aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 12:30:40 +0000
committer(no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4>2004-02-18 12:30:40 +0000
commit692cdb3dbecebdff7f3c49e9d571829441926fbd (patch)
treef6b9eb85daaa8bb260ca27d9f1b81487bdde093c
parent7d60cc603c75cb116460c7cc446891bae4462cb2 (diff)
This commit was manufactured by cvs2svn to create tagbefore-merge-3_4-csl-arm
'before-merge-3_4-csl-arm'. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/tags/before-merge-3_4-csl-arm@78026 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--ChangeLog61
-rw-r--r--MAINTAINERS7
-rw-r--r--Makefile.in88
-rw-r--r--Makefile.tpl10
-rw-r--r--boehm-gc/ChangeLog4
-rw-r--r--boehm-gc/include/private/gcconfig.h11
-rwxr-xr-xboehm-gc/install-sh34
-rw-r--r--boehm-gc/libtool.m43398
-rwxr-xr-xboehm-gc/mkinstalldirs81
-rwxr-xr-xconfig.sub12
-rwxr-xr-xconfigure71
-rw-r--r--configure.in5
-rw-r--r--contrib/ChangeLog25
-rwxr-xr-xcontrib/gcc_update22
-rw-r--r--fastjar/.cvsignore3
-rw-r--r--fastjar/ChangeLog23
-rw-r--r--fastjar/Makefile.am37
-rw-r--r--fastjar/Makefile.in889
-rw-r--r--fastjar/aclocal.m4924
-rw-r--r--fastjar/config.h.in103
-rwxr-xr-xfastjar/configure6504
-rwxr-xr-xfastjar/install-sh8
-rw-r--r--gcc/.cvsignore7
-rw-r--r--gcc/ChangeLog4439
-rw-r--r--gcc/ChangeLog.72
-rw-r--r--gcc/Makefile.in283
-rw-r--r--gcc/README.Portability214
-rw-r--r--gcc/aclocal.m451
-rw-r--r--gcc/ada/.cvsignore6
-rw-r--r--gcc/ada/35soccon.ads158
-rw-r--r--gcc/ada/3ssoliop.ads2
-rw-r--r--gcc/ada/3vtrasym.adb271
-rw-r--r--gcc/ada/45intnam.ads136
-rw-r--r--gcc/ada/52osinte.ads2
-rw-r--r--gcc/ada/53osinte.ads4
-rw-r--r--gcc/ada/54osinte.ads4
-rw-r--r--gcc/ada/55osinte.adb108
-rw-r--r--gcc/ada/55osinte.ads632
-rw-r--r--gcc/ada/55system.ads4
-rw-r--r--gcc/ada/56osinte.ads2
-rw-r--r--gcc/ada/56system.ads150
-rw-r--r--gcc/ada/5aml-tgt.adb2
-rw-r--r--gcc/ada/5asystem.ads4
-rw-r--r--gcc/ada/5bml-tgt.adb10
-rw-r--r--gcc/ada/5bosinte.ads3
-rw-r--r--gcc/ada/5cosinte.ads2
-rw-r--r--gcc/ada/5gml-tgt.adb2
-rw-r--r--gcc/ada/5gsystem.ads2
-rw-r--r--gcc/ada/5hml-tgt.adb2
-rw-r--r--gcc/ada/5hosinte.ads1
-rw-r--r--gcc/ada/5iosinte.ads2
-rw-r--r--gcc/ada/5lintman.adb401
-rw-r--r--gcc/ada/5lml-tgt.adb2
-rw-r--r--gcc/ada/5losinte.ads4
-rw-r--r--gcc/ada/5nsystem.ads150
-rw-r--r--gcc/ada/5posinte.ads6
-rw-r--r--gcc/ada/5sml-tgt.adb2
-rw-r--r--gcc/ada/5tosinte.ads4
-rw-r--r--gcc/ada/5vml-tgt.adb117
-rw-r--r--gcc/ada/5vsymbol.adb243
-rw-r--r--gcc/ada/5vtraent.adb19
-rw-r--r--gcc/ada/5vtraent.ads29
-rw-r--r--gcc/ada/5wml-tgt.adb2
-rw-r--r--gcc/ada/5wosinte.ads2
-rw-r--r--gcc/ada/5wsystem.ads2
-rw-r--r--gcc/ada/5wtaprop.adb14
-rw-r--r--gcc/ada/5zinit.adb72
-rw-r--r--gcc/ada/5zintman.adb65
-rw-r--r--gcc/ada/5zintman.ads123
-rw-r--r--gcc/ada/5zml-tgt.adb2
-rw-r--r--gcc/ada/5ztaprop.adb15
-rw-r--r--gcc/ada/5zthrini.adb113
-rw-r--r--gcc/ada/6vcstrea.adb18
-rw-r--r--gcc/ada/7sinmaop.adb13
-rw-r--r--gcc/ada/7sintman.adb15
-rw-r--r--gcc/ada/7sosprim.adb6
-rw-r--r--gcc/ada/ChangeLog1776
-rw-r--r--gcc/ada/Make-lang.in3847
-rw-r--r--gcc/ada/Makefile.generic6
-rw-r--r--gcc/ada/Makefile.in361
-rw-r--r--gcc/ada/Makefile.prolog1
-rw-r--r--gcc/ada/Makefile.rtl5
-rw-r--r--gcc/ada/a-direio.adb3
-rw-r--r--gcc/ada/a-elchha.adb165
-rw-r--r--gcc/ada/a-elchha.ads (renamed from gcc/ada/5ztiitho.adb)38
-rw-r--r--gcc/ada/a-except.adb2
-rw-r--r--gcc/ada/a-exexda.adb29
-rw-r--r--gcc/ada/a-exextr.adb101
-rw-r--r--gcc/ada/a-sequio.adb5
-rw-r--r--gcc/ada/a-ststio.adb6
-rw-r--r--gcc/ada/a-textio.adb3
-rw-r--r--gcc/ada/a-tiinau.adb5
-rw-r--r--gcc/ada/a-witeio.adb5
-rw-r--r--gcc/ada/ada-tree.def10
-rw-r--r--gcc/ada/ada-tree.h32
-rw-r--r--gcc/ada/adadecode.c31
-rw-r--r--gcc/ada/adaint.c61
-rw-r--r--gcc/ada/adaint.h1
-rw-r--r--gcc/ada/argv.c20
-rw-r--r--gcc/ada/atree.adb58
-rw-r--r--gcc/ada/aux-io.c61
-rw-r--r--gcc/ada/back_end.adb8
-rw-r--r--gcc/ada/bindgen.adb35
-rw-r--r--gcc/ada/bld-io.adb16
-rw-r--r--gcc/ada/bld.adb31
-rw-r--r--gcc/ada/cal.c4
-rw-r--r--gcc/ada/checks.adb25
-rw-r--r--gcc/ada/cio.c19
-rw-r--r--gcc/ada/comperr.adb29
-rw-r--r--gcc/ada/cstand.adb319
-rw-r--r--gcc/ada/cstreams.c16
-rw-r--r--gcc/ada/ctrl_c.c4
-rw-r--r--gcc/ada/cuintp.c6
-rw-r--r--gcc/ada/debug.adb4
-rw-r--r--gcc/ada/decl.c348
-rw-r--r--gcc/ada/einfo.adb34
-rw-r--r--gcc/ada/einfo.ads42
-rw-r--r--gcc/ada/einfo.h1814
-rw-r--r--gcc/ada/errno.c7
-rw-r--r--gcc/ada/errout.adb6
-rw-r--r--gcc/ada/exit.c5
-rw-r--r--gcc/ada/exp_aggr.adb618
-rw-r--r--gcc/ada/exp_attr.adb5
-rw-r--r--gcc/ada/exp_ch3.adb64
-rw-r--r--gcc/ada/exp_ch3.ads19
-rw-r--r--gcc/ada/exp_ch4.adb111
-rw-r--r--gcc/ada/exp_ch5.adb176
-rw-r--r--gcc/ada/exp_ch6.adb221
-rw-r--r--gcc/ada/exp_ch7.adb80
-rw-r--r--gcc/ada/exp_ch9.adb215
-rw-r--r--gcc/ada/exp_ch9.ads11
-rw-r--r--gcc/ada/exp_disp.adb3
-rw-r--r--gcc/ada/exp_util.adb2
-rw-r--r--gcc/ada/expect.c8
-rw-r--r--gcc/ada/final.c2
-rw-r--r--gcc/ada/fmap.adb2
-rw-r--r--gcc/ada/freeze.adb70
-rw-r--r--gcc/ada/g-awk.adb10
-rw-r--r--gcc/ada/g-debpoo.adb3
-rw-r--r--gcc/ada/g-debuti.adb16
-rw-r--r--gcc/ada/g-dirope.adb8
-rw-r--r--gcc/ada/g-memdum.adb2
-rw-r--r--gcc/ada/g-os_lib.adb107
-rw-r--r--gcc/ada/g-os_lib.ads57
-rw-r--r--gcc/ada/g-signal.adb (renamed from gcc/ada/5ytiitho.adb)63
-rw-r--r--gcc/ada/g-signal.ads (renamed from gcc/ada/s-tpae65.ads)51
-rw-r--r--gcc/ada/g-socket.ads15
-rw-r--r--gcc/ada/g-spipat.adb48
-rw-r--r--gcc/ada/g-table.adb4
-rw-r--r--gcc/ada/g-thread.adb12
-rw-r--r--gcc/ada/gigi.h304
-rw-r--r--gcc/ada/gmem.c5
-rw-r--r--gcc/ada/gnat1drv.adb2
-rw-r--r--gcc/ada/gnat_ug.texi2
-rw-r--r--gcc/ada/gnat_ug_unx.texi2
-rw-r--r--gcc/ada/gnat_ug_vms.texi2
-rw-r--r--gcc/ada/gnat_ug_vxw.texi2
-rw-r--r--gcc/ada/gnat_ug_wnt.texi2
-rw-r--r--gcc/ada/gnat_wrapper.adb121
-rw-r--r--gcc/ada/gnatbind.adb2
-rw-r--r--gcc/ada/gnatbl.c23
-rw-r--r--gcc/ada/gnatchop.adb55
-rw-r--r--gcc/ada/gnatlbr.adb12
-rw-r--r--gcc/ada/gnatlink.adb23
-rw-r--r--gcc/ada/gnatmem.adb2
-rw-r--r--gcc/ada/gnatpsta.adb373
-rw-r--r--gcc/ada/gnatsym.adb76
-rw-r--r--gcc/ada/gnatvsn.adb9
-rw-r--r--gcc/ada/gnatvsn.ads29
-rw-r--r--gcc/ada/gnatxref.adb13
-rw-r--r--gcc/ada/gprcmd.adb52
-rw-r--r--gcc/ada/i-cstrea.adb4
-rw-r--r--gcc/ada/i-cstrea.ads102
-rw-r--r--gcc/ada/i-vthrea.adb386
-rw-r--r--gcc/ada/i-vthrea.ads93
-rw-r--r--gcc/ada/impunit.adb1
-rw-r--r--gcc/ada/init.c366
-rw-r--r--gcc/ada/itypes.adb5
-rw-r--r--gcc/ada/lang-specs.h1
-rw-r--r--gcc/ada/lang.opt6
-rw-r--r--gcc/ada/lib-load.adb28
-rw-r--r--gcc/ada/lib-writ.adb17
-rw-r--r--gcc/ada/lib.adb31
-rw-r--r--gcc/ada/lib.ads26
-rw-r--r--gcc/ada/link.c9
-rw-r--r--gcc/ada/make.adb223
-rw-r--r--gcc/ada/mdll-utl.adb6
-rw-r--r--gcc/ada/misc.c138
-rw-r--r--gcc/ada/mkdir.c3
-rw-r--r--gcc/ada/mlib-prj.adb46
-rw-r--r--gcc/ada/mlib-tgt.adb2
-rw-r--r--gcc/ada/mlib-tgt.ads21
-rw-r--r--gcc/ada/nmake.adb2858
-rw-r--r--gcc/ada/nmake.ads1347
-rw-r--r--gcc/ada/opt.adb7
-rw-r--r--gcc/ada/opt.ads5
-rw-r--r--gcc/ada/osint.adb268
-rw-r--r--gcc/ada/osint.ads19
-rw-r--r--gcc/ada/output.adb10
-rw-r--r--gcc/ada/par-ch10.adb13
-rw-r--r--gcc/ada/par-ch12.adb8
-rw-r--r--gcc/ada/par-ch13.adb4
-rw-r--r--gcc/ada/par-ch2.adb4
-rw-r--r--gcc/ada/par-ch3.adb24
-rw-r--r--gcc/ada/par-ch4.adb53
-rw-r--r--gcc/ada/par-ch5.adb4
-rw-r--r--gcc/ada/par-ch6.adb14
-rw-r--r--gcc/ada/par-ch9.adb20
-rw-r--r--gcc/ada/par-load.adb66
-rw-r--r--gcc/ada/par-prag.adb1
-rw-r--r--gcc/ada/par-util.adb87
-rw-r--r--gcc/ada/par.adb85
-rw-r--r--gcc/ada/prj-attr.adb3
-rw-r--r--gcc/ada/prj-dect.adb32
-rw-r--r--gcc/ada/prj-env.adb23
-rw-r--r--gcc/ada/prj-env.ads22
-rw-r--r--gcc/ada/prj-nmsc.adb367
-rw-r--r--gcc/ada/prj-part.adb448
-rw-r--r--gcc/ada/prj-part.ads6
-rw-r--r--gcc/ada/prj-pp.adb133
-rw-r--r--gcc/ada/prj-proc.adb120
-rw-r--r--gcc/ada/prj-tree.adb967
-rw-r--r--gcc/ada/prj-tree.ads342
-rw-r--r--gcc/ada/prj.adb20
-rw-r--r--gcc/ada/prj.ads45
-rw-r--r--gcc/ada/raise.c105
-rw-r--r--gcc/ada/rtsfind.adb5
-rw-r--r--gcc/ada/rtsfind.ads13
-rw-r--r--gcc/ada/s-crtl.ads159
-rw-r--r--gcc/ada/s-direio.adb6
-rw-r--r--gcc/ada/s-exnint.adb6
-rw-r--r--gcc/ada/s-exnint.ads5
-rw-r--r--gcc/ada/s-fileio.adb7
-rw-r--r--gcc/ada/s-geveop.adb6
-rw-r--r--gcc/ada/s-interr.adb4
-rw-r--r--gcc/ada/s-memcop.ads28
-rw-r--r--gcc/ada/s-memory.adb21
-rw-r--r--gcc/ada/s-rident.ads1
-rw-r--r--gcc/ada/s-stache.adb23
-rw-r--r--gcc/ada/s-tasdeb.adb20
-rw-r--r--gcc/ada/s-taskin.adb4
-rw-r--r--gcc/ada/s-tassta.adb3
-rw-r--r--gcc/ada/s-thread.adb69
-rw-r--r--gcc/ada/s-thread.ads93
-rw-r--r--gcc/ada/s-tpae65.adb87
-rw-r--r--gcc/ada/scans.ads18
-rw-r--r--gcc/ada/scn.adb24
-rw-r--r--gcc/ada/scng.adb29
-rw-r--r--gcc/ada/scng.ads6
-rw-r--r--gcc/ada/sem_aggr.adb229
-rw-r--r--gcc/ada/sem_attr.adb40
-rw-r--r--gcc/ada/sem_cat.adb2
-rw-r--r--gcc/ada/sem_ch10.adb568
-rw-r--r--gcc/ada/sem_ch12.adb142
-rw-r--r--gcc/ada/sem_ch13.adb226
-rw-r--r--gcc/ada/sem_ch13.ads9
-rw-r--r--gcc/ada/sem_ch3.adb97
-rw-r--r--gcc/ada/sem_ch4.adb17
-rw-r--r--gcc/ada/sem_ch5.adb111
-rw-r--r--gcc/ada/sem_ch6.adb142
-rw-r--r--gcc/ada/sem_ch8.adb44
-rw-r--r--gcc/ada/sem_ch8.ads8
-rw-r--r--gcc/ada/sem_ch9.adb1
-rw-r--r--gcc/ada/sem_elab.adb83
-rw-r--r--gcc/ada/sem_prag.adb129
-rw-r--r--gcc/ada/sem_res.adb64
-rw-r--r--gcc/ada/sem_type.adb19
-rw-r--r--gcc/ada/sem_util.adb10
-rw-r--r--gcc/ada/sem_warn.adb8
-rw-r--r--gcc/ada/sinfo.adb29
-rw-r--r--gcc/ada/sinfo.ads62
-rw-r--r--gcc/ada/sinfo.h840
-rw-r--r--gcc/ada/sinput-p.adb5
-rw-r--r--gcc/ada/sinput.adb20
-rw-r--r--gcc/ada/snames.adb8
-rw-r--r--gcc/ada/snames.ads1191
-rw-r--r--gcc/ada/snames.h25
-rw-r--r--gcc/ada/socket.c41
-rw-r--r--gcc/ada/sprint.adb29
-rw-r--r--gcc/ada/stamp-xgnatug (renamed from fastjar/stamp-h.in)0
-rw-r--r--gcc/ada/stringt.h12
-rw-r--r--gcc/ada/switch-c.adb45
-rw-r--r--gcc/ada/symbols.adb14
-rw-r--r--gcc/ada/symbols.ads26
-rw-r--r--gcc/ada/sysdep.c118
-rw-r--r--gcc/ada/targparm.ads6
-rw-r--r--gcc/ada/targtyps.c45
-rw-r--r--gcc/ada/tb-alvms.c293
-rw-r--r--gcc/ada/tb-alvxw.c92
-rw-r--r--gcc/ada/tracebak.c17
-rw-r--r--gcc/ada/trans.c292
-rw-r--r--gcc/ada/treeprs.ads796
-rw-r--r--gcc/ada/types.ads7
-rw-r--r--gcc/ada/usage.adb7
-rw-r--r--gcc/ada/utils.c337
-rw-r--r--gcc/ada/utils2.c178
-rw-r--r--gcc/ada/vms_conv.adb1321
-rw-r--r--gcc/ada/vms_conv.ads9
-rw-r--r--gcc/ada/vms_data.ads53
-rw-r--r--gcc/ada/xref_lib.adb35
-rw-r--r--gcc/alias.c2
-rw-r--r--gcc/alloc-pool.c2
-rw-r--r--gcc/basic-block.h57
-rw-r--r--gcc/bb-reorder.c22
-rw-r--r--gcc/bitmap.c2
-rw-r--r--gcc/bitmap.h2
-rw-r--r--gcc/bt-load.c27
-rw-r--r--gcc/builtins.c67
-rw-r--r--gcc/c-common.c96
-rw-r--r--gcc/c-common.h21
-rw-r--r--gcc/c-cppbuiltin.c18
-rw-r--r--gcc/c-decl.c304
-rw-r--r--gcc/c-format.c30
-rw-r--r--gcc/c-incpath.c4
-rw-r--r--gcc/c-objc-common.c38
-rw-r--r--gcc/c-opts.c41
-rw-r--r--gcc/c-parse.in90
-rw-r--r--gcc/c-pch.c33
-rw-r--r--gcc/c-pragma.c2
-rw-r--r--gcc/c-pretty-print.c10
-rw-r--r--gcc/c-semantics.c4
-rw-r--r--gcc/c-tree.h29
-rw-r--r--gcc/c-typeck.c69
-rw-r--r--gcc/caller-save.c18
-rw-r--r--gcc/calls.c159
-rw-r--r--gcc/cfg.c4
-rw-r--r--gcc/cfganal.c26
-rw-r--r--gcc/cfgbuild.c21
-rw-r--r--gcc/cfgcleanup.c154
-rw-r--r--gcc/cfghooks.h2
-rw-r--r--gcc/cfglayout.c50
-rw-r--r--gcc/cfglayout.h4
-rw-r--r--gcc/cfgloop.c43
-rw-r--r--gcc/cfgloop.h17
-rw-r--r--gcc/cfgloopanal.c375
-rw-r--r--gcc/cfgloopmanip.c139
-rw-r--r--gcc/cfgrtl.c308
-rw-r--r--gcc/cgraph.c85
-rw-r--r--gcc/cgraph.h4
-rw-r--r--gcc/cgraphunit.c20
-rw-r--r--gcc/collect2.c367
-rw-r--r--gcc/combine.c77
-rw-r--r--gcc/common.opt32
-rw-r--r--gcc/config.gcc70
-rwxr-xr-xgcc/config.guess4
-rw-r--r--gcc/config.in12
-rw-r--r--gcc/config/alpha/alpha-modes.def2
-rw-r--r--gcc/config/alpha/alpha-protos.h1
-rw-r--r--gcc/config/alpha/alpha.c78
-rw-r--r--gcc/config/alpha/alpha.h6
-rw-r--r--gcc/config/alpha/alpha.md30
-rw-r--r--gcc/config/alpha/elf.h6
-rw-r--r--gcc/config/alpha/gnu.h5
-rw-r--r--gcc/config/alpha/lib1funcs.asm2
-rw-r--r--gcc/config/alpha/linux.h2
-rw-r--r--gcc/config/alpha/openbsd.h2
-rw-r--r--gcc/config/alpha/osf.h7
-rw-r--r--gcc/config/alpha/unicosmk.h6
-rw-r--r--gcc/config/alpha/vms-cc.c10
-rw-r--r--gcc/config/alpha/vms-crt0-64.c2
-rw-r--r--gcc/config/alpha/vms-crt0.c2
-rw-r--r--gcc/config/alpha/vms-ld.c12
-rw-r--r--gcc/config/alpha/vms-psxcrt0-64.c2
-rw-r--r--gcc/config/alpha/vms-psxcrt0.c2
-rw-r--r--gcc/config/alpha/vms.h6
-rw-r--r--gcc/config/arc/arc-protos.h81
-rw-r--r--gcc/config/arc/arc.c229
-rw-r--r--gcc/config/arc/arc.h1
-rw-r--r--gcc/config/arc/initfini.c8
-rw-r--r--gcc/config/arm/aof.h27
-rw-r--r--gcc/config/arm/aout.h27
-rw-r--r--gcc/config/arm/arm-cores.def87
-rw-r--r--gcc/config/arm/arm-generic.md152
-rw-r--r--gcc/config/arm/arm-modes.def2
-rw-r--r--gcc/config/arm/arm-protos.h23
-rw-r--r--gcc/config/arm/arm.c1849
-rw-r--r--gcc/config/arm/arm.h424
-rw-r--r--gcc/config/arm/arm.md1554
-rw-r--r--gcc/config/arm/arm1026ejs.md241
-rw-r--r--gcc/config/arm/arm1136jfs.md377
-rw-r--r--gcc/config/arm/arm926ejs.md188
-rw-r--r--gcc/config/arm/cirrus.md88
-rw-r--r--gcc/config/arm/elf.h4
-rw-r--r--gcc/config/arm/fpa.md172
-rw-r--r--gcc/config/arm/iwmmxt.md18
-rw-r--r--gcc/config/arm/lib1funcs.asm48
-rw-r--r--gcc/config/arm/linux-elf.h14
-rw-r--r--gcc/config/arm/netbsd-elf.h13
-rw-r--r--gcc/config/arm/pe.h8
-rw-r--r--gcc/config/arm/semi.h3
-rw-r--r--gcc/config/arm/vfp.md744
-rw-r--r--gcc/config/arm/vxworks.h2
-rw-r--r--gcc/config/avr/avr.c77
-rw-r--r--gcc/config/avr/avr.h35
-rw-r--r--gcc/config/avr/avr.md4
-rw-r--r--gcc/config/c4x/c4x.c2
-rw-r--r--gcc/config/c4x/c4x.md8
-rw-r--r--gcc/config/cris/cris.h6
-rw-r--r--gcc/config/cris/cris.md6
-rw-r--r--gcc/config/cris/linux.h8
-rw-r--r--gcc/config/d30v/d30v-protos.h177
-rw-r--r--gcc/config/d30v/d30v.c25
-rw-r--r--gcc/config/d30v/d30v.h7
-rw-r--r--gcc/config/darwin-protos.h1
-rw-r--r--gcc/config/darwin.c26
-rw-r--r--gcc/config/darwin.h9
-rw-r--r--gcc/config/dsp16xx/dsp16xx-protos.h112
-rw-r--r--gcc/config/dsp16xx/dsp16xx.c12
-rw-r--r--gcc/config/dsp16xx/dsp16xx.h2
-rw-r--r--gcc/config/elfos.h4
-rw-r--r--gcc/config/fr30/fr30-protos.h38
-rw-r--r--gcc/config/fr30/fr30.c99
-rw-r--r--gcc/config/fr30/fr30.h2
-rw-r--r--gcc/config/fr30/fr30.md2
-rw-r--r--gcc/config/frv/frv-protos.h315
-rw-r--r--gcc/config/frv/frv.c1062
-rw-r--r--gcc/config/frv/frv.h15
-rw-r--r--gcc/config/frv/frv.md52
-rw-r--r--gcc/config/frv/frvbegin.c10
-rw-r--r--gcc/config/gnu.h12
-rw-r--r--gcc/config/h8300/h8300-protos.h1
-rw-r--r--gcc/config/h8300/h8300.c36
-rw-r--r--gcc/config/h8300/h8300.h36
-rw-r--r--gcc/config/h8300/h8300.md525
-rw-r--r--gcc/config/h8300/lib1funcs.asm164
-rw-r--r--gcc/config/h8300/t-h83003
-rw-r--r--gcc/config/i370/i370-protos.h40
-rw-r--r--gcc/config/i370/i370.c22
-rw-r--r--gcc/config/i370/linux.h8
-rw-r--r--gcc/config/i386/athlon.md4
-rw-r--r--gcc/config/i386/cygming.h4
-rw-r--r--gcc/config/i386/gnu.h9
-rw-r--r--gcc/config/i386/i386-interix.h14
-rw-r--r--gcc/config/i386/i386-modes.def16
-rw-r--r--gcc/config/i386/i386-protos.h1
-rw-r--r--gcc/config/i386/i386.c334
-rw-r--r--gcc/config/i386/i386.h123
-rw-r--r--gcc/config/i386/i386.md1330
-rw-r--r--gcc/config/i386/i386elf.h8
-rw-r--r--gcc/config/i386/linux-aout.h5
-rw-r--r--gcc/config/i386/linux.h5
-rw-r--r--gcc/config/i386/linux64.h5
-rw-r--r--gcc/config/i386/ptx4-i.h8
-rw-r--r--gcc/config/i386/sco5.h3
-rw-r--r--gcc/config/i386/scodbx.h84
-rw-r--r--gcc/config/i386/sysv4.h8
-rw-r--r--gcc/config/i386/x86-64.h1
-rw-r--r--gcc/config/i386/xm-dgux.h4
-rw-r--r--gcc/config/i386/xm-sun.h21
-rw-r--r--gcc/config/i386/xm-sysv3.h3
-rw-r--r--gcc/config/i860/i860-protos.h4
-rw-r--r--gcc/config/i860/i860.c8
-rw-r--r--gcc/config/i860/i860.h4
-rw-r--r--gcc/config/i960/i960-protos.h117
-rw-r--r--gcc/config/i960/i960.c28
-rw-r--r--gcc/config/i960/i960.h4
-rw-r--r--gcc/config/ia64/fde-glibc.c4
-rw-r--r--gcc/config/ia64/hpux.h6
-rw-r--r--gcc/config/ia64/ia64.c273
-rw-r--r--gcc/config/ia64/ia64.h33
-rw-r--r--gcc/config/ia64/ia64.md488
-rw-r--r--gcc/config/ia64/linux.h103
-rw-r--r--gcc/config/ia64/sysv4.h4
-rw-r--r--gcc/config/ia64/t-ia642
-rw-r--r--gcc/config/ia64/unwind-ia64.c150
-rw-r--r--gcc/config/ip2k/ip2k-protos.h103
-rw-r--r--gcc/config/ip2k/ip2k.c326
-rw-r--r--gcc/config/ip2k/ip2k.md2
-rw-r--r--gcc/config/iq2000/iq2000-protos.h62
-rw-r--r--gcc/config/iq2000/iq2000.c712
-rw-r--r--gcc/config/iq2000/iq2000.h497
-rw-r--r--gcc/config/kfreebsdgnu.h2
-rw-r--r--gcc/config/linux.h10
-rw-r--r--gcc/config/m32r/m32r-protos.h115
-rw-r--r--gcc/config/m32r/m32r.c549
-rw-r--r--gcc/config/m32r/m32r.h50
-rw-r--r--gcc/config/m32r/m32r.md53
-rw-r--r--gcc/config/m32r/t-m32r6
-rw-r--r--gcc/config/m68hc11/m68hc11-protos.h186
-rw-r--r--gcc/config/m68hc11/m68hc11.c442
-rw-r--r--gcc/config/m68hc11/m68hc11.h2
-rw-r--r--gcc/config/m68k/linux.h6
-rw-r--r--gcc/config/m68k/m68k.c992
-rw-r--r--gcc/config/m68k/m68k.h25
-rw-r--r--gcc/config/m68k/m68k.md685
-rw-r--r--gcc/config/m68k/m68kelf.h9
-rw-r--r--gcc/config/m68k/netbsd-elf.h3
-rw-r--r--gcc/config/m68k/rtemself.h2
-rw-r--r--gcc/config/m68k/uclinux.h4
-rw-r--r--gcc/config/mcore/mcore-elf.h3
-rw-r--r--gcc/config/mips/_tilib.c2
-rw-r--r--gcc/config/mips/iris6.h29
-rw-r--r--gcc/config/mips/iris6gld.h11
-rw-r--r--gcc/config/mips/irix6-crti.asm33
-rw-r--r--gcc/config/mips/irix6-crtn.asm27
-rw-r--r--gcc/config/mips/irix6-libc-compat.c82
-rw-r--r--gcc/config/mips/linux.h5
-rw-r--r--gcc/config/mips/mips-protos.h9
-rw-r--r--gcc/config/mips/mips.c1745
-rw-r--r--gcc/config/mips/mips.h27
-rw-r--r--gcc/config/mips/mips.md234
-rw-r--r--gcc/config/mips/t-iris610
-rw-r--r--gcc/config/mips/t-iris6gld9
-rw-r--r--gcc/config/mn10300/linux.h11
-rw-r--r--gcc/config/mn10300/mn10300-protos.h60
-rw-r--r--gcc/config/mn10300/mn10300.c135
-rw-r--r--gcc/config/netware.h1
-rw-r--r--gcc/config/ns32k/ns32k-protos.h32
-rw-r--r--gcc/config/ns32k/ns32k.c116
-rw-r--r--gcc/config/ns32k/ns32k.h9
-rw-r--r--gcc/config/pa/pa-linux.h10
-rw-r--r--gcc/config/pa/pa-protos.h8
-rw-r--r--gcc/config/pa/pa.c685
-rw-r--r--gcc/config/pa/pa.h592
-rw-r--r--gcc/config/pa/pa.md1910
-rw-r--r--gcc/config/pa/som.h6
-rw-r--r--gcc/config/ptx4.h1
-rw-r--r--gcc/config/rs6000/aix.h5
-rw-r--r--gcc/config/rs6000/altivec.h8
-rw-r--r--gcc/config/rs6000/altivec.md90
-rw-r--r--gcc/config/rs6000/darwin.h8
-rw-r--r--gcc/config/rs6000/linux64.h6
-rw-r--r--gcc/config/rs6000/rs6000-protos.h11
-rw-r--r--gcc/config/rs6000/rs6000.c1140
-rw-r--r--gcc/config/rs6000/rs6000.h168
-rw-r--r--gcc/config/rs6000/rs6000.md448
-rw-r--r--gcc/config/rs6000/sysv4.h78
-rw-r--r--gcc/config/rs6000/t-darwin1
-rw-r--r--gcc/config/s390/linux.h6
-rw-r--r--gcc/config/s390/s390-protos.h11
-rw-r--r--gcc/config/s390/s390.c644
-rw-r--r--gcc/config/s390/s390.h56
-rw-r--r--gcc/config/s390/s390.md581
-rw-r--r--gcc/config/sh/linux.h2
-rw-r--r--gcc/config/sh/netbsd-elf.h2
-rw-r--r--gcc/config/sh/sh-protos.h6
-rw-r--r--gcc/config/sh/sh.c136
-rw-r--r--gcc/config/sh/sh.h10
-rw-r--r--gcc/config/sh/sh.md75
-rw-r--r--gcc/config/sol2.h7
-rw-r--r--gcc/config/sparc/linux.h1
-rw-r--r--gcc/config/sparc/linux64.h5
-rw-r--r--gcc/config/sparc/liteelf.h1
-rw-r--r--gcc/config/sparc/sol2-bi.h20
-rw-r--r--gcc/config/sparc/sol2-gld-bi.h25
-rw-r--r--gcc/config/sparc/sol2-gld.h3
-rw-r--r--gcc/config/sparc/sol2.h4
-rw-r--r--gcc/config/sparc/sol26-sld.h7
-rw-r--r--gcc/config/sparc/sp86x-elf.h1
-rw-r--r--gcc/config/sparc/sparc-protos.h14
-rw-r--r--gcc/config/sparc/sparc.c408
-rw-r--r--gcc/config/sparc/sparc.h8
-rw-r--r--gcc/config/sparc/sparc.md4
-rw-r--r--gcc/config/stormy16/stormy16-protos.h1
-rw-r--r--gcc/config/stormy16/stormy16.c7
-rw-r--r--gcc/config/stormy16/stormy16.h5
-rw-r--r--gcc/config/t-darwin2
-rw-r--r--gcc/config/t-libunwind6
-rw-r--r--gcc/config/t-slibgcc-darwin30
-rw-r--r--gcc/config/v850/v850.c6
-rw-r--r--gcc/config/v850/v850.h2
-rw-r--r--gcc/config/v850/v850.md14
-rw-r--r--gcc/config/vax/vax.c3
-rw-r--r--gcc/config/vax/vax.h18
-rw-r--r--gcc/config/vxlib.c2
-rw-r--r--gcc/config/vxworks.h1
-rw-r--r--gcc/config/xtensa/elf.h2
-rw-r--r--gcc/config/xtensa/linux.h8
-rw-r--r--gcc/config/xtensa/xtensa-protos.h3
-rw-r--r--gcc/config/xtensa/xtensa.c78
-rw-r--r--gcc/config/xtensa/xtensa.h70
-rwxr-xr-xgcc/configure863
-rw-r--r--gcc/configure.in110
-rw-r--r--gcc/conflict.c6
-rw-r--r--gcc/coverage.c52
-rw-r--r--gcc/cp/ChangeLog754
-rw-r--r--gcc/cp/ChangeLog.14
-rw-r--r--gcc/cp/ChangeLog.26
-rw-r--r--gcc/cp/Make-lang.in61
-rw-r--r--gcc/cp/call.c154
-rw-r--r--gcc/cp/class.c83
-rw-r--r--gcc/cp/cp-lang.c14
-rw-r--r--gcc/cp/cp-tree.h72
-rw-r--r--gcc/cp/cvt.c26
-rw-r--r--gcc/cp/cxx-pretty-print.c6
-rw-r--r--gcc/cp/decl.c344
-rw-r--r--gcc/cp/decl2.c69
-rw-r--r--gcc/cp/dump.c5
-rw-r--r--gcc/cp/error.c14
-rw-r--r--gcc/cp/except.c11
-rw-r--r--gcc/cp/expr.c4
-rw-r--r--gcc/cp/friend.c102
-rw-r--r--gcc/cp/g++spec.c7
-rw-r--r--gcc/cp/init.c89
-rw-r--r--gcc/cp/lex.c35
-rw-r--r--gcc/cp/mangle.c205
-rw-r--r--gcc/cp/method.c26
-rw-r--r--gcc/cp/name-lookup.c183
-rw-r--r--gcc/cp/name-lookup.h4
-rw-r--r--gcc/cp/optimize.c1
-rw-r--r--gcc/cp/parser.c1507
-rw-r--r--gcc/cp/pt.c301
-rw-r--r--gcc/cp/ptree.c2
-rw-r--r--gcc/cp/repo.c14
-rw-r--r--gcc/cp/rtti.c2
-rw-r--r--gcc/cp/search.c14
-rw-r--r--gcc/cp/semantics.c79
-rw-r--r--gcc/cp/tree.c99
-rw-r--r--gcc/cp/typeck.c149
-rw-r--r--gcc/cp/typeck2.c23
-rw-r--r--gcc/cppcharset.c58
-rw-r--r--gcc/cpperror.c20
-rw-r--r--gcc/cppexp.c61
-rw-r--r--gcc/cppfiles.c84
-rw-r--r--gcc/cpphash.h2
-rw-r--r--gcc/cppinit.c17
-rw-r--r--gcc/cpplex.c36
-rw-r--r--gcc/cpplib.c129
-rw-r--r--gcc/cpplib.h22
-rw-r--r--gcc/cppmacro.c50
-rw-r--r--gcc/cpppch.c19
-rw-r--r--gcc/cpptrad.c24
-rw-r--r--gcc/crtstuff.c14
-rw-r--r--gcc/cse.c14
-rw-r--r--gcc/dbxout.c27
-rw-r--r--gcc/defaults.h17
-rw-r--r--gcc/df.c46
-rw-r--r--gcc/diagnostic.c2
-rw-r--r--gcc/doc/.cvsignore7
-rw-r--r--gcc/doc/c-tree.texi23
-rw-r--r--gcc/doc/contrib.texi15
-rw-r--r--gcc/doc/cpp.texi2
-rw-r--r--gcc/doc/cppopts.texi2
-rw-r--r--gcc/doc/extend.texi104
-rw-r--r--gcc/doc/gcov.texi32
-rw-r--r--gcc/doc/gty.texi29
-rw-r--r--gcc/doc/include/gcc-common.texi4
-rw-r--r--gcc/doc/install-old.texi523
-rw-r--r--gcc/doc/install.texi137
-rw-r--r--gcc/doc/invoke.texi465
-rw-r--r--gcc/doc/makefile.texi5
-rw-r--r--gcc/doc/md.texi56
-rw-r--r--gcc/doc/passes.texi51
-rw-r--r--gcc/doc/sourcebuild.texi45
-rw-r--r--gcc/doc/tm.texi68
-rw-r--r--gcc/dojump.c15
-rw-r--r--gcc/dominance.c346
-rw-r--r--gcc/doschk.c360
-rw-r--r--gcc/dwarf2out.c221
-rw-r--r--gcc/dwarfout.c6396
-rw-r--r--gcc/emit-rtl.c333
-rw-r--r--gcc/et-forest.c1090
-rw-r--r--gcc/et-forest.h44
-rw-r--r--gcc/except.c6
-rw-r--r--gcc/explow.c2
-rw-r--r--gcc/expmed.c28
-rw-r--r--gcc/expr.c191
-rw-r--r--gcc/expr.h1
-rw-r--r--gcc/f/.cvsignore2
-rw-r--r--gcc/f/ChangeLog63
-rw-r--r--gcc/f/Make-lang.in67
-rw-r--r--gcc/f/com.c34
-rw-r--r--gcc/f/expr.c18
-rw-r--r--gcc/f/intdoc.in4
-rw-r--r--gcc/f/intdoc.texi4
-rw-r--r--gcc/final.c39
-rw-r--r--gcc/fix-header.c2
-rw-r--r--gcc/fixinc/fixincl.x100
-rw-r--r--gcc/fixinc/inclhack.def38
-rw-r--r--gcc/fixinc/tests/base/wchar.h15
-rw-r--r--gcc/flags.h4
-rw-r--r--gcc/flow.c232
-rw-r--r--gcc/fold-const.c40
-rw-r--r--gcc/function.c239
-rw-r--r--gcc/function.h20
-rw-r--r--gcc/future.options40
-rw-r--r--gcc/gcc.c57
-rw-r--r--gcc/gcov.c2
-rw-r--r--gcc/gcse.c313
-rw-r--r--gcc/genattrtab.c552
-rw-r--r--gcc/genautomata.c2
-rw-r--r--gcc/genemit.c16
-rw-r--r--gcc/gengtype-lex.l4
-rw-r--r--gcc/gengtype.c8
-rw-r--r--gcc/genmodes.c74
-rw-r--r--gcc/genmultilib7
-rw-r--r--gcc/genrecog.c20
-rw-r--r--gcc/gensupport.c4
-rw-r--r--gcc/ggc-common.c8
-rw-r--r--gcc/ggc-page.c51
-rw-r--r--gcc/ggc-simple.c14
-rw-r--r--gcc/ggc-zone.c203
-rw-r--r--gcc/ggc.h13
-rw-r--r--gcc/ginclude/stddef.h21
-rw-r--r--gcc/global.c56
-rw-r--r--gcc/graph.c35
-rw-r--r--gcc/haifa-sched.c25
-rw-r--r--gcc/ifcvt.c248
-rw-r--r--gcc/integrate.c3
-rw-r--r--gcc/java/.cvsignore10
-rw-r--r--gcc/java/ChangeLog254
-rw-r--r--gcc/java/Make-lang.in143
-rw-r--r--gcc/java/class.c6
-rw-r--r--gcc/java/constants.c20
-rw-r--r--gcc/java/decl.c59
-rw-r--r--gcc/java/except.c20
-rw-r--r--gcc/java/expr.c7
-rw-r--r--gcc/java/gjavah.c8
-rw-r--r--gcc/java/java-tree.h20
-rw-r--r--gcc/java/jcf-dump.c2
-rw-r--r--gcc/java/jcf-io.c4
-rw-r--r--gcc/java/jcf-parse.c18
-rw-r--r--gcc/java/jcf-write.c10
-rw-r--r--gcc/java/keyword.h10
-rw-r--r--gcc/java/lang.c31
-rw-r--r--gcc/java/lex.h2
-rw-r--r--gcc/java/parse.y428
-rw-r--r--gcc/java/resource.c6
-rw-r--r--gcc/java/typeck.c6
-rw-r--r--gcc/java/verify.c5
-rw-r--r--gcc/langhooks-def.h2
-rw-r--r--gcc/langhooks.c4
-rw-r--r--gcc/langhooks.h2
-rw-r--r--gcc/lcm.c14
-rw-r--r--gcc/libgcc-darwin.ver213
-rw-r--r--gcc/libgcc2.c223
-rw-r--r--gcc/libgcc2.h6
-rw-r--r--gcc/line-map.c6
-rw-r--r--gcc/line-map.h14
-rw-r--r--gcc/local-alloc.c28
-rw-r--r--gcc/longlong.h2
-rw-r--r--gcc/loop-init.c5
-rw-r--r--gcc/loop-unroll.c80
-rw-r--r--gcc/loop-unswitch.c31
-rw-r--r--gcc/loop.c91
-rw-r--r--gcc/machmode.def12
-rw-r--r--gcc/machmode.h12
-rw-r--r--gcc/mklibgcc.in11
-rw-r--r--gcc/objc/.cvsignore2
-rw-r--r--gcc/objc/Make-lang.in8
-rw-r--r--gcc/objc/objc-act.c2
-rw-r--r--gcc/optabs.c2
-rw-r--r--gcc/opts.c70
-rw-r--r--gcc/params.def23
-rw-r--r--gcc/po/ChangeLog13
-rw-r--r--gcc/po/de.po875
-rw-r--r--gcc/po/exgettext2
-rw-r--r--gcc/po/gcc.pot4016
-rw-r--r--gcc/postreload.c30
-rw-r--r--gcc/predict.c94
-rw-r--r--gcc/predict.def5
-rw-r--r--gcc/predict.h5
-rw-r--r--gcc/pretty-print.c3
-rw-r--r--gcc/pretty-print.h2
-rw-r--r--gcc/print-rtl.c2
-rw-r--r--gcc/profile.c20
-rw-r--r--gcc/ra-build.c12
-rw-r--r--gcc/ra-colorize.c8
-rw-r--r--gcc/ra-debug.c11
-rw-r--r--gcc/ra-rewrite.c20
-rw-r--r--gcc/ra.c4
-rw-r--r--gcc/real.c5
-rw-r--r--gcc/recog.c227
-rw-r--r--gcc/recog.h2
-rw-r--r--gcc/reg-stack.c119
-rw-r--r--gcc/regclass.c55
-rw-r--r--gcc/regmove.c18
-rw-r--r--gcc/regrename.c37
-rw-r--r--gcc/regs.h7
-rw-r--r--gcc/reload.c53
-rw-r--r--gcc/reload1.c92
-rw-r--r--gcc/reorg.c2
-rw-r--r--gcc/resource.c29
-rw-r--r--gcc/resource.h3
-rw-r--r--gcc/rtl.c52
-rw-r--r--gcc/rtl.def32
-rw-r--r--gcc/rtl.h14
-rw-r--r--gcc/rtlanal.c6
-rw-r--r--gcc/sbitmap.c13
-rw-r--r--gcc/sched-ebb.c30
-rw-r--r--gcc/sched-rgn.c49
-rw-r--r--gcc/sched-vis.c2
-rw-r--r--gcc/sibcall.c4
-rw-r--r--gcc/simplify-rtx.c60
-rw-r--r--gcc/ssa-ccp.c1206
-rw-r--r--gcc/ssa-dce.c713
-rw-r--r--gcc/ssa.c2214
-rw-r--r--gcc/ssa.h70
-rw-r--r--gcc/stmt.c159
-rw-r--r--gcc/stor-layout.c20
-rw-r--r--gcc/system.h33
-rw-r--r--gcc/target-def.h5
-rw-r--r--gcc/target.h11
-rw-r--r--gcc/targhooks.c13
-rw-r--r--gcc/targhooks.h1
-rw-r--r--gcc/testsuite/ChangeLog1065
-rw-r--r--gcc/testsuite/g++.dg/abi/bitfield5.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/bitfield7.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/covariant2.C32
-rw-r--r--gcc/testsuite/g++.dg/abi/covariant3.C85
-rw-r--r--gcc/testsuite/g++.dg/abi/dtor2.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/macro0.C5
-rw-r--r--gcc/testsuite/g++.dg/abi/macro1.C5
-rw-r--r--gcc/testsuite/g++.dg/abi/macro2.C5
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle11.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle12.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle14.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle17.C2
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle18-1.C23
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle18-2.C23
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle19-1.C13
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle19-2.C13
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle20-1.C19
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle20-2.C16
-rw-r--r--gcc/testsuite/g++.dg/abi/mangle4.C4
-rw-r--r--gcc/testsuite/g++.dg/abi/vbase10.C7
-rw-r--r--gcc/testsuite/g++.dg/abi/vbase14.C2
-rw-r--r--gcc/testsuite/g++.dg/bprob/bprob.exp5
-rw-r--r--gcc/testsuite/g++.dg/compat/compat.exp11
-rw-r--r--gcc/testsuite/g++.dg/eh/dtor2.C30
-rw-r--r--gcc/testsuite/g++.dg/eh/ia64-1.C50
-rw-r--r--gcc/testsuite/g++.dg/eh/simd-1.C1
-rw-r--r--gcc/testsuite/g++.dg/eh/simd-2.C1
-rw-r--r--gcc/testsuite/g++.dg/expr/assign1.C34
-rw-r--r--gcc/testsuite/g++.dg/expr/sizeof1.C7
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib10.C7
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib11.C17
-rw-r--r--gcc/testsuite/g++.dg/ext/attrib9.C5
-rw-r--r--gcc/testsuite/g++.dg/ext/complit2.C25
-rw-r--r--gcc/testsuite/g++.dg/ext/cond1.C4
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-1.C8
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-2.C7
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-3.C7
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-4.C8
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-5.C11
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-6.C10
-rw-r--r--gcc/testsuite/g++.dg/ext/visibility-7.C11
-rw-r--r--gcc/testsuite/g++.dg/inherit/operator2.C22
-rw-r--r--gcc/testsuite/g++.dg/init/array12.C28
-rw-r--r--gcc/testsuite/g++.dg/init/assign1.C30
-rw-r--r--gcc/testsuite/g++.dg/init/bitfield2.C33
-rw-r--r--gcc/testsuite/g++.dg/init/cleanup1.C16
-rw-r--r--gcc/testsuite/g++.dg/init/cleanup2.C19
-rw-r--r--gcc/testsuite/g++.dg/init/error1.C7
-rw-r--r--gcc/testsuite/g++.dg/init/placement1.C10
-rw-r--r--gcc/testsuite/g++.dg/init/placement2.C22
-rw-r--r--gcc/testsuite/g++.dg/init/pm3.C10
-rw-r--r--gcc/testsuite/g++.dg/lookup/java1.C68
-rw-r--r--gcc/testsuite/g++.dg/lookup/java2.C47
-rw-r--r--gcc/testsuite/g++.dg/lookup/ns1.C22
-rw-r--r--gcc/testsuite/g++.dg/lookup/used-before-declaration.C5
-rw-r--r--gcc/testsuite/g++.dg/lookup/using5.C2
-rw-r--r--gcc/testsuite/g++.dg/lookup/using9.C30
-rw-r--r--gcc/testsuite/g++.dg/opt/const3.C44
-rw-r--r--gcc/testsuite/g++.dg/opt/expect1.C17
-rw-r--r--gcc/testsuite/g++.dg/opt/inline6.C14
-rw-r--r--gcc/testsuite/g++.dg/opt/noreturn-1.C87
-rw-r--r--gcc/testsuite/g++.dg/opt/reg-stack4.C29
-rw-r--r--gcc/testsuite/g++.dg/other/error2.C2
-rw-r--r--gcc/testsuite/g++.dg/other/java1.C22
-rw-r--r--gcc/testsuite/g++.dg/other/offsetof2.C4
-rw-r--r--gcc/testsuite/g++.dg/other/stdarg2.C12
-rw-r--r--gcc/testsuite/g++.dg/other/struct-va_list.C8
-rw-r--r--gcc/testsuite/g++.dg/parse/crash10.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/dce1.C13
-rw-r--r--gcc/testsuite/g++.dg/parse/defarg6.C11
-rw-r--r--gcc/testsuite/g++.dg/parse/error3.C6
-rw-r--r--gcc/testsuite/g++.dg/parse/error4.C7
-rw-r--r--gcc/testsuite/g++.dg/parse/error5.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error6.C6
-rw-r--r--gcc/testsuite/g++.dg/parse/error7.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error8.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/error9.C5
-rw-r--r--gcc/testsuite/g++.dg/parse/explicit1.C11
-rw-r--r--gcc/testsuite/g++.dg/parse/nontype1.C9
-rw-r--r--gcc/testsuite/g++.dg/parse/offsetof1.C11
-rw-r--r--gcc/testsuite/g++.dg/parse/offsetof2.C12
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon1.C4
-rw-r--r--gcc/testsuite/g++.dg/parse/semicolon1.h2
-rw-r--r--gcc/testsuite/g++.dg/parse/typename5.C2
-rw-r--r--gcc/testsuite/g++.dg/parse/undefined1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/access13.C16
-rw-r--r--gcc/testsuite/g++.dg/template/arg2.C2
-rw-r--r--gcc/testsuite/g++.dg/template/array1-1.C32
-rw-r--r--gcc/testsuite/g++.dg/template/array1-2.C32
-rw-r--r--gcc/testsuite/g++.dg/template/array2-1.C14
-rw-r--r--gcc/testsuite/g++.dg/template/array2-2.C14
-rw-r--r--gcc/testsuite/g++.dg/template/crash13.C4
-rw-r--r--gcc/testsuite/g++.dg/template/crash14.C3
-rw-r--r--gcc/testsuite/g++.dg/template/crash15.C9
-rw-r--r--gcc/testsuite/g++.dg/template/dependent-expr3.C14
-rw-r--r--gcc/testsuite/g++.dg/template/eh1.C6
-rw-r--r--gcc/testsuite/g++.dg/template/error10.C70
-rw-r--r--gcc/testsuite/g++.dg/template/error3.C5
-rw-r--r--gcc/testsuite/g++.dg/template/error4.C8
-rw-r--r--gcc/testsuite/g++.dg/template/error5.C6
-rw-r--r--gcc/testsuite/g++.dg/template/error6.C13
-rw-r--r--gcc/testsuite/g++.dg/template/error7.C6
-rw-r--r--gcc/testsuite/g++.dg/template/error8.C7
-rw-r--r--gcc/testsuite/g++.dg/template/error9.C7
-rw-r--r--gcc/testsuite/g++.dg/template/instantiate5.C24
-rw-r--r--gcc/testsuite/g++.dg/template/lookup3.C16
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend1.C54
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend2.C61
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend3.C55
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend4.C63
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend5.C31
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend6.C23
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend7.C133
-rw-r--r--gcc/testsuite/g++.dg/template/memfriend8.C25
-rw-r--r--gcc/testsuite/g++.dg/template/nested3.C8
-rw-r--r--gcc/testsuite/g++.dg/template/nontype3.C37
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem7.C29
-rw-r--r--gcc/testsuite/g++.dg/template/ptrmem8.C20
-rw-r--r--gcc/testsuite/g++.dg/template/qualttp17.C2
-rw-r--r--gcc/testsuite/g++.dg/template/recurse1.C16
-rw-r--r--gcc/testsuite/g++.dg/template/static2.C2
-rw-r--r--gcc/testsuite/g++.dg/template/static5.C17
-rw-r--r--gcc/testsuite/g++.dg/template/template-id-2.C22
-rw-r--r--gcc/testsuite/g++.dg/template/ttp3.C2
-rw-r--r--gcc/testsuite/g++.dg/template/type1.C2
-rw-r--r--gcc/testsuite/g++.dg/template/using8.C22
-rw-r--r--gcc/testsuite/g++.dg/warn/ctor-init-1.C9
-rw-r--r--gcc/testsuite/g++.dg/warn/format3.C12
-rw-r--r--gcc/testsuite/g++.dg/warn/noreturn-3.C13
-rw-r--r--gcc/testsuite/g++.old-deja/g++.brendan/ns1.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C20
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template18.C18
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/template37.C40
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk2.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.jason/thunk3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.law/profile1.C3
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/access11.C4
-rw-r--r--gcc/testsuite/g++.old-deja/g++.other/crash32.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/asm1.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/defarg8.C6
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/explicit71.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/friend44.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static11.C9
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.robertl/eb42.C19
-rw-r--r--gcc/testsuite/g77.dg/12632.f6
-rw-r--r--gcc/testsuite/g77.dg/bprob/bprob.exp5
-rw-r--r--gcc/testsuite/g77.f-torture/compile/13060.f13
-rw-r--r--gcc/testsuite/g77.f-torture/execute/10197.x13
-rw-r--r--gcc/testsuite/g77.f-torture/execute/13037.f58
-rw-r--r--gcc/testsuite/g77.f-torture/execute/20001201.x3
-rw-r--r--gcc/testsuite/g77.f-torture/execute/6367.x3
-rw-r--r--gcc/testsuite/g77.f-torture/execute/io0.x3
-rw-r--r--gcc/testsuite/g77.f-torture/execute/io1.x3
-rw-r--r--gcc/testsuite/g77.f-torture/execute/u77-test.x3
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/200031109-1.c11
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020604-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20020910-1.c7
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-1.c66
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-2.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-3.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031023-4.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031031-1.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031031-2.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031102-1.c12
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031112-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031113-1.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031208-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031220-1.c21
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031220-2.c44
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/20031227-1.c17
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/920625-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/930217-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/930513-1.c6
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/961203-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/980506-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/981006-1.c2
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/981223-1.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/libcall-1.c14
-rw-r--r--gcc/testsuite/gcc.c-torture/compile/simd-5.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20020227-1.x4
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20020720-1.x2
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031201-1.c76
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031204-1.c49
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031214-1.c32
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031215-1.c38
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/20031216-1.c23
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/920908-2.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/921204-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/930621-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/930630-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/931031-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/980602-2.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/compndlit-1.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/extzvsi.c10
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c29
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/loop-2e.x7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/loop-2f.x9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/loop-2g.x9
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c36
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c29
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/simd-4.x13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x7
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/va-arg-25.c3
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/va-arg-25.x13
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c8
-rw-r--r--gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x3
-rw-r--r--gcc/testsuite/gcc.c-torture/unsorted/ext.c10
-rw-r--r--gcc/testsuite/gcc.dg/20020201-2.c30
-rw-r--r--gcc/testsuite/gcc.dg/20020201-4.c16
-rw-r--r--gcc/testsuite/gcc.dg/20020304-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/20020312-2.c6
-rw-r--r--gcc/testsuite/gcc.dg/20021014-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/20030926-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/20031102-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/20031108-1.c35
-rw-r--r--gcc/testsuite/gcc.dg/20031111-1.c13
-rw-r--r--gcc/testsuite/gcc.dg/20031201-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/20031201-2.c41
-rw-r--r--gcc/testsuite/gcc.dg/20031202-1.c44
-rw-r--r--gcc/testsuite/gcc.dg/20031216-1.c37
-rw-r--r--gcc/testsuite/gcc.dg/20031218-1.c19
-rw-r--r--gcc/testsuite/gcc.dg/20031218-2.c12
-rw-r--r--gcc/testsuite/gcc.dg/20031218-3.c12
-rw-r--r--gcc/testsuite/gcc.dg/20031222-1.c18
-rw-r--r--gcc/testsuite/gcc.dg/20031223-1.c11
-rw-r--r--gcc/testsuite/gcc.dg/altivec-10.c86
-rw-r--r--gcc/testsuite/gcc.dg/altivec-varargs-1.c90
-rw-r--r--gcc/testsuite/gcc.dg/arm-g2.c19
-rw-r--r--gcc/testsuite/gcc.dg/arm-scd42-1.c15
-rw-r--r--gcc/testsuite/gcc.dg/arm-scd42-2.c17
-rw-r--r--gcc/testsuite/gcc.dg/arm-scd42-3.c15
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-1.c3
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-7.c8
-rw-r--r--gcc/testsuite/gcc.dg/bitfld-8.c7
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply2.c30
-rw-r--r--gcc/testsuite/gcc.dg/builtin-apply3.c31
-rw-r--r--gcc/testsuite/gcc.dg/builtin-return-1.c26
-rw-r--r--gcc/testsuite/gcc.dg/builtins-18.c8
-rw-r--r--gcc/testsuite/gcc.dg/builtins-20.c6
-rw-r--r--gcc/testsuite/gcc.dg/builtins-config.h29
-rw-r--r--gcc/testsuite/gcc.dg/c90-const-expr-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/c99-const-expr-2.c8
-rw-r--r--gcc/testsuite/gcc.dg/cast-function-1.c49
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-10.c114
-rw-r--r--gcc/testsuite/gcc.dg/cleanup-11.c114
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1_x.c1
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-1_y.c1
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2_x.c1
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-2_y.c1
-rw-r--r--gcc/testsuite/gcc.dg/compat/vector-check.h2
-rw-r--r--gcc/testsuite/gcc.dg/complex-1.c31
-rw-r--r--gcc/testsuite/gcc.dg/compound-lvalue-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/cond-lvalue-1.c12
-rw-r--r--gcc/testsuite/gcc.dg/const-elim-1.c5
-rw-r--r--gcc/testsuite/gcc.dg/cpp/assert4.c436
-rw-r--r--gcc/testsuite/gcc.dg/cpp/lexident.c2
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/macro.c11
-rw-r--r--gcc/testsuite/gcc.dg/cpp/trad/xwin1.c13
-rw-r--r--gcc/testsuite/gcc.dg/darwin-abi-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/darwin-misaligned.c32
-rw-r--r--gcc/testsuite/gcc.dg/debug/debug-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/debug/debug-2.c4
-rw-r--r--gcc/testsuite/gcc.dg/debug/debug-7.c16
-rw-r--r--gcc/testsuite/gcc.dg/format/c90-strftime-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/c90-strftime-2.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/c99-strftime-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/ext-1.c14
-rw-r--r--gcc/testsuite/gcc.dg/format/ext-3.c2
-rw-r--r--gcc/testsuite/gcc.dg/format/no-y2k-1.c4
-rw-r--r--gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c3
-rw-r--r--gcc/testsuite/gcc.dg/intermod-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/macho-lo-sum.c29
-rw-r--r--gcc/testsuite/gcc.dg/nest.c3
-rw-r--r--gcc/testsuite/gcc.dg/nested-func-1.c35
-rw-r--r--gcc/testsuite/gcc.dg/noreturn-7.c42
-rw-r--r--gcc/testsuite/gcc.dg/null-pointer-1.c20
-rw-r--r--gcc/testsuite/gcc.dg/overflow-1.c25
-rw-r--r--gcc/testsuite/gcc.dg/pch/warn-1.c2
-rw-r--r--gcc/testsuite/gcc.dg/ppc-stackalign-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/tls/asm-1.c7
-rw-r--r--gcc/testsuite/gcc.dg/trampoline-1.c50
-rw-r--r--gcc/testsuite/gcc.dg/unaligned-1.c49
-rw-r--r--gcc/testsuite/gcc.dg/uninit-C.c2
-rw-r--r--gcc/testsuite/gcc.dg/unused-4.c2
-rw-r--r--gcc/testsuite/gcc.dg/visibility-1.c9
-rw-r--r--gcc/testsuite/gcc.dg/visibility-2.c10
-rw-r--r--gcc/testsuite/gcc.dg/visibility-3.c8
-rw-r--r--gcc/testsuite/gcc.dg/visibility-4.c10
-rw-r--r--gcc/testsuite/gcc.dg/visibility-5.c12
-rw-r--r--gcc/testsuite/gcc.dg/visibility-6.c11
-rw-r--r--gcc/testsuite/gcc.dg/visibility-7.c12
-rw-r--r--gcc/testsuite/gcc.dg/warn-1.c6
-rw-r--r--gcc/testsuite/gcc.misc-tests/bprob.exp6
-rw-r--r--gcc/testsuite/lib/compat.exp28
-rw-r--r--gcc/testsuite/lib/g++.exp19
-rw-r--r--gcc/testsuite/lib/g77.exp3
-rw-r--r--gcc/testsuite/lib/gcc-dg.exp63
-rw-r--r--gcc/testsuite/lib/gcc.exp2
-rw-r--r--gcc/testsuite/lib/objc.exp3
-rw-r--r--gcc/testsuite/lib/target-supports.exp48
-rw-r--r--gcc/testsuite/objc.dg/proto-lossage-3.m25
-rw-r--r--gcc/timevar.def4
-rw-r--r--gcc/tlink.c13
-rw-r--r--gcc/toplev.c208
-rw-r--r--gcc/toplev.h3
-rw-r--r--gcc/tracer.c11
-rw-r--r--gcc/tree-dump.c2
-rw-r--r--gcc/tree-inline.c84
-rw-r--r--gcc/tree-optimize.c15
-rw-r--r--gcc/tree.c24
-rw-r--r--gcc/tree.def14
-rw-r--r--gcc/tree.h41
-rw-r--r--gcc/treelang/.cvsignore5
-rw-r--r--gcc/treelang/ChangeLog34
-rw-r--r--gcc/treelang/Make-lang.in35
-rw-r--r--gcc/treelang/lex.l2
-rw-r--r--gcc/treelang/treelang.texi84
-rw-r--r--gcc/tsystem.h4
-rw-r--r--gcc/unroll.c20
-rw-r--r--gcc/unwind-dw2-fde-darwin.c50
-rw-r--r--gcc/unwind-dw2-fde-glibc.c8
-rw-r--r--gcc/unwind-dw2-fde.c86
-rw-r--r--gcc/unwind-dw2-fde.h28
-rw-r--r--gcc/unwind-dw2.c15
-rw-r--r--gcc/unwind-libunwind.c26
-rw-r--r--gcc/unwind-pe.h8
-rw-r--r--gcc/unwind-sjlj.c6
-rw-r--r--gcc/value-prof.c8
-rw-r--r--gcc/varasm.c68
-rw-r--r--gcc/version.c4
-rw-r--r--gcc/web.c49
-rw-r--r--gcc/xcoff.h (renamed from gcc/dbxstclass.h)0
-rw-r--r--gcc/xcoffout.c2
-rw-r--r--include/ChangeLog24
-rw-r--r--include/fibheap.h5
-rw-r--r--include/libiberty.h59
-rw-r--r--libffi/ChangeLog202
-rw-r--r--libffi/Makefile.in134
-rw-r--r--libffi/acinclude.m489
-rw-r--r--libffi/aclocal.m4105
-rwxr-xr-xlibffi/configure323
-rw-r--r--libffi/configure.in13
-rw-r--r--libffi/fficonfig.h.in9
-rw-r--r--libffi/include/Makefile.am5
-rw-r--r--libffi/include/Makefile.in83
-rw-r--r--libffi/src/prep_cif.c6
-rw-r--r--libffi/src/x86/ffi.c8
-rw-r--r--libffi/testsuite/Makefile.in2
-rw-r--r--libffi/testsuite/lib/libffi-dg.exp14
-rw-r--r--libffi/testsuite/libffi.call/closure_fn0.c19
-rw-r--r--libffi/testsuite/libffi.call/closure_fn1.c20
-rw-r--r--libffi/testsuite/libffi.call/closure_fn2.c19
-rw-r--r--libffi/testsuite/libffi.call/closure_fn3.c18
-rw-r--r--libffi/testsuite/libffi.call/closure_fn4.c96
-rw-r--r--libffi/testsuite/libffi.call/closure_fn5.c99
-rw-r--r--libffi/testsuite/libffi.call/cls_12byte.c20
-rw-r--r--libffi/testsuite/libffi.call/cls_16byte.c20
-rw-r--r--libffi/testsuite/libffi.call/cls_18byte.c103
-rw-r--r--libffi/testsuite/libffi.call/cls_19byte.c109
-rw-r--r--libffi/testsuite/libffi.call/cls_1_1byte.c16
-rw-r--r--libffi/testsuite/libffi.call/cls_20byte.c20
-rw-r--r--libffi/testsuite/libffi.call/cls_20byte1.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_24byte.c29
-rw-r--r--libffi/testsuite/libffi.call/cls_2byte.c18
-rw-r--r--libffi/testsuite/libffi.call/cls_3_1byte.c22
-rw-r--r--libffi/testsuite/libffi.call/cls_3byte1.c18
-rw-r--r--libffi/testsuite/libffi.call/cls_3byte2.c18
-rw-r--r--libffi/testsuite/libffi.call/cls_4_1byte.c22
-rw-r--r--libffi/testsuite/libffi.call/cls_4byte.c18
-rw-r--r--libffi/testsuite/libffi.call/cls_5byte.c20
-rw-r--r--libffi/testsuite/libffi.call/cls_64byte.c131
-rw-r--r--libffi/testsuite/libffi.call/cls_6byte.c23
-rw-r--r--libffi/testsuite/libffi.call/cls_7byte.c22
-rw-r--r--libffi/testsuite/libffi.call/cls_8byte.c19
-rw-r--r--libffi/testsuite/libffi.call/cls_9byte1.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_9byte2.c99
-rw-r--r--libffi/testsuite/libffi.call/cls_align_double.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_float.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_longdouble.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_pointer.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_sint16.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_sint32.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_sint64.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_uint16.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_uint32.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_align_uint64.c98
-rw-r--r--libffi/testsuite/libffi.call/cls_double.c15
-rw-r--r--libffi/testsuite/libffi.call/cls_float.c18
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_schar.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_sshort.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_sshortchar.c93
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_uchar.c96
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_ushort.c81
-rw-r--r--libffi/testsuite/libffi.call/cls_multi_ushortchar.c93
-rw-r--r--libffi/testsuite/libffi.call/cls_schar.c50
-rw-r--r--libffi/testsuite/libffi.call/cls_sint.c50
-rw-r--r--libffi/testsuite/libffi.call/cls_sshort.c50
-rw-r--r--libffi/testsuite/libffi.call/cls_uchar.c14
-rw-r--r--libffi/testsuite/libffi.call/cls_uint.c14
-rw-r--r--libffi/testsuite/libffi.call/cls_ulonglong.c20
-rw-r--r--libffi/testsuite/libffi.call/cls_ushort.c14
-rw-r--r--libffi/testsuite/libffi.call/ffitest.h72
-rw-r--r--libffi/testsuite/libffi.call/many_win32.c3
-rw-r--r--libffi/testsuite/libffi.call/nested_struct.c10
-rw-r--r--libffi/testsuite/libffi.call/nested_struct1.c10
-rw-r--r--libffi/testsuite/libffi.call/nested_struct2.c127
-rw-r--r--libffi/testsuite/libffi.call/nested_struct3.c118
-rw-r--r--libffi/testsuite/libffi.call/problem1.c112
-rw-r--r--libffi/testsuite/libffi.call/return_sc.c8
-rw-r--r--libffi/testsuite/libffi.special/ffitestcxx.h69
-rw-r--r--libffi/testsuite/libffi.special/unwindtest.cc20
-rw-r--r--libiberty/ChangeLog300
-rw-r--r--libiberty/Makefile.in5
-rw-r--r--libiberty/cp-demangle.c6833
-rw-r--r--libiberty/floatformat.c187
-rw-r--r--libiberty/hashtab.c4
-rw-r--r--libiberty/lbasename.c20
-rw-r--r--libiberty/make-relative-prefix.c15
-rw-r--r--libiberty/pex-common.h3
-rw-r--r--libiberty/pex-unix.c254
-rw-r--r--libiberty/pex-win32.c515
-rw-r--r--libiberty/testsuite/Makefile.in2
-rw-r--r--libiberty/testsuite/demangle-expected114
-rw-r--r--libiberty/testsuite/test-demangle.c2
-rw-r--r--libiberty/vasprintf.c17
-rw-r--r--libjava/ChangeLog2196
-rw-r--r--libjava/Makefile.am74
-rw-r--r--libjava/Makefile.in167
-rw-r--r--libjava/aclocal.m416
-rw-r--r--libjava/boehm.cc2
-rwxr-xr-xlibjava/configure735
-rw-r--r--libjava/configure.in34
-rw-r--r--libjava/gcj/javaprims.h1
-rw-r--r--libjava/gnu/awt/gtk/GtkButtonPeer.java61
-rw-r--r--libjava/gnu/awt/gtk/GtkComponentPeer.java269
-rw-r--r--libjava/gnu/awt/gtk/GtkContainerPeer.java55
-rw-r--r--libjava/gnu/awt/gtk/GtkFramePeer.java42
-rw-r--r--libjava/gnu/awt/gtk/GtkLabelPeer.java37
-rw-r--r--libjava/gnu/awt/gtk/GtkMainThread.java36
-rw-r--r--libjava/gnu/awt/gtk/GtkToolkit.java314
-rw-r--r--libjava/gnu/awt/gtk/GtkWindowPeer.java39
-rw-r--r--libjava/gnu/awt/gtk/gtkcommon.cc14
-rw-r--r--libjava/gnu/awt/gtk/gtkcommon.h85
-rw-r--r--libjava/gnu/awt/gtk/natGtkButtonPeer.cc52
-rw-r--r--libjava/gnu/awt/gtk/natGtkComponentPeer.cc265
-rw-r--r--libjava/gnu/awt/gtk/natGtkContainerPeer.cc15
-rw-r--r--libjava/gnu/awt/gtk/natGtkFramePeer.cc51
-rw-r--r--libjava/gnu/awt/gtk/natGtkLabelPeer.cc59
-rw-r--r--libjava/gnu/awt/gtk/natGtkMainThread.cc22
-rw-r--r--libjava/gnu/awt/gtk/natGtkToolkit.cc75
-rw-r--r--libjava/gnu/awt/gtk/natGtkWindowPeer.cc40
-rw-r--r--libjava/gnu/gcj/convert/natIconv.cc4
-rw-r--r--libjava/gnu/gcj/runtime/FirstThread.java10
-rw-r--r--libjava/gnu/gcj/runtime/natNameFinder.cc4
-rw-r--r--libjava/gnu/gcj/xlib/GC.java10
-rw-r--r--libjava/gnu/gcj/xlib/XAnyEvent.java2
-rw-r--r--libjava/gnu/gcj/xlib/natGC.cc24
-rw-r--r--libjava/gnu/java/awt/image/ImageDecoder.java34
-rw-r--r--libjava/gnu/java/awt/image/XBMDecoder.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java64
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java116
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java21
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java444
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java12
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java29
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java6
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java11
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java5
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkImage.java62
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java29
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkListPeer.java43
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java3
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java2
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkToolkit.java52
-rw-r--r--libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java3
-rw-r--r--libjava/gnu/java/beans/IntrospectionIncubator.java2
-rw-r--r--libjava/gnu/java/lang/reflect/TypeSignature.java25
-rw-r--r--libjava/gnu/java/net/HeaderFieldHelper.java138
-rw-r--r--libjava/gnu/java/net/PlainDatagramSocketImpl.java17
-rw-r--r--libjava/gnu/java/net/URLParseError.java57
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc31
-rw-r--r--libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc24
-rw-r--r--libjava/gnu/java/net/natPlainSocketImplPosix.cc21
-rw-r--r--libjava/gnu/java/net/natPlainSocketImplWin32.cc83
-rw-r--r--libjava/gnu/java/net/protocol/file/Connection.java119
-rw-r--r--libjava/gnu/java/net/protocol/file/Handler.java16
-rw-r--r--libjava/gnu/java/net/protocol/http/Connection.java494
-rw-r--r--libjava/gnu/java/net/protocol/jar/Connection.java262
-rw-r--r--libjava/gnu/java/net/protocol/jar/Handler.java115
-rw-r--r--libjava/gnu/java/nio/ChannelInputStream.java79
-rw-r--r--libjava/gnu/java/nio/ChannelOutputStream.java67
-rw-r--r--libjava/gnu/java/nio/DatagramChannelImpl.java4
-rw-r--r--libjava/gnu/java/nio/FileLockImpl.java10
-rw-r--r--libjava/gnu/java/nio/InputStreamChannel.java88
-rw-r--r--libjava/gnu/java/nio/NIODatagramSocket.java2
-rw-r--r--libjava/gnu/java/nio/NIOSocket.java4
-rw-r--r--libjava/gnu/java/nio/OutputStreamChannel.java87
-rw-r--r--libjava/gnu/java/nio/SelectorImpl.java301
-rw-r--r--libjava/gnu/java/nio/ServerSocketChannelImpl.java6
-rw-r--r--libjava/gnu/java/nio/SocketChannelImpl.java10
-rw-r--r--libjava/gnu/java/nio/natPipeImplEcos.cc25
-rw-r--r--libjava/gnu/java/nio/natPipeImplPosix.cc (renamed from libjava/gnu/java/nio/natPipeImpl.cc)2
-rw-r--r--libjava/gnu/java/nio/natPipeImplWin32.cc38
-rw-r--r--libjava/gnu/java/nio/natSelectorImplEcos.cc25
-rw-r--r--libjava/gnu/java/nio/natSelectorImplPosix.cc (renamed from libjava/gnu/java/nio/natSelectorImpl.cc)68
-rw-r--r--libjava/gnu/java/nio/natSelectorImplWin32.cc93
-rw-r--r--libjava/gnu/java/rmi/server/RMIVoidValue.java51
-rw-r--r--libjava/gnu/java/rmi/server/UnicastConnectionManager.java3
-rw-r--r--libjava/gnu/java/rmi/server/UnicastRemoteCall.java99
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServer.java2
-rw-r--r--libjava/gnu/java/rmi/server/UnicastServerRef.java7
-rw-r--r--libjava/include/config.h.in3
-rw-r--r--libjava/include/jni.h33
-rw-r--r--libjava/include/win32.h92
-rw-r--r--libjava/java/awt/Choice.java50
-rw-r--r--libjava/java/awt/Component.java42
-rw-r--r--libjava/java/awt/FlowLayout.java3
-rw-r--r--libjava/java/awt/Font.java3
-rw-r--r--libjava/java/awt/GridBagLayout.java20
-rw-r--r--libjava/java/awt/List.java19
-rw-r--r--libjava/java/awt/MediaTracker.java4
-rw-r--r--libjava/java/awt/MenuComponent.java5
-rw-r--r--libjava/java/awt/MenuItem.java6
-rw-r--r--libjava/java/awt/Polygon.java2
-rw-r--r--libjava/java/awt/TextComponent.java10
-rw-r--r--libjava/java/awt/datatransfer/DataFlavor.java5
-rw-r--r--libjava/java/awt/datatransfer/StringSelection.java12
-rw-r--r--libjava/java/awt/font/TextLayout.java160
-rw-r--r--libjava/java/awt/geom/CubicCurve2D.java1019
-rw-r--r--libjava/java/awt/geom/FlatteningPathIterator.java526
-rw-r--r--libjava/java/awt/geom/QuadCurve2D.java202
-rw-r--r--libjava/java/awt/geom/doc-files/CubicCurve2D-1.pngbin0 -> 6280 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/CubicCurve2D-2.pngbin0 -> 5791 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/CubicCurve2D-3.pngbin0 -> 13168 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/CubicCurve2D-4.pngbin0 -> 7839 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/CubicCurve2D-5.pngbin0 -> 5112 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html481
-rw-r--r--libjava/java/awt/geom/doc-files/QuadCurve2D-4.pngbin0 -> 7797 bytes
-rw-r--r--libjava/java/awt/geom/doc-files/QuadCurve2D-5.pngbin0 -> 4757 bytes
-rw-r--r--libjava/java/awt/image/ImageConsumer.java46
-rw-r--r--libjava/java/awt/image/ImagingOpException.java4
-rw-r--r--libjava/java/awt/image/PixelGrabber.java948
-rw-r--r--libjava/java/beans/BeanDescriptor.java2
-rw-r--r--libjava/java/beans/EventSetDescriptor.java7
-rw-r--r--libjava/java/beans/FeatureDescriptor.java3
-rw-r--r--libjava/java/beans/IndexedPropertyDescriptor.java4
-rw-r--r--libjava/java/beans/Introspector.java10
-rw-r--r--libjava/java/beans/MethodDescriptor.java2
-rw-r--r--libjava/java/beans/PropertyDescriptor.java4
-rw-r--r--libjava/java/beans/SimpleBeanInfo.java3
-rw-r--r--libjava/java/beans/beancontext/BeanContextServicesSupport.java2
-rw-r--r--libjava/java/io/BufferedReader.java34
-rw-r--r--libjava/java/io/ByteArrayOutputStream.java2
-rw-r--r--libjava/java/io/CharArrayReader.java2
-rw-r--r--libjava/java/io/FileInputStream.java15
-rw-r--r--libjava/java/io/FilePermission.java3
-rw-r--r--libjava/java/io/LineNumberReader.java138
-rw-r--r--libjava/java/io/ObjectInputStream.java1293
-rw-r--r--libjava/java/io/ObjectOutputStream.java679
-rw-r--r--libjava/java/io/ObjectStreamClass.java819
-rw-r--r--libjava/java/io/ObjectStreamField.java171
-rw-r--r--libjava/java/io/PrintStream.java197
-rw-r--r--libjava/java/io/StreamTokenizer.java22
-rw-r--r--libjava/java/io/natFileDescriptorWin32.cc16
-rw-r--r--libjava/java/io/natFileWin32.cc72
-rw-r--r--libjava/java/lang/Class.h2
-rw-r--r--libjava/java/lang/Float.java15
-rw-r--r--libjava/java/lang/Win32Process.java16
-rw-r--r--libjava/java/lang/natClass.cc17
-rw-r--r--libjava/java/lang/natDouble.cc2
-rw-r--r--libjava/java/lang/natPosixProcess.cc4
-rw-r--r--libjava/java/lang/natRuntime.cc4
-rw-r--r--libjava/java/lang/natWin32Process.cc219
-rw-r--r--libjava/java/lang/reflect/natMethod.cc6
-rw-r--r--libjava/java/math/BigInteger.java2
-rw-r--r--libjava/java/net/DatagramPacket.java98
-rw-r--r--libjava/java/net/DatagramSocket.java407
-rw-r--r--libjava/java/net/Inet4Address.java4
-rw-r--r--libjava/java/net/Inet6Address.java2
-rw-r--r--libjava/java/net/InetAddress.java5
-rw-r--r--libjava/java/net/InetSocketAddress.java33
-rw-r--r--libjava/java/net/JarURLConnection.java228
-rw-r--r--libjava/java/net/MulticastSocket.java113
-rw-r--r--libjava/java/net/ServerSocket.java108
-rw-r--r--libjava/java/net/Socket.java328
-rw-r--r--libjava/java/net/SocketPermission.java3
-rw-r--r--libjava/java/net/URL.java71
-rw-r--r--libjava/java/net/URLStreamHandler.java73
-rw-r--r--libjava/java/net/natNetworkInterfaceWin32.cc10
-rw-r--r--libjava/java/nio/ByteBuffer.java3
-rw-r--r--libjava/java/nio/channels/Channels.java22
-rw-r--r--libjava/java/nio/channels/FileChannelImpl.java4
-rw-r--r--libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java11
-rw-r--r--libjava/java/nio/channels/spi/AbstractSelector.java11
-rw-r--r--libjava/java/rmi/MarshalledObject.java2
-rw-r--r--libjava/java/rmi/Naming.java33
-rw-r--r--libjava/java/rmi/server/RMIClassLoader.java3
-rw-r--r--libjava/java/security/DigestInputStream.java4
-rw-r--r--libjava/java/security/Security.java2
-rw-r--r--libjava/java/security/cert/CertStore.java3
-rw-r--r--libjava/java/sql/Timestamp.java38
-rw-r--r--libjava/java/text/DateFormat.java105
-rw-r--r--libjava/java/text/DecimalFormat.java26
-rw-r--r--libjava/java/text/DecimalFormatSymbols.java40
-rw-r--r--libjava/java/text/FieldPosition.java78
-rw-r--r--libjava/java/text/Format.java23
-rw-r--r--libjava/java/text/FormatCharacterIterator.java469
-rw-r--r--libjava/java/text/MessageFormat.java20
-rw-r--r--libjava/java/text/NumberFormat.java208
-rw-r--r--libjava/java/text/SimpleDateFormat.java7
-rw-r--r--libjava/java/util/Calendar.java6
-rw-r--r--libjava/java/util/Currency.java189
-rw-r--r--libjava/java/util/GregorianCalendar.java10
-rw-r--r--libjava/java/util/HashMap.java17
-rw-r--r--libjava/java/util/Hashtable.java52
-rw-r--r--libjava/java/util/IdentityHashMap.java5
-rw-r--r--libjava/java/util/SimpleTimeZone.java32
-rw-r--r--libjava/java/util/TimeZone.java18
-rw-r--r--libjava/java/util/jar/JarInputStream.java1
-rw-r--r--libjava/java/util/logging/logging.properties8
-rw-r--r--libjava/java/util/prefs/AbstractPreferences.java10
-rw-r--r--libjava/java/util/prefs/Preferences.java2
-rw-r--r--libjava/java/util/zip/DeflaterOutputStream.java30
-rw-r--r--libjava/java/util/zip/ZipFile.java6
-rw-r--r--libjava/javax/naming/CompoundName.java2
-rw-r--r--libjava/javax/naming/InitialContext.java23
-rw-r--r--libjava/javax/naming/directory/Attribute.java5
-rw-r--r--libjava/javax/naming/directory/Attributes.java4
-rw-r--r--libjava/javax/naming/directory/DirContext.java5
-rw-r--r--libjava/javax/naming/directory/InitialDirContext.java8
-rw-r--r--libjava/javax/naming/directory/SearchResult.java3
-rw-r--r--libjava/javax/naming/event/EventContext.java5
-rw-r--r--libjava/javax/naming/event/EventDirContext.java38
-rw-r--r--libjava/javax/naming/event/NamingEvent.java3
-rw-r--r--libjava/javax/naming/event/NamingExceptionEvent.java5
-rw-r--r--libjava/javax/naming/ldap/ControlFactory.java5
-rw-r--r--libjava/javax/naming/ldap/ExtendedRequest.java3
-rw-r--r--libjava/javax/naming/ldap/HasControls.java3
-rw-r--r--libjava/javax/naming/ldap/InitialLdapContext.java7
-rw-r--r--libjava/javax/naming/ldap/LdapContext.java5
-rw-r--r--libjava/javax/naming/ldap/LdapReferralException.java5
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotification.java3
-rw-r--r--libjava/javax/naming/ldap/UnsolicitedNotificationListener.java3
-rw-r--r--libjava/javax/naming/spi/DirObjectFactory.java6
-rw-r--r--libjava/javax/naming/spi/DirStateFactory.java7
-rw-r--r--libjava/javax/naming/spi/DirectoryManager.java14
-rw-r--r--libjava/javax/naming/spi/NamingManager.java23
-rw-r--r--libjava/javax/naming/spi/ObjectFactoryBuilder.java3
-rw-r--r--libjava/javax/naming/spi/ResolveResult.java7
-rw-r--r--libjava/javax/naming/spi/Resolver.java4
-rw-r--r--libjava/javax/naming/spi/StateFactory.java5
-rw-r--r--libjava/javax/print/attribute/AttributeSetUtilities.java445
-rw-r--r--libjava/javax/print/attribute/DateTimeSyntax.java101
-rw-r--r--libjava/javax/print/attribute/DocAttribute.java45
-rw-r--r--libjava/javax/print/attribute/DocAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/EnumSyntax.java146
-rw-r--r--libjava/javax/print/attribute/HashAttributeSet.java366
-rw-r--r--libjava/javax/print/attribute/HashDocAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintJobAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintRequestAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/HashPrintServiceAttributeSet.java94
-rw-r--r--libjava/javax/print/attribute/IntegerSyntax.java122
-rw-r--r--libjava/javax/print/attribute/PrintJobAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintJobAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/PrintRequestAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintServiceAttribute.java45
-rw-r--r--libjava/javax/print/attribute/PrintServiceAttributeSet.java55
-rw-r--r--libjava/javax/print/attribute/ResolutionSyntax.java220
-rw-r--r--libjava/javax/print/attribute/SetOfIntegerSyntax.java253
-rw-r--r--libjava/javax/print/attribute/Size2DSyntax.java225
-rw-r--r--libjava/javax/print/attribute/SupportedValuesAttribute.java45
-rw-r--r--libjava/javax/print/attribute/TextSyntax.java118
-rw-r--r--libjava/javax/print/attribute/URISyntax.java112
-rw-r--r--libjava/javax/print/attribute/UnmodifiableSetException.java65
-rw-r--r--libjava/javax/swing/BoxLayout.java318
-rw-r--r--libjava/javax/swing/JFrame.java2
-rw-r--r--libjava/javax/swing/JLayeredPane.java343
-rw-r--r--libjava/javax/swing/JRootPane.java2
-rw-r--r--libjava/javax/swing/UIDefaults.java303
-rw-r--r--libjava/javax/swing/UIManager.java20
-rw-r--r--libjava/javax/swing/plaf/basic/BasicDefaults.java43
-rw-r--r--libjava/javax/swing/undo/AbstractUndoableEdit.java323
-rw-r--r--libjava/javax/swing/undo/CannotRedoException.java32
-rw-r--r--libjava/javax/swing/undo/CannotUndoException.java33
-rw-r--r--libjava/javax/swing/undo/CompoundEdit.java590
-rw-r--r--libjava/javax/swing/undo/StateEdit.java160
-rw-r--r--libjava/javax/swing/undo/StateEditable.java73
-rw-r--r--libjava/jni.cc14
-rw-r--r--libjava/jni/gtk-peer/gdkfont.h93
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c9
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c93
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c78
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c173
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c153
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c2
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c38
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c26
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c62
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c6
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c85
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c623
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c9
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c62
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c141
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c9
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c28
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c7
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c39
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c43
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c12
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c64
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c5
-rw-r--r--libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c41
-rw-r--r--libjava/jni/gtk-peer/gtkpeer.h26
-rw-r--r--libjava/libltdl/.cvsignore1
-rw-r--r--libjava/libltdl/Makefile.am8
-rw-r--r--libjava/libltdl/Makefile.in714
-rw-r--r--libjava/libltdl/README1
-rw-r--r--libjava/libltdl/acconfig.h15
-rw-r--r--libjava/libltdl/acinclude.m46538
-rw-r--r--libjava/libltdl/aclocal.m47412
-rw-r--r--libjava/libltdl/config-h.in193
-rwxr-xr-xlibjava/libltdl/config.guess1415
-rw-r--r--libjava/libltdl/config.h.in98
-rwxr-xr-xlibjava/libltdl/config.sub1510
-rwxr-xr-xlibjava/libltdl/configure23560
-rw-r--r--libjava/libltdl/configure.ac80
-rw-r--r--libjava/libltdl/configure.in63
-rwxr-xr-xlibjava/libltdl/install-sh294
-rw-r--r--libjava/libltdl/ltdl.c5534
-rw-r--r--libjava/libltdl/ltdl.h425
-rw-r--r--libjava/libltdl/ltmain.sh6322
-rwxr-xr-xlibjava/libltdl/missing (renamed from fastjar/missing)168
-rwxr-xr-xlibjava/libltdl/mkinstalldirs (renamed from fastjar/mkinstalldirs)0
-rw-r--r--libjava/libltdl/stamp-h.in1
-rw-r--r--libjava/mauve-libgcj6
-rw-r--r--libjava/sysdep/sparc/locks.h4
-rw-r--r--libjava/testsuite/ChangeLog59
-rw-r--r--libjava/testsuite/lib/libjava.exp32
-rw-r--r--libjava/testsuite/libjava.compile/InnerExcept.java19
-rw-r--r--libjava/testsuite/libjava.compile/PR12374.java27
-rw-r--r--libjava/testsuite/libjava.compile/PR12857.java4
-rw-r--r--libjava/testsuite/libjava.compile/PR13024.java18
-rw-r--r--libjava/testsuite/libjava.compile/PR13237.java3
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.exp1
-rw-r--r--libjava/testsuite/libjava.jacks/jacks.xfail30
-rw-r--r--libjava/testsuite/libjava.jni/jniutf.c10
-rw-r--r--libjava/testsuite/libjava.jni/jniutf.java16
-rw-r--r--libjava/testsuite/libjava.jni/jniutf.out0
-rw-r--r--libjava/testsuite/libjava.lang/PR12915.java6
-rw-r--r--libjava/testsuite/libjava.lang/PR12915.out1
-rw-r--r--libjava/testsuite/libjava.mauve/xfails68
-rw-r--r--libjava/verify.cc13
-rw-r--r--libjava/win32-threads.cc21
-rw-r--r--libjava/win32.cc282
-rw-r--r--libobjc/ChangeLog15
-rw-r--r--libobjc/Protocol.m22
-rw-r--r--libstdc++-v3/ChangeLog1633
-rw-r--r--libstdc++-v3/Makefile.am4
-rw-r--r--libstdc++-v3/Makefile.in69
-rw-r--r--libstdc++-v3/acconfig.h6
-rw-r--r--libstdc++-v3/acinclude.m450
-rw-r--r--libstdc++-v3/aclocal.m454
-rw-r--r--libstdc++-v3/config.h.in9
-rw-r--r--libstdc++-v3/config/cpu/alpha/atomicity.h6
-rw-r--r--libstdc++-v3/config/cpu/cris/atomicity.h13
-rw-r--r--libstdc++-v3/config/cpu/generic/atomicity.h14
-rw-r--r--libstdc++-v3/config/cpu/hppa/atomicity.h4
-rw-r--r--libstdc++-v3/config/cpu/i386/atomicity.h23
-rw-r--r--libstdc++-v3/config/cpu/i486/atomicity.h13
-rw-r--r--libstdc++-v3/config/cpu/ia64/atomicity.h10
-rw-r--r--libstdc++-v3/config/cpu/m68k/atomicity.h27
-rw-r--r--libstdc++-v3/config/cpu/mips/atomicity.h10
-rw-r--r--libstdc++-v3/config/cpu/powerpc/atomicity.h30
-rw-r--r--libstdc++-v3/config/cpu/s390/atomicity.h18
-rw-r--r--libstdc++-v3/config/cpu/sparc/atomicity.h44
-rw-r--r--libstdc++-v3/config/io/basic_file_stdio.cc17
-rw-r--r--libstdc++-v3/config/io/basic_file_stdio.h4
-rw-r--r--libstdc++-v3/config/linker-map.gnu25
-rw-r--r--libstdc++-v3/config/locale/generic/c_locale.cc85
-rw-r--r--libstdc++-v3/config/locale/generic/codecvt_members.cc57
-rw-r--r--libstdc++-v3/config/locale/generic/ctype_members.cc79
-rw-r--r--libstdc++-v3/config/locale/gnu/c_locale.cc86
-rw-r--r--libstdc++-v3/config/locale/gnu/codecvt_members.cc204
-rw-r--r--libstdc++-v3/config/locale/gnu/ctype_members.cc106
-rw-r--r--libstdc++-v3/config/locale/gnu/monetary_members.cc67
-rw-r--r--libstdc++-v3/config/os/aix/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/djgpp/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/generic/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/gnu-linux/ctype_noninline.h16
-rw-r--r--libstdc++-v3/config/os/hpux/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/mingw32/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/newlib/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/vxworks/ctype_noninline.h14
-rw-r--r--libstdc++-v3/config/os/windiss/ctype_noninline.h14
-rwxr-xr-xlibstdc++-v3/configure445
-rw-r--r--libstdc++-v3/configure.ac9
-rw-r--r--libstdc++-v3/configure.host2
-rw-r--r--libstdc++-v3/crossconfig.m44
-rw-r--r--libstdc++-v3/docs/doxygen/TODO2
-rw-r--r--libstdc++-v3/docs/html/17_intro/C++STYLE20
-rw-r--r--libstdc++-v3/docs/html/17_intro/TODO30
-rw-r--r--libstdc++-v3/docs/html/17_intro/configury.html7
-rw-r--r--libstdc++-v3/docs/html/17_intro/contribute.html6
-rw-r--r--libstdc++-v3/docs/html/17_intro/howto.html22
-rw-r--r--libstdc++-v3/docs/html/17_intro/license.html4
-rw-r--r--libstdc++-v3/docs/html/18_support/howto.html12
-rw-r--r--libstdc++-v3/docs/html/19_diagnostics/howto.html12
-rw-r--r--libstdc++-v3/docs/html/20_util/howto.html12
-rw-r--r--libstdc++-v3/docs/html/21_strings/howto.html32
-rw-r--r--libstdc++-v3/docs/html/22_locale/codecvt.html7
-rw-r--r--libstdc++-v3/docs/html/22_locale/ctype.html7
-rw-r--r--libstdc++-v3/docs/html/22_locale/howto.html20
-rw-r--r--libstdc++-v3/docs/html/22_locale/locale.html7
-rw-r--r--libstdc++-v3/docs/html/22_locale/messages.html7
-rw-r--r--libstdc++-v3/docs/html/23_containers/howto.html12
-rw-r--r--libstdc++-v3/docs/html/24_iterators/howto.html12
-rw-r--r--libstdc++-v3/docs/html/25_algorithms/howto.html12
-rw-r--r--libstdc++-v3/docs/html/26_numerics/howto.html12
-rw-r--r--libstdc++-v3/docs/html/27_io/howto.html14
-rw-r--r--libstdc++-v3/docs/html/configopts.html3
-rw-r--r--libstdc++-v3/docs/html/debug.html287
-rw-r--r--libstdc++-v3/docs/html/debug_mode.html590
-rw-r--r--libstdc++-v3/docs/html/documentation.html5
-rw-r--r--libstdc++-v3/docs/html/explanations.html3
-rw-r--r--libstdc++-v3/docs/html/ext/howto.html69
-rw-r--r--libstdc++-v3/docs/html/ext/lwg-active.html6978
-rw-r--r--libstdc++-v3/docs/html/ext/lwg-defects.html4658
-rw-r--r--libstdc++-v3/docs/html/ext/sgiexts.html9
-rw-r--r--libstdc++-v3/docs/html/faq/index.html22
-rw-r--r--libstdc++-v3/docs/html/faq/index.txt693
-rw-r--r--libstdc++-v3/docs/html/install.html3
-rw-r--r--libstdc++-v3/docs/html/test.html20
-rw-r--r--libstdc++-v3/include/Makefile.am44
-rw-r--r--libstdc++-v3/include/Makefile.in55
-rw-r--r--libstdc++-v3/include/backward/algo.h118
-rw-r--r--libstdc++-v3/include/backward/algobase.h26
-rw-r--r--libstdc++-v3/include/backward/alloc.h14
-rw-r--r--libstdc++-v3/include/backward/complex.h6
-rw-r--r--libstdc++-v3/include/backward/defalloc.h22
-rw-r--r--libstdc++-v3/include/backward/function.h114
-rw-r--r--libstdc++-v3/include/backward/iterator.h4
-rw-r--r--libstdc++-v3/include/backward/new.h6
-rw-r--r--libstdc++-v3/include/backward/ostream.h2
-rw-r--r--libstdc++-v3/include/backward/queue.h2
-rw-r--r--libstdc++-v3/include/backward/rope.h12
-rw-r--r--libstdc++-v3/include/backward/stream.h2
-rw-r--r--libstdc++-v3/include/backward/streambuf.h2
-rw-r--r--libstdc++-v3/include/backward/strstream10
-rw-r--r--libstdc++-v3/include/backward/tempbuf.h6
-rw-r--r--libstdc++-v3/include/backward/tree.h2
-rw-r--r--libstdc++-v3/include/backward/vector.h2
-rw-r--r--libstdc++-v3/include/bits/allocator.h8
-rw-r--r--libstdc++-v3/include/bits/allocator_traits.h6
-rw-r--r--libstdc++-v3/include/bits/basic_ios.h18
-rw-r--r--libstdc++-v3/include/bits/basic_ios.tcc2
-rw-r--r--libstdc++-v3/include/bits/basic_string.h149
-rw-r--r--libstdc++-v3/include/bits/basic_string.tcc46
-rw-r--r--libstdc++-v3/include/bits/c++config26
-rw-r--r--libstdc++-v3/include/bits/concurrence.h54
-rw-r--r--libstdc++-v3/include/bits/demangle.h843
-rw-r--r--libstdc++-v3/include/bits/deque.tcc4
-rw-r--r--libstdc++-v3/include/bits/fstream.tcc325
-rw-r--r--libstdc++-v3/include/bits/ios_base.h10
-rw-r--r--libstdc++-v3/include/bits/istream.tcc604
-rw-r--r--libstdc++-v3/include/bits/list.tcc103
-rw-r--r--libstdc++-v3/include/bits/locale_classes.h197
-rw-r--r--libstdc++-v3/include/bits/locale_facets.h1126
-rw-r--r--libstdc++-v3/include/bits/locale_facets.tcc1102
-rw-r--r--libstdc++-v3/include/bits/ostream.tcc399
-rw-r--r--libstdc++-v3/include/bits/postypes.h4
-rw-r--r--libstdc++-v3/include/bits/sstream.tcc10
-rw-r--r--libstdc++-v3/include/bits/stl_algo.h142
-rw-r--r--libstdc++-v3/include/bits/stl_algobase.h21
-rw-r--r--libstdc++-v3/include/bits/stl_bvector.h94
-rw-r--r--libstdc++-v3/include/bits/stl_construct.h26
-rw-r--r--libstdc++-v3/include/bits/stl_deque.h215
-rw-r--r--libstdc++-v3/include/bits/stl_heap.h61
-rw-r--r--libstdc++-v3/include/bits/stl_list.h1767
-rw-r--r--libstdc++-v3/include/bits/stl_map.h4
-rw-r--r--libstdc++-v3/include/bits/stl_multimap.h4
-rw-r--r--libstdc++-v3/include/bits/stl_multiset.h12
-rw-r--r--libstdc++-v3/include/bits/stl_numeric.h10
-rw-r--r--libstdc++-v3/include/bits/stl_queue.h540
-rw-r--r--libstdc++-v3/include/bits/stl_set.h93
-rw-r--r--libstdc++-v3/include/bits/stl_stack.h244
-rw-r--r--libstdc++-v3/include/bits/stl_tree.h111
-rw-r--r--libstdc++-v3/include/bits/stl_vector.h101
-rw-r--r--libstdc++-v3/include/bits/stream_iterator.h24
-rw-r--r--libstdc++-v3/include/bits/streambuf.tcc55
-rw-r--r--libstdc++-v3/include/bits/streambuf_iterator.h36
-rw-r--r--libstdc++-v3/include/bits/vector.tcc7
-rw-r--r--libstdc++-v3/include/c/std_cctype.h2
-rw-r--r--libstdc++-v3/include/c/std_cmath.h16
-rw-r--r--libstdc++-v3/include/c/std_cstdlib.h2
-rw-r--r--libstdc++-v3/include/c/std_cwchar.h6
-rw-r--r--libstdc++-v3/include/c/std_cwctype.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/iso646.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/limits.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/locale.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/stdio.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/string.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/time.h2
-rw-r--r--libstdc++-v3/include/c_compatibility/wchar.h8
-rw-r--r--libstdc++-v3/include/c_compatibility/wctype.h2
-rw-r--r--libstdc++-v3/include/c_std/cmath.tcc2
-rw-r--r--libstdc++-v3/include/c_std/std_cassert.h2
-rw-r--r--libstdc++-v3/include/c_std/std_cctype.h2
-rw-r--r--libstdc++-v3/include/c_std/std_cmath.h592
-rw-r--r--libstdc++-v3/include/c_std/std_cstddef.h2
-rw-r--r--libstdc++-v3/include/c_std/std_cstdio.h4
-rw-r--r--libstdc++-v3/include/c_std/std_cstdlib.h28
-rw-r--r--libstdc++-v3/include/c_std/std_cstring.h2
-rw-r--r--libstdc++-v3/include/c_std/std_cwchar.h24
-rw-r--r--libstdc++-v3/include/c_std/std_cwctype.h10
-rw-r--r--libstdc++-v3/include/debug/bitset298
-rw-r--r--libstdc++-v3/include/debug/debug.h531
-rw-r--r--libstdc++-v3/include/debug/deque386
-rw-r--r--libstdc++-v3/include/debug/formatter.h389
-rw-r--r--libstdc++-v3/include/debug/hash_map38
-rw-r--r--libstdc++-v3/include/debug/hash_map.h270
-rw-r--r--libstdc++-v3/include/debug/hash_multimap.h261
-rw-r--r--libstdc++-v3/include/debug/hash_multiset.h236
-rw-r--r--libstdc++-v3/include/debug/hash_set38
-rw-r--r--libstdc++-v3/include/debug/hash_set.h245
-rw-r--r--libstdc++-v3/include/debug/list505
-rw-r--r--libstdc++-v3/include/debug/map38
-rw-r--r--libstdc++-v3/include/debug/map.h323
-rw-r--r--libstdc++-v3/include/debug/multimap.h314
-rw-r--r--libstdc++-v3/include/debug/multiset.h320
-rw-r--r--libstdc++-v3/include/debug/safe_base.h201
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.h607
-rw-r--r--libstdc++-v3/include/debug/safe_iterator.tcc140
-rw-r--r--libstdc++-v3/include/debug/safe_sequence.h179
-rw-r--r--libstdc++-v3/include/debug/set38
-rw-r--r--libstdc++-v3/include/debug/set.h325
-rw-r--r--libstdc++-v3/include/debug/string1001
-rw-r--r--libstdc++-v3/include/debug/vector412
-rw-r--r--libstdc++-v3/include/ext/algorithm77
-rw-r--r--libstdc++-v3/include/ext/debug_allocator.h96
-rw-r--r--libstdc++-v3/include/ext/enc_filebuf.h26
-rw-r--r--libstdc++-v3/include/ext/functional28
-rw-r--r--libstdc++-v3/include/ext/hash_fun.h32
-rw-r--r--libstdc++-v3/include/ext/hash_map40
-rw-r--r--libstdc++-v3/include/ext/hash_set60
-rw-r--r--libstdc++-v3/include/ext/hashtable.h100
-rw-r--r--libstdc++-v3/include/ext/iterator6
-rw-r--r--libstdc++-v3/include/ext/malloc_allocator.h177
-rw-r--r--libstdc++-v3/include/ext/memory18
-rw-r--r--libstdc++-v3/include/ext/mt_allocator.h336
-rw-r--r--libstdc++-v3/include/ext/new_allocator.h79
-rw-r--r--libstdc++-v3/include/ext/numeric4
-rw-r--r--libstdc++-v3/include/ext/pod_char_traits.h78
-rw-r--r--libstdc++-v3/include/ext/pool_allocator.h41
-rw-r--r--libstdc++-v3/include/ext/rb_tree8
-rw-r--r--libstdc++-v3/include/ext/rope146
-rw-r--r--libstdc++-v3/include/ext/ropeimpl.h122
-rw-r--r--libstdc++-v3/include/ext/slist169
-rw-r--r--libstdc++-v3/include/ext/stdio_filebuf.h39
-rw-r--r--libstdc++-v3/include/ext/stdio_sync_filebuf.h34
-rw-r--r--libstdc++-v3/include/std/std_algorithm.h4
-rw-r--r--libstdc++-v3/include/std/std_bitset.h93
-rw-r--r--libstdc++-v3/include/std/std_deque.h4
-rw-r--r--libstdc++-v3/include/std/std_fstream.h63
-rw-r--r--libstdc++-v3/include/std/std_functional.h6
-rw-r--r--libstdc++-v3/include/std/std_iterator.h5
-rw-r--r--libstdc++-v3/include/std/std_list.h4
-rw-r--r--libstdc++-v3/include/std/std_map.h8
-rw-r--r--libstdc++-v3/include/std/std_memory.h13
-rw-r--r--libstdc++-v3/include/std/std_numeric.h5
-rw-r--r--libstdc++-v3/include/std/std_queue.h10
-rw-r--r--libstdc++-v3/include/std/std_set.h8
-rw-r--r--libstdc++-v3/include/std/std_stack.h6
-rw-r--r--libstdc++-v3/include/std/std_streambuf.h20
-rw-r--r--libstdc++-v3/include/std/std_utility.h5
-rw-r--r--libstdc++-v3/include/std/std_valarray.h31
-rw-r--r--libstdc++-v3/include/std/std_vector.h4
-rw-r--r--libstdc++-v3/libmath/Makefile.in15
-rw-r--r--libstdc++-v3/libmath/stubs.c195
-rw-r--r--libstdc++-v3/libsupc++/Makefile.in17
-rw-r--r--libstdc++-v3/libsupc++/vec.cc12
-rw-r--r--libstdc++-v3/linkage.m42
-rw-r--r--libstdc++-v3/po/Makefile.in16
-rwxr-xr-xlibstdc++-v3/scripts/testsuite_flags.in10
-rw-r--r--libstdc++-v3/src/Makefile.am4
-rw-r--r--libstdc++-v3/src/Makefile.in11
-rw-r--r--libstdc++-v3/src/ctype.cc13
-rw-r--r--libstdc++-v3/src/debug.cc660
-rw-r--r--libstdc++-v3/src/demangle.cc2
-rw-r--r--libstdc++-v3/src/ios.cc2
-rw-r--r--libstdc++-v3/src/ios_init.cc13
-rw-r--r--libstdc++-v3/src/locale-inst.cc47
-rw-r--r--libstdc++-v3/src/locale.cc6
-rw-r--r--libstdc++-v3/src/locale_facets.cc2
-rw-r--r--libstdc++-v3/src/locale_init.cc46
-rw-r--r--libstdc++-v3/src/localename.cc2
-rw-r--r--libstdc++-v3/src/misc-inst.cc8
-rw-r--r--libstdc++-v3/src/streambuf-inst.cc4
-rw-r--r--libstdc++-v3/src/string-inst.cc19
-rw-r--r--libstdc++-v3/testsuite/18_support/numeric_limits.cc2
-rw-r--r--libstdc++-v3/testsuite/20_util/allocator_members.cc89
-rw-r--r--libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc4
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc3
-rw-r--r--libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc50
-rw-r--r--libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc50
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc72
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc69
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc160
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc79
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc58
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc70
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc65
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc72
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc69
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc160
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc79
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc58
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc70
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc65
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc68
-rw-r--r--libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc68
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc79
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc65
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc4
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc79
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc65
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc63
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc2
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc8
-rw-r--r--libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc6
-rw-r--r--libstdc++-v3/testsuite/23_containers/list/operators/4.cc4
-rw-r--r--libstdc++-v3/testsuite/23_containers/vector/resize/1.cc2
-rw-r--r--libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc181
-rw-r--r--libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc118
-rw-r--r--libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc7
-rw-r--r--libstdc++-v3/testsuite/25_algorithms/heap.cc8
-rw-r--r--libstdc++-v3/testsuite/26_numerics/complex_value.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc78
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc61
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc (renamed from libstdc++-v3/testsuite/ext/stdio_filebuf.cc)35
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc78
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc54
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc60
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc61
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc56
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc60
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc82
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc85
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc71
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc46
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc46
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc80
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc81
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc (renamed from libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc)48
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc55
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc8
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc52
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc185
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc185
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc200
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_fstream/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc59
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc44
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc6
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc76
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc75
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc78
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc3
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc67
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc89
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc68
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc96
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc50
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc74
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc76
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc99
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc67
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc79
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc89
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc68
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc66
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc49
-rw-r--r--libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc61
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc2
-rw-r--r--libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/5.cc1
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/7.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/9.cc4
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc7
-rw-r--r--libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc1
-rw-r--r--libstdc++-v3/testsuite/Makefile.am5
-rw-r--r--libstdc++-v3/testsuite/Makefile.in21
-rw-r--r--libstdc++-v3/testsuite/backward/11460.cc3
-rw-r--r--libstdc++-v3/testsuite/backward/strstream_members.cc3
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_examples/10.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/abi_text/01.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/3111-2.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-01.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/7986-07.cc2
-rw-r--r--libstdc++-v3/testsuite/demangle/regression/cw-16.cc53
-rw-r--r--libstdc++-v3/testsuite/ext/allocators.cc50
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc140
-rw-r--r--libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc142
-rw-r--r--libstdc++-v3/testsuite/lib/libstdc++.exp39
-rw-r--r--libstdc++-v3/testsuite/libstdc++-dg/normal.exp31
-rw-r--r--libstdc++-v3/testsuite/performance/allocator.cc6
-rw-r--r--libstdc++-v3/testsuite/performance/container_benchmark.cc175
-rw-r--r--libstdc++-v3/testsuite/performance/ifstream_extract_int.cc57
-rw-r--r--libstdc++-v3/testsuite/performance/is_wchar_t.cc87
-rw-r--r--libstdc++-v3/testsuite/performance/list_create_fill_sort.cc2
-rw-r--r--libstdc++-v3/testsuite/performance/narrow_widen_char.cc76
-rw-r--r--libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc76
-rw-r--r--libstdc++-v3/testsuite/performance/wchar_t_in.cc84
-rw-r--r--libstdc++-v3/testsuite/performance/wchar_t_length.cc62
-rw-r--r--libstdc++-v3/testsuite/performance/wchar_t_out.cc84
-rw-r--r--libstdc++-v3/testsuite/testsuite_character.h415
-rw-r--r--libstdc++-v3/testsuite/testsuite_io.h186
-rw-r--r--libstdc++-v3/testsuite/testsuite_performance.h23
-rw-r--r--libtool.m45
-rw-r--r--ltcf-c.sh59
-rw-r--r--ltcf-cxx.sh47
-rw-r--r--ltcf-gcj.sh49
-rwxr-xr-xltconfig23
-rw-r--r--ltmain.sh59
-rw-r--r--maintainer-scripts/ChangeLog4
-rwxr-xr-xmaintainer-scripts/maintainer-addresses25
2003 files changed, 176011 insertions, 85042 deletions
diff --git a/ChangeLog b/ChangeLog
index 2273b43846d..5f1d9cfa967 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,64 @@
+2003-12-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * MAINTAINERS: Remove the mn10200 maintainer.
+
+2003-12-21 Bernardo Innocenti <bernie@develer.com>
+
+ * configure.in (*-*-uclinux): Exclude newlib, libgloss and rda.
+ * configure: Regenerated.
+
+2003-12-16 Jan Hubicka <jh@suse.cz>
+
+ * MAINTAINERS: Add myself as callgraph maintainer.
+
+2003-12-08 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * configure.in (raw_libstdcxx_flags): Remove the leading space.
+ * configure: Regenerate.
+
+2003-12-01 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * MAINTAINERS: Move myself from 'Bug database only accounts' to
+ 'Write After Approval' section. Update email.
+
+2003-12-01 James Lemke <jim@wasabisystems.com>
+
+ * MAINTAINERS (Write After Approval): Add myself.
+
+2003-11-20 Matt Thomas <matt@3am-software.com>
+
+ * MAINTAINERS: Add myself as a vax port maintainer.
+
+2003-11-20 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.tpl (BASE_FLAGS_TO_PASS): Pass along CONFIG_SHELL.
+ (configure-build-[+module+], configure-[+module+]): Likewise.
+ (configure-target-[+module+], configure-gcc, config.status): Likewise.
+ * Makefile.in: Regenerate.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * libtool.m4: Sync darwin bits from libtool cvs to build a gcc with
+ shared/dylibed libraries.
+ * ltmain.sh: Likewise.
+ * ltcf-c.sh: Likewise, disable shared library build for OS-X < 10.3.
+ * ltcf-cxx.sh: Likewise.
+ * ltcf-gcj.sh: Likewise.
+ * ltconfig: Likewise.
+
+2003-11-17 Stan Cox <scox@redhat.com>
+
+ * MAINTAINERS: Add myself as iq2000 port maintainer.
+
+2003-11-14 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.tpl (EXTRA_GCC_FLAGS): Pass BOOT_ADAFLAGS.
+ * Makefile.in: Regenerate.
+
+2003-11-03 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config.sub: Update to 2003-11-03 version.
+
2003-10-20 Phil Edwards <phil@codesourcery.com>
* configure.in (*-*-vxworks): Add target-libiberty to noconfdirs.
diff --git a/MAINTAINERS b/MAINTAINERS
index 9fcc8636ddd..db62e1f8e2f 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -53,6 +53,7 @@ i860 port Jason Eckhardt jle@rice.edu
i960 port Jim Wilson wilson@specifixinc.com
ia64 port Jim Wilson wilson@specifixinc.com
ip2k port Denis Chertykov denisc@overta.ru
+iq2000 port Stan Cox scox@redhat.com
m32r port Nick Clifton nickc@redhat.com
m68hc11 port Stephane Carrez stcarrez@nerim.fr
m68k port (?) Jeff Law law@redhat.com
@@ -60,7 +61,6 @@ m68k-motorola-sysv port Philippe De Muyter phdm@macqel.be
mcore port Nick Clifton nickc@redhat.com
mips port Eric Christopher echristo@redhat.com
mmix port Hans-Peter Nilsson hp@bitrange.com
-mn10200 port Jeff Law law@redhat.com
mn10300 port Jeff Law law@redhat.com
mn10300 port Alexandre Oliva aoliva@redhat.com
ns32k port Ian Dall ian@beware.dropbear.id.au
@@ -77,6 +77,7 @@ sparc port David S. Miller davem@redhat.com
sparc port Jakub Jelinek jakub@redhat.com
v850 port Nick Clifton nickc@redhat.com
vax port Dave Anglin dave.anglin@nrc.ca
+vax port Matt Thomas matt@3am-software.com
x86-64 port Jan Hubicka jh@suse.cz
xstormy16 port Geoffrey Keating geoffk@geoffk.org
xtensa port Bob Wilson bob.wilson@acm.org
@@ -123,6 +124,7 @@ scheduler (+ haifa) Michael Meissner gnu@the-meissners.org
scheduler (+ haifa) Jeff Law law@redhat.com
reorg Jeff Law law@redhat.com
caller-save.c Jeff Law law@redhat.com
+callgraph Jan Hubicka jh@suse.cz
debugging code Jim Wilson wilson@specifixinc.com
dwarf debugging code Jason Merrill jason@redhat.com
c++ runtime libs Paolo Carlini pcarlini@unitus.it
@@ -172,6 +174,7 @@ in changes outside of the parts of the compiler they maintain.
Write After Approval (last name alphabetical order)
Matt Austern austern@apple.com
+Giovanni Bajo giovannibajo@gcc.gnu.org
Scott Bambrough scottb@netwinder.org
Wolfgang Bangerth bangerth@dealii.org
Daniel Berlin dan@dberlin.org
@@ -219,6 +222,7 @@ Jeff Knaggs jknaggs@redhat.com
Matt Kraai kraai@alumni.cmu.edu
Marc Lehmann pcg@goof.com
Alan Lehotsky apl@alum.mit.edu
+James Lemke jim@wasabisystems.com
Kriang Lerdsuwanakij lerdsuwa@users.sourceforge.net
Warren Levy warrenl@cruzio.com
Don Lindsay dlindsay@redhat.com
@@ -278,7 +282,6 @@ Josef Zlomek zlomekj@suse.cz
Bug database only accounts
-Giovanni Bajo giovannibajo@libero.it
James Dennett jdennett@acm.org
Christian Ehrhardt ehrhardt@mathematik.uni-ulm.de
Dara Hazeghi dhazeghi@yahoo.com
diff --git a/Makefile.in b/Makefile.in
index fc0fcc98e58..8fe85ff369f 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -446,6 +446,7 @@ BASE_FLAGS_TO_PASS = \
"NM_FOR_TARGET=$(NM_FOR_TARGET)" \
"RANLIB_FOR_TARGET=$(RANLIB_FOR_TARGET)" \
"WINDRES_FOR_TARGET=$(WINDRES_FOR_TARGET)" \
+ "CONFIG_SHELL=$(SHELL)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
# For any flags above that may contain shell code that varies from one
@@ -522,7 +523,8 @@ EXTRA_GCC_FLAGS = \
"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
+ "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
+ "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
@@ -17607,6 +17609,7 @@ configure-build-libiberty:
AS="$(AS_FOR_BUILD)"; export AS; \
CC="$(CC_FOR_BUILD)"; export CC; \
CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX_FOR_BUILD)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
@@ -17678,6 +17681,7 @@ configure-ash:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -17744,6 +17748,7 @@ configure-autoconf:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -17810,6 +17815,7 @@ configure-automake:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -17876,6 +17882,7 @@ configure-bash:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -17942,6 +17949,7 @@ configure-bfd:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18008,6 +18016,7 @@ configure-opcodes:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18074,6 +18083,7 @@ configure-binutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18140,6 +18150,7 @@ configure-bison:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18209,6 +18220,7 @@ configure-byacc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18278,6 +18290,7 @@ configure-bzip2:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18344,6 +18357,7 @@ configure-dejagnu:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18410,6 +18424,7 @@ configure-diff:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18476,6 +18491,7 @@ configure-dosutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18538,6 +18554,7 @@ configure-etc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18604,6 +18621,7 @@ configure-fastjar:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18673,6 +18691,7 @@ configure-fileutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18739,6 +18758,7 @@ configure-findutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18805,6 +18825,7 @@ configure-find:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18871,6 +18892,7 @@ configure-flex:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -18940,6 +18962,7 @@ configure-gas:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19006,6 +19029,7 @@ configure-gawk:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19072,6 +19096,7 @@ configure-gettext:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19138,6 +19163,7 @@ configure-gnuserv:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19204,6 +19230,7 @@ configure-gprof:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19270,6 +19297,7 @@ configure-gzip:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19336,6 +19364,7 @@ configure-hello:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19402,6 +19431,7 @@ configure-indent:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19468,6 +19498,7 @@ configure-intl:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19534,6 +19565,7 @@ configure-tcl:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19600,6 +19632,7 @@ configure-itcl:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19666,6 +19699,7 @@ configure-ld:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19732,6 +19766,7 @@ configure-libgui:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19798,6 +19833,7 @@ configure-libiberty:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19864,6 +19900,7 @@ configure-libtool:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19930,6 +19967,7 @@ configure-m4:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -19996,6 +20034,7 @@ configure-make:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20062,6 +20101,7 @@ configure-mmalloc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20124,6 +20164,7 @@ configure-patch:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20190,6 +20231,7 @@ configure-perl:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20256,6 +20298,7 @@ configure-prms:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20322,6 +20365,7 @@ configure-rcs:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20388,6 +20432,7 @@ configure-readline:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20454,6 +20499,7 @@ configure-release:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20512,6 +20558,7 @@ configure-recode:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20578,6 +20625,7 @@ configure-sed:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20644,6 +20692,7 @@ configure-send-pr:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20710,6 +20759,7 @@ configure-shellutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20776,6 +20826,7 @@ configure-sid:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20842,6 +20893,7 @@ configure-sim:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20908,6 +20960,7 @@ configure-tar:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -20974,6 +21027,7 @@ configure-texinfo:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21036,6 +21090,7 @@ configure-textutils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21102,6 +21157,7 @@ configure-time:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21168,6 +21224,7 @@ configure-uudecode:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21234,6 +21291,7 @@ configure-wdiff:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21300,6 +21358,7 @@ configure-zip:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21369,6 +21428,7 @@ configure-zlib:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21427,6 +21487,7 @@ configure-gdb:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21493,6 +21554,7 @@ configure-expect:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21559,6 +21621,7 @@ configure-guile:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21625,6 +21688,7 @@ configure-tk:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21691,6 +21755,7 @@ configure-tix:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21757,6 +21822,7 @@ configure-libtermcap:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21819,6 +21885,7 @@ configure-utils:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -21896,6 +21963,7 @@ configure-target-libstdc++-v3: $(TARGET_SUBDIR)/libstdc++-v3/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
@@ -21998,6 +22066,7 @@ configure-target-newlib: $(TARGET_SUBDIR)/newlib/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22099,6 +22168,7 @@ configure-target-libf2c: $(TARGET_SUBDIR)/libf2c/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22200,6 +22270,7 @@ configure-target-libobjc: $(TARGET_SUBDIR)/libobjc/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22301,6 +22372,7 @@ configure-target-libtermcap: $(TARGET_SUBDIR)/libtermcap/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22398,6 +22470,7 @@ configure-target-winsup: $(TARGET_SUBDIR)/winsup/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22499,6 +22572,7 @@ configure-target-libgloss: $(TARGET_SUBDIR)/libgloss/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22596,6 +22670,7 @@ configure-target-libiberty: $(TARGET_SUBDIR)/libiberty/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22697,6 +22772,7 @@ configure-target-gperf: $(TARGET_SUBDIR)/gperf/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22798,6 +22874,7 @@ configure-target-examples: $(TARGET_SUBDIR)/examples/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22891,6 +22968,7 @@ configure-target-libffi: $(TARGET_SUBDIR)/libffi/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -22992,6 +23070,7 @@ configure-target-libjava: $(TARGET_SUBDIR)/libjava/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
CXX="$(RAW_CXX_FOR_TARGET)"; export CXX; \
@@ -23094,6 +23173,7 @@ configure-target-zlib: $(TARGET_SUBDIR)/zlib/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -23195,6 +23275,7 @@ configure-target-boehm-gc: $(TARGET_SUBDIR)/boehm-gc/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -23296,6 +23377,7 @@ configure-target-qthreads: $(TARGET_SUBDIR)/qthreads/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -23397,6 +23479,7 @@ configure-target-rda: $(TARGET_SUBDIR)/rda/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \
CXX="$(CXX_FOR_TARGET)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
@@ -23498,6 +23581,7 @@ configure-gcc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -23831,7 +23915,7 @@ Makefile: $(srcdir)/Makefile.in config.status
CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
config.status: configure $(gcc_version_trigger)
- $(SHELL) ./config.status --recheck
+ CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
# Rebuilding configure.
AUTOCONF = autoconf
diff --git a/Makefile.tpl b/Makefile.tpl
index 6f1f9df6636..3b545c46095 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -389,6 +389,7 @@ all: all.normal
# Flags to pass down to all sub-makes.
BASE_FLAGS_TO_PASS = [+ FOR flags_to_pass +]\
"[+flag+]=$([+flag+])" [+ ENDFOR flags_to_pass +]\
+ "CONFIG_SHELL=$(SHELL)" \
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)"
# For any flags above that may contain shell code that varies from one
@@ -465,7 +466,8 @@ EXTRA_GCC_FLAGS = \
"`echo 'LIBGCC2_DEBUG_CFLAGS=$(LIBGCC2_DEBUG_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'LIBGCC2_INCLUDES=$(LIBGCC2_INCLUDES)' | sed -e s/.*=$$/XFOO=/`" \
"`echo 'STAGE1_CFLAGS=$(STAGE1_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
- "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`"
+ "`echo 'BOOT_CFLAGS=$(BOOT_CFLAGS)' | sed -e s/.*=$$/XFOO=/`" \
+ "`echo 'BOOT_ADAFLAGS=$(BOOT_ADAFLAGS)' | sed -e s/.*=$$/XFOO=/`"
GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
@@ -776,6 +778,7 @@ configure-build-[+module+]:
AS="$(AS_FOR_BUILD)"; export AS; \
CC="$(CC_FOR_BUILD)"; export CC; \
CFLAGS="$(CFLAGS_FOR_BUILD)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX_FOR_BUILD)"; export CXX; \
CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \
GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \
@@ -847,6 +850,7 @@ configure-[+module+]:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
AR="$(AR)"; export AR; \
@@ -953,6 +957,7 @@ configure-target-[+module+]: $(TARGET_SUBDIR)/[+module+]/multilib.out
AS="$(AS_FOR_TARGET)"; export AS; \
CC="$(CC_FOR_TARGET)"; export CC; \
CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CPPFLAGS="$(CFLAGS_FOR_TARGET)"; export CPPFLAGS; \[+
IF raw_cxx +]
CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
@@ -1073,6 +1078,7 @@ configure-gcc:
s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
CC="$(CC)"; export CC; \
CFLAGS="$(CFLAGS)"; export CFLAGS; \
+ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
CXX="$(CXX)"; export CXX; \
CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
TOPLEVEL_CONFIGURE_ARGUMENTS="$(TOPLEVEL_CONFIGURE_ARGUMENTS)"; export TOPLEVEL_CONFIGURE_ARGUMENTS; \
@@ -1406,7 +1412,7 @@ Makefile: $(srcdir)/Makefile.in config.status
CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
config.status: configure $(gcc_version_trigger)
- $(SHELL) ./config.status --recheck
+ CONFIG_SHELL="$(SHELL)" $(SHELL) ./config.status --recheck
# Rebuilding configure.
AUTOCONF = autoconf
diff --git a/boehm-gc/ChangeLog b/boehm-gc/ChangeLog
index 5f5c2c0a2c4..347a310d82c 100644
--- a/boehm-gc/ChangeLog
+++ b/boehm-gc/ChangeLog
@@ -1,3 +1,7 @@
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ * include/private/gcconfig.h: Re-install change of 2003-04-16.
+
2003-10-20 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* mips_sgi_mach_dep.s: Use _ABIO32 instead of external
diff --git a/boehm-gc/include/private/gcconfig.h b/boehm-gc/include/private/gcconfig.h
index fceba8fa205..65e71479892 100644
--- a/boehm-gc/include/private/gcconfig.h
+++ b/boehm-gc/include/private/gcconfig.h
@@ -62,7 +62,7 @@
/* Determine the machine type: */
# if defined(__arm__) || defined(__thumb__)
# define ARM32
-# if !defined(LINUX)
+# if !defined(LINUX) && !defined(NETBSD)
# define NOSYS
# define mach_type_known
# endif
@@ -1688,8 +1688,13 @@
# ifdef NETBSD
# define OS_TYPE "NETBSD"
# define HEURISTIC2
- extern char etext[];
-# define DATASTART ((ptr_t)(etext))
+# ifdef __ELF__
+# define DATASTART GC_data_start
+# define DYNAMIC_LOADING
+# else
+ extern char etext[];
+# define DATASTART ((ptr_t)(etext))
+# endif
# define USE_GENERIC_PUSH_REGS
# endif
# ifdef LINUX
diff --git a/boehm-gc/install-sh b/boehm-gc/install-sh
index 398a88e1421..e9de23842dc 100755
--- a/boehm-gc/install-sh
+++ b/boehm-gc/install-sh
@@ -109,7 +109,7 @@ then
echo "install: no input file specified"
exit 1
else
- :
+ true
fi
if [ x"$dir_arg" != x ]; then
@@ -120,7 +120,7 @@ if [ x"$dir_arg" != x ]; then
instcmd=:
chmodcmd=""
else
- instcmd=$mkdirprog
+ instcmd=mkdir
fi
else
@@ -130,7 +130,7 @@ else
if [ -f $src -o -d $src ]
then
- :
+ true
else
echo "install: $src does not exist"
exit 1
@@ -141,7 +141,7 @@ else
echo "install: no destination specified"
exit 1
else
- :
+ true
fi
# If destination is a directory, append the input filename; if your system
@@ -151,7 +151,7 @@ else
then
dst="$dst"/`basename $src`
else
- :
+ true
fi
fi
@@ -163,8 +163,8 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
-defaultIFS='
- '
+defaultIFS='
+'
IFS="${IFS-${defaultIFS}}"
oIFS="${IFS}"
@@ -183,7 +183,7 @@ while [ $# -ne 0 ] ; do
then
$mkdirprog "${pathcomp}"
else
- :
+ true
fi
pathcomp="${pathcomp}/"
@@ -194,10 +194,10 @@ if [ x"$dir_arg" != x ]
then
$doit $instcmd $dst &&
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else : ; fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else : ; fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else : ; fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else : ; fi
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
else
# If we're going to rename the final executable, determine the name now.
@@ -216,7 +216,7 @@ else
then
dstfile=`basename $dst`
else
- :
+ true
fi
# Make a temp file name in the proper directory.
@@ -235,10 +235,10 @@ else
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
- if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else :;fi &&
- if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else :;fi &&
- if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else :;fi &&
- if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else :;fi &&
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
# Now rename the file to the real destination.
diff --git a/boehm-gc/libtool.m4 b/boehm-gc/libtool.m4
index 066bf6a5ce6..c857149a9d6 100644
--- a/boehm-gc/libtool.m4
+++ b/boehm-gc/libtool.m4
@@ -1,6 +1,5 @@
-# libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-## Copyright 1996, 1997, 1998, 1999, 2000, 2001
-## Free Software Foundation, Inc.
+## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
+## Copyright (C) 1996-1999 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
@@ -22,68 +21,85 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
-# serial 46 AC_PROG_LIBTOOL
-
-AC_DEFUN([AC_PROG_LIBTOOL],
+# serial 40 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" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
+DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
+|| 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/ltmain.sh"
+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
-# Prevent multiple expansion
-define([AC_PROG_LIBTOOL], [])
+# 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_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_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
AC_REQUIRE([AC_PROG_LN_S])dnl
-AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
-AC_REQUIRE([AC_OBJEXT])dnl
-AC_REQUIRE([AC_EXEEXT])dnl
dnl
-_LT_AC_PROG_ECHO_BACKSLASH
-# 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
- AC_PATH_MAGIC
- fi
- ;;
+case "$target" in
+NONE) lt_target="$host" ;;
+*) lt_target="$target" ;;
esac
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+# Check for any special flags to pass to ltconfig.
+#
+# the following will cause an existing older ltconfig to fail, so
+# we ignore this at the expense of the cache file... Checking this
+# will just take longer ... bummer!
+#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"
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+[libtool_flags="$libtool_flags --enable-dlopen"])
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-enable_win32_dll=yes, enable_win32_dll=no)
-
+[libtool_flags="$libtool_flags --enable-win32-dll"])
AC_ARG_ENABLE(libtool-lock,
[ --disable-libtool-lock avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case $host in
+case "$lt_target" 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.$ac_objext` in
+ case "`/usr/bin/file conftest.o`" in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -103,10 +119,7 @@ case $host in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_SAVE
- AC_LANG_C
- AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_RESTORE])
+ [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"
@@ -114,2889 +127,33 @@ case $host in
;;
ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+[*-*-cygwin* | *-*-mingw*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
- # recent cygwin and mingw systems supply a stub DllMain which the user
- # can override, but on older systems we have to supply one
- AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
- [AC_TRY_LINK([],
- [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
- DllMain (0, 0, 0);],
- [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
- 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"
- AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
- [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
- CFLAGS="$SAVE_CFLAGS" ;;
- *-*-cygwin* | *-*-pw32*)
- # cygwin systems need to pass --dll to the linker, and not link
- # crt.o which will require a WinMain@16 definition.
- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
- esac
;;
- ])
-esac
-
-_LT_AC_LTCONFIG_HACK
-
])
-
-# AC_LIBTOOL_HEADER_ASSERT
-# ------------------------
-AC_DEFUN([AC_LIBTOOL_HEADER_ASSERT],
-[AC_CACHE_CHECK([whether $CC supports assert without backlinking],
- [lt_cv_func_assert_works],
- [case $host in
- *-*-solaris*)
- if test "$GCC" = yes && test "$with_gnu_ld" != yes; then
- case `$CC --version 2>/dev/null` in
- [[12]].*) lt_cv_func_assert_works=no ;;
- *) lt_cv_func_assert_works=yes ;;
- esac
- fi
- ;;
- esac])
-
-if test "x$lt_cv_func_assert_works" = xyes; then
- AC_CHECK_HEADERS(assert.h)
-fi
-])# AC_LIBTOOL_HEADER_ASSERT
-
-# _LT_AC_CHECK_DLFCN
-# --------------------
-AC_DEFUN([_LT_AC_CHECK_DLFCN],
-[AC_CHECK_HEADERS(dlfcn.h)
-])# _LT_AC_CHECK_DLFCN
-
-# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-# ---------------------------------
-AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
-[AC_REQUIRE([AC_CANONICAL_HOST])
-AC_REQUIRE([AC_PROG_NM])
-AC_REQUIRE([AC_OBJEXT])
-# 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([lt_cv_sys_global_symbol_pipe], [dnl
-
-# 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.
-symcode='[[BCDEGRST]]'
-
-# Regexp to match symbols that can be accessed directly from C.
-sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
-
-# Transform the above into a raw symbol and a C symbol.
-symxfrm='\1 \2\3 \3'
-
-# Transform an extracted symbol line into a proper C declaration
-lt_cv_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
-
-# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
-
-# Define system-specific variables.
-case $host_os in
-aix*)
- symcode='[[BCDT]]'
- ;;
-cygwin* | mingw* | pw32*)
- symcode='[[ABCDGISTW]]'
- ;;
-hpux*) # Its linker distinguishes data from code symbols
- lt_cv_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
- lt_cv_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
- ;;
-irix*)
- symcode='[[BCDEGRST]]'
- ;;
-solaris* | sysv5*)
- symcode='[[BDT]]'
- ;;
-sysv4)
- symcode='[[DFNSTU]]'
- ;;
-esac
-
-# Handle CRLF in mingw tool chain
-opt_cr=
-case $host_os in
-mingw*)
- opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
- ;;
-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
- symcode='[[ABCDGISTW]]'
-fi
-
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
-
- # Write the raw and C identifiers.
-lt_cv_sys_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
- rm -f conftest*
- 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.
- nlist=conftest.nm
- if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
- # Try sorting and uniquifying the output.
- if sort "$nlist" | uniq > "$nlist"T; then
- mv -f "$nlist"T "$nlist"
- else
- rm -f "$nlist"T
- fi
-
- # Make sure that we snagged all the symbols we need.
- if egrep ' nm_test_var$' "$nlist" >/dev/null; then
- if egrep ' nm_test_func$' "$nlist" >/dev/null; then
- cat <<EOF > conftest.$ac_ext
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-EOF
- # Now generate the symbol file.
- eval "$lt_cv_global_symbol_to_cdecl"' < "$nlist" >> conftest.$ac_ext'
-
- cat <<EOF >> conftest.$ac_ext
-#if defined (__STDC__) && __STDC__
-# define lt_ptr void *
-#else
-# define lt_ptr char *
-# define const
-#endif
-
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr address;
-}
-lt_preloaded_symbols[[]] =
-{
-EOF
- sed "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr) \&\2},/" < "$nlist" >> conftest.$ac_ext
- cat <<\EOF >> conftest.$ac_ext
- {0, (lt_ptr) 0}
-};
-
-#ifdef __cplusplus
-}
-#endif
-EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- save_LIBS="$LIBS"
- save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if AC_TRY_EVAL(ac_link) && test -s conftest; then
- pipe_works=yes
- fi
- LIBS="$save_LIBS"
- CFLAGS="$save_CFLAGS"
- else
- echo "cannot find nm_test_func in $nlist" >&AC_FD_CC
- fi
- else
- echo "cannot find nm_test_var in $nlist" >&AC_FD_CC
- fi
- else
- echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AC_FD_CC
- fi
- else
- echo "$progname: failed program was:" >&AC_FD_CC
- cat conftest.$ac_ext >&5
- fi
- rm -f conftest* conftst*
-
- # Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
- break
- else
- lt_cv_sys_global_symbol_pipe=
- fi
-done
-])
-global_symbol_pipe="$lt_cv_sys_global_symbol_pipe"
-if test -z "$lt_cv_sys_global_symbol_pipe"; then
- global_symbol_to_cdecl=
- global_symbol_to_c_name_address=
-else
- global_symbol_to_cdecl="$lt_cv_global_symbol_to_cdecl"
- global_symbol_to_c_name_address="$lt_cv_global_symbol_to_c_name_address"
-fi
-if test -z "$global_symbol_pipe$global_symbol_to_cdec$global_symbol_to_c_name_address";
-then
- AC_MSG_RESULT(failed)
-else
- AC_MSG_RESULT(ok)
-fi
-]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
-
-# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-# ---------------------------------
-AC_DEFUN([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR],
-[# Find the correct PATH separator. Usually this is `:', but
-# DJGPP uses `;' like DOS.
-if test "X${PATH_SEPARATOR+set}" != Xset; then
- UNAME=${UNAME-`uname 2>/dev/null`}
- case X$UNAME in
- *-DOS) lt_cv_sys_path_separator=';' ;;
- *) lt_cv_sys_path_separator=':' ;;
- esac
- PATH_SEPARATOR=$lt_cv_sys_path_separator
-fi
-])# _LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# _LT_AC_PROG_ECHO_BACKSLASH
-# --------------------------
-# Add some code to the start of the generated configure script which
-# will find an echo command which doesn't interpret backslashes.
-AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
-[ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
- [AC_DIVERT_PUSH(NOTICE)])
-_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR
-
-# Check that we are running under the correct shell.
-SHELL=${CONFIG_SHELL-/bin/sh}
-
-case X$ECHO in
-X*--fallback-echo)
- # Remove one level of quotation (which was required for Make).
- ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
- ;;
-esac
-
-echo=${ECHO-echo}
-if test "X[$]1" = X--no-reexec; then
- # Discard the --no-reexec flag, and continue.
- shift
-elif test "X[$]1" = X--fallback-echo; then
- # Avoid inline document here, it may be left over
- :
-elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
- # Yippee, $echo works!
- :
-else
- # Restart under the correct shell.
- exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
-fi
-
-if test "X[$]1" = X--fallback-echo; then
- # used as fallback echo
- shift
- cat <<EOF
-$*
-EOF
- exit 0
-fi
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-if test -z "$ECHO"; then
-if test "X${echo_test_string+set}" != Xset; then
-# find a string as large as possible, as long as the shell can cope with it
- for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
- # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
- if (echo_test_string="`eval $cmd`") 2>/dev/null &&
- echo_test_string="`eval $cmd`" &&
- (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
- then
- break
- fi
- done
-fi
-
-if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- :
-else
- # The Solaris, AIX, and Digital Unix default echo programs unquote
- # backslashes. This makes it impossible to quote backslashes using
- # echo "$something" | sed 's/\\/\\\\/g'
- #
- # So, first we look for a working echo in the user's PATH.
-
- IFS="${IFS= }"; save_ifs="$IFS"; IFS=$PATH_SEPARATOR
- for dir in $PATH /usr/ucb; do
- if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
- test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$dir/echo"
- break
- fi
- done
- IFS="$save_ifs"
-
- if test "X$echo" = Xecho; then
- # We didn't find a better echo, so look for alternatives.
- if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # This shell has a builtin print -r that does the trick.
- echo='print -r'
- elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
- test "X$CONFIG_SHELL" != X/bin/ksh; then
- # If we have ksh, try running configure again with it.
- ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
- export ORIGINAL_CONFIG_SHELL
- CONFIG_SHELL=/bin/ksh
- export CONFIG_SHELL
- exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
- else
- # Try using printf.
- echo='printf %s\n'
- if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
- echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- # Cool, printf works
- :
- elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
- export CONFIG_SHELL
- SHELL="$CONFIG_SHELL"
- export SHELL
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
- test "X$echo_testing_string" = 'X\t' &&
- echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
- test "X$echo_testing_string" = "X$echo_test_string"; then
- echo="$CONFIG_SHELL [$]0 --fallback-echo"
- else
- # maybe with a smaller string...
- prev=:
-
- for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
- if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
- then
- break
- fi
- prev="$cmd"
- done
-
- if test "$prev" != 'sed 50q "[$]0"'; then
- echo_test_string=`eval $prev`
- export echo_test_string
- exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
- else
- # Oops. We lost completely, so just stick with echo.
- echo=echo
- fi
- fi
- fi
- fi
-fi
-fi
-
-# Copy echo and quote the copy suitably for passing to libtool from
-# the Makefile, instead of quoting the original, which is used later.
-ECHO=$echo
-if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
- ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
-fi
-
-AC_SUBST(ECHO)
-AC_DIVERT_POP
-])# _LT_AC_PROG_ECHO_BACKSLASH
-
-# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
-# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
-# ------------------------------------------------------------------
-AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
-[if test "$cross_compiling" = yes; then :
- [$4]
-else
- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
- lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
- lt_status=$lt_dlunknown
- cat > conftest.$ac_ext <<EOF
-[#line __oline__ "configure"
-#include "confdefs.h"
-
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
-
-#include <stdio.h>
-
-#ifdef RTLD_GLOBAL
-# define LT_DLGLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LT_DLGLOBAL DL_GLOBAL
-# else
-# define LT_DLGLOBAL 0
-# endif
-#endif
-
-/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LT_DLLAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LT_DLLAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LT_DLLAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LT_DLLAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LT_DLLAZY_OR_NOW DL_NOW
-# else
-# define LT_DLLAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
-#endif
-
-#ifdef __cplusplus
-extern "C" void exit (int);
-#endif
-
-void fnord() { int i=42;}
-int main ()
-{
- void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
- int status = $lt_dlunknown;
-
- if (self)
- {
- if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
- else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
- /* dlclose (self); */
- }
-
- exit (status);
-}]
-EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
- (./conftest; exit; ) 2>/dev/null
- lt_status=$?
- case x$lt_status in
- x$lt_dlno_uscore) $1 ;;
- x$lt_dlneed_uscore) $2 ;;
- x$lt_unknown|x*) $3 ;;
- esac
- else :
- # compilation failed
- $3
- fi
-fi
-rm -fr conftest*
-])# _LT_AC_TRY_DLOPEN_SELF
-
-# AC_LIBTOOL_DLOPEN_SELF
-# -------------------
-AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
-[if test "x$enable_dlopen" != xyes; then
- enable_dlopen=unknown
- enable_dlopen_self=unknown
- enable_dlopen_self_static=unknown
-else
- lt_cv_dlopen=no
- lt_cv_dlopen_libs=
-
- case $host_os in
- beos*)
- lt_cv_dlopen="load_add_on"
- lt_cv_dlopen_libs=
- lt_cv_dlopen_self=yes
- ;;
-
- cygwin* | mingw* | pw32*)
- lt_cv_dlopen="LoadLibrary"
- lt_cv_dlopen_libs=
- ;;
-
- *)
- AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
- [AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
- [AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
- [AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
- [AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
- [AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
- ])
- ])
- ])
- ])
- ])
- ;;
- esac
-
- if test "x$lt_cv_dlopen" != xno; then
- enable_dlopen=yes
- else
- enable_dlopen=no
- fi
-
- case $lt_cv_dlopen in
- dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
-
- save_LDFLAGS="$LDFLAGS"
- eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
-
- save_LIBS="$LIBS"
- LIBS="$lt_cv_dlopen_libs $LIBS"
-
- AC_CACHE_CHECK([whether a program can dlopen itself],
- lt_cv_dlopen_self, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
- lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
- ])
-
- if test "x$lt_cv_dlopen_self" = xyes; then
- LDFLAGS="$LDFLAGS $link_static_flag"
- AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
- lt_cv_dlopen_self_static, [dnl
- _LT_AC_TRY_DLOPEN_SELF(
- lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
- lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
- ])
- fi
-
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
- ;;
- esac
-
- 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
- yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
- *) enable_dlopen_self_static=unknown ;;
- esac
-fi
-])# AC_LIBTOOL_DLOPEN_SELF
-
-AC_DEFUN([_LT_AC_LTCONFIG_HACK],
-[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])dnl
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed='sed -e s/^X//'
-sed_quote_subst='s/\([[\\"\\`$\\\\]]\)/\\\1/g'
-
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\([[\\"\\`\\\\]]\)/\\\1/g'
-
-# Sed substitution to delay expansion of an escaped shell variable in a
-# double_quote_subst'ed string.
-delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
-
-# Constants:
-rm="rm -f"
-
-# Global variables:
-default_ofile=libtool
-can_build_shared=yes
-
-# All known linkers require a `.a' archive for static linking (except M$VC,
-# which needs '.lib').
-libext=a
-ltmain="$ac_aux_dir/ltmain.sh"
-ofile="$default_ofile"
-with_gnu_ld="$lt_cv_prog_gnu_ld"
-need_locks="$enable_libtool_lock"
-
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
-
-# Set sane defaults for various variables
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-test -z "$AS" && AS=as
-test -z "$CC" && CC=cc
-test -z "$DLLTOOL" && DLLTOOL=dlltool
-test -z "$LD" && LD=ld
-test -z "$LN_S" && LN_S="ln -s"
-test -z "$MAGIC_CMD" && MAGIC_CMD=file
-test -z "$NM" && NM=nm
-test -z "$OBJDUMP" && OBJDUMP=objdump
-test -z "$RANLIB" && RANLIB=:
-test -z "$STRIP" && STRIP=:
-test -z "$ac_objext" && ac_objext=o
-
-if test x"$host" != x"$build"; then
- ac_tool_prefix=${host_alias}-
-else
- ac_tool_prefix=
-fi
-
-# Transform linux* to *-*-linux-gnu*, to support old configure scripts.
-case $host_os in
-linux-gnu*) ;;
-linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
esac
-
-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
- # vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
- fi
- ;;
-esac
-
-# Determine commands to create old-style static archives.
-old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
-old_postinstall_cmds='chmod 644 $oldlib'
-old_postuninstall_cmds=
-
-if test -n "$RANLIB"; then
- case $host_os in
- openbsd*)
- old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
- ;;
- *)
- old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
- ;;
- esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
-fi
-
-# Allow CC to be a program name with arguments.
-set dummy $CC
-compiler="[$]2"
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([for objdir])
-rm -f .libs 2>/dev/null
-mkdir .libs 2>/dev/null
-if test -d .libs; then
- objdir=.libs
-else
- # MS-DOS does not allow filenames that begin with a dot.
- objdir=_libs
-fi
-rmdir .libs 2>/dev/null
-AC_MSG_RESULT($objdir)
-##
-## END FIXME
-
-
-## FIXME: this should be a separate macro
-##
-AC_ARG_WITH(pic,
-[ --with-pic try to use only PIC/non-PIC objects [default=use both]],
-pic_mode="$withval", pic_mode=default)
-test -z "$pic_mode" && pic_mode=default
-
-# We assume here that the value for lt_cv_prog_cc_pic will not be cached
-# in isolation, and that seeing it set (from the cache) indicates that
-# the associated values are set (in the cache) correctly too.
-AC_MSG_CHECKING([for $compiler option to produce PIC])
-AC_CACHE_VAL(lt_cv_prog_cc_pic,
-[ lt_cv_prog_cc_pic=
- lt_cv_prog_cc_shlib=
- lt_cv_prog_cc_wl=
- lt_cv_prog_cc_static=
- lt_cv_prog_cc_no_builtin=
- lt_cv_prog_cc_can_build_shared=$can_build_shared
-
- if test "$GCC" = yes; then
- lt_cv_prog_cc_wl='-Wl,'
- lt_cv_prog_cc_static='-static'
-
- 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
- # not sure about C++ programs.
- lt_cv_prog_cc_static="$lt_cv_prog_cc_static ${lt_cv_prog_cc_wl}-lC"
- ;;
- 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'.
- lt_cv_prog_cc_pic='-m68020 -resident32 -malways-restore-a4'
- ;;
- beos* | irix5* | irix6* | osf3* | osf4* | osf5*)
- # PIC is the default for these OSes.
- ;;
- darwin* | rhapsody*)
- # PIC is the default on this platform
- # Common symbols not allowed in MH_DYLIB files
- lt_cv_prog_cc_pic='-fno-common'
- ;;
- cygwin* | mingw* | pw32* | 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).
- lt_cv_prog_cc_pic='-DDLL_EXPORT'
- ;;
- sysv4*MP*)
- if test -d /usr/nec; then
- lt_cv_prog_cc_pic=-Kconform_pic
- fi
- ;;
- *)
- lt_cv_prog_cc_pic='-fPIC'
- ;;
- esac
- else
- # PORTME Check for PIC flags for the system compiler.
- case $host_os in
- aix3* | aix4* | aix5*)
- lt_cv_prog_cc_wl='-Wl,'
- # 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
- ;;
-
- hpux9* | hpux10* | hpux11*)
- # Is there a better lt_cv_prog_cc_static that works with the bundled CC?
- lt_cv_prog_cc_wl='-Wl,'
- lt_cv_prog_cc_static="${lt_cv_prog_cc_wl}-a ${lt_cv_prog_cc_wl}archive"
- lt_cv_prog_cc_pic='+Z'
- ;;
-
- irix5* | irix6*)
- lt_cv_prog_cc_wl='-Wl,'
- lt_cv_prog_cc_static='-non_shared'
- # PIC (with -KPIC) is the default.
- ;;
-
- cygwin* | mingw* | pw32* | 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).
- lt_cv_prog_cc_pic='-DDLL_EXPORT'
- ;;
-
- newsos6)
- lt_cv_prog_cc_pic='-KPIC'
- lt_cv_prog_cc_static='-Bstatic'
- ;;
-
- osf3* | osf4* | osf5*)
- # All OSF/1 code is PIC.
- lt_cv_prog_cc_wl='-Wl,'
- lt_cv_prog_cc_static='-non_shared'
- ;;
-
- sco3.2v5*)
- lt_cv_prog_cc_pic='-Kpic'
- lt_cv_prog_cc_static='-dn'
- lt_cv_prog_cc_shlib='-belf'
- ;;
-
- solaris*)
- lt_cv_prog_cc_pic='-KPIC'
- lt_cv_prog_cc_static='-Bstatic'
- lt_cv_prog_cc_wl='-Wl,'
- ;;
-
- sunos4*)
- lt_cv_prog_cc_pic='-PIC'
- lt_cv_prog_cc_static='-Bstatic'
- lt_cv_prog_cc_wl='-Qoption ld '
- ;;
-
- sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- lt_cv_prog_cc_pic='-KPIC'
- lt_cv_prog_cc_static='-Bstatic'
- if test "x$host_vendor" = xsni; then
- lt_cv_prog_cc_wl='-LD'
- else
- lt_cv_prog_cc_wl='-Wl,'
- fi
- ;;
-
- uts4*)
- lt_cv_prog_cc_pic='-pic'
- lt_cv_prog_cc_static='-Bstatic'
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec ;then
- lt_cv_prog_cc_pic='-Kconform_pic'
- lt_cv_prog_cc_static='-Bstatic'
- fi
- ;;
-
- *)
- lt_cv_prog_cc_can_build_shared=no
- ;;
- esac
- fi
-])
-if test -z "$lt_cv_prog_cc_pic"; then
- AC_MSG_RESULT([none])
-else
- AC_MSG_RESULT([$lt_cv_prog_cc_pic])
-
- # Check to make sure the pic_flag actually works.
- AC_MSG_CHECKING([if $compiler PIC flag $lt_cv_prog_cc_pic works])
- AC_CACHE_VAL(lt_cv_prog_cc_pic_works, [dnl
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $lt_cv_prog_cc_pic -DPIC"
- AC_TRY_COMPILE([], [], [dnl
- 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
- # assume that PIC is not supported.
- if test -s conftest.err; then
- lt_cv_prog_cc_pic_works=no
- else
- lt_cv_prog_cc_pic_works=yes
- fi
- ;;
- *)
- lt_cv_prog_cc_pic_works=yes
- ;;
- esac
- ], [dnl
- lt_cv_prog_cc_pic_works=no
- ])
- CFLAGS="$save_CFLAGS"
- ])
-
- if test "X$lt_cv_prog_cc_pic_works" = Xno; then
- lt_cv_prog_cc_pic=
- lt_cv_prog_cc_can_build_shared=no
- else
- lt_cv_prog_cc_pic=" $lt_cv_prog_cc_pic"
- fi
-
- AC_MSG_RESULT([$lt_cv_prog_cc_pic_works])
-fi
-##
-## END FIXME
-
-# Check for any special shared library compilation flags.
-if test -n "$lt_cv_prog_cc_shlib"; then
- AC_MSG_WARN([\`$CC' requires \`$lt_cv_prog_cc_shlib' to build shared libraries])
- if echo "$old_CC $old_CFLAGS " | egrep -e "[[ ]]$lt_cv_prog_cc_shlib[[ ]]" >/dev/null; then :
- else
- AC_MSG_WARN([add \`$lt_cv_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure])
- lt_cv_prog_cc_can_build_shared=no
- fi
-fi
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([if $compiler static flag $lt_cv_prog_cc_static works])
-AC_CACHE_VAL([lt_cv_prog_cc_static_works], [dnl
- lt_cv_prog_cc_static_works=no
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS $lt_cv_prog_cc_static"
- AC_TRY_LINK([], [], [lt_cv_prog_cc_static_works=yes])
- LDFLAGS="$save_LDFLAGS"
])
-# Belt *and* braces to stop my trousers falling down:
-test "X$lt_cv_prog_cc_static_works" = Xno && lt_cv_prog_cc_static=
-AC_MSG_RESULT([$lt_cv_prog_cc_static_works])
-
-pic_flag="$lt_cv_prog_cc_pic"
-special_shlib_compile_flags="$lt_cv_prog_cc_shlib"
-wl="$lt_cv_prog_cc_wl"
-link_static_flag="$lt_cv_prog_cc_static"
-no_builtin_flag="$lt_cv_prog_cc_no_builtin"
-can_build_shared="$lt_cv_prog_cc_can_build_shared"
-##
-## END FIXME
-
-
-## FIXME: this should be a separate macro
-##
-# Check to see if options -o and -c are simultaneously supported by compiler
-AC_MSG_CHECKING([if $compiler supports -c -o file.$ac_objext])
-AC_CACHE_VAL([lt_cv_compiler_c_o], [
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-echo "int some_variable = 0;" > 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.$ac_objext"
-compiler_c_o=no
-if { (eval echo configure:__oline__: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_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>&AC_FD_CC
- 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
-])
-compiler_c_o=$lt_cv_compiler_c_o
-AC_MSG_RESULT([$compiler_c_o])
-
-if test x"$compiler_c_o" = x"yes"; then
- # Check to see if we can write to a .lo
- AC_MSG_CHECKING([if $compiler supports -c -o file.lo])
- AC_CACHE_VAL([lt_cv_compiler_o_lo], [
- lt_cv_compiler_o_lo=no
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -c -o conftest.lo"
- save_objext="$ac_objext"
- ac_objext=lo
- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- lt_cv_compiler_o_lo=no
- else
- lt_cv_compiler_o_lo=yes
- fi
- ])
- ac_objext="$save_objext"
- CFLAGS="$save_CFLAGS"
- ])
- compiler_o_lo=$lt_cv_compiler_o_lo
- AC_MSG_RESULT([$compiler_o_lo])
-else
- compiler_o_lo=no
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Check to see if we can do hard links to lock some files if needed
-hard_links="nottested"
-if test "$compiler_c_o" = no && test "$need_locks" != no; then
- # do not overwrite the value of need_locks provided by the user
- AC_MSG_CHECKING([if we can lock with hard links])
- hard_links=yes
- $rm conftest*
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- touch conftest.a
- ln conftest.a conftest.b 2>&5 || hard_links=no
- ln conftest.a conftest.b 2>/dev/null && hard_links=no
- AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([\`$CC' does not support \`-c -o', so \`make -j' may be unsafe])
- need_locks=warn
- fi
-else
- need_locks=no
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-if test "$GCC" = yes; then
- # Check to see if options -fno-rtti -fno-exceptions are supported by compiler
- AC_MSG_CHECKING([if $compiler supports -fno-rtti -fno-exceptions])
- echo "int some_variable = 0;" > conftest.$ac_ext
- save_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.$ac_ext"
- compiler_rtti_exceptions=no
- AC_TRY_COMPILE([], [int some_variable = 0;], [dnl
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s conftest.err; then
- compiler_rtti_exceptions=no
- else
- compiler_rtti_exceptions=yes
- fi
- ])
- CFLAGS="$save_CFLAGS"
- AC_MSG_RESULT([$compiler_rtti_exceptions])
-
- if test "$compiler_rtti_exceptions" = "yes"; then
- no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions'
- else
- no_builtin_flag=' -fno-builtin'
- fi
-fi
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# See if the linker supports building shared libraries.
-AC_MSG_CHECKING([whether the linker ($LD) supports shared libraries])
-
-allow_undefined_flag=
-no_undefined_flag=
-need_lib_prefix=unknown
-need_version=unknown
-# when you set need_version to no, make sure it does not cause -set_version
-# flags to be left without arguments
-archive_cmds=
-archive_expsym_cmds=
-old_archive_from_new_cmds=
-old_archive_from_expsyms_cmds=
-export_dynamic_flag_spec=
-whole_archive_flag_spec=
-thread_safe_flag_spec=
-hardcode_into_libs=no
-hardcode_libdir_flag_spec=
-hardcode_libdir_separator=
-hardcode_direct=no
-hardcode_minus_L=no
-hardcode_shlibpath_var=unsupported
-runpath_var=
-link_all_deplibs=unknown
-always_export_symbols=no
-export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols'
-# include_expsyms should be a list of space-separated symbols to be *always*
-# included in the symbol list
-include_expsyms=
-# exclude_expsyms can be an egrep regular expression of symbols to exclude
-# it will be wrapped by ` (' and `)$', so one must not match beginning or
-# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
-# as well as any symbol that contains `d'.
-exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
-# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
-# platforms (ab)use it in PIC code, but their linkers get confused if
-# the symbol is explicitly referenced. Since portable code cannot
-# rely on this symbol name, it's probably fine to never include it in
-# preloaded symbol tables.
-extract_expsyms_cmds=
-
-case $host_os in
-cygwin* | mingw* | pw32*)
- # FIXME: the MSVC++ port hasn't been tested in a loooong time
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- if test "$GCC" != yes; then
- with_gnu_ld=no
- fi
- ;;
-openbsd*)
- with_gnu_ld=no
- ;;
-esac
-
-ld_shlibs=yes
-if test "$with_gnu_ld" = yes; then
- # If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
-
- # See if GNU ld supports shared libraries.
- case $host_os in
- aix3* | aix4* | aix5*)
- # On AIX, the GNU linker is very broken
- # Note:Check GNU linker on AIX 5-IA64 when/if it becomes available.
- 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.
-*** Therefore, libtool is disabling shared libraries support. If you
-*** really care for shared libraries, you may want to modify your PATH
-*** so that a non-GNU linker is found, and then restart.
-
-EOF
- ;;
-
- 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)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
-
- # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
- # that the semantics of dynamic libraries on AmigaOS, at least up
- # to version 4, is to share data among multiple programs linked
- # with the same dynamic library. Since this doesn't match the
- # behavior of shared libraries on other platforms, we can use
- # them.
- ld_shlibs=no
- ;;
-
- beos*)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- allow_undefined_flag=unsupported
- # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
- # support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- else
- ld_shlibs=no
- fi
- ;;
-
- cygwin* | mingw* | pw32*)
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec='-L$libdir'
- allow_undefined_flag=unsupported
- always_export_symbols=yes
-
- extract_expsyms_cmds='test -f $output_objdir/impgen.c || \
- sed -e "/^# \/\* impgen\.c starts here \*\//,/^# \/\* impgen.c ends here \*\// { s/^# //;s/^# *$//; p; }" -e d < $''0 > $output_objdir/impgen.c~
- 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/$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'
-
- # cygwin and mingw dlls have different entry points and sets of symbols
- # to exclude.
- # 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
- mingw*)
- # mingw values
- dll_entry=_DllMainCRTStartup@12
- dll_exclude_symbols=DllMain@12,DllMainCRTStartup@12,DllEntryPoint@12~
- ;;
- esac
-
- # mingw and cygwin differ, and it's simplest to just exclude the union
- # of the two symbol sets.
- dll_exclude_symbols=DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12,DllMainCRTStartup@12,DllEntryPoint@12
-
- # recent cygwin and mingw systems supply a stub DllMain which the user
- # can override, but on older systems we have to supply one (in ltdll.c)
- if test "x$lt_cv_need_dllmain" = "xyes"; then
- ltdll_obj='$output_objdir/$soname-ltdll.'"$ac_objext "
- ltdll_cmds='test -f $output_objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $''0 > $output_objdir/$soname-ltdll.c~
- test -f $output_objdir/$soname-ltdll.$ac_objext || (cd $output_objdir && $CC -c $soname-ltdll.c)~'
- else
- ltdll_obj=
- ltdll_cmds=
- fi
-
- # Extract the symbol export list from an `--export-all' def file,
- # then regenerate the def file from the symbol export list, so that
- # the compiled dll only exports the symbol export list.
- # Be careful not to strip the DATA tag left be newer dlltools.
- export_symbols_cmds="$ltdll_cmds"'
- $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='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 $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_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*)
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
- wlarc=
- else
- 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
- ;;
-
- solaris* | sysv5*)
- if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then
- ld_shlibs=no
- cat <<EOF 1>&2
-
-*** Warning: The releases 2.8.* of the GNU linker cannot reliably
-*** create shared libraries on Solaris systems. Therefore, libtool
-*** is disabling shared libraries support. We urge you to upgrade GNU
-*** binutils to release 2.9.1 or newer. Another option is to modify
-*** your PATH or compiler configuration so that the native linker is
-*** used, and then restart.
-
-EOF
- elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- 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
- ;;
-
- sunos4*)
- archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- wlarc=
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- *)
- if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then
- 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
- ;;
- esac
-
- if test "$ld_shlibs" = yes; then
- runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
- case $host_os in
- cygwin* | mingw* | pw32*)
- # dlltool doesn't understand --whole-archive et. al.
- whole_archive_flag_spec=
- ;;
- *)
- # ancient GNU ld didn't support --whole-archive et. al.
- if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
- else
- whole_archive_flag_spec=
- fi
- ;;
- esac
- fi
-else
- # PORTME fill in a description of your system's linker (not GNU ld)
- case $host_os in
- aix3*)
- allow_undefined_flag=unsupported
- always_export_symbols=yes
- archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
- # Note: this linker hardcodes the directories in LIBPATH if there
- # are no directories specified by -L.
- hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$link_static_flag"; then
- # Neither direct hardcoding nor static linking is supported with a
- # broken collect2.
- hardcode_direct=unsupported
- fi
- ;;
-
- aix4* | aix5*)
- 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
- exp_sym_flag='-Bexport'
- no_entry_flag=""
- else
- aix_use_runtimelinking=no
-
- # 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 runtime linking.
- case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
- for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
- aix_use_runtimelinking=yes
- break
- fi
- done
- esac
-
- exp_sym_flag='-bexport'
- no_entry_flag='-bnoentry'
- fi
-
- # 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.
-
- hardcode_direct=yes
- archive_cmds=''
- hardcode_libdir_separator=':'
- if test "$GCC" = yes; then
- case $host_os in aix4.[[012]]|aix4.[[012]].*)
- 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
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
- else
- shared_flag='${wl}-bM:SRE'
- fi
- fi
- fi
-
- # It seems that -bexpall can do strange things, so it is better to
- # generate a list of symbols to export.
- always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
- # Warning - without using the other runtime loading flags (-brtl),
- # -berok will link without error, but may produce a broken library.
- allow_undefined_flag='-berok'
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:/usr/lib:/lib'
- archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
- else
- if test "$host_cpu" = ia64; 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 ${wl}-h$soname $libobjs $deplibs $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"
- else
- hardcode_libdir_flag_spec='${wl}-bnolibpath ${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.
- allow_undefined_flag='${wl}-berok'
- # This is a bit strange, but 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 ${allow_undefined_flag} '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols"' ~$AR -crlo $objdir/$libname$release.a $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)'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- # see comment about different semantics on the GNU ld section
- ld_shlibs=no
- ;;
-
- cygwin* | mingw* | pw32*)
- # When not using gcc, we currently assume that we are using
- # Microsoft Visual C++.
- # hardcode_libdir_flag_spec is actually meaningless, as there is
- # no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- 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"`'
- ;;
-
- darwin* | rhapsody*)
- case "$host_os" in
- rhapsody* | darwin1.[[012]])
- allow_undefined_flag='-undefined suppress'
- ;;
- *) # Darwin 1.3 on
- allow_undefined_flag='-flat_namespace -undefined suppress'
- ;;
- esac
- # FIXME: Relying on posixy $() will cause problems for
- # cross-compilation, but unfortunately the echo tests do not
- # yet detect zsh echo's removal of \ escapes.
- archive_cmds='$nonopt $(test "x$module" = xyes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $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'
- ;;
-
- freebsd1*)
- ld_shlibs=no
- ;;
-
- # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
- # support. Future versions do this automatically, but an explicit c++rt0.o
- # does not break anything, and helps significantly (at the cost of a little
- # extra space).
- freebsd2.2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- # Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
- freebsd*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- 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
- 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'
- ;;
-
- irix5* | irix6*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- link_all_deplibs=yes
- ;;
-
- netbsd*)
- 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
- fi
- hardcode_libdir_flag_spec='-R$libdir'
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- ;;
-
- newsos6)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- hardcode_shlibpath_var=no
- ;;
-
- openbsd*)
- hardcode_direct=yes
- hardcode_shlibpath_var=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
- else
- case "$host_os" in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
- fi
- ;;
-
- os2*)
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_minus_L=yes
- allow_undefined_flag=unsupported
- archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
- ;;
-
- osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- else
- allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
- fi
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- hardcode_libdir_separator=:
- ;;
-
- osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$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}${output_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 ${output_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'
-
- #Both c and cxx compiler support -rpath directly
- hardcode_libdir_flag_spec='-rpath $libdir'
- fi
- hardcode_libdir_separator=:
- ;;
-
- sco3.2v5*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- export_dynamic_flag_spec='${wl}-Bexport'
- ;;
-
- solaris*)
- # gcc --version < 3.0 without binutils cannot create self contained
- # shared libraries reliably, requiring libgcc.a to resolve some of
- # the object symbols generated in some cases. Libraries that use
- # assert need libgcc.a to resolve __eprintf, for example. Linking
- # a copy of libgcc.a into every shared library to guarantee resolving
- # such symbols causes other problems: According to Tim Van Holder
- # <tim.van.holder@pandora.be>, C++ libraries end up with a separate
- # (to the application) exception stack for one thing.
- no_undefined_flag=' -z defs'
- if test "$GCC" = yes; then
- case `$CC --version 2>/dev/null` in
- [[12]].*)
- cat <<EOF 1>&2
-
-*** Warning: Releases of GCC earlier than version 3.0 cannot reliably
-*** create self contained shared libraries on Solaris systems, without
-*** introducing a dependency on libgcc.a. Therefore, libtool is disabling
-*** -no-undefined support, which will at least allow you to build shared
-*** libraries. However, you may find that when you link such libraries
-*** into an application without using GCC, you have to manually add
-*** \`gcc --print-libgcc-file-name\` to the link command. We urge you to
-*** upgrade to a newer version of GCC. Another option is to rebuild your
-*** current GCC to use the GNU linker from GNU binutils 2.9.1 or newer.
-
-EOF
- no_undefined_flag=
- ;;
- esac
- fi
- # $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'
- 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'
- hardcode_shlibpath_var=no
- 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' ;;
- esac
- link_all_deplibs=yes
- ;;
-
- sunos4*)
- if test "x$host_vendor" = xsequent; then
- # Use $CC to link under sequent, because it throws in some extra .o
- # files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
- else
- archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
- fi
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_direct=yes
- hardcode_minus_L=yes
- hardcode_shlibpath_var=no
- ;;
-
- sysv4)
- if test "x$host_vendor" = xsno; then
- archive_cmds='$LD -G -Bsymbolic -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes # is this really true???
- else
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=no #Motorola manual says yes, but my tests say they lie
- fi
- runpath_var='LD_RUN_PATH'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4.3*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- export_dynamic_flag_spec='-Bexport'
- ;;
-
- sysv5*)
- 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'
- 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=
- hardcode_shlibpath_var=no
- runpath_var='LD_RUN_PATH'
- ;;
-
- uts4*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- dgux*)
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-L$libdir'
- hardcode_shlibpath_var=no
- ;;
-
- sysv4*MP*)
- if test -d /usr/nec; then
- archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
- hardcode_shlibpath_var=no
- runpath_var=LD_RUN_PATH
- hardcode_runpath_var=yes
- ld_shlibs=yes
- fi
- ;;
-
- sysv4.2uw2*)
- archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
- hardcode_direct=yes
- hardcode_minus_L=no
- hardcode_shlibpath_var=no
- hardcode_runpath_var=yes
- runpath_var=LD_RUN_PATH
- ;;
-
- 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
- ;;
-
- *)
- ld_shlibs=no
- ;;
- esac
-fi
-AC_MSG_RESULT([$ld_shlibs])
-test "$ld_shlibs" = no && can_build_shared=no
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Check hardcoding attributes.
-AC_MSG_CHECKING([how to hardcode library paths into programs])
-hardcode_action=
-if test -n "$hardcode_libdir_flag_spec" || \
- test -n "$runpath_var"; then
-
- # We can hardcode non-existant directories.
- if test "$hardcode_direct" != no &&
- # If the only mechanism to avoid hardcoding is shlibpath_var, we
- # have to relink, otherwise we might link with an installed library
- # when we should be linking with a yet-to-be-installed one
- ## test "$hardcode_shlibpath_var" != no &&
- test "$hardcode_minus_L" != no; then
- # Linking always hardcodes the temporary library directory.
- hardcode_action=relink
- else
- # We can link without hardcoding, and we can hardcode nonexisting dirs.
- hardcode_action=immediate
- fi
-else
- # We cannot hardcode anything, or else we can only hardcode existing
- # directories.
- hardcode_action=unsupported
-fi
-AC_MSG_RESULT([$hardcode_action])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-striplib=
-old_striplib=
-AC_MSG_CHECKING([whether stripping libraries is possible])
-if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
- test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
- test -z "$striplib" && striplib="$STRIP --strip-unneeded"
- AC_MSG_RESULT([yes])
-else
- AC_MSG_RESULT([no])
-fi
-##
-## END FIXME
-
-reload_cmds='$LD$reload_flag -o $output$reload_objs'
-test -z "$deplibs_check_method" && deplibs_check_method=unknown
-
-## FIXME: this should be a separate macro
-##
-# PORTME Fill in your ld.so characteristics
-AC_MSG_CHECKING([dynamic linker characteristics])
-library_names_spec=
-libname_spec='lib$name'
-soname_spec=
-postinstall_cmds=
-postuninstall_cmds=
-finish_cmds=
-finish_eval=
-shlibpath_var=
-shlibpath_overrides_runpath=unknown
-version_type=none
-dynamic_linker="$host_os ld.so"
-sys_lib_dlsearch_path_spec="/lib /usr/lib"
-sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
-
-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.
- soname_spec='${libname}${release}.so$major'
- ;;
-
-aix4* | aix5*)
- version_type=linux
- if test "$host_cpu" = ia64; then
- # AIX 5 supports IA64
- library_names_spec='${libname}${release}.so$major ${libname}${release}.so$versuffix $libname.so'
- shlibpath_var=LD_LIBRARY_PATH
- 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.
- 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
- can_build_shared=no
- fi
- ;;
- esac
- # 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.
- 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 through 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
- shlibpath_var=LIBPATH
- fi
- ;;
-
-amigaos*)
- library_names_spec='$libname.ixlibrary $libname.a'
- # Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
- ;;
-
-beos*)
- library_names_spec='${libname}.so'
- dynamic_linker="$host_os ld.so"
- shlibpath_var=LIBRARY_PATH
- ;;
-
-bsdi4*)
- version_type=linux
- need_version=no
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- soname_spec='${libname}${release}.so$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
- sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
- export_dynamic_flag_spec=-rdynamic
- # the default ld.so.conf also contains /usr/contrib/lib and
- # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
- # libtool to hard-code these into programs
- ;;
-
-cygwin* | mingw* | pw32*)
- version_type=windows
- need_version=no
- need_lib_prefix=no
- case $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'
- 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'
- ;;
- esac
- dynamic_linker='Win32 ld.exe'
- # FIXME: first we should search . and the directory the executable is in
- shlibpath_var=PATH
- ;;
-
-darwin* | rhapsody*)
- dynamic_linker="$host_os dyld"
- version_type=darwin
- need_lib_prefix=no
- need_version=no
- # FIXME: Relying on posixy $() will cause problems for
- # cross-compilation, but unfortunately the echo tests do not
- # yet detect zsh echo's removal of \ escapes.
- 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
- ;;
-
-freebsd*)
- objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
- version_type=freebsd-$objformat
- case $version_type in
- freebsd-elf*)
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
- need_version=no
- need_lib_prefix=no
- ;;
- freebsd-*)
- library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix'
- need_version=yes
- ;;
- esac
- shlibpath_var=LD_LIBRARY_PATH
- case $host_os in
- freebsd2*)
- shlibpath_overrides_runpath=yes
- ;;
- *)
- shlibpath_overrides_runpath=no
- hardcode_into_libs=yes
- ;;
- esac
- ;;
-
-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so'
- soname_spec='${libname}${release}.so$major'
- shlibpath_var=LD_LIBRARY_PATH
- hardcode_into_libs=yes
- ;;
-
-hpux9* | hpux10* | hpux11*)
- # Give a soname corresponding to the major version so that dld.sl refuses to
- # link against other versions.
- dynamic_linker="$host_os dld.sl"
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- shlibpath_var=SHLIB_PATH
- shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl'
- soname_spec='${libname}${release}.sl$major'
- # HP-UX runs *really* slowly unless shared libraries are mode 555.
- postinstall_cmds='chmod 555 $lib'
- ;;
-
-irix5* | irix6*)
- version_type=irix
- need_lib_prefix=no
- 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
- irix5*)
- libsuff= shlibsuff=
- ;;
- *)
- 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;;
- *) libsuff= shlibsuff= libmagic=never-match;;
- esac
- ;;
- esac
- shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
- ;;
-
-# No shared lib support for Linux oldld, aout, or coff.
-linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*)
- dynamic_linker=no
- ;;
-
-# This must be Linux ELF.
-linux-gnu*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- soname_spec='${libname}${release}.so$major'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=no
- # This implies no fast_install, which is unacceptable.
- # Some rework will be needed to allow for fast_install
- # before this can be enabled.
- hardcode_into_libs=yes
-
- # We used to test for /lib/ld.so.1 and disable shared libraries on
- # powerpc, because MkLinux only supported shared libraries with the
- # GNU dynamic linker. Since this was broken with cross compilers,
- # most powerpc-linux boxes support dynamic linking these days and
- # people can always --disable-shared, the test was removed, and we
- # assume the GNU/Linux dynamic linker is in use.
- dynamic_linker='GNU/Linux ld.so'
- ;;
-
-netbsd*)
- version_type=sunos
- need_lib_prefix=no
- need_version=no
- if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- dynamic_linker='NetBSD (a.out) ld.so'
- else
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so'
- soname_spec='${libname}${release}.so$major'
- dynamic_linker='NetBSD ld.elf_so'
- fi
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- 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
- need_lib_prefix=no
- need_version=no
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case "$host_os" in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
- finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-os2*)
- libname_spec='$name'
- need_lib_prefix=no
- library_names_spec='$libname.dll $libname.a'
- dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
- ;;
-
-osf3* | osf4* | osf5*)
- version_type=osf
- need_version=no
- soname_spec='${libname}${release}.so'
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so'
- shlibpath_var=LD_LIBRARY_PATH
- sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
- ;;
-
-sco3.2v5*)
- version_type=osf
- soname_spec='${libname}${release}.so$major'
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-solaris*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- soname_spec='${libname}${release}.so$major'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- hardcode_into_libs=yes
- # ldd complains unless libraries are executable
- postinstall_cmds='chmod +x $lib'
- ;;
-
-sunos4*)
- version_type=sunos
- library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix'
- finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
- shlibpath_var=LD_LIBRARY_PATH
- shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
- need_lib_prefix=no
- fi
- need_version=yes
- ;;
-
-sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- version_type=linux
- 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
- sni)
- shlibpath_overrides_runpath=no
- ;;
- motorola)
- need_lib_prefix=no
- need_version=no
- shlibpath_overrides_runpath=no
- sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
- ;;
- esac
- ;;
-
-uts4*)
- version_type=linux
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- soname_spec='${libname}${release}.so$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-dgux*)
- version_type=linux
- need_lib_prefix=no
- need_version=no
- library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
- soname_spec='${libname}${release}.so$major'
- shlibpath_var=LD_LIBRARY_PATH
- ;;
-
-sysv4*MP*)
- if test -d /usr/nec ;then
- version_type=linux
- library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so'
- soname_spec='$libname.so.$major'
- shlibpath_var=LD_LIBRARY_PATH
- fi
- ;;
-
-*)
- dynamic_linker=no
- ;;
-esac
-AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# Report the final consequences.
-AC_MSG_CHECKING([if libtool supports shared libraries])
-AC_MSG_RESULT([$can_build_shared])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([whether to build shared libraries])
-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
-aix3*)
- test "$enable_shared" = yes && enable_static=no
- if test -n "$RANLIB"; then
- archive_cmds="$archive_cmds~\$RANLIB \$lib"
- postinstall_cmds='$RANLIB $lib'
- fi
- ;;
-
-aix4*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
- fi
- ;;
-esac
-AC_MSG_RESULT([$enable_shared])
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-AC_MSG_CHECKING([whether to build static libraries])
-# Make sure either enable_shared or enable_static is yes.
-test "$enable_shared" = yes || enable_static=yes
-AC_MSG_RESULT([$enable_static])
-##
-## END FIXME
-
-if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
- # Fast installation is not necessary
- enable_fast_install=needless
-fi
-
-variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
- variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
-fi
-
-AC_LIBTOOL_DLOPEN_SELF
-
-## FIXME: this should be a separate macro
-##
-if test "$enable_shared" = yes && test "$GCC" = yes; then
- case $archive_cmds in
- *'~'*)
- # FIXME: we may have to deal with multi-command sequences.
- ;;
- '$CC '*)
- # Test whether the compiler implicitly links with -lc since on some
- # systems, -lgcc has to come before -lc. If gcc already passes -lc
- # to ld, don't add -lc before -lgcc.
- AC_MSG_CHECKING([whether -lc should be explicitly linked in])
- AC_CACHE_VAL([lt_cv_archive_cmds_need_lc],
- [$rm conftest*
- echo 'static int dummy;' > conftest.$ac_ext
-
- if AC_TRY_EVAL(ac_compile); then
- soname=conftest
- lib=conftest
- libobjs=conftest.$ac_objext
- deplibs=
- wl=$lt_cv_prog_cc_wl
- compiler_flags=-v
- linker_flags=-v
- verstring=
- output_objdir=.
- libname=conftest
- save_allow_undefined_flag=$allow_undefined_flag
- allow_undefined_flag=
- if AC_TRY_EVAL(archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
- then
- lt_cv_archive_cmds_need_lc=no
- else
- lt_cv_archive_cmds_need_lc=yes
- fi
- allow_undefined_flag=$save_allow_undefined_flag
- else
- cat conftest.err 1>&5
- fi])
- AC_MSG_RESULT([$lt_cv_archive_cmds_need_lc])
- ;;
- esac
-fi
-need_lc=${lt_cv_archive_cmds_need_lc-yes}
-##
-## END FIXME
-
-## FIXME: this should be a separate macro
-##
-# The second clause should only fire when bootstrapping the
-# libtool distribution, otherwise you forgot to ship ltmain.sh
-# with your package, and you will get complaints that there are
-# no rules to generate ltmain.sh.
-if test -f "$ltmain"; then
- :
-else
- # If there is no Makefile yet, we rely on a make rule to execute
- # `config.status --recheck' to rerun these tests and create the
- # libtool script then.
- test -f Makefile && make "$ltmain"
-fi
-
-if test -f "$ltmain"; then
- trap "$rm \"${ofile}T\"; exit 1" 1 2 15
- $rm -f "${ofile}T"
-
- echo creating $ofile
-
- # Now quote all the things that may contain metacharacters while being
- # careful not to overquote the AC_SUBSTed values. We take copies of the
- # variables and quote the copies for generation of the libtool script.
- for var in echo old_CC old_CFLAGS \
- AR AR_FLAGS CC LD LN_S NM SHELL \
- reload_flag reload_cmds wl \
- pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \
- thread_safe_flag_spec whole_archive_flag_spec libname_spec \
- library_names_spec soname_spec \
- RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \
- old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds \
- postuninstall_cmds extract_expsyms_cmds old_archive_from_expsyms_cmds \
- old_striplib striplib file_magic_cmd export_symbols_cmds \
- deplibs_check_method allow_undefined_flag no_undefined_flag \
- finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \
- global_symbol_to_c_name_address \
- hardcode_libdir_flag_spec hardcode_libdir_separator \
- sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
- compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do
-
- 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 | \
- extract_expsyms_cmds | old_archive_from_expsyms_cmds | \
- postinstall_cmds | postuninstall_cmds | \
- finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
- # Double-quote double-evaled strings.
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
- ;;
- *)
- eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
- ;;
- esac
- done
-
- cat <<__EOF__ > "${ofile}T"
-#! $SHELL
-
-# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
-# Copyright (C) 1996-2000 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
-# 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.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-# Sed that helps us avoid accidentally triggering echo(1) options like -n.
-Xsed="sed -e s/^X//"
-
-# The HP-UX ksh and POSIX shell print the target directory to stdout
-# if CDPATH is set.
-if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
-
-# ### BEGIN LIBTOOL CONFIG
-
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-
-# Shell to use when invoking shell scripts.
-SHELL=$lt_SHELL
-
-# Whether or not to build shared libraries.
-build_libtool_libs=$enable_shared
-
-# Whether or not to build static libraries.
-build_old_libs=$enable_static
-
-# Whether or not to add -lc for building shared libraries.
-build_libtool_need_lc=$need_lc
-
-# Whether or not to optimize for fast installation.
-fast_install=$enable_fast_install
-
-# The host system.
-host_alias=$host_alias
-host=$host
-
-# An echo program that does not interpret backslashes.
-echo=$lt_echo
-
-# The archiver.
-AR=$lt_AR
-AR_FLAGS=$lt_AR_FLAGS
-
-# The default C compiler.
-CC=$lt_CC
-
-# Is the compiler the GNU C compiler?
-with_gcc=$GCC
-
-# The linker used to build libraries.
-LD=$lt_LD
-
-# Whether we need hard or soft links.
-LN_S=$lt_LN_S
-
-# A BSD-compatible nm program.
-NM=$lt_NM
-
-# A symbol stripping program
-STRIP=$STRIP
-
-# Used to examine libraries when file_magic_cmd begins "file"
-MAGIC_CMD=$MAGIC_CMD
-
-# Used on cygwin: DLL creation program.
-DLLTOOL="$DLLTOOL"
-
-# Used on cygwin: object dumper.
-OBJDUMP="$OBJDUMP"
-
-# Used on cygwin: assembler.
-AS="$AS"
-
-# The name of the directory that contains temporary libtool files.
-objdir=$objdir
-
-# How to create reloadable object files.
-reload_flag=$lt_reload_flag
-reload_cmds=$lt_reload_cmds
-
-# How to pass a linker flag through the compiler.
-wl=$lt_wl
-
-# Object file suffix (normally "o").
-objext="$ac_objext"
-
-# Old archive suffix (normally "a").
-libext="$libext"
-
-# Executable file suffix (normally "").
-exeext="$exeext"
-
-# Additional compiler flags for building library objects.
-pic_flag=$lt_pic_flag
-pic_mode=$pic_mode
-
-# Does compiler simultaneously support -c and -o options?
-compiler_c_o=$lt_compiler_c_o
-
-# Can we write directly to a .lo ?
-compiler_o_lo=$lt_compiler_o_lo
-
-# Must we lock files when doing compilation ?
-need_locks=$lt_need_locks
-
-# Do we need the lib prefix for modules?
-need_lib_prefix=$need_lib_prefix
-
-# Do we need a version for libraries?
-need_version=$need_version
-
-# Whether dlopen is supported.
-dlopen_support=$enable_dlopen
-
-# Whether dlopen of programs is supported.
-dlopen_self=$enable_dlopen_self
-
-# Whether dlopen of statically linked programs is supported.
-dlopen_self_static=$enable_dlopen_self_static
-
-# Compiler flag to prevent dynamic linking.
-link_static_flag=$lt_link_static_flag
-
-# Compiler flag to turn off builtin functions.
-no_builtin_flag=$lt_no_builtin_flag
-
-# Compiler flag to allow reflexive dlopens.
-export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
-
-# Compiler flag to generate shared objects directly from archives.
-whole_archive_flag_spec=$lt_whole_archive_flag_spec
-
-# Compiler flag to generate thread-safe objects.
-thread_safe_flag_spec=$lt_thread_safe_flag_spec
-
-# Library versioning type.
-version_type=$version_type
-
-# Format of library name prefix.
-libname_spec=$lt_libname_spec
-
-# List of archive names. First name is the real one, the rest are links.
-# The last name is the one that the linker finds with -lNAME.
-library_names_spec=$lt_library_names_spec
-
-# The coded name of the library, if different from the real name.
-soname_spec=$lt_soname_spec
-
-# Commands used to build and install an old-style archive.
-RANLIB=$lt_RANLIB
-old_archive_cmds=$lt_old_archive_cmds
-old_postinstall_cmds=$lt_old_postinstall_cmds
-old_postuninstall_cmds=$lt_old_postuninstall_cmds
-
-# Create an old-style archive from a shared archive.
-old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
-
-# Create a temporary old-style archive to link instead of a shared archive.
-old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
-
-# Commands used to build and install a shared archive.
-archive_cmds=$lt_archive_cmds
-archive_expsym_cmds=$lt_archive_expsym_cmds
-postinstall_cmds=$lt_postinstall_cmds
-postuninstall_cmds=$lt_postuninstall_cmds
-
-# Commands to strip libraries.
-old_striplib=$lt_old_striplib
-striplib=$lt_striplib
-
-# Method to check whether dependent libraries are shared objects.
-deplibs_check_method=$lt_deplibs_check_method
-
-# Command to use when deplibs_check_method == file_magic.
-file_magic_cmd=$lt_file_magic_cmd
-
-# Flag that allows shared libraries with undefined symbols to be built.
-allow_undefined_flag=$lt_allow_undefined_flag
-
-# Flag that forces no undefined symbols.
-no_undefined_flag=$lt_no_undefined_flag
-
-# Commands used to finish a libtool library installation in a directory.
-finish_cmds=$lt_finish_cmds
-
-# Same as above, but a single script fragment to be evaled but not shown.
-finish_eval=$lt_finish_eval
-
-# Take the output of nm and produce a listing of raw symbols and C names.
-global_symbol_pipe=$lt_global_symbol_pipe
-
-# Transform the output of nm in a proper C declaration
-global_symbol_to_cdecl=$lt_global_symbol_to_cdecl
-
-# Transform the output of nm in a C name address pair
-global_symbol_to_c_name_address=$lt_global_symbol_to_c_name_address
-
-# This is the shared library runtime path variable.
-runpath_var=$runpath_var
-
-# This is the shared library path variable.
-shlibpath_var=$shlibpath_var
-
-# Is shlibpath searched before the hard-coded library search path?
-shlibpath_overrides_runpath=$shlibpath_overrides_runpath
-
-# How to hardcode a shared library path into an executable.
-hardcode_action=$hardcode_action
-
-# Whether we should hardcode library paths into libraries.
-hardcode_into_libs=$hardcode_into_libs
-
-# Flag to hardcode \$libdir into a binary during linking.
-# This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-
-# Whether we need a single -rpath flag with a separated argument.
-hardcode_libdir_separator=$lt_hardcode_libdir_separator
-
-# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
-# resulting binary.
-hardcode_direct=$hardcode_direct
-
-# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
-# resulting binary.
-hardcode_minus_L=$hardcode_minus_L
-
-# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
-# the resulting binary.
-hardcode_shlibpath_var=$hardcode_shlibpath_var
-
-# Variables whose values should be saved in libtool wrapper scripts and
-# restored at relink time.
-variables_saved_for_relink="$variables_saved_for_relink"
-
-# Whether libtool must link a program against all its dependency libraries.
-link_all_deplibs=$link_all_deplibs
-
-# Compile-time system search path for libraries
-sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-
-# Run-time system search path for libraries
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
-
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path="$fix_srcfile_path"
-
-# Set to yes if exported symbols are required.
-always_export_symbols=$always_export_symbols
-
-# The commands to list exported symbols.
-export_symbols_cmds=$lt_export_symbols_cmds
-
-# The commands to extract the exported symbol list from a shared archive.
-extract_expsyms_cmds=$lt_extract_expsyms_cmds
-
-# Symbols that should not be listed in the preloaded symbols.
-exclude_expsyms=$lt_exclude_expsyms
-
-# Symbols that must always be exported.
-include_expsyms=$lt_include_expsyms
-
-# ### END LIBTOOL CONFIG
-
-__EOF__
-
- case $host_os in
- aix3*)
- cat <<\EOF >> "${ofile}T"
-
-# AIX sometimes has problems with the GCC collect2 program. For some
-# reason, if we set the COLLECT_NAMES environment variable, the problems
-# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
- COLLECT_NAMES=
- export COLLECT_NAMES
-fi
-EOF
- ;;
- esac
-
- case $host_os in
- cygwin* | mingw* | pw32* | os2*)
- cat <<'EOF' >> "${ofile}T"
- # This is a source program that is used to create dlls on Windows
- # Don't remove nor modify the starting and closing comments
-# /* ltdll.c starts here */
-# #define WIN32_LEAN_AND_MEAN
-# #include <windows.h>
-# #undef WIN32_LEAN_AND_MEAN
-# #include <stdio.h>
-#
-# #ifndef __CYGWIN__
-# # ifdef __CYGWIN32__
-# # define __CYGWIN__ __CYGWIN32__
-# # endif
-# #endif
-#
-# #ifdef __cplusplus
-# extern "C" {
-# #endif
-# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
-# #ifdef __cplusplus
-# }
-# #endif
-#
-# #ifdef __CYGWIN__
-# #include <cygwin/cygwin_dll.h>
-# DECLARE_CYGWIN_DLL( DllMain );
-# #endif
-# HINSTANCE __hDllInstance_base;
-#
-# BOOL APIENTRY
-# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
-# {
-# __hDllInstance_base = hInst;
-# return TRUE;
-# }
-# /* ltdll.c ends here */
- # This is a source program that is used to create import libraries
- # on Windows for dlls which lack them. Don't remove nor modify the
- # starting and closing comments
-# /* impgen.c starts here */
-# /* Copyright (C) 1999-2000 Free Software Foundation, Inc.
-#
-# This file is part of GNU libtool.
-#
-# 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.
-# */
-#
-# #include <stdio.h> /* for printf() */
-# #include <unistd.h> /* for open(), lseek(), read() */
-# #include <fcntl.h> /* for O_RDONLY, O_BINARY */
-# #include <string.h> /* for strdup() */
-#
-# /* O_BINARY isn't required (or even defined sometimes) under Unix */
-# #ifndef O_BINARY
-# #define O_BINARY 0
-# #endif
-#
-# static unsigned int
-# pe_get16 (fd, offset)
-# int fd;
-# int offset;
-# {
-# unsigned char b[2];
-# lseek (fd, offset, SEEK_SET);
-# read (fd, b, 2);
-# return b[0] + (b[1]<<8);
-# }
-#
-# static unsigned int
-# pe_get32 (fd, offset)
-# int fd;
-# int offset;
-# {
-# unsigned char b[4];
-# lseek (fd, offset, SEEK_SET);
-# read (fd, b, 4);
-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# static unsigned int
-# pe_as32 (ptr)
-# void *ptr;
-# {
-# unsigned char *b = ptr;
-# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24);
-# }
-#
-# int
-# main (argc, argv)
-# int argc;
-# char *argv[];
-# {
-# int dll;
-# unsigned long pe_header_offset, opthdr_ofs, num_entries, i;
-# unsigned long export_rva, export_size, nsections, secptr, expptr;
-# unsigned long name_rvas, nexp;
-# unsigned char *expdata, *erva;
-# char *filename, *dll_name;
-#
-# filename = argv[1];
-#
-# dll = open(filename, O_RDONLY|O_BINARY);
-# if (dll < 1)
-# return 1;
-#
-# dll_name = filename;
-#
-# for (i=0; filename[i]; i++)
-# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':')
-# dll_name = filename + i +1;
-#
-# pe_header_offset = pe_get32 (dll, 0x3c);
-# opthdr_ofs = pe_header_offset + 4 + 20;
-# num_entries = pe_get32 (dll, opthdr_ofs + 92);
-#
-# if (num_entries < 1) /* no exports */
-# return 1;
-#
-# export_rva = pe_get32 (dll, opthdr_ofs + 96);
-# export_size = pe_get32 (dll, opthdr_ofs + 100);
-# nsections = pe_get16 (dll, pe_header_offset + 4 +2);
-# secptr = (pe_header_offset + 4 + 20 +
-# pe_get16 (dll, pe_header_offset + 4 + 16));
-#
-# expptr = 0;
-# for (i = 0; i < nsections; i++)
-# {
-# char sname[8];
-# unsigned long secptr1 = secptr + 40 * i;
-# unsigned long vaddr = pe_get32 (dll, secptr1 + 12);
-# unsigned long vsize = pe_get32 (dll, secptr1 + 16);
-# unsigned long fptr = pe_get32 (dll, secptr1 + 20);
-# lseek(dll, secptr1, SEEK_SET);
-# read(dll, sname, 8);
-# if (vaddr <= export_rva && vaddr+vsize > export_rva)
-# {
-# expptr = fptr + (export_rva - vaddr);
-# if (export_rva + export_size > vaddr + vsize)
-# export_size = vsize - (export_rva - vaddr);
-# break;
-# }
-# }
-#
-# expdata = (unsigned char*)malloc(export_size);
-# lseek (dll, expptr, SEEK_SET);
-# read (dll, expdata, export_size);
-# erva = expdata - export_rva;
-#
-# nexp = pe_as32 (expdata+24);
-# name_rvas = pe_as32 (expdata+32);
-#
-# printf ("EXPORTS\n");
-# for (i = 0; i<nexp; i++)
-# {
-# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4);
-# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i);
-# }
-#
-# return 0;
-# }
-# /* impgen.c ends here */
-
-EOF
- ;;
- esac
-
- # We use sed instead of cat because bash on DJGPP gets confused if
- # if finds mixed CR/LF and LF-only lines. Since sed operates in
- # text mode, it properly converts lines to CR/LF. This bash problem
- # is reportedly fixed, but why not run on old versions too?
- sed '$q' "$ltmain" >> "${ofile}T" || (rm -f "${ofile}T"; exit 1)
-
- mv -f "${ofile}T" "$ofile" || \
- (rm -f "$ofile" && cp "${ofile}T" "$ofile" && rm -f "${ofile}T")
- chmod +x "$ofile"
-fi
-##
-## END FIXME
-
-])# _LT_AC_LTCONFIG_HACK
-
# 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],
-[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_SHARED, [dnl
+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 ;;
*)
@@ -3015,22 +172,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],
-[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_STATIC, [dnl
+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 ;;
*)
@@ -3049,8 +205,7 @@ 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)])
@@ -3058,14 +213,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],
-[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
+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 ;;
*)
@@ -3083,120 +238,29 @@ esac],
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_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
+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
-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_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
-[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=":"
-dnl $ac_dummy forces splitting on constant user-supplied paths.
-dnl POSIX.2 word splitting is done only on the output of word expansions,
-dnl not every word. This closes a longstanding sh security hole.
- ac_dummy="ifelse([$2], , $PATH, [$2])"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- 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
- "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
-
-*** 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])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
-if test -n "$MAGIC_CMD"; then
- AC_MSG_RESULT($MAGIC_CMD)
-else
- AC_MSG_RESULT(no)
-fi
-])
-
-
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-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
- if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
- else
- MAGIC_CMD=:
- fi
-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)
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_CANONICAL_HOST])dnl
AC_REQUIRE([AC_CANONICAL_BUILD])dnl
-AC_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
ac_prog=ld
-if test "$GCC" = yes; then
+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])
- 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
+ ac_prog=`($CC -print-prog-name=ld) 2>&5`
+ case "$ac_prog" in
# Accept absolute paths.
- [[\\/]]* | [[A-Za-z]]:[[\\/]]*)
- re_direlt='/[[^/]][[^/]]*/\.\./'
+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
@@ -3218,17 +282,17 @@ elif test "$with_gnu_ld" = yes; then
else
AC_MSG_CHECKING([for non-GNU ld])
fi
-AC_CACHE_VAL(lt_cv_path_LD,
+AC_CACHE_VAL(ac_cv_path_LD,
[if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ 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
- lt_cv_path_LD="$ac_dir/$ac_prog"
+ 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 "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+ 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
@@ -3237,9 +301,9 @@ AC_CACHE_VAL(lt_cv_path_LD,
done
IFS="$ac_save_ifs"
else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ ac_cv_path_LD="$LD" # Let the user override the test with a path.
fi])
-LD="$lt_cv_path_LD"
+LD="$ac_cv_path_LD"
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
@@ -3249,252 +313,56 @@ test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
])
-# AC_PROG_LD_GNU -
-AC_DEFUN([AC_PROG_LD_GNU],
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+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
- lt_cv_prog_gnu_ld=yes
+ ac_cv_prog_gnu_ld=yes
else
- lt_cv_prog_gnu_ld=no
+ ac_cv_prog_gnu_ld=no
fi])
-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_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
-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_CACHE_CHECK([how to recognise dependant libraries],
-lt_cv_deplibs_check_method,
-[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
-aix4* | aix5*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-beos*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-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
- ;;
-
-cygwin* | mingw* | pw32*)
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- 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=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
- ;;
- *) # 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
- 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
- ;;
-
-gnu*)
- lt_cv_deplibs_check_method=pass_all
- ;;
-
-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
- 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
- ;;
-
-# 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`
- ;;
-
-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
- lt_cv_deplibs_check_method='match_pattern /lib[[^/\.]]+\.so$'
- fi
- ;;
-
-newos6*)
- 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
- ;;
-
-openbsd*)
- lt_cv_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
- else
- lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
- 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
- ;;
-
-solaris*)
- lt_cv_deplibs_check_method=pass_all
- 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
- 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*`
- ;;
- ncr)
- lt_cv_deplibs_check_method=pass_all
- ;;
- sequent)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
- ;;
- sni)
- lt_cv_file_magic_cmd='/bin/file'
- lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
- lt_cv_file_magic_test_file=/lib/libc.so
- ;;
- esac
- ;;
-esac
-])
-file_magic_cmd=$lt_cv_file_magic_cmd
-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_REQUIRE([_LT_AC_LIBTOOL_SYS_PATH_SEPARATOR])dnl
-AC_MSG_CHECKING([for BSD-compatible nm])
-AC_CACHE_VAL(lt_cv_path_NM,
+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.
- lt_cv_path_NM="$NM"
+ ac_cv_path_NM="$NM"
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ 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=.
- tmp_nm=$ac_dir/${ac_tool_prefix}nm
- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; then
+ if test -f $ac_dir/nm || test -f $ac_dir/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
- # 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"
+ 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 ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
- lt_cv_path_NM="$tmp_nm -p"
+ 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
- lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+ 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 "$lt_cv_path_NM" && lt_cv_path_NM=nm
+ test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
fi])
-NM="$lt_cv_path_NM"
+NM="$ac_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
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
+case "$lt_target" in
+*-*-beos* | *-*-cygwin*)
# These system don't have libm
;;
*-ncr-sysv4.3*)
@@ -3508,39 +376,33 @@ esac
])
# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments. Note that LIBLTDL and INCLTDL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
-# with '${top_builddir}/' and INCLTDL will be prefixed with
-# '${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
+# 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, [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" ;;
esac
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdlc.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
])
# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
-# with '${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.
+# 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_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
@@ -3551,8 +413,8 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
])
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
- LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ LIBLTDL=ifelse($#,1,$1,['${top_builddir}/libltdl'])/libltdl.la
+ INCLTDL=ifelse($#,1,-I$1,['-I${top_builddir}/libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
@@ -3560,14 +422,14 @@ AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
fi
])
-# old names
-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])
-
-# This is just to silence aclocal about the macro not being used
-ifelse([AC_DISABLE_FAST_INSTALL])
+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
+
+dnl This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])dnl
diff --git a/boehm-gc/mkinstalldirs b/boehm-gc/mkinstalldirs
index f9c37afd1b8..cc8783edce3 100755
--- a/boehm-gc/mkinstalldirs
+++ b/boehm-gc/mkinstalldirs
@@ -2,90 +2,29 @@
# mkinstalldirs --- make directory hierarchy
# Author: Noah Friedman <friedman@prep.ai.mit.edu>
# Created: 1993-05-16
+# Last modified: 1994-03-25
# Public domain
-# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $
-
errstatus=0
-dirmode=""
-
-usage="\
-Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..."
-
-# process command line arguments
-while test $# -gt 0 ; do
- case "${1}" in
- -h | --help | --h* ) # -h for help
- echo "${usage}" 1>&2; exit 0 ;;
- -m ) # -m PERM arg
- shift
- test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; }
- dirmode="${1}"
- shift ;;
- -- ) shift; break ;; # stop option processing
- -* ) echo "${usage}" 1>&2; exit 1 ;; # unknown option
- * ) break ;; # first non-opt arg
- esac
-done
-
-for file
-do
- if test -d "$file"; then
- shift
- else
- break
- fi
-done
-
-case $# in
-0) exit 0 ;;
-esac
-case $dirmode in
-'')
- if mkdir -p -- . 2>/dev/null; then
- echo "mkdir -p -- $*"
- exec mkdir -p -- "$@"
- fi ;;
-*)
- if mkdir -m "$dirmode" -p -- . 2>/dev/null; then
- echo "mkdir -m $dirmode -p -- $*"
- exec mkdir -m "$dirmode" -p -- "$@"
- fi ;;
-esac
-
-for file
-do
+for file in ${1+"$@"} ; do
set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'`
shift
pathcomp=
- for d
- do
+ for d in ${1+"$@"} ; do
pathcomp="$pathcomp$d"
case "$pathcomp" in
-* ) pathcomp=./$pathcomp ;;
esac
if test ! -d "$pathcomp"; then
- echo "mkdir $pathcomp"
-
- mkdir "$pathcomp" || lasterr=$?
-
- if test ! -d "$pathcomp"; then
- errstatus=$lasterr
- else
- if test ! -z "$dirmode"; then
- echo "chmod $dirmode $pathcomp"
-
- lasterr=""
- chmod "$dirmode" "$pathcomp" || lasterr=$?
+ echo "mkdir $pathcomp" 1>&2
+ mkdir "$pathcomp" > /dev/null 2>&1 || lasterr=$?
+ fi
- if test ! -z "$lasterr"; then
- errstatus=$lasterr
- fi
- fi
- fi
+ if test ! -d "$pathcomp"; then
+ errstatus=$lasterr
fi
pathcomp="$pathcomp/"
@@ -94,8 +33,4 @@ done
exit $errstatus
-# Local Variables:
-# mode: shell-script
-# sh-indentation: 3
-# End:
# mkinstalldirs ends here
diff --git a/config.sub b/config.sub
index a2734b3355f..e1e455b776e 100755
--- a/config.sub
+++ b/config.sub
@@ -3,7 +3,7 @@
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
-timestamp='2003-10-16'
+timestamp='2003-11-03'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
@@ -968,6 +968,10 @@ case $basic_machine in
tower | tower-32)
basic_machine=m68k-ncr
;;
+ tpf)
+ basic_machine=s390x-ibm
+ os=-tpf
+ ;;
udi29k)
basic_machine=a29k-amd
os=-udi
@@ -1233,6 +1237,9 @@ case $os in
-sinix*)
os=-sysv4
;;
+ -tpf*)
+ os=-tpf
+ ;;
-triton*)
os=-sysv3
;;
@@ -1487,6 +1494,9 @@ case $basic_machine in
-ptx*)
vendor=sequent
;;
+ -tpf*)
+ vendor=ibm
+ ;;
-vxsim* | -vxworks* | -windiss*)
vendor=wrs
;;
diff --git a/configure b/configure
index b49d8b16bfe..0c88cf501a3 100755
--- a/configure
+++ b/configure
@@ -1130,6 +1130,9 @@ case "${target}" in
*) ;;
esac
;;
+ *-*-uclinux*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
+ ;;
*-*-vxworks*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
;;
@@ -2724,7 +2727,7 @@ GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
# Don't use libstdc++-v3's flags to configure/build itself.
libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
-raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then
@@ -2823,7 +2826,7 @@ test -n "$target_alias" && ncn_target_tool_prefix=$target_alias-
# Extract the first word of "${ncn_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2827: checking for $ac_word" >&5
+echo "configure:2830: 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
@@ -2856,7 +2859,7 @@ if test -z "$ac_cv_prog_AR" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2860: checking for $ac_word" >&5
+echo "configure:2863: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2895,7 +2898,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2899: checking for $ac_word" >&5
+echo "configure:2902: 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
@@ -2928,7 +2931,7 @@ if test -z "$ac_cv_prog_AS" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2932: checking for $ac_word" >&5
+echo "configure:2935: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2967,7 +2970,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2971: checking for $ac_word" >&5
+echo "configure:2974: 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
@@ -3000,7 +3003,7 @@ if test -z "$ac_cv_prog_DLLTOOL" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3004: checking for $ac_word" >&5
+echo "configure:3007: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3039,7 +3042,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3043: checking for $ac_word" >&5
+echo "configure:3046: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3072,7 +3075,7 @@ if test -z "$ac_cv_prog_LD" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3076: checking for $ac_word" >&5
+echo "configure:3079: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3111,7 +3114,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3115: checking for $ac_word" >&5
+echo "configure:3118: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3144,7 +3147,7 @@ if test -z "$ac_cv_prog_NM" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3148: checking for $ac_word" >&5
+echo "configure:3151: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3183,7 +3186,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3187: checking for $ac_word" >&5
+echo "configure:3190: 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
@@ -3216,7 +3219,7 @@ if test -z "$ac_cv_prog_RANLIB" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3220: checking for $ac_word" >&5
+echo "configure:3223: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3255,7 +3258,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3259: checking for $ac_word" >&5
+echo "configure:3262: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3288,7 +3291,7 @@ if test -z "$ac_cv_prog_WINDRES" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3292: checking for $ac_word" >&5
+echo "configure:3295: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3327,7 +3330,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objcopy", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3331: checking for $ac_word" >&5
+echo "configure:3334: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3360,7 +3363,7 @@ if test -z "$ac_cv_prog_OBJCOPY" ; then
# Extract the first word of "objcopy", so it can be a program name with args.
set dummy objcopy; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3364: checking for $ac_word" >&5
+echo "configure:3367: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJCOPY'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3399,7 +3402,7 @@ fi
# Extract the first word of "${ncn_tool_prefix}objdump", so it can be a program name with args.
set dummy ${ncn_tool_prefix}objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3403: checking for $ac_word" >&5
+echo "configure:3406: 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
@@ -3432,7 +3435,7 @@ if test -z "$ac_cv_prog_OBJDUMP" ; then
# Extract the first word of "objdump", so it can be a program name with args.
set dummy objdump; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3436: checking for $ac_word" >&5
+echo "configure:3439: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_OBJDUMP'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3481,7 +3484,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ar", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3485: checking for $ac_word" >&5
+echo "configure:3488: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3514,7 +3517,7 @@ if test -z "$ac_cv_prog_AR_FOR_TARGET" ; then
# Extract the first word of "ar", so it can be a program name with args.
set dummy ar; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3518: checking for $ac_word" >&5
+echo "configure:3521: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AR_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3553,7 +3556,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}as", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3557: checking for $ac_word" >&5
+echo "configure:3560: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3586,7 +3589,7 @@ if test -z "$ac_cv_prog_AS_FOR_TARGET" ; then
# Extract the first word of "as", so it can be a program name with args.
set dummy as; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3590: checking for $ac_word" >&5
+echo "configure:3593: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_AS_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3625,7 +3628,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}dlltool", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3629: checking for $ac_word" >&5
+echo "configure:3632: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3658,7 +3661,7 @@ if test -z "$ac_cv_prog_DLLTOOL_FOR_TARGET" ; then
# Extract the first word of "dlltool", so it can be a program name with args.
set dummy dlltool; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3662: checking for $ac_word" >&5
+echo "configure:3665: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_DLLTOOL_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3697,7 +3700,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ld", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3701: checking for $ac_word" >&5
+echo "configure:3704: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3730,7 +3733,7 @@ if test -z "$ac_cv_prog_LD_FOR_TARGET" ; then
# Extract the first word of "ld", so it can be a program name with args.
set dummy ld; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3734: checking for $ac_word" >&5
+echo "configure:3737: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_LD_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3769,7 +3772,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}nm", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3773: checking for $ac_word" >&5
+echo "configure:3776: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3802,7 +3805,7 @@ if test -z "$ac_cv_prog_NM_FOR_TARGET" ; then
# Extract the first word of "nm", so it can be a program name with args.
set dummy nm; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3806: checking for $ac_word" >&5
+echo "configure:3809: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_NM_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3841,7 +3844,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}ranlib", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3845: checking for $ac_word" >&5
+echo "configure:3848: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3874,7 +3877,7 @@ if test -z "$ac_cv_prog_RANLIB_FOR_TARGET" ; then
# Extract the first word of "ranlib", so it can be a program name with args.
set dummy ranlib; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3878: checking for $ac_word" >&5
+echo "configure:3881: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_RANLIB_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3913,7 +3916,7 @@ fi
# Extract the first word of "${ncn_target_tool_prefix}windres", so it can be a program name with args.
set dummy ${ncn_target_tool_prefix}windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3917: checking for $ac_word" >&5
+echo "configure:3920: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3946,7 +3949,7 @@ if test -z "$ac_cv_prog_WINDRES_FOR_TARGET" ; then
# Extract the first word of "windres", so it can be a program name with args.
set dummy windres; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:3950: checking for $ac_word" >&5
+echo "configure:3953: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_ncn_cv_WINDRES_FOR_TARGET'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4013,7 +4016,7 @@ RANLIB_FOR_TARGET=${RANLIB_FOR_TARGET}${extra_ranlibflags_for_target}
NM_FOR_TARGET=${NM_FOR_TARGET}${extra_nmflags_for_target}
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:4017: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:4020: 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"
diff --git a/configure.in b/configure.in
index f849e26ccff..256748764fb 100644
--- a/configure.in
+++ b/configure.in
@@ -369,6 +369,9 @@ case "${target}" in
*) ;;
esac
;;
+ *-*-uclinux*)
+ noconfigdirs="$noconfigdirs target-newlib target-libgloss target-rda ${libgcj}"
+ ;;
*-*-vxworks*)
noconfigdirs="$noconfigdirs target-newlib target-libgloss target-libiberty ${libgcj}"
;;
@@ -1962,7 +1965,7 @@ GCJ_FOR_TARGET=$GCJ_FOR_TARGET' $(FLAGS_FOR_TARGET)'
# Don't use libstdc++-v3's flags to configure/build itself.
libstdcxx_flags='`test ! -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags || $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
-raw_libstdcxx_flags=' -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
+raw_libstdcxx_flags='-L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs'
if test "x${CXX_FOR_TARGET+set}" = xset; then
if test "x${RAW_CXX_FOR_TARGET+set}" != xset; then
diff --git a/contrib/ChangeLog b/contrib/ChangeLog
index f072f106af1..6832e3d2539 100644
--- a/contrib/ChangeLog
+++ b/contrib/ChangeLog
@@ -1,3 +1,28 @@
+2003-12-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * gcc_update (files_and_dependencies): For libjava/libltdl directory,
+ remove acconfig.h. No longer used.
+
+2003-12-18 Kelley Cook <kcook@gcc.gnu.org>
+
+ * gcc_update (files_generated): Add in gcc/ada/stamp-xgnatug and update
+ gcc/ada/gnat_ug_* to use it.
+
+2003-12-16 James E Wilson <wilson@specifixinc.com>
+
+ * gcc_update (files_and_dependencies): For libjava/libltdl directory,
+ rename configure.in to configure.ac, and stamp-h.in to config-h.in.
+
+2003-12-11 Kelley Cook <kcook@gcc.gnu.org>
+
+ * gcc_update (files_and_dependencies): Correct typo in the filename
+ gnat_ug_wnt.texi.
+
+2003-12-08 Arnaud Charlet <charlet@act-europe.fr
+
+ * gcc_update: Remove handling of sinfo.h, einfo.h, nmake.ads,
+ treeprs.ads.
+
2003-10-16 Mark Mitchell <mark@codesourcery.com>
* gennews (files): Add GCC 3.3 files.
diff --git a/contrib/gcc_update b/contrib/gcc_update
index 3792807c285..f6596fd721a 100755
--- a/contrib/gcc_update
+++ b/contrib/gcc_update
@@ -79,15 +79,11 @@ gcc/fixinc/fixincl.x: gcc/fixinc/fixincl.tpl gcc/fixinc/inclhack.def
gcc/f/intdoc.texi: gcc/f/intdoc.in gcc/f/intdoc.c gcc/f/intrin.h gcc/f/intrin.def
gcc/cp/cfns.h: gcc/cp/cfns.gperf
gcc/java/keyword.h: gcc/java/keyword.gperf
-gcc/ada/treeprs.ads: gcc/ada/treeprs.adt gcc/ada/sinfo.ads gcc/ada/xtreeprs.adb
-gcc/ada/einfo.h: gcc/ada/einfo.ads gcc/ada/einfo.adb gcc/ada/xeinfo.adb
-gcc/ada/sinfo.h: gcc/ada/sinfo.ads gcc/ada/xsinfo.adb
-gcc/ada/nmake.adb: gcc/ada/sinfo.ads gcc/ada/nmake.adt gcc/ada/xnmake.adb
-gcc/ada/nmake.ads: gcc/ada/sinfo.ads gcc/ada/nmake.adt gcc/ada/xnmake.adb
-gcc/ada/gnat_ug_unx.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
-gcc/ada/gnat_ug_vms.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
-gcc/ada/gnat_ug_vxw.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
-gcc/ada/gnat_ug_w32.texi: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
+gcc/ada/stamp-xgnatug: gcc/ada/gnat_ug.texi gcc/ada/xgnatug.adb gcc/ada/ug_words
+gcc/ada/gnat_ug_unx.texi: gcc/ada/stamp-xgnatug
+gcc/ada/gnat_ug_vms.texi: gcc/ada/stamp-xgnatug
+gcc/ada/gnat_ug_vxw.texi: gcc/ada/stamp-xgnatug
+gcc/ada/gnat_ug_wnt.texi: gcc/ada/stamp-xgnatug
# testsuite
# Without this, _Pragma3.c can have a false negative.
gcc/testsuite/gcc.dg/cpp/_Pragma3.c: gcc/testsuite/gcc.dg/cpp/mi1c.h
@@ -111,10 +107,10 @@ boehm-gc/configure: boehm-gc/configure.in boehm-gc/aclocal.m4
libjava/aclocal.m4: libjava/configure.in libjava/acinclude.m4
libjava/Makefile.in: libjava/Makefile.am libjava/configure.in libjava/aclocal.m4
libjava/configure: libjava/configure.in libjava/aclocal.m4
-libjava/libltdl/aclocal.m4: libjava/libltdl/configure.in libjava/libltdl/acinclude.m4
-libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.in libjava/libltdl/aclocal.m4
-libjava/libltdl/configure: libjava/libltdl/configure.in libjava/libltdl/aclocal.m4
-libjava/libltdl/stamp-h.in: libjava/libltdl/configure.in libjava/libltdl/aclocal.m4 libjava/libltdl/acconfig.h
+libjava/libltdl/aclocal.m4: libjava/libltdl/configure.ac libjava/libltdl/acinclude.m4
+libjava/libltdl/Makefile.in: libjava/libltdl/Makefile.am libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
+libjava/libltdl/configure: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
+libjava/libltdl/config-h.in: libjava/libltdl/configure.ac libjava/libltdl/aclocal.m4
# Top level
Makefile.in: Makefile.tpl Makefile.def
configure: configure.in config/acx.m4
diff --git a/fastjar/.cvsignore b/fastjar/.cvsignore
deleted file mode 100644
index 67c7a2e782d..00000000000
--- a/fastjar/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-fastjar.info
-grepjar.1
-jar.1
diff --git a/fastjar/ChangeLog b/fastjar/ChangeLog
index 2653d1725e3..648a9b6f75f 100644
--- a/fastjar/ChangeLog
+++ b/fastjar/ChangeLog
@@ -1,3 +1,26 @@
+2003-12-01 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.am: Define AM_MAKINFOFLAGS. Remove Automake 1.4 hack.
+ * Makefile.in: Regenerate with automake 1.7.6 & autoconf 2.57 tools.
+ * aclocal.m4, config.h.in, configure: Likewise.
+ * install-sh, missing, mkinstalldirs, stamp-h.in: Remove.
+
+2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Delete.
+
+2003-10-30 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.am (my_make_i_flags): Add $(srcdir) and update comment
+ to match.
+ (fastjar.info): Update target to write to build directory.
+ (%.1): New implicit rule from a .pod file.
+ (jar.1): Delete.
+ (grepjar.1): Delete.
+ (jar.pod): New intermediate rule.
+ (grepjar.pod): Likewise.
+ * Makefile.in: Regenerate.
+
2003-08-13 Matthias Klose <doko@debian.org>
* fastjar.texi: License manual under the GPL.
diff --git a/fastjar/Makefile.am b/fastjar/Makefile.am
index fa31b9235fb..3d4ea36c232 100644
--- a/fastjar/Makefile.am
+++ b/fastjar/Makefile.am
@@ -57,6 +57,7 @@ grepjar_LDADD = $(ZLIBS) $(LIBIBERTY)
grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
AM_CFLAGS = @fastjar_warn_cflags@
+AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
@@ -66,32 +67,18 @@ fastjar_TEXINFOS = \
man_MANS = jar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
-## This is a hack. We can't set AM_MAKEINFOFLAGS, since that isn't
-## available in 1.4. Nor can we override or append to MAKEINFO or
-## MAKEINFOFLAGS, since these are overridden by the top-level
-## Makefile. So, we just duplicate the rules. FIXME: remove this
-## when we upgrade automake. Note that we don't include $(srcdir) in
-## my_makei_flags; makeinfo is run in srcdir.
-my_makei_flags += -I ../gcc/doc/include
-fastjar.info: fastjar.texi $(fastjar_TEXINFOS)
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'`
-
-
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@"
-$(srcdir)/jar.1: $(srcdir)/fastjar.texi
- -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod
- -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \
- mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \
- (rm -f jar.1.T$$$$ && exit 1)
- -rm -f fastjar.pod
+%.1: %.pod
+ -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
+ mv -f $(@).T$$$$ $@) || \
+ (rm -f $(@).T$$$$ && exit 1)
+
+.INTERMEDIATE: jar.pod grepjar.pod
+
+jar.pod: $(srcdir)/fastjar.texi
+ -$(TEXI2POD) -D jar $< > $@
-$(srcdir)/grepjar.1: $(srcdir)/fastjar.texi
- -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod
- -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \
- mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \
- (rm -f grepjar.1.T$$$$ && exit 1)
- -rm -f grepjar.pod
+grepjar.pod: $(srcdir)/fastjar.texi
+ -$(TEXI2POD) -D grepjar $< > $@
diff --git a/fastjar/Makefile.in b/fastjar/Makefile.in
index b79a3ade06e..6268072a05e 100644
--- a/fastjar/Makefile.in
+++ b/fastjar/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4-p6 from Makefile.am
+# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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,77 +12,150 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-# Process this with automake to create Makefile.in
-
+@SET_MAKE@
-SHELL = @SHELL@
+# Process this with automake to create Makefile.in
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@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
CHMOD = @CHMOD@
CP = @CP@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
+OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
RM = @RM@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
ZLIBS = @ZLIBS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build_alias = @build_alias@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
fastjar_warn_cflags = @fastjar_warn_cflags@
gcc_version = @gcc_version@
+host_alias = @host_alias@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
AUTOMAKE_OPTIONS = no-dependencies
# 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)" "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)" "JC1FLAGS=$(JC1FLAGS)" "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)" "exec_prefix=$(exec_prefix)" "infodir=$(infodir)" "libdir=$(libdir)" "prefix=$(prefix)" "AR=$(AR)" "AS=$(AS)" "CC=$(CC)" "CXX=$(CXX)" "LD=$(LD)" "LIBCFLAGS=$(LIBCFLAGS)" "NM=$(NM)" "PICFLAG=$(PICFLAG)" "RANLIB=$(RANLIB)" "DESTDIR=$(DESTDIR)"
+AM_MAKEFLAGS = \
+ "AR_FLAGS=$(AR_FLAGS)" \
+ "CC_FOR_BUILD=$(CC_FOR_BUILD)" \
+ "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)" \
+ "JC1FLAGS=$(JC1FLAGS)" \
+ "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)" \
+ "exec_prefix=$(exec_prefix)" \
+ "infodir=$(infodir)" \
+ "libdir=$(libdir)" \
+ "prefix=$(prefix)" \
+ "AR=$(AR)" \
+ "AS=$(AS)" \
+ "CC=$(CC)" \
+ "CXX=$(CXX)" \
+ "LD=$(LD)" \
+ "LIBCFLAGS=$(LIBCFLAGS)" \
+ "NM=$(NM)" \
+ "PICFLAG=$(PICFLAG)" \
+ "RANLIB=$(RANLIB)" \
+ "DESTDIR=$(DESTDIR)"
INCLUDES = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include
@@ -88,291 +163,232 @@ INCLUDES = -I. -I$(top_srcdir) $(ZINCS) -I$(top_srcdir)/../include
LIBIBERTY = ../libiberty/libiberty.a
bin_PROGRAMS = jar grepjar
-jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
+jar_SOURCES = jartool.c dostime.c compress.c pushback.c jartool.h \
+zipfile.h dostime.h compress.h pushback.h
jar_LDADD = $(ZLIBS) $(LIBIBERTY)
jar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
-grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h zipfile.h dostime.h compress.h pushback.h
+grepjar_SOURCES = jargrep.c dostime.c compress.c pushback.c jartool.h \
+zipfile.h dostime.h compress.h pushback.h
grepjar_LDADD = $(ZLIBS) $(LIBIBERTY)
grepjar_DEPENDENCIES = $(ZDEPS) $(LIBIBERTY)
AM_CFLAGS = @fastjar_warn_cflags@
+AM_MAKEINFOFLAGS = -I $(srcdir)/../gcc/doc/include
TEXINFO_TEX = ../gcc/doc/include/texinfo.tex
info_TEXINFOS = fastjar.texi
-fastjar_TEXINFOS = ../gcc/doc/include/gcc-common.texi ../gcc/doc/include/gpl.texi
+fastjar_TEXINFOS = \
+ ../gcc/doc/include/gcc-common.texi \
+ ../gcc/doc/include/gpl.texi
man_MANS = jar.1 grepjar.1
EXTRA_DIST = $(man_MANS)
-my_makei_flags = -I ../gcc/doc/include
-
TEXI2POD = perl $(srcdir)/../contrib/texi2pod.pl
POD2MAN = pod2man --center="GNU" --release="gcc-@gcc_version@"
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
+mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = install-defs.sh
-bin_PROGRAMS = jar$(EXEEXT) grepjar$(EXEEXT)
-PROGRAMS = $(bin_PROGRAMS)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-jar_OBJECTS = jartool.o dostime.o compress.o pushback.o
-jar_LDFLAGS =
-grepjar_OBJECTS = jargrep.o dostime.o compress.o pushback.o
-grepjar_LDFLAGS =
-CFLAGS = @CFLAGS@
-COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CONFIG_CLEAN_FILES = install-defs.sh
+bin_PROGRAMS = jar$(EXEEXT) grepjar$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS)
+
+am_grepjar_OBJECTS = jargrep.$(OBJEXT) dostime.$(OBJEXT) \
+ compress.$(OBJEXT) pushback.$(OBJEXT)
+grepjar_OBJECTS = $(am_grepjar_OBJECTS)
+grepjar_LDFLAGS =
+am_jar_OBJECTS = jartool.$(OBJEXT) dostime.$(OBJEXT) compress.$(OBJEXT) \
+ pushback.$(OBJEXT)
+jar_OBJECTS = $(am_jar_OBJECTS)
+jar_LDFLAGS =
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-TEXI2DVI = texi2dvi
+LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(grepjar_SOURCES) $(jar_SOURCES)
+am__TEXINFO_TEX_DIR = $(srcdir)/../gcc/doc/include
INFO_DEPS = fastjar.info
DVIS = fastjar.dvi
+PDFS = fastjar.pdf
+PSS = fastjar.ps
TEXINFOS = fastjar.texi
-man1dir = $(mandir)/man1
-MANS = $(man_MANS)
NROFF = nroff
-DIST_COMMON = README $(fastjar_TEXINFOS) ./stamp-h.in AUTHORS COPYING \
-ChangeLog INSTALL Makefile.am Makefile.in NEWS acinclude.m4 aclocal.m4 \
-config.h.in configure configure.in install-defs.sh.in install-sh \
-missing mkinstalldirs
-
+MANS = $(man_MANS)
+DIST_COMMON = README $(fastjar_TEXINFOS) ../install-sh ../missing \
+ ../mkinstalldirs AUTHORS COPYING ChangeLog INSTALL Makefile.am \
+ Makefile.in NEWS acinclude.m4 aclocal.m4 config.h.in configure \
+ configure.in install-defs.sh.in
+SOURCES = $(grepjar_SOURCES) $(jar_SOURCES)
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
-TAR = tar
-GZIP_ENV = --best
-SOURCES = $(jar_SOURCES) $(grepjar_SOURCES)
-OBJECTS = $(jar_OBJECTS) $(grepjar_OBJECTS)
-
-all: all-redirect
.SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
-$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile
-
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+.SUFFIXES: .c .dvi .info .o .obj .pdf .ps .texi
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
- cd $(srcdir) && $(ACLOCAL)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --gnu Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-config.h: stamp-h
- @if test ! -f $@; then \
- rm -f stamp-h; \
- $(MAKE) stamp-h; \
- else :; fi
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h \
- $(SHELL) ./config.status
- @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
@if test ! -f $@; then \
- rm -f $(srcdir)/stamp-h.in; \
- $(MAKE) $(srcdir)/stamp-h.in; \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4)
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-mostlyclean-hdr:
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
-clean-hdr:
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.in $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ touch $(srcdir)/config.h.in
distclean-hdr:
- -rm -f config.h
-
-maintainer-clean-hdr:
+ -rm -f config.h stamp-h1
install-defs.sh: $(top_builddir)/config.status install-defs.sh.in
- cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
-
-mostlyclean-binPROGRAMS:
-
-clean-binPROGRAMS:
- -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
-
-distclean-binPROGRAMS:
-
-maintainer-clean-binPROGRAMS:
-
+ cd $(top_builddir) && $(SHELL) ./config.status $@
+binPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(bindir)
@list='$(bin_PROGRAMS)'; for p in $$list; do \
- if test -f $$p; then \
- echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
- $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \
+ if test -f $$p \
+ ; then \
+ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \
+ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f || exit 1; \
else :; fi; \
done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
- list='$(bin_PROGRAMS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+ @list='$(bin_PROGRAMS)'; for p in $$list; do \
+ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \
+ echo " rm -f $(DESTDIR)$(bindir)/$$f"; \
+ rm -f $(DESTDIR)$(bindir)/$$f; \
done
-.c.o:
- $(COMPILE) -c $<
-
-.s.o:
- $(COMPILE) -c $<
-
-.S.o:
- $(COMPILE) -c $<
+clean-binPROGRAMS:
+ -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
+ @rm -f grepjar$(EXEEXT)
+ $(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
+jar$(EXEEXT): $(jar_OBJECTS) $(jar_DEPENDENCIES)
+ @rm -f jar$(EXEEXT)
+ $(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS)
mostlyclean-compile:
- -rm -f *.o core *.core
-
-clean-compile:
+ -rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
+.c.o:
+ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-jar$(EXEEXT): $(jar_OBJECTS) $(jar_DEPENDENCIES)
- @rm -f jar$(EXEEXT)
- $(LINK) $(jar_LDFLAGS) $(jar_OBJECTS) $(jar_LDADD) $(LIBS)
+.c.obj:
+ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-grepjar$(EXEEXT): $(grepjar_OBJECTS) $(grepjar_DEPENDENCIES)
- @rm -f grepjar$(EXEEXT)
- $(LINK) $(grepjar_LDFLAGS) $(grepjar_OBJECTS) $(grepjar_LDADD) $(LIBS)
+.texi.info:
+ @rm -f $@ $@-[0-9] $@-[0-9][0-9] $(@:.info=).i[0-9] $(@:.info=).i[0-9][0-9]
+ $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir) \
+ -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
+.texi.dvi:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2DVI) `test -f '$<' || echo '$(srcdir)/'`$<
+
+.texi.pdf:
+ TEXINPUTS="$(am__TEXINFO_TEX_DIR)$(PATH_SEPARATOR)$$TEXINPUTS" \
+ MAKEINFO='$(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) -I $(srcdir)' \
+ $(TEXI2PDF) `test -f '$<' || echo '$(srcdir)/'`$<
fastjar.info: fastjar.texi $(fastjar_TEXINFOS)
fastjar.dvi: fastjar.texi $(fastjar_TEXINFOS)
+fastjar.pdf: fastjar.texi $(fastjar_TEXINFOS)
+TEXI2DVI = texi2dvi
-
+TEXI2PDF = $(TEXI2DVI) --pdf --batch
DVIPS = dvips
-
-.texi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texi.dvi:
- TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.texinfo.dvi:
- TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi.info:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
-
-.txi.dvi:
- TEXINPUTS=$(srcdir)/../gcc/doc/include:$$TEXINPUTS \
- MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.txi:
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) `echo $< | sed 's,.*/,,'`
.dvi.ps:
- $(DVIPS) $< -o $@
+ $(DVIPS) -o $@ $<
-install-info-am: $(INFO_DEPS)
- @$(NORMAL_INSTALL)
- $(mkinstalldirs) $(DESTDIR)$(infodir)
- @list='$(INFO_DEPS)'; \
- for file in $$list; do \
- d=$(srcdir); \
- for ifile in `cd $$d && echo $$file $$file-[0-9] $$file-[0-9][0-9]`; do \
- if test -f $$d/$$ifile; then \
- echo " $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile"; \
- $(INSTALL_DATA) $$d/$$ifile $(DESTDIR)$(infodir)/$$ifile; \
- else : ; fi; \
- done; \
- done
- @$(POST_INSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
+uninstall-info-am:
+ $(PRE_UNINSTALL)
+ @if (install-info --version && \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
list='$(INFO_DEPS)'; \
for file in $$list; do \
- echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file";\
- install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$file || :;\
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile"; \
+ install-info --info-dir=$(DESTDIR)$(infodir) --remove $(DESTDIR)$(infodir)/$$relfile; \
done; \
- else : ; fi
-
-uninstall-info:
- $(PRE_UNINSTALL)
- @if $(SHELL) -c 'install-info --version | sed 1q | fgrep -s -v -i debian' >/dev/null 2>&1; then \
- ii=yes; \
- else ii=; fi; \
- list='$(INFO_DEPS)'; \
- for file in $$list; do \
- test -z "$$ii" \
- || install-info --info-dir=$(DESTDIR)$(infodir) --remove $$file; \
- done
+ else :; fi
@$(NORMAL_UNINSTALL)
- list='$(INFO_DEPS)'; \
+ @list='$(INFO_DEPS)'; \
for file in $$list; do \
- (cd $(DESTDIR)$(infodir) && rm -f $$file $$file-[0-9] $$file-[0-9][0-9]); \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ relfile_i=`echo "$$relfile" | sed 's|\.info$$||;s|$$|.i|'`; \
+ (if cd $(DESTDIR)$(infodir); then \
+ echo " rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9])"; \
+ rm -f $$relfile $$relfile-[0-9] $$relfile-[0-9][0-9] $$relfile_i[0-9] $$relfile_i[0-9][0-9]; \
+ else :; fi); \
done
dist-info: $(INFO_DEPS)
list='$(INFO_DEPS)'; \
for base in $$list; do \
- d=$(srcdir); \
- for file in `cd $$d && eval echo $$base*`; do \
- test -f $(distdir)/$$file \
- || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
- || cp -p $$d/$$file $(distdir)/$$file; \
+ if test -f $$base; then d=.; else d=$(srcdir); fi; \
+ for file in $$d/$$base*; do \
+ relfile=`expr "$$file" : "$$d/\(.*\)"`; \
+ test -f $(distdir)/$$relfile || \
+ cp -p $$file $(distdir)/$$relfile; \
done; \
done
mostlyclean-aminfo:
- -rm -f fastjar.aux fastjar.cp fastjar.cps fastjar.dvi fastjar.fn \
- fastjar.fns fastjar.ky fastjar.kys fastjar.ps fastjar.log \
- fastjar.pg fastjar.toc fastjar.tp fastjar.tps fastjar.vr \
- fastjar.vrs fastjar.op fastjar.tr fastjar.cv fastjar.cn
-
-clean-aminfo:
-
-distclean-aminfo:
+ -rm -f fastjar.aux fastjar.cp fastjar.cps fastjar.fn fastjar.fns fastjar.ky \
+ fastjar.kys fastjar.log fastjar.pg fastjar.pgs fastjar.tmp \
+ fastjar.toc fastjar.tp fastjar.tps fastjar.vr fastjar.vrs \
+ fastjar.dvi fastjar.pdf fastjar.ps
maintainer-clean-aminfo:
- cd $(srcdir) && for i in $(INFO_DEPS); do \
- rm -f $$i; \
- if test "`echo $$i-[0-9]*`" != "$$i-[0-9]*"; then \
- rm -f $$i-[0-9]*; \
- fi; \
+ @list='$(INFO_DEPS)'; for i in $$list; do \
+ i_i=`echo "$$i" | sed 's|\.info$$||;s|$$|.i|'`; \
+ echo " rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]"; \
+ rm -f $$i $$i-[0-9] $$i-[0-9][0-9] $$i_i[0-9] $$i_i[0-9][0-9]; \
done
-install-man1:
+man1dir = $(mandir)/man1
+install-man1: $(man1_MANS) $(man_MANS)
+ @$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(man1dir)
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
@@ -381,213 +397,340 @@ install-man1:
if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \
else file=$$i; fi; \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \
$(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \
done
-
uninstall-man1:
- @list='$(man1_MANS)'; \
- l2='$(man_MANS)'; for i in $$l2; do \
+ @$(NORMAL_UNINSTALL)
+ @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \
+ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \
+ for i in $$l2; do \
case "$$i" in \
*.1*) list="$$list $$i" ;; \
esac; \
done; \
for i in $$list; do \
ext=`echo $$i | sed -e 's/^.*\\.//'`; \
+ case "$$ext" in \
+ 1*) ;; \
+ *) ext='1' ;; \
+ esac; \
inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \
+ inst=`echo $$inst | sed -e 's/^.*\///'`; \
inst=`echo $$inst | sed '$(transform)'`.$$ext; \
echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \
rm -f $(DESTDIR)$(man1dir)/$$inst; \
done
-install-man: $(MANS)
- @$(NORMAL_INSTALL)
- $(MAKE) $(AM_MAKEFLAGS) install-man1
-uninstall-man:
- @$(NORMAL_UNINSTALL)
- $(MAKE) $(AM_MAKEFLAGS) uninstall-man1
+
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(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; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique
-TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(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; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP))
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(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; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
+
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ $(mkinstalldirs) $(distdir)/. $(distdir)/.. $(distdir)/../gcc/doc/include
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ $(MAKE) $(AM_MAKEFLAGS) \
+ top_distdir="$(top_distdir)" distdir="$(distdir)" \
+ dist-info
+ -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)
+dist-gzip: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_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
- -rm -rf $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ $(am__remove_distdir)
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(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
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-distdir: $(DISTFILES)
- -rm -rf $(distdir)
- mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- 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
- $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-info
-info-am: $(INFO_DEPS)
-info: info-am
-dvi-am: $(DVIS)
-dvi: dvi-am
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
+ && rm -f $(distdir).tar.gz \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @echo "$(distdir).tar.gz is ready for distribution" | \
+ sed 'h;s/./=/g;p;x;p;x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h
-install-exec-am: install-binPROGRAMS
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) $(DESTDIR)$(man1dir)
+install: install-am
install-exec: install-exec-am
-
-install-data-am: install-info-am install-man
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-binPROGRAMS uninstall-info uninstall-man
-uninstall: uninstall-am
-all-am: Makefile $(INFO_DEPS) $(PROGRAMS) $(MANS) config.h
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(infodir) \
- $(DESTDIR)$(mandir)/man1
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
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-hdr mostlyclean-binPROGRAMS \
- mostlyclean-compile mostlyclean-aminfo mostlyclean-tags \
- mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
-clean-am: clean-hdr clean-binPROGRAMS clean-compile clean-aminfo \
- clean-tags clean-generic mostlyclean-am
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \
+ distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-hdr distclean-binPROGRAMS distclean-compile \
- distclean-aminfo distclean-tags distclean-generic \
- clean-am
+dvi-am: $(DVIS)
-distclean: distclean-am
- -rm -f config.status
+info: info-am
-maintainer-clean-am: maintainer-clean-hdr maintainer-clean-binPROGRAMS \
- maintainer-clean-compile maintainer-clean-aminfo \
- maintainer-clean-tags 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."
+info-am: $(INFO_DEPS)
+
+install-data-am: install-info-am install-man
+
+install-exec-am: install-binPROGRAMS
+
+install-info: install-info-am
+
+install-info-am: $(INFO_DEPS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(infodir)
+ @list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ if test -f $$file; then d=.; else d=$(srcdir); fi; \
+ file_i=`echo "$$file" | sed 's|\.info$$||;s|$$|.i|'`; \
+ for ifile in $$d/$$file $$d/$$file-[0-9] $$d/$$file-[0-9][0-9] \
+ $$d/$$file_i[0-9] $$d/$$file_i[0-9][0-9] ; do \
+ if test -f $$ifile; then \
+ relfile=`echo "$$ifile" | sed 's|^.*/||'`; \
+ echo " $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile"; \
+ $(INSTALL_DATA) $$ifile $(DESTDIR)$(infodir)/$$relfile; \
+ else : ; fi; \
+ done; \
+ done
+ @$(POST_INSTALL)
+ @if (install-info --version && \
+ install-info --version | grep -i -v debian) >/dev/null 2>&1; then \
+ list='$(INFO_DEPS)'; \
+ for file in $$list; do \
+ relfile=`echo "$$file" | sed 's|^.*/||'`; \
+ echo " install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile";\
+ install-info --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/$$relfile || :;\
+ done; \
+ else : ; fi
+install-man: install-man1
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
-maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile install-info-am uninstall-info \
-mostlyclean-aminfo distclean-aminfo clean-aminfo \
-maintainer-clean-aminfo install-man1 uninstall-man1 install-man \
-uninstall-man tags mostlyclean-tags distclean-tags clean-tags \
-maintainer-clean-tags distdir info-am info 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
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+maintainer-clean-am: distclean-am maintainer-clean-aminfo \
+ maintainer-clean-generic
-fastjar.info: fastjar.texi $(fastjar_TEXINFOS)
- @cd $(srcdir) && rm -f $@ $@-[0-9] $@-[0-9][0-9]
- cd $(srcdir) \
- && $(MAKEINFO) $(my_makei_flags) `echo $< | sed 's,.*/,,'`
-
-$(srcdir)/jar.1: $(srcdir)/fastjar.texi
- -$(TEXI2POD) -D jar < $(srcdir)/fastjar.texi > fastjar.pod
- -($(POD2MAN) --section=1 fastjar.pod > jar.1.T$$$$ && \
- mv -f jar.1.T$$$$ $(srcdir)/jar.1) || \
- (rm -f jar.1.T$$$$ && exit 1)
- -rm -f fastjar.pod
-
-$(srcdir)/grepjar.1: $(srcdir)/fastjar.texi
- -$(TEXI2POD) -D grepjar < $(srcdir)/fastjar.texi > grepjar.pod
- -($(POD2MAN) --section=1 grepjar.pod > grepjar.1.T$$$$ && \
- mv -f grepjar.1.T$$$$ $(srcdir)/grepjar.1) || \
- (rm -f grepjar.1.T$$$$ && exit 1)
- -rm -f grepjar.pod
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-aminfo mostlyclean-compile \
+ mostlyclean-generic
+
+pdf: pdf-am
+
+pdf-am: $(PDFS)
+
+ps: ps-am
+
+ps-am: $(PSS)
+
+uninstall-am: uninstall-binPROGRAMS uninstall-info-am uninstall-man
+
+uninstall-man: uninstall-man1
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+ clean-generic ctags dist dist-all dist-gzip dist-info distcheck \
+ distclean distclean-compile distclean-generic distclean-hdr \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am info info-am install install-am install-binPROGRAMS \
+ install-data install-data-am install-exec install-exec-am \
+ install-info install-info-am install-man install-man1 \
+ install-strip installcheck installcheck-am installdirs \
+ maintainer-clean maintainer-clean-aminfo \
+ maintainer-clean-generic mostlyclean mostlyclean-aminfo \
+ mostlyclean-compile mostlyclean-generic pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-binPROGRAMS \
+ uninstall-info-am uninstall-man uninstall-man1
+
+
+%.1: %.pod
+ -($(POD2MAN) --section=1 $< > $(@).T$$$$ && \
+ mv -f $(@).T$$$$ $@) || \
+ (rm -f $(@).T$$$$ && exit 1)
+
+.INTERMEDIATE: jar.pod grepjar.pod
+
+jar.pod: $(srcdir)/fastjar.texi
+ -$(TEXI2POD) -D jar $< > $@
+grepjar.pod: $(srcdir)/fastjar.texi
+ -$(TEXI2POD) -D grepjar $< > $@
# 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/fastjar/aclocal.m4 b/fastjar/aclocal.m4
index d84a6631e71..cde83941aad 100644
--- a/fastjar/aclocal.m4
+++ b/fastjar/aclocal.m4
@@ -1,14 +1,15 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+# generated automatically by aclocal 1.7.6 -*- Autoconf -*-
-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.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file 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.
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
+# 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.
sinclude(../config/accross.m4)
@@ -34,61 +35,248 @@ single argument.])
fi
])
-# 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.
+# Do all the work for Automake. -*- Autoconf -*-
-# serial 1
+# 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.
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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, 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.
+
+# serial 10
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
+AC_PREREQ([2.54])
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright 2002 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, 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
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.7.6])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright 2001, 2002 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, 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.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
#
# Check to make sure that the build environment is sane.
#
+# Copyright 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# 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
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $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
@@ -98,7 +286,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -107,52 +295,615 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
+# -*- Autoconf -*-
+
+
+# Copyright 1997, 1999, 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
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.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
fi
-AC_SUBST($1)])
+])
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-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.
-dnl This file resides in the same directory as the config header
-dnl that is generated. We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
- case " <<$>>CONFIG_HEADERS " in
- *" <<$>>am_file "*<<)>>
- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
+# AM_AUX_DIR_EXPAND
+
+# Copyright 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, 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.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright 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, 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.
+
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 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, 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.
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# -*- Autoconf -*-
+# Copyright (C) 2003 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, 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.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# serial 5 -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 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, 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.
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001, 2002 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, 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.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 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, 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.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 5
+
+AC_PREREQ(2.52)
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+ $1_TRUE=
+ $1_FALSE='#'
+else
+ $1_TRUE='#'
+ $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# Copyright 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_PREREQ([2.52])
+
+# serial 6
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
-# serial 1
+# Copyright 1996, 1998, 2000, 2001, 2002 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, 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.
+
+# serial 2
AC_DEFUN([AM_MAINTAINER_MODE],
[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
@@ -162,23 +913,12 @@ AC_DEFUN([AM_MAINTAINER_MODE],
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
- AC_MSG_RESULT($USE_MAINTAINER_MODE)
- AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
-# Define a conditional.
-
-AC_DEFUN([AM_CONDITIONAL],
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
-if $2; then
- $1_TRUE=
- $1_FALSE='#'
-else
- $1_TRUE='#'
- $1_FALSE=
-fi])
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
diff --git a/fastjar/config.h.in b/fastjar/config.h.in
index 61fcc9da7bd..b6f06b3d238 100644
--- a/fastjar/config.h.in
+++ b/fastjar/config.h.in
@@ -1,57 +1,87 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
+/* config.h.in. Generated from configure.in by autoheader. */
-/* Define to `long' if <sys/types.h> doesn't define. */
-#undef off_t
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if your <sys/time.h> declares struct tm. */
-#undef TM_IN_SYS_TIME
+/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
+#undef BYTEORDER
-/* Define if you have the <dirent.h> header file. */
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
#undef HAVE_DIRENT_H
-/* Define if you have the <fcntl.h> header file. */
+/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
-/* Define if you have the <limits.h> header file. */
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <limits.h> header file. */
#undef HAVE_LIMITS_H
-/* Define if you have the <ndir.h> header file. */
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
-/* Define if you have the <stdlib.h> header file. */
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
-/* Define if you have the <sys/dir.h> header file. */
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
#undef HAVE_SYS_DIR_H
-/* Define if you have the <sys/ndir.h> header file. */
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
#undef HAVE_SYS_NDIR_H
-/* Define if you have the <sys/param.h> header file. */
+/* Define to 1 if you have the <sys/param.h> header file. */
#undef HAVE_SYS_PARAM_H
-/* Define if you have the <unistd.h> header file. */
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
+/* Define if the host machine stores words of multi-word integers in
+ big-endian order. */
+#undef HOST_WORDS_BIG_ENDIAN
+
+/* Define if host mkdir takes a single argument. */
+#undef MKDIR_TAKES_ONE_ARG
+
/* Name of package */
#undef PACKAGE
-/* Version number of package */
-#undef VERSION
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
-/* Define if host mkdir takes a
-single argument. */
-#undef MKDIR_TAKES_ONE_ARG
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
/* The number of bytes in type char */
#undef SIZEOF_CHAR
-/* The number of bytes in type short */
-#undef SIZEOF_SHORT
-
/* The number of bytes in type int */
#undef SIZEOF_INT
@@ -61,13 +91,20 @@ single argument. */
/* The number of bytes in type long long */
#undef SIZEOF_LONG_LONG
-/* whether byteorder is bigendian */
-#undef WORDS_BIGENDIAN
+/* The number of bytes in type short */
+#undef SIZEOF_SHORT
-/* Define if the host machine stores words of multi-word integers in
- big-endian order. */
-#undef HOST_WORDS_BIG_ENDIAN
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
-/* 1234 = LIL_ENDIAN, 4321 = BIGENDIAN */
-#undef BYTEORDER
+/* Define to 1 if your <sys/time.h> declares `struct tm'. */
+#undef TM_IN_SYS_TIME
+/* Version number of package */
+#undef VERSION
+
+/* whether byteorder is bigendian */
+#undef WORDS_BIGENDIAN
+
+/* Define to `long' if <sys/types.h> does not define. */
+#undef off_t
diff --git a/fastjar/configure b/fastjar/configure
index 9931c0d4647..b4417364cb0 100755
--- a/fastjar/configure
+++ b/fastjar/configure
@@ -1,31 +1,324 @@
#! /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.
+# Generated by GNU Autoconf 2.57.
#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
-# Defaults:
-ac_help=
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
-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
- --with-system-zlib use installed libz"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME=
+PACKAGE_TARNAME=
+PACKAGE_VERSION=
+PACKAGE_STRING=
+PACKAGE_BUGREPORT=
+
+ac_unique_file="jartool.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE RM CP CHMOD MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT fastjar_warn_cflags CPP EGREP ZLIBS ZDEPS ZINCS gcc_version LIBOBJS LTLIBOBJS'
+ac_subst_files=''
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -34,10 +327,15 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -51,17 +349,9 @@ 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"
@@ -69,59 +359,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$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" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*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" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ 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/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# 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
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -130,95 +420,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ 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 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$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" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ 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" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -227,19 +469,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ 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-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -253,26 +495,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ 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_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_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -289,7 +531,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -299,7 +541,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -310,58 +552,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ 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" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$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 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# 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
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*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" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -372,99 +613,110 @@ EOF
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_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" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- 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"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$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; }
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); 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
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# 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
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
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" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
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
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+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
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# 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=jartool.h
# 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=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -474,13 +726,440 @@ else
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; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # 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 <<_ACEOF
+\`configure' configures this package to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --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
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-system-zlib use installed libz
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd $ac_popdir
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core core.* *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# 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
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -491,41 +1170,106 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
+ fi
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); 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
-
-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
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+am__api_version="1.7"
ac_aux_dir=
for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
if test -f $ac_dir/install-sh; then
@@ -536,14 +1280,20 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
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 "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;}
+ { (exit 1); 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.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -552,444 +1302,1012 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# 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:561: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
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
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /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
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ 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"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:614: checking whether build environment is sane" >&5
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# 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`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $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; }
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
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
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
+ 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"
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+for ac_prog in gawk mawk 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:671: 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
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
else
- cat > conftestmake <<\EOF
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
+
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 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
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
-PACKAGE=fastjar
-
-VERSION=0.92-gcc
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-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; }
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
fi
-cat >> confdefs.h <<EOF
+
+
+# Define the identity of the package.
+ PACKAGE=fastjar
+ VERSION=0.92-gcc
+
+
+cat >>confdefs.h <<_ACEOF
#define PACKAGE "$PACKAGE"
-EOF
+_ACEOF
-cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define VERSION "$VERSION"
-EOF
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:717: 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
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:730: 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
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:743: 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
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:756: 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
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:769: 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
+ STRIP=$ac_ct_STRIP
else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+ ac_config_headers="$ac_config_headers config.h"
-# Extract the first word of "gcc", so it can be a program name with args.
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # 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:789: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
else
- echo "$ac_t""no" 1>&6
+ CC="$ac_cv_prog_CC"
fi
+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:819: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
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
+ if test $# != 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="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&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:870: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&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; }
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:902: 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
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-cat > conftest.$ac_ext << EOF
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
-#line 913 "configure"
-#include "confdefs.h"
+ test -n "$ac_ct_CC" && break
+done
-main(){return(0);}
-EOF
-if { (eval echo configure:918: \"$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
+ CC=$ac_ct_CC
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
else
- ac_cv_prog_cc_cross=yes
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
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:944: 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:949: 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:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
else
- ac_cv_prog_gcc=no
-fi
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
else
- GCC=
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
-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:977: 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
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
+ CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
@@ -1003,6 +2321,390 @@ else
CFLAGS=
fi
fi
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
+}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
+}
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ ''\
+ '#include <stdlib.h>' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
+fi
+
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+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
@@ -1011,315 +2713,254 @@ fi
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# 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:1020: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
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
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /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
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ 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"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# Extract the first word of "rm", so it can be a program name with args.
set dummy rm; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1075: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_RM'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_RM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$RM" in
- /*)
+ case $RM in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_RM="$RM" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_RM="$RM" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_RM="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_RM="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_RM" && ac_cv_path_RM="/bin/rm"
;;
esac
fi
-RM="$ac_cv_path_RM"
+RM=$ac_cv_path_RM
+
if test -n "$RM"; then
- echo "$ac_t""$RM" 1>&6
+ echo "$as_me:$LINENO: result: $RM" >&5
+echo "${ECHO_T}$RM" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
# Extract the first word of "cp", so it can be a program name with args.
set dummy cp; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1111: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_CP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$CP" in
- /*)
+ case $CP in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_CP="$CP" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_CP="$CP" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CP="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CP="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_CP" && ac_cv_path_CP="/bin/cp"
;;
esac
fi
-CP="$ac_cv_path_CP"
+CP=$ac_cv_path_CP
+
if test -n "$CP"; then
- echo "$ac_t""$CP" 1>&6
+ echo "$as_me:$LINENO: result: $CP" >&5
+echo "${ECHO_T}$CP" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
# 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:1147: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_STRIP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$STRIP" in
- /*)
+ case $STRIP in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_STRIP="$STRIP" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_STRIP="$STRIP" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_STRIP="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_STRIP="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_STRIP" && ac_cv_path_STRIP="/usr/bin/strip"
;;
esac
fi
-STRIP="$ac_cv_path_STRIP"
+STRIP=$ac_cv_path_STRIP
+
if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
# Extract the first word of "chmod", so it can be a program name with args.
set dummy chmod; ac_word=$2
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1183: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_path_CHMOD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_path_CHMOD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$CHMOD" in
- /*)
+ case $CHMOD in
+ [\\/]* | ?:[\\/]*)
ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a path.
;;
- ?:/*)
- ac_cv_path_CHMOD="$CHMOD" # Let the user override the test with a dos path.
- ;;
*)
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
- for ac_dir in $ac_dummy; do
- test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_path_CHMOD="$ac_dir/$ac_word"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_dummy="$PATH:/bin:/usr/bin:/usr/local/bin"
+for as_dir in $as_dummy
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_path_CHMOD="$as_dir/$ac_word$ac_exec_ext"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
test -z "$ac_cv_path_CHMOD" && ac_cv_path_CHMOD="/bin/chmod"
;;
esac
fi
-CHMOD="$ac_cv_path_CHMOD"
-if test -n "$CHMOD"; then
- echo "$ac_t""$CHMOD" 1>&6
-else
- echo "$ac_t""no" 1>&6
-fi
-
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:1217: 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 1222 "configure"
-#include "confdefs.h"
-
-int main() {
-
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:1233: \"$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:1250: 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 1255 "configure"
-#include "confdefs.h"
+CHMOD=$ac_cv_path_CHMOD
-int main() {
-return __MINGW32__;
-; return 0; }
-EOF
-if { (eval echo configure:1262: \"$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 $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1281: 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
+if test -n "$CHMOD"; then
+ echo "$as_me:$LINENO: result: $CHMOD" >&5
+echo "${ECHO_T}$CHMOD" >&6
else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- if { (eval echo configure:1291: \"$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
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
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:1313: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
# 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
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
- echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
-
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
@@ -1328,8 +2969,9 @@ else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
+
MAINT=$MAINTAINER_MODE_TRUE
-
+
if test "$GCC" = yes; then
@@ -1337,251 +2979,600 @@ if test "$GCC" = yes; then
fi
+
+
+
+
+
+
ac_header_dirent=no
-for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h
-do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6
-echo "configure:1346: checking for $ac_hdr that defines DIR" >&5
-if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat > conftest.$ac_ext <<EOF
-#line 1351 "configure"
-#include "confdefs.h"
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <$ac_hdr>
-int main() {
-DIR *dirp = 0;
-; return 0; }
-EOF
-if { (eval echo configure:1359: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=yes"
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_header_dirent_$ac_safe=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-if eval "test \"`echo '$ac_cv_header_dirent_'$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
- ac_header_dirent=$ac_hdr; break
-else
- echo "$ac_t""no" 1>&6
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
fi
+
done
# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
if test $ac_header_dirent = dirent.h; then
-echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6
-echo "configure:1384: checking for opendir in -ldir" >&5
-ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldir $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1392 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:1403: \"$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"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -ldir"
-else
- echo "$ac_t""no" 1>&6
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
+
fi
else
-echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6
-echo "configure:1425: checking for opendir in -lx" >&5
-ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-lx $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1433 "configure"
-#include "confdefs.h"
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char opendir();
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-int main() {
-opendir()
-; return 0; }
-EOF
-if { (eval echo configure:1444: \"$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"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- LIBS="$LIBS -lx"
-else
- echo "$ac_t""no" 1>&6
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1467: checking how to run the C preprocessor" >&5
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
# 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
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
# On the NeXT, cc -E runs the code through the compiler's parser,
- # not just through cpp.
- cat > conftest.$ac_ext <<EOF
-#line 1482 "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:1488: \"$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
- :
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
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 1499 "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:1505: \"$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
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_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 1516 "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:1522: \"$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
- :
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ ac_cpp_err=yes
fi
-rm -f conftest*
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
fi
-rm -f conftest*
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+
+ done
+ ac_cv_prog_CPP=$CPP
+
fi
- CPP="$ac_cv_prog_CPP"
+ CPP=$ac_cv_prog_CPP
else
- ac_cv_prog_CPP="$CPP"
+ ac_cv_prog_CPP=$CPP
fi
-echo "$ac_t""$CPP" 1>&6
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:1547: 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
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
else
- cat > conftest.$ac_ext <<EOF
-#line 1552 "configure"
-#include "confdefs.h"
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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:1560: \"$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*
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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 1577 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <string.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
+ $EGREP "memchr" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1590,16 +3581,20 @@ 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 1595 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <stdlib.h>
-EOF
+
+_ACEOF
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
+ $EGREP "free" >/dev/null 2>&1; then
:
else
- rm -rf conftest*
ac_cv_header_stdc=no
fi
rm -f conftest*
@@ -1608,196 +3603,463 @@ 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
+ if test "$cross_compiling" = yes; then
:
else
- cat > conftest.$ac_ext <<EOF
-#line 1616 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end 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); }
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
-EOF
-if { (eval echo configure:1627: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
:
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_header_stdc" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
if test $ac_cv_header_stdc = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define STDC_HEADERS 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1651: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1656 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
-int main() {
+
+int
+main ()
+{
struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_struct_tm=time.h
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm=sys/time.h
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_struct_tm=sys/time.h
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
if test $ac_cv_struct_tm = sys/time.h; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define TM_IN_SYS_TIME 1
-EOF
+_ACEOF
fi
-for ac_hdr in fcntl.h unistd.h sys/param.h stdlib.h limits.h
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.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:1688: 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 1693 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:1698: \"$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"
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
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
-
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+for ac_header in fcntl.h unistd.h sys/param.h stdlib.h limits.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
done
-echo $ac_n "checking for off_t""... $ac_c" 1>&6
-echo "configure:1726: 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
+echo "$as_me:$LINENO: checking for off_t" >&5
+echo $ECHO_N "checking for off_t... $ECHO_C" >&6
+if test "${ac_cv_type_off_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1731 "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*
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+int
+main ()
+{
+if ((off_t *) 0)
+ return 0;
+if (sizeof (off_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_type_off_t=yes
else
- rm -rf conftest*
- ac_cv_type_off_t=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_type_off_t=no
fi
-echo "$ac_t""$ac_cv_type_off_t" 1>&6
-if test $ac_cv_type_off_t = no; then
- cat >> confdefs.h <<\EOF
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_off_t" >&5
+echo "${ECHO_T}$ac_cv_type_off_t" >&6
+if test $ac_cv_type_off_t = yes; then
+ :
+else
+
+cat >>confdefs.h <<_ACEOF
#define off_t long
-EOF
+_ACEOF
fi
-echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:1759: checking whether struct tm is in sys/time.h or time.h" >&5
-if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking whether struct tm is in sys/time.h or time.h" >&5
+echo $ECHO_N "checking whether struct tm is in sys/time.h or time.h... $ECHO_C" >&6
+if test "${ac_cv_struct_tm+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1764 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <time.h>
-int main() {
+
+int
+main ()
+{
struct tm *tp; tp->tm_sec;
-; return 0; }
-EOF
-if { (eval echo configure:1772: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_struct_tm=time.h
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_struct_tm=sys/time.h
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_struct_tm=sys/time.h
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$ac_cv_struct_tm" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_struct_tm" >&5
+echo "${ECHO_T}$ac_cv_struct_tm" >&6
if test $ac_cv_struct_tm = sys/time.h; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define TM_IN_SYS_TIME 1
-EOF
+_ACEOF
fi
# mkdir takes a single argument on some systems.
-echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:1795: 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
+echo "$as_me:$LINENO: checking if mkdir takes one argument" >&5
+echo $ECHO_N "checking if mkdir takes one argument... $ECHO_C" >&6
+if test "${gcc_cv_mkdir_takes_one_arg+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1800 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#ifdef HAVE_SYS_STAT_H
@@ -1809,283 +4071,454 @@ else
#ifdef HAVE_DIRECT_H
# include <direct.h>
#endif
-int main() {
+int
+main ()
+{
mkdir ("foo", 0);
-; return 0; }
-EOF
-if { (eval echo configure:1817: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
gcc_cv_mkdir_takes_one_arg=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- gcc_cv_mkdir_takes_one_arg=yes
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+gcc_cv_mkdir_takes_one_arg=yes
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
fi
-
-echo "$ac_t""$gcc_cv_mkdir_takes_one_arg" 1>&6
+echo "$as_me:$LINENO: result: $gcc_cv_mkdir_takes_one_arg" >&5
+echo "${ECHO_T}$gcc_cv_mkdir_takes_one_arg" >&6
if test $gcc_cv_mkdir_takes_one_arg = yes ; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define MKDIR_TAKES_ONE_ARG 1
-EOF
+_ACEOF
fi
-echo $ac_n "checking size of char""... $ac_c" 1>&6
-echo "configure:1839: checking size of char" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking size of char" >&5
+echo $ECHO_N "checking size of char... $ECHO_C" >&6
+if test "${ac_cv_sizeof_char+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
- cat > conftest.$ac_ext <<EOF
-#line 1845 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
-int main() {
+int
+main ()
+{
switch (0) case 0: case (sizeof (char) == $ac_size):;
-; return 0; }
-EOF
-if { (eval echo configure:1855: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_sizeof_char=$ac_size
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x$ac_cv_sizeof_char != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_char = x ; then
- { echo "configure: error: cannot determine a size for char" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot determine a size for char" >&5
+echo "$as_me: error: cannot determine a size for char" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_sizeof_char" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_char" >&5
+echo "${ECHO_T}$ac_cv_sizeof_char" >&6
+
+cat >>confdefs.h <<_ACEOF
#define SIZEOF_CHAR $ac_cv_sizeof_char
-EOF
+_ACEOF
-echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1878: checking size of short" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking size of short" >&5
+echo $ECHO_N "checking size of short... $ECHO_C" >&6
+if test "${ac_cv_sizeof_short+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
- cat > conftest.$ac_ext <<EOF
-#line 1884 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
-int main() {
+int
+main ()
+{
switch (0) case 0: case (sizeof (short) == $ac_size):;
-; return 0; }
-EOF
-if { (eval echo configure:1894: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_sizeof_short=$ac_size
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x$ac_cv_sizeof_short != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_short = x ; then
- { echo "configure: error: cannot determine a size for short" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot determine a size for short" >&5
+echo "$as_me: error: cannot determine a size for short" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_sizeof_short" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_short" >&5
+echo "${ECHO_T}$ac_cv_sizeof_short" >&6
+
+cat >>confdefs.h <<_ACEOF
#define SIZEOF_SHORT $ac_cv_sizeof_short
-EOF
+_ACEOF
-echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1917: checking size of int" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking size of int" >&5
+echo $ECHO_N "checking size of int... $ECHO_C" >&6
+if test "${ac_cv_sizeof_int+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
- cat > conftest.$ac_ext <<EOF
-#line 1923 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
-int main() {
+int
+main ()
+{
switch (0) case 0: case (sizeof (int) == $ac_size):;
-; return 0; }
-EOF
-if { (eval echo configure:1933: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_sizeof_int=$ac_size
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x$ac_cv_sizeof_int != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_int = x ; then
- { echo "configure: error: cannot determine a size for int" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot determine a size for int" >&5
+echo "$as_me: error: cannot determine a size for int" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_sizeof_int" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_int" >&5
+echo "${ECHO_T}$ac_cv_sizeof_int" >&6
+
+cat >>confdefs.h <<_ACEOF
#define SIZEOF_INT $ac_cv_sizeof_int
-EOF
+_ACEOF
-echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1956: checking size of long" >&5
-if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking size of long" >&5
+echo $ECHO_N "checking size of long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
- cat > conftest.$ac_ext <<EOF
-#line 1962 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
-int main() {
+int
+main ()
+{
switch (0) case 0: case (sizeof (long) == $ac_size):;
-; return 0; }
-EOF
-if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_sizeof_long=$ac_size
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x$ac_cv_sizeof_long != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_long = x ; then
- { echo "configure: error: cannot determine a size for long" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot determine a size for long" >&5
+echo "$as_me: error: cannot determine a size for long" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_sizeof_long" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long" >&6
+
+cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG $ac_cv_sizeof_long
-EOF
+_ACEOF
-echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1995: 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
+echo "$as_me:$LINENO: checking size of long long" >&5
+echo $ECHO_N "checking size of long long... $ECHO_C" >&6
+if test "${ac_cv_sizeof_long_long+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
- cat > conftest.$ac_ext <<EOF
-#line 2001 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include "confdefs.h"
#include <sys/types.h>
-int main() {
+int
+main ()
+{
switch (0) case 0: case (sizeof (long long) == $ac_size):;
-; return 0; }
-EOF
-if { (eval echo configure:2011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_sizeof_long_long=$ac_size
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test x$ac_cv_sizeof_long_long != x ; then break; fi
done
fi
if test x$ac_cv_sizeof_long_long = x ; then
- { echo "configure: error: cannot determine a size for long long" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: cannot determine a size for long long" >&5
+echo "$as_me: error: cannot determine a size for long long" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6
-cat >> confdefs.h <<EOF
+echo "$as_me:$LINENO: result: $ac_cv_sizeof_long_long" >&5
+echo "${ECHO_T}$ac_cv_sizeof_long_long" >&6
+
+cat >>confdefs.h <<_ACEOF
#define SIZEOF_LONG_LONG $ac_cv_sizeof_long_long
-EOF
+_ACEOF
-echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:2035: 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
+echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5
+echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6
+if test "${ac_cv_c_bigendian+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_bigendian=unknown
# See if sys/param.h defines the BYTE_ORDER macro.
-cat > conftest.$ac_ext <<EOF
-#line 2042 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
-int main() {
+int
+main ()
+{
#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN
bogus endian macros
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2053: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
# It does; now see whether it defined to BIG_ENDIAN or not.
-cat > conftest.$ac_ext <<EOF
-#line 2057 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
#include <sys/types.h>
#include <sys/param.h>
-int main() {
+int
+main ()
+{
#if BYTE_ORDER != BIG_ENDIAN
not big endian
#endif
-; return 0; }
-EOF
-if { (eval echo configure:2068: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_bigendian=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_bigendian=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
if test $ac_cv_c_bigendian = unknown; then
if test "$cross_compiling" = yes; then
- echo $ac_n "cross-compiling... " 2>&6
+ echo $ac_n "cross-compiling... " 2>&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2088 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
main () {
/* Are we little or big endian? From Harbison&Steele. */
union
@@ -2096,26 +4529,36 @@ main () {
u.l = 1;
exit (u.c[sizeof (long) - 1] == 1);
}
-EOF
-if { (eval echo configure:2101: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_bigendian=no
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_c_bigendian=yes
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_c_bigendian=yes
fi
-rm -fr conftest*
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
-
fi
fi
-
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
if test $ac_cv_c_bigendian = unknown; then
-echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:2119: checking to probe for byte ordering" >&5
+echo "$as_me:$LINENO: checking to probe for byte ordering" >&5
+echo $ECHO_N "checking to probe for byte ordering... $ECHO_C" >&6
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -2143,81 +4586,106 @@ EOF
echo $ac_n 'guessing bigendian ... ' >&6
fi
fi
-echo "$ac_t""$ac_cv_c_bigendian" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5
+echo "${ECHO_T}$ac_cv_c_bigendian" >&6
fi
if test $ac_cv_c_bigendian = yes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define WORDS_BIGENDIAN 1
-EOF
+_ACEOF
+
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HOST_WORDS_BIG_ENDIAN 1
-EOF
+_ACEOF
BYTEORDER=4321
else
BYTEORDER=1234
fi
-cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define BYTEORDER $BYTEORDER
-EOF
+_ACEOF
if test $ac_cv_c_bigendian = unknown; then
- { echo "configure: error: unknown endianess - sorry" 1>&2; exit 1; }
+ { { echo "$as_me:$LINENO: error: unknown endianess - sorry" >&5
+echo "$as_me: error: unknown endianess - sorry" >&2;}
+ { (exit please pre-set ac_cv_c_bigendian); exit please pre-set ac_cv_c_bigendian; }; }
fi
+
# Check whether --with-system-zlib or --without-system-zlib was given.
if test "${with_system_zlib+set}" = set; then
withval="$with_system_zlib"
- :
-fi
+fi;
ZLIBS=
ZDEPS=
ZINCS=
use_zlib=maybe
if test "$with_system_zlib" = yes; then
- echo $ac_n "checking for deflate in -lz""... $ac_c" 1>&6
-echo "configure:2184: 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
+ echo "$as_me:$LINENO: checking for deflate in -lz" >&5
+echo $ECHO_N "checking for deflate in -lz... $ECHO_C" >&6
+if test "${ac_cv_lib_z_deflate+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 2192 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char deflate();
-
-int main() {
-deflate()
-; return 0; }
-EOF
-if { (eval echo configure:2203: \"$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"
+ builtin and then its argument prototype would still apply. */
+char deflate ();
+int
+main ()
+{
+deflate ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_z_deflate=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_z_deflate=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_z_deflate" >&5
+echo "${ECHO_T}$ac_cv_lib_z_deflate" >&6
+if test $ac_cv_lib_z_deflate = yes; then
ZLIBS=-lz
else
- echo "$ac_t""no" 1>&6
-use_zlib=no
+ use_zlib=no
fi
else
@@ -2244,383 +4712,1327 @@ gcc_version_full=`grep version_string ${gcc_version_trigger} | sed -e 's/.*"\([^
gcc_version=`echo ${gcc_version_full} | sed -e 's/\([^ ]*\) .*/\1/'`
-trap '' 1 2 15
-cat > confcache <<\EOF
+ ac_config_files="$ac_config_files Makefile install-defs.sh"
+cat >confcache <<\_ACEOF
# 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.
+# scripts and configure runs, see configure's option --config-cache.
+# 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.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# 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
+{
+ (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 \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && 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.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# 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.
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
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
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-trap 'rm -fr `echo "Makefile install-defs.sh config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
-# 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%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-s%@AUTOMAKE@%$AUTOMAKE%g
-s%@AUTOHEADER@%$AUTOHEADER%g
-s%@MAKEINFO@%$MAKEINFO%g
-s%@SET_MAKE@%$SET_MAKE%g
-s%@CC@%$CC%g
-s%@RM@%$RM%g
-s%@CP@%$CP%g
-s%@STRIP@%$STRIP%g
-s%@CHMOD@%$CHMOD%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%@fastjar_warn_cflags@%$fastjar_warn_cflags%g
-s%@CPP@%$CPP%g
-s%@ZLIBS@%$ZLIBS%g
-s%@ZDEPS@%$ZDEPS%g
-s%@ZINCS@%$ZINCS%g
-s%@gcc_version@%$gcc_version%g
-CEOF
-EOF
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
-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
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
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`
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by $as_me, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+config.status
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-EOF
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
-CONFIG_FILES=\${CONFIG_FILES-"Makefile install-defs.sh"}
-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" ;;
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "install-defs.sh" ) CONFIG_FILES="$CONFIG_FILES install-defs.sh" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
+done
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
- # 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=
+# Create a (secure) tmp directory for tmp files.
+
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@RM@,$RM,;t t
+s,@CP@,$CP,;t t
+s,@CHMOD@,$CHMOD,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@fastjar_warn_cflags@,$fastjar_warn_cflags,;t t
+s,@CPP@,$CPP,;t t
+s,@EGREP@,$EGREP,;t t
+s,@ZLIBS@,$ZLIBS,;t t
+s,@ZDEPS@,$ZDEPS,;t t
+s,@ZINCS@,$ZINCS,;t t
+s,@gcc_version@,$gcc_version,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # 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_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+fi # test -n "$CONFIG_FILES"
- 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" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
- 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= ;;
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
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
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
# 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_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without 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
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# 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" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) 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
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# 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.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# 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.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
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
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$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
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
+done
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.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"
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
-fi; done
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
-exit 0
-EOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
diff --git a/fastjar/install-sh b/fastjar/install-sh
deleted file mode 100755
index c719342656f..00000000000
--- a/fastjar/install-sh
+++ /dev/null
@@ -1,8 +0,0 @@
-#! /bin/bash
-
-. install-defs.sh
-
-$CP fastjar ${BINDIR}
-$STRIP ${BINDIR}/fastjar
-$CHMOD 755 ${BINDIR}/fastjar
-
diff --git a/gcc/.cvsignore b/gcc/.cvsignore
index 4e3c335065a..3f4ee4b6f48 100644
--- a/gcc/.cvsignore
+++ b/gcc/.cvsignore
@@ -1,11 +1,4 @@
-c-parse.y
-c-parse.h
-c-parse.c
-tradcif.c
cscope.files
cscope.out
cscope.in.out
cscope.po.out
-gengtype-lex.c
-gengtype-yacc.c
-gengtype-yacc.h
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e62f2451f43..3308196ed66 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,4429 @@
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
+ * rtlanal.c (rtx_varies_p): Return 0 for NULL_RTX
+
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
+ PR debug/12934
+ * dwarf2out.c (loc_descriptor_from_tree): Handle
+ EXPR_WITH_FILE_LOCATION.
+
+2004-02-11 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.c (set_collect_gcc_options): Use double quotes instead of
+ single quotes on Windows.
+ * tlink.c (recompile_files): Do not assume that "rename" can
+ overwrite an existing file. Use "&&" as the command separator
+ rather than ";".
+
+ * collect2.c (collect_wait): Check return code from pwait.
+ (collect_execute): Pass third argument to open. Check return code
+ from open. Redirect both stdout and stderr when redirecting.
+
+ * system.h (WIFSIGNALED, WTERMSIG, WIFEXITED, WEXITSTATUS,
+ WSTOPSIG, SCOREDUMP, WCOREFLG): Remove definitions.
+
+2004-01-30 Paul Brook <paul@codesourcery.com>
+
+ * aof.h (REGISTER_NAMES): Add vfp reg names
+ (ADDITIONAL_REGISTER_NAMES): Ditto.
+ * aout.h (REGISTER_NAMES): Ditto.
+ (ADDITIONAL_REGISTER_NAMES): Ditto.
+ * arm-protos.h: Update/Add Prototypes.
+ * arm.c (init_fp_table): Rename from init_fpa_table. Update users.
+ Only allow 0.0 for VFP.
+ (fp_consts_inited): Rename from fpa_consts_inited. Update users.
+ (values_fp): Rename from values_fpa. Update Users.
+ (arm_const_double_rtx): Rename from const_double_rtx_ok_for_fpa.
+ Update users. Only check valid constants for this hardware.
+ (arm_float_rhs_operand): Rename from fpa_rhs_operand. Update Users.
+ Only allow consts for FPA.
+ (arm_float_add_operand): Rename from fpa_add_operand. Update users.
+ Only allow consts for FPA.
+ (use_return_insn): Check for saved VFP regs.
+ (arm_legitimate_address_p): Handle VFP DFmode addressing.
+ (arm_legitimize_address): Ditto.
+ (arm_general_register_operand): New function.
+ (vfp_mem_operand): New function.
+ (vfp_compare_operand): New function.
+ (vfp_secondary_reload_class): New function.
+ (arm_float_compare_operand): New function.
+ (vfp_print_multi): New function.
+ (vfp_output_fstmx): New function.
+ (vfp_emit_fstm): New function.
+ (arm_output_epilogue): Output VPF reg restore code.
+ (arm_expand_prologue): Output VFP reg save code.
+ (arm_print_operand): Add 'P'.
+ (arm_hard_regno_mode_ok): Return modes for VFP regs.
+ (arm_regno_class): Return classes for VFP regs.
+ (arm_compute_initial_elimination_offset): Include space for VFP regs.
+ (arm_get_frame_size): Ditto.
+ * arm.h (FIXED_REGISTERS): Add VFP regs.
+ (CALL_USED_REGISTERS): Ditto.
+ (CONDITIONAL_REGISTER_USAGE): Enable VFP regs.
+ (FIRST_VFP_REGNUM): Define.
+ (LAST_VFP_REGNUM): Define.
+ (IS_VFP_REGNUM): Define.
+ (FIRST_PSEUDO_REGISTER): Include VFP regs.
+ (HARD_REGNO_NREGS): Handle VFP regs.
+ (REG_ALLOC_ORDER): Add VFP regs.
+ (enum reg_class): Add VFP_REGS.
+ (REG_CLASS_NAMES): Ditto.
+ (REG_CLASS_CONTENTS): Ditto.
+ (CANNOT_CHANGE_MODE_CLASS) Handle VFP Regs.
+ (REG_CLASS_FROM_LETTER): Add 'w'.
+ (EXTRA_CONSTRAINT_ARM): Add 'U'.
+ (EXTRA_MEMORY_CONSTRAINT): Define.
+ (SECONDARY_OUTPUT_RELOAD_CLASS): Handle VFP regs.
+ (SECONDARY_INPUT_RELOAD_CLASS): Ditto.
+ (REGISTER_MOVE_COST): Ditto.
+ (PREDICATE_CODES): Add arm_general_register_operand,
+ arm_float_compare_operand and vfp_compare_operand.
+ * arm.md (various): Rename as above.
+ (divsf3): Enable when TARGET_VFP.
+ (divdf3): Ditto.
+ (movdfcc): Ditto.
+ (sqrtsf2): Ditto.
+ (sqrtdf2): Ditto.
+ (arm_movdi): Disable when TARGET_VFP.
+ (arm_movsi_insn): Ditto.
+ (movsi): Only split with general regs.
+ (cmpsf): Use arm_float_compare_operand.
+ (push_fp_multi): Restrict to TARGET_FPA.
+ (vfp.md): Include.
+ * vfp.md: New file.
+ * fpa.md (various): Rename as above.
+ * doc/md.texi: Document ARM w and U constraints.
+
+2004-01-15 Paul Brook <paul@codesourcery.com>
+
+ * config.gcc: Add with_fpu. Allow with-float=softfp.
+ * config/arm/arm.c (arm_override_options): Rename *-s to *s.
+ Break out of loop when we find a float-abi. Fix typo.
+ * config/arm/arm.h (OPTION_DEFAULT_SPECS): Add "fpu".
+ Set -mfloat-abi=.
+ * doc/install.texi: Document --with-fpu.
+
+2003-01-14 Paul Brook <paul@codesourcery.com>
+
+ * config.gcc (with_arch): Add armv6.
+ * config/arm/arm.h: Rename TARGET_CPU_*_s to TARGET_CPU_*s.
+ * config/arm/arm.c (arm_overrride_options): Ditto.
+
+2004-01-08 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (FL_ARCH3M): Renamed from FL_FAST_MULT.
+ (FL_ARCH6): Renamed from FL_ARCH6J.
+ (arm_arch3m): Renamed from arm_fast_multiply.
+ (arm_arch6): Renamed from arm_arch6j.
+ * arm.h: Update all uses of above.
+ * arm-cores.def: Likewise.
+ * arm.md: Likewise.
+
+ * arm.h (CPP_CPU_ARCH_SPEC): Emit __ARM_ARCH_6J__ define for armV6j,
+ not arm6j. Add entry for arch armv6.
+
+2004-01-07 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_emit_extendsi): Delete.
+ * arm-protos.h (arm_emit_extendsi): Delete.
+ * arm.md (zero_extendhisi2): Also handle zero-extension of
+ non-subregs.
+ (zero_extendqisi2, extendhisi2, extendqisi2): Likewise.
+ (thumb_zero_extendhisi2): Only match if not v6.
+ (arm_zero_extendhisi2, thumb_zero_extendqisi2, arm_zero_extendqisi2)
+ (thumb_extendhisi2, arm_extendhisi2, arm_extendqisi)
+ (thumb_extendqisi2): Likewise.
+ (thumb_zero_extendhisi2_v6, arm_zero_extendhisi2_v6): New patterns.
+ (thumb_zero_extendqisi2_v6, arm_zero_extendqisi2_v6): New patterns.
+ (thumb_extendhisi2_insn_v6, arm_extendhisi2_v6): New patterns.
+ (thumb_extendqisi2_v6, arm_extendqisi_v6): New patterns.
+ (arm_zero_extendhisi2_reg, arm_zero_extendqisi2_reg): Delete.
+ (arm_extendhisi2_reg, arm_extendqisi2_reg): Delete.
+ (arm_zero_extendhisi2addsi): Remove subreg. Add attributes.
+ (arm_zero_extendqisi2addsi, arm_extendhisi2addsi): Likewise.
+ (arm_extendqisi2addsi): Likewise.
+
+2003-12-31 Mark Mitchell <mark@codesourcery.com>
+
+ * diagnostic.c (bug_report_request): Use email form.
+ * gcc.c (execute): Likewise.
+ * version.c (version_string): Modify.
+ (bug_report_url): Likewise.
+
+ Revert this change:
+ * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ + REG addressing modes.
+
+ * regrename.c (find_oldest_value_reg): Handle HARD_REGNO_NREGS > 1
+ correctly.
+
+ * config/arm/arm.h (THUMB_LEGTITIMIZE_RELOAD_ADDRESS): Reload REG
+ + REG addressing modes.
+
+2003-12-30 Mark Mitchell <mark@codesourcery.com>
+
+ * config/arm/arm.h (THUMB_LEGITIMATE_CONSTANT_P): Accept
+ CONSTANT_P_RTX.
+
+2003-30-12 Paul Brook <paul@codesourcery.com>
+
+ * longlong.h: protect arm inlines with !defined (__thumb__)
+
+2003-30-12 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.h (TARGET_CPU_CPP_BUILTINS): Always define __arm__.
+
+2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * builtins.c (expand_builtin_apply_args_1): Fix typo in previous
+ change.
+
+2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * builtins.c (expand_builtin_apply_args_1): Add pretend args size
+ to the virtual incoming args pointer for downward stacks.
+
+2003-12-29 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm-cores.def: Add cost function.
+ * config/arm/arm.c (arm_*_rtx_costs): New functions.
+ (arm_rtx_costs): Remove
+ (struct processors): Add rtx_costs field.
+ (all_cores, all_architectures): Ditto.
+ (arm_override_options): Set targetm.rtx_costs.
+ (thumb_rtx_costs): New function.
+ (arm_rtx_costs_1): Remove cases handled elsewhere.
+ * config/arm/arm.h (processor_type): Add COSTS parameter.
+
+2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/arm/arm.md (generic_sched): arm926 has its own scheduler.
+ (arm926ejs.md): Include it.
+ * config/arm/arm926ejs.md: New pipeline description.
+
+2003-12-24 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.c (arm_arch6j): New variable.
+ (arm_override_options): Set it.
+ (arm_emit_extendsi): New function.
+ * config/arm/arm-protos.h (arm_emit_extendsi): Add prototype.
+ * config/arm/arm.h (arm_arch6j): Declare.
+ * config/arm/arm.md: Add sign/zero extend insns.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * calls.c (expand_call): Recognize calls to "sqrt" and create
+ corresponding notes.
+
+2003-12-23 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.c (all_architectures): Add armv6.
+ * doc/invoke.texi: Document it.
+
+2003-12-23 Zack Weinberg <zack@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * collect2.c (windows.h): Include.
+ (dup2): Remove.
+ (handler): Change prototype.
+ (unhandled_filter): New funciton.
+ (install_handlers): Likewise.
+ (disable_break): Likewise.
+ (enable_break): Likewise.
+ (main): Call install_handlers rather than signal directly.
+ (collect_execute): Use pexec.
+ (scan_prog_file): Likewise.
+ (scan_libraries): Likewise.
+
+2003-12-19 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.md: Add load1 and load_byte "type" attrs. Modify
+ insn patterns to match.
+ * config/arm/arm-generic.md: Ditto.
+ * config/arm/cirrus.md: Ditto.
+ * config/arm/fpa.md: Ditto.
+ * config/amm/iwmmxt.md: Ditto.
+ * config/arm/arm1026ejs.md: Ditto.
+ * config/arm/arm1135jfs.md: Ditto. Add insn_reservation and bypasses
+ for 11_loadb.
+
+2003-12-18 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/arm/arm-protos.h (arm_no_early_alu_shift_value_dep): Declare.
+ * config/arm/arm.c (arm_adjust_cost): Check shift cost for
+ TYPE_ALU_SHIFT and TYPE_ALU_SHIFT_REG.
+ (arm_no_early_store_addr_dep, arm_no_early_alu_shift_dep,
+ arm_no_early_mul_dep): Correctly deal with conditional execution,
+ parallels and single shift operations.
+ (arm_no_early_alu_shift_value_dep): Define.
+ * arm.md (attr type): Replace 'normal' with 'alu',
+ 'alu_shift' and 'alu_shift_reg'.
+ (attr core_cycles): Adjust.
+ (*addsi3_carryin_shift, andsi_not_shiftsi_si, *arm_shiftsi3,
+ *shiftsi3_compare0, *notsi_shiftsi, *notsi_shiftsi_compare0,
+ *not_shiftsi_compare0_scratch, *cmpsi_shiftsi, *cmpsi_shiftsi_swp,
+ *cmpsi_neg_shiftsi, *arith_shiftsi, *arith_shiftsi_compare0,
+ *arith_shiftsi_compare0_scratch, *sub_shiftsi,
+ *sub_shiftsi_compare0, *sub_shiftsi_compare0_scratch,
+ *if_shift_move, *if_move_shift, *if_shift_shift): Set type
+ attribute appropriately.
+ * config/arm/arm1026ejs.md (alu_op): Adjust.
+ (alu_shift_op, alu_shift_reg_op): New.
+ * config/arm/arm1136.md: Add better bypasses for early
+ registers. Remove load[234] and store[234] bypasses.
+ (11_alu_op): Adjust.
+ (11_alu_shift_op, 11_alu_shift_reg_op): New.
+
+2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * config/arm/arm-protos.h (arm_no_early_store_addr_dep,
+ arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Declare.
+ * config/arm/arm.c (arm_no_early_store_addr_dep,
+ arm_no_early_alu_shift_dep, arm_no_early_mul_dep): Define.
+ * config/arm/arm1026ejs.md: Add load-store bypass.
+ * config/arm/arm1136jfs.md (11_alu_op): Take 2 cycles.
+ Add bypasses between instructions.
+
+2003-12-10 Paul Brook <paul@codesourcery.com>
+
+ * config/arm/arm.c (arm_fpu_model): New variable.
+ (arm_fload_abi): New variable.
+ (target_fpe_name): Rename from target_fp_name.
+ (target_fpu_name): New variable.
+ (arm_is_cirrus): Remove.
+ (fpu_desc): New struct.
+ (all_fpus): Define.
+ (pf_model_for_fpu): Define.
+ (all_loat_abis): Define.
+ (arm_override_options): Set fp arch flags based on -mfpu=
+ and -float-abi=.
+ (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
+ (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
+ (*): Use new TARGET_* flags.
+ * config/arm/arm.h (TARGET_ANY_HARD_FLOAT): Remove.
+ (TARGET_HARD_FLOAT): No longer implies TARGET_FPA.
+ (TARGET_SOFT_FLOAT): Ditto.
+ (TARGET_SOFT_FLOAT_ABI): New.
+ (TARGET_MAVERICK): Rename from TARGET_CIRRUS. No longer implies
+ TARGET_HARD_FLOAT.
+ (TARGET_VFP): No longer implies TARGET_HARD_FLOAT.
+ (TARGET_OPTIONS): Add -mfpu=.
+ (FIRST_FPA_REGNUM): Rename from FIRST_ARM_FP_REGNUM.
+ (LAST_FPA_REGNUM): Rename from LAST_ARM_FP_REGNUM.
+ (arm_pf_model): Define.
+ (arm_float_abi_type): Define.
+ (fputype): Add FPUTYPE_VFP. Change SOFT_FPA->NONE
+ * config/arm/arm.md: Use new TARGET_* flags.
+ * config/arm/cirrus.md: Ditto.
+ * config/arm/fpa.md: Ditto.
+ * config/arm/elf.h (ASM_SPEC): Pass -mfloat-abi= and -mfpu=.
+ * config/arm/semi.h (ASM_SPEC): Ditto.
+ * config/arm/netbsd-elf.h (SUBTARGET_ASM_FLOAT_SPEC): Specify vfp.
+ (FPUTYPE_DEFAULT): Set to VFP.
+ * doc/invoke.texi: Document -mfpu= and -mfloat-abi=.
+
+2003-11-22 Phil Edwards <phil@codesourcery.com>
+
+ PR target/12476
+ * config/arm/arm.c (arm_output_mi_thunk): In Thumb mode, use
+ 'bx' instead of 'b' to avoid branch range restrictions. Output
+ the thunk immediately before the thunked-to function.
+ * config/arm/arm.h (ARM_DECLARE_FUNCTION_NAME): Do not emit
+ .thumb_func if a thunk is being generated. Emit .code 16 along
+ with .thumb_func if a thunk is not being generated.
+
+2003-11-15 Nicolas Pitre <nico@cam.org>
+
+ * config/arm/arm.md (ashldi3, arm_ashldi3_1bit, ashrdi3,
+ arm_ashrdi3_1bit, lshrdi3, arm_lshrdi3_1bit): New patterns.
+ * config/arm/iwmmxt.md (ashrdi3_iwmmxt): Renamed from ashrdi3.
+ (lshrdi3_iwmmxt): Renamed from lshrdi3.
+ * config/arm/arm.c (IWMMXT_BUILTIN2): Renamed argument accordingly.
+
+2003-11-12 Steve Woodford <scw@wasabisystems.com>
+ Ian Lance Taylor <ian@wasabisystems.com>
+
+ * config/arm/lib1funcs.asm (ARM_DIV_BODY, ARM_MOD_BODY): Add new
+ code for __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__).
+
+2003-11-05 Phil Edwards <phil@codesourcery.com>
+
+ * config/arm/arm.md (insn): Add new V6 instruction names.
+ (generic_sched): New attr.
+ * config/arm/arm-generic.md: Use generic_sched here.
+ * config/arm/arm1026ejs.md: Do not model fetch/issue/decode
+ stages of pipeline. Adjust latency counts accordingly.
+ * config/arm/arm1136jfs.md: New file.
+
+2003-11-05 Mark Mitchell <mark@codesourcery.com>
+
+ * calls.c (initialize_argument_information): Add CALL_FROM_THUNK_P
+ parameter. Use it instead of current_function_is_thunk.
+ * function.h (struct function): Update documentation for is_thunk.
+ * tree.h (CALL_FROM_THUNK_P): New macro.
+ * config/alpha/alpha.c (alpha_sa_mask): Do not check
+ no_new_pseudos when testing current_function_is_thunk.
+ * config/rs6000/rs6000.c (rs6000_ra_ever_killed): Likeiwse.
+
+2003-10-28 Mark Mitchell <mark@codesourcery.com>
+
+ * config/arm/arm.h (processor_type): New enumeration type.
+ (CPP_ARCH_DEFAULT_SPEC): Set appropriately for ARM 926EJ-S,
+ ARM1026EJ-S, ARM1136J-S, and ARM1136JF-S processor cores.
+ (CPP_CPU_ARCH_SPEC): Likewise.
+ * config/arm/arm.c (arm_tune): New variable.
+ (all_cores): Use cores.def.
+ (all_architectures): Add representative processor.
+ (arm_override_options): Restructure way in which tuning
+ information is deduced.
+ * arm.md: Update "insn" and "type" attributes throughout.
+ (insn): New attribute.
+ (type): Compute "mult" from "insn" attribute. Add load2,
+ load3, load4 alternatives.
+ (arm automaton): Move to arm-generic.md.
+ * config/arm/arm-cores.def: New file.
+ * config/arm/arm-generic.md: Likewise.
+ * config/arm/arm1026ejs.md: Likewise.
+
+2003-12-30 Mark Mitchell <mark@codesourcery.com>
+
+ * stor-layout.c (layout_decl): Turn bitfields into ordinary
+ fields, even if they are the first field in a structure.
+
+2003-12-30 Roger Sayle <roger@eyesopen.com>
+
+ * fold-const.c (fold) <COND_EXPR>: Don't require strict type
+ equality, instead just prevent replacing a COND_EXPR of non-void
+ type by one of its operands of void type.
+
+2003-12-30 Andreas Schwab <schwab@suse.de>
+
+ * doc/c-tree.texi: Fix @item vs. @itemx.
+ * doc/cpp.texi: Likewise.
+ * doc/install.texi: Likewise.
+ * doc/invoke.texi: Likewise.
+
+2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ * builtins.c (expand_builtin_apply_args_1): Fix typo in previous
+ change.
+
+2003-12-30 Jan Hubicka <jh@suse.cz>
+
+ PR ice/11936
+ * i386.h (CLASS_LIKELY_SPILLED_P): Return true for
+ FP_TOP_REG/FP_SECOND_REG.
+
+2003-12-30 Steven Bosscher <steven@gcc.gnu.org>
+
+ Backport from tree-ssa (relevant changes only):
+ 2003-12-18 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * et-forest.h (et_forest_create, et_forest_delete,
+ et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
+ et_forest_remove_edge, et_forest_parent,
+ et_forest_common_ancestor, et_forest_node_value,
+ et_forest_enumerate_sons): Declarations removed.
+ (struct et_node): New.
+ (et_new_tree, et_free_tree, et_set_father, et_split, et_nca,
+ et_below): Declare.
+ * et-forest.c (struct et_forest_occurrence, struct et_forest,
+ struct et_forest_node): Removed.
+ (et_forest_create, et_forest_delete,
+ et_forest_add_node, et_forest_add_edge, et_forest_remove_node,
+ et_forest_remove_edge, et_forest_parent,
+ et_forest_common_ancestor, et_forest_node_value,
+ et_forest_enumerate_sons, splay, remove_all_occurrences,
+ find_leftmost_node, find_rightmost_node, calculate_value): Removed.
+ (struct et_occ): New.
+ (et_nodes, et_occurences): New.
+ (set_depth, set_depth_add, set_prev, set_next, et_recomp_min,
+ et_check_occ_sanity, et_check_sanity, et_check_tree_sanity,
+ record_path_before_1, record_path_before, check_path_after_1,
+ check_path_after, et_splay, et_new_occ, et_new_tree,
+ et_free_tree, et_set_father, et_split, et_nca, et_below): New.
+ * basic-block.h (struct basic_block_def): New field dom.
+ (struct dominance_info): Type removed.
+ (calculate_dominance_info, free_dominance_info,
+ nearest_common_dominator, set_immediate_dominator,
+ get_immediate_dominator, dominated_by_p, get_dominated_by,
+ add_to_dominance_info, delete_from_dominance_info,
+ recount_dominator, redirect_immediate_dominators,
+ iterate_fix_dominators, verify_dominators): Declarations
+ changed.
+ (enum dom_state): New.
+ (dom_computed): New variable.
+ (first_dom_son, next_dom_son): Declare.
+ * dominance.c (struct dominance_info): Removed.
+ (BB_NODE, SET_BB_NODE): Removed.
+ (calculate_dominance_info, free_dominance_info,
+ nearest_common_dominator, set_immediate_dominator,
+ get_immediate_dominator, dominated_by_p, get_dominated_by,
+ add_to_dominance_info, delete_from_dominance_info,
+ recount_dominator, redirect_immediate_dominators,
+ iterate_fix_dominators, verify_dominators,
+ debug_dominance_info): Work over new datastructure. Access
+ dominance datastructures through CFG.
+ (assign_dfs_numbers, compute_dom_fast_query, first_dom_son,
+ next_dom_son): New.
+ * bt-load.c (dom): Variable removed.
+ (augment_live_range, combine_btr_defs, migrate_btr_def,
+ migrate_btr_defs, branch_target_load_optimize): Updated for the
+ new interface for dominance information.
+ * cfg.c {exit_entry_blocks): Update initializer.
+ * cfglayout.c (copy_bbs): Removed loops argument. Updated for
+ the new interface for dominance information.
+ * cfglayout.h (copy_bbs): Declaration changed.
+ * cfgloop.c (flow_loop_pre_header_find, flow_loops_cfg_dump,
+ flow_loop_scan, canonicalize_loop_headers, flow_loops_find): Updated
+ for the new interface for dominance information.
+ (flow_loop_scan): Loops argument removed.
+ (flow_loops_free): Don't release dominators.
+ * cfgloop.h (struct cfg): Dom field removed.
+ (flow_loop_scan, loop_split_edge_with, simple_loop_p,
+ just_once_each_iteration_p, split_loop_bb): Declaration changed.
+ * cfgloopanal.c (simple_loop_exit_p, simple_increment,
+ just_once_each_iteration_p, simple_loop_p): Remove loops argument.
+ Updated for the new interface for dominance information.
+ * cfgloopmanip.c (remove_bbs, find_path, create_preheader,
+ split_loop_bb, loopify, duplicate_loop_to_header_edge,
+ force_single_succ_latches, loop_split_edge_with): Ditto.
+ * gcse.c (dominators): Variable removed.
+ (free_code_hoist_mem, compute_code_hoist_data, hoist_code):
+ Updated for the new interface for dominance information.
+ * ifcvt.c (post_dominators): Variable removed.
+ (mark_loop_exit_edges, merge_if_block, find_if_header,
+ find_cond_trap, find_if_case_1, find_if_case_2, if_convert):
+ Updated for the new interface for dominance information.
+ * loop-init.c (rtl_loop_optimizer_init,
+ rtl_loop_optimizer_finalize): Ditto.
+ * loop-unroll.c (decide_peel_simple, decide_peel_once_rolling,
+ decide_peel_completely, decide_unroll_stupid,
+ decide_unroll_constant_iterations,
+ decide_unroll_runtime_iterations): Loops argument removed.
+ Updated for the new interface for dominance information.
+ (unroll_and_peel_loops, peel_loops_completely,
+ unroll_loop_runtime_iterations): Updated for the new interface for
+ dominance information.
+ * loop-unswitch.c (may_unswitch_on_p, unswitch_loops,
+ unswitch_single_loop, unswitch_loop): Updated for the new
+ interface for dominance information.
+ * predict.c (process_note_predictions, process_note_prediction,
+ estimate_probability, note_prediction_to_br_prob): Ditto.
+ * sched-rgn.c (find_rgns, init_regions): Ditto.
+ * toplev.c (rest_of_handle_branch_prob): Free the dominators.
+
+2003-12-30 Jan Hubicka <jh@suse.cz>
+
+ PR target/13456
+ * i386.md (allocate_stack_worker): Use different pattern for pre and
+ post reload expansion.
+ (allocate_stack_worker_1, allocate_stack_worker_rex64): Use
+ match_scratch.
+ (allocate_stack_worder_1_postreload,
+ allocate_stack_worker_rex64_postreload): New.
+
+2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ * builtins.c (expand_builtin_apply_args_1): Add pretend args size
+ to the virtual incoming args pointer for downward stacks.
+
+2003-12-29 Roger Sayle <roger@eyesopen.com>
+
+ PR fortran/12632
+ * fold-const.c (fold) <COND_EXPR>: Don't fold a constant condition,
+ if the type of the selected branch doesn't match its' parent.
+
+2003-12-29 Jan Hubicka <jh@suse.cz>
+
+ * coverage.c (read_counts_file): Better error messages; cause corrupted
+ profiles to produce hard errors, not just warnings
+ (get_coverage_counts): Similarly.
+
+ * toplev.c (rest_of_handle_loop_optimize): Enable LOOP_AUTO_UNROLL.
+
+2003-12-29 Phil Edwards <phil@codesourcery.com>
+
+ * doc/cppopts.texi: Use of -idirafter, -iprefix, -iwithprefix, and
+ -iwithprefixbefore is not discouraged.
+
+2003-12-28 Mostafa Hagog <mustafa@il.ibm.com>
+
+ * sbitmap.c (sbitmap_union_of_diff_cg, sbitmap_a_and_b_cg,
+ sbitmap_a_xor_b_cg): Accumulate "changed" properly.
+ (sbitmap_not): Zero all bits past n_bit.
+
+2003-12-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR opt/13159
+ * cfgloopanal.c (mark_irreducible_loops): Fix the strongly connected
+ components detection.
+ * loop-unswitch.c (unswitch_loop): Preserve simple preheaders.
+
+2003-12-27 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/uclinux.h (LIB_SPEC): Add elf2flt magic required for
+ correct linking of executables using id-based shared libraries.
+
+2003-12-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/i386/i386-interix.h: Remove uses of "register"
+ specifier in declarations of arguments and local variables.
+ * config/i386/i386.c: Likewise.
+ * config/i386/i386elf.h: Likewise.
+ * config/i386/ptx4-i.h: Likewise.
+ * config/i386/sysv4.h: Likewise.
+
+2003-12-26 Fariborz Jahanian <fjahanian@apple.com>
+ Geoffrey Keating <geoffk@apple.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (legitimate_offset_address_p): Do not
+ restrict DFmode and TFmode to word alignment.
+ * config/rs6000/rs6000.md (movdf_hardfloat64): Use 'o' constraint
+ for ld/std and order before mr.
+
+2003-12-26 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/darwin.h (LINK_COMMAND_SPEC): Arrange
+ -fprofile-generate to imply -lgcov.
+
+2003-12-26 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (ldm_h8300s_2_normal): Use HImode for
+ addresses.
+
+2003-12-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/m32r/m32r.md: Remove a constraint from a splitter.
+
+2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR C++/13429, C/11944
+ * c-common.c (c_build_qualified_type): Return early when type is
+ error_mark_node.
+ (c_apply_type_quals_to_decl): Likewise.
+
+2003-12-25 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/alpha/alpha-modes.def: Fix comment formatting.
+ * config/alpha/alpha.c: Likewise.
+ * config/alpha/alpha.h: Likewise.
+ * config/alpha/elf.h: Likewise.
+ * config/alpha/lib1funcs.asm: Likewise.
+ * config/alpha/openbsd.h: Likewise.
+ * config/alpha/vms-cc.c: Likewise.
+ * config/alpha/vms-crt0-64.c: Likewise.
+ * config/alpha/vms-crt0.c: Likewise.
+ * config/alpha/vms-ld.c: Likewise.
+ * config/alpha/vms-psxcrt0-64.c: Likewise.
+ * config/alpha/vms-psxcrt0.c: Likewise.
+ * config/alpha/vms.h: Likewise.
+ * config/arc/arc.c: Likewise.
+ * config/arm/aof.h: Likewise.
+ * config/arm/arm-modes.def: Likewise.
+ * config/arm/arm.c: Likewise.
+ * config/arm/arm.h: Likewise.
+ * config/arm/arm.md: Likewise.
+ * config/arm/linux-elf.h: Likewise.
+ * config/arm/vxworks.h: Likewise.
+ * config/avr/avr.c: Likewise.
+ * config/avr/avr.h: Likewise.
+
+2003-12-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/xtensa/elf.h: Fix comment formatting.
+ * config/xtensa/xtensa-protos.h: Likewise.
+ * config/xtensa/xtensa.c: Likewise.
+ * config/xtensa/xtensa.h: Likewise.
+
+2003-12-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/avr/avr.c: Fix comment formatting.
+ * config/avr/avr.md: Likewise.
+
+2003-12-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/12721.
+ * config/avr/avr.c: Include ggc.h.
+ (tmp_reg_rtx): Declare with GTY.
+ (zero_reg_rtx): Likewise.
+ (ldi_reg_rtx): Remove.
+ (avr_override_options): Initialize zero_reg_rtx and
+ ldi_reg_rtx.
+ (avr_init): Remove.
+ Include gt-avr.h.
+ * config/avr/avr.h (LDI_REG_REGNO): Remove.
+ Remove externs for tmp_reg_rtx, zero_reg_rtx, and ldi_reg_rtx.
+
+2003-12-24 David Edelsohn <edelsohn@gnu.org>
+
+ * doc/md.texi: Document PowerPC vector register constraint letter.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * calls.c (expand_call): Recognize calls to "sqrt" and create
+ corresponding notes.
+
+2003-12-23 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/mips/mips.c (override_options): Use `inform' instead
+ of `warning' for -g -mabi=32 and native assembler.
+
+ * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS, TARGET_LIBGCC2_CFLAGS):
+ Don't pass -Wno-error.
+
+2003-12-23 David Edelsohn <edelsohn@gnu.org>
+
+ * function.c (assign_parms): Update max_parm_reg and
+ parm_reg_stack_loc when adding new parm reg.
+
+2003-12-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/ns32k/ns32k.c: Convert to ISO-C.
+
+2003-12-23 Zack Weinberg <zack@codesourcery.com>
+
+ * config/ia64/ia64.c (ia64_va_arg): Pass pointer for
+ variable-sized type through convert_memory_address.
+ (ia64_in_small_data_p): Always return false for FUNCTION_DECLs.
+
+2003-12-23 Jan Hubicka <jh@suse.cz>
+
+ * common.opt (fprofile-generate,fprofile-use): Add.
+ * gcc.c (LINK_COMMAND_SPEC): Arrange -fprofile-generate to imply -lgcov
+ * opts.c (profile_arc_flag_set, flag_profile_values_set,
+ flag_unroll_loops_set, flag_tracer_set,
+ flag_value_profile_transformations_set,
+ flag_peel_loops_set): New static variables.
+ (common_handle_option): Deal with -fprofile-generate/-fprofile-use
+ * invoke.texi (-fprofile-generate, -fprofile-use): Describe.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * Makefile.in (OBJS-common): Remove dwarfout.o.
+ (dwarfout.o): Remove.
+ * common.opt: Remove -gdwarf, -gdwarf+.
+ * defaults.h (PREFERRED_DEBUGGING_TYPE): Do not check for
+ DWARF_DEBUGGING_INFO.
+ * dwarf2out.c: Fix typo in comment.
+ * dwarfout.c: Remove.
+ * opts.c (common_handle_option): Remove OPT_gdwarf, OPT_gdwarf_.
+ * toplev.c (process_options): Remove check for
+ DWARF_DEBUGGING_INFO.
+ * config/elfos.h (DWARF_DEBUGGING_INFO): Do not #define it or
+ #undef it.
+ * config/netware.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/ptx4.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/vxworks.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/alpha/unicosmk.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/arc/arc.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/i386/sco5.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/i386/x86-64.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/m32r/m32r.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/mcore/mcore-elf.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/sparc/linux64.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/sparc/liteelf.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/sparc/sol26-sld.h (DWARF_DEBUGGING_INFO): Likewise.
+ * config/sparc/sp86x-elf.h (DWARF_DEBUGGING_INFO): Likewise.
+ * doc/invoke.texi: Do not mention -gdwarf, -gdwarf-1, -gdwarf-1+,
+ or -gdwarf+.
+ * doc/tm.texi: Likewise.
+
+ * c-common.c (flag_abi_version): Default to 2.
+ * c-cppbuiltin.c (c_cpp_builtins): Define __GXX_ABI_VERSION
+ uniformly for versions above 2.
+ * doc/invoke.texi: Update documentation for -fabi-version.
+
+2003-12-22 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.md: Change many instances of '!
+ TARGET_POWERPC64' to 'TARGET_32BIT' when the pattern being guarded
+ was guarded only because it changed CR0 or the carry bit in XER.
+
+2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/13394
+ * toplev.c (rest_of_compilation): Move call to
+ check_function_return_warnings right after the sibcall
+ optimization pass.
+
+2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/13382
+ * c-typeck.c (convert_for_assignment): When converting from
+ integral type to pointer type, always call convert.
+
+2003-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ * doc/invoke.texi: Deprecate -fwritable-strings.
+
+ * c-common.c (flag_external_templates): Remove.
+ (flag_alt_external_templates): Likewise.
+ * c-common.h (flag_external_templates): Remove.
+ (flag_alt_external_templates): Likewise.
+ * c-opts.c (c_common_handle_option): Unsupport
+ -falt-external-templates and -ftemplates.
+ * doc/invoke.texi: Remove mention of -fexternal-templates and
+ -falt-external-templates.
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/13466
+ * config.gcc (powerpc-*-darwin): Remove overridden value of need_64bit_hwint.
+
+ * emit-rtl.c (copy_rtx_if_shared): Add comment about its use of
+ copy_rtx_if_shared_1.
+ (copy_rtx_if_shared_1): Add comment about what the function does.
+
+ * c-decl.c (finish_function): Change order of checks.
+ (c_expand_body): Likewise.
+
+2003-12-22 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (legitimate_offset_address_p): Correct
+ check for the legitimate offset when memory of
+ DImode/DFmode/TFmode/TImode mode is being referenced and target
+ is TARGET_POWERPC64.
+
+2003-12-22 Dale Johannesen <dalej@apple.com>
+
+ * reload1.c: Add reg_reloaded_call_part_clobbered.
+ (reload_as_needed): Use it.
+ (forget_old_reloads_1): Ditto.
+ (emit_reload_insns): Ditto.
+
+2003-12-22 Dale Johannesen <dalej@apple.com>
+
+ PR optimization/12828
+ * loop.c: Add find_regs_nested to look inside CLOBBER(MEM).
+ (scan_loop): Call it.
+ * regclass.c (reg_scan_mark_regs): Look inside CLOBBER(MEM).
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/9163
+ * c-decl.c (poplevel): Only set DECL_INITIAL of a current function
+ if it is non-null.
+ (finish_function): Check for error_mark_node or null on DECL_RESULT and
+ DECL_RESULT of fndecl.
+ (c_expand_body): Only expand when DECL_INITIAL of fndecl is not
+ error_mark_node and not null.
+
+2003-12-21 Dan Nicolaescu <dann@ics.uci.edu>
+
+ * rtl.h (dump_rtx_statistics): Declare it.
+ * rtl.c (rtx_alloc_counts, rtx_alloc_sizes, rtvec_alloc_counts,
+ rtx_alloc_sizes): New static vars.
+ (rtx_alloc, rtvec_alloc): Update them.
+ (dump_rtx_statistics): New function.
+ * toplev.c (finalize): Call it.
+ * ggc-page.c (struct globals): Fix comments. Add new member
+ total_allocated_per_order.
+ (ggc_alloc): Keep track of the total allocated memory.
+ (ggc_print_statistics): Clarify message. Print total allocated
+ memory stats.
+ * configure.in (gather-detailed-mem-stats): New flag.
+ * configure: Regenerate.
+ * config.in: Regenerate.
+ * doc/install.texi (Configuration): Document
+ --enable-gather-detailed-mem-stats.
+
+2003-12-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * system.h (CONVERT_HARD_REGISTER_TO_SSA_P): Poison.
+ * config/i386/i386.h (CONVERT_HARD_REGISTER_TO_SSA_P): Remove.
+
+2003-12-21 Roger Sayle <roger@eyesopen.com>
+
+ * config/ia64/hpux.h (TARGET_OS_CPP_BUILTINS): Define _ILP32
+ when compiling in ILP32 mode.
+
+2003-12-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/rs6000.c (rs6000_tls_referenced_p): Return early if
+ TARGET_HAVE_TLS is false.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/ip2k/ip2k-protos.h: Remove the prototype for
+ asm_output_section_name.
+ * config/ip2k/ip2k.c (asm_output_section_name): Remove.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * alias.c: Fix comment formatting.
+ * alloc-pool.c: Likewise.
+ * bitmap.c: Likewise.
+ * bitmap.h: Likewise.
+ * bt-load.c: Likewise.
+ * c-common.c: Likewise.
+ * c-common.h: Likewise.
+ * c-decl.c: Likewise.
+ * c-opts.c: Likewise.
+ * c-pretty-print.c: Likewise.
+ * caller-save.c: Likewise.
+ * cfghooks.h: Likewise.
+ * cgraph.c: Likewise.
+ * collect2.c: Likewise.
+ * cppfiles.c: Likewise.
+ * cpplib.h: Likewise.
+ * dwarf2out.c: Likewise.
+ * dwarfout.c: Likewise.
+ * emit-rtl.c: Likewise.
+ * final.c: Likewise.
+ * function.c: Likewise.
+ * gcov.c: Likewise.
+ * gcse.c: Likewise.
+ * genemit.c: Likewise.
+ * ggc.h: Likewise.
+ * haifa-sched.c: Likewise.
+ * ifcvt.c: Likewise.
+ * libgcc2.h: Likewise.
+ * loop.c: Likewise.
+ * predict.h: Likewise.
+ * unwind-libunwind.c: Likewise.
+ * varasm.c: Likewise.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/mn10300/mn10300.c (mn10300_encode_section_info): Fix
+ a warning.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/arm/arm.c: Convert to ISO-C.
+ * config/avr/avr.h: Likewise.
+ * config/fr30/fr30.c: Likewise.
+ * config/ip2k/ip2k.c: Likewise.
+ * config/mn10300/mn10300.c: Likewise.
+
+2003-12-20 Andrew Pinski <pinskia@gcc.gnu.org>
+ Matt Thomas <matt@3am-software.com>
+
+ PR target/12749
+ * config/i386/i386.c (print_operand): Print only the first
+ 8 characters of the float in hex.
+
+2003-12-20 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.h (TRAMPOLINE_TEMPLATE): Shorten sequence when generating PA
+ 2.0 code.
+ (TRAMPOLINE_CODE_SIZE, MIN_CACHELINE_SIZE): New defines.
+ (INITIALIZE_TRAMPOLINE): Rework to pass line length, and aligned start
+ and end addresses to I and D cache instruction patterns.
+ * pa.md (anddi3, iordi3): Change predicates of operands 1 and 2 to
+ and_operand and ior_operand, respectively. When generating 64-bit
+ code, only one operand needs to be a register operand.
+ (xordi3): Change predicates of operands 1 and 2 to register_operand.
+ (one_cmpldi2): Change predicate of operand 1 to register_operand.
+ (dcacheflush, icacheflush): Revise to flush an arbitrary number of
+ cache lines.
+
+2003-12-20 Josef Zlomek <zlomekj@suse.cz>
+
+ PR optimization/13430, PR optimization/12322
+ * bb-reorder.c (copy_bb_p): Do not allow block with many successors to
+ be copied.
+ (find_traces_1_round): Surround check for fake edges by
+ #ifdef ENABLE_CHECKING #endif.
+
+2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR other/7956
+ * genmultilib: New variable disable_multilib. Set it to 'yes'
+ if enable_multilib was set to 'no'. Emit DISABLE_MULTILIB
+ if disable_multilib was set to 'yes'.
+ * gcc.c: Include multilib.h before tm.h.
+ * config/sparc/sol2-bi.h (LINK_ARCH_SPEC): Emit an error
+ message for multiarch options if DISABLE_MULTILIB is set.
+ * config/sparc/sol2-gld-bi.h (LINK_ARCH_SPEC): Likewise.
+
+2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR c/12085
+ * c-typeck.c (build_function_call): Issue a warning if a
+ function is called through an incompatible prototype and
+ replace the call by a trap in this case.
+
+2003-12-19 James E Wilson <wilson@specifixinc.com>
+
+ * install.texi (ia64-*-linux): Document minimum libunwind version
+ number.
+
+2003-12-19 Per Bothner <per@bothner.com>
+
+ * langhooks.c (lhd_print_error_function): Fix for PR c/13110.
+ Don't do pp_newline; it causes an extra blank line.
+ * pretty-print.c (pp_base_flush): Clear pp_needs_newline.
+
+2003-12-19 Jason Merrill <jason@redhat.com>
+
+ * tree.c (get_unwidened): Decide whether to narrow a bitfield
+ reference based on TYPE_SIZE, not TYPE_PRECISION.
+
+ * stmt.c (parse_output_constraint): Warn about in-out constraint
+ that doesn't allow a register.
+ (parse_input_constraint): Warn about matching constraint that
+ doesn't allow a register.
+
+2003-12-19 James E Wilson <wilson@specifixinc.com>
+
+ * flow.c (mark_set_regs, case PARALLEL): Scan loop forwards.
+ Add case for ASM_OPERANDS.
+ * global.c (global_alloc): Set regs_ever_live for regs_asm_clobbered
+ registers.
+
+2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * expr.c (check_max_integer_computation_mode): Remove.
+ * dojump.c (do_jump): Don't use MAX_INTEGER_COMPUTATION_MODE.
+ * fold-const.c (fold): Likewise.
+ * system.h (MAX_INTEGER_COMPUTATION_MODE): Poison.
+ * doc/tm.texi (MAX_INTEGER_COMPUTATION_MODE): Remove.
+
+2003-12-19 James E Wilson <wilson@specifixinc.com>
+
+ * configure.in: Delete libunwind_has_eh_support test.
+ * configure: Regenerate.
+ * config.gcc (ia64*-*-linux*): Delete reference to t-libunwind-no-eh
+ and libunwind_has_eh_support check.
+ * config/t-libunwind-no-eh: Delete.
+
+2003-12-19 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-format.c (print_char_table): Allow 'I' flag on floating point
+ decimal formats.
+
+2003-12-19 Stuart Hastings <stuart@apple.com>
+
+ * gcc/config/i386/i386.c (ix86_expand_call, x86_output_mi_thunk):
+ Trivial fixes for i386.c on Darwin/x86.
+
+2003-12-19 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Add code to
+ recognize macho-style lo_sum adrress patterns.
+
+2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * dwarfout.c: Remove uses of "register" specifier in
+ declarations of arguments and local variables.
+ * gensupport.c: Likewise.
+ * local-alloc.c: Likewise.
+ * regclass.c: Likewise.
+
+2003-12-19 Kelley Cook <kelleycook@wideopenwest.com>
+
+ * config.guess: Remove.
+
+2003-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/unwind-ia64.c (ia64_copy_rbs): New function.
+ (unw_access_gr): Only call ia64_rse_rnat_addr if addr is above
+ regstk_top.
+ (uw_frame_state_for): Handle locations inside bundles.
+ (uw_init_context_1): Initialize context->rnat.
+ Set context->regstk_top to lowest rbs address which has nat collection
+ in context->rnat.
+ (uw_install_context): Fix rnat restoring.
+ Restore ar.rsc to previous state.
+ * config/ia64/linux.h (MD_FALLBACK_FRAME_STATE_FOR,
+ MD_HANDLE_UNWABI): Handle unwinding through SA_ONSTACK frames.
+
+2003-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/13239
+ * builtins.c (expand_builtin_expect_jump): Update
+ TREE_VALUE (arglist) if unsave_expr_now langhook
+ created a new tree.
+
+2003-12-19 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (thumb_base_register_rtx_p): Use regno in comparison against
+ FIRST_PSEUDO_REGISTER.
+
+2003-12-18 Hartmut Penner <hpenner@de.ibm.com>
+
+ * gcc/config/rs6000/rs6000.c (USE_ALTIVEC_FOR_ARG_P): Don't check
+ for SVR4 ABI.
+
+2003-12-18 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/aix.h (OS_MISSING_POWERPC64): Define.
+ (OS_MISSING_ALTIVEC): Define.
+ * config/rs6000/darwin.h (ASM_SPEC): Be generous about supplying
+ -force_cpusubtype_ALL.
+ * config/rs6000/rs6000.c (rs6000_override_options): Rearrange
+ CPU information table; now always set all CPU-specific values.
+ Also, use Altivec and powerpc64 when chip and OS supports them.
+
+2003-12-18 Geoffrey Keating <geoffk@apple.com>
+
+ * fixinc/inclhack.def (darwin_macho_dyldh): New.
+ * fixinc/fixincl.x: Regenerate.
+
+2003-12-18 Dara Hazeghi <dhazeghi@yahoo.com>
+
+ * version.c (version_string): Renumber as 3.4.0
+ * doc/include/gcc-common.texi: Likewise
+
+2003-12-18 Richard Henderson <rth@redhat.com>
+
+ * genrecog.c (print_host_wide_int): New.
+ (write_switch, write_cond): Use it.
+
+2003-12-18 Richard Henderson <rth@redhat.com>
+
+ * c-decl.c (check_bitfield_type_and_width): Remove enum special
+ case suppression of pedwarn.
+ * system.h (ENUM_BITFIELD): Use __extension__.
+ (CHAR_BITFIELD): Likewise.
+
+2003-12-18 Ulrich Weigand <uweigand@de.ibm.com>
+ Mark Dettinger <dettinge@de.ibm.com>
+
+ * config/s390/s390.md (UNSPEC_SRST): New constant.
+ ("strlendi", "strlensi"): New expanders.
+ ("*strlendi", "*strlensi"): New insns.
+
+2003-12-18 Mark Mitchell <mark@codesourcery.com>
+
+ * config/sol2.h (LINK_ARCH32_SPEC): Define in terms of ...
+ (LINK_ARCH32_SPEC_BASE): ... this new macro.
+ * config/sparc/sol2-bi.h (LINK_ARCH64_SPEC): Define in terms of
+ ...
+ (LINK_ARCH64_SPEC_BASE): ... this new macro.
+ * config/sparc/sol2-gld-bi.h (LINK_ARCH32_SPEC): New macro.
+ (LINK_ARCH64_SPEC): Likewise.
+
+2003-12-18 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/13234
+ * tree-dump.c (dequeue_and_dump): Handle 'r' and 's' code
+ classes.
+
+2003-12-18 Steven Bosscher <stevenb@suse.de>
+
+ * Makefile.in (tracer.o, bb-reorder.o): Depend on timevar.h
+ * toplev.c (rest_of_handle_reorder_blocks, rest_of_handle_tracer):
+ Don't push and pop TV_REORDER_BLOCKS timevars, do it...
+ * bb-reorder.c (reorder_basic_blocks): ...here, and...
+ * tracer.c (tracer): here.
+
+2003-12-18 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * loop.c (move_movables): Handle combination of m->consec,
+ m->move_insn_first, and m->insert_temp all nonzero correctly.
+
+2003-12-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * calls.c (load_register_parameters): Don't use
+ LOAD_ARGS_REVERSED.
+ * system.h (LOAD_ARGS_REVERSED): Poison.
+ * doc/tm.texi (LOAD_ARGS_REVERSED): Remove.
+
+2003-12-17 Per Bothner <per@bothner.com>
+
+ * emit-rtl.c (set_new_first_and_last_label_num): Remove function.
+ * rtl.h (set_new_first_and_last_label_num): Remove declaration.
+
+2003-12-17 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/frv/frv.c (frv_ifcvt_modify_insn): Don't leave alone
+ scratch insns of the then branch that clobber regs needed by the
+ else branch.
+
+2003-12-17 Kazu Hirata <kazu@cs.umass.edu>
+
+ * calls.c (expand_call): Update comments.
+ * system.h (PRETEND_OUTGOING_VARARGS_NAMED): Poison.
+ * targhooks.c: Do not refer to PRETEND_OUTGOING_VARARGS_NAMED.
+
+2003-12-17 James E Wilson <wilson@specifixinc.com>
+ Roger Sayle <roger@eyesopen.com>
+
+ * Makefile.in (gcse.o): Add $(TREE_H) to dependencies.
+ * gcse.c: Include tree.h.
+ (implicit_set_cond_p): New.
+ (find_implicit_sets): Call it.
+
+2003-12-17 Santiago Vila <sanvila@unex.es>
+
+ * config/kfreebsdgnu.h (TARGET_OS_CPP_BUILTINS): Rename from
+ TARET_OS_CPP_BUILTINS.
+
+2003-12-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * emit-rtl.c: Fix signed/unsigned comparison warnings.
+
+2003-12-17 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * predict.c (struct block_info_def, struct edge_info_def): Change
+ bit-fields of width 1 to unsigned int.
+
+2003-12-16 Geoffrey Keating <geoffk@apple.com>
+
+ PR 12480
+ * c-pch.c (pch_init): Improve error message when precompiled
+ header can't be written.
+
+ PR 12606
+ * c-pch.c (pch_init): Make a PCH file appear invalid while it's
+ being written.
+ (c_common_write_pch): Make it valid once it's done.
+
+2003-12-17 Ulrich Weigand <uweigand@de.ibm.com>
+
+ PR target/11992
+ * config/s390/s390.md ("*cmpmem_long_64"): Use CLCLE instruction
+ instead of CLCL.
+ ("*cmpmem_long_31"): Likewise.
+
+2003-12-17 Vladimir Makarov <vmakarov@redhat.com>
+
+ * config/ia64/ia64.c: Add more comments about insn bundling.
+
+2003-12-17 Richard Earnshaw <rearnsha@arm.com>
+
+ PR optimization/10592
+ * caller-save.c (mark_referenced_regs): Don't short-circuit a reg
+ or subreg in SET_DEST if it isn't a hard register.
+
+2003-12-17 David Edelsohn <edelsohn@gnu.org>
+
+ * collect2.c (main): Add -fno-profile-arcs -fno-test-coverage
+ -fno-branch-probabilities to arguments when compiling ctors and
+ dtors.
+
+2003-12-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sol2.h: Set SUPPORTS_INIT_PRIORITY to 0.
+ * config/sparc/sol2-gld.h: Set SUPPORTS_INIT_PRIORITY to 1.
+
+2003-12-17 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (thumb_base_register_rtx_p): Don't allow virtual registers
+ as base registers for sub-word operations.
+ (thumb_legitimate_address_p): Simplify REG+REG test.
+
+2003-12-17 Segher Boessenkool <boessen@de.ibm.com>
+
+ * opts.c (wrap_help): Fix overflow.
+
+2003-12-17 Fred Fish <fnf@redhat.com>
+
+ * configure.in: Remove code to examine linker scripts and set
+ HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES.
+ * configure, config.in: Regenerate.
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12218
+ * varasm.c (initializer_constant_valid_p): Allow a conversion from
+ an integral constant to an OFFSET_TYPE.
+
+2003-12-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/11012
+ * config/m32r/m32r.c (gen_compare): Call gen_addsi3 instead of
+ gen_cmp_ne_small_const_insn.
+ * config/m32r/m32r.md (cmp_ne_small_const_insn): Remove.
+
+2003-12-17 Neil Booth <neil@daikokuya.co.uk>
+ Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/3347
+ * c-decl.c (enum_decl_context): Remove BITFIELD.
+ (grokdeclarator): Take bit-field width as an input.
+ Perform bit-field width validation with
+ check_bitfield_type_and_width rather than waiting for
+ finish_struct.
+ (groktypename, groktypename_in_parm_context, start_decl,
+ push_parm_decl, grokfield, start_function): Update calls to
+ grokdeclarator.
+ (check_bitfield_type_and_width): New function.
+ (finish_struct): Move bit-field validation to grokdeclarator
+ and check_bitfield_type_and_width.
+
+2003-12-16 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR bootstrap/13386
+ * configure.in (gcc_cv_ld_hidden): Set to yes on hppa64*-*-hpux* when
+ using HP native linker.
+ * configure: Rebuilt.
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13275
+ * c-common.h (enum rid): Add RID_OFFSETOF.
+ * c-parser.in (rid_to_yy): Ignore RID_OFFSETOF.
+ * ginclude/stddef.h (offsetof): Reimplement for C++, using
+ __offsetof__.
+ * doc/extend.texi: Document __offsetof__.
+
+2003-12-16 Stan Cox <scox@redhat.com>
+
+ * config/iq2000/iq2000.h: Formatting.
+ (MAX_INT_TYPE_SIZE, MAX_INT_TYPE_SIZE, CONST_COSTS, RTX_COSTS)
+ (ADDRESS_COST, ASM_OUTPUT_INTERNAL_LABEL, ASM_OUTPUT_INTERNAL_LABEL)
+ (IMPLICIT_FIX_EXPR, EASY_DIV_EXPR, SLOW_ZERO_EXTEND): Remove
+ * config/iq2000/iq2000.c: Formatting.
+ (iq2000_rtx_costs): New.
+
+2003-12-16 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (addsi3_carryin_shift): Add missing register constraints.
+
+2003-12-16 Loren James Rittle <ljrittle@acm.org>
+
+ * testsuite/g++.old-deja/g++.eh/badalloc1.C: Tweak to
+ pass with -pthread on FreeBSD systems.
+
+2003-12-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_file_end): Only write symbols that have
+ been referenced at some point.
+
+2003-12-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c: Include langhooks.h
+ (mips_build_builtin_va_list): Use lang_hooks.types.make_type.
+
+2003-12-16 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/13313
+ * combine.c (make_extraction) [REG]: Do not use
+ gen_lowpart_for_combine when POS is non-zero.
+
+2003-12-16 Hartmut Penner <hpenner@de.ibm.com>
+
+ * altivec.h (vec_cmple, vec_all_numeric): Fix typo.
+ * testsuite/gcc.dg/altivec-10.c: Test for above.
+
+2003-12-15 David O'Brien <obrien@FreeBSD.org>
+
+ * Makefile.in (CPPFLAGS): Initialize from configure.
+
+2003-12-15 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/13400
+ * ifcvt.c (noce_process_if_block): Disable unconditional write
+ optimizations if we could introduce a store to trapping memory
+ that wasn't present previously.
+
+2003-12-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * system.h (DEFAULT_CALLER_SAVES): Poison.
+ * toplev.c (flag_caller_saves): Always initialize with 0.
+ * doc/tm.texi (DEFAULT_CALLER_SAVES): Remove.
+
+2003-12-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * flow.c (EXIT_IGNORE_STACK): Move to ...
+ * defaults.h (EXIT_IGNORE_STACK): ... here.
+ * dojump.c (clear_pending_stack_adjust): Don't use #ifdef
+ EXIT_IGNORE_STACK.
+ * function.c (expand_function_end): Likewise.
+ * global.c (global_alloc): Likewise.
+ * ra.c (init_ra): Likewise.
+ * reload1.c (init_elim_table): Likewise.
+ * reorg.c (fill_simple_delay_slots): Likewise.
+ * resource.c (init_resource_info): Likewise.
+ * doc/tm.texi (EXIT_IGNORE_STACK): Document that the default
+ is 0.
+
+2003-12-15 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * reload.c (reg_overlap_mentioned_for_reload_p):
+ When looking at a PLUS in X, avoid spuriously returning nonzero
+ when IN is a REG or another simple PLUS, or a MEM containing one.
+
+ * loop.c (loop_invariant_p): Amend comment about where new registers
+ might come from.
+
+2003-12-15 Andreas Jaeger <aj@suse.de>
+
+ * config/rs6000/rs6000.c (rs6000_output_function_epilogue): Remove
+ handling of obsolete language CHILL.
+
+2003-12-15 Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ * tree.c (initializer_zerop): Add test for empty set.
+ * integrate.c (function_cannot_inline_p): Forbid inlining
+ functions calling `longjmp'.
+
+2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/11773
+ * doc/gcov.texi (Gcov and Optimization): Document inline function
+ behaviour. Fix some file suffixes.
+
+2003-12-14 David O'Brien <obrien@FreeBSD.org>
+
+ * config/i386/i386.h (__amd64, __amd64__): Remove duplicates.
+
+2003-12-14 Mark Mitchell <mark@codesourcery.com>
+
+ * c-common.h (c_parse_error): Declare it.
+ * c-common.c (c_parse_error): New function.
+ * c-parse.y (yyerror): Use it.
+
+2003-12-14 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR target/13054
+ * pa-protos.h (indexed_memory_operand, borx_reg_operand,
+ move_dest_operand, move_src_operand): New protypes.
+ (basereg_operand, move_operand, reg_or_nonsymb_mem_operand): Deleted.
+ * pa.c (copy_reg_pointer, indexed_memory_operand, move_dest_operand,
+ move_src_operand): New functions.
+ (basereg_operand, reg_or_nonsymb_mem_operand, move_operand): Delete.
+ (reg_or_0_or_nonsymb_mem_operand): Return false for unscaled indexed
+ address until cse is not expected on targets with non-equivalent
+ space registers.
+ (hppa_legitimize_address): Canonicalize unscaled indexed addresses
+ on targets non-equivalent space registers.
+ (emit_move_sequence): Break out indexed addresses from destination
+ operand. Similarly, break out unscaled indexed addresses from
+ source operand on targets with non-equivalent space registers. Fix
+ REG_POINTER flag when possible. Mark register pointer when creating
+ new pointers.
+ (print_operand): Handle unscaled index addresses.
+ * pa.h (IS_INDEX_ADDR_P, IS_LO_SUM_DLT_ADDR_P): New macro subroutines
+ for EXTRA_CONSTRAINT.
+ (EXTRA_CONSTRAINT): Rework to make more readable.
+ (MODE_OK_FOR_SCALED_INDEXING_P, MODE_OK_FOR_UNSCALED_INDEXING_P): New
+ subroutines for GO_IF_LEGITIMATE_ADDRESS.
+ (GO_IF_LEGITIMATE_ADDRESS): Rework using new subroutines. Allow scaled
+ and unscaled addresses. Canonicalize unscaled indexed addresses on
+ targets with non-equivalent space registers. Document issues in
+ handling indexed address modes on PA-RISC.
+ (PREDICATE_CODES): Update for new and deleted predicates.
+ * pa.md (move_dest_operand, move_src_operand, indexed_memory_operand):
+ Use new predicates in move patterns.
+ Add peephole2 patterns to optimize floating point stores. Fix
+ constrain preferencing in move patterns. Delete patterns for handling
+ unscaled indexed memory loads. Add missing load and store with
+ base-register modification patterns. Correct SFmode floating point
+ store pattern. Add missing zero extension loads.
+
+2003-12-13 Steven Bosscher <stevenb@suse.de>
+
+ * ggc-zone.c (struct alloc_zone): Don't pre-declare, it already
+ comes in with ggc.h. Add a new bool field `dead'.
+ (destroy_ggc_zone): Don't destroy a zone at once. Instead, only
+ set the `dead' flag for the dead zone. Wrap a sanity check in
+ ENABLE_CHECKING.
+ (ggc_collect_1): Always mark and sweep if a zone has the `dead'
+ flag set.
+ (ggc_collect): Free dead zones after collecting.
+
+2003-12-13 Jan Hubicka <jh@suse.cz>
+
+ * coverage.c (get_coverage_counts): Use inform instead of warning
+ about missing profile.
+
+2003-12-12 Steven Bosscher <stevenb@suse.de>
+
+ * Makefile.in (opts.o, explow.o): Depend on langhooks.h
+
+2003-12-12 Geoffrey Keating <geoffk@apple.com>
+
+ * config.gcc <i[34567]86-*-darwin*>: Don't use fixproto.
+ <powerpc-*-darwin*>: Likewise.
+
+2003-12-12 Jakub Jelinek <jakub@redhat.com>
+
+ * config/ia64/linux.h (IA64_GATE_AREA_END): Increase by 64K.
+ (MD_FALLBACK_FRAME_STATE_FOR): Set fpsr_loc, br_loc[6] and
+ br_loc[7]. Update comment.
+ (MD_HANDLE_UNWABI): Define.
+ * config/ia64/unwind-ia64.c (struct unw_state_record): Add
+ unwabi field.
+ (struct _Unwind_Context): Increase br_loc array size to 8 entries.
+ (desc_abi): Set unwabi.
+ (uw_update_reg_address): Allow br up to 7.
+ (uw_update_context): Invoke MD_HANDLE_UNWABI if defined.
+ (uw_install_context): Load b1..b5 from correct locations.
+ Fix insn loading ar.fpsr.
+ * doc/tm.texi: Document MD_HANDLE_UNWABI.
+
+2003-12-12 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/13037
+ * loop.c (update_giv_derive): Ignore redundant sets of a biv when
+ calculating how to derive a giv from a biv.
+
+2003-12-12 Neil Booth <neil@daikokuya.co.uk>
+
+ PR preprocessor/12935 preprocessor/12952 preprocessor/13046
+ * cpplib.c (prepare_directive_trad): Clear skipping only in
+ #if and #elif directives.
+ (do_undef): Call the handler even if the identifier is not a macro.
+ * cpptrad.c (scan_parameters): Emit an error message.
+ (_cpp_create_trad_definition): Remember the params list even on
+ failure.
+
+2003-12-11 Zack Weinberg <zack@codesourcery.com>
+
+ * arm.c (ARM_ADDRESS_COST, THUMB_ADDRESS_COST): Convert macros
+ to inline functions: arm_arm_address_cost, arm_thumb_address_cost
+ respectively.
+ (arm_address_cost): Use 'em.
+
+2003-12-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/osf.h (TARGET_OS_CPP_BUILTINS): Define
+ __STDC_VERSION__ to ISO C94 for C++.
+
+ * fixinc/inclhack.def (alpha_wchar): New fix.
+ * fixinc/fixincl.x: Regenerate.
+ * fixinc/tests/base/wchar.h: New file.
+
+2003-12-11 David Mosberger <davidm@hpl.hp.com>
+
+ * unwind-libunwind.c (_Unwind_SetGR): Clear the NaT bit as
+ required by C++ ABI for Itanium.
+ * config/t-libunwind (LIB2ADDEH): Remove unwind-libunwind.c.
+ * config/t-libunwind-no-eh: New file.
+ * configure.in: Check libunwind for _Unwind_Resume() and if it's
+ present, set libunwind_has_eh_support to "yes".
+ * configure: Regenerate.
+ * config.gcc (ia64*-*-linux*): If $libunwind_has_eh_support is
+ set to yes, use t-libunwind, otherwise, use t-libunwind-no-eh.
+
+2003-12-11 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_global_pointer): Force functions with
+ a nonlocal goto to set up $gp.
+
+2003-12-11 James E Wilson <wilson@specifixinc.com>
+
+ PR target/13132
+ * function.c (gen_mem_addressof): When no decl, explicitly clear flag
+ bits.
+
+2003-12-12 Nick Clifton <nickc@redhat.com>
+
+ * config/m32r/m32r.c: Convert to ISO-C
+
+2003-12-12 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * doc/invoke.texi: Replace Mitsubishi with Renesas.
+ * config/m32r/m32r.h: Ditto.
+ * config/m32r/m32r.c: Ditto.
+ * config/m32r/m32r.md: Ditto.
+
+2003-12-11 Steven Bosscher <steven@gcc.gnu.org>
+
+ * basic-block.h (BLOCK_HEAD, BLOCK_END): Remove.
+ (BLOCK_HEAD_TREE, BLOCK_END_TREE): Remove.
+ (basic_block_def): Rename `head' to `head_' and `end' to `end_'.
+ (BB_HEAD, BB_END): New accessor macros for the `head_' and `end_'
+ fields of a basic block.
+ * bb-reorder.c, bt-load.c, caller-save.c, cfg.c, cfganal.c,
+ cfgbuild.c, cfgcleanup.c, cfglayout.c, cfgloop.c, cfgloopanal.c,
+ cfgloopmanip.c, cfgrtl.c, combine.c, conflict.c, df.c, emit-rtl.c,
+ final.c, flow.c, function.c, gcse.c, global.c, graph.c,
+ haifa-sched.c, ifcvt.c, lcm.c, local-alloc.c, loop-unswitch.c,
+ loop.c, postreload.c, predict.c, profile.c, ra-build.c, ra-debug.c,
+ ra-rewrite.c, ra.c, recog.c, reg-stack.c, regclass.c, regmove.c,
+ regrename.c, reload1.c, resource.c, sched-ebb.c, sched-rgn.c,
+ sibcall.c, tracer.c, config/frv/frv.c, config/i386/i386.c,
+ config/ia64/ia64.c: Use the BB_HEAD and BB_END macros instead of
+ accessing the `head' and `end' fields of a basic block directly.
+
+ * gengtype.c: Teach about "void**" pointers and "void *" function
+ types. Fixes earlier commit.
+
+2003-12-10 Geoffrey Keating <geoffk@apple.com>
+
+ * doc/extend.texi (Vector Extensions): Document that bitwise
+ operations also work on vectors.
+
+2003-12-10 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md: New split patterns for optimizing bitfield accesses.
+
+2003-12-10 Steven Bosscher <stevenb@suse.de>
+
+ * README.Portability: Remove K+R section.
+
+ * gengtype-lex.l: Teach about "void**" pointers and
+ "void*" function types.
+
+2003-12-10 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/13354
+ * config/sparc/sparc.c (sparc_output_mi_thunk): Load DELTA
+ manually if one can do that with only one instruction.
+
+2003-12-10 Nick Clifton <nickc@redhat.com>
+
+ * config.gcc (arm-linux): Include linux.h in tm_file so that
+ LINUX_TARGET_OS_CPP_BUILTINS is defined.
+ * config/arm/linux-elf.h (LIB_SPEC): Protect the definition.
+
+2003-12-09 James E Wilson <wilson@specifixinc.com>
+
+ * rtl.def (CODE_LABEL, NOTE): Correct operand numbers in comments.
+
+2003-12-09 Matt Austern <austern@apple.com>
+
+ PR c/13134
+ * c-decl.c (duplicate_decls): Copy visibility flag when appropriate.
+
+2003-12-09 Kazuhiro Inaoka <inaoka.kazuhiro@renesas.com>
+
+ * config/m32r/m32r.h: Add support for m32r2 processor. Including
+ a new command line option -m32r2 to select it.
+ * config/m32r/m32r.c: Add support for the new processor variant.
+ * config/m32r/m32r.md: Likewise.
+ * config/m32r/t-m32r: Add m32r2 multilibs.
+ * doc/invoke.texi: Document the new command line switch.
+
+2003-12-08 Kazu Hirata <kazu@cs.umass.edu>
+
+ * defaults.h (LOCAL_REGNO): Give the default definition.
+ * flow.c (LOCAL_REGNO): Remove.
+ * reload1.c (LOCAL_REGNO): Likewise.
+
+2003-12-08 Geoffrey Keating <geoffk@apple.com>
+
+ PR target/11848
+ * rs6000.h (CANNOT_CHANGE_MODE_CLASS): Allow change of mode
+ in floating-point registers between TFmode and DImode.
+ * rs6000.c (rs6000_emit_move): Split moves early.
+ (secondary_reload_class): Random Whitespace Change.
+ (rs6000_split_multireg_move): Support moves involving FP registers.
+ Emit instructions directly.
+ * rs6000-protos.h (rs6000_split_multireg_move): Update prototype.
+ * altivec.md: Update for changes to rs6000_split_multireg_move.
+ * rs6000.md: Update for changes to rs6000_split_multireg_move.
+ (movtf_internal): Support moves to/from GPRs.
+
+2003-12-08 Stuart Hastings <stuart@apple.com>
+
+ * config/i386/i386.md: Typo in split of fp-valued if_then_else.
+
+2003-12-08 James E Wilson <wilson@specifixinc.com>
+
+ PR target/13132
+ * expmed.c (extract_bit_field): Only call mode_for_size for scalar
+ integer modes.
+
+2003-12-08 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * doc/install.texi: Revert change of Dec 7; gcc is still a 2.13
+ directory.
+
+2003-12-08 Alexandre Oliva <aoliva@redhat.com>
+
+ * config/frv/frv.md (subdi2): Merge with _internal insn_and_split,
+ by using match_scratch.
+ (negdi2): New.
+
+2003-12-08 Jason Merrill <jason@redhat.com>
+ Daniel Berlin <dberlin@dberlin.org>
+
+ PR debug/11114
+ Support namespaces in DWARF 2 output.
+ * dwarf2out.c (gen_namespace_die): New function.
+ (force_namespace_die, setup_namespace_context): New fns.
+ (declare_in_namespace): New fn.
+ (gen_decl_die): Call declare_in_namespace. Handle namespaces.
+ (dwarf2out_decl): Handle namespaces.
+ (scope_die_for): Pass through a namespace scope.
+ (class_scope_p): Rename to class_or_namespace_scope_p.
+ (gen_subprogram_die, gen_variable_die): Adjust.
+ (gen_struct_or_union_die): Always emit a declaration
+ if context_die is a namespace.
+
+2003-12-08 Jan Hubicka <jh@suse.cz>
+
+ * unwind-pe.h (read_uleb128): Fix handling of large values
+ (read_sleb128): Fix handling of large values
+
+2003-12-08 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR middle-end/10060
+ * emit-rtl.c (copy_rtx_if_shared): Split out into ...
+ (copy_rtx_if_shared_1): here and optimize the last one
+ in the sequence into tail-recursion.
+ (reset_used_flags): Optimize the last one
+ in the sequence into tail-recursion.
+
+2003-12-08 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md: New split to transform ((X << y) - 1) into ~(~(X-1) << y)
+ for constant X.
+
+2003-12-08 Richard Sandiford <rsandifo@redhat.com>
+
+ * calls.c (expand_call): Don't try using tail or recursive calls
+ after the function body has been expanded.
+
+2003-12-08 Jan Hubicka <jh@suse.cz>
+
+ * i386.md (cmpstr expander): Obey TARGET_INLINE_ALL_STRINGOPS
+
+2003-12-08 Arnaud Charlet <charlet@act-europe.fr>
+
+ PR ada/13324, PR ada/12614
+ * doc/install.texi: Update requirements for building Ada.
+
+2003-12-07 David Edelsohn <edelsohn@gnu.org>
+ Graham Reed <greed@pobox.com>
+
+ * collect2.c (GCC_OK_SYMBOL): Add support for AIX C_WEAKEXT.
+ (GCC_UNDEF_SYMBOL): Same.
+
+2003-12-07 Kazu Hirata <kazu@cs.umass.edu>
+
+ * final.c (final_scan_insn): Don't use FINAL_PRESCAN_LABEL.
+ * system.h (FINAL_PRESCAN_LABEL): Poison.
+ * doc/tm.texi (FINAL_PRESCAN_LABEL): Remove.
+
+2003-12-07 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (compare): Combine toplevel and $(SUBDIRS) cases.
+
+2003-12-07 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in, aclocal.m4: Revert to pre-2.5x conversion status.
+ * configure: Regenerate with autoconf 2.13.
+
+ * configure.in: Replace AC_INIT, AC_OUTPUT, AC_CANONICAL_SYSTEM
+ with modern equivalents.
+ * configure: Regenerate.
+
+ * configure.in: Replace gcc_AC_CHECK_TYPE with AC_CHECK_TYPE.
+ * aclocal.m4 (gcc_AC_CHECK_TYPE): Remove.
+ * configure: Regenerate.
+
+ * configure: Regenerate with (preferred) autoconf 2.57.
+ * doc/install.texi: Note that 'gcc' is now a 2.57 directory.
+
+2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/12965
+ * caller-save.c (save_call_clobbered_regs): Do not save/restore
+ registers around no-return calls.
+
+2003-12-07 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Make minimum necessary changes for autoconf 2.5x.
+ * aclocal.m4: Make minimum necessary changes for autoconf 2.5x.
+ * configure: Regenerate with autoconf 2.58.
+
+2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/13318
+ * loop.c (express_from): Protect integer division from overflow.
+
+2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/13060
+ * function.c (fixup_var_refs_1) [SUBREG]: Recognize even if a
+ replacement already exists. Fix again the whole insn if that fails.
+
+2003-12-06 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/rs6000/rs6000.c (macho_branch_islands): Use
+ HOST_WIDE_INT_PRINT_UNSIGNED.
+
+2003-12-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * varasm.c (incorporeal_function_p): New.
+ (assemble_external): Use it as a filter.
+ * config/mips/mips.c (mips_output_external): Don't check for builtin
+ functions here.
+
+2003-12-06 Richard Earnshaw <reanrsha@arm.com>
+
+ * arm.md (IOR (COMPARISON) (AND)): New define_splits.
+
+2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (program_transform_cross_name): Delete.
+ (GCC_CROSS_NAME, CPP_CROSS_NAME): Delete.
+ (PROTOIZE_CROSS_NAME, UNPROTOIZE_CROSS_NAME): Delete.
+ (AR_FOR_TARGET, RANLIB_FOR_TARGET, NM_FOR_TARGET): Adjust for above.
+ (install_cpp, install_driver, install-man, uninstall): Likewise.
+
+2003-12-06 Alan Modra <amodra@bigpond.net.au>
+
+ PR 13169
+ * basic-block.h (PROP_ASM_SCAN): Define.
+ * final.c (regs_asm_clobbered): New array.
+ * regs.h (regs_asm_clobbered): Declare.
+ * flow.c (life_analysis): Init it.
+ (mark_set_regs): Set PROP_ASM_SCAN for asms.
+ (mark_set_1): Set regs_asm_clobbered.
+ * global.c (global_alloc): Don't set eliminable_regset when
+ regs_asm_clobbered.
+
+2003-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ * config/ia64/ia64.h (MUST_PASS_IN_STACK): Define.
+
+ PR c++/13314
+ * emit-rtl.c (set_mem_attributes_minus_bitpos): Robustify.
+
+2003-12-05 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR driver/13211
+ * gcc.c (execute) Increment execution_count when returning
+ early because verbose_only_flag is true.
+
+2003-12-05 Per Bothner <pbothner@apple.com>
+
+ * cppfiles.c (file_hash_hash): New static function.
+ (hash_string_eq): Renamed static function to file_hash_eq.
+ (_cpp_init_files): Create file_hash table with above callbacks.
+ (cpp_included): Must use htab_find_with_hash insead of htab_find.
+ (_cpp_find_find, make_cpp_dir): Must use htab_find_slot_with_hash.
+
+2003-12-05 Per Bothner <pbothner@apple.com>
+
+ * line-map.h (source_location): New typedef.
+ (fileline): Redefined as source_location.
+ (struct line_map, linemap_add, linemap_lookup): Replace filefile
+ by source_location.
+ * line-map.c (linemap_add, linemap_lookup): Use source_location.
+
+2003-12-05 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.c (alpha_build_builtin_va_list): Add dummy
+ field to suppress -Wpadded warnings.
+
+2003-12-05 Stuart Hastings <stuart@apple.com>
+
+ * config/rs6000/rs6000.md: Correct macro test of TARGET_MACHO.
+
+2003-12-05 Stuart Menefy <stuart.menefy@st.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
+
+ PR target/13302
+ * sh.c (sh_build_builtin_va_list): Use (*lang_hooks.types.make_type).
+
+2003-12-05 Roger Sayle <roger@eyesopen.com>
+
+ * dojump.c (do_jump): If the expression being compared against
+ zero, is the subreg of a promoted variable, perform the comparison
+ in the promoted mode.
+ * simplify-rtx.c (simplify_unary_operation): Optimize sign and
+ zero-extensions of subregs of promoted variables where the
+ extension is identical to that used to promote the variable.
+
+2003-12-05 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/13256
+ * resource.h (enum mark_resource_type): Remove member MARK_DEST.
+ The only user changed as follows:
+ * resource.c (mark_set_resources) <case SET>: Always recurse for
+ SET_SRC (x).
+ <case SIGN_EXTRACT, case ZERO_EXTRACT>: Always recurse on
+ operands.
+ <case STRICT_LOW_PART>: Delete, deferring to default code.
+
+2003-12-05 Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ * stmt.c (expand_nl_goto_receiver): Copy hard register clobbers
+ and ASM_INPUT barrier from expand_builtin_setjmp_receiver.
+
+2003-12-05 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_expand_call): Don't allow laziy binding
+ for n32 & n64 abicalls.
+
+2003-12-05 Richard Sandiford <rsandifo@redhat.com>
+
+ PR bootstrap/13145
+ * config/mips/mips.h (FIRST_PSEUDO_REGISTER): Adjust comment.
+ * config/mips/mips.c (mips_reg_names, mips_sw_reg_names): Add $fcall.
+ (mips_load_got): Always create a constant MEM.
+ (mips_expand_call): Use load_callsi and load_calldi.
+ * config/mips/mips.md (UNSPEC_LOAD_CALL, FAKE_CALL_REGNO): New consts.
+ (load_callsi, load_calldi): New patterns.
+
+2003-12-05 Peter Gerwinski <peter@gerwinski.de>
+
+ * tree.def (PLACEHOLDER_EXPR): Clarify commentary.
+
+2003-12-05 Steven Bosscher <stevenb@suse.de>
+
+ * config/d30v/d30v-protos.h , config/d30v/d30v.c,
+ config/dsp16xx/dsp16xx-protos.h, config/dsp16xx/dsp16xx.c,
+ config/fr30/fr30-protos.h, config/fr30/fr30.c,
+ config/i370/i370-protos.h, config/i370/i370.c,
+ config/i960/i960-protos.h, config/i960/i960.c,
+ config/ip2k/ip2k-protos.h, config/ip2k/ip2k.c,
+ config/m32r/m32r-protos.h, config/m32r/m32r.c,
+ config/mn10300/mn10300-protos.h, config/mn10300/mn10300.c,
+ config/ns32k/ns32k-protos.h, config/ns32k/ns32k.c:
+ Convert to ISO C90 function declarations and definitions.
+
+2003-12-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * doc/extend.texi (Constructing Calls): Add warning about
+ the limitations of the functions.
+
+2003-12-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/11151
+ * function.h (struct function): New field 'x_naked_return_label'.
+ * function.c (free_after_compilation): Set it to NULL.
+ (expand_function_end): Emit 'naked_return_label' if it exists.
+ * rtl.h (expand_naked_return): Declare.
+ * stmt.c (expand_naked_return): New function to generate a
+ jump to 'naked_return_label'.
+ * builtins.c (expand_builtin_return): Call expand_naked_return
+ instead of expand_null_return.
+ * config/sparc/sparc.md (untyped_return): Likewise.
+
+2003-12-04 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR target/11322
+ * config/sh/netbsd-elf.h (NO_PROFILE_COUNTERS): Define.
+
+ PR target/12467
+ * config/rs6000/altivec.md (altivec_vmsummbm): Fix typo.
+
+2003-12-04 Stuart Hastings <stuart@apple.com>
+
+ * rs6000.c (output_call, macho_branch_islands,
+ add_compiler_branch_island, no_previous_def, get_previous_label)
+ Revisions of xx_stub functions for branch islands,
+ add -fPIC support for Darwin.
+ * rs6000-protos.h (output_call) Prototype.
+ * rs6000.md Use output_call.
+ * invoke.texi Explain Darwin semantics of -longcall.
+ * testsuite/gcc.dg/darwin-abi-1.c Revise testcase for -longcall/jbsr.
+
+2003-12-04 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.md (addqi3_carry): Use q not r constraints.
+ (subqi3_carry): Likewise.
+
+2003-12-04 J"orn Rennecke <joern.rennecke@superh.com>
+
+ PR optimization/13260
+ * sh-protos.h (sh_expand_t_scc): Declare.
+ * sh.h (PREDICATE_CODES): Add cmpsi_operand.
+ * sh.c (cmpsi_operand, sh_expand_t_scc): New functions.
+ * sh.md (cmpsi): Use cmpsi_operand. If T_REG is compared to
+ something that is not a CONST_INT, copy it into a pseudo register.
+ (subc): Fix description of new T value.
+ (slt, sgt, sge, sgtu): Don't clobber T after rtl generation is over.
+ (sltu, sleu, sgeu): Likewise.
+ (seq, sne): Likewise. Use sh_expand_t_scc.
+
+2003-12-04 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * configure.in: Generalize the CONFIG_HEADERS pattern under which
+ we stamp cstamp-h.
+ * configure: Regenerate.
+
+ * configure.in: Pull AC_CHECK_HEADER call out of shell if statement
+ to avoid trouble when updating to autoconf 2.5x.
+ * configure: Regenerate (with autoconf 2.13 still).
+
+2003-12-04 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh.md (truncdiqi2): Use andi opcode for immediate.
+ (reload_outdf+1,reload_outdf+2): Remove constraints.
+ (movv16sf_i): Fxi multiplier for SUBREG_BYTE.
+ (movv8qi_i+2): Zero-extend low byte before adding it to high byte.
+ (fipr, ftrv): Add .s suffix to opcode.
+
+2003-12-04 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/13186
+
+ Revert all of the following patch, except the addition of
+ hook_bool_machine_mode_true:
+
+ 2003-11-02 Richard Sandiford <rsandifo@redhat.com>
+
+ * Makefile.in (targhooks.o, reload.o): Update dependencies.
+ (GTFILES): Add targhooks.c.
+ (gt-targhooks.h): New rule; depend on s-gtype.
+ * target.h (direct_pool_load_p): New hook.
+ * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro.
+ (TARGET_INITIALIZER): Include it.
+ * targhooks.h (default_direct_pool_load_p): Declare.
+ (hook_bool_machine_mode_true): Declare.
+ * targhooks.c: Include insn-config.h, recog.h, ggc.h and
+ gt-targhooks.h.
+ (pool_symbol): New variable.
+ (default_direct_pool_load_p): New function.
+ (hook_bool_machine_mode_true): New function.
+ * reload.c: Include target.h.
+ (find_reloads): If an alternative will force a constant into memory,
+ count an extra reload if constant pool symbols are not valid
+ addresses. If an alternative uses memory to move values between
+ registers, count the move as two reloads rather than one.
+ * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define.
+ * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document.
+
+2003-12-03 Mark Mitchell <mark@codesourcery.com>
+
+ * config/ia64/hpux.h (TARGET_HAVE_TLS): Define it to false.
+ * config/ia64/ia64.h (TARGET_HAVE_TLS): Define it to true if
+ HAVE_AS_TLS is true.
+ * config/ia64/ia64.c (TARGET_HAVE_TLS): Do not define it.
+
+2003-12-03 James E Wilson <wilson@specifixinc.com>
+
+ * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name.
+
+ * gcc-page.c (extra_order_size_tab): Correct comment.
+
+2003-12-03 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (push): Call gen_push_h8300hs_advanced
+ instead of gen_push_h8300hs.
+ (pop): Call gen_pop_h8300hs_advanced instead of
+ gen_pop_h8300hs.
+ * config/h8300/h8300.h (TRAMPOLINE_SIZE): Use Pmode.
+ * config/h8300/h8300.md (*tablejump_h8300hs_advanced):
+ Tighten the predicate.
+ (*tablejump_h8300hs_normal): Tighten the predicate.
+ (push_h8300hs): Change to
+ push_h8300hs_advanced.
+ (pop_h8300hs): Change to pop_h8300hs_advanced.
+
+2003-12-03 Eric Christopher <echristo@redhat.com>
+
+ * rtl.c: Fix typo.
+ * config/mips/mips.h: Ditto. Fix formatting.
+
+2003-12-04 Ben Elliston <bje@wasabisystems.com>
+
+ * future.options: Remove. Move to gnu.org web pages.
+
+2003-12-03 Eric Christopher <echristo@redhat.com>
+
+ * c-parse.in (c_in_iteration_stmt, c_in_case_stmt): Move
+ from here...
+ * c-tree.h: to here.
+
+2003-12-03 Jan Hubicka <jh@suse.cz>
+
+ PR optimization/12324
+ * toplev.c (rest_of_decl_compilation): Do not deffer when compiling
+ in unit-at-a-time mode.
+
+2003-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ * expr.c (store_constructor): Only set RTX_UNCHANGING_P for
+ read-only field if cleared is 0.
+
+2003-12-03 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config.gcc: Mark obsolete targets for GCC 3.4.
+
+2003-12-03 Zack Weinberg <zack@codesourcery.com>
+
+ * aclocal.m4 (AM_ICONV): Add explicit check for iconv.h.
+ * config.in, configure.in: Regenerate.
+ * cpphash.h: Check both HAVE_ICONV and HAVE_ICONV_H before
+ including iconv.h.
+
+2003-12-03 Alan Modra <amodra@bigpond.net.au>
+
+ PR target/11229
+ * cse.c (cse_insn): Set classp using src_const_elt if
+ src_eqv_elt is NULL.
+
+2003-12-03 Richard Earnshaw <rearnsha@arm.com>
+
+ * gcse.c (reg_clear_last_set): New function.
+ (reg_set_info): If data is non-null, treat it as an sbitmap of
+ registers, set the bit for the register being set.
+ (compute_store_table): Allocate last_set_in with xcalloc. Do not
+ memset this array on each iteration. Pass reg_set_in_block[bb->index]
+ to note_stores while computing last_set_in instead of scanning
+ last_set_in after the first pass through the insns.
+ Clear last_set_in using reg_clear_last_set instead of explicitly
+ rescanning after each insn. If checking is enabled, assert that
+ last_set_in is completely zeroed after each bb has been processed.
+
+2003-12-02 Geoffrey Keating <geoffk@geoffk.org>
+
+ * df.c (df_uses_record) <MEM>: The argument of a MEM is read-only,
+ never read-write.
+ <REG>: Delete incorrect comment.
+ <SET>: Remove 'use_flags' variable.
+
+2003-12-03 David Edelsohn <edelsohn@gnu.org>
+
+ * function.c (assign_parms): Make sure parm PARALLEL combined
+ in reg is composed of more than one object and the mode really
+ produces a reg.
+
+2003-12-03 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (classify_argument): Make it 64bit clean.
+
+2003-12-02 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_output_external): Replace checks for
+ specific builtin-in functions with a check for DECL_BUILTIN_IN.
+
+2003-12-02 Richard Henderson <rth@redhat.com>
+
+ * rtl.h (PUT_CODE, PUT_MODE): Remove ENUM_BITFIELD cast.
+ * tree.h (TREE_SET_CODE): Likewise.
+ * recog.h (struct insn_operand_data): Move const after ENUM_BITFIELD.
+
+2003-12-02 Ben Elliston <bje@wasabisystems.com>
+
+ * dbxstclass.h: Rename from this ..
+ * xcoff.h: .. to this.
+ * xcoffout.c: Include xcoff.h.
+
+2003-12-01 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * Makefile.in (GCC_CFLAGS): Add -Wold-style-definition.
+
+2003-12-01 James Lemke <jim@wasabisystems.com>
+
+ * config/arm/arm.c (arm_rtx_costs): Improve for xscale multiply.
+
+2003-12-01 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11634
+ * recog.c (split_insn): Factor test of INSN_P and handling of
+ set_noop_p out of here into the two callers.
+ (split_all_insns): Add INSN_P test and set_noop_p handling here.
+ If deleting a no-op set after reload that has a REG_UNUSED note,
+ mark the basic block as changed and recalculate life information.
+ (split_all_insns_noflow): Add INSN_P test and set_noop_p handling
+ here.
+
+2003-12-01 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/12322
+ * gcse.c (struct ls_expr): Change type of hash_index from int to
+ unsigned int.
+ (hash_expr): Document hash_table_size parameter and wrap long line.
+ (ldst_entry): Calculate expression's hash_index and record in ptr.
+ (trim_ld_motion_mems): Use hash_index to search a single bucket
+ instead of scanning the entire hash_table. Remove the "del" local
+ variable and use the equivalent "expr == 0" instead. Change last
+ to be a pointer to the pointer to the current element, to simplify
+ and speed-up deleting from a linked list.
+
+2003-12-01 James E Wilson <wilson@specifixinc.com>
+
+ * doc/contrib.texi: Update David Mosberger.
+
+ * doc/c-tree.texi (CONSTRUCTOR): Clarify element order and handling
+ of missing fields.
+
+ PR target/8407
+ * config/ia64/ia64.c (ia64_function_arg): For single-reg HFA, call
+ gen_rtx_REG to create new reg with argument mode.
+
+2003-12-01 Steven Bosscher <stevenb@suse.de>
+
+ * ggc.h (struct alloc_zone): Move forward declaration up.
+ (new_ggc_zone): New function prototype.
+ (destroy_ggc_zone): Ditto.
+ * ggc-simple.c (new_ggc_zone): New function, does nothing.
+ (destroy_ggc_zone): Ditto.
+ * ggc-page.c (new_ggc_zone): New function, does nothing.
+ (destroy_ggc_zone): Ditto.
+ * ggc-zone.c (struct page_entry): Fix comment.
+ (ggc_alloc_typed): Use a switch statement instead of ifs.
+ (new_ggc_zone): New function to set up a new GC zone.
+ (destroy_ggc_zone): New function to remove a GC zone.
+ init_ggc): Use new_ggc_zone to set up the default zones.
+ (ggc_collect): Walk a list of zones, instead of just the
+ default zones. Report statistics using the zone name.
+
+2003-12-01 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * unroll.c (find_splittable_givs): Add missing extend_value_for_giv.
+
+2003-12-01 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/12628
+ * toplev.c (rest_of_handle_jump_bypass): Call reg_scan.
+ * regclass.c (reg_scan): Include allocate_reg_info time in
+ TV_REG_SCAN. Minor clean-ups.
+ (reg_scan_update): Minor clean-ups.
+
+2003-12-01 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config.gcc (s390x-ibm-tpf*): Add extra_parts.
+
+2003-12-01 James E Wilson <wilson@specifixinc.com>
+
+ * config/ia64/ia64.h (FUNCTION_ARG_REGNO_P): Use AR_REG_FIRST not
+ GR_ARG_FIRST.
+
+2003-12-01 Zack Weinberg <zack@codesourcery.com>
+
+ * common.opt: Remove -fgnu-linker.
+ * flags.h: Remove flag_gnu_linker.
+ * opts.c: Don't handle OPT_fgnu_linker.
+ * toplev.c: Don't initialize flag_gnu_linker.
+ Remove gnu-linker entry from f_options.
+ * config/dsp16xx/dsp16xx.h (OPTIMIZATION_OPTIONS):
+ Don't reset flag_gnu_linker.
+ * config/mips/mips.c (override_options): Likewise.
+ * doc/invoke.texi: Remove all mention of -fgnu-linker.
+
+2003-12-01 Daniel Berlin <dberlin@dberlin.org>
+
+ * ggc-zone.c (ggc_pch_write_object): Calculate object size using
+ ggc_get_size (which accounts for large objects properly).
+
+2003-12-01 Jeff Sturm <jsturm@one-point.com>
+
+ PR optimization/13024
+ * toplev.c (rest_of_handle_new_regalloc): Remove rebuild_notes
+ parameter.
+ (rest_of_handle_old_regalloc): Likewise. Add rebuild_notes
+ declaration. Rebuild jump labels following local_alloc if necessary.
+ (rest_of_compilation): Remove rebuild_label_notes_after_reload
+ declaration. Don't pass rebuild_notes parameter to
+ rest_of_handle_new_regalloc and rest_of_handle_old_regalloc.
+ Don't rebuild jump labels.
+
+2003-12-01 Jeff Law <law@redhat.com>
+
+ * flow.c (count_or_remove_death_notes_bb): New. Extracted from
+ count_or_remove_death_notes.
+ (count_or_remove_death_notes): Use EXECUTE_IF_SET_IN_SBITMAP.
+
+2003-12-01 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * builtins.c (expand_builtin_longjmp): Added two memory clobbers.
+
+2003-12-01 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * reload.c (find_reloads_address): Split addresses of type
+ (plus (plus (reg) (reg)) (const_int)) only if one register
+ is either a valid base register or else one of the stack
+ frame related registers (sp/fp/ap).
+
+2003-12-01 Steven Bosscher <stevenb@suse.de>
+
+ * function.c (update_epilogue_consts): Don't use PARAMS.
+ * rtl.h (web_main): Ditto.
+ * target.h (is_costly_dependence): Ditto
+
+2003-12-01 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/7847
+ * expr.c (expand_expr) [normal_inner_ref]: When 'offset' is non-zero,
+ do not recheck that 'op0' is a MEM. Move comment. When testing for
+ unaligned objects, take also into account the alignment of 'op0' and
+ 'mode1' if 'op0' is a MEM.
+
+2003-12-01 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ * doc/c-tree.texi (Function Bodies): Update HANDLER documentation.
+
+2003-12-01 Kelley Cook <kcook@gcc.gnu.org>
+
+ * doc/install.texi: Note that fastjar is built with automake 1.7.x
+ and autoconf 2.57.
+
+2003-12-01 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/linux64.h (SUBSUBTARGET_OVERRIDE_OPTIONS): Test
+ target_flags directly rather than using TARGET_* defines.
+
+2003-11-30 Ben Elliston <bje@wasabisystems.com>
+
+ * doschk.c: Remove.
+
+2003-11-30 Richard Sandiford <rsandifo@redhat.com>
+
+ PR target/12727
+ * config/mips/mips.c (mips_save_reg): Fix frame information for sdc1
+ on 32-bit big-endian targets.
+
+2003-11-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * genemit.c (register_constraints): Remove.
+
+2003-11-30 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * config/s390/s390.md ("tmdi_reg", "tmsi_reg", "*movdi_64", "*movdi_31",
+ "iordi3"): Insns now use multiple letter constraints.
+ ("*movdi_lhi", "*movdi_lli", "*movdi_lay"): Insns deleted. They are now
+ covered by "*movdi_64".
+ ("*movsi_lhi", "*movsi_lli", "*movsi_lay"): Insns deleted. They are now
+ covered by "*movsi_zarch" and "*movsi_esa".
+ ("*movsi_zarch", "*movsi_!zarch"): New insns.
+ ("*llgt_sisi_split", "*llgt_didi_split"): Insns deleted. Now covered
+ by "*andsi3_zarch" and "anddi3".
+ ("*anddi3_ni"): Insn merged with "anddi3".
+ ("*andsi3_ni"): Insn merged with "*andsi3_zarch".
+ ("*andsi3_zarch", "*andsi3_esa"): New insns.
+ ("*iordi3_oi"): Insn merged with "iordi3".
+ ("*iorsi3_oi"): Insn merged with "*iorsi3_zarch".
+ ("*iorsi3_zarch", "*iorsi3_esa"): New insns.
+
+ * config/s390/s390.c (s390_single_qi, s390_single_hi): Functions
+ merged to s390_single_part.
+ (s390_single_part): New function.
+ NOTE: Semantics have changed a bit. Now the value of the part must
+ be different from the others to get a non-negative return value.
+ (s390_extract_qi, s390_extract_hi): Functions merged to
+ s390_extract_part.
+ (s390_extract_part, s390_extra_constraint_str,
+ s390_const_ok_for_constraint_p): New functions. The L constraint got a
+ new meaning and the N constraint was added as a multiple letter
+ constraint.
+ (s390_extra_constraint): Function deleted.
+ (print_operand): New output modifier 'i' and 'j' added.
+ All uses of CONST_OK_FOR_LETTER_P were replaced by
+ CONST_OK_FOR_CONSTRAINT_P.
+
+ * config/s390/s390-protos.h: Function prototypes adapted.
+ * doc/md.texi: Documentation for new constraint letters added.
+
+2003-11-30 Andreas Schwab <schwab@suse.de>
+
+ * Makefile.in ($(DESTDIR)$(infodir)/%.info): Fix missing semicolon.
+
+2003-11-29 James E Wilson <wilson@specifixinc.com>
+
+ * gcc.c (init_spec): Pass -lunwind to init_gcc_specs in eh_name
+ instead of in shared_name.
+
+ * final.c (final_start_function): Delete code for NON_SAVING_SETJMP.
+ * reload1.c (reload): Re-add it here.
+
+2003-11-30 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.c (rs6000_elf_section_type_flags): Don't
+ set SECTION_WRITE on TARGET_RELOCATABLE.
+
+2003-11-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (LIBCALL_VALUE): Use R0_REG.
+
+2003-11-28 Gunther Nikl <gni@gecko.de>
+
+ * config/m68k/m68k.c (MOTOROLA): Move from here...
+ * config/m68k/m68k.h (MOTOROLA): ... to here.
+ (OUTPUT_JUMP): Use do {...} while (0).
+ * config/m68k/m68k.md: Replace #ifdef MOTOROLA with C statements.
+
+2003-11-28 Gunther Nikl <gni@gecko.de>
+
+ * config.gcc (m68020-*-elf*, m68k-*-elf*, m68010-*-netbsdelf*,
+ m68k*-*-netbsdelf*, m68k-*-rtems*): Add tm_defines containing
+ MOTOROLA and USE_GAS.
+ * config/m68k/rtemself.h (MOTOROLA): Delete.
+ * config/m68k/netbsd-elf.h (MOTOROLA, USE_GAS): Delete.
+ * config/m68k/m68kelf.h (MOTOROLA, USE_GAS, SGS_CMP_ORDER): Delete.
+
+2003-11-29 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (WORDS_BIG_ENDIAN): Update the comment.
+
+2003-11-29 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (install-info): Install gccinstall.info too.
+
+2003-11-29 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("cmpint_di"): Fix incorrect instruction lengths.
+
+2003-11-29 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.md ("movhi"): Do not emit extender pattern
+ when loading from a (MEM (ADDRESSOF ...)).
+ ("movqi"): Likewise.
+
+2003-11-29 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/10333
+ * c-parse.in (typespec_reserved_nonattr): Reject typeof on
+ bit-fields.
+
+2003-11-29 Richard Sandiford <rsandifo@redhat.com>
+
+ * stmt.c (expand_asm_operands): Check whether force_const_mem
+ succeeded.
+
+2003-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/gnu.h (HURD_TARGET_OS_CPP_BUILTINS): New.
+ * config/linux.h (LINUX_TARGET_OS_CPP_BUILTINS): New.
+
+ * config/alpha/gnu.h, config/alpha/linux.h,
+ config/arm/linux-elf.h, config/cris/cris.h, config/cris/linux.h,
+ config/i370/linux.h, config/i386/gnu.h, config/i386/i386.h,
+ config/i386/linux-aout.h, config/i386/linux.h,
+ config/i386/linux64.h, config/ia64/linux.h, config/m68k/linux.h,
+ config/m68k/uclinux.h, config/mips/linux.h,
+ config/mn10300/linux.h, config/pa/pa-linux.h,
+ config/rs6000/sysv4.h, config/s390/linux.h, config/sh/linux.h,
+ config/sparc/linux.h, config/sparc/linux64.h,
+ config/xtensa/linux.h (TARGET_OS_CPP_BUILTINS): Use
+ HURD_TARGET_OS_CPP_BUILTINS/LINUX_TARGET_OS_CPP_BUILTINS or ensure
+ all necessary assertions are included.
+
+2003-11-28 Jan Hubicka <jh@suse.cz>
+
+ * emit-rtl.c (set_used_flags): New.
+ (verify_rtx_sharing, verify_rtl_sharing): New.
+ (unshare_all_rtl_1): Rename to....
+ (unshare_all_rtl_in_chain): ... this one; make static.
+ (copy_rtx_if_shared): LABEL_REF chan be shared.
+ * ifcvt.c (unshare_ifcvt_sequence): New.
+ (noce_try_move, noce_try_store_flag, noce_try_store_flag_constants,
+ noce_try_addcc, noce_try_addcc, noce_try_store_flag_mask,
+ noce_try_cmove, noce_try_store_flag_mask, noce_try_minmax,
+ noce_try_abs, noce_process_if_block, find_cond_trap
+ * rtl.h (verify_rtl_sharing, set_used_flags, unshare_all_rtl_in_chain):
+ Declare.
+
+2003-11-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Fix a comment typo.
+
+2003-11-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*movsf_h8300h): Change to
+ *movsf_h8300hs.
+ (addsi_h8300): Change to *addsi_h8300.
+ (addsi_h8300h): Change to *addsi_h8300hs.
+ (subsi3_h8300): Change to *subsi3_h8300.
+ (subsi3_h8300h): Change to *subsi3_h8300hs.
+ (neghi2_h8300h): Change to *neghi2_h8300hs.
+ (negsi2_h8300h): Change to *negsi2_h8300hs.
+
+2003-11-28 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (*subhi3_h8300): Remove '&' from the
+ constraint.
+ (*subhi3_h8300hs): Likewise.
+
+2003-11-28 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (MASK_MFCRF): New.
+ (TARGET_MFCRF): Test target_flags, not processor type.
+ (TARGET_SWITCHES): Add mfcrf and no-mfcrf.
+ Change Don't to Do not.
+ * config/rs6000/rs6000.c (processors_target_table): Add MASK_MFCRF
+ to power4, 970, G5.
+
+2003-11-27 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * cse.c (cse_set_around_loop): When changing a constant load
+ to a register -register copy, add a REG_EQUAL note.
+
+2003-11-27 Randolph Chung <tausq@debian.org>
+ John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (hppa_profile_hook): Split gen_call_profiler into separate
+ insns. Use the regular call expander for the call to the profiler.
+ * pa.md (call_profiler): Delete.
+ (load_offset_label_address): New insn to load the address of the
+ current function for the profiler.
+ (lcla1, lcla2): New insns to output a code label and load its address.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * final.c (final_scan_insn): Remove commented-out code.
+
+2003-11-27 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * doc/install.texi: Remove ADAC reference and make accurate.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (FUNCTION_VALUE): Use R0_REG.
+ (FUNCTION_VALUE_REGNO_P): Likewise.
+ * config/h8300/h8300.md: Define R0_REG.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c: Fix formatting.
+ * config/h8300/h8300.md: Likewise.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (ELIMINABLE_REGS): Update a comment.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Give names to anonymous insns.
+
+2003-11-27 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (extendqisi2): Remove constraints.
+
+2003-11-27 Gunther Nikl <gni@gecko.de>
+
+ * doc/tm.texi (SYSROOT_HEADERS_SUFFIX_SPEC): Fix typo.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/13041
+ * final.c (frame_pointer_needed): Fix comment.
+ * reload1.c (reload): Decrease alignment of the frame
+ pointer if it was used for register allocation.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR target/12900
+ * reg-stack (move_for_stack_reg): New prototype. Return
+ whether a control flow insn was deleted.
+ (subst_stack_regs_pat): Likewise, using the information provided
+ by move_for_stack_reg.
+ (subst_stack_regs): Likewise, using the information provided
+ by subst_stack_regs_pat.
+ (convert_regs_1): Record whether a control flow insn was deleted,
+ using the information provided by subst_stack_regs. Purge dead
+ edges only if a control flow insn was deleted.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR middle-end/8028
+ PR middle-end/9890
+ PR middle-end/11151
+ PR middle-end/12210
+ PR middle-end/12503
+ PR middle-end/12692
+ * builtins.c (expand_builtin_apply): Use virtual_outgoing_args_rtx
+ as the base address to copy the memory arguments to.
+
+2003-11-26 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * config/i386/cygming.h (ASM_OUTPUT_DEF_FROM_DECLS): Declare
+ function aliases as functions.
+
+2003-11-26 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * aclocal.m4 (gcc_AC_PROG_GNAT): Rewrite to account for removal
+ of ADAC.
+ * configure: Regenerate.
+
+ * Makefile.in: Remove references to ADAC.
+
+ * configure.in: Remove check for whether ${ADAC} accepts -Wno-long-long.
+ * configure: Regenerate.
+
+2003-11-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+ Olivier Hainque <hainque@act-europe.fr>
+
+ PR target/6466
+ * config/sparc/sparc-protos.h (compute_frame_size): New prototype.
+ (sparc_flat_compute_frame_size): Likewise.
+ (sparc_flat_save_restore): Move prototype...
+ * config/sparc/sparc.c (sparc_flat_save_restore): ...here.
+ (save_regs): New prototype.
+ (build_big_number): Likewise.
+ (apparent_fsize): Change type to HOST_WIDE_INT.
+ (actual_fsize): Likewise.
+ (frame_base_offset): Likewise.
+ (build_big_number): Add support for HOST_BITS_PER_WIDE_INT == 64.
+ Change string descriptor to HOST_WIDE_INT_PRINT_DEC.
+ [TARGET_ARCH64]: Use the sequence of sparc_emit_set_const64_longway
+ to load a 64-bit constant.
+ (sparc_nonflat_function_prologue): Change string descriptor to
+ HOST_WIDE_INT_PRINT_DEC. Change offset type to HOST_WIDE_INT.
+ (output_restore_regs): Change offset type to HOST_WIDE_INT.
+ (sparc_nonflat_function_epilogue): Change string descriptor to
+ HOST_WIDE_INT_PRINT_DEC. Use build_big_number.
+ (output_sibcall): Change size type to HOST_WIDE_INT. Use
+ build_big_number. Change string descriptor to HOST_WIDE_INT_PRINT_DEC.
+ (sparc_frame_info): Change types for several components.
+ (sparc_flat_compute_frame_size): Update types according to previous
+ change.
+ (sparc_flat_function_prologue): Change string descriptor to
+ HOST_WIDE_INT_PRINT_DEC. Change offset type to int. Use
+ build_big_number.
+ (sparc_flat_function_epilogue): Change offset type to int.
+ Rename 'size1' into 'reg_offset1'. Change string descriptor to
+ HOST_WIDE_INT_PRINT_DEC. Use build_big_number. Change big number
+ limit to 4096 instead of 4095.
+
+ * config/sparc/sparc.c (mems_ok_for_ldd_peep): Change offset type to
+ HOST_WIDE_INT.
+
+2003-11-24 Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ * function.c: Make outer_function-chain external.
+ * function.h: Likewise.
+
+2003-11-24 Richard Sandiford <rsandifo@redhat.com>
+
+ * config.gcc (mips-sgi-irix6*): Add t-iris6gld to tmake_file when
+ using GNU ld.
+ * config/mips/iris6.h (IRIX6_STARTFILE_SPEC): New, taking the
+ whole of the previous STARTFILE_SPEC except crtbegin.o%s.
+ (IRIX6_ENDFILE_SPEC): Likewise ENDFILE_SPEC and crtend.o%s.
+ (STARTFILE_SPEC, ENDFILE_SPEC): Define in terms of the above.
+ (SUBTARGET_EXTRA_SPECS): Define.
+ * config/mips/iris6gld.h (LINK_SPEC): Change -init function
+ to __gcc_init and -fini function to __gcc_fini.
+ (STARTFILE_SPEC): Redefine, including irix6-crti.o before crtbegin.o.
+ (ENDFILE_SPEC): Likewise, including irix6-crtn.o after crtend.o.
+ (INIT_SECTION_ASM_OP, FINI_SECTION_ASM_OP): Define.
+ * config/mips/t-iris6gld,
+ * config/mips/irix6-crti.asm,
+ * config/mips/irix6-crtn.asm: New files.
+
+2003-11-24 Eric Christopher <echristo@redhat.com>
+
+ PR C/13014
+ * c-decl.c (c_in_iteration_stmt, c_in_case_stmt): New.
+ (start_function): Use.
+ (c_push_function_context): Ditto.
+ (c-pop_function_context): Ditto.
+ (language_function): Move...
+ * c-tree.h: ... here. Add x_in_iteration_stmt, and
+ x_in_case_stmt.
+ * c-parse.in (do_stmt_start, select_or_iter_stmt, stmt): Use
+ c_in_iteration_stmt, c_in_case_stmt for parser state. Move
+ check for valid break or continue statment here...
+ * c-semantics.c (genrtl_break_stmt, genrtl_continue_stmt): From
+ here. Change original errors to abort.
+
+2003-11-24 Jan Hubicka <jh@suse.cz>
+
+ * fold-const.c (fold): Do not return early when optimizing
+ COMPONENT_REF and constant.
+
+2003-11-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md (tablejump_h8300): Change to
+ *tablejump_h8300.
+ (tablejump_h8300h): Change to *tablejump_h8300hs_advanced.
+ (tablejump_normal_mode): Change to *tablejump_h8300hs_normal.
+ (indirect_jump_h8300): Change to *indirect_jump_h8300.
+ (indirect_jump_h8300h): Change to
+ *indirect_jump_h8300hs_advanced.
+ (indirect_jump_normal_mode): Change to
+ *indirect_jump_h8300hs_normal.
+
+2003-11-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Remove constraints from expanders.
+
+2003-11-24 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: (stm_h8300s_2): Change the name to
+ stm_h8300s_2_advanced.
+ (stm_h8300s_2_normal): New.
+ (stm_h8300s_2): Likewise.
+ (stm_h8300s_3): Change the name to stm_h8300s_3_advanced.
+ (stm_h8300s_3_normal): New.
+ (stm_h8300s_3): Likewise.
+ (stm_h8300s_4): Change the name to stm_h8300s_4_advanced.
+ (stm_h8300s_4_normal): New.
+ (stm_h8300s_4): Likewise.
+ (ldm_h8300s_2): Change the name to ldm_h8300s_2_advanced.
+ (ldm_h8300s_2_normal): New.
+ (ldm_h8300s_2): Likewise.
+ (ldm_h8300s_3): Change the name to ldm_h8300s_3_advanced.
+ (ldm_h8300s_3_normal): New.
+ (ldm_h8300s_3): Likewise.
+ (ldm_h8300s_4): Change the name to ldm_h8300s_4_advanced.
+ (ldm_h8300s_4_normal): New.
+ (ldm_h8300s_4): Likewise.
+ (two peephole2's): Enable only with !TARGET_NORMAL_MODE.
+ (two peephole2's): New.
+
+2003-11-24 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * genattrtab.c (simplify_cond): Update indices correctly.
+ (attr_alt_subset_p, attr_alt_subset_of_compl_p, attr_alt_intersection,
+ attr_alt_union, attr_alt_complement, attr_alt_bit_p, mk_attr_alt): New.
+ (check_attr_test, encode_units_mask, compute_alternative_mask,
+ make_alternative_compare, simplify_and_tree,
+ attr_rtx_cost, simplify_test_exp, gen_attr,
+ write_test_expr, walk_attr_value): Handle EQ_ATTR_ALT.
+ * rtl.def (EQ_ATTR_ALT): New.
+
+2003-11-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * genattrtab.c (strcmp_check, DEF_ATTR_STRING): New macros.
+ (length_str, delay_type_str, delay_1_0_str, num_delay_slots_str):
+ New variables.
+ (main): Initialize them.
+ (find_attr): Canonicalize the attribute name string.
+ (attr_rtx_1, copy_boolean, expand_delays, gen_unit): Always canonicalize
+ string arguments.
+ (attr_printf, attr_eq): Use DEF_ATTR_STRING.
+ (check_attr_test, check_attr_value, make_length_attrs,
+ write_length_unit_log, simplify_by_exploding, gen_attr,
+ write_test_expr, write_attr_value, write_eligible_delay,
+ write_complex_function, make_internal_attr,
+ write_const_num_delay_slots): Changed due to change of type of
+ find_attr.
+ (fill_attr, evaluate_eq_attr, simplify_and_tree,
+ attr_rtx_cost, simplify_by_exploding, walk_attr_value): Use
+ strcmp_check.
+
+2003-11-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ PR target/13122
+ * config/h8300/h8300.c (push): Call push_h8300hs_normal in
+ normal mode.
+ (pop): Call pop_h8300hs_normal in normal mode.
+ * config/h8300/h8300.md: Likewise.
+ (pushqi1_h8300hs_normal): New.
+ (pushqi1): Call pushqi1_h8300hs_normal in normal mode.
+ (pushhi1_h8300hs_normal): New.
+ (pushhi1): Call pushhi1_h8300hs_normal in normal mode.
+ (push_h8300hs_normal): New.
+ (pop_h8300hs_normal): Likewise.
+
+2003-11-23 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * genattrtab.c (count_sub_rtxs): Removed.
+
+2003-11-23 Richard Earnshaw <rearnsha@arm.com>
+
+ * recog.c (preprocess_constraints): Only zero those elements of
+ recog_op_alt that are needed for this insn.
+ * arm.c (note_invalid_constants): A function can't contain invalid
+ constants if it has no constraints.
+
+2003-11-22 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (classify_argument): Pass __float128 in memory.
+ (ix86_return_in_memory): Likewise.
+ (ix86_libcall_value): Likewsie.
+
+2003-11-22 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.c (dosize): Convert to ISO-C.
+
+2003-11-22 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * flow.c (update_life_info): Amend comment about when a register
+ can become dead.
+
+2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
+
+ * doc/.cvsignore: Delete.
+
+2003-11-21 Daniel Berlin <dberlin@dberlin.org>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * dwarf2out.c (add_location_or_const_value_attribute): Add support
+ for PARALLEL.
+
+2003-11-21 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/t-iris6 (CRTSTUFF_T_CFLAGS): Add -Wno-error.
+ (TARGET_LIBGCC2_CFLAGS): Define.
+
+ * crtstuff.c [HAS_INIT_SECTION] (__do_global_dtors): Declare.
+ (__do_global_ctors): Likewise.
+
+2003-11-21 Mark Wielaard <mark@klomp.org>
+
+ * doc/invoke.texi (-O2): Doesn't enable -fweb.
+
+2003-11-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Mention dV and dZ.
+
+2003-11-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/invoke.texi: Update dump file names.
+ Remove de, dW, and dX.
+
+2003-11-20 James E Wilson <wilson@specifixinc.com>
+
+ PR c/13133
+ * reload1.c (reload): Delete special handling for setjmp.
+
+2003-11-21 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * mklibgcc.in: Evaluate shlib_slibdir_qual during link
+ step too.
+ * config/t-slibgcc-darwin: Adjust install path.
+ * config/rs6000/t-darwin: Revert multilib matches since
+ it is not used on darwin.
+
+2003-11-20 Richard Henderson <rth@redhat.com>
+
+ * ssa.c, ssa-dce.c, ssa-ccp.c: Remove files.
+ * Makefile.in (OBJS-common, GTFILES): Don't reference them.
+ (gtype-desc.o, toplev.o, flow.o): Remove ssa.h.
+ (ssa.o, ssa-dce.o, ssa-ccp.o): Remove.
+ * flow.c: Don't include ssa.h.
+ (set_phi_alternative_reg): Remove.
+ (calculate_global_regs_live): Don't call it.
+ (mark_used_regs): Don't handle PHI.
+ * gengtype.c (open_base_files): Don't reference ssa.h.
+ * rtl.def (PHI): Remove.
+ * timevar.def (TV_TO_SSA, TV_SSA_CCP, TV_SSA_DCE, TV_FROM_SSA): Kill.
+ * common.opt: Remove -fssa, -fssa-ccp, -fssa-dce.
+ * opts.c (common_handle_option): Likewise.
+ * toplev.c (f_options): Likewise.
+ (DFI_ssa, DFI_ssa_ccp, DFI_ssa_dce, DFI_ussa): Remove.
+ (dump_file): Update to match.
+ (flag_ssa, flag_ssa_ccp, flag_ssa_dce): Remove.
+ (rest_of_handle_ssa): Remove.
+ (rest_of_compilation): Don't call it.
+ * toplev.h (flag_ssa, flag_ssa_dce, flag_ssa_ccp): Remove.
+ * doc/invoke.texi: Remove -fssa, -fssa-ccp, -fssa-dce.
+ * doc/passes.texi (SSA optimizations): Remove.
+
+2003-11-20 Bob Wilson <bob.wilson@acm.org>
+
+ * configure.in: Add xtensa-*-* targets to test for dwarf2 debug_line.
+ * configure: Regenerate.
+
+2003-11-20 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (Makefile): Pass along CONFIG_SHELL.
+
+2003-11-20 David Mosberger <davidm@hpl.hp.com>
+
+ * config/t-libunwind (LIB2ADDEH): Add unwind-c.c.
+ (SHLIB_LC): Define.
+ * unwind-libunwind.c (_Unwind_GetCFA): Implement.
+ (_Unwind_GetBSP) [UNW_TARGET_IA64]: New function.
+
+2003-11-20 Fariborz Jahanian <fjahanian@apple.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * calls.c (expand_call): Allocate new temp in pass1.
+ (store_one_arg): If PARALLEL, calculate excess using mode size of
+ rtvec elt.
+ * expr.c (emit_push_insn): If PARALLEL, calculate offset using
+ mode size of rtvec elt.
+ * function.c (assign_parms): Use parm in register, if available.
+
+2003-11-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (MOVP): Remove.
+ (ADDP): Likewise.
+ (CMPP): Likewise.
+
+2003-11-20 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (use_return_insn): New argument, SIBLING. Support returning
+ with a single instruction if the stack has been decremented by 4
+ and we have a frame pointer. Update all callers.
+ (output_return_instruction): Likewise.
+ (arm_output_epilogue): Change argument to SIBLING. Calculate
+ really_return from the new argument. Update all callers.
+ * arm.h (USE_RETURN_INSN): Pass NULL for the sibling.
+ * arm.md (sibcall_epilogue): Call use_return_insn directly, and
+ pass the sibling call.
+ * arm-protos.h (use_return_insn, arm_output_epilogue): Update
+ prototypes.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Makefile.in (extraclean): Delete.
+ * configure.in (target_list): Remove extraclean.
+ * configure: Regenerate.
+ * doc/makefile.texi, doc/sourcebuild.texi: Update.
+ * objc/Make-lang.in (objc.extraclean): Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Makefile.in (lang_checks): Add.
+ (check-c++, check-f77, check-java, check-g++, check-g77,
+ check-objc): Remove hardcoded targets.
+ * doc/sourcebuild.texi: Document testsuite hooks.
+ * objc/Make-lang.in (check-objc, lang_checks): Add.
+
+2003-11-19 Scott Snyder <snyder@fnal.gov>
+
+ PR target/13131
+ * dwarf2out.c (gen_array_type_die): DW_AT_declaration should be a
+ flag, not a constant.
+
+2003-11-19 Kelley Cook <kcook@gcc.gnu.org>
+
+ * config/arc/arc-protos.h: Update to C90 prototypes.
+ * config/arc/arc.c: Likewise.
+ * config/arc/initfini.c: Likewise.
+
+2003-11-19 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * stmt.c (expand_goto): Memory clobbers added.
+
+2003-11-19 Andreas Krebbel <krebbel1@de.ibm.com>
+
+ * reload.c (find_reloads): Added missing type casts.
+
+2003-11-19 James E Wilson <wilson@specifixinc.com>
+
+ * combine.c (sets_function_arg_p): Delete unused function.
+
+2003-11-19 Eric Christopher <echristo@redhat.com>
+
+ * reload1.c (reload): Revert 2 previous checkins.
+
+2003-11-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * cpptrad.c (_cpp_scan_out_logical_line): Improve test for
+ whether directive begins at the beginning of a line.
+
+2003-11-19 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/frv/frv.c (frv_init_libfuncs): Correct ufix_optab entries.
+
+2003-11-19 Gerald Pfeifer <gp@suse.de>
+
+ * doc/install.texi (Specific): Remove information on old versions
+ of glibc versus old versions of GCC.
+
+2003-11-19 Richard SAndiford <rsandifo@redhat.com>
+
+ * emit-rtl.c (gen_lowpart): Don't force MEMs into a register unless
+ the register lowpart is a TRULY_NOOP_TRUNCATION.
+
+2003-11-19 Richard Henderson <rth@redhat.com>
+
+ * config/i386/i386.c (print_reg): Handle QI and HI modes for
+ non Q regs.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * config/config.gcc (powerpc-*-darwin*): Add libgcc build
+ specification file.
+ * config/t-slibgcc-darwin: New file, libgcc build specification.
+ * config/t-darwin: Add libgcc2 flag -fPIC.
+ * config/rs6000/t-darwin: Multilib matches float.
+ * libgcc-darwin.ver: New file, contains libgcc symbols.
+
+2003-11-18 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/ns32k/ns32k.h: Remove obsolete comment.
+
+2003-11-18 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11821
+ * config/arm/arm.c (arm_rtx_costs_1): Improve estimate of the code
+ size for calls to libgcc's div & mod subroutines when using -Os.
+
+2003-11-18 Jan Hubicka <jh@suse.cz>
+
+ * cgraph.c (change_decl_assembler_name): Avoid bogus warnings.
+
+2003-11-18 Marc Espie <espie@openbsd.org>
+
+ * config/rs6000/sysv4.h: OpenBSD hooks.
+
+2003-11-18 Richard Henderson <rth@redhat.com>
+
+ * expr.c (expand_expr): Don't look through constant arrays if
+ they don't bind locally.
+
+2003-11-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * expr.c (convert_move): Use GET_MODE_PRECISION instead of bitsize
+ when seeing if truncation or extension.
+
+2003-11-17 Eric Christopher <echristo@redhat.com>
+
+ * reload1.c (reload): Fix previous change.
+
+2003-11-17 Scott Snyder <snyder@fnal.gov>
+
+ PR debug/11325
+ * dwarf2out.c (struct die_struct): Add die_definition field.
+ (add_AT_specification): New.
+ (gen_subprogram_die, gen_variable_die,
+ gen_struct_or_union_type_die): Use it.
+ (prune_unused_types_mark): If we're marking a forward declaration,
+ also mark the full definition, if it exists.
+
+2003-11-16 Nick Clifton <nickc@redhat.com>
+
+ * config/stormy16/stormy16.h (BUILD_VA_LIST_TYPE): Delete.
+ * config/stormy16/stormy16-protos.h (xstormy16_build_va_list):
+ Remove prototype.
+ * config/stormy16/stormy16.c (xstormy16_build_va_list): Rename
+ to xstormy16_build_builtin_va_list and make static.
+ (TARGET_BUILD_BUILTIN_VA_LIST): Define.
+
+2003-11-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300-protos.h: Add the prototype for
+ same_cmp_following_p.
+ * config/h8300/h8300.c (same_cmp_following_p): New.
+ * config/h8300/h8300.md (peephole2): Use it.
+
+2003-11-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Don't use REGNO when its operand is
+ not guaranteed to be a REG.
+
+2003-11-16 Richard Sandiford <rsandifo@redhat.com>
+
+ * Makefile.in (expr.o): Depend on $(TARGET_H).
+ * target.h (return_in_msb): New target hook.
+ * target-def.h (TARGET_RETURN_IN_MSB): New macro.
+ (TARGET_CALLS): Include it.
+ * calls.c (shift_returned_value): New function.
+ (expand_call): Use it.
+ * expr.c: Include target.h.
+ (copy_blkmode_from_reg): Check targetm.calls.return_in_msb when
+ deciding what padding is needed. Change the name of the local
+ padding variable from big_endian_correction to padding_correction.
+ * stmt.c (shift_return_value): New function.
+ (expand_return): Use it. Adjust memory->register copy in the same
+ way as copy_blkmode_from_reg. Only change the return register's
+ mode if it was originally BLKmode.
+ * doc/tm.texi (TARGET_RETURN_IN_MSB): Document.
+ * config/mips/mips.c (TARGET_RETURN_IN_MSB): Define.
+ (mips_fpr_return_fields): New, split out from mips_function_value.
+ (mips_return_in_msb, mips_return_fpr_pair): New functions.
+ (mips_function_value): Rework to use the functions above.
+ * config/mips/irix6-libc-compat.c: Delete.
+ * config/mips/t-iris6 (LIB2FUNCS_STATIC_EXTRA): Undefine.
+
+2003-11-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * doc/install.texi (--enable-checking): Update valgrind's URL.
+
+2003-11-16 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.md: Fix warnings by replacing -2147483648
+ with -2147483647 - 1.
+
+2003-11-16 Gerald Pfeifer <gerald@pfeifer.com>
+
+ Fix links in online manuals.
+ * doc/invoke.texi (H8/300 Options): @xref to ld, not ld.info.
+ (Precompiled Headers): @pxref to cpp, not cpp.info.
+
+2003-11-16 Jason Merrill <jason@redhat.com>
+
+ * Makefile.in, objc/Make-lang.in (objc.tags): Create TAGS.sub
+ files in each directory and TAGS files that include them for each
+ front end.
+
+2003-11-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (divnorm): Store the sign in bit
+ 3 of S2L.
+ (modnorm): Likewise.
+ (exitdiv): Look at bit 3 of S2L only.
+
+2003-11-15 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/h8300.h (DO_GLOBAL_CTORS_BODY): Fix warnings.
+ (DO_GLOBAL_DTORS_BODY): Likewise.
+
+2003-11-15 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * doc/install.texi (Prerequisites): Refine documentation of
+ autoconf, automake and perl requirements. Document required
+ gettext version.
+
+<2003-11-14 Jason Merrill <jason@redhat.com>
+
+ * function.c (assign_parms): Use TREE_TYPE to determine the real
+ type of the argument object.
+
+2003-11-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (___udivsi3): Peel off the first
+ iteration.
+
+2003-11-14 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_move_block_from_reg):
+ New routine to save vararg registers on stack. Support for
+ -mpowerpc64 in mixed mode.
+
+2003-11-14 Bernardo Innocenti <bernie@develer.com>
+
+ * config/m68k/m68k.c: Use C statements instead of #ifdef's when testing
+ for MOTOROLA versus MIT syntax. Improves readability and provides
+ better compile-time error checking for both code paths.
+
+2003-11-14 Kelley Cook <kcook@gcc.gnu.org>
+
+ * config/frv/frv-protos.h: Update for C90.
+ * config/frv/frv.h: Likewise.
+ * config/frv/frvbegin.c: Likewise.
+ * config/frv/frv.c: Likewise.
+ (frv_adjust_field_align): Delete unused variable.
+
+2003-11-14 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.md: Add 'DEFAULT_ABI == ABI_DARWIN'
+ to each place where TARGET_LONG_DOUBLE_128 is used with
+ DEFAULT_ABI == ABI_AIX.
+
+ * cppfiles.c (_cpp_find_file): Make 'one or more PCH files were found'
+ message comply with GNU standards.
+
+2003-11-14 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ PR/6552
+ * function.c (struct epi_info): New field const_equiv.
+ (update_epilogue_consts): New function.
+ (keep_stack_depressed): Clear new field and verify scratch register
+ doesn't have it set.
+ Call new function via note_stores.
+ (handle_epilogue_set): Allow setting SP equiv reg in different mode.
+ Allow PLUS where second operand is register known set to constant.
+ (emit_equiv_load): Write load using proper mode if source different.
+ * config/mips/mips.md (return_internal): Put (return) first.
+
+2003-11-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (___udivsi3): Add a comment.
+
+2003-11-14 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (modsi3): Don't save unused
+ registers.
+ (divsi3): Likewise.
+ (reti): Don't restore unused registers.
+
+2003-11-14 Nick Clifton <nickc@redhat.com>
+
+ * config/fr30/fr30.c: Include toplev.h
+
+2003-11-14 Richard Earnshaw <rearnsha@arm.com>
+
+ * except.c (sjlj_emit_function_enter): Mark internal label as LOCAL.
+
+2003-11-14 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_emit_vector_const, arm_output_load_gr): Use ISO C
+ function definition syntax.
+
+2003-11-14 Eric Christopher <echristo@redhat.com>
+
+ * reload1.c (reload): Revert previous patch. Make
+ check for assignment into reg_equiv_address stricter.
+
+2003-11-14 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.in (POSTSTAGE1_FLAGS_TO_PASS): Pass ADAFLAGS.
+
+2003-11-14 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/frv/frv.c (frv_in_small_data_p): Return false for unknown
+ section names.
+
+2003-11-14 Jason Merrill <jason@redhat.com>
+
+ PR middle-end/12526
+ * tree.c (build): A CALL_EXPR has side-effects if its arguments do.
+ * calls.c (call_expr_flags): New fn.
+ * tree.h: Declare it.
+
+2003-11-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (__udivsi3): Remove.
+ (divmodsi3): Change the name to ___udivsi3.
+ Update all callers.
+
+2003-11-13 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * libgcc2.c (__negdi2, __addvsi3, __addvdi3, __subvsi3, __subvdi3,
+ __mulvsi3, __negvsi2, __negvdi2, __mulvdi3, __lshrdi3, __ashldi3,
+ __ashrdi3, __ffsDI2, __muldi3, __clzDI2, __ctzDI2, __parityDI2,
+ __udivmoddi4, __divdi3, __moddi3, __cmpdi2, __ucmpdi2,
+ __fixunstfDI, __fixunsxfDI, __fixunsdfDI, __fixunssfDI,
+ __floatdixf, __floatditf, __floatdidf, __floatdisf, __gcc_bcmp):
+ Const-ify and/or initialize automatic variables at declaration.
+
+2003-11-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (divmodsi4): Replace all the uses
+ of er4 with er3. Adjust all callers.
+
+2003-11-13 Andrew Pinski <apinski@apple.com>
+
+ * config/darwin.c (machopic_output_possible_stub_label):
+ Allow stub symbol be not defined when outputting possible
+ stub label.
+
+2003-11-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (___udivsi3): Jump to reti
+ instead of exitdiv.
+ (___umodsi3): Likewise.
+ (exitdiv): Do not restore any register.
+ (reti): Restore registers.
+
+2003-11-13 Steven Bosscher <stevenb@suse.de>
+
+ * tree-inline.c (walk_tree): Handle PLACEHOLDER_EXPR.
+
+2003-11-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm: Fix comment typos.
+
+2003-11-13 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (udivsi3): Don't save/restore
+ unused registers. Don't jump to exitdiv.
+ (umodsi3): Likewise.
+
+2003-11-13 Mark Mitchell <mark@codesourcery.com>
+ Kean Johnston <jkj@sco.com>
+
+ PR c/13029
+ * toplev.c (check_global_declarations): Do not warn about unused
+ static consts.
+
+2003-11-13 Pavel Pisa <pisa@cmp.felk.cvut.cz>
+ Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (DenHighNonZero): Optimize using
+ the approximate quotient method.
+
+2003-11-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * combine.c (distribute_notes): When re-distributing the notes from
+ an insn we are about to delete, ensure we can't end up with a cyclic
+ list of notes.
+
+2003-11-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/12926
+ * expr.c (expand_assignment) [COMPONENT_REF]: Don't put
+ the UNCHANGING_RTX_P flag on memory references to read-only
+ components that are not addressable.
+
+2003-11-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (divmodsi4): Clear S0P in
+ DenHighNonZero.
+
+2003-11-13 Jan Hubicka <jh@suse.cz>
+
+ PR opt/12275
+ * c-decl.c (finish_decl): Use change_decl_assembler_name.
+ * c-pragma.c (handle_pragma_redefine_extname): Likewise.
+ * varasm.c (make_decl_rtl): Likewise.
+ * cgraph.c (change_decl_assembler_name): New function.
+ * tree.h (set_decl_assembler_name): Kill dead declaration.
+ (change_decl_assembler_name): Declare.
+
+ * decl.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name.
+ * decl2.c (make_rtl_for_nonlocal_decl): Use change_decl_assembler_name.
+
+2003-11-12 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm (___mulsi3): Don't save/restore
+ an unused register.
+
+2003-11-12 Richard Sandiford <rsandifo@redhat.com>
+
+ PR bootstrap/12752
+ * config/mips/t-iris6 (MULTILIB_OPTIONS): Put -mabi=n32 first.
+ (MULTILIB_OSDIRNAMES): Reorder accordingly.
+
+2003-11-12 Janis Johnson <janis187@us.ibm.com>
+
+ * rs6000-protos.h (rs6000_initial_elimination_offset): Add.
+ (rs6000_stack_info): Remove. (debug_stack_info): Remove.
+ (rs6000_emit_eh_reg_restore): Add
+ * rs6000.c (rs6000_stack_t): Move from rs6000.h, change data type
+ of vars_size and total_size to HOST_WIDE_INT.
+ (emit_frame_save): Change parameter size to HOST_WIDE_INT.
+ (rs6000_stack_info): Make static; change data size to HOST_WIDE_INT.
+ (debug_stack_info): Make static; change output format of HOST_WIDE_INT
+ values.
+ (rs6000_emit_eh_reg_restore): New, with code formerly in rs6000.md.
+ (rs6000_initial_elimination_offset): New, with code formerly in
+ INITIAL_ELIMINATION_OFFSET.
+ * rs6000.h (rs6000_stack_t): Remove.
+ (INITIAL_ELIMINATION_OFFSET): Replace code with call to function
+ rs6000_initial_elimination_offset.
+ * rs6000.md (UNSPECV_EH_RR split): Replace code with call to
+ rs6000_emit_eh_reg_restore.
+
+2003-11-12 Mike Stump <mrs@apple.com>
+
+ * c-typeck.c (c_convert_parm_for_inlining): Add argnum, which
+ is the argumnt we are processing so that warnings and errors
+ will have that information.
+ * c-tree.h (c_convert_parm_for_inlining): Add argnum.
+ * lang-hooks-def.h
+ (lhd_tree_inlining_convert_parm_for_inlining): Likewse.
+ * langhooks.c (lhd_tree_inlining_convert_parm_for_inlining): Likewise.
+ * langhooks.h (convert_parm_for_inlining): Likewise.
+ * tree-inline.c (initialize_inlined_parameters): Compute and
+ pass argnum down.
+
+2003-11-12 Alexey Starovoytov <alexey.starovoytov@sun.com>
+ Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/12953
+ * tree-inline.c (inline_forbidden_p_1): Added check for BUILT_IN
+ before switch by FUNCTION_CODE.
+
+2003-11-12 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.md (storehi): Avoid use of explicit subreg.
+ (storehi_bigend, storeinthi, movhi_bigend): Likewise.
+
+2003-11-12 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * config/sh/sh.md (prefetch): New pattern.
+
+2003-11-11 Eric Christopher <echristo@redhat.com>
+
+ * reload1.c (reload): Verify that addresses for
+ reg_equiv_* are valid for the architecture.
+
+2003-11-11 Eric Christopher <echristo@redhat.com>
+
+ * function.c (purge_addressof_1): Add libcall check.
+ Remove test for cached replacements on fallback case.
+ Simplify mode comparisons. Add libcall test for
+ paradoxical subregs.
+
+2003-11-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/t-h8300: Fix an obsolete comment.
+
+2003-11-11 James E Wilson <wilson@specifixinc.com>
+
+ * expmed.c (store_bit_field, extract_bit_field): Revert last two
+ changes.
+
+2003-11-11 Kazu Hirata <kazu@cs.umass.edu>
+
+ * config/h8300/lib1funcs.asm: Replace DenHighZero with
+ DenHighNonZero.
+
+2003-11-11 Jan Hubicka <jh@suse.cz>
+
+ * cgraphunit.c (cgraph_function_possibly_inlined_p): Use
+ really_no_inline.
+
+2003-11-11 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.h (TRAMPOLINE_TEMPLATE): Fix flushing of cache lines when
+ generating 64-bit code.
+
+2003-11-10 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (legitimate_lo_sum_address_p): Remove
+ accidental commit in previous change.
+
+2003-11-10 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.h (STACK_SIZE_MODE): Add definition.
+ * config/rs6000/rs6000.c (reg_or_mem_operand): Add macho-style
+ address recognition.
+ (macho_lo_sum_memory_operand): Routine to recognize macho-style
+ address recognition.
+
+2003-11-10 Richard Henderson <rth@redhat.com>
+
+ * dwarf2out.c (gen_label_die): Cope with DECL_RTL not set.
+
+2003-11-10 Matt Austern <austern@apple.com>
+
+ * config/darwin-protos.h (darwin_assemble_visibility): Declare.
+ * config/darwin.c (darwin_assemble_visibility): Define. Warn for
+ anything other than VISIBILITY_DEFAULT and VISIBILITY_HIDDEN.
+ * config/darwin.h (TARGET_ASM_ASSEMBLE_VISIBILITY): Use
+ darwin_assemble_visibility instead of default.
+
+2003-11-10 Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ PR target/12865
+ * config/sparc/sparc.c (sparc_initialize_trampoline): Call
+ __enable_execute_stack only after writing onto the stack.
+ (sparc64_initialize_trampoline): Likewise.
+
+2003-11-09 Roger Sayle <roger@eyesopen.com>
+
+ * loop.c (check_dbra_loop): Try swapping the comparison operands
+ of the loop condition to identify a suitable induction variable.
+ * unroll.c (loop_iterations): Likewise.
+
+2003-11-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/sparc/sparc.h (TARGET_CPU_CPP_BUILTINS): Fix sparc vs
+ sparc64 #cpu and #machine assertions.
+
+2003-11-09 Richard Henderson <rth@redhat.com>
+
+ * Makefile.in (rtlanal.o): Depend on BASIC_BLOCK_H.
+
+2003-11-09 Jan Hubicka <jh@suse.cz>
+
+ * tree-optimize.c (tree_rest_of_compilation): Fix warning.
+
+ * cgraphunit.c (cgraph_expand_function): Use
+ cgraph_possibly_inlined_p.
+ * tree-optimize.c (tree_rest_of_compilation): Do not kill saved tree.
+
+ * opts.c (common_handle_option): Do not set max-inline-insns.
+ * params.def: Update comments.
+ (PARAM_MAX_INLINE_INSNS): Kill.
+ * invoke.texi (max-inline-insns): Kill.
+
+2003-11-08 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/3190
+ PR c/8714
+ * c-format.c (set_Wformat): Do not enable -Wformat-y2k by default.
+ * invoke.texi: Update.
+
+2003-11-08 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR optimization/12630
+ * pa.c (compute_movstrsi_length): Rename to compute_movstr_length.
+ Handle length computation 64-bit moves.
+ (compute_clrstr_length, output_block_clear): Implement block clear.
+ (output_block_move): Handle 64-bit moves.
+ (pa_adjust_insn_length): Use compute_movstr_length and
+ compute_clrstr_length.
+ * pa.md (movstrsi): Revise operand order and comments. Don't use
+ match_scratch.
+ (movstrsi_internal): Delete.
+ (movstrsi_prereload, movstrsi_postreload): New insns. Define splitter
+ and peephole2 patterns to transform prereload to postreload form.
+ (movstrdi, movstrdi_prereload, movstrdi_postreload, clrstrsi,
+ clrstrsi_prereload, clrstrsi_postreload, clrstrdi, clrstrdi_prereload,
+ clrstrdi_postreload): New patterns for 64-bit block move, and block
+ clear.
+ * pa-protos.h (output_block_clear): New prototype.
+
+2003-11-08 Andreas Schwab <schwab@suse.de>
+
+ * dbxout.c (current_file): Also wrap inside DBX_DEBUGGING_INFO ||
+ XCOFF_DEBUGGING_INFO.
+
+2003-11-08 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * dbxout.c (current_file): Wrap declaration in DBX_USE_BINCL.
+
+2003-11-07 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_legitimize_address): Remove
+ redundant parens.
+
+ * cppfiles.c (pch_open_file): New parameter 'invalid_pch', set it.
+ (find_file_in_dir): Likewise.
+ (_cpp_find_file): Print message if no header file is found
+ but an invalid PCH file was.
+
+2003-11-08 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (pedantic_lvalue_warning): Deprecate compound
+ expressions as lvalues.
+ (internal_build_compound_expr): Remove special handling for
+ non-pedantic case.
+ * doc/extend.texi: Document that all extended lvalues are now
+ deprecated.
+
+2003-11-07 Geoffrey Keating <geoffk@apple.com>
+
+ PR 11654
+ * dbxout.c (struct dbx_file): Do not save for PCH.
+ (current_file): Likewise.
+ (dbxout_init): Don't allocate struct dbx_file using GC.
+ (dbxout_start_source_file): Likewise.
+
+2003-11-07 Falk Hueffner <falk@debian.org>
+
+ * config/alpha/elf.h, config/alpha/unicosmk.h,
+ config/alpha/vms.h: Convert to ISO C90.
+
+2003-11-07 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * config/arm/pe.h: Convert to ISO C90.
+
+2003-11-07 J"orn Rennecke <joern.rennecke@superh.com>
+
+ * sh-protos.h (sh_pch_valid_p): Declare.
+ * sh.c ("intl.h"): Include.
+ (TARGET_PCH_VALID_P): Override.
+ (sh_target_switches): New variable.
+ (target_switches): Define.
+ (sh_pch_valid_p): New function.
+
+ * sh.h (MODE_AFTER): Don't change mode unless TARGET_HITACHI.
+
+2003-11-07 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (x86_64_sign_extended_value): Return false from tls variables.
+ (x86_64_zero_extended_value): likewise.
+
+2003-11-07 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (loadgp): Take $25 as a second operand.
+ * config/mips/mips.c (mips_expand_prologue): Modify accordingly.
+
+2003-11-06 Matt Austern <austern@apple.com>
+
+ * c-common.c (handle_visibility_attribute): Set DECL_VISIBILITY
+ field instead of hanging an attribute object off the decl.
+ * tree.h (DECL_VISIBLITY): New accessor macro for
+ symbol_visibility field in struct tree_decl.
+ (enum symbol_visibility): Move definition to before tree_decl.
+ (struct tree_decl): Define new two-bit field, symbol_visibility.
+ (decl_visibility): Remove declaration.
+ * varasm.c (maybe_assemble_visibility): Use DECL_VISIBILITY
+ instead of decl_visibility.
+ (default_binds_local_p_1): Use DECL_VISIBILITY instead of
+ decl_visibility.
+ (decl_visibility): Remove.
+
+2003-11-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (s390_emit_epilogue): Recognize more cases
+ where register 14 will be saved.
+
+2003-11-06 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.h (USE_FP_FOR_ARG_P): Move to rs6000.c.
+ (USE_ALTIVEC_FOR_ARG_P): Likewise.
+ * config/rs6000/rs6000.c (USE_FP_FOR_ARG_P): Move from rs6000.h.
+ Take a pointer as the CUM parameter. Update callers.
+ (USE_ALTIVEC_FOR_ARG_P): Likewise. Also correct for Darwin/AIX
+ 32-bit ABIs.
+ (function_arg_advance): Use USE_ALTIVEC_FOR_ARG_P. Correct case
+ of vector parameters as named arguments of stdarg function.
+ (function_arg): Likewise.
+
+ * config/rs6000/darwin.h (ASM_SPEC): Use -force_cpusubtype_ALL when
+ -maltivec is specified, not the non-existent -faltivec.
+
+2003-11-06 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390-protos.h (s390_function_value): Declare.
+ * config/s390/s390.c (TARGET_RETURN_IN_MEMORY): Define.
+ (s390_return_in_memory): New function.
+ (s390_function_value): New function.
+ (s390_function_arg_float): Return false for all arguments larger
+ than 8 bytes.
+ (s390_function_arg_pass_by_reference): Likewise. Return true for
+ all vector arguments.
+ (s390_function_arg_integer): New function.
+ (s390_function_arg_advance): Call it. Add sanity checks.
+ (s390_function_arg): Likewise.
+ * config/s390/s390.h (FUNCTION_VALUE): Call s390_function_value.
+ (LIBCALL_VALUE): Likewise.
+ (RET_REG): Remove.
+ (RETURN_IN_MEMORY): Remove.
+
+2003-11-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_initial_elimination_offset): Change
+ return type to HOST_WIDE_INT.
+ * config/mips/mips.c (mips_frame_info): Give sizes type HOST_WIDE_INT.
+ Make initialized a bool. Make register masks unsigned ints.
+ (compute_frame_size): Make same mask change here. Use HOST_WIDE_INT
+ where appropriate.
+ (mips_initial_elimination_offset): Return a HOST_WIDE_INT.
+ (mips_output_function_prologue): Print sizes as HOST_WIDE_INTs.
+
+2003-11-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/frv/frv.c (frv_initial_elimination_offset): Remove bogus
+ negation.
+
+2003-11-06 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/frv/frv.h (ASM_OUTPUT_ALIGN_WITH_NOP): Define.
+
+2003-11-06 Momchil Velikov <velco@fadata.bg>
+
+ * config/mips/mips.c (override_options): Set MASK_SOFT_FLOAT
+ for VR4111 too.
+
+2003-11-06 Jan Hubicka <jh@suse.cz>
+
+ * builtins.c (simplify_builtin_strrchr, simplify_builtin_strpbrk): Add
+ missing casts.
+
+2003-11-06 Zack Weinberg <zack@codesourcery.com>
+
+ * genmodes.c: Change the word "bitsize" to "precision" throughout.
+ * machmode.def: Likewise.
+ * machmode.h (GET_MODE_SIZE): Cast value to unsigned short.
+ (GET_MODE_BITSIZE): Define as GET_MODE_SIZE * BITS_PER_UNIT.
+ (GET_MODE_PRECISION): New macro.
+ (mode_bitsize): Renamed mode_precision.
+ * stor-layout.c (mode_for_size, smallest_mode_for_size):
+ Use GET_MODE_PRECISION; clarify comments.
+
+2003-11-05 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * doc/install-old.texi: Remove old documentation of building
+ cross-compilers.
+ * doc/install.texi: Move some of it to here.
+
+2003-11-05 Per Bothner <pbothner@apple.com>
+
+ PR preprocessor/12891
+ * c-opts.c (finish_options): Set include_cursor to disable premature
+ calls to push_command_line_include from cpp_scan_nooutput.
+ Fixes bug reported by DJ Delorie.
+
+2003-11-05 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (setup_incoming_varargs): Remove
+ code supporting old-style varargs.
+
+ * config/rs6000/rs6000.c (rs6000_machopic_legitimize_pic_address): Use
+ an intermediate register for better optimisation.
+
+2003-11-05 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/10080
+ * cfgloopanal.c (variable_initial_value, variable_initial_values,
+ simple_loop_exit_p): Record the fact that initial value is extended
+ from inner mode.
+ (count_strange_loop_iterations, count_loop_iterations): Handle
+ ivs that iterate in a narrower mode. Fix handling of overflows.
+ Improve handling of NE conditions.
+ (inverse, fits_in_mode_p): New static functions.
+ (simple_increment): Detect variables that iterate in a narrower mode.
+ * cfgloop.h (struct loop_desc): Fields inner_mode and extend added.
+
+2003-11-05 Geoffrey Keating <geoffk@apple.com>
+
+ * config/rs6000/rs6000.c (compute_vrsave_mask): Correct off-by-one
+ error.
+
+ * config/rs6000/darwin.h (SUBTARGET_OVERRIDE_OPTIONS): Darwin
+ needs VRSAVE.
+
+2003-11-05 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * c-typeck.c (pedantic_lvalue_warning): Deprecate use of
+ conditional expressions as lvalues.
+
+2003-11-05 Kazu Hirata <kazu@cs.umass.edu>
+
+ * tsystem.h: Add the prototype of strlen.
+ * unwind-pe.h (read_encoded_value_with_base): Add an
+ appropriate cast to handle a case where the pointer size is
+ smaller than sizeof (int).
+
+2003-11-04 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips-protos.h (mips_global_pic_constant_p): Delete.
+ (mips_delegitimize_address): Delete.
+ (mips_gotoff_global, mips_load_got_page): Declare.
+ (mips_load_got_global, mips_rewrite_small_data): Declare.
+
+ * config/mips/mips.h (FIND_BASE_TERM): Remove definition.
+ (DANGEROUS_FOR_LA25_P): Use global_got_operand.
+ (PREDICATE_CODES): Add global_got_operand, local_got_operand and
+ small_data_pattern. Remove CONST from const_arith_operand's entry.
+
+ * config/mips/mips.c (UNSPEC_ADDRESS_P, CONST_GP_P): New macros.
+ (UNSPEC_ADDRESS, UNSPEC_ADDRESS_TYPE): Likewise.
+ (mips_constant_type): Delete.
+ (mips_symbol_type): Add SYMBOL_GOTOFF_PAGE, SYMBOL_GOTOFF_GLOBAL,
+ SYMBOL_GOTOFF_CALL and SYMBOL_GOTOFF_LOADGP.
+ (NUM_SYMBOL_TYPES): New macro.
+ (mips_address_type): Remove ADDRESS_INVALID.
+ (machine_function): Add has_gp_insn_p.
+ (mips_constant_info): Delete.
+ (mips_address_info): Add the address type as an extra field. Replace
+ the c field with symbol_type.
+ (mips_split_p, mips_lo_relocs, mips_hi_relocs): New arrays.
+ (TARGET_DELEGITIMIZE_ADDRESS): Remove definition.
+ (mips_reloc_offset_ok_p, mips_classify_constant): Delete.
+ (mips_split_const, mips_symbolic_constant_p): New functions.
+ (mips_symbolic_address_p): Take the symbol type and mode as arguments.
+ (mips_classify_address): Return true if the address is valid, storing
+ its type in INFO. Use mips_symbolic_constant_p. Use mips_lo_relocs[]
+ to test whether a LO_SUM address is allowed.
+ (mips_symbol_insns): Return 0 for general mips16 symbols.
+ Reorder SYMBOL_GOT_GLOBAL case to match mips_symbol_type definition.
+ Handle the new SYMBOL_GOTOFF_*s.
+ (mips_address_insns): Update call to mips_classify_address.
+ (mips_const_insns): Be more fussy about HIGH constants. Remove use
+ of mips_classify_constant. Be more accurate about CONSTs.
+ (mips_global_pic_constant_p): Delete.
+ (const_arith_operand): Only accept CONST_INTs.
+ (call_insn_operand): Remove call to mips_classify_constant.
+ Let mips_symbolic_constant_p check for invalid offsets.
+ (move_operand): Check for general_operands first. Only accept symbolic
+ constants if they satisfy mips_symbolic_constant_p and cannot be split.
+ (symbolic_constant): Use mips_symbolic_constant_p.
+ (global_got_operand, local_got_operand): New predicates.
+ (stack_operand): Update call to mips_classify_address.
+ (mips_legitimate_address_p): Likewise.
+ (mips_reloc, mips_lui_reloc): Delete.
+ (mips_force_temporary): Only use the given temporary if no_new_pseudos.
+ Use emit_move_insn.
+ (mips_split_symbol, mips_unspec_address): New functions.
+ (mips_unspec_offset_high): New function.
+ (mips_load_got): Replace reloc argument with a symbol_type.
+ Use mips_unspec_address to create the address and put it in a
+ LO_SUM with the base register.
+ (mips_load_got16, mips_load_got32): Delete.
+ (mips_emit_high, mips_legitimize_symbol): Delete.
+ (mips_gotoff_global): New function.
+ (mips_load_got_page, mips_load_got_global): New functions.
+ (mips_legitimize_symbol): Inline handling of LO_SUM splits.
+ (mips_legitimize_const_move): Likewise. Remove HIGH handling.
+ Inline code to handle constants plus invalid offsets. Use
+ mips_split_symbol to legitimize constant pool addresses.
+ (mips_delegitimize_address): Delete.
+ (mips_rtx_costs): Give legitimate symbolic constants and CONST_DOUBLEs
+ a cost of 1 insn. Give the rest a cost of CONSTANT_POOL_ADDRESS.
+ (mips_subword): Pass memrefs through mips_rewrite_small_data.
+ (mips_output_move): Remove use of mips_classify_constant.
+ (mips_expand_call): Use mips_unspec_offset_high to calculate the
+ high part of the GOT address for calls to global functions.
+ (override_options): Initialize mips_split_p[], mips_lo_relocs[]
+ and mips_hi_relocs[].
+ (print_operand): Use print_operand_reloc to handle '%h' and '%R'.
+ Remove use of mips_classify_constant.
+ (mips_reloc_string): Delete.
+ (print_operand_reloc): New function.
+ (print_operand_address): Update call to mips_classify_address.
+ (mips_rewrite_small_data_p, small_data_pattern_1): New functions.
+ (small_data_pattern): New predicate.
+ (mips_rewrite_small_data_1, mips_rewrite_small_data): New functions.
+ (mips_function_has_gp_insn): New function.
+ (mips_global_pointer): Use it.
+ (mips_gp_insn): Delete.
+ (mips_expand_prologue): When compiling for n32/n64 abicalls, use a
+ single loadgp pattern to initialize $gp. Pass it the offset of _gp
+ from the start of the current function.
+ (mips16_gp_pseudo_reg): Revert last patch.
+
+ * config/mips/mips.md (RELOC_*): Delete.
+ (UNSPEC_LOADGP, UNSPEC_FIRST_ADDRESS): New constants.
+ (got): New insn attribute.
+ (type): Set to "load" if got == load.
+ (length): Set to 4 if got == load, 8 if got == xgot_high.
+ (lui[sd]i): Delete.
+ (*xgot_hi[sd]i, *xgot_lo[sd]i): New patterns.
+ (*got_disp[sd]i, *got_page[sd]i): Likewise.
+ (*low[sd]i): Change constraints to "d". Add a new define_split to
+ rewrite small data constants into LO_SUMs.
+ (loadgp): New insns.
+
+2003-11-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/mips/_tilib.c: Use _ABI* in _MIPS_SIM tests.
+
+2003-11-04 DJ Delorie <dj@redhat.com>
+
+ * config/v850/v850.md (mulhisi3): Expand the const_int case
+ separately to avoid trying to sign extend the const.
+
+2003-11-04 Richard Sandiford <rsandifo@redhat.com>
+
+ * emit-rtl.c (copy_rtx_if_shared): Don't allow MEMs with constant
+ addresses to be shared.
+ (force_const_mem): Return a copy of the pool entry.
+
+2003-11-03 Andreas Jaeger <aj@suse.de>
+
+ * Makefile.in (GCC_CFLAGS): Remove @WERROR@ again.
+
+2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (cpp.dvi): New target split from cpp.info.
+ (gcc.dvi): New target split from gcc.info.
+ (gccint.dvi): New target split from gccint.info.
+ (cppinternals.dvi): New target split from cppinternals.info
+ (gccinstall.info): New specific rule.
+ (gccinstall.dvi): Likewise.
+ (dvi): Move targets to $(docobjdir).
+ ($(docobjdir)/%.dvi): New implicit rule.
+
+2003-11-03 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * doc/gty.texi (tag, desc): Say more about role of desc values in
+ selecting between tags.
+
+2003-11-03 Alexander Kabaev <ak03@gte.com>
+
+ * real.c (encode_ieee_single): Ensure proper promotion.
+
+2003-11-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ * doc/contrib.texi: Add Giovanni Bajo, Dara Hazeghi, Falk Hueffner,
+ and Andrew Pinski.
+
+2003-11-03 Syd Polk <spolk@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_override_options): Add G3, G4, and G5
+ marketing names to the list of supported processors.
+ * config/rs6000/rs6000.h: Ditto.
+ * doc/invoke.texi: Ditto.
+ * config.gcc: Ditto.
+
+2003-11-03 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * fixinc/inclhack.def (stdio_va_list): Allow tab before va_list.
+ Merge two substitutions.
+ * fixinc/fixincl.x: Regenerate.
+ Fixes PR bootstrap/12666.
+
+2003-11-03 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * doc/install-old.texi: Remove VMS documentation.
+
+2003-11-03 Jan Hubicka <jh@suse.cz>
+
+ * i386.c (override_options): Remove hack enabling 128bit long double
+ commited by accident.
+
+2003-11-02 Per Bothner <per@bothner.com>
+
+ * c-opts.c (needValue): Do cpp_find_main_file before processing
+ any imacros flags, so pfile->main_file is set for the latter.
+
+2003-11-03 Andreas Jaeger <aj@suse.de>
+ Zack Weinberg <zack@codesourcery.com>
+
+ * Makefile.in (GCC_CFLAGS): Allow blacklisting of warnings.
+ (SYSCALLS.c.X-warn): Suppress warnings.
+
+2003-11-02 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ PR optimization/12845
+ * pa.c (output_cbranch): Use cmpb for DImode comparisons with 0.
+
+2003-11-02 Zack Weinberg <zack@codesourcery.com>
+
+ * print-rtl.c (print_rtx): Call PRINT_REG with second argument -1.
+ * config/i386/i386.c (print_reg): Abort on a virtual register
+ if code != -1; not if file == asm_out_file.
+ * config/i386/i386.h (PRINT_REG): Document meaning of CODE == -1.
+ (DEBUG_PRINT_REG): Delete, unused.
+
+2003-11-02 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/fde-glibc.c (_GNU_SOURCE): Define to 1 instead of
+ empty to avoid conflict with the definition from configure.
+
+2003-11-02 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/10817
+ * ifcvt.c (noce_emit_move_insn): Improve documentation comment.
+ (noce_try_move): New function to optimize an if-the-else into an
+ unconditional move, i.e. "if (a!=b) x=a; else x=b" into "x=a".
+ (noce_process_if_block): Attempt simplification with noce_try_move.
+
+ * simplify-rtx.c (simplify_ternary_operation): Some minor fixes
+ and improvements to the optimizations of IF_THEN_ELSE expressions.
+ (simplify_subreg): Silence signed/unsigned comparison warning.
+
+2003-11-02 Richard Sandiford <rsandifo@redhat.com>
+
+ * Makefile.in (targhooks.o, reload.o): Update dependencies.
+ (GTFILES): Add targhooks.c.
+ (gt-targhooks.h): New rule; depend on s-gtype.
+ * target.h (direct_pool_load_p): New hook.
+ * target-def.h (TARGET_DIRECT_POOL_LOAD_P): New macro.
+ (TARGET_INITIALIZER): Include it.
+ * targhooks.h (default_direct_pool_load_p): Declare.
+ (hook_bool_machine_mode_true): Declare.
+ * targhooks.c: Include insn-config.h, recog.h, ggc.h and
+ gt-targhooks.h.
+ (pool_symbol): New variable.
+ (default_direct_pool_load_p): New function.
+ (hook_bool_machine_mode_true): New function.
+ * reload.c: Include target.h.
+ (find_reloads): If an alternative will force a constant into memory,
+ count an extra reload if constant pool symbols are not valid
+ addresses. If an alternative uses memory to move values between
+ registers, count the move as two reloads rather than one.
+ * config/s390/s390.c (TARGET_DIRECT_POOL_LOAD_P): Define.
+ * doc/tm.texi (TARGET_DIRECT_POOL_LOAD_P): Document.
+
+2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ PR optimization/12799
+ * postreload.c (reload_cse_move2add): Generate the add2
+ patterns manually.
+
+2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]:
+ Return 0 for all complex modes whose size is lesser or equal to
+ a word. Add a ??? comment for the condition used with 16-byte
+ aligned modes.
+
+2003-11-01 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Remove c-parse* and tradcif.c.
+ * objc/.cvsignore: Delete.
+
+2003-11-01 Roger Sayle <roger@eyesopen.com>
+
+ * unwind-sjlj.c (_Unwind_GetCFA): Return (_Unwind_Word)0 instead
+ of NULL.
+
+2003-11-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * som.h (DO_GLOBAL_DTORS_BODY): Change to C90 declaration.
+
+ * libgcc2.c (SYMBOL__MAIN): Provide C90 declaration.
+
+ * collect2.c (scan_libraries): Fix typos.
+
+ PR preprocessor/12847
+ * cppfiles.c, cppexp.c, cpperror.c, cpplib.h, cpplib.c, cpplex.c,
+ cppinit.c, cpptrad.c, cppmacro.c, fix-header.c, cpppch.c, c-pch.c,
+ c-incpath.c, cppcharset.c (DL_WARNING, DL_WARNING_SYSHDR, DL_PEDWARN,
+ DL_ERROR, DL_ICE, DL_EXTRACT, DL_WARNING_P): Prefix macro names with
+ "CPP_".
+
+2003-11-01 Fariborz Jahanian <fjahanian@apple.com>
+
+ * config/rs6000/rs6000.c (rs6000_mixed_function_arg): Correct
+ no_units calculation.
+
+2003-11-01 Andreas Jaeger <aj@suse.de>
+
+ * unwind-dw2.c (_Unwind_FrameState): Remove commas at end of
+ enumeration list.
+
+2003-11-01 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/sysv4.h (SDATA_SECTION_FUNCTION): Update to C90
+ prototypes.
+ (SBSS_SECTION_FUNCTION): Likewise.
+
+2003-11-01 Andreas Jaeger <aj@suse.de>
+
+ * Makefile.in (GCC_CFLAGS): Add @WERROR@ for target files.
+
+2003-11-01 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * config/rs6000/sysv4.h (EXTRA_SECTION_FUNCTIONS): Update to C90
+ prototypes.
+
+2003-11-01 Andreas Jaeger <aj@suse.de>
+
+ * unwind-dw2.c (_Unwind_FindEnclosingFunction): Constify variable.
+ (uw_frame_state_for): Constify variables.
+ (extract_cie_info): Constify first argument.
+
+ * unwind-dw2-fde-darwin.c: Adjust prototype of
+ _Unwind_Find_registered_FDE for recent changes.
+ (examine_objects): Constify return value and local variable result.
+ (_Unwind_Find_FDE): Constify return value and local variable ret.
+
+2003-10-31 Per Bothner <pbothner@apple.com>
+
+ * c-opts.c (finish_options): Change to returns boolean - false iff
+ the call to cpp_find_main_file fails.
+ (c_common_init): Skip preprocess_file if finish_options failed.
+ (c_common_parse_file): Break if finish_options failed.
+ Fixes PR preprocessor/12545.
+
+2003-10-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * aclocal.m4: Blacklist ultrix* for mmap file.
+ * configure: Rebuilt.
+
+ * function.c (assign_parms): Add ATTRIBUTE_UNUSED to variable
+ reg_parm_stack_space.
+ * toplev.c (default_get_pch_validity): Fix warning.
+
+ * vax.c: Include toplev.h.
+ (vax_init_libfuncs): Fix typo (umod).
+ * vax.h (ASM_COMMENT_START): Define.
+ (PRINT_OPERAND): Fix warning when HOST_WIDE_INT is a long long.
+
+2003-10-31 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/11968
+ * expr.c (expand_expr <MULT_EXPR>): Remove inappropriate and
+ confusing comment; distributivity isn't handled in expand_expr.
+ * fold-const.c (extract_muldiv_1 <PLUS_EXPR>): Allow overflow
+ in distributivity, if wrap-around semantics are specified with
+ -fwrapv.
+
+2003-11-01 Alan Modra <amodra@bigpond.net.au>
+
+ PR 12315
+ * final.c (profile_function): Allow for NULL svrtx.
+
+2003-10-31 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.c (pa_select_section): Use new style declaration.
+ * som.h (readonly_data): Likewise.
+
+2003-10-31 Kelley Cook <kcook@gcc.gnu.org>
+
+ * config/rs6000/rs6000.c: Update to C90 prototypes.
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/7513
+ * arm.h (CONDITIONAL_REGISTER_USAGE): Disable use of LR in Thumb
+ code.
+
+2003-10-31 Andreas Jaeger <aj@suse.de>,
+ Zack Weinberg <zack@codesourcery.com>
+
+
+ * crtstuff.c (__register_frame_info, __register_frame_info_bases)
+ (__deregister_frame_info, __deregister_frame_info_bases):
+ Constify void * argument.
+ * unwind-dw2-fde.h (struct fde_vector):
+ Constify 'orig_data' and 'array' fields.
+ (__register_frame_info, __register_frame_info_bases)
+ (__deregister_frame_info, __deregister_frame_info_bases):
+ Constify void * argument.
+ (get_cie, next_fde, _Unwind_Find_FDE): Constify arguments,
+ return values, and casts of type fde *, struct dwarf_fde *,
+ and struct dwarf_cie *.
+ * unwind-dw2-fde.c (__register_frame_info, __register_frame_info_bases)
+ (__deregister_frame_info, __deregister_frame_info_bases):
+ Constify void * argument.
+ (get_cie_encoding, ): Constify struct dwarf_cie * argument.
+ (get_fde_encoding, fde_unencoded_compare, fde_single_encoding_compare)
+ (fde_mixed_encoding_compare, fde_compare_t, start_fde_sort, fde_insert)
+ fde_split, SWAP, frame_downheap, frame_heapsort)
+ (classify_object_over_fdes, add_fdes, linear_search_fdes,
+ binary_search_unencoded_fdes, binary_search_single_encoding_fdes,
+ binary_search_mixed_encoding_fdes, search_object, _Unwind_Find_FDE):
+ Constify arguments, local variables, return values, and casts
+ of type fde *, fde **, struct dwarf_fde *, and struct dwarf_cie *.
+ Use const pointer types in sizeof expressions, for clarity.
+ * unwind-dw2-fde-glibc.c
+ (_Unwind_find_registered_FDE, _Unwind_find_FDE): Constify return value.
+ (struct unw_eh_callback_data): Constify 'ret' field.
+
+2003-10-31 Fariborz Jahanian <fjahanian@apple.com>
+ David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.c (rs6000_mixed_function_arg): New.
+ (function_arg): Call it.
+ (rs6000_function_value): Widen integral return value to mode based
+ on TARGET_32BIT, not word_mode.
+ * config/rs6000/rs6000.h (PROMOTE_MODE): Likewise.
+ (UNITS_PER_ARG): New.
+ (RS6000_ARG_SIZE): Use it.
+
+2003-10-31 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * .cvsignore: No longer ignore gengtype-lex.c, gengtype-yacc.c,
+ and gengtype-yacc.h.
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ PR optimization/8896
+ * postreload.c (reload_combine): Check that REGY doesn't die in an
+ insn of the form (set (regx) (plus (regx) (regy))), ie REGX != REGY.
+
+2003-10-31 Josef Zlomek <zlomekj@suse.cz>
+
+ PR/10239
+ * cfgrtl.c (delete_insn): Decrease LABEL_NUSES for all REG_LABEL notes.
+
+2003-10-31 Josef Zlomek <zlomekj@suse.cz>
+
+ PR/11640
+ * cfgrtl.c (try_redirect_by_replacing_jump): Move jump
+ immediatelly before BARRIER.
+
+2003-10-31 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (STRICT2_WARN): Add -Wold-style-definition.
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ PR target/11271
+ * reload.c (find_reloads_address): Handle any register in
+ (PLUS (PLUS (REG) (REG)) (CONST_INT).
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ * ggc-page.c (ggc_pch_read): Wrap call to poison_pages in
+ ENABLE_GC_CHECKING not in GGC_POISON.
+
+2003-10-31 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR bootstrap/9863
+ * configure.in: Bail out if awk is missing.
+ * configure: Regenerate.
+
+ PR ada/12761
+ * Makefile.in: Move default definitions of X_ADA_CFLAGS,
+ T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS from ada/Make-lang.in to here.
+
+2003-10-30 Richard Henderson <rth@redhat.com>
+
+ * c-objc-common.c (c_tree_printer): Handle types correctly.
+ Factor code a bit.
+
+2003-10-30 Kelley Cook <kcook@gcc.gnu.org>
+
+ * value-prof.c, web.c: Update to C90.
+
+2003-10-30 Eric Christopher <echristo@redhat.com>
+
+ * function.c (purge_addressof_1): Add case for REG_RETVAL
+ notes when modes are unequal.
+
+2003-10-31 Jan Hubicka <jh@suse.cz>
+
+ * i386-modes.def: Add XFmode format adjustment.
+
+2003-10-30 Jan Hubicka <jh@suse.cz>
+
+ * real.c (encode_ieee_extended): Back out previous patch.
+
+2003-10-30 Jan Hubicka <jh@suse.cz>
+
+ * real.c (encode_ieee_extended): Initialize whole array.
+ * reg-stack.c (move_for_stack_reg0: Use always XFmode.
+ * i386-modes.def: Change definitions of TFmode and XFmode.
+ * i386.c (classify_argument): Rename TFmodes to XFmodes; add new TFmode
+ code.
+ (construct_container): Allow constructing of TFmode integer containers.
+ (ix86_return_in_memory): XFmode is not returned in memory.
+ (init_ext_80387_constants): Always use XFmode.
+ (print_operand): Likewise.
+ (ix86_prepare_fp_compare_regs): Likewise.
+ (split_to_parts): Deal with TFmode.
+ (split_long_move): Simplify.
+ (ix86_init_mmx_sse_builtins): Add __float80, __float128.
+ (ix86_memory_move_cost): Do not confuse TFmode.
+ * i386.h (LONG_DOUBLE_TYPE_SIZE): Set to 96.
+ (IS_STACK_MODE): TFmode is not stack mode.
+ (HARD_REGNO_NREGS, CLASS_MAX_NREGS): Deal nicely with XFmode.
+ (VALID_SSE_REG_MODE): Allow TFmode.
+ (VALID_FP_MODE_P): Disallow TFmode.
+ (VALID_INT_MODE_P): Allow TFmode in 64bit mode.
+ * i386.md (TFmode patterns): Kill.
+ (movtf, motf_rex64): New patterns.
+
+2003-10-30 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (adddi3): Fix typo in mips16 stack pointer code.
+
+2003-10-30 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.md (mov_lwl): Use memory_operand where appropriate.
+ (mov_lwr, mov_swl, mov_swr): Likewise.
+ (mov_ldl, mov_ldr, mov_sdl, mov_sdr): Likewise.
+
+2003-10-30 Richard Sandiford <rsandifo@redhat.com>
+
+ * config/mips/mips.c (mips_global_pointer): Don't try to use $25.
+
+2003-10-30 Richard Henderson <rth@redhat.com>
+
+ * config/mips/mips.c (mips_build_builtin_va_list): Use runtime
+ test for irix6 rather than preprocessor test.
+
+2003-10-30 Richard Henderson <rth@redhat.com>
+
+ * cppcharset.c (one_utf8_to_utf16): Initialize 's' to silence warning.
+
+2003-10-30 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * config/s390/s390.c (struct machine_function): Use save_return_addr_p
+ as a general flag that the return address register needs to be saved,
+ not necessarily because of __builtin_return_addr (0).
+ (s390_split_branches): Remove TEMP_REG and TEMP_USED arguments,
+ remove special handling of zSeries machines.
+ (s390_optimize_prolog): Remove TEMP_USED argument, treat the return
+ register as a regular register on zSeries machines.
+ (s390_reorg): Adjust calls to s390_split_branches and
+ s390_optimize_prolog.
+ (s390_frame_info): On zSeries machines, do not assume the return
+ register is always used. Update regs_ever_live with current data
+ for the special registers.
+ (s390_emit_epilogue): Use save_return_addr_p to determine whether
+ the return register was saved.
+ * config/s390/s390.h (CONDITIONAL_REGISTER_USAGE): Do not mark
+ RETURN_REGNUM fixed on zSeries machines.
+ (REG_ALLOC_ORDER): Use RETURN_REGNUM last.
+ * config/s390/s390.md ("*doloop_si"): Handle branch overflow
+ via ahi-jgne pair on zSeries machines.
+ ("*doloop_di"): Likewise.
+ ("*doloop_di_long"): Remove.
+
+2003-10-30 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_override_options): Revert change of arm_constant_limit
+ when optimizing for size.
+
+2003-10-29 Richard Henderson <rth@redhat.com>
+
+ * fold-const.c (fold_single_bit_test): Convert the input to the
+ operational intermediate type.
+
+2003-10-29 Richard Henderson <rth@redhat.com>
+
+ * builtins.c (std_build_builtin_va_list): New.
+ * expr.h (std_build_builtin_va_list): Declare.
+ * defaults.h (BUILD_VA_LIST_TYPE): New.
+ * system.h (BUILD_VA_LIST_TYPE): Poison.
+ * target-def.h (TARGET_BUILD_BUILTIN_VA_LIST): New.
+ * target.h (struct gcc_target): Add build_builtin_va_list.
+ * tree.c (build_common_tree_nodes_2): Use it.
+
+ * config/alpha/alpha-protos.h, config/alpha/alpha.c,
+ config/alpha/alpha.h, config/alpha/unicosmk.h,
+ config/d30v/d30v-protos.h, config/d30v/d30v.c, config/d30v/d30v.h,
+ config/i386/i386-protos.h, config/i386/i386.c, config/i386/i386.h,
+ config/i860/i860-protos.h, config/i860/i860.c, config/i860/i860.h,
+ config/i960/i960-protos.h, config/i960/i960.c, config/i960/i960.h,
+ config/mips/iris6.h, config/mips/mips-protos.h, config/mips/mips.c,
+ config/mips/mips.h, config/rs6000/rs6000-protos.h,
+ config/rs6000/rs6000.c, config/rs6000/rs6000.h,
+ config/s390/s390-protos.h, config/s390/s390.c, config/s390/s390.h,
+ config/sh/sh-protos.h, config/sh/sh.c, config/sh/sh.h,
+ config/xtensa/xtensa-protos.h, config/xtensa/xtensa.c,
+ config/xtensa/xtensa.h: Rename foo_build_va_list to
+ foo_build_builtin_va_list; make it static. Define
+ TARGET_BUILD_BUILTIN_VA_LIST. Remove BUILD_VA_LIST_TYPE.
+ Update protos.
+
+ * config/i386/i386.c (ix86_expand_carry_flag_compare): Make static.
+ * config/iq2000/iq2000.h (BUILD_VA_LIST_TYPE): Remove.
+
+2003-10-29 James E Wilson <wilson@specifixinc.com>
+
+ * recog.c (asm_operand_ok): Add missing break after case 'X'.
+ Change if statements to else if statements in default case.
+ (extract_constrain_insn_cached): Fix misspelling of constrain_operands
+ in comment.
+ (constrain_operands_cached): Likewise.
+ (constrain_operands): Change if statements to else if statements in
+ default case.
+ * reload.c (find_reloads): Likewise.
+
+2003-10-29 Richard Henderson <rth@redhat.com>
+
+ * config/m68k/m68k.c (notice_update_cc): Clear cc status for
+ shifts and rotates.
+
+2003-10-30 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.md: Remove duplicate pattern.
+
+2003-10-29 Hans-Peter Nilsson <hp@axis.com>
+
+ * real.c (do_divide): Initialize result with a 0.
+
+ * configure.in <enable-checking for valgrind>: Look for
+ <valgrind/memcheck.h> first. AC_DEFINE HAVE_VALGRIND_MEMCHECK_H
+ if it exists.
+ * configure, config.in: Regenerate.
+ * ggc-common.c [ENABLE_VALGRIND_CHECKING &&
+ HAVE_VALGRIND_MEMCHECK_H]: Include <valgrind/memcheck.h>. Use
+ #elif for other alternatives.
+ * ggc-page.c: Ditto.
+ * ggc-zone.c: Don't assume <valgrind/memcheck.h>; instead copy
+ include structure from ggc-common.c.
+
+2003-10-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa-linux.h (ASM_OUTPUT_ADDR_VEC_ELT): Use label in big switch ELTs.
+ (ASM_OUTPUT_ADDR_DIFF_ELT): Use label difference in big switch ELTs.
+ * pa.c (pa_adjust_insn_length): Check for btable branches using
+ attribute TYPE_BTABLE_BRANCH.
+ (pa_reorg): Simplify.
+ * pa.h (CASE_VECTOR_MODE): Change big switch mode to SImode.
+ (ASM_OUTPUT_ADDR_VEC_ELT): As above.
+ (ASM_OUTPUT_ADDR_DIFF_ELT): As above.
+ * pa.md (btable_branch): New instruction type.
+ (in_branch_delay, in_nullified_branch_delay, in_call_delay): Disallow
+ btable branches.
+ (define_delay): Add btable branches to insn types that may have an
+ insn in the delay position.
+ (Z2, Z3): Add btable branch to list.
+ Simplify unamed pattern set copy pic_label_operand to register. Add
+ PA 2.0 variant.
+ (short_jump): New jump for use in branch tables.
+ (casesi, casesi0): Revise for new branch table formats.
+ (casesi32, casesi32p, casesi64p): New casesi patterns.
+ (indirect_jump): Move.
+
+2003-10-29 David Edelsohn <edelsohn@gnu.org>
+
+ * config/rs6000/rs6000.h (UNITS_PER_WORD): Revert to
+ !TARGET_POWERPC64.
+ (UNITS_PER_GPR_WORD): Delete.
+ (HARD_REGNO_NREGS): Revert to UNITS_PER_WORD.
+ (HARD_REGNO_MODE_OK): Same.
+ (CLASS_MAX_NREGS): Same.
+
+2003-10-29 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
+
+ * pa.h (ASM_COMMENT_START): Define.
+
+2003-10-29 Zack Weinberg <zack@codesourcery.com>
+
+ * genmodes.c (complete_mode): Record MODE_CC, MODE_INT,
+ MODE_FLOAT, and MODE_PARTIAL_INT modes as having one
+ component, not zero.
+
+2003-10-29 Andreas Schwab <schwab@suse.de>
+
+ * config/ia64/t-ia64 (LIB2ADDEH): Add $(srcdir)/gthr-gnat.c.
+
+2003-10-29 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * config/sparc/sparc.c (function_arg_partial_nregs) [TARGET_ARCH64]:
+ Never return 1 for complex integral modes whose size is lesser or
+ equal to a word.
+ (function_arg_pass_by_reference) [TARGET_ARCH64]: Mention CTImode
+ in the comment.
+ (function_arg_advance) [TARGET_ARCH64]: Don't special-case complex
+ modes.
+ (sparc_va_arg) [TARGET_ARCH64]: Handle any types whose size is
+ greater than 16 bytes by reference.
+
+2003-10-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * config/ia64/ia64.c (ia64_assemble_integer): Test POINTER_SIZE,
+ not TARGET_ILP32.
+ (ia64_initialize_trampoline): Use globalize_label target call.
+
+2003-10-29 Andreas Schwab <schwab@suse.de>
+
+ * doc/install.texi (Building): Add a sentence about building Ada
+ for a canadian cross.
+
+2003-10-28 Zack Weinberg <zack@codesourcery.com>
+
+ * config/ia64/ia64.c (cmptf_libfunc): New static.
+ (ia64_expand_compare): Add logic to open-code calls to
+ _U_Qfcmp for TFmode comparisons.
+ (ia64_hpux_init_libfuncs): Initialize cmptf_libfunc.
+ Set libfuncs for TFmode eq/ne/gt/ge/lt/gt to 0; these should
+ never be generated anymore.
+ * config/ia64/ia64.md (cmptf): New expander.
+
+2003-10-28 Zack Weinberg <zack@codesourcery.com>
+
+ * ia64.md (UNSPEC_SETF_EXP,UNSPEC_FR_SQRT_RECIP_APPROX): New constants.
+ (*sqrt_approx): New instruction pattern for approximate square roots.
+ (*setf_exp_xf): New instruction pattern for exponentiation.
+ (*maddxf4_alts_truncsf): New instruction pattern for truncation.
+ (sqrtsf2_internal_thr): New define_and_split implementing
+ throughput-optimized inline calculation of SFmode square root.
+ (sqrtdf2_internal_thr): Likewise for DFmode.
+ (sqrtxf2_internal_thr): Likewise for XFmode.
+ (sqrtsf2, sqrtdf2, sqrtxf2): New expanders to choose between
+ latency- and throughput-optimized square root algorithms.
+ * ia64.h (MASK_INLINE_SQRT_LAT, MASK_INLINE_SQRT_THR,
+ TARGET_INLINE_SQRT_LAT, TARGET_INLINE_SQRT_THR, TARGET_INLINE_SQRT):
+ New macros.
+ (TARGET_SWITCHES): Add -minline-sqrt-min-latency and
+ -minline-sqrt-max-throughput.
+ * ia64.c (ia64_override_options): If both -minline-sqrt-min-latency
+ and -minline-sqrt-max-throughput are given, notify the user
+ that both options cannot be used simultaneously.
+ If -minline-sqrt-min-latency is given, notify the user that
+ this mode is not yet implemented.
+ (rtx_needs_barrier): Reformat initial comment to obey
+ 72-character width limit. Support UNSPEC_SETF_EXP and
+ UNSPEC_FR_SQRT_RECIP_APPROX.
+
+2003-10-29 Alan Modra <amodra@bigpond.net.au>
+
+ * config/rs6000/rs6000.md (movdf_softfloat64): Allow dummy ctr,ctr
+ moves.
+
+2003-10-28 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR target/11598
+ PR libgcj/10610
+ * config/rs6000/sysv4.h (PREFERRED_STACK_BOUNDARY): New macro.
+
+2003-10-28 Richard Earnshaw <rearnsha@arm.com>
+
+ * arm.c (arm_output_epilogue): When using a frame pointer, don't emit
+ an extra stack adjustment insn if the stack pointer is already
+ pointing at the right place.
+ (use_return_insn): Allow a return insn to be used when we have a
+ frame pointer if the stack pointer is in the right place.
+ (output_return_instruction): Handle it.
+
+2003-10-28 Andreas Jaeger <aj@suse.de>
+
+ * ggc-zone.c (check_cookies): Add missing variable.
+ Add void to prototypes.
+
+2003-10-27 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * config/mips/irix6-libc-compat.c (inet_makeaddr): Prototype.
+ * crtstuff.c (__do_global_ctors_1): Move prototype.
+ * unwind-dw2.c (NO_SIZE_OF_ENCODED_VALUE): Define when
+ appropriate.
+ * unwind-sjlj.c (_Unwind_GetCFA, _Unwind_FindEnclosingFunction):
+ Mark parameter with __attribute__((unused)).
+
+2003-10-27 Zack Weinberg <zack@codesourcery.com>
+
+ * c-decl.c (pushdecl): Clarify comment.
+
+2003-10-27 Arnaud Charlet <charlet@act-europe.fr>
+
+ * doc/install.texi: Update instructions for Ada cross builds
+
+ PR ada/5909:
+ * doc/sourcebuild.texi: Document Ada test suite.
+
+2003-10-27 Stephane Carrez <stcarrez@nerim.fr>
+
+ * config/m68hc11/m68hc11.c: Convert to ISO C90.
+ * config/m68hc11/m68hc11-protos.h: Likewise.
+
+2003-10-27 Jan Hubicka <jh@suse.cz>
+ Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * toplev.c (enum dump_file_index, dump_file): Fix ordering of
+ webizer pass dump.
+
+2003-10-27 Jakub Jelinek <jakub@redhat.com>
+ Jan Hubicka <jh@suse.cz>
+
+ * reload1.c (struct elim_table): Change offset, initial_offset and
+ previous_offset fields to HOST_WIDE_INT.
+ (offsets_at): Change from int to HOST_WIDE_INT.
+ (reload): Adjust offsets_at initialization.
+ (eliminate_regs_in_insn): Change type of offset to HOST_WIDE_INT.
+ (verify_initial_elim_offsets): Change type of t to HOST_WIDE_INT.
+ * config/i386/i386.c (ix86_compute_frame_layout): Change offset type
+ to HOST_WIDE_INT. Don't save regs using mov for huge frame sizes
+ if TARGET_64BIT.
+ (pro_epilogue_adjust_stack): New function.
+ (ix86_expand_prologue, ix86_expand_epilogue): Use it.
+ * config/i386/i386.md (pro_epilogue_adjust_stack): Remove.
+ (pro_epilogue_adjust_stack_1): Remove * in front of name.
+ (pro_epilogue_adjust_stack_rex64): Handle -2147483648 properly.
+ (pro_epilogue_adjust_stack_rex64_2): New insn.
+
+ * config/i386/i386.c (ix86_expand_epilogue): Fix comment typo.
+
+ * config/i386/i386.c (ix86_expand_call): Replace 40 with
+ FIRST_REX_INT_REG + 3 /* R11 */.
+
+2003-10-26 Richard Henderson <rth@redhat.com>
+
+ * config/alpha/alpha.md (attr cannot_copy): New.
+ (call_osf_2_er, call_value_osf_2_er, ldgp_er_1, ldgp_er_2,
+ prologue_ldgp_er_2, prologue_ldgp_1): Set it.
+ * config/alpha/alpha.c (alpha_cannot_copy_insn_p): Test it.
+
2003-10-26 Daniel Berlin <dberlin@dberlin.org>
* ggc-zone.c: New file, zone allocating collector.
@@ -35,7 +4461,7 @@
2003-10-26 Bernardo Innocenti <bernie@develer.com>
* config/m68k/m68k.c (m68k_output_function_prologue): Eliminate
- num_saved_regs, use current_frame.reg_no instead.
+ num_saved_regs, use current_frame.reg_no instead.
2003-10-26 Bernardo Innocenti <bernie@develer.com>
Paul Dale <pauli@snapgear.com>
@@ -122,9 +4548,9 @@
2003-10-25 Richard Henderson <rth@redhat.com>
- * config/i386/i386.c (ix86_eax_live_at_start_p): New.
- (ix86_expand_prologue): Save and restore eax around stack probe
- if it's live.
+ * config/i386/i386.c (ix86_eax_live_at_start_p): New.
+ (ix86_expand_prologue): Save and restore eax around stack probe
+ if it's live.
2003-10-25 Jan Hubicka <jh@suse.cz>
@@ -322,7 +4748,7 @@
2003-10-24 Danny Smith <dannysmith@users.sourceforge.net>
- * config/i386/cygwin.asm. Add copyright notice. Add comment
+ * config/i386/cygwin.asm: Add copyright notice. Add comment
on why this code is needed.
2003-10-23 Kazu Hirata <kazu@cs.umass.edu>
@@ -455,7 +4881,6 @@
* c-pch.c (struct c_pch_validity): Add pch_init field.
(pch_init): Set it.
(c_common_valid_pch): Check it.
- (get_ident): Bump the PCH version number.
2003-10-22 David Taylor <dtaylor@emc.com>
@@ -1596,7 +6021,7 @@
* config/i386/i386.c (x86_this_parameter): Fix typo.
-2003-10-11 Jan Hubicka <jh@suse.cz>
+203-10-11 Jan Hubicka <jh@suse.cz>
* Makefile.in (web.o): New.
* web.c: New file.
diff --git a/gcc/ChangeLog.7 b/gcc/ChangeLog.7
index c796d0fd23c..f9c6a7dbcb0 100644
--- a/gcc/ChangeLog.7
+++ b/gcc/ChangeLog.7
@@ -12648,7 +12648,7 @@ Thu Mar 28 16:35:31 2002 Jeffrey A Law (law@redhat.com)
Thu Mar 28 19:13:36 CET 2002 Jan Hubicka <jh@suse.cz>
- * ifcvt.c (if_convert): Clear aux_for_blocks early enought.
+ * ifcvt.c (if_convert): Clear aux_for_blocks early enough.
Thu Mar 28 13:21:53 CET 2002 Jan Hubicka <jh@suse.cz>
diff --git a/gcc/Makefile.in b/gcc/Makefile.in
index 81f819c256f..bd65e0bf67e 100644
--- a/gcc/Makefile.in
+++ b/gcc/Makefile.in
@@ -63,7 +63,6 @@ target_noncanonical=@target_noncanonical@
# Sed command to transform gcc to installed name.
program_transform_name = @program_transform_name@
-program_transform_cross_name = @program_transform_name@
# -----------------------------
# Directories used during build
@@ -99,6 +98,18 @@ VPATH = @srcdir@
vpath %.texi $(docdir):$(docdir)/include
+# ----
+# Default values for variables overridden in Makefile fragments.
+# These need to be quite early in the Makefile so as to avoid
+# trouble induced by changes in fragment ordering.
+# ----
+
+# For ada/Make-lang.in; overridden in, for example, config/pa/x-ada.
+X_ADA_CFLAGS =
+T_ADA_CFLAGS =
+X_ADAFLAGS =
+T_ADAFLAGS =
+
# --------
# UNSORTED
# --------
@@ -152,7 +163,7 @@ coverageexts = .{gcda,gcno}
# stage1, as not all versions of gcc understand -Wno-long-long.
LOOSE_WARN = -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes
STRICT_WARN = @strict1_warn@
-STRICT2_WARN = -pedantic -Wno-long-long @WERROR@
+STRICT2_WARN = -pedantic -Wno-long-long -Wold-style-definition @WERROR@
# This is set by --enable-checking. The idea is to catch forgotten
# "extern" tags in header files.
@@ -175,12 +186,16 @@ gengtype-yacc.o-warn = -Wno-error
c-parse.o-warn = -Wno-error
# flex output may yield harmless "no previous prototype" warnings
gengtype-lex.o-warn = -Wno-error
+# SYSCALLS.c misses prototypes
+SYSCALLS.c.X-warn = -Wno-strict-prototypes -Wno-error
# All warnings have to be shut off in stage1 if the compiler used then
# isn't gcc; configure determines that. WARN_CFLAGS will be either
# $(GCC_WARN_CFLAGS), or nothing.
WARN_CFLAGS = @warn_cflags@
+CPPFLAGS = @CPPFLAGS@
+
# These exists to be overridden by the x-* and t-* files, respectively.
X_CFLAGS =
T_CFLAGS =
@@ -188,7 +203,6 @@ T_CFLAGS =
X_CPPFLAGS =
T_CPPFLAGS =
-ADAC = @ADAC@
AWK = @AWK@
CC = @CC@
BISON = @BISON@
@@ -275,7 +289,7 @@ GCC_FOR_TARGET = $(STAGE_CC_WRAPPER) ./xgcc -B./ -B$(build_tooldir)/bin/ -isyste
# This is used instead of ALL_CFLAGS when compiling with GCC_FOR_TARGET.
# It omits XCFLAGS, and specifies -B./.
# It also specifies -isystem ./include to find, e.g., stddef.h.
-GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -isystem ./include $(TCFLAGS)
+GCC_CFLAGS=$(INTERNAL_CFLAGS) $(X_CFLAGS) $(T_CFLAGS) $(LOOSE_WARN) -Wold-style-definition $($@-warn) -isystem ./include $(TCFLAGS)
# ---------------------------------------------------
# Programs which produce files for the target machine
@@ -288,7 +302,7 @@ AR_FOR_TARGET = ` \
if [ "$(host)" = "$(target)" ] ; then \
echo ar; \
else \
- t='$(program_transform_cross_name)'; echo ar | sed -e $$t ; \
+ t='$(program_transform_name)'; echo ar | sed -e $$t ; \
fi; \
fi`
AR_FLAGS_FOR_TARGET =
@@ -301,7 +315,7 @@ RANLIB_FOR_TARGET = ` \
if [ "$(host)" = "$(target)" ] ; then \
echo $(RANLIB); \
else \
- t='$(program_transform_cross_name)'; echo ranlib | sed -e $$t ; \
+ t='$(program_transform_name)'; echo ranlib | sed -e $$t ; \
fi; \
fi`
NM_FOR_TARGET = ` \
@@ -313,7 +327,7 @@ NM_FOR_TARGET = ` \
if [ "$(host)" = "$(target)" ] ; then \
echo nm; \
else \
- t='$(program_transform_cross_name)'; echo nm | sed -e $$t ; \
+ t='$(program_transform_name)'; echo nm | sed -e $$t ; \
fi; \
fi`
@@ -366,6 +380,7 @@ host_xm_defines=@host_xm_defines@
xm_file_list=@xm_file_list@
xm_include_list=@xm_include_list@
xm_defines=@xm_defines@
+lang_checks=check-gcc
lang_opt_files=@lang_opt_files@ $(srcdir)/c.opt $(srcdir)/common.opt
lang_specs_files=@lang_specs_files@
lang_tree_files=@lang_tree_files@
@@ -588,12 +603,6 @@ UNPROTOIZE_INSTALL_NAME = `echo unprotoize|sed '$(program_transform_name)'`
GCOV_INSTALL_NAME = `echo gcov|sed '$(program_transform_name)'`
GCCBUG_INSTALL_NAME = `echo gccbug|sed '$(program_transform_name)'`
-# Actual name to use when installing a cross-compiler.
-GCC_CROSS_NAME = `echo gcc|sed '$(program_transform_cross_name)'`
-CPP_CROSS_NAME = `echo cpp|sed '$(program_transform_cross_name)'`
-PROTOIZE_CROSS_NAME = `echo protoize|sed '$(program_transform_cross_name)'`
-UNPROTOIZE_CROSS_NAME = `echo unprotoize|sed '$(program_transform_cross_name)'`
-
# Setup the testing framework, if you have one
EXPECT = `if [ -f $${rootme}/../expect/expect ] ; then \
echo $${rootme}/../expect/expect ; \
@@ -843,22 +852,22 @@ OBJS-common = \
cfgloopanal.o cfgloopmanip.o loop-init.o loop-unswitch.o loop-unroll.o \
cfgrtl.o combine.o conflict.o convert.o coverage.o cse.o cselib.o \
dbxout.o debug.o df.o diagnostic.o dojump.o doloop.o dominance.o \
- dwarf2asm.o dwarf2out.o dwarfout.o emit-rtl.o except.o explow.o \
+ dwarf2asm.o dwarf2out.o emit-rtl.o except.o explow.o \
expmed.o expr.o final.o flow.o fold-const.o function.o gcse.o \
genrtl.o ggc-common.o global.o graph.o gtype-desc.o \
haifa-sched.o hooks.o ifcvt.o insn-attrtab.o insn-emit.o insn-modes.o \
insn-extract.o insn-opinit.o insn-output.o insn-peep.o insn-recog.o \
integrate.o intl.o jump.o langhooks.o lcm.o lists.o local-alloc.o \
loop.o optabs.o options.o opts.o params.o postreload.o predict.o \
- print-rtl.o print-tree.o value-prof.o \
+ print-rtl.o print-tree.o value-prof.o \
profile.o ra.o ra-build.o ra-colorize.o ra-debug.o ra-rewrite.o \
real.o recog.o reg-stack.o regclass.o regmove.o regrename.o \
reload.o reload1.o reorg.o resource.o rtl.o rtlanal.o rtl-error.o \
sbitmap.o sched-deps.o sched-ebb.o sched-rgn.o sched-vis.o sdbout.o \
- sibcall.o simplify-rtx.o sreal.o ssa.o ssa-ccp.o ssa-dce.o stmt.o \
- stor-layout.o stringpool.o targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o \
- unroll.o varasm.o varray.o version.o vmsdbgout.o xcoffout.o \
- alloc-pool.o et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o
+ sibcall.o simplify-rtx.o sreal.o stmt.o stor-layout.o stringpool.o \
+ targhooks.o timevar.o toplev.o tracer.o tree.o tree-dump.o unroll.o \
+ varasm.o varray.o version.o vmsdbgout.o xcoffout.o alloc-pool.o \
+ et-forest.o cfghooks.o bt-load.o pretty-print.o $(GGC) web.o
OBJS-md = $(out_object_file)
OBJS-archive = $(EXTRA_OBJS) $(host_hook_obj) hashtable.o tree-inline.o \
@@ -926,7 +935,7 @@ LIB2_DIVMOD_FUNCS = _divdi3 _moddi3 _udivdi3 _umoddi3 _udiv_w_sdiv _udivmoddi4
# all.cross, start.encap, rest.encap,
# install-normal, install-common, install-info, install-man,
# uninstall,
-# mostlyclean, clean, distclean, extraclean, maintainer-clean,
+# mostlyclean, clean, distclean, maintainer-clean,
# stage1, stage2, stage3, stage4
#
# Each language is linked in with a series of hooks. The name of each
@@ -951,6 +960,7 @@ endif
Makefile: config.status $(srcdir)/Makefile.in $(srcdir)/version.c $(LANG_MAKEFRAGS)
LANGUAGES="$(CONFIG_LANGUAGES)" \
CONFIG_HEADERS= \
+ CONFIG_SHELL="$(SHELL)" \
CONFIG_FILES=$@ $(SHELL) config.status
config.h: cs-config.h ; @true
@@ -1312,7 +1322,7 @@ c-convert.o : c-convert.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H)
c-pragma.o: c-pragma.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
function.h c-pragma.h toplev.h output.h $(GGC_H) $(TM_P_H) $(C_COMMON_H) gt-c-pragma.h
graph.o: graph.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h flags.h output.h \
- $(RTL_H) function.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h
+ $(RTL_H) function.h langhooks.h hard-reg-set.h $(BASIC_BLOCK_H) graph.h $(TREE_H)
sbitmap.o: sbitmap.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h \
hard-reg-set.h $(BASIC_BLOCK_H)
@@ -1451,7 +1461,7 @@ version.o: version.c version.h
gtype-desc.o: gtype-desc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) varray.h \
$(HASHTAB_H) $(TREE_H) $(RTL_H) function.h insn-config.h $(EXPR_H) $(OPTABS_H) \
libfuncs.h debug.h $(GGC_H) bitmap.h $(BASIC_BLOCK_H) hard-reg-set.h \
- ssa.h cselib.h insn-addr.h
+ cselib.h insn-addr.h
ggc-common.o: ggc-common.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GGC_H) \
$(HASHTAB_H) toplev.h $(PARAMS_H) hosthooks.h
@@ -1506,7 +1516,7 @@ diagnostic.o : diagnostic.c $(DIAGNOSTIC_H) real.h \
$(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(TM_P_H) flags.h $(GGC_H) \
input.h toplev.h intl.h langhooks.h $(LANGHOOKS_DEF_H)
opts.o : opts.c opts.h options.h toplev.h $(CONFIG_H) $(SYSTEM_H) \
- coretypes.h $(TREE_H) $(TM_H) $(LANGHOOKS_H) $(GGC_H) $(RTL_H) \
+ coretypes.h $(TREE_H) $(TM_H) langhooks.h $(GGC_H) $(RTL_H) \
output.h $(DIAGNOSTIC_H) $(TM_P_H) $(INSN_ATTR_H) intl.h
targhooks.o : targhooks.c targhooks.h $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TREE_H) $(TM_H) $(RTL_H) $(TM_P_H) function.h \
@@ -1517,7 +1527,7 @@ toplev.o : toplev.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_
debug.h insn-config.h intl.h $(RECOG_H) Makefile toplev.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) value-prof.h \
- ssa.h $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
+ $(PARAMS_H) $(TM_P_H) reload.h dwarf2asm.h $(TARGET_H) \
langhooks.h insn-flags.h cfglayout.h real.h cfgloop.h \
hosthooks.h $(LANGHOOKS_DEF_H) cgraph.h $(COVERAGE_H)
$(CC) $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
@@ -1535,10 +1545,11 @@ rtl.o : rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(GTM_H) $(RTL_H) real.h \
$(GGC_H) errors.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
-print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
- hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H)
-rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) \
- hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h
+print-rtl.o : print-rtl.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
+ $(RTL_H) $(TREE_H) hard-reg-set.h $(BASIC_BLOCK_H) real.h $(TM_P_H)
+rtlanal.o : rtlanal.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h \
+ $(RTL_H) hard-reg-set.h $(TM_P_H) insn-config.h $(RECOG_H) real.h flags.h \
+ $(BASIC_BLOCK_H)
errors.o : errors.c $(CONFIG_H) $(SYSTEM_H) errors.h
$(CC) -c $(ALL_CFLAGS) -DGENERATOR_FILE $(ALL_CPPFLAGS) $(INCLUDES) $< $(OUTPUT_OPTION)
@@ -1563,7 +1574,7 @@ except.o : except.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
expr.o : expr.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) flags.h \
function.h $(REGS_H) $(EXPR_H) $(OPTABS_H) libfuncs.h $(INSN_ATTR_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) langhooks.h intl.h $(TM_P_H) real.h
+ except.h reload.h $(GGC_H) langhooks.h intl.h $(TM_P_H) real.h $(TARGET_H)
dojump.o : dojump.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h function.h $(EXPR_H) $(OPTABS_H) $(INSN_ATTR_H) insn-config.h \
langhooks.h
@@ -1579,7 +1590,7 @@ expmed.o : expmed.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_
toplev.h $(TM_P_H) langhooks.h
explow.o : explow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h hard-reg-set.h insn-config.h $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
- toplev.h function.h $(GGC_H) $(TM_P_H) gt-explow.h
+ toplev.h function.h $(GGC_H) $(TM_P_H) langhooks.h gt-explow.h
optabs.o : optabs.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
flags.h insn-config.h $(EXPR_H) $(OPTABS_H) libfuncs.h $(RECOG_H) reload.h \
toplev.h $(GGC_H) real.h $(TM_P_H) except.h gt-optabs.h $(BASIC_BLOCK_H) \
@@ -1593,9 +1604,6 @@ sdbout.o : sdbout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) $(RTL_
flags.h function.h $(EXPR_H) output.h hard-reg-set.h $(REGS_H) real.h \
insn-config.h xcoffout.h c-pragma.h $(GGC_H) $(TARGET_H) \
sdbout.h toplev.h $(TM_P_H) except.h debug.h langhooks.h gt-sdbout.h
-dwarfout.o : dwarfout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
- $(RTL_H) dwarf.h flags.h insn-config.h reload.h output.h toplev.h $(TM_P_H) \
- debug.h langhooks.h $(TARGET_H)
dwarf2out.o : dwarf2out.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(RTL_H) dwarf2.h debug.h flags.h insn-config.h reload.h output.h $(DIAGNOSTIC_H) real.h \
hard-reg-set.h $(REGS_H) $(EXPR_H) libfuncs.h toplev.h dwarf2out.h varray.h \
@@ -1643,7 +1651,8 @@ web.o : web.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h $(BASIC_BLOCK_H) function.h output.h toplev.h df.h
gcse.o : gcse.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) \
hard-reg-set.h flags.h real.h insn-config.h $(GGC_H) $(RECOG_H) $(EXPR_H) \
- $(BASIC_BLOCK_H) function.h output.h toplev.h $(TM_P_H) $(PARAMS_H) except.h gt-gcse.h
+ $(BASIC_BLOCK_H) function.h langhooks.h output.h toplev.h $(TM_P_H) $(PARAMS_H) \
+ except.h gt-gcse.h $(TREE_H)
sibcall.o : sibcall.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_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) coretypes.h \
@@ -1652,14 +1661,6 @@ resource.o : resource.c $(CONFIG_H) $(RTL_H) hard-reg-set.h $(SYSTEM_H) coretype
lcm.o : lcm.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_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) $(TM_P_H) df.h function.h
-ssa.o : ssa.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(REGS_H) varray.h \
- $(EXPR_H) hard-reg-set.h flags.h function.h real.h insn-config.h $(RECOG_H) \
- $(BASIC_BLOCK_H) output.h ssa.h
-ssa-dce.o : ssa-dce.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
- $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h
-ssa-ccp.o : ssa-ccp.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) hard-reg-set.h \
- $(BASIC_BLOCK_H) ssa.h insn-config.h $(RECOG_H) output.h \
- errors.h $(GGC_H) df.h function.h
df.o : df.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) \
insn-config.h $(RECOG_H) function.h $(REGS_H) alloc-pool.h hard-reg-set.h \
$(BASIC_BLOCK_H) df.h $(FIBHEAP_H)
@@ -1685,7 +1686,7 @@ unroll.o : unroll.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) insn-co
alloc-pool.o : alloc-pool.c $(CONFIG_H) $(SYSTEM_H) alloc-pool.h
flow.o : flow.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_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) function.h except.h $(EXPR_H) ssa.h $(GGC_H) $(TM_P_H)
+ $(RECOG_H) function.h except.h $(EXPR_H) $(GGC_H) $(TM_P_H)
cfg.o : cfg.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) flags.h insn-config.h \
$(BASIC_BLOCK_H) $(REGS_H) hard-reg-set.h output.h toplev.h $(RECOG_H) \
function.h except.h $(GGC_H) $(TM_P_H) alloc-pool.h
@@ -1811,10 +1812,10 @@ predict.o: predict.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE
$(PARAMS_H) $(TARGET_H) cfgloop.h $(COVERAGE_H)
lists.o: lists.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) toplev.h $(RTL_H) $(GGC_H)
bb-reorder.o : bb-reorder.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
- $(RTL_H) $(BASIC_BLOCK_H) flags.h output.h cfglayout.h $(FIBHEAP_H) \
+ $(RTL_H) $(BASIC_BLOCK_H) flags.h timevar.h output.h cfglayout.h $(FIBHEAP_H) \
$(TARGET_H)
tracer.o : tracer.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(RTL_H) $(TREE_H) \
- $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h \
+ $(BASIC_BLOCK_H) hard-reg-set.h output.h cfglayout.h flags.h timevar.h \
$(PARAMS_H) $(COVERAGE_H)
cfglayout.o : cfglayout.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
$(RTL_H) $(TREE_H) insn-config.h $(BASIC_BLOCK_H) hard-reg-set.h output.h \
@@ -2051,7 +2052,7 @@ GTFILES = $(srcdir)/input.h $(srcdir)/coretypes.h $(srcdir)/cpplib.h \
$(host_xm_file_list) $(tm_file_list) $(HASHTAB_H) $(SPLAY_TREE_H) \
$(srcdir)/bitmap.h $(srcdir)/coverage.c $(srcdir)/function.h $(srcdir)/rtl.h \
$(srcdir)/optabs.h $(srcdir)/tree.h $(srcdir)/libfuncs.h $(srcdir)/hashtable.h \
- $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/ssa.h $(srcdir)/insn-addr.h \
+ $(srcdir)/real.h $(srcdir)/varray.h $(srcdir)/insn-addr.h \
$(srcdir)/cselib.h $(srcdir)/basic-block.h $(srcdir)/cgraph.h \
$(srcdir)/c-common.h $(srcdir)/c-tree.h \
$(srcdir)/alias.c $(srcdir)/bitmap.c $(srcdir)/cselib.c $(srcdir)/cgraph.c \
@@ -2656,11 +2657,10 @@ TEXI_CPPINT_FILES = cppinternals.texi
# patterns. To use them, put each of the specific target with with their
# specific dependencies but no build commands.
-$(docobjdir)/cpp.info cpp.dvi: $(TEXI_CPP_FILES)
-$(docobjdir)/gcc.info gcc.dvi: $(TEXI_GCC_FILES)
-$(docobjdir)/gccint.info gccint.dvi: $(TEXI_GCCINT_FILES)
-$(docobjdir)/gccinstall.info gccinstall.dvi: $(TEXI_GCCINSTALL_FILES)
-$(docobjdir)/cppinternals.info cppinternals.dvi: $(TEXI_CPPINT_FILES)
+$(docobjdir)/cpp.info: $(TEXI_CPP_FILES)
+$(docobjdir)/gcc.info: $(TEXI_GCC_FILES)
+$(docobjdir)/gccint.info: $(TEXI_GCCINT_FILES)
+$(docobjdir)/cppinternals.info: $(TEXI_CPPINT_FILES)
$(docobjdir)/%.info: %.texi stmp-docobjdir
if [ x$(BUILD_INFO) = xinfo ]; then \
@@ -2668,14 +2668,28 @@ $(docobjdir)/%.info: %.texi stmp-docobjdir
-I $(docdir)/include -o $@ $<; \
fi
-dvi:: gcc.dvi gccint.dvi gccinstall.dvi cpp.dvi cppinternals.dvi
+# Duplicate entry to handle renaming of gccinstall.info
+$(docobjdir)/gccinstall.info: $(TEXI_GCCINSTALL_FILES) stmp-docobjdir
+ if [ x$(BUILD_INFO) = xinfo ]; then \
+ $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir) \
+ -I $(docdir)/include -o $@ $<; \
+ fi
+
+$(docobjdir)/cpp.dvi: $(TEXI_CPP_FILES)
+$(docobjdir)/gcc.dvi: $(TEXI_GCC_FILES)
+$(docobjdir)/gccint.dvi: $(TEXI_GCCINT_FILES)
+$(docobjdir)/cppinternals.dvi: $(TEXI_CPPINT_FILES)
+
+dvi:: $(docobjdir)/gcc.dvi $(docobjdir)/gccint.dvi \
+ $(docobjdir)/gccinstall.dvi $(docobjdir)/cpp.dvi \
+ $(docobjdir)/cppinternals.dvi
-%.dvi: %.texi stmp-docobjdir
- $(TEXI2DVI) -I $(docdir) -I $(docdir)/include $<
+$(docobjdir)/%.dvi: %.texi stmp-docobjdir
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include -o $@ $<
-gccinstall.dvi:
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- $(TEXI2DVI) -I $$s/doc -I $$s/doc/include -o $@ $$s/doc/install.texi
+# Duplicate entry to handle renaming of gccinstall.dvi
+$(docobjdir)/gccinstall.dvi: $(TEXI_GCCINSTALL_FILES) stmp-docobjdir
+ $(TEXI2DVI) -I $(docdir) -I $(docdir)/include -o $@ $<
generated-manpages:: $(docobjdir)/gcov.1 $(docobjdir)/cpp.1 \
$(docobjdir)/gcc.1 $(docobjdir)/gfdl.7 $(docobjdir)/gpl.7 \
@@ -2817,24 +2831,6 @@ distclean: clean lang.distclean
-if [ ! -f po/exgettext ]; then rm -f po/*.gmo; fi
-rmdir ada cp f java objc fixinc intl po testsuite 2>/dev/null
-# Delete anything likely to be found in the source directory
-# that shouldn't be in the distribution.
-extraclean: distclean lang.extraclean
- -rm -rf =* ./"#"* *~* config/=* config/"#"* config/*~*
- -rm -f patch* *.orig *.rej config/patch* config/*.orig config/*.rej
- -rm -f config/*/=* config/*/"#"* config/*/*~*
- -rm -f config/*/*.orig config/*/*.rej
- -rm -f *.dvi *.ps *.oaux *.d *.[zZ] *.gz
- -rm -f *.tar *.xtar *diff *.diff.* *.tar.* *.xtar.* *diffs
- -rm -f *lose config/*lose config/*/*lose
- -rm -f *.s *.s[0-9] *.i config/ChangeLog
- -rm -f y.tab.c yacc.*
- -rm -f */=* */"#"* */*~*
- -rm -f */patch* */*.orig */*.rej
- -rm -f */*.dvi */*.oaux */*.d */*.[zZ] */*.gz
- -rm -f */*.tar */*.xtar */*diff */*.diff.* */*.tar.* */*.xtar.* */*diffs
- -rm -f */*lose */*.s */*.s[0-9] */*.i
-
# Get rid of every file that's generated from some other file, except for `configure'.
# Most of these files ARE PRESENT in the GCC distribution.
maintainer-clean:
@@ -2861,21 +2857,12 @@ install: install-common $(INSTALL_HEADERS) $(INSTALL_LIBGCC) \
# Handle cpp installation.
install-cpp: cpp$(exeext)
- -if [ -f gcc-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext); \
- if [ x$(cpp_install_dir) != x ]; then \
- rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
- else true; fi; \
- else \
- rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext); \
- if [ x$(cpp_install_dir) != x ]; then \
- rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
- else true; fi; \
- fi
+ -rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
+ -$(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
+ -if [ x$(cpp_install_dir) != x ]; then \
+ rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) -m 755 cpp$(exeext) $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
+ else true; fi
# Create the installation directories.
# $(libdir)/gcc/include isn't currently searched by cpp.
@@ -2918,22 +2905,14 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs
chmod a-x $(DESTDIR)$(libsubdir)/specs; \
fi
# Install protoize if it was compiled.
- -if [ -f protoize$(exeext) ]; \
- then \
- if [ -f gcc-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext); \
- else \
- rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
- fi ; \
- rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
- $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
- chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
+ -if [ -f protoize$(exeext) ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) protoize$(exeext) $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext); \
+ rm -f $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) unprotoize$(exeext) $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext); \
+ rm -f $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
+ $(INSTALL_DATA) SYSCALLS.c.X $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
+ chmod a-x $(DESTDIR)$(libsubdir)/SYSCALLS.c.X; \
fi
# Install gcov if it was compiled.
-if [ -f gcov$(exeext) ]; \
@@ -2947,22 +2926,17 @@ install-common: native $(EXTRA_PARTS) lang.install-common installdirs
# $(target_noncanonical)-gcc-$(version)
# and also as either gcc (if native) or $(gcc_tooldir)/bin/gcc.
install-driver: installdirs xgcc$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
+ -$(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version)
+ -( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) )
-if [ -f gcc-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_CROSS_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \
if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
rm -f $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
$(INSTALL_PROGRAM) gcc-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/gcc$(exeext); \
else true; fi; \
else \
- rm -f $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) xgcc$(exeext) $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-$(version); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-$(version) ); \
rm -f $(DESTDIR)$(bindir)/$(target_noncanonical)-gcc-tmp$(exeext); \
( cd $(DESTDIR)$(bindir) && \
$(LN) $(GCC_INSTALL_NAME)$(exeext) $(target_noncanonical)-gcc-tmp$(exeext) && \
@@ -2976,6 +2950,7 @@ install-info:: doc installdirs \
$(DESTDIR)$(infodir)/cpp.info \
$(DESTDIR)$(infodir)/gcc.info \
$(DESTDIR)$(infodir)/cppinternals.info \
+ $(DESTDIR)$(infodir)/gccinstall.info \
$(DESTDIR)$(infodir)/gccint.info
$(DESTDIR)$(infodir)/%.info: $(docobjdir)/%.info installdirs
@@ -2990,22 +2965,16 @@ $(DESTDIR)$(infodir)/%.info: $(docobjdir)/%.info installdirs
-if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then \
if [ -f $(DESTDIR)$(infodir)/dir ] ; then \
if [ -f $@ ]; then \
- install-info --dir-file=$(DESTDIR)$(infodir)/dir $@ \
+ install-info --dir-file=$(DESTDIR)$(infodir)/dir $@; \
else true; fi; \
else true; fi; \
else true; fi;
# Install the man pages.
install-man: installdirs $(GENERATED_MANPAGES) lang.install-man
- -if [ -f gcc-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext); \
- else \
- rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext); \
- fi
+ -rm -f $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
+ -$(INSTALL_DATA) $(docobjdir)/gcc.1 $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
+ -chmod a-x $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
-rm -f $(DESTDIR)$(man1dir)/cpp$(man1ext)
-$(INSTALL_DATA) $(docobjdir)/cpp.1 $(DESTDIR)$(man1dir)/cpp$(man1ext)
-chmod a-x $(DESTDIR)$(man1dir)/cpp$(man1ext)
@@ -3136,20 +3105,14 @@ uninstall: lang.uninstall
-rm -rf $(DESTDIR)$(libsubdir)
-rm -rf $(DESTDIR)$(libexecsubdir)
-rm -rf $(DESTDIR)$(bindir)/$(GCC_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(GCC_CROSS_NAME)$(exeext)
-rm -f $(DESTDIR)$(bindir)/$(CPP_INSTALL_NAME)$(exeext)
- -rm -f $(DESTDIR)$(bindir)/$(CPP_CROSS_NAME)$(exeext)
-if [ x$(cpp_install_dir) != x ]; then \
rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_INSTALL_NAME)$(exeext); \
- rm -f $(DESTDIR)$(prefix)/$(cpp_install_dir)/$(CPP_CROSS_NAME)$(exeext); \
else true; fi
-rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(PROTOIZE_CROSS_NAME)$(exeext)
-rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(UNPROTOIZE_CROSS_NAME)$(exeext)
-rm -rf $(DESTDIR)$(bindir)/$(GCOV_INSTALL_NAME)$(exeext)
-rm -rf $(DESTDIR)$(man1dir)/$(GCC_INSTALL_NAME)$(man1ext)
- -rm -rf $(DESTDIR)$(man1dir)/$(GCC_CROSS_NAME)$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/cpp$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/protoize$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/unprotoize$(man1ext)
@@ -3224,10 +3187,6 @@ site.exp: ./config.status Makefile
CHECK_TARGETS = check-gcc @check_languages@
-check-c++ : check-g++
-check-f77 : check-g77
-check-java :
-
check: $(CHECK_TARGETS)
# The idea is to parallelize testing of multilibs, for example:
@@ -3235,7 +3194,8 @@ check: $(CHECK_TARGETS)
# will run 3 concurrent sessions of check-gcc, eventually testing
# all 10 combinations. GNU make is required, as is a shell that expands
# alternations within braces.
-check-gcc//% check-g++//% check-g77//% check-objc//%: site.exp
+lang_checks_parallel = $(lang_checks:=//%)
+$(lang_checks_parallel): site.exp
target=`echo "$@" | sed 's,//.*,,'`; \
variant=`echo "$@" | sed 's,^[^/]*//,,'`; \
vardots=`echo "$$variant" | sed 's,/,.,g'`; \
@@ -3250,7 +3210,7 @@ $(TESTSUITEDIR)/site.exp: site.exp
-rm -f $@
sed '/set tmpdir/ s|testsuite|$(TESTSUITEDIR)|' < site.exp > $@
-check-g++ check-gcc check-g77 check-objc: check-% : $(TESTSUITEDIR)/site.exp
+$(lang_checks): check-% : $(TESTSUITEDIR)/site.exp
-(rootme=`${PWD_COMMAND}`; export rootme; \
srcdir=`cd ${srcdir}; ${PWD_COMMAND}` ; export srcdir ; \
cd $(TESTSUITEDIR); \
@@ -3335,18 +3295,19 @@ paranoia: paranoia.o real.o $(LIBIBERTY)
# Update the tags table.
TAGS: lang.tags
- (cd $(srcdir); \
- incs= ; \
- list='$(SUBDIRS)'; for dir in $$list; do \
- if test -f $$dir/TAGS; then \
- incs="$$incs --include $$dir/TAGS"; \
- fi; \
- done; \
- mkdir tmp-tags; \
- mv -f c-parse.[ch] tmp-tags; \
- etags *.y *.h *.c $$incs; \
- mv tmp-tags/* .; \
- rmdir tmp-tags)
+ (cd $(srcdir); \
+ incs= ; \
+ list='$(SUBDIRS)'; for dir in $$list; do \
+ if test -f $$dir/TAGS; then \
+ incs="$$incs --include $$dir/TAGS.sub"; \
+ fi; \
+ done; \
+ mkdir tmp-tags; \
+ mv -f c-parse.[ch] tmp-tags; \
+ etags -o TAGS.sub *.y *.h *.c; \
+ mv tmp-tags/* .; \
+ rmdir tmp-tags; \
+ etags --include TAGS.sub $$incs)
# ------------------------------------------------------
# Bootstrap-related targets (not used during 'make all')
@@ -3360,7 +3321,7 @@ VOL_FILES=`echo $(BACKEND) $(OBJS) $(C_OBJS) $(LIBCPP_OBJS) *.c *.h gen*`
# the context of the stage_x rule.
POSTSTAGE1_FLAGS_TO_PASS = \
- ADAC="\$$(CC)" \
+ ADAFLAGS="$(BOOT_ADAFLAGS)" \
CFLAGS="$(BOOT_CFLAGS)" \
LDFLAGS="$(BOOT_LDFLAGS)" \
WARN_CFLAGS="\$$(GCC_WARN_CFLAGS)" \
@@ -3589,25 +3550,7 @@ fastcompare fastcompare3 fastcompare4 fastcompare-lean fastcompare3-lean fastcom
gnucompare gnucompare3 gnucompare4 gnucompare-lean gnucompare3-lean gnucompare4-lean: force
-rm -f .bad_compare
case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
- for file in *$(objext); do \
- case "$@" in \
- slowcompare* ) \
- tail +16c ./$$file > tmp-foo1; \
- tail +16c stage$$stage/$$file > tmp-foo2 \
- && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $$file differs >> .bad_compare) || true; \
- ;; \
- fastcompare* ) \
- cmp $$file stage$$stage/$$file 16 16 > /dev/null 2>&1; \
- test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
- ;; \
- gnucompare* ) \
- cmp --ignore-initial=16 $$file stage$$stage/$$file > /dev/null 2>&1; \
- test $$? -eq 1 && echo $$file differs >> .bad_compare || true; \
- ;; \
- esac ; \
- done
- case "$@" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo $@ | sed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
- for dir in tmp-foo $(SUBDIRS); do \
+ for dir in . $(SUBDIRS); do \
if [ "`echo $$dir/*$(objext)`" != "$$dir/*$(objext)" ] ; then \
for file in $$dir/*$(objext); do \
case "$@" in \
diff --git a/gcc/README.Portability b/gcc/README.Portability
index d50947a4349..2724f2a53fd 100644
--- a/gcc/README.Portability
+++ b/gcc/README.Portability
@@ -14,18 +14,15 @@ I'm going to start from a base of the ISO C89 standard, since that is
probably what most people code to naturally. Obviously using
constructs introduced after that is not a good idea.
-The first section of this file deals strictly with portability issues,
-the second with common coding pitfalls, and the third with obsolete
-K+R portability issues.
+For the complete coding style conventions used in GCC, please read
+http://gcc.gnu.org/codingconventions.html
- Portability Issues
- ==================
-
String literals
---------------
-Some SGI compilers choke on the parentheses in:-
+Irix6 "cc -n32" and OSF4 "cc" have problems with constant string
+initializers with parens around it, e.g.
const char string[] = ("A string");
@@ -176,7 +173,7 @@ WITH UMLAUT.
Other common pitfalls
---------------------
-o Expecting 'plain' char to be either sign or unsigned extending
+o Expecting 'plain' char to be either sign or unsigned extending.
o Shifting an item by a negative amount or by greater than or equal to
the number of bits in a type (expecting shifts by 32 to be sensible
@@ -198,204 +195,3 @@ o Passing incorrect types to fprintf and friends.
o Adding a function declaration for a module declared in another file to
a .c file instead of to a .h file.
-
- K+R Portability Issues
- ======================
-
-Unary +
--------
-
-K+R C compilers and preprocessors have no notion of unary '+'. Thus
-the following code snippet contained 2 portability problems.
-
-int x = +2; /* int x = 2; */
-#if +1 /* #if 1 */
-#endif
-
-
-Pointers to void
-----------------
-
-K+R C compilers did not have a void pointer, and used char * as the
-pointer to anything. The macro PTR is defined as either void * or
-char * depending on whether you have a standards compliant compiler or
-a K+R one. Thus
-
- free ((void *) h->value.expansion);
-
-should have been written
-
- free ((PTR) h->value.expansion);
-
-Further, an initial investigation indicates that pointers to functions
-returning void were okay. Thus the example given by "Calling
-functions through pointers to functions" below appeared not to cause a
-problem.
-
-
-String literals
----------------
-
-K+R C did not allow concatenation of string literals like
-
- "This is a " "single string literal".
-
-
-signed keyword
---------------
-
-The signed keyword did not exist in K+R compilers; it was introduced
-in ISO C89, so you could not use it. In both K+R and standard C,
-unqualified char and bitfields may be signed or unsigned. There is no
-way to portably declare signed chars or signed bitfields.
-
-All other arithmetic types are signed unless you use the 'unsigned'
-qualifier. For instance, it was safe to write
-
- short paramc;
-
-instead of
-
- signed short paramc;
-
-If you have an algorithm that depends on signed char or signed
-bitfields, you had to find another way to write it before it could be
-integrated into GCC.
-
-
-Function prototypes
--------------------
-
-You need to provide a function prototype for every function before you
-use it, and functions had to be defined K+R style. The function
-prototype should have used the PARAMS macro, which takes a single
-argument. Therefore the parameter list had to be enclosed in
-parentheses. For example,
-
-int myfunc PARAMS ((double, int *));
-
-int
-myfunc (var1, var2)
- double var1;
- int *var2;
-{
- ...
-}
-
-This implies that if the function takes no arguments, it had to be
-declared and defined as follows:
-
-int myfunc PARAMS ((void));
-
-int
-myfunc ()
-{
- ...
-}
-
-You also had to use PARAMS when referring to function protypes in
-other circumstances, for example see "Calling functions through
-pointers to functions" below.
-
-Variable-argument functions are best described by example:-
-
-void cpp_ice PARAMS ((cpp_reader *, const char *msgid, ...));
-
-void
-cpp_ice VPARAMS ((cpp_reader *pfile, const char *msgid, ...))
-{
- VA_OPEN (ap, msgid);
- VA_FIXEDARG (ap, cpp_reader *, pfile);
- VA_FIXEDARG (ap, const char *, msgid);
-
- ...
- VA_CLOSE (ap);
-}
-
-See ansidecl.h for the definitions of the above macros and more.
-
-One aspect of using K+R style function declarations, is you could not
-have arguments whose types are char, short, or float, since without
-prototypes (ie, K+R rules), these types are promoted to int, int, and
-double respectively.
-
-Calling functions through pointers to functions
------------------------------------------------
-
-K+R C compilers require parentheses around the dereferenced function
-pointer expression in the call, whereas ISO C relaxes the syntax. For
-example
-
-typedef void (* cl_directive_handler) PARAMS ((cpp_reader *, const char *));
- *p->handler (pfile, p->arg);
-
-had to become
-
- (*p->handler) (pfile, p->arg);
-
-
-Macros
-------
-
-The rules under K+R C and ISO C for achieving stringification and
-token pasting are quite different. Therefore some macros have been
-defined which will get it right depending upon the compiler.
-
- CONCAT2(a,b) CONCAT3(a,b,c) and CONCAT4(a,b,c,d)
-
-will paste the tokens passed as arguments. You must not leave any
-space around the commas. Also,
-
- STRINGX(x)
-
-will stringify an argument; to get the same result on K+R and ISO
-compilers x should not have spaces around it.
-
-
-Passing structures by value
----------------------------
-
-You had to avoid passing structures by value, either to or from
-functions. It seems some K+R compilers handle this differently or not
-at all.
-
-
-Enums
------
-
-In K+R C, you had to cast enum types to use them as integers, and some
-compilers in particular give lots of warnings for using an enum as an
-array index.
-
-
-Bitfields
----------
-
-See also "signed keyword" above. In K+R C only unsigned int bitfields
-were defined (i.e. unsigned char, unsigned short, unsigned long.
-Using plain int/short/long was not allowed).
-
-
-Reserved Keywords
------------------
-
-K+R C has "entry" as a reserved keyword, so you had to not use it for
-your variable names.
-
-
-Type promotions
----------------
-
-K+R used unsigned-preserving rules for arithmetic expresssions, while
-ISO uses value-preserving. This means an unsigned char compared to an
-int is done as an unsigned comparison in K+R (since unsigned char
-promotes to unsigned) while it is signed in ISO (since all of the
-values in unsigned char fit in an int, it promotes to int).
-
-
-Suffixes on Integer Constants
------------------------------
-
-K+R C did not accept a 'u' suffix on integer constants. If you wanted
-to declare a constant to be be unsigned, you had to use an explicit
-cast.
diff --git a/gcc/aclocal.m4 b/gcc/aclocal.m4
index ca7fa5c608d..788db372e19 100644
--- a/gcc/aclocal.m4
+++ b/gcc/aclocal.m4
@@ -318,46 +318,33 @@ AC_SUBST(INSTALL_DATA)dnl
dnl Test for GNAT.
dnl We require the gnatbind program, and a compiler driver that
-dnl understands Ada. The user may set the driver name explicitly
-dnl with ADAC; also, the user's CC setting is tried. Failing that,
-dnl we try gcc and cc, then a sampling of names known to be used for
-dnl the Ada driver on various systems.
+dnl understands Ada. We use the user's CC setting, already found.
dnl
dnl Sets the shell variable have_gnat to yes or no as appropriate, and
-dnl substitutes GNATBIND and ADAC.
+dnl substitutes GNATBIND.
AC_DEFUN([gcc_AC_PROG_GNAT],
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])
+AC_REQUIRE([AC_PROG_CC])
AC_CHECK_TOOL(GNATBIND, gnatbind, no)
-AC_CACHE_CHECK([for compiler driver that understands Ada],
- gcc_cv_prog_adac,
+AC_CACHE_CHECK([whether compiler driver understands Ada],
+ gcc_cv_cc_supports_ada,
[cat >conftest.adb <<EOF
procedure conftest is begin null; end conftest;
EOF
-gcc_cv_prog_adac=no
-# Have to do ac_tool_prefix and user overrides by hand.
-for cand in ${ADAC+"$ADAC"} ${CC+"$CC"} \
- ${ac_tool_prefix}gcc gcc \
- ${ac_tool_prefix}cc cc \
- ${ac_tool_prefix}gnatgcc gnatgcc \
- ${ac_tool_prefix}gnatcc gnatcc \
- ${ac_tool_prefix}adagcc adagcc \
- ${ac_tool_prefix}adacc adacc ; do
- # There is a bug in all released versions of GCC which causes the
- # driver to exit successfully when the appropriate language module
- # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
- # Therefore we must check for the error message as well as an
- # unsuccessful exit.
- errors=`($cand -c conftest.adb) 2>&1 || echo failure`
- if test x"$errors" = x; then
- gcc_cv_prog_adac=$cand
- break
- fi
-done
+gcc_cv_cc_supports_ada=no
+# There is a bug in old released versions of GCC which causes the
+# driver to exit successfully when the appropriate language module
+# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
+# Therefore we must check for the error message as well as an
+# unsuccessful exit.
+errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
+if test x"$errors" = x; then
+ gcc_cv_cc_supports_ada=yes
+ break
+fi
rm -f conftest.*])
-ADAC=$gcc_cv_prog_adac
-AC_SUBST(ADAC)
-if test x$GNATBIND != xno && test x$ADAC != xno; then
+if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then
have_gnat=yes
else
have_gnat=no
@@ -424,7 +411,7 @@ else
# read() to the same fd. The only system known to have a problem here
# is VMS, where text files have record structure.
case "$host_os" in
- vms*)
+ vms* | ultrix*)
gcc_cv_func_mmap_file=no ;;
*)
gcc_cv_func_mmap_file=yes;;
@@ -620,6 +607,8 @@ AC_DEFUN([AM_ICONV],
done
])
+ AC_CHECK_HEADERS([iconv.h])
+
AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
diff --git a/gcc/ada/.cvsignore b/gcc/ada/.cvsignore
deleted file mode 100644
index 2ff143dfe88..00000000000
--- a/gcc/ada/.cvsignore
+++ /dev/null
@@ -1,6 +0,0 @@
-gnat_ug_unx.info*
-gnat_ug_vms.info*
-gnat_ug_vxw.info*
-gnat_ug_wnt.info*
-gnat_rm.info*
-gnat-style.info*
diff --git a/gcc/ada/35soccon.ads b/gcc/ada/35soccon.ads
new file mode 100644
index 00000000000..cd19222e1a7
--- /dev/null
+++ b/gcc/ada/35soccon.ads
@@ -0,0 +1,158 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT COMPILER COMPONENTS --
+-- --
+-- G N A T . S O C K E T S . C O N S T A N T S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2000-2003 Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides target dependent definitions of constant for use
+-- by the GNAT.Sockets package (g-socket.ads). This package should not be
+-- directly with'ed by an applications program.
+
+-- This is the version for i386 FreeBSD
+
+package GNAT.Sockets.Constants is
+
+ --------------
+ -- Families --
+ --------------
+
+ AF_INET : constant := 2; -- IPv4 address family
+ AF_INET6 : constant := 28; -- IPv6 address family
+
+ -----------
+ -- Modes --
+ -----------
+
+ SOCK_STREAM : constant := 1; -- Stream socket
+ SOCK_DGRAM : constant := 2; -- Datagram socket
+
+ -------------------
+ -- Socket errors --
+ -------------------
+
+ EACCES : constant := 13; -- Permission denied
+ EADDRINUSE : constant := 48; -- Address already in use
+ EADDRNOTAVAIL : constant := 49; -- Cannot assign address
+ EAFNOSUPPORT : constant := 47; -- Addr family not supported
+ EALREADY : constant := 37; -- Operation in progress
+ EBADF : constant := 9; -- Bad file descriptor
+ ECONNABORTED : constant := 53; -- Connection aborted
+ ECONNREFUSED : constant := 61; -- Connection refused
+ ECONNRESET : constant := 54; -- Connection reset by peer
+ EDESTADDRREQ : constant := 39; -- Destination addr required
+ EFAULT : constant := 14; -- Bad address
+ EHOSTDOWN : constant := 64; -- Host is down
+ EHOSTUNREACH : constant := 65; -- No route to host
+ EINPROGRESS : constant := 36; -- Operation now in progress
+ EINTR : constant := 4; -- Interrupted system call
+ EINVAL : constant := 22; -- Invalid argument
+ EIO : constant := 5; -- Input output error
+ EISCONN : constant := 56; -- Socket already connected
+ ELOOP : constant := 62; -- Too many symbolic lynks
+ EMFILE : constant := 24; -- Too many open files
+ EMSGSIZE : constant := 40; -- Message too long
+ ENAMETOOLONG : constant := 63; -- Name too long
+ ENETDOWN : constant := 50; -- Network is down
+ ENETRESET : constant := 52; -- Disconn. on network reset
+ ENETUNREACH : constant := 51; -- Network is unreachable
+ ENOBUFS : constant := 55; -- No buffer space available
+ ENOPROTOOPT : constant := 42; -- Protocol not available
+ ENOTCONN : constant := 57; -- Socket not connected
+ ENOTSOCK : constant := 38; -- Operation on non socket
+ EOPNOTSUPP : constant := 45; -- Operation not supported
+ EPFNOSUPPORT : constant := 46; -- Unknown protocol family
+ EPROTONOSUPPORT : constant := 43; -- Unknown protocol
+ EPROTOTYPE : constant := 41; -- Unknown protocol type
+ ESHUTDOWN : constant := 58; -- Cannot send once shutdown
+ ESOCKTNOSUPPORT : constant := 44; -- Socket type not supported
+ ETIMEDOUT : constant := 60; -- Connection timed out
+ ETOOMANYREFS : constant := 59; -- Too many references
+ EWOULDBLOCK : constant := 35; -- Operation would block
+
+ -----------------
+ -- Host errors --
+ -----------------
+
+ HOST_NOT_FOUND : constant := 1; -- Unknown host
+ TRY_AGAIN : constant := 2; -- Host name lookup failure
+ NO_DATA : constant := 4; -- No data record for name
+ NO_RECOVERY : constant := 3; -- Non recoverable errors
+
+ -------------------
+ -- Control flags --
+ -------------------
+
+ FIONBIO : constant := -2147195266; -- Set/clear non-blocking io
+ FIONREAD : constant := 1074030207; -- How many bytes to read
+
+ --------------------
+ -- Shutdown modes --
+ --------------------
+
+ SHUT_RD : constant := 0; -- No more recv
+ SHUT_WR : constant := 1; -- No more send
+ SHUT_RDWR : constant := 2; -- No more recv/send
+
+ ---------------------
+ -- Protocol levels --
+ ---------------------
+
+ SOL_SOCKET : constant := 65535; -- Options for socket level
+ IPPROTO_IP : constant := 0; -- Dummy protocol for IP
+ IPPROTO_UDP : constant := 17; -- UDP
+ IPPROTO_TCP : constant := 6; -- TCP
+
+ -------------------
+ -- Request flags --
+ -------------------
+
+ MSG_OOB : constant := 1; -- Process out-of-band data
+ MSG_PEEK : constant := 2; -- Peek at incoming data
+ MSG_EOR : constant := 8; -- Send end of record
+ MSG_WAITALL : constant := 64; -- Wait for full reception
+
+ --------------------
+ -- Socket options --
+ --------------------
+
+ TCP_NODELAY : constant := 1; -- Do not coalesce packets
+ SO_SNDBUF : constant := 4097; -- Set/get send buffer size
+ SO_RCVBUF : constant := 4098; -- Set/get recv buffer size
+ SO_REUSEADDR : constant := 4; -- Bind reuse local address
+ SO_KEEPALIVE : constant := 8; -- Enable keep-alive msgs
+ SO_LINGER : constant := 128; -- Defer close to flush data
+ SO_ERROR : constant := 4103; -- Get/clear error status
+ SO_BROADCAST : constant := 32; -- Can send broadcast msgs
+ IP_ADD_MEMBERSHIP : constant := 12; -- Join a multicast group
+ IP_DROP_MEMBERSHIP : constant := 13; -- Leave a multicast group
+ IP_MULTICAST_TTL : constant := 10; -- Set/get multicast TTL
+ IP_MULTICAST_LOOP : constant := 11; -- Set/get mcast loopback
+
+end GNAT.Sockets.Constants;
diff --git a/gcc/ada/3ssoliop.ads b/gcc/ada/3ssoliop.ads
index 18b7abb7e63..82ac94ff280 100644
--- a/gcc/ada/3ssoliop.ads
+++ b/gcc/ada/3ssoliop.ads
@@ -34,7 +34,7 @@
-- This package is used to provide target specific linker_options for the
-- support of scokets as required by the package GNAT.Sockets.
--- This is the UnixWare version of this package
+-- This is the Solaris version of this package
package GNAT.Sockets.Linker_Options is
private
diff --git a/gcc/ada/3vtrasym.adb b/gcc/ada/3vtrasym.adb
index 26382c11130..85f541d018b 100644
--- a/gcc/ada/3vtrasym.adb
+++ b/gcc/ada/3vtrasym.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2003 Ada Core Technologies, Inc. --
+-- Copyright (C) 1999-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -26,7 +26,8 @@
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
--- GNAT is maintained by Ada Core Technologies Inc (http://www.gnat.com). --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
@@ -34,7 +35,6 @@
with Ada.Exceptions.Traceback; use Ada.Exceptions.Traceback;
with Interfaces.C;
-with Interfaces.C.Strings;
with System;
with System.Aux_DEC;
with System.Soft_Links;
@@ -45,133 +45,230 @@ package body GNAT.Traceback.Symbolic is
pragma Warnings (Off);
pragma Linker_Options ("--for-linker=sys$library:trace.exe");
- use Interfaces.C.Strings;
+ use Interfaces.C;
use System;
use System.Aux_DEC;
use System.Traceback_Entries;
- type Dscdef1_Type is record
- Maxstrlen : Unsigned_Word;
- Dtype : Unsigned_Byte;
- Class : Unsigned_Byte;
- Pointer : chars_ptr;
+ subtype User_Arg_Type is Unsigned_Longword;
+ subtype Cond_Value_Type is Unsigned_Longword;
+
+ type ASCIC is record
+ Count : unsigned_char;
+ Data : char_array (1 .. 255);
end record;
+ pragma Convention (C, ASCIC);
- for Dscdef1_Type use record
- Maxstrlen at 0 range 0 .. 15;
- Dtype at 2 range 0 .. 7;
- Class at 3 range 0 .. 7;
- Pointer at 4 range 0 .. 31;
+ for ASCIC use record
+ Count at 0 range 0 .. 7;
+ Data at 1 range 0 .. 8 * 255 - 1;
end record;
- for Dscdef1_Type'Size use 64;
+ for ASCIC'Size use 8 * 256;
+
+ function Fetch_ASCIC is new Fetch_From_Address (ASCIC);
+
+ procedure Symbolize
+ (Status : out Cond_Value_Type;
+ Current_PC : in Address;
+ Adjusted_PC : in Address;
+ Current_FP : in Address;
+ Current_R26 : in Address;
+ Image_Name : out Address;
+ Module_Name : out Address;
+ Routine_Name : out Address;
+ Line_Number : out Integer;
+ Relative_PC : out Address;
+ Absolute_PC : out Address;
+ PC_Is_Valid : out Long_Integer;
+ User_Act_Proc : Address := Address'Null_Parameter;
+ User_Arg_Value : User_Arg_Type := User_Arg_Type'Null_Parameter);
+
+ pragma Interface (External, Symbolize);
+
+ pragma Import_Valued_Procedure
+ (Symbolize, "TBK$SYMBOLIZE",
+ (Cond_Value_Type, Address, Address, Address, Address,
+ Address, Address, Address, Integer,
+ Address, Address, Long_Integer,
+ Address, User_Arg_Type),
+ (Value, Value, Value, Value, Value,
+ Reference, Reference, Reference, Reference,
+ Reference, Reference, Reference,
+ Value, Value),
+ User_Act_Proc);
+
+ function Decode_Ada_Name (Encoded_Name : String) return String;
+ -- Decodes an Ada identifier name. Removes leading "_ada_" and trailing
+ -- __{DIGIT}+ or ${DIGIT}+, converts other "__" to '.'
- Image_Buf : String (1 .. 10240);
- Image_Len : Integer;
- Image_Need_Hdr : Boolean := True;
- Image_Do_Another_Line : Boolean;
- Image_Xtra_Msg : Boolean;
+ ---------------------
+ -- Decode_Ada_Name --
+ ---------------------
- procedure Traceback_Image (Out_Desc : access Dscdef1_Type);
+ function Decode_Ada_Name (Encoded_Name : String) return String is
+ Decoded_Name : String (1 .. Encoded_Name'Length);
+ Pos : Integer := Encoded_Name'First;
+ Last : Integer := Encoded_Name'Last;
+ DPos : Integer := 1;
- procedure Traceback_Image (Out_Desc : access Dscdef1_Type) is
- Image : String (1 .. Integer (Out_Desc.Maxstrlen));
begin
- Image := Value (Out_Desc.Pointer,
- Interfaces.C.size_t (Out_Desc.Maxstrlen));
+ if Pos > Last then
+ return "";
+ end if;
+
+ -- Skip leading _ada_
- if Image_Do_Another_Line and then
- (Image_Need_Hdr or else
- Image (Image'First .. Image'First + 27) /=
- " image module routine")
+ if Encoded_Name'Length > 4
+ and then Encoded_Name (Pos .. Pos + 4) = "_ada_"
then
- declare
- First : Integer := Image_Len + 1;
- Last : Integer := First + Image'Length - 1;
- begin
- Image_Buf (First .. Last + 1) := Image & ASCII.LF;
- Image_Len := Last + 1;
- end;
-
- Image_Need_Hdr := False;
-
- if Image (Image'First .. Image'First + 3) = "----" then
- if Image_Xtra_Msg = False then
- Image_Xtra_Msg := True;
- else
- Image_Xtra_Msg := False;
- end if;
- end if;
+ Pos := Pos + 5;
+ end if;
- if Out_Desc.Maxstrlen = 79 and then not Image_Xtra_Msg then
- Image_Len := Image_Len - 1;
- Image_Do_Another_Line := False;
- end if;
+ -- Skip trailing __{DIGIT}+ or ${DIGIT}+
+
+ if Encoded_Name (Last) in '0' .. '9' then
+ for J in reverse Pos + 2 .. Last - 1 loop
+ case Encoded_Name (J) is
+ when '0' .. '9' =>
+ null;
+ when '$' =>
+ Last := J - 1;
+ exit;
+ when '_' =>
+ if Encoded_Name (J - 1) = '_' then
+ Last := J - 2;
+ end if;
+ exit;
+ when others =>
+ exit;
+ end case;
+ end loop;
end if;
- end Traceback_Image;
- subtype User_Arg_Type is Unsigned_Longword;
- subtype Cond_Value_Type is Unsigned_Longword;
+ -- Now just copy encoded name to decoded name, converting "__" to '.'
- procedure Show_Traceback
- (Status : out Cond_Value_Type;
- Faulting_FP : Address;
- Faulting_SP : Address;
- Faulting_PC : Address;
- Detail_Level : Integer := Integer'Null_Parameter;
- User_Act_Proc : Address := Address'Null_Parameter;
- User_Arg_Value : User_Arg_Type := User_Arg_Type'Null_Parameter;
- Exceptionn : Unsigned_Longword := Unsigned_Longword'Null_Parameter);
+ while Pos <= Last loop
+ if Encoded_Name (Pos) = '_' and then Encoded_Name (Pos + 1) = '_'
+ and then Pos /= Encoded_Name'First
+ then
+ Decoded_Name (DPos) := '.';
+ Pos := Pos + 2;
- pragma Interface (External, Show_Traceback);
+ else
+ Decoded_Name (DPos) := Encoded_Name (Pos);
+ Pos := Pos + 1;
+ end if;
- pragma Import_Valued_Procedure
- (Show_Traceback, "TBK$SHOW_TRACEBACK",
- (Cond_Value_Type, Address, Address, Address, Integer, Address,
- User_Arg_Type, Unsigned_Longword),
- (Value, Value, Value, Value, Reference, Value, Value, Reference),
- Detail_Level);
+ DPos := DPos + 1;
+ end loop;
+ return Decoded_Name (1 .. DPos - 1);
+ end Decode_Ada_Name;
------------------------
-- Symbolic_Traceback --
------------------------
function Symbolic_Traceback (Traceback : Tracebacks_Array) return String is
- Res : String (1 .. 256 * Traceback'Length);
- Len : Integer;
- Status : Cond_Value_Type;
+ Status : Cond_Value_Type;
+ Image_Name : ASCIC;
+ Image_Name_Addr : Address;
+ Module_Name : ASCIC;
+ Module_Name_Addr : Address;
+ Routine_Name : ASCIC;
+ Routine_Name_Addr : Address;
+ Line_Number : Integer;
+ Relative_PC : Address;
+ Absolute_PC : Address;
+ PC_Is_Valid : Long_Integer;
+ Return_Address : Address;
+ Res : String (1 .. 256 * Traceback'Length);
+ Len : Integer;
begin
if Traceback'Length > 0 then
-
Len := 0;
-- Since image computation is not thread-safe we need task lockout
+
System.Soft_Links.Lock_Task.all;
- for I in Traceback'Range loop
- Image_Len := 0;
- Image_Do_Another_Line := True;
- Image_Xtra_Msg := False;
- Show_Traceback
+ for J in Traceback'Range loop
+ if J = Traceback'Last then
+ Return_Address := Address_Zero;
+ else
+ Return_Address := PC_For (Traceback (J + 1));
+ end if;
+
+ Symbolize
(Status,
- FP_For (Traceback (I)),
- SP_For (Traceback (I)),
- PC_For (Traceback (I)),
- 0,
- Traceback_Image'Address);
+ PC_For (Traceback (J)),
+ PC_For (Traceback (J)),
+ PV_For (Traceback (J)),
+ Return_Address,
+ Image_Name_Addr,
+ Module_Name_Addr,
+ Routine_Name_Addr,
+ Line_Number,
+ Relative_PC,
+ Absolute_PC,
+ PC_Is_Valid);
+
+ Image_Name := Fetch_ASCIC (Image_Name_Addr);
+ Module_Name := Fetch_ASCIC (Module_Name_Addr);
+ Routine_Name := Fetch_ASCIC (Routine_Name_Addr);
declare
First : Integer := Len + 1;
- Last : Integer := First + Image_Len - 1;
+ Last : Integer := First + 80 - 1;
+ Pos : Integer;
+ Routine_Name_D : String := Decode_Ada_Name
+ (To_Ada
+ (Routine_Name.Data (1 .. size_t (Routine_Name.Count)),
+ False));
+
begin
- Res (First .. Last + 1) := Image_Buf & ASCII.LF;
- Len := Last + 1;
+ Res (First .. Last) := (others => ' ');
+
+ Res (First .. First + Integer (Image_Name.Count) - 1) :=
+ To_Ada
+ (Image_Name.Data (1 .. size_t (Image_Name.Count)),
+ False);
+
+ Res (First + 10 ..
+ First + 10 + Integer (Module_Name.Count) - 1) :=
+ To_Ada
+ (Module_Name.Data (1 .. size_t (Module_Name.Count)),
+ False);
+
+ Res (First + 30 ..
+ First + 30 + Routine_Name_D'Length - 1) :=
+ Routine_Name_D;
+
+ -- If routine name doesn't fit 20 characters, output
+ -- the line number on next line at 50th position
+
+ if Routine_Name_D'Length > 20 then
+ Pos := First + 30 + Routine_Name_D'Length;
+ Res (Pos) := ASCII.LF;
+ Last := Pos + 80;
+ Res (Pos + 1 .. Last) := (others => ' ');
+ Pos := Pos + 51;
+ else
+ Pos := First + 50;
+ end if;
+
+ Res (Pos .. Pos + Integer'Image (Line_Number)'Length - 1) :=
+ Integer'Image (Line_Number);
+
+ Res (Last) := ASCII.LF;
+ Len := Last;
end;
end loop;
- System.Soft_Links.Unlock_Task.all;
+ System.Soft_Links.Unlock_Task.all;
return Res (1 .. Len);
+
else
return "";
end if;
diff --git a/gcc/ada/45intnam.ads b/gcc/ada/45intnam.ads
new file mode 100644
index 00000000000..eb05daaa912
--- /dev/null
+++ b/gcc/ada/45intnam.ads
@@ -0,0 +1,136 @@
+------------------------------------------------------------------------------
+-- --
+-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- A D A . I N T E R R U P T S . N A M E S --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1991-2003 Free Software Foundation, Inc. --
+-- --
+-- GNARL is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNARL; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. --
+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the FreeBSD THREADS version of this package
+
+with System.OS_Interface;
+-- used for names of interrupts
+
+package Ada.Interrupts.Names is
+
+ SIGHUP : constant Interrupt_ID :=
+ System.OS_Interface.SIGHUP; -- hangup
+
+ SIGINT : constant Interrupt_ID :=
+ System.OS_Interface.SIGINT; -- interrupt (rubout)
+
+ SIGQUIT : constant Interrupt_ID :=
+ System.OS_Interface.SIGQUIT; -- quit (ASCD FS)
+
+ SIGILL : constant Interrupt_ID :=
+ System.OS_Interface.SIGILL; -- illegal instruction (not reset)
+
+ SIGTRAP : constant Interrupt_ID :=
+ System.OS_Interface.SIGTRAP; -- trace trap (not reset)
+
+ SIGIOT : constant Interrupt_ID :=
+ System.OS_Interface.SIGIOT; -- IOT instruction
+
+ SIGABRT : constant Interrupt_ID := -- used by abort,
+ System.OS_Interface.SIGABRT; -- replace SIGIOT in the future
+
+ SIGFPE : constant Interrupt_ID :=
+ System.OS_Interface.SIGFPE; -- floating point exception
+
+ SIGKILL : constant Interrupt_ID :=
+ System.OS_Interface.SIGKILL; -- kill (cannot be caught or ignored)
+
+ SIGBUS : constant Interrupt_ID :=
+ System.OS_Interface.SIGBUS; -- bus error
+
+ SIGSEGV : constant Interrupt_ID :=
+ System.OS_Interface.SIGSEGV; -- segmentation violation
+
+ SIGPIPE : constant Interrupt_ID := -- write on a pipe with
+ System.OS_Interface.SIGPIPE; -- no one to read it
+
+ SIGALRM : constant Interrupt_ID :=
+ System.OS_Interface.SIGALRM; -- alarm clock
+
+ SIGTERM : constant Interrupt_ID :=
+ System.OS_Interface.SIGTERM; -- software termination signal from kill
+
+ SIGURG : constant Interrupt_ID :=
+ System.OS_Interface.SIGURG; -- urgent condition on IO channel
+
+ SIGSTOP : constant Interrupt_ID :=
+ System.OS_Interface.SIGSTOP; -- stop (cannot be caught or ignored)
+
+ SIGTSTP : constant Interrupt_ID :=
+ System.OS_Interface.SIGTSTP; -- user stop requested from tty
+
+ SIGCONT : constant Interrupt_ID :=
+ System.OS_Interface.SIGCONT; -- stopped process has been continued
+
+ SIGCHLD : constant Interrupt_ID :=
+ System.OS_Interface.SIGCHLD; -- 4.3BSD's/POSIX name for SIGCLD
+
+ SIGCLD : constant Interrupt_ID :=
+ System.OS_Interface.SIGCLD; -- child status change
+
+ SIGTTIN : constant Interrupt_ID :=
+ System.OS_Interface.SIGTTIN; -- background tty read attempted
+
+ SIGTTOU : constant Interrupt_ID :=
+ System.OS_Interface.SIGTTOU; -- background tty write attempted
+
+ SIGIO : constant Interrupt_ID := -- input/output possible,
+ System.OS_Interface.SIGIO; -- SIGPOLL alias (Solaris)
+
+ SIGXCPU : constant Interrupt_ID :=
+ System.OS_Interface.SIGXCPU; -- CPU time limit exceeded
+
+ SIGXFSZ : constant Interrupt_ID :=
+ System.OS_Interface.SIGXFSZ; -- filesize limit exceeded
+
+ SIGVTALRM : constant Interrupt_ID :=
+ System.OS_Interface.SIGVTALRM; -- virtual timer expired
+
+ SIGPROF : constant Interrupt_ID :=
+ System.OS_Interface.SIGPROF; -- profiling timer expired
+
+ SIGWINCH : constant Interrupt_ID :=
+ System.OS_Interface.SIGWINCH; -- window size change
+
+ SIGUSR1 : constant Interrupt_ID :=
+ System.OS_Interface.SIGUSR1; -- user defined signal 1
+
+ SIGUSR2 : constant Interrupt_ID :=
+ System.OS_Interface.SIGUSR2; -- user defined signal 2
+
+ -- Beware that the mapping of names to signals may be
+ -- many-to-one. There may be aliases. Also, for all
+ -- signal names that are not supported on the current system
+ -- the value of the corresponding constant will be zero.
+
+end Ada.Interrupts.Names;
diff --git a/gcc/ada/52osinte.ads b/gcc/ada/52osinte.ads
index ba2e532cc24..b6f30233193 100644
--- a/gcc/ada/52osinte.ads
+++ b/gcc/ada/52osinte.ads
@@ -153,6 +153,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#80#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/53osinte.ads b/gcc/ada/53osinte.ads
index b4934b464c5..6ade0986762 100644
--- a/gcc/ada/53osinte.ads
+++ b/gcc/ada/53osinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1999-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -153,6 +153,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#10#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/54osinte.ads b/gcc/ada/54osinte.ads
index 037fd09e829..cced53c4fc6 100644
--- a/gcc/ada/54osinte.ads
+++ b/gcc/ada/54osinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2000-2002 Ada Core Technologies, Inc. --
+-- Copyright (C) 2000-2003 Ada Core Technologies, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -157,6 +157,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#0008#;
+
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
diff --git a/gcc/ada/55osinte.adb b/gcc/ada/55osinte.adb
new file mode 100644
index 00000000000..466a15d2b33
--- /dev/null
+++ b/gcc/ada/55osinte.adb
@@ -0,0 +1,108 @@
+------------------------------------------------------------------------------
+-- --
+-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- S Y S T E M . O S _ I N T E R F A C E --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 1991-2003 Free Software Foundation, Inc. --
+-- --
+-- GNARL is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNARL; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. It is --
+-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
+-- State University (http://www.gnat.com). --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the FreeBSD THREADS version of this package
+
+with Interfaces.C; use Interfaces.C;
+
+package body System.OS_Interface is
+
+ function Errno return int is
+ type int_ptr is access all int;
+
+ function internal_errno return int_ptr;
+ pragma Import (C, internal_errno, "__error");
+ begin
+ return (internal_errno.all);
+ end Errno;
+
+ function Get_Stack_Base (thread : pthread_t) return Address is
+ pragma Unreferenced (thread);
+ begin
+ return (0);
+ end Get_Stack_Base;
+
+ procedure pthread_init is
+ begin
+ null;
+ end pthread_init;
+
+ -----------------
+ -- To_Duration --
+ -----------------
+
+ function To_Duration (TS : timespec) return Duration is
+ begin
+ return Duration (TS.ts_sec) + Duration (TS.ts_nsec) / 10#1#E9;
+ end To_Duration;
+
+ -----------------
+ -- To_Timespec --
+ -----------------
+
+ function To_Timespec (D : Duration) return timespec is
+ S : time_t;
+ F : Duration;
+ begin
+ S := time_t (Long_Long_Integer (D));
+ F := D - Duration (S);
+
+ -- If F has negative value due to a round-up, adjust for positive F
+ -- value.
+ if F < 0.0 then S := S - 1; F := F + 1.0; end if;
+ return timespec'(ts_sec => S,
+ ts_nsec => long (Long_Long_Integer (F * 10#1#E9)));
+ end To_Timespec;
+
+
+ function To_Duration (TV : struct_timeval) return Duration is
+ begin
+ return Duration (TV.tv_sec) + Duration (TV.tv_usec) / 10#1#E6;
+ end To_Duration;
+
+ function To_Timeval (D : Duration) return struct_timeval is
+ S : long;
+ F : Duration;
+ begin
+ S := long (Long_Long_Integer (D));
+ F := D - Duration (S);
+
+ -- If F has negative value due to a round-up, adjust for positive F
+ -- value.
+ if F < 0.0 then S := S - 1; F := F + 1.0; end if;
+ return struct_timeval'(tv_sec => S,
+ tv_usec => long (Long_Long_Integer (F * 10#1#E6)));
+ end To_Timeval;
+
+end System.OS_Interface;
diff --git a/gcc/ada/55osinte.ads b/gcc/ada/55osinte.ads
new file mode 100644
index 00000000000..581870c63f7
--- /dev/null
+++ b/gcc/ada/55osinte.ads
@@ -0,0 +1,632 @@
+------------------------------------------------------------------------------
+-- --
+-- GNU ADA RUNTIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- S Y S T E M . O S _ I N T E R F A C E --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1991-2003 Free Software Foundation, Inc. --
+-- --
+-- GNARL is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNARL; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. It is --
+-- now maintained by Ada Core Technologies Inc. in cooperation with Florida --
+-- State University (http://www.gnat.com). --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the FreeBSD PTHREADS version of this package
+
+with Interfaces.C;
+package System.OS_Interface is
+ pragma Preelaborate;
+
+ pragma Linker_Options ("-pthread");
+
+ subtype int is Interfaces.C.int;
+ subtype short is Interfaces.C.short;
+ subtype long is Interfaces.C.long;
+ subtype unsigned is Interfaces.C.unsigned;
+ subtype unsigned_short is Interfaces.C.unsigned_short;
+ subtype unsigned_long is Interfaces.C.unsigned_long;
+ subtype unsigned_char is Interfaces.C.unsigned_char;
+ subtype plain_char is Interfaces.C.plain_char;
+ subtype size_t is Interfaces.C.size_t;
+
+ -----------
+ -- Errno --
+ -----------
+
+ function Errno return int;
+ pragma Inline (Errno);
+
+ EAGAIN : constant := 35;
+ EINTR : constant := 4;
+ EINVAL : constant := 22;
+ ENOMEM : constant := 12;
+ ETIMEDOUT : constant := 60;
+
+ -------------
+ -- Signals --
+ -------------
+
+ Max_Interrupt : constant := 31;
+ type Signal is new int range 0 .. Max_Interrupt;
+ for Signal'Size use int'Size;
+
+ SIGHUP : constant := 1; -- hangup
+ SIGINT : constant := 2; -- interrupt (rubout)
+ SIGQUIT : constant := 3; -- quit (ASCD FS)
+ SIGILL : constant := 4; -- illegal instruction (not reset)
+ SIGTRAP : constant := 5; -- trace trap (not reset)
+ SIGIOT : constant := 6; -- IOT instruction
+ SIGABRT : constant := 6; -- used by abort, replace SIGIOT in the future
+ SIGEMT : constant := 7; -- EMT instruction
+ SIGFPE : constant := 8; -- floating point exception
+ SIGKILL : constant := 9; -- kill (cannot be caught or ignored)
+ SIGBUS : constant := 10; -- bus error
+ SIGSEGV : constant := 11; -- segmentation violation
+ SIGSYS : constant := 12; -- bad argument to system call
+ SIGPIPE : constant := 13; -- write on a pipe with no one to read it
+ SIGALRM : constant := 14; -- alarm clock
+ SIGTERM : constant := 15; -- software termination signal from kill
+ SIGURG : constant := 16; -- urgent condition on IO channel
+ SIGSTOP : constant := 17; -- stop (cannot be caught or ignored)
+ SIGTSTP : constant := 18; -- user stop requested from tty
+ SIGCONT : constant := 19; -- stopped process has been continued
+ SIGCLD : constant := 20; -- alias for SIGCHLD
+ SIGCHLD : constant := 20; -- child status change
+ SIGTTIN : constant := 21; -- background tty read attempted
+ SIGTTOU : constant := 22; -- background tty write attempted
+ SIGIO : constant := 23; -- I/O possible (Solaris SIGPOLL alias)
+ SIGXCPU : constant := 24; -- CPU time limit exceeded
+ SIGXFSZ : constant := 25; -- filesize limit exceeded
+ SIGVTALRM : constant := 26; -- virtual timer expired
+ SIGPROF : constant := 27; -- profiling timer expired
+ SIGWINCH : constant := 28; -- window size change
+ SIGINFO : constant := 29; -- information request (NetBSD/FreeBSD)
+ SIGUSR1 : constant := 30; -- user defined signal 1
+ SIGUSR2 : constant := 31; -- user defined signal 2
+
+ SIGADAABORT : constant := SIGABRT;
+ -- Change this if you want to use another signal for task abort.
+ -- SIGTERM might be a good one.
+
+ type Signal_Set is array (Natural range <>) of Signal;
+
+ -- Interrupts that must be unmasked at all times. FreeBSD
+ -- pthreads will not allow an application to mask out any
+ -- interrupt needed by the threads library.
+ Unmasked : constant Signal_Set :=
+ (SIGTRAP, SIGBUS, SIGTTIN, SIGTTOU, SIGTSTP);
+
+ -- FreeBSD will uses SIGPROF for timing. Do not allow a
+ -- handler to attach to this signal.
+ Reserved : constant Signal_Set := (0 .. 0 => SIGPROF);
+
+ type sigset_t is private;
+
+ function sigaddset
+ (set : access sigset_t;
+ sig : Signal) return int;
+ pragma Import (C, sigaddset, "sigaddset");
+
+ function sigdelset
+ (set : access sigset_t;
+ sig : Signal) return int;
+ pragma Import (C, sigdelset, "sigdelset");
+
+ function sigfillset (set : access sigset_t) return int;
+ pragma Import (C, sigfillset, "sigfillset");
+
+ function sigismember
+ (set : access sigset_t;
+ sig : Signal) return int;
+ pragma Import (C, sigismember, "sigismember");
+
+ function sigemptyset (set : access sigset_t) return int;
+ pragma Import (C, sigemptyset, "sigemptyset");
+
+ -- sigcontext is architecture dependent, so define it private
+ type struct_sigcontext is private;
+
+ type old_struct_sigaction is record
+ sa_handler : System.Address;
+ sa_mask : sigset_t;
+ sa_flags : int;
+ end record;
+ pragma Convention (C, old_struct_sigaction);
+
+ type new_struct_sigaction is record
+ sa_handler : System.Address;
+ sa_flags : int;
+ sa_mask : sigset_t;
+ end record;
+ pragma Convention (C, new_struct_sigaction);
+
+ subtype struct_sigaction is new_struct_sigaction;
+ type struct_sigaction_ptr is access all struct_sigaction;
+
+ SIG_BLOCK : constant := 1;
+ SIG_UNBLOCK : constant := 2;
+ SIG_SETMASK : constant := 3;
+
+ SIG_DFL : constant := 0;
+ SIG_IGN : constant := 1;
+
+ SA_SIGINFO : constant := 16#0040#;
+
+ function sigaction
+ (sig : Signal;
+ act : struct_sigaction_ptr;
+ oact : struct_sigaction_ptr) return int;
+ pragma Import (C, sigaction, "sigaction");
+
+ ----------
+ -- Time --
+ ----------
+
+ Time_Slice_Supported : constant Boolean := True;
+ -- Indicates wether time slicing is supported (i.e SCHED_RR is supported)
+
+ type timespec is private;
+
+ function nanosleep (rqtp, rmtp : access timespec) return int;
+ pragma Import (C, nanosleep, "nanosleep");
+
+ type clockid_t is private;
+
+ CLOCK_REALTIME : constant clockid_t;
+
+ function clock_gettime
+ (clock_id : clockid_t;
+ tp : access timespec)
+ return int;
+ pragma Import (C, clock_gettime, "clock_gettime");
+
+ function To_Duration (TS : timespec) return Duration;
+ pragma Inline (To_Duration);
+
+ function To_Timespec (D : Duration) return timespec;
+ pragma Inline (To_Timespec);
+
+ type struct_timezone is record
+ tz_minuteswest : int;
+ tz_dsttime : int;
+ end record;
+ pragma Convention (C, struct_timezone);
+ type struct_timeval is private;
+ -- This is needed on systems that do not have clock_gettime()
+ -- but do have gettimeofday().
+
+ function To_Duration (TV : struct_timeval) return Duration;
+ pragma Inline (To_Duration);
+
+ function To_Timeval (D : Duration) return struct_timeval;
+ pragma Inline (To_Timeval);
+
+ function gettimeofday
+ (tv : access struct_timeval;
+ tz : System.Address) return int;
+ pragma Import (C, gettimeofday, "gettimeofday");
+
+ procedure usleep (useconds : unsigned_long);
+ pragma Import (C, usleep, "usleep");
+
+ -------------------------
+ -- Priority Scheduling --
+ -------------------------
+
+ SCHED_FIFO : constant := 1;
+ SCHED_OTHER : constant := 2;
+ SCHED_RR : constant := 3;
+
+ -------------
+ -- Process --
+ -------------
+
+ type pid_t is private;
+
+ Self_PID : constant pid_t;
+
+ function kill (pid : pid_t; sig : Signal) return int;
+ pragma Import (C, kill, "kill");
+
+ function getpid return pid_t;
+ pragma Import (C, getpid, "getpid");
+
+ ---------
+ -- LWP --
+ ---------
+
+ function lwp_self return System.Address;
+ -- lwp_self does not exist on this thread library, revert to pthread_self
+ -- which is the closest approximation (with getpid). This function is
+ -- needed to share 7staprop.adb across POSIX-like targets.
+ pragma Import (C, lwp_self, "pthread_self");
+
+ -------------
+ -- Threads --
+ -------------
+
+ type Thread_Body is access
+ function (arg : System.Address) return System.Address;
+
+ type pthread_t is private;
+ subtype Thread_Id is pthread_t;
+
+ type pthread_mutex_t is limited private;
+ type pthread_cond_t is limited private;
+ type pthread_attr_t is limited private;
+ type pthread_mutexattr_t is limited private;
+ type pthread_condattr_t is limited private;
+ type pthread_key_t is private;
+
+ PTHREAD_CREATE_DETACHED : constant := 1;
+ PTHREAD_CREATE_JOINABLE : constant := 0;
+
+ -----------
+ -- Stack --
+ -----------
+
+ Stack_Base_Available : constant Boolean := False;
+ -- Indicates wether the stack base is available on this target.
+ -- This allows us to share s-osinte.adb between all the FSU run time.
+ -- Note that this value can only be true if pthread_t has a complete
+ -- definition that corresponds exactly to the C header files.
+
+ function Get_Stack_Base (thread : pthread_t) return Address;
+ pragma Inline (Get_Stack_Base);
+ -- returns the stack base of the specified thread.
+ -- Only call this function when Stack_Base_Available is True.
+
+ function Get_Page_Size return size_t;
+ function Get_Page_Size return Address;
+ pragma Import (C, Get_Page_Size, "getpagesize");
+ -- returns the size of a page, or 0 if this is not relevant on this
+ -- target
+
+ PROT_NONE : constant := 0;
+ PROT_READ : constant := 1;
+ PROT_WRITE : constant := 2;
+ PROT_EXEC : constant := 4;
+ PROT_ALL : constant := PROT_READ + PROT_WRITE + PROT_EXEC;
+
+ PROT_ON : constant := PROT_NONE;
+ PROT_OFF : constant := PROT_ALL;
+
+ function mprotect
+ (addr : Address; len : size_t; prot : int) return int;
+ pragma Import (C, mprotect);
+
+ -----------------------------------------
+ -- Nonstandard Thread Initialization --
+ -----------------------------------------
+ -- FSU_THREADS requires pthread_init, which is nonstandard
+ -- and this should be invoked during the elaboration of s-taprop.adb
+ --
+ -- FreeBSD does not require this so we provide an empty Ada body.
+ procedure pthread_init;
+
+ ---------------------------
+ -- POSIX.1c Section 3 --
+ ---------------------------
+
+ function sigwait
+ (set : access sigset_t;
+ sig : access Signal) return int;
+ pragma Import (C, sigwait, "sigwait");
+
+ function pthread_kill
+ (thread : pthread_t;
+ sig : Signal) return int;
+ pragma Import (C, pthread_kill, "pthread_kill");
+
+ type sigset_t_ptr is access all sigset_t;
+
+ function pthread_sigmask
+ (how : int;
+ set : sigset_t_ptr;
+ oset : sigset_t_ptr) return int;
+ pragma Import (C, pthread_sigmask, "pthread_sigmask");
+
+ ----------------------------
+ -- POSIX.1c Section 11 --
+ ----------------------------
+
+ function pthread_mutexattr_init
+ (attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutexattr_init, "pthread_mutexattr_init");
+
+ function pthread_mutexattr_destroy
+ (attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutexattr_destroy, "pthread_mutexattr_destroy");
+
+ function pthread_mutex_init
+ (mutex : access pthread_mutex_t;
+ attr : access pthread_mutexattr_t) return int;
+ pragma Import (C, pthread_mutex_init, "pthread_mutex_init");
+
+ function pthread_mutex_destroy (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_destroy, "pthread_mutex_destroy");
+
+ function pthread_mutex_lock (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_lock, "pthread_mutex_lock");
+
+ function pthread_mutex_unlock (mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_mutex_unlock, "pthread_mutex_unlock");
+
+ function pthread_condattr_init
+ (attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_condattr_init, "pthread_condattr_init");
+
+ function pthread_condattr_destroy
+ (attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_condattr_destroy, "pthread_condattr_destroy");
+
+ function pthread_cond_init
+ (cond : access pthread_cond_t;
+ attr : access pthread_condattr_t) return int;
+ pragma Import (C, pthread_cond_init, "pthread_cond_init");
+
+ function pthread_cond_destroy (cond : access pthread_cond_t) return int;
+ pragma Import (C, pthread_cond_destroy, "pthread_cond_destroy");
+
+ function pthread_cond_signal (cond : access pthread_cond_t) return int;
+ pragma Import (C, pthread_cond_signal, "pthread_cond_signal");
+
+ function pthread_cond_wait
+ (cond : access pthread_cond_t;
+ mutex : access pthread_mutex_t) return int;
+ pragma Import (C, pthread_cond_wait, "pthread_cond_wait");
+
+ function pthread_cond_timedwait
+ (cond : access pthread_cond_t;
+ mutex : access pthread_mutex_t;
+ abstime : access timespec) return int;
+ pragma Import (C, pthread_cond_timedwait, "pthread_cond_timedwait");
+
+ Relative_Timed_Wait : constant Boolean := False;
+ -- pthread_cond_timedwait requires an absolute delay time
+
+ ----------------------------
+ -- POSIX.1c Section 13 --
+ ----------------------------
+
+ PTHREAD_PRIO_NONE : constant := 0;
+ PTHREAD_PRIO_PROTECT : constant := 2;
+ PTHREAD_PRIO_INHERIT : constant := 1;
+
+ function pthread_mutexattr_setprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : int) return int;
+ pragma Import
+ (C, pthread_mutexattr_setprotocol, "pthread_mutexattr_setprotocol");
+
+ function pthread_mutexattr_getprotocol
+ (attr : access pthread_mutexattr_t;
+ protocol : access int) return int;
+ pragma Import
+ (C, pthread_mutexattr_getprotocol, "pthread_mutexattr_getprotocol");
+
+ function pthread_mutexattr_setprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : int) return int;
+ pragma Import
+ (C, pthread_mutexattr_setprioceiling,
+ "pthread_mutexattr_setprioceiling");
+
+ function pthread_mutexattr_getprioceiling
+ (attr : access pthread_mutexattr_t;
+ prioceiling : access int) return int;
+ pragma Import
+ (C, pthread_mutexattr_getprioceiling,
+ "pthread_mutexattr_getprioceiling");
+
+ type struct_sched_param is record
+ sched_priority : int;
+ end record;
+ pragma Convention (C, struct_sched_param);
+
+ function pthread_getschedparam
+ (thread : pthread_t;
+ policy : access int;
+ param : access struct_sched_param) return int;
+ pragma Import (C, pthread_getschedparam, "pthread_getschedparam");
+
+ function pthread_setschedparam
+ (thread : pthread_t;
+ policy : int;
+ param : access struct_sched_param) return int;
+ pragma Import (C, pthread_setschedparam, "pthread_setschedparam");
+
+ function pthread_attr_setscope
+ (attr : access pthread_attr_t;
+ contentionscope : int) return int;
+ pragma Import (C, pthread_attr_setscope, "pthread_attr_setscope");
+
+ function pthread_attr_getscope
+ (attr : access pthread_attr_t;
+ contentionscope : access int) return int;
+ pragma Import (C, pthread_attr_getscope, "pthread_attr_getscope");
+
+ function pthread_attr_setinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : int) return int;
+ pragma Import
+ (C, pthread_attr_setinheritsched, "pthread_attr_setinheritsched");
+
+ function pthread_attr_getinheritsched
+ (attr : access pthread_attr_t;
+ inheritsched : access int) return int;
+ pragma Import
+ (C, pthread_attr_getinheritsched, "pthread_attr_getinheritsched");
+
+ function pthread_attr_setschedpolicy
+ (attr : access pthread_attr_t;
+ policy : int) return int;
+ pragma Import (C, pthread_attr_setschedpolicy,
+ "pthread_attr_setschedpolicy");
+
+ function pthread_attr_getschedpolicy
+ (attr : access pthread_attr_t;
+ policy : access int) return int;
+ pragma Import (C, pthread_attr_getschedpolicy,
+ "pthread_attr_getschedpolicy");
+
+ function pthread_attr_setschedparam
+ (attr : access pthread_attr_t;
+ sched_param : int) return int;
+ pragma Import (C, pthread_attr_setschedparam, "pthread_attr_setschedparam");
+
+ function pthread_attr_getschedparam
+ (attr : access pthread_attr_t;
+ sched_param : access int) return int;
+ pragma Import (C, pthread_attr_getschedparam, "pthread_attr_getschedparam");
+
+ function sched_yield return int;
+ pragma Import (C, sched_yield, "pthread_yield");
+
+ -----------------------------
+ -- P1003.1c - Section 16 --
+ -----------------------------
+
+ function pthread_attr_init (attributes : access pthread_attr_t) return int;
+ pragma Import (C, pthread_attr_init, "pthread_attr_init");
+
+ function pthread_attr_destroy
+ (attributes : access pthread_attr_t) return int;
+ pragma Import (C, pthread_attr_destroy, "pthread_attr_destroy");
+
+ function pthread_attr_setdetachstate
+ (attr : access pthread_attr_t;
+ detachstate : int) return int;
+ pragma Import
+ (C, pthread_attr_setdetachstate, "pthread_attr_setdetachstate");
+
+ function pthread_attr_getdetachstate
+ (attr : access pthread_attr_t;
+ detachstate : access int) return int;
+ pragma Import
+ (C, pthread_attr_getdetachstate, "pthread_attr_getdetachstate");
+
+ function pthread_attr_getstacksize
+ (attr : access pthread_attr_t;
+ stacksize : access size_t) return int;
+ pragma Import
+ (C, pthread_attr_getstacksize, "pthread_attr_getstacksize");
+
+ function pthread_attr_setstacksize
+ (attr : access pthread_attr_t;
+ stacksize : size_t) return int;
+ pragma Import
+ (C, pthread_attr_setstacksize, "pthread_attr_setstacksize");
+
+ function pthread_create
+ (thread : access pthread_t;
+ attributes : access pthread_attr_t;
+ start_routine : Thread_Body;
+ arg : System.Address) return int;
+ pragma Import (C, pthread_create, "pthread_create");
+
+ function pthread_detach (thread : pthread_t) return int;
+ pragma Import (C, pthread_detach, "pthread_detach");
+
+ procedure pthread_exit (status : System.Address);
+ pragma Import (C, pthread_exit, "pthread_exit");
+
+ function pthread_self return pthread_t;
+ pragma Import (C, pthread_self, "pthread_self");
+
+ ----------------------------
+ -- POSIX.1c Section 17 --
+ ----------------------------
+
+ function pthread_setspecific
+ (key : pthread_key_t;
+ value : System.Address) return int;
+ pragma Import (C, pthread_setspecific, "pthread_setspecific");
+
+ function pthread_getspecific (key : pthread_key_t) return System.Address;
+ pragma Import (C, pthread_getspecific, "pthread_getspecific");
+
+ type destructor_pointer is access
+ procedure (arg : System.Address);
+
+ function pthread_key_create
+ (key : access pthread_key_t;
+ destructor : destructor_pointer) return int;
+ pragma Import (C, pthread_key_create, "pthread_key_create");
+
+ --------------------------------------
+ -- Non-portable pthread functions --
+ --------------------------------------
+
+ function pthread_set_name_np
+ (thread : pthread_t;
+ name : System.Address) return int;
+ pragma Import (C, pthread_set_name_np, "pthread_set_name_np");
+
+private
+
+ type sigset_t is array (1 .. 4) of unsigned;
+
+ -- In FreeBSD the component sa_handler turns out to
+ -- be one a union type, and the selector is a macro:
+ -- #define sa_handler __sigaction_u._handler
+ -- #define sa_sigaction __sigaction_u._sigaction
+
+ -- Should we add a signal_context type here ?
+ -- How could it be done independent of the CPU architecture ?
+ -- sigcontext type is opaque, so it is architecturally neutral.
+ -- It is always passed as an access type, so define it as an empty record
+ -- since the contents are not used anywhere.
+ type struct_sigcontext is null record;
+ pragma Convention (C, struct_sigcontext);
+
+ type pid_t is new int;
+ Self_PID : constant pid_t := 0;
+
+ type time_t is new long;
+
+ type timespec is record
+ ts_sec : time_t;
+ ts_nsec : long;
+ end record;
+ pragma Convention (C, timespec);
+
+ type clockid_t is new int;
+ CLOCK_REALTIME : constant clockid_t := 0;
+
+ type struct_timeval is record
+ tv_sec : long;
+ tv_usec : long;
+ end record;
+ pragma Convention (C, struct_timeval);
+
+ type pthread_t is new System.Address;
+ type pthread_attr_t is new System.Address;
+ type pthread_mutex_t is new System.Address;
+ type pthread_mutexattr_t is new System.Address;
+ type pthread_cond_t is new System.Address;
+ type pthread_condattr_t is new System.Address;
+ type pthread_key_t is new int;
+
+end System.OS_Interface;
diff --git a/gcc/ada/55system.ads b/gcc/ada/55system.ads
index 65bcc0ebd7f..72c51b0df52 100644
--- a/gcc/ada/55system.ads
+++ b/gcc/ada/55system.ads
@@ -138,8 +138,8 @@ private
Support_Long_Shifts : constant Boolean := True;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- ZCX_By_Default : constant Boolean := False;
- GCC_ZCX_Support : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
Front_End_ZCX_Support : constant Boolean := False;
-- Obsolete entries, to be removed eventually (bootstrap issues!)
diff --git a/gcc/ada/56osinte.ads b/gcc/ada/56osinte.ads
index c6bcbeb9ad4..3d7ff038f59 100644
--- a/gcc/ada/56osinte.ads
+++ b/gcc/ada/56osinte.ads
@@ -167,6 +167,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#80#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/56system.ads b/gcc/ada/56system.ads
new file mode 100644
index 00000000000..a7371a2d9a2
--- /dev/null
+++ b/gcc/ada/56system.ads
@@ -0,0 +1,150 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M --
+-- --
+-- S p e c --
+-- (FreeBSD/x86 Version) --
+-- --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package System is
+pragma Pure (System);
+-- Note that we take advantage of the implementation permission to
+-- make this unit Pure instead of Preelaborable, see RM 13.7(36)
+
+ type Name is (SYSTEM_NAME_GNAT);
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
+
+ -- System-Dependent Named Numbers
+
+ Min_Int : constant := Long_Long_Integer'First;
+ Max_Int : constant := Long_Long_Integer'Last;
+
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+ Max_Nonbinary_Modulus : constant := Integer'Last;
+
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
+ Max_Digits : constant := Long_Long_Float'Digits;
+
+ Max_Mantissa : constant := 63;
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+
+ Tick : constant := 0.000_001;
+
+ -- Storage-related Declarations
+
+ type Address is private;
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+ Word_Size : constant := 32;
+ Memory_Size : constant := 2 ** 32;
+
+ -- Address comparison
+
+ function "<" (Left, Right : Address) return Boolean;
+ function "<=" (Left, Right : Address) return Boolean;
+ function ">" (Left, Right : Address) return Boolean;
+ function ">=" (Left, Right : Address) return Boolean;
+ function "=" (Left, Right : Address) return Boolean;
+
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, ">=");
+ pragma Import (Intrinsic, "=");
+
+ -- Other System-Dependent Declarations
+
+ type Bit_Order is (High_Order_First, Low_Order_First);
+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
+
+ -- Priority-related Declarations (RM D.1)
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+
+ subtype Any_Priority is Integer range 0 .. 31;
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+ Default_Priority : constant Priority := 15;
+
+private
+
+ type Address is mod Memory_Size;
+ Null_Address : constant Address := 0;
+
+ --------------------------------------
+ -- System Implementation Parameters --
+ --------------------------------------
+
+ -- These parameters provide information about the target that is used
+ -- by the compiler. They are in the private part of System, where they
+ -- can be accessed using the special circuitry in the Targparm unit
+ -- whose source should be consulted for more detailed descriptions
+ -- of the individual switch values.
+
+ AAMP : constant Boolean := False;
+ Backend_Divide_Checks : constant Boolean := False;
+ Backend_Overflow_Checks : constant Boolean := False;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+ Duration_32_Bits : constant Boolean := False;
+ Exit_Status_Supported : constant Boolean := True;
+ Fractional_Fixed_Ops : constant Boolean := False;
+ Frontend_Layout : constant Boolean := False;
+ Functions_Return_By_DSP : constant Boolean := False;
+ Machine_Overflows : constant Boolean := False;
+ Machine_Rounds : constant Boolean := True;
+ OpenVMS : constant Boolean := False;
+ Signed_Zeros : constant Boolean := True;
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := False;
+ GCC_ZCX_Support : constant Boolean := False;
+ Front_End_ZCX_Support : constant Boolean := False;
+
+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
+
+ High_Integrity_Mode : constant Boolean := False;
+ Long_Shifts_Inlined : constant Boolean := True;
+
+end System;
diff --git a/gcc/ada/5aml-tgt.adb b/gcc/ada/5aml-tgt.adb
index 60e998e024d..69385b66d37 100644
--- a/gcc/ada/5aml-tgt.adb
+++ b/gcc/ada/5aml-tgt.adb
@@ -108,6 +108,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -117,6 +118,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Relocatable);
diff --git a/gcc/ada/5asystem.ads b/gcc/ada/5asystem.ads
index 3e445d90b27..f0067b37f84 100644
--- a/gcc/ada/5asystem.ads
+++ b/gcc/ada/5asystem.ads
@@ -138,8 +138,8 @@ private
Support_Long_Shifts : constant Boolean := True;
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
- ZCX_By_Default : constant Boolean := False;
- GCC_ZCX_Support : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
Front_End_ZCX_Support : constant Boolean := False;
-- Obsolete entries, to be removed eventually (bootstrap issues!)
diff --git a/gcc/ada/5bml-tgt.adb b/gcc/ada/5bml-tgt.adb
index 2f18936c5db..c07d58cb01a 100644
--- a/gcc/ada/5bml-tgt.adb
+++ b/gcc/ada/5bml-tgt.adb
@@ -35,10 +35,10 @@ with Ada.Text_IO; use Ada.Text_IO;
with MLib.Fil;
with MLib.Utl;
with Namet; use Namet;
+with Osint; use Osint;
with Opt;
with Output; use Output;
with Prj.Com;
-with Sdefault;
package body MLib.Tgt is
@@ -120,6 +120,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -129,6 +130,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Lib_Version);
pragma Unreferenced (Relocatable);
@@ -175,9 +177,9 @@ package body MLib.Tgt is
Last : Natural;
begin
- Open (File, In_File,
- Sdefault.Include_Dir_Default_Name.all &
- "/s-osinte.ads");
+ Open
+ (File, In_File,
+ Include_Dir_Default_Prefix & "/s-osinte.ads");
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
diff --git a/gcc/ada/5bosinte.ads b/gcc/ada/5bosinte.ads
index ab144c0f4d6..9d43a19bc93 100644
--- a/gcc/ada/5bosinte.ads
+++ b/gcc/ada/5bosinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -162,6 +162,7 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#0100#;
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
diff --git a/gcc/ada/5cosinte.ads b/gcc/ada/5cosinte.ads
index 86c507e0251..3dfe47d2f24 100644
--- a/gcc/ada/5cosinte.ads
+++ b/gcc/ada/5cosinte.ads
@@ -162,6 +162,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#0100#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/5gml-tgt.adb b/gcc/ada/5gml-tgt.adb
index 027ae8a8684..c5390a685ce 100644
--- a/gcc/ada/5gml-tgt.adb
+++ b/gcc/ada/5gml-tgt.adb
@@ -103,6 +103,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -112,6 +113,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Relocatable);
diff --git a/gcc/ada/5gsystem.ads b/gcc/ada/5gsystem.ads
index c18318ca364..2a2c5f4f026 100644
--- a/gcc/ada/5gsystem.ads
+++ b/gcc/ada/5gsystem.ads
@@ -124,7 +124,7 @@ private
Exit_Status_Supported : constant Boolean := True;
Fractional_Fixed_Ops : constant Boolean := False;
Frontend_Layout : constant Boolean := False;
- Functions_Return_By_DSP : constant Boolean := True;
+ Functions_Return_By_DSP : constant Boolean := False;
Machine_Overflows : constant Boolean := False;
Machine_Rounds : constant Boolean := True;
OpenVMS : constant Boolean := False;
diff --git a/gcc/ada/5hml-tgt.adb b/gcc/ada/5hml-tgt.adb
index 5398d563990..c790df89bfb 100644
--- a/gcc/ada/5hml-tgt.adb
+++ b/gcc/ada/5hml-tgt.adb
@@ -102,6 +102,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -111,6 +112,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Relocatable);
diff --git a/gcc/ada/5hosinte.ads b/gcc/ada/5hosinte.ads
index 1e51907f1af..379f0dc0a20 100644
--- a/gcc/ada/5hosinte.ads
+++ b/gcc/ada/5hosinte.ads
@@ -164,6 +164,7 @@ package System.OS_Interface is
type struct_sigaction_ptr is access all struct_sigaction;
SA_RESTART : constant := 16#40#;
+ SA_SIGINFO : constant := 16#10#;
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
diff --git a/gcc/ada/5iosinte.ads b/gcc/ada/5iosinte.ads
index e112c8cdaf5..4dceebfac96 100644
--- a/gcc/ada/5iosinte.ads
+++ b/gcc/ada/5iosinte.ads
@@ -196,6 +196,8 @@ package System.OS_Interface is
end record;
type Machine_State_Ptr is access all Machine_State;
+ SA_SIGINFO : constant := 16#04#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/5lintman.adb b/gcc/ada/5lintman.adb
deleted file mode 100644
index 56871f3d9ec..00000000000
--- a/gcc/ada/5lintman.adb
+++ /dev/null
@@ -1,401 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
--- --
--- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
--- --
--- B o d y --
--- --
--- Copyright (C) 1991-1994, Florida State University --
--- Copyright (C) 1995-2003, Ada Core Technologies --
--- --
--- GNARL is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see 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 other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNARL was developed by the GNARL team at Florida State University. --
--- Extensive contributions were provided by Ada Core Technologies, Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the GNU/Linux version of this package
-
--- This file performs the system-dependent translation between machine
--- exceptions and the Ada exceptions, if any, that should be raised when they
--- occur. This version works for the x86 running linux.
-
--- This is a Sun OS (FSU THREADS) version of this package
-
--- PLEASE DO NOT add any dependences on other packages. ??? why not ???
--- This package is designed to work with or without tasking support.
-
--- Make a careful study of all signals available under the OS, to see which
--- need to be reserved, kept always unmasked, or kept always unmasked. Be on
--- the lookout for special signals that may be used by the thread library.
-
--- The definitions of "reserved" differ slightly between the ARM and POSIX.
--- Here is the ARM definition of reserved interrupt:
-
--- The set of reserved interrupts is implementation defined. A reserved
--- interrupt is either an interrupt for which user-defined handlers are not
--- supported, or one which already has an attached handler by some other
--- implementation-defined means. Program units can be connected to
--- non-reserved interrupts.
-
--- POSIX.5b/.5c specifies further:
-
--- Signals which the application cannot accept, and for which the application
--- cannot modify the signal action or masking, because the signals are
--- reserved for use by the Ada language implementation. The reserved signals
--- defined by this standard are Signal_Abort, Signal_Alarm,
--- Signal_Floating_Point_Error, Signal_Illegal_Instruction,
--- Signal_Segmentation_Violation, Signal_Bus_Error. If the implementation
--- supports any signals besides those defined by this standard, the
--- implementation may also reserve some of those.
-
--- The signals defined by POSIX.5b/.5c that are not specified as being
--- reserved are SIGHUP, SIGINT, SIGPIPE, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2,
--- SIGCHLD, SIGCONT, SIGSTOP, SIGTSTP, SIGTTIN, SIGTTOU, SIGIO SIGURG, and all
--- the real-time signals.
-
--- Beware of reserving signals that POSIX.5b/.5c require to be available for
--- users. POSIX.5b/.5c say:
-
--- An implementation shall not impose restrictions on the ability of an
--- application to send, accept, block, or ignore the signals defined by this
--- standard, except as specified in this standard.
-
--- Here are some other relevant requirements from POSIX.5b/.5c:
-
--- For the environment task, the initial signal mask is that specified for
--- the process...
-
--- It is anticipated that the paragraph above may be modified by a future
--- revision of this standard, to require that the realtime signals always be
--- initially masked for a process that is an Ada active partition.
-
--- For all other tasks, the initial signal mask shall include all the signals
--- that are not reserved signals and are not bound to entries of the task.
-
-with Interfaces.C;
--- used for int and other types
-
-with System.Error_Reporting;
--- used for Shutdown
-
-with System.OS_Interface;
--- used for various Constants, Signal and types
-
-with Ada.Exceptions;
--- used for Exception_Id
--- Raise_From_Signal_Handler
-
-with System.Soft_Links;
--- used for Get_Machine_State_Addr
-
-with Unchecked_Conversion;
-
-package body System.Interrupt_Management is
-
- use Interfaces.C;
- use System.Error_Reporting;
- use System.OS_Interface;
-
- package TSL renames System.Soft_Links;
-
- type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID;
- Exception_Interrupts : constant Interrupt_List :=
- (SIGFPE, SIGILL, SIGSEGV);
-
- Unreserve_All_Interrupts : Interfaces.C.int;
- pragma Import
- (C, Unreserve_All_Interrupts, "__gl_unreserve_all_interrupts");
-
- subtype int is Interfaces.C.int;
- subtype unsigned_short is Interfaces.C.unsigned_short;
- subtype unsigned_long is Interfaces.C.unsigned_long;
-
- ----------------------
- -- Notify_Exception --
- ----------------------
-
- pragma Warnings (Off);
- -- Because many unaccessed arguments
-
- Signal_Mask : aliased sigset_t;
- -- The set of signals handled by Notify_Exception
-
- -- This function identifies the Ada exception to be raised using
- -- the information when the system received a synchronous signal.
- -- Since this function is machine and OS dependent, different code
- -- has to be provided for different target.
-
- procedure Notify_Exception
- (signo : Signal;
- gs : unsigned_short;
- fs : unsigned_short;
- es : unsigned_short;
- ds : unsigned_short;
- edi : unsigned_long;
- esi : unsigned_long;
- ebp : unsigned_long;
- esp : unsigned_long;
- ebx : unsigned_long;
- edx : unsigned_long;
- ecx : unsigned_long;
- eax : unsigned_long;
- trapno : unsigned_long;
- err : unsigned_long;
- eip : unsigned_long;
- cs : unsigned_short;
- eflags : unsigned_long;
- esp_at_signal : unsigned_long;
- ss : unsigned_short;
- fpstate : System.Address;
- oldmask : unsigned_long;
- cr2 : unsigned_long);
-
- procedure Notify_Exception
- (signo : Signal;
- gs : unsigned_short;
- fs : unsigned_short;
- es : unsigned_short;
- ds : unsigned_short;
- edi : unsigned_long;
- esi : unsigned_long;
- ebp : unsigned_long;
- esp : unsigned_long;
- ebx : unsigned_long;
- edx : unsigned_long;
- ecx : unsigned_long;
- eax : unsigned_long;
- trapno : unsigned_long;
- err : unsigned_long;
- eip : unsigned_long;
- cs : unsigned_short;
- eflags : unsigned_long;
- esp_at_signal : unsigned_long;
- ss : unsigned_short;
- fpstate : System.Address;
- oldmask : unsigned_long;
- cr2 : unsigned_long)
- is
- pragma Warnings (On);
-
- function To_Machine_State_Ptr is new
- Unchecked_Conversion (Address, Machine_State_Ptr);
-
- -- These are not directly visible
-
- procedure Raise_From_Signal_Handler
- (E : Ada.Exceptions.Exception_Id;
- M : System.Address);
- pragma Import
- (Ada, Raise_From_Signal_Handler,
- "ada__exceptions__raise_from_signal_handler");
- pragma No_Return (Raise_From_Signal_Handler);
-
- mstate : Machine_State_Ptr;
- message : aliased constant String := "" & ASCII.Nul;
- -- A null terminated String.
-
- Result : int;
-
- begin
-
- -- Raise_From_Signal_Handler makes sure that the exception is raised
- -- safely from this signal handler.
-
- -- ??? The original signal mask (the one we had before coming into this
- -- signal catching function) should be restored by
- -- Raise_From_Signal_Handler. For now, restore it explicitely
-
- Result := pthread_sigmask (SIG_UNBLOCK, Signal_Mask'Access, null);
- pragma Assert (Result = 0);
-
- -- Check that treatment of exception propagation here
- -- is consistent with treatment of the abort signal in
- -- System.Task_Primitives.Operations.
-
- mstate := To_Machine_State_Ptr (TSL.Get_Machine_State_Addr.all);
- mstate.eip := eip;
- mstate.ebx := ebx;
- mstate.esp := esp_at_signal;
- mstate.ebp := ebp;
- mstate.esi := esi;
- mstate.edi := edi;
-
- case signo is
- when SIGFPE =>
- Raise_From_Signal_Handler
- (Constraint_Error'Identity, message'Address);
- when SIGILL =>
- Raise_From_Signal_Handler
- (Constraint_Error'Identity, message'Address);
- when SIGSEGV =>
- Raise_From_Signal_Handler
- (Storage_Error'Identity, message'Address);
- when others =>
- if Shutdown ("Unexpected signal") then
- null;
- end if;
- end case;
- end Notify_Exception;
-
- ---------------------------
- -- Initialize_Interrupts --
- ---------------------------
-
- -- Nothing needs to be done on this platform.
-
- procedure Initialize_Interrupts is
- begin
- null;
- end Initialize_Interrupts;
-
-begin
- declare
- act : aliased struct_sigaction;
- old_act : aliased struct_sigaction;
- Result : int;
-
- function State (Int : Interrupt_ID) return Character;
- pragma Import (C, State, "__gnat_get_interrupt_state");
- -- Get interrupt state. Defined in a-init.c
- -- The input argument is the interrupt number,
- -- and the result is one of the following:
-
- User : constant Character := 'u';
- Runtime : constant Character := 'r';
- Default : constant Character := 's';
- -- 'n' this interrupt not set by any Interrupt_State pragma
- -- 'u' Interrupt_State pragma set state to User
- -- 'r' Interrupt_State pragma set state to Runtime
- -- 's' Interrupt_State pragma set state to System (use "default"
- -- system handler)
-
- begin
- -- Need to call pthread_init very early because it is doing signal
- -- initializations.
-
- pthread_init;
-
- Abort_Task_Interrupt := SIGADAABORT;
-
- act.sa_handler := Notify_Exception'Address;
-
- act.sa_flags := 0;
-
- -- On some targets, we set sa_flags to SA_NODEFER so that during the
- -- handler execution we do not change the Signal_Mask to be masked for
- -- the Signal.
-
- -- This is a temporary fix to the problem that the Signal_Mask is
- -- not restored after the exception (longjmp) from the handler.
- -- The right fix should be made in sigsetjmp so that we save
- -- the Signal_Set and restore it after a longjmp.
-
- -- Since SA_NODEFER is obsolete, instead we reset explicitely
- -- the mask in the exception handler.
-
- Result := sigemptyset (Signal_Mask'Access);
- pragma Assert (Result = 0);
-
- -- Add signals that map to Ada exceptions to the mask.
-
- for J in Exception_Interrupts'Range loop
- if State (Exception_Interrupts (J)) /= Default then
- Result :=
- sigaddset (Signal_Mask'Access, Signal (Exception_Interrupts (J)));
- pragma Assert (Result = 0);
- end if;
- end loop;
-
- act.sa_mask := Signal_Mask;
-
- pragma Assert (Keep_Unmasked = (Interrupt_ID'Range => False));
- pragma Assert (Reserve = (Interrupt_ID'Range => False));
-
- -- Process state of exception signals
-
- for J in Exception_Interrupts'Range loop
- if State (Exception_Interrupts (J)) /= User then
- Keep_Unmasked (Exception_Interrupts (J)) := True;
- Reserve (Exception_Interrupts (J)) := True;
-
- if State (Exception_Interrupts (J)) /= Default then
- Result :=
- sigaction
- (Signal (Exception_Interrupts (J)), act'Unchecked_Access,
- old_act'Unchecked_Access);
- pragma Assert (Result = 0);
- end if;
- end if;
- end loop;
-
- if State (Abort_Task_Interrupt) /= User then
- Keep_Unmasked (Abort_Task_Interrupt) := True;
- Reserve (Abort_Task_Interrupt) := True;
- end if;
-
- -- Set SIGINT to unmasked state as long as it's
- -- not in "User" state. Check for Unreserve_All_Interrupts last
-
- if State (SIGINT) /= User then
- Keep_Unmasked (SIGINT) := True;
- Reserve (SIGINT) := True;
- end if;
-
- -- Check all signals for state that requires keeping them
- -- unmasked and reserved
-
- for J in Interrupt_ID'Range loop
- if State (J) = Default or else State (J) = Runtime then
- Keep_Unmasked (J) := True;
- Reserve (J) := True;
- end if;
- end loop;
-
- -- Add the set of signals that must always be unmasked for this target
-
- for J in Unmasked'Range loop
- Keep_Unmasked (Interrupt_ID (Unmasked (J))) := True;
- Reserve (Interrupt_ID (Unmasked (J))) := True;
- end loop;
-
- -- Add target-specific reserved signals
-
- for J in Reserved'Range loop
- Reserve (Interrupt_ID (Reserved (J))) := True;
- end loop;
-
- -- Process pragma Unreserve_All_Interrupts. This overrides any
- -- settings due to pragma Interrupt_State:
-
- if Unreserve_All_Interrupts /= 0 then
- Keep_Unmasked (SIGINT) := False;
- Reserve (SIGINT) := False;
- end if;
-
- -- We do not have Signal 0 in reality. We just use this value
- -- to identify non-existent signals (see s-intnam.ads). Therefore,
- -- Signal 0 should not be used in all signal related operations hence
- -- mark it as reserved.
-
- Reserve (0) := True;
- end;
-end System.Interrupt_Management;
diff --git a/gcc/ada/5lml-tgt.adb b/gcc/ada/5lml-tgt.adb
index ad40c10b0df..b9d4217fe19 100644
--- a/gcc/ada/5lml-tgt.adb
+++ b/gcc/ada/5lml-tgt.adb
@@ -106,6 +106,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -115,6 +116,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Relocatable);
diff --git a/gcc/ada/5losinte.ads b/gcc/ada/5losinte.ads
index 498fa62574e..8ca3d616072 100644
--- a/gcc/ada/5losinte.ads
+++ b/gcc/ada/5losinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1991-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1991-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -162,6 +162,8 @@ package System.OS_Interface is
end record;
type Machine_State_Ptr is access all Machine_State;
+ SA_SIGINFO : constant := 16#04#;
+
SIG_BLOCK : constant := 0;
SIG_UNBLOCK : constant := 1;
SIG_SETMASK : constant := 2;
diff --git a/gcc/ada/5nsystem.ads b/gcc/ada/5nsystem.ads
new file mode 100644
index 00000000000..37a495d8870
--- /dev/null
+++ b/gcc/ada/5nsystem.ads
@@ -0,0 +1,150 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M --
+-- --
+-- S p e c --
+-- (GNU-Linux/x86-64 Version) --
+-- --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+package System is
+pragma Pure (System);
+-- Note that we take advantage of the implementation permission to
+-- make this unit Pure instead of Preelaborable, see RM 13.7(36)
+
+ type Name is (SYSTEM_NAME_GNAT);
+ System_Name : constant Name := SYSTEM_NAME_GNAT;
+
+ -- System-Dependent Named Numbers
+
+ Min_Int : constant := Long_Long_Integer'First;
+ Max_Int : constant := Long_Long_Integer'Last;
+
+ Max_Binary_Modulus : constant := 2 ** Long_Long_Integer'Size;
+ Max_Nonbinary_Modulus : constant := Integer'Last;
+
+ Max_Base_Digits : constant := Long_Long_Float'Digits;
+ Max_Digits : constant := Long_Long_Float'Digits;
+
+ Max_Mantissa : constant := 63;
+ Fine_Delta : constant := 2.0 ** (-Max_Mantissa);
+
+ Tick : constant := 0.000_001;
+
+ -- Storage-related Declarations
+
+ type Address is private;
+ Null_Address : constant Address;
+
+ Storage_Unit : constant := 8;
+ Word_Size : constant := 64;
+ Memory_Size : constant := 2 ** 64;
+
+ -- Address comparison
+
+ function "<" (Left, Right : Address) return Boolean;
+ function "<=" (Left, Right : Address) return Boolean;
+ function ">" (Left, Right : Address) return Boolean;
+ function ">=" (Left, Right : Address) return Boolean;
+ function "=" (Left, Right : Address) return Boolean;
+
+ pragma Import (Intrinsic, "<");
+ pragma Import (Intrinsic, "<=");
+ pragma Import (Intrinsic, ">");
+ pragma Import (Intrinsic, ">=");
+ pragma Import (Intrinsic, "=");
+
+ -- Other System-Dependent Declarations
+
+ type Bit_Order is (High_Order_First, Low_Order_First);
+ Default_Bit_Order : constant Bit_Order := Low_Order_First;
+
+ -- Priority-related Declarations (RM D.1)
+
+ Max_Priority : constant Positive := 30;
+ Max_Interrupt_Priority : constant Positive := 31;
+
+ subtype Any_Priority is Integer range 0 .. 31;
+ subtype Priority is Any_Priority range 0 .. 30;
+ subtype Interrupt_Priority is Any_Priority range 31 .. 31;
+
+ Default_Priority : constant Priority := 15;
+
+private
+
+ type Address is mod Memory_Size;
+ Null_Address : constant Address := 0;
+
+ --------------------------------------
+ -- System Implementation Parameters --
+ --------------------------------------
+
+ -- These parameters provide information about the target that is used
+ -- by the compiler. They are in the private part of System, where they
+ -- can be accessed using the special circuitry in the Targparm unit
+ -- whose source should be consulted for more detailed descriptions
+ -- of the individual switch values.
+
+ AAMP : constant Boolean := False;
+ Backend_Divide_Checks : constant Boolean := False;
+ Backend_Overflow_Checks : constant Boolean := False;
+ Command_Line_Args : constant Boolean := True;
+ Configurable_Run_Time : constant Boolean := False;
+ Denorm : constant Boolean := True;
+ Duration_32_Bits : constant Boolean := False;
+ Exit_Status_Supported : constant Boolean := True;
+ Fractional_Fixed_Ops : constant Boolean := False;
+ Frontend_Layout : constant Boolean := False;
+ Functions_Return_By_DSP : constant Boolean := False;
+ Machine_Overflows : constant Boolean := False;
+ Machine_Rounds : constant Boolean := True;
+ OpenVMS : constant Boolean := False;
+ Signed_Zeros : constant Boolean := True;
+ Stack_Check_Default : constant Boolean := False;
+ Stack_Check_Probes : constant Boolean := False;
+ Support_64_Bit_Divides : constant Boolean := True;
+ Support_Aggregates : constant Boolean := True;
+ Support_Composite_Assign : constant Boolean := True;
+ Support_Composite_Compare : constant Boolean := True;
+ Support_Long_Shifts : constant Boolean := True;
+ Suppress_Standard_Library : constant Boolean := False;
+ Use_Ada_Main_Program_Name : constant Boolean := False;
+ ZCX_By_Default : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := True;
+ Front_End_ZCX_Support : constant Boolean := False;
+
+ -- Obsolete entries, to be removed eventually (bootstrap issues!)
+
+ High_Integrity_Mode : constant Boolean := False;
+ Long_Shifts_Inlined : constant Boolean := True;
+
+end System;
diff --git a/gcc/ada/5posinte.ads b/gcc/ada/5posinte.ads
index fa94ad21feb..57f04a82c17 100644
--- a/gcc/ada/5posinte.ads
+++ b/gcc/ada/5posinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -155,6 +155,10 @@ package System.OS_Interface is
SIG_DFL : constant := 0;
SIG_IGN : constant := 1;
+ SA_SIGINFO : constant := 0;
+ -- Dummy constant for a sa_flags bit. A proper definition is needed only
+ -- for the GCC/ZCX EH scheme (see System.Interrupt_Management).
+
function sigaction
(sig : Signal;
act : struct_sigaction_ptr;
diff --git a/gcc/ada/5sml-tgt.adb b/gcc/ada/5sml-tgt.adb
index 901e7a68bee..a7bc9333b66 100644
--- a/gcc/ada/5sml-tgt.adb
+++ b/gcc/ada/5sml-tgt.adb
@@ -100,6 +100,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -109,6 +110,7 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Relocatable);
diff --git a/gcc/ada/5tosinte.ads b/gcc/ada/5tosinte.ads
index 14570656b9b..eaaf4e584df 100644
--- a/gcc/ada/5tosinte.ads
+++ b/gcc/ada/5tosinte.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1997-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2003, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -249,6 +249,8 @@ package System.OS_Interface is
pragma Convention (C, struct_sigaction);
type struct_sigaction_ptr is access all struct_sigaction;
+ SA_SIGINFO : constant := 16#08#;
+
SIG_BLOCK : constant := 1;
SIG_UNBLOCK : constant := 2;
SIG_SETMASK : constant := 3;
diff --git a/gcc/ada/5vml-tgt.adb b/gcc/ada/5vml-tgt.adb
index 3dba336db29..269e8b045e5 100644
--- a/gcc/ada/5vml-tgt.adb
+++ b/gcc/ada/5vml-tgt.adb
@@ -59,13 +59,9 @@ package body MLib.Tgt is
-- Options to use when invoking gcc to build the dynamic library
No_Start_Files : aliased String := "-nostartfiles";
- For_Linker_Opt : aliased String := "--for-linker=symvec.opt";
- Gsmatch : aliased String := "--for-linker=gsmatch=equal,1,0";
- VMS_Options : constant Argument_List :=
- (No_Start_Files'Access, For_Linker_Opt'Access, Gsmatch'Access);
-
--- Command : String_Access;
+ VMS_Options : Argument_List :=
+ (No_Start_Files'Access, null);
Gnatsym_Name : constant String := "gnatsym";
@@ -134,6 +130,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -143,10 +140,9 @@ package body MLib.Tgt is
pragma Unreferenced (Foreign);
pragma Unreferenced (Afiles);
pragma Unreferenced (Lib_Address);
- pragma Unreferenced (Lib_Version);
pragma Unreferenced (Relocatable);
- Opt_File_Name : constant String := "symvec.opt";
+
Lib_File : constant String :=
Lib_Dir & Directory_Separator & "lib" &
@@ -163,6 +159,13 @@ package body MLib.Tgt is
-- file name of an interface of the SAL.
-- For other libraries, always return True.
+ function Option_File_Name return String;
+ -- Returns Symbol_File, if not empty. Otherwise, returns "symvec.opt"
+
+ function Version_String return String;
+ -- Returns Lib_Version if not empty, otherwise returns "1".
+ -- Fails gnatmake if Lib_Version is not the image of a positive number.
+
------------------
-- Is_Interface --
------------------
@@ -192,7 +195,57 @@ package body MLib.Tgt is
end if;
end Is_Interface;
+ ----------------------
+ -- Option_File_Name --
+ ----------------------
+
+ function Option_File_Name return String is
+ begin
+ if Symbol_Data.Symbol_File = No_Name then
+ return "symvec.opt";
+
+ else
+ return Get_Name_String (Symbol_Data.Symbol_File);
+ end if;
+ end Option_File_Name;
+
+ --------------------
+ -- Version_String --
+ --------------------
+
+ function Version_String return String is
+ Version : Integer := 0;
+ begin
+ if Lib_Version = "" then
+ return "1";
+
+ else
+ begin
+ Version := Integer'Value (Lib_Version);
+
+ if Version <= 0 then
+ raise Constraint_Error;
+ end if;
+
+ return Lib_Version;
+
+ exception
+ when Constraint_Error =>
+ Fail ("illegal version """, Lib_Version,
+ """ (on VMS version must be a positive number)");
+ return "";
+ end;
+ end if;
+ end Version_String;
+
+ Opt_File_Name : constant String := Option_File_Name;
+ For_Linker_Opt : constant String_Access :=
+ new String'("--for-linker=" & Opt_File_Name);
+ Version : constant String := Version_String;
+
begin
+ VMS_Options (VMS_Options'First + 1) := For_Linker_Opt;
+
for J in Inter'Range loop
To_Lower (Inter (J).all);
end loop;
@@ -288,19 +341,61 @@ package body MLib.Tgt is
end;
end if;
- -- Allocate the argument list and put the symbol file name
+ -- Allocate the argument list and put the symbol file name, the
+ -- reference (if any) and the policy (if not autonomous).
- Arguments := new Argument_List (1 .. Ofiles'Length + 2);
+ Arguments := new Argument_List (1 .. Ofiles'Length + 8);
- Last_Argument := 1;
+ Last_Argument := 0;
+
+ -- Verbosity
if Verbose_Mode then
+ Last_Argument := Last_Argument + 1;
Arguments (Last_Argument) := new String'("-v");
+ end if;
+
+ -- Version number (major ID)
+
+ if Lib_Version /= "" then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-V");
Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'(Version);
end if;
+ -- Symbol file
+
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-s");
+ Last_Argument := Last_Argument + 1;
Arguments (Last_Argument) := new String'(Opt_File_Name);
+ -- Reference Symbol File
+
+ if Symbol_Data.Reference /= No_Name then
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-r");
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) :=
+ new String'(Get_Name_String (Symbol_Data.Reference));
+ end if;
+
+ -- Policy
+
+ case Symbol_Data.Symbol_Policy is
+ when Autonomous =>
+ null;
+
+ when Compliant =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-c");
+
+ when Controlled =>
+ Last_Argument := Last_Argument + 1;
+ Arguments (Last_Argument) := new String'("-C");
+ end case;
+
-- Add each relevant object file
for Index in Ofiles'Range loop
diff --git a/gcc/ada/5vsymbol.adb b/gcc/ada/5vsymbol.adb
index d505491c86b..c623e42b383 100644
--- a/gcc/ada/5vsymbol.adb
+++ b/gcc/ada/5vsymbol.adb
@@ -36,10 +36,32 @@ package body Symbols is
Symbol_Vector : constant String := "SYMBOL_VECTOR=(";
Equal_Data : constant String := "=DATA)";
Equal_Procedure : constant String := "=PROCEDURE)";
+ Gsmatch : constant String := "gsmatch=equal,";
Symbol_File_Name : String_Access := null;
-- Name of the symbol file
+ Sym_Policy : Policy := Autonomous;
+ -- The symbol policy. Set by Initialize
+
+ Major_ID : Integer := 1;
+ -- The Major ID. May be modified by Initialize if Library_Version is
+ -- specified or if it is read from the reference symbol file.
+
+ Soft_Major_ID : Boolean := True;
+ -- False if library version is specified in procedure Initialize.
+ -- When True, Major_ID may be modified if found in the reference symbol
+ -- file.
+
+ Minor_ID : Natural := 0;
+ -- The Minor ID. May be modified if read from the reference symbol file
+
+ Soft_Minor_ID : Boolean := True;
+ -- False if symbol policy is Autonomous, if library version is specified
+ -- in procedure Initialize and is not the same as the major ID read from
+ -- the reference symbol file. When True, Minor_ID may be increased in
+ -- Compliant symbol policy.
+
subtype Byte is Character;
-- Object files are stream of bytes, but some of these bytes, those for
-- the names of the symbols, are ASCII characters.
@@ -67,6 +89,9 @@ package body Symbols is
Number_Of_Characters : Natural := 0;
-- The number of characters of each section
+ -- The following variables are used by procedure Process when reading an
+ -- object file.
+
Code : Number := 0;
Length : Natural := 0;
@@ -87,6 +112,10 @@ package body Symbols is
procedure Get (N : out Natural);
-- Read two bytes from the object file, LSByte first, as a Natural
+
+ function Image (N : Integer) return String;
+ -- Returns the image of N, without the initial space
+
-----------
-- Equal --
-----------
@@ -121,15 +150,32 @@ package body Symbols is
N := Natural (Result);
end Get;
+ -----------
+ -- Image --
+ -----------
+
+ function Image (N : Integer) return String is
+ Result : constant String := N'Img;
+ begin
+ if Result (Result'First) = ' ' then
+ return Result (Result'First + 1 .. Result'Last);
+
+ else
+ return Result;
+ end if;
+ end Image;
+
----------------
-- Initialize --
----------------
procedure Initialize
- (Symbol_File : String;
- Force : Boolean;
- Quiet : Boolean;
- Success : out Boolean)
+ (Symbol_File : String;
+ Reference : String;
+ Symbol_Policy : Policy;
+ Quiet : Boolean;
+ Version : String;
+ Success : out Boolean)
is
File : Ada.Text_IO.File_Type;
Line : String (1 .. 1_000);
@@ -140,6 +186,40 @@ package body Symbols is
Symbol_File_Name := new String'(Symbol_File);
+ -- Record the policy
+
+ Sym_Policy := Symbol_Policy;
+
+ -- Record the version (Major ID)
+
+ if Version = "" then
+ Major_ID := 1;
+ Soft_Major_ID := True;
+
+ else
+ begin
+ Major_ID := Integer'Value (Version);
+ Soft_Major_ID := False;
+
+ if Major_ID <= 0 then
+ raise Constraint_Error;
+ end if;
+
+ exception
+ when Constraint_Error =>
+ if not Quiet then
+ Put_Line ("Version """ & Version & """ is illegal.");
+ Put_Line ("On VMS, version must be a positive number");
+ end if;
+
+ Success := False;
+ return;
+ end;
+ end if;
+
+ Minor_ID := 0;
+ Soft_Minor_ID := Sym_Policy /= Autonomous;
+
-- Empty the symbol tables
Symbol_Table.Set_Last (Original_Symbols, 0);
@@ -149,11 +229,11 @@ package body Symbols is
Success := True;
- -- If Force is not set, attempt to read the symbol file
+ -- If policy is not autonomous, attempt to read the reference file
- if not Force then
+ if Sym_Policy /= Autonomous then
begin
- Open (File, In_File, Symbol_File);
+ Open (File, In_File, Reference);
exception
when Ada.Text_IO.Name_Error =>
@@ -161,7 +241,7 @@ package body Symbols is
when X : others =>
if not Quiet then
- Put_Line ("could not open """ & Symbol_File & """");
+ Put_Line ("could not open """ & Reference & """");
Put_Line (Exception_Message (X));
end if;
@@ -169,20 +249,31 @@ package body Symbols is
return;
end;
+ -- Read line by line
+
while not End_Of_File (File) loop
Get_Line (File, Line, Last);
+ -- Ignore empty lines
+
if Last = 0 then
null;
+ -- Ignore lines starting with "case_sensitive="
+
elsif Last > Case_Sensitive'Length
and then Line (1 .. Case_Sensitive'Length) = Case_Sensitive
then
null;
+ -- Line starting with "SYMBOL_VECTOR=("
+
elsif Last > Symbol_Vector'Length
and then Line (1 .. Symbol_Vector'Length) = Symbol_Vector
then
+
+ -- SYMBOL_VECTOR=(<symbol>=DATA)
+
if Last > Symbol_Vector'Length + Equal_Data'Length and then
Line (Last - Equal_Data'Length + 1 .. Last) = Equal_Data
then
@@ -195,6 +286,8 @@ package body Symbols is
Kind => Data,
Present => True);
+ -- SYMBOL_VECTOR=(<symbol>=PROCEDURE)
+
elsif Last > Symbol_Vector'Length + Equal_Procedure'Length
and then
Line (Last - Equal_Procedure'Length + 1 .. Last) =
@@ -209,9 +302,11 @@ package body Symbols is
Kind => Proc,
Present => True);
+ -- Anything else is incorrectly formatted
+
else
if not Quiet then
- Put_Line ("symbol file """ & Symbol_File &
+ Put_Line ("symbol file """ & Reference &
""" is incorrectly formatted:");
Put_Line ("""" & Line (1 .. Last) & """");
end if;
@@ -221,10 +316,95 @@ package body Symbols is
return;
end if;
+ -- Lines with "gsmatch=equal,<Major_ID>,<Minor_Id>
+
+ elsif Last > Gsmatch'Length
+ and then Line (1 .. Gsmatch'Length) = Gsmatch
+ then
+ declare
+ Start : Positive := Gsmatch'Length + 1;
+ Finish : Positive := Start;
+ OK : Boolean := True;
+ ID : Integer;
+
+ begin
+ loop
+ if Line (Finish) not in '0' .. '9'
+ or else Finish >= Last - 1
+ then
+ OK := False;
+ exit;
+ end if;
+
+ exit when Line (Finish + 1) = ',';
+
+ Finish := Finish + 1;
+ end loop;
+
+ if OK then
+ ID := Integer'Value (Line (Start .. Finish));
+ OK := ID /= 0;
+
+ -- If Soft_Major_ID is True, it means that
+ -- Library_Version was not specified.
+
+ if Soft_Major_ID then
+ Major_ID := ID;
+
+ -- If the Major ID in the reference file is different
+ -- from the Library_Version, then the Minor ID will be 0
+ -- because there is no point in taking the Minor ID in
+ -- the reference file, or incrementing it. So, we set
+ -- Soft_Minor_ID to False, so that we don't modify
+ -- the Minor_ID later.
+
+ elsif Major_ID /= ID then
+ Soft_Minor_ID := False;
+ end if;
+
+ Start := Finish + 2;
+ Finish := Start;
+
+ loop
+ if Line (Finish) not in '0' .. '9' then
+ OK := False;
+ exit;
+ end if;
+
+ exit when Finish = Last;
+
+ Finish := Finish + 1;
+ end loop;
+
+ -- Only set Minor_ID if Soft_Minor_ID is True (see above)
+
+ if OK and then Soft_Minor_ID then
+ Minor_ID := Integer'Value (Line (Start .. Finish));
+ end if;
+ end if;
+
+ -- If OK is not True, that means the line is not correctly
+ -- formatted.
+
+ if not OK then
+ if not Quiet then
+ Put_Line ("symbol file """ & Reference &
+ """ is incorrectly formatted");
+ Put_Line ("""" & Line (1 .. Last) & """");
+ end if;
+
+ Close (File);
+ Success := False;
+ return;
+ end if;
+ end;
+
+ -- Anything else is incorrectly formatted
+
else
if not Quiet then
Put_Line ("unexpected line in symbol file """ &
- Symbol_File & """");
+ Reference & """");
Put_Line ("""" & Line (1 .. Last) & """");
end if;
@@ -247,7 +427,8 @@ package body Symbols is
Success : out Boolean)
is
begin
- -- Open the object file. Return with Success = False if this fails.
+ -- Open the object file with Byte_IO. Return with Success = False if
+ -- this fails.
begin
Open (File, In_File, Object_File);
@@ -410,8 +591,9 @@ package body Symbols is
else
- -- First find if the symbols in the symbol file are also in the
- -- object files.
+ -- First find if the symbols in the reference symbol file are also
+ -- in the object files. Note that this is not done if the policy is
+ -- Autonomous, because no reference symbol file has been read.
-- Expect the first symbol in the symbol file to also be the first
-- in Complete_Symbols.
@@ -450,13 +632,27 @@ package body Symbols is
-- If the symbol is not found, mark it as such in the table
if not Found then
- if not Quiet then
+ if (not Quiet) or else Sym_Policy = Controlled then
Put_Line ("symbol """ & S_Data.Name.all &
""" is no longer present in the object files");
end if;
+ if Sym_Policy = Controlled then
+ Success := False;
+ return;
+
+ elsif Soft_Minor_ID then
+ Minor_ID := Minor_ID + 1;
+ Soft_Minor_ID := False;
+ end if;
+
Original_Symbols.Table (Index_1).Present := False;
Free (Original_Symbols.Table (Index_1).Name);
+
+ if Soft_Minor_ID then
+ Minor_ID := Minor_ID + 1;
+ Soft_Minor_ID := False;
+ end if;
end if;
end loop;
@@ -466,6 +662,18 @@ package body Symbols is
S_Data := Complete_Symbols.Table (Index);
if S_Data.Present then
+
+ if Sym_Policy = Controlled then
+ Put_Line ("symbol """ & S_Data.Name.all &
+ """ is not in the reference symbol file");
+ Success := False;
+ return;
+
+ elsif Soft_Minor_ID then
+ Minor_ID := Minor_ID + 1;
+ Soft_Minor_ID := False;
+ end if;
+
Symbol_Table.Increment_Last (Original_Symbols);
Original_Symbols.Table (Symbol_Table.Last (Original_Symbols)) :=
S_Data;
@@ -501,6 +709,13 @@ package body Symbols is
Put (File, Case_Sensitive);
Put_Line (File, "NO");
+ -- Put the version IDs
+
+ Put (File, Gsmatch);
+ Put (File, Image (Major_ID));
+ Put (File, ',');
+ Put_Line (File, Image (Minor_ID));
+
-- And we are done
Close (File);
diff --git a/gcc/ada/5vtraent.adb b/gcc/ada/5vtraent.adb
index bab8daf7f08..532acad6e32 100644
--- a/gcc/ada/5vtraent.adb
+++ b/gcc/ada/5vtraent.adb
@@ -47,22 +47,13 @@ package body System.Traceback_Entries is
end PC_For;
------------
- -- SP_For --
+ -- PV_For --
------------
- function SP_For (TB_Entry : Traceback_Entry) return System.Address is
+ function PV_For (TB_Entry : Traceback_Entry) return System.Address is
begin
- return TB_Entry.SP;
- end SP_For;
-
- ------------
- -- FP_For --
- ------------
-
- function FP_For (TB_Entry : Traceback_Entry) return System.Address is
- begin
- return TB_Entry.FP;
- end FP_For;
+ return TB_Entry.PV;
+ end PV_For;
------------------
-- TB_Entry_For --
@@ -70,7 +61,7 @@ package body System.Traceback_Entries is
function TB_Entry_For (PC : System.Address) return Traceback_Entry is
begin
- return (PC => PC, SP => System.Null_Address, FP => System.Null_Address);
+ return (PC => PC, PV => System.Null_Address);
end TB_Entry_For;
end System.Traceback_Entries;
diff --git a/gcc/ada/5vtraent.ads b/gcc/ada/5vtraent.ads
index ed71437ea62..0d27c197fff 100644
--- a/gcc/ada/5vtraent.ads
+++ b/gcc/ada/5vtraent.ads
@@ -35,34 +35,25 @@
-- --
------------------------------------------------------------------------------
--- This is the Alpha/OpenVMS version of this package.
+-- This is the Alpha/OpenVMS version of this package
package System.Traceback_Entries is
- type Traceback_Entry is private;
-
- Null_TB_Entry : constant Traceback_Entry;
-
- function PC_For (TB_Entry : Traceback_Entry) return System.Address;
- function SP_For (TB_Entry : Traceback_Entry) return System.Address;
- function FP_For (TB_Entry : Traceback_Entry) return System.Address;
-
- function TB_Entry_For (PC : System.Address) return Traceback_Entry;
-
-private
-
type Traceback_Entry is record
PC : System.Address;
- SP : System.Address;
- FP : System.Address;
+ PV : System.Address;
end record;
pragma Suppress_Initialization (Traceback_Entry);
- Null_TB_Entry : constant Traceback_Entry
- := (PC => System.Null_Address,
- SP => System.Null_Address,
- FP => System.Null_Address);
+ Null_TB_Entry : constant Traceback_Entry :=
+ (PC => System.Null_Address,
+ PV => System.Null_Address);
+
+ function PC_For (TB_Entry : Traceback_Entry) return System.Address;
+ function PV_For (TB_Entry : Traceback_Entry) return System.Address;
+
+ function TB_Entry_For (PC : System.Address) return Traceback_Entry;
end System.Traceback_Entries;
diff --git a/gcc/ada/5wml-tgt.adb b/gcc/ada/5wml-tgt.adb
index ffb3b2acf68..5747ead4cdb 100644
--- a/gcc/ada/5wml-tgt.adb
+++ b/gcc/ada/5wml-tgt.adb
@@ -91,6 +91,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -99,6 +100,7 @@ package body MLib.Tgt is
is
pragma Unreferenced (Ofiles);
pragma Unreferenced (Interfaces);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Driver_Name);
pragma Unreferenced (Lib_Version);
pragma Unreferenced (Auto_Init);
diff --git a/gcc/ada/5wosinte.ads b/gcc/ada/5wosinte.ads
index cf9aee5a35b..8a74f50d14b 100644
--- a/gcc/ada/5wosinte.ads
+++ b/gcc/ada/5wosinte.ads
@@ -46,6 +46,8 @@ with Interfaces.C.Strings;
package System.OS_Interface is
pragma Preelaborate;
+ pragma Linker_Options ("-mthreads");
+
subtype int is Interfaces.C.int;
subtype long is Interfaces.C.long;
diff --git a/gcc/ada/5wsystem.ads b/gcc/ada/5wsystem.ads
index 9316644e0d9..2a7496a9843 100644
--- a/gcc/ada/5wsystem.ads
+++ b/gcc/ada/5wsystem.ads
@@ -139,7 +139,7 @@ private
Suppress_Standard_Library : constant Boolean := False;
Use_Ada_Main_Program_Name : constant Boolean := False;
ZCX_By_Default : constant Boolean := False;
- GCC_ZCX_Support : constant Boolean := True;
+ GCC_ZCX_Support : constant Boolean := False;
Front_End_ZCX_Support : constant Boolean := False;
-- Obsolete entries, to be removed eventually (bootstrap issues!)
diff --git a/gcc/ada/5wtaprop.adb b/gcc/ada/5wtaprop.adb
index 506ece210c1..aa84c28bfaf 100644
--- a/gcc/ada/5wtaprop.adb
+++ b/gcc/ada/5wtaprop.adb
@@ -296,9 +296,13 @@ package body System.Task_Primitives.Operations is
Timed_Out : out Boolean;
Status : out Integer)
is
- Time_Out : DWORD;
- Result : BOOL;
- Wait_Result : DWORD;
+ Time_Out_Max : constant DWORD := 16#FFFF0000#;
+ -- NT 4 cannot handle timeout values that are too large,
+ -- e.g. DWORD'Last - 1
+
+ Time_Out : DWORD;
+ Result : BOOL;
+ Wait_Result : DWORD;
begin
-- Must reset Cond BEFORE L is unlocked.
@@ -315,8 +319,8 @@ package body System.Task_Primitives.Operations is
Wait_Result := 0;
else
- if Rel_Time >= Duration (DWORD'Last - 1) / 1000 then
- Time_Out := DWORD'Last - 1;
+ if Rel_Time >= Duration (Time_Out_Max) / 1000 then
+ Time_Out := Time_Out_Max;
else
Time_Out := DWORD (Rel_Time * 1000);
end if;
diff --git a/gcc/ada/5zinit.adb b/gcc/ada/5zinit.adb
index c947057f044..3fe64bd1aed 100644
--- a/gcc/ada/5zinit.adb
+++ b/gcc/ada/5zinit.adb
@@ -33,9 +33,6 @@
-- This is the VxWorks version of this package
-with System.OS_Interface;
--- used for various Constants, Signal and types
-
with Interfaces.C;
-- used for int and other types
@@ -47,10 +44,58 @@ package body System.Init is
-- This unit contains initialization circuits that are system dependent.
use Ada.Exceptions;
- use System.OS_Interface;
- use type Interfaces.C.int;
+ use Interfaces.C;
+
+ --------------------------
+ -- Signal Definitions --
+ --------------------------
+
+ NSIG : constant := 32;
+ -- Number of signals on the target OS
+ type Signal is new int range 0 .. Interfaces.C."-" (NSIG, 1);
+
+ SIGILL : constant := 4; -- illegal instruction (not reset)
+ SIGFPE : constant := 8; -- floating point exception
+ SIGBUS : constant := 10; -- bus error
+ SIGSEGV : constant := 11; -- segmentation violation
+
+ type sigset_t is new long;
+
+ SIG_SETMASK : constant := 3;
+ SA_ONSTACK : constant := 16#0004#;
+
+ type struct_sigaction is record
+ sa_handler : System.Address;
+ sa_mask : sigset_t;
+ sa_flags : int;
+ end record;
+ pragma Convention (C, struct_sigaction);
+ type struct_sigaction_ptr is access all struct_sigaction;
+
+ function sigdelset (set : access sigset_t; sig : Signal) return int;
+ pragma Import (C, sigdelset, "sigdelset");
+
+ function sigemptyset (set : access sigset_t) return int;
+ pragma Import (C, sigemptyset, "sigemptyset");
+
+ function sigaction
+ (sig : Signal;
+ act : struct_sigaction_ptr;
+ oact : struct_sigaction_ptr) return int;
+ pragma Import (C, sigaction, "sigaction");
+
+ type sigset_t_ptr is access all sigset_t;
+
+ function pthread_sigmask
+ (how : int;
+ set : sigset_t_ptr;
+ oset : sigset_t_ptr) return int;
+ pragma Import (C, pthread_sigmask, "sigprocmask");
+
+ -------------------------------
+ -- Binder Generated Values --
+ -------------------------------
- -- Copies of global values computed by the binder
Gl_Main_Priority : Integer := -1;
pragma Export (C, Gl_Main_Priority, "__gl_main_priority");
@@ -104,11 +149,6 @@ package body System.Init is
-- Common procedure that is executed when a SIGFPE, SIGILL,
-- SIGSEGV, or SIGBUS is captured.
- procedure Install_Handler;
- pragma Export (C, Install_Handler, "__gnat_install_handler");
- -- Install handler for the synchronous signals. The C profile
- -- here is what is expected by the binder-generated main.
-
------------------------
-- GNAT_Error_Handler --
------------------------
@@ -238,16 +278,6 @@ package body System.Init is
end if;
end Set_Globals;
- -----------------------------
- -- Install_Signal_Handlers --
- -----------------------------
-
- function Install_Signal_Handlers return Interfaces.C.int is
- begin
- Install_Handler;
- return 0;
- end Install_Signal_Handlers;
-
---------------------
-- Install_Handler --
---------------------
diff --git a/gcc/ada/5zintman.adb b/gcc/ada/5zintman.adb
index 2933f240a39..d5e8afcf904 100644
--- a/gcc/ada/5zintman.adb
+++ b/gcc/ada/5zintman.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -53,31 +53,37 @@ with Interfaces.C;
with System.OS_Interface;
-- used for various Constants, Signal and types
-with Ada.Exceptions;
--- used for Raise_Exception
-
package body System.Interrupt_Management is
- use Ada.Exceptions;
use System.OS_Interface;
use type Interfaces.C.int;
- type Interrupt_List is array (Interrupt_ID range <>) of Interrupt_ID;
- Exception_Interrupts : constant Interrupt_List (1 .. 4) :=
- (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
+ type Signal_List is array (Signal_ID range <>) of Signal_ID;
+ Exception_Signals : constant Signal_List (1 .. 4) :=
+ (SIGFPE, SIGILL, SIGSEGV, SIGBUS);
- -- Keep these variables global so that they are initialized only once.
+ -- Keep these variables global so that they are initialized only once
+ -- What are "these variables" ???, I see only one
Exception_Action : aliased struct_sigaction;
- ----------------------
- -- Notify_Exception --
- ----------------------
+ procedure Map_And_Raise_Exception (signo : Signal);
+ pragma Import (C, Map_And_Raise_Exception, "__gnat_map_signal");
+ -- Map signal to Ada exception and raise it. Different versions
+ -- of VxWorks need different mappings.
+
+ -----------------------
+ -- Local Subprograms --
+ -----------------------
procedure Notify_Exception (signo : Signal);
-- Identify the Ada exception to be raised using
-- the information when the system received a synchronous signal.
+ ----------------------
+ -- Notify_Exception --
+ ----------------------
+
procedure Notify_Exception (signo : Signal) is
Mask : aliased sigset_t;
Result : int;
@@ -98,20 +104,7 @@ package body System.Interrupt_Management is
Result := taskResume (My_Id);
end if;
- case signo is
- when SIGFPE =>
- Raise_Exception (Constraint_Error'Identity, "SIGFPE");
- when SIGILL =>
- Raise_Exception (Constraint_Error'Identity, "SIGILL");
- when SIGSEGV =>
- Raise_Exception
- (Program_Error'Identity,
- "stack overflow or erroneous memory access");
- when SIGBUS =>
- Raise_Exception (Program_Error'Identity, "SIGBUS");
- when others =>
- Raise_Exception (Program_Error'Identity, "unhandled signal");
- end case;
+ Map_And_Raise_Exception (signo);
end Notify_Exception;
---------------------------
@@ -126,10 +119,10 @@ package body System.Interrupt_Management is
old_act : aliased struct_sigaction;
begin
- for J in Exception_Interrupts'Range loop
+ for J in Exception_Signals'Range loop
Result :=
sigaction
- (Signal (Exception_Interrupts (J)), Exception_Action'Access,
+ (Signal (Exception_Signals (J)), Exception_Action'Access,
old_act'Unchecked_Access);
pragma Assert (Result = 0);
end loop;
@@ -160,15 +153,15 @@ begin
-- Change this if you want to use another signal for task abort.
-- SIGTERM might be a good one.
- Abort_Task_Interrupt := SIGABRT;
+ Abort_Task_Signal := SIGABRT;
Exception_Action.sa_handler := Notify_Exception'Address;
Exception_Action.sa_flags := SA_ONSTACK;
Result := sigemptyset (mask'Access);
pragma Assert (Result = 0);
- for J in Exception_Interrupts'Range loop
- Result := sigaddset (mask'Access, Signal (Exception_Interrupts (J)));
+ for J in Exception_Signals'Range loop
+ Result := sigaddset (mask'Access, Signal (Exception_Signals (J)));
pragma Assert (Result = 0);
end loop;
@@ -185,5 +178,15 @@ begin
Reserve (J) := True;
end if;
end loop;
+
+ -- Add exception signals to the set of unmasked signals
+
+ for J in Exception_Signals'Range loop
+ Keep_Unmasked (Exception_Signals (J)) := True;
+ end loop;
+
+ -- The abort signal must also be unmasked
+
+ Keep_Unmasked (Abort_Task_Signal) := True;
end;
end System.Interrupt_Management;
diff --git a/gcc/ada/5zintman.ads b/gcc/ada/5zintman.ads
new file mode 100644
index 00000000000..b0a4c3c5bda
--- /dev/null
+++ b/gcc/ada/5zintman.ads
@@ -0,0 +1,123 @@
+------------------------------------------------------------------------------
+-- --
+-- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- --
+-- S Y S T E M . I N T E R R U P T _ M A N A G E M E N T --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- --
+-- GNARL is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNARL; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNARL was developed by the GNARL team at Florida State University. --
+-- Extensive contributions were provided by Ada Core Technologies, Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This is the VxWorks version of this package.
+
+-- This package encapsulates and centralizes information about all
+-- uses of interrupts (or signals), including the target-dependent
+-- mapping of interrupts (or signals) to exceptions.
+
+-- Unlike the original design, System.Interrupt_Management can only
+-- be used for tasking systems.
+
+-- PLEASE DO NOT remove the Elaborate_Body pragma from this package.
+-- Elaboration of this package should happen early, as most other
+-- initializations depend on it. Forcing immediate elaboration of
+-- the body also helps to enforce the design assumption that this
+-- is a second-level package, just one level above System.OS_Interface
+-- with no cross-dependencies.
+
+-- PLEASE DO NOT put any subprogram declarations with arguments of
+-- type Interrupt_ID into the visible part of this package. The type
+-- Interrupt_ID is used to derive the type in Ada.Interrupts, and
+-- adding more operations to that type would be illegal according
+-- to the Ada Reference Manual. This is the reason why the signals
+-- sets are implemeneted using visible arrays rather than functions.
+
+with System.OS_Interface;
+-- used for sigset_t
+
+with Interfaces.C;
+-- used for int
+
+package System.Interrupt_Management is
+
+ pragma Elaborate_Body;
+
+ type Interrupt_Mask is limited private;
+
+ type Interrupt_ID is new Interfaces.C.int
+ range 0 .. System.OS_Interface.Max_Interrupt;
+
+ type Interrupt_Set is array (Interrupt_ID) of Boolean;
+
+ subtype Signal_ID is Interrupt_ID
+ range 0 .. Interfaces.C."-" (System.OS_Interface.NSIG, 1);
+
+ type Signal_Set is array (Signal_ID) of Boolean;
+
+ -- The following objects serve as constants, but are initialized
+ -- in the body to aid portability. This permits us to use more
+ -- portable names for interrupts, where distinct names may map to
+ -- the same interrupt ID value.
+ --
+ -- For example, suppose SIGRARE is a signal that is not defined on
+ -- all systems, but is always reserved when it is defined. If we
+ -- have the convention that ID zero is not used for any "real"
+ -- signals, and SIGRARE = 0 when SIGRARE is not one of the locally
+ -- supported signals, we can write
+ -- Reserved (SIGRARE) := true;
+ -- and the initialization code will be portable.
+
+ Abort_Task_Signal : Signal_ID;
+ -- The signal that is used to implement task abortion if
+ -- an interrupt is used for that purpose. This is one of the
+ -- reserved signals.
+
+ Keep_Unmasked : Signal_Set := (others => False);
+ -- Keep_Unmasked (I) is true iff the signal I is one that must
+ -- that must be kept unmasked at all times, except (perhaps) for
+ -- short critical sections. This includes signals that are
+ -- mapped to exceptions, but may also include interrupts
+ -- (e.g. timer) that need to be kept unmasked for other
+ -- reasons. Where signal masking is per-task, the signal should be
+ -- unmasked in ALL TASKS.
+
+ Reserve : Interrupt_Set := (others => False);
+ -- Reserve (I) is true iff the interrupt I is one that cannot be
+ -- permitted to be attached to a user handler. The possible reasons
+ -- are many. For example, it may be mapped to an exception used to
+ -- implement task abortion, or used to implement time delays.
+
+ procedure Initialize_Interrupts;
+ -- On systems where there is no signal inheritance between tasks (e.g
+ -- VxWorks, GNU/LinuxThreads), this procedure is used to initialize
+ -- interrupts handling in each task. Otherwise this function should
+ -- only be called by initialize in this package body.
+
+private
+ type Interrupt_Mask is new System.OS_Interface.sigset_t;
+ -- In some implementation Interrupt_Mask can be represented
+ -- as a linked list.
+
+end System.Interrupt_Management;
diff --git a/gcc/ada/5zml-tgt.adb b/gcc/ada/5zml-tgt.adb
index 7016a222cd6..0331c9f23f8 100644
--- a/gcc/ada/5zml-tgt.adb
+++ b/gcc/ada/5zml-tgt.adb
@@ -93,6 +93,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -106,6 +107,7 @@ package body MLib.Tgt is
pragma Unreferenced (Interfaces);
pragma Unreferenced (Lib_Filename);
pragma Unreferenced (Lib_Dir);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Driver_Name);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Lib_Version);
diff --git a/gcc/ada/5ztaprop.adb b/gcc/ada/5ztaprop.adb
index 2451e91dce5..6ee3f80fdcf 100644
--- a/gcc/ada/5ztaprop.adb
+++ b/gcc/ada/5ztaprop.adb
@@ -45,8 +45,8 @@ with System.Tasking.Debug;
with System.Interrupt_Management;
-- used for Keep_Unmasked
--- Abort_Task_Interrupt
--- Interrupt_ID
+-- Abort_Task_Signal
+-- Signal_ID
-- Initialize_Interrupts
with System.Soft_Links;
@@ -262,7 +262,7 @@ package body System.Task_Primitives.Operations is
Result :=
sigaction
- (Signal (Interrupt_Management.Abort_Task_Interrupt),
+ (Signal (Interrupt_Management.Abort_Task_Signal),
act'Unchecked_Access,
old_act'Unchecked_Access);
pragma Assert (Result = 0);
@@ -1008,7 +1008,7 @@ package body System.Task_Primitives.Operations is
begin
Result := kill (T.Common.LL.Thread,
- Signal (Interrupt_Management.Abort_Task_Interrupt));
+ Signal (Interrupt_Management.Abort_Task_Signal));
pragma Assert (Result = 0);
end Abort_Task;
@@ -1126,6 +1126,13 @@ package body System.Task_Primitives.Operations is
Result := sigemptyset (Unblocked_Signal_Mask'Access);
pragma Assert (Result = 0);
+ for J in Interrupt_Management.Signal_ID loop
+ if System.Interrupt_Management.Keep_Unmasked (J) then
+ Result := sigaddset (Unblocked_Signal_Mask'Access, Signal (J));
+ pragma Assert (Result = 0);
+ end if;
+ end loop;
+
Environment_Task_ID := Environment_Task;
-- Initialize the lock used to synchronize chain of all ATCBs.
diff --git a/gcc/ada/5zthrini.adb b/gcc/ada/5zthrini.adb
deleted file mode 100644
index ded9a5118bb..00000000000
--- a/gcc/ada/5zthrini.adb
+++ /dev/null
@@ -1,113 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N --
--- --
--- B o d y --
--- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see 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 other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- This is the VxWorks version of this package; to use this implementation,
--- the task hook libraries should be included in the VxWorks kernel.
-
-with System.Secondary_Stack;
-with Interfaces.C;
-with Unchecked_Conversion;
-
-package body System.Threads.Initialization is
-
- use Interfaces.C;
-
- package SSS renames System.Secondary_Stack;
-
- procedure Initialize_Task_Hooks;
- -- Register the appropriate hooks (Register and Reset_TSD) to the
- -- underlying OS, so that they will be called when a task is created
- -- or reset.
-
- Current_ATSD : aliased System.Address;
- pragma Import (C, Current_ATSD, "__gnat_current_atsd");
-
- ---------------------------
- -- Initialize_Task_Hooks --
- ---------------------------
-
- procedure Initialize_Task_Hooks is separate;
- -- Separate, as these hooks are different for AE653 and VxWorks 5.5.
-
- --------------
- -- Register --
- --------------
-
- function Register (T : OSI.Thread_Id) return OSI.STATUS is
- TSD : ATSD_Access := new ATSD;
- Result : OSI.STATUS;
- begin
- -- It cannot be assumed that the caller of this routine has a ATSD;
- -- so neither this procedure nor the procedures that it calls should
- -- raise or handle exceptions, or make use of a secondary stack.
-
- if OSI.taskIdVerify (T) = OSI.ERROR
- or else OSI.taskVarGet (T, Current_ATSD'Access) /= OSI.ERROR
- then
- return OSI.ERROR;
- end if;
-
- Result := OSI.taskVarAdd (T, Current_ATSD'Access);
- pragma Assert (Result /= -1);
- Result := OSI.taskVarSet (T, Current_ATSD'Access, TSD.all'Address);
- pragma Assert (Result /= -1);
- TSD.Sec_Stack_Addr := SSS.SS_Create;
- SSS.SS_Init (TSD.Sec_Stack_Addr);
- return Result;
- end Register;
-
- ---------------
- -- Reset_TSD --
- ---------------
-
- function Reset_TSD (T : OSI.Thread_Id) return OSI.STATUS is
- TSD_Ptr : int;
- function To_Address is new Unchecked_Conversion
- (Interfaces.C.int, ATSD_Access);
- begin
- TSD_Ptr := OSI.taskVarGet (T, Current_ATSD'Access);
- pragma Assert (TSD_Ptr /= OSI.ERROR);
-
- -- Just reset the secondary stack pointer. The implementation here
- -- assumes that the fixed secondary stack implementation is used.
- -- If not, there will be a memory leak (along with allocation, which
- -- is prohibited for ARINC processes once the system enters "normal"
- -- mode).
-
- SSS.SS_Init (To_Address (TSD_Ptr).Sec_Stack_Addr);
- return OSI.OK;
- end Reset_TSD;
-
-begin
- Initialize_Task_Hooks;
-end System.Threads.Initialization;
diff --git a/gcc/ada/6vcstrea.adb b/gcc/ada/6vcstrea.adb
index 1a320bc545e..04690190b0a 100644
--- a/gcc/ada/6vcstrea.adb
+++ b/gcc/ada/6vcstrea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -36,6 +36,8 @@
with Unchecked_Conversion;
package body Interfaces.C_Streams is
+ use type System.CRTL.size_t;
+
------------
-- fread --
------------
@@ -154,14 +156,6 @@ package body Interfaces.C_Streams is
size : size_t)
return int
is
- function C_setvbuf
- (stream : FILEs;
- buffer : chars;
- mode : int;
- size : size_t)
- return int;
- pragma Import (C, C_setvbuf, "setvbuf");
-
use type System.Address;
begin
@@ -173,9 +167,11 @@ package body Interfaces.C_Streams is
if mode = IONBF
and then (stream = stdout or else stream = stderr)
then
- return C_setvbuf (stream, buffer, IOLBF, size);
+ return System.CRTL.setvbuf
+ (stream, buffer, IOLBF, System.CRTL.size_t (size));
else
- return C_setvbuf (stream, buffer, mode, size);
+ return System.CRTL.setvbuf
+ (stream, buffer, mode, System.CRTL.size_t (size));
end if;
end setvbuf;
diff --git a/gcc/ada/7sinmaop.adb b/gcc/ada/7sinmaop.adb
index 8c767b231e4..8fe6b3a89bd 100644
--- a/gcc/ada/7sinmaop.adb
+++ b/gcc/ada/7sinmaop.adb
@@ -325,11 +325,16 @@ begin
Storage_Elements.To_Address
(Storage_Elements.Integer_Address (SIG_IGN));
- for I in Interrupt_ID loop
- if Keep_Unmasked (I) then
- Result := sigaddset (mask'Access, Signal (I));
+ for J in Interrupt_ID loop
+
+ -- We need to check whether J is in Keep_Unmasked because
+ -- the index type of the Keep_Unmasked array is not always
+ -- Interrupt_ID; it may be a subtype of Interrupt_ID.
+
+ if J in Keep_Unmasked'Range and then Keep_Unmasked (J) then
+ Result := sigaddset (mask'Access, Signal (J));
pragma Assert (Result = 0);
- Result := sigdelset (allmask'Access, Signal (I));
+ Result := sigdelset (allmask'Access, Signal (J));
pragma Assert (Result = 0);
end if;
end loop;
diff --git a/gcc/ada/7sintman.adb b/gcc/ada/7sintman.adb
index 72b1cf87380..801adac39f2 100644
--- a/gcc/ada/7sintman.adb
+++ b/gcc/ada/7sintman.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -152,7 +152,7 @@ begin
function State (Int : Interrupt_ID) return Character;
pragma Import (C, State, "__gnat_get_interrupt_state");
- -- Get interrupt state. Defined in a-init.c
+ -- Get interrupt state. Defined in a-init.c
-- The input argument is the interrupt number,
-- and the result is one of the following:
@@ -175,7 +175,16 @@ begin
act.sa_handler := Notify_Exception'Address;
- act.sa_flags := 0;
+ act.sa_flags := SA_SIGINFO;
+
+ -- Setting SA_SIGINFO asks the kernel to pass more than just the signal
+ -- number argument to the handler when it is called. The set of extra
+ -- parameters typically includes a pointer to a structure describing
+ -- the interrupted context. Although the Notify_Exception handler does
+ -- not use this information, it is actually required for the GCC/ZCX
+ -- exception propagation scheme because on some targets (at least
+ -- alpha-tru64), the structure contents are not even filled when this
+ -- flag is not set.
-- On some targets, we set sa_flags to SA_NODEFER so that during the
-- handler execution we do not change the Signal_Mask to be masked for
diff --git a/gcc/ada/7sosprim.adb b/gcc/ada/7sosprim.adb
index 7cc32510576..c4a7a112380 100644
--- a/gcc/ada/7sosprim.adb
+++ b/gcc/ada/7sosprim.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -47,11 +47,11 @@ package body System.OS_Primitives is
pragma Convention (C, struct_timezone);
type struct_timezone_ptr is access all struct_timezone;
- type time_t is new Integer;
+ type time_t is new Long_Integer;
type struct_timeval is record
tv_sec : time_t;
- tv_usec : Integer;
+ tv_usec : Long_Integer;
end record;
pragma Convention (C, struct_timeval);
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index af03db0b3a1..a49c825dc86 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,1779 @@
+2003-12-23 Kelley Cook <kcook@gcc.gnu.org>
+
+ * gnat_ug.texi: Force a CVS commit by updating copyright.
+ * gnat_ug_vxw.texi: Regenerate.
+ * gnat_ug_wnt.texi: Regenerate.
+ * gnat_ug_vms.texi: Regenerate.
+ * gnat_ug_unx.texi: Regenerate.
+
+2003-12-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * trans.c: Remove uses of "register" specifier in
+ declarations of local variables.
+
+2003-12-18 Kelley Cook <kcook@gcc.gnu.org>
+
+ * stamp-xgnatug: New stamp file.
+ * Make-lang.in (stamp-xgnatug): New stamp file and comment.
+ (ada/doctools/xgnatug): Add $(build_exeext).
+ (ada/gnat_ug_unx.texi, ada/gnat_ug_vwx.texi, ada/gnat_ug_vms.texi
+ ada/gnat_ug_wnt.texi): Update to depend on stamp-xgnatug.
+
+2003-12-17 Ed Falis <falis@gnat.com>
+
+ * a-elchha.adb (Tailored_Exception_Information): made Info constant to
+ eliminate warning.
+
+ * a-exextr.adb: Add context clause for
+ Ada.Exceptions.Last_Chance_Handler.
+
+2003-12-17 Sergey Rybin <rybin@act-europe.fr>
+
+ * cstand.adb (Create_Standard): Change the way how the declaration of
+ the Duration type is created (making it the same way as it is for all
+ the other standard types).
+
+2003-12-17 Robert Dewar <dewar@gnat.com>
+
+ * s-crtl.ads: Fix header format
+ Change Pure to Preelaborate
+
+2003-12-17 Ed Schonberg <schonberg@gnat.com>
+
+ * checks.adb (Selected_Length_Checks): Generate an Itype reference for
+ the expression type only if it is declared in the current unit.
+
+ * sem_ch3.adb (Constrain_Index): Handle properly a range whose bounds
+ are universal and already analyzed, as can occur in constrained
+ subcomponents that depend on discriminants, when one constraint is a
+ subtype mark.
+
+ * sem_res.adb (Resolve_Type_Conversion): Any arithmetic expression of
+ type Any_Fixed is legal as the argument of a conversion, if only one
+ fixed-point type is in context.
+
+2003-12-17 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-12-15 Robert Dewar <dewar@gnat.com>
+
+ * exp_ch6.adb (Expand_Thread_Body): Fix error in picking up default
+ sec stack size.
+
+2003-12-15 Vincent Celier <celier@gnat.com>
+
+ * gnatchop.adb: (Error_Msg): Do not exit on error for a warning
+ (Gnatchop): Do not set failure status when reporting the number of
+ warnings.
+
+2003-12-15 Doug Rupp <rupp@gnat.com>
+
+ * s-ctrl.ads: New file.
+
+ * Makefile.rtl (GNAT_RTL_NONTASKING_OBJS): Add s-crtl$(objext).
+
+ * Make-lang.in: (GNAT_ADA_OBJS): Add ada/s-crtl.o.
+ (GNATBIND_OBJS): Add ada/s-crtl.o.
+
+ * Makefile.in [VMS]: Clean up ifeq rules.
+
+ * gnatlink.adb, 6vcstrea.adb, a-direio.adb, a-sequio.adb,
+ a-ststio.adb, a-textio.adb, g-os_lib.adb, a-witeio.adb,
+ g-os_lib.ads, i-cstrea.adb, i-cstrea.ads, s-direio.adb,
+ s-fileio.adb, s-memcop.ads, s-memory.adb, s-stache.adb,
+ s-tasdeb.adb: Update copyright.
+ Import System.CRTL.
+ Make minor modifications to use System.CRTL declared functions instead
+ of importing locally.
+
+2003-12-15 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-12-11 Ed Falis <falis@gnat.com>
+
+ * 5zinit.adb: Clean up.
+
+ * 5zintman.adb (Notify_Exception): replaced case statement with a call
+ to __gnat_map_signal, imported from init.c to support
+ signal -> exception mappings that depend on the vxWorks version.
+
+ * init.c:
+ Created and exported __gnat_map_signal to support signal -> exception
+ mapping that is dependent on the VxWorks version.
+ Change mapping of SIGBUS from Program_Error to Storage_Error on VxWorks
+
+2003-12-11 Vasiliy Fofanv <fofanov@act-europe.fr>
+
+ * 5wosinte.ads: Link with -mthreads switch.
+
+2003-12-11 Arnaud Charlet <charlet@act-europe.fr>
+
+ * init.c (__gnat_install_handler [NetBSD]): Set
+ __gnat_handler_installed, as done on all other platforms.
+ Remove duplicated code.
+
+2003-12-11 Jerome Guitton <guitton@act-europe.fr>
+
+ * Makefile.in (rts-zfp, rts-ravenscar): Create libgnat.a.
+
+2003-12-11 Thomas Quinot <quinot@act-europe.fr>
+
+ * sinfo.ads: Fix inconsistent example code in comment.
+
+2003-12-11 Robert Dewar <dewar@gnat.com>
+
+ * a-tiinau.adb: Add a couple of comments
+
+ * sem_ch3.adb: Minor reformatting
+
+ * sem_prag.adb:
+ Fix bad prototype of Same_Base_Type in body (code reading cleanup)
+ Minor reformatting throughout
+
+2003-12-11 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch7.adb (Establish_Transient_Scope): If the call is within the
+ bounds of a loop, create a separate block in order to generate proper
+ cleanup actions to prevent memory leaks.
+
+ * sem_res.adb (Resolve_Call): After a call to
+ Establish_Transient_Scope, the call may be rewritten and relocated, in
+ which case no further processing is needed.
+
+ * sem_util.adb: (Wrong_Type): Refine previous fix.
+ Fixes ACATS regressions.
+
+ PR ada/13353
+
+ * sem_prag.adb (Back_End_Cannot_Inline): A renaming_as_body can always
+ be inlined.
+
+2003-12-08 Jerome Guitton <guitton@act-europe.fr>
+
+ * 5ytiitho.adb, 5zthrini.adb, 5ztiitho.adb, i-vthrea.adb,
+ i-vthrea.ads, s-tpae65.adb, s-tpae65.ads: Cleanup: Remove a bunch of
+ obsolete files.
+
+ * Makefile.in: (rts-ravenscar): Generate an empty libgnat.a.
+ (rts-zfp): Ditto.
+
+2003-12-08 Robert Dewar <dewar@gnat.com>
+
+ * 7sintman.adb: Minor reformatting
+
+ * bindgen.adb: Configurable_Run_Time mode no longer suppresses the
+ standard linker options to get standard libraries linked. We now plan
+ to provide dummy versions of these libraries to match the appropriate
+ configurable run-time (e.g. if a library is not needed at all, provide
+ a dummy empty library).
+
+ * targparm.ads: Configurable_Run_Time mode no longer affects linker
+ options (-L parameters and standard libraries). What we plan to do is
+ to provide dummy libraries where the libraries are not required.
+
+ * gnatbind.adb: Minor comment improvement
+
+2003-12-08 Javier Miranda <miranda@gnat.com>
+
+ * exp_aggr.adb (Build_Record_Aggr_Code): Do not remove the expanded
+ aggregate in the parent. Otherwise constants with limited aggregates
+ are not supported. Add new formal to pass the component type (Ctype).
+ It is required to call the corresponding IP subprogram in case of
+ default initialized components.
+ (Gen_Assign): In case of default-initialized component, generate a
+ call to the IP subprogram associated with the component.
+ (Build_Record_Aggr_Code): Remove the aggregate from the parent in case
+ of aggregate with default initialized components.
+ (Has_Default_Init_Comps): Improve implementation to recursively check
+ all the present expressions.
+
+ * exp_ch3.ads, exp_ch3.adb (Build_Initialization_Call): Add new formal
+ to indicate that the initialization call corresponds to a
+ default-initialized component of an aggregate.
+ In case of default initialized aggregate with tasks this parameter is
+ used to generate a null string (this is just a workaround that must be
+ improved later). In case of discriminants, this parameter is used to
+ generate a selected component node that gives access to the discriminant
+ value.
+
+ * exp_ch9.ads, exp_ch9.adb (Build_Task_Allocate_Block_With_Stmts): New
+ subprogram, based on Build_Task_Allocate_Block, but adapted to expand
+ allocated aggregates with default-initialized components.
+
+ * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Improve error message if
+ the box notation is used in positional aggregates.
+
+2003-12-08 Samuel Tardieu <tardieu@act-europe.fr>
+
+ * lib.ads: Fix typo in comment
+
+2003-12-08 Vincent Celier <celier@gnat.com>
+
+ * prj.adb (Project_Empty): New component Unkept_Comments
+ (Scan): Remove procedure; moved to Prj.Err.
+
+ * prj.ads (Project_Data): New Boolean component Unkept_Comments
+ (Scan): Remove procedure; moved to Prj.Err.
+
+ * prj-dect.adb: Manage comments for the different declarations.
+
+ * prj-part.adb (With_Record): New component Node
+ (Parse): New Boolean parameter Store_Comments, defaulted to False.
+ Set the scanner to return ends of line and comments as tokens, if
+ Store_Comments is True.
+ (Pre_Parse_Context_Clause): Create the N_With_Clause nodes so that
+ comments are associated with these nodes. Store the node IDs in the
+ With_Records.
+ (Post_Parse_Context_Clause): Use the N_With_Clause nodes stored in the
+ With_Records.
+ (Parse_Single_Project): Call Pre_Parse_Context_Clause before creating
+ the N_Project node. Call Tree.Save and Tree.Reset before scanning the
+ current project. Call Tree.Restore afterwards. Set the various nodes
+ for comment storage (Next_End, End_Of_Line, Previous_Line,
+ Previous_End).
+
+ * prj-part.ads (Parse): New Boolean parameter Store_Comments,
+ defaulted to False.
+
+ * prj-pp.adb (Write_String): New Boolean parameter Truncated, defaulted
+ to False. When Truncated is True, truncate the string, never go to the
+ next line.
+ (Write_End_Of_Line_Comment): New procedure
+ (Print): Process comments for nodes N_With_Clause,
+ N_Package_Declaration, N_String_Type_Declaration,
+ N_Attribute_Declaration, N_Typed_Variable_Declaration,
+ N_Variable_Declaration, N_Case_Construction, N_Case_Item.
+ Process nodes N_Comment.
+
+ * prj-tree.ads, prj-tree.adb (Default_Project_Node): If it is a node
+ without comments and there are some comments, set the flag
+ Unkept_Comments to True.
+ (Scan): If there are comments, set the flag Unkept_Comments to True and
+ clear the comments.
+ (Project_Node_Kind): Add enum values N_Comment_Zones, N_Comment
+ (Next_End_Nodes: New table
+ (Comment_Zones_Of): New function
+ (Scan): New procedure; moved from Prj. Accumulate comments in the
+ Comments table and set end of line comments, comments after, after end
+ and before end.
+ (Add_Comments): New procedure
+ (Save, Restore, Seset_State): New procedures
+ (There_Are_Unkept_Comments): New function
+ (Set_Previous_Line_Node, Set_Previous_End_Node): New procedures
+ (Set_End_Of_Line, Set_Next_End_Node, Remove_Next_End_Node): New
+ procedures.
+ (First_Comment_After, First_Comment_After_End): New functions
+ (First_Comment_Before, First_Comment_Before_End): New functions
+ (Next_Comment): New function
+ (End_Of_Line_Comment, Follows_Empty_Line,
+ Is_Followed_By_Empty_Line): New functions
+ (Set_First_Comment_After, Set_First_Comment_After_End): New procedures
+ (Set_First_Comment_Before, Set_First_Comment_Before_End): New procedures
+ (Set_Next_Comment): New procedure
+ (Default_Project_Node): Associate comment before if the node can store
+ comments.
+
+ * scans.ads (Token_Type): New enumeration value Tok_Comment
+ (Comment_Id): New global variable
+
+ * scng.ads, scng.adb (Comment_Is_Token): New Boolean global variable,
+ defaulted to False.
+ (Scan): Store position of start of comment. If comments are tokens, set
+ Comment_Id and set Token to Tok_Comment when scanning a comment.
+ (Set_Comment_As_Token): New procedure
+
+ * sinput-p.adb: Update Copyright notice
+ (Source_File_Is_Subunit): Call Prj.Err.Scanner.Scan instead of Prj.Scan
+ that no longer exists.
+
+2003-12-08 Javier Miranda <miranda@gnat.com>
+
+ * sem_aggr.adb: Add dependence on Exp_Tss package
+ Correct typo in comment
+ (Resolve_Aggregate): In case of array aggregates set the estimated
+ type of the aggregate before calling resolve. This is needed to know
+ the name of the corresponding IP in case of limited array aggregates.
+ (Resolve_Array_Aggregate): Delay the resolution to the expansion phase
+ in case of default initialized array components.
+
+ * sem_ch12.adb (Analyze_Formal_Object_Declaration): Allow limited
+ types. Required to give support to limited aggregates in generic
+ formals.
+
+2003-12-08 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch3.adb (Check_Initialization): For legality purposes, an
+ inlined body functions like an instantiation.
+ (Decimal_Fixed_Point_Declaration): Do not set kind of first subtype
+ until bounds are analyzed, to diagnose premature use of type.
+
+ * sem_util.adb (Wrong_Type): Improve error message when the type of
+ the expression is used prematurely.
+
+2003-12-08 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-12-08 Arnaud Charlet <charlet@act-europe.fr>
+
+ * sinfo.h, einfo.h, nmake.ads, nmake.adb, treeprs.ads: Removed, since
+ they are automatically generated by Make-lang.in and cause nothing but
+ maintenance troubles.
+
+2003-12-05 Thomas Quinot <quinot@act-europe.fr>
+
+ * 3ssoliop.ads: Fix comment (this is the Solaris, not the UnixWare,
+ version of this unit).
+
+2003-12-05 Olivier Hainque <hainque@act-europe.fr>
+
+ * 53osinte.ads, 54osinte.ads, 55osinte.ads, 56osinte.ads, 5bosinte.ads,
+ 5cosinte.ads, 5hosinte.ads, 5iosinte.ads, 5losinte.ads,
+ 5tosinte.ads: Define the SA_SIGINFO constant, to allow references from
+ the body of System.Interrupt_Management common to several targets.
+ Update copyright notice when appropriate.
+
+ * 52osinte.ads, 5posinte.ads: Define a dummy value for the SA_SIGINFO
+ constant.
+
+ * 7sintman.adb (elaboration): Set SA_SIGINFO in the sigaction flags,
+ to ensure that the kernel fills in the interrupted context structure
+ before calling a signal handler, which is necessary to be able to
+ unwind past it. Update the copyright notice.
+
+2003-12-05 Jerome Guitton <guitton@act-europe.fr>
+
+ * a-elchha.ads: New file.
+
+ * a-elchha.adb: New default last chance handler. Contents taken from
+ Ada.Exceptions.Exception_Traces.Unhandled_Exception_Terminate.
+
+ * a-exextr.adb (Unhandled_Exception_Terminate): Most of this routine
+ is moved to a-elchha.adb to provide a target-independent default last
+ chance handler.
+
+ * Makefile.rtl: Add a-elchha.o
+
+ * Make-lang.in (GNAT_ADA_OBJS, GNATBIND_OBJS): Add a-elchha.o.
+
+2003-12-05 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch6.adb (Expand_Call): If the subprogram is inlined and is
+ declared in an instance, do not inline the call if the instance is not
+ frozen yet, to prevent order of elaboration problems.
+
+ * sem_prag.adb: Add comments for previous fix.
+
+2003-12-05 Samuel Tardieu <tardieu@act-europe.fr>
+
+ * g-table.adb: Use the right variable in Set_Item.
+ Update copyright notice.
+
+2003-12-05 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.in: Remove unused rules.
+
+2003-12-05 Vincent Celier <celier@gnat.com>
+
+ * switch-c.adb (Scan_Front_End_Switches): Remove processing of
+ -nostdlib. Not needed here after all.
+
+2003-12-03 Thomas Quinot <quinot@act-europe.fr>
+
+ PR ada/11724
+
+ * adaint.h, adaint.c, g-os_lib.ads:
+ Do not assume that the offset argument to lseek(2) is a 32 bit integer,
+ on some platforms (including FreeBSD), it is a 64 bit value.
+ Introduce a __gnat_lseek wrapper in adaint.c to allow for portability.
+
+2003-12-03 Arnaud Charlet <charlet@act-europe.fr>
+
+ * gnatvsn.ads (Library_Version): Now contain only the relevant
+ version info.
+ (Verbose_Library_Version): New constant.
+
+ * g-spipat.adb, g-awk.adb, g-debpoo.adb,
+ g-memdum.adb, g-thread.adb, s-geveop.adb, s-interr.adb,
+ s-taskin.adb, s-tassta.adb: Make code compile with -gnatwa.
+
+ * gnatlbr.adb: Clean up: replace Library_Version by
+ Verbose_Library_Version.
+
+ * make.adb, lib-writ.adb, exp_attr.adb:
+ Clean up: replace Library_Version by Verbose_Library_Version.
+
+ * 5lintman.adb: Removed.
+
+ * Makefile.in:
+ Update and simplify computation of LIBRARY_VERSION.
+ Fix computation of GSMATCH_VERSION.
+ 5lintman.adb is no longer used: replaced by 7sintman.adb.
+
+2003-12-03 Robert Dewar <dewar@gnat.com>
+
+ * exp_ch5.adb:
+ (Possible_Bit_Aligned_Component): Maybe_Bit_Aligned_Large_Component new
+ name. Modified to consider small non-bit-packed arrays as troublesome
+ and in need of component-by-component assigment expansion.
+
+2003-12-03 Vincent Celier <celier@gnat.com>
+
+ * lang-specs.h: Process nostdlib as nostdinc
+
+ * back_end.adb: Update Copyright notice
+ (Scan_Compiler_Arguments): Process -nostdlib directly.
+
+2003-12-03 Jose Ruiz <ruiz@act-europe.fr>
+
+ * Makefile.in:
+ When defining LIBGNAT_TARGET_PAIRS for bare board targets, remove the
+ redundant inclusion of EXTRA_HIE_NONE_TARGET_PAIRS, which is always
+ included in HIE_NONE_TARGET_PAIRS.
+
+2003-12-03 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_attr.adb:
+ (Legal_Formal_Attribute): Attribute is legal in an inlined body, as it
+ is legal in an instance, because legality is cheched in the template.
+
+ * sem_prag.adb:
+ (Analyze_Pragma, case Warnings): In an inlined body, the pragma may be
+ appplied to an unchecked conversion of a formal parameter.
+
+ * sem_warn.adb:
+ (Output_Unreferenced_Messages): Suppress "not read" warnings on imported
+ variables.
+
+2003-12-03 Olivier Hainque <hainque@act-europe.fr>
+
+ * tb-alvms.c (unwind_regular_code, unwind_kernel_handler): New
+ routines. The second one is new functionality to deal with backtracing
+ through signal handlers.
+ (unwind): Split into the two separate subroutines above.
+ Update the documentation, and deal properly with sizeof (REG) different
+ from sizeof (void*).
+
+2003-12-01 Nicolas Setton <setton@act-europe.fr>
+
+ * a-except.adb (Raise_Current_Excep): Add a pragma Inspection_Point,
+ so that the debugger can reliably access the value of the parameter,
+ and therefore is able to display the exception name when an exception
+ breakpoint is reached.
+
+2003-12-01 Thomas Quinot <quinot@act-europe.fr>
+
+ * fmap.adb: Fix typo in warning message.
+
+ * g-socket.ads, g-socket.adb: Make Free a visible instance of
+ Ada.Unchecked_Deallocation (no need to wrap it in a subprogram).
+
+2003-12-01 Vincent Celier <celier@gnat.com>
+
+ * mlib-prj.adb (Build_Library.Process): Do not check a withed unit if
+ ther is no Afile.
+ (Build_Library): Get the switches only if Default_Switches is declared
+ in package Binder.
+
+2003-12-01 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch6.adb (Expand_Actuals): When applying validity checks to
+ actuals that are indexed components, reanalyze actual to ensure that
+ packed array references are properly expanded.
+
+ * sem_ch5.adb (Diagnose_Non_Variable_Lhs): Add special case for
+ attempted assignment to a discriminant.
+
+2003-12-01 Robert Dewar <dewar@gnat.com>
+
+ * rtsfind.adb, exp_ch4.adb, s-exnint.ads, s-exnint.adb: Minor
+ reformatting.
+
+ * switch-c.adb: Minor reformatting of comments
+
+2003-12-01 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.in: Clean ups.
+
+2003-12-01 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-12-01 Arnaud Charlet <charlet@act-europe.fr>
+
+ * 5wsystem.ads: Disable zero cost exception, not ready yet.
+
+2003-11-29 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * Make-lang.in (nmake.ads): Add dependency on ada/nmake.adb
+ to force serialization.
+
+2003-11-26 Thomas Quinot <quinot@act-europe.fr>
+
+ * g-socket.ads, g-socket.adb:
+ Clarify documentation of function Stream. Introduce a Free procedure
+ to release the returned Stream once it becomes unused.
+
+ * 5asystem.ads: For Alpha Tru64, enable ZCX by default.
+
+2003-11-26 Arnaud Charlet <charlet@act-europe.fr>
+
+ (Cond_Timed_Wait): Introduce new constant Time_Out_Max,
+ since NT 4 cannot handle timeout values that are too large,
+ e.g. DWORD'Last - 1.
+
+2003-11-26 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch4.adb:
+ (Expand_N_Slice): Recognize all cases of slices that appear as actuals
+ in procedure calls and whose expansion must be deferred.
+
+ * exp_ch6.adb (Add_Call_By_Copy_Node): Remove previous fix. Proper fix
+ is in exp_ch4.
+
+ * sem_ch3.adb:
+ (Build_Derived_Array_Type): Create operator for unconstrained type
+ if ancestor is unconstrained.
+
+2003-11-26 Vincent Celier <celier@gnat.com>
+
+ * make.adb (Project_Object_Directory): New global variable
+ (Change_To_Object_Directory): New procedure
+ (Collect_Arguments_And_Compile): Call Change_To_Object_Directory instead
+ of Change_Dir directly. Do not change working directory to object
+ directory of main project after each compilation.
+ (Gnatmake): Use Change_To_Object_Directory instead of Change_Dir
+ directly.
+ Change to object directory of main project before binding step.
+ (Initialize): Initialize Project_Object_Directory to No_Project
+
+ * mlib-prj.adb:
+ (Build_Library): Take into account Builder'Default_Switches ("Ada") when
+ binding a Stand-Alone Library.
+
+ * output.adb: Update Copyright notice
+ (Write_Char): Output buffer when full
+
+2003-11-26 Robert Dewar <dewar@gnat.com>
+
+ * sem_ch13.adb: (Check_Size): Reset size if size is too small
+
+ * sem_ch13.ads:
+ (Check_Size): Fix documentation to include bit-packed array case
+
+ * sem_res.adb: Implement restriction No_Direct_Boolean_Operators
+
+ * s-rident.ads: Put No_Direct_Boolean_Operators in proper order
+
+ * s-rident.ads: Add new restriction No_Direct_Boolean_Operators
+
+2003-11-24 Arnaud Charlet <charlet@act-europe.fr>
+
+ PR ada/13142
+ * utils.c (init_gigi_decls): Change name of built-in setjmp to
+ __builtin_setjmp, since this is apparently needed by recent
+ non Ada changes.
+
+2003-11-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * adadecode.c: Only include ctype.h if not IN_GCC.
+ (__gnat_decode): Use ISDIGIT from safe-ctype.h.
+
+2003-11-24 Jose Ruiz <ruiz@act-europe.fr>
+
+ * Makefile.in:
+ Use 5zintman.ads for VxWorks targets. This file avoid confusion between
+ signals and interrupts.
+
+ * 5zintman.ads: New File.
+
+ * 5zintman.adb: Replace Exception_Interrupts by Exception_Signals, and
+ add exception signals to the set of unmasked signals.
+
+ * 5ztaprop.adb:
+ Use Abort_Task_Signal instead of Abort_Task_Interrupt to avoid confusion
+ between signals and interrupts.
+ Add to Unblocked_Signal_Mask the set of signals that are in
+ Keep_Unmasked.
+
+ * 7sinmaop.adb:
+ Adding a check to see whether the Interrupt_ID we want to unmask is in
+ the range of Keep_Unmasked (in procedure Interrupt_Self_Process). The
+ reason is that the index type of the Keep_Unmasked array is not always
+ Interrupt_ID; it may be a subtype of Interrupt_ID.
+
+2003-11-24 Gary Dismukes <dismukes@gnat.com>
+
+ * exp_util.adb:
+ (Remove_Side_Effects): Condition constantness of object created for a
+ an unchecked type conversion on the constantness of the expression
+ to ensure the correct value for 'Constrained when passing components
+ of view-converted class-wide objects.
+
+2003-11-24 Robert Dewar <dewar@gnat.com>
+
+ * par-load.adb (Load): Improve handling of misspelled and missing units
+ Removes several cases of compilation abandoned messages
+
+ * lib.adb: (Remove_Unit): New procedure
+
+ * lib.ads: (Remove_Unit): New procedure
+
+ * lib-load.adb: Minor reformatting
+
+2003-11-24 Vincent Celier <celier@gnat.com>
+
+ * make.adb:
+ (Gnatmake, Initialize): Call Usage instead of Makeusg directly
+ (Marking_Label): Label to mark processed source files. Incremented for
+ each executable.
+ (Gnatmake): Increase Marking_Labet for each executable
+ (Is_Marked): Compare against marking label
+ (Mark): Mark with marking label
+
+2003-11-24 Jerome Guitton <guitton@act-europe.fr>
+
+ * s-thread.ads:
+ Move the declaration of the TSD for System.Threads to System.Soft_Links.
+ Add some comments.
+
+ * Makefile.in: Added target pair for s-thread.adb for cert runtime.
+ (rts-cert): build a single relocatable object for the run-time lib.
+ Fix perms.
+
+2003-11-24 Vasiliy Fofanov <fofanov@act-europe.fr>
+
+ * Make-lang.in:
+ Use gnatls rather than gcc to obtain the location of GNAT RTL for
+ crosstools build.
+
+2003-11-24 Sergey Rybin <rybin@act-europe.fr>
+
+ * opt.adb (Tree_Write): Gnat_Version_String is now a function, so we
+ can not use it as before (that is, as a variable) when dumping it into
+ the tree file. Add a local variable to store the result of this
+ function and to be used as the string to be written into the tree.
+
+ * scn.adb (Initialize_Scanner): Add comments explaining the recent
+ changes.
+
+ * sinput.adb (Source_First, Source_Last): In case of
+ Internal_Source_File, replace returning attributes of
+ Internal_Source_Ptr (which is wrong) with returning attributes of
+ Internal_Source.
+
+2003-11-24 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch3.adb:
+ (New_Concatenation_Op): Proper name for New_Binary_Operator, only
+ used for implicit concatenation operators.
+ Code cleanup.
+
+ * sem_elab.adb:
+ (Check_Elab_Call): Set No_Elaboration_Check appropriately on calls in
+ task bodies that are in the scope of a Suppress pragma.
+ (Check_A Call): Use the flag to prevent spurious elaboration checks.
+
+ * sinfo.ads, sinfo.adb:
+ New flag No_Elaboration_Check on function/procedure calls, to properly
+ suppress checks on calls in task bodies that are within a local suppress
+ pragma.
+
+ * exp_ch4.adb:
+ (Expand_Concatenate_Other): Use the proper integer type for the
+ expression for the upper bound, to avoid universal_integer computations
+ when possible.
+
+2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Delete.
+
+2003-11-21 Andreas Schwab <schwab@suse.de>
+
+ * 55system.ads: Set ZCX_By_Default and GCC_ZCX_Support to True.
+
+2003-11-21 Vasiliy Fofanov <fofanov@act-europe.fr>
+
+ * 5wsystem.ads: Enable zero cost exception.
+
+2003-11-21 Jerome Guitton <guitton@act-europe.fr>
+
+ * 5ztiitho.adb: Remove an unreferenced variable.
+
+2003-11-21 Thomas Quinot <quinot@act-europe.fr>
+
+ * adaint.c: For FreeBSD, use mkstemp.
+
+2003-11-21 Arnaud Charlet <charlet@act-europe.fr>
+
+ * gnatlbr.adb: Now reference Gnat_Static_Version_String.
+
+2003-11-21 Robert Dewar <dewar@gnat.com>
+
+ * bld.adb: Remove useless USE of gnatvsn
+
+ * gnatchop.adb: Minor reformatting
+ Clean up version handling to be more consistent
+
+ * gnatxref.adb: Minor reformatting
+
+ * gprcmd.adb: Minor reformatting
+ Fix output of copyright to be more consistent with other tools
+
+2003-11-21 Vincent Celier <celier@gnat.com>
+
+ * make.adb (Scan_Make_Args): Do not transmit --RTS= to gnatlink
+
+2003-11-21 Sergey Rybin <rybin@act-europe.fr>
+
+ * atree.adb (Initialize): Add initializations for global variables
+ used in New_Copy_Tree.
+
+ * cstand.adb (Create_Standard): Add call to Initialize_Scanner (with
+ Internal_Source_File as the actual).
+ Put the set of statements creating Any_Character before the set of
+ statements creating Any_Array to have Any_Character fully initialized
+ when it is used in creating Any_Array.
+
+ * scn.adb (Initialize_Scanner): Do not set Comes_From_Source ON and do
+ not call Scan in case if the actual is Internal_Source_File
+ Add 2003 to copyright note.
+
+ * sinput.adb (Source_First, Source_Last, Source_Text): Add code for
+ processing Internal_Source_File.
+
+ * types.ads: Add the constant Internal_Source_File representing the
+ source buffer for artificial source-code-like strings created within
+ the compiler (the definition of Source_File_Index is changed).
+
+2003-11-20 Arnaud Charlet <charlet@act-europe.fr>
+
+ * 35soccon.ads, 45intnam.ads, 55osinte.adb, 55osinte.ads,
+ 56system.ads: New file, FreeBSD version.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (ada.extraclean): Delete.
+
+2003-11-19 Arnaud Charlet <charlet@act-europe.fr>
+
+ * gnatmem.adb: Clean up verbose output.
+
+ * gprcmd.adb: Change copyright to FSF.
+
+2003-11-19 Vincent Celier <celier@gnat.com>
+
+ * symbols.adb: (Initialize): New parameters Reference, Symbol_Policy
+ and Version (ignored).
+
+ * symbols.ads: (Policy): New type
+ (Initialize): New parameter Reference, Symbol_Policy and
+ Library_Version.
+ Remove parameter Force.
+ Minor reformatting.
+
+ * snames.ads, snames.adbadb: New standard names
+ Library_Reference_Symbol_File and Library_Symbol_Policy
+
+ * mlib-prj.adb:
+ (Build_Library): Call Build_Dinamic_Library with the Symbol_Data of the
+ project.
+
+ * mlib-tgt.adb:
+ (Build_Dynamic_Library): New parameter Symbol_Data (ignored)
+
+ * mlib-tgt.ads: (Build_Dynamic_Library): New parameter Symbol_Data
+
+ * prj.adb: (Project_Empty): New component Symbol_Data
+
+ * prj.ads: (Policy, Symbol_Record): New types
+ (Project_Data): New component Symbol_Data
+
+ * prj-attr.adb:
+ New attributes Library_Symbol_File, Library_Symbol_Policy and
+ Library_Reference_Symbol_File.
+
+ * prj-nmsc.adb:
+ (Ada_Check): When project is a Stand-Alone library project, process
+ attribute Library_Symbol_File, Library_Symbol_Policy and
+ Library_Reference_Symbol_File.
+
+ * 5aml-tgt.adb, 5bml-tgt.adb, 5gml-tgt.adb, 5hml-tgt.adb,
+ 5wml-tgt.adb, 5zml-tgt.adb, 5lml-tgt.adb,
+ 5sml-tgt.adb (Build_Dynamic_Library): New parameter
+ Symbol_Data (ignored).
+
+ * 5vml-tgt.adb (VMS_Options): Remove --for-linker=gsmatch=equal,1,0
+ (Build_Dynamic_Library): New parameter Symbol_Data. New internal
+ functions Option_File_Name and Version_String. Set new options of
+ gnatsym related to symbol file, symbol policy and reference symbol
+ file.
+
+ * 5vsymbol.adb:
+ Extensive modifications to take into account the reference symbol file,
+ the symbol policy, the library version and to put in the symbol file the
+ minor and major IDs.
+
+ * bld.adb (Process_Declarative_Items): Put second argument of
+ gprcmd to_absolute between single quotes, to avoid problems with
+ Windows.
+
+ * bld-io.adb: Update Copyright notice.
+ (Flush): Remove last character of a line, if it is a back slash, to
+ avoid make problems.
+
+ * gnatsym.adb:
+ Implement new scheme with reference symbol file and symbol policy.
+
+ * g-os_lib.ads: (Is_Directory): Clarify comment
+
+2003-11-19 Robert Dewar <dewar@gnat.com>
+
+ * atree.adb: Move New_Copy_Tree global variables to head of package
+
+ * errout.adb: Minor reformatting
+
+2003-11-19 Javier Miranda <miranda@gnat.com>
+
+ * sem_ch4.adb: (Diagnose_Call): Improve error message.
+ Add reference to Ada0Y (AI-50217)
+
+ * sem_ch6.adb, sem_ch8.adb, sem_type.adb,
+ sem_util.adb: Add reference to AI-50217
+
+ * sinfo.ads: (N_With_Clause): Document fields referred to AI-50217
+
+ * sprint.adb: Add reference to Ada0Y (AI-50217, AI-287)
+
+ * sem_aggr.adb: Complete documentation of AI-287 changes
+
+ * par-ch4.adb: Document previous changes.
+
+ * lib-load.adb, lib-writ.adb, einfo.ads, par-ch10.adb,
+ sem_cat.adb, sem_ch3.adb, sem_ch10.adb, sem_ch12.adb: Add references to
+ Ada0Y (AI-50217)
+
+ * exp_aggr.adb: Add references to AI-287 in previous changes
+
+2003-11-19 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch6.adb:
+ (Add_Call_By_Copy_Node): Do not original node of rewritten expression
+ in the rewriting is the result of an inlined call.
+
+ * exp_ch6.adb (Add_Call_By_Copy_Node): If actual for (in-)out
+ parameter is a type conversion, use original node to construct the
+ post-call assignment, because expression may have been rewritten, e.g.
+ if it is a packed array.
+
+ * sem_attr.adb:
+ (Resolve_Attribute, case 'Constrained): Attribute is legal in an inlined
+ body, just as it is in an instance.
+ Categorization routines
+
+ * sem_ch12.adb (Analyze_Association, Instantiate_Formal_Subprogram,
+ Instantiate_Object): Set proper sloc reference for message on missing
+ actual.
+
+2003-11-19 Thomas Quinot <quinot@act-europe.fr>
+
+ * Makefile.in: Add FreeBSD libgnat pairs.
+
+ * usage.adb: Fix typo in usage message.
+
+2003-11-19 Jerome Guitton <guitton@act-europe.fr>
+
+ * Makefile.in: On powerpc-wrs-vxworksae: Add s-thread.ad?,
+ s-thrini.ad? and s-tiitho.adb to the full runtime, to support the
+ pragma Thread_Body.
+ Remove i-vthrea.ad? and s-tpae65.ad?, not needed anymore.
+
+ * s-thread.adb: This file is now a dummy implementation of
+ System.Thread.
+
+2003-11-19 Sergey Rybin <rybin@act-europe.fr>
+
+ * rtsfind.adb (Initialize): Add initialization for RTE_Is_Available
+
+2003-11-19 Emmanuel Briot <briot@act-europe.fr>
+
+ * xref_lib.adb (Parse_Identifier_Info): Add handling of generic
+ instanciation references in the parent type description.
+
+2003-11-18 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * ada-tree.def: (ALLOCATE_EXPR): Class is "2", not "s".
+
+ * decl.c (gnat_to_gnu_entity, case E_Floating_Point_Subtype): Set
+ TYPE_PRECISION directly from esize.
+
+2003-11-18 Thomas Quinot <quinot@act-europe.fr>
+
+ * cstreams.c:
+ Use realpath(3) on FreeBSD. Fix typo in comment while we are at it.
+
+ * init.c: Initialization routines for FreeBSD
+
+ * link.c: Link info for FreeBSD
+
+ * sysdep.c: Add the case of FreeBSD
+
+2003-11-17 Jerome Guitton <guitton@act-europe.fr>
+
+ * 5zthrini.adb: Remove the call to Init_RTS at elaboration, as it is
+ already called in System.Threads.
+
+ * 5ztiitho.adb (Initialize_Task_Hooks): Remove the registration of the
+ environment task, as it has been moved to System.Threads.Initialization.
+
+2003-11-17 Arnaud Charlet <charlet@act-europe.fr>
+
+ * adaint.c (__gnatlib_install_locks): Only reference
+ __gnat_install_locks on VMS, since other platforms can avoid using
+ --enable-threads=gnat
+
+2003-11-17 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * ada-tree.h: (TYPE_IS_PACKED_ARRAY_TYPE_P): New macro.
+
+ * decl.c (gnat_to_gnu_entity, case E_Array_Subtype): Set
+ TYPE_PACKED_ARRAY_TYPE_P.
+ (validate_size): Do not verify size if TYPE_IS_PACKED_ARRAY_TYPE_P.
+
+ Part of PR ada/12806
+ * utils.c (float_type_for_precision): Renamed from float_type_for_size.
+ Use GET_MODE_PRECISION instead of GET_MODE_BITSIZE.
+
+2003-11-17 Vincent Celier <celier@gnat.com>
+
+ * gnatchop.adb (Error_Msg): New Boolean parameter Warning, defaulted
+ to False.
+ Do not set exit status to Failure when Warning is True.
+ (Gnatchop): Make errors "no compilation units found" and
+ "no source files written" warnings only.
+
+ * make.adb (Gnatmake): When using a project file, set
+ Look_In_Primary_Dir to False.
+ (Configuration_Pragmas_Switch): Check for Global_Configuration_Pragmas
+ and Local_Configuration_Pragmas in the project where they are declared
+ not an extending project which might have inherited them.
+
+ * osint.adb (Locate_File): If Name is already an absolute path, do not
+ look for a directory.
+
+ * par-ch10.adb (P_Compilation_Unit): If source contains no token, and
+ -gnats (Check_Syntax) is used, issue only a warning, not an error.
+
+ * prj.adb (Register_Default_Naming_Scheme): Add new component Project
+ in objects of type Variable_Value.
+
+ * prj.ads: (Variable_Value): New component Project
+
+ * prj-nmsc.adb (Ada_Check.Warn_If_Not_Sources): No warning if source
+ is in a project extended by Project.
+
+ * prj-proc.adb (Add_Attributes): New parameter Project. Set component
+ Project of Variable_Values to this new parameter value.
+ (Expression): Set component Project of Variable_Values.
+ (Process_Declarative_Items): Call Add_Attributes with parameter Project.
+ Set the component Project in array elements.
+
+2003-11-17 Sergey Rybin <rybin@act-europe.fr>
+
+ * errout.adb: (Initialize): Add initialization for error nodes.
+
+ * sem_ch12.adb (Initialize): Add missing initializations for
+ Exchanged_Views and Hidden_Entities.
+
+2003-11-17 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch12.adb (Copy_Generic_Node): Preserve entity when copying an
+ already instantiated tree for use in subsequent inlining.
+ (Analyze_Associations, Instantiate_Formal_Subprogram,
+ Instantiate_Object): improve error message for mismatch in
+ instantiations.
+
+ * sem_ch6.adb (Build_Body_To_Inline): Major cleanup to handle
+ instantiations of subprograms declared in instances.
+
+2003-11-17 Javier Miranda <miranda@gnat.com>
+
+ * sem_ch4.adb (Analyze_Allocator): Previous modification must be
+ executed only under the Extensions_Allowed flag.
+
+2003-11-17 Robert Dewar <dewar@gnat.com>
+
+ * a-exexda.adb (Address_Image): Fix documentation to indicate leading
+ zeroes suppressed.
+ (Address_Image): Fix bug of returning 0x instead of 0x0
+ Minor reformatting (function specs).
+
+ * einfo.ads: Minor fix for documentation of Is_Bit_Packed_Array
+ (missed case of 33-63)
+
+ * freeze.adb, sem_ch13.adb: Properly check size of packed bit array
+
+ * s-thread.adb: Add comments for pragma Restriction
+
+ * exp_aggr.adb, g-debuti.adb, par-ch4.adb, sem_aggr.adb,
+ sem_ch6.adb, sprint.adb, xref_lib.adb: Minor reformatting
+
+2003-11-17 Ed Falis <falis@gnat.com>
+
+ * s-thread.adb: Added No_Tasking restriction for this implementation.
+
+2003-11-17 Emmanuel Briot <briot@act-europe.fr>
+
+ * xref_lib.adb (Parse_Identifier_Info): Add handling of generic
+ instanciation references in the parent type description.
+
+2003-11-17 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-11-16 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (ada.tags): Create TAGS.sub files in each directory
+ and TAGS files that include them for each front end.
+
+2003-11-14 Andreas Jaeger <aj@suse.de>
+
+ * lang.opt: Change -Wno-long-long to -Wlong-long since the latter
+ is the canonical version.
+ * misc.c (gnat_handle_option): Likewise.
+
+ * Makefile.in (LIBGNAT_TARGET_PAIRS): Add rules for x86_64-linux.
+
+ * 5nsystem.ads: New file for x86_64-linux-gnu.
+
+2003-11-14 Arnaud Charlet <charlet@act-europe.fr>
+
+ * nmake.ads, nmake.adb, sinfo.h, treeprs.ads: Regenerated.
+
+ * comperr.adb: Fix logic in previous change.
+
+2003-11-13 Vincent Celier <celier@gnat.com>
+
+ * 5bml-tgt.adb (Build_Dynamic_Library): Use
+ Osint.Include_Dir_Default_Prefix instead of
+ Sdefault.Include_Dir_Default_Name.
+
+ * gnatlbr.adb: Update Copyright notice
+ (Gnatlbr): : Use Osint.Include_Dir_Default_Prefix instead of
+ Sdefault.Include_Dir_Default_Name and Osint.Object_Dir_Default_Prefix
+ instead of Sdefault.Object_Dir_Default_Name
+
+ * gnatlink.adb:
+ (Process_Binder_File): Never suppress the option following -Xlinker
+
+ * mdll-utl.adb:
+ (Gcc): Use Osint.Object_Dir_Default_Prefix instead of
+ Sdefault.Object_Dir_Default_Name.
+
+ * osint.ads, osint.adb:
+ (Include_Dir_Default_Prefix, Object_Dir_Default_Prefix): New functions
+ Minor reformatting.
+
+ * vms_conv.ads: Minor reformating
+ Remove GNAT STANDARD and GNAT PSTA
+
+ * vms_conv.adb:
+ Allow GNAT MAKE to have several files on the command line.
+ (Init_Object_Dirs): Use Osint.Object_Dir_Default_Prefix instead of
+ Sdefault.Object_Dir_Default_Name.
+ Minor Reformating
+ Remove data for GNAT STANDARD
+
+ * vms_data.ads:
+ Add new compiler qualifier /PRINT_STANDARD (-gnatS)
+ Remove data for GNAT STANDARD
+ Remove options and documentation for -gnatwb/-gnatwB: these warning
+ options no longer exist.
+
+2003-11-13 Ed Falis <falis@gnat.com>
+
+ * 5zthrini.adb: (Init_RTS): Made visible
+
+ * 5zthrini.adb:
+ (Register): Removed unnecessary call to taskVarGet that checked whether
+ an ATSD was already set as a task var for the argument thread.
+
+ * s-thread.adb:
+ Updated comment to reflect that this is a VxWorks version
+ Added context clause for System.Threads.Initialization
+ Added call to System.Threads.Initialization.Init_RTS
+
+2003-11-13 Jerome Guitton <guitton@act-europe.fr>
+
+ * 5zthrini.adb:
+ (Init_RTS): New procedure, for the initialization of the run-time lib.
+
+ * s-thread.adb:
+ Remove dependancy on System.Init, so that this file can be used in the
+ AE653 sequential run-time lib.
+
+2003-11-13 Robert Dewar <dewar@gnat.com>
+
+ * bindgen.adb: Minor reformatting
+
+2003-11-13 Ed Schonberg <schonberg@gnat.com>
+
+ * checks.adb:
+ (Apply_Discriminant_Check): Do no apply check if target type is derived
+ from source type with no applicable constraint.
+
+ * lib-writ.adb:
+ (Ensure_System_Dependency): Do not apply the style checks that may have
+ been specified for the main unit.
+
+ * sem_ch8.adb:
+ (Find_Selected_Component): Further improvement in error message, with
+ RM reference.
+
+ * sem_res.adb:
+ (Resolve): Handle properly the case of an illegal overloaded protected
+ procedure.
+
+2003-11-13 Javier Miranda <miranda@gnat.com>
+
+ * exp_aggr.adb:
+ (Has_Default_Init_Comps): New function to check the presence of
+ default initialization in an aggregate.
+ (Build_Record_Aggr_Code): Recursively expand the ancestor in case of
+ extension aggregate of a limited record. In addition, a new formal
+ was added to do not initialize the record controller (if any) during
+ this recursive expansion of ancestors.
+ (Init_Controller): Add support for limited record components.
+ (Expand_Record_Aggregate): In case of default initialized components
+ convert the aggregate into a set of assignments.
+
+ * par-ch4.adb (P_Aggregate_Or_Paren_Expr): Update the comment
+ describing the new syntax.
+ Nothing else needed to be done because this subprogram delegates part of
+ its work to P_Precord_Or_Array_Component_Association.
+ (P_Record_Or_Array_Component_Association): Give support to the new
+ syntax for default initialization of components.
+
+ * sem_aggr.adb:
+ (Resolve_Aggregate): Relax the strictness of the frontend in case of
+ limited aggregates.
+ (Resolve_Record_Aggregate): Give support to default initialized
+ components.
+ (Get_Value): In case of default initialized components, duplicate
+ the corresponding default expression (from the record type
+ declaration). In case of default initialization in the *others*
+ choice, do not check that all components have the same type.
+ (Resolve_Extension_Aggregate): Give support to limited extension
+ aggregates.
+
+ * sem_ch3.adb:
+ (Check_Initialization): Relax the strictness of the front-end in case
+ of aggregate and extension aggregates. This test is now done in
+ Get_Value in a per-component manner.
+
+ * sem_ch4.adb (Analyze_Allocator): Don't post an error if the
+ expression corresponds to a limited aggregate. This test is now done
+ in Get_Value.
+
+ * sinfo.ads, sinfo.adb (N_Component_Association): Addition of
+ Box_Present flag.
+
+ * sprint.adb (Sprint_Node_Actual): Modified to print an mbox if
+ present in an N_Component_Association node
+
+2003-11-13 Thomas Quinot <quinot@act-europe.fr>
+
+ * sem_ch9.adb (Analyze_Accept_Statement): A procedure hides a
+ type-conformant entry only if they are homographs.
+
+2003-11-13 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-11-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * adadecode.c: Use <> form of include for ctype.h.
+ * sysdep.c [IN_RTS]: Use <> form of include for time.h.
+
+2003-11-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * 5gsystem.ads (Functions_Return_By_DSP): Set to False.
+ Works around PR middle-end/6552.
+
+2003-11-10 Ed Falis <falis@gnat.com>
+
+ * 5ytiitho.adb: (procStartHookAdd): Definition and call deleted
+
+ * 5zinit.adb: (Install_Handler): Moved back to spec
+ (Install_Signal_Handlers): Deleted
+
+ * 5zthrini.adb: Added context clause for System.Storage_Elements
+ (Register): Only handles creation of taskVar; initialization moved to
+ Thread_Body_Enter.
+ (Reset_TSD): Deleted; replaced by Thread_Body_Enter
+ Added declaration of environment task secondary stack and
+ initialization.
+
+ * s-thread.adb: Implement bodies for thread body processing
+
+ * s-thread.ads:
+ Added comment identifying supported targets for pragma Thread_Body.
+
+2003-11-10 Pascal Obry <obry@gnat.com>
+
+ * adaint.c (_gnat_stat) [WIN32]: Check if name is not bigger than
+ GNAT_MAX_PATH_LEN.
+
+ * s-fileio.adb:
+ (Open): Properly check for string length before copying into the buffer.
+ Raises Name_Error if buffer is too small. Note that this was a potential
+ buffer overflow.
+
+2003-11-10 Romain Berrendonner <berrendo@act-europe.fr>
+
+ * bindgen.adb, comperr.adb: Code clean ups.
+ * gnatvsn.ads, gnatvsn.adb (Get_Gnat_Version_Type): New function.
+
+2003-11-10 Sergey Rybin <rybin@act-europe.fr>
+
+ * gnat1drv.adb: Add call to Sem_Elim.Initialize.
+
+2003-11-10 Vincent Celier <celier@gnat.com>
+
+ * gprcmd.adb:
+ (Gprcmd): Add new command "prefix" to get the prefix of the GNAT
+ installation.
+
+ * make.adb (Scan_Make_Arg): Transmit -nostdlib to the compiler
+
+ * prj.adb: (Project_Empty): Add new boolean component Virtual
+
+ * prj.ads: (Virtual_Prefix): New constant string
+ (Project_Data): New boolean component Virtual
+
+ * prj-nmsc.adb (Language_Independent_Check): Adjust error message when
+ a library project is extended by a virtual extending project.
+
+ * prj-part.adb:
+ Modifications throughout to implement extending-all project, including:
+ (Virtual_Hash, Processed_Hash): New hash tables
+ (Create_Virtual_Extending_Project): New procedure
+ (Look_For_Virtual_Projects_For): New procedure
+
+ * prj-proc.adb:
+ (Process): After checking the projects, if main project is an
+ extending-all project, set the object directory of all virtual extending
+ project to the object directory of the main project.
+ Adjust error message when a virtual extending project has the same
+ object directory as an project being extended.
+ (Recursive_Process): If name starts with the virtual prefix, set Virtual
+ to True in the project data.
+
+ * prj-tree.adb:
+ (Default_Project_Node): Add new boolean component Extending_All
+ (Is_Extending_All): New function
+ (Set_Is_Extending_All): New procedure
+
+ * prj-tree.ads: (Is_Extending_All): New function
+ (Set_Is_Extending_All): New procedure
+ (Project_Node_Record): New boolean component Extending_All
+
+ * switch-c.adb: (Scan_Front_End_Switches): Process -nostdlib
+
+ * vms_data.ads:
+ Add qualifier /NOSTD_LIBRARIES (-nostdlib) for the compiler
+
+ * bld.adb (Recursive_Process): If MAKE_ROOT is not defined, call
+ "gprcmd prefix" to define it.
+
+2003-11-10 Thomas Quinot <quinot@act-europe.fr>
+
+ * einfo.ads: Fix a typo and remove an extraneous word in comments.
+
+ * lib-load.adb:
+ (Create_Dummy_Package_Unit): Set the scope of the entity for the
+ created dummy package to Standard_Standard, not to itself, to
+ defend other parts of the front-end against encoutering a cycle in
+ the scope chain.
+
+ * sem_ch10.adb:
+ (Analyze_With_Clause): When setting the entities for the successive
+ N_Expanded_Names that constitute the name of a child unit, do not
+ attempt to go further than Standard_Standard in the chain of scopes.
+ This case arises from the placeholder units created by
+ Create_Dummy_Package_Unit in the case of a with_clause for a
+ nonexistent child unit.
+
+2003-11-10 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch6.adb:
+ (Expand_Thread_Body): Place subprogram on scope stack, so that new
+ declarations are given the proper scope.
+
+ * sem_ch13.adb:
+ (Check_Expr_Constants): Reject an expression that contains a constant
+ created during expansion, and that appears after the object to which
+ the address clause applies.
+
+ * sem_ch5.adb (Check_Controlled_Array_Attribute): Subsidiary of
+ Analyze_Iteration_Scheme, to rewrite a loop parameter specification
+ that uses 'Range of a function call with controlled components, so
+ that the function result can be finalized before starting the loop.
+
+ * sem_ch8.adb:
+ (Find_Selected_Component): Improve error message when prefix is
+ an implicit dereference of an incomplete type.
+
+2003-11-10 Robert Dewar <dewar@gnat.com>
+
+ * opt.ads: New Print_Standard flag for -gnatS switch
+
+ * sem_ch13.adb: Remove some additional checks for unaligned arrays
+
+ * cstand.adb (Create_Standard): Print out package standard if -gnatS
+ switch set
+
+ * debug.adb: Update doc for -gnatds to discuss relationship with new
+ -gnatS flag
+
+ * sinfo.adb: Add new field Entity_Or_Associated_Node
+
+ * sinfo.ads: Add new field Entity_Or_Associated_Node
+ Update documentation for Associated_Node and Entity fields to clarify
+ relationship and usage.
+
+ * sprint.adb:
+ (Write_Id): Properly process Associated_Node field in generic template
+
+ * switch-c.adb:
+ Recognize new -gnatS switch for printing package Standard
+ This replaces gnatpsta
+
+ * usage.adb:
+ Add line for new -gnatS switch for printing package Standard
+ This replaces gnatpsta
+
+2003-11-10 Andreas Jaeger <aj@suse.de>
+
+ * 7sosprim.adb: tv_usec of struct_timeval and time_t are long
+ integer.
+
+2003-11-10 Arnaud Charlet <charlet@act-europe.fr>
+
+ * misc.c, lang.opt: Add handling of -nostdlib, now recognized/needed
+ by gnat1.
+
+2003-11-10 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.in, Make-lang.in: Remove build of gnat_wrapper and gnatpsta,
+ no longer needed.
+
+ * gnatpsta.adb, gnat_wrapper.adb: Removed, no longer needed.
+
+ * sysdep.c: Add handling of cygwin.
+
+2003-11-10 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-11-10 Arnaud Charlet <charlet@act-europe.fr>
+
+ PR 12950
+ * osint.ads, osint.adb (Relocate_Path, Executable_Suffix): New
+ functions. Used to handle dynamic prefix relocation, via set_std_prefix.
+ Replace GNAT_ROOT by GCC_ROOT.
+
+ * Make-lang.in: Use new function Relocate_Path to generate sdefault.adb
+
+2003-11-06 Zack Weinberg <zack@codesourcery.com>
+
+ * misc.c (fp_prec_to_size, fp_size_to_prec): Use GET_MODE_PRECISION
+ and update for changed meaning of GET_MODE_BITSIZE.
+
+2003-11-04 Doug Rupp <rupp@gnat.com>
+
+ * sysdep.c: Problem discovered during IA64 VMS port.
+ [VMS] #include <unixio.h> to get proper prototypes.
+
+ * adaint.c:
+ Issues discovered/problems fixed during IA64 VMS port.
+ [VMS] #define _POSIX_EXIT for proper semantics.
+ [VMS] #include <unixio.h> for proper prototypes.
+ [VMS] (fork): #define IA64 version.
+ (__gnat_os_exit): Remove unnecessary VMS specific code.
+
+2003-11-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ Part of PR ada/12806
+
+ * ada-tree.h (TYPE_DIGITS_VALUE, SET_TYPE_DIGITS_VALUE): Save count as
+ tree, not integer.
+
+ * decl.c:
+ (gnat_to_gnu_entity, case E_Floating_Point_Type): Save count as tree,
+ not integer.
+
+ * targtyps.c, decl.c, misc.c,
+ gigi.h (fp_prec_to_size, fp_size_to_prec): Temporary
+ routines to work around change in FP sizing semantics in GCC.
+
+ * utils.c:
+ (build_vms_descriptor): TYPE_DIGITS_VALUE is tree, not integer.
+
+ * gigi.h: (enumerate_modes): New function.
+
+ * Make-lang.in: (ada/misc.o): Add real.h.
+
+ * misc.c: (enumerate_modes): New function.
+
+2003-11-04 Robert Dewar <dewar@gnat.com>
+
+ * 3vtrasym.adb: Minor reformatting
+ Use terminology encoded/decoded name, rather than C++ specific notion
+ of mangling (this is the terminology used throughout GNAT).
+
+ * einfo.h: Regenerated
+
+ * einfo.ads, einfo.adb: Add new flag Is_Thread_Body
+
+ * exp_ch6.adb:
+ (Expand_N_Subprogram_Body): Handle expansion of thread body procedure
+
+ * par-prag.adb: Add dummy entry for Thread_Body pragma
+
+ * rtsfind.ads:
+ Add entries for System.Threads entities for thread body processing
+
+ * sem_attr.adb:
+ (Analyze_Pragma, Access attributes): Check these are not applied to a
+ thread body, since this is not permitted
+
+ * sem_prag.adb: Add processing for Thread_Body pragma.
+ Minor comment fix.
+
+ * sem_res.adb:
+ (Resolve_Call): Check for incorrect attempt to call a thread body
+ procedure with a direct call.
+
+ * snames.ads, snames.adb: Add entry for Thread_Body pragma
+ Add names associated with thread body expansion
+
+ * snames.h: Add entry for Thread_Body pragma
+
+ * s-thread.adb: Add entries for thread body processing
+ These are dummy bodies so far
+
+ * s-thread.ads: Add documentation on thread body handling.
+ Add entries for thread body processing.
+
+2003-11-04 Javier Miranda <miranda@gnat.com>
+
+ * sem_ch10.adb:
+ (Build_Limited_Views): Return after posting an error in case of limited
+ with_clause on subprograms, generics, instances or generic renamings
+ (Install_Limited_Withed_Unit): Do nothing in case of limited with_clause
+ on subprograms, generics, instances or generic renamings
+
+2003-11-04 Arnaud Charlet <charlet@act-europe.fr>
+
+ * raise.c (setup_to_install): Correct mistake in last revision; two
+ arguments out of order.
+
+ * trans.c, cuintp.c, argv.c, aux-io.c, cal.c, errno.c, exit.c,
+ gnatbl.c, init.c, stringt.h, utils.c, utils2.c: Update copyright
+ notice, missed in previous change.
+ Remove trailing blanks and other style errors introduced in previous
+ change.
+
+2003-11-04 Olivier Hainque <hainque@act-europe.fr>
+
+ * decl.c (gnat_to_gnu_field): Adjust the conditions under which we get
+ rid of the wrapper for a LJM type, ensuring we don't do that if the
+ field is addressable. This avoids potential low level type view
+ mismatches later on, for instance in a by-reference argument passing
+ process.
+
+2003-11-04 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * decl.c (gnat_to_gnu_field): No longer check for BLKmode being
+ aligned at byte boundary.
+
+2003-11-04 Joel Brobecker <brobecker@gnat.com>
+
+ * decl.c (components_to_record): Do not delete the empty variants from
+ the end of the union type.
+
+2003-11-04 Ed Schonberg <schonberg@gnat.com>
+
+ * exp_ch4.adb (Expand_N_Op_Eq): Use base type when locating primitive
+ operation for a derived type, an explicit declaration may use a local
+ subtype of Boolean.
+
+2003-11-04 Vincent Celier <celier@gnat.com>
+
+ * make.adb (Gnatmake): Allow main sources on the command line with a
+ library project when it is only for compilation (no binding or
+ linking).
+
+2003-11-04 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * Makefile.in: Remove many duplicate variables.
+
+2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (dvi): Move targets to $(docobjdir).
+ (gnat_ug_vms.dvi): Simplify rule and adjust target.
+ (gnat_ug_wnt.dvi): Likewise.
+ (gnat_ug_unx.dvi): Likewise.
+ (gnat_ug_vxw.dvi): Likewise.
+ (gnat_rm.dvi): Likewise.
+ (gnat-style.dvi): Likewise.
+
+2003-10-31 Kelley Cook <kcook@gcc.gnu.org>
+
+ * gigi.h: Missed commit from update for C90.
+
+2003-10-31 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Makefile.in (ada/b_gnat1.o): Compile with -Wno-error.
+
+2003-10-31 Andreas Schwab <schwab@suse.de>
+
+ * raise.c (get_action_description_for): Fix typo in last change.
+
+2003-10-31 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ PR ada/12761
+ * ada/Make-lang.in: Move default definitions of X_ADA_CFLAGS,
+ T_ADA_CFLAGS, X_ADAFLAGS, T_ADAFLAGS from here to master Makefile.in.
+
+2003-10-30 Kelley Cook <kcook@gcc.gnu.org>
+
+ * adadecode.c, adaint.c, argv.c, aux-io.c, cal.c, cio.c, cstreams.c,
+ ctrl_c.c, cuintp.c, decl.c, errno.c, exit.c, expect.c, final.c,
+ gigi.h, gmem.c, gnatbl.c, init.c, misc.c, mkdir.c, raise.c, socket.c,
+ sysdep.c, sysdep.c, targtyps.c, tb-alvms.c, tb-alvxw.c, tracebak.c,
+ trans.c, utils.c, utils2.c: Convert function prototypes to C90.
+
+2003-10-30 Vasiliy Fofanov <fofanov@act-europe.fr>
+
+ * 3vtrasym.adb:
+ Demangle Ada symbols returned by TBK$SYMBOLIZE. Correctly align line
+ numbers when symbol name is too long.
+
+2003-10-30 Ed Falis <falis@gnat.com>
+
+ * g-signal.ads, g-signal.adb: New files
+
+ * impunit.adb: (Non_Imp_File_Names): Added "g-signal"
+
+ * Makefile.rtl: Introduce GNAT.Signals
+
+2003-10-30 Robert Dewar <dewar@gnat.com>
+
+ * freeze.adb: Minor reformatting
+
+ * lib-writ.adb (Write_ALI): Never write ali file if -gnats is specified
+
+ * par.adb, par-ch12.adb, par-ch13.adb, par-ch2.adb, par-ch3.adb,
+ par-ch5.adb, par-ch6.adb, par-ch9.adb, par-util.adb:
+ New handling of Id_Check parameter to improve recognition of keywords
+ used as identifiers.
+ Update copyright notice to include 2003
+
+2003-10-29 Robert Dewar <dewar@gnat.com>
+
+ * 3vtrasym.adb, 5vtraent.ads, sprint.adb,
+ sem_ch10.adb: Minor reformatting
+
+ * exp_ch5.adb (Expand_Assign_Array): Test for bit unaligned operands
+ (Expand_Assign_Record): Test right hand side for bit unaligned as well
+
+2003-10-29 Vasiliy Fofanov <fofanov@act-europe.fr>
+
+ * 3vtrasym.adb, 5vtraent.adb, 5vtraent.ads, tb-alvms.c:
+ Support for TBK$SYMBOLIZE-based symbolic traceback.
+
+2003-10-29 Jose Ruiz <ruiz@act-europe.fr>
+
+ * exp_disp.adb:
+ Revert previous change, that did not work well when pragma No_Run_Time
+ was used in conjunction with a run-time other than ZFP.
+
+2003-10-29 Vincent Celier <celier@gnat.com>
+
+ * make.adb:
+ (Gnatmake): When there are no Ada mains in attribute Main, disable the
+ bind and link steps only is switch -z is not used.
+
+2003-10-29 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.generic: Remove duplicated setting of CC.
+
+ * Makefile.prolog: Set CC to gcc by default, to override make's
+ default (cc).
+
+ * einfo.h: Regenerated.
+
+2003-10-29 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch10.adb (Analyze_Subunit): Restore state of suppress flags for
+ current body, after compiling subunit.
+
+ * itypes.adb (Create_Itype): In ASIS_Mode, do not freeze the itype
+ when in deleted code, because gigi needs properly ordered freeze
+ actions to annotate types.
+
+ * freeze.adb (Is_Fully_Defined): Predicate must be recursive, to
+ prevent the premature freezing of record type that contains
+ subcomponents with a private type that does not yet have a completion.
+
+2003-10-29 Javier Miranda <miranda@gnat.com>
+
+ * sem_ch12.adb:
+ (Analyze_Package_Instantiation): Check that instances can not be used in
+ limited with_clauses.
+
+ * sem_ch8.adb:
+ (Analyze_Package_Renaming): Check that limited withed packages cannot
+ be renamed. Improve text on error messages related to limited
+ with_clauses.
+
+ * einfo.adb, einfo.ads: Remove Non_Limited_Views attribute.
+
+ * sprint.adb: (Sprint_Node_Actual): Print limited with_clauses.
+ Update copyright notice.
+
+ * sem_ch10.adb: (Build_Limited_Views): Complete its documentation.
+ (Install_Limited_Context_Clauses): New subprogram that isolates all the
+ checks required for limited context_clauses and installs the limited
+ view.
+ (Install_Limited_Withed_Unit): Complete its documentation.
+ (Analyze_Context): Check that limited with_clauses are only allowed in
+ package specs.
+ (Install_Context): Call Install_Limited_Context_Clauses after the
+ parents have been installed.
+ (Install_Limited_Withed_Unit): Add documentation. Mark the installed
+ package as 'From_With_Type'; this mark indicates that the limited view
+ is installed. Used to check bad usages of limited with_clauses.
+ (Build_Limited_Views): Do not add shadow entities to the scope's list
+ of entities. Do not add real entities to the Non_Limited_Views chain.
+ Improve error notification.
+ (Remove_Context_Clauses): Remove context clauses in two phases:
+ limited views first and regular views later (to maintain the
+ stack model).
+ (Remove_Limited_With_Clause): If the package is analyzed then reinstall
+ its visible entities.
+
+2003-10-29 Thomas Quinot <quinot@act-europe.fr>
+
+ * sem_type.adb (Specific_Type): Type Universal_Fixed is compatible
+ with any type that Is_Fixed_Point_Type.
+
+ * sinfo.ads: Fix documentation for Associated_Node attribute.
+
+2003-10-29 Sergey Rybin <rybin@act-europe.fr>
+
+ * switch-c.adb (Scan_Front_End_Switches): ASIS_Mode is set now when
+ both '-gnatc' and '-gnatt' are specified.
+
+ * atree.adb (Initialize): Add initialization for Node_Count (set to
+ zero).
+
+2003-10-29 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+
+ * decl.c (gnat_to_gnu_entity, case E_Subprogram): If no return value,
+ do not consider as Pure.
+
+ Part of implementation of function-at-a-time:
+
+ * trans.c (gnat_to_gnu_code): If IS_STMT, call expand_expr_stmt.
+ (tree_transform): Add new argument to build_component_ref.
+ (tree_transform, case N_Assignment_Statement): Make and return an
+ EXPR_STMT.
+ (tree_transform): If result IS_STMT, set flags and return it.
+ (gnat_expand_stmt, set_lineno_from_sloc): New functions.
+
+ * utils2.c (build_simple_component_ref, build_component_ref): Add new
+ arg, NO_FOLD_P.
+ (build_binary_op, case EQ_EXPR): Pass additional arg to it.
+ (build_allocator): Likewise.
+
+ * utils.c (convert_to_fat_pointer, convert_to_thin_pointer, convert):
+ Add new arg to build_component_ref.
+ (maybe_unconstrained_array, unchecked_convert): Likewise.
+
+ * ada-tree.def (EXPR_STMT): New code.
+
+ * ada-tree.h (IS_STMT, TREE_SLOC, EXPR_STMT_EXPR): New macros.
+
+ * decl.c (gnat_to_gnu_entity, case object): Add extra arg to
+ build_component_ref calls.
+
+ * misc.c (gnat_expand_expr): If IS_STMT, call gnat_expand_stmt.
+
+ * gigi.h (gnat_expand_stmt, set_lineno_from_sloc): New functions.
+ (build_component_ref): Add new argument, NO_FOLD_P.
+
+2003-10-27 Arnaud Charlet <charlet@act-europe.fr>
+
+ * Makefile.generic: Add missing substitution on object_deps handling.
+
+ PR ada/5909:
+ * Make-lang.in (check-ada): Enable ACATS test suite.
+
+2003-10-27 Robert Dewar <dewar@gnat.com>
+
+ * exp_ch3.adb:
+ (Freeze_Array_Type): We do not need an initialization routine for types
+ derived from String or Wide_String. They should be treated the same
+ as String and Wide_String themselves. This caused problems with the
+ use of Initialize_Scalars.
+
+ * exp_ch5.adb:
+ (Expand_Assign_Record): Do component-wise assignment of non-byte aligned
+ composites. This allows use of component clauses that are not byte
+ aligned.
+
+ * sem_prag.adb:
+ (Analyze_Pragma, case Pack): Generate warning and ignore pack if there
+ is an attempt to pack an array of atomic objects.
+
+ * make.adb, prj-env.adb, prj-env.ads: Minor reformatting
+
+2003-10-27 Pascal Obry <obry@gnat.com>
+
+ * g-dirope.adb:
+ (Basename): Check for drive letters in a pathname only on DOS based OS.
+
+2003-10-27 Vincent Celier <celier@gnat.com>
+
+ * make.adb:
+ (Gnatmake): When unable to change dir to the object dir, display the
+ content of the parent dir of the obj dir, to try to understand why this
+ happens.
+
+2003-10-27 GNAT Script <nobody@gnat.com>
+
+ * Make-lang.in: Makefile automatically updated
+
+2003-10-27 Ed Schonberg <schonberg@gnat.com>
+
+ * sem_ch12.adb:
+ (Inline_Instance_Body): Indicate that the save/restore of use_clauses
+ should not be done in Save/Restore_Scope_Stack, because it is performed
+ locally.
+
+ * sem_ch8.adb:
+ (Save_Scope_Stack, Restore_Scope_Stack): Add parameter to indicate
+ whether use clauses should be removed/restored.
+
+ * sem_ch8.ads:
+ (Save_Scope_Stack, Restore_Scope_Stack): Add parameter to indicate
+ whether use clauses should be removed/restored.
+
2003-10-26 Andreas Jaeger <aj@suse.de>
* Makefile.in: Remove duplicated lines.
diff --git a/gcc/ada/Make-lang.in b/gcc/ada/Make-lang.in
index 4ce68a6057d..45e16f94335 100644
--- a/gcc/ada/Make-lang.in
+++ b/gcc/ada/Make-lang.in
@@ -1,4 +1,4 @@
-# Top level makefile fragment for GNU Ada (GNAT).
+# Top level -*- makefile -*- fragment for GNU Ada (GNAT).
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
# Free Software Foundation, Inc.
@@ -24,7 +24,7 @@
#
# foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
-# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -46,11 +46,6 @@ RMDIR = rm -rf
# default extensions
shext =
-X_ADA_CFLAGS =
-T_ADA_CFLAGS =
-
-X_ADAFLAGS =
-T_ADAFLAGS =
# Extra flags to pass to recursive makes.
BOOT_ADAFLAGS= $(ADAFLAGS)
@@ -86,6 +81,7 @@ ADA_FLAGS_TO_PASS = \
ada-warn = $(ALL_ADA_CFLAGS) $(WERROR)
# unresolved warnings in a couple of files
ada/tracebak.o-warn = -Wno-error
+ada/b_gnat1.o-warn = -Wno-error
ada/b_gnatb.o-warn = -Wno-error
.adb.o:
@@ -122,7 +118,7 @@ GNAT1_C_OBJS = ada/b_gnat1.o ada/adadecode.o ada/adaint.o ada/cstreams.o \
# Object files from Ada sources that are used by gnat1
GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \
- ada/a-ioexce.o \
+ ada/a-elchha.o ada/a-ioexce.o \
ada/s-memory.o ada/s-carun8.o ada/s-casuti.o ada/s-strcom.o ada/s-purexc.o \
ada/s-htable.o ada/s-traceb.o ada/s-mastop.o ada/s-except.o ada/ali.o \
ada/alloc.o ada/atree.o ada/butil.o ada/casing.o ada/checks.o ada/comperr.o \
@@ -157,7 +153,7 @@ GNAT_ADA_OBJS = ada/ada.o ada/a-charac.o ada/a-chlat1.o ada/a-except.o \
ada/stylesw.o ada/validsw.o ada/system.o ada/table.o ada/targparm.o \
ada/tbuild.o ada/tree_gen.o ada/tree_io.o ada/treepr.o ada/treeprs.o \
ada/ttypef.o ada/ttypes.o ada/types.o ada/uintp.o ada/uname.o ada/urealp.o \
- ada/usage.o ada/widechar.o
+ ada/usage.o ada/widechar.o ada/s-crtl.o
# Object files for gnat executables
GNAT1_ADA_OBJS = $(GNAT_ADA_OBJS) ada/back_end.o ada/gnat1drv.o
@@ -177,6 +173,7 @@ GNATBIND_OBJS = \
ada/tracebak.o \
ada/a-except.o \
ada/ada.o \
+ ada/a-elchha.o \
ada/ali-util.o \
ada/ali.o \
ada/alloc.o \
@@ -215,6 +212,7 @@ GNATBIND_OBJS = \
ada/s-carun8.o \
ada/s-casuti.o \
ada/s-crc32.o \
+ ada/s-crtl.o \
ada/s-except.o \
ada/s-exctab.o \
ada/s-htable.o \
@@ -294,10 +292,10 @@ regnattools:
# use host-gcc host-gnatmake host-gnatbind host-gnatlink
# put the host RTS dir first in the PATH to hide the default runtime
# files that are among the sources
-RTS_DIR:=$(dir $(subst \,/,$(shell $(CC) -print-libgcc-file-name)))
+RTS_DIR:=$(strip $(subst \,/,$(shell gnatls -v | grep adalib )))
cross-gnattools: force
$(MAKE) -C ada $(FLAGS_TO_PASS) $(ADA_FLAGS_TO_PASS)\
- ADA_INCLUDES="-I$(RTS_DIR)adainclude -I$(RTS_DIR)adalib" \
+ ADA_INCLUDES="-I$(RTS_DIR)../adainclude -I$(RTS_DIR)" \
GNATMAKE="gnatmake" \
GNATBIND="gnatbind" \
GNATLINK="gnatlink" \
@@ -407,10 +405,6 @@ ada.all.cross:
then \
$(MV) gnatprep$(exeext) gnatprep-cross$(exeext); \
fi
- -if [ -f gnatpsta$(exeext) ] ; \
- then \
- $(MV) gnatpsta$(exeext) gnatpsta-cross$(exeext); \
- fi
-if [ -f gnatxref$(exeext) ] ; \
then \
$(MV) gnatxref$(exeext) gnatxref-cross$(exeext); \
@@ -440,34 +434,56 @@ ada.start.encap:
ada.rest.encap:
ada.tags: force
- cd $(srcdir)/ada; etags *.c *.h *.ads *.adb
+ cd $(srcdir)/ada; etags -o TAGS.sub *.c *.h *.ads *.adb; \
+ etags --include TAGS.sub --include ../TAGS.sub
+
ada.generated-manpages:
# Generate documentation.
#
# The generated Texinfo files for the User Guide are stored in
-# $(srcdir), like the Info files.
+# $(srcdir). However, if the documentation files depended on
+# executables in the build tree, there'd be no way to ship a source
+# tree with the documentation already generated such that `make'
+# wouldn't attempt to rebuild it. So, we punt and arrange for the
+# documentation files to depend on a stamp file which has the
+# combined dependencies of the texi files and the generatator file.
+# This stamp file calls a submake to build the executable.
+#
+# If gnu make 3.80 is ever made a requirement to build, then
+# this dance could be avoided using an order-only dependency:
+#
+# $(srcdir)/ada/gnat_ug_unx.texi: \
+# ada/gnat_ug.texi ada/ug_words | ada/doctools/xgnatug$(build_exeext)
+
+$(srcdir)/ada/stamp-xgnatug: ada/xgnatug.adb ada/gnat_ug.texi ada/ug_words
+ $(MAKE) ada/doctools/xgnatug$(build_exeext)
+ $(STAMP) $(srcdir)/ada/stamp-xgnatug
-ada/doctools/xgnatug : ada/xgnatug.adb
+ada/doctools/xgnatug$(build_exeext): ada/xgnatug.adb
-$(MKDIR) ada/doctools
cp $^ ada/doctools
cd ada/doctools && gnatmake -q xgnatug
-$(srcdir)/ada/gnat_ug_unx.texi : ada/doctools/xgnatug \
- $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words
- ada/doctools/xgnatug unx $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_unx.texi
+$(srcdir)/ada/gnat_ug_unx.texi: $(srcdir)/ada/stamp-xgnatug
+ ada/doctools/xgnatug unx $(srcdir)/ada/gnat_ug.texi \
+ $(srcdir)/ada/ug_words \
+ $(srcdir)/ada/gnat_ug_unx.texi
-$(srcdir)/ada/gnat_ug_vms.texi : ada/doctools/xgnatug \
- $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words
- ada/doctools/xgnatug vms $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_vms.texi
+$(srcdir)/ada/gnat_ug_vms.texi: $(srcdir)/ada/stamp-xgnatug
+ ada/doctools/xgnatug vms $(srcdir)/ada/gnat_ug.texi \
+ $(srcdir)/ada/ug_words \
+ $(srcdir)/ada/gnat_ug_vms.texi
-$(srcdir)/ada/gnat_ug_vxw.texi : ada/doctools/xgnatug \
- $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words
- ada/doctools/xgnatug vxworks $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_vxw.texi
+$(srcdir)/ada/gnat_ug_vxw.texi: $(srcdir)/ada/stamp-xgnatug
+ ada/doctools/xgnatug vxworks $(srcdir)/ada/gnat_ug.texi \
+ $(srcdir)/ada/ug_words \
+ $(srcdir)/ada/gnat_ug_vxw.texi
-$(srcdir)/ada/gnat_ug_wnt.texi : ada/doctools/xgnatug \
- $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words
- ada/doctools/xgnatug wnt $(srcdir)/ada/gnat_ug.texi $(srcdir)/ada/ug_words $(srcdir)/ada/gnat_ug_wnt.texi
+$(srcdir)/ada/gnat_ug_wnt.texi: $(srcdir)/ada/stamp-xgnatug
+ ada/doctools/xgnatug wnt $(srcdir)/ada/gnat_ug.texi \
+ $(srcdir)/ada/ug_words \
+ $(srcdir)/ada/gnat_ug_wnt.texi
$(docobjdir)/gnat_ug_unx.info : $(srcdir)/ada/gnat_ug_unx.texi \
$(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi \
@@ -510,39 +526,38 @@ install-info:: $(DESTDIR)$(infodir)/gnat_ug_vms.info \
$(DESTDIR)$(infodir)/gnat_rm.info \
$(DESTDIR)$(infodir)/gnat-style.info
-ada/gnat_ug_unx.dvi : $(srcdir)/ada/gnat_ug_unx.texi \
- $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_unx.dvi $$s/ada/gnat_ug_unx.texi
+dvi:: $(docobjdir)/gnat_ug_vms.dvi $(docobjdir)/gnat_ug_wnt.dvi \
+ $(docobjdir)/gnat_ug_unx.dvi $(docobjdir)/gnat_ug_vxw.dvi \
+ $(docobjdir)/gnat_rm.dvi $(docobjdir)/gnat-style.dvi
-ada/gnat_ug_vms.dvi : $(srcdir)/ada/gnat_ug_vms.texi \
- $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_vms.dvi $$s/ada/gnat_ug_vms.texi
+$(docobjdir)/gnat_ug_unx.dvi: ada/gnat_ug_unx.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
-ada/gnat_ug_vxw.dvi : $(srcdir)/ada/gnat_ug_vxw.texi \
- $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_vxw.dvi $$s/ada/gnat_ug_vxw.texi
+$(docobjdir)/gnat_ug_vms.dvi: ada/gnat_ug_vms.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
-ada/gnat_ug_wnt.dvi : $(srcdir)/ada/gnat_ug_wnt.texi \
- $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_ug_wnt.dvi $$s/ada/gnat_ug_wnt.texi
+$(docobjdir)/gnat_ug_vxw.dvi: ada/gnat_ug_vxw.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
-ada/gnat_rm.dvi : $(srcdir)/ada/gnat_rm.texi \
- $(srcdir)/doc/include/fdl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat_rm.dvi $$s/ada/gnat_rm.texi
+$(docobjdir)/gnat_ug_wnt.dvi: ada/gnat_ug_wnt.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
-ada/gnat-style.dvi : $(srcdir)/ada/gnat-style.texi \
- $(srcdir)/doc/include/fdl.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; \
- cd ada && $(TEXI2DVI) -c -I $$s/doc/include -o gnat-style.dvi $$s/ada/gnat-style.texi
+$(docobjdir)/gnat_rm.dvi: ada/gnat_rm.texi \
+ $(docdir)/include/fdl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
-dvi:: ada/gnat_ug_vms.dvi ada/gnat_ug_wnt.dvi \
- ada/gnat_ug_unx.dvi ada/gnat_ug_vxw.dvi \
- ada/gnat_rm.dvi ada/gnat-style.dvi
+$(docobjdir)/gnat-style.dvi: ada/gnat-style.texi $(docdir)/include/fdl.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -c -I $(docdir)/include -o $@ $<
# Install hooks:
@@ -716,21 +731,6 @@ ada.install-common:
fi
-if [ -f gnat1$(exeext) ] ; \
then \
- if [ -f gnatpsta-cross$(exeext) ] ; \
- then \
- $(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext); \
- $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext); \
- if [ -d $(DESTDIR)$(tooldir)/bin/. ] ; then \
- rm -f $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext); \
- $(INSTALL_PROGRAM) gnatpsta-cross$(exeext) $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext); \
- fi; \
- else \
- $(RM) $(DESTDIR)$(bindir)/gnatpsta$(exeext); \
- $(INSTALL_PROGRAM) gnatpsta$(exeext) $(DESTDIR)$(bindir)/gnatpsta$(exeext); \
- fi ; \
- fi
- -if [ -f gnat1$(exeext) ] ; \
- then \
if [ -f gnatxref-cross$(exeext) ] ; \
then \
$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatxref$(exeext); \
@@ -862,7 +862,6 @@ ada.uninstall:
-$(RM) $(DESTDIR)$(bindir)/gnatmem$(exeext)
-$(RM) $(DESTDIR)$(bindir)/gnatname$(exeext)
-$(RM) $(DESTDIR)$(bindir)/gnatprep$(exeext)
- -$(RM) $(DESTDIR)$(bindir)/gnatpsta$(exeext)
-$(RM) $(DESTDIR)$(bindir)/gnatxref$(exeext)
-$(RM) $(DESTDIR)$(bindir)/gnatclean$(exeext)
-$(RM) $(DESTDIR)$(bindir)/gnatsym$(exeext)
@@ -880,7 +879,6 @@ ada.uninstall:
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatmem$(exeext)
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatname$(exeext)
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatprep$(exeext)
- -$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatpsta$(exeext)
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatxref$(exeext)
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatclean$(exeext)
-$(RM) $(DESTDIR)$(bindir)/$(target_noncanonical)-gnatsym$(exeext)
@@ -898,7 +896,6 @@ ada.uninstall:
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatmem$(exeext)
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatname$(exeext)
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatprep$(exeext)
- -$(RM) $(DESTDIR)$(tooldir)/bin/gnatpsta$(exeext)
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatxref$(exeext)
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatclean$(exeext)
-$(RM) $(DESTDIR)$(tooldir)/bin/gnatsym$(exeext)
@@ -928,7 +925,6 @@ ada.distclean:
-$(RM) gnatmem$(exeext)
-$(RM) gnatname$(exeext)
-$(RM) gnatprep$(exeext)
- -$(RM) gnatpsta$(exeext)
-$(RM) gnatfind$(exeext)
-$(RM) gnatxref$(exeext)
-$(RM) gnatclean$(exeext)
@@ -939,10 +935,9 @@ ada.distclean:
-$(RMDIR) ada/rts
-$(RM) ada/tools/*
-$(RMDIR) ada/tools
-ada.extraclean:
ada.maintainer-clean:
- -$(RM) ada/a-sinfo.h
- -$(RM) ada/a-einfo.h
+ -$(RM) ada/sinfo.h
+ -$(RM) ada/einfo.h
-$(RM) ada/nmake.adb
-$(RM) ada/nmake.ads
-$(RM) ada/treeprs.ads
@@ -969,7 +964,17 @@ ada.stagefeedback: stagefeedback-start
-$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stagefeedback/ada
-$(MV) ada/stamp-* stagefeedback/ada
-check-ada:
+check-ada: check-gnat
+
+ACATSDIR = $(TESTSUITEDIR)/ada/acats
+
+check-gnat:
+ test -d $(ACATSDIR) || mkdir -p $(ACATSDIR)
+ testdir=`cd ${srcdir}/${ACATSDIR}; ${PWD_COMMAND}`; \
+ export testdir; cd $(ACATSDIR); $${testdir}/run_acats $(CHAPTERS)
+
+.PHONY: check-gnat
+
# Bootstrapping targets for just GNAT - use the same stage directories
gnatboot: force
@@ -1054,7 +1059,7 @@ ada/nmake.adb : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb
$(CP) $^ ada/bldtools
(cd ada/bldtools; gnatmake -q xnmake ; ./xnmake -b ../nmake.adb )
-ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb
+ada/nmake.ads : ada/sinfo.ads ada/nmake.adt ada/xnmake.adb ada/nmake.adb
-$(MKDIR) ada/bldtools
$(CP) $^ ada/bldtools
(cd ada/bldtools; gnatmake -q xnmake ; ./xnmake -s ../nmake.ads )
@@ -1063,33 +1068,32 @@ update-sources : ada/treeprs.ads ada/einfo.h ada/sinfo.h ada/nmake.adb \
ada/nmake.ads
$(CP) $^ $(srcdir)/ada
-# Note: the strings below do not make sense for Ada strings in the OS/2
-# case. This is ignored for now since the OS/2 version doesn't use
-# these -- there are no default locations.
ada/sdefault.adb: ada/stamp-sdefault ; @true
ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \
Makefile
$(ECHO) "pragma Style_Checks (Off);" >tmp-sdefault.adb
+ $(ECHO) "with Osint; use Osint;" >>tmp-sdefault.adb
$(ECHO) "package body Sdefault is" >>tmp-sdefault.adb
- $(ECHO) " S1 : aliased constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
- $(ECHO) " S2 : aliased constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
- $(ECHO) " S3 : aliased constant String := \"$(target)/\";" >>tmp-sdefault.adb
- $(ECHO) " S4 : aliased constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S0 : constant String := \"$(prefix)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S1 : constant String := \"$(ADA_INCLUDE_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S2 : constant String := \"$(ADA_RTL_OBJ_DIR)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S3 : constant String := \"$(target)/\";" >>tmp-sdefault.adb
+ $(ECHO) " S4 : constant String := \"$(libsubdir)/\";" >>tmp-sdefault.adb
$(ECHO) " function Include_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
$(ECHO) " begin" >>tmp-sdefault.adb
- $(ECHO) " return new String'(S1);" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S1);" >>tmp-sdefault.adb
$(ECHO) " end Include_Dir_Default_Name;" >>tmp-sdefault.adb
$(ECHO) " function Object_Dir_Default_Name return String_Ptr is" >>tmp-sdefault.adb
$(ECHO) " begin" >>tmp-sdefault.adb
- $(ECHO) " return new String'(S2);" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S2);" >>tmp-sdefault.adb
$(ECHO) " end Object_Dir_Default_Name;" >>tmp-sdefault.adb
$(ECHO) " function Target_Name return String_Ptr is" >>tmp-sdefault.adb
$(ECHO) " begin" >>tmp-sdefault.adb
- $(ECHO) " return new String'(S3);" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S3);" >>tmp-sdefault.adb
$(ECHO) " end Target_Name;" >>tmp-sdefault.adb
$(ECHO) " function Search_Dir_Prefix return String_Ptr is" >>tmp-sdefault.adb
$(ECHO) " begin" >>tmp-sdefault.adb
- $(ECHO) " return new String'(S4);" >>tmp-sdefault.adb
+ $(ECHO) " return Relocate_Path (S0, S4);" >>tmp-sdefault.adb
$(ECHO) " end Search_Dir_Prefix;" >>tmp-sdefault.adb
$(ECHO) "end Sdefault;" >> tmp-sdefault.adb
$(srcdir)/move-if-change tmp-sdefault.adb ada/sdefault.adb
@@ -1097,7 +1101,7 @@ ada/stamp-sdefault : $(srcdir)/version.c $(srcdir)/move-if-change \
ada/sdefault.o : ada/sdefault.ads ada/sdefault.adb ada/types.ads \
ada/unchdeal.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/unchconv.ads
+ ada/unchconv.ads ada/osint.ads
ADA_TREE_H = ada/ada-tree.h ada/ada-tree.def
@@ -1196,7 +1200,7 @@ ada/misc.o : ada/misc.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) $(TREE_H) \
$(LANGHOOKS_DEF_H) libfuncs.h $(OPTABS_H) ada/ada.h ada/types.h \
ada/atree.h ada/nlists.h ada/elists.h ada/sinfo.h ada/einfo.h ada/namet.h \
ada/stringt.h ada/uintp.h ada/fe.h $(ADA_TREE_H) ada/gigi.h \
- ada/adadecode.h opts.h options.h target.h
+ ada/adadecode.h opts.h options.h target.h real.h
ada/targtyps.o : ada/targtyps.c $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
ada/ada.h ada/types.h ada/atree.h ada/nlists.h ada/elists.h ada/uintp.h \
@@ -1230,95 +1234,118 @@ ada/a-charac.o : ada/ada.ads ada/a-charac.ads ada/system.ads
ada/a-chlat1.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
ada/system.ads
-ada/ada.o : ada/ada.ads ada/system.ads
+ada/a-elchha.o : ada/ada.ads ada/a-except.ads ada/a-elchha.ads \
+ ada/a-elchha.adb ada/system.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/unchconv.ads
ada/a-except.o : ada/ada.ads ada/a-except.ads ada/a-except.adb \
ada/a-excach.adb ada/a-exexda.adb ada/a-exexpr.adb ada/a-exextr.adb \
- ada/a-excpol.adb ada/a-exstat.adb ada/a-unccon.ads ada/a-uncdea.ads \
- ada/interfac.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/a-elchha.ads ada/a-excpol.adb ada/a-exstat.adb ada/a-unccon.ads \
+ ada/a-uncdea.ads ada/interfac.ads ada/system.ads ada/s-exctab.ads \
ada/s-except.ads ada/s-mastop.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traceb.ads ada/s-traent.ads ada/s-unstyp.ads ada/unchconv.ads
+ ada/s-traceb.ads ada/s-traent.ads ada/s-traent.adb ada/s-unstyp.ads \
+ ada/unchconv.ads
-ada/a-ioexce.o : ada/ada.ads ada/a-ioexce.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/unchconv.ads
+ada/a-ioexce.o : ada/ada.ads ada/a-except.ads ada/a-ioexce.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
-ada/ali.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \
- ada/ali.adb ada/alloc.ads ada/butil.ads ada/casing.ads ada/debug.ads \
- ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
- ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
- ada/s-memory.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ada/ada.o : ada/ada.ads ada/system.ads
ada/ali-util.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \
ada/ali-util.ads ada/ali-util.adb ada/alloc.ads ada/binderr.ads \
ada/casing.ads ada/debug.ads ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/interfac.ads ada/lib.ads ada/namet.ads ada/opt.ads ada/osint.ads \
- ada/output.ads ada/rident.ads ada/system.ads ada/s-assert.ads \
- ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
- ada/s-memory.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/interfac.ads ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads \
+ ada/osint.ads ada/output.ads ada/rident.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads ada/s-exctab.adb \
+ ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
+
+ada/ali.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/ali.ads \
+ ada/ali.adb ada/alloc.ads ada/butil.ads ada/casing.ads ada/debug.ads \
+ ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-htable.adb ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
ada/alloc.o : ada/alloc.ads ada/system.ads
ada/atree.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \
ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \
- ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
+
+ada/back_end.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/back_end.ads ada/back_end.adb ada/casing.ads \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/fname.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \
+ ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/switch.ads ada/switch-c.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-
-ada/back_end.o : ada/alloc.ads ada/atree.ads ada/back_end.ads \
- ada/back_end.adb ada/casing.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/switch.ads ada/switch-c.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads
ada/bcheck.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/ali-util.ads \
- ada/alloc.ads ada/bcheck.ads ada/bcheck.adb ada/binderr.ads \
- ada/butil.ads ada/casing.ads ada/fname.ads ada/gnat.ads \
- ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \
- ada/rident.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/ali-util.adb ada/alloc.ads ada/bcheck.ads ada/bcheck.adb \
+ ada/binderr.ads ada/butil.ads ada/casing.ads ada/debug.ads \
+ ada/fname.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \
+ ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads ada/osint.ads \
+ ada/output.ads ada/rident.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/widechar.ads
ada/binde.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \
ada/binde.ads ada/binde.adb ada/binderr.ads ada/butil.ads \
ada/casing.ads ada/debug.ads ada/fname.ads ada/gnat.ads \
ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/namet.ads ada/opt.ads ada/output.ads \
- ada/rident.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
- ada/unchdeal.ads
+ ada/hostparm.ads ada/lib.ads ada/namet.ads ada/namet.adb ada/opt.ads \
+ ada/output.ads ada/rident.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/widechar.ads
ada/binderr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/binderr.ads \
- ada/binderr.adb ada/butil.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
- ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/binderr.adb ada/butil.ads ada/debug.ads ada/gnat.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/opt.ads ada/output.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/bindgen.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \
ada/binde.ads ada/bindgen.ads ada/bindgen.adb ada/butil.ads \
@@ -1326,60 +1353,79 @@ ada/bindgen.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \
ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
ada/osint.ads ada/osint-b.ads ada/output.ads ada/rident.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/targparm.ads ada/tree_io.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-strops.ads \
+ ada/s-sopco3.ads ada/s-sopco4.ads ada/s-sopco5.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads
ada/bindusg.o : ada/bindusg.ads ada/bindusg.adb ada/gnat.ads \
ada/g-os_lib.ads ada/g-string.ads ada/osint.ads ada/output.ads \
ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-ada/butil.o : ada/alloc.ads ada/butil.ads ada/butil.adb ada/hostparm.ads \
- ada/namet.ads ada/output.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/types.ads \
- ada/unchconv.ads ada/unchdeal.ads
+ada/butil.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/butil.ads \
+ ada/butil.adb ada/debug.ads ada/gnat.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/opt.ads ada/output.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-ada/casing.o : ada/alloc.ads ada/casing.ads ada/casing.adb ada/csets.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/opt.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
+ada/casing.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
+ ada/casing.adb ada/csets.ads ada/csets.adb ada/debug.ads ada/gnat.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/opt.ads ada/output.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/widechar.ads
ada/checks.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
- ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_ch2.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \
- ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb ada/fname.ads \
+ ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-load.ads \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/rtsfind.adb ada/sem.ads \
+ ada/sem_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads ada/validsw.ads
ada/comperr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/comperr.ads ada/comperr.adb ada/debug.ads \
- ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/fname.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/osint.ads ada/output.ads ada/sdefault.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/sprint.ads ada/system.ads \
- ada/s-exctab.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/table.ads ada/treepr.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/comperr.ads ada/comperr.adb \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads ada/output.ads \
+ ada/output.adb ada/sdefault.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/treepr.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/csets.o : ada/csets.ads ada/csets.adb ada/gnat.ads ada/g-string.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/system.ads \
@@ -1387,522 +1433,840 @@ ada/csets.o : ada/csets.ads ada/csets.adb ada/gnat.ads ada/g-string.ads \
ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/cstand.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/csets.ads ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/layout.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/rident.ads ada/sem_mech.ads \
- ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/tbuild.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \
+ ada/cstand.ads ada/cstand.adb ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \
+ ada/layout.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb ada/widechar.ads
+
+ada/debug.o : ada/debug.ads ada/debug.adb ada/system.ads
ada/debug_a.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/debug.ads ada/debug_a.ads ada/debug_a.adb \
- ada/einfo.ads ada/output.ads ada/sinfo.ads ada/sinput.ads \
- ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-imgenu.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \
+ ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/nlists.ads ada/nlists.adb ada/opt.ads \
+ ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads
-ada/debug.o : ada/debug.ads ada/debug.adb ada/system.ads
-
ada/einfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/einfo.ads ada/einfo.adb ada/namet.ads ada/nlists.ads ada/output.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/snames.adb \
+ ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/elists.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/elists.ads ada/elists.adb ada/gnat.ads ada/g-os_lib.ads \
ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \
- ada/output.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads
+
+ada/err_vars.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/err_vars.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/output.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-memory.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads
ada/errout.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/errout.adb \
- ada/erroutc.ads ada/fname.ads ada/gnat.ads ada/g-htable.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads \
- ada/scans.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
- ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/errout.adb ada/erroutc.ads ada/fname.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/scans.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/erroutc.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
ada/debug.ads ada/err_vars.ads ada/erroutc.ads ada/erroutc.adb \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \
- ada/rident.ads ada/sinput.ads ada/snames.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/targparm.ads ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/err_vars.o : ada/alloc.ads ada/err_vars.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/eval_fat.o : ada/alloc.ads ada/einfo.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/eval_fat.adb \
- ada/hostparm.ads ada/rident.ads ada/sem_util.ads ada/snames.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/targparm.ads \
- ada/ttypef.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/output.adb ada/rident.ads ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads
-ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch3.ads ada/exp_ch7.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads \
+ada/eval_fat.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/eval_fat.ads ada/eval_fat.adb ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/rident.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tree_io.ads ada/ttypef.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb
-ada/expander.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \
- ada/exp_attr.ads ada/exp_ch11.ads ada/exp_ch12.ads ada/exp_ch13.ads \
- ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch5.ads \
- ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch8.ads ada/exp_ch9.ads \
- ada/exp_prag.ads ada/expander.ads ada/expander.adb ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads \
- ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/exp_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
+ ada/exp_aggr.ads ada/exp_aggr.adb ada/exp_ch11.ads ada/exp_ch2.ads \
+ ada/exp_ch3.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
+ ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_attr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/einfo.ads ada/exp_attr.ads ada/exp_attr.adb \
- ada/exp_ch2.ads ada/exp_ch9.ads ada/exp_imgv.ads ada/exp_pakd.ads \
- ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_attr.ads ada/exp_attr.adb \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_ch9.ads \
+ ada/exp_imgv.ads ada/exp_pakd.ads ada/exp_strm.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/exp_ch11.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/atree.adb ada/casing.ads ada/casing.adb ada/checks.ads \
+ ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
ada/exp_ch11.adb ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch5.ads ada/sem_ch8.ads ada/sem_res.ads ada/sem_util.ads \
- ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
-ada/exp_ch12.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/exp_ch12.ads ada/exp_ch12.adb ada/exp_tss.ads ada/exp_util.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/rtsfind.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_ch5.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/types.adb \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/exp_ch13.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/elists.ads ada/exp_ch13.ads ada/exp_ch13.adb ada/exp_ch3.ads \
- ada/exp_ch6.ads ada/exp_imgv.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads \
- ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ada/exp_ch12.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/exp_ch12.ads ada/exp_ch12.adb \
+ ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads
-ada/exp_ch2.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch2.ads ada/exp_ch2.adb ada/exp_smem.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_vfpt.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/exp_ch13.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/exp_ch13.ads ada/exp_ch13.adb \
+ ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_imgv.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch7.ads \
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
+ ada/tree_io.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+
+ada/exp_ch2.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch2.ads \
+ ada/exp_ch2.adb ada/exp_ch7.ads ada/exp_smem.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/exp_vfpt.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
+ ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/validsw.ads
ada/exp_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch11.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch11.ads ada/exp_ch2.ads \
ada/exp_ch3.ads ada/exp_ch3.adb ada/exp_ch4.ads ada/exp_ch7.ads \
ada/exp_ch9.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_smem.ads \
- ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads
+ ada/exp_strm.ads ada/exp_tss.ads ada/exp_tss.adb ada/exp_util.ads \
+ ada/expander.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads \
+ ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads \
+ ada/sem_intr.ads ada/sem_mech.ads ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch4.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_ch3.ads \
- ada/exp_ch4.ads ada/exp_ch4.adb ada/exp_ch7.ads ada/exp_ch9.ads \
- ada/exp_disp.ads ada/exp_fixd.ads ada/exp_pakd.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/exp_vfpt.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rident.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch13.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo-cn.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch4.ads \
+ ada/exp_ch4.adb ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_disp.ads \
+ ada/exp_fixd.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/exp_util.adb ada/exp_vfpt.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
+ ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \
+ ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads
ada/exp_ch5.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/einfo.ads ada/exp_aggr.ads ada/exp_ch11.ads \
- ada/exp_ch5.ads ada/exp_ch5.adb ada/exp_ch7.ads ada/exp_dbug.ads \
- ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch13.ads \
- ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch5.ads ada/exp_ch5.adb \
+ ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
ada/exp_ch6.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads ada/exp_ch6.ads \
- ada/exp_ch6.adb ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_dbug.ads \
- ada/exp_disp.ads ada/exp_dist.ads ada/exp_intr.ads ada/exp_pakd.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch6.ads ada/sem_ch8.ads \
- ada/sem_disp.ads ada/sem_dist.ads ada/sem_res.ads ada/sem_util.ads \
- ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch3.ads \
+ ada/exp_ch6.ads ada/exp_ch6.adb ada/exp_ch7.ads ada/exp_ch9.ads \
+ ada/exp_dbug.ads ada/exp_disp.ads ada/exp_dist.ads ada/exp_intr.ads \
+ ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
+ ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \
+ ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch4.ads ada/sem_ch6.ads \
+ ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
-ada/exp_ch7.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
- ada/exp_ch7.ads ada/exp_ch7.adb ada/exp_ch9.ads ada/exp_dbug.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_ch3.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ada/exp_ch7.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_ch7.adb \
+ ada/exp_ch9.ads ada/exp_dbug.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/exp_util.adb ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/sem.ads \
+ ada/sem_ch3.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_eval.ads \
ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
-ada/exp_ch8.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/exp_ch8.ads \
+ada/exp_ch8.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_ch8.ads \
ada/exp_ch8.adb ada/exp_dbug.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/freeze.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/exp_util.adb ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/itypes.ads ada/lib.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
ada/exp_ch9.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch11.ads ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch9.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
+ ada/exp_ch3.ads ada/exp_ch6.ads ada/exp_ch7.ads ada/exp_ch9.ads \
ada/exp_ch9.adb ada/exp_dbug.ads ada/exp_smem.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/freeze.ads ada/gnat.ads ada/g-htable.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/fname.ads ada/fname-uf.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/restrict.adb ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
ada/sem_ch11.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_elab.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
-
-ada/exp_code.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_code.ads \
- ada/exp_code.adb ada/fname.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \
- ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
-ada/exp_dbug.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/einfo.ads ada/exp_dbug.ads ada/exp_dbug.adb \
- ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+
+ada/exp_code.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_code.ads \
+ ada/exp_code.adb ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_cat.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/widechar.ads
-ada/exp_disp.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ada/exp_dbug.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/exp_dbug.ads ada/exp_dbug.adb ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/widechar.ads
+
+ada/exp_disp.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
ada/exp_ch7.ads ada/exp_disp.ads ada/exp_disp.adb ada/exp_tss.ads \
- ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \
- ada/sem_disp.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/exp_tss.adb ada/exp_util.ads ada/exp_util.adb ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
+ ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
-ada/exp_dist.o : ada/ada.ads ada/a-uncdea.ads ada/alloc.ads ada/atree.ads \
- ada/einfo.ads ada/elists.ads ada/exp_dist.ads ada/exp_dist.adb \
- ada/exp_strm.ads ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads \
- ada/g-htable.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads ada/sem_ch8.ads \
- ada/sem_dist.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
+ada/exp_dist.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
+ ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/exp_dist.ads ada/exp_dist.adb ada/exp_strm.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads \
+ ada/sem_ch8.ads ada/sem_dist.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads
-ada/exp_fixd.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/exp_fixd.ads ada/exp_fixd.adb ada/exp_tss.ads ada/exp_util.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/exp_fixd.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/eval_fat.ads ada/exp_fixd.ads ada/exp_fixd.adb \
+ ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tree_io.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb
-ada/exp_imgv.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \
- ada/einfo.ads ada/exp_imgv.ads ada/exp_imgv.adb ada/exp_tss.ads \
- ada/exp_util.ads ada/get_targ.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem_res.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ada/exp_imgv.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/exp_imgv.ads ada/exp_imgv.adb \
+ ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem_res.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads
-ada/exp_intr.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \
+ada/exp_intr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch4.ads \
+ ada/exp_ch7.ads ada/exp_code.ads ada/exp_fixd.ads ada/exp_intr.ads \
+ ada/exp_intr.adb ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
+ ada/fname.ads ada/fname-uf.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
+ ada/widechar.ads
+
+ada/exp_pakd.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
- ada/exp_ch4.ads ada/exp_ch7.ads ada/exp_code.ads ada/exp_fixd.ads \
- ada/exp_intr.ads ada/exp_intr.adb ada/exp_tss.ads ada/exp_util.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/itypes.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
+ ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_dbug.ads ada/exp_pakd.ads \
+ ada/exp_pakd.adb ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/itypes.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
-ada/exp_pakd.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/exp_dbug.ads ada/exp_pakd.ads ada/exp_pakd.adb ada/exp_tss.ads \
- ada/exp_util.ads ada/get_targ.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/tbuild.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/sem_res.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
-ada/exp_prag.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
- ada/exp_prag.ads ada/exp_prag.adb ada/exp_tss.ads ada/exp_util.ads \
- ada/expander.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
+ada/exp_prag.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/casing.adb ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads ada/exp_prag.ads \
+ ada/exp_prag.adb ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/snames.adb ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/exp_smem.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/exp_smem.ads ada/exp_smem.adb ada/exp_tss.ads ada/exp_util.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ada/exp_smem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/exp_smem.ads ada/exp_smem.adb ada/exp_tss.ads \
+ ada/exp_util.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/sem.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/exp_strm.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/exp_strm.ads ada/exp_strm.adb ada/exp_tss.ads ada/get_targ.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/rtsfind.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/table.ads ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/exp_strm.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/exp_strm.ads ada/exp_strm.adb ada/exp_tss.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads
-ada/exp_tss.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/elists.ads \
- ada/exp_tss.ads ada/exp_tss.adb ada/exp_util.ads ada/lib.ads \
- ada/namet.ads ada/rtsfind.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/exp_tss.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/exp_tss.ads ada/exp_tss.adb \
+ ada/exp_util.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \
+ ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/exp_util.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/exp_util.adb ada/get_targ.ads ada/gnat.ads ada/g-string.ads \
+ada/exp_util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads \
+ ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
+ ada/fname.ads ada/fname-uf.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/itypes.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/targparm.ads ada/tbuild.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
- ada/validsw.ads
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/restrict.adb ada/rident.ads \
+ ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch8.ads \
+ ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads \
+ ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb ada/validsw.ads
-ada/exp_vfpt.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/exp_vfpt.ads ada/exp_vfpt.adb ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/rtsfind.ads ada/sem_res.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/tbuild.ads ada/ttypef.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/exp_vfpt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/exp_vfpt.ads ada/exp_vfpt.adb ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \
+ ada/sem_res.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypef.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb
+
+ada/expander.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \
+ ada/debug_a.adb ada/einfo.ads ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_aggr.ads ada/exp_attr.ads \
+ ada/exp_ch11.ads ada/exp_ch12.ads ada/exp_ch13.ads ada/exp_ch2.ads \
+ ada/exp_ch3.ads ada/exp_ch4.ads ada/exp_ch5.ads ada/exp_ch6.ads \
+ ada/exp_ch7.ads ada/exp_ch8.ads ada/exp_ch9.ads ada/exp_prag.ads \
+ ada/expander.ads ada/expander.adb ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/rtsfind.ads ada/sem.ads ada/sem_ch8.ads ada/sem_util.ads \
+ ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads
ada/fmap.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \
ada/debug.ads ada/fmap.ads ada/fmap.adb ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
- ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/fname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
- ada/fname.ads ada/fname.adb ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
- ada/opt.ads ada/output.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/fname-uf.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
ada/alloc.ads ada/casing.ads ada/debug.ads ada/fmap.ads ada/fname.ads \
ada/fname-uf.ads ada/fname-uf.adb ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/krunch.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
+ ada/s-memory.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/widechar.ads
+
+ada/fname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/fname.ads ada/fname.adb ada/gnat.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/opt.ads ada/output.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/freeze.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
- ada/exp_ch7.ads ada/exp_pakd.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/freeze.ads ada/freeze.adb ada/get_targ.ads ada/gnat.ads \
- ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/layout.ads ada/lib.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch6.ads ada/sem_ch7.ads \
- ada/sem_ch8.ads ada/sem_eval.ads ada/sem_mech.ads ada/sem_prag.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \
- ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_pakd.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/expander.ads ada/fname.ads ada/freeze.ads \
+ ada/freeze.adb ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/itypes.ads ada/layout.ads ada/lib.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch4.ads \
+ ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
+ ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads ada/sem_intr.ads \
+ ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/frontend.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \
- ada/cstand.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ada/frontend.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads \
+ ada/cstand.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
ada/exp_dbug.ads ada/fmap.ads ada/fname.ads ada/fname-uf.ads \
- ada/frontend.ads ada/frontend.adb ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
- ada/lib.ads ada/lib-load.ads ada/live.ads ada/namet.ads ada/nlists.ads \
- ada/opt.ads ada/osint.ads ada/output.ads ada/par.ads ada/prepcomp.ads \
- ada/rtsfind.ads ada/scn.ads ada/scng.ads ada/sem.ads ada/sem_ch8.ads \
- ada/sem_elab.ads ada/sem_prag.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinput.ads ada/sinput-l.ads ada/snames.ads ada/sprint.ads \
- ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-
-ada/get_targ.o : ada/get_targ.ads ada/get_targ.adb ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \
- ada/unchconv.ads ada/unchdeal.ads
+ ada/frontend.ads ada/frontend.adb ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \
+ ada/live.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/osint.ads ada/output.ads ada/par.ads \
+ ada/prepcomp.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_ch8.ads ada/sem_elab.ads ada/sem_prag.ads ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/sinput-l.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-crc32.adb ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/g-hesora.o : ada/gnat.ads ada/g-hesora.ads ada/g-hesora.adb \
ada/system.ads
@@ -1910,56 +2274,67 @@ ada/g-hesora.o : ada/gnat.ads ada/g-hesora.ads ada/g-hesora.adb \
ada/g-htable.o : ada/gnat.ads ada/g-htable.ads ada/g-htable.adb \
ada/system.ads ada/s-htable.ads
-ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/back_end.ads ada/casing.ads ada/comperr.ads ada/csets.ads \
- ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/fmap.ads ada/fname.ads \
- ada/fname-uf.ads ada/frontend.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnat1drv.ads ada/gnat1drv.adb \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/lib-writ.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/opt.ads ada/osint.ads ada/output.ads ada/prepcomp.ads \
- ada/repinfo.ads ada/restrict.ads ada/rident.ads ada/sem.ads \
- ada/sem_ch12.ads ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads \
- ada/sem_type.ads ada/sinfo.ads ada/sinput.ads ada/sinput-l.ads \
- ada/snames.ads ada/sprint.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-soflin.ads \
+ada/g-os_lib.o : ada/ada.ads ada/a-except.ads ada/gnat.ads \
+ ada/g-os_lib.ads ada/g-os_lib.adb ada/g-string.ads ada/system.ads \
+ ada/s-casuti.ads ada/s-crtl.ads ada/s-exctab.ads ada/s-exctab.adb \
+ ada/s-htable.ads ada/s-parame.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/targparm.ads ada/tree_gen.ads ada/treepr.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/usage.ads
+ ada/s-traent.ads ada/unchconv.ads ada/unchdeal.ads
+
+ada/g-speche.o : ada/gnat.ads ada/g-speche.ads ada/g-speche.adb \
+ ada/system.ads
+
+ada/g-string.o : ada/gnat.ads ada/g-string.ads ada/g-string.adb \
+ ada/system.ads ada/unchdeal.ads
+
+ada/get_targ.o : ada/get_targ.ads ada/get_targ.adb ada/system.ads \
+ ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads
ada/gnat.o : ada/gnat.ads ada/system.ads
+ada/gnat1drv.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/back_end.ads ada/casing.ads ada/comperr.ads \
+ ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fmap.ads \
+ ada/fname.ads ada/fname-uf.ads ada/frontend.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnat1drv.ads ada/gnat1drv.adb ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/lib-writ.ads ada/lib-xref.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/osint.ads \
+ ada/output.ads ada/prepcomp.ads ada/repinfo.ads ada/restrict.ads \
+ ada/rident.ads ada/sem.ads ada/sem_ch12.ads ada/sem_ch13.ads \
+ ada/sem_ch8.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_type.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/sinput-l.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tree_gen.ads ada/tree_io.ads ada/treepr.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/usage.ads
+
ada/gnatbind.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/ali-util.ads \
ada/alloc.ads ada/bcheck.ads ada/binde.ads ada/binderr.ads \
ada/bindgen.ads ada/bindusg.ads ada/butil.ads ada/casing.ads \
- ada/csets.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \
+ ada/csets.ads ada/debug.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatbind.ads ada/gnatbind.adb \
ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
ada/osint.ads ada/osint-b.ads ada/output.ads ada/rident.ads \
- ada/switch.ads ada/switch-b.ads ada/system.ads ada/s-assert.ads \
- ada/s-casuti.ads ada/s-exctab.ads ada/s-htable.ads ada/s-rident.ads \
+ ada/switch.ads ada/switch-b.ads ada/system.ads ada/s-casuti.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-memory.ads ada/s-rident.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads \
ada/s-sopco4.ads ada/s-sopco5.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/gnatvsn.o : ada/gnatvsn.ads ada/system.ads
-
-ada/g-os_lib.o : ada/ada.ads ada/a-except.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-os_lib.adb ada/g-string.ads ada/system.ads \
- ada/s-casuti.ads ada/s-exctab.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/g-speche.o : ada/gnat.ads ada/g-speche.ads ada/g-speche.adb \
- ada/system.ads
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads
-ada/g-string.o : ada/gnat.ads ada/g-string.ads ada/g-string.adb \
- ada/system.ads ada/unchdeal.ads
+ada/gnatvsn.o : ada/gnatvsn.ads ada/gnatvsn.adb ada/system.ads \
+ ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads
ada/hlo.o : ada/hlo.ads ada/hlo.adb ada/output.ads ada/system.ads \
ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \
@@ -1967,167 +2342,258 @@ ada/hlo.o : ada/hlo.ads ada/hlo.adb ada/output.ads ada/system.ads \
ada/hostparm.o : ada/hostparm.ads ada/system.ads
-ada/impunit.o : ada/alloc.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/impunit.ads ada/impunit.adb \
- ada/lib.ads ada/namet.ads ada/opt.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ada/impunit.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/impunit.ads ada/impunit.adb ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/widechar.ads
ada/inline.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch11.ads \
- ada/exp_ch7.ads ada/exp_tss.ads ada/fname.ads ada/fname-uf.ads \
- ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/inline.ads ada/inline.adb ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads \
- ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch8.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch11.ads ada/exp_ch7.ads ada/exp_tss.ads \
+ ada/exp_tss.adb ada/exp_util.ads ada/fname.ads ada/fname-uf.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/inline.adb ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/rtsfind.ads ada/sem_ch10.ads \
+ ada/sem_ch12.ads ada/sem_ch8.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/interfac.o : ada/interfac.ads ada/system.ads
-ada/itypes.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/gnat.ads \
+ada/itypes.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads \
- ada/itypes.adb ada/namet.ads ada/opt.ads ada/sem.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/itypes.adb ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads \
+ ada/output.ads ada/sem.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads
ada/krunch.o : ada/hostparm.ads ada/krunch.ads ada/krunch.adb \
ada/system.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads
ada/layout.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch3.ads ada/exp_tss.ads ada/exp_util.ads ada/get_targ.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_ch3.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \
ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/layout.ads ada/layout.adb \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/repinfo.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch13.ads ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-
-ada/lib.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/debug.ads ada/einfo.ads ada/fname.ads ada/gnat.ads \
- ada/g-hesora.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
- ada/lib-sort.adb ada/namet.ads ada/opt.ads ada/output.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
- ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/layout.ads \
+ ada/layout.adb ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/repinfo.ads ada/repinfo.adb ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_ch13.ads ada/sem_ch8.ads \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/lib-load.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \
- ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/fname.ads ada/fname-uf.ads ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-load.ads ada/lib-load.adb ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \
- ada/par.ads ada/rident.ads ada/scn.ads ada/scng.ads ada/sinfo.ads \
- ada/sinput.ads ada/sinput-l.ads ada/snames.ads ada/stand.ads \
- ada/style.ads ada/styleg.ads ada/styleg-c.ads ada/system.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/lib-load.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/fname.ads ada/fname-uf.ads ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib-load.ads \
+ ada/lib-load.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \
+ ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/sinput-l.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/lib-util.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/hostparm.ads ada/lib.ads ada/lib-util.ads \
- ada/lib-util.adb ada/namet.ads ada/osint.ads ada/osint-c.ads \
- ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-unstyp.ads ada/table.ads ada/types.ads \
- ada/unchconv.ads ada/unchdeal.ads
+ada/lib-util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-util.adb \
+ ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/lib-writ.o : ada/ada.ads ada/a-except.ads ada/ali.ads ada/alloc.ads \
- ada/atree.ads ada/casing.ads ada/debug.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/fname-uf.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-util.ads ada/lib-writ.ads ada/lib-writ.adb ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads \
- ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads ada/scn.ads \
- ada/scng.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads \
+ ada/atree.ads ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/fname.ads ada/fname-uf.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \
+ ada/lib-util.ads ada/lib-util.adb ada/lib-writ.ads ada/lib-writ.adb \
+ ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/osint.ads ada/osint-c.ads \
+ ada/output.ads ada/par.ads ada/restrict.ads ada/rident.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/lib-xref.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
- ada/g-hesora.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-xref.ads \
- ada/lib-xref.adb ada/namet.ads ada/nlists.ads ada/opt.ads \
- ada/output.ads ada/sem_prag.ads ada/sinfo.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib-util.ads ada/lib-util.adb \
+ ada/lib-xref.ads ada/lib-xref.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/osint.ads ada/osint-c.ads ada/output.ads \
+ ada/sem_prag.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ada/lib.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/widechar.ads
+
ada/live.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/lib.ads ada/live.ads ada/live.adb ada/nlists.ads ada/output.ads \
- ada/sem_util.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads \
- ada/s-imgenu.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/table.ads ada/tree_io.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/live.ads ada/live.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/sem_util.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/memtrack.o : ada/ada.ads ada/a-except.ads ada/system.ads \
ada/s-memory.ads ada/memtrack.adb ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traceb.ads \
- ada/s-traent.ads ada/unchconv.ads
+ ada/s-traent.ads ada/s-traent.adb ada/unchconv.ads
ada/namet.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/namet.ads ada/namet.adb ada/opt.ads ada/output.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-memory.ads \
ada/s-secsta.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/widechar.ads
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/types.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
ada/nlists.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/einfo.ads ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \
- ada/nlists.adb ada/opt.ads ada/output.ads ada/sinfo.ads ada/snames.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
- ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
-ada/nmake.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/nmake.adb ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/nmake.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
-ada/opt.o : ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/opt.ads ada/opt.adb ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ada/opt.o : ada/ada.ads ada/a-except.ads ada/gnat.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \
+ ada/opt.adb ada/system.ads ada/s-exctab.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ada/osint-b.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads \
+ ada/osint-b.ads ada/osint-b.adb ada/output.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
+ ada/unchdeal.ads
+
+ada/osint-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads \
+ ada/osint-c.ads ada/osint-c.adb ada/output.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
+ ada/unchdeal.ads
+
ada/osint.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \
ada/debug.ads ada/fmap.ads ada/gnat.ads ada/g-htable.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/namet.ads ada/opt.ads ada/osint.ads ada/osint.adb ada/output.ads \
- ada/sdefault.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/sdefault.ads ada/system.ads ada/s-casuti.ads ada/s-exctab.ads \
ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
@@ -2135,49 +2601,40 @@ ada/osint.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \
ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
ada/unchconv.ads ada/unchdeal.ads
-ada/osint-b.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-b.ads ada/osint-b.adb \
- ada/system.ads ada/s-exctab.ads ada/s-secsta.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/osint-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/opt.ads ada/osint.ads ada/osint-c.ads ada/osint-c.adb \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tree_io.ads ada/types.ads ada/unchconv.ads \
- ada/unchdeal.ads
-
ada/output.o : ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
ada/output.ads ada/output.adb ada/system.ads ada/s-exctab.ads \
ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads ada/unchconv.ads \
ada/unchdeal.ads
ada/par.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/fname-uf.ads ada/gnat.ads ada/g-os_lib.ads ada/g-speche.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/fname.ads ada/fname-uf.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-load.ads ada/lib-sort.adb ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
ada/osint.ads ada/output.ads ada/par.ads ada/par.adb ada/par-ch10.adb \
ada/par-ch11.adb ada/par-ch12.adb ada/par-ch13.adb ada/par-ch2.adb \
ada/par-ch3.adb ada/par-ch4.adb ada/par-ch5.adb ada/par-ch6.adb \
ada/par-ch7.adb ada/par-ch8.adb ada/par-ch9.adb ada/par-endh.adb \
ada/par-labl.adb ada/par-load.adb ada/par-prag.adb ada/par-sync.adb \
- ada/par-tchk.adb ada/par-util.adb ada/scans.ads ada/scn.ads \
- ada/scng.ads ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads \
- ada/sinput-l.ads ada/snames.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-memory.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/par-tchk.adb ada/par-util.adb ada/restrict.ads ada/rident.ads \
+ ada/scans.ads ada/scans.adb ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
+ ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/snames.adb \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads \
+ ada/widechar.ads
ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \
@@ -2185,7 +2642,7 @@ ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads ada/prep.ads \
ada/prep.adb ada/scans.ads ada/sinput.ads ada/snames.ads \
- ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-carun8.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
@@ -2193,730 +2650,1126 @@ ada/prep.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/prepcomp.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
- ada/alloc.ads ada/casing.ads ada/debug.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-dyntab.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/alloc.ads ada/casing.ads ada/csets.ads ada/debug.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
+ ada/g-dyntab.ads ada/g-dyntab.adb ada/g-hesorg.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads \
ada/lib.ads ada/lib-writ.ads ada/namet.ads ada/opt.ads ada/osint.ads \
ada/output.ads ada/prep.ads ada/prepcomp.ads ada/prepcomp.adb \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/sinput.ads ada/sinput-l.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sinput.ads \
+ ada/sinput.adb ada/sinput-l.ads ada/snames.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-crc32.adb ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/repinfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/debug.ads ada/einfo.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/opt.ads ada/output.ads ada/repinfo.ads \
- ada/repinfo.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/output.adb ada/repinfo.ads \
+ ada/repinfo.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/restrict.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \
- ada/erroutc.ads ada/fname.ads ada/fname-uf.ads ada/hostparm.ads \
- ada/lib.ads ada/namet.ads ada/restrict.ads ada/restrict.adb \
- ada/rident.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/system.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-rident.ads \
- ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/fname.ads ada/fname-uf.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/restrict.adb \
+ ada/rident.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/rident.o : ada/rident.ads ada/system.ads ada/s-rident.ads
ada/rtsfind.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/fname-uf.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/lib-load.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads ada/rtsfind.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/fname.ads ada/fname-uf.ads \
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/rtsfind.ads \
ada/rtsfind.adb ada/sem.ads ada/sem_ch7.ads ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads ada/s-secsta.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-exctab.adb \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
ada/s-assert.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-assert.ads ada/s-assert.adb ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-traent.ads ada/unchconv.ads
-
-ada/scans.o : ada/alloc.ads ada/scans.ads ada/scans.adb ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/s-assert.ads ada/s-assert.adb ada/s-exctab.ads ada/s-exctab.adb \
+ ada/s-htable.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
ada/s-carun8.o : ada/system.ads ada/s-carun8.ads ada/s-carun8.adb \
ada/unchconv.ads
ada/s-casuti.o : ada/system.ads ada/s-casuti.ads ada/s-casuti.adb
+ada/s-crc32.o : ada/interfac.ads ada/system.ads ada/s-crc32.ads \
+ ada/s-crc32.adb
+
+ada/s-crtl.o : ada/system.ads ada/s-crtl.ads ada/s-parame.ads
+
+ada/s-except.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-except.ads ada/s-stalib.ads ada/s-traent.ads ada/unchconv.ads
+
+ada/s-exctab.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-htable.adb ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
+
+ada/s-htable.o : ada/ada.ads ada/a-uncdea.ads ada/system.ads \
+ ada/s-htable.ads ada/s-htable.adb
+
+ada/s-imgenu.o : ada/system.ads ada/s-imgenu.ads ada/s-imgenu.adb \
+ ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads
+
+ada/s-mastop.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-except.ads ada/s-mastop.ads ada/s-mastop.adb ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
+
+ada/s-memory.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-crtl.ads ada/s-memory.ads ada/s-memory.adb ada/s-parame.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
+
+ada/s-parame.o : ada/system.ads ada/s-parame.ads ada/s-parame.adb
+
+ada/s-purexc.o : ada/system.ads ada/s-purexc.ads
+
+ada/s-secsta.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-parame.ads ada/s-secsta.ads ada/s-secsta.adb ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/unchconv.ads ada/unchdeal.ads
+
+ada/s-soflin.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-except.ads ada/s-mastop.ads ada/s-parame.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-soflin.adb ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
+
+ada/s-sopco3.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco3.adb \
+ ada/s-sopco4.ads ada/s-sopco5.ads ada/unchconv.ads
+
+ada/s-sopco4.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
+ ada/s-sopco4.adb ada/s-sopco5.ads ada/unchconv.ads
+
+ada/s-sopco5.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
+ ada/s-sopco5.ads ada/s-sopco5.adb ada/unchconv.ads
+
+ada/s-stache.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-crtl.ads ada/s-parame.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stache.adb ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/unchconv.ads
+
+ada/s-stalib.o : ada/ada.ads ada/a-except.ads ada/system.ads \
+ ada/s-memory.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stalib.adb ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/unchconv.ads
+
+ada/s-stoele.o : ada/system.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/unchconv.ads
+
+ada/s-strcom.o : ada/system.ads ada/s-strcom.ads ada/s-strcom.adb \
+ ada/unchconv.ads
+
+ada/s-strops.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-strops.ads ada/s-strops.adb ada/unchconv.ads
+
+ada/s-traceb.o : ada/system.ads ada/s-traceb.ads ada/s-traceb.adb
+
+ada/s-traent.o : ada/system.ads ada/s-traent.ads ada/s-traent.adb
+
+ada/s-unstyp.o : ada/system.ads ada/s-unstyp.ads
+
+ada/s-wchcnv.o : ada/interfac.ads ada/system.ads ada/s-wchcnv.ads \
+ ada/s-wchcnv.adb ada/s-wchcon.ads ada/s-wchjis.ads
+
+ada/s-wchcon.o : ada/system.ads ada/s-wchcon.ads
+
+ada/s-wchjis.o : ada/system.ads ada/s-wchjis.ads ada/s-wchjis.adb
+
+ada/scans.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/opt.ads ada/output.ads ada/scans.ads ada/scans.adb \
+ ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+
ada/scn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/einfo.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-string.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/namet.ads \
- ada/opt.ads ada/scans.ads ada/scn.ads ada/scn.adb ada/scng.ads \
- ada/scng.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stringt.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \
- ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
- ada/s-imgenu.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/scans.ads ada/scn.ads ada/scn.adb ada/scng.ads ada/scng.adb \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
ada/widechar.ads
-ada/scng.o : ada/alloc.ads ada/casing.ads ada/csets.ads ada/err_vars.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/interfac.ads ada/namet.ads ada/opt.ads ada/scans.ads ada/scng.ads \
- ada/scng.adb ada/sinput.ads ada/snames.ads ada/stringt.ads \
+ada/scng.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
+ ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/namet.ads ada/opt.ads ada/output.ads ada/scans.ads \
+ ada/scng.ads ada/scng.adb ada/sinput.ads ada/snames.ads ada/stringt.ads \
ada/styleg.ads ada/stylesw.ads ada/system.ads ada/s-crc32.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/s-crc32.o : ada/interfac.ads ada/system.ads ada/s-crc32.ads \
- ada/s-crc32.adb
-
-ada/sem_aggr.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/freeze.ads ada/gnat.ads \
- ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/opt.ads ada/rident.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_aggr.ads ada/sem_aggr.adb ada/sem_cat.ads \
- ada/sem_ch13.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
ada/sem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/expander.ads ada/fname.ads \
- ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hlo.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/lib-load.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
- ada/output.ads ada/sem.ads ada/sem.adb ada/sem_attr.ads \
- ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads ada/sem_ch13.ads \
- ada/sem_ch2.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_ch9.ads \
- ada/sem_prag.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/debug_a.ads \
+ ada/debug_a.adb ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/expander.ads \
+ ada/fname.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hlo.ads \
+ ada/hostparm.ads ada/inline.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/sem.ads ada/sem.adb \
+ ada/sem_attr.ads ada/sem_ch10.ads ada/sem_ch11.ads ada/sem_ch12.ads \
+ ada/sem_ch13.ads ada/sem_ch2.ads ada/sem_ch2.adb ada/sem_ch3.ads \
+ ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch7.ads \
+ ada/sem_ch8.ads ada/sem_ch9.ads ada/sem_prag.ads ada/sem_util.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-carun8.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
- ada/a-except.ads ada/alloc.ads ada/atree.ads ada/casing.ads \
- ada/checks.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \
- ada/erroutc.ads ada/eval_fat.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/expander.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sdefault.ads \
- ada/sem.ads ada/sem_attr.ads ada/sem_attr.adb ada/sem_cat.ads \
- ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/tbuild.ads ada/ttypef.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
+ada/sem_aggr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads \
+ ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/exp_util.adb \
+ ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_aggr.ads ada/sem_aggr.adb \
+ ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch4.ads \
+ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
+ ada/sem_elab.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \
+ ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/validsw.ads ada/widechar.ads
-ada/sem_case.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
- ada/g-hesora.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/sem.ads \
- ada/sem_case.ads ada/sem_case.adb ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/sem_attr.o : ada/ada.ads ada/a-charac.ads ada/a-chlat1.ads \
+ ada/a-except.ads ada/alloc.ads ada/atree.ads ada/atree.adb \
+ ada/casing.ads ada/checks.ads ada/checks.adb ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
+ ada/exp_ch11.ads ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/itypes.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/sdefault.ads ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_attr.adb ada/sem_cat.ads ada/sem_ch4.ads ada/sem_ch6.ads \
+ ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads \
+ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/snames.adb ada/sprint.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypef.ads ada/ttypes.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
+ ada/widechar.ads
-ada/sem_cat.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \
+ada/sem_case.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_tss.ads ada/fname.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/opt.ads ada/sem.ads ada/sem_cat.ads ada/sem_cat.adb \
- ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/sem.ads ada/sem_case.ads ada/sem_case.adb \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+
+ada/sem_cat.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_tss.ads ada/fname.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/sem.ads ada/sem_cat.ads \
+ ada/sem_cat.adb ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sem_ch10.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \
ada/exp_util.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/impunit.ads ada/inline.ads ada/lib.ads \
- ada/lib-load.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/output.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch10.ads \
- ada/sem_ch10.adb ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
- ada/sem_dist.ads ada/sem_prag.ads ada/sem_util.ads ada/sem_warn.ads \
- ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/uname.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/impunit.ads ada/inline.ads ada/interfac.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_ch10.ads ada/sem_ch10.adb \
+ ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_dist.ads \
+ ada/sem_eval.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads \
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
-ada/sem_ch11.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
+ada/sem_ch11.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch11.ads ada/sem_ch11.adb ada/sem_ch5.ads ada/sem_ch8.ads \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch11.ads \
+ ada/sem_ch11.adb ada/sem_ch5.ads ada/sem_ch8.ads ada/sem_res.ads \
+ ada/sem_util.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
ada/sem_ch12.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
- ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/checks.ads \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \
ada/expander.ads ada/fname.ads ada/fname-uf.ads ada/freeze.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/lib-load.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/output.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \
- ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch12.adb ada/sem_ch13.ads \
- ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads \
- ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_cat.ads ada/sem_ch10.ads ada/sem_ch12.ads ada/sem_ch12.adb \
+ ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads \
+ ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
+ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads \
+ ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
ada/sinfo-cn.ads ada/sinput.ads ada/sinput-l.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads \
- ada/s-rident.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-htable.adb ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tbuild.ads \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uname.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/widechar.ads
ada/sem_ch13.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/debug.ads ada/einfo.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_ch13.ads ada/sem_ch13.adb \
- ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads \
- ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/table.adb ada/tbuild.ads ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
-ada/sem_ch2.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
- ada/restrict.ads ada/rident.ads ada/sem_ch2.ads ada/sem_ch2.adb \
- ada/sem_ch8.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-
-ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/eval_fat.ads ada/exp_ch3.ads ada/exp_dist.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/layout.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \
- ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_case.ads ada/sem_case.adb \
- ada/sem_cat.ads ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch3.adb \
- ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_mech.ads \
- ada/sem_res.ads ada/sem_smem.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_warn.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/einfo.adb ada/elists.ads ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/sem.ads ada/sem_ch13.ads ada/sem_ch13.adb ada/sem_ch8.ads \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/table.ads ada/table.adb ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/urealp.adb
-ada/sem_ch4.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/gnat.ads ada/g-speche.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/itypes.ads ada/lib.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/sem.ads ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch4.ads \
- ada/sem_ch4.adb ada/sem_ch8.ads ada/sem_dist.ads ada/sem_eval.ads \
- ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/tbuild.ads ada/types.ads \
+ada/sem_ch2.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/sem_ch2.ads ada/sem_ch2.adb ada/sem_ch8.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/types.adb \
ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/sem_ch5.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/expander.ads ada/freeze.ads ada/gnat.ads \
- ada/g-hesora.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \
- ada/opt.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_case.ads \
- ada/sem_case.adb ada/sem_ch3.ads ada/sem_ch5.ads ada/sem_ch5.adb \
- ada/sem_ch8.ads ada/sem_disp.ads ada/sem_eval.ads ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/targparm.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ada/sem_ch3.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads ada/exp_ch2.ads \
+ ada/exp_ch3.ads ada/exp_ch7.ads ada/exp_dist.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/exp_util.adb ada/expander.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/itypes.ads \
+ ada/layout.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_aggr.ads ada/sem_attr.ads ada/sem_case.ads ada/sem_case.adb \
+ ada/sem_cat.ads ada/sem_cat.adb ada/sem_ch13.ads ada/sem_ch3.ads \
+ ada/sem_ch3.adb ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch7.ads \
+ ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_elim.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads \
+ ada/sem_mech.ads ada/sem_res.ads ada/sem_res.adb ada/sem_smem.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads \
+ ada/sprint.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/validsw.ads \
+ ada/widechar.ads
-ada/sem_ch6.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/checks.ads \
- ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads ada/expander.ads \
- ada/fname.ads ada/freeze.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/lib.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \
- ada/sem_ch12.ads ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads \
- ada/sem_ch6.ads ada/sem_ch6.adb ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_dist.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_mech.ads \
- ada/sem_prag.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_warn.ads ada/sinfo.ads ada/sinfo-cn.ads ada/sinput.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
- ada/styleg.ads ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
- ada/s-assert.ads ada/s-carun8.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads ada/validsw.ads
+ada/sem_ch4.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/interfac.ads ada/itypes.ads ada/lib.ads \
+ ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch4.ads \
+ ada/sem_ch4.adb ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \
+ ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads ada/sem_intr.ads \
+ ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
-ada/sem_ch7.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \
- ada/einfo.ads ada/elists.ads ada/err_vars.ads ada/errout.ads \
- ada/erroutc.ads ada/exp_dbug.ads ada/exp_disp.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
- ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads \
- ada/opt.ads ada/output.ads ada/sem.ads ada/sem_cat.ads ada/sem_ch12.ads \
+ada/sem_ch5.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/eval_fat.ads ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/expander.ads ada/fname.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
+ ada/sem_case.ads ada/sem_case.adb ada/sem_cat.ads ada/sem_ch3.ads \
+ ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch5.adb ada/sem_ch6.ads \
+ ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads \
+ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/widechar.ads
+
+ada/sem_ch6.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads ada/interfac.ads \
+ ada/itypes.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch12.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch5.ads ada/sem_ch6.ads \
+ ada/sem_ch6.adb ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
+ ada/sem_elab.ads ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads \
+ ada/sem_mech.ads ada/sem_prag.ads ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/stringt.adb ada/style.ads ada/styleg.ads ada/styleg.adb \
+ ada/styleg-c.ads ada/stylesw.ads ada/system.ads ada/s-carun8.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/validsw.ads ada/widechar.ads
+
+ada/sem_ch7.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dbug.ads \
+ ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/inline.ads ada/interfac.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_cat.ads ada/sem_ch12.ads \
ada/sem_ch3.ads ada/sem_ch6.ads ada/sem_ch7.ads ada/sem_ch7.adb \
- ada/sem_ch8.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/style.ads \
- ada/styleg.ads ada/styleg-c.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/snames.adb ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
ada/sem_ch8.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \
- ada/fname.ads ada/freeze.ads ada/gnat.ads ada/g-os_lib.ads \
- ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/inline.ads ada/lib.ads ada/lib-load.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads ada/expander.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/inline.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads \
+ ada/scng.adb ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads \
ada/sem_cat.ads ada/sem_ch12.ads ada/sem_ch3.ads ada/sem_ch4.ads \
- ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch8.adb ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sinfo.ads ada/sinfo-cn.ads \
- ada/snames.ads ada/stand.ads ada/style.ads ada/styleg.ads \
- ada/styleg-c.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-memory.ads ada/s-rident.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tbuild.ads ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch8.adb ada/sem_disp.ads \
+ ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads ada/sem_intr.ads \
+ ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinfo-cn.ads ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
+ ada/ttypes.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/sem_ch9.o : ada/alloc.ads ada/atree.ads ada/checks.ads ada/einfo.ads \
+ada/sem_ch9.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch9.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/restrict.ads \
- ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_ch3.ads \
+ ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_ch9.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/expander.ads ada/fname.ads ada/fname-uf.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/restrict.adb ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch3.ads ada/sem_ch4.ads \
ada/sem_ch5.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_ch9.ads \
- ada/sem_ch9.adb ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/style.ads ada/styleg.ads ada/styleg-c.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tbuild.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/sem_ch9.adb ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
+ ada/snames.ads ada/sprint.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/validsw.ads ada/widechar.ads
+
+ada/sem_disp.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads \
+ ada/exp_disp.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/lib.ads ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_disp.adb \
+ ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/widechar.ads
-ada/sem_disp.o : ada/alloc.ads ada/atree.ads ada/debug.ads ada/einfo.ads \
+ada/sem_dist.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_ch7.ads ada/exp_disp.ads ada/exp_tss.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads \
- ada/opt.ads ada/output.ads ada/sem.ads ada/sem_ch6.ads ada/sem_disp.ads \
- ada/sem_disp.adb ada/sem_eval.ads ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
-
-ada/sem_dist.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dist.ads \
- ada/exp_tss.ads ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/rtsfind.ads ada/sem.ads ada/sem_dist.ads ada/sem_dist.adb \
- ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/tbuild.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/exp_dist.ads ada/exp_tss.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/lib.ads ada/namet.ads ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/nmake.adb ada/opt.ads ada/output.ads ada/restrict.ads \
+ ada/rident.ads ada/rtsfind.ads ada/sem.ads ada/sem_dist.ads \
+ ada/sem_dist.adb ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/types.ads \
+ ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sem_elab.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib-load.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads ada/sem_elab.ads \
- ada/sem_elab.adb ada/sem_res.ads ada/sem_util.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/elists.adb \
+ ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_tss.ads \
+ ada/exp_util.ads ada/expander.ads ada/fname.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/interfac.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-load.ads ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_cat.ads ada/sem_ch7.ads ada/sem_ch8.ads \
+ ada/sem_elab.ads ada/sem_elab.adb ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/sinput.adb ada/snames.ads \
+ ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tbuild.ads ada/tree_io.ads ada/types.ads \
- ada/uintp.ads ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/table.adb ada/targparm.ads ada/tbuild.ads ada/tbuild.adb \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
-ada/sem_elim.o : ada/ada.ads ada/a-uncdea.ads ada/alloc.ads ada/atree.ads \
- ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/gnat.ads ada/g-htable.ads ada/hostparm.ads ada/namet.ads \
- ada/nlists.ads ada/sem_elim.ads ada/sem_elim.adb ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb ada/s-stalib.ads \
- ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \
+ada/sem_elim.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
+ ada/alloc.ads ada/atree.ads ada/atree.adb ada/casing.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/sem_elim.ads ada/sem_elim.adb ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-htable.adb \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sem_eval.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/checks.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/eval_fat.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/gnat.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
- ada/nmake.ads ada/opt.ads ada/rtsfind.ads ada/sem.ads ada/sem_cat.ads \
- ada/sem_ch8.ads ada/sem_eval.ads ada/sem_eval.adb ada/sem_res.ads \
- ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/stringt.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/tbuild.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/debug_a.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/eval_fat.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/expander.ads ada/fname.ads ada/freeze.ads ada/get_targ.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
+ ada/lib.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/scans.ads \
+ ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads ada/sem_aggr.ads \
+ ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch4.ads ada/sem_ch6.ads \
+ ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads \
+ ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_res.ads \
+ ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/stringt.adb \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/urealp.adb ada/widechar.ads
-ada/sem_intr.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/hostparm.ads ada/lib.ads ada/namet.ads ada/rident.ads \
+ada/sem_intr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/fname.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/namet.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/rident.ads \
ada/sem_eval.ads ada/sem_intr.ads ada/sem_intr.adb ada/sem_util.ads \
- ada/sinfo.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-exctab.ads ada/s-rident.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/table.ads ada/targparm.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sem_maps.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/einfo.ads ada/gnat.ads ada/g-os_lib.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
- ada/opt.ads ada/output.ads ada/sem_maps.ads ada/sem_maps.adb \
- ada/sinfo.ads ada/snames.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/sem_maps.ads ada/sem_maps.adb ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads
-ada/sem_mech.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
- ada/nlists.ads ada/opt.ads ada/rident.ads ada/sem.ads ada/sem_mech.ads \
- ada/sem_mech.adb ada/sem_util.ads ada/sinfo.ads ada/snames.ads \
- ada/stand.ads ada/system.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/targparm.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/sem_mech.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/rident.ads ada/sem.ads \
+ ada/sem_mech.ads ada/sem_mech.adb ada/sem_util.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tree_io.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads
ada/sem_prag.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/exp_dist.ads \
- ada/expander.ads ada/fname.ads ada/get_targ.ads ada/gnat.ads \
- ada/g-speche.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/lib.ads ada/lib-writ.ads ada/lib-xref.ads ada/namet.ads \
- ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_ch13.ads ada/sem_ch3.ads ada/sem_ch8.ads ada/sem_disp.ads \
- ada/sem_elim.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_mech.ads \
- ada/sem_prag.ads ada/sem_prag.adb ada/sem_res.ads ada/sem_type.ads \
- ada/sem_util.ads ada/sem_vfpt.ads ada/sinfo.ads ada/sinfo-cn.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
- ada/stylesw.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
+ ada/atree.adb ada/casing.ads ada/casing.adb ada/checks.ads \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/elists.adb ada/err_vars.ads ada/errout.ads \
+ ada/erroutc.ads ada/eval_fat.ads ada/exp_ch7.ads ada/exp_dist.ads \
+ ada/exp_tss.ads ada/exp_util.ads ada/expander.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-speche.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/itypes.ads \
+ ada/lib.ads ada/lib.adb ada/lib-list.adb ada/lib-sort.adb \
+ ada/lib-writ.ads ada/lib-xref.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads \
+ ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
+ ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb ada/sem.ads \
+ ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch13.ads \
+ ada/sem_ch3.ads ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads \
+ ada/sem_disp.ads ada/sem_dist.ads ada/sem_elab.ads ada/sem_elim.ads \
+ ada/sem_eval.ads ada/sem_eval.adb ada/sem_intr.ads ada/sem_mech.ads \
+ ada/sem_prag.ads ada/sem_prag.adb ada/sem_res.ads ada/sem_res.adb \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_vfpt.ads \
+ ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb ada/sinfo-cn.ads \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/snames.adb \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-exctab.adb ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/tbuild.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/validsw.ads
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/targparm.ads ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads ada/widechar.ads
ada/sem_res.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads \
- ada/debug_a.ads ada/einfo.ads ada/elists.ads ada/err_vars.ads \
- ada/errout.ads ada/erroutc.ads ada/exp_ch7.ads ada/exp_tss.ads \
- ada/exp_util.ads ada/expander.ads ada/freeze.ads ada/gnat.ads \
- ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/itypes.ads ada/lib.ads ada/lib-xref.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads ada/output.ads \
- ada/restrict.ads ada/rident.ads ada/rtsfind.ads ada/sem.ads \
- ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads ada/sem_ch4.ads \
- ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads ada/sem_dist.ads \
- ada/sem_elab.ads ada/sem_eval.ads ada/sem_intr.ads ada/sem_res.ads \
- ada/sem_res.adb ada/sem_type.ads ada/sem_util.ads ada/sem_warn.ads \
- ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
- ada/stringt.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/checks.adb \
+ ada/csets.ads ada/debug.ads ada/debug_a.ads ada/debug_a.adb \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/eval_fat.ads ada/exp_ch11.ads \
+ ada/exp_ch2.ads ada/exp_ch7.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/exp_util.adb ada/expander.ads ada/fname.ads ada/freeze.ads \
+ ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/inline.ads ada/interfac.ads ada/itypes.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_aggr.ads ada/sem_attr.ads ada/sem_cat.ads \
+ ada/sem_ch4.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_disp.ads \
+ ada/sem_dist.ads ada/sem_elab.ads ada/sem_eval.ads ada/sem_eval.adb \
+ ada/sem_intr.ads ada/sem_res.ads ada/sem_res.adb ada/sem_type.ads \
+ ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/sprint.ads \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-carun8.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/validsw.ads ada/widechar.ads
+
+ada/sem_smem.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/sem_smem.ads \
+ ada/sem_smem.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
-
-ada/sem_smem.o : ada/alloc.ads ada/atree.ads ada/einfo.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/hostparm.ads \
- ada/namet.ads ada/sem_smem.ads ada/sem_smem.adb ada/sinfo.ads \
- ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/sem_type.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/debug.ads ada/einfo.ads ada/err_vars.ads ada/errout.ads \
- ada/erroutc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads ada/opt.ads \
- ada/output.ads ada/sem.ads ada/sem_ch6.ads ada/sem_ch8.ads \
- ada/sem_type.ads ada/sem_type.adb ada/sem_util.ads ada/sinfo.ads \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
-
-ada/sem_util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/checks.ads ada/debug.ads ada/einfo.ads \
- ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/exp_tss.ads ada/exp_util.ads ada/fname.ads ada/freeze.ads \
- ada/get_targ.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/lib-xref.ads ada/namet.ads ada/nlists.ads ada/nmake.ads ada/opt.ads \
- ada/output.ads ada/restrict.ads ada/rident.ads ada/rtsfind.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/sem.ads ada/sem_ch8.ads \
- ada/sem_eval.ads ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
- ada/sem_util.adb ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/style.ads ada/styleg.ads \
- ada/styleg-c.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-imgenu.ads ada/s-rident.ads ada/s-secsta.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_ch6.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_res.ads ada/sem_type.ads ada/sem_type.adb ada/sem_util.ads \
+ ada/sem_util.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/stand.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads \
ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/tbuild.ads ada/tree_io.ads \
- ada/ttypes.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ ada/table.ads ada/table.adb ada/targparm.ads ada/tbuild.ads \
+ ada/tree_io.ads ada/ttypes.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/uname.ads ada/unchconv.ads ada/unchdeal.ads \
+ ada/urealp.ads ada/widechar.ads
-ada/sem_vfpt.o : ada/alloc.ads ada/cstand.ads ada/einfo.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
- ada/opt.ads ada/rident.ads ada/sem_vfpt.ads ada/sem_vfpt.adb \
- ada/snames.ads ada/stand.ads ada/system.ads ada/s-exctab.ads \
- ada/s-rident.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/targparm.ads ada/ttypef.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/sem_util.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/casing.adb ada/checks.ads \
+ ada/csets.ads ada/debug.ads ada/einfo.ads ada/einfo.adb ada/elists.ads \
+ ada/elists.adb ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/eval_fat.ads ada/exp_tss.ads ada/exp_util.ads ada/fname.ads \
+ ada/freeze.ads ada/get_targ.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/interfac.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads ada/namet.ads \
+ ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads ada/nmake.adb \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_cat.ads ada/sem_ch8.ads ada/sem_eval.ads \
+ ada/sem_eval.adb ada/sem_res.ads ada/sem_type.ads ada/sem_util.ads \
+ ada/sem_util.adb ada/sem_warn.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/sinput.adb ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/stringt.adb ada/style.ads ada/styleg.ads \
+ ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads ada/system.ads \
+ ada/s-carun8.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads ada/ttypes.ads \
+ ada/types.ads ada/types.adb ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb \
+ ada/widechar.ads
-ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/err_vars.ads ada/errout.ads ada/erroutc.ads ada/fname.ads \
- ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/namet.ads \
- ada/nlists.ads ada/opt.ads ada/output.ads ada/sem.ads ada/sem_ch8.ads \
- ada/sem_util.ads ada/sem_warn.ads ada/sem_warn.adb ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
- ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ada/sem_vfpt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/cstand.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/gnat.ads ada/g-htable.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/namet.ads ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads \
+ ada/rident.ads ada/sem_vfpt.ads ada/sem_vfpt.adb ada/sinfo.ads \
+ ada/sinfo.adb ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/tree_io.ads ada/ttypef.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
ada/unchdeal.ads ada/urealp.ads
-ada/s-except.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-except.ads ada/s-stalib.ads ada/s-traent.ads ada/unchconv.ads
-
-ada/s-exctab.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads \
- ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
- ada/s-htable.adb ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
-
-ada/s-htable.o : ada/ada.ads ada/a-uncdea.ads ada/system.ads \
- ada/s-htable.ads ada/s-htable.adb
-
-ada/s-imgenu.o : ada/system.ads ada/s-imgenu.ads ada/s-imgenu.adb \
- ada/s-secsta.ads ada/s-stoele.ads ada/s-stoele.adb ada/unchconv.ads
-
-ada/sinfo.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/sinfo.ads \
- ada/sinfo.adb ada/snames.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ada/sem_warn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/checks.ads ada/csets.ads ada/debug.ads \
+ ada/einfo.ads ada/einfo.adb ada/elists.ads ada/err_vars.ads \
+ ada/errout.ads ada/erroutc.ads ada/exp_tss.ads ada/exp_util.ads \
+ ada/fname.ads ada/freeze.ads ada/get_targ.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/interfac.ads ada/lib.ads \
+ ada/lib.adb ada/lib-list.adb ada/lib-sort.adb ada/lib-xref.ads \
+ ada/namet.ads ada/namet.adb ada/nlists.ads ada/nlists.adb ada/nmake.ads \
+ ada/opt.ads ada/output.ads ada/restrict.ads ada/rident.ads \
+ ada/rtsfind.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sem.ads ada/sem_ch8.ads ada/sem_eval.ads ada/sem_res.ads \
+ ada/sem_type.ads ada/sem_util.ads ada/sem_util.adb ada/sem_warn.ads \
+ ada/sem_warn.adb ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/style.ads ada/styleg.ads ada/styleg.adb ada/styleg-c.ads \
+ ada/stylesw.ads ada/system.ads ada/s-crc32.ads ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-rident.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/targparm.ads \
+ ada/tbuild.ads ada/tree_io.ads ada/ttypes.ads ada/types.ads \
+ ada/uintp.ads ada/uintp.adb ada/uname.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/sinfo-cn.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/sinfo.ads \
- ada/sinfo-cn.ads ada/sinfo-cn.adb ada/snames.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
+ada/sinfo-cn.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo-cn.ads \
+ ada/sinfo-cn.adb ada/sinput.ads ada/snames.ads ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
+ ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads
-ada/sinput.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
- ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
- ada/output.ads ada/sinput.ads ada/sinput.adb ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ada/sinfo.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/snames.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
- ada/unchdeal.ads
-
-ada/sinput-d.o : ada/alloc.ads ada/casing.ads ada/gnat.ads \
- ada/g-os_lib.ads ada/g-string.ads ada/osint.ads ada/osint-c.ads \
- ada/sinput.ads ada/sinput-d.ads ada/sinput-d.adb ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/sinput-l.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/debug.ads \
- ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/gnat.ads ada/g-dyntab.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
- ada/osint.ads ada/output.ads ada/prep.ads ada/prepcomp.ads \
- ada/scans.ads ada/scn.ads ada/scng.ads ada/sinfo.ads ada/sinput.ads \
- ada/sinput-l.ads ada/sinput-l.adb ada/snames.ads ada/style.ads \
- ada/styleg.ads ada/styleg-c.ads ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads \
- ada/table.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/sinput-d.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
+ ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/osint.ads \
+ ada/osint-c.ads ada/output.ads ada/sinput.ads ada/sinput-d.ads \
+ ada/sinput-d.adb ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads
-ada/s-mastop.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-except.ads ada/s-mastop.ads ada/s-mastop.adb ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
+ada/sinput-l.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/gnat.ads ada/g-dyntab.ads ada/g-dyntab.adb ada/g-hesorg.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/interfac.ads ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/osint.ads ada/output.ads ada/prep.ads \
+ ada/prepcomp.ads ada/scans.ads ada/scn.ads ada/scng.ads ada/scng.adb \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput-l.ads \
+ ada/sinput-l.adb ada/snames.ads ada/stringt.ads ada/style.ads \
+ ada/styleg.ads ada/styleg.adb ada/styleg-c.ads ada/stylesw.ads \
+ ada/system.ads ada/s-crc32.ads ada/s-crc32.adb ada/s-exctab.ads \
+ ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads ada/s-secsta.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/s-memory.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-memory.ads ada/s-memory.adb ada/s-parame.ads ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/unchconv.ads
+ada/sinput.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
+ ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/namet.adb \
+ ada/opt.ads ada/output.ads ada/sinput.ads ada/sinput.adb ada/system.ads \
+ ada/s-exctab.ads ada/s-memory.ads ada/s-secsta.ads ada/s-stalib.ads \
+ ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads ada/widechar.ads
ada/snames.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \
- ada/snames.ads ada/snames.adb ada/system.ads ada/s-assert.ads \
- ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/s-parame.o : ada/system.ads ada/s-parame.ads ada/s-parame.adb
+ ada/snames.ads ada/snames.adb ada/system.ads ada/s-exctab.ads \
+ ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/sprint.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/gnat.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/opt.ads ada/output.ads ada/rtsfind.ads \
- ada/sinfo.ads ada/sinput.ads ada/sinput-d.ads ada/snames.ads \
- ada/sprint.ads ada/sprint.adb ada/stand.ads ada/stringt.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-imgenu.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/fname.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/output.adb \
+ ada/rtsfind.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput-d.ads ada/snames.ads ada/sprint.ads ada/sprint.adb \
+ ada/stand.ads ada/stringt.ads ada/stringt.adb ada/system.ads \
+ ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads ada/s-memory.ads \
ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/types.ads ada/uintp.ads \
- ada/uname.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-
-ada/s-purexc.o : ada/system.ads ada/s-purexc.ads
-
-ada/s-secsta.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-parame.ads ada/s-secsta.ads ada/s-secsta.adb ada/s-soflin.ads \
- ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/s-traent.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/s-soflin.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-except.ads ada/s-mastop.ads ada/s-parame.ads ada/s-secsta.ads \
- ada/s-soflin.ads ada/s-soflin.adb ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/unchconv.ads
-
-ada/s-sopco3.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco3.adb \
- ada/s-sopco4.ads ada/s-sopco5.ads ada/unchconv.ads
-
-ada/s-sopco4.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
- ada/s-sopco4.adb ada/s-sopco5.ads ada/unchconv.ads
-
-ada/s-sopco5.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-strops.ads ada/s-sopco3.ads ada/s-sopco4.ads \
- ada/s-sopco5.ads ada/s-sopco5.adb ada/unchconv.ads
-
-ada/s-stache.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-parame.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stache.adb \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/unchconv.ads
-
-ada/s-stalib.o : ada/ada.ads ada/a-except.ads ada/system.ads \
- ada/s-memory.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stalib.adb ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/unchconv.ads
-
-ada/s-stoele.o : ada/system.ads ada/s-stoele.ads ada/s-stoele.adb \
- ada/unchconv.ads
-
-ada/s-strcom.o : ada/system.ads ada/s-strcom.ads ada/s-strcom.adb \
- ada/unchconv.ads
-
-ada/s-strops.o : ada/system.ads ada/s-secsta.ads ada/s-stoele.ads \
- ada/s-stoele.adb ada/s-strops.ads ada/s-strops.adb ada/unchconv.ads
-
-ada/stand.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/namet.ads ada/stand.ads ada/stand.adb ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-
-ada/s-traceb.o : ada/system.ads ada/s-traceb.ads ada/s-traceb.adb
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb
-ada/s-traent.o : ada/system.ads ada/s-traent.ads ada/s-traent.adb
+ada/stand.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads ada/stand.ads \
+ ada/stand.adb ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads
ada/stringt.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
ada/hostparm.ads ada/namet.ads ada/opt.ads ada/output.ads \
- ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-assert.ads \
+ ada/stringt.ads ada/stringt.adb ada/system.ads ada/s-carun8.ads \
ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
- ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
+ ada/tree_io.ads ada/types.ads ada/types.adb ada/unchconv.ads \
+ ada/unchdeal.ads
-ada/style.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/csets.ads \
- ada/einfo.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/namet.ads ada/opt.ads ada/scans.ads ada/sinfo.ads ada/sinput.ads \
+ada/style.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/elists.ads ada/err_vars.ads ada/errout.ads ada/erroutc.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/namet.adb \
+ ada/nlists.ads ada/nlists.adb ada/opt.ads ada/output.ads ada/scans.ads \
+ ada/sinfo.ads ada/sinfo.adb ada/sinput.ads ada/sinput.adb \
ada/snames.ads ada/stand.ads ada/style.ads ada/styleg.ads \
ada/styleg.adb ada/styleg-c.ads ada/styleg-c.adb ada/stylesw.ads \
- ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/styleg.o : ada/alloc.ads ada/casing.ads ada/csets.ads ada/err_vars.ads \
- ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
- ada/opt.ads ada/scans.ads ada/sinput.ads ada/styleg.ads ada/styleg.adb \
- ada/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \
- ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/styleg-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/err_vars.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads ada/opt.ads \
+ ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
+ ada/stand.ads ada/styleg.ads ada/styleg-c.ads ada/styleg-c.adb \
+ ada/stylesw.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/styleg-c.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/csets.ads \
- ada/einfo.ads ada/err_vars.ads ada/namet.ads ada/sinfo.ads \
- ada/sinput.ads ada/snames.ads ada/stand.ads ada/styleg.ads \
- ada/styleg-c.ads ada/styleg-c.adb ada/stylesw.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
+ada/styleg.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/casing.ads \
+ ada/csets.ads ada/debug.ads ada/err_vars.ads ada/gnat.ads \
+ ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
+ ada/opt.ads ada/output.ads ada/scans.ads ada/sinput.ads ada/styleg.ads \
+ ada/styleg.adb ada/stylesw.ads ada/system.ads ada/s-exctab.ads \
+ ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads \
+ ada/s-wchcon.ads ada/table.ads ada/table.adb ada/tree_io.ads \
ada/types.ads ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads \
ada/urealp.ads
@@ -2925,19 +3778,6 @@ ada/stylesw.o : ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
ada/s-wchcon.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-ada/s-unstyp.o : ada/system.ads ada/s-unstyp.ads
-
-ada/s-wchcnv.o : ada/interfac.ads ada/system.ads ada/s-wchcnv.ads \
- ada/s-wchcnv.adb ada/s-wchcon.ads ada/s-wchjis.ads
-
-ada/s-wchcon.o : ada/system.ads ada/s-wchcon.ads
-
-ada/s-wchjis.o : ada/system.ads ada/s-wchjis.ads ada/s-wchjis.adb
-
-ada/switch.o : ada/ada.ads ada/a-except.ads ada/switch.ads ada/switch.adb \
- ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-traent.ads \
- ada/s-unstyp.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
-
ada/switch-b.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \
ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads \
ada/opt.ads ada/osint.ads ada/switch.ads ada/switch-b.ads \
@@ -2948,13 +3788,20 @@ ada/switch-b.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \
ada/switch-c.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/lib.ads ada/opt.ads ada/osint.ads ada/prepcomp.ads \
- ada/stylesw.ads ada/switch.ads ada/switch-c.ads ada/switch-c.adb \
- ada/system.ads ada/s-exctab.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/types.ads \
+ ada/hostparm.ads ada/lib.ads ada/opt.ads ada/osint.ads ada/output.ads \
+ ada/prepcomp.ads ada/stylesw.ads ada/switch.ads ada/switch-c.ads \
+ ada/switch-c.adb ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads \
ada/unchconv.ads ada/unchdeal.ads ada/validsw.ads
+ada/switch.o : ada/ada.ads ada/a-except.ads ada/switch.ads ada/switch.adb \
+ ada/system.ads ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads \
+ ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads \
+ ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads ada/types.ads \
+ ada/unchconv.ads ada/unchdeal.ads
+
ada/system.o : ada/system.ads
ada/table.o : ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
@@ -2964,55 +3811,77 @@ ada/table.o : ada/debug.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
ada/tree_io.ads ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/targparm.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/csets.ads \
- ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \
- ada/rident.ads ada/system.ads ada/s-exctab.ads ada/s-imgenu.ads \
- ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/targparm.ads \
- ada/targparm.adb ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads
+ ada/debug.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
+ ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/namet.ads \
+ ada/namet.adb ada/opt.ads ada/osint.ads ada/output.ads ada/rident.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/targparm.ads ada/targparm.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/unchconv.ads \
+ ada/unchdeal.ads ada/widechar.ads
-ada/tbuild.o : ada/alloc.ads ada/atree.ads ada/einfo.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/nmake.ads ada/restrict.ads \
- ada/rident.ads ada/sinfo.ads ada/snames.ads ada/stand.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-rident.ads \
- ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-unstyp.ads \
- ada/table.ads ada/tbuild.ads ada/tbuild.adb ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/tbuild.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/namet.adb ada/nlists.ads \
+ ada/nlists.adb ada/nmake.ads ada/nmake.adb ada/opt.ads ada/output.ads \
+ ada/restrict.ads ada/rident.ads ada/sinfo.ads ada/sinfo.adb \
+ ada/sinput.ads ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-rident.ads ada/s-secsta.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tbuild.ads ada/tbuild.adb ada/tree_io.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/widechar.ads
-ada/tree_gen.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \
- ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-os_lib.ads \
- ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads \
- ada/namet.ads ada/nlists.ads ada/opt.ads ada/osint.ads ada/osint-c.ads \
- ada/repinfo.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \
- ada/s-stalib.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/tree_gen.ads ada/tree_gen.adb ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
+ada/tree_gen.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/casing.ads ada/debug.ads ada/einfo.ads ada/elists.ads ada/fname.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads ada/opt.ads \
+ ada/osint.ads ada/osint-c.ads ada/output.ads ada/repinfo.ads \
+ ada/sinfo.ads ada/sinput.ads ada/snames.ads ada/stand.ads \
+ ada/stringt.ads ada/system.ads ada/s-exctab.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_gen.ads ada/tree_gen.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
+ ada/unchdeal.ads ada/urealp.ads
ada/tree_io.o : ada/ada.ads ada/a-except.ads ada/debug.ads ada/gnat.ads \
ada/g-os_lib.ads ada/g-string.ads ada/output.ads ada/system.ads \
- ada/s-exctab.ads ada/s-soflin.ads ada/s-stache.ads ada/s-stalib.ads \
- ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads ada/s-unstyp.ads \
- ada/tree_io.ads ada/tree_io.adb ada/types.ads ada/unchconv.ads \
- ada/unchdeal.ads
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/tree_io.ads ada/tree_io.adb \
+ ada/types.ads ada/unchconv.ads ada/unchdeal.ads
ada/treepr.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
- ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads ada/elists.ads \
- ada/lib.ads ada/namet.ads ada/nlists.ads ada/output.ads \
- ada/sem_mech.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/stand.ads ada/stringt.ads ada/system.ads ada/s-exctab.ads \
- ada/s-imgenu.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/atree.adb ada/casing.ads ada/csets.ads ada/debug.ads ada/einfo.ads \
+ ada/einfo.adb ada/elists.ads ada/elists.adb ada/fname.ads ada/gnat.ads \
+ ada/g-hesora.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/lib.ads ada/lib.adb \
+ ada/lib-list.adb ada/lib-sort.adb ada/namet.ads ada/nlists.ads \
+ ada/nlists.adb ada/opt.ads ada/output.ads ada/output.adb \
+ ada/sem_mech.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
- ada/s-unstyp.ads ada/table.ads ada/treepr.ads ada/treepr.adb \
- ada/treeprs.ads ada/types.ads ada/uintp.ads ada/uname.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/treepr.ads ada/treepr.adb ada/treeprs.ads \
+ ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
-ada/treeprs.o : ada/alloc.ads ada/sinfo.ads ada/system.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/table.ads \
- ada/treeprs.ads ada/types.ads ada/uintp.ads ada/unchconv.ads \
- ada/unchdeal.ads ada/urealp.ads
+ada/treeprs.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/opt.ads ada/output.ads ada/sinfo.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
+ ada/table.adb ada/tree_io.ads ada/treeprs.ads ada/types.ads \
+ ada/uintp.ads ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/ttypef.o : ada/system.ads ada/ttypef.ads
@@ -3020,39 +3889,51 @@ ada/ttypes.o : ada/get_targ.ads ada/system.ads ada/s-exctab.ads \
ada/s-stalib.ads ada/s-unstyp.ads ada/ttypes.ads ada/types.ads \
ada/unchconv.ads ada/unchdeal.ads
-ada/types.o : ada/system.ads ada/s-assert.ads ada/s-carun8.ads \
- ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads ada/types.ads \
- ada/types.adb ada/unchconv.ads ada/unchdeal.ads
+ada/types.o : ada/ada.ads ada/a-except.ads ada/system.ads ada/s-carun8.ads \
+ ada/s-exctab.ads ada/s-exctab.adb ada/s-htable.ads ada/s-soflin.ads \
+ ada/s-stache.ads ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb \
+ ada/s-traent.ads ada/s-unstyp.ads ada/types.ads ada/types.adb \
+ ada/unchconv.ads ada/unchdeal.ads
ada/uintp.o : ada/ada.ads ada/a-except.ads ada/a-uncdea.ads ada/alloc.ads \
ada/debug.ads ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads \
ada/g-string.ads ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads \
- ada/output.ads ada/system.ads ada/s-assert.ads ada/s-exctab.ads \
- ada/s-htable.ads ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads \
- ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
+ ada/output.ads ada/system.ads ada/s-exctab.ads ada/s-htable.ads \
+ ada/s-htable.adb ada/s-memory.ads ada/s-stalib.ads ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb \
ada/unchconv.ads ada/unchdeal.ads
-ada/uname.o : ada/alloc.ads ada/atree.ads ada/casing.ads ada/einfo.ads \
- ada/hostparm.ads ada/lib.ads ada/namet.ads ada/nlists.ads \
- ada/output.ads ada/sinfo.ads ada/sinput.ads ada/snames.ads \
- ada/system.ads ada/s-assert.ads ada/s-exctab.ads ada/s-stalib.ads \
- ada/s-unstyp.ads ada/table.ads ada/types.ads ada/uintp.ads \
- ada/uname.ads ada/uname.adb ada/unchconv.ads ada/unchdeal.ads \
- ada/urealp.ads
+ada/uname.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/atree.ads \
+ ada/atree.adb ada/casing.ads ada/debug.ads ada/einfo.ads ada/einfo.adb \
+ ada/elists.ads ada/fname.ads ada/gnat.ads ada/g-hesora.ads \
+ ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
+ ada/hostparm.ads ada/lib.ads ada/lib.adb ada/lib-list.adb \
+ ada/lib-sort.adb ada/namet.ads ada/nlists.ads ada/nlists.adb \
+ ada/opt.ads ada/output.ads ada/sinfo.ads ada/sinfo.adb ada/sinput.ads \
+ ada/sinput.adb ada/snames.ads ada/stand.ads ada/stringt.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-imgenu.ads \
+ ada/s-memory.ads ada/s-secsta.ads ada/s-soflin.ads ada/s-stache.ads \
+ ada/s-stalib.ads ada/s-stoele.ads ada/s-stoele.adb ada/s-traent.ads \
+ ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads ada/table.adb \
+ ada/tree_io.ads ada/types.ads ada/uintp.ads ada/uintp.adb ada/uname.ads \
+ ada/uname.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads
ada/urealp.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
+ ada/gnat.ads ada/g-htable.ads ada/g-os_lib.ads ada/g-string.ads \
+ ada/gnatvsn.ads ada/hostparm.ads ada/opt.ads ada/output.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-htable.ads ada/s-memory.ads \
+ ada/s-stalib.ads ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads \
+ ada/table.ads ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
+ ada/uintp.adb ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads \
+ ada/urealp.adb
+
+ada/usage.o : ada/ada.ads ada/a-except.ads ada/alloc.ads ada/debug.ads \
ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads ada/gnatvsn.ads \
- ada/hostparm.ads ada/opt.ads ada/output.ads ada/system.ads \
- ada/s-assert.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
+ ada/hostparm.ads ada/namet.ads ada/opt.ads ada/osint.ads ada/output.ads \
+ ada/system.ads ada/s-exctab.ads ada/s-memory.ads ada/s-stalib.ads \
ada/s-traent.ads ada/s-unstyp.ads ada/s-wchcon.ads ada/table.ads \
- ada/table.adb ada/tree_io.ads ada/types.ads ada/uintp.ads \
- ada/unchconv.ads ada/unchdeal.ads ada/urealp.ads ada/urealp.adb
-
-ada/usage.o : ada/alloc.ads ada/gnat.ads ada/g-os_lib.ads ada/g-string.ads \
- ada/hostparm.ads ada/namet.ads ada/osint.ads ada/output.ads \
- ada/system.ads ada/s-exctab.ads ada/s-stalib.ads ada/s-unstyp.ads \
- ada/s-wchcon.ads ada/table.ads ada/types.ads ada/unchconv.ads \
+ ada/table.adb ada/tree_io.ads ada/types.ads ada/unchconv.ads \
ada/unchdeal.ads ada/usage.ads ada/usage.adb
ada/validsw.o : ada/gnat.ads ada/g-string.ads ada/gnatvsn.ads \
diff --git a/gcc/ada/Makefile.generic b/gcc/ada/Makefile.generic
index bdba19c5052..34e0d24af01 100644
--- a/gcc/ada/Makefile.generic
+++ b/gcc/ada/Makefile.generic
@@ -67,10 +67,6 @@ ifndef MAIN
MAIN=ada
endif
-ifndef CC
- CC=gcc
-endif
-
ifndef ADA_SPEC
ADA_SPEC=.ads
endif
@@ -157,7 +153,7 @@ $(compile_deps): force
@$(MAKE) -C $(dir $(subst |,:,$(@:compile_%=%))) -f Makefile.$(notdir $@) internal-compile
$(object_deps): force
- @$(MAKE) -C $(dir $(@:object_%=%)) -f Makefile.$(notdir $@) internal-archive-objects ARCHIVE=$(ARCHIVE)
+ @$(MAKE) -C $(dir $(subst |,:,$(@:object_%=%))) -f Makefile.$(notdir $@) internal-archive-objects ARCHIVE=$(ARCHIVE)
$(ada_deps): force
@$(MAKE) -C $(dir $(subst |,:,$(@:ada_%=%))) -f Makefile.$(notdir $@) internal-ada
diff --git a/gcc/ada/Makefile.in b/gcc/ada/Makefile.in
index 9aa5fa5e5e1..b20402c7f17 100644
--- a/gcc/ada/Makefile.in
+++ b/gcc/ada/Makefile.in
@@ -109,25 +109,7 @@ LS = ls
RANLIB = ranlib
# Test to use to see whether ranlib exists on the system.
RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
-CC = cc
-BISON = bison
-BISONFLAGS =
-ECHO = echo
-LEX = flex
-LEXFLAGS =
-CHMOD = chmod
-CP = cp -p
-MV = mv -f
-RM = rm -f
-RMDIR = rm -rf
-MKDIR = mkdir -p
-AR = ar
-AR_FLAGS = rc
-# How to invoke ranlib.
-RANLIB = ranlib
-# Test to use to see whether ranlib exists on the system.
-RANLIB_TEST = [ -f /usr/bin/ranlib -o -f /bin/ranlib ]
SHELL = @SHELL@
PWD_COMMAND = $${PWDCMD-pwd}
# How to copy preserving the date
@@ -393,6 +375,8 @@ PREFIX_REAL_OBJS = ../prefix.o \
../../libiberty/xstrdup.o \
../../libiberty/xexit.o
+LIB_VERSION = $(strip $(shell grep ' Library_Version :' $(fsrcpfx)gnatvsn.ads | sed -e 's/.*"\(.*\)".*/\1/'))
+
# $(filter-out PATTERN...,TEXT) removes all PATTERN words from TEXT.
# $(strip STRING) removes leading and trailing spaces from STRING.
# If what's left is null then it's a match.
@@ -468,7 +452,7 @@ ifeq ($(strip $(filter-out %86 sysv5uw%,$(arch) $(osys))),)
PREFIX_OBJS=$(PREFIX_REAL_OBJS)
SO_OPTS = -Wl,-h,
GNATLIB_SHARED = gnatlib-shared-dual
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),)
@@ -479,6 +463,7 @@ ifeq ($(strip $(filter-out alpha% dec vx%,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -505,6 +490,7 @@ ifeq ($(strip $(filter-out m68k% wrs vx%,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -542,6 +528,7 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -592,127 +579,6 @@ ifeq ($(strip $(filter-out powerpc% wrs vxworks,$(targ))),)
s-vxwork.ads<5pvxwork.ads \
a-taside.adb<1ataside.adb \
- CERT_LEVEL_B_TARGET_PAIRS=\
- a-tags.ads<1atags.ads \
- a-tags.adb<1atags.adb \
- a-except.adb<2aexcept.adb \
- a-except.ads<2aexcept.ads \
- a-excach.adb<2aexcach.adb \
- i-c.ads<1ic.ads \
- g-io.adb<2gio.adb \
- s-init.ads<2sinit.ads \
- s-init.adb<5zinit.adb \
- s-memory.adb<2smemory.adb \
- s-memory.ads<2smemory.ads \
- s-osinte.ads<2sosinte.ads \
- s-secsta.ads<2ssecsta.ads \
- s-secsta.adb<2ssecsta.adb \
- s-soflin.adb<2ssoflin.adb \
- s-soflin.ads<2ssoflin.ads \
- s-stalib.adb<1sstalib.adb \
- s-stalib.ads<1sstalib.ads \
- s-thrini.ads<2sthrini.ads \
- s-thrini.adb<5zthrini.adb \
- s-tiitho.adb<5ztiitho.adb \
- s-traceb.adb<2straceb.adb \
- s-traceb.ads<2straceb.ads \
- system.ads<5isystem.ads
-
- ifeq ($(strip $(filter-out yes,$(TRACE))),)
- LIBGNAT_TARGET_PAIRS += \
- s-traces.adb<7straces.adb \
- s-trafor.adb<7strafor.adb \
- s-trafor.ads<7strafor.ads \
- s-tratas.adb<7stratas.adb \
- s-tfsetr.adb<5ztfsetr.adb
- endif
-endif
-
-
-ifeq ($(strip $(filter-out powerpc% wrs vxworksae,$(targ))),)
- LIBGNAT_TARGET_PAIRS = \
- a-sytaco.ads<4zsytaco.ads \
- a-sytaco.adb<4zsytaco.adb \
- a-intnam.ads<4zintnam.ads \
- a-numaux.ads<4znumaux.ads \
- s-inmaop.adb<7sinmaop.adb \
- s-interr.adb<5zinterr.adb \
- s-intman.adb<5zintman.adb \
- s-osinte.adb<5zosinte.adb \
- s-osinte.ads<5zosinte.ads \
- s-osprim.adb<5zosprim.adb \
- s-parame.ads<5yparame.ads \
- s-taprop.adb<5ztaprop.adb \
- s-taspri.ads<5ztaspri.ads \
- s-tpopsp.adb<5ztpopsp.adb \
- s-vxwork.ads<5pvxwork.ads \
- g-soccon.ads<3zsoccon.ads \
- g-socthi.ads<3zsocthi.ads \
- g-socthi.adb<3zsocthi.adb \
- system.ads<5ysystem.ads
-
- TOOLS_TARGET_PAIRS=mlib-tgt.adb<5zml-tgt.adb
-
- EXTRA_HIE_NONE_TARGET_PAIRS= \
- system.ads<50system.ads
-
- EXTRA_RAVEN_SOURCES=i-vxwork.ads s-vxwork.ads
- EXTRA_RAVEN_OBJS=i-vxwork.o s-vxwork.o
- EXTRA_GNATRTL_NONTASKING_OBJS=i-vxwork.o i-vxwoio.o
- EXTRA_GNATRTL_TASKING_OBJS=i-vthrea.o s-tpae65.o s-vxwork.o
- HIE_RAVEN_TARGET_PAIRS=\
- $(HIE_NONE_TARGET_PAIRS) \
- a-reatim.ads<1areatim.ads \
- a-reatim.adb<1areatim.adb \
- a-retide.adb<1aretide.adb \
- a-interr.adb<1ainterr.adb \
- s-interr.ads<1sinterr.ads \
- s-interr.adb<1sinterr.adb \
- s-taskin.ads<1staskin.ads \
- s-taskin.adb<1staskin.adb \
- s-tarest.adb<1starest.adb \
- s-tposen.ads<1stposen.ads \
- s-tposen.adb<1stposen.adb \
- s-osinte.adb<1sosinte.adb \
- s-taprop.ads<1staprop.ads \
- s-taprop.adb<1staprop.adb \
- s-taprob.ads<1staprob.ads \
- s-taprob.adb<1staprob.adb \
- a-sytaco.ads<1asytaco.ads \
- a-sytaco.adb<1asytaco.adb \
- a-intnam.ads<4zintnam.ads \
- s-osinte.ads<5zosinte.ads \
- s-parame.ads<5zparame.ads \
- s-taspri.ads<5ztaspri.ads \
- s-vxwork.ads<5pvxwork.ads \
- a-taside.adb<1ataside.adb \
-
- CERT_LEVEL_B_TARGET_PAIRS=\
- a-tags.ads<1atags.ads \
- a-tags.adb<1atags.adb \
- a-except.adb<2aexcept.adb \
- a-except.ads<2aexcept.ads \
- a-excach.adb<2aexcach.adb \
- i-c.ads<1ic.ads \
- g-io.adb<2gio.adb \
- s-init.ads<2sinit.ads \
- s-init.adb<5zinit.adb \
- s-memory.adb<2smemory.adb \
- s-memory.ads<2smemory.ads \
- s-osinte.ads<2sosinte.ads \
- s-secsta.ads<2ssecsta.ads \
- s-secsta.adb<2ssecsta.adb \
- s-soflin.adb<2ssoflin.adb \
- s-soflin.ads<2ssoflin.ads \
- s-stalib.adb<1sstalib.adb \
- s-stalib.ads<1sstalib.ads \
- s-thrini.ads<2sthrini.ads \
- s-thrini.adb<5zthrini.adb \
- s-tiitho.adb<5ytiitho.adb \
- s-traceb.adb<2straceb.adb \
- s-traceb.ads<2straceb.ads \
- system.ads<5isystem.ads
-
ifeq ($(strip $(filter-out yes,$(TRACE))),)
LIBGNAT_TARGET_PAIRS += \
s-traces.adb<7straces.adb \
@@ -728,8 +594,7 @@ ifeq ($(strip $(filter-out powerpc% unknown elf,$(targ))),)
system.ads<59system.ads
LIBGNAT_TARGET_PAIRS = \
- $(HIE_NONE_TARGET_PAIRS) \
- $(EXTRA_HIE_NONE_TARGET_PAIRS)
+ $(HIE_NONE_TARGET_PAIRS)
endif
ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),)
@@ -737,8 +602,7 @@ ifeq ($(strip $(filter-out sparc% unknown elf,$(targ))),)
system.ads<5rsystem.ads
LIBGNAT_TARGET_PAIRS = \
- $(HIE_NONE_TARGET_PAIRS) \
- $(EXTRA_HIE_NONE_TARGET_PAIRS)
+ $(HIE_NONE_TARGET_PAIRS)
endif
ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
@@ -749,6 +613,7 @@ ifeq ($(strip $(filter-out sparc% wrs vx%,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -777,6 +642,7 @@ ifeq ($(strip $(filter-out xscale% coff wrs vx%,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -805,6 +671,7 @@ ifeq ($(strip $(filter-out mips% wrs vx%,$(targ))),)
a-numaux.ads<4znumaux.ads \
s-inmaop.adb<7sinmaop.adb \
s-interr.adb<5zinterr.adb \
+ s-intman.ads<5zintman.ads \
s-intman.adb<5zintman.adb \
s-osinte.adb<5zosinte.adb \
s-osinte.ads<5zosinte.ads \
@@ -852,7 +719,7 @@ ifeq ($(strip $(filter-out sparc sun solaris%,$(targ))),)
GNATLIB_SHARED = gnatlib-shared-dual
GMEM_LIB = gmemlib
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS = \
@@ -936,7 +803,7 @@ ifeq ($(strip $(filter-out %86 solaris2%,$(arch) $(osys))),)
SO_OPTS = -Wl,-h,
GNATLIB_SHARED = gnatlib-shared-dual
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
@@ -945,7 +812,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
a-numaux.adb<86numaux.adb \
a-numaux.ads<86numaux.ads \
s-inmaop.adb<7sinmaop.adb \
- s-intman.adb<5lintman.adb \
+ s-intman.adb<7sintman.adb \
s-mastop.adb<5omastop.adb \
s-osinte.adb<5iosinte.adb \
s-osinte.ads<5iosinte.ads \
@@ -962,7 +829,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
GNATLIB_SHARED = gnatlib-shared-dual
GMEM_LIB = gmemlib
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
ifeq ($(strip $(filter-out fsu FSU,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS = \
@@ -970,7 +837,7 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
a-numaux.adb<86numaux.adb \
a-numaux.ads<86numaux.ads \
s-inmaop.adb<7sinmaop.adb \
- s-intman.adb<5lintman.adb \
+ s-intman.adb<7sintman.adb \
s-mastop.adb<5omastop.adb \
s-osinte.adb<7sosinte.adb \
s-osinte.ads<5losinte.ads \
@@ -984,6 +851,25 @@ ifeq ($(strip $(filter-out %86 linux%,$(arch) $(osys))),)
endif
endif
+ifeq ($(strip $(filter-out %86 freebsd%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<45intnam.ads \
+ g-soccon.ads<35soccon.ads \
+ s-inmaop.adb<7sinmaop.adb \
+ s-intman.adb<7sintman.adb \
+ s-mastop.adb<5omastop.adb \
+ s-osinte.adb<55osinte.adb \
+ s-osinte.ads<55osinte.ads \
+ s-osprim.adb<7sosprim.adb \
+ s-taprop.adb<7staprop.adb \
+ s-taspri.ads<7staspri.ads \
+ s-tpopsp.adb<7stpopsp.adb \
+ system.ads<56system.ads
+
+ THREADSLIB=
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
ifeq ($(strip $(filter-out mips sgi irix6%,$(targ))),)
LIBGNAT_TARGET_PAIRS = \
@@ -1035,7 +921,7 @@ ifeq ($(strip $(filter-out mips sgi irix%,$(targ))),)
MISCLIB = -lexc
SO_OPTS = -Wl,-all,-set_version,sgi1.0,-update_registry,../so_locations,-soname,
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
ifeq ($(strip $(filter-out hppa% hp hpux10%,$(targ))),)
@@ -1083,7 +969,7 @@ ifeq ($(strip $(filter-out hppa% hp hpux11%,$(targ))),)
SO_OPTS = -Wl,+h,
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
GNATLIB_SHARED = gnatlib-shared-dual
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
ifeq ($(strip $(filter-out dce DCE,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS = \
@@ -1234,10 +1120,10 @@ ifeq ($(strip $(filter-out alpha% dec osf%,$(targ))),)
THREADSLIB = -lpthread -lmach -lexc -lrt
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
GNATLIB_SHARED = gnatlib-shared-default
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
-ifeq ($(strip $(filter-out alpha% dec vms% openvms% alphavms%,$(host))),)
+ifeq ($(strip $(filter-out alpha% ia64 dec vms% openvms% alphavms%,$(host))),)
soext = .exe
@@ -1248,17 +1134,32 @@ soext = .exe
endif
ifeq ($(strip $(filter-out alpha% ia64 dec hp vms% openvms% alphavms%,$(targ))),)
-ifeq ($(strip $(filter-out alpha64% dec vms% openvms% alphavms%,$(targ))),)
- LIBGNAT_TARGET_PAIRS_AUX =
+
+ifeq ($(strip $(filter-out ia64% hp vms% openvms%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS_AUX = \
+ s-osinte.adb<5xosinte.adb \
+ s-osinte.ads<5xosinte.ads \
+ s-parame.ads<5vparame.ads
+else
+ifeq ($(strip $(filter-out alpha64% dec hp vms% openvms% alphavms%,$(targ))),)
+ LIBGNAT_TARGET_PAIRS_AUX = \
+ s-osinte.adb<5vosinte.adb \
+ s-osinte.ads<5vosinte.ads \
+ s-parame.ads<5vparame.ads
else
ifeq ($(strip $(filter-out express EXPRESS,$(THREAD_KIND))),)
LIBGNAT_TARGET_PAIRS_AUX = \
+ s-osinte.adb<5vosinte.adb \
+ s-osinte.ads<5vosinte.ads \
s-parame.ads<5xparame.ads
else
LIBGNAT_TARGET_PAIRS_AUX = \
+ s-osinte.adb<5vosinte.adb \
+ s-osinte.ads<5vosinte.ads \
s-parame.ads<5vparame.ads
endif
endif
+endif
LIBGNAT_TARGET_PAIRS = \
a-caldel.adb<4vcaldel.adb \
@@ -1266,6 +1167,7 @@ endif
a-calend.ads<4vcalend.ads \
a-excpol.adb<4wexcpol.adb \
a-intnam.ads<4vintnam.ads \
+ a-numaux.ads<4vnumaux.ads \
g-expect.adb<3vexpect.adb \
g-soccon.ads<3vsoccon.ads \
g-socthi.ads<3vsocthi.ads \
@@ -1275,12 +1177,11 @@ endif
i-cpp.adb<6vcpp.adb \
interfac.ads<6vinterf.ads \
s-asthan.adb<5vasthan.adb \
+ s-crtl.ads<5vcrtl.ads \
s-inmaop.adb<5vinmaop.adb \
s-interr.adb<5vinterr.adb \
s-intman.adb<5vintman.adb \
s-intman.ads<5vintman.ads \
- s-osinte.adb<5vosinte.adb \
- s-osinte.ads<5vosinte.ads \
s-osprim.adb<5vosprim.adb \
s-osprim.ads<5vosprim.ads \
s-taprop.adb<5vtaprop.adb \
@@ -1304,8 +1205,7 @@ endif
../../gnatlbr$(exeext) \
,,/../gnatsym$(exeext)
# This command transforms (YYYYMMDD) into YY,MMDD
- GSMATCH_VERSION := $(shell grep "^ *Gnat_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/' -e 's/\./_/g'))
+ GSMATCH_VERSION := $(shell grep "^ *Gnat_Static_Version_String" $(fsrcpfx)gnatvsn.ads | sed -e 's/.*(\(.*\)).*/\1/' -e 's/\(..\)\(..\)\(....\)/\2,\3/')
TOOLS_LIBS_LO := --for-linker=sys\\$$\$$library:trace.exe
endif
@@ -1338,19 +1238,18 @@ ifeq ($(strip $(filter-out cygwin32% mingw32% pe,$(osys))),)
GMEM_LIB = gmemlib
PREFIX_OBJS = $(PREFIX_REAL_OBJS)
EXTRA_GNATTOOLS = ../../gnatdll$(exeext)
- GNAT_WRAPPER_TOOL = ../../gnat_wrapper$(exeext)
EXTRA_GNATMAKE_OBJS = mdll.o mdll-utl.o mdll-fil.o
EXTRA_GNATRTL_NONTASKING_OBJS = g-regist.o
soext = .dll
GNATLIB_SHARED = gnatlib-shared-win32
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
LIBGNAT_TARGET_PAIRS = \
a-intnam.ads<4lintnam.ads \
s-inmaop.adb<7sinmaop.adb \
- s-intman.adb<5lintman.adb \
+ s-intman.adb<7sintman.adb \
s-osinte.ads<5iosinte.ads \
s-osinte.adb<5iosinte.adb \
s-osprim.adb<7sosprim.adb \
@@ -1364,7 +1263,28 @@ ifeq ($(strip $(filter-out %ia64 linux%,$(arch) $(osys))),)
THREADSLIB=-lpthread
GNATLIB_SHARED=gnatlib-shared-dual
PREFIX_OBJS=$(PREFIX_REAL_OBJS)
- LIBRARY_VERSION := $(strip $(shell grep Library_Version $(fsrcpfx)gnatvsn.ads | sed -e 's/.*GNAT Lib v\(.*\)[ "].*/\1/'))
+ LIBRARY_VERSION := $(LIB_VERSION)
+endif
+
+ifeq ($(strip $(filter-out %x86_64 linux%,$(arch) $(osys))),)
+ LIBGNAT_TARGET_PAIRS = \
+ a-intnam.ads<4lintnam.ads \
+ s-inmaop.adb<7sinmaop.adb \
+ s-intman.adb<7sintman.adb \
+ s-osinte.ads<5iosinte.ads \
+ s-osinte.adb<5iosinte.adb \
+ s-osprim.adb<7sosprim.adb \
+ s-taprop.adb<5itaprop.adb \
+ s-tpopsp.adb<5atpopsp.adb \
+ s-taspri.ads<5itaspri.ads \
+ system.ads<5nsystem.ads
+
+ TOOLS_TARGET_PAIRS=mlib-tgt.adb<5lml-tgt.adb
+ MISCLIB=
+ THREADSLIB=-lpthread
+ GNATLIB_SHARED=gnatlib-shared-dual
+ PREFIX_OBJS=$(PREFIX_REAL_OBJS)
+ LIBRARY_VERSION := $(LIB_VERSION)
endif
# The runtime library for gnat comprises two directories. One contains the
@@ -1519,80 +1439,6 @@ RAVEN_OBJS = \
a-sytaco.o \
a-taside.o $(EXTRA_RAVEN_OBJS)
-
-# Files which are needed for the cert level B runtime
-
-COMPILABLE_CERT_LEVEL_B_SOURCES = \
-$(COMPILABLE_HIE_SOURCES) \
- a-except.adb \
- a-except.ads \
- a-exctra.ads \
- a-exctra.adb \
- s-init.adb \
- s-init.ads \
- s-memory.adb \
- s-memory.ads \
- s-osinte.ads \
- s-soflin.adb \
- s-soflin.ads \
- s-stalib.adb \
- s-stalib.ads \
- s-thrini.adb \
- s-thrini.ads \
- s-assert.adb \
- s-assert.ads \
- s-exnint.adb \
- s-exnint.ads \
- s-strops.adb \
- s-strops.ads \
- s-thread.adb \
- s-thread.ads \
- s-traceb.adb \
- s-traceb.ads \
- s-traent.ads \
- s-traent.adb \
- g-debuti.ads \
- g-debuti.adb \
- g-io.adb \
- g-io.ads \
- $(EXTRA_CERT_LEVEL_B_SOURCES)
-
-NON_COMPILABLE_CERT_LEVEL_B_SOURCES= \
- a-excach.adb \
- s-tiitho.adb \
- $(NON_COMPILABLE_HIE_SOURCES)
-
-CERT_LEVEL_B_SOURCES = \
-$(NON_COMPILABLE_CERT_LEVEL_B_SOURCES) \
-$(COMPILABLE_CERT_LEVEL_B_SOURCES)
-
-# Objects to generate for the cert level B run time
-
-CERT_LEVEL_B_OBJS = \
- $(HIE_OBJS) \
- a-except.o \
- a-excach.o \
- s-init.o \
- s-memory.o \
- s-soflin.o \
- s-stalib.o \
- s-tiitho.o \
- s-thrini.o \
- s-traceb.o \
- s-assert.o \
- s-exnint.o \
- s-strops.o \
- s-thread.o \
- g-debuti.o \
- g-io.o \
- $(EXTRA_CERT_LEVEL_B_OBJS)
-
-# C files for the cert level B run time (without the .c extension)
-
-CERT_LEVEL_B_C_FILES = \
-2raise \
-$(EXTRA_CERT_LEVEL_B_C_FILES)
-
# Default run time files
ADA_INCLUDE_SRCS =\
@@ -1678,11 +1524,10 @@ gnattools2: ../stamp-tools
TOOLSCASE=native \
../../gnatchop$(exeext) ../../gnat$(exeext) ../../gnatkr$(exeext) \
../../gnatls$(exeext) ../../gnatprep$(exeext) \
- ../../gnatpsta$(exeext) ../../gnatxref$(exeext) \
+ ../../gnatxref$(exeext) \
../../gnatfind$(exeext) ../../gnatname$(exeext) \
../../gnatclean$(exeext) \
- ../../gprcmd$(exeext) ../../gpr2make$(exeext) \
- $(GNAT_WRAPPER_TOOL)
+ ../../gprcmd$(exeext) ../../gpr2make$(exeext)
# These tools are only built for the native version.
gnattools3: ../stamp-tools
@@ -1735,12 +1580,6 @@ gnattools4: ../stamp-tools
$(GNATLINK) -v gnatprep -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
$(TOOLS_LIBS)
-../../gnatpsta$(exeext): deftarg.o ../stamp-tools
-# $(GNATMAKE) -c $(ADA_INCLUDES) gnatpsta --GCC="$(CC) $(ALL_ADAFLAGS)"
-# $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatpsta
-# $(GNATLINK) -v gnatpsta -o $@ --GCC="$(CC) $(ADA_INCLUDES)"\
-# ../targtyps.o deftarg.o $(TOOLS_LIBS)
-
../../gnatxref$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gnatxref --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatxref
@@ -1779,12 +1618,6 @@ endif
$(GNATLINK) -v gnatdll -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
$(TOOLS_LIBS)
-../../gnat_wrapper$(exeext): ../stamp-tools
- $(GNATMAKE) -c -O2 -gnatpn $(ADA_INCLUDES) gnat_wrapper --GCC="$(CC) $(ALL_ADAFLAGS)"
- $(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnat_wrapper
- $(GNATLINK) -v gnat_wrapper -o $@ --GCC="$(CC) $(ADA_INCLUDES)" \
- $(TOOLS_LIBS)
-
../../gprcmd$(exeext): ../stamp-tools
$(GNATMAKE) -c $(ADA_INCLUDES) gprcmd --GCC="$(CC) $(ALL_ADAFLAGS)"
$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gprcmd
@@ -2023,27 +1856,10 @@ rts-zfp: force
RTS_TARGET_PAIRS="$(HIE_NONE_TARGET_PAIRS)" \
COMPILABLE_SOURCES="$(COMPILABLE_HIE_SOURCES)"
-$(GNATMAKE) -Prts-zfp/zfp.gpr --GCC="../../../xgcc -B../../../"
+ cd rts-zfp/adalib/ ; $(AR) r libgnat.a *.o
$(RM) rts-zfp/adalib/*.o
$(CHMOD) a-wx rts-zfp/adalib/*.ali
-
-rts-cert: force
-# First compile the Ada files ...
- $(MAKE) $(FLAGS_TO_PASS) prepare-rts \
- RTS_NAME=cert RTS_SRCS="$(CERT_LEVEL_B_SOURCES)" \
- RTS_TARGET_PAIRS="$(CERT_LEVEL_B_TARGET_PAIRS)" \
- COMPILABLE_SOURCES="$(COMPILABLE_CERT_LEVEL_B_SOURCES)"
- -$(GNATMAKE) -Prts-cert/cert.gpr --GCC="../../../xgcc -B../../../"
- $(CHMOD) a-wx rts-cert/adalib/*.ali
-# ... then the C files. This section will eventually be removed.
- $(foreach f,$(CERT_LEVEL_B_C_FILES), \
- $(CP) $(fsrcpfx)$(f).c rts-cert/adainclude/ ;)
- cd rts-cert/adalib ; \
- $(foreach f,$(CERT_LEVEL_B_C_FILES), \
- ../../../$(GCC_FOR_TARGET) -B../../../ $(TARGET_LIBGCC2_CFLAGS) \
- $(ALL_CFLAGS) $(GNATLIBCFLAGS_FOR_C) -c ../adainclude/$(f).c \
- -I../adainclude $(INCLUDES_FOR_SUBDIR) -I../../../ ;) \
- $(AR) $(AR_FLAGS) libgnat$(arext) \
- $(addsuffix .o,$(CERT_LEVEL_B_C_FILES))
+ $(CHMOD) a-wx rts-zfp/adalib/libgnat.a
rts-none: force
$(MAKE) $(FLAGS_TO_PASS) prepare-rts \
@@ -2061,7 +1877,10 @@ rts-ravenscar: force
COMPILABLE_SOURCES="$(COMPILABLE_RAVEN_SOURCES)"
-$(GNATMAKE) -Prts-ravenscar/ravenscar.gpr \
--GCC="../../../xgcc -B../../../"
+ cd rts-ravenscar/adalib/ ; $(AR) r libgnat.a *.o
+ $(RM) rts-ravenscar/adalib/*.o
$(CHMOD) a-wx rts-ravenscar/adalib/*.ali
+ $(CHMOD) a-wx rts-ravenscar/adalib/libgnat.a
# Warning: this target assumes that LIBRARY_VERSION has been set correctly.
gnatlib-shared-default:
diff --git a/gcc/ada/Makefile.prolog b/gcc/ada/Makefile.prolog
index 5766fa98ae1..1aaff294617 100644
--- a/gcc/ada/Makefile.prolog
+++ b/gcc/ada/Makefile.prolog
@@ -39,6 +39,7 @@ C_EXT:=.c
CXX_EXT:=.cc
AR_EXT=.a
OBJ_EXT=.o
+CC=gcc
# Default target is to build (compile/bind/link)
# Target build is defined in Makefile.generic
diff --git a/gcc/ada/Makefile.rtl b/gcc/ada/Makefile.rtl
index f44db99ba00..0fabb1d0ebd 100644
--- a/gcc/ada/Makefile.rtl
+++ b/gcc/ada/Makefile.rtl
@@ -1,5 +1,5 @@
# Makefile.rtl for GNU Ada Compiler (GNAT).
-# Copyright (C) 2002 Free Software Foundation, Inc.
+# Copyright (C) 2003 Free Software Foundation, Inc.
#This file is part of GCC.
@@ -38,6 +38,7 @@ GNATRTL_TASKING_OBJS= \
g-boubuf$(objext) \
g-boumai$(objext) \
g-semaph$(objext) \
+ g-signal$(objext) \
g-thread$(objext) \
s-asthan$(objext) \
s-inmaop$(objext) \
@@ -86,6 +87,7 @@ GNATRTL_NONTASKING_OBJS= \
a-diocst$(objext) \
a-direio$(objext) \
a-einuoc$(objext) \
+ a-elchha$(objext) \
a-except$(objext) \
a-exctra$(objext) \
a-filico$(objext) \
@@ -281,6 +283,7 @@ GNATRTL_NONTASKING_OBJS= \
s-caun32$(objext) \
s-caun64$(objext) \
s-chepoo$(objext) \
+ s-crtl$(objext) \
s-crc32$(objext) \
s-direio$(objext) \
s-errrep$(objext) \
diff --git a/gcc/ada/a-direio.adb b/gcc/ada/a-direio.adb
index 310e24f6102..3c5743bc439 100644
--- a/gcc/ada/a-direio.adb
+++ b/gcc/ada/a-direio.adb
@@ -38,6 +38,7 @@
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System; use System;
+with System.CRTL;
with System.File_Control_Block;
with System.File_IO;
with System.Direct_IO;
@@ -65,6 +66,8 @@ package body Ada.Direct_IO is
function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode);
function To_DIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
+ use type System.CRTL.size_t;
+
-----------
-- Close --
-----------
diff --git a/gcc/ada/a-elchha.adb b/gcc/ada/a-elchha.adb
new file mode 100644
index 00000000000..6e2da234a4b
--- /dev/null
+++ b/gcc/ada/a-elchha.adb
@@ -0,0 +1,165 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- A D A . E X C E P T I O N S . L A S T _ C H A N C E _ H A N D L E R --
+-- --
+-- B o d y --
+-- --
+-- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- Default version for most targets
+
+procedure Ada.Exceptions.Last_Chance_Handler
+ (Except : Exception_Occurrence)
+is
+ procedure Unhandled_Terminate;
+ pragma No_Return (Unhandled_Terminate);
+ pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate");
+ -- Perform system dependent shutdown code
+
+ function Tailored_Exception_Information
+ (X : Exception_Occurrence) return String;
+ -- Exception information to be output in the case of automatic tracing
+ -- requested through GNAT.Exception_Traces.
+ --
+ -- This is the same as Exception_Information if no backtrace decorator
+ -- is currently in place. Otherwise, this is Exception_Information with
+ -- the call chain raw addresses replaced by the result of a call to the
+ -- current decorator provided with the call chain addresses.
+
+ pragma Import
+ (Ada, Tailored_Exception_Information,
+ "__gnat_tailored_exception_information");
+
+ procedure Tailored_Exception_Information
+ (X : Exception_Occurrence;
+ Buff : in out String;
+ Last : in out Integer);
+ -- Procedural version of the above function. Instead of returning the
+ -- result, this one is put in Buff (Buff'first .. Buff'first + Last)
+
+ procedure To_Stderr (S : String);
+ pragma Import (Ada, To_Stderr, "__gnat_to_stderr");
+ -- Little routine to output string to stderr
+
+ Nline : constant String := String'(1 => ASCII.LF);
+ -- Convenient shortcut
+
+ Msg : constant String := Except.Msg (1 .. Except.Msg_Length);
+
+ Max_Static_Exc_Info : constant := 1024;
+ -- This should be enough for most exception information cases
+ -- even though tailoring introduces some uncertainty. The
+ -- name+message should not exceed 320 chars, so that leaves at
+ -- least 35 backtrace slots (each slot needs 19 chars for
+ -- representing a 64 bit address).
+
+ subtype Exc_Info_Type is String (1 .. Max_Static_Exc_Info);
+ type Str_Ptr is access Exc_Info_Type;
+ Exc_Info : Str_Ptr;
+ Exc_Info_Last : Natural := 0;
+ -- Buffer that is allocated to store the tailored exception
+ -- information while Adafinal is run. This buffer is allocated
+ -- on the heap only when it is needed. It is better to allocate
+ -- on the heap than on the stack since stack overflows are more
+ -- common than heap overflows.
+
+ procedure Tailored_Exception_Information
+ (X : Exception_Occurrence;
+ Buff : in out String;
+ Last : in out Integer)
+ is
+ Info : constant String := Tailored_Exception_Information (X);
+ begin
+ Last := Info'Last;
+ Buff (1 .. Last) := Info;
+ end Tailored_Exception_Information;
+
+begin
+ -- First allocate & store the exception info in a buffer when
+ -- we know it will be needed. This needs to be done before
+ -- Adafinal because it implicitly uses the secondary stack.
+
+ if Except.Id.Full_Name.all (1) /= '_'
+ and then Except.Num_Tracebacks /= 0
+ then
+ Exc_Info := new Exc_Info_Type;
+ if Exc_Info /= null then
+ Tailored_Exception_Information
+ (Except, Exc_Info.all, Exc_Info_Last);
+ end if;
+ end if;
+
+ -- Let's shutdown the runtime now. The rest of the procedure
+ -- needs to be careful not to use anything that would require
+ -- runtime support. In particular, functions returning strings
+ -- are banned since the sec stack is no longer functional.
+ System.Standard_Library.Adafinal;
+
+ -- Check for special case of raising _ABORT_SIGNAL, which is not
+ -- really an exception at all. We recognize this by the fact that
+ -- it is the only exception whose name starts with underscore.
+
+ if Except.Id.Full_Name.all (1) = '_' then
+ To_Stderr (Nline);
+ To_Stderr ("Execution terminated by abort of environment task");
+ To_Stderr (Nline);
+
+ -- If no tracebacks, we print the unhandled exception in the old style
+ -- (i.e. the style used before ZCX was implemented). We do this to
+ -- retain compatibility.
+
+ elsif Except.Num_Tracebacks = 0 then
+ To_Stderr (Nline);
+ To_Stderr ("raised ");
+ To_Stderr (Except.Id.Full_Name.all (1 .. Except.Id.Name_Length - 1));
+
+ if Msg'Length /= 0 then
+ To_Stderr (" : ");
+ To_Stderr (Msg);
+ end if;
+
+ To_Stderr (Nline);
+
+ -- Traceback exists
+
+ else
+ -- Note we can have this whole information output twice if
+ -- this occurrence gets reraised up to here.
+
+ To_Stderr (Nline);
+ To_Stderr ("Execution terminated by unhandled exception");
+ To_Stderr (Nline);
+ To_Stderr (Exc_Info (1 .. Exc_Info_Last));
+ end if;
+
+ Unhandled_Terminate;
+end Ada.Exceptions.Last_Chance_Handler;
diff --git a/gcc/ada/5ztiitho.adb b/gcc/ada/a-elchha.ads
index f5c60043dee..7efbe0f5558 100644
--- a/gcc/ada/5ztiitho.adb
+++ b/gcc/ada/a-elchha.ads
@@ -1,13 +1,16 @@
------------------------------------------------------------------------------
-- --
--- GNAT COMPILER COMPONENTS --
+-- GNAT RUN-TIME COMPONENTS --
-- --
--- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . --
--- I N I T I A L I Z E _ T A S K _ H O O K S --
+-- A D A . E X C E P T I O N S . L A S T _ C H A N C E _ H A N D L E R --
-- --
--- B o d y --
+-- S p e c --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- --
+-- This specification is derived from the Ada Reference Manual for use with --
+-- GNAT. The copyright notice above, and the license provisions that follow --
+-- apply solely to the contents of the part following the private keyword. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -32,21 +35,12 @@
-- --
------------------------------------------------------------------------------
--- This is the VxWorks 5.5 version of this procedure
-
-separate (System.Threads.Initialization)
-
-procedure Initialize_Task_Hooks is
-
- type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS;
-
- procedure taskCreateHookAdd (createHookFunction : FUNCPTR);
- pragma Import (C, taskCreateHookAdd, "taskCreateHookAdd");
+-- Last chance handler. Unhandled exceptions are passed to this
+-- routine.
- Result : OSI.STATUS;
-begin
- taskCreateHookAdd (Register'Access);
- -- Register the environment task
- Result := Register (OSI.taskIdSelf);
- pragma Assert (Result /= -1);
-end Initialize_Task_Hooks;
+procedure Ada.Exceptions.Last_Chance_Handler
+ (Except : Exception_Occurrence);
+pragma Export (C,
+ Last_Chance_Handler,
+ "__gnat_last_chance_handler");
+pragma No_Return (Last_Chance_Handler);
diff --git a/gcc/ada/a-except.adb b/gcc/ada/a-except.adb
index d6a6f5ff3c6..cf12af818c7 100644
--- a/gcc/ada/a-except.adb
+++ b/gcc/ada/a-except.adb
@@ -859,6 +859,8 @@ package body Ada.Exceptions is
-------------------------
procedure Raise_Current_Excep (E : Exception_Id) is
+ pragma Inspection_Point (E);
+ -- This is so the debugger can reliably inspect the parameter
begin
Process_Raise_Exception (E => E, From_Signal_Handler => False);
end Raise_Current_Excep;
diff --git a/gcc/ada/a-exexda.adb b/gcc/ada/a-exexda.adb
index b88d643092f..214d5348ca3 100644
--- a/gcc/ada/a-exexda.adb
+++ b/gcc/ada/a-exexda.adb
@@ -41,9 +41,8 @@ package body Exception_Data is
-----------------------
function Address_Image (A : System.Address) return String;
- -- Returns at string of the form 0xhhhhhhhhh for 32-bit addresses
- -- or 0xhhhhhhhhhhhhhhhh for 64-bit addresses. Hex characters are
- -- in lower case.
+ -- Returns at string of the form 0xhhhhhhhhh for an address, with
+ -- leading zeros suppressed. Hex characters a-f are in lower case.
procedure Append_Info_Nat
(N : Natural;
@@ -66,22 +65,19 @@ package body Exception_Data is
-- we then use three intermediate functions :
function Basic_Exception_Information
- (X : Exception_Occurrence)
- return String;
+ (X : Exception_Occurrence) return String;
-- Returns the basic exception information string associated with a
-- given exception occurrence. This is the common part shared by both
-- Exception_Information and Tailored_Exception_Infomation.
function Basic_Exception_Traceback
- (X : Exception_Occurrence)
- return String;
+ (X : Exception_Occurrence) return String;
-- Returns an image of the complete call chain associated with an
-- exception occurence in its most basic form, that is as a raw sequence
-- of hexadecimal binary addresses.
function Tailored_Exception_Traceback
- (X : Exception_Occurrence)
- return String;
+ (X : Exception_Occurrence) return String;
-- Returns an image of the complete call chain associated with an
-- exception occurrence, either in its basic form if no decorator is
-- in place, or as formatted by the decorator otherwise.
@@ -121,10 +117,11 @@ package body Exception_Data is
begin
P := S'Last;
N := To_Integer (A);
- while N /= 0 loop
+ loop
S (P) := H (Integer (N mod 16));
P := P - 1;
N := N / 16;
+ exit when N = 0;
end loop;
S (P - 1) := '0';
@@ -184,8 +181,7 @@ package body Exception_Data is
---------------------------------
function Basic_Exception_Information
- (X : Exception_Occurrence)
- return String
+ (X : Exception_Occurrence) return String
is
Name : constant String := Exception_Name (X);
Msg : constant String := Exception_Message (X);
@@ -251,8 +247,7 @@ package body Exception_Data is
-------------------------------
function Basic_Exception_Traceback
- (X : Exception_Occurrence)
- return String
+ (X : Exception_Occurrence) return String
is
Info_Maxlen : constant Natural := 35 + X.Num_Tracebacks * 19;
-- Maximum length of the information string we are building, with :
@@ -460,8 +455,7 @@ package body Exception_Data is
----------------------------------
function Tailored_Exception_Traceback
- (X : Exception_Occurrence)
- return String
+ (X : Exception_Occurrence) return String
is
-- We indeed reference the decorator *wrapper* from here and not the
-- decorator itself. The purpose of the local variable Wrapper is to
@@ -491,8 +485,7 @@ package body Exception_Data is
------------------------------------
function Tailored_Exception_Information
- (X : Exception_Occurrence)
- return String
+ (X : Exception_Occurrence) return String
is
-- The tailored exception information is simply the basic information
-- associated with the tailored call chain backtrace.
diff --git a/gcc/ada/a-exextr.adb b/gcc/ada/a-exextr.adb
index 0ddb2934885..938f04b06e6 100644
--- a/gcc/ada/a-exextr.adb
+++ b/gcc/ada/a-exextr.adb
@@ -33,6 +33,11 @@
with Unchecked_Conversion;
+pragma Warnings (Off);
+with Ada.Exceptions.Last_Chance_Handler;
+pragma Warnings (On);
+-- Bring last chance handler into closure
+
separate (Ada.Exceptions)
package body Exception_Traces is
@@ -50,6 +55,14 @@ package body Exception_Traces is
pragma Export
(Ada, Raise_Hook_Initialized, "__gnat_exception_actions_initialized");
+ procedure Last_Chance_Handler
+ (Except : Exception_Occurrence);
+ pragma Import
+ (C, Last_Chance_Handler, "__gnat_last_chance_handler");
+ pragma No_Return (Last_Chance_Handler);
+ -- Users can replace the default version of this routine,
+ -- Ada.Exceptions.Last_Chance_Handler.
+
function To_Action is new Unchecked_Conversion
(Raise_Action, Exception_Action);
@@ -95,11 +108,6 @@ package body Exception_Traces is
pragma Propagate_Exceptions;
- procedure Unhandled_Terminate;
- pragma No_Return (Unhandled_Terminate);
- pragma Import (C, Unhandled_Terminate, "__gnat_unhandled_terminate");
- -- Perform system dependent shutdown code
-
----------------------
-- Notify_Exception --
----------------------
@@ -186,89 +194,8 @@ package body Exception_Traces is
-- could be overwritten if an exception is raised during finalization
-- (even if that exception is caught).
- Msg : constant String := Excep.Msg (1 .. Excep.Msg_Length);
-
- Max_Static_Exc_Info : constant := 1024;
- -- That should be enough for most exception information cases
- -- eventhough tailorising introduces some uncertainty. the
- -- name+message should not exceed 320 chars, so that leaves at
- -- least 35 backtrace slots (each slot needs 19 chars for
- -- representing a 64 bit address).
- -- And what happens on overflow ???
-
- subtype Exc_Info_Type is String (1 .. Max_Static_Exc_Info);
- type Str_Ptr is access Exc_Info_Type;
- Exc_Info : Str_Ptr;
- Exc_Info_Last : Natural := 0;
- -- Buffer that is allocated to store the tailored exception
- -- information while Adafinal is run. This buffer is allocated
- -- on the heap only when it is needed. It is better to allocate
- -- on the heap than on the stack since stack overflows are more
- -- common that heap overflows.
-
- -- Start of processing for Unhandled_Exception_Terminate
-
begin
- -- First allocate & store the exception info in a buffer when
- -- we know it will be needed. This needs to be done before
- -- Adafinal because it implicitly uses the secondary stack.
-
- if Excep.Id.Full_Name.all (1) /= '_'
- and then Excep.Num_Tracebacks /= 0
- then
- Exc_Info := new Exc_Info_Type;
- if Exc_Info /= null then
- Tailored_Exception_Information
- (Excep.all, Exc_Info.all, Exc_Info_Last);
- end if;
- end if;
-
- -- Let's shutdown the runtime now. The rest of the procedure
- -- needs to be careful not to use anything that would require
- -- runtime support. In particular, function returing strings
- -- are banned since the sec stack is not functional anymore
-
- System.Standard_Library.Adafinal;
-
- -- Check for special case of raising _ABORT_SIGNAL, which is not
- -- really an exception at all. We recognize this by the fact that
- -- it is the only exception whose name starts with underscore.
-
- if Excep.Id.Full_Name.all (1) = '_' then
- To_Stderr (Nline);
- To_Stderr ("Execution terminated by abort of environment task");
- To_Stderr (Nline);
-
- -- If no tracebacks, we print the unhandled exception in the old style
- -- (i.e. the style used before ZCX was implemented). We do this to
- -- retain compatibility, especially with the nightly scripts, but
- -- this can be removed at some point ???
-
- elsif Excep.Num_Tracebacks = 0 then
- To_Stderr (Nline);
- To_Stderr ("raised ");
- To_Stderr (Excep.Id.Full_Name.all (1 .. Excep.Id.Name_Length - 1));
-
- if Msg'Length /= 0 then
- To_Stderr (" : ");
- To_Stderr (Msg);
- end if;
-
- To_Stderr (Nline);
-
- else
- -- Traceback exists
-
- -- Note we can have this whole information output twice if
- -- this occurrence gets reraised up to here.
-
- To_Stderr (Nline);
- To_Stderr ("Execution terminated by unhandled exception");
- To_Stderr (Nline);
- To_Stderr (Exc_Info (1 .. Exc_Info_Last));
- end if;
-
- Unhandled_Terminate;
+ Last_Chance_Handler (Excep.all);
end Unhandled_Exception_Terminate;
---------------
diff --git a/gcc/ada/a-sequio.adb b/gcc/ada/a-sequio.adb
index 90b543a7b03..7218763a5a4 100644
--- a/gcc/ada/a-sequio.adb
+++ b/gcc/ada/a-sequio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -38,6 +38,7 @@
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System;
+with System.CRTL;
with System.File_Control_Block;
with System.File_IO;
with System.Storage_Elements;
@@ -58,6 +59,8 @@ package body Ada.Sequential_IO is
function To_FCB is new Unchecked_Conversion (File_Mode, FCB.File_Mode);
function To_SIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
+ use type System.CRTL.size_t;
+
-----------
-- Close --
-----------
diff --git a/gcc/ada/a-ststio.adb b/gcc/ada/a-ststio.adb
index 8df6a379ba9..2d5db6196fc 100644
--- a/gcc/ada/a-ststio.adb
+++ b/gcc/ada/a-ststio.adb
@@ -35,6 +35,7 @@ with Interfaces.C_Streams; use Interfaces.C_Streams;
with System; use System;
with System.File_IO;
with System.Soft_Links;
+with System.CRTL;
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -382,8 +383,11 @@ package body Ada.Streams.Stream_IO is
------------------
procedure Set_Position (File : in File_Type) is
+ use type System.CRTL.long;
begin
- if fseek (File.Stream, long (File.Index) - 1, SEEK_SET) /= 0 then
+ if fseek (File.Stream,
+ System.CRTL.long (File.Index) - 1, SEEK_SET) /= 0
+ then
raise Use_Error;
end if;
end Set_Position;
diff --git a/gcc/ada/a-textio.adb b/gcc/ada/a-textio.adb
index b61ebd3c80a..98766ce9bf3 100644
--- a/gcc/ada/a-textio.adb
+++ b/gcc/ada/a-textio.adb
@@ -35,6 +35,7 @@ with Ada.Streams; use Ada.Streams;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System;
with System.File_IO;
+with System.CRTL;
with Unchecked_Conversion;
with Unchecked_Deallocation;
@@ -51,6 +52,8 @@ package body Ada.Text_IO is
function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
use type FCB.File_Mode;
+ use type System.CRTL.size_t;
+
-------------------
-- AFCB_Allocate --
-------------------
diff --git a/gcc/ada/a-tiinau.adb b/gcc/ada/a-tiinau.adb
index f9d7ce0052a..03977710a50 100644
--- a/gcc/ada/a-tiinau.adb
+++ b/gcc/ada/a-tiinau.adb
@@ -167,6 +167,9 @@ package body Ada.Text_IO.Integer_Aux is
Load_Digits (File, Buf, Ptr, Loaded);
if Loaded then
+
+ -- Deal with based literal (note : is ok replacement for #)
+
Load (File, Buf, Ptr, '#', ':', Loaded);
if Loaded then
@@ -175,6 +178,8 @@ package body Ada.Text_IO.Integer_Aux is
Load (File, Buf, Ptr, Buf (Hash_Loc));
end if;
+ -- Deal with exponent
+
Load (File, Buf, Ptr, 'E', 'e', Loaded);
if Loaded then
diff --git a/gcc/ada/a-witeio.adb b/gcc/ada/a-witeio.adb
index 50b1202796d..621f4bd30ff 100644
--- a/gcc/ada/a-witeio.adb
+++ b/gcc/ada/a-witeio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -36,6 +36,7 @@ with Ada.Streams; use Ada.Streams;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System;
+with System.CRTL;
with System.File_IO;
with System.WCh_Cnv; use System.WCh_Cnv;
with System.WCh_Con; use System.WCh_Con;
@@ -55,6 +56,8 @@ package body Ada.Wide_Text_IO is
function To_TIO is new Unchecked_Conversion (FCB.File_Mode, File_Mode);
use type FCB.File_Mode;
+ use type System.CRTL.size_t;
+
WC_Encoding : Character;
pragma Import (C, WC_Encoding, "__gl_wc_encoding");
diff --git a/gcc/ada/ada-tree.def b/gcc/ada/ada-tree.def
index 9b3b1cdf9bd..08a69acd21f 100644
--- a/gcc/ada/ada-tree.def
+++ b/gcc/ada/ada-tree.def
@@ -37,7 +37,7 @@ DEFTREECODE (TRANSFORM_EXPR, "transform_expr", 'e', 0)
by operand 0 at the alignment given by operand 1 and return the
address of the resulting memory. */
-DEFTREECODE (ALLOCATE_EXPR, "allocate_expr", 's', 2)
+DEFTREECODE (ALLOCATE_EXPR, "allocate_expr", '2', 2)
/* A type that is an unconstrained array itself. This node is never passed
to GCC. TREE_TYPE is the type of the fat pointer and TYPE_OBJECT_RECORD_TYPE
@@ -77,3 +77,11 @@ DEFTREECODE (GNAT_NOP_EXPR, "gnat_nop_expr", '1', 1)
??? This should be redone at some point. */
DEFTREECODE (GNAT_LOOP_ID, "gnat_loop_id", 'x', 0)
+
+/* Here are the tree codes for the statement types known to Ada. These
+ must be at the end of this file to allow IS_STMT to work.
+
+ We start with an expression statement, whose only operand is an
+ expression, EXPR_STMT_EXPR, Execution of the statement means evaluation of
+ the expression (such as a MODIFY_EXPR) and discarding its result. */
+DEFTREECODE (EXPR_STMT, "expr_stmt_expr", 's', 1)
diff --git a/gcc/ada/ada-tree.h b/gcc/ada/ada-tree.h
index 9f1675a2c23..d7767e274e4 100644
--- a/gcc/ada/ada-tree.h
+++ b/gcc/ada/ada-tree.h
@@ -72,10 +72,14 @@ struct lang_type GTY(())
#define TYPE_FAT_POINTER_P(NODE) \
(TREE_CODE (NODE) == RECORD_TYPE && TYPE_IS_FAT_POINTER_P (NODE))
-/* For integral types, nonzero if this is a packed array type. Such
- types should not be extended to a larger size. */
+/* For integral types and array types, nonzero if this is a packed array type.
+ Such types should not be extended to a larger size. */
#define TYPE_PACKED_ARRAY_TYPE_P(NODE) TYPE_LANG_FLAG_0 (NODE)
+#define TYPE_IS_PACKED_ARRAY_TYPE_P(NODE) \
+ ((TREE_CODE (NODE) == INTEGER_TYPE || TREE_CODE (NODE) == ARRAY_TYPE) \
+ && TYPE_PACKED_ARRAY_TYPE_P (NODE))
+
/* For INTEGER_TYPE, nonzero if this is a modular type with a modulus that
is not equal to two to the power of its mode's size. */
#define TYPE_MODULAR_P(NODE) TYPE_LANG_FLAG_1 (INTEGER_TYPE_CHECK (NODE))
@@ -174,14 +178,14 @@ struct lang_type GTY(())
#define TYPE_INDEX_TYPE(NODE) \
(&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
#define SET_TYPE_INDEX_TYPE(NODE, X) \
- (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(X))
+ (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *) (X))
/* For an INTEGER_TYPE with TYPE_VAX_FLOATING_POINT_P, stores the
Digits_Value. */
-#define TYPE_DIGITS_VALUE(NODE) \
- ((long) TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)))
+#define TYPE_DIGITS_VALUE(NODE) \
+ (&TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE))->t.generic)
#define SET_TYPE_DIGITS_VALUE(NODE, X) \
- (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *)(size_t)(X))
+ (TYPE_LANG_SPECIFIC (INTEGER_TYPE_CHECK (NODE)) = (struct lang_type *) (X))
/* For INTEGER_TYPE, stores the RM_Size of the type. */
#define TYPE_RM_SIZE_INT(NODE) TYPE_VALUES (INTEGER_TYPE_CHECK (NODE))
@@ -271,7 +275,17 @@ struct lang_type GTY(())
discriminant number. */
#define DECL_DISCRIMINANT_NUMBER(NODE) DECL_INITIAL (FIELD_DECL_CHECK (NODE))
-/* This is a horrible kludge to store the loop_id of a loop into a tree
- node. We need to find some other place to store it! */
+/* This is the loop id for a GNAT_LOOP_ID node. */
#define TREE_LOOP_ID(NODE) \
- (((union lang_tree_node *)TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id)
+ ((union lang_tree_node *) TREE_CHECK (NODE, GNAT_LOOP_ID))->loop_id.loop_id
+
+/* Define fields and macros for statements.
+
+ Start by defining which tree codes are used for statements. */
+#define IS_STMT(NODE) (TREE_CODE_CLASS (TREE_CODE (NODE)) == 's')
+
+/* We store the Sloc in statement nodes. */
+#define TREE_SLOC(NODE) TREE_COMPLEXITY (STMT_CHECK (NODE))
+
+/* There is just one field in an EXPR_STMT: the expression. */
+#define EXPR_STMT_EXPR(NODE) TREE_OPERAND_CHECK_CODE (NODE, EXPR_STMT, 0)
diff --git a/gcc/ada/adadecode.c b/gcc/ada/adadecode.c
index 928b838ab19..fe0253ee09f 100644
--- a/gcc/ada/adadecode.c
+++ b/gcc/ada/adadecode.c
@@ -35,15 +35,16 @@
#include "system.h"
#else
#include <stdio.h>
+#include <ctype.h>
+#define ISDIGIT(c) isdigit(c)
#define PARMS(ARGS) ARGS
#endif
-#include "ctype.h"
#include "adadecode.h"
-static void add_verbose PARAMS ((const char *, char *));
-static int has_prefix PARAMS ((const char *, const char *));
-static int has_suffix PARAMS ((const char *, const char *));
+static void add_verbose (const char *, char *);
+static int has_prefix (const char *, const char *);
+static int has_suffix (const char *, const char *);
/* This is a safe version of strcpy that can be used with overlapped
pointers. Does nothing if s2 <= s1. */
@@ -55,9 +56,7 @@ static int verbose_info;
/* Add TEXT to end of ADA_NAME, putting a leading " (" or ", ", depending
on VERBOSE_INFO. */
-static void add_verbose (text, ada_name)
- const char *text;
- char *ada_name;
+static void add_verbose (const char *text, char *ada_name)
{
strcat (ada_name, verbose_info ? ", " : " (");
strcat (ada_name, text);
@@ -68,9 +67,7 @@ static void add_verbose (text, ada_name)
/* Returns 1 if NAME starts with PREFIX. */
static int
-has_prefix (name, prefix)
- const char *name;
- const char *prefix;
+has_prefix (const char *name, const char *prefix)
{
return strncmp (name, prefix, strlen (prefix)) == 0;
}
@@ -78,9 +75,7 @@ has_prefix (name, prefix)
/* Returns 1 if NAME ends with SUFFIX. */
static int
-has_suffix (name, suffix)
- const char *name;
- const char *suffix;
+has_suffix (const char *name, const char *suffix)
{
int nlen = strlen (name);
int slen = strlen (suffix);
@@ -147,10 +142,7 @@ ostrcpy (char *s1, char *s2)
x__Oexpon "**" */
void
-__gnat_decode (coded_name, ada_name, verbose)
- const char *coded_name;
- char *ada_name;
- int verbose;
+__gnat_decode (const char *coded_name, char *ada_name, int verbose)
{
int lib_subprog = 0;
int overloaded = 0;
@@ -216,7 +208,7 @@ __gnat_decode (coded_name, ada_name, verbose)
int n_digits = 0;
if (len > 1)
- while (isdigit ((int) ada_name[(int) len - 1 - n_digits]))
+ while (ISDIGIT ((int) ada_name[(int) len - 1 - n_digits]))
n_digits++;
/* Check if we have $ or __ before digits. */
@@ -322,8 +314,7 @@ __gnat_decode (coded_name, ada_name, verbose)
}
char *
-ada_demangle (coded_name)
- const char *coded_name;
+ada_demangle (const char *coded_name)
{
char ada_name[2048];
diff --git a/gcc/ada/adaint.c b/gcc/ada/adaint.c
index c5a1cddced6..b7130d8fbb1 100644
--- a/gcc/ada/adaint.c
+++ b/gcc/ada/adaint.c
@@ -50,6 +50,10 @@
#endif /* VxWorks */
+#ifdef VMS
+#define _POSIX_EXIT 1
+#endif
+
#ifdef IN_RTS
#include "tconfig.h"
#include "tsystem.h"
@@ -57,6 +61,9 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
+#ifdef VMS
+#include <unixio.h>
+#endif
/* We don't have libiberty, so use malloc. */
#define xmalloc(S) malloc (S)
@@ -425,7 +432,7 @@ __gnat_try_lock (char *dir, char *file)
/* Return the maximum file name length. */
int
-__gnat_get_maximum_file_name_length ()
+__gnat_get_maximum_file_name_length (void)
{
#if defined (MSDOS)
return 8;
@@ -442,7 +449,7 @@ __gnat_get_maximum_file_name_length ()
/* Return nonzero if file names are case sensitive. */
int
-__gnat_get_file_names_case_sensitive ()
+__gnat_get_file_names_case_sensitive (void)
{
#if defined (__EMX__) || defined (MSDOS) || defined (VMS) || defined (WINNT)
return 0;
@@ -452,7 +459,7 @@ __gnat_get_file_names_case_sensitive ()
}
char
-__gnat_get_default_identifier_character_set ()
+__gnat_get_default_identifier_character_set (void)
{
#if defined (__EMX__) || defined (MSDOS)
return 'p';
@@ -660,7 +667,7 @@ __gnat_open_new_temp (char *path, int fmode)
strcpy (path, "GNAT-XXXXXX");
-#if defined (linux) && !defined (__vxworks)
+#if (defined (__FreeBSD__) || defined (linux)) && !defined (__vxworks)
return mkstemp (path);
#elif defined (__Lynx__)
mktemp (path);
@@ -735,7 +742,7 @@ __gnat_tmp_name (char *tmp_filename)
free (pname);
}
-#elif defined (linux)
+#elif defined (linux) || defined (__FreeBSD__)
#define MAX_SAFE_PATH 1000
char *tmpdir = getenv ("TMPDIR");
@@ -782,7 +789,7 @@ __gnat_readdir (DIR *dirp, char *buffer)
/* Returns 1 if readdir is thread safe, 0 otherwise. */
int
-__gnat_readdir_is_thread_safe ()
+__gnat_readdir_is_thread_safe (void)
{
#ifdef HAVE_READDIR_R
return 1;
@@ -1270,7 +1277,7 @@ __gnat_set_env_value (char *name, char *value)
key. */
char *
-__gnat_get_libraries_from_registry ()
+__gnat_get_libraries_from_registry (void)
{
char *result = (char *) "";
@@ -1332,7 +1339,10 @@ __gnat_stat (char *name, struct stat *statbuf)
terminated by a directory separator except if just after a drive name. */
int name_len = strlen (name);
char last_char = name[name_len - 1];
- char win32_name[4096];
+ char win32_name[GNAT_MAX_PATH_LEN + 2];
+
+ if (name_len > GNAT_MAX_PATH_LEN)
+ return -1;
strcpy (win32_name, name);
@@ -1463,8 +1473,13 @@ __gnat_is_symbolic_link (char *name ATTRIBUTE_UNUSED)
#ifdef VMS
/* Defined in VMS header files. */
+#if defined (__ALPHA)
+#define fork() (decc$$alloc_vfork_blocks() >= 0 ? \
+ LIB$GET_CURRENT_INVO_CONTEXT (decc$$get_vfork_jmpbuf()) : -1)
+#elif defined (__IA64)
#define fork() (decc$$alloc_vfork_blocks() >= 0 ? \
- LIB$GET_CURRENT_INVO_CONTEXT (decc$$get_vfork_jmpbuf()) : -1)
+ LIB$I64_GET_CURR_INVO_CONTEXT(decc$$get_vfork_jmpbuf()) : -1)
+#endif
#endif
#if defined (sun) && defined (__SVR4)
@@ -1816,12 +1831,7 @@ __gnat_waitpid (int pid)
void
__gnat_os_exit (int status)
{
-#ifdef VMS
- /* Exit without changing 0 to 1. */
- __posix_exit (status);
-#else
exit (status);
-#endif
}
/* Locate a regular file, give a Path value. */
@@ -2299,13 +2309,13 @@ __gnat_to_canonical_file_list_init
}
char *
-__gnat_to_canonical_file_list_next ()
+__gnat_to_canonical_file_list_next (void)
{
return (char *) "";
}
void
-__gnat_to_canonical_file_list_free ()
+__gnat_to_canonical_file_list_free (void)
{
}
@@ -2340,7 +2350,7 @@ __gnat_to_host_file_spec (char *filespec)
}
void
-__gnat_adjust_os_resource_limits ()
+__gnat_adjust_os_resource_limits (void)
{
}
@@ -2455,14 +2465,15 @@ __gnat_copy_attribs (char *from, char *to, int mode)
extern void __gnat_install_locks (void (*) (void), void (*) (void));
/* This function offers a hook for libgnarl to set the
- locking subprograms for libgcc_eh. */
+ locking subprograms for libgcc_eh.
+ This is only needed on OpenVMS, since other platforms use standard
+ --enable-threads=posix option, or similar. */
void
-__gnatlib_install_locks (lock, unlock)
- void (*lock) (void) ATTRIBUTE_UNUSED;
- void (*unlock) (void) ATTRIBUTE_UNUSED;
+__gnatlib_install_locks (void (*lock) (void) ATTRIBUTE_UNUSED,
+ void (*unlock) (void) ATTRIBUTE_UNUSED)
{
-#ifdef IN_RTS
+#if defined (IN_RTS) && defined (VMS)
__gnat_install_locks (lock, unlock);
/* There is a bootstrap path issue if adaint is build with this
symbol unresolved for the stage1 compiler. Since the compiler
@@ -2470,3 +2481,9 @@ __gnatlib_install_locks (lock, unlock)
a no-op in this case. */
#endif
}
+
+int
+__gnat_lseek (int fd, long offset, int whence)
+{
+ return (int) lseek (fd, offset, whence);
+}
diff --git a/gcc/ada/adaint.h b/gcc/ada/adaint.h
index 5ce5d68ba2d..33c2bdcba95 100644
--- a/gcc/ada/adaint.h
+++ b/gcc/ada/adaint.h
@@ -140,6 +140,7 @@ extern int __gnat_expect_poll (int *, int, int, int *);
extern void __gnat_set_binary_mode (int);
extern void __gnat_set_text_mode (int);
extern char *__gnat_ttyname (int);
+extern int __gnat_lseek (int, long, int);
#ifdef __MINGW32__
extern void __gnat_plist_init (void);
diff --git a/gcc/ada/argv.c b/gcc/ada/argv.c
index d0ba12d9ee5..4f78ac21198 100644
--- a/gcc/ada/argv.c
+++ b/gcc/ada/argv.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2002 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -71,28 +71,25 @@ const char **gnat_envp = (const char **) 0;
#endif
int
-__gnat_arg_count ()
+__gnat_arg_count (void)
{
return gnat_argc;
}
int
-__gnat_len_arg (arg_num)
- int arg_num;
+__gnat_len_arg (int arg_num)
{
return strlen (gnat_argv[arg_num]);
}
void
-__gnat_fill_arg (a, i)
- char *a;
- int i;
+__gnat_fill_arg (char *a, int i)
{
strncpy (a, gnat_argv[i], strlen(gnat_argv[i]));
}
int
-__gnat_env_count ()
+__gnat_env_count (void)
{
int i;
@@ -102,16 +99,13 @@ __gnat_env_count ()
}
int
-__gnat_len_env (env_num)
- int env_num;
+__gnat_len_env (int env_num)
{
return strlen (gnat_envp[env_num]);
}
void
-__gnat_fill_env (a, i)
- char *a;
- int i;
+__gnat_fill_env (char *a, int i)
{
strncpy (a, gnat_envp[i], strlen (gnat_envp[i]));
}
diff --git a/gcc/ada/atree.adb b/gcc/ada/atree.adb
index e27a63fa445..65d2056da31 100644
--- a/gcc/ada/atree.adb
+++ b/gcc/ada/atree.adb
@@ -347,6 +347,35 @@ package body Atree is
Table_Increment => Alloc.Orig_Nodes_Increment,
Table_Name => "Orig_Nodes");
+ ----------------------------------------
+ -- Global_Variables for New_Copy_Tree --
+ ----------------------------------------
+
+ -- These global variables are used by New_Copy_Tree. See description
+ -- of the body of this subprogram for details. Global variables can be
+ -- safely used by New_Copy_Tree, since there is no case of a recursive
+ -- call from the processing inside New_Copy_Tree.
+
+ NCT_Hash_Threshhold : constant := 20;
+ -- If there are more than this number of pairs of entries in the
+ -- map, then Hash_Tables_Used will be set, and the hash tables will
+ -- be initialized and used for the searches.
+
+ NCT_Hash_Tables_Used : Boolean := False;
+ -- Set to True if hash tables are in use
+
+ NCT_Table_Entries : Nat;
+ -- Count entries in table to see if threshhold is reached
+
+ NCT_Hash_Table_Setup : Boolean := False;
+ -- Set to True if hash table contains data. We set this True if we
+ -- setup the hash table with data, and leave it set permanently
+ -- from then on, this is a signal that second and subsequent users
+ -- of the hash table must clear the old entries before reuse.
+
+ subtype NCT_Header_Num is Int range 0 .. 511;
+ -- Defines range of headers in hash tables (512 headers)
+
-----------------------
-- Local Subprograms --
-----------------------
@@ -838,6 +867,7 @@ package body Atree is
pragma Warnings (Off, Dummy);
begin
+ Node_Count := 0;
Atree_Private_Part.Nodes.Init;
Orig_Nodes.Init;
@@ -852,6 +882,11 @@ package body Atree is
Dummy := New_Node (N_Error, No_Location);
Set_Name1 (Error, Error_Name);
Set_Error_Posted (Error, True);
+
+ -- Set global variables for New_Copy_Tree:
+ NCT_Hash_Tables_Used := False;
+ NCT_Table_Entries := 0;
+ NCT_Hash_Table_Setup := False;
end Initialize;
--------------------------
@@ -958,29 +993,6 @@ package body Atree is
-- (because setting up a hash table for only a few entries takes
-- more time than it saves.
- -- Global variables are safe for this purpose, since there is no case
- -- of a recursive call from the processing inside New_Copy_Tree.
-
- NCT_Hash_Threshhold : constant := 20;
- -- If there are more than this number of pairs of entries in the
- -- map, then Hash_Tables_Used will be set, and the hash tables will
- -- be initialized and used for the searches.
-
- NCT_Hash_Tables_Used : Boolean := False;
- -- Set to True if hash tables are in use
-
- NCT_Table_Entries : Nat;
- -- Count entries in table to see if threshhold is reached
-
- NCT_Hash_Table_Setup : Boolean := False;
- -- Set to True if hash table contains data. We set this True if we
- -- setup the hash table with data, and leave it set permanently
- -- from then on, this is a signal that second and subsequent users
- -- of the hash table must clear the old entries before reuse.
-
- subtype NCT_Header_Num is Int range 0 .. 511;
- -- Defines range of headers in hash tables (512 headers)
-
function New_Copy_Hash (E : Entity_Id) return NCT_Header_Num;
-- Hash function used for hash operations
diff --git a/gcc/ada/aux-io.c b/gcc/ada/aux-io.c
index 8185f2e033b..3ff9f3ed0f8 100644
--- a/gcc/ada/aux-io.c
+++ b/gcc/ada/aux-io.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -43,29 +43,29 @@
/* Function wrappers are needed to access the values from Ada which are
defined as C macros. */
-FILE *c_stdin PARAMS ((void));
-FILE *c_stdout PARAMS ((void));
-FILE *c_stderr PARAMS ((void));
-int seek_set_function PARAMS ((void));
-int seek_end_function PARAMS ((void));
-void *null_function PARAMS ((void));
-int c_fileno PARAMS ((FILE *));
+FILE *c_stdin (void);
+FILE *c_stdout (void);
+FILE *c_stderr (void);
+int seek_set_function (void);
+int seek_end_function (void);
+void *null_function (void);
+int c_fileno (FILE *);
FILE *
-c_stdin ()
-{
- return stdin;
+c_stdin (void)
+{
+ return stdin;
}
FILE *
-c_stdout ()
-{
+c_stdout (void)
+{
return stdout;
}
FILE *
-c_stderr ()
-{
+c_stderr (void)
+{
return stderr;
}
@@ -75,26 +75,25 @@ c_stderr ()
#define SEEK_END 2 /* Set file pointer to the size of the file plus offset */
#endif
-int
-seek_set_function ()
-{
- return SEEK_SET;
+int
+seek_set_function (void)
+{
+ return SEEK_SET;
}
-int
-seek_end_function ()
-{
- return SEEK_END;
+int
+seek_end_function (void)
+{
+ return SEEK_END;
}
-void *null_function ()
-{
- return NULL;
+void *null_function (void)
+{
+ return NULL;
}
-int
-c_fileno (s)
- FILE *s;
-{
- return fileno (s);
+int
+c_fileno (FILE *s)
+{
+ return fileno (s);
}
diff --git a/gcc/ada/back_end.adb b/gcc/ada/back_end.adb
index 5725f9eca21..ede3f8b2097 100644
--- a/gcc/ada/back_end.adb
+++ b/gcc/ada/back_end.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -270,6 +270,12 @@ package body Back_End is
Opt.No_Stdinc := True;
Scan_Back_End_Switches (Argv);
+ -- We must recognize -nostdlib to suppress visibility on the
+ -- standard GNAT RTL objects.
+
+ elsif Argv (Argv'First + 1 .. Argv'Last) = "nostdlib" then
+ Opt.No_Stdlib := True;
+
elsif Is_Front_End_Switch (Argv) then
Scan_Front_End_Switches (Argv);
diff --git a/gcc/ada/bindgen.adb b/gcc/ada/bindgen.adb
index 8db6a302ef0..56b2915ef6f 100644
--- a/gcc/ada/bindgen.adb
+++ b/gcc/ada/bindgen.adb
@@ -1774,22 +1774,18 @@ package body Bindgen is
end if;
end loop;
- -- Add a "-Ldir" for each directory in the object path. We skip this
- -- in Configurable_Run_Time mode, where we want more precise control
- -- of exactly what goes into the resulting object file
+ -- Add a "-Ldir" for each directory in the object path
- if not Configurable_Run_Time_Mode then
- for J in 1 .. Nb_Dir_In_Obj_Search_Path loop
- declare
- Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J);
- begin
- Name_Len := 0;
- Add_Str_To_Name_Buffer ("-L");
- Add_Str_To_Name_Buffer (Dir.all);
- Write_Linker_Option;
- end;
- end loop;
- end if;
+ for J in 1 .. Nb_Dir_In_Obj_Search_Path loop
+ declare
+ Dir : constant String_Ptr := Dir_In_Obj_Search_Path (J);
+ begin
+ Name_Len := 0;
+ Add_Str_To_Name_Buffer ("-L");
+ Add_Str_To_Name_Buffer (Dir.all);
+ Write_Linker_Option;
+ end;
+ end loop;
-- Sort linker options
@@ -1845,7 +1841,7 @@ package body Bindgen is
-- files. The reason for this decision is that libraries referenced
-- by internal routines may reference these standard library entries.
- if not (Configurable_Run_Time_Mode or else Opt.No_Stdlib) then
+ if not Opt.No_Stdlib then
Name_Len := 0;
if Opt.Shared_Libgnat then
@@ -1894,8 +1890,7 @@ package body Bindgen is
---------------------
procedure Gen_Output_File (Filename : String) is
- Public_Version : constant Boolean := Gnat_Version_Type = "PUBLIC ";
- -- Set true if this is the public version of GNAT
+ Is_Public_Version : constant Boolean := Get_Gnat_Build_Type = Public;
begin
-- Acquire settings for Interrupt_State pragmas
@@ -1929,7 +1924,7 @@ package body Bindgen is
-- Get the time stamp of the former bind for public version warning
- if Public_Version then
+ if Is_Public_Version then
Record_Time_From_Last_Bind;
end if;
@@ -1944,7 +1939,7 @@ package body Bindgen is
-- Periodically issue a warning when the public version is used on
-- big projects
- if Public_Version then
+ if Is_Public_Version then
Public_Version_Warning;
end if;
end Gen_Output_File;
diff --git a/gcc/ada/bld-io.adb b/gcc/ada/bld-io.adb
index 51c14cbc7ef..7bd01e6ac6d 100644
--- a/gcc/ada/bld-io.adb
+++ b/gcc/ada/bld-io.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002 Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -132,6 +132,7 @@ package body Bld.IO is
-----------
procedure Flush is
+ Last : Natural;
begin
if Lines (Current).Length /= 0 then
Osint.Fail ("INTERNAL ERROR: flushing before end of line: """ &
@@ -141,7 +142,18 @@ package body Bld.IO is
for J in 1 .. Current - 1 loop
if not Lines (J).Suppressed then
- Text_IO.Put_Line (File, Lines (J).Value (1 .. Lines (J).Length));
+ Last := Lines (J).Length;
+
+ -- The last character of a line cannot be a back slash ('\'),
+ -- otherwise make has a problem. The only real place were it
+ -- should happen is for directory names on Windows, and then
+ -- this terminal back slash is not needed.
+
+ if Last > 0 and then Lines (J).Value (Last) = '\' then
+ Last := Last - 1;
+ end if;
+
+ Text_IO.Put_Line (File, Lines (J).Value (1 .. Last));
end if;
end loop;
diff --git a/gcc/ada/bld.adb b/gcc/ada/bld.adb
index 07add38e2e0..492f205ec61 100644
--- a/gcc/ada/bld.adb
+++ b/gcc/ada/bld.adb
@@ -1559,9 +1559,9 @@ package body Bld is
Put ("src.list_file:=" &
"$(strip $(shell gprcmd to_absolute $(");
Put (Project_Name);
- Put (".base_dir) $(");
+ Put (".base_dir) '$(");
Put_Attribute (Project, Pkg, Item_Name, No_Name);
- Put_Line (")))");
+ Put_Line (")'))");
if In_Case then
if Source_List_File_Declaration = False then
@@ -1595,9 +1595,9 @@ package body Bld is
Put (".obj_dir:=" &
"$(strip $(shell gprcmd to_absolute $(");
Put (Project_Name);
- Put (".base_dir) $(");
+ Put (".base_dir) '$(");
Put_Attribute (Project, Pkg, Item_Name, No_Name);
- Put_Line (")))");
+ Put_Line (")'))");
elsif Item_Name = Snames.Name_Exec_Dir then
@@ -1611,9 +1611,9 @@ package body Bld is
Put ("EXEC_DIR:=" &
"$(strip $(shell gprcmd to_absolute $(");
Put (Project_Name);
- Put (".base_dir) $(");
+ Put (".base_dir) '$(");
Put_Attribute (Project, Pkg, Item_Name, No_Name);
- Put_Line (")))");
+ Put_Line (")'))");
elsif Item_Name = Snames.Name_Main then
@@ -2595,6 +2595,25 @@ package body Bld is
-- Include some utility functions and saved all reserved
-- env. vars. by including Makefile.prolog.
+ New_Line;
+
+ -- First, if MAKE_ROOT is not defined, try to get GNAT prefix
+
+ Put (" ifeq ($(");
+ Put (MAKE_ROOT);
+ Put ("),)");
+ New_Line;
+
+ Put (" MAKE_ROOT=$(shell gprcmd prefix)");
+ New_Line;
+
+ Put (" endif");
+ New_Line;
+
+ New_Line;
+
+ -- If MAKE_ROOT is still not defined, then fail
+
Put (" ifeq ($(");
Put (MAKE_ROOT);
Put ("),)");
diff --git a/gcc/ada/cal.c b/gcc/ada/cal.c
index 31d39834afc..8f8930e24eb 100644
--- a/gcc/ada/cal.c
+++ b/gcc/ada/cal.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2002, Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003, Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -94,7 +94,7 @@ __gnat_duration_to_timeval (long sec, long usec, struct timeval *t)
what time_t is on the target. */
long
-gnat_time ()
+gnat_time (void)
{
return time (0);
}
diff --git a/gcc/ada/checks.adb b/gcc/ada/checks.adb
index 04a4c048d75..2adb5f73ba2 100644
--- a/gcc/ada/checks.adb
+++ b/gcc/ada/checks.adb
@@ -1183,6 +1183,26 @@ package body Checks is
if No (DconS) then
return;
end if;
+
+ -- A further optimization: if T_Typ is derived from S_Typ
+ -- without imposing a constraint, no check is needed.
+
+ if Nkind (Original_Node (Parent (T_Typ))) =
+ N_Full_Type_Declaration
+ then
+ declare
+ Type_Def : Node_Id :=
+ Type_Definition
+ (Original_Node (Parent (T_Typ)));
+ begin
+ if Nkind (Type_Def) = N_Derived_Type_Definition
+ and then Is_Entity_Name (Subtype_Indication (Type_Def))
+ and then Entity (Subtype_Indication (Type_Def)) = S_Typ
+ then
+ return;
+ end if;
+ end;
+ end if;
end if;
DconT := First_Elmt (Discriminant_Constraint (T_Typ));
@@ -4758,13 +4778,16 @@ package body Checks is
-- At the library level, we need to ensure that the
-- type of the object is elaborated before the check
- -- itself is emitted.
+ -- itself is emitted. This is only done if the object
+ -- is in the current compilation unit, otherwise the
+ -- type is frozen and elaborated in its unit.
if Is_Itype (Exptyp)
and then
Ekind (Cunit_Entity (Current_Sem_Unit)) = E_Package
and then
not In_Package_Body (Cunit_Entity (Current_Sem_Unit))
+ and then In_Open_Scopes (Scope (Exptyp))
then
Ref_Node := Make_Itype_Reference (Sloc (Ck_Node));
Set_Itype (Ref_Node, Exptyp);
diff --git a/gcc/ada/cio.c b/gcc/ada/cio.c
index 1316455c86a..8e4c7cba596 100644
--- a/gcc/ada/cio.c
+++ b/gcc/ada/cio.c
@@ -52,7 +52,7 @@
#endif
int
-get_char ()
+get_char (void)
{
#ifdef VMS
return decc$getchar();
@@ -62,7 +62,7 @@ get_char ()
}
int
-get_int ()
+get_int (void)
{
int x;
@@ -71,8 +71,7 @@ get_int ()
}
void
-put_int (x)
- int x;
+put_int (int x)
{
/* Use fprintf rather than printf, since the latter is unbuffered
on vxworks */
@@ -80,22 +79,19 @@ put_int (x)
}
void
-put_int_stderr (x)
- int x;
+put_int_stderr (int x)
{
fprintf (stderr, "%d", x);
}
void
-put_char (c)
- int c;
+put_char (int c)
{
putchar (c);
}
void
-put_char_stderr (c)
- int c;
+put_char_stderr (int c)
{
fputc (c, stderr);
}
@@ -103,8 +99,7 @@ put_char_stderr (c)
#ifdef __vxworks
char *
-mktemp (template)
- char *template;
+mktemp (char *template)
{
return tmpnam (NULL);
}
diff --git a/gcc/ada/comperr.adb b/gcc/ada/comperr.adb
index ecc0f855294..69302f77171 100644
--- a/gcc/ada/comperr.adb
+++ b/gcc/ada/comperr.adb
@@ -80,12 +80,6 @@ package body Comperr is
-- the FSF version of GNAT, but there are specializations for
-- the GNATPRO and Public releases by Ada Core Technologies.
- Public_Version : constant Boolean := Gnat_Version_Type = "PUBLIC ";
- -- Set True for the public version of GNAT
-
- GNATPRO_Version : constant Boolean := Gnat_Version_Type = "GNATPRO";
- -- Set True for the GNATPRO version of GNAT
-
procedure End_Line;
-- Add blanks up to column 76, and then a final vertical bar
@@ -99,6 +93,9 @@ package body Comperr is
Write_Eol;
end End_Line;
+ Is_Public_Version : constant Boolean := Get_Gnat_Build_Type = Public;
+ Is_FSF_Version : constant Boolean := Get_Gnat_Build_Type = FSF;
+
-- Start of processing for Compiler_Abort
begin
@@ -264,7 +261,13 @@ package body Comperr is
-- Otherwise we use the standard fixed text
else
- if Public_Version or GNATPRO_Version then
+ if Is_FSF_Version then
+ Write_Str
+ ("| Please submit a bug report; see" &
+ " http://gcc.gnu.org/bugs.html.");
+ End_Line;
+
+ else
Write_Str
("| Please submit bug report by email " &
"to report@gnat.com.");
@@ -274,15 +277,9 @@ package body Comperr is
("| Use a subject line meaningful to you" &
" and us to track the bug.");
End_Line;
-
- else
- Write_Str
- ("| Please submit a bug report; see" &
- " http://gcc.gnu.org/bugs.html.");
- End_Line;
end if;
- if GNATPRO_Version then
+ if not (Is_Public_Version or Is_FSF_Version) then
Write_Str
("| (include your customer number #nnn " &
"in the subject line).");
@@ -307,7 +304,7 @@ package body Comperr is
("| (concatenated together with no headers between files).");
End_Line;
- if Public_Version then
+ if Is_Public_Version then
Write_Str
("| (use plain ASCII or MIME attachment).");
End_Line;
@@ -317,7 +314,7 @@ package body Comperr is
"for submitting bugs.");
End_Line;
- elsif GNATPRO_Version then
+ elsif not Is_FSF_Version then
Write_Str
("| (use plain ASCII or MIME attachment, or FTP "
& "to your customer directory).");
diff --git a/gcc/ada/cstand.adb b/gcc/ada/cstand.adb
index 93b84a86f27..c79d6027f4b 100644
--- a/gcc/ada/cstand.adb
+++ b/gcc/ada/cstand.adb
@@ -33,10 +33,12 @@ with Namet; use Namet;
with Nlists; use Nlists;
with Nmake; use Nmake;
with Opt; use Opt;
+with Output; use Output;
with Targparm; use Targparm;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
with Ttypef; use Ttypef;
+with Scn;
with Sem_Mech; use Sem_Mech;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
@@ -102,8 +104,7 @@ package body CStand is
function Make_Formal
(Typ : Entity_Id;
- Formal_Name : String)
- return Entity_Id;
+ Formal_Name : String) return Entity_Id;
-- Construct entity for subprogram formal with given name and type
function Make_Integer (V : Uint) return Node_Id;
@@ -116,10 +117,12 @@ package body CStand is
-- Build entity for standard operator with given name and type.
function New_Standard_Entity
- (New_Node_Kind : Node_Kind := N_Defining_Identifier)
- return Entity_Id;
+ (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id;
-- Builds a new entity for Standard
+ procedure Print_Standard;
+ -- Print representation of package Standard if switch set
+
procedure Set_Integer_Bounds
(Id : Entity_Id;
Typ : Entity_Id;
@@ -255,10 +258,10 @@ package body CStand is
-- by Initialize_Standard in the semantics module.
procedure Create_Standard is
- Decl_S : List_Id;
+ Decl_S : List_Id := New_List;
-- List of declarations in Standard
- Decl_A : List_Id;
+ Decl_A : List_Id := New_List;
-- List of declarations in ASCII
Decl : Node_Id;
@@ -293,7 +296,9 @@ package body CStand is
-- Start of processing for Create_Standard
begin
- Decl_S := New_List;
+ -- Initialize scanner for internal scans of literals
+
+ Scn.Initialize_Scanner (No_Unit, Internal_Source_File);
-- First step is to create defining identifiers for each entity
@@ -410,7 +415,6 @@ package body CStand is
declare
LIS : Nat;
-
begin
if Debug_Flag_M then
LIS := 64;
@@ -653,7 +657,6 @@ package body CStand is
Set_Defining_Unit_Name (Pspec, Standard_Entity (S_ASCII));
Set_Ekind (Standard_Entity (S_ASCII), E_Package);
- Decl_A := New_List; -- for ASCII declarations
Set_Visible_Declarations (Pspec, Decl_A);
-- Create control character definitions in package ASCII. Note that
@@ -787,6 +790,18 @@ package body CStand is
Set_Prim_Alignment (Any_Access);
Make_Name (Any_Access, "an access type");
+ Any_Character := New_Standard_Entity;
+ Set_Ekind (Any_Character, E_Enumeration_Type);
+ Set_Scope (Any_Character, Standard_Standard);
+ Set_Etype (Any_Character, Any_Character);
+ Set_Is_Unsigned_Type (Any_Character);
+ Set_Is_Character_Type (Any_Character);
+ Init_Esize (Any_Character, Standard_Character_Size);
+ Init_RM_Size (Any_Character, 8);
+ Set_Prim_Alignment (Any_Character);
+ Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character));
+ Make_Name (Any_Character, "a character type");
+
Any_Array := New_Standard_Entity;
Set_Ekind (Any_Array, E_String_Type);
Set_Scope (Any_Array, Standard_Standard);
@@ -806,18 +821,6 @@ package body CStand is
Set_Scalar_Range (Any_Boolean, Scalar_Range (Standard_Boolean));
Make_Name (Any_Boolean, "a boolean type");
- Any_Character := New_Standard_Entity;
- Set_Ekind (Any_Character, E_Enumeration_Type);
- Set_Scope (Any_Character, Standard_Standard);
- Set_Etype (Any_Character, Any_Character);
- Set_Is_Unsigned_Type (Any_Character);
- Set_Is_Character_Type (Any_Character);
- Init_Esize (Any_Character, Standard_Character_Size);
- Init_RM_Size (Any_Character, 8);
- Set_Prim_Alignment (Any_Character);
- Set_Scalar_Range (Any_Character, Scalar_Range (Standard_Character));
- Make_Name (Any_Character, "a character type");
-
Any_Composite := New_Standard_Entity;
Set_Ekind (Any_Composite, E_Array_Type);
Set_Scope (Any_Composite, Standard_Standard);
@@ -1004,9 +1007,9 @@ package body CStand is
-- delta and size values depend on the mode set in system.ads.
Build_Duration : declare
- Dlo : Uint;
- Dhi : Uint;
- Delta_Val : Ureal;
+ Dlo : Uint;
+ Dhi : Uint;
+ Delta_Val : Ureal;
begin
-- In 32 bit mode, the size is 32 bits, and the delta and
@@ -1026,18 +1029,16 @@ package body CStand is
Delta_Val := UR_From_Components (Uint_1, Uint_9, 10);
end if;
- Decl :=
- Make_Full_Type_Declaration (Stloc,
- Defining_Identifier => Standard_Duration,
- Type_Definition =>
- Make_Ordinary_Fixed_Point_Definition (Stloc,
+ Tdef_Node := Make_Ordinary_Fixed_Point_Definition (Stloc,
Delta_Expression => Make_Real_Literal (Stloc, Delta_Val),
Real_Range_Specification =>
Make_Real_Range_Specification (Stloc,
Low_Bound => Make_Real_Literal (Stloc,
Realval => Dlo * Delta_Val),
High_Bound => Make_Real_Literal (Stloc,
- Realval => Dhi * Delta_Val))));
+ Realval => Dhi * Delta_Val)));
+
+ Set_Type_Definition (Parent (Standard_Duration), Tdef_Node);
Set_Ekind (Standard_Duration, E_Ordinary_Fixed_Point_Type);
Set_Etype (Standard_Duration, Standard_Duration);
@@ -1053,7 +1054,7 @@ package body CStand is
Set_Small_Value (Standard_Duration, Delta_Val);
Set_Scalar_Range (Standard_Duration,
Real_Range_Specification
- (Type_Definition (Decl)));
+ (Type_Definition (Parent (Standard_Duration))));
-- Normally it does not matter that nodes in package Standard are
-- not marked as analyzed. The Scalar_Range of the fixed-point
@@ -1243,6 +1244,12 @@ package body CStand is
-- The Error node has an Etype of Any_Type to help error recovery
Set_Etype (Error, Any_Type);
+
+ -- Print representation of standard if switch set
+
+ if Opt.Print_Standard then
+ Print_Standard;
+ end if;
end Create_Standard;
------------------------------------
@@ -1314,8 +1321,7 @@ package body CStand is
function Make_Formal
(Typ : Entity_Id;
- Formal_Name : String)
- return Entity_Id
+ Formal_Name : String) return Entity_Id
is
Formal : Entity_Id;
@@ -1337,7 +1343,6 @@ package body CStand is
function Make_Integer (V : Uint) return Node_Id is
N : constant Node_Id := Make_Integer_Literal (Stloc, V);
-
begin
Set_Is_Static_Expression (N);
return N;
@@ -1387,8 +1392,7 @@ package body CStand is
-------------------------
function New_Standard_Entity
- (New_Node_Kind : Node_Kind := N_Defining_Identifier)
- return Entity_Id
+ (New_Node_Kind : Node_Kind := N_Defining_Identifier) return Entity_Id
is
E : constant Entity_Id := New_Entity (New_Node_Kind, Stloc);
@@ -1417,6 +1421,249 @@ package body CStand is
return E;
end New_Standard_Entity;
+ --------------------
+ -- Print_Standard --
+ --------------------
+
+ procedure Print_Standard is
+
+ procedure P (Item : String) renames Output.Write_Line;
+ -- Short-hand, since we do a lot of line writes here!
+
+ procedure P_Int_Range (Size : Pos);
+ -- Prints the range of an integer based on its Size
+
+ procedure P_Float_Range (Id : Entity_Id);
+ -- Prints the bounds range for the given float type entity
+
+ -------------------
+ -- P_Float_Range --
+ -------------------
+
+ procedure P_Float_Range (Id : Entity_Id) is
+ Digs : constant Nat := UI_To_Int (Digits_Value (Id));
+
+ begin
+ Write_Str (" range ");
+
+ if Vax_Float (Id) then
+ if Digs = VAXFF_Digits then
+ Write_Str (VAXFF_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (VAXFF_Last'Universal_Literal_String);
+
+ elsif Digs = VAXDF_Digits then
+ Write_Str (VAXDF_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (VAXDF_Last'Universal_Literal_String);
+
+ else
+ pragma Assert (Digs = VAXGF_Digits);
+
+ Write_Str (VAXGF_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (VAXGF_Last'Universal_Literal_String);
+ end if;
+
+ elsif Is_AAMP_Float (Id) then
+ if Digs = AAMPS_Digits then
+ Write_Str (AAMPS_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (AAMPS_Last'Universal_Literal_String);
+
+ else
+ pragma Assert (Digs = AAMPL_Digits);
+ Write_Str (AAMPL_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (AAMPL_Last'Universal_Literal_String);
+ end if;
+
+ elsif Digs = IEEES_Digits then
+ Write_Str (IEEES_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (IEEES_Last'Universal_Literal_String);
+
+
+ elsif Digs = IEEEL_Digits then
+ Write_Str (IEEEL_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (IEEEL_Last'Universal_Literal_String);
+
+ else
+ pragma Assert (Digs = IEEEX_Digits);
+
+ Write_Str (IEEEX_First'Universal_Literal_String);
+ Write_Str (" .. ");
+ Write_Str (IEEEX_Last'Universal_Literal_String);
+ end if;
+
+ Write_Str (";");
+ Write_Eol;
+ end P_Float_Range;
+
+ -----------------
+ -- P_Int_Range --
+ -----------------
+
+ procedure P_Int_Range (Size : Pos) is
+ begin
+ Write_Str (" is range -(2 **");
+ Write_Int (Size - 1);
+ Write_Str (")");
+ Write_Str (" .. +(2 **");
+ Write_Int (Size - 1);
+ Write_Str (" - 1);");
+ Write_Eol;
+ end P_Int_Range;
+
+ -- Start of processing for Print_Standard
+
+ begin
+ P ("-- Representation of package Standard");
+ Write_Eol;
+ P ("-- This is not accurate Ada, since new base types cannot be ");
+ P ("-- created, but the listing shows the target dependent");
+ P ("-- characteristics of the Standard types for this compiler");
+ Write_Eol;
+
+ P ("package Standard is");
+ P ("pragma Pure(Standard);");
+ Write_Eol;
+
+ P (" type Boolean is (False, True);");
+ P (" for Boolean'Size use 1;");
+ P (" for Boolean use (False => 0, True => 1);");
+ Write_Eol;
+
+ -- Integer types
+
+ Write_Str (" type Integer");
+ P_Int_Range (Standard_Integer_Size);
+ Write_Str (" for Integer'Size use ");
+ Write_Int (Standard_Integer_Size);
+ P (";");
+ Write_Eol;
+
+ P (" subtype Natural is Integer range 0 .. Integer'Last;");
+ P (" subtype Positive is Integer range 1 .. Integer'Last;");
+ Write_Eol;
+
+ Write_Str (" type Short_Short_Integer");
+ P_Int_Range (Standard_Short_Short_Integer_Size);
+ Write_Str (" for Short_Short_Integer'Size use ");
+ Write_Int (Standard_Short_Short_Integer_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Short_Integer");
+ P_Int_Range (Standard_Short_Integer_Size);
+ Write_Str (" for Short_Integer'Size use ");
+ Write_Int (Standard_Short_Integer_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Long_Integer");
+ P_Int_Range (Standard_Long_Integer_Size);
+ Write_Str (" for Long_Integer'Size use ");
+ Write_Int (Standard_Long_Integer_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Long_Long_Integer");
+ P_Int_Range (Standard_Long_Long_Integer_Size);
+ Write_Str (" for Long_Long_Integer'Size use ");
+ Write_Int (Standard_Long_Long_Integer_Size);
+ P (";");
+ Write_Eol;
+
+ -- Floating point types
+
+ Write_Str (" type Short_Float is digits ");
+ Write_Int (Standard_Short_Float_Digits);
+ Write_Eol;
+ P_Float_Range (Standard_Short_Float);
+ Write_Str (" for Short_Float'Size use ");
+ Write_Int (Standard_Short_Float_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Float is digits ");
+ Write_Int (Standard_Float_Digits);
+ Write_Eol;
+ P_Float_Range (Standard_Float);
+ Write_Str (" for Float'Size use ");
+ Write_Int (Standard_Float_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Long_Float is digits ");
+ Write_Int (Standard_Long_Float_Digits);
+ Write_Eol;
+ P_Float_Range (Standard_Long_Float);
+ Write_Str (" for Long_Float'Size use ");
+ Write_Int (Standard_Long_Float_Size);
+ P (";");
+ Write_Eol;
+
+ Write_Str (" type Long_Long_Float is digits ");
+ Write_Int (Standard_Long_Long_Float_Digits);
+ Write_Eol;
+ P_Float_Range (Standard_Long_Long_Float);
+ Write_Str (" for Long_Long_Float'Size use ");
+ Write_Int (Standard_Long_Long_Float_Size);
+ P (";");
+ Write_Eol;
+
+ P (" type Character is (...)");
+ Write_Str (" for Character'Size use ");
+ Write_Int (Standard_Character_Size);
+ P (";");
+ P (" -- See RM A.1(35) for details of this type");
+ Write_Eol;
+
+ P (" type Wide_Character is (...)");
+ Write_Str (" for Wide_Character'Size use ");
+ Write_Int (Standard_Wide_Character_Size);
+ P (";");
+ P (" -- See RM A.1(36) for details of this type");
+ Write_Eol;
+
+ P (" type String is array (Positive range <>) of Character;");
+ P (" pragma Pack (String);");
+ Write_Eol;
+
+ P (" type Wide_String is array (Positive range <>)" &
+ " of Wide_Character;");
+ P (" pragma Pack (Wide_String);");
+ Write_Eol;
+
+ -- Here it's OK to use the Duration type of the host compiler since
+ -- the implementation of Duration in GNAT is target independent.
+
+ if Duration_32_Bits_On_Target then
+ P (" type Duration is delta 0.020");
+ P (" range -((2 ** 31 - 1) * 0.020) ..");
+ P (" +((2 ** 31 - 1) * 0.020);");
+ P (" for Duration'Small use 0.020;");
+ else
+ P (" type Duration is delta 0.000000001");
+ P (" range -((2 ** 63 - 1) * 0.000000001) ..");
+ P (" +((2 ** 63 - 1) * 0.000000001);");
+ P (" for Duration'Small use 0.000000001;");
+ end if;
+
+ Write_Eol;
+
+ P (" Constraint_Error : exception;");
+ P (" Program_Error : exception;");
+ P (" Storage_Error : exception;");
+ P (" Tasking_Error : exception;");
+ P (" Numeric_Error : exception renames Constraint_Error;");
+ Write_Eol;
+
+ P ("end Standard;");
+ end Print_Standard;
+
----------------------
-- Set_Float_Bounds --
----------------------
diff --git a/gcc/ada/cstreams.c b/gcc/ada/cstreams.c
index f56cfff44bd..7001f847b57 100644
--- a/gcc/ada/cstreams.c
+++ b/gcc/ada/cstreams.c
@@ -76,29 +76,25 @@
#endif
int
-__gnat_feof (stream)
- FILE *stream;
+__gnat_feof (FILE *stream)
{
return (feof (stream));
}
int
-__gnat_ferror (stream)
- FILE *stream;
+__gnat_ferror (FILE *stream)
{
return (ferror (stream));
}
int
-__gnat_fileno (stream)
- FILE *stream;
+__gnat_fileno (FILE *stream)
{
return (fileno (stream));
}
int
-__gnat_is_regular_file_fd (fd)
- int fd;
+__gnat_is_regular_file_fd (int fd)
{
int ret;
struct stat statbuf;
@@ -179,9 +175,9 @@ __gnat_full_name (char *nam, char *buffer)
#elif defined (MSDOS)
_fixpath (nam, buffer);
-#elif defined (sgi)
+#elif defined (sgi) || defined (__FreeBSD__)
- /* Use realpath function which resolves links and references to .. and ..
+ /* Use realpath function which resolves links and references to . and ..
on those Unix systems that support it. Note that GNU/Linux provides it but
cannot handle more than 5 symbolic links in a full name, so we use the
getcwd approach instead. */
diff --git a/gcc/ada/ctrl_c.c b/gcc/ada/ctrl_c.c
index 22d00667275..20dd8811007 100644
--- a/gcc/ada/ctrl_c.c
+++ b/gcc/ada/ctrl_c.c
@@ -132,7 +132,7 @@ __gnat_install_int_handler (void (*proc) (void))
}
void
-__gnat_uninstall_int_handler ()
+__gnat_uninstall_int_handler (void)
{
if (sigint_intercepted != NULL)
SetConsoleCtrlHandler (__gnat_int_handler, FALSE);
@@ -150,7 +150,7 @@ __gnat_install_int_handler (void (*proc) (void) __attribute__ ((unused)))
}
void
-__gnat_uninstall_int_handler ()
+__gnat_uninstall_int_handler (void)
{
}
#endif
diff --git a/gcc/ada/cuintp.c b/gcc/ada/cuintp.c
index 80ed5b588bf..f83f5184ee6 100644
--- a/gcc/ada/cuintp.c
+++ b/gcc/ada/cuintp.c
@@ -57,14 +57,12 @@
resulting node. */
tree
-UI_To_gnu (Input, type)
- Uint Input;
- tree type;
+UI_To_gnu (Uint Input, tree type)
{
tree gnu_ret;
if (Input <= Uint_Direct_Last)
- gnu_ret = convert (type, build_int_2 (Input - Uint_Direct_Bias,
+ gnu_ret = convert (type, build_int_2 (Input - Uint_Direct_Bias,
Input < Uint_Direct_Bias ? -1 : 0));
else
{
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 09ec0dccd49..3c6a67f5ac0 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -338,7 +338,9 @@ package body Debug is
-- dz Print source of package Standard. Normally the source print out
-- does not include package Standard, even if the -df switch is set.
-- This switch forces output of the source recreated from the internal
- -- tree built for Standard.
+ -- tree built for Standard. Note that this differs from -gnatS in
+ -- that it prints from the actual tree using the normal Sprint
+ -- circuitry for printing trees.
-- dA Forces output of representation information, including full
-- information for all internal type and object entities, as well
diff --git a/gcc/ada/decl.c b/gcc/ada/decl.c
index bbad5b50e46..85bd27bf274 100644
--- a/gcc/ada/decl.c
+++ b/gcc/ada/decl.c
@@ -82,42 +82,34 @@ static struct incomplete
Entity_Id full_type;
} *defer_incomplete_list = 0;
-static tree substitution_list PARAMS ((Entity_Id, Entity_Id,
- tree, int));
-static int allocatable_size_p PARAMS ((tree, int));
-static struct attrib *build_attr_list PARAMS ((Entity_Id));
-static tree elaborate_expression PARAMS ((Node_Id, Entity_Id, tree,
- int, int, int));
-static int is_variable_size PARAMS ((tree));
-static tree elaborate_expression_1 PARAMS ((Node_Id, Entity_Id, tree,
- tree, int, int));
-static tree make_packable_type PARAMS ((tree));
-static tree maybe_pad_type PARAMS ((tree, tree, unsigned int,
- Entity_Id, const char *, int,
- int, int));
-static tree gnat_to_gnu_field PARAMS ((Entity_Id, tree, int, int));
-static void components_to_record PARAMS ((tree, Node_Id, tree, int,
- int, tree *, int, int));
-static int compare_field_bitpos PARAMS ((const PTR, const PTR));
-static Uint annotate_value PARAMS ((tree));
-static void annotate_rep PARAMS ((Entity_Id, tree));
-static tree compute_field_positions PARAMS ((tree, tree, tree, tree,
- unsigned int));
-static tree validate_size PARAMS ((Uint, tree, Entity_Id,
- enum tree_code, int, int));
-static void set_rm_size PARAMS ((Uint, tree, Entity_Id));
-static tree make_type_from_size PARAMS ((tree, tree, int));
-static unsigned int validate_alignment PARAMS ((Uint, Entity_Id,
- unsigned int));
-static void check_ok_for_atomic PARAMS ((tree, Entity_Id, int));
+static tree substitution_list (Entity_Id, Entity_Id, tree, int);
+static int allocatable_size_p (tree, int);
+static struct attrib *build_attr_list (Entity_Id);
+static tree elaborate_expression (Node_Id, Entity_Id, tree, int, int, int);
+static int is_variable_size (tree);
+static tree elaborate_expression_1 (Node_Id, Entity_Id, tree, tree, int, int);
+static tree make_packable_type (tree);
+static tree maybe_pad_type (tree, tree, unsigned int, Entity_Id, const char *,
+ int, int, int);
+static tree gnat_to_gnu_field (Entity_Id, tree, int, int);
+static void components_to_record (tree, Node_Id, tree, int, int, tree *,
+ int, int);
+static int compare_field_bitpos (const PTR, const PTR);
+static Uint annotate_value (tree);
+static void annotate_rep (Entity_Id, tree);
+static tree compute_field_positions (tree, tree, tree, tree, unsigned int);
+static tree validate_size (Uint, tree, Entity_Id, enum tree_code, int, int);
+static void set_rm_size (Uint, tree, Entity_Id);
+static tree make_type_from_size (tree, tree, int);
+static unsigned int validate_alignment (Uint, Entity_Id, unsigned int);
+static void check_ok_for_atomic (tree, Entity_Id, int);
/* Given GNAT_ENTITY, an entity in the incoming GNAT tree, return a
GCC type corresponding to that entity. GNAT_ENTITY is assumed to
refer to an Ada type. */
tree
-gnat_to_gnu_type (gnat_entity)
- Entity_Id gnat_entity;
+gnat_to_gnu_type (Entity_Id gnat_entity)
{
tree gnu_decl;
@@ -146,10 +138,7 @@ gnat_to_gnu_type (gnat_entity)
the code. */
tree
-gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
- Entity_Id gnat_entity;
- tree gnu_expr;
- int definition;
+gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, int definition)
{
tree gnu_entity_id;
tree gnu_type = 0;
@@ -177,7 +166,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
&& UI_Is_In_Int_Range (Esize (gnat_entity)))
? MIN (UI_To_Int (Esize (gnat_entity)),
IN (kind, Float_Kind)
- ? LONG_DOUBLE_TYPE_SIZE
+ ? fp_prec_to_size (LONG_DOUBLE_TYPE_SIZE)
: IN (kind, Access_Kind) ? POINTER_SIZE * 2
: LONG_LONG_TYPE_SIZE)
: LONG_LONG_TYPE_SIZE);
@@ -946,7 +935,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
gnu_expr
= build_component_ref
(gnu_expr, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))));
+ TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (gnu_expr))), 0);
}
if (TREE_CODE (TYPE_SIZE_UNIT (gnu_alloc_type)) == INTEGER_CST
@@ -990,7 +979,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
(build_binary_op
(MODIFY_EXPR, NULL_TREE,
build_component_ref (gnu_new_var, NULL_TREE,
- TYPE_FIELDS (gnu_new_type)),
+ TYPE_FIELDS (gnu_new_type), 0),
gnu_expr));
gnu_type = build_reference_type (gnu_type);
@@ -998,7 +987,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
= build_unary_op
(ADDR_EXPR, gnu_type,
build_component_ref (gnu_new_var, NULL_TREE,
- TYPE_FIELDS (gnu_new_type)));
+ TYPE_FIELDS (gnu_new_type), 0));
gnu_size = 0;
used_by_ref = 1;
@@ -1348,14 +1337,15 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
gnu_type = make_signed_type (esize);
TYPE_VAX_FLOATING_POINT_P (gnu_type) = 1;
SET_TYPE_DIGITS_VALUE (gnu_type,
- UI_To_Int (Digits_Value (gnat_entity)));
+ UI_To_gnu (Digits_Value (gnat_entity),
+ sizetype));
break;
}
/* The type of the Low and High bounds can be our type if this is
a type from Standard, so set them at the end of the function. */
gnu_type = make_node (REAL_TYPE);
- TYPE_PRECISION (gnu_type) = esize;
+ TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize);
layout_type (gnu_type);
break;
@@ -1367,8 +1357,6 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
}
{
- enum machine_mode mode;
-
if (definition == 0
&& Present (Ancestor_Subtype (gnat_entity))
&& ! In_Extended_Main_Code_Unit (Ancestor_Subtype (gnat_entity))
@@ -1377,15 +1365,9 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
gnat_to_gnu_entity (Ancestor_Subtype (gnat_entity),
gnu_expr, definition);
- for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT);
- (GET_MODE_WIDER_MODE (mode) != VOIDmode
- && GET_MODE_BITSIZE (GET_MODE_WIDER_MODE (mode)) <= esize);
- mode = GET_MODE_WIDER_MODE (mode))
- ;
-
gnu_type = make_node (REAL_TYPE);
TREE_TYPE (gnu_type) = get_unpadded_type (Etype (gnat_entity));
- TYPE_PRECISION (gnu_type) = GET_MODE_BITSIZE (mode);
+ TYPE_PRECISION (gnu_type) = fp_size_to_prec (esize);
TYPE_MIN_VALUE (gnu_type)
= convert (TREE_TYPE (gnu_type),
@@ -1571,8 +1553,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
tem = gnat_to_gnu_type (Component_Type (gnat_entity));
/* Get and validate any specified Component_Size, but if Packed,
- ignore it since the front end will have taken care of it. Also,
- allow sizes not a multiple of Storage_Unit if packed. */
+ ignore it since the front end will have taken care of it. */
gnu_comp_size
= validate_size (Component_Size (gnat_entity), tem,
gnat_entity,
@@ -1895,8 +1876,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
}
/* Get and validate any specified Component_Size, but if Packed,
- ignore it since the front end will have taken care of it. Also,
- allow sizes not a multiple of Storage_Unit if packed. */
+ ignore it since the front end will have taken care of it. */
gnu_comp_size
= validate_size (Component_Size (gnat_entity), gnu_type,
gnat_entity,
@@ -2004,6 +1984,8 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
debug_no_type_hash = 0;
TYPE_CONVENTION_FORTRAN_P (gnu_type)
= (Convention (gnat_entity) == Convention_Fortran);
+ TYPE_PACKED_ARRAY_TYPE_P (gnu_type)
+ = Is_Packed_Array_Type (gnat_entity);
/* If our size depends on a placeholder and the maximum size doesn't
overflow, use it. */
@@ -3536,6 +3518,13 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
if (! global_bindings_p ())
pure_flag = 0;
+ /* A subprogram (something that doesn't return anything) shouldn't
+ be considered Pure since there would be no reason for such a
+ subprogram. Note that procedures with Out (or In Out) parameters
+ have already been converted into a function with a return type. */
+ if (TREE_CODE (gnu_return_type) == VOID_TYPE)
+ pure_flag = 0;
+
gnu_type
= build_qualified_type (gnu_type,
(TYPE_QUALS (gnu_type)
@@ -4030,8 +4019,7 @@ gnat_to_gnu_entity (gnat_entity, gnu_expr, definition)
be elaborated at the point of its definition, but do nothing else. */
void
-elaborate_entity (gnat_entity)
- Entity_Id gnat_entity;
+elaborate_entity (Entity_Id gnat_entity)
{
switch (Ekind (gnat_entity))
{
@@ -4102,8 +4090,7 @@ elaborate_entity (gnat_entity)
any entities on its entity chain similarly. */
void
-mark_out_of_scope (gnat_entity)
- Entity_Id gnat_entity;
+mark_out_of_scope (Entity_Id gnat_entity)
{
Entity_Id gnat_sub_entity;
unsigned int kind = Ekind (gnat_entity);
@@ -4146,11 +4133,10 @@ mark_out_of_scope (gnat_entity)
DEFINITION is as in gnat_to_gnu_entity. */
static tree
-substitution_list (gnat_subtype, gnat_type, gnu_list, definition)
- Entity_Id gnat_subtype;
- Entity_Id gnat_type;
- tree gnu_list;
- int definition;
+substitution_list (Entity_Id gnat_subtype,
+ Entity_Id gnat_type,
+ tree gnu_list,
+ int definition)
{
Entity_Id gnat_discrim;
Node_Id gnat_value;
@@ -4184,7 +4170,7 @@ static GTY((length ("max_gnat_nodes"))) tree * dummy_node_table;
/* Initialize the above table. */
void
-init_dummy_type ()
+init_dummy_type (void)
{
Node_Id gnat_node;
@@ -4199,8 +4185,7 @@ init_dummy_type ()
/* Make a dummy type corresponding to GNAT_TYPE. */
tree
-make_dummy_type (gnat_type)
- Entity_Id gnat_type;
+make_dummy_type (Entity_Id gnat_type)
{
Entity_Id gnat_underlying;
tree gnu_type;
@@ -4246,9 +4231,7 @@ make_dummy_type (gnat_type)
done with a static allocation. */
static int
-allocatable_size_p (gnu_size, static_p)
- tree gnu_size;
- int static_p;
+allocatable_size_p (tree gnu_size, int static_p)
{
HOST_WIDE_INT our_size;
@@ -4272,8 +4255,7 @@ allocatable_size_p (gnu_size, static_p)
/* Return a list of attributes for GNAT_ENTITY, if any. */
static struct attrib *
-build_attr_list (gnat_entity)
- Entity_Id gnat_entity;
+build_attr_list (Entity_Id gnat_entity)
{
struct attrib *attr_list = 0;
Node_Id gnat_temp;
@@ -4345,8 +4327,7 @@ build_attr_list (gnat_entity)
/* Get the unpadded version of a GNAT type. */
tree
-get_unpadded_type (gnat_entity)
- Entity_Id gnat_entity;
+get_unpadded_type (Entity_Id gnat_entity)
{
tree type = gnat_to_gnu_type (gnat_entity);
@@ -4359,9 +4340,7 @@ get_unpadded_type (gnat_entity)
/* Called when we need to protect a variable object using a save_expr. */
tree
-maybe_variable (gnu_operand, gnat_node)
- tree gnu_operand;
- Node_Id gnat_node;
+maybe_variable (tree gnu_operand, Node_Id gnat_node)
{
if (TREE_CONSTANT (gnu_operand) || TREE_READONLY (gnu_operand)
|| TREE_CODE (gnu_operand) == SAVE_EXPR
@@ -4390,14 +4369,12 @@ maybe_variable (gnu_operand, gnat_node)
purposes even if it isn't needed for code generation. */
static tree
-elaborate_expression (gnat_expr, gnat_entity, gnu_name, definition,
- need_value, need_debug)
- Node_Id gnat_expr;
- Entity_Id gnat_entity;
- tree gnu_name;
- int definition;
- int need_value;
- int need_debug;
+elaborate_expression (Node_Id gnat_expr,
+ Entity_Id gnat_entity,
+ tree gnu_name,
+ int definition,
+ int need_value,
+ int need_debug)
{
tree gnu_expr;
@@ -4432,14 +4409,12 @@ elaborate_expression (gnat_expr, gnat_entity, gnu_name, definition,
/* Similar, but take a GNU expression. */
static tree
-elaborate_expression_1 (gnat_expr, gnat_entity, gnu_expr, gnu_name, definition,
- need_debug)
- Node_Id gnat_expr;
- Entity_Id gnat_entity;
- tree gnu_expr;
- tree gnu_name;
- int definition;
- int need_debug;
+elaborate_expression_1 (Node_Id gnat_expr,
+ Entity_Id gnat_entity,
+ tree gnu_expr,
+ tree gnu_name,
+ int definition,
+ int need_debug)
{
tree gnu_decl = 0;
/* Strip any conversions to see if the expression is a readonly variable.
@@ -4507,10 +4482,7 @@ elaborate_expression_1 (gnat_expr, gnat_entity, gnu_expr, gnu_name, definition,
position so that it is aligned to ALIGN bits and is SIZE bytes long. */
tree
-make_aligning_type (type, align, size)
- tree type;
- int align;
- tree size;
+make_aligning_type (tree type, int align, tree size)
{
tree record_type = make_node (RECORD_TYPE);
tree place = build (PLACEHOLDER_EXPR, record_type);
@@ -4561,8 +4533,7 @@ make_aligning_type (type, align, size)
return the new type. If not, return the original type. */
static tree
-make_packable_type (type)
- tree type;
+make_packable_type (tree type)
{
tree new_type = make_node (TREE_CODE (type));
tree field_list = NULL_TREE;
@@ -4638,16 +4609,14 @@ make_packable_type (type)
type. */
static tree
-maybe_pad_type (type, size, align, gnat_entity, name_trailer,
- is_user_type, definition, same_rm_size)
- tree type;
- tree size;
- unsigned int align;
- Entity_Id gnat_entity;
- const char *name_trailer;
- int is_user_type;
- int definition;
- int same_rm_size;
+maybe_pad_type (tree type,
+ tree size,
+ unsigned int align,
+ Entity_Id gnat_entity,
+ const char *name_trailer,
+ int is_user_type,
+ int definition,
+ int same_rm_size)
{
tree orig_size = TYPE_SIZE (type);
tree record;
@@ -4823,9 +4792,7 @@ maybe_pad_type (type, size, align, gnat_entity, name_trailer,
the value passed against the list of choices. */
tree
-choices_to_gnu (operand, choices)
- tree operand;
- Node_Id choices;
+choices_to_gnu (tree operand, Node_Id choices)
{
Node_Id choice;
Node_Id gnat_temp;
@@ -4917,11 +4884,10 @@ choices_to_gnu (operand, choices)
DEFINITION is nonzero if this field is for a record being defined. */
static tree
-gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition)
- Entity_Id gnat_field;
- tree gnu_record_type;
- int packed;
- int definition;
+gnat_to_gnu_field (Entity_Id gnat_field,
+ tree gnu_record_type,
+ int packed,
+ int definition)
{
tree gnu_field_id = get_entity_name (gnat_field);
tree gnu_field_type = gnat_to_gnu_type (Etype (gnat_field));
@@ -4951,10 +4917,14 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition)
gnu_size = validate_size (Esize (gnat_field), gnu_field_type,
gnat_field, FIELD_DECL, 0, 1);
- /* If the field's type is a left-justified modular type, make the field
- the type of the inner object unless it is aliases. We don't need
- the the wrapper here and it can prevent packing. */
- if (! Is_Aliased (gnat_field) && TREE_CODE (gnu_field_type) == RECORD_TYPE
+ /* If the field's type is left-justified modular, the wrapper can prevent
+ packing so we make the field the type of the inner object unless the
+ situation forbids it. We may not do that when the field is addressable_p,
+ typically because in that case this field may later be passed by-ref for
+ a formal argument expecting the left justification. The condition below
+ is then matching the addressable_p code for COMPONENT_REF. */
+ if (! Is_Aliased (gnat_field) && flag_strict_aliasing
+ && TREE_CODE (gnu_field_type) == RECORD_TYPE
&& TYPE_LEFT_JUSTIFIED_MODULAR_P (gnu_field_type))
gnu_field_type = TREE_TYPE (TYPE_FIELDS (gnu_field_type));
@@ -5077,17 +5047,6 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition)
if (Is_Atomic (gnat_field))
check_ok_for_atomic (gnu_field_type, gnat_field, 0);
-
- if (gnu_pos != 0 && TYPE_MODE (gnu_field_type) == BLKmode
- && (! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_pos,
- bitsize_unit_node)))
- && TYPE_MODE (gnu_field_type) == BLKmode)
- {
- post_error_ne ("fields of& must start at storage unit boundary",
- First_Bit (Component_Clause (gnat_field)),
- Etype (gnat_field));
- gnu_pos = 0;
- }
}
/* If the record has rep clauses and this is the tag field, make a rep
@@ -5099,17 +5058,6 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition)
gnu_size = TYPE_SIZE (gnu_field_type);
}
- /* If a size is specified and this is a BLKmode field, it must be an
- integral number of bytes. */
- if (gnu_size != 0 && TYPE_MODE (gnu_field_type) == BLKmode
- && ! integer_zerop (size_binop (TRUNC_MOD_EXPR, gnu_size,
- bitsize_unit_node)))
- {
- post_error_ne ("size of fields of& must be multiple of a storage unit",
- gnat_field, Etype (gnat_field));
- gnu_pos = gnu_size = 0;
- }
-
/* We need to make the size the maximum for the type if it is
self-referential and an unconstrained type. In that case, we can't
pack the field since we can't make a copy to align it. */
@@ -5166,8 +5114,7 @@ gnat_to_gnu_field (gnat_field, gnu_record_type, packed, definition)
of variable size or is a record that has a field such a field. */
static int
-is_variable_size (type)
- tree type;
+is_variable_size (tree type)
{
tree field;
@@ -5222,16 +5169,14 @@ is_variable_size (type)
fields of the record and then the record type is finished. */
static void
-components_to_record (gnu_record_type, component_list, gnu_field_list, packed,
- definition, p_gnu_rep_list, cancel_alignment, all_rep)
- tree gnu_record_type;
- Node_Id component_list;
- tree gnu_field_list;
- int packed;
- int definition;
- tree *p_gnu_rep_list;
- int cancel_alignment;
- int all_rep;
+components_to_record (tree gnu_record_type,
+ Node_Id component_list,
+ tree gnu_field_list,
+ int packed,
+ int definition,
+ tree *p_gnu_rep_list,
+ int cancel_alignment,
+ int all_rep)
{
Node_Id component_decl;
Entity_Id gnat_field;
@@ -5371,11 +5316,11 @@ components_to_record (gnu_record_type, component_list, gnu_field_list, packed,
gnu_variant_list = gnu_field;
}
- /* We can delete any empty variants from the end. This may leave none
- left. Note we cannot delete variants from anywhere else. */
- while (gnu_variant_list != 0
- && TYPE_FIELDS (TREE_TYPE (gnu_variant_list)) == 0)
- gnu_variant_list = TREE_CHAIN (gnu_variant_list);
+ /* We use to delete the empty variants from the end. However,
+ we no longer do that because we need them to generate complete
+ debugging information for the variant record. Otherwise,
+ the union type definition will be missing the fields associated
+ to these empty variants. */
/* Only make the QUAL_UNION_TYPE if there are any non-empty variants. */
if (gnu_variant_list != 0)
@@ -5495,9 +5440,7 @@ components_to_record (gnu_record_type, component_list, gnu_field_list, packed,
bit positions and ordinals of the two fields. */
static int
-compare_field_bitpos (rt1, rt2)
- const PTR rt1;
- const PTR rt2;
+compare_field_bitpos (const PTR rt1, const PTR rt2)
{
tree *t1 = (tree *) rt1;
tree *t2 = (tree *) rt2;
@@ -5517,8 +5460,7 @@ compare_field_bitpos (rt1, rt2)
in the GNAT tree. */
static Uint
-annotate_value (gnu_size)
- tree gnu_size;
+annotate_value (tree gnu_size)
{
int len = TREE_CODE_LENGTH (TREE_CODE (gnu_size));
TCode tcode;
@@ -5656,9 +5598,7 @@ annotate_value (gnu_size)
used by Gigi. */
static void
-annotate_rep (gnat_entity, gnu_type)
- Entity_Id gnat_entity;
- tree gnu_type;
+annotate_rep (Entity_Id gnat_entity, tree gnu_type)
{
tree gnu_list;
tree gnu_entry;
@@ -5736,12 +5676,11 @@ annotate_rep (gnat_entity, gnu_type)
so far. */
static tree
-compute_field_positions (gnu_type, gnu_list, gnu_pos, gnu_bitpos, offset_align)
- tree gnu_type;
- tree gnu_list;
- tree gnu_pos;
- tree gnu_bitpos;
- unsigned int offset_align;
+compute_field_positions (tree gnu_type,
+ tree gnu_list,
+ tree gnu_pos,
+ tree gnu_bitpos,
+ unsigned int offset_align)
{
tree gnu_field;
tree gnu_result = gnu_list;
@@ -5785,13 +5724,12 @@ compute_field_positions (gnu_type, gnu_list, gnu_pos, gnu_bitpos, offset_align)
it means that a size of zero should be treated as an unspecified size. */
static tree
-validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok)
- Uint uint_size;
- tree gnu_type;
- Entity_Id gnat_object;
- enum tree_code kind;
- int component_p;
- int zero_ok;
+validate_size (Uint uint_size,
+ tree gnu_type,
+ Entity_Id gnat_object,
+ enum tree_code kind,
+ int component_p,
+ int zero_ok)
{
Node_Id gnat_error_node;
tree type_size
@@ -5808,11 +5746,6 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok)
else
gnat_error_node = gnat_object;
- /* Don't give errors on packed array types; we'll be giving the error on
- the type itself soon enough. */
- if (Is_Packed_Array_Type (gnat_object))
- gnat_error_node = Empty;
-
/* Return 0 if no size was specified, either because Esize was not Present or
the specified size was zero. */
if (No (uint_size) || uint_size == No_Uint)
@@ -5847,11 +5780,11 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok)
return 0;
}
- /* If this is an integral type, the front-end has verified the size, so we
- need not do it here (which would entail checking against the bounds).
- However, if this is an aliased object, it may not be smaller than the
- type of the object. */
- if (INTEGRAL_TYPE_P (gnu_type) && ! TYPE_PACKED_ARRAY_TYPE_P (gnu_type)
+ /* If this is an integral type or a packed array type, the front-end has
+ verified the size, so we need not do it here (which would entail
+ checking against the bounds). However, if this is an aliased object, it
+ may not be smaller than the type of the object. */
+ if ((INTEGRAL_TYPE_P (gnu_type) || TYPE_IS_PACKED_ARRAY_TYPE_P (gnu_type))
&& ! (kind == VAR_DECL && Is_Aliased (gnat_object)))
return size;
@@ -5904,10 +5837,7 @@ validate_size (uint_size, gnu_type, gnat_object, kind, component_p, zero_ok)
routine is only called for types. */
static void
-set_rm_size (uint_size, gnu_type, gnat_entity)
- Uint uint_size;
- tree gnu_type;
- Entity_Id gnat_entity;
+set_rm_size (Uint uint_size, tree gnu_type, Entity_Id gnat_entity)
{
/* Only give an error if a Value_Size clause was explicitly given.
Otherwise, we'd be duplicating an error on the Size clause. */
@@ -5981,10 +5911,7 @@ set_rm_size (uint_size, gnu_type, gnat_entity)
we are making a biased type. */
static tree
-make_type_from_size (type, size_tree, biased_p)
- tree type;
- tree size_tree;
- int biased_p;
+make_type_from_size (tree type, tree size_tree, int biased_p)
{
tree new_type;
unsigned HOST_WIDE_INT size;
@@ -6054,10 +5981,7 @@ make_type_from_size (type, size_tree, biased_p)
valid, return it. Otherwise, give an error and return ALIGN. */
static unsigned int
-validate_alignment (alignment, gnat_entity, align)
- Uint alignment;
- Entity_Id gnat_entity;
- unsigned int align;
+validate_alignment (Uint alignment, Entity_Id gnat_entity, unsigned int align)
{
Node_Id gnat_error_node = gnat_entity;
unsigned int new_align;
@@ -6102,10 +6026,7 @@ validate_alignment (alignment, gnat_entity, align)
if we require atomic components. */
static void
-check_ok_for_atomic (object, gnat_entity, comp_p)
- tree object;
- Entity_Id gnat_entity;
- int comp_p;
+check_ok_for_atomic (tree object, Entity_Id gnat_entity, int comp_p)
{
Node_Id gnat_error_point = gnat_entity;
Node_Id gnat_node;
@@ -6181,8 +6102,7 @@ check_ok_for_atomic (object, gnat_entity, comp_p)
changed. */
tree
-gnat_substitute_in_type (t, f, r)
- tree t, f, r;
+gnat_substitute_in_type (tree t, tree f, tree r)
{
tree new = t;
tree tem;
@@ -6403,8 +6323,7 @@ gnat_substitute_in_type (t, f, r)
needed to represent the object. */
tree
-rm_size (gnu_type)
- tree gnu_type;
+rm_size (tree gnu_type)
{
/* For integer types, this is the precision. For record types, we store
the size explicitly. For other types, this is just the size. */
@@ -6433,9 +6352,7 @@ rm_size (gnu_type)
and the specified suffix. */
tree
-create_concat_name (gnat_entity, suffix)
- Entity_Id gnat_entity;
- const char *suffix;
+create_concat_name (Entity_Id gnat_entity, const char *suffix)
{
const char *str = (suffix == 0 ? "" : suffix);
String_Template temp = {1, strlen (str)};
@@ -6473,8 +6390,7 @@ create_concat_name (gnat_entity, suffix)
Otherwise, return the name. */
tree
-get_entity_name (gnat_entity)
- Entity_Id gnat_entity;
+get_entity_name (Entity_Id gnat_entity)
{
Get_Encoded_Name (gnat_entity);
return get_identifier (Name_Buffer);
@@ -6485,9 +6401,7 @@ get_entity_name (gnat_entity)
the name in GNU_ID and SUFFIX. */
tree
-concat_id_with_name (gnu_id, suffix)
- tree gnu_id;
- const char *suffix;
+concat_id_with_name (tree gnu_id, const char *suffix)
{
int len = IDENTIFIER_LENGTH (gnu_id);
diff --git a/gcc/ada/einfo.adb b/gcc/ada/einfo.adb
index 6eac0d78359..f1a9afa7317 100644
--- a/gcc/ada/einfo.adb
+++ b/gcc/ada/einfo.adb
@@ -80,7 +80,6 @@ package body Einfo is
-- Hiding_Loop_Variable Node8
-- Mechanism Uint8 (but returns Mechanism_Type)
-- Normalized_First_Bit Uint8
- -- Non_Limited_Views Elist8
-- Class_Wide_Type Node9
-- Current_Value Node9
@@ -303,6 +302,7 @@ package body Einfo is
-- Is_CPP_Class Flag74
-- Has_Non_Standard_Rep Flag75
-- Is_Constructor Flag76
+ -- Is_Thread_Body Flag77
-- Is_Tag Flag78
-- Has_All_Calls_Remote Flag79
-- Is_Constr_Subt_For_U_Nominal Flag80
@@ -421,7 +421,6 @@ package body Einfo is
-- Remaining flags are currently unused and available
- -- (unused) Flag77
-- (unused) Flag136
-- (unused) Flag183
@@ -1641,6 +1640,11 @@ package body Einfo is
return Flag55 (Id);
end Is_Tagged_Type;
+ function Is_Thread_Body (Id : E) return B is
+ begin
+ return Flag77 (Id);
+ end Is_Thread_Body;
+
function Is_True_Constant (Id : E) return B is
begin
return Flag163 (Id);
@@ -1798,17 +1802,10 @@ package body Einfo is
function Non_Limited_View (Id : E) return E is
begin
pragma Assert (False
- or else Ekind (Id) = E_Incomplete_Type
- or else Ekind (Id) = E_Package);
+ or else Ekind (Id) = E_Incomplete_Type);
return Node17 (Id);
end Non_Limited_View;
- function Non_Limited_Views (Id : E) return L is
- begin
- pragma Assert (Ekind (Id) = E_Package);
- return Elist8 (Id);
- end Non_Limited_Views;
-
function Nonzero_Is_True (Id : E) return B is
begin
pragma Assert (Root_Type (Id) = Standard_Boolean);
@@ -2845,7 +2842,7 @@ package body Einfo is
begin
pragma Assert
(Is_Type (Id)
- or else Ekind (Id) = E_Package);
+ or else Ekind (Id) = E_Package);
Set_Flag159 (Id, V);
end Set_From_With_Type;
@@ -3589,6 +3586,11 @@ package body Einfo is
Set_Flag55 (Id, V);
end Set_Is_Tagged_Type;
+ procedure Set_Is_Thread_Body (Id : E; V : B := True) is
+ begin
+ Set_Flag77 (Id, V);
+ end Set_Is_Thread_Body;
+
procedure Set_Is_True_Constant (Id : E; V : B := True) is
begin
Set_Flag163 (Id, V);
@@ -3741,18 +3743,11 @@ package body Einfo is
procedure Set_Non_Limited_View (Id : E; V : E) is
pragma Assert (False
- or else Ekind (Id) = E_Incomplete_Type
- or else Ekind (Id) = E_Package);
+ or else Ekind (Id) = E_Incomplete_Type);
begin
Set_Node17 (Id, V);
end Set_Non_Limited_View;
- procedure Set_Non_Limited_Views (Id : E; V : L) is
- begin
- pragma Assert (Ekind (Id) = E_Package);
- Set_Elist8 (Id, V);
- end Set_Non_Limited_Views;
-
procedure Set_Nonzero_Is_True (Id : E; V : B := True) is
begin
pragma Assert
@@ -6214,6 +6209,7 @@ package body Einfo is
W ("Is_Statically_Allocated", Flag28 (Id));
W ("Is_Tag", Flag78 (Id));
W ("Is_Tagged_Type", Flag55 (Id));
+ W ("Is_Thread_Body", Flag77 (Id));
W ("Is_True_Constant", Flag163 (Id));
W ("Is_Unchecked_Union", Flag117 (Id));
W ("Is_Unsigned_Type", Flag144 (Id));
diff --git a/gcc/ada/einfo.ads b/gcc/ada/einfo.ads
index 3f8b227fd6d..07aa13fa406 100644
--- a/gcc/ada/einfo.ads
+++ b/gcc/ada/einfo.ads
@@ -930,7 +930,7 @@ package Einfo is
-- the record that is the fat pointer representation of an RAST.
-- Esize (Uint12)
--- Present in all types and subtypes, an also for components, constants,
+-- Present in all types and subtypes, and also for components, constants,
-- and variables. Contains the Object_Size of the type or of the object.
-- A value of zero indicates that the value is not yet known.
--
@@ -1162,6 +1162,9 @@ package Einfo is
-- types, i.e. record types (Java classes) that hold pointers to each
-- other. If such a type is an access type, it has no explicit freeze
-- node, so that the back-end does not attempt to elaborate it.
+-- Currently this flag is also used to implement Ada0Y (AI-50217).
+-- It will be renamed to From_Limited_With after removal of the current
+-- GNAT with_type clause???
-- Full_View (Node11)
-- Present in all type and subtype entities and in deferred constants.
@@ -1660,9 +1663,9 @@ package Einfo is
-- Is_Bit_Packed_Array (Flag122) [implementation base type only]
-- Present in all entities. This flag is set for a packed array
-- type that is bit packed (i.e. the component size is known by the
--- front end and is in the range 1-7, 9-15, or 17-31). Is_Packed is
--- always set if Is_Bit_Packed_Array is set, but it is possible for
--- Is_Packed to be set without Is_Bit_Packed_Array or the case of an
+-- front end and is in the range 1-7, 9-15, 17-31, or 33-63). Is_Packed
+-- is always set if Is_Bit_Packed_Array is set, but it is possible for
+-- Is_Packed to be set without Is_Bit_Packed_Array for the case of an
-- array having one or more index types that are enumeration types
-- with non-standard enumeration representations.
@@ -2276,6 +2279,10 @@ package Einfo is
-- Is_Task_Type (synthesized)
-- Applies to all entities, true for task types and subtypes
+-- Is_Thread_Body (Flag77)
+-- Applies to subprogram entities. Set if a valid Thread_Body pragma
+-- applies to this subprogram, which is thus a thread body.
+
-- Is_True_Constant (Flag163)
-- This flag is set in constants and variables which have an initial
-- value specified but which are never assigned, partially or in the
@@ -2381,8 +2388,7 @@ package Einfo is
-- Present in non-generic package entities that are not instances.
-- The elements of this list are the shadow entities created for the
-- types and local packages that are declared in a package that appears
--- in a limited_with clause. This list and Non_Limited_Views are built
--- at the same time, and their elements are in one-one correspondence.
+-- in a limited_with clause (Ada0Y: AI-50217)
-- Lit_Indexes (Node15)
-- Present in enumeration types and subtypes. Non-empty only for the
@@ -2551,14 +2557,9 @@ package Einfo is
-- is other than a power of 2.
-- Non_Limited_View (Node17)
--- Present in incomplete types, and local packages that are the
--- shadow entities created when analyzing a limited_with_clause.
--- Points to the definining entity in the original declaration.
-
--- Non_Limited_Views (Elist8)
--- Present in non-generic packages that are not instances. The elements
--- of this list are defining identifiers for types and local packages
--- declared within a package that appears in a limited_with clause.
+-- Present in incomplete types that are the shadow entities created
+-- when analyzing a limited_with_clause (Ada0Y: AI-50217). Points to
+-- the defining entity in the original declaration.
-- Nonzero_Is_True (Flag162) [base type only]
-- Present in enumeration types. True if any non-zero value is to be
@@ -2832,7 +2833,7 @@ package Einfo is
-- Present in all type and subtype entities. Contains the value of
-- type'Size as defined in the RM. See also the Esize field and
-- and the description on "Handling of Type'Size Values". A value
--- of zero for in this field for a non-discrete type means that
+-- of zero in this field for a non-discrete type means that
-- the front end has not yet determined the size value. For the
-- case of a discrete type, this field is always set by the front
-- end and zero is a legitimate value for a type with one value.
@@ -4258,6 +4259,7 @@ package Einfo is
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
+ -- Is_Thread_Body (Flag77) (non-generic case only)
-- Is_Visible_Child_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
-- Return_Present (Flag54)
@@ -4388,7 +4390,6 @@ package Einfo is
-- E_Package
-- E_Generic_Package
-- Dependent_Instances (Elist8) (for an instance)
- -- Non_Limited_Views (Elist8) (non-generic, not instance)
-- Renaming_Map (Uint9)
-- Handler_Records (List10) (non-generic case only)
-- Generic_Homonym (Node11) (generic case only)
@@ -4503,6 +4504,7 @@ package Einfo is
-- Is_Overriding_Operation (Flag39) (non-generic case only)
-- Is_Private_Descendant (Flag53)
-- Is_Pure (Flag44)
+ -- Is_Thread_Body (Flag77) (non-generic case only)
-- Is_Valued_Procedure (Flag127)
-- Is_Visible_Child_Unit (Flag116)
-- Needs_No_Actuals (Flag22)
@@ -5124,6 +5126,7 @@ package Einfo is
function Is_Statically_Allocated (Id : E) return B;
function Is_Tag (Id : E) return B;
function Is_Tagged_Type (Id : E) return B;
+ function Is_Thread_Body (Id : E) return B;
function Is_True_Constant (Id : E) return B;
function Is_Unchecked_Union (Id : E) return B;
function Is_Unsigned_Type (Id : E) return B;
@@ -5152,7 +5155,6 @@ package Einfo is
function No_Return (Id : E) return B;
function Non_Binary_Modulus (Id : E) return B;
function Non_Limited_View (Id : E) return E;
- function Non_Limited_Views (Id : E) return L;
function Nonzero_Is_True (Id : E) return B;
function Normalized_First_Bit (Id : E) return U;
function Normalized_Position (Id : E) return U;
@@ -5597,6 +5599,7 @@ package Einfo is
procedure Set_Is_Statically_Allocated (Id : E; V : B := True);
procedure Set_Is_Tag (Id : E; V : B := True);
procedure Set_Is_Tagged_Type (Id : E; V : B := True);
+ procedure Set_Is_Thread_Body (Id : E; V : B := True);
procedure Set_Is_True_Constant (Id : E; V : B := True);
procedure Set_Is_Unchecked_Union (Id : E; V : B := True);
procedure Set_Is_Unsigned_Type (Id : E; V : B := True);
@@ -5624,7 +5627,6 @@ package Einfo is
procedure Set_No_Return (Id : E; V : B := True);
procedure Set_Non_Binary_Modulus (Id : E; V : B := True);
procedure Set_Non_Limited_View (Id : E; V : E);
- procedure Set_Non_Limited_Views (Id : E; V : L);
procedure Set_Nonzero_Is_True (Id : E; V : B := True);
procedure Set_Normalized_First_Bit (Id : E; V : U);
procedure Set_Normalized_Position (Id : E; V : U);
@@ -6120,6 +6122,7 @@ package Einfo is
pragma Inline (Is_Subprogram);
pragma Inline (Is_Tag);
pragma Inline (Is_Tagged_Type);
+ pragma Inline (Is_Thread_Body);
pragma Inline (Is_True_Constant);
pragma Inline (Is_Task_Type);
pragma Inline (Is_Type);
@@ -6150,7 +6153,6 @@ package Einfo is
pragma Inline (No_Return);
pragma Inline (Non_Binary_Modulus);
pragma Inline (Non_Limited_View);
- pragma Inline (Non_Limited_Views);
pragma Inline (Nonzero_Is_True);
pragma Inline (Normalized_First_Bit);
pragma Inline (Normalized_Position);
@@ -6428,6 +6430,7 @@ package Einfo is
pragma Inline (Set_Is_Statically_Allocated);
pragma Inline (Set_Is_Tag);
pragma Inline (Set_Is_Tagged_Type);
+ pragma Inline (Set_Is_Thread_Body);
pragma Inline (Set_Is_True_Constant);
pragma Inline (Set_Is_Unchecked_Union);
pragma Inline (Set_Is_Unsigned_Type);
@@ -6455,7 +6458,6 @@ package Einfo is
pragma Inline (Set_No_Return);
pragma Inline (Set_Non_Binary_Modulus);
pragma Inline (Set_Non_Limited_View);
- pragma Inline (Set_Non_Limited_Views);
pragma Inline (Set_Nonzero_Is_True);
pragma Inline (Set_Normalized_First_Bit);
pragma Inline (Set_Normalized_Position);
diff --git a/gcc/ada/einfo.h b/gcc/ada/einfo.h
deleted file mode 100644
index f9b0a8a41fa..00000000000
--- a/gcc/ada/einfo.h
+++ /dev/null
@@ -1,1814 +0,0 @@
-/*--------------------------------------------------------------------------*/
-/* */
-/* GNAT COMPILER COMPONENTS */
-/* */
-/* E I N F O */
-/* */
-/* C Header File */
-/* */
-/* Copyright (C) 1992-2003 Free Software Foundation, Inc. */
-/* */
-/* GNAT is free software; you can redistribute it and/or modify it under */
-/* terms of the GNU General Public License as published by the Free Soft- */
-/* ware Foundation; either version 2, or (at your option) any later ver- */
-/* sion. GNAT is distributed in the hope that it will be useful, but WITH- */
-/* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */
-/* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License */
-/* for more details. You should have received a copy of the GNU General */
-/* Public License distributed with GNAT; see 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 other files instantiate generics from this */
-/* unit, or you link this unit with other files to produce an executable, */
-/* this unit does not by itself cause the resulting executable to be */
-/* covered by the GNU General Public License. This exception does not */
-/* however invalidate any other reasons why the executable file might be */
-/* covered by the GNU Public License. */
-/* */
-/* GNAT was originally developed by the GNAT team at New York University. */
-/* Extensive contributions were provided by Ada Core Technologies Inc. */
-/* */
-/*--------------------------------------------------------------------------*/
-
- #define E_Void 0
- #define E_Variable 1
- #define E_Component 2
- #define E_Constant 3
- #define E_Discriminant 4
- #define E_Loop_Parameter 5
- #define E_In_Parameter 6
- #define E_Out_Parameter 7
- #define E_In_Out_Parameter 8
- #define E_Generic_In_Out_Parameter 9
- #define E_Generic_In_Parameter 10
- #define E_Named_Integer 11
- #define E_Named_Real 12
- #define E_Enumeration_Type 13
- #define E_Enumeration_Subtype 14
- #define E_Signed_Integer_Type 15
- #define E_Signed_Integer_Subtype 16
- #define E_Modular_Integer_Type 17
- #define E_Modular_Integer_Subtype 18
- #define E_Ordinary_Fixed_Point_Type 19
- #define E_Ordinary_Fixed_Point_Subtype 20
- #define E_Decimal_Fixed_Point_Type 21
- #define E_Decimal_Fixed_Point_Subtype 22
- #define E_Floating_Point_Type 23
- #define E_Floating_Point_Subtype 24
- #define E_Access_Type 25
- #define E_Access_Subtype 26
- #define E_Access_Attribute_Type 27
- #define E_Allocator_Type 28
- #define E_General_Access_Type 29
- #define E_Access_Subprogram_Type 30
- #define E_Access_Protected_Subprogram_Type 31
- #define E_Anonymous_Access_Type 32
- #define E_Array_Type 33
- #define E_Array_Subtype 34
- #define E_String_Type 35
- #define E_String_Subtype 36
- #define E_String_Literal_Subtype 37
- #define E_Class_Wide_Type 38
- #define E_Class_Wide_Subtype 39
- #define E_Record_Type 40
- #define E_Record_Subtype 41
- #define E_Record_Type_With_Private 42
- #define E_Record_Subtype_With_Private 43
- #define E_Private_Type 44
- #define E_Private_Subtype 45
- #define E_Limited_Private_Type 46
- #define E_Limited_Private_Subtype 47
- #define E_Incomplete_Type 48
- #define E_Task_Type 49
- #define E_Task_Subtype 50
- #define E_Protected_Type 51
- #define E_Protected_Subtype 52
- #define E_Exception_Type 53
- #define E_Subprogram_Type 54
- #define E_Enumeration_Literal 55
- #define E_Function 56
- #define E_Operator 57
- #define E_Procedure 58
- #define E_Entry 59
- #define E_Entry_Family 60
- #define E_Block 61
- #define E_Entry_Index_Parameter 62
- #define E_Exception 63
- #define E_Generic_Function 64
- #define E_Generic_Procedure 65
- #define E_Generic_Package 66
- #define E_Label 67
- #define E_Loop 68
- #define E_Package 69
- #define E_Package_Body 70
- #define E_Protected_Object 71
- #define E_Protected_Body 72
- #define E_Task_Body 73
- #define E_Subprogram_Body 74
-
- SUBTYPE (Access_Kind, Entity_Kind,
- E_Access_Type, E_Anonymous_Access_Type)
-
- SUBTYPE (Array_Kind, Entity_Kind,
- E_Array_Type, E_String_Literal_Subtype)
-
- SUBTYPE (Class_Wide_Kind, Entity_Kind,
- E_Class_Wide_Type, E_Class_Wide_Subtype)
-
- SUBTYPE (Composite_Kind, Entity_Kind,
- E_Array_Type, E_Protected_Subtype)
-
- SUBTYPE (Concurrent_Kind, Entity_Kind,
- E_Task_Type, E_Protected_Subtype)
-
- SUBTYPE (Concurrent_Body_Kind, Entity_Kind,
- E_Protected_Body, E_Task_Body)
-
- SUBTYPE (Decimal_Fixed_Point_Kind, Entity_Kind,
- E_Decimal_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype)
-
- SUBTYPE (Digits_Kind, Entity_Kind,
- E_Decimal_Fixed_Point_Type, E_Floating_Point_Subtype)
-
- SUBTYPE (Discrete_Kind, Entity_Kind,
- E_Enumeration_Type, E_Modular_Integer_Subtype)
-
- SUBTYPE (Discrete_Or_Fixed_Point_Kind, Entity_Kind,
- E_Enumeration_Type, E_Decimal_Fixed_Point_Subtype)
-
- SUBTYPE (Elementary_Kind, Entity_Kind,
- E_Enumeration_Type, E_Anonymous_Access_Type)
-
- SUBTYPE (Enumeration_Kind, Entity_Kind,
- E_Enumeration_Type, E_Enumeration_Subtype)
-
- SUBTYPE (Entry_Kind, Entity_Kind,
- E_Entry, E_Entry_Family)
-
- SUBTYPE (Fixed_Point_Kind, Entity_Kind,
- E_Ordinary_Fixed_Point_Type, E_Decimal_Fixed_Point_Subtype)
-
- SUBTYPE (Float_Kind, Entity_Kind,
- E_Floating_Point_Type, E_Floating_Point_Subtype)
-
- SUBTYPE (Formal_Kind, Entity_Kind,
- E_In_Parameter, E_In_Out_Parameter)
-
- SUBTYPE (Generic_Subprogram_Kind, Entity_Kind,
- E_Generic_Function, E_Generic_Procedure)
-
- SUBTYPE (Generic_Unit_Kind, Entity_Kind,
- E_Generic_Function, E_Generic_Package)
-
- SUBTYPE (Incomplete_Or_Private_Kind, Entity_Kind,
- E_Record_Type_With_Private, E_Incomplete_Type)
-
- SUBTYPE (Integer_Kind, Entity_Kind,
- E_Signed_Integer_Type, E_Modular_Integer_Subtype)
-
- SUBTYPE (Modular_Integer_Kind, Entity_Kind,
- E_Modular_Integer_Type, E_Modular_Integer_Subtype)
-
- SUBTYPE (Named_Kind, Entity_Kind,
- E_Named_Integer, E_Named_Real)
-
- SUBTYPE (Numeric_Kind, Entity_Kind,
- E_Signed_Integer_Type, E_Floating_Point_Subtype)
-
- SUBTYPE (Object_Kind, Entity_Kind,
- E_Variable, E_Generic_In_Parameter)
-
- SUBTYPE (Ordinary_Fixed_Point_Kind, Entity_Kind,
- E_Ordinary_Fixed_Point_Type, E_Ordinary_Fixed_Point_Subtype)
-
- SUBTYPE (Overloadable_Kind, Entity_Kind,
- E_Enumeration_Literal, E_Entry)
-
- SUBTYPE (Private_Kind, Entity_Kind,
- E_Record_Type_With_Private, E_Limited_Private_Subtype)
-
- SUBTYPE (Protected_Kind, Entity_Kind,
- E_Protected_Type, E_Protected_Subtype)
-
- SUBTYPE (Real_Kind, Entity_Kind,
- E_Ordinary_Fixed_Point_Type, E_Floating_Point_Subtype)
-
- SUBTYPE (Record_Kind, Entity_Kind,
- E_Class_Wide_Type, E_Record_Subtype_With_Private)
-
- SUBTYPE (Scalar_Kind, Entity_Kind,
- E_Enumeration_Type, E_Floating_Point_Subtype)
-
- SUBTYPE (String_Kind, Entity_Kind,
- E_String_Type, E_String_Literal_Subtype)
-
- SUBTYPE (Subprogram_Kind, Entity_Kind,
- E_Function, E_Procedure)
-
- SUBTYPE (Signed_Integer_Kind, Entity_Kind,
- E_Signed_Integer_Type, E_Signed_Integer_Subtype)
-
- SUBTYPE (Task_Kind, Entity_Kind,
- E_Task_Type, E_Task_Subtype)
-
- SUBTYPE (Type_Kind, Entity_Kind,
- E_Enumeration_Type, E_Subprogram_Type)
-
- typedef char Component_Alignment_Kind;
- #define Calign_Default 0
- #define Calign_Component_Size 1
- #define Calign_Component_Size_4 2
- #define Calign_Storage_Unit 3
-
- typedef Boolean B;
- typedef Component_Alignment_Kind C;
- typedef Entity_Id E;
- typedef Mechanism_Type M;
- typedef Node_Id N;
- typedef Uint U;
- typedef Ureal R;
- typedef Elist_Id L;
- typedef List_Id S;
-
- INLINE L Accept_Address (E Id);
- INLINE E Access_Disp_Table (E Id);
- INLINE E Actual_Subtype (E Id);
- INLINE B Address_Taken (E Id);
- INLINE E Alias (E Id);
- INLINE U Alignment (E Id);
- INLINE E Associated_Final_Chain (E Id);
- INLINE E Associated_Formal_Package (E Id);
- INLINE N Associated_Node_For_Itype (E Id);
- INLINE E Associated_Storage_Pool (E Id);
- INLINE N Barrier_Function (E Id);
- INLINE N Block_Node (E Id);
- INLINE E Body_Entity (E Id);
- INLINE B Body_Needed_For_SAL (E Id);
- INLINE E CR_Discriminant (E Id);
- INLINE B C_Pass_By_Copy (E Id);
- INLINE B Can_Never_Be_Null (E Id);
- INLINE B Checks_May_Be_Suppressed (E Id);
- INLINE E Class_Wide_Type (E Id);
- INLINE E Cloned_Subtype (E Id);
-
- #define Component_Alignment einfo__component_alignment
- C Component_Alignment (E Id);
-
- INLINE N Component_Clause (E Id);
- INLINE U Component_Bit_Offset (E Id);
- INLINE U Component_Size (E Id);
- INLINE E Component_Type (E Id);
- INLINE E Corresponding_Concurrent_Type (E Id);
- INLINE E Corresponding_Discriminant (E Id);
- INLINE E Corresponding_Equality (E Id);
- INLINE E Corresponding_Record_Type (E Id);
- INLINE E Corresponding_Remote_Type (E Id);
- INLINE N Current_Value (E Id);
- INLINE B Debug_Info_Off (E Id);
- INLINE E Debug_Renaming_Link (E Id);
- INLINE E DTC_Entity (E Id);
- INLINE U DT_Entry_Count (E Id);
- INLINE U DT_Position (E Id);
- INLINE E Default_Expr_Function (E Id);
- INLINE B Default_Expressions_Processed (E Id);
- INLINE N Default_Value (E Id);
- INLINE B Delay_Cleanups (E Id);
- INLINE B Delay_Subprogram_Descriptors (E Id);
- INLINE R Delta_Value (E Id);
- INLINE L Dependent_Instances (E Id);
- INLINE B Depends_On_Private (E Id);
- INLINE U Digits_Value (E Id);
- INLINE E Directly_Designated_Type (E Id);
- INLINE B Discard_Names (E Id);
- INLINE E Discriminal (E Id);
- INLINE E Discriminal_Link (E Id);
- INLINE E Discriminant_Checking_Func (E Id);
- INLINE L Discriminant_Constraint (E Id);
- INLINE N Discriminant_Default_Value (E Id);
- INLINE U Discriminant_Number (E Id);
- INLINE B Elaborate_All_Desirable (E Id);
- INLINE E Elaboration_Entity (E Id);
- INLINE B Elaboration_Entity_Required (E Id);
- INLINE E Enclosing_Scope (E Id);
- INLINE B Entry_Accepted (E Id);
- INLINE E Entry_Bodies_Array (E Id);
- INLINE E Entry_Cancel_Parameter (E Id);
- INLINE E Entry_Component (E Id);
- INLINE E Entry_Formal (E Id);
- INLINE E Entry_Index_Constant (E Id);
- INLINE E Entry_Index_Type (E Id);
- INLINE E Entry_Parameters_Type (E Id);
- INLINE E Enum_Pos_To_Rep (E Id);
- INLINE U Enumeration_Pos (E Id);
- INLINE U Enumeration_Rep (E Id);
- INLINE N Enumeration_Rep_Expr (E Id);
- INLINE E Equivalent_Type (E Id);
- INLINE U Esize (E Id);
- INLINE U Exception_Code (E Id);
- INLINE E Extra_Accessibility (E Id);
- INLINE E Extra_Constrained (E Id);
- INLINE E Extra_Formal (E Id);
- INLINE E Finalization_Chain_Entity (E Id);
-
- #define Finalize_Storage_Only einfo__finalize_storage_only
- B Finalize_Storage_Only (E Id);
-
- INLINE E First_Entity (E Id);
- INLINE N First_Index (E Id);
- INLINE E First_Literal (E Id);
- INLINE E First_Optional_Parameter (E Id);
- INLINE E First_Private_Entity (E Id);
- INLINE N First_Rep_Item (E Id);
- INLINE N Freeze_Node (E Id);
- INLINE B From_With_Type (E Id);
- INLINE E Full_View (E Id);
- INLINE B Function_Returns_With_DSP (E Id);
- INLINE E Generic_Homonym (E Id);
- INLINE L Generic_Renamings (E Id);
- INLINE S Handler_Records (E Id);
- INLINE B Has_Aliased_Components (E Id);
- INLINE B Has_Alignment_Clause (E Id);
- INLINE B Has_All_Calls_Remote (E Id);
- INLINE B Has_Atomic_Components (E Id);
- INLINE B Has_Biased_Representation (E Id);
- INLINE B Has_Completion (E Id);
- INLINE B Has_Completion_In_Body (E Id);
- INLINE B Has_Complex_Representation (E Id);
- INLINE B Has_Component_Size_Clause (E Id);
- INLINE B Has_Contiguous_Rep (E Id);
- INLINE B Has_Controlled_Component (E Id);
- INLINE B Has_Controlling_Result (E Id);
- INLINE B Has_Convention_Pragma (E Id);
- INLINE B Has_Delayed_Freeze (E Id);
- INLINE B Has_Discriminants (E Id);
- INLINE B Has_Enumeration_Rep_Clause (E Id);
- INLINE B Has_Exit (E Id);
- INLINE B Has_External_Tag_Rep_Clause (E Id);
- INLINE B Has_Fully_Qualified_Name (E Id);
- INLINE B Has_Gigi_Rep_Item (E Id);
- INLINE B Has_Homonym (E Id);
-
- #define Has_Interrupt_Handler einfo__has_interrupt_handler
- B Has_Interrupt_Handler (E Id);
-
- INLINE B Has_Machine_Radix_Clause (E Id);
- INLINE B Has_Master_Entity (E Id);
- INLINE B Has_Missing_Return (E Id);
- INLINE B Has_Nested_Block_With_Handler (E Id);
- INLINE B Has_Forward_Instantiation (E Id);
- INLINE B Has_Non_Standard_Rep (E Id);
- INLINE B Has_Object_Size_Clause (E Id);
- INLINE B Has_Per_Object_Constraint (E Id);
- INLINE B Has_Pragma_Controlled (E Id);
- INLINE B Has_Pragma_Elaborate_Body (E Id);
- INLINE B Has_Pragma_Inline (E Id);
- INLINE B Has_Pragma_Pack (E Id);
- INLINE B Has_Pragma_Pure_Function (E Id);
- INLINE B Has_Pragma_Unreferenced (E Id);
- INLINE B Has_Primitive_Operations (E Id);
- INLINE B Has_Qualified_Name (E Id);
- INLINE B Has_Record_Rep_Clause (E Id);
- INLINE B Has_Recursive_Call (E Id);
- INLINE B Has_Size_Clause (E Id);
- INLINE B Has_Small_Clause (E Id);
- INLINE B Has_Specified_Layout (E Id);
- INLINE B Has_Storage_Size_Clause (E Id);
- INLINE B Has_Subprogram_Descriptor (E Id);
- INLINE B Has_Task (E Id);
- INLINE B Has_Unchecked_Union (E Id);
- INLINE B Has_Unknown_Discriminants (E Id);
- INLINE B Has_Volatile_Components (E Id);
- INLINE B Has_Xref_Entry (E Id);
- INLINE E Hiding_Loop_Variable (E Id);
- INLINE E Homonym (E Id);
- INLINE B In_Package_Body (E Id);
- INLINE B In_Private_Part (E Id);
- INLINE B In_Use (E Id);
- INLINE L Inner_Instances (E Id);
- INLINE N Interface_Name (E Id);
- INLINE B Is_AST_Entry (E Id);
- INLINE B Is_Abstract (E Id);
- INLINE B Is_Access_Constant (E Id);
- INLINE B Is_Aliased (E Id);
- INLINE B Is_Asynchronous (E Id);
- INLINE B Is_Atomic (E Id);
- INLINE B Is_Bit_Packed_Array (E Id);
- INLINE B Is_CPP_Class (E Id);
- INLINE B Is_Called (E Id);
- INLINE B Is_Character_Type (E Id);
- INLINE B Is_Child_Unit (E Id);
- INLINE B Is_Class_Wide_Equivalent_Type (E Id);
- INLINE B Is_Compilation_Unit (E Id);
- INLINE B Is_Completely_Hidden (E Id);
- INLINE B Is_Constr_Subt_For_UN_Aliased (E Id);
- INLINE B Is_Constr_Subt_For_U_Nominal (E Id);
- INLINE B Is_Constrained (E Id);
- INLINE B Is_Constructor (E Id);
- INLINE B Is_Controlled (E Id);
- INLINE B Is_Controlling_Formal (E Id);
- INLINE B Is_Discrim_SO_Function (E Id);
- INLINE B Is_Dispatching_Operation (E Id);
- INLINE B Is_Eliminated (E Id);
- INLINE B Is_Entry_Formal (E Id);
- INLINE B Is_Exported (E Id);
- INLINE B Is_First_Subtype (E Id);
- INLINE B Is_For_Access_Subtype (E Id);
- INLINE B Is_Frozen (E Id);
- INLINE B Is_Generic_Instance (E Id);
- INLINE B Is_Hidden (E Id);
- INLINE B Is_Hidden_Open_Scope (E Id);
- INLINE B Is_Immediately_Visible (E Id);
- INLINE B Is_Imported (E Id);
- INLINE B Is_Inlined (E Id);
- INLINE B Is_Instantiated (E Id);
- INLINE B Is_Internal (E Id);
- INLINE B Is_Interrupt_Handler (E Id);
- INLINE B Is_Intrinsic_Subprogram (E Id);
- INLINE B Is_Itype (E Id);
- INLINE B Is_Known_Non_Null (E Id);
- INLINE B Is_Known_Valid (E Id);
- INLINE B Is_Limited_Composite (E Id);
- INLINE B Is_Machine_Code_Subprogram (E Id);
- INLINE B Is_Non_Static_Subtype (E Id);
- INLINE B Is_Null_Init_Proc (E Id);
- INLINE B Is_Optional_Parameter (E Id);
- INLINE B Is_Package_Body_Entity (E Id);
- INLINE B Is_Packed (E Id);
- INLINE B Is_Packed_Array_Type (E Id);
- INLINE B Is_Potentially_Use_Visible (E Id);
- INLINE B Is_Preelaborated (E Id);
- INLINE B Is_Private_Composite (E Id);
- INLINE B Is_Private_Descendant (E Id);
- INLINE B Is_Psected (E Id);
- INLINE B Is_Public (E Id);
- INLINE B Is_Pure (E Id);
- INLINE B Is_Remote_Call_Interface (E Id);
- INLINE B Is_Remote_Types (E Id);
- INLINE B Is_Renaming_Of_Object (E Id);
- INLINE B Is_Shared_Passive (E Id);
- INLINE B Is_Statically_Allocated (E Id);
- INLINE B Is_Tag (E Id);
- INLINE B Is_Tagged_Type (E Id);
- INLINE B Is_True_Constant (E Id);
- INLINE B Is_Unchecked_Union (E Id);
- INLINE B Is_Unsigned_Type (E Id);
- INLINE B Is_VMS_Exception (E Id);
- INLINE B Is_Valued_Procedure (E Id);
- INLINE B Is_Visible_Child_Unit (E Id);
-
- #define Is_Volatile einfo__is_volatile
- B Is_Volatile (E Id);
-
- #define Is_Wrapper_Package einfo__is_wrapper_package
- B Is_Wrapper_Package (E Id);
-
- INLINE B Kill_Elaboration_Checks (E Id);
- INLINE B Kill_Range_Checks (E Id);
- INLINE B Kill_Tag_Checks (E Id);
- INLINE E Last_Entity (E Id);
- INLINE L Limited_Views (E Id);
- INLINE E Lit_Indexes (E Id);
- INLINE E Lit_Strings (E Id);
- INLINE B Machine_Radix_10 (E Id);
- INLINE E Master_Id (E Id);
- INLINE B Materialize_Entity (E Id);
- INLINE M Mechanism (E Id);
- INLINE U Modulus (E Id);
- INLINE B Needs_Debug_Info (E Id);
- INLINE B Needs_No_Actuals (E Id);
- INLINE B Never_Set_In_Source (E Id);
- INLINE E Next_Inlined_Subprogram (E Id);
- INLINE B No_Pool_Assigned (E Id);
- INLINE B No_Return (E Id);
- INLINE B Non_Binary_Modulus (E Id);
- INLINE E Non_Limited_View (E Id);
- INLINE L Non_Limited_Views (E Id);
- INLINE B Nonzero_Is_True (E Id);
- INLINE U Normalized_First_Bit (E Id);
- INLINE U Normalized_Position (E Id);
- INLINE U Normalized_Position_Max (E Id);
- INLINE E Object_Ref (E Id);
- INLINE E Original_Array_Type (E Id);
- INLINE E Original_Record_Component (E Id);
- INLINE E Packed_Array_Type (E Id);
- INLINE E Parent_Subtype (E Id);
- INLINE L Primitive_Operations (E Id);
- INLINE E Prival (E Id);
- INLINE L Privals_Chain (E Id);
- INLINE L Private_Dependents (E Id);
- INLINE N Private_View (E Id);
- INLINE E Protected_Body_Subprogram (E Id);
- INLINE E Protected_Formal (E Id);
- INLINE E Protected_Operation (E Id);
- INLINE U RM_Size (E Id);
- INLINE B Reachable (E Id);
- INLINE B Referenced (E Id);
- INLINE B Referenced_As_LHS (E Id);
- INLINE N Referenced_Object (E Id);
- INLINE N Register_Exception_Call (E Id);
- INLINE E Related_Array_Object (E Id);
- INLINE E Related_Instance (E Id);
- INLINE N Renamed_Entity (E Id);
- INLINE N Renamed_Object (E Id);
- INLINE U Renaming_Map (E Id);
- INLINE B Return_Present (E Id);
- INLINE B Returns_By_Ref (E Id);
- INLINE B Reverse_Bit_Order (E Id);
- INLINE N Scalar_Range (E Id);
- INLINE U Scale_Value (E Id);
- INLINE U Scope_Depth_Value (E Id);
- INLINE B Sec_Stack_Needed_For_Return (E Id);
- INLINE S Shadow_Entities (E Id);
- INLINE E Shared_Var_Assign_Proc (E Id);
- INLINE E Shared_Var_Read_Proc (E Id);
- INLINE N Size_Check_Code (E Id);
- INLINE B Size_Known_At_Compile_Time (E Id);
- INLINE B Size_Depends_On_Discriminant (E Id);
- INLINE R Small_Value (E Id);
- INLINE E Spec_Entity (E Id);
- INLINE E Storage_Size_Variable (E Id);
- INLINE L Stored_Constraint (E Id);
- INLINE B Strict_Alignment (E Id);
- INLINE U String_Literal_Length (E Id);
- INLINE N String_Literal_Low_Bound (E Id);
- INLINE B Suppress_Elaboration_Warnings (E Id);
- INLINE B Suppress_Init_Proc (E Id);
- INLINE B Suppress_Style_Checks (E Id);
- INLINE B Treat_As_Volatile (E Id);
- INLINE E Underlying_Full_View (E Id);
- INLINE N Unset_Reference (E Id);
- INLINE B Uses_Sec_Stack (E Id);
- INLINE B Vax_Float (E Id);
- INLINE B Warnings_Off (E Id);
- INLINE B Is_Access_Type (E Id);
- INLINE B Is_Array_Type (E Id);
- INLINE B Is_Class_Wide_Type (E Id);
- INLINE B Is_Composite_Type (E Id);
- INLINE B Is_Concurrent_Body (E Id);
- INLINE B Is_Concurrent_Record_Type (E Id);
- INLINE B Is_Concurrent_Type (E Id);
- INLINE B Is_Decimal_Fixed_Point_Type (E Id);
- INLINE B Is_Digits_Type (E Id);
- INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id);
- INLINE B Is_Discrete_Type (E Id);
- INLINE B Is_Elementary_Type (E Id);
- INLINE B Is_Entry (E Id);
- INLINE B Is_Enumeration_Type (E Id);
- INLINE B Is_Fixed_Point_Type (E Id);
- INLINE B Is_Floating_Point_Type (E Id);
- INLINE B Is_Formal (E Id);
- INLINE B Is_Formal_Subprogram (E Id);
- INLINE B Is_Generic_Actual_Type (E Id);
- INLINE B Is_Generic_Unit (E Id);
- INLINE B Is_Generic_Type (E Id);
- INLINE B Is_Generic_Subprogram (E Id);
- INLINE B Is_Incomplete_Or_Private_Type (E Id);
- INLINE B Is_Integer_Type (E Id);
- INLINE B Is_Limited_Record (E Id);
- INLINE B Is_Modular_Integer_Type (E Id);
- INLINE B Is_Named_Number (E Id);
- INLINE B Is_Numeric_Type (E Id);
- INLINE B Is_Object (E Id);
- INLINE B Is_Ordinary_Fixed_Point_Type (E Id);
- INLINE B Is_Overloadable (E Id);
- INLINE B Is_Overriding_Operation (E Id);
- INLINE B Is_Private_Type (E Id);
- INLINE B Is_Protected_Type (E Id);
- INLINE B Is_Real_Type (E Id);
- INLINE B Is_Record_Type (E Id);
- INLINE B Is_Scalar_Type (E Id);
- INLINE B Is_Signed_Integer_Type (E Id);
- INLINE B Is_Subprogram (E Id);
- INLINE B Is_Task_Type (E Id);
- INLINE B Is_Type (E Id);
-
- #define Address_Clause einfo__address_clause
- N Address_Clause (E Id);
-
- #define Alignment_Clause einfo__alignment_clause
- N Alignment_Clause (E Id);
-
- #define Ancestor_Subtype einfo__ancestor_subtype
- E Ancestor_Subtype (E Id);
-
- #define Base_Type einfo__base_type
- E Base_Type (E Id);
-
- #define Constant_Value einfo__constant_value
- N Constant_Value (E Id);
-
- #define Declaration_Node einfo__declaration_node
- N Declaration_Node (E Id);
-
- #define Designated_Type einfo__designated_type
- E Designated_Type (E Id);
-
- #define Enclosing_Dynamic_Scope einfo__enclosing_dynamic_scope
- E Enclosing_Dynamic_Scope (E Id);
-
- #define First_Component einfo__first_component
- E First_Component (E Id);
-
- #define First_Discriminant einfo__first_discriminant
- E First_Discriminant (E Id);
-
- #define First_Formal einfo__first_formal
- E First_Formal (E Id);
-
- #define First_Stored_Discriminant einfo__first_stored_discriminant
- E First_Stored_Discriminant (E Id);
-
- #define First_Subtype einfo__first_subtype
- E First_Subtype (E Id);
-
- #define Has_Attach_Handler einfo__has_attach_handler
- B Has_Attach_Handler (E Id);
-
- #define Has_Entries einfo__has_entries
- B Has_Entries (E Id);
-
- #define Has_Foreign_Convention einfo__has_foreign_convention
- B Has_Foreign_Convention (E Id);
-
- #define Has_Private_Ancestor einfo__has_private_ancestor
- B Has_Private_Ancestor (E Id);
-
- INLINE B Has_Private_Declaration (E Id);
-
- #define Implementation_Base_Type einfo__implementation_base_type
- E Implementation_Base_Type (E Id);
-
- #define Is_Always_Inlined einfo__is_always_inlined
- B Is_Always_Inlined (E Id);
-
- #define Is_Boolean_Type einfo__is_boolean_type
- B Is_Boolean_Type (E Id);
-
- #define Is_By_Copy_Type einfo__is_by_copy_type
- B Is_By_Copy_Type (E Id);
-
- #define Is_By_Reference_Type einfo__is_by_reference_type
- B Is_By_Reference_Type (E Id);
-
- #define Is_Derived_Type einfo__is_derived_type
- B Is_Derived_Type (E Id);
-
- #define Is_Dynamic_Scope einfo__is_dynamic_scope
- B Is_Dynamic_Scope (E Id);
-
- #define Is_Indefinite_Subtype einfo__is_indefinite_subtype
- B Is_Indefinite_Subtype (E Id);
-
- #define Is_Limited_Type einfo__is_limited_type
- B Is_Limited_Type (E Id);
-
- #define Is_Package einfo__is_package
- B Is_Package (E Id);
-
- #define Is_Protected_Private einfo__is_protected_private
- B Is_Protected_Private (E Id);
-
- #define Is_Protected_Record_Type einfo__is_protected_record_type
- B Is_Protected_Record_Type (E Id);
-
- #define Is_Return_By_Reference_Type einfo__is_return_by_reference_type
- B Is_Return_By_Reference_Type (E Id);
-
- #define Is_String_Type einfo__is_string_type
- B Is_String_Type (E Id);
-
- #define Is_Task_Record_Type einfo__is_task_record_type
- B Is_Task_Record_Type (E Id);
-
- #define Next_Component einfo__next_component
- E Next_Component (E Id);
-
- #define Next_Discriminant einfo__next_discriminant
- E Next_Discriminant (E Id);
-
- #define Next_Formal einfo__next_formal
- E Next_Formal (E Id);
-
- #define Next_Formal_With_Extras einfo__next_formal_with_extras
- E Next_Formal_With_Extras (E Id);
-
- INLINE E Next_Literal (E Id);
-
- #define Next_Stored_Discriminant einfo__next_stored_discriminant
- E Next_Stored_Discriminant (E Id);
-
- #define Number_Dimensions einfo__number_dimensions
- Pos Number_Dimensions (E Id);
-
- #define Number_Discriminants einfo__number_discriminants
- Pos Number_Discriminants (E Id);
-
- #define Number_Entries einfo__number_entries
- Nat Number_Entries (E Id);
-
- #define Number_Formals einfo__number_formals
- Pos Number_Formals (E Id);
-
- INLINE Formal_Kind Parameter_Mode (E Id);
-
- #define Root_Type einfo__root_type
- E Root_Type (E Id);
-
- #define Scope_Depth_Set einfo__scope_depth_set
- B Scope_Depth_Set (E Id);
-
- #define Size_Clause einfo__size_clause
- N Size_Clause (E Id);
-
- #define Tag_Component einfo__tag_component
- E Tag_Component (E Id);
-
- #define Type_High_Bound einfo__type_high_bound
- N Type_High_Bound (E Id);
-
- #define Type_Low_Bound einfo__type_low_bound
- N Type_Low_Bound (E Id);
-
- #define Underlying_Type einfo__underlying_type
- E Underlying_Type (E Id);
-
- #define Known_Alignment einfo__known_alignment
- B Known_Alignment (Entity_Id E);
-
- #define Known_Component_Bit_Offset einfo__known_component_bit_offset
- B Known_Component_Bit_Offset (Entity_Id E);
-
- #define Known_Component_Size einfo__known_component_size
- B Known_Component_Size (Entity_Id E);
-
- #define Known_Esize einfo__known_esize
- B Known_Esize (Entity_Id E);
-
- #define Known_Normalized_First_Bit einfo__known_normalized_first_bit
- B Known_Normalized_First_Bit (Entity_Id E);
-
- #define Known_Normalized_Position einfo__known_normalized_position
- B Known_Normalized_Position (Entity_Id E);
-
- #define Known_Normalized_Position_Max einfo__known_normalized_position_max
- B Known_Normalized_Position_Max (Entity_Id E);
-
- #define Known_RM_Size einfo__known_rm_size
- B Known_RM_Size (Entity_Id E);
-
- #define Known_Static_Component_Bit_Offset einfo__known_static_component_bit_offset
- B Known_Static_Component_Bit_Offset (Entity_Id E);
-
- #define Known_Static_Component_Size einfo__known_static_component_size
- B Known_Static_Component_Size (Entity_Id E);
-
- #define Known_Static_Esize einfo__known_static_esize
- B Known_Static_Esize (Entity_Id E);
-
- #define Known_Static_Normalized_First_Bit einfo__known_static_normalized_first_bit
- B Known_Static_Normalized_First_Bit (Entity_Id E);
-
- #define Known_Static_Normalized_Position einfo__known_static_normalized_position
- B Known_Static_Normalized_Position (Entity_Id E);
-
- #define Known_Static_Normalized_Position_Max einfo__known_static_normalized_position_max
- B Known_Static_Normalized_Position_Max (Entity_Id E);
-
- #define Known_Static_RM_Size einfo__known_static_rm_size
- B Known_Static_RM_Size (Entity_Id E);
-
- #define Unknown_Alignment einfo__unknown_alignment
- B Unknown_Alignment (Entity_Id E);
-
- #define Unknown_Component_Bit_Offset einfo__unknown_component_bit_offset
- B Unknown_Component_Bit_Offset (Entity_Id E);
-
- #define Unknown_Component_Size einfo__unknown_component_size
- B Unknown_Component_Size (Entity_Id E);
-
- #define Unknown_Esize einfo__unknown_esize
- B Unknown_Esize (Entity_Id E);
-
- #define Unknown_Normalized_First_Bit einfo__unknown_normalized_first_bit
- B Unknown_Normalized_First_Bit (Entity_Id E);
-
- #define Unknown_Normalized_Position einfo__unknown_normalized_position
- B Unknown_Normalized_Position (Entity_Id E);
-
- #define Unknown_Normalized_Position_Max einfo__unknown_normalized_position_max
- B Unknown_Normalized_Position_Max (Entity_Id E);
-
- #define Unknown_RM_Size einfo__unknown_rm_size
- B Unknown_RM_Size (Entity_Id E);
-
-
- INLINE L Accept_Address (E Id)
- { return Elist21 (Id); }
-
- INLINE E Access_Disp_Table (E Id)
- { return Node16 (Implementation_Base_Type (Id)); }
-
- INLINE E Actual_Subtype (E Id)
- { return Node17 (Id); }
-
- INLINE B Address_Taken (E Id)
- { return Flag104 (Id); }
-
- INLINE E Alias (E Id)
- { return Node18 (Id); }
-
- INLINE U Alignment (E Id)
- { return Uint14 (Id); }
-
- INLINE E Associated_Final_Chain (E Id)
- { return Node23 (Id); }
-
- INLINE E Associated_Formal_Package (E Id)
- { return Node12 (Id); }
-
- INLINE N Associated_Node_For_Itype (E Id)
- { return Node8 (Id); }
-
- INLINE E Associated_Storage_Pool (E Id)
- { return Node22 (Root_Type (Id)); }
-
- INLINE N Barrier_Function (E Id)
- { return Node12 (Id); }
-
- INLINE N Block_Node (E Id)
- { return Node11 (Id); }
-
- INLINE E Body_Entity (E Id)
- { return Node19 (Id); }
-
- INLINE B Body_Needed_For_SAL (E Id)
- { return Flag40 (Id); }
-
- INLINE B C_Pass_By_Copy (E Id)
- { return Flag125 (Implementation_Base_Type (Id)); }
-
- INLINE B Can_Never_Be_Null (E Id)
- { return Flag38 (Id); }
-
- INLINE B Checks_May_Be_Suppressed (E Id)
- { return Flag31 (Id); }
-
- INLINE E Class_Wide_Type (E Id)
- { return Node9 (Id); }
-
- INLINE E Cloned_Subtype (E Id)
- { return Node16 (Id); }
-
- INLINE U Component_Bit_Offset (E Id)
- { return Uint11 (Id); }
-
- INLINE N Component_Clause (E Id)
- { return Node13 (Id); }
-
- INLINE U Component_Size (E Id)
- { return Uint22 (Implementation_Base_Type (Id)); }
-
- INLINE E Component_Type (E Id)
- { return Node20 (Implementation_Base_Type (Id)); }
-
- INLINE E Corresponding_Concurrent_Type (E Id)
- { return Node18 (Id); }
-
- INLINE E Corresponding_Discriminant (E Id)
- { return Node19 (Id); }
-
- INLINE E Corresponding_Equality (E Id)
- { return Node13 (Id); }
-
- INLINE E Corresponding_Record_Type (E Id)
- { return Node18 (Id); }
-
- INLINE E Corresponding_Remote_Type (E Id)
- { return Node22 (Id); }
-
- INLINE N Current_Value (E Id)
- { return Node9 (Id); }
-
- INLINE E CR_Discriminant (E Id)
- { return Node23 (Id); }
-
- INLINE B Debug_Info_Off (E Id)
- { return Flag166 (Id); }
-
- INLINE E Debug_Renaming_Link (E Id)
- { return Node13 (Id); }
-
- INLINE E Default_Expr_Function (E Id)
- { return Node21 (Id); }
-
- INLINE B Default_Expressions_Processed (E Id)
- { return Flag108 (Id); }
-
- INLINE N Default_Value (E Id)
- { return Node20 (Id); }
-
- INLINE B Delay_Cleanups (E Id)
- { return Flag114 (Id); }
-
- INLINE B Delay_Subprogram_Descriptors (E Id)
- { return Flag50 (Id); }
-
- INLINE R Delta_Value (E Id)
- { return Ureal18 (Id); }
-
- INLINE L Dependent_Instances (E Id)
- { return Elist8 (Id); }
-
- INLINE B Depends_On_Private (E Id)
- { return Flag14 (Id); }
-
- INLINE U Digits_Value (E Id)
- { return Uint17 (Id); }
-
- INLINE E Directly_Designated_Type (E Id)
- { return Node20 (Id); }
-
- INLINE B Discard_Names (E Id)
- { return Flag88 (Id); }
-
- INLINE E Discriminal (E Id)
- { return Node17 (Id); }
-
- INLINE N Discriminal_Link (E Id)
- { return Node10 (Id); }
-
- INLINE E Discriminant_Checking_Func (E Id)
- { return Node20 (Id); }
-
- INLINE L Discriminant_Constraint (E Id)
- { return Elist21 (Id); }
-
- INLINE N Discriminant_Default_Value (E Id)
- { return Node20 (Id); }
-
- INLINE U Discriminant_Number (E Id)
- { return Uint15 (Id); }
-
- INLINE U DT_Entry_Count (E Id)
- { return Uint15 (Id); }
-
- INLINE U DT_Position (E Id)
- { return Uint15 (Id); }
-
- INLINE E DTC_Entity (E Id)
- { return Node16 (Id); }
-
- INLINE B Elaborate_All_Desirable (E Id)
- { return Flag146 (Id); }
-
- INLINE E Elaboration_Entity (E Id)
- { return Node13 (Id); }
-
- INLINE B Elaboration_Entity_Required (E Id)
- { return Flag174 (Id); }
-
- INLINE E Enclosing_Scope (E Id)
- { return Node18 (Id); }
-
- INLINE B Entry_Accepted (E Id)
- { return Flag152 (Id); }
-
- INLINE E Entry_Bodies_Array (E Id)
- { return Node15 (Id); }
-
- INLINE E Entry_Cancel_Parameter (E Id)
- { return Node23 (Id); }
-
- INLINE E Entry_Component (E Id)
- { return Node11 (Id); }
-
- INLINE E Entry_Formal (E Id)
- { return Node16 (Id); }
-
- INLINE N Entry_Index_Constant (E Id)
- { return Node18 (Id); }
-
- INLINE E Entry_Parameters_Type (E Id)
- { return Node15 (Id); }
-
- INLINE E Enum_Pos_To_Rep (E Id)
- { return Node23 (Id); }
-
- INLINE Uint Enumeration_Pos (E Id)
- { return Uint11 (Id); }
-
- INLINE U Enumeration_Rep (E Id)
- { return Uint12 (Id); }
-
- INLINE N Enumeration_Rep_Expr (E Id)
- { return Node22 (Id); }
-
- INLINE E Equivalent_Type (E Id)
- { return Node18 (Id); }
-
- INLINE Uint Esize (E Id)
- { return Uint12 (Id); }
-
- INLINE Uint Exception_Code (E Id)
- { return Uint22 (Id); }
-
- INLINE E Extra_Accessibility (E Id)
- { return Node13 (Id); }
-
- INLINE E Extra_Constrained (E Id)
- { return Node23 (Id); }
-
- INLINE E Extra_Formal (E Id)
- { return Node15 (Id); }
-
- INLINE E Finalization_Chain_Entity (E Id)
- { return Node19 (Id); }
-
- INLINE E First_Entity (E Id)
- { return Node17 (Id); }
-
- INLINE N First_Index (E Id)
- { return Node17 (Id); }
-
- INLINE E First_Literal (E Id)
- { return Node17 (Id); }
-
- INLINE E First_Optional_Parameter (E Id)
- { return Node14 (Id); }
-
- INLINE E First_Private_Entity (E Id)
- { return Node16 (Id); }
-
- INLINE E First_Rep_Item (E Id)
- { return Node6 (Id); }
-
- INLINE N Freeze_Node (E Id)
- { return Node7 (Id); }
-
- INLINE B From_With_Type (E Id)
- { return Flag159 (Id); }
-
- INLINE E Full_View (E Id)
- { return Node11 (Id); }
-
- INLINE B Function_Returns_With_DSP (E Id)
- { return Flag169 (Id); }
-
- INLINE E Generic_Homonym (E Id)
- { return Node11 (Id); }
-
- INLINE L Generic_Renamings (E Id)
- { return Elist23 (Id); }
-
- INLINE S Handler_Records (E Id)
- { return List10 (Id); }
-
- INLINE B Has_Aliased_Components (E Id)
- { return Flag135 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Alignment_Clause (E Id)
- { return Flag46 (Id); }
-
- INLINE B Has_All_Calls_Remote (E Id)
- { return Flag79 (Id); }
-
- INLINE B Has_Atomic_Components (E Id)
- { return Flag86 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Biased_Representation (E Id)
- { return Flag139 (Id); }
-
- INLINE B Has_Completion (E Id)
- { return Flag26 (Id); }
-
- INLINE B Has_Completion_In_Body (E Id)
- { return Flag71 (Id); }
-
- INLINE B Has_Complex_Representation (E Id)
- { return Flag140 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Component_Size_Clause (E Id)
- { return Flag68 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Controlled_Component (E Id)
- { return Flag43 (Base_Type (Id)); }
-
- INLINE B Has_Contiguous_Rep (E Id)
- { return Flag181 (Id); }
-
- INLINE B Has_Controlling_Result (E Id)
- { return Flag98 (Id); }
-
- INLINE B Has_Convention_Pragma (E Id)
- { return Flag119 (Id); }
-
- INLINE B Has_Delayed_Freeze (E Id)
- { return Flag18 (Id); }
-
- INLINE B Has_Discriminants (E Id)
- { return Flag5 (Id); }
-
- INLINE B Has_Enumeration_Rep_Clause (E Id)
- { return Flag66 (Id); }
-
- INLINE B Has_Exit (E Id)
- { return Flag47 (Id); }
-
- INLINE B Has_External_Tag_Rep_Clause (E Id)
- { return Flag110 (Id); }
-
- INLINE B Has_Forward_Instantiation (E Id)
- { return Flag175 (Id); }
-
- INLINE B Has_Fully_Qualified_Name (E Id)
- { return Flag173 (Id); }
-
- INLINE B Has_Gigi_Rep_Item (E Id)
- { return Flag82 (Id); }
-
- INLINE B Has_Homonym (E Id)
- { return Flag56 (Id); }
-
- INLINE B Has_Machine_Radix_Clause (E Id)
- { return Flag83 (Id); }
-
- INLINE B Has_Master_Entity (E Id)
- { return Flag21 (Id); }
-
- INLINE B Has_Missing_Return (E Id)
- { return Flag142 (Id); }
-
- INLINE B Has_Nested_Block_With_Handler (E Id)
- { return Flag101 (Id); }
-
- INLINE B Has_Non_Standard_Rep (E Id)
- { return Flag75 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Object_Size_Clause (E Id)
- { return Flag172 (Id); }
-
- INLINE B Has_Per_Object_Constraint (E Id)
- { return Flag154 (Id); }
-
- INLINE B Has_Pragma_Controlled (E Id)
- { return Flag27 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Pragma_Elaborate_Body (E Id)
- { return Flag150 (Id); }
-
- INLINE B Has_Pragma_Inline (E Id)
- { return Flag157 (Id); }
-
- INLINE B Has_Pragma_Pack (E Id)
- { return Flag121 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Pragma_Pure_Function (E Id)
- { return Flag179 (Id); }
-
- INLINE B Has_Pragma_Unreferenced (E Id)
- { return Flag180 (Id); }
-
- INLINE B Has_Primitive_Operations (E Id)
- { return Flag120 (Base_Type (Id)); }
-
- INLINE B Has_Private_Declaration (E Id)
- { return Flag155 (Id); }
-
- INLINE B Has_Qualified_Name (E Id)
- { return Flag161 (Id); }
-
- INLINE B Has_Record_Rep_Clause (E Id)
- { return Flag65 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Recursive_Call (E Id)
- { return Flag143 (Id); }
-
- INLINE B Has_Size_Clause (E Id)
- { return Flag29 (Id); }
-
- INLINE B Has_Small_Clause (E Id)
- { return Flag67 (Id); }
-
- INLINE B Has_Specified_Layout (E Id)
- { return Flag100 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Storage_Size_Clause (E Id)
- { return Flag23 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Subprogram_Descriptor (E Id)
- { return Flag93 (Id); }
-
- INLINE B Has_Task (E Id)
- { return Flag30 (Base_Type (Id)); }
-
- INLINE B Has_Unchecked_Union (E Id)
- { return Flag123 (Base_Type (Id)); }
-
- INLINE B Has_Unknown_Discriminants (E Id)
- { return Flag72 (Id); }
-
- INLINE B Has_Volatile_Components (E Id)
- { return Flag87 (Implementation_Base_Type (Id)); }
-
- INLINE B Has_Xref_Entry (E Id)
- { return Flag182 (Implementation_Base_Type (Id)); }
-
- INLINE E Hiding_Loop_Variable (E Id)
- { return Node8 (Id); }
-
- INLINE E Homonym (E Id)
- { return Node4 (Id); }
-
- INLINE B In_Package_Body (E Id)
- { return Flag48 (Id); }
-
- INLINE B In_Private_Part (E Id)
- { return Flag45 (Id); }
-
- INLINE B In_Use (E Id)
- { return Flag8 (Id); }
-
- INLINE L Inner_Instances (E Id)
- { return Elist23 (Id); }
-
- INLINE N Interface_Name (E Id)
- { return Node21 (Id); }
-
- INLINE B Is_Abstract (E Id)
- { return Flag19 (Id); }
-
- INLINE B Is_Access_Constant (E Id)
- { return Flag69 (Id); }
-
- INLINE B Is_Aliased (E Id)
- { return Flag15 (Id); }
-
- INLINE B Is_AST_Entry (E Id)
- { return Flag132 (Id); }
-
- INLINE B Is_Asynchronous (E Id)
- { return Flag81 (Id); }
-
- INLINE B Is_Atomic (E Id)
- { return Flag85 (Id); }
-
- INLINE B Is_Bit_Packed_Array (E Id)
- { return Flag122 (Implementation_Base_Type (Id)); }
-
- INLINE B Is_Called (E Id)
- { return Flag102 (Id); }
-
- INLINE B Is_Character_Type (E Id)
- { return Flag63 (Id); }
-
- INLINE B Is_Child_Unit (E Id)
- { return Flag73 (Id); }
-
- INLINE B Is_Class_Wide_Equivalent_Type (E Id)
- { return Flag35 (Id); }
-
- INLINE B Is_Compilation_Unit (E Id)
- { return Flag149 (Id); }
-
- INLINE B Is_Completely_Hidden (E Id)
- { return Flag103 (Id); }
-
- INLINE B Is_Constr_Subt_For_U_Nominal (E Id)
- { return Flag80 (Id); }
-
- INLINE B Is_Constr_Subt_For_UN_Aliased (E Id)
- { return Flag141 (Id); }
-
- INLINE B Is_Constrained (E Id)
- { return Flag12 (Id); }
-
- INLINE B Is_Constructor (E Id)
- { return Flag76 (Id); }
-
- INLINE B Is_Controlled (E Id)
- { return Flag42 (Base_Type (Id)); }
-
- INLINE B Is_Controlling_Formal (E Id)
- { return Flag97 (Id); }
-
- INLINE B Is_CPP_Class (E Id)
- { return Flag74 (Id); }
-
- INLINE B Is_Discrim_SO_Function (E Id)
- { return Flag176 (Id); }
-
- INLINE B Is_Dispatching_Operation (E Id)
- { return Flag6 (Id); }
-
- INLINE B Is_Eliminated (E Id)
- { return Flag124 (Id); }
-
- INLINE B Is_Entry_Formal (E Id)
- { return Flag52 (Id); }
-
- INLINE B Is_Exported (E Id)
- { return Flag99 (Id); }
-
- INLINE B Is_First_Subtype (E Id)
- { return Flag70 (Id); }
-
- INLINE B Is_For_Access_Subtype (E Id)
- { return Flag118 (Id); }
-
- INLINE B Is_Formal_Subprogram (E Id)
- { return Flag111 (Id); }
-
- INLINE B Is_Frozen (E Id)
- { return Flag4 (Id); }
-
- INLINE B Is_Generic_Actual_Type (E Id)
- { return Flag94 (Id); }
-
- INLINE B Is_Generic_Instance (E Id)
- { return Flag130 (Id); }
-
- INLINE B Is_Generic_Type (E Id)
- { return Flag13 (Id); }
-
- INLINE B Is_Hidden (E Id)
- { return Flag57 (Id); }
-
- INLINE B Is_Hidden_Open_Scope (E Id)
- { return Flag171 (Id); }
-
- INLINE B Is_Immediately_Visible (E Id)
- { return Flag7 (Id); }
-
- INLINE B Is_Imported (E Id)
- { return Flag24 (Id); }
-
- INLINE B Is_Inlined (E Id)
- { return Flag11 (Id); }
-
- INLINE B Is_Instantiated (E Id)
- { return Flag126 (Id); }
-
- INLINE B Is_Internal (E Id)
- { return Flag17 (Id); }
-
- INLINE B Is_Interrupt_Handler (E Id)
- { return Flag89 (Id); }
-
- INLINE B Is_Intrinsic_Subprogram (E Id)
- { return Flag64 (Id); }
-
- INLINE B Is_Itype (E Id)
- { return Flag91 (Id); }
-
- INLINE B Is_Known_Non_Null (E Id)
- { return Flag37 (Id); }
-
- INLINE B Is_Known_Valid (E Id)
- { return Flag170 (Id); }
-
- INLINE B Is_Limited_Composite (E Id)
- { return Flag106 (Id); }
-
- INLINE B Is_Limited_Record (E Id)
- { return Flag25 (Id); }
-
- INLINE B Is_Machine_Code_Subprogram (E Id)
- { return Flag137 (Id); }
-
- INLINE B Is_Non_Static_Subtype (E Id)
- { return Flag109 (Id); }
-
- INLINE B Is_Null_Init_Proc (E Id)
- { return Flag178 (Id); }
-
- INLINE B Is_Optional_Parameter (E Id)
- { return Flag134 (Id); }
-
- INLINE B Is_Overriding_Operation (E Id)
- { return Flag39 (Id); }
-
- INLINE B Is_Package_Body_Entity (E Id)
- { return Flag160 (Id); }
-
- INLINE B Is_Packed (E Id)
- { return Flag51 (Implementation_Base_Type (Id)); }
-
- INLINE B Is_Packed_Array_Type (E Id)
- { return Flag138 (Id); }
-
- INLINE B Is_Potentially_Use_Visible (E Id)
- { return Flag9 (Id); }
-
- INLINE B Is_Preelaborated (E Id)
- { return Flag59 (Id); }
-
- INLINE B Is_Private_Composite (E Id)
- { return Flag107 (Id); }
-
- INLINE B Is_Private_Descendant (E Id)
- { return Flag53 (Id); }
-
- INLINE B Is_Psected (E Id)
- { return Flag153 (Id); }
-
- INLINE B Is_Public (E Id)
- { return Flag10 (Id); }
-
- INLINE B Is_Pure (E Id)
- { return Flag44 (Id); }
-
- INLINE B Is_Remote_Call_Interface (E Id)
- { return Flag62 (Id); }
-
- INLINE B Is_Remote_Types (E Id)
- { return Flag61 (Id); }
-
- INLINE B Is_Renaming_Of_Object (E Id)
- { return Flag112 (Id); }
-
- INLINE B Is_Shared_Passive (E Id)
- { return Flag60 (Id); }
-
- INLINE B Is_Statically_Allocated (E Id)
- { return Flag28 (Id); }
-
- INLINE B Is_Tag (E Id)
- { return Flag78 (Id); }
-
- INLINE B Is_Tagged_Type (E Id)
- { return Flag55 (Id); }
-
- INLINE B Is_True_Constant (E Id)
- { return Flag163 (Id); }
-
- INLINE B Is_Unchecked_Union (E Id)
- { return Flag117 (Id); }
-
- INLINE B Is_Unsigned_Type (E Id)
- { return Flag144 (Id); }
-
- INLINE B Is_Valued_Procedure (E Id)
- { return Flag127 (Id); }
-
- INLINE B Is_Visible_Child_Unit (E Id)
- { return Flag116 (Id); }
-
- INLINE B Is_VMS_Exception (E Id)
- { return Flag133 (Id); }
-
- INLINE B Kill_Elaboration_Checks (E Id)
- { return Flag32 (Id); }
-
- INLINE B Kill_Range_Checks (E Id)
- { return Flag33 (Id); }
-
- INLINE B Kill_Tag_Checks (E Id)
- { return Flag34 (Id); }
-
- INLINE E Last_Entity (E Id)
- { return Node20 (Id); }
-
- INLINE L Limited_Views (E Id)
- { return Elist23 (Id); }
-
- INLINE E Lit_Indexes (E Id)
- { return Node15 (Id); }
-
- INLINE E Lit_Strings (E Id)
- { return Node16 (Id); }
-
- INLINE B Machine_Radix_10 (E Id)
- { return Flag84 (Id); }
-
- INLINE E Master_Id (E Id)
- { return Node17 (Id); }
-
- INLINE B Materialize_Entity (E Id)
- { return Flag168 (Id); }
-
- INLINE M Mechanism (E Id)
- { return UI_To_Int (Uint8 (Id)); }
-
- INLINE Uint Modulus (E Id)
- { return Uint17 (Base_Type (Id)); }
-
- INLINE B Needs_Debug_Info (E Id)
- { return Flag147 (Id); }
-
- INLINE B Needs_No_Actuals (E Id)
- { return Flag22 (Id); }
-
- INLINE B Never_Set_In_Source (E Id)
- { return Flag115 (Id); }
-
- INLINE E Next_Inlined_Subprogram (E Id)
- { return Node12 (Id); }
-
- INLINE B No_Pool_Assigned (E Id)
- { return Flag131 (Root_Type (Id)); }
-
- INLINE B No_Return (E Id)
- { return Flag113 (Id); }
-
- INLINE B Non_Binary_Modulus (E Id)
- { return Flag58 (Base_Type (Id)); }
-
- INLINE E Non_Limited_View (E Id)
- { return Node17 (Id); }
-
- INLINE L Non_Limited_Views (E Id)
- { return Elist8 (Id); }
-
- INLINE B Nonzero_Is_True (E Id)
- { return Flag162 (Base_Type (Id)); }
-
- INLINE U Normalized_First_Bit (E Id)
- { return Uint8 (Id); }
-
- INLINE U Normalized_Position (E Id)
- { return Uint14 (Id); }
-
- INLINE U Normalized_Position_Max (E Id)
- { return Uint10 (Id); }
-
- INLINE E Object_Ref (E Id)
- { return Node17 (Id); }
-
- INLINE E Original_Array_Type (E Id)
- { return Node21 (Id); }
-
- INLINE E Original_Record_Component (E Id)
- { return Node22 (Id); }
-
- INLINE E Packed_Array_Type (E Id)
- { return Node23 (Id); }
-
- INLINE E Parent_Subtype (E Id)
- { return Node19 (Id); }
-
- INLINE L Primitive_Operations (E Id)
- { return Elist15 (Id); }
-
- INLINE E Prival (E Id)
- { return Node17 (Id); }
-
- INLINE L Privals_Chain (E Id)
- { return Elist23 (Id); }
-
- INLINE L Private_Dependents (E Id)
- { return Elist18 (Id); }
-
- INLINE N Private_View (E Id)
- { return Node22 (Id); }
-
- INLINE E Protected_Body_Subprogram (E Id)
- { return Node11 (Id); }
-
- INLINE E Protected_Formal (E Id)
- { return Node22 (Id); }
-
- INLINE N Protected_Operation (E Id)
- { return Node23 (Id); }
-
- INLINE B Reachable (E Id)
- { return Flag49 (Id); }
-
- INLINE B Referenced (E Id)
- { return Flag156 (Id); }
-
- INLINE B Referenced_As_LHS (E Id)
- { return Flag36 (Id); }
-
- INLINE N Referenced_Object (E Id)
- { return Node10 (Id); }
-
- INLINE N Register_Exception_Call (E Id)
- { return Node20 (Id); }
-
- INLINE E Related_Array_Object (E Id)
- { return Node19 (Id); }
-
- INLINE E Related_Instance (E Id)
- { return Node15 (Id); }
-
- INLINE N Renamed_Entity (E Id)
- { return Node18 (Id); }
-
- INLINE N Renamed_Object (E Id)
- { return Node18 (Id); }
-
- INLINE U Renaming_Map (E Id)
- { return Uint9 (Id); }
-
- INLINE B Return_Present (E Id)
- { return Flag54 (Id); }
-
- INLINE B Returns_By_Ref (E Id)
- { return Flag90 (Id); }
-
- INLINE B Reverse_Bit_Order (E Id)
- { return Flag164 (Base_Type (Id)); }
-
- INLINE U RM_Size (E Id)
- { return Uint13 (Id); }
-
- INLINE N Scalar_Range (E Id)
- { return Node20 (Id); }
-
- INLINE U Scale_Value (E Id)
- { return Uint15 (Id); }
-
- INLINE U Scope_Depth_Value (E Id)
- { return Uint22 (Id); }
-
- INLINE B Sec_Stack_Needed_For_Return (E Id)
- { return Flag167 (Id); }
-
- INLINE S Shadow_Entities (E Id)
- { return List14 (Id); }
-
- INLINE E Shared_Var_Assign_Proc (E Id)
- { return Node22 (Id); }
-
- INLINE E Shared_Var_Read_Proc (E Id)
- { return Node15 (Id); }
-
- INLINE N Size_Check_Code (E Id)
- { return Node19 (Id); }
-
- INLINE B Size_Depends_On_Discriminant (E Id)
- { return Flag177 (Id); }
-
- INLINE B Size_Known_At_Compile_Time (E Id)
- { return Flag92 (Id); }
-
- INLINE R Small_Value (E Id)
- { return Ureal21 (Id); }
-
- INLINE E Spec_Entity (E Id)
- { return Node19 (Id); }
-
- INLINE E Storage_Size_Variable (E Id)
- { return Node15 (Implementation_Base_Type (Id)); }
-
- INLINE L Stored_Constraint (E Id)
- { return Elist23 (Id); }
-
- INLINE B Strict_Alignment (E Id)
- { return Flag145 (Implementation_Base_Type (Id)); }
-
- INLINE U String_Literal_Length (E Id)
- { return Uint16 (Id); }
-
- INLINE N String_Literal_Low_Bound (E Id)
- { return Node15 (Id); }
-
- INLINE B Suppress_Elaboration_Warnings (E Id)
- { return Flag148 (Id); }
-
- INLINE B Suppress_Init_Proc (E Id)
- { return Flag105 (Base_Type (Id)); }
-
- INLINE B Suppress_Style_Checks (E Id)
- { return Flag165 (Id); }
-
- INLINE B Treat_As_Volatile (E Id)
- { return Flag41 (Id); }
-
- INLINE E Underlying_Full_View (E Id)
- { return Node19 (Id); }
-
- INLINE N Unset_Reference (E Id)
- { return Node16 (Id); }
-
- INLINE B Uses_Sec_Stack (E Id)
- { return Flag95 (Id); }
-
- INLINE B Vax_Float (E Id)
- { return Flag151 (Base_Type (Id)); }
-
- INLINE B Warnings_Off (E Id)
- { return Flag96 (Id); }
-
- INLINE B Is_Access_Type (E Id)
- { return IN (Ekind (Id), Access_Kind); }
-
- INLINE B Is_Array_Type (E Id)
- { return IN (Ekind (Id), Array_Kind); }
-
- INLINE B Is_Class_Wide_Type (E Id)
- { return IN (Ekind (Id), Class_Wide_Kind); }
-
- INLINE B Is_Composite_Type (E Id)
- { return IN (Ekind (Id), Composite_Kind); }
-
- INLINE B Is_Concurrent_Body (E Id)
- { return IN (Ekind (Id), Concurrent_Body_Kind); }
-
- INLINE B Is_Concurrent_Record_Type (E Id)
- { return Flag20 (Id); }
-
- INLINE B Is_Concurrent_Type (E Id)
- { return IN (Ekind (Id), Concurrent_Kind); }
-
- INLINE B Is_Decimal_Fixed_Point_Type (E Id)
- { return IN (Ekind (Id), Decimal_Fixed_Point_Kind); }
-
- INLINE B Is_Digits_Type (E Id)
- { return IN (Ekind (Id), Digits_Kind); }
-
- INLINE B Is_Discrete_Or_Fixed_Point_Type (E Id)
- { return IN (Ekind (Id), Discrete_Or_Fixed_Point_Kind); }
-
- INLINE B Is_Discrete_Type (E Id)
- { return IN (Ekind (Id), Discrete_Kind); }
-
- INLINE B Is_Elementary_Type (E Id)
- { return IN (Ekind (Id), Elementary_Kind); }
-
- INLINE B Is_Entry (E Id)
- { return IN (Ekind (Id), Entry_Kind); }
-
- INLINE B Is_Enumeration_Type (E Id)
- { return IN (Ekind (Id), Enumeration_Kind); }
-
- INLINE B Is_Fixed_Point_Type (E Id)
- { return IN (Ekind (Id), Fixed_Point_Kind); }
-
- INLINE B Is_Floating_Point_Type (E Id)
- { return IN (Ekind (Id), Float_Kind); }
-
- INLINE B Is_Formal (E Id)
- { return IN (Ekind (Id), Formal_Kind); }
-
- INLINE B Is_Generic_Subprogram (E Id)
- { return IN (Ekind (Id), Generic_Subprogram_Kind); }
-
- INLINE B Is_Generic_Unit (E Id)
- { return IN (Ekind (Id), Generic_Unit_Kind); }
-
- INLINE B Is_Incomplete_Or_Private_Type (E Id)
- { return IN (Ekind (Id), Incomplete_Or_Private_Kind); }
-
- INLINE B Is_Integer_Type (E Id)
- { return IN (Ekind (Id), Integer_Kind); }
-
- INLINE B Is_Modular_Integer_Type (E Id)
- { return IN (Ekind (Id), Modular_Integer_Kind); }
-
- INLINE B Is_Named_Number (E Id)
- { return IN (Ekind (Id), Named_Kind); }
-
- INLINE B Is_Numeric_Type (E Id)
- { return IN (Ekind (Id), Numeric_Kind); }
-
- INLINE B Is_Object (E Id)
- { return IN (Ekind (Id), Object_Kind); }
-
- INLINE B Is_Ordinary_Fixed_Point_Type (E Id)
- { return IN (Ekind (Id), Ordinary_Fixed_Point_Kind); }
-
- INLINE B Is_Overloadable (E Id)
- { return IN (Ekind (Id), Overloadable_Kind); }
-
- INLINE B Is_Private_Type (E Id)
- { return IN (Ekind (Id), Private_Kind); }
-
- INLINE B Is_Protected_Type (E Id)
- { return IN (Ekind (Id), Protected_Kind); }
-
- INLINE B Is_Real_Type (E Id)
- { return IN (Ekind (Id), Real_Kind); }
-
- INLINE B Is_Record_Type (E Id)
- { return IN (Ekind (Id), Record_Kind); }
-
- INLINE B Is_Scalar_Type (E Id)
- { return IN (Ekind (Id), Scalar_Kind); }
-
- INLINE B Is_Signed_Integer_Type (E Id)
- { return IN (Ekind (Id), Signed_Integer_Kind); }
-
- INLINE B Is_Subprogram (E Id)
- { return IN (Ekind (Id), Subprogram_Kind); }
-
- INLINE B Is_Task_Type (E Id)
- { return IN (Ekind (Id), Task_Kind); }
-
- INLINE B Is_Type (E Id)
- { return IN (Ekind (Id), Type_Kind); }
-
- INLINE N Entry_Index_Type (E Id)
- { return Etype (Discrete_Subtype_Definition (Parent (Id))); }
-
- INLINE Node_Id Next_Index (Node_Id Id)
- { return Next (Id); }
-
- INLINE E Next_Literal (E Id)
- { return Next (Id); }
-
- INLINE Formal_Kind Parameter_Mode (E Id)
- { return Ekind (Id); }
-
-/* End of einfo.h (C version of Einfo package specification) */
diff --git a/gcc/ada/errno.c b/gcc/ada/errno.c
index c1b8ec9485a..fc6964b4ec2 100644
--- a/gcc/ada/errno.c
+++ b/gcc/ada/errno.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -42,14 +42,13 @@
#include <errno.h>
int
-__get_errno()
+__get_errno(void)
{
return errno;
}
void
-__set_errno(err)
- int err;
+__set_errno(int err)
{
errno = err;
}
diff --git a/gcc/ada/errout.adb b/gcc/ada/errout.adb
index fb1142e2cd4..fb1cc76909a 100644
--- a/gcc/ada/errout.adb
+++ b/gcc/ada/errout.adb
@@ -1408,6 +1408,12 @@ package body Errout is
Warnings.Table (Warnings.Last).Start := Source_Ptr'First;
Warnings.Table (Warnings.Last).Stop := Source_Ptr'Last;
end if;
+
+ -- Set the error nodes to Empty to avoid uninitialized variable
+ -- references for saves/restores/moves.
+
+ Error_Msg_Node_1 := Empty;
+ Error_Msg_Node_2 := Empty;
end Initialize;
-----------------
diff --git a/gcc/ada/exit.c b/gcc/ada/exit.c
index dbb54a1a919..2f21067faac 100644
--- a/gcc/ada/exit.c
+++ b/gcc/ada/exit.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -50,8 +50,7 @@
int gnat_exit_status = 0;
void
-__gnat_set_exit_status (i)
- int i;
+__gnat_set_exit_status (int i)
{
gnat_exit_status = i;
}
diff --git a/gcc/ada/exp_aggr.adb b/gcc/ada/exp_aggr.adb
index 0985ead93a7..9c233995c8f 100644
--- a/gcc/ada/exp_aggr.adb
+++ b/gcc/ada/exp_aggr.adb
@@ -33,6 +33,7 @@ with Expander; use Expander;
with Exp_Util; use Exp_Util;
with Exp_Ch3; use Exp_Ch3;
with Exp_Ch7; use Exp_Ch7;
+with Exp_Ch9; use Exp_Ch9;
with Freeze; use Freeze;
with Hostparm; use Hostparm;
with Itypes; use Itypes;
@@ -70,6 +71,10 @@ package body Exp_Aggr is
-- statement of variant part will usually be small and probably in near
-- sorted order.
+ function Has_Default_Init_Comps (N : Node_Id) return Boolean;
+ -- N is an aggregate (record or array). Checks the presence of default
+ -- initialization (<>) in any component (Ada0Y: AI-287)
+
------------------------------------------------------
-- Local subprograms for Record Aggregate Expansion --
------------------------------------------------------
@@ -97,12 +102,12 @@ package body Exp_Aggr is
-- assignments component per component.
function Build_Record_Aggr_Code
- (N : Node_Id;
- Typ : Entity_Id;
- Target : Node_Id;
- Flist : Node_Id := Empty;
- Obj : Entity_Id := Empty)
- return List_Id;
+ (N : Node_Id;
+ Typ : Entity_Id;
+ Target : Node_Id;
+ Flist : Node_Id := Empty;
+ Obj : Entity_Id := Empty;
+ Is_Limited_Ancestor_Expansion : Boolean := False) return List_Id;
-- N is an N_Aggregate or a N_Extension_Aggregate. Typ is the type
-- of the aggregate. Target is an expression containing the
-- location on which the component by component assignments will
@@ -113,6 +118,8 @@ package body Exp_Aggr is
-- object declaration and dynamic allocation cases, it contains
-- an entity that allows to know if the value being created needs to be
-- attached to the final list in case of pragma finalize_Storage_Only.
+ -- Is_Limited_Ancestor_Expansion indicates that the function has been
+ -- called recursively to expand the limited ancestor to avoid copying it.
function Has_Mutable_Components (Typ : Entity_Id) return Boolean;
-- Return true if one of the component is of a discriminated type with
@@ -164,12 +171,12 @@ package body Exp_Aggr is
function Build_Array_Aggr_Code
(N : Node_Id;
+ Ctype : Entity_Id;
Index : Node_Id;
Into : Node_Id;
Scalar_Comp : Boolean;
Indices : List_Id := No_List;
- Flist : Node_Id := Empty)
- return List_Id;
+ Flist : Node_Id := Empty) return List_Id;
-- This recursive routine returns a list of statements containing the
-- loops and assignments that are needed for the expansion of the array
-- aggregate N.
@@ -200,8 +207,7 @@ package body Exp_Aggr is
Typ : Entity_Id;
Target : Node_Id;
Flist : Node_Id := Empty;
- Obj : Entity_Id := Empty)
- return List_Id;
+ Obj : Entity_Id := Empty) return List_Id;
-- N is a nested (record or array) aggregate that has been marked
-- with 'Delay_Expansion'. Typ is the expected type of the
-- aggregate and Target is a (duplicable) expression that will
@@ -218,8 +224,7 @@ package body Exp_Aggr is
function Make_OK_Assignment_Statement
(Sloc : Source_Ptr;
Name : Node_Id;
- Expression : Node_Id)
- return Node_Id;
+ Expression : Node_Id) return Node_Id;
-- This is like Make_Assignment_Statement, except that Assignment_OK
-- is set in the left operand. All assignments built by this unit
-- use this routine. This is needed to deal with assignments to
@@ -394,12 +399,12 @@ package body Exp_Aggr is
function Build_Array_Aggr_Code
(N : Node_Id;
+ Ctype : Entity_Id;
Index : Node_Id;
Into : Node_Id;
Scalar_Comp : Boolean;
Indices : List_Id := No_List;
- Flist : Node_Id := Empty)
- return List_Id
+ Flist : Node_Id := Empty) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
Index_Base : constant Entity_Id := Base_Type (Etype (Index));
@@ -428,6 +433,9 @@ package body Exp_Aggr is
-- Into (Indices, Ind) := Expr;
--
-- Otherwise we call Build_Code recursively.
+ --
+ -- Ada0Y (AI-287): In case of default initialized component, Expr is
+ -- empty and we generate a call to the corresponding IP subprogram.
function Gen_Loop (L, H : Node_Id; Expr : Node_Id) return List_Id;
-- Nodes L and H must be side-effect free expressions.
@@ -654,7 +662,13 @@ package body Exp_Aggr is
Res : List_Id;
begin
- if Nkind (Parent (Expr)) = N_Component_Association
+ -- Ada0Y (AI-287): Do nothing else in case of default initialized
+ -- component
+
+ if not Present (Expr) then
+ return Lis;
+
+ elsif Nkind (Parent (Expr)) = N_Component_Association
and then Present (Loop_Actions (Parent (Expr)))
then
Append_List (Lis, Loop_Actions (Parent (Expr)));
@@ -690,15 +704,20 @@ package body Exp_Aggr is
F := Find_Final_List (Current_Scope);
end if;
else
- F := 0;
+ F := Empty;
end if;
if Present (Next_Index (Index)) then
return
Add_Loop_Actions (
Build_Array_Aggr_Code
- (Expr, Next_Index (Index),
- Into, Scalar_Comp, New_Indices, F));
+ (N => Expr,
+ Ctype => Ctype,
+ Index => Next_Index (Index),
+ Into => Into,
+ Scalar_Comp => Scalar_Comp,
+ Indices => New_Indices,
+ Flist => F));
end if;
-- If we get here then we are at a bottom-level (sub-)aggregate
@@ -711,7 +730,12 @@ package body Exp_Aggr is
Set_Assignment_OK (Indexed_Comp);
- if Nkind (Expr) = N_Qualified_Expression then
+ -- Ada0Y (AI-287): In case of default initialized component, Expr
+ -- is not present (and therefore we also initialize Expr_Q to empty)
+
+ if not Present (Expr) then
+ Expr_Q := Empty;
+ elsif Nkind (Expr) = N_Qualified_Expression then
Expr_Q := Expression (Expr);
else
Expr_Q := Expr;
@@ -721,34 +745,49 @@ package body Exp_Aggr is
and then Etype (N) /= Any_Composite
then
Comp_Type := Component_Type (Etype (N));
+ pragma Assert (Comp_Type = Ctype); -- AI-287
elsif Present (Next (First (New_Indices))) then
- -- This is a multidimensional array. Recover the component
- -- type from the outermost aggregate, because subaggregates
- -- do not have an assigned type.
+ -- Ada0Y (AI-287): Do nothing in case of default initialized
+ -- component because we have received the component type in
+ -- the formal parameter Ctype.
+ -- ??? I have added some assert pragmas to check if this new
+ -- formal can be used to replace this code in all cases.
- declare
- P : Node_Id := Parent (Expr);
+ if Present (Expr) then
- begin
- while Present (P) loop
+ -- This is a multidimensional array. Recover the component
+ -- type from the outermost aggregate, because subaggregates
+ -- do not have an assigned type.
- if Nkind (P) = N_Aggregate
- and then Present (Etype (P))
- then
- Comp_Type := Component_Type (Etype (P));
- exit;
+ declare
+ P : Node_Id := Parent (Expr);
- else
- P := Parent (P);
- end if;
- end loop;
- end;
+ begin
+ while Present (P) loop
+
+ if Nkind (P) = N_Aggregate
+ and then Present (Etype (P))
+ then
+ Comp_Type := Component_Type (Etype (P));
+ exit;
+
+ else
+ P := Parent (P);
+ end if;
+ end loop;
+ pragma Assert (Comp_Type = Ctype); -- AI-287
+ end;
+ end if;
end if;
- if Nkind (Expr_Q) = N_Aggregate
- or else Nkind (Expr_Q) = N_Extension_Aggregate
+ -- Ada0Y (AI-287): We only analyze the expression in case of non
+ -- default initialized components (otherwise Expr_Q is not present)
+
+ if Present (Expr_Q)
+ and then (Nkind (Expr_Q) = N_Aggregate
+ or else Nkind (Expr_Q) = N_Extension_Aggregate)
then
-- At this stage the Expression may not have been
-- analyzed yet because the array aggregate code has not
@@ -769,59 +808,73 @@ package body Exp_Aggr is
end if;
end if;
- -- Now generate the assignment with no associated controlled
- -- actions since the target of the assignment may not have
- -- been initialized, it is not possible to Finalize it as
- -- expected by normal controlled assignment. The rest of the
- -- controlled actions are done manually with the proper
- -- finalization list coming from the context.
+ -- Ada0Y (AI-287): In case of default initialized component, call
+ -- the initialization subprogram associated with the component type
- A :=
- Make_OK_Assignment_Statement (Loc,
- Name => Indexed_Comp,
- Expression => New_Copy_Tree (Expr));
+ if not Present (Expr) then
- if Present (Comp_Type) and then Controlled_Type (Comp_Type) then
- Set_No_Ctrl_Actions (A);
- end if;
+ Append_List_To (L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Indexed_Comp,
+ Typ => Ctype,
+ With_Default_Init => True));
- Append_To (L, A);
+ else
- -- Adjust the tag if tagged (because of possible view
- -- conversions), unless compiling for the Java VM
- -- where tags are implicit.
+ -- Now generate the assignment with no associated controlled
+ -- actions since the target of the assignment may not have
+ -- been initialized, it is not possible to Finalize it as
+ -- expected by normal controlled assignment. The rest of the
+ -- controlled actions are done manually with the proper
+ -- finalization list coming from the context.
- if Present (Comp_Type)
- and then Is_Tagged_Type (Comp_Type)
- and then not Java_VM
- then
A :=
Make_OK_Assignment_Statement (Loc,
- Name =>
- Make_Selected_Component (Loc,
- Prefix => New_Copy_Tree (Indexed_Comp),
- Selector_Name =>
- New_Reference_To (Tag_Component (Comp_Type), Loc)),
+ Name => Indexed_Comp,
+ Expression => New_Copy_Tree (Expr));
- Expression =>
- Unchecked_Convert_To (RTE (RE_Tag),
- New_Reference_To (
- Access_Disp_Table (Comp_Type), Loc)));
+ if Present (Comp_Type) and then Controlled_Type (Comp_Type) then
+ Set_No_Ctrl_Actions (A);
+ end if;
Append_To (L, A);
- end if;
- -- Adjust and Attach the component to the proper final list
- -- which can be the controller of the outer record object or
- -- the final list associated with the scope
+ -- Adjust the tag if tagged (because of possible view
+ -- conversions), unless compiling for the Java VM
+ -- where tags are implicit.
- if Present (Comp_Type) and then Controlled_Type (Comp_Type) then
- Append_List_To (L,
- Make_Adjust_Call (
- Ref => New_Copy_Tree (Indexed_Comp),
- Typ => Comp_Type,
- Flist_Ref => F,
- With_Attach => Make_Integer_Literal (Loc, 1)));
+ if Present (Comp_Type)
+ and then Is_Tagged_Type (Comp_Type)
+ and then not Java_VM
+ then
+ A :=
+ Make_OK_Assignment_Statement (Loc,
+ Name =>
+ Make_Selected_Component (Loc,
+ Prefix => New_Copy_Tree (Indexed_Comp),
+ Selector_Name =>
+ New_Reference_To (Tag_Component (Comp_Type), Loc)),
+
+ Expression =>
+ Unchecked_Convert_To (RTE (RE_Tag),
+ New_Reference_To (
+ Access_Disp_Table (Comp_Type), Loc)));
+
+ Append_To (L, A);
+ end if;
+
+ -- Adjust and Attach the component to the proper final list
+ -- which can be the controller of the outer record object or
+ -- the final list associated with the scope
+
+ if Present (Comp_Type) and then Controlled_Type (Comp_Type) then
+ Append_List_To (L,
+ Make_Adjust_Call (
+ Ref => New_Copy_Tree (Indexed_Comp),
+ Typ => Comp_Type,
+ Flist_Ref => F,
+ With_Attach => Make_Integer_Literal (Loc, 1)));
+ end if;
end if;
return Add_Loop_Actions (L);
@@ -855,21 +908,29 @@ package body Exp_Aggr is
if Empty_Range (L, H) then
Append_To (S, Make_Null_Statement (Loc));
- -- The expression must be type-checked even though no component
- -- of the aggregate will have this value. This is done only for
- -- actual components of the array, not for subaggregates. Do the
- -- check on a copy, because the expression may be shared among
- -- several choices, some of which might be non-null.
+ -- Ada0Y (AI-287): Nothing else need to be done in case of
+ -- default initialized component
- if Present (Etype (N))
- and then Is_Array_Type (Etype (N))
- and then No (Next_Index (Index))
- then
- Expander_Mode_Save_And_Set (False);
- Tcopy := New_Copy_Tree (Expr);
- Set_Parent (Tcopy, N);
- Analyze_And_Resolve (Tcopy, Component_Type (Etype (N)));
- Expander_Mode_Restore;
+ if not Present (Expr) then
+ null;
+
+ else
+ -- The expression must be type-checked even though no component
+ -- of the aggregate will have this value. This is done only for
+ -- actual components of the array, not for subaggregates. Do
+ -- the check on a copy, because the expression may be shared
+ -- among several choices, some of which might be non-null.
+
+ if Present (Etype (N))
+ and then Is_Array_Type (Etype (N))
+ and then No (Next_Index (Index))
+ then
+ Expander_Mode_Save_And_Set (False);
+ Tcopy := New_Copy_Tree (Expr);
+ Set_Parent (Tcopy, N);
+ Analyze_And_Resolve (Tcopy, Component_Type (Etype (N)));
+ Expander_Mode_Restore;
+ end if;
end if;
return S;
@@ -889,6 +950,7 @@ package body Exp_Aggr is
and then Local_Compile_Time_Known_Value (H)
and then Local_Expr_Value (H) - Local_Expr_Value (L) <= 2
then
+
Append_List_To (S, Gen_Assign (New_Copy_Tree (L), Expr));
Append_List_To (S, Gen_Assign (Add (1, To => L), Expr));
@@ -1082,7 +1144,8 @@ package body Exp_Aggr is
Expr : Node_Id;
Typ : Entity_Id;
- Others_Expr : Node_Id := Empty;
+ Others_Expr : Node_Id := Empty;
+ Others_Mbox_Present : Boolean := False;
Aggr_L : constant Node_Id := Low_Bound (Aggregate_Bounds (N));
Aggr_H : constant Node_Id := High_Bound (Aggregate_Bounds (N));
@@ -1094,8 +1157,8 @@ package body Exp_Aggr is
Aggr_High : constant Node_Id := Duplicate_Subexpr_No_Checks (Aggr_H);
-- After Duplicate_Subexpr these are side-effect free.
- Low : Node_Id;
- High : Node_Id;
+ Low : Node_Id;
+ High : Node_Id;
Nb_Choices : Nat := 0;
Table : Case_Table_Type (1 .. Number_Of_Choices (N));
@@ -1142,7 +1205,12 @@ package body Exp_Aggr is
while Present (Choice) loop
if Nkind (Choice) = N_Others_Choice then
Set_Loop_Actions (Assoc, New_List);
- Others_Expr := Expression (Assoc);
+
+ if Box_Present (Assoc) then
+ Others_Mbox_Present := True;
+ else
+ Others_Expr := Expression (Assoc);
+ end if;
exit;
end if;
@@ -1153,9 +1221,15 @@ package body Exp_Aggr is
end if;
Nb_Choices := Nb_Choices + 1;
- Table (Nb_Choices) := (Choice_Lo => Low,
- Choice_Hi => High,
- Choice_Node => Expression (Assoc));
+ if Box_Present (Assoc) then
+ Table (Nb_Choices) := (Choice_Lo => Low,
+ Choice_Hi => High,
+ Choice_Node => Empty);
+ else
+ Table (Nb_Choices) := (Choice_Lo => Low,
+ Choice_Hi => High,
+ Choice_Node => Expression (Assoc));
+ end if;
Next (Choice);
end loop;
@@ -1183,7 +1257,7 @@ package body Exp_Aggr is
-- We don't need to generate loops over empty gaps, but if there is
-- a single empty range we must analyze the expression for semantics
- if Present (Others_Expr) then
+ if Present (Others_Expr) or else Others_Mbox_Present then
declare
First : Boolean := True;
@@ -1252,12 +1326,21 @@ package body Exp_Aggr is
if Present (Component_Associations (N)) then
Assoc := Last (Component_Associations (N));
- Expr := Expression (Assoc);
- Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L),
- Aggr_High,
- Expr),
- To => New_Code);
+ -- Ada0Y (AI-287)
+ if Box_Present (Assoc) then
+ Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L),
+ Aggr_High,
+ Empty),
+ To => New_Code);
+ else
+ Expr := Expression (Assoc);
+
+ Append_List (Gen_While (Add (Nb_Elements, To => Aggr_L),
+ Aggr_High,
+ Expr), -- AI-287
+ To => New_Code);
+ end if;
end if;
end if;
@@ -1269,12 +1352,12 @@ package body Exp_Aggr is
----------------------------
function Build_Record_Aggr_Code
- (N : Node_Id;
- Typ : Entity_Id;
- Target : Node_Id;
- Flist : Node_Id := Empty;
- Obj : Entity_Id := Empty)
- return List_Id
+ (N : Node_Id;
+ Typ : Entity_Id;
+ Target : Node_Id;
+ Flist : Node_Id := Empty;
+ Obj : Entity_Id := Empty;
+ Is_Limited_Ancestor_Expansion : Boolean := False) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
L : constant List_Id := New_List;
@@ -1325,8 +1408,7 @@ package body Exp_Aggr is
Typ : Entity_Id;
F : Node_Id;
Attach : Node_Id;
- Init_Pr : Boolean)
- return List_Id;
+ Init_Pr : Boolean) return List_Id;
-- returns the list of statements necessary to initialize the internal
-- controller of the (possible) ancestor typ into target and attach
-- it to finalization list F. Init_Pr conditions the call to the
@@ -1522,8 +1604,7 @@ package body Exp_Aggr is
Typ : Entity_Id;
F : Node_Id;
Attach : Node_Id;
- Init_Pr : Boolean)
- return List_Id
+ Init_Pr : Boolean) return List_Id
is
L : constant List_Id := New_List;
Ref : Node_Id;
@@ -1540,20 +1621,58 @@ package body Exp_Aggr is
Selector_Name => Make_Identifier (Loc, Name_uController));
Set_Assignment_OK (Ref);
- if Init_Pr then
- Append_List_To (L,
- Build_Initialization_Call (Loc,
- Id_Ref => Ref,
- Typ => RTE (RE_Record_Controller),
- In_Init_Proc => Within_Init_Proc));
- end if;
+ -- Ada0Y (AI-287): Give support to default initialization of limited
+ -- types and components
+
+ if (Nkind (Target) = N_Identifier
+ and then Present (Etype (Target))
+ and then Is_Limited_Type (Etype (Target)))
+ or else (Nkind (Target) = N_Selected_Component
+ and then Present (Etype (Selector_Name (Target)))
+ and then Is_Limited_Type (Etype (Selector_Name (Target))))
+ or else (Nkind (Target) = N_Unchecked_Type_Conversion
+ and then Present (Etype (Target))
+ and then Is_Limited_Type (Etype (Target)))
+ or else (Nkind (Target) = N_Unchecked_Expression
+ and then Nkind (Expression (Target)) = N_Indexed_Component
+ and then Present (Etype (Prefix (Expression (Target))))
+ and then Is_Limited_Type
+ (Etype (Prefix (Expression (Target)))))
+ then
- Append_To (L,
- Make_Procedure_Call_Statement (Loc,
- Name =>
- New_Reference_To (Find_Prim_Op (RTE (RE_Record_Controller),
- Name_Initialize), Loc),
- Parameter_Associations => New_List (New_Copy_Tree (Ref))));
+ if Init_Pr then
+ Append_List_To (L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Ref,
+ Typ => RTE (RE_Limited_Record_Controller),
+ In_Init_Proc => Within_Init_Proc));
+ end if;
+
+ Append_To (L,
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Reference_To
+ (Find_Prim_Op (RTE (RE_Limited_Record_Controller),
+ Name_Initialize), Loc),
+ Parameter_Associations => New_List (New_Copy_Tree (Ref))));
+
+ else
+ if Init_Pr then
+ Append_List_To (L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Ref,
+ Typ => RTE (RE_Record_Controller),
+ In_Init_Proc => Within_Init_Proc));
+ end if;
+
+ Append_To (L,
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Reference_To (Find_Prim_Op (RTE (RE_Record_Controller),
+ Name_Initialize), Loc),
+ Parameter_Associations => New_List (New_Copy_Tree (Ref))));
+
+ end if;
Append_To (L,
Make_Attach_Call (
@@ -1636,11 +1755,22 @@ package body Exp_Aggr is
Ref := Convert_To (Init_Typ, New_Copy_Tree (Target));
Set_Assignment_OK (Ref);
- Append_List_To (Start_L,
- Build_Initialization_Call (Loc,
- Id_Ref => Ref,
- Typ => Init_Typ,
- In_Init_Proc => Within_Init_Proc));
+ if Has_Default_Init_Comps (N)
+ or else Has_Task (Base_Type (Init_Typ))
+ then
+ Append_List_To (Start_L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Ref,
+ Typ => Init_Typ,
+ In_Init_Proc => Within_Init_Proc,
+ With_Default_Init => True));
+ else
+ Append_List_To (Start_L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Ref,
+ Typ => Init_Typ,
+ In_Init_Proc => Within_Init_Proc));
+ end if;
if Is_Constrained (Entity (A))
and then Has_Discriminants (Entity (A))
@@ -1648,6 +1778,21 @@ package body Exp_Aggr is
Check_Ancestor_Discriminants (Entity (A));
end if;
+ -- Ada0Y (AI-287): If the ancestor part is a limited type, a
+ -- recursive call expands the ancestor.
+
+ elsif Is_Limited_Type (Etype (A)) then
+ Ancestor_Is_Expression := True;
+
+ Append_List_To (Start_L,
+ Build_Record_Aggr_Code (
+ N => Expression (A),
+ Typ => Etype (Expression (A)),
+ Target => Target,
+ Flist => Flist,
+ Obj => Obj,
+ Is_Limited_Ancestor_Expansion => True));
+
-- If the ancestor part is an expression "E", we generate
-- T(tmp) := E;
@@ -1767,6 +1912,52 @@ package body Exp_Aggr is
while Present (Comp) loop
Selector := Entity (First (Choices (Comp)));
+ -- Ada0Y (AI-287): Default initialization of a limited component
+
+ if Box_Present (Comp)
+ and then Is_Limited_Type (Etype (Selector))
+ then
+
+ -- Ada0Y (AI-287): If the component type has tasks then generate
+ -- the activation chain and master entities (except in case of an
+ -- allocator because in that case these entities are generated
+ -- by Build_Task_Allocate_Block_With_Init_Stmts)
+
+ declare
+ Ctype : Entity_Id := Etype (Selector);
+ Inside_Allocator : Boolean := False;
+ P : Node_Id := Parent (N);
+
+ begin
+ if Is_Task_Type (Ctype) or else Has_Task (Ctype) then
+ while Present (P) loop
+ if Nkind (P) = N_Allocator then
+ Inside_Allocator := True;
+ exit;
+ end if;
+
+ P := Parent (P);
+ end loop;
+
+ if not Inside_Init_Proc and not Inside_Allocator then
+ Build_Activation_Chain_Entity (N);
+ Build_Master_Entity (Etype (N));
+ end if;
+ end if;
+ end;
+
+ Append_List_To (L,
+ Build_Initialization_Call (Loc,
+ Id_Ref => Make_Selected_Component (Loc,
+ Prefix => New_Copy_Tree (Target),
+ Selector_Name => New_Occurrence_Of (Selector,
+ Loc)),
+ Typ => Etype (Selector),
+ With_Default_Init => True));
+
+ goto Next_Comp;
+ end if;
+
-- ???
if Ekind (Selector) /= E_Discriminant
@@ -1900,6 +2091,8 @@ package body Exp_Aggr is
end;
end if;
+ <<Next_Comp>>
+
Next (Comp);
end loop;
@@ -1997,7 +2190,9 @@ package body Exp_Aggr is
-- In the Has_Controlled component case, all the intermediate
-- controllers must be initialized
- if Has_Controlled_Component (Typ) then
+ if Has_Controlled_Component (Typ)
+ and not Is_Limited_Ancestor_Expansion
+ then
declare
Inner_Typ : Entity_Id;
Outer_Typ : Entity_Id;
@@ -2135,10 +2330,26 @@ package body Exp_Aggr is
Access_Type : constant Entity_Id := Etype (Temp);
begin
- Insert_Actions_After (Decl,
- Late_Expansion (Aggr, Typ, Occ,
- Find_Final_List (Access_Type),
- Associated_Final_Chain (Base_Type (Access_Type))));
+ if Has_Default_Init_Comps (Aggr) then
+ declare
+ L : constant List_Id := New_List;
+ Init_Stmts : List_Id;
+
+ begin
+ Init_Stmts := Late_Expansion (Aggr, Typ, Occ,
+ Find_Final_List (Access_Type),
+ Associated_Final_Chain (Base_Type (Access_Type)));
+
+ Build_Task_Allocate_Block_With_Init_Stmts (L, Aggr, Init_Stmts);
+ Insert_Actions_After (Decl, L);
+ end;
+
+ else
+ Insert_Actions_After (Decl,
+ Late_Expansion (Aggr, Typ, Occ,
+ Find_Final_List (Access_Type),
+ Associated_Final_Chain (Base_Type (Access_Type))));
+ end if;
end Convert_Aggr_In_Allocator;
--------------------------------
@@ -2359,10 +2570,9 @@ package body Exp_Aggr is
Typ : constant Entity_Id := Etype (N);
function Flatten
- (N : Node_Id;
- Ix : Node_Id;
- Ixb : Node_Id)
- return Boolean;
+ (N : Node_Id;
+ Ix : Node_Id;
+ Ixb : Node_Id) return Boolean;
-- Convert the aggregate into a purely positional form if possible.
function Is_Flat (N : Node_Id; Dims : Int) return Boolean;
@@ -2373,10 +2583,9 @@ package body Exp_Aggr is
-------------
function Flatten
- (N : Node_Id;
- Ix : Node_Id;
- Ixb : Node_Id)
- return Boolean
+ (N : Node_Id;
+ Ix : Node_Id;
+ Ixb : Node_Id) return Boolean
is
Loc : constant Source_Ptr := Sloc (N);
Blo : constant Node_Id := Type_Low_Bound (Etype (Ixb));
@@ -2643,6 +2852,14 @@ package body Exp_Aggr is
-- Start of processing for Convert_To_Positional
begin
+ -- Ada0Y (AI-287): Do not convert in case of default initialized
+ -- components because in this case will need to call the corresponding
+ -- IP procedure.
+
+ if Has_Default_Init_Comps (N) then
+ return;
+ end if;
+
if Is_Flat (N, Number_Dimensions (Typ)) then
return;
end if;
@@ -3764,14 +3981,19 @@ package body Exp_Aggr is
(N, Sec_Stack => Has_Controlled_Component (Typ));
end if;
- Maybe_In_Place_OK :=
- Comes_From_Source (N)
- and then Nkind (Parent (N)) = N_Assignment_Statement
- and then not Is_Bit_Packed_Array (Typ)
- and then not Has_Controlled_Component (Typ)
- and then In_Place_Assign_OK;
+ if Has_Default_Init_Comps (N) then
+ Maybe_In_Place_OK := False;
+ else
+ Maybe_In_Place_OK :=
+ Comes_From_Source (N)
+ and then Nkind (Parent (N)) = N_Assignment_Statement
+ and then not Is_Bit_Packed_Array (Typ)
+ and then not Has_Controlled_Component (Typ)
+ and then In_Place_Assign_OK;
+ end if;
- if Comes_From_Source (Parent (N))
+ if not Has_Default_Init_Comps (N)
+ and then Comes_From_Source (Parent (N))
and then Nkind (Parent (N)) = N_Object_Declaration
and then not Must_Slide (N, Typ)
and then N = Expression (Parent (N))
@@ -3875,6 +4097,15 @@ package body Exp_Aggr is
Target := New_Reference_To (Tmp, Loc);
else
+
+ if Has_Default_Init_Comps (N) then
+
+ -- Ada0Y (AI-287): This case has not been analyzed???
+
+ pragma Assert (False);
+ null;
+ end if;
+
-- Name in assignment is explicit dereference.
Target := New_Copy (Tmp);
@@ -3882,6 +4113,7 @@ package body Exp_Aggr is
Aggr_Code :=
Build_Array_Aggr_Code (N,
+ Ctype => Ctyp,
Index => First_Index (Typ),
Into => Target,
Scalar_Comp => Is_Scalar_Type (Ctyp));
@@ -4082,6 +4314,12 @@ package body Exp_Aggr is
then
Convert_To_Assignments (N, Typ);
+ -- Ada0Y (AI-287): In case of default initialized components we convert
+ -- the aggregate into assignments.
+
+ elsif Has_Default_Init_Comps (N) then
+ Convert_To_Assignments (N, Typ);
+
elsif Has_Delayed_Nested_Aggregate_Or_Tagged_Comps then
Convert_To_Assignments (N, Typ);
@@ -4402,6 +4640,53 @@ package body Exp_Aggr is
end if;
end Expand_Record_Aggregate;
+ ----------------------------
+ -- Has_Default_Init_Comps --
+ ----------------------------
+
+ function Has_Default_Init_Comps (N : Node_Id) return Boolean is
+ Comps : constant List_Id := Component_Associations (N);
+ C : Node_Id;
+ Expr : Node_Id;
+ begin
+ pragma Assert (Nkind (N) = N_Aggregate
+ or else Nkind (N) = N_Extension_Aggregate);
+
+ if No (Comps) then
+ return False;
+ end if;
+
+ -- Check if any direct component has default initialized components
+
+ C := First (Comps);
+ while Present (C) loop
+ if Box_Present (C) then
+ return True;
+ end if;
+
+ Next (C);
+ end loop;
+
+ -- Recursive call in case of aggregate expression
+
+ C := First (Comps);
+ while Present (C) loop
+ Expr := Expression (C);
+
+ if Present (Expr)
+ and then (Nkind (Expr) = N_Aggregate
+ or else Nkind (Expr) = N_Extension_Aggregate)
+ and then Has_Default_Init_Comps (Expr)
+ then
+ return True;
+ end if;
+
+ Next (C);
+ end loop;
+
+ return False;
+ end Has_Default_Init_Comps;
+
--------------------------
-- Is_Delayed_Aggregate --
--------------------------
@@ -4432,21 +4717,23 @@ package body Exp_Aggr is
Typ : Entity_Id;
Target : Node_Id;
Flist : Node_Id := Empty;
- Obj : Entity_Id := Empty)
- return List_Id
- is
+ Obj : Entity_Id := Empty) return List_Id is
begin
if Is_Record_Type (Etype (N)) then
return Build_Record_Aggr_Code (N, Typ, Target, Flist, Obj);
- else
+ elsif Is_Array_Type (Etype (N)) then
return
Build_Array_Aggr_Code
- (N,
- First_Index (Typ),
- Target,
- Is_Scalar_Type (Component_Type (Typ)),
- No_List,
- Flist);
+ (N => N,
+ Ctype => Component_Type (Etype (N)),
+ Index => First_Index (Typ),
+ Into => Target,
+ Scalar_Comp => Is_Scalar_Type (Component_Type (Typ)),
+ Indices => No_List,
+ Flist => Flist);
+ else
+ pragma Assert (False);
+ return New_List;
end if;
end Late_Expansion;
@@ -4457,8 +4744,7 @@ package body Exp_Aggr is
function Make_OK_Assignment_Statement
(Sloc : Source_Ptr;
Name : Node_Id;
- Expression : Node_Id)
- return Node_Id
+ Expression : Node_Id) return Node_Id
is
begin
Set_Assignment_OK (Name);
diff --git a/gcc/ada/exp_attr.adb b/gcc/ada/exp_attr.adb
index 7a5d7737f02..f296a6f60cf 100644
--- a/gcc/ada/exp_attr.adb
+++ b/gcc/ada/exp_attr.adb
@@ -907,8 +907,9 @@ package body Exp_Attr is
if Pent = Standard_Standard
or else Pent = Standard_ASCII
then
- Name_Buffer (1 .. Library_Version'Length) := Library_Version;
- Name_Len := Library_Version'Length;
+ Name_Buffer (1 .. Verbose_Library_Version'Length) :=
+ Verbose_Library_Version;
+ Name_Len := Verbose_Library_Version'Length;
Rewrite (N,
Make_String_Literal (Loc,
Strval => String_From_Name_Buffer));
diff --git a/gcc/ada/exp_ch3.adb b/gcc/ada/exp_ch3.adb
index a6d058d11a4..1cb9328655c 100644
--- a/gcc/ada/exp_ch3.adb
+++ b/gcc/ada/exp_ch3.adb
@@ -56,6 +56,7 @@ with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Stand; use Stand;
+with Stringt; use Stringt;
with Snames; use Snames;
with Tbuild; use Tbuild;
with Ttypes; use Ttypes;
@@ -1032,13 +1033,14 @@ package body Exp_Ch3 is
-- end;
function Build_Initialization_Call
- (Loc : Source_Ptr;
- Id_Ref : Node_Id;
- Typ : Entity_Id;
- In_Init_Proc : Boolean := False;
- Enclos_Type : Entity_Id := Empty;
- Discr_Map : Elist_Id := New_Elmt_List)
- return List_Id
+ (Loc : Source_Ptr;
+ Id_Ref : Node_Id;
+ Typ : Entity_Id;
+ In_Init_Proc : Boolean := False;
+ Enclos_Type : Entity_Id := Empty;
+ Discr_Map : Elist_Id := New_Elmt_List;
+ With_Default_Init : Boolean := False)
+ return List_Id
is
First_Arg : Node_Id;
Args : List_Id;
@@ -1076,7 +1078,6 @@ package body Exp_Ch3 is
-- honest. Actually it isn't quite type honest, because there can be
-- conflicts of views in the private type case. That is why we set
-- Conversion_OK in the conversion node.
-
if (Is_Record_Type (Typ)
or else Is_Array_Type (Typ)
or else Is_Private_Type (Typ))
@@ -1110,12 +1111,28 @@ package body Exp_Ch3 is
Append_To (Args, Make_Identifier (Loc, Name_uChain));
- Decls := Build_Task_Image_Decls (Loc, Id_Ref, Enclos_Type);
- Decl := Last (Decls);
+ -- Ada0Y (AI-287): In case of default initialized components
+ -- with tasks, we generate a null string actual parameter.
+ -- This is just a workaround that must be improved later???
+
+ if With_Default_Init then
+ declare
+ S : String_Id;
+ Null_String : Node_Id;
+ begin
+ Start_String;
+ S := End_String;
+ Null_String := Make_String_Literal (Loc, Strval => S);
+ Append_To (Args, Null_String);
+ end;
+ else
+ Decls := Build_Task_Image_Decls (Loc, Id_Ref, Enclos_Type);
+ Decl := Last (Decls);
- Append_To (Args,
- New_Occurrence_Of (Defining_Identifier (Decl), Loc));
- Append_List (Decls, Res);
+ Append_To (Args,
+ New_Occurrence_Of (Defining_Identifier (Decl), Loc));
+ Append_List (Decls, Res);
+ end if;
else
Decls := No_List;
@@ -1202,7 +1219,22 @@ package body Exp_Ch3 is
end if;
end if;
- Append_To (Args, Arg);
+ -- Ada0Y (AI-287) In case of default initialized components, we
+ -- need to generate the corresponding selected component node
+ -- to access the discriminant value. In other cases this is not
+ -- required because we are inside the init proc and we use the
+ -- corresponding formal.
+
+ if With_Default_Init
+ and then Nkind (Id_Ref) = N_Selected_Component
+ then
+ Append_To (Args,
+ Make_Selected_Component (Loc,
+ Prefix => New_Copy_Tree (Prefix (Id_Ref)),
+ Selector_Name => Arg));
+ else
+ Append_To (Args, Arg);
+ end if;
Next_Discriminant (Discr);
end loop;
@@ -3428,8 +3460,8 @@ package body Exp_Ch3 is
-- initialize scalars mode, and these types are treated specially
-- and do not need initialization procedures.
- elsif Base = Standard_String
- or else Base = Standard_Wide_String
+ elsif Root_Type (Base) = Standard_String
+ or else Root_Type (Base) = Standard_Wide_String
then
null;
diff --git a/gcc/ada/exp_ch3.ads b/gcc/ada/exp_ch3.ads
index 6d94e1a714b..7de6498a696 100644
--- a/gcc/ada/exp_ch3.ads
+++ b/gcc/ada/exp_ch3.ads
@@ -52,13 +52,14 @@ package Exp_Ch3 is
-- and the discriminant checking functions are inserted after this node.
function Build_Initialization_Call
- (Loc : Source_Ptr;
- Id_Ref : Node_Id;
- Typ : Entity_Id;
- In_Init_Proc : Boolean := False;
- Enclos_Type : Entity_Id := Empty;
- Discr_Map : Elist_Id := New_Elmt_List)
- return List_Id;
+ (Loc : Source_Ptr;
+ Id_Ref : Node_Id;
+ Typ : Entity_Id;
+ In_Init_Proc : Boolean := False;
+ Enclos_Type : Entity_Id := Empty;
+ Discr_Map : Elist_Id := New_Elmt_List;
+ With_Default_Init : Boolean := False)
+ return List_Id;
-- Builds a call to the initialization procedure of the Id entity. Id_Ref
-- is either a new reference to Id (for record fields), or an indexed
-- component (for array elements). Loc is the source location for the
@@ -76,6 +77,10 @@ package Exp_Ch3 is
-- entry families bounded by discriminants, protected type discriminants
-- can appear within expressions in array bounds (not as stand-alone
-- identifiers) and a general replacement is necessary.
+ --
+ -- Ada0Y (AI-287): With_Default_Init is used to indicate that the initia-
+ -- lization call corresponds to a default initialized component of an
+ -- aggregate.
procedure Freeze_Type (N : Node_Id);
-- This procedure executes the freezing actions associated with the given
diff --git a/gcc/ada/exp_ch4.adb b/gcc/ada/exp_ch4.adb
index 30be4d754f2..192e89805d4 100644
--- a/gcc/ada/exp_ch4.adb
+++ b/gcc/ada/exp_ch4.adb
@@ -1472,7 +1472,7 @@ package body Exp_Ch4 is
-- their base type, Ind_Typ their index type, and Arr_Typ the original
-- array type to which the concatenantion operator applies, then the
-- following subprogram is constructed:
- --
+
-- [function Cnn (S1 : Base_Typ; ...; Sn : Base_Typ) return Base_Typ is
-- L : Ind_Typ;
-- begin
@@ -1489,7 +1489,7 @@ package body Exp_Ch4 is
-- else
-- return Sn;
-- end if;
- --
+
-- declare
-- P : Ind_Typ;
-- H : Ind_Typ :=
@@ -1516,9 +1516,9 @@ package body Exp_Ch4 is
-- P := Ind_Typ'Succ (P);
-- end loop;
-- end if;
- --
+
-- ...
- --
+
-- if Sn'Length /= 0 then
-- P := Sn'First;
-- loop
@@ -1528,7 +1528,7 @@ package body Exp_Ch4 is
-- P := Ind_Typ'Succ (P);
-- end loop;
-- end if;
- --
+
-- return R;
-- end;
-- end Cnn;]
@@ -1598,7 +1598,9 @@ package body Exp_Ch4 is
-- Builds reference to identifier L.
function L_Pos return Node_Id;
- -- Builds expression Ind_Typ'Pos (L).
+ -- Builds expression Integer_Type'(Ind_Typ'Pos (L)).
+ -- We qualify the expression to avoid universal_integer computations
+ -- whenever possible, in the expression for the upper bound H.
function L_Succ return Node_Id;
-- Builds expression Ind_Typ'Succ (L).
@@ -1743,12 +1745,31 @@ package body Exp_Ch4 is
-----------
function L_Pos return Node_Id is
+ Target_Type : Entity_Id;
+
begin
+ -- If the index type is an enumeration type, the computation
+ -- can be done in standard integer. Otherwise, choose a large
+ -- enough integer type.
+
+ if Is_Enumeration_Type (Ind_Typ)
+ or else Root_Type (Ind_Typ) = Standard_Integer
+ or else Root_Type (Ind_Typ) = Standard_Short_Integer
+ or else Root_Type (Ind_Typ) = Standard_Short_Short_Integer
+ then
+ Target_Type := Standard_Integer;
+ else
+ Target_Type := Root_Type (Ind_Typ);
+ end if;
+
return
- Make_Attribute_Reference (Loc,
- Prefix => New_Reference_To (Ind_Typ, Loc),
- Attribute_Name => Name_Pos,
- Expressions => New_List (L));
+ Make_Qualified_Expression (Loc,
+ Subtype_Mark => New_Reference_To (Target_Type, Loc),
+ Expression =>
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (Ind_Typ, Loc),
+ Attribute_Name => Name_Pos,
+ Expressions => New_List (L)));
end L_Pos;
------------
@@ -3713,7 +3734,8 @@ package body Exp_Ch4 is
exit when Chars (Node (Prim)) = Name_Op_Eq
and then Etype (First_Formal (Node (Prim))) =
Etype (Next_Formal (First_Formal (Node (Prim))))
- and then Etype (Node (Prim)) = Standard_Boolean;
+ and then
+ Base_Type (Etype (Node (Prim))) = Standard_Boolean;
Next_Elmt (Prim);
pragma Assert (Present (Prim));
@@ -5311,11 +5333,37 @@ package body Exp_Ch4 is
Pfx : constant Node_Id := Prefix (N);
Ptp : Entity_Id := Etype (Pfx);
+ function Is_Procedure_Actual (N : Node_Id) return Boolean;
+ -- Check whether context is a procedure call, in which case
+ -- expansion of a bit-packed slice is deferred until the call
+ -- itself is expanded.
+
procedure Make_Temporary;
-- Create a named variable for the value of the slice, in
-- cases where the back-end cannot handle it properly, e.g.
-- when packed types or unaligned slices are involved.
+ -------------------------
+ -- Is_Procedure_Actual --
+ -------------------------
+
+ function Is_Procedure_Actual (N : Node_Id) return Boolean is
+ Par : Node_Id := Parent (N);
+
+ begin
+ while Present (Par)
+ and then Nkind (Par) not in N_Statement_Other_Than_Procedure_Call
+ loop
+ if Nkind (Par) = N_Procedure_Call_Statement then
+ return True;
+ else
+ Par := Parent (Par);
+ end if;
+ end loop;
+
+ return False;
+ end Is_Procedure_Actual;
+
--------------------
-- Make_Temporary --
--------------------
@@ -5400,26 +5448,35 @@ package body Exp_Ch4 is
-- is caught elsewhere, and the expansion would intefere
-- with generating the error message).
- if Is_Packed (Typ)
- and then Nkind (Parent (N)) /= N_Assignment_Statement
- and then (Nkind (Parent (Parent (N))) /= N_Assignment_Statement
- or else
- Parent (N) /= Name (Parent (Parent (N))))
- and then Nkind (Parent (N)) /= N_Indexed_Component
- and then not Is_Renamed_Object (N)
- and then Nkind (Parent (N)) /= N_Procedure_Call_Statement
- and then (Nkind (Parent (N)) /= N_Attribute_Reference
- or else
- Attribute_Name (Parent (N)) /= Name_Address)
+ if not Is_Packed (Typ) then
+
+ -- Apply transformation for actuals of a function call,
+ -- where Expand_Actuals is not used.
+
+ if Nkind (Parent (N)) = N_Function_Call
+ and then Is_Possibly_Unaligned_Slice (N)
+ then
+ Make_Temporary;
+ end if;
+
+ elsif Nkind (Parent (N)) = N_Assignment_Statement
+ or else (Nkind (Parent (Parent (N))) = N_Assignment_Statement
+ and then Parent (N) = Name (Parent (Parent (N))))
then
- Make_Temporary;
+ return;
- -- Same transformation for actuals in a function call, where
- -- Expand_Actuals is not used.
+ elsif Nkind (Parent (N)) = N_Indexed_Component
+ or else Is_Renamed_Object (N)
+ or else Is_Procedure_Actual (N)
+ then
+ return;
- elsif Nkind (Parent (N)) = N_Function_Call
- and then Is_Possibly_Unaligned_Slice (N)
+ elsif (Nkind (Parent (N)) = N_Attribute_Reference
+ and then Attribute_Name (Parent (N)) = Name_Address)
then
+ return;
+
+ else
Make_Temporary;
end if;
end Expand_N_Slice;
diff --git a/gcc/ada/exp_ch5.adb b/gcc/ada/exp_ch5.adb
index 5fd2dc9c512..a257b274ce0 100644
--- a/gcc/ada/exp_ch5.adb
+++ b/gcc/ada/exp_ch5.adb
@@ -91,8 +91,9 @@ package body Exp_Ch5 is
procedure Expand_Assign_Record (N : Node_Id);
-- N is an assignment of a non-tagged record value. This routine handles
- -- the special cases and checks required for such assignments, including
- -- change of representation.
+ -- the case where the assignment must be made component by component,
+ -- either because the target is not byte aligned, or there is a change
+ -- of representation.
function Make_Tag_Ctrl_Assignment (N : Node_Id) return List_Id;
-- Generate the necessary code for controlled and Tagged assignment,
@@ -101,13 +102,41 @@ package body Exp_Ch5 is
-- pointers which are not 'part of the value' and must not be changed
-- upon assignment. N is the original Assignment node.
+ function Possible_Bit_Aligned_Component (N : Node_Id) return Boolean;
+ -- This function is used in processing the assignment of a record or
+ -- indexed component. The back end can handle such assignments fine
+ -- if the objects involved are small (64-bits or less) records or
+ -- scalar items (including bit-packed arrays represented with modular
+ -- types) or are both aligned on a byte boundary (starting on a byte
+ -- boundary, and occupying an integral number of bytes).
+ --
+ -- However, problems arise for records larger than 64 bits, or for
+ -- arrays (other than bit-packed arrays represented with a modular
+ -- type) if the component starts on a non-byte boundary, or does
+ -- not occupy an integral number of bytes (i.e. there are some bits
+ -- possibly shared with fields at the start or beginning of the
+ -- component). The back end cannot handle loading and storing such
+ -- components in a single operation.
+ --
+ -- This function is used to detect the troublesome situation. it is
+ -- conservative in the sense that it produces True unless it knows
+ -- for sure that the component is safe (as outlined in the first
+ -- paragraph above). The code generation for record and array
+ -- assignment checks for trouble using this function, and if so
+ -- the assignment is generated component-wise, which the back end
+ -- is required to handle correctly.
+ --
+ -- Note that in GNAT 3, the back end will reject such components
+ -- anyway, so the hard work in checking for this case is wasted
+ -- in GNAT 3, but it's harmless, so it is easier to do it in
+ -- all cases, rather than conditionalize it in GNAT 5 or beyond.
+
------------------------------
-- Change_Of_Representation --
------------------------------
function Change_Of_Representation (N : Node_Id) return Boolean is
Rhs : constant Node_Id := Expression (N);
-
begin
return
Nkind (Rhs) = N_Type_Conversion
@@ -351,6 +380,14 @@ package body Exp_Ch5 is
R_Type := Get_Actual_Subtype (Act_Rhs);
Loop_Required := True;
+ -- We require a loop if the left side is possibly bit unaligned
+
+ elsif Possible_Bit_Aligned_Component (Lhs)
+ or else
+ Possible_Bit_Aligned_Component (Rhs)
+ then
+ Loop_Required := True;
+
-- Arrays with controlled components are expanded into a loop
-- to force calls to adjust at the component level.
@@ -982,19 +1019,41 @@ package body Exp_Ch5 is
-- by field assignments.
procedure Expand_Assign_Record (N : Node_Id) is
+ Lhs : constant Node_Id := Name (N);
+ Rhs : Node_Id := Expression (N);
+
begin
- if not Change_Of_Representation (N) then
+ -- If change of representation, then extract the real right hand
+ -- side from the type conversion, and proceed with component-wise
+ -- assignment, since the two types are not the same as far as the
+ -- back end is concerned.
+
+ if Change_Of_Representation (N) then
+ Rhs := Expression (Rhs);
+
+ -- If this may be a case of a large bit aligned component, then
+ -- proceed with component-wise assignment, to avoid possible
+ -- clobbering of other components sharing bits in the first or
+ -- last byte of the component to be assigned.
+
+ elsif Possible_Bit_Aligned_Component (Lhs)
+ or
+ Possible_Bit_Aligned_Component (Rhs)
+ then
+ null;
+
+ -- If neither condition met, then nothing special to do, the back end
+ -- can handle assignment of the entire component as a single entity.
+
+ else
return;
end if;
- -- At this stage we know that the right hand side is a conversion
+ -- At this stage we know that we must do a component wise assignment
declare
Loc : constant Source_Ptr := Sloc (N);
- Lhs : constant Node_Id := Name (N);
- Rhs : constant Node_Id := Expression (Expression (N));
- R_Rec : constant Node_Id := Expression (Expression (N));
- R_Typ : constant Entity_Id := Base_Type (Etype (R_Rec));
+ R_Typ : constant Entity_Id := Base_Type (Etype (Rhs));
L_Typ : constant Entity_Id := Base_Type (Etype (Lhs));
Decl : constant Node_Id := Declaration_Node (R_Typ);
RDef : Node_Id;
@@ -1002,8 +1061,7 @@ package body Exp_Ch5 is
function Find_Component
(Typ : Entity_Id;
- Comp : Entity_Id)
- return Entity_Id;
+ Comp : Entity_Id) return Entity_Id;
-- Find the component with the given name in the underlying record
-- declaration for Typ. We need to use the actual entity because
-- the type may be private and resolution by identifier alone would
@@ -1027,9 +1085,7 @@ package body Exp_Ch5 is
function Find_Component
(Typ : Entity_Id;
- Comp : Entity_Id)
- return Entity_Id
-
+ Comp : Entity_Id) return Entity_Id
is
Utyp : constant Entity_Id := Underlying_Type (Typ);
C : Entity_Id;
@@ -3175,4 +3231,96 @@ package body Exp_Ch5 is
return Empty_List;
end Make_Tag_Ctrl_Assignment;
+ ------------------------------------
+ -- Possible_Bit_Aligned_Component --
+ ------------------------------------
+
+ function Possible_Bit_Aligned_Component (N : Node_Id) return Boolean is
+ begin
+ case Nkind (N) is
+
+ -- Case of indexed component
+
+ when N_Indexed_Component =>
+ declare
+ P : constant Node_Id := Prefix (N);
+ Ptyp : constant Entity_Id := Etype (P);
+
+ begin
+ -- If we know the component size and it is less than 64, then
+ -- we are definitely OK. The back end always does assignment
+ -- of misaligned small objects correctly.
+
+ if Known_Static_Component_Size (Ptyp)
+ and then Component_Size (Ptyp) <= 64
+ then
+ return False;
+
+ -- Otherwise, we need to test the prefix, to see if we are
+ -- indexing from a possibly unaligned component.
+
+ else
+ return Possible_Bit_Aligned_Component (P);
+ end if;
+ end;
+
+ -- Case of selected component
+
+ when N_Selected_Component =>
+ declare
+ P : constant Node_Id := Prefix (N);
+ Comp : constant Entity_Id := Entity (Selector_Name (N));
+
+ begin
+ -- If there is no component clause, then we are in the clear
+ -- since the back end will never misalign a large component
+ -- unless it is forced to do so. In the clear means we need
+ -- only the recursive test on the prefix.
+
+ if No (Component_Clause (Comp)) then
+ return Possible_Bit_Aligned_Component (P);
+
+ -- Otherwise we have a component clause, which means that
+ -- the Esize and Normalized_First_Bit fields are set and
+ -- contain static values known at compile time.
+
+ else
+ -- If we know that we have a small (64 bits or less) record
+ -- or bit-packed array, then everything is fine, since the
+ -- back end can handle these cases correctly.
+
+ if Esize (Comp) <= 64
+ and then (Is_Record_Type (Etype (Comp))
+ or else
+ Is_Bit_Packed_Array (Etype (Comp)))
+ then
+ return False;
+
+ -- Otherwise if the component is not byte aligned, we
+ -- know we have the nasty unaligned case.
+
+ elsif Normalized_First_Bit (Comp) /= Uint_0
+ or else Esize (Comp) mod System_Storage_Unit /= Uint_0
+ then
+ return True;
+
+ -- If we are large and byte aligned, then OK at this level
+ -- but we still need to test our prefix recursively.
+
+ else
+ return Possible_Bit_Aligned_Component (P);
+ end if;
+ end if;
+ end;
+
+ -- If we have neither a record nor array component, it means that
+ -- we have fallen off the top testing prefixes recursively, and
+ -- we now have a stand alone object, where we don't have a problem
+
+ when others =>
+ return False;
+
+ end case;
+ end Possible_Bit_Aligned_Component;
+
end Exp_Ch5;
diff --git a/gcc/ada/exp_ch6.adb b/gcc/ada/exp_ch6.adb
index d51aaa8ece4..cad54ac7ba8 100644
--- a/gcc/ada/exp_ch6.adb
+++ b/gcc/ada/exp_ch6.adb
@@ -59,12 +59,14 @@ with Sem_Ch12; use Sem_Ch12;
with Sem_Ch13; use Sem_Ch13;
with Sem_Disp; use Sem_Disp;
with Sem_Dist; use Sem_Dist;
+with Sem_Eval; use Sem_Eval;
with Sem_Res; use Sem_Res;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
with Snames; use Snames;
with Stand; use Stand;
with Tbuild; use Tbuild;
+with Ttypes; use Ttypes;
with Uintp; use Uintp;
with Validsw; use Validsw;
@@ -539,9 +541,15 @@ package body Exp_Ch6 is
if Nkind (Actual) = N_Type_Conversion then
V_Typ := Etype (Expression (Actual));
- Var := Make_Var (Expression (Actual));
- Crep := not Same_Representation
- (Etype (Formal), Etype (Expression (Actual)));
+
+ -- If the formal is an (in-)out parameter, capture the name
+ -- of the variable in order to build the post-call assignment.
+
+ Var := Make_Var (Expression (Actual));
+
+ Crep := not Same_Representation
+ (Etype (Formal), Etype (Expression (Actual)));
+
else
V_Typ := Etype (Actual);
Var := Make_Var (Actual);
@@ -1521,8 +1529,16 @@ package body Exp_Ch6 is
if Validity_Checks_On then
if Ekind (Formal) = E_In_Parameter
and then Validity_Check_In_Params
- and then Is_Entity_Name (Actual)
then
+ -- If the actual is an indexed component of a packed
+ -- type, it has not been expanded yet. It will be
+ -- copied in the validity code that follows, and has
+ -- to be expanded appropriately, so reanalyze it.
+
+ if Nkind (Actual) = N_Indexed_Component then
+ Set_Analyzed (Actual, False);
+ end if;
+
Ensure_Valid (Actual);
elsif Ekind (Formal) = E_In_Out_Parameter
@@ -1925,6 +1941,7 @@ package body Exp_Ch6 is
Bod : Node_Id;
Must_Inline : Boolean := False;
Spec : constant Node_Id := Unit_Declaration_Node (Subp);
+ Scop : constant Entity_Id := Scope (Subp);
begin
-- Verify that the body to inline has already been seen,
@@ -1938,6 +1955,26 @@ package body Exp_Ch6 is
then
Must_Inline := False;
+ -- If this an inherited function that returns a private
+ -- type, do not inline if the full view is an unconstrained
+ -- array, because such calls cannot be inlined.
+
+ elsif Present (Orig_Subp)
+ and then Is_Array_Type (Etype (Orig_Subp))
+ and then not Is_Constrained (Etype (Orig_Subp))
+ then
+ Must_Inline := False;
+
+ -- If the subprogram comes from an instance in the same
+ -- unit, and the instance is not yet frozen, inlining might
+ -- trigger order-of-elaboration problems in gigi.
+
+ elsif Is_Generic_Instance (Scop)
+ and then Present (Freeze_Node (Scop))
+ and then not Analyzed (Freeze_Node (Scop))
+ then
+ Must_Inline := False;
+
else
Bod := Body_To_Inline (Spec);
@@ -2515,7 +2552,8 @@ package body Exp_Ch6 is
Temp_Typ := Etype (A);
end if;
- -- Comments needed here ???
+ -- If the actual is a simple name or a literal, no need to
+ -- create a temporary, object can be used directly.
if (Is_Entity_Name (A)
and then
@@ -2849,6 +2887,8 @@ package body Exp_Ch6 is
-- Reset Pure indication if any parameter has root type System.Address
+ -- Wrap thread body
+
procedure Expand_N_Subprogram_Body (N : Node_Id) is
Loc : constant Source_Ptr := Sloc (N);
H : constant Node_Id := Handled_Statement_Sequence (N);
@@ -2866,6 +2906,9 @@ package body Exp_Ch6 is
-- the latter test is not critical, it does not matter if we add a
-- few extra returns, since they get eliminated anyway later on.
+ procedure Expand_Thread_Body;
+ -- Perform required expansion of a thread body
+
----------------
-- Add_Return --
----------------
@@ -2882,6 +2925,168 @@ package body Exp_Ch6 is
end if;
end Add_Return;
+ ------------------------
+ -- Expand_Thread_Body --
+ ------------------------
+
+ -- The required expansion of a thread body is as follows
+
+ -- procedure <thread body procedure name> is
+
+ -- _Secondary_Stack : aliased
+ -- Storage_Elements.Storage_Array
+ -- (1 .. Storage_Offset (Sec_Stack_Size));
+ -- for _Secondary_Stack'Alignment use Standard'Maximum_Alignment;
+
+ -- _Process_ATSD : aliased System.Threads.ATSD;
+
+ -- begin
+ -- System.Threads.Thread_Body_Enter;
+ -- (_Secondary_Stack'Address,
+ -- _Secondary_Stack'Length,
+ -- _Process_ATSD'Address);
+
+ -- declare
+ -- <user declarations>
+ -- begin
+ -- <user statements>
+ -- <user exception handlers>
+ -- end;
+
+ -- System.Threads.Thread_Body_Leave;
+
+ -- exception
+ -- when E : others =>
+ -- System.Threads.Thread_Body_Exceptional_Exit (E);
+ -- end;
+
+ -- Note the exception handler is omitted if pragma Restriction
+ -- No_Exception_Handlers is currently active.
+
+ procedure Expand_Thread_Body is
+ User_Decls : constant List_Id := Declarations (N);
+ Sec_Stack_Len : Node_Id;
+
+ TB_Pragma : constant Node_Id :=
+ Get_Rep_Pragma (Spec_Id, Name_Thread_Body);
+
+ Ent_SS : Entity_Id;
+ Ent_ATSD : Entity_Id;
+ Ent_EO : Entity_Id;
+
+ Decl_SS : Node_Id;
+ Decl_ATSD : Node_Id;
+
+ Excep_Handlers : List_Id;
+
+ begin
+ New_Scope (Spec_Id);
+
+ -- Get proper setting for secondary stack size
+
+ if List_Length (Pragma_Argument_Associations (TB_Pragma)) = 2 then
+ Sec_Stack_Len :=
+ Expression (Last (Pragma_Argument_Associations (TB_Pragma)));
+ else
+ Sec_Stack_Len :=
+ Make_Integer_Literal (Loc,
+ Intval =>
+ Expr_Value
+ (Constant_Value (RTE (RE_Default_Secondary_Stack_Size))));
+ end if;
+
+ Sec_Stack_Len := Convert_To (RTE (RE_Storage_Offset), Sec_Stack_Len);
+
+ -- Build and set declarations for the wrapped thread body
+
+ Ent_SS := Make_Defining_Identifier (Loc, Name_uSecondary_Stack);
+ Ent_ATSD := Make_Defining_Identifier (Loc, Name_uProcess_ATSD);
+
+ Decl_SS :=
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Ent_SS,
+ Aliased_Present => True,
+ Object_Definition =>
+ Make_Subtype_Indication (Loc,
+ Subtype_Mark =>
+ New_Occurrence_Of (RTE (RE_Storage_Array), Loc),
+ Constraint =>
+ Make_Index_Or_Discriminant_Constraint (Loc,
+ Constraints => New_List (
+ Make_Range (Loc,
+ Low_Bound => Make_Integer_Literal (Loc, 1),
+ High_Bound => Sec_Stack_Len)))));
+
+ Decl_ATSD :=
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Ent_ATSD,
+ Aliased_Present => True,
+ Object_Definition => New_Occurrence_Of (RTE (RE_ATSD), Loc));
+
+ Set_Declarations (N, New_List (Decl_SS, Decl_ATSD));
+ Analyze (Decl_SS);
+ Analyze (Decl_ATSD);
+ Set_Alignment (Ent_SS, UI_From_Int (Maximum_Alignment));
+
+ -- Create new exception handler
+
+ if Restrictions (No_Exception_Handlers) then
+ Excep_Handlers := No_List;
+
+ else
+ Check_Restriction (No_Exception_Handlers, N);
+
+ Ent_EO := Make_Defining_Identifier (Loc, Name_uE);
+
+ Excep_Handlers := New_List (
+ Make_Exception_Handler (Loc,
+ Choice_Parameter => Ent_EO,
+ Exception_Choices => New_List (
+ Make_Others_Choice (Loc)),
+ Statements => New_List (
+ Make_Procedure_Call_Statement (Loc,
+ Name =>
+ New_Occurrence_Of
+ (RTE (RE_Thread_Body_Exceptional_Exit), Loc),
+ Parameter_Associations => New_List (
+ New_Occurrence_Of (Ent_EO, Loc))))));
+ end if;
+
+ -- Now build new handled statement sequence and analyze it
+
+ Set_Handled_Statement_Sequence (N,
+ Make_Handled_Sequence_Of_Statements (Loc,
+ Statements => New_List (
+
+ Make_Procedure_Call_Statement (Loc,
+ Name => New_Occurrence_Of (RTE (RE_Thread_Body_Enter), Loc),
+ Parameter_Associations => New_List (
+
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Ent_SS, Loc),
+ Attribute_Name => Name_Address),
+
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Ent_SS, Loc),
+ Attribute_Name => Name_Length),
+
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Occurrence_Of (Ent_ATSD, Loc),
+ Attribute_Name => Name_Address))),
+
+ Make_Block_Statement (Loc,
+ Declarations => User_Decls,
+ Handled_Statement_Sequence => H),
+
+ Make_Procedure_Call_Statement (Loc,
+ Name => New_Occurrence_Of (RTE (RE_Thread_Body_Leave), Loc))),
+
+ Exception_Handlers => Excep_Handlers));
+
+ Analyze (Handled_Statement_Sequence (N));
+ End_Scope;
+ end Expand_Thread_Body;
+
-- Start of processing for Expand_N_Subprogram_Body
begin
@@ -3150,6 +3355,12 @@ package body Exp_Ch6 is
end;
end if;
+ -- Deal with thread body
+
+ if Is_Thread_Body (Spec_Id) then
+ Expand_Thread_Body;
+ end if;
+
-- If the subprogram does not have pending instantiations, then we
-- must generate the subprogram descriptor now, since the code for
-- the subprogram is complete, and this is our last chance. However
diff --git a/gcc/ada/exp_ch7.adb b/gcc/ada/exp_ch7.adb
index f9844cd3b33..e9e80532048 100644
--- a/gcc/ada/exp_ch7.adb
+++ b/gcc/ada/exp_ch7.adb
@@ -1074,6 +1074,76 @@ package body Exp_Ch7 is
if No (Wrap_Node) then
null;
+ elsif Nkind (Wrap_Node) = N_Iteration_Scheme then
+
+ -- Create a declaration followed by an assignment, so that
+ -- the assignment can have its own transient scope.
+ -- We generate the equivalent of:
+
+ -- type Ptr is access all expr_type;
+ -- Var : Ptr;
+ -- begin
+ -- Var := Expr'reference;
+ -- end;
+
+ -- This closely resembles what is done in Remove_Side_Effect,
+ -- but it has to be done here, before the analysis of the call
+ -- is completed.
+
+ declare
+ Ptr_Typ : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_Internal_Name ('A'));
+ Ptr : constant Entity_Id :=
+ Make_Defining_Identifier (Loc,
+ Chars => New_Internal_Name ('T'));
+
+ Expr_Type : constant Entity_Id := Etype (N);
+ New_Expr : constant Node_Id := Relocate_Node (N);
+ Decl : Node_Id;
+ Ptr_Typ_Decl : Node_Id;
+ Stmt : Node_Id;
+
+ begin
+ Ptr_Typ_Decl :=
+ Make_Full_Type_Declaration (Loc,
+ Defining_Identifier => Ptr_Typ,
+ Type_Definition =>
+ Make_Access_To_Object_Definition (Loc,
+ All_Present => True,
+ Subtype_Indication =>
+ New_Reference_To (Expr_Type, Loc)));
+
+ Decl :=
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Ptr,
+ Object_Definition => New_Occurrence_Of (Ptr_Typ, Loc));
+
+ Set_Etype (Ptr, Ptr_Typ);
+ Stmt :=
+ Make_Assignment_Statement (Loc,
+ Name => New_Occurrence_Of (Ptr, Loc),
+ Expression => Make_Reference (Loc, New_Expr));
+
+ Set_Analyzed (New_Expr, False);
+
+ Insert_List_Before_And_Analyze
+ (Parent (Wrap_Node),
+ New_List (
+ Ptr_Typ_Decl,
+ Decl,
+ Make_Block_Statement (Loc,
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc,
+ New_List (Stmt)))));
+
+ Rewrite (N,
+ Make_Explicit_Dereference (Loc,
+ Prefix => New_Reference_To (Ptr, Loc)));
+ Analyze_And_Resolve (N, Expr_Type);
+
+ end;
+
-- Transient scope is required
else
@@ -1815,14 +1885,12 @@ package body Exp_Ch7 is
return The_Parent;
end if;
- -- ??? No scheme yet for "for I in Expression'Range loop"
- -- ??? the current scheme for Expression wrapping doesn't apply
- -- ??? because a RANGE is NOT an expression. Tricky problem...
- -- ??? while this problem is not solved we have a potential for
- -- ??? leak and unfinalized intermediate objects here.
+ -- If the expression is within the iteration scheme of a loop,
+ -- we must create a declaration for it, followed by an assignment
+ -- in order to have a usable statement to wrap.
when N_Loop_Parameter_Specification =>
- return Empty;
+ return Parent (The_Parent);
-- The following nodes contains "dummy calls" which don't
-- need to be wrapped.
diff --git a/gcc/ada/exp_ch9.adb b/gcc/ada/exp_ch9.adb
index 08c824dcedd..f8bf7f80a6c 100644
--- a/gcc/ada/exp_ch9.adb
+++ b/gcc/ada/exp_ch9.adb
@@ -69,8 +69,7 @@ package body Exp_Ch9 is
(Sloc : Source_Ptr;
Ent : Entity_Id;
Index : Node_Id;
- Tsk : Entity_Id)
- return Node_Id;
+ Tsk : Entity_Id) return Node_Id;
-- Compute the index position for an entry call. Tsk is the target
-- task. If the bounds of some entry family depend on discriminants,
-- the expression computed by this function uses the discriminants
@@ -79,8 +78,7 @@ package body Exp_Ch9 is
function Index_Constant_Declaration
(N : Node_Id;
Index_Id : Entity_Id;
- Prot : Entity_Id)
- return List_Id;
+ Prot : Entity_Id) return List_Id;
-- For an entry family and its barrier function, we define a local entity
-- that maps the index in the call into the entry index into the object:
--
@@ -105,23 +103,20 @@ package body Exp_Ch9 is
function Build_Barrier_Function
(N : Node_Id;
Ent : Entity_Id;
- Pid : Node_Id)
- return Node_Id;
+ Pid : Node_Id) return Node_Id;
-- Build the function body returning the value of the barrier expression
-- for the specified entry body.
function Build_Barrier_Function_Specification
(Def_Id : Entity_Id;
- Loc : Source_Ptr)
- return Node_Id;
+ Loc : Source_Ptr) return Node_Id;
-- Build a specification for a function implementing
-- the protected entry barrier of the specified entry body.
function Build_Corresponding_Record
(N : Node_Id;
Ctyp : Node_Id;
- Loc : Source_Ptr)
- return Node_Id;
+ Loc : Source_Ptr) return Node_Id;
-- Common to tasks and protected types. Copy discriminant specifications,
-- build record declaration. N is the type declaration, Ctyp is the
-- concurrent entity (task type or protected type).
@@ -129,40 +124,33 @@ package body Exp_Ch9 is
function Build_Entry_Count_Expression
(Concurrent_Type : Node_Id;
Component_List : List_Id;
- Loc : Source_Ptr)
- return Node_Id;
+ Loc : Source_Ptr) return Node_Id;
-- Compute number of entries for concurrent object. This is a count of
-- simple entries, followed by an expression that computes the length
-- of the range of each entry family. A single array with that size is
-- allocated for each concurrent object of the type.
- function Build_Find_Body_Index
- (Typ : Entity_Id)
- return Node_Id;
+ function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id;
-- Build the function that translates the entry index in the call
-- (which depends on the size of entry families) into an index into the
-- Entry_Bodies_Array, to determine the body and barrier function used
-- in a protected entry call. A pointer to this function appears in every
-- protected object.
- function Build_Find_Body_Index_Spec
- (Typ : Entity_Id)
- return Node_Id;
- -- Build subprogram declaration for previous one.
+ function Build_Find_Body_Index_Spec (Typ : Entity_Id) return Node_Id;
+ -- Build subprogram declaration for previous one
function Build_Protected_Entry
- (N : Node_Id;
- Ent : Entity_Id;
- Pid : Node_Id)
- return Node_Id;
+ (N : Node_Id;
+ Ent : Entity_Id;
+ Pid : Node_Id) return Node_Id;
-- Build the procedure implementing the statement sequence of
-- the specified entry body.
function Build_Protected_Entry_Specification
(Def_Id : Entity_Id;
Ent_Id : Entity_Id;
- Loc : Source_Ptr)
- return Node_Id;
+ Loc : Source_Ptr) return Node_Id;
-- Build a specification for a procedure implementing
-- the statement sequence of the specified entry body.
-- Add attributes associating it with the entry defining identifier
@@ -171,8 +159,7 @@ package body Exp_Ch9 is
function Build_Protected_Subprogram_Body
(N : Node_Id;
Pid : Node_Id;
- N_Op_Spec : Node_Id)
- return Node_Id;
+ N_Op_Spec : Node_Id) return Node_Id;
-- This function is used to construct the protected version of a protected
-- subprogram. Its statement sequence first defers abortion, then locks
-- the associated protected object, and then enters a block that contains
@@ -185,8 +172,7 @@ package body Exp_Ch9 is
(N : Node_Id;
Obj_Type : Entity_Id;
Unprotected : Boolean := False;
- Ident : Entity_Id)
- return List_Id;
+ Ident : Entity_Id) return List_Id;
-- Utility shared by Build_Protected_Sub_Spec and Expand_Access_Protected_
-- Subprogram_Type. Builds signature of protected subprogram, adding the
-- formal that corresponds to the object itself. For an access to protected
@@ -197,8 +183,7 @@ package body Exp_Ch9 is
function Build_Selected_Name
(Prefix, Selector : Name_Id;
- Append_Char : Character := ' ')
- return Name_Id;
+ Append_Char : Character := ' ') return Name_Id;
-- Build a name in the form of Prefix__Selector, with an optional
-- character appended. This is used for internal subprograms generated
-- for operations of protected types, including barrier functions. In
@@ -227,9 +212,8 @@ package body Exp_Ch9 is
-- value type that is associated with the task type.
function Build_Unprotected_Subprogram_Body
- (N : Node_Id;
- Pid : Node_Id)
- return Node_Id;
+ (N : Node_Id;
+ Pid : Node_Id) return Node_Id;
-- This routine constructs the unprotected version of a protected
-- subprogram body, which is contains all of the code in the
-- original, unexpanded body. This is the version of the protected
@@ -248,8 +232,7 @@ package body Exp_Ch9 is
(Loc : Source_Ptr;
Hi : Node_Id;
Lo : Node_Id;
- Ttyp : Entity_Id)
- return Node_Id;
+ Ttyp : Entity_Id) return Node_Id;
-- Compute (Hi - Lo) for two entry family indices. Hi is the index in
-- an accept statement, or the upper bound in the discrete subtype of
-- an entry declaration. Lo is the corresponding lower bound. Ttyp is
@@ -259,8 +242,7 @@ package body Exp_Ch9 is
(Loc : Source_Ptr;
Hi : Node_Id;
Lo : Node_Id;
- Ttyp : Entity_Id)
- return Node_Id;
+ Ttyp : Entity_Id) return Node_Id;
-- Compute (Hi - Lo) + 1 Max 0, to determine the number of entries in
-- a family, and handle properly the superflat case. This is equivalent
-- to the use of 'Length on the index type, but must use Family_Offset
@@ -275,9 +257,8 @@ package body Exp_Ch9 is
-- the entry name, and the entry family index.
function Find_Task_Or_Protected_Pragma
- (T : Node_Id;
- P : Name_Id)
- return Node_Id;
+ (T : Node_Id;
+ P : Name_Id) return Node_Id;
-- Searches the task or protected definition T for the first occurrence
-- of the pragma whose name is given by P. The caller has ensured that
-- the pragma is present in the task definition. A special case is that
@@ -302,8 +283,7 @@ package body Exp_Ch9 is
(Sloc : Source_Ptr;
Ent : Entity_Id;
Index : Node_Id;
- Tsk : Entity_Id)
- return Node_Id
+ Tsk : Entity_Id) return Node_Id
is
Ttyp : constant Entity_Id := Etype (Tsk);
Expr : Node_Id;
@@ -746,8 +726,7 @@ package body Exp_Ch9 is
function Build_Barrier_Function
(N : Node_Id;
Ent : Entity_Id;
- Pid : Node_Id)
- return Node_Id
+ Pid : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Ent_Formals : constant Node_Id := Entry_Body_Formal_Part (N);
@@ -816,8 +795,7 @@ package body Exp_Ch9 is
function Build_Barrier_Function_Specification
(Def_Id : Entity_Id;
- Loc : Source_Ptr)
- return Node_Id
+ Loc : Source_Ptr) return Node_Id
is
begin
return Make_Function_Specification (Loc,
@@ -841,9 +819,8 @@ package body Exp_Ch9 is
--------------------------
function Build_Call_With_Task
- (N : Node_Id;
- E : Entity_Id)
- return Node_Id
+ (N : Node_Id;
+ E : Entity_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
@@ -861,8 +838,7 @@ package body Exp_Ch9 is
function Build_Corresponding_Record
(N : Node_Id;
Ctyp : Entity_Id;
- Loc : Source_Ptr)
- return Node_Id
+ Loc : Source_Ptr) return Node_Id
is
Rec_Ent : constant Entity_Id :=
Make_Defining_Identifier
@@ -941,8 +917,7 @@ package body Exp_Ch9 is
function Build_Entry_Count_Expression
(Concurrent_Type : Node_Id;
Component_List : List_Id;
- Loc : Source_Ptr)
- return Node_Id
+ Loc : Source_Ptr) return Node_Id
is
Eindx : Nat;
Ent : Entity_Id;
@@ -999,10 +974,7 @@ package body Exp_Ch9 is
-- Build_Find_Body_Index --
---------------------------
- function Build_Find_Body_Index
- (Typ : Entity_Id)
- return Node_Id
- is
+ function Build_Find_Body_Index (Typ : Entity_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (Typ);
Ent : Entity_Id;
E_Typ : Entity_Id;
@@ -1192,10 +1164,7 @@ package body Exp_Ch9 is
-- Build_Find_Body_Index_Spec --
--------------------------------
- function Build_Find_Body_Index_Spec
- (Typ : Entity_Id)
- return Node_Id
- is
+ function Build_Find_Body_Index_Spec (Typ : Entity_Id) return Node_Id is
Loc : constant Source_Ptr := Sloc (Typ);
Id : constant Entity_Id :=
Make_Defining_Identifier (Loc,
@@ -1285,10 +1254,9 @@ package body Exp_Ch9 is
---------------------------
function Build_Protected_Entry
- (N : Node_Id;
- Ent : Entity_Id;
- Pid : Node_Id)
- return Node_Id
+ (N : Node_Id;
+ Ent : Entity_Id;
+ Pid : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Op_Decls : constant List_Id := New_List;
@@ -1401,8 +1369,7 @@ package body Exp_Ch9 is
function Build_Protected_Entry_Specification
(Def_Id : Entity_Id;
Ent_Id : Entity_Id;
- Loc : Source_Ptr)
- return Node_Id
+ Loc : Source_Ptr) return Node_Id
is
P : Entity_Id;
@@ -1440,8 +1407,7 @@ package body Exp_Ch9 is
(N : Node_Id;
Obj_Type : Entity_Id;
Unprotected : Boolean := False;
- Ident : Entity_Id)
- return List_Id
+ Ident : Entity_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
Formal : Entity_Id;
@@ -1494,8 +1460,7 @@ package body Exp_Ch9 is
function Build_Protected_Sub_Specification
(N : Node_Id;
Prottyp : Entity_Id;
- Unprotected : Boolean := False)
- return Node_Id
+ Unprotected : Boolean := False) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Decl : Node_Id;
@@ -1556,8 +1521,7 @@ package body Exp_Ch9 is
function Build_Protected_Subprogram_Body
(N : Node_Id;
Pid : Node_Id;
- N_Op_Spec : Node_Id)
- return Node_Id
+ N_Op_Spec : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
Op_Spec : Node_Id;
@@ -1573,9 +1537,8 @@ package body Exp_Ch9 is
Service_Name : Node_Id;
Service_Stmt : Node_Id;
R : Node_Id;
- Return_Stmt : Node_Id := Empty;
- Pre_Stmts : List_Id := No_List;
- -- Initializations to avoid spurious warnings from GCC3.
+ Return_Stmt : Node_Id := Empty; -- init to avoid gcc 3 warning
+ Pre_Stmts : List_Id := No_List; -- init to avoid gcc 3 warning
Stmts : List_Id;
Object_Parm : Node_Id;
Exc_Safe : Boolean;
@@ -1906,7 +1869,6 @@ package body Exp_Ch9 is
then
Add_Shared_Var_Lock_Procs (N);
end if;
-
end Build_Protected_Subprogram_Call;
-------------------------
@@ -1915,8 +1877,7 @@ package body Exp_Ch9 is
function Build_Selected_Name
(Prefix, Selector : Name_Id;
- Append_Char : Character := ' ')
- return Name_Id
+ Append_Char : Character := ' ') return Name_Id
is
Select_Buffer : String (1 .. Hostparm.Max_Name_Length);
Select_Len : Natural;
@@ -2336,7 +2297,6 @@ package body Exp_Ch9 is
Analyze (N);
end;
-
end Build_Simple_Entry_Call;
--------------------------------
@@ -2352,7 +2312,7 @@ package body Exp_Ch9 is
begin
-- Get the activation chain entity. Except in the case of a package
- -- body, this is in the node that was passed. For a package body, we
+ -- body, this is in the node that w as passed. For a package body, we
-- have to find the corresponding package declaration node.
if Nkind (N) = N_Package_Body then
@@ -2424,7 +2384,6 @@ package body Exp_Ch9 is
Analyze (Call);
Check_Task_Activation (N);
end if;
-
end Build_Task_Activation_Call;
-------------------------------
@@ -2492,9 +2451,63 @@ package body Exp_Ch9 is
Append_To (Actions, Block);
Set_Activation_Chain_Entity (Block, Chain);
-
end Build_Task_Allocate_Block;
+ -----------------------------------------------
+ -- Build_Task_Allocate_Block_With_Init_Stmts --
+ -----------------------------------------------
+
+ procedure Build_Task_Allocate_Block_With_Init_Stmts
+ (Actions : List_Id;
+ N : Node_Id;
+ Init_Stmts : List_Id)
+ is
+ Loc : constant Source_Ptr := Sloc (N);
+ Chain : constant Entity_Id :=
+ Make_Defining_Identifier (Loc, Name_uChain);
+ Blkent : Entity_Id;
+ Block : Node_Id;
+
+ begin
+ Blkent := Make_Defining_Identifier (Loc, New_Internal_Name ('A'));
+
+ Append_To (Init_Stmts,
+ Make_Procedure_Call_Statement (Loc,
+ Name => New_Reference_To (RTE (RE_Activate_Tasks), Loc),
+ Parameter_Associations => New_List (
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (Chain, Loc),
+ Attribute_Name => Name_Unchecked_Access))));
+
+ Block :=
+ Make_Block_Statement (Loc,
+ Identifier => New_Reference_To (Blkent, Loc),
+ Declarations => New_List (
+
+ -- _Chain : Activation_Chain;
+
+ Make_Object_Declaration (Loc,
+ Defining_Identifier => Chain,
+ Aliased_Present => True,
+ Object_Definition =>
+ New_Reference_To (RTE (RE_Activation_Chain), Loc))),
+
+ Handled_Statement_Sequence =>
+ Make_Handled_Sequence_Of_Statements (Loc, Init_Stmts),
+
+ Has_Created_Identifier => True,
+ Is_Task_Allocation_Block => True);
+
+ Append_To (Actions,
+ Make_Implicit_Label_Declaration (Loc,
+ Defining_Identifier => Blkent,
+ Label_Construct => Block));
+
+ Append_To (Actions, Block);
+
+ Set_Activation_Chain_Entity (Block, Chain);
+ end Build_Task_Allocate_Block_With_Init_Stmts;
+
-----------------------------------
-- Build_Task_Proc_Specification --
-----------------------------------
@@ -2531,7 +2544,6 @@ package body Exp_Ch9 is
Subtype_Mark =>
New_Reference_To
(Corresponding_Record_Type (T), Loc)))));
-
end Build_Task_Proc_Specification;
---------------------------------------
@@ -2539,9 +2551,8 @@ package body Exp_Ch9 is
---------------------------------------
function Build_Unprotected_Subprogram_Body
- (N : Node_Id;
- Pid : Node_Id)
- return Node_Id
+ (N : Node_Id;
+ Pid : Node_Id) return Node_Id
is
Loc : constant Source_Ptr := Sloc (N);
N_Op_Spec : Node_Id;
@@ -2563,7 +2574,6 @@ package body Exp_Ch9 is
Declarations => Op_Decls,
Handled_Statement_Sequence =>
Handled_Statement_Sequence (N));
-
end Build_Unprotected_Subprogram_Body;
----------------------------
@@ -2800,9 +2810,8 @@ package body Exp_Ch9 is
------------------------
function Convert_Concurrent
- (N : Node_Id;
- Typ : Entity_Id)
- return Node_Id
+ (N : Node_Id;
+ Typ : Entity_Id) return Node_Id
is
begin
if not Is_Concurrent_Type (Typ) then
@@ -2822,8 +2831,7 @@ package body Exp_Ch9 is
(Sloc : Source_Ptr;
Ent : Entity_Id;
Index : Node_Id;
- Ttyp : Entity_Id)
- return Node_Id
+ Ttyp : Entity_Id) return Node_Id
is
Expr : Node_Id;
Num : Node_Id;
@@ -4550,7 +4558,6 @@ package body Exp_Ch9 is
Set_Privals (Dec, Next_Op, Loc);
Set_Discriminals (Dec);
end if;
-
end Expand_N_Entry_Body;
-----------------------------------
@@ -6049,7 +6056,6 @@ package body Exp_Ch9 is
Make_Aggregate (Loc, Expressions => New_List (Null_Body, Expr)));
Num_Accept := Num_Accept + 1;
-
end Add_Accept;
----------------------------
@@ -7716,8 +7722,7 @@ package body Exp_Ch9 is
(Loc : Source_Ptr;
Hi : Node_Id;
Lo : Node_Id;
- Ttyp : Entity_Id)
- return Node_Id
+ Ttyp : Entity_Id) return Node_Id
is
function Convert_Discriminant_Ref (Bound : Node_Id) return Node_Id;
-- If one of the bounds is a reference to a discriminant, replace
@@ -7790,8 +7795,7 @@ package body Exp_Ch9 is
(Loc : Source_Ptr;
Hi : Node_Id;
Lo : Node_Id;
- Ttyp : Entity_Id)
- return Node_Id
+ Ttyp : Entity_Id) return Node_Id
is
Ityp : Entity_Id;
@@ -7820,9 +7824,8 @@ package body Exp_Ch9 is
-----------------------------------
function Find_Task_Or_Protected_Pragma
- (T : Node_Id;
- P : Name_Id)
- return Node_Id
+ (T : Node_Id;
+ P : Name_Id) return Node_Id
is
N : Node_Id;
@@ -7898,8 +7901,7 @@ package body Exp_Ch9 is
function Index_Constant_Declaration
(N : Node_Id;
Index_Id : Entity_Id;
- Prot : Entity_Id)
- return List_Id
+ Prot : Entity_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (N);
Decls : constant List_Id := New_List;
@@ -8003,8 +8005,7 @@ package body Exp_Ch9 is
--------------------------------
function Make_Initialize_Protection
- (Protect_Rec : Entity_Id)
- return List_Id
+ (Protect_Rec : Entity_Id) return List_Id
is
Loc : constant Source_Ptr := Sloc (Protect_Rec);
P_Arr : Entity_Id;
diff --git a/gcc/ada/exp_ch9.ads b/gcc/ada/exp_ch9.ads
index 76a888ed6d7..72060781470 100644
--- a/gcc/ada/exp_ch9.ads
+++ b/gcc/ada/exp_ch9.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -164,6 +164,15 @@ package Exp_Ch9 is
-- the Master_Id of the access type as the _Master parameter, and _Chain
-- (defined above) as the _Chain parameter.
+ procedure Build_Task_Allocate_Block_With_Init_Stmts
+ (Actions : List_Id;
+ N : Node_Id;
+ Init_Stmts : List_Id);
+ -- Ada0Y (AI-287): Similar to previous routine, but used to expand alloca-
+ -- ted aggregates with default initialized components. Init_Stmts contains
+ -- the list of statements required to initialize the allocated aggregate.
+ -- It replaces the call to Init (Args) done by Build_Task_Allocate_Block.
+
function Concurrent_Ref (N : Node_Id) return Node_Id;
-- Given the name of a concurrent object (task or protected object), or
-- the name of an access to a concurrent object, this function returns an
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index c9ba3be354f..0d203b6d289 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -922,10 +922,11 @@ package body Exp_Disp is
-- Register_Tag (Dt_Ptr);
- -- Skip this if routine not available
+ -- Skip this if routine not available, or in No_Run_Time mode
if RTE_Available (RE_Register_Tag)
and then Is_RTE (Generalized_Tag, RE_Tag)
+ and then not No_Run_Time_Mode
then
Append_To (Elab_Code,
Make_Procedure_Call_Statement (Loc,
diff --git a/gcc/ada/exp_util.adb b/gcc/ada/exp_util.adb
index 7cc74834745..6c3911c740d 100644
--- a/gcc/ada/exp_util.adb
+++ b/gcc/ada/exp_util.adb
@@ -3510,7 +3510,7 @@ package body Exp_Util is
Make_Object_Declaration (Loc,
Defining_Identifier => Def_Id,
Object_Definition => New_Reference_To (Exp_Type, Loc),
- Constant_Present => True,
+ Constant_Present => not Is_Variable (Exp),
Expression => Relocate_Node (Exp));
Set_Assignment_OK (E);
diff --git a/gcc/ada/expect.c b/gcc/ada/expect.c
index 3a86ffdf87c..54952268517 100644
--- a/gcc/ada/expect.c
+++ b/gcc/ada/expect.c
@@ -72,7 +72,7 @@ __gnat_kill (int pid, int sig)
}
int
-__gnat_expect_fork ()
+__gnat_expect_fork (void)
{
return 0;
}
@@ -159,7 +159,7 @@ __gnat_pipe (int *fd)
}
int
-__gnat_expect_fork ()
+__gnat_expect_fork (void)
{
return -1;
}
@@ -299,7 +299,7 @@ __gnat_pipe (int *fd)
}
int
-__gnat_expect_fork ()
+__gnat_expect_fork (void)
{
return fork ();
}
@@ -406,7 +406,7 @@ __gnat_pipe (int *fd)
}
int
-__gnat_expect_fork ()
+__gnat_expect_fork (void)
{
return -1;
}
diff --git a/gcc/ada/final.c b/gcc/ada/final.c
index 0fda97b98ee..c17c6769b52 100644
--- a/gcc/ada/final.c
+++ b/gcc/ada/final.c
@@ -38,6 +38,6 @@ extern void __gnat_finalize (void);
where finalization is required. */
void
-__gnat_finalize ()
+__gnat_finalize (void)
{
}
diff --git a/gcc/ada/fmap.adb b/gcc/ada/fmap.adb
index f65d88781a0..0c7ec893ce2 100644
--- a/gcc/ada/fmap.adb
+++ b/gcc/ada/fmap.adb
@@ -292,7 +292,7 @@ package body Fmap is
then
Write_Str ("warning: mapping file """);
Write_Str (File_Name);
- Write_Line (""" is incorrectly formated");
+ Write_Line (""" is incorrectly formatted");
Empty_Tables;
return;
end if;
diff --git a/gcc/ada/freeze.adb b/gcc/ada/freeze.adb
index 18f77f04283..812ea693e52 100644
--- a/gcc/ada/freeze.adb
+++ b/gcc/ada/freeze.adb
@@ -124,7 +124,12 @@ package body Freeze is
-- a subprogram type (i.e. an access to a subprogram).
function Is_Fully_Defined (T : Entity_Id) return Boolean;
- -- true if T is not private, or has a full view.
+ -- True if T is not private and has no private components, or has a full
+ -- view. Used to determine whether the designated type of an access type
+ -- should be frozen when the access type is frozen. This is done when an
+ -- allocator is frozen, or an expression that may involve attributes of
+ -- the designated type. Otherwise freezing the access type does not freeze
+ -- the designated type.
procedure Process_Default_Expressions
(E : Entity_Id;
@@ -1812,16 +1817,19 @@ package body Freeze is
-- fields with component clauses, where we must check the size.
-- This is not done till the freeze point, since for fixed-point
-- types, we do not know the size until the type is frozen.
+ -- Similar processing applies to bit packed arrays.
if Is_First_Subtype (Rec) then
Comp := First_Component (Rec);
while Present (Comp) loop
if Present (Component_Clause (Comp))
- and then Is_Fixed_Point_Type (Etype (Comp))
+ and then (Is_Fixed_Point_Type (Etype (Comp))
+ or else
+ Is_Bit_Packed_Array (Etype (Comp)))
then
Check_Size
- (Component_Clause (Comp),
+ (Component_Name (Component_Clause (Comp)),
Etype (Comp),
Esize (Comp),
Junk);
@@ -2377,6 +2385,29 @@ package body Freeze is
end if;
end if;
+ -- For bit-packed arrays, check the size
+
+ if Is_Bit_Packed_Array (E)
+ and then Known_Esize (E)
+ then
+ declare
+ Discard : Boolean;
+ SizC : constant Node_Id := Size_Clause (E);
+
+ begin
+ -- It is not clear if it is possible to have no size
+ -- clause at this stage, but this is not worth worrying
+ -- about. Post the error on the entity name in the size
+ -- clause if present, else on the type entity itself.
+
+ if Present (SizC) then
+ Check_Size (Name (SizC), E, Esize (E), Discard);
+ else
+ Check_Size (E, E, Esize (E), Discard);
+ end if;
+ end;
+ end if;
+
-- Check one common case of a size given where the array
-- needs to be packed, but was not so the size cannot be
-- honored. This would of course be caught by the backend,
@@ -4246,15 +4277,38 @@ package body Freeze is
-- Is_Fully_Defined --
-----------------------
- -- Should this be in Sem_Util ???
-
function Is_Fully_Defined (T : Entity_Id) return Boolean is
begin
if Ekind (T) = E_Class_Wide_Type then
return Is_Fully_Defined (Etype (T));
- else
- return not Is_Private_Type (T)
- or else Present (Full_View (Base_Type (T)));
+
+ elsif Is_Array_Type (T) then
+ return Is_Fully_Defined (Component_Type (T));
+
+ elsif Is_Record_Type (T)
+ and not Is_Private_Type (T)
+ then
+ -- Verify that the record type has no components with
+ -- private types without completion.
+
+ declare
+ Comp : Entity_Id;
+
+ begin
+ Comp := First_Component (T);
+
+ while Present (Comp) loop
+ if not Is_Fully_Defined (Etype (Comp)) then
+ return False;
+ end if;
+
+ Next_Component (Comp);
+ end loop;
+ return True;
+ end;
+
+ else return not Is_Private_Type (T)
+ or else Present (Full_View (Base_Type (T)));
end if;
end Is_Fully_Defined;
diff --git a/gcc/ada/g-awk.adb b/gcc/ada/g-awk.adb
index 3396daac0e1..cece7e6de48 100644
--- a/gcc/ada/g-awk.adb
+++ b/gcc/ada/g-awk.adb
@@ -873,8 +873,7 @@ package body GNAT.AWK is
Callbacks : Callback_Mode := None;
Session : Session_Type := Current_Session)
is
- Filter_Active : Boolean;
- Quit : Boolean;
+ Quit : Boolean;
begin
Open (Separators, Filename, Session);
@@ -884,7 +883,12 @@ package body GNAT.AWK is
Split_Line (Session);
if Callbacks in Only .. Pass_Through then
- Filter_Active := Apply_Filters (Session);
+ declare
+ Discard : Boolean;
+ pragma Unreferenced (Discard);
+ begin
+ Discard := Apply_Filters (Session);
+ end;
end if;
if Callbacks /= Only then
diff --git a/gcc/ada/g-debpoo.adb b/gcc/ada/g-debpoo.adb
index ef853da04e9..4eeae1af222 100644
--- a/gcc/ada/g-debpoo.adb
+++ b/gcc/ada/g-debpoo.adb
@@ -116,7 +116,7 @@ package body GNAT.Debug_Pools is
return Tracebacks_Array_Access;
function Hash (T : Tracebacks_Array_Access) return Header;
function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean;
- pragma Inline (Set_Next, Next, Get_Key, Equal, Hash);
+ pragma Inline (Set_Next, Next, Get_Key, Hash);
-- Subprograms required for instantiation of the htable. See GNAT.HTable.
package Backtrace_Htable is new GNAT.HTable.Static_HTable
@@ -374,7 +374,6 @@ package body GNAT.Debug_Pools is
function Equal (K1, K2 : Tracebacks_Array_Access) return Boolean is
use Ada.Exceptions.Traceback;
-
begin
return K1.all = K2.all;
end Equal;
diff --git a/gcc/ada/g-debuti.adb b/gcc/ada/g-debuti.adb
index 1c1e29d7304..8e4480ab50b 100644
--- a/gcc/ada/g-debuti.adb
+++ b/gcc/ada/g-debuti.adb
@@ -39,9 +39,11 @@ package body GNAT.Debug_Utilities is
H : constant array (0 .. 15) of Character := "0123456789ABCDEF";
-- Table of hex digits
- --------------------------
- -- Image (address case) --
- --------------------------
+ -----------
+ -- Image --
+ -----------
+
+ -- Address case
function Image (A : Address) return Image_String is
S : Image_String;
@@ -71,9 +73,11 @@ package body GNAT.Debug_Utilities is
return S;
end Image;
- -------------------------
- -- Image (string case) --
- -------------------------
+ -----------
+ -- Image --
+ -----------
+
+ -- String case
function Image (S : String) return String is
W : String (1 .. 2 * S'Length + 2);
diff --git a/gcc/ada/g-dirope.adb b/gcc/ada/g-dirope.adb
index ca200ebf843..321b81244c4 100644
--- a/gcc/ada/g-dirope.adb
+++ b/gcc/ada/g-dirope.adb
@@ -123,11 +123,17 @@ package body GNAT.Directory_Operations is
Base_Name.Path (Cut_Start - Offset .. Cut_End - Offset);
-- Here we use Base_Name.Path to keep the original casing
+ Has_Drive_Letter : constant Boolean :=
+ OS_Lib.Path_Separator /= ':';
+ -- If Path separator is not ':' then we are on a DOS based OS
+ -- where this character is used as a drive letter separator.
+
begin
if BN = "." or else BN = ".." then
return "";
- elsif BN'Length > 2
+ elsif Has_Drive_Letter
+ and then BN'Length > 2
and then Characters.Handling.Is_Letter (BN (BN'First))
and then BN (BN'First + 1) = ':'
then
diff --git a/gcc/ada/g-memdum.adb b/gcc/ada/g-memdum.adb
index fd2167c4a63..92f08392e47 100644
--- a/gcc/ada/g-memdum.adb
+++ b/gcc/ada/g-memdum.adb
@@ -66,7 +66,7 @@ package body GNAT.Memory_Dump is
Line_Buf : String (1 .. Line_Len);
- Hex : array (0 .. 15) of Character := "0123456789ABCDEF";
+ Hex : constant array (0 .. 15) of Character := "0123456789ABCDEF";
type Char_Ptr is access all Character;
diff --git a/gcc/ada/g-os_lib.adb b/gcc/ada/g-os_lib.adb
index 24f6297b639..d568d364a7a 100644
--- a/gcc/ada/g-os_lib.adb
+++ b/gcc/ada/g-os_lib.adb
@@ -32,6 +32,7 @@
------------------------------------------------------------------------------
with System.Case_Util;
+with System.CRTL;
with System.Soft_Links;
with Unchecked_Conversion;
with System; use System;
@@ -82,8 +83,7 @@ package body GNAT.OS_Lib is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access;
+ Path_Len : Integer) return String_Access;
-- Converts a C String to an Ada String. We could do this making use of
-- Interfaces.C.Strings but we prefer not to import that entire package
@@ -143,8 +143,7 @@ package body GNAT.OS_Lib is
-----------------------------
function Argument_String_To_List
- (Arg_String : String)
- return Argument_List_Access
+ (Arg_String : String) return Argument_List_Access
is
Max_Args : constant Integer := Arg_String'Length;
New_Argv : Argument_List (1 .. Max_Args);
@@ -397,8 +396,7 @@ package body GNAT.OS_Lib is
function Copy_Attributes
(From, To : System.Address;
- Mode : Integer)
- return Integer;
+ Mode : Integer) return Integer;
pragma Import (C, Copy_Attributes, "__gnat_copy_attribs");
-- Mode = 0 - copy only time stamps.
-- Mode = 1 - copy time stamps and read/write/execute attributes
@@ -558,8 +556,7 @@ package body GNAT.OS_Lib is
function Copy_Attributes
(From, To : System.Address;
- Mode : Integer)
- return Integer;
+ Mode : Integer) return Integer;
pragma Import (C, Copy_Attributes, "__gnat_copy_attribs");
-- Mode = 0 - copy only time stamps.
-- Mode = 1 - copy time stamps and read/write/execute attributes
@@ -611,13 +608,11 @@ package body GNAT.OS_Lib is
function Create_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
function C_Create_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
pragma Import (C, C_Create_File, "__gnat_open_create");
begin
@@ -626,8 +621,7 @@ package body GNAT.OS_Lib is
function Create_File
(Name : String;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
C_Name : String (1 .. Name'Length + 1);
@@ -643,13 +637,11 @@ package body GNAT.OS_Lib is
function Create_New_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
function C_Create_New_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
pragma Import (C, C_Create_New_File, "__gnat_open_new");
begin
@@ -658,8 +650,7 @@ package body GNAT.OS_Lib is
function Create_New_File
(Name : String;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
C_Name : String (1 .. Name'Length + 1);
@@ -679,8 +670,7 @@ package body GNAT.OS_Lib is
is
function Open_New_Temp
(Name : System.Address;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
pragma Import (C, Open_New_Temp, "__gnat_open_new_temp");
begin
@@ -1225,8 +1215,7 @@ package body GNAT.OS_Lib is
-------------------------
function Locate_Exec_On_Path
- (Exec_Name : String)
- return String_Access
+ (Exec_Name : String) return String_Access
is
function Locate_Exec_On_Path (C_Exec_Name : Address) return Address;
pragma Import (C, Locate_Exec_On_Path, "__gnat_locate_exec_on_path");
@@ -1262,8 +1251,7 @@ package body GNAT.OS_Lib is
function Locate_Regular_File
(File_Name : C_File_Name;
- Path : C_File_Name)
- return String_Access
+ Path : C_File_Name) return String_Access
is
function Locate_Regular_File
(C_File_Name, Path_Val : Address) return Address;
@@ -1291,8 +1279,7 @@ package body GNAT.OS_Lib is
function Locate_Regular_File
(File_Name : String;
- Path : String)
- return String_Access
+ Path : String) return String_Access
is
C_File_Name : String (1 .. File_Name'Length + 1);
C_Path : String (1 .. Path'Length + 1);
@@ -1313,8 +1300,7 @@ package body GNAT.OS_Lib is
function Non_Blocking_Spawn
(Program_Name : String;
- Args : Argument_List)
- return Process_Id
+ Args : Argument_List) return Process_Id
is
Junk : Integer;
Pid : Process_Id;
@@ -1428,8 +1414,7 @@ package body GNAT.OS_Lib is
(Name : String;
Directory : String := "";
Resolve_Links : Boolean := True;
- Case_Sensitive : Boolean := True)
- return String
+ Case_Sensitive : Boolean := True) return String
is
Max_Path : Integer;
pragma Import (C, Max_Path, "__gnat_max_path_len");
@@ -1465,13 +1450,11 @@ package body GNAT.OS_Lib is
function Readlink
(Path : System.Address;
Buf : System.Address;
- Bufsiz : Integer)
- return Integer;
+ Bufsiz : Integer) return Integer;
pragma Import (C, Readlink, "__gnat_readlink");
function To_Canonical_File_Spec
- (Host_File : System.Address)
- return System.Address;
+ (Host_File : System.Address) return System.Address;
pragma Import
(C, To_Canonical_File_Spec, "__gnat_to_canonical_file_spec");
@@ -1909,13 +1892,11 @@ package body GNAT.OS_Lib is
function Open_Read
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
function C_Open_Read
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
pragma Import (C, C_Open_Read, "__gnat_open_read");
begin
@@ -1924,8 +1905,7 @@ package body GNAT.OS_Lib is
function Open_Read
(Name : String;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
C_Name : String (1 .. Name'Length + 1);
@@ -1941,13 +1921,11 @@ package body GNAT.OS_Lib is
function Open_Read_Write
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
function C_Open_Read_Write
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
pragma Import (C, C_Open_Read_Write, "__gnat_open_rw");
begin
@@ -1956,8 +1934,7 @@ package body GNAT.OS_Lib is
function Open_Read_Write
(Name : String;
- Fmode : Mode)
- return File_Descriptor
+ Fmode : Mode) return File_Descriptor
is
C_Name : String (1 .. Name'Length + 1);
@@ -1967,6 +1944,20 @@ package body GNAT.OS_Lib is
return Open_Read_Write (C_Name (C_Name'First)'Address, Fmode);
end Open_Read_Write;
+ ----------
+ -- Read --
+ ----------
+
+ function Read
+ (FD : File_Descriptor;
+ A : System.Address;
+ N : Integer) return Integer
+ is
+ begin
+ return Integer (System.CRTL.read
+ (System.CRTL.int (FD), System.CRTL.chars (A), System.CRTL.int (N)));
+ end Read;
+
-----------------
-- Rename_File --
-----------------
@@ -2031,8 +2022,7 @@ package body GNAT.OS_Lib is
function Spawn
(Program_Name : String;
- Args : Argument_List)
- return Integer
+ Args : Argument_List) return Integer
is
Junk : Process_Id;
Result : Integer;
@@ -2173,8 +2163,7 @@ package body GNAT.OS_Lib is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access
+ Path_Len : Integer) return String_Access
is
subtype Path_String is String (1 .. Path_Len);
type Path_String_Access is access Path_String;
@@ -2213,4 +2202,18 @@ package body GNAT.OS_Lib is
Success := (Status = 0);
end Wait_Process;
+ -----------
+ -- Write --
+ -----------
+
+ function Write
+ (FD : File_Descriptor;
+ A : System.Address;
+ N : Integer) return Integer
+ is
+ begin
+ return Integer (System.CRTL.write
+ (System.CRTL.int (FD), System.CRTL.chars (A), System.CRTL.int (N)));
+ end Write;
+
end GNAT.OS_Lib;
diff --git a/gcc/ada/g-os_lib.ads b/gcc/ada/g-os_lib.ads
index f7cf85bb3fc..8b317fdc2ca 100644
--- a/gcc/ada/g-os_lib.ads
+++ b/gcc/ada/g-os_lib.ads
@@ -175,31 +175,27 @@ pragma Elaborate_Body (OS_Lib);
function Open_Read
(Name : String;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
-- Open file Name for reading, returning file descriptor File descriptor
-- returned is Invalid_FD if file cannot be opened.
function Open_Read_Write
(Name : String;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
-- Open file Name for both reading and writing, returning file
-- descriptor. File descriptor returned is Invalid_FD if file cannot be
-- opened.
function Create_File
(Name : String;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
-- Creates new file with given name for writing, returning file descriptor
-- for subsequent use in Write calls. File descriptor returned is
-- Invalid_FD if file cannot be successfully created
function Create_New_File
(Name : String;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
-- Create new file with given name for writing, returning file descriptor
-- for subsequent use in Write calls. This differs from Create_File in
-- that it fails if the file already exists. File descriptor returned is
@@ -334,18 +330,14 @@ pragma Elaborate_Body (OS_Lib);
function Read
(FD : File_Descriptor;
A : System.Address;
- N : Integer)
- return Integer;
- pragma Import (C, Read, "read");
+ N : Integer) return Integer;
-- Read N bytes to address A from file referenced by FD. Returned value
-- is count of bytes actually read, which can be less than N at EOF.
function Write
(FD : File_Descriptor;
A : System.Address;
- N : Integer)
- return Integer;
- pragma Import (C, Write, "write");
+ N : Integer) return Integer;
-- Write N bytes from address A to file referenced by FD. The returned
-- value is the number of bytes written, which can be less than N if
-- a disk full condition was detected.
@@ -359,7 +351,7 @@ pragma Elaborate_Body (OS_Lib);
(FD : File_Descriptor;
offset : Long_Integer;
origin : Integer);
- pragma Import (C, Lseek, "lseek");
+ pragma Import (C, Lseek, "__gnat_lseek");
-- Sets the current file pointer to the indicated offset value,
-- relative to the current position (origin = SEEK_CUR), end of
-- file (origin = SEEK_END), or start of file (origin = SEEK_SET).
@@ -379,8 +371,7 @@ pragma Elaborate_Body (OS_Lib);
(Name : String;
Directory : String := "";
Resolve_Links : Boolean := True;
- Case_Sensitive : Boolean := True)
- return String;
+ Case_Sensitive : Boolean := True) return String;
-- Returns a file name as an absolute path name, resolving all relative
-- directories, and symbolic links. The parameter Directory is a fully
-- resolved path name for a directory, or the empty string (the default).
@@ -416,15 +407,21 @@ pragma Elaborate_Body (OS_Lib);
function Is_Absolute_Path (Name : String) return Boolean;
-- Returns True if Name is an absolute path name, i.e. it designates
- -- a directory absolutely, rather than relative to another directory.
+ -- a file or a directory absolutely, rather than relative to another
+ -- directory.
function Is_Regular_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing
- -- regular file. Returns True if so, False otherwise.
+ -- regular file. Returns True if so, False otherwise. Name may be an
+ -- absolute path name or a relative path name, including a simple file
+ -- name. If it is a relative path name, it is relative to the current
+ -- working directory.
function Is_Directory (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of a directory.
- -- Returns True if so, False otherwise.
+ -- Returns True if so, False otherwise. Name may be an absolute path
+ -- name or a relative path name, including a simple file name. If it is
+ -- a relative path name, it is relative to the current working directory.
function Is_Readable_File (Name : String) return Boolean;
-- Determines if the given string, Name, is the name of an existing
@@ -452,8 +449,7 @@ pragma Elaborate_Body (OS_Lib);
-- span file systems and may refer to directories.
function Locate_Exec_On_Path
- (Exec_Name : String)
- return String_Access;
+ (Exec_Name : String) return String_Access;
-- Try to locate an executable whose name is given by Exec_Name in the
-- directories listed in the environment Path. If the Exec_Name doesn't
-- have the executable suffix, it will be appended before the search.
@@ -464,8 +460,7 @@ pragma Elaborate_Body (OS_Lib);
function Locate_Regular_File
(File_Name : String;
- Path : String)
- return String_Access;
+ Path : String) return String_Access;
-- Try to locate a regular file whose name is given by File_Name in the
-- directories listed in Path. If a file is found, its full pathname is
-- returned; otherwise, a null pointer is returned. If the File_Name given
@@ -505,25 +500,23 @@ pragma Elaborate_Body (OS_Lib);
-- This subtype is used to document that a parameter is the address
-- of a null-terminated string containing the name of a file.
+ -- All the following functions need comments ???
+
function Open_Read
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
function Open_Read_Write
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
function Create_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
function Create_New_File
(Name : C_File_Name;
- Fmode : Mode)
- return File_Descriptor;
+ Fmode : Mode) return File_Descriptor;
procedure Delete_File (Name : C_File_Name; Success : out Boolean);
diff --git a/gcc/ada/5ytiitho.adb b/gcc/ada/g-signal.adb
index f0027fd24e1..605b3e72f91 100644
--- a/gcc/ada/5ytiitho.adb
+++ b/gcc/ada/g-signal.adb
@@ -1,13 +1,12 @@
------------------------------------------------------------------------------
-- --
--- GNAT COMPILER COMPONENTS --
+-- GNAT RUNTIME COMPONENTS --
-- --
--- S Y S T E M . T H R E A D S . I N I T I A L I Z A T I O N . --
--- I N I T I A L I Z E _ T A S K _ H O O K S --
+-- G N A T . S I G N A L S --
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
+-- Copyright (C) 2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -32,35 +31,41 @@
-- --
------------------------------------------------------------------------------
--- This is the VxWorks AE 653 version of this procedure
+with System.Interrupts;
-separate (System.Threads.Initialization)
+package body GNAT.Signals is
-procedure Initialize_Task_Hooks is
+ package SI renames System.Interrupts;
- -- When defining the following routines for export in an AE 1.1
- -- simulation of AE653, Interfaces.C.int may be used for the
- -- parameters of FUNCPTR.
- type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS;
+ ------------------
+ -- Block_Signal --
+ ------------------
- --------------------------------
- -- Imported vThreads Routines --
- --------------------------------
+ procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID) is
+ begin
+ SI.Block_Interrupt (SI.Interrupt_ID (Signal));
+ end Block_Signal;
- procedure procCreateHookAdd (createHookFunction : FUNCPTR);
- pragma Import (C, procCreateHookAdd, "procCreateHookAdd");
- -- Registers task registration routine for AE653
+ ----------------
+ -- Is_Blocked --
+ ----------------
- procedure procStartHookAdd (StartHookFunction : FUNCPTR);
- pragma Import (C, procStartHookAdd, "procStartHookAdd");
- -- Registers task restart routine for AE653
+ function Is_Blocked
+ (Signal : Ada.Interrupts.Interrupt_ID)
+ return Boolean
+ is
+ begin
+ return SI.Is_Blocked (SI.Interrupt_ID (Signal));
+ end Is_Blocked;
+
+ --------------------
+ -- Unblock_Signal --
+ --------------------
+
+ procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID) is
+ begin
+ SI.Unblock_Interrupt (SI.Interrupt_ID (Signal));
+ end Unblock_Signal;
+
+end GNAT.Signals;
- Result : OSI.STATUS;
-begin
- -- Register the exported routines with the vThreads ARINC API
- procCreateHookAdd (Register'Access);
- procStartHookAdd (Reset_TSD'Access);
- -- Register the environment task
- Result := Register (OSI.taskIdSelf);
- pragma Assert (Result /= -1);
-end Initialize_Task_Hooks;
diff --git a/gcc/ada/s-tpae65.ads b/gcc/ada/g-signal.ads
index 641f17187d8..6939fe27386 100644
--- a/gcc/ada/s-tpae65.ads
+++ b/gcc/ada/g-signal.ads
@@ -1,21 +1,21 @@
------------------------------------------------------------------------------
-- --
--- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
+-- GNAT RUNTIME COMPONENTS --
-- --
--- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 --
+-- G N A T . S I G N A L S --
-- --
--- S p e c --
+-- S p e c --
-- --
--- Copyright (C) 2002-2003, Free Software Foundation, Inc. --
+-- Copyright (C) 2003 Free Software Foundation, Inc. --
-- --
--- GNARL is free software; you can redistribute it and/or modify it under --
+-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
-- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
-- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see file COPYING. If not, write --
+-- Public License distributed with GNAT; see file COPYING. If not, write --
-- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
-- MA 02111-1307, USA. --
-- --
@@ -26,29 +26,30 @@
-- however invalidate any other reasons why the executable file might be --
-- covered by the GNU Public License. --
-- --
--- GNARL was developed by the GNARL team at Florida State University. --
--- Extensive contributions were provided by Ada Core Technologies, Inc. --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
-- --
------------------------------------------------------------------------------
--- Export certain tasking-related routines for use by Interfaces.Vthreads
+with Ada.Interrupts;
-with System.Tasking;
-with System.OS_Interface;
-package System.Task_Primitives.Ae_653 is
- type Address_Access is access System.Address;
+-- This package provides operations for querying and setting the blocked
+-- status of signals.
- function ATCB_Key_Addr return Address_Access;
- pragma Inline (ATCB_Key_Addr);
- -- Address of ATCB_Key taskvar
+-- This package is supported only on targets where Ada.Interrupts.Interrupt_ID
+-- corresponds to software signals on the target, and where System.Interrupts
+-- provides the ability to block and unblock signals.
- procedure Set_Current_Priority
- (T : System.Tasking.Task_ID; Prio : System.Priority);
- -- Set priority
+package GNAT.Signals is
- procedure Set_Task_Thread
- (T : System.Tasking.Task_ID;
- Thread : System.OS_Interface.Thread_Id);
- -- Set "Thread" as the underlying OS thread implementing "T"
+ procedure Block_Signal (Signal : Ada.Interrupts.Interrupt_ID);
+ -- Block "Signal" at the process level
-end System.Task_Primitives.Ae_653;
+ procedure Unblock_Signal (Signal : Ada.Interrupts.Interrupt_ID);
+ -- Unblock "Signal" at the process level
+
+ function Is_Blocked (Signal : Ada.Interrupts.Interrupt_ID)
+ return Boolean;
+ -- "Signal" blocked at the process level?
+
+end GNAT.Signals;
diff --git a/gcc/ada/g-socket.ads b/gcc/ada/g-socket.ads
index 57a83743f1e..27841d8c9d2 100644
--- a/gcc/ada/g-socket.ads
+++ b/gcc/ada/g-socket.ads
@@ -54,6 +54,7 @@
with Ada.Exceptions;
with Ada.Streams;
+with Ada.Unchecked_Deallocation;
with System;
@@ -885,15 +886,15 @@ package GNAT.Sockets is
function Stream
(Socket : Socket_Type)
return Stream_Access;
- -- Associate a stream with a stream-based socket that is already
- -- connected.
+ -- Create a stream associated with a stream-based socket that is
+ -- already connected.
function Stream
(Socket : Socket_Type;
Send_To : Sock_Addr_Type)
return Stream_Access;
- -- Associate a stream with a datagram-based socket that is already
- -- bound. Send_To is the socket address to which messages are
+ -- Create a stream associated with a datagram-based socket that is
+ -- already bound. Send_To is the socket address to which messages are
-- being sent.
function Get_Address
@@ -902,6 +903,12 @@ package GNAT.Sockets is
-- Return the socket address from which the last message was
-- received.
+ procedure Free is new Ada.Unchecked_Deallocation
+ (Ada.Streams.Root_Stream_Type'Class, Stream_Access);
+ -- Destroy a stream created by one of the Stream functions above,
+ -- releasing the corresponding resources. The user is responsible
+ -- for calling this subprogram when the stream is not needed anymore.
+
type Socket_Set_Type is limited private;
-- This type allows to manipulate sets of sockets. It allows to
-- wait for events on multiple endpoints at one time. This is an
diff --git a/gcc/ada/g-spipat.adb b/gcc/ada/g-spipat.adb
index 3832a7603e8..2f499b8d3ec 100644
--- a/gcc/ada/g-spipat.adb
+++ b/gcc/ada/g-spipat.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2002, Ada Core Technologies, Inc. --
+-- Copyright (C) 1998-2003, Ada Core Technologies, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -343,30 +343,28 @@ package body GNAT.Spitbol.Patterns is
-- structure (i.e. it is a pattern that is guaranteed to match at least
-- one character on success, and not to make any entries on the stack.
- OK_For_Simple_Arbno :
- array (Pattern_Code) of Boolean := (
- PC_Any_CS |
- PC_Any_CH |
- PC_Any_VF |
- PC_Any_VP |
- PC_Char |
- PC_Len_Nat |
- PC_NotAny_CS |
- PC_NotAny_CH |
- PC_NotAny_VF |
- PC_NotAny_VP |
- PC_Span_CS |
- PC_Span_CH |
- PC_Span_VF |
- PC_Span_VP |
- PC_String |
- PC_String_2 |
- PC_String_3 |
- PC_String_4 |
- PC_String_5 |
- PC_String_6 => True,
-
- others => False);
+ OK_For_Simple_Arbno : constant array (Pattern_Code) of Boolean :=
+ (PC_Any_CS |
+ PC_Any_CH |
+ PC_Any_VF |
+ PC_Any_VP |
+ PC_Char |
+ PC_Len_Nat |
+ PC_NotAny_CS |
+ PC_NotAny_CH |
+ PC_NotAny_VF |
+ PC_NotAny_VP |
+ PC_Span_CS |
+ PC_Span_CH |
+ PC_Span_VF |
+ PC_Span_VP |
+ PC_String |
+ PC_String_2 |
+ PC_String_3 |
+ PC_String_4 |
+ PC_String_5 |
+ PC_String_6 => True,
+ others => False);
-------------------------------
-- The Pattern History Stack --
diff --git a/gcc/ada/g-table.adb b/gcc/ada/g-table.adb
index 57f7c724058..e3eaa23b039 100644
--- a/gcc/ada/g-table.adb
+++ b/gcc/ada/g-table.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2002 Ada Core Technologies, Inc. --
+-- Copyright (C) 1998-2003 Ada Core Technologies, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -224,7 +224,7 @@ package body GNAT.Table is
Item : Table_Component_Type)
is
begin
- if Integer (Index) > Max then
+ if Integer (Index) > Last_Val then
Set_Last (Index);
end if;
diff --git a/gcc/ada/g-thread.adb b/gcc/ada/g-thread.adb
index 30367306b2f..1d71f379ed4 100644
--- a/gcc/ada/g-thread.adb
+++ b/gcc/ada/g-thread.adb
@@ -81,8 +81,7 @@ package body GNAT.Threads is
(Code : Address;
Parm : Void_Ptr;
Size : Natural;
- Prio : Integer)
- return System.Address
+ Prio : Integer) return System.Address
is
TP : Tptr;
@@ -108,7 +107,6 @@ package body GNAT.Threads is
procedure Unregister_Thread is
Self_Id : constant Tasking.Task_ID := Task_Primitives.Operations.Self;
-
begin
Self_Id.Common.State := Tasking.Terminated;
Destroy_TSD (Self_Id.Common.Compiler_Data);
@@ -150,7 +148,6 @@ package body GNAT.Threads is
procedure Destroy_Thread (Id : Address) is
Tid : constant Task_Id := To_Id (Id);
-
begin
Abort_Task (Tid);
end Destroy_Thread;
@@ -161,9 +158,7 @@ package body GNAT.Threads is
procedure Get_Thread (Id : Address; Thread : Address) is
use System.OS_Interface;
-
- Thr : Thread_Id_Ptr := To_Thread (Thread);
-
+ Thr : constant Thread_Id_Ptr := To_Thread (Thread);
begin
Thr.all := Task_Primitives.Operations.Get_Thread_Id (To_Id (Id));
end Get_Thread;
@@ -173,8 +168,7 @@ package body GNAT.Threads is
----------------
function To_Task_Id
- (Id : System.Address)
- return Ada.Task_Identification.Task_Id
+ (Id : System.Address) return Ada.Task_Identification.Task_Id
is
begin
return To_Tid (Id);
diff --git a/gcc/ada/gigi.h b/gcc/ada/gigi.h
index 573d934b4ab..4d4467127bc 100644
--- a/gcc/ada/gigi.h
+++ b/gcc/ada/gigi.h
@@ -39,42 +39,42 @@ extern unsigned int largest_move_alignment;
/* See if DECL has an RTL that is indirect via a pseudo-register or a
memory location and replace it with an indirect reference if so.
This improves the debugger's ability to display the value. */
-extern void adjust_decl_rtl PARAMS ((tree));
+extern void adjust_decl_rtl (tree);
/* Record the current code position in GNAT_NODE. */
-extern void record_code_position PARAMS ((Node_Id));
+extern void record_code_position (Node_Id);
/* Insert the code for GNAT_NODE at the position saved for that node. */
-extern void insert_code_for PARAMS ((Node_Id));
+extern void insert_code_for (Node_Id);
/* Compute the alignment of the largest mode that can be used for copying
objects. */
-extern void gnat_compute_largest_alignment PARAMS ((void));
+extern void gnat_compute_largest_alignment (void);
/* Routine called by gcc for emitting a stack check. GNU_EXPR is the
expression that contains the last address on the stack to check. */
-extern tree emit_stack_check PARAMS ((tree));
+extern tree emit_stack_check (tree);
/* Make a TRANSFORM_EXPR to later expand GNAT_NODE into code. */
-extern tree make_transform_expr PARAMS ((Node_Id));
+extern tree make_transform_expr (Node_Id);
/* Update the setjmp buffer BUF with the current stack pointer. We assume
here that a __builtin_setjmp was done to BUF. */
-extern void update_setjmp_buf PARAMS ((tree));
+extern void update_setjmp_buf (tree);
/* GNU_TYPE is a type. Determine if it should be passed by reference by
default. */
-extern int default_pass_by_ref PARAMS ((tree));
+extern int default_pass_by_ref (tree);
/* GNU_TYPE is the type of a subprogram parameter. Determine from the type
if it should be passed by reference. */
-extern int must_pass_by_ref PARAMS ((tree));
+extern int must_pass_by_ref (tree);
/* Elaboration routines for the front end. */
-extern void elab_all_gnat PARAMS ((void));
+extern void elab_all_gnat (void);
/* Initialize DUMMY_NODE_TABLE. */
-extern void init_dummy_type PARAMS ((void));
+extern void init_dummy_type (void);
/* Given GNAT_ENTITY, a GNAT defining identifier node, which denotes some Ada
entity, this routine returns the equivalent GCC tree for that entity
@@ -91,63 +91,63 @@ extern void init_dummy_type PARAMS ((void));
was not created previously. The value of 1 is normally used for a non-zero
DEFINITION, but a value of 2 is used in special circumstances, defined in
the code. */
-extern tree gnat_to_gnu_entity PARAMS ((Entity_Id, tree, int));
+extern tree gnat_to_gnu_entity (Entity_Id, tree, int);
/* Given GNAT_ENTITY, an entity in the incoming GNAT tree, return a
GCC type corresponding to that entity. GNAT_ENTITY is assumed to
refer to an Ada type. */
-extern tree gnat_to_gnu_type PARAMS ((Entity_Id));
+extern tree gnat_to_gnu_type (Entity_Id);
/* Given GNAT_ENTITY, elaborate all expressions that are required to
be elaborated at the point of its definition, but do nothing else. */
-extern void elaborate_entity PARAMS ((Entity_Id));
+extern void elaborate_entity (Entity_Id);
/* Mark GNAT_ENTITY as going out of scope at this point. Recursively mark
any entities on its entity chain similarly. */
-extern void mark_out_of_scope PARAMS ((Entity_Id));
+extern void mark_out_of_scope (Entity_Id);
/* Make a dummy type corresponding to GNAT_TYPE. */
-extern tree make_dummy_type PARAMS ((Entity_Id));
+extern tree make_dummy_type (Entity_Id);
/* Get the unpadded version of a GNAT type. */
-extern tree get_unpadded_type PARAMS ((Entity_Id));
+extern tree get_unpadded_type (Entity_Id);
/* Called when we need to protect a variable object using a save_expr. */
-extern tree maybe_variable PARAMS ((tree, Node_Id));
+extern tree maybe_variable (tree, Node_Id);
/* Create a record type that contains a field of TYPE with a starting bit
position so that it is aligned to ALIGN bits. */
/* Create a record type that contains a field of TYPE with a starting bit
position so that it is aligned to ALIGN bits and is SIZE bytes long. */
-extern tree make_aligning_type PARAMS ((tree, int, tree));
+extern tree make_aligning_type (tree, int, tree);
/* Given a GNU tree and a GNAT list of choices, generate an expression to test
the value passed against the list of choices. */
-extern tree choices_to_gnu PARAMS ((tree, Node_Id));
+extern tree choices_to_gnu (tree, Node_Id);
/* Given a type T, a FIELD_DECL F, and a replacement value R,
return a new type with all size expressions that contain F
updated by replacing F with R. This is identical to GCC's
substitute_in_type except that it knows about TYPE_INDEX_TYPE. */
-extern tree gnat_substitute_in_type PARAMS ((tree, tree, tree));
+extern tree gnat_substitute_in_type (tree, tree, tree);
/* Return the "RM size" of GNU_TYPE. This is the actual number of bits
needed to represent the object. */
-extern tree rm_size PARAMS ((tree));
+extern tree rm_size (tree);
/* Given GNU_ID, an IDENTIFIER_NODE containing a name and SUFFIX, a
string, return a new IDENTIFIER_NODE that is the concatenation of
the name in GNU_ID and SUFFIX. */
-extern tree concat_id_with_name PARAMS ((tree, const char *));
+extern tree concat_id_with_name (tree, const char *);
/* Return the name to be used for GNAT_ENTITY. If a type, create a
fully-qualified name, possibly with type information encoding.
Otherwise, return the name. */
-extern tree get_entity_name PARAMS ((Entity_Id));
+extern tree get_entity_name (Entity_Id);
/* Return a name for GNAT_ENTITY concatenated with two underscores and
SUFFIX. */
-extern tree create_concat_name PARAMS ((Entity_Id, const char *));
+extern tree create_concat_name (Entity_Id, const char *);
/* Flag indicating whether file names are discarded in exception messages */
extern int discard_file_names;
@@ -168,81 +168,78 @@ extern GTY(()) tree gnu_block_stack;
/* This is the main program of the back-end. It sets up all the table
structures and then generates code. */
-extern void gigi PARAMS ((Node_Id, int, int, struct Node *,
- Node_Id *, Node_Id *,
- struct Elist_Header *,
- struct Elmt_Item *,
- struct String_Entry *,
- Char_Code *,
- struct List_Header *,
- Int, char *,
- Entity_Id, Entity_Id, Entity_Id,
- Int));
+extern void gigi (Node_Id, int, int, struct Node *, Node_Id *, Node_Id *,
+ struct Elist_Header *, struct Elmt_Item *,
+ struct String_Entry *, Char_Code *, struct List_Header *,
+ Int, char *, Entity_Id, Entity_Id, Entity_Id, Int);
/* This function is the driver of the GNAT to GCC tree transformation process.
GNAT_NODE is the root of some gnat tree. It generates code for that
part of the tree. */
-extern void gnat_to_code PARAMS ((Node_Id));
+extern void gnat_to_code (Node_Id);
/* GNAT_NODE is the root of some GNAT tree. Return the root of the
GCC tree corresponding to that GNAT tree. Normally, no code is generated;
we just return an equivalent tree which is used elsewhere to generate
code. */
-extern tree gnat_to_gnu PARAMS ((Node_Id));
+extern tree gnat_to_gnu (Node_Id);
+
+/* GNU_STMT is a statement. We generate code for that statement. */
+extern void gnat_expand_stmt (tree);
/* Do the processing for the declaration of a GNAT_ENTITY, a type. If
a separate Freeze node exists, delay the bulk of the processing. Otherwise
make a GCC type for GNAT_ENTITY and set up the correspondance. */
-extern void process_type PARAMS ((Entity_Id));
+extern void process_type (Entity_Id);
/* Determine the input_filename and the input_line from the source location
(Sloc) of GNAT_NODE node. Set the global variable input_filename and
input_line. If WRITE_NOTE_P is true, emit a line number note. */
-extern void set_lineno PARAMS ((Node_Id, int));
+extern void set_lineno (Node_Id, int);
+
+/* Likewise, but passed a Sloc. */
+extern void set_lineno_from_sloc (Source_Ptr, int);
/* Post an error message. MSG is the error message, properly annotated.
NODE is the node at which to post the error and the node to use for the
"&" substitution. */
-extern void post_error PARAMS ((const char *, Node_Id));
+extern void post_error (const char *, Node_Id);
/* Similar, but NODE is the node at which to post the error and ENT
is the node to use for the "&" substitution. */
-extern void post_error_ne PARAMS ((const char *, Node_Id, Entity_Id));
+extern void post_error_ne (const char *, Node_Id, Entity_Id);
/* Similar, but NODE is the node at which to post the error, ENT is the node
to use for the "&" substitution, and N is the number to use for the ^. */
-extern void post_error_ne_num PARAMS ((const char *, Node_Id, Entity_Id,
- int));
+extern void post_error_ne_num (const char *, Node_Id, Entity_Id, int);
/* Similar to post_error_ne_num, but T is a GCC tree representing the number
to write. If the tree represents a constant that fits within a
host integer, the text inside curly brackets in MSG will be output
(presumably including a '^'). Otherwise that text will not be output
and the text inside square brackets will be output instead. */
-extern void post_error_ne_tree PARAMS ((const char *, Node_Id, Entity_Id,
- tree));
+extern void post_error_ne_tree (const char *, Node_Id, Entity_Id, tree);
/* Similar to post_error_ne_tree, except that NUM is a second
integer to write in the message. */
-extern void post_error_ne_tree_2 PARAMS ((const char *, Node_Id, Entity_Id,
- tree, int));
+extern void post_error_ne_tree_2 (const char *, Node_Id, Entity_Id, tree, int);
/* Set the node for a second '&' in the error message. */
-extern void set_second_error_entity PARAMS ((Entity_Id));
+extern void set_second_error_entity (Entity_Id);
/* Protect EXP from multiple evaluation. This may make a SAVE_EXPR. */
-extern tree protect_multiple_eval PARAMS ((tree));
+extern tree protect_multiple_eval (tree);
/* Signal abort, with "Gigi abort" as the error label, and error_gnat_node
as the relevant node that provides the location info for the error.
The single parameter CODE is an integer code that is included in the
additional error message generated. */
-extern void gigi_abort PARAMS ((int)) ATTRIBUTE_NORETURN;
+extern void gigi_abort (int) ATTRIBUTE_NORETURN;
/* Initialize the table that maps GNAT codes to GCC codes for simple
binary and unary operations. */
-extern void init_code_table PARAMS ((void));
+extern void init_code_table (void);
/* Current node being treated, in case gigi_abort or Check_Elaboration_Code
called. */
@@ -252,7 +249,7 @@ extern Node_Id error_gnat_node;
how to handle our new nodes and we take an extra argument that says
whether to force evaluation of everything. */
-extern tree gnat_stabilize_reference PARAMS ((tree, int));
+extern tree gnat_stabilize_reference (tree, int);
/* Highest number in the front-end node table. */
extern int max_gnat_nodes;
@@ -380,18 +377,18 @@ extern GTY(()) tree gnat_raise_decls[(int) LAST_REASON_CODE + 1];
prototype and names as below. */
/* Returns non-zero if we are currently in the global binding level */
-extern int global_bindings_p PARAMS ((void));
+extern int global_bindings_p (void);
/* Returns the list of declarations in the current level. Note that this list
is in reverse order (it has to be so for back-end compatibility). */
-extern tree getdecls PARAMS ((void));
+extern tree getdecls (void);
/* Nonzero if the current level needs to have a BLOCK made. */
-extern int kept_level_p PARAMS ((void));
+extern int kept_level_p (void);
/* Enter a new binding level. The input parameter is ignored, but has to be
specified for back-end compatibility. */
-extern void pushlevel PARAMS ((int));
+extern void pushlevel (int);
/* Exit a binding level.
Pop the level off, and restore the state of the identifier-decl mappings
@@ -407,52 +404,52 @@ extern void pushlevel PARAMS ((int));
If REVERSE is nonzero, reverse the order of decls before putting
them into the BLOCK. */
-extern tree poplevel PARAMS ((int,int, int));
+extern tree poplevel (int, int, int);
/* 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 the BIND_EXPR. */
-extern void insert_block PARAMS ((tree));
+extern void insert_block (tree);
/* Set the BLOCK node for the innermost scope
(the one we are currently in). */
-extern void set_block PARAMS ((tree));
+extern void set_block (tree);
/* Records a ..._DECL node DECL as belonging to the current lexical scope.
Returns the ..._DECL node. */
-extern tree pushdecl PARAMS ((tree));
+extern tree pushdecl (tree);
/* Create the predefined scalar types such as `integer_type_node' needed
in the gcc back-end and initialize the global binding level. */
-extern void gnat_init_decl_processing PARAMS ((void));
-extern void init_gigi_decls PARAMS ((tree, tree));
-extern void gnat_init_gcc_eh PARAMS ((void));
+extern void gnat_init_decl_processing (void);
+extern void init_gigi_decls (tree, tree);
+extern void gnat_init_gcc_eh (void);
/* Return an integer type with the number of bits of precision given by
PRECISION. UNSIGNEDP is nonzero if the type is unsigned; otherwise
it is a signed type. */
-extern tree gnat_type_for_size PARAMS ((unsigned, int));
+extern tree gnat_type_for_size (unsigned, int);
/* Return a data type that has machine mode MODE. UNSIGNEDP selects
an unsigned type; otherwise a signed type is returned. */
-extern tree gnat_type_for_mode PARAMS ((enum machine_mode, int));
+extern tree gnat_type_for_mode (enum machine_mode, int);
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
-extern tree gnat_unsigned_type PARAMS ((tree));
+extern tree gnat_unsigned_type (tree);
/* Return the signed version of a TYPE_NODE, a scalar type. */
-extern tree gnat_signed_type PARAMS ((tree));
+extern tree gnat_signed_type (tree);
/* Return a type the same as TYPE except unsigned or signed according to
UNSIGNEDP. */
-extern tree gnat_signed_or_unsigned_type PARAMS ((int, tree));
+extern tree gnat_signed_or_unsigned_type (int, tree);
/* 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. */
-extern tree convert PARAMS ((tree, tree));
+extern tree convert (tree, tree);
/* Routines created solely for the tree translator's sake. Their prototypes
can be changed as desired. */
@@ -462,18 +459,18 @@ extern tree convert PARAMS ((tree, tree));
GNAT_ENTITY. Such gnu tree node is always an ..._DECL node.
If NO_CHECK is nonzero, the latter check is suppressed.
If GNU_DECL is zero, a previous association is to be reset. */
-extern void save_gnu_tree PARAMS ((Entity_Id, tree, int));
+extern void save_gnu_tree (Entity_Id, tree, int);
/* GNAT_ENTITY is a GNAT tree node for a defining identifier.
Return the ..._DECL node that was associated with it. If there is no tree
node associated with GNAT_ENTITY, abort. */
-extern tree get_gnu_tree PARAMS ((Entity_Id));
+extern tree get_gnu_tree (Entity_Id);
/* Return nonzero if a GCC tree has been associated with GNAT_ENTITY. */
-extern int present_gnu_tree PARAMS ((Entity_Id));
+extern int present_gnu_tree (Entity_Id);
/* Initialize tables for above routines. */
-extern void init_gnat_to_gnu PARAMS ((void));
+extern void init_gnat_to_gnu (void);
/* Given a record type (RECORD_TYPE) and a chain of FIELD_DECL
nodes (FIELDLIST), finish constructing the record or union type.
@@ -481,7 +478,7 @@ extern void init_gnat_to_gnu PARAMS ((void));
layout_type but merely set the size and alignment ourselves.
If DEFER_DEBUG is nonzero, do not call the debugging routines
on this type; it will be done later. */
-extern void finish_record_type PARAMS ((tree, tree, int, int));
+extern void finish_record_type (tree, tree, int, int);
/* Returns a FUNCTION_TYPE node. RETURN_TYPE is the type returned by the
subprogram. If it is void_type_node, then we are dealing with a procedure,
@@ -492,23 +489,21 @@ extern void finish_record_type PARAMS ((tree, tree, int, int));
object. RETURNS_BY_REF is nonzero if the function returns by reference.
RETURNS_WITH_DSP is nonzero if the function is to return with a
depressed stack pointer. */
-extern tree create_subprog_type PARAMS ((tree, tree, tree, int, int,
- int));
+extern tree create_subprog_type (tree, tree, tree, int, int, int);
/* Return a copy of TYPE, but safe to modify in any way. */
-extern tree copy_type PARAMS ((tree));
+extern tree copy_type (tree);
/* Return an INTEGER_TYPE of SIZETYPE with range MIN to MAX and whose
TYPE_INDEX_TYPE is INDEX. */
-extern tree create_index_type PARAMS ((tree, tree, tree));
+extern tree create_index_type (tree, tree, tree);
/* Return a TYPE_DECL node. TYPE_NAME gives the name of the type (a character
string) and TYPE is a ..._TYPE node giving its data type.
ARTIFICIAL_P is nonzero if this is a declaration that was generated
by the compiler. DEBUG_INFO_P is nonzero if we need to write debugging
information about this type. */
-extern tree create_type_decl PARAMS ((tree, tree, struct attrib *,
- int, int));
+extern tree create_type_decl (tree, tree, struct attrib *, int, int);
/* Returns a GCC VAR_DECL node. VAR_NAME gives the name of the variable.
ASM_NAME is its assembler name (if provided). TYPE is
@@ -524,36 +519,35 @@ extern tree create_type_decl PARAMS ((tree, tree, struct attrib *,
definition: no storage is to be allocated for the variable here).
STATIC_FLAG is only relevant when not at top level. In that case
it indicates whether to always allocate storage to the variable. */
-extern tree create_var_decl PARAMS ((tree, tree, tree, tree, int,
- int, int, int,
- struct attrib *));
+extern tree create_var_decl (tree, tree, tree, tree, int, int, int, int,
+ struct attrib *);
/* Given a DECL and ATTR_LIST, apply the listed attributes. */
-extern void process_attributes PARAMS ((tree, struct attrib *));
+extern void process_attributes (tree, struct attrib *);
/* Obtain any pending elaborations and clear the old list. */
-extern tree get_pending_elaborations PARAMS ((void));
+extern tree get_pending_elaborations (void);
/* Return nonzero if there are pending elaborations. */
-extern int pending_elaborations_p PARAMS ((void));
+extern int pending_elaborations_p (void);
/* Save a copy of the current pending elaboration list and make a new
one. */
-extern void push_pending_elaborations PARAMS ((void));
+extern void push_pending_elaborations (void);
/* Pop the stack of pending elaborations. */
-extern void pop_pending_elaborations PARAMS ((void));
+extern void pop_pending_elaborations (void);
/* Return the current position in pending_elaborations so we can insert
elaborations after that point. */
-extern tree get_elaboration_location PARAMS ((void));
+extern tree get_elaboration_location (void);
/* Insert the current elaborations after ELAB, which is in some elaboration
list. */
-extern void insert_elaboration_list PARAMS ((tree));
+extern void insert_elaboration_list (tree);
/* Add some pending elaborations to the current list. */
-extern void add_pending_elaborations PARAMS ((tree, tree));
+extern void add_pending_elaborations (tree, tree);
/* Returns a FIELD_DECL node. FIELD_NAME the field name, FIELD_TYPE is its
type, and RECORD_TYPE is the type of the parent. PACKED is nonzero if
@@ -561,14 +555,13 @@ extern void add_pending_elaborations PARAMS ((tree, tree));
it is the specified size for this field. If POS is nonzero, it is the bit
position. If ADDRESSABLE is nonzero, it means we are allowed to take
the address of this field for aliasing purposes. */
-extern tree create_field_decl PARAMS ((tree, tree, tree, int,
- tree, tree, int));
+extern tree create_field_decl (tree, tree, tree, int, tree, tree, int);
/* Returns a PARM_DECL node. PARAM_NAME is the name of the parameter,
PARAM_TYPE is its type. READONLY is nonzero if the parameter is
readonly (either an IN parameter or an address of a pass-by-ref
parameter). */
-extern tree create_param_decl PARAMS ((tree, tree, int));
+extern tree create_param_decl (tree, tree, int);
/* Returns a FUNCTION_DECL node. SUBPROG_NAME is the name of the subprogram,
ASM_NAME is its assembler name, SUBPROG_TYPE is its type (a FUNCTION_TYPE
@@ -577,25 +570,25 @@ extern tree create_param_decl PARAMS ((tree, tree, int));
INLINE_FLAG, PUBLIC_FLAG, and EXTERN_FLAG are used to set the appropriate
fields in the FUNCTION_DECL. */
-extern tree create_subprog_decl PARAMS ((tree, tree, tree, tree, int,
- int, int, struct attrib *));
+extern tree create_subprog_decl (tree, tree, tree, tree, int, int, int,
+ struct attrib *);
/* Returns a LABEL_DECL node for LABEL_NAME. */
-extern tree create_label_decl PARAMS ((tree));
+extern tree create_label_decl (tree);
/* Set up the framework for generating code for SUBPROG_DECL, a subprogram
body. This routine needs to be invoked before processing the declarations
appearing in the subprogram. */
-extern void begin_subprog_body PARAMS ((tree));
+extern void begin_subprog_body (tree);
/* Finish the definition of the current subprogram and compile it all the way
to assembler language output. */
-extern void end_subprog_body PARAMS ((void));
+extern void end_subprog_body (void);
/* Build a template of type TEMPLATE_TYPE from the array bounds of ARRAY_TYPE.
EXPR is an expression that we can use to locate any PLACEHOLDER_EXPRs.
Return a constructor for the template. */
-extern tree build_template PARAMS ((tree, tree, tree));
+extern tree build_template (tree, tree, tree);
/* Build a VMS descriptor from a Mechanism_Type, which must specify
a descriptor type, and the GCC type of an object. Each FIELD_DECL
@@ -604,8 +597,7 @@ extern tree build_template PARAMS ((tree, tree, tree));
to print out an error message if the mechanism cannot be applied to
an object of that type and also for the name. */
-extern tree build_vms_descriptor PARAMS ((tree, Mechanism_Type,
- Entity_Id));
+extern tree build_vms_descriptor (tree, Mechanism_Type, Entity_Id);
/* Build a type to be used to represent an aliased object whose nominal
type is an unconstrained array. This consists of a RECORD_TYPE containing
@@ -613,32 +605,32 @@ extern tree build_vms_descriptor PARAMS ((tree, Mechanism_Type,
ARRAY_TYPE. If ARRAY_TYPE is that of the unconstrained array, this
is used to represent an arbitrary unconstrained object. Use NAME
as the name of the record. */
-extern tree build_unc_object_type PARAMS ((tree, tree, tree));
+extern tree build_unc_object_type (tree, tree, tree);
/* Update anything previously pointing to OLD_TYPE to point to NEW_TYPE. In
the normal case this is just two adjustments, but we have more to do
if NEW is an UNCONSTRAINED_ARRAY_TYPE. */
-extern void update_pointer_to PARAMS ((tree, tree));
+extern void update_pointer_to (tree, tree);
/* EXP is an expression for the size of an object. If this size contains
discriminant references, replace them with the maximum (if MAX_P) or
minimum (if ! MAX_P) possible value of the discriminant. */
-extern tree max_size PARAMS ((tree, int));
+extern tree max_size (tree, int);
/* Remove all conversions that are done in EXP. This includes converting
from a padded type or to a left-justified modular type. If TRUE_ADDRESS
is nonzero, always return the address of the containing object even if
the address is not bit-aligned. */
-extern tree remove_conversions PARAMS ((tree, int));
+extern tree remove_conversions (tree, int);
/* If EXP's type is an UNCONSTRAINED_ARRAY_TYPE, return an expression that
refers to the underlying array. If its type has TYPE_CONTAINS_TEMPLATE_P,
likewise return an expression pointing to the underlying array. */
-extern tree maybe_unconstrained_array PARAMS ((tree));
+extern tree maybe_unconstrained_array (tree);
/* Return an expression that does an unchecked converstion of EXPR to TYPE.
If NOTRUNC_P is set, truncation operations should be suppressed. */
-extern tree unchecked_convert PARAMS ((tree, tree, int));
+extern tree unchecked_convert (tree, tree, int);
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
operation.
@@ -652,55 +644,55 @@ extern tree unchecked_convert PARAMS ((tree, tree, int));
The resulting type should always be the same as the input type.
This function is simpler than the corresponding C version since
the only possible operands will be things of Boolean type. */
-extern tree gnat_truthvalue_conversion PARAMS((tree));
+extern tree gnat_truthvalue_conversion (tree);
/* Return the base type of TYPE. */
-extern tree get_base_type PARAMS((tree));
+extern tree get_base_type (tree);
/* Likewise, but only return types known at Ada source. */
-extern tree get_ada_base_type PARAMS((tree));
+extern tree get_ada_base_type (tree);
/* EXP is a GCC tree representing an address. See if we can find how
strictly the object at that address is aligned. Return that alignment
strictly the object at that address is aligned. Return that alignment
in bits. If we don't know anything about the alignment, return 0. */
-extern unsigned int known_alignment PARAMS((tree));
+extern unsigned int known_alignment (tree);
/* Make a binary operation of kind OP_CODE. RESULT_TYPE is the type
desired for the result. Usually the operation is to be performed
in that type. For MODIFY_EXPR and ARRAY_REF, RESULT_TYPE may be 0
in which case the type to be used will be derived from the operands. */
-extern tree build_binary_op PARAMS((enum tree_code, tree, tree, tree));
+extern tree build_binary_op (enum tree_code, tree, tree, tree);
/* Similar, but make unary operation. */
-extern tree build_unary_op PARAMS((enum tree_code, tree, tree));
+extern tree build_unary_op (enum tree_code, tree, tree);
/* Similar, but for COND_EXPR. */
-extern tree build_cond_expr PARAMS((tree, tree, tree, tree));
+extern tree build_cond_expr (tree, tree, tree, tree);
/* Build a CALL_EXPR to call FUNDECL with one argument, ARG. Return
the CALL_EXPR. */
-extern tree build_call_1_expr PARAMS((tree, tree));
+extern tree build_call_1_expr (tree, tree);
/* Build a CALL_EXPR to call FUNDECL with two argument, ARG1 & ARG2. Return
the CALL_EXPR. */
-extern tree build_call_2_expr PARAMS((tree, tree, tree));
+extern tree build_call_2_expr (tree, tree, tree);
/* Likewise to call FUNDECL with no arguments. */
-extern tree build_call_0_expr PARAMS((tree));
+extern tree build_call_0_expr (tree);
/* Call a function that raises an exception and pass the line number and file
name, if requested. MSG says which exception function to call. */
-extern tree build_call_raise PARAMS((int));
+extern tree build_call_raise (int);
/* Return a CONSTRUCTOR of TYPE whose list is LIST. This is not the
same as build_constructor in the language-independent tree.c. */
-extern tree gnat_build_constructor PARAMS((tree, tree));
+extern tree gnat_build_constructor (tree, tree);
/* Return a COMPONENT_REF to access a field that is given by COMPONENT,
an IDENTIFIER_NODE giving the name of the field, FIELD, a FIELD_DECL,
- for the field, or both. */
-extern tree build_component_ref PARAMS((tree, tree, tree));
+ for the field, or both. Don't fold the result if NO_FOLD_P. */
+extern tree build_component_ref (tree, tree, tree, int);
/* Build a GCC tree to call an allocation or deallocation function.
If GNU_OBJ is nonzero, it is an object to deallocate. Otherwise,
@@ -709,8 +701,8 @@ extern tree build_component_ref PARAMS((tree, tree, tree));
GNU_SIZE is the size of the object and ALIGN is the alignment.
GNAT_PROC, if present is a procedure to call and GNAT_POOL is the
storage pool to use. If not preset, malloc and free will be used. */
-extern tree build_call_alloc_dealloc PARAMS((tree, tree, int, Entity_Id,
- Entity_Id, Node_Id));
+extern tree build_call_alloc_dealloc (tree, tree, int, Entity_Id,
+ Entity_Id, Node_Id);
/* Build a GCC tree to correspond to allocating an object of TYPE whose
initial value if INIT, if INIT is nonzero. Convert the expression to
@@ -718,37 +710,55 @@ extern tree build_call_alloc_dealloc PARAMS((tree, tree, int, Entity_Id,
GNAT_PROC and GNAT_POOL optionally give the procedure to call and
the storage pool to use. GNAT_NODE is used to provide an error
location for restriction violations messages. */
-extern tree build_allocator PARAMS((tree, tree, tree, Entity_Id,
- Entity_Id, Node_Id));
+extern tree build_allocator (tree, tree, tree, Entity_Id, Entity_Id, Node_Id);
/* Fill in a VMS descriptor for EXPR and return a constructor for it.
GNAT_FORMAL is how we find the descriptor record. */
-extern tree fill_vms_descriptor PARAMS((tree, Entity_Id));
+extern tree fill_vms_descriptor (tree, Entity_Id);
/* Indicate that we need to make the address of EXPR_NODE and it therefore
should not be allocated in a register. Return true if successful. */
-extern bool gnat_mark_addressable PARAMS((tree));
+extern bool gnat_mark_addressable (tree);
+
+/* This function is called by the front end to enumerate all the supported
+ modes for the machine. We pass a function which is called back with
+ the following integer parameters:
+
+ FLOAT_P nonzero if this represents a floating-point mode
+ COMPLEX_P nonzero is this represents a complex mode
+ COUNT count of number of items, nonzero for vector mode
+ PRECISION number of bits in data representation
+ MANTISSA number of bits in mantissa, if FP and known, else zero.
+ SIZE number of bits used to store data
+ ALIGN number of bits to which mode is aligned. */
+extern void enumerate_modes (void (*f) (int, int, int, int, int, int,
+ unsigned int));
+
+/* These are temporary function to deal with recent GCC changes related to
+ FP type sizes and precisions. */
+extern int fp_prec_to_size (int);
+extern int fp_size_to_prec (int);
/* These functions return the basic data type sizes and related parameters
about the target machine. */
-extern Pos get_target_bits_per_unit PARAMS ((void));
-extern Pos get_target_bits_per_word PARAMS ((void));
-extern Pos get_target_char_size PARAMS ((void));
-extern Pos get_target_wchar_t_size PARAMS ((void));
-extern Pos get_target_short_size PARAMS ((void));
-extern Pos get_target_int_size PARAMS ((void));
-extern Pos get_target_long_size PARAMS ((void));
-extern Pos get_target_long_long_size PARAMS ((void));
-extern Pos get_target_float_size PARAMS ((void));
-extern Pos get_target_double_size PARAMS ((void));
-extern Pos get_target_long_double_size PARAMS ((void));
-extern Pos get_target_pointer_size PARAMS ((void));
-extern Pos get_target_maximum_alignment PARAMS ((void));
-extern Boolean get_target_no_dollar_in_label PARAMS ((void));
-extern Nat get_float_words_be PARAMS ((void));
-extern Nat get_words_be PARAMS ((void));
-extern Nat get_bytes_be PARAMS ((void));
-extern Nat get_bits_be PARAMS ((void));
-extern Nat get_strict_alignment PARAMS ((void));
+extern Pos get_target_bits_per_unit (void);
+extern Pos get_target_bits_per_word (void);
+extern Pos get_target_char_size (void);
+extern Pos get_target_wchar_t_size (void);
+extern Pos get_target_short_size (void);
+extern Pos get_target_int_size (void);
+extern Pos get_target_long_size (void);
+extern Pos get_target_long_long_size (void);
+extern Pos get_target_float_size (void);
+extern Pos get_target_double_size (void);
+extern Pos get_target_long_double_size (void);
+extern Pos get_target_pointer_size (void);
+extern Pos get_target_maximum_alignment (void);
+extern Boolean get_target_no_dollar_in_label (void);
+extern Nat get_float_words_be (void);
+extern Nat get_words_be (void);
+extern Nat get_bytes_be (void);
+extern Nat get_bits_be (void);
+extern Nat get_strict_alignment (void);
diff --git a/gcc/ada/gmem.c b/gcc/ada/gmem.c
index c21fa47c8ff..002f78f77be 100644
--- a/gcc/ada/gmem.c
+++ b/gcc/ada/gmem.c
@@ -75,7 +75,7 @@ convert_addresses (char *addrs[], int n_addr, void *buf, int *len);
*/
static void
-gmem_read_backtrace ()
+gmem_read_backtrace (void)
{
fread (&cur_tb_len, sizeof (int), 1, gmemfile);
fread (tracebk, sizeof (char *), cur_tb_len, gmemfile);
@@ -120,8 +120,7 @@ void __gnat_gmem_a2l_initialize (char *exename)
write an alloc/free information in buf to be processed by gnatmem */
void
-__gnat_gmem_read_next (buf)
- struct struct_storage_elmt *buf;
+__gnat_gmem_read_next (struct struct_storage_elmt *buf)
{
void *addr;
size_t size;
diff --git a/gcc/ada/gnat1drv.adb b/gcc/ada/gnat1drv.adb
index dcae02ee0b7..6f9b8a0f2c6 100644
--- a/gcc/ada/gnat1drv.adb
+++ b/gcc/ada/gnat1drv.adb
@@ -54,6 +54,7 @@ with Sem;
with Sem_Ch8;
with Sem_Ch12;
with Sem_Ch13;
+with Sem_Elim;
with Sem_Eval;
with Sem_Type;
with Sinfo; use Sinfo;
@@ -118,6 +119,7 @@ begin
Sem_Ch8.Initialize;
Sem_Ch12.Initialize;
Sem_Ch13.Initialize;
+ Sem_Elim.Initialize;
Sem_Eval.Initialize;
Sem_Type.Init_Interp_Tables;
diff --git a/gcc/ada/gnat_ug.texi b/gcc/ada/gnat_ug.texi
index f631ca6e5c9..946da534211 100644
--- a/gcc/ada/gnat_ug.texi
+++ b/gcc/ada/gnat_ug.texi
@@ -79,7 +79,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 1995-2002, Free Software Foundation
+Copyright @copyright{} 1995-2003, Free Software Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
diff --git a/gcc/ada/gnat_ug_unx.texi b/gcc/ada/gnat_ug_unx.texi
index e0924e4750f..484f5a75b19 100644
--- a/gcc/ada/gnat_ug_unx.texi
+++ b/gcc/ada/gnat_ug_unx.texi
@@ -65,7 +65,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 1995-2002, Free Software Foundation
+Copyright @copyright{} 1995-2003, Free Software Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
diff --git a/gcc/ada/gnat_ug_vms.texi b/gcc/ada/gnat_ug_vms.texi
index e717a20fa1e..89bc0e17b49 100644
--- a/gcc/ada/gnat_ug_vms.texi
+++ b/gcc/ada/gnat_ug_vms.texi
@@ -65,7 +65,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 1995-2002, Free Software Foundation
+Copyright @copyright{} 1995-2003, Free Software Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
diff --git a/gcc/ada/gnat_ug_vxw.texi b/gcc/ada/gnat_ug_vxw.texi
index 50d7c9dd9ba..8fb949d1c6e 100644
--- a/gcc/ada/gnat_ug_vxw.texi
+++ b/gcc/ada/gnat_ug_vxw.texi
@@ -65,7 +65,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 1995-2002, Free Software Foundation
+Copyright @copyright{} 1995-2003, Free Software Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
diff --git a/gcc/ada/gnat_ug_wnt.texi b/gcc/ada/gnat_ug_wnt.texi
index 24390ffb555..1d799b2792f 100644
--- a/gcc/ada/gnat_ug_wnt.texi
+++ b/gcc/ada/gnat_ug_wnt.texi
@@ -65,7 +65,7 @@
@c %**end of header
@copying
-Copyright @copyright{} 1995-2002, Free Software Foundation
+Copyright @copyright{} 1995-2003, Free Software Foundation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.2
diff --git a/gcc/ada/gnat_wrapper.adb b/gcc/ada/gnat_wrapper.adb
deleted file mode 100644
index 189cdc46ea1..00000000000
--- a/gcc/ada/gnat_wrapper.adb
+++ /dev/null
@@ -1,121 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- G N A T _ W R A P P E R --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- GNAT_Wrapper is to be used as the starter program for most of the GNAT
--- executables. It sets up the working environment variables and calls the
--- real executable which is to be found under the 'real' sub-directory.
---
--- This avoids using the registry on Windows which is tricky to setup to run
--- multiple compilers (GNAT Pro release and wavefronts for example) at the
--- same time.
-
-with Ada.Command_Line; use Ada.Command_Line;
-with GNAT.OS_Lib; use GNAT.OS_Lib;
-
-procedure GNAT_Wrapper is
- DS : Character renames Directory_Separator;
- PS : Character renames Path_Separator;
-
- procedure Split_Command;
- -- Parse Actual_Name and set K and L variables (see below).
-
- Actual_Name : String_Access := new String'(Command_Name);
-
- K : Natural;
- -- Index of the directory separator just before program name's first
- -- character.
-
- L : Natural;
- -- Index of the last character of the GNATPRO install directory.
-
- LD_LIBRARY_PATH : String_Access := Getenv ("LD_LIBRARY_PATH");
- PATH : String_Access := Getenv ("PATH");
-
- -------------------
- -- Split_Command --
- -------------------
-
- procedure Split_Command is
- begin
- K := Actual_Name'Last;
- loop
- exit when K = 0
- or else Actual_Name (K) = '\' or else Actual_Name (K) = '/';
- K := K - 1;
- end loop;
- end Split_Command;
-
-begin
- Split_Command;
-
- if K = 0 then
- -- No path information found, locate the program on the path.
- declare
- Old : String_Access := Actual_Name;
- begin
- Actual_Name := Locate_Exec_On_Path (Actual_Name.all);
- Free (Old);
-
- Split_Command;
- end;
- end if;
-
- -- Skip 'bin' from directory above. GNAT binaries are always under
- -- <gnatpro>/bin directory.
-
- L := K - 4;
-
- declare
- Prog : constant String := Actual_Name (K + 1 .. Actual_Name'Last);
- Dir : constant String := Actual_Name (Actual_Name'First .. L - 1);
- Real : constant String := Dir & DS & ".bin";
- Bin : constant String := Dir & DS & "bin";
- Args : Argument_List (1 .. Argument_Count);
- Result : Integer;
-
- begin
- Setenv ("GCC_ROOT", Dir);
- Setenv ("GNAT_ROOT", Dir);
- Setenv ("BINUTILS_ROOT", Dir);
- Setenv ("LD_LIBRARY_PATH", Dir & DS & "lib" & PS & LD_LIBRARY_PATH.all);
- Setenv ("PATH", Real & PS & Bin & PS & PATH.all);
-
- -- Call the right executable under "<dir>/.bin"
-
- for K in 1 .. Argument_Count loop
- Args (K) := new String'(Argument (K));
- end loop;
-
- Normalize_Arguments (Args);
- Result := Spawn (Real & DS & Prog, Args);
-
- for K in 1 .. Argument_Count loop
- Free (Args (K));
- end loop;
-
- OS_Exit (Result);
- end;
-end GNAT_Wrapper;
diff --git a/gcc/ada/gnatbind.adb b/gcc/ada/gnatbind.adb
index 45dda7404f2..d2378630825 100644
--- a/gcc/ada/gnatbind.adb
+++ b/gcc/ada/gnatbind.adb
@@ -471,7 +471,7 @@ begin
-- Add System.Standard_Library to list to ensure that these files are
-- included in the bind, even if not directly referenced from Ada code
- -- This is suppressed if the configurable run-time requests it.
+ -- This is suppressed if the appropriate targparm switch is set.
if not Suppress_Standard_Library_On_Target then
Name_Buffer (1 .. 12) := "s-stalib.ali";
diff --git a/gcc/ada/gnatbl.c b/gcc/ada/gnatbl.c
index 72f85169fd8..82284286676 100644
--- a/gcc/ada/gnatbl.c
+++ b/gcc/ada/gnatbl.c
@@ -6,7 +6,7 @@
* *
* C Implementation File *
* *
- * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -72,12 +72,11 @@ char *gcc_B_arg = 0;
static int linkonly = 0;
-static void addarg PARAMS ((char *));
-static void process_args PARAMS ((int *, char *[]));
+static void addarg (char *);
+static void process_args (int *, char *[]);
static void
-addarg (str)
- char *str;
+addarg (char *str)
{
int i;
@@ -100,9 +99,7 @@ addarg (str)
}
static void
-process_args (p_argc, argv)
- int *p_argc;
- char *argv[];
+process_args (int *p_argc, char *argv[])
{
int i, j;
@@ -199,12 +196,10 @@ process_args (p_argc, argv)
}
}
}
-extern int main PARAMS ((int, char **));
+extern int main (int, char **);
int
-main (argc, argv)
- int argc;
- char **argv;
+main (int argc, char **argv)
{
int i, j;
int done_an_ali = 0;
@@ -294,7 +289,7 @@ main (argc, argv)
{
if (done_an_ali)
{
- fprintf (stderr,
+ fprintf (stderr,
"Sorry - cannot handle more than one ALI file\n");
exit (1);
}
@@ -328,7 +323,7 @@ main (argc, argv)
exit (retcode);
}
}
- else
+ else
addarg (argv[i]);
}
#ifdef MSDOS
diff --git a/gcc/ada/gnatchop.adb b/gcc/ada/gnatchop.adb
index 3e771e5a05d..7384cd353a3 100644
--- a/gcc/ada/gnatchop.adb
+++ b/gcc/ada/gnatchop.adb
@@ -37,11 +37,6 @@ with Hostparm;
procedure Gnatchop is
- Cwrite : constant String :=
- "GNATCHOP " &
- Gnatvsn.Gnat_Version_String &
- " Copyright 1998-2000, Ada Core Technologies Inc.";
-
Terminate_Program : exception;
-- Used to terminate execution immediately
@@ -57,9 +52,13 @@ procedure Gnatchop is
Gnat_Cmd : String_Access;
-- Command to execute the GNAT compiler
- Gnat_Args : Argument_List_Access := new Argument_List'
- (new String'("-c"), new String'("-x"), new String'("ada"),
- new String'("-gnats"), new String'("-gnatu"));
+ Gnat_Args : Argument_List_Access :=
+ new Argument_List'
+ (new String'("-c"),
+ new String'("-x"),
+ new String'("ada"),
+ new String'("-gnats"),
+ new String'("-gnatu"));
-- Arguments used in Gnat_Cmd call
EOF : constant Character := Character'Val (26);
@@ -207,7 +206,7 @@ procedure Gnatchop is
-- Local subprograms --
-----------------------
- procedure Error_Msg (Message : String);
+ procedure Error_Msg (Message : String; Warning : Boolean := False);
-- Produce an error message on standard error output
procedure File_Time_Stamp (Name : C_File_Name; Time : OS_Time);
@@ -337,13 +336,16 @@ procedure Gnatchop is
-- Error_Msg --
---------------
- procedure Error_Msg (Message : String) is
+ procedure Error_Msg (Message : String; Warning : Boolean := False) is
begin
Put_Line (Standard_Error, Message);
- Set_Exit_Status (Failure);
- if Exit_On_Error then
- raise Terminate_Program;
+ if not Warning then
+ Set_Exit_Status (Failure);
+
+ if Exit_On_Error then
+ raise Terminate_Program;
+ end if;
end if;
end Error_Msg;
@@ -1107,6 +1109,7 @@ procedure Gnatchop is
else
Error_Msg ("-k# requires numeric parameter");
end if;
+
return False;
end if;
end loop;
@@ -1126,23 +1129,31 @@ procedure Gnatchop is
end;
when 'p' =>
- Preserve_Mode := True;
+ Preserve_Mode := True;
when 'q' =>
- Quiet_Mode := True;
+ Quiet_Mode := True;
when 'r' =>
Source_References := True;
when 'v' =>
- Verbose_Mode := True;
- Put_Line (Standard_Error, Cwrite);
+ Verbose_Mode := True;
+
+ -- Why is following written to standard error. Most other
+ -- tools write to standard output ???
+
+ Put (Standard_Error, "GNATCHOP ");
+ Put (Standard_Error, Gnatvsn.Gnat_Version_String);
+ Put_Line
+ (Standard_Error,
+ " Copyright 1998-2000, Ada Core Technologies Inc.");
when 'w' =>
- Overwrite_Files := True;
+ Overwrite_Files := True;
when 'x' =>
- Exit_On_Error := True;
+ Exit_On_Error := True;
when others =>
null;
@@ -1687,7 +1698,7 @@ begin
if Unit.Last = 0 then
if not Write_gnat_adc then
- Error_Msg ("no compilation units found");
+ Error_Msg ("no compilation units found", Warning => True);
end if;
goto No_Files_Written;
@@ -1727,7 +1738,7 @@ begin
declare
Warnings_Msg : String := Warning_Count'Img & " warning(s)";
begin
- Error_Msg (Warnings_Msg (2 .. Warnings_Msg'Last));
+ Error_Msg (Warnings_Msg (2 .. Warnings_Msg'Last), Warning => True);
end;
end if;
@@ -1739,7 +1750,7 @@ begin
-- been written.
if not Write_gnat_adc then
- Error_Msg ("no source files written");
+ Error_Msg ("no source files written", Warning => True);
end if;
return;
diff --git a/gcc/ada/gnatlbr.adb b/gcc/ada/gnatlbr.adb
index dd200508169..917f06416da 100644
--- a/gcc/ada/gnatlbr.adb
+++ b/gcc/ada/gnatlbr.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -47,11 +47,10 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
with Gnatvsn; use Gnatvsn;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with Osint; use Osint;
-with Sdefault; use Sdefault;
with System;
procedure GnatLbr is
- pragma Ident (Gnat_Version_String);
+ pragma Ident (Gnat_Static_Version_String);
type Lib_Mode is (None, Create, Set, Delete);
Next_Arg : Integer;
@@ -192,7 +191,7 @@ begin
-- there are two.
--
Include_Dirs := 0;
- Include_Dir_Name := String_Access (Include_Dir_Default_Name);
+ Include_Dir_Name := new String'(Include_Dir_Default_Prefix);
Get_Next_Dir_In_Path_Init (String_Access (Include_Dir_Name));
loop
@@ -208,7 +207,7 @@ begin
end loop;
Object_Dirs := 0;
- Object_Dir_Name := String_Access (Object_Dir_Default_Name);
+ Object_Dir_Name := new String'(Object_Dir_Default_Prefix);
Get_Next_Dir_In_Path_Init (String_Access (Object_Dir_Name));
loop
@@ -255,7 +254,8 @@ begin
& F_ADC_File (1 .. F_ADC_File_Len));
Make_Args (6) :=
- new String'("LIBRARY_VERSION=" & '"' & Library_Version & '"');
+ new String'("LIBRARY_VERSION=" & '"' &
+ Verbose_Library_Version & '"');
Make_Args (7) :=
new String'("-f");
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index 123cff59800..5d198c03144 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -42,6 +42,7 @@ with Types;
with Ada.Command_Line; use Ada.Command_Line;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with Interfaces.C_Streams; use Interfaces.C_Streams;
+with System.CRTL;
procedure Gnatlink is
pragma Ident (Gnatvsn.Gnat_Static_Version_String);
@@ -619,6 +620,10 @@ procedure Gnatlink is
GNAT_Shared : Boolean := False;
-- Save state of -shared option.
+ Xlinker_Was_Previous : Boolean := False;
+ -- Indicate that "-Xlinker" was the option preceding the current
+ -- option. If True, then the current option is never suppressed.
+
-- Rollback data
-- These data items are used to store current binder file context.
@@ -766,6 +771,7 @@ procedure Gnatlink is
------------------------
procedure Store_File_Context is
+ use type System.CRTL.long;
begin
RB_Next_Line := Next_Line;
RB_Nfirst := Nfirst;
@@ -936,8 +942,17 @@ procedure Gnatlink is
-- Process switches and options
if Next_Line (Nfirst .. Nlast) /= End_Info then
+ Xlinker_Was_Previous := False;
+
loop
- if Next_Line (Nfirst .. Nlast) = "-static" then
+ if Xlinker_Was_Previous
+ or else Next_Line (Nfirst .. Nlast) = "-Xlinker"
+ then
+ Linker_Options.Increment_Last;
+ Linker_Options.Table (Linker_Options.Last) :=
+ new String'(Next_Line (Nfirst .. Nlast));
+
+ elsif Next_Line (Nfirst .. Nlast) = "-static" then
GNAT_Static := True;
elsif Next_Line (Nfirst .. Nlast) = "-shared" then
@@ -946,9 +961,7 @@ procedure Gnatlink is
-- Add binder options only if not already set on the command
-- line. This rule is a way to control the linker options order.
- elsif not Is_Option_Present (Next_Line (Nfirst .. Nlast))
- or else Next_Line (Nfirst .. Nlast) = "-Xlinker"
- then
+ elsif not Is_Option_Present (Next_Line (Nfirst .. Nlast)) then
if Nlast > Nfirst + 2 and then
Next_Line (Nfirst .. Nfirst + 1) = "-L"
then
@@ -1125,6 +1138,8 @@ procedure Gnatlink is
end if;
end if;
+ Xlinker_Was_Previous := Next_Line (Nfirst .. Nlast) = "-Xlinker";
+
Get_Next_Line;
exit when Next_Line (Nfirst .. Nlast) = End_Info;
diff --git a/gcc/ada/gnatmem.adb b/gcc/ada/gnatmem.adb
index a852b26f8bc..8deca2e1873 100644
--- a/gcc/ada/gnatmem.adb
+++ b/gcc/ada/gnatmem.adb
@@ -228,7 +228,7 @@ procedure Gnatmem is
procedure Usage is
begin
New_Line;
- Put ("GNATMEM Pro ");
+ Put ("GNATMEM ");
Put (Gnat_Version_String);
Put_Line (" Copyright 1997-2003 Free Software Foundation, Inc.");
New_Line;
diff --git a/gcc/ada/gnatpsta.adb b/gcc/ada/gnatpsta.adb
deleted file mode 100644
index 502445d355f..00000000000
--- a/gcc/ada/gnatpsta.adb
+++ /dev/null
@@ -1,373 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT SYSTEM UTILITIES --
--- --
--- G N A T P S T A --
--- --
--- B o d y --
--- --
--- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
--- Program to print out listing of Standard package for the target (not
--- the host) with all constants appearing explicitly. This is not really
--- valid Ada, since one cannot really define new base types, but it is a
--- helpful listing from a documentation point of view.
-
--- Note that special care has been taken to use the host parameters for
--- integer and floating point sizes.
-
-with Ada.Text_IO; use Ada.Text_IO;
-with Gnatvsn;
-with Ttypef; use Ttypef;
-with Ttypes; use Ttypes;
-with Types; use Types;
-
-procedure GnatPsta is
- pragma Ident (Gnatvsn.Gnat_Static_Version_String);
-
- procedure P (Item : String) renames Ada.Text_IO.Put_Line;
-
- procedure P_Int_Range (Size : Pos; Put_First : Boolean := True);
- -- Prints the range of an integer based on its Size. If Put_First is
- -- False, then skip the first bound.
-
- procedure P_Float_Range (Nb_Digits : Pos);
- -- Prints the maximum range of a Float whose 'Digits is given by Nb_Digits
-
- -------------------
- -- P_Float_Range --
- -------------------
-
- procedure P_Float_Range (Nb_Digits : Pos) is
- begin
- -- This routine assumes only IEEE floats.
- -- ??? Should the following be adapted for OpenVMS ?
-
- case Nb_Digits is
- when IEEES_Digits =>
- P (" range " & IEEES_First'Universal_Literal_String & " .. " &
- IEEES_Last'Universal_Literal_String & ";");
- when IEEEL_Digits =>
- P (" range " & IEEEL_First'Universal_Literal_String & " .. " &
- IEEEL_Last'Universal_Literal_String & ";");
- when IEEEX_Digits =>
- P (" range " & IEEEX_First'Universal_Literal_String & " .. " &
- IEEEX_Last'Universal_Literal_String & ";");
-
- when others =>
- P (";");
- end case;
-
- -- If one of the floating point types of the host computer has the
- -- same digits as the target float we are processing, then print out
- -- the float range using the host computer float type.
-
- if Nb_Digits = Short_Float'Digits then
- P (" -- " &
- Short_Float'First'Img & " .. " & Short_Float'Last'Img);
-
- elsif Nb_Digits = Float'Digits then
- P (" -- " &
- Float'First'Img & " .. " & Float'Last'Img);
-
- elsif Nb_Digits = Long_Float'Digits then
- P (" -- " &
- Long_Float'First'Img & " .. " & Long_Float'Last'Img);
-
- elsif Nb_Digits = Long_Long_Float'Digits then
- P (" -- " &
- Long_Long_Float'First'Img & " .. " & Long_Long_Float'Last'Img);
- end if;
-
- New_Line;
- end P_Float_Range;
-
- -----------------
- -- P_Int_Range --
- -----------------
-
- procedure P_Int_Range (Size : Pos; Put_First : Boolean := True) is
- begin
- if Put_First then
- Put (" is range -(2 **" & Pos'Image (Size - 1) & ")");
- end if;
- P (" .. +(2 **" & Pos'Image (Size - 1) & " - 1);");
- end P_Int_Range;
-
--- Start of processing for GnatPsta
-
-begin
- P ("package Standard is");
- P ("pragma Pure(Standard);");
- New_Line;
-
- P (" type Boolean is (False, True);");
- New_Line;
-
- -- Integer types
-
- Put (" type Integer");
- P_Int_Range (Standard_Integer_Size);
- New_Line;
-
- Put (" subtype Natural is Integer range 0");
- P_Int_Range (Standard_Integer_Size, Put_First => False);
-
- Put (" subtype Positive is Integer range 1");
- P_Int_Range (Standard_Integer_Size, Put_First => False);
- New_Line;
-
- Put (" type Short_Short_Integer");
- P_Int_Range (Standard_Short_Short_Integer_Size);
-
- Put (" type Short_Integer ");
- P_Int_Range (Standard_Short_Integer_Size);
-
- Put (" type Long_Integer ");
- P_Int_Range (Standard_Long_Integer_Size);
-
- Put (" type Long_Long_Integer ");
- P_Int_Range (Standard_Long_Long_Integer_Size);
- New_Line;
-
- -- Floating point types
-
- P (" type Short_Float is digits"
- & Standard_Short_Float_Digits'Img);
- P_Float_Range (Standard_Short_Float_Digits);
-
- P (" type Float is digits"
- & Standard_Float_Digits'Img);
- P_Float_Range (Standard_Float_Digits);
-
- P (" type Long_Float is digits"
- & Standard_Long_Float_Digits'Img);
- P_Float_Range (Standard_Long_Float_Digits);
-
- P (" type Long_Long_Float is digits"
- & Standard_Long_Long_Float_Digits'Img);
- P_Float_Range (Standard_Long_Long_Float_Digits);
-
- P (" -- function ""*"" (Left : root_integer; Right : root_real)");
- P (" -- return root_real;");
- New_Line;
-
- P (" -- function ""*"" (Left : root_real; Right : root_integer)");
- P (" -- return root_real;");
- New_Line;
-
- P (" -- function ""/"" (Left : root_real; Right : root_integer)");
- P (" -- return root_real;");
- New_Line;
-
- P (" -- function ""*"" (Left : universal_fixed; " &
- "Right : universal_fixed)");
- P (" -- return universal_fixed;");
- New_Line;
-
- P (" -- function ""/"" (Left : universal_fixed; " &
- "Right : universal_fixed)");
- P (" -- return universal_fixed;");
- New_Line;
-
- P (" -- The declaration of type Character is based on the standard");
- P (" -- ISO 8859-1 character set.");
- New_Line;
-
- P (" -- There are no character literals corresponding to the positions");
- P (" -- for control characters. They are indicated by lower case");
- P (" -- identifiers in the following list.");
- New_Line;
-
- P (" -- Note: this type cannot be represented accurately in Ada");
- New_Line;
-
- P (" -- type Character is");
- New_Line;
-
- P (" -- (nul, soh, stx, etx, eot, enq, ack, bel,");
- P (" -- bs, ht, lf, vt, ff, cr, so, si,");
- New_Line;
-
- P (" -- dle, dc1, dc2, dc3, dc4, nak, syn, etb,");
- P (" -- can, em, sub, esc, fs, gs, rs, us,");
- New_Line;
-
- P (" -- ' ', '!', '""', '#', '$', '%', '&', ''',");
- P (" -- '(', ')', '*', '+', ',', '-', '.', '/',");
- New_Line;
-
- P (" -- '0', '1', '2', '3', '4', '5', '6', '7',");
- P (" -- '8', '9', ':', ';', '<', '=', '>', '?',");
- New_Line;
-
- P (" -- '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G',");
- P (" -- 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O',");
- New_Line;
-
- P (" -- 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',");
- P (" -- 'X', 'Y', 'Z', '[', '\', ']', '^', '_',");
- New_Line;
-
- P (" -- '`', 'a', 'b', 'c', 'd', 'e', 'f', 'g',");
- P (" -- 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',");
- New_Line;
-
- P (" -- 'p', 'q', 'r', 's', 't', 'u', 'v', 'w',");
- P (" -- 'x', 'y', 'z', '{', '|', '}', '~', del,");
- New_Line;
-
- P (" -- reserved_128, reserved_129, bph, nbh,");
- P (" -- reserved_132, nel, ssa, esa,");
- New_Line;
-
- P (" -- hts, htj, vts, pld, plu, ri, ss2, ss3,");
- New_Line;
-
- P (" -- dcs, pu1, pu2, sts, cch, mw, spa, epa,");
- New_Line;
-
- P (" -- sos, reserved_153, sci, csi,");
- P (" -- st, osc, pm, apc,");
- New_Line;
-
- P (" -- ... );");
- New_Line;
-
- P (" -- The declaration of type Wide_Character is based " &
- "on the standard");
- P (" -- ISO 10646 BMP character set.");
- New_Line;
-
- P (" -- Note: this type cannot be represented accurately in Ada");
- New_Line;
-
- P (" -- The first 256 positions have the same contents as " &
- "type Character");
- New_Line;
-
- P (" -- type Wide_Character is (nul, soh ... FFFE, FFFF);");
- New_Line;
-
- P (" package ASCII is");
- New_Line;
-
- P (" -- Control characters:");
- New_Line;
-
- P (" NUL : constant Character := Character'Val (16#00#);");
- P (" SOH : constant Character := Character'Val (16#01#);");
- P (" STX : constant Character := Character'Val (16#02#);");
- P (" ETX : constant Character := Character'Val (16#03#);");
- P (" EOT : constant Character := Character'Val (16#04#);");
- P (" ENQ : constant Character := Character'Val (16#05#);");
- P (" ACK : constant Character := Character'Val (16#06#);");
- P (" BEL : constant Character := Character'Val (16#07#);");
- P (" BS : constant Character := Character'Val (16#08#);");
- P (" HT : constant Character := Character'Val (16#09#);");
- P (" LF : constant Character := Character'Val (16#0A#);");
- P (" VT : constant Character := Character'Val (16#0B#);");
- P (" FF : constant Character := Character'Val (16#0C#);");
- P (" CR : constant Character := Character'Val (16#0D#);");
- P (" SO : constant Character := Character'Val (16#0E#);");
- P (" SI : constant Character := Character'Val (16#0F#);");
- P (" DLE : constant Character := Character'Val (16#10#);");
- P (" DC1 : constant Character := Character'Val (16#11#);");
- P (" DC2 : constant Character := Character'Val (16#12#);");
- P (" DC3 : constant Character := Character'Val (16#13#);");
- P (" DC4 : constant Character := Character'Val (16#14#);");
- P (" NAK : constant Character := Character'Val (16#15#);");
- P (" SYN : constant Character := Character'Val (16#16#);");
- P (" ETB : constant Character := Character'Val (16#17#);");
- P (" CAN : constant Character := Character'Val (16#18#);");
- P (" EM : constant Character := Character'Val (16#19#);");
- P (" SUB : constant Character := Character'Val (16#1A#);");
- P (" ESC : constant Character := Character'Val (16#1B#);");
- P (" FS : constant Character := Character'Val (16#1C#);");
- P (" GS : constant Character := Character'Val (16#1D#);");
- P (" RS : constant Character := Character'Val (16#1E#);");
- P (" US : constant Character := Character'Val (16#1F#);");
- P (" DEL : constant Character := Character'Val (16#7F#);");
- New_Line;
-
- P (" -- Other characters:");
- New_Line;
-
- P (" Exclam : constant Character := '!';");
- P (" Quotation : constant Character := '""';");
- P (" Sharp : constant Character := '#';");
- P (" Dollar : constant Character := '$';");
- P (" Percent : constant Character := '%';");
- P (" Ampersand : constant Character := '&';");
- P (" Colon : constant Character := ':';");
- P (" Semicolon : constant Character := ';';");
- P (" Query : constant Character := '?';");
- P (" At_Sign : constant Character := '@';");
- P (" L_Bracket : constant Character := '[';");
- P (" Back_Slash : constant Character := '\';");
- P (" R_Bracket : constant Character := ']';");
- P (" Circumflex : constant Character := '^';");
- P (" Underline : constant Character := '_';");
- P (" Grave : constant Character := '`';");
- P (" L_Brace : constant Character := '{';");
- P (" Bar : constant Character := '|';");
- P (" R_Brace : constant Character := '}';");
- P (" Tilde : constant Character := '~';");
- New_Line;
-
- P (" -- Lower case letters:");
- New_Line;
-
- for C in Character range 'a' .. 'z' loop
- P (" LC_" & Character'Val (Character'Pos (C) - 32) &
- " : constant Character := '" & C & "';");
- end loop;
- New_Line;
-
- P (" end ASCII;");
- New_Line;
-
- P (" type String is array (Positive range <>) of Character;");
- P (" pragma Pack (String);");
- New_Line;
-
- P (" type Wide_String is array (Positive range <>) of Wide_Character;");
- P (" pragma Pack (Wide_String);");
- New_Line;
-
- -- Here it's OK to use the Duration type of the host compiler since
- -- the implementation of Duration in GNAT is target independent.
-
- P (" type Duration is delta" &
- Duration'Image (Duration'Delta));
- P (" range -((2 **" & Natural'Image (Duration'Size - 1) &
- " - 1) *" & Duration'Image (Duration'Delta) & ") ..");
- P (" +((2 **" & Natural'Image (Duration'Size - 1) &
- " - 1) *" & Duration'Image (Duration'Delta) & ");");
- P (" for Duration'Small use" & Duration'Image (Duration'Small) & ";");
- New_Line;
-
- P (" Constraint_Error : exception;");
- P (" Program_Error : exception;");
- P (" Storage_Error : exception;");
- P (" Tasking_Error : exception;");
- New_Line;
-
- P ("end Standard;");
-end GnatPsta;
diff --git a/gcc/ada/gnatsym.adb b/gcc/ada/gnatsym.adb
index b5523f87da1..a15cb6df732 100644
--- a/gcc/ada/gnatsym.adb
+++ b/gcc/ada/gnatsym.adb
@@ -37,7 +37,9 @@
-- only on OpenVMS.
-- gnatsym takes as parameters:
--- - the name of the symbol file to create or update
+-- - the name of the symbol file to create
+-- - (optional) the policy to create the symbol file
+-- - (optional) the name of the reference symbol file
-- - the names of one or more object files where the symbols are found
with GNAT.Command_Line; use GNAT.Command_Line;
@@ -52,13 +54,16 @@ with Table;
procedure Gnatsym is
+ Empty_String : aliased String := "";
+ Empty : constant String_Access := Empty_String'Unchecked_Access;
+ -- To initialize variables Reference and Version_String
+
Copyright_Displayed : Boolean := False;
-- A flag to prevent multiple display of the Copyright notice
Success : Boolean := True;
- Force : Boolean := False;
- -- True when -f switcxh is used
+ Symbol_Policy : Policy := Autonomous;
Verbose : Boolean := False;
-- True when -v switch is used
@@ -66,9 +71,15 @@ procedure Gnatsym is
Quiet : Boolean := False;
-- True when -q switch is used
- Symbol_File_Name : String_Access;
+ Symbol_File_Name : String_Access := null;
-- The name of the symbol file
+ Reference_Symbol_File_Name : String_Access := Empty;
+ -- The name of the reference symbol file
+
+ Version_String : String_Access := Empty;
+ -- The version of the library. Used on VMS.
+
package Object_Files is new Table.Table
(Table_Component_Type => String_Access,
Table_Index_Type => Natural,
@@ -113,19 +124,32 @@ procedure Gnatsym is
procedure Parse_Cmd_Line is
begin
loop
- case GNAT.Command_Line.Getopt ("f q v") is
+ case GNAT.Command_Line.Getopt ("c C q r: s: v V:") is
when ASCII.NUL =>
exit;
- when 'f' =>
- Force := True;
+ when 'c' =>
+ Symbol_Policy := Compliant;
+
+ when 'C' =>
+ Symbol_Policy := Controlled;
when 'q' =>
Quiet := True;
+ when 'r' =>
+ Reference_Symbol_File_Name :=
+ new String'(GNAT.Command_Line.Parameter);
+
+ when 's' =>
+ Symbol_File_Name := new String'(GNAT.Command_Line.Parameter);
+
when 'v' =>
Verbose := True;
+ when 'V' =>
+ Version_String := new String'(GNAT.Command_Line.Parameter);
+
when others =>
Fail ("invalid switch: ", Full_Switch);
end case;
@@ -141,13 +165,8 @@ procedure Gnatsym is
begin
exit when S'Length = 0;
- if Symbol_File_Name = null then
- Symbol_File_Name := S;
-
- else
- Object_Files.Increment_Last;
- Object_Files.Table (Object_Files.Last) := S;
- end if;
+ Object_Files.Increment_Last;
+ Object_Files.Table (Object_Files.Last) := S;
end;
end loop;
exception
@@ -162,11 +181,17 @@ procedure Gnatsym is
procedure Usage is
begin
- Write_Line ("gnatsym [options] sym_file object_file {object_file}");
+ Write_Line ("gnatsym [options] object_file {object_file}");
Write_Eol;
- Write_Line (" -f Force generation of symbol file");
- Write_Line (" -q Quiet mode");
- Write_Line (" -v Verbose mode");
+ Write_Line (" -c Compliant policy");
+ Write_Line (" -C Controlled policy");
+ Write_Line (" -q Quiet mode");
+ Write_Line (" -r<ref> Reference symbol file name");
+ Write_Line (" -s<sym> Symbol file name");
+ Write_Line (" -v Verbose mode");
+ Write_Line (" -V<ver> Version");
+ Write_Eol;
+ Write_Line ("Specifying a symbol file with -s<sym> is compulsory");
Write_Eol;
end Usage;
@@ -188,7 +213,7 @@ begin
-- If there is no symbol file or no object files on the command line,
-- display the usage and exit with an error status.
- if Object_Files.Last = 0 then
+ if Symbol_File_Name = null or else Object_Files.Last = 0 then
Usage;
OS_Exit (1);
@@ -199,9 +224,16 @@ begin
Write_Line ("""");
end if;
- -- Initialize the symbol file
+ -- Initialize the symbol file and, if specified, read the reference
+ -- file.
- Symbols.Initialize (Symbol_File_Name.all, Force, Quiet, Success);
+ Symbols.Initialize
+ (Symbol_File => Symbol_File_Name.all,
+ Reference => Reference_Symbol_File_Name.all,
+ Symbol_Policy => Symbol_Policy,
+ Quiet => Quiet,
+ Version => Version_String.all,
+ Success => Success);
-- Process the object files in order. Stop as soon as there is
-- something wrong.
@@ -232,6 +264,8 @@ begin
Finalize (Quiet, Success);
end if;
+ -- Fail if there was anything wrong
+
if not Success then
Fail ("unable to build symbol file");
end if;
diff --git a/gcc/ada/gnatvsn.adb b/gcc/ada/gnatvsn.adb
index cbeadd5d3f6..b15c6faf582 100644
--- a/gcc/ada/gnatvsn.adb
+++ b/gcc/ada/gnatvsn.adb
@@ -41,6 +41,15 @@ package body Gnatvsn is
pragma Import (C, Version_String, "version_string");
-------------------------
+ -- Get_Gnat_Build_Type --
+ -------------------------
+
+ function Get_Gnat_Build_Type return Gnat_Build_Type is
+ begin
+ return FSF;
+ end Get_Gnat_Build_Type;
+
+ -------------------------
-- Gnat_Version_String --
-------------------------
diff --git a/gcc/ada/gnatvsn.ads b/gcc/ada/gnatvsn.ads
index f665e5339ee..3b2c5e84285 100644
--- a/gcc/ada/gnatvsn.ads
+++ b/gcc/ada/gnatvsn.ads
@@ -45,12 +45,24 @@ package Gnatvsn is
-- Static string identifying this version, that can be used as an argument
-- to e.g. pragma Ident.
- Gnat_Version_Type : constant String := "FSF ";
- -- GNAT FSF version. This version of GNAT is part of a Free Software
- -- Foundation release of the GNU Compiler Collection (GCC). The binder
- -- will not output informational messages regarding intended use,
- -- and the bug box generated by Comperr will give information on
- -- how to report bugs and list the "no warranty" information.
+ type Gnat_Build_Type is (FSF, Public);
+ -- See Get_Gnat_Build_Type below for the meaning of these values.
+
+ function Get_Gnat_Build_Type return Gnat_Build_Type;
+ -- This function returns one of the following values of Gnat_Build_Type:
+ --
+ -- FSF
+ -- GNAT FSF version. This version of GNAT is part of a Free Software
+ -- Foundation release of the GNU Compiler Collection (GCC). The binder
+ -- will not output informational messages regarding intended use,
+ -- and the bug box generated by Comperr will give information on
+ -- how to report bugs and list the "no warranty" information.
+ --
+ -- Public
+ -- GNAT Public version.
+ -- The binder will output informational messages, and the bug box
+ -- generated by the package Comperr will give appropriate bug
+ -- submission instructions.
Ver_Len_Max : constant := 32;
-- Longest possible length for Gnat_Version_String in this or any
@@ -59,7 +71,7 @@ package Gnatvsn is
-- value should never be decreased in the future, but it would be
-- OK to increase it if absolutely necessary.
- Library_Version : constant String := "GNAT Lib v3.4";
+ Library_Version : constant String := "3.4";
-- Library version. This value must be updated whenever any change to the
-- compiler affects the library formats in such a way as to obsolete
-- previously compiled library modules.
@@ -67,6 +79,9 @@ package Gnatvsn is
-- Note: Makefile.in relies on the precise format of the library version
-- string in order to correctly construct the soname value.
+ Verbose_Library_Version : constant String := "GNAT Lib v" & Library_Version;
+ -- Version string stored in e.g. ALI files.
+
ASIS_Version_Number : constant := 2;
-- ASIS Version. This is used to check for consistency between the compiler
-- used to generate trees, and an ASIS application that is reading the
diff --git a/gcc/ada/gnatxref.adb b/gcc/ada/gnatxref.adb
index 7e429585b93..a7b22d6a3c8 100644
--- a/gcc/ada/gnatxref.adb
+++ b/gcc/ada/gnatxref.adb
@@ -24,10 +24,10 @@
-- --
------------------------------------------------------------------------------
-with Xr_Tabls; use Xr_Tabls;
-with Xref_Lib; use Xref_Lib;
-with Osint; use Osint;
-with Types; use Types;
+with Xr_Tabls; use Xr_Tabls;
+with Xref_Lib; use Xref_Lib;
+with Osint; use Osint;
+with Types; use Types;
with Gnatvsn;
with Opt;
@@ -35,10 +35,9 @@ with Opt;
with Ada.Strings.Fixed; use Ada.Strings.Fixed;
with Ada.Text_IO; use Ada.Text_IO;
with GNAT.Command_Line; use GNAT.Command_Line;
-with GNAT.Strings; use GNAT.Strings;
+with GNAT.Strings; use GNAT.Strings;
procedure Gnatxref is
-
Search_Unused : Boolean := False;
Local_Symbols : Boolean := True;
Prj_File : File_Name_String;
@@ -209,8 +208,6 @@ procedure Gnatxref is
-----------------
procedure Write_Usage is
- use Ada.Text_IO;
-
begin
Put_Line ("GNATXREF " & Gnatvsn.Gnat_Version_String
& " Copyright 1998-2003, Ada Core Technologies Inc.");
diff --git a/gcc/ada/gprcmd.adb b/gcc/ada/gprcmd.adb
index 3d5766df703..5718e120d55 100644
--- a/gcc/ada/gprcmd.adb
+++ b/gcc/ada/gprcmd.adb
@@ -37,6 +37,11 @@
-- extend handle recursive directories ("/**" notation)
-- deps post process dependency makefiles
-- stamp copy file time stamp from file1 to file2
+-- prefix get the prefix of the GNAT installation
+
+with Gnatvsn;
+with Osint; use Osint;
+with Namet; use Namet;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
@@ -44,15 +49,12 @@ with Ada.Text_IO; use Ada.Text_IO;
with GNAT.OS_Lib; use GNAT.OS_Lib;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.Regpat; use GNAT.Regpat;
-with Gnatvsn;
+
procedure Gprcmd is
-- ??? comments are thin throughout this unit
- Version : constant String :=
- "GPRCMD " & Gnatvsn.Gnat_Version_String &
- " Copyright 2002-2003, Ada Core Technologies Inc.";
procedure Cat (File : String);
-- Print the contents of file on standard output.
@@ -347,7 +349,13 @@ begin
begin
if Cmd = "-v" then
- Put_Line (Standard_Error, Version);
+
+ -- Should this be on Standard_Error ???
+
+ Put (Standard_Error, "GPRCMD ");
+ Put (Standard_Error, Gnatvsn.Gnat_Version_String);
+ Put_Line (Standard_Error,
+ " Copyright 2002-2003, Free Software Fundation, Inc.");
Usage;
elsif Cmd = "pwd" then
@@ -418,6 +426,40 @@ begin
elsif Cmd = "stamp" then
Check_Args (Argument_Count = 3);
Copy_Time_Stamp (Argument (2), Argument (3));
+
+ elsif Cmd = "prefix" then
+
+ -- Find the GNAT prefix. gprcmd is found in <prefix>/bin.
+ -- So we find the full path of gprcmd, verify that it is in a
+ -- subdirectory "bin", and return the <prefix> if it is the case.
+ -- Otherwise, nothing is returned.
+
+ Find_Program_Name;
+
+ declare
+ Path : String_Access :=
+ Locate_Exec_On_Path (Name_Buffer (1 .. Name_Len));
+ Index : Natural;
+
+ begin
+ if Path /= null then
+ Index := Path'Last;
+
+ while Index >= Path'First + 4 loop
+ exit when Path (Index) = Directory_Separator;
+ Index := Index - 1;
+ end loop;
+
+ if Index > Path'First + 5
+ and then Path (Index - 3 .. Index - 1) = "bin"
+ and then Path (Index - 4) = Directory_Separator
+ then
+ -- We have found the <prefix>, return it.
+
+ Put (Path (Path'First .. Index - 5));
+ end if;
+ end if;
+ end;
end if;
end;
end Gprcmd;
diff --git a/gcc/ada/i-cstrea.adb b/gcc/ada/i-cstrea.adb
index 9d322d42906..2c85bc937ed 100644
--- a/gcc/ada/i-cstrea.adb
+++ b/gcc/ada/i-cstrea.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1996-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1996-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -39,6 +39,8 @@ with Unchecked_Conversion;
package body Interfaces.C_Streams is
+ use type System.CRTL.size_t;
+
------------
-- fread --
------------
diff --git a/gcc/ada/i-cstrea.ads b/gcc/ada/i-cstrea.ads
index 4650cdbde83..39f8af90a74 100644
--- a/gcc/ada/i-cstrea.ads
+++ b/gcc/ada/i-cstrea.ads
@@ -34,38 +34,17 @@
-- This package is a thin binding to selected functions in the C
-- library that provide a complete interface for handling C streams.
-with System.Parameters;
+with System.CRTL;
package Interfaces.C_Streams is
pragma Preelaborate;
- -- Note: the reason we do not use the types that are in Interfaces.C is
- -- that we want to avoid dragging in the code in this unit if possible.
-
- subtype chars is System.Address;
- -- Pointer to null-terminated array of characters
-
- subtype FILEs is System.Address;
- -- Corresponds to the C type FILE*
-
+ subtype chars is System.CRTL.chars;
+ subtype FILEs is System.CRTL.FILEs;
+ subtype int is System.CRTL.int;
+ subtype long is System.CRTL.long;
+ subtype size_t is System.CRTL.size_t;
subtype voids is System.Address;
- -- Corresponds to the C type void*
-
- subtype int is Integer;
- -- Note: the above type is a subtype deliberately, and it is part of
- -- this spec that the above correspondence is guaranteed. This means
- -- that it is legitimate to, for example, use Integer instead of int.
- -- We provide this synonym for clarity, but in some cases it may be
- -- convenient to use the underlying types (for example to avoid an
- -- unnecessary dependency of a spec on the spec of this unit).
-
- type long is range -(2 ** (System.Parameters.long_bits - 1))
- .. +(2 ** (System.Parameters.long_bits - 1)) - 1;
- -- Note: the above type also used to be a subtype, but the correspondence
- -- was unused so it was made into a parameterized type to avoid having
- -- multiple versions of this spec for systems where long /= Long_Integer.
-
- type size_t is mod 2 ** Standard'Address_Size;
NULL_Stream : constant FILEs;
-- Value returned (NULL in C) to indicate an fdopen/fopen/tmpfile error
@@ -106,34 +85,39 @@ package Interfaces.C_Streams is
-- Library Reference" (Microsoft Press, 1990, ISBN 1-55615-225-6),
-- which includes useful information on system compatibility.
- procedure clearerr (stream : FILEs);
+ procedure clearerr (stream : FILEs) renames System.CRTL.clearerr;
- function fclose (stream : FILEs) return int;
+ function fclose (stream : FILEs) return int renames System.CRTL.fclose;
- function fdopen (handle : int; mode : chars) return FILEs;
+ function fdopen (handle : int; mode : chars) return FILEs
+ renames System.CRTL.fdopen;
function feof (stream : FILEs) return int;
function ferror (stream : FILEs) return int;
- function fflush (stream : FILEs) return int;
+ function fflush (stream : FILEs) return int renames System.CRTL.fflush;
- function fgetc (stream : FILEs) return int;
+ function fgetc (stream : FILEs) return int renames System.CRTL.fgetc;
- function fgets (strng : chars; n : int; stream : FILEs) return chars;
+ function fgets (strng : chars; n : int; stream : FILEs) return chars
+ renames System.CRTL.fgets;
function fileno (stream : FILEs) return int;
- function fopen (filename : chars; Mode : chars) return FILEs;
+ function fopen (filename : chars; Mode : chars) return FILEs
+ renames System.CRTL.fopen;
-- Note: to maintain target independence, use text_translation_required,
-- a boolean variable defined in a-sysdep.c to deal with the target
-- dependent text translation requirement. If this variable is set,
-- then b/t should be appended to the standard mode argument to set
-- the text translation mode off or on as required.
- function fputc (C : int; stream : FILEs) return int;
+ function fputc (C : int; stream : FILEs) return int
+ renames System.CRTL.fputc;
- function fputs (Strng : chars; Stream : FILEs) return int;
+ function fputs (Strng : chars; Stream : FILEs) return int
+ renames System.CRTL.fputs;
function fread
(buffer : voids;
@@ -159,15 +143,16 @@ package Interfaces.C_Streams is
(filename : chars;
mode : chars;
stream : FILEs)
- return FILEs;
+ return FILEs renames System.CRTL.freopen;
function fseek
(stream : FILEs;
offset : long;
origin : int)
- return int;
+ return int renames System.CRTL.fseek;
- function ftell (stream : FILEs) return long;
+ function ftell (stream : FILEs) return long
+ renames System.CRTL.ftell;
function fwrite
(buffer : voids;
@@ -176,12 +161,12 @@ package Interfaces.C_Streams is
stream : FILEs)
return size_t;
- function isatty (handle : int) return int;
+ function isatty (handle : int) return int renames System.CRTL.isatty;
- procedure mktemp (template : chars);
+ procedure mktemp (template : chars) renames System.CRTL.mktemp;
-- The return value (which is just a pointer to template) is discarded
- procedure rewind (stream : FILEs);
+ procedure rewind (stream : FILEs) renames System.CRTL.rewind;
function setvbuf
(stream : FILEs;
@@ -190,16 +175,18 @@ package Interfaces.C_Streams is
size : size_t)
return int;
- procedure tmpnam (string : chars);
+ procedure tmpnam (string : chars) renames System.CRTL.tmpnam;
-- The parameter must be a pointer to a string buffer of at least L_tmpnam
-- bytes (the call with a null parameter is not supported). The returned
-- value, which is just a copy of the input argument, is discarded.
- function tmpfile return FILEs;
+ function tmpfile return FILEs renames System.CRTL.tmpfile;
- function ungetc (c : int; stream : FILEs) return int;
+ function ungetc (c : int; stream : FILEs) return int
+ renames System.CRTL.ungetc;
- function unlink (filename : chars) return int;
+ function unlink (filename : chars) return int
+ renames System.CRTL.unlink;
---------------------
-- Extra functions --
@@ -253,29 +240,6 @@ private
pragma Inline (fwrite);
pragma Inline (setvbuf);
- -- The following routines are always functions in C, and thus can be
- -- imported directly into Ada without any intermediate C needed
-
- pragma Import (C, clearerr);
- pragma Import (C, fclose);
- pragma Import (C, fdopen);
- pragma Import (C, fflush);
- pragma Import (C, fgetc);
- pragma Import (C, fgets);
- pragma Import (C, fopen);
- pragma Import (C, fputc);
- pragma Import (C, fputs);
- pragma Import (C, freopen);
- pragma Import (C, fseek);
- pragma Import (C, ftell);
- pragma Import (C, isatty);
- pragma Import (C, mktemp);
- pragma Import (C, rewind);
- pragma Import (C, tmpnam);
- pragma Import (C, tmpfile);
- pragma Import (C, ungetc);
- pragma Import (C, unlink);
-
pragma Import (C, file_exists, "__gnat_file_exists");
pragma Import (C, is_regular_file, "__gnat_is_regular_file_fd");
diff --git a/gcc/ada/i-vthrea.adb b/gcc/ada/i-vthrea.adb
deleted file mode 100644
index 049e1c4bf68..00000000000
--- a/gcc/ada/i-vthrea.adb
+++ /dev/null
@@ -1,386 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
--- --
--- I N T E R F A C E S . V T H R E A D S --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2003, Free Software Foundation, Inc. --
--- --
--- GNARL is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see 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 other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNARL was developed by the GNARL team at Florida State University. --
--- Extensive contributions were provided by Ada Core Technologies, Inc. --
--- --
-------------------------------------------------------------------------------
-
--- Implement APEX process registration for AE653
-
-with Ada.Exceptions; use Ada.Exceptions;
-with Ada.Unchecked_Conversion;
-
-with Interfaces.C;
-
-with System.Secondary_Stack;
-with System.Soft_Links;
-with System.Task_Primitives.Ae_653;
-with System.Task_Primitives.Operations; use System.Task_Primitives.Operations;
-with System.Tasking; use System.Tasking;
-with System.Task_Info;
-with System.Tasking.Initialization;
-
-package body Interfaces.Vthreads is
-
- use System.OS_Interface;
-
- -----------------------
- -- Local Subprograms --
- -----------------------
-
- procedure Enter_Task (T : Task_ID; Thread : Thread_Id);
- -- Duplicate and generalize
- -- System.Task_Primitives.Operations.Enter_Task
-
- procedure GNAT_Error_Handler (Sig : Signal);
- -- Signal handler for ARINC processes
-
- procedure Init_Float;
- pragma Import (C, Init_Float, "__gnat_init_float");
- -- Properly initializes the FPU for PPC systems.
-
- procedure Install_Handler;
- -- Install signal handlers for the calling ARINC process
-
- function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID;
- -- Duplicate and generalize
- -- System.Task_Primitives.Operations.Register_Foreign_Thread
-
- -----------------------------
- -- Install_Signal_Handlers --
- -----------------------------
-
- function Install_Signal_Handlers return Interfaces.C.int is
- begin
- Install_Handler;
- Init_Float;
- return 0;
- end Install_Signal_Handlers;
-
- ----------------------
- -- Register_Foreign --
- ----------------------
-
- -- Create Ada task data structures for an ARINC process. All dynamic
- -- allocation of related data structures must be done via this routine.
-
- function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS is
- use Interfaces.C;
- use System.Task_Primitives.Ae_653;
-
- pragma Assert (taskVarGet (T, ATCB_Key_Addr) = ERROR);
- -- "T" is not yet registered
-
- Result : OSI.STATUS := taskIdVerify (T);
- Status : OSI.STATUS := OK;
- Temp_Id : Task_ID;
-
- begin
- if Result = OK then
- Status := taskVarGet (T, ATCB_Key_Addr);
-
- -- Error of already registered
-
- if Status /= ERROR then
- Result := ERROR;
-
- else
- -- Create a TCB
-
- declare
- -- Make sure the caller has a TCB, since it's possible to have
- -- pure C APEX processes that create ones calling Ada code
-
- Caller : Task_ID;
-
- begin
- Status := taskVarGet (taskIdSelf, ATCB_Key_Addr);
-
- if Status = ERROR then
- Caller := Register_Foreign_Thread (taskIdSelf);
- end if;
- end;
-
- if taskIdSelf /= T then
- Temp_Id := Register_Foreign_Thread (T);
- end if;
-
- Result := OK;
- end if;
- end if;
-
- return Result;
- end Register_Foreign;
-
- -------------------
- -- Reset_Foreign --
- -------------------
-
- -- Reinitialize Ada task data structures. No dynamic allocation
- -- may occur via this routine.
-
- function Reset_Foreign (T : Thread_Id) return STATUS is
- use Interfaces.C;
- use System.Secondary_Stack;
- use System.Task_Primitives.Ae_653;
- use type System.Address;
-
- pragma Assert (taskVarGet (T, ATCB_Key_Addr) /= ERROR);
- -- "T" has already been registered
-
- Result : STATUS := taskVarGet (T, ATCB_Key_Addr);
- function To_Address is new Ada.Unchecked_Conversion
- (Interfaces.C.int, System.Address);
-
- pragma Assert (
- To_Task_Id
- (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr
- /= System.Null_Address);
- -- "T" already has a secondary stack
-
- begin
- if Result /= ERROR then
-
- -- Just reset the secondary stack pointer. The implementation here
- -- assumes that the fixed secondary stack implementation is used.
- -- If not, there will be a memory leak (along with allocation, which
- -- is prohibited for ARINC processes once the system enters "normal"
- -- mode).
-
- SS_Init
- (To_Task_Id
- (To_Address (Result)).Common.Compiler_Data.Sec_Stack_Addr);
- Result := OK;
- end if;
-
- return Result;
- end Reset_Foreign;
-
- ------------------
- -- Setup_Thread --
- ------------------
-
- function Setup_Thread return System.Address is
- Result : System.Address := System.Null_Address;
- Status : OSI.STATUS;
-
- begin
- if Is_Valid_Task then
- Status := Reset_Foreign (taskIdSelf);
- Result :=
- To_Address (System.Task_Primitives.Operations.Self);
- else
- Status := Register_Foreign (taskIdSelf);
- Install_Handler;
- Init_Float;
- Result :=
- To_Address (System.Task_Primitives.Operations.Self);
- end if;
-
- return Result;
- end Setup_Thread;
-
- ----------------
- -- Enter_Task --
- ----------------
-
- procedure Enter_Task (T : Task_ID; Thread : Thread_Id) is
- use System.Task_Primitives.Ae_653;
-
- begin
- Set_Task_Thread (T, Thread);
- end Enter_Task;
-
- ------------------------
- -- GNAT_Error_Handler --
- ------------------------
-
- procedure GNAT_Error_Handler (Sig : Signal) is
- Mask : aliased sigset_t;
- Result : int;
-
- begin
- -- This code is the Ada replacement for init.c in the
- -- AE653 level B runtime.
-
- -- VxWorks will always mask out the signal during the signal
- -- handler and will reenable it on a longjmp. GNAT does not
- -- generate a longjmp to return from a signal handler so the
- -- signal will still be masked unless we unmask it.
-
- Result := pthread_sigmask (SIG_SETMASK, null, Mask'Unchecked_Access);
- Result := sigdelset (Mask'Access, Sig);
- Result := pthread_sigmask (SIG_SETMASK, Mask'Unchecked_Access, null);
-
- case Sig is
- when SIGFPE =>
- Raise_Exception (Constraint_Error'Identity, "SIGFPE");
- when SIGILL =>
- Raise_Exception (Constraint_Error'Identity, "SIGILL");
- when SIGSEGV =>
- Raise_Exception
- (Program_Error'Identity,
- "erroneous memory access");
- when SIGBUS =>
- -- SIGBUS indicates stack overflow when it occurs
- -- in an application domain (but not in the Core
- -- OS under AE653, or in the kernel domain under
- -- AE 1.1).
- Raise_Exception
- (Storage_Error'Identity,
- "stack overflow or SIGBUS");
- when others =>
- Raise_Exception (Program_Error'Identity, "unhandled signal");
- end case;
- end GNAT_Error_Handler;
-
- ---------------------
- -- Install_Handler --
- ---------------------
-
- procedure Install_Handler is
- Mask : aliased sigset_t;
- Signal_Action : aliased struct_sigaction;
- Result : Interfaces.C.int;
-
- begin
- -- Set up signal handler to map synchronous signals to appropriate
- -- exceptions. Make sure that the handler isn't interrupted by
- -- another signal that might cause a scheduling event!
-
- -- This code is the Ada replacement for init.c in the
- -- AE653 level B runtime.
- Signal_Action.sa_handler := GNAT_Error_Handler'Address;
- Signal_Action.sa_flags := SA_ONSTACK;
- Result := sigemptyset (Mask'Access);
- Signal_Action.sa_mask := Mask;
-
- Result := sigaction
- (Signal (SIGFPE), Signal_Action'Unchecked_Access, null);
-
- Result := sigaction
- (Signal (SIGILL), Signal_Action'Unchecked_Access, null);
-
- Result := sigaction
- (Signal (SIGSEGV), Signal_Action'Unchecked_Access, null);
-
- Result := sigaction
- (Signal (SIGBUS), Signal_Action'Unchecked_Access, null);
-
- end Install_Handler;
-
- -----------------------------
- -- Register_Foreign_Thread --
- -----------------------------
-
- Foreign_Task_Elaborated : aliased Boolean := True;
-
- function Register_Foreign_Thread (Thread : Thread_Id) return Task_ID is
- pragma Assert (Thread = taskIdSelf or else Is_Valid_Task);
- -- Ensure that allocation will work
-
- Local_ATCB : aliased Ada_Task_Control_Block (0);
- New_Id : Task_ID;
- Succeeded : Boolean;
-
- use type Interfaces.C.unsigned;
- use type System.Address;
- use System.Task_Info;
- use System.Task_Primitives.Ae_653;
-
- begin
- if taskIdSelf = Thread then
- declare
- Self : Task_ID := Local_ATCB'Unchecked_Access;
- -- Temporarily record this as the Task_ID for the thread
-
- begin
- Set_Current_Priority (Self, System.Priority'First);
- Set_Task_Thread (Self, Thread);
- end;
- end if;
-
- pragma Assert (Is_Valid_Task);
- -- It is now safe to use an allocator for the real TCB
-
- New_Id := new Ada_Task_Control_Block (0);
-
- -- Finish initialization
-
- System.Tasking.Initialize_ATCB
- (New_Id, null, System.Null_Address, Null_Task,
- Foreign_Task_Elaborated'Access,
- System.Priority'First,
- System.Task_Info.Unspecified_Task_Info, 0, New_Id,
- Succeeded);
- pragma Assert (Succeeded);
-
- New_Id.Master_of_Task := 0;
- New_Id.Master_Within := New_Id.Master_of_Task + 1;
-
- for L in New_Id.Entry_Calls'Range loop
- New_Id.Entry_Calls (L).Self := New_Id;
- New_Id.Entry_Calls (L).Level := L;
- end loop;
-
- New_Id.Common.State := Runnable;
- New_Id.Awake_Count := 1;
-
- -- Since this is not an ordinary Ada task, we will start out undeferred
-
- New_Id.Deferral_Level := 0;
-
- System.Soft_Links.Create_TSD (New_Id.Common.Compiler_Data);
-
- -- Allocate a fixed secondary stack
-
- pragma Assert
- (New_Id.Common.Compiler_Data.Sec_Stack_Addr = System.Null_Address);
- System.Secondary_Stack.SS_Init
- (New_Id.Common.Compiler_Data.Sec_Stack_Addr);
-
- Enter_Task (New_Id, Thread);
-
- return New_Id;
- end Register_Foreign_Thread;
-
- -- Force use of tasking versions of secondary stack routines:
-
- procedure Force_Closure renames
- System.Tasking.Initialization.Defer_Abortion;
- pragma Unreferenced (Force_Closure);
-
--- Package elaboration code
-
-begin
- -- Register the exported routines with the vThreads ARINC API
-
- procCreateHookAdd (Register_Foreign'Access);
- procStartHookAdd (Reset_Foreign'Access);
-end Interfaces.Vthreads;
diff --git a/gcc/ada/i-vthrea.ads b/gcc/ada/i-vthrea.ads
deleted file mode 100644
index d4a79757cfe..00000000000
--- a/gcc/ada/i-vthrea.ads
+++ /dev/null
@@ -1,93 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
--- --
--- I N T E R F A C E S . V T H R E A D S --
--- --
--- S p e c --
--- --
--- Copyright (C) 2002-2003, Free Software Foundation, Inc. --
--- --
--- GNARL is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see 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 other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNARL was developed by the GNARL team at Florida State University. --
--- Extensive contributions were provided by Ada Core Technologies, Inc. --
--- --
-------------------------------------------------------------------------------
-
--- Implement APEX process registration for AE653. The routines exported
--- by this package are only called from the APEX CREATE and START routines
--- in the AE653 vThreads API. A context clause for this unit must appear in
--- the Ada APEX binding.
---
--- If this package appears in a context clause for an application that will
--- be run in a non-AE653 version of VxWorks, or in a non-vThreads AE653
--- partition, link or load errors for the symbols procCreateHookAdd and
--- procStartHookAdd will occur, unless these routines are defined
--- in the application. This is used when simulating AE653 in AE 1.1.
-
-with System.OS_Interface;
-with Interfaces.C;
-
-package Interfaces.Vthreads is
-
- function Setup_Thread return System.Address;
- -- Register an existing vxWorks task. This routine is used
- -- under AE 1.1 when simulating AE 653.
-
- function Install_Signal_Handlers return Interfaces.C.int;
- pragma Export (C, Install_Signal_Handlers,
- "__gnat_install_signal_handlers");
- -- Map the synchronous signals SIGSEGV, SIGFPE, SIGILL and
- -- SIGBUS to Ada exceptions for the calling ARINC process.
- -- This routine should be called as early as possible in
- -- each ARINC process body.
- -- C declaration:
- -- extern int __gnat_install_signal_handlers ();
- -- This call is unnecessary on AE 1.1.
-
-private
- package OSI renames System.OS_Interface;
-
- function Register_Foreign (T : OSI.Thread_Id) return OSI.STATUS;
- -- Create runtime structures necessary for Ada language support for
- -- an ARINC process. Called from APEX CREATE routine.
-
- function Reset_Foreign (T : OSI.Thread_Id) return OSI.STATUS;
- -- Reset runtime structures upon an AE653 process restart. Called from
- -- APEX START routine.
-
- -- When defining the following routines for export in an AE 1.1
- -- simulation of AE653, Interfaces.C.int may be used for the
- -- parameters of FUNCPTR.
- type FUNCPTR is access function (T : OSI.Thread_Id) return OSI.STATUS;
-
- --------------------------------
- -- Imported vThreads Routines --
- --------------------------------
-
- procedure procCreateHookAdd (createHookFunction : FUNCPTR);
- pragma Import (C, procCreateHookAdd, "procCreateHookAdd");
- -- Registers task registration routine for AE653
-
- procedure procStartHookAdd (StartHookFunction : FUNCPTR);
- pragma Import (C, procStartHookAdd, "procStartHookAdd");
- -- Registers task restart routine for AE653
-
-end Interfaces.Vthreads;
diff --git a/gcc/ada/impunit.adb b/gcc/ada/impunit.adb
index fcc174b8a33..d2a8645fc19 100644
--- a/gcc/ada/impunit.adb
+++ b/gcc/ada/impunit.adb
@@ -229,6 +229,7 @@ package body Impunit is
"g-regist", -- GNAT.Registry
"g-regpat", -- GNAT.Regpat
"g-semaph", -- GNAT.Semaphores
+ "g-signal", -- GNAT.Signals
"g-socket", -- GNAT.Sockets
"g-souinf", -- GNAT.Source_Info
"g-speche", -- GNAT.Spell_Checker
diff --git a/gcc/ada/init.c b/gcc/ada/init.c
index c23819d7e08..734a482bdcc 100644
--- a/gcc/ada/init.c
+++ b/gcc/ada/init.c
@@ -71,28 +71,28 @@ extern struct Exception_Data tasking_error;
extern struct Exception_Data _abort_signal;
#define Lock_Task system__soft_links__lock_task
-extern void (*Lock_Task) PARAMS ((void));
+extern void (*Lock_Task) (void);
#define Unlock_Task system__soft_links__unlock_task
-extern void (*Unlock_Task) PARAMS ((void));
+extern void (*Unlock_Task) (void);
#define Get_Machine_State_Addr \
system__soft_links__get_machine_state_addr
-extern struct Machine_State *(*Get_Machine_State_Addr) PARAMS ((void));
+extern struct Machine_State *(*Get_Machine_State_Addr) (void);
#define Check_Abort_Status \
system__soft_links__check_abort_status
-extern int (*Check_Abort_Status) PARAMS ((void));
+extern int (*Check_Abort_Status) (void);
#define Raise_From_Signal_Handler \
ada__exceptions__raise_from_signal_handler
-extern void Raise_From_Signal_Handler PARAMS ((struct Exception_Data *,
- const char *));
+extern void Raise_From_Signal_Handler (struct Exception_Data *, const char *);
#define Propagate_Signal_Exception \
__gnat_propagate_sig_exc
-extern void Propagate_Signal_Exception
- PARAMS ((struct Machine_State *, struct Exception_Data *, const char *));
+extern void Propagate_Signal_Exception (struct Machine_State *,
+ struct Exception_Data *,
+ const char *);
/* Copies of global values computed by the binder */
int __gl_main_priority = -1;
@@ -134,8 +134,7 @@ char __gnat_get_interrupt_state (int);
's' Interrupt_State pragma set state to System */
char
-__gnat_get_interrupt_state (intrup)
- int intrup;
+__gnat_get_interrupt_state (int intrup)
{
if (intrup >= __gl_num_interrupt_states)
return 'n';
@@ -156,30 +155,18 @@ __gnat_get_interrupt_state (intrup)
boundaries like this are not handled correctly in all systems. */
void
-__gnat_set_globals (main_priority,
- time_slice_val,
- wc_encoding,
- locking_policy,
- queuing_policy,
- task_dispatching_policy,
- restrictions,
- interrupt_states,
- num_interrupt_states,
- unreserve_all_interrupts,
- exception_tracebacks,
- zero_cost_exceptions)
- int main_priority;
- int time_slice_val;
- char wc_encoding;
- char locking_policy;
- char queuing_policy;
- char task_dispatching_policy;
- char *restrictions;
- char *interrupt_states;
- int num_interrupt_states;
- int unreserve_all_interrupts;
- int exception_tracebacks;
- int zero_cost_exceptions;
+__gnat_set_globals (int main_priority,
+ int time_slice_val,
+ char wc_encoding,
+ char locking_policy,
+ char queuing_policy,
+ char task_dispatching_policy,
+ char *restrictions,
+ char *interrupt_states,
+ int num_interrupt_states,
+ int unreserve_all_interrupts,
+ int exception_tracebacks,
+ int zero_cost_exceptions)
{
static int already_called = 0;
@@ -288,22 +275,20 @@ __gnat_set_globals (main_priority,
#ifndef _AIXVERSION_430
-extern int nanosleep PARAMS ((struct timestruc_t *, struct timestruc_t *));
+extern int nanosleep (struct timestruc_t *, struct timestruc_t *);
int
-nanosleep (Rqtp, Rmtp)
- struct timestruc_t *Rqtp, *Rmtp;
+nanosleep (struct timestruc_t *Rqtp, struct timestruc_t *Rmtp)
{
return nsleep (Rqtp, Rmtp);
}
#endif /* _AIXVERSION_430 */
-static void __gnat_error_handler PARAMS ((int));
+static void __gnat_error_handler (int);
static void
-__gnat_error_handler (sig)
- int sig;
+__gnat_error_handler (int sig)
{
struct Exception_Data *exception;
const char *msg;
@@ -335,7 +320,7 @@ __gnat_error_handler (sig)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -363,7 +348,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -380,20 +365,16 @@ __gnat_initialize ()
#include <signal.h>
#include <sys/siginfo.h>
-static void __gnat_error_handler PARAMS ((int, siginfo_t *,
- struct sigcontext *));
-extern char *__gnat_get_code_loc PARAMS ((struct sigcontext *));
-extern void __gnat_enter_handler PARAMS ((struct sigcontext *, char *));
-extern size_t __gnat_machine_state_length PARAMS ((void));
+static void __gnat_error_handler (int, siginfo_t *, struct sigcontext *);
+extern char *__gnat_get_code_loc (struct sigcontext *);
+extern void __gnat_enter_handler (struct sigcontext *, char *);
+extern size_t __gnat_machine_state_length (void);
-extern long exc_lookup_gp PARAMS ((char *));
-extern void exc_resume PARAMS ((struct sigcontext *));
+extern long exc_lookup_gp (char *);
+extern void exc_resume (struct sigcontext *);
static void
-__gnat_error_handler (sig, sip, context)
- int sig;
- siginfo_t *sip;
- struct sigcontext *context;
+__gnat_error_handler (int sig, siginfo_t *sip, struct sigcontext *context)
{
struct Exception_Data *exception;
static int recurse = 0;
@@ -463,7 +444,7 @@ __gnat_error_handler (sig, sip, context)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -471,7 +452,7 @@ __gnat_install_handler ()
exceptions. Make sure that the handler isn't interrupted by another
signal that might cause a scheduling event! */
- act.sa_handler = (void (*) PARAMS ((int))) __gnat_error_handler;
+ act.sa_handler = (void (*) (int)) __gnat_error_handler;
act.sa_flags = SA_ONSTACK | SA_RESTART | SA_NODEFER | SA_SIGINFO;
sigemptyset (&act.sa_mask);
@@ -491,7 +472,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -500,16 +481,13 @@ __gnat_initialize ()
#define SC_GP 29
char *
-__gnat_get_code_loc (context)
- struct sigcontext *context;
+__gnat_get_code_loc (struct sigcontext *context)
{
return (char *) context->sc_pc;
}
void
-__gnat_enter_handler (context, pc)
- struct sigcontext *context;
- char *pc;
+__gnat_enter_handler ( struct sigcontext *context, char *pc)
{
context->sc_pc = (long) pc;
context->sc_regs[SC_GP] = exc_lookup_gp (pc);
@@ -517,7 +495,7 @@ __gnat_enter_handler (context, pc)
}
size_t
-__gnat_machine_state_length ()
+__gnat_machine_state_length (void)
{
return sizeof (struct sigcontext);
}
@@ -530,11 +508,10 @@ __gnat_machine_state_length ()
#include <signal.h>
-static void __gnat_error_handler PARAMS ((int));
+static void __gnat_error_handler (int);
static void
-__gnat_error_handler (sig)
- int sig;
+__gnat_error_handler (int sig)
{
struct Exception_Data *exception;
char *msg;
@@ -566,7 +543,7 @@ __gnat_error_handler (sig)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -609,7 +586,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -639,11 +616,10 @@ struct Machine_State
unsigned long edi;
};
-static void __gnat_error_handler PARAMS ((int));
+static void __gnat_error_handler (int);
static void
-__gnat_error_handler (sig)
- int sig;
+__gnat_error_handler (int sig)
{
struct Exception_Data *exception;
const char *msg;
@@ -731,7 +707,7 @@ __gnat_error_handler (sig)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -759,7 +735,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -770,13 +746,12 @@ __gnat_initialize ()
#elif defined (__MINGW32__)
#include <windows.h>
-static LONG WINAPI __gnat_error_handler PARAMS ((PEXCEPTION_POINTERS));
+static LONG WINAPI __gnat_error_handler (PEXCEPTION_POINTERS);
/* __gnat_initialize (mingw32). */
static LONG WINAPI
-__gnat_error_handler (info)
- PEXCEPTION_POINTERS info;
+__gnat_error_handler (PEXCEPTION_POINTERS info)
{
static int recurse;
struct Exception_Data *exception;
@@ -891,14 +866,14 @@ __gnat_error_handler (info)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
SetUnhandledExceptionFilter (__gnat_error_handler);
__gnat_handler_installed = 1;
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
/* Initialize floating-point coprocessor. This call is needed because
@@ -921,11 +896,10 @@ __gnat_initialize ()
#include <signal.h>
-static void __gnat_error_handler PARAMS ((int));
+static void __gnat_error_handler (int);
static void
-__gnat_error_handler (sig)
- int sig;
+__gnat_error_handler (int sig)
{
struct Exception_Data *exception;
char *msg;
@@ -956,7 +930,7 @@ __gnat_error_handler (sig)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -982,7 +956,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
__gnat_init_float ();
}
@@ -994,7 +968,7 @@ __gnat_initialize ()
#elif defined (__Lynx__)
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
__gnat_init_float ();
}
@@ -1004,7 +978,7 @@ __gnat_initialize ()
/*********************************/
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
__gnat_handler_installed = 1;
}
@@ -1016,7 +990,7 @@ __gnat_install_handler ()
#elif defined (__EMX__) /* OS/2 dependent initialization */
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -1025,7 +999,7 @@ __gnat_initialize ()
/*********************************/
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
__gnat_handler_installed = 1;
}
@@ -1052,13 +1026,10 @@ struct Machine_State
sigcontext_t context;
};
-static void __gnat_error_handler PARAMS ((int, int, sigcontext_t *));
+static void __gnat_error_handler (int, int, sigcontext_t *);
static void
-__gnat_error_handler (sig, code, sc)
- int sig;
- int code;
- sigcontext_t *sc;
+__gnat_error_handler (int sig, int code, sigcontext_t *sc)
{
struct Machine_State *mstate;
struct Exception_Data *exception;
@@ -1138,7 +1109,7 @@ __gnat_error_handler (sig, code, sc)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -1169,7 +1140,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -1182,12 +1153,10 @@ __gnat_initialize ()
#include <signal.h>
#include <siginfo.h>
-static void __gnat_error_handler PARAMS ((int, siginfo_t *));
+static void __gnat_error_handler (int, siginfo_t *);
static void
-__gnat_error_handler (sig, sip)
- int sig;
- siginfo_t *sip;
+__gnat_error_handler (int sig, siginfo_t *sip)
{
struct Exception_Data *exception;
static int recurse = 0;
@@ -1253,7 +1222,7 @@ __gnat_error_handler (sig, sip)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -1279,7 +1248,7 @@ __gnat_install_handler ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -1291,7 +1260,7 @@ __gnat_initialize ()
/* The prehandler actually gets control first on a condition. It swaps the
stack pointer and calls the handler (__gnat_error_handler). */
-extern long __gnat_error_prehandler ();
+extern long __gnat_error_prehandler (void);
extern char *__gnat_error_prehandler_stack; /* Alternate signal stack */
@@ -1329,12 +1298,10 @@ extern struct Exception_Data *Coded_Exception (int);
struct descriptor_s {unsigned short len, mbz; char *adr; };
-long __gnat_error_handler PARAMS ((int *, void *));
+long __gnat_error_handler (int *, void *);
long
-__gnat_error_handler (sigargs, mechargs)
- int *sigargs;
- void *mechargs;
+__gnat_error_handler (int *sigargs, void *mechargs)
{
struct Exception_Data *exception = 0;
char *msg = "";
@@ -1470,7 +1437,7 @@ __gnat_error_handler (sigargs, mechargs)
}
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
long prvhnd;
char *c;
@@ -1485,8 +1452,90 @@ __gnat_install_handler ()
}
void
-__gnat_initialize()
+__gnat_initialize(void)
+{
+}
+
+/*************************************************/
+/* __gnat_initialize (FreeBSD version) */
+/*************************************************/
+
+#elif defined (__FreeBSD__)
+
+#include <signal.h>
+#include <unistd.h>
+
+static void
+__gnat_error_handler (sig, code, sc)
+ int sig;
+ int code;
+ struct sigcontext *sc;
{
+ struct Exception_Data *exception;
+ char *msg;
+
+ switch (sig)
+ {
+ case SIGFPE:
+ exception = &constraint_error;
+ msg = "SIGFPE";
+ break;
+
+ case SIGILL:
+ exception = &constraint_error;
+ msg = "SIGILL";
+ break;
+
+ case SIGSEGV:
+ exception = &storage_error;
+ msg = "stack overflow or erroneous memory access";
+ break;
+
+ case SIGBUS:
+ exception = &constraint_error;
+ msg = "SIGBUS";
+ break;
+
+ default:
+ exception = &program_error;
+ msg = "unhandled signal";
+ }
+
+ Raise_From_Signal_Handler (exception, msg);
+}
+
+void
+__gnat_install_handler ()
+{
+ struct sigaction act;
+
+ /* Set up signal handler to map synchronous signals to appropriate
+ exceptions. Make sure that the handler isn't interrupted by another
+ signal that might cause a scheduling event! */
+
+ act.sa_handler = __gnat_error_handler;
+ act.sa_flags = SA_NODEFER | SA_RESTART;
+ (void) sigemptyset (&act.sa_mask);
+
+ (void) sigaction (SIGILL, &act, NULL);
+ (void) sigaction (SIGFPE, &act, NULL);
+ (void) sigaction (SIGSEGV, &act, NULL);
+ (void) sigaction (SIGBUS, &act, NULL);
+}
+
+void __gnat_init_float ();
+
+void
+__gnat_initialize ()
+{
+ __gnat_install_handler ();
+
+ /* XXX - Initialize floating-point coprocessor. This call is
+ needed because FreeBSD defaults to 64-bit precision instead
+ of 80-bit precision? We require the full precision for
+ proper operation, given that we have set Max_Digits etc
+ with this in mind */
+ __gnat_init_float ();
}
/***************************************/
@@ -1502,16 +1551,17 @@ __gnat_initialize()
extern int __gnat_inum_to_ivec (int);
static void __gnat_error_handler (int, int, struct sigcontext *);
+void __gnat_map_signal (int);
#ifndef __alpha_vxworks
/* getpid is used by s-parint.adb, but is not defined by VxWorks, except
on Alpha VxWorks */
-extern long getpid PARAMS ((void));
+extern long getpid (void);
long
-getpid ()
+getpid (void)
{
return taskIdSelf ();
}
@@ -1519,36 +1569,19 @@ getpid ()
/* This is needed by the GNAT run time to handle Vxworks interrupts */
int
-__gnat_inum_to_ivec (num)
- int num;
+__gnat_inum_to_ivec (int num)
{
return INUM_TO_IVEC (num);
}
-static void
-__gnat_error_handler (sig, code, sc)
- int sig;
- int code;
- struct sigcontext *sc;
+/* Exported to 5zintman.adb in order to handle different signal
+ to exception mappings in different VxWorks versions */
+void
+__gnat_map_signal (int sig)
{
struct Exception_Data *exception;
- sigset_t mask;
- int result;
char *msg;
- /* VxWorks will always mask out the signal during the signal handler and
- will reenable it on a longjmp. GNAT does not generate a longjmp to
- return from a signal handler so the signal will still be masked unless
- we unmask it. */
- sigprocmask (SIG_SETMASK, NULL, &mask);
- sigdelset (&mask, sig);
- sigprocmask (SIG_SETMASK, &mask, NULL);
-
- /* VxWorks will suspend the task when it gets a hardware exception. We
- take the liberty of resuming the task for the application. */
- if (taskIsSuspended (taskIdSelf ()) != 0)
- taskResume (taskIdSelf ());
-
switch (sig)
{
case SIGFPE:
@@ -1564,8 +1597,13 @@ __gnat_error_handler (sig, code, sc)
msg = "SIGSEGV";
break;
case SIGBUS:
+#ifdef VTHREADS
+ exception = &storage_error;
+ msg = "SIGBUS: possible stack overflow";
+#else
exception = &program_error;
msg = "SIGBUS";
+#endif
break;
default:
exception = &program_error;
@@ -1575,8 +1613,31 @@ __gnat_error_handler (sig, code, sc)
Raise_From_Signal_Handler (exception, msg);
}
+static void
+__gnat_error_handler (int sig, int code, struct sigcontext *sc)
+{
+ sigset_t mask;
+ int result;
+
+ /* VxWorks will always mask out the signal during the signal handler and
+ will reenable it on a longjmp. GNAT does not generate a longjmp to
+ return from a signal handler so the signal will still be masked unless
+ we unmask it. */
+ sigprocmask (SIG_SETMASK, NULL, &mask);
+ sigdelset (&mask, sig);
+ sigprocmask (SIG_SETMASK, &mask, NULL);
+
+ /* VxWorks will suspend the task when it gets a hardware exception. We
+ take the liberty of resuming the task for the application. */
+ if (taskIsSuspended (taskIdSelf ()) != 0)
+ taskResume (taskIdSelf ());
+
+ __gnat_map_signal (sig);
+
+}
+
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
struct sigaction act;
@@ -1601,7 +1662,7 @@ __gnat_install_handler ()
#define HAVE_GNAT_INIT_FLOAT
void
-__gnat_init_float ()
+__gnat_init_float (void)
{
/* Disable overflow/underflow exceptions on the PPC processor, this is needed
to get correct Ada semantic. */
@@ -1631,7 +1692,7 @@ __gnat_init_float ()
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
__gnat_init_float ();
@@ -1661,8 +1722,7 @@ __gnat_initialize ()
#include <unistd.h>
static void
-__gnat_error_handler (sig)
- int sig;
+__gnat_error_handler (int sig)
{
struct Exception_Data *exception;
const char *msg;
@@ -1694,7 +1754,7 @@ __gnat_error_handler (sig)
}
void
-__gnat_install_handler()
+__gnat_install_handler(void)
{
struct sigaction act;
@@ -1711,10 +1771,12 @@ __gnat_install_handler()
sigaction (SIGSEGV, &act, NULL);
if (__gnat_get_interrupt_state (SIGBUS) != 's')
sigaction (SIGBUS, &act, NULL);
+
+ __gnat_handler_installed = 1;
}
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
__gnat_install_handler ();
__gnat_init_float ();
@@ -1726,28 +1788,12 @@ __gnat_initialize ()
#elif defined(__rtems__)
-extern void __gnat_install_handler ();
-
-/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */
-
-void
-__gnat_initialize ()
-{
- __gnat_install_handler ();
-}
-
-/***************************************/
-/* __gnat_initialize (RTEMS version) */
-/***************************************/
-
-#elif defined(__rtems__)
-
-extern void __gnat_install_handler ();
+extern void __gnat_install_handler (void);
/* For RTEMS, each bsp will provide a custom __gnat_install_handler (). */
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
__gnat_install_handler ();
}
@@ -1762,7 +1808,7 @@ __gnat_initialize ()
/***************************************/
void
-__gnat_initialize ()
+__gnat_initialize (void)
{
}
@@ -1771,7 +1817,7 @@ __gnat_initialize ()
/********************************************/
void
-__gnat_install_handler ()
+__gnat_install_handler (void)
{
__gnat_handler_installed = 1;
}
@@ -1787,12 +1833,12 @@ __gnat_install_handler ()
WIN32 and could be used under OS/2 */
#if defined (_WIN32) || defined (__INTERIX) || defined (__EMX__) \
- || defined (__Lynx__) || defined(__NetBSD__)
+ || defined (__Lynx__) || defined(__NetBSD__) || defined(__FreeBSD__)
#define HAVE_GNAT_INIT_FLOAT
void
-__gnat_init_float ()
+__gnat_init_float (void)
{
#if defined (__i386__) || defined (i386)
@@ -1809,7 +1855,7 @@ __gnat_init_float ()
/* All targets without a specific __gnat_init_float will use an empty one */
void
-__gnat_init_float ()
+__gnat_init_float (void)
{
}
#endif
diff --git a/gcc/ada/itypes.adb b/gcc/ada/itypes.adb
index 12864b84be2..dd5f98a5132 100644
--- a/gcc/ada/itypes.adb
+++ b/gcc/ada/itypes.adb
@@ -26,6 +26,7 @@
with Atree; use Atree;
with Einfo; use Einfo;
+with Opt; use Opt;
with Sem; use Sem;
with Sem_Util; use Sem_Util;
with Sinfo; use Sinfo;
@@ -64,7 +65,9 @@ package body Itypes is
Set_Is_Itype (Typ);
Set_Associated_Node_For_Itype (Typ, Related_Nod);
- if In_Deleted_Code then
+ if In_Deleted_Code
+ and then not ASIS_Mode
+ then
Set_Is_Frozen (Typ);
end if;
diff --git a/gcc/ada/lang-specs.h b/gcc/ada/lang-specs.h
index 0ab33ff0201..b68e78d098b 100644
--- a/gcc/ada/lang-specs.h
+++ b/gcc/ada/lang-specs.h
@@ -35,6 +35,7 @@
%{!gnatc*:%{!gnatz*:%{!gnats*:%{!S:%{!c:\
%eone of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada}}}}}\
gnat1 %{I*} %{k8:-gnatk8} %{w:-gnatws} %1 %{!Q:-quiet} %{nostdinc*}\
+ %{nostdlib*}\
-dumpbase %{.adb:%b.adb}%{.ads:%b.ads}%{!.adb:%{!.ads:%b.ada}}\
%{g*} %{O*} %{W*} %{w} %{p} %{pg:-p} %{m*} %{a} %{f*} %{d*}\
%{!S:%{o*:%w%*-gnatO}} \
diff --git a/gcc/ada/lang.opt b/gcc/ada/lang.opt
index e38af20b2e8..7ac89f96426 100644
--- a/gcc/ada/lang.opt
+++ b/gcc/ada/lang.opt
@@ -45,7 +45,7 @@ Wwrite-strings
Ada
; Documented for C
-Wno-long-long
+Wlong-long
Ada
; Documented for C
@@ -53,6 +53,10 @@ nostdinc
Ada RejectNegative
; Don't look for source files
+nostdlib
+Ada
+; Don't look for object files
+
fRTS
Ada RejectNegative
diff --git a/gcc/ada/lib-load.adb b/gcc/ada/lib-load.adb
index 285e2512027..fbb50af0800 100644
--- a/gcc/ada/lib-load.adb
+++ b/gcc/ada/lib-load.adb
@@ -78,7 +78,6 @@ package body Lib.Load is
is
Unum : Unit_Number_Type;
Cunit_Entity : Entity_Id;
- Scope_Entity : Entity_Id;
Cunit : Node_Id;
Du_Name : Node_Or_Entity_Id;
End_Lab : Node_Id;
@@ -98,11 +97,12 @@ package body Lib.Load is
Du_Name := Cunit_Entity;
End_Lab := New_Occurrence_Of (Cunit_Entity, No_Location);
- Scope_Entity := Standard_Standard;
-
-- Child package
- else -- Nkind (Name (With_Node)) = N_Expanded_Name
+ else
+
+ -- Nkind (Name (With_Node)) = N_Expanded_Name
+
Cunit_Entity :=
Make_Defining_Identifier (No_Location,
Chars => Chars (Selector_Name (Name (With_Node))));
@@ -113,19 +113,14 @@ package body Lib.Load is
Set_Is_Child_Unit (Cunit_Entity);
- if Nkind (Du_Name) = N_Defining_Program_Unit_Name then
- Scope_Entity := Defining_Identifier (Du_Name);
- else
- Scope_Entity := Du_Name;
- end if;
-
End_Lab :=
Make_Designator (No_Location,
Name => New_Copy_Tree (Prefix (Name (With_Node))),
Identifier => New_Occurrence_Of (Cunit_Entity, No_Location));
+
end if;
- Set_Scope (Cunit_Entity, Scope_Entity);
+ Set_Scope (Cunit_Entity, Standard_Standard);
Cunit :=
Make_Compilation_Unit (No_Location,
@@ -524,8 +519,8 @@ package body Lib.Load is
-- legitimately occurs (e.g. two package bodies that contain
-- inlined subprogram referenced by the other).
- -- We also ignore limited_with clauses, because their purpose is
- -- precisely to create legal circular structures.
+ -- Ada0Y (AI-50217): We also ignore limited_with clauses, because
+ -- their purpose is precisely to create legal circular structures.
if Loading (Unum)
and then (Is_Spec_Name (Units.Table (Unum).Unit_Name)
@@ -693,14 +688,11 @@ package body Lib.Load is
procedure Make_Instance_Unit (N : Node_Id) is
Sind : constant Source_File_Index := Source_Index (Main_Unit);
-
begin
Units.Increment_Last;
-
Units.Table (Units.Last) := Units.Table (Main_Unit);
Units.Table (Units.Last).Cunit := Library_Unit (N);
Units.Table (Units.Last).Generate_Code := True;
-
Units.Table (Main_Unit).Cunit := N;
Units.Table (Main_Unit).Unit_Name :=
Get_Body_Name (Unit_Name (Get_Cunit_Unit_Number (Library_Unit (N))));
@@ -718,7 +710,6 @@ package body Lib.Load is
is
Sunit : constant Node_Id := Cunit (Spec_Unit);
Bunit : constant Node_Id := Cunit (Body_Unit);
-
begin
-- The spec is irrelevant if the body is a subprogram body, and the
-- spec is other than a subprogram spec or generic subprogram spec.
@@ -730,7 +721,6 @@ package body Lib.Load is
Nkind (Unit (Bunit)) = N_Subprogram_Body
and then Nkind (Unit (Sunit)) /= N_Subprogram_Declaration
and then Nkind (Unit (Sunit)) /= N_Generic_Subprogram_Declaration;
-
end Spec_Is_Irrelevant;
--------------------
@@ -740,9 +730,7 @@ package body Lib.Load is
procedure Version_Update (U : Node_Id; From : Node_Id) is
Unum : constant Unit_Number_Type := Get_Cunit_Unit_Number (U);
Fnum : constant Unit_Number_Type := Get_Cunit_Unit_Number (From);
-
begin
-
if Source_Index (Fnum) /= No_Source_File then
Units.Table (Unum).Version :=
Units.Table (Unum).Version
diff --git a/gcc/ada/lib-writ.adb b/gcc/ada/lib-writ.adb
index 35248a49d9b..055f53a897b 100644
--- a/gcc/ada/lib-writ.adb
+++ b/gcc/ada/lib-writ.adb
@@ -91,6 +91,8 @@ package body Lib.Writ is
System_Fname : File_Name_Type;
-- File name for system spec if needed for dummy entry
+ Save_Style : constant Boolean := Style_Check;
+
begin
-- Nothing to do if we already compiled System
@@ -133,9 +135,12 @@ package body Lib.Writ is
Error_Location => No_Location);
-- Parse system.ads so that the checksum is set right
+ -- Style checks are not applied.
+ Style_Check := False;
Initialize_Scanner (Units.Last, System_Source_File_Index);
Discard_List (Par (Configuration_Pragmas => False));
+ Style_Check := Save_Style;
end Ensure_System_Dependency;
---------------
@@ -209,7 +214,8 @@ package body Lib.Writ is
Item := First (Context_Items (Cunit));
while Present (Item) loop
- -- limited_with_clauses do not create dependencies.
+ -- Ada0Y (AI-50217): limited with_clauses do not create
+ -- dependencies
if Nkind (Item) = N_With_Clause
and then not (Limited_Present (Item))
@@ -680,6 +686,13 @@ package body Lib.Writ is
-- Start of processing for Writ_ALI
begin
+ -- We never write an ALI file if the original operating mode was
+ -- syntax-only (-gnats switch used in compiler invocation line)
+
+ if Original_Operating_Mode = Check_Syntax then
+ return;
+ end if;
+
-- Build sorted source dependency table. We do this right away,
-- because it is referenced by Up_To_Date_ALI_File_Exists.
@@ -716,7 +729,7 @@ package body Lib.Writ is
Write_Info_Initiate ('V');
Write_Info_Str (" """);
- Write_Info_Str (Library_Version);
+ Write_Info_Str (Verbose_Library_Version);
Write_Info_Char ('"');
Write_Info_EOL;
diff --git a/gcc/ada/lib.adb b/gcc/ada/lib.adb
index db01b6b362f..5e909307264 100644
--- a/gcc/ada/lib.adb
+++ b/gcc/ada/lib.adb
@@ -460,8 +460,7 @@ package body Lib is
end Generic_Separately_Compiled;
function Generic_Separately_Compiled
- (Sfile : File_Name_Type)
- return Boolean
+ (Sfile : File_Name_Type) return Boolean
is
begin
-- Exactly the same as previous function, but works directly on a file
@@ -534,8 +533,7 @@ package body Lib is
----------------------------------
function Get_Cunit_Entity_Unit_Number
- (E : Entity_Id)
- return Unit_Number_Type
+ (E : Entity_Id) return Unit_Number_Type
is
begin
for U in Units.First .. Units.Last loop
@@ -613,8 +611,7 @@ package body Lib is
--------------------------------
function In_Extended_Main_Code_Unit
- (N : Node_Or_Entity_Id)
- return Boolean
+ (N : Node_Or_Entity_Id) return Boolean
is
begin
if Sloc (N) = Standard_Location then
@@ -647,10 +644,7 @@ package body Lib is
end if;
end In_Extended_Main_Code_Unit;
- function In_Extended_Main_Code_Unit
- (Loc : Source_Ptr)
- return Boolean
- is
+ function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean is
begin
if Loc = Standard_Location then
return True;
@@ -676,8 +670,7 @@ package body Lib is
----------------------------------
function In_Extended_Main_Source_Unit
- (N : Node_Or_Entity_Id)
- return Boolean
+ (N : Node_Or_Entity_Id) return Boolean
is
Nloc : constant Source_Ptr := Sloc (N);
Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
@@ -718,8 +711,7 @@ package body Lib is
end In_Extended_Main_Source_Unit;
function In_Extended_Main_Source_Unit
- (Loc : Source_Ptr)
- return Boolean
+ (Loc : Source_Ptr) return Boolean
is
Mloc : constant Source_Ptr := Sloc (Cunit (Main_Unit));
@@ -878,6 +870,17 @@ package body Lib is
return Int (Units.Last) - Int (Main_Unit) + 1;
end Num_Units;
+ -----------------
+ -- Remove_Unit --
+ -----------------
+
+ procedure Remove_Unit (U : Unit_Number_Type) is
+ begin
+ if U = Units.Last then
+ Units.Decrement_Last;
+ end if;
+ end Remove_Unit;
+
----------------------------------
-- Replace_Linker_Option_String --
----------------------------------
diff --git a/gcc/ada/lib.ads b/gcc/ada/lib.ads
index e01ab65ff6b..82eaeb6301d 100644
--- a/gcc/ada/lib.ads
+++ b/gcc/ada/lib.ads
@@ -417,6 +417,10 @@ package Lib is
function Num_Units return Nat;
-- Number of units currently in unit table
+ procedure Remove_Unit (U : Unit_Number_Type);
+ -- Remove unit U from unit table. Currently this is effective only
+ -- if U is the last unit currently stored in the unit table.
+
function Entity_Is_In_Main_Unit (E : Entity_Id) return Boolean;
-- Returns True if the entity E is declared in the main unit, or, in
-- its corresponding spec, or one of its subunits. Entities declared
@@ -462,8 +466,7 @@ package Lib is
-- and False otherwise.
function In_Extended_Main_Code_Unit
- (N : Node_Or_Entity_Id)
- return Boolean;
+ (N : Node_Or_Entity_Id) return Boolean;
-- Return True if the node is in the generated code of the extended main
-- unit, defined as the main unit, its specification (if any), and all
-- its subunits (considered recursively). Units for which this enquiry
@@ -472,15 +475,12 @@ package Lib is
-- If the main unit is itself a subunit, then the extended main unit
-- includes its parent unit, and the parent unit spec if it is separate.
- function In_Extended_Main_Code_Unit
- (Loc : Source_Ptr)
- return Boolean;
+ function In_Extended_Main_Code_Unit (Loc : Source_Ptr) return Boolean;
-- Same function as above, but argument is a source pointer rather
-- than a node.
function In_Extended_Main_Source_Unit
- (N : Node_Or_Entity_Id)
- return Boolean;
+ (N : Node_Or_Entity_Id) return Boolean;
-- Return True if the node is in the source text of the extended main
-- unit, defined as the main unit, its specification (if any), and all
-- its subunits (considered recursively). Units for which this enquiry
@@ -490,9 +490,7 @@ package Lib is
-- a subunit, then the extended main unit includes its parent unit,
-- and the parent unit spec if it is separate.
- function In_Extended_Main_Source_Unit
- (Loc : Source_Ptr)
- return Boolean;
+ function In_Extended_Main_Source_Unit (Loc : Source_Ptr) return Boolean;
-- Same function as above, but argument is a source pointer rather
-- than a node.
@@ -515,8 +513,7 @@ package Lib is
-- could not have been built without making a unit table entry.
function Get_Cunit_Entity_Unit_Number
- (E : Entity_Id)
- return Unit_Number_Type;
+ (E : Entity_Id) return Unit_Number_Type;
-- Return unit number of the unit whose compilation unit spec entity is
-- the one passed as an argument. This must always succeed since the
-- entity could not have been built without making a unit table entry.
@@ -590,7 +587,7 @@ package Lib is
-- function returns True if the given generic unit entity E is for a
-- generic unit that should be separately compiled, and false otherwise.
--
- -- Now GNAT can compile any generic unit including predefifined ones, but
+ -- Now GNAT can compile any generic unit including predefined ones, but
-- because of the backward compatibility (to keep the ability to use old
-- compiler versions to build GNAT) compiling library generics is an
-- option. That is, now GNAT compiles a library generic as an ordinary
@@ -603,8 +600,7 @@ package Lib is
-- compiled with the current approach.
function Generic_Separately_Compiled
- (Sfile : File_Name_Type)
- return Boolean;
+ (Sfile : File_Name_Type) return Boolean;
-- Same as the previous function, but works directly on a unit file name.
private
diff --git a/gcc/ada/link.c b/gcc/ada/link.c
index 5a8fbeb8339..4dd087658b0 100644
--- a/gcc/ada/link.c
+++ b/gcc/ada/link.c
@@ -154,6 +154,15 @@ unsigned char objlist_file_supported = 0;
unsigned char using_gnu_linker = 0;
const char *object_library_extension = ".a";
+#elif defined (__FreeBSD__)
+char *object_file_option = "";
+char *run_path_option = "";
+char shared_libgnat_default = SHARED;
+int link_max = 2147483647;
+unsigned char objlist_file_supported = 0;
+unsigned char using_gnu_linker = 0;
+char *object_library_extension = ".a";
+
#elif defined (linux)
const char *object_file_option = "";
const char *run_path_option = "-Wl,-rpath,";
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 3ebec3d7d83..b566c6b1c91 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -24,12 +24,6 @@
-- --
------------------------------------------------------------------------------
-with Ada.Exceptions; use Ada.Exceptions;
-with Ada.Command_Line; use Ada.Command_Line;
-
-with GNAT.Directory_Operations; use GNAT.Directory_Operations;
-with GNAT.Case_Util; use GNAT.Case_Util;
-
with ALI; use ALI;
with ALI.Util; use ALI.Util;
with Csets;
@@ -65,6 +59,12 @@ with System.HTable;
with Targparm;
with Tempdir;
+with Ada.Exceptions; use Ada.Exceptions;
+with Ada.Command_Line; use Ada.Command_Line;
+
+with GNAT.Directory_Operations; use GNAT.Directory_Operations;
+with GNAT.Case_Util; use GNAT.Case_Util;
+
package body Make is
use ASCII;
@@ -312,6 +312,11 @@ package body Make is
Main_Project : Prj.Project_Id := No_Project;
-- The project id of the main project file, if any
+ Project_Object_Directory : Project_Id := No_Project;
+ -- The object directory of the project for the last compilation.
+ -- Avoid calling Change_Dir if the current working directory is already
+ -- this directory
+
-- Packages of project files where unknown attributes are errors.
Naming_String : aliased String := "naming";
@@ -344,6 +349,10 @@ package body Make is
procedure Add_Object_Directories is
new Prj.Env.For_All_Object_Dirs (Action => Add_Object_Dir);
+ procedure Change_To_Object_Directory (Project : Project_Id);
+ -- Change to the object directory of project Project, if this is not
+ -- already the current working directory.
+
type Bad_Compilation_Info is record
File : File_Name_Type;
Unit : Unit_Name_Type;
@@ -480,6 +489,9 @@ package body Make is
-- Marking Routines --
----------------------
+ Marking_Label : Byte := 1;
+ -- Value to mark the source files
+
procedure Mark (Source_File : File_Name_Type);
-- Mark Source_File. Marking is used to signal that Source_File has
-- already been inserted in the Q.
@@ -1104,6 +1116,36 @@ package body Make is
end if;
end Bind;
+ --------------------------------
+ -- Change_To_Object_Directory --
+ --------------------------------
+
+ procedure Change_To_Object_Directory (Project : Project_Id) is
+ begin
+ -- Nothing to do if the current working directory is alresdy the one
+ -- we want.
+
+ if Project_Object_Directory /= Project then
+ Project_Object_Directory := Project;
+
+ -- If in a real project, set the working directory to the object
+ -- directory of the project.
+
+ if Project /= No_Project then
+ Change_Dir
+ (Get_Name_String (Projects.Table (Project).Object_Directory));
+
+ -- Otherwise, for sources outside of any project, set the working
+ -- directory to the object directory of the main project.
+
+ elsif Main_Project /= No_Project then
+ Change_Dir
+ (Get_Name_String
+ (Projects.Table (Main_Project).Object_Directory));
+ end if;
+ end if;
+ end Change_To_Object_Directory;
+
-----------
-- Check --
-----------
@@ -1314,7 +1356,7 @@ package body Make is
return;
elsif ALIs.Table (ALI).Ver (1 .. ALIs.Table (ALI).Ver_Len) /=
- Library_Version
+ Verbose_Library_Version
then
Verbose_Msg (Full_Lib_File, "compiled with old GNAT version");
ALI := No_ALI_Id;
@@ -2201,28 +2243,23 @@ package body Make is
end;
end if;
- -- Change to the object directory of the project file, if it is
- -- not the main project file.
+ -- Change to the object directory of the project file,
+ -- if necessary.
- if Arguments_Project /= Main_Project then
- Change_Dir
- (Get_Name_String
- (Projects.Table (Arguments_Project).Object_Directory));
- end if;
+ Change_To_Object_Directory (Arguments_Project);
Pid := Compile (Arguments_Path_Name, Lib_File,
Arguments (1 .. Last_Argument));
- -- Change back to the object directory of the main project file,
- -- if necessary.
+ else
+ -- If this is a source outside of any project file, make sure
+ -- it will be compiled in the object directory of the main project
+ -- file.
- if Arguments_Project /= Main_Project then
- Change_Dir
- (Get_Name_String
- (Projects.Table (Main_Project).Object_Directory));
+ if Main_Project /= No_Project then
+ Change_To_Object_Directory (Arguments_Project);
end if;
- else
Pid := Compile (Full_Source_File, Lib_File,
Arguments (1 .. Last_Argument));
end if;
@@ -2233,7 +2270,9 @@ package body Make is
-------------
function Compile
- (S : Name_Id; L : Name_Id; Args : Argument_List) return Process_Id
+ (S : Name_Id;
+ L : Name_Id;
+ Args : Argument_List) return Process_Id
is
Comp_Args : Argument_List (Args'First .. Args'Last + 8);
Comp_Next : Integer := Args'First;
@@ -3001,7 +3040,8 @@ package body Make is
if Global_Attribute_Present then
declare
Path : constant String :=
- Absolute_Path (Global_Attribute.Value, Main_Project);
+ Absolute_Path
+ (Global_Attribute.Value, Global_Attribute.Project);
begin
if not Is_Regular_File (Path) then
Make_Failed
@@ -3033,7 +3073,8 @@ package body Make is
if Local_Attribute_Present then
declare
Path : constant String :=
- Absolute_Path (Local_Attribute.Value, For_Project);
+ Absolute_Path
+ (Local_Attribute.Value, Local_Attribute.Project);
begin
if not Is_Regular_File (Path) then
Make_Failed
@@ -3363,7 +3404,10 @@ package body Make is
-- cannot be specified on the command line.
if Osint.Number_Of_Files /= 0 then
- if Projects.Table (Main_Project).Library then
+ if Projects.Table (Main_Project).Library
+ and then not Unique_Compile
+ and then ((not Make_Steps) or else Bind_Only or else Link_Only)
+ then
Make_Failed ("cannot specify a main program " &
"on the command line for a library project file");
@@ -3386,7 +3430,7 @@ package body Make is
loop
declare
- Main : constant String := Mains.Next_Main;
+ Main : constant String := Mains.Next_Main;
-- The name specified on the command line may include
-- directory information.
@@ -3416,7 +3460,7 @@ package body Make is
if Main /= File_Name then
declare
Data : constant Project_Data :=
- Projects.Table (Main_Project);
+ Projects.Table (Main_Project);
Project_Path : constant String :=
Prj.Env.File_Name_Of_Library_Unit_Body
@@ -3478,12 +3522,14 @@ package body Make is
end if;
if not Unique_Compile then
+
-- Record the project, if it is the first main
if Real_Main_Project = No_Project then
Real_Main_Project := Proj;
elsif Proj /= Real_Main_Project then
+
-- Fail, as the current main is not a source
-- of the same project as the first main.
@@ -3557,11 +3603,14 @@ package body Make is
declare
Data : Project_Data := Projects.Table (Main_Project);
+
Languages : Variable_Value :=
- Prj.Util.Value_Of
- (Name_Languages, Data.Decl.Attributes);
+ Prj.Util.Value_Of
+ (Name_Languages, Data.Decl.Attributes);
+
Current : String_List_Id;
Element : String_Element;
+
Foreign_Language : Boolean := False;
At_Least_One_Main : Boolean := False;
@@ -3587,14 +3636,14 @@ package body Make is
end loop Look_For_Foreign;
end if;
- -- The, find all mains, or if there is a foreign
+ -- Then, find all mains, or if there is a foreign
-- language, all the Ada mains.
while Value /= Prj.Nil_String loop
Get_Name_String (String_Elements.Table (Value).Value);
- -- To know if a main is an Ada main, get its project;
- -- it should be the project specified on the command
+ -- To know if a main is an Ada main, get its project.
+ -- It should be the project specified on the command
-- line.
if (not Foreign_Language) or else
@@ -3616,11 +3665,14 @@ package body Make is
-- we put all sources of the main project in the Q.
if not At_Least_One_Main then
+
-- First make sure that the binder and the linker
- -- will not be invoked.
+ -- will not be invoked if -z is not used.
- Do_Bind_Step := False;
- Do_Link_Step := False;
+ if not No_Main_Subprogram then
+ Do_Bind_Step := False;
+ Do_Link_Step := False;
+ end if;
-- Put all the sources in the queue
@@ -3679,7 +3731,7 @@ package body Make is
else
-- Output usage information if no files to compile
- Makeusg;
+ Usage;
Exit_Program (E_Fatal);
end if;
end if;
@@ -3714,6 +3766,16 @@ package body Make is
And_Save => False);
end if;
+ else
+ -- If we use a project file, we have already checked that a main
+ -- specified on the command line with directory information has the
+ -- path name corresponding to a correct source in the project tree.
+ -- So, we don't need the directory information to be taken into
+ -- account by Find_File, and in fact it may lead to take the wrong
+ -- sources for other compilation units, when there are extending
+ -- projects.
+
+ Opt.Look_In_Primary_Dir := False;
end if;
-- If the user wants a program without a main subprogram, add the
@@ -3733,12 +3795,50 @@ package body Make is
-- project.
begin
- Change_Dir
- (Get_Name_String
- (Projects.Table (Main_Project).Object_Directory));
+ Project_Object_Directory := No_Project;
+ Change_To_Object_Directory (Main_Project);
exception
when Directory_Error =>
+
+ -- This should never happen. But, if it does, display the
+ -- content of the parent directory of the obj dir.
+
+ declare
+ Parent : constant Dir_Name_Str :=
+ Dir_Name
+ (Get_Name_String
+ (Projects.Table (Main_Project).Object_Directory));
+ Dir : Dir_Type;
+ Str : String (1 .. 200);
+ Last : Natural;
+
+ begin
+ Write_Str ("Contents of directory """);
+ Write_Str (Parent);
+ Write_Line (""":");
+
+ Open (Dir, Parent);
+
+ loop
+ Read (Dir, Str, Last);
+ exit when Last = 0;
+ Write_Str (" ");
+ Write_Line (Str (1 .. Last));
+ end loop;
+
+ Close (Dir);
+
+ exception
+ when X : others =>
+ Write_Line ("(unexpected exception)");
+ Write_Line (Exception_Information (X));
+
+ if Is_Open (Dir) then
+ Close (Dir);
+ end if;
+ end;
+
Make_Failed ("unable to change working directory to """,
Get_Name_String
(Projects.Table (Main_Project).Object_Directory),
@@ -4166,6 +4266,18 @@ package body Make is
Multiple_Main_Loop : for N_File in 1 .. Osint.Number_Of_Files loop
+ -- Increase the marking label to be sure to check sources
+ -- for all executables.
+
+ Marking_Label := Marking_Label + 1;
+
+ -- Make sure it is not 0, which is the default value for
+ -- a file that has never been marked.
+
+ if Marking_Label = 0 then
+ Marking_Label := 1;
+ end if;
+
-- First, find the executable name and path
Executable := No_File;
@@ -4544,6 +4656,13 @@ package body Make is
end Recursive_Compilation_Step;
end if;
+ -- For binding and linking, we need to be in the object directory of
+ -- the main project.
+
+ if Main_Project /= No_Project then
+ Change_To_Object_Directory (Main_Project);
+ end if;
+
-- If we are here, it means that we need to rebuilt the current
-- main. So we set Executable_Obsolete to True to make sure that
-- the subsequent mains will be rebuilt.
@@ -5511,7 +5630,7 @@ package body Make is
end loop Scan_Args;
if Usage_Requested then
- Makeusg;
+ Usage;
end if;
-- Test for trailing -P switch
@@ -5633,6 +5752,14 @@ package body Make is
Make_Failed (Exception_Message (Err));
end;
end if;
+
+ -- Make sure no project object directory is recorded
+
+ Project_Object_Directory := No_Project;
+
+ -- Set the marking label to a value that is not zero
+
+ Marking_Label := 1;
end Initialize;
-----------------------------------
@@ -5645,10 +5772,11 @@ package body Make is
Into_Q : Boolean)
is
Put_In_Q : Boolean := Into_Q;
- Unit : Com.Unit_Data;
- Sfile : Name_Id;
+ Unit : Com.Unit_Data;
+ Sfile : Name_Id;
+
Extending : constant Boolean :=
- Projects.Table (The_Project).Extends /= No_Project;
+ Projects.Table (The_Project).Extends /= No_Project;
function Check_Project (P : Project_Id) return Boolean;
-- Returns True if P is The_Project or a project extended by
@@ -5982,7 +6110,7 @@ package body Make is
function Is_Marked (Source_File : File_Name_Type) return Boolean is
begin
- return Get_Name_Table_Byte (Source_File) /= 0;
+ return Get_Name_Table_Byte (Source_File) = Marking_Label;
end Is_Marked;
----------
@@ -6166,7 +6294,7 @@ package body Make is
procedure Mark (Source_File : File_Name_Type) is
begin
- Set_Name_Table_Byte (Source_File, 1);
+ Set_Name_Table_Byte (Source_File, Marking_Label);
end Mark;
--------------------
@@ -6489,7 +6617,6 @@ package body Make is
then
Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
- Add_Switch (Argv, Linker, And_Save => And_Save);
if Argv'Length <= 6 or else Argv (6) /= '=' then
Make_Failed ("missing path for --RTS");
@@ -6798,11 +6925,13 @@ package body Make is
-- linking with all standard library files.
Opt.No_Stdlib := True;
+
+ Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Binder, And_Save => And_Save);
elsif Argv (2 .. Argv'Last) = "nostdinc" then
- -- Pass -nostdinv to the Compiler and to gnatbind
+ -- Pass -nostdinc to the Compiler and to gnatbind
Opt.No_Stdinc := True;
Add_Switch (Argv, Compiler, And_Save => And_Save);
diff --git a/gcc/ada/mdll-utl.adb b/gcc/ada/mdll-utl.adb
index 82c33b0d6c1..2608e92f224 100644
--- a/gcc/ada/mdll-utl.adb
+++ b/gcc/ada/mdll-utl.adb
@@ -30,7 +30,7 @@ with Ada.Text_IO;
with Ada.Exceptions;
with GNAT.Directory_Operations;
-with Sdefault;
+with Osint;
package body MDLL.Utl is
@@ -155,7 +155,7 @@ package body MDLL.Utl is
Base_File : String := "";
Build_Lib : Boolean := False)
is
- use Sdefault;
+ use Osint;
Arguments : OS_Lib.Argument_List
(1 .. 5 + Files'Length + Options'Length);
@@ -167,7 +167,7 @@ package body MDLL.Utl is
Out_V : aliased String := Output_File;
Bas_Opt : aliased String := "-Wl,--base-file," & Base_File;
Lib_Opt : aliased String := "-mdll";
- Lib_Dir : aliased String := "-L" & Object_Dir_Default_Name.all;
+ Lib_Dir : aliased String := "-L" & Object_Dir_Default_Prefix;
begin
A := A + 1;
diff --git a/gcc/ada/misc.c b/gcc/ada/misc.c
index 83907b94903..cd9663c73e4 100644
--- a/gcc/ada/misc.c
+++ b/gcc/ada/misc.c
@@ -39,6 +39,7 @@
#include "coretypes.h"
#include "tm.h"
#include "tree.h"
+#include "real.h"
#include "rtl.h"
#include "errors.h"
#include "diagnostic.h"
@@ -146,7 +147,7 @@ static void gnat_adjust_rli (record_layout_info);
const struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER;
-/* Tables describing GCC tree codes used only by GNAT.
+/* Tables describing GCC tree codes used only by GNAT.
Table indexed by tree code giving a string containing a character
classifying the tree code. Possibilities are
@@ -258,13 +259,18 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
case OPT_Wmissing_prototypes:
case OPT_Wstrict_prototypes:
case OPT_Wwrite_strings:
- case OPT_Wno_long_long:
+ case OPT_Wlong_long:
break;
/* This is handled by the front-end. */
case OPT_nostdinc:
break;
+ case OPT_nostdlib:
+ gnat_argv[gnat_argc] = xstrdup ("-nostdlib");
+ gnat_argc++;
+ break;
+
case OPT_fRTS:
gnat_argv[gnat_argc] = xstrdup ("-fRTS");
gnat_argc++;
@@ -272,7 +278,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
case OPT_gant:
warning ("`-gnat' misspelled as `-gant'");
-
+
/* ... fall through ... */
case OPT_gnat:
@@ -283,7 +289,7 @@ gnat_handle_option (size_t scode, const char *arg, int value ATTRIBUTE_UNUSED)
gnat_argc++;
if (arg[0] == 'O')
- for (i = 1; i < save_argc - 1; i++)
+ for (i = 1; i < save_argc - 1; i++)
if (!strncmp (save_argv[i], "-gnatO", 6))
if (save_argv[++i][0] != '-')
{
@@ -304,8 +310,8 @@ static unsigned int
gnat_init_options (unsigned int argc, const char **argv)
{
/* Initialize gnat_argv with save_argv size. */
- gnat_argv = (char **) xmalloc ((argc + 1) * sizeof (argv[0]));
- gnat_argv[0] = xstrdup (argv[0]); /* name of the command */
+ gnat_argv = (char **) xmalloc ((argc + 1) * sizeof (argv[0]));
+ gnat_argv[0] = xstrdup (argv[0]); /* name of the command */
gnat_argc = 1;
save_argc = argc;
@@ -359,7 +365,7 @@ gnat_tree_size (enum tree_code code)
/* Perform all the initialization steps that are language-specific. */
static bool
-gnat_init ()
+gnat_init (void)
{
/* Performs whatever initialization steps needed by the language-dependent
lexical analyzer. */
@@ -396,7 +402,7 @@ gnat_finish_incomplete_decl (tree dont_care ATTRIBUTE_UNUSED)
objects. */
void
-gnat_compute_largest_alignment ()
+gnat_compute_largest_alignment (void)
{
enum machine_mode mode;
@@ -413,7 +419,7 @@ gnat_compute_largest_alignment ()
various language dependent hooks. */
void
-gnat_init_gcc_eh ()
+gnat_init_gcc_eh (void)
{
/* We shouldn't do anything if the No_Exceptions_Handler pragma is set,
though. This could for instance lead to the emission of tables with
@@ -544,6 +550,13 @@ gnat_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
tree new;
rtx result;
+ /* If this is a statement, call the expansion routine for statements. */
+ if (IS_STMT (exp))
+ {
+ gnat_expand_stmt (exp);
+ return const0_rtx;
+ }
+
/* Update EXP to be the new expression to expand. */
switch (TREE_CODE (exp))
{
@@ -699,7 +712,7 @@ static int
gnat_eh_type_covers (tree a, tree b)
{
/* a catches b if they represent the same exception id or if a
- is an "others".
+ is an "others".
??? integer_zero_node for "others" is hardwired in too many places
currently. */
@@ -879,3 +892,108 @@ must_pass_by_ref (tree gnu_type)
|| (TYPE_SIZE (gnu_type) != 0
&& TREE_CODE (TYPE_SIZE (gnu_type)) != INTEGER_CST));
}
+
+/* This function is called by the front end to enumerate all the supported
+ modes for the machine. We pass a function which is called back with
+ the following integer parameters:
+
+ FLOAT_P nonzero if this represents a floating-point mode
+ COMPLEX_P nonzero is this represents a complex mode
+ COUNT count of number of items, nonzero for vector mode
+ PRECISION number of bits in data representation
+ MANTISSA number of bits in mantissa, if FP and known, else zero.
+ SIZE number of bits used to store data
+ ALIGN number of bits to which mode is aligned. */
+
+void
+enumerate_modes (void (*f) (int, int, int, int, int, int, unsigned int))
+{
+ enum machine_mode i;
+
+ for (i = 0; i < NUM_MACHINE_MODES; i++)
+ {
+ enum machine_mode j;
+ bool float_p = 0;
+ bool complex_p = 0;
+ bool vector_p = 0;
+ bool skip_p = 0;
+ int mantissa = 0;
+ enum machine_mode inner_mode = i;
+
+ switch (GET_MODE_CLASS (i))
+ {
+ case MODE_INT:
+ break;
+ case MODE_FLOAT:
+ float_p = 1;
+ break;
+ case MODE_COMPLEX_INT:
+ complex_p = 1;
+ inner_mode = GET_MODE_INNER (i);
+ break;
+ case MODE_COMPLEX_FLOAT:
+ float_p = 1;
+ complex_p = 1;
+ inner_mode = GET_MODE_INNER (i);
+ break;
+ case MODE_VECTOR_INT:
+ vector_p = 1;
+ inner_mode = GET_MODE_INNER (i);
+ break;
+ case MODE_VECTOR_FLOAT:
+ float_p = 1;
+ vector_p = 1;
+ inner_mode = GET_MODE_INNER (i);
+ break;
+ default:
+ skip_p = 1;
+ }
+
+ /* Skip this mode if it's one the front end doesn't need to know about
+ (e.g., the CC modes) or if there is no add insn for that mode (or
+ any wider mode), meaning it is not supported by the hardware. If
+ this a complex or vector mode, we care about the inner mode. */
+ for (j = inner_mode; j != VOIDmode; j = GET_MODE_WIDER_MODE (j))
+ if (add_optab->handlers[j].insn_code != CODE_FOR_nothing)
+ break;
+
+ if (float_p)
+ {
+ const struct real_format *fmt = REAL_MODE_FORMAT (inner_mode);
+
+ mantissa = fmt->p * fmt->log2_b;
+ }
+
+ if (!skip_p && j != VOIDmode)
+ (*f) (float_p, complex_p, vector_p ? GET_MODE_NUNITS (i) : 0,
+ GET_MODE_BITSIZE (i), mantissa,
+ GET_MODE_SIZE (i) * BITS_PER_UNIT, GET_MODE_ALIGNMENT (i));
+ }
+}
+
+int
+fp_prec_to_size (int prec)
+{
+ enum machine_mode mode;
+
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if (GET_MODE_PRECISION (mode) == prec)
+ return GET_MODE_BITSIZE (mode);
+
+ abort ();
+}
+
+int
+fp_size_to_prec (int size)
+{
+ enum machine_mode mode;
+
+ for (mode = GET_CLASS_NARROWEST_MODE (MODE_FLOAT); mode != VOIDmode;
+ mode = GET_MODE_WIDER_MODE (mode))
+ if (GET_MODE_BITSIZE (mode) == size)
+ return GET_MODE_PRECISION (mode);
+
+ abort ();
+}
+
diff --git a/gcc/ada/mkdir.c b/gcc/ada/mkdir.c
index 2501461f9f0..ce08d9a0601 100644
--- a/gcc/ada/mkdir.c
+++ b/gcc/ada/mkdir.c
@@ -48,8 +48,7 @@
/* This function provides a portable binding to the mkdir function. */
int
-__gnat_mkdir (dir_name)
- char *dir_name;
+__gnat_mkdir (char *dir_name)
{
#if defined (_WIN32) || defined (__vxworks)
return mkdir (dir_name);
diff --git a/gcc/ada/mlib-prj.adb b/gcc/ada/mlib-prj.adb
index f71ae7b2e81..93025586b31 100644
--- a/gcc/ada/mlib-prj.adb
+++ b/gcc/ada/mlib-prj.adb
@@ -576,7 +576,7 @@ package body MLib.Prj is
for W in Unit_Data.First_With .. Unit_Data.Last_With loop
Afile := Withs.Table (W).Afile;
- if Library_ALIs.Get (Afile)
+ if Afile /= No_Name and then Library_ALIs.Get (Afile)
and then not Processed_ALIs.Get (Afile)
then
if not Interface_ALIs.Get (Afile) then
@@ -806,6 +806,49 @@ package body MLib.Prj is
(B_Start & Get_Name_String (Data.Library_Name) & ".adb");
Add_Argument ("-L" & Get_Name_String (Data.Library_Name));
+ -- Check if Binder'Default_Switches ("Ada) is defined. If it is,
+ -- add these switches to call gnatbind.
+
+ declare
+ Binder_Package : constant Package_Id :=
+ Value_Of
+ (Name => Name_Binder,
+ In_Packages => Data.Decl.Packages);
+
+ begin
+ if Binder_Package /= No_Package then
+ declare
+ Defaults : constant Array_Element_Id :=
+ Value_Of
+ (Name => Name_Default_Switches,
+ In_Arrays =>
+ Packages.Table
+ (Binder_Package).Decl.Arrays);
+ Switches : Variable_Value := Nil_Variable_Value;
+
+ Switch : String_List_Id := Nil_String;
+
+ begin
+ if Defaults /= No_Array_Element then
+ Switches :=
+ Value_Of
+ (Index => Name_Ada, In_Array => Defaults);
+
+ if not Switches.Default then
+ Switch := Switches.Values;
+
+ while Switch /= Nil_String loop
+ Add_Argument
+ (Get_Name_String
+ (String_Elements.Table (Switch).Value));
+ Switch := String_Elements.Table (Switch).Next;
+ end loop;
+ end if;
+ end if;
+ end;
+ end if;
+ end;
+
-- Get all the ALI files of the project file
declare
@@ -1313,6 +1356,7 @@ package body MLib.Prj is
Interfaces => Arguments (1 .. Argument_Number),
Lib_Filename => Lib_Filename.all,
Lib_Dir => Lib_Dirpath.all,
+ Symbol_Data => Data.Symbol_Data,
Driver_Name => Driver_Name,
Lib_Address => DLL_Address.all,
Lib_Version => Lib_Version.all,
diff --git a/gcc/ada/mlib-tgt.adb b/gcc/ada/mlib-tgt.adb
index 0fc5919db40..d8e280a706c 100644
--- a/gcc/ada/mlib-tgt.adb
+++ b/gcc/ada/mlib-tgt.adb
@@ -79,6 +79,7 @@ package body MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -92,6 +93,7 @@ package body MLib.Tgt is
pragma Unreferenced (Interfaces);
pragma Unreferenced (Lib_Filename);
pragma Unreferenced (Lib_Dir);
+ pragma Unreferenced (Symbol_Data);
pragma Unreferenced (Driver_Name);
pragma Unreferenced (Lib_Address);
pragma Unreferenced (Lib_Version);
diff --git a/gcc/ada/mlib-tgt.ads b/gcc/ada/mlib-tgt.ads
index d7cad10b091..1fac4efe3fc 100644
--- a/gcc/ada/mlib-tgt.ads
+++ b/gcc/ada/mlib-tgt.ads
@@ -113,6 +113,7 @@ package MLib.Tgt is
Interfaces : Argument_List;
Lib_Filename : String;
Lib_Dir : String;
+ Symbol_Data : Symbol_Record;
Driver_Name : Name_Id := No_Name;
Lib_Address : String := "";
Lib_Version : String := "";
@@ -125,23 +126,33 @@ package MLib.Tgt is
-- Afiles is the list of ALI files for the Ada object files.
-- Options is a list of options to be passed to the tool (gcc or other)
-- that effectively builds the dynamic library.
+ --
-- Interfaces is the list of ALI files for the interfaces of a SAL.
-- It is empty if the library is not a SAL.
+ --
-- Lib_Filename is the name of the library, without any prefix or
-- extension. For example, on Unix, if Lib_Filename is "toto", the name of
-- the library file will be "libtoto.so".
+ --
-- Lib_Dir is the directory path where the library will be located.
+ --
-- Lib_Address is the base address of the library for a non relocatable
-- library, given as an hexadecimal string.
- -- For OSes that support symbolic links, Lib_Version, if non null, is
- -- the actual file name of the library. For example on Unix,
- -- if Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1",
- -- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which will
- -- be the actual library file.
+ --
+ -- For OSes that support symbolic links, Lib_Version, if non null,
+ -- is the actual file name of the library. For example on Unix, if
+ -- Lib_Filename is "toto" and Lib_Version is "libtoto.so.2.1",
+ -- "libtoto.so" will be a symbolic link to "libtoto.so.2.1" which
+ -- will be the actual library file.
+ --
-- Relocatable indicates if the library should be relocatable or not,
-- for those OSes that actually support non relocatable dynamic libraries.
-- Relocatable indicates that automatic elaboration/finalization must be
-- indicated to the linker, if possible.
+ --
+ -- Symbol_Data is used for some patforms, including VMS, to generate
+ -- the symbols to be exported by the library.
+ --
-- Note: Depending on the OS, some of the parameters may not be taken
-- into account. For example, on Linux, Foreign, Afiles Lib_Address and
-- Relocatable are ignored.
diff --git a/gcc/ada/nmake.adb b/gcc/ada/nmake.adb
deleted file mode 100644
index 9b199faa0d0..00000000000
--- a/gcc/ada/nmake.adb
+++ /dev/null
@@ -1,2858 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- N M A K E --
--- --
--- B o d y --
--- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
-pragma Style_Checks (All_Checks);
--- Turn off subprogram order checking, since the routines here are
--- generated automatically in order.
-
-
-with Atree; use Atree;
-with Sinfo; use Sinfo;
-with Snames; use Snames;
-with Stand; use Stand;
-
-package body Nmake is
-
- function Make_Unused_At_Start (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Unused_At_Start, Sloc);
- begin
- return N;
- end Make_Unused_At_Start;
-
- function Make_Unused_At_End (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Unused_At_End, Sloc);
- begin
- return N;
- end Make_Unused_At_End;
-
- function Make_Identifier (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Identifier, Sloc);
- begin
- Set_Chars (N, Chars);
- return N;
- end Make_Identifier;
-
- function Make_Integer_Literal (Sloc : Source_Ptr;
- Intval : Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Integer_Literal, Sloc);
- begin
- Set_Intval (N, Intval);
- return N;
- end Make_Integer_Literal;
-
- function Make_Real_Literal (Sloc : Source_Ptr;
- Realval : Ureal)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Real_Literal, Sloc);
- begin
- Set_Realval (N, Realval);
- return N;
- end Make_Real_Literal;
-
- function Make_Character_Literal (Sloc : Source_Ptr;
- Chars : Name_Id;
- Char_Literal_Value : Char_Code)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Character_Literal, Sloc);
- begin
- Set_Chars (N, Chars);
- Set_Char_Literal_Value (N, Char_Literal_Value);
- return N;
- end Make_Character_Literal;
-
- function Make_String_Literal (Sloc : Source_Ptr;
- Strval : String_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_String_Literal, Sloc);
- begin
- Set_Strval (N, Strval);
- return N;
- end Make_String_Literal;
-
- function Make_Pragma (Sloc : Source_Ptr;
- Chars : Name_Id;
- Pragma_Argument_Associations : List_Id := No_List;
- Debug_Statement : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Pragma, Sloc);
- begin
- Set_Chars (N, Chars);
- Set_Pragma_Argument_Associations
- (N, Pragma_Argument_Associations);
- Set_Debug_Statement (N, Debug_Statement);
- return N;
- end Make_Pragma;
-
- function Make_Pragma_Argument_Association (Sloc : Source_Ptr;
- Chars : Name_Id := No_Name;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Pragma_Argument_Association, Sloc);
- begin
- Set_Chars (N, Chars);
- Set_Expression (N, Expression);
- return N;
- end Make_Pragma_Argument_Association;
-
- function Make_Defining_Identifier (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Entity (N_Defining_Identifier, Sloc);
- begin
- Set_Chars (N, Chars);
- return N;
- end Make_Defining_Identifier;
-
- function Make_Full_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Type_Definition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Full_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Type_Definition (N, Type_Definition);
- return N;
- end Make_Full_Type_Declaration;
-
- function Make_Subtype_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Subtype_Indication : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subtype_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Subtype_Indication (N, Subtype_Indication);
- return N;
- end Make_Subtype_Declaration;
-
- function Make_Subtype_Indication (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Constraint : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subtype_Indication, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Constraint (N, Constraint);
- return N;
- end Make_Subtype_Indication;
-
- function Make_Object_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Aliased_Present : Boolean := False;
- Constant_Present : Boolean := False;
- Object_Definition : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Object_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Aliased_Present (N, Aliased_Present);
- Set_Constant_Present (N, Constant_Present);
- Set_Object_Definition (N, Object_Definition);
- Set_Expression (N, Expression);
- return N;
- end Make_Object_Declaration;
-
- function Make_Number_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Number_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Expression (N, Expression);
- return N;
- end Make_Number_Declaration;
-
- function Make_Derived_Type_Definition (Sloc : Source_Ptr;
- Abstract_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Record_Extension_Part : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Derived_Type_Definition, Sloc);
- begin
- Set_Abstract_Present (N, Abstract_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- Set_Record_Extension_Part (N, Record_Extension_Part);
- return N;
- end Make_Derived_Type_Definition;
-
- function Make_Range_Constraint (Sloc : Source_Ptr;
- Range_Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Range_Constraint, Sloc);
- begin
- Set_Range_Expression (N, Range_Expression);
- return N;
- end Make_Range_Constraint;
-
- function Make_Range (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id;
- Includes_Infinities : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Range, Sloc);
- begin
- Set_Low_Bound (N, Low_Bound);
- Set_High_Bound (N, High_Bound);
- Set_Includes_Infinities (N, Includes_Infinities);
- return N;
- end Make_Range;
-
- function Make_Enumeration_Type_Definition (Sloc : Source_Ptr;
- Literals : List_Id;
- End_Label : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Enumeration_Type_Definition, Sloc);
- begin
- Set_Literals (N, Literals);
- Set_End_Label (N, End_Label);
- return N;
- end Make_Enumeration_Type_Definition;
-
- function Make_Defining_Character_Literal (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Entity (N_Defining_Character_Literal, Sloc);
- begin
- Set_Chars (N, Chars);
- return N;
- end Make_Defining_Character_Literal;
-
- function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Signed_Integer_Type_Definition, Sloc);
- begin
- Set_Low_Bound (N, Low_Bound);
- Set_High_Bound (N, High_Bound);
- return N;
- end Make_Signed_Integer_Type_Definition;
-
- function Make_Modular_Type_Definition (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Modular_Type_Definition, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Modular_Type_Definition;
-
- function Make_Floating_Point_Definition (Sloc : Source_Ptr;
- Digits_Expression : Node_Id;
- Real_Range_Specification : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Floating_Point_Definition, Sloc);
- begin
- Set_Digits_Expression (N, Digits_Expression);
- Set_Real_Range_Specification (N, Real_Range_Specification);
- return N;
- end Make_Floating_Point_Definition;
-
- function Make_Real_Range_Specification (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Real_Range_Specification, Sloc);
- begin
- Set_Low_Bound (N, Low_Bound);
- Set_High_Bound (N, High_Bound);
- return N;
- end Make_Real_Range_Specification;
-
- function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Real_Range_Specification : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Ordinary_Fixed_Point_Definition, Sloc);
- begin
- Set_Delta_Expression (N, Delta_Expression);
- Set_Real_Range_Specification (N, Real_Range_Specification);
- return N;
- end Make_Ordinary_Fixed_Point_Definition;
-
- function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Digits_Expression : Node_Id;
- Real_Range_Specification : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Decimal_Fixed_Point_Definition, Sloc);
- begin
- Set_Delta_Expression (N, Delta_Expression);
- Set_Digits_Expression (N, Digits_Expression);
- Set_Real_Range_Specification (N, Real_Range_Specification);
- return N;
- end Make_Decimal_Fixed_Point_Definition;
-
- function Make_Digits_Constraint (Sloc : Source_Ptr;
- Digits_Expression : Node_Id;
- Range_Constraint : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Digits_Constraint, Sloc);
- begin
- Set_Digits_Expression (N, Digits_Expression);
- Set_Range_Constraint (N, Range_Constraint);
- return N;
- end Make_Digits_Constraint;
-
- function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr;
- Subtype_Marks : List_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Unconstrained_Array_Definition, Sloc);
- begin
- Set_Subtype_Marks (N, Subtype_Marks);
- Set_Aliased_Present (N, Aliased_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- return N;
- end Make_Unconstrained_Array_Definition;
-
- function Make_Constrained_Array_Definition (Sloc : Source_Ptr;
- Discrete_Subtype_Definitions : List_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Constrained_Array_Definition, Sloc);
- begin
- Set_Discrete_Subtype_Definitions
- (N, Discrete_Subtype_Definitions);
- Set_Aliased_Present (N, Aliased_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- return N;
- end Make_Constrained_Array_Definition;
-
- function Make_Discriminant_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Type : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Discriminant_Specification, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Type (N, Discriminant_Type);
- Set_Expression (N, Expression);
- return N;
- end Make_Discriminant_Specification;
-
- function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr;
- Constraints : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Index_Or_Discriminant_Constraint, Sloc);
- begin
- Set_Constraints (N, Constraints);
- return N;
- end Make_Index_Or_Discriminant_Constraint;
-
- function Make_Discriminant_Association (Sloc : Source_Ptr;
- Selector_Names : List_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Discriminant_Association, Sloc);
- begin
- Set_Selector_Names (N, Selector_Names);
- Set_Expression (N, Expression);
- return N;
- end Make_Discriminant_Association;
-
- function Make_Record_Definition (Sloc : Source_Ptr;
- End_Label : Node_Id := Empty;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False;
- Component_List : Node_Id;
- Null_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Record_Definition, Sloc);
- begin
- Set_End_Label (N, End_Label);
- Set_Abstract_Present (N, Abstract_Present);
- Set_Tagged_Present (N, Tagged_Present);
- Set_Limited_Present (N, Limited_Present);
- Set_Component_List (N, Component_List);
- Set_Null_Present (N, Null_Present);
- return N;
- end Make_Record_Definition;
-
- function Make_Component_List (Sloc : Source_Ptr;
- Component_Items : List_Id;
- Variant_Part : Node_Id := Empty;
- Null_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Component_List, Sloc);
- begin
- Set_Component_Items (N, Component_Items);
- Set_Variant_Part (N, Variant_Part);
- Set_Null_Present (N, Null_Present);
- return N;
- end Make_Component_List;
-
- function Make_Component_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Component_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Aliased_Present (N, Aliased_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- Set_Expression (N, Expression);
- return N;
- end Make_Component_Declaration;
-
- function Make_Variant_Part (Sloc : Source_Ptr;
- Name : Node_Id;
- Variants : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Variant_Part, Sloc);
- begin
- Set_Name (N, Name);
- Set_Variants (N, Variants);
- return N;
- end Make_Variant_Part;
-
- function Make_Variant (Sloc : Source_Ptr;
- Discrete_Choices : List_Id;
- Component_List : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Variant, Sloc);
- begin
- Set_Discrete_Choices (N, Discrete_Choices);
- Set_Component_List (N, Component_List);
- return N;
- end Make_Variant;
-
- function Make_Others_Choice (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Others_Choice, Sloc);
- begin
- return N;
- end Make_Others_Choice;
-
- function Make_Access_To_Object_Definition (Sloc : Source_Ptr;
- All_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Constant_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Access_To_Object_Definition, Sloc);
- begin
- Set_All_Present (N, All_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- Set_Constant_Present (N, Constant_Present);
- return N;
- end Make_Access_To_Object_Definition;
-
- function Make_Access_Function_Definition (Sloc : Source_Ptr;
- Protected_Present : Boolean := False;
- Parameter_Specifications : List_Id := No_List;
- Subtype_Mark : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Access_Function_Definition, Sloc);
- begin
- Set_Protected_Present (N, Protected_Present);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- Set_Subtype_Mark (N, Subtype_Mark);
- return N;
- end Make_Access_Function_Definition;
-
- function Make_Access_Procedure_Definition (Sloc : Source_Ptr;
- Protected_Present : Boolean := False;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Access_Procedure_Definition, Sloc);
- begin
- Set_Protected_Present (N, Protected_Present);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- return N;
- end Make_Access_Procedure_Definition;
-
- function Make_Access_Definition (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Access_Definition, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- return N;
- end Make_Access_Definition;
-
- function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Incomplete_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Unknown_Discriminants_Present
- (N, Unknown_Discriminants_Present);
- return N;
- end Make_Incomplete_Type_Declaration;
-
- function Make_Explicit_Dereference (Sloc : Source_Ptr;
- Prefix : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Explicit_Dereference, Sloc);
- begin
- Set_Prefix (N, Prefix);
- return N;
- end Make_Explicit_Dereference;
-
- function Make_Indexed_Component (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Expressions : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Indexed_Component, Sloc);
- begin
- Set_Prefix (N, Prefix);
- Set_Expressions (N, Expressions);
- return N;
- end Make_Indexed_Component;
-
- function Make_Slice (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Discrete_Range : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Slice, Sloc);
- begin
- Set_Prefix (N, Prefix);
- Set_Discrete_Range (N, Discrete_Range);
- return N;
- end Make_Slice;
-
- function Make_Selected_Component (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Selector_Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Selected_Component, Sloc);
- begin
- Set_Prefix (N, Prefix);
- Set_Selector_Name (N, Selector_Name);
- return N;
- end Make_Selected_Component;
-
- function Make_Attribute_Reference (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Attribute_Name : Name_Id;
- Expressions : List_Id := No_List;
- Must_Be_Byte_Aligned : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Attribute_Reference, Sloc);
- begin
- Set_Prefix (N, Prefix);
- Set_Attribute_Name (N, Attribute_Name);
- Set_Expressions (N, Expressions);
- Set_Must_Be_Byte_Aligned (N, Must_Be_Byte_Aligned);
- return N;
- end Make_Attribute_Reference;
-
- function Make_Aggregate (Sloc : Source_Ptr;
- Expressions : List_Id := No_List;
- Component_Associations : List_Id := No_List;
- Null_Record_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Aggregate, Sloc);
- begin
- Set_Expressions (N, Expressions);
- Set_Component_Associations (N, Component_Associations);
- Set_Null_Record_Present (N, Null_Record_Present);
- return N;
- end Make_Aggregate;
-
- function Make_Component_Association (Sloc : Source_Ptr;
- Choices : List_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Component_Association, Sloc);
- begin
- Set_Choices (N, Choices);
- Set_Expression (N, Expression);
- return N;
- end Make_Component_Association;
-
- function Make_Extension_Aggregate (Sloc : Source_Ptr;
- Ancestor_Part : Node_Id;
- Expressions : List_Id := No_List;
- Component_Associations : List_Id := No_List;
- Null_Record_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Extension_Aggregate, Sloc);
- begin
- Set_Ancestor_Part (N, Ancestor_Part);
- Set_Expressions (N, Expressions);
- Set_Component_Associations (N, Component_Associations);
- Set_Null_Record_Present (N, Null_Record_Present);
- return N;
- end Make_Extension_Aggregate;
-
- function Make_Null (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Null, Sloc);
- begin
- return N;
- end Make_Null;
-
- function Make_And_Then (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_And_Then, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- return N;
- end Make_And_Then;
-
- function Make_Or_Else (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Or_Else, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- return N;
- end Make_Or_Else;
-
- function Make_In (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_In, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- return N;
- end Make_In;
-
- function Make_Not_In (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Not_In, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- return N;
- end Make_Not_In;
-
- function Make_Op_And (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_And, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_And);
- Set_Entity (N, Standard_Op_And);
- return N;
- end Make_Op_And;
-
- function Make_Op_Or (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Or, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Or);
- Set_Entity (N, Standard_Op_Or);
- return N;
- end Make_Op_Or;
-
- function Make_Op_Xor (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Xor, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Xor);
- Set_Entity (N, Standard_Op_Xor);
- return N;
- end Make_Op_Xor;
-
- function Make_Op_Eq (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Eq, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Eq);
- Set_Entity (N, Standard_Op_Eq);
- return N;
- end Make_Op_Eq;
-
- function Make_Op_Ne (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Ne, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Ne);
- Set_Entity (N, Standard_Op_Ne);
- return N;
- end Make_Op_Ne;
-
- function Make_Op_Lt (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Lt, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Lt);
- Set_Entity (N, Standard_Op_Lt);
- return N;
- end Make_Op_Lt;
-
- function Make_Op_Le (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Le, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Le);
- Set_Entity (N, Standard_Op_Le);
- return N;
- end Make_Op_Le;
-
- function Make_Op_Gt (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Gt, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Gt);
- Set_Entity (N, Standard_Op_Gt);
- return N;
- end Make_Op_Gt;
-
- function Make_Op_Ge (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Ge, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Ge);
- Set_Entity (N, Standard_Op_Ge);
- return N;
- end Make_Op_Ge;
-
- function Make_Op_Add (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Add, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Add);
- Set_Entity (N, Standard_Op_Add);
- return N;
- end Make_Op_Add;
-
- function Make_Op_Subtract (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Subtract, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Subtract);
- Set_Entity (N, Standard_Op_Subtract);
- return N;
- end Make_Op_Subtract;
-
- function Make_Op_Concat (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Concat, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Concat);
- Set_Entity (N, Standard_Op_Concat);
- return N;
- end Make_Op_Concat;
-
- function Make_Op_Multiply (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Multiply, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Multiply);
- Set_Entity (N, Standard_Op_Multiply);
- return N;
- end Make_Op_Multiply;
-
- function Make_Op_Divide (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Divide, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Divide);
- Set_Entity (N, Standard_Op_Divide);
- return N;
- end Make_Op_Divide;
-
- function Make_Op_Mod (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Mod, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Mod);
- Set_Entity (N, Standard_Op_Mod);
- return N;
- end Make_Op_Mod;
-
- function Make_Op_Rem (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Rem, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Rem);
- Set_Entity (N, Standard_Op_Rem);
- return N;
- end Make_Op_Rem;
-
- function Make_Op_Expon (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Expon, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Expon);
- Set_Entity (N, Standard_Op_Expon);
- return N;
- end Make_Op_Expon;
-
- function Make_Op_Plus (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Plus, Sloc);
- begin
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Add);
- Set_Entity (N, Standard_Op_Plus);
- return N;
- end Make_Op_Plus;
-
- function Make_Op_Minus (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Minus, Sloc);
- begin
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Subtract);
- Set_Entity (N, Standard_Op_Minus);
- return N;
- end Make_Op_Minus;
-
- function Make_Op_Abs (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Abs, Sloc);
- begin
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Abs);
- Set_Entity (N, Standard_Op_Abs);
- return N;
- end Make_Op_Abs;
-
- function Make_Op_Not (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Not, Sloc);
- begin
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Op_Not);
- Set_Entity (N, Standard_Op_Not);
- return N;
- end Make_Op_Not;
-
- function Make_Type_Conversion (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Type_Conversion, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Expression (N, Expression);
- return N;
- end Make_Type_Conversion;
-
- function Make_Qualified_Expression (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Qualified_Expression, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Expression (N, Expression);
- return N;
- end Make_Qualified_Expression;
-
- function Make_Allocator (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Allocator, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Allocator;
-
- function Make_Null_Statement (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Null_Statement, Sloc);
- begin
- return N;
- end Make_Null_Statement;
-
- function Make_Label (Sloc : Source_Ptr;
- Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Label, Sloc);
- begin
- Set_Identifier (N, Identifier);
- return N;
- end Make_Label;
-
- function Make_Assignment_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Assignment_Statement, Sloc);
- begin
- Set_Name (N, Name);
- Set_Expression (N, Expression);
- return N;
- end Make_Assignment_Statement;
-
- function Make_If_Statement (Sloc : Source_Ptr;
- Condition : Node_Id;
- Then_Statements : List_Id;
- Elsif_Parts : List_Id := No_List;
- Else_Statements : List_Id := No_List;
- End_Span : Uint := No_Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_If_Statement, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Then_Statements (N, Then_Statements);
- Set_Elsif_Parts (N, Elsif_Parts);
- Set_Else_Statements (N, Else_Statements);
- Set_End_Span (N, End_Span);
- return N;
- end Make_If_Statement;
-
- function Make_Elsif_Part (Sloc : Source_Ptr;
- Condition : Node_Id;
- Then_Statements : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Elsif_Part, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Then_Statements (N, Then_Statements);
- return N;
- end Make_Elsif_Part;
-
- function Make_Case_Statement (Sloc : Source_Ptr;
- Expression : Node_Id;
- Alternatives : List_Id;
- End_Span : Uint := No_Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Case_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- Set_Alternatives (N, Alternatives);
- Set_End_Span (N, End_Span);
- return N;
- end Make_Case_Statement;
-
- function Make_Case_Statement_Alternative (Sloc : Source_Ptr;
- Discrete_Choices : List_Id;
- Statements : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Case_Statement_Alternative, Sloc);
- begin
- Set_Discrete_Choices (N, Discrete_Choices);
- Set_Statements (N, Statements);
- return N;
- end Make_Case_Statement_Alternative;
-
- function Make_Loop_Statement (Sloc : Source_Ptr;
- Identifier : Node_Id := Empty;
- Iteration_Scheme : Node_Id := Empty;
- Statements : List_Id;
- End_Label : Node_Id;
- Has_Created_Identifier : Boolean := False;
- Is_Null_Loop : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Loop_Statement, Sloc);
- begin
- Set_Identifier (N, Identifier);
- Set_Iteration_Scheme (N, Iteration_Scheme);
- Set_Statements (N, Statements);
- Set_End_Label (N, End_Label);
- Set_Has_Created_Identifier (N, Has_Created_Identifier);
- Set_Is_Null_Loop (N, Is_Null_Loop);
- return N;
- end Make_Loop_Statement;
-
- function Make_Iteration_Scheme (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Loop_Parameter_Specification : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Iteration_Scheme, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Loop_Parameter_Specification
- (N, Loop_Parameter_Specification);
- return N;
- end Make_Iteration_Scheme;
-
- function Make_Loop_Parameter_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Reverse_Present : Boolean := False;
- Discrete_Subtype_Definition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Loop_Parameter_Specification, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Reverse_Present (N, Reverse_Present);
- Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition);
- return N;
- end Make_Loop_Parameter_Specification;
-
- function Make_Block_Statement (Sloc : Source_Ptr;
- Identifier : Node_Id := Empty;
- Declarations : List_Id := No_List;
- Handled_Statement_Sequence : Node_Id;
- Has_Created_Identifier : Boolean := False;
- Is_Task_Allocation_Block : Boolean := False;
- Is_Asynchronous_Call_Block : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Block_Statement, Sloc);
- begin
- Set_Identifier (N, Identifier);
- Set_Declarations (N, Declarations);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- Set_Has_Created_Identifier (N, Has_Created_Identifier);
- Set_Is_Task_Allocation_Block (N, Is_Task_Allocation_Block);
- Set_Is_Asynchronous_Call_Block (N, Is_Asynchronous_Call_Block);
- return N;
- end Make_Block_Statement;
-
- function Make_Exit_Statement (Sloc : Source_Ptr;
- Name : Node_Id := Empty;
- Condition : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Exit_Statement, Sloc);
- begin
- Set_Name (N, Name);
- Set_Condition (N, Condition);
- return N;
- end Make_Exit_Statement;
-
- function Make_Goto_Statement (Sloc : Source_Ptr;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Goto_Statement, Sloc);
- begin
- Set_Name (N, Name);
- return N;
- end Make_Goto_Statement;
-
- function Make_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subprogram_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- return N;
- end Make_Subprogram_Declaration;
-
- function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Abstract_Subprogram_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- return N;
- end Make_Abstract_Subprogram_Declaration;
-
- function Make_Function_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Parameter_Specifications : List_Id := No_List;
- Subtype_Mark : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Function_Specification, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- Set_Subtype_Mark (N, Subtype_Mark);
- return N;
- end Make_Function_Specification;
-
- function Make_Procedure_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Procedure_Specification, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- return N;
- end Make_Procedure_Specification;
-
- function Make_Designator (Sloc : Source_Ptr;
- Name : Node_Id;
- Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Designator, Sloc);
- begin
- Set_Name (N, Name);
- Set_Identifier (N, Identifier);
- return N;
- end Make_Designator;
-
- function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr;
- Name : Node_Id;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Defining_Program_Unit_Name, Sloc);
- begin
- Set_Name (N, Name);
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Defining_Program_Unit_Name;
-
- function Make_Operator_Symbol (Sloc : Source_Ptr;
- Chars : Name_Id;
- Strval : String_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Operator_Symbol, Sloc);
- begin
- Set_Chars (N, Chars);
- Set_Strval (N, Strval);
- return N;
- end Make_Operator_Symbol;
-
- function Make_Defining_Operator_Symbol (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Entity (N_Defining_Operator_Symbol, Sloc);
- begin
- Set_Chars (N, Chars);
- return N;
- end Make_Defining_Operator_Symbol;
-
- function Make_Parameter_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- In_Present : Boolean := False;
- Out_Present : Boolean := False;
- Parameter_Type : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Parameter_Specification, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_In_Present (N, In_Present);
- Set_Out_Present (N, Out_Present);
- Set_Parameter_Type (N, Parameter_Type);
- Set_Expression (N, Expression);
- return N;
- end Make_Parameter_Specification;
-
- function Make_Subprogram_Body (Sloc : Source_Ptr;
- Specification : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id;
- Bad_Is_Detected : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subprogram_Body, Sloc);
- begin
- Set_Specification (N, Specification);
- Set_Declarations (N, Declarations);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- Set_Bad_Is_Detected (N, Bad_Is_Detected);
- return N;
- end Make_Subprogram_Body;
-
- function Make_Procedure_Call_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Procedure_Call_Statement, Sloc);
- begin
- Set_Name (N, Name);
- Set_Parameter_Associations (N, Parameter_Associations);
- return N;
- end Make_Procedure_Call_Statement;
-
- function Make_Function_Call (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Function_Call, Sloc);
- begin
- Set_Name (N, Name);
- Set_Parameter_Associations (N, Parameter_Associations);
- return N;
- end Make_Function_Call;
-
- function Make_Parameter_Association (Sloc : Source_Ptr;
- Selector_Name : Node_Id;
- Explicit_Actual_Parameter : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Parameter_Association, Sloc);
- begin
- Set_Selector_Name (N, Selector_Name);
- Set_Explicit_Actual_Parameter (N, Explicit_Actual_Parameter);
- return N;
- end Make_Parameter_Association;
-
- function Make_Return_Statement (Sloc : Source_Ptr;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Return_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Return_Statement;
-
- function Make_Package_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- return N;
- end Make_Package_Declaration;
-
- function Make_Package_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Specification, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Visible_Declarations (N, Visible_Declarations);
- Set_Private_Declarations (N, Private_Declarations);
- Set_End_Label (N, End_Label);
- return N;
- end Make_Package_Specification;
-
- function Make_Package_Body (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Body, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Declarations (N, Declarations);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- return N;
- end Make_Package_Body;
-
- function Make_Private_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Private_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Unknown_Discriminants_Present
- (N, Unknown_Discriminants_Present);
- Set_Abstract_Present (N, Abstract_Present);
- Set_Tagged_Present (N, Tagged_Present);
- Set_Limited_Present (N, Limited_Present);
- return N;
- end Make_Private_Type_Declaration;
-
- function Make_Private_Extension_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False;
- Abstract_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Private_Extension_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Unknown_Discriminants_Present
- (N, Unknown_Discriminants_Present);
- Set_Abstract_Present (N, Abstract_Present);
- Set_Subtype_Indication (N, Subtype_Indication);
- return N;
- end Make_Private_Extension_Declaration;
-
- function Make_Use_Package_Clause (Sloc : Source_Ptr;
- Names : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Use_Package_Clause, Sloc);
- begin
- Set_Names (N, Names);
- return N;
- end Make_Use_Package_Clause;
-
- function Make_Use_Type_Clause (Sloc : Source_Ptr;
- Subtype_Marks : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Use_Type_Clause, Sloc);
- begin
- Set_Subtype_Marks (N, Subtype_Marks);
- return N;
- end Make_Use_Type_Clause;
-
- function Make_Object_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Subtype_Mark : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Object_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Name (N, Name);
- return N;
- end Make_Object_Renaming_Declaration;
-
- function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Exception_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Name (N, Name);
- return N;
- end Make_Exception_Renaming_Declaration;
-
- function Make_Package_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- return N;
- end Make_Package_Renaming_Declaration;
-
- function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subprogram_Renaming_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- Set_Name (N, Name);
- return N;
- end Make_Subprogram_Renaming_Declaration;
-
- function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Package_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- return N;
- end Make_Generic_Package_Renaming_Declaration;
-
- function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Procedure_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- return N;
- end Make_Generic_Procedure_Renaming_Declaration;
-
- function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Function_Renaming_Declaration, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- return N;
- end Make_Generic_Function_Renaming_Declaration;
-
- function Make_Task_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Task_Definition : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Task_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Task_Definition (N, Task_Definition);
- return N;
- end Make_Task_Type_Declaration;
-
- function Make_Single_Task_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Task_Definition : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Single_Task_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Task_Definition (N, Task_Definition);
- return N;
- end Make_Single_Task_Declaration;
-
- function Make_Task_Definition (Sloc : Source_Ptr;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Task_Definition, Sloc);
- begin
- Set_Visible_Declarations (N, Visible_Declarations);
- Set_Private_Declarations (N, Private_Declarations);
- Set_End_Label (N, End_Label);
- return N;
- end Make_Task_Definition;
-
- function Make_Task_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Task_Body, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Declarations (N, Declarations);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- return N;
- end Make_Task_Body;
-
- function Make_Protected_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Protected_Definition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Protected_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Protected_Definition (N, Protected_Definition);
- return N;
- end Make_Protected_Type_Declaration;
-
- function Make_Single_Protected_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Protected_Definition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Single_Protected_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Protected_Definition (N, Protected_Definition);
- return N;
- end Make_Single_Protected_Declaration;
-
- function Make_Protected_Definition (Sloc : Source_Ptr;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Protected_Definition, Sloc);
- begin
- Set_Visible_Declarations (N, Visible_Declarations);
- Set_Private_Declarations (N, Private_Declarations);
- Set_End_Label (N, End_Label);
- return N;
- end Make_Protected_Definition;
-
- function Make_Protected_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Declarations : List_Id;
- End_Label : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Protected_Body, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Declarations (N, Declarations);
- Set_End_Label (N, End_Label);
- return N;
- end Make_Protected_Body;
-
- function Make_Entry_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discrete_Subtype_Definition : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- return N;
- end Make_Entry_Declaration;
-
- function Make_Accept_Statement (Sloc : Source_Ptr;
- Entry_Direct_Name : Node_Id;
- Entry_Index : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List;
- Handled_Statement_Sequence : Node_Id;
- Declarations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Accept_Statement, Sloc);
- begin
- Set_Entry_Direct_Name (N, Entry_Direct_Name);
- Set_Entry_Index (N, Entry_Index);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- Set_Declarations (N, Declarations);
- return N;
- end Make_Accept_Statement;
-
- function Make_Entry_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Entry_Body_Formal_Part : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Body, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Entry_Body_Formal_Part (N, Entry_Body_Formal_Part);
- Set_Declarations (N, Declarations);
- Set_Handled_Statement_Sequence (N, Handled_Statement_Sequence);
- return N;
- end Make_Entry_Body;
-
- function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr;
- Entry_Index_Specification : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List;
- Condition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Body_Formal_Part, Sloc);
- begin
- Set_Entry_Index_Specification (N, Entry_Index_Specification);
- Set_Parameter_Specifications (N, Parameter_Specifications);
- Set_Condition (N, Condition);
- return N;
- end Make_Entry_Body_Formal_Part;
-
- function Make_Entry_Index_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discrete_Subtype_Definition : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Index_Specification, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Discrete_Subtype_Definition (N, Discrete_Subtype_Definition);
- return N;
- end Make_Entry_Index_Specification;
-
- function Make_Entry_Call_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Call_Statement, Sloc);
- begin
- Set_Name (N, Name);
- Set_Parameter_Associations (N, Parameter_Associations);
- return N;
- end Make_Entry_Call_Statement;
-
- function Make_Requeue_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Abort_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Requeue_Statement, Sloc);
- begin
- Set_Name (N, Name);
- Set_Abort_Present (N, Abort_Present);
- return N;
- end Make_Requeue_Statement;
-
- function Make_Delay_Until_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Delay_Until_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Delay_Until_Statement;
-
- function Make_Delay_Relative_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Delay_Relative_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Delay_Relative_Statement;
-
- function Make_Selective_Accept (Sloc : Source_Ptr;
- Select_Alternatives : List_Id;
- Else_Statements : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Selective_Accept, Sloc);
- begin
- Set_Select_Alternatives (N, Select_Alternatives);
- Set_Else_Statements (N, Else_Statements);
- return N;
- end Make_Selective_Accept;
-
- function Make_Accept_Alternative (Sloc : Source_Ptr;
- Accept_Statement : Node_Id;
- Condition : Node_Id := Empty;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Accept_Alternative, Sloc);
- begin
- Set_Accept_Statement (N, Accept_Statement);
- Set_Condition (N, Condition);
- Set_Statements (N, Statements);
- Set_Pragmas_Before (N, Pragmas_Before);
- return N;
- end Make_Accept_Alternative;
-
- function Make_Delay_Alternative (Sloc : Source_Ptr;
- Delay_Statement : Node_Id;
- Condition : Node_Id := Empty;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Delay_Alternative, Sloc);
- begin
- Set_Delay_Statement (N, Delay_Statement);
- Set_Condition (N, Condition);
- Set_Statements (N, Statements);
- Set_Pragmas_Before (N, Pragmas_Before);
- return N;
- end Make_Delay_Alternative;
-
- function Make_Terminate_Alternative (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Pragmas_Before : List_Id := No_List;
- Pragmas_After : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Terminate_Alternative, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Pragmas_Before (N, Pragmas_Before);
- Set_Pragmas_After (N, Pragmas_After);
- return N;
- end Make_Terminate_Alternative;
-
- function Make_Timed_Entry_Call (Sloc : Source_Ptr;
- Entry_Call_Alternative : Node_Id;
- Delay_Alternative : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Timed_Entry_Call, Sloc);
- begin
- Set_Entry_Call_Alternative (N, Entry_Call_Alternative);
- Set_Delay_Alternative (N, Delay_Alternative);
- return N;
- end Make_Timed_Entry_Call;
-
- function Make_Entry_Call_Alternative (Sloc : Source_Ptr;
- Entry_Call_Statement : Node_Id;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Entry_Call_Alternative, Sloc);
- begin
- Set_Entry_Call_Statement (N, Entry_Call_Statement);
- Set_Statements (N, Statements);
- Set_Pragmas_Before (N, Pragmas_Before);
- return N;
- end Make_Entry_Call_Alternative;
-
- function Make_Conditional_Entry_Call (Sloc : Source_Ptr;
- Entry_Call_Alternative : Node_Id;
- Else_Statements : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Conditional_Entry_Call, Sloc);
- begin
- Set_Entry_Call_Alternative (N, Entry_Call_Alternative);
- Set_Else_Statements (N, Else_Statements);
- return N;
- end Make_Conditional_Entry_Call;
-
- function Make_Asynchronous_Select (Sloc : Source_Ptr;
- Triggering_Alternative : Node_Id;
- Abortable_Part : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Asynchronous_Select, Sloc);
- begin
- Set_Triggering_Alternative (N, Triggering_Alternative);
- Set_Abortable_Part (N, Abortable_Part);
- return N;
- end Make_Asynchronous_Select;
-
- function Make_Triggering_Alternative (Sloc : Source_Ptr;
- Triggering_Statement : Node_Id;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Triggering_Alternative, Sloc);
- begin
- Set_Triggering_Statement (N, Triggering_Statement);
- Set_Statements (N, Statements);
- Set_Pragmas_Before (N, Pragmas_Before);
- return N;
- end Make_Triggering_Alternative;
-
- function Make_Abortable_Part (Sloc : Source_Ptr;
- Statements : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Abortable_Part, Sloc);
- begin
- Set_Statements (N, Statements);
- return N;
- end Make_Abortable_Part;
-
- function Make_Abort_Statement (Sloc : Source_Ptr;
- Names : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Abort_Statement, Sloc);
- begin
- Set_Names (N, Names);
- return N;
- end Make_Abort_Statement;
-
- function Make_Compilation_Unit (Sloc : Source_Ptr;
- Context_Items : List_Id;
- Private_Present : Boolean := False;
- Unit : Node_Id;
- Aux_Decls_Node : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Compilation_Unit, Sloc);
- begin
- Set_Context_Items (N, Context_Items);
- Set_Private_Present (N, Private_Present);
- Set_Unit (N, Unit);
- Set_Aux_Decls_Node (N, Aux_Decls_Node);
- return N;
- end Make_Compilation_Unit;
-
- function Make_Compilation_Unit_Aux (Sloc : Source_Ptr;
- Declarations : List_Id := No_List;
- Actions : List_Id := No_List;
- Pragmas_After : List_Id := No_List;
- Config_Pragmas : List_Id := Empty_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Compilation_Unit_Aux, Sloc);
- begin
- Set_Declarations (N, Declarations);
- Set_Actions (N, Actions);
- Set_Pragmas_After (N, Pragmas_After);
- Set_Config_Pragmas (N, Config_Pragmas);
- return N;
- end Make_Compilation_Unit_Aux;
-
- function Make_With_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- First_Name : Boolean := True;
- Last_Name : Boolean := True;
- Limited_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_With_Clause, Sloc);
- begin
- Set_Name (N, Name);
- Set_First_Name (N, First_Name);
- Set_Last_Name (N, Last_Name);
- Set_Limited_Present (N, Limited_Present);
- return N;
- end Make_With_Clause;
-
- function Make_With_Type_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- Tagged_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_With_Type_Clause, Sloc);
- begin
- Set_Name (N, Name);
- Set_Tagged_Present (N, Tagged_Present);
- return N;
- end Make_With_Type_Clause;
-
- function Make_Subprogram_Body_Stub (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subprogram_Body_Stub, Sloc);
- begin
- Set_Specification (N, Specification);
- return N;
- end Make_Subprogram_Body_Stub;
-
- function Make_Package_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Body_Stub, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Package_Body_Stub;
-
- function Make_Task_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Task_Body_Stub, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Task_Body_Stub;
-
- function Make_Protected_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Protected_Body_Stub, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Protected_Body_Stub;
-
- function Make_Subunit (Sloc : Source_Ptr;
- Name : Node_Id;
- Proper_Body : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subunit, Sloc);
- begin
- Set_Name (N, Name);
- Set_Proper_Body (N, Proper_Body);
- return N;
- end Make_Subunit;
-
- function Make_Exception_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Exception_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Exception_Declaration;
-
- function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr;
- Statements : List_Id;
- End_Label : Node_Id := Empty;
- Exception_Handlers : List_Id := No_List;
- At_End_Proc : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Handled_Sequence_Of_Statements, Sloc);
- begin
- Set_Statements (N, Statements);
- Set_End_Label (N, End_Label);
- Set_Exception_Handlers (N, Exception_Handlers);
- Set_At_End_Proc (N, At_End_Proc);
- return N;
- end Make_Handled_Sequence_Of_Statements;
-
- function Make_Exception_Handler (Sloc : Source_Ptr;
- Choice_Parameter : Node_Id := Empty;
- Exception_Choices : List_Id;
- Statements : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Exception_Handler, Sloc);
- begin
- Set_Choice_Parameter (N, Choice_Parameter);
- Set_Exception_Choices (N, Exception_Choices);
- Set_Statements (N, Statements);
- return N;
- end Make_Exception_Handler;
-
- function Make_Raise_Statement (Sloc : Source_Ptr;
- Name : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Raise_Statement, Sloc);
- begin
- Set_Name (N, Name);
- return N;
- end Make_Raise_Statement;
-
- function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Generic_Formal_Declarations : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Subprogram_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations);
- return N;
- end Make_Generic_Subprogram_Declaration;
-
- function Make_Generic_Package_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Generic_Formal_Declarations : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Package_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- Set_Generic_Formal_Declarations (N, Generic_Formal_Declarations);
- return N;
- end Make_Generic_Package_Declaration;
-
- function Make_Package_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Package_Instantiation, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- Set_Generic_Associations (N, Generic_Associations);
- return N;
- end Make_Package_Instantiation;
-
- function Make_Procedure_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Procedure_Instantiation, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- Set_Generic_Associations (N, Generic_Associations);
- return N;
- end Make_Procedure_Instantiation;
-
- function Make_Function_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Function_Instantiation, Sloc);
- begin
- Set_Defining_Unit_Name (N, Defining_Unit_Name);
- Set_Name (N, Name);
- Set_Generic_Associations (N, Generic_Associations);
- return N;
- end Make_Function_Instantiation;
-
- function Make_Generic_Association (Sloc : Source_Ptr;
- Selector_Name : Node_Id := Empty;
- Explicit_Generic_Actual_Parameter : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Generic_Association, Sloc);
- begin
- Set_Selector_Name (N, Selector_Name);
- Set_Explicit_Generic_Actual_Parameter
- (N, Explicit_Generic_Actual_Parameter);
- return N;
- end Make_Generic_Association;
-
- function Make_Formal_Object_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- In_Present : Boolean := False;
- Out_Present : Boolean := False;
- Subtype_Mark : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Object_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_In_Present (N, In_Present);
- Set_Out_Present (N, Out_Present);
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Expression (N, Expression);
- return N;
- end Make_Formal_Object_Declaration;
-
- function Make_Formal_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Formal_Type_Definition : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Type_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Formal_Type_Definition (N, Formal_Type_Definition);
- Set_Discriminant_Specifications (N, Discriminant_Specifications);
- Set_Unknown_Discriminants_Present
- (N, Unknown_Discriminants_Present);
- return N;
- end Make_Formal_Type_Declaration;
-
- function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Private_Type_Definition, Sloc);
- begin
- Set_Abstract_Present (N, Abstract_Present);
- Set_Tagged_Present (N, Tagged_Present);
- Set_Limited_Present (N, Limited_Present);
- return N;
- end Make_Formal_Private_Type_Definition;
-
- function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Private_Present : Boolean := False;
- Abstract_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Derived_Type_Definition, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Private_Present (N, Private_Present);
- Set_Abstract_Present (N, Abstract_Present);
- return N;
- end Make_Formal_Derived_Type_Definition;
-
- function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Discrete_Type_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Discrete_Type_Definition;
-
- function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Signed_Integer_Type_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Signed_Integer_Type_Definition;
-
- function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Modular_Type_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Modular_Type_Definition;
-
- function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Floating_Point_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Floating_Point_Definition;
-
- function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Ordinary_Fixed_Point_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Ordinary_Fixed_Point_Definition;
-
- function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Decimal_Fixed_Point_Definition, Sloc);
- begin
- return N;
- end Make_Formal_Decimal_Fixed_Point_Definition;
-
- function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Default_Name : Node_Id := Empty;
- Box_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Subprogram_Declaration, Sloc);
- begin
- Set_Specification (N, Specification);
- Set_Default_Name (N, Default_Name);
- Set_Box_Present (N, Box_Present);
- return N;
- end Make_Formal_Subprogram_Declaration;
-
- function Make_Formal_Package_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List;
- Box_Present : Boolean := False)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Formal_Package_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- Set_Name (N, Name);
- Set_Generic_Associations (N, Generic_Associations);
- Set_Box_Present (N, Box_Present);
- return N;
- end Make_Formal_Package_Declaration;
-
- function Make_Attribute_Definition_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- Chars : Name_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Attribute_Definition_Clause, Sloc);
- begin
- Set_Name (N, Name);
- Set_Chars (N, Chars);
- Set_Expression (N, Expression);
- return N;
- end Make_Attribute_Definition_Clause;
-
- function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Array_Aggregate : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Enumeration_Representation_Clause, Sloc);
- begin
- Set_Identifier (N, Identifier);
- Set_Array_Aggregate (N, Array_Aggregate);
- return N;
- end Make_Enumeration_Representation_Clause;
-
- function Make_Record_Representation_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Mod_Clause : Node_Id := Empty;
- Component_Clauses : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Record_Representation_Clause, Sloc);
- begin
- Set_Identifier (N, Identifier);
- Set_Mod_Clause (N, Mod_Clause);
- Set_Component_Clauses (N, Component_Clauses);
- return N;
- end Make_Record_Representation_Clause;
-
- function Make_Component_Clause (Sloc : Source_Ptr;
- Component_Name : Node_Id;
- Position : Node_Id;
- First_Bit : Node_Id;
- Last_Bit : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Component_Clause, Sloc);
- begin
- Set_Component_Name (N, Component_Name);
- Set_Position (N, Position);
- Set_First_Bit (N, First_Bit);
- Set_Last_Bit (N, Last_Bit);
- return N;
- end Make_Component_Clause;
-
- function Make_Code_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Code_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Code_Statement;
-
- function Make_Op_Rotate_Left (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Rotate_Left, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Rotate_Left);
- Set_Entity (N, Standard_Op_Rotate_Left);
- return N;
- end Make_Op_Rotate_Left;
-
- function Make_Op_Rotate_Right (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Rotate_Right, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Rotate_Right);
- Set_Entity (N, Standard_Op_Rotate_Right);
- return N;
- end Make_Op_Rotate_Right;
-
- function Make_Op_Shift_Left (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Shift_Left, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Shift_Left);
- Set_Entity (N, Standard_Op_Shift_Left);
- return N;
- end Make_Op_Shift_Left;
-
- function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Shift_Right_Arithmetic, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Shift_Right_Arithmetic);
- Set_Entity (N, Standard_Op_Shift_Right_Arithmetic);
- return N;
- end Make_Op_Shift_Right_Arithmetic;
-
- function Make_Op_Shift_Right (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Op_Shift_Right, Sloc);
- begin
- Set_Left_Opnd (N, Left_Opnd);
- Set_Right_Opnd (N, Right_Opnd);
- Set_Chars (N, Name_Shift_Right);
- Set_Entity (N, Standard_Op_Shift_Right);
- return N;
- end Make_Op_Shift_Right;
-
- function Make_Delta_Constraint (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Range_Constraint : Node_Id := Empty)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Delta_Constraint, Sloc);
- begin
- Set_Delta_Expression (N, Delta_Expression);
- Set_Range_Constraint (N, Range_Constraint);
- return N;
- end Make_Delta_Constraint;
-
- function Make_At_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_At_Clause, Sloc);
- begin
- Set_Identifier (N, Identifier);
- Set_Expression (N, Expression);
- return N;
- end Make_At_Clause;
-
- function Make_Mod_Clause (Sloc : Source_Ptr;
- Expression : Node_Id;
- Pragmas_Before : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Mod_Clause, Sloc);
- begin
- Set_Expression (N, Expression);
- Set_Pragmas_Before (N, Pragmas_Before);
- return N;
- end Make_Mod_Clause;
-
- function Make_Conditional_Expression (Sloc : Source_Ptr;
- Expressions : List_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Conditional_Expression, Sloc);
- begin
- Set_Expressions (N, Expressions);
- return N;
- end Make_Conditional_Expression;
-
- function Make_Expanded_Name (Sloc : Source_Ptr;
- Chars : Name_Id;
- Prefix : Node_Id;
- Selector_Name : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Expanded_Name, Sloc);
- begin
- Set_Chars (N, Chars);
- Set_Prefix (N, Prefix);
- Set_Selector_Name (N, Selector_Name);
- return N;
- end Make_Expanded_Name;
-
- function Make_Free_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Free_Statement, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Free_Statement;
-
- function Make_Freeze_Entity (Sloc : Source_Ptr;
- Actions : List_Id := No_List)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Freeze_Entity, Sloc);
- begin
- Set_Actions (N, Actions);
- return N;
- end Make_Freeze_Entity;
-
- function Make_Implicit_Label_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Implicit_Label_Declaration, Sloc);
- begin
- Set_Defining_Identifier (N, Defining_Identifier);
- return N;
- end Make_Implicit_Label_Declaration;
-
- function Make_Itype_Reference (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Itype_Reference, Sloc);
- begin
- return N;
- end Make_Itype_Reference;
-
- function Make_Raise_Constraint_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Raise_Constraint_Error, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Reason (N, Reason);
- return N;
- end Make_Raise_Constraint_Error;
-
- function Make_Raise_Program_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Raise_Program_Error, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Reason (N, Reason);
- return N;
- end Make_Raise_Program_Error;
-
- function Make_Raise_Storage_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Raise_Storage_Error, Sloc);
- begin
- Set_Condition (N, Condition);
- Set_Reason (N, Reason);
- return N;
- end Make_Raise_Storage_Error;
-
- function Make_Reference (Sloc : Source_Ptr;
- Prefix : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Reference, Sloc);
- begin
- Set_Prefix (N, Prefix);
- return N;
- end Make_Reference;
-
- function Make_Subprogram_Info (Sloc : Source_Ptr;
- Identifier : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Subprogram_Info, Sloc);
- begin
- Set_Identifier (N, Identifier);
- return N;
- end Make_Subprogram_Info;
-
- function Make_Unchecked_Expression (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Unchecked_Expression, Sloc);
- begin
- Set_Expression (N, Expression);
- return N;
- end Make_Unchecked_Expression;
-
- function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Unchecked_Type_Conversion, Sloc);
- begin
- Set_Subtype_Mark (N, Subtype_Mark);
- Set_Expression (N, Expression);
- return N;
- end Make_Unchecked_Type_Conversion;
-
- function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr)
- return Node_Id
- is
- N : constant Node_Id :=
- New_Node (N_Validate_Unchecked_Conversion, Sloc);
- begin
- return N;
- end Make_Validate_Unchecked_Conversion;
-
-end Nmake;
diff --git a/gcc/ada/nmake.ads b/gcc/ada/nmake.ads
deleted file mode 100644
index be05e7940b3..00000000000
--- a/gcc/ada/nmake.ads
+++ /dev/null
@@ -1,1347 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- N M A K E --
--- --
--- S p e c --
--- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
-pragma Style_Checks (All_Checks);
--- Turn off subprogram order checking, since the routines here are
--- generated automatically in order.
-
-
-with Nlists; use Nlists;
-with Types; use Types;
-with Uintp; use Uintp;
-with Urealp; use Urealp;
-
-package Nmake is
-
--- This package contains a set of routines used to construct tree nodes
--- using a functional style. There is one routine for each node type defined
--- in Sinfo with the general interface:
-
--- function Make_xxx (Sloc : Source_Ptr,
--- Field_Name_1 : Field_Name_1_Type [:= default]
--- Field_Name_2 : Field_Name_2_Type [:= default]
--- ...)
--- return Node_Id
-
--- Only syntactic fields are included (i.e. fields marked as "-Sem" or "-Lib"
--- in the Sinfo spec are excluded). In addition, the following four syntactic
--- fields are excluded:
-
--- Prev_Ids
--- More_Ids
--- Comes_From_Source
--- Paren_Count
-
--- since they are very rarely set in expanded code. If they need to be set,
--- to other than the default values (False, False, False, zero), then the
--- appropriate Set_xxx procedures must be used on the returned value.
-
--- Default values are provided only for flag fields (where the default is
--- False), and for optional fields. An optional field is one where the
--- comment line describing the field contains the string "(set to xxx if".
--- For such fields, a default value of xxx is provided."
-
--- Warning: since calls to Make_xxx routines are normal function calls, the
--- arguments can be evaluated in any order. This means that at most one such
--- argument can have side effects (e.g. be a call to a parse routine).
-
- function Make_Unused_At_Start (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Unused_At_Start);
-
- function Make_Unused_At_End (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Unused_At_End);
-
- function Make_Identifier (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id;
- pragma Inline (Make_Identifier);
-
- function Make_Integer_Literal (Sloc : Source_Ptr;
- Intval : Uint)
- return Node_Id;
- pragma Inline (Make_Integer_Literal);
-
- function Make_Real_Literal (Sloc : Source_Ptr;
- Realval : Ureal)
- return Node_Id;
- pragma Inline (Make_Real_Literal);
-
- function Make_Character_Literal (Sloc : Source_Ptr;
- Chars : Name_Id;
- Char_Literal_Value : Char_Code)
- return Node_Id;
- pragma Inline (Make_Character_Literal);
-
- function Make_String_Literal (Sloc : Source_Ptr;
- Strval : String_Id)
- return Node_Id;
- pragma Inline (Make_String_Literal);
-
- function Make_Pragma (Sloc : Source_Ptr;
- Chars : Name_Id;
- Pragma_Argument_Associations : List_Id := No_List;
- Debug_Statement : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Pragma);
-
- function Make_Pragma_Argument_Association (Sloc : Source_Ptr;
- Chars : Name_Id := No_Name;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Pragma_Argument_Association);
-
- function Make_Defining_Identifier (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id;
- pragma Inline (Make_Defining_Identifier);
-
- function Make_Full_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Type_Definition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Full_Type_Declaration);
-
- function Make_Subtype_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Subtype_Indication : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subtype_Declaration);
-
- function Make_Subtype_Indication (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Constraint : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subtype_Indication);
-
- function Make_Object_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Aliased_Present : Boolean := False;
- Constant_Present : Boolean := False;
- Object_Definition : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Object_Declaration);
-
- function Make_Number_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Number_Declaration);
-
- function Make_Derived_Type_Definition (Sloc : Source_Ptr;
- Abstract_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Record_Extension_Part : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Derived_Type_Definition);
-
- function Make_Range_Constraint (Sloc : Source_Ptr;
- Range_Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Range_Constraint);
-
- function Make_Range (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id;
- Includes_Infinities : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Range);
-
- function Make_Enumeration_Type_Definition (Sloc : Source_Ptr;
- Literals : List_Id;
- End_Label : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Enumeration_Type_Definition);
-
- function Make_Defining_Character_Literal (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id;
- pragma Inline (Make_Defining_Character_Literal);
-
- function Make_Signed_Integer_Type_Definition (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id)
- return Node_Id;
- pragma Inline (Make_Signed_Integer_Type_Definition);
-
- function Make_Modular_Type_Definition (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Modular_Type_Definition);
-
- function Make_Floating_Point_Definition (Sloc : Source_Ptr;
- Digits_Expression : Node_Id;
- Real_Range_Specification : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Floating_Point_Definition);
-
- function Make_Real_Range_Specification (Sloc : Source_Ptr;
- Low_Bound : Node_Id;
- High_Bound : Node_Id)
- return Node_Id;
- pragma Inline (Make_Real_Range_Specification);
-
- function Make_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Real_Range_Specification : Node_Id)
- return Node_Id;
- pragma Inline (Make_Ordinary_Fixed_Point_Definition);
-
- function Make_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Digits_Expression : Node_Id;
- Real_Range_Specification : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Decimal_Fixed_Point_Definition);
-
- function Make_Digits_Constraint (Sloc : Source_Ptr;
- Digits_Expression : Node_Id;
- Range_Constraint : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Digits_Constraint);
-
- function Make_Unconstrained_Array_Definition (Sloc : Source_Ptr;
- Subtype_Marks : List_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id;
- pragma Inline (Make_Unconstrained_Array_Definition);
-
- function Make_Constrained_Array_Definition (Sloc : Source_Ptr;
- Discrete_Subtype_Definitions : List_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id;
- pragma Inline (Make_Constrained_Array_Definition);
-
- function Make_Discriminant_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Type : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Discriminant_Specification);
-
- function Make_Index_Or_Discriminant_Constraint (Sloc : Source_Ptr;
- Constraints : List_Id)
- return Node_Id;
- pragma Inline (Make_Index_Or_Discriminant_Constraint);
-
- function Make_Discriminant_Association (Sloc : Source_Ptr;
- Selector_Names : List_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Discriminant_Association);
-
- function Make_Record_Definition (Sloc : Source_Ptr;
- End_Label : Node_Id := Empty;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False;
- Component_List : Node_Id;
- Null_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Record_Definition);
-
- function Make_Component_List (Sloc : Source_Ptr;
- Component_Items : List_Id;
- Variant_Part : Node_Id := Empty;
- Null_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Component_List);
-
- function Make_Component_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Aliased_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Component_Declaration);
-
- function Make_Variant_Part (Sloc : Source_Ptr;
- Name : Node_Id;
- Variants : List_Id)
- return Node_Id;
- pragma Inline (Make_Variant_Part);
-
- function Make_Variant (Sloc : Source_Ptr;
- Discrete_Choices : List_Id;
- Component_List : Node_Id)
- return Node_Id;
- pragma Inline (Make_Variant);
-
- function Make_Others_Choice (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Others_Choice);
-
- function Make_Access_To_Object_Definition (Sloc : Source_Ptr;
- All_Present : Boolean := False;
- Subtype_Indication : Node_Id;
- Constant_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Access_To_Object_Definition);
-
- function Make_Access_Function_Definition (Sloc : Source_Ptr;
- Protected_Present : Boolean := False;
- Parameter_Specifications : List_Id := No_List;
- Subtype_Mark : Node_Id)
- return Node_Id;
- pragma Inline (Make_Access_Function_Definition);
-
- function Make_Access_Procedure_Definition (Sloc : Source_Ptr;
- Protected_Present : Boolean := False;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Access_Procedure_Definition);
-
- function Make_Access_Definition (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id)
- return Node_Id;
- pragma Inline (Make_Access_Definition);
-
- function Make_Incomplete_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Incomplete_Type_Declaration);
-
- function Make_Explicit_Dereference (Sloc : Source_Ptr;
- Prefix : Node_Id)
- return Node_Id;
- pragma Inline (Make_Explicit_Dereference);
-
- function Make_Indexed_Component (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Expressions : List_Id)
- return Node_Id;
- pragma Inline (Make_Indexed_Component);
-
- function Make_Slice (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Discrete_Range : Node_Id)
- return Node_Id;
- pragma Inline (Make_Slice);
-
- function Make_Selected_Component (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Selector_Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Selected_Component);
-
- function Make_Attribute_Reference (Sloc : Source_Ptr;
- Prefix : Node_Id;
- Attribute_Name : Name_Id;
- Expressions : List_Id := No_List;
- Must_Be_Byte_Aligned : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Attribute_Reference);
-
- function Make_Aggregate (Sloc : Source_Ptr;
- Expressions : List_Id := No_List;
- Component_Associations : List_Id := No_List;
- Null_Record_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Aggregate);
-
- function Make_Component_Association (Sloc : Source_Ptr;
- Choices : List_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Component_Association);
-
- function Make_Extension_Aggregate (Sloc : Source_Ptr;
- Ancestor_Part : Node_Id;
- Expressions : List_Id := No_List;
- Component_Associations : List_Id := No_List;
- Null_Record_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Extension_Aggregate);
-
- function Make_Null (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Null);
-
- function Make_And_Then (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_And_Then);
-
- function Make_Or_Else (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Or_Else);
-
- function Make_In (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_In);
-
- function Make_Not_In (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Not_In);
-
- function Make_Op_And (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_And);
-
- function Make_Op_Or (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Or);
-
- function Make_Op_Xor (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Xor);
-
- function Make_Op_Eq (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Eq);
-
- function Make_Op_Ne (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Ne);
-
- function Make_Op_Lt (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Lt);
-
- function Make_Op_Le (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Le);
-
- function Make_Op_Gt (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Gt);
-
- function Make_Op_Ge (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Ge);
-
- function Make_Op_Add (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Add);
-
- function Make_Op_Subtract (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Subtract);
-
- function Make_Op_Concat (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Concat);
-
- function Make_Op_Multiply (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Multiply);
-
- function Make_Op_Divide (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Divide);
-
- function Make_Op_Mod (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Mod);
-
- function Make_Op_Rem (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Rem);
-
- function Make_Op_Expon (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Expon);
-
- function Make_Op_Plus (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Plus);
-
- function Make_Op_Minus (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Minus);
-
- function Make_Op_Abs (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Abs);
-
- function Make_Op_Not (Sloc : Source_Ptr;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Not);
-
- function Make_Type_Conversion (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Type_Conversion);
-
- function Make_Qualified_Expression (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Qualified_Expression);
-
- function Make_Allocator (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Allocator);
-
- function Make_Null_Statement (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Null_Statement);
-
- function Make_Label (Sloc : Source_Ptr;
- Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Label);
-
- function Make_Assignment_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Assignment_Statement);
-
- function Make_If_Statement (Sloc : Source_Ptr;
- Condition : Node_Id;
- Then_Statements : List_Id;
- Elsif_Parts : List_Id := No_List;
- Else_Statements : List_Id := No_List;
- End_Span : Uint := No_Uint)
- return Node_Id;
- pragma Inline (Make_If_Statement);
-
- function Make_Elsif_Part (Sloc : Source_Ptr;
- Condition : Node_Id;
- Then_Statements : List_Id)
- return Node_Id;
- pragma Inline (Make_Elsif_Part);
-
- function Make_Case_Statement (Sloc : Source_Ptr;
- Expression : Node_Id;
- Alternatives : List_Id;
- End_Span : Uint := No_Uint)
- return Node_Id;
- pragma Inline (Make_Case_Statement);
-
- function Make_Case_Statement_Alternative (Sloc : Source_Ptr;
- Discrete_Choices : List_Id;
- Statements : List_Id)
- return Node_Id;
- pragma Inline (Make_Case_Statement_Alternative);
-
- function Make_Loop_Statement (Sloc : Source_Ptr;
- Identifier : Node_Id := Empty;
- Iteration_Scheme : Node_Id := Empty;
- Statements : List_Id;
- End_Label : Node_Id;
- Has_Created_Identifier : Boolean := False;
- Is_Null_Loop : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Loop_Statement);
-
- function Make_Iteration_Scheme (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Loop_Parameter_Specification : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Iteration_Scheme);
-
- function Make_Loop_Parameter_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Reverse_Present : Boolean := False;
- Discrete_Subtype_Definition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Loop_Parameter_Specification);
-
- function Make_Block_Statement (Sloc : Source_Ptr;
- Identifier : Node_Id := Empty;
- Declarations : List_Id := No_List;
- Handled_Statement_Sequence : Node_Id;
- Has_Created_Identifier : Boolean := False;
- Is_Task_Allocation_Block : Boolean := False;
- Is_Asynchronous_Call_Block : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Block_Statement);
-
- function Make_Exit_Statement (Sloc : Source_Ptr;
- Name : Node_Id := Empty;
- Condition : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Exit_Statement);
-
- function Make_Goto_Statement (Sloc : Source_Ptr;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Goto_Statement);
-
- function Make_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subprogram_Declaration);
-
- function Make_Abstract_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id;
- pragma Inline (Make_Abstract_Subprogram_Declaration);
-
- function Make_Function_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Parameter_Specifications : List_Id := No_List;
- Subtype_Mark : Node_Id)
- return Node_Id;
- pragma Inline (Make_Function_Specification);
-
- function Make_Procedure_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Procedure_Specification);
-
- function Make_Designator (Sloc : Source_Ptr;
- Name : Node_Id;
- Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Designator);
-
- function Make_Defining_Program_Unit_Name (Sloc : Source_Ptr;
- Name : Node_Id;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Defining_Program_Unit_Name);
-
- function Make_Operator_Symbol (Sloc : Source_Ptr;
- Chars : Name_Id;
- Strval : String_Id)
- return Node_Id;
- pragma Inline (Make_Operator_Symbol);
-
- function Make_Defining_Operator_Symbol (Sloc : Source_Ptr;
- Chars : Name_Id)
- return Node_Id;
- pragma Inline (Make_Defining_Operator_Symbol);
-
- function Make_Parameter_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- In_Present : Boolean := False;
- Out_Present : Boolean := False;
- Parameter_Type : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Parameter_Specification);
-
- function Make_Subprogram_Body (Sloc : Source_Ptr;
- Specification : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id;
- Bad_Is_Detected : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Subprogram_Body);
-
- function Make_Procedure_Call_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Procedure_Call_Statement);
-
- function Make_Function_Call (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Function_Call);
-
- function Make_Parameter_Association (Sloc : Source_Ptr;
- Selector_Name : Node_Id;
- Explicit_Actual_Parameter : Node_Id)
- return Node_Id;
- pragma Inline (Make_Parameter_Association);
-
- function Make_Return_Statement (Sloc : Source_Ptr;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Return_Statement);
-
- function Make_Package_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id;
- pragma Inline (Make_Package_Declaration);
-
- function Make_Package_Specification (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id;
- pragma Inline (Make_Package_Specification);
-
- function Make_Package_Body (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Package_Body);
-
- function Make_Private_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Private_Type_Declaration);
-
- function Make_Private_Extension_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False;
- Abstract_Present : Boolean := False;
- Subtype_Indication : Node_Id)
- return Node_Id;
- pragma Inline (Make_Private_Extension_Declaration);
-
- function Make_Use_Package_Clause (Sloc : Source_Ptr;
- Names : List_Id)
- return Node_Id;
- pragma Inline (Make_Use_Package_Clause);
-
- function Make_Use_Type_Clause (Sloc : Source_Ptr;
- Subtype_Marks : List_Id)
- return Node_Id;
- pragma Inline (Make_Use_Type_Clause);
-
- function Make_Object_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Subtype_Mark : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Object_Renaming_Declaration);
-
- function Make_Exception_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Exception_Renaming_Declaration);
-
- function Make_Package_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Package_Renaming_Declaration);
-
- function Make_Subprogram_Renaming_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subprogram_Renaming_Declaration);
-
- function Make_Generic_Package_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Package_Renaming_Declaration);
-
- function Make_Generic_Procedure_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Procedure_Renaming_Declaration);
-
- function Make_Generic_Function_Renaming_Declaration (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Function_Renaming_Declaration);
-
- function Make_Task_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Task_Definition : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Task_Type_Declaration);
-
- function Make_Single_Task_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Task_Definition : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Single_Task_Declaration);
-
- function Make_Task_Definition (Sloc : Source_Ptr;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id;
- pragma Inline (Make_Task_Definition);
-
- function Make_Task_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id)
- return Node_Id;
- pragma Inline (Make_Task_Body);
-
- function Make_Protected_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Protected_Definition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Protected_Type_Declaration);
-
- function Make_Single_Protected_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Protected_Definition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Single_Protected_Declaration);
-
- function Make_Protected_Definition (Sloc : Source_Ptr;
- Visible_Declarations : List_Id;
- Private_Declarations : List_Id := No_List;
- End_Label : Node_Id)
- return Node_Id;
- pragma Inline (Make_Protected_Definition);
-
- function Make_Protected_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Declarations : List_Id;
- End_Label : Node_Id)
- return Node_Id;
- pragma Inline (Make_Protected_Body);
-
- function Make_Entry_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discrete_Subtype_Definition : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Entry_Declaration);
-
- function Make_Accept_Statement (Sloc : Source_Ptr;
- Entry_Direct_Name : Node_Id;
- Entry_Index : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List;
- Handled_Statement_Sequence : Node_Id;
- Declarations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Accept_Statement);
-
- function Make_Entry_Body (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Entry_Body_Formal_Part : Node_Id;
- Declarations : List_Id;
- Handled_Statement_Sequence : Node_Id)
- return Node_Id;
- pragma Inline (Make_Entry_Body);
-
- function Make_Entry_Body_Formal_Part (Sloc : Source_Ptr;
- Entry_Index_Specification : Node_Id := Empty;
- Parameter_Specifications : List_Id := No_List;
- Condition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Entry_Body_Formal_Part);
-
- function Make_Entry_Index_Specification (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Discrete_Subtype_Definition : Node_Id)
- return Node_Id;
- pragma Inline (Make_Entry_Index_Specification);
-
- function Make_Entry_Call_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Parameter_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Entry_Call_Statement);
-
- function Make_Requeue_Statement (Sloc : Source_Ptr;
- Name : Node_Id;
- Abort_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Requeue_Statement);
-
- function Make_Delay_Until_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Delay_Until_Statement);
-
- function Make_Delay_Relative_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Delay_Relative_Statement);
-
- function Make_Selective_Accept (Sloc : Source_Ptr;
- Select_Alternatives : List_Id;
- Else_Statements : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Selective_Accept);
-
- function Make_Accept_Alternative (Sloc : Source_Ptr;
- Accept_Statement : Node_Id;
- Condition : Node_Id := Empty;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Accept_Alternative);
-
- function Make_Delay_Alternative (Sloc : Source_Ptr;
- Delay_Statement : Node_Id;
- Condition : Node_Id := Empty;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Delay_Alternative);
-
- function Make_Terminate_Alternative (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Pragmas_Before : List_Id := No_List;
- Pragmas_After : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Terminate_Alternative);
-
- function Make_Timed_Entry_Call (Sloc : Source_Ptr;
- Entry_Call_Alternative : Node_Id;
- Delay_Alternative : Node_Id)
- return Node_Id;
- pragma Inline (Make_Timed_Entry_Call);
-
- function Make_Entry_Call_Alternative (Sloc : Source_Ptr;
- Entry_Call_Statement : Node_Id;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Entry_Call_Alternative);
-
- function Make_Conditional_Entry_Call (Sloc : Source_Ptr;
- Entry_Call_Alternative : Node_Id;
- Else_Statements : List_Id)
- return Node_Id;
- pragma Inline (Make_Conditional_Entry_Call);
-
- function Make_Asynchronous_Select (Sloc : Source_Ptr;
- Triggering_Alternative : Node_Id;
- Abortable_Part : Node_Id)
- return Node_Id;
- pragma Inline (Make_Asynchronous_Select);
-
- function Make_Triggering_Alternative (Sloc : Source_Ptr;
- Triggering_Statement : Node_Id;
- Statements : List_Id := Empty_List;
- Pragmas_Before : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Triggering_Alternative);
-
- function Make_Abortable_Part (Sloc : Source_Ptr;
- Statements : List_Id)
- return Node_Id;
- pragma Inline (Make_Abortable_Part);
-
- function Make_Abort_Statement (Sloc : Source_Ptr;
- Names : List_Id)
- return Node_Id;
- pragma Inline (Make_Abort_Statement);
-
- function Make_Compilation_Unit (Sloc : Source_Ptr;
- Context_Items : List_Id;
- Private_Present : Boolean := False;
- Unit : Node_Id;
- Aux_Decls_Node : Node_Id)
- return Node_Id;
- pragma Inline (Make_Compilation_Unit);
-
- function Make_Compilation_Unit_Aux (Sloc : Source_Ptr;
- Declarations : List_Id := No_List;
- Actions : List_Id := No_List;
- Pragmas_After : List_Id := No_List;
- Config_Pragmas : List_Id := Empty_List)
- return Node_Id;
- pragma Inline (Make_Compilation_Unit_Aux);
-
- function Make_With_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- First_Name : Boolean := True;
- Last_Name : Boolean := True;
- Limited_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_With_Clause);
-
- function Make_With_Type_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- Tagged_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_With_Type_Clause);
-
- function Make_Subprogram_Body_Stub (Sloc : Source_Ptr;
- Specification : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subprogram_Body_Stub);
-
- function Make_Package_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Package_Body_Stub);
-
- function Make_Task_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Task_Body_Stub);
-
- function Make_Protected_Body_Stub (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Protected_Body_Stub);
-
- function Make_Subunit (Sloc : Source_Ptr;
- Name : Node_Id;
- Proper_Body : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subunit);
-
- function Make_Exception_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Exception_Declaration);
-
- function Make_Handled_Sequence_Of_Statements (Sloc : Source_Ptr;
- Statements : List_Id;
- End_Label : Node_Id := Empty;
- Exception_Handlers : List_Id := No_List;
- At_End_Proc : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Handled_Sequence_Of_Statements);
-
- function Make_Exception_Handler (Sloc : Source_Ptr;
- Choice_Parameter : Node_Id := Empty;
- Exception_Choices : List_Id;
- Statements : List_Id)
- return Node_Id;
- pragma Inline (Make_Exception_Handler);
-
- function Make_Raise_Statement (Sloc : Source_Ptr;
- Name : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Raise_Statement);
-
- function Make_Generic_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Generic_Formal_Declarations : List_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Subprogram_Declaration);
-
- function Make_Generic_Package_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Generic_Formal_Declarations : List_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Package_Declaration);
-
- function Make_Package_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Package_Instantiation);
-
- function Make_Procedure_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Procedure_Instantiation);
-
- function Make_Function_Instantiation (Sloc : Source_Ptr;
- Defining_Unit_Name : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Function_Instantiation);
-
- function Make_Generic_Association (Sloc : Source_Ptr;
- Selector_Name : Node_Id := Empty;
- Explicit_Generic_Actual_Parameter : Node_Id)
- return Node_Id;
- pragma Inline (Make_Generic_Association);
-
- function Make_Formal_Object_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- In_Present : Boolean := False;
- Out_Present : Boolean := False;
- Subtype_Mark : Node_Id;
- Expression : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Formal_Object_Declaration);
-
- function Make_Formal_Type_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Formal_Type_Definition : Node_Id;
- Discriminant_Specifications : List_Id := No_List;
- Unknown_Discriminants_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Formal_Type_Declaration);
-
- function Make_Formal_Private_Type_Definition (Sloc : Source_Ptr;
- Abstract_Present : Boolean := False;
- Tagged_Present : Boolean := False;
- Limited_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Formal_Private_Type_Definition);
-
- function Make_Formal_Derived_Type_Definition (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Private_Present : Boolean := False;
- Abstract_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Formal_Derived_Type_Definition);
-
- function Make_Formal_Discrete_Type_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Discrete_Type_Definition);
-
- function Make_Formal_Signed_Integer_Type_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Signed_Integer_Type_Definition);
-
- function Make_Formal_Modular_Type_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Modular_Type_Definition);
-
- function Make_Formal_Floating_Point_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Floating_Point_Definition);
-
- function Make_Formal_Ordinary_Fixed_Point_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Ordinary_Fixed_Point_Definition);
-
- function Make_Formal_Decimal_Fixed_Point_Definition (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Formal_Decimal_Fixed_Point_Definition);
-
- function Make_Formal_Subprogram_Declaration (Sloc : Source_Ptr;
- Specification : Node_Id;
- Default_Name : Node_Id := Empty;
- Box_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Formal_Subprogram_Declaration);
-
- function Make_Formal_Package_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id;
- Name : Node_Id;
- Generic_Associations : List_Id := No_List;
- Box_Present : Boolean := False)
- return Node_Id;
- pragma Inline (Make_Formal_Package_Declaration);
-
- function Make_Attribute_Definition_Clause (Sloc : Source_Ptr;
- Name : Node_Id;
- Chars : Name_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Attribute_Definition_Clause);
-
- function Make_Enumeration_Representation_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Array_Aggregate : Node_Id)
- return Node_Id;
- pragma Inline (Make_Enumeration_Representation_Clause);
-
- function Make_Record_Representation_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Mod_Clause : Node_Id := Empty;
- Component_Clauses : List_Id)
- return Node_Id;
- pragma Inline (Make_Record_Representation_Clause);
-
- function Make_Component_Clause (Sloc : Source_Ptr;
- Component_Name : Node_Id;
- Position : Node_Id;
- First_Bit : Node_Id;
- Last_Bit : Node_Id)
- return Node_Id;
- pragma Inline (Make_Component_Clause);
-
- function Make_Code_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Code_Statement);
-
- function Make_Op_Rotate_Left (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Rotate_Left);
-
- function Make_Op_Rotate_Right (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Rotate_Right);
-
- function Make_Op_Shift_Left (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Shift_Left);
-
- function Make_Op_Shift_Right_Arithmetic (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Shift_Right_Arithmetic);
-
- function Make_Op_Shift_Right (Sloc : Source_Ptr;
- Left_Opnd : Node_Id;
- Right_Opnd : Node_Id)
- return Node_Id;
- pragma Inline (Make_Op_Shift_Right);
-
- function Make_Delta_Constraint (Sloc : Source_Ptr;
- Delta_Expression : Node_Id;
- Range_Constraint : Node_Id := Empty)
- return Node_Id;
- pragma Inline (Make_Delta_Constraint);
-
- function Make_At_Clause (Sloc : Source_Ptr;
- Identifier : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_At_Clause);
-
- function Make_Mod_Clause (Sloc : Source_Ptr;
- Expression : Node_Id;
- Pragmas_Before : List_Id)
- return Node_Id;
- pragma Inline (Make_Mod_Clause);
-
- function Make_Conditional_Expression (Sloc : Source_Ptr;
- Expressions : List_Id)
- return Node_Id;
- pragma Inline (Make_Conditional_Expression);
-
- function Make_Expanded_Name (Sloc : Source_Ptr;
- Chars : Name_Id;
- Prefix : Node_Id;
- Selector_Name : Node_Id)
- return Node_Id;
- pragma Inline (Make_Expanded_Name);
-
- function Make_Free_Statement (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Free_Statement);
-
- function Make_Freeze_Entity (Sloc : Source_Ptr;
- Actions : List_Id := No_List)
- return Node_Id;
- pragma Inline (Make_Freeze_Entity);
-
- function Make_Implicit_Label_Declaration (Sloc : Source_Ptr;
- Defining_Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Implicit_Label_Declaration);
-
- function Make_Itype_Reference (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Itype_Reference);
-
- function Make_Raise_Constraint_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id;
- pragma Inline (Make_Raise_Constraint_Error);
-
- function Make_Raise_Program_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id;
- pragma Inline (Make_Raise_Program_Error);
-
- function Make_Raise_Storage_Error (Sloc : Source_Ptr;
- Condition : Node_Id := Empty;
- Reason : Uint)
- return Node_Id;
- pragma Inline (Make_Raise_Storage_Error);
-
- function Make_Reference (Sloc : Source_Ptr;
- Prefix : Node_Id)
- return Node_Id;
- pragma Inline (Make_Reference);
-
- function Make_Subprogram_Info (Sloc : Source_Ptr;
- Identifier : Node_Id)
- return Node_Id;
- pragma Inline (Make_Subprogram_Info);
-
- function Make_Unchecked_Expression (Sloc : Source_Ptr;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Unchecked_Expression);
-
- function Make_Unchecked_Type_Conversion (Sloc : Source_Ptr;
- Subtype_Mark : Node_Id;
- Expression : Node_Id)
- return Node_Id;
- pragma Inline (Make_Unchecked_Type_Conversion);
-
- function Make_Validate_Unchecked_Conversion (Sloc : Source_Ptr)
- return Node_Id;
- pragma Inline (Make_Validate_Unchecked_Conversion);
-
-end Nmake;
diff --git a/gcc/ada/opt.adb b/gcc/ada/opt.adb
index cce9b1e87aa..be1eca67bcd 100644
--- a/gcc/ada/opt.adb
+++ b/gcc/ada/opt.adb
@@ -186,6 +186,7 @@ package body Opt is
----------------
procedure Tree_Write is
+ Version_String : String := Gnat_Version_String;
begin
Tree_Write_Int (ASIS_Version_Number);
Tree_Write_Bool (Brief_Output);
@@ -202,9 +203,9 @@ package body Opt is
Tree_Write_Bool (Assertions_Enabled);
Tree_Write_Bool (Enable_Overflow_Checks);
Tree_Write_Bool (Full_List);
- Tree_Write_Int (Int (Gnat_Version_String'Length));
- Tree_Write_Data (Gnat_Version_String'Address,
- Gnat_Version_String'Length);
+ Tree_Write_Int (Int (Version_String'Length));
+ Tree_Write_Data (Version_String'Address,
+ Version_String'Length);
Tree_Write_Data (Distribution_Stub_Mode'Address,
Distribution_Stub_Mode_Type'Object_Size / Storage_Unit);
Tree_Write_Bool (Immediate_Errors);
diff --git a/gcc/ada/opt.ads b/gcc/ada/opt.ads
index 356ed026927..356564a12ab 100644
--- a/gcc/ada/opt.ads
+++ b/gcc/ada/opt.ads
@@ -719,6 +719,11 @@ package Opt is
-- Set to True to enable output of generated code in source form. This
-- flag is set by the -gnatG switch.
+ Print_Standard : Boolean := False;
+ -- GNAT
+ -- Set to true to enable printing of package standard in source form.
+ -- This flag is set by the -gnatS switch
+
Propagate_Exceptions : Boolean := False;
-- GNAT
-- Indicates if subprogram descriptor exception tables should be
diff --git a/gcc/ada/osint.adb b/gcc/ada/osint.adb
index 88fcd3fd94e..1bd39c4ea66 100644
--- a/gcc/ada/osint.adb
+++ b/gcc/ada/osint.adb
@@ -24,12 +24,13 @@
-- --
------------------------------------------------------------------------------
-with Fmap; use Fmap;
+with Fmap; use Fmap;
with Hostparm;
-with Namet; use Namet;
-with Opt; use Opt;
-with Output; use Output;
-with Sdefault; use Sdefault;
+with Namet; use Namet;
+with Opt; use Opt;
+with Output; use Output;
+with Sdefault; use Sdefault;
+with System.Case_Util; use System.Case_Util;
with Table;
with Unchecked_Conversion;
@@ -40,7 +41,19 @@ with GNAT.HTable;
package body Osint is
Running_Program : Program_Type := Unspecified;
- Program_Set : Boolean := False;
+ -- comment required here ???
+
+ Program_Set : Boolean := False;
+ -- comment required here ???
+
+ Std_Prefix : String_Ptr;
+ -- Standard prefix, computed dynamically the first time Relocate_Path
+ -- is called, and cached for subsequent calls.
+
+ Empty : aliased String := "";
+ No_Dir : constant String_Ptr := Empty'Access;
+ -- Used in Locate_File as a fake directory when Name is already an
+ -- absolute path.
-------------------------------------
-- Use of Name_Find and Name_Enter --
@@ -61,8 +74,7 @@ package body Osint is
function Append_Suffix_To_File_Name
(Name : Name_Id;
- Suffix : String)
- return Name_Id;
+ Suffix : String) return Name_Id;
-- Appends Suffix to Name and returns the new name.
function OS_Time_To_GNAT_Time (T : OS_Time) return Time_Stamp_Type;
@@ -71,11 +83,19 @@ package body Osint is
function Concat (String_One : String; String_Two : String) return String;
-- Concatenates 2 strings and returns the result of the concatenation
+ function Executable_Prefix return String_Ptr;
+ -- Returns the name of the root directory where the executable is stored.
+ -- The executable must be located in a directory called "bin", or
+ -- under root/lib/gcc-lib/..., or under root/libexec/gcc/... Thus, if
+ -- the executable is stored in directory "/foo/bar/bin", this routine
+ -- returns "/foo/bar/". Return "" if the location is not recognized
+ -- as described above.
+
function Update_Path (Path : String_Ptr) return String_Ptr;
-- Update the specified path to replace the prefix with the location
-- where GNAT is installed. See the file prefix.c in GCC for details.
- procedure Write_With_Check (A : Address; N : Integer);
+ procedure Write_With_Check (A : Address; N : Integer);
-- Writes N bytes from buffer starting at address A to file whose FD is
-- stored in Output_FD, and whose file name is stored as a File_Name_Type
-- in Output_File_Name. A check is made for disk full, and if this is
@@ -86,8 +106,7 @@ package body Osint is
(N : File_Name_Type;
T : File_Type;
Dir : Natural;
- Name : String)
- return File_Name_Type;
+ Name : String) return File_Name_Type;
-- See if the file N whose name is Name exists in directory Dir. Dir is
-- an index into the Lib_Search_Directories table if T = Library.
-- Otherwise if T = Source, Dir is an index into the
@@ -99,8 +118,7 @@ package body Osint is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access;
+ Path_Len : Integer) return String_Access;
-- Converts a C String to an Ada String. Are we doing this to avoid
-- withing Interfaces.C.Strings ???
@@ -205,17 +223,15 @@ package body Osint is
Equal => "=");
function Smart_Find_File
- (N : File_Name_Type;
- T : File_Type)
- return File_Name_Type;
+ (N : File_Name_Type;
+ T : File_Type) return File_Name_Type;
-- Exactly like Find_File except that if File_Cache_Enabled is True this
-- routine looks first in the hash table to see if the full name of the
-- file is already available.
function Smart_File_Stamp
- (N : File_Name_Type;
- T : File_Type)
- return Time_Stamp_Type;
+ (N : File_Name_Type;
+ T : File_Type) return Time_Stamp_Type;
-- Takes the same parameter as the routine above (N is a file name
-- without any prefix directory information) and behaves like File_Stamp
-- except that if File_Cache_Enabled is True this routine looks first in
@@ -578,8 +594,7 @@ package body Osint is
function Append_Suffix_To_File_Name
(Name : Name_Id;
- Suffix : String)
- return Name_Id
+ Suffix : String) return Name_Id
is
begin
Get_Name_String (Name);
@@ -735,6 +750,63 @@ package body Osint is
return Name_Enter;
end Executable_Name;
+ -------------------------
+ -- Executable_Prefix --
+ -------------------------
+
+ function Executable_Prefix return String_Ptr is
+ Exec_Name : String (1 .. Len_Arg (0));
+
+ function Get_Install_Dir (Exec : String) return String_Ptr;
+ -- S is the executable name preceeded by the absolute or relative
+ -- path, e.g. "c:\usr\bin\gcc.exe" or "..\bin\gcc".
+
+ ---------------------
+ -- Get_Install_Dir --
+ ---------------------
+
+ function Get_Install_Dir (Exec : String) return String_Ptr is
+ begin
+ for J in reverse Exec'Range loop
+ if Is_Directory_Separator (Exec (J)) then
+ if J < Exec'Last - 5 then
+ if (To_Lower (Exec (J + 1)) = 'l'
+ and then To_Lower (Exec (J + 2)) = 'i'
+ and then To_Lower (Exec (J + 3)) = 'b')
+ or else
+ (To_Lower (Exec (J + 1)) = 'b'
+ and then To_Lower (Exec (J + 2)) = 'i'
+ and then To_Lower (Exec (J + 3)) = 'n')
+ then
+ return new String'(Exec (Exec'First .. J));
+ end if;
+ end if;
+ end if;
+ end loop;
+
+ return new String'("");
+ end Get_Install_Dir;
+
+ -- Start of processing for Executable_Prefix
+
+ begin
+ Osint.Fill_Arg (Exec_Name'Address, 0);
+
+ -- First determine if a path prefix was placed in front of the
+ -- executable name.
+
+ for J in reverse Exec_Name'Range loop
+ if Is_Directory_Separator (Exec_Name (J)) then
+ return Get_Install_Dir (Exec_Name);
+ end if;
+ end loop;
+
+ -- If we come here, the user has typed the executable name with no
+ -- directory prefix.
+
+ return Get_Install_Dir (GNAT.OS_Lib.Locate_Exec_On_Path (Exec_Name).all);
+ end Executable_Prefix;
+
------------------
-- Exit_Program --
------------------
@@ -820,9 +892,8 @@ package body Osint is
---------------
function Find_File
- (N : File_Name_Type;
- T : File_Type)
- return File_Name_Type
+ (N : File_Name_Type;
+ T : File_Type) return File_Name_Type
is
begin
Get_Name_String (N);
@@ -1019,8 +1090,7 @@ package body Osint is
-- call to Get_Next_Dir_In_Path_Init, updated by Get_Next_Dir_In_Path.
function Get_Next_Dir_In_Path
- (Search_Path : String_Access)
- return String_Access
+ (Search_Path : String_Access) return String_Access
is
Lower_Bound : Positive := Search_Path_Pos;
Upper_Bound : Positive;
@@ -1073,8 +1143,7 @@ package body Osint is
function Get_RTS_Search_Dir
(Search_Dir : String;
- File_Type : Search_File_Type)
- return String_Ptr
+ File_Type : Search_File_Type) return String_Ptr
is
procedure Get_Current_Dir
(Dir : System.Address;
@@ -1229,6 +1298,28 @@ package body Osint is
end if;
end Get_RTS_Search_Dir;
+ --------------------------------
+ -- Include_Dir_Default_Prefix --
+ --------------------------------
+
+ function Include_Dir_Default_Prefix return String is
+ Include_Dir : String_Access :=
+ String_Access (Update_Path (Include_Dir_Default_Name));
+
+ begin
+ if Include_Dir = null then
+ return "";
+
+ else
+ declare
+ Result : constant String := Include_Dir.all;
+ begin
+ Free (Include_Dir);
+ return Result;
+ end;
+ end if;
+ end Include_Dir_Default_Prefix;
+
----------------
-- Initialize --
----------------
@@ -1339,13 +1430,17 @@ package body Osint is
(N : File_Name_Type;
T : File_Type;
Dir : Natural;
- Name : String)
- return File_Name_Type
+ Name : String) return File_Name_Type
is
Dir_Name : String_Ptr;
begin
- if T = Library then
+ -- If Name is already an absolute path, do not look for a directory
+
+ if Is_Absolute_Path (Name) then
+ Dir_Name := No_Dir;
+
+ elsif T = Library then
Dir_Name := Lib_Search_Directories.Table (Dir);
else pragma Assert (T /= Config);
@@ -1381,9 +1476,8 @@ package body Osint is
-------------------------------
function Matching_Full_Source_Name
- (N : File_Name_Type;
- T : Time_Stamp_Type)
- return File_Name_Type
+ (N : File_Name_Type;
+ T : Time_Stamp_Type) return File_Name_Type
is
begin
Get_Name_String (N);
@@ -1610,6 +1704,28 @@ package body Osint is
return Number_File_Names;
end Number_Of_Files;
+ -------------------------------
+ -- Object_Dir_Default_Prefix --
+ -------------------------------
+
+ function Object_Dir_Default_Prefix return String is
+ Object_Dir : String_Access :=
+ String_Access (Update_Path (Object_Dir_Default_Name));
+
+ begin
+ if Object_Dir = null then
+ return "";
+
+ else
+ declare
+ Result : constant String := Object_Dir.all;
+ begin
+ Free (Object_Dir);
+ return Result;
+ end;
+ end if;
+ end Object_Dir_Default_Prefix;
+
----------------------
-- Object_File_Name --
----------------------
@@ -1698,8 +1814,7 @@ package body Osint is
function Read_Default_Search_Dirs
(Search_Dir_Prefix : String_Access;
Search_File : String_Access;
- Search_Dir_Default_Name : String_Access)
- return String_Access
+ Search_Dir_Default_Name : String_Access) return String_Access
is
Prefix_Len : constant Integer := Search_Dir_Prefix.all'Length;
Buffer : String (1 .. Prefix_Len + Search_File.all'Length + 1);
@@ -1818,8 +1933,7 @@ package body Osint is
function Read_Library_Info
(Lib_File : File_Name_Type;
- Fatal_Err : Boolean := False)
- return Text_Buffer_Ptr
+ Fatal_Err : Boolean := False) return Text_Buffer_Ptr
is
Lib_FD : File_Descriptor;
-- The file descriptor for the current library file. A negative value
@@ -2074,6 +2188,44 @@ package body Osint is
end Read_Source_File;
+ -------------------
+ -- Relocate_Path --
+ -------------------
+
+ function Relocate_Path
+ (Prefix : String;
+ Path : String) return String_Ptr
+ is
+ S : String_Ptr;
+
+ procedure set_std_prefix (S : String; Len : Integer);
+ pragma Import (C, set_std_prefix);
+
+ begin
+ if Std_Prefix = null then
+ Std_Prefix := Executable_Prefix;
+
+ if Std_Prefix.all /= "" then
+ -- Remove trailing directory separator when calling set_std_prefix
+
+ set_std_prefix (Std_Prefix.all, Std_Prefix'Length - 1);
+ end if;
+ end if;
+
+ if Path (Prefix'Range) = Prefix then
+ if Std_Prefix.all /= "" then
+ S := new String
+ (1 .. Std_Prefix'Length + Path'Last - Prefix'Last);
+ S (1 .. Std_Prefix'Length) := Std_Prefix.all;
+ S (Std_Prefix'Length + 1 .. S'Last) :=
+ Path (Prefix'Last + 1 .. Path'Last);
+ return S;
+ end if;
+ end if;
+
+ return new String'(Path);
+ end Relocate_Path;
+
-----------------
-- Set_Program --
-----------------
@@ -2093,9 +2245,8 @@ package body Osint is
----------------------
function Smart_File_Stamp
- (N : File_Name_Type;
- T : File_Type)
- return Time_Stamp_Type
+ (N : File_Name_Type;
+ T : File_Type) return Time_Stamp_Type
is
Time_Stamp : Time_Stamp_Type;
@@ -2120,8 +2271,7 @@ package body Osint is
function Smart_Find_File
(N : File_Name_Type;
- T : File_Type)
- return File_Name_Type
+ T : File_Type) return File_Name_Type
is
Full_File_Name : File_Name_Type;
@@ -2212,13 +2362,11 @@ package body Osint is
function To_Canonical_Dir_Spec
(Host_Dir : String;
- Prefix_Style : Boolean)
- return String_Access
+ Prefix_Style : Boolean) return String_Access
is
function To_Canonical_Dir_Spec
(Host_Dir : Address;
- Prefix_Flag : Integer)
- return Address;
+ Prefix_Flag : Integer) return Address;
pragma Import (C, To_Canonical_Dir_Spec, "__gnat_to_canonical_dir_spec");
C_Host_Dir : String (1 .. Host_Dir'Length + 1);
@@ -2254,13 +2402,11 @@ package body Osint is
function To_Canonical_File_List
(Wildcard_Host_File : String;
- Only_Dirs : Boolean)
- return String_Access_List_Access
+ Only_Dirs : Boolean) return String_Access_List_Access
is
function To_Canonical_File_List_Init
(Host_File : Address;
- Only_Dirs : Integer)
- return Integer;
+ Only_Dirs : Integer) return Integer;
pragma Import (C, To_Canonical_File_List_Init,
"__gnat_to_canonical_file_list_init");
@@ -2313,8 +2459,7 @@ package body Osint is
----------------------------
function To_Canonical_File_Spec
- (Host_File : String)
- return String_Access
+ (Host_File : String) return String_Access
is
function To_Canonical_File_Spec (Host_File : Address) return Address;
pragma Import
@@ -2349,8 +2494,7 @@ package body Osint is
----------------------------
function To_Canonical_Path_Spec
- (Host_Path : String)
- return String_Access
+ (Host_Path : String) return String_Access
is
function To_Canonical_Path_Spec (Host_Path : Address) return Address;
pragma Import
@@ -2384,13 +2528,11 @@ package body Osint is
function To_Host_Dir_Spec
(Canonical_Dir : String;
- Prefix_Style : Boolean)
- return String_Access
+ Prefix_Style : Boolean) return String_Access
is
function To_Host_Dir_Spec
(Canonical_Dir : Address;
- Prefix_Flag : Integer)
- return Address;
+ Prefix_Flag : Integer) return Address;
pragma Import (C, To_Host_Dir_Spec, "__gnat_to_host_dir_spec");
C_Canonical_Dir : String (1 .. Canonical_Dir'Length + 1);
@@ -2420,8 +2562,7 @@ package body Osint is
----------------------------
function To_Host_File_Spec
- (Canonical_File : String)
- return String_Access
+ (Canonical_File : String) return String_Access
is
function To_Host_File_Spec (Canonical_File : Address) return Address;
pragma Import (C, To_Host_File_Spec, "__gnat_to_host_file_spec");
@@ -2451,8 +2592,7 @@ package body Osint is
function To_Path_String_Access
(Path_Addr : Address;
- Path_Len : Integer)
- return String_Access
+ Path_Len : Integer) return String_Access
is
subtype Path_String is String (1 .. Path_Len);
type Path_String_Access is access Path_String;
@@ -2493,7 +2633,7 @@ package body Osint is
In_Length : constant Integer := Path'Length;
In_String : String (1 .. In_Length + 1);
- Component_Name : aliased String := "GNAT" & ASCII.NUL;
+ Component_Name : aliased String := "GCC" & ASCII.NUL;
Result_Ptr : Address;
Result_Length : Integer;
Out_String : String_Ptr;
diff --git a/gcc/ada/osint.ads b/gcc/ada/osint.ads
index ba586222675..18e261039dc 100644
--- a/gcc/ada/osint.ads
+++ b/gcc/ada/osint.ads
@@ -202,10 +202,29 @@ package Osint is
return String_Access;
-- Convert a canonical syntax file specification to host syntax.
+ function Relocate_Path
+ (Prefix : String;
+ Path : String) return String_Ptr;
+ -- Given an absolute path and a prefix, if Path starts with Prefix,
+ -- replace the Prefix substring with the root installation directory.
+ -- By default, try to compute the root installation directory by looking
+ -- at the executable name as it was typed on the command line and, if
+ -- needed, use the PATH environment variable.
+ -- If the above computation fails, return Path.
+ -- This function assumes that Prefix'First = Path'First
+
-------------------------
-- Search Dir Routines --
-------------------------
+ function Include_Dir_Default_Prefix return String;
+ -- Return the directory of the run-time library sources, as modified
+ -- by update_path.
+
+ function Object_Dir_Default_Prefix return String;
+ -- Return the directory of the run-time library ALI and object files, as
+ -- modified by update_path.
+
procedure Add_Default_Search_Dirs;
-- This routine adds the default search dirs indicated by the
-- environment variables and sdefault package.
diff --git a/gcc/ada/output.adb b/gcc/ada/output.adb
index 78f80f45c6f..ea52af636bf 100644
--- a/gcc/ada/output.adb
+++ b/gcc/ada/output.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -236,10 +236,12 @@ package body Output is
procedure Write_Char (C : Character) is
begin
- if Next_Column < Buffer'Length then
- Buffer (Natural (Next_Column)) := C;
- Next_Column := Next_Column + 1;
+ if Next_Column = Buffer'Length then
+ Write_Eol;
end if;
+
+ Buffer (Natural (Next_Column)) := C;
+ Next_Column := Next_Column + 1;
end Write_Char;
---------------
diff --git a/gcc/ada/par-ch10.adb b/gcc/ada/par-ch10.adb
index 00cbd9b1569..8066aa77b96 100644
--- a/gcc/ada/par-ch10.adb
+++ b/gcc/ada/par-ch10.adb
@@ -300,9 +300,14 @@ package body Ch10 is
Append_List (P_Context_Clause, Context_Items (Comp_Unit_Node));
else
- Error_Msg_SC ("compilation unit expected");
- Cunit_Error_Flag := True;
- Resync_Cunit;
+ if Operating_Mode = Check_Syntax and then Token = Tok_EOF then
+ Error_Msg_SC ("?file contains no compilation units");
+
+ else
+ Error_Msg_SC ("compilation unit expected");
+ Cunit_Error_Flag := True;
+ Resync_Cunit;
+ end if;
-- If we are at an end of file, then just quit, the above error
-- message was complaint enough.
@@ -777,7 +782,7 @@ package body Ch10 is
-- Processing for WITH clause
- -- First check for LIMITED WITH
+ -- Ada0Y (AI-50217): First check for LIMITED WITH
if Token = Tok_Limited then
Has_Limited := True;
diff --git a/gcc/ada/par-ch12.adb b/gcc/ada/par-ch12.adb
index 2b9adaf73ae..2880fe43678 100644
--- a/gcc/ada/par-ch12.adb
+++ b/gcc/ada/par-ch12.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -367,12 +367,12 @@ package body Ch12 is
-- bother to check for it being exceeded.
begin
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
@@ -873,7 +873,7 @@ package body Ch12 is
begin
Def_Node := New_Node (N_Formal_Package_Declaration, Prev_Token_Ptr);
Scan; -- past PACKAGE
- Set_Defining_Identifier (Def_Node, P_Defining_Identifier);
+ Set_Defining_Identifier (Def_Node, P_Defining_Identifier (C_Is));
T_Is;
T_New;
Set_Name (Def_Node, P_Qualified_Simple_Name);
diff --git a/gcc/ada/par-ch13.adb b/gcc/ada/par-ch13.adb
index cfcc3807fc0..7a7e4798a85 100644
--- a/gcc/ada/par-ch13.adb
+++ b/gcc/ada/par-ch13.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2001 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -92,7 +92,7 @@ package body Ch13 is
-- Note that the name in a representation clause is always a simple
-- name, even in the attribute case, see AI-300 which made this so!
- Identifier_Node := P_Identifier;
+ Identifier_Node := P_Identifier (C_Use);
-- Check case of qualified name to give good error message
diff --git a/gcc/ada/par-ch2.adb b/gcc/ada/par-ch2.adb
index 7064c5df578..dd58e1f9cdc 100644
--- a/gcc/ada/par-ch2.adb
+++ b/gcc/ada/par-ch2.adb
@@ -47,7 +47,7 @@ package body Ch2 is
-- Error recovery: can raise Error_Resync (cannot return Error)
- function P_Identifier return Node_Id is
+ function P_Identifier (C : Id_Check := None) return Node_Id is
Ident_Node : Node_Id;
begin
@@ -61,7 +61,7 @@ package body Ch2 is
-- If we have a reserved identifier, manufacture an identifier with
-- a corresponding name after posting an appropriate error message
- elsif Is_Reserved_Identifier then
+ elsif Is_Reserved_Identifier (C) then
Scan_Reserved_Identifier (Force_Msg => False);
Ident_Node := Token_Node;
Scan; -- past the node
diff --git a/gcc/ada/par-ch3.adb b/gcc/ada/par-ch3.adb
index df156b93c05..8236c5897d7 100644
--- a/gcc/ada/par-ch3.adb
+++ b/gcc/ada/par-ch3.adb
@@ -164,7 +164,7 @@ package body Ch3 is
-- Error recovery: can raise Error_Resync
- function P_Defining_Identifier return Node_Id is
+ function P_Defining_Identifier (C : Id_Check := None) return Node_Id is
Ident_Node : Node_Id;
begin
@@ -179,7 +179,7 @@ package body Ch3 is
-- If we have a reserved identifier, manufacture an identifier with
-- a corresponding name after posting an appropriate error message
- elsif Is_Reserved_Identifier then
+ elsif Is_Reserved_Identifier (C) then
Scan_Reserved_Identifier (Force_Msg => True);
-- Otherwise we have junk that cannot be interpreted as an identifier
@@ -262,7 +262,7 @@ package body Ch3 is
Type_Loc := Token_Ptr;
Type_Start_Col := Start_Column;
T_Type;
- Ident_Node := P_Defining_Identifier;
+ Ident_Node := P_Defining_Identifier (C_Is);
Discr_Sloc := Token_Ptr;
if P_Unknown_Discriminant_Part_Opt then
@@ -732,7 +732,7 @@ package body Ch3 is
begin
Decl_Node := New_Node (N_Subtype_Declaration, Token_Ptr);
Scan; -- past SUBTYPE
- Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
+ Set_Defining_Identifier (Decl_Node, P_Defining_Identifier (C_Is));
TF_Is;
if Token = Tok_New then
@@ -1090,7 +1090,7 @@ package body Ch3 is
begin
Ident_Sloc := Token_Ptr;
Save_Scan_State (Scan_State); -- at first identifier
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
-- If we have a colon after the identifier, then we can assume that
-- this is in fact a valid identifier declaration and can steam ahead.
@@ -1104,7 +1104,7 @@ package body Ch3 is
while Comma_Present loop
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
Save_Scan_State (Scan_State); -- at colon
@@ -1685,7 +1685,7 @@ package body Ch3 is
if Token = Tok_Char_Literal then
return P_Defining_Character_Literal;
else
- return P_Defining_Identifier;
+ return P_Defining_Identifier (C_Comma_Right_Paren);
end if;
end P_Enumeration_Literal_Specification;
@@ -2278,12 +2278,12 @@ package body Ch3 is
Specification_Loop : loop
Ident_Sloc := Token_Ptr;
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
@@ -2518,7 +2518,7 @@ package body Ch3 is
Names_List := New_List;
loop
- Append (P_Identifier, Names_List);
+ Append (P_Identifier (C_Vertical_Bar_Arrow), Names_List);
exit when Token /= Tok_Vertical_Bar;
Scan; -- past |
end loop;
@@ -2747,12 +2747,12 @@ package body Ch3 is
end if;
Ident_Sloc := Token_Ptr;
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
while Comma_Present loop
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop;
T_Colon;
diff --git a/gcc/ada/par-ch4.adb b/gcc/ada/par-ch4.adb
index 62c4e108c21..838738c9bd9 100644
--- a/gcc/ada/par-ch4.adb
+++ b/gcc/ada/par-ch4.adb
@@ -28,6 +28,8 @@ pragma Style_Checks (All_Checks);
-- Turn off subprogram body ordering check. Subprograms are in order
-- by RM section rather than alphabetical
+with Hostparm; use Hostparm;
+
separate (Par)
package body Ch4 is
@@ -1116,6 +1118,7 @@ package body Ch4 is
-- POSITIONAL_ARRAY_AGGREGATE ::=
-- (EXPRESSION, EXPRESSION {, EXPRESSION})
-- | (EXPRESSION {, EXPRESSION}, others => EXPRESSION)
+ -- | (EXPRESSION {, EXPRESSION}, others => <>)
-- NAMED_ARRAY_AGGREGATE ::=
-- (ARRAY_COMPONENT_ASSOCIATION {, ARRAY_COMPONENT_ASSOCIATION})
@@ -1124,6 +1127,9 @@ package body Ch4 is
-- Error recovery: can raise Error_Resync
+ -- Note: POSITIONAL_ARRAY_AGGREGATE rule has been extended to give support
+ -- to Ada0Y limited aggregates (AI-287)
+
function P_Aggregate_Or_Paren_Expr return Node_Id is
Aggregate_Node : Node_Id;
Expr_List : List_Id;
@@ -1161,6 +1167,20 @@ package body Ch4 is
end if;
end if;
+ -- Ada0Y (AI-287): The box notation is allowed only with named
+ -- notation because positional notation might be error prone. For
+ -- example, in "(X, <>, Y, <>)", there is no type associated with
+ -- the boxes, so you might not be leaving out the components you
+ -- thought you were leaving out.
+
+ if Extensions_Allowed and then Token = Tok_Box then
+ Error_Msg_SC ("(Ada 0Y) box notation only allowed with "
+ & "named notation");
+ Scan; -- past BOX
+ Aggregate_Node := New_Node (N_Aggregate, Lparen_Sloc);
+ return Aggregate_Node;
+ end if;
+
Expr_Node := P_Expression_Or_Range_Attribute;
-- Extension aggregate case
@@ -1354,6 +1374,7 @@ package body Ch4 is
-- RECORD_COMPONENT_ASSOCIATION ::=
-- [COMPONENT_CHOICE_LIST =>] EXPRESSION
+ -- | COMPONENT_CHOICE_LIST => <>
-- COMPONENT_CHOICE_LIST =>
-- component_SELECTOR_NAME {| component_SELECTOR_NAME}
@@ -1361,6 +1382,7 @@ package body Ch4 is
-- ARRAY_COMPONENT_ASSOCIATION ::=
-- DISCRETE_CHOICE_LIST => EXPRESSION
+ -- | DISCRETE_CHOICE_LIST => <>
-- Note: this routine only handles the named cases, including others.
-- Cases where the component choice list is not present have already
@@ -1368,6 +1390,10 @@ package body Ch4 is
-- Error recovery: can raise Error_Resync
+ -- Note: RECORD_COMPONENT_ASSOCIATION and ARRAY_COMPONENT_ASSOCIATION
+ -- rules have been extended to give support to Ada0Y limited
+ -- aggregates (AI-287)
+
function P_Record_Or_Array_Component_Association return Node_Id is
Assoc_Node : Node_Id;
@@ -1376,7 +1402,32 @@ package body Ch4 is
Set_Choices (Assoc_Node, P_Discrete_Choice_List);
Set_Sloc (Assoc_Node, Token_Ptr);
TF_Arrow;
- Set_Expression (Assoc_Node, P_Expression);
+
+ if Token = Tok_Box then
+
+ -- Ada0Y (AI-287): The box notation is used to indicate the default
+ -- initialization of limited aggregate components
+
+ if not Extensions_Allowed then
+ Error_Msg_SP
+ ("(Ada 0Y) limited aggregates are an Ada0X extension");
+
+ if OpenVMS then
+ Error_Msg_SP
+ ("\unit must be compiled with " &
+ "'/'E'X'T'E'N'S'I'O'N'S'_'A'L'L'O'W'E'D qualifier");
+ else
+ Error_Msg_SP
+ ("\unit must be compiled with -gnatX switch");
+ end if;
+ end if;
+
+ Set_Box_Present (Assoc_Node);
+ Scan; -- Past box
+ else
+ Set_Expression (Assoc_Node, P_Expression);
+ end if;
+
return Assoc_Node;
end P_Record_Or_Array_Component_Association;
diff --git a/gcc/ada/par-ch5.adb b/gcc/ada/par-ch5.adb
index e8c6f3d65d6..e45b0fafb59 100644
--- a/gcc/ada/par-ch5.adb
+++ b/gcc/ada/par-ch5.adb
@@ -1004,7 +1004,7 @@ package body Ch5 is
begin
Label_Node := New_Node (N_Label, Token_Ptr);
Scan; -- past <<
- Set_Identifier (Label_Node, P_Identifier);
+ Set_Identifier (Label_Node, P_Identifier (C_Greater_Greater));
T_Greater_Greater;
Append_Elmt (Label_Node, Label_List);
return Label_Node;
@@ -1621,7 +1621,7 @@ package body Ch5 is
New_Node (N_Loop_Parameter_Specification, Token_Ptr);
Save_Scan_State (Scan_State);
- ID_Node := P_Defining_Identifier;
+ ID_Node := P_Defining_Identifier (C_In);
Set_Defining_Identifier (Loop_Param_Specification_Node, ID_Node);
if Token = Tok_Left_Paren then
diff --git a/gcc/ada/par-ch6.adb b/gcc/ada/par-ch6.adb
index e5dc9ffff68..cc0e8981740 100644
--- a/gcc/ada/par-ch6.adb
+++ b/gcc/ada/par-ch6.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -593,6 +593,10 @@ package body Ch6 is
-- True, a real dot has been scanned and we are positioned past it,
-- if the result is False, the scan position is unchanged.
+ --------------
+ -- Real_Dot --
+ --------------
+
function Real_Dot return Boolean is
Scan_State : Saved_Scan_State;
@@ -715,7 +719,7 @@ package body Ch6 is
Set_Identifier_Casing (Current_Source_File, Determine_Token_Casing);
end if;
- Ident_Node := P_Identifier;
+ Ident_Node := P_Identifier (C_Dot);
Merge_Identifier (Ident_Node, Tok_Return);
-- Normal case (not child library unit name)
@@ -746,7 +750,7 @@ package body Ch6 is
Name_Node := New_Node (N_Selected_Component, Token_Ptr);
Scan; -- past period
Set_Prefix (Name_Node, Prefix_Node);
- Ident_Node := P_Identifier;
+ Ident_Node := P_Identifier (C_Dot);
Set_Selector_Name (Name_Node, Ident_Node);
Prefix_Node := Name_Node;
end loop;
@@ -870,7 +874,7 @@ package body Ch6 is
Ignore (Tok_Left_Paren);
Ident_Sloc := Token_Ptr;
- Idents (1) := P_Defining_Identifier;
+ Idents (1) := P_Defining_Identifier (C_Comma_Colon);
Num_Idents := 1;
Ident_Loop : loop
@@ -924,7 +928,7 @@ package body Ch6 is
T_Comma;
Num_Idents := Num_Idents + 1;
- Idents (Num_Idents) := P_Defining_Identifier;
+ Idents (Num_Idents) := P_Defining_Identifier (C_Comma_Colon);
end loop Ident_Loop;
-- Fall through the loop on encountering a colon, or deciding
diff --git a/gcc/ada/par-ch9.adb b/gcc/ada/par-ch9.adb
index e68c972d63f..6bfc409acce 100644
--- a/gcc/ada/par-ch9.adb
+++ b/gcc/ada/par-ch9.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -90,7 +90,7 @@ package body Ch9 is
if Token = Tok_Body then
Scan; -- past BODY
- Name_Node := P_Defining_Identifier;
+ Name_Node := P_Defining_Identifier (C_Is);
Scope.Table (Scope.Last).Labl := Name_Node;
if Token = Tok_Left_Paren then
@@ -133,7 +133,7 @@ package body Ch9 is
else
Task_Node := New_Node (N_Single_Task_Declaration, Task_Sloc);
- Name_Node := P_Defining_Identifier;
+ Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Task_Node, Name_Node);
Scope.Table (Scope.Last).Labl := Name_Node;
@@ -141,7 +141,6 @@ package body Ch9 is
Error_Msg_SC ("discriminant part not allowed for single task");
Discard_Junk_List (P_Known_Discriminant_Part_Opt);
end if;
-
end if;
-- Parse optional task definition. Note that P_Task_Definition scans
@@ -344,7 +343,7 @@ package body Ch9 is
if Token = Tok_Body then
Scan; -- past BODY
- Name_Node := P_Defining_Identifier;
+ Name_Node := P_Defining_Identifier (C_Is);
Scope.Table (Scope.Last).Labl := Name_Node;
if Token = Tok_Left_Paren then
@@ -381,7 +380,7 @@ package body Ch9 is
Scan; -- past TYPE
Protected_Node :=
New_Node (N_Protected_Type_Declaration, Protected_Sloc);
- Name_Node := P_Defining_Identifier;
+ Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Protected_Node, Name_Node);
Scope.Table (Scope.Last).Labl := Name_Node;
Set_Discriminant_Specifications
@@ -390,7 +389,7 @@ package body Ch9 is
else
Protected_Node :=
New_Node (N_Single_Protected_Declaration, Protected_Sloc);
- Name_Node := P_Defining_Identifier;
+ Name_Node := P_Defining_Identifier (C_Is);
Set_Defining_Identifier (Protected_Node, Name_Node);
if Token = Tok_Left_Paren then
@@ -631,7 +630,8 @@ package body Ch9 is
Decl_Node := New_Node (N_Entry_Declaration, Token_Ptr);
Scan; -- past ENTRY
- Set_Defining_Identifier (Decl_Node, P_Defining_Identifier);
+ Set_Defining_Identifier
+ (Decl_Node, P_Defining_Identifier (C_Left_Paren_Semicolon));
-- If left paren, could be (Discrete_Subtype_Definition) or Formal_Part
@@ -719,7 +719,7 @@ package body Ch9 is
Scan; -- past ACCEPT
Scope.Table (Scope.Last).Labl := Token_Node;
- Set_Entry_Direct_Name (Accept_Node, P_Identifier);
+ Set_Entry_Direct_Name (Accept_Node, P_Identifier (C_Do));
-- Left paren could be (Entry_Index) or Formal_Part, determine which
@@ -932,7 +932,7 @@ package body Ch9 is
begin
Iterator_Node := New_Node (N_Entry_Index_Specification, Token_Ptr);
T_For; -- past FOR
- Set_Defining_Identifier (Iterator_Node, P_Defining_Identifier);
+ Set_Defining_Identifier (Iterator_Node, P_Defining_Identifier (C_In));
T_In;
Set_Discrete_Subtype_Definition
(Iterator_Node, P_Discrete_Subtype_Definition);
diff --git a/gcc/ada/par-load.adb b/gcc/ada/par-load.adb
index fb0f2684f6c..163fb0b13e8 100644
--- a/gcc/ada/par-load.adb
+++ b/gcc/ada/par-load.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -42,6 +42,8 @@ with Sinput.L; use Sinput.L;
with Stylesw; use Stylesw;
with Validsw; use Validsw;
+with GNAT.Spelling_Checker; use GNAT.Spelling_Checker;
+
separate (Par)
procedure Load is
@@ -188,26 +190,45 @@ begin
or else
Name_Buffer (1) = 'g')
then
- -- In the predefined file case, we know the user did not construct
- -- their own package, but we got the wrong one. This means that the
- -- name supplied by the user crunched to something we recognized,
- -- but then the file did not contain the unit expected. Most likely
- -- this is due to a misspelling, e.g.
-
- -- with Ada.Calender;
-
- -- This crunches to a-calend, which indeed contains the unit
- -- Ada.Calendar, and we can diagnose the misspelling. This is
- -- a simple heuristic, but it catches many common cases of
- -- misspelling of predefined unit names without needing a full
- -- list of them.
-
- Error_Msg_Name_1 := Expected_Unit (Cur_Unum);
- Error_Msg ("% is not a predefined library unit!", Loc);
- Error_Msg_Name_1 := Unit_Name (Cur_Unum);
- Error_Msg ("possible misspelling of %!", Loc);
+ declare
+ Expect_Name : constant Name_Id := Expected_Unit (Cur_Unum);
+ Actual_Name : constant Name_Id := Unit_Name (Cur_Unum);
+
+ begin
+ Error_Msg_Name_1 := Expect_Name;
+ Error_Msg ("% is not a predefined library unit!", Loc);
+
+ -- In the predefined file case, we know the user did not
+ -- construct their own package, but we got the wrong one.
+ -- This means that the name supplied by the user crunched
+ -- to something we recognized, but then the file did not
+ -- contain the unit expected. Most likely this is due to
+ -- a misspelling, e.g.
+
+ -- with Ada.Calender;
+
+ -- This crunches to a-calend, which indeed contains the unit
+ -- Ada.Calendar, and we can diagnose the misspelling. This
+ -- is a simple heuristic, but it catches many common cases
+ -- of misspelling of predefined unit names without needing
+ -- a full list of them.
+
+ -- Before actually issinying the message, we will check that the
+ -- unit name is indeed a plausible misspelling of the one we got.
+
+ if Is_Bad_Spelling_Of
+ (Found => Get_Name_String (Expect_Name),
+ Expect => Get_Name_String (Actual_Name))
+ then
+ Error_Msg_Name_1 := Actual_Name;
+ Error_Msg ("possible misspelling of %!", Loc);
+ end if;
+ end;
- -- Non-predefined file name case
+ -- Non-predefined file name case. In this case we generate a message
+ -- and then we quit, because we are in big trouble, and if we try
+ -- to continue compilation, we get into some nasty situations
+ -- (for example in some subunit cases).
else
Error_Msg ("file { does not contain expected unit!", Loc);
@@ -217,7 +238,10 @@ begin
Error_Msg ("found unit $!", Loc);
end if;
- raise Unrecoverable_Error;
+ -- In both cases, remove the unit if it is the last unit (which it
+ -- normally (always?) will be) so that it is out of the way later.
+
+ Remove_Unit (Cur_Unum);
end if;
-- If current unit is a body, load its corresponding spec
diff --git a/gcc/ada/par-prag.adb b/gcc/ada/par-prag.adb
index 2f5482fd70a..19eefc42047 100644
--- a/gcc/ada/par-prag.adb
+++ b/gcc/ada/par-prag.adb
@@ -980,6 +980,7 @@ begin
Pragma_Task_Info |
Pragma_Task_Name |
Pragma_Task_Storage |
+ Pragma_Thread_Body |
Pragma_Time_Slice |
Pragma_Title |
Pragma_Unchecked_Union |
diff --git a/gcc/ada/par-util.adb b/gcc/ada/par-util.adb
index d7e2e15e33a..d23269ea88d 100644
--- a/gcc/ada/par-util.adb
+++ b/gcc/ada/par-util.adb
@@ -24,6 +24,7 @@
-- --
------------------------------------------------------------------------------
+with Csets; use Csets;
with Uintp; use Uintp;
with GNAT.Spelling_Checker; use GNAT.Spelling_Checker;
@@ -419,7 +420,7 @@ package body Util is
-- Is_Reserved_Identifier --
----------------------------
- function Is_Reserved_Identifier return Boolean is
+ function Is_Reserved_Identifier (C : Id_Check := None) return Boolean is
begin
if not Is_Reserved_Keyword (Token) then
return False;
@@ -438,20 +439,88 @@ package body Util is
-- keyword casing, then we return False, since it is pretty
-- clearly intended to be a keyword.
- if Ident_Casing /= Unknown
- and then Key_Casing /= Unknown
- and then Ident_Casing /= Key_Casing
- and then Determine_Token_Casing = Key_Casing
+ if Ident_Casing = Unknown
+ or else Key_Casing = Unknown
+ or else Ident_Casing = Key_Casing
+ or else Determine_Token_Casing /= Key_Casing
then
- return False;
+ return True;
- -- Otherwise assume that an identifier was intended
+ -- Here we have a keyword written clearly with keyword casing.
+ -- In default mode, we would not be willing to consider this as
+ -- a reserved identifier, but if C is set, we may still accept it
- else
- return True;
+ elsif C /= None then
+ declare
+ Scan_State : Saved_Scan_State;
+ OK_Next_Tok : Boolean;
+
+ begin
+ Save_Scan_State (Scan_State);
+ Scan;
+
+ if Token_Is_At_Start_Of_Line then
+ return False;
+ end if;
+
+ case C is
+ when None =>
+ raise Program_Error;
+
+ when C_Comma_Right_Paren =>
+ OK_Next_Tok :=
+ Token = Tok_Comma or else Token = Tok_Right_Paren;
+
+ when C_Comma_Colon =>
+ OK_Next_Tok :=
+ Token = Tok_Comma or else Token = Tok_Colon;
+
+ when C_Do =>
+ OK_Next_Tok :=
+ Token = Tok_Do;
+
+ when C_Dot =>
+ OK_Next_Tok :=
+ Token = Tok_Dot;
+
+ when C_Greater_Greater =>
+ OK_Next_Tok :=
+ Token = Tok_Greater_Greater;
+
+ when C_In =>
+ OK_Next_Tok :=
+ Token = Tok_In;
+
+ when C_Is =>
+ OK_Next_Tok :=
+ Token = Tok_Is;
+
+ when C_Left_Paren_Semicolon =>
+ OK_Next_Tok :=
+ Token = Tok_Left_Paren or else Token = Tok_Semicolon;
+
+ when C_Use =>
+ OK_Next_Tok :=
+ Token = Tok_Use;
+
+ when C_Vertical_Bar_Arrow =>
+ OK_Next_Tok :=
+ Token = Tok_Vertical_Bar or else Token = Tok_Arrow;
+ end case;
+
+ Restore_Scan_State (Scan_State);
+
+ if OK_Next_Tok then
+ return True;
+ end if;
+ end;
end if;
end;
end if;
+
+ -- If we fall through it is not a reserved identifier
+
+ return False;
end Is_Reserved_Identifier;
----------------------
diff --git a/gcc/ada/par.adb b/gcc/ada/par.adb
index b5365332fb3..56629ef436f 100644
--- a/gcc/ada/par.adb
+++ b/gcc/ada/par.adb
@@ -26,7 +26,6 @@
with Atree; use Atree;
with Casing; use Casing;
-with Csets; use Csets;
with Debug; use Debug;
with Elists; use Elists;
with Errout; use Errout;
@@ -189,6 +188,73 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- that there is a missing body, but it seems more reasonable to let the
-- later semantic checking discover this.
+ ----------------------------------------------------
+ -- Handling of Reserved Words Used as Identifiers --
+ ----------------------------------------------------
+
+ -- Note: throughout the parser, the terms reserved word and keyword
+ -- are used interchangably to refer to the same set of reserved
+ -- keywords (including until, protected, etc).
+
+ -- If a reserved word is used in place of an identifier, the parser
+ -- where possible tries to recover gracefully. In particular, if the
+ -- keyword is clearly spelled using identifier casing, e.g. Until in
+ -- a source program using mixed case identifiers and lower case keywords,
+ -- then the keyword is treated as an identifier if it appears in a place
+ -- where an identifier is required.
+
+ -- The situation is more complex if the keyword is spelled with normal
+ -- keyword casing. In this case, the parser is more reluctant to
+ -- consider it to be intended as an identifier, unless it has some
+ -- further confirmation.
+
+ -- In the case of an identifier appearing in the identifier list of a
+ -- declaration, the appearence of a comma or colon right after the
+ -- keyword on the same line is taken as confirmation. For an enumeration
+ -- literal, a comma or right paren right after the identifier is also
+ -- treated as adequate confirmation.
+
+ -- The following type is used in calls to Is_Reserved_Identifier and
+ -- also to P_Defining_Identifier and P_Identifier. The default for all
+ -- these functins is that reserved words in reserved word case are not
+ -- considered to be reserved identifiers. The Id_Check value indicates
+ -- tokens, which if they appear immediately after the identifier, are
+ -- taken as confirming that the use of an identifier was expected
+
+ type Id_Check is
+ (None,
+ -- Default, no special token test
+
+ C_Comma_Right_Paren,
+ -- Consider as identifier if followed by comma or right paren
+
+ C_Comma_Colon,
+ -- Consider as identifier if followed by comma or colon
+
+ C_Do,
+ -- Consider as identifier if followed by DO
+
+ C_Dot,
+ -- Consider as identifier if followed by period
+
+ C_Greater_Greater,
+ -- Consider as identifier if followed by >>
+
+ C_In,
+ -- Consider as identifier if followed by IN
+
+ C_Is,
+ -- Consider as identifier if followed by IS
+
+ C_Left_Paren_Semicolon,
+ -- Consider as identifier if followed by left paren or semicolon
+
+ C_Use,
+ -- Consider as identifier if followed by USE
+
+ C_Vertical_Bar_Arrow);
+ -- Consider as identifier if followed by | or =>
+
--------------------------------------------
-- Handling IS Used in Place of Semicolon --
--------------------------------------------
@@ -450,9 +516,12 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- List that is created.
package Ch2 is
- function P_Identifier return Node_Id;
function P_Pragma return Node_Id;
+ function P_Identifier (C : Id_Check := None) return Node_Id;
+ -- Scans out an identifier. The parameter C determines the treatment
+ -- of reserved identifiers. See declaration of Id_Check for details.
+
function P_Pragmas_Opt return List_Id;
-- This function scans for a sequence of pragmas in other than a
-- declaration sequence or statement sequence context. All pragmas
@@ -482,7 +551,6 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
function P_Basic_Declarative_Items return List_Id;
function P_Constraint_Opt return Node_Id;
function P_Declarative_Part return List_Id;
- function P_Defining_Identifier return Node_Id;
function P_Discrete_Choice_List return List_Id;
function P_Discrete_Range return Node_Id;
function P_Discrete_Subtype_Definition return Node_Id;
@@ -503,6 +571,11 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- case where the source has a single declaration with multiple
-- defining identifiers.
+ function P_Defining_Identifier (C : Id_Check := None) return Node_Id;
+ -- Scan out a defining identifier. The parameter C controls the
+ -- treatment of errors in case a reserved word is scanned. See the
+ -- declaration of this type for details.
+
function Init_Expr_Opt (P : Boolean := False) return Node_Id;
-- If an initialization expression is present (:= expression), then
-- it is scanned out and returned, otherwise Empty is returned if no
@@ -908,10 +981,12 @@ function Par (Configuration_Pragmas : Boolean) return List_Id is
-- past it, otherwise the call has no effect at all. T may be any
-- reserved word token, or comma, left or right paren, or semicolon.
- function Is_Reserved_Identifier return Boolean;
+ function Is_Reserved_Identifier (C : Id_Check := None) return Boolean;
-- Test if current token is a reserved identifier. This test is based
-- on the token being a keyword and being spelled in typical identifier
- -- style (i.e. starting with an upper case letter).
+ -- style (i.e. starting with an upper case letter). The parameter C
+ -- determines the special treatment if a reserved word is encountered
+ -- that has the normal casing of a reserved word.
procedure Merge_Identifier (Prev : Node_Id; Nxt : Token_Type);
-- Called when the previous token is an identifier (whose Token_Node
diff --git a/gcc/ada/prj-attr.adb b/gcc/ada/prj-attr.adb
index e3fb2c0ef38..8482fd2a2e3 100644
--- a/gcc/ada/prj-attr.adb
+++ b/gcc/ada/prj-attr.adb
@@ -69,6 +69,9 @@ package body Prj.Attr is
"LVlibrary_options#" &
"SVlibrary_src_dir#" &
"SVlibrary_gcc#" &
+ "SVlibrary_symbol_file#" &
+ "SVlibrary_symbol_policy#" &
+ "SVlibrary_reference_symbol_file#" &
"LVmain#" &
"LVlanguages#" &
"SVmain_language#" &
diff --git a/gcc/ada/prj-dect.adb b/gcc/ada/prj-dect.adb
index 9865dff63c1..ac39eeda369 100644
--- a/gcc/ada/prj-dect.adb
+++ b/gcc/ada/prj-dect.adb
@@ -125,6 +125,7 @@ package body Prj.Dect is
begin
Attribute := Default_Project_Node (Of_Kind => N_Attribute_Declaration);
Set_Location_Of (Attribute, To => Token_Ptr);
+ Set_Previous_Line_Node (Attribute);
-- Scan past "for"
@@ -467,6 +468,9 @@ package body Prj.Dect is
if Current_Attribute = Empty_Attribute then
Attribute := Empty_Node;
end if;
+
+ Set_End_Of_Line (Attribute);
+ Set_Previous_Line_Node (Attribute);
end Parse_Attribute_Declaration;
-----------------------------
@@ -535,6 +539,9 @@ package body Prj.Dect is
Expect (Tok_Is, "IS");
if Token = Tok_Is then
+ Set_End_Of_Line (Case_Construction);
+ Set_Previous_Line_Node (Case_Construction);
+ Set_Next_End_Node (Case_Construction);
-- Scan past "is"
@@ -571,6 +578,8 @@ package body Prj.Dect is
Scan;
Expect (Tok_Arrow, "`=>`");
+ Set_End_Of_Line (Current_Item);
+ Set_Previous_Line_Node (Current_Item);
-- Empty_Node in Field1 of a Case_Item indicates
-- the "when others =>" branch.
@@ -596,6 +605,8 @@ package body Prj.Dect is
Set_First_Choice_Of (Current_Item, To => First_Choice);
Expect (Tok_Arrow, "`=>`");
+ Set_End_Of_Line (Current_Item);
+ Set_Previous_Line_Node (Current_Item);
Parse_Declarative_Items
(Declarations => First_Declarative_Item,
@@ -613,6 +624,7 @@ package body Prj.Dect is
End_Case_Construction;
Expect (Tok_End, "`END CASE`");
+ Remove_Next_End_Node;
if Token = Tok_End then
@@ -629,6 +641,7 @@ package body Prj.Dect is
Scan;
Expect (Tok_Semicolon, "`;`");
+ Set_Previous_End_Node (Case_Construction);
end Parse_Case_Construction;
@@ -673,6 +686,9 @@ package body Prj.Dect is
Current_Project => Current_Project,
Current_Package => Current_Package);
+ Set_End_Of_Line (Current_Declaration);
+ Set_Previous_Line_Node (Current_Declaration);
+
when Tok_For =>
Parse_Attribute_Declaration
@@ -681,6 +697,9 @@ package body Prj.Dect is
Current_Project => Current_Project,
Current_Package => Current_Package);
+ Set_End_Of_Line (Current_Declaration);
+ Set_Previous_Line_Node (Current_Declaration);
+
when Tok_Package =>
-- Package declaration
@@ -693,6 +712,8 @@ package body Prj.Dect is
(Package_Declaration => Current_Declaration,
Current_Project => Current_Project);
+ Set_Previous_End_Node (Current_Declaration);
+
when Tok_Type =>
-- Type String Declaration
@@ -706,6 +727,9 @@ package body Prj.Dect is
(String_Type => Current_Declaration,
Current_Project => Current_Project);
+ Set_End_Of_Line (Current_Declaration);
+ Set_Previous_Line_Node (Current_Declaration);
+
when Tok_Case =>
-- Case construction
@@ -716,6 +740,8 @@ package body Prj.Dect is
Current_Project => Current_Project,
Current_Package => Current_Package);
+ Set_Previous_End_Node (Current_Declaration);
+
when others =>
exit;
@@ -928,8 +954,13 @@ package body Prj.Dect is
end if;
Expect (Tok_Semicolon, "`;`");
+ Set_End_Of_Line (Package_Declaration);
+ Set_Previous_Line_Node (Package_Declaration);
elsif Token = Tok_Is then
+ Set_End_Of_Line (Package_Declaration);
+ Set_Previous_Line_Node (Package_Declaration);
+ Set_Next_End_Node (Package_Declaration);
Parse_Declarative_Items
(Declarations => First_Declarative_Item,
@@ -970,6 +1001,7 @@ package body Prj.Dect is
end if;
Expect (Tok_Semicolon, "`;`");
+ Remove_Next_End_Node;
else
Error_Msg ("expected IS or RENAMES", Token_Ptr);
diff --git a/gcc/ada/prj-env.adb b/gcc/ada/prj-env.adb
index 588352fc29f..5c3a07be0d9 100644
--- a/gcc/ada/prj-env.adb
+++ b/gcc/ada/prj-env.adb
@@ -203,10 +203,13 @@ package body Prj.Env is
return Projects.Table (Project).Ada_Include_Path;
end Ada_Include_Path;
+ ----------------------
+ -- Ada_Include_Path --
+ ----------------------
+
function Ada_Include_Path
(Project : Project_Id;
- Recursive : Boolean)
- return String
+ Recursive : Boolean) return String
is
begin
if Recursive then
@@ -224,8 +227,7 @@ package body Prj.Env is
function Ada_Objects_Path
(Project : Project_Id;
- Including_Libraries : Boolean := True)
- return String_Access
+ Including_Libraries : Boolean := True) return String_Access
is
procedure Add (Project : Project_Id);
-- Add all the object directories of a project to the path only if
@@ -1061,8 +1063,7 @@ package body Prj.Env is
(Name : String;
Project : Project_Id;
Main_Project_Only : Boolean := True;
- Full_Path : Boolean := False)
- return String
+ Full_Path : Boolean := False) return String
is
The_Project : Project_Id := Project;
Data : Project_Data := Projects.Table (Project);
@@ -1547,8 +1548,7 @@ package body Prj.Env is
function Path_Name_Of_Library_Unit_Body
(Name : String;
- Project : Project_Id)
- return String
+ Project : Project_Id) return String
is
Data : constant Project_Data := Projects.Table (Project);
Original_Name : String := Name;
@@ -1733,8 +1733,7 @@ package body Prj.Env is
function Project_Of
(Name : String;
- Main_Project : Project_Id)
- return Project_Id
+ Main_Project : Project_Id) return Project_Id
is
Result : Project_Id := No_Project;
@@ -1777,10 +1776,13 @@ package body Prj.Env is
Unit := Units.Table (Current);
-- Check for body
+
Current_Name := Unit.File_Names (Body_Part).Name;
+
-- Case of a body present
if Current_Name /= No_Name then
+
-- If it has the name of the original name or the body name,
-- we have found the project.
@@ -1798,6 +1800,7 @@ package body Prj.Env is
Current_Name := Unit.File_Names (Specification).Name;
if Current_Name /= No_Name then
+
-- If name same as the original name, or the spec name, we have
-- found the project.
diff --git a/gcc/ada/prj-env.ads b/gcc/ada/prj-env.ads
index 7ea02870198..8730ccb52d2 100644
--- a/gcc/ada/prj-env.ads
+++ b/gcc/ada/prj-env.ads
@@ -66,8 +66,7 @@ package Prj.Env is
function Ada_Include_Path
(Project : Project_Id;
- Recursive : Boolean)
- return String;
+ Recursive : Boolean) return String;
-- Get the ADA_INCLUDE_PATH of a Project file. If Recursive it True,
-- get all the source directories of the imported and modified project
-- files (recursively). If Recursive is False, just get the path for the
@@ -76,8 +75,7 @@ package Prj.Env is
function Ada_Objects_Path
(Project : Project_Id;
- Including_Libraries : Boolean := True)
- return String_Access;
+ Including_Libraries : Boolean := True) return String_Access;
-- Get the ADA_OBJECTS_PATH of a Project file. For the first call, compute
-- it and cache it. When Including_Libraries is False, do not include the
-- object directories of the library projects, and do not cache the result.
@@ -86,7 +84,7 @@ package Prj.Env is
(Project : Project_Id;
Including_Libraries : Boolean);
-- Set the env vars for additional project path files, after
- -- creating if necessary the path files.
+ -- creating the path files if necessary.
procedure Delete_All_Path_Files;
-- Delete all temporary path files that have been created by
@@ -94,22 +92,23 @@ package Prj.Env is
function Path_Name_Of_Library_Unit_Body
(Name : String;
- Project : Project_Id)
- return String;
- -- Returns the Path of a library unit.
+ Project : Project_Id) return String;
+ -- Returns the Path of a library unit
function File_Name_Of_Library_Unit_Body
(Name : String;
Project : Project_Id;
Main_Project_Only : Boolean := True;
- Full_Path : Boolean := False)
- return String;
+ Full_Path : Boolean := False) return String;
-- Returns the file name of a library unit, in canonical case. Name may or
-- may not have an extension (corresponding to the naming scheme of the
-- project). If there is no body with this name, but there is a spec, the
-- name of the spec is returned.
+ --
-- If Full_Path is False (the default), the simple file name is returned.
+ --
-- If Full_Path is True, the absolute path name is returned.
+ --
-- If neither a body nor a spec can be found, an empty string is returned.
-- If Main_Project_Only is True, the unit must be an immediate source of
-- Project. If it is False, it may be a source of one of its imported
@@ -117,8 +116,7 @@ package Prj.Env is
function Project_Of
(Name : String;
- Main_Project : Project_Id)
- return Project_Id;
+ Main_Project : Project_Id) return Project_Id;
-- Get the project of a source. The source file name may be truncated
-- (".adb" or ".ads" may be missing). If the source is in a project being
-- extended, return the ultimate extending project. If it is not a source
diff --git a/gcc/ada/prj-nmsc.adb b/gcc/ada/prj-nmsc.adb
index 27662a3f89e..6089bea61ed 100644
--- a/gcc/ada/prj-nmsc.adb
+++ b/gcc/ada/prj-nmsc.adb
@@ -991,8 +991,8 @@ package body Prj.Nmsc is
The_Unit_Data := Units.Table (The_Unit_Id);
if Specs then
- if The_Unit_Data.File_Names (Specification).Project /=
- Project
+ if not Check_Project
+ (The_Unit_Data.File_Names (Specification).Project)
then
Error_Msg
(Project,
@@ -1001,8 +1001,8 @@ package body Prj.Nmsc is
end if;
else
- if The_Unit_Data.File_Names (Com.Body_Part).Project /=
- Project
+ if not Check_Project
+ (The_Unit_Data.File_Names (Com.Body_Part).Project)
then
Error_Msg
(Project,
@@ -1350,16 +1350,32 @@ package body Prj.Nmsc is
(Snames.Name_Library_Src_Dir,
Data.Decl.Attributes);
- Auto_Init_Supported
- : constant Boolean :=
- MLib.Tgt.
- Standalone_Library_Auto_Init_Is_Supported;
+ Lib_Symbol_File : constant Prj.Variable_Value :=
+ Prj.Util.Value_Of
+ (Snames.Name_Library_Symbol_File,
+ Data.Decl.Attributes);
+
+ Lib_Symbol_Policy : constant Prj.Variable_Value :=
+ Prj.Util.Value_Of
+ (Snames.Name_Library_Symbol_Policy,
+ Data.Decl.Attributes);
+
+ Lib_Ref_Symbol_File : constant Prj.Variable_Value :=
+ Prj.Util.Value_Of
+ (Snames.Name_Library_Reference_Symbol_File,
+ Data.Decl.Attributes);
+
+ Auto_Init_Supported : constant Boolean :=
+ MLib.Tgt.
+ Standalone_Library_Auto_Init_Is_Supported;
+
+ OK : Boolean := True;
begin
pragma Assert (Lib_Interfaces.Kind = List);
- -- It is a library project file if attribute Library_Interface
- -- is defined.
+ -- It is a stand-alone library project file if attribute
+ -- Library_Interface is defined.
if not Lib_Interfaces.Default then
declare
@@ -1566,102 +1582,257 @@ package body Prj.Nmsc is
Lib_Auto_Init.Location);
end if;
end if;
+ end;
- if Lib_Src_Dir.Value /= Empty_String then
- declare
- Dir_Id : constant Name_Id := Lib_Src_Dir.Value;
+ -- If attribute Library_Src_Dir is defined and not the
+ -- empty string, check if the directory exist and is not
+ -- the object directory or one of the source directories.
+ -- This is the directory where copies of the interface
+ -- sources will be copied. Note that this directory may be
+ -- the library directory.
- begin
- Locate_Directory
- (Dir_Id, Data.Display_Directory,
- Data.Library_Src_Dir,
- Data.Display_Library_Src_Dir);
+ if Lib_Src_Dir.Value /= Empty_String then
+ declare
+ Dir_Id : constant Name_Id := Lib_Src_Dir.Value;
- -- Comment needed here ???
+ begin
+ Locate_Directory
+ (Dir_Id, Data.Display_Directory,
+ Data.Library_Src_Dir,
+ Data.Display_Library_Src_Dir);
- if Data.Library_Src_Dir = No_Name then
+ -- If directory does not exist, report an error
- -- Get the absolute name of the library directory
- -- that does not exist, to report an error.
+ if Data.Library_Src_Dir = No_Name then
- declare
- Dir_Name : constant String :=
- Get_Name_String (Dir_Id);
- begin
- if Is_Absolute_Path (Dir_Name) then
- Err_Vars.Error_Msg_Name_1 := Dir_Id;
+ -- Get the absolute name of the library directory
+ -- that does not exist, to report an error.
- else
- Get_Name_String (Data.Directory);
+ declare
+ Dir_Name : constant String :=
+ Get_Name_String (Dir_Id);
- if Name_Buffer (Name_Len) /=
- Directory_Separator
- then
- Name_Len := Name_Len + 1;
- Name_Buffer (Name_Len) :=
- Directory_Separator;
- end if;
+ begin
+ if Is_Absolute_Path (Dir_Name) then
+ Err_Vars.Error_Msg_Name_1 := Dir_Id;
- Name_Buffer
- (Name_Len + 1 ..
- Name_Len + Dir_Name'Length) :=
- Dir_Name;
- Name_Len := Name_Len + Dir_Name'Length;
- Err_Vars.Error_Msg_Name_1 := Name_Find;
- end if;
+ else
+ Get_Name_String (Data.Directory);
- -- Report the error
+ if Name_Buffer (Name_Len) /=
+ Directory_Separator
+ then
+ Name_Len := Name_Len + 1;
+ Name_Buffer (Name_Len) :=
+ Directory_Separator;
+ end if;
- Error_Msg
- (Project,
- "Directory { does not exist",
- Lib_Src_Dir.Location);
- end;
+ Name_Buffer
+ (Name_Len + 1 ..
+ Name_Len + Dir_Name'Length) :=
+ Dir_Name;
+ Name_Len := Name_Len + Dir_Name'Length;
+ Err_Vars.Error_Msg_Name_1 := Name_Find;
+ end if;
- -- And comment needed here ???
+ -- Report the error
- elsif Data.Library_Src_Dir = Data.Object_Directory then
Error_Msg
(Project,
- "directory to copy interfaces cannot be " &
- "the object directory",
+ "Directory { does not exist",
Lib_Src_Dir.Location);
- Data.Library_Src_Dir := No_Name;
+ end;
- -- And comment needed here ???
+ -- Report an error if it is the same as the object
+ -- directory.
- else
- declare
- Src_Dirs : String_List_Id := Data.Source_Dirs;
- Src_Dir : String_Element;
- begin
- while Src_Dirs /= Nil_String loop
- Src_Dir := String_Elements.Table (Src_Dirs);
- Src_Dirs := Src_Dir.Next;
-
- if Data.Library_Src_Dir = Src_Dir.Value then
- Error_Msg
- (Project,
- "directory to copy interfaces cannot " &
- "be one of the source directories",
- Lib_Src_Dir.Location);
- Data.Library_Src_Dir := No_Name;
- exit;
- end if;
- end loop;
- end;
+ elsif Data.Library_Src_Dir = Data.Object_Directory then
+ Error_Msg
+ (Project,
+ "directory to copy interfaces cannot be " &
+ "the object directory",
+ Lib_Src_Dir.Location);
+ Data.Library_Src_Dir := No_Name;
+
+ -- Check if it is the same as one of the source
+ -- directories.
+
+ else
+ declare
+ Src_Dirs : String_List_Id := Data.Source_Dirs;
+ Src_Dir : String_Element;
- if Data.Library_Src_Dir /= No_Name
- and then Current_Verbosity = High
+ begin
+ while Src_Dirs /= Nil_String loop
+ Src_Dir := String_Elements.Table (Src_Dirs);
+ Src_Dirs := Src_Dir.Next;
+
+ -- Report an error if it is one of the
+ -- source directories.
+
+ if Data.Library_Src_Dir = Src_Dir.Value then
+ Error_Msg
+ (Project,
+ "directory to copy interfaces cannot " &
+ "be one of the source directories",
+ Lib_Src_Dir.Location);
+ Data.Library_Src_Dir := No_Name;
+ exit;
+ end if;
+ end loop;
+ end;
+
+ if Data.Library_Src_Dir /= No_Name
+ and then Current_Verbosity = High
+ then
+ Write_Str ("Directory to copy interfaces =""");
+ Write_Str (Get_Name_String (Data.Library_Dir));
+ Write_Line ("""");
+ end if;
+ end if;
+ end;
+ end if;
+
+ if not Lib_Symbol_File.Default then
+ Data.Symbol_Data.Symbol_File := Lib_Symbol_File.Value;
+
+ Get_Name_String (Lib_Symbol_File.Value);
+
+ if Name_Len = 0 then
+ Error_Msg
+ (Project,
+ "symbol file name cannot be an empty string",
+ Lib_Symbol_File.Location);
+
+ else
+ OK := not Is_Absolute_Path (Name_Buffer (1 .. Name_Len));
+
+ if OK then
+ for J in 1 .. Name_Len loop
+ if Name_Buffer (J) = '/'
+ or else Name_Buffer (J) = Directory_Separator
then
- Write_Str ("Directory to copy interfaces =""");
- Write_Str (Get_Name_String (Data.Library_Dir));
- Write_Line ("""");
+ OK := False;
+ exit;
end if;
- end if;
- end;
+ end loop;
+ end if;
+
+ if not OK then
+ Error_Msg_Name_1 := Lib_Symbol_File.Value;
+ Error_Msg
+ (Project,
+ "symbol file name { is illegal. " &
+ "Name canot include directory info.",
+ Lib_Symbol_File.Location);
+ end if;
end if;
- end;
+ end if;
+
+ if not Lib_Symbol_Policy.Default then
+ declare
+ Value : constant String :=
+ To_Lower
+ (Get_Name_String (Lib_Symbol_Policy.Value));
+
+ begin
+ if Value = "autonomous" or else Value = "default" then
+ Data.Symbol_Data.Symbol_Policy := Autonomous;
+
+ elsif Value = "compliant" then
+ Data.Symbol_Data.Symbol_Policy := Compliant;
+
+ elsif Value = "controlled" then
+ Data.Symbol_Data.Symbol_Policy := Controlled;
+
+ else
+ Error_Msg
+ (Project,
+ "illegal value for Library_Symbol_Policy",
+ Lib_Symbol_Policy.Location);
+ end if;
+ end;
+ end if;
+
+ if Lib_Ref_Symbol_File.Default then
+ if Data.Symbol_Data.Symbol_Policy /= Autonomous then
+ Error_Msg
+ (Project,
+ "a reference symbol file need to be defined",
+ Lib_Symbol_Policy.Location);
+ end if;
+
+ else
+ Data.Symbol_Data.Reference := Lib_Ref_Symbol_File.Value;
+
+ Get_Name_String (Lib_Symbol_File.Value);
+
+ if Name_Len = 0 then
+ Error_Msg
+ (Project,
+ "reference symbol file name cannot be an empty string",
+ Lib_Symbol_File.Location);
+
+ else
+ OK := not Is_Absolute_Path (Name_Buffer (1 .. Name_Len));
+
+ if OK then
+ for J in 1 .. Name_Len loop
+ if Name_Buffer (J) = '/'
+ or else Name_Buffer (J) = Directory_Separator
+ then
+ OK := False;
+ exit;
+ end if;
+ end loop;
+ end if;
+
+ if not OK then
+ Error_Msg_Name_1 := Lib_Ref_Symbol_File.Value;
+ Error_Msg
+ (Project,
+ "reference symbol file { name is illegal. " &
+ "Name canot include directory info.",
+ Lib_Ref_Symbol_File.Location);
+ end if;
+
+ if not Is_Regular_File
+ (Get_Name_String (Data.Object_Directory) &
+ Directory_Separator &
+ Get_Name_String (Lib_Ref_Symbol_File.Value))
+ then
+ Error_Msg_Name_1 := Lib_Ref_Symbol_File.Value;
+ Error_Msg
+ (Project,
+ "library reference symbol file { does not exist",
+ Lib_Ref_Symbol_File.Location);
+ end if;
+
+ if Data.Symbol_Data.Symbol_File /= No_Name then
+ declare
+ Symbol : String :=
+ Get_Name_String
+ (Data.Symbol_Data.Symbol_File);
+
+ Reference : String :=
+ Get_Name_String
+ (Data.Symbol_Data.Reference);
+
+ begin
+ Canonical_Case_File_Name (Symbol);
+ Canonical_Case_File_Name (Reference);
+
+ if Symbol = Reference then
+ Error_Msg
+ (Project,
+ "reference symbol file and symbol file " &
+ "cannot be the same file",
+ Lib_Ref_Symbol_File.Location);
+ end if;
+ end;
+ end if;
+ end if;
+ end if;
end if;
end Standalone_Library;
end if;
@@ -2973,11 +3144,28 @@ package body Prj.Nmsc is
end if;
if Lib_Dir.Default then
- Error_Msg
- (Project,
- "a project extending a library project must specify " &
- "an attribute Library_Dir",
- Data.Location);
+
+ -- If the extending project is a virtual project, we
+ -- put the error message in the library project that
+ -- is extended, rather than in the extending all project.
+ -- Of course, we cannot put it in the virtual extending
+ -- project, because it has no source.
+
+ if Data.Virtual then
+ Error_Msg_Name_1 := Extended_Data.Name;
+
+ Error_Msg
+ (Project,
+ "library project % cannot be virtually extended",
+ Extended_Data.Location);
+
+ else
+ Error_Msg
+ (Project,
+ "a project extending a library project must " &
+ "specify an attribute Library_Dir",
+ Data.Location);
+ end if;
end if;
Projects.Table (Data.Extends).Library := False;
@@ -3001,6 +3189,7 @@ package body Prj.Nmsc is
Data.Library_Dir, Data.Display_Library_Dir);
if Data.Library_Dir = No_Name then
+
-- Get the absolute name of the library directory that
-- does not exist, to report an error.
diff --git a/gcc/ada/prj-part.adb b/gcc/ada/prj-part.adb
index 28e4af9bd44..1aa4725e46c 100644
--- a/gcc/ada/prj-part.adb
+++ b/gcc/ada/prj-part.adb
@@ -35,6 +35,7 @@ with Prj.Err; use Prj.Err;
with Scans; use Scans;
with Sinput; use Sinput;
with Sinput.P; use Sinput.P;
+with Snames;
with Table;
with Types; use Types;
@@ -44,6 +45,8 @@ with Ada.Exceptions; use Ada.Exceptions;
with GNAT.Directory_Operations; use GNAT.Directory_Operations;
with GNAT.OS_Lib; use GNAT.OS_Lib;
+with System.HTable; use System.HTable;
+
pragma Elaborate_All (GNAT.OS_Lib);
package body Prj.Part is
@@ -62,6 +65,11 @@ package body Prj.Part is
-- The path name(s) of directories where project files may reside.
-- May be empty.
+ type Extension_Origin is (None, Extending_Simple, Extending_All);
+ -- Type of parameter From_Extended for procedures Parse_Single_Project and
+ -- Post_Parse_Context_Clause. Extending_All means that we are parsing the
+ -- tree rooted at an extending all project.
+
------------------------------------
-- Local Packages and Subprograms --
------------------------------------
@@ -73,6 +81,7 @@ package body Prj.Part is
Path : Name_Id;
Location : Source_Ptr;
Limited_With : Boolean;
+ Node : Project_Node_Id;
Next : With_Id;
end record;
-- Information about an imported project, to be put in table Withs below
@@ -105,6 +114,42 @@ package body Prj.Part is
-- limited imported projects when there is a circularity with at least
-- one limited imported project file.
+ package Virtual_Hash is new Simple_HTable
+ (Header_Num => Header_Num,
+ Element => Project_Node_Id,
+ No_Element => Empty_Node,
+ Key => Project_Node_Id,
+ Hash => Prj.Tree.Hash,
+ Equal => "=");
+ -- Hash table to store the node id of the project for which a virtual
+ -- extending project need to be created.
+
+ package Processed_Hash is new Simple_HTable
+ (Header_Num => Header_Num,
+ Element => Boolean,
+ No_Element => False,
+ Key => Project_Node_Id,
+ Hash => Prj.Tree.Hash,
+ Equal => "=");
+ -- Hash table to store the project process when looking for project that
+ -- need to have a virtual extending project, to avoid processing the same
+ -- project twice.
+
+ procedure Create_Virtual_Extending_Project
+ (For_Project : Project_Node_Id;
+ Main_Project : Project_Node_Id);
+ -- Create a virtual extending project of For_Project. Main_Project is
+ -- the extending all project.
+
+ procedure Look_For_Virtual_Projects_For
+ (Proj : Project_Node_Id;
+ Potentially_Virtual : Boolean);
+ -- Look for projects that need to have a virtual extending project.
+ -- This procedure is recursive. If called with Potentially_Virtual set to
+ -- True, then Proj may need an virtual extending project; otherwise it
+ -- does not (because it is already extended), but other projects that it
+ -- imports may need to be virtually extended.
+
procedure Pre_Parse_Context_Clause (Context_Clause : out With_Id);
-- Parse the context clause of a project.
-- Store the paths and locations of the imported projects in table Withs.
@@ -115,7 +160,7 @@ package body Prj.Part is
(Context_Clause : With_Id;
Imported_Projects : out Project_Node_Id;
Project_Directory : Name_Id;
- From_Extended : Boolean);
+ From_Extended : Extension_Origin);
-- Parse the imported projects that have been stored in table Withs,
-- if any. From_Extended is used for the call to Parse_Single_Project
-- below.
@@ -124,10 +169,10 @@ package body Prj.Part is
(Project : out Project_Node_Id;
Path_Name : String;
Extended : Boolean;
- From_Extended : Boolean);
+ From_Extended : Extension_Origin);
-- Parse a project file.
-- Recursive procedure: it calls itself for imported and extended
- -- projects. When From_Extended is True, if the project has already
+ -- projects. When From_Extended is not None, if the project has already
-- been parsed and is an extended project A, return the ultimate
-- (not extended) project that extends A.
@@ -148,6 +193,132 @@ package body Prj.Part is
-- Returns No_Name if the path name is invalid, because the corresponding
-- project name does not have the syntax of an ada identifier.
+ --------------------------------------
+ -- Create_Virtual_Extending_Project --
+ --------------------------------------
+
+ procedure Create_Virtual_Extending_Project
+ (For_Project : Project_Node_Id;
+ Main_Project : Project_Node_Id)
+ is
+
+ Virtual_Name : constant String :=
+ Virtual_Prefix &
+ Get_Name_String (Name_Of (For_Project));
+ -- The name of the virtual extending project
+
+ Virtual_Name_Id : Name_Id;
+ -- Virtual extending project name id
+
+ Virtual_Path_Id : Name_Id;
+ -- Fake path name of the virtual extending project. The directory is
+ -- the same directory as the extending all project.
+
+ Virtual_Dir_Id : constant Name_Id :=
+ Immediate_Directory_Of (Path_Name_Of (Main_Project));
+ -- The directory of the extending all project
+
+ -- The source of the virtual extending project is something like:
+
+ -- project V$<project name> extends <project path> is
+
+ -- for Source_Dirs use ();
+
+ -- end V$<project name>;
+
+ -- The project directory cannot be specified during parsing; it will be
+ -- put directly in the virtual extending project data during processing.
+
+ -- Nodes that made up the virtual extending project
+
+ Virtual_Project : constant Project_Node_Id :=
+ Default_Project_Node (N_Project);
+ With_Clause : constant Project_Node_Id :=
+ Default_Project_Node (N_With_Clause);
+ Project_Declaration : constant Project_Node_Id :=
+ Default_Project_Node (N_Project_Declaration);
+ Source_Dirs_Declaration : constant Project_Node_Id :=
+ Default_Project_Node (N_Declarative_Item);
+ Source_Dirs_Attribute : constant Project_Node_Id :=
+ Default_Project_Node
+ (N_Attribute_Declaration, List);
+ Source_Dirs_Expression : constant Project_Node_Id :=
+ Default_Project_Node (N_Expression, List);
+ Source_Dirs_Term : constant Project_Node_Id :=
+ Default_Project_Node (N_Term, List);
+ Source_Dirs_List : constant Project_Node_Id :=
+ Default_Project_Node
+ (N_Literal_String_List, List);
+
+ begin
+ -- Get the virtual name id
+
+ Name_Len := Virtual_Name'Length;
+ Name_Buffer (1 .. Name_Len) := Virtual_Name;
+ Virtual_Name_Id := Name_Find;
+
+ -- Get the virtual path name
+
+ Get_Name_String (Path_Name_Of (Main_Project));
+
+ while Name_Len > 0
+ and then Name_Buffer (Name_Len) /= Directory_Separator
+ and then Name_Buffer (Name_Len) /= '/'
+ loop
+ Name_Len := Name_Len - 1;
+ end loop;
+
+ Name_Buffer (Name_Len + 1 .. Name_Len + Virtual_Name'Length) :=
+ Virtual_Name;
+ Name_Len := Name_Len + Virtual_Name'Length;
+ Virtual_Path_Id := Name_Find;
+
+ -- With clause
+
+ Set_Name_Of (With_Clause, Virtual_Name_Id);
+ Set_Path_Name_Of (With_Clause, Virtual_Path_Id);
+ Set_Project_Node_Of (With_Clause, Virtual_Project);
+ Set_Next_With_Clause_Of
+ (With_Clause, First_With_Clause_Of (Main_Project));
+ Set_First_With_Clause_Of (Main_Project, With_Clause);
+
+ -- Virtual project node
+
+ Set_Name_Of (Virtual_Project, Virtual_Name_Id);
+ Set_Path_Name_Of (Virtual_Project, Virtual_Path_Id);
+ Set_Location_Of (Virtual_Project, Location_Of (Main_Project));
+ Set_Directory_Of (Virtual_Project, Virtual_Dir_Id);
+ Set_Project_Declaration_Of (Virtual_Project, Project_Declaration);
+ Set_Extended_Project_Path_Of
+ (Virtual_Project, Path_Name_Of (For_Project));
+
+ -- Project declaration
+
+ Set_First_Declarative_Item_Of
+ (Project_Declaration, Source_Dirs_Declaration);
+ Set_Extended_Project_Of (Project_Declaration, For_Project);
+
+ -- Source_Dirs declaration
+
+ Set_Current_Item_Node (Source_Dirs_Declaration, Source_Dirs_Attribute);
+
+ -- Source_Dirs attribute
+
+ Set_Name_Of (Source_Dirs_Attribute, Snames.Name_Source_Dirs);
+ Set_Expression_Of (Source_Dirs_Attribute, Source_Dirs_Expression);
+
+ -- Source_Dirs expression
+
+ Set_First_Term (Source_Dirs_Expression, Source_Dirs_Term);
+
+ -- Source_Dirs term
+
+ Set_Current_Term (Source_Dirs_Term, Source_Dirs_List);
+
+ -- Source_Dirs empty list: nothing to do
+
+ end Create_Virtual_Extending_Project;
+
----------------------------
-- Immediate_Directory_Of --
----------------------------
@@ -181,6 +352,73 @@ package body Prj.Part is
return Name_Find;
end Immediate_Directory_Of;
+ -----------------------------------
+ -- Look_For_Virtual_Projects_For --
+ -----------------------------------
+
+ procedure Look_For_Virtual_Projects_For
+ (Proj : Project_Node_Id;
+ Potentially_Virtual : Boolean)
+
+ is
+ Declaration : Project_Node_Id := Empty_Node;
+ -- Node for the project declaration of Proj
+
+ With_Clause : Project_Node_Id := Empty_Node;
+ -- Node for a with clause of Proj
+
+ Imported : Project_Node_Id := Empty_Node;
+ -- Node for a project imported by Proj
+
+ Extended : Project_Node_Id := Empty_Node;
+ -- Node for the eventual project extended by Proj
+
+ begin
+ -- Nothing to do if Proj is not defined or if it has already been
+ -- processed.
+
+ if Proj /= Empty_Node and then not Processed_Hash.Get (Proj) then
+ -- Make sure the project will not be processed again
+
+ Processed_Hash.Set (Proj, True);
+
+ Declaration := Project_Declaration_Of (Proj);
+
+ if Declaration /= Empty_Node then
+ Extended := Extended_Project_Of (Declaration);
+ end if;
+
+ -- If this is a project that may need a virtual extending project
+ -- and it is not itself an extending project, put it in the list.
+
+ if Potentially_Virtual and then Extended = Empty_Node then
+ Virtual_Hash.Set (Proj, Proj);
+ end if;
+
+ -- Now check the projects it imports
+
+ With_Clause := First_With_Clause_Of (Proj);
+
+ while With_Clause /= Empty_Node loop
+ Imported := Project_Node_Of (With_Clause);
+
+ if Imported /= Empty_Node then
+ Look_For_Virtual_Projects_For
+ (Imported, Potentially_Virtual => True);
+ end if;
+
+ With_Clause := Next_With_Clause_Of (With_Clause);
+ end loop;
+
+ -- Check also the eventual project extended by Proj. As this project
+ -- is already extended, call recursively with Potentially_Virtual
+ -- being False.
+
+ Look_For_Virtual_Projects_For
+ (Extended, Potentially_Virtual => False);
+ end if;
+ end Look_For_Virtual_Projects_For;
+
-----------
-- Parse --
-----------
@@ -189,7 +427,8 @@ package body Prj.Part is
(Project : out Project_Node_Id;
Project_File_Name : String;
Always_Errout_Finalize : Boolean;
- Packages_To_Check : String_List_Access := All_Packages)
+ Packages_To_Check : String_List_Access := All_Packages;
+ Store_Comments : Boolean := False)
is
Current_Directory : constant String := Get_Current_Dir;
@@ -214,6 +453,8 @@ package body Prj.Part is
begin
Prj.Err.Initialize;
+ Prj.Err.Scanner.Set_Comment_As_Token (Store_Comments);
+ Prj.Err.Scanner.Set_End_Of_Line_As_Token (Store_Comments);
-- Parse the main project file
@@ -228,7 +469,84 @@ package body Prj.Part is
(Project => Project,
Path_Name => Path_Name,
Extended => False,
- From_Extended => False);
+ From_Extended => None);
+
+ -- If Project is an extending-all project, create the eventual
+ -- virtual extending projects and check that there are no illegally
+ -- imported projects.
+
+ if Project /= Empty_Node and then Is_Extending_All (Project) then
+ -- First look for projects that potentially need a virtual
+ -- extending project.
+
+ Virtual_Hash.Reset;
+ Processed_Hash.Reset;
+
+ -- Mark the extending all project as processed, to avoid checking
+ -- the imported projects in case of a "limited with" on this
+ -- extending all project.
+
+ Processed_Hash.Set (Project, True);
+
+ declare
+ Declaration : constant Project_Node_Id :=
+ Project_Declaration_Of (Project);
+ begin
+ Look_For_Virtual_Projects_For
+ (Extended_Project_Of (Declaration),
+ Potentially_Virtual => False);
+ end;
+
+ -- Now, check the projects directly imported by the main project.
+ -- Remove from the potentially virtual any project extended by one
+ -- of these imported projects. For non extending imported
+ -- projects, check that they do not belong to the project tree of
+ -- the project being "extended-all" by the main project.
+
+ declare
+ With_Clause : Project_Node_Id :=
+ First_With_Clause_Of (Project);
+ Imported : Project_Node_Id := Empty_Node;
+ Declaration : Project_Node_Id := Empty_Node;
+
+ begin
+ while With_Clause /= Empty_Node loop
+ Imported := Project_Node_Of (With_Clause);
+
+ if Imported /= Empty_Node then
+ Declaration := Project_Declaration_Of (Imported);
+
+ if Extended_Project_Of (Declaration) /= Empty_Node then
+ loop
+ Imported := Extended_Project_Of (Declaration);
+ exit when Imported = Empty_Node;
+ Virtual_Hash.Remove (Imported);
+ Declaration := Project_Declaration_Of (Imported);
+ end loop;
+
+ elsif Virtual_Hash.Get (Imported) /= Empty_Node then
+ Error_Msg
+ ("this project cannot be imported directly",
+ Location_Of (With_Clause));
+ end if;
+
+ end if;
+
+ With_Clause := Next_With_Clause_Of (With_Clause);
+ end loop;
+ end;
+
+ -- Now create all the virtual extending projects
+
+ declare
+ Proj : Project_Node_Id := Virtual_Hash.Get_First;
+ begin
+ while Proj /= Empty_Node loop
+ Create_Virtual_Extending_Project (Proj, Project);
+ Proj := Virtual_Hash.Get_Next;
+ end loop;
+ end;
+ end if;
-- If there were any kind of error during the parsing, serious
-- or not, then the parsing fails.
@@ -264,6 +582,8 @@ package body Prj.Part is
Current_With : With_Record;
+ Current_With_Node : Project_Node_Id := Empty_Node;
+
begin
-- Assume no context clause
@@ -274,6 +594,7 @@ package body Prj.Part is
-- or we have exhausted the with clauses.
while Token = Tok_With or else Token = Tok_Limited loop
+ Current_With_Node := Default_Project_Node (Of_Kind => N_With_Clause);
Limited_With := Token = Tok_Limited;
if Limited_With then
@@ -298,6 +619,7 @@ package body Prj.Part is
(Path => Token_Name,
Location => Token_Ptr,
Limited_With => Limited_With,
+ Node => Current_With_Node,
Next => No_With);
Withs.Increment_Last;
@@ -315,6 +637,8 @@ package body Prj.Part is
Scan;
if Token = Tok_Semicolon then
+ Set_End_Of_Line (Current_With_Node);
+ Set_Previous_Line_Node (Current_With_Node);
-- End of (possibly multiple) with clause;
@@ -325,6 +649,9 @@ package body Prj.Part is
Error_Msg ("expected comma or semi colon", Token_Ptr);
exit Comma_Loop;
end if;
+
+ Current_With_Node :=
+ Default_Project_Node (Of_Kind => N_With_Clause);
end loop Comma_Loop;
end loop With_Loop;
end Pre_Parse_Context_Clause;
@@ -338,7 +665,7 @@ package body Prj.Part is
(Context_Clause : With_Id;
Imported_Projects : out Project_Node_Id;
Project_Directory : Name_Id;
- From_Extended : Boolean)
+ From_Extended : Extension_Origin)
is
Current_With_Clause : With_Id := Context_Clause;
@@ -400,13 +727,11 @@ package body Prj.Part is
-- First with clause of the context clause
- Current_Project := Default_Project_Node
- (Of_Kind => N_With_Clause);
+ Current_Project := Current_With.Node;
Imported_Projects := Current_Project;
else
- Next_Project := Default_Project_Node
- (Of_Kind => N_With_Clause);
+ Next_Project := Current_With.Node;
Set_Next_With_Clause_Of (Current_Project, Next_Project);
Current_Project := Next_Project;
end if;
@@ -494,7 +819,7 @@ package body Prj.Part is
(Project : out Project_Node_Id;
Path_Name : String;
Extended : Boolean;
- From_Extended : Boolean)
+ From_Extended : Extension_Origin)
is
Normed_Path_Name : Name_Id;
Canonical_Path_Name : Name_Id;
@@ -515,6 +840,8 @@ package body Prj.Part is
use Tree_Private_Part;
+ Project_Comment_State : Tree.Comment_State;
+
begin
declare
Normed : String := Normalize_Pathname (Path_Name);
@@ -554,6 +881,8 @@ package body Prj.Part is
end if;
end loop;
+ -- Put the new path name on the stack
+
Project_Stack.Increment_Last;
Project_Stack.Table (Project_Stack.Last).Name := Canonical_Path_Name;
@@ -583,7 +912,7 @@ package body Prj.Part is
-- in an extended project, replace A with the ultimate project
-- extending A.
- if From_Extended then
+ if From_Extended /= None then
declare
Decl : Project_Node_Id :=
Project_Declaration_Of
@@ -619,6 +948,7 @@ package body Prj.Part is
Save_Project_Scan_State (Project_Scan_State);
Source_Index := Load_Project_File (Path_Name);
+ Tree.Save (Project_Comment_State);
-- if we cannot find it, we stop
@@ -629,6 +959,7 @@ package body Prj.Part is
end if;
Prj.Err.Scanner.Initialize_Scanner (Types.No_Unit, Source_Index);
+ Tree.Reset_State;
Scan;
if Name_From_Path = No_Name then
@@ -648,6 +979,10 @@ package body Prj.Part is
Write_Eol;
end if;
+ -- Is there any imported project?
+
+ Pre_Parse_Context_Clause (First_With);
+
Project_Directory := Immediate_Directory_Of (Normed_Path_Name);
Project := Default_Project_Node (Of_Kind => N_Project);
Project_Stack.Table (Project_Stack.Last).Id := Project;
@@ -655,10 +990,6 @@ package body Prj.Part is
Set_Path_Name_Of (Project, Normed_Path_Name);
Set_Location_Of (Project, Token_Ptr);
- -- Is there any imported project?
-
- Pre_Parse_Context_Clause (First_With);
-
Expect (Tok_Project, "PROJECT");
-- Mark location of PROJECT token if present
@@ -745,13 +1076,26 @@ package body Prj.Part is
declare
Imported_Projects : Project_Node_Id := Empty_Node;
+ From_Ext : Extension_Origin := None;
begin
+ -- Extending_All is always propagated
+
+ if From_Extended = Extending_All then
+ From_Ext := Extending_All;
+
+ -- Otherwise, From_Extended is set to Extending_Single if the
+ -- current project is an extending project.
+
+ elsif Extended then
+ From_Ext := Extending_Simple;
+ end if;
+
Post_Parse_Context_Clause
(Context_Clause => First_With,
Imported_Projects => Imported_Projects,
Project_Directory => Project_Directory,
- From_Extended => Extended);
+ From_Extended => From_Ext);
Set_First_With_Clause_Of (Project, Imported_Projects);
end;
@@ -797,6 +1141,12 @@ package body Prj.Part is
-- We are extending another project
Scan; -- scan past EXTENDS
+
+ if Token = Tok_All then
+ Set_Is_Extending_All (Project);
+ Scan; -- scan past ALL
+ end if;
+
Expect (Tok_String_Literal, "literal string");
if Token = Tok_String_Literal then
@@ -836,11 +1186,27 @@ package body Prj.Part is
end if;
else
- Parse_Single_Project
- (Project => Extended_Project,
- Path_Name => Extended_Project_Path_Name,
- Extended => True,
- From_Extended => False);
+ declare
+ From_Extended : Extension_Origin := None;
+
+ begin
+ if Is_Extending_All (Project) then
+ From_Extended := Extending_All;
+ end if;
+
+ Parse_Single_Project
+ (Project => Extended_Project,
+ Path_Name => Extended_Project_Path_Name,
+ Extended => True,
+ From_Extended => From_Extended);
+ end;
+
+ -- A project that extends an extending-all project is also
+ -- an extending-all project.
+
+ if Is_Extending_All (Extended_Project) then
+ Set_Is_Extending_All (Project);
+ end if;
end if;
end;
@@ -848,6 +1214,30 @@ package body Prj.Part is
end if;
end if;
+ -- Check that a non extending-all project does not import an
+ -- extending-all project.
+
+ if not Is_Extending_All (Project) then
+ declare
+ With_Clause : Project_Node_Id := First_With_Clause_Of (Project);
+ Imported : Project_Node_Id := Empty_Node;
+
+ begin
+ With_Clause_Loop :
+ while With_Clause /= Empty_Node loop
+ Imported := Project_Node_Of (With_Clause);
+ With_Clause := Next_With_Clause_Of (With_Clause);
+
+ if Is_Extending_All (Imported) then
+ Error_Msg_Name_1 := Name_Of (Imported);
+ Error_Msg ("cannot import extending-all project {",
+ Token_Ptr);
+ exit With_Clause_Loop;
+ end if;
+ end loop With_Clause_Loop;
+ end;
+ end if;
+
-- Check that a project with a name including a dot either imports
-- or extends the project whose name precedes the last dot.
@@ -903,6 +1293,9 @@ package body Prj.Part is
end if;
Expect (Tok_Is, "IS");
+ Set_End_Of_Line (Project);
+ Set_Previous_Line_Node (Project);
+ Set_Next_End_Node (Project);
declare
Project_Declaration : Project_Node_Id := Empty_Node;
@@ -923,6 +1316,7 @@ package body Prj.Part is
end;
Expect (Tok_End, "END");
+ Remove_Next_End_Node;
-- Skip "end" if present
@@ -980,6 +1374,7 @@ package body Prj.Part is
-- source.
if Token = Tok_Semicolon then
+ Set_Previous_End_Node (Project);
Scan;
if Token /= Tok_EOF then
@@ -995,6 +1390,15 @@ package body Prj.Part is
-- And remove the project from the project stack
Project_Stack.Decrement_Last;
+
+ -- Indicate if there are unkept comments
+
+ Tree.Set_Project_File_Includes_Unkept_Comments
+ (Node => Project, To => Tree.There_Are_Unkept_Comments);
+
+ -- And restore the comment state that was saved
+
+ Tree.Restore (Project_Comment_State);
end Parse_Single_Project;
-----------------------
diff --git a/gcc/ada/prj-part.ads b/gcc/ada/prj-part.ads
index a4d20faef1a..5b8f3921928 100644
--- a/gcc/ada/prj-part.ads
+++ b/gcc/ada/prj-part.ads
@@ -34,13 +34,15 @@ package Prj.Part is
(Project : out Project_Node_Id;
Project_File_Name : String;
Always_Errout_Finalize : Boolean;
- Packages_To_Check : String_List_Access := All_Packages);
+ Packages_To_Check : String_List_Access := All_Packages;
+ Store_Comments : Boolean := False);
-- Parse project file and all its imported project files and create a tree.
-- Return the node for the project (or Empty_Node if parsing failed). If
-- Always_Errout_Finalize is True, Errout.Finalize is called in all cases,
-- Otherwise, Errout.Finalize is only called if there are errors (but not
-- if there are only warnings). Packages_To_Check indicates the packages
-- where any unknown attribute produces an error. For other packages, an
- -- unknown attribute produces a warning.
+ -- unknown attribute produces a warning. When Store_Comments is True,
+ -- comments are stored in the parse tree.
end Prj.Part;
diff --git a/gcc/ada/prj-pp.adb b/gcc/ada/prj-pp.adb
index 8bbc265efc8..1ac45ed28e3 100644
--- a/gcc/ada/prj-pp.adb
+++ b/gcc/ada/prj-pp.adb
@@ -27,8 +27,8 @@
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Hostparm;
-with Namet; use Namet;
-with Output; use Output;
+with Namet; use Namet;
+with Output; use Output;
with Snames;
package body Prj.PP is
@@ -47,7 +47,6 @@ package body Prj.PP is
procedure Indicate_Tested (Kind : Project_Node_Kind);
-- Set the corresponding component of array Not_Tested to False.
-- Only called by pragmas Debug.
- --
---------------------
-- Indicate_Tested --
@@ -98,9 +97,13 @@ package body Prj.PP is
procedure Write_Line (S : String);
-- Outputs S followed by a new line
- procedure Write_String (S : String);
+ procedure Write_String (S : String; Truncated : Boolean := False);
-- Outputs S using Write_Str, starting a new line if line would
- -- become too long.
+ -- become too long, when Truncated = False.
+ -- When Truncated = True, only the part of the string that can fit on
+ -- the line is output.
+
+ procedure Write_End_Of_Line_Comment (Node : Project_Node_Id);
Write_Char : Write_Char_Ap := Output.Write_Char'Access;
Write_Eol : Write_Eol_Ap := Output.Write_Eol'Access;
@@ -246,6 +249,21 @@ package body Prj.PP is
end if;
end Write_Empty_Line;
+ -------------------------------
+ -- Write_End_Of_Line_Comment --
+ -------------------------------
+
+ procedure Write_End_Of_Line_Comment (Node : Project_Node_Id) is
+ Value : Name_Id := End_Of_Line_Comment (Node);
+ begin
+ if Value /= No_Name then
+ Write_String (" --");
+ Write_String (Get_Name_String (Value), Truncated => True);
+ end if;
+
+ Write_Line ("");
+ end Write_End_Of_Line_Comment;
+
----------------
-- Write_Line --
----------------
@@ -262,18 +280,24 @@ package body Prj.PP is
-- Write_String --
------------------
- procedure Write_String (S : String) is
+ procedure Write_String (S : String; Truncated : Boolean := False) is
+ Length : Natural := S'Length;
begin
-- If the string would not fit on the line,
-- start a new line.
- if Column + S'Length > Max_Line_Length then
- Write_Eol.all;
- Column := 0;
+ if Column + Length > Max_Line_Length then
+ if Truncated then
+ Length := Max_Line_Length - Column;
+
+ else
+ Write_Eol.all;
+ Column := 0;
+ end if;
end if;
- Write_Str (S);
- Column := Column + S'Length;
+ Write_Str (S (S'First .. S'First + Length - 1));
+ Column := Column + Length;
end Write_String;
-----------
@@ -296,6 +320,7 @@ package body Prj.PP is
Write_Empty_Line (Always => True);
end if;
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("project ");
Output_Name (Name_Of (Node));
@@ -307,21 +332,26 @@ package body Prj.PP is
Output_String (Extended_Project_Path_Of (Node));
end if;
- Write_Line (" is");
+ Write_String (" is");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent + Increment);
Write_Empty_Line (Always => True);
-- Output all of the declarations in the project
Print (Project_Declaration_Of (Node), Indent);
+ Print (First_Comment_Before_End (Node), Indent + Increment);
Start_Line (Indent);
Write_String ("end ");
Output_Name (Name_Of (Node));
Write_Line (";");
+ Print (First_Comment_After_End (Node), Indent);
when N_With_Clause =>
pragma Debug (Indicate_Tested (N_With_Clause));
if Name_Of (Node) /= No_Name then
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
if Non_Limited_Project_Node_Of (Node) = Empty_Node then
@@ -330,7 +360,9 @@ package body Prj.PP is
Write_String ("with ");
Output_String (String_Value_Of (Node));
- Write_Line (";");
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent);
end if;
Print (Next_With_Clause_Of (Node), Indent);
@@ -352,6 +384,7 @@ package body Prj.PP is
when N_Package_Declaration =>
pragma Debug (Indicate_Tested (N_Package_Declaration));
Write_Empty_Line (Always => True);
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("package ");
Output_Name (Name_Of (Node));
@@ -362,10 +395,14 @@ package body Prj.PP is
(Name_Of (Project_Of_Renamed_Package_Of (Node)));
Write_String (".");
Output_Name (Name_Of (Node));
- Write_Line (";");
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After_End (Node), Indent);
else
- Write_Line (" is");
+ Write_String (" is");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent + Increment);
if First_Declarative_Item_Of (Node) /= Empty_Node then
Print
@@ -373,15 +410,19 @@ package body Prj.PP is
Indent + Increment);
end if;
+ Print (First_Comment_Before_End (Node),
+ Indent + Increment);
Start_Line (Indent);
Write_String ("end ");
Output_Name (Name_Of (Node));
Write_Line (";");
+ Print (First_Comment_After_End (Node), Indent);
Write_Empty_Line;
end if;
when N_String_Type_Declaration =>
pragma Debug (Indicate_Tested (N_String_Type_Declaration));
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("type ");
Output_Name (Name_Of (Node));
@@ -404,7 +445,9 @@ package body Prj.PP is
end loop;
end;
- Write_Line (");");
+ Write_String (");");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent);
when N_Literal_String =>
pragma Debug (Indicate_Tested (N_Literal_String));
@@ -412,6 +455,7 @@ package body Prj.PP is
when N_Attribute_Declaration =>
pragma Debug (Indicate_Tested (N_Attribute_Declaration));
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("for ");
Output_Attribute_Name (Name_Of (Node));
@@ -424,26 +468,34 @@ package body Prj.PP is
Write_String (" use ");
Print (Expression_Of (Node), Indent);
- Write_Line (";");
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent);
when N_Typed_Variable_Declaration =>
pragma Debug
(Indicate_Tested (N_Typed_Variable_Declaration));
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Output_Name (Name_Of (Node));
Write_String (" : ");
Output_Name (Name_Of (String_Type_Of (Node)));
Write_String (" := ");
Print (Expression_Of (Node), Indent);
- Write_Line (";");
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent);
when N_Variable_Declaration =>
pragma Debug (Indicate_Tested (N_Variable_Declaration));
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Output_Name (Name_Of (Node));
Write_String (" := ");
Print (Expression_Of (Node), Indent);
- Write_Line (";");
+ Write_String (";");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent);
when N_Expression =>
pragma Debug (Indicate_Tested (N_Expression));
@@ -566,10 +618,13 @@ package body Prj.PP is
if Is_Non_Empty then
Write_Empty_Line;
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("case ");
Print (Case_Variable_Reference_Of (Node), Indent);
- Write_Line (" is");
+ Write_String (" is");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent + Increment);
declare
Case_Item : Project_Node_Id :=
@@ -584,8 +639,11 @@ package body Prj.PP is
end loop;
end;
+ Print (First_Comment_Before_End (Node),
+ Indent + Increment);
Start_Line (Indent);
Write_Line ("end case;");
+ Print (First_Comment_After_End (Node), Indent);
end if;
end;
@@ -596,6 +654,7 @@ package body Prj.PP is
or else not Eliminate_Empty_Case_Constructions
then
Write_Empty_Line;
+ Print (First_Comment_Before (Node), Indent);
Start_Line (Indent);
Write_String ("when ");
@@ -618,7 +677,9 @@ package body Prj.PP is
end;
end if;
- Write_Line (" =>");
+ Write_String (" =>");
+ Write_End_Of_Line_Comment (Node);
+ Print (First_Comment_After (Node), Indent + Increment);
declare
First : constant Project_Node_Id :=
@@ -626,13 +687,39 @@ package body Prj.PP is
begin
if First = Empty_Node then
- Write_Eol.all;
+ Write_Empty_Line;
else
Print (First, Indent + Increment);
end if;
end;
end if;
+
+ when N_Comment_Zones =>
+
+ -- Nothing to do, because it will not be processed directly
+
+ null;
+
+ when N_Comment =>
+ pragma Debug (Indicate_Tested (N_Comment));
+
+ if Follows_Empty_Line (Node) then
+ Write_Empty_Line;
+ end if;
+
+ Start_Line (Indent);
+ Write_String ("--");
+ Write_String
+ (Get_Name_String (String_Value_Of (Node)),
+ Truncated => True);
+ Write_Line ("");
+
+ if Is_Followed_By_Empty_Line (Node) then
+ Write_Empty_Line;
+ end if;
+
+ Print (Next_Comment (Node), Indent);
end case;
end if;
end Print;
@@ -674,7 +761,7 @@ package body Prj.PP is
Output.Write_Line ("Project_Node_Kinds not tested:");
for Kind in Project_Node_Kind loop
- if Not_Tested (Kind) then
+ if Kind /= N_Comment_Zones and then Not_Tested (Kind) then
Output.Write_Str (" ");
Output.Write_Line (Project_Node_Kind'Image (Kind));
end if;
diff --git a/gcc/ada/prj-proc.adb b/gcc/ada/prj-proc.adb
index fc0d816d9af..e75057a883d 100644
--- a/gcc/ada/prj-proc.adb
+++ b/gcc/ada/prj-proc.adb
@@ -56,8 +56,9 @@ package body Prj.Proc is
-- arguments are not null string.
procedure Add_Attributes
- (Decl : in out Declarations;
- First : Attribute_Node_Id);
+ (Project : Project_Id;
+ Decl : in out Declarations;
+ First : Attribute_Node_Id);
-- Add all attributes, starting with First, with their default
-- values to the package or project with declarations Decl.
@@ -66,21 +67,18 @@ package body Prj.Proc is
From_Project_Node : Project_Node_Id;
Pkg : Package_Id;
First_Term : Project_Node_Id;
- Kind : Variable_Kind)
- return Variable_Value;
+ Kind : Variable_Kind) return Variable_Value;
-- From N_Expression project node From_Project_Node, compute the value
-- of an expression and return it as a Variable_Value.
function Imported_Or_Extended_Project_From
(Project : Project_Id;
- With_Name : Name_Id)
- return Project_Id;
+ With_Name : Name_Id) return Project_Id;
-- Find an imported or extended project of Project whose name is With_Name
function Package_From
(Project : Project_Id;
- With_Name : Name_Id)
- return Package_Id;
+ With_Name : Name_Id) return Package_Id;
-- Find the package of Project whose name is With_Name
procedure Process_Declarative_Items
@@ -143,8 +141,9 @@ package body Prj.Proc is
--------------------
procedure Add_Attributes
- (Decl : in out Declarations;
- First : Attribute_Node_Id)
+ (Project : Project_Id;
+ Decl : in out Declarations;
+ First : Attribute_Node_Id)
is
The_Attribute : Attribute_Node_Id := First;
Attribute_Data : Attribute_Record;
@@ -171,7 +170,8 @@ package body Prj.Proc is
when Single =>
New_Attribute :=
- (Kind => Single,
+ (Project => Project,
+ Kind => Single,
Location => No_Location,
Default => True,
Value => Empty_String);
@@ -180,7 +180,8 @@ package body Prj.Proc is
when List =>
New_Attribute :=
- (Kind => List,
+ (Project => Project,
+ Kind => List,
Location => No_Location,
Default => True,
Values => Nil_String);
@@ -225,8 +226,7 @@ package body Prj.Proc is
From_Project_Node : Project_Node_Id;
Pkg : Package_Id;
First_Term : Project_Node_Id;
- Kind : Variable_Kind)
- return Variable_Value
+ Kind : Variable_Kind) return Variable_Value
is
The_Term : Project_Node_Id := First_Term;
-- The term in the expression list
@@ -241,6 +241,7 @@ package body Prj.Proc is
-- Reference to the last string elements in Result, when Kind is List.
begin
+ Result.Project := Project;
Result.Location := Location_Of (First_Term);
-- Process each term of the expression, starting with First_Term
@@ -536,14 +537,16 @@ package body Prj.Proc is
Expression_Kind_Of (The_Current_Term) = List
then
The_Variable :=
- (Kind => List,
+ (Project => Project,
+ Kind => List,
Location => No_Location,
Default => True,
Values => Nil_String);
else
The_Variable :=
- (Kind => Single,
+ (Project => Project,
+ Kind => Single,
Location => No_Location,
Default => True,
Value => Empty_String);
@@ -739,8 +742,7 @@ package body Prj.Proc is
function Imported_Or_Extended_Project_From
(Project : Project_Id;
- With_Name : Name_Id)
- return Project_Id
+ With_Name : Name_Id) return Project_Id
is
Data : constant Project_Data := Projects.Table (Project);
List : Project_List := Data.Imported_Projects;
@@ -779,8 +781,7 @@ package body Prj.Proc is
function Package_From
(Project : Project_Id;
- With_Name : Name_Id)
- return Package_Id
+ With_Name : Name_Id) return Package_Id
is
Data : constant Project_Data := Projects.Table (Project);
Result : Package_Id := Data.Decl.Packages;
@@ -840,6 +841,25 @@ package body Prj.Proc is
Check (Project);
end if;
+ -- If main project is an extending all project, set the object
+ -- directory of all virtual extending projects to the object directory
+ -- of the main project.
+
+ if Project /= No_Project
+ and then Is_Extending_All (From_Project_Node)
+ then
+ declare
+ Object_Dir : constant Name_Id :=
+ Projects.Table (Project).Object_Directory;
+ begin
+ for Index in Projects.First .. Projects.Last loop
+ if Projects.Table (Index).Virtual then
+ Projects.Table (Index).Object_Directory := Object_Dir;
+ end if;
+ end loop;
+ end;
+ end if;
+
-- Check that no extended project shares its object directory with
-- another project.
@@ -855,20 +875,39 @@ package body Prj.Proc is
and then Projects.Table (Prj).Sources_Present
and then Projects.Table (Prj).Object_Directory = Obj_Dir
then
- Error_Msg_Name_1 := Projects.Table (Extending).Name;
- Error_Msg_Name_2 := Projects.Table (Extended).Name;
+ if Projects.Table (Extending).Virtual then
+ Error_Msg_Name_1 := Projects.Table (Extended).Name;
- if Error_Report = null then
- Error_Msg ("project % cannot extend project %",
- Projects.Table (Extending).Location);
+ if Error_Report = null then
+ Error_Msg
+ ("project % cannot be extended by " &
+ "a virtual project",
+ Projects.Table (Extending).Location);
+
+ else
+ Error_Report
+ ("project """ &
+ Get_Name_String (Error_Msg_Name_1) &
+ """ cannot be extended by a virtual project",
+ Project);
+ end if;
else
- Error_Report
- ("project """ &
- Get_Name_String (Error_Msg_Name_1) &
- """ cannot extend project """ &
- Get_Name_String (Error_Msg_Name_2) & '"',
- Project);
+ Error_Msg_Name_1 := Projects.Table (Extending).Name;
+ Error_Msg_Name_2 := Projects.Table (Extended).Name;
+
+ if Error_Report = null then
+ Error_Msg ("project % cannot extend project %",
+ Projects.Table (Extending).Location);
+
+ else
+ Error_Report
+ ("project """ &
+ Get_Name_String (Error_Msg_Name_1) &
+ """ cannot extend project """ &
+ Get_Name_String (Error_Msg_Name_2) & '"',
+ Project);
+ end if;
end if;
Error_Msg_Name_1 := Projects.Table (Extended).Name;
@@ -997,7 +1036,8 @@ package body Prj.Proc is
-- Set the default values of the attributes
Add_Attributes
- (Packages.Table (New_Pkg).Decl,
+ (Project,
+ Packages.Table (New_Pkg).Decl,
Package_Attributes.Table
(Package_Id_Of (Current_Item)).First_Attribute);
@@ -1222,6 +1262,8 @@ package body Prj.Proc is
Array_Elements.Table (New_Element) :=
Array_Elements.Table (Orig_Element);
+ Array_Elements.Table (New_Element).Value.Project :=
+ Project;
-- Adjust the Next link
@@ -1789,6 +1831,18 @@ package body Prj.Proc is
Processed_Data.Name := Name;
+ Get_Name_String (Name);
+
+ -- If name starts with the virtual prefix, flag the project as
+ -- being a virtual extending project.
+
+ if Name_Len > Virtual_Prefix'Length
+ and then Name_Buffer (1 .. Virtual_Prefix'Length) =
+ Virtual_Prefix
+ then
+ Processed_Data.Virtual := True;
+ end if;
+
Processed_Data.Display_Path_Name :=
Path_Name_Of (From_Project_Node);
Get_Name_String (Processed_Data.Display_Path_Name);
@@ -1806,7 +1860,7 @@ package body Prj.Proc is
Processed_Data.Extended_By := Extended_By;
Processed_Data.Naming := Standard_Naming_Data;
- Add_Attributes (Processed_Data.Decl, Attribute_First);
+ Add_Attributes (Project, Processed_Data.Decl, Attribute_First);
With_Clause := First_With_Clause_Of (From_Project_Node);
while With_Clause /= Empty_Node loop
diff --git a/gcc/ada/prj-tree.adb b/gcc/ada/prj-tree.adb
index 6587d35300b..7e548e8ce2e 100644
--- a/gcc/ada/prj-tree.adb
+++ b/gcc/ada/prj-tree.adb
@@ -24,17 +24,193 @@
-- --
------------------------------------------------------------------------------
+with Prj.Err;
+
package body Prj.Tree is
+ Node_With_Comments : constant array (Project_Node_Kind) of Boolean :=
+ (N_Project => True,
+ N_With_Clause => True,
+ N_Project_Declaration => False,
+ N_Declarative_Item => False,
+ N_Package_Declaration => True,
+ N_String_Type_Declaration => True,
+ N_Literal_String => False,
+ N_Attribute_Declaration => True,
+ N_Typed_Variable_Declaration => True,
+ N_Variable_Declaration => True,
+ N_Expression => False,
+ N_Term => False,
+ N_Literal_String_List => False,
+ N_Variable_Reference => False,
+ N_External_Value => False,
+ N_Attribute_Reference => False,
+ N_Case_Construction => True,
+ N_Case_Item => True,
+ N_Comment_Zones => True,
+ N_Comment => True);
+ -- Indicates the kinds of node that may have associated comments
+
+ package Next_End_Nodes is new Table.Table
+ (Table_Component_Type => Project_Node_Id,
+ Table_Index_Type => Natural,
+ Table_Low_Bound => 1,
+ Table_Initial => 10,
+ Table_Increment => 100,
+ Table_Name => "Next_End_Nodes");
+ -- A stack of nodes to indicates to what node the next "end" is associated
+
use Tree_Private_Part;
+ End_Of_Line_Node : Project_Node_Id := Empty_Node;
+ -- The node an end of line comment may be associated with
+
+ Previous_Line_Node : Project_Node_Id := Empty_Node;
+ -- The node an immediately following comment may be associated with
+
+ Previous_End_Node : Project_Node_Id := Empty_Node;
+ -- The node comments immediately following an "end" line may be
+ -- associated with.
+
+ Unkept_Comments : Boolean := False;
+ -- Set to True when some comments may not be associated with any node
+
+ function Comment_Zones_Of
+ (Node : Project_Node_Id) return Project_Node_Id;
+ -- Returns the ID of the N_Comment_Zones node associated with node Node.
+ -- If there is not already an N_Comment_Zones node, create one and
+ -- associate it with node Node.
+
+ ------------------
+ -- Add_Comments --
+ ------------------
+
+ procedure Add_Comments (To : Project_Node_Id; Where : Comment_Location) is
+ Zone : Project_Node_Id := Empty_Node;
+ Previous : Project_Node_Id := Empty_Node;
+
+ begin
+ pragma Assert
+ (To /= Empty_Node
+ and then
+ Project_Nodes.Table (To).Kind /= N_Comment);
+
+ Zone := Project_Nodes.Table (To).Comments;
+
+ if Zone = Empty_Node then
+
+ -- Create new N_Comment_Zones node
+
+ Project_Nodes.Increment_Last;
+ Project_Nodes.Table (Project_Nodes.Last) :=
+ (Kind => N_Comment_Zones,
+ Expr_Kind => Undefined,
+ Location => No_Location,
+ Directory => No_Name,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => No_Name,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Flag1 => False,
+ Flag2 => False,
+ Comments => Empty_Node);
+
+ Zone := Project_Nodes.Last;
+ Project_Nodes.Table (To).Comments := Zone;
+ end if;
+
+ if Where = End_Of_Line then
+ Project_Nodes.Table (Zone).Value := Comments.Table (1).Value;
+
+ else
+ -- Get each comments in the Comments table and link them to node To
+
+ for J in 1 .. Comments.Last loop
+
+ -- Create new N_Comment node
+
+ if (Where = After or else Where = After_End) and then
+ Token /= Tok_EOF and then
+ Comments.Table (J).Follows_Empty_Line
+ then
+ Comments.Table (1 .. Comments.Last - J + 1) :=
+ Comments.Table (J .. Comments.Last);
+ Comments.Set_Last (Comments.Last - J + 1);
+ return;
+ end if;
+
+ Project_Nodes.Increment_Last;
+ Project_Nodes.Table (Project_Nodes.Last) :=
+ (Kind => N_Comment,
+ Expr_Kind => Undefined,
+ Flag1 => Comments.Table (J).Follows_Empty_Line,
+ Flag2 =>
+ Comments.Table (J).Is_Followed_By_Empty_Line,
+ Location => No_Location,
+ Directory => No_Name,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => Comments.Table (J).Value,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Comments => Empty_Node);
+
+ -- If this is the first comment, put it in the right field of
+ -- the node Zone.
+
+ if Previous = Empty_Node then
+ case Where is
+ when Before =>
+ Project_Nodes.Table (Zone).Field1 := Project_Nodes.Last;
+
+ when After =>
+ Project_Nodes.Table (Zone).Field2 := Project_Nodes.Last;
+
+ when Before_End =>
+ Project_Nodes.Table (Zone).Field3 := Project_Nodes.Last;
+
+ when After_End =>
+ Project_Nodes.Table (Zone).Comments := Project_Nodes.Last;
+
+ when End_Of_Line =>
+ null;
+ end case;
+
+ else
+ -- When it is not the first, link it to the previous one
+
+ Project_Nodes.Table (Previous).Comments := Project_Nodes.Last;
+ end if;
+
+ -- This node becomes the previous one for the next comment, if
+ -- there is one.
+
+ Previous := Project_Nodes.Last;
+ end loop;
+ end if;
+
+ -- Empty the Comments table, so that there is no risk to link the same
+ -- comments to another node.
+
+ Comments.Set_Last (0);
+ end Add_Comments;
+
+
--------------------------------
-- Associative_Array_Index_Of --
--------------------------------
function Associative_Array_Index_Of
- (Node : Project_Node_Id)
- return Name_Id
+ (Node : Project_Node_Id) return Name_Id
is
begin
pragma Assert
@@ -51,8 +227,7 @@ package body Prj.Tree is
----------------------------
function Associative_Package_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -67,8 +242,7 @@ package body Prj.Tree is
----------------------------
function Associative_Project_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -90,7 +264,7 @@ package body Prj.Tree is
(Project_Nodes.Table (Node).Kind = N_Attribute_Declaration
or else
Project_Nodes.Table (Node).Kind = N_Attribute_Reference));
- return Project_Nodes.Table (Node).Case_Insensitive;
+ return Project_Nodes.Table (Node).Flag1;
end Case_Insensitive;
--------------------------------
@@ -98,8 +272,7 @@ package body Prj.Tree is
--------------------------------
function Case_Variable_Reference_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -109,13 +282,54 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field1;
end Case_Variable_Reference_Of;
+ ----------------------
+ -- Comment_Zones_Of --
+ ----------------------
+
+ function Comment_Zones_Of
+ (Node : Project_Node_Id) return Project_Node_Id
+ is
+ Zone : Project_Node_Id;
+
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ -- If there is not already an N_Comment_Zones associated, create a new
+ -- one and associate it with node Node.
+
+ if Zone = Empty_Node then
+ Project_Nodes.Increment_Last;
+ Zone := Project_Nodes.Last;
+ Project_Nodes.Table (Zone) :=
+ (Kind => N_Comment_Zones,
+ Location => No_Location,
+ Directory => No_Name,
+ Expr_Kind => Undefined,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => No_Name,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Flag1 => False,
+ Flag2 => False,
+ Comments => Empty_Node);
+ Project_Nodes.Table (Node).Comments := Zone;
+ end if;
+
+ return Zone;
+ end Comment_Zones_Of;
+
-----------------------
-- Current_Item_Node --
-----------------------
function Current_Item_Node
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -130,8 +344,7 @@ package body Prj.Tree is
------------------
function Current_Term
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -147,27 +360,118 @@ package body Prj.Tree is
function Default_Project_Node
(Of_Kind : Project_Node_Kind;
- And_Expr_Kind : Variable_Kind := Undefined)
- return Project_Node_Id
+ And_Expr_Kind : Variable_Kind := Undefined) return Project_Node_Id
is
+ Result : Project_Node_Id;
+ Zone : Project_Node_Id;
+ Previous : Project_Node_Id;
+
begin
+ -- Create new node with specified kind and expression kind
+
Project_Nodes.Increment_Last;
Project_Nodes.Table (Project_Nodes.Last) :=
- (Kind => Of_Kind,
- Location => No_Location,
- Directory => No_Name,
- Expr_Kind => And_Expr_Kind,
- Variables => Empty_Node,
- Packages => Empty_Node,
- Pkg_Id => Empty_Package,
- Name => No_Name,
- Path_Name => No_Name,
- Value => No_Name,
- Field1 => Empty_Node,
- Field2 => Empty_Node,
- Field3 => Empty_Node,
- Case_Insensitive => False);
- return Project_Nodes.Last;
+ (Kind => Of_Kind,
+ Location => No_Location,
+ Directory => No_Name,
+ Expr_Kind => And_Expr_Kind,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => No_Name,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Flag1 => False,
+ Flag2 => False,
+ Comments => Empty_Node);
+
+ -- Save the new node for the returned value
+
+ Result := Project_Nodes.Last;
+
+ if Comments.Last > 0 then
+
+ -- If this is not a node with comments, then set the flag
+
+ if not Node_With_Comments (Of_Kind) then
+ Unkept_Comments := True;
+
+ elsif Of_Kind /= N_Comment and then Of_Kind /= N_Comment_Zones then
+
+ Project_Nodes.Increment_Last;
+ Project_Nodes.Table (Project_Nodes.Last) :=
+ (Kind => N_Comment_Zones,
+ Expr_Kind => Undefined,
+ Location => No_Location,
+ Directory => No_Name,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => No_Name,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Flag1 => False,
+ Flag2 => False,
+ Comments => Empty_Node);
+
+ Zone := Project_Nodes.Last;
+ Project_Nodes.Table (Result).Comments := Zone;
+ Previous := Empty_Node;
+
+ for J in 1 .. Comments.Last loop
+
+ -- Create a new N_Comment node
+
+ Project_Nodes.Increment_Last;
+ Project_Nodes.Table (Project_Nodes.Last) :=
+ (Kind => N_Comment,
+ Expr_Kind => Undefined,
+ Flag1 => Comments.Table (J).Follows_Empty_Line,
+ Flag2 =>
+ Comments.Table (J).Is_Followed_By_Empty_Line,
+ Location => No_Location,
+ Directory => No_Name,
+ Variables => Empty_Node,
+ Packages => Empty_Node,
+ Pkg_Id => Empty_Package,
+ Name => No_Name,
+ Path_Name => No_Name,
+ Value => Comments.Table (J).Value,
+ Field1 => Empty_Node,
+ Field2 => Empty_Node,
+ Field3 => Empty_Node,
+ Comments => Empty_Node);
+
+ -- Link it to the N_Comment_Zones node, if it is the first,
+ -- otherwise to the previous one.
+
+ if Previous = Empty_Node then
+ Project_Nodes.Table (Zone).Field1 := Project_Nodes.Last;
+
+ else
+ Project_Nodes.Table (Previous).Comments :=
+ Project_Nodes.Last;
+ end if;
+
+ -- This new node will be the previous one for the next
+ -- N_Comment node, if there is one.
+
+ Previous := Project_Nodes.Last;
+ end loop;
+
+ -- Empty the Comments table after all comments have been processed
+
+ Comments.Set_Last (0);
+ end if;
+ end if;
+
+ return Result;
end Default_Project_Node;
------------------
@@ -183,6 +487,24 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Directory;
end Directory_Of;
+ -------------------------
+ -- End_Of_Line_Comment --
+ -------------------------
+
+ function End_Of_Line_Comment (Node : Project_Node_Id) return Name_Id is
+ Zone : Project_Node_Id := Empty_Node;
+
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ if Zone = Empty_Node then
+ return No_Name;
+ else
+ return Project_Nodes.Table (Zone).Value;
+ end if;
+ end End_Of_Line_Comment;
+
------------------------
-- Expression_Kind_Of --
------------------------
@@ -218,8 +540,7 @@ package body Prj.Tree is
-------------------
function Expression_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -239,8 +560,7 @@ package body Prj.Tree is
-------------------------
function Extended_Project_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -255,8 +575,7 @@ package body Prj.Tree is
------------------------------
function Extended_Project_Path_Of
- (Node : Project_Node_Id)
- return Name_Id
+ (Node : Project_Node_Id) return Name_Id
is
begin
pragma Assert
@@ -270,8 +589,7 @@ package body Prj.Tree is
-- Extending_Project_Of --
--------------------------
function Extending_Project_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -286,8 +604,7 @@ package body Prj.Tree is
---------------------------
function External_Reference_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -318,8 +635,7 @@ package body Prj.Tree is
------------------------
function First_Case_Item_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -345,13 +661,96 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field1;
end First_Choice_Of;
+ -------------------------
+ -- First_Comment_After --
+ -------------------------
+
+ function First_Comment_After
+ (Node : Project_Node_Id) return Project_Node_Id
+ is
+ Zone : Project_Node_Id := Empty_Node;
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ if Zone = Empty_Node then
+ return Empty_Node;
+
+ else
+ return Project_Nodes.Table (Zone).Field2;
+ end if;
+ end First_Comment_After;
+
+ -----------------------------
+ -- First_Comment_After_End --
+ -----------------------------
+
+ function First_Comment_After_End
+ (Node : Project_Node_Id)
+ return Project_Node_Id
+ is
+ Zone : Project_Node_Id := Empty_Node;
+
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ if Zone = Empty_Node then
+ return Empty_Node;
+
+ else
+ return Project_Nodes.Table (Zone).Comments;
+ end if;
+ end First_Comment_After_End;
+
+ --------------------------
+ -- First_Comment_Before --
+ --------------------------
+
+ function First_Comment_Before
+ (Node : Project_Node_Id) return Project_Node_Id
+ is
+ Zone : Project_Node_Id := Empty_Node;
+
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ if Zone = Empty_Node then
+ return Empty_Node;
+
+ else
+ return Project_Nodes.Table (Zone).Field1;
+ end if;
+ end First_Comment_Before;
+
+ ------------------------------
+ -- First_Comment_Before_End --
+ ------------------------------
+
+ function First_Comment_Before_End
+ (Node : Project_Node_Id) return Project_Node_Id
+ is
+ Zone : Project_Node_Id := Empty_Node;
+
+ begin
+ pragma Assert (Node /= Empty_Node);
+ Zone := Project_Nodes.Table (Node).Comments;
+
+ if Zone = Empty_Node then
+ return Empty_Node;
+
+ else
+ return Project_Nodes.Table (Zone).Field3;
+ end if;
+ end First_Comment_Before_End;
+
-------------------------------
-- First_Declarative_Item_Of --
-------------------------------
function First_Declarative_Item_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -375,8 +774,7 @@ package body Prj.Tree is
------------------------------
function First_Expression_In_List
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -391,8 +789,7 @@ package body Prj.Tree is
--------------------------
function First_Literal_String
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -407,8 +804,7 @@ package body Prj.Tree is
----------------------
function First_Package_Of
- (Node : Project_Node_Id)
- return Package_Declaration_Id
+ (Node : Project_Node_Id) return Package_Declaration_Id
is
begin
pragma Assert
@@ -423,8 +819,7 @@ package body Prj.Tree is
--------------------------
function First_String_Type_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -439,8 +834,7 @@ package body Prj.Tree is
----------------
function First_Term
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -455,8 +849,7 @@ package body Prj.Tree is
-----------------------
function First_Variable_Of
- (Node : Project_Node_Id)
- return Variable_Node_Id
+ (Node : Project_Node_Id) return Variable_Node_Id
is
begin
pragma Assert
@@ -474,8 +867,7 @@ package body Prj.Tree is
--------------------------
function First_With_Clause_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -485,6 +877,19 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field1;
end First_With_Clause_Of;
+ ------------------------
+ -- Follows_Empty_Line --
+ ------------------------
+
+ function Follows_Empty_Line (Node : Project_Node_Id) return Boolean is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Comment);
+ return Project_Nodes.Table (Node).Flag1;
+ end Follows_Empty_Line;
+
----------
-- Hash --
----------
@@ -494,14 +899,51 @@ package body Prj.Tree is
return Header_Num (N mod Project_Node_Id (Header_Num'Last));
end Hash;
+ ----------------
+ -- Initialize --
+ ----------------
+
+ procedure Initialize is
+ begin
+ Project_Nodes.Set_Last (Empty_Node);
+ Projects_Htable.Reset;
+ end Initialize;
+
+ -------------------------------
+ -- Is_Followed_By_Empty_Line --
+ -------------------------------
+
+ function Is_Followed_By_Empty_Line
+ (Node : Project_Node_Id) return Boolean
+ is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Comment);
+ return Project_Nodes.Table (Node).Flag2;
+ end Is_Followed_By_Empty_Line;
+
+ ----------------------
+ -- Is_Extending_All --
+ ----------------------
+
+ function Is_Extending_All (Node : Project_Node_Id) return Boolean is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Project);
+ return Project_Nodes.Table (Node).Flag2;
+ end Is_Extending_All;
+
-------------------------------------
-- Imported_Or_Extended_Project_Of --
-------------------------------------
function Imported_Or_Extended_Project_Of
(Project : Project_Node_Id;
- With_Name : Name_Id)
- return Project_Node_Id
+ With_Name : Name_Id) return Project_Node_Id
is
With_Clause : Project_Node_Id := First_With_Clause_Of (Project);
Result : Project_Node_Id := Empty_Node;
@@ -534,16 +976,6 @@ package body Prj.Tree is
return Result;
end Imported_Or_Extended_Project_Of;
- ----------------
- -- Initialize --
- ----------------
-
- procedure Initialize is
- begin
- Project_Nodes.Set_Last (Empty_Node);
- Projects_Htable.Reset;
- end Initialize;
-
-------------
-- Kind_Of --
-------------
@@ -579,8 +1011,7 @@ package body Prj.Tree is
--------------------
function Next_Case_Item
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -590,13 +1021,25 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field3;
end Next_Case_Item;
+ ------------------
+ -- Next_Comment --
+ ------------------
+
+ function Next_Comment (Node : Project_Node_Id) return Project_Node_Id is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Comment);
+ return Project_Nodes.Table (Node).Comments;
+ end Next_Comment;
+
---------------------------
-- Next_Declarative_Item --
---------------------------
function Next_Declarative_Item
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -611,8 +1054,7 @@ package body Prj.Tree is
-----------------------------
function Next_Expression_In_List
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -643,8 +1085,7 @@ package body Prj.Tree is
-----------------------------
function Next_Package_In_Project
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -675,8 +1116,7 @@ package body Prj.Tree is
---------------
function Next_Term
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -710,8 +1150,7 @@ package body Prj.Tree is
-------------------------
function Next_With_Clause_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -726,8 +1165,7 @@ package body Prj.Tree is
---------------------------------
function Non_Limited_Project_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -736,6 +1174,7 @@ package body Prj.Tree is
(Project_Nodes.Table (Node).Kind = N_With_Clause));
return Project_Nodes.Table (Node).Field3;
end Non_Limited_Project_Node_Of;
+
-------------------
-- Package_Id_Of --
-------------------
@@ -754,8 +1193,7 @@ package body Prj.Tree is
---------------------
function Package_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -787,8 +1225,7 @@ package body Prj.Tree is
----------------------------
function Project_Declaration_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -798,13 +1235,25 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field2;
end Project_Declaration_Of;
+ -------------------------------------------
+ -- Project_File_Includes_Unkept_Comments --
+ -------------------------------------------
+
+ function Project_File_Includes_Unkept_Comments
+ (Node : Project_Node_Id) return Boolean
+ is
+ Declaration : constant Project_Node_Id :=
+ Project_Declaration_Of (Node);
+ begin
+ return Project_Nodes.Table (Declaration).Flag1;
+ end Project_File_Includes_Unkept_Comments;
+
---------------------
-- Project_Node_Of --
---------------------
function Project_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -823,8 +1272,7 @@ package body Prj.Tree is
-----------------------------------
function Project_Of_Renamed_Package_Of
- (Node : Project_Node_Id)
- return Project_Node_Id
+ (Node : Project_Node_Id) return Project_Node_Id
is
begin
pragma Assert
@@ -834,6 +1282,181 @@ package body Prj.Tree is
return Project_Nodes.Table (Node).Field1;
end Project_Of_Renamed_Package_Of;
+ --------------------------
+ -- Remove_Next_End_Node --
+ --------------------------
+
+ procedure Remove_Next_End_Node is
+ begin
+ Next_End_Nodes.Decrement_Last;
+ end Remove_Next_End_Node;
+
+ -----------------
+ -- Reset_State --
+ -----------------
+
+ procedure Reset_State is
+ begin
+ End_Of_Line_Node := Empty_Node;
+ Previous_Line_Node := Empty_Node;
+ Previous_End_Node := Empty_Node;
+ Unkept_Comments := False;
+ Comments.Set_Last (0);
+ end Reset_State;
+
+ -------------
+ -- Restore --
+ -------------
+
+ procedure Restore (S : in Comment_State) is
+ begin
+ End_Of_Line_Node := S.End_Of_Line_Node;
+ Previous_Line_Node := S.Previous_Line_Node;
+ Previous_End_Node := S.Previous_End_Node;
+ Next_End_Nodes.Set_Last (0);
+ Unkept_Comments := S.Unkept_Comments;
+
+ Comments.Set_Last (0);
+
+ for J in S.Comments'Range loop
+ Comments.Increment_Last;
+ Comments.Table (Comments.Last) := S.Comments (J);
+ end loop;
+ end Restore;
+
+ ----------
+ -- Save --
+ ----------
+
+ procedure Save (S : out Comment_State) is
+ Cmts : Comments_Ptr := new Comment_Array (1 .. Comments.Last);
+ begin
+ for J in 1 .. Comments.Last loop
+ Cmts (J) := Comments.Table (J);
+ end loop;
+
+ S :=
+ (End_Of_Line_Node => End_Of_Line_Node,
+ Previous_Line_Node => Previous_Line_Node,
+ Previous_End_Node => Previous_End_Node,
+ Unkept_Comments => Unkept_Comments,
+ Comments => Cmts);
+ end Save;
+
+ ----------
+ -- Scan --
+ ----------
+
+ procedure Scan is
+ Empty_Line : Boolean := False;
+ begin
+ -- If there are comments, then they will not be kept. Set the flag and
+ -- clear the comments.
+
+ if Comments.Last > 0 then
+ Unkept_Comments := True;
+ Comments.Set_Last (0);
+ end if;
+
+ -- Loop until a token other that End_Of_Line or Comment is found
+
+ loop
+ Prj.Err.Scanner.Scan;
+
+ case Token is
+ when Tok_End_Of_Line =>
+ if Prev_Token = Tok_End_Of_Line then
+ Empty_Line := True;
+
+ if Comments.Last > 0 then
+ Comments.Table (Comments.Last).Is_Followed_By_Empty_Line
+ := True;
+ end if;
+ end if;
+
+ when Tok_Comment =>
+ -- If this is a line comment, add it to the comment table
+
+ if Prev_Token = Tok_End_Of_Line
+ or else Prev_Token = No_Token
+ then
+ Comments.Increment_Last;
+ Comments.Table (Comments.Last) :=
+ (Value => Comment_Id,
+ Follows_Empty_Line => Empty_Line,
+ Is_Followed_By_Empty_Line => False);
+
+ -- Otherwise, it is an end of line comment. If there is
+ -- an end of line node specified, associate the comment with
+ -- this node.
+
+ elsif End_Of_Line_Node /= Empty_Node then
+ declare
+ Zones : constant Project_Node_Id :=
+ Comment_Zones_Of (End_Of_Line_Node);
+ begin
+ Project_Nodes.Table (Zones).Value := Comment_Id;
+ end;
+
+ -- Otherwise, this end of line node cannot be kept
+
+ else
+ Unkept_Comments := True;
+ Comments.Set_Last (0);
+ end if;
+
+ Empty_Line := False;
+
+ when others =>
+ -- If there are comments, where the first comment is not
+ -- following an empty line, put the initial uninterrupted
+ -- comment zone with the node of the preceding line (either
+ -- a Previous_Line or a Previous_End node), if any.
+
+ if Comments.Last > 0 and then
+ not Comments.Table (1).Follows_Empty_Line then
+ if Previous_Line_Node /= Empty_Node then
+ Add_Comments
+ (To => Previous_Line_Node, Where => After);
+
+ elsif Previous_End_Node /= Empty_Node then
+ Add_Comments
+ (To => Previous_End_Node, Where => After_End);
+ end if;
+ end if;
+
+ -- If there are still comments and the token is "end", then
+ -- put these comments with the Next_End node, if any;
+ -- otherwise, these comments cannot be kept. Always clear
+ -- the comments.
+
+ if Comments.Last > 0 and then Token = Tok_End then
+ if Next_End_Nodes.Last > 0 then
+ Add_Comments
+ (To => Next_End_Nodes.Table (Next_End_Nodes.Last),
+ Where => Before_End);
+
+ else
+ Unkept_Comments := True;
+ end if;
+
+ Comments.Set_Last (0);
+ end if;
+
+ -- Reset the End_Of_Line, Previous_Line and Previous_End nodes
+ -- so that they are not used again.
+
+ End_Of_Line_Node := Empty_Node;
+ Previous_Line_Node := Empty_Node;
+ Previous_End_Node := Empty_Node;
+
+ -- And return
+
+ exit;
+ end case;
+ end loop;
+ end Scan;
+
------------------------------------
-- Set_Associative_Array_Index_Of --
------------------------------------
@@ -899,7 +1522,7 @@ package body Prj.Tree is
(Project_Nodes.Table (Node).Kind = N_Attribute_Declaration
or else
Project_Nodes.Table (Node).Kind = N_Attribute_Reference));
- Project_Nodes.Table (Node).Case_Insensitive := To;
+ Project_Nodes.Table (Node).Flag1 := To;
end Set_Case_Insensitive;
------------------------------------
@@ -966,6 +1589,15 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Directory := To;
end Set_Directory_Of;
+ ---------------------
+ -- Set_End_Of_Line --
+ ---------------------
+
+ procedure Set_End_Of_Line (To : Project_Node_Id) is
+ begin
+ End_Of_Line_Node := To;
+ end Set_End_Of_Line;
+
----------------------------
-- Set_Expression_Kind_Of --
----------------------------
@@ -1082,6 +1714,63 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Field1 := To;
end Set_First_Choice_Of;
+ -----------------------------
+ -- Set_First_Comment_After --
+ -----------------------------
+
+ procedure Set_First_Comment_After
+ (Node : Project_Node_Id;
+ To : Project_Node_Id)
+ is
+ Zone : constant Project_Node_Id :=
+ Comment_Zones_Of (Node);
+ begin
+ Project_Nodes.Table (Zone).Field2 := To;
+ end Set_First_Comment_After;
+
+ ---------------------------------
+ -- Set_First_Comment_After_End --
+ ---------------------------------
+
+ procedure Set_First_Comment_After_End
+ (Node : Project_Node_Id;
+ To : Project_Node_Id)
+ is
+ Zone : constant Project_Node_Id :=
+ Comment_Zones_Of (Node);
+ begin
+ Project_Nodes.Table (Zone).Comments := To;
+ end Set_First_Comment_After_End;
+
+ ------------------------------
+ -- Set_First_Comment_Before --
+ ------------------------------
+
+ procedure Set_First_Comment_Before
+ (Node : Project_Node_Id;
+ To : Project_Node_Id)
+
+ is
+ Zone : constant Project_Node_Id :=
+ Comment_Zones_Of (Node);
+ begin
+ Project_Nodes.Table (Zone).Field1 := To;
+ end Set_First_Comment_Before;
+
+ ----------------------------------
+ -- Set_First_Comment_Before_End --
+ ----------------------------------
+
+ procedure Set_First_Comment_Before_End
+ (Node : Project_Node_Id;
+ To : Project_Node_Id)
+ is
+ Zone : constant Project_Node_Id :=
+ Comment_Zones_Of (Node);
+ begin
+ Project_Nodes.Table (Zone).Field2 := To;
+ end Set_First_Comment_Before_End;
+
------------------------
-- Set_Next_Case_Item --
------------------------
@@ -1098,6 +1787,22 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Field3 := To;
end Set_Next_Case_Item;
+ ----------------------
+ -- Set_Next_Comment --
+ ----------------------
+
+ procedure Set_Next_Comment
+ (Node : Project_Node_Id;
+ To : Project_Node_Id)
+ is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Comment);
+ Project_Nodes.Table (Node).Comments := To;
+ end Set_Next_Comment;
+
-----------------------------------
-- Set_First_Declarative_Item_Of --
-----------------------------------
@@ -1237,6 +1942,19 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Field1 := To;
end Set_First_With_Clause_Of;
+ --------------------------
+ -- Set_Is_Extending_All --
+ --------------------------
+
+ procedure Set_Is_Extending_All (Node : Project_Node_Id) is
+ begin
+ pragma Assert
+ (Node /= Empty_Node
+ and then
+ Project_Nodes.Table (Node).Kind = N_Project);
+ Project_Nodes.Table (Node).Flag2 := True;
+ end Set_Is_Extending_All;
+
-----------------
-- Set_Kind_Of --
-----------------
@@ -1340,6 +2058,16 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Field2 := To;
end Set_Next_Declarative_Item;
+ -----------------------
+ -- Set_Next_End_Node --
+ -----------------------
+
+ procedure Set_Next_End_Node (To : Project_Node_Id) is
+ begin
+ Next_End_Nodes.Increment_Last;
+ Next_End_Nodes.Table (Next_End_Nodes.Last) := To;
+ end Set_Next_End_Node;
+
---------------------------------
-- Set_Next_Expression_In_List --
---------------------------------
@@ -1506,6 +2234,23 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Path_Name := To;
end Set_Path_Name_Of;
+ ---------------------------
+ -- Set_Previous_End_Node --
+ ---------------------------
+ procedure Set_Previous_End_Node (To : Project_Node_Id) is
+ begin
+ Previous_End_Node := To;
+ end Set_Previous_End_Node;
+
+ ----------------------------
+ -- Set_Previous_Line_Node --
+ ----------------------------
+
+ procedure Set_Previous_Line_Node (To : Project_Node_Id) is
+ begin
+ Previous_Line_Node := To;
+ end Set_Previous_Line_Node;
+
--------------------------------
-- Set_Project_Declaration_Of --
--------------------------------
@@ -1522,6 +2267,20 @@ package body Prj.Tree is
Project_Nodes.Table (Node).Field2 := To;
end Set_Project_Declaration_Of;
+ -----------------------------------------------
+ -- Set_Project_File_Includes_Unkept_Comments --
+ -----------------------------------------------
+
+ procedure Set_Project_File_Includes_Unkept_Comments
+ (Node : Project_Node_Id;
+ To : Boolean)
+ is
+ Declaration : constant Project_Node_Id :=
+ Project_Declaration_Of (Node);
+ begin
+ Project_Nodes.Table (Declaration).Flag1 := To;
+ end Set_Project_File_Includes_Unkept_Comments;
+
-------------------------
-- Set_Project_Node_Of --
-------------------------
@@ -1604,6 +2363,8 @@ package body Prj.Tree is
and then
(Project_Nodes.Table (Node).Kind = N_With_Clause
or else
+ Project_Nodes.Table (Node).Kind = N_Comment
+ or else
Project_Nodes.Table (Node).Kind = N_Literal_String));
Project_Nodes.Table (Node).Value := To;
end Set_String_Value_Of;
@@ -1612,8 +2373,9 @@ package body Prj.Tree is
-- String_Type_Of --
--------------------
- function String_Type_Of (Node : Project_Node_Id)
- return Project_Node_Id is
+ function String_Type_Of
+ (Node : Project_Node_Id) return Project_Node_Id
+ is
begin
pragma Assert
(Node /= Empty_Node
@@ -1640,6 +2402,8 @@ package body Prj.Tree is
and then
(Project_Nodes.Table (Node).Kind = N_With_Clause
or else
+ Project_Nodes.Table (Node).Kind = N_Comment
+ or else
Project_Nodes.Table (Node).Kind = N_Literal_String));
return Project_Nodes.Table (Node).Value;
end String_Value_Of;
@@ -1650,8 +2414,7 @@ package body Prj.Tree is
function Value_Is_Valid
(For_Typed_Variable : Project_Node_Id;
- Value : Name_Id)
- return Boolean
+ Value : Name_Id) return Boolean
is
begin
pragma Assert
@@ -1679,4 +2442,14 @@ package body Prj.Tree is
end Value_Is_Valid;
+ -------------------------------
+ -- There_Are_Unkept_Comments --
+ -------------------------------
+
+ function There_Are_Unkept_Comments return Boolean is
+ begin
+ return Unkept_Comments;
+ end There_Are_Unkept_Comments;
+
+
end Prj.Tree;
diff --git a/gcc/ada/prj-tree.ads b/gcc/ada/prj-tree.ads
index 4ddebb35763..942c10be0b9 100644
--- a/gcc/ada/prj-tree.ads
+++ b/gcc/ada/prj-tree.ads
@@ -30,8 +30,8 @@ with GNAT.HTable;
with Prj.Attr; use Prj.Attr;
with Prj.Com; use Prj.Com;
+with Table; use Table;
with Types; use Types;
-with Table;
package Prj.Tree is
@@ -79,7 +79,9 @@ package Prj.Tree is
N_External_Value,
N_Attribute_Reference,
N_Case_Construction,
- N_Case_Item);
+ N_Case_Item,
+ N_Comment_Zones,
+ N_Comment);
-- Each node in the tree is of a Project_Node_Kind
-- For the signification of the fields in each node of a
-- Project_Node_Kind, look at package Tree_Private_Part.
@@ -90,8 +92,7 @@ package Prj.Tree is
function Default_Project_Node
(Of_Kind : Project_Node_Kind;
- And_Expr_Kind : Variable_Kind := Undefined)
- return Project_Node_Id;
+ And_Expr_Kind : Variable_Kind := Undefined) return Project_Node_Id;
-- Returns a Project_Node_Record with the specified Kind and
-- Expr_Kind; all the other components have default nil values.
@@ -100,11 +101,85 @@ package Prj.Tree is
function Imported_Or_Extended_Project_Of
(Project : Project_Node_Id;
- With_Name : Name_Id)
- return Project_Node_Id;
+ With_Name : Name_Id) return Project_Node_Id;
-- Return the node of a project imported or extended by project Project and
-- whose name is With_Name. Return Empty_Node if there is no such project.
+ --------------
+ -- Comments --
+ --------------
+
+ type Comment_State is private;
+ -- A type to store the values of several global variables related to
+ -- comments.
+
+ procedure Save (S : out Comment_State);
+ -- Save in variable S the comment state. Called before scanning a new
+ -- project file.
+
+ procedure Restore (S : in Comment_State);
+ -- Restore the comment state to a previously saved value. Called after
+ -- scanning a project file.
+
+ procedure Reset_State;
+ -- Set the comment state to its initial value. Called before scanning a
+ -- new project file.
+
+ function There_Are_Unkept_Comments return Boolean;
+ -- Indicates that some of the comments in a project file could not be
+ -- stored in the parse tree.
+
+ procedure Set_Previous_Line_Node (To : Project_Node_Id);
+ -- Indicate the node on the previous line. If there are comments
+ -- immediately following this line, then they should be associated with
+ -- this node.
+
+ procedure Set_Previous_End_Node (To : Project_Node_Id);
+ -- Indicate that on the previous line the "end" belongs to node To.
+ -- If there are comments immediately following this "end" line, they
+ -- should be associated with this node.
+
+ procedure Set_End_Of_Line (To : Project_Node_Id);
+ -- Indicate the node on the current line. If there is an end of line
+ -- comment, then it should be associated with this node.
+
+ procedure Set_Next_End_Node (To : Project_Node_Id);
+ -- Put node To on the top of the end node stack. When an "end" line
+ -- is found with this node on the top of the end node stack, the comments,
+ -- if any, immediately preceding this "end" line will be associated with
+ -- this node.
+
+ procedure Remove_Next_End_Node;
+ -- Remove the top of the end node stack.
+
+ ------------------------
+ -- Comment Processing --
+ ------------------------
+
+ type Comment_Data is record
+ Value : Name_Id := No_Name;
+ Follows_Empty_Line : Boolean := False;
+ Is_Followed_By_Empty_Line : Boolean := False;
+ end record;
+
+ package Comments is new Table.Table
+ (Table_Component_Type => Comment_Data,
+ Table_Index_Type => Natural,
+ Table_Low_Bound => 1,
+ Table_Initial => 10,
+ Table_Increment => 100,
+ Table_Name => "Prj.Tree.Comments");
+ -- A table to store the comments that may be stored is the tree
+
+ procedure Scan;
+ -- Scan the tokens and accumulate comments.
+
+ type Comment_Location is
+ (Before, After, Before_End, After_End, End_Of_Line);
+
+ procedure Add_Comments (To : Project_Node_Id; Where : Comment_Location);
+ -- Add comments to this node.
+
----------------------
-- Access Functions --
----------------------
@@ -125,6 +200,39 @@ package Prj.Tree is
pragma Inline (Location_Of);
-- Valid for all non empty nodes
+ function First_Comment_After
+ (Node : Project_Node_Id) return Project_Node_Id;
+ -- Valid only for N_Comment_Zones nodes
+
+ function First_Comment_After_End
+ (Node : Project_Node_Id) return Project_Node_Id;
+ -- Valid only for N_Comment_Zones nodes
+
+ function First_Comment_Before
+ (Node : Project_Node_Id) return Project_Node_Id;
+ -- Valid only for N_Comment_Zones nodes
+
+ function First_Comment_Before_End
+ (Node : Project_Node_Id) return Project_Node_Id;
+ -- Valid only for N_Comment_Zones nodes
+
+ function Next_Comment (Node : Project_Node_Id) return Project_Node_Id;
+ -- Valid only for N_Comment nodes
+
+ function End_Of_Line_Comment (Node : Project_Node_Id) return Name_Id;
+ -- Valid only for non empty nodes
+
+ function Follows_Empty_Line (Node : Project_Node_Id) return Boolean;
+ -- Valid only for N_Comment nodes
+
+ function Is_Followed_By_Empty_Line (Node : Project_Node_Id) return Boolean;
+ -- Valid only for N_Comment nodes
+
+ function Project_File_Includes_Unkept_Comments
+ (Node : Project_Node_Id)
+ return Boolean;
+ -- Valid only for N_Project nodes
+
function Directory_Of (Node : Project_Node_Id) return Name_Id;
pragma Inline (Directory_Of);
-- Only valid for N_Project nodes.
@@ -135,15 +243,17 @@ package Prj.Tree is
-- N_Variable_Declaration, N_Typed_Variable_Declaration, N_Expression,
-- N_Term, N_Variable_Reference or N_Attribute_Reference nodes.
+ function Is_Extending_All (Node : Project_Node_Id) return Boolean;
+ pragma Inline (Is_Extending_All);
+ -- Only valid for N_Project
+
function First_Variable_Of
- (Node : Project_Node_Id)
- return Variable_Node_Id;
+ (Node : Project_Node_Id) return Variable_Node_Id;
pragma Inline (First_Variable_Of);
-- Only valid for N_Project or N_Package_Declaration nodes
function First_Package_Of
- (Node : Project_Node_Id)
- return Package_Declaration_Id;
+ (Node : Project_Node_Id) return Package_Declaration_Id;
pragma Inline (First_Package_Of);
-- Only valid for N_Project nodes
@@ -151,123 +261,105 @@ package Prj.Tree is
pragma Inline (Package_Id_Of);
-- Only valid for N_Package_Declaration nodes
- function Path_Name_Of (Node : Project_Node_Id) return Name_Id;
+ function Path_Name_Of (Node : Project_Node_Id) return Name_Id;
pragma Inline (Path_Name_Of);
-- Only valid for N_Project and N_With_Clause nodes.
- function String_Value_Of (Node : Project_Node_Id) return Name_Id;
+ function String_Value_Of (Node : Project_Node_Id) return Name_Id;
pragma Inline (String_Value_Of);
- -- Only valid for N_With_Clause or N_Literal_String nodes.
+ -- Only valid for N_With_Clause, N_Literal_String nodes or N_Comment
function First_With_Clause_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_With_Clause_Of);
-- Only valid for N_Project nodes
function Project_Declaration_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Project_Declaration_Of);
-- Only valid for N_Project nodes
function Extending_Project_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Extending_Project_Of);
-- Only valid for N_Project_Declaration nodes
function First_String_Type_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_String_Type_Of);
-- Only valid for N_Project nodes
function Extended_Project_Path_Of
- (Node : Project_Node_Id)
- return Name_Id;
+ (Node : Project_Node_Id) return Name_Id;
pragma Inline (Extended_Project_Path_Of);
-- Only valid for N_With_Clause nodes
function Project_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Project_Node_Of);
-- Only valid for N_With_Clause, N_Variable_Reference and
-- N_Attribute_Reference nodes.
function Non_Limited_Project_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Non_Limited_Project_Node_Of);
-- Only valid for N_With_Clause nodes. Returns Empty_Node for limited
-- imported project files, otherwise returns the same result as
-- Project_Node_Of.
function Next_With_Clause_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_With_Clause_Of);
-- Only valid for N_With_Clause nodes
function First_Declarative_Item_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Declarative_Item_Of);
-- Only valid for N_With_Clause nodes
function Extended_Project_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Extended_Project_Of);
- -- Only valid for N_With_Clause nodes
+ -- Only valid for N_Project_Declaration nodes
function Current_Item_Node
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Current_Item_Node);
-- Only valid for N_Declarative_Item nodes
function Next_Declarative_Item
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Declarative_Item);
-- Only valid for N_Declarative_Item node
function Project_Of_Renamed_Package_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Project_Of_Renamed_Package_Of);
-- Only valid for N_Package_Declaration nodes.
-- May return Empty_Node.
function Next_Package_In_Project
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Package_In_Project);
-- Only valid for N_Package_Declaration nodes
function First_Literal_String
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Literal_String);
-- Only valid for N_String_Type_Declaration nodes
function Next_String_Type
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_String_Type);
-- Only valid for N_String_Type_Declaration nodes
function Next_Literal_String
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Literal_String);
-- Only valid for N_Literal_String nodes
function Expression_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Expression_Of);
-- Only valid for N_Attribute_Declaration, N_Typed_Variable_Declaration
-- or N_Variable_Declaration nodes
@@ -286,104 +378,88 @@ package Prj.Tree is
function Value_Is_Valid
(For_Typed_Variable : Project_Node_Id;
- Value : Name_Id)
- return Boolean;
+ Value : Name_Id) return Boolean;
pragma Inline (Value_Is_Valid);
-- Only valid for N_Typed_Variable_Declaration. Returns True if Value is
-- in the list of allowed strings for For_Typed_Variable. False otherwise.
function Associative_Array_Index_Of
- (Node : Project_Node_Id)
- return Name_Id;
+ (Node : Project_Node_Id) return Name_Id;
pragma Inline (Associative_Array_Index_Of);
-- Only valid for N_Attribute_Declaration and N_Attribute_Reference.
-- Returns No_String for non associative array attributes.
function Next_Variable
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Variable);
-- Only valid for N_Typed_Variable_Declaration or N_Variable_Declaration
-- nodes.
function First_Term
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Term);
-- Only valid for N_Expression nodes
function Next_Expression_In_List
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Expression_In_List);
-- Only valid for N_Expression nodes
function Current_Term
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Current_Term);
-- Only valid for N_Term nodes
function Next_Term
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Term);
-- Only valid for N_Term nodes
function First_Expression_In_List
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Expression_In_List);
-- Only valid for N_Literal_String_List nodes
function Package_Node_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Package_Node_Of);
-- Only valid for N_Variable_Reference or N_Attribute_Reference nodes.
-- May return Empty_Node.
function String_Type_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (String_Type_Of);
-- Only valid for N_Variable_Reference or N_Typed_Variable_Declaration
-- nodes.
function External_Reference_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (External_Reference_Of);
-- Only valid for N_External_Value nodes
function External_Default_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (External_Default_Of);
-- Only valid for N_External_Value nodes
function Case_Variable_Reference_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Case_Variable_Reference_Of);
-- Only valid for N_Case_Construction nodes
function First_Case_Item_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Case_Item_Of);
-- Only valid for N_Case_Construction nodes
function First_Choice_Of
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (First_Choice_Of);
-- Return the first choice in a N_Case_Item, or Empty_Node if
-- this is when others.
function Next_Case_Item
- (Node : Project_Node_Id)
- return Project_Node_Id;
+ (Node : Project_Node_Id) return Project_Node_Id;
pragma Inline (Next_Case_Item);
-- Only valid for N_Case_Item nodes
@@ -415,6 +491,35 @@ package Prj.Tree is
To : Source_Ptr);
pragma Inline (Set_Location_Of);
+ procedure Set_First_Comment_After
+ (Node : Project_Node_Id;
+ To : Project_Node_Id);
+ pragma Inline (Set_First_Comment_After);
+
+ procedure Set_First_Comment_After_End
+ (Node : Project_Node_Id;
+ To : Project_Node_Id);
+ pragma Inline (Set_First_Comment_After_End);
+
+ procedure Set_First_Comment_Before
+ (Node : Project_Node_Id;
+ To : Project_Node_Id);
+ pragma Inline (Set_First_Comment_Before);
+
+ procedure Set_First_Comment_Before_End
+ (Node : Project_Node_Id;
+ To : Project_Node_Id);
+ pragma Inline (Set_First_Comment_Before_End);
+
+ procedure Set_Next_Comment
+ (Node : Project_Node_Id;
+ To : Project_Node_Id);
+ pragma Inline (Set_Next_Comment);
+
+ procedure Set_Project_File_Includes_Unkept_Comments
+ (Node : Project_Node_Id;
+ To : Boolean);
+
procedure Set_Directory_Of
(Node : Project_Node_Id;
To : Name_Id);
@@ -425,6 +530,9 @@ package Prj.Tree is
To : Variable_Kind);
pragma Inline (Set_Expression_Kind_Of);
+ procedure Set_Is_Extending_All (Node : Project_Node_Id);
+ pragma Inline (Set_Is_Extending_All);
+
procedure Set_First_Variable_Of
(Node : Project_Node_Id;
To : Variable_Node_Id);
@@ -680,10 +788,32 @@ package Prj.Tree is
Field3 : Project_Node_Id := Empty_Node;
-- See below the meaning for each Project_Node_Kind
- Case_Insensitive : Boolean := False;
- -- This flag is significant only for N_Attribute_Declaration and
- -- N_Atribute_Reference. It indicates for an associative array
- -- attribute, that the index is case insensitive.
+ Flag1 : Boolean := False;
+ -- This flag is significant only for:
+ -- N_Attribute_Declaration and N_Atribute_Reference
+ -- It indicates for an associative array attribute, that the
+ -- index is case insensitive.
+ -- N_Comment - it indicates that the comment is preceded by an
+ -- empty line.
+ -- N_Project - it indicates that there are comments in the project
+ -- source that cannot be kept in the tree.
+ -- N_Project_Declaration
+ -- - it indixates that there are unkept comment in the
+ -- project.
+
+ Flag2 : Boolean := False;
+ -- This flag is significant only for:
+ -- N_Project - it indicates that the project "extends all" another
+ -- project.
+ -- N_Comment - it indicates that the comment is followed by an
+ -- empty line.
+
+ Comments : Project_Node_Id := Empty_Node;
+ -- For nodes other that N_Comment_Zones or N_Comment, designates the
+ -- comment zones associated with the node.
+ -- for N_Comment_Zones, designates the comment after the "end" of
+ -- the construct.
+ -- For N_Comment, designates the next comment, if any.
end record;
@@ -851,7 +981,7 @@ package Prj.Tree is
-- -- Field3: not used
-- -- Value: not used
- -- N_Case_Item);
+ -- N_Case_Item
-- -- Name: not used
-- -- Path_Name: not used
-- -- Expr_Kind: not used
@@ -861,6 +991,28 @@ package Prj.Tree is
-- -- Field3: next case item
-- -- Value: not used
+ -- N_Comment_zones
+ -- -- Name: not used
+ -- -- Path_Name: not used
+ -- -- Expr_Kind: not used
+ -- -- Field1: comment before the construct
+ -- -- Field2: comment after the construct
+ -- -- Field3: comment before the "end" of the construct
+ -- -- Value: end of line comment
+ -- -- Comments: comment after the "end" of the construct
+
+ -- N_Comment
+ -- -- Name: not used
+ -- -- Path_Name: not used
+ -- -- Expr_Kind: not used
+ -- -- Field1: not used
+ -- -- Field2: not used
+ -- -- Field3: not used
+ -- -- Value: comment
+ -- -- Flag1: comment is preceded by an empty line
+ -- -- Flag2: comment is followed by an empty line
+ -- -- Comments: next comment
+
package Project_Nodes is
new Table.Table (Table_Component_Type => Project_Node_Record,
Table_Index_Type => Project_Node_Id,
@@ -900,4 +1052,20 @@ package Prj.Tree is
end Tree_Private_Part;
+private
+ type Comment_Array is array (Positive range <>) of Comment_Data;
+ type Comments_Ptr is access Comment_Array;
+
+ type Comment_State is record
+ End_Of_Line_Node : Project_Node_Id := Empty_Node;
+
+ Previous_Line_Node : Project_Node_Id := Empty_Node;
+
+ Previous_End_Node : Project_Node_Id := Empty_Node;
+
+ Unkept_Comments : Boolean := False;
+
+ Comments : Comments_Ptr := null;
+ end record;
+
end Prj.Tree;
diff --git a/gcc/ada/prj.adb b/gcc/ada/prj.adb
index f03f5559622..6594b8782ac 100644
--- a/gcc/ada/prj.adb
+++ b/gcc/ada/prj.adb
@@ -77,6 +77,7 @@ package body Prj is
(First_Referred_By => No_Project,
Name => No_Name,
Path_Name => No_Name,
+ Virtual => False,
Display_Path_Name => No_Name,
Location => No_Location,
Mains => Nil_String,
@@ -95,6 +96,7 @@ package body Prj is
Standalone_Library => False,
Lib_Interface_ALIs => Nil_String,
Lib_Auto_Init => False,
+ Symbol_Data => No_Symbols,
Sources_Present => True,
Sources => Nil_String,
Source_Dirs => Nil_String,
@@ -121,7 +123,8 @@ package body Prj is
Seen => False,
Flag1 => False,
Flag2 => False,
- Depth => 0);
+ Depth => 0,
+ Unkept_Comments => False);
-------------------
-- Add_To_Buffer --
@@ -305,7 +308,8 @@ package body Prj is
Element :=
(Index => Lang,
Index_Case_Sensitive => False,
- Value => (Kind => Single,
+ Value => (Project => No_Project,
+ Kind => Single,
Location => No_Location,
Default => False,
Value => Default_Spec_Suffix),
@@ -340,7 +344,8 @@ package body Prj is
Element :=
(Index => Lang,
Index_Case_Sensitive => False,
- Value => (Kind => Single,
+ Value => (Project => No_Project,
+ Kind => Single,
Location => No_Location,
Default => False,
Value => Default_Body_Suffix),
@@ -383,15 +388,6 @@ package body Prj is
and then Left.Separate_Suffix = Right.Separate_Suffix;
end Same_Naming_Scheme;
- ----------
- -- Scan --
- ----------
-
- procedure Scan is
- begin
- Scanner.Scan;
- end Scan;
-
--------------------------
-- Standard_Naming_Data --
--------------------------
diff --git a/gcc/ada/prj.ads b/gcc/ada/prj.ads
index b9dff5988b8..3f9033c7b3c 100644
--- a/gcc/ada/prj.ads
+++ b/gcc/ada/prj.ads
@@ -47,6 +47,10 @@ package Prj is
-- Default value of parameter Packages of procedures Parse, in Prj.Pars and
-- Prj.Part, indicating that all packages should be checked.
+ Virtual_Prefix : constant String := "v$";
+ -- The prefix for virtual extending projects. Because of the '$', which is
+ -- normally forbidden for project names, there cannot be any name clash.
+
Project_File_Extension : String := ".gpr";
-- The standard project file name extension.
-- It is not a constant, because Canonical_Case_File_Name is called
@@ -71,8 +75,27 @@ package Prj is
type Lib_Kind is (Static, Dynamic, Relocatable);
+ type Policy is (Autonomous, Compliant, Controlled);
+ -- See explaination about this type in package Symbol
+
+ type Symbol_Record is record
+ Symbol_File : Name_Id := No_Name;
+ Reference : Name_Id := No_Name;
+ Symbol_Policy : Policy := Autonomous;
+ end record;
+ -- Type to keep the symbol data to be used when building a shared library
+
+ No_Symbols : Symbol_Record :=
+ (Symbol_File => No_Name,
+ Reference => No_Name,
+ Symbol_Policy => Autonomous);
+
function Empty_String return Name_Id;
+ type Project_Id is new Nat;
+ No_Project : constant Project_Id := 0;
+ -- Id of a Project File
+
type String_List_Id is new Nat;
Nil_String : constant String_List_Id := 0;
type String_Element is record
@@ -103,6 +126,7 @@ package Prj is
-- while processing the project tree (unknown package name).
type Variable_Value (Kind : Variable_Kind := Undefined) is record
+ Project : Project_Id := No_Project;
Location : Source_Ptr := No_Location;
Default : Boolean := False;
case Kind is
@@ -118,7 +142,8 @@ package Prj is
-- Default is True if the current value is the default one for the variable
Nil_Variable_Value : constant Variable_Value :=
- (Kind => Undefined,
+ (Project => No_Project,
+ Kind => Undefined,
Location => No_Location,
Default => False);
-- Value of a non existing variable or array element
@@ -299,10 +324,6 @@ package Prj is
-- Returns True if Left and Right are the same naming scheme
-- not considering Specs and Bodies.
- type Project_Id is new Nat;
- No_Project : constant Project_Id := 0;
- -- Id of a Project File
-
type Project_List is new Nat;
Empty_Project_List : constant Project_List := 0;
-- A list of project files.
@@ -339,6 +360,9 @@ package Prj is
-- The path name of the project file.
-- Set by Prj.Proc.Process.
+ Virtual : Boolean := False;
+ -- True for virtual extending projects
+
Display_Path_Name : Name_Id := No_Name;
Location : Source_Ptr := No_Location;
@@ -409,6 +433,9 @@ package Prj is
-- For non static Standalone Library Project Files, indicate if
-- the library initialisation should be automatic.
+ Symbol_Data : Symbol_Record := No_Symbols;
+ -- Symbol file name, reference symbol file name, symbol policy
+
Sources_Present : Boolean := True;
-- A flag that indicates if there are sources in this project file.
-- There are no sources if 1) Source_Dirs is specified as an
@@ -527,6 +554,10 @@ package Prj is
-- The maximum depth of a project in the project graph.
-- Depth of main project is 0.
+ Unkept_Comments : Boolean := False;
+ -- True if there are comments in the project sources that cannot
+ -- be kept in the project tree.
+
end record;
function Empty_Project return Project_Data;
@@ -583,10 +614,6 @@ package Prj is
-- it is called for B. With_State may be used by Action to choose a
-- behavior or to report some global result.
- procedure Scan;
- pragma Inline (Scan);
- -- Scan a token. Change all operator symbols to literal strings.
-
private
Initial_Buffer_Size : constant := 100;
diff --git a/gcc/ada/raise.c b/gcc/ada/raise.c
index 751c01d70ca..8b1d082b0f4 100644
--- a/gcc/ada/raise.c
+++ b/gcc/ada/raise.c
@@ -58,9 +58,7 @@ typedef char bool;
/* We have not yet figured out how to import this directly */
void
-_gnat_builtin_longjmp (ptr, flag)
- void *ptr;
- int flag ATTRIBUTE_UNUSED;
+_gnat_builtin_longjmp (void *ptr, int flag ATTRIBUTE_UNUSED)
{
__builtin_longjmp (ptr, 1);
}
@@ -72,7 +70,7 @@ _gnat_builtin_longjmp (ptr, flag)
performs any system dependent cleanup required. */
void
-__gnat_unhandled_terminate ()
+__gnat_unhandled_terminate (void)
{
/* Special termination handling for VMS */
@@ -108,10 +106,10 @@ typedef struct _Unwind_Context _Unwind_Context;
typedef struct _Unwind_Exception _Unwind_Exception;
_Unwind_Reason_Code
-__gnat_Unwind_RaiseException PARAMS ((_Unwind_Exception *));
+__gnat_Unwind_RaiseException (_Unwind_Exception *);
_Unwind_Reason_Code
-__gnat_Unwind_ForcedUnwind PARAMS ((_Unwind_Exception *, void *, void *));
+__gnat_Unwind_ForcedUnwind (_Unwind_Exception *, void *, void *);
#ifdef IN_RTS /* For eh personality routine */
@@ -540,9 +538,7 @@ typedef struct
} region_descriptor;
static void
-db_region_for (region, uw_context)
- region_descriptor *region;
- _Unwind_Context *uw_context;
+db_region_for (region_descriptor *region, _Unwind_Context *uw_context)
{
_Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
@@ -563,9 +559,7 @@ db_region_for (region, uw_context)
ttype table. */
static const _Unwind_Ptr
-get_ttype_entry_for (region, filter)
- region_descriptor *region;
- long filter;
+get_ttype_entry_for (region_descriptor *region, long filter)
{
_Unwind_Ptr ttype_entry;
@@ -580,9 +574,8 @@ get_ttype_entry_for (region, filter)
/* Fill out the REGION descriptor for the provided UW_CONTEXT. */
static void
-get_region_description_for (uw_context, region)
- _Unwind_Context *uw_context;
- region_descriptor *region;
+get_region_description_for (_Unwind_Context *uw_context,
+ region_descriptor *region)
{
const unsigned char * p;
_Unwind_Word tmp;
@@ -674,9 +667,7 @@ typedef struct
static void
-db_action_for (action, uw_context)
- action_descriptor *action;
- _Unwind_Context *uw_context;
+db_action_for (action_descriptor *action, _Unwind_Context *uw_context)
{
_Unwind_Ptr ip = _Unwind_GetIP (uw_context) - 1;
@@ -725,10 +716,9 @@ db_action_for (action, uw_context)
#define __builtin_eh_return_data_regno(x) x
static void
-get_call_site_action_for (uw_context, region, action)
- _Unwind_Context *uw_context;
- region_descriptor *region;
- action_descriptor *action;
+get_call_site_action_for (_Unwind_Context *uw_context,
+ region_descriptor *region,
+ action_descriptor *action)
{
_Unwind_Ptr call_site
= _Unwind_GetIP (uw_context) - 1;
@@ -786,10 +776,9 @@ get_call_site_action_for (uw_context, region, action)
/* ! __USING_SJLJ_EXCEPTIONS__ */
static void
-get_call_site_action_for (uw_context, region, action)
- _Unwind_Context *uw_context;
- region_descriptor *region;
- action_descriptor *action;
+get_call_site_action_for (_Unwind_Context *uw_context,
+ region_descriptor *region,
+ action_descriptor *action)
{
_Unwind_Ptr ip
= _Unwind_GetIP (uw_context) - 1;
@@ -861,11 +850,10 @@ get_call_site_action_for (uw_context, region, action)
UW_CONTEXT in REGION. */
static void
-get_action_description_for (uw_context, uw_exception, region, action)
- _Unwind_Context *uw_context;
- _Unwind_Exception *uw_exception;
- region_descriptor *region;
- action_descriptor *action;
+get_action_description_for (_Unwind_Context *uw_context,
+ _Unwind_Exception *uw_exception,
+ region_descriptor *region,
+ action_descriptor *action)
{
_GNAT_Exception * gnat_exception = (_GNAT_Exception *) uw_exception;
@@ -950,11 +938,10 @@ get_action_description_for (uw_context, uw_exception, region, action)
occured. */
static void
-setup_to_install (uw_context, uw_exception, uw_landing_pad, uw_filter)
- _Unwind_Context *uw_context;
- _Unwind_Exception *uw_exception;
- int uw_filter;
- _Unwind_Ptr uw_landing_pad;
+setup_to_install (_Unwind_Context *uw_context,
+ _Unwind_Exception *uw_exception,
+ _Unwind_Ptr uw_landing_pad,
+ int uw_filter)
{
#ifndef EH_RETURN_DATA_REGNO
/* We should not be called if the appropriate underlying support is not
@@ -981,20 +968,18 @@ setup_to_install (uw_context, uw_exception, uw_landing_pad, uw_filter)
/* The following is defined from a-except.adb. Its purpose is to enable
automatic backtraces upon exception raise, as provided through the
GNAT.Traceback facilities. */
-extern void __gnat_notify_handled_exception PARAMS ((void));
-extern void __gnat_notify_unhandled_exception PARAMS ((void));
+extern void __gnat_notify_handled_exception (void);
+extern void __gnat_notify_unhandled_exception (void);
/* Below is the eh personality routine per se. We currently assume that only
GNU-Ada exceptions are met. */
_Unwind_Reason_Code
-__gnat_eh_personality (uw_version, uw_phases,
- uw_exception_class, uw_exception, uw_context)
- int uw_version;
- _Unwind_Action uw_phases;
- _Unwind_Exception_Class uw_exception_class;
- _Unwind_Exception *uw_exception;
- _Unwind_Context *uw_context;
+__gnat_eh_personality (int uw_version,
+ _Unwind_Action uw_phases,
+ _Unwind_Exception_Class uw_exception_class,
+ _Unwind_Exception *uw_exception,
+ _Unwind_Context *uw_context)
{
_GNAT_Exception * gnat_exception = (_GNAT_Exception *) uw_exception;
@@ -1075,8 +1060,7 @@ __gnat_eh_personality (uw_version, uw_phases,
#undef _Unwind_RaiseException
_Unwind_Reason_Code
-__gnat_Unwind_RaiseException (e)
- _Unwind_Exception *e;
+__gnat_Unwind_RaiseException (_Unwind_Exception *e)
{
return _Unwind_SjLj_RaiseException (e);
}
@@ -1085,10 +1069,9 @@ __gnat_Unwind_RaiseException (e)
#undef _Unwind_ForcedUnwind
_Unwind_Reason_Code
-__gnat_Unwind_ForcedUnwind (e, handler, argument)
- _Unwind_Exception *e;
- void * handler;
- void * argument;
+__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e,
+ void * handler,
+ void * argument)
{
return _Unwind_SjLj_ForcedUnwind (e, handler, argument);
}
@@ -1097,17 +1080,15 @@ __gnat_Unwind_ForcedUnwind (e, handler, argument)
#else /* __USING_SJLJ_EXCEPTIONS__ */
_Unwind_Reason_Code
-__gnat_Unwind_RaiseException (e)
- _Unwind_Exception *e;
+__gnat_Unwind_RaiseException (_Unwind_Exception *e)
{
return _Unwind_RaiseException (e);
}
_Unwind_Reason_Code
-__gnat_Unwind_ForcedUnwind (e, handler, argument)
- _Unwind_Exception *e;
- void * handler;
- void * argument;
+__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e,
+ void * handler,
+ void * argument)
{
return _Unwind_ForcedUnwind (e, handler, argument);
}
@@ -1127,18 +1108,16 @@ __gnat_Unwind_ForcedUnwind (e, handler, argument)
functions never to be called. */
_Unwind_Reason_Code
-__gnat_Unwind_RaiseException (e)
- _Unwind_Exception *e ATTRIBUTE_UNUSED;
+__gnat_Unwind_RaiseException (_Unwind_Exception *e ATTRIBUTE_UNUSED)
{
abort ();
}
_Unwind_Reason_Code
-__gnat_Unwind_ForcedUnwind (e, handler, argument)
- _Unwind_Exception *e ATTRIBUTE_UNUSED;
- void * handler ATTRIBUTE_UNUSED;
- void * argument ATTRIBUTE_UNUSED;
+__gnat_Unwind_ForcedUnwind (_Unwind_Exception *e ATTRIBUTE_UNUSED,
+ void * handler ATTRIBUTE_UNUSED,
+ void * argument ATTRIBUTE_UNUSED)
{
abort ();
}
diff --git a/gcc/ada/rtsfind.adb b/gcc/ada/rtsfind.adb
index 5759855b9b9..3d0acf16026 100644
--- a/gcc/ada/rtsfind.adb
+++ b/gcc/ada/rtsfind.adb
@@ -258,6 +258,8 @@ package body Rtsfind is
for J in RE_Id loop
RE_Table (J) := Empty;
end loop;
+
+ RTE_Is_Available := False;
end Initialize;
------------
@@ -548,7 +550,6 @@ package body Rtsfind is
declare
Loaded : Boolean;
pragma Warnings (Off, Loaded);
-
begin
Loaded := Is_Loaded (U.Uname);
end;
@@ -567,7 +568,6 @@ package body Rtsfind is
if U.Unum = No_Unit then
Load_Fail ("not found", U_Id, Id);
-
elsif Fatal_Error (U.Unum) then
Load_Fail ("had parser errors", U_Id, Id);
end if;
@@ -599,7 +599,6 @@ package body Rtsfind is
Set_Analyzed (Cunit (Current_Sem_Unit), True);
if not Analyzed (Cunit (U.Unum)) then
-
Save_Private_Visibility;
Semantics (Cunit (U.Unum));
Restore_Private_Visibility;
diff --git a/gcc/ada/rtsfind.ads b/gcc/ada/rtsfind.ads
index 000202cb63a..3ecd94842bd 100644
--- a/gcc/ada/rtsfind.ads
+++ b/gcc/ada/rtsfind.ads
@@ -298,6 +298,7 @@ package Rtsfind is
System_String_Ops_Concat_5,
System_Task_Info,
System_Tasking,
+ System_Threads,
System_Unsigned_Types,
System_Val_Bool,
System_Val_Char,
@@ -1034,6 +1035,7 @@ package Rtsfind is
RE_IS_Ilf, -- System.Scalar_Values
RE_IS_Ill, -- System.Scalar_Values
+ RE_Default_Secondary_Stack_Size, -- System.Secondary_Stack
RE_Mark_Id, -- System.Secondary_Stack
RE_SS_Allocate, -- System.Secondary_Stack
RE_SS_Pool, -- System.Secondary_Stack
@@ -1164,6 +1166,11 @@ package Rtsfind is
RE_Get_GNAT_Exception, -- System.Soft_Links
RE_Update_Exception, -- System.Soft_Links
+ RE_ATSD, -- System.Threads
+ RE_Thread_Body_Enter, -- System.Threads
+ RE_Thread_Body_Exceptional_Exit, -- System.Threads
+ RE_Thread_Body_Leave, -- System.Threads
+
RE_Bits_1, -- System.Unsigned_Types
RE_Bits_2, -- System.Unsigned_Types
RE_Bits_4, -- System.Unsigned_Types
@@ -1968,6 +1975,7 @@ package Rtsfind is
RE_IS_Ilf => System_Scalar_Values,
RE_IS_Ill => System_Scalar_Values,
+ RE_Default_Secondary_Stack_Size => System_Secondary_Stack,
RE_Mark_Id => System_Secondary_Stack,
RE_SS_Allocate => System_Secondary_Stack,
RE_SS_Mark => System_Secondary_Stack,
@@ -2098,6 +2106,11 @@ package Rtsfind is
RE_Get_GNAT_Exception => System_Soft_Links,
RE_Update_Exception => System_Soft_Links,
+ RE_ATSD => System_Threads,
+ RE_Thread_Body_Enter => System_Threads,
+ RE_Thread_Body_Exceptional_Exit => System_Threads,
+ RE_Thread_Body_Leave => System_Threads,
+
RE_Bits_1 => System_Unsigned_Types,
RE_Bits_2 => System_Unsigned_Types,
RE_Bits_4 => System_Unsigned_Types,
diff --git a/gcc/ada/s-crtl.ads b/gcc/ada/s-crtl.ads
new file mode 100644
index 00000000000..9fef16b4f24
--- /dev/null
+++ b/gcc/ada/s-crtl.ads
@@ -0,0 +1,159 @@
+------------------------------------------------------------------------------
+-- --
+-- GNAT RUN-TIME COMPONENTS --
+-- --
+-- S Y S T E M . C R T L --
+-- --
+-- S p e c --
+-- --
+-- Copyright (C) 2003 Free Software Foundation, Inc. --
+-- --
+-- GNAT is free software; you can redistribute it and/or modify it under --
+-- terms of the GNU General Public License as published by the Free Soft- --
+-- ware Foundation; either version 2, or (at your option) any later ver- --
+-- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
+-- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
+-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
+-- for more details. You should have received a copy of the GNU General --
+-- Public License distributed with GNAT; see 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 other files instantiate generics from this --
+-- unit, or you link this unit with other files to produce an executable, --
+-- this unit does not by itself cause the resulting executable to be --
+-- covered by the GNU General Public License. This exception does not --
+-- however invalidate any other reasons why the executable file might be --
+-- covered by the GNU Public License. --
+-- --
+-- GNAT was originally developed by the GNAT team at New York University. --
+-- Extensive contributions were provided by Ada Core Technologies Inc. --
+-- --
+------------------------------------------------------------------------------
+
+-- This package provides the low level interface to the C Run Time Library
+-- on non-VMS systems.
+
+with System.Parameters;
+package System.CRTL is
+pragma Preelaborate (CRTL);
+
+ subtype chars is System.Address;
+ -- Pointer to null-terminated array of characters
+
+ subtype FILEs is System.Address;
+ -- Corresponds to the C type FILE*
+
+ subtype int is Integer;
+
+ type long is range -(2 ** (System.Parameters.long_bits - 1))
+ .. +(2 ** (System.Parameters.long_bits - 1)) - 1;
+
+ subtype off_t is Long_Integer;
+
+ type size_t is mod 2 ** Standard'Address_Size;
+
+ function atoi (A : System.Address) return Integer;
+ pragma Import (C, atoi, "atoi");
+
+ procedure clearerr (stream : FILEs);
+ pragma Import (C, clearerr, "clearerr");
+
+ function fclose (stream : FILEs) return int;
+ pragma Import (C, fclose, "fclose");
+
+ function fdopen (handle : int; mode : chars) return FILEs;
+ pragma Import (C, fdopen, "fdopen");
+
+ function fflush (stream : FILEs) return int;
+ pragma Import (C, fflush, "fflush");
+
+ function fgetc (stream : FILEs) return int;
+ pragma Import (C, fgetc, "fgetc");
+
+ function fgets (strng : chars; n : int; stream : FILEs) return chars;
+ pragma Import (C, fgets, "fgets");
+
+ function fopen (filename : chars; Mode : chars) return FILEs;
+ pragma Import (C, fopen, "fopen");
+
+ function fputc (C : int; stream : FILEs) return int;
+ pragma Import (C, fputc, "fputc");
+
+ function fputs (Strng : chars; Stream : FILEs) return int;
+ pragma Import (C, fputs, "fputs");
+
+ procedure free (Ptr : System.Address);
+ pragma Import (C, free, "free");
+
+ function freopen
+ (filename : chars;
+ mode : chars;
+ stream : FILEs)
+ return FILEs;
+ pragma Import (C, freopen, "freopen");
+
+ function fseek
+ (stream : FILEs;
+ offset : long;
+ origin : int)
+ return int;
+ pragma Import (C, fseek, "fseek");
+
+ function ftell (stream : FILEs) return long;
+ pragma Import (C, ftell, "ftell");
+
+ function getenv (S : String) return System.Address;
+ pragma Import (C, getenv, "getenv");
+
+ function isatty (handle : int) return int;
+ pragma Import (C, isatty, "isatty");
+
+ function lseek (fd : int; offset : off_t; direction : int) return off_t;
+ pragma Import (C, lseek, "lseek");
+
+ function malloc (Size : size_t) return System.Address;
+ pragma Import (C, malloc, "malloc");
+
+ procedure memcpy (S1 : System.Address; S2 : System.Address; N : size_t);
+ pragma Import (C, memcpy, "memcpy");
+
+ procedure memmove (S1 : System.Address; S2 : System.Address; N : size_t);
+ pragma Import (C, memmove, "memmove");
+
+ procedure mktemp (template : chars);
+ pragma Import (C, mktemp, "mktemp");
+
+ function read (fd : int; buffer : chars; nbytes : int) return int;
+ pragma Import (C, read, "read");
+
+ function realloc
+ (Ptr : System.Address; Size : size_t) return System.Address;
+ pragma Import (C, realloc, "realloc");
+
+ procedure rewind (stream : FILEs);
+ pragma Import (C, rewind, "rewind");
+
+ function setvbuf
+ (stream : FILEs;
+ buffer : chars;
+ mode : int;
+ size : size_t)
+ return int;
+ pragma Import (C, setvbuf, "setvbuf");
+
+ procedure tmpnam (string : chars);
+ pragma Import (C, tmpnam, "tmpnam");
+
+ function tmpfile return FILEs;
+ pragma Import (C, tmpfile, "tmpfile");
+
+ function ungetc (c : int; stream : FILEs) return int;
+ pragma Import (C, ungetc, "ungetc");
+
+ function unlink (filename : chars) return int;
+ pragma Import (C, unlink, "unlink");
+
+ function write (fd : int; buffer : chars; nbytes : int) return int;
+ pragma Import (C, write, "write");
+end System.CRTL;
diff --git a/gcc/ada/s-direio.adb b/gcc/ada/s-direio.adb
index 8f43e740d87..a05461f81a3 100644
--- a/gcc/ada/s-direio.adb
+++ b/gcc/ada/s-direio.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -34,6 +34,7 @@
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
with Interfaces.C_Streams; use Interfaces.C_Streams;
with System; use System;
+with System.CRTL;
with System.File_IO;
with System.Soft_Links;
with Unchecked_Deallocation;
@@ -46,6 +47,9 @@ package body System.Direct_IO is
subtype AP is FCB.AFCB_Ptr;
use type FCB.Shared_Status_Type;
+ use type System.CRTL.long;
+ use type System.CRTL.size_t;
+
-----------------------
-- Local Subprograms --
-----------------------
diff --git a/gcc/ada/s-exnint.adb b/gcc/ada/s-exnint.adb
index 432922147af..10b51d877d9 100644
--- a/gcc/ada/s-exnint.adb
+++ b/gcc/ada/s-exnint.adb
@@ -37,11 +37,7 @@ package body System.Exn_Int is
-- Exn_Integer --
-----------------
- function Exn_Integer
- (Left : Integer;
- Right : Natural)
- return Integer
- is
+ function Exn_Integer (Left : Integer; Right : Natural) return Integer is
pragma Suppress (Division_Check);
pragma Suppress (Overflow_Check);
diff --git a/gcc/ada/s-exnint.ads b/gcc/ada/s-exnint.ads
index d601b86d537..d35547b7bb5 100644
--- a/gcc/ada/s-exnint.ads
+++ b/gcc/ada/s-exnint.ads
@@ -36,9 +36,6 @@
package System.Exn_Int is
pragma Pure (Exn_Int);
- function Exn_Integer
- (Left : Integer;
- Right : Natural)
- return Integer;
+ function Exn_Integer (Left : Integer; Right : Natural) return Integer;
end System.Exn_Int;
diff --git a/gcc/ada/s-fileio.adb b/gcc/ada/s-fileio.adb
index 9028fd694ba..cf29b249533 100644
--- a/gcc/ada/s-fileio.adb
+++ b/gcc/ada/s-fileio.adb
@@ -34,6 +34,7 @@
with Ada.Finalization; use Ada.Finalization;
with Ada.IO_Exceptions; use Ada.IO_Exceptions;
with Interfaces.C_Streams; use Interfaces.C_Streams;
+with System.CRTL;
with System.Soft_Links;
with Unchecked_Deallocation;
@@ -43,6 +44,8 @@ package body System.File_IO is
package SSL renames System.Soft_Links;
+ use type System.CRTL.size_t;
+
----------------------
-- Global Variables --
----------------------
@@ -812,6 +815,10 @@ package body System.File_IO is
-- Normal case of non-null name given
else
+ if Name'Length > Namelen then
+ raise Name_Error;
+ end if;
+
Namestr (1 .. Name'Length) := Name;
Namestr (Name'Length + 1) := ASCII.NUL;
end if;
diff --git a/gcc/ada/s-geveop.adb b/gcc/ada/s-geveop.adb
index f183a213b39..1820bdf2a47 100644
--- a/gcc/ada/s-geveop.adb
+++ b/gcc/ada/s-geveop.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2002 Free Software Foundation, Inc. --
+-- Copyright (C) 2002-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -61,7 +61,7 @@ package body System.Generic_Vector_Operations is
function VP is new Unchecked_Conversion (Address, Vector_Ptr);
function EP is new Unchecked_Conversion (Address, Element_Ptr);
- SA : Address := XA + ((Length + 0) / VU * VU
+ SA : constant Address := XA + ((Length + 0) / VU * VU
and (Boolean'Pos (Unaligned) - Address'(1)));
-- First address of argument X to start serial processing
@@ -102,7 +102,7 @@ package body System.Generic_Vector_Operations is
function VP is new Unchecked_Conversion (Address, Vector_Ptr);
function EP is new Unchecked_Conversion (Address, Element_Ptr);
- SA : Address := XA + ((Length + 0) / VU * VU
+ SA : constant Address := XA + ((Length + 0) / VU * VU
and (Boolean'Pos (Unaligned) - Address'(1)));
-- First address of argument X to start serial processing
diff --git a/gcc/ada/s-interr.adb b/gcc/ada/s-interr.adb
index dc578bc1ce0..0145610dd12 100644
--- a/gcc/ada/s-interr.adb
+++ b/gcc/ada/s-interr.adb
@@ -598,7 +598,7 @@ package body System.Interrupts is
Ptr := Registered_Handler_Head;
- while (Ptr /= null) loop
+ while Ptr /= null loop
if Ptr.H = Fat.Handler_Addr then
return True;
end if;
@@ -946,7 +946,7 @@ package body System.Interrupts is
Server_ID (Interrupt) := To_System (Access_Hold.all'Identity);
end if;
- if (New_Handler = null) then
+ if New_Handler = null then
if Old_Handler /= null then
Unbind_Handler (Interrupt);
end if;
diff --git a/gcc/ada/s-memcop.ads b/gcc/ada/s-memcop.ads
index d71d48f17ca..f4d945487be 100644
--- a/gcc/ada/s-memcop.ads
+++ b/gcc/ada/s-memcop.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 2001-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2003 Free Software Foundation, Inc. --
-- --
-- This specification is derived from the Ada Reference Manual for use with --
-- GNAT. The copyright notice above, and the license provisions that follow --
@@ -35,24 +35,27 @@
-- --
------------------------------------------------------------------------------
--- This package provides general block copy mechanisms analgous to those
+-- This package provides general block copy mechanisms analogous to those
-- provided by the C routines memcpy and memmove allowing for copies with
--- and without possible overflow.
+-- and without possible overlap of the operands.
+
+-- The idea is to allow a configurable run-time to provide this capability
+-- for use by the compiler without dragging in C-run time routines.
+
+with System.CRTL;
+-- The above with is contrary to the intent ???
package System.Memory_Copy is
pragma Preelaborate;
- type size_t is mod 2 ** Standard'Address_Size;
- -- Note: the reason we redefine this here instead of using the
- -- definition in Interfaces.C is that we do not want to drag in
- -- all of Interfaces.C just because System.Memory_Copy is used.
-
- procedure memcpy (S1 : Address; S2 : Address; N : size_t);
+ procedure memcpy (S1 : Address; S2 : Address; N : System.CRTL.size_t)
+ renames System.CRTL.memcpy;
-- Copies N storage units from area starting at S2 to area starting
-- at S1 without any check for buffer overflow. The memory areas
-- must not overlap, or the result of this call is undefined.
- procedure memmove (S1 : Address; S2 : Address; N : size_t);
+ procedure memmove (S1 : Address; S2 : Address; N : System.CRTL.size_t)
+ renames System.CRTL.memmove;
-- Copies N storage units from area starting at S2 to area starting
-- at S1 without any check for buffer overflow. The difference between
-- this memmove and memcpy is that with memmove, the storage areas may
@@ -60,8 +63,6 @@ pragma Preelaborate;
-- is as if S2 is first moved to a temporary area, and then this area
-- is copied to S1 in a separate step).
-private
-
-- In the standard library, these are just interfaced to the C routines.
-- But in the HI-E (high integrity version) they may be reprogrammed to
-- meet certification requirements (and marked High_Integrity).
@@ -70,7 +71,4 @@ private
-- available, and the HI-E compiler will as a result generate implicit
-- loops (which will violate the restriction No_Implicit_Loops).
- pragma Import (C, memcpy, "memcpy");
- pragma Import (C, memmove, "memmove");
-
end System.Memory_Copy;
diff --git a/gcc/ada/s-memory.adb b/gcc/ada/s-memory.adb
index cdbb22e8908..66637c7291b 100644
--- a/gcc/ada/s-memory.adb
+++ b/gcc/ada/s-memory.adb
@@ -46,21 +46,22 @@
with Ada.Exceptions;
with System.Soft_Links;
with System.Parameters;
+with System.CRTL;
package body System.Memory is
use Ada.Exceptions;
use System.Soft_Links;
- function c_malloc (Size : size_t) return System.Address;
- pragma Import (C, c_malloc, "malloc");
+ function c_malloc (Size : System.CRTL.size_t) return System.Address
+ renames System.CRTL.malloc;
- procedure c_free (Ptr : System.Address);
- pragma Import (C, c_free, "free");
+ procedure c_free (Ptr : System.Address)
+ renames System.CRTL.free;
function c_realloc
- (Ptr : System.Address; Size : size_t) return System.Address;
- pragma Import (C, c_realloc, "realloc");
+ (Ptr : System.Address; Size : System.CRTL.size_t) return System.Address
+ renames System.CRTL.realloc;
-----------
-- Alloc --
@@ -85,10 +86,10 @@ package body System.Memory is
end if;
if Parameters.No_Abort then
- Result := c_malloc (Actual_Size);
+ Result := c_malloc (System.CRTL.size_t (Actual_Size));
else
Abort_Defer.all;
- Result := c_malloc (Actual_Size);
+ Result := c_malloc (System.CRTL.size_t (Actual_Size));
Abort_Undefer.all;
end if;
@@ -132,10 +133,10 @@ package body System.Memory is
end if;
if Parameters.No_Abort then
- Result := c_realloc (Ptr, Actual_Size);
+ Result := c_realloc (Ptr, System.CRTL.size_t (Actual_Size));
else
Abort_Defer.all;
- Result := c_realloc (Ptr, Actual_Size);
+ Result := c_realloc (Ptr, System.CRTL.size_t (Actual_Size));
Abort_Undefer.all;
end if;
diff --git a/gcc/ada/s-rident.ads b/gcc/ada/s-rident.ads
index cd4004c834a..6b07f9190af 100644
--- a/gcc/ada/s-rident.ads
+++ b/gcc/ada/s-rident.ads
@@ -56,6 +56,7 @@ package System.Rident is
No_Asynchronous_Control, -- (RM D.7(10))
No_Calendar, -- GNAT
No_Delay, -- (RM H.4(21))
+ No_Direct_Boolean_Operators, -- GNAT
No_Dispatch, -- (RM H.4(19))
No_Dynamic_Interrupts, -- GNAT
No_Dynamic_Priorities, -- (RM D.9(9))
diff --git a/gcc/ada/s-stache.adb b/gcc/ada/s-stache.adb
index 65e816b654f..aa403c3f988 100644
--- a/gcc/ada/s-stache.adb
+++ b/gcc/ada/s-stache.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1999-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1999-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -36,6 +36,7 @@ with Ada.Exceptions;
with System.Storage_Elements; use System.Storage_Elements;
with System.Parameters; use System.Parameters;
with System.Soft_Links;
+with System.CRTL;
package body System.Stack_Checking is
@@ -72,7 +73,6 @@ package body System.Stack_Checking is
procedure Invalidate_Stack_Cache (Any_Stack : Stack_Access) is
pragma Warnings (Off, Any_Stack);
-
begin
Cache := Null_Stack;
end Invalidate_Stack_Cache;
@@ -82,8 +82,7 @@ package body System.Stack_Checking is
--------------------
function Set_Stack_Info
- (Stack : access Stack_Access)
- return Stack_Access
+ (Stack : access Stack_Access) return Stack_Access
is
type Frame_Mark is null record;
Frame_Location : Frame_Mark;
@@ -93,12 +92,6 @@ package body System.Stack_Checking is
Limit_Chars : System.Address;
Limit : Integer;
- function getenv (S : String) return System.Address;
- pragma Import (C, getenv, External_Name => "getenv");
-
- function atoi (A : System.Address) return Integer;
- pragma Import (C, atoi);
-
begin
-- The order of steps 1 .. 3 is important, see specification.
@@ -113,16 +106,16 @@ package body System.Stack_Checking is
-- the current frame address.
if My_Stack.Size = 0 then
-
My_Stack.Size := Storage_Offset (Default_Env_Stack_Size);
-- When the environment variable GNAT_STACK_LIMIT is set,
-- set Environment_Stack_Size to that number of kB.
- Limit_Chars := getenv ("GNAT_STACK_LIMIT" & ASCII.NUL);
+ Limit_Chars := System.CRTL.getenv ("GNAT_STACK_LIMIT" & ASCII.NUL);
if Limit_Chars /= Null_Address then
- Limit := atoi (Limit_Chars);
+ Limit := System.CRTL.atoi (Limit_Chars);
+
if Limit >= 0 then
My_Stack.Size := Storage_Offset (Limit) * Kilobyte;
end if;
@@ -192,8 +185,7 @@ package body System.Stack_Checking is
-----------------
function Stack_Check
- (Stack_Address : System.Address)
- return Stack_Access
+ (Stack_Address : System.Address) return Stack_Access
is
type Frame_Marker is null record;
Marker : Frame_Marker;
@@ -227,7 +219,6 @@ package body System.Stack_Checking is
-- it is essential to use our local copy of Stack!
begin
-
if (Stack_Grows_Down and then
(not (Frame_Address <= My_Stack.Base)))
or else
diff --git a/gcc/ada/s-tasdeb.adb b/gcc/ada/s-tasdeb.adb
index f8f50b9a1bb..baca96162db 100644
--- a/gcc/ada/s-tasdeb.adb
+++ b/gcc/ada/s-tasdeb.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1997-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1997-2003 Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -39,14 +39,12 @@
-- Do not add any dependency to GNARL packages since this package is used
-- in both normal and restricted (ravenscar) environments.
-with Interfaces.C;
+with System.CRTL;
with System.Task_Primitives.Operations;
with Unchecked_Conversion;
package body System.Tasking.Debug is
- use Interfaces.C;
-
package STPO renames System.Task_Primitives.Operations;
function To_Integer is new
@@ -60,8 +58,7 @@ package body System.Tasking.Debug is
-- Local Subprograms --
-----------------------
- procedure write (Fd : Integer; S : String; Count : size_t);
- pragma Import (C, write);
+ procedure Write (Fd : Integer; S : String; Count : Integer);
procedure Put (S : String);
-- Display S on standard output.
@@ -177,7 +174,7 @@ package body System.Tasking.Debug is
procedure Put (S : String) is
begin
- write (2, S, S'Length);
+ Write (2, S, S'Length);
end Put;
--------------
@@ -186,7 +183,7 @@ package body System.Tasking.Debug is
procedure Put_Line (S : String := "") is
begin
- write (2, S & ASCII.LF, S'Length + 1);
+ Write (2, S & ASCII.LF, S'Length + 1);
end Put_Line;
----------------------
@@ -297,4 +294,11 @@ package body System.Tasking.Debug is
end if;
end Trace;
+ procedure Write (Fd : Integer; S : String; Count : Integer) is
+
+ Num : Integer;
+ begin
+ Num := System.CRTL.write (Fd, S (S'First)'Address, Count);
+ end Write;
+
end System.Tasking.Debug;
diff --git a/gcc/ada/s-taskin.adb b/gcc/ada/s-taskin.adb
index 84dafe76123..63d527d20ae 100644
--- a/gcc/ada/s-taskin.adb
+++ b/gcc/ada/s-taskin.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNARL is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -122,7 +122,7 @@ package body System.Tasking is
All_Tasks_List := T;
end Initialize_ATCB;
- Main_Task_Image : String := "main_task";
+ Main_Task_Image : constant String := "main_task";
-- Image of environment task.
Main_Priority : Integer;
diff --git a/gcc/ada/s-tassta.adb b/gcc/ada/s-tassta.adb
index 8fc01030702..14826330e72 100644
--- a/gcc/ada/s-tassta.adb
+++ b/gcc/ada/s-tassta.adb
@@ -1089,7 +1089,8 @@ package body System.Tasking.Stages is
(Ada, Tailored_Exception_Information,
"__gnat_tailored_exception_information");
- Excep : Exception_Occurrence_Access := SSL.Get_Current_Excep.all;
+ Excep : constant Exception_Occurrence_Access :=
+ SSL.Get_Current_Excep.all;
begin
-- This procedure is called by the task outermost handler in
diff --git a/gcc/ada/s-thread.adb b/gcc/ada/s-thread.adb
index 0f3a90c1a08..369d46d0e84 100644
--- a/gcc/ada/s-thread.adb
+++ b/gcc/ada/s-thread.adb
@@ -31,27 +31,21 @@
-- --
------------------------------------------------------------------------------
--- This is the VxWorks/Cert version of this package
+-- This is a dummy version of this package.
with Unchecked_Conversion;
-package body System.Threads is
-
- Current_ATSD : aliased System.Address := System.Null_Address;
- pragma Export (C, Current_ATSD, "__gnat_current_atsd");
+with System.Threads.Initialization;
- function From_Address is
- new Unchecked_Conversion (Address, ATSD_Access);
+package body System.Threads is
-----------------------
-- Get_Current_Excep --
-----------------------
function Get_Current_Excep return EOA is
- CTSD : ATSD_Access := From_Address (Current_ATSD);
begin
- pragma Assert (Current_ATSD /= System.Null_Address);
- return CTSD.Current_Excep'Access;
+ return null;
end Get_Current_Excep;
------------------------
@@ -59,10 +53,8 @@ package body System.Threads is
------------------------
function Get_Jmpbuf_Address return Address is
- CTSD : ATSD_Access := From_Address (Current_ATSD);
begin
- pragma Assert (Current_ATSD /= System.Null_Address);
- return CTSD.Jmpbuf_Address;
+ return Null_Address;
end Get_Jmpbuf_Address;
------------------------
@@ -70,10 +62,8 @@ package body System.Threads is
------------------------
function Get_Sec_Stack_Addr return Address is
- CTSD : ATSD_Access := From_Address (Current_ATSD);
begin
- pragma Assert (Current_ATSD /= System.Null_Address);
- return CTSD.Sec_Stack_Addr;
+ return Null_Address;
end Get_Sec_Stack_Addr;
------------------------
@@ -81,10 +71,9 @@ package body System.Threads is
------------------------
procedure Set_Jmpbuf_Address (Addr : Address) is
- CTSD : ATSD_Access := From_Address (Current_ATSD);
+ pragma Unreferenced (Addr);
begin
- pragma Assert (Current_ATSD /= System.Null_Address);
- CTSD.Jmpbuf_Address := Addr;
+ null;
end Set_Jmpbuf_Address;
------------------------
@@ -92,10 +81,46 @@ package body System.Threads is
------------------------
procedure Set_Sec_Stack_Addr (Addr : Address) is
- CTSD : ATSD_Access := From_Address (Current_ATSD);
+ pragma Unreferenced (Addr);
begin
- pragma Assert (Current_ATSD /= System.Null_Address);
- CTSD.Sec_Stack_Addr := Addr;
+ null;
end Set_Sec_Stack_Addr;
+ -----------------------
+ -- Thread_Body_Enter --
+ -----------------------
+
+ procedure Thread_Body_Enter
+ (Sec_Stack_Address : System.Address;
+ Sec_Stack_Size : Natural;
+ Process_ATSD_Address : System.Address)
+ is
+ pragma Unreferenced (Sec_Stack_Address);
+ pragma Unreferenced (Sec_Stack_Size);
+ pragma Unreferenced (Process_ATSD_Address);
+ begin
+ null;
+ end Thread_Body_Enter;
+
+ ----------------------------------
+ -- Thread_Body_Exceptional_Exit --
+ ----------------------------------
+
+ procedure Thread_Body_Exceptional_Exit
+ (EO : Ada.Exceptions.Exception_Occurrence)
+ is
+ pragma Unreferenced (EO);
+ begin
+ null;
+ end Thread_Body_Exceptional_Exit;
+
+ -----------------------
+ -- Thread_Body_Leave --
+ -----------------------
+
+ procedure Thread_Body_Leave is
+ begin
+ null;
+ end Thread_Body_Leave;
+
end System.Threads;
diff --git a/gcc/ada/s-thread.ads b/gcc/ada/s-thread.ads
index 6bf6aafb568..f1606f1b808 100644
--- a/gcc/ada/s-thread.ads
+++ b/gcc/ada/s-thread.ads
@@ -34,7 +34,14 @@
-- This package provides facilities to register a thread to the runtime,
-- and allocate its task specific datas.
+-- pragma Thread_Body is currently supported for:
+-- VxWorks AE653 with the restricted / cert runtime
+
with Ada.Exceptions;
+-- used for Exception_Occurrence
+
+with System.Soft_Links;
+-- used for TSD
package System.Threads is
@@ -48,7 +55,7 @@ package System.Threads is
type ATSD_Access is access ATSD;
- -- Get/Set for the attributes of the current thread.
+ -- Get/Set for the attributes of the current thread
function Get_Jmpbuf_Address return Address;
pragma Inline (Get_Jmpbuf_Address);
@@ -65,29 +72,75 @@ package System.Threads is
function Get_Current_Excep return EOA;
pragma Inline (Get_Current_Excep);
-private
+ --------------------------
+ -- Thread Body Handling --
+ --------------------------
+
+ -- The subprograms in this section are called by the expansion of a
+ -- subprogram body to which a Thread_Body pragma has been applied:
+
+ -- Given a subprogram body
+
+ -- procedure xyz (params ....) is -- can also be a function
+ -- <user declarations>
+ -- begin
+ -- <user statements>
+ -- <user exception handlers>
+ -- end xyz;
+
+ -- The expansion resulting from use of the Thread_Body pragma is:
+
+ -- procedure xyz (params ...) is
+
+ -- _Secondary_Stack : aliased
+ -- Storage_Elements.Storage_Array
+ -- (1 .. Storage_Offset (Sec_Stack_Size));
+ -- for _Secondary_Stack'Alignment use Standard'Maximum_Alignment;
- ------------------------
- -- Task Specific Data --
- ------------------------
+ -- _Process_ATSD : aliased System.Threads.ATSD;
- type ATSD is limited record
- Jmpbuf_Address : Address := Null_Address;
- -- Address of jump buffer used to store the address of the
- -- current longjmp/setjmp buffer for exception management.
- -- These buffers are threaded into a stack, and the address
- -- here is the top of the stack. A null address means that
- -- no exception handler is currently active.
+ -- begin
+ -- System.Threads.Thread_Body_Enter;
+ -- (_Secondary_Stack'Address,
+ -- _Secondary_Stack'Length,
+ -- _Process_ATSD'Address);
- Sec_Stack_Addr : Address := Null_Address;
- -- Address of currently allocated secondary stack
+ -- declare
+ -- <user declarations>
+ -- begin
+ -- <user statements>
+ -- <user exception handlers>
+ -- end;
- Current_Excep : aliased EO;
- -- Exception occurrence that contains the information for the
- -- current exception. Note that any exception in the same task
- -- destroys this information, so the data in this variable must
- -- be copied out before another exception can occur.
+ -- System.Threads.Thread_Body_Leave;
+
+ -- exception
+ -- when E : others =>
+ -- System.Threads.Thread_Body_Exceptional_Exit (E);
+ -- end;
+
+ -- Note the exception handler is omitted if pragma Restriction
+ -- No_Exception_Handlers is currently active.
+
+ -- Note: the secondary stack size (Sec_Stack_Size) comes either from
+ -- the pragma, if specified, or is the default value taken from
+ -- the declaration in System.Secondary_Stack.
+
+ procedure Thread_Body_Enter
+ (Sec_Stack_Address : System.Address;
+ Sec_Stack_Size : Natural;
+ Process_ATSD_Address : System.Address);
+ -- Enter thread body, see above for details
+
+ procedure Thread_Body_Leave;
+ -- Leave thread body (normally), see above for details
+
+ procedure Thread_Body_Exceptional_Exit
+ (EO : Ada.Exceptions.Exception_Occurrence);
+ -- Leave thread body (abnormally on exception), see above for details
+
+private
- end record;
+ type ATSD is new System.Soft_Links.TSD;
end System.Threads;
diff --git a/gcc/ada/s-tpae65.adb b/gcc/ada/s-tpae65.adb
deleted file mode 100644
index b0438b00fa3..00000000000
--- a/gcc/ada/s-tpae65.adb
+++ /dev/null
@@ -1,87 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNU ADA RUN-TIME LIBRARY (GNARL) COMPONENTS --
--- --
--- S Y S T E M . T A S K _ P R I M I T I V E S . A E _ 6 5 3 --
--- --
--- B o d y --
--- --
--- Copyright (C) 2002-2003, Free Software Foundation, Inc. --
--- --
--- GNARL is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNARL is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNARL; see 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 other files instantiate generics from this --
--- unit, or you link this unit with other files to produce an executable, --
--- this unit does not by itself cause the resulting executable to be --
--- covered by the GNU General Public License. This exception does not --
--- however invalidate any other reasons why the executable file might be --
--- covered by the GNU Public License. --
--- --
--- GNARL was developed by the GNARL team at Florida State University. --
--- Extensive contributions were provided by Ada Core Technologies, Inc. --
--- --
-------------------------------------------------------------------------------
-
--- Export certain tasking-related routines for use by Interfaces.Vthreads
-
-with Interfaces.C;
-package body System.Task_Primitives.Ae_653 is
-
- -------------------
- -- ATCB_Key_Addr --
- -------------------
-
- function ATCB_Key_Addr return Address_Access is
- Key_Addr : Address_Access;
- pragma Import (Ada, Key_Addr, "__gnat_ATCB_key_addr");
- -- Done this way to minimize impact on other targets. This
- -- implementation is temporary, and specific to AE653
- begin
- return Key_Addr;
- end ATCB_Key_Addr;
-
- --------------------------
- -- Set_Current_Priority --
- --------------------------
-
- procedure Set_Current_Priority
- (T : System.Tasking.Task_ID;
- Prio : System.Priority)
- is
- begin
- T.Common.Current_Priority := Prio;
- end Set_Current_Priority;
-
- ---------------------
- -- Set_Task_Thread --
- ---------------------
-
- procedure Set_Task_Thread
- (T : System.Tasking.Task_ID;
- Thread : System.OS_Interface.Thread_Id)
- is
- use System.OS_Interface;
- use System.Tasking;
- use type Interfaces.C.int;
- Result : STATUS;
- begin
- T.Common.LL.Thread := Thread;
- if taskVarGet (Thread, ATCB_Key_Addr) = ERROR then
- Result := taskVarAdd (Thread, ATCB_Key_Addr);
- pragma Assert (Result = OK);
- end if;
-
- Result := taskVarSet (Thread, ATCB_Key_Addr, To_Address (T));
- pragma Assert (Result = OK);
- end Set_Task_Thread;
-
-end System.Task_Primitives.Ae_653;
diff --git a/gcc/ada/scans.ads b/gcc/ada/scans.ads
index 1551296907e..b8f5c397654 100644
--- a/gcc/ada/scans.ads
+++ b/gcc/ada/scans.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -187,15 +187,21 @@ package Scans is
Tok_Dot_Dot, -- .. Sterm, Chtok
- -- The following three entries are used only when scanning
- -- project files.
+ -- The following three entries are used only when scanning project
+ -- files.
Tok_Project,
Tok_Extends,
Tok_External,
+ Tok_Comment,
+
+ -- The following entry is used by the preprocessor and when scanning
+ -- project files.
- -- The following two entries are used by the preprocessor
Tok_End_Of_Line,
+
+ -- The following entry is used by the preprocessor
+
Tok_Special,
No_Token);
@@ -404,6 +410,10 @@ package Scans is
Special_Character : Character;
-- Valid only when Token = Tok_Special
+ Comment_Id : Name_Id := No_Name;
+ -- Valid only when Token = Tok_Comment. Store the string that follows
+ -- the two '-' of a comment.
+
--------------------------------------------------------
-- Procedures for Saving and Restoring the Scan State --
--------------------------------------------------------
diff --git a/gcc/ada/scn.adb b/gcc/ada/scn.adb
index 91908d3667d..ff0792c2cf0 100644
--- a/gcc/ada/scn.adb
+++ b/gcc/ada/scn.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -261,10 +261,14 @@ package body Scn is
begin
Scanner.Initialize_Scanner (Unit, Index);
- -- Set default for Comes_From_Source. All nodes built now until we
+ -- Set default for Comes_From_Source (except if we are going to process
+ -- an artificial string internally created within the compiler and
+ -- placed into internal source duffer). All nodes built now until we
-- reenter the analyzer will have Comes_From_Source set to True
- Set_Comes_From_Source_Default (True);
+ if Index /= Internal_Source_File then
+ Set_Comes_From_Source_Default (True);
+ end if;
-- Check license if GNAT type header possibly present
@@ -278,7 +282,19 @@ package body Scn is
-- call Scan. Scan initial token (note this initializes Prev_Token,
-- Prev_Token_Ptr).
- Scan;
+ -- There are two reasons not to do the Scan step in case if we
+ -- initialize the scanner for the internal source buffer:
+
+ -- - The artificial string may not be created by the compiler in this
+ -- buffer when we call Initialize_Scanner
+
+ -- - For these artificial strings a special way of scanning is used, so
+ -- the standard step of the scanner may just break the algorithm of
+ -- processing these strings.
+
+ if Index /= Internal_Source_File then
+ Scan;
+ end if;
-- Clear flags for reserved words used as indentifiers
diff --git a/gcc/ada/scng.adb b/gcc/ada/scng.adb
index 369a6acc944..cb46bf189ee 100644
--- a/gcc/ada/scng.adb
+++ b/gcc/ada/scng.adb
@@ -49,6 +49,9 @@ package body Scng is
Special_Characters : array (Character) of Boolean := (others => False);
-- For characters that are Special token, the value is True
+ Comment_Is_Token : Boolean := False;
+ -- True if comments are tokens
+
End_Of_Line_Is_Token : Boolean := False;
-- True if End_Of_Line is a token
@@ -229,6 +232,8 @@ package body Scng is
procedure Scan is
+ Start_Of_Comment : Source_Ptr;
+
procedure Check_End_Of_Line;
-- Called when end of line encountered. Checks that line is not
-- too long, and that other style checks for the end of line are met.
@@ -1394,6 +1399,7 @@ package body Scng is
else -- Source (Scan_Ptr + 1) = '-' then
if Style_Check then Style.Check_Comment; end if;
Scan_Ptr := Scan_Ptr + 2;
+ Start_Of_Comment := Scan_Ptr;
-- Loop to scan comment (this loop runs more than once only if
-- a horizontal tab or other non-graphic character is scanned)
@@ -1449,9 +1455,18 @@ package body Scng is
end loop;
- -- Note that we do NOT execute a return here, instead we fall
- -- through to reexecute the scan loop to look for a token.
-
+ -- Note that, except when comments are tokens, we do NOT
+ -- execute a return here, instead we fall through to reexecute
+ -- the scan loop to look for a token.
+
+ if Comment_Is_Token then
+ Name_Len := Integer (Scan_Ptr - Start_Of_Comment);
+ Name_Buffer (1 .. Name_Len) :=
+ String (Source (Start_Of_Comment .. Scan_Ptr - 1));
+ Comment_Id := Name_Find;
+ Token := Tok_Comment;
+ return;
+ end if;
end if;
end Minus_Case;
@@ -2066,6 +2081,14 @@ package body Scng is
return;
end if;
end Scan;
+ --------------------------
+ -- Set_Comment_As_Token --
+ --------------------------
+
+ procedure Set_Comment_As_Token (Value : Boolean) is
+ begin
+ Comment_Is_Token := Value;
+ end Set_Comment_As_Token;
------------------------------
-- Set_End_Of_Line_As_Token --
diff --git a/gcc/ada/scng.ads b/gcc/ada/scng.ads
index 7ebb441f63e..31e81a7cd7f 100644
--- a/gcc/ada/scng.ads
+++ b/gcc/ada/scng.ads
@@ -6,7 +6,7 @@
-- --
-- S p e c --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -91,6 +91,10 @@ package Scng is
-- Indicate if End_Of_Line is a token or not.
-- By default, End_Of_Line is not a token.
+ procedure Set_Comment_As_Token (Value : Boolean);
+ -- Indicate if a comment is a token or not.
+ -- By default, a comment is not a token.
+
function Set_Start_Column return Column_Number;
-- This routine is called with Scan_Ptr pointing to the first character
-- of a line. On exit, Scan_Ptr is advanced to the first non-blank
diff --git a/gcc/ada/sem_aggr.adb b/gcc/ada/sem_aggr.adb
index d02abfd52dd..897e9b500af 100644
--- a/gcc/ada/sem_aggr.adb
+++ b/gcc/ada/sem_aggr.adb
@@ -29,6 +29,7 @@ with Checks; use Checks;
with Einfo; use Einfo;
with Elists; use Elists;
with Errout; use Errout;
+with Exp_Tss; use Exp_Tss;
with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Itypes; use Itypes;
@@ -334,7 +335,7 @@ package body Sem_Aggr is
--
-- Typ is the context type in which N occurs.
--
- -- This routine creates an implicit array subtype whose bouds are
+ -- This routine creates an implicit array subtype whose bounds are
-- those defined by the aggregate. When this routine is invoked
-- Resolve_Array_Aggregate has already processed aggregate N. Thus the
-- Aggregate_Bounds of each sub-aggregate, is an N_Range node giving the
@@ -866,7 +867,11 @@ package body Sem_Aggr is
Error_Msg_N ("aggregate type cannot have limited component", N);
Explain_Limited_Type (Typ, N);
- elsif Is_Limited_Type (Typ) then
+ -- Ada0Y (AI-287): Limited aggregates allowed
+
+ elsif Is_Limited_Type (Typ)
+ and not Extensions_Allowed
+ then
Error_Msg_N ("aggregate type cannot be limited", N);
Explain_Limited_Type (Typ, N);
@@ -958,6 +963,8 @@ package body Sem_Aggr is
-- formal parameter. Consequently we also need to test for
-- N_Procedure_Call_Statement or N_Function_Call.
+ Set_Etype (N, Aggr_Typ); -- may be overridden later on.
+
if Is_Constrained (Typ) and then
(Pkind = N_Assignment_Statement or else
Pkind = N_Parameter_Association or else
@@ -1637,9 +1644,27 @@ package body Sem_Aggr is
end if;
end loop;
- if not
- Resolve_Aggr_Expr
- (Expression (Assoc), Single_Elmt => Single_Choice)
+ -- Ada0Y (AI-287): In case of default initialized component
+ -- we delay the resolution to the expansion phase
+
+ if Box_Present (Assoc) then
+
+ -- Ada0Y (AI-287): In case of default initialization of a
+ -- component the expander will generate calls to the
+ -- corresponding initialization subprogram.
+
+ if Present (Base_Init_Proc (Etype (Component_Typ)))
+ or else Has_Task (Base_Type (Component_Typ))
+ then
+ null;
+ else
+ Error_Msg_N
+ ("(Ada 0Y): no value supplied for this component",
+ Assoc);
+ end if;
+
+ elsif not Resolve_Aggr_Expr (Expression (Assoc),
+ Single_Elmt => Single_Choice)
then
return Failure;
end if;
@@ -1760,8 +1785,26 @@ package body Sem_Aggr is
if Others_Present then
Assoc := Last (Component_Associations (N));
- if not Resolve_Aggr_Expr (Expression (Assoc),
- Single_Elmt => False)
+
+ -- Ada0Y (AI-287): In case of default initialized component
+ -- we delay the resolution to the expansion phase.
+
+ if Box_Present (Assoc) then
+
+ -- Ada0Y (AI-287): In case of default initialization of a
+ -- component the expander will generate calls to the
+ -- corresponding initialization subprogram.
+
+ if Present (Base_Init_Proc (Etype (Component_Typ))) then
+ null;
+ else
+ Error_Msg_N
+ ("(Ada 0Y): no value supplied for these components",
+ Assoc);
+ end if;
+
+ elsif not Resolve_Aggr_Expr (Expression (Assoc),
+ Single_Elmt => False)
then
return Failure;
end if;
@@ -1914,9 +1957,16 @@ package body Sem_Aggr is
return;
elsif Is_Limited_Type (Typ) then
- Error_Msg_N ("aggregate type cannot be limited", N);
- Explain_Limited_Type (Typ, N);
- return;
+
+ -- Ada0Y (AI-287): Limited aggregates are allowed
+
+ if Extensions_Allowed then
+ null;
+ else
+ Error_Msg_N ("aggregate type cannot be limited", N);
+ Explain_Limited_Type (Typ, N);
+ return;
+ end if;
elsif Is_Class_Wide_Type (Typ) then
Error_Msg_N ("aggregate cannot be of a class-wide type", N);
@@ -2017,7 +2067,19 @@ package body Sem_Aggr is
--
-- This variable is updated as a side effect of function Get_Value
- procedure Add_Association (Component : Entity_Id; Expr : Node_Id);
+ Mbox_Present : Boolean := False;
+ Others_Mbox : Boolean := False;
+ -- Ada0Y (AI-287): Variables used in case of default initialization to
+ -- provide a functionality similar to Others_Etype. Mbox_Present
+ -- indicates that the component takes its default initialization;
+ -- Others_Mbox indicates that at least one component takes its default
+ -- initialization. Similar to Others_Etype, they are also updated as a
+ -- side effect of function Get_Value.
+
+ procedure Add_Association
+ (Component : Entity_Id;
+ Expr : Node_Id;
+ Box_Present : Boolean := False);
-- Builds a new N_Component_Association node which associates
-- Component to expression Expr and adds it to the new association
-- list New_Assoc_List being built.
@@ -2064,7 +2126,11 @@ package body Sem_Aggr is
-- Add_Association --
---------------------
- procedure Add_Association (Component : Entity_Id; Expr : Node_Id) is
+ procedure Add_Association
+ (Component : Entity_Id;
+ Expr : Node_Id;
+ Box_Present : Boolean := False)
+ is
Choice_List : constant List_Id := New_List;
New_Assoc : Node_Id;
@@ -2072,8 +2138,9 @@ package body Sem_Aggr is
Append (New_Occurrence_Of (Component, Sloc (Expr)), Choice_List);
New_Assoc :=
Make_Component_Association (Sloc (Expr),
- Choices => Choice_List,
- Expression => Expr);
+ Choices => Choice_List,
+ Expression => Expr,
+ Box_Present => Box_Present);
Append (New_Assoc, New_Assoc_List);
end Add_Association;
@@ -2174,7 +2241,44 @@ package body Sem_Aggr is
Expr : Node_Id := Empty;
Selector_Name : Node_Id;
+ procedure Check_Non_Limited_Type;
+ -- Relax check to allow the default initialization of limited types.
+ -- For example:
+ -- record
+ -- C : Lim := (..., others => <>);
+ -- end record;
+
+ ----------------------------
+ -- Check_Non_Limited_Type --
+ ----------------------------
+
+ procedure Check_Non_Limited_Type is
+ begin
+ if Is_Limited_Type (Etype (Compon))
+ and then Comes_From_Source (Compon)
+ and then not In_Instance_Body
+ then
+ -- Ada0Y (AI-287): Limited aggregates are allowed
+
+ if Extensions_Allowed
+ and then Present (Expression (Assoc))
+ and then Nkind (Expression (Assoc)) = N_Aggregate
+ then
+ null;
+ else
+ Error_Msg_N
+ ("initialization not allowed for limited types", N);
+ Explain_Limited_Type (Etype (Compon), Compon);
+ end if;
+
+ end if;
+ end Check_Non_Limited_Type;
+
+ -- Start of processing for Get_Value
+
begin
+ Mbox_Present := False;
+
if Present (From) then
Assoc := First (From);
else
@@ -2186,14 +2290,6 @@ package body Sem_Aggr is
while Present (Selector_Name) loop
if Nkind (Selector_Name) = N_Others_Choice then
if Consider_Others_Choice and then No (Expr) then
- if Present (Others_Etype) and then
- Base_Type (Others_Etype) /= Base_Type (Etype (Compon))
- then
- Error_Msg_N ("components in OTHERS choice must " &
- "have same type", Selector_Name);
- end if;
-
- Others_Etype := Etype (Compon);
-- We need to duplicate the expression for each
-- successive component covered by the others choice.
@@ -2202,10 +2298,38 @@ package body Sem_Aggr is
-- indispensable otherwise, because each one must be
-- expanded individually to preserve side-effects.
- if Expander_Active then
- return New_Copy_Tree (Expression (Assoc));
+ -- Ada0Y (AI-287): In case of default initialization of
+ -- components, we duplicate the corresponding default
+ -- expression (from the record type declaration).
+
+ if Box_Present (Assoc) then
+ Others_Mbox := True;
+ Mbox_Present := True;
+
+ if Expander_Active then
+ return New_Copy_Tree (Expression (Parent (Compon)));
+ else
+ return Expression (Parent (Compon));
+ end if;
+
else
- return Expression (Assoc);
+ Check_Non_Limited_Type;
+
+ if Present (Others_Etype) and then
+ Base_Type (Others_Etype) /= Base_Type (Etype
+ (Compon))
+ then
+ Error_Msg_N ("components in OTHERS choice must " &
+ "have same type", Selector_Name);
+ end if;
+
+ Others_Etype := Etype (Compon);
+
+ if Expander_Active then
+ return New_Copy_Tree (Expression (Assoc));
+ else
+ return Expression (Assoc);
+ end if;
end if;
end if;
@@ -2216,10 +2340,27 @@ package body Sem_Aggr is
-- components are grouped together with a "|" choice.
-- For instance "filed1 | filed2 => Expr"
- if Present (Next (Selector_Name)) then
- Expr := New_Copy_Tree (Expression (Assoc));
+ if Box_Present (Assoc) then
+ Mbox_Present := True;
+
+ -- Duplicate the default expression of the component
+ -- from the record type declaration
+
+ if Present (Next (Selector_Name)) then
+ Expr := New_Copy_Tree
+ (Expression (Parent (Compon)));
+ else
+ Expr := Expression (Parent (Compon));
+ end if;
+
else
- Expr := Expression (Assoc);
+ Check_Non_Limited_Type;
+
+ if Present (Next (Selector_Name)) then
+ Expr := New_Copy_Tree (Expression (Assoc));
+ else
+ Expr := Expression (Assoc);
+ end if;
end if;
Generate_Reference (Compon, Selector_Name);
@@ -2753,7 +2894,19 @@ package body Sem_Aggr is
Component := Node (Component_Elmt);
Expr := Get_Value (Component, Component_Associations (N), True);
- if No (Expr) then
+ if Mbox_Present and then Is_Limited_Type (Etype (Component)) then
+
+ -- Ada0Y (AI-287): In case of default initialization of a limited
+ -- component we pass the limited component to the expander. The
+ -- expander will generate calls to the corresponding initiali-
+ -- zation subprograms.
+
+ Add_Association
+ (Component => Component,
+ Expr => Empty,
+ Box_Present => True);
+
+ elsif No (Expr) then
Error_Msg_NE ("no value supplied for component &!", N, Component);
else
Resolve_Aggr_Expr (Expr, Component);
@@ -2783,7 +2936,12 @@ package body Sem_Aggr is
Typech := Empty;
if Nkind (Selectr) = N_Others_Choice then
- if No (Others_Etype) then
+
+ -- Ada0Y (AI-287): others choice may have expression or mbox
+
+ if No (Others_Etype)
+ and then not Others_Mbox
+ then
Error_Msg_N
("OTHERS must represent at least one component", Selectr);
end if;
@@ -2804,8 +2962,10 @@ package body Sem_Aggr is
-- component supplied by a previous expansion.
if No (New_Assoc) then
+ if Box_Present (Parent (Selectr)) then
+ null;
- if Chars (Selectr) /= Name_uTag
+ elsif Chars (Selectr) /= Name_uTag
and then Chars (Selectr) /= Name_uParent
and then Chars (Selectr) /= Name_uController
then
@@ -2827,8 +2987,11 @@ package body Sem_Aggr is
Typech := Base_Type (Etype (Component));
elsif Typech /= Base_Type (Etype (Component)) then
- Error_Msg_N
- ("components in choice list must have same type", Selectr);
+ if not Box_Present (Parent (Selectr)) then
+ Error_Msg_N
+ ("components in choice list must have same type",
+ Selectr);
+ end if;
end if;
Next (Selectr);
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb
index 83833c15b5a..8629c4d7359 100644
--- a/gcc/ada/sem_attr.adb
+++ b/gcc/ada/sem_attr.adb
@@ -372,8 +372,8 @@ package body Sem_Attr is
----------------------------------
procedure Build_Access_Subprogram_Type (P : Node_Id) is
- Index : Interp_Index;
- It : Interp;
+ Index : Interp_Index;
+ It : Interp;
function Get_Kind (E : Entity_Id) return Entity_Kind;
-- Distinguish between access to regular and protected
@@ -395,6 +395,10 @@ package body Sem_Attr is
-- Start of processing for Build_Access_Subprogram_Type
begin
+ -- In the case of an access to subprogram, use the name of the
+ -- subprogram itself as the designated type. Type-checking in
+ -- this case compares the signatures of the designated types.
+
if not Is_Overloaded (P) then
Acc_Type :=
New_Internal_Entity
@@ -408,7 +412,6 @@ package body Sem_Attr is
Set_Etype (N, Any_Type);
while Present (It.Nam) loop
-
if not Is_Intrinsic_Subprogram (It.Nam) then
Acc_Type :=
New_Internal_Entity
@@ -437,17 +440,20 @@ package body Sem_Attr is
("prefix of % attribute cannot be enumeration literal", P);
end if;
- -- In the case of an access to subprogram, use the name of the
- -- subprogram itself as the designated type. Type-checking in
- -- this case compares the signatures of the designated types.
+ -- Case of access to subprogram
if Is_Entity_Name (P)
and then Is_Overloadable (Entity (P))
then
+ -- Not allowed for nested subprograms if No_Implicit_Dynamic_Code
+ -- restriction set (since in general a trampoline is required).
+
if not Is_Library_Level_Entity (Entity (P)) then
Check_Restriction (No_Implicit_Dynamic_Code, P);
end if;
+ -- Build the appropriate subprogram type
+
Build_Access_Subprogram_Type (P);
-- For unrestricted access, kill current values, since this
@@ -460,7 +466,7 @@ package body Sem_Attr is
return;
- -- Component is an operation of a protected type.
+ -- Component is an operation of a protected type
elsif Nkind (P) = N_Selected_Component
and then Is_Overloadable (Entity (Selector_Name (P)))
@@ -1358,7 +1364,8 @@ package body Sem_Attr is
Error_Attr ("prefix of % attribute must be generic type", N);
elsif Is_Generic_Actual_Type (Entity (P))
- or In_Instance
+ or else In_Instance
+ or else In_Inlined_Body
then
null;
@@ -2178,9 +2185,12 @@ package body Sem_Attr is
if Is_Entity_Name (P) and then Is_Type (Entity (P)) then
-- If we are within an instance, the attribute must be legal
- -- because it was valid in the generic unit.
+ -- because it was valid in the generic unit. Ditto if this is
+ -- an inlining of a function declared in an instance.
- if In_Instance then
+ if In_Instance
+ or else In_Inlined_Body
+ then
return;
-- For sure OK if we have a real private type itself, but must
@@ -6406,7 +6416,6 @@ package body Sem_Attr is
end if;
if Is_Entity_Name (P) then
-
if Is_Overloaded (P) then
Get_First_Interp (P, Index, It);
@@ -6437,19 +6446,18 @@ package body Sem_Attr is
Resolve (P);
end if;
+ Error_Msg_Name_1 := Aname;
+
if not Is_Entity_Name (P) then
null;
elsif Is_Abstract (Entity (P))
and then Is_Overloadable (Entity (P))
then
- Error_Msg_Name_1 := Aname;
Error_Msg_N ("prefix of % attribute cannot be abstract", P);
Set_Etype (N, Any_Type);
elsif Convention (Entity (P)) = Convention_Intrinsic then
- Error_Msg_Name_1 := Aname;
-
if Ekind (Entity (P)) = E_Enumeration_Literal then
Error_Msg_N
("prefix of % attribute cannot be enumeration literal",
@@ -6460,6 +6468,10 @@ package body Sem_Attr is
end if;
Set_Etype (N, Any_Type);
+
+ elsif Is_Thread_Body (Entity (P)) then
+ Error_Msg_N
+ ("prefix of % attribute cannot be a thread body", P);
end if;
-- Assignments, return statements, components of aggregates,
diff --git a/gcc/ada/sem_cat.adb b/gcc/ada/sem_cat.adb
index bb33f4cf27f..3dac1e3aa02 100644
--- a/gcc/ada/sem_cat.adb
+++ b/gcc/ada/sem_cat.adb
@@ -761,7 +761,7 @@ package body Sem_Cat is
return;
end if;
- -- Process explicit with_clauses that are not limited.
+ -- Ada0Y (AI-50217): Process explicit with_clauses that are not limited
declare
Item : Node_Id;
diff --git a/gcc/ada/sem_ch10.adb b/gcc/ada/sem_ch10.adb
index 743e943ff7a..4fdf9a9a4ca 100644
--- a/gcc/ada/sem_ch10.adb
+++ b/gcc/ada/sem_ch10.adb
@@ -73,8 +73,11 @@ package body Sem_Ch10 is
-- Analyzes items in the context clause of compilation unit
procedure Build_Limited_Views (N : Node_Id);
- -- Build list of shadow entities for a package mentioned in a
- -- limited_with clause.
+ -- Build and decorate the list of shadow entities for a package mentioned
+ -- in a limited_with clause. If the package was not previously analyzed
+ -- then it also performs a basic decoration of the real entities; this
+ -- is required to do not pass non-decorated entities to the back-end.
+ -- Implements Ada0Y (AI-50217).
procedure Check_Body_Needed_For_SAL (Unit_Name : Entity_Id);
-- Check whether the source for the body of a compilation unit must
@@ -93,11 +96,12 @@ package body Sem_Ch10 is
-- and not in an inner frame.
procedure Expand_Limited_With_Clause (Nam : Node_Id; N : Node_Id);
- -- if a child unit appears in a limited_with clause, there are implicit
+ -- If a child unit appears in a limited_with clause, there are implicit
-- limited_with clauses on all parents that are not already visible
-- through a regular with clause. This procedure creates the implicit
-- limited with_clauses for the parents and loads the corresponding units.
-- The shadow entities are created when the inserted clause is analyzed.
+ -- Implements Ada0Y (AI-50217).
procedure Expand_With_Clause (Nam : Node_Id; N : Node_Id);
-- When a child unit appears in a context clause, the implicit withs on
@@ -123,10 +127,13 @@ package body Sem_Ch10 is
-- Subsidiary to previous one. Process only with_ and use_clauses for
-- current unit and its library unit if any.
+ procedure Install_Limited_Context_Clauses (N : Node_Id);
+ -- Subsidiary to Install_Context. Process only limited with_clauses
+ -- for current unit. Implements Ada0Y (AI-50217).
+
procedure Install_Limited_Withed_Unit (N : Node_Id);
-- Place shadow entities for a limited_with package in the visibility
- -- structures for the current compilation. Verify that there is no
- -- regular with_clause in the context.
+ -- structures for the current compilation. Implements Ada0Y (AI-50217).
procedure Install_Withed_Unit (With_Clause : Node_Id);
-- If the unit is not a child unit, make unit immediately visible.
@@ -169,7 +176,7 @@ package body Sem_Ch10 is
procedure Remove_Limited_With_Clause (N : Node_Id);
-- Remove from visibility the shadow entities introduced for a package
- -- mentioned in a limited_with clause.
+ -- mentioned in a limited_with clause. Implements Ada0Y (AI-50217).
procedure Remove_Parents (Lib_Unit : Node_Id);
-- Remove_Parents checks if Lib_Unit is a child spec. If so then the parent
@@ -606,6 +613,9 @@ package body Sem_Ch10 is
begin
Item := First (Context_Items (N));
while Present (Item) loop
+
+ -- Ada0Y (AI-50217): Do not consider limited-withed units
+
if Nkind (Item) = N_With_Clause
and then not Implicit_With (Item)
and then not Limited_Present (Item)
@@ -782,9 +792,9 @@ package body Sem_Ch10 is
begin
-- Loop through context items. This is done is three passes:
-- a) The first pass analyze non-limited with-clauses.
- -- b) The second pass add implicit limited_with clauses for the
- -- the parents of child units.
- -- c) The third pass analyzes limited_with clauses.
+ -- b) The second pass add implicit limited_with clauses for
+ -- the parents of child units (Ada0Y: AI-50217)
+ -- c) The third pass analyzes limited_with clauses (Ada0Y: AI-50217)
Item := First (Context_Items (N));
while Present (Item) loop
@@ -792,7 +802,9 @@ package body Sem_Ch10 is
-- For with clause, analyze the with clause, and then update
-- the version, since we are dependent on a unit that we with.
- if Nkind (Item) = N_With_Clause then
+ if Nkind (Item) = N_With_Clause
+ and then not Limited_Present (Item)
+ then
-- Skip analyzing with clause if no unit, nothing to do (this
-- happens for a with that references a non-existant unit)
@@ -845,6 +857,11 @@ package body Sem_Ch10 is
and then Limited_Present (Item)
then
+ if Nkind (Unit (N)) /= N_Package_Declaration then
+ Error_Msg_N ("limited with_clause only allowed in"
+ & " package specification", Item);
+ end if;
+
-- Skip analyzing with clause if no unit, see above.
if Present (Library_Unit (Item)) then
@@ -1239,6 +1256,7 @@ package body Sem_Ch10 is
Num_Scopes : Int := 0;
Use_Clauses : array (1 .. Scope_Stack.Last) of Node_Id;
Enclosing_Child : Entity_Id := Empty;
+ Svg : constant Suppress_Array := Scope_Suppress;
procedure Analyze_Subunit_Context;
-- Capture names in use clauses of the subunit. This must be done
@@ -1482,6 +1500,10 @@ package body Sem_Ch10 is
Re_Install_Use_Clauses;
Install_Context (N);
+ -- Restore state of suppress flags for current body.
+
+ Scope_Suppress := Svg;
+
-- If the subunit is within a child unit, then siblings of any
-- parent unit that appear in the context clause of the subunit
-- must also be made immediately visible.
@@ -1573,8 +1595,8 @@ package body Sem_Ch10 is
begin
if Limited_Present (N) then
-
- -- Build visibility structures but do not analyze unit
+ -- Ada0Y (AI-50217): Build visibility structures but do not
+ -- analyze unit
Build_Limited_Views (N);
return;
@@ -1732,7 +1754,14 @@ package body Sem_Ch10 is
Generate_Reference (Par_Name, Pref);
Pref := Prefix (Pref);
- Par_Name := Scope (Par_Name);
+
+ -- If E_Name is the dummy entity for a nonexistent unit,
+ -- its scope is set to Standard_Standard, and no attempt
+ -- should be made to further unwind scopes.
+
+ if Par_Name /= Standard_Standard then
+ Par_Name := Scope (Par_Name);
+ end if;
end loop;
if Present (Entity (Pref))
@@ -2534,6 +2563,8 @@ package body Sem_Ch10 is
Install_Parents (Lib_Unit, Private_Present (Parent (Lib_Unit)));
end if;
+ Install_Limited_Context_Clauses (N);
+
Check_With_Type_Clauses (N);
end Install_Context;
@@ -2548,7 +2579,6 @@ package body Sem_Ch10 is
Check_Private : Boolean := False;
Decl_Node : Node_Id;
Lib_Parent : Entity_Id;
- Lim_Present : Boolean := False;
begin
-- Loop through context clauses to find the with/use clauses.
@@ -2565,9 +2595,8 @@ package body Sem_Ch10 is
then
if Limited_Present (Item) then
- -- Second pass will be necessary
+ -- Limited withed units will be installed later.
- Lim_Present := True;
goto Continue;
-- If Name (Item) is not an entity name, something is wrong, and
@@ -2703,7 +2732,7 @@ package body Sem_Ch10 is
if Is_Child_Spec (Lib_Unit) then
- -- The unit also has implicit withs on its own parents.
+ -- The unit also has implicit withs on its own parents
if No (Context_Items (N)) then
Set_Context_Items (N, New_List);
@@ -2778,23 +2807,224 @@ package body Sem_Ch10 is
if Check_Private then
Check_Private_Child_Unit (N);
end if;
+ end Install_Context_Clauses;
- -- Second pass: install limited_with clauses
+ -------------------------------------
+ -- Install_Limited_Context_Clauses --
+ -------------------------------------
- if Lim_Present then
- Item := First (Context_Items (N));
+ procedure Install_Limited_Context_Clauses (N : Node_Id) is
+ Item : Node_Id;
+
+ procedure Check_Parent (P : Node_Id; W : Node_Id);
+ -- Check that the unlimited view of a given compilation_unit is not
+ -- already visible in the parents (neither immediately through the
+ -- context clauses, nor indirectly through "use + renamings").
+
+ procedure Check_Private_Limited_Withed_Unit (N : Node_Id);
+ -- Check that if a limited_with clause of a given compilation_unit
+ -- mentions a private child of some library unit, then the given
+ -- compilation_unit shall be the declaration of a private descendant
+ -- of that library unit.
+
+ procedure Check_Withed_Unit (W : Node_Id);
+ -- Check that a limited with_clause does not appear in the same
+ -- context_clause as a nonlimited with_clause that mentions
+ -- the same library.
+
+ --------------------
+ -- Check_Parent --
+ --------------------
+
+ procedure Check_Parent (P : Node_Id; W : Node_Id) is
+ Item : Node_Id;
+ Spec : Node_Id;
+ WEnt : Entity_Id;
+ Nam : Node_Id;
+ E : Entity_Id;
+ E2 : Entity_Id;
+ begin
+ pragma Assert (Nkind (W) = N_With_Clause);
+
+ -- Step 1: Check if the unlimited view is installed in the parent
+
+ Item := First (Context_Items (P));
while Present (Item) loop
if Nkind (Item) = N_With_Clause
- and then Limited_Present (Item)
+ and then not Limited_Present (Item)
+ and then not Implicit_With (Item)
+ and then Library_Unit (Item) = Library_Unit (W)
then
- Install_Limited_Withed_Unit (Item);
+ Error_Msg_N ("unlimited view visible in ancestor", W);
+ return;
end if;
Next (Item);
end loop;
- end if;
- end Install_Context_Clauses;
+
+ -- Step 2: Check "use + renamings"
+
+ WEnt := Defining_Unit_Name (Specification (Unit (Library_Unit (W))));
+ Spec := Specification (Unit (P));
+
+ -- We tried to traverse the list of entities corresponding to the
+ -- defining entity of the package spec. However, first_entity was
+ -- found to be 'empty'. Don't know why???
+
+ -- Def := Defining_Unit_Name (Spec);
+ -- Ent := First_Entity (Def);
+
+ -- As a workaround we traverse the list of visible declarations ???
+
+ Item := First (Visible_Declarations (Spec));
+ while Present (Item) loop
+
+ if Nkind (Item) = N_Use_Package_Clause then
+
+ -- Traverse the list of packages
+
+ Nam := First (Names (Item));
+
+ while Present (Nam) loop
+ E := Entity (Nam);
+
+ pragma Assert (Present (Parent (E)));
+
+ if Nkind (Parent (E))
+ = N_Package_Renaming_Declaration
+ and then Renamed_Entity (E) = WEnt
+ then
+ Error_Msg_N ("unlimited view visible through "
+ & "use_clause + renamings", W);
+ return;
+
+ elsif Nkind (Parent (E)) = N_Package_Specification then
+
+ -- The use clause may refer to a local package.
+ -- Check all the enclosing scopes.
+
+ E2 := E;
+ while E2 /= Standard_Standard
+ and then E2 /= WEnt loop
+ E2 := Scope (E2);
+ end loop;
+
+ if E2 = WEnt then
+ Error_Msg_N ("unlimited view visible through "
+ & "use_clause ", W);
+ return;
+ end if;
+
+ end if;
+ Next (Nam);
+ end loop;
+
+ end if;
+
+ Next (Item);
+ end loop;
+
+ -- Recursive call to check all the ancestors
+
+ if Is_Child_Spec (Unit (P)) then
+ Check_Parent (P => Parent_Spec (Unit (P)), W => W);
+ end if;
+ end Check_Parent;
+
+ ---------------------------------------
+ -- Check_Private_Limited_Withed_Unit --
+ ---------------------------------------
+
+ procedure Check_Private_Limited_Withed_Unit (N : Node_Id) is
+ C : Node_Id;
+ P : Node_Id;
+ Found : Boolean := False;
+
+ begin
+ -- If the current compilation unit is not private we don't
+ -- need to check anything else.
+
+ if not Private_Present (Parent (N)) then
+ Found := False;
+
+ else
+ -- Compilation unit of the parent of the withed library unit
+
+ P := Parent_Spec (Unit (Library_Unit (N)));
+
+ -- Traverse all the ancestors of the current compilation
+ -- unit to check if it is a descendant of named library unit.
+
+ C := Parent (N);
+ while Present (Parent_Spec (Unit (C))) loop
+ C := Parent_Spec (Unit (C));
+
+ if C = P then
+ Found := True;
+ exit;
+ end if;
+ end loop;
+ end if;
+
+ if not Found then
+ Error_Msg_N ("current unit is not a private descendant"
+ & " of the withed unit ('R'M 10.1.2(8)", N);
+ end if;
+ end Check_Private_Limited_Withed_Unit;
+
+ -----------------------
+ -- Check_Withed_Unit --
+ -----------------------
+
+ procedure Check_Withed_Unit (W : Node_Id) is
+ Item : Node_Id;
+
+ begin
+ -- A limited with_clause can not appear in the same context_clause
+ -- as a nonlimited with_clause which mentions the same library.
+
+ Item := First (Context_Items (N));
+ while Present (Item) loop
+ if Nkind (Item) = N_With_Clause
+ and then not Limited_Present (Item)
+ and then not Implicit_With (Item)
+ and then Library_Unit (Item) = Library_Unit (W)
+ then
+ Error_Msg_N ("limited and unlimited view "
+ & "not allowed in the same context clauses", W);
+ return;
+ end if;
+
+ Next (Item);
+ end loop;
+ end Check_Withed_Unit;
+
+ -- Start of processing for Install_Limited_Context_Clauses
+
+ begin
+ Item := First (Context_Items (N));
+ while Present (Item) loop
+ if Nkind (Item) = N_With_Clause
+ and then Limited_Present (Item)
+ then
+
+ Check_Withed_Unit (Item);
+
+ if Private_Present (Library_Unit (Item)) then
+ Check_Private_Limited_Withed_Unit (Item);
+ end if;
+
+ if Is_Child_Spec (Unit (N)) then
+ Check_Parent (Parent_Spec (Unit (N)), Item);
+ end if;
+
+ Install_Limited_Withed_Unit (Item);
+ end if;
+
+ Next (Item);
+ end loop;
+ end Install_Limited_Context_Clauses;
---------------------
-- Install_Parents --
@@ -2917,6 +3147,10 @@ package body Sem_Ch10 is
-- the current unit.
-- Shouldn't this be somewhere more general ???
+ -----------------
+ -- Is_Ancestor --
+ -----------------
+
function Is_Ancestor (E : Entity_Id) return Boolean is
Par : Entity_Id;
@@ -3011,8 +3245,7 @@ package body Sem_Ch10 is
Unum : Unit_Number_Type :=
Get_Source_Unit (Library_Unit (N));
P_Unit : Entity_Id := Unit (Library_Unit (N));
- P : Entity_Id :=
- Defining_Unit_Name (Specification (P_Unit));
+ P : Entity_Id;
Lim_Elmt : Elmt_Id;
Lim_Typ : Entity_Id;
Is_Child_Package : Boolean := False;
@@ -3039,6 +3272,33 @@ package body Sem_Ch10 is
-- Start of processing for Install_Limited_Withed_Unit
begin
+ -- In case of limited with_clause on subprograms, generics, instances,
+ -- or generic renamings, the corresponding error was previously posted
+ -- and we have nothing to do here.
+
+ case Nkind (P_Unit) is
+
+ when N_Package_Declaration =>
+ null;
+
+ when N_Subprogram_Declaration |
+ N_Generic_Package_Declaration |
+ N_Generic_Subprogram_Declaration |
+ N_Package_Instantiation |
+ N_Function_Instantiation |
+ N_Procedure_Instantiation |
+ N_Generic_Package_Renaming_Declaration |
+ N_Generic_Procedure_Renaming_Declaration |
+ N_Generic_Function_Renaming_Declaration =>
+ return;
+
+ when others =>
+ pragma Assert (False);
+ null;
+ end case;
+
+ P := Defining_Unit_Name (Specification (P_Unit));
+
if Nkind (P) = N_Defining_Program_Unit_Name then
-- Retrieve entity of child package
@@ -3047,16 +3307,37 @@ package body Sem_Ch10 is
P := Defining_Identifier (P);
end if;
+ -- A common usage of the limited-with is to have a limited-with
+ -- in the package spec, and a normal with in its package body.
+ -- For example:
+
+ -- limited with X; -- [1]
+ -- package A is ...
+
+ -- with X; -- [2]
+ -- package body A is ...
+
+ -- The compilation of A's body installs the entities of its
+ -- withed packages (the context clauses found at [2]) and
+ -- then the context clauses of its specification (found at [1]).
+
+ -- As a consequence, at point [1] the specification of X has been
+ -- analyzed and it is immediately visible. According to the semantics
+ -- of the limited-with context clauses we don't install the limited
+ -- view because the full view of X supersedes its limited view.
+
if Analyzed (Cunit (Unum))
and then Is_Immediately_Visible (P)
then
- -- disallow naming in a limited with clause a unit (or renaming
- -- thereof) that is mentioned in an enclosing normal with clause.
- Error_Msg_N ("limited_with not allowed on unit already withed", N);
-
return;
end if;
+ if Debug_Flag_I then
+ Write_Str ("install limited view of ");
+ Write_Name (Chars (P));
+ Write_Eol;
+ end if;
+
if not Analyzed (Cunit (Unum)) then
Set_Ekind (P, E_Package);
Set_Etype (P, Standard_Void_Type);
@@ -3067,6 +3348,13 @@ package body Sem_Ch10 is
if Current_Entity (P) /= P then
Set_Homonym (P, Current_Entity (P));
Set_Current_Entity (P);
+
+ if Debug_Flag_I then
+ Write_Str (" (homonym) chain ");
+ Write_Name (Chars (P));
+ Write_Eol;
+ end if;
+
end if;
if Is_Child_Package then
@@ -3084,7 +3372,9 @@ package body Sem_Ch10 is
Set_Scope (P, Parent_Id);
end;
end if;
+
else
+
-- If the unit appears in a previous regular with_clause, the
-- regular entities must be unchained before the shadow ones
-- are made accessible.
@@ -3099,6 +3389,7 @@ package body Sem_Ch10 is
Next_Entity (Ent);
end loop;
end;
+
end if;
-- The package must be visible while the with_type clause is active,
@@ -3116,6 +3407,13 @@ package body Sem_Ch10 is
if not In_Chain (Lim_Typ) then
Set_Homonym (Lim_Typ, Current_Entity (Lim_Typ));
Set_Current_Entity (Lim_Typ);
+
+ if Debug_Flag_I then
+ Write_Str (" (homonym) chain ");
+ Write_Name (Chars (Lim_Typ));
+ Write_Eol;
+ end if;
+
end if;
Next_Elmt (Lim_Elmt);
@@ -3125,6 +3423,7 @@ package body Sem_Ch10 is
-- accordingly, to uninstall it when the context is removed.
Set_Limited_View_Installed (N);
+ Set_From_With_Type (P);
end Install_Limited_Withed_Unit;
-------------------------
@@ -3136,6 +3435,13 @@ package body Sem_Ch10 is
P : constant Entity_Id := Scope (Uname);
begin
+
+ if Debug_Flag_I then
+ Write_Str ("install withed unit ");
+ Write_Name (Chars (Uname));
+ Write_Eol;
+ end if;
+
-- We do not apply the restrictions to an internal unit unless
-- we are compiling the internal unit as a main unit. This check
-- is also skipped for dummy units (for missing packages).
@@ -3308,6 +3614,13 @@ package body Sem_Ch10 is
-- Construct list of shadow entities and attach it to entity of
-- package that is mentioned in a limited_with clause.
+ function New_Internal_Shadow_Entity
+ (Kind : Entity_Kind;
+ Sloc_Value : Source_Ptr;
+ Id_Char : Character) return Entity_Id;
+ -- This function is similar to New_Internal_Entity, except that the
+ -- entity is not added to the scope's list of entities.
+
------------------------------
-- Decorate_Incomplete_Type --
------------------------------
@@ -3324,7 +3637,6 @@ package body Sem_Ch10 is
Set_Stored_Constraint (E, No_Elist);
Set_Full_View (E, Empty);
Init_Size_Align (E);
- Set_Has_Unknown_Discriminants (E);
end Decorate_Incomplete_Type;
--------------------------
@@ -3374,22 +3686,54 @@ package body Sem_Ch10 is
Set_Etype (P, Standard_Void_Type);
end Decorate_Package_Specification;
+ -------------------------
+ -- New_Internal_Entity --
+ -------------------------
+
+ function New_Internal_Shadow_Entity
+ (Kind : Entity_Kind;
+ Sloc_Value : Source_Ptr;
+ Id_Char : Character) return Entity_Id
+ is
+ N : constant Entity_Id :=
+ Make_Defining_Identifier (Sloc_Value,
+ Chars => New_Internal_Name (Id_Char));
+
+ begin
+ Set_Ekind (N, Kind);
+ Set_Is_Internal (N, True);
+
+ if Kind in Type_Kind then
+ Init_Size_Align (N);
+ end if;
+
+ return N;
+ end New_Internal_Shadow_Entity;
+
-----------------
-- Build_Chain --
-----------------
+ -- Could use more comments below ???
+
procedure Build_Chain (Spec : Node_Id; Scope : Entity_Id) is
- Decl : Node_Id;
+ Decl : Node_Id;
+ Analyzed_Unit : Boolean := Analyzed (Cunit (Unum));
+ Is_Tagged : Boolean;
begin
Decl := First (Visible_Declarations (Spec));
while Present (Decl) loop
if Nkind (Decl) = N_Full_Type_Declaration then
+ Is_Tagged :=
+ Nkind (Type_Definition (Decl)) = N_Record_Definition
+ and then Tagged_Present (Type_Definition (Decl));
+
Comp_Typ := Defining_Identifier (Decl);
- if not Analyzed (Cunit (Unum)) then
- if Tagged_Present (Type_Definition (Decl)) then
+ if not Analyzed_Unit then
+ if Is_Tagged then
Decorate_Tagged_Type (Sloc (Decl), Comp_Typ, Scope);
else
Decorate_Incomplete_Type (Comp_Typ, Scope);
@@ -3398,9 +3742,8 @@ package body Sem_Ch10 is
-- Create shadow entity for type
- Lim_Typ := New_Internal_Entity
+ Lim_Typ := New_Internal_Shadow_Entity
(Kind => Ekind (Comp_Typ),
- Scope_Id => Scope,
Sloc_Value => Sloc (Comp_Typ),
Id_Char => 'Z');
@@ -3408,17 +3751,13 @@ package body Sem_Ch10 is
Set_Parent (Lim_Typ, Parent (Comp_Typ));
Set_From_With_Type (Lim_Typ);
- if Tagged_Present (Type_Definition (Decl)) then
+ if Is_Tagged then
Decorate_Tagged_Type (Sloc (Decl), Lim_Typ, Scope);
else
Decorate_Incomplete_Type (Lim_Typ, Scope);
end if;
Set_Non_Limited_View (Lim_Typ, Comp_Typ);
-
- -- Add each entity to the proper list
-
- Append_Elmt (Comp_Typ, To => Non_Limited_Views (P));
Append_Elmt (Lim_Typ, To => Limited_Views (P));
elsif Nkind (Decl) = N_Private_Type_Declaration
@@ -3426,13 +3765,12 @@ package body Sem_Ch10 is
then
Comp_Typ := Defining_Identifier (Decl);
- if not Analyzed (Cunit (Unum)) then
+ if not Analyzed_Unit then
Decorate_Tagged_Type (Sloc (Decl), Comp_Typ, Scope);
end if;
- Lim_Typ := New_Internal_Entity
+ Lim_Typ := New_Internal_Shadow_Entity
(Kind => Ekind (Comp_Typ),
- Scope_Id => Scope,
Sloc_Value => Sloc (Comp_Typ),
Id_Char => 'Z');
@@ -3443,10 +3781,6 @@ package body Sem_Ch10 is
Decorate_Tagged_Type (Sloc (Decl), Lim_Typ, Scope);
Set_Non_Limited_View (Lim_Typ, Comp_Typ);
-
- -- Add the entities to the proper list
-
- Append_Elmt (Comp_Typ, To => Non_Limited_Views (P));
Append_Elmt (Lim_Typ, To => Limited_Views (P));
elsif Nkind (Decl) = N_Package_Declaration then
@@ -3464,9 +3798,8 @@ package body Sem_Ch10 is
Set_Scope (Comp_Typ, Scope);
end if;
- Lim_Typ := New_Internal_Entity
+ Lim_Typ := New_Internal_Shadow_Entity
(Kind => Ekind (Comp_Typ),
- Scope_Id => Scope,
Sloc_Value => Sloc (Comp_Typ),
Id_Char => 'Z');
@@ -3480,8 +3813,6 @@ package body Sem_Ch10 is
-- Note: The non_limited_view attribute is not used
-- for local packages.
- -- Add the entities to the proper list.
- Append_Elmt (Comp_Typ, To => Non_Limited_Views (P));
Append_Elmt (Lim_Typ, To => Limited_Views (P));
Build_Chain (Spec, Scope => Lim_Typ);
@@ -3497,14 +3828,45 @@ package body Sem_Ch10 is
begin
pragma Assert (Limited_Present (N));
- -- Limited withed subprograms are not allowed. Therefore, we
- -- don't need to build the limited-view auxiliary chain.
+ -- A library_item mentioned in a limited_with_clause shall be
+ -- a package_declaration, not a subprogram_declaration,
+ -- generic_declaration, generic_instantiation, or
+ -- package_renaming_declaration
- if Nkind (Parent (P)) = N_Function_Specification
- or else Nkind (Parent (P)) = N_Procedure_Specification
- then
- return;
- end if;
+ case Nkind (Unit (Library_Unit (N))) is
+
+ when N_Package_Declaration =>
+ null;
+
+ when N_Subprogram_Declaration =>
+ Error_Msg_N ("subprograms not allowed in "
+ & "limited with_clauses", N);
+ return;
+
+ when N_Generic_Package_Declaration |
+ N_Generic_Subprogram_Declaration =>
+ Error_Msg_N ("generics not allowed in "
+ & "limited with_clauses", N);
+ return;
+
+ when N_Package_Instantiation |
+ N_Function_Instantiation |
+ N_Procedure_Instantiation =>
+ Error_Msg_N ("generic instantiations not allowed in "
+ & "limited with_clauses", N);
+ return;
+
+ when N_Generic_Package_Renaming_Declaration |
+ N_Generic_Procedure_Renaming_Declaration |
+ N_Generic_Function_Renaming_Declaration =>
+ Error_Msg_N ("generic renamings not allowed in "
+ & "limited with_clauses", N);
+ return;
+
+ when others =>
+ pragma Assert (False);
+ null;
+ end case;
-- Check if the chain is already built
@@ -3516,7 +3878,6 @@ package body Sem_Ch10 is
Set_Ekind (P, E_Package);
Set_Limited_Views (P, New_Elmt_List);
- Set_Non_Limited_Views (P, New_Elmt_List);
-- Set_Entity (Name (N), P);
-- Create the auxiliary chain
@@ -3650,11 +4011,33 @@ package body Sem_Ch10 is
Unit_Name : Entity_Id;
begin
+ -- Ada0Y (AI-50217): We remove the context clauses in two phases:
+ -- limited-views first and regular-views later (to maintain the
+ -- stack model).
- -- Loop through context items and undo with_clauses and use_clauses.
+ -- First Phase: Remove limited_with context clauses
Item := First (Context_Items (N));
+ while Present (Item) loop
+
+ -- We are interested only in with clauses which got installed
+ -- on entry.
+
+ if Nkind (Item) = N_With_Clause
+ and then Limited_Present (Item)
+ and then Limited_View_Installed (Item)
+ then
+ Remove_Limited_With_Clause (Item);
+
+ end if;
+
+ Next (Item);
+ end loop;
+ -- Second Phase: Loop through context items and undo regular
+ -- with_clauses and use_clauses.
+
+ Item := First (Context_Items (N));
while Present (Item) loop
-- We are interested only in with clauses which got installed
@@ -3664,7 +4047,7 @@ package body Sem_Ch10 is
and then Limited_Present (Item)
and then Limited_View_Installed (Item)
then
- Remove_Limited_With_Clause (Item);
+ null;
elsif Nkind (Item) = N_With_Clause
and then Context_Installed (Item)
@@ -3687,7 +4070,6 @@ package body Sem_Ch10 is
Next (Item);
end loop;
-
end Remove_Context_Clauses;
--------------------------------
@@ -3697,7 +4079,6 @@ package body Sem_Ch10 is
procedure Remove_Limited_With_Clause (N : Node_Id) is
P_Unit : Entity_Id := Unit (Library_Unit (N));
P : Entity_Id := Defining_Unit_Name (Specification (P_Unit));
-
Lim_Elmt : Elmt_Id;
Lim_Typ : Entity_Id;
@@ -3709,6 +4090,13 @@ package body Sem_Ch10 is
P := Defining_Identifier (P);
end if;
+ if Debug_Flag_I then
+ Write_Str ("remove limited view of ");
+ Write_Name (Chars (P));
+ Write_Str (" from visibility");
+ Write_Eol;
+ end if;
+
-- Remove all shadow entities from visibility
Lim_Elmt := First_Elmt (Limited_Views (P));
@@ -3720,6 +4108,11 @@ package body Sem_Ch10 is
Next_Elmt (Lim_Elmt);
end loop;
+ -- Indicate that the limited view of the package is not installed
+
+ Set_From_With_Type (P, False);
+ Set_Limited_View_Installed (N, False);
+
-- If the exporting package has previously been analyzed, it
-- has appeared in the closure already and should be left alone.
-- Otherwise, remove package itself from visibility.
@@ -3731,9 +4124,40 @@ package body Sem_Ch10 is
Set_Ekind (P, E_Void);
Set_Scope (P, Empty);
Set_Is_Immediately_Visible (P, False);
- end if;
- Set_Limited_View_Installed (N, False);
+ else
+
+ -- Reinstall visible entities (entities removed from visibility in
+ -- Install_Limited_Withed to install the shadow entities).
+
+ declare
+ Ent : Entity_Id;
+
+ begin
+ Ent := First_Entity (P);
+ while Present (Ent) and then Ent /= First_Private_Entity (P) loop
+
+ -- Shadow entities have not been added to the list of
+ -- entities associated to the package spec. Therefore we
+ -- just have to re-chain all its visible entities.
+
+ if not Is_Class_Wide_Type (Ent) then
+
+ Set_Homonym (Ent, Current_Entity (Ent));
+ Set_Current_Entity (Ent);
+
+ if Debug_Flag_I then
+ Write_Str (" (homonym) chain ");
+ Write_Name (Chars (Ent));
+ Write_Eol;
+ end if;
+
+ end if;
+
+ Next_Entity (Ent);
+ end loop;
+ end;
+ end if;
end Remove_Limited_With_Clause;
--------------------
@@ -3819,6 +4243,8 @@ package body Sem_Ch10 is
end if;
end Unchain;
+ -- Start of Remove_With_Type_Clause
+
begin
if Nkind (Name) = N_Selected_Component then
Typ := Entity (Selector_Name (Name));
@@ -3882,8 +4308,9 @@ package body Sem_Ch10 is
begin
if Debug_Flag_I then
- Write_Str ("remove withed unit ");
+ Write_Str ("remove unit ");
Write_Name (Chars (Unit_Name));
+ Write_Str (" from visibility");
Write_Eol;
end if;
@@ -3923,5 +4350,12 @@ package body Sem_Ch10 is
Set_Homonym (Prev, Homonym (E));
end if;
end if;
+
+ if Debug_Flag_I then
+ Write_Str (" (homonym) unchain ");
+ Write_Name (Chars (E));
+ Write_Eol;
+ end if;
+
end Unchain;
end Sem_Ch10;
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 60dbbe595c3..1676ee85491 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -543,22 +543,22 @@ package body Sem_Ch12 is
-- those nodes that contain global information. At instantiation, the
-- information from the associated node is placed on the new copy, so
-- that name resolution is not repeated.
-
+ --
-- Three kinds of source nodes have associated nodes:
-
+ --
-- a) those that can reference (denote) entities, that is identifiers,
-- character literals, expanded_names, operator symbols, operators,
-- and attribute reference nodes. These nodes have an Entity field
-- and are the set of nodes that are in N_Has_Entity.
-
+ --
-- b) aggregates (N_Aggregate and N_Extension_Aggregate)
-
+ --
-- c) selected components (N_Selected_Component)
-
+ --
-- For the first class, the associated node preserves the entity if it is
- -- global. If the generic contains nested instantiations, the associated_
+ -- global. If the generic contains nested instantiations, the associated
-- node itself has been recopied, and a chain of them must be followed.
-
+ --
-- For aggregates, the associated node allows retrieval of the type, which
-- may otherwise not appear in the generic. The view of this type may be
-- different between generic and instantiation, and the full view can be
@@ -566,14 +566,14 @@ package body Sem_Ch12 is
-- type extensions, the same view exchange may have to be performed for
-- some of the ancestor types, if their view is private at the point of
-- instantiation.
-
+ --
-- Nodes that are selected components in the parse tree may be rewritten
-- as expanded names after resolution, and must be treated as potential
-- entity holders. which is why they also have an Associated_Node.
-
+ --
-- Nodes that do not come from source, such as freeze nodes, do not appear
-- in the generic tree, and need not have an associated node.
-
+ --
-- The associated node is stored in the Associated_Node field. Note that
-- this field overlaps Entity, which is fine, because the whole point is
-- that we don't need or want the normal Entity field in this situation.
@@ -757,9 +757,11 @@ package body Sem_Ch12 is
F_Copy : List_Id)
return List_Id
is
- Actual_Types : constant Elist_Id := New_Elmt_List;
- Assoc : constant List_Id := New_List;
- Defaults : constant Elist_Id := New_Elmt_List;
+ Actual_Types : constant Elist_Id := New_Elmt_List;
+ Assoc : constant List_Id := New_List;
+ Defaults : constant Elist_Id := New_Elmt_List;
+ Gen_Unit : constant Entity_Id := Defining_Entity
+ (Parent (F_Copy));
Actuals : List_Id;
Actual : Node_Id;
Formal : Node_Id;
@@ -985,8 +987,12 @@ package body Sem_Ch12 is
Defining_Identifier (Analyzed_Formal));
if No (Match) then
- Error_Msg_NE ("missing actual for instantiation of &",
- Instantiation_Node, Defining_Identifier (Formal));
+ Error_Msg_Sloc := Sloc (Gen_Unit);
+ Error_Msg_NE
+ ("missing actual&",
+ Instantiation_Node, Defining_Identifier (Formal));
+ Error_Msg_NE ("\in instantiation of & declared#",
+ Instantiation_Node, Gen_Unit);
Abandon_Instantiation (Instantiation_Node);
else
@@ -1070,10 +1076,12 @@ package body Sem_Ch12 is
Defining_Identifier (Original_Node (Analyzed_Formal)));
if No (Match) then
+ Error_Msg_Sloc := Sloc (Gen_Unit);
Error_Msg_NE
- ("missing actual for instantiation of&",
- Instantiation_Node,
- Defining_Identifier (Formal));
+ ("missing actual&",
+ Instantiation_Node, Defining_Identifier (Formal));
+ Error_Msg_NE ("\in instantiation of & declared#",
+ Instantiation_Node, Gen_Unit);
Abandon_Instantiation (Instantiation_Node);
@@ -1105,8 +1113,19 @@ package body Sem_Ch12 is
end loop;
if Num_Actuals > Num_Matched then
- Error_Msg_N
- ("unmatched actuals in instantiation", Instantiation_Node);
+ Error_Msg_Sloc := Sloc (Gen_Unit);
+
+ if Present (Selector_Name (Actual)) then
+ Error_Msg_NE
+ ("unmatched actual&",
+ Actual, Selector_Name (Actual));
+ Error_Msg_NE ("\in instantiation of& declared#",
+ Actual, Gen_Unit);
+ else
+ Error_Msg_NE
+ ("unmatched actual in instantiation of& declared#",
+ Actual, Gen_Unit);
+ end if;
end if;
elsif Present (Actuals) then
@@ -1447,7 +1466,10 @@ package body Sem_Ch12 is
end if;
if K = E_Generic_In_Parameter then
- if Is_Limited_Type (T) then
+
+ -- Ada0Y (AI-287): Limited aggregates allowed in generic formals
+
+ if not Extensions_Allowed and then Is_Limited_Type (T) then
Error_Msg_N
("generic formal of mode IN must not be of limited type", N);
Explain_Limited_Type (T, N);
@@ -2332,8 +2354,17 @@ package body Sem_Ch12 is
return;
elsif Ekind (Gen_Unit) /= E_Generic_Package then
- Error_Msg_N
- ("expect name of generic package in instantiation", Gen_Id);
+
+ -- Ada0Y (AI-50217): Instance can not be used in limited with_clause
+
+ if From_With_Type (Gen_Unit) then
+ Error_Msg_N
+ ("cannot instantiate a limited withed package", Gen_Id);
+ else
+ Error_Msg_N
+ ("expect name of generic package in instantiation", Gen_Id);
+ end if;
+
Restore_Env;
return;
end if;
@@ -2887,7 +2918,7 @@ package body Sem_Ch12 is
-- Remove entities in current scopes from visibility, so
-- than instance body is compiled in a clean environment.
- Save_Scope_Stack;
+ Save_Scope_Stack (Handle_Use => False);
if Is_Child_Unit (S) then
@@ -2951,7 +2982,7 @@ package body Sem_Ch12 is
end loop;
end if;
- Restore_Scope_Stack;
+ Restore_Scope_Stack (Handle_Use => False);
end if;
-- Restore use clauses. For a child unit, use clauses in the
@@ -4634,19 +4665,37 @@ package body Sem_Ch12 is
else
-- If the associated node is still defined, the entity in
-- it is global, and must be copied to the instance.
+ -- If this copy is being made for a body to inline, it is
+ -- applied to an instantiated tree, and the entity is already
+ -- present and must be also preserved.
- if Present (Get_Associated_Node (N)) then
- if Nkind (Get_Associated_Node (N)) = Nkind (N) then
- Set_Entity (New_N, Entity (Get_Associated_Node (N)));
- Check_Private_View (N);
+ declare
+ Assoc : constant Node_Id := Get_Associated_Node (N);
+ begin
+ if Present (Assoc) then
+ if Nkind (Assoc) = Nkind (N) then
+ Set_Entity (New_N, Entity (Assoc));
+ Check_Private_View (N);
+
+ elsif Nkind (Assoc) = N_Function_Call then
+ Set_Entity (New_N, Entity (Name (Assoc)));
+
+ elsif (Nkind (Assoc) = N_Defining_Identifier
+ or else Nkind (Assoc) = N_Defining_Character_Literal
+ or else Nkind (Assoc) = N_Defining_Operator_Symbol)
+ and then Expander_Active
+ then
+ -- Inlining case: we are copying a tree that contains
+ -- global entities, which are preserved in the copy
+ -- to be used for subsequent inlining.
- elsif Nkind (Get_Associated_Node (N)) = N_Function_Call then
- Set_Entity (New_N, Entity (Name (Get_Associated_Node (N))));
+ null;
- else
- Set_Entity (New_N, Empty);
+ else
+ Set_Entity (New_N, Empty);
+ end if;
end if;
- end if;
+ end;
end if;
-- For expanded name, we must copy the Prefix and Selector_Name
@@ -5611,6 +5660,8 @@ package body Sem_Ch12 is
Generic_Flags.Init;
Generic_Renamings_HTable.Reset;
Circularity_Detected := False;
+ Exchanged_Views := No_Elist;
+ Hidden_Entities := No_Elist;
end Initialize;
----------------------------
@@ -6578,9 +6629,12 @@ package body Sem_Ch12 is
end if;
else
+ Error_Msg_Sloc := Sloc (Scope (Analyzed_S));
+ Error_Msg_NE
+ ("missing actual&", Instantiation_Node, Formal_Sub);
Error_Msg_NE
- ("missing actual for instantiation of &",
- Instantiation_Node, Formal_Sub);
+ ("\in instantiation of & declared#",
+ Instantiation_Node, Scope (Analyzed_S));
Abandon_Instantiation (Instantiation_Node);
end if;
@@ -6702,6 +6756,9 @@ package body Sem_Ch12 is
Subt_Decl : Node_Id := Empty;
begin
+ -- Sloc for error message on missing actual.
+ Error_Msg_Sloc := Sloc (Scope (Defining_Identifier (Analyzed_Formal)));
+
if Get_Instance_Of (Formal_Id) /= Formal_Id then
Error_Msg_N ("duplicate instantiation of generic parameter", Actual);
end if;
@@ -6722,8 +6779,12 @@ package body Sem_Ch12 is
if No (Actual) then
Error_Msg_NE
- ("missing actual for instantiation of &",
+ ("missing actual&",
Instantiation_Node, Formal_Id);
+ Error_Msg_NE
+ ("\in instantiation of & declared#",
+ Instantiation_Node,
+ Scope (Defining_Identifier (Analyzed_Formal)));
Abandon_Instantiation (Instantiation_Node);
end if;
@@ -6886,8 +6947,11 @@ package body Sem_Ch12 is
else
Error_Msg_NE
- ("missing actual for instantiation of &",
- Instantiation_Node, Formal_Id);
+ ("missing actual&",
+ Instantiation_Node, Formal_Id);
+ Error_Msg_NE ("\in instantiation of & declared#",
+ Instantiation_Node,
+ Scope (Defining_Identifier (Analyzed_Formal)));
if Is_Scalar_Type
(Etype (Defining_Identifier (Analyzed_Formal)))
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 83b209570ed..ca7ca0fb6c8 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -1881,7 +1881,7 @@ package body Sem_Ch13 is
Biased : Boolean;
Max_Bit_So_Far : Uint;
- -- Records the maximum bit position so far. If all field positoins
+ -- Records the maximum bit position so far. If all field positions
-- are monotonically increasing, then we can skip the circuit for
-- checking for overlap, since no overlap is possible.
@@ -2153,33 +2153,9 @@ package body Sem_Ch13 is
CC, Rectype);
end if;
- -- Test for large object that is not on a storage unit
- -- boundary, defined as a large packed array not
- -- represented by a modular type, or an object for
- -- which a size of greater than 64 bits is specified.
-
- if Fbit mod SSU /= 0 then
- if (Is_Packed_Array_Type (Etype (Comp))
- and then Is_Array_Type
- (Packed_Array_Type (Etype (Comp))))
- or else Esize (Etype (Comp)) > Max_Unaligned_Field
- then
- if SSU = 8 then
- Error_Msg_N
- ("large component must be on byte boundary",
- First_Bit (CC));
- else
- Error_Msg_N
- ("large component must be on word boundary",
- First_Bit (CC));
- end if;
- end if;
- end if;
-
- -- This information is also set in the
- -- corresponding component of the base type,
- -- found by accessing the Original_Record_Component
- -- link if it is present.
+ -- This information is also set in the corresponding
+ -- component of the base type, found by accessing the
+ -- Original_Record_Component link if it is present.
Ocomp := Original_Record_Component (Comp);
@@ -2602,6 +2578,9 @@ package body Sem_Ch13 is
--------------------------
procedure Check_Expr_Constants (Nod : Node_Id) is
+ Loc_U_Ent : constant Source_Ptr := Sloc (U_Ent);
+ Ent : Entity_Id := Empty;
+
begin
if Nkind (Nod) in N_Has_Etype
and then Etype (Nod) = Any_Type
@@ -2614,6 +2593,7 @@ package body Sem_Ch13 is
return;
when N_Identifier | N_Expanded_Name =>
+ Ent := Entity (Nod);
-- We need to look at the original node if it is different
-- from the node, since we may have rewritten things and
@@ -2627,85 +2607,92 @@ package body Sem_Ch13 is
-- is not constant, even if the constituents might be
-- acceptable, as in A'Address + offset.
- if Ekind (Entity (Nod)) = E_Variable
- and then Nkind (Declaration_Node (Entity (Nod)))
+ if Ekind (Ent) = E_Variable
+ and then Nkind (Declaration_Node (Ent))
= N_Object_Declaration
and then
- No (Expression (Declaration_Node (Entity (Nod))))
+ No (Expression (Declaration_Node (Ent)))
+ then
+ Error_Msg_NE
+ ("invalid address clause for initialized object &!",
+ Nod, U_Ent);
+
+ -- If entity is constant, it may be the result of expanding
+ -- a check. We must verify that its declaration appears
+ -- before the object in question, else we also reject the
+ -- address clause.
+
+ elsif Ekind (Ent) = E_Constant
+ and then In_Same_Source_Unit (Ent, U_Ent)
+ and then Sloc (Ent) > Loc_U_Ent
then
Error_Msg_NE
("invalid address clause for initialized object &!",
Nod, U_Ent);
end if;
+
return;
end if;
-- Otherwise look at the identifier and see if it is OK.
- declare
- Ent : constant Entity_Id := Entity (Nod);
- Loc_Ent : constant Source_Ptr := Sloc (Ent);
- Loc_U_Ent : constant Source_Ptr := Sloc (U_Ent);
-
- begin
- if Ekind (Ent) = E_Named_Integer
- or else
- Ekind (Ent) = E_Named_Real
- or else
- Is_Type (Ent)
- then
- return;
-
- elsif
- Ekind (Ent) = E_Constant
- or else
- Ekind (Ent) = E_In_Parameter
- then
- -- This is the case where we must have Ent defined
- -- before U_Ent. Clearly if they are in different
- -- units this requirement is met since the unit
- -- containing Ent is already processed.
-
- if not In_Same_Source_Unit (Ent, U_Ent) then
- return;
+ if Ekind (Ent) = E_Named_Integer
+ or else
+ Ekind (Ent) = E_Named_Real
+ or else
+ Is_Type (Ent)
+ then
+ return;
- -- Otherwise location of Ent must be before the
- -- location of U_Ent, that's what prior defined means.
+ elsif
+ Ekind (Ent) = E_Constant
+ or else
+ Ekind (Ent) = E_In_Parameter
+ then
+ -- This is the case where we must have Ent defined
+ -- before U_Ent. Clearly if they are in different
+ -- units this requirement is met since the unit
+ -- containing Ent is already processed.
- elsif Loc_Ent < Loc_U_Ent then
- return;
+ if not In_Same_Source_Unit (Ent, U_Ent) then
+ return;
- else
- Error_Msg_NE
- ("invalid address clause for initialized object &!",
- Nod, U_Ent);
- Error_Msg_Name_1 := Chars (Ent);
- Error_Msg_Name_2 := Chars (U_Ent);
- Error_Msg_N
- ("\% must be defined before % ('R'M 13.1(22))!",
- Nod);
- end if;
+ -- Otherwise location of Ent must be before the
+ -- location of U_Ent, that's what prior defined means.
- elsif Nkind (Original_Node (Nod)) = N_Function_Call then
- Check_Expr_Constants (Original_Node (Nod));
+ elsif Sloc (Ent) < Loc_U_Ent then
+ return;
else
Error_Msg_NE
("invalid address clause for initialized object &!",
Nod, U_Ent);
+ Error_Msg_Name_1 := Chars (Ent);
+ Error_Msg_Name_2 := Chars (U_Ent);
+ Error_Msg_N
+ ("\% must be defined before % ('R'M 13.1(22))!",
+ Nod);
+ end if;
- if Comes_From_Source (Ent) then
- Error_Msg_Name_1 := Chars (Ent);
- Error_Msg_N
- ("\reference to variable% not allowed"
- & " ('R'M 13.1(22))!", Nod);
- else
- Error_Msg_N
- ("non-static expression not allowed"
- & " ('R'M 13.1(22))!", Nod);
- end if;
+ elsif Nkind (Original_Node (Nod)) = N_Function_Call then
+ Check_Expr_Constants (Original_Node (Nod));
+
+ else
+ Error_Msg_NE
+ ("invalid address clause for initialized object &!",
+ Nod, U_Ent);
+
+ if Comes_From_Source (Ent) then
+ Error_Msg_Name_1 := Chars (Ent);
+ Error_Msg_N
+ ("\reference to variable% not allowed"
+ & " ('R'M 13.1(22))!", Nod);
+ else
+ Error_Msg_N
+ ("non-static expression not allowed"
+ & " ('R'M 13.1(22))!", Nod);
end if;
- end;
+ end if;
when N_Integer_Literal |
N_Real_Literal |
@@ -2860,21 +2847,70 @@ package body Sem_Ch13 is
begin
Biased := False;
- -- Immediate return if size is same as standard size or if composite
- -- item, or generic type, or type with previous errors.
+ -- Dismiss cases for generic types or types with previous errors
if No (UT)
or else UT = Any_Type
or else Is_Generic_Type (UT)
or else Is_Generic_Type (Root_Type (UT))
- or else Is_Composite_Type (UT)
- or else (Known_Esize (UT) and then Siz = Esize (UT))
then
return;
+ -- Check case of bit packed array
+
+ elsif Is_Array_Type (UT)
+ and then Known_Static_Component_Size (UT)
+ and then Is_Bit_Packed_Array (UT)
+ then
+ declare
+ Asiz : Uint;
+ Indx : Node_Id;
+ Ityp : Entity_Id;
+
+ begin
+ Asiz := Component_Size (UT);
+ Indx := First_Index (UT);
+ loop
+ Ityp := Etype (Indx);
+
+ -- If non-static bound, then we are not in the business of
+ -- trying to check the length, and indeed an error will be
+ -- issued elsewhere, since sizes of non-static array types
+ -- cannot be set implicitly or explicitly.
+
+ if not Is_Static_Subtype (Ityp) then
+ return;
+ end if;
+
+ -- Otherwise accumulate next dimension
+
+ Asiz := Asiz * (Expr_Value (Type_High_Bound (Ityp)) -
+ Expr_Value (Type_Low_Bound (Ityp)) +
+ Uint_1);
+
+ Next_Index (Indx);
+ exit when No (Indx);
+ end loop;
+
+ if Asiz <= Siz then
+ return;
+ else
+ Error_Msg_Uint_1 := Asiz;
+ Error_Msg_NE
+ ("size for& too small, minimum allowed is ^", N, T);
+ Set_Esize (T, Asiz);
+ Set_RM_Size (T, Asiz);
+ end if;
+ end;
+
+ -- All other composite types are ignored
+
+ elsif Is_Composite_Type (UT) then
+ return;
+
-- For fixed-point types, don't check minimum if type is not frozen,
- -- since type is not known till then
- -- at freeze time.
+ -- since we don't know all the characteristics of the type that can
+ -- affect the size (e.g. a specified small) till freeze time.
elsif Is_Fixed_Point_Type (UT)
and then not Is_Frozen (UT)
@@ -2884,6 +2920,14 @@ package body Sem_Ch13 is
-- Cases for which a minimum check is required
else
+ -- Ignore if specified size is correct for the type
+
+ if Known_Esize (UT) and then Siz = Esize (UT) then
+ return;
+ end if;
+
+ -- Otherwise get minimum size
+
M := UI_From_Int (Minimum_Size (UT));
if Siz < M then
@@ -2897,6 +2941,8 @@ package body Sem_Ch13 is
Error_Msg_Uint_1 := M;
Error_Msg_NE
("size for& too small, minimum allowed is ^", N, T);
+ Set_Esize (T, M);
+ Set_RM_Size (T, M);
else
Biased := True;
end if;
diff --git a/gcc/ada/sem_ch13.ads b/gcc/ada/sem_ch13.ads
index 2f520cd5e3a..3abdffb8073 100644
--- a/gcc/ada/sem_ch13.ads
+++ b/gcc/ada/sem_ch13.ads
@@ -79,14 +79,17 @@ package Sem_Ch13 is
Biased : out Boolean);
-- Called when size Siz is specified for subtype T. This subprogram checks
-- that the size is appropriate, posting errors on node N as required.
- -- For non-elementary types, a check is only made if an explicit size
- -- has been given for the type (and the specified size must match). The
- -- parameter Biased is set False if the size specified did not require
+ -- This check is effective for elementary types and bit-packed arrays.
+ -- For other non-elementary types, a check is only made if an explicit
+ -- size has been given for the type (and the specified size must match).
+ -- The parameter Biased is set False if the size specified did not require
-- the use of biased representation, and True if biased representation
-- was required to meet the size requirement. Note that Biased is only
-- set if the type is not currently biased, but biasing it is the only
-- way to meet the requirement. If the type is currently biased, then
-- this biased size is used in the initial check, and Biased is False.
+ -- If the size is too small, and an error message is given, then both
+ -- Esize and RM_Size are reset to the allowed minimum value in T.
procedure Record_Rep_Item (T : Entity_Id; N : Node_Id);
-- N is the node for either a representation pragma or an attribute
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 839081dbbfd..93593cfaee0 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -548,9 +548,9 @@ package body Sem_Ch3 is
-- Create new modular type. Verify that modulus is in bounds and is
-- a power of two (implementation restriction).
- procedure New_Binary_Operator (Op_Name : Name_Id; Typ : Entity_Id);
+ procedure New_Concatenation_Op (Typ : Entity_Id);
-- Create an abbreviated declaration for an operator in order to
- -- materialize minimally operators on derived types.
+ -- materialize concatenation on array types.
procedure Ordinary_Fixed_Point_Type_Declaration
(T : Entity_Id;
@@ -690,6 +690,10 @@ package body Sem_Ch3 is
-- if the designated type is.
Set_Is_Public (Anon_Type, Is_Public (Scope (Anon_Type)));
+
+ -- Ada0Y (AI-50217): Propagate the attribute that indicates that the
+ -- designated type comes from the limited view (for back-end purposes).
+
Set_From_With_Type (Anon_Type, From_With_Type (Desig_Type));
-- The context is either a subprogram declaration or an access
@@ -857,9 +861,9 @@ package body Sem_Ch3 is
-- access type is also imported, and therefore restricted in its use.
-- The access type may already be imported, so keep setting otherwise.
- -- If the non-limited view of the designated type is available, use
- -- it as the designated type of the access type, so that the back-end
- -- gets a usable entity.
+ -- Ada0Y (AI-50217): If the non-limited view of the designated type is
+ -- available, use it as the designated type of the access type, so that
+ -- the back-end gets a usable entity.
if From_With_Type (Desig) then
Set_From_With_Type (T);
@@ -2448,9 +2452,11 @@ package body Sem_Ch3 is
begin
Prev := Find_Type_Name (N);
- -- The full view, if present, now points to the current type. If the
- -- type was previously decorated when imported through a LIMITED WITH
- -- clause, it appears as incomplete but has no full view.
+ -- The full view, if present, now points to the current type
+
+ -- Ada0Y (AI-50217): If the type was previously decorated when imported
+ -- through a LIMITED WITH clause, it appears as incomplete but has no
+ -- full view.
if Ekind (Prev) = E_Incomplete_Type
and then Present (Full_View (Prev))
@@ -2859,7 +2865,7 @@ package body Sem_Ch3 is
if Number_Dimensions (T) = 1
and then not Is_Packed_Array_Type (T)
then
- New_Binary_Operator (Name_Op_Concat, T);
+ New_Concatenation_Op (T);
end if;
-- In the case of an unconstrained array the parser has already
@@ -3055,14 +3061,21 @@ package body Sem_Ch3 is
-- declared in a closed scope (e.g., a subprogram), then we
-- need to explicitly introduce the new type's concatenation
-- operator since Derive_Subprograms will not inherit the
- -- parent's operator.
+ -- parent's operator. If the parent type is unconstrained, the
+ -- operator is of the unconstrained base type.
if Number_Dimensions (Parent_Type) = 1
and then not Is_Limited_Type (Parent_Type)
and then not Is_Derived_Type (Parent_Type)
and then not Is_Package (Scope (Base_Type (Parent_Type)))
then
- New_Binary_Operator (Name_Op_Concat, Derived_Type);
+ if not Is_Constrained (Parent_Type)
+ and then Is_Constrained (Derived_Type)
+ then
+ New_Concatenation_Op (Implicit_Base);
+ else
+ New_Concatenation_Op (Derived_Type);
+ end if;
end if;
end Build_Derived_Array_Type;
@@ -6233,10 +6246,21 @@ package body Sem_Ch3 is
if (Is_Limited_Type (T)
or else Is_Limited_Composite (T))
and then not In_Instance
+ and then not In_Inlined_Body
then
- Error_Msg_N
- ("cannot initialize entities of limited type", Exp);
- Explain_Limited_Type (T, Exp);
+ -- Ada0Y (AI-287): Relax the strictness of the front-end in case of
+ -- limited aggregates and extension aggregates.
+
+ if Extensions_Allowed
+ and then (Nkind (Exp) = N_Aggregate
+ or else Nkind (Exp) = N_Extension_Aggregate)
+ then
+ null;
+ else
+ Error_Msg_N
+ ("cannot initialize entities of limited type", Exp);
+ Explain_Limited_Type (T, Exp);
+ end if;
end if;
end Check_Initialization;
@@ -7691,8 +7715,8 @@ package body Sem_Ch3 is
if not Error_Posted (S)
and then
(Nkind (S) /= N_Range
- or else Base_Type (T) /= Base_Type (Etype (Low_Bound (S)))
- or else Base_Type (T) /= Base_Type (Etype (High_Bound (S))))
+ or else not Covers (T, (Etype (Low_Bound (S))))
+ or else not Covers (T, (Etype (High_Bound (S)))))
then
if Base_Type (T) /= Any_Type
and then Etype (Low_Bound (S)) /= Any_Type
@@ -8415,18 +8439,6 @@ package body Sem_Ch3 is
Init_Size_Align (Implicit_Base);
- -- Complete entity for first subtype
-
- Set_Ekind (T, E_Decimal_Fixed_Point_Subtype);
- Set_Etype (T, Implicit_Base);
- Set_Size_Info (T, Implicit_Base);
- Set_First_Rep_Item (T, First_Rep_Item (Implicit_Base));
- Set_Digits_Value (T, Digs_Val);
- Set_Delta_Value (T, Delta_Val);
- Set_Small_Value (T, Delta_Val);
- Set_Scale_Value (T, Scale_Val);
- Set_Is_Constrained (T);
-
-- If there are bounds given in the declaration use them as the
-- bounds of the first named subtype.
@@ -8469,6 +8481,17 @@ package body Sem_Ch3 is
Set_Fixed_Range (T, Loc, -Bound_Val, Bound_Val);
end if;
+ -- Complete entity for first subtype
+
+ Set_Ekind (T, E_Decimal_Fixed_Point_Subtype);
+ Set_Etype (T, Implicit_Base);
+ Set_Size_Info (T, Implicit_Base);
+ Set_First_Rep_Item (T, First_Rep_Item (Implicit_Base));
+ Set_Digits_Value (T, Digs_Val);
+ Set_Delta_Value (T, Delta_Val);
+ Set_Small_Value (T, Delta_Val);
+ Set_Scale_Value (T, Scale_Val);
+ Set_Is_Constrained (T);
end Decimal_Fixed_Point_Type_Declaration;
-----------------------
@@ -10929,11 +10952,11 @@ package body Sem_Ch3 is
end Modular_Type_Declaration;
- -------------------------
- -- New_Binary_Operator --
- -------------------------
+ --------------------------
+ -- New_Concatenation_Op --
+ --------------------------
- procedure New_Binary_Operator (Op_Name : Name_Id; Typ : Entity_Id) is
+ procedure New_Concatenation_Op (Typ : Entity_Id) is
Loc : constant Source_Ptr := Sloc (Typ);
Op : Entity_Id;
@@ -10955,26 +10978,26 @@ package body Sem_Ch3 is
return Formal;
end Make_Op_Formal;
- -- Start of processing for New_Binary_Operator
+ -- Start of processing for New_Concatenation_Op
begin
- Op := Make_Defining_Operator_Symbol (Loc, Op_Name);
+ Op := Make_Defining_Operator_Symbol (Loc, Name_Op_Concat);
Set_Ekind (Op, E_Operator);
Set_Scope (Op, Current_Scope);
Set_Etype (Op, Typ);
- Set_Homonym (Op, Get_Name_Entity_Id (Op_Name));
+ Set_Homonym (Op, Get_Name_Entity_Id (Name_Op_Concat));
Set_Is_Immediately_Visible (Op);
Set_Is_Intrinsic_Subprogram (Op);
Set_Has_Completion (Op);
Append_Entity (Op, Current_Scope);
- Set_Name_Entity_Id (Op_Name, Op);
+ Set_Name_Entity_Id (Name_Op_Concat, Op);
Append_Entity (Make_Op_Formal (Typ, Op), Op);
Append_Entity (Make_Op_Formal (Typ, Op), Op);
- end New_Binary_Operator;
+ end New_Concatenation_Op;
-------------------------------------------
-- Ordinary_Fixed_Point_Type_Declaration --
diff --git a/gcc/ada/sem_ch4.adb b/gcc/ada/sem_ch4.adb
index 81c4e2ab22e..e122af79423 100644
--- a/gcc/ada/sem_ch4.adb
+++ b/gcc/ada/sem_ch4.adb
@@ -342,8 +342,18 @@ package body Sem_Ch4 is
and then Comes_From_Source (N)
and then not In_Instance_Body
then
- Error_Msg_N ("initialization not allowed for limited types", N);
- Explain_Limited_Type (Type_Id, N);
+ -- Ada0Y (AI-287): Do not post an error if the expression corres-
+ -- ponds to a limited aggregate. Limited aggregates are checked in
+ -- sem_aggr in a per-component manner (cf. Get_Value subprogram).
+
+ if Extensions_Allowed
+ and then Nkind (Expression (E)) = N_Aggregate
+ then
+ null;
+ else
+ Error_Msg_N ("initialization not allowed for limited types", N);
+ Explain_Limited_Type (Type_Id, N);
+ end if;
end if;
Analyze_And_Resolve (Expression (E), Type_Id);
@@ -3436,6 +3446,9 @@ package body Sem_Ch4 is
Actual := First_Actual (N);
while Present (Actual) loop
+ -- Ada0Y (AI-50217): Post an error in case of premature usage of
+ -- an entity from the limited view.
+
if not Analyzed (Etype (Actual))
and then From_With_Type (Etype (Actual))
then
diff --git a/gcc/ada/sem_ch5.adb b/gcc/ada/sem_ch5.adb
index 227bb140446..ecb00348fa0 100644
--- a/gcc/ada/sem_ch5.adb
+++ b/gcc/ada/sem_ch5.adb
@@ -33,6 +33,7 @@ with Exp_Util; use Exp_Util;
with Freeze; use Freeze;
with Lib.Xref; use Lib.Xref;
with Nlists; use Nlists;
+with Nmake; use Nmake;
with Opt; use Opt;
with Sem; use Sem;
with Sem_Case; use Sem_Case;
@@ -114,11 +115,9 @@ package body Sem_Ch5 is
-- Some special bad cases of entity names
elsif Is_Entity_Name (N) then
-
if Ekind (Entity (N)) = E_In_Parameter then
Error_Msg_N
("assignment to IN mode parameter not allowed", N);
- return;
-- Private declarations in a protected object are turned into
-- constants when compiling a protected function.
@@ -132,27 +131,38 @@ package body Sem_Ch5 is
then
Error_Msg_N
("protected function cannot modify protected object", N);
- return;
elsif Ekind (Entity (N)) = E_Loop_Parameter then
Error_Msg_N
("assignment to loop parameter not allowed", N);
- return;
+ else
+ Error_Msg_N
+ ("left hand side of assignment must be a variable", N);
end if;
- -- For indexed components, or selected components, test prefix
+ -- For indexed components or selected components, test prefix
- elsif Nkind (N) = N_Indexed_Component
- or else Nkind (N) = N_Selected_Component
- then
+ elsif Nkind (N) = N_Indexed_Component then
Diagnose_Non_Variable_Lhs (Prefix (N));
- return;
- end if;
- -- If we fall through, we have no special message to issue!
+ -- Another special case for assignment to discriminant.
+
+ elsif Nkind (N) = N_Selected_Component then
+ if Present (Entity (Selector_Name (N)))
+ and then Ekind (Entity (Selector_Name (N))) = E_Discriminant
+ then
+ Error_Msg_N
+ ("assignment to discriminant not allowed", N);
+ else
+ Diagnose_Non_Variable_Lhs (Prefix (N));
+ end if;
+
+ else
+ -- If we fall through, we have no special message to issue!
- Error_Msg_N ("left hand side of assignment must be a variable", N);
+ Error_Msg_N ("left hand side of assignment must be a variable", N);
+ end if;
end Diagnose_Non_Variable_Lhs;
-------------------------
@@ -395,7 +405,6 @@ package body Sem_Ch5 is
(Nkind (Rhs) /= N_Type_Conversion
or else Is_Constrained (Etype (Rhs)))
then
-
-- Assignment verifies that the length of the Lsh and Rhs are equal,
-- but of course the indices do not have to match. If the right-hand
-- side is a type conversion to an unconstrained type, a length check
@@ -596,7 +605,7 @@ package body Sem_Ch5 is
Process_Non_Static_Choice => Non_Static_Choice_Error,
Process_Associated_Node => Process_Statements);
use Case_Choices_Processing;
- -- Instantiation of the generic choice processing package.
+ -- Instantiation of the generic choice processing package
-----------------------------
-- Non_Static_Choice_Error --
@@ -667,11 +676,10 @@ package body Sem_Ch5 is
return;
end if;
- -- If the case expression is a formal object of mode in out,
- -- then treat it as having a nonstatic subtype by forcing
- -- use of the base type (which has to get passed to
- -- Check_Case_Choices below). Also use base type when
- -- the case expression is parenthesized.
+ -- If the case expression is a formal object of mode in out, then
+ -- treat it as having a nonstatic subtype by forcing use of the base
+ -- type (which has to get passed to Check_Case_Choices below). Also
+ -- use base type when the case expression is parenthesized.
if Paren_Count (Exp) > 0
or else (Is_Entity_Name (Exp)
@@ -680,7 +688,7 @@ package body Sem_Ch5 is
Exp_Type := Exp_Btype;
end if;
- -- Call the instantiated Analyze_Choices which does the rest of the work
+ -- Call instantiated Analyze_Choices which does the rest of the work
Analyze_Choices
(N, Exp_Type, Case_Table, Last_Choice, Dont_Care, Others_Present);
@@ -777,7 +785,7 @@ package body Sem_Ch5 is
end if;
end loop;
- -- Verify that if present the condition is a Boolean expression.
+ -- Verify that if present the condition is a Boolean expression
if Present (Cond) then
Analyze_And_Resolve (Cond, Any_Boolean);
@@ -990,7 +998,6 @@ package body Sem_Ch5 is
procedure Analyze_Implicit_Label_Declaration (N : Node_Id) is
Id : constant Node_Id := Defining_Identifier (N);
-
begin
Enter_Name (Id);
Set_Ekind (Id, E_Label);
@@ -1003,6 +1010,62 @@ package body Sem_Ch5 is
------------------------------
procedure Analyze_Iteration_Scheme (N : Node_Id) is
+ procedure Check_Controlled_Array_Attribute (DS : Node_Id);
+ -- If the bounds are given by a 'Range reference on a function call
+ -- that returns a controlled array, introduce an explicit declaration
+ -- to capture the bounds, so that the function result can be finalized
+ -- in timely fashion.
+
+ --------------------------------------
+ -- Check_Controlled_Array_Attribute --
+ --------------------------------------
+
+ procedure Check_Controlled_Array_Attribute (DS : Node_Id) is
+ begin
+ if Nkind (DS) = N_Attribute_Reference
+ and then Is_Entity_Name (Prefix (DS))
+ and then Ekind (Entity (Prefix (DS))) = E_Function
+ and then Is_Array_Type (Etype (Entity (Prefix (DS))))
+ and then
+ Is_Controlled (
+ Component_Type (Etype (Entity (Prefix (DS)))))
+ and then Expander_Active
+ then
+ declare
+ Loc : constant Source_Ptr := Sloc (N);
+ Arr : constant Entity_Id :=
+ Etype (Entity (Prefix (DS)));
+ Indx : constant Entity_Id :=
+ Base_Type (Etype (First_Index (Arr)));
+ Subt : constant Entity_Id :=
+ Make_Defining_Identifier
+ (Loc, New_Internal_Name ('S'));
+ Decl : Node_Id;
+
+ begin
+ Decl :=
+ Make_Subtype_Declaration (Loc,
+ Defining_Identifier => Subt,
+ Subtype_Indication =>
+ Make_Subtype_Indication (Loc,
+ Subtype_Mark => New_Reference_To (Indx, Loc),
+ Constraint =>
+ Make_Range_Constraint (Loc,
+ Relocate_Node (DS))));
+ Insert_Before (Parent (N), Decl);
+ Analyze (Decl);
+
+ Rewrite (DS,
+ Make_Attribute_Reference (Loc,
+ Prefix => New_Reference_To (Subt, Loc),
+ Attribute_Name => Attribute_Name (DS)));
+ Analyze (DS);
+ end;
+ end if;
+ end Check_Controlled_Array_Attribute;
+
+ -- Start of processing for Analyze_Iteration_Scheme
+
begin
-- For an infinite loop, there is no iteration scheme
@@ -1043,7 +1106,6 @@ package body Sem_Ch5 is
declare
H : constant Entity_Id := Homonym (Id);
-
begin
if Present (H)
and then Enclosing_Dynamic_Scope (H) =
@@ -1080,6 +1142,7 @@ package body Sem_Ch5 is
Set_Etype (DS, Any_Type);
end if;
+ Check_Controlled_Array_Attribute (DS);
Make_Index (DS, LP);
Set_Ekind (Id, E_Loop_Parameter);
@@ -1189,7 +1252,6 @@ package body Sem_Ch5 is
procedure Analyze_Label (N : Node_Id) is
pragma Warnings (Off, N);
-
begin
Kill_Current_Values;
end Analyze_Label;
@@ -1270,7 +1332,6 @@ package body Sem_Ch5 is
procedure Analyze_Null_Statement (N : Node_Id) is
pragma Warnings (Off, N);
-
begin
null;
end Analyze_Null_Statement;
diff --git a/gcc/ada/sem_ch6.adb b/gcc/ada/sem_ch6.adb
index 6c9b3990328..d28109b1c54 100644
--- a/gcc/ada/sem_ch6.adb
+++ b/gcc/ada/sem_ch6.adb
@@ -82,11 +82,7 @@ package body Sem_Ch6 is
-- Analyze a generic subprogram body. N is the body to be analyzed,
-- and Gen_Id is the defining entity Id for the corresponding spec.
- function Build_Body_To_Inline
- (N : Node_Id;
- Subp : Entity_Id;
- Orig_Body : Node_Id)
- return Boolean;
+ procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id);
-- If a subprogram has pragma Inline and inlining is active, use generic
-- machinery to build an unexpanded body for the subprogram. This body is
-- subsequenty used for inline expansions at call sites. If subprogram can
@@ -132,8 +128,7 @@ package body Sem_Ch6 is
function Is_Non_Overriding_Operation
(Prev_E : Entity_Id;
- New_E : Entity_Id)
- return Boolean;
+ New_E : Entity_Id) return Boolean;
-- Enforce the rule given in 12.3(18): a private operation in an instance
-- overrides an inherited operation only if the corresponding operation
-- was overriding in the generic. This can happen for primitive operations
@@ -156,8 +151,7 @@ package body Sem_Ch6 is
(T1 : Entity_Id;
T2 : Entity_Id;
Ctype : Conformance_Type;
- Get_Inst : Boolean := False)
- return Boolean;
+ Get_Inst : Boolean := False) return Boolean;
-- Check that two formal parameter types conform, checking both
-- for equality of base types, and where required statically
-- matching subtypes, depending on the setting of Ctype.
@@ -1142,9 +1136,7 @@ package body Sem_Ch6 is
(Front_End_Inlining
or else Configurable_Run_Time_Mode)))
then
- if Build_Body_To_Inline (N, Spec_Id, Copy_Separate_Tree (N)) then
- null;
- end if;
+ Build_Body_To_Inline (N, Spec_Id);
end if;
-- Now we can go on to analyze the body
@@ -1492,12 +1484,7 @@ package body Sem_Ch6 is
-- Build_Body_To_Inline --
--------------------------
- function Build_Body_To_Inline
- (N : Node_Id;
- Subp : Entity_Id;
- Orig_Body : Node_Id)
- return Boolean
- is
+ procedure Build_Body_To_Inline (N : Node_Id; Subp : Entity_Id) is
Decl : constant Node_Id := Unit_Declaration_Node (Subp);
Original_Body : Node_Id;
Body_To_Analyze : Node_Id;
@@ -1732,7 +1719,7 @@ package body Sem_Ch6 is
if Nkind (Decl) = N_Subprogram_Declaration
and then Present (Body_To_Inline (Decl))
then
- return True; -- Done already.
+ return; -- Done already.
-- Functions that return unconstrained composite types will require
-- secondary stack handling, and cannot currently be inlined.
@@ -1744,64 +1731,13 @@ package body Sem_Ch6 is
then
Cannot_Inline
("cannot inline & (unconstrained return type)?", N, Subp);
- return False;
- end if;
-
- -- We need to capture references to the formals in order to substitute
- -- the actuals at the point of inlining, i.e. instantiation. To treat
- -- the formals as globals to the body to inline, we nest it within
- -- a dummy parameterless subprogram, declared within the real one.
-
- Original_Body := Orig_Body;
-
- -- Within an instance, the current tree is already the result of
- -- a generic copy, and not what we need for subsequent inlining.
- -- We create the required body by doing an instantiating copy, to
- -- obtain the proper partially analyzed tree.
-
- if In_Instance then
- if No (Generic_Parent (Specification (N))) then
- return False;
-
- elsif Is_Child_Unit (Scope (Current_Scope)) then
- return False;
-
- elsif Scope (Current_Scope) = Cunit_Entity (Main_Unit) then
-
- -- compiling an instantiation. There is no point in generating
- -- bodies to inline, because they will not be used.
-
- return False;
-
- else
- Body_To_Analyze :=
- Copy_Generic_Node
- (Generic_Parent (Specification (N)), Empty,
- Instantiating => True);
- end if;
-
- -- Case of not in an instance
-
- else
- Body_To_Analyze :=
- Copy_Generic_Node (Original_Body, Empty,
- Instantiating => False);
- end if;
-
- Set_Parameter_Specifications (Specification (Original_Body), No_List);
- Set_Defining_Unit_Name (Specification (Original_Body),
- Make_Defining_Identifier (Sloc (N), New_Internal_Name ('S')));
- Set_Corresponding_Spec (Original_Body, Empty);
-
- if Ekind (Subp) = E_Function then
- Set_Subtype_Mark (Specification (Original_Body),
- New_Occurrence_Of (Etype (Subp), Sloc (N)));
+ return;
end if;
- if Present (Declarations (Orig_Body))
- and then Has_Excluded_Declaration (Declarations (Orig_Body))
+ if Present (Declarations (N))
+ and then Has_Excluded_Declaration (Declarations (N))
then
- return False;
+ return;
end if;
if Present (Handled_Statement_Sequence (N)) then
@@ -1810,12 +1746,12 @@ package body Sem_Ch6 is
("cannot inline& (exception handler)?",
First (Exception_Handlers (Handled_Statement_Sequence (N))),
Subp);
- return False;
+ return;
elsif
Has_Excluded_Statement
(Statements (Handled_Statement_Sequence (N)))
then
- return False;
+ return;
end if;
end if;
@@ -1827,16 +1763,36 @@ package body Sem_Ch6 is
and then not Is_Always_Inlined (Subp)
then
Cannot_Inline ("cannot inline& (body too large)?", N, Subp);
- return False;
+ return;
end if;
if Has_Pending_Instantiation then
Cannot_Inline
("cannot inline& (forward instance within enclosing body)?",
N, Subp);
- return False;
+ return;
+ end if;
+
+ -- Within an instance, the body to inline must be treated as a nested
+ -- generic, so that the proper global references are preserved.
+
+ if In_Instance then
+ Save_Env (Scope (Current_Scope), Scope (Current_Scope));
+ Original_Body := Copy_Generic_Node (N, Empty, True);
+ else
+ Original_Body := Copy_Separate_Tree (N);
end if;
+ -- We need to capture references to the formals in order to substitute
+ -- the actuals at the point of inlining, i.e. instantiation. To treat
+ -- the formals as globals to the body to inline, we nest it within
+ -- a dummy parameterless subprogram, declared within the real one.
+
+ Set_Parameter_Specifications (Specification (Original_Body), No_List);
+ Set_Defining_Unit_Name (Specification (Original_Body),
+ Make_Defining_Identifier (Sloc (N), New_Internal_Name ('S')));
+ Set_Corresponding_Spec (Original_Body, Empty);
+
Body_To_Analyze := Copy_Generic_Node (Original_Body, Empty, False);
-- Set return type of function, which is also global and does not need
@@ -1866,7 +1822,10 @@ package body Sem_Ch6 is
Set_Body_To_Inline (Decl, Original_Body);
Set_Ekind (Defining_Entity (Original_Body), Ekind (Subp));
Set_Is_Inlined (Subp);
- return True;
+
+ if In_Instance then
+ Restore_Env;
+ end if;
end Build_Body_To_Inline;
-------------------
@@ -2972,8 +2931,7 @@ package body Sem_Ch6 is
(T1 : Entity_Id;
T2 : Entity_Id;
Ctype : Conformance_Type;
- Get_Inst : Boolean := False)
- return Boolean
+ Get_Inst : Boolean := False) return Boolean
is
Type_1 : Entity_Id := T1;
Type_2 : Entity_Id := T2;
@@ -3475,8 +3433,7 @@ package body Sem_Ch6 is
function Fully_Conformant_Expressions
(Given_E1 : Node_Id;
- Given_E2 : Node_Id)
- return Boolean
+ Given_E2 : Node_Id) return Boolean
is
E1 : constant Node_Id := Original_Node (Given_E1);
E2 : constant Node_Id := Original_Node (Given_E2);
@@ -3849,8 +3806,7 @@ package body Sem_Ch6 is
function Fully_Conformant_Discrete_Subtypes
(Given_S1 : Node_Id;
- Given_S2 : Node_Id)
- return Boolean
+ Given_S2 : Node_Id) return Boolean
is
S1 : constant Node_Id := Original_Node (Given_S1);
S2 : constant Node_Id := Original_Node (Given_S2);
@@ -3942,8 +3898,7 @@ package body Sem_Ch6 is
function Is_Non_Overriding_Operation
(Prev_E : Entity_Id;
- New_E : Entity_Id)
- return Boolean
+ New_E : Entity_Id) return Boolean
is
Formal : Entity_Id;
F_Typ : Entity_Id;
@@ -3956,8 +3911,7 @@ package body Sem_Ch6 is
function Types_Correspond
(P_Type : Entity_Id;
- N_Type : Entity_Id)
- return Boolean;
+ N_Type : Entity_Id) return Boolean;
-- Returns true if and only if the types (or designated types
-- in the case of anonymous access types) are the same or N_Type
-- is derived directly or indirectly from P_Type.
@@ -4005,8 +3959,7 @@ package body Sem_Ch6 is
function Types_Correspond
(P_Type : Entity_Id;
- N_Type : Entity_Id)
- return Boolean
+ N_Type : Entity_Id) return Boolean
is
Prev_Type : Entity_Id := Base_Type (P_Type);
New_Type : Entity_Id := Base_Type (N_Type);
@@ -4887,9 +4840,9 @@ package body Sem_Ch6 is
and then Ekind (Root_Type (Formal_Type)) =
E_Incomplete_Type)
then
-
- -- Incomplete tagged types that are made visible through
- -- a limited with_clause are valid formal types.
+ -- Ada0Y (AI-50217): Incomplete tagged types that are made
+ -- visible through a limited with_clause are valid formal
+ -- types.
if From_With_Type (Formal_Type)
and then Is_Tagged_Type (Formal_Type)
@@ -5245,7 +5198,6 @@ package body Sem_Ch6 is
function Type_Conformant (New_Id, Old_Id : Entity_Id) return Boolean is
Result : Boolean;
-
begin
Check_Conformance (New_Id, Old_Id, Type_Conformant, False, Result);
return Result;
diff --git a/gcc/ada/sem_ch8.adb b/gcc/ada/sem_ch8.adb
index da29d208cef..6c65a7b5ecd 100644
--- a/gcc/ada/sem_ch8.adb
+++ b/gcc/ada/sem_ch8.adb
@@ -789,8 +789,16 @@ package body Sem_Ch8 is
end if;
if Etype (Old_P) = Any_Type then
- Error_Msg_N
- ("expect package name in renaming", Name (N));
+ Error_Msg_N
+ ("expect package name in renaming", Name (N));
+
+ -- Ada0Y (AI-50217): Limited withed packages can not be renamed
+
+ elsif Ekind (Old_P) = E_Package
+ and then From_With_Type (Old_P)
+ then
+ Error_Msg_N
+ ("limited withed package cannot be renamed", Name (N));
elsif Ekind (Old_P) /= E_Package
and then not (Ekind (Old_P) = E_Generic_Package
@@ -811,11 +819,6 @@ package body Sem_Ch8 is
Set_Ekind (New_P, E_Package);
Set_Etype (New_P, Standard_Void_Type);
- elsif Ekind (Old_P) = E_Package
- and then From_With_Type (Old_P)
- then
- Error_Msg_N ("imported package cannot be renamed", Name (N));
-
else
-- Entities in the old package are accessible through the
-- renaming entity. The simplest implementation is to have
@@ -3388,6 +3391,8 @@ package body Sem_Ch8 is
Set_Chars (Selector, Chars (Id));
end if;
+ -- Ada0Y (AI-50217): Check usage of entities in limited withed units
+
if Ekind (P_Name) = E_Package
and then From_With_Type (P_Name)
then
@@ -3397,7 +3402,8 @@ package body Sem_Ch8 is
null;
else
Error_Msg_N
- ("imported package can only be used to access imported type",
+ ("limited withed package can only be used to access "
+ & " incomplete types",
N);
end if;
end if;
@@ -4058,6 +4064,14 @@ package body Sem_Ch8 is
Error_Msg_N (
"invalid prefix in selected component&", P);
+ if Is_Access_Type (P_Type)
+ and then Ekind (Designated_Type (P_Type)) = E_Incomplete_Type
+ then
+ Error_Msg_N
+ ("\dereference must not be of an incomplete type " &
+ "('R'M 3.10.1)", P);
+ end if;
+
else
Error_Msg_N (
"invalid prefix in selected component", P);
@@ -5072,7 +5086,7 @@ package body Sem_Ch8 is
-- Restore_Scope_Stack --
-------------------------
- procedure Restore_Scope_Stack is
+ procedure Restore_Scope_Stack (Handle_Use : Boolean := True) is
E : Entity_Id;
S : Entity_Id;
Comp_Unit : Node_Id;
@@ -5174,6 +5188,7 @@ package body Sem_Ch8 is
if SS_Last >= Scope_Stack.First
and then Scope_Stack.Table (SS_Last).Entity /= Standard_Standard
+ and then Handle_Use
then
Install_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause);
end if;
@@ -5183,7 +5198,7 @@ package body Sem_Ch8 is
-- Save_Scope_Stack --
----------------------
- procedure Save_Scope_Stack is
+ procedure Save_Scope_Stack (Handle_Use : Boolean := True) is
E : Entity_Id;
S : Entity_Id;
SS_Last : constant Int := Scope_Stack.Last;
@@ -5192,8 +5207,9 @@ package body Sem_Ch8 is
if SS_Last >= Scope_Stack.First
and then Scope_Stack.Table (SS_Last).Entity /= Standard_Standard
then
-
- End_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause);
+ if Handle_Use then
+ End_Use_Clauses (Scope_Stack.Table (SS_Last).First_Use_Clause);
+ end if;
-- If the call is from within a compilation unit, as when
-- called from Rtsfind, make current entries in scope stack
@@ -5282,8 +5298,10 @@ package body Sem_Ch8 is
Set_In_Use (P);
+ -- Ada0Y (AI-50217): Check restriction.
+
if From_With_Type (P) then
- Error_Msg_N ("imported package cannot appear in use clause", N);
+ Error_Msg_N ("limited withed package cannot appear in use clause", N);
end if;
-- Find enclosing instance, if any.
diff --git a/gcc/ada/sem_ch8.ads b/gcc/ada/sem_ch8.ads
index 87db07a074d..bdd3d53d646 100644
--- a/gcc/ada/sem_ch8.ads
+++ b/gcc/ada/sem_ch8.ads
@@ -135,14 +135,18 @@ package Sem_Ch8 is
-- or else a with-clause on system. N is absent when the function is
-- called to find the visibility of implicit operators.
- procedure Restore_Scope_Stack;
- procedure Save_Scope_Stack;
+ procedure Restore_Scope_Stack (Handle_Use : Boolean := True);
+ procedure Save_Scope_Stack (Handle_Use : Boolean := True);
-- These two procedures are called from Semantics, when a unit U1 is
-- to be compiled in the course of the compilation of another unit U2.
-- This happens whenever Rtsfind is called. U1, the unit retrieved by
-- Rtsfind, must be compiled in its own context, and the current scope
-- stack containing U2 and local scopes must be made unreachable. On
-- return, the contents of the scope stack must be made accessible again.
+ -- The flag Handle_Use indicates whether local use clauses must be
+ -- removed/installed. In the case of inlining of instance bodies, the
+ -- visiblity handling is done fully in Inline_Instance_Body, and use
+ -- clauses are handled there.
procedure Set_Use (L : List_Id);
-- Find use clauses that are declarative items in a package declaration
diff --git a/gcc/ada/sem_ch9.adb b/gcc/ada/sem_ch9.adb
index 653774fdee1..d7bff861585 100644
--- a/gcc/ada/sem_ch9.adb
+++ b/gcc/ada/sem_ch9.adb
@@ -294,6 +294,7 @@ package body Sem_Ch9 is
while Present (E1) loop
if Ekind (E1) = E_Procedure
+ and then Chars (E1) = Chars (Entry_Nam)
and then Type_Conformant (E1, Entry_Nam)
then
Error_Msg_N ("entry name is not visible", N);
diff --git a/gcc/ada/sem_elab.adb b/gcc/ada/sem_elab.adb
index 8e6e2e1d83a..f189fe127db 100644
--- a/gcc/ada/sem_elab.adb
+++ b/gcc/ada/sem_elab.adb
@@ -325,6 +325,16 @@ package body Sem_Elab is
-- we ignore this flag.
begin
+ -- If the call is known to be within a local Suppress Elaboration
+ -- pragma, nothing to check. This can happen in task bodies.
+
+ if (Nkind (N) = N_Function_Call
+ or else Nkind (N) = N_Procedure_Call_Statement)
+ and then No_Elaboration_Check (N)
+ then
+ return;
+ end if;
+
-- Go to parent for derived subprogram, or to original subprogram
-- in the case of a renaming (Alias covers both these cases)
@@ -826,10 +836,41 @@ package body Sem_Elab is
(N : Node_Id;
Outer_Scope : Entity_Id := Empty)
is
- Nam : Node_Id;
Ent : Entity_Id;
P : Node_Id;
+ function Get_Called_Ent return Entity_Id;
+ -- Retrieve called entity. If this is a call to a protected subprogram,
+ -- entity is a selected component. The callable entity may be absent,
+ -- in which case there is no check to perform. This happens with
+ -- non-analyzed calls in nested generics.
+
+ --------------------
+ -- Get_Called_Ent --
+ --------------------
+
+ function Get_Called_Ent return Entity_Id is
+ Nam : Node_Id;
+
+ begin
+ Nam := Name (N);
+
+ if No (Nam) then
+ return Empty;
+
+ elsif Nkind (Nam) = N_Selected_Component then
+ return Entity (Selector_Name (Nam));
+
+ elsif not Is_Entity_Name (Nam) then
+ return Empty;
+
+ else
+ return Entity (Nam);
+ end if;
+ end Get_Called_Ent;
+
+ -- Start of processing for Check_Elab_Call
+
begin
-- For an entry call, check relevant restriction
@@ -1014,6 +1055,26 @@ package body Sem_Elab is
exit;
+ elsif Nkind (P) = N_Task_Body then
+
+ -- The check is deferred until Check_Task_Activation
+ -- but we need to capture local suppress pragmas
+ -- that may inhibit checks on this call.
+
+ Ent := Get_Called_Ent;
+
+ if No (Ent) then
+ return;
+
+ elsif Elaboration_Checks_Suppressed (Current_Scope)
+ or else Elaboration_Checks_Suppressed (Ent)
+ or else Elaboration_Checks_Suppressed (Scope (Ent))
+ then
+ Set_No_Elaboration_Check (N);
+ end if;
+
+ return;
+
-- Static model, call is not in elaboration code, we
-- never need to worry, because in the static model
-- the top level caller always takes care of things.
@@ -1027,25 +1088,7 @@ package body Sem_Elab is
end if;
end if;
- -- Retrieve called entity. If this is a call to a protected subprogram,
- -- the entity is a selected component.
- -- The callable entity may be absent, in which case there is nothing
- -- to do. This happens with non-analyzed calls in nested generics.
-
- Nam := Name (N);
-
- if No (Nam) then
- return;
-
- elsif Nkind (Nam) = N_Selected_Component then
- Ent := Entity (Selector_Name (Nam));
-
- elsif not Is_Entity_Name (Nam) then
- return;
-
- else
- Ent := Entity (Nam);
- end if;
+ Ent := Get_Called_Ent;
if No (Ent) then
return;
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 57712b06d9c..f080512468b 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -432,8 +432,7 @@ package body Sem_Prag is
function Is_Before_First_Decl
(Pragma_Node : Node_Id;
- Decls : List_Id)
- return Boolean;
+ Decls : List_Id) return Boolean;
-- Return True if Pragma_Node is before the first declarative item in
-- Decls where Decls is the list of declarative items.
@@ -1122,7 +1121,6 @@ package body Sem_Prag is
when N_Index_Or_Discriminant_Constraint =>
declare
IDC : Entity_Id := First (Constraints (Constr));
-
begin
while Present (IDC) loop
Check_Static_Constraint (IDC);
@@ -1506,8 +1504,7 @@ package body Sem_Prag is
function Is_Before_First_Decl
(Pragma_Node : Node_Id;
- Decls : List_Id)
- return Boolean
+ Decls : List_Id) return Boolean
is
Item : Node_Id := First (Decls);
@@ -2185,8 +2182,7 @@ package body Sem_Prag is
function Same_Base_Type
(Ptype : Node_Id;
- Formal : Entity_Id)
- return Boolean;
+ Formal : Entity_Id) return Boolean;
-- Determines if Ptype references the type of Formal. Note that
-- only the base types need to match according to the spec. Ptype
-- here is the argument from the pragma, which is either a type
@@ -2196,7 +2192,10 @@ package body Sem_Prag is
-- Same_Base_Type --
--------------------
- function Same_Base_Type (Ptype, Formal : Entity_Id) return Boolean is
+ function Same_Base_Type
+ (Ptype : Node_Id;
+ Formal : Entity_Id) return Boolean
+ is
Ftyp : constant Entity_Id := Base_Type (Etype (Formal));
Pref : Node_Id;
@@ -2823,9 +2822,8 @@ package body Sem_Prag is
if Nkind (Parent (N)) = N_Compilation_Unit_Aux then
declare
Cunit : constant Node_Id := Parent (Parent (N));
-
begin
- Set_Body_Required (Cunit, False);
+ Set_Body_Required (Cunit, False);
end;
end if;
end Process_Import_Or_Interface;
@@ -2869,10 +2867,21 @@ package body Sem_Prag is
elsif Nkind (Decl) = N_Subprogram_Declaration
and then Present (Corresponding_Body (Decl))
then
- return
- Present (Exception_Handlers
- (Handled_Statement_Sequence
- (Unit_Declaration_Node (Corresponding_Body (Decl)))));
+ -- If the subprogram is a renaming as body, the body is
+ -- just a call to the renamed subprogram, and inlining is
+ -- trivially possible.
+
+ if Nkind (Unit_Declaration_Node (Corresponding_Body (Decl))) =
+ N_Subprogram_Renaming_Declaration
+ then
+ return False;
+
+ else
+ return
+ Present (Exception_Handlers
+ (Handled_Statement_Sequence
+ (Unit_Declaration_Node (Corresponding_Body (Decl)))));
+ end if;
else
-- If body is not available, assume the best, the check is
-- performed again when compiling enclosing package bodies.
@@ -3701,11 +3710,9 @@ package body Sem_Prag is
declare
Arg_Node : Node_Id;
-
begin
Arg_Count := 0;
Arg_Node := Arg1;
-
while Present (Arg_Node) loop
Arg_Count := Arg_Count + 1;
Next (Arg_Node);
@@ -4480,7 +4487,6 @@ package body Sem_Prag is
when Pragma_Convention => Convention : declare
C : Convention_Id;
E : Entity_Id;
-
begin
Check_Ada_83_Warning;
Check_Arg_Count (2);
@@ -7477,7 +7483,9 @@ package body Sem_Prag is
Error_Pragma
("pragma% ignored, cannot pack aliased components?");
- elsif Has_Atomic_Components (Typ) then
+ elsif Has_Atomic_Components (Typ)
+ or else Is_Atomic (Component_Type (Typ))
+ then
Error_Pragma
("?pragma% ignored, cannot pack atomic components");
@@ -9080,6 +9088,80 @@ package body Sem_Prag is
end if;
end Task_Storage;
+ -----------------
+ -- Thread_Body --
+ -----------------
+
+ -- pragma Thread_Body
+ -- ( [Entity =>] LOCAL_NAME
+ -- [,[Secondary_Stack_Size =>] static_integer_EXPRESSION]);
+
+ when Pragma_Thread_Body => Thread_Body : declare
+ Id : Node_Id;
+ SS : Node_Id;
+ E : Entity_Id;
+
+ begin
+ GNAT_Pragma;
+ Check_At_Least_N_Arguments (1);
+ Check_At_Most_N_Arguments (2);
+ Check_Optional_Identifier (Arg1, Name_Entity);
+ Check_Arg_Is_Local_Name (Arg1);
+
+ Id := Expression (Arg1);
+
+ if not Is_Entity_Name (Id)
+ or else not Is_Subprogram (Entity (Id))
+ then
+ Error_Pragma_Arg ("subprogram name required", Arg1);
+ end if;
+
+ E := Entity (Id);
+
+ -- Go to renamed subprogram if present, since Thread_Body applies
+ -- to the actual renamed entity, not to the renaming entity.
+
+ if Present (Alias (E))
+ and then Nkind (Parent (Declaration_Node (E))) =
+ N_Subprogram_Renaming_Declaration
+ then
+ E := Alias (E);
+ end if;
+
+ -- Various error checks
+
+ if Nkind (Parent (Declaration_Node (E))) = N_Subprogram_Body then
+ Error_Pragma
+ ("pragma% requires separate spec and must come before body");
+
+ elsif Rep_Item_Too_Early (E, N)
+ or else
+ Rep_Item_Too_Late (E, N)
+ then
+ raise Pragma_Exit;
+
+ elsif Is_Thread_Body (E) then
+ Error_Pragma_Arg
+ ("only one thread body pragma allowed", Arg1);
+
+ elsif Present (Homonym (E))
+ and then Scope (Homonym (E)) = Current_Scope
+ then
+ Error_Pragma_Arg
+ ("thread body subprogram must not be overloaded", Arg1);
+ end if;
+
+ Set_Is_Thread_Body (E);
+
+ -- Deal with secondary stack argument
+
+ if Arg_Count = 2 then
+ Check_Optional_Identifier (Arg2, Name_Secondary_Stack_Size);
+ SS := Expression (Arg2);
+ Analyze_And_Resolve (SS, Any_Integer);
+ end if;
+ end Thread_Body;
+
----------------
-- Time_Slice --
----------------
@@ -9555,6 +9637,16 @@ package body Sem_Prag is
E_Id := Expression (Arg2);
Analyze (E_Id);
+ -- In the expansion of an inlined body, a reference to
+ -- the formal may be wrapped in a conversion if the actual
+ -- is a conversion. Retrieve the real entity name.
+
+ if In_Instance_Body
+ and then Nkind (E_Id) = N_Unchecked_Type_Conversion
+ then
+ E_Id := Expression (E_Id);
+ end if;
+
if not Is_Entity_Name (E_Id) then
Error_Pragma_Arg
("second argument of pragma% must be entity name",
@@ -9810,6 +9902,7 @@ package body Sem_Prag is
Pragma_Task_Info => -1,
Pragma_Task_Name => -1,
Pragma_Task_Storage => 0,
+ Pragma_Thread_Body => +2,
Pragma_Time_Slice => -1,
Pragma_Title => -1,
Pragma_Unchecked_Union => -1,
diff --git a/gcc/ada/sem_res.adb b/gcc/ada/sem_res.adb
index 68c45f65409..51971d135d3 100644
--- a/gcc/ada/sem_res.adb
+++ b/gcc/ada/sem_res.adb
@@ -88,6 +88,11 @@ package body Sem_Res is
-- Give list of candidate interpretations when a character literal cannot
-- be resolved.
+ procedure Check_Direct_Boolean_Op (N : Node_Id);
+ -- N is a binary operator node which may possibly operate on Boolean
+ -- operands. If the operator does have Boolean operands, then a call is
+ -- made to check the restriction No_Direct_Boolean_Operators.
+
procedure Check_Discriminant_Use (N : Node_Id);
-- Enforce the restrictions on the use of discriminants when constraining
-- a component of a discriminated type (record or concurrent type).
@@ -342,6 +347,17 @@ package body Sem_Res is
end if;
end Analyze_And_Resolve;
+ -----------------------------
+ -- Check_Direct_Boolean_Op --
+ -----------------------------
+
+ procedure Check_Direct_Boolean_Op (N : Node_Id) is
+ begin
+ if Root_Type (Etype (Left_Opnd (N))) = Standard_Boolean then
+ Check_Restriction (No_Direct_Boolean_Operators, N);
+ end if;
+ end Check_Direct_Boolean_Op;
+
----------------------------
-- Check_Discriminant_Use --
----------------------------
@@ -1940,9 +1956,25 @@ package body Sem_Res is
if Is_Overloaded (N)
and then Nkind (N) = N_Function_Call
then
- Error_Msg_Node_2 := Typ;
- Error_Msg_NE ("no visible interpretation of&" &
- " matches expected type&", N, Name (N));
+ declare
+ Subp_Name : Node_Id;
+ begin
+ if Is_Entity_Name (Name (N)) then
+ Subp_Name := Name (N);
+
+ elsif Nkind (Name (N)) = N_Selected_Component then
+
+ -- Protected operation: retrieve operation name.
+
+ Subp_Name := Selector_Name (Name (N));
+ else
+ raise Program_Error;
+ end if;
+
+ Error_Msg_Node_2 := Typ;
+ Error_Msg_NE ("no visible interpretation of&" &
+ " matches expected type&", N, Subp_Name);
+ end;
if All_Errors_Mode then
declare
@@ -3315,7 +3347,6 @@ package body Sem_Res is
-- dereference made explicit in Analyze_Call.
if Ekind (Etype (Subp)) = E_Subprogram_Type then
-
if not Is_Overloaded (Subp) then
Nam := Etype (Subp);
@@ -3423,6 +3454,12 @@ package body Sem_Res is
end;
end if;
+ -- Cannot call thread body directly
+
+ if Is_Thread_Body (Nam) then
+ Error_Msg_N ("cannot call thread body directly", N);
+ end if;
+
-- If the subprogram is not global, then kill all checks. This is
-- a bit conservative, since in many cases we could do better, but
-- it is not worth the effort. Similarly, we kill constant values.
@@ -3690,6 +3727,13 @@ package body Sem_Res is
Establish_Transient_Scope
(N, Sec_Stack => not Functions_Return_By_DSP_On_Target);
+ -- If the call appears within the bounds of a loop, it will
+ -- be rewritten and reanalyzed, nothing left to do here.
+
+ if Nkind (N) /= N_Function_Call then
+ return;
+ end if;
+
elsif Is_Init_Proc (Nam)
and then not Within_Init_Proc
then
@@ -3831,6 +3875,8 @@ package body Sem_Res is
T : Entity_Id;
begin
+ Check_Direct_Boolean_Op (N);
+
-- If this is an intrinsic operation which is not predefined, use
-- the types of its declared arguments to resolve the possibly
-- overloaded operands. Otherwise the operands are unambiguous and
@@ -4570,6 +4616,8 @@ package body Sem_Res is
-- Start of processing for Resolve_Equality_Op
begin
+ Check_Direct_Boolean_Op (N);
+
Set_Etype (N, Base_Type (Typ));
Generate_Reference (T, N, ' ');
@@ -4951,6 +4999,8 @@ package body Sem_Res is
B_Typ : Entity_Id;
begin
+ Check_Direct_Boolean_Op (N);
+
-- Predefined operations on scalar types yield the base type. On
-- the other hand, logical operations on arrays yield the type of
-- the arguments (and the context).
@@ -6157,6 +6207,12 @@ package body Sem_Res is
Error_Msg_N ("\as Duration, and will lose precision?", Rop);
end if;
+ elsif Is_Numeric_Type (Typ)
+ and then Nkind (Operand) in N_Op
+ and then Unique_Fixed_Point_Type (N) /= Any_Type
+ then
+ Set_Etype (Operand, Standard_Duration);
+
else
Error_Msg_N ("invalid context for mixed mode operation", N);
Set_Etype (Operand, Any_Type);
diff --git a/gcc/ada/sem_type.adb b/gcc/ada/sem_type.adb
index 105dc53bc55..57bbb3de759 100644
--- a/gcc/ada/sem_type.adb
+++ b/gcc/ada/sem_type.adb
@@ -824,6 +824,9 @@ package body Sem_Type is
then
return True;
+ -- Ada0Y (AI-50217): Additional branches to make the shadow entity
+ -- compatible with its real entity.
+
elsif From_With_Type (T1) then
-- If the expected type is the non-limited view of a type, the
@@ -2134,15 +2137,19 @@ package body Sem_Type is
if B1 = B2 then
return B1;
- elsif (T1 = Universal_Integer and then Is_Integer_Type (T2))
- or else (T1 = Universal_Real and then Is_Real_Type (T2))
- or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2))
+ elsif False
+ or else (T1 = Universal_Integer and then Is_Integer_Type (T2))
+ or else (T1 = Universal_Real and then Is_Real_Type (T2))
+ or else (T1 = Universal_Fixed and then Is_Fixed_Point_Type (T2))
+ or else (T1 = Any_Fixed and then Is_Fixed_Point_Type (T2))
then
return B2;
- elsif (T2 = Universal_Integer and then Is_Integer_Type (T1))
- or else (T2 = Universal_Real and then Is_Real_Type (T1))
- or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1))
+ elsif False
+ or else (T2 = Universal_Integer and then Is_Integer_Type (T1))
+ or else (T2 = Universal_Real and then Is_Real_Type (T1))
+ or else (T2 = Universal_Fixed and then Is_Fixed_Point_Type (T1))
+ or else (T2 = Any_Fixed and then Is_Fixed_Point_Type (T1))
then
return B1;
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index dc67b50db51..57f93173b54 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -818,8 +818,8 @@ package body Sem_Util is
begin
if Ekind (T) = E_Incomplete_Type then
- -- If the type is available through a limited_with_clause,
- -- verify that its full view has been analyzed.
+ -- Ada0Y (AI-50217): If the type is available through a limited
+ -- with_clause, verify that its full view has been analyzed.
if From_With_Type (T)
and then Present (Non_Limited_View (T))
@@ -6371,6 +6371,12 @@ package body Sem_Util is
Error_Msg_N (
"operator of the type is not directly visible!", Expr);
+ elsif Ekind (Found_Type) = E_Void
+ and then Present (Parent (Found_Type))
+ and then Nkind (Parent (Found_Type)) = N_Full_Type_Declaration
+ then
+ Error_Msg_NE ("found premature usage of}!", Expr, Found_Type);
+
else
Error_Msg_NE ("found}!", Expr, Found_Type);
end if;
diff --git a/gcc/ada/sem_warn.adb b/gcc/ada/sem_warn.adb
index b77d49b9940..0d57ac00f66 100644
--- a/gcc/ada/sem_warn.adb
+++ b/gcc/ada/sem_warn.adb
@@ -1440,14 +1440,16 @@ package body Sem_Warn is
when E_Variable =>
-- Case of variable that is assigned but not read. We
- -- suppress the message if the variable is volatile or
- -- has an address clause.
+ -- suppress the message if the variable is volatile,
+ -- has an address clause, or is imported.
if Referenced_As_LHS (E)
and then No (Address_Clause (E))
and then not Is_Volatile (E)
then
- if Warn_On_Modified_Unread then
+ if Warn_On_Modified_Unread
+ and then not Is_Imported (E)
+ then
Error_Msg_N
("variable & is assigned but never read?", E);
end if;
diff --git a/gcc/ada/sinfo.adb b/gcc/ada/sinfo.adb
index 22b8137ed39..f8d22784d0c 100644
--- a/gcc/ada/sinfo.adb
+++ b/gcc/ada/sinfo.adb
@@ -297,6 +297,7 @@ package body Sinfo is
(N : Node_Id) return Boolean is
begin
pragma Assert (False
+ or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
return Flag15 (N);
@@ -930,6 +931,15 @@ package body Sinfo is
return Node4 (N);
end Entity;
+ function Entity_Or_Associated_Node
+ (N : Node_Id) return Node_Id is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind in N_Has_Entity
+ or else NT (N).Nkind = N_Freeze_Entity);
+ return Node4 (N);
+ end Entity_Or_Associated_Node;
+
function Entry_Body_Formal_Part
(N : Node_Id) return Node_Id is
begin
@@ -1754,6 +1764,15 @@ package body Sinfo is
return Flag7 (N);
end No_Ctrl_Actions;
+ function No_Elaboration_Check
+ (N : Node_Id) return Boolean is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Function_Call
+ or else NT (N).Nkind = N_Procedure_Call_Statement);
+ return Flag14 (N);
+ end No_Elaboration_Check;
+
function No_Entities_Ref_In_Spec
(N : Node_Id) return Boolean is
begin
@@ -2720,6 +2739,7 @@ package body Sinfo is
(N : Node_Id; Val : Boolean := True) is
begin
pragma Assert (False
+ or else NT (N).Nkind = N_Component_Association
or else NT (N).Nkind = N_Formal_Package_Declaration
or else NT (N).Nkind = N_Formal_Subprogram_Declaration);
Set_Flag15 (N, Val);
@@ -4176,6 +4196,15 @@ package body Sinfo is
Set_Flag7 (N, Val);
end Set_No_Ctrl_Actions;
+ procedure Set_No_Elaboration_Check
+ (N : Node_Id; Val : Boolean := True) is
+ begin
+ pragma Assert (False
+ or else NT (N).Nkind = N_Function_Call
+ or else NT (N).Nkind = N_Procedure_Call_Statement);
+ Set_Flag14 (N, Val);
+ end Set_No_Elaboration_Check;
+
procedure Set_No_Entities_Ref_In_Spec
(N : Node_Id; Val : Boolean := True) is
begin
diff --git a/gcc/ada/sinfo.ads b/gcc/ada/sinfo.ads
index 014228b5a9c..de8b23eb7d0 100644
--- a/gcc/ada/sinfo.ads
+++ b/gcc/ada/sinfo.ads
@@ -244,7 +244,7 @@ package Sinfo is
-- Variant := First (Variants (N));
-- while Present (Variant) loop
-- ...
- -- Alt := Next (Alt);
+ -- Variant := Next (Variant);
-- end loop;
-- or
@@ -252,7 +252,7 @@ package Sinfo is
-- Variant := First_Non_Pragma (Variants (N));
-- while Present (Variant) loop
-- ...
- -- Alt := Next_Non_Pragma (Alt);
+ -- Variant := Next_Non_Pragma (Variant);
-- end loop;
-- In the first form of the loop, Variant can either be an N_Pragma or
@@ -393,7 +393,7 @@ package Sinfo is
-- abbreviations are used:
-- Note: the utility program that creates the Treeprs spec (in the file
- -- treeprs.ads) knows about the special fields here, so it must be
+ -- xtreeprs.adb) knows about the special fields here, so it must be
-- modified if any change is made to these fields.
-- "plus fields for binary operator"
@@ -567,14 +567,18 @@ package Sinfo is
-- Associated_Node (Node4-Sem)
-- Present in nodes that can denote an entity: identifiers, character
- -- literals, operator symbols, expanded names, operator nodes and
+ -- literals, operator symbols, expanded names, operator nodes, and
-- attribute reference nodes (all these nodes have an Entity field).
-- This field is also present in N_Aggregate, N_Selected_Component,
- -- and N_Extension_Aggregate nodes. This field is used during generic
- -- processing to relate nodes in the original template to nodes in the
- -- generic copy. It overlaps the Entity field, and is used to capture
- -- global references in the analyzed copy and place them in the template.
- -- See description in Sem_Ch12 for further details on this usage.
+ -- and N_Extension_Aggregate nodes. This field is used in generic
+ -- processing to create links between the generic template and the
+ -- generic copy. See Sem_Ch12.Get_Associated_Node for full details.
+ -- Note that this field overlaps Entity, which is fine, since, as
+ -- explained in Sem_Ch12, the normal function of Entity is not
+ -- required at the point where the Associated_Node is set. Note
+ -- also, that in generic templates, this means that the Entity field
+ -- does not necessarily point to an Entity. Since the back end is
+ -- expected to ignore generic templates, this is harmless.
-- At_End_Proc (Node1)
-- This field is present in an N_Handled_Sequence_Of_Statements node.
@@ -861,8 +865,16 @@ package Sinfo is
-- incorrect (e.g. during overload resolution, Entity is initially
-- set to the first possible correct interpretation, and then later
-- modified if necessary to contain the correct value after resolution).
- -- Note that Associated_Node overlays this field during the processing
- -- of generics. See Sem_Ch12 for further details.
+ -- Note that this field overlaps Associated_Node, which is used during
+ -- generic processing (see Sem_Ch12 for details). Note also that in
+ -- generic templates, this means that the Entity field does not always
+ -- point to an Entity. Since the back end is expected to ignore
+ -- generic templates, this is harmless.
+
+ -- Entity_Or_Associated_Node (Node4-Sem)
+ -- A synonym for both Entity and Asasociated_Node. Used by convention
+ -- in the code when referencing this field in cases where it is not
+ -- known whether the field contains an Entity or an Associated_Node.
-- Etype (Node5-Sem)
-- Appears in all expression nodes, all direct names, and all
@@ -1254,6 +1266,13 @@ package Sinfo is
-- where the generated assignments are more initialisations than real
-- assignments.
+ -- No_Elaboration_Check (Flag14-Sem)
+ -- Present in N_Function_Call and N_Procedure_Call_Statement. Indicates
+ -- that no elaboration check is needed on the call, because it appears
+ -- in the context of a local Suppress pragma. This is used on calls
+ -- within task bodies, where the actual elaboration checks are applied
+ -- after analysis, when the local scope stack is not present.
+
-- No_Entities_Ref_In_Spec (Flag8-Sem)
-- Present in N_With_Clause nodes. Set if the with clause is on the
-- package or subprogram spec where the main unit is the corresponding
@@ -2996,13 +3015,15 @@ package Sinfo is
-- Choices (List1)
-- Loop_Actions (List2-Sem)
-- Expression (Node3)
+ -- Box_Present (Flag15)
-- Note: this structure is used for both record component associations
-- and array component associations, since the two cases aren't always
-- separable by the parser. The choices list may represent either a
-- list of selector names in the record aggregate case, or a list of
-- discrete choices in the array aggregate case or an N_Others_Choice
- -- node (which appears as a singleton list).
+ -- node (which appears as a singleton list). Box_Present gives support
+ -- to Ada0Y (AI-287).
------------------------------------
-- 4.3.1 Commponent Choice List --
@@ -4029,6 +4050,7 @@ package Sinfo is
-- First_Named_Actual (Node4-Sem)
-- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
-- Do_Tag_Check (Flag13-Sem)
+ -- No_Elaboration_Check (Flag14-Sem)
-- Parameter_List_Truncated (Flag17-Sem)
-- ABE_Is_Certain (Flag18-Sem)
-- plus fields for expression
@@ -4059,6 +4081,7 @@ package Sinfo is
-- First_Named_Actual (Node4-Sem)
-- Controlling_Argument (Node1-Sem) (set to Empty if not dispatching)
-- Do_Tag_Check (Flag13-Sem)
+ -- No_Elaboration_Check (Flag14-Sem)
-- Parameter_List_Truncated (Flag17-Sem)
-- ABE_Is_Certain (Flag18-Sem)
-- plus fields for expression
@@ -5077,6 +5100,9 @@ package Sinfo is
-- Unreferenced_In_Spec (Flag7-Sem)
-- No_Entities_Ref_In_Spec (Flag8-Sem)
+ -- Note: Limited_Present and Limited_View_Installed give support to
+ -- Ada0Y (AI-50217).
+
----------------------
-- With_Type clause --
----------------------
@@ -7107,6 +7133,9 @@ package Sinfo is
function Entity
(N : Node_Id) return Node_Id; -- Node4
+ function Entity_Or_Associated_Node
+ (N : Node_Id) return Node_Id; -- Node4
+
function Entry_Body_Formal_Part
(N : Node_Id) return Node_Id; -- Node5
@@ -7371,6 +7400,9 @@ package Sinfo is
function No_Ctrl_Actions
(N : Node_Id) return Boolean; -- Flag7
+ function No_Elaboration_Check
+ (N : Node_Id) return Boolean; -- Flag14
+
function No_Entities_Ref_In_Spec
(N : Node_Id) return Boolean; -- Flag8
@@ -8145,6 +8177,9 @@ package Sinfo is
procedure Set_No_Ctrl_Actions
(N : Node_Id; Val : Boolean := True); -- Flag7
+ procedure Set_No_Elaboration_Check
+ (N : Node_Id; Val : Boolean := True); -- Flag14
+
procedure Set_No_Entities_Ref_In_Spec
(N : Node_Id; Val : Boolean := True); -- Flag8
@@ -8491,6 +8526,7 @@ package Sinfo is
pragma Inline (End_Label);
pragma Inline (End_Span);
pragma Inline (Entity);
+ pragma Inline (Entity_Or_Associated_Node);
pragma Inline (Entry_Body_Formal_Part);
pragma Inline (Entry_Call_Alternative);
pragma Inline (Entry_Call_Statement);
@@ -8579,6 +8615,7 @@ package Sinfo is
pragma Inline (Next_Rep_Item);
pragma Inline (Next_Use_Clause);
pragma Inline (No_Ctrl_Actions);
+ pragma Inline (No_Elaboration_Check);
pragma Inline (No_Entities_Ref_In_Spec);
pragma Inline (No_Initialization);
pragma Inline (No_Truncation);
@@ -8833,6 +8870,7 @@ package Sinfo is
pragma Inline (Set_Next_Named_Actual);
pragma Inline (Set_Next_Use_Clause);
pragma Inline (Set_No_Ctrl_Actions);
+ pragma Inline (Set_No_Elaboration_Check);
pragma Inline (Set_No_Entities_Ref_In_Spec);
pragma Inline (Set_No_Initialization);
pragma Inline (Set_No_Truncation);
diff --git a/gcc/ada/sinfo.h b/gcc/ada/sinfo.h
deleted file mode 100644
index fd5d13d2b89..00000000000
--- a/gcc/ada/sinfo.h
+++ /dev/null
@@ -1,840 +0,0 @@
-/*--------------------------------------------------------------------------*/
-/* */
-/* GNAT COMPILER COMPONENTS */
-/* */
-/* S I N F O */
-/* */
-/* C Header File */
-/* */
-/* Copyright (C) 1992-2003, Free Software Foundation, Inc. */
-/* */
-/* GNAT is free software; you can redistribute it and/or modify it under */
-/* terms of the GNU General Public License as published by the Free Soft- */
-/* ware Foundation; either version 2, or (at your option) any later ver- */
-/* sion. GNAT is distributed in the hope that it will be useful, but WITH- */
-/* OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY */
-/* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License */
-/* for more details. You should have received a copy of the GNU General */
-/* Public License distributed with GNAT; see 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 other files instantiate generics from this */
-/* unit, or you link this unit with other files to produce an executable, */
-/* this unit does not by itself cause the resulting executable to be */
-/* covered by the GNU General Public License. This exception does not */
-/* however invalidate any other reasons why the executable file might be */
-/* covered by the GNU Public License. */
-/* */
-/* GNAT was originally developed by the GNAT team at New York University. */
-/* Extensive contributions were provided by Ada Core Technologies Inc. */
-/* */
-/*--------------------------------------------------------------------------*/
-
- #define N_Unused_At_Start 0
- #define N_At_Clause 1
- #define N_Component_Clause 2
- #define N_Enumeration_Representation_Clause 3
- #define N_Mod_Clause 4
- #define N_Record_Representation_Clause 5
- #define N_Attribute_Definition_Clause 6
- #define N_Empty 7
- #define N_Pragma 8
- #define N_Pragma_Argument_Association 9
- #define N_Error 10
- #define N_Defining_Character_Literal 11
- #define N_Defining_Identifier 12
- #define N_Defining_Operator_Symbol 13
- #define N_Expanded_Name 14
- #define N_Identifier 15
- #define N_Operator_Symbol 16
- #define N_Character_Literal 17
- #define N_Op_Add 18
- #define N_Op_Concat 19
- #define N_Op_Expon 20
- #define N_Op_Subtract 21
- #define N_Op_Divide 22
- #define N_Op_Mod 23
- #define N_Op_Multiply 24
- #define N_Op_Rem 25
- #define N_Op_And 26
- #define N_Op_Eq 27
- #define N_Op_Ge 28
- #define N_Op_Gt 29
- #define N_Op_Le 30
- #define N_Op_Lt 31
- #define N_Op_Ne 32
- #define N_Op_Or 33
- #define N_Op_Xor 34
- #define N_Op_Rotate_Left 35
- #define N_Op_Rotate_Right 36
- #define N_Op_Shift_Left 37
- #define N_Op_Shift_Right 38
- #define N_Op_Shift_Right_Arithmetic 39
- #define N_Op_Abs 40
- #define N_Op_Minus 41
- #define N_Op_Not 42
- #define N_Op_Plus 43
- #define N_Attribute_Reference 44
- #define N_And_Then 45
- #define N_Conditional_Expression 46
- #define N_Explicit_Dereference 47
- #define N_Function_Call 48
- #define N_In 49
- #define N_Indexed_Component 50
- #define N_Integer_Literal 51
- #define N_Not_In 52
- #define N_Null 53
- #define N_Or_Else 54
- #define N_Procedure_Call_Statement 55
- #define N_Qualified_Expression 56
- #define N_Raise_Constraint_Error 57
- #define N_Raise_Program_Error 58
- #define N_Raise_Storage_Error 59
- #define N_Aggregate 60
- #define N_Allocator 61
- #define N_Extension_Aggregate 62
- #define N_Range 63
- #define N_Real_Literal 64
- #define N_Reference 65
- #define N_Selected_Component 66
- #define N_Slice 67
- #define N_String_Literal 68
- #define N_Subprogram_Info 69
- #define N_Type_Conversion 70
- #define N_Unchecked_Expression 71
- #define N_Unchecked_Type_Conversion 72
- #define N_Subtype_Indication 73
- #define N_Component_Declaration 74
- #define N_Entry_Declaration 75
- #define N_Formal_Object_Declaration 76
- #define N_Formal_Type_Declaration 77
- #define N_Full_Type_Declaration 78
- #define N_Incomplete_Type_Declaration 79
- #define N_Loop_Parameter_Specification 80
- #define N_Object_Declaration 81
- #define N_Protected_Type_Declaration 82
- #define N_Private_Extension_Declaration 83
- #define N_Private_Type_Declaration 84
- #define N_Subtype_Declaration 85
- #define N_Function_Specification 86
- #define N_Procedure_Specification 87
- #define N_Entry_Index_Specification 88
- #define N_Freeze_Entity 89
- #define N_Access_Function_Definition 90
- #define N_Access_Procedure_Definition 91
- #define N_Task_Type_Declaration 92
- #define N_Package_Body_Stub 93
- #define N_Protected_Body_Stub 94
- #define N_Subprogram_Body_Stub 95
- #define N_Task_Body_Stub 96
- #define N_Function_Instantiation 97
- #define N_Package_Instantiation 98
- #define N_Procedure_Instantiation 99
- #define N_Package_Body 100
- #define N_Subprogram_Body 101
- #define N_Protected_Body 102
- #define N_Task_Body 103
- #define N_Implicit_Label_Declaration 104
- #define N_Package_Declaration 105
- #define N_Single_Task_Declaration 106
- #define N_Subprogram_Declaration 107
- #define N_Use_Package_Clause 108
- #define N_Generic_Package_Declaration 109
- #define N_Generic_Subprogram_Declaration 110
- #define N_Constrained_Array_Definition 111
- #define N_Unconstrained_Array_Definition 112
- #define N_Exception_Renaming_Declaration 113
- #define N_Object_Renaming_Declaration 114
- #define N_Package_Renaming_Declaration 115
- #define N_Subprogram_Renaming_Declaration 116
- #define N_Generic_Function_Renaming_Declaration 117
- #define N_Generic_Package_Renaming_Declaration 118
- #define N_Generic_Procedure_Renaming_Declaration 119
- #define N_Abort_Statement 120
- #define N_Accept_Statement 121
- #define N_Assignment_Statement 122
- #define N_Asynchronous_Select 123
- #define N_Block_Statement 124
- #define N_Case_Statement 125
- #define N_Code_Statement 126
- #define N_Conditional_Entry_Call 127
- #define N_Delay_Relative_Statement 128
- #define N_Delay_Until_Statement 129
- #define N_Entry_Call_Statement 130
- #define N_Free_Statement 131
- #define N_Goto_Statement 132
- #define N_Loop_Statement 133
- #define N_Null_Statement 134
- #define N_Raise_Statement 135
- #define N_Requeue_Statement 136
- #define N_Return_Statement 137
- #define N_Selective_Accept 138
- #define N_Timed_Entry_Call 139
- #define N_Exit_Statement 140
- #define N_If_Statement 141
- #define N_Accept_Alternative 142
- #define N_Delay_Alternative 143
- #define N_Elsif_Part 144
- #define N_Entry_Body_Formal_Part 145
- #define N_Iteration_Scheme 146
- #define N_Terminate_Alternative 147
- #define N_Abortable_Part 148
- #define N_Abstract_Subprogram_Declaration 149
- #define N_Access_Definition 150
- #define N_Access_To_Object_Definition 151
- #define N_Case_Statement_Alternative 152
- #define N_Compilation_Unit 153
- #define N_Compilation_Unit_Aux 154
- #define N_Component_Association 155
- #define N_Component_List 156
- #define N_Derived_Type_Definition 157
- #define N_Decimal_Fixed_Point_Definition 158
- #define N_Defining_Program_Unit_Name 159
- #define N_Delta_Constraint 160
- #define N_Designator 161
- #define N_Digits_Constraint 162
- #define N_Discriminant_Association 163
- #define N_Discriminant_Specification 164
- #define N_Enumeration_Type_Definition 165
- #define N_Entry_Body 166
- #define N_Entry_Call_Alternative 167
- #define N_Exception_Declaration 168
- #define N_Exception_Handler 169
- #define N_Floating_Point_Definition 170
- #define N_Formal_Decimal_Fixed_Point_Definition 171
- #define N_Formal_Derived_Type_Definition 172
- #define N_Formal_Discrete_Type_Definition 173
- #define N_Formal_Floating_Point_Definition 174
- #define N_Formal_Modular_Type_Definition 175
- #define N_Formal_Ordinary_Fixed_Point_Definition 176
- #define N_Formal_Package_Declaration 177
- #define N_Formal_Private_Type_Definition 178
- #define N_Formal_Signed_Integer_Type_Definition 179
- #define N_Formal_Subprogram_Declaration 180
- #define N_Generic_Association 181
- #define N_Handled_Sequence_Of_Statements 182
- #define N_Index_Or_Discriminant_Constraint 183
- #define N_Itype_Reference 184
- #define N_Label 185
- #define N_Modular_Type_Definition 186
- #define N_Number_Declaration 187
- #define N_Ordinary_Fixed_Point_Definition 188
- #define N_Others_Choice 189
- #define N_Package_Specification 190
- #define N_Parameter_Association 191
- #define N_Parameter_Specification 192
- #define N_Protected_Definition 193
- #define N_Range_Constraint 194
- #define N_Real_Range_Specification 195
- #define N_Record_Definition 196
- #define N_Signed_Integer_Type_Definition 197
- #define N_Single_Protected_Declaration 198
- #define N_Subunit 199
- #define N_Task_Definition 200
- #define N_Triggering_Alternative 201
- #define N_Use_Type_Clause 202
- #define N_Validate_Unchecked_Conversion 203
- #define N_Variant 204
- #define N_Variant_Part 205
- #define N_With_Clause 206
- #define N_With_Type_Clause 207
- #define N_Unused_At_End 208
-
- #define Number_Node_Kinds 209
- SUBTYPE (N_Access_To_Subprogram_Definition, Node_Kind,
- N_Access_Function_Definition,
- N_Access_Procedure_Definition)
- SUBTYPE (N_Array_Type_Definition, Node_Kind,
- N_Constrained_Array_Definition,
- N_Unconstrained_Array_Definition)
- SUBTYPE (N_Binary_Op, Node_Kind,
- N_Op_Add,
- N_Op_Shift_Right_Arithmetic)
- SUBTYPE (N_Body_Stub, Node_Kind,
- N_Package_Body_Stub,
- N_Task_Body_Stub)
- SUBTYPE (N_Declaration, Node_Kind,
- N_Component_Declaration,
- N_Procedure_Specification)
- SUBTYPE (N_Direct_Name, Node_Kind,
- N_Identifier,
- N_Character_Literal)
- SUBTYPE (N_Entity, Node_Kind,
- N_Defining_Character_Literal,
- N_Defining_Operator_Symbol)
- SUBTYPE (N_Generic_Declaration, Node_Kind,
- N_Generic_Package_Declaration,
- N_Generic_Subprogram_Declaration)
- SUBTYPE (N_Generic_Instantiation, Node_Kind,
- N_Function_Instantiation,
- N_Procedure_Instantiation)
- SUBTYPE (N_Generic_Renaming_Declaration, Node_Kind,
- N_Generic_Function_Renaming_Declaration,
- N_Generic_Procedure_Renaming_Declaration)
- SUBTYPE (N_Has_Chars, Node_Kind,
- N_Attribute_Definition_Clause,
- N_Op_Plus)
- SUBTYPE (N_Has_Entity, Node_Kind,
- N_Expanded_Name,
- N_Attribute_Reference)
- SUBTYPE (N_Has_Etype, Node_Kind,
- N_Error,
- N_Subtype_Indication)
- SUBTYPE (N_Has_Treat_Fixed_As_Integer, Node_Kind,
- N_Op_Divide,
- N_Op_Rem)
- SUBTYPE (N_Later_Decl_Item, Node_Kind,
- N_Task_Type_Declaration,
- N_Generic_Subprogram_Declaration)
- SUBTYPE (N_Op, Node_Kind,
- N_Op_Add,
- N_Op_Plus)
- SUBTYPE (N_Op_Boolean, Node_Kind,
- N_Op_And,
- N_Op_Xor)
- SUBTYPE (N_Op_Compare, Node_Kind,
- N_Op_Eq,
- N_Op_Ne)
- SUBTYPE (N_Op_Shift, Node_Kind,
- N_Op_Rotate_Left,
- N_Op_Shift_Right_Arithmetic)
- SUBTYPE (N_Proper_Body, Node_Kind,
- N_Package_Body,
- N_Task_Body)
- SUBTYPE (N_Raise_xxx_Error, Node_Kind,
- N_Raise_Constraint_Error,
- N_Raise_Storage_Error)
- SUBTYPE (N_Renaming_Declaration, Node_Kind,
- N_Exception_Renaming_Declaration,
- N_Generic_Procedure_Renaming_Declaration)
- SUBTYPE (N_Representation_Clause, Node_Kind,
- N_At_Clause,
- N_Attribute_Definition_Clause)
- SUBTYPE (N_Statement_Other_Than_Procedure_Call, Node_Kind,
- N_Abort_Statement,
- N_If_Statement)
- SUBTYPE (N_Has_Condition, Node_Kind,
- N_Exit_Statement,
- N_Terminate_Alternative)
- SUBTYPE (N_Subexpr, Node_Kind,
- N_Expanded_Name,
- N_Unchecked_Type_Conversion)
- SUBTYPE (N_Subprogram_Specification, Node_Kind,
- N_Function_Specification,
- N_Procedure_Specification)
- SUBTYPE (N_Unary_Op, Node_Kind,
- N_Op_Abs,
- N_Op_Plus)
- SUBTYPE (N_Unit_Body, Node_Kind,
- N_Package_Body,
- N_Subprogram_Body)
- INLINE Boolean ABE_Is_Certain (Node_Id N)
- { return Flag18 (N); }
- INLINE Boolean Abort_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Node_Id Abortable_Part (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean Abstract_Present (Node_Id N)
- { return Flag4 (N); }
- INLINE List_Id Accept_Handler_Records (Node_Id N)
- { return List5 (N); }
- INLINE Node_Id Accept_Statement (Node_Id N)
- { return Node2 (N); }
- INLINE Elist_Id Access_Types_To_Process (Node_Id N)
- { return Elist2 (N); }
- INLINE List_Id Actions (Node_Id N)
- { return List1 (N); }
- INLINE Node_Id Activation_Chain_Entity (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Acts_As_Spec (Node_Id N)
- { return Flag4 (N); }
- INLINE Node_Id Aggregate_Bounds (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Aliased_Present (Node_Id N)
- { return Flag4 (N); }
- INLINE Boolean All_Others (Node_Id N)
- { return Flag11 (N); }
- INLINE Boolean All_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE List_Id Alternatives (Node_Id N)
- { return List4 (N); }
- INLINE Node_Id Ancestor_Part (Node_Id N)
- { return Node3 (N); }
- INLINE Node_Id Array_Aggregate (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Assignment_OK (Node_Id N)
- { return Flag15 (N); }
- INLINE Node_Id Associated_Node (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id At_End_Proc (Node_Id N)
- { return Node1 (N); }
- INLINE Name_Id Attribute_Name (Node_Id N)
- { return Name2 (N); }
- INLINE Node_Id Aux_Decls_Node (Node_Id N)
- { return Node5 (N); }
- INLINE Boolean Backwards_OK (Node_Id N)
- { return Flag6 (N); }
- INLINE Boolean Bad_Is_Detected (Node_Id N)
- { return Flag15 (N); }
- INLINE Boolean By_Ref (Node_Id N)
- { return Flag5 (N); }
- INLINE Boolean Body_Required (Node_Id N)
- { return Flag13 (N); }
- INLINE Node_Id Body_To_Inline (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Box_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Char_Code Char_Literal_Value (Node_Id N)
- { return Char_Code2 (N); }
- INLINE Name_Id Chars (Node_Id N)
- { return Name1 (N); }
- INLINE Boolean Check_Address_Alignment (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Choice_Parameter (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Choices (Node_Id N)
- { return List1 (N); }
- INLINE Boolean Compile_Time_Known_Aggregate (Node_Id N)
- { return Flag18 (N); }
- INLINE List_Id Component_Associations (Node_Id N)
- { return List2 (N); }
- INLINE List_Id Component_Clauses (Node_Id N)
- { return List3 (N); }
- INLINE List_Id Component_Items (Node_Id N)
- { return List3 (N); }
- INLINE Node_Id Component_List (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Component_Name (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Condition (Node_Id N)
- { return Node1 (N); }
- INLINE List_Id Condition_Actions (Node_Id N)
- { return List3 (N); }
- INLINE List_Id Config_Pragmas (Node_Id N)
- { return List4 (N); }
- INLINE Boolean Constant_Present (Node_Id N)
- { return Flag17 (N); }
- INLINE Node_Id Constraint (Node_Id N)
- { return Node3 (N); }
- INLINE List_Id Constraints (Node_Id N)
- { return List1 (N); }
- INLINE Boolean Context_Installed (Node_Id N)
- { return Flag13 (N); }
- INLINE List_Id Context_Items (Node_Id N)
- { return List1 (N); }
- INLINE Node_Id Controlling_Argument (Node_Id N)
- { return Node1 (N); }
- INLINE Boolean Conversion_OK (Node_Id N)
- { return Flag14 (N); }
- INLINE Node_Id Corresponding_Body (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Corresponding_Generic_Association (Node_Id N)
- { return Node5 (N); }
- INLINE Uint Corresponding_Integer_Value (Node_Id N)
- { return Uint4 (N); }
- INLINE Node_Id Corresponding_Spec (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Corresponding_Stub (Node_Id N)
- { return Node3 (N); }
- INLINE Entity_Id Dcheck_Function (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Debug_Statement (Node_Id N)
- { return Node3 (N); }
- INLINE List_Id Declarations (Node_Id N)
- { return List2 (N); }
- INLINE Node_Id Default_Expression (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Default_Name (Node_Id N)
- { return Node2 (N); }
- INLINE Entity_Id Defining_Identifier (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Defining_Unit_Name (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Delay_Alternative (Node_Id N)
- { return Node4 (N); }
- INLINE Boolean Delay_Finalize_Attach (Node_Id N)
- { return Flag14 (N); }
- INLINE Node_Id Delay_Statement (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Delta_Expression (Node_Id N)
- { return Node3 (N); }
- INLINE Node_Id Digits_Expression (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean Discr_Check_Funcs_Built (Node_Id N)
- { return Flag11 (N); }
- INLINE List_Id Discrete_Choices (Node_Id N)
- { return List4 (N); }
- INLINE Node_Id Discrete_Range (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Discrete_Subtype_Definition (Node_Id N)
- { return Node4 (N); }
- INLINE List_Id Discrete_Subtype_Definitions (Node_Id N)
- { return List2 (N); }
- INLINE List_Id Discriminant_Specifications (Node_Id N)
- { return List4 (N); }
- INLINE Node_Id Discriminant_Type (Node_Id N)
- { return Node5 (N); }
- INLINE Boolean Do_Accessibility_Check (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Do_Discriminant_Check (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Do_Division_Check (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Do_Length_Check (Node_Id N)
- { return Flag4 (N); }
- INLINE Boolean Do_Overflow_Check (Node_Id N)
- { return Flag17 (N); }
- INLINE Boolean Do_Range_Check (Node_Id N)
- { return Flag9 (N); }
- INLINE Boolean Do_Storage_Check (Node_Id N)
- { return Flag17 (N); }
- INLINE Boolean Do_Tag_Check (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Elaborate_All_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Boolean Elaborate_Present (Node_Id N)
- { return Flag4 (N); }
- INLINE Node_Id Elaboration_Boolean (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Else_Actions (Node_Id N)
- { return List3 (N); }
- INLINE List_Id Else_Statements (Node_Id N)
- { return List4 (N); }
- INLINE List_Id Elsif_Parts (Node_Id N)
- { return List3 (N); }
- INLINE Node_Id Enclosing_Variant (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id End_Label (Node_Id N)
- { return Node4 (N); }
- INLINE Uint End_Span (Node_Id N)
- { return Uint5 (N); }
- INLINE Node_Id Entity (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Entry_Body_Formal_Part (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Entry_Call_Alternative (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Entry_Call_Statement (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Entry_Direct_Name (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Entry_Index (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Entry_Index_Specification (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Etype (Node_Id N)
- { return Node5 (N); }
- INLINE List_Id Exception_Choices (Node_Id N)
- { return List4 (N); }
- INLINE List_Id Exception_Handlers (Node_Id N)
- { return List5 (N); }
- INLINE Boolean Exception_Junk (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Explicit_Actual_Parameter (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Expansion_Delayed (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Explicit_Generic_Actual_Parameter (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Expression (Node_Id N)
- { return Node3 (N); }
- INLINE List_Id Expressions (Node_Id N)
- { return List1 (N); }
- INLINE Node_Id First_Bit (Node_Id N)
- { return Node3 (N); }
- INLINE Entity_Id First_Inlined_Subprogram (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean First_Name (Node_Id N)
- { return Flag5 (N); }
- INLINE Node_Id First_Named_Actual (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id First_Real_Statement (Node_Id N)
- { return Node2 (N); }
- INLINE Entity_Id First_Subtype_Link (Node_Id N)
- { return Node5 (N); }
- INLINE Boolean Float_Truncate (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Formal_Type_Definition (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Forwards_OK (Node_Id N)
- { return Flag5 (N); }
- INLINE Boolean From_At_Mod (Node_Id N)
- { return Flag4 (N); }
- INLINE List_Id Generic_Associations (Node_Id N)
- { return List3 (N); }
- INLINE List_Id Generic_Formal_Declarations (Node_Id N)
- { return List2 (N); }
- INLINE Node_Id Generic_Parent (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Generic_Parent_Type (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Handled_Statement_Sequence (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Handler_List_Entry (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean Has_Created_Identifier (Node_Id N)
- { return Flag15 (N); }
- INLINE Boolean Has_Dynamic_Length_Check (Node_Id N)
- { return Flag10 (N); }
- INLINE Boolean Has_Dynamic_Range_Check (Node_Id N)
- { return Flag12 (N); }
- INLINE Boolean Has_No_Elaboration_Code (Node_Id N)
- { return Flag17 (N); }
- INLINE Boolean Has_Priority_Pragma (Node_Id N)
- { return Flag6 (N); }
- INLINE Boolean Has_Private_View (Node_Id N)
- { return Flag11 (N); }
- INLINE Boolean Has_Storage_Size_Pragma (Node_Id N)
- { return Flag5 (N); }
- INLINE Boolean Has_Task_Info_Pragma (Node_Id N)
- { return Flag7 (N); }
- INLINE Boolean Has_Task_Name_Pragma (Node_Id N)
- { return Flag8 (N); }
- INLINE Boolean Has_Wide_Character (Node_Id N)
- { return Flag11 (N); }
- INLINE Elist_Id Hidden_By_Use_Clause (Node_Id N)
- { return Elist4 (N); }
- INLINE Node_Id High_Bound (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Identifier (Node_Id N)
- { return Node1 (N); }
- INLINE Boolean Implicit_With (Node_Id N)
- { return Flag16 (N); }
- INLINE Boolean In_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Boolean Includes_Infinities (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Instance_Spec (Node_Id N)
- { return Node5 (N); }
- INLINE Uint Intval (Node_Id N)
- { return Uint3 (N); }
- INLINE Boolean Is_Asynchronous_Call_Block (Node_Id N)
- { return Flag7 (N); }
- INLINE Boolean Is_Component_Left_Opnd (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Is_Component_Right_Opnd (Node_Id N)
- { return Flag14 (N); }
- INLINE Boolean Is_Controlling_Actual (Node_Id N)
- { return Flag16 (N); }
- INLINE Boolean Is_In_Discriminant_Check (Node_Id N)
- { return Flag11 (N); }
- INLINE Boolean Is_Machine_Number (Node_Id N)
- { return Flag11 (N); }
- INLINE Boolean Is_Null_Loop (Node_Id N)
- { return Flag16 (N); }
- INLINE Boolean Is_Overloaded (Node_Id N)
- { return Flag5 (N); }
- INLINE Boolean Is_Power_Of_2_For_Shift (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Is_Protected_Subprogram_Body (Node_Id N)
- { return Flag7 (N); }
- INLINE Boolean Is_Static_Expression (Node_Id N)
- { return Flag6 (N); }
- INLINE Boolean Is_Subprogram_Descriptor (Node_Id N)
- { return Flag16 (N); }
- INLINE Boolean Is_Task_Allocation_Block (Node_Id N)
- { return Flag6 (N); }
- INLINE Boolean Is_Task_Master (Node_Id N)
- { return Flag5 (N); }
- INLINE Node_Id Iteration_Scheme (Node_Id N)
- { return Node2 (N); }
- INLINE Entity_Id Itype (Node_Id N)
- { return Node1 (N); }
- INLINE Boolean Kill_Range_Check (Node_Id N)
- { return Flag11 (N); }
- INLINE Node_Id Label_Construct (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Left_Opnd (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Last_Bit (Node_Id N)
- { return Node4 (N); }
- INLINE Boolean Last_Name (Node_Id N)
- { return Flag6 (N); }
- INLINE Node_Id Library_Unit (Node_Id N)
- { return Node4 (N); }
- INLINE Boolean Limited_View_Installed (Node_Id N)
- { return Flag18 (N); }
- INLINE Boolean Limited_Present (Node_Id N)
- { return Flag17 (N); }
- INLINE List_Id Literals (Node_Id N)
- { return List1 (N); }
- INLINE List_Id Loop_Actions (Node_Id N)
- { return List2 (N); }
- INLINE Node_Id Loop_Parameter_Specification (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Low_Bound (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Mod_Clause (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean More_Ids (Node_Id N)
- { return Flag5 (N); }
- INLINE Boolean Must_Be_Byte_Aligned (Node_Id N)
- { return Flag14 (N); }
- INLINE Boolean Must_Not_Freeze (Node_Id N)
- { return Flag8 (N); }
- INLINE Node_Id Name (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Names (Node_Id N)
- { return List2 (N); }
- INLINE Node_Id Next_Entity (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Next_Named_Actual (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Next_Rep_Item (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Next_Use_Clause (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean No_Ctrl_Actions (Node_Id N)
- { return Flag7 (N); }
- INLINE Boolean No_Entities_Ref_In_Spec (Node_Id N)
- { return Flag8 (N); }
- INLINE Boolean No_Initialization (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean No_Truncation (Node_Id N)
- { return Flag17 (N); }
- INLINE Boolean Null_Present (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Null_Record_Present (Node_Id N)
- { return Flag17 (N); }
- INLINE Node_Id Object_Definition (Node_Id N)
- { return Node4 (N); }
- INLINE Boolean OK_For_Stream (Node_Id N)
- { return Flag4 (N); }
- INLINE Node_Id Original_Discriminant (Node_Id N)
- { return Node2 (N); }
- INLINE Entity_Id Original_Entity (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Others_Discrete_Choices (Node_Id N)
- { return List1 (N); }
- INLINE Boolean Out_Present (Node_Id N)
- { return Flag17 (N); }
- INLINE List_Id Parameter_Associations (Node_Id N)
- { return List3 (N); }
- INLINE Boolean Parameter_List_Truncated (Node_Id N)
- { return Flag17 (N); }
- INLINE List_Id Parameter_Specifications (Node_Id N)
- { return List3 (N); }
- INLINE Node_Id Parameter_Type (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Parent_Spec (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Position (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Pragma_Argument_Associations (Node_Id N)
- { return List2 (N); }
- INLINE List_Id Pragmas_After (Node_Id N)
- { return List5 (N); }
- INLINE List_Id Pragmas_Before (Node_Id N)
- { return List4 (N); }
- INLINE Node_Id Prefix (Node_Id N)
- { return Node3 (N); }
- INLINE Uint Present_Expr (Node_Id N)
- { return Uint3 (N); }
- INLINE Boolean Prev_Ids (Node_Id N)
- { return Flag6 (N); }
- INLINE Boolean Print_In_Hex (Node_Id N)
- { return Flag13 (N); }
- INLINE List_Id Private_Declarations (Node_Id N)
- { return List3 (N); }
- INLINE Boolean Private_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Node_Id Procedure_To_Call (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Proper_Body (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Protected_Definition (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Protected_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Boolean Raises_Constraint_Error (Node_Id N)
- { return Flag7 (N); }
- INLINE Node_Id Range_Constraint (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Range_Expression (Node_Id N)
- { return Node4 (N); }
- INLINE Node_Id Real_Range_Specification (Node_Id N)
- { return Node4 (N); }
- INLINE Ureal Realval (Node_Id N)
- { return Ureal3 (N); }
- INLINE Uint Reason (Node_Id N)
- { return Uint3 (N); }
- INLINE Node_Id Record_Extension_Part (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Redundant_Use (Node_Id N)
- { return Flag13 (N); }
- INLINE Node_Id Return_Type (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean Reverse_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Node_Id Right_Opnd (Node_Id N)
- { return Node3 (N); }
- INLINE Boolean Rounded_Result (Node_Id N)
- { return Flag18 (N); }
- INLINE Node_Id Scope (Node_Id N)
- { return Node3 (N); }
- INLINE List_Id Select_Alternatives (Node_Id N)
- { return List1 (N); }
- INLINE Node_Id Selector_Name (Node_Id N)
- { return Node2 (N); }
- INLINE List_Id Selector_Names (Node_Id N)
- { return List1 (N); }
- INLINE Boolean Shift_Count_OK (Node_Id N)
- { return Flag4 (N); }
- INLINE Entity_Id Source_Type (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Specification (Node_Id N)
- { return Node1 (N); }
- INLINE List_Id Statements (Node_Id N)
- { return List3 (N); }
- INLINE Boolean Static_Processing_OK (Node_Id N)
- { return Flag4 (N); }
- INLINE Node_Id Storage_Pool (Node_Id N)
- { return Node1 (N); }
- INLINE String_Id Strval (Node_Id N)
- { return Str3 (N); }
- INLINE Node_Id Subtype_Indication (Node_Id N)
- { return Node5 (N); }
- INLINE Node_Id Subtype_Mark (Node_Id N)
- { return Node4 (N); }
- INLINE List_Id Subtype_Marks (Node_Id N)
- { return List2 (N); }
- INLINE Boolean Tagged_Present (Node_Id N)
- { return Flag15 (N); }
- INLINE Entity_Id Target_Type (Node_Id N)
- { return Node2 (N); }
- INLINE Entity_Id Task_Body_Procedure (Node_Id N)
- { return Node2 (N); }
- INLINE Node_Id Task_Definition (Node_Id N)
- { return Node3 (N); }
- INLINE List_Id Then_Actions (Node_Id N)
- { return List2 (N); }
- INLINE List_Id Then_Statements (Node_Id N)
- { return List2 (N); }
- INLINE Boolean Treat_Fixed_As_Integer (Node_Id N)
- { return Flag14 (N); }
- INLINE Node_Id Triggering_Alternative (Node_Id N)
- { return Node1 (N); }
- INLINE Node_Id Triggering_Statement (Node_Id N)
- { return Node1 (N); }
- INLINE Elist_Id TSS_Elist (Node_Id N)
- { return Elist3 (N); }
- INLINE Node_Id Type_Definition (Node_Id N)
- { return Node3 (N); }
- INLINE Node_Id Unit (Node_Id N)
- { return Node2 (N); }
- INLINE Boolean Unknown_Discriminants_Present (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Unreferenced_In_Spec (Node_Id N)
- { return Flag7 (N); }
- INLINE Node_Id Variant_Part (Node_Id N)
- { return Node4 (N); }
- INLINE List_Id Variants (Node_Id N)
- { return List1 (N); }
- INLINE List_Id Visible_Declarations (Node_Id N)
- { return List2 (N); }
- INLINE Boolean Was_Originally_Stub (Node_Id N)
- { return Flag13 (N); }
- INLINE Boolean Zero_Cost_Handling (Node_Id N)
- { return Flag5 (N); }
-
diff --git a/gcc/ada/sinput-p.adb b/gcc/ada/sinput-p.adb
index 5edc13bf9ae..89befb6a0c6 100644
--- a/gcc/ada/sinput-p.adb
+++ b/gcc/ada/sinput-p.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -24,7 +24,6 @@
-- --
------------------------------------------------------------------------------
-with Prj; use Prj;
with Prj.Err;
with Sinput.C;
@@ -97,7 +96,7 @@ package body Sinput.P is
or else Token = Tok_Private
or else (Token not in Token_Class_Cunit and then Token /= Tok_EOF)
loop
- Scan;
+ Prj.Err.Scanner.Scan;
end loop;
return Token = Tok_Separate;
diff --git a/gcc/ada/sinput.adb b/gcc/ada/sinput.adb
index 25b74a8c694..3ab47c7106a 100644
--- a/gcc/ada/sinput.adb
+++ b/gcc/ada/sinput.adb
@@ -1110,17 +1110,31 @@ package body Sinput is
function Source_First (S : SFI) return Source_Ptr is
begin
- return Source_File.Table (S).Source_First;
+ if S = Internal_Source_File then
+ return Internal_Source'First;
+ else
+ return Source_File.Table (S).Source_First;
+ end if;
end Source_First;
function Source_Last (S : SFI) return Source_Ptr is
begin
- return Source_File.Table (S).Source_Last;
+ if S = Internal_Source_File then
+ return Internal_Source'Last;
+ else
+ return Source_File.Table (S).Source_Last;
+ end if;
+
end Source_Last;
function Source_Text (S : SFI) return Source_Buffer_Ptr is
begin
- return Source_File.Table (S).Source_Text;
+ if S = Internal_Source_File then
+ return Internal_Source_Ptr;
+ else
+ return Source_File.Table (S).Source_Text;
+ end if;
+
end Source_Text;
function Template (S : SFI) return SFI is
diff --git a/gcc/ada/snames.adb b/gcc/ada/snames.adb
index 944fe9c397c..85294fe3159 100644
--- a/gcc/ada/snames.adb
+++ b/gcc/ada/snames.adb
@@ -62,8 +62,8 @@ package body Snames is
"off#" &
"space#" &
"time#" &
- "_alignment#" &
"_abort_signal#" &
+ "_alignment#" &
"_assign#" &
"_chain#" &
"_clean#" &
@@ -77,6 +77,8 @@ package body Snames is
"_master#" &
"_object#" &
"_priority#" &
+ "_process_atsd#" &
+ "_secondary_stack#" &
"_service#" &
"_size#" &
"_tags#" &
@@ -274,6 +276,7 @@ package body Snames is
"task_info#" &
"task_name#" &
"task_storage#" &
+ "thread_body#" &
"time_slice#" &
"title#" &
"unchecked_union#" &
@@ -336,6 +339,7 @@ package body Snames is
"result_type#" &
"runtime#" &
"sb#" &
+ "secondary_stack_size#" &
"section#" &
"semaphore#" &
"spec_file_name#" &
@@ -614,8 +618,10 @@ package body Snames is
"library_kind#" &
"library_name#" &
"library_options#" &
+ "library_reference_symbol_file#" &
"library_src_dir#" &
"library_symbol_file#" &
+ "library_symbol_policy#" &
"library_version#" &
"linker#" &
"local_configuration_pragmas#" &
diff --git a/gcc/ada/snames.ads b/gcc/ada/snames.ads
index 3d1705e584c..df33ca06bb0 100644
--- a/gcc/ada/snames.ads
+++ b/gcc/ada/snames.ads
@@ -145,8 +145,8 @@ package Snames is
-- at the start of these names get translated to extra underscores. These
-- names are only referenced internally by expander generated code.
- Name_uAlignment : constant Name_Id := N + 005;
- Name_uAbort_Signal : constant Name_Id := N + 006;
+ Name_uAbort_Signal : constant Name_Id := N + 005;
+ Name_uAlignment : constant Name_Id := N + 006;
Name_uAssign : constant Name_Id := N + 007;
Name_uChain : constant Name_Id := N + 008;
Name_uClean : constant Name_Id := N + 009;
@@ -160,113 +160,115 @@ package Snames is
Name_uMaster : constant Name_Id := N + 017;
Name_uObject : constant Name_Id := N + 018;
Name_uPriority : constant Name_Id := N + 019;
- Name_uService : constant Name_Id := N + 020;
- Name_uSize : constant Name_Id := N + 021;
- Name_uTags : constant Name_Id := N + 022;
- Name_uTask : constant Name_Id := N + 023;
- Name_uTask_Id : constant Name_Id := N + 024;
- Name_uTask_Info : constant Name_Id := N + 025;
- Name_uTask_Name : constant Name_Id := N + 026;
- Name_uTrace_Sp : constant Name_Id := N + 027;
+ Name_uProcess_ATSD : constant Name_Id := N + 020;
+ Name_uSecondary_Stack : constant Name_Id := N + 021;
+ Name_uService : constant Name_Id := N + 022;
+ Name_uSize : constant Name_Id := N + 023;
+ Name_uTags : constant Name_Id := N + 024;
+ Name_uTask : constant Name_Id := N + 025;
+ Name_uTask_Id : constant Name_Id := N + 026;
+ Name_uTask_Info : constant Name_Id := N + 027;
+ Name_uTask_Name : constant Name_Id := N + 028;
+ Name_uTrace_Sp : constant Name_Id := N + 029;
-- Names of routines in Ada.Finalization, needed by expander
- Name_Initialize : constant Name_Id := N + 028;
- Name_Adjust : constant Name_Id := N + 029;
- Name_Finalize : constant Name_Id := N + 030;
+ Name_Initialize : constant Name_Id := N + 030;
+ Name_Adjust : constant Name_Id := N + 031;
+ Name_Finalize : constant Name_Id := N + 032;
-- Names of fields declared in System.Finalization_Implementation,
-- needed by the expander when generating code for finalization.
- Name_Next : constant Name_Id := N + 031;
- Name_Prev : constant Name_Id := N + 032;
+ Name_Next : constant Name_Id := N + 033;
+ Name_Prev : constant Name_Id := N + 034;
-- Names of allocation routines, also needed by expander
- Name_Allocate : constant Name_Id := N + 033;
- Name_Deallocate : constant Name_Id := N + 034;
- Name_Dereference : constant Name_Id := N + 035;
+ Name_Allocate : constant Name_Id := N + 035;
+ Name_Deallocate : constant Name_Id := N + 036;
+ Name_Dereference : constant Name_Id := N + 037;
-- Names of Text_IO generic subpackages (see Rtsfind.Text_IO_Kludge)
- First_Text_IO_Package : constant Name_Id := N + 036;
- Name_Decimal_IO : constant Name_Id := N + 036;
- Name_Enumeration_IO : constant Name_Id := N + 037;
- Name_Fixed_IO : constant Name_Id := N + 038;
- Name_Float_IO : constant Name_Id := N + 039;
- Name_Integer_IO : constant Name_Id := N + 040;
- Name_Modular_IO : constant Name_Id := N + 041;
- Last_Text_IO_Package : constant Name_Id := N + 041;
+ First_Text_IO_Package : constant Name_Id := N + 038;
+ Name_Decimal_IO : constant Name_Id := N + 038;
+ Name_Enumeration_IO : constant Name_Id := N + 039;
+ Name_Fixed_IO : constant Name_Id := N + 040;
+ Name_Float_IO : constant Name_Id := N + 041;
+ Name_Integer_IO : constant Name_Id := N + 042;
+ Name_Modular_IO : constant Name_Id := N + 043;
+ Last_Text_IO_Package : constant Name_Id := N + 043;
subtype Text_IO_Package_Name is Name_Id
range First_Text_IO_Package .. Last_Text_IO_Package;
-- Names of files in library for Ada.Text_IO and Ada.Wide_Text_IO
- Name_a_textio : constant Name_Id := N + 042;
- Name_a_witeio : constant Name_Id := N + 043;
+ Name_a_textio : constant Name_Id := N + 044;
+ Name_a_witeio : constant Name_Id := N + 045;
-- Some miscellaneous names used for error detection/recovery
- Name_Const : constant Name_Id := N + 044;
- Name_Error : constant Name_Id := N + 045;
- Name_Go : constant Name_Id := N + 046;
- Name_Put : constant Name_Id := N + 047;
- Name_Put_Line : constant Name_Id := N + 048;
- Name_To : constant Name_Id := N + 049;
+ Name_Const : constant Name_Id := N + 046;
+ Name_Error : constant Name_Id := N + 047;
+ Name_Go : constant Name_Id := N + 048;
+ Name_Put : constant Name_Id := N + 049;
+ Name_Put_Line : constant Name_Id := N + 050;
+ Name_To : constant Name_Id := N + 051;
-- Names for packages that are treated specially by the compiler
- Name_Finalization : constant Name_Id := N + 050;
- Name_Finalization_Root : constant Name_Id := N + 051;
- Name_Interfaces : constant Name_Id := N + 052;
- Name_Standard : constant Name_Id := N + 053;
- Name_System : constant Name_Id := N + 054;
- Name_Text_IO : constant Name_Id := N + 055;
- Name_Wide_Text_IO : constant Name_Id := N + 056;
+ Name_Finalization : constant Name_Id := N + 052;
+ Name_Finalization_Root : constant Name_Id := N + 053;
+ Name_Interfaces : constant Name_Id := N + 054;
+ Name_Standard : constant Name_Id := N + 055;
+ Name_System : constant Name_Id := N + 056;
+ Name_Text_IO : constant Name_Id := N + 057;
+ Name_Wide_Text_IO : constant Name_Id := N + 058;
-- Names of identifiers used in expanding distribution stubs
- Name_Addr : constant Name_Id := N + 057;
- Name_Async : constant Name_Id := N + 058;
- Name_Get_Active_Partition_ID : constant Name_Id := N + 059;
- Name_Get_RCI_Package_Receiver : constant Name_Id := N + 060;
- Name_Origin : constant Name_Id := N + 061;
- Name_Params : constant Name_Id := N + 062;
- Name_Partition : constant Name_Id := N + 063;
- Name_Partition_Interface : constant Name_Id := N + 064;
- Name_Ras : constant Name_Id := N + 065;
- Name_RCI_Name : constant Name_Id := N + 066;
- Name_Receiver : constant Name_Id := N + 067;
- Name_Result : constant Name_Id := N + 068;
- Name_Rpc : constant Name_Id := N + 069;
- Name_Subp_Id : constant Name_Id := N + 070;
+ Name_Addr : constant Name_Id := N + 059;
+ Name_Async : constant Name_Id := N + 060;
+ Name_Get_Active_Partition_ID : constant Name_Id := N + 061;
+ Name_Get_RCI_Package_Receiver : constant Name_Id := N + 062;
+ Name_Origin : constant Name_Id := N + 063;
+ Name_Params : constant Name_Id := N + 064;
+ Name_Partition : constant Name_Id := N + 065;
+ Name_Partition_Interface : constant Name_Id := N + 066;
+ Name_Ras : constant Name_Id := N + 067;
+ Name_RCI_Name : constant Name_Id := N + 068;
+ Name_Receiver : constant Name_Id := N + 069;
+ Name_Result : constant Name_Id := N + 070;
+ Name_Rpc : constant Name_Id := N + 071;
+ Name_Subp_Id : constant Name_Id := N + 072;
-- Operator Symbol entries. The actual names have an upper case O at
-- the start in place of the Op_ prefix (e.g. the actual name that
-- corresponds to Name_Op_Abs is "Oabs".
- First_Operator_Name : constant Name_Id := N + 071;
- Name_Op_Abs : constant Name_Id := N + 071; -- "abs"
- Name_Op_And : constant Name_Id := N + 072; -- "and"
- Name_Op_Mod : constant Name_Id := N + 073; -- "mod"
- Name_Op_Not : constant Name_Id := N + 074; -- "not"
- Name_Op_Or : constant Name_Id := N + 075; -- "or"
- Name_Op_Rem : constant Name_Id := N + 076; -- "rem"
- Name_Op_Xor : constant Name_Id := N + 077; -- "xor"
- Name_Op_Eq : constant Name_Id := N + 078; -- "="
- Name_Op_Ne : constant Name_Id := N + 079; -- "/="
- Name_Op_Lt : constant Name_Id := N + 080; -- "<"
- Name_Op_Le : constant Name_Id := N + 081; -- "<="
- Name_Op_Gt : constant Name_Id := N + 082; -- ">"
- Name_Op_Ge : constant Name_Id := N + 083; -- ">="
- Name_Op_Add : constant Name_Id := N + 084; -- "+"
- Name_Op_Subtract : constant Name_Id := N + 085; -- "-"
- Name_Op_Concat : constant Name_Id := N + 086; -- "&"
- Name_Op_Multiply : constant Name_Id := N + 087; -- "*"
- Name_Op_Divide : constant Name_Id := N + 088; -- "/"
- Name_Op_Expon : constant Name_Id := N + 089; -- "**"
- Last_Operator_Name : constant Name_Id := N + 089;
+ First_Operator_Name : constant Name_Id := N + 073;
+ Name_Op_Abs : constant Name_Id := N + 073; -- "abs"
+ Name_Op_And : constant Name_Id := N + 074; -- "and"
+ Name_Op_Mod : constant Name_Id := N + 075; -- "mod"
+ Name_Op_Not : constant Name_Id := N + 076; -- "not"
+ Name_Op_Or : constant Name_Id := N + 077; -- "or"
+ Name_Op_Rem : constant Name_Id := N + 078; -- "rem"
+ Name_Op_Xor : constant Name_Id := N + 079; -- "xor"
+ Name_Op_Eq : constant Name_Id := N + 080; -- "="
+ Name_Op_Ne : constant Name_Id := N + 081; -- "/="
+ Name_Op_Lt : constant Name_Id := N + 082; -- "<"
+ Name_Op_Le : constant Name_Id := N + 083; -- "<="
+ Name_Op_Gt : constant Name_Id := N + 084; -- ">"
+ Name_Op_Ge : constant Name_Id := N + 085; -- ">="
+ Name_Op_Add : constant Name_Id := N + 086; -- "+"
+ Name_Op_Subtract : constant Name_Id := N + 087; -- "-"
+ Name_Op_Concat : constant Name_Id := N + 088; -- "&"
+ Name_Op_Multiply : constant Name_Id := N + 089; -- "*"
+ Name_Op_Divide : constant Name_Id := N + 090; -- "/"
+ Name_Op_Expon : constant Name_Id := N + 091; -- "**"
+ Last_Operator_Name : constant Name_Id := N + 091;
-- Names for all pragmas recognized by GNAT. The entries with the comment
-- "Ada 83" are pragmas that are defined in Ada 83, but not in Ada 95.
@@ -286,59 +288,59 @@ package Snames is
-- only in GNAT for the AAMP. They are ignored in other versions with
-- appropriate warnings.
- First_Pragma_Name : constant Name_Id := N + 090;
+ First_Pragma_Name : constant Name_Id := N + 092;
-- Configuration pragmas are grouped at start
- Name_Ada_83 : constant Name_Id := N + 090; -- GNAT
- Name_Ada_95 : constant Name_Id := N + 091; -- GNAT
- Name_C_Pass_By_Copy : constant Name_Id := N + 092; -- GNAT
- Name_Compile_Time_Warning : constant Name_Id := N + 093; -- GNAT
- Name_Component_Alignment : constant Name_Id := N + 094; -- GNAT
- Name_Convention_Identifier : constant Name_Id := N + 095; -- GNAT
- Name_Discard_Names : constant Name_Id := N + 096;
- Name_Elaboration_Checks : constant Name_Id := N + 097; -- GNAT
- Name_Eliminate : constant Name_Id := N + 098; -- GNAT
- Name_Explicit_Overriding : constant Name_Id := N + 099;
- Name_Extend_System : constant Name_Id := N + 100; -- GNAT
- Name_Extensions_Allowed : constant Name_Id := N + 101; -- GNAT
- Name_External_Name_Casing : constant Name_Id := N + 102; -- GNAT
- Name_Float_Representation : constant Name_Id := N + 103; -- GNAT
- Name_Initialize_Scalars : constant Name_Id := N + 104; -- GNAT
- Name_Interrupt_State : constant Name_Id := N + 105; -- GNAT
- Name_License : constant Name_Id := N + 106; -- GNAT
- Name_Locking_Policy : constant Name_Id := N + 107;
- Name_Long_Float : constant Name_Id := N + 108; -- VMS
- Name_No_Run_Time : constant Name_Id := N + 109; -- GNAT
- Name_Normalize_Scalars : constant Name_Id := N + 110;
- Name_Polling : constant Name_Id := N + 111; -- GNAT
- Name_Persistent_Data : constant Name_Id := N + 112; -- GNAT
- Name_Persistent_Object : constant Name_Id := N + 113; -- GNAT
- Name_Propagate_Exceptions : constant Name_Id := N + 114; -- GNAT
- Name_Queuing_Policy : constant Name_Id := N + 115;
- Name_Ravenscar : constant Name_Id := N + 116;
- Name_Restricted_Run_Time : constant Name_Id := N + 117;
- Name_Restrictions : constant Name_Id := N + 118;
- Name_Restriction_Warnings : constant Name_Id := N + 119; -- GNAT
- Name_Reviewable : constant Name_Id := N + 120;
- Name_Source_File_Name : constant Name_Id := N + 121; -- GNAT
- Name_Source_File_Name_Project : constant Name_Id := N + 122; -- GNAT
- Name_Style_Checks : constant Name_Id := N + 123; -- GNAT
- Name_Suppress : constant Name_Id := N + 124;
- Name_Suppress_Exception_Locations : constant Name_Id := N + 125; -- GNAT
- Name_Task_Dispatching_Policy : constant Name_Id := N + 126;
- Name_Universal_Data : constant Name_Id := N + 127; -- AAMP
- Name_Unsuppress : constant Name_Id := N + 128; -- GNAT
- Name_Use_VADS_Size : constant Name_Id := N + 129; -- GNAT
- Name_Validity_Checks : constant Name_Id := N + 130; -- GNAT
- Name_Warnings : constant Name_Id := N + 131; -- GNAT
- Last_Configuration_Pragma_Name : constant Name_Id := N + 131;
+ Name_Ada_83 : constant Name_Id := N + 092; -- GNAT
+ Name_Ada_95 : constant Name_Id := N + 093; -- GNAT
+ Name_C_Pass_By_Copy : constant Name_Id := N + 094; -- GNAT
+ Name_Compile_Time_Warning : constant Name_Id := N + 095; -- GNAT
+ Name_Component_Alignment : constant Name_Id := N + 096; -- GNAT
+ Name_Convention_Identifier : constant Name_Id := N + 097; -- GNAT
+ Name_Discard_Names : constant Name_Id := N + 098;
+ Name_Elaboration_Checks : constant Name_Id := N + 099; -- GNAT
+ Name_Eliminate : constant Name_Id := N + 100; -- GNAT
+ Name_Explicit_Overriding : constant Name_Id := N + 101;
+ Name_Extend_System : constant Name_Id := N + 102; -- GNAT
+ Name_Extensions_Allowed : constant Name_Id := N + 103; -- GNAT
+ Name_External_Name_Casing : constant Name_Id := N + 104; -- GNAT
+ Name_Float_Representation : constant Name_Id := N + 105; -- GNAT
+ Name_Initialize_Scalars : constant Name_Id := N + 106; -- GNAT
+ Name_Interrupt_State : constant Name_Id := N + 107; -- GNAT
+ Name_License : constant Name_Id := N + 108; -- GNAT
+ Name_Locking_Policy : constant Name_Id := N + 109;
+ Name_Long_Float : constant Name_Id := N + 110; -- VMS
+ Name_No_Run_Time : constant Name_Id := N + 111; -- GNAT
+ Name_Normalize_Scalars : constant Name_Id := N + 112;
+ Name_Polling : constant Name_Id := N + 113; -- GNAT
+ Name_Persistent_Data : constant Name_Id := N + 114; -- GNAT
+ Name_Persistent_Object : constant Name_Id := N + 115; -- GNAT
+ Name_Propagate_Exceptions : constant Name_Id := N + 116; -- GNAT
+ Name_Queuing_Policy : constant Name_Id := N + 117;
+ Name_Ravenscar : constant Name_Id := N + 118;
+ Name_Restricted_Run_Time : constant Name_Id := N + 119;
+ Name_Restrictions : constant Name_Id := N + 120;
+ Name_Restriction_Warnings : constant Name_Id := N + 121; -- GNAT
+ Name_Reviewable : constant Name_Id := N + 122;
+ Name_Source_File_Name : constant Name_Id := N + 123; -- GNAT
+ Name_Source_File_Name_Project : constant Name_Id := N + 124; -- GNAT
+ Name_Style_Checks : constant Name_Id := N + 125; -- GNAT
+ Name_Suppress : constant Name_Id := N + 126;
+ Name_Suppress_Exception_Locations : constant Name_Id := N + 127; -- GNAT
+ Name_Task_Dispatching_Policy : constant Name_Id := N + 128;
+ Name_Universal_Data : constant Name_Id := N + 129; -- AAMP
+ Name_Unsuppress : constant Name_Id := N + 130; -- GNAT
+ Name_Use_VADS_Size : constant Name_Id := N + 131; -- GNAT
+ Name_Validity_Checks : constant Name_Id := N + 132; -- GNAT
+ Name_Warnings : constant Name_Id := N + 133; -- GNAT
+ Last_Configuration_Pragma_Name : constant Name_Id := N + 133;
-- Remaining pragma names
- Name_Abort_Defer : constant Name_Id := N + 132; -- GNAT
- Name_All_Calls_Remote : constant Name_Id := N + 133;
- Name_Annotate : constant Name_Id := N + 134; -- GNAT
+ Name_Abort_Defer : constant Name_Id := N + 134; -- GNAT
+ Name_All_Calls_Remote : constant Name_Id := N + 135;
+ Name_Annotate : constant Name_Id := N + 136; -- GNAT
-- Note: AST_Entry is not in this list because its name matches the
-- name of the corresponding attribute. However, it is included in the
@@ -346,78 +348,78 @@ package Snames is
-- and Check_Pragma_Id correctly recognize and process Name_AST_Entry.
-- AST_Entry is a VMS specific pragma.
- Name_Assert : constant Name_Id := N + 135; -- GNAT
- Name_Asynchronous : constant Name_Id := N + 136;
- Name_Atomic : constant Name_Id := N + 137;
- Name_Atomic_Components : constant Name_Id := N + 138;
- Name_Attach_Handler : constant Name_Id := N + 139;
- Name_Comment : constant Name_Id := N + 140; -- GNAT
- Name_Common_Object : constant Name_Id := N + 141; -- GNAT
- Name_Complex_Representation : constant Name_Id := N + 142; -- GNAT
- Name_Controlled : constant Name_Id := N + 143;
- Name_Convention : constant Name_Id := N + 144;
- Name_CPP_Class : constant Name_Id := N + 145; -- GNAT
- Name_CPP_Constructor : constant Name_Id := N + 146; -- GNAT
- Name_CPP_Virtual : constant Name_Id := N + 147; -- GNAT
- Name_CPP_Vtable : constant Name_Id := N + 148; -- GNAT
- Name_Debug : constant Name_Id := N + 149; -- GNAT
- Name_Elaborate : constant Name_Id := N + 150; -- Ada 83
- Name_Elaborate_All : constant Name_Id := N + 151;
- Name_Elaborate_Body : constant Name_Id := N + 152;
- Name_Export : constant Name_Id := N + 153;
- Name_Export_Exception : constant Name_Id := N + 154; -- VMS
- Name_Export_Function : constant Name_Id := N + 155; -- GNAT
- Name_Export_Object : constant Name_Id := N + 156; -- GNAT
- Name_Export_Procedure : constant Name_Id := N + 157; -- GNAT
- Name_Export_Value : constant Name_Id := N + 158; -- GNAT
- Name_Export_Valued_Procedure : constant Name_Id := N + 159; -- GNAT
- Name_External : constant Name_Id := N + 160; -- GNAT
- Name_Finalize_Storage_Only : constant Name_Id := N + 161; -- GNAT
- Name_Ident : constant Name_Id := N + 162; -- VMS
- Name_Import : constant Name_Id := N + 163;
- Name_Import_Exception : constant Name_Id := N + 164; -- VMS
- Name_Import_Function : constant Name_Id := N + 165; -- GNAT
- Name_Import_Object : constant Name_Id := N + 166; -- GNAT
- Name_Import_Procedure : constant Name_Id := N + 167; -- GNAT
- Name_Import_Valued_Procedure : constant Name_Id := N + 168; -- GNAT
- Name_Inline : constant Name_Id := N + 169;
- Name_Inline_Always : constant Name_Id := N + 170; -- GNAT
- Name_Inline_Generic : constant Name_Id := N + 171; -- GNAT
- Name_Inspection_Point : constant Name_Id := N + 172;
- Name_Interface : constant Name_Id := N + 173; -- Ada 83
- Name_Interface_Name : constant Name_Id := N + 174; -- GNAT
- Name_Interrupt_Handler : constant Name_Id := N + 175;
- Name_Interrupt_Priority : constant Name_Id := N + 176;
- Name_Java_Constructor : constant Name_Id := N + 177; -- GNAT
- Name_Java_Interface : constant Name_Id := N + 178; -- GNAT
- Name_Keep_Names : constant Name_Id := N + 179; -- GNAT
- Name_Link_With : constant Name_Id := N + 180; -- GNAT
- Name_Linker_Alias : constant Name_Id := N + 181; -- GNAT
- Name_Linker_Options : constant Name_Id := N + 182;
- Name_Linker_Section : constant Name_Id := N + 183; -- GNAT
- Name_List : constant Name_Id := N + 184;
- Name_Machine_Attribute : constant Name_Id := N + 185; -- GNAT
- Name_Main : constant Name_Id := N + 186; -- GNAT
- Name_Main_Storage : constant Name_Id := N + 187; -- GNAT
- Name_Memory_Size : constant Name_Id := N + 188; -- Ada 83
- Name_No_Return : constant Name_Id := N + 189; -- GNAT
- Name_Obsolescent : constant Name_Id := N + 190; -- GNAT
- Name_Optimize : constant Name_Id := N + 191;
- Name_Optional_Overriding : constant Name_Id := N + 192;
- Name_Overriding : constant Name_Id := N + 193;
- Name_Pack : constant Name_Id := N + 194;
- Name_Page : constant Name_Id := N + 195;
- Name_Passive : constant Name_Id := N + 196; -- GNAT
- Name_Preelaborate : constant Name_Id := N + 197;
- Name_Priority : constant Name_Id := N + 198;
- Name_Psect_Object : constant Name_Id := N + 199; -- VMS
- Name_Pure : constant Name_Id := N + 200;
- Name_Pure_Function : constant Name_Id := N + 201; -- GNAT
- Name_Remote_Call_Interface : constant Name_Id := N + 202;
- Name_Remote_Types : constant Name_Id := N + 203;
- Name_Share_Generic : constant Name_Id := N + 204; -- GNAT
- Name_Shared : constant Name_Id := N + 205; -- Ada 83
- Name_Shared_Passive : constant Name_Id := N + 206;
+ Name_Assert : constant Name_Id := N + 137; -- GNAT
+ Name_Asynchronous : constant Name_Id := N + 138;
+ Name_Atomic : constant Name_Id := N + 139;
+ Name_Atomic_Components : constant Name_Id := N + 140;
+ Name_Attach_Handler : constant Name_Id := N + 141;
+ Name_Comment : constant Name_Id := N + 142; -- GNAT
+ Name_Common_Object : constant Name_Id := N + 143; -- GNAT
+ Name_Complex_Representation : constant Name_Id := N + 144; -- GNAT
+ Name_Controlled : constant Name_Id := N + 145;
+ Name_Convention : constant Name_Id := N + 146;
+ Name_CPP_Class : constant Name_Id := N + 147; -- GNAT
+ Name_CPP_Constructor : constant Name_Id := N + 148; -- GNAT
+ Name_CPP_Virtual : constant Name_Id := N + 149; -- GNAT
+ Name_CPP_Vtable : constant Name_Id := N + 150; -- GNAT
+ Name_Debug : constant Name_Id := N + 151; -- GNAT
+ Name_Elaborate : constant Name_Id := N + 152; -- Ada 83
+ Name_Elaborate_All : constant Name_Id := N + 153;
+ Name_Elaborate_Body : constant Name_Id := N + 154;
+ Name_Export : constant Name_Id := N + 155;
+ Name_Export_Exception : constant Name_Id := N + 156; -- VMS
+ Name_Export_Function : constant Name_Id := N + 157; -- GNAT
+ Name_Export_Object : constant Name_Id := N + 158; -- GNAT
+ Name_Export_Procedure : constant Name_Id := N + 159; -- GNAT
+ Name_Export_Value : constant Name_Id := N + 160; -- GNAT
+ Name_Export_Valued_Procedure : constant Name_Id := N + 161; -- GNAT
+ Name_External : constant Name_Id := N + 162; -- GNAT
+ Name_Finalize_Storage_Only : constant Name_Id := N + 163; -- GNAT
+ Name_Ident : constant Name_Id := N + 164; -- VMS
+ Name_Import : constant Name_Id := N + 165;
+ Name_Import_Exception : constant Name_Id := N + 166; -- VMS
+ Name_Import_Function : constant Name_Id := N + 167; -- GNAT
+ Name_Import_Object : constant Name_Id := N + 168; -- GNAT
+ Name_Import_Procedure : constant Name_Id := N + 169; -- GNAT
+ Name_Import_Valued_Procedure : constant Name_Id := N + 170; -- GNAT
+ Name_Inline : constant Name_Id := N + 171;
+ Name_Inline_Always : constant Name_Id := N + 172; -- GNAT
+ Name_Inline_Generic : constant Name_Id := N + 173; -- GNAT
+ Name_Inspection_Point : constant Name_Id := N + 174;
+ Name_Interface : constant Name_Id := N + 175; -- Ada 83
+ Name_Interface_Name : constant Name_Id := N + 176; -- GNAT
+ Name_Interrupt_Handler : constant Name_Id := N + 177;
+ Name_Interrupt_Priority : constant Name_Id := N + 178;
+ Name_Java_Constructor : constant Name_Id := N + 179; -- GNAT
+ Name_Java_Interface : constant Name_Id := N + 180; -- GNAT
+ Name_Keep_Names : constant Name_Id := N + 181; -- GNAT
+ Name_Link_With : constant Name_Id := N + 182; -- GNAT
+ Name_Linker_Alias : constant Name_Id := N + 183; -- GNAT
+ Name_Linker_Options : constant Name_Id := N + 184;
+ Name_Linker_Section : constant Name_Id := N + 185; -- GNAT
+ Name_List : constant Name_Id := N + 186;
+ Name_Machine_Attribute : constant Name_Id := N + 187; -- GNAT
+ Name_Main : constant Name_Id := N + 188; -- GNAT
+ Name_Main_Storage : constant Name_Id := N + 189; -- GNAT
+ Name_Memory_Size : constant Name_Id := N + 190; -- Ada 83
+ Name_No_Return : constant Name_Id := N + 191; -- GNAT
+ Name_Obsolescent : constant Name_Id := N + 192; -- GNAT
+ Name_Optimize : constant Name_Id := N + 193;
+ Name_Optional_Overriding : constant Name_Id := N + 194;
+ Name_Overriding : constant Name_Id := N + 195;
+ Name_Pack : constant Name_Id := N + 196;
+ Name_Page : constant Name_Id := N + 197;
+ Name_Passive : constant Name_Id := N + 198; -- GNAT
+ Name_Preelaborate : constant Name_Id := N + 199;
+ Name_Priority : constant Name_Id := N + 200;
+ Name_Psect_Object : constant Name_Id := N + 201; -- VMS
+ Name_Pure : constant Name_Id := N + 202;
+ Name_Pure_Function : constant Name_Id := N + 203; -- GNAT
+ Name_Remote_Call_Interface : constant Name_Id := N + 204;
+ Name_Remote_Types : constant Name_Id := N + 205;
+ Name_Share_Generic : constant Name_Id := N + 206; -- GNAT
+ Name_Shared : constant Name_Id := N + 207; -- Ada 83
+ Name_Shared_Passive : constant Name_Id := N + 208;
-- Note: Storage_Size is not in this list because its name matches the
-- name of the corresponding attribute. However, it is included in the
@@ -427,26 +429,27 @@ package Snames is
-- Note: Storage_Unit is also omitted from the list because of a clash
-- with an attribute name, and is treated similarly.
- Name_Source_Reference : constant Name_Id := N + 207; -- GNAT
- Name_Stream_Convert : constant Name_Id := N + 208; -- GNAT
- Name_Subtitle : constant Name_Id := N + 209; -- GNAT
- Name_Suppress_All : constant Name_Id := N + 210; -- GNAT
- Name_Suppress_Debug_Info : constant Name_Id := N + 211; -- GNAT
- Name_Suppress_Initialization : constant Name_Id := N + 212; -- GNAT
- Name_System_Name : constant Name_Id := N + 213; -- Ada 83
- Name_Task_Info : constant Name_Id := N + 214; -- GNAT
- Name_Task_Name : constant Name_Id := N + 215; -- GNAT
- Name_Task_Storage : constant Name_Id := N + 216; -- VMS
- Name_Time_Slice : constant Name_Id := N + 217; -- GNAT
- Name_Title : constant Name_Id := N + 218; -- GNAT
- Name_Unchecked_Union : constant Name_Id := N + 219; -- GNAT
- Name_Unimplemented_Unit : constant Name_Id := N + 220; -- GNAT
- Name_Unreferenced : constant Name_Id := N + 221; -- GNAT
- Name_Unreserve_All_Interrupts : constant Name_Id := N + 222; -- GNAT
- Name_Volatile : constant Name_Id := N + 223;
- Name_Volatile_Components : constant Name_Id := N + 224;
- Name_Weak_External : constant Name_Id := N + 225; -- GNAT
- Last_Pragma_Name : constant Name_Id := N + 225;
+ Name_Source_Reference : constant Name_Id := N + 209; -- GNAT
+ Name_Stream_Convert : constant Name_Id := N + 210; -- GNAT
+ Name_Subtitle : constant Name_Id := N + 211; -- GNAT
+ Name_Suppress_All : constant Name_Id := N + 212; -- GNAT
+ Name_Suppress_Debug_Info : constant Name_Id := N + 213; -- GNAT
+ Name_Suppress_Initialization : constant Name_Id := N + 214; -- GNAT
+ Name_System_Name : constant Name_Id := N + 215; -- Ada 83
+ Name_Task_Info : constant Name_Id := N + 216; -- GNAT
+ Name_Task_Name : constant Name_Id := N + 217; -- GNAT
+ Name_Task_Storage : constant Name_Id := N + 218; -- VMS
+ Name_Thread_Body : constant Name_Id := N + 219; -- GNAT
+ Name_Time_Slice : constant Name_Id := N + 220; -- GNAT
+ Name_Title : constant Name_Id := N + 221; -- GNAT
+ Name_Unchecked_Union : constant Name_Id := N + 222; -- GNAT
+ Name_Unimplemented_Unit : constant Name_Id := N + 223; -- GNAT
+ Name_Unreferenced : constant Name_Id := N + 224; -- GNAT
+ Name_Unreserve_All_Interrupts : constant Name_Id := N + 225; -- GNAT
+ Name_Volatile : constant Name_Id := N + 226;
+ Name_Volatile_Components : constant Name_Id := N + 227;
+ Name_Weak_External : constant Name_Id := N + 228; -- GNAT
+ Last_Pragma_Name : constant Name_Id := N + 228;
-- Language convention names for pragma Convention/Export/Import/Interface
-- Note that Name_C is not included in this list, since it was already
@@ -457,95 +460,96 @@ package Snames is
-- Entry and Protected, this is because these conventions cannot be
-- specified by a pragma.
- First_Convention_Name : constant Name_Id := N + 226;
- Name_Ada : constant Name_Id := N + 226;
- Name_Assembler : constant Name_Id := N + 227;
- Name_COBOL : constant Name_Id := N + 228;
- Name_CPP : constant Name_Id := N + 229;
- Name_Fortran : constant Name_Id := N + 230;
- Name_Intrinsic : constant Name_Id := N + 231;
- Name_Java : constant Name_Id := N + 232;
- Name_Stdcall : constant Name_Id := N + 233;
- Name_Stubbed : constant Name_Id := N + 234;
- Last_Convention_Name : constant Name_Id := N + 234;
+ First_Convention_Name : constant Name_Id := N + 229;
+ Name_Ada : constant Name_Id := N + 229;
+ Name_Assembler : constant Name_Id := N + 230;
+ Name_COBOL : constant Name_Id := N + 231;
+ Name_CPP : constant Name_Id := N + 232;
+ Name_Fortran : constant Name_Id := N + 233;
+ Name_Intrinsic : constant Name_Id := N + 234;
+ Name_Java : constant Name_Id := N + 235;
+ Name_Stdcall : constant Name_Id := N + 236;
+ Name_Stubbed : constant Name_Id := N + 237;
+ Last_Convention_Name : constant Name_Id := N + 237;
-- The following names are preset as synonyms for Assembler
- Name_Asm : constant Name_Id := N + 235;
- Name_Assembly : constant Name_Id := N + 236;
+ Name_Asm : constant Name_Id := N + 238;
+ Name_Assembly : constant Name_Id := N + 239;
-- The following names are preset as synonyms for C
- Name_Default : constant Name_Id := N + 237;
+ Name_Default : constant Name_Id := N + 240;
-- Name_Exernal (previously defined as pragma)
-- The following names are present as synonyms for Stdcall
- Name_DLL : constant Name_Id := N + 238;
- Name_Win32 : constant Name_Id := N + 239;
+ Name_DLL : constant Name_Id := N + 241;
+ Name_Win32 : constant Name_Id := N + 242;
-- Other special names used in processing pragma arguments
- Name_As_Is : constant Name_Id := N + 240;
- Name_Body_File_Name : constant Name_Id := N + 241;
- Name_Casing : constant Name_Id := N + 242;
- Name_Code : constant Name_Id := N + 243;
- Name_Component : constant Name_Id := N + 244;
- Name_Component_Size_4 : constant Name_Id := N + 245;
- Name_Copy : constant Name_Id := N + 246;
- Name_D_Float : constant Name_Id := N + 247;
- Name_Descriptor : constant Name_Id := N + 248;
- Name_Dot_Replacement : constant Name_Id := N + 249;
- Name_Dynamic : constant Name_Id := N + 250;
- Name_Entity : constant Name_Id := N + 251;
- Name_External_Name : constant Name_Id := N + 252;
- Name_First_Optional_Parameter : constant Name_Id := N + 253;
- Name_Form : constant Name_Id := N + 254;
- Name_G_Float : constant Name_Id := N + 255;
- Name_Gcc : constant Name_Id := N + 256;
- Name_Gnat : constant Name_Id := N + 257;
- Name_GPL : constant Name_Id := N + 258;
- Name_IEEE_Float : constant Name_Id := N + 259;
- Name_Homonym_Number : constant Name_Id := N + 260;
- Name_Internal : constant Name_Id := N + 261;
- Name_Link_Name : constant Name_Id := N + 262;
- Name_Lowercase : constant Name_Id := N + 263;
- Name_Max_Size : constant Name_Id := N + 264;
- Name_Mechanism : constant Name_Id := N + 265;
- Name_Mixedcase : constant Name_Id := N + 266;
- Name_Modified_GPL : constant Name_Id := N + 267;
- Name_Name : constant Name_Id := N + 268;
- Name_NCA : constant Name_Id := N + 269;
- Name_No : constant Name_Id := N + 270;
- Name_On : constant Name_Id := N + 271;
- Name_Parameter_Types : constant Name_Id := N + 272;
- Name_Reference : constant Name_Id := N + 273;
- Name_Restricted : constant Name_Id := N + 274;
- Name_Result_Mechanism : constant Name_Id := N + 275;
- Name_Result_Type : constant Name_Id := N + 276;
- Name_Runtime : constant Name_Id := N + 277;
- Name_SB : constant Name_Id := N + 278;
- Name_Section : constant Name_Id := N + 279;
- Name_Semaphore : constant Name_Id := N + 280;
- Name_Spec_File_Name : constant Name_Id := N + 281;
- Name_Static : constant Name_Id := N + 282;
- Name_Stack_Size : constant Name_Id := N + 283;
- Name_Subunit_File_Name : constant Name_Id := N + 284;
- Name_Task_Stack_Size_Default : constant Name_Id := N + 285;
- Name_Task_Type : constant Name_Id := N + 286;
- Name_Time_Slicing_Enabled : constant Name_Id := N + 287;
- Name_Top_Guard : constant Name_Id := N + 288;
- Name_UBA : constant Name_Id := N + 289;
- Name_UBS : constant Name_Id := N + 290;
- Name_UBSB : constant Name_Id := N + 291;
- Name_Unit_Name : constant Name_Id := N + 292;
- Name_Unknown : constant Name_Id := N + 293;
- Name_Unrestricted : constant Name_Id := N + 294;
- Name_Uppercase : constant Name_Id := N + 295;
- Name_User : constant Name_Id := N + 296;
- Name_VAX_Float : constant Name_Id := N + 297;
- Name_VMS : constant Name_Id := N + 298;
- Name_Working_Storage : constant Name_Id := N + 299;
+ Name_As_Is : constant Name_Id := N + 243;
+ Name_Body_File_Name : constant Name_Id := N + 244;
+ Name_Casing : constant Name_Id := N + 245;
+ Name_Code : constant Name_Id := N + 246;
+ Name_Component : constant Name_Id := N + 247;
+ Name_Component_Size_4 : constant Name_Id := N + 248;
+ Name_Copy : constant Name_Id := N + 249;
+ Name_D_Float : constant Name_Id := N + 250;
+ Name_Descriptor : constant Name_Id := N + 251;
+ Name_Dot_Replacement : constant Name_Id := N + 252;
+ Name_Dynamic : constant Name_Id := N + 253;
+ Name_Entity : constant Name_Id := N + 254;
+ Name_External_Name : constant Name_Id := N + 255;
+ Name_First_Optional_Parameter : constant Name_Id := N + 256;
+ Name_Form : constant Name_Id := N + 257;
+ Name_G_Float : constant Name_Id := N + 258;
+ Name_Gcc : constant Name_Id := N + 259;
+ Name_Gnat : constant Name_Id := N + 260;
+ Name_GPL : constant Name_Id := N + 261;
+ Name_IEEE_Float : constant Name_Id := N + 262;
+ Name_Homonym_Number : constant Name_Id := N + 263;
+ Name_Internal : constant Name_Id := N + 264;
+ Name_Link_Name : constant Name_Id := N + 265;
+ Name_Lowercase : constant Name_Id := N + 266;
+ Name_Max_Size : constant Name_Id := N + 267;
+ Name_Mechanism : constant Name_Id := N + 268;
+ Name_Mixedcase : constant Name_Id := N + 269;
+ Name_Modified_GPL : constant Name_Id := N + 270;
+ Name_Name : constant Name_Id := N + 271;
+ Name_NCA : constant Name_Id := N + 272;
+ Name_No : constant Name_Id := N + 273;
+ Name_On : constant Name_Id := N + 274;
+ Name_Parameter_Types : constant Name_Id := N + 275;
+ Name_Reference : constant Name_Id := N + 276;
+ Name_Restricted : constant Name_Id := N + 277;
+ Name_Result_Mechanism : constant Name_Id := N + 278;
+ Name_Result_Type : constant Name_Id := N + 279;
+ Name_Runtime : constant Name_Id := N + 280;
+ Name_SB : constant Name_Id := N + 281;
+ Name_Secondary_Stack_Size : constant Name_Id := N + 282;
+ Name_Section : constant Name_Id := N + 283;
+ Name_Semaphore : constant Name_Id := N + 284;
+ Name_Spec_File_Name : constant Name_Id := N + 285;
+ Name_Static : constant Name_Id := N + 286;
+ Name_Stack_Size : constant Name_Id := N + 287;
+ Name_Subunit_File_Name : constant Name_Id := N + 288;
+ Name_Task_Stack_Size_Default : constant Name_Id := N + 289;
+ Name_Task_Type : constant Name_Id := N + 290;
+ Name_Time_Slicing_Enabled : constant Name_Id := N + 291;
+ Name_Top_Guard : constant Name_Id := N + 292;
+ Name_UBA : constant Name_Id := N + 293;
+ Name_UBS : constant Name_Id := N + 294;
+ Name_UBSB : constant Name_Id := N + 295;
+ Name_Unit_Name : constant Name_Id := N + 296;
+ Name_Unknown : constant Name_Id := N + 297;
+ Name_Unrestricted : constant Name_Id := N + 298;
+ Name_Uppercase : constant Name_Id := N + 299;
+ Name_User : constant Name_Id := N + 300;
+ Name_VAX_Float : constant Name_Id := N + 301;
+ Name_VMS : constant Name_Id := N + 302;
+ Name_Working_Storage : constant Name_Id := N + 303;
-- Names of recognized attributes. The entries with the comment "Ada 83"
-- are attributes that are defined in Ada 83, but not in Ada 95. These
@@ -559,158 +563,158 @@ package Snames is
-- The entries marked VMS are recognized only in OpenVMS implementations
-- of GNAT, and are treated as illegal in all other contexts.
- First_Attribute_Name : constant Name_Id := N + 300;
- Name_Abort_Signal : constant Name_Id := N + 300; -- GNAT
- Name_Access : constant Name_Id := N + 301;
- Name_Address : constant Name_Id := N + 302;
- Name_Address_Size : constant Name_Id := N + 303; -- GNAT
- Name_Aft : constant Name_Id := N + 304;
- Name_Alignment : constant Name_Id := N + 305;
- Name_Asm_Input : constant Name_Id := N + 306; -- GNAT
- Name_Asm_Output : constant Name_Id := N + 307; -- GNAT
- Name_AST_Entry : constant Name_Id := N + 308; -- VMS
- Name_Bit : constant Name_Id := N + 309; -- GNAT
- Name_Bit_Order : constant Name_Id := N + 310;
- Name_Bit_Position : constant Name_Id := N + 311; -- GNAT
- Name_Body_Version : constant Name_Id := N + 312;
- Name_Callable : constant Name_Id := N + 313;
- Name_Caller : constant Name_Id := N + 314;
- Name_Code_Address : constant Name_Id := N + 315; -- GNAT
- Name_Component_Size : constant Name_Id := N + 316;
- Name_Compose : constant Name_Id := N + 317;
- Name_Constrained : constant Name_Id := N + 318;
- Name_Count : constant Name_Id := N + 319;
- Name_Default_Bit_Order : constant Name_Id := N + 320; -- GNAT
- Name_Definite : constant Name_Id := N + 321;
- Name_Delta : constant Name_Id := N + 322;
- Name_Denorm : constant Name_Id := N + 323;
- Name_Digits : constant Name_Id := N + 324;
- Name_Elaborated : constant Name_Id := N + 325; -- GNAT
- Name_Emax : constant Name_Id := N + 326; -- Ada 83
- Name_Enum_Rep : constant Name_Id := N + 327; -- GNAT
- Name_Epsilon : constant Name_Id := N + 328; -- Ada 83
- Name_Exponent : constant Name_Id := N + 329;
- Name_External_Tag : constant Name_Id := N + 330;
- Name_First : constant Name_Id := N + 331;
- Name_First_Bit : constant Name_Id := N + 332;
- Name_Fixed_Value : constant Name_Id := N + 333; -- GNAT
- Name_Fore : constant Name_Id := N + 334;
- Name_Has_Discriminants : constant Name_Id := N + 335; -- GNAT
- Name_Identity : constant Name_Id := N + 336;
- Name_Img : constant Name_Id := N + 337; -- GNAT
- Name_Integer_Value : constant Name_Id := N + 338; -- GNAT
- Name_Large : constant Name_Id := N + 339; -- Ada 83
- Name_Last : constant Name_Id := N + 340;
- Name_Last_Bit : constant Name_Id := N + 341;
- Name_Leading_Part : constant Name_Id := N + 342;
- Name_Length : constant Name_Id := N + 343;
- Name_Machine_Emax : constant Name_Id := N + 344;
- Name_Machine_Emin : constant Name_Id := N + 345;
- Name_Machine_Mantissa : constant Name_Id := N + 346;
- Name_Machine_Overflows : constant Name_Id := N + 347;
- Name_Machine_Radix : constant Name_Id := N + 348;
- Name_Machine_Rounds : constant Name_Id := N + 349;
- Name_Machine_Size : constant Name_Id := N + 350; -- GNAT
- Name_Mantissa : constant Name_Id := N + 351; -- Ada 83
- Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 352;
- Name_Maximum_Alignment : constant Name_Id := N + 353; -- GNAT
- Name_Mechanism_Code : constant Name_Id := N + 354; -- GNAT
- Name_Model_Emin : constant Name_Id := N + 355;
- Name_Model_Epsilon : constant Name_Id := N + 356;
- Name_Model_Mantissa : constant Name_Id := N + 357;
- Name_Model_Small : constant Name_Id := N + 358;
- Name_Modulus : constant Name_Id := N + 359;
- Name_Null_Parameter : constant Name_Id := N + 360; -- GNAT
- Name_Object_Size : constant Name_Id := N + 361; -- GNAT
- Name_Partition_ID : constant Name_Id := N + 362;
- Name_Passed_By_Reference : constant Name_Id := N + 363; -- GNAT
- Name_Pool_Address : constant Name_Id := N + 364;
- Name_Pos : constant Name_Id := N + 365;
- Name_Position : constant Name_Id := N + 366;
- Name_Range : constant Name_Id := N + 367;
- Name_Range_Length : constant Name_Id := N + 368; -- GNAT
- Name_Round : constant Name_Id := N + 369;
- Name_Safe_Emax : constant Name_Id := N + 370; -- Ada 83
- Name_Safe_First : constant Name_Id := N + 371;
- Name_Safe_Large : constant Name_Id := N + 372; -- Ada 83
- Name_Safe_Last : constant Name_Id := N + 373;
- Name_Safe_Small : constant Name_Id := N + 374; -- Ada 83
- Name_Scale : constant Name_Id := N + 375;
- Name_Scaling : constant Name_Id := N + 376;
- Name_Signed_Zeros : constant Name_Id := N + 377;
- Name_Size : constant Name_Id := N + 378;
- Name_Small : constant Name_Id := N + 379;
- Name_Storage_Size : constant Name_Id := N + 380;
- Name_Storage_Unit : constant Name_Id := N + 381; -- GNAT
- Name_Tag : constant Name_Id := N + 382;
- Name_Target_Name : constant Name_Id := N + 383; -- GNAT
- Name_Terminated : constant Name_Id := N + 384;
- Name_To_Address : constant Name_Id := N + 385; -- GNAT
- Name_Type_Class : constant Name_Id := N + 386; -- GNAT
- Name_UET_Address : constant Name_Id := N + 387; -- GNAT
- Name_Unbiased_Rounding : constant Name_Id := N + 388;
- Name_Unchecked_Access : constant Name_Id := N + 389;
- Name_Unconstrained_Array : constant Name_Id := N + 390;
- Name_Universal_Literal_String : constant Name_Id := N + 391; -- GNAT
- Name_Unrestricted_Access : constant Name_Id := N + 392; -- GNAT
- Name_VADS_Size : constant Name_Id := N + 393; -- GNAT
- Name_Val : constant Name_Id := N + 394;
- Name_Valid : constant Name_Id := N + 395;
- Name_Value_Size : constant Name_Id := N + 396; -- GNAT
- Name_Version : constant Name_Id := N + 397;
- Name_Wchar_T_Size : constant Name_Id := N + 398; -- GNAT
- Name_Wide_Width : constant Name_Id := N + 399;
- Name_Width : constant Name_Id := N + 400;
- Name_Word_Size : constant Name_Id := N + 401; -- GNAT
+ First_Attribute_Name : constant Name_Id := N + 304;
+ Name_Abort_Signal : constant Name_Id := N + 304; -- GNAT
+ Name_Access : constant Name_Id := N + 305;
+ Name_Address : constant Name_Id := N + 306;
+ Name_Address_Size : constant Name_Id := N + 307; -- GNAT
+ Name_Aft : constant Name_Id := N + 308;
+ Name_Alignment : constant Name_Id := N + 309;
+ Name_Asm_Input : constant Name_Id := N + 310; -- GNAT
+ Name_Asm_Output : constant Name_Id := N + 311; -- GNAT
+ Name_AST_Entry : constant Name_Id := N + 312; -- VMS
+ Name_Bit : constant Name_Id := N + 313; -- GNAT
+ Name_Bit_Order : constant Name_Id := N + 314;
+ Name_Bit_Position : constant Name_Id := N + 315; -- GNAT
+ Name_Body_Version : constant Name_Id := N + 316;
+ Name_Callable : constant Name_Id := N + 317;
+ Name_Caller : constant Name_Id := N + 318;
+ Name_Code_Address : constant Name_Id := N + 319; -- GNAT
+ Name_Component_Size : constant Name_Id := N + 320;
+ Name_Compose : constant Name_Id := N + 321;
+ Name_Constrained : constant Name_Id := N + 322;
+ Name_Count : constant Name_Id := N + 323;
+ Name_Default_Bit_Order : constant Name_Id := N + 324; -- GNAT
+ Name_Definite : constant Name_Id := N + 325;
+ Name_Delta : constant Name_Id := N + 326;
+ Name_Denorm : constant Name_Id := N + 327;
+ Name_Digits : constant Name_Id := N + 328;
+ Name_Elaborated : constant Name_Id := N + 329; -- GNAT
+ Name_Emax : constant Name_Id := N + 330; -- Ada 83
+ Name_Enum_Rep : constant Name_Id := N + 331; -- GNAT
+ Name_Epsilon : constant Name_Id := N + 332; -- Ada 83
+ Name_Exponent : constant Name_Id := N + 333;
+ Name_External_Tag : constant Name_Id := N + 334;
+ Name_First : constant Name_Id := N + 335;
+ Name_First_Bit : constant Name_Id := N + 336;
+ Name_Fixed_Value : constant Name_Id := N + 337; -- GNAT
+ Name_Fore : constant Name_Id := N + 338;
+ Name_Has_Discriminants : constant Name_Id := N + 339; -- GNAT
+ Name_Identity : constant Name_Id := N + 340;
+ Name_Img : constant Name_Id := N + 341; -- GNAT
+ Name_Integer_Value : constant Name_Id := N + 342; -- GNAT
+ Name_Large : constant Name_Id := N + 343; -- Ada 83
+ Name_Last : constant Name_Id := N + 344;
+ Name_Last_Bit : constant Name_Id := N + 345;
+ Name_Leading_Part : constant Name_Id := N + 346;
+ Name_Length : constant Name_Id := N + 347;
+ Name_Machine_Emax : constant Name_Id := N + 348;
+ Name_Machine_Emin : constant Name_Id := N + 349;
+ Name_Machine_Mantissa : constant Name_Id := N + 350;
+ Name_Machine_Overflows : constant Name_Id := N + 351;
+ Name_Machine_Radix : constant Name_Id := N + 352;
+ Name_Machine_Rounds : constant Name_Id := N + 353;
+ Name_Machine_Size : constant Name_Id := N + 354; -- GNAT
+ Name_Mantissa : constant Name_Id := N + 355; -- Ada 83
+ Name_Max_Size_In_Storage_Elements : constant Name_Id := N + 356;
+ Name_Maximum_Alignment : constant Name_Id := N + 357; -- GNAT
+ Name_Mechanism_Code : constant Name_Id := N + 358; -- GNAT
+ Name_Model_Emin : constant Name_Id := N + 359;
+ Name_Model_Epsilon : constant Name_Id := N + 360;
+ Name_Model_Mantissa : constant Name_Id := N + 361;
+ Name_Model_Small : constant Name_Id := N + 362;
+ Name_Modulus : constant Name_Id := N + 363;
+ Name_Null_Parameter : constant Name_Id := N + 364; -- GNAT
+ Name_Object_Size : constant Name_Id := N + 365; -- GNAT
+ Name_Partition_ID : constant Name_Id := N + 366;
+ Name_Passed_By_Reference : constant Name_Id := N + 367; -- GNAT
+ Name_Pool_Address : constant Name_Id := N + 368;
+ Name_Pos : constant Name_Id := N + 369;
+ Name_Position : constant Name_Id := N + 370;
+ Name_Range : constant Name_Id := N + 371;
+ Name_Range_Length : constant Name_Id := N + 372; -- GNAT
+ Name_Round : constant Name_Id := N + 373;
+ Name_Safe_Emax : constant Name_Id := N + 374; -- Ada 83
+ Name_Safe_First : constant Name_Id := N + 375;
+ Name_Safe_Large : constant Name_Id := N + 376; -- Ada 83
+ Name_Safe_Last : constant Name_Id := N + 377;
+ Name_Safe_Small : constant Name_Id := N + 378; -- Ada 83
+ Name_Scale : constant Name_Id := N + 379;
+ Name_Scaling : constant Name_Id := N + 380;
+ Name_Signed_Zeros : constant Name_Id := N + 381;
+ Name_Size : constant Name_Id := N + 382;
+ Name_Small : constant Name_Id := N + 383;
+ Name_Storage_Size : constant Name_Id := N + 384;
+ Name_Storage_Unit : constant Name_Id := N + 385; -- GNAT
+ Name_Tag : constant Name_Id := N + 386;
+ Name_Target_Name : constant Name_Id := N + 387; -- GNAT
+ Name_Terminated : constant Name_Id := N + 388;
+ Name_To_Address : constant Name_Id := N + 389; -- GNAT
+ Name_Type_Class : constant Name_Id := N + 390; -- GNAT
+ Name_UET_Address : constant Name_Id := N + 391; -- GNAT
+ Name_Unbiased_Rounding : constant Name_Id := N + 392;
+ Name_Unchecked_Access : constant Name_Id := N + 393;
+ Name_Unconstrained_Array : constant Name_Id := N + 394;
+ Name_Universal_Literal_String : constant Name_Id := N + 395; -- GNAT
+ Name_Unrestricted_Access : constant Name_Id := N + 396; -- GNAT
+ Name_VADS_Size : constant Name_Id := N + 397; -- GNAT
+ Name_Val : constant Name_Id := N + 398;
+ Name_Valid : constant Name_Id := N + 399;
+ Name_Value_Size : constant Name_Id := N + 400; -- GNAT
+ Name_Version : constant Name_Id := N + 401;
+ Name_Wchar_T_Size : constant Name_Id := N + 402; -- GNAT
+ Name_Wide_Width : constant Name_Id := N + 403;
+ Name_Width : constant Name_Id := N + 404;
+ Name_Word_Size : constant Name_Id := N + 405; -- GNAT
-- Attributes that designate attributes returning renamable functions,
-- i.e. functions that return other than a universal value.
- First_Renamable_Function_Attribute : constant Name_Id := N + 402;
- Name_Adjacent : constant Name_Id := N + 402;
- Name_Ceiling : constant Name_Id := N + 403;
- Name_Copy_Sign : constant Name_Id := N + 404;
- Name_Floor : constant Name_Id := N + 405;
- Name_Fraction : constant Name_Id := N + 406;
- Name_Image : constant Name_Id := N + 407;
- Name_Input : constant Name_Id := N + 408;
- Name_Machine : constant Name_Id := N + 409;
- Name_Max : constant Name_Id := N + 410;
- Name_Min : constant Name_Id := N + 411;
- Name_Model : constant Name_Id := N + 412;
- Name_Pred : constant Name_Id := N + 413;
- Name_Remainder : constant Name_Id := N + 414;
- Name_Rounding : constant Name_Id := N + 415;
- Name_Succ : constant Name_Id := N + 416;
- Name_Truncation : constant Name_Id := N + 417;
- Name_Value : constant Name_Id := N + 418;
- Name_Wide_Image : constant Name_Id := N + 419;
- Name_Wide_Value : constant Name_Id := N + 420;
- Last_Renamable_Function_Attribute : constant Name_Id := N + 420;
+ First_Renamable_Function_Attribute : constant Name_Id := N + 406;
+ Name_Adjacent : constant Name_Id := N + 406;
+ Name_Ceiling : constant Name_Id := N + 407;
+ Name_Copy_Sign : constant Name_Id := N + 408;
+ Name_Floor : constant Name_Id := N + 409;
+ Name_Fraction : constant Name_Id := N + 410;
+ Name_Image : constant Name_Id := N + 411;
+ Name_Input : constant Name_Id := N + 412;
+ Name_Machine : constant Name_Id := N + 413;
+ Name_Max : constant Name_Id := N + 414;
+ Name_Min : constant Name_Id := N + 415;
+ Name_Model : constant Name_Id := N + 416;
+ Name_Pred : constant Name_Id := N + 417;
+ Name_Remainder : constant Name_Id := N + 418;
+ Name_Rounding : constant Name_Id := N + 419;
+ Name_Succ : constant Name_Id := N + 420;
+ Name_Truncation : constant Name_Id := N + 421;
+ Name_Value : constant Name_Id := N + 422;
+ Name_Wide_Image : constant Name_Id := N + 423;
+ Name_Wide_Value : constant Name_Id := N + 424;
+ Last_Renamable_Function_Attribute : constant Name_Id := N + 424;
-- Attributes that designate procedures
- First_Procedure_Attribute : constant Name_Id := N + 421;
- Name_Output : constant Name_Id := N + 421;
- Name_Read : constant Name_Id := N + 422;
- Name_Write : constant Name_Id := N + 423;
- Last_Procedure_Attribute : constant Name_Id := N + 423;
+ First_Procedure_Attribute : constant Name_Id := N + 425;
+ Name_Output : constant Name_Id := N + 425;
+ Name_Read : constant Name_Id := N + 426;
+ Name_Write : constant Name_Id := N + 427;
+ Last_Procedure_Attribute : constant Name_Id := N + 427;
-- Remaining attributes are ones that return entities
- First_Entity_Attribute_Name : constant Name_Id := N + 424;
- Name_Elab_Body : constant Name_Id := N + 424; -- GNAT
- Name_Elab_Spec : constant Name_Id := N + 425; -- GNAT
- Name_Storage_Pool : constant Name_Id := N + 426;
+ First_Entity_Attribute_Name : constant Name_Id := N + 428;
+ Name_Elab_Body : constant Name_Id := N + 428; -- GNAT
+ Name_Elab_Spec : constant Name_Id := N + 429; -- GNAT
+ Name_Storage_Pool : constant Name_Id := N + 430;
-- These attributes are the ones that return types
- First_Type_Attribute_Name : constant Name_Id := N + 427;
- Name_Base : constant Name_Id := N + 427;
- Name_Class : constant Name_Id := N + 428;
- Last_Type_Attribute_Name : constant Name_Id := N + 428;
- Last_Entity_Attribute_Name : constant Name_Id := N + 428;
- Last_Attribute_Name : constant Name_Id := N + 428;
+ First_Type_Attribute_Name : constant Name_Id := N + 431;
+ Name_Base : constant Name_Id := N + 431;
+ Name_Class : constant Name_Id := N + 432;
+ Last_Type_Attribute_Name : constant Name_Id := N + 432;
+ Last_Entity_Attribute_Name : constant Name_Id := N + 432;
+ Last_Attribute_Name : constant Name_Id := N + 432;
-- Names of recognized locking policy identifiers
@@ -718,10 +722,10 @@ package Snames is
-- name (e.g. C for Ceiling_Locking). If new policy names are added,
-- the first character must be distinct.
- First_Locking_Policy_Name : constant Name_Id := N + 429;
- Name_Ceiling_Locking : constant Name_Id := N + 429;
- Name_Inheritance_Locking : constant Name_Id := N + 430;
- Last_Locking_Policy_Name : constant Name_Id := N + 430;
+ First_Locking_Policy_Name : constant Name_Id := N + 433;
+ Name_Ceiling_Locking : constant Name_Id := N + 433;
+ Name_Inheritance_Locking : constant Name_Id := N + 434;
+ Last_Locking_Policy_Name : constant Name_Id := N + 434;
-- Names of recognized queuing policy identifiers.
@@ -729,10 +733,10 @@ package Snames is
-- name (e.g. F for FIFO_Queuing). If new policy names are added,
-- the first character must be distinct.
- First_Queuing_Policy_Name : constant Name_Id := N + 431;
- Name_FIFO_Queuing : constant Name_Id := N + 431;
- Name_Priority_Queuing : constant Name_Id := N + 432;
- Last_Queuing_Policy_Name : constant Name_Id := N + 432;
+ First_Queuing_Policy_Name : constant Name_Id := N + 435;
+ Name_FIFO_Queuing : constant Name_Id := N + 435;
+ Name_Priority_Queuing : constant Name_Id := N + 436;
+ Last_Queuing_Policy_Name : constant Name_Id := N + 436;
-- Names of recognized task dispatching policy identifiers
@@ -740,191 +744,193 @@ package Snames is
-- name (e.g. F for FIFO_WIthinn_Priorities). If new policy names
-- are added, the first character must be distinct.
- First_Task_Dispatching_Policy_Name : constant Name_Id := N + 433;
- Name_Fifo_Within_Priorities : constant Name_Id := N + 433;
- Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 433;
+ First_Task_Dispatching_Policy_Name : constant Name_Id := N + 437;
+ Name_Fifo_Within_Priorities : constant Name_Id := N + 437;
+ Last_Task_Dispatching_Policy_Name : constant Name_Id := N + 437;
-- Names of recognized checks for pragma Suppress
- First_Check_Name : constant Name_Id := N + 434;
- Name_Access_Check : constant Name_Id := N + 434;
- Name_Accessibility_Check : constant Name_Id := N + 435;
- Name_Discriminant_Check : constant Name_Id := N + 436;
- Name_Division_Check : constant Name_Id := N + 437;
- Name_Elaboration_Check : constant Name_Id := N + 438;
- Name_Index_Check : constant Name_Id := N + 439;
- Name_Length_Check : constant Name_Id := N + 440;
- Name_Overflow_Check : constant Name_Id := N + 441;
- Name_Range_Check : constant Name_Id := N + 442;
- Name_Storage_Check : constant Name_Id := N + 443;
- Name_Tag_Check : constant Name_Id := N + 444;
- Name_All_Checks : constant Name_Id := N + 445;
- Last_Check_Name : constant Name_Id := N + 445;
+ First_Check_Name : constant Name_Id := N + 438;
+ Name_Access_Check : constant Name_Id := N + 438;
+ Name_Accessibility_Check : constant Name_Id := N + 439;
+ Name_Discriminant_Check : constant Name_Id := N + 440;
+ Name_Division_Check : constant Name_Id := N + 441;
+ Name_Elaboration_Check : constant Name_Id := N + 442;
+ Name_Index_Check : constant Name_Id := N + 443;
+ Name_Length_Check : constant Name_Id := N + 444;
+ Name_Overflow_Check : constant Name_Id := N + 445;
+ Name_Range_Check : constant Name_Id := N + 446;
+ Name_Storage_Check : constant Name_Id := N + 447;
+ Name_Tag_Check : constant Name_Id := N + 448;
+ Name_All_Checks : constant Name_Id := N + 449;
+ Last_Check_Name : constant Name_Id := N + 449;
-- Names corresponding to reserved keywords, excluding those already
-- declared in the attribute list (Access, Delta, Digits, Range).
- Name_Abort : constant Name_Id := N + 446;
- Name_Abs : constant Name_Id := N + 447;
- Name_Accept : constant Name_Id := N + 448;
- Name_And : constant Name_Id := N + 449;
- Name_All : constant Name_Id := N + 450;
- Name_Array : constant Name_Id := N + 451;
- Name_At : constant Name_Id := N + 452;
- Name_Begin : constant Name_Id := N + 453;
- Name_Body : constant Name_Id := N + 454;
- Name_Case : constant Name_Id := N + 455;
- Name_Constant : constant Name_Id := N + 456;
- Name_Declare : constant Name_Id := N + 457;
- Name_Delay : constant Name_Id := N + 458;
- Name_Do : constant Name_Id := N + 459;
- Name_Else : constant Name_Id := N + 460;
- Name_Elsif : constant Name_Id := N + 461;
- Name_End : constant Name_Id := N + 462;
- Name_Entry : constant Name_Id := N + 463;
- Name_Exception : constant Name_Id := N + 464;
- Name_Exit : constant Name_Id := N + 465;
- Name_For : constant Name_Id := N + 466;
- Name_Function : constant Name_Id := N + 467;
- Name_Generic : constant Name_Id := N + 468;
- Name_Goto : constant Name_Id := N + 469;
- Name_If : constant Name_Id := N + 470;
- Name_In : constant Name_Id := N + 471;
- Name_Is : constant Name_Id := N + 472;
- Name_Limited : constant Name_Id := N + 473;
- Name_Loop : constant Name_Id := N + 474;
- Name_Mod : constant Name_Id := N + 475;
- Name_New : constant Name_Id := N + 476;
- Name_Not : constant Name_Id := N + 477;
- Name_Null : constant Name_Id := N + 478;
- Name_Of : constant Name_Id := N + 479;
- Name_Or : constant Name_Id := N + 480;
- Name_Others : constant Name_Id := N + 481;
- Name_Out : constant Name_Id := N + 482;
- Name_Package : constant Name_Id := N + 483;
- Name_Pragma : constant Name_Id := N + 484;
- Name_Private : constant Name_Id := N + 485;
- Name_Procedure : constant Name_Id := N + 486;
- Name_Raise : constant Name_Id := N + 487;
- Name_Record : constant Name_Id := N + 488;
- Name_Rem : constant Name_Id := N + 489;
- Name_Renames : constant Name_Id := N + 490;
- Name_Return : constant Name_Id := N + 491;
- Name_Reverse : constant Name_Id := N + 492;
- Name_Select : constant Name_Id := N + 493;
- Name_Separate : constant Name_Id := N + 494;
- Name_Subtype : constant Name_Id := N + 495;
- Name_Task : constant Name_Id := N + 496;
- Name_Terminate : constant Name_Id := N + 497;
- Name_Then : constant Name_Id := N + 498;
- Name_Type : constant Name_Id := N + 499;
- Name_Use : constant Name_Id := N + 500;
- Name_When : constant Name_Id := N + 501;
- Name_While : constant Name_Id := N + 502;
- Name_With : constant Name_Id := N + 503;
- Name_Xor : constant Name_Id := N + 504;
+ Name_Abort : constant Name_Id := N + 450;
+ Name_Abs : constant Name_Id := N + 451;
+ Name_Accept : constant Name_Id := N + 452;
+ Name_And : constant Name_Id := N + 453;
+ Name_All : constant Name_Id := N + 454;
+ Name_Array : constant Name_Id := N + 455;
+ Name_At : constant Name_Id := N + 456;
+ Name_Begin : constant Name_Id := N + 457;
+ Name_Body : constant Name_Id := N + 458;
+ Name_Case : constant Name_Id := N + 459;
+ Name_Constant : constant Name_Id := N + 460;
+ Name_Declare : constant Name_Id := N + 461;
+ Name_Delay : constant Name_Id := N + 462;
+ Name_Do : constant Name_Id := N + 463;
+ Name_Else : constant Name_Id := N + 464;
+ Name_Elsif : constant Name_Id := N + 465;
+ Name_End : constant Name_Id := N + 466;
+ Name_Entry : constant Name_Id := N + 467;
+ Name_Exception : constant Name_Id := N + 468;
+ Name_Exit : constant Name_Id := N + 469;
+ Name_For : constant Name_Id := N + 470;
+ Name_Function : constant Name_Id := N + 471;
+ Name_Generic : constant Name_Id := N + 472;
+ Name_Goto : constant Name_Id := N + 473;
+ Name_If : constant Name_Id := N + 474;
+ Name_In : constant Name_Id := N + 475;
+ Name_Is : constant Name_Id := N + 476;
+ Name_Limited : constant Name_Id := N + 477;
+ Name_Loop : constant Name_Id := N + 478;
+ Name_Mod : constant Name_Id := N + 479;
+ Name_New : constant Name_Id := N + 480;
+ Name_Not : constant Name_Id := N + 481;
+ Name_Null : constant Name_Id := N + 482;
+ Name_Of : constant Name_Id := N + 483;
+ Name_Or : constant Name_Id := N + 484;
+ Name_Others : constant Name_Id := N + 485;
+ Name_Out : constant Name_Id := N + 486;
+ Name_Package : constant Name_Id := N + 487;
+ Name_Pragma : constant Name_Id := N + 488;
+ Name_Private : constant Name_Id := N + 489;
+ Name_Procedure : constant Name_Id := N + 490;
+ Name_Raise : constant Name_Id := N + 491;
+ Name_Record : constant Name_Id := N + 492;
+ Name_Rem : constant Name_Id := N + 493;
+ Name_Renames : constant Name_Id := N + 494;
+ Name_Return : constant Name_Id := N + 495;
+ Name_Reverse : constant Name_Id := N + 496;
+ Name_Select : constant Name_Id := N + 497;
+ Name_Separate : constant Name_Id := N + 498;
+ Name_Subtype : constant Name_Id := N + 499;
+ Name_Task : constant Name_Id := N + 500;
+ Name_Terminate : constant Name_Id := N + 501;
+ Name_Then : constant Name_Id := N + 502;
+ Name_Type : constant Name_Id := N + 503;
+ Name_Use : constant Name_Id := N + 504;
+ Name_When : constant Name_Id := N + 505;
+ Name_While : constant Name_Id := N + 506;
+ Name_With : constant Name_Id := N + 507;
+ Name_Xor : constant Name_Id := N + 508;
-- Names of intrinsic subprograms
-- Note: Asm is missing from this list, since Asm is a legitimate
-- convention name. So is To_Adress, which is a GNAT attribute.
- First_Intrinsic_Name : constant Name_Id := N + 505;
- Name_Divide : constant Name_Id := N + 505;
- Name_Enclosing_Entity : constant Name_Id := N + 506;
- Name_Exception_Information : constant Name_Id := N + 507;
- Name_Exception_Message : constant Name_Id := N + 508;
- Name_Exception_Name : constant Name_Id := N + 509;
- Name_File : constant Name_Id := N + 510;
- Name_Import_Address : constant Name_Id := N + 511;
- Name_Import_Largest_Value : constant Name_Id := N + 512;
- Name_Import_Value : constant Name_Id := N + 513;
- Name_Is_Negative : constant Name_Id := N + 514;
- Name_Line : constant Name_Id := N + 515;
- Name_Rotate_Left : constant Name_Id := N + 516;
- Name_Rotate_Right : constant Name_Id := N + 517;
- Name_Shift_Left : constant Name_Id := N + 518;
- Name_Shift_Right : constant Name_Id := N + 519;
- Name_Shift_Right_Arithmetic : constant Name_Id := N + 520;
- Name_Source_Location : constant Name_Id := N + 521;
- Name_Unchecked_Conversion : constant Name_Id := N + 522;
- Name_Unchecked_Deallocation : constant Name_Id := N + 523;
- Name_To_Pointer : constant Name_Id := N + 524;
- Last_Intrinsic_Name : constant Name_Id := N + 524;
+ First_Intrinsic_Name : constant Name_Id := N + 509;
+ Name_Divide : constant Name_Id := N + 509;
+ Name_Enclosing_Entity : constant Name_Id := N + 510;
+ Name_Exception_Information : constant Name_Id := N + 511;
+ Name_Exception_Message : constant Name_Id := N + 512;
+ Name_Exception_Name : constant Name_Id := N + 513;
+ Name_File : constant Name_Id := N + 514;
+ Name_Import_Address : constant Name_Id := N + 515;
+ Name_Import_Largest_Value : constant Name_Id := N + 516;
+ Name_Import_Value : constant Name_Id := N + 517;
+ Name_Is_Negative : constant Name_Id := N + 518;
+ Name_Line : constant Name_Id := N + 519;
+ Name_Rotate_Left : constant Name_Id := N + 520;
+ Name_Rotate_Right : constant Name_Id := N + 521;
+ Name_Shift_Left : constant Name_Id := N + 522;
+ Name_Shift_Right : constant Name_Id := N + 523;
+ Name_Shift_Right_Arithmetic : constant Name_Id := N + 524;
+ Name_Source_Location : constant Name_Id := N + 525;
+ Name_Unchecked_Conversion : constant Name_Id := N + 526;
+ Name_Unchecked_Deallocation : constant Name_Id := N + 527;
+ Name_To_Pointer : constant Name_Id := N + 528;
+ Last_Intrinsic_Name : constant Name_Id := N + 528;
-- Reserved words used only in Ada 95
- First_95_Reserved_Word : constant Name_Id := N + 525;
- Name_Abstract : constant Name_Id := N + 525;
- Name_Aliased : constant Name_Id := N + 526;
- Name_Protected : constant Name_Id := N + 527;
- Name_Until : constant Name_Id := N + 528;
- Name_Requeue : constant Name_Id := N + 529;
- Name_Tagged : constant Name_Id := N + 530;
- Last_95_Reserved_Word : constant Name_Id := N + 530;
+ First_95_Reserved_Word : constant Name_Id := N + 529;
+ Name_Abstract : constant Name_Id := N + 529;
+ Name_Aliased : constant Name_Id := N + 530;
+ Name_Protected : constant Name_Id := N + 531;
+ Name_Until : constant Name_Id := N + 532;
+ Name_Requeue : constant Name_Id := N + 533;
+ Name_Tagged : constant Name_Id := N + 534;
+ Last_95_Reserved_Word : constant Name_Id := N + 534;
subtype Ada_95_Reserved_Words is
Name_Id range First_95_Reserved_Word .. Last_95_Reserved_Word;
-- Miscellaneous names used in semantic checking
- Name_Raise_Exception : constant Name_Id := N + 531;
+ Name_Raise_Exception : constant Name_Id := N + 535;
-- Additional reserved words in GNAT Project Files
-- Note that Name_External is already previously declared
- Name_Binder : constant Name_Id := N + 532;
- Name_Body_Suffix : constant Name_Id := N + 533;
- Name_Builder : constant Name_Id := N + 534;
- Name_Compiler : constant Name_Id := N + 535;
- Name_Cross_Reference : constant Name_Id := N + 536;
- Name_Default_Switches : constant Name_Id := N + 537;
- Name_Exec_Dir : constant Name_Id := N + 538;
- Name_Executable : constant Name_Id := N + 539;
- Name_Executable_Suffix : constant Name_Id := N + 540;
- Name_Extends : constant Name_Id := N + 541;
- Name_Finder : constant Name_Id := N + 542;
- Name_Global_Configuration_Pragmas : constant Name_Id := N + 543;
- Name_Gnatls : constant Name_Id := N + 544;
- Name_Gnatstub : constant Name_Id := N + 545;
- Name_Implementation : constant Name_Id := N + 546;
- Name_Implementation_Exceptions : constant Name_Id := N + 547;
- Name_Implementation_Suffix : constant Name_Id := N + 548;
- Name_Languages : constant Name_Id := N + 549;
- Name_Library_Dir : constant Name_Id := N + 550;
- Name_Library_Auto_Init : constant Name_Id := N + 551;
- Name_Library_GCC : constant Name_Id := N + 552;
- Name_Library_Interface : constant Name_Id := N + 553;
- Name_Library_Kind : constant Name_Id := N + 554;
- Name_Library_Name : constant Name_Id := N + 555;
- Name_Library_Options : constant Name_Id := N + 556;
- Name_Library_Src_Dir : constant Name_Id := N + 557;
- Name_Library_Symbol_File : constant Name_Id := N + 558;
- Name_Library_Version : constant Name_Id := N + 559;
- Name_Linker : constant Name_Id := N + 560;
- Name_Local_Configuration_Pragmas : constant Name_Id := N + 561;
- Name_Locally_Removed_Files : constant Name_Id := N + 562;
- Name_Naming : constant Name_Id := N + 563;
- Name_Object_Dir : constant Name_Id := N + 564;
- Name_Pretty_Printer : constant Name_Id := N + 565;
- Name_Project : constant Name_Id := N + 566;
- Name_Separate_Suffix : constant Name_Id := N + 567;
- Name_Source_Dirs : constant Name_Id := N + 568;
- Name_Source_Files : constant Name_Id := N + 569;
- Name_Source_List_File : constant Name_Id := N + 570;
- Name_Spec : constant Name_Id := N + 571;
- Name_Spec_Suffix : constant Name_Id := N + 572;
- Name_Specification : constant Name_Id := N + 573;
- Name_Specification_Exceptions : constant Name_Id := N + 574;
- Name_Specification_Suffix : constant Name_Id := N + 575;
- Name_Switches : constant Name_Id := N + 576;
+ Name_Binder : constant Name_Id := N + 536;
+ Name_Body_Suffix : constant Name_Id := N + 537;
+ Name_Builder : constant Name_Id := N + 538;
+ Name_Compiler : constant Name_Id := N + 539;
+ Name_Cross_Reference : constant Name_Id := N + 540;
+ Name_Default_Switches : constant Name_Id := N + 541;
+ Name_Exec_Dir : constant Name_Id := N + 542;
+ Name_Executable : constant Name_Id := N + 543;
+ Name_Executable_Suffix : constant Name_Id := N + 544;
+ Name_Extends : constant Name_Id := N + 545;
+ Name_Finder : constant Name_Id := N + 546;
+ Name_Global_Configuration_Pragmas : constant Name_Id := N + 547;
+ Name_Gnatls : constant Name_Id := N + 548;
+ Name_Gnatstub : constant Name_Id := N + 549;
+ Name_Implementation : constant Name_Id := N + 550;
+ Name_Implementation_Exceptions : constant Name_Id := N + 551;
+ Name_Implementation_Suffix : constant Name_Id := N + 552;
+ Name_Languages : constant Name_Id := N + 553;
+ Name_Library_Dir : constant Name_Id := N + 554;
+ Name_Library_Auto_Init : constant Name_Id := N + 555;
+ Name_Library_GCC : constant Name_Id := N + 556;
+ Name_Library_Interface : constant Name_Id := N + 557;
+ Name_Library_Kind : constant Name_Id := N + 558;
+ Name_Library_Name : constant Name_Id := N + 559;
+ Name_Library_Options : constant Name_Id := N + 560;
+ Name_Library_Reference_Symbol_File : constant Name_Id := N + 561;
+ Name_Library_Src_Dir : constant Name_Id := N + 562;
+ Name_Library_Symbol_File : constant Name_Id := N + 563;
+ Name_Library_Symbol_Policy : constant Name_Id := N + 564;
+ Name_Library_Version : constant Name_Id := N + 565;
+ Name_Linker : constant Name_Id := N + 566;
+ Name_Local_Configuration_Pragmas : constant Name_Id := N + 567;
+ Name_Locally_Removed_Files : constant Name_Id := N + 568;
+ Name_Naming : constant Name_Id := N + 569;
+ Name_Object_Dir : constant Name_Id := N + 570;
+ Name_Pretty_Printer : constant Name_Id := N + 571;
+ Name_Project : constant Name_Id := N + 572;
+ Name_Separate_Suffix : constant Name_Id := N + 573;
+ Name_Source_Dirs : constant Name_Id := N + 574;
+ Name_Source_Files : constant Name_Id := N + 575;
+ Name_Source_List_File : constant Name_Id := N + 576;
+ Name_Spec : constant Name_Id := N + 577;
+ Name_Spec_Suffix : constant Name_Id := N + 578;
+ Name_Specification : constant Name_Id := N + 579;
+ Name_Specification_Exceptions : constant Name_Id := N + 580;
+ Name_Specification_Suffix : constant Name_Id := N + 581;
+ Name_Switches : constant Name_Id := N + 582;
-- Other miscellaneous names used in front end
- Name_Unaligned_Valid : constant Name_Id := N + 577;
+ Name_Unaligned_Valid : constant Name_Id := N + 583;
-- Mark last defined name for consistency check in Snames body
- Last_Predefined_Name : constant Name_Id := N + 577;
+ Last_Predefined_Name : constant Name_Id := N + 583;
subtype Any_Operator_Name is Name_Id range
First_Operator_Name .. Last_Operator_Name;
@@ -1257,6 +1263,7 @@ package Snames is
Pragma_Task_Info,
Pragma_Task_Name,
Pragma_Task_Storage,
+ Pragma_Thread_Body,
Pragma_Time_Slice,
Pragma_Title,
Pragma_Unchecked_Union,
diff --git a/gcc/ada/snames.h b/gcc/ada/snames.h
index b71c60b8998..d81122763c0 100644
--- a/gcc/ada/snames.h
+++ b/gcc/ada/snames.h
@@ -326,21 +326,22 @@ extern unsigned char Get_Pragma_Id (int);
#define Pragma_Task_Info 124
#define Pragma_Task_Name 125
#define Pragma_Task_Storage 126
-#define Pragma_Time_Slice 127
-#define Pragma_Title 128
-#define Pragma_Unchecked_Union 129
-#define Pragma_Unimplemented_Unit 130
-#define Pragma_Unreferenced 131
-#define Pragma_Unreserve_All_Interrupts 132
-#define Pragma_Volatile 133
-#define Pragma_Volatile_Components 134
-#define Pragma_Weak_External 135
+#define Pragma_Thread_Body 127
+#define Pragma_Time_Slice 128
+#define Pragma_Title 129
+#define Pragma_Unchecked_Union 130
+#define Pragma_Unimplemented_Unit 131
+#define Pragma_Unreferenced 132
+#define Pragma_Unreserve_All_Interrupts 133
+#define Pragma_Volatile 134
+#define Pragma_Volatile_Components 135
+#define Pragma_Weak_External 136
/* The following are deliberately out of alphabetical order, see Snames */
-#define Pragma_AST_Entry 136
-#define Pragma_Storage_Size 137
-#define Pragma_Storage_Unit 138
+#define Pragma_AST_Entry 137
+#define Pragma_Storage_Size 138
+#define Pragma_Storage_Unit 139
/* Define the numeric values for the conventions. */
diff --git a/gcc/ada/socket.c b/gcc/ada/socket.c
index f660975fcba..89b8163fada 100644
--- a/gcc/ada/socket.c
+++ b/gcc/ada/socket.c
@@ -66,19 +66,18 @@
#include "raise.h"
-extern void __gnat_free_socket_set PARAMS ((fd_set *));
-extern void __gnat_last_socket_in_set PARAMS ((fd_set *, int *));
-extern void __gnat_get_socket_from_set PARAMS ((fd_set *, int *, int *));
-extern void __gnat_insert_socket_in_set PARAMS ((fd_set *, int));
-extern int __gnat_is_socket_in_set PARAMS ((fd_set *, int));
-extern fd_set *__gnat_new_socket_set PARAMS ((fd_set *));
-extern void __gnat_remove_socket_from_set PARAMS ((fd_set *, int));
+extern void __gnat_free_socket_set (fd_set *);
+extern void __gnat_last_socket_in_set (fd_set *, int *);
+extern void __gnat_get_socket_from_set (fd_set *, int *, int *);
+extern void __gnat_insert_socket_in_set (fd_set *, int);
+extern int __gnat_is_socket_in_set (fd_set *, int);
+extern fd_set *__gnat_new_socket_set (fd_set *);
+extern void __gnat_remove_socket_from_set (fd_set *, int);
/* Free socket set. */
void
-__gnat_free_socket_set (set)
- fd_set *set;
+__gnat_free_socket_set (fd_set *set)
{
__gnat_free (set);
}
@@ -89,9 +88,7 @@ __gnat_free_socket_set (set)
actual largest socket in the socket set. */
void
-__gnat_last_socket_in_set (set, last)
- fd_set *set;
- int *last;
+__gnat_last_socket_in_set (fd_set *set, int *last)
{
int s;
int l;
@@ -122,10 +119,7 @@ __gnat_last_socket_in_set (set, last)
socket in the socket set. */
void
-__gnat_get_socket_from_set (set, last, socket)
- fd_set *set;
- int *last;
- int *socket;
+__gnat_get_socket_from_set (fd_set *set, int *last, int *socket)
{
*socket = *last;
FD_CLR (*socket, set);
@@ -135,9 +129,7 @@ __gnat_get_socket_from_set (set, last, socket)
/* Insert SOCKET in the socket set SET. */
void
-__gnat_insert_socket_in_set (set, socket)
- fd_set *set;
- int socket;
+__gnat_insert_socket_in_set (fd_set *set, int socket)
{
FD_SET (socket, set);
}
@@ -145,9 +137,7 @@ __gnat_insert_socket_in_set (set, socket)
/* Check whether a given SOCKET is in the socket set SET. */
int
-__gnat_is_socket_in_set (set, socket)
- fd_set *set;
- int socket;
+__gnat_is_socket_in_set (fd_set *set, int socket)
{
return FD_ISSET (socket, set);
}
@@ -155,8 +145,7 @@ __gnat_is_socket_in_set (set, socket)
/* Allocate a new socket set and set it as empty. */
fd_set *
-__gnat_new_socket_set (set)
- fd_set *set;
+__gnat_new_socket_set (fd_set *set)
{
fd_set *new;
@@ -173,9 +162,7 @@ __gnat_new_socket_set (set)
/* Remove SOCKET from the socket set SET. */
void
-__gnat_remove_socket_from_set (set, socket)
- fd_set *set;
- int socket;
+__gnat_remove_socket_from_set (fd_set *set, int socket)
{
FD_CLR (socket, set);
}
diff --git a/gcc/ada/sprint.adb b/gcc/ada/sprint.adb
index 0cb991802e4..c0ac7bcd2b1 100644
--- a/gcc/ada/sprint.adb
+++ b/gcc/ada/sprint.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1992-2002, Free Software Foundation, Inc. --
+-- Copyright (C) 1992-2003, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -61,7 +61,7 @@ package body Sprint is
Dump_Generated_Only : Boolean;
-- Set True if the -gnatG (dump generated tree) debug flag is set
- -- or for Print_Generated_Code (-gnatG) or Dump_Gnerated_Code (-gnatD).
+ -- or for Print_Generated_Code (-gnatG) or Dump_Generated_Code (-gnatD).
Dump_Freeze_Null : Boolean;
-- Set True if freeze nodes and non-source null statements output
@@ -928,7 +928,14 @@ package body Sprint is
Set_Debug_Sloc;
Sprint_Bar_List (Choices (Node));
Write_Str (" => ");
- Sprint_Node (Expression (Node));
+
+ -- Ada0Y (AI-287): Print the mbox if present
+
+ if Box_Present (Node) then
+ Write_Str_With_Col_Check ("<>");
+ else
+ Sprint_Node (Expression (Node));
+ end if;
when N_Component_Clause =>
Write_Indent;
@@ -2490,7 +2497,15 @@ package body Sprint is
else
if First_Name (Node) or else not Dump_Original_Only then
- Write_Indent_Str ("with ");
+
+ -- Ada0Y (AI-50217): Print limited with_clauses
+
+ if Limited_Present (Node) then
+ Write_Indent_Str ("limited with ");
+ else
+ Write_Indent_Str ("with ");
+ end if;
+
else
Write_Str (", ");
end if;
@@ -2503,7 +2518,6 @@ package body Sprint is
end if;
when N_With_Type_Clause =>
-
Write_Indent_Str ("with type ");
Sprint_Node_Sloc (Name (Node));
@@ -2777,10 +2791,11 @@ package body Sprint is
then
Write_Id (Entity (Parent (N)));
- -- For any other kind of node with an associated entity, output it.
+ -- For any other node with an associated entity, output it
elsif Nkind (N) in N_Has_Entity
- and then Present (Entity (N))
+ and then Present (Entity_Or_Associated_Node (N))
+ and then Nkind (Entity_Or_Associated_Node (N)) in N_Entity
then
Write_Id (Entity (N));
diff --git a/fastjar/stamp-h.in b/gcc/ada/stamp-xgnatug
index 9788f70238c..9788f70238c 100644
--- a/fastjar/stamp-h.in
+++ b/gcc/ada/stamp-xgnatug
diff --git a/gcc/ada/stringt.h b/gcc/ada/stringt.h
index 1260909ac30..f204ea6cf71 100644
--- a/gcc/ada/stringt.h
+++ b/gcc/ada/stringt.h
@@ -6,7 +6,7 @@
* *
* C Header File *
* *
- * Copyright (C) 1992-2001 Free Software Foundation, Inc. *
+ * Copyright (C) 1992-2003 Free Software Foundation, Inc. *
* *
* GNAT is free software; you can redistribute it and/or modify it under *
* terms of the GNU General Public License as published by the Free Soft- *
@@ -26,23 +26,23 @@
/* This file is the C file that corresponds to the Ada package spec
Stringt. It was created manually from stringt.ads and stringt.adb
-
+
Note: only the access functions are provided, since the tree transformer
is not allowed to modify the tree or its auxiliary structures.
-
+
This package contains routines for handling the strings table which is
used to store string constants encountered in the source, and also those
additional string constants generated by compile time concatenation and
other similar processing.
-
+
A string constant in this table consists of a series of Char_Code values,
so that 16-bit character codes can be properly handled if this feature is
implemented in the scanner.
-
+
There is no guarantee that hashing is used in the implementation. This
means that the caller cannot count on having the same Id value for two
identical strings stored separately.
-
+
The String_Id values reference entries in the Strings table, which
contains String_Entry records that record the length of each stored string
and its starting location in the String_Chars table. */
diff --git a/gcc/ada/switch-c.adb b/gcc/ada/switch-c.adb
index c76c4a1af55..2387cec446f 100644
--- a/gcc/ada/switch-c.adb
+++ b/gcc/ada/switch-c.adb
@@ -96,8 +96,8 @@ package body Switch.C is
when False =>
- -- There are only two front-end switches that
- -- do not start with -gnat, namely -I and --RTS
+ -- There are few front-end switches that
+ -- do not start with -gnat: -I, --RTS
if Switch_Chars (Ptr) = 'I' then
Store_Switch := False;
@@ -216,6 +216,10 @@ package body Switch.C is
Ptr := Ptr + 1;
Operating_Mode := Check_Semantics;
+ if Tree_Output then
+ ASIS_Mode := True;
+ end if;
+
-- Processing for d switch
when 'd' =>
@@ -284,20 +288,21 @@ package body Switch.C is
Xref_Active := False;
Set_Debug_Flag ('g');
- -- Processing for e switch
+ -- -gnate? (extended switches)
when 'e' =>
- -- Only -gnateD and -gnatep= are stored
-
Ptr := Ptr + 1;
+ -- The -gnate? switches are all double character switches
+ -- so we must always have a character after the e.
+
if Ptr > Max then
raise Bad_Switch;
end if;
case Switch_Chars (Ptr) is
- -- Configuration pragmas
+ -- -gnatec (configuration pragmas)
when 'c' =>
Store_Switch := False;
@@ -347,7 +352,7 @@ package body Switch.C is
return;
- -- Symbol definition
+ -- -gnateD switch (symbol definition)
when 'D' =>
Store_Switch := False;
@@ -369,7 +374,7 @@ package body Switch.C is
(Storing'First .. First_Stored + Max - Ptr + 2));
return;
- -- Full source path for brief error messages
+ -- -gnatef (full source path for brief error messages)
when 'f' =>
Store_Switch := False;
@@ -377,7 +382,7 @@ package body Switch.C is
Full_Path_Name_For_Brief_Errors := True;
return;
- -- Mapping file
+ -- -gnatem (mapping file)
when 'm' =>
Store_Switch := False;
@@ -398,7 +403,7 @@ package body Switch.C is
new String'(Switch_Chars (Ptr .. Max));
return;
- -- Preprocessing data file
+ -- -gnatep (preprocessing data file)
when 'p' =>
Store_Switch := False;
@@ -433,19 +438,21 @@ package body Switch.C is
Store_Compilation_Switch (To_Store);
end;
- return;
+ return;
+
+ -- All other -gnate? switches are unassigned
when others =>
raise Bad_Switch;
end case;
- -- Processing for E switch
+ -- -gnatE (dynamic elaboration checks)
when 'E' =>
Ptr := Ptr + 1;
Dynamic_Elaboration_Checks := True;
- -- Processing for f switch
+ -- -gnatf (full error messages)
when 'f' =>
Ptr := Ptr + 1;
@@ -633,12 +640,22 @@ package body Switch.C is
Ptr := Ptr + 1;
Operating_Mode := Check_Syntax;
+ -- Processing for S switch
+
+ when 'S' =>
+ Print_Standard := True;
+ Ptr := Ptr + 1;
+
-- Processing for t switch
when 't' =>
Ptr := Ptr + 1;
Tree_Output := True;
- ASIS_Mode := True;
+
+ if Operating_Mode = Check_Semantics then
+ ASIS_Mode := True;
+ end if;
+
Back_Annotate_Rep_Info := True;
-- Processing for T switch
diff --git a/gcc/ada/symbols.adb b/gcc/ada/symbols.adb
index 2c3e7d0ac08..0ccd4cbf666 100644
--- a/gcc/ada/symbols.adb
+++ b/gcc/ada/symbols.adb
@@ -36,14 +36,18 @@ package body Symbols is
----------------
procedure Initialize
- (Symbol_File : String;
- Force : Boolean;
- Quiet : Boolean;
- Success : out Boolean)
+ (Symbol_File : String;
+ Reference : String;
+ Symbol_Policy : Policy;
+ Quiet : Boolean;
+ Version : String;
+ Success : out Boolean)
is
pragma Unreferenced (Symbol_File);
- pragma Unreferenced (Force);
+ pragma Unreferenced (Reference);
+ pragma Unreferenced (Symbol_Policy);
pragma Unreferenced (Quiet);
+ pragma Unreferenced (Version);
begin
Put_Line
("creation of symbol files are not supported on this platform");
diff --git a/gcc/ada/symbols.ads b/gcc/ada/symbols.ads
index 9e823eff74c..73fa2c8863c 100644
--- a/gcc/ada/symbols.ads
+++ b/gcc/ada/symbols.ads
@@ -33,6 +33,20 @@ with GNAT.OS_Lib; use GNAT.OS_Lib;
package Symbols is
+ type Policy is
+ -- Symbol policy:
+
+ (Autonomous,
+ -- Create a symbol file without considering any reference
+
+ Compliant,
+ -- Either create a symbol file with the same major and minor IDs if
+ -- all symbols are already found in the reference file or with an
+ -- incremented minor ID, if not.
+
+ Controlled);
+ -- Fail if symbols are not the same as those in the reference file
+
type Symbol_Kind is (Data, Proc);
-- To distinguish between the different kinds of symbols
@@ -52,16 +66,18 @@ package Symbols is
-- The symbol tables
Original_Symbols : Symbol_Table.Instance;
- -- The symbols, if any, found in the original symbol table
+ -- The symbols, if any, found in the reference symbol table
Complete_Symbols : Symbol_Table.Instance;
-- The symbols, if any, found in the objects files
procedure Initialize
- (Symbol_File : String;
- Force : Boolean;
- Quiet : Boolean;
- Success : out Boolean);
+ (Symbol_File : String;
+ Reference : String;
+ Symbol_Policy : Policy;
+ Quiet : Boolean;
+ Version : String;
+ Success : out Boolean);
-- Initialize a symbol file. This procedure must be called before
-- Processing any object file. Depending on the platforms and the
-- circumstances, additional messages may be issued if Quiet is False.
diff --git a/gcc/ada/sysdep.c b/gcc/ada/sysdep.c
index 836f3d53528..fcca318c7f5 100644
--- a/gcc/ada/sysdep.c
+++ b/gcc/ada/sysdep.c
@@ -44,7 +44,10 @@
#include "tsystem.h"
#include <fcntl.h>
#include <sys/stat.h>
-#include "time.h"
+#include <time.h>
+#ifdef VMS
+#include <unixio.h>
+#endif
#else
#include "config.h"
#include "system.h"
@@ -157,15 +160,13 @@ static const char *mode_append_binary_plus = "a+b";
const char __gnat_text_translation_required = 1;
void
-__gnat_set_binary_mode (handle)
- int handle;
+__gnat_set_binary_mode (int handle)
{
_setmode (handle, O_BINARY);
}
void
-__gnat_set_text_mode (handle)
- int handle;
+__gnat_set_text_mode (int handle)
{
_setmode (handle, O_TEXT);
}
@@ -178,8 +179,7 @@ __gnat_set_text_mode (handle)
"console". */
char *
-__gnat_ttyname (filedes)
- int filedes;
+__gnat_ttyname (int filedes)
{
if (isatty (filedes))
return "console";
@@ -206,22 +206,22 @@ __gnat_ttyname (filedes)
Calling FlushConsoleInputBuffer just after getch() fix the bug under
95/98. */
-static void winflush_init PARAMS ((void));
+static void winflush_init (void);
-static void winflush_95 PARAMS ((void));
+static void winflush_95 (void);
-static void winflush_nt PARAMS ((void));
+static void winflush_nt (void);
/* winflusfunction is set first to the winflushinit function which will check
the OS version 95/98 or NT/2000 */
-static void (*winflush_function) PARAMS ((void)) = winflush_init;
+static void (*winflush_function) (void) = winflush_init;
/* This function does the runtime check of the OS version and then sets
winflush_function to the appropriate function and then call it. */
static void
-winflush_init ()
+winflush_init (void)
{
DWORD dwVersion = GetVersion();
@@ -234,12 +234,12 @@ winflush_init ()
}
-static void winflush_95 ()
+static void winflush_95 (void)
{
FlushConsoleInputBuffer (GetStdHandle (STD_INPUT_HANDLE));
}
-static void winflush_nt ()
+static void winflush_nt (void)
{
/* Does nothing as there is no problem under NT. */
}
@@ -264,22 +264,19 @@ const char __gnat_text_translation_required = 0;
/* These functions do nothing in non-DOS systems. */
void
-__gnat_set_binary_mode (handle)
- int handle ATTRIBUTE_UNUSED;
+__gnat_set_binary_mode (int handle ATTRIBUTE_UNUSED)
{
}
void
-__gnat_set_text_mode (handle)
- int handle ATTRIBUTE_UNUSED;
+__gnat_set_text_mode (int handle ATTRIBUTE_UNUSED)
{
}
char *
-__gnat_ttyname (filedes)
- int filedes;
+__gnat_ttyname (int filedes)
{
#ifndef __vxworks
- extern char *ttyname PARAMS ((int));
+ extern char *ttyname (int);
return ttyname (filedes);
@@ -293,7 +290,8 @@ __gnat_ttyname (filedes)
#if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
|| (defined (__osf__) && ! defined (__alpha_vxworks)) || defined (WINNT) \
|| defined (__MACHTEN__) || defined (hpux) || defined (_AIX) \
- || (defined (__svr4__) && defined (i386)) || defined (__Lynx__)
+ || (defined (__svr4__) && defined (i386)) || defined (__Lynx__) \
+ || defined (__CYGWIN__) || defined (__FreeBSD__)
#ifdef __MINGW32__
#if OLD_MINGW
@@ -315,18 +313,14 @@ static int initted = 0;
/* Implements the common processing for getc_immediate and
getc_immediate_nowait. */
-extern void getc_immediate PARAMS ((FILE *, int *, int *));
-extern void getc_immediate_nowait PARAMS ((FILE *, int *, int *, int *));
-extern void getc_immediate_common PARAMS ((FILE *, int *, int *,
- int *, int));
+extern void getc_immediate (FILE *, int *, int *);
+extern void getc_immediate_nowait (FILE *, int *, int *, int *);
+extern void getc_immediate_common (FILE *, int *, int *, int *, int);
/* Called by Get_Immediate (Foo); */
void
-getc_immediate (stream, ch, end_of_file)
- FILE *stream;
- int *ch;
- int *end_of_file;
+getc_immediate (FILE *stream, int *ch, int *end_of_file)
{
int avail;
@@ -336,11 +330,7 @@ getc_immediate (stream, ch, end_of_file)
/* Called by Get_Immediate (Foo, Available); */
void
-getc_immediate_nowait (stream, ch, end_of_file, avail)
- FILE *stream;
- int *ch;
- int *end_of_file;
- int *avail;
+getc_immediate_nowait (FILE *stream, int *ch, int *end_of_file, int *avail)
{
getc_immediate_common (stream, ch, end_of_file, avail, 0);
}
@@ -348,18 +338,17 @@ getc_immediate_nowait (stream, ch, end_of_file, avail)
/* Called by getc_immediate () and getc_immediate_nowait () */
void
-getc_immediate_common (stream, ch, end_of_file, avail, waiting)
- FILE *stream;
- int *ch;
- int *end_of_file;
- int *avail;
- int waiting;
+getc_immediate_common (FILE *stream,
+ int *ch,
+ int *end_of_file,
+ int *avail,
+ int waiting)
{
#if defined (linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
|| (defined (__osf__) && ! defined (__alpha_vxworks)) \
|| defined (__CYGWIN32__) || defined (__MACHTEN__) || defined (hpux) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \
- || defined (__Lynx__)
+ || defined (__Lynx__) || defined (__FreeBSD__)
char c;
int nread;
int good_one = 0;
@@ -378,7 +367,7 @@ getc_immediate_common (stream, ch, end_of_file, avail, waiting)
#if defined(linux) || defined (sun) || defined (sgi) || defined (__EMX__) \
|| defined (__osf__) || defined (__MACHTEN__) || defined (hpux) \
|| defined (_AIX) || (defined (__svr4__) && defined (i386)) \
- || defined (__Lynx__)
+ || defined (__Lynx__) || defined (__FreeBSD__)
eof_ch = termios_rec.c_cc[VEOF];
/* If waiting (i.e. Get_Immediate (Char)), set MIN = 1 and wait for
@@ -614,31 +603,31 @@ getc_immediate_common (stream, ch, end_of_file, avail, waiting)
will want to import these). We use the same names as the routines used
by AdaMagic for compatibility. */
-char *rts_get_hInstance PARAMS ((void));
-char *rts_get_hPrevInstance PARAMS ((void));
-char *rts_get_lpCommandLine PARAMS ((void));
-int rts_get_nShowCmd PARAMS ((void));
+char *rts_get_hInstance (void);
+char *rts_get_hPrevInstance (void);
+char *rts_get_lpCommandLine (void);
+int rts_get_nShowCmd (void);
char *
-rts_get_hInstance ()
+rts_get_hInstance (void)
{
return (char *)GetModuleHandleA (0);
}
char *
-rts_get_hPrevInstance ()
+rts_get_hPrevInstance (void)
{
return 0;
}
char *
-rts_get_lpCommandLine ()
+rts_get_lpCommandLine (void)
{
return GetCommandLineA ();
}
int
-rts_get_nShowCmd ()
+rts_get_nShowCmd (void)
{
return 1;
}
@@ -650,10 +639,10 @@ rts_get_nShowCmd ()
#include <time.h>
-extern long get_gmtoff PARAMS ((void));
+extern long get_gmtoff (void);
long
-get_gmtoff ()
+get_gmtoff (void)
{
time_t t;
struct tm *ts;
@@ -668,22 +657,19 @@ get_gmtoff ()
#if defined (_AIX) || defined (__EMX__)
#define Lock_Task system__soft_links__lock_task
-extern void (*Lock_Task) PARAMS ((void));
+extern void (*Lock_Task) (void);
#define Unlock_Task system__soft_links__unlock_task
-extern void (*Unlock_Task) PARAMS ((void));
+extern void (*Unlock_Task) (void);
/* Provide reentrant version of localtime on Aix and OS/2. Note that AiX does
provide localtime_r, but in the library libc_r which doesn't get included
systematically, so we can't use it. */
-extern struct tm *__gnat_localtime_r PARAMS ((const time_t *,
- struct tm *));
+extern struct tm *__gnat_localtime_r (const time_t *, struct tm *);
struct tm *
-__gnat_localtime_r (timer, tp)
- const time_t *timer;
- struct tm *tp;
+__gnat_localtime_r (const time_t *timer, struct tm *tp)
{
struct tm *tmp;
@@ -703,12 +689,10 @@ __gnat_localtime_r (timer, tp)
spec is required. Only use when ___THREADS_POSIX4ad4__ is defined,
the Lynx convention when building against the legacy API. */
-extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *));
+extern struct tm *__gnat_localtime_r (const time_t *, struct tm *);
struct tm *
-__gnat_localtime_r (timer, tp)
- const time_t *timer;
- struct tm *tp;
+__gnat_localtime_r (const time_t *timer, struct tm *tp)
{
localtime_r (tp, timer);
return NULL;
@@ -723,12 +707,10 @@ __gnat_localtime_r (timer, tp)
/* All other targets provide a standard localtime_r */
-extern struct tm *__gnat_localtime_r PARAMS ((const time_t *, struct tm *));
+extern struct tm *__gnat_localtime_r (const time_t *, struct tm *);
struct tm *
-__gnat_localtime_r (timer, tp)
- const time_t *timer;
- struct tm *tp;
+__gnat_localtime_r (const time_t *timer, struct tm *tp)
{
return (struct tm *) localtime_r (timer, tp);
}
diff --git a/gcc/ada/targparm.ads b/gcc/ada/targparm.ads
index cf7aa2398ba..942b501af18 100644
--- a/gcc/ada/targparm.ads
+++ b/gcc/ada/targparm.ads
@@ -322,12 +322,6 @@ package Targparm is
--
-- The variable __gnat_exit_status is generated within the binder file
-- instead of being imported from the run-time library.
- --
- -- No -Ldir switches are added for the linker step
- --
- -- No standard switches are added after user file entries to the
- -- linker line. All such switches must be explicit. In other words
- -- the option -nostdlib is implicit with a configurable run-time.
Suppress_Standard_Library_On_Target : Boolean;
-- If this flag is True, then the standard library is not included by
diff --git a/gcc/ada/targtyps.c b/gcc/ada/targtyps.c
index 4315c00f023..465edb672ad 100644
--- a/gcc/ada/targtyps.c
+++ b/gcc/ada/targtyps.c
@@ -69,86 +69,87 @@
to determine the sizes that are used for various C types. */
Pos
-get_target_bits_per_unit ()
+get_target_bits_per_unit (void)
{
return BITS_PER_UNIT;
}
Pos
-get_target_bits_per_word ()
+get_target_bits_per_word (void)
{
return BITS_PER_WORD;
}
Pos
-get_target_char_size ()
+get_target_char_size (void)
{
return CHAR_TYPE_SIZE;
}
Pos
-get_target_wchar_t_size ()
+get_target_wchar_t_size (void)
{
/* We never want wide chacters less than "short" in Ada. */
return MAX (SHORT_TYPE_SIZE, WCHAR_TYPE_SIZE);
}
Pos
-get_target_short_size ()
+get_target_short_size (void)
{
return SHORT_TYPE_SIZE;
}
Pos
-get_target_int_size ()
+get_target_int_size (void)
{
return INT_TYPE_SIZE;
}
Pos
-get_target_long_size ()
+get_target_long_size (void)
{
return ADA_LONG_TYPE_SIZE;
}
Pos
-get_target_long_long_size ()
+get_target_long_long_size (void)
{
return LONG_LONG_TYPE_SIZE;
}
Pos
-get_target_float_size ()
+get_target_float_size (void)
{
- return FLOAT_TYPE_SIZE;
+ return fp_prec_to_size (FLOAT_TYPE_SIZE);
}
Pos
-get_target_double_size ()
+get_target_double_size (void)
{
- return DOUBLE_TYPE_SIZE;
+ return fp_prec_to_size (DOUBLE_TYPE_SIZE);
}
Pos
-get_target_long_double_size ()
+get_target_long_double_size (void)
{
- return WIDEST_HARDWARE_FP_SIZE;
+ return fp_prec_to_size (WIDEST_HARDWARE_FP_SIZE);
}
+
Pos
-get_target_pointer_size ()
+get_target_pointer_size (void)
{
return POINTER_SIZE;
}
Pos
-get_target_maximum_alignment ()
+get_target_maximum_alignment (void)
{
return BIGGEST_ALIGNMENT / BITS_PER_UNIT;
}
Boolean
-get_target_no_dollar_in_label ()
+get_target_no_dollar_in_label (void)
{
#ifdef NO_DOLLAR_IN_LABEL
return 1;
@@ -162,31 +163,31 @@ get_target_no_dollar_in_label ()
#endif
Nat
-get_float_words_be ()
+get_float_words_be (void)
{
return FLOAT_WORDS_BIG_ENDIAN;
}
Nat
-get_words_be ()
+get_words_be (void)
{
return WORDS_BIG_ENDIAN;
}
Nat
-get_bytes_be ()
+get_bytes_be (void)
{
return BYTES_BIG_ENDIAN;
}
Nat
-get_bits_be ()
+get_bits_be (void)
{
return BITS_BIG_ENDIAN;
}
Nat
-get_strict_alignment ()
+get_strict_alignment (void)
{
return STRICT_ALIGNMENT;
}
diff --git a/gcc/ada/tb-alvms.c b/gcc/ada/tb-alvms.c
index fecedd396f0..60effcc0504 100644
--- a/gcc/ada/tb-alvms.c
+++ b/gcc/ada/tb-alvms.c
@@ -40,33 +40,38 @@
document, sections of which we will refer to as ABI-<section_number>. */
#include <pdscdef.h>
+#include <libicb.h>
+#include <chfctxdef.h>
+#include <chfdef.h>
-/* We still use a number of macros similar to the ones for the generic
- __gnat_backtrace implementation. */
-#define SKIP_FRAME 1
-#define PC_ADJUST -4
-
-#define STOP_FRAME (frame_state.saved_ra == RA_STOP)
-
-/* Mask for PDSC$V_BASE_FRAME in procedure descriptors, missing from the
- header file included above. */
+/* A couple of items missing from the header file included above. */
+extern void * SYS$GL_CALL_HANDL;
#define PDSC$M_BASE_FRAME (1 << 10)
-typedef unsigned long REG;
+/* Registers are 64bit wide and addresses are 32bit wide on alpha-vms. */
+typedef void * ADDR;
+typedef unsigned long long REG;
+
+#define REG_AT(addr) (*(REG *)(addr))
-#define REG_AT(address) (*(REG *)(address))
+#define AS_REG(addr) ((REG)(unsigned long)(addr))
+#define AS_ADDR(reg) ((ADDR)(unsigned long)(reg))
+#define ADDR_IN(reg) (AS_ADDR(reg))
/* The following structure defines the state maintained during the
unwinding process. */
typedef struct
{
- void * pc; /* Address of the call insn involved in the chain. */
- void * sp; /* Stack Pointer at the time of this call. */
- void * fp; /* Frame Pointer at the time of this call. */
+ ADDR pc; /* Address of the call insn involved in the chain. */
+ ADDR sp; /* Stack Pointer at the time of this call. */
+ ADDR fp; /* Frame Pointer at the time of this call. */
+
+ /* The values above are fetched as saved REGisters on the stack. They are
+ typed ADDR because this is what the values in those registers are. */
/* Values of the registers saved by the functions in the chain,
- incrementally updated through consecutive calls to the "unwind"
- function below. */
+ incrementally updated through consecutive calls to the "unwind" function
+ below. */
REG saved_regs [32];
} frame_state_t;
@@ -79,68 +84,111 @@ typedef struct
This is from ABI-3.1.1 [Integer Registers]. */
-#define saved_fp saved_regs[29]
-#define saved_sp saved_regs[30]
-#define saved_ra saved_regs[26]
-#define saved_pv saved_regs[27]
+#define saved_fpr saved_regs[29]
+#define saved_spr saved_regs[30]
+#define saved_rar saved_regs[26]
+#define saved_pvr saved_regs[27]
-/* Special values for saved_ra, used to control the overall unwinding
+/* Special values for saved_rar, used to control the overall unwinding
process. */
#define RA_UNKNOWN ((REG)~0)
#define RA_STOP ((REG)0)
+/* We still use a number of macros similar to the ones for the generic
+ __gnat_backtrace implementation. */
+#define PC_ADJUST 4
+#define STOP_FRAME (frame_state.saved_rar == RA_STOP)
+
+/* Compute Procedure Value from Frame Pointer value. This follows the rules
+ in ABI-3.6.1 [Current Procedure]. */
+#define PV_FOR(FP) \
+ (((FP) != 0) \
+ ? (((REG_AT (FP) & 0x7) == 0) ? *(PDSCDEF **)(FP) : (PDSCDEF *)(FP)) : 0)
+
+
/**********
* unwind *
**********/
-/* Helper for __gnat_backtrace. Update FS->pc/sp/fp to represent the
- state computed in FS->saved_regs during the previous call, and update
- FS->saved_regs in preparation of the next call. */
+/* Helper for __gnat_backtrace.
+
+ FS represents some call frame, identified by a pc and associated frame
+ pointer in FS->pc and FS->fp. FS->saved_regs contains the state of the
+ general registers upon entry in this frame. Of most interest in this set
+ are the saved return address and frame pointer registers, which actually
+ allow identifying the caller's frame.
+
+ This routine "unwinds" the input frame state by adjusting it to eventually
+ represent its caller's frame. The basic principle is to shift the fp and pc
+ saved values into the current state, and then compute the corresponding new
+ saved registers set.
+
+ If the call chain goes through a signal handler, special processing is
+ required when we process the kernel frame which has called the handler, to
+ switch it to the interrupted context frame. */
+
+#define K_HANDLER_FRAME(fs) (PV_FOR ((fs)->fp) == SYS$GL_CALL_HANDL)
+
+static void unwind_regular_code (frame_state_t * fs);
+static void unwind_kernel_handler (frame_state_t * fs);
void
unwind (frame_state_t * fs)
{
- REG frame_base;
- PDSCDEF * pv;
-
/* Don't do anything if requested so. */
- if (fs->saved_ra == RA_STOP)
+ if (fs->saved_rar == RA_STOP)
return;
/* Retrieve the values of interest computed during the previous
call. PC_ADJUST gets us from the return address to the call insn
address. */
- fs->pc = (void *) fs->saved_ra + PC_ADJUST;
- fs->sp = (void *) fs->saved_sp;
- fs->fp = (void *) fs->saved_fp;
+ fs->pc = ADDR_IN (fs->saved_rar) - PC_ADJUST;
+ fs->sp = ADDR_IN (fs->saved_spr);
+ fs->fp = ADDR_IN (fs->saved_fpr);
/* Unless we are able to determine otherwise, set the frame state's
saved return address such that the unwinding process will stop. */
- fs->saved_ra = RA_STOP;
+ fs->saved_rar = RA_STOP;
- /* Now we want to update fs->saved_regs to reflect what the procedure
- described by pc/fp/sp has done. */
+ /* Now we want to update fs->saved_regs to reflect the state of the caller
+ of the procedure described by pc/fp.
- /* Compute the corresponding "procedure value", following the rules in
- ABI-3.6.1 [Current Procedure]. Return immediatly if this value mandates
- us to stop. */
- if (fs->fp == 0)
- return;
+ The condition to check for a special kernel frame which has called a
+ signal handler is stated in ABI-6.7.1 [Signaler's Registers] : "The frame
+ of the call to the handler can be identified by the return address of
+ SYS$CALL_HANDL+4". We use the equivalent procedure value identification
+ here because SYS$CALL_HANDL appears to be undefined. */
- if ((REG_AT (fs->fp) & 0x7) == 0)
- pv = *(PDSCDEF **)fs->fp;
+ if (K_HANDLER_FRAME (fs))
+ unwind_kernel_handler (fs);
else
- pv = (PDSCDEF *) fs->fp;
+ unwind_regular_code (fs);
+}
+
+/***********************
+ * unwind_regular_code *
+ ***********************/
+
+/* Helper for unwind, for the case of unwinding through regular code which
+ is not a signal handler. */
+
+static void
+unwind_regular_code (frame_state_t * fs)
+{
+ PDSCDEF * pv = PV_FOR (fs->fp);
+
+ ADDR frame_base;
+
+ /* Use the procedure value to unwind, in a way depending on the kind of
+ procedure at hand. See ABI-3.3 [Procedure Representation] and ABI-3.4
+ [Procedure Types]. */
if (pv == 0
|| pv->pdsc$w_flags & PDSC$M_BASE_FRAME)
return;
- /* Use the procedure value to unwind, in a way depending on the kind of
- procedure at hand. This is based on ABI-3.3 [Procedure Representation]
- and ABI-3.4 [Procedure Types]. */
frame_base
- = (REG) ((pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP) ? fs->fp : fs->sp);
+ = (pv->pdsc$w_flags & PDSC$M_BASE_REG_IS_FP) ? fs->fp : fs->sp;
switch (pv->pdsc$w_flags & 0xf)
{
@@ -148,21 +196,21 @@ unwind (frame_state_t * fs)
/* Stack Frame Procedure (ABI-3.4.1). Retrieve the necessary registers
from the Register Save Area in the frame. */
{
- REG rsa_base = frame_base + pv->pdsc$w_rsa_offset;
+ ADDR rsa_base = frame_base + pv->pdsc$w_rsa_offset;
int i, j;
- fs->saved_ra = REG_AT (rsa_base);
- fs->saved_pv = REG_AT (frame_base);
-
+ fs->saved_rar = REG_AT (rsa_base);
+ fs->saved_pvr = REG_AT (frame_base);
+
for (i = 0, j = 0; i < 32; i++)
if (pv->pdsc$l_ireg_mask & (1 << i))
fs->saved_regs[i] = REG_AT (rsa_base + 8 * ++j);
- /* Note that the loop above is guaranteed to set fs->saved_fp, because
- "The preserved register set must always include R29(FP) since it
- will always be used." (ABI-3.4.3.4 [Register Save Area for All
- Stack Frames]).
-
+ /* Note that the loop above is guaranteed to set fs->saved_fpr,
+ because "The preserved register set must always include R29(FP)
+ since it will always be used." (ABI-3.4.3.4 [Register Save Area for
+ All Stack Frames]).
+
Also note that we need to run through all the registers to ensure
that unwinding through register procedures (see below) gets the
right values out of the saved_regs array. */
@@ -173,8 +221,8 @@ unwind (frame_state_t * fs)
/* Register Procedure (ABI-3.4.4). Retrieve the necessary registers from
the registers where they have been saved. */
{
- fs->saved_ra = fs->saved_regs[pv->pdsc$b_save_ra];
- fs->saved_fp = fs->saved_regs[pv->pdsc$b_save_fp];
+ fs->saved_rar = fs->saved_regs[pv->pdsc$b_save_ra];
+ fs->saved_fpr = fs->saved_regs[pv->pdsc$b_save_fp];
}
break;
@@ -186,22 +234,111 @@ unwind (frame_state_t * fs)
/* SP is actually never part of the saved registers area, so we use the
corresponding entry in the saved_regs array to manually keep track of
it's evolution. */
- fs->saved_sp = frame_base + pv->pdsc$l_size;
+ fs->saved_spr = AS_REG (frame_base) + pv->pdsc$l_size;
+}
+
+/*************************
+ * unwind_kernel_handler *
+ *************************/
+
+/* Helper for unwind, for the specific case of unwinding through a signal
+ handler.
+
+ The input frame state describes the kernel frame which has called a signal
+ handler. We fill the corresponding saved_regs to have it's "caller" frame
+ represented as the interrupted context. */
+
+static void
+unwind_kernel_handler (frame_state_t * fs)
+{
+ PDSCDEF * pv = PV_FOR (fs->fp);
+
+ CHFDEF1 *sigargs;
+ CHFDEF2 *mechargs;
+
+ /* Retrieve the arguments passed to the handler, by way of a VMS service
+ providing the corresponding "Invocation Context Block". */
+ {
+ long handler_ivhandle;
+ INVO_CONTEXT_BLK handler_ivcb;
+
+ CHFCTX *chfctx;
+
+ handler_ivcb.libicb$q_ireg [29] = AS_REG (fs->fp);
+ handler_ivcb.libicb$q_ireg [30] = 0;
+
+ handler_ivhandle = LIB$GET_INVO_HANDLE (&handler_ivcb);
+
+ if ((LIB$GET_INVO_CONTEXT (handler_ivhandle, &handler_ivcb) & 1) != 1)
+ return;
+
+ chfctx = (CHFCTX *) AS_ADDR (handler_ivcb.libicb$ph_chfctx_addr);
+
+ sigargs = (CHFDEF1 *) AS_ADDR (chfctx->chfctx$q_sigarglst);
+ mechargs = (CHFDEF2 *) AS_ADDR (chfctx->chfctx$q_mcharglst);
+ }
+
+ /* Compute the saved return address as the PC of the instruction causing the
+ condition, accounting for the fact that it will be adjusted by the next
+ call to "unwind" as if it was an actual call return address. */
+ {
+ /* ABI-6.5.1.1 [Signal Argument Vector]: The signal occurrence address
+ is available from the sigargs argument to the handler, designed to
+ support both 32 and 64 bit addresses. The initial reference we get
+ is a pointer to the 32bit form, from which one may extract a pointer
+ to the 64bit version if need be. We work directly from the 32bit
+ form here. */
+
+ /* The sigargs vector structure for 32bits addresses is:
+
+ <......32bit......>
+ +-----------------+
+ | Vsize | :chf$is_sig_args
+ +-----------------+ -+-
+ | Condition Value | : [0]
+ +-----------------+ :
+ | ... | :
+ +-----------------+ : vector of Vsize entries
+ | Signal PC | :
+ +-----------------+ :
+ | PS | : [Vsize - 1]
+ +-----------------+ -+-
+
+ */
+
+ unsigned long * sigargs_vector
+ = ((unsigned long *) (&sigargs->chf$is_sig_args)) + 1;
+
+ long sigargs_vsize
+ = sigargs->chf$is_sig_args;
+
+ fs->saved_rar = (REG) sigargs_vector [sigargs_vsize - 2] + PC_ADJUST;
+ }
+
+ fs->saved_spr = RA_UNKNOWN;
+ fs->saved_fpr = (REG) mechargs->chf$q_mch_frame;
+ fs->saved_pvr = (REG) mechargs->chf$q_mch_savr27;
+
+ fs->saved_regs[16] = (REG) mechargs->chf$q_mch_savr16;
+ fs->saved_regs[17] = (REG) mechargs->chf$q_mch_savr17;
+ fs->saved_regs[18] = (REG) mechargs->chf$q_mch_savr18;
+ fs->saved_regs[19] = (REG) mechargs->chf$q_mch_savr19;
+ fs->saved_regs[20] = (REG) mechargs->chf$q_mch_savr20;
}
/* Structure representing a traceback entry in the tracebacks array to be
- filled by __gnat_backtrace below. This should match the declaration of
- Traceback_Entry in System.Traceback_Entries.
+ filled by __gnat_backtrace below.
+
+ !! This should match what is in System.Traceback_Entries, so beware of
+ !! the REG/ADDR difference here.
The use of a structure is motivated by the potential necessity of having
several fields to fill for each entry, for instance if later calls to VMS
system functions need more than just a mere PC to compute info on a frame
(e.g. for non-symbolic->symbolic translation purposes). */
-
typedef struct {
- void * pc; /* Address of the call instruction in the chain. */
- void * sp; /* Stack Pointer value at the point of this call. */
- void * fp; /* Frame Pointer value at the point of this call. */
+ ADDR pc;
+ ADDR pv;
} tb_entry_t;
/********************
@@ -209,12 +346,8 @@ typedef struct {
********************/
int
-__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
- void **array;
- int size;
- void *exclude_min;
- void *exclude_max;
- int skip_frames;
+__gnat_backtrace (void **array, int size,
+ void *exclude_min, void *exclude_max, int skip_frames)
{
int cnt;
@@ -226,9 +359,9 @@ __gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
register REG this_FP __asm__("$29");
register REG this_SP __asm__("$30");
- frame_state.saved_fp = this_FP;
- frame_state.saved_sp = this_SP;
- frame_state.saved_ra = RA_UNKNOWN;
+ frame_state.saved_fpr = this_FP;
+ frame_state.saved_spr = this_SP;
+ frame_state.saved_rar = RA_UNKNOWN;
unwind (&frame_state);
@@ -242,16 +375,18 @@ __gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
cnt = 0;
while (cnt < size)
{
+ PDSCDEF * pv = PV_FOR (frame_state.fp);
+
+ /* Stop if either the frame contents or the unwinder say so. */
if (STOP_FRAME)
break;
- if (frame_state.pc < exclude_min
- || frame_state.pc > exclude_max)
+ if (! K_HANDLER_FRAME (&frame_state)
+ && (frame_state.pc < exclude_min || frame_state.pc > exclude_max))
{
- tbe->pc = frame_state.pc;
- tbe->sp = frame_state.sp;
- tbe->fp = frame_state.fp;
-
+ tbe->pc = (ADDR) frame_state.pc;
+ tbe->pv = (ADDR) PV_FOR (frame_state.fp);
+
cnt ++;
tbe ++;
}
diff --git a/gcc/ada/tb-alvxw.c b/gcc/ada/tb-alvxw.c
index 0c022aad63b..b86091f7742 100644
--- a/gcc/ada/tb-alvxw.c
+++ b/gcc/ada/tb-alvxw.c
@@ -39,7 +39,7 @@
#include <limits.h>
#include <string.h>
-extern void kerTaskEntry();
+extern void kerTaskEntry(void);
/* We still use a number of macros similar to the ones for the generic
__gnat_backtrace implementation. */
@@ -259,8 +259,7 @@ struct alloc_chain
struct alloc_chain *trace_alloc_chain;
static void *
-trace_alloc (n)
- unsigned int n;
+trace_alloc (unsigned int n)
{
struct alloc_chain * result = malloc (n + sizeof(struct alloc_chain));
@@ -270,7 +269,7 @@ trace_alloc (n)
}
static void
-free_trace_alloc ()
+free_trace_alloc (void)
{
while (trace_alloc_chain != 0)
{
@@ -285,9 +284,7 @@ free_trace_alloc ()
otherwise. */
static int
-read_memory_safe4 (addr, dest)
- CORE_ADDR addr;
- unsigned int *dest;
+read_memory_safe4 (CORE_ADDR addr, unsigned int *dest)
{
*dest = *((unsigned int*) addr);
return 0;
@@ -297,17 +294,14 @@ read_memory_safe4 (addr, dest)
otherwise. */
static int
-read_memory_safe8 (addr, dest)
- CORE_ADDR addr;
- CORE_ADDR *dest;
+read_memory_safe8 (CORE_ADDR addr, CORE_ADDR *dest)
{
*dest = *((CORE_ADDR*) addr);
return 0;
}
static CORE_ADDR
-read_register (regno)
- int regno;
+read_register (int regno)
{
if (regno >= 0 && regno < 31)
return theRegisters[regno];
@@ -316,23 +310,20 @@ read_register (regno)
}
static void
-frame_saved_regs_zalloc (fi)
- struct frame_info *fi;
+frame_saved_regs_zalloc (struct frame_info *fi)
{
fi->saved_regs = (CORE_ADDR *) trace_alloc (SIZEOF_FRAME_SAVED_REGS);
memset (fi->saved_regs, 0, SIZEOF_FRAME_SAVED_REGS);
}
static void *
-frame_obstack_alloc (size)
- unsigned long size;
+frame_obstack_alloc (unsigned long size)
{
return (void *) trace_alloc (size);
}
static int
-inside_entry_file (addr)
- CORE_ADDR addr;
+inside_entry_file (CORE_ADDR addr)
{
if (addr == 0)
return 1;
@@ -341,8 +332,7 @@ inside_entry_file (addr)
}
static CORE_ADDR
-alpha_saved_pc_after_call (frame)
- struct frame_info *frame;
+alpha_saved_pc_after_call (struct frame_info *frame)
{
CORE_ADDR pc = frame->pc;
alpha_extra_func_info_t proc_desc;
@@ -358,8 +348,7 @@ alpha_saved_pc_after_call (frame)
NULL). */
static void
-alpha_find_saved_regs (frame)
- struct frame_info *frame;
+alpha_find_saved_regs (struct frame_info *frame)
{
int ireg;
CORE_ADDR reg_position;
@@ -430,9 +419,7 @@ alpha_find_saved_regs (frame)
}
static CORE_ADDR
-read_next_frame_reg (fi, regno)
- struct frame_info *fi;
- int regno;
+read_next_frame_reg (struct frame_info *fi, int regno)
{
CORE_ADDR result;
for (; fi; fi = fi->next)
@@ -460,8 +447,7 @@ read_next_frame_reg (fi, regno)
}
static CORE_ADDR
-alpha_frame_saved_pc (frame)
- struct frame_info *frame;
+alpha_frame_saved_pc (struct frame_info *frame)
{
return read_next_frame_reg (frame, frame->pc_reg);
}
@@ -472,8 +458,7 @@ static struct alpha_extra_func_info temp_proc_desc;
$zero,($ra),1" on alpha. */
static int
-alpha_about_to_return (pc)
- CORE_ADDR pc;
+alpha_about_to_return (CORE_ADDR pc)
{
int inst;
@@ -485,8 +470,7 @@ alpha_about_to_return (pc)
containing address PC. Returns 0 if none detected. */
static CORE_ADDR
-heuristic_proc_start (pc)
- CORE_ADDR pc;
+heuristic_proc_start (CORE_ADDR pc)
{
CORE_ADDR start_pc = pc;
CORE_ADDR fence = start_pc - heuristic_fence_post;
@@ -512,11 +496,10 @@ heuristic_proc_start (pc)
}
static alpha_extra_func_info_t
-heuristic_proc_desc (start_pc, limit_pc, next_frame, saved_regs_p)
- CORE_ADDR start_pc;
- CORE_ADDR limit_pc;
- struct frame_info *next_frame;
- struct frame_saved_regs *saved_regs_p;
+heuristic_proc_desc (CORE_ADDR start_pc,
+ CORE_ADDR limit_pc,
+ struct frame_info *next_frame,
+ struct frame_saved_regs *saved_regs_p)
{
CORE_ADDR sp = read_next_frame_reg (next_frame, SP_REGNUM);
CORE_ADDR cur_pc;
@@ -641,10 +624,9 @@ heuristic_proc_desc (start_pc, limit_pc, next_frame, saved_regs_p)
}
static alpha_extra_func_info_t
-find_proc_desc (pc, next_frame, saved_regs)
- CORE_ADDR pc;
- struct frame_info *next_frame;
- struct frame_saved_regs *saved_regs;
+find_proc_desc (CORE_ADDR pc,
+ struct frame_info *next_frame,
+ struct frame_saved_regs *saved_regs)
{
CORE_ADDR startaddr;
@@ -660,8 +642,7 @@ find_proc_desc (pc, next_frame, saved_regs)
}
static CORE_ADDR
-alpha_frame_chain (frame)
- struct frame_info *frame;
+alpha_frame_chain (struct frame_info *frame)
{
alpha_extra_func_info_t proc_desc;
CORE_ADDR saved_pc = FRAME_SAVED_PC (frame);
@@ -685,8 +666,7 @@ alpha_frame_chain (frame)
}
static void
-init_extra_frame_info (frame)
- struct frame_info *frame;
+init_extra_frame_info (struct frame_info *frame)
{
struct frame_saved_regs temp_saved_regs;
alpha_extra_func_info_t proc_desc =
@@ -729,9 +709,7 @@ init_extra_frame_info (frame)
Always returns a non-NULL value. */
static struct frame_info *
-create_new_frame (addr, pc)
- CORE_ADDR addr;
- CORE_ADDR pc;
+create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
{
struct frame_info *fi;
@@ -754,19 +732,19 @@ create_new_frame (addr, pc)
static CORE_ADDR current_pc;
static void
-set_current_pc ()
+set_current_pc (void)
{
current_pc = (CORE_ADDR) __builtin_return_address (0);
}
static CORE_ADDR
-read_pc ()
+read_pc (void)
{
return current_pc;
}
static struct frame_info *
-get_current_frame ()
+get_current_frame (void)
{
return create_new_frame (0, read_pc ());
}
@@ -775,8 +753,7 @@ get_current_frame ()
If FI is the original frame (it has no caller), return 0. */
static struct frame_info *
-get_prev_frame (next_frame)
- struct frame_info *next_frame;
+get_prev_frame (struct frame_info *next_frame)
{
CORE_ADDR address = 0;
struct frame_info *prev;
@@ -897,12 +874,11 @@ get_prev_frame (next_frame)
"stq $" #regno ", " #disp "(%0)\n"
int
-__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
- void **array;
- int size;
- void *exclude_min;
- void *exclude_max;
- int skip_frames;
+__gnat_backtrace (void **array,
+ int size,
+ void *exclude_min,
+ void *exclude_max,
+ int skip_frames)
{
struct frame_info* top;
struct frame_info* current;
diff --git a/gcc/ada/tracebak.c b/gcc/ada/tracebak.c
index 5c9b9f690b4..59ed396d266 100644
--- a/gcc/ada/tracebak.c
+++ b/gcc/ada/tracebak.c
@@ -58,7 +58,7 @@
#include "system.h"
#endif
-extern int __gnat_backtrace PARAMS ((void **, int, void *, void *, int));
+extern int __gnat_backtrace (void **, int, void *, void *, int);
/* The point is to provide an implementation of the __gnat_bactrace function
above, called by the default implementation of the System.Traceback
@@ -77,10 +77,10 @@ extern int __gnat_backtrace PARAMS ((void **, int, void *, void *, int));
function is still referenced by the default System.Traceback. */
#define Lock_Task system__soft_links__lock_task
-extern void (*Lock_Task) PARAMS ((void));
+extern void (*Lock_Task) (void);
#define Unlock_Task system__soft_links__unlock_task
-extern void (*Unlock_Task) PARAMS ((void));
+extern void (*Unlock_Task) (void);
/*-------------------------------------*
*-- Target specific implementations --*
@@ -339,12 +339,11 @@ static void forced_callee () {}
#endif
int
-__gnat_backtrace (array, size, exclude_min, exclude_max, skip_frames)
- void **array;
- int size;
- void *exclude_min;
- void *exclude_max;
- int skip_frames;
+__gnat_backtrace (void **array,
+ int size,
+ void *exclude_min,
+ void *exclude_max,
+ int skip_frames)
{
struct layout *current;
void *top_frame;
diff --git a/gcc/ada/trans.c b/gcc/ada/trans.c
index d28ded8f305..9f443a6f9fb 100644
--- a/gcc/ada/trans.c
+++ b/gcc/ada/trans.c
@@ -103,24 +103,22 @@ Node_Id error_gnat_node;
a return in some functions. See processing for N_Subprogram_Body. */
static GTY(()) tree gnu_return_label_stack;
-static tree tree_transform PARAMS((Node_Id));
-static void elaborate_all_entities PARAMS((Node_Id));
-static void process_freeze_entity PARAMS((Node_Id));
-static void process_inlined_subprograms PARAMS((Node_Id));
-static void process_decls PARAMS((List_Id, List_Id, Node_Id,
- int, int));
-static tree emit_range_check PARAMS((tree, Node_Id));
-static tree emit_index_check PARAMS((tree, tree, tree, tree));
-static tree emit_check PARAMS((tree, tree, int));
-static tree convert_with_check PARAMS((Entity_Id, tree,
- int, int, int));
-static int addressable_p PARAMS((tree));
-static tree assoc_to_constructor PARAMS((Node_Id, tree));
-static tree extract_values PARAMS((tree, tree));
-static tree pos_to_constructor PARAMS((Node_Id, tree, Entity_Id));
-static tree maybe_implicit_deref PARAMS((tree));
-static tree gnat_stabilize_reference_1 PARAMS((tree, int));
-static int build_unit_elab PARAMS((Entity_Id, int, tree));
+static tree tree_transform (Node_Id);
+static void elaborate_all_entities (Node_Id);
+static void process_freeze_entity (Node_Id);
+static void process_inlined_subprograms (Node_Id);
+static void process_decls (List_Id, List_Id, Node_Id, int, int);
+static tree emit_range_check (tree, Node_Id);
+static tree emit_index_check (tree, tree, tree, tree);
+static tree emit_check (tree, tree, int);
+static tree convert_with_check (Entity_Id, tree, int, int, int);
+static int addressable_p (tree);
+static tree assoc_to_constructor (Node_Id, tree);
+static tree extract_values (tree, tree);
+static tree pos_to_constructor (Node_Id, tree, Entity_Id);
+static tree maybe_implicit_deref (tree);
+static tree gnat_stabilize_reference_1 (tree, int);
+static int build_unit_elab (Entity_Id, int, tree);
/* Constants for +0.5 and -0.5 for float-to-integer rounding. */
static REAL_VALUE_TYPE dconstp5;
@@ -130,27 +128,23 @@ static REAL_VALUE_TYPE dconstmp5;
structures and then generates code. */
void
-gigi (gnat_root, max_gnat_node, number_name, nodes_ptr, next_node_ptr,
- prev_node_ptr, elists_ptr, elmts_ptr, strings_ptr, string_chars_ptr,
- list_headers_ptr, number_units, file_info_ptr, standard_integer,
- standard_long_long_float, standard_exception_type, gigi_operating_mode)
- Node_Id gnat_root;
- int max_gnat_node;
- int number_name;
- struct Node *nodes_ptr;
- Node_Id *next_node_ptr;
- Node_Id *prev_node_ptr;
- struct Elist_Header *elists_ptr;
- struct Elmt_Item *elmts_ptr;
- struct String_Entry *strings_ptr;
- Char_Code *string_chars_ptr;
- struct List_Header *list_headers_ptr;
- Int number_units ATTRIBUTE_UNUSED;
- char *file_info_ptr ATTRIBUTE_UNUSED;
- Entity_Id standard_integer;
- Entity_Id standard_long_long_float;
- Entity_Id standard_exception_type;
- Int gigi_operating_mode;
+gigi (Node_Id gnat_root,
+ int max_gnat_node,
+ int number_name,
+ struct Node *nodes_ptr,
+ Node_Id *next_node_ptr,
+ Node_Id *prev_node_ptr,
+ struct Elist_Header *elists_ptr,
+ struct Elmt_Item *elmts_ptr,
+ struct String_Entry *strings_ptr,
+ Char_Code *string_chars_ptr,
+ struct List_Header *list_headers_ptr,
+ Int number_units ATTRIBUTE_UNUSED,
+ char *file_info_ptr ATTRIBUTE_UNUSED,
+ Entity_Id standard_integer,
+ Entity_Id standard_long_long_float,
+ Entity_Id standard_exception_type,
+ Int gigi_operating_mode)
{
tree gnu_standard_long_long_float;
tree gnu_standard_exception_type;
@@ -233,8 +227,7 @@ gigi (gnat_root, max_gnat_node, number_name, nodes_ptr, next_node_ptr,
part of the tree. */
void
-gnat_to_code (gnat_node)
- Node_Id gnat_node;
+gnat_to_code (Node_Id gnat_node)
{
tree gnu_root;
@@ -243,9 +236,13 @@ gnat_to_code (gnat_node)
gnu_root = tree_transform (gnat_node);
+ /* If we return a statement, generate code for it. */
+ if (IS_STMT (gnu_root))
+ expand_expr_stmt (gnu_root);
+
/* This should just generate code, not return a value. If it returns
a value, something is wrong. */
- if (gnu_root != error_mark_node)
+ else if (gnu_root != error_mark_node)
gigi_abort (302);
}
@@ -255,8 +252,7 @@ gnat_to_code (gnat_node)
code. */
tree
-gnat_to_gnu (gnat_node)
- Node_Id gnat_node;
+gnat_to_gnu (Node_Id gnat_node)
{
tree gnu_root;
@@ -282,8 +278,7 @@ gnat_to_gnu (gnat_node)
in the above two routines for most purposes. */
static tree
-tree_transform (gnat_node)
- Node_Id gnat_node;
+tree_transform (Node_Id gnat_node)
{
tree gnu_result = error_mark_node; /* Default to no value. */
tree gnu_result_type = void_type_node;
@@ -997,7 +992,9 @@ tree_transform (gnat_node)
gnu_prefix = gnat_stabilize_reference (gnu_prefix, 0);
gnu_result
- = build_component_ref (gnu_prefix, NULL_TREE, gnu_field);
+ = build_component_ref (gnu_prefix, NULL_TREE, gnu_field,
+ (Nkind (Parent (gnat_node))
+ == N_Attribute_Reference));
}
if (gnu_result == 0)
@@ -2058,8 +2055,6 @@ tree_transform (gnat_node)
gnu_rhs
= maybe_unconstrained_array (gnat_to_gnu (Expression (gnat_node)));
- set_lineno (gnat_node, 1);
-
/* If range check is needed, emit code to generate it */
if (Do_Range_Check (Expression (gnat_node)))
gnu_rhs = emit_range_check (gnu_rhs, Etype (Name (gnat_node)));
@@ -2071,10 +2066,12 @@ tree_transform (gnat_node)
&& TREE_OVERFLOW (TYPE_SIZE (TREE_TYPE (gnu_lhs))))
|| (TREE_CODE (TYPE_SIZE (TREE_TYPE (gnu_rhs))) == INTEGER_CST
&& TREE_OVERFLOW (TYPE_SIZE (TREE_TYPE (gnu_rhs)))))
- expand_expr_stmt (build_call_raise (SE_Object_Too_Large));
+ gnu_result = build_call_raise (SE_Object_Too_Large);
else
- expand_expr_stmt (build_binary_op (MODIFY_EXPR, NULL_TREE,
- gnu_lhs, gnu_rhs));
+ gnu_result
+ = build_binary_op (MODIFY_EXPR, NULL_TREE, gnu_lhs, gnu_rhs);
+
+ gnu_result = build_nt (EXPR_STMT, gnu_result);
break;
case N_If_Statement:
@@ -3168,7 +3165,7 @@ tree_transform (gnat_node)
= length == 1 ? gnu_subprog_call
: build_component_ref
(gnu_subprog_call, NULL_TREE,
- TREE_PURPOSE (scalar_return_list));
+ TREE_PURPOSE (scalar_return_list), 0);
int unchecked_conversion
= Nkind (gnat_actual) == N_Unchecked_Type_Conversion;
/* If the actual is a conversion, get the inner expression,
@@ -3614,7 +3611,8 @@ tree_transform (gnat_node)
(build_unary_op
(INDIRECT_REF, NULL_TREE,
TREE_VALUE (gnu_except_ptr_stack)),
- get_identifier ("not_handled_by_others"), NULL_TREE)),
+ get_identifier ("not_handled_by_others"), NULL_TREE,
+ 0)),
integer_zero_node);
}
@@ -3643,7 +3641,7 @@ tree_transform (gnat_node)
(build_unary_op
(INDIRECT_REF, NULL_TREE,
TREE_VALUE (gnu_except_ptr_stack)),
- get_identifier ("import_code"), NULL_TREE),
+ get_identifier ("import_code"), NULL_TREE, 0),
gnu_expr);
else
this_choice
@@ -3664,7 +3662,7 @@ tree_transform (gnat_node)
(build_unary_op
(INDIRECT_REF, NULL_TREE,
TREE_VALUE (gnu_except_ptr_stack)),
- get_identifier ("lang"), NULL_TREE);
+ get_identifier ("lang"), NULL_TREE, 0);
this_choice
= build_binary_op
@@ -4024,8 +4022,17 @@ tree_transform (gnat_node)
gigi_abort (321);
}
+ /* If the result is a statement, set needed flags and return it. */
+ if (IS_STMT (gnu_result))
+ {
+ TREE_TYPE (gnu_result) = void_type_node;
+ TREE_THIS_VOLATILE (gnu_result) = TREE_SIDE_EFFECTS (gnu_result) = 1;
+ TREE_SLOC (gnu_result) = Sloc (gnat_node);
+ return gnu_result;
+ }
+
/* If the result is a constant that overflows, raise constraint error. */
- if (TREE_CODE (gnu_result) == INTEGER_CST
+ else if (TREE_CODE (gnu_result) == INTEGER_CST
&& TREE_CONSTANT_OVERFLOW (gnu_result))
{
post_error ("Constraint_Error will be raised at run-time?", gnat_node);
@@ -4137,6 +4144,24 @@ tree_transform (gnat_node)
return gnu_result;
}
+/* GNU_STMT is a statement. We generate code for that statement. */
+
+void
+gnat_expand_stmt (tree gnu_stmt)
+{
+ set_lineno_from_sloc (TREE_SLOC (gnu_stmt), 1);
+
+ switch (TREE_CODE (gnu_stmt))
+ {
+ case EXPR_STMT:
+ expand_expr_stmt (EXPR_STMT_EXPR (gnu_stmt));
+ break;
+
+ default:
+ abort ();
+ }
+}
+
/* Force references to each of the entities in packages GNAT_NODE with's
so that the debugging information for all of them are identical
in all clients. Operate recursively on anything it with's, but check
@@ -4158,8 +4183,7 @@ tree_transform (gnat_node)
information for types in withed units, for ASIS use */
static void
-elaborate_all_entities (gnat_node)
- Node_Id gnat_node;
+elaborate_all_entities (Node_Id gnat_node)
{
Entity_Id gnat_with_clause, gnat_entity;
@@ -4225,8 +4249,7 @@ elaborate_all_entities (gnat_node)
/* Do the processing of N_Freeze_Entity, GNAT_NODE. */
static void
-process_freeze_entity (gnat_node)
- Node_Id gnat_node;
+process_freeze_entity (Node_Id gnat_node)
{
Entity_Id gnat_entity = Entity (gnat_node);
tree gnu_old;
@@ -4334,8 +4357,7 @@ process_freeze_entity (gnat_node)
N_Compilation_Unit. */
static void
-process_inlined_subprograms (gnat_node)
- Node_Id gnat_node;
+process_inlined_subprograms (Node_Id gnat_node)
{
Entity_Id gnat_entity;
Node_Id gnat_body;
@@ -4381,10 +4403,11 @@ process_inlined_subprograms (gnat_node)
correspond to the public and private parts of a package. */
static void
-process_decls (gnat_decls, gnat_decls2, gnat_end_list, pass1p, pass2p)
- List_Id gnat_decls, gnat_decls2;
- Node_Id gnat_end_list;
- int pass1p, pass2p;
+process_decls (List_Id gnat_decls,
+ List_Id gnat_decls2,
+ Node_Id gnat_end_list,
+ int pass1p,
+ int pass2p)
{
List_Id gnat_decl_array[2];
Node_Id gnat_decl;
@@ -4501,9 +4524,7 @@ process_decls (gnat_decls, gnat_decls2, gnat_end_list, pass1p, pass2p)
which we have to check. */
static tree
-emit_range_check (gnu_expr, gnat_range_type)
- tree gnu_expr;
- Entity_Id gnat_range_type;
+emit_range_check (tree gnu_expr, Entity_Id gnat_range_type)
{
tree gnu_range_type = get_unpadded_type (gnat_range_type);
tree gnu_low = TYPE_MIN_VALUE (gnu_range_type);
@@ -4553,11 +4574,10 @@ emit_range_check (gnu_expr, gnat_range_type)
subprograms having unconstrained array formal parameters */
static tree
-emit_index_check (gnu_array_object, gnu_expr, gnu_low, gnu_high)
- tree gnu_array_object;
- tree gnu_expr;
- tree gnu_low;
- tree gnu_high;
+emit_index_check (tree gnu_array_object,
+ tree gnu_expr,
+ tree gnu_low,
+ tree gnu_high)
{
tree gnu_expr_check;
@@ -4600,10 +4620,7 @@ emit_index_check (gnu_array_object, gnu_expr, gnu_low, gnu_high)
why the exception was raised. */
static tree
-emit_check (gnu_cond, gnu_expr, reason)
- tree gnu_cond;
- tree gnu_expr;
- int reason;
+emit_check (tree gnu_cond, tree gnu_expr, int reason)
{
tree gnu_call;
tree gnu_result;
@@ -4641,12 +4658,11 @@ emit_check (gnu_cond, gnu_expr, reason)
truncation; otherwise round. */
static tree
-convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p)
- Entity_Id gnat_type;
- tree gnu_expr;
- int overflow_p;
- int range_p;
- int truncate_p;
+convert_with_check (Entity_Id gnat_type,
+ tree gnu_expr,
+ int overflow_p,
+ int range_p,
+ int truncate_p)
{
tree gnu_type = get_unpadded_type (gnat_type);
tree gnu_in_type = TREE_TYPE (gnu_expr);
@@ -4785,8 +4801,7 @@ convert_with_check (gnat_type, gnu_expr, overflow_p, range_p, truncate_p)
cases. */
static int
-addressable_p (gnu_expr)
- tree gnu_expr;
+addressable_p (tree gnu_expr)
{
switch (TREE_CODE (gnu_expr))
{
@@ -4848,8 +4863,7 @@ addressable_p (gnu_expr)
make a GCC type for GNAT_ENTITY and set up the correspondance. */
void
-process_type (gnat_entity)
- Entity_Id gnat_entity;
+process_type (Entity_Id gnat_entity)
{
tree gnu_old
= present_gnu_tree (gnat_entity) ? get_gnu_tree (gnat_entity) : 0;
@@ -4944,9 +4958,7 @@ process_type (gnat_entity)
Return a CONSTRUCTOR to build the record. */
static tree
-assoc_to_constructor (gnat_assoc, gnu_type)
- Node_Id gnat_assoc;
- tree gnu_type;
+assoc_to_constructor (Node_Id gnat_assoc, tree gnu_type)
{
tree gnu_field, gnu_list, gnu_result;
@@ -4995,10 +5007,9 @@ assoc_to_constructor (gnat_assoc, gnu_type)
of the array component. It is needed for range checking. */
static tree
-pos_to_constructor (gnat_expr, gnu_array_type, gnat_component_type)
- Node_Id gnat_expr;
- tree gnu_array_type;
- Entity_Id gnat_component_type;
+pos_to_constructor (Node_Id gnat_expr,
+ tree gnu_array_type,
+ Entity_Id gnat_component_type)
{
tree gnu_expr;
tree gnu_expr_list = NULL_TREE;
@@ -5039,9 +5050,7 @@ pos_to_constructor (gnat_expr, gnu_array_type, gnat_component_type)
record, make a recursive call to fill it in as well. */
static tree
-extract_values (values, record_type)
- tree values;
- tree record_type;
+extract_values (tree values, tree record_type)
{
tree result = NULL_TREE;
tree field, tem;
@@ -5088,8 +5097,7 @@ extract_values (values, record_type)
an access object and perform the required dereferences. */
static tree
-maybe_implicit_deref (exp)
- tree exp;
+maybe_implicit_deref (tree exp)
{
/* If the type is a pointer, dereference it. */
@@ -5107,8 +5115,7 @@ maybe_implicit_deref (exp)
/* Protect EXP from multiple evaluation. This may make a SAVE_EXPR. */
tree
-protect_multiple_eval (exp)
- tree exp;
+protect_multiple_eval (tree exp)
{
tree type = TREE_TYPE (exp);
@@ -5147,13 +5154,11 @@ protect_multiple_eval (exp)
whether to force evaluation of everything. */
tree
-gnat_stabilize_reference (ref, force)
- tree ref;
- int force;
+gnat_stabilize_reference (tree ref, int force)
{
- register tree type = TREE_TYPE (ref);
- register enum tree_code code = TREE_CODE (ref);
- register tree result;
+ tree type = TREE_TYPE (ref);
+ enum tree_code code = TREE_CODE (ref);
+ tree result;
switch (code)
{
@@ -5245,13 +5250,11 @@ gnat_stabilize_reference (ref, force)
arg to force a SAVE_EXPR for everything. */
static tree
-gnat_stabilize_reference_1 (e, force)
- tree e;
- int force;
+gnat_stabilize_reference_1 (tree e, int force)
{
- register enum tree_code code = TREE_CODE (e);
- register tree type = TREE_TYPE (e);
- register tree result;
+ enum tree_code code = TREE_CODE (e);
+ tree type = TREE_TYPE (e);
+ tree result;
/* We cannot ignore const expressions because it might be a reference
to a const array but whose index contains side-effects. But we can
@@ -5310,10 +5313,7 @@ gnat_stabilize_reference_1 (e, force)
Return 1 if we didn't need an elaboration function, zero otherwise. */
static int
-build_unit_elab (gnat_unit, body_p, gnu_elab_list)
- Entity_Id gnat_unit;
- int body_p;
- tree gnu_elab_list;
+build_unit_elab (Entity_Id gnat_unit, int body_p, tree gnu_elab_list)
{
tree gnu_decl;
rtx insn;
@@ -5394,19 +5394,25 @@ build_unit_elab (gnat_unit, body_p, gnu_elab_list)
return result;
}
-extern char *__gnat_to_canonical_file_spec PARAMS ((char *));
+extern char *__gnat_to_canonical_file_spec (char *);
/* Determine the input_filename and the input_line from the source location
(Sloc) of GNAT_NODE node. Set the global variable input_filename and
input_line. If WRITE_NOTE_P is true, emit a line number note. */
void
-set_lineno (gnat_node, write_note_p)
- Node_Id gnat_node;
- int write_note_p;
+set_lineno (Node_Id gnat_node, int write_note_p)
{
Source_Ptr source_location = Sloc (gnat_node);
+ set_lineno_from_sloc (source_location, write_note_p);
+}
+
+/* Likewise, but passed a Sloc. */
+
+void
+set_lineno_from_sloc (Source_Ptr source_location, int write_note_p)
+{
/* If node not from source code, ignore. */
if (source_location < 0)
return;
@@ -5441,9 +5447,7 @@ set_lineno (gnat_node, write_note_p)
"&" substitution. */
void
-post_error (msg, node)
- const char *msg;
- Node_Id node;
+post_error (const char *msg, Node_Id node)
{
String_Template temp;
Fat_Pointer fp;
@@ -5458,10 +5462,7 @@ post_error (msg, node)
is the node to use for the "&" substitution. */
void
-post_error_ne (msg, node, ent)
- const char *msg;
- Node_Id node;
- Entity_Id ent;
+post_error_ne (const char *msg, Node_Id node, Entity_Id ent)
{
String_Template temp;
Fat_Pointer fp;
@@ -5476,11 +5477,7 @@ post_error_ne (msg, node, ent)
to use for the "&" substitution, and N is the number to use for the ^. */
void
-post_error_ne_num (msg, node, ent, n)
- const char *msg;
- Node_Id node;
- Entity_Id ent;
- int n;
+post_error_ne_num (const char *msg, Node_Id node, Entity_Id ent, int n)
{
String_Template temp;
Fat_Pointer fp;
@@ -5500,11 +5497,7 @@ post_error_ne_num (msg, node, ent, n)
and the text inside square brackets will be output instead. */
void
-post_error_ne_tree (msg, node, ent, t)
- const char *msg;
- Node_Id node;
- Entity_Id ent;
- tree t;
+post_error_ne_tree (const char *msg, Node_Id node, Entity_Id ent, tree t)
{
char *newmsg = alloca (strlen (msg) + 1);
String_Template temp = {1, 0};
@@ -5552,12 +5545,11 @@ post_error_ne_tree (msg, node, ent, t)
integer to write in the message. */
void
-post_error_ne_tree_2 (msg, node, ent, t, num)
- const char *msg;
- Node_Id node;
- Entity_Id ent;
- tree t;
- int num;
+post_error_ne_tree_2 (const char *msg,
+ Node_Id node,
+ Entity_Id ent,
+ tree t,
+ int num)
{
Error_Msg_Uint_2 = UI_From_Int (num);
post_error_ne_tree (msg, node, ent, t);
@@ -5566,8 +5558,7 @@ post_error_ne_tree_2 (msg, node, ent, t, num)
/* Set the node for a second '&' in the error message. */
void
-set_second_error_entity (e)
- Entity_Id e;
+set_second_error_entity (Entity_Id e)
{
Error_Msg_Node_2 = e;
}
@@ -5576,8 +5567,7 @@ set_second_error_entity (e)
as the relevant node that provides the location info for the error */
void
-gigi_abort (code)
- int code;
+gigi_abort (int code)
{
String_Template temp = {1, 10};
Fat_Pointer fp;
@@ -5592,7 +5582,7 @@ gigi_abort (code)
binary and unary operations. */
void
-init_code_table ()
+init_code_table (void)
{
gnu_codes[N_And_Then] = TRUTH_ANDIF_EXPR;
gnu_codes[N_Or_Else] = TRUTH_ORIF_EXPR;
diff --git a/gcc/ada/treeprs.ads b/gcc/ada/treeprs.ads
deleted file mode 100644
index 433cb081975..00000000000
--- a/gcc/ada/treeprs.ads
+++ /dev/null
@@ -1,796 +0,0 @@
-------------------------------------------------------------------------------
--- --
--- GNAT COMPILER COMPONENTS --
--- --
--- T R E E P R S --
--- --
--- S p e c --
--- --
--- Copyright (C) 1992-2003 Free Software Foundation, Inc. --
--- --
--- GNAT is free software; you can redistribute it and/or modify it under --
--- terms of the GNU General Public License as published by the Free Soft- --
--- ware Foundation; either version 2, or (at your option) any later ver- --
--- sion. GNAT is distributed in the hope that it will be useful, but WITH- --
--- OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY --
--- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License --
--- for more details. You should have received a copy of the GNU General --
--- Public License distributed with GNAT; see file COPYING. If not, write --
--- to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, --
--- MA 02111-1307, USA. --
--- --
--- GNAT was originally developed by the GNAT team at New York University. --
--- Extensive contributions were provided by Ada Core Technologies Inc. --
--- --
-------------------------------------------------------------------------------
-
-
--- This package contains the declaration of the string used by the Tree_Print
--- package. It must be updated whenever the arrangements of the field names
--- in package Sinfo is changed. The utility program XTREEPRS is used to
--- do this update correctly using the template treeprs.adt as input.
-
-with Sinfo; use Sinfo;
-
-package Treeprs is
-
- --------------------------------
- -- String Data for Node Print --
- --------------------------------
-
- -- String data for print out. The Pchars array is a long string with the
- -- the entry for each node type consisting of a single blank, followed by
- -- a series of entries, one for each Op or Flag field used for the node.
- -- Each entry has a single character which identifies the field, followed
- -- by the synonym name. The starting location for a given node type is
- -- found from the corresponding entry in the Pchars_Pos_Array.
-
- -- The following characters identify the field. These are characters
- -- which could never occur in a field name, so they also mark the
- -- end of the previous name.
-
- subtype Fchar is Character range '#' .. '9';
-
- F_Field1 : constant Fchar := '#'; -- Character'Val (16#23#)
- F_Field2 : constant Fchar := '$'; -- Character'Val (16#24#)
- F_Field3 : constant Fchar := '%'; -- Character'Val (16#25#)
- F_Field4 : constant Fchar := '&'; -- Character'Val (16#26#)
- F_Field5 : constant Fchar := '''; -- Character'Val (16#27#)
- F_Flag1 : constant Fchar := '('; -- Character'Val (16#28#)
- F_Flag2 : constant Fchar := ')'; -- Character'Val (16#29#)
- F_Flag3 : constant Fchar := '*'; -- Character'Val (16#2A#)
- F_Flag4 : constant Fchar := '+'; -- Character'Val (16#2B#)
- F_Flag5 : constant Fchar := ','; -- Character'Val (16#2C#)
- F_Flag6 : constant Fchar := '-'; -- Character'Val (16#2D#)
- F_Flag7 : constant Fchar := '.'; -- Character'Val (16#2E#)
- F_Flag8 : constant Fchar := '/'; -- Character'Val (16#2F#)
- F_Flag9 : constant Fchar := '0'; -- Character'Val (16#30#)
- F_Flag10 : constant Fchar := '1'; -- Character'Val (16#31#)
- F_Flag11 : constant Fchar := '2'; -- Character'Val (16#32#)
- F_Flag12 : constant Fchar := '3'; -- Character'Val (16#33#)
- F_Flag13 : constant Fchar := '4'; -- Character'Val (16#34#)
- F_Flag14 : constant Fchar := '5'; -- Character'Val (16#35#)
- F_Flag15 : constant Fchar := '6'; -- Character'Val (16#36#)
- F_Flag16 : constant Fchar := '7'; -- Character'Val (16#37#)
- F_Flag17 : constant Fchar := '8'; -- Character'Val (16#38#)
- F_Flag18 : constant Fchar := '9'; -- Character'Val (16#39#)
-
- -- Note this table does not include entity field and flags whose access
- -- functions are in Einfo (these are handled by the Print_Entity_Info
- -- procedure in Treepr, which uses the routines in Einfo to get the
- -- proper symbolic information). In addition, the following fields are
- -- handled by Treepr, and do not appear in the Pchars array:
-
- -- Analyzed
- -- Cannot_Be_Constant
- -- Chars
- -- Comes_From_Source
- -- Error_Posted
- -- Etype
- -- Is_Controlling_Actual
- -- Is_Overloaded
- -- Is_Static_Expression
- -- Left_Opnd
- -- Must_Check_Expr
- -- Must_Not_Freeze
- -- No_Overflow_Expr
- -- Paren_Count
- -- Raises_Constraint_Error
- -- Right_Opnd
-
- Pchars : constant String :=
- -- Unused_At_Start
- "" &
- -- At_Clause
- "#Identifier%Expression" &
- -- Component_Clause
- "#Component_Name$Position%First_Bit&Last_Bit" &
- -- Enumeration_Representation_Clause
- "#Identifier%Array_Aggregate&Next_Rep_Item" &
- -- Mod_Clause
- "%Expression&Pragmas_Before" &
- -- Record_Representation_Clause
- "#Identifier$Mod_Clause%Component_Clauses&Next_Rep_Item" &
- -- Attribute_Definition_Clause
- "$Name%Expression&Next_Rep_Item+From_At_Mod2Check_Address_Alignment" &
- -- Empty
- "" &
- -- Pragma
- "$Pragma_Argument_Associations%Debug_Statement&Next_Rep_Item" &
- -- Pragma_Argument_Association
- "%Expression" &
- -- Error
- "" &
- -- Defining_Character_Literal
- "$Next_Entity%Scope" &
- -- Defining_Identifier
- "$Next_Entity%Scope" &
- -- Defining_Operator_Symbol
- "$Next_Entity%Scope" &
- -- Expanded_Name
- "%Prefix$Selector_Name&Entity&Associated_Node4Redundant_Use2Has_Privat" &
- "e_View" &
- -- Identifier
- "&Entity&Associated_Node$Original_Discriminant4Redundant_Use2Has_Priva" &
- "te_View" &
- -- Operator_Symbol
- "%Strval&Entity&Associated_Node2Has_Private_View" &
- -- Character_Literal
- "$Char_Literal_Value&Entity&Associated_Node2Has_Private_View" &
- -- Op_Add
- "" &
- -- Op_Concat
- "4Is_Component_Left_Opnd5Is_Component_Right_Opnd" &
- -- Op_Expon
- "4Is_Power_Of_2_For_Shift" &
- -- Op_Subtract
- "" &
- -- Op_Divide
- "5Treat_Fixed_As_Integer4Do_Division_Check9Rounded_Result" &
- -- Op_Mod
- "5Treat_Fixed_As_Integer4Do_Division_Check" &
- -- Op_Multiply
- "5Treat_Fixed_As_Integer9Rounded_Result" &
- -- Op_Rem
- "5Treat_Fixed_As_Integer4Do_Division_Check" &
- -- Op_And
- "+Do_Length_Check" &
- -- Op_Eq
- "" &
- -- Op_Ge
- "" &
- -- Op_Gt
- "" &
- -- Op_Le
- "" &
- -- Op_Lt
- "" &
- -- Op_Ne
- "" &
- -- Op_Or
- "+Do_Length_Check" &
- -- Op_Xor
- "+Do_Length_Check" &
- -- Op_Rotate_Left
- "+Shift_Count_OK" &
- -- Op_Rotate_Right
- "+Shift_Count_OK" &
- -- Op_Shift_Left
- "+Shift_Count_OK" &
- -- Op_Shift_Right
- "+Shift_Count_OK" &
- -- Op_Shift_Right_Arithmetic
- "+Shift_Count_OK" &
- -- Op_Abs
- "" &
- -- Op_Minus
- "" &
- -- Op_Not
- "" &
- -- Op_Plus
- "" &
- -- Attribute_Reference
- "%Prefix$Attribute_Name#Expressions&Entity&Associated_Node8Do_Overflow" &
- "_Check4Redundant_Use+OK_For_Stream5Must_Be_Byte_Aligned" &
- -- And_Then
- "#Actions" &
- -- Conditional_Expression
- "#Expressions$Then_Actions%Else_Actions" &
- -- Explicit_Dereference
- "%Prefix" &
- -- Function_Call
- "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" &
- "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" &
- -- In
- "" &
- -- Indexed_Component
- "%Prefix#Expressions" &
- -- Integer_Literal
- "$Original_Entity%Intval4Print_In_Hex" &
- -- Not_In
- "" &
- -- Null
- "" &
- -- Or_Else
- "#Actions" &
- -- Procedure_Call_Statement
- "$Name%Parameter_Associations&First_Named_Actual#Controlling_Argument4" &
- "Do_Tag_Check8Parameter_List_Truncated9ABE_Is_Certain" &
- -- Qualified_Expression
- "&Subtype_Mark%Expression" &
- -- Raise_Constraint_Error
- "#Condition%Reason" &
- -- Raise_Program_Error
- "#Condition%Reason" &
- -- Raise_Storage_Error
- "#Condition%Reason" &
- -- Aggregate
- "#Expressions$Component_Associations8Null_Record_Present%Aggregate_Bou" &
- "nds&Associated_Node+Static_Processing_OK9Compile_Time_Known_Aggreg" &
- "ate2Expansion_Delayed" &
- -- Allocator
- "%Expression#Storage_Pool&Procedure_To_Call4No_Initialization8Do_Stora" &
- "ge_Check" &
- -- Extension_Aggregate
- "%Ancestor_Part&Associated_Node#Expressions$Component_Associations8Nul" &
- "l_Record_Present2Expansion_Delayed" &
- -- Range
- "#Low_Bound$High_Bound2Includes_Infinities" &
- -- Real_Literal
- "$Original_Entity%Realval&Corresponding_Integer_Value2Is_Machine_Numbe" &
- "r" &
- -- Reference
- "%Prefix" &
- -- Selected_Component
- "%Prefix$Selector_Name&Associated_Node4Do_Discriminant_Check2Is_In_Dis" &
- "criminant_Check" &
- -- Slice
- "%Prefix&Discrete_Range" &
- -- String_Literal
- "%Strval2Has_Wide_Character" &
- -- Subprogram_Info
- "#Identifier" &
- -- Type_Conversion
- "&Subtype_Mark%Expression4Do_Tag_Check+Do_Length_Check8Do_Overflow_Che" &
- "ck2Float_Truncate9Rounded_Result5Conversion_OK" &
- -- Unchecked_Expression
- "%Expression" &
- -- Unchecked_Type_Conversion
- "&Subtype_Mark%Expression2Kill_Range_Check8No_Truncation" &
- -- Subtype_Indication
- "&Subtype_Mark%Constraint/Must_Not_Freeze" &
- -- Component_Declaration
- "#Defining_Identifier+Aliased_Present'Subtype_Indication%Expression,Mo" &
- "re_Ids-Prev_Ids" &
- -- Entry_Declaration
- "#Defining_Identifier&Discrete_Subtype_Definition%Parameter_Specificat" &
- "ions'Corresponding_Body" &
- -- Formal_Object_Declaration
- "#Defining_Identifier6In_Present8Out_Present&Subtype_Mark%Expression,M" &
- "ore_Ids-Prev_Ids" &
- -- Formal_Type_Declaration
- "#Defining_Identifier%Formal_Type_Definition&Discriminant_Specificatio" &
- "ns4Unknown_Discriminants_Present" &
- -- Full_Type_Declaration
- "#Defining_Identifier&Discriminant_Specifications%Type_Definition2Disc" &
- "r_Check_Funcs_Built" &
- -- Incomplete_Type_Declaration
- "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" &
- "s_Present" &
- -- Loop_Parameter_Specification
- "#Defining_Identifier6Reverse_Present&Discrete_Subtype_Definition" &
- -- Object_Declaration
- "#Defining_Identifier+Aliased_Present8Constant_Present&Object_Definiti" &
- "on%Expression$Handler_List_Entry'Corresponding_Generic_Association" &
- ",More_Ids-Prev_Ids4No_Initialization6Assignment_OK2Exception_Junk5" &
- "Delay_Finalize_Attach7Is_Subprogram_Descriptor" &
- -- Protected_Type_Declaration
- "#Defining_Identifier&Discriminant_Specifications%Protected_Definition" &
- "'Corresponding_Body" &
- -- Private_Extension_Declaration
- "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" &
- "s_Present+Abstract_Present'Subtype_Indication" &
- -- Private_Type_Declaration
- "#Defining_Identifier&Discriminant_Specifications4Unknown_Discriminant" &
- "s_Present+Abstract_Present6Tagged_Present8Limited_Present" &
- -- Subtype_Declaration
- "#Defining_Identifier'Subtype_Indication&Generic_Parent_Type2Exception" &
- "_Junk" &
- -- Function_Specification
- "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications&Subt" &
- "ype_Mark'Generic_Parent" &
- -- Procedure_Specification
- "#Defining_Unit_Name$Elaboration_Boolean%Parameter_Specifications'Gene" &
- "ric_Parent" &
- -- Entry_Index_Specification
- "#Defining_Identifier&Discrete_Subtype_Definition" &
- -- Freeze_Entity
- "&Entity$Access_Types_To_Process%TSS_Elist#Actions'First_Subtype_Link" &
- -- Access_Function_Definition
- "6Protected_Present%Parameter_Specifications&Subtype_Mark" &
- -- Access_Procedure_Definition
- "6Protected_Present%Parameter_Specifications" &
- -- Task_Type_Declaration
- "#Defining_Identifier$Task_Body_Procedure&Discriminant_Specifications%" &
- "Task_Definition'Corresponding_Body" &
- -- Package_Body_Stub
- "#Defining_Identifier&Library_Unit'Corresponding_Body" &
- -- Protected_Body_Stub
- "#Defining_Identifier&Library_Unit'Corresponding_Body" &
- -- Subprogram_Body_Stub
- "#Specification&Library_Unit'Corresponding_Body" &
- -- Task_Body_Stub
- "#Defining_Identifier&Library_Unit'Corresponding_Body" &
- -- Function_Instantiation
- "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" &
- "ec9ABE_Is_Certain" &
- -- Package_Instantiation
- "#Defining_Unit_Name$Name%Generic_Associations&Parent_Spec'Instance_Sp" &
- "ec9ABE_Is_Certain" &
- -- Procedure_Instantiation
- "#Defining_Unit_Name$Name&Parent_Spec%Generic_Associations'Instance_Sp" &
- "ec9ABE_Is_Certain" &
- -- Package_Body
- "#Defining_Unit_Name$Declarations&Handled_Statement_Sequence'Correspon" &
- "ding_Spec4Was_Originally_Stub" &
- -- Subprogram_Body
- "#Specification$Declarations&Handled_Statement_Sequence%Activation_Cha" &
- "in_Entity'Corresponding_Spec+Acts_As_Spec6Bad_Is_Detected8Do_Stora" &
- "ge_Check-Has_Priority_Pragma.Is_Protected_Subprogram_Body,Is_Task_" &
- "Master4Was_Originally_Stub" &
- -- Protected_Body
- "#Defining_Identifier$Declarations&End_Label'Corresponding_Spec4Was_Or" &
- "iginally_Stub" &
- -- Task_Body
- "#Defining_Identifier$Declarations&Handled_Statement_Sequence,Is_Task_" &
- "Master%Activation_Chain_Entity'Corresponding_Spec4Was_Originally_S" &
- "tub" &
- -- Implicit_Label_Declaration
- "#Defining_Identifier$Label_Construct" &
- -- Package_Declaration
- "#Specification'Corresponding_Body&Parent_Spec%Activation_Chain_Entity" &
- -- Single_Task_Declaration
- "#Defining_Identifier%Task_Definition" &
- -- Subprogram_Declaration
- "#Specification%Body_To_Inline'Corresponding_Body&Parent_Spec" &
- -- Use_Package_Clause
- "$Names%Next_Use_Clause&Hidden_By_Use_Clause" &
- -- Generic_Package_Declaration
- "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" &
- "Spec%Activation_Chain_Entity" &
- -- Generic_Subprogram_Declaration
- "#Specification'Corresponding_Body$Generic_Formal_Declarations&Parent_" &
- "Spec" &
- -- Constrained_Array_Definition
- "$Discrete_Subtype_Definitions+Aliased_Present'Subtype_Indication" &
- -- Unconstrained_Array_Definition
- "$Subtype_Marks+Aliased_Present'Subtype_Indication" &
- -- Exception_Renaming_Declaration
- "#Defining_Identifier$Name" &
- -- Object_Renaming_Declaration
- "#Defining_Identifier&Subtype_Mark$Name'Corresponding_Generic_Associat" &
- "ion" &
- -- Package_Renaming_Declaration
- "#Defining_Unit_Name$Name&Parent_Spec" &
- -- Subprogram_Renaming_Declaration
- "#Specification$Name&Parent_Spec'Corresponding_Spec" &
- -- Generic_Function_Renaming_Declaration
- "#Defining_Unit_Name$Name&Parent_Spec" &
- -- Generic_Package_Renaming_Declaration
- "#Defining_Unit_Name$Name&Parent_Spec" &
- -- Generic_Procedure_Renaming_Declaration
- "#Defining_Unit_Name$Name&Parent_Spec" &
- -- Abort_Statement
- "$Names" &
- -- Accept_Statement
- "#Entry_Direct_Name'Entry_Index%Parameter_Specifications&Handled_State" &
- "ment_Sequence$Declarations" &
- -- Assignment_Statement
- "$Name%Expression4Do_Tag_Check+Do_Length_Check,Forwards_OK-Backwards_O" &
- "K.No_Ctrl_Actions" &
- -- Asynchronous_Select
- "#Triggering_Alternative$Abortable_Part" &
- -- Block_Statement
- "#Identifier$Declarations&Handled_Statement_Sequence,Is_Task_Master%Ac" &
- "tivation_Chain_Entity6Has_Created_Identifier-Is_Task_Allocation_Bl" &
- "ock.Is_Asynchronous_Call_Block" &
- -- Case_Statement
- "%Expression&Alternatives'End_Span" &
- -- Code_Statement
- "%Expression" &
- -- Conditional_Entry_Call
- "#Entry_Call_Alternative&Else_Statements" &
- -- Delay_Relative_Statement
- "%Expression" &
- -- Delay_Until_Statement
- "%Expression" &
- -- Entry_Call_Statement
- "$Name%Parameter_Associations&First_Named_Actual" &
- -- Free_Statement
- "%Expression#Storage_Pool&Procedure_To_Call" &
- -- Goto_Statement
- "$Name2Exception_Junk" &
- -- Loop_Statement
- "#Identifier$Iteration_Scheme%Statements&End_Label6Has_Created_Identif" &
- "ier7Is_Null_Loop" &
- -- Null_Statement
- "" &
- -- Raise_Statement
- "$Name" &
- -- Requeue_Statement
- "$Name6Abort_Present" &
- -- Return_Statement
- "%Expression#Storage_Pool&Procedure_To_Call4Do_Tag_Check$Return_Type,B" &
- "y_Ref" &
- -- Selective_Accept
- "#Select_Alternatives&Else_Statements" &
- -- Timed_Entry_Call
- "#Entry_Call_Alternative&Delay_Alternative" &
- -- Exit_Statement
- "$Name#Condition" &
- -- If_Statement
- "#Condition$Then_Statements%Elsif_Parts&Else_Statements'End_Span" &
- -- Accept_Alternative
- "$Accept_Statement#Condition%Statements&Pragmas_Before'Accept_Handler_" &
- "Records" &
- -- Delay_Alternative
- "$Delay_Statement#Condition%Statements&Pragmas_Before" &
- -- Elsif_Part
- "#Condition$Then_Statements%Condition_Actions" &
- -- Entry_Body_Formal_Part
- "&Entry_Index_Specification%Parameter_Specifications#Condition" &
- -- Iteration_Scheme
- "#Condition%Condition_Actions&Loop_Parameter_Specification" &
- -- Terminate_Alternative
- "#Condition&Pragmas_Before'Pragmas_After" &
- -- Abortable_Part
- "%Statements" &
- -- Abstract_Subprogram_Declaration
- "#Specification" &
- -- Access_Definition
- "&Subtype_Mark" &
- -- Access_To_Object_Definition
- "6All_Present'Subtype_Indication8Constant_Present" &
- -- Case_Statement_Alternative
- "&Discrete_Choices%Statements" &
- -- Compilation_Unit
- "&Library_Unit#Context_Items6Private_Present$Unit'Aux_Decls_Node8Has_N" &
- "o_Elaboration_Code4Body_Required+Acts_As_Spec%First_Inlined_Subpro" &
- "gram" &
- -- Compilation_Unit_Aux
- "$Declarations#Actions'Pragmas_After&Config_Pragmas" &
- -- Component_Association
- "#Choices$Loop_Actions%Expression" &
- -- Component_List
- "%Component_Items&Variant_Part4Null_Present" &
- -- Derived_Type_Definition
- "+Abstract_Present'Subtype_Indication%Record_Extension_Part" &
- -- Decimal_Fixed_Point_Definition
- "%Delta_Expression$Digits_Expression&Real_Range_Specification" &
- -- Defining_Program_Unit_Name
- "$Name#Defining_Identifier" &
- -- Delta_Constraint
- "%Delta_Expression&Range_Constraint" &
- -- Designator
- "$Name#Identifier" &
- -- Digits_Constraint
- "$Digits_Expression&Range_Constraint" &
- -- Discriminant_Association
- "#Selector_Names%Expression" &
- -- Discriminant_Specification
- "#Defining_Identifier'Discriminant_Type%Expression,More_Ids-Prev_Ids" &
- -- Enumeration_Type_Definition
- "#Literals&End_Label" &
- -- Entry_Body
- "#Defining_Identifier'Entry_Body_Formal_Part$Declarations&Handled_Stat" &
- "ement_Sequence%Activation_Chain_Entity" &
- -- Entry_Call_Alternative
- "#Entry_Call_Statement%Statements&Pragmas_Before" &
- -- Exception_Declaration
- "#Defining_Identifier%Expression,More_Ids-Prev_Ids" &
- -- Exception_Handler
- "$Choice_Parameter&Exception_Choices%Statements,Zero_Cost_Handling" &
- -- Floating_Point_Definition
- "$Digits_Expression&Real_Range_Specification" &
- -- Formal_Decimal_Fixed_Point_Definition
- "" &
- -- Formal_Derived_Type_Definition
- "&Subtype_Mark6Private_Present+Abstract_Present" &
- -- Formal_Discrete_Type_Definition
- "" &
- -- Formal_Floating_Point_Definition
- "" &
- -- Formal_Modular_Type_Definition
- "" &
- -- Formal_Ordinary_Fixed_Point_Definition
- "" &
- -- Formal_Package_Declaration
- "#Defining_Identifier$Name%Generic_Associations6Box_Present'Instance_S" &
- "pec9ABE_Is_Certain" &
- -- Formal_Private_Type_Definition
- "+Abstract_Present6Tagged_Present8Limited_Present" &
- -- Formal_Signed_Integer_Type_Definition
- "" &
- -- Formal_Subprogram_Declaration
- "#Specification$Default_Name6Box_Present" &
- -- Generic_Association
- "$Selector_Name#Explicit_Generic_Actual_Parameter" &
- -- Handled_Sequence_Of_Statements
- "%Statements&End_Label'Exception_Handlers#At_End_Proc$First_Real_State" &
- "ment,Zero_Cost_Handling" &
- -- Index_Or_Discriminant_Constraint
- "#Constraints" &
- -- Itype_Reference
- "#Itype" &
- -- Label
- "#Identifier2Exception_Junk" &
- -- Modular_Type_Definition
- "%Expression" &
- -- Number_Declaration
- "#Defining_Identifier%Expression,More_Ids-Prev_Ids" &
- -- Ordinary_Fixed_Point_Definition
- "%Delta_Expression&Real_Range_Specification" &
- -- Others_Choice
- "#Others_Discrete_Choices2All_Others" &
- -- Package_Specification
- "#Defining_Unit_Name$Visible_Declarations%Private_Declarations&End_Lab" &
- "el'Generic_Parent9Limited_View_Installed" &
- -- Parameter_Association
- "$Selector_Name%Explicit_Actual_Parameter&Next_Named_Actual" &
- -- Parameter_Specification
- "#Defining_Identifier6In_Present8Out_Present$Parameter_Type%Expression" &
- "4Do_Accessibility_Check,More_Ids-Prev_Ids'Default_Expression" &
- -- Protected_Definition
- "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" &
- "gma" &
- -- Range_Constraint
- "&Range_Expression" &
- -- Real_Range_Specification
- "#Low_Bound$High_Bound" &
- -- Record_Definition
- "&End_Label+Abstract_Present6Tagged_Present8Limited_Present#Component_" &
- "List4Null_Present" &
- -- Signed_Integer_Type_Definition
- "#Low_Bound$High_Bound" &
- -- Single_Protected_Declaration
- "#Defining_Identifier%Protected_Definition" &
- -- Subunit
- "$Name#Proper_Body%Corresponding_Stub" &
- -- Task_Definition
- "$Visible_Declarations%Private_Declarations&End_Label-Has_Priority_Pra" &
- "gma,Has_Storage_Size_Pragma.Has_Task_Info_Pragma/Has_Task_Name_Pra" &
- "gma" &
- -- Triggering_Alternative
- "#Triggering_Statement%Statements&Pragmas_Before" &
- -- Use_Type_Clause
- "$Subtype_Marks%Next_Use_Clause&Hidden_By_Use_Clause" &
- -- Validate_Unchecked_Conversion
- "#Source_Type$Target_Type" &
- -- Variant
- "&Discrete_Choices#Component_List$Enclosing_Variant%Present_Expr'Dchec" &
- "k_Function" &
- -- Variant_Part
- "$Name#Variants" &
- -- With_Clause
- "$Name&Library_Unit'Corresponding_Spec,First_Name-Last_Name4Context_In" &
- "stalled+Elaborate_Present6Elaborate_All_Present7Implicit_With8Limi" &
- "ted_Present9Limited_View_Installed.Unreferenced_In_Spec/No_Entitie" &
- "s_Ref_In_Spec" &
- -- With_Type_Clause
- "$Name6Tagged_Present" &
- -- Unused_At_End
- "";
-
- type Pchar_Pos_Array is array (Node_Kind) of Positive;
- Pchar_Pos : constant Pchar_Pos_Array := Pchar_Pos_Array'(
- N_Unused_At_Start => 1,
- N_At_Clause => 1,
- N_Component_Clause => 23,
- N_Enumeration_Representation_Clause => 66,
- N_Mod_Clause => 107,
- N_Record_Representation_Clause => 133,
- N_Attribute_Definition_Clause => 187,
- N_Empty => 253,
- N_Pragma => 253,
- N_Pragma_Argument_Association => 312,
- N_Error => 323,
- N_Defining_Character_Literal => 323,
- N_Defining_Identifier => 341,
- N_Defining_Operator_Symbol => 359,
- N_Expanded_Name => 377,
- N_Identifier => 452,
- N_Operator_Symbol => 528,
- N_Character_Literal => 575,
- N_Op_Add => 634,
- N_Op_Concat => 634,
- N_Op_Expon => 681,
- N_Op_Subtract => 705,
- N_Op_Divide => 705,
- N_Op_Mod => 761,
- N_Op_Multiply => 802,
- N_Op_Rem => 840,
- N_Op_And => 881,
- N_Op_Eq => 897,
- N_Op_Ge => 897,
- N_Op_Gt => 897,
- N_Op_Le => 897,
- N_Op_Lt => 897,
- N_Op_Ne => 897,
- N_Op_Or => 897,
- N_Op_Xor => 913,
- N_Op_Rotate_Left => 929,
- N_Op_Rotate_Right => 944,
- N_Op_Shift_Left => 959,
- N_Op_Shift_Right => 974,
- N_Op_Shift_Right_Arithmetic => 989,
- N_Op_Abs => 1004,
- N_Op_Minus => 1004,
- N_Op_Not => 1004,
- N_Op_Plus => 1004,
- N_Attribute_Reference => 1004,
- N_And_Then => 1128,
- N_Conditional_Expression => 1136,
- N_Explicit_Dereference => 1174,
- N_Function_Call => 1181,
- N_In => 1302,
- N_Indexed_Component => 1302,
- N_Integer_Literal => 1321,
- N_Not_In => 1357,
- N_Null => 1357,
- N_Or_Else => 1357,
- N_Procedure_Call_Statement => 1365,
- N_Qualified_Expression => 1486,
- N_Raise_Constraint_Error => 1510,
- N_Raise_Program_Error => 1527,
- N_Raise_Storage_Error => 1544,
- N_Aggregate => 1561,
- N_Allocator => 1717,
- N_Extension_Aggregate => 1794,
- N_Range => 1897,
- N_Real_Literal => 1938,
- N_Reference => 2008,
- N_Selected_Component => 2015,
- N_Slice => 2099,
- N_String_Literal => 2121,
- N_Subprogram_Info => 2147,
- N_Type_Conversion => 2158,
- N_Unchecked_Expression => 2273,
- N_Unchecked_Type_Conversion => 2284,
- N_Subtype_Indication => 2339,
- N_Component_Declaration => 2379,
- N_Entry_Declaration => 2463,
- N_Formal_Object_Declaration => 2555,
- N_Formal_Type_Declaration => 2640,
- N_Full_Type_Declaration => 2741,
- N_Incomplete_Type_Declaration => 2829,
- N_Loop_Parameter_Specification => 2907,
- N_Object_Declaration => 2971,
- N_Protected_Type_Declaration => 3218,
- N_Private_Extension_Declaration => 3306,
- N_Private_Type_Declaration => 3420,
- N_Subtype_Declaration => 3546,
- N_Function_Specification => 3620,
- N_Procedure_Specification => 3712,
- N_Entry_Index_Specification => 3791,
- N_Freeze_Entity => 3839,
- N_Access_Function_Definition => 3907,
- N_Access_Procedure_Definition => 3963,
- N_Task_Type_Declaration => 4006,
- N_Package_Body_Stub => 4109,
- N_Protected_Body_Stub => 4161,
- N_Subprogram_Body_Stub => 4213,
- N_Task_Body_Stub => 4259,
- N_Function_Instantiation => 4311,
- N_Package_Instantiation => 4397,
- N_Procedure_Instantiation => 4483,
- N_Package_Body => 4569,
- N_Subprogram_Body => 4667,
- N_Protected_Body => 4894,
- N_Task_Body => 4976,
- N_Implicit_Label_Declaration => 5114,
- N_Package_Declaration => 5150,
- N_Single_Task_Declaration => 5219,
- N_Subprogram_Declaration => 5255,
- N_Use_Package_Clause => 5315,
- N_Generic_Package_Declaration => 5358,
- N_Generic_Subprogram_Declaration => 5455,
- N_Constrained_Array_Definition => 5528,
- N_Unconstrained_Array_Definition => 5592,
- N_Exception_Renaming_Declaration => 5641,
- N_Object_Renaming_Declaration => 5666,
- N_Package_Renaming_Declaration => 5738,
- N_Subprogram_Renaming_Declaration => 5774,
- N_Generic_Function_Renaming_Declaration => 5824,
- N_Generic_Package_Renaming_Declaration => 5860,
- N_Generic_Procedure_Renaming_Declaration => 5896,
- N_Abort_Statement => 5932,
- N_Accept_Statement => 5938,
- N_Assignment_Statement => 6033,
- N_Asynchronous_Select => 6119,
- N_Block_Statement => 6157,
- N_Case_Statement => 6322,
- N_Code_Statement => 6355,
- N_Conditional_Entry_Call => 6366,
- N_Delay_Relative_Statement => 6405,
- N_Delay_Until_Statement => 6416,
- N_Entry_Call_Statement => 6427,
- N_Free_Statement => 6474,
- N_Goto_Statement => 6516,
- N_Loop_Statement => 6536,
- N_Null_Statement => 6621,
- N_Raise_Statement => 6621,
- N_Requeue_Statement => 6626,
- N_Return_Statement => 6645,
- N_Selective_Accept => 6719,
- N_Timed_Entry_Call => 6755,
- N_Exit_Statement => 6796,
- N_If_Statement => 6811,
- N_Accept_Alternative => 6874,
- N_Delay_Alternative => 6950,
- N_Elsif_Part => 7002,
- N_Entry_Body_Formal_Part => 7046,
- N_Iteration_Scheme => 7107,
- N_Terminate_Alternative => 7164,
- N_Abortable_Part => 7203,
- N_Abstract_Subprogram_Declaration => 7214,
- N_Access_Definition => 7228,
- N_Access_To_Object_Definition => 7241,
- N_Case_Statement_Alternative => 7289,
- N_Compilation_Unit => 7317,
- N_Compilation_Unit_Aux => 7456,
- N_Component_Association => 7506,
- N_Component_List => 7538,
- N_Derived_Type_Definition => 7580,
- N_Decimal_Fixed_Point_Definition => 7638,
- N_Defining_Program_Unit_Name => 7698,
- N_Delta_Constraint => 7723,
- N_Designator => 7757,
- N_Digits_Constraint => 7773,
- N_Discriminant_Association => 7808,
- N_Discriminant_Specification => 7834,
- N_Enumeration_Type_Definition => 7901,
- N_Entry_Body => 7920,
- N_Entry_Call_Alternative => 8027,
- N_Exception_Declaration => 8074,
- N_Exception_Handler => 8123,
- N_Floating_Point_Definition => 8188,
- N_Formal_Decimal_Fixed_Point_Definition => 8231,
- N_Formal_Derived_Type_Definition => 8231,
- N_Formal_Discrete_Type_Definition => 8277,
- N_Formal_Floating_Point_Definition => 8277,
- N_Formal_Modular_Type_Definition => 8277,
- N_Formal_Ordinary_Fixed_Point_Definition => 8277,
- N_Formal_Package_Declaration => 8277,
- N_Formal_Private_Type_Definition => 8364,
- N_Formal_Signed_Integer_Type_Definition => 8412,
- N_Formal_Subprogram_Declaration => 8412,
- N_Generic_Association => 8451,
- N_Handled_Sequence_Of_Statements => 8499,
- N_Index_Or_Discriminant_Constraint => 8591,
- N_Itype_Reference => 8603,
- N_Label => 8609,
- N_Modular_Type_Definition => 8635,
- N_Number_Declaration => 8646,
- N_Ordinary_Fixed_Point_Definition => 8695,
- N_Others_Choice => 8737,
- N_Package_Specification => 8772,
- N_Parameter_Association => 8881,
- N_Parameter_Specification => 8939,
- N_Protected_Definition => 9068,
- N_Range_Constraint => 9140,
- N_Real_Range_Specification => 9157,
- N_Record_Definition => 9178,
- N_Signed_Integer_Type_Definition => 9264,
- N_Single_Protected_Declaration => 9285,
- N_Subunit => 9326,
- N_Task_Definition => 9362,
- N_Triggering_Alternative => 9500,
- N_Use_Type_Clause => 9547,
- N_Validate_Unchecked_Conversion => 9598,
- N_Variant => 9622,
- N_Variant_Part => 9701,
- N_With_Clause => 9715,
- N_With_Type_Clause => 9929,
- N_Unused_At_End => 9949);
-
-end Treeprs;
diff --git a/gcc/ada/types.ads b/gcc/ada/types.ads
index a93dbb47054..a2c15984cf6 100644
--- a/gcc/ada/types.ads
+++ b/gcc/ada/types.ads
@@ -569,9 +569,14 @@ pragma Preelaborate (Types);
No_Unit : constant Unit_Number_Type := -1;
-- Special value used to signal no unit
- type Source_File_Index is new Nat;
+ type Source_File_Index is new Int range -1 .. Int'Last;
-- Type used to index the source file table (see package Sinput)
+ Internal_Source_File : constant Source_File_Index :=
+ Source_File_Index'First;
+ -- Value used to indicate the buffer for the source-code-like strings
+ -- internally created withing the compiler (see package Sinput)
+
No_Source_File : constant Source_File_Index := 0;
-- Value used to indicate no source file present
diff --git a/gcc/ada/usage.adb b/gcc/ada/usage.adb
index dad6005376b..c729f483791 100644
--- a/gcc/ada/usage.adb
+++ b/gcc/ada/usage.adb
@@ -235,7 +235,7 @@ begin
-- Line for -gnatN switch
Write_Switch_Char ("N");
- Write_Line ("Full (frontend) inlining of subprograqms");
+ Write_Line ("Full (frontend) inlining of subprograms");
-- Line for -gnato switch
@@ -277,6 +277,11 @@ begin
Write_Switch_Char ("s");
Write_Line ("Syntax check only");
+ -- Lines for -gnatS switch
+
+ Write_Switch_Char ("S");
+ Write_Line ("Print listing of package Standard");
+
-- Lines for -gnatt switch
Write_Switch_Char ("t");
diff --git a/gcc/ada/utils.c b/gcc/ada/utils.c
index c1c5ccf4ce4..423634ea64d 100644
--- a/gcc/ada/utils.c
+++ b/gcc/ada/utils.c
@@ -144,22 +144,21 @@ struct language_function GTY(())
int unused;
};
-static tree merge_sizes PARAMS ((tree, tree, tree, int, int));
-static tree compute_related_constant PARAMS ((tree, tree));
-static tree split_plus PARAMS ((tree, tree *));
-static int value_zerop PARAMS ((tree));
-static tree float_type_for_size PARAMS ((int, enum machine_mode));
-static tree convert_to_fat_pointer PARAMS ((tree, tree));
-static tree convert_to_thin_pointer PARAMS ((tree, tree));
-static tree make_descriptor_field PARAMS ((const char *,tree, tree,
- tree));
-static int value_factor_p PARAMS ((tree, int));
-static int potential_alignment_gap PARAMS ((tree, tree, tree));
+static tree merge_sizes (tree, tree, tree, int, int);
+static tree compute_related_constant (tree, tree);
+static tree split_plus (tree, tree *);
+static int value_zerop (tree);
+static tree float_type_for_precision (int, enum machine_mode);
+static tree convert_to_fat_pointer (tree, tree);
+static tree convert_to_thin_pointer (tree, tree);
+static tree make_descriptor_field (const char *,tree, tree, tree);
+static int value_factor_p (tree, int);
+static int potential_alignment_gap (tree, tree, tree);
/* Initialize the association of GNAT nodes to GCC trees. */
void
-init_gnat_to_gnu ()
+init_gnat_to_gnu (void)
{
associate_gnat_to_gnu
= (tree *) ggc_alloc_cleared (max_gnat_nodes * sizeof (tree));
@@ -174,10 +173,7 @@ init_gnat_to_gnu ()
If GNU_DECL is zero, a previous association is to be reset. */
void
-save_gnu_tree (gnat_entity, gnu_decl, no_check)
- Entity_Id gnat_entity;
- tree gnu_decl;
- int no_check;
+save_gnu_tree (Entity_Id gnat_entity, tree gnu_decl, int no_check)
{
/* Check that GNAT_ENTITY is not already defined and that it is being set
to something which is a decl. Raise gigi 401 if not. Usually, this
@@ -199,8 +195,7 @@ save_gnu_tree (gnat_entity, gnu_decl, no_check)
be elaborated only once, GNAT_ENTITY is really not an entity. */
tree
-get_gnu_tree (gnat_entity)
- Entity_Id gnat_entity;
+get_gnu_tree (Entity_Id gnat_entity)
{
if (! associate_gnat_to_gnu[gnat_entity - First_Node_Id])
gigi_abort (402);
@@ -211,8 +206,7 @@ get_gnu_tree (gnat_entity)
/* Return nonzero if a GCC tree has been associated with GNAT_ENTITY. */
int
-present_gnu_tree (gnat_entity)
- Entity_Id gnat_entity;
+present_gnu_tree (Entity_Id gnat_entity)
{
return (associate_gnat_to_gnu[gnat_entity - First_Node_Id] != NULL_TREE);
}
@@ -221,7 +215,7 @@ present_gnu_tree (gnat_entity)
/* Return non-zero if we are currently in the global binding level. */
int
-global_bindings_p ()
+global_bindings_p (void)
{
return (force_global != 0 || current_binding_level == global_binding_level
? -1 : 0);
@@ -231,7 +225,7 @@ global_bindings_p ()
is in reverse order (it has to be so for back-end compatibility). */
tree
-getdecls ()
+getdecls (void)
{
return current_binding_level->names;
}
@@ -239,7 +233,7 @@ getdecls ()
/* Nonzero if the current level needs to have a BLOCK made. */
int
-kept_level_p ()
+kept_level_p (void)
{
return (current_binding_level->names != 0);
}
@@ -248,8 +242,7 @@ kept_level_p ()
specified for back-end compatibility. */
void
-pushlevel (ignore)
- int ignore ATTRIBUTE_UNUSED;
+pushlevel (int ignore ATTRIBUTE_UNUSED)
{
struct binding_level *newlevel = NULL;
@@ -287,10 +280,7 @@ pushlevel (ignore)
them into the BLOCK. */
tree
-poplevel (keep, reverse, functionbody)
- int keep;
- int reverse;
- int functionbody;
+poplevel (int keep, int reverse, int functionbody)
{
/* Points to a GCC BLOCK tree node. This is the BLOCK node construted for the
binding level that we are about to exit and which is returned by this
@@ -396,8 +386,7 @@ poplevel (keep, reverse, functionbody)
to handle the BLOCK node inside the BIND_EXPR. */
void
-insert_block (block)
- tree block;
+insert_block (tree block)
{
TREE_USED (block) = 1;
current_binding_level->blocks
@@ -408,8 +397,7 @@ insert_block (block)
(the one we are currently in). */
void
-set_block (block)
- tree block;
+set_block (tree block)
{
current_binding_level->this_block = block;
current_binding_level->names = chainon (current_binding_level->names,
@@ -422,8 +410,7 @@ set_block (block)
Returns the ..._DECL node. */
tree
-pushdecl (decl)
- tree decl;
+pushdecl (tree decl)
{
struct binding_level *b;
@@ -478,7 +465,7 @@ pushdecl (decl)
front end has been run. */
void
-gnat_init_decl_processing ()
+gnat_init_decl_processing (void)
{
input_line = 0;
@@ -516,8 +503,7 @@ gnat_init_decl_processing ()
in the gcc back-end and initialize the global binding level. */
void
-init_gigi_decls (long_long_float_type, exception_type)
- tree long_long_float_type, exception_type;
+init_gigi_decls (tree long_long_float_type, tree exception_type)
{
tree endlink, decl;
unsigned int i;
@@ -689,7 +675,7 @@ init_gigi_decls (long_long_float_type, exception_type)
a jmpbuf. */
setjmp_decl
= create_subprog_decl
- (get_identifier ("setjmp"), NULL_TREE,
+ (get_identifier ("__builtin_setjmp"), NULL_TREE,
build_function_type (integer_type_node,
tree_cons (NULL_TREE, jmpbuf_ptr_type, endlink)),
NULL_TREE, 0, 1, 1, 0);
@@ -708,11 +694,10 @@ init_gigi_decls (long_long_float_type, exception_type)
on this type; it will be done later. */
void
-finish_record_type (record_type, fieldlist, has_rep, defer_debug)
- tree record_type;
- tree fieldlist;
- int has_rep;
- int defer_debug;
+finish_record_type (tree record_type,
+ tree fieldlist,
+ int has_rep,
+ int defer_debug)
{
enum tree_code code = TREE_CODE (record_type);
tree ada_size = bitsize_zero_node;
@@ -1030,11 +1015,11 @@ finish_record_type (record_type, fieldlist, has_rep, defer_debug)
We return an expression for the size. */
static tree
-merge_sizes (last_size, first_bit, size, special, has_rep)
- tree last_size;
- tree first_bit, size;
- int special;
- int has_rep;
+merge_sizes (tree last_size,
+ tree first_bit,
+ tree size,
+ int special,
+ int has_rep)
{
tree type = TREE_TYPE (last_size);
tree new;
@@ -1070,8 +1055,7 @@ merge_sizes (last_size, first_bit, size, special, has_rep)
related by the addition of a constant. Return that constant if so. */
static tree
-compute_related_constant (op0, op1)
- tree op0, op1;
+compute_related_constant (tree op0, tree op1)
{
tree op0_var, op1_var;
tree op0_con = split_plus (op0, &op0_var);
@@ -1092,9 +1076,7 @@ compute_related_constant (op0, op1)
bitsizetype. */
static tree
-split_plus (in, pvar)
- tree in;
- tree *pvar;
+split_plus (tree in, tree *pvar)
{
/* Strip NOPS in order to ease the tree traversal and maximize the
potential for constant or plus/minus discovery. We need to be careful
@@ -1137,12 +1119,12 @@ split_plus (in, pvar)
depressed stack pointer. */
tree
-create_subprog_type (return_type, param_decl_list, cico_list,
- returns_unconstrained, returns_by_ref, returns_with_dsp)
- tree return_type;
- tree param_decl_list;
- tree cico_list;
- int returns_unconstrained, returns_by_ref, returns_with_dsp;
+create_subprog_type (tree return_type,
+ tree param_decl_list,
+ tree cico_list,
+ int returns_unconstrained,
+ int returns_by_ref,
+ int returns_with_dsp)
{
/* A chain of TREE_LIST nodes whose TREE_VALUEs are the data type nodes of
the subprogram formal parameters. This list is generated by traversing the
@@ -1186,8 +1168,7 @@ create_subprog_type (return_type, param_decl_list, cico_list,
/* Return a copy of TYPE but safe to modify in any way. */
tree
-copy_type (type)
- tree type;
+copy_type (tree type)
{
tree new = copy_node (type);
@@ -1207,9 +1188,7 @@ copy_type (type)
TYPE_INDEX_TYPE is INDEX. */
tree
-create_index_type (min, max, index)
- tree min, max;
- tree index;
+create_index_type (tree min, tree max, tree index)
{
/* First build a type for the desired range. */
tree type = build_index_2_type (min, max);
@@ -1235,12 +1214,11 @@ create_index_type (min, max, index)
information about this type. */
tree
-create_type_decl (type_name, type, attr_list, artificial_p, debug_info_p)
- tree type_name;
- tree type;
- struct attrib *attr_list;
- int artificial_p;
- int debug_info_p;
+create_type_decl (tree type_name,
+ tree type,
+ struct attrib *attr_list,
+ int artificial_p,
+ int debug_info_p)
{
tree type_decl = build_decl (TYPE_DECL, type_name, type);
enum tree_code code = TREE_CODE (type);
@@ -1282,17 +1260,15 @@ create_type_decl (type_name, type, attr_list, artificial_p, debug_info_p)
it indicates whether to always allocate storage to the variable. */
tree
-create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag,
- extern_flag, static_flag, attr_list)
- tree var_name;
- tree asm_name;
- tree type;
- tree var_init;
- int const_flag;
- int public_flag;
- int extern_flag;
- int static_flag;
- struct attrib *attr_list;
+create_var_decl (tree var_name,
+ tree asm_name,
+ tree type,
+ tree var_init,
+ int const_flag,
+ int public_flag,
+ int extern_flag,
+ int static_flag,
+ struct attrib *attr_list)
{
int init_const
= (var_init == 0
@@ -1397,14 +1373,13 @@ create_var_decl (var_name, asm_name, type, var_init, const_flag, public_flag,
the address of this field for aliasing purposes. */
tree
-create_field_decl (field_name, field_type, record_type, packed, size, pos,
- addressable)
- tree field_name;
- tree field_type;
- tree record_type;
- int packed;
- tree size, pos;
- int addressable;
+create_field_decl (tree field_name,
+ tree field_type,
+ tree record_type,
+ int packed,
+ tree size,
+ tree pos,
+ int addressable)
{
tree field_decl = build_decl (FIELD_DECL, field_name, field_type);
@@ -1515,8 +1490,7 @@ create_field_decl (field_name, field_type, record_type, packed, size, pos,
effects, has the value of zero. */
static int
-value_zerop (exp)
- tree exp;
+value_zerop (tree exp)
{
if (TREE_CODE (exp) == COMPOUND_EXPR)
return value_zerop (TREE_OPERAND (exp, 1));
@@ -1530,10 +1504,7 @@ value_zerop (exp)
parameter). */
tree
-create_param_decl (param_name, param_type, readonly)
- tree param_name;
- tree param_type;
- int readonly;
+create_param_decl (tree param_name, tree param_type, int readonly)
{
tree param_decl = build_decl (PARM_DECL, param_name, param_type);
@@ -1570,9 +1541,7 @@ create_param_decl (param_name, param_type, readonly)
/* Given a DECL and ATTR_LIST, process the listed attributes. */
void
-process_attributes (decl, attr_list)
- tree decl;
- struct attrib *attr_list;
+process_attributes (tree decl, struct attrib *attr_list)
{
for (; attr_list; attr_list = attr_list->next)
switch (attr_list->type)
@@ -1613,9 +1582,7 @@ process_attributes (decl, attr_list)
/* Add some pending elaborations on the list. */
void
-add_pending_elaborations (var_decl, var_init)
- tree var_decl;
- tree var_init;
+add_pending_elaborations (tree var_decl, tree var_init)
{
if (var_init != 0)
Check_Elaboration_Code_Allowed (error_gnat_node);
@@ -1627,7 +1594,7 @@ add_pending_elaborations (var_decl, var_init)
/* Obtain any pending elaborations and clear the old list. */
tree
-get_pending_elaborations ()
+get_pending_elaborations (void)
{
/* Each thing added to the list went on the end; we want it on the
beginning. */
@@ -1641,9 +1608,7 @@ get_pending_elaborations ()
of 2. */
static int
-value_factor_p (value, factor)
- tree value;
- int factor;
+value_factor_p (tree value, int factor)
{
if (host_integerp (value, 1))
return tree_low_cst (value, 1) % factor == 0;
@@ -1662,10 +1627,7 @@ value_factor_p (value, factor)
position of CURR_FIELD. It is ignored if null. */
static int
-potential_alignment_gap (prev_field, curr_field, offset)
- tree prev_field;
- tree curr_field;
- tree offset;
+potential_alignment_gap (tree prev_field, tree curr_field, tree offset)
{
/* If this is the first field of the record, there cannot be any gap */
if (!prev_field)
@@ -1707,7 +1669,7 @@ potential_alignment_gap (prev_field, curr_field, offset)
/* Return nonzero if there are pending elaborations. */
int
-pending_elaborations_p ()
+pending_elaborations_p (void)
{
return TREE_CHAIN (pending_elaborations) != 0;
}
@@ -1716,7 +1678,7 @@ pending_elaborations_p ()
one. */
void
-push_pending_elaborations ()
+push_pending_elaborations (void)
{
struct e_stack *p = (struct e_stack *) ggc_alloc (sizeof (struct e_stack));
@@ -1729,7 +1691,7 @@ push_pending_elaborations ()
/* Pop the stack of pending elaborations. */
void
-pop_pending_elaborations ()
+pop_pending_elaborations (void)
{
struct e_stack *p = elist_stack;
@@ -1741,7 +1703,7 @@ pop_pending_elaborations ()
elaborations after that point. */
tree
-get_elaboration_location ()
+get_elaboration_location (void)
{
return tree_last (pending_elaborations);
}
@@ -1750,8 +1712,7 @@ get_elaboration_location ()
list. */
void
-insert_elaboration_list (elab)
- tree elab;
+insert_elaboration_list (tree elab)
{
tree next = TREE_CHAIN (elab);
@@ -1766,8 +1727,7 @@ insert_elaboration_list (elab)
/* Returns a LABEL_DECL node for LABEL_NAME. */
tree
-create_label_decl (label_name)
- tree label_name;
+create_label_decl (tree label_name)
{
tree label_decl = build_decl (LABEL_DECL, label_name, void_type_node);
@@ -1787,16 +1747,14 @@ create_label_decl (label_name)
appropriate fields in the FUNCTION_DECL. */
tree
-create_subprog_decl (subprog_name, asm_name, subprog_type, param_decl_list,
- inline_flag, public_flag, extern_flag, attr_list)
- tree subprog_name;
- tree asm_name;
- tree subprog_type;
- tree param_decl_list;
- int inline_flag;
- int public_flag;
- int extern_flag;
- struct attrib *attr_list;
+create_subprog_decl (tree subprog_name,
+ tree asm_name,
+ tree subprog_type,
+ tree param_decl_list,
+ int inline_flag,
+ int public_flag,
+ int extern_flag,
+ struct attrib *attr_list)
{
tree return_type = TREE_TYPE (subprog_type);
tree subprog_decl = build_decl (FUNCTION_DECL, subprog_name, subprog_type);
@@ -1842,8 +1800,7 @@ static int function_nesting_depth;
appearing in the subprogram. */
void
-begin_subprog_body (subprog_decl)
- tree subprog_decl;
+begin_subprog_body (tree subprog_decl)
{
tree param_decl_list;
tree param_decl;
@@ -1905,7 +1862,7 @@ begin_subprog_body (subprog_decl)
to assembler language output. */
void
-end_subprog_body ()
+end_subprog_body (void)
{
tree decl;
tree cico_list;
@@ -1979,13 +1936,12 @@ end_subprog_body ()
ATTRS is nonzero, use that for the function attribute list. */
tree
-builtin_function (name, type, function_code, class, library_name, attrs)
- const char *name;
- tree type;
- int function_code;
- enum built_in_class class;
- const char *library_name;
- tree attrs;
+builtin_function (const char *name,
+ tree type,
+ int function_code,
+ enum built_in_class class,
+ const char *library_name,
+ tree attrs)
{
tree decl = build_decl (FUNCTION_DECL, get_identifier (name), type);
@@ -2007,9 +1963,7 @@ builtin_function (name, type, function_code, class, library_name, attrs)
it is a signed type. */
tree
-gnat_type_for_size (precision, unsignedp)
- unsigned precision;
- int unsignedp;
+gnat_type_for_size (unsigned precision, int unsignedp)
{
tree t;
char type_name[20];
@@ -2038,9 +1992,7 @@ gnat_type_for_size (precision, unsignedp)
/* Likewise for floating-point types. */
static tree
-float_type_for_size (precision, mode)
- int precision;
- enum machine_mode mode;
+float_type_for_precision (int precision, enum machine_mode mode)
{
tree t;
char type_name[20];
@@ -2068,12 +2020,10 @@ float_type_for_size (precision, mode)
an unsigned type; otherwise a signed type is returned. */
tree
-gnat_type_for_mode (mode, unsignedp)
- enum machine_mode mode;
- int unsignedp;
+gnat_type_for_mode (enum machine_mode mode, int unsignedp)
{
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
- return float_type_for_size (GET_MODE_BITSIZE (mode), mode);
+ return float_type_for_precision (GET_MODE_PRECISION (mode), mode);
else
return gnat_type_for_size (GET_MODE_BITSIZE (mode), unsignedp);
}
@@ -2081,8 +2031,7 @@ gnat_type_for_mode (mode, unsignedp)
/* Return the unsigned version of a TYPE_NODE, a scalar type. */
tree
-gnat_unsigned_type (type_node)
- tree type_node;
+gnat_unsigned_type (tree type_node)
{
tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 1);
@@ -2105,8 +2054,7 @@ gnat_unsigned_type (type_node)
/* Return the signed version of a TYPE_NODE, a scalar type. */
tree
-gnat_signed_type (type_node)
- tree type_node;
+gnat_signed_type (tree type_node)
{
tree type = gnat_type_for_size (TYPE_PRECISION (type_node), 0);
@@ -2130,9 +2078,7 @@ gnat_signed_type (type_node)
UNSIGNEDP. */
tree
-gnat_signed_or_unsigned_type (unsignedp, type)
- int unsignedp;
- tree type;
+gnat_signed_or_unsigned_type (int unsignedp, tree type)
{
if (! INTEGRAL_TYPE_P (type) || TREE_UNSIGNED (type) == unsignedp)
return type;
@@ -2145,9 +2091,7 @@ gnat_signed_or_unsigned_type (unsignedp, type)
minimum (if ! MAX_P) possible value of the discriminant. */
tree
-max_size (exp, max_p)
- tree exp;
- int max_p;
+max_size (tree exp, int max_p)
{
enum tree_code code = TREE_CODE (exp);
tree type = TREE_TYPE (exp);
@@ -2246,10 +2190,7 @@ max_size (exp, max_p)
Return a constructor for the template. */
tree
-build_template (template_type, array_type, expr)
- tree template_type;
- tree array_type;
- tree expr;
+build_template (tree template_type, tree array_type, tree expr)
{
tree template_elts = NULL_TREE;
tree bound_list = NULL_TREE;
@@ -2318,10 +2259,7 @@ build_template (template_type, array_type, expr)
an object of that type and also for the name. */
tree
-build_vms_descriptor (type, mech, gnat_entity)
- tree type;
- Mechanism_Type mech;
- Entity_Id gnat_entity;
+build_vms_descriptor (tree type, Mechanism_Type mech, Entity_Id gnat_entity)
{
tree record_type = make_node (RECORD_TYPE);
tree field_list = 0;
@@ -2368,7 +2306,7 @@ build_vms_descriptor (type, mech, gnat_entity)
case INTEGER_TYPE:
case ENUMERAL_TYPE:
if (TYPE_VAX_FLOATING_POINT_P (type))
- switch ((int) TYPE_DIGITS_VALUE (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
{
case 6:
dtype = 10;
@@ -2408,7 +2346,7 @@ build_vms_descriptor (type, mech, gnat_entity)
case COMPLEX_TYPE:
if (TREE_CODE (TREE_TYPE (type)) == INTEGER_TYPE
&& TYPE_VAX_FLOATING_POINT_P (type))
- switch ((int) TYPE_DIGITS_VALUE (type))
+ switch (tree_low_cst (TYPE_DIGITS_VALUE (type), 1))
{
case 6:
dtype = 12;
@@ -2606,11 +2544,8 @@ build_vms_descriptor (type, mech, gnat_entity)
/* Utility routine for above code to make a field. */
static tree
-make_descriptor_field (name, type, rec_type, initial)
- const char *name;
- tree type;
- tree rec_type;
- tree initial;
+make_descriptor_field (const char *name, tree type,
+ tree rec_type, tree initial)
{
tree field
= create_field_decl (get_identifier (name), type, rec_type, 0, 0, 0, 0);
@@ -2627,10 +2562,7 @@ make_descriptor_field (name, type, rec_type, initial)
as the name of the record. */
tree
-build_unc_object_type (template_type, object_type, name)
- tree template_type;
- tree object_type;
- tree name;
+build_unc_object_type (tree template_type, tree object_type, tree name)
{
tree type = make_node (RECORD_TYPE);
tree template_field = create_field_decl (get_identifier ("BOUNDS"),
@@ -2653,9 +2585,7 @@ build_unc_object_type (template_type, object_type, name)
if NEW is an UNCONSTRAINED_ARRAY_TYPE. */
void
-update_pointer_to (old_type, new_type)
- tree old_type;
- tree new_type;
+update_pointer_to (tree old_type, tree new_type)
{
tree ptr = TYPE_POINTER_TO (old_type);
tree ref = TYPE_REFERENCE_TO (old_type);
@@ -2792,9 +2722,7 @@ update_pointer_to (old_type, new_type)
pointer. This involves making or finding a template. */
static tree
-convert_to_fat_pointer (type, expr)
- tree type;
- tree expr;
+convert_to_fat_pointer (tree type, tree expr)
{
tree template_type = TREE_TYPE (TREE_TYPE (TREE_CHAIN (TYPE_FIELDS (type))));
tree template, template_addr;
@@ -2825,10 +2753,10 @@ convert_to_fat_pointer (type, expr)
else
expr = build1 (INDIRECT_REF, TREE_TYPE (etype), expr);
- template = build_component_ref (expr, NULL_TREE, fields);
+ template = build_component_ref (expr, NULL_TREE, fields, 0);
expr = build_unary_op (ADDR_EXPR, NULL_TREE,
build_component_ref (expr, NULL_TREE,
- TREE_CHAIN (fields)));
+ TREE_CHAIN (fields), 0));
}
else
/* Otherwise, build the constructor for the template. */
@@ -2861,9 +2789,7 @@ convert_to_fat_pointer (type, expr)
is not already a fat pointer. */
static tree
-convert_to_thin_pointer (type, expr)
- tree type;
- tree expr;
+convert_to_thin_pointer (tree type, tree expr)
{
if (! TYPE_FAT_POINTER_P (TREE_TYPE (expr)))
expr
@@ -2872,7 +2798,8 @@ convert_to_thin_pointer (type, expr)
/* We get the pointer to the data and use a NOP_EXPR to make it the
proper GCC type. */
- expr = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (TREE_TYPE (expr)));
+ expr
+ = build_component_ref (expr, NULL_TREE, TYPE_FIELDS (TREE_TYPE (expr)), 0);
expr = build1 (NOP_EXPR, type, expr);
return expr;
@@ -2885,8 +2812,7 @@ convert_to_thin_pointer (type, expr)
not permitted by the language being compiled. */
tree
-convert (type, expr)
- tree type, expr;
+convert (tree type, tree expr)
{
enum tree_code code = TREE_CODE (type);
tree etype = TREE_TYPE (expr);
@@ -2927,7 +2853,7 @@ convert (type, expr)
return TREE_VALUE (CONSTRUCTOR_ELTS (expr));
else
return convert (type, build_component_ref (expr, NULL_TREE,
- TYPE_FIELDS (etype)));
+ TYPE_FIELDS (etype), 0));
}
else if (code == RECORD_TYPE && TYPE_IS_PADDING_P (type))
{
@@ -2977,7 +2903,7 @@ convert (type, expr)
if (ecode == RECORD_TYPE && TYPE_LEFT_JUSTIFIED_MODULAR_P (etype)
&& code != UNCONSTRAINED_ARRAY_TYPE)
return convert (type, build_component_ref (expr, NULL_TREE,
- TYPE_FIELDS (etype)));
+ TYPE_FIELDS (etype), 0));
/* If converting to a type that contains a template, convert to the data
type and then build the template. */
@@ -3051,7 +2977,7 @@ convert (type, expr)
expr = build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (expr, 0),
get_identifier ("P_ARRAY"),
- NULL_TREE));
+ NULL_TREE, 0));
etype = TREE_TYPE (expr);
ecode = TREE_CODE (etype);
break;
@@ -3146,7 +3072,7 @@ convert (type, expr)
array and then convert it. */
else if (TYPE_FAT_POINTER_P (etype))
expr = build_component_ref (expr, get_identifier ("P_ARRAY"),
- NULL_TREE);
+ NULL_TREE, 0);
return fold (convert_to_pointer (type, expr));
@@ -3228,9 +3154,7 @@ convert (type, expr)
the address is not bit-aligned. */
tree
-remove_conversions (exp, true_address)
- tree exp;
- int true_address;
+remove_conversions (tree exp, int true_address)
{
switch (TREE_CODE (exp))
{
@@ -3263,8 +3187,7 @@ remove_conversions (exp, true_address)
likewise return an expression pointing to the underlying array. */
tree
-maybe_unconstrained_array (exp)
- tree exp;
+maybe_unconstrained_array (tree exp)
{
enum tree_code code = TREE_CODE (exp);
tree new;
@@ -3278,7 +3201,7 @@ maybe_unconstrained_array (exp)
= build_unary_op (INDIRECT_REF, NULL_TREE,
build_component_ref (TREE_OPERAND (exp, 0),
get_identifier ("P_ARRAY"),
- NULL_TREE));
+ NULL_TREE, 0));
TREE_READONLY (new) = TREE_STATIC (new) = TREE_READONLY (exp);
return new;
}
@@ -3306,12 +3229,13 @@ maybe_unconstrained_array (exp)
&& TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (new)))
return
build_component_ref (new, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))));
+ TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (new))),
+ 0);
}
else if (TYPE_CONTAINS_TEMPLATE_P (TREE_TYPE (exp)))
return
build_component_ref (exp, NULL_TREE,
- TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))));
+ TREE_CHAIN (TYPE_FIELDS (TREE_TYPE (exp))), 0);
break;
default:
@@ -3325,10 +3249,7 @@ maybe_unconstrained_array (exp)
If NOTRUNC_P is set, truncation operations should be suppressed. */
tree
-unchecked_convert (type, expr, notrunc_p)
- tree type;
- tree expr;
- int notrunc_p;
+unchecked_convert (tree type, tree expr, int notrunc_p)
{
tree etype = TREE_TYPE (expr);
@@ -3399,7 +3320,7 @@ unchecked_convert (type, expr, notrunc_p)
layout_type (rec_type);
expr = unchecked_convert (rec_type, expr, notrunc_p);
- expr = build_component_ref (expr, NULL_TREE, field);
+ expr = build_component_ref (expr, NULL_TREE, field, 0);
}
/* Similarly for integral input type whose precision is not equal to its
diff --git a/gcc/ada/utils2.c b/gcc/ada/utils2.c
index c2ffdfbc153..a8f228d6eb0 100644
--- a/gcc/ada/utils2.c
+++ b/gcc/ada/utils2.c
@@ -44,13 +44,12 @@
#include "ada-tree.h"
#include "gigi.h"
-static tree find_common_type PARAMS ((tree, tree));
-static int contains_save_expr_p PARAMS ((tree));
-static tree contains_null_expr PARAMS ((tree));
-static tree compare_arrays PARAMS ((tree, tree, tree));
-static tree nonbinary_modular_operation PARAMS ((enum tree_code, tree,
- tree, tree));
-static tree build_simple_component_ref PARAMS ((tree, tree, tree));
+static tree find_common_type (tree, tree);
+static int contains_save_expr_p (tree);
+static tree contains_null_expr (tree);
+static tree compare_arrays (tree, tree, tree);
+static tree nonbinary_modular_operation (enum tree_code, tree, tree, tree);
+static tree build_simple_component_ref (tree, tree, tree, int);
/* Prepare expr to be an argument of a TRUTH_NOT_EXPR or other logical
operation.
@@ -68,8 +67,7 @@ static tree build_simple_component_ref PARAMS ((tree, tree, tree));
the only possible operands will be things of Boolean type. */
tree
-gnat_truthvalue_conversion (expr)
- tree expr;
+gnat_truthvalue_conversion (tree expr)
{
tree type = TREE_TYPE (expr);
@@ -106,8 +104,7 @@ gnat_truthvalue_conversion (expr)
/* Return the base type of TYPE. */
tree
-get_base_type (type)
- tree type;
+get_base_type (tree type)
{
if (TREE_CODE (type) == RECORD_TYPE
&& TYPE_LEFT_JUSTIFIED_MODULAR_P (type))
@@ -123,8 +120,7 @@ get_base_type (type)
/* Likewise, but only return types known to the Ada source. */
tree
-get_ada_base_type (type)
- tree type;
+get_ada_base_type (tree type)
{
while (TREE_TYPE (type) != 0
&& (TREE_CODE (type) == INTEGER_TYPE
@@ -140,8 +136,7 @@ get_ada_base_type (type)
in bits. If we don't know anything about the alignment, return 0. */
unsigned int
-known_alignment (exp)
- tree exp;
+known_alignment (tree exp)
{
unsigned int this_alignment;
unsigned int lhs, rhs;
@@ -158,8 +153,8 @@ known_alignment (exp)
We always compute a type_alignment value and return the MAX of it
compared with what we get from the expression tree. Just set the
type_alignment value to 0 when the type information is to be ignored. */
- type_alignment
- = ((POINTER_TYPE_P (TREE_TYPE (exp))
+ type_alignment
+ = ((POINTER_TYPE_P (TREE_TYPE (exp))
&& ! TYPE_IS_DUMMY_P (TREE_TYPE (TREE_TYPE (exp))))
? TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))) : 0);
@@ -170,7 +165,7 @@ known_alignment (exp)
case NON_LVALUE_EXPR:
/* Conversions between pointers and integers don't change the alignment
of the underlying object. */
- this_alignment = known_alignment (TREE_OPERAND (exp, 0));
+ this_alignment = known_alignment (TREE_OPERAND (exp, 0));
break;
case PLUS_EXPR:
@@ -221,8 +216,7 @@ known_alignment (exp)
Otherwise return zero. */
static tree
-find_common_type (t1, t2)
- tree t1, t2;
+find_common_type (tree t1, tree t2)
{
/* If either type is non-BLKmode, use it. Note that we know that we will
not have any alignment problems since if we did the non-BLKmode
@@ -251,8 +245,7 @@ find_common_type (t1, t2)
of some very general solution. */
static int
-contains_save_expr_p (exp)
- tree exp;
+contains_save_expr_p (tree exp)
{
switch (TREE_CODE (exp))
{
@@ -283,8 +276,7 @@ contains_save_expr_p (exp)
that are known to raise Constraint_Error. */
static tree
-contains_null_expr (exp)
- tree exp;
+contains_null_expr (tree exp)
{
tree tem;
@@ -339,9 +331,7 @@ contains_null_expr (exp)
length tests in as efficient a manner as possible. */
static tree
-compare_arrays (result_type, a1, a2)
- tree a1, a2;
- tree result_type;
+compare_arrays (tree result_type, tree a1, tree a2)
{
tree t1 = TREE_TYPE (a1);
tree t2 = TREE_TYPE (a2);
@@ -367,7 +357,7 @@ compare_arrays (result_type, a1, a2)
tree comparison, this_a1_is_null, this_a2_is_null;
/* If the length of the first array is a constant, swap our operands
- unless the length of the second array is the constant zero.
+ unless the length of the second array is the constant zero.
Note that we have set the `length' values to the length - 1. */
if (TREE_CODE (length1) == INTEGER_CST
&& ! integer_zerop (fold (build (PLUS_EXPR, bt, length2,
@@ -416,7 +406,7 @@ compare_arrays (result_type, a1, a2)
nbt = get_base_type (TREE_TYPE (ub1));
comparison
- = build_binary_op (EQ_EXPR, result_type,
+ = build_binary_op (EQ_EXPR, result_type,
build_binary_op (MINUS_EXPR, nbt, ub1, lb1),
build_binary_op (MINUS_EXPR, nbt, ub2, lb2));
@@ -501,10 +491,10 @@ compare_arrays (result_type, a1, a2)
modulus. */
static tree
-nonbinary_modular_operation (op_code, type, lhs, rhs)
- enum tree_code op_code;
- tree type;
- tree lhs, rhs;
+nonbinary_modular_operation (enum tree_code op_code,
+ tree type,
+ tree lhs,
+ tree rhs)
{
tree modulus = TYPE_MODULUS (type);
unsigned int needed_precision = tree_floor_log2 (modulus) + 1;
@@ -601,11 +591,10 @@ nonbinary_modular_operation (op_code, type, lhs, rhs)
have to do here is validate the work done by SEM and handle subtypes. */
tree
-build_binary_op (op_code, result_type, left_operand, right_operand)
- enum tree_code op_code;
- tree result_type;
- tree left_operand;
- tree right_operand;
+build_binary_op (enum tree_code op_code,
+ tree result_type,
+ tree left_operand,
+ tree right_operand)
{
tree left_type = TREE_TYPE (left_operand);
tree right_type = TREE_TYPE (right_operand);
@@ -948,14 +937,15 @@ build_binary_op (op_code, result_type, left_operand, right_operand)
gigi_abort (505);
}
- /* If we are comparing a fat pointer against zero, we need to
+ /* If we are comparing a fat pointer against zero, we need to
just compare the data pointer. */
else if (TYPE_FAT_POINTER_P (left_base_type)
&& TREE_CODE (right_operand) == CONSTRUCTOR
&& integer_zerop (TREE_VALUE (CONSTRUCTOR_ELTS (right_operand))))
{
right_operand = build_component_ref (left_operand, NULL_TREE,
- TYPE_FIELDS (left_base_type));
+ TYPE_FIELDS (left_base_type),
+ 0);
left_operand = convert (TREE_TYPE (right_operand),
integer_zero_node);
}
@@ -1093,10 +1083,7 @@ build_binary_op (op_code, result_type, left_operand, right_operand)
/* Similar, but for unary operations. */
tree
-build_unary_op (op_code, result_type, operand)
- enum tree_code op_code;
- tree result_type;
- tree operand;
+build_unary_op (enum tree_code op_code, tree result_type, tree operand)
{
tree type = TREE_TYPE (operand);
tree base_type = get_base_type (type);
@@ -1414,11 +1401,10 @@ build_unary_op (op_code, result_type, operand)
/* Similar, but for COND_EXPR. */
tree
-build_cond_expr (result_type, condition_operand, true_operand, false_operand)
- tree result_type;
- tree condition_operand;
- tree true_operand;
- tree false_operand;
+build_cond_expr (tree result_type,
+ tree condition_operand,
+ tree true_operand,
+ tree false_operand)
{
tree result;
int addr_p = 0;
@@ -1469,9 +1455,7 @@ build_cond_expr (result_type, condition_operand, true_operand, false_operand)
the CALL_EXPR. */
tree
-build_call_1_expr (fundecl, arg)
- tree fundecl;
- tree arg;
+build_call_1_expr (tree fundecl, tree arg)
{
tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl),
@@ -1487,9 +1471,7 @@ build_call_1_expr (fundecl, arg)
the CALL_EXPR. */
tree
-build_call_2_expr (fundecl, arg1, arg2)
- tree fundecl;
- tree arg1, arg2;
+build_call_2_expr (tree fundecl, tree arg1, tree arg2)
{
tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl),
@@ -1506,8 +1488,7 @@ build_call_2_expr (fundecl, arg1, arg2)
/* Likewise to call FUNDECL with no arguments. */
tree
-build_call_0_expr (fundecl)
- tree fundecl;
+build_call_0_expr (tree fundecl)
{
tree call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (fundecl)),
build_unary_op (ADDR_EXPR, NULL_TREE, fundecl),
@@ -1522,8 +1503,7 @@ build_call_0_expr (fundecl)
name, if requested. MSG says which exception function to call. */
tree
-build_call_raise (msg)
- int msg;
+build_call_raise (int msg)
{
tree fndecl = gnat_raise_decls[msg];
const char *str = discard_file_names ? "" : ref_filename;
@@ -1544,9 +1524,7 @@ build_call_raise (msg)
/* Return a CONSTRUCTOR of TYPE whose list is LIST. */
tree
-gnat_build_constructor (type, list)
- tree type;
- tree list;
+gnat_build_constructor (tree type, tree list)
{
tree elmt;
int allconstant = (TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST);
@@ -1609,16 +1587,16 @@ gnat_build_constructor (type, list)
/* Return a COMPONENT_REF to access a field that is given by COMPONENT,
an IDENTIFIER_NODE giving the name of the field, or FIELD, a FIELD_DECL,
- for the field.
+ for the field. Don't fold the result if NO_FOLD_P is nonzero.
We also handle the fact that we might have been passed a pointer to the
actual record and know how to look for fields in variant parts. */
static tree
-build_simple_component_ref (record_variable, component, field)
- tree record_variable;
- tree component;
- tree field;
+build_simple_component_ref (tree record_variable,
+ tree component,
+ tree field,
+ int no_fold_p)
{
tree record_type = TYPE_MAIN_VARIANT (TREE_TYPE (record_variable));
tree ref;
@@ -1673,9 +1651,10 @@ build_simple_component_ref (record_variable, component, field)
if (DECL_INTERNAL_P (new_field))
{
tree field_ref
- = build_simple_component_ref (record_variable,
- NULL_TREE, new_field);
- ref = build_simple_component_ref (field_ref, NULL_TREE, field);
+ = build_simple_component_ref (record_variable,
+ NULL_TREE, new_field, no_fold_p);
+ ref = build_simple_component_ref (field_ref, NULL_TREE, field,
+ no_fold_p);
if (ref != 0)
return ref;
@@ -1697,19 +1676,20 @@ build_simple_component_ref (record_variable, component, field)
|| TYPE_VOLATILE (record_type))
TREE_THIS_VOLATILE (ref) = 1;
- return fold (ref);
+ return no_fold_p ? ref : fold (ref);
}
/* Like build_simple_component_ref, except that we give an error if the
reference could not be found. */
tree
-build_component_ref (record_variable, component, field)
- tree record_variable;
- tree component;
- tree field;
+build_component_ref (tree record_variable,
+ tree component,
+ tree field,
+ int no_fold_p)
{
- tree ref = build_simple_component_ref (record_variable, component, field);
+ tree ref = build_simple_component_ref (record_variable, component, field,
+ no_fold_p);
if (ref != 0)
return ref;
@@ -1736,14 +1716,12 @@ build_component_ref (record_variable, component, field)
object dynamically on the stack frame. */
tree
-build_call_alloc_dealloc
- (gnu_obj, gnu_size, align, gnat_proc, gnat_pool, gnat_node)
- tree gnu_obj;
- tree gnu_size;
- int align;
- Entity_Id gnat_proc;
- Entity_Id gnat_pool;
- Node_Id gnat_node;
+build_call_alloc_dealloc (tree gnu_obj,
+ tree gnu_size,
+ int align,
+ Entity_Id gnat_proc,
+ Entity_Id gnat_pool,
+ Node_Id gnat_node)
{
tree gnu_align = size_int (align / BITS_PER_UNIT);
@@ -1753,7 +1731,7 @@ build_call_alloc_dealloc
if (Present (gnat_proc))
{
- /* The storage pools are obviously always tagged types, but the
+ /* The storage pools are obviously always tagged types, but the
secondary stack uses the same mechanism and is not tagged */
if (Is_Tagged_Type (Etype (gnat_pool)))
{
@@ -1785,7 +1763,7 @@ build_call_alloc_dealloc
convert (gnu_size_type, gnu_size)));
gnu_args
= chainon (gnu_args,
- build_tree_list (NULL_TREE,
+ build_tree_list (NULL_TREE,
convert (gnu_size_type, gnu_align)));
gnu_call = build (CALL_EXPR, TREE_TYPE (TREE_TYPE (gnu_proc)),
@@ -1798,7 +1776,7 @@ build_call_alloc_dealloc
else
{
/* The size is the second parameter */
- Entity_Id gnat_size_type
+ Entity_Id gnat_size_type
= Etype (Next_Formal (First_Formal (gnat_proc)));
tree gnu_size_type = gnat_to_gnu_type (gnat_size_type);
tree gnu_proc = gnat_to_gnu (gnat_proc);
@@ -1860,13 +1838,12 @@ build_call_alloc_dealloc
the storage pool to use. */
tree
-build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node)
- tree type;
- tree init;
- tree result_type;
- Entity_Id gnat_proc;
- Entity_Id gnat_pool;
- Node_Id gnat_node;
+build_allocator (tree type,
+ tree init,
+ tree result_type,
+ Entity_Id gnat_proc,
+ Entity_Id gnat_pool,
+ Node_Id gnat_node)
{
tree size = TYPE_SIZE_UNIT (type);
tree result;
@@ -1945,7 +1922,7 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node)
build_component_ref
(build_unary_op (INDIRECT_REF, NULL_TREE,
convert (storage_ptr_type, storage)),
- NULL_TREE, TYPE_FIELDS (storage_type)),
+ NULL_TREE, TYPE_FIELDS (storage_type), 0),
build_template (template_type, type, NULL_TREE)),
convert (result_type, convert (storage_ptr_type, storage)));
}
@@ -1990,7 +1967,7 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node)
result = convert (build_pointer_type (new_type), result);
result = build_unary_op (INDIRECT_REF, NULL_TREE, result);
result = build_component_ref (result, NULL_TREE,
- TYPE_FIELDS (new_type));
+ TYPE_FIELDS (new_type), 0);
result = convert (result_type,
build_unary_op (ADDR_EXPR, NULL_TREE, result));
}
@@ -2021,13 +1998,11 @@ build_allocator (type, init, result_type, gnat_proc, gnat_pool, gnat_node)
return convert (result_type, result);
}
-/* Fill in a VMS descriptor for EXPR and return a constructor for it.
+/* Fill in a VMS descriptor for EXPR and return a constructor for it.
GNAT_FORMAL is how we find the descriptor record. */
tree
-fill_vms_descriptor (expr, gnat_formal)
- tree expr;
- Entity_Id gnat_formal;
+fill_vms_descriptor (tree expr, Entity_Id gnat_formal)
{
tree record_type = TREE_TYPE (TREE_TYPE (get_gnu_tree (gnat_formal)));
tree field;
@@ -2054,8 +2029,7 @@ fill_vms_descriptor (expr, gnat_formal)
should not be allocated in a register. Returns true if successful. */
bool
-gnat_mark_addressable (expr_node)
- tree expr_node;
+gnat_mark_addressable (tree expr_node)
{
while (1)
switch (TREE_CODE (expr_node))
diff --git a/gcc/ada/vms_conv.adb b/gcc/ada/vms_conv.adb
index f028b3084a9..479ecde92ee 100644
--- a/gcc/ada/vms_conv.adb
+++ b/gcc/ada/vms_conv.adb
@@ -25,8 +25,7 @@
------------------------------------------------------------------------------
with Hostparm;
-with Osint; use Osint;
-with Sdefault; use Sdefault;
+with Osint; use Osint;
with Ada.Characters.Handling; use Ada.Characters.Handling;
with Ada.Command_Line; use Ada.Command_Line;
@@ -141,7 +140,7 @@ package body VMS_Conv is
begin
Object_Dirs := 0;
- Object_Dir_Name := String_Access (Object_Dir_Default_Name);
+ Object_Dir_Name := new String'(Object_Dir_Default_Prefix);
Get_Next_Dir_In_Path_Init (Object_Dir_Name);
loop
@@ -287,13 +286,13 @@ package body VMS_Conv is
Make =>
(Cname => new S'("MAKE"),
- Usage => new S'("GNAT MAKE file /qualifiers (includes "
+ Usage => new S'("GNAT MAKE file(s) /qualifiers (includes "
& "COMPILE /qualifiers)"),
VMS_Only => False,
Unixcmd => new S'("gnatmake"),
Unixsws => null,
Switches => Make_Switches'Access,
- Params => new Parameter_Array'(1 => File),
+ Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
Name =>
@@ -340,16 +339,6 @@ package body VMS_Conv is
Params => new Parameter_Array'(1 => Unlimited_Files),
Defext => " "),
- Standard =>
- (Cname => new S'("STANDARD"),
- Usage => new S'("GNAT STANDARD"),
- VMS_Only => False,
- Unixcmd => new S'("gnatpsta"),
- Unixsws => null,
- Switches => Standard_Switches'Access,
- Params => new Parameter_Array'(1 .. 0 => File),
- Defext => " "),
-
Stub =>
(Cname => new S'("STUB"),
Usage => new S'("GNAT STUB file [directory]/qualifiers"),
@@ -1092,231 +1081,270 @@ package body VMS_Conv is
Arg_Idx := Argv'First;
<<Tryagain_After_Coalesce>>
- loop
- declare
- Next_Arg_Idx : Integer;
- Arg : String_Access;
-
- begin
- Next_Arg_Idx := Get_Arg_End (Argv.all, Arg_Idx);
- Arg := new String'(Argv (Arg_Idx .. Next_Arg_Idx));
+ loop
+ declare
+ Next_Arg_Idx : Integer;
+ Arg : String_Access;
- -- The first one must be a command name
+ begin
+ Next_Arg_Idx := Get_Arg_End (Argv.all, Arg_Idx);
+ Arg := new String'(Argv (Arg_Idx .. Next_Arg_Idx));
- if Arg_Num = 1 and then Arg_Idx = Argv'First then
+ -- The first one must be a command name
- Command := Matching_Name (Arg.all, Commands);
+ if Arg_Num = 1 and then Arg_Idx = Argv'First then
- if Command = null then
- raise Error_Exit;
- end if;
+ Command := Matching_Name (Arg.all, Commands);
- The_Command := Command.Command;
+ if Command = null then
+ raise Error_Exit;
+ end if;
- -- Give usage information if only command given
+ The_Command := Command.Command;
- if Argument_Count = 1 and then Next_Arg_Idx = Argv'Last
- and then Command.Command /= VMS_Conv.Standard
- then
- Output_Version;
- New_Line;
- Put_Line
- ("List of available qualifiers and options");
- New_Line;
+ -- Give usage information if only command given
- Put (Command.Usage.all);
- Set_Col (53);
- Put_Line (Command.Unix_String.all);
+ if Argument_Count = 1
+ and then Next_Arg_Idx = Argv'Last
+ then
+ Output_Version;
+ New_Line;
+ Put_Line
+ ("List of available qualifiers and options");
+ New_Line;
- declare
- Sw : Item_Ptr := Command.Switches;
+ Put (Command.Usage.all);
+ Set_Col (53);
+ Put_Line (Command.Unix_String.all);
- begin
- while Sw /= null loop
- Put (" ");
- Put (Sw.Name.all);
+ declare
+ Sw : Item_Ptr := Command.Switches;
- case Sw.Translation is
+ begin
+ while Sw /= null loop
+ Put (" ");
+ Put (Sw.Name.all);
- when T_Other =>
- Set_Col (53);
- Put_Line (Sw.Unix_String.all &
- "/<other>");
+ case Sw.Translation is
- when T_Direct =>
- Set_Col (53);
- Put_Line (Sw.Unix_String.all);
+ when T_Other =>
+ Set_Col (53);
+ Put_Line (Sw.Unix_String.all &
+ "/<other>");
- when T_Directories =>
- Put ("=(direc,direc,..direc)");
- Set_Col (53);
- Put (Sw.Unix_String.all);
- Put (" direc ");
- Put (Sw.Unix_String.all);
- Put_Line (" direc ...");
+ when T_Direct =>
+ Set_Col (53);
+ Put_Line (Sw.Unix_String.all);
- when T_Directory =>
- Put ("=directory");
- Set_Col (53);
- Put (Sw.Unix_String.all);
+ when T_Directories =>
+ Put ("=(direc,direc,..direc)");
+ Set_Col (53);
+ Put (Sw.Unix_String.all);
+ Put (" direc ");
+ Put (Sw.Unix_String.all);
+ Put_Line (" direc ...");
- if Sw.Unix_String (Sw.Unix_String'Last)
- /= '='
- then
- Put (' ');
- end if;
+ when T_Directory =>
+ Put ("=directory");
+ Set_Col (53);
+ Put (Sw.Unix_String.all);
- Put_Line ("directory ");
+ if Sw.Unix_String (Sw.Unix_String'Last)
+ /= '='
+ then
+ Put (' ');
+ end if;
- when T_File | T_No_Space_File =>
- Put ("=file");
- Set_Col (53);
- Put (Sw.Unix_String.all);
+ Put_Line ("directory ");
- if Sw.Translation = T_File
- and then Sw.Unix_String
- (Sw.Unix_String'Last)
- /= '='
- then
- Put (' ');
- end if;
+ when T_File | T_No_Space_File =>
+ Put ("=file");
+ Set_Col (53);
+ Put (Sw.Unix_String.all);
+
+ if Sw.Translation = T_File
+ and then Sw.Unix_String
+ (Sw.Unix_String'Last)
+ /= '='
+ then
+ Put (' ');
+ end if;
- Put_Line ("file ");
+ Put_Line ("file ");
- when T_Numeric =>
- Put ("=nnn");
- Set_Col (53);
+ when T_Numeric =>
+ Put ("=nnn");
+ Set_Col (53);
- if Sw.Unix_String (Sw.Unix_String'First)
- = '`'
- then
- Put (Sw.Unix_String
- (Sw.Unix_String'First + 1
- .. Sw.Unix_String'Last));
- else
- Put (Sw.Unix_String.all);
- end if;
+ if Sw.Unix_String (Sw.Unix_String'First)
+ = '`'
+ then
+ Put (Sw.Unix_String
+ (Sw.Unix_String'First + 1
+ .. Sw.Unix_String'Last));
+ else
+ Put (Sw.Unix_String.all);
+ end if;
- Put_Line ("nnn");
+ Put_Line ("nnn");
- when T_Alphanumplus =>
- Put ("=xyz");
- Set_Col (53);
+ when T_Alphanumplus =>
+ Put ("=xyz");
+ Set_Col (53);
- if Sw.Unix_String (Sw.Unix_String'First)
- = '`'
- then
- Put (Sw.Unix_String
- (Sw.Unix_String'First + 1
- .. Sw.Unix_String'Last));
- else
- Put (Sw.Unix_String.all);
- end if;
+ if Sw.Unix_String (Sw.Unix_String'First)
+ = '`'
+ then
+ Put (Sw.Unix_String
+ (Sw.Unix_String'First + 1
+ .. Sw.Unix_String'Last));
+ else
+ Put (Sw.Unix_String.all);
+ end if;
- Put_Line ("xyz");
+ Put_Line ("xyz");
- when T_String =>
- Put ("=");
- Put ('"');
- Put ("<string>");
- Put ('"');
- Set_Col (53);
+ when T_String =>
+ Put ("=");
+ Put ('"');
+ Put ("<string>");
+ Put ('"');
+ Set_Col (53);
- Put (Sw.Unix_String.all);
+ Put (Sw.Unix_String.all);
- if Sw.Unix_String (Sw.Unix_String'Last)
- /= '='
- then
- Put (' ');
- end if;
+ if Sw.Unix_String (Sw.Unix_String'Last)
+ /= '='
+ then
+ Put (' ');
+ end if;
- Put ("<string>");
- New_Line;
+ Put ("<string>");
+ New_Line;
- when T_Commands =>
- Put (" (switches for ");
- Put (Sw.Unix_String
- (Sw.Unix_String'First + 7
- .. Sw.Unix_String'Last));
- Put (')');
- Set_Col (53);
- Put (Sw.Unix_String
- (Sw.Unix_String'First
- .. Sw.Unix_String'First + 5));
- Put_Line (" switches");
+ when T_Commands =>
+ Put (" (switches for ");
+ Put (Sw.Unix_String
+ (Sw.Unix_String'First + 7
+ .. Sw.Unix_String'Last));
+ Put (')');
+ Set_Col (53);
+ Put (Sw.Unix_String
+ (Sw.Unix_String'First
+ .. Sw.Unix_String'First + 5));
+ Put_Line (" switches");
- when T_Options =>
- declare
- Opt : Item_Ptr := Sw.Options;
+ when T_Options =>
+ declare
+ Opt : Item_Ptr := Sw.Options;
- begin
- Put_Line ("=(option,option..)");
+ begin
+ Put_Line ("=(option,option..)");
- while Opt /= null loop
- Put (" ");
- Put (Opt.Name.all);
+ while Opt /= null loop
+ Put (" ");
+ Put (Opt.Name.all);
- if Opt = Sw.Options then
- Put (" (D)");
- end if;
+ if Opt = Sw.Options then
+ Put (" (D)");
+ end if;
- Set_Col (53);
- Put_Line (Opt.Unix_String.all);
- Opt := Opt.Next;
- end loop;
- end;
+ Set_Col (53);
+ Put_Line (Opt.Unix_String.all);
+ Opt := Opt.Next;
+ end loop;
+ end;
- end case;
+ end case;
- Sw := Sw.Next;
- end loop;
- end;
+ Sw := Sw.Next;
+ end loop;
+ end;
- raise Normal_Exit;
- end if;
+ raise Normal_Exit;
+ end if;
-- Special handling for internal debugging switch /?
- elsif Arg.all = "/?" then
- Display_Command := True;
+ elsif Arg.all = "/?" then
+ Display_Command := True;
-- Copy -switch unchanged
- elsif Arg (Arg'First) = '-' then
- Place (' ');
- Place (Arg.all);
+ elsif Arg (Arg'First) = '-' then
+ Place (' ');
+ Place (Arg.all);
-- Copy quoted switch with quotes stripped
- elsif Arg (Arg'First) = '"' then
- if Arg (Arg'Last) /= '"' then
- Put (Standard_Error, "misquoted argument: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
+ elsif Arg (Arg'First) = '"' then
+ if Arg (Arg'Last) /= '"' then
+ Put (Standard_Error, "misquoted argument: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
- else
- Place (' ');
- Place (Arg (Arg'First + 1 .. Arg'Last - 1));
- end if;
+ else
+ Place (' ');
+ Place (Arg (Arg'First + 1 .. Arg'Last - 1));
+ end if;
-- Parameter Argument
- elsif Arg (Arg'First) /= '/'
- and then Make_Commands_Active = null
- then
- Param_Count := Param_Count + 1;
+ elsif Arg (Arg'First) /= '/'
+ and then Make_Commands_Active = null
+ then
+ Param_Count := Param_Count + 1;
- if Param_Count <= Command.Params'Length then
+ if Param_Count <= Command.Params'Length then
- case Command.Params (Param_Count) is
+ case Command.Params (Param_Count) is
- when File | Optional_File =>
- declare
- Normal_File : constant String_Access :=
- To_Canonical_File_Spec
- (Arg.all);
+ when File | Optional_File =>
+ declare
+ Normal_File : constant String_Access :=
+ To_Canonical_File_Spec
+ (Arg.all);
- begin
+ begin
+ Place (' ');
+ Place_Lower (Normal_File.all);
+
+ if Is_Extensionless (Normal_File.all)
+ and then Command.Defext /= " "
+ then
+ Place ('.');
+ Place (Command.Defext);
+ end if;
+ end;
+
+ when Unlimited_Files =>
+ declare
+ Normal_File :
+ constant String_Access :=
+ To_Canonical_File_Spec (Arg.all);
+
+ File_Is_Wild : Boolean := False;
+ File_List : String_Access_List_Access;
+
+ begin
+ for J in Arg'Range loop
+ if Arg (J) = '*'
+ or else Arg (J) = '%'
+ then
+ File_Is_Wild := True;
+ end if;
+ end loop;
+
+ if File_Is_Wild then
+ File_List := To_Canonical_File_List
+ (Arg.all, False);
+
+ for J in File_List.all'Range loop
+ Place (' ');
+ Place_Lower (File_List.all (J).all);
+ end loop;
+
+ else
Place (' ');
Place_Lower (Normal_File.all);
@@ -1326,36 +1354,92 @@ package body VMS_Conv is
Place ('.');
Place (Command.Defext);
end if;
- end;
+ end if;
- when Unlimited_Files =>
- declare
- Normal_File :
- constant String_Access :=
- To_Canonical_File_Spec (Arg.all);
+ Param_Count := Param_Count - 1;
+ end;
+
+ when Other_As_Is =>
+ Place (' ');
+ Place (Arg.all);
+
+ when Unlimited_As_Is =>
+ Place (' ');
+ Place (Arg.all);
+ Param_Count := Param_Count - 1;
+
+ when Files_Or_Wildcard =>
+
+ -- Remove spaces from a comma separated list
+ -- of file names and adjust control variables
+ -- accordingly.
+
+ while Arg_Num < Argument_Count and then
+ (Argv (Argv'Last) = ',' xor
+ Argument (Arg_Num + 1)
+ (Argument (Arg_Num + 1)'First) = ',')
+ loop
+ Argv := new String'
+ (Argv.all & Argument (Arg_Num + 1));
+ Arg_Num := Arg_Num + 1;
+ Arg_Idx := Argv'First;
+ Next_Arg_Idx :=
+ Get_Arg_End (Argv.all, Arg_Idx);
+ Arg := new String'
+ (Argv (Arg_Idx .. Next_Arg_Idx));
+ end loop;
+
+ -- Parse the comma separated list of VMS
+ -- filenames and place them on the command
+ -- line as space separated Unix style
+ -- filenames. Lower case and add default
+ -- extension as appropriate.
- File_Is_Wild : Boolean := False;
- File_List : String_Access_List_Access;
+ declare
+ Arg1_Idx : Integer := Arg'First;
+
+ function Get_Arg1_End
+ (Arg : String; Arg_Idx : Integer)
+ return Integer;
+ -- Begins looking at Arg_Idx + 1 and
+ -- returns the index of the last character
+ -- before a comma or else the index of the
+ -- last character in the string Arg.
+ ------------------
+ -- Get_Arg1_End --
+ ------------------
+
+ function Get_Arg1_End
+ (Arg : String; Arg_Idx : Integer)
+ return Integer
+ is
begin
- for J in Arg'Range loop
- if Arg (J) = '*'
- or else Arg (J) = '%'
- then
- File_Is_Wild := True;
+ for J in Arg_Idx + 1 .. Arg'Last loop
+ if Arg (J) = ',' then
+ return J - 1;
end if;
end loop;
- if File_Is_Wild then
- File_List := To_Canonical_File_List
- (Arg.all, False);
+ return Arg'Last;
+ end Get_Arg1_End;
- for J in File_List.all'Range loop
- Place (' ');
- Place_Lower (File_List.all (J).all);
- end loop;
+ begin
+ loop
+ declare
+ Next_Arg1_Idx :
+ constant Integer :=
+ Get_Arg1_End (Arg.all, Arg1_Idx);
- else
+ Arg1 :
+ constant String :=
+ Arg (Arg1_Idx .. Next_Arg1_Idx);
+
+ Normal_File :
+ constant String_Access :=
+ To_Canonical_File_Spec (Arg1);
+
+ begin
Place (' ');
Place_Lower (Normal_File.all);
@@ -1365,542 +1449,447 @@ package body VMS_Conv is
Place ('.');
Place (Command.Defext);
end if;
- end if;
-
- Param_Count := Param_Count - 1;
- end;
-
- when Other_As_Is =>
- Place (' ');
- Place (Arg.all);
-
- when Unlimited_As_Is =>
- Place (' ');
- Place (Arg.all);
- Param_Count := Param_Count - 1;
-
- when Files_Or_Wildcard =>
-
- -- Remove spaces from a comma separated list
- -- of file names and adjust control variables
- -- accordingly.
-
- while Arg_Num < Argument_Count and then
- (Argv (Argv'Last) = ',' xor
- Argument (Arg_Num + 1)
- (Argument (Arg_Num + 1)'First) = ',')
- loop
- Argv := new String'
- (Argv.all & Argument (Arg_Num + 1));
- Arg_Num := Arg_Num + 1;
- Arg_Idx := Argv'First;
- Next_Arg_Idx :=
- Get_Arg_End (Argv.all, Arg_Idx);
- Arg := new String'
- (Argv (Arg_Idx .. Next_Arg_Idx));
- end loop;
-
- -- Parse the comma separated list of VMS
- -- filenames and place them on the command
- -- line as space separated Unix style
- -- filenames. Lower case and add default
- -- extension as appropriate.
-
- declare
- Arg1_Idx : Integer := Arg'First;
-
- function Get_Arg1_End
- (Arg : String; Arg_Idx : Integer)
- return Integer;
- -- Begins looking at Arg_Idx + 1 and
- -- returns the index of the last character
- -- before a comma or else the index of the
- -- last character in the string Arg.
- ------------------
- -- Get_Arg1_End --
- ------------------
+ Arg1_Idx := Next_Arg1_Idx + 1;
+ end;
- function Get_Arg1_End
- (Arg : String; Arg_Idx : Integer)
- return Integer
- is
- begin
- for J in Arg_Idx + 1 .. Arg'Last loop
- if Arg (J) = ',' then
- return J - 1;
- end if;
- end loop;
+ exit when Arg1_Idx > Arg'Last;
- return Arg'Last;
- end Get_Arg1_End;
+ -- Don't allow two or more commas in
+ -- a row
- begin
- loop
- declare
- Next_Arg1_Idx :
- constant Integer :=
- Get_Arg1_End (Arg.all, Arg1_Idx);
-
- Arg1 :
- constant String :=
- Arg (Arg1_Idx .. Next_Arg1_Idx);
-
- Normal_File :
- constant String_Access :=
- To_Canonical_File_Spec (Arg1);
-
- begin
- Place (' ');
- Place_Lower (Normal_File.all);
-
- if Is_Extensionless (Normal_File.all)
- and then Command.Defext /= " "
- then
- Place ('.');
- Place (Command.Defext);
- end if;
-
- Arg1_Idx := Next_Arg1_Idx + 1;
- end;
-
- exit when Arg1_Idx > Arg'Last;
-
- -- Don't allow two or more commas in
- -- a row
-
- if Arg (Arg1_Idx) = ',' then
- Arg1_Idx := Arg1_Idx + 1;
- if Arg1_Idx > Arg'Last or else
- Arg (Arg1_Idx) = ','
- then
- Put_Line
- (Standard_Error,
- "Malformed Parameter: " &
- Arg.all);
- Put (Standard_Error, "usage: ");
- Put_Line (Standard_Error,
- Command.Usage.all);
- raise Error_Exit;
- end if;
+ if Arg (Arg1_Idx) = ',' then
+ Arg1_Idx := Arg1_Idx + 1;
+ if Arg1_Idx > Arg'Last or else
+ Arg (Arg1_Idx) = ','
+ then
+ Put_Line
+ (Standard_Error,
+ "Malformed Parameter: " &
+ Arg.all);
+ Put (Standard_Error, "usage: ");
+ Put_Line (Standard_Error,
+ Command.Usage.all);
+ raise Error_Exit;
end if;
+ end if;
- end loop;
- end;
- end case;
- end if;
-
- -- Qualifier argument
-
- else
- -- This code is too heavily nested, should be
- -- separated out as separate subprogram ???
-
- declare
- Sw : Item_Ptr;
- SwP : Natural;
- P2 : Natural;
- Endp : Natural := 0; -- avoid warning!
- Opt : Item_Ptr;
-
- begin
- SwP := Arg'First;
- while SwP < Arg'Last
- and then Arg (SwP + 1) /= '='
- loop
- SwP := SwP + 1;
- end loop;
+ end loop;
+ end;
+ end case;
+ end if;
- -- At this point, the switch name is in
- -- Arg (Arg'First..SwP) and if that is not the
- -- whole switch, then there is an equal sign at
- -- Arg (SwP + 1) and the rest of Arg is what comes
- -- after the equal sign.
+ -- Qualifier argument
- -- If make commands are active, see if we have
- -- another COMMANDS_TRANSLATION switch belonging
- -- to gnatmake.
+ else
+ -- This code is too heavily nested, should be
+ -- separated out as separate subprogram ???
+
+ declare
+ Sw : Item_Ptr;
+ SwP : Natural;
+ P2 : Natural;
+ Endp : Natural := 0; -- avoid warning!
+ Opt : Item_Ptr;
+
+ begin
+ SwP := Arg'First;
+ while SwP < Arg'Last
+ and then Arg (SwP + 1) /= '='
+ loop
+ SwP := SwP + 1;
+ end loop;
+
+ -- At this point, the switch name is in
+ -- Arg (Arg'First..SwP) and if that is not the
+ -- whole switch, then there is an equal sign at
+ -- Arg (SwP + 1) and the rest of Arg is what comes
+ -- after the equal sign.
+
+ -- If make commands are active, see if we have
+ -- another COMMANDS_TRANSLATION switch belonging
+ -- to gnatmake.
+
+ if Make_Commands_Active /= null then
+ Sw :=
+ Matching_Name
+ (Arg (Arg'First .. SwP),
+ Command.Switches,
+ Quiet => True);
+
+ if Sw /= null
+ and then Sw.Translation = T_Commands
+ then
+ null;
- if Make_Commands_Active /= null then
+ else
Sw :=
Matching_Name
- (Arg (Arg'First .. SwP),
- Command.Switches,
- Quiet => True);
-
- if Sw /= null
- and then Sw.Translation = T_Commands
- then
- null;
-
- else
- Sw :=
- Matching_Name
- (Arg (Arg'First .. SwP),
- Make_Commands_Active.Switches,
- Quiet => False);
- end if;
+ (Arg (Arg'First .. SwP),
+ Make_Commands_Active.Switches,
+ Quiet => False);
+ end if;
-- For case of GNAT MAKE or CHOP, if we cannot
-- find the switch, then see if it is a
-- recognized compiler switch instead, and if
-- so process the compiler switch.
- elsif Command.Name.all = "MAKE"
- or else Command.Name.all = "CHOP" then
+ elsif Command.Name.all = "MAKE"
+ or else Command.Name.all = "CHOP" then
+ Sw :=
+ Matching_Name
+ (Arg (Arg'First .. SwP),
+ Command.Switches,
+ Quiet => True);
+
+ if Sw = null then
Sw :=
Matching_Name
- (Arg (Arg'First .. SwP),
- Command.Switches,
- Quiet => True);
-
- if Sw = null then
- Sw :=
+ (Arg (Arg'First .. SwP),
Matching_Name
- (Arg (Arg'First .. SwP),
- Matching_Name
- ("COMPILE", Commands).Switches,
- Quiet => False);
- end if;
+ ("COMPILE", Commands).Switches,
+ Quiet => False);
+ end if;
-- For all other cases, just search the relevant
-- command.
- else
- Sw :=
- Matching_Name
- (Arg (Arg'First .. SwP),
- Command.Switches,
- Quiet => False);
- end if;
-
- if Sw /= null then
- case Sw.Translation is
+ else
+ Sw :=
+ Matching_Name
+ (Arg (Arg'First .. SwP),
+ Command.Switches,
+ Quiet => False);
+ end if;
- when T_Direct =>
- Place_Unix_Switches (Sw.Unix_String);
- if SwP < Arg'Last
- and then Arg (SwP + 1) = '='
+ if Sw /= null then
+ case Sw.Translation is
+
+ when T_Direct =>
+ Place_Unix_Switches (Sw.Unix_String);
+ if SwP < Arg'Last
+ and then Arg (SwP + 1) = '='
+ then
+ Put (Standard_Error,
+ "qualifier options ignored: ");
+ Put_Line (Standard_Error, Arg.all);
+ end if;
+
+ when T_Directories =>
+ if SwP + 1 > Arg'Last then
+ Put (Standard_Error,
+ "missing directories for: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
+
+ elsif Arg (SwP + 2) /= '(' then
+ SwP := SwP + 2;
+ Endp := Arg'Last;
+
+ elsif Arg (Arg'Last) /= ')' then
+
+ -- Remove spaces from a comma separated
+ -- list of file names and adjust
+ -- control variables accordingly.
+
+ if Arg_Num < Argument_Count and then
+ (Argv (Argv'Last) = ',' xor
+ Argument (Arg_Num + 1)
+ (Argument (Arg_Num + 1)'First) = ',')
then
- Put (Standard_Error,
- "qualifier options ignored: ");
- Put_Line (Standard_Error, Arg.all);
- end if;
-
- when T_Directories =>
- if SwP + 1 > Arg'Last then
- Put (Standard_Error,
- "missing directories for: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
-
- elsif Arg (SwP + 2) /= '(' then
- SwP := SwP + 2;
- Endp := Arg'Last;
-
- elsif Arg (Arg'Last) /= ')' then
-
- -- Remove spaces from a comma separated
- -- list of file names and adjust
- -- control variables accordingly.
-
- if Arg_Num < Argument_Count and then
- (Argv (Argv'Last) = ',' xor
- Argument (Arg_Num + 1)
- (Argument (Arg_Num + 1)'First) = ',')
- then
- Argv :=
- new String'(Argv.all
- & Argument
- (Arg_Num + 1));
- Arg_Num := Arg_Num + 1;
- Arg_Idx := Argv'First;
- Next_Arg_Idx
- := Get_Arg_End (Argv.all, Arg_Idx);
- Arg := new String'
- (Argv (Arg_Idx .. Next_Arg_Idx));
- goto Tryagain_After_Coalesce;
- end if;
-
- Put (Standard_Error,
- "incorrectly parenthesized " &
- "or malformed argument: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
-
- else
- SwP := SwP + 3;
- Endp := Arg'Last - 1;
+ Argv :=
+ new String'(Argv.all
+ & Argument
+ (Arg_Num + 1));
+ Arg_Num := Arg_Num + 1;
+ Arg_Idx := Argv'First;
+ Next_Arg_Idx
+ := Get_Arg_End (Argv.all, Arg_Idx);
+ Arg := new String'
+ (Argv (Arg_Idx .. Next_Arg_Idx));
+ goto Tryagain_After_Coalesce;
end if;
- while SwP <= Endp loop
- declare
- Dir_Is_Wild : Boolean := False;
- Dir_Maybe_Is_Wild : Boolean := False;
- Dir_List : String_Access_List_Access;
- begin
- P2 := SwP;
-
- while P2 < Endp
- and then Arg (P2 + 1) /= ','
- loop
+ Put (Standard_Error,
+ "incorrectly parenthesized " &
+ "or malformed argument: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
+
+ else
+ SwP := SwP + 3;
+ Endp := Arg'Last - 1;
+ end if;
+
+ while SwP <= Endp loop
+ declare
+ Dir_Is_Wild : Boolean := False;
+ Dir_Maybe_Is_Wild : Boolean := False;
+ Dir_List : String_Access_List_Access;
+ begin
+ P2 := SwP;
- -- A wildcard directory spec on
- -- VMS will contain either * or
- -- % or ...
+ while P2 < Endp
+ and then Arg (P2 + 1) /= ','
+ loop
- if Arg (P2) = '*' then
- Dir_Is_Wild := True;
+ -- A wildcard directory spec on
+ -- VMS will contain either * or
+ -- % or ...
- elsif Arg (P2) = '%' then
- Dir_Is_Wild := True;
+ if Arg (P2) = '*' then
+ Dir_Is_Wild := True;
- elsif Dir_Maybe_Is_Wild
- and then Arg (P2) = '.'
- and then Arg (P2 + 1) = '.'
- then
- Dir_Is_Wild := True;
- Dir_Maybe_Is_Wild := False;
+ elsif Arg (P2) = '%' then
+ Dir_Is_Wild := True;
- elsif Dir_Maybe_Is_Wild then
- Dir_Maybe_Is_Wild := False;
+ elsif Dir_Maybe_Is_Wild
+ and then Arg (P2) = '.'
+ and then Arg (P2 + 1) = '.'
+ then
+ Dir_Is_Wild := True;
+ Dir_Maybe_Is_Wild := False;
- elsif Arg (P2) = '.'
- and then Arg (P2 + 1) = '.'
- then
- Dir_Maybe_Is_Wild := True;
+ elsif Dir_Maybe_Is_Wild then
+ Dir_Maybe_Is_Wild := False;
- end if;
+ elsif Arg (P2) = '.'
+ and then Arg (P2 + 1) = '.'
+ then
+ Dir_Maybe_Is_Wild := True;
- P2 := P2 + 1;
- end loop;
+ end if;
- if Dir_Is_Wild then
- Dir_List := To_Canonical_File_List
- (Arg (SwP .. P2), True);
+ P2 := P2 + 1;
+ end loop;
- for J in Dir_List.all'Range loop
- Place_Unix_Switches
- (Sw.Unix_String);
- Place_Lower
- (Dir_List.all (J).all);
- end loop;
+ if Dir_Is_Wild then
+ Dir_List := To_Canonical_File_List
+ (Arg (SwP .. P2), True);
- else
+ for J in Dir_List.all'Range loop
Place_Unix_Switches
(Sw.Unix_String);
Place_Lower
- (To_Canonical_Dir_Spec
- (Arg (SwP .. P2), False).all);
- end if;
+ (Dir_List.all (J).all);
+ end loop;
- SwP := P2 + 2;
- end;
- end loop;
+ else
+ Place_Unix_Switches
+ (Sw.Unix_String);
+ Place_Lower
+ (To_Canonical_Dir_Spec
+ (Arg (SwP .. P2), False).all);
+ end if;
- when T_Directory =>
- if SwP + 1 > Arg'Last then
- Put (Standard_Error,
- "missing directory for: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
+ SwP := P2 + 2;
+ end;
+ end loop;
- else
- Place_Unix_Switches (Sw.Unix_String);
+ when T_Directory =>
+ if SwP + 1 > Arg'Last then
+ Put (Standard_Error,
+ "missing directory for: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
- -- Some switches end in "=". No space
- -- here
+ else
+ Place_Unix_Switches (Sw.Unix_String);
- if Sw.Unix_String
- (Sw.Unix_String'Last) /= '='
- then
- Place (' ');
- end if;
+ -- Some switches end in "=". No space
+ -- here
- Place_Lower
- (To_Canonical_Dir_Spec
- (Arg (SwP + 2 .. Arg'Last),
- False).all);
+ if Sw.Unix_String
+ (Sw.Unix_String'Last) /= '='
+ then
+ Place (' ');
end if;
- when T_File | T_No_Space_File =>
- if SwP + 1 > Arg'Last then
- Put (Standard_Error,
- "missing file for: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
+ Place_Lower
+ (To_Canonical_Dir_Spec
+ (Arg (SwP + 2 .. Arg'Last),
+ False).all);
+ end if;
- else
- Place_Unix_Switches (Sw.Unix_String);
-
- -- Some switches end in "=". No space
- -- here.
-
- if Sw.Translation = T_File
- and then Sw.Unix_String
- (Sw.Unix_String'Last) /= '='
- then
- Place (' ');
- end if;
+ when T_File | T_No_Space_File =>
+ if SwP + 1 > Arg'Last then
+ Put (Standard_Error,
+ "missing file for: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
- Place_Lower
- (To_Canonical_File_Spec
- (Arg (SwP + 2 .. Arg'Last)).all);
- end if;
-
- when T_Numeric =>
- if
- OK_Integer (Arg (SwP + 2 .. Arg'Last))
- then
- Place_Unix_Switches (Sw.Unix_String);
- Place (Arg (SwP + 2 .. Arg'Last));
+ else
+ Place_Unix_Switches (Sw.Unix_String);
- else
- Put (Standard_Error, "argument for ");
- Put (Standard_Error, Sw.Name.all);
- Put_Line
- (Standard_Error, " must be numeric");
- Errors := Errors + 1;
- end if;
+ -- Some switches end in "=". No space
+ -- here.
- when T_Alphanumplus =>
- if
- OK_Alphanumerplus
- (Arg (SwP + 2 .. Arg'Last))
+ if Sw.Translation = T_File
+ and then Sw.Unix_String
+ (Sw.Unix_String'Last) /= '='
then
- Place_Unix_Switches (Sw.Unix_String);
- Place (Arg (SwP + 2 .. Arg'Last));
-
- else
- Put (Standard_Error, "argument for ");
- Put (Standard_Error, Sw.Name.all);
- Put_Line (Standard_Error,
- " must be alphanumeric");
- Errors := Errors + 1;
+ Place (' ');
end if;
- when T_String =>
-
- -- A String value must be extended to the
- -- end of the Argv, otherwise strings like
- -- "foo/bar" get split at the slash.
- --
- -- The begining and ending of the string
- -- are flagged with embedded nulls which
- -- are removed when building the Spawn
- -- call. Nulls are use because they won't
- -- show up in a /? output. Quotes aren't
- -- used because that would make it
- -- difficult to embed them.
+ Place_Lower
+ (To_Canonical_File_Spec
+ (Arg (SwP + 2 .. Arg'Last)).all);
+ end if;
+ when T_Numeric =>
+ if
+ OK_Integer (Arg (SwP + 2 .. Arg'Last))
+ then
Place_Unix_Switches (Sw.Unix_String);
- if Next_Arg_Idx /= Argv'Last then
- Next_Arg_Idx := Argv'Last;
- Arg := new String'
- (Argv (Arg_Idx .. Next_Arg_Idx));
-
- SwP := Arg'First;
- while SwP < Arg'Last and then
- Arg (SwP + 1) /= '=' loop
- SwP := SwP + 1;
- end loop;
- end if;
- Place (ASCII.NUL);
Place (Arg (SwP + 2 .. Arg'Last));
- Place (ASCII.NUL);
- when T_Commands =>
-
- -- Output -largs/-bargs/-cargs
-
- Place (' ');
- Place (Sw.Unix_String
- (Sw.Unix_String'First ..
- Sw.Unix_String'First + 5));
-
- if Sw.Unix_String
- (Sw.Unix_String'First + 7 ..
- Sw.Unix_String'Last) =
- "MAKE"
- then
- Make_Commands_Active := null;
+ else
+ Put (Standard_Error, "argument for ");
+ Put (Standard_Error, Sw.Name.all);
+ Put_Line
+ (Standard_Error, " must be numeric");
+ Errors := Errors + 1;
+ end if;
+
+ when T_Alphanumplus =>
+ if
+ OK_Alphanumerplus
+ (Arg (SwP + 2 .. Arg'Last))
+ then
+ Place_Unix_Switches (Sw.Unix_String);
+ Place (Arg (SwP + 2 .. Arg'Last));
- else
- -- Set source of new commands, also
- -- setting this non-null indicates that
- -- we are in the special commands mode
- -- for processing the -xargs case.
-
- Make_Commands_Active :=
- Matching_Name
- (Sw.Unix_String
- (Sw.Unix_String'First + 7 ..
- Sw.Unix_String'Last),
- Commands);
- end if;
+ else
+ Put (Standard_Error, "argument for ");
+ Put (Standard_Error, Sw.Name.all);
+ Put_Line (Standard_Error,
+ " must be alphanumeric");
+ Errors := Errors + 1;
+ end if;
+
+ when T_String =>
+
+ -- A String value must be extended to the
+ -- end of the Argv, otherwise strings like
+ -- "foo/bar" get split at the slash.
+ --
+ -- The begining and ending of the string
+ -- are flagged with embedded nulls which
+ -- are removed when building the Spawn
+ -- call. Nulls are use because they won't
+ -- show up in a /? output. Quotes aren't
+ -- used because that would make it
+ -- difficult to embed them.
+
+ Place_Unix_Switches (Sw.Unix_String);
+ if Next_Arg_Idx /= Argv'Last then
+ Next_Arg_Idx := Argv'Last;
+ Arg := new String'
+ (Argv (Arg_Idx .. Next_Arg_Idx));
- when T_Options =>
- if SwP + 1 > Arg'Last then
- Place_Unix_Switches
- (Sw.Options.Unix_String);
- SwP := Endp + 1;
-
- elsif Arg (SwP + 2) /= '(' then
- SwP := SwP + 2;
- Endp := Arg'Last;
-
- elsif Arg (Arg'Last) /= ')' then
- Put
- (Standard_Error,
- "incorrectly parenthesized " &
- "argument: ");
- Put_Line (Standard_Error, Arg.all);
- Errors := Errors + 1;
- SwP := Endp + 1;
+ SwP := Arg'First;
+ while SwP < Arg'Last and then
+ Arg (SwP + 1) /= '=' loop
+ SwP := SwP + 1;
+ end loop;
+ end if;
+ Place (ASCII.NUL);
+ Place (Arg (SwP + 2 .. Arg'Last));
+ Place (ASCII.NUL);
- else
- SwP := SwP + 3;
- Endp := Arg'Last - 1;
- end if;
+ when T_Commands =>
- while SwP <= Endp loop
- P2 := SwP;
+ -- Output -largs/-bargs/-cargs
- while P2 < Endp
- and then Arg (P2 + 1) /= ','
- loop
- P2 := P2 + 1;
- end loop;
+ Place (' ');
+ Place (Sw.Unix_String
+ (Sw.Unix_String'First ..
+ Sw.Unix_String'First + 5));
+
+ if Sw.Unix_String
+ (Sw.Unix_String'First + 7 ..
+ Sw.Unix_String'Last) =
+ "MAKE"
+ then
+ Make_Commands_Active := null;
+
+ else
+ -- Set source of new commands, also
+ -- setting this non-null indicates that
+ -- we are in the special commands mode
+ -- for processing the -xargs case.
+
+ Make_Commands_Active :=
+ Matching_Name
+ (Sw.Unix_String
+ (Sw.Unix_String'First + 7 ..
+ Sw.Unix_String'Last),
+ Commands);
+ end if;
+
+ when T_Options =>
+ if SwP + 1 > Arg'Last then
+ Place_Unix_Switches
+ (Sw.Options.Unix_String);
+ SwP := Endp + 1;
+
+ elsif Arg (SwP + 2) /= '(' then
+ SwP := SwP + 2;
+ Endp := Arg'Last;
+
+ elsif Arg (Arg'Last) /= ')' then
+ Put
+ (Standard_Error,
+ "incorrectly parenthesized " &
+ "argument: ");
+ Put_Line (Standard_Error, Arg.all);
+ Errors := Errors + 1;
+ SwP := Endp + 1;
+
+ else
+ SwP := SwP + 3;
+ Endp := Arg'Last - 1;
+ end if;
+
+ while SwP <= Endp loop
+ P2 := SwP;
+
+ while P2 < Endp
+ and then Arg (P2 + 1) /= ','
+ loop
+ P2 := P2 + 1;
+ end loop;
- -- Option name is in Arg (SwP .. P2)
+ -- Option name is in Arg (SwP .. P2)
- Opt := Matching_Name (Arg (SwP .. P2),
- Sw.Options);
+ Opt := Matching_Name (Arg (SwP .. P2),
+ Sw.Options);
- if Opt /= null then
- Place_Unix_Switches
- (Opt.Unix_String);
- end if;
+ if Opt /= null then
+ Place_Unix_Switches
+ (Opt.Unix_String);
+ end if;
- SwP := P2 + 2;
- end loop;
+ SwP := P2 + 2;
+ end loop;
- when T_Other =>
- Place_Unix_Switches
- (new String'(Sw.Unix_String.all &
- Arg.all));
+ when T_Other =>
+ Place_Unix_Switches
+ (new String'(Sw.Unix_String.all &
+ Arg.all));
- end case;
- end if;
- end;
- end if;
+ end case;
+ end if;
+ end;
+ end if;
- Arg_Idx := Next_Arg_Idx + 1;
- end;
+ Arg_Idx := Next_Arg_Idx + 1;
+ end;
- exit when Arg_Idx > Argv'Last;
+ exit when Arg_Idx > Argv'Last;
- end loop;
+ end loop;
end Process_Argument;
Arg_Num := Arg_Num + 1;
diff --git a/gcc/ada/vms_conv.ads b/gcc/ada/vms_conv.ads
index 3e3216608b4..e945f7fbf98 100644
--- a/gcc/ada/vms_conv.ads
+++ b/gcc/ada/vms_conv.ads
@@ -25,7 +25,7 @@
------------------------------------------------------------------------------
-- This package is part of the GNAT driver. It contains a procedure
--- VMS_Conversion to convert the command line in VMS form to the wquivalent
+-- VMS_Conversion to convert the command line in VMS form to the equivalent
-- command line with switches for the GNAT tools that the GNAT driver will
-- invoke.
--
@@ -97,9 +97,9 @@ package VMS_Conv is
type Command_Type is
(Bind, Chop, Clean, Compile, Elim, Find, Krunch, Library, Link, List,
- Make, Name, Preprocess, Pretty, Shared, Standard, Stub, Xref, Undefined);
+ Make, Name, Preprocess, Pretty, Shared, Stub, Xref, Undefined);
- type Alternate_Command is (Comp, Ls, Kr, Pp, Prep, Psta);
+ type Alternate_Command is (Comp, Ls, Kr, Pp, Prep);
-- Alternate command libel for non VMS system
Corresponding_To : constant array (Alternate_Command) of Command_Type :=
@@ -107,8 +107,7 @@ package VMS_Conv is
Ls => List,
Kr => Krunch,
Prep => Preprocess,
- Pp => Pretty,
- Psta => Standard);
+ Pp => Pretty);
-- Mapping of alternate commands to commands
subtype Real_Command_Type is Command_Type range Bind .. Xref;
diff --git a/gcc/ada/vms_data.ads b/gcc/ada/vms_data.ads
index 72f5942cfae..74da7099f54 100644
--- a/gcc/ada/vms_data.ads
+++ b/gcc/ada/vms_data.ads
@@ -1526,6 +1526,12 @@ package VMS_Data is
--
-- Do not look in the default directory for source files of the runtime.
+ S_GCC_Nostlib : aliased constant S := "/NOSTD_LIBRARIES " &
+ "-nostdlib";
+ -- /NOSTD_LIBRARIES
+ --
+ -- Do not look for library files in the system default directory.
+
S_GCC_Opt : aliased constant S := "/OPTIMIZE=" &
"ALL " &
"-O2,!-O0,!-O1,!-O3 " &
@@ -1585,6 +1591,17 @@ package VMS_Data is
-- communicated to the compiler through logical names
-- ADA_PRJ_INCLUDE_FILE and ADA_PRJ_OBJECTS_FILE.
+ S_GCC_Psta : aliased constant S := "/PRINT_STANDARD " &
+ "-gnatS";
+ -- /PRINT_STANDARD
+ --
+ -- cause the compiler to output a representation of package Standard
+ -- in a form very close to standard Ada. It is not quite possible to
+ -- do this and remain entirely Standard (since new numeric base types
+ -- cannot be created in standard Ada), but the output is easily
+ -- readable to any Ada programmer, and is useful to determine the
+ -- characteristics of target dependent types in package Standard.
+
S_GCC_Report : aliased constant S := "/REPORT_ERRORS=" &
"VERBOSE " &
"-gnatv " &
@@ -2272,10 +2289,6 @@ package VMS_Data is
"-gnatwA " &
"ALL_GCC " &
"-Wall " &
- "BIASED_ROUNDING " &
- "-gnatwb " &
- "NOBIASED_ROUNDING " &
- "-gnatwB " &
"CONDITIONALS " &
"-gnatwc " &
"NOCONDITIONALS " &
@@ -2393,30 +2406,6 @@ package VMS_Data is
-- backend. Most of these are not relevant
-- to Ada.
--
- -- BIASED_ROUNDING Activate warnings on biased rounding.
- -- If a static floating-point expression has
- -- a value that is exactly half way between
- -- two adjacent machine numbers, then the
- -- rules of Ada (Ada Reference Manual,
- -- para 4.9(38)) require that this rounding
- -- be done away from zero, even if the normal
- -- unbiased rounding rules at run time would
- -- require rounding towards zero.
- --
- -- This warning message alerts you to such
- -- instances where compile-time rounding and
- -- run-time rounding are not equivalent.
- -- If it is important to get proper run-time
- -- rounding, then you can force this by
- -- making one of the operands into a
- -- variable. The default is that such
- -- warnings are not generated. Note that
- -- /WARNINGS=ALL does not affect the setting
- -- of this warning option.
- --
- -- NOBIASED_ROUNDING Suppress warnings on biased rounding.
- -- Disable warnings on biased rounding.
- --
-- CONDITIONALS Activate warnings for conditional
-- Expressions used in tests that are known
-- to be True or False at compile time. The
@@ -2809,10 +2798,12 @@ package VMS_Data is
S_GCC_Noadc 'Access,
S_GCC_Noload 'Access,
S_GCC_Nostinc 'Access,
+ S_GCC_Nostlib 'Access,
S_GCC_Opt 'Access,
S_GCC_OptX 'Access,
S_GCC_Polling 'Access,
S_GCC_Project 'Access,
+ S_GCC_Psta 'Access,
S_GCC_Report 'Access,
S_GCC_ReportX 'Access,
S_GCC_Repinfo 'Access,
@@ -4636,12 +4627,6 @@ package VMS_Data is
S_Shared_Verb 'Access,
S_Shared_ZZZZZ 'Access);
- --------------------------------
- -- Switches for GNAT STANDARD --
- --------------------------------
-
- Standard_Switches : aliased constant Switches := (1 .. 0 => null);
-
----------------------------
-- Switches for GNAT STUB --
----------------------------
diff --git a/gcc/ada/xref_lib.adb b/gcc/ada/xref_lib.adb
index 713a91baf83..cca42856270 100644
--- a/gcc/ada/xref_lib.adb
+++ b/gcc/ada/xref_lib.adb
@@ -6,7 +6,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 1998-2002 Free Software Foundation, Inc. --
+-- Copyright (C) 1998-2003 Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -359,10 +359,7 @@ package body Xref_Lib is
-- Default_Project_File --
--------------------------
- function Default_Project_File
- (Dir_Name : String)
- return String
- is
+ function Default_Project_File (Dir_Name : String) return String is
My_Dir : Dir_Type;
Dir_Ent : File_Name_String;
Last : Natural;
@@ -396,8 +393,7 @@ package body Xref_Lib is
function File_Name
(File : ALI_File;
- Num : Positive)
- return File_Reference
+ Num : Positive) return File_Reference
is
begin
return File.Dep.Table (Num);
@@ -876,6 +872,9 @@ package body Xref_Lib is
-- unit number is optional. It is specified only if the parent type
-- is not defined in the current unit.
+ -- We also have the format for generic instantiations, as in
+ -- 7a5*Uid(3|5I8[4|2]) 2|4r74
+
-- We could also have something like
-- 16I9*I<integer>
-- that indicates that I derives from the predefined type integer.
@@ -918,6 +917,25 @@ package body Xref_Lib is
Ptr := Ptr + 1;
Parse_Number (Ali, Ptr, P_Column);
+ -- Skip the information for generics instantiations
+
+ if Ali (Ptr) = '[' then
+ declare
+ Num_Brackets : Natural := 1;
+ begin
+ while Num_Brackets /= 0 loop
+ Ptr := Ptr + 1;
+ if Ali (Ptr) = '[' then
+ Num_Brackets := Num_Brackets + 1;
+ elsif Ali (Ptr) = ']' then
+ Num_Brackets := Num_Brackets - 1;
+ end if;
+ end loop;
+
+ Ptr := Ptr + 1;
+ end;
+ end if;
+
-- Skip '>', or ')' or '>'
Ptr := Ptr + 1;
@@ -928,8 +946,7 @@ package body Xref_Lib is
if Der_Info or else Type_Tree then
declare
Symbol : constant String :=
- Get_Symbol_Name (P_Eun, P_Line, P_Column);
-
+ Get_Symbol_Name (P_Eun, P_Line, P_Column);
begin
if Symbol /= "???" then
Add_Parent
diff --git a/gcc/alias.c b/gcc/alias.c
index 797c3f5cd97..e4485375975 100644
--- a/gcc/alias.c
+++ b/gcc/alias.c
@@ -692,7 +692,7 @@ record_component_aliases (tree type)
case RECORD_TYPE:
case UNION_TYPE:
case QUAL_UNION_TYPE:
- /* Recursively record aliases for the base classes, if there are any */
+ /* Recursively record aliases for the base classes, if there are any. */
if (TYPE_BINFO (type) != NULL && TYPE_BINFO_BASETYPES (type) != NULL)
{
int i;
diff --git a/gcc/alloc-pool.c b/gcc/alloc-pool.c
index d275cd86cff..c21cfe4c707 100644
--- a/gcc/alloc-pool.c
+++ b/gcc/alloc-pool.c
@@ -112,7 +112,7 @@ create_alloc_pool (const char *name, size_t size, size_t num)
pool->elt_size = size;
pool->elts_per_block = num;
- /* List header size should be a multiple of 8 */
+ /* List header size should be a multiple of 8. */
header_size = align_eight (sizeof (struct alloc_pool_list_def));
pool->block_size = (size * num) + header_size;
diff --git a/gcc/basic-block.h b/gcc/basic-block.h
index 221b2466985..2e8f5786348 100644
--- a/gcc/basic-block.h
+++ b/gcc/basic-block.h
@@ -193,7 +193,7 @@ struct loops;
/* Basic block information indexed by block number. */
typedef struct basic_block_def {
/* The first and last insns of the block. */
- rtx head, end;
+ rtx head_, end_;
/* The first and last trees of the block. */
tree head_tree;
@@ -234,6 +234,9 @@ typedef struct basic_block_def {
/* Outermost loop containing the block. */
struct loop *loop_father;
+ /* The dominance and postdominance information node. */
+ struct et_node *dom[2];
+
/* Expected number of executions: calculated in profile.c. */
gcov_type count;
@@ -316,11 +319,8 @@ extern struct obstack flow_obstack;
/* Stuff for recording basic block info. */
-#define BLOCK_HEAD(B) (BASIC_BLOCK (B)->head)
-#define BLOCK_END(B) (BASIC_BLOCK (B)->end)
-
-#define BLOCK_HEAD_TREE(B) (BASIC_BLOCK (B)->head_tree)
-#define BLOCK_END_TREE(B) (BASIC_BLOCK (B)->end_tree)
+#define BB_HEAD(B) (B)->head_
+#define BB_END(B) (B)->end_
/* Special block numbers [markers] for entry and exit. */
#define ENTRY_BLOCK (-1)
@@ -376,10 +376,6 @@ extern void clear_edges (void);
extern void mark_critical_edges (void);
extern rtx first_insn_after_basic_block_note (basic_block);
-/* Dominator information for basic blocks. */
-
-typedef struct dominance_info *dominance_info;
-
/* Structure to group all of the information to process IF-THEN and
IF-THEN-ELSE blocks for the conditional execution support. This
needs to be in a public file in case the IFCVT macros call
@@ -477,6 +473,8 @@ enum update_life_extent
#define PROP_AUTOINC 64 /* Create autoinc mem references. */
#define PROP_EQUAL_NOTES 128 /* Take into account REG_EQUAL notes. */
#define PROP_SCAN_DEAD_STORES 256 /* Scan for dead code. */
+#define PROP_ASM_SCAN 512 /* Internal flag used within flow.c
+ to flag analysis of asms. */
#define PROP_FINAL (PROP_DEATH_NOTES | PROP_LOG_LINKS \
| PROP_REG_INFO | PROP_KILL_DEAD_CODE \
| PROP_SCAN_DEAD_CODE | PROP_AUTOINC \
@@ -613,22 +611,35 @@ enum cdi_direction
CDI_POST_DOMINATORS
};
-extern dominance_info calculate_dominance_info (enum cdi_direction);
-extern void free_dominance_info (dominance_info);
-extern basic_block nearest_common_dominator (dominance_info,
+enum dom_state
+{
+ DOM_NONE, /* Not computed at all. */
+ DOM_CONS_OK, /* The data is conservatively OK, i.e. if it says you that A dominates B,
+ it indeed does. */
+ DOM_NO_FAST_QUERY, /* The data is OK, but the fast query data are not usable. */
+ DOM_OK /* Everything is ok. */
+};
+
+extern enum dom_state dom_computed[2];
+
+extern void calculate_dominance_info (enum cdi_direction);
+extern void free_dominance_info (enum cdi_direction);
+extern basic_block nearest_common_dominator (enum cdi_direction,
basic_block, basic_block);
-extern void set_immediate_dominator (dominance_info, basic_block,
+extern void set_immediate_dominator (enum cdi_direction, basic_block,
basic_block);
-extern basic_block get_immediate_dominator (dominance_info, basic_block);
-extern bool dominated_by_p (dominance_info, basic_block, basic_block);
-extern int get_dominated_by (dominance_info, basic_block, basic_block **);
-extern void add_to_dominance_info (dominance_info, basic_block);
-extern void delete_from_dominance_info (dominance_info, basic_block);
-basic_block recount_dominator (dominance_info, basic_block);
-extern void redirect_immediate_dominators (dominance_info, basic_block,
+extern basic_block get_immediate_dominator (enum cdi_direction, basic_block);
+extern bool dominated_by_p (enum cdi_direction, basic_block, basic_block);
+extern int get_dominated_by (enum cdi_direction, basic_block, basic_block **);
+extern void add_to_dominance_info (enum cdi_direction, basic_block);
+extern void delete_from_dominance_info (enum cdi_direction, basic_block);
+basic_block recount_dominator (enum cdi_direction, basic_block);
+extern void redirect_immediate_dominators (enum cdi_direction, basic_block,
basic_block);
-void iterate_fix_dominators (dominance_info, basic_block *, int);
-extern void verify_dominators (dominance_info);
+extern void iterate_fix_dominators (enum cdi_direction, basic_block *, int);
+extern void verify_dominators (enum cdi_direction);
+extern basic_block first_dom_son (enum cdi_direction, basic_block);
+extern basic_block next_dom_son (enum cdi_direction, basic_block);
#include "cfghooks.h"
diff --git a/gcc/bb-reorder.c b/gcc/bb-reorder.c
index e75958e8b74..fc50b6494d3 100644
--- a/gcc/bb-reorder.c
+++ b/gcc/bb-reorder.c
@@ -72,6 +72,7 @@
#include "rtl.h"
#include "basic-block.h"
#include "flags.h"
+#include "timevar.h"
#include "output.h"
#include "cfglayout.h"
#include "fibheap.h"
@@ -312,7 +313,7 @@ rotate_loop (edge back_edge, struct trace *trace, int trace_n)
/* Duplicate HEADER if it is a small block containing cond jump
in the end. */
- if (any_condjump_p (header->end) && copy_bb_p (header, 0))
+ if (any_condjump_p (BB_END (header)) && copy_bb_p (header, 0))
{
copy_bb (header, prev_bb->succ, prev_bb, trace_n);
}
@@ -414,8 +415,10 @@ find_traces_1_round (int branch_th, int exec_th, gcov_type count_th,
/* Select the successor that will be placed after BB. */
for (e = bb->succ; e; e = e->succ_next)
{
+#ifdef ENABLE_CHECKING
if (e->flags & EDGE_FAKE)
abort ();
+#endif
if (e->dest == EXIT_BLOCK_PTR)
continue;
@@ -1000,6 +1003,8 @@ copy_bb_p (basic_block bb, int code_may_grow)
int size = 0;
int max_size = uncond_jump_length;
rtx insn;
+ int n_succ;
+ edge e;
if (!bb->frequency)
return false;
@@ -1008,10 +1013,19 @@ copy_bb_p (basic_block bb, int code_may_grow)
if (!cfg_layout_can_duplicate_bb_p (bb))
return false;
+ /* Avoid duplicating blocks which have many successors (PR/13430). */
+ n_succ = 0;
+ for (e = bb->succ; e; e = e->succ_next)
+ {
+ n_succ++;
+ if (n_succ > 8)
+ return false;
+ }
+
if (code_may_grow && maybe_hot_bb_p (bb))
max_size *= 8;
- for (insn = bb->head; insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -1064,6 +1078,8 @@ reorder_basic_blocks (void)
if ((* targetm.cannot_modify_jumps_p) ())
return;
+ timevar_push (TV_REORDER_BLOCKS);
+
cfg_layout_initialize ();
set_edge_can_fallthru_flag ();
@@ -1096,4 +1112,6 @@ reorder_basic_blocks (void)
dump_flow_info (rtl_dump_file);
cfg_layout_finalize ();
+
+ timevar_pop (TV_REORDER_BLOCKS);
}
diff --git a/gcc/bitmap.c b/gcc/bitmap.c
index 84d4be2ec38..bffd9154aee 100644
--- a/gcc/bitmap.c
+++ b/gcc/bitmap.c
@@ -348,7 +348,7 @@ bitmap_clear_bit (bitmap head, int bit)
unsigned word_num = bit / BITMAP_WORD_BITS % BITMAP_ELEMENT_WORDS;
ptr->bits[word_num] &= ~ (((BITMAP_WORD) 1) << bit_num);
- /* If we cleared the entire word, free up the element */
+ /* If we cleared the entire word, free up the element. */
if (bitmap_element_zerop (ptr))
bitmap_element_free (head, ptr);
}
diff --git a/gcc/bitmap.h b/gcc/bitmap.h
index d7220034880..4191542d3ac 100644
--- a/gcc/bitmap.h
+++ b/gcc/bitmap.h
@@ -305,7 +305,7 @@ do { \
\
for (; ptr1_ != 0 ; ptr1_ = ptr1_->next) \
{ \
- /* Advance BITMAP2 to the equivalent link */ \
+ /* Advance BITMAP2 to the equivalent link. */ \
while (ptr2_ != 0 && ptr2_->indx < ptr1_->indx) \
ptr2_ = ptr2_->next; \
\
diff --git a/gcc/bt-load.c b/gcc/bt-load.c
index b3ba22b83ee..2a68cd76bdb 100644
--- a/gcc/bt-load.c
+++ b/gcc/bt-load.c
@@ -155,9 +155,6 @@ static void note_btr_set (rtx, rtx, void *);
migrating branch target load instructions. */
static struct obstack migrate_btrl_obstack;
-/* Basic block dominator information used when migrating PT instructions */
-static dominance_info dom;
-
/* Array indexed by basic block number, giving the set of registers
live in that block. */
static HARD_REG_SET *btrs_live;
@@ -477,7 +474,7 @@ compute_defs_uses_and_gen (fibheap_t all_btr_defs, btr_def *def_array,
&& REGNO_REG_SET_P (bb->global_live_at_start, reg))
SET_HARD_REG_BIT (info.btrs_live_in_block, reg);
- for (insn = bb->head, last = NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb));
insn != last;
insn = NEXT_INSN (insn), insn_luid++)
{
@@ -629,7 +626,7 @@ link_btr_uses (btr_def *def_array, btr_user *use_array, sbitmap *bb_out,
rtx last;
sbitmap_union_of_preds (reaching_defs, bb_out, i);
- for (insn = bb->head, last = NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb));
insn != last;
insn = NEXT_INSN (insn))
{
@@ -840,9 +837,9 @@ augment_live_range (bitmap live_range, HARD_REG_SET *btrs_live_in_range,
tos = worklist = xmalloc (sizeof (basic_block) * (n_basic_blocks + 1));
- if (dominated_by_p (dom, new_bb, head_bb))
+ if (dominated_by_p (CDI_DOMINATORS, new_bb, head_bb))
*tos++ = new_bb;
- else if (dominated_by_p (dom, head_bb, new_bb))
+ else if (dominated_by_p (CDI_DOMINATORS, head_bb, new_bb))
{
edge e;
int new_block = new_bb->index;
@@ -974,7 +971,7 @@ combine_btr_defs (btr_def def, HARD_REG_SET *btrs_live_in_range)
if (other_def != def
&& other_def->uses != NULL
&& ! other_def->has_ambiguous_use
- && dominated_by_p (dom, other_def->bb, def->bb))
+ && dominated_by_p (CDI_DOMINATORS, other_def->bb, def->bb))
{
/* def->bb dominates the other def, so def and other_def could
be combined. */
@@ -1058,7 +1055,7 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range,
Replace all uses of the old target register definition by
uses of the new definition. Delete the old definition. */
basic_block b = new_def_bb;
- rtx insp = b->head;
+ rtx insp = BB_HEAD (b);
rtx old_insn = def->insn;
rtx src;
rtx btr_rtx;
@@ -1131,7 +1128,7 @@ move_btr_def (basic_block new_def_bb, int btr, btr_def def, bitmap live_range,
static int
can_move_up (basic_block bb, rtx insn, int n_insns)
{
- while (insn != bb->head && n_insns > 0)
+ while (insn != BB_HEAD (bb) && n_insns > 0)
{
insn = PREV_INSN (insn);
/* ??? What if we have an anti-dependency that actually prevents the
@@ -1226,9 +1223,9 @@ migrate_btr_def (btr_def def, int min_cost)
def_basic_block_freq = basic_block_freq (def->bb);
- for (try = get_immediate_dominator (dom, def->bb);
+ for (try = get_immediate_dominator (CDI_DOMINATORS, def->bb);
!give_up && try && try != ENTRY_BLOCK_PTR && def->cost >= min_cost;
- try = get_immediate_dominator (dom, try))
+ try = get_immediate_dominator (CDI_DOMINATORS, try))
{
/* Try to move the instruction that sets the target register into
basic block TRY. */
@@ -1299,7 +1296,7 @@ migrate_btr_defs (enum reg_class btr_class, int allow_callee_save)
"Basic block %d: count = " HOST_WIDEST_INT_PRINT_DEC
" loop-depth = %d idom = %d\n",
i, (HOST_WIDEST_INT) bb->count, bb->loop_depth,
- get_immediate_dominator (dom, bb)->index);
+ get_immediate_dominator (CDI_DOMINATORS, bb)->index);
}
}
@@ -1367,12 +1364,12 @@ branch_target_load_optimize (rtx insns, bool after_prologue_epilogue_gen)
life_analysis (insns, NULL, 0);
/* Dominator info is also needed for migrate_btr_def. */
- dom = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
migrate_btr_defs (class,
((*targetm.branch_target_register_callee_saved)
(after_prologue_epilogue_gen)));
- free_dominance_info (dom);
+ free_dominance_info (CDI_DOMINATORS);
update_life_info (NULL, UPDATE_LIFE_GLOBAL_RM_NOTES,
PROP_DEATH_NOTES | PROP_REG_INFO);
diff --git a/gcc/builtins.c b/gcc/builtins.c
index 39156ebb62e..c5af18d7182 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -710,6 +710,13 @@ expand_builtin_longjmp (rtx buf_addr, rtx value)
{
lab = copy_to_reg (lab);
+ emit_insn (gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_SCRATCH (VOIDmode))));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ hard_frame_pointer_rtx)));
+
emit_move_insn (hard_frame_pointer_rtx, fp);
emit_stack_restore (SAVE_NONLOCAL, stack, NULL_RTX);
@@ -1089,7 +1096,7 @@ result_vector (int savep, rtx result)
static rtx
expand_builtin_apply_args_1 (void)
{
- rtx registers;
+ rtx registers, tem;
int size, align, regno;
enum machine_mode mode;
rtx struct_incoming_value = targetm.calls.struct_value_rtx (cfun ? TREE_TYPE (cfun->decl) : 0, 1);
@@ -1107,8 +1114,6 @@ expand_builtin_apply_args_1 (void)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if ((mode = apply_args_mode[regno]) != VOIDmode)
{
- rtx tem;
-
align = GET_MODE_ALIGNMENT (mode) / BITS_PER_UNIT;
if (size % align != 0)
size = CEIL (size, align) * align;
@@ -1120,8 +1125,14 @@ expand_builtin_apply_args_1 (void)
}
/* Save the arg pointer to the block. */
- emit_move_insn (adjust_address (registers, Pmode, 0),
- copy_to_reg (virtual_incoming_args_rtx));
+ tem = copy_to_reg (virtual_incoming_args_rtx);
+#ifdef STACK_GROWS_DOWNWARD
+ /* We need the pointer as the caller actually passed them to us, not
+ as we might have pretended they were passed. */
+ tem = plus_constant (tem, current_function_pretend_args_size);
+#endif
+ emit_move_insn (adjust_address (registers, Pmode, 0), tem);
+
size = GET_MODE_SIZE (Pmode);
/* Save the structure value address unless this is passed as an
@@ -1219,12 +1230,16 @@ expand_builtin_apply (rtx function, rtx arguments, rtx argsize)
#endif
emit_stack_save (SAVE_BLOCK, &old_stack_level, NULL_RTX);
- /* Push a block of memory onto the stack to store the memory arguments.
- Save the address in a register, and copy the memory arguments. ??? I
- haven't figured out how the calling convention macros effect this,
- but it's likely that the source and/or destination addresses in
- the block copy will need updating in machine specific ways. */
- dest = allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT);
+ /* Allocate a block of memory onto the stack and copy the memory
+ arguments to the outgoing arguments address. */
+ allocate_dynamic_stack_space (argsize, 0, BITS_PER_UNIT);
+ dest = virtual_outgoing_args_rtx;
+#ifndef STACK_GROWS_DOWNWARD
+ if (GET_CODE (argsize) == CONST_INT)
+ dest = plus_constant (dest, -INTVAL (argsize));
+ else
+ dest = gen_rtx_PLUS (Pmode, dest, negate_rtx (Pmode, argsize));
+#endif
dest = gen_rtx_MEM (BLKmode, dest);
set_mem_align (dest, PARM_BOUNDARY);
src = gen_rtx_MEM (BLKmode, incoming_args);
@@ -1378,7 +1393,7 @@ expand_builtin_return (rtx result)
/* Return whatever values was restored by jumping directly to the end
of the function. */
- expand_null_return ();
+ expand_naked_return ();
}
/* Used by expand_builtin_classify_type and fold_builtin_classify_type. */
@@ -2261,7 +2276,8 @@ expand_builtin_strstr (tree arglist, rtx target, enum machine_mode mode)
/* Return an offset into the constant string argument. */
return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1),
- s1, ssize_int (r - p1))),
+ s1, convert (TREE_TYPE (s1),
+ ssize_int (r - p1)))),
target, mode, EXPAND_NORMAL);
}
@@ -2318,7 +2334,8 @@ expand_builtin_strchr (tree arglist, rtx target, enum machine_mode mode)
/* Return an offset into the constant string argument. */
return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1),
- s1, ssize_int (r - p1))),
+ s1, convert (TREE_TYPE (s1),
+ ssize_int (r - p1)))),
target, mode, EXPAND_NORMAL);
}
@@ -2362,7 +2379,8 @@ expand_builtin_strrchr (tree arglist, rtx target, enum machine_mode mode)
/* Return an offset into the constant string argument. */
return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1),
- s1, ssize_int (r - p1))),
+ s1, convert (TREE_TYPE (s1),
+ ssize_int (r - p1)))),
target, mode, EXPAND_NORMAL);
}
@@ -2408,7 +2426,8 @@ expand_builtin_strpbrk (tree arglist, rtx target, enum machine_mode mode)
/* Return an offset into the constant string argument. */
return expand_expr (fold (build (PLUS_EXPR, TREE_TYPE (s1),
- s1, ssize_int (r - p1))),
+ s1, convert (TREE_TYPE (s1),
+ ssize_int (r - p1)))),
target, mode, EXPAND_NORMAL);
}
@@ -3910,6 +3929,14 @@ stabilize_va_list (tree valist, int needs_lvalue)
return valist;
}
+/* The "standard" definition of va_list is void*. */
+
+tree
+std_build_builtin_va_list (void)
+{
+ return ptr_type_node;
+}
+
/* The "standard" implementation of va_start: just assign `nextarg' to
the variable. */
@@ -4437,6 +4464,14 @@ expand_builtin_expect_jump (tree exp, rtx if_false_label, rtx if_true_label)
ret = get_insns ();
end_sequence ();
+ /* For mildly unsafe builtin jump's, if unsave_expr_now
+ creates a new tree instead of changing the old one
+ TREE_VALUE (arglist) needs to be updated. */
+ if (arg0 != TREE_VALUE (arglist)
+ && TREE_CODE (arg0) == UNSAVE_EXPR
+ && TREE_OPERAND (arg0, 0) != TREE_VALUE (arglist))
+ TREE_VALUE (arglist) = TREE_OPERAND (arg0, 0);
+
/* Now that the __builtin_expect has been validated, go through and add
the expect's to each of the conditional jumps. If we run into an
error, just give up and generate the 'safe' code of doing a SCC
diff --git a/gcc/c-common.c b/gcc/c-common.c
index 1d32d963a51..3ba73dd2722 100644
--- a/gcc/c-common.c
+++ b/gcc/c-common.c
@@ -386,7 +386,7 @@ int flag_isoc94;
int flag_isoc99;
-/* Nonzero means that we have builtin functions, and main is an int */
+/* Nonzero means that we have builtin functions, and main is an int. */
int flag_hosted = 1;
@@ -510,17 +510,6 @@ int flag_no_gnu_keywords;
int flag_implement_inlines = 1;
-/* Nonzero means do emit exported implementations of templates, instead of
- multiple static copies in each file that needs a definition. */
-
-int flag_external_templates;
-
-/* Nonzero means that the decision to emit or not emit the implementation of a
- template depends on where the template is instantiated, rather than where
- it is defined. */
-
-int flag_alt_external_templates;
-
/* Nonzero means that implicit instantiations will be emitted if needed. */
int flag_implicit_templates = 1;
@@ -620,10 +609,12 @@ int flag_enforce_eh_specs = 1;
1: The version of the ABI first used in G++ 3.2.
+ 2: The version of the ABI first used in G++ 3.4.
+
Additional positive integers will be assigned as new versions of
the ABI become the default version of the ABI. */
-int flag_abi_version = 1;
+int flag_abi_version = 2;
/* Nonzero means warn about things that will change when compiling
with an ABI-compliant compiler. */
@@ -2793,6 +2784,9 @@ static tree builtin_function_2 (const char *, const char *, tree, tree,
tree
c_build_qualified_type (tree type, int type_quals)
{
+ if (type == error_mark_node)
+ return type;
+
if (TREE_CODE (type) == ARRAY_TYPE)
return build_array_type (c_build_qualified_type (TREE_TYPE (type),
type_quals),
@@ -2818,6 +2812,9 @@ void
c_apply_type_quals_to_decl (int type_quals, tree decl)
{
tree type = TREE_TYPE (decl);
+
+ if (type == error_mark_node)
+ return;
if (((type_quals & TYPE_QUAL_CONST)
|| (type && TREE_CODE (type) == REFERENCE_TYPE))
@@ -4929,34 +4926,33 @@ handle_visibility_attribute (tree *node, tree name, tree args,
bool *no_add_attrs)
{
tree decl = *node;
+ tree id = TREE_VALUE (args);
+
+ *no_add_attrs = true;
if (decl_function_context (decl) != 0 || ! TREE_PUBLIC (decl))
{
warning ("`%s' attribute ignored", IDENTIFIER_POINTER (name));
- *no_add_attrs = true;
+ return NULL_TREE;
}
- else
- {
- tree id;
- id = TREE_VALUE (args);
- if (TREE_CODE (id) != STRING_CST)
- {
- error ("visibility arg not a string");
- *no_add_attrs = true;
- return NULL_TREE;
- }
- if (strcmp (TREE_STRING_POINTER (id), "hidden")
- && strcmp (TREE_STRING_POINTER (id), "protected")
- && strcmp (TREE_STRING_POINTER (id), "internal")
- && strcmp (TREE_STRING_POINTER (id), "default"))
- {
- error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
- *no_add_attrs = true;
- return NULL_TREE;
- }
+ if (TREE_CODE (id) != STRING_CST)
+ {
+ error ("visibility arg not a string");
+ return NULL_TREE;
}
+ if (strcmp (TREE_STRING_POINTER (id), "default") == 0)
+ DECL_VISIBILITY (decl) = VISIBILITY_DEFAULT;
+ else if (strcmp (TREE_STRING_POINTER (id), "internal") == 0)
+ DECL_VISIBILITY (decl) = VISIBILITY_INTERNAL;
+ else if (strcmp (TREE_STRING_POINTER (id), "hidden") == 0)
+ DECL_VISIBILITY (decl) = VISIBILITY_HIDDEN;
+ else if (strcmp (TREE_STRING_POINTER (id), "protected") == 0)
+ DECL_VISIBILITY (decl) = VISIBILITY_PROTECTED;
+ else
+ error ("visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\"");
+
return NULL_TREE;
}
@@ -5775,7 +5771,7 @@ c_estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
return NULL;
switch (TREE_CODE (x))
{
- /* Reconginze assignments of large structures and constructors of
+ /* Recognize assignments of large structures and constructors of
big arrays. */
case MODIFY_EXPR:
case CONSTRUCTOR:
@@ -5894,4 +5890,36 @@ c_decl_uninit (tree t)
return false;
}
+/* Issue the error given by MSGID, indicating that it occurred before
+ TOKEN, which had the associated VALUE. */
+
+void
+c_parse_error (const char *msgid, enum cpp_ttype token, tree value)
+{
+ const char *string = _(msgid);
+
+ if (token == CPP_EOF)
+ error ("%s at end of input", string);
+ else if (token == CPP_CHAR || token == CPP_WCHAR)
+ {
+ unsigned int val = TREE_INT_CST_LOW (value);
+ const char *const ell = (token == CPP_CHAR) ? "" : "L";
+ if (val <= UCHAR_MAX && ISGRAPH (val))
+ error ("%s before %s'%c'", string, ell, val);
+ else
+ error ("%s before %s'\\x%x'", string, ell, val);
+ }
+ else if (token == CPP_STRING
+ || token == CPP_WSTRING)
+ error ("%s before string constant", string);
+ else if (token == CPP_NUMBER)
+ error ("%s before numeric constant", string);
+ else if (token == CPP_NAME)
+ error ("%s before \"%s\"", string, IDENTIFIER_POINTER (value));
+ else if (token < N_TTYPES)
+ error ("%s before '%s' token", string, cpp_type2name (token));
+ else
+ error ("%s", string);
+}
+
#include "gt-c-common.h"
diff --git a/gcc/c-common.h b/gcc/c-common.h
index ccfc779bee0..e3ae91fb311 100644
--- a/gcc/c-common.h
+++ b/gcc/c-common.h
@@ -88,9 +88,10 @@ enum rid
RID_PUBLIC, RID_PRIVATE, RID_PROTECTED,
RID_TEMPLATE, RID_NULL, RID_CATCH,
RID_DELETE, RID_FALSE, RID_NAMESPACE,
- RID_NEW, RID_OPERATOR, RID_THIS,
- RID_THROW, RID_TRUE, RID_TRY,
- RID_TYPENAME, RID_TYPEID, RID_USING,
+ RID_NEW, RID_OFFSETOF, RID_OPERATOR,
+ RID_THIS, RID_THROW, RID_TRUE,
+ RID_TRY, RID_TYPENAME, RID_TYPEID,
+ RID_USING,
/* casts */
RID_CONSTCAST, RID_DYNCAST, RID_REINTCAST, RID_STATCAST,
@@ -552,7 +553,7 @@ extern int flag_isoc94;
extern int flag_isoc99;
-/* Nonzero means that we have builtin functions, and main is an int */
+/* Nonzero means that we have builtin functions, and main is an int. */
extern int flag_hosted;
@@ -673,17 +674,6 @@ extern int flag_no_gnu_keywords;
extern int flag_implement_inlines;
-/* Nonzero means do emit exported implementations of templates, instead of
- multiple static copies in each file that needs a definition. */
-
-extern int flag_external_templates;
-
-/* Nonzero means that the decision to emit or not emit the implementation of a
- template depends on where the template is instantiated, rather than where
- it is defined. */
-
-extern int flag_alt_external_templates;
-
/* Nonzero means that implicit instantiations will be emitted if needed. */
extern int flag_implicit_templates;
@@ -1330,6 +1320,7 @@ extern void c_stddef_cpp_builtins (void);
extern void fe_file_change (const struct line_map *);
extern int c_estimate_num_insns (tree decl);
extern bool c_decl_uninit (tree t);
+extern void c_parse_error (const char *, enum cpp_ttype, tree);
/* The following have been moved here from c-tree.h, since they're needed
in the ObjC++ world, too. What is more, stub-objc.c could use a few
diff --git a/gcc/c-cppbuiltin.c b/gcc/c-cppbuiltin.c
index 19a9cf48106..739a34224b1 100644
--- a/gcc/c-cppbuiltin.c
+++ b/gcc/c-cppbuiltin.c
@@ -310,7 +310,23 @@ c_cpp_builtins (cpp_reader *pfile)
/* represents the C++ ABI version, always defined so it can be used while
preprocessing C and assembler. */
- cpp_define (pfile, "__GXX_ABI_VERSION=102");
+ if (flag_abi_version == 0)
+ /* Use a very large value so that:
+
+ #if __GXX_ABI_VERSION >= <value for version X>
+
+ will work whether the user explicitly says "-fabi-version=x" or
+ "-fabi-version=0". Do not use INT_MAX because that will be
+ different from system to system. */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION", 999999);
+ else if (flag_abi_version == 1)
+ /* Due to an historical accident, this version had the value
+ "102". */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION", 102);
+ else
+ /* Newer versions have values 1002, 1003, ... */
+ builtin_define_with_int_value ("__GXX_ABI_VERSION",
+ 1000 + flag_abi_version);
/* libgcc needs to know this. */
if (USING_SJLJ_EXCEPTIONS)
diff --git a/gcc/c-decl.c b/gcc/c-decl.c
index 93ce347784d..db04a877f1a 100644
--- a/gcc/c-decl.c
+++ b/gcc/c-decl.c
@@ -61,7 +61,6 @@ enum decl_context
FUNCDEF, /* Function definition */
PARM, /* Declaration of parm before function body */
FIELD, /* Declaration inside struct or union */
- BITFIELD, /* Likewise but with specified width */
TYPENAME}; /* Typename (inside cast or sizeof) */
@@ -126,6 +125,10 @@ static GTY(()) struct stmt_tree_s c_stmt_tree;
static GTY(()) tree c_scope_stmt_stack;
+/* State saving variables. */
+int c_in_iteration_stmt;
+int c_in_case_stmt;
+
/* A list of external DECLs that appeared at block scope when there was
some other global meaning for that identifier. */
static GTY(()) tree truly_local_externals;
@@ -311,7 +314,7 @@ static void bind_label (tree, tree, struct c_scope *);
static void implicit_decl_warning (tree);
static tree lookup_tag (enum tree_code, tree, int);
static tree lookup_name_current_level (tree);
-static tree grokdeclarator (tree, tree, enum decl_context, int);
+static tree grokdeclarator (tree, tree, enum decl_context, int, tree *);
static tree grokparms (tree, int);
static void layout_array_type (tree);
static void store_parm_decls_newstyle (void);
@@ -321,6 +324,7 @@ static void c_expand_body_1 (tree, int);
static tree any_external_decl (tree);
static void record_external_decl (tree);
static void warn_if_shadowing (tree, tree);
+static void check_bitfield_type_and_width (tree *, tree *, const char *);
static void clone_underlying_type (tree);
static bool flexible_array_type_p (tree);
static hashval_t link_hash_hash (const void *);
@@ -425,13 +429,13 @@ void
objc_mark_locals_volatile (void *enclosing_blk)
{
struct c_scope *scope;
-
- for (scope = current_scope;
+
+ for (scope = current_scope;
scope && scope != enclosing_blk;
scope = scope->outer)
{
tree decl;
-
+
for (decl = scope->names; decl; decl = TREE_CHAIN (decl))
{
DECL_REGISTER (decl) = 0;
@@ -440,9 +444,9 @@ objc_mark_locals_volatile (void *enclosing_blk)
/* Do not climb up past the current function. */
if (scope->function_body)
break;
- }
-}
-
+ }
+}
+
/* Nonzero if we are currently in the global scope. */
int
@@ -537,7 +541,7 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody)
tree decl;
tree p;
- /* The following line does not use |= due to a bug in HP's C compiler */
+ /* The following line does not use |= due to a bug in HP's C compiler. */
scope->function_body = scope->function_body | functionbody;
if (keep == KEEP_MAYBE)
@@ -672,7 +676,7 @@ poplevel (int keep, int dummy ATTRIBUTE_UNUSED, int functionbody)
IDENTIFIER_TAG_VALUE (TREE_PURPOSE (p)) = TREE_VALUE (p);
/* Dispose of the block that we just made inside some higher level. */
- if (scope->function_body)
+ if (scope->function_body && current_function_decl)
DECL_INITIAL (current_function_decl) = block;
else if (scope->outer)
{
@@ -1331,6 +1335,19 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
Currently, it can only be defined in the prototype. */
COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
+ /* If either declaration has a nondefault visibility, use it. */
+ if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
+ {
+ if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
+ && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
+ {
+ warning ("%J'%D': visibility attribute ignored because it",
+ newdecl, newdecl);
+ warning ("%Jconflicts with previous declaration here", olddecl);
+ }
+ DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
+ }
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
DECL_STATIC_CONSTRUCTOR(newdecl) |= DECL_STATIC_CONSTRUCTOR(olddecl);
@@ -1408,7 +1425,7 @@ duplicate_decls (tree newdecl, tree olddecl, int different_binding_level,
{
if (TREE_USED (olddecl)
/* In unit-at-a-time mode we never inline re-defined extern
- inline functions. */
+ inline functions. */
&& !flag_unit_at_a_time)
(*debug_hooks->outlining_inline_function) (olddecl);
@@ -1677,7 +1694,7 @@ pushdecl (tree x)
DECL_CONTEXT (x) = current_file_decl;
else
DECL_CONTEXT (x) = current_function_decl;
-
+
if (name)
{
tree old;
@@ -1712,13 +1729,13 @@ pushdecl (tree x)
if (DECL_EXTERNAL (x) || scope == global_scope)
{
/* Find and check against a previous, not-in-scope, external
- decl for this identifier. (C99 s???: If two declarations
- with external linkage, referring to the same object, have
- incompatible types, the behavior is undefined). */
- tree ext = any_external_decl (name);
+ decl for this identifier. (C99 6.2.7p2: All declarations
+ that refer to the same object or function shall have
+ compatible type; otherwise, the behavior is undefined.) */
+ tree ext = any_external_decl (name);
if (ext)
{
- if (duplicate_decls (x, ext, scope != global_scope,
+ if (duplicate_decls (x, ext, scope != global_scope,
false))
x = copy_node (ext);
}
@@ -2250,7 +2267,7 @@ c_init_decl_processing (void)
tree endlink;
tree ptr_ftype_void, ptr_ftype_ptr;
location_t save_loc = input_location;
-
+
/* Adds some ggc roots, and reserved words for c-parse.in. */
c_parse_init ();
@@ -2523,7 +2540,8 @@ groktypename (tree typename)
split_specs_attrs (TREE_PURPOSE (typename), &specs, &attrs);
- typename = grokdeclarator (TREE_VALUE (typename), specs, TYPENAME, 0);
+ typename = grokdeclarator (TREE_VALUE (typename), specs, TYPENAME, 0,
+ NULL);
/* Apply attributes. */
decl_attributes (&typename, attrs, 0);
@@ -2540,7 +2558,7 @@ groktypename_in_parm_context (tree typename)
return typename;
return grokdeclarator (TREE_VALUE (typename),
TREE_PURPOSE (typename),
- PARM, 0);
+ PARM, 0, NULL);
}
/* Decode a declarator in an ordinary declaration or data definition.
@@ -2570,7 +2588,7 @@ start_decl (tree declarator, tree declspecs, int initialized, tree attributes)
deprecated_state = DEPRECATED_SUPPRESS;
decl = grokdeclarator (declarator, declspecs,
- NORMAL, initialized);
+ NORMAL, initialized, NULL);
deprecated_state = DEPRECATED_NORMAL;
@@ -2757,7 +2775,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
|| TREE_CODE (decl) == FIELD_DECL))
objc_check_decl (decl);
- /* Deduce size of array from initialization, if not already known */
+ /* Deduce size of array from initialization, if not already known. */
if (TREE_CODE (type) == ARRAY_TYPE
&& TYPE_DOMAIN (type) == 0
&& TREE_CODE (decl) != TYPE_DECL)
@@ -2870,7 +2888,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
#endif
}
SET_DECL_RTL (decl, NULL_RTX);
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
+ change_decl_assembler_name (decl, get_identifier (starred));
}
/* If #pragma weak was used, mark the decl weak now. */
@@ -2920,7 +2938,7 @@ finish_decl (tree decl, tree init, tree asmspec_tree)
warning ("%Jignoring asm-specifier for non-static local "
"variable '%D'", decl, decl);
else
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+ change_decl_assembler_name (decl, get_identifier (asmspec));
}
if (TREE_CODE (decl) != FUNCTION_DECL)
@@ -3006,7 +3024,8 @@ push_parm_decl (tree parm)
immediate_size_expand = 0;
decl = grokdeclarator (TREE_VALUE (TREE_PURPOSE (parm)),
- TREE_PURPOSE (TREE_PURPOSE (parm)), PARM, 0);
+ TREE_PURPOSE (TREE_PURPOSE (parm)),
+ PARM, 0, NULL);
decl_attributes (&decl, TREE_VALUE (parm), 0);
decl = pushdecl (decl);
@@ -3201,6 +3220,77 @@ flexible_array_type_p (tree type)
}
}
+/* Performs sanity checks on the TYPE and WIDTH of the bit-field NAME,
+ replacing with appropriate values if they are invalid. */
+static void
+check_bitfield_type_and_width (tree *type, tree *width, const char *orig_name)
+{
+ tree type_mv;
+ unsigned int max_width;
+ unsigned HOST_WIDE_INT w;
+ const char *name = orig_name ? orig_name: _("<anonymous>");
+
+ /* Necessary? */
+ STRIP_NOPS (*width);
+
+ /* Detect and ignore out of range field width and process valid
+ field widths. */
+ if (TREE_CODE (*width) != INTEGER_CST)
+ {
+ error ("bit-field `%s' width not an integer constant", name);
+ *width = integer_one_node;
+ }
+ else
+ {
+ constant_expression_warning (*width);
+ if (tree_int_cst_sgn (*width) < 0)
+ {
+ error ("negative width in bit-field `%s'", name);
+ *width = integer_one_node;
+ }
+ else if (integer_zerop (*width) && orig_name)
+ {
+ error ("zero width for bit-field `%s'", name);
+ *width = integer_one_node;
+ }
+ }
+
+ /* Detect invalid bit-field type. */
+ if (TREE_CODE (*type) != INTEGER_TYPE
+ && TREE_CODE (*type) != BOOLEAN_TYPE
+ && TREE_CODE (*type) != ENUMERAL_TYPE)
+ {
+ error ("bit-field `%s' has invalid type", name);
+ *type = unsigned_type_node;
+ }
+
+ type_mv = TYPE_MAIN_VARIANT (*type);
+ if (pedantic
+ && type_mv != integer_type_node
+ && type_mv != unsigned_type_node
+ && type_mv != boolean_type_node)
+ pedwarn ("type of bit-field `%s' is a GCC extension", name);
+
+ if (type_mv == boolean_type_node)
+ max_width = CHAR_TYPE_SIZE;
+ else
+ max_width = TYPE_PRECISION (*type);
+
+ if (0 < compare_tree_int (*width, max_width))
+ {
+ error ("width of `%s' exceeds its type", name);
+ w = max_width;
+ *width = build_int_2 (w, 0);
+ }
+ else
+ w = tree_low_cst (*width, 1);
+
+ if (TREE_CODE (*type) == ENUMERAL_TYPE
+ && (w < min_precision (TYPE_MIN_VALUE (*type), TREE_UNSIGNED (*type))
+ || w < min_precision (TYPE_MAX_VALUE (*type), TREE_UNSIGNED (*type))))
+ warning ("`%s' is narrower than values of its type", name);
+}
+
/* Given declspecs and a declarator,
determine the name and type of the object declared
and construct a ..._DECL node for it.
@@ -3220,8 +3310,9 @@ flexible_array_type_p (tree type)
TYPENAME if for a typename (in a cast or sizeof).
Don't make a DECL node; just return the ..._TYPE node.
FIELD for a struct or union field; make a FIELD_DECL.
- BITFIELD for a field with specified width.
INITIALIZED is 1 if the decl has an initializer.
+ WIDTH is non-NULL for bit-fields, and is a pointer to an INTEGER_CST node
+ representing the width of the bit-field.
In the TYPENAME case, DECLARATOR is really an absolute declarator.
It may also be so in the PARM case, for a prototype where the
@@ -3232,7 +3323,7 @@ flexible_array_type_p (tree type)
static tree
grokdeclarator (tree declarator, tree declspecs,
- enum decl_context decl_context, int initialized)
+ enum decl_context decl_context, int initialized, tree *width)
{
int specbits = 0;
tree spec;
@@ -3247,19 +3338,16 @@ grokdeclarator (tree declarator, tree declspecs,
int explicit_char = 0;
int defaulted_int = 0;
tree typedef_decl = 0;
- const char *name;
+ const char *name, *orig_name;
tree typedef_type = 0;
int funcdef_flag = 0;
enum tree_code innermost_code = ERROR_MARK;
- int bitfield = 0;
int size_varies = 0;
tree decl_attr = NULL_TREE;
tree array_ptr_quals = NULL_TREE;
int array_parm_static = 0;
tree returned_attrs = NULL_TREE;
-
- if (decl_context == BITFIELD)
- bitfield = 1, decl_context = FIELD;
+ bool bitfield = width != NULL;
if (decl_context == FUNCDEF)
funcdef_flag = 1, decl_context = NORMAL;
@@ -3292,6 +3380,7 @@ grokdeclarator (tree declarator, tree declspecs,
default:
abort ();
}
+ orig_name = name;
if (name == 0)
name = "type name";
}
@@ -3524,7 +3613,7 @@ grokdeclarator (tree declarator, tree declspecs,
}
/* Decide whether an integer type is signed or not.
- Optionally treat bitfields as signed by default. */
+ Optionally treat bit-fields as signed by default. */
if (specbits & 1 << (int) RID_UNSIGNED
|| (bitfield && ! flag_signed_bitfields
&& (explicit_int || defaulted_int || explicit_char
@@ -3596,6 +3685,10 @@ grokdeclarator (tree declarator, tree declspecs,
}
}
+ /* Check the type and width of a bit-field. */
+ if (bitfield)
+ check_bitfield_type_and_width (&type, width, orig_name);
+
/* Figure out the type qualifiers for the declaration. There are
two ways a declaration can become qualified. One is something
like `const int i' where the `const' is explicit. Another is
@@ -4637,7 +4730,7 @@ get_parm_info (int void_at_end)
default: abort ();
}
- if (TREE_PURPOSE (decl))
+ if (TREE_PURPOSE (decl))
/* The first %s will be one of 'struct', 'union', or 'enum'. */
warning ("\"%s %s\" declared inside parameter list",
keyword, IDENTIFIER_POINTER (TREE_PURPOSE (decl)));
@@ -4752,7 +4845,7 @@ start_struct (enum tree_code code, tree name)
/* Process the specs, declarator (NULL if omitted) and width (NULL if omitted)
of a structure component, returning a FIELD_DECL node.
- WIDTH is non-NULL for bit fields only, and is an INTEGER_CST node.
+ WIDTH is non-NULL for bit-fields only, and is an INTEGER_CST node.
This is done during the parsing of the struct declaration.
The FIELD_DECL nodes are chained together and the lot of them
@@ -4807,7 +4900,8 @@ grokfield (tree declarator, tree declspecs, tree width)
}
}
- value = grokdeclarator (declarator, declspecs, width ? BITFIELD : FIELD, 0);
+ value = grokdeclarator (declarator, declspecs, FIELD, 0,
+ width ? &width : NULL);
finish_decl (value, NULL_TREE, NULL_TREE);
DECL_INITIAL (value) = width;
@@ -4954,72 +5048,12 @@ finish_struct (tree t, tree fieldlist, tree attributes)
error ("nested redefinition of `%s'",
IDENTIFIER_POINTER (TYPE_NAME (t)));
- /* Detect invalid bit-field size. */
- if (DECL_INITIAL (x))
- STRIP_NOPS (DECL_INITIAL (x));
- if (DECL_INITIAL (x))
- {
- if (TREE_CODE (DECL_INITIAL (x)) == INTEGER_CST)
- constant_expression_warning (DECL_INITIAL (x));
- else
- {
- error ("%Jbit-field '%D' width not an integer constant", x, x);
- DECL_INITIAL (x) = NULL;
- }
- }
-
- /* Detect invalid bit-field type. */
- if (DECL_INITIAL (x)
- && TREE_CODE (TREE_TYPE (x)) != INTEGER_TYPE
- && TREE_CODE (TREE_TYPE (x)) != BOOLEAN_TYPE
- && TREE_CODE (TREE_TYPE (x)) != ENUMERAL_TYPE)
- {
- error ("%Jbit-field '%D' has invalid type", x, x);
- DECL_INITIAL (x) = NULL;
- }
-
- if (DECL_INITIAL (x) && pedantic
- && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != integer_type_node
- && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != unsigned_type_node
- && TYPE_MAIN_VARIANT (TREE_TYPE (x)) != boolean_type_node
- /* Accept an enum that's equivalent to int or unsigned int. */
- && !(TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE
- && (TYPE_PRECISION (TREE_TYPE (x))
- == TYPE_PRECISION (integer_type_node))))
- pedwarn ("%Jbit-field '%D' type invalid in ISO C", x, x);
-
- /* Detect and ignore out of range field width and process valid
- field widths. */
if (DECL_INITIAL (x))
{
- int max_width
- = (TYPE_MAIN_VARIANT (TREE_TYPE (x)) == boolean_type_node
- ? CHAR_TYPE_SIZE : TYPE_PRECISION (TREE_TYPE (x)));
-
- if (tree_int_cst_sgn (DECL_INITIAL (x)) < 0)
- error ("%Jnegative width in bit-field '%D'", x, x);
- else if (0 < compare_tree_int (DECL_INITIAL (x), max_width))
- pedwarn ("%Jwidth of '%D' exceeds its type", x, x);
- else if (integer_zerop (DECL_INITIAL (x)) && DECL_NAME (x) != 0)
- error ("%Jzero width for bit-field '%D'", x, x);
- else
- {
- /* The test above has assured us that TREE_INT_CST_HIGH is 0. */
- unsigned HOST_WIDE_INT width
- = tree_low_cst (DECL_INITIAL (x), 1);
-
- if (TREE_CODE (TREE_TYPE (x)) == ENUMERAL_TYPE
- && (width < min_precision (TYPE_MIN_VALUE (TREE_TYPE (x)),
- TREE_UNSIGNED (TREE_TYPE (x)))
- || (width
- < min_precision (TYPE_MAX_VALUE (TREE_TYPE (x)),
- TREE_UNSIGNED (TREE_TYPE (x))))))
- warning ("%J'%D' is narrower than values of its type", x, x);
-
- DECL_SIZE (x) = bitsize_int (width);
- DECL_BIT_FIELD (x) = 1;
- SET_DECL_C_BIT_FIELD (x);
- }
+ unsigned HOST_WIDE_INT width = tree_low_cst (DECL_INITIAL (x), 1);
+ DECL_SIZE (x) = bitsize_int (width);
+ DECL_BIT_FIELD (x) = 1;
+ SET_DECL_C_BIT_FIELD (x);
}
DECL_INITIAL (x) = 0;
@@ -5055,7 +5089,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
layout_type (t);
- /* Delete all zero-width bit-fields from the fieldlist */
+ /* Delete all zero-width bit-fields from the fieldlist. */
{
tree *fieldlistp = &fieldlist;
while (*fieldlistp)
@@ -5071,7 +5105,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
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". */
+ We arbitrarily consider 16 or more elts to be "a lot". */
{
int len = 0;
@@ -5088,23 +5122,23 @@ finish_struct (tree t, tree fieldlist, tree attributes)
tree *field_array;
struct lang_type *space;
struct sorted_fields_type *space2;
-
+
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. */
-
+
space = ggc_alloc (sizeof (struct lang_type));
space2 = ggc_alloc (sizeof (struct sorted_fields_type) + len * sizeof (tree));
-
+
len = 0;
space->s = space2;
field_array = &space2->elts[0];
for (x = fieldlist; x; x = TREE_CHAIN (x))
{
field_array[len++] = x;
-
+
/* If there is anonymous struct or union, break out of the loop. */
if (DECL_NAME (x) == NULL)
break;
@@ -5119,7 +5153,7 @@ finish_struct (tree t, tree fieldlist, tree attributes)
}
}
}
-
+
for (x = TYPE_MAIN_VARIANT (t); x; x = TYPE_NEXT_VARIANT (x))
{
TYPE_FIELDS (x) = TYPE_FIELDS (t);
@@ -5438,11 +5472,13 @@ start_function (tree declspecs, tree declarator, tree attributes)
current_function_returns_abnormally = 0;
warn_about_return_type = 0;
current_extern_inline = 0;
+ c_in_iteration_stmt = 0;
+ c_in_case_stmt = 0;
/* Don't expand any sizes in the return type of the function. */
immediate_size_expand = 0;
- decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1);
+ decl1 = grokdeclarator (declarator, declspecs, FUNCDEF, 1, NULL);
/* If the declarator is not suitable for a function definition,
cause a syntax error. */
@@ -6052,11 +6088,13 @@ finish_function (void)
}
}
- BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
+ if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node)
+ BLOCK_SUPERCONTEXT (DECL_INITIAL (fndecl)) = fndecl;
/* Must mark the RESULT_DECL as being in this function. */
- DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
+ if (DECL_RESULT (fndecl) && DECL_RESULT (fndecl) != error_mark_node)
+ DECL_CONTEXT (DECL_RESULT (fndecl)) = fndecl;
if (MAIN_NAME_P (DECL_NAME (fndecl)) && flag_hosted)
{
@@ -6156,7 +6194,7 @@ c_expand_body_1 (tree fndecl, int nested_p)
/* Squirrel away our current state. */
push_function_context ();
}
-
+
tree_rest_of_compilation (fndecl, nested_p);
if (nested_p)
@@ -6187,7 +6225,9 @@ c_expand_body_1 (tree fndecl, int nested_p)
void
c_expand_body (tree fndecl)
{
- c_expand_body_1 (fndecl, 0);
+
+ if (DECL_INITIAL (fndecl) && DECL_INITIAL (fndecl) != error_mark_node)
+ c_expand_body_1 (fndecl, 0);
}
/* Check the declarations given in a for-loop for satisfying the C99
@@ -6251,20 +6291,6 @@ check_for_loop_decls (void)
}
}
-/* 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 language_function GTY(())
-{
- struct c_language_function base;
- int returns_value;
- int returns_null;
- int returns_abnormally;
- int warn_about_return_type;
- int extern_inline;
-};
-
/* Save and reinitialize the variables
used during compilation of a C function. */
@@ -6277,6 +6303,8 @@ c_push_function_context (struct function *f)
p->base.x_stmt_tree = c_stmt_tree;
p->base.x_scope_stmt_stack = c_scope_stmt_stack;
+ p->x_in_iteration_stmt = c_in_iteration_stmt;
+ p->x_in_case_stmt = c_in_case_stmt;
p->returns_value = current_function_returns_value;
p->returns_null = current_function_returns_null;
p->returns_abnormally = current_function_returns_abnormally;
@@ -6303,6 +6331,8 @@ c_pop_function_context (struct function *f)
c_stmt_tree = p->base.x_stmt_tree;
c_scope_stmt_stack = p->base.x_scope_stmt_stack;
+ c_in_iteration_stmt = p->x_in_iteration_stmt;
+ c_in_case_stmt = p->x_in_case_stmt;
current_function_returns_value = p->returns_value;
current_function_returns_null = p->returns_null;
current_function_returns_abnormally = p->returns_abnormally;
@@ -6510,7 +6540,7 @@ merge_translation_unit_decls (void)
tree decl;
htab_t link_hash_table;
tree block;
-
+
/* Create the BLOCK that poplevel would have created, but don't
actually call poplevel since that's expensive. */
block = make_node (BLOCK);
@@ -6551,7 +6581,7 @@ merge_translation_unit_decls (void)
DECL_EXTERNAL (decl) = 1;
else if (DECL_COMMON (old_decl) || DECL_ONE_ONLY (old_decl))
DECL_EXTERNAL (old_decl) = 1;
-
+
if (DECL_EXTERNAL (decl))
{
DECL_INITIAL (decl) = NULL_TREE;
@@ -6585,10 +6615,10 @@ merge_translation_unit_decls (void)
{
tree global_decl;
global_decl = htab_find (link_hash_table, decl);
-
+
if (! global_decl)
continue;
-
+
/* Print any appropriate error messages, and partially merge
the decls. */
(void) duplicate_decls (decl, global_decl, true, true);
@@ -6603,7 +6633,7 @@ void
c_write_global_declarations(void)
{
tree link;
-
+
for (link = current_file_decl; link; link = TREE_CHAIN (link))
{
tree globals = BLOCK_VARS (DECL_INITIAL (link));
@@ -6611,16 +6641,16 @@ c_write_global_declarations(void)
tree *vec = xmalloc (sizeof (tree) * len);
int i;
tree decl;
-
+
/* Process the decls in the order they were written. */
for (i = 0, decl = globals; i < len; i++, decl = TREE_CHAIN (decl))
vec[i] = decl;
-
+
wrapup_global_declarations (vec, len);
-
+
check_global_declarations (vec, len);
-
+
/* Clean up. */
free (vec);
}
@@ -6633,7 +6663,7 @@ c_reset_state (void)
{
tree link;
tree file_scope_decl;
-
+
/* Pop the global scope. */
if (current_scope != global_scope)
current_scope = global_scope;
diff --git a/gcc/c-format.c b/gcc/c-format.c
index 82fb593f440..a532259750c 100644
--- a/gcc/c-format.c
+++ b/gcc/c-format.c
@@ -37,13 +37,13 @@ void
set_Wformat (int setting)
{
warn_format = setting;
- warn_format_y2k = setting;
warn_format_extra_args = setting;
warn_format_zero_length = setting;
if (setting != 1)
{
warn_format_nonliteral = setting;
warn_format_security = setting;
+ warn_format_y2k = setting;
}
/* Make sure not to disable -Wnonnull if -Wformat=0 is specified. */
if (setting)
@@ -755,23 +755,23 @@ static const format_flag_pair strfmon_flag_pairs[] =
static const format_char_info print_char_table[] =
{
/* C89 conversion specifiers. */
- { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" },
- { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
- { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" },
- { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
- { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
- { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
- { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
- { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" },
- { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" },
+ { "di", 0, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, TEX_LL, T99_SST, T99_PD, T99_IM }, "-wp0 +'I", "i" },
+ { "oxX", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0#", "i" },
+ { "u", 0, STD_C89, { T89_UI, T99_UC, T89_US, T89_UL, T9L_ULL, TEX_ULL, T99_ST, T99_UPD, T99_UIM }, "-wp0'I", "i" },
+ { "fgG", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" },
+ { "eE", 0, STD_C89, { T89_D, BADLEN, BADLEN, T99_D, BADLEN, T89_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#I", "" },
+ { "c", 0, STD_C89, { T89_I, BADLEN, BADLEN, T94_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
+ { "s", 1, STD_C89, { T89_C, BADLEN, BADLEN, T94_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "cR" },
+ { "p", 1, STD_C89, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "c" },
+ { "n", 1, STD_C89, { T89_I, T99_SC, T89_S, T89_L, T9L_LL, BADLEN, T99_SST, T99_PD, T99_IM }, "", "W" },
/* C99 conversion specifiers. */
- { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'", "" },
- { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
+ { "F", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#'I", "" },
+ { "aA", 0, STD_C99, { T99_D, BADLEN, BADLEN, T99_D, BADLEN, T99_LD, BADLEN, BADLEN, BADLEN }, "-wp0 +#", "" },
/* X/Open conversion specifiers. */
- { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
- { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
+ { "C", 0, STD_EXT, { TEX_WI, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-w", "" },
+ { "S", 1, STD_EXT, { TEX_W, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "R" },
/* GNU conversion specifiers. */
- { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
+ { "m", 0, STD_EXT, { T89_V, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN, BADLEN }, "-wp", "" },
{ NULL, 0, 0, NOLENGTHS, NULL, NULL }
};
diff --git a/gcc/c-incpath.c b/gcc/c-incpath.c
index e28114652a3..7b08c1a12a3 100644
--- a/gcc/c-incpath.c
+++ b/gcc/c-incpath.c
@@ -187,12 +187,12 @@ remove_duplicates (cpp_reader *pfile, struct cpp_dir *head,
{
/* Dirs that don't exist are silently ignored, unless verbose. */
if (errno != ENOENT)
- cpp_errno (pfile, DL_ERROR, cur->name);
+ cpp_errno (pfile, CPP_DL_ERROR, cur->name);
else
reason = REASON_NOENT;
}
else if (!S_ISDIR (st.st_mode))
- cpp_error_with_line (pfile, DL_ERROR, 0, 0,
+ cpp_error_with_line (pfile, CPP_DL_ERROR, 0, 0,
"%s: not a directory", cur->name);
else
{
diff --git a/gcc/c-objc-common.c b/gcc/c-objc-common.c
index 287cf300232..e9a4a09ed8d 100644
--- a/gcc/c-objc-common.c
+++ b/gcc/c-objc-common.c
@@ -293,29 +293,41 @@ static bool
c_tree_printer (pretty_printer *pp, text_info *text)
{
tree t = va_arg (*text->args_ptr, tree);
+ const char *n = "({anonymous})";
switch (*text->format_spec)
{
case 'D':
case 'F':
+ if (DECL_NAME (t))
+ n = (*lang_hooks.decl_printable_name) (t, 2);
+ break;
+
case 'T':
- {
- const char *n = DECL_NAME (t)
- ? (*lang_hooks.decl_printable_name) (t, 2)
- : "({anonymous})";
- pp_string (pp, n);
- }
- return true;
+ if (TREE_CODE (t) == TYPE_DECL)
+ {
+ if (DECL_NAME (t))
+ n = (*lang_hooks.decl_printable_name) (t, 2);
+ }
+ else
+ {
+ t = TYPE_NAME (t);
+ if (t)
+ n = IDENTIFIER_POINTER (t);
+ }
+ break;
case 'E':
- if (TREE_CODE (t) == IDENTIFIER_NODE)
- {
- pp_string (pp, IDENTIFIER_POINTER (t));
- return true;
- }
- return false;
+ if (TREE_CODE (t) == IDENTIFIER_NODE)
+ n = IDENTIFIER_POINTER (t);
+ else
+ return false;
+ break;
default:
return false;
}
+
+ pp_string (pp, n);
+ return true;
}
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index b15f31ce78e..59bce76607b 100644
--- a/gcc/c-opts.c
+++ b/gcc/c-opts.c
@@ -108,7 +108,7 @@ static void sanitize_cpp_opts (void);
static void add_prefixed_path (const char *, size_t);
static void push_command_line_include (void);
static void cb_file_change (cpp_reader *, const struct line_map *);
-static void finish_options (const char *);
+static bool finish_options (const char *);
#ifndef STDC_0_IN_SYSTEM_HEADERS
#define STDC_0_IN_SYSTEM_HEADERS 0
@@ -672,7 +672,9 @@ c_common_handle_option (size_t scode, const char *arg, int value)
/* Fall through. */
case OPT_fall_virtual:
+ case OPT_falt_external_templates:
case OPT_fenum_int_equiv:
+ case OPT_fexternal_templates:
case OPT_fguiding_decls:
case OPT_fhonor_std:
case OPT_fhuge_objects:
@@ -697,15 +699,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_access_control = value;
break;
- case OPT_falt_external_templates:
- flag_alt_external_templates = value;
- if (value)
- flag_external_templates = true;
- cp_deprecated:
- warning ("switch \"%s\" is deprecated, please see documentation "
- "for details", option->opt_text);
- break;
-
case OPT_fasm:
flag_no_asm = !value;
break;
@@ -799,10 +792,6 @@ c_common_handle_option (size_t scode, const char *arg, int value)
flag_enforce_eh_specs = value;
break;
- case OPT_fexternal_templates:
- flag_external_templates = value;
- goto cp_deprecated;
-
case OPT_ffixed_form:
case OPT_ffixed_line_length_:
/* Fortran front end options ignored when preprocessing only. */
@@ -1183,8 +1172,8 @@ c_common_init (void)
if (flag_preprocess_only)
{
- finish_options (in_fnames[0]);
- preprocess_file (parse_in);
+ if (finish_options (in_fnames[0]))
+ preprocess_file (parse_in);
return false;
}
@@ -1220,7 +1209,8 @@ c_common_parse_file (int set_yydebug ATTRIBUTE_UNUSED)
cpp_undef_all (parse_in);
}
- finish_options(in_fnames[file_index]);
+ if (! finish_options(in_fnames[file_index]))
+ break;
if (file_index == 0)
pch_init();
c_parse_file ();
@@ -1387,10 +1377,14 @@ add_prefixed_path (const char *suffix, size_t chain)
/* Handle -D, -U, -A, -imacros, and the first -include.
TIF is the input file to which we will return after processing all
- the includes. */
-static void
+ the includes. Returns true on success. */
+static bool
finish_options (const char *tif)
{
+ this_input_filename = tif;
+ if (! cpp_find_main_file (parse_in, this_input_filename))
+ return false;
+
if (!cpp_opts->preprocessed)
{
size_t i;
@@ -1435,14 +1429,17 @@ finish_options (const char *tif)
if (opt->code == OPT_imacros
&& cpp_push_include (parse_in, opt->arg))
- cpp_scan_nooutput (parse_in);
+ {
+ /* Disable push_command_line_include callback for now. */
+ include_cursor = deferred_count + 1;
+ cpp_scan_nooutput (parse_in);
+ }
}
}
include_cursor = 0;
- this_input_filename = tif;
- cpp_find_main_file (parse_in, this_input_filename);
push_command_line_include ();
+ return true;
}
/* Give CPP the next file given by -include, if any. */
diff --git a/gcc/c-parse.in b/gcc/c-parse.in
index 22bab99077a..954c37067ff 100644
--- a/gcc/c-parse.in
+++ b/gcc/c-parse.in
@@ -1372,7 +1372,11 @@ typespec_nonreserved_nonattr:
{ $$ = get_object_reference ($1); }
@@end_ifobjc
| typeof '(' expr ')'
- { skip_evaluation--; $$ = TREE_TYPE ($3); }
+ { skip_evaluation--;
+ if (TREE_CODE ($3) == COMPONENT_REF
+ && DECL_C_BIT_FIELD (TREE_OPERAND ($3, 1)))
+ error ("`typeof' applied to a bit-field");
+ $$ = TREE_TYPE ($3); }
| typeof '(' typename ')'
{ skip_evaluation--; $$ = groktypename ($3); }
;
@@ -2053,12 +2057,12 @@ pushlevel: /* empty */
;
poplevel: /* empty */
- {
+ {
@@ifobjc
if (c_dialect_objc ())
objc_clear_super_receiver ();
@@end_ifobjc
- $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
+ $$ = add_scope_stmt (/*begin_p=*/0, /*partial_p=*/0);
}
;
@@ -2202,6 +2206,7 @@ do_stmt_start:
DO
{ stmt_count++;
compstmt_count++;
+ c_in_iteration_stmt++;
$<ttype>$
= add_stmt (build_stmt (DO_STMT, NULL_TREE,
NULL_TREE));
@@ -2212,7 +2217,8 @@ do_stmt_start:
DO_COND ($<ttype>$) = error_mark_node; }
c99_block_lineno_labeled_stmt WHILE
{ $$ = $<ttype>2;
- RECHAIN_STMTS ($$, DO_BODY ($$)); }
+ RECHAIN_STMTS ($$, DO_BODY ($$));
+ c_in_iteration_stmt--; }
;
/* The forced readahead in here is because we might be at the end of a
@@ -2295,12 +2301,14 @@ select_or_iter_stmt:
{ stmt_count++;
$<ttype>$ = c_begin_while_stmt (); }
'(' expr ')'
- { $4 = c_common_truthvalue_conversion ($4);
+ { c_in_iteration_stmt++;
+ $4 = c_common_truthvalue_conversion ($4);
c_finish_while_stmt_cond
(c_common_truthvalue_conversion ($4), $<ttype>2);
$<ttype>$ = add_stmt ($<ttype>2); }
c99_block_lineno_labeled_stmt
- { RECHAIN_STMTS ($<ttype>6, WHILE_BODY ($<ttype>6)); }
+ { c_in_iteration_stmt--;
+ RECHAIN_STMTS ($<ttype>6, WHILE_BODY ($<ttype>6)); }
| do_stmt_start
'(' expr ')' ';'
{ DO_COND ($1) = c_common_truthvalue_conversion ($3); }
@@ -2318,14 +2326,18 @@ select_or_iter_stmt:
FOR_COND ($<ttype>2)
= c_common_truthvalue_conversion ($6); }
xexpr ')'
- { FOR_EXPR ($<ttype>2) = $9; }
+ { c_in_iteration_stmt++;
+ FOR_EXPR ($<ttype>2) = $9; }
c99_block_lineno_labeled_stmt
- { RECHAIN_STMTS ($<ttype>2, FOR_BODY ($<ttype>2)); }
+ { RECHAIN_STMTS ($<ttype>2, FOR_BODY ($<ttype>2));
+ c_in_iteration_stmt--;}
| SWITCH '(' expr ')'
{ stmt_count++;
- $<ttype>$ = c_start_case ($3); }
+ $<ttype>$ = c_start_case ($3);
+ c_in_case_stmt++; }
c99_block_lineno_labeled_stmt
- { c_finish_case (); }
+ { c_finish_case ();
+ c_in_case_stmt--; }
;
for_init_stmt:
@@ -2348,9 +2360,21 @@ stmt:
$$ = NULL_TREE; }
| BREAK ';'
{ stmt_count++;
+ if (!(c_in_iteration_stmt || c_in_case_stmt))
+ {
+ error ("break statement not within loop or switch");
+ $$ = NULL_TREE;
+ }
+ else
$$ = add_stmt (build_break_stmt ()); }
| CONTINUE ';'
{ stmt_count++;
+ if (!c_in_iteration_stmt)
+ {
+ error ("continue statement not within a loop");
+ $$ = NULL_TREE;
+ }
+ else
$$ = add_stmt (build_continue_stmt ()); }
| RETURN ';'
{ stmt_count++;
@@ -2397,18 +2421,18 @@ stmt:
{ $$ = NULL_TREE; }
@@ifobjc
| AT_THROW expr ';'
- { stmt_count++;
- $$ = objc_build_throw_stmt ($2);
+ { stmt_count++;
+ $$ = objc_build_throw_stmt ($2);
}
| AT_THROW ';'
- { stmt_count++;
- $$ = objc_build_throw_stmt (NULL_TREE);
+ { stmt_count++;
+ $$ = objc_build_throw_stmt (NULL_TREE);
}
- | objc_try_catch_stmt
+ | objc_try_catch_stmt
{ objc_build_finally_prologue (); }
objc_finally_block
{ $$ = objc_build_try_catch_finally_stmt ($1, $3); }
- | AT_SYNCHRONIZED '(' expr ')'
+ | AT_SYNCHRONIZED '(' expr ')'
{ objc_build_synchronized_prologue ($3); }
compstmt
{ $$ = objc_build_synchronized_epilogue (); }
@@ -2425,18 +2449,18 @@ objc_try_catch_stmt:
objc_try_stmt:
- AT_TRY
+ AT_TRY
{ objc_build_try_prologue (); }
- compstmt
+ compstmt
;
-
+
objc_catch_list:
objc_catch_list objc_catch_block
| objc_catch_block
;
objc_catch_block:
- AT_CATCH '(' parm ')'
+ AT_CATCH '(' parm ')'
{ objc_build_catch_stmt ($3); }
compstmt
{ stmt_count++; }
@@ -3460,6 +3484,7 @@ static const short rid_to_yy[RID_MAX] =
/* RID_FALSE */ 0,
/* RID_NAMESPACE */ 0,
/* RID_NEW */ 0,
+ /* RID_OFFSETOF */ 0,
/* RID_OPERATOR */ 0,
/* RID_THIS */ 0,
/* RID_THROW */ 0,
@@ -3527,28 +3552,7 @@ init_reswords (void)
static void
yyerror (const char *msgid)
{
- const char *string = _(msgid);
-
- if (last_token == CPP_EOF)
- error ("%s at end of input", string);
- else if (last_token == CPP_CHAR || last_token == CPP_WCHAR)
- {
- unsigned int val = TREE_INT_CST_LOW (yylval.ttype);
- const char *const ell = (last_token == CPP_CHAR) ? "" : "L";
- if (val <= UCHAR_MAX && ISGRAPH (val))
- error ("%s before %s'%c'", string, ell, val);
- else
- error ("%s before %s'\\x%x'", string, ell, val);
- }
- else if (last_token == CPP_STRING
- || last_token == CPP_WSTRING)
- error ("%s before string constant", string);
- else if (last_token == CPP_NUMBER)
- error ("%s before numeric constant", string);
- else if (last_token == CPP_NAME)
- error ("%s before \"%s\"", string, IDENTIFIER_POINTER (yylval.ttype));
- else
- error ("%s before '%s' token", string, NAME(last_token));
+ c_parse_error (msgid, last_token, yylval.ttype);
}
static int
@@ -3689,7 +3693,7 @@ _yylex (void)
case CPP_STRING:
case CPP_WSTRING:
return STRING;
-
+
case CPP_OBJC_STRING:
return OBJC_STRING;
diff --git a/gcc/c-pch.c b/gcc/c-pch.c
index 2a29075d5a3..157061f9177 100644
--- a/gcc/c-pch.c
+++ b/gcc/c-pch.c
@@ -102,13 +102,14 @@ pch_init (void)
FILE *f;
struct c_pch_validity v;
void *target_validity;
+ static const char partial_pch[IDENT_LENGTH] = "gpcWrite";
if (! pch_file)
return;
f = fopen (pch_file, "w+b");
if (f == NULL)
- fatal_error ("can't open %s: %m", pch_file);
+ fatal_error ("can't create precompiled header %s: %m", pch_file);
pch_outfile = f;
if (strlen (host_machine) > 255 || strlen (target_machine) > 255
@@ -122,7 +123,7 @@ pch_init (void)
v.pch_init = &pch_init;
target_validity = targetm.get_pch_validity (&v.target_data_length);
- if (fwrite (get_ident(), IDENT_LENGTH, 1, f) != 1
+ if (fwrite (partial_pch, IDENT_LENGTH, 1, f) != 1
|| fwrite (&v, sizeof (v), 1, f) != 1
|| fwrite (host_machine, v.host_machine_length, 1, f) != 1
|| fwrite (target_machine, v.target_machine_length, 1, f) != 1
@@ -189,6 +190,10 @@ c_common_write_pch (void)
gt_pch_save (pch_outfile);
cpp_write_pch_state (parse_in, pch_outfile);
+ if (fseek (pch_outfile, 0, SEEK_SET) != 0
+ || fwrite (get_ident (), IDENT_LENGTH, 1, pch_outfile) != 1)
+ fatal_error ("can't write %s: %m", pch_file);
+
fclose (pch_outfile);
}
@@ -225,15 +230,15 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
if (memcmp (ident, pch_ident, 5) == 0)
/* It's a PCH, for the right language, but has the wrong version.
*/
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: not compatible with this GCC version", name);
else if (memcmp (ident, pch_ident, 4) == 0)
/* It's a PCH for the wrong language. */
- cpp_error (pfile, DL_WARNING, "%s: not for %s", name,
+ cpp_error (pfile, CPP_DL_WARNING, "%s: not for %s", name,
lang_hooks.name);
else
/* Not any kind of PCH. */
- cpp_error (pfile, DL_WARNING, "%s: not a PCH file", name);
+ cpp_error (pfile, CPP_DL_WARNING, "%s: not a PCH file", name);
}
return 2;
}
@@ -251,7 +256,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
|| memcmp (host_machine, short_strings, strlen (host_machine)) != 0)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: created on host `%.*s', but used on host `%s'", name,
v.host_machine_length, short_strings, host_machine);
return 2;
@@ -261,7 +266,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
strlen (target_machine)) != 0)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: created for target `%.*s', but used for target `%s'",
name, v.target_machine_length,
short_strings + v.host_machine_length, target_machine);
@@ -274,7 +279,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
v.version_length) != 0)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: created by version `%.*s', but this is version `%s'",
name, v.version_length,
(short_strings + v.host_machine_length
@@ -290,7 +295,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
&& write_symbols != NO_DEBUG)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: created with -g%s, but used with -g%s", name,
debug_type_names[v.debug_info_type],
debug_type_names[write_symbols]);
@@ -304,7 +309,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
if (v.pch_init != &pch_init)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"%s: had text segment at different address", name);
return 2;
}
@@ -322,7 +327,7 @@ c_common_valid_pch (cpp_reader *pfile, const char *name, int fd)
if (msg != NULL)
{
if (cpp_get_options (pfile)->warn_invalid_pch)
- cpp_error (pfile, DL_WARNING, "%s: %s", name, msg);
+ cpp_error (pfile, CPP_DL_WARNING, "%s: %s", name, msg);
return 2;
}
}
@@ -353,7 +358,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
f = fdopen (fd, "rb");
if (f == NULL)
{
- cpp_errno (pfile, DL_ERROR, "calling fdopen");
+ cpp_errno (pfile, CPP_DL_ERROR, "calling fdopen");
return;
}
@@ -361,7 +366,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
if (fread (&h, sizeof (h), 1, f) != 1)
{
- cpp_errno (pfile, DL_ERROR, "reading");
+ cpp_errno (pfile, CPP_DL_ERROR, "reading");
return;
}
@@ -373,7 +378,7 @@ c_common_read_pch (cpp_reader *pfile, const char *name,
size = 16384;
if (fread (buf, size, 1, f) != 1
|| fwrite (buf, size, 1, asm_out_file) != 1)
- cpp_errno (pfile, DL_ERROR, "reading");
+ cpp_errno (pfile, CPP_DL_ERROR, "reading");
written += size;
}
free (buf);
diff --git a/gcc/c-pragma.c b/gcc/c-pragma.c
index 141b9061cef..e233a5e35fd 100644
--- a/gcc/c-pragma.c
+++ b/gcc/c-pragma.c
@@ -382,7 +382,7 @@ handle_pragma_redefine_extname (cpp_reader *dummy ATTRIBUTE_UNUSED)
if (DECL_ASSEMBLER_NAME_SET_P (decl)
&& DECL_ASSEMBLER_NAME (decl) != newname)
warning ("#pragma redefine_extname conflicts with declaration");
- SET_DECL_ASSEMBLER_NAME (decl, newname);
+ change_decl_assembler_name (decl, newname);
}
else
add_to_renaming_pragma_list(oldname, newname);
diff --git a/gcc/c-pretty-print.c b/gcc/c-pretty-print.c
index b2161b0b6a3..1c1f77bcd74 100644
--- a/gcc/c-pretty-print.c
+++ b/gcc/c-pretty-print.c
@@ -1106,7 +1106,7 @@ pp_c_initializer_list (c_pretty_printer *pp, tree e)
}
}
-/* Pretty-print a brace-enclosed initializer-list. */
+/* Pretty-print a brace-enclosed initializer-list. */
static void
pp_c_brace_enclosed_initializer_list (c_pretty_printer *pp, tree l)
@@ -1246,7 +1246,7 @@ pp_c_postfix_expression (c_pretty_printer *pp, tree e)
}
}
-/* Print out an expression-list; E is expected to be a TREE_LIST */
+/* Print out an expression-list; E is expected to be a TREE_LIST. */
void
pp_c_expression_list (c_pretty_printer *pp, tree e)
@@ -1259,7 +1259,7 @@ pp_c_expression_list (c_pretty_printer *pp, tree e)
}
}
-/* Print out an expression-list in parens, as in a function call. */
+/* Print out an expression-list in parens, as in a function call. */
void
pp_c_call_argument_list (c_pretty_printer *pp, tree t)
@@ -1820,7 +1820,7 @@ pp_c_expression (c_pretty_printer *pp, tree e)
/* statement:
labeled-statement
- coumpound-statement
+ compound-statement
expression-statement
selection-statement
iteration-statement
@@ -1870,7 +1870,7 @@ pp_c_statement (c_pretty_printer *pp, tree stmt)
pp_needs_newline (pp) = true;
break;
- /* coumpound-statement:
+ /* compound-statement:
{ block-item-list(opt) }
block-item-list:
diff --git a/gcc/c-semantics.c b/gcc/c-semantics.c
index a3e1b45343c..f3c61b42c35 100644
--- a/gcc/c-semantics.c
+++ b/gcc/c-semantics.c
@@ -592,7 +592,7 @@ genrtl_break_stmt (void)
{
emit_line_note (input_location);
if ( ! expand_exit_something ())
- error ("break statement not within loop or switch");
+ abort ();
}
/* Build a continue statement node and return it. */
@@ -610,7 +610,7 @@ genrtl_continue_stmt (void)
{
emit_line_note (input_location);
if (! expand_continue_loop (0))
- error ("continue statement not within a loop");
+ abort ();
}
/* Generate the RTL for T, which is a SCOPE_STMT. */
diff --git a/gcc/c-tree.h b/gcc/c-tree.h
index 96faf84ac9b..4849ab2dd55 100644
--- a/gcc/c-tree.h
+++ b/gcc/c-tree.h
@@ -44,12 +44,12 @@ struct lang_identifier GTY(())
/* The resulting tree type. */
-union lang_tree_node
+union lang_tree_node
GTY((desc ("TREE_CODE (&%h.generic) == IDENTIFIER_NODE"),
chain_next ("TREE_CODE (&%h.generic) == INTEGER_TYPE ? (union lang_tree_node *)TYPE_NEXT_VARIANT (&%h.generic) : (union lang_tree_node *)TREE_CHAIN (&%h.generic)")))
{
- union tree_node GTY ((tag ("0"),
- desc ("tree_node_structure (&%h)")))
+ union tree_node GTY ((tag ("0"),
+ desc ("tree_node_structure (&%h)")))
generic;
struct lang_identifier GTY ((tag ("1"))) identifier;
};
@@ -106,7 +106,7 @@ struct lang_decl GTY(())
/* In a RECORD_TYPE, a sorted array of the fields of the type. */
struct lang_type GTY(())
{
- struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
+ struct sorted_fields_type * GTY ((reorder ("resort_sorted_fields"))) s;
};
/* Record whether a type or decl was written with nonconstant size.
@@ -152,6 +152,22 @@ struct lang_type GTY(())
#define KEEP_YES 1
#define KEEP_MAYBE 2
+/* 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 language_function GTY(())
+{
+ struct c_language_function base;
+ int returns_value;
+ int returns_null;
+ int returns_abnormally;
+ int warn_about_return_type;
+ int extern_inline;
+ int x_in_iteration_stmt;
+ int x_in_case_stmt;
+};
+
/* in c-parse.in */
extern void c_parse_init (void);
@@ -160,6 +176,9 @@ extern void c_parse_init (void);
extern void gen_aux_info_record (tree, int, int, int);
/* in c-decl.c */
+extern int c_in_iteration_stmt;
+extern int c_in_case_stmt;
+
extern int global_bindings_p (void);
extern tree getdecls (void);
extern void pushlevel (int);
@@ -273,7 +292,7 @@ extern tree c_start_case (tree);
extern void c_finish_case (void);
extern tree simple_asm_stmt (tree);
extern tree build_asm_stmt (tree, tree, tree, tree, tree);
-extern tree c_convert_parm_for_inlining (tree, tree, tree);
+extern tree c_convert_parm_for_inlining (tree, tree, tree, int);
/* Set to 0 at beginning of a function definition, set to 1 if
a return statement that specifies a return value is seen. */
diff --git a/gcc/c-typeck.c b/gcc/c-typeck.c
index 598e249d947..682cbc0585f 100644
--- a/gcc/c-typeck.c
+++ b/gcc/c-typeck.c
@@ -1645,6 +1645,7 @@ build_function_call (tree function, tree params)
tree fntype, fundecl = 0;
tree coerced_params;
tree name = NULL_TREE, result;
+ tree tem;
/* Strip NON_LVALUE_EXPRs, etc., since we aren't using as an lvalue. */
STRIP_TYPE_NOPS (function);
@@ -1684,6 +1685,47 @@ build_function_call (tree function, tree params)
/* fntype now gets the type of function pointed to. */
fntype = TREE_TYPE (fntype);
+ /* Check that the function is called through a compatible prototype.
+ If it is not, replace the call by a trap, wrapped up in a compound
+ expression if necessary. This has the nice side-effect to prevent
+ the tree-inliner from generating invalid assignment trees which may
+ blow up in the RTL expander later.
+
+ ??? This doesn't work for Objective-C because objc_comptypes
+ refuses to compare function prototypes, yet the compiler appears
+ to build calls that are flagged as invalid by C's comptypes. */
+ if (! c_dialect_objc ()
+ && TREE_CODE (function) == NOP_EXPR
+ && TREE_CODE (tem = TREE_OPERAND (function, 0)) == ADDR_EXPR
+ && TREE_CODE (tem = TREE_OPERAND (tem, 0)) == FUNCTION_DECL
+ && ! comptypes (fntype, TREE_TYPE (tem), COMPARE_STRICT))
+ {
+ tree return_type = TREE_TYPE (fntype);
+ tree trap = build_function_call (built_in_decls[BUILT_IN_TRAP],
+ NULL_TREE);
+
+ /* This situation leads to run-time undefined behavior. We can't,
+ therefore, simply error unless we can prove that all possible
+ executions of the program must execute the code. */
+ warning ("function called through a non-compatible type");
+
+ if (VOID_TYPE_P (return_type))
+ return trap;
+ else
+ {
+ tree rhs;
+
+ if (AGGREGATE_TYPE_P (return_type))
+ rhs = build_compound_literal (return_type,
+ build_constructor (return_type,
+ NULL_TREE));
+ else
+ rhs = fold (build1 (NOP_EXPR, return_type, integer_zero_node));
+
+ return build (COMPOUND_EXPR, return_type, trap, rhs);
+ }
+ }
+
/* Convert the parameters to the types declared in the
function prototype, or apply default promotions. */
@@ -2588,12 +2630,10 @@ pedantic_lvalue_warning (enum tree_code code)
switch (code)
{
case COND_EXPR:
- if (pedantic)
- pedwarn ("ISO C forbids use of conditional expressions as lvalues");
+ pedwarn ("use of conditional expressions as lvalues is deprecated");
break;
case COMPOUND_EXPR:
- if (pedantic)
- pedwarn ("ISO C forbids use of compound expressions as lvalues");
+ pedwarn ("use of compound expressions as lvalues is deprecated");
break;
default:
pedwarn ("use of cast expressions as lvalues is deprecated");
@@ -2904,11 +2944,6 @@ internal_build_compound_expr (tree list, int first_p)
&& ! (TREE_CODE (TREE_VALUE (list)) == CONVERT_EXPR
&& VOID_TYPE_P (TREE_TYPE (TREE_VALUE (list)))))
warning ("left-hand operand of comma expression has no effect");
-
- /* When pedantic, a compound expression can be neither an lvalue
- nor an integer constant expression. */
- if (! pedantic)
- return rest;
}
/* With -Wunused, we should also warn if the left-hand operand does have
@@ -3573,12 +3608,10 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
&& TREE_CODE (TREE_TYPE (rhs)) == INTEGER_TYPE
&& TREE_CODE (TREE_OPERAND (rhs, 0)) == INTEGER_CST
&& integer_zerop (TREE_OPERAND (rhs, 0))))
- {
warn_for_assignment ("%s makes pointer from integer without a cast",
errtype, funname, parmnum);
- return convert (type, rhs);
- }
- return null_pointer_node;
+
+ return convert (type, rhs);
}
else if (codel == INTEGER_TYPE && coder == POINTER_TYPE)
{
@@ -3612,10 +3645,12 @@ convert_for_assignment (tree type, tree rhs, const char *errtype,
return error_mark_node;
}
-/* Convert VALUE for assignment into inlined parameter PARM. */
+/* Convert VALUE for assignment into inlined parameter PARM. ARGNUM
+ is used for error and waring reporting and indicates which argument
+ is being processed. */
tree
-c_convert_parm_for_inlining (tree parm, tree value, tree fn)
+c_convert_parm_for_inlining (tree parm, tree value, tree fn, int argnum)
{
tree ret, type;
@@ -3627,7 +3662,7 @@ c_convert_parm_for_inlining (tree parm, tree value, tree fn)
type = TREE_TYPE (parm);
ret = convert_for_assignment (type, value,
(char *) 0 /* arg passing */, fn,
- DECL_NAME (fn), 0);
+ DECL_NAME (fn), argnum);
if (targetm.calls.promote_prototypes (TREE_TYPE (fn))
&& INTEGRAL_TYPE_P (type)
&& (TYPE_PRECISION (type) < TYPE_PRECISION (integer_type_node)))
@@ -5647,7 +5682,7 @@ output_pending_init_elements (int all)
retry:
- /* Look thru the whole pending tree.
+ /* Look through the whole pending tree.
If we find an element that should be output now,
output it. Otherwise, set NEXT to the element
that comes first among those still pending. */
diff --git a/gcc/caller-save.c b/gcc/caller-save.c
index d40c8d99be1..7133fe393ab 100644
--- a/gcc/caller-save.c
+++ b/gcc/caller-save.c
@@ -408,7 +408,7 @@ save_call_clobbered_regs (void)
regno += insert_restore (chain, 1, regno, MOVE_MAX_WORDS, save_mode);
}
- if (code == CALL_INSN)
+ if (code == CALL_INSN && ! find_reg_note (insn, REG_NORETURN, NULL))
{
int regno;
HARD_REG_SET hard_regs_to_save;
@@ -568,8 +568,10 @@ mark_referenced_regs (rtx x)
{
x = SET_DEST (x);
code = GET_CODE (x);
- if (code == REG || code == PC || code == CC0
+ if ((code == REG && REGNO (x) < FIRST_PSEUDO_REGISTER)
+ || code == PC || code == CC0
|| (code == SUBREG && GET_CODE (SUBREG_REG (x)) == REG
+ && REGNO (SUBREG_REG (x)) < FIRST_PSEUDO_REGISTER
/* If we're setting only part of a multi-word register,
we shall mark it as referenced, because the words
that are not being set should be restored. */
@@ -697,7 +699,7 @@ insert_restore (struct insn_chain *chain, int before_p, int regno,
n_regs_saved--;
}
- /* Tell our callers how many extra registers we saved/restored */
+ /* Tell our callers how many extra registers we saved/restored. */
return numregs - 1;
}
@@ -769,7 +771,7 @@ insert_save (struct insn_chain *chain, int before_p, int regno,
n_regs_saved++;
}
- /* Tell our callers how many extra registers we saved/restored */
+ /* Tell our callers how many extra registers we saved/restored. */
return numregs - 1;
}
@@ -832,8 +834,8 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
}
}
CLEAR_REG_SET (&new->dead_or_set);
- if (chain->insn == BLOCK_HEAD (chain->block))
- BLOCK_HEAD (chain->block) = new->insn;
+ if (chain->insn == BB_HEAD (BASIC_BLOCK (chain->block)))
+ BB_HEAD (BASIC_BLOCK (chain->block)) = new->insn;
}
else
{
@@ -852,8 +854,8 @@ insert_one_insn (struct insn_chain *chain, int before_p, int code, rtx pat)
note_stores (PATTERN (chain->insn), add_stored_regs,
&new->live_throughout);
CLEAR_REG_SET (&new->dead_or_set);
- if (chain->insn == BLOCK_END (chain->block))
- BLOCK_END (chain->block) = new->insn;
+ if (chain->insn == BB_END (BASIC_BLOCK (chain->block)))
+ BB_END (BASIC_BLOCK (chain->block)) = new->insn;
}
new->block = chain->block;
new->is_caller_save_insn = 1;
diff --git a/gcc/calls.c b/gcc/calls.c
index 18df59a92c2..244aa4cb73e 100644
--- a/gcc/calls.c
+++ b/gcc/calls.c
@@ -133,7 +133,8 @@ static int compute_argument_block_size (int, struct args_size *, int);
static void initialize_argument_information (int, struct arg_data *,
struct args_size *, int, tree,
tree, CUMULATIVE_ARGS *, int,
- rtx *, int *, int *, int *);
+ rtx *, int *, int *, int *,
+ bool);
static void compute_argument_addresses (struct arg_data *, rtx, int);
static rtx rtx_for_function_call (tree, tree);
static void load_register_parameters (struct arg_data *, int, rtx *, int,
@@ -148,6 +149,7 @@ static int check_sibcall_argument_overlap (rtx, struct arg_data *, int);
static int combine_pending_stack_adjustment_and_call (int, struct args_size *,
int);
static tree fix_unsafe_tree (tree);
+static bool shift_returned_value (tree, rtx *);
#ifdef REG_PARM_STACK_SPACE
static rtx save_fixed_argument_area (int, rtx, int *, int *);
@@ -289,7 +291,7 @@ prepare_call_address (rtx funexp, tree fndecl, rtx *call_fusage,
/* Get possible static chain value for nested function in C. */
static_chain_value = lookup_static_chain (fndecl);
- /* Make a valid memory address and copy constants thru pseudo-regs,
+ /* Make a valid memory address and copy constants through pseudo-regs,
but not for a constant address if -fno-function-cse. */
if (GET_CODE (funexp) != SYMBOL_REF)
/* If we are using registers for parameters, force the
@@ -744,6 +746,28 @@ flags_from_decl_or_type (tree exp)
return flags;
}
+/* Detect flags from a CALL_EXPR. */
+
+int
+call_expr_flags (tree t)
+{
+ int flags;
+ tree decl = get_callee_fndecl (t);
+
+ if (decl)
+ flags = flags_from_decl_or_type (decl);
+ else
+ {
+ t = TREE_TYPE (TREE_OPERAND (t, 0));
+ if (t && TREE_CODE (t) == POINTER_TYPE)
+ flags = flags_from_decl_or_type (TREE_TYPE (t));
+ else
+ flags = 0;
+ }
+
+ return flags;
+}
+
/* Precompute all register parameters as described by ARGS, storing values
into fields within the ARGS array.
@@ -1000,7 +1024,10 @@ store_unaligned_arguments_into_pseudos (struct arg_data *args, int num_actuals)
and may be modified by this routine.
OLD_PENDING_ADJ, MUST_PREALLOCATE and FLAGS are pointers to integer
- flags which may may be modified by this routine. */
+ flags which may may be modified by this routine.
+
+ CALL_FROM_THUNK_P is true if this call is the jump from a thunk to
+ the thunked-to function. */
static void
initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
@@ -1011,7 +1038,8 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
CUMULATIVE_ARGS *args_so_far,
int reg_parm_stack_space,
rtx *old_stack_level, int *old_pending_adj,
- int *must_preallocate, int *ecf_flags)
+ int *must_preallocate, int *ecf_flags,
+ bool call_from_thunk_p)
{
/* 1 if scanning parms front to back, -1 if scanning back to front. */
int inc;
@@ -1084,7 +1112,7 @@ initialize_argument_information (int num_actuals ATTRIBUTE_UNUSED,
{
/* If we're compiling a thunk, pass through invisible
references instead of making a copy. */
- if (current_function_is_thunk
+ if (call_from_thunk_p
#ifdef FUNCTION_ARG_CALLEE_COPIES
|| (FUNCTION_ARG_CALLEE_COPIES (*args_so_far, TYPE_MODE (type),
type, argpos < n_named_args)
@@ -1578,11 +1606,7 @@ load_register_parameters (struct arg_data *args, int num_actuals,
{
int i, j;
-#ifdef LOAD_ARGS_REVERSED
- for (i = num_actuals - 1; i >= 0; i--)
-#else
for (i = 0; i < num_actuals; i++)
-#endif
{
rtx reg = ((flags & ECF_SIBCALL)
? args[i].tail_call_reg : args[i].reg);
@@ -2000,6 +2024,34 @@ fix_unsafe_tree (tree t)
return t;
}
+
+/* If function value *VALUE was returned at the most significant end of a
+ register, shift it towards the least significant end and convert it to
+ TYPE's mode. Return true and update *VALUE if some action was needed.
+
+ TYPE is the type of the function's return value, which is known not
+ to have mode BLKmode. */
+
+static bool
+shift_returned_value (tree type, rtx *value)
+{
+ if (targetm.calls.return_in_msb (type))
+ {
+ HOST_WIDE_INT shift;
+
+ shift = (GET_MODE_BITSIZE (GET_MODE (*value))
+ - BITS_PER_UNIT * int_size_in_bytes (type));
+ if (shift > 0)
+ {
+ *value = expand_binop (GET_MODE (*value), lshr_optab, *value,
+ GEN_INT (shift), 0, 1, OPTAB_WIDEN);
+ *value = convert_to_mode (TYPE_MODE (type), *value, 0);
+ return true;
+ }
+ }
+ return false;
+}
+
/* Generate all the code for a function call
and return an rtx for its value.
Store the value in TARGET (specified as an rtx) if convenient.
@@ -2101,6 +2153,7 @@ expand_call (tree exp, rtx target, int ignore)
#endif
int initial_highest_arg_in_use = highest_outgoing_arg_in_use;
+ rtx temp_target = 0;
char *initial_stack_usage_map = stack_usage_map;
int old_stack_allocated;
@@ -2361,15 +2414,16 @@ expand_call (tree exp, rtx target, int ignore)
(If no anonymous args follow, the result of list_length is actually
one too large. This is harmless.)
- If PRETEND_OUTGOING_VARARGS_NAMED is set and STRICT_ARGUMENT_NAMING is
- zero, this machine will be able to place unnamed args that were
- passed in registers into the stack. So treat all args as named.
- This allows the insns emitting for a specific argument list to be
- independent of the function declaration.
+ If targetm.calls.pretend_outgoing_varargs_named() returns
+ nonzero, and STRICT_ARGUMENT_NAMING is zero, this machine will be
+ able to place unnamed args that were passed in registers into the
+ stack. So treat all args as named. This allows the insns
+ emitting for a specific argument list to be independent of the
+ function declaration.
- If PRETEND_OUTGOING_VARARGS_NAMED is not set, we do not have any
- reliable way to pass unnamed args in registers, so we must force
- them into memory. */
+ If targetm.calls.pretend_outgoing_varargs_named() returns zero,
+ we do not have any reliable way to pass unnamed args in
+ registers, so we must force them into memory. */
if ((targetm.calls.strict_argument_naming (&args_so_far)
|| ! targetm.calls.pretend_outgoing_varargs_named (&args_so_far))
@@ -2394,7 +2448,8 @@ expand_call (tree exp, rtx target, int ignore)
n_named_args, actparms, fndecl,
&args_so_far, reg_parm_stack_space,
&old_stack_level, &old_pending_adj,
- &must_preallocate, &flags);
+ &must_preallocate, &flags,
+ CALL_FROM_THUNK_P (exp));
if (args_size.var)
{
@@ -2433,11 +2488,15 @@ expand_call (tree exp, rtx target, int ignore)
finished with regular parsing. Which means that some of the
machinery we use to generate tail-calls is no longer in place.
This is most often true of sjlj-exceptions, which we couldn't
- tail-call to anyway. */
+ tail-call to anyway.
+ If current_nesting_level () == 0, we're being called after
+ the function body has been expanded. This can happen when
+ setting up trampolines in expand_function_end. */
if (currently_expanding_call++ != 0
|| !flag_optimize_sibling_calls
|| !rtx_equal_function_value_matters
+ || current_nesting_level () == 0
|| any_pending_cleanups ()
|| args_size.var)
try_tail_call = try_tail_recursion = 0;
@@ -3097,22 +3156,33 @@ expand_call (tree exp, rtx target, int ignore)
mark_reg_pointer (temp,
TYPE_ALIGN (TREE_TYPE (TREE_TYPE (exp))));
- /* Construct an "equal form" for the value which mentions all the
- arguments in order as well as the function name. */
- for (i = 0; i < num_actuals; i++)
- note = gen_rtx_EXPR_LIST (VOIDmode,
- args[i].initial_value, note);
- note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
-
end_sequence ();
-
- if (flags & ECF_PURE)
- note = gen_rtx_EXPR_LIST (VOIDmode,
+ if (flag_unsafe_math_optimizations
+ && fndecl
+ && DECL_BUILT_IN (fndecl)
+ && (DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRT
+ || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTF
+ || DECL_FUNCTION_CODE (fndecl) == BUILT_IN_SQRTL))
+ note = gen_rtx_fmt_e (SQRT,
+ GET_MODE (temp),
+ args[0].initial_value);
+ else
+ {
+ /* Construct an "equal form" for the value which
+ mentions all the arguments in order as well as
+ the function name. */
+ for (i = 0; i < num_actuals; i++)
+ note = gen_rtx_EXPR_LIST (VOIDmode,
+ args[i].initial_value, note);
+ note = gen_rtx_EXPR_LIST (VOIDmode, funexp, note);
+
+ if (flags & ECF_PURE)
+ note = gen_rtx_EXPR_LIST (VOIDmode,
gen_rtx_USE (VOIDmode,
gen_rtx_MEM (BLKmode,
gen_rtx_SCRATCH (VOIDmode))),
note);
-
+ }
emit_libcall_block (insns, temp, valreg, note);
valreg = temp;
@@ -3215,7 +3285,11 @@ expand_call (tree exp, rtx target, int ignore)
The Irix 6 ABI has examples of this. */
else if (GET_CODE (valreg) == PARALLEL)
{
- if (target == 0)
+ /* Second condition is added because "target" is freed at the
+ the end of "pass0" for -O2 when call is made to
+ expand_end_target_temps (). Its "in_use" flag has been set
+ to false, so allocate a new temp. */
+ if (target == 0 || (pass == 1 && target == temp_target))
{
/* This will only be assigned once, so it can be readonly. */
tree nt = build_qualified_type (TREE_TYPE (exp),
@@ -3223,6 +3297,7 @@ expand_call (tree exp, rtx target, int ignore)
| TYPE_QUAL_CONST));
target = assign_temp (nt, 0, 1, 1);
+ temp_target = target;
preserve_temp_slots (target);
}
@@ -3259,7 +3334,12 @@ expand_call (tree exp, rtx target, int ignore)
sibcall_failure = 1;
}
else
- target = copy_to_reg (valreg);
+ {
+ if (shift_returned_value (TREE_TYPE (exp), &valreg))
+ sibcall_failure = 1;
+
+ target = copy_to_reg (valreg);
+ }
if (targetm.calls.promote_function_return(funtype))
{
@@ -4559,9 +4639,18 @@ store_one_arg (struct arg_data *arg, rtx argblock, int flags,
{
/* PUSH_ROUNDING has no effect on us, because
emit_push_insn for BLKmode is careful to avoid it. */
- excess = (arg->locate.size.constant
- - int_size_in_bytes (TREE_TYPE (pval))
- + partial * UNITS_PER_WORD);
+ if (reg && GET_CODE (reg) == PARALLEL)
+ {
+ /* Use the size of the elt to compute excess. */
+ rtx elt = XEXP (XVECEXP (reg, 0, 0), 0);
+ excess = (arg->locate.size.constant
+ - int_size_in_bytes (TREE_TYPE (pval))
+ + partial * GET_MODE_SIZE (GET_MODE (elt)));
+ }
+ else
+ excess = (arg->locate.size.constant
+ - int_size_in_bytes (TREE_TYPE (pval))
+ + partial * UNITS_PER_WORD);
size_rtx = expand_expr (size_in_bytes (TREE_TYPE (pval)),
NULL_RTX, TYPE_MODE (sizetype), 0);
}
diff --git a/gcc/cfg.c b/gcc/cfg.c
index ded0e3263fb..96dac25d0ac 100644
--- a/gcc/cfg.c
+++ b/gcc/cfg.c
@@ -111,6 +111,7 @@ struct basic_block_def entry_exit_blocks[2]
EXIT_BLOCK_PTR, /* next_bb */
0, /* loop_depth */
NULL, /* loop_father */
+ { NULL, NULL }, /* dom */
0, /* count */
0, /* frequency */
0, /* flags */
@@ -133,6 +134,7 @@ struct basic_block_def entry_exit_blocks[2]
NULL, /* next_bb */
0, /* loop_depth */
NULL, /* loop_father */
+ { NULL, NULL }, /* dom */
0, /* count */
0, /* frequency */
0, /* flags */
@@ -543,7 +545,7 @@ dump_flow_info (FILE *file)
gcov_type lsum;
fprintf (file, "\nBasic block %d: first insn %d, last %d, ",
- bb->index, INSN_UID (bb->head), INSN_UID (bb->end));
+ bb->index, INSN_UID (BB_HEAD (bb)), INSN_UID (BB_END (bb)));
fprintf (file, "prev %d, next %d, ",
bb->prev_bb->index, bb->next_bb->index);
fprintf (file, "loop_depth %d, count ", bb->loop_depth);
diff --git a/gcc/cfganal.c b/gcc/cfganal.c
index e45b48465e2..91297e53daa 100644
--- a/gcc/cfganal.c
+++ b/gcc/cfganal.c
@@ -89,7 +89,7 @@ forwarder_block_p (basic_block bb)
|| !bb->succ || bb->succ->succ_next)
return false;
- for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))
if (INSN_P (insn) && flow_active_insn_p (insn))
return false;
@@ -103,8 +103,8 @@ forwarder_block_p (basic_block bb)
bool
can_fallthru (basic_block src, basic_block target)
{
- rtx insn = src->end;
- rtx insn2 = target == EXIT_BLOCK_PTR ? NULL : target->head;
+ rtx insn = BB_END (src);
+ rtx insn2 = target == EXIT_BLOCK_PTR ? NULL : BB_HEAD (target);
if (src->next_bb != target)
return 0;
@@ -232,11 +232,11 @@ set_edge_can_fallthru_flag (void)
CAN_FALLTHRU edges. */
if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next)
continue;
- if (!any_condjump_p (bb->end))
+ if (!any_condjump_p (BB_END (bb)))
continue;
- if (!invert_jump (bb->end, JUMP_LABEL (bb->end), 0))
+ if (!invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0))
continue;
- invert_jump (bb->end, JUMP_LABEL (bb->end), 0);
+ invert_jump (BB_END (bb), JUMP_LABEL (BB_END (bb)), 0);
bb->succ->flags |= EDGE_CAN_FALLTHRU;
bb->succ->succ_next->flags |= EDGE_CAN_FALLTHRU;
}
@@ -305,10 +305,10 @@ flow_call_edges_add (sbitmap blocks)
if (check_last_block)
{
basic_block bb = EXIT_BLOCK_PTR->prev_bb;
- rtx insn = bb->end;
+ rtx insn = BB_END (bb);
/* Back up past insns that must be kept in the same block as a call. */
- while (insn != bb->head
+ while (insn != BB_HEAD (bb)
&& keep_with_call_p (insn))
insn = PREV_INSN (insn);
@@ -342,7 +342,7 @@ flow_call_edges_add (sbitmap blocks)
if (blocks && !TEST_BIT (blocks, i))
continue;
- for (insn = bb->end; ; insn = prev_insn)
+ for (insn = BB_END (bb); ; insn = prev_insn)
{
prev_insn = PREV_INSN (insn);
if (need_fake_edge_p (insn))
@@ -353,7 +353,7 @@ flow_call_edges_add (sbitmap blocks)
/* Don't split the block between a call and an insn that should
remain in the same block as the call. */
if (GET_CODE (insn) == CALL_INSN)
- while (split_at_insn != bb->end
+ while (split_at_insn != BB_END (bb)
&& keep_with_call_p (NEXT_INSN (split_at_insn)))
split_at_insn = NEXT_INSN (split_at_insn);
@@ -363,7 +363,7 @@ flow_call_edges_add (sbitmap blocks)
cause us to mark that edge as fake and remove it later. */
#ifdef ENABLE_CHECKING
- if (split_at_insn == bb->end)
+ if (split_at_insn == BB_END (bb))
for (e = bb->succ; e; e = e->succ_next)
if (e->dest == EXIT_BLOCK_PTR)
abort ();
@@ -371,7 +371,7 @@ flow_call_edges_add (sbitmap blocks)
/* Note that the following may create a new basic block
and renumber the existing basic blocks. */
- if (split_at_insn != bb->end)
+ if (split_at_insn != BB_END (bb))
{
e = split_block (bb, split_at_insn);
if (e)
@@ -381,7 +381,7 @@ flow_call_edges_add (sbitmap blocks)
make_edge (bb, EXIT_BLOCK_PTR, EDGE_FAKE);
}
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
break;
}
}
diff --git a/gcc/cfgbuild.c b/gcc/cfgbuild.c
index 1fb43605972..5805e587ec8 100644
--- a/gcc/cfgbuild.c
+++ b/gcc/cfgbuild.c
@@ -303,13 +303,14 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p
enum rtx_code code;
int force_fallthru = 0;
- if (GET_CODE (bb->head) == CODE_LABEL && LABEL_ALT_ENTRY_P (bb->head))
+ if (GET_CODE (BB_HEAD (bb)) == CODE_LABEL
+ && LABEL_ALT_ENTRY_P (BB_HEAD (bb)))
cached_make_edge (NULL, ENTRY_BLOCK_PTR, bb, 0);
/* Examine the last instruction of the block, and discover the
ways we can leave the block. */
- insn = bb->end;
+ insn = BB_END (bb);
code = GET_CODE (insn);
/* A branch. */
@@ -432,7 +433,7 @@ make_edges (rtx label_value_list, basic_block min, basic_block max, int update_p
cached_make_edge (edge_cache, bb, EXIT_BLOCK_PTR, EDGE_FALLTHRU);
else if (bb->next_bb != EXIT_BLOCK_PTR)
{
- if (force_fallthru || insn == bb->next_bb->head)
+ if (force_fallthru || insn == BB_HEAD (bb->next_bb))
cached_make_edge (edge_cache, bb, bb->next_bb, EDGE_FALLTHRU);
}
}
@@ -649,12 +650,12 @@ enum state {BLOCK_NEW = 0, BLOCK_ORIGINAL, BLOCK_TO_SPLIT};
static void
find_bb_boundaries (basic_block bb)
{
- rtx insn = bb->head;
- rtx end = bb->end;
+ rtx insn = BB_HEAD (bb);
+ rtx end = BB_END (bb);
rtx flow_transfer_insn = NULL_RTX;
edge fallthru = NULL;
- if (insn == bb->end)
+ if (insn == BB_END (bb))
return;
if (GET_CODE (insn) == CODE_LABEL)
@@ -670,7 +671,7 @@ find_bb_boundaries (basic_block bb)
{
fallthru = split_block (bb, PREV_INSN (insn));
if (flow_transfer_insn)
- bb->end = flow_transfer_insn;
+ BB_END (bb) = flow_transfer_insn;
bb = fallthru->dest;
remove_edge (fallthru);
@@ -684,7 +685,7 @@ find_bb_boundaries (basic_block bb)
if (flow_transfer_insn && inside_basic_block_p (insn))
{
fallthru = split_block (bb, PREV_INSN (insn));
- bb->end = flow_transfer_insn;
+ BB_END (bb) = flow_transfer_insn;
bb = fallthru->dest;
remove_edge (fallthru);
flow_transfer_insn = NULL_RTX;
@@ -701,7 +702,7 @@ find_bb_boundaries (basic_block bb)
return and barrier, or possibly other sequence not behaving like
ordinary jump, we need to take care and move basic block boundary. */
if (flow_transfer_insn)
- bb->end = flow_transfer_insn;
+ BB_END (bb) = flow_transfer_insn;
/* We've possibly replaced the conditional jump by conditional jump
followed by cleanup at fallthru edge, so the outgoing edges may
@@ -719,7 +720,7 @@ compute_outgoing_frequencies (basic_block b)
if (b->succ && b->succ->succ_next && !b->succ->succ_next->succ_next)
{
- rtx note = find_reg_note (b->end, REG_BR_PROB, NULL);
+ rtx note = find_reg_note (BB_END (b), REG_BR_PROB, NULL);
int probability;
if (!note)
diff --git a/gcc/cfgcleanup.c b/gcc/cfgcleanup.c
index 32a9e653228..056a32f4faa 100644
--- a/gcc/cfgcleanup.c
+++ b/gcc/cfgcleanup.c
@@ -129,7 +129,7 @@ try_simplify_condjump (basic_block cbranch_block)
/* Verify that we've got a normal conditional branch at the end
of the block. */
- cbranch_insn = cbranch_block->end;
+ cbranch_insn = BB_END (cbranch_block);
if (!any_condjump_p (cbranch_insn))
return false;
@@ -159,7 +159,7 @@ try_simplify_condjump (basic_block cbranch_block)
if (rtl_dump_file)
fprintf (rtl_dump_file, "Simplifying condjump %i around jump %i\n",
- INSN_UID (cbranch_insn), INSN_UID (jump_block->end));
+ INSN_UID (cbranch_insn), INSN_UID (BB_END (jump_block)));
/* Success. Update the CFG to match. Note that after this point
the edge variable names appear backwards; the redirection is done
@@ -172,19 +172,19 @@ try_simplify_condjump (basic_block cbranch_block)
cbranch_fallthru_edge->flags &= ~EDGE_FALLTHRU;
update_br_prob_note (cbranch_block);
- end = jump_block->end;
+ end = BB_END (jump_block);
/* Deleting a block may produce unreachable code warning even when we are
- not deleting anything live. Supress it by moving all the line number
+ not deleting anything live. Suppress it by moving all the line number
notes out of the block. */
- for (insn = jump_block->head; insn != NEXT_INSN (jump_block->end);
+ for (insn = BB_HEAD (jump_block); insn != NEXT_INSN (BB_END (jump_block));
insn = next)
{
next = NEXT_INSN (insn);
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
{
- if (insn == jump_block->end)
+ if (insn == BB_END (jump_block))
{
- jump_block->end = PREV_INSN (insn);
+ BB_END (jump_block) = PREV_INSN (insn);
if (insn == end)
break;
}
@@ -300,17 +300,17 @@ thread_jump (int mode, edge e, basic_block b)
}
/* Second branch must end with onlyjump, as we will eliminate the jump. */
- if (!any_condjump_p (e->src->end))
+ if (!any_condjump_p (BB_END (e->src)))
return NULL;
- if (!any_condjump_p (b->end) || !onlyjump_p (b->end))
+ if (!any_condjump_p (BB_END (b)) || !onlyjump_p (BB_END (b)))
{
BB_SET_FLAG (b, BB_NONTHREADABLE_BLOCK);
return NULL;
}
- set1 = pc_set (e->src->end);
- set2 = pc_set (b->end);
+ set1 = pc_set (BB_END (e->src));
+ set2 = pc_set (BB_END (b));
if (((e->flags & EDGE_FALLTHRU) != 0)
!= (XEXP (SET_SRC (set1), 1) == pc_rtx))
reverse1 = true;
@@ -318,12 +318,12 @@ thread_jump (int mode, edge e, basic_block b)
cond1 = XEXP (SET_SRC (set1), 0);
cond2 = XEXP (SET_SRC (set2), 0);
if (reverse1)
- code1 = reversed_comparison_code (cond1, e->src->end);
+ code1 = reversed_comparison_code (cond1, BB_END (e->src));
else
code1 = GET_CODE (cond1);
code2 = GET_CODE (cond2);
- reversed_code2 = reversed_comparison_code (cond2, b->end);
+ reversed_code2 = reversed_comparison_code (cond2, BB_END (b));
if (!comparison_dominates_p (code1, code2)
&& !comparison_dominates_p (code1, reversed_code2))
@@ -339,7 +339,7 @@ thread_jump (int mode, edge e, basic_block b)
/* Short circuit cases where block B contains some side effects, as we can't
safely bypass it. */
- for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end);
+ for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b));
insn = NEXT_INSN (insn))
if (INSN_P (insn) && side_effects_p (PATTERN (insn)))
{
@@ -350,7 +350,7 @@ thread_jump (int mode, edge e, basic_block b)
cselib_init ();
/* First process all values computed in the source basic block. */
- for (insn = NEXT_INSN (e->src->head); insn != NEXT_INSN (e->src->end);
+ for (insn = NEXT_INSN (BB_HEAD (e->src)); insn != NEXT_INSN (BB_END (e->src));
insn = NEXT_INSN (insn))
if (INSN_P (insn))
cselib_process_insn (insn);
@@ -362,7 +362,7 @@ thread_jump (int mode, edge e, basic_block b)
processing as if it were same basic block.
Our goal is to prove that whole block is an NOOP. */
- for (insn = NEXT_INSN (b->head); insn != NEXT_INSN (b->end) && !failed;
+ for (insn = NEXT_INSN (BB_HEAD (b)); insn != NEXT_INSN (BB_END (b)) && !failed;
insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -509,7 +509,7 @@ try_forward_edges (int mode, basic_block b)
if ((mode & CLEANUP_PRE_LOOP) && optimize)
{
rtx insn = (target->succ->flags & EDGE_FALLTHRU
- ? target->head : prev_nonnote_insn (target->end));
+ ? BB_HEAD (target) : prev_nonnote_insn (BB_END (target)));
if (GET_CODE (insn) != NOTE)
insn = NEXT_INSN (insn);
@@ -527,7 +527,7 @@ try_forward_edges (int mode, basic_block b)
at this time; it can mess up the loop optimizer's
recognition of some patterns. */
- insn = PREV_INSN (target->head);
+ insn = PREV_INSN (BB_HEAD (target));
if (insn && GET_CODE (insn) == NOTE
&& NOTE_LINE_NUMBER (insn) == NOTE_INSN_LOOP_END)
break;
@@ -696,7 +696,7 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
{
rtx barrier;
- barrier = next_nonnote_insn (a->end);
+ barrier = next_nonnote_insn (BB_END (a));
if (GET_CODE (barrier) != BARRIER)
abort ();
delete_insn (barrier);
@@ -708,12 +708,12 @@ merge_blocks_move_predecessor_nojumps (basic_block a, basic_block b)
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
- if (squeeze_notes (&a->head, &a->end))
+ if (squeeze_notes (&BB_HEAD (a), &BB_END (a)))
abort ();
/* Scramble the insn chain. */
- if (a->end != PREV_INSN (b->head))
- reorder_insns_nobb (a->head, a->end, PREV_INSN (b->head));
+ if (BB_END (a) != PREV_INSN (BB_HEAD (b)))
+ reorder_insns_nobb (BB_HEAD (a), BB_END (a), PREV_INSN (BB_HEAD (b)));
a->flags |= BB_DIRTY;
if (rtl_dump_file)
@@ -739,18 +739,18 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
rtx barrier, real_b_end;
rtx label, table;
- real_b_end = b->end;
+ real_b_end = BB_END (b);
/* If there is a jump table following block B temporarily add the jump table
to block B so that it will also be moved to the correct location. */
- if (tablejump_p (b->end, &label, &table)
- && prev_active_insn (label) == b->end)
+ if (tablejump_p (BB_END (b), &label, &table)
+ && prev_active_insn (label) == BB_END (b))
{
- b->end = table;
+ BB_END (b) = table;
}
/* There had better have been a barrier there. Delete it. */
- barrier = NEXT_INSN (b->end);
+ barrier = NEXT_INSN (BB_END (b));
if (barrier && GET_CODE (barrier) == BARRIER)
delete_insn (barrier);
@@ -761,14 +761,14 @@ merge_blocks_move_successor_nojumps (basic_block a, basic_block b)
and adjust the block trees appropriately. Even better would be to have
a tighter connection between block trees and rtl so that this is not
necessary. */
- if (squeeze_notes (&b->head, &b->end))
+ if (squeeze_notes (&BB_HEAD (b), &BB_END (b)))
abort ();
/* Scramble the insn chain. */
- reorder_insns_nobb (b->head, b->end, a->end);
+ reorder_insns_nobb (BB_HEAD (b), BB_END (b), BB_END (a));
/* Restore the real end of b. */
- b->end = real_b_end;
+ BB_END (b) = real_b_end;
if (rtl_dump_file)
fprintf (rtl_dump_file, "Moved block %d after %d and merged.\n",
@@ -799,8 +799,8 @@ merge_blocks_move (edge e, basic_block b, basic_block c, int mode)
that would make optimize_sibling_and_tail_recursive_calls more
complex for no gain. */
if ((mode & CLEANUP_PRE_SIBCALL)
- && GET_CODE (c->head) == CODE_LABEL
- && tail_recursion_label_p (c->head))
+ && GET_CODE (BB_HEAD (c)) == CODE_LABEL
+ && tail_recursion_label_p (BB_HEAD (c)))
return NULL;
/* If B has a fallthru edge to C, no need to move anything. */
@@ -1010,7 +1010,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1,
/* Skip simple jumps at the end of the blocks. Complex jumps still
need to be compared for equivalence, which we'll do below. */
- i1 = bb1->end;
+ i1 = BB_END (bb1);
last1 = afterlast1 = last2 = afterlast2 = NULL_RTX;
if (onlyjump_p (i1)
|| (returnjump_p (i1) && !side_effects_p (PATTERN (i1))))
@@ -1019,7 +1019,7 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1,
i1 = PREV_INSN (i1);
}
- i2 = bb2->end;
+ i2 = BB_END (bb2);
if (onlyjump_p (i2)
|| (returnjump_p (i2) && !side_effects_p (PATTERN (i2))))
{
@@ -1033,13 +1033,13 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1,
while (true)
{
/* Ignore notes. */
- while (!INSN_P (i1) && i1 != bb1->head)
+ while (!INSN_P (i1) && i1 != BB_HEAD (bb1))
i1 = PREV_INSN (i1);
- while (!INSN_P (i2) && i2 != bb2->head)
+ while (!INSN_P (i2) && i2 != BB_HEAD (bb2))
i2 = PREV_INSN (i2);
- if (i1 == bb1->head || i2 == bb2->head)
+ if (i1 == BB_HEAD (bb1) || i2 == BB_HEAD (bb2))
break;
if (!insns_match_p (mode, i1, i2))
@@ -1085,16 +1085,16 @@ flow_find_cross_jump (int mode ATTRIBUTE_UNUSED, basic_block bb1,
Two, it keeps line number notes as matched as may be. */
if (ninsns)
{
- while (last1 != bb1->head && !INSN_P (PREV_INSN (last1)))
+ while (last1 != BB_HEAD (bb1) && !INSN_P (PREV_INSN (last1)))
last1 = PREV_INSN (last1);
- if (last1 != bb1->head && GET_CODE (PREV_INSN (last1)) == CODE_LABEL)
+ if (last1 != BB_HEAD (bb1) && GET_CODE (PREV_INSN (last1)) == CODE_LABEL)
last1 = PREV_INSN (last1);
- while (last2 != bb2->head && !INSN_P (PREV_INSN (last2)))
+ while (last2 != BB_HEAD (bb2) && !INSN_P (PREV_INSN (last2)))
last2 = PREV_INSN (last2);
- if (last2 != bb2->head && GET_CODE (PREV_INSN (last2)) == CODE_LABEL)
+ if (last2 != BB_HEAD (bb2) && GET_CODE (PREV_INSN (last2)) == CODE_LABEL)
last2 = PREV_INSN (last2);
*f1 = last1;
@@ -1121,18 +1121,18 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
unconditional jump, or a fake edge to exit. */
if (bb1->succ && !bb1->succ->succ_next
&& (bb1->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0
- && (GET_CODE (bb1->end) != JUMP_INSN || simplejump_p (bb1->end)))
+ && (GET_CODE (BB_END (bb1)) != JUMP_INSN || simplejump_p (BB_END (bb1))))
return (bb2->succ && !bb2->succ->succ_next
&& (bb2->succ->flags & (EDGE_COMPLEX | EDGE_FAKE)) == 0
- && (GET_CODE (bb2->end) != JUMP_INSN || simplejump_p (bb2->end)));
+ && (GET_CODE (BB_END (bb2)) != JUMP_INSN || simplejump_p (BB_END (bb2))));
/* Match conditional jumps - this may get tricky when fallthru and branch
edges are crossed. */
if (bb1->succ
&& bb1->succ->succ_next
&& !bb1->succ->succ_next->succ_next
- && any_condjump_p (bb1->end)
- && onlyjump_p (bb1->end))
+ && any_condjump_p (BB_END (bb1))
+ && onlyjump_p (BB_END (bb1)))
{
edge b1, f1, b2, f2;
bool reverse, match;
@@ -1142,8 +1142,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
if (!bb2->succ
|| !bb2->succ->succ_next
|| bb2->succ->succ_next->succ_next
- || !any_condjump_p (bb2->end)
- || !onlyjump_p (bb2->end))
+ || !any_condjump_p (BB_END (bb2))
+ || !onlyjump_p (BB_END (bb2)))
return false;
b1 = BRANCH_EDGE (bb1);
@@ -1175,8 +1175,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
else
return false;
- set1 = pc_set (bb1->end);
- set2 = pc_set (bb2->end);
+ set1 = pc_set (BB_END (bb1));
+ set2 = pc_set (BB_END (bb2));
if ((XEXP (SET_SRC (set1), 1) == pc_rtx)
!= (XEXP (SET_SRC (set2), 1) == pc_rtx))
reverse = !reverse;
@@ -1185,7 +1185,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
cond2 = XEXP (SET_SRC (set2), 0);
code1 = GET_CODE (cond1);
if (reverse)
- code2 = reversed_comparison_code (cond2, bb2->end);
+ code2 = reversed_comparison_code (cond2, BB_END (bb2));
else
code2 = GET_CODE (cond2);
@@ -1250,8 +1250,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
rtx label1, label2;
rtx table1, table2;
- if (tablejump_p (bb1->end, &label1, &table1)
- && tablejump_p (bb2->end, &label2, &table2)
+ if (tablejump_p (BB_END (bb1), &label1, &table1)
+ && tablejump_p (BB_END (bb2), &label2, &table2)
&& GET_CODE (PATTERN (table1)) == GET_CODE (PATTERN (table2)))
{
/* The labels should never be the same rtx. If they really are same
@@ -1261,7 +1261,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
/* If LABEL2 is referenced in BB1->END do not do anything
because we would loose information when replacing
LABEL1 by LABEL2 and then LABEL2 by LABEL1 in BB1->END. */
- if (label1 != label2 && !rtx_referenced_p (label2, bb1->end))
+ if (label1 != label2 && !rtx_referenced_p (label2, BB_END (bb1)))
{
/* Set IDENTICAL to true when the tables are identical. */
bool identical = false;
@@ -1296,9 +1296,9 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
rr.r1 = label1;
rr.r2 = label2;
rr.update_label_nuses = false;
- for_each_rtx (&bb1->end, replace_label, &rr);
+ for_each_rtx (&BB_END (bb1), replace_label, &rr);
- match = insns_match_p (mode, bb1->end, bb2->end);
+ match = insns_match_p (mode, BB_END (bb1), BB_END (bb2));
if (rtl_dump_file && match)
fprintf (rtl_dump_file,
"Tablejumps in bb %i and %i match.\n",
@@ -1309,7 +1309,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
from the instruction is deleted too. */
rr.r1 = label2;
rr.r2 = label1;
- for_each_rtx (&bb1->end, replace_label, &rr);
+ for_each_rtx (&BB_END (bb1), replace_label, &rr);
return match;
}
@@ -1321,7 +1321,7 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
/* First ensure that the instructions match. There may be many outgoing
edges so this test is generally cheaper. */
- if (!insns_match_p (mode, bb1->end, bb2->end))
+ if (!insns_match_p (mode, BB_END (bb1), BB_END (bb2)))
return false;
/* Search the outgoing edges, ensure that the counts do match, find possible
@@ -1362,8 +1362,8 @@ outgoing_edges_match (int mode, basic_block bb1, basic_block bb2)
/* Ensure the same EH region. */
{
- rtx n1 = find_reg_note (bb1->end, REG_EH_REGION, 0);
- rtx n2 = find_reg_note (bb2->end, REG_EH_REGION, 0);
+ rtx n1 = find_reg_note (BB_END (bb1), REG_EH_REGION, 0);
+ rtx n2 = find_reg_note (BB_END (bb2), REG_EH_REGION, 0);
if (!n1 && n2)
return false;
@@ -1443,8 +1443,8 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
rtx label1, label2;
rtx table1, table2;
- if (tablejump_p (src1->end, &label1, &table1)
- && tablejump_p (src2->end, &label2, &table2)
+ if (tablejump_p (BB_END (src1), &label1, &table1)
+ && tablejump_p (BB_END (src2), &label2, &table2)
&& label1 != label2)
{
replace_label_data rr;
@@ -1459,7 +1459,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
/* Do not replace the label in SRC1->END because when deleting
a block whose end is a tablejump, the tablejump referenced
from the instruction is deleted too. */
- if (insn != src1->end)
+ if (insn != BB_END (src1))
for_each_rtx (&insn, replace_label, &rr);
}
}
@@ -1467,7 +1467,7 @@ try_crossjump_to_edge (int mode, edge e1, edge e2)
#endif
/* Avoid splitting if possible. */
- if (newpos2 == src2->head)
+ if (newpos2 == BB_HEAD (src2))
redirect_to = src2;
else
{
@@ -1716,9 +1716,9 @@ try_optimize_cfg (int mode)
if (b->pred->pred_next == NULL
&& (b->pred->flags & EDGE_FALLTHRU)
&& !(b->pred->flags & EDGE_COMPLEX)
- && GET_CODE (b->head) == CODE_LABEL
+ && GET_CODE (BB_HEAD (b)) == CODE_LABEL
&& (!(mode & CLEANUP_PRE_SIBCALL)
- || !tail_recursion_label_p (b->head))
+ || !tail_recursion_label_p (BB_HEAD (b)))
/* If the previous block ends with a branch to this
block, we can't delete the label. Normally this
is a condjump that is yet to be simplified, but
@@ -1726,21 +1726,21 @@ try_optimize_cfg (int mode)
some element going to the same place as the
default (fallthru). */
&& (b->pred->src == ENTRY_BLOCK_PTR
- || GET_CODE (b->pred->src->end) != JUMP_INSN
- || ! label_is_jump_target_p (b->head,
- b->pred->src->end)))
+ || GET_CODE (BB_END (b->pred->src)) != JUMP_INSN
+ || ! label_is_jump_target_p (BB_HEAD (b),
+ BB_END (b->pred->src))))
{
- rtx label = b->head;
+ rtx label = BB_HEAD (b);
delete_insn_chain (label, label);
/* In the case label is undeletable, move it after the
BASIC_BLOCK note. */
- if (NOTE_LINE_NUMBER (b->head) == NOTE_INSN_DELETED_LABEL)
+ if (NOTE_LINE_NUMBER (BB_HEAD (b)) == NOTE_INSN_DELETED_LABEL)
{
- rtx bb_note = NEXT_INSN (b->head);
+ rtx bb_note = NEXT_INSN (BB_HEAD (b));
reorder_insns_nobb (label, label, bb_note);
- b->head = bb_note;
+ BB_HEAD (b) = bb_note;
}
if (rtl_dump_file)
fprintf (rtl_dump_file, "Deleted label in block %i.\n",
@@ -1751,7 +1751,7 @@ try_optimize_cfg (int mode)
if (!(mode & CLEANUP_CFGLAYOUT)
&& b->pred->pred_next == NULL
&& (b->pred->flags & EDGE_FALLTHRU)
- && GET_CODE (b->head) != CODE_LABEL
+ && GET_CODE (BB_HEAD (b)) != CODE_LABEL
&& FORWARDER_BLOCK_P (b)
/* Note that forwarder_block_p true ensures that
there is a successor for this block. */
@@ -1793,10 +1793,10 @@ try_optimize_cfg (int mode)
else if (!(mode & CLEANUP_CFGLAYOUT)
/* If the jump insn has side effects,
we can't kill the edge. */
- && (GET_CODE (b->end) != JUMP_INSN
+ && (GET_CODE (BB_END (b)) != JUMP_INSN
|| (flow2_completed
- ? simplejump_p (b->end)
- : onlyjump_p (b->end)))
+ ? simplejump_p (BB_END (b))
+ : onlyjump_p (BB_END (b))))
&& (next = merge_blocks_move (s, b, c, mode)))
{
b = next;
@@ -1818,7 +1818,7 @@ try_optimize_cfg (int mode)
if (b->succ
&& ! b->succ->succ_next
&& b->succ->dest != EXIT_BLOCK_PTR
- && onlyjump_p (b->end)
+ && onlyjump_p (BB_END (b))
&& redirect_edge_and_branch (b->succ, b->succ->dest))
{
update_forwarder_flag (b);
diff --git a/gcc/cfghooks.h b/gcc/cfghooks.h
index 37457deff8b..5ef3b1f5480 100644
--- a/gcc/cfghooks.h
+++ b/gcc/cfghooks.h
@@ -31,7 +31,7 @@ struct cfg_hooks
/* Basic CFG manipulation. */
- /* Return new basic block */
+ /* Return new basic block. */
basic_block (*create_basic_block) (void *head, void *end, basic_block after);
/* Redirect edge E to the given basic block B and update underlying program
diff --git a/gcc/cfglayout.c b/gcc/cfglayout.c
index 7c7600af9ae..15ec0547451 100644
--- a/gcc/cfglayout.c
+++ b/gcc/cfglayout.c
@@ -89,9 +89,9 @@ skip_insns_after_block (basic_block bb)
next_head = NULL_RTX;
if (bb->next_bb != EXIT_BLOCK_PTR)
- next_head = bb->next_bb->head;
+ next_head = BB_HEAD (bb->next_bb);
- for (last_insn = insn = bb->end; (insn = NEXT_INSN (insn)) != 0; )
+ for (last_insn = insn = BB_END (bb); (insn = NEXT_INSN (insn)) != 0; )
{
if (insn == next_head)
break;
@@ -148,7 +148,7 @@ skip_insns_after_block (basic_block bb)
created by removing the basic block originally following
NOTE_INSN_LOOP_BEG. In such case reorder the notes. */
- for (insn = last_insn; insn != bb->end; insn = prev)
+ for (insn = last_insn; insn != BB_END (bb); insn = prev)
{
prev = PREV_INSN (insn);
if (GET_CODE (insn) == NOTE)
@@ -172,7 +172,7 @@ skip_insns_after_block (basic_block bb)
static rtx
label_for_bb (basic_block bb)
{
- rtx label = bb->head;
+ rtx label = BB_HEAD (bb);
if (GET_CODE (label) != CODE_LABEL)
{
@@ -214,13 +214,13 @@ record_effective_endpoints (void)
{
rtx end;
- if (PREV_INSN (bb->head) && next_insn != bb->head)
+ if (PREV_INSN (BB_HEAD (bb)) && next_insn != BB_HEAD (bb))
bb->rbi->header = unlink_insn_chain (next_insn,
- PREV_INSN (bb->head));
+ PREV_INSN (BB_HEAD (bb)));
end = skip_insns_after_block (bb);
- if (NEXT_INSN (bb->end) && bb->end != end)
- bb->rbi->footer = unlink_insn_chain (NEXT_INSN (bb->end), end);
- next_insn = NEXT_INSN (bb->end);
+ if (NEXT_INSN (BB_END (bb)) && BB_END (bb) != end)
+ bb->rbi->footer = unlink_insn_chain (NEXT_INSN (BB_END (bb)), end);
+ next_insn = NEXT_INSN (BB_END (bb));
}
cfg_layout_function_footer = next_insn;
@@ -598,11 +598,11 @@ fixup_reorder_chain (void)
insn = NEXT_INSN (insn);
}
if (insn)
- NEXT_INSN (insn) = bb->head;
+ NEXT_INSN (insn) = BB_HEAD (bb);
else
- set_first_insn (bb->head);
- PREV_INSN (bb->head) = insn;
- insn = bb->end;
+ set_first_insn (BB_HEAD (bb));
+ PREV_INSN (BB_HEAD (bb)) = insn;
+ insn = BB_END (bb);
if (bb->rbi->footer)
{
NEXT_INSN (insn) = bb->rbi->footer;
@@ -649,7 +649,7 @@ fixup_reorder_chain (void)
else if (! (e->flags & EDGE_EH))
e_taken = e;
- bb_end_insn = bb->end;
+ bb_end_insn = BB_END (bb);
if (GET_CODE (bb_end_insn) == JUMP_INSN)
{
if (any_condjump_p (bb_end_insn))
@@ -675,9 +675,9 @@ fixup_reorder_chain (void)
e_fake = unchecked_make_edge (bb, e_fall->dest, 0);
- if (!redirect_jump (bb->end, block_label (bb), 0))
+ if (!redirect_jump (BB_END (bb), block_label (bb), 0))
abort ();
- note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX);
+ note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
if (note)
{
int prob = INTVAL (XEXP (note, 0));
@@ -784,7 +784,7 @@ fixup_reorder_chain (void)
if (bb->rbi->original)
fprintf (rtl_dump_file, "duplicate of %i ",
bb->rbi->original->index);
- else if (forwarder_block_p (bb) && GET_CODE (bb->head) != CODE_LABEL)
+ else if (forwarder_block_p (bb) && GET_CODE (BB_HEAD (bb)) != CODE_LABEL)
fprintf (rtl_dump_file, "compensation ");
else
fprintf (rtl_dump_file, "bb %i ", bb->index);
@@ -896,18 +896,18 @@ cfg_layout_can_duplicate_bb_p (basic_block bb)
/* Do not attempt to duplicate tablejumps, as we need to unshare
the dispatch table. This is difficult to do, as the instructions
computing jump destination may be hoisted outside the basic block. */
- if (tablejump_p (bb->end, NULL, NULL))
+ if (tablejump_p (BB_END (bb), NULL, NULL))
return false;
/* Do not duplicate blocks containing insns that can't be copied. */
if (targetm.cannot_copy_insn_p)
{
- rtx insn = bb->head;
+ rtx insn = BB_HEAD (bb);
while (1)
{
if (INSN_P (insn) && (*targetm.cannot_copy_insn_p) (insn))
return false;
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
insn = NEXT_INSN (insn);
}
@@ -1028,7 +1028,7 @@ cfg_layout_duplicate_bb (basic_block bb, edge e)
abort ();
#endif
- insn = duplicate_insn_chain (bb->head, bb->end);
+ insn = duplicate_insn_chain (BB_HEAD (bb), BB_END (bb));
new_bb = create_basic_block (insn,
insn ? get_last_insn () : NULL,
EXIT_BLOCK_PTR->prev_bb);
@@ -1253,7 +1253,7 @@ end:
void
copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
edge *edges, unsigned n_edges, edge *new_edges,
- struct loop *base, struct loops *loops)
+ struct loop *base)
{
unsigned i, j;
basic_block bb, new_bb, dom_bb;
@@ -1268,7 +1268,7 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
bb->rbi->duplicated = 1;
/* Add to loop. */
add_bb_to_loop (new_bb, bb->loop_father->copy);
- add_to_dominance_info (loops->cfg.dom, new_bb);
+ add_to_dominance_info (CDI_DOMINATORS, new_bb);
/* Possibly set header. */
if (bb->loop_father->header == bb && bb->loop_father != base)
new_bb->loop_father->header = new_bb;
@@ -1283,11 +1283,11 @@ copy_bbs (basic_block *bbs, unsigned n, basic_block *new_bbs,
bb = bbs[i];
new_bb = new_bbs[i];
- dom_bb = get_immediate_dominator (loops->cfg.dom, bb);
+ dom_bb = get_immediate_dominator (CDI_DOMINATORS, bb);
if (dom_bb->rbi->duplicated)
{
dom_bb = dom_bb->rbi->copy;
- set_immediate_dominator (loops->cfg.dom, new_bb, dom_bb);
+ set_immediate_dominator (CDI_DOMINATORS, new_bb, dom_bb);
}
}
diff --git a/gcc/cfglayout.h b/gcc/cfglayout.h
index 3258fe8fba5..ca79e26c433 100644
--- a/gcc/cfglayout.h
+++ b/gcc/cfglayout.h
@@ -43,5 +43,5 @@ extern void insn_locators_initialize (void);
extern void reemit_insn_block_notes (void);
extern bool can_copy_bbs_p (basic_block *, unsigned);
extern void copy_bbs (basic_block *, unsigned, basic_block *,
- edge *, unsigned, edge *, struct loop *, struct loops *);
-extern void cfg_layout_initialize_rbi (basic_block);
+ edge *, unsigned, edge *, struct loop *);
+extern void cfg_layout_initialize_rbi (basic_block);
diff --git a/gcc/cfgloop.c b/gcc/cfgloop.c
index 2f3ff3e4513..43c52f23ddb 100644
--- a/gcc/cfgloop.c
+++ b/gcc/cfgloop.c
@@ -38,7 +38,7 @@ static void flow_loop_entry_edges_find (struct loop *);
static void flow_loop_exit_edges_find (struct loop *);
static int flow_loop_nodes_find (basic_block, struct loop *);
static void flow_loop_pre_header_scan (struct loop *);
-static basic_block flow_loop_pre_header_find (basic_block, dominance_info);
+static basic_block flow_loop_pre_header_find (basic_block);
static int flow_loop_level_compute (struct loop *);
static int flow_loops_level_compute (struct loops *);
static void establish_preds (struct loop *);
@@ -55,7 +55,7 @@ flow_loops_cfg_dump (const struct loops *loops, FILE *file)
int i;
basic_block bb;
- if (! loops->num || ! file || ! loops->cfg.dom)
+ if (! loops->num || ! file)
return;
FOR_EACH_BB (bb)
@@ -212,9 +212,6 @@ flow_loops_free (struct loops *loops)
free (loops->parray);
loops->parray = NULL;
- if (loops->cfg.dom)
- free_dominance_info (loops->cfg.dom);
-
if (loops->cfg.dfs_order)
free (loops->cfg.dfs_order);
if (loops->cfg.rc_order)
@@ -391,11 +388,10 @@ flow_loop_pre_header_scan (struct loop *loop)
}
/* Return the block for the pre-header of the loop with header
- HEADER where DOM specifies the dominator information. Return NULL if
- there is no pre-header. */
+ HEADER. Return NULL if there is no pre-header. */
static basic_block
-flow_loop_pre_header_find (basic_block header, dominance_info dom)
+flow_loop_pre_header_find (basic_block header)
{
basic_block pre_header;
edge e;
@@ -408,7 +404,7 @@ flow_loop_pre_header_find (basic_block header, dominance_info dom)
basic_block node = e->src;
if (node != ENTRY_BLOCK_PTR
- && ! dominated_by_p (dom, node, header))
+ && ! dominated_by_p (CDI_DOMINATORS, node, header))
{
if (pre_header == NULL)
pre_header = node;
@@ -522,7 +518,7 @@ flow_loops_level_compute (struct loops *loops)
about it specified by FLAGS. */
int
-flow_loop_scan (struct loops *loops, struct loop *loop, int flags)
+flow_loop_scan (struct loop *loop, int flags)
{
if (flags & LOOP_ENTRY_EDGES)
{
@@ -541,8 +537,7 @@ flow_loop_scan (struct loops *loops, struct loop *loop, int flags)
if (flags & LOOP_PRE_HEADER)
{
/* Look to see if the loop has a pre-header node. */
- loop->pre_header
- = flow_loop_pre_header_find (loop->header, loops->cfg.dom);
+ loop->pre_header = flow_loop_pre_header_find (loop->header);
/* Find the blocks within the extended basic block of
the loop pre-header. */
@@ -588,7 +583,7 @@ make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch,
insn = PREV_INSN (first_insn_after_basic_block_note (bb));
/* For empty block split_block will return NULL. */
- if (bb->end == insn)
+ if (BB_END (bb) == insn)
emit_note_after (NOTE_INSN_DELETED, insn);
fallthru = split_block (bb, insn);
@@ -627,12 +622,11 @@ make_forwarder_block (basic_block bb, int redirect_latch, int redirect_nonlatch,
static void
canonicalize_loop_headers (void)
{
- dominance_info dom;
basic_block header;
edge e;
/* Compute the dominators. */
- dom = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
alloc_aux_for_blocks (sizeof (int));
alloc_aux_for_edges (sizeof (int));
@@ -651,7 +645,7 @@ canonicalize_loop_headers (void)
have_abnormal_edge = 1;
if (latch != ENTRY_BLOCK_PTR
- && dominated_by_p (dom, latch, header))
+ && dominated_by_p (CDI_DOMINATORS, latch, header))
{
num_latches++;
LATCH_EDGE (e) = 1;
@@ -663,6 +657,8 @@ canonicalize_loop_headers (void)
HEADER_BLOCK (header) = num_latches;
}
+ free_dominance_info (CDI_DOMINATORS);
+
if (HEADER_BLOCK (ENTRY_BLOCK_PTR->succ->dest))
{
basic_block bb;
@@ -728,7 +724,6 @@ canonicalize_loop_headers (void)
free_aux_for_blocks ();
free_aux_for_edges ();
- free_dominance_info (dom);
}
/* Find all the natural loops in the function and save in LOOPS structure and
@@ -744,7 +739,6 @@ flow_loops_find (struct loops *loops, int flags)
int num_loops;
edge e;
sbitmap headers;
- dominance_info dom;
int *dfs_order;
int *rc_order;
basic_block header;
@@ -770,7 +764,7 @@ flow_loops_find (struct loops *loops, int flags)
canonicalize_loop_headers ();
/* Compute the dominators. */
- dom = loops->cfg.dom = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
/* Count the number of loop headers. This should be the
same as the number of natural loops. */
@@ -804,7 +798,8 @@ flow_loops_find (struct loops *loops, int flags)
node (header) that dominates all the nodes in the
loop. It also has single back edge to the header
from a latch node. */
- if (latch != ENTRY_BLOCK_PTR && dominated_by_p (dom, latch, header))
+ if (latch != ENTRY_BLOCK_PTR
+ && dominated_by_p (CDI_DOMINATORS, latch, header))
{
/* Shared headers should be eliminated by now. */
if (more_latches)
@@ -849,7 +844,6 @@ flow_loops_find (struct loops *loops, int flags)
flow_depth_first_order_compute (dfs_order, rc_order);
/* Save CFG derived information to avoid recomputing it. */
- loops->cfg.dom = dom;
loops->cfg.dfs_order = dfs_order;
loops->cfg.rc_order = rc_order;
@@ -878,7 +872,7 @@ flow_loops_find (struct loops *loops, int flags)
basic_block latch = e->src;
if (latch != ENTRY_BLOCK_PTR
- && dominated_by_p (dom, latch, header))
+ && dominated_by_p (CDI_DOMINATORS, latch, header))
{
loop->latch = latch;
break;
@@ -897,14 +891,13 @@ flow_loops_find (struct loops *loops, int flags)
/* Scan the loops. */
for (i = 1; i < num_loops; i++)
- flow_loop_scan (loops, loops->parray[i], flags);
+ flow_loop_scan (loops->parray[i], flags);
loops->num = num_loops;
}
else
{
- loops->cfg.dom = NULL;
- free_dominance_info (dom);
+ free_dominance_info (CDI_DOMINATORS);
}
loops->state = 0;
diff --git a/gcc/cfgloop.h b/gcc/cfgloop.h
index e879e522031..4d8c67dd35d 100644
--- a/gcc/cfgloop.h
+++ b/gcc/cfgloop.h
@@ -42,6 +42,9 @@ struct loop_desc
int postincr; /* 1 if increment/decrement is done after loop exit condition. */
rtx stride; /* Value added to VAR in each iteration. */
rtx var; /* Loop control variable. */
+ enum machine_mode inner_mode;
+ /* The mode from that it is extended. */
+ enum rtx_code extend; /* With this extend. */
rtx var_alts; /* List of definitions of its initial value. */
rtx lim; /* Expression var is compared with. */
rtx lim_alts; /* List of definitions of its initial value. */
@@ -227,9 +230,6 @@ struct loops
/* Information derived from the CFG. */
struct cfg
{
- /* The bitmap vector of dominators or NULL if not computed. */
- dominance_info dom;
-
/* The ordering of the basic blocks in a depth first search. */
int *dfs_order;
@@ -262,7 +262,7 @@ extern void flow_loops_dump (const struct loops *, FILE *,
void (*)(const struct loop *, FILE *, int), int);
extern void flow_loop_dump (const struct loop *, FILE *,
void (*)(const struct loop *, FILE *, int), int);
-extern int flow_loop_scan (struct loops *, struct loop *, int);
+extern int flow_loop_scan (struct loop *, int);
extern void flow_loop_free (struct loop *);
void mark_irreducible_loops (struct loops *);
@@ -289,7 +289,7 @@ extern void remove_bb_from_loops (basic_block);
extern void cancel_loop (struct loops *, struct loop *);
extern void cancel_loop_tree (struct loops *, struct loop *);
-extern basic_block loop_split_edge_with (edge, rtx, struct loops *);
+extern basic_block loop_split_edge_with (edge, rtx);
extern int fix_loop_placement (struct loop *);
enum
@@ -303,10 +303,9 @@ extern void force_single_succ_latches (struct loops *);
extern void verify_loop_structure (struct loops *);
/* Loop analysis. */
-extern bool simple_loop_p (struct loops *, struct loop *, struct loop_desc *);
+extern bool simple_loop_p (struct loop *, struct loop_desc *);
extern rtx count_loop_iterations (struct loop_desc *, rtx, rtx);
-extern bool just_once_each_iteration_p (struct loops *,struct loop *,
- basic_block);
+extern bool just_once_each_iteration_p (struct loop *, basic_block);
extern unsigned expected_loop_iterations (const struct loop *);
/* Loop manipulation. */
@@ -321,7 +320,7 @@ extern int duplicate_loop_to_header_edge (struct loop *, edge, struct loops *,
extern struct loop *loopify (struct loops *, edge, edge, basic_block);
extern void unloop (struct loops *, struct loop *);
extern bool remove_path (struct loops *, edge);
-extern edge split_loop_bb (struct loops *, basic_block, rtx);
+extern edge split_loop_bb (basic_block, rtx);
/* Loop optimizer initialization. */
extern struct loops *loop_optimizer_init (FILE *);
diff --git a/gcc/cfgloopanal.c b/gcc/cfgloopanal.c
index 60c78eaa77a..fb5f8ae6c6b 100644
--- a/gcc/cfgloopanal.c
+++ b/gcc/cfgloopanal.c
@@ -39,23 +39,43 @@ static bool invariant_rtx_wrto_regs_p (rtx, regset);
static rtx test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT);
static bool constant_iterations (struct loop_desc *, unsigned HOST_WIDE_INT *,
bool *);
-static bool simple_loop_exit_p (struct loops *, struct loop *, edge, regset,
+static bool simple_loop_exit_p (struct loop *, edge, regset,
rtx *, struct loop_desc *);
-static rtx variable_initial_value (rtx, regset, rtx, rtx *);
-static rtx variable_initial_values (edge, rtx);
+static rtx variable_initial_value (rtx, regset, rtx, rtx *, enum machine_mode);
+static rtx variable_initial_values (edge, rtx, enum machine_mode);
static bool simple_condition_p (struct loop *, rtx, regset,
struct loop_desc *);
-static basic_block simple_increment (struct loops *, struct loop *, rtx *,
- struct loop_desc *);
+static basic_block simple_increment (struct loop *, rtx *, struct loop_desc *);
static rtx count_strange_loop_iterations (rtx, rtx, enum rtx_code,
- int, rtx, enum machine_mode);
+ int, rtx, enum machine_mode,
+ enum machine_mode);
+static unsigned HOST_WIDEST_INT inverse (unsigned HOST_WIDEST_INT, int);
+static bool fits_in_mode_p (enum machine_mode mode, rtx expr);
+
+/* Computes inverse to X modulo (1 << MOD). */
+static unsigned HOST_WIDEST_INT
+inverse (unsigned HOST_WIDEST_INT x, int mod)
+{
+ unsigned HOST_WIDEST_INT mask =
+ ((unsigned HOST_WIDEST_INT) 1 << (mod - 1) << 1) - 1;
+ unsigned HOST_WIDEST_INT rslt = 1;
+ int i;
+
+ for (i = 0; i < mod - 1; i++)
+ {
+ rslt = (rslt * x) & mask;
+ x = (x * x) & mask;
+ }
+
+ return rslt;
+}
/* Checks whether BB is executed exactly once in each LOOP iteration. */
bool
-just_once_each_iteration_p (struct loops *loops, struct loop *loop, basic_block bb)
+just_once_each_iteration_p (struct loop *loop, basic_block bb)
{
/* It must be executed at least once each iteration. */
- if (!dominated_by_p (loops->cfg.dom, loop->latch, bb))
+ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, bb))
return false;
/* And just once. */
@@ -91,8 +111,8 @@ blocks_invariant_registers (basic_block *bbs, int nbbs, regset regs)
for (i = 0; i < max_reg_num (); i++)
SET_REGNO_REG_SET (regs, i);
for (i = 0; i < nbbs; i++)
- for (insn = bbs[i]->head;
- insn != NEXT_INSN (bbs[i]->end);
+ for (insn = BB_HEAD (bbs[i]);
+ insn != NEXT_INSN (BB_END (bbs[i]));
insn = NEXT_INSN (insn))
if (INSN_P (insn))
note_stores (PATTERN (insn),
@@ -136,8 +156,8 @@ blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs)
regs[i] = NULL;
for (i = 0; i < nbbs; i++)
- for (insn = bbs[i]->head;
- insn != NEXT_INSN (bbs[i]->end);
+ for (insn = BB_HEAD (bbs[i]);
+ insn != NEXT_INSN (BB_END (bbs[i]));
insn = NEXT_INSN (insn))
{
rtx set = single_set (insn);
@@ -150,8 +170,8 @@ blocks_single_set_registers (basic_block *bbs, int nbbs, rtx *regs)
data.regs = regs;
for (i = 0; i < nbbs; i++)
- for (insn = bbs[i]->head;
- insn != NEXT_INSN (bbs[i]->end);
+ for (insn = BB_HEAD (bbs[i]);
+ insn != NEXT_INSN (BB_END (bbs[i]));
insn = NEXT_INSN (insn))
{
if (!INSN_P (insn))
@@ -274,11 +294,11 @@ simple_condition_p (struct loop *loop ATTRIBUTE_UNUSED, rtx condition,
iteration. Fills in DESC->stride and returns block in that DESC->var is
modified. */
static basic_block
-simple_increment (struct loops *loops, struct loop *loop,
- rtx *simple_increment_regs, struct loop_desc *desc)
+simple_increment (struct loop *loop, rtx *simple_increment_regs,
+ struct loop_desc *desc)
{
- rtx mod_insn, set, set_src, set_add;
- basic_block mod_bb;
+ rtx mod_insn, mod_insn1, set, set_src, set_add;
+ basic_block mod_bb, mod_bb1;
/* Find insn that modifies var. */
mod_insn = simple_increment_regs[REGNO (desc->var)];
@@ -287,7 +307,7 @@ simple_increment (struct loops *loops, struct loop *loop,
mod_bb = BLOCK_FOR_INSN (mod_insn);
/* Check that it is executed exactly once each iteration. */
- if (!just_once_each_iteration_p (loops, loop, mod_bb))
+ if (!just_once_each_iteration_p (loop, mod_bb))
return NULL;
/* mod_insn must be a simple increment/decrement. */
@@ -300,6 +320,71 @@ simple_increment (struct loops *loops, struct loop *loop,
set_src = find_reg_equal_equiv_note (mod_insn);
if (!set_src)
set_src = SET_SRC (set);
+
+ /* Check for variables that iterate in narrower mode. */
+ if (GET_CODE (set_src) == SIGN_EXTEND
+ || GET_CODE (set_src) == ZERO_EXTEND)
+ {
+ /* If we are sign extending variable that is then compared unsigned
+ or vice versa, there is something weird happening. */
+ if (desc->cond != EQ
+ && desc->cond != NE
+ && ((desc->cond == LEU
+ || desc->cond == LTU
+ || desc->cond == GEU
+ || desc->cond == GTU)
+ ^ (GET_CODE (set_src) == ZERO_EXTEND)))
+ return NULL;
+
+ if (GET_CODE (XEXP (set_src, 0)) != SUBREG
+ || SUBREG_BYTE (XEXP (set_src, 0)) != 0
+ || GET_MODE (SUBREG_REG (XEXP (set_src, 0))) != GET_MODE (desc->var))
+ return NULL;
+
+ desc->inner_mode = GET_MODE (XEXP (set_src, 0));
+ desc->extend = GET_CODE (set_src);
+ set_src = SUBREG_REG (XEXP (set_src, 0));
+
+ if (GET_CODE (set_src) != REG)
+ return NULL;
+
+ /* Find where the reg is set. */
+ mod_insn1 = simple_increment_regs[REGNO (set_src)];
+ if (!mod_insn1)
+ return NULL;
+
+ mod_bb1 = BLOCK_FOR_INSN (mod_insn1);
+ if (!dominated_by_p (CDI_DOMINATORS, mod_bb, mod_bb1))
+ return NULL;
+ if (mod_bb1 == mod_bb)
+ {
+ for (;
+ mod_insn != PREV_INSN (BB_HEAD (mod_bb));
+ mod_insn = PREV_INSN (mod_insn))
+ if (mod_insn == mod_insn1)
+ break;
+
+ if (mod_insn == PREV_INSN (BB_HEAD (mod_bb)))
+ return NULL;
+ }
+
+ /* Replace the source with the possible place of increment. */
+ set = single_set (mod_insn1);
+ if (!set)
+ abort ();
+ if (!rtx_equal_p (SET_DEST (set), set_src))
+ abort ();
+
+ set_src = find_reg_equal_equiv_note (mod_insn1);
+ if (!set_src)
+ set_src = SET_SRC (set);
+ }
+ else
+ {
+ desc->inner_mode = GET_MODE (desc->var);
+ desc->extend = NIL;
+ }
+
if (GET_CODE (set_src) != PLUS)
return NULL;
if (!rtx_equal_p (XEXP (set_src, 0), desc->var))
@@ -317,18 +402,20 @@ simple_increment (struct loops *loops, struct loop *loop,
/* Tries to find initial value of VAR in INSN. This value must be invariant
wrto INVARIANT_REGS. If SET_INSN is not NULL, insn in that var is set is
- placed here. */
+ placed here. INNER_MODE is mode in that induction variable VAR iterates. */
static rtx
-variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn)
+variable_initial_value (rtx insn, regset invariant_regs,
+ rtx var, rtx *set_insn, enum machine_mode inner_mode)
{
basic_block bb;
rtx set;
+ rtx ret = NULL;
/* Go back through cfg. */
bb = BLOCK_FOR_INSN (insn);
while (1)
{
- for (; insn != bb->head; insn = PREV_INSN (insn))
+ for (; insn != BB_HEAD (bb); insn = PREV_INSN (insn))
{
if (INSN_P (insn))
note_stores (PATTERN (insn),
@@ -338,7 +425,7 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn)
break;
}
- if (insn != bb->head)
+ if (insn != BB_HEAD (bb))
{
/* We found place where var is set. */
rtx set_dest;
@@ -357,8 +444,21 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn)
val = XEXP (note, 0);
else
val = SET_SRC (set);
+
+ /* If we know that the initial value is indeed in range of
+ the inner mode, record the fact even in case the value itself
+ is useless. */
+ if ((GET_CODE (val) == SIGN_EXTEND
+ || GET_CODE (val) == ZERO_EXTEND)
+ && GET_MODE (XEXP (val, 0)) == inner_mode)
+ ret = gen_rtx_fmt_e (GET_CODE (val),
+ GET_MODE (var),
+ gen_rtx_fmt_ei (SUBREG,
+ inner_mode,
+ var, 0));
+
if (!invariant_rtx_wrto_regs_p (val, invariant_regs))
- return NULL;
+ return ret;
if (set_insn)
*set_insn = insn;
@@ -370,15 +470,16 @@ variable_initial_value (rtx insn, regset invariant_regs, rtx var, rtx *set_insn)
return NULL;
bb = bb->pred->src;
- insn = bb->end;
+ insn = BB_END (bb);
}
return NULL;
}
-/* Returns list of definitions of initial value of VAR at Edge. */
+/* Returns list of definitions of initial value of VAR at edge E. INNER_MODE
+ is mode in that induction variable VAR really iterates. */
static rtx
-variable_initial_values (edge e, rtx var)
+variable_initial_values (edge e, rtx var, enum machine_mode inner_mode)
{
rtx set_insn, list;
regset invariant_regs;
@@ -394,9 +495,10 @@ variable_initial_values (edge e, rtx var)
if (e->src == ENTRY_BLOCK_PTR)
return list;
- set_insn = e->src->end;
+ set_insn = BB_END (e->src);
while (REG_P (var)
- && (var = variable_initial_value (set_insn, invariant_regs, var, &set_insn)))
+ && (var = variable_initial_value (set_insn, invariant_regs, var,
+ &set_insn, inner_mode)))
list = alloc_EXPR_LIST (0, copy_rtx (var), list);
FREE_REG_SET (invariant_regs);
@@ -453,18 +555,24 @@ constant_iterations (struct loop_desc *desc, unsigned HOST_WIDE_INT *niter,
/* Attempts to determine a number of iterations of a "strange" loop.
Its induction variable starts with value INIT, is compared by COND
with LIM. If POSTINCR, it is incremented after the test. It is incremented
- by STRIDE each iteration and iterates in MODE.
+ by STRIDE each iteration, has mode MODE but iterates in INNER_MODE.
By "strange" we mean loops where induction variable increases in the wrong
direction wrto comparison, i.e. for (i = 6; i > 5; i++). */
static rtx
count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond,
- int postincr, rtx stride, enum machine_mode mode)
+ int postincr, rtx stride, enum machine_mode mode,
+ enum machine_mode inner_mode)
{
rtx rqmt, n_to_wrap, before_wrap, after_wrap;
rtx mode_min, mode_max;
int size;
+ /* This could be handled, but it is not important enough to lose time with
+ it just now. */
+ if (mode != inner_mode)
+ return NULL_RTX;
+
if (!postincr)
init = simplify_gen_binary (PLUS, mode, init, stride);
@@ -567,6 +675,28 @@ count_strange_loop_iterations (rtx init, rtx lim, enum rtx_code cond,
return simplify_gen_binary (PLUS, mode, n_to_wrap, const1_rtx);
}
+/* Checks whether value of EXPR fits into range of MODE. */
+static bool
+fits_in_mode_p (enum machine_mode mode, rtx expr)
+{
+ unsigned HOST_WIDEST_INT val;
+ int n_bits = 0;
+
+ if (GET_CODE (expr) == CONST_INT)
+ {
+ for (val = INTVAL (expr); val; val >>= 1)
+ n_bits++;
+
+ return n_bits <= GET_MODE_BITSIZE (mode);
+ }
+
+ if (GET_CODE (expr) == SIGN_EXTEND
+ || GET_CODE (expr) == ZERO_EXTEND)
+ return GET_MODE (XEXP (expr, 0)) == mode;
+
+ return false;
+}
+
/* Return RTX expression representing number of iterations of loop as bounded
by test described by DESC (in the case loop really has multiple exit
edges, fewer iterations may happen in the practice).
@@ -584,11 +714,14 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
{
enum rtx_code cond = desc->cond;
rtx stride = desc->stride;
- rtx mod, exp;
+ rtx mod, exp, ainit, bound;
+ rtx overflow_check, mx, mxp;
+ enum machine_mode mode = GET_MODE (desc->var);
+ unsigned HOST_WIDEST_INT s, size, d;
/* Give up on floating point modes and friends. It can be possible to do
the job for constant loop bounds, but it is probably not worthwhile. */
- if (!INTEGRAL_MODE_P (GET_MODE (desc->var)))
+ if (!INTEGRAL_MODE_P (mode))
return NULL;
init = copy_rtx (init ? init : desc->var);
@@ -598,6 +731,82 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
if (desc->neg)
cond = reverse_condition (cond);
+ if (desc->inner_mode != mode)
+ {
+ /* We have a case when the variable in fact iterates in the narrower
+ mode. This has following consequences:
+
+ For induction variable itself, if !desc->postincr, it does not mean
+ anything too special, since we know the variable is already in range
+ of the inner mode when we compare it (so it is just needed to shorten
+ it into the mode before calculations are done, so that we don't risk
+ wrong results). More complicated case is when desc->postincr; then
+ the first two iterations are special (the first one because the value
+ may be out of range, the second one because after shortening it to the
+ range it may have absolutely any value), and we do not handle this in
+ unrolling. So if we aren't able to prove that the initial value is in
+ the range, we fail in this case.
+
+ Step is just moduled to fit into inner mode.
+
+ If lim is out of range, then either the loop is infinite (and then
+ we may unroll however we like to), or exits in the first iteration
+ (this is also ok, since we handle it specially for this case anyway).
+ So we may safely assume that it fits into the inner mode. */
+
+ for (ainit = desc->var_alts; ainit; ainit = XEXP (ainit, 1))
+ if (fits_in_mode_p (desc->inner_mode, XEXP (ainit, 0)))
+ break;
+
+ if (!ainit)
+ {
+ if (desc->postincr)
+ return NULL_RTX;
+
+ init = simplify_gen_unary (desc->extend,
+ mode,
+ simplify_gen_subreg (desc->inner_mode,
+ init,
+ mode,
+ 0),
+ desc->inner_mode);
+ }
+
+ stride = simplify_gen_subreg (desc->inner_mode, stride, mode, 0);
+ if (stride == const0_rtx)
+ return NULL_RTX;
+ }
+
+ /* Prepare condition to verify that we do not risk overflow. */
+ if (stride == const1_rtx
+ || stride == constm1_rtx
+ || cond == NE
+ || cond == EQ)
+ {
+ /* Overflow at NE conditions does not occur. EQ condition
+ is weird and is handled in count_strange_loop_iterations.
+ If stride is 1, overflow may occur only for <= and >= conditions,
+ and then they are infinite, so it does not bother us. */
+ overflow_check = const0_rtx;
+ }
+ else
+ {
+ if (cond == LT || cond == LTU)
+ mx = simplify_gen_binary (MINUS, mode, lim, const1_rtx);
+ else if (cond == GT || cond == GTU)
+ mx = simplify_gen_binary (PLUS, mode, lim, const1_rtx);
+ else
+ mx = lim;
+ if (mode != desc->inner_mode)
+ mxp = simplify_gen_subreg (desc->inner_mode, mx, mode, 0);
+ else
+ mxp = mx;
+ mxp = simplify_gen_binary (PLUS, desc->inner_mode, mxp, stride);
+ if (mode != desc->inner_mode)
+ mxp = simplify_gen_unary (desc->extend, mode, mxp, desc->inner_mode);
+ overflow_check = simplify_gen_relational (cond, SImode, mode, mx, mxp);
+ }
+
/* Compute absolute value of the difference of initial and final value. */
if (INTVAL (stride) > 0)
{
@@ -605,43 +814,57 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
if (cond == EQ || cond == GE || cond == GT || cond == GEU
|| cond == GTU)
return count_strange_loop_iterations (init, lim, cond, desc->postincr,
- stride, GET_MODE (desc->var));
- exp = simplify_gen_binary (MINUS, GET_MODE (desc->var),
- lim, init);
+ stride, mode, desc->inner_mode);
+ exp = simplify_gen_binary (MINUS, mode, lim, init);
}
else
{
- /* Bypass nonsensical tests. */
if (cond == EQ || cond == LE || cond == LT || cond == LEU
|| cond == LTU)
return count_strange_loop_iterations (init, lim, cond, desc->postincr,
- stride, GET_MODE (desc->var));
- exp = simplify_gen_binary (MINUS, GET_MODE (desc->var),
- init, lim);
- stride = simplify_gen_unary (NEG, GET_MODE (desc->var),
- stride, GET_MODE (desc->var));
+ stride, mode, desc->inner_mode);
+ exp = simplify_gen_binary (MINUS, mode, init, lim);
+ stride = simplify_gen_unary (NEG, mode, stride, mode);
}
+ /* If there is a risk of overflow (i.e. when we increment value satisfying
+ a condition, we may again obtain a value satisfying the condition),
+ fail. */
+ if (overflow_check != const0_rtx)
+ return NULL_RTX;
+
/* Normalize difference so the value is always first examined
and later incremented. */
-
if (!desc->postincr)
- exp = simplify_gen_binary (MINUS, GET_MODE (desc->var),
- exp, stride);
+ exp = simplify_gen_binary (MINUS, mode, exp, stride);
/* Determine delta caused by exit condition. */
switch (cond)
{
case NE:
- /* For NE tests, make sure that the iteration variable won't miss
- the final value. If EXP mod STRIDE is not zero, then the
- iteration variable will overflow before the loop exits, and we
- can not calculate the number of iterations easily. */
- if (stride != const1_rtx
- && (simplify_gen_binary (UMOD, GET_MODE (desc->var), exp, stride)
- != const0_rtx))
- return NULL;
+ /* NE tests are easy to handle, because we just perform simple
+ arithmetics modulo power of 2. Let's use the fact to compute the
+ number of iterations exactly. We are now in situation when we want to
+ solve an equation stride * i = c (mod size of inner_mode).
+ Let nsd (stride, size of mode) = d. If d does not divide c, the
+ loop is infinite. Otherwise, the number of iterations is
+ (inverse(s/d) * (c/d)) mod (size of mode/d). */
+ size = GET_MODE_BITSIZE (desc->inner_mode);
+ s = INTVAL (stride);
+ d = 1;
+ while (s % 2 != 1)
+ {
+ s /= 2;
+ d *= 2;
+ size--;
+ }
+ bound = GEN_INT (((unsigned HOST_WIDEST_INT) 1 << (size - 1 ) << 1) - 1);
+ exp = simplify_gen_binary (UDIV, mode, exp, GEN_INT (d));
+ exp = simplify_gen_binary (MULT, mode,
+ exp, GEN_INT (inverse (s, size)));
+ exp = simplify_gen_binary (AND, mode, exp, bound);
break;
+
case LT:
case GT:
case LTU:
@@ -651,19 +874,18 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
case GE:
case LEU:
case GEU:
- exp = simplify_gen_binary (PLUS, GET_MODE (desc->var),
- exp, const1_rtx);
+ exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx);
break;
default:
abort ();
}
- if (stride != const1_rtx)
+ if (cond != NE && stride != const1_rtx)
{
/* Number of iterations is now (EXP + STRIDE - 1 / STRIDE),
but we need to take care for overflows. */
- mod = simplify_gen_binary (UMOD, GET_MODE (desc->var), exp, stride);
+ mod = simplify_gen_binary (UMOD, mode, exp, stride);
/* This is dirty trick. When we can't compute number of iterations
to be constant, we simply ignore the possible overflow, as
@@ -672,18 +894,15 @@ count_loop_iterations (struct loop_desc *desc, rtx init, rtx lim)
if (GET_CODE (mod) != CONST_INT)
{
- rtx stridem1 = simplify_gen_binary (PLUS, GET_MODE (desc->var),
- stride, constm1_rtx);
- exp = simplify_gen_binary (PLUS, GET_MODE (desc->var),
- exp, stridem1);
- exp = simplify_gen_binary (UDIV, GET_MODE (desc->var), exp, stride);
+ rtx stridem1 = simplify_gen_binary (PLUS, mode, stride, constm1_rtx);
+ exp = simplify_gen_binary (PLUS, mode, exp, stridem1);
+ exp = simplify_gen_binary (UDIV, mode, exp, stride);
}
else
{
- exp = simplify_gen_binary (UDIV, GET_MODE (desc->var), exp, stride);
+ exp = simplify_gen_binary (UDIV, mode, exp, stride);
if (mod != const0_rtx)
- exp = simplify_gen_binary (PLUS, GET_MODE (desc->var),
- exp, const1_rtx);
+ exp = simplify_gen_binary (PLUS, mode, exp, const1_rtx);
}
}
@@ -742,7 +961,7 @@ test_for_iteration (struct loop_desc *desc, unsigned HOST_WIDE_INT iter)
description joined to it in in DESC. INVARIANT_REGS and SINGLE_SET_REGS
are results of blocks_{invariant,single_set}_regs over BODY. */
static bool
-simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
+simple_loop_exit_p (struct loop *loop, edge exit_edge,
regset invariant_regs, rtx *single_set_regs,
struct loop_desc *desc)
{
@@ -759,11 +978,11 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
return false;
/* It must be tested (at least) once during any iteration. */
- if (!dominated_by_p (loops->cfg.dom, loop->latch, exit_bb))
+ if (!dominated_by_p (CDI_DOMINATORS, loop->latch, exit_bb))
return false;
/* It must end in a simple conditional jump. */
- if (!any_condjump_p (exit_bb->end))
+ if (!any_condjump_p (BB_END (exit_bb)))
return false;
ei = exit_bb->succ;
@@ -775,7 +994,7 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
/* Condition must be a simple comparison in that one of operands
is register and the other one is invariant. */
- if (!(condition = get_condition (exit_bb->end, NULL, false)))
+ if (!(condition = get_condition (BB_END (exit_bb), NULL, false)))
return false;
if (!simple_condition_p (loop, condition, invariant_regs, desc))
@@ -783,17 +1002,17 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
/* Var must be simply incremented or decremented in exactly one insn that
is executed just once every iteration. */
- if (!(mod_bb = simple_increment (loops, loop, single_set_regs, desc)))
+ if (!(mod_bb = simple_increment (loop, single_set_regs, desc)))
return false;
/* OK, it is simple loop. Now just fill in remaining info. */
- desc->postincr = !dominated_by_p (loops->cfg.dom, exit_bb, mod_bb);
+ desc->postincr = !dominated_by_p (CDI_DOMINATORS, exit_bb, mod_bb);
desc->neg = !fallthru_out;
/* Find initial value of var and alternative values for lim. */
e = loop_preheader_edge (loop);
- desc->var_alts = variable_initial_values (e, desc->var);
- desc->lim_alts = variable_initial_values (e, desc->lim);
+ desc->var_alts = variable_initial_values (e, desc->var, desc->inner_mode);
+ desc->lim_alts = variable_initial_values (e, desc->lim, desc->inner_mode);
/* Number of iterations. */
desc->const_iter =
@@ -806,7 +1025,7 @@ simple_loop_exit_p (struct loops *loops, struct loop *loop, edge exit_edge,
/* Tests whether LOOP is simple for loop. Returns simple loop description
in DESC. */
bool
-simple_loop_p (struct loops *loops, struct loop *loop, struct loop_desc *desc)
+simple_loop_p (struct loop *loop, struct loop_desc *desc)
{
unsigned i;
basic_block *body;
@@ -831,7 +1050,7 @@ simple_loop_p (struct loops *loops, struct loop *loop, struct loop_desc *desc)
{
for (e = body[i]->succ; e; e = e->succ_next)
if (!flow_bb_inside_loop_p (loop, e->dest)
- && simple_loop_exit_p (loops, loop, e,
+ && simple_loop_exit_p (loop, e,
invariant_regs, single_set_regs, &act))
{
/* Prefer constant iterations; the less the better. */
@@ -1027,7 +1246,7 @@ mark_irreducible_loops (struct loops *loops)
: e->dest->index + 1;
if (closed[sidx])
{
- if (!closed[mri[sidx]])
+ if (mri[sidx] != -1 && !closed[mri[sidx]])
{
if (mr[sidx] < mr[idx])
{
@@ -1103,7 +1322,7 @@ num_loop_insns (struct loop *loop)
{
bb = bbs[i];
ninsns++;
- for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))
if (INSN_P (insn))
ninsns++;
}
@@ -1127,7 +1346,7 @@ average_num_loop_insns (struct loop *loop)
bb = bbs[i];
binsns = 1;
- for (insn = bb->head; insn != bb->end; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn != BB_END (bb); insn = NEXT_INSN (insn))
if (INSN_P (insn))
binsns++;
diff --git a/gcc/cfgloopmanip.c b/gcc/cfgloopmanip.c
index ca50760f384..86af4a2536b 100644
--- a/gcc/cfgloopmanip.c
+++ b/gcc/cfgloopmanip.c
@@ -36,9 +36,9 @@ static void copy_loops_to (struct loops *, struct loop **, int,
struct loop *);
static void loop_redirect_edge (edge, basic_block);
static bool loop_delete_branch_edge (edge, int);
-static void remove_bbs (dominance_info, basic_block *, int);
+static void remove_bbs (basic_block *, int);
static bool rpe_enum_p (basic_block, void *);
-static int find_path (edge, dominance_info, basic_block **);
+static int find_path (edge, basic_block **);
static bool alp_enum_p (basic_block, void *);
static void add_loop (struct loops *, struct loop *);
static void fix_loop_placements (struct loop *);
@@ -47,17 +47,15 @@ static void fix_bb_placements (struct loops *, basic_block);
static void place_new_loop (struct loops *, struct loop *);
static void scale_loop_frequencies (struct loop *, int, int);
static void scale_bbs_frequencies (basic_block *, int, int, int);
-static basic_block create_preheader (struct loop *, dominance_info, int);
+static basic_block create_preheader (struct loop *, int);
static void fix_irreducible_loops (basic_block);
/* Splits basic block BB after INSN, returns created edge. Updates loops
and dominators. */
edge
-split_loop_bb (struct loops *loops, basic_block bb, rtx insn)
+split_loop_bb (basic_block bb, rtx insn)
{
edge e;
- basic_block *dom_bbs;
- int n_dom_bbs, i;
/* Split the block. */
e = split_block (bb, insn);
@@ -66,42 +64,31 @@ split_loop_bb (struct loops *loops, basic_block bb, rtx insn)
add_bb_to_loop (e->dest, e->src->loop_father);
/* Fix dominators. */
- add_to_dominance_info (loops->cfg.dom, e->dest);
- n_dom_bbs = get_dominated_by (loops->cfg.dom, e->src, &dom_bbs);
- for (i = 0; i < n_dom_bbs; i++)
- set_immediate_dominator (loops->cfg.dom, dom_bbs[i], e->dest);
- free (dom_bbs);
- set_immediate_dominator (loops->cfg.dom, e->dest, e->src);
+ add_to_dominance_info (CDI_DOMINATORS, e->dest);
+ redirect_immediate_dominators (CDI_DOMINATORS, e->src, e->dest);
+ set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src);
return e;
}
-/* Checks whether basic block BB is dominated by RPE->DOM, where
- RPE is passed through DATA. */
-struct rpe_data
- {
- basic_block dom;
- dominance_info doms;
- };
-
+/* Checks whether basic block BB is dominated by DATA. */
static bool
rpe_enum_p (basic_block bb, void *data)
{
- struct rpe_data *rpe = data;
- return dominated_by_p (rpe->doms, bb, rpe->dom);
+ return dominated_by_p (CDI_DOMINATORS, bb, data);
}
/* Remove basic blocks BBS from loop structure and dominance info,
and delete them afterwards. */
static void
-remove_bbs (dominance_info dom, basic_block *bbs, int nbbs)
+remove_bbs (basic_block *bbs, int nbbs)
{
int i;
for (i = 0; i < nbbs; i++)
{
remove_bb_from_loops (bbs[i]);
- delete_from_dominance_info (dom, bbs[i]);
+ delete_from_dominance_info (CDI_DOMINATORS, bbs[i]);
delete_block (bbs[i]);
}
}
@@ -113,19 +100,15 @@ remove_bbs (dominance_info dom, basic_block *bbs, int nbbs)
alter anything by this function). The number of basic blocks in the
path is returned. */
static int
-find_path (edge e, dominance_info doms, basic_block **bbs)
+find_path (edge e, basic_block **bbs)
{
- struct rpe_data rpe;
-
if (e->dest->pred->pred_next)
abort ();
/* Find bbs in the path. */
- rpe.dom = e->dest;
- rpe.doms = doms;
*bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
return dfs_enumerate_from (e->dest, 0, rpe_enum_p, *bbs,
- n_basic_blocks, &rpe);
+ n_basic_blocks, e->dest);
}
/* Fix placement of basic block BB inside loop hierarchy stored in LOOPS --
@@ -353,19 +336,19 @@ remove_path (struct loops *loops, edge e)
fix -- when e->dest has exactly one predecessor, this corresponds
to blocks dominated by e->dest, if not, split the edge. */
if (e->dest->pred->pred_next)
- e = loop_split_edge_with (e, NULL_RTX, loops)->pred;
+ e = loop_split_edge_with (e, NULL_RTX)->pred;
/* It may happen that by removing path we remove one or more loops
we belong to. In this case first unloop the loops, then proceed
normally. We may assume that e->dest is not a header of any loop,
as it now has exactly one predecessor. */
while (e->src->loop_father->outer
- && dominated_by_p (loops->cfg.dom,
+ && dominated_by_p (CDI_DOMINATORS,
e->src->loop_father->latch, e->dest))
unloop (loops, e->src->loop_father);
/* Identify the path. */
- nrem = find_path (e, loops->cfg.dom, &rem_bbs);
+ nrem = find_path (e, &rem_bbs);
n_bord_bbs = 0;
bord_bbs = xcalloc (n_basic_blocks, sizeof (basic_block));
@@ -397,7 +380,7 @@ remove_path (struct loops *loops, edge e)
if (rem_bbs[i]->loop_father->header == rem_bbs[i])
cancel_loop_tree (loops, rem_bbs[i]->loop_father);
- remove_bbs (loops->cfg.dom, rem_bbs, nrem);
+ remove_bbs (rem_bbs, nrem);
free (rem_bbs);
/* Find blocks whose dominators may be affected. */
@@ -405,25 +388,24 @@ remove_path (struct loops *loops, edge e)
sbitmap_zero (seen);
for (i = 0; i < n_bord_bbs; i++)
{
- int j, nldom;
- basic_block *ldom;
+ basic_block ldom;
- bb = get_immediate_dominator (loops->cfg.dom, bord_bbs[i]);
+ bb = get_immediate_dominator (CDI_DOMINATORS, bord_bbs[i]);
if (TEST_BIT (seen, bb->index))
continue;
SET_BIT (seen, bb->index);
- nldom = get_dominated_by (loops->cfg.dom, bb, &ldom);
- for (j = 0; j < nldom; j++)
- if (!dominated_by_p (loops->cfg.dom, from, ldom[j]))
- dom_bbs[n_dom_bbs++] = ldom[j];
- free(ldom);
+ for (ldom = first_dom_son (CDI_DOMINATORS, bb);
+ ldom;
+ ldom = next_dom_son (CDI_DOMINATORS, ldom))
+ if (!dominated_by_p (CDI_DOMINATORS, from, ldom))
+ dom_bbs[n_dom_bbs++] = ldom;
}
free (seen);
/* Recount dominators. */
- iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs);
+ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs);
free (dom_bbs);
/* These blocks have lost some predecessor(s), thus their irreducible
@@ -513,7 +495,7 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi
basic_block succ_bb = latch_edge->dest;
basic_block pred_bb = header_edge->src;
basic_block *dom_bbs, *body;
- unsigned n_dom_bbs, i, j;
+ unsigned n_dom_bbs, i;
sbitmap seen;
struct loop *loop = xcalloc (1, sizeof (struct loop));
struct loop *outer = succ_bb->loop_father->outer;
@@ -538,9 +520,9 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi
loop_redirect_edge (switch_bb->succ, succ_bb);
/* Update dominators. */
- set_immediate_dominator (loops->cfg.dom, switch_bb, pred_bb);
- set_immediate_dominator (loops->cfg.dom, loop->header, switch_bb);
- set_immediate_dominator (loops->cfg.dom, succ_bb, switch_bb);
+ set_immediate_dominator (CDI_DOMINATORS, switch_bb, pred_bb);
+ set_immediate_dominator (CDI_DOMINATORS, loop->header, switch_bb);
+ set_immediate_dominator (CDI_DOMINATORS, succ_bb, switch_bb);
/* Compute new loop. */
add_loop (loops, loop);
@@ -569,20 +551,19 @@ loopify (struct loops *loops, edge latch_edge, edge header_edge, basic_block swi
for (i = 0; i < loop->num_nodes; i++)
{
- unsigned nldom;
- basic_block *ldom;
+ basic_block ldom;
- nldom = get_dominated_by (loops->cfg.dom, body[i], &ldom);
- for (j = 0; j < nldom; j++)
- if (!TEST_BIT (seen, ldom[j]->index))
+ for (ldom = first_dom_son (CDI_DOMINATORS, body[i]);
+ ldom;
+ ldom = next_dom_son (CDI_DOMINATORS, ldom))
+ if (!TEST_BIT (seen, ldom->index))
{
- SET_BIT (seen, ldom[j]->index);
- dom_bbs[n_dom_bbs++] = ldom[j];
+ SET_BIT (seen, ldom->index);
+ dom_bbs[n_dom_bbs++] = ldom;
}
- free (ldom);
}
- iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs);
+ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs);
free (body);
free (seen);
@@ -788,7 +769,7 @@ loop_delete_branch_edge (edge e, int really_delete)
if (src->succ->succ_next->succ_next)
return false;
/* And it must be just a simple branch. */
- if (!any_condjump_p (src->end))
+ if (!any_condjump_p (BB_END (src)))
return false;
snd = e == src->succ ? src->succ->succ_next : src->succ;
@@ -990,7 +971,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
copy_loops_to (loops, orig_loops, n_orig_loops, target);
/* Copy bbs. */
- copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop, loops);
+ copy_bbs (bbs, n, new_bbs, spec_edges, 2, new_spec_edges, loop);
/* Note whether the blocks and edges belong to an irreducible loop. */
if (add_irreducible_flag)
@@ -1019,7 +1000,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
redirect_edge_and_branch_force (latch_edge, new_bbs[0]);
redirect_edge_and_branch_force (new_spec_edges[SE_LATCH],
loop->header);
- set_immediate_dominator (loops->cfg.dom, new_bbs[0], latch);
+ set_immediate_dominator (CDI_DOMINATORS, new_bbs[0], latch);
latch = loop->latch = new_bbs[1];
e = latch_edge = new_spec_edges[SE_LATCH];
}
@@ -1028,7 +1009,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
redirect_edge_and_branch_force (new_spec_edges[SE_LATCH],
loop->header);
redirect_edge_and_branch_force (e, new_bbs[0]);
- set_immediate_dominator (loops->cfg.dom, new_bbs[0], e->src);
+ set_immediate_dominator (CDI_DOMINATORS, new_bbs[0], e->src);
e = new_spec_edges[SE_LATCH];
}
@@ -1056,7 +1037,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
/* Update the original loop. */
if (!is_latch)
- set_immediate_dominator (loops->cfg.dom, e->dest, e->src);
+ set_immediate_dominator (CDI_DOMINATORS, e->dest, e->src);
if (flags & DLTHE_FLAG_UPDATE_FREQ)
{
scale_bbs_frequencies (bbs, n, scale_main, REG_BR_PROB_BASE);
@@ -1070,15 +1051,15 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
int n_dom_bbs,j;
bb = bbs[i];
- n_dom_bbs = get_dominated_by (loops->cfg.dom, bb, &dom_bbs);
+ n_dom_bbs = get_dominated_by (CDI_DOMINATORS, bb, &dom_bbs);
for (j = 0; j < n_dom_bbs; j++)
{
dominated = dom_bbs[j];
if (flow_bb_inside_loop_p (loop, dominated))
continue;
dom_bb = nearest_common_dominator (
- loops->cfg.dom, first_active[i], first_active_latch);
- set_immediate_dominator (loops->cfg.dom, dominated, dom_bb);
+ CDI_DOMINATORS, first_active[i], first_active_latch);
+ set_immediate_dominator (CDI_DOMINATORS, dominated, dom_bb);
}
free (dom_bbs);
}
@@ -1094,7 +1075,7 @@ duplicate_loop_to_header_edge (struct loop *loop, edge e, struct loops *loops,
entry; otherwise we also force preheader block to have only one successor.
The function also updates dominators stored in DOM. */
static basic_block
-create_preheader (struct loop *loop, dominance_info dom, int flags)
+create_preheader (struct loop *loop, int flags)
{
edge e, fallthru;
basic_block dummy;
@@ -1126,7 +1107,7 @@ create_preheader (struct loop *loop, dominance_info dom, int flags)
insn = PREV_INSN (insn);
else
insn = get_last_insn ();
- if (insn == loop->header->end)
+ if (insn == BB_END (loop->header))
{
/* Split_block would not split block after its end. */
emit_note_after (NOTE_INSN_DELETED, insn);
@@ -1141,7 +1122,7 @@ create_preheader (struct loop *loop, dominance_info dom, int flags)
if (ploop->latch == dummy)
ploop->latch = fallthru->dest;
- add_to_dominance_info (dom, fallthru->dest);
+ add_to_dominance_info (CDI_DOMINATORS, fallthru->dest);
/* Redirect edges. */
for (e = dummy->pred; e; e = e->pred_next)
@@ -1159,15 +1140,15 @@ create_preheader (struct loop *loop, dominance_info dom, int flags)
jump = redirect_edge_and_branch_force (e, loop->header);
if (jump)
{
- add_to_dominance_info (dom, jump);
- set_immediate_dominator (dom, jump, src);
+ add_to_dominance_info (CDI_DOMINATORS, jump);
+ set_immediate_dominator (CDI_DOMINATORS, jump, src);
add_bb_to_loop (jump, loop);
loop->latch = jump;
}
/* Update structures. */
- redirect_immediate_dominators (dom, dummy, loop->header);
- set_immediate_dominator (dom, loop->header, dummy);
+ redirect_immediate_dominators (CDI_DOMINATORS, dummy, loop->header);
+ set_immediate_dominator (CDI_DOMINATORS, loop->header, dummy);
loop->header->loop_father = loop;
add_bb_to_loop (dummy, cloop);
if (rtl_dump_file)
@@ -1184,7 +1165,7 @@ create_preheaders (struct loops *loops, int flags)
{
unsigned i;
for (i = 1; i < loops->num; i++)
- create_preheader (loops->parray[i], loops->cfg.dom, flags);
+ create_preheader (loops->parray[i], flags);
loops->state |= LOOPS_HAVE_PREHEADERS;
}
@@ -1207,7 +1188,7 @@ force_single_succ_latches (struct loops *loops)
for (e = loop->header->pred; e->src != loop->latch; e = e->pred_next)
continue;
- loop_split_edge_with (e, NULL_RTX, loops);
+ loop_split_edge_with (e, NULL_RTX);
}
loops->state |= LOOPS_HAVE_SIMPLE_LATCHES;
}
@@ -1217,7 +1198,7 @@ force_single_succ_latches (struct loops *loops)
be ok after this function. The created block is placed on correct place
in LOOPS structure and its dominator is set. */
basic_block
-loop_split_edge_with (edge e, rtx insns, struct loops *loops)
+loop_split_edge_with (edge e, rtx insns)
{
basic_block src, dest, new_bb;
struct loop *loop_c;
@@ -1231,7 +1212,7 @@ loop_split_edge_with (edge e, rtx insns, struct loops *loops)
/* Create basic block for it. */
new_bb = split_edge (e);
- add_to_dominance_info (loops->cfg.dom, new_bb);
+ add_to_dominance_info (CDI_DOMINATORS, new_bb);
add_bb_to_loop (new_bb, loop_c);
new_bb->flags = insns ? BB_SUPERBLOCK : 0;
@@ -1243,11 +1224,11 @@ loop_split_edge_with (edge e, rtx insns, struct loops *loops)
}
if (insns)
- emit_insn_after (insns, new_bb->end);
+ emit_insn_after (insns, BB_END (new_bb));
- set_immediate_dominator (loops->cfg.dom, new_bb, src);
- set_immediate_dominator (loops->cfg.dom, dest,
- recount_dominator (loops->cfg.dom, dest));
+ set_immediate_dominator (CDI_DOMINATORS, new_bb, src);
+ set_immediate_dominator (CDI_DOMINATORS, dest,
+ recount_dominator (CDI_DOMINATORS, dest));
if (dest->loop_father->latch == src)
dest->loop_father->latch = new_bb;
diff --git a/gcc/cfgrtl.c b/gcc/cfgrtl.c
index f383438e26b..c44d25285dc 100644
--- a/gcc/cfgrtl.c
+++ b/gcc/cfgrtl.c
@@ -156,9 +156,15 @@ delete_insn (rtx insn)
LABEL_NUSES (JUMP_LABEL (insn))--;
/* Also if deleting an insn that references a label. */
- else if ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX
- && GET_CODE (XEXP (note, 0)) == CODE_LABEL)
- LABEL_NUSES (XEXP (note, 0))--;
+ else
+ {
+ while ((note = find_reg_note (insn, REG_LABEL, NULL_RTX)) != NULL_RTX
+ && GET_CODE (XEXP (note, 0)) == CODE_LABEL)
+ {
+ LABEL_NUSES (XEXP (note, 0))--;
+ remove_note (insn, note);
+ }
+ }
if (GET_CODE (insn) == JUMP_INSN
&& (GET_CODE (PATTERN (insn)) == ADDR_VEC
@@ -193,7 +199,7 @@ delete_insn_and_edges (rtx insn)
if (INSN_P (insn)
&& BLOCK_FOR_INSN (insn)
- && BLOCK_FOR_INSN (insn)->end == insn)
+ && BB_END (BLOCK_FOR_INSN (insn)) == insn)
purge = true;
x = delete_insn (insn);
if (purge)
@@ -234,7 +240,7 @@ delete_insn_chain_and_edges (rtx first, rtx last)
if (INSN_P (last)
&& BLOCK_FOR_INSN (last)
- && BLOCK_FOR_INSN (last)->end == last)
+ && BB_END (BLOCK_FOR_INSN (last)) == last)
purge = true;
delete_insn_chain (first, last);
if (purge)
@@ -304,8 +310,8 @@ create_basic_block_structure (rtx head, rtx end, rtx bb_note, basic_block after)
if (NEXT_INSN (end) == bb_note)
end = bb_note;
- bb->head = head;
- bb->end = end;
+ BB_HEAD (bb) = head;
+ BB_END (bb) = end;
bb->index = last_basic_block++;
bb->flags = BB_NEW;
link_block (bb, after);
@@ -372,7 +378,7 @@ rtl_delete_block (basic_block b)
/* Get rid of all NOTE_INSN_PREDICTIONs and NOTE_INSN_LOOP_CONTs
hanging before the block. */
- for (insn = PREV_INSN (b->head); insn; insn = PREV_INSN (insn))
+ for (insn = PREV_INSN (BB_HEAD (b)); insn; insn = PREV_INSN (insn))
{
if (GET_CODE (insn) != NOTE)
break;
@@ -381,15 +387,15 @@ rtl_delete_block (basic_block b)
NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
}
- insn = b->head;
+ insn = BB_HEAD (b);
- never_reached_warning (insn, b->end);
+ never_reached_warning (insn, BB_END (b));
if (GET_CODE (insn) == CODE_LABEL)
maybe_remove_eh_handler (insn);
/* Include any jump table following the basic block. */
- end = b->end;
+ end = BB_END (b);
if (tablejump_p (end, NULL, &tmp))
end = tmp;
@@ -399,7 +405,7 @@ rtl_delete_block (basic_block b)
end = tmp;
/* Selectively delete the entire chain. */
- b->head = NULL;
+ BB_HEAD (b) = NULL;
delete_insn_chain (insn, end);
/* Remove the edges into and out of this block. Note that there may
@@ -425,10 +431,10 @@ compute_bb_for_insn (void)
FOR_EACH_BB (bb)
{
- rtx end = bb->end;
+ rtx end = BB_END (bb);
rtx insn;
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
BLOCK_FOR_INSN (insn) = bb;
if (insn == end)
@@ -455,11 +461,11 @@ update_bb_for_insn (basic_block bb)
{
rtx insn;
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
if (GET_CODE (insn) != BARRIER)
set_block_for_insn (insn, bb);
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
@@ -478,15 +484,15 @@ rtl_split_block (basic_block bb, void *insnp)
rtx insn = insnp;
/* There is no point splitting the block after its end. */
- if (bb->end == insn)
+ if (BB_END (bb) == insn)
return 0;
/* Create the new basic block. */
- new_bb = create_basic_block (NEXT_INSN (insn), bb->end, bb);
+ new_bb = create_basic_block (NEXT_INSN (insn), BB_END (bb), bb);
new_bb->count = bb->count;
new_bb->frequency = bb->frequency;
new_bb->loop_depth = bb->loop_depth;
- bb->end = insn;
+ BB_END (bb) = insn;
/* Redirect the outgoing edges. */
new_bb->succ = bb->succ;
@@ -558,7 +564,7 @@ update_cfg_after_block_merging (basic_block a, basic_block b)
static void
rtl_merge_blocks (basic_block a, basic_block b)
{
- rtx b_head = b->head, b_end = b->end, a_end = a->end;
+ rtx b_head = BB_HEAD (b), b_end = BB_END (b), a_end = BB_END (a);
rtx del_first = NULL_RTX, del_last = NULL_RTX;
int b_empty = 0;
@@ -595,7 +601,7 @@ rtl_merge_blocks (basic_block a, basic_block b)
for (prev = PREV_INSN (a_end); ; prev = PREV_INSN (prev))
if (GET_CODE (prev) != NOTE
|| NOTE_LINE_NUMBER (prev) == NOTE_INSN_BASIC_BLOCK
- || prev == a->head)
+ || prev == BB_HEAD (a))
break;
del_first = a_end;
@@ -609,7 +615,7 @@ rtl_merge_blocks (basic_block a, basic_block b)
prev = prev_nonnote_insn (prev);
if (!prev)
- prev = a->head;
+ prev = BB_HEAD (a);
del_first = tmp;
}
#endif
@@ -638,7 +644,7 @@ rtl_merge_blocks (basic_block a, basic_block b)
a_end = b_end;
}
- a->end = a_end;
+ BB_END (a) = a_end;
}
/* Return true when block A and B can be merged. */
@@ -654,9 +660,9 @@ rtl_can_merge_blocks (basic_block a,basic_block b)
&& a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR
/* If the jump insn has side effects,
we can't kill the edge. */
- && (GET_CODE (a->end) != JUMP_INSN
+ && (GET_CODE (BB_END (a)) != JUMP_INSN
|| (flow2_completed
- ? simplejump_p (a->end) : onlyjump_p (a->end))));
+ ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a)))));
}
/* Return the label in the head of basic block BLOCK. Create one if it doesn't
@@ -668,12 +674,12 @@ block_label (basic_block block)
if (block == EXIT_BLOCK_PTR)
return NULL_RTX;
- if (GET_CODE (block->head) != CODE_LABEL)
+ if (GET_CODE (BB_HEAD (block)) != CODE_LABEL)
{
- block->head = emit_label_before (gen_label_rtx (), block->head);
+ BB_HEAD (block) = emit_label_before (gen_label_rtx (), BB_HEAD (block));
}
- return block->head;
+ return BB_HEAD (block);
}
/* Attempt to perform edge redirection by replacing possibly complex jump
@@ -685,7 +691,7 @@ static bool
try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
{
basic_block src = e->src;
- rtx insn = src->end, kill_from;
+ rtx insn = BB_END (src), kill_from;
edge tmp;
rtx set;
int fallthru = 0;
@@ -725,7 +731,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
{
rtx insn = src->rbi->footer;
- delete_insn_chain (kill_from, src->end);
+ delete_insn_chain (kill_from, BB_END (src));
/* Remove barriers but keep jumptables. */
while (insn)
@@ -745,7 +751,7 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
}
}
else
- delete_insn_chain (kill_from, PREV_INSN (target->head));
+ delete_insn_chain (kill_from, PREV_INSN (BB_HEAD (target)));
}
/* If this already is simplejump, redirect it. */
@@ -775,11 +781,11 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
rtx barrier, label, table;
emit_jump_insn_after (gen_jump (target_label), insn);
- JUMP_LABEL (src->end) = target_label;
+ JUMP_LABEL (BB_END (src)) = target_label;
LABEL_NUSES (target_label)++;
if (rtl_dump_file)
fprintf (rtl_dump_file, "Replacing insn %i by jump %i\n",
- INSN_UID (insn), INSN_UID (src->end));
+ INSN_UID (insn), INSN_UID (BB_END (src)));
delete_insn_chain (kill_from, insn);
@@ -790,9 +796,33 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
if (tablejump_p (insn, &label, &table))
delete_insn_chain (label, table);
- barrier = next_nonnote_insn (src->end);
+ barrier = next_nonnote_insn (BB_END (src));
if (!barrier || GET_CODE (barrier) != BARRIER)
- emit_barrier_after (src->end);
+ emit_barrier_after (BB_END (src));
+ else
+ {
+ if (barrier != NEXT_INSN (BB_END (src)))
+ {
+ /* Move the jump before barrier so that the notes
+ which originally were or were created before jump table are
+ inside the basic block. */
+ rtx new_insn = BB_END (src);
+ rtx tmp;
+
+ for (tmp = NEXT_INSN (BB_END (src)); tmp != barrier;
+ tmp = NEXT_INSN (tmp))
+ set_block_for_insn (tmp, src);
+
+ NEXT_INSN (PREV_INSN (new_insn)) = NEXT_INSN (new_insn);
+ PREV_INSN (NEXT_INSN (new_insn)) = PREV_INSN (new_insn);
+
+ NEXT_INSN (new_insn) = barrier;
+ NEXT_INSN (PREV_INSN (barrier)) = new_insn;
+
+ PREV_INSN (new_insn) = PREV_INSN (barrier);
+ PREV_INSN (barrier) = new_insn;
+ }
+ }
}
/* Keep only one edge out and set proper flags. */
@@ -809,9 +839,9 @@ try_redirect_by_replacing_jump (edge e, basic_block target, bool in_cfglayout)
/* 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 (e->src->end) == NOTE
- && NOTE_LINE_NUMBER (e->src->end) >= 0)
- delete_insn (e->src->end);
+ while (GET_CODE (BB_END (e->src)) == NOTE
+ && NOTE_LINE_NUMBER (BB_END (e->src)) >= 0)
+ delete_insn (BB_END (e->src));
if (e->dest != target)
redirect_edge_succ (e, target);
@@ -846,9 +876,9 @@ static bool
redirect_branch_edge (edge e, basic_block target)
{
rtx tmp;
- rtx old_label = e->dest->head;
+ rtx old_label = BB_HEAD (e->dest);
basic_block src = e->src;
- rtx insn = src->end;
+ rtx insn = BB_END (src);
/* We can only redirect non-fallthru edges of jump insn. */
if (e->flags & EDGE_FALLTHRU)
@@ -970,18 +1000,18 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
instruction, first redirect the jump itself and then continue
by creating a basic block afterwards to redirect fallthru edge. */
if (e->src != ENTRY_BLOCK_PTR && e->dest != EXIT_BLOCK_PTR
- && any_condjump_p (e->src->end)
+ && any_condjump_p (BB_END (e->src))
/* When called from cfglayout, fallthru edges do not
necessarily go to the next block. */
&& e->src->next_bb == e->dest
- && JUMP_LABEL (e->src->end) == e->dest->head)
+ && JUMP_LABEL (BB_END (e->src)) == BB_HEAD (e->dest))
{
rtx note;
edge b = unchecked_make_edge (e->src, target, 0);
- if (!redirect_jump (e->src->end, block_label (target), 0))
+ if (!redirect_jump (BB_END (e->src), block_label (target), 0))
abort ();
- note = find_reg_note (e->src->end, REG_BR_PROB, NULL_RTX);
+ note = find_reg_note (BB_END (e->src), REG_BR_PROB, NULL_RTX);
if (note)
{
int prob = INTVAL (XEXP (note, 0));
@@ -1016,7 +1046,7 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
/* We can't redirect the entry block. Create an empty block at the
start of the function which we use to add the new jump. */
edge *pe1;
- basic_block bb = create_basic_block (e->dest->head, NULL, ENTRY_BLOCK_PTR);
+ basic_block bb = create_basic_block (BB_HEAD (e->dest), NULL, ENTRY_BLOCK_PTR);
/* Change the existing edge's source to be the new block, and add
a new edge from the entry block to the new block. */
@@ -1039,8 +1069,8 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
/* If the old block ended with a tablejump, skip its table
by searching forward from there. Otherwise start searching
forward from the last instruction of the old block. */
- if (!tablejump_p (e->src->end, NULL, &note))
- note = e->src->end;
+ if (!tablejump_p (BB_END (e->src), NULL, &note))
+ note = BB_END (e->src);
/* Position the new block correctly relative to loop notes. */
note = last_loop_beg_note (note);
@@ -1081,19 +1111,19 @@ force_nonfallthru_and_redirect (edge e, basic_block target)
if (target == EXIT_BLOCK_PTR)
{
if (HAVE_return)
- emit_jump_insn_after (gen_return (), jump_block->end);
+ emit_jump_insn_after (gen_return (), BB_END (jump_block));
else
abort ();
}
else
{
rtx label = block_label (target);
- emit_jump_insn_after (gen_jump (label), jump_block->end);
- JUMP_LABEL (jump_block->end) = label;
+ emit_jump_insn_after (gen_jump (label), BB_END (jump_block));
+ JUMP_LABEL (BB_END (jump_block)) = label;
LABEL_NUSES (label)++;
}
- emit_barrier_after (jump_block->end);
+ emit_barrier_after (BB_END (jump_block));
redirect_edge_succ_nodup (e, target);
if (abnormal_edge_flags)
@@ -1146,14 +1176,14 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c)
So search through a sequence of barriers, labels, and notes for
the head of block C and assert that we really do fall through. */
- for (q = NEXT_INSN (b->end); q != c->head; q = NEXT_INSN (q))
+ for (q = NEXT_INSN (BB_END (b)); q != BB_HEAD (c); q = NEXT_INSN (q))
if (INSN_P (q))
return;
/* Remove what will soon cease being the jump insn from the source block.
If block B consisted only of this single jump, turn it into a deleted
note. */
- q = b->end;
+ q = BB_END (b);
if (GET_CODE (q) == JUMP_INSN
&& onlyjump_p (q)
&& (any_uncondjump_p (q)
@@ -1175,8 +1205,8 @@ tidy_fallthru_edge (edge e, basic_block b, basic_block c)
}
/* Selectively unlink the sequence. */
- if (q != PREV_INSN (c->head))
- delete_insn_chain (NEXT_INSN (q), PREV_INSN (c->head));
+ if (q != PREV_INSN (BB_HEAD (c)))
+ delete_insn_chain (NEXT_INSN (q), PREV_INSN (BB_HEAD (c)));
e->flags |= EDGE_FALLTHRU;
}
@@ -1217,8 +1247,8 @@ tidy_fallthru_edges (void)
&& s->succ_next == NULL
&& s->dest == c
/* If the jump insn has side effects, we can't tidy the edge. */
- && (GET_CODE (b->end) != JUMP_INSN
- || onlyjump_p (b->end)))
+ && (GET_CODE (BB_END (b)) != JUMP_INSN
+ || onlyjump_p (BB_END (b))))
tidy_fallthru_edge (s, b, c);
}
}
@@ -1244,7 +1274,7 @@ back_edge_of_syntactic_loop_p (basic_block bb1, basic_block bb2)
if (!bb)
return false;
- for (insn = bb1->end; insn != bb2->head && count >= 0;
+ for (insn = BB_END (bb1); insn != BB_HEAD (bb2) && count >= 0;
insn = NEXT_INSN (insn))
if (GET_CODE (insn) == NOTE)
{
@@ -1307,14 +1337,14 @@ rtl_split_edge (edge edge_in)
we confuse the loop optimizer into thinking the loop is a phony. */
if (edge_in->dest != EXIT_BLOCK_PTR
- && PREV_INSN (edge_in->dest->head)
- && GET_CODE (PREV_INSN (edge_in->dest->head)) == NOTE
- && (NOTE_LINE_NUMBER (PREV_INSN (edge_in->dest->head))
+ && PREV_INSN (BB_HEAD (edge_in->dest))
+ && GET_CODE (PREV_INSN (BB_HEAD (edge_in->dest))) == NOTE
+ && (NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (edge_in->dest)))
== NOTE_INSN_LOOP_BEG)
&& !back_edge_of_syntactic_loop_p (edge_in->dest, edge_in->src))
- before = PREV_INSN (edge_in->dest->head);
+ before = PREV_INSN (BB_HEAD (edge_in->dest));
else if (edge_in->dest != EXIT_BLOCK_PTR)
- before = edge_in->dest->head;
+ before = BB_HEAD (edge_in->dest);
else
before = NULL_RTX;
@@ -1482,11 +1512,11 @@ commit_one_edge_insertion (edge e, int watch_calls)
its return value. */
if (watch_calls && (e->flags & EDGE_FALLTHRU) && !e->dest->pred->pred_next
&& e->src != ENTRY_BLOCK_PTR
- && GET_CODE (e->src->end) == CALL_INSN)
+ && GET_CODE (BB_END (e->src)) == CALL_INSN)
{
- rtx next = next_nonnote_insn (e->src->end);
+ rtx next = next_nonnote_insn (BB_END (e->src));
- after = e->dest->head;
+ after = BB_HEAD (e->dest);
/* The first insn after the call may be a stack pop, skip it. */
while (next
&& keep_with_call_p (next))
@@ -1506,12 +1536,12 @@ commit_one_edge_insertion (edge e, int watch_calls)
/* Get the location correct wrt a code label, and "nice" wrt
a basic block note, and before everything else. */
- tmp = bb->head;
+ tmp = BB_HEAD (bb);
if (GET_CODE (tmp) == CODE_LABEL)
tmp = NEXT_INSN (tmp);
if (NOTE_INSN_BASIC_BLOCK_P (tmp))
tmp = NEXT_INSN (tmp);
- if (tmp == bb->head)
+ if (tmp == BB_HEAD (bb))
before = tmp;
else if (tmp)
after = PREV_INSN (tmp);
@@ -1533,8 +1563,8 @@ commit_one_edge_insertion (edge e, int watch_calls)
We know this block has a single successor, so we can just emit
the queued insns before the jump. */
- if (GET_CODE (bb->end) == JUMP_INSN)
- for (before = bb->end;
+ if (GET_CODE (BB_END (bb)) == JUMP_INSN)
+ for (before = BB_END (bb);
GET_CODE (PREV_INSN (before)) == NOTE
&& NOTE_LINE_NUMBER (PREV_INSN (before)) ==
NOTE_INSN_LOOP_BEG; before = PREV_INSN (before))
@@ -1545,14 +1575,14 @@ commit_one_edge_insertion (edge e, int watch_calls)
if ((e->flags & EDGE_FALLTHRU) == 0)
abort ();
- after = bb->end;
+ after = BB_END (bb);
}
}
/* Otherwise we must split the edge. */
else
{
bb = split_edge (e);
- after = bb->end;
+ after = BB_END (bb);
}
}
@@ -1698,7 +1728,7 @@ rtl_dump_bb (basic_block bb, FILE *outf)
dump_regset (bb->global_live_at_start, outf);
putc ('\n', outf);
- for (insn = bb->head, last = NEXT_INSN (bb->end); insn != last;
+ for (insn = BB_HEAD (bb), last = NEXT_INSN (BB_END (bb)); insn != last;
insn = NEXT_INSN (insn))
print_rtl_single (outf, insn);
@@ -1731,9 +1761,9 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first)
{
rtx x;
- start[INSN_UID (bb->head)] = bb;
- end[INSN_UID (bb->end)] = bb;
- for (x = bb->head; x != NULL_RTX; x = NEXT_INSN (x))
+ start[INSN_UID (BB_HEAD (bb))] = bb;
+ end[INSN_UID (BB_END (bb))] = bb;
+ for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x))
{
enum bb_state state = IN_MULTIPLE_BB;
@@ -1741,7 +1771,7 @@ print_rtl_with_bb (FILE *outf, rtx rtx_first)
state = IN_ONE_BB;
in_bb_p[INSN_UID (x)] = state;
- if (x == bb->end)
+ if (x == BB_END (bb))
break;
}
}
@@ -1797,9 +1827,9 @@ void
update_br_prob_note (basic_block bb)
{
rtx note;
- if (GET_CODE (bb->end) != JUMP_INSN)
+ if (GET_CODE (BB_END (bb)) != JUMP_INSN)
return;
- note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX);
+ note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX);
if (!note || INTVAL (XEXP (note, 0)) == BRANCH_EDGE (bb)->probability)
return;
XEXP (note, 0) = GEN_INT (BRANCH_EDGE (bb)->probability);
@@ -1836,8 +1866,8 @@ rtl_verify_flow_info_1 (void)
FOR_EACH_BB_REVERSE (bb)
{
- rtx head = bb->head;
- rtx end = bb->end;
+ rtx head = BB_HEAD (bb);
+ rtx end = BB_END (bb);
/* Verify the end of the basic block is in the INSN chain. */
for (x = last_head; x != NULL_RTX; x = PREV_INSN (x))
@@ -1887,10 +1917,10 @@ rtl_verify_flow_info_1 (void)
edge e, fallthru = NULL;
rtx note;
- if (INSN_P (bb->end)
- && (note = find_reg_note (bb->end, REG_BR_PROB, NULL_RTX))
+ if (INSN_P (BB_END (bb))
+ && (note = find_reg_note (BB_END (bb), REG_BR_PROB, NULL_RTX))
&& bb->succ && bb->succ->succ_next
- && any_condjump_p (bb->end))
+ && any_condjump_p (BB_END (bb)))
{
if (INTVAL (XEXP (note, 0)) != BRANCH_EDGE (bb)->probability)
{
@@ -1919,52 +1949,52 @@ rtl_verify_flow_info_1 (void)
n_abnormal++;
}
- if (n_eh && GET_CODE (PATTERN (bb->end)) != RESX
- && !find_reg_note (bb->end, REG_EH_REGION, NULL_RTX))
+ if (n_eh && GET_CODE (PATTERN (BB_END (bb))) != RESX
+ && !find_reg_note (BB_END (bb), REG_EH_REGION, NULL_RTX))
{
error ("Missing REG_EH_REGION note in the end of bb %i", bb->index);
err = 1;
}
if (n_branch
- && (GET_CODE (bb->end) != JUMP_INSN
- || (n_branch > 1 && (any_uncondjump_p (bb->end)
- || any_condjump_p (bb->end)))))
+ && (GET_CODE (BB_END (bb)) != JUMP_INSN
+ || (n_branch > 1 && (any_uncondjump_p (BB_END (bb))
+ || any_condjump_p (BB_END (bb))))))
{
error ("Too many outgoing branch edges from bb %i", bb->index);
err = 1;
}
- if (n_fallthru && any_uncondjump_p (bb->end))
+ if (n_fallthru && any_uncondjump_p (BB_END (bb)))
{
error ("Fallthru edge after unconditional jump %i", bb->index);
err = 1;
}
- if (n_branch != 1 && any_uncondjump_p (bb->end))
+ if (n_branch != 1 && any_uncondjump_p (BB_END (bb)))
{
error ("Wrong amount of branch edges after unconditional jump %i", bb->index);
err = 1;
}
- if (n_branch != 1 && any_condjump_p (bb->end)
- && JUMP_LABEL (bb->end) != fallthru->dest->head)
+ if (n_branch != 1 && any_condjump_p (BB_END (bb))
+ && JUMP_LABEL (BB_END (bb)) != BB_HEAD (fallthru->dest))
{
error ("Wrong amount of branch edges after conditional jump %i", bb->index);
err = 1;
}
- if (n_call && GET_CODE (bb->end) != CALL_INSN)
+ if (n_call && GET_CODE (BB_END (bb)) != CALL_INSN)
{
error ("Call edges for non-call insn in bb %i", bb->index);
err = 1;
}
if (n_abnormal
- && (GET_CODE (bb->end) != CALL_INSN && n_call != n_abnormal)
- && (GET_CODE (bb->end) != JUMP_INSN
- || any_condjump_p (bb->end)
- || any_uncondjump_p (bb->end)))
+ && (GET_CODE (BB_END (bb)) != CALL_INSN && n_call != n_abnormal)
+ && (GET_CODE (BB_END (bb)) != JUMP_INSN
+ || any_condjump_p (BB_END (bb))
+ || any_uncondjump_p (BB_END (bb))))
{
error ("Abnormal edges for no purpose in bb %i", bb->index);
err = 1;
}
- for (x = bb->head; x != NEXT_INSN (bb->end); x = NEXT_INSN (x))
+ for (x = BB_HEAD (bb); x != NEXT_INSN (BB_END (bb)); x = NEXT_INSN (x))
if (BLOCK_FOR_INSN (x) != bb)
{
debug_rtx (x);
@@ -1983,10 +2013,10 @@ rtl_verify_flow_info_1 (void)
/* OK pointers are correct. Now check the header of basic
block. It ought to contain optional CODE_LABEL followed
by NOTE_BASIC_BLOCK. */
- x = bb->head;
+ x = BB_HEAD (bb);
if (GET_CODE (x) == CODE_LABEL)
{
- if (bb->end == x)
+ if (BB_END (bb) == x)
{
error ("NOTE_INSN_BASIC_BLOCK is missing for block %d",
bb->index);
@@ -2003,7 +2033,7 @@ rtl_verify_flow_info_1 (void)
err = 1;
}
- if (bb->end == x)
+ if (BB_END (bb) == x)
/* Do checks for empty blocks her. e */
;
else
@@ -2016,7 +2046,7 @@ rtl_verify_flow_info_1 (void)
err = 1;
}
- if (x == bb->end)
+ if (x == BB_END (bb))
break;
if (control_flow_insn_p (x))
@@ -2062,7 +2092,7 @@ rtl_verify_flow_info (void)
rtx insn;
/* Ensure existence of barrier in BB with no fallthru edges. */
- for (insn = bb->end; !insn || GET_CODE (insn) != BARRIER;
+ for (insn = BB_END (bb); !insn || GET_CODE (insn) != BARRIER;
insn = NEXT_INSN (insn))
if (!insn
|| (GET_CODE (insn) == NOTE
@@ -2086,7 +2116,7 @@ rtl_verify_flow_info (void)
err = 1;
}
else
- for (insn = NEXT_INSN (e->src->end); insn != e->dest->head;
+ for (insn = NEXT_INSN (BB_END (e->src)); insn != BB_HEAD (e->dest);
insn = NEXT_INSN (insn))
if (GET_CODE (insn) == BARRIER
#ifndef CASE_DROPS_THROUGH
@@ -2149,7 +2179,7 @@ rtl_verify_flow_info (void)
&& returnjump_p (x) && ! condjump_p (x)
&& ! (NEXT_INSN (x) && GET_CODE (NEXT_INSN (x)) == BARRIER))
fatal_insn ("return not followed by barrier", x);
- if (curr_bb && x == curr_bb->end)
+ if (curr_bb && x == BB_END (curr_bb))
curr_bb = NULL;
}
@@ -2169,7 +2199,7 @@ bool
purge_dead_edges (basic_block bb)
{
edge e, next;
- rtx insn = bb->end, note;
+ rtx insn = BB_END (bb), note;
bool purged = false;
/* If this instruction cannot trap, remove REG_EH_REGION notes. */
@@ -2190,12 +2220,12 @@ purge_dead_edges (basic_block bb)
next = e->succ_next;
if (e->flags & EDGE_EH)
{
- if (can_throw_internal (bb->end))
+ if (can_throw_internal (BB_END (bb)))
continue;
}
else if (e->flags & EDGE_ABNORMAL_CALL)
{
- if (GET_CODE (bb->end) == CALL_INSN
+ if (GET_CODE (BB_END (bb)) == CALL_INSN
&& (! (note = find_reg_note (insn, REG_EH_REGION, NULL))
|| INTVAL (XEXP (note, 0)) >= 0))
continue;
@@ -2245,7 +2275,7 @@ purge_dead_edges (basic_block bb)
block, so we should keep the edge. */
continue;
else if (e->dest != EXIT_BLOCK_PTR
- && e->dest->head == JUMP_LABEL (insn))
+ && BB_HEAD (e->dest) == JUMP_LABEL (insn))
/* If the destination block is the target of the jump,
keep the edge. */
continue;
@@ -2432,10 +2462,10 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
if (e->flags & EDGE_FALLTHRU)
{
/* Redirect any branch edges unified with the fallthru one. */
- if (GET_CODE (src->end) == JUMP_INSN
- && JUMP_LABEL (src->end) == e->dest->head)
+ if (GET_CODE (BB_END (src)) == JUMP_INSN
+ && JUMP_LABEL (BB_END (src)) == BB_HEAD (e->dest))
{
- if (!redirect_jump (src->end, block_label (dest), 0))
+ if (!redirect_jump (BB_END (src), block_label (dest), 0))
abort ();
}
/* In case we are redirecting fallthru edge to the branch edge
@@ -2445,9 +2475,9 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
{
edge s = e->succ_next ? e->succ_next : src->succ;
if (s->dest == dest
- && any_condjump_p (src->end)
- && onlyjump_p (src->end))
- delete_insn (src->end);
+ && any_condjump_p (BB_END (src))
+ && onlyjump_p (BB_END (src)))
+ delete_insn (BB_END (src));
}
redirect_edge_succ_nodup (e, dest);
if (rtl_dump_file)
@@ -2460,7 +2490,7 @@ cfg_layout_redirect_edge_and_branch (edge e, basic_block dest)
ret = redirect_branch_edge (e, dest);
/* We don't want simplejumps in the insn stream during cfglayout. */
- if (simplejump_p (src->end))
+ if (simplejump_p (BB_END (src)))
abort ();
return ret;
@@ -2479,11 +2509,11 @@ cfg_layout_redirect_edge_and_branch_force (edge e, basic_block dest)
static void
cfg_layout_delete_block (basic_block bb)
{
- rtx insn, next, prev = PREV_INSN (bb->head), *to, remaints;
+ rtx insn, next, prev = PREV_INSN (BB_HEAD (bb)), *to, remaints;
if (bb->rbi->header)
{
- next = bb->head;
+ next = BB_HEAD (bb);
if (prev)
NEXT_INSN (prev) = bb->rbi->header;
else
@@ -2495,7 +2525,7 @@ cfg_layout_delete_block (basic_block bb)
NEXT_INSN (insn) = next;
PREV_INSN (next) = insn;
}
- next = NEXT_INSN (bb->end);
+ next = NEXT_INSN (BB_END (bb));
if (bb->rbi->footer)
{
insn = bb->rbi->footer;
@@ -2516,7 +2546,7 @@ cfg_layout_delete_block (basic_block bb)
}
if (bb->rbi->footer)
{
- insn = bb->end;
+ insn = BB_END (bb);
NEXT_INSN (insn) = bb->rbi->footer;
PREV_INSN (bb->rbi->footer) = insn;
while (NEXT_INSN (insn))
@@ -2568,9 +2598,9 @@ cfg_layout_can_merge_blocks_p (basic_block a, basic_block b)
&& a != ENTRY_BLOCK_PTR && b != EXIT_BLOCK_PTR
/* If the jump insn has side effects,
we can't kill the edge. */
- && (GET_CODE (a->end) != JUMP_INSN
+ && (GET_CODE (BB_END (a)) != JUMP_INSN
|| (flow2_completed
- ? simplejump_p (a->end) : onlyjump_p (a->end))));
+ ? simplejump_p (BB_END (a)) : onlyjump_p (BB_END (a)))));
}
/* Merge block A and B, abort when it is not possible. */
@@ -2583,38 +2613,38 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
#endif
/* If there was a CODE_LABEL beginning B, delete it. */
- if (GET_CODE (b->head) == CODE_LABEL)
- delete_insn (b->head);
+ if (GET_CODE (BB_HEAD (b)) == CODE_LABEL)
+ delete_insn (BB_HEAD (b));
/* We should have fallthru edge in a, or we can do dummy redirection to get
it cleaned up. */
- if (GET_CODE (a->end) == JUMP_INSN)
+ if (GET_CODE (BB_END (a)) == JUMP_INSN)
redirect_edge_and_branch (a->succ, b);
- if (GET_CODE (a->end) == JUMP_INSN)
+ if (GET_CODE (BB_END (a)) == JUMP_INSN)
abort ();
/* Possible line number notes should appear in between. */
if (b->rbi->header)
{
- rtx first = a->end, last;
+ rtx first = BB_END (a), last;
- last = emit_insn_after (b->rbi->header, a->end);
+ last = emit_insn_after (b->rbi->header, BB_END (a));
delete_insn_chain (NEXT_INSN (first), last);
b->rbi->header = NULL;
}
/* In the case basic blocks are not adjacent, move them around. */
- if (NEXT_INSN (a->end) != b->head)
+ if (NEXT_INSN (BB_END (a)) != BB_HEAD (b))
{
- rtx first = unlink_insn_chain (b->head, b->end);
+ rtx first = unlink_insn_chain (BB_HEAD (b), BB_END (b));
- emit_insn_after (first, a->end);
+ emit_insn_after (first, BB_END (a));
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (first))
first = NEXT_INSN (first);
if (!NOTE_INSN_BASIC_BLOCK_P (first))
abort ();
- b->head = NULL;
+ BB_HEAD (b) = NULL;
delete_insn (first);
}
/* Otherwise just re-associate the instructions. */
@@ -2622,16 +2652,18 @@ cfg_layout_merge_blocks (basic_block a, basic_block b)
{
rtx insn;
- for (insn = b->head; insn != NEXT_INSN (b->end); insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (b);
+ insn != NEXT_INSN (BB_END (b));
+ insn = NEXT_INSN (insn))
set_block_for_insn (insn, a);
- insn = b->head;
+ insn = BB_HEAD (b);
/* Skip possible DELETED_LABEL insn. */
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
insn = NEXT_INSN (insn);
if (!NOTE_INSN_BASIC_BLOCK_P (insn))
abort ();
- b->head = NULL;
- a->end = b->end;
+ BB_HEAD (b) = NULL;
+ BB_END (a) = BB_END (b);
delete_insn (insn);
}
@@ -2666,7 +2698,7 @@ cfg_layout_split_edge (edge e)
edge new_e;
basic_block new_bb =
create_basic_block (e->src != ENTRY_BLOCK_PTR
- ? NEXT_INSN (e->src-> end) : get_insns (),
+ ? NEXT_INSN (BB_END (e->src)) : get_insns (),
NULL_RTX, e->src);
new_bb->count = e->count;
diff --git a/gcc/cgraph.c b/gcc/cgraph.c
index 5daea448500..91b08a65c69 100644
--- a/gcc/cgraph.c
+++ b/gcc/cgraph.c
@@ -268,7 +268,7 @@ cgraph_mark_needed_node (struct cgraph_node *node)
cgraph_mark_reachable_node (node);
}
-/* Record call from CALLER to CALLEE */
+/* Record call from CALLER to CALLEE. */
struct cgraph_edge *
cgraph_record_call (tree caller, tree callee)
@@ -428,8 +428,6 @@ cgraph_varpool_node (tree decl)
if (!cgraph_varpool_hash)
cgraph_varpool_hash = htab_create_ggc (10, cgraph_varpool_hash_node,
eq_cgraph_varpool_node, NULL);
-
-
slot = (struct cgraph_varpool_node **)
htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl),
IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME (decl)),
@@ -444,6 +442,85 @@ cgraph_varpool_node (tree decl)
return node;
}
+/* Set the DECL_ASSEMBLER_NAME and update cgraph hashtables. */
+void
+change_decl_assembler_name (tree decl, tree name)
+{
+ struct cgraph_node *node = NULL;
+ struct cgraph_varpool_node *vnode = NULL;
+ void **slot;
+
+ if (!DECL_ASSEMBLER_NAME_SET_P (decl))
+ {
+ SET_DECL_ASSEMBLER_NAME (decl, name);
+ return;
+ }
+ if (name == DECL_ASSEMBLER_NAME (decl))
+ return;
+
+ if (TREE_SYMBOL_REFERENCED (DECL_ASSEMBLER_NAME (decl))
+ && DECL_RTL_SET_P (decl))
+ warning ("%D renamed after being referenced in assembly", decl);
+
+ if (TREE_CODE (decl) == FUNCTION_DECL && cgraph_hash)
+ {
+ /* Take a look whether declaration is in the cgraph structure. */
+ slot =
+ htab_find_slot_with_hash (cgraph_hash, DECL_ASSEMBLER_NAME (decl),
+ IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
+ (decl)), NO_INSERT);
+ if (slot)
+ node = *slot;
+
+ /* It is, verify that we are the canonical node for this decl. */
+ if (node && node->decl == decl)
+ {
+ node = *slot;
+ htab_clear_slot (cgraph_hash, slot);
+ }
+ else
+ node = NULL;
+ }
+ if (TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl) && cgraph_varpool_hash)
+ {
+ /* Take a look whether declaration is in the cgraph structure. */
+ slot =
+ htab_find_slot_with_hash (cgraph_varpool_hash, DECL_ASSEMBLER_NAME (decl),
+ IDENTIFIER_HASH_VALUE (DECL_ASSEMBLER_NAME
+ (decl)), NO_INSERT);
+ if (slot)
+ vnode = *slot;
+
+ /* It is, verify that we are the canonical vnode for this decl. */
+ if (vnode && vnode->decl == decl)
+ {
+ vnode = *slot;
+ htab_clear_slot (cgraph_varpool_hash, slot);
+ }
+ else
+ vnode = NULL;
+ }
+ SET_DECL_ASSEMBLER_NAME (decl, name);
+ if (node)
+ {
+ slot =
+ htab_find_slot_with_hash (cgraph_hash, name,
+ IDENTIFIER_HASH_VALUE (name), INSERT);
+ if (*slot)
+ abort ();
+ *slot = node;
+ }
+ if (vnode)
+ {
+ slot =
+ htab_find_slot_with_hash (cgraph_varpool_hash, name,
+ IDENTIFIER_HASH_VALUE (name), INSERT);
+ if (*slot)
+ abort ();
+ *slot = vnode;
+ }
+}
+
/* Try to find existing function for identifier ID. */
struct cgraph_varpool_node *
cgraph_varpool_node_for_identifier (tree id)
@@ -536,7 +613,7 @@ bool
cgraph_function_possibly_inlined_p (tree decl)
{
if (!cgraph_global_info_ready)
- return (DECL_INLINE (decl) && !flag_no_inline);
+ return (DECL_INLINE (decl) && !flag_really_no_inline);
return cgraph_node (decl)->global.inlined;
}
diff --git a/gcc/cgraph.h b/gcc/cgraph.h
index a37227e95c9..9540eccd937 100644
--- a/gcc/cgraph.h
+++ b/gcc/cgraph.h
@@ -75,7 +75,7 @@ struct cgraph_rtl_info GTY(())
};
-/* The cgraph data strutcture.
+/* The cgraph data structure.
Each function decl has assigned cgraph_node listing callees and callers. */
struct cgraph_node GTY((chain_next ("%h.next"), chain_prev ("%h.previous")))
@@ -122,7 +122,7 @@ struct cgraph_edge GTY(())
bool inline_call;
};
-/* The cgraph_varpool data strutcture.
+/* The cgraph_varpool data structure.
Each static variable decl has assigned cgraph_varpool_node. */
struct cgraph_varpool_node GTY(())
diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c
index 673419fa008..d2d4d4cb996 100644
--- a/gcc/cgraphunit.c
+++ b/gcc/cgraphunit.c
@@ -486,7 +486,6 @@ static void
cgraph_expand_function (struct cgraph_node *node)
{
tree decl = node->decl;
- struct cgraph_edge *e;
if (flag_unit_at_a_time)
announce_function (decl);
@@ -497,21 +496,8 @@ cgraph_expand_function (struct cgraph_node *node)
via lang_expand_decl_stmt. */
(*lang_hooks.callgraph.expand_function) (decl);
- if (!flag_unit_at_a_time)
- {
- if (!node->local.inlinable
- || (!node->local.disregard_inline_limits
- && !cgraph_default_inline_p (node)))
- DECL_SAVED_TREE (node->decl) = NULL;
- }
- else
- {
- for (e = node->callers; e; e = e->next_caller)
- if (e->inline_call)
- break;
- if (!e)
- DECL_SAVED_TREE (decl) = NULL;
- }
+ if (!cgraph_function_possibly_inlined_p (decl))
+ DECL_SAVED_TREE (decl) = NULL;
current_function_decl = NULL;
}
@@ -945,7 +931,7 @@ cgraph_default_inline_p (struct cgraph_node *n)
All inline candidates are put into prioritized heap based on estimated
growth of the overall number of instructions and then update the estimates.
- INLINED and INLINED_CALEES are just pointers to arrays large enought
+ INLINED and INLINED_CALEES are just pointers to arrays large enough
to be passed to cgraph_inlined_into and cgraph_inlined_callees. */
static void
diff --git a/gcc/collect2.c b/gcc/collect2.c
index 2d49cce3ffe..9b69a0b8e1c 100644
--- a/gcc/collect2.c
+++ b/gcc/collect2.c
@@ -30,23 +30,15 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "system.h"
#include "coretypes.h"
#include "tm.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"
+#ifdef _WIN32
+# define WIN32_LEAN_AND_MEAN
+# include <windows.h>
#else
-# define VFORK_STRING "vfork"
-#endif
-#ifdef HAVE_VFORK_H
-#include <vfork.h>
-#endif
-#ifdef VMS
-#define vfork() (decc$$alloc_vfork_blocks() >= 0 ? \
- lib$get_current_invo_context(decc$$get_vfork_jmpbuf()) : -1)
-#endif /* VMS */
+# include <signal.h>
+# if ! defined( SIGCHLD ) && defined( SIGCLD )
+# define SIGCHLD SIGCLD
+# endif
+#endif
#ifndef LIBRARY_PATH_ENV
#define LIBRARY_PATH_ENV "LIBRARY_PATH"
@@ -249,7 +241,17 @@ static struct path_prefix *libpaths[3] = {&cmdline_lib_dirs,
static const char *const libexts[3] = {"a", "so", NULL}; /* possible library extensions */
#endif
-static void handler (int);
+static void clean_up_temp_files (void);
+#ifdef _WIN32
+static BOOL WINAPI handler (DWORD);
+static LONG unhanded_filter (LPEXCEPTION_POINTERS);
+#else
+static void handler (int);
+#endif
+static void install_handlers (void);
+static void disable_break (void);
+static void enable_break (void);
+
static int is_ctor_dtor (const char *);
static char *find_a_file (struct path_prefix *, const char *);
static void add_prefix (struct path_prefix *, const char *);
@@ -290,26 +292,6 @@ static char *resolve_lib_name (const char *);
#endif
static char *extract_string (const char **);
-#ifndef HAVE_DUP2
-static int
-dup2 (int oldfd, int newfd)
-{
- int fdtmp[256];
- int fdx = 0;
- int fd;
-
- if (oldfd == newfd)
- return oldfd;
- close (newfd);
- while ((fd = dup (oldfd)) != newfd && fd >= 0) /* good enough for low fd's */
- fdtmp[fdx++] = fd;
- while (fdx > 0)
- close (fdtmp[--fdx]);
-
- return fd;
-}
-#endif /* ! HAVE_DUP2 */
-
/* Delete tempfiles and exit function. */
void
@@ -407,7 +389,7 @@ fancy_abort (void)
}
static void
-handler (int signo)
+clean_up_temp_files (void)
{
if (c_file != 0 && c_file[0])
maybe_unlink (c_file);
@@ -422,11 +404,117 @@ handler (int signo)
if (export_file != 0 && export_file[0])
maybe_unlink (export_file);
#endif
+}
+
+/* Signal handling needs to be drastically different between Windows
+ and Unix. */
+#ifdef _WIN32
+
+static BOOL WINAPI
+handler (DWORD signo ATTRIBUTE_UNUSED)
+{
+ clean_up_temp_files ();
+ return FALSE; /* not handled - default handler will terminate process */
+}
+
+static LONG
+unhandled_filter (LPEXCEPTION_POINTERS pointers ATTRIBUTE_UNUSED)
+{
+ clean_up_temp_files ();
+ return EXCEPTION_CONTINUE_SEARCH; /* carry on and terminate process */
+}
+
+
+static void
+install_handlers (void)
+{
+ SetConsoleCtrlHandler (handler, TRUE);
+ /* This is not really the right way to do this; in fact I'm not
+ sure it will work. But it might. */
+ SetUnhandledExceptionFilter (unhandled_filter);
+}
+
+static void
+disable_break (void)
+{
+ /* This only works on Windows NT, and only disables CTRL-C;
+ CTRL-BREAK is not disabled (but does get caught by the handler). */
+ if (!(GetVersion() & 0x80000000))
+ SetConsoleCtrlHandler (NULL, TRUE);
+}
+static void
+enable_break (void)
+{
+ if (!(GetVersion() & 0x80000000))
+ SetConsoleCtrlHandler (NULL, FALSE);
+}
+
+#else /* not _WIN32 */
+
+static void
+handler (int signo)
+{
+ clean_up_temp_files ();
signal (signo, SIG_DFL);
kill (getpid (), signo);
}
+static void
+install_handlers ()
+{
+#ifdef SIGQUIT
+ if (signal (SIGQUIT, SIG_IGN) != SIG_IGN)
+ signal (SIGQUIT, handler);
+#endif
+ if (signal (SIGINT, SIG_IGN) != SIG_IGN)
+ signal (SIGINT, handler);
+#ifdef SIGALRM
+ if (signal (SIGALRM, SIG_IGN) != SIG_IGN)
+ signal (SIGALRM, handler);
+#endif
+#ifdef SIGHUP
+ if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
+ signal (SIGHUP, handler);
+#endif
+ if (signal (SIGSEGV, SIG_IGN) != SIG_IGN)
+ signal (SIGSEGV, handler);
+#ifdef SIGBUS
+ if (signal (SIGBUS, SIG_IGN) != SIG_IGN)
+ signal (SIGBUS, handler);
+#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
+}
+
+static void (*int_handler) PARAMS ((int));
+#ifdef SIGQUIT
+static void (*quit_handler) PARAMS ((int));
+#endif
+
+static void
+disable_break ()
+{
+ int_handler = (void (*) PARAMS ((int))) signal (SIGINT, SIG_IGN);
+#ifdef SIGQUIT
+ quit_handler = (void (*) PARAMS ((int))) signal (SIGQUIT, SIG_IGN);
+#endif
+}
+
+static void
+enable_break ()
+{
+ signal (SIGINT, int_handler);
+#ifdef SIGQUIT
+ signal (SIGQUIT, quit_handler);
+#endif
+}
+
+#endif /* not _WIN32 */
+
int
file_exists (const char *name)
@@ -821,6 +909,8 @@ main (int argc, char **argv)
int first_file;
int num_c_args = argc+9;
+ pexec_set_program_name (argv[0]);
+
no_demangle = !! getenv ("COLLECT_NO_DEMANGLE");
/* Suppress demangling by the real linker, which may be broken. */
@@ -831,12 +921,6 @@ main (int argc, char **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
-
gcc_init_libintl ();
/* Do not invoke xcalloc before this point, since locale needs to be
@@ -884,34 +968,16 @@ main (int argc, char **argv)
}
obstack_free (&temporary_obstack, temporary_firstobj);
- /* -fno-exceptions -w */
- num_c_args += 2;
+ /* -fno-profile-arcs -fno-test-coverage -fno-branch-probabilities
+ -fno-exceptions -w */
+ num_c_args += 5;
c_ptr = (const char **) (c_argv = xcalloc (sizeof (char *), num_c_args));
if (argc < 2)
fatal ("no arguments");
-#ifdef SIGQUIT
- if (signal (SIGQUIT, SIG_IGN) != SIG_IGN)
- signal (SIGQUIT, handler);
-#endif
- if (signal (SIGINT, SIG_IGN) != SIG_IGN)
- signal (SIGINT, handler);
-#ifdef SIGALRM
- if (signal (SIGALRM, SIG_IGN) != SIG_IGN)
- signal (SIGALRM, handler);
-#endif
-#ifdef SIGHUP
- if (signal (SIGHUP, SIG_IGN) != SIG_IGN)
- signal (SIGHUP, handler);
-#endif
- if (signal (SIGSEGV, SIG_IGN) != SIG_IGN)
- signal (SIGSEGV, handler);
-#ifdef SIGBUS
- if (signal (SIGBUS, SIG_IGN) != SIG_IGN)
- signal (SIGBUS, handler);
-#endif
+ install_handlers ();
/* Extract COMPILER_PATH and PATH into our prefix list. */
prefix_from_env ("COMPILER_PATH", &cpath);
@@ -1046,6 +1112,9 @@ main (int argc, char **argv)
}
}
obstack_free (&temporary_obstack, temporary_firstobj);
+ *c_ptr++ = "-fno-profile-arcs";
+ *c_ptr++ = "-fno-test-coverage";
+ *c_ptr++ = "-fno-branch-probabilities";
*c_ptr++ = "-fno-exceptions";
*c_ptr++ = "-w";
@@ -1428,10 +1497,10 @@ main (int argc, char **argv)
fork_execute ("gcc", c_argv);
#ifdef COLLECT_EXPORT_LIST
- /* On AIX we must call tlink because of possible templates resolution */
+ /* On AIX we must call tlink because of possible templates resolution. */
do_tlink (ld2_argv, object_lst);
#else
- /* Otherwise, simply call ld because tlink is already done */
+ /* Otherwise, simply call ld because tlink is already done. */
fork_execute ("ld", ld2_argv);
/* Let scan_prog_file do any final mods (OSF/rose needs this for
@@ -1457,7 +1526,8 @@ collect_wait (const char *prog)
{
int status;
- pwait (pid, &status, 0);
+ if (pwait (pid, &status, 0) < 0)
+ fatal ("could not obtain exit status for `%s'", prog);
if (status)
{
if (WIFSIGNALED (status))
@@ -1492,11 +1562,7 @@ do_wait (const char *prog)
void
collect_execute (const char *prog, char **argv, const char *redir)
{
- char *errmsg_fmt;
- char *errmsg_arg;
int redir_handle = -1;
- int stdout_save = -1;
- int stderr_save = -1;
if (vflag || debug)
{
@@ -1514,9 +1580,6 @@ collect_execute (const char *prog, char **argv, const char *redir)
fprintf (stderr, "\n");
}
- fflush (stdout);
- fflush (stderr);
-
/* If we cannot find a program we need, complain error. Do this here
since we might not end up needing something that we could not find. */
@@ -1525,38 +1588,15 @@ collect_execute (const char *prog, char **argv, const char *redir)
if (redir)
{
- /* Open response file. */
- redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT);
-
- /* Duplicate the stdout and stderr file handles
- so they can be restored later. */
- stdout_save = dup (STDOUT_FILENO);
- if (stdout_save == -1)
- fatal_perror ("redirecting stdout: %s", redir);
- stderr_save = dup (STDERR_FILENO);
- if (stderr_save == -1)
- fatal_perror ("redirecting stdout: %s", redir);
-
- /* Redirect stdout & stderr to our response file. */
- dup2 (redir_handle, STDOUT_FILENO);
- dup2 (redir_handle, STDERR_FILENO);
+ redir_handle = open (redir, O_WRONLY | O_TRUNC | O_CREAT, S_IWUSR);
+ if (redir_handle == -1)
+ fatal ("cannot open `%s' for writing", redir);
}
- pid = pexecute (argv[0], argv, argv[0], NULL, &errmsg_fmt, &errmsg_arg,
- (PEXECUTE_FIRST | PEXECUTE_LAST | PEXECUTE_SEARCH));
+ pid = pexec (argv[0], argv, 1, -1, redir_handle, redir_handle);
- if (redir)
- {
- /* Restore stdout and stderr to their previous settings. */
- dup2 (stdout_save, STDOUT_FILENO);
- dup2 (stderr_save, STDERR_FILENO);
-
- /* Close response file. */
- close (redir_handle);
- }
-
- if (pid == -1)
- fatal_perror (errmsg_fmt, errmsg_arg);
+ if (pid == -1)
+ fatal_perror ("pexec");
}
static void
@@ -1984,8 +2024,6 @@ write_aix_file (FILE *stream, struct id *list)
static void
scan_prog_file (const char *prog_name, enum pass which_pass)
{
- void (*int_handler) (int);
- void (*quit_handler) (int);
char *real_nm_argv[4];
const char **nm_argv = (const char **) real_nm_argv;
int argc = 0;
@@ -2007,7 +2045,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
nm_argv[argc++] = prog_name;
nm_argv[argc++] = (char *) 0;
- if (pipe (pipe_fd) < 0)
+ if (pmkpipe (pipe_fd) < 0)
fatal_perror ("pipe");
inf = fdopen (pipe_fd[0], "r");
@@ -2026,38 +2064,14 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
fprintf (stderr, "\n");
}
- fflush (stdout);
- fflush (stderr);
-
/* Spawn child nm on pipe. */
- pid = vfork ();
+ pid = pexec (nm_file_name, real_nm_argv, 0, -1, pipe_fd[1], -1);
+
if (pid == -1)
- fatal_perror (VFORK_STRING);
-
- if (pid == 0) /* child context */
- {
- /* setup stdout */
- if (dup2 (pipe_fd[1], 1) < 0)
- fatal_perror ("dup2 %d 1", pipe_fd[1]);
-
- if (close (pipe_fd[0]) < 0)
- fatal_perror ("close %d", pipe_fd[0]);
-
- if (close (pipe_fd[1]) < 0)
- fatal_perror ("close %d", pipe_fd[1]);
-
- execv (nm_file_name, real_nm_argv);
- fatal_perror ("execv %s", nm_file_name);
- }
-
+ fatal_perror ("pexec");
+
/* Parent context from here on. */
- int_handler = (void (*) (int)) signal (SIGINT, SIG_IGN);
-#ifdef SIGQUIT
- quit_handler = (void (*) (int)) signal (SIGQUIT, SIG_IGN);
-#endif
-
- if (close (pipe_fd[1]) < 0)
- fatal_perror ("close %d", pipe_fd[1]);
+ disable_break ();
if (debug)
fprintf (stderr, "\nnm output with constructors/destructors.\n");
@@ -2136,10 +2150,7 @@ scan_prog_file (const char *prog_name, enum pass which_pass)
do_wait (nm_file_name);
- signal (SIGINT, int_handler);
-#ifdef SIGQUIT
- signal (SIGQUIT, quit_handler);
-#endif
+ enable_break ();
}
#if SUNOS4_SHARED_LIBRARIES
@@ -2416,8 +2427,6 @@ scan_libraries (const char *prog_name)
{
static struct head libraries; /* list of shared libraries found */
struct id *list;
- void (*int_handler) (int);
- void (*quit_handler) (int);
char *real_ldd_argv[4];
const char **ldd_argv = (const char **) real_ldd_argv;
int argc = 0;
@@ -2436,7 +2445,7 @@ scan_libraries (const char *prog_name)
ldd_argv[argc++] = prog_name;
ldd_argv[argc++] = (char *) 0;
- if (pipe (pipe_fd) < 0)
+ if (pmkpipe (pipe_fd) < 0)
fatal_perror ("pipe");
inf = fdopen (pipe_fd[0], "r");
@@ -2455,38 +2464,14 @@ scan_libraries (const char *prog_name)
fprintf (stderr, "\n");
}
- fflush (stdout);
- fflush (stderr);
-
/* Spawn child ldd on pipe. */
- pid = vfork ();
- if (pid == -1)
- fatal_perror (VFORK_STRING);
-
- if (pid == 0) /* child context */
- {
- /* setup stdout */
- if (dup2 (pipe_fd[1], 1) < 0)
- fatal_perror ("dup2 %d 1", pipe_fd[1]);
-
- if (close (pipe_fd[0]) < 0)
- fatal_perror ("close %d", pipe_fd[0]);
-
- if (close (pipe_fd[1]) < 0)
- fatal_perror ("close %d", pipe_fd[1]);
-
- execv (ldd_file_name, real_ldd_argv);
- fatal_perror ("execv %s", ldd_file_name);
- }
+ pexecute_pid = pexec (ldd_file_name, real_ldd_argv, 0, -1, infpipe[1], -1);
+
+ if (pexecute_pid == -1)
+ fatal_perror ("pexec");
/* Parent context from here on. */
- int_handler = (void (*) (int))) signal (SIGINT, SIG_IGN;
-#ifdef SIGQUIT
- quit_handler = (void (*) (int))) signal (SIGQUIT, SIG_IGN;
-#endif
-
- if (close (pipe_fd[1]) < 0)
- fatal_perror ("close %d", pipe_fd[1]);
+ disable_break ();
if (debug)
notice ("\nldd output with constructors/destructors.\n");
@@ -2529,11 +2514,7 @@ scan_libraries (const char *prog_name)
do_wait (ldd_file_name);
- signal (SIGINT, int_handler);
-#ifdef SIGQUIT
- signal (SIGQUIT, quit_handler);
-#endif
-
+ enable_break ();
/* now iterate through the library list adding their symbols to
the list. */
for (list = libraries.first; list; list = list->next)
@@ -2552,7 +2533,7 @@ scan_libraries (const char *prog_name)
#ifdef OBJECT_FORMAT_COFF
-#if defined(EXTENDED_COFF)
+#if defined (EXTENDED_COFF)
# define GCC_SYMBOLS(X) (SYMHEADER(X).isymMax + SYMHEADER(X).iextMax)
# define GCC_SYMENT SYMR
@@ -2565,14 +2546,26 @@ scan_libraries (const char *prog_name)
# define GCC_SYMBOLS(X) (HEADER(ldptr).f_nsyms)
# define GCC_SYMENT SYMENT
-# define GCC_OK_SYMBOL(X) \
- (((X).n_sclass == C_EXT) && \
- ((X).n_scnum > N_UNDEF) && \
- (aix64_flag \
- || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
- || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
-# define GCC_UNDEF_SYMBOL(X) \
- (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF))
+# if defined (C_WEAKEXT)
+# define GCC_OK_SYMBOL(X) \
+ (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \
+ ((X).n_scnum > N_UNDEF) && \
+ (aix64_flag \
+ || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
+ || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
+# define GCC_UNDEF_SYMBOL(X) \
+ (((X).n_sclass == C_EXT || (X).n_sclass == C_WEAKEXT) && \
+ ((X).n_scnum == N_UNDEF))
+# else
+# define GCC_OK_SYMBOL(X) \
+ (((X).n_sclass == C_EXT) && \
+ ((X).n_scnum > N_UNDEF) && \
+ (aix64_flag \
+ || (((X).n_type & N_TMASK) == (DT_NON << N_BTSHFT) \
+ || ((X).n_type & N_TMASK) == (DT_FCN << N_BTSHFT))))
+# define GCC_UNDEF_SYMBOL(X) \
+ (((X).n_sclass == C_EXT) && ((X).n_scnum == N_UNDEF))
+# endif
# define GCC_SYMINC(X) ((X).n_numaux+1)
# define GCC_SYMZERO(X) 0
diff --git a/gcc/combine.c b/gcc/combine.c
index c36d9223724..2c92d247aa8 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -345,7 +345,6 @@ static void setup_incoming_promotions (void);
static void set_nonzero_bits_and_sign_copies (rtx, rtx, void *);
static int cant_combine_insn_p (rtx);
static int can_combine_p (rtx, rtx, rtx, rtx, rtx *, rtx *);
-static int sets_function_arg_p (rtx);
static int combinable_i3pat (rtx, rtx *, rtx, rtx, int, rtx *);
static int contains_muldiv (rtx);
static rtx try_combine (rtx, rtx, rtx, int *);
@@ -609,8 +608,8 @@ combine_instructions (rtx f, unsigned int nregs)
FOR_EACH_BB (this_basic_block)
{
- for (insn = this_basic_block->head;
- insn != NEXT_INSN (this_basic_block->end);
+ for (insn = BB_HEAD (this_basic_block);
+ insn != NEXT_INSN (BB_END (this_basic_block));
insn = next ? next : NEXT_INSN (insn))
{
next = 0;
@@ -1205,45 +1204,6 @@ can_combine_p (rtx insn, rtx i3, rtx pred ATTRIBUTE_UNUSED, rtx succ,
return 1;
}
-/* Check if PAT is an insn - or a part of it - used to set up an
- argument for a function in a hard register. */
-
-static int
-sets_function_arg_p (rtx pat)
-{
- int i;
- rtx inner_dest;
-
- switch (GET_CODE (pat))
- {
- case INSN:
- return sets_function_arg_p (PATTERN (pat));
-
- case PARALLEL:
- for (i = XVECLEN (pat, 0); --i >= 0;)
- if (sets_function_arg_p (XVECEXP (pat, 0, i)))
- return 1;
-
- break;
-
- case SET:
- inner_dest = SET_DEST (pat);
- while (GET_CODE (inner_dest) == STRICT_LOW_PART
- || GET_CODE (inner_dest) == SUBREG
- || GET_CODE (inner_dest) == ZERO_EXTRACT)
- inner_dest = XEXP (inner_dest, 0);
-
- return (GET_CODE (inner_dest) == REG
- && REGNO (inner_dest) < FIRST_PSEUDO_REGISTER
- && FUNCTION_ARG_REGNO_P (REGNO (inner_dest)));
-
- default:
- break;
- }
-
- return 0;
-}
-
/* LOC is the location within I3 that contains its pattern or the component
of a PARALLEL of the pattern. We validate that it is valid for combining.
@@ -2377,7 +2337,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
for (insn = NEXT_INSN (i3);
insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
- || insn != this_basic_block->next_bb->head);
+ || insn != BB_HEAD (this_basic_block->next_bb));
insn = NEXT_INSN (insn))
{
if (INSN_P (insn) && reg_referenced_p (ni2dest, PATTERN (insn)))
@@ -2586,7 +2546,7 @@ try_combine (rtx i3, rtx i2, rtx i1, int *new_direct_jump_p)
SET_DEST (XVECEXP (PATTERN (i2), 0, i))))
for (temp = NEXT_INSN (i2);
temp && (this_basic_block->next_bb == EXIT_BLOCK_PTR
- || this_basic_block->head != temp);
+ || BB_HEAD (this_basic_block) != temp);
temp = NEXT_INSN (temp))
if (temp != i3 && INSN_P (temp))
for (link = LOG_LINKS (temp); link; link = XEXP (link, 1))
@@ -6083,10 +6043,11 @@ make_extraction (enum machine_mode mode, rtx inner, HOST_WIDE_INT pos,
{
if (tmode != inner_mode)
{
- if (in_dest)
+ /* We can't call gen_lowpart_for_combine in a DEST since we
+ always want a SUBREG (see below) and it would sometimes
+ return a new hard register. */
+ if (pos || in_dest)
{
- /* We can't call gen_lowpart_for_combine here since we always want
- a SUBREG and it would sometimes return a new hard register. */
HOST_WIDE_INT final_word = pos / BITS_PER_WORD;
if (WORDS_BIG_ENDIAN
@@ -12018,7 +11979,7 @@ reg_dead_at_p (rtx reg, rtx insn)
else
{
FOR_EACH_BB (block)
- if (insn == block->head)
+ if (insn == BB_HEAD (block))
break;
if (block == EXIT_BLOCK_PTR)
@@ -12657,7 +12618,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
{
if (! INSN_P (tem))
{
- if (tem == bb->head)
+ if (tem == BB_HEAD (bb))
break;
continue;
}
@@ -12702,11 +12663,12 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
This might delete other dead insns recursively.
First set the pattern to something that won't use
any register. */
+ rtx old_notes = REG_NOTES (tem);
PATTERN (tem) = pc_rtx;
+ REG_NOTES (tem) = NULL;
- distribute_notes (REG_NOTES (tem), tem, tem,
- NULL_RTX);
+ distribute_notes (old_notes, tem, tem, NULL_RTX);
distribute_links (LOG_LINKS (tem));
PUT_CODE (tem, NOTE);
@@ -12718,10 +12680,11 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
if (cc0_setter)
{
PATTERN (cc0_setter) = pc_rtx;
+ old_notes = REG_NOTES (cc0_setter);
+ REG_NOTES (cc0_setter) = NULL;
- distribute_notes (REG_NOTES (cc0_setter),
- cc0_setter, cc0_setter,
- NULL_RTX);
+ distribute_notes (old_notes, cc0_setter,
+ cc0_setter, NULL_RTX);
distribute_links (LOG_LINKS (cc0_setter));
PUT_CODE (cc0_setter, NOTE);
@@ -12782,7 +12745,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
break;
}
- if (tem == bb->head)
+ if (tem == BB_HEAD (bb))
break;
}
@@ -12879,7 +12842,7 @@ distribute_notes (rtx notes, rtx from_insn, rtx i3, rtx i2)
{
if (! INSN_P (tem))
{
- if (tem == bb->head)
+ if (tem == BB_HEAD (bb))
{
SET_BIT (refresh_blocks,
this_basic_block->index);
@@ -12986,7 +12949,7 @@ distribute_links (rtx links)
for (insn = NEXT_INSN (XEXP (link, 0));
(insn && (this_basic_block->next_bb == EXIT_BLOCK_PTR
- || this_basic_block->next_bb->head != insn));
+ || BB_HEAD (this_basic_block->next_bb) != insn));
insn = NEXT_INSN (insn))
if (INSN_P (insn) && reg_overlap_mentioned_p (reg, PATTERN (insn)))
{
diff --git a/gcc/common.opt b/gcc/common.opt
index 2ad0e0a58f6..302dfac6709 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -366,10 +366,6 @@ fgcse-las
Common
Perform redundant load after store elimination in global common subexpression elimination
-fgnu-linker
-Common
-Output GNU ld formatted global initializers
-
fguess-branch-probability
Common
Enable guessing of branch probabilities
@@ -517,6 +513,14 @@ fprofile-arcs
Common
Insert arc-based program profiling code
+fprofile-generate
+Common
+Enable common options for generating profile info for profile feedback directed optimizations
+
+fprofile-use
+Common
+Enable common options for performing profile feedback directed optimizations
+
fprofile-values
Common
Insert code to profile values of expressions
@@ -628,18 +632,6 @@ fsingle-precision-constant
Common
Convert floating point constants to single precision constants
-fssa
-Common
-Enable static single assignment optimizations
-
-fssa-ccp
-Common
-Enable SSA conditional constant propagation
-
-fssa-dce
-Common
-Enable aggressive SSA dead code elimination
-
fstack-check
Common
Insert stack checking code into the program
@@ -751,14 +743,6 @@ gcoff
Common JoinedOrMissing
Generate debug information in COFF format
-gdwarf
-Common JoinedOrMissing
-Generate debug information in DWARF v1 format
-
-gdwarf+
-Common JoinedOrMissing
-Generate debug information in extended DWARF v1 format
-
gdwarf-2
Common JoinedOrMissing
Generate debug information in DWARF v2 format
diff --git a/gcc/config.gcc b/gcc/config.gcc
index 5249689ab17..680aa3cdab6 100644
--- a/gcc/config.gcc
+++ b/gcc/config.gcc
@@ -1,5 +1,5 @@
# GCC target-specific configuration file.
-# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# Copyright 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
# Free Software Foundation, Inc.
#This file is part of GCC.
@@ -182,7 +182,23 @@ md_file=
# Obsolete configurations.
case ${target} in
- dummy)
+ d30v-* | \
+ dsp16xx-* | \
+ i370-* | \
+ i960-* | \
+ i?86-moss-msdos | i?86-*-moss* | \
+ i?86-ncr-sysv4* | \
+ i?86-*-netware | \
+ i?86-*-freebsd2* | i?86-*-freebsd*aout* | \
+ i?86-*-linux*aout* | \
+ i?86-*-linux*libc1* | \
+ i?86-*-interix | \
+ i?86-*-mach* | \
+ i?86-*-udk* | \
+ i?86-*-sysv[123]* | \
+ i386-*-vsta | \
+ m68k-hp-hpux* | m68000-hp-hpux* | \
+ m68k-*-sysv4*)
if test "x$enable_obsolete" != xyes; then
echo "*** Configuration ${target} is obsolete." >&2
echo "*** Specify --enable-obsolete to build it anyway." >&2
@@ -643,7 +659,7 @@ arm*-*-netbsd*)
use_collect2=yes
;;
arm*-*-linux*) # ARM GNU/Linux with ELF
- tm_file="dbxelf.h elfos.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
+ tm_file="dbxelf.h elfos.h linux.h arm/unknown-elf.h arm/elf.h arm/aout.h arm/arm.h arm/linux-gas.h arm/linux-elf.h"
tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux"
extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
gnu_ld=yes
@@ -875,7 +891,6 @@ i370-*-linux*)
;;
i[34567]86-*-darwin*)
tm_file="${tm_file} i386/darwin.h"
- use_fixproto=yes
;;
i[34567]86-*-elf*)
tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h i386/i386elf.h"
@@ -1324,12 +1339,14 @@ m68k-*-coff*)
;;
m68020-*-elf* | m68k-*-elf*)
tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h"
+ tm_defines="MOTOROLA USE_GAS"
tmake_file=m68k/t-m68kelf
extra_parts="crtbegin.o crtend.o"
use_fixproto=yes
;;
m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
tm_file="${tm_file} dbxelf.h elfos.h netbsd.h netbsd-elf.h m68k/netbsd-elf.h"
+ tm_defines="MOTOROLA USE_GAS"
case ${target} in
m68010*)
target_cpu_default="0"
@@ -1340,6 +1357,13 @@ m68010-*-netbsdelf* | m68k*-*-netbsdelf*)
esac
;;
m68k*-*-netbsd*)
+ if test "x$enable_obsolete" != xyes; then
+ echo "*** Configuration ${target} is obsolete." >&2
+ echo "*** Specify --enable-obsolete to build it anyway." >&2
+ echo "*** Support will be REMOVED in the next major release of GCC," >&2
+ echo "*** unless a maintainer comes forward." >&2
+ exit 1
+ fi
tm_file="m68k/m68k.h netbsd.h netbsd-aout.h m68k/netbsd.h"
tmake_file=t-netbsd
extra_parts=""
@@ -1376,6 +1400,7 @@ m68k-*-linux*) # Motorola m68k's running GNU/Linux
m68k-*-rtems*)
tmake_file="m68k/t-m68kbare m68k/t-crtstuff t-rtems m68k/t-rtems"
tm_file="m68k/m68k.h m68k/m68k-none.h m68k/m68kelf.h dbxelf.h elfos.h m68k/m68kemb.h m68k/m68020-elf.h m68k/rtemself.h rtems.h"
+ tm_defines="MOTOROLA USE_GAS"
extra_parts="crtbegin.o crtend.o"
;;
mcore-*-elf)
@@ -1418,6 +1443,7 @@ mips-sgi-irix6*o32) # SGI System V.4., IRIX 6, O32 ABI
;;
mips-sgi-irix6*) # SGI System V.4., IRIX 6
tm_file="${tm_file} mips/iris5.h mips/iris6.h"
+ tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
if test x$gas = xyes
then
tm_file="${tm_file} mips/iris6gas.h"
@@ -1425,8 +1451,8 @@ mips-sgi-irix6*) # SGI System V.4., IRIX 6
if test "x$gnu_ld" = xyes
then
tm_file="${tm_file} mips/iris6gld.h"
+ tmake_file="$tmake_file mips/t-iris6gld"
fi
- tmake_file="mips/t-iris mips/t-iris5-6 mips/t-iris6"
target_cpu_default="MASK_ABICALLS|MASK_FLOAT64|MASK_64BIT"
tm_defines="MIPS_ISA_DEFAULT=3 MIPS_ABI_DEFAULT=ABI_N32"
# See comment in mips/iris5.h file. Only enabled for O32 ABI
@@ -1653,11 +1679,8 @@ powerpc-*-beos*)
;;
powerpc-*-darwin*)
tm_file="${tm_file} rs6000/darwin.h"
- tmake_file="t-darwin rs6000/t-darwin"
+ tmake_file="t-darwin t-slibgcc-darwin rs6000/t-darwin"
extra_headers=altivec.h
- # override ppc default
- need_64bit_hwint=
- use_fixproto=yes
;;
powerpc*-*-freebsd*)
tm_file="${tm_file} dbxelf.h elfos.h ${fbsd_tm_file} rs6000/sysv4.h rs6000/freebsd.h"
@@ -1823,6 +1846,7 @@ s390x-ibm-tpf*)
tm_p_file=s390/s390-protos.h
md_file=s390/s390.md
extra_modes=s390/s390-modes.def
+ extra_parts="crtbegin.o crtbeginS.o crtbeginT.o crtend.o crtendS.o"
out_file=s390/s390.c
tmake_file="t-slibgcc-elf-ver s390/t-crtstuff s390/t-tpf"
;;
@@ -2191,6 +2215,13 @@ vax-*-ultrix*) # VAXen running ultrix
use_fixproto=yes
;;
vax-*-*) # VAX default entry
+ if test "x$enable_obsolete" != xyes; then
+ echo "*** Configuration ${target} is obsolete." >&2
+ echo "*** Specify --enable-obsolete to build it anyway." >&2
+ echo "*** Support will be REMOVED in the next major release of GCC," >&2
+ echo "*** unless a maintainer comes forward." >&2
+ exit 1
+ fi
use_fixproto=yes
;;
xscale-*-elf)
@@ -2368,7 +2399,7 @@ fi
;;
arm*-*-*)
- supported_defaults="arch cpu float tune"
+ supported_defaults="arch cpu float tune fpu"
for which in cpu tune; do
eval "val=\$with_$which"
case "$val" in
@@ -2395,7 +2426,7 @@ fi
case "$with_arch" in
"" \
- | armv[2345] | armv2a | armv3m | armv4t | armv5t \
+ | armv[23456] | armv2a | armv3m | armv4t | armv5t \
| armv5te | armv6j | ep9312)
# OK
;;
@@ -2407,7 +2438,7 @@ fi
case "$with_float" in
"" \
- | soft | hard)
+ | soft | hard | softfp)
# OK
;;
*)
@@ -2416,6 +2447,17 @@ fi
;;
esac
+ case "$with_fpu" in
+ "" \
+ | fpa | fpe2 | fpe3 | maverick | vfp )
+ # OK
+ ;;
+ *)
+ echo "Unknown fpu used in --with-fpu=$fpu" 2>&1
+ exit 1
+ ;;
+ esac
+
if test "x$with_arch" != x && test "x$with_cpu" != x; then
echo "Warning: --with-arch overrides --with-cpu" 1>&2
fi
@@ -2502,7 +2544,7 @@ fi
| 401 | 403 | 405 | 405fp | 440 | 440fp | 505 \
| 601 | 602 | 603 | 603e | ec603e | 604 \
| 604e | 620 | 630 | 740 | 750 | 7400 | 7450 \
- | 8540 | 801 | 821 | 823 | 860 | 970)
+ | 8540 | 801 | 821 | 823 | 860 | 970 | G3 | G4 | G5)
# OK
;;
*)
@@ -2701,7 +2743,7 @@ fi
esac
t=
- all_defaults="abi cpu arch tune schedule float mode"
+ all_defaults="abi cpu arch tune schedule float mode fpu"
for option in $all_defaults
do
eval "val=\$with_$option"
diff --git a/gcc/config.guess b/gcc/config.guess
deleted file mode 100755
index fd7602dabd9..00000000000
--- a/gcc/config.guess
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# Use the top-level config.guess so that we don't have two of them.
-guesssys=`echo $0 | sed 's|config.guess|../config.guess|'`
-exec ${guesssys} "$@"
diff --git a/gcc/config.in b/gcc/config.in
index 3a44fed9ee8..f4145a217d0 100644
--- a/gcc/config.in
+++ b/gcc/config.in
@@ -115,6 +115,9 @@
/* 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
@@ -241,9 +244,15 @@
through valgrind (a memory checker). This is extremely expensive. */
#undef ENABLE_VALGRIND_CHECKING
+/* Define if valgrind's valgrind/memcheck.h header is installed. */
+#undef HAVE_VALGRIND_MEMCHECK_H
+
/* Define if valgrind's memcheck.h header is installed. */
#undef HAVE_MEMCHECK_H
+/* Define to enable detailed memory allocation stats gathering. */
+#undef GATHER_STATISTICS
+
/* Always define this when using the GNU C Library */
#undef _GNU_SOURCE
@@ -511,9 +520,6 @@
/* Define if your linker supports -pie option. */
#undef HAVE_LD_PIE
-/* Define if your MIPS libgloss linker scripts consistently include STARTUP directives. */
-#undef HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES
-
/* Define to PREFIX/include if cpp should also search that directory. */
#undef PREFIX_INCLUDE_DIR
diff --git a/gcc/config/alpha/alpha-modes.def b/gcc/config/alpha/alpha-modes.def
index b3747a1dae8..8e9e6984bd2 100644
--- a/gcc/config/alpha/alpha-modes.def
+++ b/gcc/config/alpha/alpha-modes.def
@@ -19,5 +19,5 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
/* 128-bit floating point. This gets reset in alpha_override_options
- if VAX float format is in use. */
+ if VAX float format is in use. */
FLOAT_MODE (TF, 16, ieee_quad_format);
diff --git a/gcc/config/alpha/alpha-protos.h b/gcc/config/alpha/alpha-protos.h
index 29caf8f095b..95f1ad25c7c 100644
--- a/gcc/config/alpha/alpha-protos.h
+++ b/gcc/config/alpha/alpha-protos.h
@@ -80,7 +80,6 @@ extern void print_operand (FILE *, rtx, int);
extern void print_operand_address (FILE *, rtx);
extern void alpha_initialize_trampoline (rtx, rtx, rtx, int, int, int);
-extern tree alpha_build_va_list (void);
extern void alpha_va_start (tree, rtx);
extern rtx alpha_va_arg (tree, tree);
extern rtx function_arg (CUMULATIVE_ARGS, enum machine_mode, tree, int);
diff --git a/gcc/config/alpha/alpha.c b/gcc/config/alpha/alpha.c
index b2ff003a959..9d7da136499 100644
--- a/gcc/config/alpha/alpha.c
+++ b/gcc/config/alpha/alpha.c
@@ -2012,38 +2012,22 @@ split_small_symbolic_operand (rtx x)
Technically we could copy them if we could set up a mapping from one
sequence number to another, across the set of insns to be duplicated.
This seems overly complicated and error-prone since interblock motion
- from sched-ebb could move one of the pair of insns to a different block. */
+ from sched-ebb could move one of the pair of insns to a different block.
+
+ Also cannot allow jsr insns to be duplicated. If they throw exceptions,
+ then they'll be in a different block from their ldgp. Which could lead
+ the bb reorder code to think that it would be ok to copy just the block
+ containing the call and branch to the block containing the ldgp. */
static bool
alpha_cannot_copy_insn_p (rtx insn)
{
- rtx pat;
-
if (!reload_completed || !TARGET_EXPLICIT_RELOCS)
return false;
-
- if (GET_CODE (insn) != INSN)
- return false;
- if (asm_noperands (insn) >= 0)
- return false;
-
- pat = PATTERN (insn);
- if (GET_CODE (pat) != SET)
+ if (recog_memoized (insn) >= 0)
+ return get_attr_cannot_copy (insn);
+ else
return false;
- pat = SET_SRC (pat);
- if (GET_CODE (pat) == UNSPEC_VOLATILE)
- {
- if (XINT (pat, 1) == UNSPECV_LDGP1
- || XINT (pat, 1) == UNSPECV_PLDGP2)
- return true;
- }
- else if (GET_CODE (pat) == UNSPEC)
- {
- if (XINT (pat, 1) == UNSPEC_LDGP2)
- return true;
- }
-
- return false;
}
@@ -5141,7 +5125,7 @@ alpha_multipass_dfa_lookahead (void)
struct machine_function GTY(())
{
- /* For unicosmk. */
+ /* For unicosmk. */
/* List of call information words for calls from this function. */
struct rtx_def *first_ciw;
struct rtx_def *last_ciw;
@@ -5150,7 +5134,7 @@ struct machine_function GTY(())
/* List of deferred case vectors. */
struct rtx_def *addr_list;
- /* For OSF. */
+ /* For OSF. */
const char *some_ld_name;
};
@@ -6096,10 +6080,10 @@ function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
return gen_rtx_REG (mode, regnum);
}
-tree
-alpha_build_va_list (void)
+static tree
+alpha_build_builtin_va_list (void)
{
- tree base, ofs, record, type_decl;
+ tree base, ofs, space, record, type_decl;
if (TARGET_ABI_OPEN_VMS || TARGET_ABI_UNICOSMK)
return ptr_type_node;
@@ -6111,9 +6095,16 @@ alpha_build_va_list (void)
/* C++? SET_IS_AGGR_TYPE (record, 1); */
+ /* Dummy field to prevent alignment warnings. */
+ space = build_decl (FIELD_DECL, NULL_TREE, integer_type_node);
+ DECL_FIELD_CONTEXT (space) = record;
+ DECL_ARTIFICIAL (space) = 1;
+ DECL_IGNORED_P (space) = 1;
+
ofs = build_decl (FIELD_DECL, get_identifier ("__offset"),
integer_type_node);
DECL_FIELD_CONTEXT (ofs) = record;
+ TREE_CHAIN (ofs) = space;
base = build_decl (FIELD_DECL, get_identifier ("__base"),
ptr_type_node);
@@ -6686,7 +6677,7 @@ alpha_expand_builtin (tree exp, rtx target,
/* These variables are used for communication between the following functions.
They indicate various things about the current function being compiled
that are used to tell what kind of prologue, epilogue and procedure
- descriptior to generate. */
+ descriptor to generate. */
/* Nonzero if we need a stack procedure. */
enum alpha_procedure_types {PT_NULL = 0, PT_REGISTER = 1, PT_STACK = 2};
@@ -6712,13 +6703,10 @@ alpha_sa_mask (unsigned long *imaskP, unsigned long *fmaskP)
unsigned long fmask = 0;
unsigned int i;
- /* Irritatingly, there are two kinds of thunks -- those created with
- TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go
- through the regular part of the compiler. In the
- TARGET_ASM_OUTPUT_MI_THUNK case we don't have valid register life
- info, but assemble_start_function wants to output .frame and
- .mask directives. */
- if (current_function_is_thunk && !no_new_pseudos)
+ /* When outputting a thunk, we don't have valid register life info,
+ but assemble_start_function wants to output .frame and .mask
+ directives. */
+ if (current_function_is_thunk)
{
*imaskP = 0;
*fmaskP = 0;
@@ -6942,12 +6930,21 @@ alpha_does_function_need_gp (void)
if (! TARGET_ABI_OSF)
return 0;
+ /* We need the gp to load the address of __mcount. */
if (TARGET_PROFILING_NEEDS_GP && current_function_profile)
return 1;
+ /* The code emitted by alpha_output_mi_thunk_osf uses the gp. */
if (current_function_is_thunk)
return 1;
+ /* The nonlocal receiver pattern assumes that the gp is valid for
+ the nested function. Reasonable because it's almost always set
+ correctly already. For the cases where that's wrong, make sure
+ the nested function loads its gp on entry. */
+ if (current_function_has_nonlocal_goto)
+ return 1;
+
/* If we need a GP (we have a LDSYM insn or a CALL_INSN), load it first.
Even if we are a static function, we still need to do this in case
our address is taken and passed to something like qsort. */
@@ -8829,7 +8826,7 @@ alpha_align_insns (unsigned int max_align,
int nop_count = (align - ofs) / 4;
rtx where;
- /* Insert nops before labels, branches, and calls to truely merge
+ /* Insert nops before labels, branches, and calls to truly merge
the execution of the nops with the previous instruction group. */
where = prev_nonnote_insn (i);
if (where)
@@ -10204,6 +10201,9 @@ alpha_init_libfuncs (void)
#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST alpha_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/alpha/alpha.h b/gcc/config/alpha/alpha.h
index a6d33220709..fac277240a3 100644
--- a/gcc/config/alpha/alpha.h
+++ b/gcc/config/alpha/alpha.h
@@ -818,7 +818,7 @@ enum reg_class {
'U' is a symbolic operand.
- 'W' is a vector zero. */
+ 'W' is a vector zero. */
#define EXTRA_CONSTRAINT alpha_extra_constraint
@@ -1679,10 +1679,6 @@ do { \
{"some_small_symbolic_operand", {SET, PARALLEL, PREFETCH, UNSPEC, \
UNSPEC_VOLATILE}},
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = alpha_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
alpha_va_start (valist, nextarg)
diff --git a/gcc/config/alpha/alpha.md b/gcc/config/alpha/alpha.md
index 01f96ca47c2..6c25d67dff9 100644
--- a/gcc/config/alpha/alpha.md
+++ b/gcc/config/alpha/alpha.md
@@ -97,8 +97,8 @@
;; separately.
(define_attr "type"
- "ild,fld,ldsym,ist,fst,ibr,callpal,fbr,jsr,iadd,ilog,shift,icmov,fcmov,icmp,imul,\
-fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
+ "ild,fld,ldsym,ist,fst,ibr,callpal,fbr,jsr,iadd,ilog,shift,icmov,fcmov,
+ icmp,imul,fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(const_string "iadd"))
;; Describe a user's asm statement.
@@ -154,6 +154,14 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
]
(const_string "no")))
+;; The CANNOT_COPY attribute marks instructions with relocations that
+;; cannot easily be duplicated. This includes insns with gpdisp relocs
+;; since they have to stay in 1-1 correspondence with one another. This
+;; also includes jsr insns, since they must stay in correspondence with
+;; the immediately following gpdisp instructions.
+
+(define_attr "cannot_copy" "false,true"
+ (const_string "false"))
;; Include scheduling descriptions.
@@ -4740,7 +4748,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(use (match_operand 3 "const_int_operand" ""))]
"TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
"jsr $26,(%0),%2%J3"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "cannot_copy" "true")])
;; We output a nop after noreturn calls at the very end of the function to
;; ensure that the return address always remains in the caller's code range,
@@ -6814,7 +6823,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand 2 "const_int_operand" "")]
UNSPECV_LDGP1))]
"TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
- "ldah %0,0(%1)\t\t!gpdisp!%2")
+ "ldah %0,0(%1)\t\t!gpdisp!%2"
+ [(set_attr "cannot_copy" "true")])
(define_insn "*ldgp_er_2"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -6822,7 +6832,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand 2 "const_int_operand" "")]
UNSPEC_LDGP2))]
"TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
- "lda %0,0(%1)\t\t!gpdisp!%2")
+ "lda %0,0(%1)\t\t!gpdisp!%2"
+ [(set_attr "cannot_copy" "true")])
(define_insn "*prologue_ldgp_er_2"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -6830,7 +6841,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand 2 "const_int_operand" "")]
UNSPECV_PLDGP2))]
"TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
- "lda %0,0(%1)\t\t!gpdisp!%2\n$%~..ng:")
+ "lda %0,0(%1)\t\t!gpdisp!%2\n$%~..ng:"
+ [(set_attr "cannot_copy" "true")])
(define_insn "*prologue_ldgp_1"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -6838,7 +6850,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(match_operand 2 "const_int_operand" "")]
UNSPECV_LDGP1))]
""
- "ldgp %0,0(%1)\n$%~..ng:")
+ "ldgp %0,0(%1)\n$%~..ng:"
+ [(set_attr "cannot_copy" "true")])
(define_insn "*prologue_ldgp_2"
[(set (match_operand:DI 0 "register_operand" "=r")
@@ -7974,7 +7987,8 @@ fadd,fmul,fcpys,fdiv,fsqrt,misc,mvi,ftoi,itof,multi,none"
(use (match_operand 4 "" ""))]
"TARGET_EXPLICIT_RELOCS && TARGET_ABI_OSF"
"jsr $26,(%1),%3%J4"
- [(set_attr "type" "jsr")])
+ [(set_attr "type" "jsr")
+ (set_attr "cannot_copy" "true")])
(define_insn "*call_value_osf_1_noreturn"
[(set (match_operand 0 "" "")
diff --git a/gcc/config/alpha/elf.h b/gcc/config/alpha/elf.h
index f84fe3df5a2..34bba3ecb17 100644
--- a/gcc/config/alpha/elf.h
+++ b/gcc/config/alpha/elf.h
@@ -18,7 +18,7 @@ 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. */
+Boston, MA 02111-1307, USA. */
#undef OBJECT_FORMAT_COFF
#undef EXTENDED_COFF
@@ -215,7 +215,7 @@ extern void sdata_section (void);
#undef SECTION_FUNCTION_TEMPLATE
#define SECTION_FUNCTION_TEMPLATE(FN, ENUM, OP) \
-void FN () \
+void FN (void) \
{ \
if (in_section != ENUM) \
{ \
@@ -389,7 +389,7 @@ void FN () \
/* Provide a STARTFILE_SPEC appropriate for ELF. Here we add the
(even more) magical crtbegin.o file which provides part of the
support for getting C++ file-scope static object constructed
- before entering `main'. */
+ before entering `main'. */
#undef STARTFILE_SPEC
#ifdef HAVE_LD_PIE
diff --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h
index db2a278db4a..40348c60abb 100644
--- a/gcc/config/alpha/gnu.h
+++ b/gcc/config/alpha/gnu.h
@@ -6,11 +6,8 @@
#undef TARGET_OS_CPP_BUILTINS /* config.gcc includes alpha/linux.h. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define ("__GNU__"); \
- builtin_define ("__gnu_hurd__"); \
+ HURD_TARGET_OS_CPP_BUILTINS(); \
builtin_define ("_LONGLONG"); \
- builtin_define_std ("unix"); \
- builtin_assert ("system=gnu"); \
} while (0)
#undef ELF_DYNAMIC_LINKER
diff --git a/gcc/config/alpha/lib1funcs.asm b/gcc/config/alpha/lib1funcs.asm
index 6bea231bc06..a2abb1f8ae4 100644
--- a/gcc/config/alpha/lib1funcs.asm
+++ b/gcc/config/alpha/lib1funcs.asm
@@ -307,7 +307,7 @@ $46:
conventions. */
#if TYPE == UNSIGNED && SIZE == 32
/* This could be avoided by adding some CPP hair to the divide loop.
- It is probably not worth the added complexity. */
+ It is probably not worth the added complexity. */
addl RETREG,0,RETREG
#endif
diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
index 2c9cc8ea6a1..a4bc3d3e4a4 100644
--- a/gcc/config/alpha/linux.h
+++ b/gcc/config/alpha/linux.h
@@ -30,6 +30,8 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
builtin_assert ("system=linux"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=posix"); \
/* The GNU C++ standard library requires this. */ \
if (c_dialect_cxx ()) \
builtin_define ("_GNU_SOURCE"); \
diff --git a/gcc/config/alpha/openbsd.h b/gcc/config/alpha/openbsd.h
index 45f627de142..b9df2e4255c 100644
--- a/gcc/config/alpha/openbsd.h
+++ b/gcc/config/alpha/openbsd.h
@@ -72,7 +72,7 @@ Boston, MA 02111-1307, USA. */
/* Assembler format: exception region output. */
/* All configurations that don't use elf must be explicit about not using
- dwarf unwind information. */
+ dwarf unwind information. */
#ifdef INCOMING_RETURN_ADDR_RTX
#undef DWARF2_UNWIND_INFO
#define DWARF2_UNWIND_INFO 0
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 13e7626baca..fd72ba38132 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -49,6 +49,13 @@ Boston, MA 02111-1307, USA. */
to be defined for <math.h>. */ \
if (LONG_DOUBLE_TYPE_SIZE == 128) \
builtin_define ("__X_FLOAT"); \
+ \
+ /* Tru64 UNIX V4/V5 provide several ISO C94 \
+ features protected by the corresponding \
+ __STDC_VERSION__ macro. libstdc++ v3 \
+ needs them as well. */ \
+ if (c_dialect_cxx ()) \
+ builtin_define ("__STDC_VERSION__=199409L"); \
} while (0)
/* Accept DEC C flags for multithreaded programs. We use _PTHREAD_USE_D4
diff --git a/gcc/config/alpha/unicosmk.h b/gcc/config/alpha/unicosmk.h
index c7f2bfe4aa7..5f75bbb87af 100644
--- a/gcc/config/alpha/unicosmk.h
+++ b/gcc/config/alpha/unicosmk.h
@@ -290,7 +290,7 @@ SSIB_SECTION
extern void common_section (void);
#define COMMON_SECTION \
void \
-common_section () \
+common_section (void) \
{ \
in_section = in_common; \
}
@@ -298,7 +298,7 @@ common_section () \
extern void ssib_section (void);
#define SSIB_SECTION \
void \
-ssib_section () \
+ssib_section (void) \
{ \
in_section = in_ssib; \
}
@@ -480,7 +480,6 @@ ssib_section () \
#undef SDB_DEBUGGING_INFO
#undef MIPS_DEBUGGING_INFO
#undef DBX_DEBUGGING_INFO
-#undef DWARF_DEBUGGING_INFO
#undef DWARF2_DEBUGGING_INFO
#undef DWARF2_UNWIND_INFO
#undef INCOMING_RETURN_ADDR_RTX
@@ -496,7 +495,6 @@ ssib_section () \
#undef LIB_SPEC
#define LIB_SPEC "-L/opt/ctl/craylibs/craylibs -lu -lm -lc -lsma"
-#undef BUILD_VA_LIST_TYPE
#undef EXPAND_BUILTIN_VA_START
#undef EXPAND_BUILTIN_VA_ARG
diff --git a/gcc/config/alpha/vms-cc.c b/gcc/config/alpha/vms-cc.c
index 8dd12da9f43..672a30fe468 100644
--- a/gcc/config/alpha/vms-cc.c
+++ b/gcc/config/alpha/vms-cc.c
@@ -49,22 +49,22 @@ static char *default_defines = (char *) "";
static char *defines;
/* Translate a Unix syntax directory specification into VMS syntax.
- If indicators of VMS syntax found, return input string. */
+ If indicators of VMS syntax found, return input string. */
static char *to_host_dir_spec (char *);
/* Translate a Unix syntax file specification into VMS syntax.
- If indicators of VMS syntax found, return input string. */
+ If indicators of VMS syntax found, return input string. */
static char *to_host_file_spec (char *);
-/* Add a translated arg to the list to be passed to DEC CC */
+/* Add a translated arg to the list to be passed to DEC CC. */
static void addarg (const char *);
/* Preprocess the number of args in P_ARGC and contained in ARGV.
- Look for special flags, etc. that must be handled first. */
+ Look for special flags, etc. that must be handled first. */
static void preprocess_args (int *, char **);
/* Process the number of args in P_ARGC and contained in ARGV. Look
- for special flags, etc. that must be handled for the VMS compiler. */
+ for special flags, etc. that must be handled for the VMS compiler. */
static void process_args (int *, char **);
/* Action routine called by decc$to_vms */
diff --git a/gcc/config/alpha/vms-crt0-64.c b/gcc/config/alpha/vms-crt0-64.c
index 845059c83cd..9792f9205a5 100644
--- a/gcc/config/alpha/vms-crt0-64.c
+++ b/gcc/config/alpha/vms-crt0-64.c
@@ -77,7 +77,7 @@ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6)
#pragma __pointer_size long
- /* Reallocate argv with 64 bit pointers. */
+ /* Reallocate argv with 64 bit pointers. */
long_argv = (char **) malloc (sizeof (char *) * (argc + 1));
for (i = 0; i < argc; i++)
diff --git a/gcc/config/alpha/vms-crt0.c b/gcc/config/alpha/vms-crt0.c
index a3c1310da0d..88896c63af7 100644
--- a/gcc/config/alpha/vms-crt0.c
+++ b/gcc/config/alpha/vms-crt0.c
@@ -33,7 +33,7 @@ You Lose! This file can only be compiled with DEC C.
#else
/* This file can only be compiled with DEC C, due to the call to
- lib$establish. */
+ lib$establish. */
#include <stdlib.h>
#include <string.h>
diff --git a/gcc/config/alpha/vms-ld.c b/gcc/config/alpha/vms-ld.c
index bb7495ed14d..cb1d4c93faa 100644
--- a/gcc/config/alpha/vms-ld.c
+++ b/gcc/config/alpha/vms-ld.c
@@ -44,7 +44,7 @@ static char *vmsdwarf2spec = 0;
/* File specification for vms-dwarf2eh.o. */
static char *vmsdwarf2ehspec = 0;
-/* verbose = 1 if -v passed. */
+/* verbose = 1 if -v passed. */
static int verbose = 0;
/* save_temps = 1 if -save-temps passed. */
@@ -95,10 +95,10 @@ static void addarg (const char *);
static int is_regular_file (char *);
/* Translate a Unix syntax file specification FILESPEC into VMS syntax.
- If indicators of VMS syntax found, return input string. */
+ If indicators of VMS syntax found, return input string. */
static char *to_host_file_spec (char *);
-/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */
+/* Locate the library named LIB_NAME in the set of paths PATH_VAL. */
static char *locate_lib (char *, char *);
/* Given a library name NAME, i.e. foo, Look for libfoo.lib and then
@@ -106,15 +106,15 @@ static char *locate_lib (char *, char *);
static const char *expand_lib (char *);
/* Preprocess the number of args P_ARGC in ARGV.
- Look for special flags, etc. that must be handled first. */
+ Look for special flags, etc. that must be handled first. */
static void preprocess_args (int *, char **);
/* Preprocess the number of args P_ARGC in ARGV. Look for
- special flags, etc. that must be handled for the VMS linker. */
+ special flags, etc. that must be handled for the VMS linker. */
static void process_args (int *, char **);
/* Action routine called by decc$to_vms. NAME is a file name or
- directory name. TYPE is unused. */
+ directory name. TYPE is unused. */
static int translate_unix (char *, int);
int main (int, char **);
diff --git a/gcc/config/alpha/vms-psxcrt0-64.c b/gcc/config/alpha/vms-psxcrt0-64.c
index 7f93392e484..8ca9e1d07b5 100644
--- a/gcc/config/alpha/vms-psxcrt0-64.c
+++ b/gcc/config/alpha/vms-psxcrt0-64.c
@@ -79,7 +79,7 @@ __main (arg1, arg2, arg3, image_file_desc, arg5, arg6)
#pragma __pointer_size long
- /* Reallocate argv with 64 bit pointers. */
+ /* Reallocate argv with 64 bit pointers. */
long_argv = (char **) malloc (sizeof (char *) * (argc + 1));
for (i = 0; i < argc; i++)
diff --git a/gcc/config/alpha/vms-psxcrt0.c b/gcc/config/alpha/vms-psxcrt0.c
index 1b51f6d2172..65962ee2219 100644
--- a/gcc/config/alpha/vms-psxcrt0.c
+++ b/gcc/config/alpha/vms-psxcrt0.c
@@ -33,7 +33,7 @@ You Lose! This file can only be compiled with DEC C.
#else
/* This file can only be compiled with DEC C, due to the call to
- lib$establish. */
+ lib$establish. */
#include <stdlib.h>
#include <string.h>
diff --git a/gcc/config/alpha/vms.h b/gcc/config/alpha/vms.h
index 8b065e7b9b0..338ed559a32 100644
--- a/gcc/config/alpha/vms.h
+++ b/gcc/config/alpha/vms.h
@@ -218,7 +218,7 @@ typedef struct {int num_args; enum avms_arg_type atypes[6];} avms_arg_info;
#undef EXTRA_SECTION_FUNCTIONS
#define EXTRA_SECTION_FUNCTIONS \
void \
-link_section () \
+link_section (void) \
{ \
if (in_section != in_link) \
{ \
@@ -227,7 +227,7 @@ link_section () \
} \
} \
void \
-literals_section () \
+literals_section (void) \
{ \
if (in_section != in_literals) \
{ \
@@ -422,7 +422,7 @@ do { \
}
/* Link with vms-dwarf2.o if -g (except -g0). This causes the
- VMS link to pull all the dwarf2 debug sections together. */
+ VMS link to pull all the dwarf2 debug sections together. */
#undef LINK_SPEC
#define LINK_SPEC "%{g:-g vms-dwarf2.o%s} %{g0} %{g1:-g1 vms-dwarf2.o%s} \
%{g2:-g2 vms-dwarf2.o%s} %{g3:-g3 vms-dwarf2.o%s} %{shared} %{v} %{map}"
diff --git a/gcc/config/arc/arc-protos.h b/gcc/config/arc/arc-protos.h
index 511c1c76026..681e9e1ad92 100644
--- a/gcc/config/arc/arc-protos.h
+++ b/gcc/config/arc/arc-protos.h
@@ -20,58 +20,57 @@ Boston, MA 02111-1307, USA. */
#ifdef RTX_CODE
#ifdef TREE_CODE
-extern void arc_va_start PARAMS ((tree, rtx));
-extern rtx arc_va_arg PARAMS ((tree, tree));
+extern void arc_va_start (tree, rtx);
+extern rtx arc_va_arg (tree, tree);
#endif /* TREE_CODE */
-extern enum machine_mode arc_select_cc_mode PARAMS ((enum rtx_code, rtx, rtx));
+extern enum machine_mode arc_select_cc_mode (enum rtx_code, rtx, rtx);
/* Define the function that build the compare insn for scc and bcc. */
-extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx));
+extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx);
/* Declarations for various fns used in the .md file. */
-extern const char *output_shift PARAMS ((rtx *));
+extern const char *output_shift (rtx *);
-extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int arc_double_limm_p PARAMS ((rtx));
-extern int arc_eligible_for_epilogue_delay PARAMS ((rtx, int));
-extern void arc_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern void arc_print_operand PARAMS ((FILE *, rtx, int));
-extern void arc_print_operand_address PARAMS ((FILE *, rtx));
-extern void arc_final_prescan_insn PARAMS ((rtx, rtx *, int));
-extern int call_address_operand PARAMS ((rtx, enum machine_mode));
-extern int call_operand PARAMS ((rtx, enum machine_mode));
-extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int short_immediate_operand PARAMS ((rtx, enum machine_mode));
-extern int long_immediate_operand PARAMS ((rtx, enum machine_mode));
-extern int long_immediate_loadstore_operand PARAMS ((rtx, enum machine_mode));
-extern int move_src_operand PARAMS ((rtx, enum machine_mode));
-extern int move_double_src_operand PARAMS ((rtx, enum machine_mode));
-extern int move_dest_operand PARAMS ((rtx, enum machine_mode));
-extern int load_update_operand PARAMS ((rtx, enum machine_mode));
-extern int store_update_operand PARAMS ((rtx, enum machine_mode));
-extern int nonvol_nonimm_operand PARAMS ((rtx, enum machine_mode));
-extern int const_sint32_operand PARAMS ((rtx, enum machine_mode));
-extern int const_uint32_operand PARAMS ((rtx, enum machine_mode));
-extern int proper_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int shift_operator PARAMS ((rtx, enum machine_mode));
+extern int symbolic_operand (rtx, enum machine_mode);
+extern int arc_double_limm_p (rtx);
+extern int arc_eligible_for_epilogue_delay (rtx, int);
+extern void arc_initialize_trampoline (rtx, rtx, rtx);
+extern void arc_print_operand (FILE *, rtx, int);
+extern void arc_print_operand_address (FILE *, rtx);
+extern void arc_final_prescan_insn (rtx, rtx *, int);
+extern int call_address_operand (rtx, enum machine_mode);
+extern int call_operand (rtx, enum machine_mode);
+extern int symbolic_memory_operand (rtx, enum machine_mode);
+extern int short_immediate_operand (rtx, enum machine_mode);
+extern int long_immediate_operand (rtx, enum machine_mode);
+extern int long_immediate_loadstore_operand (rtx, enum machine_mode);
+extern int move_src_operand (rtx, enum machine_mode);
+extern int move_double_src_operand (rtx, enum machine_mode);
+extern int move_dest_operand (rtx, enum machine_mode);
+extern int load_update_operand (rtx, enum machine_mode);
+extern int store_update_operand (rtx, enum machine_mode);
+extern int nonvol_nonimm_operand (rtx, enum machine_mode);
+extern int const_sint32_operand (rtx, enum machine_mode);
+extern int const_uint32_operand (rtx, enum machine_mode);
+extern int proper_comparison_operator (rtx, enum machine_mode);
+extern int shift_operator (rtx, enum machine_mode);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern enum arc_function_type arc_compute_function_type PARAMS ((tree));
-extern void arc_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode, tree,
- int *, int));
+extern enum arc_function_type arc_compute_function_type (tree);
+extern void arc_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode,
+ tree, int *, int);
#endif /* TREE_CODE */
-extern void arc_init PARAMS ((void));
-extern unsigned int arc_compute_frame_size PARAMS ((int));
-extern void arc_save_restore PARAMS ((FILE *, const char *, unsigned int,
- unsigned int, const char *));
-extern int arc_delay_slots_for_epilogue PARAMS ((void));
-extern void arc_finalize_pic PARAMS ((void));
-extern void arc_ccfsm_at_label PARAMS ((const char *, int));
-extern int arc_ccfsm_branch_deleted_p PARAMS ((void));
-extern void arc_ccfsm_record_branch_deleted PARAMS ((void));
+extern void arc_init (void);
+extern unsigned int arc_compute_frame_size (int);
+extern void arc_save_restore (FILE *, const char *, unsigned int,
+ unsigned int, const char *);
+extern int arc_delay_slots_for_epilogue (void);
+extern void arc_finalize_pic (void);
+extern void arc_ccfsm_at_label (const char *, int);
+extern int arc_ccfsm_branch_deleted_p (void);
+extern void arc_ccfsm_record_branch_deleted (void);
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index 4e2022e5111..876bef56828 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -86,18 +86,18 @@ static int arc_ccfsm_target_label;
arc_print_operand. */
static int last_insn_set_cc_p;
static int current_insn_set_cc_p;
-static void record_cc_ref PARAMS ((rtx));
-static void arc_init_reg_tables PARAMS ((void));
-static int get_arc_condition_code PARAMS ((rtx));
+static void record_cc_ref (rtx);
+static void arc_init_reg_tables (void);
+static int get_arc_condition_code (rtx);
const struct attribute_spec arc_attribute_table[];
-static tree arc_handle_interrupt_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static bool arc_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void arc_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void arc_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void arc_file_start PARAMS ((void));
-static void arc_internal_label PARAMS ((FILE *, const char *, unsigned long));
-static bool arc_rtx_costs PARAMS ((rtx, int, int, int *));
-static int arc_address_cost PARAMS ((rtx));
+static tree arc_handle_interrupt_attribute (tree *, tree, tree, int, bool *);
+static bool arc_assemble_integer (rtx, unsigned int, int);
+static void arc_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void arc_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void arc_file_start (void);
+static void arc_internal_label (FILE *, const char *, unsigned long);
+static bool arc_rtx_costs (rtx, int, int, int *);
+static int arc_address_cost (rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_ALIGNED_HI_OP
@@ -128,7 +128,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
/* Called by OVERRIDE_OPTIONS to initialize various things. */
void
-arc_init ()
+arc_init (void)
{
char *tmp;
@@ -183,8 +183,7 @@ static const char *const arc_condition_codes[] =
`(eq (...) (...))'. */
static int
-get_arc_condition_code (comparison)
- rtx comparison;
+get_arc_condition_code (rtx comparison)
{
switch (GET_CODE (comparison))
{
@@ -208,9 +207,9 @@ get_arc_condition_code (comparison)
return the mode to be used for the comparison. */
enum machine_mode
-arc_select_cc_mode (op, x, y)
- enum rtx_code op;
- rtx x, y ATTRIBUTE_UNUSED;
+arc_select_cc_mode (enum rtx_code op,
+ rtx x ATTRIBUTE_UNUSED,
+ rtx y ATTRIBUTE_UNUSED)
{
switch (op)
{
@@ -284,7 +283,7 @@ unsigned int arc_mode_class [NUM_MACHINE_MODES];
enum reg_class arc_regno_reg_class[FIRST_PSEUDO_REGISTER];
static void
-arc_init_reg_tables ()
+arc_init_reg_tables (void)
{
int i;
@@ -357,12 +356,11 @@ const struct attribute_spec arc_attribute_table[] =
/* Handle an "interrupt" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-arc_handle_interrupt_attribute (node, name, args, flags, no_add_attrs)
- tree *node ATTRIBUTE_UNUSED;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+arc_handle_interrupt_attribute (tree *node ATTRIBUTE_UNUSED,
+ tree name,
+ tree args,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree value = TREE_VALUE (args);
@@ -387,9 +385,7 @@ arc_handle_interrupt_attribute (node, name, args, flags, no_add_attrs)
/* Acceptable arguments to the call insn. */
int
-call_address_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_address_operand (rtx op, enum machine_mode mode)
{
return (symbolic_operand (op, mode)
|| (GET_CODE (op) == CONST_INT && LEGITIMATE_CONSTANT_P (op))
@@ -397,9 +393,7 @@ call_address_operand (op, mode)
}
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -410,9 +404,7 @@ call_operand (op, mode)
/* Returns 1 if OP is a symbol reference. */
int
-symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -429,9 +421,7 @@ symbolic_operand (op, mode)
operand of mode MODE. */
int
-symbolic_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
@@ -445,9 +435,7 @@ symbolic_memory_operand (op, mode)
/* Return true if OP is a short immediate (shimm) value. */
int
-short_immediate_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+short_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -458,9 +446,7 @@ short_immediate_operand (op, mode)
This is currently only used when calculating length attributes. */
int
-long_immediate_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+long_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -488,9 +474,8 @@ long_immediate_operand (op, mode)
This is currently only used when calculating length attributes. */
int
-long_immediate_loadstore_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+long_immediate_loadstore_operand (rtx op,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -530,9 +515,7 @@ long_immediate_loadstore_operand (op, mode)
move source. */
int
-move_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_src_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -572,9 +555,7 @@ move_src_operand (op, mode)
move source. */
int
-move_double_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_double_src_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -604,9 +585,7 @@ move_double_src_operand (op, mode)
/* Return true if OP is an acceptable argument for a move destination. */
int
-move_dest_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_dest_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -629,9 +608,7 @@ move_dest_operand (op, mode)
/* Return true if OP is valid load with update operand. */
int
-load_update_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+load_update_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM
|| GET_MODE (op) != mode)
@@ -648,9 +625,7 @@ load_update_operand (op, mode)
/* Return true if OP is valid store with update operand. */
int
-store_update_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+store_update_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM
|| GET_MODE (op) != mode)
@@ -670,9 +645,7 @@ store_update_operand (op, mode)
and only the standard movXX patterns are set up to handle them. */
int
-nonvol_nonimm_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+nonvol_nonimm_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == MEM && MEM_VOLATILE_P (op))
return 0;
@@ -684,9 +657,7 @@ nonvol_nonimm_operand (op, mode)
contexts. */
int
-const_sint32_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_sint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* All allowed constants will fit a CONST_INT. */
return (GET_CODE (op) == CONST_INT
@@ -698,9 +669,7 @@ const_sint32_operand (op, mode)
need some extra crud to make it work when hosted on 64-bit machines. */
int
-const_uint32_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_uint32_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
#if HOST_BITS_PER_WIDE_INT > 32
/* All allowed constants will fit a CONST_INT. */
@@ -719,9 +688,7 @@ const_uint32_operand (op, mode)
comparisons that use the bits that are valid. */
int
-proper_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+proper_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -742,9 +709,7 @@ proper_comparison_operator (op, mode)
return the rtx for the cc reg in the proper mode. */
rtx
-gen_compare_reg (code, x, y)
- enum rtx_code code;
- rtx x, y;
+gen_compare_reg (enum rtx_code code, rtx x, rtx y)
{
enum machine_mode mode = SELECT_CC_MODE (code, x, y);
rtx cc_reg;
@@ -761,8 +726,7 @@ gen_compare_reg (code, x, y)
We assume the value can be either signed or unsigned. */
int
-arc_double_limm_p (value)
- rtx value;
+arc_double_limm_p (rtx value)
{
HOST_WIDE_INT low, high;
@@ -798,12 +762,11 @@ arc_double_limm_p (value)
to compensate. */
void
-arc_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int *pretend_size;
- int no_rtl;
+arc_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size,
+ int no_rtl)
{
int first_anon_arg;
@@ -845,11 +808,7 @@ arc_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-arc_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code;
- int outer_code ATTRIBUTE_UNUSED;
- int *total;
+arc_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
{
switch (code)
{
@@ -903,8 +862,7 @@ arc_rtx_costs (x, code, outer_code, total)
If ADDR is not a valid address, its cost is irrelevant. */
static int
-arc_address_cost (addr)
- rtx addr;
+arc_address_cost (rtx addr)
{
switch (GET_CODE (addr))
{
@@ -1019,8 +977,7 @@ static struct arc_frame_info zero_frame_info;
call with DECL = NULL_TREE. */
enum arc_function_type
-arc_compute_function_type (decl)
- tree decl;
+arc_compute_function_type (tree decl)
{
tree a;
/* Cached value. */
@@ -1090,8 +1047,7 @@ arc_compute_function_type (decl)
SIZE is the size needed for local variables. */
unsigned int
-arc_compute_frame_size (size)
- int size; /* # of var. bytes allocated. */
+arc_compute_frame_size (int size /* # of var. bytes allocated. */)
{
int regno;
unsigned int total_size, var_size, args_size, pretend_size, extra_size;
@@ -1155,12 +1111,11 @@ arc_compute_frame_size (size)
/* Common code to save/restore registers. */
void
-arc_save_restore (file, base_reg, offset, gmask, op)
- FILE *file;
- const char *base_reg;
- unsigned int offset;
- unsigned int gmask;
- const char *op;
+arc_save_restore (FILE *file,
+ const char *base_reg,
+ unsigned int offset,
+ unsigned int gmask,
+ const char *op)
{
int regno;
@@ -1183,10 +1138,7 @@ arc_save_restore (file, base_reg, offset, gmask, op)
symbols. */
static bool
-arc_assemble_integer (x, size, aligned_p)
- rtx x;
- unsigned int size;
- int aligned_p;
+arc_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
if (size == UNITS_PER_WORD && aligned_p
&& ((GET_CODE (x) == SYMBOL_REF && SYMBOL_REF_FUNCTION_P (x))
@@ -1203,9 +1155,7 @@ arc_assemble_integer (x, size, aligned_p)
/* Set up the stack and frame pointer (if desired) for the function. */
static void
-arc_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+arc_output_function_prologue (FILE *file, HOST_WIDE_INT size)
{
const char *sp_str = reg_names[STACK_POINTER_REGNUM];
const char *fp_str = reg_names[FRAME_POINTER_REGNUM];
@@ -1281,9 +1231,7 @@ arc_output_function_prologue (file, size)
and regs. */
static void
-arc_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+arc_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
{
rtx epilogue_delay = current_function_epilogue_delay_list;
int noepilogue = FALSE;
@@ -1446,7 +1394,7 @@ arc_output_function_epilogue (file, size)
delay slot so for now we only consider functions with empty frames. */
int
-arc_delay_slots_for_epilogue ()
+arc_delay_slots_for_epilogue (void)
{
if (arc_compute_function_type (current_function_decl) != ARC_FUNCTION_NORMAL)
return 0;
@@ -1462,9 +1410,7 @@ arc_delay_slots_for_epilogue ()
pointer or any call-saved register is OK. SLOT will always be 0. */
int
-arc_eligible_for_epilogue_delay (trial, slot)
- rtx trial;
- int slot;
+arc_eligible_for_epilogue_delay (rtx trial, int slot)
{
if (slot != 0)
abort ();
@@ -1489,7 +1435,7 @@ arc_eligible_for_epilogue_delay (trial, slot)
/* Emit special PIC prologues and epilogues. */
void
-arc_finalize_pic ()
+arc_finalize_pic (void)
{
/* nothing to do */
}
@@ -1497,9 +1443,7 @@ arc_finalize_pic ()
/* Return true if OP is a shift operator. */
int
-shift_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -1527,8 +1471,7 @@ shift_operator (op, mode)
using it here will give us a chance to play with it. */
const char *
-output_shift (operands)
- rtx *operands;
+output_shift (rtx *operands)
{
rtx shift = operands[3];
enum machine_mode mode = GET_MODE (shift);
@@ -1649,8 +1592,9 @@ output_shift (operands)
CXT is an RTX for the static chain value for the function. */
void
-arc_initialize_trampoline (tramp, fnaddr, cxt)
- rtx tramp ATTRIBUTE_UNUSED, fnaddr ATTRIBUTE_UNUSED, cxt ATTRIBUTE_UNUSED;
+arc_initialize_trampoline (rtx tramp ATTRIBUTE_UNUSED,
+ rtx fnaddr ATTRIBUTE_UNUSED,
+ rtx cxt ATTRIBUTE_UNUSED)
{
}
@@ -1658,7 +1602,7 @@ arc_initialize_trampoline (tramp, fnaddr, cxt)
at the top of the file. */
static void
-arc_file_start ()
+arc_file_start (void)
{
default_file_start ();
fprintf (asm_out_file, "\t.cpu %s\n", arc_cpu_string);
@@ -1669,10 +1613,7 @@ arc_file_start ()
For `%' followed by punctuation, CODE is the punctuation and X is null. */
void
-arc_print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+arc_print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -1884,9 +1825,7 @@ arc_print_operand (file, x, code)
/* Print a memory address as an operand to reference that memory location. */
void
-arc_print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+arc_print_operand_address (FILE *file, rtx addr)
{
register rtx base, index = 0;
int offset = 0;
@@ -1943,8 +1882,7 @@ arc_print_operand_address (file, addr)
/* Update compare/branch separation marker. */
static void
-record_cc_ref (insn)
- rtx insn;
+record_cc_ref (rtx insn)
{
last_insn_set_cc_p = current_insn_set_cc_p;
@@ -2000,10 +1938,9 @@ record_cc_ref (insn)
we may not be outputting the branch. */
void
-arc_final_prescan_insn (insn, opvec, noperands)
- rtx insn;
- rtx *opvec ATTRIBUTE_UNUSED;
- int noperands ATTRIBUTE_UNUSED;
+arc_final_prescan_insn (rtx insn,
+ rtx *opvec ATTRIBUTE_UNUSED,
+ int noperands ATTRIBUTE_UNUSED)
{
/* BODY will hold the body of INSN. */
register rtx body = PATTERN (insn);
@@ -2285,9 +2222,7 @@ arc_final_prescan_insn (insn, opvec, noperands)
Called from (*targetm.asm_out.internal_label). */
void
-arc_ccfsm_at_label (prefix, num)
- const char *prefix;
- int num;
+arc_ccfsm_at_label (const char *prefix, int num)
{
if (arc_ccfsm_state == 3 && arc_ccfsm_target_label == num
&& !strcmp (prefix, "L"))
@@ -2301,7 +2236,7 @@ arc_ccfsm_at_label (prefix, num)
deleted. */
int
-arc_ccfsm_branch_deleted_p ()
+arc_ccfsm_branch_deleted_p (void)
{
if (arc_ccfsm_state == 1 || arc_ccfsm_state == 2)
return 1;
@@ -2312,7 +2247,7 @@ arc_ccfsm_branch_deleted_p ()
conditionalized. */
void
-arc_ccfsm_record_branch_deleted ()
+arc_ccfsm_record_branch_deleted (void)
{
/* Indicate we're conditionalizing insns now. */
arc_ccfsm_state += 2;
@@ -2324,9 +2259,7 @@ arc_ccfsm_record_branch_deleted ()
}
void
-arc_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+arc_va_start (tree valist, rtx nextarg)
{
/* See arc_setup_incoming_varargs for reasons for this oddity. */
if (current_function_args_info < 8
@@ -2337,8 +2270,7 @@ arc_va_start (valist, nextarg)
}
rtx
-arc_va_arg (valist, type)
- tree valist, type;
+arc_va_arg (tree valist, tree type)
{
rtx addr_rtx;
tree addr, incr;
@@ -2413,10 +2345,7 @@ arc_va_arg (valist, type)
PREFIX is the class of label and NUM is the number within the class. */
static void
-arc_internal_label (stream, prefix, labelno)
- FILE *stream;
- const char *prefix;
- unsigned long labelno;
+arc_internal_label (FILE *stream, const char *prefix, unsigned long labelno)
{
arc_ccfsm_at_label (prefix, labelno);
default_internal_label (stream, prefix, labelno);
diff --git a/gcc/config/arc/arc.h b/gcc/config/arc/arc.h
index 2135c6c057d..5a5f168a83c 100644
--- a/gcc/config/arc/arc.h
+++ b/gcc/config/arc/arc.h
@@ -1245,7 +1245,6 @@ do { if ((LOG) != 0) fprintf (FILE, "\t.align %d\n", 1 << (LOG)); } while (0)
/* Generate DBX and DWARF debugging information. */
#define DBX_DEBUGGING_INFO 1
-#define DWARF_DEBUGGING_INFO 1
/* Prefer STABS (for now). */
#undef PREFERRED_DEBUGGING_TYPE
diff --git a/gcc/config/arc/initfini.c b/gcc/config/arc/initfini.c
index a20ae7f7947..ca88a76aee9 100644
--- a/gcc/config/arc/initfini.c
+++ b/gcc/config/arc/initfini.c
@@ -66,11 +66,11 @@ static func_ptr __DTOR_LIST__[1] __attribute__ ((section (".dtors")))
refers to one particular associated `__DTOR_LIST__' which belongs to the
same particular root executable or shared library file. */
-static void __do_global_dtors ()
+static void __do_global_dtors (void)
asm ("__do_global_dtors") __attribute__ ((section (".text")));
static void
-__do_global_dtors ()
+__do_global_dtors (void)
{
func_ptr *p;
for (p = __DTOR_LIST__ + 1; *p; p++)
@@ -125,11 +125,11 @@ static func_ptr __DTOR_END__[1] __attribute__ ((section (".dtors")))
/* Run all global constructors for the program.
Note that they are run in reverse order. */
-static void __do_global_ctors ()
+static void __do_global_ctors (void)
asm ("__do_global_ctors") __attribute__ ((section (".text")));
static void
-__do_global_ctors ()
+__do_global_ctors (void)
{
func_ptr *p;
for (p = __CTOR_END__ - 1; *p != (func_ptr) -1; p--)
diff --git a/gcc/config/arm/aof.h b/gcc/config/arm/aof.h
index 2650a0eedd2..8f058e26406 100644
--- a/gcc/config/arm/aof.h
+++ b/gcc/config/arm/aof.h
@@ -133,7 +133,7 @@
/* Some systems use __main in a way incompatible with its use in gcc, in these
cases use the macros NAME__MAIN to give a quoted symbol and SYMBOL__MAIN to
give the same symbol without quotes for an alternative entry point. You
- must define both, or neither. */
+ must define both, or neither. */
#define NAME__MAIN "__gccmain"
#define SYMBOL__MAIN __gccmain
@@ -246,7 +246,12 @@ do { \
"wr0", "wr1", "wr2", "wr3", \
"wr4", "wr5", "wr6", "wr7", \
"wr8", "wr9", "wr10", "wr11", \
- "wr12", "wr13", "wr14", "wr15" \
+ "wr12", "wr13", "wr14", "wr15", \
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
+ "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \
+ "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
+ "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
+ "vfpcc"
}
#define ADDITIONAL_REGISTER_NAMES \
@@ -267,6 +272,22 @@ do { \
{"r13", 13}, {"sp", 13}, \
{"r14", 14}, {"lr", 14}, \
{"r15", 15}, {"pc", 15} \
+ {"d0", 63}, \
+ {"d1", 65}, \
+ {"d2", 67}, \
+ {"d3", 69}, \
+ {"d4", 71}, \
+ {"d5", 73}, \
+ {"d6", 75}, \
+ {"d7", 77}, \
+ {"d8", 79}, \
+ {"d9", 81}, \
+ {"d10", 83}, \
+ {"d11", 85}, \
+ {"d12", 87}, \
+ {"d13", 89}, \
+ {"d14", 91}, \
+ {"d15", 93}, \
}
#define REGISTER_PREFIX "__"
@@ -290,7 +311,7 @@ do { \
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
fprintf ((STREAM), "\tDCD\t|L..%d|\n", (VALUE))
-/* A label marking the start of a jump table is a data label. */
+/* A label marking the start of a jump table is a data label. */
#define ASM_OUTPUT_CASE_LABEL(STREAM, PREFIX, NUM, TABLE) \
fprintf ((STREAM), "\tALIGN\n|%s..%d|\n", (PREFIX), (NUM))
diff --git a/gcc/config/arm/aout.h b/gcc/config/arm/aout.h
index 1f060fafc7b..e18a1158484 100644
--- a/gcc/config/arm/aout.h
+++ b/gcc/config/arm/aout.h
@@ -49,7 +49,7 @@
/* The assembler's names for the registers. */
#ifndef REGISTER_NAMES
-#define REGISTER_NAMES \
+#define REGISTER_NAMES \
{ \
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", \
"r8", "r9", "sl", "fp", "ip", "sp", "lr", "pc", \
@@ -63,7 +63,12 @@
"wr0", "wr1", "wr2", "wr3", \
"wr4", "wr5", "wr6", "wr7", \
"wr8", "wr9", "wr10", "wr11", \
- "wr12", "wr13", "wr14", "wr15" \
+ "wr12", "wr13", "wr14", "wr15", \
+ "s0", "s1", "s2", "s3", "s4", "s5", "s6", "s7", \
+ "s8", "s9", "s10", "s11", "s12", "s13", "s14", "s15", \
+ "s16", "s17", "s18", "s19", "s20", "s21", "s22", "s23", \
+ "s24", "s25", "s26", "s27", "s28", "s29", "s30", "s31", \
+ "vfpcc" \
}
#endif
@@ -152,7 +157,23 @@
{"mvdx12", 39}, \
{"mvdx13", 40}, \
{"mvdx14", 41}, \
- {"mvdx15", 42} \
+ {"mvdx15", 42}, \
+ {"d0", 63}, \
+ {"d1", 65}, \
+ {"d2", 67}, \
+ {"d3", 69}, \
+ {"d4", 71}, \
+ {"d5", 73}, \
+ {"d6", 75}, \
+ {"d7", 77}, \
+ {"d8", 79}, \
+ {"d9", 81}, \
+ {"d10", 83}, \
+ {"d11", 85}, \
+ {"d12", 87}, \
+ {"d13", 89}, \
+ {"d14", 91}, \
+ {"d15", 93}, \
}
#endif
diff --git a/gcc/config/arm/arm-cores.def b/gcc/config/arm/arm-cores.def
new file mode 100644
index 00000000000..038773c2b53
--- /dev/null
+++ b/gcc/config/arm/arm-cores.def
@@ -0,0 +1,87 @@
+/* ARM CPU Cores
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by CodeSourcery, LLC
+
+ 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. */
+
+/* Before using #include to read this file, define a macro:
+
+ ARM_CORE(CORE_NAME, FLAGS)
+
+ The CORE_NAME is the name of the core, represented as an identifier
+ rather than a string constant. The FLAGS are the bitwise-or of the
+ traits that apply to that core.
+
+ If you update this table, you must update the "tune" attribue in
+ arm.md. */
+
+ARM_CORE(arm2, FL_CO_PROC | FL_MODE26, slowmul)
+ARM_CORE(arm250, FL_CO_PROC | FL_MODE26, slowmul)
+ARM_CORE(arm3, FL_CO_PROC | FL_MODE26, slowmul)
+ARM_CORE(arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm60, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm600, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm610, FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm620, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm7, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+/* arm7m doesn't exist on its own, but only with D, (and I), but
+ those don't alter the code, so arm7m is sometimes used. */
+ARM_CORE(arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul)
+ARM_CORE(arm7d, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm7dm, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul)
+ARM_CORE(arm7di, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm7dmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M, fastmul)
+ARM_CORE(arm70, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm700, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm700i, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm710, FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm720, FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm710c, FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm7100, FL_MODE26 | FL_MODE32, slowmul)
+ARM_CORE(arm7500, FL_MODE26 | FL_MODE32, slowmul)
+/* Doesn't have an external co-proc, but does have embedded fpa. */
+ARM_CORE(arm7500fe, FL_CO_PROC | FL_MODE26 | FL_MODE32, slowmul)
+/* V4 Architecture Processors */
+ARM_CORE(arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul)
+ARM_CORE(arm710t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul)
+ARM_CORE(arm720t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul)
+ARM_CORE(arm740t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB, fastmul)
+ARM_CORE(arm8, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul)
+ARM_CORE(arm810, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul)
+ARM_CORE(arm9, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul)
+ARM_CORE(arm920, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, fastmul)
+ARM_CORE(arm920t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul)
+ARM_CORE(arm940t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul)
+ARM_CORE(arm9tdmi, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED, fastmul)
+ARM_CORE(arm9e, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED, 9e)
+
+ARM_CORE(ep9312, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS, fastmul)
+ARM_CORE(strongarm, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul)
+ARM_CORE(strongarm110, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul)
+ARM_CORE(strongarm1100, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul)
+ARM_CORE(strongarm1110, FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_STRONG, fastmul)
+/* V5 Architecture Processors */
+ARM_CORE(arm10tdmi, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5, fastmul)
+ARM_CORE(arm1020t, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5, fastmul)
+ARM_CORE(arm926ejs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E, 9e)
+ARM_CORE(arm1026ejs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E, 9e)
+ARM_CORE(xscale, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE, xscale)
+ARM_CORE(iwmmxt, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT, xscale)
+/* V6 Architecture Processors */
+ARM_CORE(arm1136js, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6, 9e)
+ARM_CORE(arm1136jfs, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 | FL_VFPV2, 9e)
diff --git a/gcc/config/arm/arm-generic.md b/gcc/config/arm/arm-generic.md
new file mode 100644
index 00000000000..ec2df47b465
--- /dev/null
+++ b/gcc/config/arm/arm-generic.md
@@ -0,0 +1,152 @@
+;; Generic ARM Pipeline Description
+;; Copyright (C) 2003 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. */
+
+(define_automaton "arm")
+
+;; Write buffer
+;
+; Strictly, we should model a 4-deep write buffer for ARM7xx based chips
+;
+; The write buffer on some of the arm6 processors is hard to model exactly.
+; There is room in the buffer for up to two addresses and up to eight words
+; of memory, but the two needn't be split evenly. When writing the two
+; addresses are fully pipelined. However, a read from memory that is not
+; currently in the cache will block until the writes have completed.
+; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so
+; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous
+; (they aren't allowed to be at present) then there is a startup cost of 1MCLK
+; cycle to add as well.
+(define_cpu_unit "write_buf" "arm")
+
+;; Write blockage unit
+;
+; The write_blockage unit models (partially), the fact that reads will stall
+; until the write buffer empties.
+; The f_mem_r and r_mem_f could also block, but they are to the stack,
+; so we don't model them here
+(define_cpu_unit "write_blockage" "arm")
+
+;; Core
+;
+(define_cpu_unit "core" "arm")
+
+(define_insn_reservation "r_mem_f_wbuf" 5
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "yes")
+ (eq_attr "type" "r_mem_f")))
+ "core+write_buf*3")
+
+(define_insn_reservation "store_wbuf" 5
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "yes")
+ (eq_attr "type" "store1")))
+ "core+write_buf*3+write_blockage*5")
+
+(define_insn_reservation "store2_wbuf" 7
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "yes")
+ (eq_attr "type" "store2")))
+ "core+write_buf*4+write_blockage*7")
+
+(define_insn_reservation "store3_wbuf" 9
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "yes")
+ (eq_attr "type" "store3")))
+ "core+write_buf*5+write_blockage*9")
+
+(define_insn_reservation "store4_wbuf" 11
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "yes")
+ (eq_attr "type" "store4")))
+ "core+write_buf*6+write_blockage*11")
+
+(define_insn_reservation "store2" 3
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "no")
+ (eq_attr "type" "store2")))
+ "core*3")
+
+(define_insn_reservation "store3" 4
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "no")
+ (eq_attr "type" "store3")))
+ "core*4")
+
+(define_insn_reservation "store4" 5
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "model_wbuf" "no")
+ (eq_attr "type" "store4")))
+ "core*5")
+
+(define_insn_reservation "store_ldsched" 1
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "yes")
+ (eq_attr "type" "store1")))
+ "core")
+
+(define_insn_reservation "load_ldsched_xscale" 3
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "yes")
+ (and (eq_attr "type" "load_byte,load1")
+ (eq_attr "is_xscale" "yes"))))
+ "core")
+
+(define_insn_reservation "load_ldsched" 2
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "yes")
+ (and (eq_attr "type" "load_byte,load1")
+ (eq_attr "is_xscale" "no"))))
+ "core")
+
+(define_insn_reservation "load_or_store" 2
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "!yes")
+ (eq_attr "type" "load_byte,load1,load2,load3,load4,store1")))
+ "core*2")
+
+(define_insn_reservation "mult" 16
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "no") (eq_attr "type" "mult")))
+ "core*16")
+
+(define_insn_reservation "mult_ldsched_strongarm" 3
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "yes")
+ (and (eq_attr "is_strongarm" "yes")
+ (eq_attr "type" "mult"))))
+ "core*2")
+
+(define_insn_reservation "mult_ldsched" 4
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "ldsched" "yes")
+ (and (eq_attr "is_strongarm" "no")
+ (eq_attr "type" "mult"))))
+ "core*4")
+
+(define_insn_reservation "multi_cycle" 32
+ (and (eq_attr "generic_sched" "yes")
+ (and (eq_attr "core_cycles" "multi")
+ (eq_attr "type" "!mult,load_byte,load1,load2,load3,load4,store1,store2,store3,store4")))
+ "core*32")
+
+(define_insn_reservation "single_cycle" 1
+ (and (eq_attr "generic_sched" "yes")
+ (eq_attr "core_cycles" "single"))
+ "core")
diff --git a/gcc/config/arm/arm-modes.def b/gcc/config/arm/arm-modes.def
index 1d58b18bb23..b8535519141 100644
--- a/gcc/config/arm/arm-modes.def
+++ b/gcc/config/arm/arm-modes.def
@@ -31,7 +31,7 @@ FLOAT_MODE (XF, 12, 0);
CC_NOOVmode should be used with SImode integer equalities.
CC_Zmode should be used if only the Z flag is set correctly
CC_Nmode should be used if only the N (sign) flag is set correctly
- CCmode should be used otherwise. */
+ CCmode should be used otherwise. */
CC_MODE (CC_NOOV);
CC_MODE (CC_Z);
diff --git a/gcc/config/arm/arm-protos.h b/gcc/config/arm/arm-protos.h
index 61c28be8629..25f563109ab 100644
--- a/gcc/config/arm/arm-protos.h
+++ b/gcc/config/arm/arm-protos.h
@@ -1,5 +1,6 @@
/* Prototypes for exported functions defined in arm.c and pe.c
- Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+ Free Software Foundation, Inc.
Contributed by Richard Earnshaw (rearnsha@arm.com)
Minor hacks by Nick Clifton (nickc@cygnus.com)
@@ -24,11 +25,11 @@
#define GCC_ARM_PROTOS_H
extern void arm_override_options (void);
-extern int use_return_insn (int);
+extern int use_return_insn (int, rtx);
extern int arm_regno_class (int);
extern void arm_finalize_pic (int);
extern int arm_volatile_func (void);
-extern const char *arm_output_epilogue (int);
+extern const char *arm_output_epilogue (rtx);
extern void arm_expand_prologue (void);
extern HOST_WIDE_INT arm_get_frame_size (void);
extern const char *arm_strip_name_encoding (const char *);
@@ -53,12 +54,14 @@ extern int arm_legitimate_address_p (enum machine_mode, rtx, int);
extern int thumb_legitimate_address_p (enum machine_mode, rtx, int);
extern int thumb_legitimate_offset_p (enum machine_mode, HOST_WIDE_INT);
extern rtx arm_legitimize_address (rtx, rtx, enum machine_mode);
-extern int const_double_rtx_ok_for_fpa (rtx);
+extern int arm_const_double_rtx (rtx);
extern int neg_const_double_rtx_ok_for_fpa (rtx);
+extern enum reg_class vfp_secondary_reload_class (enum machine_mode, rtx);
/* Predicates. */
extern int s_register_operand (rtx, enum machine_mode);
extern int arm_hard_register_operand (rtx, enum machine_mode);
+extern int arm_general_register_operand (rtx, enum machine_mode);
extern int f_register_operand (rtx, enum machine_mode);
extern int reg_or_int_operand (rtx, enum machine_mode);
extern int arm_reload_memory_operand (rtx, enum machine_mode);
@@ -70,8 +73,8 @@ extern int arm_not_operand (rtx, enum machine_mode);
extern int offsettable_memory_operand (rtx, enum machine_mode);
extern int alignable_memory_operand (rtx, enum machine_mode);
extern int bad_signed_byte_operand (rtx, enum machine_mode);
-extern int fpa_rhs_operand (rtx, enum machine_mode);
-extern int fpa_add_operand (rtx, enum machine_mode);
+extern int arm_float_rhs_operand (rtx, enum machine_mode);
+extern int arm_float_add_operand (rtx, enum machine_mode);
extern int power_of_two_operand (rtx, enum machine_mode);
extern int nonimmediate_di_operand (rtx, enum machine_mode);
extern int di_operand (rtx, enum machine_mode);
@@ -95,6 +98,13 @@ extern int cirrus_general_operand (rtx, enum machine_mode);
extern int cirrus_register_operand (rtx, enum machine_mode);
extern int cirrus_shift_const (rtx, enum machine_mode);
extern int cirrus_memory_offset (rtx);
+extern int vfp_mem_operand (rtx);
+extern int vfp_compare_operand (rtx, enum machine_mode);
+extern int arm_float_compare_operand (rtx, enum machine_mode);
+extern int arm_no_early_store_addr_dep (rtx, rtx);
+extern int arm_no_early_alu_shift_dep (rtx, rtx);
+extern int arm_no_early_alu_shift_value_dep (rtx, rtx);
+extern int arm_no_early_mul_dep (rtx, rtx);
extern int symbol_mentioned_p (rtx);
extern int label_mentioned_p (rtx);
@@ -138,6 +148,7 @@ extern int arm_debugger_arg_offset (int, rtx);
extern int arm_is_longcall_p (rtx, int, int);
extern int arm_emit_vector_const (FILE *, rtx);
extern const char * arm_output_load_gr (rtx *);
+extern const char *vfp_output_fstmx (rtx *);
#if defined TREE_CODE
extern rtx arm_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
diff --git a/gcc/config/arm/arm.c b/gcc/config/arm/arm.c
index f127b1d2904..1a1f92f18d2 100644
--- a/gcc/config/arm/arm.c
+++ b/gcc/config/arm/arm.c
@@ -1,6 +1,6 @@
/* Output routines for GCC for ARM.
- Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
- Free Software Foundation, Inc.
+ Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
+ 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
More major hacks by Richard Earnshaw (rearnsha@arm.com).
@@ -74,7 +74,6 @@ static bool arm_assemble_integer (rtx, unsigned int, int);
#endif
static const char *fp_const_from_val (REAL_VALUE_TYPE *);
static arm_cc get_arm_condition_code (rtx);
-static void init_fpa_table (void);
static HOST_WIDE_INT int_log2 (HOST_WIDE_INT);
static rtx is_jump_table (rtx);
static const char *output_multi_immediate (rtx *, const char *, const char *,
@@ -123,7 +122,10 @@ static void arm_internal_label (FILE *, const char *, unsigned long);
static void arm_output_mi_thunk (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT,
tree);
static int arm_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code);
-static bool arm_rtx_costs (rtx, int, int, int *);
+static bool arm_slowmul_rtx_costs (rtx, int, int, int *);
+static bool arm_fastmul_rtx_costs (rtx, int, int, int *);
+static bool arm_xscale_rtx_costs (rtx, int, int, int *);
+static bool arm_9e_rtx_costs (rtx, int, int, int *);
static int arm_address_cost (rtx);
static bool arm_memory_load_p (rtx);
static bool arm_cirrus_insn_p (rtx);
@@ -219,8 +221,9 @@ static void aof_file_end (void);
#undef TARGET_ASM_CAN_OUTPUT_MI_THUNK
#define TARGET_ASM_CAN_OUTPUT_MI_THUNK default_can_output_mi_thunk_no_vcall
+/* This will be overridden in arm_override_options. */
#undef TARGET_RTX_COSTS
-#define TARGET_RTX_COSTS arm_rtx_costs
+#define TARGET_RTX_COSTS arm_slowmul_rtx_costs
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST arm_address_cost
@@ -251,17 +254,32 @@ int making_const_table;
stored from the compare operation. */
rtx arm_compare_op0, arm_compare_op1;
-/* What type of floating point are we tuning for? */
-enum fputype arm_fpu_tune;
+/* The processor for which instructions should be scheduled. */
+enum processor_type arm_tune = arm_none;
+
+/* Which floating point model to use. */
+enum arm_fp_model arm_fp_model;
-/* What type of floating point instructions are available? */
+/* Which floating point hardware is available. */
enum fputype arm_fpu_arch;
+/* Which floating point hardware to schedule for. */
+enum fputype arm_fpu_tune;
+
+/* Whether to use floating point hardware. */
+enum float_abi_type arm_float_abi;
+
/* What program mode is the cpu running in? 26-bit mode or 32-bit mode. */
enum prog_mode_type arm_prgmode;
-/* Set by the -mfp=... option. */
-const char * target_fp_name = NULL;
+/* Set by the -mfpu=... option. */
+const char * target_fpu_name = NULL;
+
+/* Set by the -mfpe=... option. */
+const char * target_fpe_name = NULL;
+
+/* Set by the -mfloat-abi=... option. */
+const char * target_float_abi_name = NULL;
/* Used to parse -mstructure_size_boundary command line option. */
const char * structure_size_string = NULL;
@@ -269,7 +287,7 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
/* Bit values used to identify processor capabilities. */
#define FL_CO_PROC (1 << 0) /* Has external co-processor bus */
-#define FL_FAST_MULT (1 << 1) /* Fast multiply */
+#define FL_ARCH3M (1 << 1) /* Extended multiply */
#define FL_MODE26 (1 << 2) /* 26-bit mode support */
#define FL_MODE32 (1 << 3) /* 32-bit mode support */
#define FL_ARCH4 (1 << 4) /* Architecture rel 4 */
@@ -280,26 +298,25 @@ int arm_structure_size_boundary = DEFAULT_STRUCTURE_SIZE_BOUNDARY;
#define FL_ARCH5E (1 << 9) /* DSP extensions to v5 */
#define FL_XSCALE (1 << 10) /* XScale */
#define FL_CIRRUS (1 << 11) /* Cirrus/DSP. */
-#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */
-#define FL_ARCH6J (1 << 12) /* Architecture rel 6. Adds
+#define FL_ARCH6 (1 << 12) /* Architecture rel 6. Adds
media instructions. */
#define FL_VFPV2 (1 << 13) /* Vector Floating Point V2. */
+#define FL_IWMMXT (1 << 29) /* XScale v2 or "Intel Wireless MMX technology". */
+
/* The bits in this mask specify which
instructions we are allowed to generate. */
static unsigned long insn_flags = 0;
/* The bits in this mask specify which instruction scheduling options should
- be used. Note - there is an overlap with the FL_FAST_MULT. For some
- hardware we want to be able to generate the multiply instructions, but to
- tune as if they were not present in the architecture. */
+ be used. */
static unsigned long tune_flags = 0;
/* The following are used in the arm.md file as equivalents to bits
in the above two flag variables. */
-/* Nonzero if this is an "M" variant of the processor. */
-int arm_fast_multiply = 0;
+/* Nonzero if this chip supports the ARM Architecture 3M extensions. */
+int arm_arch3m = 0;
/* Nonzero if this chip supports the ARM Architecture 4 extensions. */
int arm_arch4 = 0;
@@ -310,6 +327,9 @@ int arm_arch5 = 0;
/* Nonzero if this chip supports the ARM Architecture 5E extensions. */
int arm_arch5e = 0;
+/* Nonzero if this chip supports the ARM Architecture 6 extensions. */
+int arm_arch6 = 0;
+
/* Nonzero if this chip can benefit from load scheduling. */
int arm_ld_sched = 0;
@@ -328,9 +348,6 @@ int arm_tune_xscale = 0;
/* Nonzero if this chip is an ARM6 or an ARM7. */
int arm_is_6_or_7 = 0;
-/* Nonzero if this chip is a Cirrus/DSP. */
-int arm_is_cirrus = 0;
-
/* Nonzero if generating Thumb instructions. */
int thumb_code = 0;
@@ -374,7 +391,9 @@ static const char * const arm_condition_codes[] =
struct processors
{
const char *const name;
+ enum processor_type core;
const unsigned long flags;
+ bool (* rtx_costs) (rtx, int, int, int *);
};
/* Not all of these give usefully different compilation alternatives,
@@ -382,83 +401,35 @@ struct processors
static const struct processors all_cores[] =
{
/* ARM Cores */
-
- {"arm2", FL_CO_PROC | FL_MODE26 },
- {"arm250", FL_CO_PROC | FL_MODE26 },
- {"arm3", FL_CO_PROC | FL_MODE26 },
- {"arm6", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm60", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm600", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm610", FL_MODE26 | FL_MODE32 },
- {"arm620", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm7", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- /* arm7m doesn't exist on its own, but only with D, (and I), but
- those don't alter the code, so arm7m is sometimes used. */
- {"arm7m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT },
- {"arm7d", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm7dm", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT },
- {"arm7di", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm7dmi", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT },
- {"arm70", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm700", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm700i", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- {"arm710", FL_MODE26 | FL_MODE32 },
- {"arm720", FL_MODE26 | FL_MODE32 },
- {"arm710c", FL_MODE26 | FL_MODE32 },
- {"arm7100", FL_MODE26 | FL_MODE32 },
- {"arm7500", FL_MODE26 | FL_MODE32 },
- /* Doesn't have an external co-proc, but does have embedded fpa. */
- {"arm7500fe", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- /* V4 Architecture Processors */
- {"arm7tdmi", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB },
- {"arm710t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB },
- {"arm720t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB },
- {"arm740t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB },
- {"arm8", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED },
- {"arm810", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED },
- {"arm9", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED },
- {"arm920", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED },
- {"arm920t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED },
- {"arm940t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED },
- {"arm9tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED },
- {"arm9e", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED },
- {"ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS },
- {"strongarm", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG },
- {"strongarm110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG },
- {"strongarm1100", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG },
- {"strongarm1110", FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_STRONG },
- /* V5 Architecture Processors */
- {"arm10tdmi", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 },
- {"arm1020t", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_ARCH5 },
- {"arm926ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E },
- {"arm1026ejs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E },
- {"xscale", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE },
- {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT },
- /* V6 Architecture Processors */
- {"arm1136js", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J },
- {"arm1136jfs", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J | FL_VFPV2 },
- {NULL, 0}
+#define ARM_CORE(NAME, FLAGS, COSTS) \
+ {#NAME, arm_none, FLAGS, arm_##COSTS##_rtx_costs},
+#include "arm-cores.def"
+#undef ARM_CORE
+ {NULL, arm_none, 0, NULL}
};
static const struct processors all_architectures[] =
{
/* ARM Architectures */
+ /* We don't specify rtx_costs here as it will be figured out
+ from the core. */
- { "armv2", FL_CO_PROC | FL_MODE26 },
- { "armv2a", FL_CO_PROC | FL_MODE26 },
- { "armv3", FL_CO_PROC | FL_MODE26 | FL_MODE32 },
- { "armv3m", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT },
- { "armv4", FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 },
+ { "armv2", arm2, FL_CO_PROC | FL_MODE26 , NULL},
+ { "armv2a", arm2, FL_CO_PROC | FL_MODE26 , NULL},
+ { "armv3", arm6, FL_CO_PROC | FL_MODE26 | FL_MODE32 , NULL},
+ { "armv3m", arm7m, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M , NULL},
+ { "armv4", arm7tdmi, FL_CO_PROC | FL_MODE26 | FL_MODE32 | FL_ARCH3M | FL_ARCH4 , NULL},
/* Strictly, FL_MODE26 is a permitted option for v4t, but there are no
implementations that support it, so we will leave it out for now. */
- { "armv4t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB },
- { "armv5", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 },
- { "armv5t", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 },
- { "armv5te", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E },
- { "armv6j", FL_CO_PROC | FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6J },
- { "ep9312", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS },
- {"iwmmxt", FL_MODE32 | FL_FAST_MULT | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT },
- { NULL, 0 }
+ { "armv4t", arm7tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB , NULL},
+ { "armv5", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 , NULL},
+ { "armv5t", arm10tdmi, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 , NULL},
+ { "armv5te", arm1026ejs, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E , NULL},
+ { "armv6", arm1136js, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 , NULL},
+ { "armv6j", arm1136js, FL_CO_PROC | FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_ARCH5 | FL_ARCH5E | FL_ARCH6 , NULL},
+ { "ep9312", ep9312, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_LDSCHED | FL_CIRRUS , NULL},
+ {"iwmmxt", iwmmxt, FL_MODE32 | FL_ARCH3M | FL_ARCH4 | FL_THUMB | FL_LDSCHED | FL_STRONG | FL_ARCH5 | FL_ARCH5E | FL_XSCALE | FL_IWMMXT , NULL},
+ { NULL, arm_none, 0 , NULL}
};
/* This is a magic structure. The 'string' field is magically filled in
@@ -473,6 +444,57 @@ struct arm_cpu_select arm_select[] =
{ NULL, "-mtune=", all_cores }
};
+struct fpu_desc
+{
+ const char * name;
+ enum fputype fpu;
+};
+
+
+/* Available values for for -mfpu=. */
+
+static const struct fpu_desc all_fpus[] =
+{
+ {"fpa", FPUTYPE_FPA},
+ {"fpe2", FPUTYPE_FPA_EMU2},
+ {"fpe3", FPUTYPE_FPA_EMU2},
+ {"maverick", FPUTYPE_MAVERICK},
+ {"vfp", FPUTYPE_VFP}
+};
+
+
+/* Floating point models used by the different hardware.
+ See fputype in arm.h. */
+
+static const enum fputype fp_model_for_fpu[] =
+{
+ /* No FP hardware. */
+ ARM_FP_MODEL_UNKNOWN, /* FPUTYPE_NONE */
+ ARM_FP_MODEL_FPA, /* FPUTYPE_FPA */
+ ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU2 */
+ ARM_FP_MODEL_FPA, /* FPUTYPE_FPA_EMU3 */
+ ARM_FP_MODEL_MAVERICK, /* FPUTYPE_MAVERICK */
+ ARM_FP_MODEL_VFP /* FPUTYPE_VFP */
+};
+
+
+struct float_abi
+{
+ const char * name;
+ enum float_abi_type abi_type;
+};
+
+
+/* Available values for -mfloat-abi=. */
+
+static const struct float_abi all_float_abis[] =
+{
+ {"soft", ARM_FLOAT_ABI_SOFT},
+ {"softfp", ARM_FLOAT_ABI_SOFTFP},
+ {"hard", ARM_FLOAT_ABI_HARD}
+};
+
+
/* Return the number of bits set in VALUE. */
static unsigned
bit_count (unsigned long value)
@@ -494,7 +516,7 @@ void
arm_override_options (void)
{
unsigned i;
-
+
/* Set up the flags based on the cpu/architecture selected by the user. */
for (i = ARRAY_SIZE (arm_select); i--;)
{
@@ -507,9 +529,19 @@ arm_override_options (void)
for (sel = ptr->processors; sel->name != NULL; sel++)
if (streq (ptr->string, sel->name))
{
- if (i == 2)
- tune_flags = sel->flags;
- else
+ /* Determine the processor core for which we should
+ tune code-generation. */
+ if (/* -mcpu= is a sensible default. */
+ i == 0
+ /* If -march= is used, and -mcpu= has not been used,
+ assume that we should tune for a representative
+ CPU from that architecture. */
+ || i == 1
+ /* -mtune= overrides -mcpu= and -march=. */
+ || i == 2)
+ arm_tune = (enum processor_type) (sel - ptr->processors);
+
+ if (i != 2)
{
/* If we have been given an architecture and a processor
make sure that they are compatible. We only generate
@@ -556,10 +588,10 @@ arm_override_options (void)
{ TARGET_CPU_xscale, "xscale" },
{ TARGET_CPU_ep9312, "ep9312" },
{ TARGET_CPU_iwmmxt, "iwmmxt" },
- { TARGET_CPU_arm926ej_s, "arm926ej-s" },
- { TARGET_CPU_arm1026ej_s, "arm1026ej-s" },
- { TARGET_CPU_arm1136j_s, "arm1136j_s" },
- { TARGET_CPU_arm1136jf_s, "arm1136jf_s" },
+ { TARGET_CPU_arm926ejs, "arm926ejs" },
+ { TARGET_CPU_arm1026ejs, "arm1026ejs" },
+ { TARGET_CPU_arm1136js, "arm1136js" },
+ { TARGET_CPU_arm1136jfs, "arm1136jfs" },
{ TARGET_CPU_generic, "arm" },
{ 0, 0 }
};
@@ -583,7 +615,7 @@ arm_override_options (void)
abort ();
insn_flags = sel->flags;
-
+
/* Now check to see if the user has specified some command line
switch that require certain abilities from the cpu. */
sought = 0;
@@ -653,12 +685,17 @@ arm_override_options (void)
insn_flags = sel->flags;
}
+ if (arm_tune == arm_none)
+ arm_tune = (enum processor_type) (sel - all_cores);
}
- /* If tuning has not been specified, tune for whichever processor or
- architecture has been selected. */
- if (tune_flags == 0)
- tune_flags = insn_flags;
+ /* The processor for which we should tune should now have been
+ chosen. */
+ if (arm_tune == arm_none)
+ abort ();
+
+ tune_flags = all_cores[(int)arm_tune].flags;
+ targetm.rtx_costs = all_cores[(int)arm_tune].rtx_costs;
/* Make sure that the processor choice does not conflict with any of the
other command line choices. */
@@ -747,66 +784,110 @@ arm_override_options (void)
warning ("passing floating point arguments in fp regs not yet supported");
/* Initialize boolean versions of the flags, for use in the arm.md file. */
- arm_fast_multiply = (insn_flags & FL_FAST_MULT) != 0;
- arm_arch4 = (insn_flags & FL_ARCH4) != 0;
- arm_arch5 = (insn_flags & FL_ARCH5) != 0;
- arm_arch5e = (insn_flags & FL_ARCH5E) != 0;
- arm_arch_xscale = (insn_flags & FL_XSCALE) != 0;
-
- arm_ld_sched = (tune_flags & FL_LDSCHED) != 0;
- arm_is_strong = (tune_flags & FL_STRONG) != 0;
- thumb_code = (TARGET_ARM == 0);
- arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32))
- && !(tune_flags & FL_ARCH4))) != 0;
- arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
- arm_is_cirrus = (tune_flags & FL_CIRRUS) != 0;
- arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
+ arm_arch3m = (insn_flags & FL_ARCH3M) != 0;
+ arm_arch4 = (insn_flags & FL_ARCH4) != 0;
+ arm_arch5 = (insn_flags & FL_ARCH5) != 0;
+ arm_arch5e = (insn_flags & FL_ARCH5E) != 0;
+ arm_arch6 = (insn_flags & FL_ARCH6) != 0;
+ arm_arch_xscale = (insn_flags & FL_XSCALE) != 0;
+
+ arm_ld_sched = (tune_flags & FL_LDSCHED) != 0;
+ arm_is_strong = (tune_flags & FL_STRONG) != 0;
+ thumb_code = (TARGET_ARM == 0);
+ arm_is_6_or_7 = (((tune_flags & (FL_MODE26 | FL_MODE32))
+ && !(tune_flags & FL_ARCH4))) != 0;
+ arm_tune_xscale = (tune_flags & FL_XSCALE) != 0;
+ arm_arch_iwmmxt = (insn_flags & FL_IWMMXT) != 0;
if (TARGET_IWMMXT && (! TARGET_ATPCS))
target_flags |= ARM_FLAG_ATPCS;
- if (arm_is_cirrus)
+ arm_fp_model = ARM_FP_MODEL_UNKNOWN;
+ if (target_fpu_name == NULL && target_fpe_name != NULL)
{
- arm_fpu_tune = FPUTYPE_MAVERICK;
-
- /* Ignore -mhard-float if -mcpu=ep9312. */
- if (TARGET_HARD_FLOAT)
- target_flags ^= ARM_FLAG_SOFT_FLOAT;
+ if (streq (target_fpe_name, "2"))
+ target_fpu_name = "fpe2";
+ else if (streq (target_fpe_name, "3"))
+ target_fpu_name = "fpe3";
+ else
+ error ("invalid floating point emulation option: -mfpe=%s",
+ target_fpe_name);
+ }
+ if (target_fpu_name != NULL)
+ {
+ /* The user specified a FPU. */
+ for (i = 0; i < ARRAY_SIZE (all_fpus); i++)
+ {
+ if (streq (all_fpus[i].name, target_fpu_name))
+ {
+ arm_fpu_arch = all_fpus[i].fpu;
+ arm_fpu_tune = arm_fpu_arch;
+ arm_fp_model = fp_model_for_fpu[arm_fpu_arch];
+ break;
+ }
+ }
+ if (arm_fp_model == ARM_FP_MODEL_UNKNOWN)
+ error ("invalid floating point option: -mfpu=%s", target_fpu_name);
}
else
- /* Default value for floating point code... if no co-processor
- bus, then schedule for emulated floating point. Otherwise,
- assume the user has an FPA.
- Note: this does not prevent use of floating point instructions,
- -msoft-float does that. */
- arm_fpu_tune = (tune_flags & FL_CO_PROC) ? FPUTYPE_FPA : FPUTYPE_FPA_EMU3;
-
- if (target_fp_name)
{
- if (streq (target_fp_name, "2"))
+#ifdef FPUTYPE_DEFAULT
+ /* Use the default is it is specified for this platform. */
+ arm_fpu_arch = FPUTYPE_DEFAULT;
+ arm_fpu_tune = FPUTYPE_DEFAULT;
+#else
+ /* Pick one based on CPU type. */
+ if ((insn_flags & FL_VFP) != 0)
+ arm_fpu_arch = FPUTYPE_VFP;
+ else if (insn_flags & FL_CIRRUS)
+ arm_fpu_arch = FPUTYPE_MAVERICK;
+ else
arm_fpu_arch = FPUTYPE_FPA_EMU2;
- else if (streq (target_fp_name, "3"))
- arm_fpu_arch = FPUTYPE_FPA_EMU3;
+#endif
+ if (tune_flags & FL_CO_PROC && arm_fpu_arch == FPUTYPE_FPA_EMU2)
+ arm_fpu_tune = FPUTYPE_FPA;
else
- error ("invalid floating point emulation option: -mfpe-%s",
- target_fp_name);
+ arm_fpu_tune = arm_fpu_arch;
+ arm_fp_model = fp_model_for_fpu[arm_fpu_arch];
+ if (arm_fp_model == ARM_FP_MODEL_UNKNOWN)
+ abort ();
+ }
+
+ if (target_float_abi_name != NULL)
+ {
+ /* The user specified a FP ABI. */
+ for (i = 0; i < ARRAY_SIZE (all_float_abis); i++)
+ {
+ if (streq (all_float_abis[i].name, target_float_abi_name))
+ {
+ arm_float_abi = all_float_abis[i].abi_type;
+ break;
+ }
+ }
+ if (i == ARRAY_SIZE (all_float_abis))
+ error ("invalid floating point abi: -mfloat-abi=%s",
+ target_float_abi_name);
}
else
- arm_fpu_arch = FPUTYPE_DEFAULT;
-
- if (TARGET_FPE)
{
- if (arm_fpu_tune == FPUTYPE_FPA_EMU3)
- arm_fpu_tune = FPUTYPE_FPA_EMU2;
- else if (arm_fpu_tune == FPUTYPE_MAVERICK)
- warning ("-mfpe switch not supported by ep9312 target cpu - ignored.");
- else if (arm_fpu_tune != FPUTYPE_FPA)
- arm_fpu_tune = FPUTYPE_FPA_EMU2;
+ /* Use soft-float target flag. */
+ if (target_flags & ARM_FLAG_SOFT_FLOAT)
+ arm_float_abi = ARM_FLOAT_ABI_SOFT;
+ else
+ arm_float_abi = ARM_FLOAT_ABI_HARD;
}
+
+ if (arm_float_abi == ARM_FLOAT_ABI_SOFTFP)
+ sorry ("-mfloat-abi=softfp");
+ /* If soft-float is specified then don't use FPU. */
+ if (TARGET_SOFT_FLOAT)
+ arm_fpu_arch = FPUTYPE_NONE;
/* For arm2/3 there is no need to do any scheduling if there is only
a floating point emulator, or we are doing software floating-point. */
- if ((TARGET_SOFT_FLOAT || arm_fpu_tune != FPUTYPE_FPA)
+ if ((TARGET_SOFT_FLOAT
+ || arm_fpu_tune == FPUTYPE_FPA_EMU2
+ || arm_fpu_tune == FPUTYPE_FPA_EMU3)
&& (tune_flags & FL_MODE32) == 0)
flag_schedule_insns = flag_schedule_insns_after_reload = 0;
@@ -847,14 +928,14 @@ arm_override_options (void)
if (optimize_size)
{
- /* If optimizing for space, we let the compiler synthesize constants
- with up to 2 insns, which uses the same space as a load from memory.
- This gives the opportunity to take even less space when different
- offsets can be factorized into multiple pre-indexed loads or stores. */
- arm_constant_limit = 2;
+ /* There's some dispute as to whether this should be 1 or 2. However,
+ experiments seem to show that in pathological cases a setting of
+ 1 degrades less severely than a setting of 2. This could change if
+ other parts of the compiler change their behavior. */
+ arm_constant_limit = 1;
/* If optimizing for size, bump the number of instructions that we
- are prepared to conditionally execute (even on a StrongARM). */
+ are prepared to conditionally execute (even on a StrongARM). */
max_insns_skipped = 6;
}
else
@@ -867,7 +948,7 @@ arm_override_options (void)
/* On XScale the longer latency of a load makes it more difficult
to achieve a good schedule, so it's faster to synthesize
- constants that can be done in two insns. */
+ constants that can be done in two insns. */
if (arm_tune_xscale)
arm_constant_limit = 2;
@@ -1002,23 +1083,22 @@ arm_current_func_type (void)
return cfun->machine->func_type;
}
-/* Return 1 if it is possible to return using a single instruction. */
+/* Return 1 if it is possible to return using a single instruction.
+ If SIBLING is non-null, this is a test for a return before a sibling
+ call. SIBLING is the call insn, so we can examine its register usage. */
int
-use_return_insn (int iscond)
+use_return_insn (int iscond, rtx sibling)
{
int regno;
unsigned int func_type;
unsigned long saved_int_regs;
+ unsigned HOST_WIDE_INT stack_adjust;
/* Never use a return instruction before reload has run. */
if (!reload_completed)
return 0;
- /* We need two instructions when there's a frame pointer. */
- if (frame_pointer_needed)
- return 0;
-
func_type = arm_current_func_type ();
/* Naked functions and volatile functions need special
@@ -1029,19 +1109,61 @@ use_return_insn (int iscond)
/* So do interrupt functions that use the frame pointer. */
if (IS_INTERRUPT (func_type) && frame_pointer_needed)
return 0;
-
+
+ stack_adjust = arm_get_frame_size () + current_function_outgoing_args_size;
+
/* As do variadic functions. */
if (current_function_pretend_args_size
|| cfun->machine->uses_anonymous_args
- /* Of if the function calls __builtin_eh_return () */
+ /* Or if the function calls __builtin_eh_return () */
|| ARM_FUNC_TYPE (func_type) == ARM_FT_EXCEPTION_HANDLER
- /* Or if there is no frame pointer and there is a stack adjustment. */
- || ((arm_get_frame_size () + current_function_outgoing_args_size != 0)
- && !frame_pointer_needed))
+ /* Or if the function calls alloca */
+ || current_function_calls_alloca
+ /* Or if there is a stack adjustment. However, if the stack pointer
+ is saved on the stack, we can use a pre-incrementing stack load. */
+ || !(stack_adjust == 0 || (frame_pointer_needed && stack_adjust == 4)))
return 0;
saved_int_regs = arm_compute_save_reg_mask ();
+ /* Unfortunately, the insn
+
+ ldmib sp, {..., sp, ...}
+
+ triggers a bug on most SA-110 based devices, such that the stack
+ pointer won't be correctly restored if the instruction takes a
+ page fault. We work around this problem by popping r3 along with
+ the other registers, since that is never slower than executing
+ another instruction.
+
+ We test for !arm_arch5 here, because code for any architecture
+ less than this could potentially be run on one of the buggy
+ chips. */
+ if (stack_adjust == 4 && !arm_arch5)
+ {
+ /* Validate that r3 is a call-clobbered register (always true in
+ the default abi) ... */
+ if (!call_used_regs[3])
+ return 0;
+
+ /* ... that it isn't being used for a return value (always true
+ until we implement return-in-regs), or for a tail-call
+ argument ... */
+ if (sibling)
+ {
+ if (GET_CODE (sibling) != CALL_INSN)
+ abort ();
+
+ if (find_regno_fusage (sibling, USE, 3))
+ return 0;
+ }
+
+ /* ... and that there are no call-saved registers in r0-r2
+ (always true in the default ABI). */
+ if (saved_int_regs & 0x7)
+ return 0;
+ }
+
/* Can't be done if interworking with Thumb, and any registers have been
stacked. */
if (TARGET_INTERWORK && saved_int_regs != 0)
@@ -1067,8 +1189,14 @@ use_return_insn (int iscond)
/* Can't be done if any of the FPA regs are pushed,
since this also requires an insn. */
- if (TARGET_HARD_FLOAT)
- for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++)
+ if (TARGET_HARD_FLOAT && TARGET_FPA)
+ for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++)
+ if (regs_ever_live[regno] && !call_used_regs[regno])
+ return 0;
+
+ /* Likewise VFP regs. */
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ for (regno = FIRST_VFP_REGNUM; regno <= LAST_VFP_REGNUM; regno++)
if (regs_ever_live[regno] && !call_used_regs[regno])
return 0;
@@ -1967,20 +2095,19 @@ arm_return_in_memory (tree type)
return 1;
}
-/* Indicate whether or not words of a double are in big-endian order. */
+/* Indicate whether or not words of a double are in big-endian order. */
int
arm_float_words_big_endian (void)
{
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
return 0;
/* For FPA, float words are always big-endian. For VFP, floats words
follow the memory system mode. */
- if (TARGET_HARD_FLOAT)
+ if (TARGET_FPA)
{
- /* FIXME: TARGET_HARD_FLOAT currently implies FPA. */
return 1;
}
@@ -2723,6 +2850,24 @@ arm_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p)
}
}
+ else if (TARGET_HARD_FLOAT && TARGET_VFP && mode == DFmode)
+ {
+ if (GET_CODE (x) == PLUS
+ && arm_address_register_rtx_p (XEXP (x, 0), strict_p)
+ && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ HOST_WIDE_INT val = INTVAL (XEXP (x, 1));
+
+ /* ??? valid arm offsets are a subset of VFP offsets.
+ For now only allow this subset. Proper fix is to add an
+ additional memory constraint for arm address modes.
+ Alternatively allow full vfp addressing and let
+ output_move_double fix it up with a sub-optimal sequence. */
+ if (val == 4 || val == -4 || val == -8)
+ return 1;
+ }
+ }
+
else if (GET_CODE (x) == PLUS)
{
rtx xop0 = XEXP (x, 0);
@@ -2769,12 +2914,12 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
HOST_WIDE_INT range;
enum rtx_code code = GET_CODE (index);
- if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ if (TARGET_HARD_FLOAT && TARGET_FPA && GET_MODE_CLASS (mode) == MODE_FLOAT)
return (code == CONST_INT && INTVAL (index) < 1024
&& INTVAL (index) > -1024
&& (INTVAL (index) & 3) == 0);
- if (TARGET_CIRRUS
+ if (TARGET_HARD_FLOAT && TARGET_MAVERICK
&& (GET_MODE_CLASS (mode) == MODE_FLOAT || mode == DImode))
return (code == CONST_INT
&& INTVAL (index) < 255
@@ -2827,7 +2972,7 @@ arm_legitimate_index_p (enum machine_mode mode, rtx index, int strict_p)
&& INTVAL (index) > -range);
}
-/* Return nonzero if X is valid as an ARM state addressing register. */
+/* Return nonzero if X is valid as a Thumb state base register. */
static int
thumb_base_register_rtx_p (rtx x, enum machine_mode mode, int strict_p)
{
@@ -2842,10 +2987,11 @@ thumb_base_register_rtx_p (rtx x, enum machine_mode mode, int strict_p)
return THUMB_REGNO_MODE_OK_FOR_BASE_P (regno, mode);
return (regno <= LAST_LO_REGNUM
- || regno >= FIRST_PSEUDO_REGISTER
+ || regno > LAST_VIRTUAL_REGISTER
|| regno == FRAME_POINTER_REGNUM
|| (GET_MODE_SIZE (mode) >= 4
&& (regno == STACK_POINTER_REGNUM
+ || regno >= FIRST_PSEUDO_REGISTER
|| x == hard_frame_pointer_rtx
|| x == arg_pointer_rtx)));
}
@@ -2922,8 +3068,6 @@ thumb_legitimate_address_p (enum machine_mode mode, rtx x, int strict_p)
if (GET_MODE_SIZE (mode) <= 4
&& XEXP (x, 0) != frame_pointer_rtx
&& XEXP (x, 1) != frame_pointer_rtx
- && XEXP (x, 0) != virtual_stack_vars_rtx
- && XEXP (x, 1) != virtual_stack_vars_rtx
&& thumb_index_register_rtx_p (XEXP (x, 0), strict_p)
&& thumb_index_register_rtx_p (XEXP (x, 1), strict_p))
return 1;
@@ -3009,7 +3153,10 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
rtx base_reg, val;
n = INTVAL (xop1);
- if (mode == DImode || (TARGET_SOFT_FLOAT && mode == DFmode))
+ /* VFP addressing modes actually allow greater offsets, but for
+ now we just stick with the lowest common denominator. */
+ if (mode == DImode
+ || ((TARGET_SOFT_FLOAT || TARGET_VFP) && mode == DFmode))
{
low_n = n & 0x0f;
n &= ~0x0f;
@@ -3079,129 +3226,133 @@ arm_legitimize_address (rtx x, rtx orig_x, enum machine_mode mode)
#ifndef COSTS_N_INSNS
#define COSTS_N_INSNS(N) ((N) * 4 - 2)
#endif
-/* Worker routine for arm_rtx_costs. */
static inline int
-arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
+thumb_rtx_costs (rtx x, enum rtx_code code, enum rtx_code outer)
{
enum machine_mode mode = GET_MODE (x);
- enum rtx_code subcode;
- int extra_cost;
- if (TARGET_THUMB)
+ switch (code)
{
- switch (code)
- {
- case ASHIFT:
- case ASHIFTRT:
- case LSHIFTRT:
- case ROTATERT:
- case PLUS:
- case MINUS:
- case COMPARE:
- case NEG:
- case NOT:
- return COSTS_N_INSNS (1);
-
- case MULT:
- if (GET_CODE (XEXP (x, 1)) == CONST_INT)
- {
- int cycles = 0;
- unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1));
-
- while (i)
- {
- i >>= 2;
- cycles++;
- }
- return COSTS_N_INSNS (2) + cycles;
- }
- return COSTS_N_INSNS (1) + 16;
-
- case SET:
- return (COSTS_N_INSNS (1)
- + 4 * ((GET_CODE (SET_SRC (x)) == MEM)
- + GET_CODE (SET_DEST (x)) == MEM));
+ case ASHIFT:
+ case ASHIFTRT:
+ case LSHIFTRT:
+ case ROTATERT:
+ case PLUS:
+ case MINUS:
+ case COMPARE:
+ case NEG:
+ case NOT:
+ return COSTS_N_INSNS (1);
+
+ case MULT:
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ int cycles = 0;
+ unsigned HOST_WIDE_INT i = INTVAL (XEXP (x, 1));
- case CONST_INT:
- if (outer == SET)
+ while (i)
{
- if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256)
- return 0;
- if (thumb_shiftable_const (INTVAL (x)))
- return COSTS_N_INSNS (2);
- return COSTS_N_INSNS (3);
- }
- else if ((outer == PLUS || outer == COMPARE)
- && INTVAL (x) < 256 && INTVAL (x) > -256)
- return 0;
- else if (outer == AND
- && INTVAL (x) < 256 && INTVAL (x) >= -256)
- return COSTS_N_INSNS (1);
- else if (outer == ASHIFT || outer == ASHIFTRT
- || outer == LSHIFTRT)
- return 0;
- return COSTS_N_INSNS (2);
-
- case CONST:
- case CONST_DOUBLE:
- case LABEL_REF:
- case SYMBOL_REF:
- return COSTS_N_INSNS (3);
-
- case UDIV:
- case UMOD:
- case DIV:
- case MOD:
- return 100;
+ i >>= 2;
+ cycles++;
+ }
+ return COSTS_N_INSNS (2) + cycles;
+ }
+ return COSTS_N_INSNS (1) + 16;
+
+ case SET:
+ return (COSTS_N_INSNS (1)
+ + 4 * ((GET_CODE (SET_SRC (x)) == MEM)
+ + GET_CODE (SET_DEST (x)) == MEM));
+
+ case CONST_INT:
+ if (outer == SET)
+ {
+ if ((unsigned HOST_WIDE_INT) INTVAL (x) < 256)
+ return 0;
+ if (thumb_shiftable_const (INTVAL (x)))
+ return COSTS_N_INSNS (2);
+ return COSTS_N_INSNS (3);
+ }
+ else if ((outer == PLUS || outer == COMPARE)
+ && INTVAL (x) < 256 && INTVAL (x) > -256)
+ return 0;
+ else if (outer == AND
+ && INTVAL (x) < 256 && INTVAL (x) >= -256)
+ return COSTS_N_INSNS (1);
+ else if (outer == ASHIFT || outer == ASHIFTRT
+ || outer == LSHIFTRT)
+ return 0;
+ return COSTS_N_INSNS (2);
+
+ case CONST:
+ case CONST_DOUBLE:
+ case LABEL_REF:
+ case SYMBOL_REF:
+ return COSTS_N_INSNS (3);
+
+ case UDIV:
+ case UMOD:
+ case DIV:
+ case MOD:
+ return 100;
- case TRUNCATE:
- return 99;
+ case TRUNCATE:
+ return 99;
- case AND:
- case XOR:
- case IOR:
- /* XXX guess. */
- return 8;
-
- case ADDRESSOF:
- case MEM:
- /* XXX another guess. */
- /* Memory costs quite a lot for the first word, but subsequent words
- load at the equivalent of a single insn each. */
- return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
- + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
- ? 4 : 0));
-
- case IF_THEN_ELSE:
- /* XXX a guess. */
- if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC)
- return 14;
- return 2;
+ case AND:
+ case XOR:
+ case IOR:
+ /* XXX guess. */
+ return 8;
- case ZERO_EXTEND:
- /* XXX still guessing. */
- switch (GET_MODE (XEXP (x, 0)))
- {
- case QImode:
- return (1 + (mode == DImode ? 4 : 0)
- + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
-
- case HImode:
- return (4 + (mode == DImode ? 4 : 0)
- + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
-
- case SImode:
- return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ case ADDRESSOF:
+ case MEM:
+ /* XXX another guess. */
+ /* Memory costs quite a lot for the first word, but subsequent words
+ load at the equivalent of a single insn each. */
+ return (10 + 4 * ((GET_MODE_SIZE (mode) - 1) / UNITS_PER_WORD)
+ + ((GET_CODE (x) == SYMBOL_REF && CONSTANT_POOL_ADDRESS_P (x))
+ ? 4 : 0));
+
+ case IF_THEN_ELSE:
+ /* XXX a guess. */
+ if (GET_CODE (XEXP (x, 1)) == PC || GET_CODE (XEXP (x, 2)) == PC)
+ return 14;
+ return 2;
+
+ case ZERO_EXTEND:
+ /* XXX still guessing. */
+ switch (GET_MODE (XEXP (x, 0)))
+ {
+ case QImode:
+ return (1 + (mode == DImode ? 4 : 0)
+ + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
- default:
- return 99;
- }
+ case HImode:
+ return (4 + (mode == DImode ? 4 : 0)
+ + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+ case SImode:
+ return (1 + (GET_CODE (XEXP (x, 0)) == MEM ? 10 : 0));
+
default:
return 99;
}
+
+ default:
+ return 99;
}
-
+}
+
+
+/* Worker routine for arm_rtx_costs. */
+static inline int
+arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
+{
+ enum machine_mode mode = GET_MODE (x);
+ enum rtx_code subcode;
+ int extra_cost;
+
switch (code)
{
case MEM:
@@ -3213,7 +3364,9 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
case DIV:
case MOD:
- return 100;
+ case UDIV:
+ case UMOD:
+ return optimize_size ? COSTS_N_INSNS (2) : 100;
case ROTATE:
if (mode == SImode && GET_CODE (XEXP (x, 1)) == REG)
@@ -3251,11 +3404,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
return (2 + ((REG_OR_SUBREG_REG (XEXP (x, 1))
|| (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
- && const_double_rtx_ok_for_fpa (XEXP (x, 1))))
+ && arm_const_double_rtx (XEXP (x, 1))))
? 0 : 8)
+ ((REG_OR_SUBREG_REG (XEXP (x, 0))
|| (GET_CODE (XEXP (x, 0)) == CONST_DOUBLE
- && const_double_rtx_ok_for_fpa (XEXP (x, 0))))
+ && arm_const_double_rtx (XEXP (x, 0))))
? 0 : 8));
if (((GET_CODE (XEXP (x, 0)) == CONST_INT
@@ -3280,7 +3433,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
return (2 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 8)
+ ((REG_OR_SUBREG_REG (XEXP (x, 1))
|| (GET_CODE (XEXP (x, 1)) == CONST_DOUBLE
- && const_double_rtx_ok_for_fpa (XEXP (x, 1))))
+ && arm_const_double_rtx (XEXP (x, 1))))
? 0 : 8));
/* Fall through */
@@ -3330,43 +3483,11 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
return 8;
case MULT:
- /* There is no point basing this on the tuning, since it is always the
- fast variant if it exists at all. */
- if (arm_fast_multiply && mode == DImode
- && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1)))
- && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
- || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
- return 8;
-
- if (GET_MODE_CLASS (mode) == MODE_FLOAT
- || mode == DImode)
- return 30;
-
- if (GET_CODE (XEXP (x, 1)) == CONST_INT)
- {
- unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1))
- & (unsigned HOST_WIDE_INT) 0xffffffff);
- int add_cost = const_ok_for_arm (i) ? 4 : 8;
- int j;
-
- /* Tune as appropriate. */
- int booth_unit_size = ((tune_flags & FL_FAST_MULT) ? 8 : 2);
-
- for (j = 0; i && j < 32; j += booth_unit_size)
- {
- i >>= booth_unit_size;
- add_cost += 2;
- }
-
- return add_cost;
- }
-
- return (((tune_flags & FL_FAST_MULT) ? 8 : 30)
- + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
- + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4));
+ /* This should have been handled by the CPU specific routines. */
+ abort ();
case TRUNCATE:
- if (arm_fast_multiply && mode == SImode
+ if (arm_arch3m && mode == SImode
&& GET_CODE (XEXP (x, 0)) == LSHIFTRT
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT
&& (GET_CODE (XEXP (XEXP (XEXP (x, 0), 0), 0))
@@ -3447,7 +3568,7 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
return 6;
case CONST_DOUBLE:
- if (const_double_rtx_ok_for_fpa (x))
+ if (arm_const_double_rtx (x))
return outer == SET ? 2 : -1;
else if ((outer == COMPARE || outer == PLUS)
&& neg_const_double_rtx_ok_for_fpa (x))
@@ -3459,43 +3580,312 @@ arm_rtx_costs_1 (rtx x, enum rtx_code code, enum rtx_code outer)
}
}
+/* RTX costs for cores with a slow MUL implimentation. */
+
static bool
-arm_rtx_costs (rtx x, int code, int outer_code, int *total)
+arm_slowmul_rtx_costs (rtx x, int code, int outer_code, int *total)
{
- *total = arm_rtx_costs_1 (x, code, outer_code);
- return true;
+ enum machine_mode mode = GET_MODE (x);
+
+ if (TARGET_THUMB)
+ {
+ *total = thumb_rtx_costs (x, code, outer_code);
+ return true;
+ }
+
+ switch (code)
+ {
+ case MULT:
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ || mode == DImode)
+ {
+ *total = 30;
+ return true;
+ }
+
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1))
+ & (unsigned HOST_WIDE_INT) 0xffffffff);
+ int cost, const_ok = const_ok_for_arm (i);
+ int j, booth_unit_size;
+
+ /* Tune as appropriate. */
+ cost = const_ok ? 4 : 8;
+ booth_unit_size = 2;
+ for (j = 0; i && j < 32; j += booth_unit_size)
+ {
+ i >>= booth_unit_size;
+ cost += 2;
+ }
+
+ *total = cost;
+ return true;
+ }
+
+ *total = 30 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
+ + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
+ return true;
+
+ default:
+ *total = arm_rtx_costs_1 (x, code, outer_code);
+ return true;
+ }
+}
+
+
+/* RTX cost for cores with a fast multiply unit (M variants). */
+
+static bool
+arm_fastmul_rtx_costs (rtx x, int code, int outer_code, int *total)
+{
+ enum machine_mode mode = GET_MODE (x);
+
+ if (TARGET_THUMB)
+ {
+ *total = thumb_rtx_costs (x, code, outer_code);
+ return true;
+ }
+
+ switch (code)
+ {
+ case MULT:
+ /* There is no point basing this on the tuning, since it is always the
+ fast variant if it exists at all. */
+ if (mode == DImode
+ && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1)))
+ && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
+ {
+ *total = 8;
+ return true;
+ }
+
+
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ || mode == DImode)
+ {
+ *total = 30;
+ return true;
+ }
+
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1))
+ & (unsigned HOST_WIDE_INT) 0xffffffff);
+ int cost, const_ok = const_ok_for_arm (i);
+ int j, booth_unit_size;
+
+ /* Tune as appropriate. */
+ cost = const_ok ? 4 : 8;
+ booth_unit_size = 8;
+ for (j = 0; i && j < 32; j += booth_unit_size)
+ {
+ i >>= booth_unit_size;
+ cost += 2;
+ }
+
+ *total = cost;
+ return true;
+ }
+
+ *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
+ + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
+ return true;
+
+ default:
+ *total = arm_rtx_costs_1 (x, code, outer_code);
+ return true;
+ }
}
+
+/* RTX cost for XScale CPUs. */
+
+static bool
+arm_xscale_rtx_costs (rtx x, int code, int outer_code, int *total)
+{
+ enum machine_mode mode = GET_MODE (x);
+
+ if (TARGET_THUMB)
+ {
+ *total = thumb_rtx_costs (x, code, outer_code);
+ return true;
+ }
+
+ switch (code)
+ {
+ case MULT:
+ /* There is no point basing this on the tuning, since it is always the
+ fast variant if it exists at all. */
+ if (mode == DImode
+ && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1)))
+ && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
+ {
+ *total = 8;
+ return true;
+ }
+
+
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ || mode == DImode)
+ {
+ *total = 30;
+ return true;
+ }
+
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ unsigned HOST_WIDE_INT i = (INTVAL (XEXP (x, 1))
+ & (unsigned HOST_WIDE_INT) 0xffffffff);
+ int cost, const_ok = const_ok_for_arm (i);
+ unsigned HOST_WIDE_INT masked_const;
+
+ /* The cost will be related to two insns.
+ First a load of the constant (MOV or LDR), then a multiply. */
+ cost = 2;
+ if (! const_ok)
+ cost += 1; /* LDR is probably more expensive because
+ of longer result latency. */
+ masked_const = i & 0xffff8000;
+ if (masked_const != 0 && masked_const != 0xffff8000)
+ {
+ masked_const = i & 0xf8000000;
+ if (masked_const == 0 || masked_const == 0xf8000000)
+ cost += 1;
+ else
+ cost += 2;
+ }
+ *total = cost;
+ return true;
+ }
+
+ *total = 8 + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : 4)
+ + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : 4);
+ return true;
+
+ default:
+ *total = arm_rtx_costs_1 (x, code, outer_code);
+ return true;
+ }
+}
+
+
+/* RTX costs for 9e (and later) cores. */
+
+static bool
+arm_9e_rtx_costs (rtx x, int code, int outer_code, int *total)
+{
+ enum machine_mode mode = GET_MODE (x);
+ int nonreg_cost;
+ int cost;
+
+ if (TARGET_THUMB)
+ {
+ switch (code)
+ {
+ case MULT:
+ *total = COSTS_N_INSNS (3);
+ return true;
+
+ default:
+ *total = thumb_rtx_costs (x, code, outer_code);
+ return true;
+ }
+ }
+
+ switch (code)
+ {
+ case MULT:
+ /* There is no point basing this on the tuning, since it is always the
+ fast variant if it exists at all. */
+ if (mode == DImode
+ && (GET_CODE (XEXP (x, 0)) == GET_CODE (XEXP (x, 1)))
+ && (GET_CODE (XEXP (x, 0)) == ZERO_EXTEND
+ || GET_CODE (XEXP (x, 0)) == SIGN_EXTEND))
+ {
+ *total = 3;
+ return true;
+ }
+
+
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT)
+ {
+ *total = 30;
+ return true;
+ }
+ if (mode == DImode)
+ {
+ cost = 7;
+ nonreg_cost = 8;
+ }
+ else
+ {
+ cost = 2;
+ nonreg_cost = 4;
+ }
+
+
+ *total = cost + (REG_OR_SUBREG_REG (XEXP (x, 0)) ? 0 : nonreg_cost)
+ + (REG_OR_SUBREG_REG (XEXP (x, 1)) ? 0 : nonreg_cost);
+ return true;
+
+ default:
+ *total = arm_rtx_costs_1 (x, code, outer_code);
+ return true;
+ }
+}
/* All address computations that can be done are free, but rtx cost returns
the same for practically all of them. So we weight the different types
of address here in the order (most pref first):
- PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */
+ PRE/POST_INC/DEC, SHIFT or NON-INT sum, INT sum, REG, MEM or LABEL. */
+static inline int
+arm_arm_address_cost (rtx x)
+{
+ enum rtx_code c = GET_CODE (x);
+
+ if (c == PRE_INC || c == PRE_DEC || c == POST_INC || c == POST_DEC)
+ return 0;
+ if (c == MEM || c == LABEL_REF || c == SYMBOL_REF)
+ return 10;
+
+ if (c == PLUS || c == MINUS)
+ {
+ char cl0 = GET_RTX_CLASS (GET_CODE (XEXP (x, 0)));
+ char cl1 = GET_RTX_CLASS (GET_CODE (XEXP (x, 1)));
+
+ if (GET_CODE (XEXP (x, 0)) == CONST_INT)
+ return 2;
+
+ if (cl0 == '2' || cl0 == 'c' || cl1 == '2' || cl1 == 'c')
+ return 3;
+
+ return 4;
+ }
+
+ return 6;
+}
+
+static inline int
+arm_thumb_address_cost (rtx x)
+{
+ enum rtx_code c = GET_CODE (x);
+
+ if (c == REG)
+ return 1;
+ if (c == PLUS
+ && GET_CODE (XEXP (x, 0)) == REG
+ && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ return 1;
+
+ return 2;
+}
+
static int
arm_address_cost (rtx x)
{
-#define ARM_ADDRESS_COST(X) \
- (10 - ((GET_CODE (X) == MEM || GET_CODE (X) == LABEL_REF \
- || GET_CODE (X) == SYMBOL_REF) \
- ? 0 \
- : ((GET_CODE (X) == PRE_INC || GET_CODE (X) == PRE_DEC \
- || GET_CODE (X) == POST_INC || GET_CODE (X) == POST_DEC) \
- ? 10 \
- : (((GET_CODE (X) == PLUS || GET_CODE (X) == MINUS) \
- ? 6 + (GET_CODE (XEXP (X, 1)) == CONST_INT ? 2 \
- : ((GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == '2' \
- || GET_RTX_CLASS (GET_CODE (XEXP (X, 0))) == 'c' \
- || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == '2' \
- || GET_RTX_CLASS (GET_CODE (XEXP (X, 1))) == 'c') \
- ? 1 : 0)) \
- : 4)))))
-
-#define THUMB_ADDRESS_COST(X) \
- ((GET_CODE (X) == REG \
- || (GET_CODE (X) == PLUS && GET_CODE (XEXP (X, 0)) == REG \
- && GET_CODE (XEXP (X, 1)) == CONST_INT)) \
- ? 1 : 2)
-
- return (TARGET_ARM ? ARM_ADDRESS_COST (x) : THUMB_ADDRESS_COST (x));
+ return TARGET_ARM ? arm_arm_address_cost (x) : arm_thumb_address_cost (x);
}
static int
@@ -3523,7 +3913,8 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost)
operand for INSN. If we have a shifted input operand and the
instruction we depend on is another ALU instruction, then we may
have to account for an additional stall. */
- if (shift_opnum != 0 && attr_type == TYPE_NORMAL)
+ if (shift_opnum != 0
+ && (attr_type == TYPE_ALU_SHIFT || attr_type == TYPE_ALU_SHIFT_REG))
{
rtx shifted_operand;
int opno;
@@ -3581,47 +3972,51 @@ arm_adjust_cost (rtx insn, rtx link, rtx dep, int cost)
return cost;
}
-static int fpa_consts_inited = 0;
+static int fp_consts_inited = 0;
-static const char * const strings_fpa[8] =
+/* Only zero is valid for VFP. Other values are also valid for FPA. */
+static const char * const strings_fp[8] =
{
"0", "1", "2", "3",
"4", "5", "0.5", "10"
};
-static REAL_VALUE_TYPE values_fpa[8];
+static REAL_VALUE_TYPE values_fp[8];
static void
-init_fpa_table (void)
+init_fp_table (void)
{
int i;
REAL_VALUE_TYPE r;
- for (i = 0; i < 8; i++)
+ if (TARGET_VFP)
+ fp_consts_inited = 1;
+ else
+ fp_consts_inited = 8;
+
+ for (i = 0; i < fp_consts_inited; i++)
{
- r = REAL_VALUE_ATOF (strings_fpa[i], DFmode);
- values_fpa[i] = r;
+ r = REAL_VALUE_ATOF (strings_fp[i], DFmode);
+ values_fp[i] = r;
}
-
- fpa_consts_inited = 1;
}
-/* Return TRUE if rtx X is a valid immediate FPA constant. */
+/* Return TRUE if rtx X is a valid immediate FP constant. */
int
-const_double_rtx_ok_for_fpa (rtx x)
+arm_const_double_rtx (rtx x)
{
REAL_VALUE_TYPE r;
int i;
- if (!fpa_consts_inited)
- init_fpa_table ();
+ if (!fp_consts_inited)
+ init_fp_table ();
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
if (REAL_VALUE_MINUS_ZERO (r))
return 0;
- for (i = 0; i < 8; i++)
- if (REAL_VALUES_EQUAL (r, values_fpa[i]))
+ for (i = 0; i < fp_consts_inited; i++)
+ if (REAL_VALUES_EQUAL (r, values_fp[i]))
return 1;
return 0;
@@ -3634,8 +4029,8 @@ neg_const_double_rtx_ok_for_fpa (rtx x)
REAL_VALUE_TYPE r;
int i;
- if (!fpa_consts_inited)
- init_fpa_table ();
+ if (!fp_consts_inited)
+ init_fp_table ();
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
r = REAL_VALUE_NEGATE (r);
@@ -3643,7 +4038,7 @@ neg_const_double_rtx_ok_for_fpa (rtx x)
return 0;
for (i = 0; i < 8; i++)
- if (REAL_VALUES_EQUAL (r, values_fpa[i]))
+ if (REAL_VALUES_EQUAL (r, values_fp[i]))
return 1;
return 0;
@@ -3686,6 +4081,21 @@ arm_hard_register_operand (rtx op, enum machine_mode mode)
&& REGNO (op) < FIRST_PSEUDO_REGISTER);
}
+/* An arm register operand. */
+int
+arm_general_register_operand (rtx op, enum machine_mode mode)
+{
+ if (GET_MODE (op) != mode && mode != VOIDmode)
+ return 0;
+
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ return (GET_CODE (op) == REG
+ && (REGNO (op) <= LAST_ARM_REGNUM
+ || REGNO (op) >= FIRST_PSEUDO_REGISTER));
+}
+
/* Only accept reg, subreg(reg), const_int. */
int
reg_or_int_operand (rtx op, enum machine_mode mode)
@@ -3857,9 +4267,10 @@ f_register_operand (rtx op, enum machine_mode mode)
|| REGNO_REG_CLASS (REGNO (op)) == FPA_REGS));
}
-/* Return TRUE for valid operands for the rhs of an FPA instruction. */
+/* Return TRUE for valid operands for the rhs of an floating point insns.
+ Allows regs or certain consts on FPA, just regs for everything else. */
int
-fpa_rhs_operand (rtx op, enum machine_mode mode)
+arm_float_rhs_operand (rtx op, enum machine_mode mode)
{
if (s_register_operand (op, mode))
return TRUE;
@@ -3867,14 +4278,14 @@ fpa_rhs_operand (rtx op, enum machine_mode mode)
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
- if (GET_CODE (op) == CONST_DOUBLE)
- return const_double_rtx_ok_for_fpa (op);
+ if (TARGET_FPA && GET_CODE (op) == CONST_DOUBLE)
+ return arm_const_double_rtx (op);
return FALSE;
}
int
-fpa_add_operand (rtx op, enum machine_mode mode)
+arm_float_add_operand (rtx op, enum machine_mode mode)
{
if (s_register_operand (op, mode))
return TRUE;
@@ -3882,13 +4293,27 @@ fpa_add_operand (rtx op, enum machine_mode mode)
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
- if (GET_CODE (op) == CONST_DOUBLE)
- return (const_double_rtx_ok_for_fpa (op)
+ if (TARGET_FPA && GET_CODE (op) == CONST_DOUBLE)
+ return (arm_const_double_rtx (op)
|| neg_const_double_rtx_ok_for_fpa (op));
return FALSE;
}
+
+/* Return TRUE if OP is suitable for the rhs of a floating point comparison.
+ Depends which fpu we are targeting. */
+
+int
+arm_float_compare_operand (rtx op, enum machine_mode mode)
+{
+ if (TARGET_VFP)
+ return vfp_compare_operand (op, mode);
+ else
+ return arm_float_rhs_operand (op, mode);
+}
+
+
/* Return nonzero if OP is a valid Cirrus memory address pattern. */
int
cirrus_memory_offset (rtx op)
@@ -3965,6 +4390,84 @@ cirrus_shift_const (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
&& INTVAL (op) < 64);
}
+
+/* Return TRUE if OP is a valid VFP memory address pattern. */
+/* Copied from cirrus_memory_offset but with restricted offset range. */
+
+int
+vfp_mem_operand (rtx op)
+{
+ /* Reject eliminable registers. */
+
+ if (! (reload_in_progress || reload_completed)
+ && ( reg_mentioned_p (frame_pointer_rtx, op)
+ || reg_mentioned_p (arg_pointer_rtx, op)
+ || reg_mentioned_p (virtual_incoming_args_rtx, op)
+ || reg_mentioned_p (virtual_outgoing_args_rtx, op)
+ || reg_mentioned_p (virtual_stack_dynamic_rtx, op)
+ || reg_mentioned_p (virtual_stack_vars_rtx, op)))
+ return FALSE;
+
+ /* Constants are converted into offets from labels. */
+ if (GET_CODE (op) == MEM)
+ {
+ rtx ind;
+
+ ind = XEXP (op, 0);
+
+ if (reload_completed
+ && (GET_CODE (ind) == LABEL_REF
+ || (GET_CODE (ind) == CONST
+ && GET_CODE (XEXP (ind, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (ind, 0), 0)) == LABEL_REF
+ && GET_CODE (XEXP (XEXP (ind, 0), 1)) == CONST_INT)))
+ return TRUE;
+
+ /* Match: (mem (reg)). */
+ if (GET_CODE (ind) == REG)
+ return arm_address_register_rtx_p (ind, 0);
+
+ /* Match:
+ (mem (plus (reg)
+ (const))). */
+ if (GET_CODE (ind) == PLUS
+ && GET_CODE (XEXP (ind, 0)) == REG
+ && REG_MODE_OK_FOR_BASE_P (XEXP (ind, 0), VOIDmode)
+ && GET_CODE (XEXP (ind, 1)) == CONST_INT
+ && INTVAL (XEXP (ind, 1)) > -1024
+ && INTVAL (XEXP (ind, 1)) < 1024)
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+/* Return TRUE if OP is a REG or constant zero. */
+int
+vfp_compare_operand (rtx op, enum machine_mode mode)
+{
+ if (s_register_operand (op, mode))
+ return TRUE;
+
+ return (GET_CODE (op) == CONST_DOUBLE
+ && arm_const_double_rtx (op));
+}
+
+
+/* Return GENERAL_REGS if a scratch register required to reload x to/from
+ VFP registers. Otherwise return NO_REGS. */
+
+enum reg_class
+vfp_secondary_reload_class (enum machine_mode mode, rtx x)
+{
+ if (vfp_mem_operand (x) || s_register_operand (x, mode))
+ return NO_REGS;
+
+ return GENERAL_REGS;
+}
+
+
/* Returns TRUE if INSN is an "LDR REG, ADDR" instruction.
Use by the Cirrus Maverick code which has to workaround
a hardware bug triggered by such instructions. */
@@ -4200,7 +4703,7 @@ nonimmediate_di_operand (rtx op, enum machine_mode mode)
return FALSE;
}
-/* Return TRUE for a valid operand of a DFmode operation when -msoft-float.
+/* Return TRUE for a valid operand of a DFmode operation when soft-float.
Either: REG, SUBREG, CONST_DOUBLE or MEM(DImode_address).
Note that this disallows MEM(REG+REG), but allows
MEM(PRE/POST_INC/DEC(REG)). */
@@ -5549,7 +6052,7 @@ arm_select_cc_mode (enum rtx_code op, rtx x, rtx y)
case LE:
case GT:
case GE:
- if (TARGET_CIRRUS)
+ if (TARGET_HARD_FLOAT && TARGET_MAVERICK)
return CCFPmode;
return CCFPEmode;
@@ -6865,6 +7368,9 @@ note_invalid_constants (rtx insn, HOST_WIDE_INT address, int do_pushes)
if (!constrain_operands (1))
fatal_insn_not_found (insn);
+ if (recog_data.n_alternatives == 0)
+ return false;
+
/* Fill in recog_op_alt with information about the constraints of this insn. */
preprocess_constraints ();
@@ -7092,13 +7598,13 @@ fp_immediate_constant (rtx x)
REAL_VALUE_TYPE r;
int i;
- if (!fpa_consts_inited)
- init_fpa_table ();
+ if (!fp_consts_inited)
+ init_fp_table ();
REAL_VALUE_FROM_CONST_DOUBLE (r, x);
for (i = 0; i < 8; i++)
- if (REAL_VALUES_EQUAL (r, values_fpa[i]))
- return strings_fpa[i];
+ if (REAL_VALUES_EQUAL (r, values_fp[i]))
+ return strings_fp[i];
abort ();
}
@@ -7109,12 +7615,12 @@ fp_const_from_val (REAL_VALUE_TYPE *r)
{
int i;
- if (!fpa_consts_inited)
- init_fpa_table ();
+ if (!fp_consts_inited)
+ init_fp_table ();
for (i = 0; i < 8; i++)
- if (REAL_VALUES_EQUAL (*r, values_fpa[i]))
- return strings_fpa[i];
+ if (REAL_VALUES_EQUAL (*r, values_fp[i]))
+ return strings_fp[i];
abort ();
}
@@ -7159,6 +7665,124 @@ print_multi_reg (FILE *stream, const char *instr, int reg, int mask)
fprintf (stream, "\n");
}
+
+/* Output the operands of a FLDM/FSTM instruction to STREAM.
+ REG is the base register,
+ INSTR is the possibly suffixed load or store instruction.
+ FMT specifies now to print the register name.
+ START and COUNT specify the register range. */
+
+static void
+vfp_print_multi (FILE *stream, const char *instr, int reg,
+ const char * fmt, int start, int count)
+{
+ int i;
+
+ fputc ('\t', stream);
+ asm_fprintf (stream, instr, reg);
+ fputs (", {", stream);
+
+ for (i = start; i < start + count; i++)
+ {
+ if (i > start)
+ fputs (", ", stream);
+ asm_fprintf (stream, fmt, i);
+ }
+ fputs ("}\n", stream);
+}
+
+
+/* Output the assembly for a store multiple. */
+
+const char *
+vfp_output_fstmx (rtx * operands)
+{
+ char pattern[100];
+ int p;
+ int base;
+ int i;
+
+ strcpy (pattern, "fstmfdx\t%m0!, {%P1");
+ p = strlen (pattern);
+
+ if (GET_CODE (operands[1]) != REG)
+ abort ();
+
+ base = (REGNO (operands[1]) - FIRST_VFP_REGNUM) / 2;
+ for (i = 1; i < XVECLEN (operands[2], 0); i++)
+ {
+ p += sprintf (&pattern[p], ", d%d", base + i);
+ }
+ strcpy (&pattern[p], "}");
+
+ output_asm_insn (pattern, operands);
+ return "";
+}
+
+
+/* Emit RTL to save block of VFP register pairs to the stack. */
+
+static rtx
+vfp_emit_fstmx (int base_reg, int count)
+{
+ rtx par;
+ rtx dwarf;
+ rtx tmp, reg;
+ int i;
+
+ /* ??? The frame layout is implementation defined. We describe
+ standard format 1 (equivalent to a FSTMD insn and unused pad word).
+ We really need some way of representing the whole block so that the
+ unwinder can figure it out at runtime. */
+ par = gen_rtx_PARALLEL (VOIDmode, rtvec_alloc (count));
+ dwarf = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (count + 1));
+
+ reg = gen_rtx_REG (DFmode, base_reg);
+ base_reg += 2;
+
+ XVECEXP (par, 0, 0)
+ = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_PRE_DEC (BLKmode, stack_pointer_rtx)),
+ gen_rtx_UNSPEC (BLKmode,
+ gen_rtvec (1, reg),
+ UNSPEC_PUSH_MULT));
+
+ tmp = gen_rtx_SET (VOIDmode, stack_pointer_rtx,
+ gen_rtx_PLUS (SImode, stack_pointer_rtx,
+ GEN_INT (-(count * 8 + 4))));
+ RTX_FRAME_RELATED_P (tmp) = 1;
+ XVECEXP (dwarf, 0, 0) = tmp;
+
+ tmp = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (DFmode, stack_pointer_rtx),
+ reg);
+ RTX_FRAME_RELATED_P (tmp) = 1;
+ XVECEXP (dwarf, 0, 1) = tmp;
+
+ for (i = 1; i < count; i++)
+ {
+ reg = gen_rtx_REG (DFmode, base_reg);
+ base_reg += 2;
+ XVECEXP (par, 0, i) = gen_rtx_USE (VOIDmode, reg);
+
+ tmp = gen_rtx_SET (VOIDmode,
+ gen_rtx_MEM (DFmode,
+ gen_rtx_PLUS (SImode,
+ stack_pointer_rtx,
+ GEN_INT (i * 8))),
+ reg);
+ RTX_FRAME_RELATED_P (tmp) = 1;
+ XVECEXP (dwarf, 0, i + 1) = tmp;
+ }
+
+ par = emit_insn (par);
+ REG_NOTES (par) = gen_rtx_EXPR_LIST (REG_FRAME_RELATED_EXPR, dwarf,
+ REG_NOTES (par));
+ return par;
+}
+
+
/* Output a 'call' insn. */
const char *
output_call (rtx *operands)
@@ -7940,7 +8564,7 @@ output_ascii_pseudo_op (FILE *stream, const unsigned char *p, int len)
case '\\':
putc ('\\', stream);
len_so_far++;
- /* drop through. */
+ /* Drop through. */
default:
if (c >= ' ' && c <= '~')
@@ -8098,7 +8722,7 @@ arm_compute_save_reg_mask (void)
return save_reg_mask;
}
-/* Generate a function exit sequence. If REALLY_RETURN is true, then do
+/* Generate a function exit sequence. If REALLY_RETURN is false, then do
everything bar the final return instruction. */
const char *
output_return_instruction (rtx operand, int really_return, int reverse)
@@ -8116,8 +8740,9 @@ output_return_instruction (rtx operand, int really_return, int reverse)
if (IS_VOLATILE (func_type) && TARGET_ABORT_NORETURN)
{
- /* If this function was declared non-returning, and we have found a tail
- call, then we have to trust that the called function won't return. */
+ /* If this function was declared non-returning, and we have
+ found a tail call, then we have to trust that the called
+ function won't return. */
if (really_return)
{
rtx ops[2];
@@ -8189,11 +8814,29 @@ output_return_instruction (rtx operand, int really_return, int reverse)
char *p;
int first = 1;
- /* Generate the load multiple instruction to restore the registers. */
- if (frame_pointer_needed)
- sprintf (instr, "ldm%sea\t%%|fp, {", conditional);
- else if (live_regs_mask & (1 << SP_REGNUM))
- sprintf (instr, "ldm%sfd\t%%|sp, {", conditional);
+ /* Generate the load multiple instruction to restore the
+ registers. Note we can get here, even if
+ frame_pointer_needed is true, but only if sp already
+ points to the base of the saved core registers. */
+ if (live_regs_mask & (1 << SP_REGNUM))
+ {
+ unsigned HOST_WIDE_INT stack_adjust =
+ arm_get_frame_size () + current_function_outgoing_args_size;
+
+ if (stack_adjust != 0 && stack_adjust != 4)
+ abort ();
+
+ if (stack_adjust && arm_arch5)
+ sprintf (instr, "ldm%sib\t%%|sp, {", conditional);
+ else
+ {
+ /* If we can't use ldmib (SA110 bug), then try to pop r3
+ instead. */
+ if (stack_adjust)
+ live_regs_mask |= 1 << 3;
+ sprintf (instr, "ldm%sfd\t%%|sp, {", conditional);
+ }
+ }
else
sprintf (instr, "ldm%sfd\t%%|sp!, {", conditional);
@@ -8400,7 +9043,7 @@ arm_output_function_prologue (FILE *f, HOST_WIDE_INT frame_size)
}
const char *
-arm_output_epilogue (int really_return)
+arm_output_epilogue (rtx sibling)
{
int reg;
unsigned long saved_regs_mask;
@@ -8413,10 +9056,12 @@ arm_output_epilogue (int really_return)
FILE * f = asm_out_file;
rtx eh_ofs = cfun->machine->eh_epilogue_sp_ofs;
unsigned int lrm_count = 0;
+ int really_return = (sibling == NULL);
+ int start_reg;
/* If we have already generated the return instruction
then it is futile to generate anything else. */
- if (use_return_insn (FALSE) && return_used_this_function)
+ if (use_return_insn (FALSE, sibling) && return_used_this_function)
return "";
func_type = arm_current_func_type ();
@@ -8458,11 +9103,12 @@ arm_output_epilogue (int really_return)
if (frame_pointer_needed)
{
+ /* This variable is for the Virtual Frame Pointer, not VFP regs. */
int vfp_offset = 4;
if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
{
- for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--)
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
if (regs_ever_live[reg] && !call_used_regs[reg])
{
floats_offset += 12;
@@ -8472,9 +9118,9 @@ arm_output_epilogue (int really_return)
}
else
{
- int start_reg = LAST_ARM_FP_REGNUM;
+ start_reg = LAST_FPA_REGNUM;
- for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--)
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
{
if (regs_ever_live[reg] && !call_used_regs[reg])
{
@@ -8505,6 +9151,62 @@ arm_output_epilogue (int really_return)
FP_REGNUM, floats_offset - vfp_offset);
}
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ {
+ int nregs = 0;
+
+ /* We save regs in pairs. */
+ /* A special insn for saving/restoring VFP registers. This does
+ not have base+offset addressing modes, so we use IP to
+ hold the address. Each block requires nregs*2+1 words. */
+ start_reg = FIRST_VFP_REGNUM;
+ /* Cound how many blocks of registers need saving. */
+ for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ {
+ if ((!regs_ever_live[reg] || call_used_regs[reg])
+ && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1]))
+ {
+ if (start_reg != reg)
+ floats_offset += 4;
+ start_reg = reg + 2;
+ }
+ else
+ {
+ floats_offset += 8;
+ nregs++;
+ }
+ }
+ if (start_reg != reg)
+ floats_offset += 4;
+
+ if (nregs > 0)
+ {
+ asm_fprintf (f, "\tsub\t%r, %r, #%d\n", IP_REGNUM,
+ FP_REGNUM, floats_offset - vfp_offset);
+ }
+ start_reg = FIRST_VFP_REGNUM;
+ for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ {
+ if ((!regs_ever_live[reg] || call_used_regs[reg])
+ && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1]))
+ {
+ if (start_reg != reg)
+ {
+ vfp_print_multi (f, "fldmfdx\t%r!", IP_REGNUM, "d%d",
+ (start_reg - FIRST_VFP_REGNUM) / 2,
+ (reg - start_reg) / 2);
+ }
+ start_reg = reg + 2;
+ }
+ }
+ if (start_reg != reg)
+ {
+ vfp_print_multi (f, "fldmfdx\t%r!", IP_REGNUM, "d%d",
+ (start_reg - FIRST_VFP_REGNUM) / 2,
+ (reg - start_reg) / 2);
+ }
+ }
+
if (TARGET_IWMMXT)
{
/* The frame pointer is guaranteed to be non-double-word aligned.
@@ -8552,9 +9254,13 @@ arm_output_epilogue (int really_return)
longer indicate the safe area of stack, and we can get stack
corruption. Using SP as the base register means that it will
be reset correctly to the original value, should an interrupt
- occur. */
- asm_fprintf (f, "\tsub\t%r,%r,#%d\n", SP_REGNUM, FP_REGNUM,
- 4 * bit_count (saved_regs_mask));
+ occur. If the stack pointer already points at the right
+ place, then omit the subtraction. */
+ if (((frame_size + current_function_outgoing_args_size + floats_offset)
+ != 4 * (1 + (int) bit_count (saved_regs_mask)))
+ || current_function_calls_alloca)
+ asm_fprintf (f, "\tsub\t%r, %r, #%d\n", SP_REGNUM, FP_REGNUM,
+ 4 * bit_count (saved_regs_mask));
print_multi_reg (f, "ldmfd\t%r", SP_REGNUM, saved_regs_mask);
if (IS_INTERRUPT (func_type))
@@ -8575,16 +9281,16 @@ arm_output_epilogue (int really_return)
if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
{
- for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++)
+ for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
if (regs_ever_live[reg] && !call_used_regs[reg])
asm_fprintf (f, "\tldfe\t%r, [%r], #12\n",
reg, SP_REGNUM);
}
else
{
- int start_reg = FIRST_ARM_FP_REGNUM;
+ start_reg = FIRST_FPA_REGNUM;
- for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++)
+ for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
{
if (regs_ever_live[reg] && !call_used_regs[reg])
{
@@ -8612,6 +9318,30 @@ arm_output_epilogue (int really_return)
start_reg, reg - start_reg, SP_REGNUM);
}
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ {
+ start_reg = FIRST_VFP_REGNUM;
+ for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ {
+ if ((!regs_ever_live[reg] || call_used_regs[reg])
+ && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1]))
+ {
+ if (start_reg != reg)
+ {
+ vfp_print_multi (f, "fldmfdx\t%r!", SP_REGNUM, "d%d",
+ (start_reg - FIRST_VFP_REGNUM) / 2,
+ (reg - start_reg) / 2);
+ }
+ start_reg = reg + 2;
+ }
+ }
+ if (start_reg != reg)
+ {
+ vfp_print_multi (f, "fldmfdx\t%r!", SP_REGNUM, "d%d",
+ (start_reg - FIRST_VFP_REGNUM) / 2,
+ (reg - start_reg) / 2);
+ }
+ }
if (TARGET_IWMMXT)
for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
if (regs_ever_live[reg] && !call_used_regs[reg])
@@ -8725,7 +9455,7 @@ arm_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
/* We need to take into account any stack-frame rounding. */
frame_size = arm_get_frame_size ();
- if (use_return_insn (FALSE)
+ if (use_return_insn (FALSE, NULL)
&& return_used_this_function
&& (frame_size + current_function_outgoing_args_size) != 0
&& !frame_pointer_needed)
@@ -8914,6 +9644,7 @@ emit_sfm (int base_reg, int count)
return par;
}
+
/* Compute the distance from register FROM to register TO.
These can be the arg pointer (26), the soft frame pointer (25),
the stack pointer (13) or the hard frame pointer (11).
@@ -8975,6 +9706,7 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to)
{
unsigned int reg_mask;
unsigned int reg;
+ bool new_block;
/* Make sure that we compute which registers will be saved
on the stack using the same algorithm that is used by
@@ -8995,10 +9727,31 @@ arm_compute_initial_elimination_offset (unsigned int from, unsigned int to)
/* If the hard floating point registers are going to be
used then they must be saved on the stack as well.
Each register occupies 12 bytes of stack space. */
- for (reg = FIRST_ARM_FP_REGNUM; reg <= LAST_ARM_FP_REGNUM; reg++)
+ for (reg = FIRST_FPA_REGNUM; reg <= LAST_FPA_REGNUM; reg++)
if (regs_ever_live[reg] && ! call_used_regs[reg])
call_saved_registers += 12;
+ /* Likewise VFP regs. */
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ {
+ new_block = TRUE;
+ for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ {
+ if ((regs_ever_live[reg] && !call_used_regs[reg])
+ || (regs_ever_live[reg + 1] && !call_used_regs[reg + 1]))
+ {
+ if (new_block)
+ {
+ call_saved_registers += 4;
+ new_block = FALSE;
+ }
+ call_saved_registers += 8;
+ }
+ else
+ new_block = TRUE;
+ }
+ }
+
if (TARGET_REALLY_IWMMXT)
/* Check for the call-saved iWMMXt registers. */
for (reg = FIRST_IWMMXT_REGNUM; reg <= LAST_IWMMXT_REGNUM; reg++)
@@ -9094,6 +9847,7 @@ arm_get_frame_size (void)
int entry_size = 0;
unsigned long func_type = arm_current_func_type ();
int leaf;
+ bool new_block;
if (! TARGET_ARM)
abort();
@@ -9137,12 +9891,33 @@ arm_get_frame_size (void)
/* Space for saved registers. */
entry_size += bit_count (arm_compute_save_reg_mask ()) * 4;
- /* Space for saved FPA registers. */
if (! IS_VOLATILE (func_type))
{
- for (regno = FIRST_ARM_FP_REGNUM; regno <= LAST_ARM_FP_REGNUM; regno++)
+ /* Space for saved FPA registers. */
+ for (regno = FIRST_FPA_REGNUM; regno <= LAST_FPA_REGNUM; regno++)
if (regs_ever_live[regno] && ! call_used_regs[regno])
entry_size += 12;
+
+ /* Space for saved VFP registers. */
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ {
+ new_block = TRUE;
+ for (regno = FIRST_VFP_REGNUM; regno < LAST_VFP_REGNUM; regno += 2)
+ {
+ if ((regs_ever_live[regno] && !call_used_regs[regno])
+ || (regs_ever_live[regno + 1] && !call_used_regs[regno + 1]))
+ {
+ if (new_block)
+ {
+ entry_size += 4;
+ new_block = FALSE;
+ }
+ entry_size += 8;
+ }
+ else
+ new_block = TRUE;
+ }
+ }
}
if (TARGET_REALLY_IWMMXT)
@@ -9337,11 +10112,13 @@ arm_expand_prologue (void)
if (! IS_VOLATILE (func_type))
{
+ int start_reg;
+
/* Save any floating point call-saved registers used by this
function. */
if (arm_fpu_arch == FPUTYPE_FPA_EMU2)
{
- for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--)
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
if (regs_ever_live[reg] && !call_used_regs[reg])
{
insn = gen_rtx_PRE_DEC (XFmode, stack_pointer_rtx);
@@ -9353,9 +10130,9 @@ arm_expand_prologue (void)
}
else
{
- int start_reg = LAST_ARM_FP_REGNUM;
+ start_reg = LAST_FPA_REGNUM;
- for (reg = LAST_ARM_FP_REGNUM; reg >= FIRST_ARM_FP_REGNUM; reg--)
+ for (reg = LAST_FPA_REGNUM; reg >= FIRST_FPA_REGNUM; reg--)
{
if (regs_ever_live[reg] && !call_used_regs[reg])
{
@@ -9383,6 +10160,31 @@ arm_expand_prologue (void)
RTX_FRAME_RELATED_P (insn) = 1;
}
}
+ if (TARGET_HARD_FLOAT && TARGET_VFP)
+ {
+ start_reg = FIRST_VFP_REGNUM;
+
+ for (reg = FIRST_VFP_REGNUM; reg < LAST_VFP_REGNUM; reg += 2)
+ {
+ if ((!regs_ever_live[reg] || call_used_regs[reg])
+ && (!regs_ever_live[reg + 1] || call_used_regs[reg + 1]))
+ {
+ if (start_reg != reg)
+ {
+ insn = vfp_emit_fstmx (start_reg,
+ (reg - start_reg) / 2);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+ start_reg = reg + 2;
+ }
+ }
+ if (start_reg != reg)
+ {
+ insn = vfp_emit_fstmx (start_reg,
+ (reg - start_reg) / 2);
+ RTX_FRAME_RELATED_P (insn) = 1;
+ }
+ }
}
if (frame_pointer_needed)
@@ -9702,6 +10504,27 @@ arm_print_operand (FILE *stream, rtx x, int code)
}
return;
+ /* Print a VFP double precision register name. */
+ case 'P':
+ {
+ int mode = GET_MODE (x);
+ int num;
+
+ if (mode != DImode && mode != DFmode)
+ abort ();
+
+ if (GET_CODE (x) != REG
+ || !IS_VFP_REGNUM (REGNO (x)))
+ abort ();
+
+ num = REGNO(x) - FIRST_VFP_REGNUM;
+ if (num & 1)
+ abort ();
+
+ fprintf (stream, "d%d", num >> 1);
+ }
+ return;
+
default:
if (x == 0)
abort ();
@@ -9737,7 +10560,7 @@ arm_assemble_integer (rtx x, unsigned int size, int aligned_p)
output_addr_const (asm_out_file, x);
/* Mark symbols as position independent. We only do this in the
- .text segment, not in the .data segment. */
+ .text segment, not in the .data segment. */
if (NEED_GOT_RELOC && flag_pic && making_const_table &&
(GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF))
{
@@ -10182,7 +11005,7 @@ arm_final_prescan_insn (rtx insn)
/* Fail if a conditional return is undesirable (eg on a
StrongARM), but still allow this if optimizing for size. */
else if (GET_CODE (scanbody) == RETURN
- && !use_return_insn (TRUE)
+ && !use_return_insn (TRUE, NULL)
&& !optimize_size)
fail = TRUE;
else if (GET_CODE (scanbody) == RETURN
@@ -10248,7 +11071,7 @@ arm_final_prescan_insn (rtx insn)
}
if (!this_insn)
{
- /* Oh, dear! we ran off the end.. give up */
+ /* Oh, dear! we ran off the end.. give up. */
recog (PATTERN (insn), insn, NULL);
arm_ccfsm_state = 0;
arm_target_insn = NULL;
@@ -10297,7 +11120,7 @@ int
arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
{
if (GET_MODE_CLASS (mode) == MODE_CC)
- return regno == CC_REGNUM;
+ return regno == CC_REGNUM || regno == VFPCC_REGNUM;
if (TARGET_THUMB)
/* For the Thumb we only allow values bigger than SImode in
@@ -10315,6 +11138,17 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
get sign extended to 64bits-- aldyh. */
return (GET_MODE_CLASS (mode) == MODE_FLOAT) || (mode == DImode);
+ if (IS_VFP_REGNUM (regno))
+ {
+ if (mode == SFmode || mode == SImode)
+ return TRUE;
+
+ /* DFmode values are only valid in even register pairs. */
+ if (mode == DFmode)
+ return ((regno - FIRST_VFP_REGNUM) & 1) == 0;
+ return FALSE;
+ }
+
if (IS_IWMMXT_GR_REGNUM (regno))
return mode == SImode;
@@ -10333,8 +11167,8 @@ arm_hard_regno_mode_ok (unsigned int regno, enum machine_mode mode)
/* The only registers left are the FPA registers
which we only allow to hold FP values. */
return GET_MODE_CLASS (mode) == MODE_FLOAT
- && regno >= FIRST_ARM_FP_REGNUM
- && regno <= LAST_ARM_FP_REGNUM;
+ && regno >= FIRST_FPA_REGNUM
+ && regno <= LAST_FPA_REGNUM;
}
int
@@ -10356,12 +11190,15 @@ arm_regno_class (int regno)
|| regno == ARG_POINTER_REGNUM)
return GENERAL_REGS;
- if (regno == CC_REGNUM)
+ if (regno == CC_REGNUM || regno == VFPCC_REGNUM)
return NO_REGS;
if (IS_CIRRUS_REGNUM (regno))
return CIRRUS_REGS;
+ if (IS_VFP_REGNUM (regno))
+ return VFP_REGS;
+
if (IS_IWMMXT_REGNUM (regno))
return IWMMXT_REGS;
@@ -10425,7 +11262,7 @@ arm_debugger_arg_offset (int value, rtx addr)
which is the frame pointer
a constant integer
- then... */
+ then... */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
@@ -10557,13 +11394,13 @@ static const struct builtin_description bdesc_2arg[] =
IWMMXT_BUILTIN2 (lshrv2si3_di, WSRLW)
IWMMXT_BUILTIN2 (lshrv2si3, WSRLWI)
IWMMXT_BUILTIN2 (lshrdi3_di, WSRLD)
- IWMMXT_BUILTIN2 (lshrdi3, WSRLDI)
+ IWMMXT_BUILTIN2 (lshrdi3_iwmmxt, WSRLDI)
IWMMXT_BUILTIN2 (ashrv4hi3_di, WSRAH)
IWMMXT_BUILTIN2 (ashrv4hi3, WSRAHI)
IWMMXT_BUILTIN2 (ashrv2si3_di, WSRAW)
IWMMXT_BUILTIN2 (ashrv2si3, WSRAWI)
IWMMXT_BUILTIN2 (ashrdi3_di, WSRAD)
- IWMMXT_BUILTIN2 (ashrdi3, WSRADI)
+ IWMMXT_BUILTIN2 (ashrdi3_iwmmxt, WSRADI)
IWMMXT_BUILTIN2 (rorv4hi3_di, WRORH)
IWMMXT_BUILTIN2 (rorv4hi3, WRORHI)
IWMMXT_BUILTIN2 (rorv2si3_di, WRORW)
@@ -11753,7 +12590,7 @@ is_called_in_ARM_mode (tree func)
#endif
}
-/* The bits which aren't usefully expanded as rtl. */
+/* The bits which aren't usefully expanded as rtl. */
const char *
thumb_unexpanded_epilogue (void)
{
@@ -11838,7 +12675,7 @@ thumb_unexpanded_epilogue (void)
mask &= (2 << regno) - 1; /* A noop if regno == 8 */
- /* Pop the values into the low register(s). */
+ /* Pop the values into the low register(s). */
thumb_pushpop (asm_out_file, mask, 0);
/* Move the value(s) into the high registers. */
@@ -11866,7 +12703,7 @@ thumb_unexpanded_epilogue (void)
{
/* The stack backtrace structure creation code had to
push R7 in order to get a work register, so we pop
- it now. */
+ it now. */
live_regs_mask |= (1 << LAST_LO_REGNUM);
}
@@ -12221,7 +13058,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
the assembler to bypass the ARM code when this function
is called from a Thumb encoded function elsewhere in the
same file. Hence the definition of STUB_NAME here must
- agree with the definition in gas/config/tc-arm.c */
+ agree with the definition in gas/config/tc-arm.c. */
#define STUB_NAME ".real_start_of"
@@ -12296,7 +13133,7 @@ thumb_output_function_prologue (FILE *f, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
if (regs_ever_live [LAST_ARG_REGNUM] == 0)
work_register = LAST_ARG_REGNUM;
- else /* We must push a register of our own */
+ else /* We must push a register of our own. */
live_regs_mask |= (1 << LAST_LO_REGNUM);
}
@@ -12897,7 +13734,7 @@ aof_globalize_label (FILE *stream, const char *name)
}
static void
-aof_file_start ()
+aof_file_start (void)
{
fputs ("__r0\tRN\t0\n", asm_out_file);
fputs ("__a1\tRN\t0\n", asm_out_file);
@@ -13044,6 +13881,8 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
tree function)
{
+ static int thunk_label = 0;
+ char label[256];
int mi_delta = delta;
const char *const mi_op = mi_delta < 0 ? "sub" : "add";
int shift = 0;
@@ -13051,6 +13890,14 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
? 1 : 0);
if (mi_delta < 0)
mi_delta = - mi_delta;
+ if (TARGET_THUMB)
+ {
+ int labelno = thunk_label++;
+ ASM_GENERATE_INTERNAL_LABEL (label, "LTHUMBFUNC", labelno);
+ fputs ("\tldr\tr12, ", file);
+ assemble_name (file, label);
+ fputc ('\n', file);
+ }
while (mi_delta != 0)
{
if ((mi_delta & (3 << shift)) == 0)
@@ -13064,17 +13911,26 @@ arm_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
shift += 8;
}
}
- fputs ("\tb\t", file);
- assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
- if (NEED_PLT_RELOC)
- fputs ("(PLT)", file);
- fputc ('\n', file);
+ if (TARGET_THUMB)
+ {
+ fprintf (file, "\tbx\tr12\n");
+ ASM_OUTPUT_ALIGN (file, 2);
+ assemble_name (file, label);
+ fputs (":\n", file);
+ assemble_integer (XEXP (DECL_RTL (function), 0), 4, BITS_PER_WORD, 1);
+ }
+ else
+ {
+ fputs ("\tb\t", file);
+ assemble_name (file, XSTR (XEXP (DECL_RTL (function), 0), 0));
+ if (NEED_PLT_RELOC)
+ fputs ("(PLT)", file);
+ fputc ('\n', file);
+ }
}
int
-arm_emit_vector_const (file, x)
- FILE * file;
- rtx x;
+arm_emit_vector_const (FILE *file, rtx x)
{
int i;
const char * pattern;
@@ -13103,8 +13959,7 @@ arm_emit_vector_const (file, x)
}
const char *
-arm_output_load_gr (operands)
- rtx * operands;
+arm_output_load_gr (rtx *operands)
{
rtx reg;
rtx offset;
@@ -13131,3 +13986,117 @@ arm_output_load_gr (operands)
return "";
}
+
+/* Return non-zero if the CONSUMER instruction (a store) does not need
+ PRODUCER's value to calculate the address. */
+
+int
+arm_no_early_store_addr_dep (rtx producer, rtx consumer)
+{
+ rtx value = PATTERN (producer);
+ rtx addr = PATTERN (consumer);
+
+ if (GET_CODE (value) == COND_EXEC)
+ value = COND_EXEC_CODE (value);
+ if (GET_CODE (value) == PARALLEL)
+ value = XVECEXP (value, 0, 0);
+ value = XEXP (value, 0);
+ if (GET_CODE (addr) == COND_EXEC)
+ addr = COND_EXEC_CODE (addr);
+ if (GET_CODE (addr) == PARALLEL)
+ addr = XVECEXP (addr, 0, 0);
+ addr = XEXP (addr, 0);
+
+ return !reg_overlap_mentioned_p (value, addr);
+}
+
+/* Return non-zero if the CONSUMER instruction (an ALU op) does not
+ have an early register shift value or amount dependency on the
+ result of PRODUCER. */
+
+int
+arm_no_early_alu_shift_dep (rtx producer, rtx consumer)
+{
+ rtx value = PATTERN (producer);
+ rtx op = PATTERN (consumer);
+ rtx early_op;
+
+ if (GET_CODE (value) == COND_EXEC)
+ value = COND_EXEC_CODE (value);
+ if (GET_CODE (value) == PARALLEL)
+ value = XVECEXP (value, 0, 0);
+ value = XEXP (value, 0);
+ if (GET_CODE (op) == COND_EXEC)
+ op = COND_EXEC_CODE (op);
+ if (GET_CODE (op) == PARALLEL)
+ op = XVECEXP (op, 0, 0);
+ op = XEXP (op, 1);
+
+ early_op = XEXP (op, 0);
+ /* This is either an actual independent shift, or a shift applied to
+ the first operand of another operation. We want the whole shift
+ operation. */
+ if (GET_CODE (early_op) == REG)
+ early_op = op;
+
+ return !reg_overlap_mentioned_p (value, early_op);
+}
+
+/* Return non-zero if the CONSUMER instruction (an ALU op) does not
+ have an early register shift value dependency on the result of
+ PRODUCER. */
+
+int
+arm_no_early_alu_shift_value_dep (rtx producer, rtx consumer)
+{
+ rtx value = PATTERN (producer);
+ rtx op = PATTERN (consumer);
+ rtx early_op;
+
+ if (GET_CODE (value) == COND_EXEC)
+ value = COND_EXEC_CODE (value);
+ if (GET_CODE (value) == PARALLEL)
+ value = XVECEXP (value, 0, 0);
+ value = XEXP (value, 0);
+ if (GET_CODE (op) == COND_EXEC)
+ op = COND_EXEC_CODE (op);
+ if (GET_CODE (op) == PARALLEL)
+ op = XVECEXP (op, 0, 0);
+ op = XEXP (op, 1);
+
+ early_op = XEXP (op, 0);
+
+ /* This is either an actual independent shift, or a shift applied to
+ the first operand of another operation. We want the value being
+ shifted, in either case. */
+ if (GET_CODE (early_op) != REG)
+ early_op = XEXP (early_op, 0);
+
+ return !reg_overlap_mentioned_p (value, early_op);
+}
+
+/* Return non-zero if the CONSUMER (a mul or mac op) does not
+ have an early register mult dependency on the result of
+ PRODUCER. */
+
+int
+arm_no_early_mul_dep (rtx producer, rtx consumer)
+{
+ rtx value = PATTERN (producer);
+ rtx op = PATTERN (consumer);
+
+ if (GET_CODE (value) == COND_EXEC)
+ value = COND_EXEC_CODE (value);
+ if (GET_CODE (value) == PARALLEL)
+ value = XVECEXP (value, 0, 0);
+ value = XEXP (value, 0);
+ if (GET_CODE (op) == COND_EXEC)
+ op = COND_EXEC_CODE (op);
+ if (GET_CODE (op) == PARALLEL)
+ op = XVECEXP (op, 0, 0);
+ op = XEXP (op, 1);
+
+ return (GET_CODE (op) == PLUS
+ && !reg_overlap_mentioned_p (value, XEXP (op, 0)));
+}
+
diff --git a/gcc/config/arm/arm.h b/gcc/config/arm/arm.h
index 0cb1562e636..6ed84a72a7b 100644
--- a/gcc/config/arm/arm.h
+++ b/gcc/config/arm/arm.h
@@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler, for ARM.
Copyright (C) 1991, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
- 2001, 2002, 2003 Free Software Foundation, Inc.
+ 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
and Martin Simmons (@harleqn.co.uk).
More major hacks by Richard Earnshaw (rearnsha@arm.com)
@@ -30,9 +30,10 @@
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- if (TARGET_ARM) \
- builtin_define ("__arm__"); \
- else \
+ /* Define __arm__ even when in thumb mode, for \
+ consistency with armcc. */ \
+ builtin_define ("__arm__"); \
+ if (TARGET_THUMB) \
builtin_define ("__thumb__"); \
\
if (TARGET_BIG_END) \
@@ -58,9 +59,7 @@
if (TARGET_SOFT_FLOAT) \
builtin_define ("__SOFTFP__"); \
\
- /* FIXME: TARGET_HARD_FLOAT currently implies \
- FPA. */ \
- if (TARGET_VFP && !TARGET_HARD_FLOAT) \
+ if (TARGET_VFP) \
builtin_define ("__VFP_FP__"); \
\
/* Add a define for interworking. \
@@ -98,13 +97,27 @@
#define TARGET_CPU_xscale 0x0100
#define TARGET_CPU_ep9312 0x0200
#define TARGET_CPU_iwmmxt 0x0400
-#define TARGET_CPU_arm926ej_s 0x0800
-#define TARGET_CPU_arm1026ej_s 0x1000
-#define TARGET_CPU_arm1136j_s 0x2000
-#define TARGET_CPU_arm1136jf_s 0x4000
+#define TARGET_CPU_arm926ejs 0x0800
+#define TARGET_CPU_arm1026ejs 0x1000
+#define TARGET_CPU_arm1136js 0x2000
+#define TARGET_CPU_arm1136jfs 0x4000
/* Configure didn't specify. */
#define TARGET_CPU_generic 0x8000
+/* The various ARM cores. */
+enum processor_type
+{
+#define ARM_CORE(NAME, FLAGS, COSTS) \
+ NAME,
+#include "arm-cores.def"
+#undef ARM_CORE
+ /* Used to indicate that no processor has been specified. */
+ arm_none
+};
+
+/* The processor for which instructions should be scheduled. */
+extern enum processor_type arm_tune;
+
typedef enum arm_cond_code
{
ARM_EQ = 0, ARM_NE, ARM_CS, ARM_CC, ARM_MI, ARM_PL, ARM_VS, ARM_VC,
@@ -121,8 +134,12 @@ extern int arm_ccfsm_state;
extern GTY(()) rtx arm_target_insn;
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
-/* The floating point instruction architecture, can be 2 or 3 */
-extern const char * target_fp_name;
+/* The floating point mode. */
+extern const char *target_fpu_name;
+/* For backwards compatability. */
+extern const char *target_fpe_name;
+/* Whether to use floating point hardware. */
+extern const char *target_float_abi_name;
/* Define the information needed to generate branch insns. This is
stored from the compare operation. */
extern GTY(()) rtx arm_compare_op0;
@@ -130,12 +147,12 @@ extern GTY(()) rtx arm_compare_op1;
/* The label of the current constant pool. */
extern rtx pool_vector_label;
/* Set to 1 when a return insn is output, this means that the epilogue
- is not needed. */
+ is not needed. */
extern int return_used_this_function;
/* Used to produce AOF syntax assembler. */
extern GTY(()) rtx aof_pic_label;
-/* Just in case configure has failed to define anything. */
+/* Just in case configure has failed to define anything. */
#ifndef TARGET_CPU_DEFAULT
#define TARGET_CPU_DEFAULT TARGET_CPU_generic
#endif
@@ -181,6 +198,14 @@ extern GTY(()) rtx aof_pic_label;
#if TARGET_CPU_DEFAULT == TARGET_CPU_iwmmxt
#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TE__ -D__XSCALE__ -D__IWMMXT__"
#else
+#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm926ejs || \
+ TARGET_CPU_DEFAULT == TARGET_CPU_arm1026ejs)
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_5TEJ__"
+#else
+#if (TARGET_CPU_DEFAULT == TARGET_CPU_arm1136js || \
+ TARGET_CPU_DEFAULT == TARGET_CPU_arm1136jfs)
+#define CPP_ARCH_DEFAULT_SPEC "-D__ARM_ARCH_6J__"
+#else
#error Unrecognized value in TARGET_CPU_DEFAULT.
#endif
#endif
@@ -190,6 +215,8 @@ extern GTY(()) rtx aof_pic_label;
#endif
#endif
#endif
+#endif
+#endif
#undef CPP_SPEC
#define CPP_SPEC "%(cpp_cpu_arch) %(subtarget_cpp_spec) \
@@ -225,7 +252,11 @@ extern GTY(()) rtx aof_pic_label;
%{march=arm9:-D__ARM_ARCH_4T__} \
%{march=arm920:-D__ARM_ARCH_4__} \
%{march=arm920t:-D__ARM_ARCH_4T__} \
+%{march=arm926ejs:-D__ARM_ARCH_5TEJ__} \
%{march=arm9tdmi:-D__ARM_ARCH_4T__} \
+%{march=arm1026ejs:-D__ARM_ARCH_5TEJ__} \
+%{march=arm1136js:-D__ARM_ARCH_6J__} \
+%{march=arm1136jfs:-D__ARM_ARCH_6J__} \
%{march=strongarm:-D__ARM_ARCH_4__} \
%{march=strongarm110:-D__ARM_ARCH_4__} \
%{march=strongarm1100:-D__ARM_ARCH_4__} \
@@ -243,6 +274,8 @@ extern GTY(()) rtx aof_pic_label;
%{march=armv5t:-D__ARM_ARCH_5T__} \
%{march=armv5e:-D__ARM_ARCH_5E__} \
%{march=armv5te:-D__ARM_ARCH_5TE__} \
+%{march=armv6:-D__ARM_ARCH6__} \
+%{march=armv6j:-D__ARM_ARCH6J__} \
%{!march=*: \
%{mcpu=arm2:-D__ARM_ARCH_2__} \
%{mcpu=arm250:-D__ARM_ARCH_2__} \
@@ -266,7 +299,11 @@ extern GTY(()) rtx aof_pic_label;
%{mcpu=arm9:-D__ARM_ARCH_4T__} \
%{mcpu=arm920:-D__ARM_ARCH_4__} \
%{mcpu=arm920t:-D__ARM_ARCH_4T__} \
+ %{mcpu=arm926ejs:-D__ARM_ARCH_5TEJ__} \
%{mcpu=arm9tdmi:-D__ARM_ARCH_4T__} \
+ %{mcpu=arm1026ejs:-D__ARM_ARCH_5TEJ__} \
+ %{mcpu=arm1136js:-D__ARM_ARCH_6J__} \
+ %{mcpu=arm1136jfs:-D__ARM_ARCH_6J__} \
%{mcpu=strongarm:-D__ARM_ARCH_4__} \
%{mcpu=strongarm110:-D__ARM_ARCH_4__} \
%{mcpu=strongarm1100:-D__ARM_ARCH_4__} \
@@ -371,7 +408,7 @@ extern GTY(()) rtx aof_pic_label;
function tries to return. */
#define ARM_FLAG_ABORT_NORETURN (1 << 13)
-/* Nonzero if function prologues should not load the PIC register. */
+/* Nonzero if function prologues should not load the PIC register. */
#define ARM_FLAG_SINGLE_PIC_BASE (1 << 14)
/* Nonzero if all call instructions should be indirect. */
@@ -414,13 +451,14 @@ extern GTY(()) rtx aof_pic_label;
#define TARGET_APCS_REENT (target_flags & ARM_FLAG_APCS_REENT)
#define TARGET_ATPCS (target_flags & ARM_FLAG_ATPCS)
#define TARGET_MMU_TRAPS (target_flags & ARM_FLAG_MMU_TRAPS)
-#define TARGET_SOFT_FLOAT (target_flags & ARM_FLAG_SOFT_FLOAT)
-#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
-#define TARGET_CIRRUS (arm_is_cirrus)
-#define TARGET_ANY_HARD_FLOAT (TARGET_HARD_FLOAT || TARGET_CIRRUS)
+#define TARGET_SOFT_FLOAT (arm_float_abi == ARM_FLOAT_ABI_SOFT)
+#define TARGET_SOFT_FLOAT_ABI (arm_float_abi != ARM_FLOAT_ABI_HARD)
+#define TARGET_HARD_FLOAT (arm_float_abi == ARM_FLOAT_ABI_HARD)
+#define TARGET_FPA (arm_fp_model == ARM_FP_MODEL_FPA)
+#define TARGET_MAVERICK (arm_fp_model == ARM_FP_MODEL_MAVERICK)
+#define TARGET_VFP (arm_fp_model == ARM_FP_MODEL_VFP)
#define TARGET_IWMMXT (arm_arch_iwmmxt)
#define TARGET_REALLY_IWMMXT (TARGET_IWMMXT && TARGET_ARM)
-#define TARGET_VFP (target_flags & ARM_FLAG_VFP)
#define TARGET_BIG_END (target_flags & ARM_FLAG_BIG_END)
#define TARGET_INTERWORK (target_flags & ARM_FLAG_INTERWORK)
#define TARGET_LITTLE_WORDS (target_flags & ARM_FLAG_LITTLE_WORDS)
@@ -523,20 +561,23 @@ extern GTY(()) rtx aof_pic_label;
{"", TARGET_DEFAULT, "" } \
}
-#define TARGET_OPTIONS \
-{ \
- {"cpu=", & arm_select[0].string, \
- N_("Specify the name of the target CPU"), 0}, \
- {"arch=", & arm_select[1].string, \
- N_("Specify the name of the target architecture"), 0}, \
- {"tune=", & arm_select[2].string, "", 0}, \
- {"fpe=", & target_fp_name, "" , 0}, \
- {"fp=", & target_fp_name, \
- N_("Specify the version of the floating point emulator"), 0},\
- {"structure-size-boundary=", & structure_size_string, \
- N_("Specify the minimum bit alignment of structures"), 0}, \
- {"pic-register=", & arm_pic_register_string, \
- N_("Specify the register to be used for PIC addressing"), 0} \
+#define TARGET_OPTIONS \
+{ \
+ {"cpu=", & arm_select[0].string, \
+ N_("Specify the name of the target CPU"), 0}, \
+ {"arch=", & arm_select[1].string, \
+ N_("Specify the name of the target architecture"), 0}, \
+ {"tune=", & arm_select[2].string, "", 0}, \
+ {"fpe=", & target_fpe_name, "", 0}, \
+ {"fp=", & target_fpe_name, "", 0}, \
+ {"fpu=", & target_fpu_name, \
+ N_("Specify the name of the target floating point hardware/format"), 0}, \
+ {"float-abi=", & target_float_abi_name, \
+ N_("Specify if floating point hardware should be used"), 0}, \
+ {"structure-size-boundary=", & structure_size_string, \
+ N_("Specify the minimum bit alignment of structures"), 0}, \
+ {"pic-register=", & arm_pic_register_string, \
+ N_("Specify the register to be used for PIC addressing"), 0} \
}
/* Support for a compile-time default CPU, et cetera. The rules are:
@@ -545,13 +586,16 @@ extern GTY(()) rtx aof_pic_label;
by --with-arch.
--with-tune is ignored if -mtune or -mcpu are specified (but not affected
by -march).
- --with-float is ignored if -mhard-float or -msoft-float are
- specified. */
+ --with-float is ignored if -mhard-float, -msoft-float or -mfloat-abi are
+ specified.
+ --with-fpu is ignored if -mfpu is specified. */
#define OPTION_DEFAULT_SPECS \
{"arch", "%{!march=*:%{!mcpu=*:-march=%(VALUE)}}" }, \
{"cpu", "%{!march=*:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \
{"tune", "%{!mcpu=*:%{!mtune=*:-mtune=%(VALUE)}}" }, \
- {"float", "%{!msoft-float:%{!mhard-float:-m%(VALUE)-float}}" }
+ {"float", \
+ "%{!msoft-float:%{!mhard-float:%{!mfloat-abi=*:-mfloat-abi=%(VALUE)}}}" }, \
+ {"fpu", "%{!mfpu=*:-mfpu=%(VALUE)}"},
struct arm_cpu_select
{
@@ -571,17 +615,31 @@ enum prog_mode_type
prog_mode32
};
-/* Recast the program mode class to be the prog_mode attribute */
+/* Recast the program mode class to be the prog_mode attribute. */
#define arm_prog_mode ((enum attr_prog_mode) arm_prgmode)
extern enum prog_mode_type arm_prgmode;
-/* What sort of floating point unit do we have? Hardware or software.
- If software, is it issue 2 or issue 3? */
+/* Which floating point model to use. */
+enum arm_fp_model
+{
+ ARM_FP_MODEL_UNKNOWN,
+ /* FPA model (Hardware or software). */
+ ARM_FP_MODEL_FPA,
+ /* Cirrus Maverick floating point model. */
+ ARM_FP_MODEL_MAVERICK,
+ /* VFP floating point model. */
+ ARM_FP_MODEL_VFP
+};
+
+extern enum arm_fp_model arm_fp_model;
+
+/* Which floating point hardware is available. Also update
+ fp_model_for_fpu in arm.c when adding entries to this list. */
enum fputype
{
- /* Software floating point, FPA style double fmt. */
- FPUTYPE_SOFT_FPA,
+ /* No FP hardware. */
+ FPUTYPE_NONE,
/* Full FPA support. */
FPUTYPE_FPA,
/* Emulated FPA hardware, Issue 2 emulator (no LFM/SFM). */
@@ -589,7 +647,9 @@ enum fputype
/* Emulated FPA hardware, Issue 3 emulator. */
FPUTYPE_FPA_EMU3,
/* Cirrus Maverick floating point co-processor. */
- FPUTYPE_MAVERICK
+ FPUTYPE_MAVERICK,
+ /* VFP. */
+ FPUTYPE_VFP
};
/* Recast the floating point class to be the floating point attribute. */
@@ -601,8 +661,21 @@ extern enum fputype arm_fpu_tune;
/* What type of floating point instructions are available */
extern enum fputype arm_fpu_arch;
+enum float_abi_type
+{
+ ARM_FLOAT_ABI_SOFT,
+ ARM_FLOAT_ABI_SOFTFP,
+ ARM_FLOAT_ABI_HARD
+};
+
+extern enum float_abi_type arm_float_abi;
+
/* Default floating point architecture. Override in sub-target if
- necessary. */
+ necessary.
+ FIXME: Is this still neccessary/desirable? Do we want VFP chips to
+ default to VFP unless overridden by a subtarget? If so it would be best
+ to remove these definitions. It also assumes there is only one cpu model
+ with a Maverick fpu. */
#ifndef FPUTYPE_DEFAULT
#define FPUTYPE_DEFAULT FPUTYPE_FPA_EMU2
#endif
@@ -612,19 +685,21 @@ extern enum fputype arm_fpu_arch;
#define FPUTYPE_DEFAULT FPUTYPE_MAVERICK
#endif
-/* Nonzero if the processor has a fast multiply insn, and one that does
- a 64-bit multiply of two 32-bit values. */
-extern int arm_fast_multiply;
+/* Nonzero if this chip supports the ARM Architecture 3M extensions. */
+extern int arm_arch3m;
-/* Nonzero if this chip supports the ARM Architecture 4 extensions */
+/* Nonzero if this chip supports the ARM Architecture 4 extensions. */
extern int arm_arch4;
-/* Nonzero if this chip supports the ARM Architecture 5 extensions */
+/* Nonzero if this chip supports the ARM Architecture 5 extensions. */
extern int arm_arch5;
-/* Nonzero if this chip supports the ARM Architecture 5E extensions */
+/* Nonzero if this chip supports the ARM Architecture 5E extensions. */
extern int arm_arch5e;
+/* Nonzero if this chip supports the ARM Architecture 6 extensions. */
+extern int arm_arch6;
+
/* Nonzero if this chip can benefit from load scheduling. */
extern int arm_ld_sched;
@@ -876,6 +951,11 @@ extern const char * structure_size_string;
mvf1-mvf3 Cirrus floating point scratch
mvf4-mvf15 S Cirrus floating point variable. */
+/* s0-s15 VFP scratch (aka d0-d7).
+ s16-s31 S VFP variable (aka d8-d15).
+ vfpcc Not a real register. Represents the VFP condition
+ code flags. */
+
/* The stack backtrace structure is as follows:
fp points to here: | save code pointer | [fp]
| return link value | [fp, #-4]
@@ -900,17 +980,22 @@ extern const char * structure_size_string;
/* 1 for registers that have pervasive standard uses
and are not available for the register allocator. */
-#define FIXED_REGISTERS \
-{ \
- 0,0,0,0,0,0,0,0, \
- 0,0,0,0,0,1,0,1, \
- 0,0,0,0,0,0,0,0, \
+#define FIXED_REGISTERS \
+{ \
+ 0,0,0,0,0,0,0,0, \
+ 0,0,0,0,0,1,0,1, \
+ 0,0,0,0,0,0,0,0, \
1,1,1, \
1,1,1,1,1,1,1,1, \
- 1,1,1,1,1,1,1,1, \
- 1,1,1,1,1,1,1,1, \
- 1,1,1,1,1,1,1,1, \
- 1,1,1,1 \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1 \
}
/* 1 for registers not available across function calls.
@@ -920,7 +1005,7 @@ extern const char * structure_size_string;
and the register where structure-value addresses are passed.
Aside from that, you can include as many other registers as you like.
The CC is not preserved over function calls on the ARM 6, so it is
- easier to assume this for all. SFP is preserved, since FP is. */
+ easier to assume this for all. SFP is preserved, since FP is. */
#define CALL_USED_REGISTERS \
{ \
1,1,1,1,0,0,0,0, \
@@ -931,7 +1016,12 @@ extern const char * structure_size_string;
1,1,1,1,1,1,1,1, \
1,1,1,1,1,1,1,1, \
1,1,1,1,1,1,1,1, \
- 1,1,1,1 \
+ 1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1,1,1,1,1,1,1,1, \
+ 1 \
}
#ifndef SUBTARGET_CONDITIONAL_REGISTER_USAGE
@@ -942,10 +1032,10 @@ extern const char * structure_size_string;
{ \
int regno; \
\
- if (TARGET_SOFT_FLOAT || TARGET_THUMB) \
+ if (TARGET_SOFT_FLOAT || TARGET_THUMB || !TARGET_FPA) \
{ \
- for (regno = FIRST_ARM_FP_REGNUM; \
- regno <= LAST_ARM_FP_REGNUM; ++regno) \
+ for (regno = FIRST_FPA_REGNUM; \
+ regno <= LAST_FPA_REGNUM; ++regno) \
fixed_regs[regno] = call_used_regs[regno] = 1; \
} \
\
@@ -953,22 +1043,40 @@ extern const char * structure_size_string;
{ \
/* When optimizing for size, it's better not to use \
the HI regs, because of the overhead of stacking \
- them. */ \
+ them. */ \
for (regno = FIRST_HI_REGNUM; \
regno <= LAST_HI_REGNUM; ++regno) \
fixed_regs[regno] = call_used_regs[regno] = 1; \
} \
\
- if (TARGET_CIRRUS) \
+ /* The link register can be clobbered by any branch insn, \
+ but we have no way to track that at present, so mark \
+ it as unavailable. */ \
+ if (TARGET_THUMB) \
+ fixed_regs[LR_REGNUM] = call_used_regs[LR_REGNUM] = 1; \
+ \
+ if (TARGET_ARM && TARGET_HARD_FLOAT) \
{ \
- for (regno = FIRST_ARM_FP_REGNUM; \
- regno <= LAST_ARM_FP_REGNUM; ++ regno) \
- fixed_regs[regno] = call_used_regs[regno] = 1; \
- for (regno = FIRST_CIRRUS_FP_REGNUM; \
- regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \
+ if (TARGET_MAVERICK) \
{ \
- fixed_regs[regno] = 0; \
- call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \
+ for (regno = FIRST_FPA_REGNUM; \
+ regno <= LAST_FPA_REGNUM; ++ regno) \
+ fixed_regs[regno] = call_used_regs[regno] = 1; \
+ for (regno = FIRST_CIRRUS_FP_REGNUM; \
+ regno <= LAST_CIRRUS_FP_REGNUM; ++ regno) \
+ { \
+ fixed_regs[regno] = 0; \
+ call_used_regs[regno] = regno < FIRST_CIRRUS_FP_REGNUM + 4; \
+ } \
+ } \
+ if (TARGET_VFP) \
+ { \
+ for (regno = FIRST_VFP_REGNUM; \
+ regno <= LAST_VFP_REGNUM; ++ regno) \
+ { \
+ fixed_regs[regno] = 0; \
+ call_used_regs[regno] = regno < FIRST_VFP_REGNUM + 16; \
+ } \
} \
} \
\
@@ -1030,7 +1138,8 @@ extern const char * structure_size_string;
/* Convert fron bytes to ints. */
#define ARM_NUM_INTS(X) (((X) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-/* The number of (integer) registers required to hold a quantity of type MODE. */
+/* The number of (integer) registers required to hold a quantity of type MODE.
+ Also used for VFP registers. */
#define ARM_NUM_REGS(MODE) \
ARM_NUM_INTS (GET_MODE_SIZE (MODE))
@@ -1109,8 +1218,8 @@ extern const char * structure_size_string;
#define STACK_POINTER_REGNUM SP_REGNUM
/* ARM floating pointer registers. */
-#define FIRST_ARM_FP_REGNUM 16
-#define LAST_ARM_FP_REGNUM 23
+#define FIRST_FPA_REGNUM 16
+#define LAST_FPA_REGNUM 23
#define FIRST_IWMMXT_GR_REGNUM 43
#define LAST_IWMMXT_GR_REGNUM 46
@@ -1132,10 +1241,16 @@ extern const char * structure_size_string;
#define IS_CIRRUS_REGNUM(REGNUM) \
(((REGNUM) >= FIRST_CIRRUS_FP_REGNUM) && ((REGNUM) <= LAST_CIRRUS_FP_REGNUM))
+#define FIRST_VFP_REGNUM 63
+#define LAST_VFP_REGNUM 94
+#define IS_VFP_REGNUM(REGNUM) \
+ (((REGNUM) >= FIRST_VFP_REGNUM) && ((REGNUM) <= LAST_VFP_REGNUM))
+
/* The number of hard registers is 16 ARM + 8 FPA + 1 CC + 1 SFP + 1 AFP. */
/* + 16 Cirrus registers take us up to 43. */
/* Intel Wireless MMX Technology registers add 16 + 4 more. */
-#define FIRST_PSEUDO_REGISTER 63
+/* VFP adds 32 + 1 more. */
+#define FIRST_PSEUDO_REGISTER 96
/* 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
@@ -1156,9 +1271,10 @@ extern const char * structure_size_string;
mode. */
#define HARD_REGNO_NREGS(REGNO, MODE) \
((TARGET_ARM \
- && REGNO >= FIRST_ARM_FP_REGNUM \
+ && REGNO >= FIRST_FPA_REGNUM \
&& REGNO != FRAME_POINTER_REGNUM \
&& REGNO != ARG_POINTER_REGNUM) \
+ && !IS_VFP_REGNUM (REGNO) \
? 1 : ARM_NUM_REGS (MODE))
/* Return true if REGNO is suitable for holding a quantity of type MODE. */
@@ -1184,6 +1300,7 @@ extern const char * structure_size_string;
clobber it anyway. Allocate r0 through r3 in reverse order since r3 is
least likely to contain a function parameter; in addition results are
returned in r0. */
+
#define REG_ALLOC_ORDER \
{ \
3, 2, 1, 0, 12, 14, 4, 5, \
@@ -1194,7 +1311,12 @@ extern const char * structure_size_string;
43, 44, 45, 46, 47, 48, 49, 50, \
51, 52, 53, 54, 55, 56, 57, 58, \
59, 60, 61, 62, \
- 24, 25, 26 \
+ 24, 25, 26, \
+ 78, 77, 76, 75, 74, 73, 72, 71, \
+ 70, 69, 68, 67, 66, 65, 64, 63, \
+ 79, 80, 81, 82, 83, 84, 85, 86, \
+ 87, 88, 89, 90, 91, 92, 93, 94, \
+ 95 \
}
/* Interrupt functions can only use registers that have already been
@@ -1213,6 +1335,7 @@ enum reg_class
NO_REGS,
FPA_REGS,
CIRRUS_REGS,
+ VFP_REGS,
IWMMXT_GR_REGS,
IWMMXT_REGS,
LO_REGS,
@@ -1220,6 +1343,7 @@ enum reg_class
BASE_REGS,
HI_REGS,
CC_REG,
+ VFPCC_REG,
GENERAL_REGS,
ALL_REGS,
LIM_REG_CLASSES
@@ -1227,12 +1351,13 @@ enum reg_class
#define N_REG_CLASSES (int) LIM_REG_CLASSES
-/* Give names of register classes as strings for dump file. */
+/* Give names of register classes as strings for dump file. */
#define REG_CLASS_NAMES \
{ \
"NO_REGS", \
"FPA_REGS", \
"CIRRUS_REGS", \
+ "VFP_REGS", \
"IWMMXT_GR_REGS", \
"IWMMXT_REGS", \
"LO_REGS", \
@@ -1240,6 +1365,7 @@ enum reg_class
"BASE_REGS", \
"HI_REGS", \
"CC_REG", \
+ "VFPCC_REG" \
"GENERAL_REGS", \
"ALL_REGS", \
}
@@ -1247,20 +1373,22 @@ enum reg_class
/* Define which registers fit in which classes.
This is an initializer for a vector of HARD_REG_SET
of length N_REG_CLASSES. */
-#define REG_CLASS_CONTENTS \
-{ \
- { 0x00000000, 0x0 }, /* NO_REGS */ \
- { 0x00FF0000, 0x0 }, /* FPA_REGS */ \
- { 0xF8000000, 0x000007FF }, /* CIRRUS_REGS */ \
- { 0x00000000, 0x00007800 }, /* IWMMXT_GR_REGS */\
- { 0x00000000, 0x7FFF8000 }, /* IWMMXT_REGS */ \
- { 0x000000FF, 0x0 }, /* LO_REGS */ \
- { 0x00002000, 0x0 }, /* STACK_REG */ \
- { 0x000020FF, 0x0 }, /* BASE_REGS */ \
- { 0x0000FF00, 0x0 }, /* HI_REGS */ \
- { 0x01000000, 0x0 }, /* CC_REG */ \
- { 0x0200FFFF, 0x0 }, /* GENERAL_REGS */\
- { 0xFAFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \
+#define REG_CLASS_CONTENTS \
+{ \
+ { 0x00000000, 0x00000000, 0x00000000 }, /* NO_REGS */ \
+ { 0x00FF0000, 0x00000000, 0x00000000 }, /* FPA_REGS */ \
+ { 0xF8000000, 0x000007FF, 0x00000000 }, /* CIRRUS_REGS */ \
+ { 0x00000000, 0x80000000, 0x7FFFFFFF }, /* VFP_REGS */ \
+ { 0x00000000, 0x00007800, 0x00000000 }, /* IWMMXT_GR_REGS */ \
+ { 0x00000000, 0x7FFF8000, 0x00000000 }, /* IWMMXT_REGS */ \
+ { 0x000000FF, 0x00000000, 0x00000000 }, /* LO_REGS */ \
+ { 0x00002000, 0x00000000, 0x00000000 }, /* STACK_REG */ \
+ { 0x000020FF, 0x00000000, 0x00000000 }, /* BASE_REGS */ \
+ { 0x0000FF00, 0x00000000, 0x00000000 }, /* HI_REGS */ \
+ { 0x01000000, 0x00000000, 0x00000000 }, /* CC_REG */ \
+ { 0x00000000, 0x00000000, 0x80000000 }, /* VFPCC_REG */ \
+ { 0x0200FFFF, 0x00000000, 0x00000000 }, /* GENERAL_REGS */ \
+ { 0xFAFFFFFF, 0xFFFFFFFF, 0x7FFFFFFF } /* ALL_REGS */ \
}
/* The same information, inverted:
@@ -1269,11 +1397,14 @@ enum reg_class
or could index an array. */
#define REGNO_REG_CLASS(REGNO) arm_regno_class (REGNO)
-/* FPA registers can't do dubreg as all values are reformatted to internal
- precision. */
+/* FPA registers can't do subreg as all values are reformatted to internal
+ precision. VFP registers may only be accesed in the mode they
+ were set. */
#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
(GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
- ? reg_classes_intersect_p (FPA_REGS, (CLASS)) : 0)
+ ? reg_classes_intersect_p (FPA_REGS, (CLASS)) \
+ || reg_classes_intersect_p (VFP_REGS, (CLASS)) \
+ : 0)
/* The class value for index registers, and the one for base regs. */
#define INDEX_REG_CLASS (TARGET_THUMB ? LO_REGS : GENERAL_REGS)
@@ -1291,7 +1422,7 @@ enum reg_class
/* When SMALL_REGISTER_CLASSES is nonzero, the compiler allows
registers explicitly used in the rtl to be used as spill registers
but prevents the compiler from extending the lifetime of these
- registers. */
+ registers. */
#define SMALL_REGISTER_CLASSES TARGET_THUMB
/* Get reg_class from a letter such as appears in the machine description.
@@ -1300,6 +1431,7 @@ enum reg_class
#define REG_CLASS_FROM_LETTER(C) \
( (C) == 'f' ? FPA_REGS \
: (C) == 'v' ? CIRRUS_REGS \
+ : (C) == 'w' ? VFP_REGS \
: (C) == 'y' ? IWMMXT_REGS \
: (C) == 'z' ? IWMMXT_GR_REGS \
: (C) == 'l' ? (TARGET_ARM ? GENERAL_REGS : LO_REGS) \
@@ -1344,10 +1476,10 @@ enum reg_class
(TARGET_ARM ? \
CONST_OK_FOR_ARM_LETTER (VALUE, C) : CONST_OK_FOR_THUMB_LETTER (VALUE, C))
-/* Constant letter 'G' for the FPA immediate constants.
+/* Constant letter 'G' for the FP immediate constants.
'H' means the same constant negated. */
#define CONST_DOUBLE_OK_FOR_ARM_LETTER(X, C) \
- ((C) == 'G' ? const_double_rtx_ok_for_fpa (X) : \
+ ((C) == 'G' ? arm_const_double_rtx (X) : \
(C) == 'H' ? neg_const_double_rtx_ok_for_fpa (X) : 0)
#define CONST_DOUBLE_OK_FOR_LETTER_P(X, C) \
@@ -1358,7 +1490,8 @@ enum reg_class
an offset from a register.
`S' means any symbol that has the SYMBOL_REF_FLAG set or a CONSTANT_POOL
address. This means that the symbol is in the text segment and can be
- accessed without using a load. */
+ accessed without using a load.
+ 'U' is an address valid for VFP load/store insns. */
#define EXTRA_CONSTRAINT_ARM(OP, C) \
((C) == 'Q' ? GET_CODE (OP) == MEM && GET_CODE (XEXP (OP, 0)) == REG : \
@@ -1367,6 +1500,7 @@ enum reg_class
&& CONSTANT_POOL_ADDRESS_P (XEXP (OP, 0))) : \
(C) == 'S' ? (optimize > 0 && CONSTANT_ADDRESS_P (OP)) : \
(C) == 'T' ? cirrus_memory_offset (OP) : \
+ (C) == 'U' ? vfp_mem_operand (OP) : \
0)
#define EXTRA_CONSTRAINT_THUMB(X, C) \
@@ -1377,6 +1511,8 @@ enum reg_class
(TARGET_ARM ? \
EXTRA_CONSTRAINT_ARM (X, C) : EXTRA_CONSTRAINT_THUMB (X, C))
+#define EXTRA_MEMORY_CONSTRAINT(C, STR) ((C) == 'U')
+
/* 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 for the Thumb we prefer
@@ -1404,15 +1540,23 @@ enum reg_class
or out of a register in CLASS in MODE. If it can be done directly,
NO_REGS is returned. */
#define SECONDARY_OUTPUT_RELOAD_CLASS(CLASS, MODE, X) \
- (TARGET_ARM ? \
- (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
+ /* Restrict which direct reloads are allowed for VFP regs. */ \
+ ((TARGET_VFP && TARGET_HARD_FLOAT \
+ && (CLASS) == VFP_REGS) \
+ ? vfp_secondary_reload_class (MODE, X) \
+ : TARGET_ARM \
+ ? (((MODE) == HImode && ! arm_arch4 && true_regnum (X) == -1) \
? GENERAL_REGS : NO_REGS) \
: THUMB_SECONDARY_OUTPUT_RELOAD_CLASS (CLASS, MODE, X))
-/* If we need to load shorts byte-at-a-time, then we need a scratch. */
+/* If we need to load shorts byte-at-a-time, then we need a scratch. */
#define SECONDARY_INPUT_RELOAD_CLASS(CLASS, MODE, X) \
+ /* Restrict which direct reloads are allowed for VFP regs. */ \
+ ((TARGET_VFP && TARGET_HARD_FLOAT \
+ && (CLASS) == VFP_REGS) \
+ ? vfp_secondary_reload_class (MODE, X) : \
/* Cannot load constants into Cirrus registers. */ \
- ((TARGET_CIRRUS \
+ (TARGET_MAVERICK && TARGET_HARD_FLOAT \
&& (CLASS) == CIRRUS_REGS \
&& (CONSTANT_P (X) || GET_CODE (X) == SYMBOL_REF)) \
? GENERAL_REGS : \
@@ -1446,13 +1590,14 @@ enum reg_class
HOST_WIDE_INT val = INTVAL (XEXP (X, 1)); \
HOST_WIDE_INT low, high; \
\
- if (MODE == DImode || (TARGET_SOFT_FLOAT && MODE == DFmode)) \
+ if (MODE == DImode || (TARGET_SOFT_FLOAT && TARGET_FPA \
+ && MODE == DFmode)) \
low = ((val & 0xf) ^ 0x8) - 0x8; \
- else if (TARGET_CIRRUS) \
+ else if (TARGET_MAVERICK && TARGET_HARD_FLOAT) \
/* Need to be careful, -256 is not a valid offset. */ \
low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
else if (MODE == SImode \
- || (MODE == SFmode && TARGET_SOFT_FLOAT) \
+ || (MODE == SFmode && TARGET_SOFT_FLOAT && TARGET_FPA) \
|| ((MODE == HImode || MODE == QImode) && ! arm_arch4)) \
/* Need to be careful, -4096 is not a valid offset. */ \
low = val >= 0 ? (val & 0xfff) : -((-val) & 0xfff); \
@@ -1460,7 +1605,7 @@ enum reg_class
/* Need to be careful, -256 is not a valid offset. */ \
low = val >= 0 ? (val & 0xff) : -((-val) & 0xff); \
else if (GET_MODE_CLASS (MODE) == MODE_FLOAT \
- && TARGET_HARD_FLOAT) \
+ && TARGET_HARD_FLOAT && TARGET_FPA) \
/* Need to be careful, -1024 is not a valid offset. */ \
low = val >= 0 ? (val & 0x3ff) : -((-val) & 0x3ff); \
else \
@@ -1533,6 +1678,8 @@ enum reg_class
(TARGET_ARM ? \
((FROM) == FPA_REGS && (TO) != FPA_REGS ? 20 : \
(FROM) != FPA_REGS && (TO) == FPA_REGS ? 20 : \
+ (FROM) == VFP_REGS && (TO) != VFP_REGS ? 10 : \
+ (FROM) != VFP_REGS && (TO) == VFP_REGS ? 10 : \
(FROM) == IWMMXT_REGS && (TO) != IWMMXT_REGS ? 4 : \
(FROM) != IWMMXT_REGS && (TO) == IWMMXT_REGS ? 4 : \
(FROM) == IWMMXT_GR_REGS || (TO) == IWMMXT_GR_REGS ? 20 : \
@@ -1563,7 +1710,7 @@ enum reg_class
/* If we generate an insn to push BYTES bytes,
this says how many the stack pointer really advances by. */
/* The push insns do not do this rounding implicitly.
- So don't define this. */
+ So don't define this. */
/* #define PUSH_ROUNDING(NPUSHED) ROUND_UP_WORD (NPUSHED) */
/* Define this if the maximum size of all the outgoing args is to be
@@ -1588,9 +1735,11 @@ enum reg_class
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
#define LIBCALL_VALUE(MODE) \
- (TARGET_ARM && TARGET_HARD_FLOAT && GET_MODE_CLASS (MODE) == MODE_FLOAT \
- ? gen_rtx_REG (MODE, FIRST_ARM_FP_REGNUM) \
- : TARGET_ARM && TARGET_CIRRUS && GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ (TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA \
+ && GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ ? gen_rtx_REG (MODE, FIRST_FPA_REGNUM) \
+ : TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK \
+ && GET_MODE_CLASS (MODE) == MODE_FLOAT \
? gen_rtx_REG (MODE, FIRST_CIRRUS_FP_REGNUM) \
: TARGET_REALLY_IWMMXT && VECTOR_MODE_SUPPORTED_P (MODE) \
? gen_rtx_REG (MODE, FIRST_IWMMXT_REGNUM) \
@@ -1608,18 +1757,20 @@ enum reg_class
/* On a Cirrus chip, mvf0 can return results. */
#define FUNCTION_VALUE_REGNO_P(REGNO) \
((REGNO) == ARG_REGISTER (1) \
- || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) && TARGET_CIRRUS) \
+ || (TARGET_ARM && ((REGNO) == FIRST_CIRRUS_FP_REGNUM) \
+ && TARGET_HARD_FLOAT && TARGET_MAVERICK) \
|| (TARGET_ARM && ((REGNO) == FIRST_IWMMXT_REGNUM) && TARGET_IWMMXT) \
- || (TARGET_ARM && ((REGNO) == FIRST_ARM_FP_REGNUM) && TARGET_HARD_FLOAT))
+ || (TARGET_ARM && ((REGNO) == FIRST_FPA_REGNUM) \
+ && TARGET_HARD_FLOAT && TARGET_FPA))
/* How large values are returned */
/* A C expression which can inhibit the returning of certain function values
- in registers, based on the type of value. */
+ in registers, based on the type of value. */
#define RETURN_IN_MEMORY(TYPE) arm_return_in_memory (TYPE)
/* Define DEFAULT_PCC_STRUCT_RETURN to 1 if all structure and union return
values must be in memory. On the ARM, they need only do so if larger
- than a word, or if they contain elements offset from zero in the struct. */
+ than a word, or if they contain elements offset from zero in the struct. */
#define DEFAULT_PCC_STRUCT_RETURN 0
/* Flags for the call/call_value rtl operations set up by function_arg. */
@@ -1653,7 +1804,7 @@ enum reg_class
#define ARM_FT_INTERRUPT (1 << 2) /* Note overlap with FT_ISR and above. */
#define ARM_FT_NAKED (1 << 3) /* No prologue or epilogue. */
#define ARM_FT_VOLATILE (1 << 4) /* Does not return. */
-#define ARM_FT_NESTED (1 << 5) /* Embedded inside another func. */
+#define ARM_FT_NESTED (1 << 5) /* Embedded inside another func. */
/* Some macros to test these flags. */
#define ARM_FUNC_TYPE(t) (t & ARM_FT_TYPE_MASK)
@@ -1697,7 +1848,7 @@ typedef struct
int iwmmxt_nregs;
int named_count;
int nargs;
- /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT . */
+ /* One of CALL_NORMAL, CALL_LONG or CALL_SHORT. */
int call_cookie;
} CUMULATIVE_ARGS;
@@ -1864,7 +2015,7 @@ typedef struct
/* Determine if the epilogue should be output as RTL.
You should override this if you define FUNCTION_EXTRA_EPILOGUE. */
#define USE_RETURN_INSN(ISCOND) \
- (TARGET_ARM ? use_return_insn (ISCOND) : 0)
+ (TARGET_ARM ? use_return_insn (ISCOND, NULL) : 0)
/* Definitions for register eliminations.
@@ -2049,7 +2200,7 @@ typedef struct
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.
Since they use reg_renumber, they are safe only once reg_renumber
- has been allocated, which happens in local-alloc.c. */
+ has been allocated, which happens in local-alloc.c. */
#define TEST_REGNO(R, TEST, VALUE) \
((R TEST VALUE) || ((unsigned) reg_renumber[R] TEST VALUE))
@@ -2075,7 +2226,7 @@ typedef struct
REGNO_MODE_OK_FOR_BASE_P (REGNO, QImode)
/* Maximum number of registers that can appear in a valid memory address.
- Shifts in addresses can't be by a register. */
+ Shifts in addresses can't be by a register. */
#define MAX_REGS_PER_ADDRESS 2
/* Recognize any constant value that is a valid address. */
@@ -2108,6 +2259,7 @@ typedef struct
#define THUMB_LEGITIMATE_CONSTANT_P(X) \
( GET_CODE (X) == CONST_INT \
|| GET_CODE (X) == CONST_DOUBLE \
+ || GET_CODE (X) == CONSTANT_P_RTX \
|| CONSTANT_ADDRESS_P (X) \
|| flag_pic)
@@ -2283,7 +2435,7 @@ do { \
/* Define as C expression which evaluates to nonzero 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. */
+ Do not define this if the table should contain absolute addresses. */
/* #define CASE_VECTOR_PC_RELATIVE 1 */
/* signed 'char' is most compatible, but RISC OS wants it unsigned.
@@ -2328,7 +2480,7 @@ do { \
/* This is all wrong. Defining SHIFT_COUNT_TRUNCATED tells combine that
code like (X << (Y % 32)) for register X, Y is equivalent to (X << Y).
On the arm, Y in a register is used modulo 256 for the shift. Only for
- rotates is modulo 32 used. */
+ rotates is modulo 32 used. */
/* #define SHIFT_COUNT_TRUNCATED 1 */
/* All integers have the same format so truncation is easy. */
@@ -2396,7 +2548,7 @@ extern int making_const_table;
c_register_pragma (0, "long_calls_off", arm_pr_long_calls_off); \
} while (0)
-/* Condition code information. */
+/* Condition code information. */
/* Given a comparison code (EQ, NE, etc.) and the first operand of a COMPARE,
return the mode to be used for the comparison. */
@@ -2463,10 +2615,11 @@ extern int making_const_table;
{ \
if (TARGET_THUMB) \
{ \
- if (is_called_in_ARM_mode (DECL)) \
+ if (is_called_in_ARM_mode (DECL) \
+ || current_function_is_thunk) \
fprintf (STREAM, "\t.code 32\n") ; \
else \
- fprintf (STREAM, "\t.thumb_func\n") ; \
+ fprintf (STREAM, "\t.code 16\n\t.thumb_func\n") ; \
} \
if (TARGET_POKE_FUNCTION_NAME) \
arm_poke_function_name (STREAM, (char *) NAME); \
@@ -2547,8 +2700,8 @@ extern int making_const_table;
HOST_WIDE_INT offset = 0; \
if (GET_CODE (base) != REG) \
{ \
- /* Ensure that BASE is a register */ \
- /* (one of them must be). */ \
+ /* Ensure that BASE is a register. */ \
+ /* (one of them must be). */ \
rtx temp = base; \
base = index; \
index = temp; \
@@ -2695,12 +2848,13 @@ extern int making_const_table;
/* Define the codes that are matched by predicates in arm.c */
#define PREDICATE_CODES \
{"s_register_operand", {SUBREG, REG}}, \
+ {"arm_general_register_operand", {SUBREG, REG}}, \
{"arm_hard_register_operand", {REG}}, \
{"f_register_operand", {SUBREG, REG}}, \
{"arm_add_operand", {SUBREG, REG, CONST_INT}}, \
{"arm_addimm_operand", {CONST_INT}}, \
- {"fpa_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \
- {"fpa_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \
+ {"arm_float_add_operand", {SUBREG, REG, CONST_DOUBLE}}, \
+ {"arm_float_rhs_operand", {SUBREG, REG, CONST_DOUBLE}}, \
{"arm_rhs_operand", {SUBREG, REG, CONST_INT}}, \
{"arm_not_operand", {SUBREG, REG, CONST_INT}}, \
{"reg_or_int_operand", {SUBREG, REG, CONST_INT}}, \
@@ -2732,12 +2886,14 @@ extern int making_const_table;
{"cirrus_register_operand", {REG}}, \
{"cirrus_fp_register", {REG}}, \
{"cirrus_shift_const", {CONST_INT}}, \
- {"dominant_cc_register", {REG}},
+ {"dominant_cc_register", {REG}}, \
+ {"arm_float_compare_operand", {REG, CONST_DOUBLE}}, \
+ {"vfp_compare_operand", {REG, CONST_DOUBLE}},
/* Define this if you have special predicates that know special things
about modes. Genrecog will warn about certain forms of
match_operand without a mode; if the operand predicate is listed in
- SPECIAL_MODE_PREDICATES, the warning will be suppressed. */
+ SPECIAL_MODE_PREDICATES, the warning will be suppressed. */
#define SPECIAL_MODE_PREDICATES \
"cc_register", "dominant_cc_register",
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 9a693a839d0..6cfd5f552c1 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -1,6 +1,6 @@
;;- Machine description for ARM for GNU compiler
;; Copyright 1991, 1993, 1994, 1995, 1996, 1996, 1997, 1998, 1999, 2000,
-;; 2001, 2002, 2003 Free Software Foundation, Inc.
+;; 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
;; Contributed by Pieter `Tiggr' Schoenmakers (rcpieter@win.tue.nl)
;; and Martin Simmons (@harleqn.co.uk).
;; More major hacks by Richard Earnshaw (rearnsha@arm.com).
@@ -145,7 +145,7 @@
; Floating Point Unit. If we only have floating point emulation, then there
; is no point in scheduling the floating point insns. (Well, for best
; performance we should try and group them together).
-(define_attr "fpu" "softfpa,fpa,fpe2,fpe3,maverick"
+(define_attr "fpu" "none,fpa,fpe2,fpe3,maverick,vfp"
(const (symbol_ref "arm_fpu_attr")))
; LENGTH of an instruction (in bytes)
@@ -167,13 +167,26 @@
(set_attr "length" "4")
(set_attr "pool_range" "250")])
+;; The instruction used to implement a particular pattern. This
+;; information is used by pipeline descriptions to provide accurate
+;; scheduling information.
+
+(define_attr "insn"
+ "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx,smmul,smmulr,other"
+ (const_string "other"))
+
; TYPE attribute is used to detect floating point instructions which, if
; running on a co-processor can run in parallel with other, basic instructions
; If write-buffer scheduling is enabled then it can also be used in the
; scheduling of writes.
; Classification of each insn
-; normal any data instruction that doesn't hit memory or fp regs
+; alu any alu instruction that doesn't hit memory or fp
+; regs or have a shifted source operand
+; alu_shift any data instruction that doesn't hit memory or fp
+; regs, but has a source operand shifted by a constant
+; alu_shift_reg any data instruction that doesn't hit memory or fp
+; regs, but has a source operand shifted by a register value
; mult a multiply instruction
; block blockage insn, this blocks all functional units
; float a floating point arithmetic operation (subject to expansion)
@@ -191,19 +204,27 @@
; r_mem_f the reverse of f_mem_r
; f_2_r fast transfer float to arm (no memory needed)
; r_2_f fast transfer arm to float
+; branch a branch
; call a subroutine call
-; load any load from memory
-; store1 store 1 word to memory from arm registers
+; load_byte load byte(s) from memory to arm registers
+; load1 load 1 word from memory to arm registers
+; load2 load 2 words from memory to arm registers
+; load3 load 3 words from memory to arm registers
+; load4 load 4 words from memory to arm registers
+; store store 1 word to memory from arm registers
; store2 store 2 words
; store3 store 3 words
-; store4 store 4 words
+; store4 store 4 (or more) words
; Additions for Cirrus Maverick co-processor:
; mav_farith Floating point arithmetic (4 cycle)
; mav_dmult Double multiplies (7 cycle)
;
(define_attr "type"
- "normal,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,call,load,store1,store2,store3,store4,mav_farith,mav_dmult"
- (const_string "normal"))
+ "alu,alu_shift,alu_shift_reg,mult,block,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith,float_em,f_load,f_store,f_mem_r,r_mem_f,f_2_r,r_2_f,branch,call,load_byte,load1,load2,load3,load4,store1,store2,store3,store4,mav_farith,mav_dmult"
+ (if_then_else
+ (eq_attr "insn" "smulxy,smlaxy,smlalxy,smulwy,smlawx,mul,muls,mla,mlas,umull,umulls,umlal,umlals,smull,smulls,smlal,smlals")
+ (const_string "mult")
+ (const_string "alu")))
; Load scheduling, set from the arm_ld_sched variable
; initialized by arm_override_options()
@@ -251,7 +272,7 @@
; to stall the processor. Used with model_wbuf above.
(define_attr "write_conflict" "no,yes"
(if_then_else (eq_attr "type"
- "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load")
+ "block,float_em,f_load,f_store,f_mem_r,r_mem_f,call,load1")
(const_string "yes")
(const_string "no")))
@@ -259,7 +280,7 @@
; than one on the main cpu execution unit.
(define_attr "core_cycles" "single,multi"
(if_then_else (eq_attr "type"
- "normal,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith")
+ "alu,alu_shift,float,fdivx,fdivd,fdivs,fmul,ffmul,farith,ffarith")
(const_string "single")
(const_string "multi")))
@@ -267,115 +288,27 @@
;; distant label. Only applicable to Thumb code.
(define_attr "far_jump" "yes,no" (const_string "no"))
-(define_automaton "arm")
+;;---------------------------------------------------------------------------
+;; Pipeline descriptions
-;; Write buffer
-;
-; Strictly, we should model a 4-deep write buffer for ARM7xx based chips
-;
-; The write buffer on some of the arm6 processors is hard to model exactly.
-; There is room in the buffer for up to two addresses and up to eight words
-; of memory, but the two needn't be split evenly. When writing the two
-; addresses are fully pipelined. However, a read from memory that is not
-; currently in the cache will block until the writes have completed.
-; It is normally the case that FCLK and MCLK will be in the ratio 2:1, so
-; writes will take 2 FCLK cycles per word, if FCLK and MCLK are asynchronous
-; (they aren't allowed to be at present) then there is a startup cost of 1MCLK
-; cycle to add as well.
-(define_cpu_unit "write_buf" "arm")
-
-;; Write blockage unit
-;
-; The write_blockage unit models (partially), the fact that reads will stall
-; until the write buffer empties.
-; The f_mem_r and r_mem_f could also block, but they are to the stack,
-; so we don't model them here
-(define_cpu_unit "write_blockage" "arm")
+;; Processor type. This attribute must exactly match the table in
+;; arm-cores.def.
+(define_attr "tune"
+ "arm2,arm250,arm3,arm6,arm60,arm600,arm610,arm620,arm7,arm7m,arm7d,arm7dm,arm7di,arm7dmi,arm70,arm700,arm700i,arm710,arm720,arm710c,arm7100,arm7500,arm7500fe,arm7tdmi,arm710t,arm720t,arm740t,arm8,arm810,arm9,arm920,arm920t,arm940t,arm9tdmi,arm9e,ep9312,strongarm,strongarm110,strongarm1100,strongarm1110,arm10tdmi,arm1020t,arm926ejs,arm1026ejs,xscale,iwmmxt,arm1136js,arm1136jfs"
+ (const (symbol_ref "arm_tune")))
-;; Core
-;
-(define_cpu_unit "core" "arm")
-
-(define_insn_reservation "r_mem_f_wbuf" 5
- (and (eq_attr "model_wbuf" "yes")
- (eq_attr "type" "r_mem_f"))
- "core+write_buf*3")
-
-(define_insn_reservation "store1_wbuf" 5
- (and (eq_attr "model_wbuf" "yes")
- (eq_attr "type" "store1"))
- "core+write_buf*3+write_blockage*5")
-
-(define_insn_reservation "store2_wbuf" 7
- (and (eq_attr "model_wbuf" "yes")
- (eq_attr "type" "store2"))
- "core+write_buf*4+write_blockage*7")
-
-(define_insn_reservation "store3_wbuf" 9
- (and (eq_attr "model_wbuf" "yes")
- (eq_attr "type" "store3"))
- "core+write_buf*5+write_blockage*9")
-
-(define_insn_reservation "store4_wbuf" 11
- (and (eq_attr "model_wbuf" "yes")
- (eq_attr "type" "store4"))
- "core+write_buf*6+write_blockage*11")
-
-(define_insn_reservation "store2" 3
- (and (eq_attr "model_wbuf" "no")
- (eq_attr "type" "store2"))
- "core*3")
-
-(define_insn_reservation "store3" 4
- (and (eq_attr "model_wbuf" "no")
- (eq_attr "type" "store3"))
- "core*4")
-
-(define_insn_reservation "store4" 5
- (and (eq_attr "model_wbuf" "no")
- (eq_attr "type" "store4"))
- "core*5")
-
-(define_insn_reservation "store1_ldsched" 1
- (and (eq_attr "ldsched" "yes") (eq_attr "type" "store1"))
- "core")
-
-(define_insn_reservation "load_ldsched_xscale" 3
- (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load"))
- (eq_attr "is_xscale" "yes"))
- "core")
-
-(define_insn_reservation "load_ldsched" 2
- (and (and (eq_attr "ldsched" "yes") (eq_attr "type" "load"))
- (eq_attr "is_xscale" "no"))
- "core")
-
-(define_insn_reservation "load_or_store" 2
- (and (eq_attr "ldsched" "!yes") (eq_attr "type" "load,store1"))
- "core*2")
-
-(define_insn_reservation "mult" 16
- (and (eq_attr "ldsched" "no") (eq_attr "type" "mult"))
- "core*16")
-
-(define_insn_reservation "mult_ldsched_strongarm" 3
- (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "yes"))
- (eq_attr "type" "mult"))
- "core*2")
-
-(define_insn_reservation "mult_ldsched" 4
- (and (and (eq_attr "ldsched" "yes") (eq_attr "is_strongarm" "no"))
- (eq_attr "type" "mult"))
- "core*4")
-
-(define_insn_reservation "multi_cycle" 32
- (and (eq_attr "core_cycles" "multi")
- (eq_attr "type" "!mult,load,store1,store2,store3,store4"))
- "core*32")
-
-(define_insn_reservation "single_cycle" 1
- (eq_attr "core_cycles" "single")
- "core")
+;; True if the generic scheduling description should be used.
+
+(define_attr "generic_sched" "yes,no"
+ (if_then_else
+ (eq_attr "tune" "arm926ejs,arm1026ejs,arm1136js,arm1136jfs")
+ (const_string "no")
+ (const_string "yes")))
+
+(include "arm-generic.md")
+(include "arm926ejs.md")
+(include "arm1026ejs.md")
+(include "arm1136jfs.md")
;;---------------------------------------------------------------------------
@@ -397,7 +330,7 @@
(clobber (reg:CC CC_REGNUM))])]
"TARGET_EITHER"
"
- if (TARGET_CIRRUS)
+ if (TARGET_HARD_FLOAT && TARGET_MAVERICK)
{
if (!cirrus_fp_register (operands[0], DImode))
operands[0] = force_reg (DImode, operands[0]);
@@ -433,7 +366,7 @@
(plus:DI (match_operand:DI 1 "s_register_operand" "%0, 0")
(match_operand:DI 2 "s_register_operand" "r, 0")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && !TARGET_CIRRUS"
+ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
"#"
"TARGET_ARM && reload_completed"
[(parallel [(set (reg:CC_C CC_REGNUM)
@@ -461,7 +394,7 @@
(match_operand:SI 2 "s_register_operand" "r,r"))
(match_operand:DI 1 "s_register_operand" "r,0")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && !TARGET_CIRRUS"
+ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
"#"
"TARGET_ARM && reload_completed"
[(parallel [(set (reg:CC_C CC_REGNUM)
@@ -490,7 +423,7 @@
(match_operand:SI 2 "s_register_operand" "r,r"))
(match_operand:DI 1 "s_register_operand" "r,0")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && !TARGET_CIRRUS"
+ "TARGET_ARM && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)"
"#"
"TARGET_ARM && reload_completed"
[(parallel [(set (reg:CC_C CC_REGNUM)
@@ -792,16 +725,19 @@
)
(define_insn "*addsi3_carryin_shift"
- [(set (match_operand:SI 0 "s_register_operand" "")
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
(plus:SI (ltu:SI (reg:CC_C CC_REGNUM) (const_int 0))
(plus:SI
(match_operator:SI 2 "shift_operator"
- [(match_operand:SI 3 "s_register_operand" "")
- (match_operand:SI 4 "reg_or_int_operand" "")])
- (match_operand:SI 1 "s_register_operand" ""))))]
+ [(match_operand:SI 3 "s_register_operand" "r")
+ (match_operand:SI 4 "reg_or_int_operand" "rM")])
+ (match_operand:SI 1 "s_register_operand" "r"))))]
"TARGET_ARM"
"adc%?\\t%0, %1, %3%S2"
- [(set_attr "conds" "use")]
+ [(set_attr "conds" "use")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*addsi3_carryin_alt1"
@@ -847,13 +783,27 @@
(set_attr "length" "4,8")]
)
+; transform ((x << y) - 1) to ~(~(x-1) << y) Where X is a constant.
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (plus:SI (ashift:SI (match_operand:SI 1 "const_int_operand" "")
+ (match_operand:SI 2 "s_register_operand" ""))
+ (const_int -1)))
+ (clobber (match_operand:SI 3 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 3) (match_dup 1))
+ (set (match_dup 0) (not:SI (ashift:SI (match_dup 3) (match_dup 2))))]
+ "
+ operands[1] = GEN_INT (~(INTVAL (operands[1]) - 1));
+")
+
(define_expand "addsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
(plus:SF (match_operand:SF 1 "s_register_operand" "")
- (match_operand:SF 2 "fpa_add_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_add_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS
+ if (TARGET_MAVERICK
&& !cirrus_fp_register (operands[2], SFmode))
operands[2] = force_reg (SFmode, operands[2]);
")
@@ -861,10 +811,10 @@
(define_expand "adddf3"
[(set (match_operand:DF 0 "s_register_operand" "")
(plus:DF (match_operand:DF 1 "s_register_operand" "")
- (match_operand:DF 2 "fpa_add_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_add_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS
+ if (TARGET_MAVERICK
&& !cirrus_fp_register (operands[2], DFmode))
operands[2] = force_reg (DFmode, operands[2]);
")
@@ -877,7 +827,7 @@
(clobber (reg:CC CC_REGNUM))])]
"TARGET_EITHER"
"
- if (TARGET_CIRRUS
+ if (TARGET_HARD_FLOAT && TARGET_MAVERICK
&& TARGET_ARM
&& cirrus_fp_register (operands[0], DImode)
&& cirrus_fp_register (operands[1], DImode))
@@ -1073,11 +1023,11 @@
(define_expand "subsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
- (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "")
- (match_operand:SF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "")
+ (match_operand:SF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
if (!cirrus_fp_register (operands[1], SFmode))
operands[1] = force_reg (SFmode, operands[1]);
@@ -1088,11 +1038,11 @@
(define_expand "subdf3"
[(set (match_operand:DF 0 "s_register_operand" "")
- (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "")
- (match_operand:DF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "")
+ (match_operand:DF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
if (!cirrus_fp_register (operands[1], DFmode))
operands[1] = force_reg (DFmode, operands[1]);
@@ -1119,7 +1069,7 @@
(match_operand:SI 1 "s_register_operand" "%?r,0")))]
"TARGET_ARM"
"mul%?\\t%0, %2, %1"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "mul")
(set_attr "predicable" "yes")]
)
@@ -1140,7 +1090,7 @@
return \"mul\\t%0, %0, %2\";
"
[(set_attr "length" "4,4,2")
- (set_attr "type" "mult")]
+ (set_attr "insn" "mul")]
)
(define_insn "*mulsi3_compare0"
@@ -1154,7 +1104,7 @@
"TARGET_ARM && !arm_arch_xscale"
"mul%?s\\t%0, %2, %1"
[(set_attr "conds" "set")
- (set_attr "type" "mult")]
+ (set_attr "insn" "muls")]
)
(define_insn "*mulsi_compare0_scratch"
@@ -1167,7 +1117,7 @@
"TARGET_ARM && !arm_arch_xscale"
"mul%?s\\t%0, %2, %1"
[(set_attr "conds" "set")
- (set_attr "type" "mult")]
+ (set_attr "insn" "muls")]
)
;; Unnamed templates to match MLA instruction.
@@ -1180,7 +1130,7 @@
(match_operand:SI 3 "s_register_operand" "?r,r,0,0")))]
"TARGET_ARM"
"mla%?\\t%0, %2, %1, %3"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "mla")
(set_attr "predicable" "yes")]
)
@@ -1198,7 +1148,7 @@
"TARGET_ARM && !arm_arch_xscale"
"mla%?s\\t%0, %2, %1, %3"
[(set_attr "conds" "set")
- (set_attr "type" "mult")]
+ (set_attr "insn" "mlas")]
)
(define_insn "*mulsi3addsi_compare0_scratch"
@@ -1213,10 +1163,10 @@
"TARGET_ARM && !arm_arch_xscale"
"mla%?s\\t%0, %2, %1, %3"
[(set_attr "conds" "set")
- (set_attr "type" "mult")]
+ (set_attr "insn" "mlas")]
)
-;; Unnamed template to match long long multiply-accumlate (smlal)
+;; Unnamed template to match long long multiply-accumulate (smlal)
(define_insn "*mulsidi3adddi"
[(set (match_operand:DI 0 "s_register_operand" "=&r")
@@ -1225,9 +1175,9 @@
(sign_extend:DI (match_operand:SI 2 "s_register_operand" "%r"))
(sign_extend:DI (match_operand:SI 3 "s_register_operand" "r")))
(match_operand:DI 1 "s_register_operand" "0")))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"smlal%?\\t%Q0, %R0, %3, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smlal")
(set_attr "predicable" "yes")]
)
@@ -1236,9 +1186,9 @@
(mult:DI
(sign_extend:DI (match_operand:SI 1 "s_register_operand" "%r"))
(sign_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"smull%?\\t%Q0, %R0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smull")
(set_attr "predicable" "yes")]
)
@@ -1247,13 +1197,13 @@
(mult:DI
(zero_extend:DI (match_operand:SI 1 "s_register_operand" "%r"))
(zero_extend:DI (match_operand:SI 2 "s_register_operand" "r"))))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"umull%?\\t%Q0, %R0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "umull")
(set_attr "predicable" "yes")]
)
-;; Unnamed template to match long long unsigned multiply-accumlate (umlal)
+;; Unnamed template to match long long unsigned multiply-accumulate (umlal)
(define_insn "*umulsidi3adddi"
[(set (match_operand:DI 0 "s_register_operand" "=&r")
@@ -1262,9 +1212,9 @@
(zero_extend:DI (match_operand:SI 2 "s_register_operand" "%r"))
(zero_extend:DI (match_operand:SI 3 "s_register_operand" "r")))
(match_operand:DI 1 "s_register_operand" "0")))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"umlal%?\\t%Q0, %R0, %3, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "umlal")
(set_attr "predicable" "yes")]
)
@@ -1277,9 +1227,9 @@
(sign_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")))
(const_int 32))))
(clobber (match_scratch:SI 3 "=&r,&r"))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"smull%?\\t%3, %0, %2, %1"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smull")
(set_attr "predicable" "yes")]
)
@@ -1292,9 +1242,9 @@
(zero_extend:DI (match_operand:SI 2 "s_register_operand" "r,r")))
(const_int 32))))
(clobber (match_scratch:SI 3 "=&r,&r"))]
- "TARGET_ARM && arm_fast_multiply"
+ "TARGET_ARM && arm_arch3m"
"umull%?\\t%3, %0, %2, %1"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "umull")
(set_attr "predicable" "yes")]
)
@@ -1306,7 +1256,7 @@
(match_operand:HI 2 "s_register_operand" "r"))))]
"TARGET_ARM && arm_arch5e"
"smulbb%?\\t%0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smulxy")
(set_attr "predicable" "yes")]
)
@@ -1319,7 +1269,7 @@
(match_operand:HI 2 "s_register_operand" "r"))))]
"TARGET_ARM && arm_arch5e"
"smultb%?\\t%0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smulxy")
(set_attr "predicable" "yes")]
)
@@ -1332,7 +1282,7 @@
(const_int 16))))]
"TARGET_ARM && arm_arch5e"
"smulbt%?\\t%0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smulxy")
(set_attr "predicable" "yes")]
)
@@ -1346,7 +1296,7 @@
(const_int 16))))]
"TARGET_ARM && arm_arch5e"
"smultt%?\\t%0, %1, %2"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smulxy")
(set_attr "predicable" "yes")]
)
@@ -1359,7 +1309,7 @@
(match_operand:HI 3 "s_register_operand" "r")))))]
"TARGET_ARM && arm_arch5e"
"smlabb%?\\t%0, %2, %3, %1"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smlaxy")
(set_attr "predicable" "yes")]
)
@@ -1373,16 +1323,16 @@
(match_operand:HI 3 "s_register_operand" "r")))))]
"TARGET_ARM && arm_arch5e"
"smlalbb%?\\t%Q0, %R0, %2, %3"
- [(set_attr "type" "mult")
+ [(set_attr "insn" "smlalxy")
(set_attr "predicable" "yes")])
(define_expand "mulsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
(mult:SF (match_operand:SF 1 "s_register_operand" "")
- (match_operand:SF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS
+ if (TARGET_MAVERICK
&& !cirrus_fp_register (operands[2], SFmode))
operands[2] = force_reg (SFmode, operands[2]);
")
@@ -1390,10 +1340,10 @@
(define_expand "muldf3"
[(set (match_operand:DF 0 "s_register_operand" "")
(mult:DF (match_operand:DF 1 "s_register_operand" "")
- (match_operand:DF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS
+ if (TARGET_MAVERICK
&& !cirrus_fp_register (operands[2], DFmode))
operands[2] = force_reg (DFmode, operands[2]);
")
@@ -1402,16 +1352,16 @@
(define_expand "divsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
- (div:SF (match_operand:SF 1 "fpa_rhs_operand" "")
- (match_operand:SF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "")
+ (match_operand:SF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
"")
(define_expand "divdf3"
[(set (match_operand:DF 0 "s_register_operand" "")
- (div:DF (match_operand:DF 1 "fpa_rhs_operand" "")
- (match_operand:DF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "")
+ (match_operand:DF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
"")
;; Modulo insns
@@ -1419,15 +1369,15 @@
(define_expand "modsf3"
[(set (match_operand:SF 0 "s_register_operand" "")
(mod:SF (match_operand:SF 1 "s_register_operand" "")
- (match_operand:SF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"")
(define_expand "moddf3"
[(set (match_operand:DF 0 "s_register_operand" "")
(mod:DF (match_operand:DF 1 "s_register_operand" "")
- (match_operand:DF 2 "fpa_rhs_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"")
;; Boolean and,ior,xor insns
@@ -1740,6 +1690,28 @@
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "shiftable_operator"
+ [(zero_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (match_operand:SI 5 "s_register_operand" "")]))
+ (clobber (match_operand:SI 6 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 6) (ashift:SI (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(lshiftrt:SI (match_dup 6) (match_dup 4))
+ (match_dup 5)]))]
+ "{
+ HOST_WIDE_INT temp = INTVAL (operands[3]);
+
+ operands[3] = GEN_INT (32 - temp - INTVAL (operands[4]));
+ operands[4] = GEN_INT (32 - temp);
+ }"
+)
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
(sign_extract:SI (match_operand:SI 1 "s_register_operand" "")
(match_operand:SI 2 "const_int_operand" "")
(match_operand:SI 3 "const_int_operand" "")))]
@@ -1754,6 +1726,28 @@
}"
)
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "shiftable_operator"
+ [(sign_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (match_operand:SI 5 "s_register_operand" "")]))
+ (clobber (match_operand:SI 6 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 6) (ashift:SI (match_dup 2) (match_dup 3)))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(ashiftrt:SI (match_dup 6) (match_dup 4))
+ (match_dup 5)]))]
+ "{
+ HOST_WIDE_INT temp = INTVAL (operands[3]);
+
+ operands[3] = GEN_INT (32 - temp - INTVAL (operands[4]));
+ operands[4] = GEN_INT (32 - temp);
+ }"
+)
+
;;; ??? This pattern is bogus. If operand3 has bits outside the range
;;; represented by the bitfield, then this will produce incorrect results.
;;; Somewhere, the value needs to be truncated. On targets like the m68k,
@@ -1990,16 +1984,18 @@
)
(define_insn "andsi_not_shiftsi_si"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (and:SI (not:SI (match_operator:SI 4 "shift_operator"
- [(match_operand:SI 2 "s_register_operand" "r")
- (match_operand:SI 3 "arm_rhs_operand" "rM")]))
- (match_operand:SI 1 "s_register_operand" "r")))]
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (and:SI (not:SI (match_operator:SI 4 "shift_operator"
+ [(match_operand:SI 2 "s_register_operand" "r")
+ (match_operand:SI 3 "arm_rhs_operand" "rM")]))
+ (match_operand:SI 1 "s_register_operand" "r")))]
"TARGET_ARM"
"bic%?\\t%0, %1, %2%S4"
[(set_attr "predicable" "yes")
(set_attr "shift" "2")
- ]
+ (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*andsi_notsi_si_compare0"
@@ -2262,6 +2258,109 @@
(set_attr "predicable" "yes")]
)
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "logical_binary_operator"
+ [(zero_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (match_operator:SI 9 "logical_binary_operator"
+ [(lshiftrt:SI (match_operand:SI 5 "s_register_operand" "")
+ (match_operand:SI 6 "const_int_operand" ""))
+ (match_operand:SI 7 "s_register_operand" "")])]))
+ (clobber (match_operand:SI 8 "s_register_operand" ""))]
+ "TARGET_ARM
+ && GET_CODE (operands[1]) == GET_CODE (operands[9])
+ && INTVAL (operands[3]) == 32 - INTVAL (operands[6])"
+ [(set (match_dup 8)
+ (match_op_dup 1
+ [(ashift:SI (match_dup 2) (match_dup 4))
+ (match_dup 5)]))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(lshiftrt:SI (match_dup 8) (match_dup 6))
+ (match_dup 7)]))]
+ "
+ operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4])));
+")
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "logical_binary_operator"
+ [(match_operator:SI 9 "logical_binary_operator"
+ [(lshiftrt:SI (match_operand:SI 5 "s_register_operand" "")
+ (match_operand:SI 6 "const_int_operand" ""))
+ (match_operand:SI 7 "s_register_operand" "")])
+ (zero_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))]))
+ (clobber (match_operand:SI 8 "s_register_operand" ""))]
+ "TARGET_ARM
+ && GET_CODE (operands[1]) == GET_CODE (operands[9])
+ && INTVAL (operands[3]) == 32 - INTVAL (operands[6])"
+ [(set (match_dup 8)
+ (match_op_dup 1
+ [(ashift:SI (match_dup 2) (match_dup 4))
+ (match_dup 5)]))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(lshiftrt:SI (match_dup 8) (match_dup 6))
+ (match_dup 7)]))]
+ "
+ operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4])));
+")
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "logical_binary_operator"
+ [(sign_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))
+ (match_operator:SI 9 "logical_binary_operator"
+ [(ashiftrt:SI (match_operand:SI 5 "s_register_operand" "")
+ (match_operand:SI 6 "const_int_operand" ""))
+ (match_operand:SI 7 "s_register_operand" "")])]))
+ (clobber (match_operand:SI 8 "s_register_operand" ""))]
+ "TARGET_ARM
+ && GET_CODE (operands[1]) == GET_CODE (operands[9])
+ && INTVAL (operands[3]) == 32 - INTVAL (operands[6])"
+ [(set (match_dup 8)
+ (match_op_dup 1
+ [(ashift:SI (match_dup 2) (match_dup 4))
+ (match_dup 5)]))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(ashiftrt:SI (match_dup 8) (match_dup 6))
+ (match_dup 7)]))]
+ "
+ operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4])));
+")
+
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "logical_binary_operator"
+ [(match_operator:SI 9 "logical_binary_operator"
+ [(ashiftrt:SI (match_operand:SI 5 "s_register_operand" "")
+ (match_operand:SI 6 "const_int_operand" ""))
+ (match_operand:SI 7 "s_register_operand" "")])
+ (sign_extract:SI (match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "const_int_operand" "")
+ (match_operand:SI 4 "const_int_operand" ""))]))
+ (clobber (match_operand:SI 8 "s_register_operand" ""))]
+ "TARGET_ARM
+ && GET_CODE (operands[1]) == GET_CODE (operands[9])
+ && INTVAL (operands[3]) == 32 - INTVAL (operands[6])"
+ [(set (match_dup 8)
+ (match_op_dup 1
+ [(ashift:SI (match_dup 2) (match_dup 4))
+ (match_dup 5)]))
+ (set (match_dup 0)
+ (match_op_dup 1
+ [(ashiftrt:SI (match_dup 8) (match_dup 6))
+ (match_dup 7)]))]
+ "
+ operands[4] = GEN_INT (32 - (INTVAL (operands[3]) + INTVAL (operands[4])));
+")
;; Minimum and maximum insns
@@ -2376,6 +2475,41 @@
;; Shift and rotation insns
+(define_expand "ashldi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (ashift:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:SI 2 "reg_or_int_operand" "")))]
+ "TARGET_ARM"
+ "
+ if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1)
+ {
+ emit_insn (gen_arm_ashldi3_1bit (operands[0], operands[1]));
+ DONE;
+ }
+ /* Ideally we shouldn't fail here if we could know that operands[1]
+ ends up already living in an iwmmxt register. Otherwise it's
+ cheaper to have the alternate code being generated than moving
+ values to iwmmxt regs and back. */
+ FAIL;
+ }
+ else if (!TARGET_REALLY_IWMMXT && !(TARGET_HARD_FLOAT && TARGET_MAVERICK))
+ FAIL;
+ "
+)
+
+(define_insn "arm_ashldi3_1bit"
+ [(set (match_operand:DI 0 "s_register_operand" "=&r,r")
+ (ashift:DI (match_operand:DI 1 "s_register_operand" "?r,0")
+ (const_int 1)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_ARM"
+ "movs\\t%Q0, %Q1, asl #1\;adc\\t%R0, %R1, %R1"
+ [(set_attr "conds" "clob")
+ (set_attr "length" "8")]
+)
+
(define_expand "ashlsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(ashift:SI (match_operand:SI 1 "s_register_operand" "")
@@ -2400,6 +2534,41 @@
[(set_attr "length" "2")]
)
+(define_expand "ashrdi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:SI 2 "reg_or_int_operand" "")))]
+ "TARGET_ARM"
+ "
+ if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1)
+ {
+ emit_insn (gen_arm_ashrdi3_1bit (operands[0], operands[1]));
+ DONE;
+ }
+ /* Ideally we shouldn't fail here if we could know that operands[1]
+ ends up already living in an iwmmxt register. Otherwise it's
+ cheaper to have the alternate code being generated than moving
+ values to iwmmxt regs and back. */
+ FAIL;
+ }
+ else if (!TARGET_REALLY_IWMMXT)
+ FAIL;
+ "
+)
+
+(define_insn "arm_ashrdi3_1bit"
+ [(set (match_operand:DI 0 "s_register_operand" "=&r,r")
+ (ashiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0")
+ (const_int 1)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_ARM"
+ "movs\\t%R0, %R1, asr #1\;mov\\t%Q0, %Q1, rrx"
+ [(set_attr "conds" "clob")
+ (set_attr "length" "8")]
+)
+
(define_expand "ashrsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(ashiftrt:SI (match_operand:SI 1 "s_register_operand" "")
@@ -2421,6 +2590,41 @@
[(set_attr "length" "2")]
)
+(define_expand "lshrdi3"
+ [(set (match_operand:DI 0 "s_register_operand" "")
+ (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "")
+ (match_operand:SI 2 "reg_or_int_operand" "")))]
+ "TARGET_ARM"
+ "
+ if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ if ((HOST_WIDE_INT) INTVAL (operands[2]) == 1)
+ {
+ emit_insn (gen_arm_lshrdi3_1bit (operands[0], operands[1]));
+ DONE;
+ }
+ /* Ideally we shouldn't fail here if we could know that operands[1]
+ ends up already living in an iwmmxt register. Otherwise it's
+ cheaper to have the alternate code being generated than moving
+ values to iwmmxt regs and back. */
+ FAIL;
+ }
+ else if (!TARGET_REALLY_IWMMXT)
+ FAIL;
+ "
+)
+
+(define_insn "arm_lshrdi3_1bit"
+ [(set (match_operand:DI 0 "s_register_operand" "=&r,r")
+ (lshiftrt:DI (match_operand:DI 1 "s_register_operand" "?r,0")
+ (const_int 1)))
+ (clobber (reg:CC CC_REGNUM))]
+ "TARGET_ARM"
+ "movs\\t%R0, %R1, lsr #1\;mov\\t%Q0, %Q1, rrx"
+ [(set_attr "conds" "clob")
+ (set_attr "length" "8")]
+)
+
(define_expand "lshrsi3"
[(set (match_operand:SI 0 "s_register_operand" "")
(lshiftrt:SI (match_operand:SI 1 "s_register_operand" "")
@@ -2491,19 +2695,6 @@
[(set_attr "length" "2")]
)
-(define_expand "ashldi3"
- [(set (match_operand:DI 0 "s_register_operand" "")
- (ashift:DI (match_operand:DI 1 "general_operand" "")
- (match_operand:SI 2 "general_operand" "")))]
- "TARGET_ARM && (TARGET_IWMMXT || TARGET_CIRRUS)"
- "
- if (! s_register_operand (operands[1], DImode))
- operands[1] = copy_to_mode_reg (DImode, operands[1]);
- if (! s_register_operand (operands[2], SImode))
- operands[2] = copy_to_mode_reg (SImode, operands[2]);
- "
-)
-
(define_insn "*arm_shiftsi3"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(match_operator:SI 3 "shift_operator"
@@ -2513,7 +2704,9 @@
"mov%?\\t%0, %1%S3"
[(set_attr "predicable" "yes")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*shiftsi3_compare0"
@@ -2528,7 +2721,9 @@
"mov%?s\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*shiftsi3_compare0_scratch"
@@ -2541,8 +2736,7 @@
"TARGET_ARM"
"mov%?s\\t%0, %1%S3"
[(set_attr "conds" "set")
- (set_attr "shift" "1")
- ]
+ (set_attr "shift" "1")]
)
(define_insn "*notsi_shiftsi"
@@ -2554,7 +2748,9 @@
"mvn%?\\t%0, %1%S3"
[(set_attr "predicable" "yes")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*notsi_shiftsi_compare0"
@@ -2569,7 +2765,9 @@
"mvn%?s\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*not_shiftsi_compare0_scratch"
@@ -2583,7 +2781,9 @@
"mvn%?s\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
;; We don't really have extzv, but defining this using shifts helps
@@ -2680,14 +2880,14 @@
(define_expand "negsf2"
[(set (match_operand:SF 0 "s_register_operand" "")
(neg:SF (match_operand:SF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
""
)
(define_expand "negdf2"
[(set (match_operand:DF 0 "s_register_operand" "")
(neg:DF (match_operand:DF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"")
;; abssi2 doesn't really clobber the condition codes if a different register
@@ -2734,25 +2934,25 @@
(define_expand "abssf2"
[(set (match_operand:SF 0 "s_register_operand" "")
(abs:SF (match_operand:SF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"")
(define_expand "absdf2"
[(set (match_operand:DF 0 "s_register_operand" "")
(abs:DF (match_operand:DF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"")
(define_expand "sqrtsf2"
[(set (match_operand:SF 0 "s_register_operand" "")
(sqrt:SF (match_operand:SF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
"")
(define_expand "sqrtdf2"
[(set (match_operand:DF 0 "s_register_operand" "")
(sqrt:DF (match_operand:DF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
"")
(define_insn_and_split "one_cmpldi2"
@@ -2823,9 +3023,9 @@
(define_expand "floatsisf2"
[(set (match_operand:SF 0 "s_register_operand" "")
(float:SF (match_operand:SI 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
emit_insn (gen_cirrus_floatsisf2 (operands[0], operands[1]));
DONE;
@@ -2835,9 +3035,9 @@
(define_expand "floatsidf2"
[(set (match_operand:DF 0 "s_register_operand" "")
(float:DF (match_operand:SI 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
emit_insn (gen_cirrus_floatsidf2 (operands[0], operands[1]));
DONE;
@@ -2847,9 +3047,9 @@
(define_expand "fix_truncsfsi2"
[(set (match_operand:SI 0 "s_register_operand" "")
(fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" ""))))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
if (!cirrus_fp_register (operands[0], SImode))
operands[0] = force_reg (SImode, operands[0]);
@@ -2863,9 +3063,9 @@
(define_expand "fix_truncdfsi2"
[(set (match_operand:SI 0 "s_register_operand" "")
(fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" ""))))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS)
+ if (TARGET_MAVERICK)
{
if (!cirrus_fp_register (operands[1], DFmode))
operands[1] = force_reg (DFmode, operands[0]);
@@ -2880,7 +3080,7 @@
[(set (match_operand:SF 0 "s_register_operand" "")
(float_truncate:SF
(match_operand:DF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
""
)
@@ -2909,7 +3109,7 @@
ldr%?b\\t%Q0, %1\;mov%?\\t%R0, #0"
[(set_attr "length" "8")
(set_attr "predicable" "yes")
- (set_attr "type" "*,load")
+ (set_attr "type" "*,load_byte")
(set_attr "pool_range" "*,4092")
(set_attr "neg_pool_range" "*,4084")]
)
@@ -2938,72 +3138,42 @@
"TARGET_EITHER"
"
{
- if (TARGET_ARM)
+ if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM)
{
- if (arm_arch4 && GET_CODE (operands[1]) == MEM)
- {
- /* Note: We do not have to worry about TARGET_MMU_TRAPS
- here because the insn below will generate an LDRH instruction
- rather than an LDR instruction, so we cannot get an unaligned
- word access. */
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_ZERO_EXTEND (SImode,
- operands[1])));
- DONE;
- }
- if (TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM)
- {
- emit_insn (gen_movhi_bytes (operands[0], operands[1]));
- DONE;
- }
- if (!s_register_operand (operands[1], HImode))
- operands[1] = copy_to_mode_reg (HImode, operands[1]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
+ /* Note: We do not have to worry about TARGET_MMU_TRAPS
+ here because the insn below will generate an LDRH instruction
+ rather than an LDR instruction, so we cannot get an unaligned
+ word access. */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_ZERO_EXTEND (SImode, operands[1])));
+ DONE;
}
- else /* TARGET_THUMB */
- {
- if (GET_CODE (operands[1]) == MEM)
- {
- rtx tmp;
- tmp = gen_rtx_ZERO_EXTEND (SImode, operands[1]);
- tmp = gen_rtx_SET (VOIDmode, operands[0], tmp);
- emit_insn (tmp);
- }
- else
- {
- rtx ops[3];
-
- if (!s_register_operand (operands[1], HImode))
- operands[1] = copy_to_mode_reg (HImode, operands[1]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
-
- ops[0] = operands[2];
- ops[1] = operands[1];
- ops[2] = GEN_INT (16);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFT (SImode, ops[1], ops[2])));
+ if (TARGET_ARM && TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM)
+ {
+ emit_insn (gen_movhi_bytes (operands[0], operands[1]));
+ DONE;
+ }
- ops[0] = operands[0];
- ops[1] = operands[2];
- ops[2] = GEN_INT (16);
+ if (!s_register_operand (operands[1], HImode))
+ operands[1] = copy_to_mode_reg (HImode, operands[1]);
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_LSHIFTRT (SImode, ops[1],
- ops[2])));
- }
- DONE;
+ if (arm_arch6)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_ZERO_EXTEND (SImode, operands[1])));
+ DONE;
}
+
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_reg_rtx (SImode);
}"
)
(define_insn "*thumb_zero_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
- "TARGET_THUMB"
+ [(set (match_operand:SI 0 "register_operand" "=l")
+ (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ "TARGET_THUMB && !arm_arch6"
"*
rtx mem = XEXP (operands[1], 0);
@@ -3038,21 +3208,91 @@
return \"ldrh\\t%0, %1\";
"
[(set_attr "length" "4")
- (set_attr "type" "load")
+ (set_attr "type" "load_byte")
(set_attr "pool_range" "60")]
)
+(define_insn "*thumb_zero_extendhisi2_v6"
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))]
+ "TARGET_THUMB && arm_arch6"
+ "*
+ rtx mem;
+
+ if (which_alternative == 0)
+ return \"uxth\\t%0, %1\";
+
+ mem = XEXP (operands[1], 0);
+
+ if (GET_CODE (mem) == CONST)
+ mem = XEXP (mem, 0);
+
+ if (GET_CODE (mem) == LABEL_REF)
+ return \"ldr\\t%0, %1\";
+
+ if (GET_CODE (mem) == PLUS)
+ {
+ rtx a = XEXP (mem, 0);
+ rtx b = XEXP (mem, 1);
+
+ /* This can happen due to bugs in reload. */
+ if (GET_CODE (a) == REG && REGNO (a) == SP_REGNUM)
+ {
+ rtx ops[2];
+ ops[0] = operands[0];
+ ops[1] = a;
+
+ output_asm_insn (\"mov %0, %1\", ops);
+
+ XEXP (mem, 0) = operands[0];
+ }
+
+ else if ( GET_CODE (a) == LABEL_REF
+ && GET_CODE (b) == CONST_INT)
+ return \"ldr\\t%0, %1\";
+ }
+
+ return \"ldrh\\t%0, %1\";
+ "
+ [(set_attr "length" "2,4")
+ (set_attr "type" "alu_shift,load_byte")
+ (set_attr "pool_range" "*,60")]
+)
+
(define_insn "*arm_zero_extendhisi2"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
- "TARGET_ARM && arm_arch4"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (zero_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
"ldr%?h\\t%0, %1"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")
(set_attr "pool_range" "256")
(set_attr "neg_pool_range" "244")]
)
+(define_insn "*arm_zero_extendhisi2_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (zero_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ uxth%?\\t%0, %1
+ ldr%?h\\t%0, %1"
+ [(set_attr "type" "alu_shift,load_byte")
+ (set_attr "predicable" "yes")
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
+)
+
+(define_insn "*arm_zero_extendhisi2addsi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (plus:SI (zero_extend:SI (match_operand:HI 1 "s_register_operand" "r"))
+ (match_operand:SI 2 "s_register_operand" "r")))]
+ "TARGET_ARM && arm_arch6"
+ "uxtah%?\\t%0, %2, %1"
+ [(set_attr "type" "alu_shift")
+ (set_attr "predicable" "yes")]
+)
+
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
(zero_extend:SI (match_operand:HI 1 "alignable_memory_operand" "")))
@@ -3088,7 +3328,7 @@
(zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "")))]
"TARGET_EITHER"
"
- if (GET_CODE (operands[1]) != MEM)
+ if (!arm_arch6 && GET_CODE (operands[1]) != MEM)
{
if (TARGET_ARM)
{
@@ -3124,26 +3364,61 @@
)
(define_insn "*thumb_zero_extendqisi2"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_THUMB"
+ [(set (match_operand:SI 0 "register_operand" "=l")
+ (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ "TARGET_THUMB && !arm_arch6"
"ldrb\\t%0, %1"
[(set_attr "length" "2")
- (set_attr "type" "load")
+ (set_attr "type" "load_byte")
(set_attr "pool_range" "32")]
)
+(define_insn "*thumb_zero_extendqisi2_v6"
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,m")))]
+ "TARGET_THUMB && arm_arch6"
+ "@
+ uxtb\\t%0, %1
+ ldrb\\t%0, %1"
+ [(set_attr "length" "2,2")
+ (set_attr "type" "alu_shift,load_byte")
+ (set_attr "pool_range" "*,32")]
+)
+
(define_insn "*arm_zero_extendqisi2"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_ARM"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (zero_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ "TARGET_ARM && !arm_arch6"
"ldr%?b\\t%0, %1\\t%@ zero_extendqisi2"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")
(set_attr "pool_range" "4096")
(set_attr "neg_pool_range" "4084")]
)
+(define_insn "*arm_zero_extendqisi2_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (zero_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ uxtb%?\\t%0, %1
+ ldr%?b\\t%0, %1\\t%@ zero_extendqisi2"
+ [(set_attr "type" "alu_shift,load_byte")
+ (set_attr "predicable" "yes")
+ (set_attr "pool_range" "*,4096")
+ (set_attr "neg_pool_range" "*,4084")]
+)
+
+(define_insn "*arm_zero_extendqisi2addsi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (plus:SI (zero_extend:SI (match_operand:QI 1 "s_register_operand" "r"))
+ (match_operand:SI 2 "s_register_operand" "r")))]
+ "TARGET_ARM && arm_arch6"
+ "uxtab%?\\t%0, %2, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "alu_shift")]
+)
+
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
(zero_extend:SI (subreg:QI (match_operand:SI 1 "" "") 0)))
@@ -3173,15 +3448,23 @@
"TARGET_EITHER"
"
{
- if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM)
+ if (GET_CODE (operands[1]) == MEM)
{
- /* Note: We do not have to worry about TARGET_MMU_TRAPS
- here because the insn below will generate an LDRH instruction
- rather than an LDR instruction, so we cannot get an unaligned
- word access. */
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SIGN_EXTEND (SImode, operands[1])));
- DONE;
+ if (TARGET_THUMB)
+ {
+ emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1]));
+ DONE;
+ }
+ else if (arm_arch4)
+ {
+ /* Note: We do not have to worry about TARGET_MMU_TRAPS
+ here because the insn below will generate an LDRH instruction
+ rather than an LDR instruction, so we cannot get an unaligned
+ word access. */
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (SImode, operands[1])));
+ DONE;
+ }
}
if (TARGET_ARM && TARGET_MMU_TRAPS && GET_CODE (operands[1]) == MEM)
@@ -3189,39 +3472,31 @@
emit_insn (gen_extendhisi2_mem (operands[0], operands[1]));
DONE;
}
+
if (!s_register_operand (operands[1], HImode))
operands[1] = copy_to_mode_reg (HImode, operands[1]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
- if (TARGET_THUMB)
+ if (arm_arch6)
{
- rtx ops[3];
-
- ops[0] = operands[2];
- ops[1] = operands[1];
- ops[2] = GEN_INT (16);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFT (SImode, ops[1], ops[2])));
-
- ops[0] = operands[0];
- ops[1] = operands[2];
- ops[2] = GEN_INT (16);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFTRT (SImode, ops[1], ops[2])));
-
+ if (TARGET_THUMB)
+ emit_insn (gen_thumb_extendhisi2 (operands[0], operands[1]));
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (SImode, operands[1])));
+
DONE;
}
+
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_reg_rtx (SImode);
}"
)
-(define_insn "*thumb_extendhisi2_insn"
- [(set (match_operand:SI 0 "register_operand" "=l")
- (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))
- (clobber (match_scratch:SI 2 "=&l"))]
- "TARGET_THUMB"
+(define_insn "thumb_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "=l")
+ (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))
+ (clobber (match_scratch:SI 2 "=&l"))]
+ "TARGET_THUMB && !arm_arch6"
"*
{
rtx ops[4];
@@ -3271,10 +3546,83 @@
return \"\";
}"
[(set_attr "length" "4")
- (set_attr "type" "load")
+ (set_attr "type" "load_byte")
(set_attr "pool_range" "1020")]
)
+;; We used to have an early-clobber on the scratch register here.
+;; However, there's a bug somewhere in reload which means that this
+;; can be partially ignored during spill allocation if the memory
+;; address also needs reloading; this causes an abort later on when
+;; we try to verify the operands. Fortunately, we don't really need
+;; the early-clobber: we can always use operand 0 if operand 2
+;; overlaps the address.
+(define_insn "*thumb_extendhisi2_insn_v6"
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "l,m")))
+ (clobber (match_scratch:SI 2 "=X,l"))]
+ "TARGET_THUMB && arm_arch6"
+ "*
+ {
+ rtx ops[4];
+ rtx mem;
+
+ if (which_alternative == 0)
+ return \"sxth\\t%0, %1\";
+
+ mem = XEXP (operands[1], 0);
+
+ /* This code used to try to use 'V', and fix the address only if it was
+ offsettable, but this fails for e.g. REG+48 because 48 is outside the
+ range of QImode offsets, and offsettable_address_p does a QImode
+ address check. */
+
+ if (GET_CODE (mem) == CONST)
+ mem = XEXP (mem, 0);
+
+ if (GET_CODE (mem) == LABEL_REF)
+ return \"ldr\\t%0, %1\";
+
+ if (GET_CODE (mem) == PLUS)
+ {
+ rtx a = XEXP (mem, 0);
+ rtx b = XEXP (mem, 1);
+
+ if (GET_CODE (a) == LABEL_REF
+ && GET_CODE (b) == CONST_INT)
+ return \"ldr\\t%0, %1\";
+
+ if (GET_CODE (b) == REG)
+ return \"ldrsh\\t%0, %1\";
+
+ ops[1] = a;
+ ops[2] = b;
+ }
+ else
+ {
+ ops[1] = mem;
+ ops[2] = const0_rtx;
+ }
+
+ if (GET_CODE (ops[1]) != REG)
+ {
+ debug_rtx (ops[1]);
+ abort ();
+ }
+
+ ops[0] = operands[0];
+ if (reg_mentioned_p (operands[2], ops[1]))
+ ops[3] = ops[0];
+ else
+ ops[3] = operands[2];
+ output_asm_insn (\"mov\\t%3, %2\;ldrsh\\t%0, [%1, %3]\", ops);
+ return \"\";
+ }"
+ [(set_attr "length" "2,4")
+ (set_attr "type" "alu_shift,load_byte")
+ (set_attr "pool_range" "*,1020")]
+)
+
(define_expand "extendhisi2_mem"
[(set (match_dup 2) (zero_extend:SI (match_operand:HI 1 "" "")))
(set (match_dup 3)
@@ -3312,17 +3660,38 @@
}"
)
-(define_insn "*arm_extendhisi_insn"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
- "TARGET_ARM && arm_arch4"
+(define_insn "*arm_extendhisi2"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (sign_extend:SI (match_operand:HI 1 "memory_operand" "m")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
"ldr%?sh\\t%0, %1"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")
(set_attr "pool_range" "256")
(set_attr "neg_pool_range" "244")]
)
+(define_insn "*arm_extendhisi2_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (sign_extend:SI (match_operand:HI 1 "nonimmediate_operand" "r,m")))]
+ "TARGET_ARM && arm_arch6"
+ "@
+ sxth%?\\t%0, %1
+ ldr%?sh\\t%0, %1"
+ [(set_attr "type" "alu_shift,load_byte")
+ (set_attr "predicable" "yes")
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
+)
+
+(define_insn "*arm_extendhisi2addsi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (plus:SI (sign_extend:SI (match_operand:HI 1 "s_register_operand" "r"))
+ (match_operand:SI 2 "s_register_operand" "r")))]
+ "TARGET_ARM && arm_arch6"
+ "sxtah%?\\t%0, %2, %1"
+)
+
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
(sign_extend:SI (match_operand:HI 1 "alignable_memory_operand" "")))
@@ -3384,12 +3753,12 @@
(sign_extend:HI (match_operand:QI 1 "memory_operand" "m")))]
"TARGET_ARM && arm_arch4"
"*
- /* If the address is invalid, this will split the instruction into two. */
+ /* If the address is invalid, this will split the instruction into two. */
if (bad_signed_byte_operand (operands[1], VOIDmode))
return \"#\";
return \"ldr%?sb\\t%0, %1\";
"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")
(set_attr "length" "8")
(set_attr "pool_range" "256")
@@ -3420,7 +3789,7 @@
XEXP (operands[2], 0) = plus_constant (operands[3], low);
operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
}
- /* Ensure the sum is in correct canonical form */
+ /* Ensure the sum is in correct canonical form. */
else if (GET_CODE (operands[1]) == PLUS
&& GET_CODE (XEXP (operands[1], 1)) != CONST_INT
&& !s_register_operand (XEXP (operands[1], 1), VOIDmode))
@@ -3440,60 +3809,78 @@
"TARGET_EITHER"
"
{
- if (TARGET_ARM && arm_arch4 && GET_CODE (operands[1]) == MEM)
+ if ((TARGET_THUMB || arm_arch4) && GET_CODE (operands[1]) == MEM)
{
- emit_insn (gen_rtx_SET (VOIDmode,
- operands[0],
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
gen_rtx_SIGN_EXTEND (SImode, operands[1])));
DONE;
}
+
if (!s_register_operand (operands[1], QImode))
operands[1] = copy_to_mode_reg (QImode, operands[1]);
- operands[1] = gen_lowpart (SImode, operands[1]);
- operands[2] = gen_reg_rtx (SImode);
-
- if (TARGET_THUMB)
- {
- rtx ops[3];
-
- ops[0] = operands[2];
- ops[1] = operands[1];
- ops[2] = GEN_INT (24);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFT (SImode, ops[1], ops[2])));
- ops[0] = operands[0];
- ops[1] = operands[2];
- ops[2] = GEN_INT (24);
-
- emit_insn (gen_rtx_SET (VOIDmode, ops[0],
- gen_rtx_ASHIFTRT (SImode, ops[1], ops[2])));
-
- DONE;
+ if (arm_arch6)
+ {
+ emit_insn (gen_rtx_SET (VOIDmode, operands[0],
+ gen_rtx_SIGN_EXTEND (SImode, operands[1])));
+ DONE;
}
+
+ operands[1] = gen_lowpart (SImode, operands[1]);
+ operands[2] = gen_reg_rtx (SImode);
}"
)
; Rather than restricting all byte accesses to memory addresses that ldrsb
; can handle, we fix up the ones that ldrsb can't grok with a split.
-(define_insn "*arm_extendqisi_insn"
- [(set (match_operand:SI 0 "s_register_operand" "=r")
- (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
- "TARGET_ARM && arm_arch4"
+(define_insn "*arm_extendqisi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (sign_extend:SI (match_operand:QI 1 "memory_operand" "m")))]
+ "TARGET_ARM && arm_arch4 && !arm_arch6"
"*
- /* If the address is invalid, this will split the instruction into two. */
+ /* If the address is invalid, this will split the instruction into two. */
if (bad_signed_byte_operand (operands[1], VOIDmode))
return \"#\";
return \"ldr%?sb\\t%0, %1\";
"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")
(set_attr "length" "8")
(set_attr "pool_range" "256")
(set_attr "neg_pool_range" "244")]
)
+(define_insn "*arm_extendqisi_v6"
+ [(set (match_operand:SI 0 "s_register_operand" "=r,r")
+ (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "r,m")))]
+ "TARGET_ARM && arm_arch6"
+ "*
+ if (which_alternative == 0)
+ return \"sxtb%?\\t%0, %1\";
+
+ /* If the address is invalid, this will split the instruction into two. */
+ if (bad_signed_byte_operand (operands[1], VOIDmode))
+ return \"#\";
+
+ return \"ldr%?sb\\t%0, %1\";
+ "
+ [(set_attr "type" "alu_shift,load_byte")
+ (set_attr "predicable" "yes")
+ (set_attr "length" "4,8")
+ (set_attr "pool_range" "*,256")
+ (set_attr "neg_pool_range" "*,244")]
+)
+
+(define_insn "*arm_extendqisi2addsi"
+ [(set (match_operand:SI 0 "s_register_operand" "=r")
+ (plus:SI (sign_extend:SI (match_operand:QI 1 "s_register_operand" "r"))
+ (match_operand:SI 2 "s_register_operand" "r")))]
+ "TARGET_ARM && arm_arch6"
+ "sxtab%?\\t%0, %2, %1"
+ [(set_attr "type" "alu_shift")
+ (set_attr "predicable" "yes")]
+)
+
(define_split
[(set (match_operand:SI 0 "s_register_operand" "")
(sign_extend:SI (match_operand:QI 1 "bad_signed_byte_operand" "")))]
@@ -3517,7 +3904,7 @@
XEXP (operands[2], 0) = plus_constant (operands[0], low);
operands[1] = plus_constant (XEXP (operands[1], 0), offset - low);
}
- /* Ensure the sum is in correct canonical form */
+ /* Ensure the sum is in correct canonical form. */
else if (GET_CODE (operands[1]) == PLUS
&& GET_CODE (XEXP (operands[1], 1)) != CONST_INT
&& !s_register_operand (XEXP (operands[1], 1), VOIDmode))
@@ -3527,10 +3914,10 @@
}"
)
-(define_insn "*thumb_extendqisi2_insn"
- [(set (match_operand:SI 0 "register_operand" "=l,l")
- (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))]
- "TARGET_THUMB"
+(define_insn "*thumb_extendqisi2"
+ [(set (match_operand:SI 0 "register_operand" "=l,l")
+ (sign_extend:SI (match_operand:QI 1 "memory_operand" "V,m")))]
+ "TARGET_THUMB && !arm_arch6"
"*
{
rtx ops[3];
@@ -3602,14 +3989,95 @@
return \"\";
}"
[(set_attr "length" "2,6")
- (set_attr "type" "load,load")
+ (set_attr "type" "load_byte,load_byte")
(set_attr "pool_range" "32,32")]
)
+(define_insn "*thumb_extendqisi2_v6"
+ [(set (match_operand:SI 0 "register_operand" "=l,l,l")
+ (sign_extend:SI (match_operand:QI 1 "nonimmediate_operand" "l,V,m")))]
+ "TARGET_THUMB && arm_arch6"
+ "*
+ {
+ rtx ops[3];
+ rtx mem;
+
+ if (which_alternative == 0)
+ return \"sxtb\\t%0, %1\";
+
+ mem = XEXP (operands[1], 0);
+
+ if (GET_CODE (mem) == CONST)
+ mem = XEXP (mem, 0);
+
+ if (GET_CODE (mem) == LABEL_REF)
+ return \"ldr\\t%0, %1\";
+
+ if (GET_CODE (mem) == PLUS
+ && GET_CODE (XEXP (mem, 0)) == LABEL_REF)
+ return \"ldr\\t%0, %1\";
+
+ if (which_alternative == 0)
+ return \"ldrsb\\t%0, %1\";
+
+ ops[0] = operands[0];
+
+ if (GET_CODE (mem) == PLUS)
+ {
+ rtx a = XEXP (mem, 0);
+ rtx b = XEXP (mem, 1);
+
+ ops[1] = a;
+ ops[2] = b;
+
+ if (GET_CODE (a) == REG)
+ {
+ if (GET_CODE (b) == REG)
+ output_asm_insn (\"ldrsb\\t%0, [%1, %2]\", ops);
+ else if (REGNO (a) == REGNO (ops[0]))
+ {
+ output_asm_insn (\"ldrb\\t%0, [%1, %2]\", ops);
+ output_asm_insn (\"sxtb\\t%0, %0\", ops);
+ }
+ else
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+ }
+ else if (GET_CODE (b) != REG)
+ abort ();
+ else
+ {
+ if (REGNO (b) == REGNO (ops[0]))
+ {
+ output_asm_insn (\"ldrb\\t%0, [%2, %1]\", ops);
+ output_asm_insn (\"sxtb\\t%0, %0\", ops);
+ }
+ else
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+ }
+ }
+ else if (GET_CODE (mem) == REG && REGNO (ops[0]) == REGNO (mem))
+ {
+ output_asm_insn (\"ldrb\\t%0, [%0, #0]\", ops);
+ output_asm_insn (\"sxtb\\t%0, %0\", ops);
+ }
+ else
+ {
+ ops[1] = mem;
+ ops[2] = const0_rtx;
+
+ output_asm_insn (\"mov\\t%0, %2\;ldrsb\\t%0, [%1, %0]\", ops);
+ }
+ return \"\";
+ }"
+ [(set_attr "length" "2,2,4")
+ (set_attr "type" "alu_shift,load_byte,load_byte")
+ (set_attr "pool_range" "*,32,32")]
+)
+
(define_expand "extendsfdf2"
[(set (match_operand:DF 0 "s_register_operand" "")
(float_extend:DF (match_operand:SF 1 "s_register_operand" "")))]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT"
""
)
@@ -3693,12 +4161,14 @@
(define_insn "*arm_movdi"
[(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r, o<>")
(match_operand:DI 1 "di_operand" "rIK,mi,r"))]
- "TARGET_ARM && !TARGET_CIRRUS && ! TARGET_IWMMXT"
+ "TARGET_ARM
+ && !(TARGET_HARD_FLOAT && (TARGET_MAVERICK || TARGET_VFP))
+ && !TARGET_IWMMXT"
"*
return (output_move_double (operands));
"
[(set_attr "length" "8")
- (set_attr "type" "*,load,store2")
+ (set_attr "type" "*,load2,store2")
(set_attr "pool_range" "*,1020,*")
(set_attr "neg_pool_range" "*,1008,*")]
)
@@ -3711,7 +4181,7 @@
[(set (match_operand:DI 0 "nonimmediate_operand" "=l,l,l,l,>,l, m,*r")
(match_operand:DI 1 "general_operand" "l, I,J,>,l,mi,l,*r"))]
"TARGET_THUMB
- && !TARGET_CIRRUS
+ && !(TARGET_HARD_FLOAT && TARGET_MAVERICK)
&& ( register_operand (operands[0], DImode)
|| register_operand (operands[1], DImode))"
"*
@@ -3746,7 +4216,7 @@
}
}"
[(set_attr "length" "4,4,6,2,2,6,4,4")
- (set_attr "type" "*,*,*,load,store2,load,store2,*")
+ (set_attr "type" "*,*,*,load2,store2,load2,store2,*")
(set_attr "pool_range" "*,*,*,*,*,1020,*,*")]
)
@@ -3757,10 +4227,11 @@
"
if (TARGET_ARM)
{
- /* Everything except mem = const or mem = mem can be done easily */
+ /* Everything except mem = const or mem = mem can be done easily. */
if (GET_CODE (operands[0]) == MEM)
operands[1] = force_reg (SImode, operands[1]);
- if (GET_CODE (operands[1]) == CONST_INT
+ if (arm_general_register_operand (operands[0], SImode)
+ && GET_CODE (operands[1]) == CONST_INT
&& !(const_ok_for_arm (INTVAL (operands[1]))
|| const_ok_for_arm (~INTVAL (operands[1]))))
{
@@ -3771,7 +4242,7 @@
DONE;
}
}
- else /* TARGET_THUMB.... */
+ else /* TARGET_THUMB.... */
{
if (!no_new_pseudos)
{
@@ -3793,6 +4264,7 @@
[(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r, m")
(match_operand:SI 1 "general_operand" "rI,K,mi,r"))]
"TARGET_ARM && ! TARGET_IWMMXT
+ && !(TARGET_HARD_FLOAT && TARGET_VFP)
&& ( register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
"@
@@ -3800,14 +4272,14 @@
mvn%?\\t%0, #%B1
ldr%?\\t%0, %1
str%?\\t%1, %0"
- [(set_attr "type" "*,*,load,store1")
+ [(set_attr "type" "*,*,load1,store1")
(set_attr "predicable" "yes")
(set_attr "pool_range" "*,*,4096,*")
(set_attr "neg_pool_range" "*,*,4084,*")]
)
(define_split
- [(set (match_operand:SI 0 "s_register_operand" "")
+ [(set (match_operand:SI 0 "arm_general_register_operand" "")
(match_operand:SI 1 "const_int_operand" ""))]
"TARGET_ARM
&& (!(const_ok_for_arm (INTVAL (operands[1]))
@@ -3837,7 +4309,7 @@
str\\t%1, %0
mov\\t%0, %1"
[(set_attr "length" "2,2,4,4,2,2,2,2,2")
- (set_attr "type" "*,*,*,*,load,store1,load,store1,*")
+ (set_attr "type" "*,*,*,*,load1,store1,load1,store1,*")
(set_attr "pool_range" "*,*,*,*,*,*,1020,*,*")]
)
@@ -3889,7 +4361,7 @@
(unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))]
"TARGET_ARM && flag_pic"
"ldr%?\\t%0, %1"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set (attr "pool_range") (const_int 4096))
(set (attr "neg_pool_range") (const_int 4084))]
)
@@ -3899,7 +4371,7 @@
(unspec:SI [(match_operand:SI 1 "" "mX")] UNSPEC_PIC_SYM))]
"TARGET_THUMB && flag_pic"
"ldr\\t%0, %1"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set (attr "pool_range") (const_int 1024))]
)
@@ -3925,7 +4397,7 @@
output_asm_insn (\"ldr%?\\t%0, %a1\", operands);
return \"\";
"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set (attr "pool_range")
(if_then_else (eq_attr "is_thumb" "yes")
(const_int 1024)
@@ -4007,7 +4479,7 @@
(set (match_dup 2)
(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
;; store the high byte
- (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe
+ (set (match_dup 4) (match_dup 5))]
"TARGET_ARM"
"
{
@@ -4023,7 +4495,8 @@
operands[1] = adjust_address (operands[1], QImode, 0);
operands[3] = gen_lowpart (QImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
- operands[2] = gen_reg_rtx (SImode);
+ operands[2] = gen_reg_rtx (SImode);
+ operands[5] = gen_lowpart (QImode, operands[2]);
}"
)
@@ -4031,7 +4504,7 @@
[(set (match_dup 4) (match_dup 3))
(set (match_dup 2)
(ashiftrt:SI (match_operand 0 "" "") (const_int 8)))
- (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))]
+ (set (match_operand 1 "" "") (match_dup 5))]
"TARGET_ARM"
"
{
@@ -4048,13 +4521,14 @@
operands[3] = gen_lowpart (QImode, operands[0]);
operands[0] = gen_lowpart (SImode, operands[0]);
operands[2] = gen_reg_rtx (SImode);
+ operands[5] = gen_lowpart (QImode, operands[2]);
}"
)
;; Subroutine to store a half word integer constant into memory.
(define_expand "storeinthi"
[(set (match_operand 0 "" "")
- (subreg:QI (match_operand 1 "" "") 0))
+ (match_operand 1 "" ""))
(set (match_dup 3) (match_dup 2))]
"TARGET_ARM"
"
@@ -4095,6 +4569,7 @@
operands[3] = adjust_address (op0, QImode, 1);
operands[0] = adjust_address (operands[0], QImode, 0);
operands[2] = gen_lowpart (QImode, operands[2]);
+ operands[1] = gen_lowpart (QImode, operands[1]);
}"
)
@@ -4255,7 +4730,7 @@
}
}
}
- /* Handle loading a large integer during reload */
+ /* Handle loading a large integer during reload. */
else if (GET_CODE (operands[1]) == CONST_INT
&& !const_ok_for_arm (INTVAL (operands[1]))
&& !const_ok_for_arm (~INTVAL (operands[1])))
@@ -4299,7 +4774,7 @@
= replace_equiv_address (operands[1],
copy_to_reg (XEXP (operands[1], 0)));
}
- /* Handle loading a large integer during reload */
+ /* Handle loading a large integer during reload. */
else if (GET_CODE (operands[1]) == CONST_INT
&& !CONST_OK_FOR_THUMB_LETTER (INTVAL (operands[1]), 'I'))
{
@@ -4350,7 +4825,7 @@
return \"ldrh %0, %1\";
}"
[(set_attr "length" "2,4,2,2,2,2")
- (set_attr "type" "*,load,store1,*,*,*")
+ (set_attr "type" "*,load1,store1,*,*,*")
(set_attr "pool_range" "*,64,*,*,*,*")]
)
@@ -4369,7 +4844,7 @@
output_asm_insn (\"ldr%?\\t%0, %1\\t%@ load-rotate\", ops);
return \"\";
}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")]
)
@@ -4415,11 +4890,12 @@
(set (match_dup 3)
(ashiftrt:SI (match_dup 2) (const_int 16)))
(set (match_operand:HI 0 "s_register_operand" "")
- (subreg:HI (match_dup 3) 0))]
+ (match_dup 4))]
"TARGET_ARM"
"
operands[2] = gen_reg_rtx (SImode);
operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_lowpart (HImode, operands[3]);
"
)
@@ -4437,7 +4913,7 @@
mvn%?\\t%0, #%B1\\t%@ movhi
str%?h\\t%1, %0\\t%@ movhi
ldr%?h\\t%0, %1\\t%@ movhi"
- [(set_attr "type" "*,*,store1,load")
+ [(set_attr "type" "*,*,store1,load1")
(set_attr "predicable" "yes")
(set_attr "pool_range" "*,*,*,256")
(set_attr "neg_pool_range" "*,*,*,244")]
@@ -4457,7 +4933,7 @@
mov%?\\t%0, %1\\t%@ movhi
mvn%?\\t%0, #%B1\\t%@ movhi
ldr%?\\t%0, %1\\t%@ movhi"
- [(set_attr "type" "*,*,load")
+ [(set_attr "type" "*,*,load1")
(set_attr "predicable" "yes")
(set_attr "pool_range" "4096")
(set_attr "neg_pool_range" "4084")]
@@ -4477,7 +4953,7 @@
mov%?\\t%0, %1\\t%@ movhi
mvn%?\\t%0, #%B1\\t%@ movhi
ldr%?\\t%0, %1\\t%@ movhi_bigend\;mov%?\\t%0, %0, asr #16"
- [(set_attr "type" "*,*,load")
+ [(set_attr "type" "*,*,load1")
(set_attr "predicable" "yes")
(set_attr "length" "4,4,8")
(set_attr "pool_range" "*,*,4092")
@@ -4492,7 +4968,7 @@
&& BYTES_BIG_ENDIAN
&& !TARGET_MMU_TRAPS"
"ldr%?\\t%0, %1\\t%@ movhi_bigend"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")
(set_attr "pool_range" "4096")
(set_attr "neg_pool_range" "4084")]
@@ -4603,7 +5079,7 @@
= replace_equiv_address (operands[1],
copy_to_reg (XEXP (operands[1], 0)));
}
- /* Handle loading a large integer during reload */
+ /* Handle loading a large integer during reload. */
else if (GET_CODE (operands[1]) == CONST_INT
&& !CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'I'))
{
@@ -4632,7 +5108,7 @@
mvn%?\\t%0, #%B1
ldr%?b\\t%0, %1
str%?b\\t%1, %0"
- [(set_attr "type" "*,*,load,store1")
+ [(set_attr "type" "*,*,load1,store1")
(set_attr "predicable" "yes")]
)
@@ -4650,7 +5126,7 @@
mov\\t%0, %1
mov\\t%0, %1"
[(set_attr "length" "2")
- (set_attr "type" "*,load,store1,*,*,*")
+ (set_attr "type" "*,load1,store1,*,*,*")
(set_attr "pool_range" "*,32,*,*,*,*")]
)
@@ -4679,7 +5155,7 @@
[(set (match_operand:SF 0 "nonimmediate_operand" "")
(match_operand:SF 1 "immediate_operand" ""))]
"TARGET_ARM
- && !TARGET_HARD_FLOAT
+ && !(TARGET_HARD_FLOAT && TARGET_FPA)
&& reload_completed
&& GET_CODE (operands[1]) == CONST_DOUBLE"
[(set (match_dup 2) (match_dup 3))]
@@ -4695,7 +5171,6 @@
[(set (match_operand:SF 0 "nonimmediate_operand" "=r,r,m")
(match_operand:SF 1 "general_operand" "r,mE,r"))]
"TARGET_ARM
- && !TARGET_CIRRUS
&& TARGET_SOFT_FLOAT
&& (GET_CODE (operands[0]) != MEM
|| register_operand (operands[1], SFmode))"
@@ -4705,7 +5180,7 @@
str%?\\t%1, %0\\t%@ float"
[(set_attr "length" "4,4,4")
(set_attr "predicable" "yes")
- (set_attr "type" "*,load,store1")
+ (set_attr "type" "*,load1,store1")
(set_attr "pool_range" "*,4096,*")
(set_attr "neg_pool_range" "*,4084,*")]
)
@@ -4726,7 +5201,7 @@
mov\\t%0, %1
mov\\t%0, %1"
[(set_attr "length" "2")
- (set_attr "type" "*,load,store1,load,store1,*,*")
+ (set_attr "type" "*,load1,store1,load1,store1,*,*")
(set_attr "pool_range" "*,*,*,1020,*,*,*")]
)
@@ -4798,11 +5273,10 @@
[(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=r,r,m")
(match_operand:DF 1 "soft_df_operand" "r,mF,r"))]
"TARGET_ARM && TARGET_SOFT_FLOAT
- && !TARGET_CIRRUS
"
"* return output_move_double (operands);"
[(set_attr "length" "8,8,8")
- (set_attr "type" "*,load,store2")
+ (set_attr "type" "*,load2,store2")
(set_attr "pool_range" "1020")
(set_attr "neg_pool_range" "1008")]
)
@@ -4843,7 +5317,7 @@
}
"
[(set_attr "length" "4,2,2,6,4,4")
- (set_attr "type" "*,load,store2,load,store2,*")
+ (set_attr "type" "*,load2,store2,load2,store2,*")
(set_attr "pool_range" "*,*,*,1020,*,*")]
)
@@ -4916,7 +5390,7 @@
(mem:SI (plus:SI (match_dup 2) (const_int 12))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 5"
"ldm%?ia\\t%1!, {%3, %4, %5, %6}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load4")
(set_attr "predicable" "yes")]
)
@@ -4933,7 +5407,7 @@
(mem:SI (plus:SI (match_dup 2) (const_int 8))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 4"
"ldm%?ia\\t%1!, {%3, %4, %5}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load3")
(set_attr "predicable" "yes")]
)
@@ -4948,7 +5422,7 @@
(mem:SI (plus:SI (match_dup 2) (const_int 4))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 3"
"ldm%?ia\\t%1!, {%3, %4}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load2")
(set_attr "predicable" "yes")]
)
@@ -4966,7 +5440,7 @@
(mem:SI (plus:SI (match_dup 1) (const_int 12))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 4"
"ldm%?ia\\t%1, {%2, %3, %4, %5}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load4")
(set_attr "predicable" "yes")]
)
@@ -4980,7 +5454,7 @@
(mem:SI (plus:SI (match_dup 1) (const_int 8))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 3"
"ldm%?ia\\t%1, {%2, %3, %4}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load3")
(set_attr "predicable" "yes")]
)
@@ -4992,7 +5466,7 @@
(mem:SI (plus:SI (match_dup 1) (const_int 4))))])]
"TARGET_ARM && XVECLEN (operands[0], 0) == 2"
"ldm%?ia\\t%1, {%2, %3}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load2")
(set_attr "predicable" "yes")]
)
@@ -5002,7 +5476,7 @@
(use (match_operand:SI 2 "" ""))])]
"TARGET_ARM"
"
- /* Support only fixed point registers */
+ /* Support only fixed point registers. */
if (GET_CODE (operands[2]) != CONST_INT
|| INTVAL (operands[2]) > 14
|| INTVAL (operands[2]) < 2
@@ -6242,12 +6716,9 @@
(define_expand "cmpsf"
[(match_operand:SF 0 "s_register_operand" "")
- (match_operand:SF 1 "fpa_rhs_operand" "")]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:SF 1 "arm_float_compare_operand" "")]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], SFmode))
- operands[1] = force_reg (SFmode, operands[1]);
-
arm_compare_op0 = operands[0];
arm_compare_op1 = operands[1];
DONE;
@@ -6256,12 +6727,9 @@
(define_expand "cmpdf"
[(match_operand:DF 0 "s_register_operand" "")
- (match_operand:DF 1 "fpa_rhs_operand" "")]
- "TARGET_ARM && TARGET_ANY_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_compare_operand" "")]
+ "TARGET_ARM && TARGET_HARD_FLOAT"
"
- if (TARGET_CIRRUS && !cirrus_fp_register (operands[1], DFmode))
- operands[1] = force_reg (DFmode, operands[1]);
-
arm_compare_op0 = operands[0];
arm_compare_op1 = operands[1];
DONE;
@@ -6289,7 +6757,9 @@
"cmp%?\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*cmpsi_shiftsi_swp"
@@ -6302,7 +6772,9 @@
"cmp%?\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*cmpsi_neg_shiftsi"
@@ -6315,7 +6787,9 @@
"cmn%?\\t%0, %1%S3"
[(set_attr "conds" "set")
(set_attr "shift" "1")
- ]
+ (set (attr "type") (if_then_else (match_operand 2 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
;; Cirrus SF compare instruction
@@ -6323,7 +6797,7 @@
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (match_operand:SF 0 "cirrus_fp_register" "v")
(match_operand:SF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcmps%?\\tr15, %V0, %V1"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "compare")]
@@ -6334,7 +6808,7 @@
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (match_operand:DF 0 "cirrus_fp_register" "v")
(match_operand:DF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcmpd%?\\tr15, %V0, %V1"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "compare")]
@@ -6344,7 +6818,7 @@
(define_expand "cmpdi"
[(match_operand:DI 0 "cirrus_fp_register" "")
(match_operand:DI 1 "cirrus_fp_register" "")]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"{
arm_compare_op0 = operands[0];
arm_compare_op1 = operands[1];
@@ -6355,7 +6829,7 @@
[(set (reg:CC CC_REGNUM)
(compare:CC (match_operand:DI 0 "cirrus_fp_register" "v")
(match_operand:DI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcmp64%?\\tr15, %V0, %V1"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "compare")]
@@ -6473,7 +6947,7 @@
(if_then_else (unordered (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
arm_compare_op1);"
)
@@ -6483,7 +6957,7 @@
(if_then_else (ordered (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
arm_compare_op1);"
)
@@ -6493,7 +6967,7 @@
(if_then_else (ungt (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0, arm_compare_op1);"
)
@@ -6502,7 +6976,7 @@
(if_then_else (unlt (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0, arm_compare_op1);"
)
@@ -6511,7 +6985,7 @@
(if_then_else (unge (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0, arm_compare_op1);"
)
@@ -6520,7 +6994,7 @@
(if_then_else (unle (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0, arm_compare_op1);"
)
@@ -6531,7 +7005,7 @@
(if_then_else (uneq (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNEQ, arm_compare_op0, arm_compare_op1);"
)
@@ -6540,7 +7014,7 @@
(if_then_else (ltgt (match_dup 1) (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (LTGT, arm_compare_op0, arm_compare_op1);"
)
@@ -6554,7 +7028,7 @@
(if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"*
if (arm_ccfsm_state != 0)
abort ();
@@ -6571,7 +7045,7 @@
(if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
(label_ref (match_operand 0 "" ""))
(pc)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"*
if (arm_ccfsm_state != 0)
abort ();
@@ -6597,7 +7071,8 @@
}
return \"b%d1\\t%l0\";
"
- [(set_attr "conds" "use")]
+ [(set_attr "conds" "use")
+ (set_attr "type" "branch")]
)
; Special pattern to match reversed UNEQ.
@@ -6606,7 +7081,7 @@
(if_then_else (uneq (match_operand 1 "cc_register" "") (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"*
if (arm_ccfsm_state != 0)
abort ();
@@ -6623,7 +7098,7 @@
(if_then_else (ltgt (match_operand 1 "cc_register" "") (const_int 0))
(pc)
(label_ref (match_operand 0 "" ""))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"*
if (arm_ccfsm_state != 0)
abort ();
@@ -6649,7 +7124,8 @@
}
return \"b%D1\\t%l0\";
"
- [(set_attr "conds" "use")]
+ [(set_attr "conds" "use")
+ (set_attr "type" "branch")]
)
@@ -6729,7 +7205,7 @@
(define_expand "sunordered"
[(set (match_operand:SI 0 "s_register_operand" "")
(unordered:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNORDERED, arm_compare_op0,
arm_compare_op1);"
)
@@ -6737,7 +7213,7 @@
(define_expand "sordered"
[(set (match_operand:SI 0 "s_register_operand" "")
(ordered:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (ORDERED, arm_compare_op0,
arm_compare_op1);"
)
@@ -6745,7 +7221,7 @@
(define_expand "sungt"
[(set (match_operand:SI 0 "s_register_operand" "")
(ungt:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNGT, arm_compare_op0,
arm_compare_op1);"
)
@@ -6753,7 +7229,7 @@
(define_expand "sunge"
[(set (match_operand:SI 0 "s_register_operand" "")
(unge:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNGE, arm_compare_op0,
arm_compare_op1);"
)
@@ -6761,7 +7237,7 @@
(define_expand "sunlt"
[(set (match_operand:SI 0 "s_register_operand" "")
(unlt:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNLT, arm_compare_op0,
arm_compare_op1);"
)
@@ -6769,7 +7245,7 @@
(define_expand "sunle"
[(set (match_operand:SI 0 "s_register_operand" "")
(unle:SI (match_dup 1) (const_int 0)))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"operands[1] = arm_gen_compare_reg (UNLE, arm_compare_op0,
arm_compare_op1);"
)
@@ -6780,14 +7256,14 @@
; (define_expand "suneq"
; [(set (match_operand:SI 0 "s_register_operand" "")
; (uneq:SI (match_dup 1) (const_int 0)))]
-; "TARGET_ARM && TARGET_HARD_FLOAT"
+; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
; "abort ();"
; )
;
; (define_expand "sltgt"
; [(set (match_operand:SI 0 "s_register_operand" "")
; (ltgt:SI (match_dup 1) (const_int 0)))]
-; "TARGET_ARM && TARGET_HARD_FLOAT"
+; "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
; "abort ();"
; )
@@ -6859,8 +7335,8 @@
/* When compiling for SOFT_FLOAT, ensure both arms are in registers.
Otherwise, ensure it is a valid FP add operand */
- if ((!TARGET_HARD_FLOAT)
- || (!fpa_add_operand (operands[3], SFmode)))
+ if ((!(TARGET_HARD_FLOAT && TARGET_FPA))
+ || (!arm_float_add_operand (operands[3], SFmode)))
operands[3] = force_reg (SFmode, operands[3]);
ccreg = arm_gen_compare_reg (code, arm_compare_op0, arm_compare_op1);
@@ -6872,8 +7348,8 @@
[(set (match_operand:DF 0 "s_register_operand" "")
(if_then_else:DF (match_operand 1 "arm_comparison_operator" "")
(match_operand:DF 2 "s_register_operand" "")
- (match_operand:DF 3 "fpa_add_operand" "")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 3 "arm_float_add_operand" "")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && (TARGET_FPA || TARGET_VFP)"
"
{
enum rtx_code code = GET_CODE (operands[1]);
@@ -7239,7 +7715,7 @@
}
return output_return_instruction (const_true_rtx, TRUE, FALSE);
}"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "length" "12")
(set_attr "predicable" "yes")]
)
@@ -7262,7 +7738,7 @@
}"
[(set_attr "conds" "use")
(set_attr "length" "12")
- (set_attr "type" "load")]
+ (set_attr "type" "load1")]
)
(define_insn "*cond_return_inverted"
@@ -7282,7 +7758,7 @@
return output_return_instruction (operands[0], TRUE, TRUE);
}"
[(set_attr "conds" "use")
- (set_attr "type" "load")]
+ (set_attr "type" "load1")]
)
;; Generate a sequence of instructions to determine if the processor is
@@ -7426,7 +7902,7 @@
(match_operand:SI 0 "memory_operand" "m"))]
"TARGET_ARM"
"ldr%?\\t%|pc, %0\\t%@ indirect memory jump"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "pool_range" "4096")
(set_attr "neg_pool_range" "4084")
(set_attr "predicable" "yes")]
@@ -7472,9 +7948,29 @@
"%i1%?\\t%0, %2, %4%S3"
[(set_attr "predicable" "yes")
(set_attr "shift" "4")
- ]
+ (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
+(define_split
+ [(set (match_operand:SI 0 "s_register_operand" "")
+ (match_operator:SI 1 "shiftable_operator"
+ [(match_operator:SI 2 "shiftable_operator"
+ [(match_operator:SI 3 "shift_operator"
+ [(match_operand:SI 4 "s_register_operand" "")
+ (match_operand:SI 5 "reg_or_int_operand" "")])
+ (match_operand:SI 6 "s_register_operand" "")])
+ (match_operand:SI 7 "arm_rhs_operand" "")]))
+ (clobber (match_operand:SI 8 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 8)
+ (match_op_dup 2 [(match_op_dup 3 [(match_dup 4) (match_dup 5)])
+ (match_dup 6)]))
+ (set (match_dup 0)
+ (match_op_dup 1 [(match_dup 8) (match_dup 7)]))]
+ "")
+
(define_insn "*arith_shiftsi_compare0"
[(set (reg:CC_NOOV CC_REGNUM)
(compare:CC_NOOV (match_operator:SI 1 "shiftable_operator"
@@ -7490,7 +7986,9 @@
"%i1%?s\\t%0, %2, %4%S3"
[(set_attr "conds" "set")
(set_attr "shift" "4")
- ]
+ (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*arith_shiftsi_compare0_scratch"
@@ -7506,7 +8004,9 @@
"%i1%?s\\t%0, %2, %4%S3"
[(set_attr "conds" "set")
(set_attr "shift" "4")
- ]
+ (set (attr "type") (if_then_else (match_operand 5 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*sub_shiftsi"
@@ -7519,7 +8019,9 @@
"sub%?\\t%0, %1, %3%S2"
[(set_attr "predicable" "yes")
(set_attr "shift" "3")
- ]
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*sub_shiftsi_compare0"
@@ -7536,8 +8038,10 @@
"TARGET_ARM"
"sub%?s\\t%0, %1, %3%S2"
[(set_attr "conds" "set")
- (set_attr "shift" "3")
- ]
+ (set_attr "shift" "3")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*sub_shiftsi_compare0_scratch"
@@ -7552,8 +8056,10 @@
"TARGET_ARM"
"sub%?s\\t%0, %1, %3%S2"
[(set_attr "conds" "set")
- (set_attr "shift" "3")
- ]
+ (set_attr "shift" "3")
+ (set (attr "type") (if_then_else (match_operand 4 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
@@ -7979,6 +8485,44 @@
[(set_attr "conds" "clob")
(set_attr "length" "20")])
+(define_split
+ [(set (reg:CC_NOOV CC_REGNUM)
+ (compare:CC_NOOV (ior:SI
+ (and:SI (match_operand:SI 0 "s_register_operand" "")
+ (const_int 1))
+ (match_operator:SI 1 "comparison_operator"
+ [(match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "arm_add_operand" "")]))
+ (const_int 0)))
+ (clobber (match_operand:SI 4 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 4)
+ (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
+ (match_dup 0)))
+ (set (reg:CC_NOOV CC_REGNUM)
+ (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1))
+ (const_int 0)))]
+ "")
+
+(define_split
+ [(set (reg:CC_NOOV CC_REGNUM)
+ (compare:CC_NOOV (ior:SI
+ (match_operator:SI 1 "comparison_operator"
+ [(match_operand:SI 2 "s_register_operand" "")
+ (match_operand:SI 3 "arm_add_operand" "")])
+ (and:SI (match_operand:SI 0 "s_register_operand" "")
+ (const_int 1)))
+ (const_int 0)))
+ (clobber (match_operand:SI 4 "s_register_operand" ""))]
+ "TARGET_ARM"
+ [(set (match_dup 4)
+ (ior:SI (match_op_dup 1 [(match_dup 2) (match_dup 3)])
+ (match_dup 0)))
+ (set (reg:CC_NOOV CC_REGNUM)
+ (compare:CC_NOOV (and:SI (match_dup 4) (const_int 1))
+ (const_int 0)))]
+ "")
+
(define_insn "*negscc"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(neg:SI (match_operator 3 "arm_comparison_operator"
@@ -8031,7 +8575,7 @@
return \"bics\\t%0, %2, %3, asr #32\;movcs\\t%0, %1\";
}
/* The only case that falls through to here is when both ops 1 & 2
- are constants */
+ are constants. */
}
if (GET_CODE (operands[5]) == GE
@@ -8050,7 +8594,7 @@
return \"ands\\t%0, %2, %3, asr #32\;movcc\\t%0, %1\";
}
/* The only case that falls through to here is when both ops 1 & 2
- are constants */
+ are constants. */
}
if (GET_CODE (operands[4]) == CONST_INT
&& !const_ok_for_arm (INTVAL (operands[4])))
@@ -8187,7 +8731,7 @@
"*
/* If we have an operation where (op x 0) is the identity operation and
the conditional operator is LT or GE and we are comparing against zero and
- everything is in registers then we can do this in two instructions */
+ everything is in registers then we can do this in two instructions. */
if (operands[3] == const0_rtx
&& GET_CODE (operands[7]) != AND
&& GET_CODE (operands[5]) == REG
@@ -8388,7 +8932,10 @@
mvn%D5\\t%0, #%B1\;mov%d5\\t%0, %2%S4"
[(set_attr "conds" "use")
(set_attr "shift" "2")
- (set_attr "length" "4,8,8")]
+ (set_attr "length" "4,8,8")
+ (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*ifcompare_move_shift"
@@ -8424,7 +8971,10 @@
mvn%d5\\t%0, #%B1\;mov%D5\\t%0, %2%S4"
[(set_attr "conds" "use")
(set_attr "shift" "2")
- (set_attr "length" "4,8,8")]
+ (set_attr "length" "4,8,8")
+ (set (attr "type") (if_then_else (match_operand 3 "const_int_operand" "")
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*ifcompare_shift_shift"
@@ -8461,7 +9011,12 @@
"mov%d5\\t%0, %1%S6\;mov%D5\\t%0, %3%S7"
[(set_attr "conds" "use")
(set_attr "shift" "1")
- (set_attr "length" "8")]
+ (set_attr "length" "8")
+ (set (attr "type") (if_then_else
+ (and (match_operand 2 "const_int_operand" "")
+ (match_operand 4 "const_int_operand" ""))
+ (const_string "alu_shift")
+ (const_string "alu_shift_reg")))]
)
(define_insn "*ifcompare_not_arith"
@@ -8662,7 +9217,7 @@
}"
[(set_attr "length" "12")
(set_attr "predicable" "yes")
- (set_attr "type" "load")]
+ (set_attr "type" "load1")]
)
;; the arm can support extended pre-inc instructions
@@ -8719,7 +9274,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?b\\t%3, [%0, %2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8735,7 +9290,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?b\\t%3, [%0, -%2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8752,7 +9307,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?b\\t%3, [%0, %2]!\\t%@ z_extendqisi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8769,7 +9324,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?b\\t%3, [%0, -%2]!\\t%@ z_extendqisi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8817,7 +9372,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?\\t%3, [%0, %2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")]
)
@@ -8833,7 +9388,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?\\t%3, [%0, -%2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")]
)
@@ -8852,7 +9407,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?\\t%3, [%0, %2]!\\t%@ loadhi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8871,7 +9426,7 @@
&& (GET_CODE (operands[2]) != REG
|| REGNO (operands[2]) != FRAME_POINTER_REGNUM)"
"ldr%?\\t%3, [%0, -%2]!\\t%@ loadhi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8925,7 +9480,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?b\\t%5, [%0, %3%S2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8943,7 +9498,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?b\\t%5, [%0, -%3%S2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -8997,7 +9552,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?\\t%5, [%0, %3%S2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")]
)
@@ -9015,7 +9570,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?\\t%5, [%0, -%3%S2]!"
- [(set_attr "type" "load")
+ [(set_attr "type" "load1")
(set_attr "predicable" "yes")])
(define_insn "*loadhi_shiftpreinc"
@@ -9035,7 +9590,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?\\t%5, [%0, %3%S2]!\\t%@ loadhi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -9056,7 +9611,7 @@
&& REGNO (operands[1]) != FRAME_POINTER_REGNUM
&& REGNO (operands[3]) != FRAME_POINTER_REGNUM"
"ldr%?\\t%5, [%0, -%3%S2]!\\t%@ loadhi"
- [(set_attr "type" "load")
+ [(set_attr "type" "load_byte")
(set_attr "predicable" "yes")]
)
@@ -9168,7 +9723,7 @@
(set (reg:CC CC_REGNUM)
(compare:CC (match_dup 1) (const_int 0)))]
"TARGET_ARM
- && (!TARGET_CIRRUS
+ && (!(TARGET_HARD_FLOAT && TARGET_MAVERICK)
|| (!cirrus_fp_register (operands[0], SImode)
&& !cirrus_fp_register (operands[1], SImode)))
"
@@ -9334,9 +9889,9 @@
(unspec_volatile [(return)] VUNSPEC_EPILOGUE)])]
"TARGET_ARM"
"*
- if (USE_RETURN_INSN (FALSE))
+ if (use_return_insn (FALSE, next_nonnote_insn (insn)))
return output_return_instruction (const_true_rtx, FALSE, FALSE);
- return arm_output_epilogue (FALSE);
+ return arm_output_epilogue (next_nonnote_insn (insn));
"
;; Length is absolute worst case
[(set_attr "length" "44")
@@ -9352,7 +9907,7 @@
"TARGET_EITHER"
"*
if (TARGET_ARM)
- return arm_output_epilogue (TRUE);
+ return arm_output_epilogue (NULL);
else /* TARGET_THUMB */
return thumb_unexpanded_epilogue ();
"
@@ -9612,7 +10167,7 @@
[(set (match_operand:BLK 0 "memory_operand" "=m")
(unspec:BLK [(match_operand:XF 1 "f_register_operand" "f")]
UNSPEC_PUSH_MULT))])]
- "TARGET_ARM"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"*
{
char pattern[100];
@@ -9832,3 +10387,6 @@
(include "cirrus.md")
;; Load the Intel Wireless Multimedia Extension patterns
(include "iwmmxt.md")
+;; Load the VFP co-processor patterns
+(include "vfp.md")
+
diff --git a/gcc/config/arm/arm1026ejs.md b/gcc/config/arm/arm1026ejs.md
new file mode 100644
index 00000000000..5dd433269ac
--- /dev/null
+++ b/gcc/config/arm/arm1026ejs.md
@@ -0,0 +1,241 @@
+;; ARM 1026EJ-S Pipeline Description
+;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Written by CodeSourcery, LLC.
+;;
+;; 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. */
+
+;; These descriptions are based on the information contained in the
+;; ARM1026EJ-S Technical Reference Manual, Copyright (c) 2003 ARM
+;; Limited.
+;;
+
+;; This automaton provides a pipeline description for the ARM
+;; 1026EJ-S core.
+;;
+;; The model given here assumes that the condition for all conditional
+;; instructions is "true", i.e., that all of the instructions are
+;; actually executed.
+
+(define_automaton "arm1026ejs")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Pipelines
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; There are two pipelines:
+;;
+;; - An Arithmetic Logic Unit (ALU) pipeline.
+;;
+;; The ALU pipeline has fetch, issue, decode, execute, memory, and
+;; write stages. We only need to model the execute, memory and write
+;; stages.
+;;
+;; - A Load-Store Unit (LSU) pipeline.
+;;
+;; The LSU pipeline has decode, execute, memory, and write stages.
+;; We only model the execute, memory and write stages.
+
+(define_cpu_unit "a_e,a_m,a_w" "arm1026ejs")
+(define_cpu_unit "l_e,l_m,l_w" "arm1026ejs")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ALU Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; ALU instructions require three cycles to execute, and use the ALU
+;; pipeline in each of the three stages. The results are available
+;; after the execute stage stage has finished.
+;;
+;; If the destination register is the PC, the pipelines are stalled
+;; for several cycles. That case is not modeled here.
+
+;; ALU operations with no shifted operand
+(define_insn_reservation "alu_op" 1
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "alu"))
+ "a_e,a_m,a_w")
+
+;; ALU operations with a shift-by-constant operand
+(define_insn_reservation "alu_shift_op" 1
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "alu_shift"))
+ "a_e,a_m,a_w")
+
+;; ALU operations with a shift-by-register operand
+;; These really stall in the decoder, in order to read
+;; the shift value in a second cycle. Pretend we take two cycles in
+;; the execute stage.
+(define_insn_reservation "alu_shift_reg_op" 2
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "alu_shift_reg"))
+ "a_e*2,a_m,a_w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Multiplication Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Multiplication instructions loop in the execute stage until the
+;; instruction has been passed through the multiplier array enough
+;; times.
+
+;; The result of the "smul" and "smulw" instructions is not available
+;; until after the memory stage.
+(define_insn_reservation "mult1" 2
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "smulxy,smulwy"))
+ "a_e,a_m,a_w")
+
+;; The "smlaxy" and "smlawx" instructions require two iterations through
+;; the execute stage; the result is available immediately following
+;; the execute stage.
+(define_insn_reservation "mult2" 2
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "smlaxy,smlalxy,smlawx"))
+ "a_e*2,a_m,a_w")
+
+;; The "smlalxy", "mul", and "mla" instructions require two iterations
+;; through the execute stage; the result is not available until after
+;; the memory stage.
+(define_insn_reservation "mult3" 3
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "smlalxy,mul,mla"))
+ "a_e*2,a_m,a_w")
+
+;; The "muls" and "mlas" instructions loop in the execute stage for
+;; four iterations in order to set the flags. The value result is
+;; available after three iterations.
+(define_insn_reservation "mult4" 3
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "muls,mlas"))
+ "a_e*4,a_m,a_w")
+
+;; Long multiply instructions that produce two registers of
+;; output (such as umull) make their results available in two cycles;
+;; the least significant word is available before the most significant
+;; word. That fact is not modeled; instead, the instructions are
+;; described.as if the entire result was available at the end of the
+;; cycle in which both words are available.
+
+;; The "umull", "umlal", "smull", and "smlal" instructions all take
+;; three iterations through the execute cycle, and make their results
+;; available after the memory cycle.
+(define_insn_reservation "mult5" 4
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "umull,umlal,smull,smlal"))
+ "a_e*3,a_m,a_w")
+
+;; The "umulls", "umlals", "smulls", and "smlals" instructions loop in
+;; the execute stage for five iterations in order to set the flags.
+;; The value result is vailable after four iterations.
+(define_insn_reservation "mult6" 4
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "insn" "umulls,umlals,smulls,smlals"))
+ "a_e*5,a_m,a_w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Load/Store Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; The models for load/store instructions do not accurately describe
+;; the difference between operations with a base register writeback
+;; (such as "ldm!"). These models assume that all memory references
+;; hit in dcache.
+
+;; LSU instructions require six cycles to execute. They use the ALU
+;; pipeline in all but the 5th cycle, and the LSU pipeline in cycles
+;; three through six.
+;; Loads and stores which use a scaled register offset or scaled
+;; register pre-indexed addressing mode take three cycles EXCEPT for
+;; those that are base + offset with LSL of 0 or 2, or base - offset
+;; with LSL of zero. The remainder take 1 cycle to execute.
+;; For 4byte loads there is a bypass from the load stage
+
+(define_insn_reservation "load1_op" 2
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "load_byte,load1"))
+ "a_e+l_e,l_m,a_w+l_w")
+
+(define_insn_reservation "store1_op" 0
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "store1"))
+ "a_e+l_e,l_m,a_w+l_w")
+
+;; A load's result can be stored by an immediately following store
+(define_bypass 1 "load1_op" "store1_op" "arm_no_early_store_addr_dep")
+
+;; On a LDM/STM operation, the LSU pipeline iterates until all of the
+;; registers have been processed.
+;;
+;; The time it takes to load the data depends on whether or not the
+;; base address is 64-bit aligned; if it is not, an additional cycle
+;; is required. This model assumes that the address is always 64-bit
+;; aligned. Because the processor can load two registers per cycle,
+;; that assumption means that we use the same instruction rservations
+;; for loading 2k and 2k - 1 registers.
+;;
+;; The ALU pipeline is stalled until the completion of the last memory
+;; stage in the LSU pipeline. That is modeled by keeping the ALU
+;; execute stage busy until that point.
+;;
+;; As with ALU operations, if one of the destination registers is the
+;; PC, there are additional stalls; that is not modeled.
+
+(define_insn_reservation "load2_op" 2
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "load2"))
+ "a_e+l_e,l_m,a_w+l_w")
+
+(define_insn_reservation "store2_op" 0
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "store2"))
+ "a_e+l_e,l_m,a_w+l_w")
+
+(define_insn_reservation "load34_op" 3
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "load3,load4"))
+ "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w")
+
+(define_insn_reservation "store34_op" 0
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "store3,store4"))
+ "a_e+l_e,a_e+l_e+l_m,a_e+l_m,a_w+l_w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Branch and Call Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Branch instructions are difficult to model accurately. The ARM
+;; core can predict most branches. If the branch is predicted
+;; correctly, and predicted early enough, the branch can be completely
+;; eliminated from the instruction stream. Some branches can
+;; therefore appear to require zero cycles to execute. We assume that
+;; all branches are predicted correctly, and that the latency is
+;; therefore the minimum value.
+
+(define_insn_reservation "branch_op" 0
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "branch"))
+ "nothing")
+
+;; The latency for a call is not predictable. Therefore, we use 32 as
+;; roughly equivalent to postive infinity.
+
+(define_insn_reservation "call_op" 32
+ (and (eq_attr "tune" "arm1026ejs")
+ (eq_attr "type" "call"))
+ "nothing")
diff --git a/gcc/config/arm/arm1136jfs.md b/gcc/config/arm/arm1136jfs.md
new file mode 100644
index 00000000000..acfce1b5681
--- /dev/null
+++ b/gcc/config/arm/arm1136jfs.md
@@ -0,0 +1,377 @@
+;; ARM 1136J[F]-S Pipeline Description
+;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Written by CodeSourcery, LLC.
+;;
+;; 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. */
+
+;; These descriptions are based on the information contained in the
+;; ARM1136JF-S Technical Reference Manual, Copyright (c) 2003 ARM
+;; Limited.
+;;
+
+;; This automaton provides a pipeline description for the ARM
+;; 1136J-S and 1136JF-S cores.
+;;
+;; The model given here assumes that the condition for all conditional
+;; instructions is "true", i.e., that all of the instructions are
+;; actually executed.
+
+(define_automaton "arm1136jfs")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Pipelines
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; There are three distinct pipelines (page 1-26 and following):
+;;
+;; - A 4-stage decode pipeline, shared by all three. It has fetch (1),
+;; fetch (2), decode, and issue stages. Since this is always involved,
+;; we do not model it in the scheduler.
+;;
+;; - A 4-stage ALU pipeline. It has shifter, ALU (main integer operations),
+;; and saturation stages. The fourth stage is writeback; see below.
+;;
+;; - A 4-stage multiply-accumulate pipeline. It has three stages, called
+;; MAC1 through MAC3, and a fourth writeback stage.
+;;
+;; The 4th-stage writeback is shared between the ALU and MAC pipelines,
+;; which operate in lockstep. Results from either pipeline will be
+;; moved into the writeback stage. Because the two pipelines operate
+;; in lockstep, we schedule them as a single "execute" pipeline.
+;;
+;; - A 4-stage LSU pipeline. It has address generation, data cache (1),
+;; data cache (2), and writeback stages. (Note that this pipeline,
+;; including the writeback stage, is independant from the ALU & LSU pipes.)
+
+(define_cpu_unit "e_1,e_2,e_3,e_wb" "arm1136jfs") ; ALU and MAC
+; e_1 = Sh/Mac1, e_2 = ALU/Mac2, e_3 = SAT/Mac3
+(define_cpu_unit "l_a,l_dc1,l_dc2,l_wb" "arm1136jfs") ; Load/Store
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ALU Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; ALU instructions require eight cycles to execute, and use the ALU
+;; pipeline in each of the eight stages. The results are available
+;; after the alu stage has finished.
+;;
+;; If the destination register is the PC, the pipelines are stalled
+;; for several cycles. That case is not modelled here.
+
+;; ALU operations with no shifted operand
+(define_insn_reservation "11_alu_op" 2
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "alu"))
+ "e_1,e_2,e_3,e_wb")
+
+;; ALU operations with a shift-by-constant operand
+(define_insn_reservation "11_alu_shift_op" 2
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "alu_shift"))
+ "e_1,e_2,e_3,e_wb")
+
+;; ALU operations with a shift-by-register operand
+;; These really stall in the decoder, in order to read
+;; the shift value in a second cycle. Pretend we take two cycles in
+;; the shift stage.
+(define_insn_reservation "11_alu_shift_reg_op" 3
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "alu_shift_reg"))
+ "e_1*2,e_2,e_3,e_wb")
+
+;; alu_ops can start sooner, if there is no shifter dependency
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_alu_op")
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_alu_op")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Multiplication Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Multiplication instructions loop in the first two execute stages until
+;; the instruction has been passed through the multiplier array enough
+;; times.
+
+;; Multiply and multiply-accumulate results are available after four stages.
+(define_insn_reservation "11_mult1" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "mul,mla"))
+ "e_1*2,e_2,e_3,e_wb")
+
+;; The *S variants set the condition flags, which requires three more cycles.
+(define_insn_reservation "11_mult2" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "muls,mlas"))
+ "e_1*2,e_2,e_3,e_wb")
+
+(define_bypass 3 "11_mult1,11_mult2"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 3 "11_mult1,11_mult2"
+ "11_alu_op")
+(define_bypass 3 "11_mult1,11_mult2"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 3 "11_mult1,11_mult2"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+(define_bypass 3 "11_mult1,11_mult2"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+
+;; Signed and unsigned multiply long results are available across two cycles;
+;; the less significant word is available one cycle before the more significant
+;; word. Here we conservatively wait until both are available, which is
+;; after three iterations and the memory cycle. The same is also true of
+;; the two multiply-accumulate instructions.
+(define_insn_reservation "11_mult3" 5
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "smull,umull,smlal,umlal"))
+ "e_1*3,e_2,e_3,e_wb*2")
+
+;; The *S variants set the condition flags, which requires three more cycles.
+(define_insn_reservation "11_mult4" 5
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "smulls,umulls,smlals,umlals"))
+ "e_1*3,e_2,e_3,e_wb*2")
+
+(define_bypass 4 "11_mult3,11_mult4"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 4 "11_mult3,11_mult4"
+ "11_alu_op")
+(define_bypass 4 "11_mult3,11_mult4"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 4 "11_mult3,11_mult4"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+(define_bypass 4 "11_mult3,11_mult4"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+
+;; Various 16x16->32 multiplies and multiply-accumulates, using combinations
+;; of high and low halves of the argument registers. They take a single
+;; pass through the pipeline and make the result available after three
+;; cycles.
+(define_insn_reservation "11_mult5" 3
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "smulxy,smlaxy,smulwy,smlawy,smuad,smuadx,smlad,smladx,smusd,smusdx,smlsd,smlsdx"))
+ "e_1,e_2,e_3,e_wb")
+
+(define_bypass 2 "11_mult5"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 2 "11_mult5"
+ "11_alu_op")
+(define_bypass 2 "11_mult5"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 2 "11_mult5"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+(define_bypass 2 "11_mult5"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+
+;; The same idea, then the 32-bit result is added to a 64-bit quantity.
+(define_insn_reservation "11_mult6" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "smlalxy"))
+ "e_1*2,e_2,e_3,e_wb*2")
+
+;; Signed 32x32 multiply, then the most significant 32 bits are extracted
+;; and are available after the memory stage.
+(define_insn_reservation "11_mult7" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "insn" "smmul,smmulr"))
+ "e_1*2,e_2,e_3,e_wb")
+
+(define_bypass 3 "11_mult6,11_mult7"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 3 "11_mult6,11_mult7"
+ "11_alu_op")
+(define_bypass 3 "11_mult6,11_mult7"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 3 "11_mult6,11_mult7"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+(define_bypass 3 "11_mult6,11_mult7"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Branch Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; These vary greatly depending on their arguments and the results of
+;; stat prediction. Cycle count ranges from zero (unconditional branch,
+;; folded dynamic prediction) to seven (incorrect predictions, etc). We
+;; assume an optimal case for now, because the cost of a cache miss
+;; overwhelms the cost of everything else anyhow.
+
+(define_insn_reservation "11_branches" 0
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "branch"))
+ "nothing")
+
+;; Call latencies are not predictable. A semi-arbitrary very large
+;; number is used as "positive infinity" so that everything should be
+;; finished by the time of return.
+(define_insn_reservation "11_call" 32
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "call"))
+ "nothing")
+
+;; Branches are predicted. A correctly predicted branch will be no
+;; cost, but we're conservative here, and use the timings a
+;; late-register would give us.
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_branches")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_branches")
+(define_bypass 2 "11_load1,11_load2"
+ "11_branches")
+(define_bypass 3 "11_load34"
+ "11_branches")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Load/Store Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; The models for load/store instructions do not accurately describe
+;; the difference between operations with a base register writeback.
+;; These models assume that all memory references hit in dcache. Also,
+;; if the PC is one of the registers involved, there are additional stalls
+;; not modelled here. Addressing modes are also not modelled.
+
+(define_insn_reservation "11_load1" 3
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "load1"))
+ "l_a+e_1,l_dc1,l_dc2,l_wb")
+
+;; Load byte results are not available until the writeback stage, where
+;; the correct byte is extracted.
+
+(define_insn_reservation "11_loadb" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "load_byte"))
+ "l_a+e_1,l_dc1,l_dc2,l_wb")
+
+(define_insn_reservation "11_store1" 0
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "store1"))
+ "l_a+e_1,l_dc1,l_dc2,l_wb")
+
+;; Load/store double words into adjacent registers. The timing and
+;; latencies are different depending on whether the address is 64-bit
+;; aligned. This model assumes that it is.
+(define_insn_reservation "11_load2" 3
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "load2"))
+ "l_a+e_1,l_dc1,l_dc2,l_wb")
+
+(define_insn_reservation "11_store2" 0
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "store2"))
+ "l_a+e_1,l_dc1,l_dc2,l_wb")
+
+;; Load/store multiple registers. Two registers are stored per cycle.
+;; Actual timing depends on how many registers are affected, so we
+;; optimistically schedule a low latency.
+(define_insn_reservation "11_load34" 4
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "load3,load4"))
+ "l_a+e_1,l_dc1*2,l_dc2,l_wb")
+
+(define_insn_reservation "11_store34" 0
+ (and (eq_attr "tune" "arm1136js,arm1136jfs")
+ (eq_attr "type" "store3,store4"))
+ "l_a+e_1,l_dc1*2,l_dc2,l_wb")
+
+;; A store can start immediately after an alu op, if that alu op does
+;; not provide part of the address to access.
+(define_bypass 1 "11_alu_op,11_alu_shift_op"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+(define_bypass 2 "11_alu_shift_reg_op"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+
+;; An alu op can start sooner after a load, if that alu op does not
+;; have an early register dependancy on the load
+(define_bypass 2 "11_load1"
+ "11_alu_op")
+(define_bypass 2 "11_load1"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 2 "11_load1"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+
+(define_bypass 3 "11_loadb"
+ "11_alu_op")
+(define_bypass 3 "11_loadb"
+ "11_alu_shift_op"
+ "arm_no_early_alu_shift_value_dep")
+(define_bypass 3 "11_loadb"
+ "11_alu_shift_reg_op"
+ "arm_no_early_alu_shift_dep")
+
+;; A mul op can start sooner after a load, if that mul op does not
+;; have an early multiply dependency
+(define_bypass 2 "11_load1"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 3 "11_load34"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+(define_bypass 3 "11_loadb"
+ "11_mult1,11_mult2,11_mult3,11_mult4,11_mult5,11_mult6,11_mult7"
+ "arm_no_early_mul_dep")
+
+;; A store can start sooner after a load, if that load does not
+;; produce part of the address to access
+(define_bypass 2 "11_load1"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
+(define_bypass 3 "11_loadb"
+ "11_store1"
+ "arm_no_early_store_addr_dep")
diff --git a/gcc/config/arm/arm926ejs.md b/gcc/config/arm/arm926ejs.md
new file mode 100644
index 00000000000..e8ba17cf551
--- /dev/null
+++ b/gcc/config/arm/arm926ejs.md
@@ -0,0 +1,188 @@
+;; ARM 926EJ-S Pipeline Description
+;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Written by CodeSourcery, LLC.
+;;
+;; 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. */
+
+;; These descriptions are based on the information contained in the
+;; ARM926EJ-S Technical Reference Manual, Copyright (c) 2002 ARM
+;; Limited.
+;;
+
+;; This automaton provides a pipeline description for the ARM
+;; 926EJ-S core.
+;;
+;; The model given here assumes that the condition for all conditional
+;; instructions is "true", i.e., that all of the instructions are
+;; actually executed.
+
+(define_automaton "arm926ejs")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Pipelines
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; There is a single pipeline
+;;
+;; The ALU pipeline has fetch, decode, execute, memory, and
+;; write stages. We only need to model the execute, memory and write
+;; stages.
+
+(define_cpu_unit "e,m,w" "arm926ejs")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ALU Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; ALU instructions require three cycles to execute, and use the ALU
+;; pipeline in each of the three stages. The results are available
+;; after the execute stage stage has finished.
+;;
+;; If the destination register is the PC, the pipelines are stalled
+;; for several cycles. That case is not modeled here.
+
+;; ALU operations with no shifted operand
+(define_insn_reservation "9_alu_op" 1
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "alu,alu_shift"))
+ "e,m,w")
+
+;; ALU operations with a shift-by-register operand
+;; These really stall in the decoder, in order to read
+;; the shift value in a second cycle. Pretend we take two cycles in
+;; the execute stage.
+(define_insn_reservation "9_alu_shift_reg_op" 2
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "alu_shift_reg"))
+ "e*2,m,w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Multiplication Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Multiplication instructions loop in the execute stage until the
+;; instruction has been passed through the multiplier array enough
+;; times. Multiply operations occur in both the execute and memory
+;; stages of the pipeline
+
+(define_insn_reservation "9_mult1" 3
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "smlalxy,mul,mla"))
+ "e*2,m,w")
+
+(define_insn_reservation "9_mult2" 4
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "muls,mlas"))
+ "e*3,m,w")
+
+(define_insn_reservation "9_mult3" 4
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "umull,umlal,smull,smlal"))
+ "e*3,m,w")
+
+(define_insn_reservation "9_mult4" 5
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "umulls,umlals,smulls,smlals"))
+ "e*4,m,w")
+
+(define_insn_reservation "9_mult5" 2
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "smulxy,smlaxy,smlawx"))
+ "e,m,w")
+
+(define_insn_reservation "9_mult6" 3
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "insn" "smlalxy"))
+ "e*2,m,w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Load/Store Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; The models for load/store instructions do not accurately describe
+;; the difference between operations with a base register writeback
+;; (such as "ldm!"). These models assume that all memory references
+;; hit in dcache.
+
+;; Loads with a shifted offset take 3 cycles, and are (a) probably the
+;; most common and (b) the pessimistic assumption will lead to fewer stalls.
+(define_insn_reservation "9_load1_op" 3
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "load1,load_byte"))
+ "e*2,m,w")
+
+(define_insn_reservation "9_store1_op" 0
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "store1"))
+ "e,m,w")
+
+;; multiple word loads and stores
+(define_insn_reservation "9_load2_op" 3
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "load2"))
+ "e,m*2,w")
+
+(define_insn_reservation "9_load3_op" 4
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "load3"))
+ "e,m*3,w")
+
+(define_insn_reservation "9_load4_op" 5
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "load4"))
+ "e,m*4,w")
+
+(define_insn_reservation "9_store2_op" 0
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "store2"))
+ "e,m*2,w")
+
+(define_insn_reservation "9_store3_op" 0
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "store3"))
+ "e,m*3,w")
+
+(define_insn_reservation "9_store4_op" 0
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "store4"))
+ "e,m*4,w")
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Branch and Call Instructions
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; Branch instructions are difficult to model accurately. The ARM
+;; core can predict most branches. If the branch is predicted
+;; correctly, and predicted early enough, the branch can be completely
+;; eliminated from the instruction stream. Some branches can
+;; therefore appear to require zero cycles to execute. We assume that
+;; all branches are predicted correctly, and that the latency is
+;; therefore the minimum value.
+
+(define_insn_reservation "9_branch_op" 0
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "branch"))
+ "nothing")
+
+;; The latency for a call is not predictable. Therefore, we use 32 as
+;; roughly equivalent to postive infinity.
+
+(define_insn_reservation "9_call_op" 32
+ (and (eq_attr "tune" "arm926ejs")
+ (eq_attr "type" "call"))
+ "nothing")
diff --git a/gcc/config/arm/cirrus.md b/gcc/config/arm/cirrus.md
index 0da8469ddd2..9bd01be45cb 100644
--- a/gcc/config/arm/cirrus.md
+++ b/gcc/config/arm/cirrus.md
@@ -34,7 +34,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(plus:DI (match_operand:DI 1 "cirrus_fp_register" "v")
(match_operand:DI 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfadd64%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -44,7 +44,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(plus:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfadd32%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -54,7 +54,7 @@
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(plus:SF (match_operand:SF 1 "cirrus_fp_register" "v")
(match_operand:SF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfadds%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -64,7 +64,7 @@
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(plus:DF (match_operand:DF 1 "cirrus_fp_register" "v")
(match_operand:DF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfaddd%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -74,7 +74,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(minus:DI (match_operand:DI 1 "cirrus_fp_register" "v")
(match_operand:DI 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfsub64%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -84,7 +84,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(minus:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfsub32%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -94,7 +94,7 @@
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(minus:SF (match_operand:SF 1 "cirrus_fp_register" "v")
(match_operand:SF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfsubs%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -104,7 +104,7 @@
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(minus:DF (match_operand:DF 1 "cirrus_fp_register" "v")
(match_operand:DF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfsubd%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -114,7 +114,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(mult:SI (match_operand:SI 2 "cirrus_fp_register" "v")
(match_operand:SI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfmul32%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -124,7 +124,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(mult:DI (match_operand:DI 2 "cirrus_fp_register" "v")
(match_operand:DI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmul64%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_dmult")
(set_attr "cirrus" "normal")]
@@ -136,7 +136,7 @@
(mult:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_fp_register" "v"))
(match_operand:SI 3 "cirrus_fp_register" "0")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfmac32%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -149,7 +149,7 @@
(match_operand:SI 1 "cirrus_fp_register" "0")
(mult:SI (match_operand:SI 2 "cirrus_fp_register" "v")
(match_operand:SI 3 "cirrus_fp_register" "v"))))]
- "0 && TARGET_ARM && TARGET_CIRRUS"
+ "0 && TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmsc32%?\\t%V0, %V2, %V3"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -159,7 +159,7 @@
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(mult:SF (match_operand:SF 1 "cirrus_fp_register" "v")
(match_operand:SF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmuls%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_farith")
(set_attr "cirrus" "normal")]
@@ -169,7 +169,7 @@
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(mult:DF (match_operand:DF 1 "cirrus_fp_register" "v")
(match_operand:DF 2 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmuld%?\\t%V0, %V1, %V2"
[(set_attr "type" "mav_dmult")
(set_attr "cirrus" "normal")]
@@ -179,7 +179,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_shift_const" "")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfsh32%?\\t%V0, %V1, #%s2"
[(set_attr "cirrus" "normal")]
)
@@ -188,7 +188,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(ashiftrt:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_shift_const" "")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfsh32%?\\t%V0, %V1, #-%s2"
[(set_attr "cirrus" "normal")]
)
@@ -197,7 +197,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(ashift:SI (match_operand:SI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "register_operand" "r")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfrshl32%?\\t%V1, %V0, %s2"
[(set_attr "cirrus" "normal")]
)
@@ -206,7 +206,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "register_operand" "r")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfrshl64%?\\t%V1, %V0, %s2"
[(set_attr "cirrus" "normal")]
)
@@ -215,7 +215,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(ashift:DI (match_operand:DI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_shift_const" "")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfsh64%?\\t%V0, %V1, #%s2"
[(set_attr "cirrus" "normal")]
)
@@ -224,7 +224,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(ashiftrt:DI (match_operand:DI 1 "cirrus_fp_register" "v")
(match_operand:SI 2 "cirrus_shift_const" "")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfsh64%?\\t%V0, %V1, #-%s2"
[(set_attr "cirrus" "normal")]
)
@@ -232,7 +232,7 @@
(define_insn "*cirrus_absdi2"
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(abs:DI (match_operand:DI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfabs64%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -242,7 +242,7 @@
[(set (match_operand:DI 0 "cirrus_fp_register" "=v")
(neg:DI (match_operand:DI 1 "cirrus_fp_register" "v")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfneg64%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -250,7 +250,7 @@
(define_insn "*cirrus_negsi2"
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(neg:SI (match_operand:SI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfneg32%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -258,7 +258,7 @@
(define_insn "*cirrus_negsf2"
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(neg:SF (match_operand:SF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfnegs%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -266,7 +266,7 @@
(define_insn "*cirrus_negdf2"
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(neg:DF (match_operand:DF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfnegd%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -276,7 +276,7 @@
[(set (match_operand:SI 0 "cirrus_fp_register" "=v")
(abs:SI (match_operand:SI 1 "cirrus_fp_register" "v")))
(clobber (reg:CC CC_REGNUM))]
- "TARGET_ARM && TARGET_CIRRUS && 0"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0"
"cfabs32%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -284,7 +284,7 @@
(define_insn "*cirrus_abssf2"
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(abs:SF (match_operand:SF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfabss%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -292,7 +292,7 @@
(define_insn "*cirrus_absdf2"
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(abs:DF (match_operand:DF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfabsd%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -302,7 +302,7 @@
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(float:SF (match_operand:SI 1 "s_register_operand" "r")))
(clobber (match_scratch:DF 2 "=v"))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmv64lr%?\\t%Z2, %1\;cfcvt32s%?\\t%V0, %Y2"
[(set_attr "length" "8")
(set_attr "cirrus" "move")]
@@ -312,7 +312,7 @@
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(float:DF (match_operand:SI 1 "s_register_operand" "r")))
(clobber (match_scratch:DF 2 "=v"))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfmv64lr%?\\t%Z2, %1\;cfcvt32d%?\\t%V0, %Y2"
[(set_attr "length" "8")
(set_attr "cirrus" "move")]
@@ -321,14 +321,14 @@
(define_insn "floatdisf2"
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(float:SF (match_operand:DI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcvt64s%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")])
(define_insn "floatdidf2"
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(float:DF (match_operand:DI 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcvt64d%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")])
@@ -336,7 +336,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=r")
(fix:SI (fix:SF (match_operand:SF 1 "cirrus_fp_register" "v"))))
(clobber (match_scratch:DF 2 "=v"))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cftruncs32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
[(set_attr "length" "8")
(set_attr "cirrus" "normal")]
@@ -346,7 +346,7 @@
[(set (match_operand:SI 0 "s_register_operand" "=r")
(fix:SI (fix:DF (match_operand:DF 1 "cirrus_fp_register" "v"))))
(clobber (match_scratch:DF 2 "=v"))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cftruncd32%?\\t%Y2, %V1\;cfmvr64l%?\\t%0, %Z2"
[(set_attr "length" "8")]
)
@@ -355,7 +355,7 @@
[(set (match_operand:SF 0 "cirrus_fp_register" "=v")
(float_truncate:SF
(match_operand:DF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcvtds%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -363,7 +363,7 @@
(define_insn "*cirrus_extendsfdf2"
[(set (match_operand:DF 0 "cirrus_fp_register" "=v")
(float_extend:DF (match_operand:SF 1 "cirrus_fp_register" "v")))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"cfcvtsd%?\\t%V0, %V1"
[(set_attr "cirrus" "normal")]
)
@@ -371,7 +371,7 @@
(define_insn "*cirrus_arm_movdi"
[(set (match_operand:DI 0 "nonimmediate_di_operand" "=r,r,o<>,v,r,v,m,v")
(match_operand:DI 1 "di_operand" "rIK,mi,r,r,v,m,v,v"))]
- "TARGET_ARM && TARGET_CIRRUS"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK"
"*
{
switch (which_alternative)
@@ -394,7 +394,7 @@
}
}"
[(set_attr "length" " 8, 8, 8, 8, 8, 4, 4, 4")
- (set_attr "type" " *,load,store2, *, *, load,store2, *")
+ (set_attr "type" " *,load2,store2, *, *, load2,store2, *")
(set_attr "pool_range" " *,1020, *, *, *, *, *, *")
(set_attr "neg_pool_range" " *,1012, *, *, *, *, *, *")
(set_attr "cirrus" "not, not, not,move,normal,double,double,normal")]
@@ -406,7 +406,7 @@
(define_insn "*cirrus_arm_movsi_insn"
[(set (match_operand:SI 0 "general_operand" "=r,r,r,m,*v,r,*v,T,*v")
(match_operand:SI 1 "general_operand" "rI,K,mi,r,r,*v,T,*v,*v"))]
- "TARGET_ARM && TARGET_CIRRUS && 0
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK && 0
&& (register_operand (operands[0], SImode)
|| register_operand (operands[1], SImode))"
"@
@@ -419,7 +419,7 @@
cfldr32%?\\t%V0, %1
cfstr32%?\\t%V1, %0
cfsh32%?\\t%V0, %V1, #0"
- [(set_attr "type" "*, *, load,store1, *, *, load,store1, *")
+ [(set_attr "type" "*, *, load1,store1, *, *, load1,store1, *")
(set_attr "pool_range" "*, *, 4096, *, *, *, 1024, *, *")
(set_attr "neg_pool_range" "*, *, 4084, *, *, *, 1012, *, *")
(set_attr "cirrus" "not,not, not, not,move,normal,normal,normal,normal")]
@@ -428,7 +428,7 @@
(define_insn "*cirrus_movsf_hard_insn"
[(set (match_operand:SF 0 "nonimmediate_operand" "=v,v,v,r,m,r,r,m")
(match_operand:SF 1 "general_operand" "v,m,r,v,v,r,mE,r"))]
- "TARGET_ARM && TARGET_CIRRUS
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_MAVERICK
&& (GET_CODE (operands[0]) != MEM
|| register_operand (operands[1], SFmode))"
"@
@@ -441,7 +441,7 @@
ldr%?\\t%0, %1\\t%@ float
str%?\\t%1, %0\\t%@ float"
[(set_attr "length" " *, *, *, *, *, 4, 4, 4")
- (set_attr "type" " *, load, *, *,store1, *,load,store1")
+ (set_attr "type" " *, load1, *, *,store1, *,load1,store1")
(set_attr "pool_range" " *, *, *, *, *, *,4096, *")
(set_attr "neg_pool_range" " *, *, *, *, *, *,4084, *")
(set_attr "cirrus" "normal,normal,move,normal,normal,not, not, not")]
@@ -451,7 +451,7 @@
[(set (match_operand:DF 0 "nonimmediate_operand" "=r,Q,r,m,r,v,v,v,r,m")
(match_operand:DF 1 "general_operand" "Q,r,r,r,mF,v,m,r,v,v"))]
"TARGET_ARM
- && TARGET_CIRRUS
+ && TARGET_HARD_FLOAT && TARGET_MAVERICK
&& (GET_CODE (operands[0]) != MEM
|| register_operand (operands[1], DFmode))"
"*
@@ -469,7 +469,7 @@
default: abort ();
}
}"
- [(set_attr "type" "load,store2, *,store2,load, *, load, *, *,store2")
+ [(set_attr "type" "load1,store2, *,store2,load1, *, load1, *, *,store2")
(set_attr "length" " 4, 4, 8, 8, 8, 4, 4, 8, 8, 4")
(set_attr "pool_range" " *, *, *, *, 252, *, *, *, *, *")
(set_attr "neg_pool_range" " *, *, *, *, 244, *, *, *, *, *")
diff --git a/gcc/config/arm/elf.h b/gcc/config/arm/elf.h
index 581f7267900..e3f393aa9d9 100644
--- a/gcc/config/arm/elf.h
+++ b/gcc/config/arm/elf.h
@@ -46,7 +46,7 @@
#ifndef SUBTARGET_ASM_FLOAT_SPEC
#define SUBTARGET_ASM_FLOAT_SPEC "\
-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}"
+%{mapcs-float:-mfloat}"
#endif
#ifndef ASM_SPEC
@@ -58,6 +58,8 @@
%{mapcs-*:-mapcs-%*} \
%(subtarget_asm_float_spec) \
%{mthumb-interwork:-mthumb-interwork} \
+%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \
+%{mfloat-abi=*} %{mfpu=*} \
%(subtarget_extra_asm_spec)"
#endif
diff --git a/gcc/config/arm/fpa.md b/gcc/config/arm/fpa.md
index 3b6efbfbbda..2eb74ee8c8b 100644
--- a/gcc/config/arm/fpa.md
+++ b/gcc/config/arm/fpa.md
@@ -100,8 +100,8 @@
(define_insn "*addsf3_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f,f")
(plus:SF (match_operand:SF 1 "s_register_operand" "%f,f")
- (match_operand:SF 2 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
adf%?s\\t%0, %1, %2
suf%?s\\t%0, %1, #%N2"
@@ -112,8 +112,8 @@
(define_insn "*adddf3_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f,f")
(plus:DF (match_operand:DF 1 "s_register_operand" "%f,f")
- (match_operand:DF 2 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
adf%?d\\t%0, %1, %2
suf%?d\\t%0, %1, #%N2"
@@ -125,8 +125,8 @@
[(set (match_operand:DF 0 "s_register_operand" "=f,f")
(plus:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f,f"))
- (match_operand:DF 2 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
adf%?d\\t%0, %1, %2
suf%?d\\t%0, %1, #%N2"
@@ -139,7 +139,7 @@
(plus:DF (match_operand:DF 1 "s_register_operand" "f")
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"adf%?d\\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "predicable" "yes")]
@@ -151,7 +151,7 @@
(match_operand:SF 1 "s_register_operand" "f"))
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"adf%?d\\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "predicable" "yes")]
@@ -159,9 +159,9 @@
(define_insn "*subsf3_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f,f")
- (minus:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G")
- (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (minus:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G")
+ (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
suf%?s\\t%0, %1, %2
rsf%?s\\t%0, %2, %1"
@@ -170,9 +170,9 @@
(define_insn "*subdf3_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f,f")
- (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G")
- (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G")
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
suf%?d\\t%0, %1, %2
rsf%?d\\t%0, %2, %1"
@@ -184,8 +184,8 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(minus:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"suf%?d\\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "predicable" "yes")]
@@ -193,10 +193,10 @@
(define_insn "*subdf_df_esfdf_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f,f")
- (minus:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G")
+ (minus:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G")
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f,f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
suf%?d\\t%0, %1, %2
rsf%?d\\t%0, %2, %1"
@@ -210,7 +210,7 @@
(match_operand:SF 1 "s_register_operand" "f"))
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"suf%?d\\t%0, %1, %2"
[(set_attr "type" "farith")
(set_attr "predicable" "yes")]
@@ -219,8 +219,8 @@
(define_insn "*mulsf3_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(mult:SF (match_operand:SF 1 "s_register_operand" "f")
- (match_operand:SF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"fml%?s\\t%0, %1, %2"
[(set_attr "type" "ffmul")
(set_attr "predicable" "yes")]
@@ -229,8 +229,8 @@
(define_insn "*muldf3_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(mult:DF (match_operand:DF 1 "s_register_operand" "f")
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"muf%?d\\t%0, %1, %2"
[(set_attr "type" "fmul")
(set_attr "predicable" "yes")]
@@ -240,8 +240,8 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(mult:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"muf%?d\\t%0, %1, %2"
[(set_attr "type" "fmul")
(set_attr "predicable" "yes")]
@@ -252,7 +252,7 @@
(mult:DF (match_operand:DF 1 "s_register_operand" "f")
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"muf%?d\\t%0, %1, %2"
[(set_attr "type" "fmul")
(set_attr "predicable" "yes")]
@@ -263,7 +263,7 @@
(mult:DF
(float_extend:DF (match_operand:SF 1 "s_register_operand" "f"))
(float_extend:DF (match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"muf%?d\\t%0, %1, %2"
[(set_attr "type" "fmul")
(set_attr "predicable" "yes")]
@@ -273,9 +273,9 @@
(define_insn "*divsf3_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f,f")
- (div:SF (match_operand:SF 1 "fpa_rhs_operand" "f,G")
- (match_operand:SF 2 "fpa_rhs_operand" "fG,f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (div:SF (match_operand:SF 1 "arm_float_rhs_operand" "f,G")
+ (match_operand:SF 2 "arm_float_rhs_operand" "fG,f")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
fdv%?s\\t%0, %1, %2
frd%?s\\t%0, %2, %1"
@@ -285,9 +285,9 @@
(define_insn "*divdf3_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f,f")
- (div:DF (match_operand:DF 1 "fpa_rhs_operand" "f,G")
- (match_operand:DF 2 "fpa_rhs_operand" "fG,f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "f,G")
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG,f")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
dvf%?d\\t%0, %1, %2
rdf%?d\\t%0, %2, %1"
@@ -299,8 +299,8 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(div:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"dvf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -308,10 +308,10 @@
(define_insn "*divdf_df_esfdf_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
- (div:DF (match_operand:DF 1 "fpa_rhs_operand" "fG")
+ (div:DF (match_operand:DF 1 "arm_float_rhs_operand" "fG")
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rdf%?d\\t%0, %2, %1"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -323,7 +323,7 @@
(match_operand:SF 1 "s_register_operand" "f"))
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"dvf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -332,8 +332,8 @@
(define_insn "*modsf3_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(mod:SF (match_operand:SF 1 "s_register_operand" "f")
- (match_operand:SF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rmf%?s\\t%0, %1, %2"
[(set_attr "type" "fdivs")
(set_attr "predicable" "yes")]
@@ -342,8 +342,8 @@
(define_insn "*moddf3_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(mod:DF (match_operand:DF 1 "s_register_operand" "f")
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rmf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -353,8 +353,8 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(mod:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))
- (match_operand:DF 2 "fpa_rhs_operand" "fG")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 2 "arm_float_rhs_operand" "fG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rmf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -365,7 +365,7 @@
(mod:DF (match_operand:DF 1 "s_register_operand" "f")
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rmf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -377,7 +377,7 @@
(match_operand:SF 1 "s_register_operand" "f"))
(float_extend:DF
(match_operand:SF 2 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"rmf%?d\\t%0, %1, %2"
[(set_attr "type" "fdivd")
(set_attr "predicable" "yes")]
@@ -386,7 +386,7 @@
(define_insn "*negsf2_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(neg:SF (match_operand:SF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"mnf%?s\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -395,7 +395,7 @@
(define_insn "*negdf2_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(neg:DF (match_operand:DF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"mnf%?d\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -405,7 +405,7 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(neg:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"mnf%?d\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -414,7 +414,7 @@
(define_insn "*abssf2_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(abs:SF (match_operand:SF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"abs%?s\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -423,7 +423,7 @@
(define_insn "*absdf2_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(abs:DF (match_operand:DF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"abs%?d\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -433,7 +433,7 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(abs:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"abs%?d\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -442,7 +442,7 @@
(define_insn "*sqrtsf2_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(sqrt:SF (match_operand:SF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"sqt%?s\\t%0, %1"
[(set_attr "type" "float_em")
(set_attr "predicable" "yes")]
@@ -451,7 +451,7 @@
(define_insn "*sqrtdf2_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(sqrt:DF (match_operand:DF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"sqt%?d\\t%0, %1"
[(set_attr "type" "float_em")
(set_attr "predicable" "yes")]
@@ -461,7 +461,7 @@
[(set (match_operand:DF 0 "s_register_operand" "=f")
(sqrt:DF (float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"sqt%?d\\t%0, %1"
[(set_attr "type" "float_em")
(set_attr "predicable" "yes")]
@@ -470,7 +470,7 @@
(define_insn "*floatsisf2_fpa"
[(set (match_operand:SF 0 "s_register_operand" "=f")
(float:SF (match_operand:SI 1 "s_register_operand" "r")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"flt%?s\\t%0, %1"
[(set_attr "type" "r_2_f")
(set_attr "predicable" "yes")]
@@ -479,7 +479,7 @@
(define_insn "*floatsidf2_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(float:DF (match_operand:SI 1 "s_register_operand" "r")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"flt%?d\\t%0, %1"
[(set_attr "type" "r_2_f")
(set_attr "predicable" "yes")]
@@ -488,7 +488,7 @@
(define_insn "*fix_truncsfsi2_fpa"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"fix%?z\\t%0, %1"
[(set_attr "type" "f_2_r")
(set_attr "predicable" "yes")]
@@ -497,7 +497,7 @@
(define_insn "*fix_truncdfsi2_fpa"
[(set (match_operand:SI 0 "s_register_operand" "=r")
(fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"fix%?z\\t%0, %1"
[(set_attr "type" "f_2_r")
(set_attr "predicable" "yes")]
@@ -507,7 +507,7 @@
[(set (match_operand:SF 0 "s_register_operand" "=f")
(float_truncate:SF
(match_operand:DF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"mvf%?s\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -516,7 +516,7 @@
(define_insn "*extendsfdf2_fpa"
[(set (match_operand:DF 0 "s_register_operand" "=f")
(float_extend:DF (match_operand:SF 1 "s_register_operand" "f")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"mvf%?d\\t%0, %1"
[(set_attr "type" "ffarith")
(set_attr "predicable" "yes")]
@@ -526,7 +526,7 @@
[(set (match_operand:SF 0 "nonimmediate_operand" "=f,f,f, m,f,r,r,r, m")
(match_operand:SF 1 "general_operand" "fG,H,mE,f,r,f,r,mE,r"))]
"TARGET_ARM
- && TARGET_HARD_FLOAT
+ && TARGET_HARD_FLOAT && TARGET_FPA
&& (GET_CODE (operands[0]) != MEM
|| register_operand (operands[1], SFmode))"
"@
@@ -542,7 +542,7 @@
[(set_attr "length" "4,4,4,4,8,8,4,4,4")
(set_attr "predicable" "yes")
(set_attr "type"
- "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load,store1")
+ "ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r,*,load1,store1")
(set_attr "pool_range" "*,*,1024,*,*,*,*,4096,*")
(set_attr "neg_pool_range" "*,*,1012,*,*,*,*,4084,*")]
)
@@ -553,7 +553,7 @@
(match_operand:DF 1 "general_operand"
"Q, r,r,r,mF,fG,H,mF,f,r, f"))]
"TARGET_ARM
- && TARGET_HARD_FLOAT
+ && TARGET_HARD_FLOAT && TARGET_FPA
&& (GET_CODE (operands[0]) != MEM
|| register_operand (operands[1], DFmode))"
"*
@@ -576,7 +576,7 @@
[(set_attr "length" "4,4,8,8,8,4,4,4,4,8,8")
(set_attr "predicable" "yes")
(set_attr "type"
- "load,store2,*,store2,load,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r")
+ "load1,store2,*,store2,load1,ffarith,ffarith,f_load,f_store,r_mem_f,f_mem_r")
(set_attr "pool_range" "*,*,*,*,1020,*,*,1024,*,*,*")
(set_attr "neg_pool_range" "*,*,*,*,1008,*,*,1008,*,*,*")]
)
@@ -589,7 +589,7 @@
(define_insn "*movxf_fpa"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,f,f,m,f,r,r")
(match_operand:XF 1 "general_operand" "fG,H,m,f,r,f,r"))]
- "TARGET_ARM && TARGET_HARD_FLOAT && reload_completed"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA && reload_completed"
"*
switch (which_alternative)
{
@@ -613,8 +613,8 @@
(define_insn "*cmpsf_fpa"
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (match_operand:SF 0 "s_register_operand" "f,f")
- (match_operand:SF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?\\t%0, %1
cnf%?\\t%0, #%N1"
@@ -625,8 +625,8 @@
(define_insn "*cmpdf_fpa"
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (match_operand:DF 0 "s_register_operand" "f,f")
- (match_operand:DF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?\\t%0, %1
cnf%?\\t%0, #%N1"
@@ -638,8 +638,8 @@
[(set (reg:CCFP CC_REGNUM)
(compare:CCFP (float_extend:DF
(match_operand:SF 0 "s_register_operand" "f,f"))
- (match_operand:DF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?\\t%0, %1
cnf%?\\t%0, #%N1"
@@ -652,7 +652,7 @@
(compare:CCFP (match_operand:DF 0 "s_register_operand" "f")
(float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"cmf%?\\t%0, %1"
[(set_attr "conds" "set")
(set_attr "type" "f_2_r")]
@@ -661,8 +661,8 @@
(define_insn "*cmpsf_trap_fpa"
[(set (reg:CCFPE CC_REGNUM)
(compare:CCFPE (match_operand:SF 0 "s_register_operand" "f,f")
- (match_operand:SF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?e\\t%0, %1
cnf%?e\\t%0, #%N1"
@@ -673,8 +673,8 @@
(define_insn "*cmpdf_trap_fpa"
[(set (reg:CCFPE CC_REGNUM)
(compare:CCFPE (match_operand:DF 0 "s_register_operand" "f,f")
- (match_operand:DF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?e\\t%0, %1
cnf%?e\\t%0, #%N1"
@@ -686,8 +686,8 @@
[(set (reg:CCFPE CC_REGNUM)
(compare:CCFPE (float_extend:DF
(match_operand:SF 0 "s_register_operand" "f,f"))
- (match_operand:DF 1 "fpa_add_operand" "fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_add_operand" "fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
cmf%?e\\t%0, %1
cnf%?e\\t%0, #%N1"
@@ -700,7 +700,7 @@
(compare:CCFPE (match_operand:DF 0 "s_register_operand" "f")
(float_extend:DF
(match_operand:SF 1 "s_register_operand" "f"))))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"cmf%?e\\t%0, %1"
[(set_attr "conds" "set")
(set_attr "type" "f_2_r")]
@@ -711,9 +711,9 @@
(if_then_else:SF
(match_operator 3 "arm_comparison_operator"
[(match_operand 4 "cc_register" "") (const_int 0)])
- (match_operand:SF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H")
- (match_operand:SF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:SF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H")
+ (match_operand:SF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
mvf%D3s\\t%0, %2
mnf%D3s\\t%0, #%N2
@@ -733,9 +733,9 @@
(if_then_else:DF
(match_operator 3 "arm_comparison_operator"
[(match_operand 4 "cc_register" "") (const_int 0)])
- (match_operand:DF 1 "fpa_add_operand" "0,0,fG,H,fG,fG,H,H")
- (match_operand:DF 2 "fpa_add_operand" "fG,H,0,0,fG,H,fG,H")))]
- "TARGET_ARM && TARGET_HARD_FLOAT"
+ (match_operand:DF 1 "arm_float_add_operand" "0,0,fG,H,fG,fG,H,H")
+ (match_operand:DF 2 "arm_float_add_operand" "fG,H,0,0,fG,H,fG,H")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_FPA"
"@
mvf%D3d\\t%0, %2
mnf%D3d\\t%0, #%N2
diff --git a/gcc/config/arm/iwmmxt.md b/gcc/config/arm/iwmmxt.md
index f8070a88594..6c87500093e 100644
--- a/gcc/config/arm/iwmmxt.md
+++ b/gcc/config/arm/iwmmxt.md
@@ -86,7 +86,7 @@
}
}"
[(set_attr "length" "8,8,8,4,4,4,4,4")
- (set_attr "type" "*,load,store2,*,*,*,*,*")
+ (set_attr "type" "*,load1,store2,*,*,*,*,*")
(set_attr "pool_range" "*,1020,*,*,*,*,*,*")
(set_attr "neg_pool_range" "*,1012,*,*,*,*,*,*")]
)
@@ -110,7 +110,7 @@
case 7: return \"wstrw\\t%1, %0\";
default:return \"wstrw\\t%1, [sp, #-4]!\;wldrw\\t%0, [sp], #4\\t@move CG reg\";
}"
- [(set_attr "type" "*,*,load,store1,*,*,load,store1,*")
+ [(set_attr "type" "*,*,load1,store1,*,*,load1,store1,*")
(set_attr "length" "*,*,*, *,*,*, 16, *,8")
(set_attr "pool_range" "*,*,4096, *,*,*,1024, *,*")
(set_attr "neg_pool_range" "*,*,4084, *,*,*, *, 1012,*")
@@ -148,7 +148,7 @@
case 4: return \"tmcr%?\\t%0, %1\";
default: return \"tmrc%?\\t%0, %1\";
}"
- [(set_attr "type" "*,*,load,store1,*,*")
+ [(set_attr "type" "*,*,load1,store1,*,*")
(set_attr "pool_range" "*,*,4096, *,*,*")
(set_attr "neg_pool_range" "*,*,4084, *,*,*")]
)
@@ -169,7 +169,7 @@
}"
[(set_attr "predicable" "yes")
(set_attr "length" "4, 4, 4,4,4, 8")
- (set_attr "type" "*,store1,load,*,*,load")
+ (set_attr "type" "*,store1,load1,*,*,load1")
(set_attr "pool_range" "*, *, 256,*,*, 256")
(set_attr "neg_pool_range" "*, *, 244,*,*, 244")])
@@ -189,7 +189,7 @@
}"
[(set_attr "predicable" "yes")
(set_attr "length" "4, 4, 4,4,4, 8")
- (set_attr "type" "*,store1,load,*,*,load")
+ (set_attr "type" "*,store1,load1,*,*,load1")
(set_attr "pool_range" "*, *, 256,*,*, 256")
(set_attr "neg_pool_range" "*, *, 244,*,*, 244")])
@@ -209,7 +209,7 @@
}"
[(set_attr "predicable" "yes")
(set_attr "length" "4, 4, 4,4,4, 24")
- (set_attr "type" "*,store1,load,*,*,load")
+ (set_attr "type" "*,store1,load1,*,*,load1")
(set_attr "pool_range" "*, *, 256,*,*, 256")
(set_attr "neg_pool_range" "*, *, 244,*,*, 244")])
@@ -225,7 +225,7 @@
"* return output_move_double (operands);"
[(set_attr "predicable" "yes")
(set_attr "length" "8")
- (set_attr "type" "load")
+ (set_attr "type" "load1")
(set_attr "pool_range" "256")
(set_attr "neg_pool_range" "244")])
@@ -1149,7 +1149,7 @@
"wsrawg%?\\t%0, %1, %2"
[(set_attr "predicable" "yes")])
-(define_insn "ashrdi3"
+(define_insn "ashrdi3_iwmmxt"
[(set (match_operand:DI 0 "register_operand" "=y")
(ashiftrt:DI (match_operand:DI 1 "register_operand" "y")
(match_operand:SI 2 "register_operand" "z")))]
@@ -1173,7 +1173,7 @@
"wsrlwg%?\\t%0, %1, %2"
[(set_attr "predicable" "yes")])
-(define_insn "lshrdi3"
+(define_insn "lshrdi3_iwmmxt"
[(set (match_operand:DI 0 "register_operand" "=y")
(lshiftrt:DI (match_operand:DI 1 "register_operand" "y")
(match_operand:SI 2 "register_operand" "z")))]
diff --git a/gcc/config/arm/lib1funcs.asm b/gcc/config/arm/lib1funcs.asm
index fe14070e812..ce8551abc27 100644
--- a/gcc/config/arm/lib1funcs.asm
+++ b/gcc/config/arm/lib1funcs.asm
@@ -230,6 +230,25 @@ pc .req r15
/* ------------------------------------------------------------------------ */
.macro ARM_DIV_BODY dividend, divisor, result, curbit
+#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
+
+ clz \curbit, \dividend
+ clz \result, \divisor
+ sub \curbit, \result, \curbit
+ rsbs \curbit, \curbit, #31
+ addne \curbit, \curbit, \curbit, lsl #1
+ mov \result, #0
+ addne pc, pc, \curbit, lsl #2
+ nop
+ .set shift, 32
+ .rept 32
+ .set shift, shift - 1
+ cmp \dividend, \divisor, lsl #shift
+ adc \result, \result, \result
+ subcs \dividend, \dividend, \divisor, lsl #shift
+ .endr
+
+#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
#if __ARM_ARCH__ >= 5
clz \curbit, \divisor
@@ -240,7 +259,7 @@ pc .req r15
mov \curbit, \curbit, lsl \result
mov \result, #0
-#else
+#else /* __ARM_ARCH__ < 5 */
@ Initially shift the divisor left 3 bits if possible,
@ set curbit accordingly. This allows for curbit to be located
@@ -271,7 +290,7 @@ pc .req r15
mov \result, #0
-#endif
+#endif /* __ARM_ARCH__ < 5 */
@ Division loop
1: cmp \dividend, \divisor
@@ -291,6 +310,8 @@ pc .req r15
movne \divisor, \divisor, lsr #4
bne 1b
+#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
+
.endm
/* ------------------------------------------------------------------------ */
.macro ARM_DIV2_ORDER divisor, order
@@ -325,6 +346,22 @@ pc .req r15
/* ------------------------------------------------------------------------ */
.macro ARM_MOD_BODY dividend, divisor, order, spare
+#if __ARM_ARCH__ >= 5 && ! defined (__OPTIMIZE_SIZE__)
+
+ clz \order, \divisor
+ clz \spare, \dividend
+ sub \order, \order, \spare
+ rsbs \order, \order, #31
+ addne pc, pc, \order, lsl #3
+ nop
+ .set shift, 32
+ .rept 32
+ .set shift, shift - 1
+ cmp \dividend, \divisor, lsl #shift
+ subcs \dividend, \dividend, \divisor, lsl #shift
+ .endr
+
+#else /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
#if __ARM_ARCH__ >= 5
clz \order, \divisor
@@ -332,7 +369,7 @@ pc .req r15
sub \order, \order, \spare
mov \divisor, \divisor, lsl \order
-#else
+#else /* __ARM_ARCH__ < 5 */
mov \order, #0
@@ -354,7 +391,7 @@ pc .req r15
addlo \order, \order, #1
blo 1b
-#endif
+#endif /* __ARM_ARCH__ < 5 */
@ Perform all needed substractions to keep only the reminder.
@ Do comparisons in batch of 4 first.
@@ -391,6 +428,9 @@ pc .req r15
4: cmp \dividend, \divisor
subhs \dividend, \dividend, \divisor
5:
+
+#endif /* __ARM_ARCH__ < 5 || defined (__OPTIMIZE_SIZE__) */
+
.endm
/* ------------------------------------------------------------------------ */
.macro THUMB_DIV_MOD_BODY modulo
diff --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
index f55a42562cb..a77678648d6 100644
--- a/gcc/config/arm/linux-elf.h
+++ b/gcc/config/arm/linux-elf.h
@@ -47,17 +47,18 @@
#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)"
/* Now we define the strings used to build the spec file. */
+#undef LIB_SPEC
#define LIB_SPEC \
"%{pthread:-lpthread} \
%{shared:-lc} \
%{!shared:%{profile:-lc_p}%{!profile:-lc}}"
-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc"
+#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
/* 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
- object constructed before entering `main'. */
+ object constructed before entering `main'. */
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
@@ -89,14 +90,7 @@
%{mbig-endian:-EB}" \
SUBTARGET_EXTRA_LINK_SPEC
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=posix"); \
- } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
/* This is how we tell the assembler that two symbols have the same value. */
#define ASM_OUTPUT_DEF(FILE, NAME1, NAME2) \
diff --git a/gcc/config/arm/netbsd-elf.h b/gcc/config/arm/netbsd-elf.h
index a8b43f645d3..d1661ec5fe3 100644
--- a/gcc/config/arm/netbsd-elf.h
+++ b/gcc/config/arm/netbsd-elf.h
@@ -57,14 +57,11 @@
#define SUBTARGET_EXTRA_ASM_SPEC \
"-matpcs %{fpic|fpie:-k} %{fPIC|fPIE:-k}"
-/* Default floating point model is soft-VFP.
- FIXME: -mhard-float currently implies FPA. */
+/* Default to full VFP if -mhard-float is specified. */
#undef SUBTARGET_ASM_FLOAT_SPEC
#define SUBTARGET_ASM_FLOAT_SPEC \
- "%{mhard-float:-mfpu=fpa} \
- %{msoft-float:-mfpu=softvfp} \
- %{!mhard-float: \
- %{!msoft-float:-mfpu=softvfp}}"
+ "%{mhard-float:{!mfpu=*:-mfpu=vfp}} \
+ %{mfloat-abi=hard:{!mfpu=*:-mfpu=vfp}}"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
@@ -171,3 +168,7 @@ do \
(void) sysarch (0, &s); \
} \
while (0)
+
+#undef FPUTYPE_DEFAULT
+#define FPUTYPE_DEFAULT FPUTYPE_VFP
+
diff --git a/gcc/config/arm/pe.h b/gcc/config/arm/pe.h
index bd0b6606247..7fba10b1d06 100644
--- a/gcc/config/arm/pe.h
+++ b/gcc/config/arm/pe.h
@@ -187,7 +187,7 @@
#define DRECTVE_SECTION_FUNCTION \
void \
-drectve_section () \
+drectve_section (void) \
{ \
if (in_section != in_drectve) \
{ \
@@ -203,11 +203,8 @@ drectve_section () \
ASM_DECLARE_OBJECT_NAME and then switch back to the original section
afterwards. */
#define SWITCH_TO_SECTION_FUNCTION \
-static void switch_to_section PARAMS ((enum in_section, tree)); \
static void \
-switch_to_section (section, decl) \
- enum in_section section; \
- tree decl; \
+switch_to_section (enum in_section section, tree decl) \
{ \
switch (section) \
{ \
@@ -221,3 +218,4 @@ switch_to_section (section, decl) \
default: abort (); break; \
} \
}
+
diff --git a/gcc/config/arm/semi.h b/gcc/config/arm/semi.h
index 8847f8c2369..0c9dadc208f 100644
--- a/gcc/config/arm/semi.h
+++ b/gcc/config/arm/semi.h
@@ -64,7 +64,8 @@
%{mcpu=*:-mcpu=%*} \
%{march=*:-march=%*} \
%{mapcs-float:-mfloat} \
-%{msoft-float:-mfpu=softfpa} \
+%{msoft-float:-mfloat-abi=soft} %{mhard-float:mfloat-abi=hard} \
+%{mfloat-abi=*} %{mfpu=*} \
%{mthumb-interwork:-mthumb-interwork} \
%(subtarget_extra_asm_spec)"
#endif
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
new file mode 100644
index 00000000000..a4b6bfb334d
--- /dev/null
+++ b/gcc/config/arm/vfp.md
@@ -0,0 +1,744 @@
+;; ARM VFP coprocessor Machine Description
+;; Copyright (C) 2003 Free Software Foundation, Inc.
+;; Written by CodeSourcery, LLC.
+;;
+;; 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. */
+
+;; Additional register numbers
+(define_constants
+ [(VFPCC_REGNUM 95)]
+)
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Pipeline description
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+(define_automaton "vfp11")
+
+;; There are 3 pipelines in the VFP11 unit.
+;;
+;; - A 8-stage FMAC pipeline (7 execute + writeback) with forward from
+;; fourth stage for simple operations.
+;;
+;; - A 5-stage DS pipeline (4 execute + writeback) for divide/sqrt insns.
+;; These insns also uses first execute stage of FMAC pipeline.
+;;
+;; - A 4-stage LS pipeline (execute + 2 memory + writeback) with forward from
+;; second memory stage for loads.
+
+;; We do not model Write-After-Read hazards.
+;; We do not do write scheduling with the arm core, so it is only neccessary
+;; to model the first stage of each pieline
+;; ??? Need to model LS pipeline properly for load/store multiple?
+;; We do not model fmstat properly. This could be done by modeiling pipelines
+;; properly and defining an absence set between a dummy fmstat unit and all
+;; other vfp units.
+
+(define_cpu_unit "fmac" "vfp11")
+
+(define_cpu_unit "ds" "vfp11")
+
+(define_cpu_unit "vfp_ls" "vfp11")
+
+;; The VFP "type" attributes differ from those used in the FPA model.
+;; ffarith Fast floating point insns, eg. abs, neg, cpy, cmp.
+;; farith Most arithmetic insns.
+;; fmul Double preision multiply.
+;; fdivs Single precision sqrt or division.
+;; fdivd Double precision sqrt or division.
+;; f_load Floating point load from memory.
+;; f_store Floating point store to memory.
+;; f_2_r Transfer vfp to arm reg.
+;; r_2_f Transfer arm to vfp reg.
+
+(define_insn_reservation "vfp_ffarith" 4
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "ffarith"))
+ "fmac")
+
+(define_insn_reservation "vfp_farith" 8
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "farith"))
+ "fmac")
+
+(define_insn_reservation "vfp_fmul" 9
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "fmul"))
+ "fmac*2")
+
+(define_insn_reservation "vfp_fdivs" 19
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "fdivs"))
+ "ds*15")
+
+(define_insn_reservation "vfp_fdivd" 33
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "fdivd"))
+ "fmac+ds*29")
+
+;; Moves to/from arm regs also use the load/store pipeline.
+(define_insn_reservation "vfp_fload" 4
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "f_load,r_2_f"))
+ "vfp_ls")
+
+(define_insn_reservation "vfp_fstore" 4
+ (and (eq_attr "fpu" "vfp")
+ (eq_attr "type" "f_load,f_2_r"))
+ "vfp_ls")
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Insn pattersn
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;; SImode moves
+;; ??? For now do not allow loading constants into vfp regs. This causes
+;; problems because small sonstants get converted into adds.
+(define_insn "*arm_movsi_vfp"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=r,r,r ,m,!w,r,!w,!w, U")
+ (match_operand:SI 1 "general_operand" "rI,K,mi,r,r,!w,!w,Ui,!w"))]
+ "TARGET_ARM && TARGET_VFP && TARGET_HARD_FLOAT
+ && ( s_register_operand (operands[0], SImode)
+ || s_register_operand (operands[1], SImode))"
+ "@
+ mov%?\\t%0, %1
+ mvn%?\\t%0, #%B1
+ ldr%?\\t%0, %1
+ str%?\\t%1, %0
+ fmsr%?\\t%0, %1\\t%@ int
+ fmrs%?\\t%0, %1\\t%@ int
+ fcpys%?\\t%0, %1\\t%@ int
+ flds%?\\t%0, %1\\t%@ int
+ fsts%?\\t%1, %0\\t%@ int"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "*,*,load1,store1,r_2_f,f_2_r,ffarith,f_load,f_store")
+ (set_attr "pool_range" "*,*,4096,*,*,*,*,1020,*")
+ (set_attr "neg_pool_range" "*,*,4084,*,*,*,*,1008,*")]
+)
+
+
+;; DImode moves
+
+(define_insn "*arm_movdi_vfp"
+ [(set (match_operand:DI 0 "nonimmediate_di_operand" "=r, r,o<>,w,r,w,w ,U")
+ (match_operand:DI 1 "di_operand" "rIK,mi,r ,r,w,w,Ui,w"))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "*
+ switch (which_alternative)
+ {
+ case 0: case 1: case 2:
+ return (output_move_double (operands));
+ case 3:
+ return \"fmdrr%?\\t%P0, %1\\t%@ int\";
+ case 4:
+ return \"fmrrd%?\\t%0, %1\\t%@ int\";
+ case 5:
+ return \"fcpyd%?\\t%P0, %P1\\t%@ int\";
+ case 6:
+ return \"fldd%?\\t%P0, %1\\t%@ int\";
+ case 7:
+ return \"fstd%?\\t%P1, %0\\t%@ int\";
+ default:
+ abort ();
+ }
+ "
+ [(set_attr "type" "*,load2,store2,r_2_f,f_2_r,ffarith,f_load,f_store")
+ (set_attr "length" "8,8,8,4,4,4,4,4")
+ (set_attr "pool_range" "*,1020,*,*,*,*,1020,*")
+ (set_attr "neg_pool_range" "*,1008,*,*,*,*,1008,*")]
+)
+
+
+;; SFmode moves
+
+(define_insn "*movsf_vfp"
+ [(set (match_operand:SF 0 "nonimmediate_operand" "=w,r,w ,U,r ,m,w,r")
+ (match_operand:SF 1 "general_operand" " r,w,UE,w,mE,r,w,r"))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP
+ && ( s_register_operand (operands[0], SFmode)
+ || s_register_operand (operands[1], SFmode))"
+ "@
+ fmsr%?\\t%0, %1
+ fmrs%?\\t%0, %1
+ flds%?\\t%0, %1
+ fsts%?\\t%1, %0
+ ldr%?\\t%0, %1\\t%@ float
+ str%?\\t%1, %0\\t%@ float
+ fcpys%?\\t%0, %1
+ mov%?\\t%0, %1\\t%@ float"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "r_2_f,f_2_r,ffarith,*,f_load,f_store,load1,store1")
+ (set_attr "pool_range" "*,*,1020,*,4096,*,*,*")
+ (set_attr "neg_pool_range" "*,*,1008,*,4080,*,*,*")]
+)
+
+
+;; DFmode moves
+
+(define_insn "*movdf_vfp"
+ [(set (match_operand:DF 0 "nonimmediate_soft_df_operand" "=w,r,r, m,w ,U,w,r")
+ (match_operand:DF 1 "soft_df_operand" " r,w,mF,r,UF,w,w,r"))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "*
+ {
+ switch (which_alternative)
+ {
+ case 0:
+ return \"fmdrr%?\\t%P0, %Q1, %R1\";
+ case 1:
+ return \"fmrrd%?\\t%Q0, %R0, %P1\";
+ case 2: case 3: case 7:
+ return output_move_double (operands);
+ case 4:
+ return \"fldd%?\\t%P0, %1\";
+ case 5:
+ return \"fstd%?\\t%P1, %0\";
+ case 6:
+ return \"fcpyd%?\\t%P0, %P1\";
+ default:
+ abort ();
+ }
+ }
+ "
+ [(set_attr "type" "r_2_f,f_2_r,ffarith,*,load2,store2,f_load,f_store")
+ (set_attr "length" "4,4,8,8,4,4,4,8")
+ (set_attr "pool_range" "*,*,1020,*,1020,*,*,*")
+ (set_attr "neg_pool_range" "*,*,1008,*,1008,*,*,*")]
+)
+
+
+;; Conditional move patterns
+
+(define_insn "*movsfcc_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
+ (if_then_else:SF
+ (match_operator 3 "arm_comparison_operator"
+ [(match_operand 4 "cc_register" "") (const_int 0)])
+ (match_operand:SF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
+ (match_operand:SF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcpys%D3\\t%0, %2
+ fcpys%d3\\t%0, %1
+ fcpys%D3\\t%0, %2\;fcpys%d3\\t%0, %1
+ fmsr%D3\\t%0, %2
+ fmsr%d3\\t%0, %1
+ fmsr%D3\\t%0, %2\;fmsr%d3\\t%0, %1
+ fmrs%D3\\t%0, %2
+ fmrs%d3\\t%0, %1
+ fmrs%D3\\t%0, %2\;fmrs%d3\\t%0, %1"
+ [(set_attr "conds" "use")
+ (set_attr "length" "4,4,8,4,4,8,4,4,8")
+ (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
+)
+
+(define_insn "*movdfcc_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w,w,w,w,w,w,?r,?r,?r")
+ (if_then_else:DF
+ (match_operator 3 "arm_comparison_operator"
+ [(match_operand 4 "cc_register" "") (const_int 0)])
+ (match_operand:DF 1 "s_register_operand" "0,w,w,0,?r,?r,0,w,w")
+ (match_operand:DF 2 "s_register_operand" "w,0,w,?r,0,?r,w,0,w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcpyd%D3\\t%P0, %P2
+ fcpyd%d3\\t%P0, %P1
+ fcpyd%D3\\t%P0, %P2\;fcpyd%d3\\t%P0, %P1
+ fmdrr%D3\\t%P0, %Q2, %R2
+ fmdrr%d3\\t%P0, %Q1, %R1
+ fmdrr%D3\\t%P0, %Q2, %R2\;fmdrr%d3\\t%P0, %Q1, %R1
+ fmrrd%D3\\t%Q0, %R0, %P2
+ fmrrd%d3\\t%Q0, %R0, %P1
+ fmrrd%D3\\t%Q0, %R0, %P2\;fmrrd%d3\\t%Q0, %R0, %P1"
+ [(set_attr "conds" "use")
+ (set_attr "length" "4,4,8,4,4,8,4,4,8")
+ (set_attr "type" "ffarith,ffarith,ffarith,r_2_f,r_2_f,r_2_f,f_2_r,f_2_r,f_2_r")]
+)
+
+
+;; Sign manipulation functions
+
+(define_insn "*abssf2_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (abs:SF (match_operand:SF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fabss%?\\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*absdf2_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (abs:DF (match_operand:DF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fabsd%?\\t%P0, %P1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*negsf2_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "+w")
+ (neg:SF (match_operand:SF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnegs%?\\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*negdf2_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "+w")
+ (neg:DF (match_operand:DF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnegd%?\\t%P0, %P1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+
+;; Arithmetic insns
+
+(define_insn "*addsf3_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (plus:SF (match_operand:SF 1 "s_register_operand" "w")
+ (match_operand:SF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fadds%?\\t%0, %1, %2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*adddf3_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (plus:DF (match_operand:DF 1 "s_register_operand" "w")
+ (match_operand:DF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "faddd%?\\t%P0, %P1, %P2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+
+(define_insn "*subsf3_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (minus:SF (match_operand:SF 1 "s_register_operand" "w")
+ (match_operand:SF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsubs%?\\t%0, %1, %2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*subdf3_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (minus:DF (match_operand:DF 1 "s_register_operand" "w")
+ (match_operand:DF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsubd%?\\t%P0, %P1, %P2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+
+;; Division insns
+
+(define_insn "*divsf3_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "+w")
+ (div:SF (match_operand:SF 1 "s_register_operand" "w")
+ (match_operand:SF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fdivs%?\\t%0, %1, %2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fdivs")]
+)
+
+(define_insn "*divdf3_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "+w")
+ (div:DF (match_operand:DF 1 "s_register_operand" "w")
+ (match_operand:DF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fdivd%?\\t%P0, %P1, %P2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fdivd")]
+)
+
+
+;; Multiplication insns
+
+(define_insn "*mulsf3_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "+w")
+ (mult:SF (match_operand:SF 1 "s_register_operand" "w")
+ (match_operand:SF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmuls%?\\t%0, %1, %2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*muldf3_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "+w")
+ (mult:DF (match_operand:DF 1 "s_register_operand" "w")
+ (match_operand:DF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmuld%?\\t%P0, %P1, %P2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+
+(define_insn "*mulsf3negsf_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "+w")
+ (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "w"))
+ (match_operand:SF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmuls%?\\t%0, %1, %2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*muldf3negdf_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "+w")
+ (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w"))
+ (match_operand:DF 2 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmuld%?\\t%P0, %P1, %P2"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+
+;; Multiply-accumulate insns
+
+;; 0 = 1 * 2 + 0
+(define_insn "*mulsf3addsf_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (plus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w")
+ (match_operand:SF 3 "s_register_operand" "w"))
+ (match_operand:SF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmacs%?\\t%0, %2, %3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*muldf3adddf_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (plus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
+ (match_operand:DF 3 "s_register_operand" "w"))
+ (match_operand:DF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmacd%?\\t%P0, %P2, %P3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+;; 0 = 1 * 2 - 0
+(define_insn "*mulsf3subsf_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (minus:SF (mult:SF (match_operand:SF 2 "s_register_operand" "w")
+ (match_operand:SF 3 "s_register_operand" "w"))
+ (match_operand:SF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmscs%?\\t%0, %2, %3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*muldf3subdf_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (minus:DF (mult:DF (match_operand:DF 2 "s_register_operand" "w")
+ (match_operand:DF 3 "s_register_operand" "w"))
+ (match_operand:DF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmscd%?\\t%P0, %P2, %P3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+;; 0 = -(1 * 2) + 0
+(define_insn "*mulsf3negsfaddsf_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (minus:SF (match_operand:SF 1 "s_register_operand" "0")
+ (mult:SF (match_operand:SF 2 "s_register_operand" "w")
+ (match_operand:SF 3 "s_register_operand" "w"))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmacs%?\\t%0, %2, %3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*fmuldf3negdfadddf_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (minus:DF (match_operand:DF 1 "s_register_operand" "0")
+ (mult:DF (match_operand:DF 2 "s_register_operand" "w")
+ (match_operand:DF 3 "s_register_operand" "w"))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmacd%?\\t%P0, %P2, %P3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+
+;; 0 = -(1 * 2) - 0
+(define_insn "*mulsf3negsfsubsf_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (minus:SF (mult:SF
+ (neg:SF (match_operand:SF 2 "s_register_operand" "w"))
+ (match_operand:SF 3 "s_register_operand" "w"))
+ (match_operand:SF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmscs%?\\t%0, %2, %3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*muldf3negdfsubdf_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (minus:DF (mult:DF
+ (neg:DF (match_operand:DF 2 "s_register_operand" "w"))
+ (match_operand:DF 3 "s_register_operand" "w"))
+ (match_operand:DF 1 "s_register_operand" "0")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fnmscd%?\\t%P0, %P2, %P3"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fmul")]
+)
+
+
+;; Conversion routines
+
+(define_insn "*extendsfdf2_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (float_extend:DF (match_operand:SF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fcvtds%?\\t%P0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*truncdfsf2_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (float_truncate:SF (match_operand:DF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fcvtsd%?\\t%0, %P1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*truncsisf2_vfp"
+ [(set (match_operand:SI 0 "s_register_operand" "=w")
+ (fix:SI (fix:SF (match_operand:SF 1 "s_register_operand" "w"))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "ftosizs%?\\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*truncsidf2_vfp"
+ [(set (match_operand:SI 0 "s_register_operand" "=w")
+ (fix:SI (fix:DF (match_operand:DF 1 "s_register_operand" "w"))))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "ftosizd%?\\t%0, %P1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*floatsisf2_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (float:SF (match_operand:SI 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsitos%?\\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+(define_insn "*floatsidf2_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (float:DF (match_operand:SI 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsitod%?\\t%P0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "farith")]
+)
+
+
+;; Sqrt insns.
+
+(define_insn "*sqrtsf2_vfp"
+ [(set (match_operand:SF 0 "s_register_operand" "=w")
+ (sqrt:SF (match_operand:SF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsqrts%?\\t%0, %1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fdivs")]
+)
+
+(define_insn "*sqrtdf2_vfp"
+ [(set (match_operand:DF 0 "s_register_operand" "=w")
+ (sqrt:DF (match_operand:DF 1 "s_register_operand" "w")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fsqrtd%?\\t%P0, %P1"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "fdivd")]
+)
+
+
+;; Patterns to split/copy vfp condition flags.
+
+(define_insn "*movcc_vfp"
+ [(set (reg CC_REGNUM)
+ (reg VFPCC_REGNUM))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "fmstat%?"
+ [(set_attr "conds" "set")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn_and_split "*cmpsf_split_vfp"
+ [(set (reg:CCFP CC_REGNUM)
+ (compare:CCFP (match_operand:SF 0 "s_register_operand" "w")
+ (match_operand:SF 1 "vfp_compare_operand" "wG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "#"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ [(set (reg:CCFP VFPCC_REGNUM)
+ (compare:CCFP (match_dup 0)
+ (match_dup 1)))
+ (set (reg:CCFP CC_REGNUM)
+ (reg:CCFP VFPCC_REGNUM))]
+ ""
+)
+
+(define_insn_and_split "*cmpsf_trap_split_vfp"
+ [(set (reg:CCFPE CC_REGNUM)
+ (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w")
+ (match_operand:SF 1 "vfp_compare_operand" "wG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "#"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ [(set (reg:CCFPE VFPCC_REGNUM)
+ (compare:CCFPE (match_dup 0)
+ (match_dup 1)))
+ (set (reg:CCFPE CC_REGNUM)
+ (reg:CCFPE VFPCC_REGNUM))]
+ ""
+)
+
+(define_insn_and_split "*cmpdf_split_vfp"
+ [(set (reg:CCFP CC_REGNUM)
+ (compare:CCFP (match_operand:DF 0 "s_register_operand" "w")
+ (match_operand:DF 1 "vfp_compare_operand" "wG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "#"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ [(set (reg:CCFP VFPCC_REGNUM)
+ (compare:CCFP (match_dup 0)
+ (match_dup 1)))
+ (set (reg:CCFP CC_REGNUM)
+ (reg:CCFPE VFPCC_REGNUM))]
+ ""
+)
+
+(define_insn_and_split "*cmpdf_trap_split_vfp"
+ [(set (reg:CCFPE CC_REGNUM)
+ (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w")
+ (match_operand:DF 1 "vfp_compare_operand" "wG")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "#"
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ [(set (reg:CCFPE VFPCC_REGNUM)
+ (compare:CCFPE (match_dup 0)
+ (match_dup 1)))
+ (set (reg:CCFPE CC_REGNUM)
+ (reg:CCFPE VFPCC_REGNUM))]
+ ""
+)
+
+
+;; Comparison patterns
+
+(define_insn "*cmpsf_vfp"
+ [(set (reg:CCFP VFPCC_REGNUM)
+ (compare:CCFP (match_operand:SF 0 "s_register_operand" "w,w")
+ (match_operand:SF 1 "vfp_compare_operand" "w,G")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcmps%?\\t%0, %1
+ fcmpzs%?\\t%0"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*cmpsf_trap_vfp"
+ [(set (reg:CCFPE VFPCC_REGNUM)
+ (compare:CCFPE (match_operand:SF 0 "s_register_operand" "w,w")
+ (match_operand:SF 1 "vfp_compare_operand" "w,G")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcmpes%?\\t%0, %1
+ fcmpezs%?\\t%0"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*cmpdf_vfp"
+ [(set (reg:CCFP VFPCC_REGNUM)
+ (compare:CCFP (match_operand:DF 0 "s_register_operand" "w,w")
+ (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcmpd%?\\t%P0, %P1
+ fcmpzd%?\\t%P0"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+(define_insn "*cmpdf_trap_vfp"
+ [(set (reg:CCFPE VFPCC_REGNUM)
+ (compare:CCFPE (match_operand:DF 0 "s_register_operand" "w,w")
+ (match_operand:DF 1 "vfp_compare_operand" "w,G")))]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "@
+ fcmped%?\\t%P0, %P1
+ fcmpezd%?\\t%P0"
+ [(set_attr "predicable" "yes")
+ (set_attr "type" "ffarith")]
+)
+
+
+;; Store multiple insn used in function prologue.
+
+(define_insn "*push_multi_vfp"
+ [(match_parallel 2 "multi_register_push"
+ [(set (match_operand:BLK 0 "memory_operand" "=m")
+ (unspec:BLK [(match_operand:DF 1 "s_register_operand" "w")]
+ UNSPEC_PUSH_MULT))])]
+ "TARGET_ARM && TARGET_HARD_FLOAT && TARGET_VFP"
+ "* return vfp_output_fstmx (operands);"
+ [(set_attr "type" "f_store")]
+)
+
+
+;; Unimplemented insns:
+;; fldm*
+;; fstm*
+;; fmdhr et al (VFPv1)
+;; Support for xD (single precisio only) variants.
+;; fmrrs, fmsrr
+;; fuito*
+;; ftoui*
diff --git a/gcc/config/arm/vxworks.h b/gcc/config/arm/vxworks.h
index a5a6a09f6e8..afe6b7043be 100644
--- a/gcc/config/arm/vxworks.h
+++ b/gcc/config/arm/vxworks.h
@@ -68,7 +68,7 @@ Boston, MA 02111-1307, USA. */
#define LIB_SPEC ""
/* VxWorks uses object files, not loadable images. make linker just
- combine objects. */
+ combine objects. */
#undef LINK_SPEC
#define LINK_SPEC "-r"
diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c
index a7a71871552..216ec863ba8 100644
--- a/gcc/config/avr/avr.c
+++ b/gcc/config/avr/avr.c
@@ -39,6 +39,7 @@
#include "obstack.h"
#include "function.h"
#include "recog.h"
+#include "ggc.h"
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
@@ -77,18 +78,14 @@ static int default_rtx_costs (rtx, enum rtx_code, enum rtx_code);
static bool avr_rtx_costs (rtx, int, int, int *);
static int avr_address_cost (rtx);
-/* Allocate registers from r25 to r8 for parameters for function calls */
+/* Allocate registers from r25 to r8 for parameters for function calls. */
#define FIRST_CUM_REG 26
/* Temporary register RTX (gen_rtx (REG,QImode,TMP_REGNO)) */
-rtx tmp_reg_rtx;
+static GTY(()) rtx tmp_reg_rtx;
/* Zeroed register RTX (gen_rtx (REG,QImode,ZERO_REGNO)) */
-rtx zero_reg_rtx;
-
-/* RTX for register which will be used for loading immediate values to
- r0-r15 registers. */
-rtx ldi_reg_rtx;
+static GTY(()) rtx zero_reg_rtx;
/* AVR register names {"r0", "r1", ..., "r31"} */
static const char *const avr_regnames[] = REGISTER_NAMES;
@@ -274,31 +271,12 @@ avr_override_options (void)
if (optimize && !TARGET_NO_TABLEJUMP)
avr_case_values_threshold = (!AVR_MEGA || TARGET_CALL_PROLOGUES) ? 8 : 17;
-}
-#if 0 /* Does not play nice with GC. FIXME. */
-/* Initialize TMP_REG_RTX and ZERO_REG_RTX */
-void
-avr_init_once (void)
-{
- tmp_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- PUT_CODE (tmp_reg_rtx, REG);
- PUT_MODE (tmp_reg_rtx, QImode);
- XINT (tmp_reg_rtx, 0) = TMP_REGNO;
-
- zero_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- PUT_CODE (zero_reg_rtx, REG);
- PUT_MODE (zero_reg_rtx, QImode);
- XINT (zero_reg_rtx, 0) = ZERO_REGNO;
-
- ldi_reg_rtx = xcalloc (1, sizeof (struct rtx_def) + 1 * sizeof (rtunion));
- PUT_CODE (ldi_reg_rtx, REG);
- PUT_MODE (ldi_reg_rtx, QImode);
- XINT (ldi_reg_rtx, 0) = LDI_REG_REGNO;
+ tmp_reg_rtx = gen_rtx_REG (QImode, TMP_REGNO);
+ zero_reg_rtx = gen_rtx_REG (QImode, ZERO_REGNO);
}
-#endif
-/* return register class from register number */
+/* return register class from register number. */
static const int reg_class_tab[]={
GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,GENERAL_REGS,
@@ -314,7 +292,7 @@ static const int reg_class_tab[]={
STACK_REG,STACK_REG /* SPL,SPH */
};
-/* Return register class for register R */
+/* Return register class for register R. */
enum reg_class
avr_regno_reg_class (int r)
@@ -437,7 +415,7 @@ avr_regs_to_save (HARD_REG_SET *set)
return count;
}
-/* Compute offset between arg_pointer and frame_pointer */
+/* Compute offset between arg_pointer and frame_pointer. */
int
initial_elimination_offset (int from, int to)
@@ -468,7 +446,7 @@ avr_simple_epilogue (void)
&& ! TREE_THIS_VOLATILE (current_function_decl));
}
-/* This function checks sequence of live registers */
+/* This function checks sequence of live registers. */
static int
sequent_regs_live (void)
@@ -625,7 +603,7 @@ out_set_stack_ptr (FILE *file, int before, int after)
}
-/* Output function prologue */
+/* Output function prologue. */
static void
avr_output_function_prologue (FILE *file, HOST_WIDE_INT size)
@@ -755,7 +733,7 @@ avr_output_function_prologue (FILE *file, HOST_WIDE_INT size)
fprintf (file, "/* prologue end (size=%d) */\n", prologue_size);
}
-/* Output function epilogue */
+/* Output function epilogue. */
static void
avr_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
@@ -1002,7 +980,7 @@ legitimize_address (rtx x, rtx oldx, enum machine_mode mode)
}
-/* Return a pointer register name as a string */
+/* Return a pointer register name as a string. */
static const char *
ptrreg_to_str (int regno)
@@ -1049,7 +1027,7 @@ cond_string (enum rtx_code code)
}
}
-/* Output ADDR to FILE as address */
+/* Output ADDR to FILE as address. */
void
print_operand_address (FILE *file, rtx addr)
@@ -1083,7 +1061,7 @@ print_operand_address (FILE *file, rtx addr)
}
-/* Output X as assembler operand to file FILE */
+/* Output X as assembler operand to file FILE. */
void
print_operand (FILE *file, rtx x, int code)
@@ -1154,7 +1132,7 @@ print_operand (FILE *file, rtx x, int code)
print_operand_address (file, x);
}
-/* Recognize operand OP of mode MODE used in call instructions */
+/* Recognize operand OP of mode MODE used in call instructions. */
int
call_insn_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
@@ -1476,7 +1454,7 @@ avr_num_arg_regs (enum machine_mode mode, tree type)
}
/* Controls whether a function argument is passed
- in a register, and which register. */
+ in a register, and which register. */
rtx
function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
@@ -2614,7 +2592,7 @@ out_movhi_mr_r (rtx insn, rtx op[], int *l)
return "";
}
-/* Return 1 if frame pointer for current function required */
+/* Return 1 if frame pointer for current function required. */
int
frame_pointer_required_p (void)
@@ -2670,7 +2648,7 @@ compare_eq_p (rtx insn)
}
-/* Output test instruction for HImode */
+/* Output test instruction for HImode. */
const char *
out_tsthi (rtx insn, int *l)
@@ -2683,7 +2661,7 @@ out_tsthi (rtx insn, int *l)
if (reg_unused_after (insn, SET_SRC (PATTERN (insn)))
&& compare_eq_p (insn))
{
- /* faster than sbiw if we can clobber the operand */
+ /* Faster than sbiw if we can clobber the operand. */
if (l) *l = 1;
return AS2 (or,%A0,%B0);
}
@@ -2698,7 +2676,7 @@ out_tsthi (rtx insn, int *l)
}
-/* Output test instruction for SImode */
+/* Output test instruction for SImode. */
const char *
out_tstsi (rtx insn, int *l)
@@ -4237,7 +4215,7 @@ adjust_insn_length (rtx insn, int len)
return len;
}
-/* Return nonzero if register REG dead after INSN */
+/* Return nonzero if register REG dead after INSN. */
int
reg_unused_after (rtx insn, rtx reg)
@@ -4368,7 +4346,7 @@ avr_assemble_integer (rtx x, unsigned int size, int aligned_p)
return default_assemble_integer (x, size, aligned_p);
}
-/* Sets section name for declaration DECL */
+/* Sets section name for declaration DECL. */
static void
avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
@@ -4405,7 +4383,7 @@ avr_unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
generated assembly code more compact (and thus faster to assemble)
as well as more readable, especially for targets like the i386
(where the only alternative is to output character sequences as
- comma separated lists of numbers). */
+ comma separated lists of numbers). */
void
gas_output_limited_string(FILE *file, const char *str)
@@ -4860,7 +4838,7 @@ avr_rtx_costs (rtx x, int code, int outer_code, int *total)
}
}
-/* Calculate the cost of a memory address */
+/* Calculate the cost of a memory address. */
static int
avr_address_cost (rtx x)
@@ -4925,7 +4903,7 @@ extra_constraint (rtx x, int c)
return 0;
}
-/* Convert condition code CONDITION to the valid AVR condition code */
+/* Convert condition code CONDITION to the valid AVR condition code. */
RTX_CODE
avr_normalize_condition (RTX_CODE condition)
@@ -4970,7 +4948,7 @@ avr_reorg (void)
{
if (GET_CODE (SET_SRC (pattern)) == COMPARE)
{
- /* Now we work under compare insn */
+ /* Now we work under compare insn. */
pattern = SET_SRC (pattern);
if (true_regnum (XEXP (pattern,0)) >= 0
@@ -5389,3 +5367,4 @@ avr_asm_out_dtor (rtx symbol, int priority)
default_dtor_section_asm_out_destructor (symbol, priority);
}
+#include "gt-avr.h"
diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h
index 735e75d3b63..0d5cd7c145c 100644
--- a/gcc/config/avr/avr.h
+++ b/gcc/config/avr/avr.h
@@ -20,7 +20,7 @@ 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. */
-/* Names to predefine in the preprocessor for this target machine. */
+/* Names to predefine in the preprocessor for this target machine. */
#define TARGET_CPU_CPP_BUILTINS() \
do \
@@ -41,7 +41,7 @@ Boston, MA 02111-1307, USA. */
} \
while (0)
-/* This declaration should be present. */
+/* This declaration should be present. */
extern int target_flags;
#define MASK_ALL_DEBUG 0x00000FE0
@@ -130,10 +130,10 @@ extern int avr_asm_only_p;
frame pointer. If this macro is defined, GCC will turn on the
`-fomit-frame-pointer' option whenever `-O' is specified. */
-/* Define this if most significant byte of a word is the lowest numbered. */
+/* Define this if most significant byte of a word is the lowest numbered. */
#define BITS_BIG_ENDIAN 0
-/* Define this if most significant byte of a word is the lowest numbered. */
+/* Define this if most significant byte of a word is the lowest numbered. */
#define BYTES_BIG_ENDIAN 0
/* Define this if most significant word of a multiword number is the lowest
@@ -144,7 +144,7 @@ extern int avr_asm_only_p;
/* This is to get correct SI and DI modes in libgcc2.c (32 and 64 bits). */
#define UNITS_PER_WORD 4
#else
-/* Width of a word, in units (bytes). */
+/* Width of a word, in units (bytes). */
#define UNITS_PER_WORD 1
#endif
@@ -157,16 +157,16 @@ extern int avr_asm_only_p;
DImode or Dfmode ... */
#define MAX_FIXED_MODE_SIZE 32
-/* Allocation boundary (in *bits*) for storing arguments in argument list. */
+/* Allocation boundary (in *bits*) for storing arguments in argument list. */
#define PARM_BOUNDARY 8
-/* Allocation boundary (in *bits*) for the code of a function. */
+/* Allocation boundary (in *bits*) for the code of a function. */
#define FUNCTION_BOUNDARY 8
-/* Alignment of field after `int : 0' in a structure. */
+/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 8
-/* No data type wants to be aligned rounder than this. */
+/* No data type wants to be aligned rounder than this. */
#define BIGGEST_ALIGNMENT 8
@@ -211,7 +211,7 @@ extern int avr_asm_only_p;
#define DOUBLE_TYPE_SIZE 32
/* A C expression for the size in bits of the type `double' on the
target machine. If you don't define this, the default is two
- words. */
+ words. */
#define LONG_DOUBLE_TYPE_SIZE 32
@@ -366,7 +366,7 @@ extern int avr_asm_only_p;
registers must always be saved and the save-multiple-registers
instruction supports only sequences of consecutive registers. On
such machines, define `REG_ALLOC_ORDER' to be an initializer that
- lists the highest numbered allocatable register first. */
+ lists the highest numbered allocatable register first. */
#define ORDER_REGS_FOR_LOCAL_ALLOC order_regs_for_local_alloc ()
/* ORDER_REGS_FOR_LOCAL_ALLOC'
@@ -1147,7 +1147,7 @@ typedef struct avr_args {
contains the name of the function, as a string. LIBNAME is 0 when
an ordinary C function call is being processed. Thus, each time
this macro is called, either LIBNAME or FNTYPE is nonzero, but
- never both of them at once. */
+ never both of them at once. */
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
(function_arg_advance (&CUM, MODE, TYPE, NAMED))
@@ -1160,7 +1160,7 @@ typedef struct avr_args {
This macro need not do anything if the argument in question was
passed on the stack. The compiler knows how to track the amount
- of stack space used for arguments without any special help. */
+ of stack space used for arguments without any special help. */
#define FUNCTION_ARG_REGNO_P(r) function_arg_regno_p(r)
/* A C expression that is nonzero if REGNO is the number of a hard
@@ -1644,7 +1644,7 @@ do { \
#define EXTRA_SECTION_FUNCTIONS \
\
void \
-progmem_section () \
+progmem_section (void) \
{ \
if (in_section != in_progmem) \
{ \
@@ -2482,11 +2482,4 @@ extern int avr_case_values_threshold;
/* zero register r1 */
#define ZERO_REGNO 1
-/* Temporary register which used for load immediate values to r0-r15 */
-#define LDI_REG_REGNO 31
-
-extern struct rtx_def *tmp_reg_rtx;
-extern struct rtx_def *zero_reg_rtx;
-extern struct rtx_def *ldi_reg_rtx;
-
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/gcc/config/avr/avr.md b/gcc/config/avr/avr.md
index ab7b0ed4783..e253e38a717 100644
--- a/gcc/config/avr/avr.md
+++ b/gcc/config/avr/avr.md
@@ -178,7 +178,7 @@
[(set (match_operand:QI 0 "nonimmediate_operand" "")
(match_operand:QI 1 "general_operand" ""))]
""
- "/* One of the ops has to be in a register */
+ "/* One of the ops has to be in a register. */
if (!register_operand(operand0, QImode)
&& ! (register_operand(operand1, QImode) || const0_rtx == operand1))
operands[1] = copy_to_mode_reg(QImode, operand1);
@@ -226,7 +226,7 @@
""
"
{
- /* One of the ops has to be in a register */
+ /* One of the ops has to be in a register. */
if (!register_operand(operand0, HImode)
&& !(register_operand(operand1, HImode) || const0_rtx == operands[1]))
{
diff --git a/gcc/config/c4x/c4x.c b/gcc/config/c4x/c4x.c
index 7fb5a337b41..9eaa87194d2 100644
--- a/gcc/config/c4x/c4x.c
+++ b/gcc/config/c4x/c4x.c
@@ -1088,7 +1088,7 @@ c4x_expand_epilogue(void)
dont_pop_ar3 = 0; /* If we use ar3, we need to pop it. */
if (size || current_function_args_size)
{
- /* If we are ommitting the frame pointer, we still have
+ /* If we are omitting the frame pointer, we still have
to make space for it so the offsets are correct
unless we don't use anything on the stack at all. */
size += 1;
diff --git a/gcc/config/c4x/c4x.md b/gcc/config/c4x/c4x.md
index 5755177454a..e4f240fea4f 100644
--- a/gcc/config/c4x/c4x.md
+++ b/gcc/config/c4x/c4x.md
@@ -157,7 +157,7 @@
; a register satisying the 'f' constraint is used as a dst operand,
; the CC gets clobbered (except for LDFcond).
-; The ! in front of the 'b' constaint says to GCC to disparage the
+; The ! in front of the 'b' constraint says to GCC to disparage the
; use of this constraint. The 'b' constraint applies only to the SP.
; Note that we deal with the condition code CC like some of the RISC
@@ -173,7 +173,7 @@
; delayed branch slots.
; Since the C[34]x has many instructions that set the CC, we pay the
-; price of having to explicity define which insns clobber the CC
+; price of having to explicitly define which insns clobber the CC
; (rather than using the macro NOTICE_UPDATE_CC).
; Note that many patterns say that the CC is clobbered when in fact
@@ -6265,7 +6265,7 @@
;
; MULF
;
-; The C3x MPYF only uses 24 bit precision while the C4x uses 32 bit precison.
+; The C3x MPYF only uses 24-bit precision while the C4x uses 32-bit precision.
;
(define_expand "mulhf3"
[(parallel [(set (match_operand:HF 0 "reg_operand" "=h")
@@ -7320,7 +7320,7 @@
"stf\\t%1,*%0++\\n\\tstf\\t%2,*%0++")
-; The following two peepholes remove an unecessary load
+; The following two peepholes remove an unnecessary load
; often found at the end of a function. These peepholes
; could be generalized to other binary operators. They shouldn't
; be required if we run a post reload mop-up pass.
diff --git a/gcc/config/cris/cris.h b/gcc/config/cris/cris.h
index 288be199713..69483fae1fd 100644
--- a/gcc/config/cris/cris.h
+++ b/gcc/config/cris/cris.h
@@ -251,13 +251,15 @@ extern const char *cris_elinux_stacksize_str;
builtin_define_std ("CRIS"); \
builtin_define_std ("GNU_CRIS"); \
builtin_define ("__CRIS_ABI_version=2"); \
+ builtin_assert ("cpu=cris"); \
+ builtin_assert ("machine=cris"); \
} \
while (0)
/* This needs to be at least 32 bits. */
extern int target_flags;
-/* Currently this just affects aligment. FIXME: Redundant with
+/* Currently this just affects alignment. FIXME: Redundant with
TARGET_ALIGN_BY_32, or put machine stuff here? */
#define TARGET_MASK_SVINTO 1
#define TARGET_SVINTO (target_flags & TARGET_MASK_SVINTO)
@@ -848,7 +850,7 @@ enum reg_class {NO_REGS, ALL_REGS, LIM_REG_CLASSES};
/* If we would ever need an exact mapping between canonical register
number and dwarf frame register, we would either need to include all
- registers in the gcc decription (with some marked fixed of course), or
+ registers in the gcc description (with some marked fixed of course), or
an inverse mapping from dwarf register to gcc register. There is one
need in dwarf2out.c:expand_builtin_init_dwarf_reg_sizes. Right now, I
don't see that we need exact correspondence between DWARF *frame*
diff --git a/gcc/config/cris/cris.md b/gcc/config/cris/cris.md
index ea347fd74fa..8fb07039f04 100644
--- a/gcc/config/cris/cris.md
+++ b/gcc/config/cris/cris.md
@@ -31,7 +31,7 @@
;; There are several instructions that are orthogonal in size, and seems
;; they could be matched by a single pattern without a specified size
;; for the operand that is orthogonal. However, this did not work on
-;; gcc-2.7.2 (and problably not on gcc-2.8.1), relating to that when a
+;; gcc-2.7.2 (and probably not on gcc-2.8.1), relating to that when a
;; constant is substituted into an operand, the actual mode must be
;; deduced from the pattern. There is reasonable hope that that has been
;; fixed, so FIXME: try again.
@@ -77,7 +77,7 @@
;; The possible values are "yes", "no" and "has_slot". Yes/no means if
;; the insn is slottable or not. Has_slot means that the insn is a
;; return insn or branch insn (which are not considered slottable since
-;; that is generally true). Having the semmingly illogical value
+;; that is generally true). Having the seemingly illogical value
;; "has_slot" means we do not have to add another attribute just to say
;; that an insn has a delay-slot, since it also infers that it is not
;; slottable. Better names for the attribute were found to be longer and
@@ -1354,7 +1354,7 @@
"movs.b %1,%0"
[(set_attr "slottable" "yes,yes,no")])
-;; To do a byte->word exension, extend to dword, exept that the top half
+;; To do a byte->word extension, extend to dword, exept that the top half
;; of the register will be clobbered. FIXME: Perhaps this is not needed.
(define_insn "extendqihi2"
diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
index 288c2856ee6..f842f949d64 100644
--- a/gcc/config/cris/linux.h
+++ b/gcc/config/cris/linux.h
@@ -48,9 +48,7 @@ Boston, MA 02111-1307, USA. */
#undef CRIS_CPP_SUBTARGET_SPEC
#define CRIS_CPP_SUBTARGET_SPEC \
"%{pthread:-D_REENTRANT}\
- %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}\
- %{!ansi:%{!std=*:%{!undef:-Dlinux -Dunix}\
- -Asystem(unix) -Asystem(posix) -Acpu(cris) -Amachine(cris)}}"
+ %{!march=*:%{!cpu=*:-D__arch_v10 -D__CRIS_arch_version=10}}"
#undef CRIS_CC1_SUBTARGET_SPEC
#define CRIS_CC1_SUBTARGET_SPEC \
@@ -103,9 +101,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__gnu_linux__"); \
- builtin_define ("__linux__"); \
- builtin_define ("__unix__"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/d30v/d30v-protos.h b/gcc/config/d30v/d30v-protos.h
index 7ce90afbfbb..1f93f3b38b8 100644
--- a/gcc/config/d30v/d30v-protos.h
+++ b/gcc/config/d30v/d30v-protos.h
@@ -21,119 +21,112 @@ Boston, MA 02111-1307, USA. */
/* External functions called. */
-extern void override_options PARAMS ((void));
+extern void override_options (void);
#ifdef RTX_CODE
-extern int short_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int long_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int d30v_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int single_reg_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int const_addr_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int call_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_operand PARAMS ((rtx, enum machine_mode));
-extern int accum_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_accum_operand PARAMS ((rtx, enum machine_mode));
-extern int cr_operand PARAMS ((rtx, enum machine_mode));
-extern int repeat_operand PARAMS ((rtx, enum machine_mode));
-extern int flag_operand PARAMS ((rtx, enum machine_mode));
-extern int br_flag_operand PARAMS ((rtx, enum machine_mode));
-extern int br_flag_or_constant_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_br_flag_operand PARAMS ((rtx, enum machine_mode));
-extern int f0_operand PARAMS ((rtx, enum machine_mode));
-extern int f1_operand PARAMS ((rtx, enum machine_mode));
-extern int carry_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_signed6_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_unsigned5_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_unsigned6_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_constant_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_dbl_const_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int move_input_operand PARAMS ((rtx, enum machine_mode));
-extern int move_output_operand PARAMS ((rtx, enum machine_mode));
-extern int signed6_operand PARAMS ((rtx, enum machine_mode));
-extern int unsigned5_operand PARAMS ((rtx, enum machine_mode));
-extern int unsigned6_operand PARAMS ((rtx, enum machine_mode));
-extern int bitset_operand PARAMS ((rtx, enum machine_mode));
-extern int condexec_test_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_branch_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_unary_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_addsub_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_binary_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_shiftl_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_extend_operator PARAMS ((rtx, enum machine_mode));
-extern int branch_zero_operator PARAMS ((rtx, enum machine_mode));
-extern int cond_move_dest_operand PARAMS ((rtx, enum machine_mode));
-extern int cond_move_operand PARAMS ((rtx, enum machine_mode));
-extern int cond_exec_operand PARAMS ((rtx, enum machine_mode));
-extern int srelational_si_operator PARAMS ((rtx, enum machine_mode));
-extern int urelational_si_operator PARAMS ((rtx, enum machine_mode));
-extern int relational_di_operator PARAMS ((rtx, enum machine_mode));
+extern int short_memory_operand (rtx, enum machine_mode);
+extern int long_memory_operand (rtx, enum machine_mode);
+extern int d30v_memory_operand (rtx, enum machine_mode);
+extern int single_reg_memory_operand (rtx, enum machine_mode);
+extern int const_addr_memory_operand (rtx, enum machine_mode);
+extern int call_operand (rtx, enum machine_mode);
+extern int gpr_operand (rtx, enum machine_mode);
+extern int accum_operand (rtx, enum machine_mode);
+extern int gpr_or_accum_operand (rtx, enum machine_mode);
+extern int cr_operand (rtx, enum machine_mode);
+extern int repeat_operand (rtx, enum machine_mode);
+extern int flag_operand (rtx, enum machine_mode);
+extern int br_flag_operand (rtx, enum machine_mode);
+extern int br_flag_or_constant_operand (rtx, enum machine_mode);
+extern int gpr_br_flag_operand (rtx, enum machine_mode);
+extern int f0_operand (rtx, enum machine_mode);
+extern int f1_operand (rtx, enum machine_mode);
+extern int carry_operand (rtx, enum machine_mode);
+extern int reg_or_0_operand (rtx, enum machine_mode);
+extern int gpr_or_signed6_operand (rtx, enum machine_mode);
+extern int gpr_or_unsigned5_operand (rtx, enum machine_mode);
+extern int gpr_or_unsigned6_operand (rtx, enum machine_mode);
+extern int gpr_or_constant_operand (rtx, enum machine_mode);
+extern int gpr_or_dbl_const_operand (rtx, enum machine_mode);
+extern int gpr_or_memory_operand (rtx, enum machine_mode);
+extern int move_input_operand (rtx, enum machine_mode);
+extern int move_output_operand (rtx, enum machine_mode);
+extern int signed6_operand (rtx, enum machine_mode);
+extern int unsigned5_operand (rtx, enum machine_mode);
+extern int unsigned6_operand (rtx, enum machine_mode);
+extern int bitset_operand (rtx, enum machine_mode);
+extern int condexec_test_operator (rtx, enum machine_mode);
+extern int condexec_branch_operator (rtx, enum machine_mode);
+extern int condexec_unary_operator (rtx, enum machine_mode);
+extern int condexec_addsub_operator (rtx, enum machine_mode);
+extern int condexec_binary_operator (rtx, enum machine_mode);
+extern int condexec_shiftl_operator (rtx, enum machine_mode);
+extern int condexec_extend_operator (rtx, enum machine_mode);
+extern int branch_zero_operator (rtx, enum machine_mode);
+extern int cond_move_dest_operand (rtx, enum machine_mode);
+extern int cond_move_operand (rtx, enum machine_mode);
+extern int cond_exec_operand (rtx, enum machine_mode);
+extern int srelational_si_operator (rtx, enum machine_mode);
+extern int urelational_si_operator (rtx, enum machine_mode);
+extern int relational_di_operator (rtx, enum machine_mode);
#endif
-extern d30v_stack_t *d30v_stack_info PARAMS ((void));
-extern int direct_return PARAMS ((void));
+extern d30v_stack_t *d30v_stack_info (void);
+extern int direct_return (void);
#ifdef TREE_CODE
#ifdef RTX_CODE
-extern void d30v_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree,
- rtx, tree, int));
+extern void d30v_init_cumulative_args (CUMULATIVE_ARGS *, tree,
+ rtx, tree, int);
#endif
-extern int d30v_function_arg_boundary PARAMS ((enum machine_mode, tree));
+extern int d30v_function_arg_boundary (enum machine_mode, tree);
#ifdef RTX_CODE
-extern rtx d30v_function_arg PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int, int));
+extern rtx d30v_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int, int);
#endif
-extern int d30v_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int d30v_function_arg_partial_nregs (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
-extern int d30v_function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int d30v_function_arg_pass_by_reference (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
-extern void d30v_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern void d30v_function_arg_advance (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
#endif
#ifdef RTX_CODE
-extern rtx d30v_expand_builtin_saveregs PARAMS ((void));
+extern rtx d30v_expand_builtin_saveregs (void);
#endif
#ifdef TREE_CODE
-extern void d30v_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int *, int));
-extern tree d30v_build_va_list PARAMS ((void));
+extern void d30v_setup_incoming_varargs (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int *, int);
#ifdef RTX_CODE
-extern void d30v_expand_builtin_va_start PARAMS ((tree, rtx));
-extern rtx d30v_expand_builtin_va_arg PARAMS ((tree, tree));
-#endif /* RTX_CODE */
-#endif /* TREE_CODE */
-
-extern void d30v_expand_prologue PARAMS ((void));
-extern void d30v_expand_epilogue PARAMS ((void));
-extern void d30v_function_profiler PARAMS ((FILE *, int));
+extern void d30v_expand_builtin_va_start (tree, rtx);
+extern rtx d30v_expand_builtin_va_arg (tree, tree);
+#endif /* RTX_CODE */
+#endif /* TREE_CODE */
+
+extern void d30v_expand_prologue (void);
+extern void d30v_expand_epilogue (void);
+extern void d30v_function_profiler (FILE *, int);
#ifdef RTX_CODE
-extern void d30v_split_double PARAMS ((rtx, rtx *, rtx *));
-extern void d30v_print_operand PARAMS ((FILE *, rtx, int));
-extern void d30v_print_operand_address PARAMS ((FILE *, rtx));
+extern void d30v_split_double (rtx, rtx *, rtx *);
+extern void d30v_print_operand (FILE *, rtx, int);
+extern void d30v_print_operand_address (FILE *, rtx);
#endif
-extern int d30v_trampoline_size PARAMS ((void));
+extern int d30v_trampoline_size (void);
#ifdef RTX_CODE
-extern void d30v_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern int d30v_legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
-extern rtx d30v_legitimize_address PARAMS ((rtx, rtx,
- enum machine_mode, int));
-extern int d30v_mode_dependent_address_p PARAMS ((rtx));
-extern rtx d30v_emit_comparison PARAMS ((int, rtx, rtx, rtx));
-extern const char *d30v_move_2words PARAMS ((rtx *, rtx));
-extern int d30v_emit_cond_move PARAMS ((rtx, rtx, rtx, rtx));
-extern rtx d30v_return_addr PARAMS ((void));
+extern void d30v_initialize_trampoline (rtx, rtx, rtx);
+extern int d30v_legitimate_address_p (enum machine_mode, rtx, int);
+extern rtx d30v_legitimize_address (rtx, rtx, enum machine_mode, int);
+extern int d30v_mode_dependent_address_p (rtx);
+extern rtx d30v_emit_comparison (int, rtx, rtx, rtx);
+extern const char *d30v_move_2words (rtx *, rtx);
+extern int d30v_emit_cond_move (rtx, rtx, rtx, rtx);
+extern rtx d30v_return_addr (void);
#endif
-extern void d30v_init_expanders PARAMS ((void));
-extern void debug_stack_info PARAMS ((d30v_stack_t *));
-
+extern void d30v_init_expanders (void);
+extern void debug_stack_info (d30v_stack_t *);
+
/* External variables referenced */
/* Define the information needed to generate branch and scc insns. This is
diff --git a/gcc/config/d30v/d30v.c b/gcc/config/d30v/d30v.c
index 4093ab27abf..5794d0bb64f 100644
--- a/gcc/config/d30v/d30v.c
+++ b/gcc/config/d30v/d30v.c
@@ -46,15 +46,15 @@
#include "target-def.h"
#include "langhooks.h"
-static void d30v_print_operand_memory_reference PARAMS ((FILE *, rtx));
-static void d30v_build_long_insn PARAMS ((HOST_WIDE_INT, HOST_WIDE_INT,
- rtx, rtx));
-static struct machine_function * d30v_init_machine_status PARAMS ((void));
-static void d30v_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void d30v_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static int d30v_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int d30v_issue_rate PARAMS ((void));
-static bool d30v_rtx_costs PARAMS ((rtx, int, int, int *));
+static void d30v_print_operand_memory_reference (FILE *, rtx);
+static void d30v_build_long_insn (HOST_WIDE_INT, HOST_WIDE_INT, rtx, rtx);
+static struct machine_function * d30v_init_machine_status (void);
+static void d30v_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void d30v_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static int d30v_adjust_cost (rtx, rtx, rtx, int);
+static int d30v_issue_rate (void);
+static bool d30v_rtx_costs (rtx, int, int, int *);
+static tree d30v_build_builtin_va_list (void);
/* Define the information needed to generate branch and scc insns. This is
stored from the compare operation. */
@@ -105,6 +105,9 @@ enum reg_class reg_class_from_letter[256];
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST d30v_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Sometimes certain combinations of command options do not make
@@ -2201,8 +2204,8 @@ d30v_setup_incoming_varargs (cum, mode, type, pretend_size, second_time)
/* Create the va_list data type. */
-tree
-d30v_build_va_list ()
+static tree
+d30v_build_builtin_va_list ()
{
tree f_arg_ptr, f_arg_num, record, type_decl;
tree int_type_node;
diff --git a/gcc/config/d30v/d30v.h b/gcc/config/d30v/d30v.h
index 59ba9b7ba5f..6c4c0669eb6 100644
--- a/gcc/config/d30v/d30v.h
+++ b/gcc/config/d30v/d30v.h
@@ -1407,13 +1407,6 @@ typedef struct machine_function GTY(())
d30v_setup_incoming_varargs (&ARGS_SO_FAR, (int) MODE, TYPE, \
&PRETEND_ARGS_SIZE, SECOND_TIME)
-/* Build up the stdarg/varargs va_list type tree, assinging it to NODE. If not
- defined, it is assumed that va_list is a void * pointer. */
-
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = d30v_build_va_list ()
-
-
/* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
variable to initialize. NEXTARG is the machine independent notion of the
diff --git a/gcc/config/darwin-protos.h b/gcc/config/darwin-protos.h
index 69b0b6fcb3e..41bad646ce1 100644
--- a/gcc/config/darwin-protos.h
+++ b/gcc/config/darwin-protos.h
@@ -118,5 +118,6 @@ extern void machopic_output_stub (FILE *, const char *, const char *);
extern void darwin_exception_section (void);
extern void darwin_eh_frame_section (void);
extern void darwin_globalize_label (FILE *, const char *);
+extern void darwin_assemble_visibility (tree, int);
extern void darwin_asm_output_dwarf_delta (FILE *, int, const char *,
const char *);
diff --git a/gcc/config/darwin.c b/gcc/config/darwin.c
index dcb42d5199a..1ac122376de 100644
--- a/gcc/config/darwin.c
+++ b/gcc/config/darwin.c
@@ -41,6 +41,7 @@ Boston, MA 02111-1307, USA. */
#include "ggc.h"
#include "langhooks.h"
#include "tm_p.h"
+#include "errors.h"
static int machopic_data_defined_p (const char *);
static void update_non_lazy_ptrs (const char *);
@@ -1115,7 +1116,7 @@ machopic_output_possible_stub_label (FILE *file, const char *name)
const char *sym_name;
sym_name = IDENTIFIER_POINTER (TREE_VALUE (temp));
- if (sym_name[0] == '!' && sym_name[1] == 'T'
+ if (sym_name[0] == '!' && (sym_name[1] == 'T' || sym_name[1] == 't')
&& ! strcmp (name+2, sym_name+2))
{
ASM_OUTPUT_LABEL (file, IDENTIFIER_POINTER (TREE_PURPOSE (temp)));
@@ -1324,6 +1325,29 @@ darwin_globalize_label (FILE *stream, const char *name)
default_globalize_label (stream, name);
}
+/* Emit an assembler directive to set visibility for a symbol. The
+ only supported visibilities are VISIBILITY_DEFAULT and
+ VISIBILITY_HIDDEN; the latter corresponds to Darwin's "private
+ extern". There is no MACH-O equivalent of ELF's
+ VISIBILITY_INTERNAL or VISIBILITY_PROTECTED. */
+
+void
+darwin_assemble_visibility (tree decl, int vis)
+{
+ if (vis == VISIBILITY_DEFAULT)
+ ;
+ else if (vis == VISIBILITY_HIDDEN)
+ {
+ fputs ("\t.private_extern ", asm_out_file);
+ assemble_name (asm_out_file,
+ (IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl))));
+ fputs ("\n", asm_out_file);
+ }
+ else
+ warning ("internal and protected visibility attributes not supported"
+ "in this configuration; ignored");
+}
+
/* Output a difference of two labels that will be an assembly time
constant if the two labels are local. (.long lab1-lab2 will be
very different if lab1 is at the boundary between two sections; it
diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h
index ae5201a5eb1..3470f7b8ca1 100644
--- a/gcc/config/darwin.h
+++ b/gcc/config/darwin.h
@@ -192,7 +192,7 @@ Boston, MA 02111-1307, USA. */
%{!Zdynamiclib:%{A} %{e*} %{m} %{N} %{n} %{r} %{u*} %{x} %{z}} \
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
%{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
- %{L*} %(link_libgcc) %o %{fprofile-arcs:-lgcov} \
+ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov} \
%{!nostdlib:%{!nodefaultlibs:%G %L}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} \
%{!--help:%{!no-c++filt|c++filt:| c++filt3 }} }}}}}}}}"
@@ -708,6 +708,13 @@ objc_section_init (void) \
#define GLOBAL_ASM_OP ".globl "
#define TARGET_ASM_GLOBALIZE_LABEL darwin_globalize_label
+/* Emit an assembler directive to set visibility for a symbol. Used
+ to support visibility attribute and Darwin's private extern
+ feature. */
+#undef TARGET_ASM_ASSEMBLE_VISIBILITY
+#define TARGET_ASM_ASSEMBLE_VISIBILITY darwin_assemble_visibility
+
+
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
sprintf (LABEL, "*%s%ld", PREFIX, (long)(NUM))
diff --git a/gcc/config/dsp16xx/dsp16xx-protos.h b/gcc/config/dsp16xx/dsp16xx-protos.h
index 7e2683fbb74..802c69b62ec 100644
--- a/gcc/config/dsp16xx/dsp16xx-protos.h
+++ b/gcc/config/dsp16xx/dsp16xx-protos.h
@@ -20,67 +20,67 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifdef RTX_CODE
-extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx));
-extern int call_address_operand PARAMS ((rtx, enum machine_mode));
-extern int arith_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int symbolic_address_operand PARAMS ((rtx, enum machine_mode));
-extern int Y_address_operand PARAMS ((rtx, enum machine_mode));
-extern int sp_operand PARAMS ((rtx, enum machine_mode));
-extern int sp_operand2 PARAMS ((rtx, enum machine_mode));
-extern int nonmemory_arith_operand PARAMS ((rtx, enum machine_mode));
-extern int dsp16xx_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int unx_comparison_operator PARAMS ((rtx, enum machine_mode));
-extern int signed_comparison_operator PARAMS ((rtx, enum machine_mode));
+extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx);
+extern int call_address_operand (rtx, enum machine_mode);
+extern int arith_reg_operand (rtx, enum machine_mode);
+extern int symbolic_address_operand (rtx, enum machine_mode);
+extern int Y_address_operand (rtx, enum machine_mode);
+extern int sp_operand (rtx, enum machine_mode);
+extern int sp_operand2 (rtx, enum machine_mode);
+extern int nonmemory_arith_operand (rtx, enum machine_mode);
+extern int dsp16xx_comparison_operator (rtx, enum machine_mode);
+extern int unx_comparison_operator (rtx, enum machine_mode);
+extern int signed_comparison_operator (rtx, enum machine_mode);
-extern void notice_update_cc PARAMS ((rtx));
-extern void double_reg_from_memory PARAMS ((rtx[]));
-extern void double_reg_to_memory PARAMS ((rtx[]));
-extern enum rtx_code next_cc_user_code PARAMS ((rtx));
-extern int next_cc_user_unsigned PARAMS ((rtx));
-extern struct rtx_def *gen_tst_reg PARAMS ((rtx));
-extern const char *output_block_move PARAMS ((rtx[]));
-extern enum reg_class preferred_reload_class PARAMS ((rtx, enum reg_class));
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode, rtx));
-extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void output_dsp16xx_float_const PARAMS ((rtx *));
-extern void emit_1600_core_shift PARAMS ((enum rtx_code, rtx *, int));
-extern int symbolic_address_p PARAMS ((rtx));
-extern int uns_comparison_operator PARAMS ((rtx, enum machine_mode));
+extern void notice_update_cc (rtx);
+extern void double_reg_from_memory (rtx[]);
+extern void double_reg_to_memory (rtx[]);
+extern enum rtx_code next_cc_user_code (rtx);
+extern int next_cc_user_unsigned (rtx);
+extern struct rtx_def *gen_tst_reg (rtx);
+extern const char *output_block_move (rtx[]);
+extern enum reg_class preferred_reload_class (rtx, enum reg_class);
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern int emit_move_sequence (rtx *, enum machine_mode);
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern void output_dsp16xx_float_const (rtx *);
+extern void emit_1600_core_shift (enum rtx_code, rtx *, int);
+extern int symbolic_address_p (rtx);
+extern int uns_comparison_operator (rtx, enum machine_mode);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern struct rtx_def *dsp16xx_function_arg PARAMS ((CUMULATIVE_ARGS,
- enum machine_mode,
- tree, int));
-extern void dsp16xx_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern struct rtx_def *dsp16xx_function_arg (CUMULATIVE_ARGS,
+ enum machine_mode,
+ tree, int);
+extern void dsp16xx_function_arg_advance (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
#endif /* TREE_CODE */
-extern void dsp16xx_invalid_register_for_compare PARAMS ((void));
-extern int class_max_nregs PARAMS ((enum reg_class, enum machine_mode));
-extern enum reg_class limit_reload_class PARAMS ((enum reg_class, enum machine_mode));
-extern int dsp16xx_register_move_cost PARAMS ((enum reg_class, enum reg_class));
-extern int dsp16xx_makes_calls PARAMS ((void));
-extern long compute_frame_size PARAMS ((int));
-extern int dsp16xx_call_saved_register PARAMS ((int));
-extern int dsp16xx_call_saved_register PARAMS ((int));
-extern void init_emulation_routines PARAMS ((void));
-extern int ybase_regs_ever_used PARAMS ((void));
-extern void override_options PARAMS ((void));
-extern int dsp16xx_starting_frame_offset PARAMS ((void));
-extern int initial_frame_pointer_offset PARAMS ((void));
-extern void asm_output_common PARAMS ((FILE *, const char *, int, int));
-extern void asm_output_local PARAMS ((FILE *, const char *, int, int));
-extern void asm_output_float PARAMS ((FILE *, double));
+extern void dsp16xx_invalid_register_for_compare (void);
+extern int class_max_nregs (enum reg_class, enum machine_mode);
+extern enum reg_class limit_reload_class (enum reg_class, enum machine_mode);
+extern int dsp16xx_register_move_cost (enum reg_class, enum reg_class);
+extern int dsp16xx_makes_calls (void);
+extern long compute_frame_size (int);
+extern int dsp16xx_call_saved_register (int);
+extern int dsp16xx_call_saved_register (int);
+extern void init_emulation_routines (void);
+extern int ybase_regs_ever_used (void);
+extern void override_options (void);
+extern int dsp16xx_starting_frame_offset (void);
+extern int initial_frame_pointer_offset (void);
+extern void asm_output_common (FILE *, const char *, int, int);
+extern void asm_output_local (FILE *, const char *, int, int);
+extern void asm_output_float (FILE *, double);
extern bool dsp16xx_compare_gen;
-extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
-extern enum reg_class dsp16xx_reg_class_from_letter PARAMS ((int));
-extern int regno_reg_class PARAMS ((int));
-extern void function_prologue PARAMS ((FILE *, int));
-extern void function_epilogue PARAMS ((FILE *, int));
-extern int num_1600_core_shifts PARAMS ((int));
+extern int hard_regno_mode_ok (int, enum machine_mode);
+extern enum reg_class dsp16xx_reg_class_from_letter (int);
+extern int regno_reg_class (int);
+extern void function_prologue (FILE *, int);
+extern void function_epilogue (FILE *, int);
+extern int num_1600_core_shifts (int);
diff --git a/gcc/config/dsp16xx/dsp16xx.c b/gcc/config/dsp16xx/dsp16xx.c
index dcfbc7e6853..14d9c5e088e 100644
--- a/gcc/config/dsp16xx/dsp16xx.c
+++ b/gcc/config/dsp16xx/dsp16xx.c
@@ -148,12 +148,12 @@ static const char *const lshift_right_asm_first[] =
"%0=%1>>16\n\t%0=%b0&0x0000"
};
-static int reg_save_size PARAMS ((void));
-static void dsp16xx_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void dsp16xx_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void dsp16xx_file_start PARAMS ((void));
-static bool dsp16xx_rtx_costs PARAMS ((rtx, int, int, int *));
-static int dsp16xx_address_cost PARAMS ((rtx));
+static int reg_save_size (void);
+static void dsp16xx_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void dsp16xx_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void dsp16xx_file_start (void);
+static bool dsp16xx_rtx_costs (rtx, int, int, int *);
+static int dsp16xx_address_cost (rtx);
/* Initialize the GCC target structure. */
diff --git a/gcc/config/dsp16xx/dsp16xx.h b/gcc/config/dsp16xx/dsp16xx.h
index 7e2d5405321..cea995ca104 100644
--- a/gcc/config/dsp16xx/dsp16xx.h
+++ b/gcc/config/dsp16xx/dsp16xx.h
@@ -293,8 +293,6 @@ extern int target_flags;
#define OPTIMIZATION_OPTIONS(LEVEL,SIZE) \
{ \
- flag_gnu_linker = FALSE; \
- \
if (LEVEL >= 2) \
{ \
/* The dsp16xx family has so few registers \
diff --git a/gcc/config/elfos.h b/gcc/config/elfos.h
index 063dce655cf..6a138f9f76f 100644
--- a/gcc/config/elfos.h
+++ b/gcc/config/elfos.h
@@ -66,10 +66,6 @@ Boston, MA 02111-1307, USA. */
#define HANDLE_SYSV_PRAGMA 1
-/* System V Release 4 uses DWARF debugging info. */
-
-#define DWARF_DEBUGGING_INFO 1
-
/* All ELF targets can support DWARF-2. */
#define DWARF2_DEBUGGING_INFO 1
diff --git a/gcc/config/fr30/fr30-protos.h b/gcc/config/fr30/fr30-protos.h
index c08b6639aa8..a7119042dd5 100644
--- a/gcc/config/fr30/fr30-protos.h
+++ b/gcc/config/fr30/fr30-protos.h
@@ -18,34 +18,34 @@ 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. */
-extern void fr30_expand_prologue PARAMS ((void));
-extern void fr30_expand_epilogue PARAMS ((void));
-extern unsigned int fr30_compute_frame_size PARAMS ((int, int));
+extern void fr30_expand_prologue (void);
+extern void fr30_expand_epilogue (void);
+extern unsigned int fr30_compute_frame_size (int, int);
#ifdef RTX_CODE
-extern int fr30_check_multiple_regs PARAMS ((rtx *, int, int));
-extern void fr30_print_operand PARAMS ((FILE *, rtx, int));
-extern void fr30_print_operand_address PARAMS ((FILE *, rtx));
-extern rtx fr30_move_double PARAMS ((rtx *));
+extern int fr30_check_multiple_regs (rtx *, int, int);
+extern void fr30_print_operand (FILE *, rtx, int);
+extern void fr30_print_operand_address (FILE *, rtx);
+extern rtx fr30_move_double (rtx *);
#ifdef TREE_CODE
-extern rtx fr30_va_arg PARAMS ((tree, tree));
+extern rtx fr30_va_arg (tree, tree);
#endif /* TREE_CODE */
#ifdef HAVE_MACHINE_MODES
#define Mmode enum machine_mode
-extern int stack_add_operand PARAMS ((rtx, Mmode));
-extern int add_immediate_operand PARAMS ((rtx, Mmode));
-extern int high_register_operand PARAMS ((rtx, Mmode));
-extern int low_register_operand PARAMS ((rtx, Mmode));
-extern int call_operand PARAMS ((rtx, Mmode));
-extern int di_operand PARAMS ((rtx, Mmode));
-extern int nonimmediate_di_operand PARAMS ((rtx, Mmode));
-extern int fr30_const_double_is_zero PARAMS ((rtx));
+extern int stack_add_operand (rtx, Mmode);
+extern int add_immediate_operand (rtx, Mmode);
+extern int high_register_operand (rtx, Mmode);
+extern int low_register_operand (rtx, Mmode);
+extern int call_operand (rtx, Mmode);
+extern int di_operand (rtx, Mmode);
+extern int nonimmediate_di_operand (rtx, Mmode);
+extern int fr30_const_double_is_zero (rtx);
#undef Mmode
#endif /* HAVE_MACHINE_MODES */
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern int fr30_num_arg_regs PARAMS ((int, tree));
-extern int fr30_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS, int, tree, int));
-extern void fr30_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS, int, tree, int *));
+extern int fr30_num_arg_regs (int, tree);
+extern int fr30_function_arg_partial_nregs (CUMULATIVE_ARGS, int, tree, int);
+extern void fr30_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int *);
#endif /* TREE_CODE */
diff --git a/gcc/config/fr30/fr30.c b/gcc/config/fr30/fr30.c
index 15c8b91db78..c702d0bbe28 100644
--- a/gcc/config/fr30/fr30.c
+++ b/gcc/config/fr30/fr30.c
@@ -40,6 +40,7 @@
#include "obstack.h"
#include "except.h"
#include "function.h"
+#include "toplev.h"
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
@@ -109,7 +110,7 @@ struct fr30_frame_info
unsigned int frame_size; /* # Bytes in current frame. */
unsigned int gmask; /* Mask of saved registers. */
unsigned int save_fp; /* Nonzero if frame pointer must be saved. */
- unsigned int save_rp; /* Nonzero if return popinter must be saved. */
+ unsigned int save_rp; /* Nonzero if return pointer must be saved. */
int initialised; /* Nonzero if frame size already calculated. */
};
@@ -119,8 +120,8 @@ static struct fr30_frame_info current_frame_info;
/* Zero structure to initialize current_frame_info. */
static struct fr30_frame_info zero_frame_info;
-static rtx fr30_pass_by_reference PARAMS ((tree, tree));
-static rtx fr30_pass_by_value PARAMS ((tree, tree));
+static rtx fr30_pass_by_reference (tree, tree);
+static rtx fr30_pass_by_value (tree, tree);
#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
#define RETURN_POINTER_MASK (1 << (RETURN_POINTER_REGNUM))
@@ -153,9 +154,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
for the current function. As a side effect it fills in the
current_frame_info structure, if the data is available. */
unsigned int
-fr30_compute_frame_size (from_reg, to_reg)
- int from_reg;
- int to_reg;
+fr30_compute_frame_size (int from_reg, int to_reg)
{
int regno;
unsigned int return_value;
@@ -218,7 +217,7 @@ fr30_compute_frame_size (from_reg, to_reg)
insn to prevent such scheduling. */
void
-fr30_expand_prologue ()
+fr30_expand_prologue (void)
{
int regno;
rtx insn;
@@ -346,7 +345,7 @@ fr30_expand_prologue ()
In some cases, it might be necessary to emit a barrier instruction as the
first insn to prevent such scheduling. */
void
-fr30_expand_epilogue ()
+fr30_expand_epilogue (void)
{
int regno;
@@ -405,11 +404,10 @@ fr30_expand_epilogue ()
ARG_REGS_USED_SO_FAR has *not* been updated for the last named argument
which has type TYPE and mode MODE, and we rely on this fact. */
void
-fr30_setup_incoming_varargs (arg_regs_used_so_far, int_mode, type, pretend_size)
- CUMULATIVE_ARGS arg_regs_used_so_far;
- int int_mode;
- tree type ATTRIBUTE_UNUSED;
- int * pretend_size;
+fr30_setup_incoming_varargs (CUMULATIVE_ARGS arg_regs_used_so_far,
+ int int_mode,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size)
{
enum machine_mode mode = (enum machine_mode)int_mode;
int size;
@@ -439,9 +437,7 @@ fr30_setup_incoming_varargs (arg_regs_used_so_far, int_mode, type, pretend_size)
/* Print a memory address as an operand to reference that memory location. */
void
-fr30_print_operand_address (stream, address)
- FILE * stream;
- rtx address;
+fr30_print_operand_address (FILE *stream, rtx address)
{
switch (GET_CODE (address))
{
@@ -460,10 +456,7 @@ fr30_print_operand_address (stream, address)
/* Print an operand. */
void
-fr30_print_operand (file, x, code)
- FILE * file;
- rtx x;
- int code;
+fr30_print_operand (FILE *file, rtx x, int code)
{
rtx x0;
@@ -664,9 +657,7 @@ fr30_print_operand (file, x, code)
/* Compute the number of word sized registers needed to hold a
function argument of mode INT_MODE and tree type TYPE. */
int
-fr30_num_arg_regs (int_mode, type)
- int int_mode;
- tree type;
+fr30_num_arg_regs (int int_mode, tree type)
{
enum machine_mode mode = (enum machine_mode) int_mode;
int size;
@@ -685,17 +676,14 @@ fr30_num_arg_regs (int_mode, type)
/* Implements the FUNCTION_ARG_PARTIAL_NREGS macro.
Returns the number of argument registers required to hold *part* of
a parameter of machine mode MODE and tree type TYPE (which may be
- NULL if the type is not known). If the argument fits entirly in
+ NULL if the type is not known). If the argument fits entirely in
the argument registers, or entirely on the stack, then 0 is returned.
CUM is the number of argument registers already used by earlier
parameters to the function. */
int
-fr30_function_arg_partial_nregs (cum, int_mode, type, named)
- CUMULATIVE_ARGS cum;
- int int_mode;
- tree type;
- int named;
+fr30_function_arg_partial_nregs (CUMULATIVE_ARGS cum, int int_mode,
+ tree type, int named)
{
/* Unnamed arguments, ie those that are prototyped as ...
are always passed on the stack.
@@ -717,9 +705,7 @@ fr30_function_arg_partial_nregs (cum, int_mode, type, named)
}
static rtx
-fr30_pass_by_reference (valist, type)
- tree valist;
- tree type;
+fr30_pass_by_reference (tree valist, tree type)
{
tree type_ptr;
tree type_ptr_ptr;
@@ -738,9 +724,7 @@ fr30_pass_by_reference (valist, type)
}
static rtx
-fr30_pass_by_value (valist, type)
- tree valist;
- tree type;
+fr30_pass_by_value (tree valist, tree type)
{
HOST_WIDE_INT size = int_size_in_bytes (type);
HOST_WIDE_INT rsize;
@@ -774,9 +758,7 @@ fr30_pass_by_value (valist, type)
/* Implement `va_arg'. */
rtx
-fr30_va_arg (valist, type)
- tree valist;
- tree type;
+fr30_va_arg (tree valist, tree type)
{
HOST_WIDE_INT size;
@@ -802,9 +784,7 @@ fr30_va_arg (valist, type)
/* Returns true if OPERAND is an integer value suitable for use in
an ADDSP instruction. */
int
-stack_add_operand (operand, mode)
- rtx operand;
- Mmode mode ATTRIBUTE_UNUSED;
+stack_add_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED)
{
return
(GET_CODE (operand) == CONST_INT
@@ -816,9 +796,7 @@ stack_add_operand (operand, mode)
/* Returns true if OPERAND is an integer value suitable for use in
an ADD por ADD2 instruction, or if it is a register. */
int
-add_immediate_operand (operand, mode)
- rtx operand;
- Mmode mode ATTRIBUTE_UNUSED;
+add_immediate_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED)
{
return
(GET_CODE (operand) == REG
@@ -829,9 +807,7 @@ add_immediate_operand (operand, mode)
/* Returns true if OPERAND is hard register in the range 8 - 15. */
int
-high_register_operand (operand, mode)
- rtx operand;
- Mmode mode ATTRIBUTE_UNUSED;
+high_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED)
{
return
(GET_CODE (operand) == REG
@@ -841,9 +817,7 @@ high_register_operand (operand, mode)
/* Returns true if OPERAND is hard register in the range 0 - 7. */
int
-low_register_operand (operand, mode)
- rtx operand;
- Mmode mode ATTRIBUTE_UNUSED;
+low_register_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED)
{
return
(GET_CODE (operand) == REG
@@ -852,9 +826,7 @@ low_register_operand (operand, mode)
/* Returns true if OPERAND is suitable for use in a CALL insn. */
int
-call_operand (operand, mode)
- rtx operand;
- Mmode mode ATTRIBUTE_UNUSED;
+call_operand (rtx operand, Mmode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (operand) == MEM
&& (GET_CODE (XEXP (operand, 0)) == SYMBOL_REF
@@ -863,9 +835,7 @@ call_operand (operand, mode)
/* Returns TRUE if OP is a valid operand of a DImode operation. */
int
-di_operand (op, mode)
- rtx op;
- Mmode mode;
+di_operand (rtx op, Mmode mode)
{
if (register_operand (op, mode))
return TRUE;
@@ -892,9 +862,7 @@ di_operand (op, mode)
/* Returns TRUE if OP is a DImode register or MEM. */
int
-nonimmediate_di_operand (op, mode)
- rtx op;
- Mmode mode;
+nonimmediate_di_operand (rtx op, Mmode mode)
{
if (register_operand (op, mode))
return TRUE;
@@ -914,10 +882,7 @@ nonimmediate_di_operand (op, mode)
/* Returns true iff all the registers in the operands array
are in descending or ascending order. */
int
-fr30_check_multiple_regs (operands, num_operands, descending)
- rtx * operands;
- int num_operands;
- int descending;
+fr30_check_multiple_regs (rtx *operands, int num_operands, int descending)
{
if (descending)
{
@@ -954,8 +919,7 @@ fr30_check_multiple_regs (operands, num_operands, descending)
}
int
-fr30_const_double_is_zero (operand)
- rtx operand;
+fr30_const_double_is_zero (rtx operand)
{
REAL_VALUE_TYPE d;
@@ -972,14 +936,13 @@ fr30_const_double_is_zero (operand)
/* Output a double word move.
It must be REG<-REG, REG<-MEM, MEM<-REG or REG<-CONST.
- On the FR30 we are contrained by the fact that it does not
+ On the FR30 we are constrained by the fact that it does not
support offsetable addresses, and so we have to load the
address of the secnd word into the second destination register
before we can use it. */
rtx
-fr30_move_double (operands)
- rtx * operands;
+fr30_move_double (rtx * operands)
{
rtx src = operands[1];
rtx dest = operands[0];
diff --git a/gcc/config/fr30/fr30.h b/gcc/config/fr30/fr30.h
index f44d6996eb5..845b4f1e111 100644
--- a/gcc/config/fr30/fr30.h
+++ b/gcc/config/fr30/fr30.h
@@ -926,7 +926,7 @@ enum reg_class
jmp @r0
The no-ops are to guarantee that the static chain and final
- target are 32 bit ailgned within the trampoline. That allows us to
+ target are 32 bit aligned within the trampoline. That allows us to
initialize those locations with simple SImode stores. The alternative
would be to use HImode stores. */
diff --git a/gcc/config/fr30/fr30.md b/gcc/config/fr30/fr30.md
index 048badb45ab..5be9d9ae5ce 100644
--- a/gcc/config/fr30/fr30.md
+++ b/gcc/config/fr30/fr30.md
@@ -639,7 +639,7 @@
;; We need some trickery to be able to handle the addition of
;; large (ie outside +/- 16) constants. We need to be able to
;; handle this because reload assumes that it can generate add
-;; instructions with arbitary sized constants.
+;; instructions with arbitrary sized constants.
(define_expand "addsi3"
[(set (match_operand:SI 0 "register_operand" "")
(plus:SI (match_operand:SI 1 "register_operand" "")
diff --git a/gcc/config/frv/frv-protos.h b/gcc/config/frv/frv-protos.h
index 1e2eb39dbc0..04774de1b84 100644
--- a/gcc/config/frv/frv-protos.h
+++ b/gcc/config/frv/frv-protos.h
@@ -52,194 +52,187 @@ typedef enum frv_cpu
extern frv_cpu_t frv_cpu_type; /* value of -mcpu= */
/* Define functions defined in frv.c */
-extern void frv_expand_prologue PARAMS ((void));
-extern void frv_expand_epilogue PARAMS ((int));
-extern void frv_override_options PARAMS ((void));
-extern void frv_optimization_options PARAMS ((int, int));
-extern void frv_conditional_register_usage PARAMS ((void));
-extern frv_stack_t *frv_stack_info PARAMS ((void));
-extern void frv_debug_stack PARAMS ((frv_stack_t *));
-extern int frv_frame_pointer_required PARAMS ((void));
-extern int frv_initial_elimination_offset PARAMS ((int, int));
+extern void frv_expand_prologue (void);
+extern void frv_expand_epilogue (int);
+extern void frv_override_options (void);
+extern void frv_optimization_options (int, int);
+extern void frv_conditional_register_usage (void);
+extern frv_stack_t *frv_stack_info (void);
+extern void frv_debug_stack (frv_stack_t *);
+extern int frv_frame_pointer_required (void);
+extern int frv_initial_elimination_offset (int, int);
#ifdef RTX_CODE
-extern int frv_legitimate_address_p PARAMS ((enum machine_mode, rtx,
- int, int));
-extern rtx frv_legitimize_address PARAMS ((rtx, rtx,
- enum machine_mode));
+extern int frv_legitimate_address_p (enum machine_mode, rtx,
+ int, int);
+extern rtx frv_legitimize_address (rtx, rtx, enum machine_mode);
#ifdef TREE_CODE
-extern void frv_init_cumulative_args PARAMS ((CUMULATIVE_ARGS *, tree,
- rtx, tree, int));
+extern void frv_init_cumulative_args (CUMULATIVE_ARGS *, tree,
+ rtx, tree, int);
-extern int frv_function_arg_boundary PARAMS ((enum machine_mode, tree));
-extern rtx frv_function_arg PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int, int));
+extern int frv_function_arg_boundary (enum machine_mode, tree);
+extern rtx frv_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int, int);
-extern void frv_function_arg_advance PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern void frv_function_arg_advance (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
-extern int frv_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
-extern int frv_function_arg_pass_by_reference PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int frv_function_arg_pass_by_reference (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
-extern int frv_function_arg_callee_copies PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int frv_function_arg_callee_copies (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
-extern int frv_function_arg_keep_as_reference PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
+extern int frv_function_arg_keep_as_reference (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
-extern rtx frv_expand_builtin_saveregs PARAMS ((void));
-extern void frv_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int *, int));
+extern rtx frv_expand_builtin_saveregs (void);
+extern void frv_setup_incoming_varargs (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int *, int);
-extern void frv_expand_builtin_va_start PARAMS ((tree, rtx));
-extern rtx frv_expand_builtin_va_arg PARAMS ((tree, tree));
+extern void frv_expand_builtin_va_start (tree, rtx);
+extern rtx frv_expand_builtin_va_arg (tree, tree);
#endif /* TREE_CODE */
-extern int frv_expand_block_move PARAMS ((rtx *));
-extern int frv_expand_block_clear PARAMS ((rtx *));
-extern rtx frv_dynamic_chain_address PARAMS ((rtx));
-extern rtx frv_return_addr_rtx PARAMS ((int, rtx));
-extern rtx frv_index_memory PARAMS ((rtx,
- enum machine_mode,
- int));
+extern int frv_expand_block_move (rtx *);
+extern int frv_expand_block_clear (rtx *);
+extern rtx frv_dynamic_chain_address (rtx);
+extern rtx frv_return_addr_rtx (int, rtx);
+extern rtx frv_index_memory (rtx, enum machine_mode, int);
extern const char *frv_asm_output_opcode
- PARAMS ((FILE *, const char *));
-extern void frv_final_prescan_insn PARAMS ((rtx, rtx *, int));
-extern void frv_print_operand PARAMS ((FILE *, rtx, int));
-extern void frv_print_operand_address PARAMS ((FILE *, rtx));
-extern int frv_emit_movsi PARAMS ((rtx, rtx));
-extern const char *output_move_single PARAMS ((rtx *, rtx));
-extern const char *output_move_double PARAMS ((rtx *, rtx));
+ (FILE *, const char *);
+extern void frv_final_prescan_insn (rtx, rtx *, int);
+extern void frv_print_operand (FILE *, rtx, int);
+extern void frv_print_operand_address (FILE *, rtx);
+extern int frv_emit_movsi (rtx, rtx);
+extern const char *output_move_single (rtx *, rtx);
+extern const char *output_move_double (rtx *, rtx);
extern const char *output_condmove_single
- PARAMS ((rtx *, rtx));
-extern int frv_emit_cond_branch PARAMS ((enum rtx_code, rtx));
-extern int frv_emit_scc PARAMS ((enum rtx_code, rtx));
-extern rtx frv_split_scc PARAMS ((rtx, rtx, rtx, rtx,
- HOST_WIDE_INT));
-extern int frv_emit_cond_move PARAMS ((rtx, rtx, rtx, rtx));
-extern rtx frv_split_cond_move PARAMS ((rtx *));
-extern rtx frv_split_minmax PARAMS ((rtx *));
-extern rtx frv_split_abs PARAMS ((rtx *));
-extern void frv_split_double_load PARAMS ((rtx, rtx));
-extern void frv_split_double_store PARAMS ((rtx, rtx));
+ (rtx *, rtx);
+extern int frv_emit_cond_branch (enum rtx_code, rtx);
+extern int frv_emit_scc (enum rtx_code, rtx);
+extern rtx frv_split_scc (rtx, rtx, rtx, rtx, HOST_WIDE_INT);
+extern int frv_emit_cond_move (rtx, rtx, rtx, rtx);
+extern rtx frv_split_cond_move (rtx *);
+extern rtx frv_split_minmax (rtx *);
+extern rtx frv_split_abs (rtx *);
+extern void frv_split_double_load (rtx, rtx);
+extern void frv_split_double_store (rtx, rtx);
#ifdef BLOCK_HEAD
-extern void frv_ifcvt_init_extra_fields PARAMS ((ce_if_block_t *));
-extern void frv_ifcvt_modify_tests PARAMS ((ce_if_block_t *,
- rtx *, rtx *));
+extern void frv_ifcvt_init_extra_fields (ce_if_block_t *);
+extern void frv_ifcvt_modify_tests (ce_if_block_t *, rtx *, rtx *);
extern void frv_ifcvt_modify_multiple_tests
- PARAMS ((ce_if_block_t *,
- basic_block,
- rtx *, rtx *));
-extern rtx frv_ifcvt_modify_insn PARAMS ((ce_if_block_t *,
- rtx, rtx));
-extern void frv_ifcvt_modify_final PARAMS ((ce_if_block_t *));
-extern void frv_ifcvt_modify_cancel PARAMS ((ce_if_block_t *));
+ (ce_if_block_t *, basic_block,
+ rtx *, rtx *);
+extern rtx frv_ifcvt_modify_insn (ce_if_block_t *, rtx, rtx);
+extern void frv_ifcvt_modify_final (ce_if_block_t *);
+extern void frv_ifcvt_modify_cancel (ce_if_block_t *);
#endif
-extern int frv_trampoline_size PARAMS ((void));
-extern void frv_initialize_trampoline PARAMS ((rtx, rtx, rtx));
+extern int frv_trampoline_size (void);
+extern void frv_initialize_trampoline (rtx, rtx, rtx);
extern enum reg_class frv_secondary_reload_class
- PARAMS ((enum reg_class class,
- enum machine_mode mode,
- rtx x, int));
-extern int frv_class_likely_spilled_p PARAMS ((enum reg_class class));
-extern int frv_hard_regno_mode_ok PARAMS ((int, enum machine_mode));
-extern int frv_hard_regno_nregs PARAMS ((int, enum machine_mode));
-extern int frv_class_max_nregs PARAMS ((enum reg_class class,
- enum machine_mode mode));
-extern int frv_legitimate_constant_p PARAMS ((rtx));
+ (enum reg_class class,
+ enum machine_mode mode,
+ rtx x, int);
+extern int frv_class_likely_spilled_p (enum reg_class class);
+extern int frv_hard_regno_mode_ok (int, enum machine_mode);
+extern int frv_hard_regno_nregs (int, enum machine_mode);
+extern int frv_class_max_nregs (enum reg_class class,
+ enum machine_mode mode);
+extern int frv_legitimate_constant_p (rtx);
#endif /* RTX_CODE */
-extern int direct_return_p PARAMS ((void));
-extern int frv_register_move_cost PARAMS ((enum reg_class, enum reg_class));
+extern int direct_return_p (void);
+extern int frv_register_move_cost (enum reg_class, enum reg_class);
#ifdef TREE_CODE
-extern int frv_adjust_field_align PARAMS ((tree, int));
+extern int frv_adjust_field_align (tree, int);
#endif
-extern void fixup_section PARAMS ((void));
-extern void sdata_section PARAMS ((void));
-extern void sbss_section PARAMS ((void));
-extern void data_section PARAMS ((void));
+extern void fixup_section (void);
+extern void sdata_section (void);
+extern void sbss_section (void);
+extern void data_section (void);
#ifdef RTX_CODE
-extern int integer_register_operand PARAMS ((rtx, enum machine_mode));
-extern int frv_load_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_fpr_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_no_subreg_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_int6_operand PARAMS ((rtx, enum machine_mode));
-extern int fpr_or_int6_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_int_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_int12_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_fpr_or_int12_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_int10_operand PARAMS ((rtx, enum machine_mode));
-extern int move_source_operand PARAMS ((rtx, enum machine_mode));
-extern int move_destination_operand PARAMS ((rtx, enum machine_mode));
-extern int condexec_source_operand PARAMS ((rtx, enum machine_mode));
-extern int condexec_dest_operand PARAMS ((rtx, enum machine_mode));
-extern int lr_operand PARAMS ((rtx, enum machine_mode));
-extern int gpr_or_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int fpr_or_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int reg_or_0_operand PARAMS ((rtx, enum machine_mode));
-extern int fcc_operand PARAMS ((rtx, enum machine_mode));
-extern int icc_operand PARAMS ((rtx, enum machine_mode));
-extern int cc_operand PARAMS ((rtx, enum machine_mode));
-extern int fcr_operand PARAMS ((rtx, enum machine_mode));
-extern int icr_operand PARAMS ((rtx, enum machine_mode));
-extern int cr_operand PARAMS ((rtx, enum machine_mode));
-extern int call_operand PARAMS ((rtx, enum machine_mode));
-extern int fpr_operand PARAMS ((rtx, enum machine_mode));
-extern int even_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int odd_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int even_gpr_operand PARAMS ((rtx, enum machine_mode));
-extern int odd_gpr_operand PARAMS ((rtx, enum machine_mode));
-extern int quad_fpr_operand PARAMS ((rtx, enum machine_mode));
-extern int even_fpr_operand PARAMS ((rtx, enum machine_mode));
-extern int odd_fpr_operand PARAMS ((rtx, enum machine_mode));
-extern int dbl_memory_one_insn_operand PARAMS ((rtx, enum machine_mode));
-extern int dbl_memory_two_insn_operand PARAMS ((rtx, enum machine_mode));
-extern int int12_operand PARAMS ((rtx, enum machine_mode));
-extern int int6_operand PARAMS ((rtx, enum machine_mode));
-extern int int5_operand PARAMS ((rtx, enum machine_mode));
-extern int uint5_operand PARAMS ((rtx, enum machine_mode));
-extern int uint4_operand PARAMS ((rtx, enum machine_mode));
-extern int uint1_operand PARAMS ((rtx, enum machine_mode));
-extern int int_2word_operand PARAMS ((rtx, enum machine_mode));
-extern int pic_register_operand PARAMS ((rtx, enum machine_mode));
-extern int pic_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int small_data_register_operand PARAMS ((rtx, enum machine_mode));
-extern int small_data_symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int upper_int16_operand PARAMS ((rtx, enum machine_mode));
-extern int uint16_operand PARAMS ((rtx, enum machine_mode));
-extern int relational_operator PARAMS ((rtx, enum machine_mode));
-extern int signed_relational_operator PARAMS ((rtx, enum machine_mode));
-extern int unsigned_relational_operator PARAMS ((rtx, enum machine_mode));
-extern int float_relational_operator PARAMS ((rtx, enum machine_mode));
-extern int ccr_eqne_operator PARAMS ((rtx, enum machine_mode));
-extern int minmax_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_si_binary_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_si_media_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_si_divide_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_si_unary_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_sf_conv_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_sf_add_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int intop_compare_operator PARAMS ((rtx, enum machine_mode));
-extern int condexec_intop_cmp_operator PARAMS ((rtx, enum machine_mode));
-extern int acc_operand PARAMS ((rtx, enum machine_mode));
-extern int even_acc_operand PARAMS ((rtx, enum machine_mode));
-extern int quad_acc_operand PARAMS ((rtx, enum machine_mode));
-extern int accg_operand PARAMS ((rtx, enum machine_mode));
-extern rtx frv_matching_accg_for_acc PARAMS ((rtx));
+extern int integer_register_operand (rtx, enum machine_mode);
+extern int frv_load_operand (rtx, enum machine_mode);
+extern int gpr_or_fpr_operand (rtx, enum machine_mode);
+extern int gpr_no_subreg_operand (rtx, enum machine_mode);
+extern int gpr_or_int6_operand (rtx, enum machine_mode);
+extern int fpr_or_int6_operand (rtx, enum machine_mode);
+extern int gpr_or_int_operand (rtx, enum machine_mode);
+extern int gpr_or_int12_operand (rtx, enum machine_mode);
+extern int gpr_fpr_or_int12_operand (rtx, enum machine_mode);
+extern int gpr_or_int10_operand (rtx, enum machine_mode);
+extern int move_source_operand (rtx, enum machine_mode);
+extern int move_destination_operand (rtx, enum machine_mode);
+extern int condexec_source_operand (rtx, enum machine_mode);
+extern int condexec_dest_operand (rtx, enum machine_mode);
+extern int lr_operand (rtx, enum machine_mode);
+extern int gpr_or_memory_operand (rtx, enum machine_mode);
+extern int fpr_or_memory_operand (rtx, enum machine_mode);
+extern int reg_or_0_operand (rtx, enum machine_mode);
+extern int fcc_operand (rtx, enum machine_mode);
+extern int icc_operand (rtx, enum machine_mode);
+extern int cc_operand (rtx, enum machine_mode);
+extern int fcr_operand (rtx, enum machine_mode);
+extern int icr_operand (rtx, enum machine_mode);
+extern int cr_operand (rtx, enum machine_mode);
+extern int call_operand (rtx, enum machine_mode);
+extern int fpr_operand (rtx, enum machine_mode);
+extern int even_reg_operand (rtx, enum machine_mode);
+extern int odd_reg_operand (rtx, enum machine_mode);
+extern int even_gpr_operand (rtx, enum machine_mode);
+extern int odd_gpr_operand (rtx, enum machine_mode);
+extern int quad_fpr_operand (rtx, enum machine_mode);
+extern int even_fpr_operand (rtx, enum machine_mode);
+extern int odd_fpr_operand (rtx, enum machine_mode);
+extern int dbl_memory_one_insn_operand (rtx, enum machine_mode);
+extern int dbl_memory_two_insn_operand (rtx, enum machine_mode);
+extern int int12_operand (rtx, enum machine_mode);
+extern int int6_operand (rtx, enum machine_mode);
+extern int int5_operand (rtx, enum machine_mode);
+extern int uint5_operand (rtx, enum machine_mode);
+extern int uint4_operand (rtx, enum machine_mode);
+extern int uint1_operand (rtx, enum machine_mode);
+extern int int_2word_operand (rtx, enum machine_mode);
+extern int pic_register_operand (rtx, enum machine_mode);
+extern int pic_symbolic_operand (rtx, enum machine_mode);
+extern int small_data_register_operand (rtx, enum machine_mode);
+extern int small_data_symbolic_operand (rtx, enum machine_mode);
+extern int upper_int16_operand (rtx, enum machine_mode);
+extern int uint16_operand (rtx, enum machine_mode);
+extern int relational_operator (rtx, enum machine_mode);
+extern int signed_relational_operator (rtx, enum machine_mode);
+extern int unsigned_relational_operator (rtx, enum machine_mode);
+extern int float_relational_operator (rtx, enum machine_mode);
+extern int ccr_eqne_operator (rtx, enum machine_mode);
+extern int minmax_operator (rtx, enum machine_mode);
+extern int condexec_si_binary_operator (rtx, enum machine_mode);
+extern int condexec_si_media_operator (rtx, enum machine_mode);
+extern int condexec_si_divide_operator (rtx, enum machine_mode);
+extern int condexec_si_unary_operator (rtx, enum machine_mode);
+extern int condexec_sf_conv_operator (rtx, enum machine_mode);
+extern int condexec_sf_add_operator (rtx, enum machine_mode);
+extern int condexec_memory_operand (rtx, enum machine_mode);
+extern int intop_compare_operator (rtx, enum machine_mode);
+extern int condexec_intop_cmp_operator (rtx, enum machine_mode);
+extern int acc_operand (rtx, enum machine_mode);
+extern int even_acc_operand (rtx, enum machine_mode);
+extern int quad_acc_operand (rtx, enum machine_mode);
+extern int accg_operand (rtx, enum machine_mode);
+extern rtx frv_matching_accg_for_acc (rtx);
#endif
diff --git a/gcc/config/frv/frv.c b/gcc/config/frv/frv.c
index d90ced7c418..6ee41847484 100644
--- a/gcc/config/frv/frv.c
+++ b/gcc/config/frv/frv.c
@@ -151,7 +151,7 @@ typedef struct
nested compares can be done. The csubcc and caddcc instructions don't
have enough bits to specify both a CC register to be set and a CR register
to do the test on, so the same bit number is used for both. Needless to
- say, this is rather inconvient for GCC. */
+ say, this is rather inconvenient for GCC. */
rtx nested_cc_reg;
/* Extra CR registers used for &&, ||. */
@@ -196,96 +196,75 @@ const char *frv_sched_lookahead_str; /* -msched-lookahead=n */
int frv_sched_lookahead = 4; /* -msched-lookahead=n */
/* Forward references */
-static int frv_default_flags_for_cpu PARAMS ((void));
-static int frv_string_begins_with PARAMS ((tree, const char *));
-static FRV_INLINE int const_small_data_p PARAMS ((rtx));
-static FRV_INLINE int plus_small_data_p PARAMS ((rtx, rtx));
+static int frv_default_flags_for_cpu (void);
+static int frv_string_begins_with (tree, const char *);
+static FRV_INLINE int const_small_data_p (rtx);
+static FRV_INLINE int plus_small_data_p (rtx, rtx);
static void frv_print_operand_memory_reference_reg
- PARAMS ((FILE *, rtx));
-static void frv_print_operand_memory_reference PARAMS ((FILE *, rtx, int));
-static int frv_print_operand_jump_hint PARAMS ((rtx));
-static FRV_INLINE int frv_regno_ok_for_base_p PARAMS ((int, int));
-static rtx single_set_pattern PARAMS ((rtx));
-static int frv_function_contains_far_jump PARAMS ((void));
-static rtx frv_alloc_temp_reg PARAMS ((frv_tmp_reg_t *,
- enum reg_class,
- enum machine_mode,
- int, int));
-static rtx frv_frame_offset_rtx PARAMS ((int));
-static rtx frv_frame_mem PARAMS ((enum machine_mode,
- rtx, int));
-static rtx frv_dwarf_store PARAMS ((rtx, int));
-static void frv_frame_insn PARAMS ((rtx, rtx));
-static void frv_frame_access PARAMS ((frv_frame_accessor_t*,
- rtx, int));
-static void frv_frame_access_multi PARAMS ((frv_frame_accessor_t*,
- frv_stack_t *, int));
-static void frv_frame_access_standard_regs PARAMS ((enum frv_stack_op,
- frv_stack_t *));
-static struct machine_function *frv_init_machine_status PARAMS ((void));
-static int frv_legitimate_memory_operand PARAMS ((rtx,
- enum machine_mode,
- int));
-static rtx frv_int_to_acc PARAMS ((enum insn_code,
- int, rtx));
-static enum machine_mode frv_matching_accg_mode PARAMS ((enum machine_mode));
-static rtx frv_read_argument PARAMS ((tree *));
-static int frv_check_constant_argument PARAMS ((enum insn_code,
- int, rtx));
-static rtx frv_legitimize_target PARAMS ((enum insn_code, rtx));
-static rtx frv_legitimize_argument PARAMS ((enum insn_code,
- int, rtx));
-static rtx frv_expand_set_builtin PARAMS ((enum insn_code,
- tree, rtx));
-static rtx frv_expand_unop_builtin PARAMS ((enum insn_code,
- tree, rtx));
-static rtx frv_expand_binop_builtin PARAMS ((enum insn_code,
- tree, rtx));
-static rtx frv_expand_cut_builtin PARAMS ((enum insn_code,
- tree, rtx));
-static rtx frv_expand_binopimm_builtin PARAMS ((enum insn_code,
- tree, rtx));
-static rtx frv_expand_voidbinop_builtin PARAMS ((enum insn_code,
- tree));
-static rtx frv_expand_voidtriop_builtin PARAMS ((enum insn_code,
- tree));
-static rtx frv_expand_voidaccop_builtin PARAMS ((enum insn_code,
- tree));
-static rtx frv_expand_mclracc_builtin PARAMS ((tree));
-static rtx frv_expand_mrdacc_builtin PARAMS ((enum insn_code,
- tree));
-static rtx frv_expand_mwtacc_builtin PARAMS ((enum insn_code,
- tree));
-static rtx frv_expand_noargs_builtin PARAMS ((enum insn_code));
-static rtx frv_emit_comparison PARAMS ((enum rtx_code, rtx,
- rtx));
-static int frv_clear_registers_used PARAMS ((rtx *, void *));
-static void frv_ifcvt_add_insn PARAMS ((rtx, rtx, int));
-static rtx frv_ifcvt_rewrite_mem PARAMS ((rtx,
- enum machine_mode,
- rtx));
-static rtx frv_ifcvt_load_value PARAMS ((rtx, rtx));
-static void frv_registers_update PARAMS ((rtx, unsigned char [],
- int [], int *, int));
-static int frv_registers_used_p PARAMS ((rtx, unsigned char [],
- int));
-static int frv_registers_set_p PARAMS ((rtx, unsigned char [],
- int));
-static int frv_issue_rate PARAMS ((void));
-static int frv_use_dfa_pipeline_interface PARAMS ((void));
-static void frv_pack_insns PARAMS ((void));
-static void frv_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void frv_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static bool frv_assemble_integer PARAMS ((rtx, unsigned, int));
-static void frv_init_builtins PARAMS ((void));
-static rtx frv_expand_builtin PARAMS ((tree, rtx, rtx, enum machine_mode, int));
-static void frv_init_libfuncs PARAMS ((void));
-static bool frv_in_small_data_p PARAMS ((tree));
+ (FILE *, rtx);
+static void frv_print_operand_memory_reference (FILE *, rtx, int);
+static int frv_print_operand_jump_hint (rtx);
+static FRV_INLINE int frv_regno_ok_for_base_p (int, int);
+static rtx single_set_pattern (rtx);
+static int frv_function_contains_far_jump (void);
+static rtx frv_alloc_temp_reg (frv_tmp_reg_t *,
+ enum reg_class,
+ enum machine_mode,
+ int, int);
+static rtx frv_frame_offset_rtx (int);
+static rtx frv_frame_mem (enum machine_mode, rtx, int);
+static rtx frv_dwarf_store (rtx, int);
+static void frv_frame_insn (rtx, rtx);
+static void frv_frame_access (frv_frame_accessor_t*,
+ rtx, int);
+static void frv_frame_access_multi (frv_frame_accessor_t*,
+ frv_stack_t *, int);
+static void frv_frame_access_standard_regs (enum frv_stack_op,
+ frv_stack_t *);
+static struct machine_function *frv_init_machine_status (void);
+static int frv_legitimate_memory_operand (rtx, enum machine_mode, int);
+static rtx frv_int_to_acc (enum insn_code, int, rtx);
+static enum machine_mode frv_matching_accg_mode (enum machine_mode);
+static rtx frv_read_argument (tree *);
+static int frv_check_constant_argument (enum insn_code, int, rtx);
+static rtx frv_legitimize_target (enum insn_code, rtx);
+static rtx frv_legitimize_argument (enum insn_code, int, rtx);
+static rtx frv_expand_set_builtin (enum insn_code, tree, rtx);
+static rtx frv_expand_unop_builtin (enum insn_code, tree, rtx);
+static rtx frv_expand_binop_builtin (enum insn_code, tree, rtx);
+static rtx frv_expand_cut_builtin (enum insn_code, tree, rtx);
+static rtx frv_expand_binopimm_builtin (enum insn_code, tree, rtx);
+static rtx frv_expand_voidbinop_builtin (enum insn_code, tree);
+static rtx frv_expand_voidtriop_builtin (enum insn_code, tree);
+static rtx frv_expand_voidaccop_builtin (enum insn_code, tree);
+static rtx frv_expand_mclracc_builtin (tree);
+static rtx frv_expand_mrdacc_builtin (enum insn_code, tree);
+static rtx frv_expand_mwtacc_builtin (enum insn_code, tree);
+static rtx frv_expand_noargs_builtin (enum insn_code);
+static rtx frv_emit_comparison (enum rtx_code, rtx, rtx);
+static int frv_clear_registers_used (rtx *, void *);
+static void frv_ifcvt_add_insn (rtx, rtx, int);
+static rtx frv_ifcvt_rewrite_mem (rtx, enum machine_mode, rtx);
+static rtx frv_ifcvt_load_value (rtx, rtx);
+static void frv_registers_update (rtx, unsigned char [],
+ int [], int *, int);
+static int frv_registers_used_p (rtx, unsigned char [], int);
+static int frv_registers_set_p (rtx, unsigned char [], int);
+static int frv_issue_rate (void);
+static int frv_use_dfa_pipeline_interface (void);
+static void frv_pack_insns (void);
+static void frv_function_prologue (FILE *, HOST_WIDE_INT);
+static void frv_function_epilogue (FILE *, HOST_WIDE_INT);
+static bool frv_assemble_integer (rtx, unsigned, int);
+static void frv_init_builtins (void);
+static rtx frv_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+static void frv_init_libfuncs (void);
+static bool frv_in_small_data_p (tree);
static void frv_asm_output_mi_thunk
- PARAMS ((FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree));
-static bool frv_rtx_costs PARAMS ((rtx, int, int, int*));
-static void frv_asm_out_constructor PARAMS ((rtx, int));
-static void frv_asm_out_destructor PARAMS ((rtx, int));
+ (FILE *, tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
+static bool frv_rtx_costs (rtx, int, int, int*);
+static void frv_asm_out_constructor (rtx, int);
+static void frv_asm_out_destructor (rtx, int);
/* Initialize the GCC target structure. */
#undef TARGET_ASM_FUNCTION_PROLOGUE
@@ -324,8 +303,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
/* Given a CONST, return true if the symbol_ref points to small data. */
static FRV_INLINE int
-const_small_data_p (x)
- rtx x;
+const_small_data_p (rtx x)
{
rtx x0, x1;
@@ -347,9 +325,7 @@ const_small_data_p (x)
/* Given a PLUS, return true if this is a small data reference. */
static FRV_INLINE int
-plus_small_data_p (op0, op1)
- rtx op0;
- rtx op1;
+plus_small_data_p (rtx op0, rtx op1)
{
if (GET_MODE (op0) == SImode
&& GET_CODE (op0) == REG
@@ -367,7 +343,7 @@ plus_small_data_p (op0, op1)
static int
-frv_default_flags_for_cpu ()
+frv_default_flags_for_cpu (void)
{
switch (frv_cpu_type)
{
@@ -398,7 +374,7 @@ frv_default_flags_for_cpu ()
`-O'. That is what `OPTIMIZATION_OPTIONS' is for. */
void
-frv_override_options ()
+frv_override_options (void)
{
int regno, i;
@@ -620,9 +596,7 @@ frv_override_options ()
/* On the FRV, possibly disable VLIW packing which is done by the 2nd
scheduling pass at the current time. */
void
-frv_optimization_options (level, size)
- int level;
- int size ATTRIBUTE_UNUSED;
+frv_optimization_options (int level, int size ATTRIBUTE_UNUSED)
{
if (level >= 2)
{
@@ -639,9 +613,7 @@ frv_optimization_options (level, size)
/* Return true if NAME (a STRING_CST node) begins with PREFIX. */
static int
-frv_string_begins_with (name, prefix)
- tree name;
- const char *prefix;
+frv_string_begins_with (tree name, const char *prefix)
{
int prefix_len = strlen (prefix);
@@ -671,7 +643,7 @@ frv_string_begins_with (name, prefix)
target switches are opposed to them.) */
void
-frv_conditional_register_usage ()
+frv_conditional_register_usage (void)
{
int i;
@@ -878,7 +850,7 @@ frv_conditional_register_usage ()
*/
frv_stack_t *
-frv_stack_info ()
+frv_stack_info (void)
{
static frv_stack_t info, zero_info;
frv_stack_t *info_ptr = &info;
@@ -1206,8 +1178,7 @@ frv_stack_info ()
/* Print the information about the frv stack offsets, etc. when debugging. */
void
-frv_debug_stack (info)
- frv_stack_t *info;
+frv_debug_stack (frv_stack_t *info)
{
int range;
@@ -1273,7 +1244,7 @@ static int frv_insn_packing_flag;
/* True if the current function contains a far jump. */
static int
-frv_function_contains_far_jump ()
+frv_function_contains_far_jump (void)
{
rtx insn = get_insns ();
while (insn != NULL
@@ -1290,9 +1261,7 @@ frv_function_contains_far_jump ()
will return correctly. It also does the VLIW packing. */
static void
-frv_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+frv_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
/* If no frame was created, check whether the function uses a call
instruction to implement a far jump. If so, save the link in gr3 and
@@ -1339,12 +1308,12 @@ frv_function_prologue (file, size)
/* Return the next available temporary register in a given class. */
static rtx
-frv_alloc_temp_reg (info, class, mode, mark_as_used, no_abort)
- frv_tmp_reg_t *info; /* which registers are available */
- enum reg_class class; /* register class desired */
- enum machine_mode mode; /* mode to allocate register with */
- int mark_as_used; /* register not available after allocation */
- int no_abort; /* return NULL instead of aborting */
+frv_alloc_temp_reg (
+ frv_tmp_reg_t *info, /* which registers are available */
+ enum reg_class class, /* register class desired */
+ enum machine_mode mode, /* mode to allocate register with */
+ int mark_as_used, /* register not available after allocation */
+ int no_abort) /* return NULL instead of aborting */
{
int regno = info->next_reg[ (int)class ];
int orig_regno = regno;
@@ -1386,8 +1355,7 @@ frv_alloc_temp_reg (info, class, mode, mark_as_used, no_abort)
The function returns a constant rtx if OFFSET is small enough, otherwise
it loads the constant into register OFFSET_REGNO and returns that. */
static rtx
-frv_frame_offset_rtx (offset)
- int offset;
+frv_frame_offset_rtx (int offset)
{
rtx offset_rtx = GEN_INT (offset);
if (IN_RANGE_P (offset, -2048, 2047))
@@ -1409,10 +1377,7 @@ frv_frame_offset_rtx (offset)
/* Generate (mem:MODE (plus:Pmode BASE (frv_frame_offset OFFSET)))). The
prologue and epilogue uses such expressions to access the stack. */
static rtx
-frv_frame_mem (mode, base, offset)
- enum machine_mode mode;
- rtx base;
- int offset;
+frv_frame_mem (enum machine_mode mode, rtx base, int offset)
{
return gen_rtx_MEM (mode, gen_rtx_PLUS (Pmode,
base,
@@ -1429,9 +1394,7 @@ frv_frame_mem (mode, base, offset)
or SEQUENCE that has several sets, each set must be individually marked
as frame-related. */
static rtx
-frv_dwarf_store (reg, offset)
- rtx reg;
- int offset;
+frv_dwarf_store (rtx reg, int offset)
{
rtx set = gen_rtx_SET (VOIDmode,
gen_rtx_MEM (GET_MODE (reg),
@@ -1448,9 +1411,7 @@ frv_dwarf_store (reg, offset)
frame-related and has a REG_FRAME_RELATED_EXPR note containing
DWARF_PATTERN. */
static void
-frv_frame_insn (pattern, dwarf_pattern)
- rtx pattern;
- rtx dwarf_pattern;
+frv_frame_insn (rtx pattern, rtx dwarf_pattern)
{
rtx insn = emit_insn (pattern);
RTX_FRAME_RELATED_P (insn) = 1;
@@ -1477,10 +1438,7 @@ frv_frame_insn (pattern, dwarf_pattern)
The function takes care of the moves to and from SPRs, using TEMP_REGNO
as a temporary in such cases. */
static void
-frv_frame_access (accessor, reg, stack_offset)
- frv_frame_accessor_t *accessor;
- rtx reg;
- int stack_offset;
+frv_frame_access (frv_frame_accessor_t *accessor, rtx reg, int stack_offset)
{
enum machine_mode mode = GET_MODE (reg);
rtx mem = frv_frame_mem (mode,
@@ -1531,10 +1489,9 @@ frv_frame_access (accessor, reg, stack_offset)
is the stack information generated by frv_stack_info, and REG_SET is the
number of the register set to transfer. */
static void
-frv_frame_access_multi (accessor, info, reg_set)
- frv_frame_accessor_t *accessor;
- frv_stack_t *info;
- int reg_set;
+frv_frame_access_multi (frv_frame_accessor_t *accessor,
+ frv_stack_t *info,
+ int reg_set)
{
frv_stack_regs_t *regs_info;
int regno;
@@ -1554,9 +1511,7 @@ frv_frame_access_multi (accessor, info, reg_set)
them if OP is FRV_LOAD. INFO is the stack information generated by
frv_stack_info. */
static void
-frv_frame_access_standard_regs (op, info)
- enum frv_stack_op op;
- frv_stack_t *info;
+frv_frame_access_standard_regs (enum frv_stack_op op, frv_stack_t *info)
{
frv_frame_accessor_t accessor;
@@ -1579,7 +1534,7 @@ frv_frame_access_standard_regs (op, info)
Also any insns generated here should have RTX_FRAME_RELATED_P(insn) = 1
so that the debug info generation code can handle them properly. */
void
-frv_expand_prologue ()
+frv_expand_prologue (void)
{
frv_stack_t *info = frv_stack_info ();
rtx sp = stack_pointer_rtx;
@@ -1689,12 +1644,11 @@ frv_expand_prologue ()
/* Under frv, all of the work is done via frv_expand_epilogue, but
- this function provides a convient place to do cleanup. */
+ this function provides a convenient place to do cleanup. */
static void
-frv_function_epilogue (file, size)
- FILE *file ATTRIBUTE_UNUSED;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+frv_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
frv_stack_cache = (frv_stack_t *)0;
@@ -1719,8 +1673,7 @@ frv_function_epilogue (file, size)
slots for arguments passed to the current function. */
void
-frv_expand_epilogue (sibcall_p)
- int sibcall_p;
+frv_expand_epilogue (int sibcall_p)
{
frv_stack_t *info = frv_stack_info ();
rtx fp = frame_pointer_rtx;
@@ -1821,12 +1774,11 @@ frv_expand_epilogue (sibcall_p)
varargs. */
static void
-frv_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
- FILE *file;
- tree thunk_fndecl ATTRIBUTE_UNUSED;
- HOST_WIDE_INT delta;
- HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED;
- tree function;
+frv_asm_output_mi_thunk (FILE *file,
+ tree thunk_fndecl ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT delta,
+ HOST_WIDE_INT vcall_offset ATTRIBUTE_UNUSED,
+ tree function)
{
const char *name_func = XSTR (XEXP (DECL_RTL (function), 0), 0);
const char *name_arg0 = reg_names[FIRST_ARG_REGNUM];
@@ -1909,7 +1861,7 @@ frv_asm_output_mi_thunk (file, thunk_fndecl, delta, vcall_offset, function)
/* On frv, create a frame whenever we need to create stack */
int
-frv_frame_pointer_required ()
+frv_frame_pointer_required (void)
{
if (! current_function_is_leaf)
return TRUE;
@@ -1943,9 +1895,7 @@ frv_frame_pointer_required ()
/* See frv_stack_info for more details on the frv stack frame. */
int
-frv_initial_elimination_offset (from, to)
- int from;
- int to;
+frv_initial_elimination_offset (int from, int to)
{
frv_stack_t *info = frv_stack_info ();
int ret = 0;
@@ -1954,7 +1904,7 @@ frv_initial_elimination_offset (from, to)
ret = info->total_size - info->pretend_size;
else if (to == STACK_POINTER_REGNUM && from == FRAME_POINTER_REGNUM)
- ret = - info->reg_offset[FRAME_POINTER_REGNUM];
+ ret = info->reg_offset[FRAME_POINTER_REGNUM];
else if (to == FRAME_POINTER_REGNUM && from == ARG_POINTER_REGNUM)
ret = (info->total_size
@@ -2002,12 +1952,11 @@ frv_initial_elimination_offset (from, to)
this case. */
void
-frv_setup_incoming_varargs (cum, mode, type, pretend_size, second_time)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int *pretend_size;
- int second_time;
+frv_setup_incoming_varargs (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ int *pretend_size,
+ int second_time)
{
if (TARGET_DEBUG_ARG)
fprintf (stderr,
@@ -2026,7 +1975,7 @@ frv_setup_incoming_varargs (cum, mode, type, pretend_size, second_time)
the library function `__builtin_saveregs'. */
rtx
-frv_expand_builtin_saveregs ()
+frv_expand_builtin_saveregs (void)
{
int offset = UNITS_PER_WORD * FRV_NUM_ARG_REGS;
@@ -2041,9 +1990,7 @@ frv_expand_builtin_saveregs ()
/* Expand __builtin_va_start to do the va_start macro. */
void
-frv_expand_builtin_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+frv_expand_builtin_va_start (tree valist, rtx nextarg)
{
tree t;
int num = cfun->args_info - FIRST_ARG_REGNUM - FRV_NUM_ARG_REGS;
@@ -2070,9 +2017,7 @@ frv_expand_builtin_va_start (valist, nextarg)
/* Expand __builtin_va_arg to do the va_arg macro. */
rtx
-frv_expand_builtin_va_arg(valist, type)
- tree valist;
- tree type;
+frv_expand_builtin_va_arg (tree valist, tree type)
{
rtx addr;
rtx mem;
@@ -2117,8 +2062,7 @@ frv_expand_builtin_va_arg(valist, type)
#endif
int
-frv_expand_block_move (operands)
- rtx operands[];
+frv_expand_block_move (rtx operands[])
{
rtx orig_dest = operands[0];
rtx orig_src = operands[1];
@@ -2218,8 +2162,7 @@ frv_expand_block_move (operands)
operands[2] is the alignment */
int
-frv_expand_block_clear (operands)
- rtx operands[];
+frv_expand_block_clear (rtx operands[])
{
rtx orig_dest = operands[0];
rtx bytes_rtx = operands[1];
@@ -2291,9 +2234,7 @@ static rtx *frv_insn_operands;
if it is necessary. */
const char *
-frv_asm_output_opcode (f, ptr)
- FILE *f;
- const char *ptr;
+frv_asm_output_opcode (FILE *f, const char *ptr)
{
int c;
@@ -2328,10 +2269,7 @@ frv_asm_output_opcode (f, ptr)
insns. */
void
-frv_final_prescan_insn (insn, opvec, noperands)
- rtx insn;
- rtx *opvec;
- int noperands ATTRIBUTE_UNUSED;
+frv_final_prescan_insn (rtx insn, rtx *opvec, int noperands ATTRIBUTE_UNUSED)
{
if (! PACKING_FLAG_USED_P())
return;
@@ -2362,7 +2300,7 @@ frv_final_prescan_insn (insn, opvec, noperands)
/* Set frv_insn_packing_flag to FALSE if the next instruction should
be packed with this one. Set it to TRUE otherwise. If the next
- instruction is an asm insntruction, this statement will set the
+ instruction is an asm instruction, this statement will set the
flag to TRUE, and that value will still hold when the asm operands
themselves are printed. */
frv_insn_packing_flag = ! (insn && INSN_P (insn)
@@ -2381,8 +2319,7 @@ frv_final_prescan_insn (insn, opvec, noperands)
/* The default is correct, but we need to make sure the frame gets created. */
rtx
-frv_dynamic_chain_address (frame)
- rtx frame;
+frv_dynamic_chain_address (rtx frame)
{
cfun->machine->frame_needed = 1;
return frame;
@@ -2400,9 +2337,7 @@ frv_dynamic_chain_address (frame)
address of other frames. */
rtx
-frv_return_addr_rtx (count, frame)
- int count ATTRIBUTE_UNUSED;
- rtx frame;
+frv_return_addr_rtx (int count ATTRIBUTE_UNUSED, rtx frame)
{
cfun->machine->frame_needed = 1;
return gen_rtx_MEM (Pmode, plus_constant (frame, 8));
@@ -2417,10 +2352,7 @@ frv_return_addr_rtx (count, frame)
GO_IF_LEGITIMATE_ADDRESS forbids register+register addresses, which
this function cannot handle. */
rtx
-frv_index_memory (memref, mode, index)
- rtx memref;
- enum machine_mode mode;
- int index;
+frv_index_memory (rtx memref, enum machine_mode mode, int index)
{
rtx base = XEXP (memref, 0);
if (GET_CODE (base) == PRE_MODIFY)
@@ -2432,9 +2364,7 @@ frv_index_memory (memref, mode, index)
/* Print a memory address as an operand to reference that memory location. */
void
-frv_print_operand_address (stream, x)
- FILE * stream;
- rtx x;
+frv_print_operand_address (FILE * stream, rtx x)
{
if (GET_CODE (x) == MEM)
x = XEXP (x, 0);
@@ -2467,9 +2397,7 @@ frv_print_operand_address (stream, x)
static void
-frv_print_operand_memory_reference_reg (stream, x)
- FILE *stream;
- rtx x;
+frv_print_operand_memory_reference_reg (FILE * stream, rtx x)
{
int regno = true_regnum (x);
if (GPR_P (regno))
@@ -2481,10 +2409,7 @@ frv_print_operand_memory_reference_reg (stream, x)
/* Print a memory reference suitable for the ld/st instructions. */
static void
-frv_print_operand_memory_reference (stream, x, addr_offset)
- FILE *stream;
- rtx x;
- int addr_offset;
+frv_print_operand_memory_reference (FILE * stream, rtx x, int addr_offset)
{
rtx x0 = NULL_RTX;
rtx x1 = NULL_RTX;
@@ -2594,8 +2519,7 @@ frv_print_operand_memory_reference (stream, x, addr_offset)
#define FRV_JUMP_NOT_LIKELY 0
static int
-frv_print_operand_jump_hint (insn)
- rtx insn;
+frv_print_operand_jump_hint (rtx insn)
{
rtx note;
rtx labelref;
@@ -2692,10 +2616,7 @@ frv_print_operand_jump_hint (insn)
are valid with the `PRINT_OPERAND_PUNCT_VALID_P' macro. */
void
-frv_print_operand (file, x, code)
- FILE * file;
- rtx x;
- int code;
+frv_print_operand (FILE * file, rtx x, int code)
{
HOST_WIDE_INT value;
int offset;
@@ -3022,12 +2943,11 @@ frv_print_operand (file, x, code)
FNTYPE is nonzero, but never both of them at once. */
void
-frv_init_cumulative_args (cum, fntype, libname, fndecl, incoming)
- CUMULATIVE_ARGS *cum;
- tree fntype;
- rtx libname;
- tree fndecl;
- int incoming;
+frv_init_cumulative_args (CUMULATIVE_ARGS *cum,
+ tree fntype,
+ rtx libname,
+ tree fndecl,
+ int incoming)
{
*cum = FIRST_ARG_REGNUM;
@@ -3063,9 +2983,8 @@ frv_init_cumulative_args (cum, fntype, libname, fndecl, incoming)
`PARM_BOUNDARY' is used for all arguments. */
int
-frv_function_arg_boundary (mode, type)
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
+frv_function_arg_boundary (enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED)
{
return BITS_PER_WORD;
}
@@ -3102,12 +3021,11 @@ frv_function_arg_boundary (mode, type)
stack and then loaded into a register. */
rtx
-frv_function_arg (cum, mode, type, named, incoming)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int named;
- int incoming ATTRIBUTE_UNUSED;
+frv_function_arg (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ int named,
+ int incoming ATTRIBUTE_UNUSED)
{
enum machine_mode xmode = (mode == BLKmode) ? SImode : mode;
int arg_num = *cum;
@@ -3152,11 +3070,10 @@ frv_function_arg (cum, mode, type, named, incoming)
for arguments without any special help. */
void
-frv_function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int named;
+frv_function_arg_advance (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ int named)
{
enum machine_mode xmode = (mode == BLKmode) ? SImode : mode;
int bytes = GET_MODE_SIZE (xmode);
@@ -3189,11 +3106,10 @@ frv_function_arg_advance (cum, mode, type, named)
the called function. */
int
-frv_function_arg_partial_nregs (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int named ATTRIBUTE_UNUSED;
+frv_function_arg_partial_nregs (CUMULATIVE_ARGS *cum,
+ enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED,
+ int named ATTRIBUTE_UNUSED)
{
enum machine_mode xmode = (mode == BLKmode) ? SImode : mode;
int bytes = GET_MODE_SIZE (xmode);
@@ -3226,11 +3142,10 @@ frv_function_arg_partial_nregs (cum, mode, type, named)
MUST_PASS_IN_STACK (MODE, TYPE) */
int
-frv_function_arg_pass_by_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+frv_function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode,
+ tree type,
+ int named ATTRIBUTE_UNUSED)
{
return MUST_PASS_IN_STACK (mode, type);
}
@@ -3245,11 +3160,10 @@ frv_function_arg_pass_by_reference (cum, mode, type, named)
otherwise a copy must be made. */
int
-frv_function_arg_callee_copies (cum, mode, type, named)
- CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
- int named ATTRIBUTE_UNUSED;
+frv_function_arg_callee_copies (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int named ATTRIBUTE_UNUSED)
{
return 0;
}
@@ -3259,11 +3173,10 @@ frv_function_arg_callee_copies (cum, mode, type, named)
copying it to a pseudo register. */
int
-frv_function_arg_keep_as_reference (cum, mode, type, named)
- CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type ATTRIBUTE_UNUSED;
- int named ATTRIBUTE_UNUSED;
+frv_function_arg_keep_as_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type ATTRIBUTE_UNUSED,
+ int named ATTRIBUTE_UNUSED)
{
return 0;
}
@@ -3272,9 +3185,7 @@ frv_function_arg_keep_as_reference (cum, mode, type, named)
/* Return true if a register is ok to use as a base or index register. */
static FRV_INLINE int
-frv_regno_ok_for_base_p (regno, strict_p)
- int regno;
- int strict_p;
+frv_regno_ok_for_base_p (int regno, int strict_p)
{
if (GPR_P (regno))
return TRUE;
@@ -3346,11 +3257,10 @@ frv_regno_ok_for_base_p (regno, strict_p)
`PRINT_OPERAND_ADDRESS'. */
int
-frv_legitimate_address_p (mode, x, strict_p, condexec_p)
- enum machine_mode mode;
- rtx x;
- int strict_p;
- int condexec_p;
+frv_legitimate_address_p (enum machine_mode mode,
+ rtx x,
+ int strict_p,
+ int condexec_p)
{
rtx x0, x1;
int ret = 0;
@@ -3503,10 +3413,9 @@ frv_legitimate_address_p (mode, x, strict_p, condexec_p)
can generate better code. */
rtx
-frv_legitimize_address (x, oldx, mode)
- rtx x;
- rtx oldx ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+frv_legitimize_address (rtx x,
+ rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
rtx ret = NULL_RTX;
@@ -3537,10 +3446,7 @@ frv_legitimize_address (x, oldx, mode)
the operand is used by a predicated instruction. */
static int
-frv_legitimate_memory_operand (op, mode, condexec_p)
- rtx op;
- enum machine_mode mode;
- int condexec_p;
+frv_legitimate_memory_operand (rtx op, enum machine_mode mode, int condexec_p)
{
return ((GET_MODE (op) == mode || mode == VOIDmode)
&& GET_CODE (op) == MEM
@@ -3552,9 +3458,8 @@ frv_legitimate_memory_operand (op, mode, condexec_p)
/* Return 1 is OP is a memory operand, or will be turned into one by
reload. */
-int frv_load_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+frv_load_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
@@ -3575,9 +3480,8 @@ int frv_load_operand (op, mode)
/* Return 1 if operand is a GPR register or a FPR register. */
-int gpr_or_fpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+gpr_or_fpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -3604,9 +3508,8 @@ int gpr_or_fpr_operand (op, mode)
/* Return 1 if operand is a GPR register or 12 bit signed immediate. */
-int gpr_or_int12_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+gpr_or_int12_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return IN_RANGE_P (INTVAL (op), -2048, 2047);
@@ -3631,9 +3534,8 @@ int gpr_or_int12_operand (op, mode)
/* Return 1 if operand is a GPR register, or a FPR register, or a 12 bit
signed immediate. */
-int gpr_fpr_or_int12_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+gpr_fpr_or_int12_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -3663,9 +3565,8 @@ int gpr_fpr_or_int12_operand (op, mode)
/* Return 1 if operand is a register or 6 bit signed immediate. */
-int fpr_or_int6_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+fpr_or_int6_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return IN_RANGE_P (INTVAL (op), -32, 31);
@@ -3689,9 +3590,8 @@ int fpr_or_int6_operand (op, mode)
/* Return 1 if operand is a register or 10 bit signed immediate. */
-int gpr_or_int10_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+gpr_or_int10_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return IN_RANGE_P (INTVAL (op), -512, 511);
@@ -3715,9 +3615,8 @@ int gpr_or_int10_operand (op, mode)
/* Return 1 if operand is a register or an integer immediate. */
-int gpr_or_int_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+int
+gpr_or_int_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == CONST_INT)
return TRUE;
@@ -3741,9 +3640,8 @@ int gpr_or_int_operand (op, mode)
/* Return 1 if operand is a 12 bit signed immediate. */
-int int12_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+int12_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return FALSE;
@@ -3753,9 +3651,8 @@ int int12_operand (op, mode)
/* Return 1 if operand is a 6 bit signed immediate. */
-int int6_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+int6_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return FALSE;
@@ -3765,36 +3662,32 @@ int int6_operand (op, mode)
/* Return 1 if operand is a 5 bit signed immediate. */
-int int5_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+int5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), -16, 15);
}
/* Return 1 if operand is a 5 bit unsigned immediate. */
-int uint5_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+uint5_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 31);
}
/* Return 1 if operand is a 4 bit unsigned immediate. */
-int uint4_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+uint4_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 15);
}
/* Return 1 if operand is a 1 bit unsigned immediate (0 or 1). */
-int uint1_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+uint1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == CONST_INT && IN_RANGE_P (INTVAL (op), 0, 1);
}
@@ -3802,9 +3695,8 @@ int uint1_operand (op, mode)
/* Return 1 if operand is an integer constant that takes 2 instructions
to load up and can be split into sethi/setlo instructions.. */
-int int_2word_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+int_2word_operand(rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
HOST_WIDE_INT value;
REAL_VALUE_TYPE rv;
@@ -3850,9 +3742,7 @@ int int_2word_operand (op, mode)
/* Return 1 if operand is the pic address register. */
int
-pic_register_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+pic_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (! flag_pic)
return FALSE;
@@ -3867,11 +3757,10 @@ pic_register_operand (op, mode)
}
/* Return 1 if operand is a symbolic reference when a PIC option is specified
- that takes 3 seperate instructions to form. */
+ that takes 3 separate instructions to form. */
-int pic_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+pic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (! flag_pic)
return FALSE;
@@ -3898,9 +3787,7 @@ int pic_symbolic_operand (op, mode)
/* Return 1 if operand is the small data register. */
int
-small_data_register_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_data_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != REG)
return FALSE;
@@ -3914,9 +3801,8 @@ small_data_register_operand (op, mode)
/* Return 1 if operand is a symbolic reference to a small data area static or
global object. */
-int small_data_symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+small_data_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -3935,9 +3821,8 @@ int small_data_symbolic_operand (op, mode)
/* Return 1 if operand is a 16 bit unsigned immediate */
-int uint16_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+uint16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return FALSE;
@@ -3947,9 +3832,8 @@ int uint16_operand (op, mode)
/* Return 1 if operand is an integer constant with the bottom 16 bits clear */
-int upper_int16_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int
+upper_int16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return FALSE;
@@ -3960,9 +3844,7 @@ int upper_int16_operand (op, mode)
/* Return true if operand is a GPR register. */
int
-integer_register_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+integer_register_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
@@ -3985,9 +3867,7 @@ integer_register_operand (op, mode)
here, in order to prevent a combine bug. */
int
-gpr_no_subreg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gpr_no_subreg_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
@@ -4001,9 +3881,7 @@ gpr_no_subreg_operand (op, mode)
/* Return true if operand is a FPR register. */
int
-fpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fpr_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
@@ -4025,9 +3903,7 @@ fpr_operand (op, mode)
/* Return true if operand is an even GPR or FPR register. */
int
-even_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+even_reg_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4061,9 +3937,7 @@ even_reg_operand (op, mode)
/* Return true if operand is an odd GPR register. */
int
-odd_reg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+odd_reg_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4098,9 +3972,7 @@ odd_reg_operand (op, mode)
/* Return true if operand is an even GPR register. */
int
-even_gpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+even_gpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4131,9 +4003,7 @@ even_gpr_operand (op, mode)
/* Return true if operand is an odd GPR register. */
int
-odd_gpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+odd_gpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4165,9 +4035,7 @@ odd_gpr_operand (op, mode)
/* Return true if operand is a quad aligned FPR register. */
int
-quad_fpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+quad_fpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4198,9 +4066,7 @@ quad_fpr_operand (op, mode)
/* Return true if operand is an even FPR register. */
int
-even_fpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+even_fpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4231,9 +4097,7 @@ even_fpr_operand (op, mode)
/* Return true if operand is an odd FPR register. */
int
-odd_fpr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+odd_fpr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4270,9 +4134,7 @@ odd_fpr_operand (op, mode)
the stack and the address taken and passed through to another function. */
int
-dbl_memory_one_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+dbl_memory_one_insn_operand (rtx op, enum machine_mode mode)
{
rtx addr;
rtx addr_reg;
@@ -4323,9 +4185,7 @@ dbl_memory_one_insn_operand (op, mode)
use two instructions to load or store. */
int
-dbl_memory_two_insn_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+dbl_memory_two_insn_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM)
return FALSE;
@@ -4343,9 +4203,7 @@ dbl_memory_two_insn_operand (op, mode)
operation. */
int
-move_destination_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_destination_operand (rtx op, enum machine_mode mode)
{
rtx subreg;
enum rtx_code code;
@@ -4387,9 +4245,7 @@ move_destination_operand (op, mode)
operation. */
int
-move_source_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_source_operand (rtx op, enum machine_mode mode)
{
rtx subreg;
enum rtx_code code;
@@ -4438,9 +4294,7 @@ move_source_operand (op, mode)
move operation. */
int
-condexec_dest_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_dest_operand (rtx op, enum machine_mode mode)
{
rtx subreg;
enum rtx_code code;
@@ -4482,9 +4336,7 @@ condexec_dest_operand (op, mode)
move operation. */
int
-condexec_source_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_source_operand (rtx op, enum machine_mode mode)
{
rtx subreg;
enum rtx_code code;
@@ -4530,9 +4382,7 @@ condexec_source_operand (op, mode)
appropriate type. */
int
-reg_or_0_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_0_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -4557,9 +4407,7 @@ reg_or_0_operand (op, mode)
/* Return true if operand is the link register */
int
-lr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+lr_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != REG)
return FALSE;
@@ -4576,9 +4424,7 @@ lr_operand (op, mode)
/* Return true if operand is a gpr register or a valid memory operation. */
int
-gpr_or_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+gpr_or_memory_operand (rtx op, enum machine_mode mode)
{
return (integer_register_operand (op, mode)
|| frv_legitimate_memory_operand (op, mode, FALSE));
@@ -4587,9 +4433,7 @@ gpr_or_memory_operand (op, mode)
/* Return true if operand is a fpr register or a valid memory operation. */
int
-fpr_or_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fpr_or_memory_operand (rtx op, enum machine_mode mode)
{
return (fpr_operand (op, mode)
|| frv_legitimate_memory_operand (op, mode, FALSE));
@@ -4598,9 +4442,7 @@ fpr_or_memory_operand (op, mode)
/* Return true if operand is an icc register */
int
-icc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+icc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4617,9 +4459,7 @@ icc_operand (op, mode)
/* Return true if operand is an fcc register */
int
-fcc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fcc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4636,9 +4476,7 @@ fcc_operand (op, mode)
/* Return true if operand is either an fcc or icc register */
int
-cc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+cc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4658,9 +4496,7 @@ cc_operand (op, mode)
/* Return true if operand is an integer CCR register */
int
-icr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+icr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4677,9 +4513,7 @@ icr_operand (op, mode)
/* Return true if operand is an fcc register */
int
-fcr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+fcr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4696,9 +4530,7 @@ fcr_operand (op, mode)
/* Return true if operand is either an fcc or icc register */
int
-cr_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+cr_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -4718,9 +4550,7 @@ cr_operand (op, mode)
/* Return true if operand is a memory reference suitable for a call. */
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode && GET_CODE (op) != CONST_INT)
return FALSE;
@@ -4738,9 +4568,7 @@ call_operand (op, mode)
/* Return true if operator is a kind of relational operator. */
int
-relational_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+relational_operator (rtx op, enum machine_mode mode)
{
rtx op0;
rtx op1;
@@ -4798,9 +4626,7 @@ relational_operator (op, mode)
/* Return true if operator is a signed integer relational operator */
int
-signed_relational_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+signed_relational_operator (rtx op, enum machine_mode mode)
{
rtx op0;
rtx op1;
@@ -4844,9 +4670,7 @@ signed_relational_operator (op, mode)
/* Return true if operator is a signed integer relational operator */
int
-unsigned_relational_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+unsigned_relational_operator (rtx op, enum machine_mode mode)
{
rtx op0;
rtx op1;
@@ -4888,9 +4712,7 @@ unsigned_relational_operator (op, mode)
/* Return true if operator is a floating point relational operator */
int
-float_relational_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+float_relational_operator (rtx op, enum machine_mode mode)
{
rtx op0;
rtx op1;
@@ -4938,9 +4760,7 @@ float_relational_operator (op, mode)
/* Return true if operator is EQ/NE of a conditional execution register. */
int
-ccr_eqne_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ccr_eqne_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
rtx op0;
@@ -4979,9 +4799,7 @@ ccr_eqne_operator (op, mode)
unsigned). */
int
-minmax_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+minmax_operator (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && mode != GET_MODE (op))
return FALSE;
@@ -5011,9 +4829,7 @@ minmax_operator (op, mode)
conditionally and takes 1 cycle. */
int
-condexec_si_binary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_si_binary_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5041,9 +4857,7 @@ condexec_si_binary_operator (op, mode)
executed conditionally by a media instruction. */
int
-condexec_si_media_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_si_media_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5066,9 +4880,7 @@ condexec_si_media_operator (op, mode)
conditionally. */
int
-condexec_si_divide_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_si_divide_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5090,9 +4902,7 @@ condexec_si_divide_operator (op, mode)
conditionally. */
int
-condexec_si_unary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_si_unary_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5114,9 +4924,7 @@ condexec_si_unary_operator (op, mode)
evaluated conditionally by floating-point instructions. */
int
-condexec_sf_conv_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_sf_conv_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5139,9 +4947,7 @@ condexec_sf_conv_operator (op, mode)
instructions. */
int
-condexec_sf_add_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_sf_add_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5163,9 +4969,7 @@ condexec_sf_add_operator (op, mode)
executed. */
int
-condexec_memory_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_memory_operand (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
rtx addr;
@@ -5202,9 +5006,7 @@ condexec_memory_operand (op, mode)
register. */
int
-intop_compare_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+intop_compare_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5237,9 +5039,7 @@ intop_compare_operator (op, mode)
with a setcc operation inside of a conditional execution. */
int
-condexec_intop_cmp_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+condexec_intop_cmp_operator (rtx op, enum machine_mode mode)
{
enum machine_mode op_mode = GET_MODE (op);
@@ -5271,9 +5071,7 @@ condexec_intop_cmp_operator (op, mode)
/* Return 1 if operand is a valid ACC register number */
int
-acc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+acc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -5298,9 +5096,7 @@ acc_operand (op, mode)
/* Return 1 if operand is a valid even ACC register number */
int
-even_acc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+even_acc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -5325,9 +5121,7 @@ even_acc_operand (op, mode)
/* Return 1 if operand is zero or four */
int
-quad_acc_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+quad_acc_operand (rtx op, enum machine_mode mode)
{
int regno;
@@ -5352,9 +5146,7 @@ quad_acc_operand (op, mode)
/* Return 1 if operand is a valid ACCG register number */
int
-accg_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+accg_operand (rtx op, enum machine_mode mode)
{
if (GET_MODE (op) != mode && mode != VOIDmode)
return FALSE;
@@ -5378,7 +5170,7 @@ accg_operand (op, mode)
epilog code. For frv, we only do it if there was no stack allocation. */
int
-direct_return_p ()
+direct_return_p (void)
{
frv_stack_t *info;
@@ -5395,9 +5187,7 @@ direct_return_p ()
instructions are emitted. */
int
-frv_emit_movsi (dest, src)
- rtx dest;
- rtx src;
+frv_emit_movsi (rtx dest, rtx src)
{
int base_regno = -1;
@@ -5468,9 +5258,7 @@ frv_emit_movsi (dest, src)
/* Return a string to output a single word move. */
const char *
-output_move_single (operands, insn)
- rtx operands[];
- rtx insn;
+output_move_single (rtx operands[], rtx insn)
{
rtx dest = operands[0];
rtx src = operands[1];
@@ -5688,9 +5476,7 @@ output_move_single (operands, insn)
/* Return a string to output a double word move. */
const char *
-output_move_double (operands, insn)
- rtx operands[];
- rtx insn;
+output_move_double (rtx operands[], rtx insn)
{
rtx dest = operands[0];
rtx src = operands[1];
@@ -5821,9 +5607,7 @@ output_move_double (operands, insn)
Operand3 -- source */
const char *
-output_condmove_single (operands, insn)
- rtx operands[];
- rtx insn;
+output_condmove_single (rtx operands[], rtx insn)
{
rtx dest = operands[2];
rtx src = operands[3];
@@ -5962,10 +5746,7 @@ output_condmove_single (operands, insn)
comparison was done it. */
static rtx
-frv_emit_comparison (test, op0, op1)
- enum rtx_code test;
- rtx op0;
- rtx op1;
+frv_emit_comparison (enum rtx_code test, rtx op0, rtx op1)
{
enum machine_mode cc_mode;
rtx cc_reg;
@@ -5996,9 +5777,7 @@ frv_emit_comparison (test, op0, op1)
conditional execution, but that confuses the rest of the compiler. */
int
-frv_emit_cond_branch (test, label)
- enum rtx_code test;
- rtx label;
+frv_emit_cond_branch (enum rtx_code test, rtx label)
{
rtx test_rtx;
rtx label_ref;
@@ -6023,9 +5802,7 @@ frv_emit_cond_branch (test, label)
operands were previously stored in frv_compare_op0 and frv_compare_op1. */
int
-frv_emit_scc (test, target)
- enum rtx_code test;
- rtx target;
+frv_emit_scc (enum rtx_code test, rtx target)
{
rtx set;
rtx test_rtx;
@@ -6053,15 +5830,10 @@ frv_emit_scc (test, target)
/* Split a SCC instruction into component parts, returning a SEQUENCE to hold
- the seperate insns. */
+ the separate insns. */
rtx
-frv_split_scc (dest, test, cc_reg, cr_reg, value)
- rtx dest;
- rtx test;
- rtx cc_reg;
- rtx cr_reg;
- HOST_WIDE_INT value;
+frv_split_scc (rtx dest, rtx test, rtx cc_reg, rtx cr_reg, HOST_WIDE_INT value)
{
rtx ret;
@@ -6096,11 +5868,7 @@ frv_split_scc (dest, test, cc_reg, cr_reg, value)
move. */
int
-frv_emit_cond_move (dest, test_rtx, src1, src2)
- rtx dest;
- rtx test_rtx;
- rtx src1;
- rtx src2;
+frv_emit_cond_move (rtx dest, rtx test_rtx, rtx src1, rtx src2)
{
rtx set;
rtx clobber_cc;
@@ -6173,12 +5941,11 @@ frv_emit_cond_move (dest, test_rtx, src1, src2)
}
-/* Split a conditonal move into constituent parts, returning a SEQUENCE
+/* Split a conditional move into constituent parts, returning a SEQUENCE
containing all of the insns. */
rtx
-frv_split_cond_move (operands)
- rtx operands[];
+frv_split_cond_move (rtx operands[])
{
rtx dest = operands[0];
rtx test = operands[1];
@@ -6273,9 +6040,7 @@ frv_split_cond_move (operands)
/* Split (set DEST SOURCE), where DEST is a double register and SOURCE is a
memory location that is not known to be dword-aligned. */
void
-frv_split_double_load (dest, source)
- rtx dest;
- rtx source;
+frv_split_double_load (rtx dest, rtx source)
{
int regno = REGNO (dest);
rtx dest1 = gen_highpart (SImode, dest);
@@ -6311,9 +6076,7 @@ frv_split_double_load (dest, source)
/* Split (set DEST SOURCE), where DEST refers to a dword memory location
and SOURCE is either a double register or the constant zero. */
void
-frv_split_double_store (dest, source)
- rtx dest;
- rtx source;
+frv_split_double_store (rtx dest, rtx source)
{
rtx dest1 = change_address (dest, SImode, NULL);
rtx dest2 = frv_index_memory (dest, SImode, 1);
@@ -6334,8 +6097,7 @@ frv_split_double_store (dest, source)
insns. */
rtx
-frv_split_minmax (operands)
- rtx operands[];
+frv_split_minmax (rtx operands[])
{
rtx dest = operands[0];
rtx minmax = operands[1];
@@ -6415,8 +6177,7 @@ frv_split_minmax (operands)
insns. */
rtx
-frv_split_abs (operands)
- rtx operands[];
+frv_split_abs (rtx operands[])
{
rtx dest = operands[0];
rtx src = operands[1];
@@ -6458,9 +6219,7 @@ frv_split_abs (operands)
register used in an insn. */
static int
-frv_clear_registers_used (ptr, data)
- rtx *ptr;
- void *data;
+frv_clear_registers_used (rtx *ptr, void *data)
{
if (GET_CODE (*ptr) == REG)
{
@@ -6488,8 +6247,7 @@ frv_clear_registers_used (ptr, data)
/* On the FR-V, we don't have any extra fields per se, but it is useful hook to
initialize the static storage. */
void
-frv_ifcvt_init_extra_fields (ce_info)
- ce_if_block_t *ce_info ATTRIBUTE_UNUSED;
+frv_ifcvt_init_extra_fields (ce_if_block_t *ce_info ATTRIBUTE_UNUSED)
{
frv_ifcvt.added_insns_list = NULL_RTX;
frv_ifcvt.cur_scratch_regs = 0;
@@ -6506,10 +6264,7 @@ frv_ifcvt_init_extra_fields (ce_info)
if the conditional execution conversion is successful. */
static void
-frv_ifcvt_add_insn (pattern, insn, before_p)
- rtx pattern;
- rtx insn;
- int before_p;
+frv_ifcvt_add_insn (rtx pattern, rtx insn, int before_p)
{
rtx link = alloc_EXPR_LIST (VOIDmode, pattern, insn);
@@ -6536,10 +6291,7 @@ frv_ifcvt_add_insn (pattern, insn, before_p)
tests cannot be converted. */
void
-frv_ifcvt_modify_tests (ce_info, p_true, p_false)
- ce_if_block_t *ce_info;
- rtx *p_true;
- rtx *p_false;
+frv_ifcvt_modify_tests (ce_if_block_t *ce_info, rtx *p_true, rtx *p_false)
{
basic_block test_bb = ce_info->test_bb; /* test basic block */
basic_block then_bb = ce_info->then_bb; /* THEN */
@@ -6650,16 +6402,16 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false)
/* Scan all of the blocks for registers that must not be allocated. */
for (j = 0; j < num_bb; j++)
{
- rtx last_insn = bb[j]->end;
- rtx insn = bb[j]->head;
+ rtx last_insn = BB_END (bb[j]);
+ rtx insn = BB_HEAD (bb[j]);
int regno;
if (rtl_dump_file)
fprintf (rtl_dump_file, "Scanning %s block %d, start %d, end %d\n",
(bb[j] == else_bb) ? "else" : ((bb[j] == then_bb) ? "then" : "test"),
(int) bb[j]->index,
- (int) INSN_UID (bb[j]->head),
- (int) INSN_UID (bb[j]->end));
+ (int) INSN_UID (BB_HEAD (bb[j])),
+ (int) INSN_UID (BB_END (bb[j])));
/* Anything live at the beginning of the block is obviously unavailable
for allocation. */
@@ -6859,7 +6611,7 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false)
gen_rtx_fmt_ee (code, CC_CCRmode, cc, const0_rtx));
/* Record the check insn to be inserted later. */
- frv_ifcvt_add_insn (check_insn, test_bb->end, TRUE);
+ frv_ifcvt_add_insn (check_insn, BB_END (test_bb), TRUE);
/* Update the tests. */
frv_ifcvt.cr_reg = cr;
@@ -6893,11 +6645,10 @@ frv_ifcvt_modify_tests (ce_info, p_true, p_false)
(const_int 0))) */
void
-frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
- ce_if_block_t *ce_info;
- basic_block bb;
- rtx *p_true;
- rtx *p_false;
+frv_ifcvt_modify_multiple_tests (ce_if_block_t *ce_info,
+ basic_block bb,
+ rtx *p_true,
+ rtx *p_false)
{
rtx old_true = XEXP (*p_true, 0);
rtx old_false = XEXP (*p_false, 0);
@@ -6978,7 +6729,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
/* First add the andcr/andncr/orcr/orncr, which will be added after the
conditional check instruction, due to frv_ifcvt_add_insn being a LIFO
stack. */
- frv_ifcvt_add_insn ((*logical_func) (cr, cr, new_cr), bb->end, TRUE);
+ frv_ifcvt_add_insn ((*logical_func) (cr, cr, new_cr), BB_END (bb), TRUE);
/* Now add the conditional check insn. */
cc = XEXP (test_expr, 0);
@@ -6989,7 +6740,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
/* add the new check insn to the list of check insns that need to be
inserted. */
- frv_ifcvt_add_insn (check_insn, bb->end, TRUE);
+ frv_ifcvt_add_insn (check_insn, BB_END (bb), TRUE);
if (TARGET_DEBUG_COND_EXEC)
{
@@ -7026,9 +6777,7 @@ frv_ifcvt_modify_multiple_tests (ce_info, bb, p_true, p_false)
that use constants to ones that just use registers. */
static rtx
-frv_ifcvt_load_value (value, insn)
- rtx value;
- rtx insn ATTRIBUTE_UNUSED;
+frv_ifcvt_load_value (rtx value, rtx insn ATTRIBUTE_UNUSED)
{
int num_alloc = frv_ifcvt.cur_scratch_regs;
int i;
@@ -7098,10 +6847,7 @@ frv_ifcvt_load_value (value, insn)
into a temporary register, or the new MEM if we were successful. */
static rtx
-frv_ifcvt_rewrite_mem (mem, mode, insn)
- rtx mem;
- enum machine_mode mode;
- rtx insn;
+frv_ifcvt_rewrite_mem (rtx mem, enum machine_mode mode, rtx insn)
{
rtx addr = XEXP (mem, 0);
@@ -7149,8 +6895,7 @@ frv_ifcvt_rewrite_mem (mem, mode, insn)
SET, possibly conditionally executed. It may also have CLOBBERs, USEs. */
static rtx
-single_set_pattern (pattern)
- rtx pattern;
+single_set_pattern (rtx pattern)
{
rtx set;
int i;
@@ -7197,10 +6942,9 @@ single_set_pattern (pattern)
insn cannot be converted to be executed conditionally. */
rtx
-frv_ifcvt_modify_insn (ce_info, pattern, insn)
- ce_if_block_t *ce_info ATTRIBUTE_UNUSED;
- rtx pattern;
- rtx insn;
+frv_ifcvt_modify_insn (ce_if_block_t *ce_info,
+ rtx pattern,
+ rtx insn)
{
rtx orig_ce_pattern = pattern;
rtx set;
@@ -7324,7 +7068,16 @@ frv_ifcvt_modify_insn (ce_info, pattern, insn)
other registers. */
else if (frv_ifcvt.scratch_insns_bitmap
&& bitmap_bit_p (frv_ifcvt.scratch_insns_bitmap,
- INSN_UID (insn)))
+ INSN_UID (insn))
+ /* We must not unconditionally set a reg set used as
+ scratch in the THEN branch if the same reg is live
+ in the ELSE branch. */
+ && REG_P (SET_DEST (set))
+ && (! ce_info->else_bb
+ || BLOCK_FOR_INSN (insn) == ce_info->else_bb
+ || ! (REGNO_REG_SET_P
+ (ce_info->else_bb->global_live_at_start,
+ REGNO (SET_DEST (set))))))
pattern = set;
else if (mode == QImode || mode == HImode || mode == SImode
@@ -7452,8 +7205,7 @@ frv_ifcvt_modify_insn (ce_info, pattern, insn)
conditional if information CE_INFO. */
void
-frv_ifcvt_modify_final (ce_info)
- ce_if_block_t *ce_info ATTRIBUTE_UNUSED;
+frv_ifcvt_modify_final (ce_if_block_t *ce_info ATTRIBUTE_UNUSED)
{
rtx existing_insn;
rtx check_insn;
@@ -7509,8 +7261,7 @@ frv_ifcvt_modify_final (ce_info)
information CE_INFO. */
void
-frv_ifcvt_modify_cancel (ce_info)
- ce_if_block_t *ce_info ATTRIBUTE_UNUSED;
+frv_ifcvt_modify_cancel (ce_if_block_t *ce_info ATTRIBUTE_UNUSED)
{
int i;
rtx p = frv_ifcvt.added_insns_list;
@@ -7545,7 +7296,7 @@ frv_ifcvt_modify_cancel (ce_info)
jmpl @(gr0,<jmp_reg>) */
int
-frv_trampoline_size ()
+frv_trampoline_size (void)
{
return 5 /* instructions */ * 4 /* instruction size */;
}
@@ -7565,10 +7316,7 @@ frv_trampoline_size ()
jmpl @(gr0,<jmp_reg>) */
void
-frv_initialize_trampoline (addr, fnaddr, static_chain)
- rtx addr;
- rtx fnaddr;
- rtx static_chain;
+frv_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
{
rtx sc_reg = force_reg (Pmode, static_chain);
@@ -7634,11 +7382,10 @@ frv_initialize_trampoline (addr, fnaddr, static_chain)
This case often occurs between floating-point and general registers. */
enum reg_class
-frv_secondary_reload_class (class, mode, x, in_p)
- enum reg_class class;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx x;
- int in_p ATTRIBUTE_UNUSED;
+frv_secondary_reload_class (enum reg_class class,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx x,
+ int in_p ATTRIBUTE_UNUSED)
{
enum reg_class ret;
@@ -7714,8 +7461,7 @@ frv_secondary_reload_class (class, mode, x, in_p)
register allocation. */
int
-frv_class_likely_spilled_p (class)
- enum reg_class class;
+frv_class_likely_spilled_p (enum reg_class class)
{
switch (class)
{
@@ -7790,13 +7536,8 @@ frv_class_likely_spilled_p (class)
*/
int
-frv_adjust_field_align (field, computed)
- tree field;
- int computed;
+frv_adjust_field_align (tree field, int computed)
{
-
- tree type = TREE_TYPE (field);
-
/* Make sure that the bitfield is not wider than the type. */
if (DECL_BIT_FIELD (field)
&& !DECL_ARTIFICIAL (field))
@@ -7889,9 +7630,7 @@ frv_adjust_field_align (field, computed)
pattern's constraint asks for one. */
int
-frv_hard_regno_mode_ok (regno, mode)
- int regno;
- enum machine_mode mode;
+frv_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
int base;
int mask;
@@ -7973,9 +7712,7 @@ frv_hard_regno_mode_ok (regno, mode)
for each byte. */
int
-frv_hard_regno_nregs (regno, mode)
- int regno;
- enum machine_mode mode;
+frv_hard_regno_nregs (int regno, enum machine_mode mode)
{
if (ACCG_P (regno))
return GET_MODE_SIZE (mode);
@@ -7997,9 +7734,7 @@ frv_hard_regno_nregs (regno, mode)
This declaration is required. */
int
-frv_class_max_nregs (class, mode)
- enum reg_class class;
- enum machine_mode mode;
+frv_class_max_nregs (enum reg_class class, enum machine_mode mode)
{
if (class == ACCG_REGS)
/* An N-byte value requires N accumulator guards. */
@@ -8015,8 +7750,7 @@ frv_class_max_nregs (class, mode)
definition for this macro on machines where anything `CONSTANT_P' is valid. */
int
-frv_legitimate_constant_p (x)
- rtx x;
+frv_legitimate_constant_p (rtx x)
{
enum machine_mode mode = GET_MODE (x);
@@ -8065,9 +7799,7 @@ frv_legitimate_constant_p (x)
#define LOW_COST 1
int
-frv_register_move_cost (from, to)
- enum reg_class from;
- enum reg_class to;
+frv_register_move_cost (enum reg_class from, enum reg_class to)
{
switch (from)
{
@@ -8156,10 +7888,7 @@ frv_register_move_cost (from, to)
need a fixup entry for aligned (non-debugging) code. */
static bool
-frv_assemble_integer (value, size, aligned_p)
- rtx value;
- unsigned int size;
- int aligned_p;
+frv_assemble_integer (rtx value, unsigned int size, int aligned_p)
{
if (flag_pic && size == UNITS_PER_WORD)
{
@@ -8198,7 +7927,7 @@ frv_assemble_integer (value, size, aligned_p)
/* Function to set up the backend function structure. */
static struct machine_function *
-frv_init_machine_status ()
+frv_init_machine_status (void)
{
return ggc_alloc_cleared (sizeof (struct machine_function));
}
@@ -8241,12 +7970,11 @@ frv_use_dfa_pipeline_interface (void)
or clobbered. */
static void
-frv_registers_update (x, reg_state, modified, p_num_mod, flag)
- rtx x;
- unsigned char reg_state[];
- int modified[];
- int *p_num_mod;
- int flag;
+frv_registers_update (rtx x,
+ unsigned char reg_state[],
+ int modified[],
+ int *p_num_mod,
+ int flag)
{
int regno, reg_max;
rtx reg;
@@ -8389,10 +8117,7 @@ frv_registers_update (x, reg_state, modified, p_num_mod, flag)
/* Return if any registers in a hard register set were used an insn. */
static int
-frv_registers_used_p (x, reg_state, flag)
- rtx x;
- unsigned char reg_state[];
- int flag;
+frv_registers_used_p (rtx x, unsigned char reg_state[], int flag)
{
int regno, reg_max;
rtx reg;
@@ -8549,10 +8274,7 @@ frv_registers_used_p (x, reg_state, flag)
/* Return if any registers in a hard register set were set in an insn. */
static int
-frv_registers_set_p (x, reg_state, modify_p)
- rtx x;
- unsigned char reg_state[];
- int modify_p;
+frv_registers_set_p (rtx x, unsigned char reg_state[], int modify_p)
{
int regno, reg_max;
rtx reg;
@@ -8663,7 +8385,7 @@ frv_registers_set_p (x, reg_state, modify_p)
information in a reasonable state. */
static void
-frv_pack_insns ()
+frv_pack_insns (void)
{
state_t frv_state; /* frv state machine */
int cur_start_vliw_p; /* current insn starts a VLIW insn */
@@ -8731,7 +8453,7 @@ frv_pack_insns ()
}
/* Clear the VLIW start flag on random USE and CLOBBER insns, which is
- set on the USE insn that preceeds the return, and potentially on
+ set on the USE insn that precedes the return, and potentially on
CLOBBERs for setting multiword variables. Also skip the ADDR_VEC
holding the case table labels. */
pattern_code = GET_CODE (PATTERN (insn));
@@ -8970,7 +8692,7 @@ static struct builtin_description bdesc_voidacc[] =
/* Initialize media builtins. */
static void
-frv_init_builtins ()
+frv_init_builtins (void)
{
tree endlink = void_list_node;
tree accumulator = integer_type_node;
@@ -9159,9 +8881,9 @@ frv_init_libfuncs (void)
set_conv_libfunc (sfix_optab, DImode, DFmode, "__dtoll");
set_conv_libfunc (ufix_optab, SImode, SFmode, "__ftoui");
- set_conv_libfunc (ufix_optab, SImode, SFmode, "__ftoull");
- set_conv_libfunc (ufix_optab, SImode, SFmode, "__dtoui");
- set_conv_libfunc (ufix_optab, SImode, SFmode, "__dtoull");
+ set_conv_libfunc (ufix_optab, DImode, SFmode, "__ftoull");
+ set_conv_libfunc (ufix_optab, SImode, DFmode, "__dtoui");
+ set_conv_libfunc (ufix_optab, DImode, DFmode, "__dtoull");
set_conv_libfunc (sfloat_optab, SFmode, SImode, "__itof");
set_conv_libfunc (sfloat_optab, SFmode, DImode, "__lltof");
@@ -9176,10 +8898,7 @@ frv_init_libfuncs (void)
instruction. */
static rtx
-frv_int_to_acc (icode, opnum, opval)
- enum insn_code icode;
- int opnum;
- rtx opval;
+frv_int_to_acc (enum insn_code icode, int opnum, rtx opval)
{
rtx reg;
@@ -9211,8 +8930,7 @@ frv_int_to_acc (icode, opnum, opval)
should have. */
static enum machine_mode
-frv_matching_accg_mode (mode)
- enum machine_mode mode;
+frv_matching_accg_mode (enum machine_mode mode)
{
switch (mode)
{
@@ -9235,8 +8953,7 @@ frv_matching_accg_mode (mode)
class as ACC, but is four times smaller. */
rtx
-frv_matching_accg_for_acc (acc)
- rtx acc;
+frv_matching_accg_for_acc (rtx acc)
{
return gen_rtx_REG (frv_matching_accg_mode (GET_MODE (acc)),
REGNO (acc) - ACC_FIRST + ACCG_FIRST);
@@ -9247,8 +8964,7 @@ frv_matching_accg_for_acc (acc)
list. */
static rtx
-frv_read_argument (arglistptr)
- tree *arglistptr;
+frv_read_argument (tree *arglistptr)
{
tree next = TREE_VALUE (*arglistptr);
*arglistptr = TREE_CHAIN (*arglistptr);
@@ -9260,10 +8976,7 @@ frv_read_argument (arglistptr)
function prints an error if OPVAL is not valid. */
static int
-frv_check_constant_argument (icode, opnum, opval)
- enum insn_code icode;
- int opnum;
- rtx opval;
+frv_check_constant_argument (enum insn_code icode, int opnum, rtx opval)
{
if (GET_CODE (opval) != CONST_INT)
{
@@ -9283,9 +8996,7 @@ frv_check_constant_argument (icode, opnum, opval)
predicate. */
static rtx
-frv_legitimize_target (icode, target)
- enum insn_code icode;
- rtx target;
+frv_legitimize_target (enum insn_code icode, rtx target)
{
enum machine_mode mode = insn_data[icode].operand[0].mode;
@@ -9298,15 +9009,12 @@ frv_legitimize_target (icode, target)
}
/* Given that ARG is being passed as operand OPNUM to instruction ICODE,
- check whether ARG satisfies the operand's contraints. If it doesn't,
+ check whether ARG satisfies the operand's constraints. If it doesn't,
copy ARG to a temporary register and return that. Otherwise return ARG
itself. */
static rtx
-frv_legitimize_argument (icode, opnum, arg)
- enum insn_code icode;
- int opnum;
- rtx arg;
+frv_legitimize_argument (enum insn_code icode, int opnum, rtx arg)
{
enum machine_mode mode = insn_data[icode].operand[opnum].mode;
@@ -9320,10 +9028,7 @@ frv_legitimize_argument (icode, opnum, arg)
only MHDSETS falls into this category. */
static rtx
-frv_expand_set_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+frv_expand_set_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9343,10 +9048,7 @@ frv_expand_set_builtin (icode, arglist, target)
/* Expand builtins that take one operand. */
static rtx
-frv_expand_unop_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+frv_expand_unop_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9364,10 +9066,7 @@ frv_expand_unop_builtin (icode, arglist, target)
/* Expand builtins that take two operands. */
static rtx
-frv_expand_binop_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+frv_expand_binop_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9388,10 +9087,7 @@ frv_expand_binop_builtin (icode, arglist, target)
one. */
static rtx
-frv_expand_cut_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+frv_expand_cut_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9423,10 +9119,7 @@ frv_expand_cut_builtin (icode, arglist, target)
/* Expand builtins that take two operands and the second is immediate. */
static rtx
-frv_expand_binopimm_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+frv_expand_binopimm_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9449,9 +9142,7 @@ frv_expand_binopimm_builtin (icode, arglist, target)
ints and return void. */
static rtx
-frv_expand_voidbinop_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+frv_expand_voidbinop_builtin (enum insn_code icode, tree arglist)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9492,9 +9183,7 @@ frv_expand_voidbinop_builtin (icode, arglist)
corresponds to the accumulator. */
static rtx
-frv_expand_voidtriop_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+frv_expand_voidtriop_builtin (enum insn_code icode, tree arglist)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9522,9 +9211,7 @@ frv_expand_voidtriop_builtin (icode, arglist)
void. */
static rtx
-frv_expand_voidaccop_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+frv_expand_voidaccop_builtin (enum insn_code icode, tree arglist)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9554,8 +9241,7 @@ frv_expand_voidaccop_builtin (icode, arglist)
number as argument. */
static rtx
-frv_expand_mclracc_builtin (arglist)
- tree arglist;
+frv_expand_mclracc_builtin (tree arglist)
{
enum insn_code icode = CODE_FOR_mclracc;
rtx pat;
@@ -9575,8 +9261,7 @@ frv_expand_mclracc_builtin (arglist)
/* Expand builtins that take no arguments. */
static rtx
-frv_expand_noargs_builtin (icode)
- enum insn_code icode;
+frv_expand_noargs_builtin (enum insn_code icode)
{
rtx pat = GEN_FCN (icode) (GEN_INT (0));
if (pat)
@@ -9589,9 +9274,7 @@ frv_expand_noargs_builtin (icode)
number or accumulator guard number as argument and return an SI integer. */
static rtx
-frv_expand_mrdacc_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+frv_expand_mrdacc_builtin (enum insn_code icode, tree arglist)
{
rtx pat;
rtx target = gen_reg_rtx (SImode);
@@ -9614,9 +9297,7 @@ frv_expand_mrdacc_builtin (icode, arglist)
second. */
static rtx
-frv_expand_mwtacc_builtin (icode, arglist)
- enum insn_code icode;
- tree arglist;
+frv_expand_mwtacc_builtin (enum insn_code icode, tree arglist)
{
rtx pat;
rtx op0 = frv_read_argument (&arglist);
@@ -9637,12 +9318,11 @@ frv_expand_mwtacc_builtin (icode, arglist)
/* Expand builtins. */
static rtx
-frv_expand_builtin (exp, target, subtarget, mode, ignore)
- tree exp;
- rtx target;
- rtx subtarget ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- int ignore ATTRIBUTE_UNUSED;
+frv_expand_builtin (tree exp,
+ rtx target,
+ rtx subtarget ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ int ignore ATTRIBUTE_UNUSED)
{
tree arglist = TREE_OPERAND (exp, 1);
tree fndecl = TREE_OPERAND (TREE_OPERAND (exp, 0), 0);
@@ -9771,8 +9451,7 @@ frv_expand_builtin (exp, target, subtarget, mode, ignore)
}
static bool
-frv_in_small_data_p (decl)
- tree decl;
+frv_in_small_data_p (tree decl)
{
HOST_WIDE_INT size;
tree section_name;
@@ -9784,10 +9463,6 @@ frv_in_small_data_p (decl)
if (TREE_CODE (decl) != VAR_DECL || DECL_ARTIFICIAL (decl))
return false;
- size = int_size_in_bytes (TREE_TYPE (decl));
- if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
- return true;
-
/* If we already know which section the decl should be in, see if
it's a small data section. */
section_name = DECL_SECTION_NAME (decl);
@@ -9799,16 +9474,21 @@ frv_in_small_data_p (decl)
return true;
if (frv_string_begins_with (section_name, ".sbss"))
return true;
+ return false;
}
+ size = int_size_in_bytes (TREE_TYPE (decl));
+ if (size > 0 && (unsigned HOST_WIDE_INT) size <= g_switch_value)
+ return true;
+
return false;
}
static bool
-frv_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code ATTRIBUTE_UNUSED;
- int *total;
+frv_rtx_costs (rtx x,
+ int code ATTRIBUTE_UNUSED,
+ int outer_code ATTRIBUTE_UNUSED,
+ int *total)
{
switch (code)
{
@@ -9867,9 +9547,7 @@ frv_rtx_costs (x, code, outer_code, total)
}
static void
-frv_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+frv_asm_out_constructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
ctors_section ();
assemble_align (POINTER_SIZE);
@@ -9877,9 +9555,7 @@ frv_asm_out_constructor (symbol, priority)
}
static void
-frv_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority ATTRIBUTE_UNUSED;
+frv_asm_out_destructor (rtx symbol, int priority ATTRIBUTE_UNUSED)
{
dtors_section ();
assemble_align (POINTER_SIZE);
diff --git a/gcc/config/frv/frv.h b/gcc/config/frv/frv.h
index 2f958da582b..efb655a9684 100644
--- a/gcc/config/frv/frv.h
+++ b/gcc/config/frv/frv.h
@@ -1885,7 +1885,7 @@ struct machine_function GTY(())
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
frv_function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
-/* extern int frv_function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS, int, Tree, int)); */
+/* extern int frv_function_arg_partial_nregs (CUMULATIVE_ARGS, int, Tree, int); */
/* A C expression that indicates when an argument must be passed by reference.
If nonzero for an argument, a copy of that argument is made in memory and a
@@ -2180,11 +2180,7 @@ struct machine_function GTY(())
extern int _write (int, const void *, unsigned); \
\
void \
-__trampoline_setup (addr, size, fnaddr, sc) \
- short * addr; \
- int size; \
- int fnaddr; \
- int sc; \
+__trampoline_setup (short * addr, int size, int fnaddr, int sc) \
{ \
extern short __trampoline_template[]; \
short * to = addr; \
@@ -2565,7 +2561,7 @@ __asm__("\n" \
#define SDATA_SECTION_FUNCTION \
void \
-sdata_section () \
+sdata_section (void) \
{ \
if (in_section != in_sdata) \
{ \
@@ -2576,7 +2572,7 @@ sdata_section () \
#define FIXUP_SECTION_FUNCTION \
void \
-fixup_section () \
+fixup_section (void) \
{ \
if (in_section != in_fixup) \
{ \
@@ -2970,6 +2966,9 @@ do { \
#define ASM_OUTPUT_ALIGN(STREAM, POWER) \
fprintf ((STREAM), "\t.p2align %d\n", (POWER))
+/* Inside the text section, align with unpacked nops rather than zeros. */
+#define ASM_OUTPUT_ALIGN_WITH_NOP(STREAM, POWER) \
+ fprintf ((STREAM), "\t.p2alignl %d,0x80880000\n", (POWER))
/* Macros Affecting all Debug Formats. */
diff --git a/gcc/config/frv/frv.md b/gcc/config/frv/frv.md
index ce5ce8bac25..9d06fbbdfdb 100644
--- a/gcc/config/frv/frv.md
+++ b/gcc/config/frv/frv.md
@@ -463,7 +463,7 @@
first regular expression *and* the reservation described by
the second regular expression *and* etc.
- 4. "*" is used for convinience and simply means sequence in
+ 4. "*" is used for convenience and simply means sequence in
which the regular expression are repeated NUMBER times with
cycle advancing (see ",").
@@ -1118,7 +1118,7 @@
;; Note - it is the backend's responsibility to fill any unfilled delay slots
;; at assembler generation time. This is usually done by adding a special print
-;; operand to the delayed insrtuction, and then in the PRINT_OPERAND function
+;; operand to the delayed instruction, and then in the PRINT_OPERAND function
;; calling dbr_sequence_length() to determine how many delay slots were filled.
;; For example:
;;
@@ -1364,7 +1364,7 @@
;; Note - it is best to only have one movsi pattern and to handle
;; all the various contingencies by the use of alternatives. This
-;; allows reload the greatest amount of flexability (since reload will
+;; allows reload the greatest amount of flexibility (since reload will
;; only choose amoungst alternatives for a selected insn, it will not
;; replace the insn with another one).
@@ -1374,7 +1374,7 @@
;; constants into memory when the destination is a floating-point register.
;; That may make a function use a PIC pointer when it didn't before, and we
;; cannot change PIC usage (and hence stack layout) so late in the game.
-;; The resulting sequences for loading cosntants into FPRs are preferable
+;; The resulting sequences for loading constants into FPRs are preferable
;; even when we're not generating PIC code.
(define_insn "*movsi_load"
@@ -2754,22 +2754,11 @@
;; Subtraction No need to worry about constants, since the compiler
;; canonicalizes them into adddi3's.
-(define_expand "subdi3"
- [(parallel [(set (match_operand:DI 0 "integer_register_operand" "")
- (minus:DI (match_operand:DI 1 "integer_register_operand" "")
- (match_operand:DI 2 "integer_register_operand" "")))
- (clobber (match_dup 3))])]
- ""
- "
-{
- operands[3] = gen_reg_rtx (CCmode);
-}")
-
-(define_insn_and_split "*subdi3_internal"
+(define_insn_and_split "subdi3"
[(set (match_operand:DI 0 "integer_register_operand" "=&e,e,e")
(minus:DI (match_operand:DI 1 "integer_register_operand" "e,0,e")
(match_operand:DI 2 "integer_register_operand" "e,e,0")))
- (clobber (match_operand:CC 3 "icc_operand" "=t,t,t"))]
+ (clobber (match_scratch:CC 3 "=t,t,t"))]
""
"#"
"reload_completed"
@@ -2842,6 +2831,31 @@
[(set_attr "length" "4")
(set_attr "type" "int")])
+(define_insn_and_split "negdi2"
+ [(set (match_operand:DI 0 "integer_register_operand" "=&e,e")
+ (neg:DI (match_operand:DI 1 "integer_register_operand" "e,0")))
+ (clobber (match_scratch:CC 2 "=t,t"))]
+ ""
+ "#"
+ "reload_completed"
+ [(match_dup 3)
+ (match_dup 4)]
+ "
+{
+ rtx op0_high = gen_highpart (SImode, operands[0]);
+ rtx op1_high = gen_rtx_REG (SImode, GPR_FIRST);
+ rtx op2_high = gen_highpart (SImode, operands[1]);
+ rtx op0_low = gen_lowpart (SImode, operands[0]);
+ rtx op1_low = op1_high;
+ rtx op2_low = gen_lowpart (SImode, operands[1]);
+ rtx op3 = operands[2];
+
+ operands[3] = gen_subdi3_lower (op0_low, op1_low, op2_low, op3);
+ operands[4] = gen_subdi3_upper (op0_high, op1_high, op2_high, op3);
+}"
+ [(set_attr "length" "8")
+ (set_attr "type" "multi")])
+
;; Multiplication (same size)
;; (define_insn "muldi3"
;; [(set (match_operand:DI 0 "register_operand" "=r")
@@ -3314,7 +3328,7 @@
;; "anddi3 %0,%1,%2"
;; [(set_attr "length" "4")])
-;; Includive OR, 64 bit integers
+;; Inclusive OR, 64 bit integers
;; (define_insn "iordi3"
;; [(set (match_operand:DI 0 "register_operand" "=r")
;; (ior:DI (match_operand:DI 1 "register_operand" "%r")
@@ -7379,7 +7393,7 @@
[(set_attr "length" "4")
(set_attr "type" "mqsath")])
-;; Set hi/lo instrctions: type "mset"
+;; Set hi/lo instructions: type "mset"
(define_insn "mhsetlos"
[(set (match_operand:SI 0 "fpr_operand" "=f")
diff --git a/gcc/config/frv/frvbegin.c b/gcc/config/frv/frvbegin.c
index 81040f3543a..82f9500eab2 100644
--- a/gcc/config/frv/frvbegin.c
+++ b/gcc/config/frv/frvbegin.c
@@ -81,7 +81,7 @@ extern void __frv_deregister_eh(void) __attribute__((__destructor__));
extern func_ptr __EH_FRAME_BEGIN__[];
-/* Register the exeception handling table as the first constructor */
+/* Register the exception handling table as the first constructor */
void
__frv_register_eh (void)
{
@@ -93,7 +93,7 @@ __frv_register_eh (void)
/* Note, do not declare __{,de}register_frame_info weak as it seems
to interfere with the pic support. */
-/* Unregister the exeception handling table as a deconstructor */
+/* Unregister the exception handling table as a deconstructor */
void
__frv_deregister_eh (void)
{
@@ -110,7 +110,7 @@ __frv_deregister_eh (void)
/* Run the global destructors */
void
-__do_global_dtors ()
+__do_global_dtors (void)
{
static func_ptr *p = __DTOR_LIST__ + 1;
while (*p)
@@ -122,7 +122,7 @@ __do_global_dtors ()
/* Run the global constructors */
void
-__do_global_ctors ()
+__do_global_ctors (void)
{
unsigned long nptrs = (unsigned long) __CTOR_LIST__[0];
unsigned i;
@@ -145,7 +145,7 @@ __do_global_ctors ()
to run __do_global_ctors, so we need not do anything here. */
void
-__main ()
+__main (void)
{
/* Support recursive calls to `main': run initializers just once. */
static int initialized;
diff --git a/gcc/config/gnu.h b/gcc/config/gnu.h
index f5f4184e8d3..23a8a730ec9 100644
--- a/gcc/config/gnu.h
+++ b/gcc/config/gnu.h
@@ -18,3 +18,15 @@
/* The system headers under GNU are C++-aware. */
#define NO_IMPLICIT_EXTERN_C
+
+#define HURD_TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__gnu_hurd__"); \
+ builtin_define ("__GNU__"); \
+ builtin_define_std ("unix"); \
+ builtin_define_std ("MACH"); \
+ builtin_assert ("system=gnu"); \
+ builtin_assert ("system=mach"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=posix"); \
+ } while (0)
diff --git a/gcc/config/h8300/h8300-protos.h b/gcc/config/h8300/h8300-protos.h
index e36ae4b719c..a7987d06a83 100644
--- a/gcc/config/h8300/h8300-protos.h
+++ b/gcc/config/h8300/h8300-protos.h
@@ -79,6 +79,7 @@ extern int h8300_eightbit_constant_address_p (rtx);
extern int h8300_tiny_constant_address_p (rtx);
extern int byte_accesses_mergeable_p (rtx, rtx);
extern int same_cmp_preceding_p (rtx);
+extern int same_cmp_following_p (rtx);
/* Used in builtins.c */
extern rtx h8300_return_addr_rtx (int, rtx);
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index 88e9a63a6dd..ed3cc08c51d 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -365,9 +365,7 @@ byte_reg (rtx x, int b)
SIZE to adjust the stack pointer. */
static void
-dosize (sign, size)
- int sign;
- unsigned int size;
+dosize (int sign, unsigned int size)
{
/* H8/300 cannot add/subtract a large constant with a single
instruction. If a temporary register is available, load the
@@ -436,8 +434,10 @@ push (int rn)
if (TARGET_H8300)
x = gen_push_h8300 (reg);
+ else if (!TARGET_NORMAL_MODE)
+ x = gen_push_h8300hs_advanced (reg);
else
- x = gen_push_h8300hs (reg);
+ x = gen_push_h8300hs_normal (reg);
x = emit_insn (x);
REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
}
@@ -452,8 +452,10 @@ pop (int rn)
if (TARGET_H8300)
x = gen_pop_h8300 (reg);
+ else if (!TARGET_NORMAL_MODE)
+ x = gen_pop_h8300hs_advanced (reg);
else
- x = gen_pop_h8300hs (reg);
+ x = gen_pop_h8300hs_normal (reg);
x = emit_insn (x);
REG_NOTES (x) = gen_rtx_EXPR_LIST (REG_INC, stack_pointer_rtx, 0);
}
@@ -1979,7 +1981,7 @@ compute_mov_length (rtx *operands)
if (val == (val & 0x00ff) || val == (val & 0xff00))
return 4;
-
+
switch (val & 0xffffffff)
{
case 0xffffffff:
@@ -4514,6 +4516,26 @@ same_cmp_preceding_p (rtx i3)
&& any_condjump_p (i2) && onlyjump_p (i2));
}
+/* Return nonzero if we have the same comparison insn as I1 two insns
+ after I1. I1 is assumed to be a comparison insn. */
+
+int
+same_cmp_following_p (rtx i1)
+{
+ rtx i2, i3;
+
+ /* Make sure we have a sequence of three insns. */
+ i2 = next_nonnote_insn (i1);
+ if (i2 == NULL_RTX)
+ return 0;
+ i3 = next_nonnote_insn (i2);
+ if (i3 == NULL_RTX)
+ return 0;
+
+ return (INSN_P (i3) && rtx_equal_p (PATTERN (i1), PATTERN (i3))
+ && any_condjump_p (i2) && onlyjump_p (i2));
+}
+
/* Return nonzero if register OLD_REG can be renamed to register NEW_REG. */
int
@@ -4528,7 +4550,7 @@ h8300_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
&& !regs_ever_live[new_reg])
return 0;
- return 1;
+ return 1;
}
/* Perform target dependent optabs initialization. */
diff --git a/gcc/config/h8300/h8300.h b/gcc/config/h8300/h8300.h
index 055a32542e1..b60fc52af49 100644
--- a/gcc/config/h8300/h8300.h
+++ b/gcc/config/h8300/h8300.h
@@ -224,9 +224,7 @@ extern int target_flags;
#define BYTES_BIG_ENDIAN 1
/* Define this if most significant word of a multiword number is lowest
- numbered.
- This is true on an H8/300 (actually we can make it up, but we choose to
- be consistent). */
+ numbered. */
#define WORDS_BIG_ENDIAN 1
#define MAX_BITS_PER_WORD 32
@@ -570,10 +568,12 @@ enum reg_class {
followed by "to". Eliminations of the same "from" register are listed
in order of preference.
- We have two registers that can be eliminated on the h8300. First, the
- frame pointer register can often be eliminated in favor of the stack
- pointer register. Secondly, the argument pointer register can always be
- eliminated; it is replaced with either the stack or frame pointer. */
+ We have three registers that can be eliminated on the h8300.
+ First, the frame pointer register can often be eliminated in favor
+ of the stack pointer register. Secondly, the argument pointer
+ register and the return address pointer register are always
+ eliminated; they are replaced with either the stack or frame
+ pointer. */
#define ELIMINABLE_REGS \
{{ ARG_POINTER_REGNUM, STACK_POINTER_REGNUM}, \
@@ -607,7 +607,7 @@ enum reg_class {
On the H8 the return value is in R0/R1. */
#define FUNCTION_VALUE(VALTYPE, FUNC) \
- gen_rtx_REG (TYPE_MODE (VALTYPE), 0)
+ gen_rtx_REG (TYPE_MODE (VALTYPE), R0_REG)
/* Define how to find the value returned by a library function
assuming the value has mode MODE. */
@@ -615,12 +615,12 @@ enum reg_class {
/* On the H8 the return value is in R0/R1. */
#define LIBCALL_VALUE(MODE) \
- gen_rtx_REG (MODE, 0)
+ gen_rtx_REG (MODE, R0_REG)
/* 1 if N is a possible register number for a function value.
On the H8, R0 is the only register thus used. */
-#define FUNCTION_VALUE_REGNO_P(N) ((N) == 0)
+#define FUNCTION_VALUE_REGNO_P(N) ((N) == R0_REG)
/* Define this if PCC uses the nonreentrant convention for returning
structure and union values. */
@@ -735,7 +735,7 @@ struct cum_arg
/* Length in units of the trampoline for entering a nested function. */
-#define TRAMPOLINE_SIZE ((TARGET_H8300 || TARGET_NORMAL_MODE) ? 8 : 12)
+#define TRAMPOLINE_SIZE ((Pmode == HImode) ? 8 : 12)
/* Emit RTL insns to build a trampoline.
FNADDR is an RTX for the address of the function's pure code.
@@ -1054,10 +1054,9 @@ struct cum_arg
#undef DO_GLOBAL_CTORS_BODY
#define DO_GLOBAL_CTORS_BODY \
{ \
- typedef (*pfunc)(); \
- extern pfunc __ctors[]; \
- extern pfunc __ctors_end[]; \
- pfunc *p; \
+ extern func_ptr __ctors[]; \
+ extern func_ptr __ctors_end[]; \
+ func_ptr *p; \
for (p = __ctors_end; p > __ctors; ) \
{ \
(*--p)(); \
@@ -1067,10 +1066,9 @@ struct cum_arg
#undef DO_GLOBAL_DTORS_BODY
#define DO_GLOBAL_DTORS_BODY \
{ \
- typedef (*pfunc)(); \
- extern pfunc __dtors[]; \
- extern pfunc __dtors_end[]; \
- pfunc *p; \
+ extern func_ptr __dtors[]; \
+ extern func_ptr __dtors_end[]; \
+ func_ptr *p; \
for (p = __dtors; p < __dtors_end; p++) \
{ \
(*p)(); \
diff --git a/gcc/config/h8300/h8300.md b/gcc/config/h8300/h8300.md
index 0daa45c2f11..80683d56876 100644
--- a/gcc/config/h8300/h8300.md
+++ b/gcc/config/h8300/h8300.md
@@ -53,7 +53,8 @@
(UNSPEC_MONITOR 1)])
(define_constants
- [(SC_REG 3)
+ [(R0_REG 0)
+ (SC_REG 3)
(FP_REG 6)
(SP_REG 7)
(MAC_REG 8)
@@ -124,7 +125,7 @@
(set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -1)))
(match_operand:QI 0 "register_operand" "r"))])]
"TARGET_H8300
- && REGNO (operands[0]) != SP_REG"
+ && operands[0] != stack_pointer_rtx"
"mov.w\\t%T0,@-r7"
[(set_attr "length" "2")
(set_attr "cc" "clobber")])
@@ -135,7 +136,18 @@
(set (mem:QI (plus:SI (reg:SI SP_REG) (const_int -3)))
(match_operand:QI 0 "register_operand" "r"))])]
"(TARGET_H8300H || TARGET_H8300S)
- && REGNO (operands[0]) != SP_REG"
+ && operands[0] != stack_pointer_rtx"
+ "mov.l\\t%S0,@-er7"
+ [(set_attr "length" "4")
+ (set_attr "cc" "clobber")])
+
+(define_insn "pushqi1_h8300hs_normal"
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3)))
+ (match_operand:QI 0 "register_operand" "r"))])]
+ "(TARGET_H8300H || TARGET_H8300S)
+ && operands[0] != stack_pointer_rtx"
"mov.l\\t%S0,@-er7"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
@@ -147,8 +159,10 @@
{
if (TARGET_H8300)
emit_insn (gen_pushqi1_h8300 (operands[0]));
- else
+ else if (!TARGET_NORMAL_MODE)
emit_insn (gen_pushqi1_h8300hs (operands[0]));
+ else
+ emit_insn (gen_pushqi1_h8300hs_normal (operands[0]));
DONE;
}")
@@ -218,7 +232,7 @@
[(set (mem:HI (pre_dec:HI (reg:HI SP_REG)))
(match_operand:HI 0 "register_operand" ""))]
"TARGET_H8300
- && REGNO (operands[0]) != SP_REG"
+ && operands[0] != stack_pointer_rtx"
"")
(define_insn "pushhi1_h8300hs"
@@ -227,7 +241,18 @@
(set (mem:HI (plus:SI (reg:SI SP_REG) (const_int -2)))
(match_operand:HI 0 "register_operand" "r"))])]
"(TARGET_H8300H || TARGET_H8300S)
- && REGNO (operands[0]) != SP_REG"
+ && operands[0] != stack_pointer_rtx"
+ "mov.l\\t%S0,@-er7"
+ [(set_attr "length" "4")
+ (set_attr "cc" "clobber")])
+
+(define_insn "pushhi1_h8300hs_normal"
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2)))
+ (match_operand:HI 0 "register_operand" "r"))])]
+ "(TARGET_H8300H || TARGET_H8300S)
+ && operands[0] != stack_pointer_rtx"
"mov.l\\t%S0,@-er7"
[(set_attr "length" "4")
(set_attr "cc" "clobber")])
@@ -239,8 +264,10 @@
{
if (TARGET_H8300)
emit_insn (gen_pushhi1_h8300 (operands[0]));
- else
+ else if (!TARGET_NORMAL_MODE)
emit_insn (gen_pushhi1_h8300hs (operands[0]));
+ else
+ emit_insn (gen_pushhi1_h8300hs_normal (operands[0]));
DONE;
}")
@@ -561,7 +588,7 @@
(symbol_ref "compute_mov_length (operands)"))
(set_attr "cc" "set_zn,set_znv,clobber,set_znv,set_znv,set_znv,set_znv,none_0hit,none_0hit,set_znv")])
-(define_insn "*movsf_h8300h"
+(define_insn "*movsf_h8300hs"
[(set (match_operand:SF 0 "general_operand_dst" "=r,r,r,m,<,r")
(match_operand:SF 1 "general_operand_src" "G,r,im,r,r,>"))]
"(TARGET_H8300H || TARGET_H8300S)
@@ -704,7 +731,7 @@
[(set_attr "length" "2")
(set_attr "cc" "set_znv")])
-(define_insn ""
+(define_insn "*tsthi_upper"
[(set (cc0)
(and:HI (match_operand:HI 0 "register_operand" "r")
(const_int -256)))]
@@ -720,7 +747,7 @@
[(set_attr "length" "2")
(set_attr "cc" "set_znv")])
-(define_insn ""
+(define_insn "*tstsi_upper"
[(set (cc0)
(and:SI (match_operand:SI 0 "register_operand" "r")
(const_int -65536)))]
@@ -882,7 +909,7 @@
""
"")
-(define_insn "addsi_h8300"
+(define_insn "*addsi_h8300"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(plus:SI (match_operand:SI 1 "register_operand" "%0,0")
(match_operand:SI 2 "nonmemory_operand" "n,r")))]
@@ -893,7 +920,7 @@
(set (attr "cc")
(symbol_ref "compute_plussi_cc (operands)"))])
-(define_insn "addsi_h8300h"
+(define_insn "*addsi_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(plus:SI (match_operand:SI 1 "register_operand" "%0,0")
(match_operand:SI 2 "nonmemory_operand" "i,r")))]
@@ -944,8 +971,8 @@
""
"")
-(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r,&r")
+(define_insn "*subhi3_h8300"
+ [(set (match_operand:HI 0 "register_operand" "=r,r")
(minus:HI (match_operand:HI 1 "general_operand" "0,0")
(match_operand:HI 2 "nonmemory_operand" "r,n")))]
"TARGET_H8300"
@@ -955,8 +982,8 @@
[(set_attr "length" "2,4")
(set_attr "cc" "set_zn,clobber")])
-(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r,&r")
+(define_insn "*subhi3_h8300hs"
+ [(set (match_operand:HI 0 "register_operand" "=r,r")
(minus:HI (match_operand:HI 1 "general_operand" "0,0")
(match_operand:HI 2 "nonmemory_operand" "r,n")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -973,7 +1000,7 @@
""
"")
-(define_insn "subsi3_h8300"
+(define_insn "*subsi3_h8300"
[(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (match_operand:SI 1 "register_operand" "0")
(match_operand:SI 2 "register_operand" "r")))]
@@ -982,7 +1009,7 @@
[(set_attr "length" "6")
(set_attr "cc" "clobber")])
-(define_insn "subsi3_h8300h"
+(define_insn "*subsi3_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(minus:SI (match_operand:SI 1 "general_operand" "0,0")
(match_operand:SI 2 "nonmemory_operand" "r,i")))]
@@ -1163,7 +1190,7 @@
;; AND INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn ""
+(define_insn "*andqi3_1"
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(and:QI (match_operand:QI 1 "bit_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "rn,n")))]
@@ -1263,7 +1290,7 @@
;; OR INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn ""
+(define_insn "*iorqi3_1"
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(ior:QI (match_operand:QI 1 "bit_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "rn,n")))]
@@ -1304,7 +1331,7 @@
;; XOR INSTRUCTIONS
;; ----------------------------------------------------------------------
-(define_insn ""
+(define_insn "*xorqi3_1"
[(set (match_operand:QI 0 "bit_operand" "=r,U")
(xor:QI (match_operand:QI 1 "bit_operand" "%0,0")
(match_operand:QI 2 "nonmemory_operand" "rn,n")))]
@@ -1345,7 +1372,7 @@
;; {AND,IOR,XOR}{HI3,SI3} PATTERNS
;; ----------------------------------------------------------------------
-(define_insn ""
+(define_insn "*logicalhi3"
[(set (match_operand:HI 0 "register_operand" "=r")
(match_operator:HI 3 "bit_operator"
[(match_operand:HI 1 "register_operand" "%0")
@@ -1357,7 +1384,7 @@
(set (attr "cc")
(symbol_ref "compute_logical_op_cc (HImode, operands)"))])
-(define_insn ""
+(define_insn "*logicalsi3"
[(set (match_operand:SI 0 "register_operand" "=r")
(match_operator:SI 3 "bit_operator"
[(match_operand:SI 1 "register_operand" "%0")
@@ -1403,7 +1430,7 @@
""
"operands[2] = gen_reg_rtx (HImode);")
-(define_insn "neghi2_h8300h"
+(define_insn "*neghi2_h8300hs"
[(set (match_operand:HI 0 "register_operand" "=r")
(neg:HI (match_operand:HI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -1433,7 +1460,7 @@
""
"operands[2] = gen_reg_rtx (SImode);")
-(define_insn "negsi2_h8300h"
+(define_insn "*negsi2_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r")
(neg:SI (match_operand:SI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -1507,7 +1534,7 @@
""
"")
-(define_insn ""
+(define_insn "*one_cmplhi2_h8300"
[(set (match_operand:HI 0 "register_operand" "=r")
(not:HI (match_operand:HI 1 "register_operand" "0")))]
"TARGET_H8300"
@@ -1515,7 +1542,7 @@
[(set_attr "cc" "clobber")
(set_attr "length" "4")])
-(define_insn ""
+(define_insn "*one_cmplhi2_h8300hs"
[(set (match_operand:HI 0 "register_operand" "=r")
(not:HI (match_operand:HI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -1529,7 +1556,7 @@
""
"")
-(define_insn ""
+(define_insn "*one_complsi2_h8300"
[(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (match_operand:SI 1 "register_operand" "0")))]
"TARGET_H8300"
@@ -1537,7 +1564,7 @@
[(set_attr "cc" "clobber")
(set_attr "length" "8")])
-(define_insn ""
+(define_insn "*one_complsi2_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r")
(not:SI (match_operand:SI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -1725,7 +1752,7 @@
""
"")
-(define_insn "tablejump_h8300"
+(define_insn "*tablejump_h8300"
[(set (pc) (match_operand:HI 0 "register_operand" "r"))
(use (label_ref (match_operand 1 "" "")))]
"TARGET_H8300"
@@ -1733,21 +1760,21 @@
[(set_attr "cc" "none")
(set_attr "length" "2")])
-(define_insn "tablejump_h8300h"
+(define_insn "*tablejump_h8300hs_advanced"
[(set (pc) (match_operand:SI 0 "register_operand" "r"))
(use (label_ref (match_operand 1 "" "")))]
- "TARGET_H8300H || TARGET_H8300S"
+ "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE"
"jmp @%0"
[(set_attr "cc" "none")
(set_attr "length" "2")])
-(define_insn "tablejump_normal_mode"
- [(set (pc) (match_operand:HI 0 "register_operand" "r"))
- (use (label_ref (match_operand 1 "" "")))]
- "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE"
- "jmp @%S0"
- [(set_attr "cc" "none")
- (set_attr "length" "2")])
+(define_insn "*tablejump_h8300hs_normal"
+ [(set (pc) (match_operand:HI 0 "register_operand" "r"))
+ (use (label_ref (match_operand 1 "" "")))]
+ "(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE"
+ "jmp @%S0"
+ [(set_attr "cc" "none")
+ (set_attr "length" "2")])
;; This is a define expand, because pointers may be either 16 or 32 bits.
@@ -1756,21 +1783,21 @@
""
"")
-(define_insn "indirect_jump_h8300"
+(define_insn "*indirect_jump_h8300"
[(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))]
"TARGET_H8300"
"jmp @%0"
[(set_attr "cc" "none")
(set_attr "length" "2")])
-(define_insn "indirect_jump_h8300h"
+(define_insn "*indirect_jump_h8300hs_advanced"
[(set (pc) (match_operand:SI 0 "jump_address_operand" "Vr"))]
- "TARGET_H8300H || TARGET_H8300S"
+ "(TARGET_H8300H || TARGET_H8300S) && !TARGET_NORMAL_MODE"
"jmp @%0"
[(set_attr "cc" "none")
(set_attr "length" "2")])
-(define_insn "indirect_jump_normal_mode"
+(define_insn "*indirect_jump_h8300hs_normal"
[(set (pc) (match_operand:HI 0 "jump_address_operand" "Vr"))]
"(TARGET_H8300H || TARGET_H8300S) && TARGET_NORMAL_MODE"
"jmp @%S0"
@@ -1836,30 +1863,41 @@
(define_expand "push_h8300"
[(set (mem:HI (pre_dec:HI (reg:HI SP_REG)))
- (match_operand:HI 0 "register_operand" "=r"))]
-
+ (match_operand:HI 0 "register_operand" ""))]
"TARGET_H8300"
"")
-(define_expand "push_h8300hs"
+(define_expand "push_h8300hs_advanced"
[(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
- (match_operand:SI 0 "register_operand" "=r"))]
- "TARGET_H8300H && TARGET_H8300S"
+ (match_operand:SI 0 "register_operand" ""))]
+ "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
+ "")
+
+(define_expand "push_h8300hs_normal"
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 0 "register_operand" ""))]
+ "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
"")
(define_expand "pop_h8300"
- [(set (match_operand:HI 0 "register_operand" "=r")
+ [(set (match_operand:HI 0 "register_operand" "")
(mem:HI (post_inc:HI (reg:HI SP_REG))))]
"TARGET_H8300"
"")
-(define_expand "pop_h8300hs"
- [(set (match_operand:SI 0 "register_operand" "=r")
+(define_expand "pop_h8300hs_advanced"
+ [(set (match_operand:SI 0 "register_operand" "")
(mem:SI (post_inc:SI (reg:SI SP_REG))))]
- "TARGET_H8300H && TARGET_H8300S"
+ "TARGET_H8300H && TARGET_H8300S && !TARGET_NORMAL_MODE"
"")
-(define_insn "stm_h8300s_2"
+(define_expand "pop_h8300hs_normal"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (mem:SI (post_inc:HI (reg:HI SP_REG))))]
+ "TARGET_H8300H && TARGET_H8300S && TARGET_NORMAL_MODE"
+ "")
+
+(define_insn "stm_h8300s_2_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -8)))
@@ -1867,7 +1905,7 @@
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -8)))
(match_operand:SI 1 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
|| (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
|| (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
@@ -1875,7 +1913,39 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
-(define_insn "stm_h8300s_3"
+(define_insn "stm_h8300s_2_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_operand:SI 1 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
+ || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
+ || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
+ "stm.l\\t%S0-%S1,@-er7"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_expand "stm_h8300s_2"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))]
+ "TARGET_H8300S
+ && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
+ || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
+ || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_stm_h8300s_2_advanced (operands[0], operands[1]));
+ else
+ emit_insn (gen_stm_h8300s_2_normal (operands[0], operands[1]));
+ DONE;
+}")
+
+(define_insn "stm_h8300s_3_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -12)))
@@ -1885,7 +1955,28 @@
(match_operand:SI 1 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -12)))
(match_operand:SI 2 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2)
+ || (REGNO (operands[0]) == 4
+ && REGNO (operands[1]) == 5
+ && REGNO (operands[2]) == 6))"
+ "stm.l\\t%S0-%S2,@-er7"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_insn "stm_h8300s_3_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -12)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12)))
+ (match_operand:SI 2 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2)
@@ -1896,7 +1987,29 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
-(define_insn "stm_h8300s_4"
+(define_expand "stm_h8300s_3"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))
+ (use (match_operand:SI 2 "register_operand" ""))]
+ "TARGET_H8300S
+ && ((REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2)
+ || (REGNO (operands[0]) == 4
+ && REGNO (operands[1]) == 5
+ && REGNO (operands[2]) == 6))"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_stm_h8300s_3_advanced (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_stm_h8300s_3_normal (operands[0], operands[1],
+ operands[2]));
+ DONE;
+}")
+
+(define_insn "stm_h8300s_4_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int -16)))
@@ -1908,7 +2021,7 @@
(match_operand:SI 2 "register_operand" ""))
(set (mem:SI (plus:SI (reg:SI SP_REG) (const_int -16)))
(match_operand:SI 3 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2
@@ -1917,7 +2030,49 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
-(define_insn "ldm_h8300s_2"
+(define_insn "stm_h8300s_4_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -16)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12)))
+ (match_operand:SI 2 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -16)))
+ (match_operand:SI 3 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2
+ && REGNO (operands[3]) == 3"
+ "stm.l\\t%S0-%S3,@-er7"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_expand "stm_h8300s_4"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))
+ (use (match_operand:SI 2 "register_operand" ""))
+ (use (match_operand:SI 3 "register_operand" ""))]
+ "TARGET_H8300S
+ && REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2
+ && REGNO (operands[3]) == 3"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_stm_h8300s_4_advanced (operands[0], operands[1],
+ operands[2], operands[3]));
+ else
+ emit_insn (gen_stm_h8300s_4_normal (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+}")
+
+(define_insn "ldm_h8300s_2_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 8)))
@@ -1925,7 +2080,7 @@
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 1 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
|| (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
|| (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
@@ -1933,7 +2088,39 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
-(define_insn "ldm_h8300s_3"
+(define_insn "ldm_h8300s_2_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int 8)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (reg:HI SP_REG))
+ (match_operand:SI 1 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
+ || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
+ || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
+ "ldm.l\\t@er7+,%S0-%S1"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_expand "ldm_h8300s_2"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))]
+ "TARGET_H8300S
+ && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
+ || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
+ || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_ldm_h8300s_2_advanced (operands[0], operands[1]));
+ else
+ emit_insn (gen_ldm_h8300s_2_normal (operands[0], operands[1]));
+ DONE;
+}")
+
+(define_insn "ldm_h8300s_3_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 12)))
@@ -1943,7 +2130,7 @@
(match_operand:SI 1 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 2 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2)
@@ -1954,7 +2141,50 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
-(define_insn "ldm_h8300s_4"
+(define_insn "ldm_h8300s_3_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int 12)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 8)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (reg:HI SP_REG))
+ (match_operand:SI 2 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2)
+ || (REGNO (operands[0]) == 4
+ && REGNO (operands[1]) == 5
+ && REGNO (operands[2]) == 6))"
+ "ldm.l\\t@er7+,%S0-%S2"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_expand "ldm_h8300s_3"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))
+ (use (match_operand:SI 2 "register_operand" ""))]
+ "TARGET_H8300S
+ && ((REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2)
+ || (REGNO (operands[0]) == 4
+ && REGNO (operands[1]) == 5
+ && REGNO (operands[2]) == 6))"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_ldm_h8300s_3_advanced (operands[0], operands[1],
+ operands[2]));
+ else
+ emit_insn (gen_ldm_h8300s_3_normal (operands[0], operands[1],
+ operands[2]));
+ DONE;
+}")
+
+(define_insn "ldm_h8300s_4_advanced"
[(parallel
[(set (reg:SI SP_REG)
(plus:SI (reg:SI SP_REG) (const_int 16)))
@@ -1966,7 +2196,7 @@
(match_operand:SI 2 "register_operand" ""))
(set (mem:SI (reg:SI SP_REG))
(match_operand:SI 3 "register_operand" ""))])]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2
@@ -1975,6 +2205,48 @@
[(set_attr "cc" "none")
(set_attr "length" "4")])
+(define_insn "ldm_h8300s_4_normal"
+ [(parallel
+ [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int 16)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 12)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 8)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int 4)))
+ (match_operand:SI 2 "register_operand" ""))
+ (set (mem:SI (reg:HI SP_REG))
+ (match_operand:SI 3 "register_operand" ""))])]
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
+ && REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2
+ && REGNO (operands[3]) == 3"
+ "ldm.l\\t@er7+,%S0-%S3"
+ [(set_attr "cc" "none")
+ (set_attr "length" "4")])
+
+(define_expand "ldm_h8300s_4"
+ [(use (match_operand:SI 0 "register_operand" ""))
+ (use (match_operand:SI 1 "register_operand" ""))
+ (use (match_operand:SI 2 "register_operand" ""))
+ (use (match_operand:SI 3 "register_operand" ""))]
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
+ && REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2
+ && REGNO (operands[3]) == 3"
+ "
+{
+ if (!TARGET_NORMAL_MODE)
+ emit_insn (gen_ldm_h8300s_4_advanced (operands[0], operands[1],
+ operands[2], operands[3]));
+ else
+ emit_insn (gen_ldm_h8300s_4_normal (operands[0], operands[1],
+ operands[2], operands[3]));
+ DONE;
+}")
+
(define_expand "return"
[(return)]
"h8300_can_use_return_insn_p ()"
@@ -2131,7 +2403,7 @@
[(set_attr "length" "2,4,6")
(set_attr "cc" "clobber,clobber,clobber")])
-(define_insn ""
+(define_insn "*zero_extendhisi2_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (match_operand:HI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -2145,7 +2417,7 @@
""
"")
-(define_insn ""
+(define_insn "*extendqihi2_h8300"
[(set (match_operand:HI 0 "register_operand" "=r,r")
(sign_extend:HI (match_operand:QI 1 "general_operand_src" "0,g>")))]
"TARGET_H8300"
@@ -2155,7 +2427,7 @@
[(set_attr "length" "4,8")
(set_attr "cc" "clobber,clobber")])
-(define_insn ""
+(define_insn "*extendqihi2_h8300hs"
[(set (match_operand:HI 0 "register_operand" "=r")
(sign_extend:HI (match_operand:QI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -2164,7 +2436,7 @@
(set_attr "cc" "set_znv")])
(define_expand "extendqisi2"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
+ [(set (match_operand:SI 0 "register_operand" "")
(sign_extend:SI (match_operand:QI 1 "register_operand" "")))]
""
"")
@@ -2211,7 +2483,7 @@
[(set_attr "length" "6,10")
(set_attr "cc" "clobber,clobber")])
-(define_insn ""
+(define_insn "*extendhisi2_h8300hs"
[(set (match_operand:SI 0 "register_operand" "=r")
(sign_extend:SI (match_operand:HI 1 "register_operand" "0")))]
"TARGET_H8300H || TARGET_H8300S"
@@ -2261,7 +2533,7 @@
""
"expand_a_shift (QImode, LSHIFTRT, operands); DONE;")
-(define_insn ""
+(define_insn "*shiftqi"
[(set (match_operand:QI 0 "register_operand" "=r,r")
(match_operator:QI 3 "nshift_operator"
[ (match_operand:QI 1 "register_operand" "0,0")
@@ -2297,7 +2569,7 @@
""
"expand_a_shift (HImode, ASHIFTRT, operands); DONE;")
-(define_insn ""
+(define_insn "*shifthi"
[(set (match_operand:HI 0 "register_operand" "=r,r")
(match_operator:HI 3 "nshift_operator"
[ (match_operand:HI 1 "register_operand" "0,0")
@@ -2333,7 +2605,7 @@
""
"expand_a_shift (SImode, ASHIFTRT, operands); DONE;")
-(define_insn ""
+(define_insn "*shiftsi"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(match_operator:SI 3 "nshift_operator"
[ (match_operand:SI 1 "register_operand" "0,0")
@@ -3584,11 +3856,21 @@
(plus:SI (reg:SI SP_REG) (const_int -4)))
(set (mem:QI (plus:SI (reg:SI SP_REG) (const_int -3)))
(match_operand:QI 0 "register_operand" ""))])]
- "TARGET_H8300S"
+ "TARGET_H8300S && !TARGET_NORMAL_MODE"
[(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_dup 0))]
"operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
+(define_peephole2
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (set (mem:QI (plus:HI (reg:HI SP_REG) (const_int -3)))
+ (match_operand:QI 0 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE"
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_dup 0))]
+ "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
+
;; Convert a HImode push into an SImode push so that the
;; define_peephole2 below can cram multiple pushes into one stm.l.
@@ -3597,11 +3879,21 @@
(plus:SI (reg:SI SP_REG) (const_int -4)))
(set (mem:HI (plus:SI (reg:SI SP_REG) (const_int -2)))
(match_operand:HI 0 "register_operand" ""))])]
- "TARGET_H8300S"
+ "TARGET_H8300S && !TARGET_NORMAL_MODE"
[(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_dup 0))]
"operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
+(define_peephole2
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (set (mem:HI (plus:HI (reg:HI SP_REG) (const_int -2)))
+ (match_operand:HI 0 "register_operand" ""))])]
+ "TARGET_H8300S && TARGET_NORMAL_MODE"
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_dup 0))]
+ "operands[0] = gen_rtx_REG (SImode, REGNO (operands[0]));")
+
;; Cram four pushes into stm.l.
(define_peephole2
@@ -3613,7 +3905,7 @@
(match_operand:SI 2 "register_operand" ""))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_operand:SI 3 "register_operand" ""))]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2
@@ -3631,6 +3923,33 @@
(match_dup 3))])]
"")
+(define_peephole2
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 2 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 3 "register_operand" ""))]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2
+ && REGNO (operands[3]) == 3"
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG)
+ (const_int -16)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_dup 0))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_dup 1))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12)))
+ (match_dup 2))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -16)))
+ (match_dup 3))])]
+ "")
+
;; Cram three pushes into stm.l.
(define_peephole2
@@ -3640,7 +3959,7 @@
(match_operand:SI 1 "register_operand" ""))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_operand:SI 2 "register_operand" ""))]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0
&& REGNO (operands[1]) == 1
&& REGNO (operands[2]) == 2)
@@ -3658,6 +3977,31 @@
(match_dup 2))])]
"")
+(define_peephole2
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 1 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 2 "register_operand" ""))]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0
+ && REGNO (operands[1]) == 1
+ && REGNO (operands[2]) == 2)
+ || (REGNO (operands[0]) == 4
+ && REGNO (operands[1]) == 5
+ && REGNO (operands[2]) == 6))"
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG)
+ (const_int -12)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_dup 0))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_dup 1))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -12)))
+ (match_dup 2))])]
+ "")
+
;; Cram two pushes into stm.l.
(define_peephole2
@@ -3665,7 +4009,7 @@
(match_operand:SI 0 "register_operand" ""))
(set (mem:SI (pre_dec:SI (reg:SI SP_REG)))
(match_operand:SI 1 "register_operand" ""))]
- "TARGET_H8300S
+ "TARGET_H8300S && !TARGET_NORMAL_MODE
&& ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
|| (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
|| (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
@@ -3678,6 +4022,24 @@
(match_dup 1))])]
"")
+(define_peephole2
+ [(set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 0 "register_operand" ""))
+ (set (mem:SI (pre_dec:HI (reg:HI SP_REG)))
+ (match_operand:SI 1 "register_operand" ""))]
+ "TARGET_H8300S && TARGET_NORMAL_MODE
+ && ((REGNO (operands[0]) == 0 && REGNO (operands[1]) == 1)
+ || (REGNO (operands[0]) == 2 && REGNO (operands[1]) == 3)
+ || (REGNO (operands[0]) == 4 && REGNO (operands[1]) == 5))"
+ [(parallel [(set (reg:HI SP_REG)
+ (plus:HI (reg:HI SP_REG)
+ (const_int -8)))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -4)))
+ (match_dup 0))
+ (set (mem:SI (plus:HI (reg:HI SP_REG) (const_int -8)))
+ (match_dup 1))])]
+ "")
+
;; Turn
;;
;; mov.w #2,r0
@@ -4138,7 +4500,7 @@
;; dead 127 geu/ltu and.b and test
;; dead 255 geu/ltu and.b and test
;;
-;; dead 65535 geu/ltu mov.w
+;; ---- 65535 geu/ltu mov.w
;; For a small constant, it is cheaper to actually do the subtraction
;; and then test the register.
@@ -4262,7 +4624,7 @@
(pc)))]
"(TARGET_H8300H || TARGET_H8300S)
&& peep2_reg_dead_p (1, operands[0])
- && (INTVAL (operands[1]) == -2147483648
+ && (INTVAL (operands[1]) == -2147483647 - 1
|| (TARGET_H8300S && INTVAL (operands[1]) == 1073741824))"
[(set (match_dup 0)
(rotate:SI (match_dup 0)
@@ -4277,7 +4639,7 @@
(if_then_else (match_op_dup 3 [(cc0) (const_int 0)])
(label_ref (match_dup 2))
(pc)))]
- "operands[4] = GEN_INT (INTVAL (operands[1]) == -2147483648 ? 1 : 2);")
+ "operands[4] = GEN_INT (INTVAL (operands[1]) == -2147483647 - 1 ? 1 : 2);")
;; Transform
;;
@@ -4482,8 +4844,7 @@
(pc)))]
"(TARGET_H8300H || TARGET_H8300S)
&& !peep2_reg_dead_p (1, operands[0])
- && !rtx_equal_p (PATTERN (insn),
- PATTERN (next_nonnote_insn (next_nonnote_insn (insn))))"
+ && !same_cmp_following_p (insn)"
[(set (match_dup 4)
(match_dup 0))
(set (match_dup 4)
diff --git a/gcc/config/h8300/lib1funcs.asm b/gcc/config/h8300/lib1funcs.asm
index dc22e54d60e..3793a4bf522 100644
--- a/gcc/config/h8300/lib1funcs.asm
+++ b/gcc/config/h8300/lib1funcs.asm
@@ -59,9 +59,6 @@ Boston, MA 02111-1307, USA. */
#define S2H r6h
#ifdef __H8300__
-#define MOVP mov.w /* pointers are 16 bits */
-#define ADDP add.w
-#define CMPP cmp.w
#define PUSHP push
#define POPP pop
@@ -75,9 +72,6 @@ Boston, MA 02111-1307, USA. */
#endif
#if defined (__H8300H__) || defined (__H8300S__)
-#define MOVP mov.l /* pointers are 32 bits */
-#define ADDP add.l
-#define CMPP cmp.l
#define PUSHP push.l
#define POPP pop.l
@@ -323,8 +317,8 @@ setbit: inc A0L ; do insert bit
#ifdef __H8300__
divnorm:
- mov.b #0,S2L ; keep the sign in S2
mov.b A0H,A0H ; is the numerator -ve
+ stc ccr,S2L ; keep the sign in bit 3 of S2L
bge postive
; negate arg
@@ -337,8 +331,6 @@ divnorm:
addx #0,A1H
addx #0,A0L
addx #0,A0H
-
- mov.b #1,S2L ; the sign will be -ve
postive:
mov.b A2H,A2H ; is the denominator -ve
bge postive2
@@ -350,15 +342,15 @@ postive:
addx #0,A3H
addx #0,A2L
addx #0,A2H
- xor #1,S2L ; toggle result sign
+ xor.b #0x08,S2L ; toggle the result sign
postive2:
rts
;; Basically the same, except that the sign of the divisor determines
;; the sign.
modnorm:
- mov.b #0,S2L ; keep the sign in S2
mov.b A0H,A0H ; is the numerator -ve
+ stc ccr,S2L ; keep the sign in bit 3 of S2L
bge mpostive
; negate arg
@@ -371,8 +363,6 @@ modnorm:
addx #0,A1H
addx #0,A0L
addx #0,A0H
-
- mov.b #1,S2L ; the sign will be -ve
mpostive:
mov.b A2H,A2H ; is the denominator -ve
bge mpostive2
@@ -390,19 +380,18 @@ mpostive2:
#else /* __H8300H__ */
divnorm:
- mov.b #0,S2L ; keep the sign in S2
mov.l A0P,A0P ; is the numerator -ve
+ stc ccr,S2L ; keep the sign in bit 3 of S2L
bge postive
neg.l A0P ; negate arg
- mov.b #1,S2L ; the sign will be -ve
postive:
mov.l A1P,A1P ; is the denominator -ve
bge postive2
neg.l A1P ; negate arg
- xor.b #1,S2L ; toggle result sign
+ xor.b #0x08,S2L ; toggle the result sign
postive2:
rts
@@ -410,12 +399,11 @@ postive2:
;; Basically the same, except that the sign of the divisor determines
;; the sign.
modnorm:
- mov.b #0,S2L ; keep the sign in S2
mov.l A0P,A0P ; is the numerator -ve
+ stc ccr,S2L ; keep the sign in bit 3 of S2L
bge mpostive
neg.l A0P ; negate arg
- mov.b #1,S2L ; the sign will be -ve
mpostive:
mov.l A1P,A1P ; is the denominator -ve
@@ -432,58 +420,68 @@ mpostive2:
; denominator in A2/A3
.global ___modsi3
___modsi3:
+#ifdef __H8300__
PUSHP S2P
PUSHP S0P
PUSHP S1P
-
bsr modnorm
bsr divmodsi4
-#ifdef __H8300__
mov S0,A0
mov S1,A1
+ bra exitdiv
#else
- mov.l S0P,A0P
-#endif
+ PUSHP S2P
+ bsr modnorm
+ bsr ___udivsi3
+ mov.l er3,er0
bra exitdiv
+#endif
+ ;; H8/300H and H8S version of ___udivsi3 is defined later in
+ ;; the file.
+#ifdef __H8300__
.global ___udivsi3
___udivsi3:
PUSHP S2P
PUSHP S0P
PUSHP S1P
- mov.b #0,S2L ; keep sign low
bsr divmodsi4
- bra exitdiv
+ bra reti
+#endif
.global ___umodsi3
___umodsi3:
+#ifdef __H8300__
PUSHP S2P
PUSHP S0P
PUSHP S1P
- mov.b #0,S2L ; keep sign low
bsr divmodsi4
-#ifdef __H8300__
mov S0,A0
mov S1,A1
+ bra reti
#else
- mov.l S0P,A0P
+ bsr ___udivsi3
+ mov.l er3,er0
+ rts
#endif
- bra exitdiv
.global ___divsi3
___divsi3:
+#ifdef __H8300__
PUSHP S2P
PUSHP S0P
PUSHP S1P
jsr divnorm
jsr divmodsi4
+#else
+ PUSHP S2P
+ jsr divnorm
+ bsr ___udivsi3
+#endif
; examine what the sign should be
exitdiv:
- POPP S1P
- POPP S0P
-
- or S2L,S2L
+ btst #3,S2L
beq reti
; should be -ve
@@ -502,6 +500,10 @@ exitdiv:
#endif
reti:
+#ifdef __H8300__
+ POPP S1P
+ POPP S0P
+#endif
POPP S2P
rts
@@ -509,7 +511,7 @@ reti:
; A2/A3 denominator (A1P for H8/300H)
; returns A0/A1 quotient (A0P for H8/300H)
; S0/S1 remainder (S0P for H8/300H)
- ; trashes S2
+ ; trashes S2H
#ifdef __H8300__
@@ -519,7 +521,7 @@ divmodsi4:
mov.b A2H,S2H
or A2L,S2H
or A3H,S2H
- bne DenHighZero
+ bne DenHighNonZero
mov.b A0H,A0H
bne NumByte0Zero
mov.b A0L,A0L
@@ -549,7 +551,7 @@ NumByte3Zero:
rts
; have to do the divide by shift and test
-DenHighZero:
+DenHighNonZero:
mov.b A0H,S1L
mov.b A0L,A0H
mov.b A1H,A0L
@@ -588,10 +590,11 @@ setone:
#else /* __H8300H__ */
-divmodsi4:
- sub.l S0P,S0P ; zero play area
+ ;; This function also computes the remainder and stores it in er3.
+ .global ___udivsi3
+___udivsi3:
mov.w A1E,A1E ; denominator top word 0?
- bne DenHighZero
+ bne DenHighNonZero
; do it the easy way, see page 107 in manual
mov.w A0E,A2
@@ -599,36 +602,65 @@ divmodsi4:
divxu.w A1,A2P
mov.w A2E,A0E
divxu.w A1,A0P
- mov.w A0E,S0
- mov.w A2,A0E
- extu.l S0P
- rts
-
-DenHighZero:
- mov.w A0E,A2
- mov.b A2H,S0L
- mov.b A2L,A2H
- mov.b A0H,A2L
+ mov.w A0E,A3
mov.w A2,A0E
- mov.b A0L,A0H
- mov.b #0,A0L
- mov.b #24,S2H ; only do 24 iterations
-
-nextbit:
- shll.l A0P ; double the answer guess
- rotxl.l S0P ; double remainder
- sub.l A1P,S0P ; does it all fit?
- bhs setone
-
- add.l A1P,S0P ; no, restore mistake
- dec S2H
- bne nextbit
+ extu.l A3P
rts
-setone:
- inc A0L
- dec S2H
- bne nextbit
+ ; er0 = er0 / er1
+ ; er3 = er0 % er1
+ ; trashes er1 er2
+ ; expects er1 >= 2^16
+DenHighNonZero:
+ mov.l er0,er3
+ mov.l er1,er2
+#ifdef __H8300H__
+divmod_L21:
+ shlr.l er0
+ shlr.l er2 ; make divisor < 2^16
+ mov.w e2,e2
+ bne divmod_L21
+#else
+ shlr.l #2,er2 ; make divisor < 2^16
+ mov.w e2,e2
+ beq divmod_L22A
+divmod_L21:
+ shlr.l #2,er0
+divmod_L22:
+ shlr.l #2,er2 ; make divisor < 2^16
+ mov.w e2,e2
+ bne divmod_L21
+divmod_L22A:
+ rotxl.w r2
+ bcs divmod_L23
+ shlr.l er0
+ bra divmod_L24
+divmod_L23:
+ rotxr.w r2
+ shlr.l #2,er0
+divmod_L24:
+#endif
+ ;; At this point,
+ ;; er0 contains shifted dividend
+ ;; er1 contains divisor
+ ;; er2 contains shifted divisor
+ ;; er3 contains dividend, later remainder
+ divxu.w r2,er0 ; r0 now contains the approximate quotient (AQ)
+ extu.l er0
+ beq divmod_L25
+ subs #1,er0 ; er0 = AQ - 1
+ mov.w e1,r2
+ mulxu.w r0,er2 ; er2 = upper (AQ - 1) * divisor
+ sub.w r2,e3 ; dividend - 65536 * er2
+ mov.w r1,r2
+ mulxu.w r0,er2 ; compute er3 = remainder (tentative)
+ sub.l er2,er3 ; er3 = dividend - (AQ - 1) * divisor
+divmod_L25:
+ cmp.l er1,er3 ; is divisor < remainder?
+ blo divmod_L26
+ adds #1,er0
+ sub.l er1,er3 ; correct the remainder
+divmod_L26:
rts
#endif
@@ -698,7 +730,6 @@ ___mulhi3:
___mulsi3:
PUSHP S0P
PUSHP S1P
- PUSHP S2P
sub.w S0,S0
sub.w S1,S1
@@ -731,7 +762,6 @@ _nobit:
_done:
mov.w S0,A0
mov.w S1,A1
- POPP S2P
POPP S1P
POPP S0P
rts
diff --git a/gcc/config/h8300/t-h8300 b/gcc/config/h8300/t-h8300
index a8b2981e397..28ea2cf71bd 100644
--- a/gcc/config/h8300/t-h8300
+++ b/gcc/config/h8300/t-h8300
@@ -1,6 +1,3 @@
-# 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.
LIB1ASMSRC = h8300/lib1funcs.asm
LIB1ASMFUNCS = _cmpsi2 _ucmpsi2 _divhi3 _divsi3 _mulhi3 _mulsi3 \
_fixunssfsi_asm
diff --git a/gcc/config/i370/i370-protos.h b/gcc/config/i370/i370-protos.h
index be2c01c463d..666db0b7aa6 100644
--- a/gcc/config/i370/i370-protos.h
+++ b/gcc/config/i370/i370-protos.h
@@ -24,32 +24,32 @@ Boston, MA 02111-1307, USA. */
#ifndef GCC_I370_PROTOS_H
#define GCC_I370_PROTOS_H
-extern void override_options PARAMS ((void));
+extern void override_options (void);
#ifdef RTX_CODE
-extern int i370_branch_dest PARAMS ((rtx));
-extern int i370_branch_length PARAMS ((rtx));
-extern int i370_short_branch PARAMS ((rtx));
-extern int s_operand PARAMS ((rtx, enum machine_mode));
-extern int r_or_s_operand PARAMS ((rtx, enum machine_mode));
-extern int unsigned_jump_follows_p PARAMS ((rtx));
+extern int i370_branch_dest (rtx);
+extern int i370_branch_length (rtx);
+extern int i370_short_branch (rtx);
+extern int s_operand (rtx, enum machine_mode);
+extern int r_or_s_operand (rtx, enum machine_mode);
+extern int unsigned_jump_follows_p (rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern int handle_pragma PARAMS ((int (*)(void), void (*)(int), const char *));
+extern int handle_pragma (int (*)(void), void (*)(int), const char *);
#endif /* TREE_CODE */
-extern void mvs_add_label PARAMS ((int));
-extern int mvs_check_label PARAMS ((int));
-extern int mvs_check_page PARAMS ((FILE *, int, int));
-extern int mvs_function_check PARAMS ((const char *));
-extern void mvs_add_alias PARAMS ((const char *, const char *, int));
-extern int mvs_need_alias PARAMS ((const char *));
-extern int mvs_get_alias PARAMS ((const char *, char *));
-extern int mvs_check_alias PARAMS ((const char *, char *));
-extern void check_label_emit PARAMS ((void));
-extern void mvs_free_label_list PARAMS ((void));
-
-extern void i370_pr_map PARAMS ((struct cpp_reader *));
+extern void mvs_add_label (int);
+extern int mvs_check_label (int);
+extern int mvs_check_page (FILE *, int, int);
+extern int mvs_function_check (const char *);
+extern void mvs_add_alias (const char *, const char *, int);
+extern int mvs_need_alias (const char *);
+extern int mvs_get_alias (const char *, char *);
+extern int mvs_check_alias (const char *, char *);
+extern void check_label_emit (void);
+extern void mvs_free_label_list (void);
+
+extern void i370_pr_map (struct cpp_reader *);
#endif /* ! GCC_I370_PROTOS_H */
diff --git a/gcc/config/i370/i370.c b/gcc/config/i370/i370.c
index 0dfa3c4559b..2cfe4fe3269 100644
--- a/gcc/config/i370/i370.c
+++ b/gcc/config/i370/i370.c
@@ -99,22 +99,22 @@ static label_node_t *free_anchor = 0;
/* Assembler source file descriptor. */
static FILE *assembler_source = 0;
-static label_node_t * mvs_get_label PARAMS ((int));
-static void i370_label_scan PARAMS ((void));
+static label_node_t * mvs_get_label (int);
+static void i370_label_scan (void);
#ifdef TARGET_HLASM
-static bool i370_hlasm_assemble_integer PARAMS ((rtx, unsigned int, int));
-static void i370_globalize_label PARAMS ((FILE *, const char *));
+static bool i370_hlasm_assemble_integer (rtx, unsigned int, int);
+static void i370_globalize_label (FILE *, const char *);
#endif
-static void i370_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void i370_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void i370_file_start PARAMS ((void));
-static void i370_file_end PARAMS ((void));
+static void i370_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void i370_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void i370_file_start (void);
+static void i370_file_end (void);
#ifdef LONGEXTERNAL
-static int mvs_hash_alias PARAMS ((const char *));
+static int mvs_hash_alias (const char *);
#endif
-static void i370_internal_label PARAMS ((FILE *, const char *, unsigned long));
-static bool i370_rtx_costs PARAMS ((rtx, int, int, int *));
+static void i370_internal_label (FILE *, const char *, unsigned long);
+static bool i370_rtx_costs (rtx, int, int, int *);
/* ===================================================== */
/* defines and functions specific to the HLASM assembler */
diff --git a/gcc/config/i370/linux.h b/gcc/config/i370/linux.h
index adc1959c4d0..f402fbde9f3 100644
--- a/gcc/config/i370/linux.h
+++ b/gcc/config/i370/linux.h
@@ -29,13 +29,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_ELF_ABI
/* Target OS preprocessor built-ins. */
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=posix"); \
- } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
/* Options for this target machine. */
diff --git a/gcc/config/i386/athlon.md b/gcc/config/i386/athlon.md
index b90ae22c06d..4ce9a3812d8 100644
--- a/gcc/config/i386/athlon.md
+++ b/gcc/config/i386/athlon.md
@@ -220,7 +220,7 @@
(and (eq_attr "type" "idiv")
(eq_attr "memory" "load,both")))
"athlon-vector,((athlon-load,athlon-ieu0*6)+(athlon-fpsched,athlon-fvector))")
-;; The paralelism of string instructions is not documented. Model it same way
+;; The parallelism of string instructions is not documented. Model it same way
;; as idiv to create smaller automata. This probably does not matter much.
(define_insn_reservation "athlon_str" 6
(and (eq_attr "cpu" "athlon,k8")
@@ -831,7 +831,7 @@
(and (eq_attr "cpu" "k8")
(eq_attr "type" "ssemul"))
"athlon-double,athlon-fpsched,(athlon-fmul*2)")
-;; divsd timmings. divss is faster
+;; divsd timings. divss is faster
(define_insn_reservation "athlon_ssediv_load" 20
(and (eq_attr "cpu" "athlon")
(and (eq_attr "type" "ssediv")
diff --git a/gcc/config/i386/cygming.h b/gcc/config/i386/cygming.h
index 8ed30443bc8..99b037233da 100644
--- a/gcc/config/i386/cygming.h
+++ b/gcc/config/i386/cygming.h
@@ -376,6 +376,9 @@ extern int i386_pe_dllimport_name_p (const char *);
alias = XSTR (rtlname, 0); \
else \
abort (); \
+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
+ i386_pe_declare_function_type (STREAM, alias, \
+ TREE_PUBLIC (DECL)); \
ASM_OUTPUT_DEF (STREAM, alias, IDENTIFIER_POINTER (TARGET)); \
} while (0)
@@ -384,4 +387,3 @@ extern int i386_pe_dllimport_name_p (const char *);
#ifndef BUFSIZ
# undef FILE
#endif
-
diff --git a/gcc/config/i386/gnu.h b/gcc/config/i386/gnu.h
index ff0ff254bac..cc9994bcaed 100644
--- a/gcc/config/i386/gnu.h
+++ b/gcc/config/i386/gnu.h
@@ -7,14 +7,7 @@
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("MACH"); \
- builtin_define_std ("unix"); \
- builtin_define ("__GNU__"); \
- builtin_define ("__gnu_hurd__"); \
- builtin_assert ("system=gnu"); \
- builtin_assert ("system=mach"); \
- builtin_assert ("system=posix"); \
- builtin_assert ("system=unix"); \
+ HURD_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/i386/i386-interix.h b/gcc/config/i386/i386-interix.h
index 9e20b31dbf6..4f21789c99d 100644
--- a/gcc/config/i386/i386-interix.h
+++ b/gcc/config/i386/i386-interix.h
@@ -145,13 +145,13 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_LIMITED_STRING(FILE, STR) \
do \
{ \
- register const unsigned char *_limited_str = \
+ const unsigned char *_limited_str = \
(const unsigned char *) (STR); \
- register unsigned ch; \
+ unsigned ch; \
fprintf ((FILE), "%s\"", STRING_ASM_OP); \
for (; (ch = *_limited_str); _limited_str++) \
{ \
- register int escape = ESCAPES[ch]; \
+ int escape = ESCAPES[ch]; \
switch (escape) \
{ \
case 0: \
@@ -181,13 +181,13 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
- register const unsigned char *_ascii_bytes = \
+ const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
- register const unsigned char *limit = _ascii_bytes + (LENGTH); \
- register unsigned bytes_in_chunk = 0; \
+ const unsigned char *limit = _ascii_bytes + (LENGTH); \
+ unsigned bytes_in_chunk = 0; \
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
- register const unsigned char *p; \
+ const unsigned char *p; \
if (bytes_in_chunk >= 64) \
{ \
fputc ('\n', (FILE)); \
diff --git a/gcc/config/i386/i386-modes.def b/gcc/config/i386/i386-modes.def
index ddfc5cfcf52..89c83c44187 100644
--- a/gcc/config/i386/i386-modes.def
+++ b/gcc/config/i386/i386-modes.def
@@ -18,11 +18,21 @@ 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. */
-/* By default our XFmode is the 80-bit extended format. If we use
- TFmode instead, it's also the 80-bit format, but with padding. */
+/* x86_64 ABI specifies both XF and TF modes.
+ XFmode is __float80 is IEEE extended; TFmode is __float128
+ is IEEE quad.
+
+ IEEE extended is 128 bits wide, except in ILP32 mode, but we
+ have to say it's 12 bytes so that the bitsize and wider_mode
+ tables are correctly set up. We correct its size below. */
FLOAT_MODE (XF, 12, ieee_extended_intel_96_format);
-FLOAT_MODE (TF, 16, ieee_extended_intel_128_format);
+ADJUST_FLOAT_FORMAT (XF, (TARGET_128BIT_LONG_DOUBLE
+ ? &ieee_extended_intel_128_format
+ : &ieee_extended_intel_96_format));
+ADJUST_BYTESIZE (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 12);
+ADJUST_ALIGNMENT (XF, TARGET_128BIT_LONG_DOUBLE ? 16 : 4);
+FLOAT_MODE (TF, 16, ieee_quad_format);
/* Add any extra modes needed to represent the condition code.
diff --git a/gcc/config/i386/i386-protos.h b/gcc/config/i386/i386-protos.h
index 33469ccd3ef..60880b805e2 100644
--- a/gcc/config/i386/i386-protos.h
+++ b/gcc/config/i386/i386-protos.h
@@ -203,7 +203,6 @@ extern rtx ix86_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
#ifdef TREE_CODE
extern int ix86_return_pops_args (tree, tree, int);
-extern tree ix86_build_va_list (void);
extern int ix86_data_alignment (tree, int);
extern int ix86_local_alignment (tree, int);
diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 8fdf24dad46..d4653ace834 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -830,7 +830,8 @@ static void x86_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
static bool x86_can_output_mi_thunk (tree, HOST_WIDE_INT, HOST_WIDE_INT, tree);
static void x86_file_start (void);
static void ix86_reorg (void);
-bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*);
+static bool ix86_expand_carry_flag_compare (enum rtx_code, rtx, rtx, rtx*);
+static tree ix86_build_builtin_va_list (void);
struct ix86_address
{
@@ -1012,6 +1013,9 @@ static void init_ext_80387_constants (void);
#undef TARGET_MACHINE_DEPENDENT_REORG
#define TARGET_MACHINE_DEPENDENT_REORG ix86_reorg
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST ix86_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* The svr4 ABI for the i386 says that records and unions are returned
@@ -1662,7 +1666,7 @@ ix86_comp_type_attributes (tree type1, tree type2)
/* Return the regparm value for a fuctio with the indicated TYPE and DECL.
DECL may be NULL when calling function indirectly
- or considerling a libcall. */
+ or considering a libcall. */
static int
ix86_function_regparm (tree type, tree decl)
@@ -1930,7 +1934,7 @@ static int
classify_argument (enum machine_mode mode, tree type,
enum x86_64_reg_class classes[MAX_CLASSES], int bit_offset)
{
- int bytes =
+ HOST_WIDE_INT bytes =
(mode == BLKmode) ? int_size_in_bytes (type) : (int) GET_MODE_SIZE (mode);
int words = (bytes + (bit_offset % 64) / 8 + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
@@ -2193,11 +2197,14 @@ classify_argument (enum machine_mode mode, tree type,
case DFmode:
classes[0] = X86_64_SSEDF_CLASS;
return 1;
- case TFmode:
+ case XFmode:
classes[0] = X86_64_X87_CLASS;
classes[1] = X86_64_X87UP_CLASS;
return 2;
+ case TFmode:
case TCmode:
+ return 0;
+ case XCmode:
classes[0] = X86_64_X87_CLASS;
classes[1] = X86_64_X87UP_CLASS;
classes[2] = X86_64_X87_CLASS;
@@ -2334,16 +2341,16 @@ construct_container (enum machine_mode mode, tree type, int in_return,
return gen_rtx_REG (mode, SSE_REGNO (sse_regno));
if (n == 2
&& class[0] == X86_64_X87_CLASS && class[1] == X86_64_X87UP_CLASS)
- return gen_rtx_REG (TFmode, FIRST_STACK_REG);
+ return gen_rtx_REG (XFmode, FIRST_STACK_REG);
if (n == 2 && class[0] == X86_64_INTEGER_CLASS
&& class[1] == X86_64_INTEGER_CLASS
- && (mode == CDImode || mode == TImode)
+ && (mode == CDImode || mode == TImode || mode == TFmode)
&& intreg[0] + 1 == intreg[1])
return gen_rtx_REG (mode, intreg[0]);
if (n == 4
&& class[0] == X86_64_X87_CLASS && class[1] == X86_64_X87UP_CLASS
&& class[2] == X86_64_X87_CLASS && class[3] == X86_64_X87UP_CLASS)
- return gen_rtx_REG (TCmode, FIRST_STACK_REG);
+ return gen_rtx_REG (XCmode, FIRST_STACK_REG);
/* Otherwise figure out the entries of the PARALLEL. */
for (i = 0; i < n; i++)
@@ -2775,8 +2782,9 @@ ix86_return_in_memory (tree type)
}
}
- if (mode == TFmode)
+ if (mode == XFmode)
return 0;
+
if (size > 12)
return 1;
return 0;
@@ -2791,20 +2799,23 @@ ix86_libcall_value (enum machine_mode mode)
{
switch (mode)
{
- case SFmode:
- case SCmode:
- case DFmode:
- case DCmode:
- return gen_rtx_REG (mode, FIRST_SSE_REG);
- case TFmode:
- case TCmode:
- return gen_rtx_REG (mode, FIRST_FLOAT_REG);
- default:
- return gen_rtx_REG (mode, 0);
+ case SFmode:
+ case SCmode:
+ case DFmode:
+ case DCmode:
+ return gen_rtx_REG (mode, FIRST_SSE_REG);
+ case XFmode:
+ case XCmode:
+ return gen_rtx_REG (mode, FIRST_FLOAT_REG);
+ case TFmode:
+ case TCmode:
+ return NULL;
+ default:
+ return gen_rtx_REG (mode, 0);
}
}
else
- return gen_rtx_REG (mode, ix86_value_regno (mode));
+ return gen_rtx_REG (mode, ix86_value_regno (mode));
}
/* Given a mode, return the register to use for a return value. */
@@ -2825,8 +2836,8 @@ ix86_value_regno (enum machine_mode mode)
/* Create the va_list data type. */
-tree
-ix86_build_va_list (void)
+static tree
+ix86_build_builtin_va_list (void)
{
tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
@@ -3430,7 +3441,7 @@ const_int_1_31_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
reference and a constant. */
int
-symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -3474,7 +3485,7 @@ symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
/* Return true if the operand contains a @GOT or @GOTOFF reference. */
int
-pic_symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+pic_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST)
return 0;
@@ -3537,7 +3548,7 @@ local_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
/* Test for various thread-local symbols. */
int
-tls_symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+tls_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != SYMBOL_REF)
return 0;
@@ -3553,29 +3564,27 @@ tls_symbolic_operand_1 (rtx op, enum tls_model kind)
}
int
-global_dynamic_symbolic_operand (register rtx op,
+global_dynamic_symbolic_operand (rtx op,
enum machine_mode mode ATTRIBUTE_UNUSED)
{
return tls_symbolic_operand_1 (op, TLS_MODEL_GLOBAL_DYNAMIC);
}
int
-local_dynamic_symbolic_operand (register rtx op,
+local_dynamic_symbolic_operand (rtx op,
enum machine_mode mode ATTRIBUTE_UNUSED)
{
return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_DYNAMIC);
}
int
-initial_exec_symbolic_operand (register rtx op,
- enum machine_mode mode ATTRIBUTE_UNUSED)
+initial_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return tls_symbolic_operand_1 (op, TLS_MODEL_INITIAL_EXEC);
}
int
-local_exec_symbolic_operand (register rtx op,
- enum machine_mode mode ATTRIBUTE_UNUSED)
+local_exec_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return tls_symbolic_operand_1 (op, TLS_MODEL_LOCAL_EXEC);
}
@@ -3646,13 +3655,13 @@ constant_call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
/* Match exactly zero and one. */
int
-const0_operand (register rtx op, enum machine_mode mode)
+const0_operand (rtx op, enum machine_mode mode)
{
return op == CONST0_RTX (mode);
}
int
-const1_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+const1_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return op == const1_rtx;
}
@@ -3660,33 +3669,32 @@ const1_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
/* Match 2, 4, or 8. Used for leal multiplicands. */
int
-const248_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+const248_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& (INTVAL (op) == 2 || INTVAL (op) == 4 || INTVAL (op) == 8));
}
int
-const_0_to_3_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+const_0_to_3_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 4);
}
int
-const_0_to_7_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+const_0_to_7_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 8);
}
int
-const_0_to_15_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+const_0_to_15_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 16);
}
int
-const_0_to_255_operand (register rtx op,
- enum machine_mode mode ATTRIBUTE_UNUSED)
+const_0_to_255_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT && INTVAL (op) >= 0 && INTVAL (op) < 256);
}
@@ -3695,7 +3703,7 @@ const_0_to_255_operand (register rtx op,
/* True if this is a constant appropriate for an increment or decrement. */
int
-incdec_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+incdec_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* On Pentium4, the inc and dec operations causes extra dependency on flag
registers, since carry flag is not set. */
@@ -3724,7 +3732,7 @@ shiftdi_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
Which would only happen in pathological cases. */
int
-reg_no_sp_operand (register rtx op, enum machine_mode mode)
+reg_no_sp_operand (rtx op, enum machine_mode mode)
{
rtx t = op;
if (GET_CODE (t) == SUBREG)
@@ -3736,7 +3744,7 @@ reg_no_sp_operand (register rtx op, enum machine_mode mode)
}
int
-mmx_reg_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+mmx_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return MMX_REG_P (op);
}
@@ -3745,7 +3753,7 @@ mmx_reg_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
general_operand. */
int
-general_no_elim_operand (register rtx op, enum machine_mode mode)
+general_no_elim_operand (rtx op, enum machine_mode mode)
{
rtx t = op;
if (GET_CODE (t) == SUBREG)
@@ -3766,7 +3774,7 @@ general_no_elim_operand (register rtx op, enum machine_mode mode)
register_operand or const_int. */
int
-nonmemory_no_elim_operand (register rtx op, enum machine_mode mode)
+nonmemory_no_elim_operand (rtx op, enum machine_mode mode)
{
rtx t = op;
if (GET_CODE (t) == SUBREG)
@@ -3783,7 +3791,7 @@ nonmemory_no_elim_operand (register rtx op, enum machine_mode mode)
otherwise work like register_operand. */
int
-index_register_operand (register rtx op, enum machine_mode mode)
+index_register_operand (rtx op, enum machine_mode mode)
{
rtx t = op;
if (GET_CODE (t) == SUBREG)
@@ -3804,7 +3812,7 @@ index_register_operand (register rtx op, enum machine_mode mode)
/* Return true if op is a Q_REGS class register. */
int
-q_regs_operand (register rtx op, enum machine_mode mode)
+q_regs_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
@@ -3816,7 +3824,7 @@ q_regs_operand (register rtx op, enum machine_mode mode)
/* Return true if op is an flags register. */
int
-flags_reg_operand (register rtx op, enum machine_mode mode)
+flags_reg_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
@@ -3826,7 +3834,7 @@ flags_reg_operand (register rtx op, enum machine_mode mode)
/* Return true if op is a NON_Q_REGS class register. */
int
-non_q_regs_operand (register rtx op, enum machine_mode mode)
+non_q_regs_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && GET_MODE (op) != mode)
return 0;
@@ -3874,7 +3882,7 @@ vector_move_operand (rtx op, enum machine_mode mode)
a segment override. */
int
-no_seg_address_operand (register rtx op, enum machine_mode mode)
+no_seg_address_operand (rtx op, enum machine_mode mode)
{
struct ix86_address parts;
@@ -3919,7 +3927,7 @@ sse_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
}
/* Return 1 if OP is a valid comparison operator in valid mode. */
int
-ix86_comparison_operator (register rtx op, enum machine_mode mode)
+ix86_comparison_operator (rtx op, enum machine_mode mode)
{
enum machine_mode inmode;
enum rtx_code code = GET_CODE (op);
@@ -3960,7 +3968,7 @@ ix86_comparison_operator (register rtx op, enum machine_mode mode)
/* Return 1 if OP is a valid comparison operator testing carry flag
to be set. */
int
-ix86_carry_flag_operator (register rtx op, enum machine_mode mode)
+ix86_carry_flag_operator (rtx op, enum machine_mode mode)
{
enum machine_mode inmode;
enum rtx_code code = GET_CODE (op);
@@ -3992,7 +4000,7 @@ ix86_carry_flag_operator (register rtx op, enum machine_mode mode)
/* Return 1 if OP is a comparison operator that can be issued by fcmov. */
int
-fcmov_comparison_operator (register rtx op, enum machine_mode mode)
+fcmov_comparison_operator (rtx op, enum machine_mode mode)
{
enum machine_mode inmode;
enum rtx_code code = GET_CODE (op);
@@ -4029,8 +4037,7 @@ fcmov_comparison_operator (register rtx op, enum machine_mode mode)
/* Return 1 if OP is a binary operator that can be promoted to wider mode. */
int
-promotable_binary_operator (register rtx op,
- enum machine_mode mode ATTRIBUTE_UNUSED)
+promotable_binary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -4054,7 +4061,7 @@ promotable_binary_operator (register rtx op,
into registers. */
int
-cmp_fp_expander_operand (register rtx op, enum machine_mode mode)
+cmp_fp_expander_operand (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -4066,7 +4073,7 @@ cmp_fp_expander_operand (register rtx op, enum machine_mode mode)
/* Match an SI or HImode register for a zero_extract. */
int
-ext_register_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+ext_register_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int regno;
if ((!TARGET_64BIT || GET_MODE (op) != DImode)
@@ -4085,7 +4092,7 @@ ext_register_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
OP is the expression matched, and MODE is its mode. */
int
-binary_fp_operator (register rtx op, enum machine_mode mode)
+binary_fp_operator (rtx op, enum machine_mode mode)
{
if (mode != VOIDmode && mode != GET_MODE (op))
return 0;
@@ -4104,13 +4111,13 @@ binary_fp_operator (register rtx op, enum machine_mode mode)
}
int
-mult_operator (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+mult_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == MULT;
}
int
-div_operator (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+div_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == DIV;
}
@@ -4126,7 +4133,7 @@ arith_or_logical_operator (rtx op, enum machine_mode mode)
/* Returns 1 if OP is memory operand with a displacement. */
int
-memory_displacement_operand (register rtx op, enum machine_mode mode)
+memory_displacement_operand (rtx op, enum machine_mode mode)
{
struct ix86_address parts;
@@ -4168,7 +4175,7 @@ cmpsi_operand (rtx op, enum machine_mode mode)
modRM array. */
int
-long_memory_operand (register rtx op, enum machine_mode mode)
+long_memory_operand (rtx op, enum machine_mode mode)
{
if (! memory_operand (op, mode))
return 0;
@@ -4253,8 +4260,7 @@ init_ext_80387_constants (void)
real_from_string (&ext_80387_constants_table[i], cst[i]);
/* Ensure each constant is rounded to XFmode precision. */
real_convert (&ext_80387_constants_table[i],
- TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode,
- &ext_80387_constants_table[i]);
+ XFmode, &ext_80387_constants_table[i]);
}
ext_80387_constants_init = 1;
@@ -4276,7 +4282,7 @@ standard_80387_constant_p (rtx x)
/* For XFmode constants, try to find a special 80387 instruction on
those CPUs that benefit from them. */
- if ((GET_MODE (x) == XFmode || GET_MODE (x) == TFmode)
+ if (GET_MODE (x) == XFmode
&& x86_ext_80387_constants & TUNEMASK)
{
REAL_VALUE_TYPE r;
@@ -4347,7 +4353,7 @@ standard_80387_constant_rtx (int idx)
}
return CONST_DOUBLE_FROM_REAL_VALUE (ext_80387_constants_table[i],
- TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode);
+ XFmode);
}
/* Return 1 if X is FP constant we can load to SSE register w/o using memory.
@@ -4365,8 +4371,8 @@ standard_sse_constant_p (rtx x)
int
symbolic_reference_mentioned_p (rtx op)
{
- register const char *fmt;
- register int i;
+ const char *fmt;
+ int i;
if (GET_CODE (op) == SYMBOL_REF || GET_CODE (op) == LABEL_REF)
return 1;
@@ -4376,7 +4382,7 @@ symbolic_reference_mentioned_p (rtx op)
{
if (fmt[i] == 'E')
{
- register int j;
+ int j;
for (j = XVECLEN (op, i) - 1; j >= 0; j--)
if (symbolic_reference_mentioned_p (XVECEXP (op, i, j)))
@@ -4449,6 +4455,9 @@ x86_64_sign_extended_value (rtx value)
library. Don't count TLS SYMBOL_REFs here, since they should fit
only if inside of UNSPEC handled below. */
case SYMBOL_REF:
+ /* TLS symbols are not constant. */
+ if (tls_symbolic_operand (value, Pmode))
+ return false;
return (ix86_cmodel == CM_SMALL || ix86_cmodel == CM_KERNEL);
/* For certain code models, the code is near as well. */
@@ -4554,6 +4563,9 @@ x86_64_zero_extended_value (rtx value)
/* For certain code models, the symbolic references are known to fit. */
case SYMBOL_REF:
+ /* TLS symbols are not constant. */
+ if (tls_symbolic_operand (value, Pmode))
+ return false;
return ix86_cmodel == CM_SMALL;
/* For certain code models, the code is near as well. */
@@ -4882,7 +4894,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
{
HOST_WIDE_INT total_size;
int stack_alignment_needed = cfun->stack_alignment_needed / BITS_PER_UNIT;
- int offset;
+ HOST_WIDE_INT offset;
int preferred_alignment = cfun->preferred_stack_boundary / BITS_PER_UNIT;
HOST_WIDE_INT size = get_frame_size ();
@@ -4998,7 +5010,8 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
(size + frame->padding1 + frame->padding2
+ frame->outgoing_arguments_size + frame->va_arg_size);
- if (!frame->to_allocate && frame->nregs <= 1)
+ if ((!frame->to_allocate && frame->nregs <= 1)
+ || (TARGET_64BIT && frame->to_allocate >= (HOST_WIDE_INT) 0x80000000))
frame->save_regs_using_mov = false;
if (TARGET_RED_ZONE && current_function_sp_is_unchanging
@@ -5035,7 +5048,7 @@ ix86_compute_frame_layout (struct ix86_frame *frame)
static void
ix86_emit_save_regs (void)
{
- register int regno;
+ int regno;
rtx insn;
for (regno = FIRST_PSEUDO_REGISTER - 1; regno >= 0; regno--)
@@ -5065,6 +5078,41 @@ ix86_emit_save_regs_using_mov (rtx pointer, HOST_WIDE_INT offset)
}
}
+/* Expand prologue or epilogue stack adjustment.
+ The pattern exist to put a dependency on all ebp-based memory accesses.
+ STYLE should be negative if instructions should be marked as frame related,
+ zero if %r11 register is live and cannot be freely used and positive
+ otherwise. */
+
+static void
+pro_epilogue_adjust_stack (rtx dest, rtx src, rtx offset, int style)
+{
+ rtx insn;
+
+ if (! TARGET_64BIT)
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_1 (dest, src, offset));
+ else if (x86_64_immediate_operand (offset, DImode))
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64 (dest, src, offset));
+ else
+ {
+ rtx r11;
+ /* r11 is used by indirect sibcall return as well, set before the
+ epilogue and used after the epilogue. ATM indirect sibcall
+ shouldn't be used together with huge frame sizes in one
+ function because of the frame_size check in sibcall.c. */
+ if (style == 0)
+ abort ();
+ r11 = gen_rtx_REG (DImode, FIRST_REX_INT_REG + 3 /* R11 */);
+ insn = emit_insn (gen_rtx_SET (DImode, r11, offset));
+ if (style < 0)
+ RTX_FRAME_RELATED_P (insn) = 1;
+ insn = emit_insn (gen_pro_epilogue_adjust_stack_rex64_2 (dest, src, r11,
+ offset));
+ }
+ if (style < 0)
+ RTX_FRAME_RELATED_P (insn) = 1;
+}
+
/* Expand the prologue into a bunch of separate insns. */
void
@@ -5106,12 +5154,8 @@ ix86_expand_prologue (void)
if (allocate == 0)
;
else if (! TARGET_STACK_PROBE || allocate < CHECK_STACK_LIMIT)
- {
- insn = emit_insn (gen_pro_epilogue_adjust_stack
- (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-allocate)));
- RTX_FRAME_RELATED_P (insn) = 1;
- }
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (-allocate), -1);
else
{
/* Only valid for Win32. */
@@ -5266,8 +5310,8 @@ ix86_expand_epilogue (int style)
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));
+ pro_epilogue_adjust_stack (stack_pointer_rtx, sa,
+ const0_rtx, style);
}
else
{
@@ -5278,19 +5322,19 @@ ix86_expand_epilogue (int style)
}
}
else if (!frame_pointer_needed)
- emit_insn (gen_pro_epilogue_adjust_stack
- (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (frame.to_allocate
- + frame.nregs * UNITS_PER_WORD)));
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (frame.to_allocate
+ + frame.nregs * UNITS_PER_WORD),
+ style);
/* If not an i386, mov & pop is faster than "leave". */
else if (TARGET_USE_LEAVE || optimize_size
|| !cfun->machine->use_fast_prologue_epilogue)
emit_insn (TARGET_64BIT ? gen_leave_rex64 () : gen_leave ());
else
{
- emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
- hard_frame_pointer_rtx,
- const0_rtx));
+ pro_epilogue_adjust_stack (stack_pointer_rtx,
+ hard_frame_pointer_rtx,
+ const0_rtx, style);
if (TARGET_64BIT)
emit_insn (gen_popdi1 (hard_frame_pointer_rtx));
else
@@ -5305,14 +5349,13 @@ ix86_expand_epilogue (int style)
{
if (!frame_pointer_needed)
abort ();
- emit_insn (gen_pro_epilogue_adjust_stack (stack_pointer_rtx,
- hard_frame_pointer_rtx,
- GEN_INT (offset)));
+ pro_epilogue_adjust_stack (stack_pointer_rtx,
+ hard_frame_pointer_rtx,
+ GEN_INT (offset), style);
}
else if (frame.to_allocate)
- emit_insn (gen_pro_epilogue_adjust_stack
- (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (frame.to_allocate)));
+ pro_epilogue_adjust_stack (stack_pointer_rtx, stack_pointer_rtx,
+ GEN_INT (frame.to_allocate), style);
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (ix86_save_reg (regno, false))
@@ -5351,7 +5394,7 @@ ix86_expand_epilogue (int style)
{
rtx ecx = gen_rtx_REG (SImode, 2);
- /* There are is no "pascal" calling convention in 64bit ABI. */
+ /* There is no "pascal" calling convention in 64bit ABI. */
if (TARGET_64BIT)
abort ();
@@ -5382,7 +5425,7 @@ ix86_output_function_epilogue (FILE *file ATTRIBUTE_UNUSED,
strictly valid, but still used for computing length of lea instruction. */
static int
-ix86_decompose_address (register rtx addr, struct ix86_address *out)
+ix86_decompose_address (rtx addr, struct ix86_address *out)
{
rtx base = NULL_RTX;
rtx index = NULL_RTX;
@@ -5744,7 +5787,7 @@ legitimate_pic_operand_p (rtx x)
in PIC mode. */
int
-legitimate_pic_address_disp_p (register rtx disp)
+legitimate_pic_address_disp_p (rtx disp)
{
bool saw_plus;
@@ -5858,7 +5901,7 @@ legitimate_pic_address_disp_p (register rtx disp)
be recognized. */
int
-legitimate_address_p (enum machine_mode mode, register rtx addr, int strict)
+legitimate_address_p (enum machine_mode mode, rtx addr, int strict)
{
struct ix86_address parts;
rtx base, index, disp;
@@ -6426,8 +6469,7 @@ legitimize_tls_address (rtx x, enum tls_model model, int for_mov)
See comments by legitimize_pic_address in i386.c for details. */
rtx
-legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED,
- enum machine_mode mode)
+legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED, enum machine_mode mode)
{
int changed = 0;
unsigned log;
@@ -6567,8 +6609,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED,
if (GET_CODE (XEXP (x, 0)) == REG)
{
- register rtx temp = gen_reg_rtx (Pmode);
- register rtx val = force_operand (XEXP (x, 1), temp);
+ rtx temp = gen_reg_rtx (Pmode);
+ rtx val = force_operand (XEXP (x, 1), temp);
if (val != temp)
emit_move_insn (temp, val);
@@ -6578,8 +6620,8 @@ legitimize_address (register rtx x, register rtx oldx ATTRIBUTE_UNUSED,
else if (GET_CODE (XEXP (x, 1)) == REG)
{
- register rtx temp = gen_reg_rtx (Pmode);
- register rtx val = force_operand (XEXP (x, 0), temp);
+ rtx temp = gen_reg_rtx (Pmode);
+ rtx val = force_operand (XEXP (x, 0), temp);
if (val != temp)
emit_move_insn (temp, val);
@@ -6937,11 +6979,14 @@ put_condition_code (enum rtx_code code, enum machine_mode mode, int reverse,
void
print_reg (rtx x, int code, FILE *file)
{
- if ((REGNO (x) == ARG_POINTER_REGNUM
- || REGNO (x) == FRAME_POINTER_REGNUM
- || REGNO (x) == FLAGS_REG
- || REGNO (x) == FPSR_REG)
- && file == asm_out_file)
+ /* Code -1 indicates we are called from print_rtx, and it is not
+ an error for a virtual register to appear here. */
+ if (code == -1)
+ code = 0;
+ else if (REGNO (x) == ARG_POINTER_REGNUM
+ || REGNO (x) == FRAME_POINTER_REGNUM
+ || REGNO (x) == FLAGS_REG
+ || REGNO (x) == FPSR_REG)
abort ();
if (ASSEMBLER_DIALECT == ASM_ATT || USER_LABEL_PREFIX[0] == 0)
@@ -7008,12 +7053,17 @@ print_reg (rtx x, int code, FILE *file)
/* FALLTHRU */
case 16:
case 2:
+ normal:
fputs (hi_reg_name[REGNO (x)], file);
break;
case 1:
+ if (REGNO (x) >= ARRAY_SIZE (qi_reg_name))
+ goto normal;
fputs (qi_reg_name[REGNO (x)], file);
break;
case 0:
+ if (REGNO (x) >= ARRAY_SIZE (qi_high_reg_name))
+ goto normal;
fputs (qi_high_reg_name[REGNO (x)], file);
break;
default:
@@ -7402,7 +7452,7 @@ print_operand (FILE *file, rtx x, int code)
if (ASSEMBLER_DIALECT == ASM_ATT)
putc ('$', file);
- fprintf (file, "0x%lx", l);
+ fprintf (file, "0x%08lx", l);
}
/* These float cases don't actually occur as immediate operands. */
@@ -7415,7 +7465,7 @@ print_operand (FILE *file, rtx x, int code)
}
else if (GET_CODE (x) == CONST_DOUBLE
- && (GET_MODE (x) == XFmode || GET_MODE (x) == TFmode))
+ && GET_MODE (x) == XFmode)
{
char dstr[30];
@@ -7453,7 +7503,7 @@ print_operand (FILE *file, rtx x, int code)
/* Print a memory operand whose address is ADDR. */
void
-print_operand_address (FILE *file, register rtx addr)
+print_operand_address (FILE *file, rtx addr)
{
struct ix86_address parts;
rtx base, index, disp;
@@ -8655,7 +8705,6 @@ ix86_prepare_fp_compare_args (enum rtx_code code, rtx *pop0, rtx *pop1)
if (!is_sse
&& (fpcmp_mode == CCFPUmode
|| op_mode == XFmode
- || op_mode == TFmode
|| ix86_use_fcomi_compare (code)))
{
op0 = force_reg (op_mode, op0);
@@ -9130,7 +9179,6 @@ ix86_expand_branch (enum rtx_code code, rtx label)
case SFmode:
case DFmode:
case XFmode:
- case TFmode:
{
rtvec vec;
int use_fcomi;
@@ -9423,9 +9471,9 @@ ix86_expand_setcc (enum rtx_code code, rtx dest)
return 1; /* DONE */
}
-/* Expand comparison setting or clearing carry flag. Return true when successful
- and set pop for the operation. */
-bool
+/* Expand comparison setting or clearing carry flag. Return true when
+ successful and set pop for the operation. */
+static bool
ix86_expand_carry_flag_compare (enum rtx_code code, rtx op0, rtx op1, rtx *pop)
{
enum machine_mode mode =
@@ -10321,7 +10369,7 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode)
int size;
if (!TARGET_64BIT)
- size = mode == TFmode ? 3 : (GET_MODE_SIZE (mode) / 4);
+ size = mode==XFmode ? 3 : GET_MODE_SIZE (mode) / 4;
else
size = (GET_MODE_SIZE (mode) + 4) / 8;
@@ -10381,7 +10429,6 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode)
switch (mode)
{
case XFmode:
- case TFmode:
REAL_VALUE_TO_TARGET_LONG_DOUBLE (r, l);
parts[2] = gen_int_mode (l[2], SImode);
break;
@@ -10404,18 +10451,19 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode)
split_ti (&operand, 1, &parts[0], &parts[1]);
if (mode == XFmode || mode == TFmode)
{
+ enum machine_mode upper_mode = mode==XFmode ? SImode : DImode;
if (REG_P (operand))
{
if (!reload_completed)
abort ();
parts[0] = gen_rtx_REG (DImode, REGNO (operand) + 0);
- parts[1] = gen_rtx_REG (SImode, REGNO (operand) + 1);
+ parts[1] = gen_rtx_REG (upper_mode, REGNO (operand) + 1);
}
else if (offsettable_memref_p (operand))
{
operand = adjust_address (operand, DImode, 0);
parts[0] = operand;
- parts[1] = adjust_address (operand, SImode, 8);
+ parts[1] = adjust_address (operand, upper_mode, 8);
}
else if (GET_CODE (operand) == CONST_DOUBLE)
{
@@ -10433,7 +10481,16 @@ ix86_split_to_parts (rtx operand, rtx *parts, enum machine_mode mode)
DImode);
else
parts[0] = immed_double_const (l[0], l[1], DImode);
- parts[1] = gen_int_mode (l[2], SImode);
+ if (upper_mode == SImode)
+ parts[1] = gen_int_mode (l[2], SImode);
+ else if (HOST_BITS_PER_WIDE_INT >= 64)
+ parts[1]
+ = gen_int_mode
+ ((l[2] & (((HOST_WIDE_INT) 2 << 31) - 1))
+ + ((((HOST_WIDE_INT) l[3]) << 31) << 1),
+ DImode);
+ else
+ parts[1] = immed_double_const (l[2], l[3], DImode);
}
else
abort ();
@@ -10554,12 +10611,8 @@ ix86_split_long_move (rtx operands[])
{
if (nparts == 3)
{
- /* We use only first 12 bytes of TFmode value, but for pushing we
- are required to adjust stack as if we were pushing real 16byte
- value. */
- if (mode == TFmode && !TARGET_64BIT)
- emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
- GEN_INT (-4)));
+ if (TARGET_128BIT_LONG_DOUBLE && mode == XFmode)
+ emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx, GEN_INT (-4)));
emit_move_insn (part[0][2], part[1][2]);
}
}
@@ -11556,7 +11609,8 @@ ix86_expand_strlensi_unroll_1 (rtx out, rtx align_rtx)
}
void
-ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx callarg2,
+ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1,
+ rtx callarg2 ATTRIBUTE_UNUSED,
rtx pop, int sibcall)
{
rtx use = NULL, call;
@@ -11594,7 +11648,7 @@ ix86_expand_call (rtx retval, rtx fnaddr, rtx callarg1, rtx callarg2,
{
rtx addr;
addr = copy_to_mode_reg (Pmode, XEXP (fnaddr, 0));
- fnaddr = gen_rtx_REG (Pmode, 40);
+ fnaddr = gen_rtx_REG (Pmode, FIRST_REX_INT_REG + 3 /* R11 */);
emit_move_insn (fnaddr, addr);
fnaddr = gen_rtx_MEM (QImode, fnaddr);
}
@@ -13270,6 +13324,27 @@ ix86_init_mmx_sse_builtins (void)
tree v2di_ftype_v2di
= build_function_type_list (V2DI_type_node, V2DI_type_node, NULL_TREE);
+ tree float80_type;
+ tree float128_type;
+
+ /* The __float80 type. */
+ if (TYPE_MODE (long_double_type_node) == XFmode)
+ (*lang_hooks.types.register_builtin_type) (long_double_type_node,
+ "__float80");
+ else
+ {
+ /* The __float80 type. */
+ float80_type = make_node (REAL_TYPE);
+ TYPE_PRECISION (float80_type) = 96;
+ layout_type (float80_type);
+ (*lang_hooks.types.register_builtin_type) (float80_type, "__float80");
+ }
+
+ float128_type = make_node (REAL_TYPE);
+ TYPE_PRECISION (float128_type) = 128;
+ layout_type (float128_type);
+ (*lang_hooks.types.register_builtin_type) (float128_type, "__float128");
+
/* Add all builtins that are more or less simple operations on two
operands. */
for (i = 0, d = bdesc_2arg; i < ARRAY_SIZE (bdesc_2arg); i++, d++)
@@ -14710,7 +14785,6 @@ ix86_memory_move_cost (enum machine_mode mode, enum reg_class class, int in)
index = 1;
break;
case XFmode:
- case TFmode:
index = 2;
break;
default:
@@ -15384,7 +15458,7 @@ x86_output_mi_thunk (FILE *file ATTRIBUTE_UNUSED,
#if TARGET_MACHO
if (TARGET_MACHO)
{
- char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
+ const char *ip = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function));
tmp = gen_rtx_SYMBOL_REF (Pmode, machopic_stub_name (ip));
tmp = gen_rtx_MEM (QImode, tmp);
xops[0] = tmp;
@@ -15595,7 +15669,7 @@ ix86_reorg (void)
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
{
basic_block bb = e->src;
- rtx ret = bb->end;
+ rtx ret = BB_END (bb);
rtx prev;
bool replace = false;
diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h
index 53f9bcba6b2..08424a4caac 100644
--- a/gcc/config/i386/i386.h
+++ b/gcc/config/i386/i386.h
@@ -546,12 +546,11 @@ extern int x86_prefetch_sse;
if (TARGET_64BIT) \
{ \
builtin_assert ("cpu=x86_64"); \
+ builtin_assert ("machine=x86_64"); \
builtin_define ("__amd64"); \
builtin_define ("__amd64__"); \
builtin_define ("__x86_64"); \
builtin_define ("__x86_64__"); \
- builtin_define ("__amd64"); \
- builtin_define ("__amd64__"); \
} \
else \
{ \
@@ -721,16 +720,7 @@ extern int x86_prefetch_sse;
/* target machine storage layout */
-/* Define for XFmode or TFmode extended real floating point support.
- The XFmode is specified by i386 ABI, while TFmode may be faster
- due to alignment and simplifications in the address calculations. */
-#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
-#define MAX_LONG_DOUBLE_TYPE_SIZE 128
-#ifdef __x86_64__
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
-#else
-#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
-#endif
+#define LONG_DOUBLE_TYPE_SIZE 96
/* Set the value of FLT_EVAL_METHOD in float.h. When using only the
FPU, assume that the fpcw is set to extended precision; when using
@@ -900,8 +890,7 @@ extern int x86_prefetch_sse;
#define STACK_REGS
#define IS_STACK_MODE(MODE) \
- ((MODE) == DFmode || (MODE) == SFmode || (MODE) == XFmode \
- || (MODE) == TFmode)
+ ((MODE) == DFmode || (MODE) == SFmode || (MODE) == XFmode) \
/* Number of actual hardware registers.
The hardware registers are assigned numbers for the compiler
@@ -1049,9 +1038,9 @@ do { \
#define HARD_REGNO_NREGS(REGNO, MODE) \
(FP_REGNO_P (REGNO) || SSE_REGNO_P (REGNO) || MMX_REGNO_P (REGNO) \
? (COMPLEX_MODE_P (MODE) ? 2 : 1) \
- : ((MODE) == TFmode \
+ : ((MODE) == XFmode \
? (TARGET_64BIT ? 2 : 3) \
- : (MODE) == TCmode \
+ : (MODE) == XCmode \
? (TARGET_64BIT ? 4 : 6) \
: ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)))
@@ -1061,7 +1050,7 @@ do { \
#define VALID_SSE_REG_MODE(MODE) \
((MODE) == TImode || (MODE) == V4SFmode || (MODE) == V4SImode \
- || (MODE) == SFmode \
+ || (MODE) == SFmode || (MODE) == TFmode \
/* Always accept SSE2 modes so that xmmintrin.h compiles. */ \
|| VALID_SSE2_REG_MODE (MODE) \
|| (TARGET_SSE2 && ((MODE) == DFmode || VALID_MMX_REG_MODE (MODE))))
@@ -1079,21 +1068,20 @@ do { \
: VALID_MMX_REG_MODE_3DNOW (MODE) && TARGET_3DNOW ? 1 : 0)
#define VALID_FP_MODE_P(MODE) \
- ((MODE) == SFmode || (MODE) == DFmode || (MODE) == TFmode \
- || (!TARGET_64BIT && (MODE) == XFmode) \
- || (MODE) == SCmode || (MODE) == DCmode || (MODE) == TCmode \
- || (!TARGET_64BIT && (MODE) == XCmode))
+ ((MODE) == SFmode || (MODE) == DFmode || (MODE) == XFmode \
+ || (MODE) == SCmode || (MODE) == DCmode || (MODE) == XCmode) \
#define VALID_INT_MODE_P(MODE) \
((MODE) == QImode || (MODE) == HImode || (MODE) == SImode \
|| (MODE) == DImode \
|| (MODE) == CQImode || (MODE) == CHImode || (MODE) == CSImode \
|| (MODE) == CDImode \
- || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode)))
+ || (TARGET_64BIT && ((MODE) == TImode || (MODE) == CTImode \
+ || (MODE) == TFmode || (MODE) == TCmode)))
/* Return true for modes passed in SSE registers. */
#define SSE_REG_MODE_P(MODE) \
- ((MODE) == TImode || (MODE) == V16QImode \
+ ((MODE) == TImode || (MODE) == V16QImode || (MODE) == TFmode \
|| (MODE) == V8HImode || (MODE) == V2DFmode || (MODE) == V2DImode \
|| (MODE) == V4SFmode || (MODE) == V4SImode)
@@ -1438,11 +1426,6 @@ enum reg_class
#define CC_REG_P(X) (REG_P (X) && CC_REGNO_P (REGNO (X)))
#define CC_REGNO_P(X) ((X) == FLAGS_REG || (X) == FPSR_REG)
-/* Indicate whether hard register numbered REG_NO should be converted
- to SSA form. */
-#define CONVERT_HARD_REGISTER_TO_SSA_P(REG_NO) \
- ((REG_NO) == FLAGS_REG || (REG_NO) == ARG_POINTER_REGNUM)
-
/* The class value for index registers, and the one for base regs. */
#define INDEX_REG_CLASS INDEX_REGS
@@ -1568,15 +1551,12 @@ enum reg_class
/* Return the maximum number of consecutive registers
needed to represent mode MODE in a register of class CLASS. */
/* On the 80386, this is the size of MODE in words,
- except in the FP regs, where a single reg is always enough.
- The TFmodes are really just 80bit values, so we use only 3 registers
- to hold them, instead of 4, as the size would suggest.
- */
+ except in the FP regs, where a single reg is always enough. */
#define CLASS_MAX_NREGS(CLASS, MODE) \
(!MAYBE_INTEGER_CLASS_P (CLASS) \
? (COMPLEX_MODE_P (MODE) ? 2 : 1) \
- : ((GET_MODE_SIZE ((MODE) == TFmode ? XFmode : (MODE)) \
- + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
+ : (((((MODE) == XFmode ? 12 : GET_MODE_SIZE (MODE))) \
+ + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
/* A C expression whose value is nonzero if pseudos that have been
assigned to registers of class CLASS would likely be spilled
@@ -1601,7 +1581,9 @@ enum reg_class
|| ((CLASS) == BREG) \
|| ((CLASS) == AD_REGS) \
|| ((CLASS) == SIREG) \
- || ((CLASS) == DIREG))
+ || ((CLASS) == DIREG) \
+ || ((CLASS) == FP_TOP_REG) \
+ || ((CLASS) == FP_SECOND_REG))
/* Return a class of registers that cannot change FROM mode to TO mode.
@@ -1828,10 +1810,6 @@ typedef struct ix86_args {
ix86_setup_incoming_varargs (&(CUM), (MODE), (TYPE), &(PRETEND_SIZE), \
(NO_RTL))
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- ((VALIST) = ix86_build_va_list ())
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(VALIST, NEXTARG) \
ix86_va_start (VALIST, NEXTARG)
@@ -2900,7 +2878,8 @@ do { \
If CODE is 'k', pretend the mode is SImode.
If CODE is 'q', pretend the mode is DImode.
If CODE is 'h', pretend the reg is the `high' byte register.
- If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op. */
+ If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
+ If CODE is -1, it is not an error for X to be a virtual register. */
#define PRINT_REG(X, CODE, FILE) \
print_reg ((X), (CODE), (FILE))
@@ -2917,70 +2896,6 @@ do { \
goto FAIL; \
} while (0);
-/* Print the name of a register for based on its machine mode and number.
- This macro is used to print debugging output.
- This macro is different from PRINT_REG in that it may be used in
- programs that are not linked with aux-output.o. */
-
-#define DEBUG_PRINT_REG(X, CODE, FILE) \
- do { static const char * const hi_name[] = HI_REGISTER_NAMES; \
- static const char * const qi_name[] = QI_REGISTER_NAMES; \
- fprintf ((FILE), "%d ", REGNO (X)); \
- if (REGNO (X) == FLAGS_REG) \
- { fputs ("flags", (FILE)); break; } \
- if (REGNO (X) == DIRFLAG_REG) \
- { fputs ("dirflag", (FILE)); break; } \
- if (REGNO (X) == FPSR_REG) \
- { fputs ("fpsr", (FILE)); break; } \
- if (REGNO (X) == ARG_POINTER_REGNUM) \
- { fputs ("argp", (FILE)); break; } \
- if (REGNO (X) == FRAME_POINTER_REGNUM) \
- { fputs ("frame", (FILE)); break; } \
- if (STACK_TOP_P (X)) \
- { fputs ("st(0)", (FILE)); break; } \
- if (FP_REG_P (X)) \
- { fputs (hi_name[REGNO(X)], (FILE)); break; } \
- if (REX_INT_REG_P (X)) \
- { \
- switch (GET_MODE_SIZE (GET_MODE (X))) \
- { \
- default: \
- case 8: \
- fprintf ((FILE), "r%i", REGNO (X) \
- - FIRST_REX_INT_REG + 8); \
- break; \
- case 4: \
- fprintf ((FILE), "r%id", REGNO (X) \
- - FIRST_REX_INT_REG + 8); \
- break; \
- case 2: \
- fprintf ((FILE), "r%iw", REGNO (X) \
- - FIRST_REX_INT_REG + 8); \
- break; \
- case 1: \
- fprintf ((FILE), "r%ib", REGNO (X) \
- - FIRST_REX_INT_REG + 8); \
- break; \
- } \
- break; \
- } \
- switch (GET_MODE_SIZE (GET_MODE (X))) \
- { \
- case 8: \
- fputs ("r", (FILE)); \
- fputs (hi_name[REGNO (X)], (FILE)); \
- break; \
- default: \
- fputs ("e", (FILE)); \
- case 2: \
- fputs (hi_name[REGNO (X)], (FILE)); \
- break; \
- case 1: \
- fputs (qi_name[REGNO (X)], (FILE)); \
- break; \
- } \
- } while (0)
-
/* a letter which is not needed by the normal asm syntax, which
we can use for operand syntax in the extended asm */
diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index 835480d3a47..8b32c5e014c 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -716,17 +716,6 @@
[(set (reg:CC 17)
(compare:CC (match_operand:XF 0 "cmp_fp_expander_operand" "")
(match_operand:XF 1 "cmp_fp_expander_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
-{
- ix86_compare_op0 = operands[0];
- ix86_compare_op1 = operands[1];
- DONE;
-})
-
-(define_expand "cmptf"
- [(set (reg:CC 17)
- (compare:CC (match_operand:TF 0 "cmp_fp_expander_operand" "")
- (match_operand:TF 1 "cmp_fp_expander_operand" "")))]
"TARGET_80387"
{
ix86_compare_op0 = operands[0];
@@ -850,16 +839,6 @@
(compare:CCFP
(match_operand:XF 0 "register_operand" "f")
(match_operand:XF 1 "register_operand" "f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "* return output_fp_compare (insn, operands, 0, 0);"
- [(set_attr "type" "fcmp")
- (set_attr "mode" "XF")])
-
-(define_insn "*cmpfp_2_tf"
- [(set (reg:CCFP 18)
- (compare:CCFP
- (match_operand:TF 0 "register_operand" "f")
- (match_operand:TF 1 "register_operand" "f")))]
"TARGET_80387"
"* return output_fp_compare (insn, operands, 0, 0);"
[(set_attr "type" "fcmp")
@@ -872,18 +851,6 @@
(match_operand:XF 1 "register_operand" "f")
(match_operand:XF 2 "register_operand" "f"))]
UNSPEC_FNSTSW))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "* return output_fp_compare (insn, operands, 2, 0);"
- [(set_attr "type" "multi")
- (set_attr "mode" "XF")])
-
-(define_insn "*cmpfp_2_tf_1"
- [(set (match_operand:HI 0 "register_operand" "=a")
- (unspec:HI
- [(compare:CCFP
- (match_operand:TF 1 "register_operand" "f")
- (match_operand:TF 2 "register_operand" "f"))]
- UNSPEC_FNSTSW))]
"TARGET_80387"
"* return output_fp_compare (insn, operands, 2, 0);"
[(set_attr "type" "multi")
@@ -2166,7 +2133,7 @@
return "push{l}\t%1";
default:
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
}
@@ -2184,7 +2151,7 @@
return "push{q}\t%q1";
default:
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
}
@@ -2442,7 +2409,7 @@
(match_operand:DF 1 "general_no_elim_operand" "f#Y,Fo#fY,*r#fY,Y#f"))]
"!TARGET_64BIT && !TARGET_INTEGER_DFMODE_MOVES"
{
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
[(set_attr "type" "multi")
@@ -2453,7 +2420,7 @@
(match_operand:DF 1 "general_no_elim_operand" "f#rY,rFo#fY,Y#rf"))]
"TARGET_64BIT || TARGET_INTEGER_DFMODE_MOVES"
{
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
[(set_attr "type" "multi")
@@ -2744,14 +2711,8 @@
(define_expand "movxf"
[(set (match_operand:XF 0 "nonimmediate_operand" "")
(match_operand:XF 1 "general_operand" ""))]
- "!TARGET_128BIT_LONG_DOUBLE"
- "ix86_expand_move (XFmode, operands); DONE;")
-
-(define_expand "movtf"
- [(set (match_operand:TF 0 "nonimmediate_operand" "")
- (match_operand:TF 1 "general_operand" ""))]
""
- "ix86_expand_move (TFmode, operands); DONE;")
+ "ix86_expand_move (XFmode, operands); DONE;")
;; Size of pushdf is 3 (for sub) + 2 (for fstp) + memory operand size.
;; Size of pushdf using integer instructions is 3+3*memory operand size
@@ -2763,20 +2724,9 @@
(define_insn "*pushxf_nointeger"
[(set (match_operand:XF 0 "push_operand" "=X,X,X")
(match_operand:XF 1 "general_no_elim_operand" "f,Fo,*r"))]
- "!TARGET_128BIT_LONG_DOUBLE && optimize_size"
-{
- /* This insn should be already splitted before reg-stack. */
- abort ();
-}
- [(set_attr "type" "multi")
- (set_attr "mode" "XF,SI,SI")])
-
-(define_insn "*pushtf_nointeger"
- [(set (match_operand:TF 0 "push_operand" "=<,<,<")
- (match_operand:TF 1 "general_no_elim_operand" "f,Fo,*r"))]
"optimize_size"
{
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
[(set_attr "type" "multi")
@@ -2785,20 +2735,9 @@
(define_insn "*pushxf_integer"
[(set (match_operand:XF 0 "push_operand" "=<,<")
(match_operand:XF 1 "general_no_elim_operand" "f#r,ro#f"))]
- "!TARGET_128BIT_LONG_DOUBLE && !optimize_size"
-{
- /* This insn should be already splitted before reg-stack. */
- abort ();
-}
- [(set_attr "type" "multi")
- (set_attr "mode" "XF,SI")])
-
-(define_insn "*pushtf_integer"
- [(set (match_operand:TF 0 "push_operand" "=<,<")
- (match_operand:TF 1 "general_no_elim_operand" "f#r,rFo#f"))]
"!optimize_size"
{
- /* This insn should be already splitted before reg-stack. */
+ /* This insn should be already split before reg-stack. */
abort ();
}
[(set_attr "type" "multi")
@@ -2809,7 +2748,6 @@
(match_operand 1 "general_operand" ""))]
"reload_completed
&& (GET_MODE (operands[0]) == XFmode
- || GET_MODE (operands[0]) == TFmode
|| GET_MODE (operands[0]) == DFmode)
&& !ANY_FP_REG_P (operands[1])"
[(const_int 0)]
@@ -2818,30 +2756,24 @@
(define_split
[(set (match_operand:XF 0 "push_operand" "")
(match_operand:XF 1 "any_fp_register_operand" ""))]
- "!TARGET_128BIT_LONG_DOUBLE"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12)))
- (set (mem:XF (reg:SI 7)) (match_dup 1))])
-
-(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (match_operand:TF 1 "any_fp_register_operand" ""))]
"!TARGET_64BIT"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16)))
- (set (mem:TF (reg:SI 7)) (match_dup 1))])
+ [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2)))
+ (set (mem:XF (reg:SI 7)) (match_dup 1))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (match_operand:TF 1 "any_fp_register_operand" ""))]
+ [(set (match_operand:XF 0 "push_operand" "")
+ (match_operand:XF 1 "any_fp_register_operand" ""))]
"TARGET_64BIT"
- [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16)))
- (set (mem:TF (reg:DI 7)) (match_dup 1))])
+ [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2)))
+ (set (mem:XF (reg:DI 7)) (match_dup 1))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
;; Do not use integer registers when optimizing for size
(define_insn "*movxf_nointeger"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m,f,*r,o")
(match_operand:XF 1 "general_operand" "fm,f,G,*roF,F*r"))]
- "!TARGET_128BIT_LONG_DOUBLE
- && optimize_size
+ "optimize_size
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
&& (reload_in_progress || reload_completed
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2882,56 +2814,10 @@
[(set_attr "type" "fmov,fmov,fmov,multi,multi")
(set_attr "mode" "XF,XF,XF,SI,SI")])
-(define_insn "*movtf_nointeger"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m,f,*r,o")
- (match_operand:TF 1 "general_operand" "fm,f,G,*roF,F*r"))]
- "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && optimize_size
- && (reload_in_progress || reload_completed
- || GET_CODE (operands[1]) != CONST_DOUBLE
- || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || memory_operand (operands[0], TFmode))"
-{
- switch (which_alternative)
- {
- case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
-
- case 1:
- /* There is no non-popping store to memory for XFmode. So if
- we need one, follow the store with a load. */
- if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0\;fld%z0\t%y0";
- else
- return "fstp%z0\t%y0";
-
- case 2:
- return standard_80387_constant_opcode (operands[1]);
-
- case 3: case 4:
- return "#";
- }
- abort();
-}
- [(set_attr "type" "fmov,fmov,fmov,multi,multi")
- (set_attr "mode" "XF,XF,XF,SI,SI")])
-
(define_insn "*movxf_integer"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,m,f#r,r#f,o")
(match_operand:XF 1 "general_operand" "fm#r,f#r,G,roF#f,Fr#f"))]
- "!TARGET_128BIT_LONG_DOUBLE
- && !optimize_size
+ "!optimize_size
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
&& (reload_in_progress || reload_completed
|| GET_CODE (operands[1]) != CONST_DOUBLE
@@ -2972,57 +2858,12 @@
[(set_attr "type" "fmov,fmov,fmov,multi,multi")
(set_attr "mode" "XF,XF,XF,SI,SI")])
-(define_insn "*movtf_integer"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,m,f#r,r#f,o")
- (match_operand:TF 1 "general_operand" "fm#r,f#r,G,roF#f,Fr#f"))]
- "(GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && !optimize_size
- && (reload_in_progress || reload_completed
- || GET_CODE (operands[1]) != CONST_DOUBLE
- || (ix86_cmodel == CM_MEDIUM || ix86_cmodel == CM_LARGE)
- || memory_operand (operands[0], TFmode))"
-{
- switch (which_alternative)
- {
- case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- {
- if (REGNO (operands[0]) == FIRST_STACK_REG
- && TARGET_USE_FFREEP)
- return "ffreep\t%y0";
- return "fstp\t%y0";
- }
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
-
- case 1:
- /* There is no non-popping store to memory for XFmode. So if
- we need one, follow the store with a load. */
- if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0\;fld%z0\t%y0";
- else
- return "fstp%z0\t%y0";
-
- case 2:
- return standard_80387_constant_opcode (operands[1]);
-
- case 3: case 4:
- return "#";
- }
- abort();
-}
- [(set_attr "type" "fmov,fmov,fmov,multi,multi")
- (set_attr "mode" "XF,XF,XF,SI,SI")])
-
(define_split
[(set (match_operand 0 "nonimmediate_operand" "")
(match_operand 1 "general_operand" ""))]
"reload_completed
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)
- && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode)
+ && GET_MODE (operands[0]) == XFmode
&& ! (ANY_FP_REG_P (operands[0]) ||
(GET_CODE (operands[0]) == SUBREG
&& ANY_FP_REG_P (SUBREG_REG (operands[0]))))
@@ -3037,7 +2878,7 @@
(match_operand 1 "memory_operand" ""))]
"reload_completed
&& GET_CODE (operands[1]) == MEM
- && (GET_MODE (operands[0]) == XFmode || GET_MODE (operands[0]) == TFmode
+ && (GET_MODE (operands[0]) == XFmode
|| GET_MODE (operands[0]) == SFmode || GET_MODE (operands[0]) == DFmode)
&& GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF
&& CONSTANT_POOL_ADDRESS_P (XEXP (operands[1], 0))
@@ -3067,21 +2908,6 @@
}
[(set_attr "type" "fxch")
(set_attr "mode" "XF")])
-
-(define_insn "swaptf"
- [(set (match_operand:TF 0 "register_operand" "+f")
- (match_operand:TF 1 "register_operand" "+f"))
- (set (match_dup 1)
- (match_dup 0))]
- ""
-{
- if (STACK_TOP_P (operands[0]))
- return "fxch\t%1";
- else
- return "fxch\t%0";
-}
- [(set_attr "type" "fxch")
- (set_attr "mode" "XF")])
;; Zero extension instructions
@@ -3632,62 +3458,34 @@
(define_split
[(set (match_operand:XF 0 "push_operand" "")
(float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12)))
- (set (mem:XF (reg:SI 7)) (float_extend:XF (match_dup 1)))])
-
-(define_insn "*dummy_extendsftf2"
- [(set (match_operand:TF 0 "push_operand" "=<")
- (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "f")))]
- "0"
- "#")
-
-(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (float_extend:TF (match_operand:SF 1 "fp_register_operand" "")))]
- "!TARGET_64BIT"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16)))
- (set (mem:TF (reg:SI 7)) (float_extend:TF (match_dup 1)))])
+ ""
+ [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2)))
+ (set (mem:XF (reg:SI 7)) (float_extend:XF (match_dup 1)))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (float_extend:TF (match_operand:SF 1 "fp_register_operand" "")))]
+ [(set (match_operand:XF 0 "push_operand" "")
+ (float_extend:XF (match_operand:SF 1 "fp_register_operand" "")))]
"TARGET_64BIT"
- [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16)))
- (set (mem:DF (reg:DI 7)) (float_extend:TF (match_dup 1)))])
-
-(define_insn "*dummy_extenddfxf2"
- [(set (match_operand:XF 0 "push_operand" "=<")
- (float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "f")))]
- "0"
- "#")
+ [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2)))
+ (set (mem:DF (reg:DI 7)) (float_extend:XF (match_dup 1)))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
(define_split
[(set (match_operand:XF 0 "push_operand" "")
(float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -12)))
- (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))])
-
-(define_insn "*dummy_extenddftf2"
- [(set (match_operand:TF 0 "push_operand" "=<")
- (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "f")))]
- "0"
- "#")
-
-(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (float_extend:TF (match_operand:DF 1 "fp_register_operand" "")))]
- "!TARGET_64BIT"
- [(set (reg:SI 7) (plus:SI (reg:SI 7) (const_int -16)))
- (set (mem:TF (reg:SI 7)) (float_extend:XF (match_dup 1)))])
+ ""
+ [(set (reg:SI 7) (plus:SI (reg:SI 7) (match_dup 2)))
+ (set (mem:DF (reg:SI 7)) (float_extend:XF (match_dup 1)))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
(define_split
- [(set (match_operand:TF 0 "push_operand" "")
- (float_extend:TF (match_operand:DF 1 "fp_register_operand" "")))]
+ [(set (match_operand:XF 0 "push_operand" "")
+ (float_extend:XF (match_operand:DF 1 "fp_register_operand" "")))]
"TARGET_64BIT"
- [(set (reg:DI 7) (plus:DI (reg:DI 7) (const_int -16)))
- (set (mem:TF (reg:DI 7)) (float_extend:TF (match_dup 1)))])
+ [(set (reg:DI 7) (plus:DI (reg:DI 7) (match_dup 2)))
+ (set (mem:XF (reg:DI 7)) (float_extend:XF (match_dup 1)))]
+ "operands[2] = GEN_INT (TARGET_128BIT_LONG_DOUBLE ? -16 : -12);")
(define_expand "extendsfdf2"
[(set (match_operand:DF 0 "nonimmediate_operand" "")
@@ -3747,7 +3545,7 @@
(define_expand "extendsfxf2"
[(set (match_operand:XF 0 "nonimmediate_operand" "")
(float_extend:XF (match_operand:SF 1 "general_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
/* ??? Needed for compress_float_constant since all fp constants
are LEGITIMATE_CONSTANT_P. */
@@ -3760,51 +3558,6 @@
(define_insn "*extendsfxf2_1"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m")
(float_extend:XF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
- && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
-{
- switch (which_alternative)
- {
- case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
-
- case 1:
- /* There is no non-popping store to memory for XFmode. So if
- we need one, follow the store with a load. */
- if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0\n\tfld%z0\t%y0";
- else
- return "fstp%z0\t%y0";
-
- default:
- abort ();
- }
-}
- [(set_attr "type" "fmov")
- (set_attr "mode" "SF,XF")])
-
-(define_expand "extendsftf2"
- [(set (match_operand:TF 0 "nonimmediate_operand" "")
- (float_extend:TF (match_operand:SF 1 "general_operand" "")))]
- "TARGET_80387"
-{
- /* ??? Needed for compress_float_constant since all fp constants
- are LEGITIMATE_CONSTANT_P. */
- if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = validize_mem (force_const_mem (SFmode, operands[1]));
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
- operands[1] = force_reg (SFmode, operands[1]);
-})
-
-(define_insn "*extendsftf2_1"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m")
- (float_extend:TF (match_operand:SF 1 "nonimmediate_operand" "fm,f")))]
"TARGET_80387
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
{
@@ -3837,7 +3590,7 @@
(define_expand "extenddfxf2"
[(set (match_operand:XF 0 "nonimmediate_operand" "")
(float_extend:XF (match_operand:DF 1 "general_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
/* ??? Needed for compress_float_constant since all fp constants
are LEGITIMATE_CONSTANT_P. */
@@ -3850,51 +3603,6 @@
(define_insn "*extenddfxf2_1"
[(set (match_operand:XF 0 "nonimmediate_operand" "=f,m")
(float_extend:XF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
- && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
-{
- switch (which_alternative)
- {
- case 0:
- if (REG_P (operands[1])
- && find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp\t%y0";
- else if (STACK_TOP_P (operands[0]))
- return "fld%z1\t%y1";
- else
- return "fst\t%y0";
-
- case 1:
- /* There is no non-popping store to memory for XFmode. So if
- we need one, follow the store with a load. */
- if (! find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0\n\tfld%z0\t%y0";
- else
- return "fstp%z0\t%y0";
-
- default:
- abort ();
- }
-}
- [(set_attr "type" "fmov")
- (set_attr "mode" "DF,XF")])
-
-(define_expand "extenddftf2"
- [(set (match_operand:TF 0 "nonimmediate_operand" "")
- (float_extend:TF (match_operand:DF 1 "general_operand" "")))]
- "TARGET_80387"
-{
- /* ??? Needed for compress_float_constant since all fp constants
- are LEGITIMATE_CONSTANT_P. */
- if (GET_CODE (operands[1]) == CONST_DOUBLE)
- operands[1] = validize_mem (force_const_mem (DFmode, operands[1]));
- if (GET_CODE (operands[0]) == MEM && GET_CODE (operands[1]) == MEM)
- operands[1] = force_reg (DFmode, operands[1]);
-})
-
-(define_insn "*extenddftf2_1"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f,m")
- (float_extend:TF (match_operand:DF 1 "nonimmediate_operand" "fm,f")))]
"TARGET_80387
&& (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
{
@@ -4169,7 +3877,7 @@
(float_truncate:SF
(match_operand:XF 1 "register_operand" "")))
(clobber (match_dup 2))])]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"operands[2] = assign_386_stack_local (SFmode, 0);")
(define_insn "*truncxfsf2_1"
@@ -4177,7 +3885,7 @@
(float_truncate:SF
(match_operand:XF 1 "register_operand" "f,f,f,f")))
(clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
switch (which_alternative)
{
@@ -4197,7 +3905,7 @@
[(set (match_operand:SF 0 "memory_operand" "=m")
(float_truncate:SF
(match_operand:XF 1 "register_operand" "f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
return "fstp%z0\t%y0";
@@ -4226,75 +3934,12 @@
(set (match_dup 0) (match_dup 2))]
"")
-(define_expand "trunctfsf2"
- [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "")
- (float_truncate:SF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_dup 2))])]
- "TARGET_80387"
- "operands[2] = assign_386_stack_local (SFmode, 0);")
-
-(define_insn "*trunctfsf2_1"
- [(set (match_operand:SF 0 "nonimmediate_operand" "=m,?f#rx,?r#fx,?x#rf")
- (float_truncate:SF
- (match_operand:TF 1 "register_operand" "f,f,f,f")))
- (clobber (match_operand:SF 2 "memory_operand" "=X,m,m,m"))]
- "TARGET_80387"
-{
- switch (which_alternative)
- {
- case 0:
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0";
- else
- return "fst%z0\t%y0";
- default:
- abort();
- }
-}
- [(set_attr "type" "fmov,multi,multi,multi")
- (set_attr "mode" "SF")])
-
-(define_insn "*trunctfsf2_2"
- [(set (match_operand:SF 0 "memory_operand" "=m")
- (float_truncate:SF
- (match_operand:TF 1 "register_operand" "f")))]
- "TARGET_80387"
-{
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0";
- else
- return "fst%z0\t%y0";
-}
- [(set_attr "type" "fmov")
- (set_attr "mode" "SF")])
-
-(define_split
- [(set (match_operand:SF 0 "memory_operand" "")
- (float_truncate:SF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_operand:SF 2 "memory_operand" ""))]
- "TARGET_80387"
- [(set (match_dup 0) (float_truncate:SF (match_dup 1)))]
- "")
-
-(define_split
- [(set (match_operand:SF 0 "register_operand" "")
- (float_truncate:SF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_operand:SF 2 "memory_operand" ""))]
- "TARGET_80387 && reload_completed"
- [(set (match_dup 2) (float_truncate:SF (match_dup 1)))
- (set (match_dup 0) (match_dup 2))]
- "")
-
-
(define_expand "truncxfdf2"
[(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "")
(float_truncate:DF
(match_operand:XF 1 "register_operand" "")))
(clobber (match_dup 2))])]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"operands[2] = assign_386_stack_local (DFmode, 0);")
(define_insn "*truncxfdf2_1"
@@ -4302,7 +3947,7 @@
(float_truncate:DF
(match_operand:XF 1 "register_operand" "f,f,f,f")))
(clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
switch (which_alternative)
{
@@ -4323,7 +3968,7 @@
[(set (match_operand:DF 0 "memory_operand" "=m")
(float_truncate:DF
(match_operand:XF 1 "register_operand" "f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
{
if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
return "fstp%z0\t%y0";
@@ -4352,69 +3997,6 @@
(set (match_dup 0) (match_dup 2))]
"")
-(define_expand "trunctfdf2"
- [(parallel [(set (match_operand:DF 0 "nonimmediate_operand" "")
- (float_truncate:DF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_dup 2))])]
- "TARGET_80387"
- "operands[2] = assign_386_stack_local (DFmode, 0);")
-
-(define_insn "*trunctfdf2_1"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=m,?f#rY,?r#fY,?Y#rf")
- (float_truncate:DF
- (match_operand:TF 1 "register_operand" "f,f,f,f")))
- (clobber (match_operand:DF 2 "memory_operand" "=X,m,m,m"))]
- "TARGET_80387"
-{
- switch (which_alternative)
- {
- case 0:
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0";
- else
- return "fst%z0\t%y0";
- default:
- abort();
- }
- abort ();
-}
- [(set_attr "type" "fmov,multi,multi,multi")
- (set_attr "mode" "DF")])
-
- (define_insn "*trunctfdf2_2"
- [(set (match_operand:DF 0 "memory_operand" "=m")
- (float_truncate:DF
- (match_operand:TF 1 "register_operand" "f")))]
- "TARGET_80387"
-{
- if (find_regno_note (insn, REG_DEAD, REGNO (operands[1])))
- return "fstp%z0\t%y0";
- else
- return "fst%z0\t%y0";
-}
- [(set_attr "type" "fmov")
- (set_attr "mode" "DF")])
-
-(define_split
- [(set (match_operand:DF 0 "memory_operand" "")
- (float_truncate:DF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_operand:DF 2 "memory_operand" ""))]
- "TARGET_80387"
- [(set (match_dup 0) (float_truncate:DF (match_dup 1)))]
- "")
-
-(define_split
- [(set (match_operand:DF 0 "register_operand" "")
- (float_truncate:DF
- (match_operand:TF 1 "register_operand" "")))
- (clobber (match_operand:DF 2 "memory_operand" ""))]
- "TARGET_80387 && reload_completed"
- [(set (match_dup 2) (float_truncate:DF (match_dup 1)))
- (set (match_dup 0) (match_dup 2))]
- "")
-
;; %%% Break up all these bad boys.
@@ -4423,12 +4005,6 @@
(define_expand "fix_truncxfdi2"
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(fix:DI (match_operand:XF 1 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "fix_trunctfdi2"
- [(set (match_operand:DI 0 "nonimmediate_operand" "")
- (fix:DI (match_operand:TF 1 "register_operand" "")))]
"TARGET_80387"
"")
@@ -4590,12 +4166,6 @@
(define_expand "fix_truncxfsi2"
[(set (match_operand:SI 0 "nonimmediate_operand" "")
(fix:SI (match_operand:XF 1 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "fix_trunctfsi2"
- [(set (match_operand:SI 0 "nonimmediate_operand" "")
- (fix:SI (match_operand:TF 1 "register_operand" "")))]
"TARGET_80387"
"")
@@ -4751,12 +4321,6 @@
(define_expand "fix_truncxfhi2"
[(set (match_operand:HI 0 "nonimmediate_operand" "")
(fix:HI (match_operand:XF 1 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "fix_trunctfhi2"
- [(set (match_operand:HI 0 "nonimmediate_operand" "")
- (fix:HI (match_operand:TF 1 "register_operand" "")))]
"TARGET_80387"
"")
@@ -5103,17 +4667,6 @@
(define_insn "floathixf2"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(float:XF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "@
- fild%z1\t%1
- #"
- [(set_attr "type" "fmov,multi")
- (set_attr "mode" "XF")
- (set_attr "fp_int_src" "true")])
-
-(define_insn "floathitf2"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (float:TF (match_operand:HI 1 "nonimmediate_operand" "m,r")))]
"TARGET_80387"
"@
fild%z1\t%1
@@ -5125,17 +4678,6 @@
(define_insn "floatsixf2"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(float:XF (match_operand:SI 1 "nonimmediate_operand" "m,r")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "@
- fild%z1\t%1
- #"
- [(set_attr "type" "fmov,multi")
- (set_attr "mode" "XF")
- (set_attr "fp_int_src" "true")])
-
-(define_insn "floatsitf2"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (float:TF (match_operand:SI 1 "nonimmediate_operand" "m,r")))]
"TARGET_80387"
"@
fild%z1\t%1
@@ -5147,17 +4689,6 @@
(define_insn "floatdixf2"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(float:XF (match_operand:DI 1 "nonimmediate_operand" "m,r")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "@
- fild%z1\t%1
- #"
- [(set_attr "type" "fmov,multi")
- (set_attr "mode" "XF")
- (set_attr "fp_int_src" "true")])
-
-(define_insn "floatditf2"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (float:TF (match_operand:DI 1 "nonimmediate_operand" "m,r")))]
"TARGET_80387"
"@
fild%z1\t%1
@@ -5265,10 +4796,10 @@
(set_attr "mode" "DI")])
(define_insn "addqi3_carry"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,r")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(plus:QI (plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "")
(match_operand:QI 1 "nonimmediate_operand" "%0,0"))
- (match_operand:QI 2 "general_operand" "ri,rm")))
+ (match_operand:QI 2 "general_operand" "qi,qm")))
(clobber (reg:CC 17))]
"ix86_binary_operator_ok (PLUS, QImode, operands)"
"adc{b}\t{%2, %0|%0, %2}"
@@ -6858,13 +6389,6 @@
[(set (match_operand:XF 0 "register_operand" "")
(plus:XF (match_operand:XF 1 "register_operand" "")
(match_operand:XF 2 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "addtf3"
- [(set (match_operand:TF 0 "register_operand" "")
- (plus:TF (match_operand:TF 1 "register_operand" "")
- (match_operand:TF 2 "register_operand" "")))]
"TARGET_80387"
"")
@@ -6969,10 +6493,10 @@
(set_attr "mode" "DI")])
(define_insn "subqi3_carry"
- [(set (match_operand:QI 0 "nonimmediate_operand" "=rm,r")
+ [(set (match_operand:QI 0 "nonimmediate_operand" "=qm,q")
(minus:QI (match_operand:QI 1 "nonimmediate_operand" "0,0")
(plus:QI (match_operand:QI 3 "ix86_carry_flag_operator" "")
- (match_operand:QI 2 "general_operand" "ri,rm"))))
+ (match_operand:QI 2 "general_operand" "qi,qm"))))
(clobber (reg:CC 17))]
"ix86_binary_operator_ok (MINUS, QImode, operands)"
"sbb{b}\t{%2, %0|%0, %2}"
@@ -7211,13 +6735,6 @@
[(set (match_operand:XF 0 "register_operand" "")
(minus:XF (match_operand:XF 1 "register_operand" "")
(match_operand:XF 2 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "subtf3"
- [(set (match_operand:TF 0 "register_operand" "")
- (minus:TF (match_operand:TF 1 "register_operand" "")
- (match_operand:TF 2 "register_operand" "")))]
"TARGET_80387"
"")
@@ -7729,13 +7246,6 @@
[(set (match_operand:XF 0 "register_operand" "")
(mult:XF (match_operand:XF 1 "register_operand" "")
(match_operand:XF 2 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "multf3"
- [(set (match_operand:TF 0 "register_operand" "")
- (mult:TF (match_operand:TF 1 "register_operand" "")
- (match_operand:TF 2 "register_operand" "")))]
"TARGET_80387"
"")
@@ -7783,13 +7293,6 @@
[(set (match_operand:XF 0 "register_operand" "")
(div:XF (match_operand:XF 1 "register_operand" "")
(match_operand:XF 2 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "")
-
-(define_expand "divtf3"
- [(set (match_operand:TF 0 "register_operand" "")
- (div:TF (match_operand:TF 1 "register_operand" "")
- (match_operand:TF 2 "register_operand" "")))]
"TARGET_80387"
"")
@@ -10018,8 +9521,7 @@
{
int size = GET_MODE_SIZE (GET_MODE (operands[1]));
- /* XFmode's size is 12, TFmode 16, but only 10 bytes are used. */
- if (size >= 12)
+ if (GET_MODE (operands[1]) == XFmode)
size = 10;
operands[0] = adjust_address (operands[0], QImode, size - 1);
operands[1] = gen_int_mode (0x80, QImode);
@@ -10196,15 +9698,8 @@
[(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "")
(neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))
(clobber (reg:CC 17))])]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;")
-
-(define_expand "negtf2"
- [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "")
- (neg:TF (match_operand:TF 1 "nonimmediate_operand" "")))
- (clobber (reg:CC 17))])]
"TARGET_80387"
- "ix86_expand_unary_operator (NEG, TFmode, operands); DONE;")
+ "ix86_expand_unary_operator (NEG, XFmode, operands); DONE;")
;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
;; because of secondary memory needed to reload from class FLOAT_INT_REGS
@@ -10213,7 +9708,7 @@
[(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f")
(neg:XF (match_operand:XF 1 "nonimmediate_operand" "0,0")))
(clobber (reg:CC 17))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
+ "TARGET_80387
&& ix86_unary_operator_ok (NEG, XFmode, operands)"
"#")
@@ -10237,36 +9732,6 @@
operands[0] = gen_rtx_REG (SImode,
true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));")
-;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
-;; because of secondary memory needed to reload from class FLOAT_INT_REGS
-;; to itself.
-(define_insn "*negtf2_if"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,rm#f")
- (neg:TF (match_operand:TF 1 "nonimmediate_operand" "0,0")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && ix86_unary_operator_ok (NEG, TFmode, operands)"
- "#")
-
-(define_split
- [(set (match_operand:TF 0 "fp_register_operand" "")
- (neg:TF (match_operand:TF 1 "register_operand" "")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && reload_completed"
- [(set (match_dup 0)
- (neg:TF (match_dup 1)))]
- "")
-
-(define_split
- [(set (match_operand:TF 0 "register_and_not_fp_reg_operand" "")
- (neg:TF (match_operand:TF 1 "register_operand" "")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && reload_completed"
- [(parallel [(set (match_dup 0) (xor:SI (match_dup 0) (match_dup 1)))
- (clobber (reg:CC 17))])]
- "operands[1] = GEN_INT (0x8000);
- operands[0] = gen_rtx_REG (SImode,
- true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));")
-
;; Conditionalize these after reload. If they matches before reload, we
;; lose the clobber and ability to use integer instructions.
@@ -10301,7 +9766,7 @@
(define_insn "*negxf2_1"
[(set (match_operand:XF 0 "register_operand" "=f")
(neg:XF (match_operand:XF 1 "register_operand" "0")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && reload_completed"
+ "TARGET_80387 && reload_completed"
"fchs"
[(set_attr "type" "fsgn")
(set_attr "mode" "XF")
@@ -10311,7 +9776,7 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(neg:XF (float_extend:XF
(match_operand:DF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"fchs"
[(set_attr "type" "fsgn")
(set_attr "mode" "XF")
@@ -10321,35 +9786,6 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(neg:XF (float_extend:XF
(match_operand:SF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "fchs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "XF")
- (set_attr "ppro_uops" "few")])
-
-(define_insn "*negtf2_1"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (neg:TF (match_operand:TF 1 "register_operand" "0")))]
- "TARGET_80387 && reload_completed"
- "fchs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "XF")
- (set_attr "ppro_uops" "few")])
-
-(define_insn "*negextenddftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (neg:TF (float_extend:TF
- (match_operand:DF 1 "register_operand" "0"))))]
- "TARGET_80387"
- "fchs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "XF")
- (set_attr "ppro_uops" "few")])
-
-(define_insn "*negextendsftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (neg:TF (float_extend:TF
- (match_operand:SF 1 "register_operand" "0"))))]
"TARGET_80387"
"fchs"
[(set_attr "type" "fsgn")
@@ -10491,8 +9927,7 @@
{
int size = GET_MODE_SIZE (GET_MODE (operands[1]));
- /* XFmode's size is 12, TFmode 16, but only 10 bytes are used. */
- if (size >= 12)
+ if (GET_MODE (operands[1]) == XFmode)
size = 10;
operands[0] = adjust_address (operands[0], QImode, size - 1);
operands[1] = gen_int_mode (~0x80, QImode);
@@ -10658,15 +10093,8 @@
[(parallel [(set (match_operand:XF 0 "nonimmediate_operand" "")
(neg:XF (match_operand:XF 1 "nonimmediate_operand" "")))
(clobber (reg:CC 17))])]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;")
-
-(define_expand "abstf2"
- [(parallel [(set (match_operand:TF 0 "nonimmediate_operand" "")
- (neg:TF (match_operand:TF 1 "nonimmediate_operand" "")))
- (clobber (reg:CC 17))])]
"TARGET_80387"
- "ix86_expand_unary_operator (ABS, TFmode, operands); DONE;")
+ "ix86_expand_unary_operator (ABS, XFmode, operands); DONE;")
;; Keep 'f' and 'r' in separate alternatives to avoid reload problems
;; because of secondary memory needed to reload from class FLOAT_INT_REGS
@@ -10675,7 +10103,7 @@
[(set (match_operand:XF 0 "nonimmediate_operand" "=f#r,rm#f")
(abs:XF (match_operand:XF 1 "nonimmediate_operand" "0,0")))
(clobber (reg:CC 17))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
+ "TARGET_80387
&& ix86_unary_operator_ok (ABS, XFmode, operands)"
"#")
@@ -10699,33 +10127,6 @@
operands[0] = gen_rtx_REG (SImode,
true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));")
-(define_insn "*abstf2_if"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f#r,rm#f")
- (abs:TF (match_operand:TF 1 "nonimmediate_operand" "0,0")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && ix86_unary_operator_ok (ABS, TFmode, operands)"
- "#")
-
-(define_split
- [(set (match_operand:TF 0 "fp_register_operand" "")
- (abs:TF (match_operand:TF 1 "register_operand" "")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && reload_completed"
- [(set (match_dup 0)
- (abs:TF (match_dup 1)))]
- "")
-
-(define_split
- [(set (match_operand:TF 0 "register_and_not_any_fp_reg_operand" "")
- (abs:TF (match_operand:TF 1 "register_operand" "")))
- (clobber (reg:CC 17))]
- "TARGET_80387 && reload_completed"
- [(parallel [(set (match_dup 0) (and:SI (match_dup 0) (match_dup 1)))
- (clobber (reg:CC 17))])]
- "operands[1] = GEN_INT (~0x8000);
- operands[0] = gen_rtx_REG (SImode,
- true_regnum (operands[0]) + (TARGET_64BIT ? 1 : 2));")
-
(define_insn "*abssf2_1"
[(set (match_operand:SF 0 "register_operand" "=f")
(abs:SF (match_operand:SF 1 "register_operand" "0")))]
@@ -10754,7 +10155,7 @@
(define_insn "*absxf2_1"
[(set (match_operand:XF 0 "register_operand" "=f")
(abs:XF (match_operand:XF 1 "register_operand" "0")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && reload_completed"
+ "TARGET_80387 && reload_completed"
"fabs"
[(set_attr "type" "fsgn")
(set_attr "mode" "DF")])
@@ -10763,7 +10164,7 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(abs:XF (float_extend:XF
(match_operand:DF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"fabs"
[(set_attr "type" "fsgn")
(set_attr "mode" "XF")])
@@ -10772,32 +10173,6 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(abs:XF (float_extend:XF
(match_operand:SF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
- "fabs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "XF")])
-
-(define_insn "*abstf2_1"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (abs:TF (match_operand:TF 1 "register_operand" "0")))]
- "TARGET_80387 && reload_completed"
- "fabs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "DF")])
-
-(define_insn "*absextenddftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (abs:TF (float_extend:TF
- (match_operand:DF 1 "register_operand" "0"))))]
- "TARGET_80387"
- "fabs"
- [(set_attr "type" "fsgn")
- (set_attr "mode" "XF")])
-
-(define_insn "*absextendsftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (abs:TF (float_extend:TF
- (match_operand:SF 1 "register_operand" "0"))))]
"TARGET_80387"
"fabs"
[(set_attr "type" "fsgn")
@@ -14841,7 +14216,7 @@
(match_operator:XF 3 "binary_fp_operator"
[(match_operand:XF 1 "register_operand" "%0")
(match_operand:XF 2 "register_operand" "f")]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
+ "TARGET_80387
&& GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -14850,19 +14225,6 @@
(const_string "fop")))
(set_attr "mode" "XF")])
-(define_insn "*fop_tf_comm"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (match_operator:TF 3 "binary_fp_operator"
- [(match_operand:TF 1 "register_operand" "%0")
- (match_operand:TF 2 "register_operand" "f")]))]
- "TARGET_80387 && GET_RTX_CLASS (GET_CODE (operands[3])) == 'c'"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (if_then_else (match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (const_string "fop")))
- (set_attr "mode" "XF")])
-
(define_insn "*fop_sf_1_nosse"
[(set (match_operand:SF 0 "register_operand" "=f,f")
(match_operator:SF 3 "binary_fp_operator"
@@ -15117,7 +14479,7 @@
(match_operator:XF 3 "binary_fp_operator"
[(match_operand:XF 1 "register_operand" "0,f")
(match_operand:XF 2 "register_operand" "f,0")]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387
+ "TARGET_80387
&& GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
@@ -15129,29 +14491,12 @@
(const_string "fop")))
(set_attr "mode" "XF")])
-(define_insn "*fop_tf_1"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(match_operand:TF 1 "register_operand" "0,f")
- (match_operand:TF 2 "register_operand" "f,0")]))]
- "TARGET_80387
- && GET_RTX_CLASS (GET_CODE (operands[3])) != 'c'"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "mode" "XF")])
-
(define_insn "*fop_xf_2"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
[(float:XF (match_operand:SI 1 "nonimmediate_operand" "m,?r"))
(match_operand:XF 2 "register_operand" "0,0")]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && TARGET_USE_FIOP"
+ "TARGET_80387 && TARGET_USE_FIOP"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -15164,30 +14509,12 @@
(set_attr "mode" "SI")
(set_attr "ppro_uops" "many")])
-(define_insn "*fop_tf_2"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(float:TF (match_operand:SI 1 "nonimmediate_operand" "m,?r"))
- (match_operand:TF 2 "register_operand" "0,0")]))]
- "TARGET_80387 && TARGET_USE_FIOP"
- "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "fp_int_src" "true")
- (set_attr "mode" "SI")
- (set_attr "ppro_uops" "many")])
-
(define_insn "*fop_xf_3"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
[(match_operand:XF 1 "register_operand" "0,0")
(float:XF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && TARGET_USE_FIOP"
+ "TARGET_80387 && TARGET_USE_FIOP"
"* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -15200,30 +14527,12 @@
(set_attr "mode" "SI")
(set_attr "ppro_uops" "many")])
-(define_insn "*fop_tf_3"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(match_operand:TF 1 "register_operand" "0,0")
- (float:TF (match_operand:SI 2 "nonimmediate_operand" "m,?r"))]))]
- "TARGET_80387 && TARGET_USE_FIOP"
- "* return which_alternative ? \"#\" : output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "fp_int_src" "true")
- (set_attr "mode" "SI")
- (set_attr "ppro_uops" "many")])
-
(define_insn "*fop_xf_4"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
[(float_extend:XF (match_operand 1 "nonimmediate_operand" "fm,0"))
(match_operand:XF 2 "register_operand" "0,f")]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -15234,29 +14543,13 @@
(const_string "fop")))
(set_attr "mode" "SF")])
-(define_insn "*fop_tf_4"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(float_extend:TF (match_operand 1 "nonimmediate_operand" "fm,0"))
- (match_operand:TF 2 "register_operand" "0,f")]))]
- "TARGET_80387"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "mode" "SF")])
-
(define_insn "*fop_xf_5"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
[(match_operand:XF 1 "register_operand" "0,f")
(float_extend:XF
(match_operand 2 "nonimmediate_operand" "fm,0"))]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -15267,23 +14560,6 @@
(const_string "fop")))
(set_attr "mode" "SF")])
-(define_insn "*fop_tf_5"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(match_operand:TF 1 "register_operand" "0,f")
- (float_extend:TF
- (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
- "TARGET_80387"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "mode" "SF")])
-
(define_insn "*fop_xf_6"
[(set (match_operand:XF 0 "register_operand" "=f,f")
(match_operator:XF 3 "binary_fp_operator"
@@ -15291,7 +14567,7 @@
(match_operand 1 "register_operand" "0,f"))
(float_extend:XF
(match_operand 2 "nonimmediate_operand" "fm,0"))]))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387"
+ "TARGET_80387"
"* return output_387_binary_op (insn, operands);"
[(set (attr "type")
(cond [(match_operand:XF 3 "mult_operator" "")
@@ -15302,24 +14578,6 @@
(const_string "fop")))
(set_attr "mode" "SF")])
-(define_insn "*fop_tf_6"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (match_operator:TF 3 "binary_fp_operator"
- [(float_extend:TF
- (match_operand 1 "register_operand" "0,f"))
- (float_extend:TF
- (match_operand 2 "nonimmediate_operand" "fm,0"))]))]
- "TARGET_80387"
- "* return output_387_binary_op (insn, operands);"
- [(set (attr "type")
- (cond [(match_operand:TF 3 "mult_operator" "")
- (const_string "fmul")
- (match_operand:TF 3 "div_operator" "")
- (const_string "fdiv")
- ]
- (const_string "fop")))
- (set_attr "mode" "SF")])
-
(define_split
[(set (match_operand 0 "register_operand" "")
(match_operator 3 "binary_fp_operator"
@@ -15457,17 +14715,7 @@
(define_insn "sqrtxf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(sqrt:XF (match_operand:XF 1 "register_operand" "0")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387
- && (TARGET_IEEE_FP || flag_unsafe_math_optimizations) "
- "fsqrt"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")
- (set_attr "athlon_decode" "direct")])
-
-(define_insn "sqrttf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (sqrt:TF (match_operand:TF 1 "register_operand" "0")))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ "TARGET_80387 && !TARGET_NO_FANCY_MATH_387
&& (TARGET_IEEE_FP || flag_unsafe_math_optimizations) "
"fsqrt"
[(set_attr "type" "fpspc")
@@ -15478,17 +14726,7 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(sqrt:XF (float_extend:XF
(match_operand:DF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387"
- "fsqrt"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")
- (set_attr "athlon_decode" "direct")])
-
-(define_insn "*sqrtextenddftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (sqrt:TF (float_extend:TF
- (match_operand:DF 1 "register_operand" "0"))))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387"
+ "TARGET_80387 && !TARGET_NO_FANCY_MATH_387"
"fsqrt"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")
@@ -15498,17 +14736,7 @@
[(set (match_operand:XF 0 "register_operand" "=f")
(sqrt:XF (float_extend:XF
(match_operand:SF 1 "register_operand" "0"))))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387"
- "fsqrt"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")
- (set_attr "athlon_decode" "direct")])
-
-(define_insn "*sqrtextendsftf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (sqrt:TF (float_extend:TF
- (match_operand:SF 1 "register_operand" "0"))))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387"
+ "TARGET_80387 && !TARGET_NO_FANCY_MATH_387"
"fsqrt"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")
@@ -15546,16 +14774,7 @@
(define_insn "sinxf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_SIN))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_80387 && !TARGET_NO_FANCY_MATH_387
- && flag_unsafe_math_optimizations"
- "fsin"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "sintf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 1 "register_operand" "0")] UNSPEC_SIN))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ "TARGET_80387 && !TARGET_NO_FANCY_MATH_387
&& flag_unsafe_math_optimizations"
"fsin"
[(set_attr "type" "fpspc")
@@ -15593,16 +14812,7 @@
(define_insn "cosxf2"
[(set (match_operand:XF 0 "register_operand" "=f")
(unspec:XF [(match_operand:XF 1 "register_operand" "0")] UNSPEC_COS))]
- "!TARGET_128BIT_LONG_DOUBLE && ! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations"
- "fcos"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "costf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 1 "register_operand" "0")] UNSPEC_COS))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
+ "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
&& flag_unsafe_math_optimizations"
"fcos"
[(set_attr "type" "fpspc")
@@ -15665,7 +14875,7 @@
UNSPEC_FPATAN))
(clobber (match_scratch:XF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && ! TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
"fpatan"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")])
@@ -15675,7 +14885,7 @@
(use (match_operand:XF 2 "register_operand" "0"))
(use (match_operand:XF 1 "register_operand" "u"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && ! TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
{
rtx copy = gen_reg_rtx (XFmode);
emit_move_insn (copy, operands[1]);
@@ -15683,40 +14893,14 @@
DONE;
})
-(define_insn "atan2tf3_1"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 2 "register_operand" "0")
- (match_operand:TF 1 "register_operand" "u")]
- UNSPEC_FPATAN))
- (clobber (match_scratch:TF 3 "=1"))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
- "fpatan"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_expand "atan2tf3"
- [(use (match_operand:TF 0 "register_operand" "=f"))
- (use (match_operand:TF 2 "register_operand" "0"))
- (use (match_operand:TF 1 "register_operand" "u"))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
-{
- rtx copy = gen_reg_rtx (TFmode);
- emit_move_insn (copy, operands[1]);
- emit_insn (gen_atan2tf3_1 (operands[0], copy, operands[2]));
- DONE;
-})
-
(define_insn "*fyl2x_sfxf3"
[(set (match_operand:SF 0 "register_operand" "=f")
(unspec:SF [(match_operand:SF 2 "register_operand" "0")
- (match_operand 1 "register_operand" "u")]
+ (match_operand:XF 1 "register_operand" "u")]
UNSPEC_FYL2X))
(clobber (match_scratch:SF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations
- && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)"
+ && flag_unsafe_math_optimizations"
"fyl2x"
[(set_attr "type" "fpspc")
(set_attr "mode" "SF")])
@@ -15724,12 +14908,11 @@
(define_insn "*fyl2x_dfxf3"
[(set (match_operand:DF 0 "register_operand" "=f")
(unspec:DF [(match_operand:DF 2 "register_operand" "0")
- (match_operand 1 "register_operand" "u")]
+ (match_operand:XF 1 "register_operand" "u")]
UNSPEC_FYL2X))
(clobber (match_scratch:DF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations
- && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)"
+ && flag_unsafe_math_optimizations"
"fyl2x"
[(set_attr "type" "fpspc")
(set_attr "mode" "DF")])
@@ -15741,19 +14924,7 @@
UNSPEC_FYL2X))
(clobber (match_scratch:XF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
- "fyl2x"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "*fyl2x_tfxf3"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 2 "register_operand" "0")
- (match_operand:TF 1 "register_operand" "u")]
- UNSPEC_FYL2X))
- (clobber (match_scratch:TF 3 "=1"))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
"fyl2x"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")])
@@ -15768,7 +14939,7 @@
{
rtx temp;
- operands[2] = gen_reg_rtx (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode);
+ operands[2] = gen_reg_rtx (XFmode);
temp = standard_80387_constant_rtx (4); /* fldln2 */
emit_move_insn (operands[2], temp);
})
@@ -15783,7 +14954,7 @@
{
rtx temp;
- operands[2] = gen_reg_rtx (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode);
+ operands[2] = gen_reg_rtx (XFmode);
temp = standard_80387_constant_rtx (4); /* fldln2 */
emit_move_insn (operands[2], temp);
})
@@ -15794,7 +14965,7 @@
(match_dup 2)] UNSPEC_FYL2X))
(clobber (match_scratch:XF 3 ""))])]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
{
rtx temp;
@@ -15803,45 +14974,26 @@
emit_move_insn (operands[2], temp);
})
-(define_expand "logtf2"
- [(parallel [(set (match_operand:TF 0 "register_operand" "")
- (unspec:TF [(match_operand:TF 1 "register_operand" "")
- (match_dup 2)] UNSPEC_FYL2X))
- (clobber (match_scratch:TF 3 ""))])]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
-{
- rtx temp;
-
- operands[2] = gen_reg_rtx (TFmode);
- temp = standard_80387_constant_rtx (4); /* fldln2 */
- emit_move_insn (operands[2], temp);
-})
-
(define_insn "*fscale_sfxf3"
[(set (match_operand:SF 0 "register_operand" "=f")
- (unspec:SF [(match_operand 2 "register_operand" "0")
- (match_operand 1 "register_operand" "u")]
+ (unspec:SF [(match_operand:XF 2 "register_operand" "0")
+ (match_operand:XF 1 "register_operand" "u")]
UNSPEC_FSCALE))
(clobber (match_scratch:SF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations
- && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)
- && GET_MODE (operands[2]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)"
+ && flag_unsafe_math_optimizations"
"fscale\;fstp\t%y1"
[(set_attr "type" "fpspc")
(set_attr "mode" "SF")])
(define_insn "*fscale_dfxf3"
[(set (match_operand:DF 0 "register_operand" "=f")
- (unspec:DF [(match_operand 2 "register_operand" "0")
- (match_operand 1 "register_operand" "u")]
+ (unspec:DF [(match_operand:XF 2 "register_operand" "0")
+ (match_operand:XF 1 "register_operand" "u")]
UNSPEC_FSCALE))
(clobber (match_scratch:DF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations
- && GET_MODE (operands[1]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)
- && GET_MODE (operands[2]) == (TARGET_128BIT_LONG_DOUBLE ? TFmode : XFmode)"
+ && flag_unsafe_math_optimizations"
"fscale\;fstp\t%y1"
[(set_attr "type" "fpspc")
(set_attr "mode" "DF")])
@@ -15853,19 +15005,7 @@
UNSPEC_FSCALE))
(clobber (match_scratch:XF 3 "=1"))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
- "fscale\;fstp\t%y1"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "*fscale_tf3"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 2 "register_operand" "0")
- (match_operand:TF 1 "register_operand" "u")]
- UNSPEC_FSCALE))
- (clobber (match_scratch:TF 3 "=1"))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
"fscale\;fstp\t%y1"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")])
@@ -15875,17 +15015,7 @@
(unspec:XF [(match_operand:XF 1 "register_operand" "0")]
UNSPEC_FRNDINT))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
- "frndint"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "*frndinttf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 1 "register_operand" "0")]
- UNSPEC_FRNDINT))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
"frndint"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")])
@@ -15895,17 +15025,7 @@
(unspec:XF [(match_operand:XF 1 "register_operand" "0")]
UNSPEC_F2XM1))]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
- "f2xm1"
- [(set_attr "type" "fpspc")
- (set_attr "mode" "XF")])
-
-(define_insn "*f2xm1tf2"
- [(set (match_operand:TF 0 "register_operand" "=f")
- (unspec:TF [(match_operand:TF 1 "register_operand" "0")]
- UNSPEC_F2XM1))]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
"f2xm1"
[(set_attr "type" "fpspc")
(set_attr "mode" "XF")])
@@ -15927,12 +15047,6 @@
rtx temp;
int i;
- if (TARGET_128BIT_LONG_DOUBLE)
- {
- emit_insn (gen_expsf2_tf (operands[0], operands[1]));
- DONE;
- }
-
for (i=2; i<10; i++)
operands[i] = gen_reg_rtx (XFmode);
temp = standard_80387_constant_rtx (5); /* fldl2e */
@@ -15940,29 +15054,6 @@
emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */
})
-(define_expand "expsf2_tf"
- [(set (match_dup 2)
- (float_extend:TF (match_operand:SF 1 "register_operand" "")))
- (set (match_dup 4) (mult:TF (match_dup 2) (match_dup 3)))
- (set (match_dup 5) (unspec:TF [(match_dup 4)] UNSPEC_FRNDINT))
- (set (match_dup 6) (minus:TF (match_dup 4) (match_dup 5)))
- (set (match_dup 7) (unspec:TF [(match_dup 6)] UNSPEC_F2XM1))
- (set (match_dup 9) (plus:TF (match_dup 7) (match_dup 8)))
- (parallel [(set (match_operand:SF 0 "register_operand" "")
- (unspec:SF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE))
- (clobber (match_scratch:SF 5 ""))])]
- ""
-{
- rtx temp;
- int i;
-
- for (i=2; i<10; i++)
- operands[i] = gen_reg_rtx (TFmode);
- temp = standard_80387_constant_rtx (5); /* fldl2e */
- emit_move_insn (operands[3], temp);
- emit_move_insn (operands[8], CONST1_RTX (TFmode)); /* fld1 */
-})
-
(define_expand "expdf2"
[(set (match_dup 2)
(float_extend:XF (match_operand:DF 1 "register_operand" "")))
@@ -15980,12 +15071,6 @@
rtx temp;
int i;
- if (TARGET_128BIT_LONG_DOUBLE)
- {
- emit_insn (gen_expdf2_tf (operands[0], operands[1]));
- DONE;
- }
-
for (i=2; i<10; i++)
operands[i] = gen_reg_rtx (XFmode);
temp = standard_80387_constant_rtx (5); /* fldl2e */
@@ -15993,30 +15078,6 @@
emit_move_insn (operands[8], CONST1_RTX (XFmode)); /* fld1 */
})
-
-(define_expand "expdf2_tf"
- [(set (match_dup 2)
- (float_extend:TF (match_operand:DF 1 "register_operand" "")))
- (set (match_dup 4) (mult:TF (match_dup 2) (match_dup 3)))
- (set (match_dup 5) (unspec:TF [(match_dup 4)] UNSPEC_FRNDINT))
- (set (match_dup 6) (minus:TF (match_dup 4) (match_dup 5)))
- (set (match_dup 7) (unspec:TF [(match_dup 6)] UNSPEC_F2XM1))
- (set (match_dup 9) (plus:TF (match_dup 7) (match_dup 8)))
- (parallel [(set (match_operand:DF 0 "register_operand" "")
- (unspec:DF [(match_dup 9) (match_dup 5)] UNSPEC_FSCALE))
- (clobber (match_scratch:DF 5 ""))])]
- ""
-{
- rtx temp;
- int i;
-
- for (i=2; i<10; i++)
- operands[i] = gen_reg_rtx (TFmode);
- temp = standard_80387_constant_rtx (5); /* fldl2e */
- emit_move_insn (operands[3], temp);
- emit_move_insn (operands[8], CONST1_RTX (TFmode)); /* fld1 */
-})
-
(define_expand "expxf2"
[(set (match_dup 3) (mult:XF (match_operand:XF 1 "register_operand" "")
(match_dup 2)))
@@ -16028,7 +15089,7 @@
(unspec:XF [(match_dup 8) (match_dup 4)] UNSPEC_FSCALE))
(clobber (match_scratch:XF 5 ""))])]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
{
rtx temp;
int i;
@@ -16053,29 +15114,6 @@
emit_move_insn (operands[2], CONST1_RTX (SFmode)); /* fld1 */
})
-(define_expand "exptf2"
- [(set (match_dup 3) (mult:TF (match_operand:TF 1 "register_operand" "")
- (match_dup 2)))
- (set (match_dup 4) (unspec:TF [(match_dup 3)] UNSPEC_FRNDINT))
- (set (match_dup 5) (minus:TF (match_dup 3) (match_dup 4)))
- (set (match_dup 6) (unspec:TF [(match_dup 5)] UNSPEC_F2XM1))
- (set (match_dup 8) (plus:TF (match_dup 6) (match_dup 7)))
- (parallel [(set (match_operand:TF 0 "register_operand" "")
- (unspec:TF [(match_dup 8) (match_dup 4)] UNSPEC_FSCALE))
- (clobber (match_scratch:TF 5 ""))])]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
-{
- rtx temp;
- int i;
-
- for (i=2; i<9; i++)
- operands[i] = gen_reg_rtx (TFmode);
- temp = standard_80387_constant_rtx (5); /* fldl2e */
- emit_move_insn (operands[2], temp);
- emit_move_insn (operands[7], CONST1_RTX (TFmode)); /* fld1 */
-})
-
(define_expand "atandf2"
[(parallel [(set (match_operand:DF 0 "register_operand" "")
(unspec:DF [(match_dup 2)
@@ -16096,24 +15134,11 @@
UNSPEC_FPATAN))
(clobber (match_scratch:XF 3 ""))])]
"! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && !TARGET_128BIT_LONG_DOUBLE"
+ && flag_unsafe_math_optimizations"
{
operands[2] = gen_reg_rtx (XFmode);
emit_move_insn (operands[2], CONST1_RTX (XFmode)); /* fld1 */
})
-
-(define_expand "atantf2"
- [(parallel [(set (match_operand:TF 0 "register_operand" "")
- (unspec:TF [(match_dup 2)
- (match_operand:TF 1 "register_operand" "")]
- UNSPEC_FPATAN))
- (clobber (match_scratch:TF 3 ""))])]
- "! TARGET_NO_FANCY_MATH_387 && TARGET_80387
- && flag_unsafe_math_optimizations && TARGET_128BIT_LONG_DOUBLE"
-{
- operands[2] = gen_reg_rtx (TFmode);
- emit_move_insn (operands[2], CONST1_RTX (TFmode)); /* fld1 */
-})
;; Block operation instructions
@@ -16848,7 +15873,7 @@
(match_operand:BLK 2 "general_operand" "")))
(use (match_operand 3 "general_operand" ""))
(use (match_operand 4 "immediate_operand" ""))]
- "! optimize_size"
+ "! optimize_size || TARGET_INLINE_ALL_STRINGOPS"
{
rtx addr1, addr2, out, outlow, count, countreg, align;
@@ -17364,14 +16389,6 @@
(if_then_else:XF (match_operand 1 "comparison_operator" "")
(match_operand:XF 2 "register_operand" "")
(match_operand:XF 3 "register_operand" "")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_CMOVE"
- "if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;")
-
-(define_expand "movtfcc"
- [(set (match_operand:TF 0 "register_operand" "")
- (if_then_else:TF (match_operand 1 "comparison_operator" "")
- (match_operand:TF 2 "register_operand" "")
- (match_operand:TF 3 "register_operand" "")))]
"TARGET_CMOVE"
"if (! ix86_expand_fp_movcc (operands)) FAIL; DONE;")
@@ -17381,19 +16398,6 @@
[(reg 17) (const_int 0)])
(match_operand:XF 2 "register_operand" "f,0")
(match_operand:XF 3 "register_operand" "0,f")))]
- "!TARGET_128BIT_LONG_DOUBLE && TARGET_CMOVE"
- "@
- fcmov%F1\t{%2, %0|%0, %2}
- fcmov%f1\t{%3, %0|%0, %3}"
- [(set_attr "type" "fcmov")
- (set_attr "mode" "XF")])
-
-(define_insn "*movtfcc_1"
- [(set (match_operand:TF 0 "register_operand" "=f,f")
- (if_then_else:TF (match_operator 1 "fcmov_comparison_operator"
- [(reg 17) (const_int 0)])
- (match_operand:TF 2 "register_operand" "f,0")
- (match_operand:TF 3 "register_operand" "0,f")))]
"TARGET_CMOVE"
"@
fcmov%F1\t{%2, %0|%0, %2}
@@ -17582,7 +16586,7 @@
&& operands_match_p (operands[2], operands[3])))"
[(set (reg:CCFP 17)
(compare:CCFP (match_dup 2)
- (match_dup 2)))
+ (match_dup 1)))
(set (match_dup 0)
(if_then_else:DF (ge (reg:CCFP 17) (const_int 0))
(match_dup 1)
@@ -17772,23 +16776,7 @@
;; [(set (mem (plus (reg ebp) (const_int -160000))) (const_int 0))]
;;
;; in proper program order.
-(define_expand "pro_epilogue_adjust_stack"
- [(parallel [(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")))
- (clobber (reg:CC 17))
- (clobber (mem:BLK (scratch)))])]
- ""
-{
- if (TARGET_64BIT)
- {
- emit_insn (gen_pro_epilogue_adjust_stack_rex64
- (operands[0], operands[1], operands[2]));
- DONE;
- }
-})
-
-(define_insn "*pro_epilogue_adjust_stack_1"
+(define_insn "pro_epilogue_adjust_stack_1"
[(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")))
@@ -17844,6 +16832,8 @@
case TYPE_ALU:
if (GET_CODE (operands[2]) == CONST_INT
+ /* Avoid overflows. */
+ && ((INTVAL (operands[2]) & ((((unsigned int) 1) << 31) - 1)))
&& (INTVAL (operands[2]) == 128
|| (INTVAL (operands[2]) < 0
&& INTVAL (operands[2]) != -128)))
@@ -17870,6 +16860,30 @@
(const_string "lea")))
(set_attr "mode" "DI")])
+(define_insn "pro_epilogue_adjust_stack_rex64_2"
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (plus:DI (match_operand:DI 1 "register_operand" "0,r")
+ (match_operand:DI 3 "immediate_operand" "i,i")))
+ (use (match_operand:DI 2 "register_operand" "r,r"))
+ (clobber (reg:CC 17))
+ (clobber (mem:BLK (scratch)))]
+ "TARGET_64BIT"
+{
+ switch (get_attr_type (insn))
+ {
+ case TYPE_ALU:
+ return "add{q}\t{%2, %0|%0, %2}";
+
+ case TYPE_LEA:
+ operands[2] = gen_rtx_PLUS (DImode, operands[1], operands[2]);
+ return "lea{q}\t{%a2, %0|%0, %a2}";
+
+ default:
+ abort ();
+ }
+}
+ [(set_attr "type" "alu,lea")
+ (set_attr "mode" "DI")])
;; Placeholder for the conditional moves. This one is split either to SSE
;; based moves emulation or to usual cmove sequence. Little bit unfortunate
@@ -18154,33 +17168,61 @@
[(match_operand:SI 0 "register_operand" "")]
"TARGET_STACK_PROBE"
{
- if (TARGET_64BIT)
- emit_insn (gen_allocate_stack_worker_rex64 (operands[0]));
+ if (reload_completed)
+ {
+ if (TARGET_64BIT)
+ emit_insn (gen_allocate_stack_worker_rex64_postreload (operands[0]));
+ else
+ emit_insn (gen_allocate_stack_worker_postreload (operands[0]));
+ }
else
- emit_insn (gen_allocate_stack_worker_1 (operands[0]));
+ {
+ if (TARGET_64BIT)
+ emit_insn (gen_allocate_stack_worker_rex64 (operands[0]));
+ else
+ emit_insn (gen_allocate_stack_worker_1 (operands[0]));
+ }
DONE;
})
(define_insn "allocate_stack_worker_1"
[(unspec:SI [(match_operand:SI 0 "register_operand" "a")] UNSPEC_STACK_PROBE)
(set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0)))
- (clobber (match_dup 0))
+ (clobber (match_scratch:SI 1 "=0"))
(clobber (reg:CC 17))]
"!TARGET_64BIT && TARGET_STACK_PROBE"
"call\t__alloca"
[(set_attr "type" "multi")
(set_attr "length" "5")])
+(define_expand "allocate_stack_worker_postreload"
+ [(parallel [(unspec:SI [(match_operand:SI 0 "register_operand" "a")]
+ UNSPEC_STACK_PROBE)
+ (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0)))
+ (clobber (match_dup 0))
+ (clobber (reg:CC 17))])]
+ ""
+ "")
+
(define_insn "allocate_stack_worker_rex64"
[(unspec:DI [(match_operand:DI 0 "register_operand" "a")] UNSPEC_STACK_PROBE)
(set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0)))
- (clobber (match_dup 0))
+ (clobber (match_scratch:DI 1 "=0"))
(clobber (reg:CC 17))]
"TARGET_64BIT && TARGET_STACK_PROBE"
"call\t__alloca"
[(set_attr "type" "multi")
(set_attr "length" "5")])
+(define_expand "allocate_stack_worker_rex64_postreload"
+ [(parallel [(unspec:DI [(match_operand:DI 0 "register_operand" "a")]
+ UNSPEC_STACK_PROBE)
+ (set (reg:DI 7) (minus:DI (reg:DI 7) (match_dup 0)))
+ (clobber (match_dup 0))
+ (clobber (reg:CC 17))])]
+ ""
+ "")
+
(define_expand "allocate_stack"
[(parallel [(set (match_operand:SI 0 "register_operand" "=r")
(minus:SI (reg:SI 7)
@@ -19524,6 +18566,18 @@
DONE;
})
+(define_expand "movtf"
+ [(set (match_operand:TF 0 "nonimmediate_operand" "")
+ (match_operand:TF 1 "nonimmediate_operand" ""))]
+ "TARGET_64BIT"
+{
+ if (TARGET_64BIT)
+ ix86_expand_move (TFmode, operands);
+ else
+ ix86_expand_vector_move (TFmode, operands);
+ DONE;
+})
+
(define_insn "movv2df_internal"
[(set (match_operand:V2DF 0 "nonimmediate_operand" "=x,x,m")
(match_operand:V2DF 1 "vector_move_operand" "C,xm,x"))]
@@ -19909,6 +18963,50 @@
(const_string "TI"))]
(const_string "DI")))])
+(define_insn "*movtf_rex64"
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=r,o,x,x,xm")
+ (match_operand:TF 1 "general_operand" "riFo,riF,C,xm,x"))]
+ "TARGET_64BIT
+ && (GET_CODE (operands[0]) != MEM || GET_CODE (operands[1]) != MEM)"
+{
+ switch (which_alternative)
+ {
+ case 0:
+ case 1:
+ return "#";
+ case 2:
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "xorps\t%0, %0";
+ else
+ return "pxor\t%0, %0";
+ case 3:
+ case 4:
+ if (get_attr_mode (insn) == MODE_V4SF)
+ return "movaps\t{%1, %0|%0, %1}";
+ else
+ return "movdqa\t{%1, %0|%0, %1}";
+ default:
+ abort ();
+ }
+}
+ [(set_attr "type" "*,*,ssemov,ssemov,ssemov")
+ (set (attr "mode")
+ (cond [(eq_attr "alternative" "2,3")
+ (if_then_else
+ (ne (symbol_ref "optimize_size")
+ (const_int 0))
+ (const_string "V4SF")
+ (const_string "TI"))
+ (eq_attr "alternative" "4")
+ (if_then_else
+ (ior (ne (symbol_ref "TARGET_SSE_TYPELESS_STORES")
+ (const_int 0))
+ (ne (symbol_ref "optimize_size")
+ (const_int 0)))
+ (const_string "V4SF")
+ (const_string "TI"))]
+ (const_string "DI")))])
+
(define_split
[(set (match_operand:TI 0 "nonimmediate_operand" "")
(match_operand:TI 1 "general_operand" ""))]
@@ -19917,6 +19015,14 @@
[(const_int 0)]
"ix86_split_long_move (operands); DONE;")
+(define_split
+ [(set (match_operand:TF 0 "nonimmediate_operand" "")
+ (match_operand:TF 1 "general_operand" ""))]
+ "reload_completed && !SSE_REG_P (operands[0])
+ && !SSE_REG_P (operands[1])"
+ [(const_int 0)]
+ "ix86_split_long_move (operands); DONE;")
+
;; These two patterns are useful for specifying exactly whether to use
;; movaps or movups
(define_expand "sse_movaps"
diff --git a/gcc/config/i386/i386elf.h b/gcc/config/i386/i386elf.h
index b484126b6af..ed6b41aa9b3 100644
--- a/gcc/config/i386/i386elf.h
+++ b/gcc/config/i386/i386elf.h
@@ -65,13 +65,13 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
- register const unsigned char *_ascii_bytes = \
+ const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
- register const unsigned char *limit = _ascii_bytes + (LENGTH); \
- register unsigned bytes_in_chunk = 0; \
+ const unsigned char *limit = _ascii_bytes + (LENGTH); \
+ unsigned bytes_in_chunk = 0; \
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
- register const unsigned char *p; \
+ const unsigned char *p; \
if (bytes_in_chunk >= 64) \
{ \
fputc ('\n', (FILE)); \
diff --git a/gcc/config/i386/linux-aout.h b/gcc/config/i386/linux-aout.h
index b286b800fa6..d7be93c7312 100644
--- a/gcc/config/i386/linux-aout.h
+++ b/gcc/config/i386/linux-aout.h
@@ -26,10 +26,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=posix"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
index 493d64f7974..e7d19ec181a 100644
--- a/gcc/config/i386/linux.h
+++ b/gcc/config/i386/linux.h
@@ -73,10 +73,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=posix"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
index 416561733c1..98536c19bd3 100644
--- a/gcc/config/i386/linux64.h
+++ b/gcc/config/i386/linux64.h
@@ -24,10 +24,7 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=posix"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/i386/ptx4-i.h b/gcc/config/i386/ptx4-i.h
index 65beba0711a..5fcd074f48b 100644
--- a/gcc/config/i386/ptx4-i.h
+++ b/gcc/config/i386/ptx4-i.h
@@ -57,13 +57,13 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
- register const unsigned char *_ascii_bytes = \
+ const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
- register const unsigned char *limit = _ascii_bytes + (LENGTH); \
- register unsigned bytes_in_chunk = 0; \
+ const unsigned char *limit = _ascii_bytes + (LENGTH); \
+ unsigned bytes_in_chunk = 0; \
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
- register const unsigned char *p; \
+ const unsigned char *p; \
if (bytes_in_chunk >= 64) \
{ \
fputc ('\n', (FILE)); \
diff --git a/gcc/config/i386/sco5.h b/gcc/config/i386/sco5.h
index 54c761b1af5..bb872d5ec15 100644
--- a/gcc/config/i386/sco5.h
+++ b/gcc/config/i386/sco5.h
@@ -60,7 +60,6 @@ Boston, MA 02111-1307, USA. */
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
#define DWARF2_DEBUGGING_INFO 1
-#define DWARF_DEBUGGING_INFO 1
#define DBX_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
@@ -146,7 +145,7 @@ Boston, MA 02111-1307, USA. */
assume that /usr/gnu is the prefix for the GNU tools, because thats
where the SCO provided ones go. This is especially important for
include and library search path ordering. We want to look in /usr/gnu
- first, becuase frequently people are linking against -lintl, and they
+ first because frequently people are linking against -lintl, and they
MEAN to link with gettext. What they get is the SCO intl library. Its
a REAL pity that GNU gettext chose that name; perhaps in a future
version they can be persuaded to change it to -lgnuintl and have a
diff --git a/gcc/config/i386/scodbx.h b/gcc/config/i386/scodbx.h
deleted file mode 100644
index 7da93053256..00000000000
--- a/gcc/config/i386/scodbx.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Definitions for Intel 386 running SCO Unix System V,
- using dbx-in-coff encapsulation.
- Copyright (C) 1992, 1995, 1996, 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. */
-
-#include "i386/svr3dbx.h"
-
-/* Overridden defines for SCO systems from sco.h. */
-
-/* By default, target has a 80387, uses IEEE compatible arithmetic,
- and returns float values in the 387, ie,
- (TARGET_80387 | TARGET_FLOAT_RETURNS_IN_80387)
-
- SCO's software emulation of a 387 fails to handle the `fucomp'
- opcode. fucomp is only used when generating IEEE compliant code.
- So don't make TARGET_IEEE_FP default for SCO. */
-
-#undef TARGET_SUBTARGET_DEFAULT
-#define TARGET_SUBTARGET_DEFAULT (MASK_80387 | MASK_FLOAT_RETURNS)
-
-/* Use crt1.o as a startup file and crtn.o as a closing file. */
-
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
- "%{!r:%{!z:svr3.ifile%s}%{z:svr3z.ifile%s}}\
- %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}}"
-
-/* Library spec, including SCO international language support. */
-
-#undef LIB_SPEC
-#define LIB_SPEC \
- "%{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp} %{scointl:libintl.a%s} -lc"
-
-/* Specify predefined symbols in preprocessor. */
-
-#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Dunix -DM_UNIX -DM_I386 -DM_COFF -DM_WORDSWAP -Asystem=svr3"
-
-#undef CPP_SPEC
-#define CPP_SPEC "%(cpp_cpu) %{scointl:-DM_INTERNAT}"
-
-/* This spec is used for telling cpp whether char is signed or not. */
-
-#undef SIGNED_CHAR_SPEC
-#if DEFAULT_SIGNED_CHAR
-#define SIGNED_CHAR_SPEC \
- "%{funsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#else
-#define SIGNED_CHAR_SPEC \
- "%{!fsigned-char:-D__CHAR_UNSIGNED__ -D_CHAR_UNSIGNED}"
-#endif
-
-/* caller has to pop the extra argument passed to functions that return
- structures. */
-
-#undef RETURN_POPS_ARGS
-#define RETURN_POPS_ARGS(FUNDECL,FUNTYPE,SIZE) \
- ((FUNDECL) && TREE_CODE (FUNDECL) == IDENTIFIER_NODE ? 0 \
- : (TARGET_RTD \
- && (TYPE_ARG_TYPES (FUNTYPE) == 0 \
- || (TREE_VALUE (tree_last (TYPE_ARG_TYPES (FUNTYPE))) \
- == void_type_node))) ? (SIZE) \
- : 0)
-/* On other 386 systems, the last line looks like this:
- : (aggregate_value_p (TREE_TYPE (FUNTYPE))) ? GET_MODE_SIZE (Pmode) : 0) */
-
-/* Handle #pragma pack. */
-#define HANDLE_SYSV_PRAGMA
diff --git a/gcc/config/i386/sysv4.h b/gcc/config/i386/sysv4.h
index 18eadf52592..244700637ec 100644
--- a/gcc/config/i386/sysv4.h
+++ b/gcc/config/i386/sysv4.h
@@ -52,13 +52,13 @@ Boston, MA 02111-1307, USA. */
#define ASM_OUTPUT_ASCII(FILE, STR, LENGTH) \
do \
{ \
- register const unsigned char *_ascii_bytes = \
+ const unsigned char *_ascii_bytes = \
(const unsigned char *) (STR); \
- register const unsigned char *limit = _ascii_bytes + (LENGTH); \
- register unsigned bytes_in_chunk = 0; \
+ const unsigned char *limit = _ascii_bytes + (LENGTH); \
+ unsigned bytes_in_chunk = 0; \
for (; _ascii_bytes < limit; _ascii_bytes++) \
{ \
- register const unsigned char *p; \
+ const unsigned char *p; \
if (bytes_in_chunk >= 64) \
{ \
fputc ('\n', (FILE)); \
diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h
index e49086a2328..16b06331b98 100644
--- a/gcc/config/i386/x86-64.h
+++ b/gcc/config/i386/x86-64.h
@@ -68,7 +68,6 @@ Boston, MA 02111-1307, USA. */
/* i386 System V Release 4 uses DWARF debugging info.
x86-64 ABI specifies DWARF2. */
-#undef DWARF_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO 1
#define DWARF2_UNWIND_INFO 1
/* Incorrectly autodetected in cross compilation. */
diff --git a/gcc/config/i386/xm-dgux.h b/gcc/config/i386/xm-dgux.h
deleted file mode 100644
index 881c5c7be9d..00000000000
--- a/gcc/config/i386/xm-dgux.h
+++ /dev/null
@@ -1,4 +0,0 @@
-/* Configuration for GCC for Intel i386 running DG/ux */
-
-/* looks just like sysv4 for now */
-#include "xm-svr4.h"
diff --git a/gcc/config/i386/xm-sun.h b/gcc/config/i386/xm-sun.h
deleted file mode 100644
index 6c0f0a25630..00000000000
--- a/gcc/config/i386/xm-sun.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Configuration for GNU C-compiler for Intel 80386 running SunOS 4.0.
- Copyright (C) 1988, 1997 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. */
-
-#define USG
diff --git a/gcc/config/i386/xm-sysv3.h b/gcc/config/i386/xm-sysv3.h
deleted file mode 100644
index 9a655443ff5..00000000000
--- a/gcc/config/i386/xm-sysv3.h
+++ /dev/null
@@ -1,3 +0,0 @@
-/* Configuration for GCC for Intel i386 running System V Release 3. */
-
-#include "xm-svr3.h"
diff --git a/gcc/config/i860/i860-protos.h b/gcc/config/i860/i860-protos.h
index e29a5cd4895..74568af66b5 100644
--- a/gcc/config/i860/i860-protos.h
+++ b/gcc/config/i860/i860-protos.h
@@ -51,9 +51,5 @@ extern rtx i860_va_arg (tree, tree);
#endif /* TREE_CODE */
#endif /* RTX_CODE */
-#ifdef TREE_CODE
-extern tree i860_build_va_list (void);
-#endif /* TREE_CODE */
-
extern void tdesc_section (void);
diff --git a/gcc/config/i860/i860.c b/gcc/config/i860/i860.c
index a8585eff404..9946f261c7c 100644
--- a/gcc/config/i860/i860.c
+++ b/gcc/config/i860/i860.c
@@ -1813,8 +1813,8 @@ i860_saveregs (void)
The tree representing the va_list declaration is returned. */
-tree
-i860_build_va_list (void)
+static tree
+i860_build_builtin_va_list (void)
{
tree f_gpr, f_fpr, f_mem, f_sav, record, type_decl;
@@ -2117,5 +2117,7 @@ i860_init_libfuncs (void)
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS i860_init_libfuncs
-struct gcc_target targetm = TARGET_INITIALIZER;
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST i860_build_builtin_va_list
+struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/i860/i860.h b/gcc/config/i860/i860.h
index b5575ec7f1c..c600f0276ec 100644
--- a/gcc/config/i860/i860.h
+++ b/gcc/config/i860/i860.h
@@ -571,10 +571,6 @@ struct cumulative_args { int ints, floats; };
#define EXPAND_BUILTIN_SAVEREGS() \
i860_saveregs()
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = i860_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
i860_va_start (valist, nextarg)
diff --git a/gcc/config/i960/i960-protos.h b/gcc/config/i960/i960-protos.h
index 5a46c4a841d..269a40be19c 100644
--- a/gcc/config/i960/i960-protos.h
+++ b/gcc/config/i960/i960-protos.h
@@ -26,78 +26,77 @@ Boston, MA 02111-1307, USA. */
#define GCC_I960_PROTOS_H
#ifdef RTX_CODE
-extern struct rtx_def *legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
+extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode);
/* Define the function that build the compare insn for scc and bcc. */
-extern struct rtx_def *gen_compare_reg PARAMS ((enum rtx_code, rtx, rtx));
+extern struct rtx_def *gen_compare_reg (enum rtx_code, rtx, rtx);
/* Define functions in i960.c and used in insn-output.c. */
-extern const char *i960_output_ldconst PARAMS ((rtx, rtx));
-extern const char *i960_output_call_insn PARAMS ((rtx, rtx, rtx, rtx));
-extern const char *i960_output_ret_insn PARAMS ((rtx));
-extern const char *i960_output_move_double PARAMS ((rtx, rtx));
-extern const char *i960_output_move_double_zero PARAMS ((rtx));
-extern const char *i960_output_move_quad PARAMS ((rtx, rtx));
-extern const char *i960_output_move_quad_zero PARAMS ((rtx));
+extern const char *i960_output_ldconst (rtx, rtx);
+extern const char *i960_output_call_insn (rtx, rtx, rtx, rtx);
+extern const char *i960_output_ret_insn (rtx);
+extern const char *i960_output_move_double (rtx, rtx);
+extern const char *i960_output_move_double_zero (rtx);
+extern const char *i960_output_move_quad (rtx, rtx);
+extern const char *i960_output_move_quad_zero (rtx);
-extern int literal PARAMS ((rtx, enum machine_mode));
-extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
-extern int fp_literal PARAMS ((rtx, enum machine_mode));
-extern int signed_literal PARAMS ((rtx, enum machine_mode));
-extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
-extern void i960_print_operand PARAMS ((FILE *, rtx, int));
-extern int fpmove_src_operand PARAMS ((rtx, enum machine_mode));
-extern int arith_operand PARAMS ((rtx, enum machine_mode));
-extern int logic_operand PARAMS ((rtx, enum machine_mode));
-extern int fp_arith_operand PARAMS ((rtx, enum machine_mode));
-extern int signed_arith_operand PARAMS ((rtx, enum machine_mode));
-extern int fp_literal_one PARAMS ((rtx, enum machine_mode));
-extern int fp_literal_zero PARAMS ((rtx, enum machine_mode));
-extern int symbolic_memory_operand PARAMS ((rtx, enum machine_mode));
-extern int eq_or_neq PARAMS ((rtx, enum machine_mode));
-extern int arith32_operand PARAMS ((rtx, enum machine_mode));
-extern int power2_operand PARAMS ((rtx, enum machine_mode));
-extern int cmplpower2_operand PARAMS ((rtx, enum machine_mode));
-extern enum machine_mode select_cc_mode PARAMS ((RTX_CODE, rtx));
-extern int emit_move_sequence PARAMS ((rtx *, enum machine_mode));
-extern int i960_bypass PARAMS ((rtx, rtx, rtx, int));
-extern void i960_print_operand_addr PARAMS ((FILE *, rtx));
-extern int i960_expr_alignment PARAMS ((rtx, int));
-extern int i960_improve_align PARAMS ((rtx, rtx, int));
-extern int i960_si_ti PARAMS ((rtx, rtx));
-extern int i960_si_di PARAMS ((rtx, rtx));
+extern int literal (rtx, enum machine_mode);
+extern int hard_regno_mode_ok (int, enum machine_mode);
+extern int fp_literal (rtx, enum machine_mode);
+extern int signed_literal (rtx, enum machine_mode);
+extern int legitimate_address_p (enum machine_mode, rtx, int);
+extern void i960_print_operand (FILE *, rtx, int);
+extern int fpmove_src_operand (rtx, enum machine_mode);
+extern int arith_operand (rtx, enum machine_mode);
+extern int logic_operand (rtx, enum machine_mode);
+extern int fp_arith_operand (rtx, enum machine_mode);
+extern int signed_arith_operand (rtx, enum machine_mode);
+extern int fp_literal_one (rtx, enum machine_mode);
+extern int fp_literal_zero (rtx, enum machine_mode);
+extern int symbolic_memory_operand (rtx, enum machine_mode);
+extern int eq_or_neq (rtx, enum machine_mode);
+extern int arith32_operand (rtx, enum machine_mode);
+extern int power2_operand (rtx, enum machine_mode);
+extern int cmplpower2_operand (rtx, enum machine_mode);
+extern enum machine_mode select_cc_mode (RTX_CODE, rtx);
+extern int emit_move_sequence (rtx *, enum machine_mode);
+extern int i960_bypass (rtx, rtx, rtx, int);
+extern void i960_print_operand_addr (FILE *, rtx);
+extern int i960_expr_alignment (rtx, int);
+extern int i960_improve_align (rtx, rtx, int);
+extern int i960_si_ti (rtx, rtx);
+extern int i960_si_di (rtx, rtx);
#ifdef TREE_CODE
-extern struct rtx_def *i960_function_arg PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode,
- tree, int));
-extern rtx i960_va_arg PARAMS ((tree, tree));
-extern void i960_va_start PARAMS ((tree, rtx));
+extern struct rtx_def *i960_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode,
+ tree, int);
+extern rtx i960_va_arg (tree, tree);
+extern void i960_va_start (tree, rtx);
#endif /* TREE_CODE */
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class, enum machine_mode, rtx));
+extern enum reg_class secondary_reload_class (enum reg_class, enum machine_mode, rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern void i960_function_name_declare PARAMS ((FILE *, const char *, tree));
-extern void i960_function_arg_advance PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int));
-extern int i960_round_align PARAMS ((int, tree));
-extern void i960_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int));
-extern tree i960_build_va_list PARAMS ((void));
-extern int i960_final_reg_parm_stack_space PARAMS ((int, tree));
-extern int i960_reg_parm_stack_space PARAMS ((tree));
+extern void i960_function_name_declare (FILE *, const char *, tree);
+extern void i960_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern int i960_round_align (int, tree);
+extern void i960_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
+extern int i960_final_reg_parm_stack_space (int, tree);
+extern int i960_reg_parm_stack_space (tree);
#endif /* TREE_CODE */
-extern int process_pragma PARAMS ((int(*)(void), void(*)(int), const char *));
-extern int i960_object_bytes_bitalign PARAMS ((int));
-extern void i960_initialize PARAMS ((void));
-extern int bitpos PARAMS ((unsigned int));
-extern int is_mask PARAMS ((unsigned int));
-extern int bitstr PARAMS ((unsigned int, int *, int *));
-extern int compute_frame_size PARAMS ((int));
-extern void output_function_profiler PARAMS ((FILE *, int));
-extern void i960_scan_opcode PARAMS ((const char *));
+extern int process_pragma (int(*)(void), void(*)(int), const char *);
+extern int i960_object_bytes_bitalign (int);
+extern void i960_initialize (void);
+extern int bitpos (unsigned int);
+extern int is_mask (unsigned int);
+extern int bitstr (unsigned int, int *, int *);
+extern int compute_frame_size (int);
+extern void output_function_profiler (FILE *, int);
+extern void i960_scan_opcode (const char *);
-extern void i960_pr_align PARAMS ((struct cpp_reader *));
-extern void i960_pr_noalign PARAMS ((struct cpp_reader *));
+extern void i960_pr_align (struct cpp_reader *);
+extern void i960_pr_noalign (struct cpp_reader *);
#endif /* ! GCC_I960_PROTOS_H */
diff --git a/gcc/config/i960/i960.c b/gcc/config/i960/i960.c
index c1284f48da3..3d976b65fd4 100644
--- a/gcc/config/i960/i960.c
+++ b/gcc/config/i960/i960.c
@@ -46,12 +46,13 @@ Boston, MA 02111-1307, USA. */
#include "target.h"
#include "target-def.h"
-static void i960_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void i960_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void i960_output_mi_thunk PARAMS ((FILE *, tree, HOST_WIDE_INT,
- HOST_WIDE_INT, tree));
-static bool i960_rtx_costs PARAMS ((rtx, int, int, int *));
-static int i960_address_cost PARAMS ((rtx));
+static void i960_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void i960_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void i960_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
+ HOST_WIDE_INT, tree);
+static bool i960_rtx_costs (rtx, int, int, int *);
+static int i960_address_cost (rtx);
+static tree i960_build_builtin_va_list (void);
/* Save the operands last given to a compare for use when we
generate a scc or bcc insn. */
@@ -114,6 +115,9 @@ static int ret_label = 0;
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST i960_address_cost
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST i960_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Override conflicting target switch options.
@@ -1231,10 +1235,10 @@ struct reg_group
char length;
};
-static int i960_form_reg_groups PARAMS ((int, int, int *, int, struct reg_group *));
-static int i960_reg_group_compare PARAMS ((const void *, const void *));
-static int i960_split_reg_group PARAMS ((struct reg_group *, int, int));
-static void i960_arg_size_and_align PARAMS ((enum machine_mode, tree, int *, int *));
+static int i960_form_reg_groups (int, int, int *, int, struct reg_group *);
+static int i960_reg_group_compare (const void *, const void *);
+static int i960_split_reg_group (struct reg_group *, int, int);
+static void i960_arg_size_and_align (enum machine_mode, tree, int *, int *);
/* The following functions forms the biggest as possible register
groups with registers in STATE. REGS contain states of the
@@ -2600,8 +2604,8 @@ i960_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
/* Define the `__builtin_va_list' type for the ABI. */
-tree
-i960_build_va_list ()
+static tree
+i960_build_builtin_va_list ()
{
return build_array_type (unsigned_type_node,
build_index_type (size_one_node));
diff --git a/gcc/config/i960/i960.h b/gcc/config/i960/i960.h
index 767efeb7fce..ad86dba003b 100644
--- a/gcc/config/i960/i960.h
+++ b/gcc/config/i960/i960.h
@@ -817,10 +817,6 @@ enum reg_class { NO_REGS, GLOBAL_REGS, LOCAL_REGS, LOCAL_OR_GLOBAL_REGS,
#define SETUP_INCOMING_VARARGS(CUM,MODE,TYPE,PRETEND_SIZE,NO_RTL) \
i960_setup_incoming_varargs(&CUM,MODE,TYPE,&PRETEND_SIZE,NO_RTL)
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = i960_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
i960_va_start (valist, nextarg)
diff --git a/gcc/config/ia64/fde-glibc.c b/gcc/config/ia64/fde-glibc.c
index 8c9b55a1b1e..15e19270f03 100644
--- a/gcc/config/ia64/fde-glibc.c
+++ b/gcc/config/ia64/fde-glibc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+/* Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
Contributed by Richard Henderson <rth@cygnus.com>.
This file is part of GCC.
@@ -29,7 +29,7 @@
to avoid register/deregister calls at DSO load/unload. */
#ifndef _GNU_SOURCE
-#define _GNU_SOURCE
+#define _GNU_SOURCE 1
#endif
#include "config.h"
#include <stddef.h>
diff --git a/gcc/config/ia64/hpux.h b/gcc/config/ia64/hpux.h
index 382751a7c37..1bd02c35d73 100644
--- a/gcc/config/ia64/hpux.h
+++ b/gcc/config/ia64/hpux.h
@@ -45,6 +45,8 @@ do { \
builtin_define("_HPUX_SOURCE"); \
builtin_define("__STDC_EXT__"); \
} \
+ if (TARGET_ILP32) \
+ builtin_define("_ILP32"); \
} while (0)
#undef CPP_SPEC
@@ -188,6 +190,10 @@ do { \
#undef TARGET_SECTION_TYPE_FLAGS
#define TARGET_SECTION_TYPE_FLAGS ia64_rwreloc_section_type_flags
+/* HP-UX does not support thread-local storage. */
+#undef TARGET_HAVE_TLS
+#define TARGET_HAVE_TLS false
+
/* ia64 HPUX has the float and long double forms of math functions. */
#undef TARGET_C99_FUNCTIONS
#define TARGET_C99_FUNCTIONS 1
diff --git a/gcc/config/ia64/ia64.c b/gcc/config/ia64/ia64.c
index 7b0069d7fb0..67df9cb2b90 100644
--- a/gcc/config/ia64/ia64.c
+++ b/gcc/config/ia64/ia64.c
@@ -344,11 +344,6 @@ static const struct attribute_spec ia64_attribute_table[] =
#undef TARGET_SCHED_DFA_NEW_CYCLE
#define TARGET_SCHED_DFA_NEW_CYCLE ia64_dfa_new_cycle
-#ifdef HAVE_AS_TLS
-#undef TARGET_HAVE_TLS
-#define TARGET_HAVE_TLS true
-#endif
-
#undef TARGET_FUNCTION_OK_FOR_SIBCALL
#define TARGET_FUNCTION_OK_FOR_SIBCALL ia64_function_ok_for_sibcall
@@ -1465,6 +1460,8 @@ spill_xfmode_operand (rtx in, int force)
/* Emit comparison instruction if necessary, returning the expression
that holds the compare result in the proper mode. */
+static GTY(()) rtx cmptf_libfunc;
+
rtx
ia64_expand_compare (enum rtx_code code, enum machine_mode mode)
{
@@ -1480,6 +1477,59 @@ ia64_expand_compare (enum rtx_code code, enum machine_mode mode)
else
abort ();
}
+ /* HPUX TFmode compare requires a library call to _U_Qfcmp, which takes a
+ magic number as its third argument, that indicates what to do.
+ The return value is an integer to be compared against zero. */
+ else if (TARGET_HPUX && GET_MODE (op0) == TFmode)
+ {
+ enum qfcmp_magic {
+ QCMP_INV = 1, /* Raise FP_INVALID on SNaN as a side effect. */
+ QCMP_UNORD = 2,
+ QCMP_EQ = 4,
+ QCMP_LT = 8,
+ QCMP_GT = 16
+ } magic;
+ enum rtx_code ncode;
+ rtx ret, insns;
+ if (GET_MODE (op1) != TFmode)
+ abort ();
+ switch (code)
+ {
+ /* 1 = equal, 0 = not equal. Equality operators do
+ not raise FP_INVALID when given an SNaN operand. */
+ case EQ: magic = QCMP_EQ; ncode = NE; break;
+ case NE: magic = QCMP_EQ; ncode = EQ; break;
+ /* isunordered() from C99. */
+ case UNORDERED: magic = QCMP_UNORD; ncode = NE; break;
+ /* Relational operators raise FP_INVALID when given
+ an SNaN operand. */
+ case LT: magic = QCMP_LT |QCMP_INV; ncode = NE; break;
+ case LE: magic = QCMP_LT|QCMP_EQ|QCMP_INV; ncode = NE; break;
+ case GT: magic = QCMP_GT |QCMP_INV; ncode = NE; break;
+ case GE: magic = QCMP_GT|QCMP_EQ|QCMP_INV; ncode = NE; break;
+ /* FUTURE: Implement UNEQ, UNLT, UNLE, UNGT, UNGE, LTGT.
+ Expanders for buneq etc. weuld have to be added to ia64.md
+ for this to be useful. */
+ default: abort ();
+ }
+
+ start_sequence ();
+
+ ret = emit_library_call_value (cmptf_libfunc, 0, LCT_CONST, DImode, 3,
+ op0, TFmode, op1, TFmode,
+ GEN_INT (magic), DImode);
+ cmp = gen_reg_rtx (BImode);
+ emit_insn (gen_rtx_SET (VOIDmode, cmp,
+ gen_rtx_fmt_ee (ncode, BImode,
+ ret, const0_rtx)));
+
+ insns = get_insns ();
+ end_sequence ();
+
+ emit_libcall_block (insns, cmp, cmp,
+ gen_rtx_fmt_ee (code, BImode, op0, op1));
+ code = NE;
+ }
else
{
cmp = gen_reg_rtx (BImode);
@@ -3065,13 +3115,13 @@ ia64_hard_regno_rename_ok (int from, int to)
static bool
ia64_assemble_integer (rtx x, unsigned int size, int aligned_p)
{
- if (size == (TARGET_ILP32 ? 4 : 8)
+ if (size == POINTER_SIZE / BITS_PER_UNIT
&& aligned_p
&& !(TARGET_NO_PIC || TARGET_AUTO_PIC)
&& GET_CODE (x) == SYMBOL_REF
&& SYMBOL_REF_FUNCTION_P (x))
{
- if (TARGET_ILP32)
+ if (POINTER_SIZE == 32)
fputs ("\tdata4\t@fptr(", asm_out_file);
else
fputs ("\tdata8\t@fptr(", asm_out_file);
@@ -3227,7 +3277,8 @@ ia64_initialize_trampoline (rtx addr, rtx fnaddr, rtx static_chain)
if (!declared_ia64_trampoline)
{
declared_ia64_trampoline = true;
- fputs ("\t.global\t__ia64_trampoline\n", asm_out_file);
+ (*targetm.asm_out.globalize_label) (asm_out_file,
+ "__ia64_trampoline");
}
}
@@ -3471,9 +3522,10 @@ ia64_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
? 1 : GET_MODE_SIZE (gr_mode) / UNITS_PER_WORD;
}
- /* If we ended up using just one location, just return that one loc. */
+ /* If we ended up using just one location, just return that one loc, but
+ change the mode back to the argument mode. */
if (i == 1)
- return XEXP (loc[0], 0);
+ return gen_rtx_REG (mode, REGNO (XEXP (loc[0], 0)));
else
return gen_rtx_PARALLEL (mode, gen_rtvec_v (i, loc));
}
@@ -3690,8 +3742,12 @@ ia64_va_arg (tree valist, tree type)
/* Variable sized types are passed by reference. */
if (TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
{
- rtx addr = std_expand_builtin_va_arg (valist, build_pointer_type (type));
- return gen_rtx_MEM (ptr_mode, force_reg (Pmode, addr));
+ rtx addr = force_reg (ptr_mode,
+ std_expand_builtin_va_arg (valist, build_pointer_type (type)));
+#ifdef POINTERS_EXTEND_UNSIGNED
+ addr = convert_memory_address (Pmode, addr);
+#endif
+ return gen_rtx_MEM (ptr_mode, addr);
}
/* Arguments with alignment larger than 8 bytes start at the next even
@@ -4350,7 +4406,7 @@ ia64_asm_output_external (FILE *file, tree decl, const char *name)
if (TARGET_GNU_AS
&& (!TARGET_HPUX_LD
|| TREE_CODE (decl) != FUNCTION_DECL
- || strstr(name, "__builtin_") == name))
+ || strstr (name, "__builtin_") == name))
return;
/* ??? The Intel assembler creates a reference that needs to be satisfied by
@@ -4487,6 +4543,18 @@ ia64_override_options (void)
target_flags &= ~MASK_INLINE_INT_DIV_THR;
}
+ if (TARGET_INLINE_SQRT_LAT && TARGET_INLINE_SQRT_THR)
+ {
+ warning ("cannot optimize square root for both latency and throughput");
+ target_flags &= ~MASK_INLINE_SQRT_THR;
+ }
+
+ if (TARGET_INLINE_SQRT_LAT)
+ {
+ warning ("not yet implemented: latency-optimized inline square root");
+ target_flags &= ~MASK_INLINE_SQRT_LAT;
+ }
+
if (ia64_fixed_range_string)
fix_range (ia64_fixed_range_string);
@@ -4896,9 +4964,9 @@ set_src_needs_barrier (rtx x, struct reg_flags flags, int pred, rtx cond)
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. */
+/* Handle an access to rtx X of type FLAGS using predicate register
+ PRED. Return 1 if this access creates a dependency with an earlier
+ instruction in the same group. */
static int
rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
@@ -5124,7 +5192,9 @@ rtx_needs_barrier (rtx x, struct reg_flags flags, int pred)
case UNSPEC_FR_SPILL:
case UNSPEC_FR_RESTORE:
case UNSPEC_GETF_EXP:
+ case UNSPEC_SETF_EXP:
case UNSPEC_ADDP4:
+ case UNSPEC_FR_SQRT_RECIP_APPROX:
need_barrier = rtx_needs_barrier (XVECEXP (x, 0, 0), flags, pred);
break;
@@ -6491,13 +6561,44 @@ get_next_important_insn (rtx insn, rtx tail)
return NULL_RTX;
}
-/* The following function does insn bundling. Bundling algorithm is
- based on dynamic programming. It tries to insert different number of
- nop insns before/after the real insns. At the end of EBB, it chooses the
- best alternative and then, moving back in EBB, inserts templates for
- the best alternative. The algorithm is directed by information
- (changes of simulated processor cycle) created by the 2nd insn
- scheduling. */
+/* The following function does insn bundling. Bundling means
+ inserting templates and nop insns to fit insn groups into permitted
+ templates. Instruction scheduling uses NDFA (non-deterministic
+ finite automata) encoding informations about the templates and the
+ inserted nops. Nondeterminism of the automata permits follows
+ all possible insn sequences very fast.
+
+ Unfortunately it is not possible to get information about inserting
+ nop insns and used templates from the automata states. The
+ automata only says that we can issue an insn possibly inserting
+ some nops before it and using some template. Therefore insn
+ bundling in this function is implemented by using DFA
+ (deterministic finite automata). We follows all possible insn
+ sequences by inserting 0-2 nops (that is what the NDFA describe for
+ insn scheduling) before/after each insn being bundled. We know the
+ start of simulated processor cycle from insn scheduling (insn
+ starting a new cycle has TImode).
+
+ Simple implementation of insn bundling would create enormous
+ number of possible insn sequences satisfying information about new
+ cycle ticks taken from the insn scheduling. To make the algorithm
+ practical we use dynamic programming. Each decision (about
+ inserting nops and implicitly about previous decisions) is described
+ by structure bundle_state (see above). If we generate the same
+ bundle state (key is automaton state after issuing the insns and
+ nops for it), we reuse already generated one. As consequence we
+ reject some decisions which can not improve the solution and
+ reduce memory for the algorithm.
+
+ When we reach the end of EBB (extended basic block), we choose the
+ best sequence and then, moving back in EBB, insert templates for
+ the best alternative. The templates are taken from querying
+ automaton state for each insn in chosen bundle states.
+
+ So the algorithm makes two (forward and backward) passes through
+ EBB. There is an additional forward pass through EBB for Itanium1
+ processor. This pass inserts more nops to make dependency between
+ a producer insn and MMMUL/MMSHF at least 4 cycles long. */
static void
bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
@@ -6512,6 +6613,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
enum attr_type type;
insn_num = 0;
+ /* Count insns in the EBB. */
for (insn = NEXT_INSN (prev_head_insn);
insn && insn != tail;
insn = NEXT_INSN (insn))
@@ -6524,7 +6626,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
initiate_bundle_state_table ();
index_to_bundle_states = xmalloc ((insn_num + 2)
* sizeof (struct bundle_state *));
- /* First (forward) pass -- generates states. */
+ /* First (forward) pass -- generation of bundle states. */
curr_state = get_free_bundle_state ();
curr_state->insn = NULL;
curr_state->before_nops_num = 0;
@@ -6538,6 +6640,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
state_reset (curr_state->dfa_state);
index_to_bundle_states [0] = curr_state;
insn_num = 0;
+ /* Shift cycle mark if it is put on insn which could be ignored. */
for (insn = NEXT_INSN (prev_head_insn);
insn != tail;
insn = NEXT_INSN (insn))
@@ -6560,6 +6663,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
break;
}
}
+ /* Froward pass: generation of bundle states. */
for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail);
insn != NULL_RTX;
insn = next_insn)
@@ -6579,19 +6683,25 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
{
pos = curr_state->accumulated_insns_num % 3;
next_state = curr_state->next;
- /* Finish the current bundle in order to start a subsequent
- asm insn in a new bundle. */
+ /* We must fill up the current bundle in order to start a
+ subsequent asm insn in a new bundle. Asm insn is always
+ placed in a separate bundle. */
only_bundle_end_p
= (next_insn != NULL_RTX
&& INSN_CODE (insn) == CODE_FOR_insn_group_barrier
&& ia64_safe_type (next_insn) == TYPE_UNKNOWN);
+ /* We may fill up the current bundle if it is the cycle end
+ without a group barrier. */
bundle_end_p
= (only_bundle_end_p || next_insn == NULL_RTX
|| (GET_MODE (next_insn) == TImode
&& INSN_CODE (insn) != CODE_FOR_insn_group_barrier));
if (type == TYPE_F || type == TYPE_B || type == TYPE_L
|| type == TYPE_S
- /* We need to insert 2 Nops for cases like M_MII. */
+ /* We need to insert 2 nops for cases like M_MII. To
+ guarantee issuing all insns on the same cycle for
+ Itanium 1, we need to issue 2 nops after the first M
+ insn (MnnMII where n is a nop insn). */
|| (type == TYPE_M && ia64_tune == PROCESSOR_ITANIUM
&& !bundle_end_p && pos == 1))
issue_nops_and_insn (curr_state, 2, insn, bundle_end_p,
@@ -6608,6 +6718,10 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
curr_state = curr_state->next)
if (verbose >= 2 && dump)
{
+ /* This structure is taken from generated code of the
+ pipeline hazard recognizer (see file insn-attrtab.c).
+ Please don't forget to change the structure if a new
+ automaton is added to .md file. */
struct DFA_chip
{
unsigned short one_automaton_state;
@@ -6632,12 +6746,18 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
}
}
if (index_to_bundle_states [insn_num] == NULL)
+ /* We should find a solution because the 2nd insn scheduling has
+ found one. */
abort ();
- /* Finding state with a minimal cost: */
+ /* Find a state corresponding to the best insn sequence. */
best_state = NULL;
for (curr_state = index_to_bundle_states [insn_num];
curr_state != NULL;
curr_state = curr_state->next)
+ /* We are just looking at the states with fully filled up last
+ bundle. The first we prefer insn sequences with minimal cost
+ then with minimal inserted nops and finally with branch insns
+ placed in the 3rd slots. */
if (curr_state->accumulated_insns_num % 3 == 0
&& (best_state == NULL || best_state->cost > curr_state->cost
|| (best_state->cost == curr_state->cost
@@ -6648,7 +6768,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
&& curr_state->branch_deviation
< best_state->branch_deviation)))))
best_state = curr_state;
- /* Second (backward) pass: adding nops and templates: */
+ /* Second (backward) pass: adding nops and templates. */
insn_num = best_state->before_nops_num;
template0 = template1 = -1;
for (curr_state = best_state;
@@ -6683,9 +6803,17 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
: ((struct DFA_chip *) curr_state->dfa_state)->twob_automaton_state),
INSN_UID (insn));
}
+ /* Find the position in the current bundle window. The window can
+ contain at most two bundles. Two bundle window means that
+ the processor will make two bundle rotation. */
max_pos = get_max_pos (curr_state->dfa_state);
- if (max_pos == 6 || (max_pos == 3 && template0 < 0))
+ if (max_pos == 6
+ /* The following (negative template number) means that the
+ processor did one bundle rotation. */
+ || (max_pos == 3 && template0 < 0))
{
+ /* We are at the end of the window -- find template(s) for
+ its bundle(s). */
pos = max_pos;
if (max_pos == 3)
template0 = get_template (curr_state->dfa_state, 3);
@@ -6696,6 +6824,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
}
}
if (max_pos > 3 && template1 < 0)
+ /* It may happen when we have the stop inside a bundle. */
{
if (pos > 3)
abort ();
@@ -6703,6 +6832,7 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
pos += 3;
}
if (!asm_p)
+ /* Emit nops after the current insn. */
for (i = 0; i < curr_state->after_nops_num; i++)
{
nop = gen_nop ();
@@ -6712,18 +6842,26 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
abort ();
if (pos % 3 == 0)
{
+ /* We are at the start of a bundle: emit the template
+ (it should be defined). */
if (template0 < 0)
abort ();
b = gen_bundle_selector (GEN_INT (template0));
ia64_emit_insn_before (b, nop);
+ /* If we have two bundle window, we make one bundle
+ rotation. Otherwise template0 will be undefined
+ (negative value). */
template0 = template1;
template1 = -1;
}
}
+ /* Move the position backward in the window. Group barrier has
+ no slot. Asm insn takes all bundle. */
if (INSN_CODE (insn) != CODE_FOR_insn_group_barrier
&& GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0)
pos--;
+ /* Long insn takes 2 slots. */
if (ia64_safe_type (insn) == TYPE_L)
pos--;
if (pos < 0)
@@ -6733,15 +6871,20 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
&& GET_CODE (PATTERN (insn)) != ASM_INPUT
&& asm_noperands (PATTERN (insn)) < 0)
{
+ /* The current insn is at the bundle start: emit the
+ template. */
if (template0 < 0)
abort ();
b = gen_bundle_selector (GEN_INT (template0));
ia64_emit_insn_before (b, insn);
b = PREV_INSN (insn);
insn = b;
+ /* See comment above in analogous place for emiting nops
+ after the insn. */
template0 = template1;
template1 = -1;
}
+ /* Emit nops after the current insn. */
for (i = 0; i < curr_state->before_nops_num; i++)
{
nop = gen_nop ();
@@ -6753,6 +6896,8 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
abort ();
if (pos % 3 == 0)
{
+ /* See comment above in analogous place for emiting nops
+ after the insn. */
if (template0 < 0)
abort ();
b = gen_bundle_selector (GEN_INT (template0));
@@ -6765,7 +6910,11 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
}
}
if (ia64_tune == PROCESSOR_ITANIUM)
- /* Insert additional cycles for MM-insns: */
+ /* Insert additional cycles for MM-insns (MMMUL and MMSHF).
+ Itanium1 has a strange design, if the distance between an insn
+ and dependent MM-insn is less 4 then we have a 6 additional
+ cycles stall. So we make the distance equal to 4 cycles if it
+ is less. */
for (insn = get_next_important_insn (NEXT_INSN (prev_head_insn), tail);
insn != NULL_RTX;
insn = next_insn)
@@ -6777,11 +6926,16 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
abort ();
next_insn = get_next_important_insn (NEXT_INSN (insn), tail);
if (INSN_UID (insn) < clocks_length && add_cycles [INSN_UID (insn)])
+ /* We found a MM-insn which needs additional cycles. */
{
rtx last;
int i, j, n;
int pred_stop_p;
+ /* Now we are searching for a template of the bundle in
+ which the MM-insn is placed and the position of the
+ insn in the bundle (0, 1, 2). Also we are searching
+ for that there is a stop before the insn. */
last = prev_active_insn (insn);
pred_stop_p = recog_memoized (last) == CODE_FOR_insn_group_barrier;
if (pred_stop_p)
@@ -6792,17 +6946,27 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
{
template0 = XINT (XVECEXP (PATTERN (last), 0, 0), 0);
if (template0 == 9)
+ /* The insn is in MLX bundle. Change the template
+ onto MFI because we will add nops before the
+ insn. It simplifies subsequent code a lot. */
PATTERN (last)
= gen_bundle_selector (GEN_INT (2)); /* -> MFI */
break;
}
else if (recog_memoized (last) != CODE_FOR_insn_group_barrier)
n++;
+ /* Some check of correctness: the stop is not at the
+ bundle start, there are no more 3 insns in the bundle,
+ and the MM-insn is not at the start of bundle with
+ template MLX. */
if ((pred_stop_p && n == 0) || n > 2
|| (template0 == 9 && n != 0))
abort ();
+ /* Put nops after the insn in the bundle. */
for (j = 3 - n; j > 0; j --)
ia64_emit_insn_before (gen_nop (), insn);
+ /* It takes into account that we will add more N nops
+ before the insn lately -- please see code below. */
add_cycles [INSN_UID (insn)]--;
if (!pred_stop_p || add_cycles [INSN_UID (insn)])
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
@@ -6811,13 +6975,15 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
add_cycles [INSN_UID (insn)]--;
for (i = add_cycles [INSN_UID (insn)]; i > 0; i--)
{
- /* Insert .MII bundle. */
+ /* Insert "MII;" template. */
ia64_emit_insn_before (gen_bundle_selector (GEN_INT (0)),
insn);
ia64_emit_insn_before (gen_nop (), insn);
ia64_emit_insn_before (gen_nop (), insn);
if (i > 1)
{
+ /* To decrease code size, we use "MI;I;"
+ template. */
ia64_emit_insn_before
(gen_insn_group_barrier (GEN_INT (3)), insn);
i--;
@@ -6826,10 +6992,15 @@ bundling (FILE *dump, int verbose, rtx prev_head_insn, rtx tail)
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
}
+ /* Put the MM-insn in the same slot of a bundle with the
+ same template as the original one. */
ia64_emit_insn_before (gen_bundle_selector (GEN_INT (template0)),
insn);
+ /* To put the insn in the same slot, add necessary number
+ of nops. */
for (j = n; j > 0; j --)
ia64_emit_insn_before (gen_nop (), insn);
+ /* Put the stop if the original bundle had it. */
if (pred_stop_p)
ia64_emit_insn_before (gen_insn_group_barrier (GEN_INT (3)),
insn);
@@ -7074,7 +7245,7 @@ emit_predicate_relation_info (void)
FOR_EACH_BB_REVERSE (bb)
{
int r;
- rtx head = bb->head;
+ rtx head = BB_HEAD (bb);
/* We only need such notes at code labels. */
if (GET_CODE (head) != CODE_LABEL)
@@ -7088,8 +7259,8 @@ emit_predicate_relation_info (void)
{
rtx p = gen_rtx_REG (BImode, r);
rtx n = emit_insn_after (gen_pred_rel_mutex (p), head);
- if (head == bb->end)
- bb->end = n;
+ if (head == BB_END (bb))
+ BB_END (bb) = n;
head = n;
}
}
@@ -7100,7 +7271,7 @@ emit_predicate_relation_info (void)
the call. */
FOR_EACH_BB_REVERSE (bb)
{
- rtx insn = bb->head;
+ rtx insn = BB_HEAD (bb);
while (1)
{
@@ -7110,13 +7281,13 @@ emit_predicate_relation_info (void)
{
rtx b = emit_insn_before (gen_safe_across_calls_all (), insn);
rtx a = emit_insn_after (gen_safe_across_calls_normal (), insn);
- if (bb->head == insn)
- bb->head = b;
- if (bb->end == insn)
- bb->end = a;
+ if (BB_HEAD (bb) == insn)
+ BB_HEAD (bb) = b;
+ if (BB_END (bb) == insn)
+ BB_END (bb) = a;
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
insn = NEXT_INSN (insn);
}
@@ -7344,6 +7515,10 @@ ia64_in_small_data_p (tree exp)
if (TREE_CODE (exp) == STRING_CST)
return false;
+ /* Functions are never small data. */
+ if (TREE_CODE (exp) == FUNCTION_DECL)
+ return false;
+
if (TREE_CODE (exp) == VAR_DECL && DECL_SECTION_NAME (exp))
{
const char *section = TREE_STRING_POINTER (DECL_SECTION_NAME (exp));
@@ -8324,12 +8499,16 @@ ia64_hpux_init_libfuncs (void)
set_optab_libfunc (abs_optab, TFmode, "_U_Qfabs");
set_optab_libfunc (neg_optab, TFmode, "_U_Qfneg");
- set_optab_libfunc (eq_optab, TFmode, "_U_Qfeq");
- set_optab_libfunc (ne_optab, TFmode, "_U_Qfne");
- set_optab_libfunc (gt_optab, TFmode, "_U_Qfgt");
- set_optab_libfunc (ge_optab, TFmode, "_U_Qfge");
- set_optab_libfunc (lt_optab, TFmode, "_U_Qflt");
- set_optab_libfunc (le_optab, TFmode, "_U_Qfle");
+ /* ia64_expand_compare uses this. */
+ cmptf_libfunc = init_one_libfunc ("_U_Qfcmp");
+
+ /* These should never be used. */
+ set_optab_libfunc (eq_optab, TFmode, 0);
+ set_optab_libfunc (ne_optab, TFmode, 0);
+ set_optab_libfunc (gt_optab, TFmode, 0);
+ set_optab_libfunc (ge_optab, TFmode, 0);
+ set_optab_libfunc (lt_optab, TFmode, 0);
+ set_optab_libfunc (le_optab, TFmode, 0);
set_conv_libfunc (sext_optab, TFmode, SFmode, "_U_Qfcnvff_sgl_to_quad");
set_conv_libfunc (sext_optab, TFmode, DFmode, "_U_Qfcnvff_dbl_to_quad");
diff --git a/gcc/config/ia64/ia64.h b/gcc/config/ia64/ia64.h
index 8ccda53bd9b..84e864908c1 100644
--- a/gcc/config/ia64/ia64.h
+++ b/gcc/config/ia64/ia64.h
@@ -87,6 +87,10 @@ extern int target_flags;
#define MASK_INLINE_INT_DIV_THR 0x00001000 /* inline div, max throughput. */
+#define MASK_INLINE_SQRT_LAT 0x00002000 /* inline sqrt, min latency. */
+
+#define MASK_INLINE_SQRT_THR 0x00004000 /* inline sqrt, max throughput. */
+
#define MASK_DWARF2_ASM 0x40000000 /* test dwarf2 line info via gas. */
#define MASK_EARLY_STOP_BITS 0x00002000 /* tune stop bits for the model. */
@@ -127,8 +131,24 @@ extern int target_flags;
#define TARGET_INLINE_INT_DIV \
(target_flags & (MASK_INLINE_INT_DIV_LAT | MASK_INLINE_INT_DIV_THR))
+#define TARGET_INLINE_SQRT_LAT (target_flags & MASK_INLINE_SQRT_LAT)
+
+#define TARGET_INLINE_SQRT_THR (target_flags & MASK_INLINE_SQRT_THR)
+
+#define TARGET_INLINE_SQRT \
+ (target_flags & (MASK_INLINE_SQRT_LAT | MASK_INLINE_SQRT_THR))
+
#define TARGET_DWARF2_ASM (target_flags & MASK_DWARF2_ASM)
+/* If the assembler supports thread-local storage, assume that the
+ system does as well. If a particular target system has an
+ assembler that supports TLS -- but the rest of the system does not
+ support TLS -- that system should explicit define TARGET_HAVE_TLS
+ to false in its own configuration file. */
+#if !defined(TARGET_HAVE_TLS) && defined(HAVE_AS_TLS)
+#define TARGET_HAVE_TLS true
+#endif
+
extern int ia64_tls_size;
#define TARGET_TLS14 (ia64_tls_size == 14)
#define TARGET_TLS22 (ia64_tls_size == 22)
@@ -186,6 +206,10 @@ extern int ia64_tls_size;
N_("Generate inline integer division, optimize for latency") }, \
{ "inline-int-divide-max-throughput", MASK_INLINE_INT_DIV_THR, \
N_("Generate inline integer division, optimize for throughput") },\
+ { "inline-sqrt-min-latency", MASK_INLINE_SQRT_LAT, \
+ N_("Generate inline square root, optimize for latency") }, \
+ { "inline-sqrt-max-throughput", MASK_INLINE_SQRT_THR, \
+ N_("Generate inline square root, optimize for throughput") }, \
{ "dwarf2-asm", MASK_DWARF2_ASM, \
N_("Enable Dwarf 2 line debug info via GNU as")}, \
{ "no-dwarf2-asm", -MASK_DWARF2_ASM, \
@@ -1304,6 +1328,13 @@ enum reg_class
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
ia64_function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
+/* Nonzero if we do not know how to pass TYPE solely in registers. */
+
+#define MUST_PASS_IN_STACK(MODE, TYPE) \
+ ((TYPE) != 0 \
+ && (TREE_CODE (TYPE_SIZE (TYPE)) != INTEGER_CST \
+ || TREE_ADDRESSABLE (TYPE)))
+
/* A C type for declaring a variable that is used as the first argument of
`FUNCTION_ARG' and other related values. For some target machines, the type
`int' suffices and can hold the number of bytes of argument so far. */
@@ -1368,7 +1399,7 @@ do { \
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(REGNO) \
-(((REGNO) >= GR_ARG_FIRST && (REGNO) < (GR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
+(((REGNO) >= AR_ARG_FIRST && (REGNO) < (AR_ARG_FIRST + MAX_ARGUMENT_SLOTS)) \
|| ((REGNO) >= FR_ARG_FIRST && (REGNO) < (FR_ARG_FIRST + MAX_ARGUMENT_SLOTS)))
/* Implement `va_arg'. */
diff --git a/gcc/config/ia64/ia64.md b/gcc/config/ia64/ia64.md
index 547b7979862..01e4d73839e 100644
--- a/gcc/config/ia64/ia64.md
+++ b/gcc/config/ia64/ia64.md
@@ -74,6 +74,8 @@
(UNSPEC_ADDP4 24)
(UNSPEC_PROLOGUE_USE 25)
(UNSPEC_RET_ADDR 26)
+ (UNSPEC_SETF_EXP 27)
+ (UNSPEC_FR_SQRT_RECIP_APPROX 28)
])
(define_constants
@@ -2757,6 +2759,155 @@
operands[10] = CONST1_RTX (XFmode);
}
[(set_attr "predicable" "no")])
+
+;; Inline square root.
+
+(define_insn "*sqrt_approx"
+ [(set (match_operand:XF 0 "fr_register_operand" "=f")
+ (div:XF (const_int 1)
+ (sqrt:XF (match_operand:XF 2 "fr_register_operand" "f"))))
+ (set (match_operand:BI 1 "register_operand" "=c")
+ (unspec:BI [(match_dup 2)] UNSPEC_FR_SQRT_RECIP_APPROX))
+ (use (match_operand:SI 3 "const_int_operand" "")) ]
+ ""
+ "frsqrta.s%3 %0, %1 = %2"
+ [(set_attr "itanium_class" "fmisc")
+ (set_attr "predicable" "no")])
+
+(define_insn "*setf_exp_xf"
+ [(set (match_operand:XF 0 "fr_register_operand" "=f")
+ (unspec:XF [(match_operand:DI 1 "register_operand" "r")]
+ UNSPEC_SETF_EXP))]
+ ""
+ "setf.exp %0 = %1"
+ [(set_attr "itanium_class" "frfr")])
+
+(define_expand "sqrtsf2"
+ [(set (match_operand:SF 0 "fr_register_operand" "=&f")
+ (sqrt:SF (match_operand:SF 1 "fr_register_operand" "f")))]
+ "TARGET_INLINE_SQRT"
+{
+ rtx insn;
+ if (TARGET_INLINE_SQRT_LAT)
+#if 0
+ insn = gen_sqrtsf2_internal_lat (operands[0], operands[1]);
+#else
+ abort ();
+#endif
+ else
+ insn = gen_sqrtsf2_internal_thr (operands[0], operands[1]);
+ emit_insn (insn);
+ DONE;
+})
+
+;; Latency-optimized square root.
+;; FIXME: Implement.
+
+;; Throughput-optimized square root.
+
+(define_insn_and_split "sqrtsf2_internal_thr"
+ [(set (match_operand:SF 0 "fr_register_operand" "=&f")
+ (sqrt:SF (match_operand:SF 1 "fr_register_operand" "f")))
+ ;; Register r2 in optimization guide.
+ (clobber (match_scratch:DI 2 "=r"))
+ ;; Register f8 in optimization guide
+ (clobber (match_scratch:XF 3 "=&f"))
+ ;; Register f9 in optimization guide
+ (clobber (match_scratch:XF 4 "=&f"))
+ ;; Register f10 in optimization guide
+ (clobber (match_scratch:XF 5 "=&f"))
+ ;; Register p6 in optimization guide.
+ (clobber (match_scratch:BI 6 "=c"))]
+ "TARGET_INLINE_SQRT_THR"
+ "#"
+ "&& reload_completed"
+ [ ;; exponent of +1/2 in r2
+ (set (match_dup 2) (const_int 65534))
+ ;; +1/2 in f8
+ (set (match_dup 3)
+ (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP))
+ ;; Step 1
+ ;; y0 = 1/sqrt(a) in f7
+ (parallel [(set (match_dup 7)
+ (div:XF (const_int 1)
+ (sqrt:XF (match_dup 8))))
+ (set (match_dup 6)
+ (unspec:BI [(match_dup 8)]
+ UNSPEC_FR_SQRT_RECIP_APPROX))
+ (use (const_int 0))])
+ ;; Step 2
+ ;; H0 = 1/2 * y0 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 7))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 3
+ ;; S0 = a * y0 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 7)
+ (plus:XF (mult:XF (match_dup 8) (match_dup 7))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 4
+ ;; d = 1/2 - S0 * H0 in f10
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 5)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 4)))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 5
+ ;; d' = d + 1/2 * d in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 5))
+ (match_dup 5)))
+ (use (const_int 1))]))
+ ;; Step 6
+ ;; e = d + d * d' in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 3))
+ (match_dup 5)))
+ (use (const_int 1))]))
+ ;; Step 7
+ ;; S1 = S0 + e * S0 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 0)
+ (float_truncate:SF
+ (plus:XF (mult:XF (match_dup 3) (match_dup 7))
+ (match_dup 7))))
+ (use (const_int 1))]))
+ ;; Step 8
+ ;; H1 = H0 + e * H0 in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 4))
+ (match_dup 4)))
+ (use (const_int 1))]))
+ ;; Step 9
+ ;; d1 = a - S1 * S1 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7)))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 10
+ ;; S = S1 + d1 * H1 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 0)
+ (float_truncate:SF
+ (plus:XF (mult:XF (match_dup 4) (match_dup 3))
+ (match_dup 7))))
+ (use (const_int 0))]))]
+{
+ /* Generate 82-bit versions of the input and output operands. */
+ operands[7] = gen_rtx_REG (XFmode, REGNO (operands[0]));
+ operands[8] = gen_rtx_REG (XFmode, REGNO (operands[1]));
+ /* Generate required floating-point constants. */
+ operands[9] = CONST0_RTX (XFmode);
+}
+ [(set_attr "predicable" "no")])
;; ::::::::::::::::::::
;; ::
@@ -3102,6 +3253,155 @@
operands[10] = CONST1_RTX (XFmode);
}
[(set_attr "predicable" "no")])
+
+;; Inline square root.
+
+(define_expand "sqrtdf2"
+ [(set (match_operand:DF 0 "fr_register_operand" "=&f")
+ (sqrt:DF (match_operand:DF 1 "fr_register_operand" "f")))]
+ "TARGET_INLINE_SQRT"
+{
+ rtx insn;
+ if (TARGET_INLINE_SQRT_LAT)
+#if 0
+ insn = gen_sqrtdf2_internal_lat (operands[0], operands[1]);
+#else
+ abort ();
+#endif
+ else
+ insn = gen_sqrtdf2_internal_thr (operands[0], operands[1]);
+ emit_insn (insn);
+ DONE;
+})
+
+;; Latency-optimized square root.
+;; FIXME: Implement.
+
+;; Throughput-optimized square root.
+
+(define_insn_and_split "sqrtdf2_internal_thr"
+ [(set (match_operand:DF 0 "fr_register_operand" "=&f")
+ (sqrt:DF (match_operand:DF 1 "fr_register_operand" "f")))
+ ;; Register r2 in optimization guide.
+ (clobber (match_scratch:DI 2 "=r"))
+ ;; Register f8 in optimization guide
+ (clobber (match_scratch:XF 3 "=&f"))
+ ;; Register f9 in optimization guide
+ (clobber (match_scratch:XF 4 "=&f"))
+ ;; Register f10 in optimization guide
+ (clobber (match_scratch:XF 5 "=&f"))
+ ;; Register p6 in optimization guide.
+ (clobber (match_scratch:BI 6 "=c"))]
+ "TARGET_INLINE_SQRT_THR"
+ "#"
+ "&& reload_completed"
+ [ ;; exponent of +1/2 in r2
+ (set (match_dup 2) (const_int 65534))
+ ;; +1/2 in f10
+ (set (match_dup 5)
+ (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP))
+ ;; Step 1
+ ;; y0 = 1/sqrt(a) in f7
+ (parallel [(set (match_dup 7)
+ (div:XF (const_int 1)
+ (sqrt:XF (match_dup 8))))
+ (set (match_dup 6)
+ (unspec:BI [(match_dup 8)]
+ UNSPEC_FR_SQRT_RECIP_APPROX))
+ (use (const_int 0))])
+ ;; Step 2
+ ;; H0 = 1/2 * y0 in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 7))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 3
+ ;; G0 = a * y0 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 7)
+ (plus:XF (mult:XF (match_dup 8) (match_dup 7))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 4
+ ;; r0 = 1/2 - G0 * H0 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3)))
+ (match_dup 5)))
+ (use (const_int 1))]))
+ ;; Step 5
+ ;; H1 = H0 + r0 * H0 in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 4) (match_dup 3))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 6
+ ;; G1 = G0 + r0 * G0 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 7)
+ (plus:XF (mult:XF (match_dup 4) (match_dup 7))
+ (match_dup 7)))
+ (use (const_int 1))]))
+ ;; Step 7
+ ;; r1 = 1/2 - G1 * H1 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 3)))
+ (match_dup 5)))
+ (use (const_int 1))]))
+ ;; Step 8
+ ;; H2 = H1 + r1 * H1 in f8
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (mult:XF (match_dup 4) (match_dup 3))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 9
+ ;; G2 = G1 + r1 * G1 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 7)
+ (plus:XF (mult:XF (match_dup 4) (match_dup 7))
+ (match_dup 7)))
+ (use (const_int 1))]))
+ ;; Step 10
+ ;; d2 = a - G2 * G2 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7)))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 11
+ ;; G3 = G2 + d2 * H2 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 7)
+ (plus:XF (mult:XF (match_dup 4) (match_dup 3))
+ (match_dup 7)))
+ (use (const_int 1))]))
+ ;; Step 12
+ ;; d3 = a - G3 * G3 in f9
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (neg:XF (mult:XF (match_dup 7) (match_dup 7)))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 13
+ ;; S = G3 + d3 * H2 in f7
+ (cond_exec (ne (match_dup 6) (const_int 0))
+ (parallel [(set (match_dup 0)
+ (float_truncate:DF
+ (plus:XF (mult:XF (match_dup 4) (match_dup 3))
+ (match_dup 7))))
+ (use (const_int 0))]))]
+{
+ /* Generate 82-bit versions of the input and output operands. */
+ operands[7] = gen_rtx_REG (XFmode, REGNO (operands[0]));
+ operands[8] = gen_rtx_REG (XFmode, REGNO (operands[1]));
+ /* Generate required floating-point constants. */
+ operands[9] = CONST0_RTX (XFmode);
+}
+ [(set_attr "predicable" "no")])
;; ::::::::::::::::::::
;; ::
@@ -3292,6 +3592,17 @@
"fma.s%4 %0 = %F1, %F2, %F3"
[(set_attr "itanium_class" "fmac")])
+(define_insn "*maddxf4_alts_truncsf"
+ [(set (match_operand:SF 0 "fr_register_operand" "=f")
+ (float_truncate:SF
+ (plus:XF (mult:XF (match_operand:XF 1 "xfreg_or_fp01_operand" "fG")
+ (match_operand:XF 2 "xfreg_or_fp01_operand" "fG"))
+ (match_operand:XF 3 "xfreg_or_fp01_operand" "fG"))))
+ (use (match_operand:SI 4 "const_int_operand" ""))]
+ ""
+ "fma.s.s%4 %0 = %F1, %F2, %F3"
+ [(set_attr "itanium_class" "fmac")])
+
(define_insn "*maddxf4_alts_truncdf"
[(set (match_operand:DF 0 "fr_register_operand" "=f")
(float_truncate:DF
@@ -3591,6 +3902,170 @@
"operands[6] = CONST1_RTX (XFmode);"
[(set_attr "predicable" "no")])
+;; Inline square root.
+
+(define_expand "sqrtxf2"
+ [(set (match_operand:XF 0 "fr_register_operand" "=&f")
+ (sqrt:XF (match_operand:XF 1 "fr_register_operand" "f")))]
+ "TARGET_INLINE_SQRT"
+{
+ rtx insn;
+ if (TARGET_INLINE_SQRT_LAT)
+#if 0
+ insn = gen_sqrtxf2_internal_lat (operands[0], operands[1]);
+#else
+ abort ();
+#endif
+ else
+ insn = gen_sqrtxf2_internal_thr (operands[0], operands[1]);
+ emit_insn (insn);
+ DONE;
+})
+
+;; Latency-optimized square root.
+;; FIXME: Implement.
+
+;; Throughput-optimized square root.
+
+(define_insn_and_split "sqrtxf2_internal_thr"
+ [(set (match_operand:XF 0 "fr_register_operand" "=&f")
+ (sqrt:XF (match_operand:XF 1 "fr_register_operand" "f")))
+ ;; Register r2 in optimization guide.
+ (clobber (match_scratch:DI 2 "=r"))
+ ;; Register f8 in optimization guide
+ (clobber (match_scratch:XF 3 "=&f"))
+ ;; Register f9 in optimization guide
+ (clobber (match_scratch:XF 4 "=&f"))
+ ;; Register f10 in optimization guide
+ (clobber (match_scratch:XF 5 "=&f"))
+ ;; Register f11 in optimization guide
+ (clobber (match_scratch:XF 6 "=&f"))
+ ;; Register p6 in optimization guide.
+ (clobber (match_scratch:BI 7 "=c"))]
+ "TARGET_INLINE_SQRT_THR"
+ "#"
+ "&& reload_completed"
+ [ ;; exponent of +1/2 in r2
+ (set (match_dup 2) (const_int 65534))
+ ;; +1/2 in f8. The Intel manual mistakenly specifies f10.
+ (set (match_dup 3)
+ (unspec:XF [(match_dup 2)] UNSPEC_SETF_EXP))
+ ;; Step 1
+ ;; y0 = 1/sqrt(a) in f7
+ (parallel [(set (match_dup 8)
+ (div:XF (const_int 1)
+ (sqrt:XF (match_dup 9))))
+ (set (match_dup 7)
+ (unspec:BI [(match_dup 9)]
+ UNSPEC_FR_SQRT_RECIP_APPROX))
+ (use (const_int 0))])
+ ;; Step 2
+ ;; H0 = 1/2 * y0 in f9
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 8))
+ (match_dup 10)))
+ (use (const_int 1))]))
+ ;; Step 3
+ ;; S0 = a * y0 in f7
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 8)
+ (plus:XF (mult:XF (match_dup 9) (match_dup 8))
+ (match_dup 10)))
+ (use (const_int 1))]))
+ ;; Step 4
+ ;; d0 = 1/2 - S0 * H0 in f10
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 5)
+ (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4)))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 5
+ ;; H1 = H0 + d0 * H0 in f9
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 4))
+ (match_dup 4)))
+ (use (const_int 1))]))
+ ;; Step 6
+ ;; S1 = S0 + d0 * S0 in f7
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 8)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 8))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 7
+ ;; d1 = 1/2 - S1 * H1 in f10
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 5)
+ (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4)))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 8
+ ;; H2 = H1 + d1 * H1 in f9
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 4))
+ (match_dup 4)))
+ (use (const_int 1))]))
+ ;; Step 9
+ ;; S2 = S1 + d1 * S1 in f7
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 8)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 8))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 10
+ ;; d2 = 1/2 - S2 * H2 in f10
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 5)
+ (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 4)))
+ (match_dup 3)))
+ (use (const_int 1))]))
+ ;; Step 11
+ ;; e2 = a - S2 * S2 in f8
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8)))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 12
+ ;; S3 = S2 + e2 * H2 in f7
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 8)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 4))
+ (match_dup 8)))
+ (use (const_int 1))]))
+ ;; Step 13
+ ;; H3 = H2 + d2 * H2 in f9
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 4)
+ (plus:XF (mult:XF (match_dup 5) (match_dup 4))
+ (match_dup 4)))
+ (use (const_int 1))]))
+ ;; Step 14
+ ;; e3 = a - S3 * S3 in f8
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 3)
+ (plus:XF (neg:XF (mult:XF (match_dup 8) (match_dup 8)))
+ (match_dup 9)))
+ (use (const_int 1))]))
+ ;; Step 15
+ ;; S = S3 + e3 * H3 in f7
+ (cond_exec (ne (match_dup 7) (const_int 0))
+ (parallel [(set (match_dup 0)
+ (plus:XF (mult:XF (match_dup 3) (match_dup 4))
+ (match_dup 8)))
+ (use (const_int 0))]))]
+{
+ /* Generate 82-bit versions of the input and output operands. */
+ operands[8] = gen_rtx_REG (XFmode, REGNO (operands[0]));
+ operands[9] = gen_rtx_REG (XFmode, REGNO (operands[1]));
+ /* Generate required floating-point constants. */
+ operands[10] = CONST0_RTX (XFmode);
+}
+ [(set_attr "predicable" "no")])
+
;; ??? frcpa works like cmp.foo.unc.
(define_insn "*recip_approx"
@@ -4009,6 +4484,17 @@
DONE;
})
+(define_expand "cmptf"
+ [(set (cc0)
+ (compare (match_operand:TF 0 "gr_register_operand" "")
+ (match_operand:TF 1 "gr_register_operand" "")))]
+ "TARGET_HPUX"
+{
+ ia64_compare_op0 = operands[0];
+ ia64_compare_op1 = operands[1];
+ DONE;
+})
+
(define_insn "*cmpsi_normal"
[(set (match_operand:BI 0 "register_operand" "=c")
(match_operator:BI 1 "normal_comparison_operator"
@@ -5103,7 +5589,7 @@
;; ::
;; ::::::::::::::::::::
-;; ??? Emiting a NOP instruction isn't very useful. This should probably
+;; ??? Emitting a NOP instruction isn't very useful. This should probably
;; be emitting ";;" to force a break in the instruction packing.
;; No operation, needed in case the user uses -g but not -O.
diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
index c24c70c8d5a..fc7df808188 100644
--- a/gcc/config/ia64/linux.h
+++ b/gcc/config/ia64/linux.h
@@ -12,10 +12,7 @@
/* Target OS builtins. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
- builtin_assert("system=linux"); \
- builtin_define_std("linux"); \
- builtin_define_std("unix"); \
- builtin_define("__gnu_linux__"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
builtin_define("_LONGLONG"); \
} while (0)
@@ -66,7 +63,7 @@ do { \
#include <sys/ucontext.h>
#define IA64_GATE_AREA_START 0xa000000000000100LL
-#define IA64_GATE_AREA_END 0xa000000000020000LL
+#define IA64_GATE_AREA_END 0xa000000000030000LL
#define MD_FALLBACK_FRAME_STATE_FOR(CONTEXT, FS, SUCCESS) \
if ((CONTEXT)->rp >= IA64_GATE_AREA_START \
@@ -93,11 +90,13 @@ do { \
(CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
} \
\
+ (CONTEXT)->fpsr_loc = &(sc_->sc_ar_fpsr); \
(CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
(CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
(CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
(CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \
- (CONTEXT)->bsp = sc_->sc_ar_bsp; \
+ (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \
+ (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \
(CONTEXT)->pr = sc_->sc_pr; \
(CONTEXT)->psp = sc_->sc_gr[12]; \
(CONTEXT)->gp = sc_->sc_gr[1]; \
@@ -105,11 +104,26 @@ do { \
other than what we adjust for below. */ \
(FS) -> no_reg_stack_frame = 1; \
\
- /* Don't touch the branch registers o.t. b0. The kernel doesn't \
- pass the preserved branch registers in the sigcontext but \
- leaves them intact, so there's no need to do anything \
- with them here. */ \
+ if (sc_->sc_rbs_base) \
+ { \
+ /* Need to switch from alternate register backing store. */ \
+ long ndirty, loadrs = sc_->sc_loadrs >> 16; \
+ unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \
+ unsigned long bspstore; \
+ unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \
\
+ ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \
+ (unsigned long *) (CONTEXT)->bsp);\
+ bspstore = (unsigned long) \
+ ia64_rse_skip_regs (ar_bsp, -ndirty); \
+ ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \
+ sc_->sc_ar_rnat); \
+ } \
+ \
+ /* Don't touch the branch registers o.t. b0, b6 and b7. \
+ The kernel doesn't pass the preserved branch registers \
+ in the sigcontext but leaves them intact, so there's no \
+ need to do anything with them here. */ \
{ \
unsigned long sof = sc_->sc_cfm & 0x7f; \
(CONTEXT)->bsp = (unsigned long) \
@@ -123,4 +137,73 @@ do { \
\
goto SUCCESS; \
}
+
+#define MD_HANDLE_UNWABI(CONTEXT, FS) \
+ if ((FS)->unwabi == ((3 << 8) | 's') \
+ || (FS)->unwabi == ((0 << 8) | 's')) \
+ { \
+ struct sigframe { \
+ char scratch[16]; \
+ unsigned long sig_number; \
+ struct siginfo *info; \
+ struct sigcontext *sc; \
+ } *frame_ = (struct sigframe *)(CONTEXT)->psp; \
+ struct sigcontext *sc_ = frame_->sc; \
+ \
+ /* Restore scratch registers in case the unwinder needs to \
+ refer to a value stored in one of them. */ \
+ { \
+ int i_; \
+ \
+ for (i_ = 2; i_ < 4; i_++) \
+ (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
+ for (i_ = 8; i_ < 12; i_++) \
+ (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
+ for (i_ = 14; i_ < 32; i_++) \
+ (CONTEXT)->ireg[i_ - 2].loc = &sc_->sc_gr[i_]; \
+ } \
+ \
+ (CONTEXT)->pfs_loc = &(sc_->sc_ar_pfs); \
+ (CONTEXT)->lc_loc = &(sc_->sc_ar_lc); \
+ (CONTEXT)->unat_loc = &(sc_->sc_ar_unat); \
+ (CONTEXT)->br_loc[0] = &(sc_->sc_br[0]); \
+ (CONTEXT)->br_loc[6] = &(sc_->sc_br[6]); \
+ (CONTEXT)->br_loc[7] = &(sc_->sc_br[7]); \
+ (CONTEXT)->pr = sc_->sc_pr; \
+ (CONTEXT)->gp = sc_->sc_gr[1]; \
+ /* Signal frame doesn't have an associated reg. stack frame \
+ other than what we adjust for below. */ \
+ (FS) -> no_reg_stack_frame = 1; \
+ \
+ if (sc_->sc_rbs_base) \
+ { \
+ /* Need to switch from alternate register backing store. */ \
+ long ndirty, loadrs = sc_->sc_loadrs >> 16; \
+ unsigned long alt_bspstore = (CONTEXT)->bsp - loadrs; \
+ unsigned long bspstore; \
+ unsigned long *ar_bsp = (unsigned long *)(sc_->sc_ar_bsp); \
+ \
+ ndirty = ia64_rse_num_regs ((unsigned long *) alt_bspstore, \
+ (unsigned long *) (CONTEXT)->bsp);\
+ bspstore = (unsigned long) \
+ ia64_rse_skip_regs (ar_bsp, -ndirty); \
+ ia64_copy_rbs ((CONTEXT), bspstore, alt_bspstore, loadrs, \
+ sc_->sc_ar_rnat); \
+ } \
+ \
+ /* Don't touch the branch registers o.t. b0, b6 and b7. \
+ The kernel doesn't pass the preserved branch registers \
+ in the sigcontext but leaves them intact, so there's no \
+ need to do anything with them here. */ \
+ { \
+ unsigned long sof = sc_->sc_cfm & 0x7f; \
+ (CONTEXT)->bsp = (unsigned long) \
+ ia64_rse_skip_regs ((unsigned long *)(sc_->sc_ar_bsp), -sof); \
+ } \
+ \
+ /* pfs_loc already set above. Without this pfs_loc would point \
+ incorrectly to sc_cfm instead of sc_ar_pfs. */ \
+ (FS)->curr.reg[UNW_REG_PFS].where = UNW_WHERE_NONE; \
+ }
+
#endif /* IN_LIBGCC2 */
diff --git a/gcc/config/ia64/sysv4.h b/gcc/config/ia64/sysv4.h
index 5db10895860..15a57d924cd 100644
--- a/gcc/config/ia64/sysv4.h
+++ b/gcc/config/ia64/sysv4.h
@@ -133,7 +133,7 @@ do { \
#define SDATA_SECTION_FUNCTION \
void \
-sdata_section () \
+sdata_section (void) \
{ \
if (in_section != in_sdata) \
{ \
@@ -146,7 +146,7 @@ sdata_section () \
#define SBSS_SECTION_FUNCTION \
void \
-sbss_section () \
+sbss_section (void) \
{ \
if (in_section != in_sbss) \
{ \
diff --git a/gcc/config/ia64/t-ia64 b/gcc/config/ia64/t-ia64
index 04cfc21592d..21d37a79a92 100644
--- a/gcc/config/ia64/t-ia64
+++ b/gcc/config/ia64/t-ia64
@@ -41,7 +41,7 @@ crtfastmath.o: $(srcdir)/config/ia64/crtfastmath.c $(GCC_PASSES)
$(srcdir)/config/ia64/crtfastmath.c
LIB2ADDEH = $(srcdir)/config/ia64/unwind-ia64.c $(srcdir)/unwind-sjlj.c \
- $(srcdir)/unwind-c.c
+ $(srcdir)/unwind-c.c $(srcdir)/gthr-gnat.c
ia64-c.o: $(srcdir)/config/ia64/ia64-c.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h $(TM_H) $(TREE_H) $(CPPLIB_H) $(C_COMMON_H) c-pragma.h toplev.h
diff --git a/gcc/config/ia64/unwind-ia64.c b/gcc/config/ia64/unwind-ia64.c
index 41f59d10b9d..29c63fa13a7 100644
--- a/gcc/config/ia64/unwind-ia64.c
+++ b/gcc/config/ia64/unwind-ia64.c
@@ -157,6 +157,7 @@ typedef struct unw_state_record
unsigned char gr_save_loc; /* next general register to use for saving */
unsigned char return_link_reg; /* branch register for return link */
+ unsigned short unwabi;
struct unw_labeled_state *labeled_states; /* list of all labeled states */
struct unw_reg_state curr; /* current state */
@@ -183,7 +184,8 @@ struct _Unwind_Context
{
/* Initial frame info. */
unsigned long rnat; /* rse nat collection */
- unsigned long regstk_top; /* bsp for first frame */
+ unsigned long regstk_top; /* lowest address of rbs stored register
+ which uses context->rnat collection */
/* Current frame info. */
unsigned long bsp; /* backing store pointer value
@@ -221,7 +223,7 @@ struct _Unwind_Context
} nat;
} ireg[32 - 2]; /* Indexed by <register number> - 2 */
- unsigned long *br_loc[7];
+ unsigned long *br_loc[8];
void *fr_loc[32 - 2];
/* ??? We initially point pri_unat_loc here. The entire NAT bit
@@ -621,11 +623,11 @@ desc_prologue (int body, unw_word rlen, unsigned char mask,
*/
static inline void
-desc_abi (unsigned char abi __attribute__((unused)),
- unsigned char context __attribute__((unused)),
- struct unw_state_record *sr __attribute__((unused)))
+desc_abi (unsigned char abi,
+ unsigned char context,
+ struct unw_state_record *sr)
{
- /* Anything to do? */
+ sr->unwabi = (abi << 8) | context;
}
static inline void
@@ -1491,6 +1493,80 @@ ia64_rse_skip_regs (unsigned long *addr, long num_regs)
}
+/* Copy register backing store from SRC to DST, LEN words
+ (which include both saved registers and nat collections).
+ DST_RNAT is a partial nat collection for DST. SRC and DST
+ don't have to be equal modulo 64 slots, so it cannot be
+ done with a simple memcpy as the nat collections will be
+ at different relative offsets and need to be combined together. */
+static void
+ia64_copy_rbs (struct _Unwind_Context *info, unsigned long dst,
+ unsigned long src, long len, unsigned long dst_rnat)
+{
+ long count;
+ unsigned long src_rnat;
+ unsigned long shift1, shift2;
+
+ len <<= 3;
+ dst_rnat &= (1UL << ((dst >> 3) & 0x3f)) - 1;
+ src_rnat = src >= info->regstk_top
+ ? info->rnat : *(unsigned long *) (src | 0x1f8);
+ src_rnat &= ~((1UL << ((src >> 3) & 0x3f)) - 1);
+ /* Just to make sure. */
+ src_rnat &= ~(1UL << 63);
+ shift1 = ((dst - src) >> 3) & 0x3f;
+ if ((dst & 0x1f8) < (src & 0x1f8))
+ shift1--;
+ shift2 = 0x3f - shift1;
+ if ((dst & 0x1f8) >= (src & 0x1f8))
+ {
+ count = ~dst & 0x1f8;
+ goto first;
+ }
+ count = ~src & 0x1f8;
+ goto second;
+ while (len > 0)
+ {
+ src_rnat = src >= info->regstk_top
+ ? info->rnat : *(unsigned long *) (src | 0x1f8);
+ /* Just to make sure. */
+ src_rnat &= ~(1UL << 63);
+ count = shift2 << 3;
+first:
+ if (count > len)
+ count = len;
+ memcpy ((char *) dst, (char *) src, count);
+ dst += count;
+ src += count;
+ len -= count;
+ dst_rnat |= (src_rnat << shift1) & ~(1UL << 63);
+ if (len <= 0)
+ break;
+ *(long *) dst = dst_rnat;
+ dst += 8;
+ dst_rnat = 0;
+ count = shift1 << 3;
+second:
+ if (count > len)
+ count = len;
+ memcpy ((char *) dst, (char *) src, count);
+ dst += count;
+ src += count + 8;
+ len -= count + 8;
+ dst_rnat |= (src_rnat >> shift2);
+ }
+ if ((dst & 0x1f8) == 0x1f8)
+ {
+ *(long *) dst = dst_rnat;
+ dst += 8;
+ dst_rnat = 0;
+ }
+ /* Set info->regstk_top to lowest rbs address which will use
+ info->rnat collection. */
+ info->regstk_top = dst & ~0x1ffUL;
+ info->rnat = dst_rnat;
+}
+
/* Unwind accessors. */
static void
@@ -1550,9 +1626,10 @@ unw_access_gr (struct _Unwind_Context *info, int regnum,
break;
case UNW_NAT_REGSTK:
- nat_addr = ia64_rse_rnat_addr (addr);
- if ((unsigned long) nat_addr >= info->regstk_top)
+ if ((unsigned long) addr >= info->regstk_top)
nat_addr = &info->rnat;
+ else
+ nat_addr = ia64_rse_rnat_addr (addr);
nat_mask = 1UL << ia64_rse_slot_num (addr);
break;
}
@@ -1562,9 +1639,10 @@ unw_access_gr (struct _Unwind_Context *info, int regnum,
{
/* 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)
+ if ((unsigned long) addr >= info->regstk_top)
nat_addr = &info->rnat;
+ else
+ nat_addr = ia64_rse_rnat_addr (addr);
nat_mask = 1UL << ia64_rse_slot_num (addr);
}
@@ -1723,7 +1801,8 @@ uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
}
context->region_start = ent->start_offset + segment_base;
- fs->when_target = (context->rp - context->region_start) / 16 * 3;
+ fs->when_target = ((context->rp & -16) - context->region_start) / 16 * 3
+ + (context->rp & 15);
unw = (unsigned long *) (ent->info_offset + segment_base);
header = *unw;
@@ -1814,9 +1893,9 @@ uw_update_reg_address (struct _Unwind_Context *context,
case UNW_WHERE_BR:
/* Note that while RVAL can only be 1-5 from normal descriptors,
- we can want to look at B0 due to having manually unwound a
+ we can want to look at B0, B6 and B7 due to having manually unwound a
signal frame. */
- if (rval <= 5)
+ if (rval < 8)
addr = context->br_loc[rval];
else
abort ();
@@ -1930,6 +2009,10 @@ uw_update_context (struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
long i;
+#ifdef MD_HANDLE_UNWABI
+ MD_HANDLE_UNWABI (context, fs);
+#endif
+
context->sp = context->psp;
/* First, set PSP. Subsequent instructions may depend on this value. */
@@ -1993,18 +2076,31 @@ uw_init_context_1 (struct _Unwind_Context *context, void *bsp)
/* Set psp to the caller's stack pointer. */
void *psp = __builtin_dwarf_cfa () - 16;
_Unwind_FrameState fs;
-
- /* Flush the register stack to memory so that we can access it. */
- __builtin_ia64_flushrs ();
+ unsigned long rnat, tmp1, tmp2;
+
+ /* Flush the register stack to memory so that we can access it.
+ Get rse nat collection for the last incomplete rbs chunk of
+ registers at the same time. For this RSE needs to be turned
+ into the mandatory only mode. */
+ asm ("mov.m %1 = ar.rsc;;\n\t"
+ "and %2 = 0x1c, %1;;\n\t"
+ "mov.m ar.rsc = %2;;\n\t"
+ "flushrs;;\n\t"
+ "mov.m %0 = ar.rnat;;\n\t"
+ "mov.m ar.rsc = %1\n\t"
+ : "=r" (rnat), "=r" (tmp1), "=r" (tmp2));
memset (context, 0, sizeof (struct _Unwind_Context));
- context->bsp = context->regstk_top = (unsigned long) bsp;
+ context->bsp = (unsigned long) bsp;
+ /* Set context->regstk_top to lowest rbs address which will use
+ context->rnat collection. */
+ context->regstk_top = context->bsp & ~0x1ffULL;
+ context->rnat = rnat;
context->psp = (unsigned long) psp;
context->rp = (unsigned long) rp;
asm ("mov %0 = sp" : "=r" (context->sp));
asm ("mov %0 = pr" : "=r" (context->pr));
context->pri_unat_loc = &context->initial_unat; /* ??? */
- /* ??? Get rnat. Don't we have to turn off the rse for that? */
if (uw_frame_state_for (context, &fs) != _URC_NO_REASON)
abort ();
@@ -2045,6 +2141,9 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
ia64_rse_skip_regs ((unsigned long *)target->bsp,
(*target->pfs_loc >> 7) & 0x7f);
+ if (target->bsp < target->regstk_top)
+ target->rnat = *ia64_rse_rnat_addr ((unsigned long *) target->bsp);
+
/* Provide assembly with the offsets into the _Unwind_Context. */
asm volatile ("uc_rnat = %0"
: : "i"(offsetof (struct _Unwind_Context, rnat)));
@@ -2081,22 +2180,22 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
";; \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"
+ "add r21 = uc_br_loc + 16, %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"
+ "add r20 = uc_br_loc + 8, %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"
+ "ld8 r25 = [r21], uc_fr_loc - (uc_br_loc + 32)\n\t"
";; \n\t"
- "ld8 r26 = [r20], uc_fr_loc + 8 - (uc_br_loc + 32)\n\t"
+ "ld8 r26 = [r20], uc_fr_loc + 8 - (uc_br_loc + 40)\n\t"
"ld8 r27 = [r21], 24 \n\t"
"cmp.ne p6, p0 = r0, r22 \n\t"
";; \n\t"
@@ -2244,12 +2343,12 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
"(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"
+ "(p6) mov.m ar.fpsr = r30 \n\t"
";; \n\t"
- "and r25 = 0x1c, r25 \n\t"
+ "and r29 = 0x1c, r25 \n\t"
"mov b0 = r26 \n\t"
";; \n\t"
- "mov.m ar.rsc = r25 \n\t"
+ "mov.m ar.rsc = r29 \n\t"
";; \n\t"
/* This must be done before setting AR.BSPSTORE, otherwise
AR.BSP will be initialized with a random displacement
@@ -2260,7 +2359,6 @@ uw_install_context (struct _Unwind_Context *current __attribute__((unused)),
";; \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"
diff --git a/gcc/config/ip2k/ip2k-protos.h b/gcc/config/ip2k/ip2k-protos.h
index d1553ac047e..1c4355ff92c 100644
--- a/gcc/config/ip2k/ip2k-protos.h
+++ b/gcc/config/ip2k/ip2k-protos.h
@@ -18,75 +18,66 @@
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-extern void function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-extern void function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-extern int find_one_set_bit_p PARAMS ((HOST_WIDE_INT));
-extern int find_one_clear_bit_p PARAMS ((HOST_WIDE_INT));
+extern void function_prologue (FILE *, HOST_WIDE_INT);
+extern void function_epilogue (FILE *, HOST_WIDE_INT);
+extern int find_one_set_bit_p (HOST_WIDE_INT);
+extern int find_one_clear_bit_p (HOST_WIDE_INT);
#ifdef TREE_CODE
-extern void unique_section PARAMS ((tree, int));
-extern void asm_output_section_name PARAMS ((FILE *, tree, const char *,
- int));
-extern int valid_machine_type_attribute PARAMS ((tree, tree, tree, tree));
-extern int valid_machine_decl_attribute PARAMS ((tree, tree, tree, tree));
-extern int ip2k_return_pops_args PARAMS ((tree, tree, int));
+extern void unique_section (tree, int);
+extern int valid_machine_type_attribute (tree, tree, tree, tree);
+extern int valid_machine_decl_attribute (tree, tree, tree, tree);
+extern int ip2k_return_pops_args (tree, tree, int);
#endif /* TREE_CODE */
#ifdef RTX_CODE
-extern int legitimate_address_p PARAMS ((enum machine_mode, rtx, int));
-extern int ip2k_extra_constraint PARAMS ((rtx, int));
-extern rtx legitimize_address PARAMS ((rtx, rtx, enum machine_mode, rtx));
-extern int adjust_insn_length PARAMS ((rtx insn, int len));
-extern void asm_output_char PARAMS ((FILE *, rtx));
-extern void asm_output_short PARAMS ((FILE *, rtx));
-extern void asm_output_byte PARAMS ((FILE *, int));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern int ip2k_jump_mode PARAMS ((rtx, rtx));
-extern void ip2k_split_words PARAMS ((enum machine_mode, enum machine_mode,
- rtx *));
-extern rtx ip2k_get_low_half PARAMS ((rtx, enum machine_mode));
-extern rtx ip2k_get_high_half PARAMS ((rtx, enum machine_mode));
-extern int ip2k_nonptr_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_ptr_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_ip_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_short_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_gen_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_nonsp_reg_operand PARAMS ((rtx, enum machine_mode));
-extern int ip2k_symbol_ref_operand PARAMS ((rtx, enum machine_mode));
-extern const char *ip2k_set_compare PARAMS ((rtx, rtx));
-extern const char *ip2k_gen_sCOND PARAMS ((rtx, enum rtx_code, rtx));
-extern const char *ip2k_gen_signed_comp_branch PARAMS ((rtx,
- enum rtx_code,
- rtx));
-extern const char *ip2k_gen_unsigned_comp_branch PARAMS ((rtx,
- enum rtx_code,
- rtx));
-extern int is_regfile_address PARAMS ((rtx));
-extern int ip2k_mode_dependent_address PARAMS ((rtx));
-extern int ip2k_address_uses_reg_p PARAMS ((rtx, unsigned int));
-extern int ip2k_xexp_not_uses_reg_p PARAMS ((rtx, unsigned int, int));
-extern int ip2k_composite_xexp_not_uses_reg_p PARAMS ((rtx, unsigned int, int));
-extern int ip2k_composite_xexp_not_uses_cc0_p PARAMS ((rtx));
-extern int ip2k_signed_comparison_operator PARAMS ((rtx,
- enum machine_mode));
-extern int ip2k_unsigned_comparison_operator PARAMS ((rtx,
- enum machine_mode));
-extern int ip2k_unary_operator PARAMS ((rtx, enum machine_mode));
-extern int ip2k_binary_operator PARAMS ((rtx, enum machine_mode));
+extern int legitimate_address_p (enum machine_mode, rtx, int);
+extern int ip2k_extra_constraint (rtx, int);
+extern rtx legitimize_address (rtx, rtx, enum machine_mode, rtx);
+extern int adjust_insn_length (rtx insn, int len);
+extern void asm_output_char (FILE *, rtx);
+extern void asm_output_short (FILE *, rtx);
+extern void asm_output_byte (FILE *, int);
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern int ip2k_jump_mode (rtx, rtx);
+extern void ip2k_split_words (enum machine_mode, enum machine_mode, rtx *);
+extern rtx ip2k_get_low_half (rtx, enum machine_mode);
+extern rtx ip2k_get_high_half (rtx, enum machine_mode);
+extern int ip2k_nonptr_operand (rtx, enum machine_mode);
+extern int ip2k_ptr_operand (rtx, enum machine_mode);
+extern int ip2k_ip_operand (rtx, enum machine_mode);
+extern int ip2k_short_operand (rtx, enum machine_mode);
+extern int ip2k_gen_operand (rtx, enum machine_mode);
+extern int ip2k_nonsp_reg_operand (rtx, enum machine_mode);
+extern int ip2k_symbol_ref_operand (rtx, enum machine_mode);
+extern const char *ip2k_set_compare (rtx, rtx);
+extern const char *ip2k_gen_sCOND (rtx, enum rtx_code, rtx);
+extern const char *ip2k_gen_signed_comp_branch (rtx, enum rtx_code, rtx);
+extern const char *ip2k_gen_unsigned_comp_branch (rtx, enum rtx_code, rtx);
+extern int is_regfile_address (rtx);
+extern int ip2k_mode_dependent_address (rtx);
+extern int ip2k_address_uses_reg_p (rtx, unsigned int);
+extern int ip2k_xexp_not_uses_reg_p (rtx, unsigned int, int);
+extern int ip2k_composite_xexp_not_uses_reg_p (rtx, unsigned int, int);
+extern int ip2k_composite_xexp_not_uses_cc0_p (rtx);
+extern int ip2k_signed_comparison_operator (rtx, enum machine_mode);
+extern int ip2k_unsigned_comparison_operator (rtx, enum machine_mode);
+extern int ip2k_unary_operator (rtx, enum machine_mode);
+extern int ip2k_binary_operator (rtx, enum machine_mode);
extern rtx ip2k_compare_operands[3];
#endif /* RTX_CODE */
#ifdef HAVE_MACHINE_MODES
-extern int class_max_nregs PARAMS ((enum reg_class, enum machine_mode));
-extern enum reg_class class_likely_spilled_p PARAMS ((int c));
+extern int class_max_nregs (enum reg_class, enum machine_mode);
+extern enum reg_class class_likely_spilled_p (int c);
#endif /* HAVE_MACHINE_MODES */
#ifdef REAL_VALUE_TYPE
-extern void asm_output_float PARAMS ((FILE *, REAL_VALUE_TYPE));
+extern void asm_output_float (FILE *, REAL_VALUE_TYPE);
#endif
-extern int ip2k_init_elim_offset PARAMS ((int, int));
-extern void ip2k_init_local_alloc PARAMS ((int *));
+extern int ip2k_init_elim_offset (int, int);
+extern void ip2k_init_local_alloc (int *);
diff --git a/gcc/config/ip2k/ip2k.c b/gcc/config/ip2k/ip2k.c
index e31347fd701..cb73b39234b 100644
--- a/gcc/config/ip2k/ip2k.c
+++ b/gcc/config/ip2k/ip2k.c
@@ -54,35 +54,33 @@
the stack offsets. Isolate the decision process into a simple macro. */
#define CHAIN_FRAMES (frame_pointer_needed || FRAME_POINTER_REQUIRED)
-static int ip2k_naked_function_p PARAMS ((tree));
+static int ip2k_naked_function_p (tree);
#ifdef IP2K_MD_REORG_PASS
-static void mdr_resequence_xy_yx PARAMS ((rtx));
-static void mdr_pres_replace_and_recurse PARAMS ((rtx, rtx, rtx));
-static void mdr_propagate_reg_equivs_sequence PARAMS ((rtx, rtx, rtx));
-static void mdr_propagate_reg_equivs PARAMS ((rtx));
-static int track_dp_reload PARAMS ((rtx , rtx *, int , int));
-static void mdr_try_dp_reload_elim PARAMS ((rtx));
-static void mdr_try_move_dp_reload PARAMS ((rtx));
-static void mdr_try_move_pushes PARAMS ((rtx));
-static void mdr_try_propagate_clr_sequence PARAMS ((rtx, unsigned int));
-static void mdr_try_propagate_clr PARAMS ((rtx));
-static void mdr_try_propagate_move_sequence PARAMS ((rtx, rtx, rtx));
-static void mdr_try_propagate_move PARAMS ((rtx));
-static void mdr_try_remove_redundant_insns PARAMS ((rtx));
-static int track_w_reload PARAMS ((rtx, rtx *, int , int));
-static void mdr_try_wreg_elim PARAMS ((rtx));
+static void mdr_resequence_xy_yx (rtx);
+static void mdr_pres_replace_and_recurse (rtx, rtx, rtx);
+static void mdr_propagate_reg_equivs_sequence (rtx, rtx, rtx);
+static void mdr_propagate_reg_equivs (rtx);
+static int track_dp_reload (rtx , rtx *, int , int);
+static void mdr_try_dp_reload_elim (rtx);
+static void mdr_try_move_dp_reload (rtx);
+static void mdr_try_move_pushes (rtx);
+static void mdr_try_propagate_clr_sequence (rtx, unsigned int);
+static void mdr_try_propagate_clr (rtx);
+static void mdr_try_propagate_move_sequence (rtx, rtx, rtx);
+static void mdr_try_propagate_move (rtx);
+static void mdr_try_remove_redundant_insns (rtx);
+static int track_w_reload (rtx, rtx *, int , int);
+static void mdr_try_wreg_elim (rtx);
#endif /* IP2K_MD_REORG_PASS */
-static void ip2k_reorg PARAMS ((void));
-static int ip2k_check_can_adjust_stack_ref PARAMS ((rtx, int));
-static void ip2k_adjust_stack_ref PARAMS ((rtx *, int));
-static int ip2k_xexp_not_uses_reg_for_mem PARAMS ((rtx, unsigned int));
-static tree ip2k_handle_progmem_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static tree ip2k_handle_fndecl_attribute PARAMS ((tree *, tree, tree, int,
- bool *));
-static bool ip2k_rtx_costs PARAMS ((rtx, int, int, int *));
-static int ip2k_address_cost PARAMS ((rtx));
-static void ip2k_init_libfuncs PARAMS ((void));
+static void ip2k_reorg (void);
+static int ip2k_check_can_adjust_stack_ref (rtx, int);
+static void ip2k_adjust_stack_ref (rtx *, int);
+static int ip2k_xexp_not_uses_reg_for_mem (rtx, unsigned int);
+static tree ip2k_handle_progmem_attribute (tree *, tree, tree, int, bool *);
+static tree ip2k_handle_fndecl_attribute (tree *, tree, tree, int, bool *);
+static bool ip2k_rtx_costs (rtx, int, int, int *);
+static int ip2k_address_cost (rtx);
+static void ip2k_init_libfuncs (void);
const struct attribute_spec ip2k_attribute_table[];
@@ -145,8 +143,7 @@ int ip2k_reorg_merge_qimode = 0;
/* Set up local allocation order. */
void
-ip2k_init_local_alloc (rao)
- int * rao;
+ip2k_init_local_alloc (int *rao)
{
static const int alloc_order[] = REG_ALLOC_ORDER;
@@ -161,10 +158,7 @@ ip2k_init_local_alloc (rao)
SIZE is the number of bytes of arguments passed on the stack. */
int
-ip2k_return_pops_args (fundecl, funtype, size)
- tree fundecl ATTRIBUTE_UNUSED;
- tree funtype;
- int size;
+ip2k_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, tree funtype, int size)
{
if (TREE_CODE (funtype) == IDENTIFIER_NODE)
return size;
@@ -179,8 +173,7 @@ ip2k_return_pops_args (fundecl, funtype, size)
/* Return nonzero if FUNC is a naked function. */
static int
-ip2k_naked_function_p (func)
- tree func;
+ip2k_naked_function_p (tree func)
{
tree a;
@@ -193,9 +186,7 @@ ip2k_naked_function_p (func)
/* Output function prologue. */
void
-function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+function_prologue (FILE *file, HOST_WIDE_INT size)
{
int leaf_func_p;
int main_p;
@@ -316,9 +307,7 @@ function_prologue (file, size)
/* Output function epilogue. */
void
-function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+function_epilogue (FILE *file, HOST_WIDE_INT size)
{
int leaf_func_p;
int reg,savelimit;
@@ -370,7 +359,7 @@ function_epilogue (file, size)
OUT_AS2 (mov, w, %L0);
OUT_AS2 (add, spl, w);
epilogue_size += 4;
- /* fall-thru */
+ /* fall-through */
case 0:
break;
case 1:
@@ -385,7 +374,7 @@ function_epilogue (file, size)
OUT_AS2 (mov, w, %H0);
OUT_AS2 (add, sph, w);
epilogue_size += 4;
- /* fall-thru */
+ /* fall-through */
case 0:
break;
case 0x100:
@@ -500,7 +489,7 @@ function_epilogue (file, size)
OUT_AS2 (mov, w, %L0);
OUT_AS2 (add, spl, w);
epilogue_size += 4;
- /* fall-thru */
+ /* fall-through */
case 0:
break;
@@ -517,7 +506,7 @@ function_epilogue (file, size)
OUT_AS2 (mov, w, %H0);
OUT_AS2 (add, sph, w);
epilogue_size += 4;
- /* fall-thru */
+ /* fall-through */
case 0:
break;
@@ -552,9 +541,7 @@ function_epilogue (file, size)
STACK ALLOCATION
<------ SP ($6:$7) */
int
-ip2k_init_elim_offset (from, to)
- int from;
- int to;
+ip2k_init_elim_offset (int from, int to)
{
int leaf_func_p = leaf_function_p ();
int no_saved_pc = leaf_func_p
@@ -599,10 +586,7 @@ ip2k_init_elim_offset (from, to)
machine for a memory operand of mode MODE. */
int
-legitimate_address_p (mode, x, strict)
- enum machine_mode mode;
- rtx x;
- int strict;
+legitimate_address_p (enum machine_mode mode, rtx x, int strict)
{
int off;
@@ -617,7 +601,7 @@ legitimate_address_p (mode, x, strict)
if (REGNO (x) == REG_IP)
return (GET_MODE_SIZE (mode) == 1) ? 'R' : 0;
- /* We can indirect thru DP or SP register. */
+ /* We can indirect through DP or SP register. */
if (strict ? REG_OK_FOR_BASE_STRICT_P (x)
: REG_OK_FOR_BASE_NOSTRICT_P (x))
return 'S';
@@ -638,7 +622,7 @@ legitimate_address_p (mode, x, strict)
op2 = tmp;
}
- /* Don't let anything but R+I thru.. */
+ /* Don't let anything but R+I through.. */
if (! REG_P (op1)
|| REG_P (op2)
|| GET_CODE (op2) != CONST_INT)
@@ -691,8 +675,7 @@ legitimate_address_p (mode, x, strict)
/* Is ADDR mode dependent? */
int
-ip2k_mode_dependent_address (addr)
- rtx addr;
+ip2k_mode_dependent_address (rtx addr)
{
switch (GET_CODE (addr))
{
@@ -714,11 +697,8 @@ ip2k_mode_dependent_address (addr)
memory address for an operand of mode MODE. */
rtx
-legitimize_address (x, oldx, mode, scratch)
- rtx x;
- rtx oldx ATTRIBUTE_UNUSED;
- rtx scratch;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED, rtx scratch)
{
rtx reg;
@@ -749,8 +729,7 @@ legitimize_address (x, oldx, mode, scratch)
data and stack variables reside in data memory. Only code is believed
to be in PRAM or FLASH. */
int
-is_regfile_address (x)
- rtx x;
+is_regfile_address (rtx x)
{
while (1)
switch (GET_CODE (x))
@@ -777,15 +756,13 @@ is_regfile_address (x)
/* Output ADDR to FILE as address. */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
switch (GET_CODE (addr))
{
case SUBREG:
addr = alter_subreg (&addr);
- /* fall-thru */
+ /* fall-through */
case REG:
fprintf (file, "(%s)",
@@ -850,10 +827,7 @@ print_operand_address (file, addr)
/* Output X as assembler operand to file FILE. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
int abcd = 0;
unsigned long value;
@@ -908,7 +882,7 @@ print_operand (file, x, code)
{
case SUBREG:
x = alter_subreg (&x);
- /* fall-thru */
+ /* fall-through */
case REG:
fprintf (file, reg_names[true_regnum (x) + abcd]);
@@ -1103,9 +1077,7 @@ print_operand (file, x, code)
/* Remember the operands for the compare. */
const char *
-ip2k_set_compare (x, y)
- rtx x;
- rtx y;
+ip2k_set_compare (rtx x, rtx y)
{
ip2k_compare_operands[0] = x;
ip2k_compare_operands[1] = y;
@@ -1114,10 +1086,7 @@ ip2k_set_compare (x, y)
/* Emit the code for sCOND instructions. */
const char *
-ip2k_gen_sCOND (insn, code, dest)
- rtx insn ATTRIBUTE_UNUSED;
- enum rtx_code code;
- rtx dest;
+ip2k_gen_sCOND (rtx insn ATTRIBUTE_UNUSED, enum rtx_code code, rtx dest)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -1328,10 +1297,7 @@ ip2k_gen_sCOND (insn, code, dest)
}
const char *
-ip2k_gen_signed_comp_branch (insn, code, label)
- rtx insn;
- enum rtx_code code;
- rtx label;
+ip2k_gen_signed_comp_branch (rtx insn, enum rtx_code code, rtx label)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -1677,10 +1643,7 @@ ip2k_gen_signed_comp_branch (insn, code, label)
}
const char *
-ip2k_gen_unsigned_comp_branch (insn, code, label)
- rtx insn;
- enum rtx_code code;
- rtx label;
+ip2k_gen_unsigned_comp_branch (rtx insn, enum rtx_code code, rtx label)
{
#define operands ip2k_compare_operands
enum machine_mode mode;
@@ -1759,7 +1722,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
case GTU:
code = NE; /* Anything nonzero is GTU. */
- /* fall-thru */
+ /* fall-through */
case EQ:
case NE: /* Test all the bits, result in
@@ -2079,7 +2042,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
case GTU:
if (imm_sub)
{
- /* > 0xffff never suceeds! */
+ /* > 0xffff never succeeds! */
if ((INTVAL (operands[1]) & 0xffff) != 0xffff)
{
operands[3] = GEN_INT (INTVAL (operands[1]) + 1);
@@ -2179,7 +2142,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
{
if ((INTVAL (operands[1]) & 0xffff) == 0xffff)
{
- /* <= 0xffff always suceeds. */
+ /* <= 0xffff always succeeds. */
OUT_AS1 (page, %2);
OUT_AS1 (jmp, %2);
}
@@ -2308,7 +2271,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
case GTU:
if (imm_sub)
{
- /* > 0xffffffff never suceeds! */
+ /* > 0xffffffff never succeeds! */
if ((unsigned HOST_WIDE_INT)(INTVAL (operands[1]) & 0xffffffff)
!= 0xffffffff)
{
@@ -2438,7 +2401,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
if ((unsigned HOST_WIDE_INT)(INTVAL (operands[1]) & 0xffffffff)
== 0xffffffff)
{
- /* <= 0xffffffff always suceeds. */
+ /* <= 0xffffffff always succeeds. */
OUT_AS1 (page, %2);
OUT_AS1 (jmp, %2);
}
@@ -3045,9 +3008,7 @@ ip2k_gen_unsigned_comp_branch (insn, code, label)
/* Output rtx VALUE as .byte to file FILE. */
void
-asm_output_char(file, value)
- FILE *file;
- rtx value;
+asm_output_char (FILE *file, rtx value)
{
fprintf (file, "\t.byte ");
output_addr_const (file, value);
@@ -3058,9 +3019,7 @@ asm_output_char(file, value)
/* Output VALUE as .byte to file FILE. */
void
-asm_output_byte (file,value)
- FILE *file;
- int value;
+asm_output_byte (FILE *file, int value)
{
fprintf (file, "\t.byte 0x%x\n",value & 0xff);
}
@@ -3069,9 +3028,7 @@ asm_output_byte (file,value)
/* Output rtx VALUE as .word to file FILE. */
void
-asm_output_short (file, value)
- FILE *file;
- rtx value;
+asm_output_short (FILE *file, rtx value)
{
fprintf (file, "\t.word ");
output_addr_const (file, (value));
@@ -3082,9 +3039,7 @@ asm_output_short (file, value)
/* Output real N to file FILE. */
void
-asm_output_float (file, n)
- FILE *file;
- REAL_VALUE_TYPE n;
+asm_output_float (FILE *file, REAL_VALUE_TYPE n)
{
long val;
char dstr[100];
@@ -3098,9 +3053,7 @@ asm_output_float (file, n)
/* Sets section name for declaration DECL. */
void
-unique_section (decl, reloc)
- tree decl;
- int reloc ATTRIBUTE_UNUSED;
+unique_section (tree decl, int reloc ATTRIBUTE_UNUSED)
{
int len;
const char *name;
@@ -3129,26 +3082,12 @@ unique_section (decl, reloc)
}
}
-
-/* Output section name to file FILE. */
-
-void
-asm_output_section_name(file, decl, name, reloc)
- FILE *file;
- tree decl ATTRIBUTE_UNUSED;
- const char *name;
- int reloc ATTRIBUTE_UNUSED;
-{
- fprintf (file, ".section %s\n", name);
-}
-
/* Return 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. */
enum reg_class
-class_likely_spilled_p(c)
- int c;
+class_likely_spilled_p (int c)
{
return (c == IP_REGS
|| c == IPL_REGS
@@ -3178,12 +3117,10 @@ const struct attribute_spec ip2k_attribute_table[] =
/* Handle a "progmem" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-ip2k_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+ip2k_handle_progmem_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (DECL_P (*node))
{
@@ -3222,12 +3159,10 @@ ip2k_handle_progmem_attribute (node, name, args, flags, no_add_attrs)
/* Handle an attribute requiring a FUNCTION_DECL; arguments as in
struct attribute_spec.handler. */
static tree
-ip2k_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+ip2k_handle_fndecl_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_DECL)
{
@@ -3246,10 +3181,7 @@ ip2k_handle_fndecl_attribute (node, name, args, flags, no_add_attrs)
scanned. In either case, *TOTAL contains the cost result. */
static bool
-ip2k_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+ip2k_rtx_costs (rtx x, int code, int outer_code, int *total)
{
enum machine_mode mode = GET_MODE (x);
int extra_cost = 0;
@@ -3382,8 +3314,7 @@ ip2k_rtx_costs (x, code, outer_code, total)
/* Calculate the cost of a memory address. */
static int
-ip2k_address_cost (x)
- rtx x;
+ip2k_address_cost (rtx x)
{
switch (legitimate_address_p (VOIDmode, x, 0))
{
@@ -3858,7 +3789,7 @@ track_dp_reload (insn, dp_current, dp_current_ok, modifying)
/* As part of the machine-dependent reorg we scan loads and reloads of
DP to see where any are redundant. This does happens because we
are able to subsequently transform things in interesting ways. Sometimes
- gcc also does unecessary reloads too so we try to eliminate these too. */
+ gcc also does unnecessary reloads too so we try to eliminate these too. */
static void
mdr_try_dp_reload_elim (first_insn)
@@ -4019,7 +3950,7 @@ mdr_try_dp_reload_elim (first_insn)
}
/* When we're looking to see if we've finished we count the number of
- paths throught the code labels where we weren't able to definitively
+ paths through the code labels where we weren't able to definitively
track DP.
This number is used to see if we're converging on a solution.
If this hits zero then we've fully converged, but if this stays the
@@ -4162,9 +4093,7 @@ mdr_try_move_dp_reload (first_insn)
a fixed constant, offset. If it definitely can then returns nonzero. */
static int
-ip2k_check_can_adjust_stack_ref (x, offset)
- rtx x;
- int offset;
+ip2k_check_can_adjust_stack_ref (rtx x, int offset)
{
if (GET_RTX_CLASS (GET_CODE (x)) == '2'
|| GET_RTX_CLASS (GET_CODE (x)) == 'c')
@@ -4210,9 +4139,7 @@ ip2k_check_can_adjust_stack_ref (x, offset)
a fixed offset. */
static void
-ip2k_adjust_stack_ref (x, offset)
- rtx *x;
- int offset;
+ip2k_adjust_stack_ref (rtx *x, int offset)
{
if (GET_RTX_CLASS (GET_CODE (*x)) == '2'
|| GET_RTX_CLASS (GET_CODE (*x)) == 'c')
@@ -4701,9 +4628,7 @@ mdr_try_propagate_clr (first_insn)
nonzero if we definitely don't have such a memory ref. */
static int
-ip2k_xexp_not_uses_reg_for_mem (x, regno)
- rtx x;
- unsigned int regno;
+ip2k_xexp_not_uses_reg_for_mem (rtx x, unsigned int regno)
{
if (regno & 1)
regno &= 0xfffffffe;
@@ -5264,7 +5189,7 @@ mdr_try_wreg_elim (first_insn)
}
/* When we're looking to see if we've finished we count the number of
- paths throught the code labels where we weren't able to definitively
+ paths through the code labels where we weren't able to definitively
track WREG. This number is used to see if we're converging on a
solution.
If this hits zero then we've fully converged, but if this stays the
@@ -5318,7 +5243,7 @@ mdr_try_wreg_elim (first_insn)
making the subsequent runs continue to win. */
static void
-ip2k_reorg ()
+ip2k_reorg (void)
{
#ifdef IP2K_MD_REORG_PASS
rtx first_insn, insn, set;
@@ -5520,8 +5445,7 @@ ip2k_init_libfuncs (void)
/* Returns a bit position if mask contains only a single bit. Returns -1 if
there were zero or more than one set bits. */
int
-find_one_set_bit_p (mask)
- HOST_WIDE_INT mask;
+find_one_set_bit_p (HOST_WIDE_INT mask)
{
int i;
unsigned HOST_WIDE_INT n = mask;
@@ -5542,8 +5466,7 @@ find_one_set_bit_p (mask)
/* Returns a bit position if mask contains only a single clear bit.
Returns -1 if there were zero or more than one clear bits. */
int
-find_one_clear_bit_p (mask)
- HOST_WIDE_INT mask;
+find_one_clear_bit_p (HOST_WIDE_INT mask)
{
int i;
unsigned HOST_WIDE_INT n = mask;
@@ -5570,10 +5493,8 @@ find_one_clear_bit_p (mask)
and OPERANDS[5]. */
void
-ip2k_split_words (nmode, omode, operands)
- enum machine_mode nmode;
- enum machine_mode omode;
- rtx *operands;
+ip2k_split_words (enum machine_mode nmode, enum machine_mode omode,
+ rtx *operands)
{
rtx dl, dh; /* src/dest pieces. */
rtx sl, sh;
@@ -5761,9 +5682,7 @@ ip2k_split_words (nmode, omode, operands)
/* Get the low half of an operand. */
rtx
-ip2k_get_low_half (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_get_low_half (rtx x, enum machine_mode mode)
{
switch (GET_CODE (x))
{
@@ -5862,9 +5781,7 @@ ip2k_get_low_half (x, mode)
/* Get the high half of an operand. */
rtx
-ip2k_get_high_half (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_get_high_half (rtx x, enum machine_mode mode)
{
switch (GET_CODE (x))
{
@@ -5964,9 +5881,7 @@ ip2k_get_high_half (x, mode)
or REG_FP. */
int
-ip2k_address_uses_reg_p (x, r)
- rtx x;
- unsigned int r;
+ip2k_address_uses_reg_p (rtx x, unsigned int r)
{
if (GET_CODE (x) != MEM)
return 0;
@@ -6013,10 +5928,7 @@ ip2k_address_uses_reg_p (x, r)
that it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_xexp_not_uses_reg_p (x, r, rsz)
- rtx x;
- unsigned int r;
- int rsz;
+ip2k_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
{
switch (GET_CODE (x))
{
@@ -6049,10 +5961,7 @@ ip2k_xexp_not_uses_reg_p (x, r, rsz)
that it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_composite_xexp_not_uses_reg_p (x, r, rsz)
- rtx x;
- unsigned int r;
- int rsz;
+ip2k_composite_xexp_not_uses_reg_p (rtx x, unsigned int r, int rsz)
{
if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
return (ip2k_composite_xexp_not_uses_reg_p (XEXP (x, 0), r, rsz)
@@ -6076,8 +5985,7 @@ ip2k_composite_xexp_not_uses_reg_p (x, r, rsz)
it doesn't then we return TRUE otherwise we assume FALSE. */
int
-ip2k_composite_xexp_not_uses_cc0_p (x)
- rtx x;
+ip2k_composite_xexp_not_uses_cc0_p (rtx x)
{
if (GET_RTX_CLASS (GET_CODE (x)) == 'b')
return (ip2k_composite_xexp_not_uses_cc0_p (XEXP (x, 0))
@@ -6098,17 +6006,13 @@ ip2k_composite_xexp_not_uses_cc0_p (x)
}
int
-ip2k_split_dest_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_split_dest_operand (rtx x, enum machine_mode mode)
{
return nonimmediate_operand (x, mode) || push_operand (x, mode);
}
int
-ip2k_nonptr_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_nonptr_operand (rtx x, enum machine_mode mode)
{
return register_operand (x, mode) && !ip2k_ptr_operand (x, mode);
}
@@ -6116,9 +6020,7 @@ ip2k_nonptr_operand (x, mode)
/* Is X a reference to IP or DP or SP? */
int
-ip2k_ptr_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_ptr_operand (rtx x, enum machine_mode mode)
{
if (GET_CODE (x) == SUBREG)
@@ -6132,18 +6034,14 @@ ip2k_ptr_operand (x, mode)
}
int
-ip2k_sp_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_sp_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return REG_P (x) && REGNO (x) == REG_SP;
}
int
-ip2k_ip_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_ip_operand (rtx x, enum machine_mode mode)
{
if (GET_CODE (x) != MEM)
@@ -6165,9 +6063,7 @@ ip2k_ip_operand (x, mode)
/* Is X a memory address suitable for SP or DP relative addressing? */
int
-ip2k_short_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_short_operand (rtx x, enum machine_mode mode)
{
int r;
unsigned int offs = 0;
@@ -6193,7 +6089,7 @@ ip2k_short_operand (x, mode)
x = XEXP (x, 0);
- /* fall thru */
+ /* fall through */
case REG:
if (IS_PSEUDO_P (x))
@@ -6213,9 +6109,7 @@ ip2k_short_operand (x, mode)
}
int
-ip2k_nonsp_reg_operand (x, mode)
- rtx x;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_nonsp_reg_operand (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (x) == SUBREG)
x = SUBREG_REG (x);
@@ -6224,9 +6118,7 @@ ip2k_nonsp_reg_operand (x, mode)
}
int
-ip2k_gen_operand (x, mode)
- rtx x;
- enum machine_mode mode;
+ip2k_gen_operand (rtx x, enum machine_mode mode)
{
return ip2k_short_operand (x, mode)
|| (GET_CODE (x) == SUBREG
@@ -6235,9 +6127,7 @@ ip2k_gen_operand (x, mode)
}
int
-ip2k_extra_constraint (x, c)
- rtx x;
- int c;
+ip2k_extra_constraint (rtx x, int c)
{
switch (c)
{
@@ -6256,18 +6146,14 @@ ip2k_extra_constraint (x, c)
}
int
-ip2k_unary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_unary_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || GET_MODE (op) == mode)
&& GET_RTX_CLASS (GET_CODE (op)) == '1');
}
int
-ip2k_binary_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_binary_operator (rtx op, enum machine_mode mode)
{
return ((mode == VOIDmode || GET_MODE (op) == mode)
&& (GET_RTX_CLASS (GET_CODE (op)) == 'c'
@@ -6275,9 +6161,7 @@ ip2k_binary_operator (op, mode)
}
int
-ip2k_symbol_ref_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+ip2k_symbol_ref_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
/* We define an IP2k symbol ref to be either a direct reference or one
with a constant offset. */
@@ -6288,18 +6172,14 @@ ip2k_symbol_ref_operand (op, mode)
}
int
-ip2k_signed_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_signed_comparison_operator (rtx op, enum machine_mode mode)
{
return (comparison_operator (op, mode)
&& signed_condition (GET_CODE (op)) == GET_CODE (op));
}
int
-ip2k_unsigned_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode;
+ip2k_unsigned_comparison_operator (rtx op, enum machine_mode mode)
{
return (comparison_operator (op, mode)
&& unsigned_condition (GET_CODE (op)) == GET_CODE (op));
diff --git a/gcc/config/ip2k/ip2k.md b/gcc/config/ip2k/ip2k.md
index ddd6fd20a7b..e51db0255ae 100644
--- a/gcc/config/ip2k/ip2k.md
+++ b/gcc/config/ip2k/ip2k.md
@@ -65,7 +65,7 @@
;; d - non-pointer registers (not SP, DP, IP)
;; u - non-SP registers (everything except SP)
;;
-;; R - Indirect thru IP - Avoid this except for QI mode, since we
+;; R - Indirect through IP - Avoid this except for QI mode, since we
;; can't access extra bytes.
;; S - Short (stack/dp address). Pointer with 0..127 displacement
;; Note that 0(SP) has undefined contents due to post-decrement push
diff --git a/gcc/config/iq2000/iq2000-protos.h b/gcc/config/iq2000/iq2000-protos.h
index 8901fd300b1..2a37f276eb2 100644
--- a/gcc/config/iq2000/iq2000-protos.h
+++ b/gcc/config/iq2000/iq2000-protos.h
@@ -21,44 +21,40 @@
#ifndef GCC_IQ2000_PROTOS_H
#define GCC_IQ2000_PROTOS_H
-extern int iq2000_check_split (rtx, enum machine_mode);
-extern int iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int);
-extern int iq2000_legitimate_address_p (enum machine_mode, rtx, int);
-extern const char* iq2000_fill_delay_slot (const char*, enum delay_type, rtx*, rtx);
-extern const char *iq2000_move_1word (rtx *, rtx, int);
-extern int iq2000_address_cost (rtx);
-extern void override_options (void);
-extern HOST_WIDE_INT iq2000_debugger_offset (rtx, HOST_WIDE_INT);
-extern void final_prescan_insn (rtx, rtx*, int);
-extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT);
-extern int iq2000_initial_elimination_offset (int, int);
-extern void iq2000_expand_prologue (void);
-extern void iq2000_expand_epilogue (void);
-extern void iq2000_expand_eh_return (rtx);
-extern int iq2000_can_use_return_insn (void);
-int function_arg_pass_by_reference (CUMULATIVE_ARGS*, enum machine_mode, tree, int);
-int iq2000_adjust_insn_length (rtx, int);
-char *iq2000_output_conditional_branch (rtx, rtx*, int, int, int, int);
-extern void iq2000_init_builtins (void);
-extern void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int*, int);
-extern void print_operand_address (FILE*, rtx);
-extern void print_operand (FILE*, rtx, int);
+extern int iq2000_check_split (rtx, enum machine_mode);
+extern int iq2000_reg_mode_ok_for_base_p (rtx, enum machine_mode, int);
+extern int iq2000_legitimate_address_p (enum machine_mode, rtx, int);
+extern const char * iq2000_fill_delay_slot (const char *, enum delay_type, rtx *, rtx);
+extern const char * iq2000_move_1word (rtx *, rtx, int);
+extern void override_options (void);
+extern HOST_WIDE_INT iq2000_debugger_offset (rtx, HOST_WIDE_INT);
+extern void final_prescan_insn (rtx, rtx *, int);
+extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT);
+extern int iq2000_initial_elimination_offset (int, int);
+extern void iq2000_expand_prologue (void);
+extern void iq2000_expand_epilogue (void);
+extern void iq2000_expand_eh_return (rtx);
+extern int iq2000_can_use_return_insn (void);
+extern int function_arg_pass_by_reference (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern int iq2000_adjust_insn_length (rtx, int);
+extern char * iq2000_output_conditional_branch (rtx, rtx *, int, int, int, int);
+extern void iq2000_setup_incoming_varargs (CUMULATIVE_ARGS, int, tree, int*, int);
+extern void print_operand_address (FILE *, rtx);
+extern void print_operand (FILE *, rtx, int);
#ifdef RTX_CODE
-extern rtx gen_int_relational (enum rtx_code, rtx, rtx, rtx, int*);
-extern void gen_conditional_branch (rtx *, enum rtx_code);
+extern rtx gen_int_relational (enum rtx_code, rtx, rtx, rtx, int *);
+extern void gen_conditional_branch (rtx *, enum rtx_code);
#endif
#ifdef TREE_CODE
-extern void init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx);
-extern void function_arg_advance (CUMULATIVE_ARGS*, enum machine_mode, tree, int);
-extern struct rtx_def* function_arg (CUMULATIVE_ARGS*, enum machine_mode, tree, int);
-extern int function_arg_partial_nregs (CUMULATIVE_ARGS*, enum machine_mode, tree, int);
-extern void iq2000_va_start (tree, rtx);
-extern rtx iq2000_va_arg (tree, tree);
-extern rtx iq2000_function_value (tree, tree);
-extern rtx iq2000_expand_builtin (tree, rtx, rtx,
- enum machine_mode, int);
+extern void init_cumulative_args (CUMULATIVE_ARGS *, tree, rtx);
+extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern struct rtx_def * function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern void iq2000_va_start (tree, rtx);
+extern rtx iq2000_va_arg (tree, tree);
+extern rtx iq2000_function_value (tree, tree);
#endif
#endif /* ! GCC_IQ2000_PROTOS_H */
diff --git a/gcc/config/iq2000/iq2000.c b/gcc/config/iq2000/iq2000.c
index f9a62d28189..d895bb3c88d 100644
--- a/gcc/config/iq2000/iq2000.c
+++ b/gcc/config/iq2000/iq2000.c
@@ -50,7 +50,8 @@ Boston, MA 02111-1307, USA. */
arrays indexed by the test type, and not worry about the order
of EQ, NE, etc. */
-enum internal_test {
+enum internal_test
+ {
ITEST_EQ,
ITEST_NE,
ITEST_GT,
@@ -66,114 +67,118 @@ enum internal_test {
struct constant;
-static void iq2000_count_memory_refs (rtx, int);
-static enum internal_test map_test_to_internal_test (enum rtx_code);
-static rtx iq2000_add_large_offset_to_sp (HOST_WIDE_INT);
-static void iq2000_annotate_frame_insn (rtx, rtx);
-static void iq2000_emit_frame_related_store (rtx, rtx,
- HOST_WIDE_INT);
-static struct machine_function * iq2000_init_machine_status (void);
-static void save_restore_insns (int);
-static void abort_with_insn (rtx, const char *)
- ATTRIBUTE_NORETURN;
-static int symbolic_expression_p (rtx);
-static enum processor_type iq2000_parse_cpu (const char *);
-static void iq2000_select_rtx_section (enum machine_mode, rtx,
- unsigned HOST_WIDE_INT);
-static void iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
-static rtx expand_one_builtin (enum insn_code, rtx, tree, enum rtx_code*,
- int);
/* Structure to be filled in by compute_frame_size with register
save masks, and offsets for the current function. */
struct iq2000_frame_info
{
- long total_size; /* # bytes that the entire frame takes up */
- long var_size; /* # bytes that variables take up */
- long args_size; /* # bytes that outgoing arguments take up */
- long extra_size; /* # bytes of extra gunk */
- int gp_reg_size; /* # bytes needed to store gp regs */
- int fp_reg_size; /* # bytes needed to store fp regs */
- long mask; /* mask of saved gp registers */
- long gp_save_offset; /* offset from vfp to store gp registers */
- long fp_save_offset; /* offset from vfp to store fp registers */
- long gp_sp_offset; /* offset from new sp to store gp registers */
- long fp_sp_offset; /* offset from new sp to store fp registers */
- int initialized; /* != 0 if frame size already calculated */
- int num_gp; /* number of gp registers saved */
-};
-
-struct machine_function
+ long total_size; /* # bytes that the entire frame takes up. */
+ long var_size; /* # bytes that variables take up. */
+ long args_size; /* # bytes that outgoing arguments take up. */
+ long extra_size; /* # bytes of extra gunk. */
+ int gp_reg_size; /* # bytes needed to store gp regs. */
+ int fp_reg_size; /* # bytes needed to store fp regs. */
+ long mask; /* Mask of saved gp registers. */
+ long gp_save_offset; /* Offset from vfp to store gp registers. */
+ long fp_save_offset; /* Offset from vfp to store fp registers. */
+ long gp_sp_offset; /* Offset from new sp to store gp registers. */
+ long fp_sp_offset; /* Offset from new sp to store fp registers. */
+ int initialized; /* != 0 if frame size already calculated. */
+ int num_gp; /* Number of gp registers saved. */
+} iq2000_frame_info;
+
+struct machine_function GTY(())
{
/* Current frame information, calculated by compute_frame_size. */
- struct iq2000_frame_info frame;
+ long total_size; /* # bytes that the entire frame takes up. */
+ long var_size; /* # bytes that variables take up. */
+ long args_size; /* # bytes that outgoing arguments take up. */
+ long extra_size; /* # bytes of extra gunk. */
+ int gp_reg_size; /* # bytes needed to store gp regs. */
+ int fp_reg_size; /* # bytes needed to store fp regs. */
+ long mask; /* Mask of saved gp registers. */
+ long gp_save_offset; /* Offset from vfp to store gp registers. */
+ long fp_save_offset; /* Offset from vfp to store fp registers. */
+ long gp_sp_offset; /* Offset from new sp to store gp registers. */
+ long fp_sp_offset; /* Offset from new sp to store fp registers. */
+ int initialized; /* != 0 if frame size already calculated. */
+ int num_gp; /* Number of gp registers saved. */
};
/* Global variables for machine-dependent things. */
-/* Count the number of .file directives, so that .loc is up to date. */
-int num_source_filenames = 0;
-
-/* Files to separate the text and the data output, so that all of the data
- can be emitted before the text, which will mean that the assembler will
- generate smaller code, based on the global pointer. */
-FILE *asm_out_data_file;
-FILE *asm_out_text_file;
-
-/* The next branch instruction is a branch likely, not branch normal. */
-int iq2000_branch_likely;
-
-/* Count of delay slots and how many are filled. */
-int dslots_load_total;
-int dslots_load_filled;
-int dslots_jump_total;
-int dslots_jump_filled;
-
-/* # of nops needed by previous insn */
-int dslots_number_nops;
+/* List of all IQ2000 punctuation characters used by print_operand. */
+char iq2000_print_operand_punct[256];
-/* Number of 1/2/3 word references to data items (ie, not jal's). */
-int num_refs[3];
+/* The target cpu for optimization and scheduling. */
+enum processor_type iq2000_tune;
-/* registers to check for load delay */
-rtx iq2000_load_reg, iq2000_load_reg2, iq2000_load_reg3, iq2000_load_reg4;
+/* Which instruction set architecture to use. */
+int iq2000_isa;
/* Cached operands, and operator to compare for use in set/branch/trap
on condition codes. */
rtx branch_cmp[2];
-/* what type of branch to use */
+/* What type of branch to use. */
enum cmp_type branch_type;
-/* The target cpu for code generation. */
-enum processor_type iq2000_arch;
+/* Strings to hold which cpu and instruction set architecture to use. */
+const char * iq2000_cpu_string; /* For -mcpu=<xxx>. */
+const char * iq2000_arch_string; /* For -march=<xxx>. */
-/* The target cpu for optimization and scheduling. */
-enum processor_type iq2000_tune;
-/* which instruction set architecture to use. */
-int iq2000_isa;
+/* Local variables. */
-/* Strings to hold which cpu and instruction set architecture to use. */
-const char *iq2000_cpu_string; /* for -mcpu=<xxx> */
-const char *iq2000_arch_string; /* for -march=<xxx> */
+/* The next branch instruction is a branch likely, not branch normal. */
+static int iq2000_branch_likely;
+
+/* Count of delay slots and how many are filled. */
+static int dslots_load_total;
+static int dslots_load_filled;
+static int dslots_jump_total;
+
+/* # of nops needed by previous insn. */
+static int dslots_number_nops;
+
+/* Number of 1/2/3 word references to data items (ie, not jal's). */
+static int num_refs[3];
+
+/* Registers to check for load delay. */
+static rtx iq2000_load_reg;
+static rtx iq2000_load_reg2;
+static rtx iq2000_load_reg3;
+static rtx iq2000_load_reg4;
+
+/* The target cpu for code generation. */
+static enum processor_type iq2000_arch;
/* Mode used for saving/restoring general purpose registers. */
static enum machine_mode gpr_mode;
-/* List of all IQ2000 punctuation characters used by print_operand. */
-char iq2000_print_operand_punct[256];
/* Initialize the GCC target structure. */
-#undef TARGET_INIT_BUILTINS
-#define TARGET_INIT_BUILTINS iq2000_init_builtins
-
-#undef TARGET_EXPAND_BUILTIN
-#define TARGET_EXPAND_BUILTIN iq2000_expand_builtin
-
-#undef TARGET_ASM_SELECT_RTX_SECTION
-#define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section
+static struct machine_function* iq2000_init_machine_status (void);
+static void iq2000_select_rtx_section (enum machine_mode, rtx, unsigned HOST_WIDE_INT);
+static void iq2000_init_builtins (void);
+static rtx iq2000_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+static bool iq2000_rtx_costs (rtx, int, int, int *);
+static int iq2000_address_cost (rtx);
+static void iq2000_select_section (tree, int, unsigned HOST_WIDE_INT);
+
+#undef TARGET_INIT_BUILTINS
+#define TARGET_INIT_BUILTINS iq2000_init_builtins
+#undef TARGET_EXPAND_BUILTIN
+#define TARGET_EXPAND_BUILTIN iq2000_expand_builtin
+#undef TARGET_ASM_SELECT_RTX_SECTION
+#define TARGET_ASM_SELECT_RTX_SECTION iq2000_select_rtx_section
+#undef TARGET_RTX_COSTS
+#define TARGET_RTX_COSTS iq2000_rtx_costs
+#undef TARGET_ADDRESS_COST
+#define TARGET_ADDRESS_COST iq2000_address_cost
+#undef TARGET_ASM_SELECT_SECTION
+#define TARGET_ASM_SELECT_SECTION iq2000_select_section
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -189,7 +194,7 @@ uns_arith_operand (rtx op, enum machine_mode mode)
return register_operand (op, mode);
}
-/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */
+/* Return 1 if OP can be used as an operand where a 16 bit integer is needed. */
int
arith_operand (rtx op, enum machine_mode mode)
@@ -200,7 +205,7 @@ arith_operand (rtx op, enum machine_mode mode)
return register_operand (op, mode);
}
-/* Return 1 if OP is a integer which fits in 16 bits */
+/* Return 1 if OP is a integer which fits in 16 bits. */
int
small_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
@@ -221,15 +226,15 @@ large_int (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
value = INTVAL (op);
- /* ior reg,$r0,value */
+ /* IOR reg,$r0,value. */
if ((value & ~ ((HOST_WIDE_INT) 0x0000ffff)) == 0)
return 0;
- /* subu reg,$r0,value */
+ /* SUBU reg,$r0,value. */
if (((unsigned HOST_WIDE_INT) (value + 32768)) <= 32767)
return 0;
- /* lui reg,value>>16 */
+ /* LUI reg,value >> 16. */
if ((value & 0x0000ffff) == 0)
return 0;
@@ -268,11 +273,11 @@ simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
rtx addr, plus0, plus1;
- /* Eliminate non-memory operations */
+ /* Eliminate non-memory operations. */
if (GET_CODE (op) != MEM)
return 0;
- /* dword operations really put out 2 instructions, so eliminate them. */
+ /* Dword operations really put out 2 instructions, so eliminate them. */
if (GET_MODE_SIZE (GET_MODE (op)) > (unsigned) UNITS_PER_WORD)
return 0;
@@ -292,12 +297,12 @@ simple_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
plus1 = XEXP (addr, 1);
if (GET_CODE (plus0) == REG
&& GET_CODE (plus1) == CONST_INT && SMALL_INT (plus1)
- && SMALL_INT_UNSIGNED (plus1) /* No negative offsets */)
+ && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */)
return 1;
else if (GET_CODE (plus1) == REG
&& GET_CODE (plus0) == CONST_INT && SMALL_INT (plus0)
- && SMALL_INT_UNSIGNED (plus1) /* No negative offsets */)
+ && SMALL_INT_UNSIGNED (plus1) /* No negative offsets. */)
return 1;
else
@@ -324,7 +329,7 @@ equality_op (rtx op, enum machine_mode mode)
return GET_CODE (op) == EQ || GET_CODE (op) == NE;
}
-/* Return nonzero if the code is a relational operations (EQ, LE, etc.) */
+/* Return nonzero if the code is a relational operations (EQ, LE, etc). */
int
cmp_op (rtx op, enum machine_mode mode)
@@ -449,8 +454,8 @@ iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict)
if (GET_CODE (xinsn) == LO_SUM)
{
- register rtx xlow0 = XEXP (xinsn, 0);
- register rtx xlow1 = XEXP (xinsn, 1);
+ rtx xlow0 = XEXP (xinsn, 0);
+ rtx xlow1 = XEXP (xinsn, 1);
while (GET_CODE (xlow0) == SUBREG)
xlow0 = SUBREG_REG (xlow0);
@@ -462,10 +467,10 @@ iq2000_legitimate_address_p (enum machine_mode mode, rtx xinsn, int strict)
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;
+ 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);
@@ -504,10 +509,10 @@ const char *
iq2000_fill_delay_slot (const char *ret, enum delay_type type, rtx operands[],
rtx cur_insn)
{
- register rtx set_reg;
- register enum machine_mode mode;
- register rtx next_insn = cur_insn ? NEXT_INSN (cur_insn) : NULL_RTX;
- register int num_nops;
+ rtx set_reg;
+ enum machine_mode mode;
+ rtx next_insn = cur_insn ? NEXT_INSN (cur_insn) : NULL_RTX;
+ int num_nops;
if (type == DELAY_LOAD || type == DELAY_FCMP)
num_nops = 1;
@@ -536,6 +541,7 @@ iq2000_fill_delay_slot (const char *ret, enum delay_type type, rtx operands[],
iq2000_load_reg2 = 0;
iq2000_load_reg3 = 0;
iq2000_load_reg4 = 0;
+
return ret;
}
@@ -644,7 +650,7 @@ iq2000_count_memory_refs (rtx op, int num)
break;
case LABEL_REF:
- n_words = 2; /* always 2 words */
+ n_words = 2; /* Always 2 words. */
break;
case CONST:
@@ -672,6 +678,16 @@ iq2000_count_memory_refs (rtx op, int num)
num_refs[n_words-1] += num;
}
+/* Abort after printing out a specific insn. */
+
+static void
+abort_with_insn (rtx insn, const char * reason)
+{
+ error (reason);
+ debug_rtx (insn);
+ abort ();
+}
+
/* Return the appropriate instructions to move one operand to another. */
const char *
@@ -904,7 +920,7 @@ iq2000_move_1word (rtx operands[], rtx insn, int unsignedp)
/* Provide the costs of an addressing mode that contains ADDR. */
-int
+static int
iq2000_address_cost (rtx addr)
{
switch (GET_CODE (addr))
@@ -918,7 +934,8 @@ iq2000_address_cost (rtx addr)
case CONST:
{
rtx offset = const0_rtx;
- addr = eliminate_constant_term (XEXP (addr, 0), &offset);
+
+ addr = eliminate_constant_term (XEXP (addr, 0), & offset);
if (GET_CODE (addr) == LABEL_REF)
return 2;
@@ -929,15 +946,15 @@ iq2000_address_cost (rtx addr)
return 2;
}
- /* ... fall through ... */
+ /* Fall through. */
case SYMBOL_REF:
return SYMBOL_REF_FLAG (addr) ? 1 : 2;
case PLUS:
{
- register rtx plus0 = XEXP (addr, 0);
- register rtx plus1 = XEXP (addr, 1);
+ rtx plus0 = XEXP (addr, 0);
+ rtx plus1 = XEXP (addr, 1);
if (GET_CODE (plus0) != REG && GET_CODE (plus1) == REG)
plus0 = XEXP (addr, 1), plus1 = XEXP (addr, 0);
@@ -994,15 +1011,11 @@ map_test_to_internal_test (enum rtx_code test_code)
return test;
}
-/* Generate the code to compare two integer values. The return value is:
+/* Generate the code to do a TEST_CODE comparison on two integer values CMP0
+ and CMP1. P_INVERT is NULL or ptr if branch needs to reverse its test.
+ The return value RESULT is:
(reg:SI xx) The pseudo register the comparison is in
- 0 No register, generate a simple branch.
-
- TEST_CODE: relational test (EQ, etc).
- RESULT: result to store comp. or 0 if branch.
- CMP0: first operand to compare
- CMP1: second operand to compare
- *P_INVERT: NULL or ptr to hold whether branch needs to reverse its test. */
+ 0 No register, generate a simple branch. */
rtx
gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
@@ -1010,18 +1023,18 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
{
struct cmp_info
{
- enum rtx_code test_code; /* code to use in instruction (LT vs. LTU) */
- int const_low; /* low bound of constant we can accept */
- int const_high; /* high bound of constant we can accept */
- 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 */
+ enum rtx_code test_code; /* Code to use in instruction (LT vs. LTU). */
+ int const_low; /* Low bound of constant we can accept. */
+ int const_high; /* High bound of constant we can accept. */
+ 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 ] = {
-
+ static struct cmp_info info[ (int)ITEST_MAX ] =
+ {
{ XOR, 0, 65535, 0, 0, 0, 0, 0 }, /* EQ */
{ XOR, 0, 65535, 0, 0, 1, 1, 0 }, /* NE */
{ LT, -32769, 32766, 1, 1, 1, 0, 0 }, /* GT */
@@ -1054,13 +1067,13 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
if (mode == VOIDmode)
mode = GET_MODE (cmp1);
- /* Eliminate simple branches */
+ /* Eliminate simple branches. */
branch_p = (result == 0);
if (branch_p)
{
if (GET_CODE (cmp0) == REG || GET_CODE (cmp0) == SUBREG)
{
- /* Comparisons against zero are simple branches */
+ /* Comparisons against zero are simple branches. */
if (GET_CODE (cmp1) == CONST_INT && INTVAL (cmp1) == 0)
return 0;
@@ -1069,7 +1082,7 @@ gen_int_relational (enum rtx_code test_code, rtx result, rtx cmp0, rtx cmp1,
return 0;
}
- /* allocate a pseudo to calculate the value in. */
+ /* Allocate a pseudo to calculate the value in. */
result = gen_reg_rtx (mode);
}
@@ -1205,7 +1218,7 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code)
case CMP_DF:
reg = gen_reg_rtx (CCmode);
- /* For cmp0 != cmp1, build cmp0 == cmp1, and test for result == 0 */
+ /* For cmp0 != cmp1, build cmp0 == cmp1, and test for result == 0. */
emit_insn (gen_rtx_SET (VOIDmode, reg,
gen_rtx (test_code == NE ? EQ : test_code,
CCmode, cmp0, cmp1)));
@@ -1222,7 +1235,6 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code)
}
/* Generate the branch. */
-
label1 = gen_rtx_LABEL_REF (VOIDmode, operands[0]);
label2 = pc_rtx;
@@ -1239,19 +1251,20 @@ gen_conditional_branch (rtx operands[], enum rtx_code test_code)
label1, label2)));
}
-/* Initialize CUMULATIVE_ARGS for a function. */
+/* Initialize CUM for a function FNTYPE. */
void
init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
rtx libname ATTRIBUTE_UNUSED)
{
static CUMULATIVE_ARGS zero_cum;
- tree param, next_param;
+ tree param;
+ tree next_param;
if (TARGET_DEBUG_D_MODE)
{
fprintf (stderr,
- "\ninit_cumulative_args, fntype = 0x%.8lx", (long)fntype);
+ "\ninit_cumulative_args, fntype = 0x%.8lx", (long) fntype);
if (!fntype)
fputc ('\n', stderr);
@@ -1259,6 +1272,7 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
else
{
tree ret_type = TREE_TYPE (fntype);
+
fprintf (stderr, ", fntype code = %s, ret code = %s\n",
tree_code_name[(int)TREE_CODE (fntype)],
tree_code_name[(int)TREE_CODE (ret_type)]);
@@ -1281,7 +1295,8 @@ init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype,
}
}
-/* Advance the argument to the next argument position. */
+/* Advance the argument of type TYPE and mode MODE to the next argument
+ position in CUM. */
void
function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
@@ -1320,7 +1335,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
break;
case SFmode:
- cum->arg_words++;
+ cum->arg_words ++;
if (! cum->gp_reg_found && cum->arg_number <= 2)
cum->fp_code += 1 << ((cum->arg_number - 1) * 2);
break;
@@ -1340,13 +1355,13 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
case HImode:
case SImode:
cum->gp_reg_found = 1;
- cum->arg_words++;
+ cum->arg_words ++;
break;
}
}
-/* Return an RTL expression containing the register for the given mode,
- or 0 if the argument is to be passed on the stack. */
+/* Return an RTL expression containing the register for the given mode MODE
+ and type TYPE in CUM, or 0 if the argument is to be passed on the stack. */
struct rtx_def *
function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
@@ -1450,13 +1465,12 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
/* ??? If this is a packed structure, then the last hunk won't
be 64 bits. */
-
chunks
= tree_low_cst (TYPE_SIZE_UNIT (type), 1) / UNITS_PER_WORD;
if (chunks + *arg_words + bias > (unsigned) MAX_ARGS_IN_REGISTERS)
chunks = MAX_ARGS_IN_REGISTERS - *arg_words - bias;
- /* assign_parms checks the mode of ENTRY_PARM, so we must
+ /* Assign_parms checks the mode of ENTRY_PARM, so we must
use the actual mode here. */
ret = gen_rtx_PARALLEL (mode, rtvec_alloc (chunks));
@@ -1532,21 +1546,20 @@ void
iq2000_va_start (tree valist, rtx nextarg)
{
int int_arg_words;
-
- /* Find out how many non-float named formals */
+ /* Find out how many non-float named formals. */
int gpr_save_area_size;
- /* Note UNITS_PER_WORD is 4 bytes */
+ /* Note UNITS_PER_WORD is 4 bytes. */
int_arg_words = current_function_args_info.arg_words;
+
if (int_arg_words < 8 )
- /* Adjust for the prologue's economy measure */
+ /* Adjust for the prologue's economy measure. */
gpr_save_area_size = (8 - int_arg_words) * UNITS_PER_WORD;
else
gpr_save_area_size = 0;
/* Everything is in the GPR save area, or in the overflow
area which is contiguous with it. */
-
- nextarg = plus_constant (nextarg, -gpr_save_area_size);
+ nextarg = plus_constant (nextarg, - gpr_save_area_size);
std_expand_builtin_va_start (valist, nextarg);
}
@@ -1558,7 +1571,6 @@ iq2000_va_arg (tree valist, tree type)
HOST_WIDE_INT size, rsize;
rtx addr_rtx;
tree t;
-
int indirect;
rtx r, lab_over = NULL_RTX, lab_false;
tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff;
@@ -1579,8 +1591,8 @@ iq2000_va_arg (tree valist, tree type)
{
/* Case of all args in a merged stack. No need to check bounds,
just advance valist along the stack. */
-
tree gpr = valist;
+
if (! indirect
&& TYPE_ALIGN (type) > (unsigned) BITS_PER_WORD)
{
@@ -1616,7 +1628,6 @@ iq2000_va_arg (tree valist, tree type)
}
/* Not a simple merged stack. Need ptrs and indexes left by va_start. */
-
f_ovfl = TYPE_FIELDS (va_list_type_node);
f_gtop = TREE_CHAIN (f_ovfl);
f_ftop = TREE_CHAIN (f_gtop);
@@ -1634,26 +1645,25 @@ iq2000_va_arg (tree valist, tree type)
if (TREE_CODE (type) == REAL_TYPE)
{
-
/* Emit code to branch if foff == 0. */
r = expand_expr (foff, NULL_RTX, TYPE_MODE (TREE_TYPE (foff)),
EXPAND_NORMAL);
emit_cmp_and_jump_insns (r, const0_rtx, EQ,
const1_rtx, GET_MODE (r), 1, lab_false);
- /* Emit code for addr_rtx = ftop - foff */
+ /* Emit code for addr_rtx = ftop - foff. */
t = build (MINUS_EXPR, TREE_TYPE (ftop), ftop, foff );
r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
if (r != addr_rtx)
emit_move_insn (addr_rtx, r);
/* Emit code for foff-=8.
- Advances the offset up FPR save area by one double */
+ 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);
expand_expr (t, const0_rtx, VOIDmode, EXPAND_NORMAL);
- emit_queue();
+ emit_queue ();
emit_jump (lab_over);
emit_barrier ();
emit_label (lab_false);
@@ -1681,7 +1691,7 @@ iq2000_va_arg (tree valist, tree type)
}
else
{
- /* not REAL_TYPE */
+ /* Not REAL_TYPE. */
int step_size;
if (TREE_CODE (type) == INTEGER_TYPE
@@ -1726,7 +1736,7 @@ iq2000_va_arg (tree valist, tree type)
emit_barrier ();
emit_label (lab_false);
- /* Emit code for addr_rtx -> overflow area, postinc by step_size */
+ /* Emit code for addr_rtx -> overflow area, postinc by step_size. */
t = build (POSTINCREMENT_EXPR, TREE_TYPE(ovfl), ovfl,
size_int (step_size));
r = expand_expr (t, addr_rtx, Pmode, EXPAND_NORMAL);
@@ -1751,22 +1761,46 @@ iq2000_va_arg (tree valist, tree type)
}
}
-/* Abort after printing out a specific insn. */
+/* Allocate a chunk of memory for per-function machine-dependent data. */
-static void
-abort_with_insn (rtx insn, const char *reason)
+static struct machine_function *
+iq2000_init_machine_status (void)
{
- error (reason);
- debug_rtx (insn);
- abort ();
+ struct machine_function *f;
+
+ f = ggc_alloc_cleared (sizeof (struct machine_function));
+
+ return f;
}
-
+
+static enum processor_type
+iq2000_parse_cpu (const char * cpu_string)
+{
+ const char *p = cpu_string;
+ enum processor_type cpu;
+
+ cpu = PROCESSOR_DEFAULT;
+ switch (p[2])
+ {
+ case '1':
+ if (!strcmp (p, "iq10"))
+ cpu = PROCESSOR_IQ10;
+ break;
+ case '2':
+ if (!strcmp (p, "iq2000"))
+ cpu = PROCESSOR_IQ2000;
+ break;
+ }
+
+ return cpu;
+}
+
/* Detect any conflicts in the switches. */
void
override_options (void)
{
- register enum processor_type iq2000_cpu;
+ enum processor_type iq2000_cpu;
target_flags &= ~MASK_GPOPT;
@@ -1838,16 +1872,7 @@ override_options (void)
gpr_mode = SImode;
/* Function to allocate machine-dependent function status. */
- init_machine_status = &iq2000_init_machine_status;
-}
-
-/* Allocate a chunk of memory for per-function machine-dependent data. */
-
-static struct machine_function *
-iq2000_init_machine_status (void)
-{
- return ((struct machine_function *)
- ggc_alloc_cleared (sizeof (struct machine_function)));
+ init_machine_status = iq2000_init_machine_status;
}
/* The arg pointer (which is eliminated) points to the virtual frame pointer,
@@ -1858,7 +1883,7 @@ HOST_WIDE_INT
iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset)
{
rtx offset2 = const0_rtx;
- rtx reg = eliminate_constant_term (addr, &offset2);
+ rtx reg = eliminate_constant_term (addr, & offset2);
if (offset == 0)
offset = INTVAL (offset2);
@@ -1866,9 +1891,9 @@ iq2000_debugger_offset (rtx addr, HOST_WIDE_INT offset)
if (reg == stack_pointer_rtx || reg == frame_pointer_rtx
|| reg == hard_frame_pointer_rtx)
{
- HOST_WIDE_INT frame_size = (!cfun->machine->frame.initialized)
+ HOST_WIDE_INT frame_size = (!cfun->machine->initialized)
? compute_frame_size (get_frame_size ())
- : cfun->machine->frame.total_size;
+ : cfun->machine->total_size;
offset = offset - frame_size;
}
@@ -1898,7 +1923,7 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
rtx pattern = PATTERN (insn);
int length = get_attr_length (insn);
- /* Do we need to emit a NOP? */
+ /* Do we need to emit a NOP? */
if (length == 0
|| (iq2000_load_reg != 0 && reg_mentioned_p (iq2000_load_reg, pattern))
|| (iq2000_load_reg2 != 0 && reg_mentioned_p (iq2000_load_reg2, pattern))
@@ -1908,7 +1933,7 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
fputs ("\tnop\n", asm_out_file);
else
- dslots_load_filled++;
+ dslots_load_filled ++;
while (--dslots_number_nops > 0)
fputs ("\tnop\n", asm_out_file);
@@ -1919,22 +1944,23 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
iq2000_load_reg4 = 0;
}
- if ((GET_CODE (insn) == JUMP_INSN
+ if ( (GET_CODE (insn) == JUMP_INSN
|| GET_CODE (insn) == CALL_INSN
|| (GET_CODE (PATTERN (insn)) == RETURN))
&& NEXT_INSN (PREV_INSN (insn)) == insn)
{
rtx nop_insn = emit_insn_after (gen_nop (), insn);
+
INSN_ADDRESSES_NEW (nop_insn, -1);
}
if (TARGET_STATS
&& (GET_CODE (insn) == JUMP_INSN || GET_CODE (insn) == CALL_INSN))
- dslots_jump_total++;
+ dslots_jump_total ++;
}
/* Return the bytes needed to compute the frame pointer from the current
- stack pointer.
+ stack pointer where SIZE is the # of var. bytes allocated.
IQ2000 stack frames look like:
@@ -1982,24 +2008,22 @@ final_prescan_insn (rtx insn, rtx opvec[] ATTRIBUTE_UNUSED,
| arguments passed |
| in registers, even |
low SP->| if not passed. |
- memory +-----------------------+
-
-*/
+ memory +-----------------------+ */
HOST_WIDE_INT
compute_frame_size (HOST_WIDE_INT size)
{
int regno;
- HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */
- HOST_WIDE_INT var_size; /* # bytes that variables take up */
- HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */
- HOST_WIDE_INT extra_size; /* # extra bytes */
- HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */
- HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */
- HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */
- long mask; /* mask of saved gp registers */
- int fp_inc; /* 1 or 2 depending on the size of fp regs */
- long fp_bits; /* bitmask to use for each fp register */
+ HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */
+ HOST_WIDE_INT var_size; /* # bytes that variables take up. */
+ HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up. */
+ HOST_WIDE_INT extra_size; /* # extra bytes. */
+ HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding. */
+ HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs. */
+ HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs. */
+ long mask; /* mask of saved gp registers. */
+ int fp_inc; /* 1 or 2 depending on the size of fp regs. */
+ long fp_bits; /* bitmask to use for each fp register. */
gp_reg_size = 0;
fp_reg_size = 0;
@@ -2009,8 +2033,7 @@ compute_frame_size (HOST_WIDE_INT size)
args_size = IQ2000_STACK_ALIGN (current_function_outgoing_args_size);
/* If a function dynamically allocates the stack and
- has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space */
-
+ has 0 for STACK_DYNAMIC_OFFSET then allocate some stack space. */
if (args_size == 0 && current_function_calls_alloca)
args_size = 4 * UNITS_PER_WORD;
@@ -2029,11 +2052,12 @@ compute_frame_size (HOST_WIDE_INT size)
/* We need to restore these for the handler. */
if (current_function_calls_eh_return)
{
- int i;
+ unsigned int i;
+
for (i = 0; ; ++i)
{
regno = EH_RETURN_DATA_REGNO (i);
- if (regno == (signed int) INVALID_REGNUM)
+ if (regno == (int) INVALID_REGNUM)
break;
gp_reg_size += GET_MODE_SIZE (gpr_mode);
mask |= 1L << (regno - GP_REG_FIRST);
@@ -2054,15 +2078,15 @@ compute_frame_size (HOST_WIDE_INT size)
total_size += IQ2000_STACK_ALIGN (current_function_pretend_args_size);
/* Save other computed information. */
- cfun->machine->frame.total_size = total_size;
- cfun->machine->frame.var_size = var_size;
- cfun->machine->frame.args_size = args_size;
- cfun->machine->frame.extra_size = extra_size;
- cfun->machine->frame.gp_reg_size = gp_reg_size;
- cfun->machine->frame.fp_reg_size = fp_reg_size;
- cfun->machine->frame.mask = mask;
- cfun->machine->frame.initialized = reload_completed;
- cfun->machine->frame.num_gp = gp_reg_size / UNITS_PER_WORD;
+ cfun->machine->total_size = total_size;
+ cfun->machine->var_size = var_size;
+ cfun->machine->args_size = args_size;
+ cfun->machine->extra_size = extra_size;
+ cfun->machine->gp_reg_size = gp_reg_size;
+ cfun->machine->fp_reg_size = fp_reg_size;
+ cfun->machine->mask = mask;
+ cfun->machine->initialized = reload_completed;
+ cfun->machine->num_gp = gp_reg_size / UNITS_PER_WORD;
if (mask)
{
@@ -2071,17 +2095,17 @@ compute_frame_size (HOST_WIDE_INT size)
offset = (args_size + extra_size + var_size
+ gp_reg_size - GET_MODE_SIZE (gpr_mode));
- cfun->machine->frame.gp_sp_offset = offset;
- cfun->machine->frame.gp_save_offset = offset - total_size;
+ cfun->machine->gp_sp_offset = offset;
+ cfun->machine->gp_save_offset = offset - total_size;
}
else
{
- cfun->machine->frame.gp_sp_offset = 0;
- cfun->machine->frame.gp_save_offset = 0;
+ cfun->machine->gp_sp_offset = 0;
+ cfun->machine->gp_save_offset = 0;
}
- cfun->machine->frame.fp_sp_offset = 0;
- cfun->machine->frame.fp_save_offset = 0;
+ cfun->machine->fp_sp_offset = 0;
+ cfun->machine->fp_save_offset = 0;
/* Ok, we're done. */
return total_size;
@@ -2100,15 +2124,15 @@ iq2000_initial_elimination_offset (int from, int to ATTRIBUTE_UNUSED)
if ((from) == FRAME_POINTER_REGNUM)
(offset) = 0;
else if ((from) == ARG_POINTER_REGNUM)
- (offset) = (cfun->machine->frame.total_size);
+ (offset) = (cfun->machine->total_size);
else if ((from) == RETURN_ADDRESS_POINTER_REGNUM)
- {
- if (leaf_function_p ())
- (offset) = 0;
- else (offset) = cfun->machine->frame.gp_sp_offset
- + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT))
- * (BYTES_BIG_ENDIAN != 0));
- }
+ {
+ if (leaf_function_p ())
+ (offset) = 0;
+ else (offset) = cfun->machine->gp_sp_offset
+ + ((UNITS_PER_WORD - (POINTER_SIZE / BITS_PER_UNIT))
+ * (BYTES_BIG_ENDIAN != 0));
+ }
return offset;
}
@@ -2164,10 +2188,12 @@ iq2000_emit_frame_related_store (rtx mem, rtx reg, HOST_WIDE_INT offset)
gen_rtx_SET (GET_MODE (reg), dwarf_mem, reg));
}
+/* Emit instructions to save/restore registers, as determined by STORE_P. */
+
static void
save_restore_insns (int store_p)
{
- long mask = cfun->machine->frame.mask;
+ long mask = cfun->machine->mask;
int regno;
rtx base_reg_rtx;
HOST_WIDE_INT base_offset;
@@ -2196,9 +2222,9 @@ save_restore_insns (int store_p)
the constant created in the prologue/epilogue to adjust the stack
frame. */
- gp_offset = cfun->machine->frame.gp_sp_offset;
+ gp_offset = cfun->machine->gp_sp_offset;
end_offset
- = gp_offset - (cfun->machine->frame.gp_reg_size
+ = gp_offset - (cfun->machine->gp_reg_size
- GET_MODE_SIZE (gpr_mode));
if (gp_offset < 0 || end_offset < 0)
@@ -2212,6 +2238,7 @@ save_restore_insns (int store_p)
{
int regno;
int reg_save_count = 0;
+
for (regno = GP_REG_LAST; regno >= GP_REG_FIRST; regno--)
if (BITSET_P (mask, regno - GP_REG_FIRST)) reg_save_count += 1;
base_offset = gp_offset - ((reg_save_count - 1) * 4);
@@ -2263,9 +2290,9 @@ iq2000_expand_prologue (void)
int store_args_on_stack = (iq2000_can_use_return_insn ());
/* If struct value address is treated as the first argument. */
- if (aggregate_value_p (DECL_RESULT (fndecl))
+ if (aggregate_value_p (DECL_RESULT (fndecl), fndecl)
&& ! current_function_returns_pcc_struct
- && struct_value_incoming_rtx == 0)
+ && targetm.calls.struct_value_rtx (TREE_TYPE (fndecl), 1) == 0)
{
tree type = build_pointer_type (fntype);
tree function_result_decl = build_decl (PARM_DECL, NULL_TREE, type);
@@ -2282,7 +2309,6 @@ iq2000_expand_prologue (void)
variable arguments.
This is only needed if store_args_on_stack is true. */
-
INIT_CUMULATIVE_ARGS (args_so_far, fntype, NULL_RTX, 0);
regno = GP_ARG_FIRST;
@@ -2343,7 +2369,6 @@ iq2000_expand_prologue (void)
Function_arg has encoded a PARALLEL rtx, holding a vector of
adjustments to be made as the next_arg_reg variable, so we split up the
insns, and emit them separately. */
-
next_arg_reg = FUNCTION_ARG (args_so_far, VOIDmode, void_type_node, 1);
if (next_arg_reg != 0 && GET_CODE (next_arg_reg) == PARALLEL)
{
@@ -2438,7 +2463,7 @@ iq2000_expand_prologue (void)
void
iq2000_expand_epilogue (void)
{
- HOST_WIDE_INT tsize = cfun->machine->frame.total_size;
+ HOST_WIDE_INT tsize = cfun->machine->total_size;
rtx tsize_rtx = GEN_INT (tsize);
rtx tmp_rtx = (rtx)0;
@@ -2499,7 +2524,7 @@ iq2000_expand_epilogue (void)
void
iq2000_expand_eh_return (rtx address)
{
- HOST_WIDE_INT gp_offset = cfun->machine->frame.gp_sp_offset;
+ HOST_WIDE_INT gp_offset = cfun->machine->gp_sp_offset;
rtx scratch;
scratch = plus_constant (stack_pointer_rtx, gp_offset);
@@ -2519,8 +2544,8 @@ iq2000_can_use_return_insn (void)
if (regs_ever_live[31] || profile_flag)
return 0;
- if (cfun->machine->frame.initialized)
- return cfun->machine->frame.total_size == 0;
+ if (cfun->machine->initialized)
+ return cfun->machine->total_size == 0;
return compute_frame_size (get_frame_size ()) == 0;
}
@@ -2576,7 +2601,6 @@ iq2000_select_section (tree decl, int reloc ATTRIBUTE_UNUSED,
{
/* For embedded applications, always put an object in read-only data
if possible, in order to reduce RAM usage. */
-
if (((TREE_CODE (decl) == VAR_DECL
&& TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
&& DECL_INITIAL (decl)
@@ -2594,7 +2618,6 @@ iq2000_select_section (tree decl, int reloc ATTRIBUTE_UNUSED,
{
/* For hosted applications, always put an object in small data if
possible, as this gives the best performance. */
-
if (((TREE_CODE (decl) == VAR_DECL
&& TREE_READONLY (decl) && !TREE_SIDE_EFFECTS (decl)
&& DECL_INITIAL (decl)
@@ -2639,13 +2662,13 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
/* We must pass by reference if we would be both passing in registers
and the stack. This is because any subsequent partial arg would be
handled incorrectly in this case. */
-
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
passed in registers. */
CUMULATIVE_ARGS temp;
+
temp = *cum;
if (FUNCTION_ARG (temp, mode, type, named) != 0)
return 1;
@@ -2665,10 +2688,10 @@ int
iq2000_adjust_insn_length (rtx insn, int length)
{
/* A unconditional jump has an unfilled delay slot if it is not part
- of a sequence. A conditional jump normally has a delay slot */
+ of a sequence. A conditional jump normally has a delay slot. */
if (simplejump_p (insn)
- || ((GET_CODE (insn) == JUMP_INSN
- || GET_CODE (insn) == CALL_INSN)))
+ || ( (GET_CODE (insn) == JUMP_INSN
+ || GET_CODE (insn) == CALL_INSN)))
length += 4;
return length;
@@ -2690,13 +2713,13 @@ iq2000_adjust_insn_length (rtx insn, int length)
reversed conditional branch around a `jr' instruction. */
char *
-iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
+iq2000_output_conditional_branch (rtx insn, rtx * operands, int two_operands_p,
int float_p, int inverted_p, int length)
{
static char buffer[200];
/* The kind of comparison we are doing. */
enum rtx_code code = GET_CODE (operands[0]);
- /* Nonzero if the opcode for the comparison needs a `z' indicating
+ /* nonzero if the opcode for the comparison needs a `z' indicating
that it is a comparison against zero. */
int need_z_p;
/* A string to use in the assembly output to represent the first
@@ -2711,7 +2734,7 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
/* The operand-printing string for the inverted comparison. */
const char *inverted_comp = (float_p ? "%W0" : "%N0");
- /* likely variants of each branch instruction annul the instruction
+ /* Likely variants of each branch instruction annul the instruction
in the delay slot if the branch is not taken. */
iq2000_branch_likely = (final_sequence && INSN_ANNULLED_BRANCH_P (insn));
@@ -2813,7 +2836,7 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
char *c;
c = strchr (buffer, '\0');
- /* Generate the reversed comparison. This takes four
+ /* Generate the reversed comparision. This takes four
bytes. */
if (float_p)
sprintf (c, "b%s\t%%Z2%s",
@@ -2843,32 +2866,10 @@ iq2000_output_conditional_branch (rtx insn, rtx *operands, int two_operands_p,
return 0;
}
-static enum processor_type
-iq2000_parse_cpu (const char *cpu_string)
-{
- const char *p = cpu_string;
- enum processor_type cpu;
-
- cpu = PROCESSOR_DEFAULT;
- switch (p[2])
- {
- case '1':
- if (!strcmp (p, "iq10"))
- cpu = PROCESSOR_IQ10;
- break;
- case '2':
- if (!strcmp (p, "iq2000"))
- cpu = PROCESSOR_IQ2000;
- break;
- }
-
- return cpu;
-}
-
#define def_builtin(NAME, TYPE, CODE) \
builtin_function ((NAME), (TYPE), (CODE), BUILT_IN_MD, NULL, NULL_TREE)
-void
+static void
iq2000_init_builtins (void)
{
tree endlink = void_list_node;
@@ -2999,7 +3000,7 @@ void_ftype_int_int_int
}
/* Builtin for ICODE having ARGCOUNT args in ARGLIST where each arg
- has an rtx CODE */
+ has an rtx CODE. */
static rtx
expand_one_builtin (enum insn_code icode, rtx target, tree arglist,
@@ -3079,7 +3080,7 @@ expand_one_builtin (enum insn_code icode, rtx target, tree arglist,
SUBTARGET may be used as the target for computing one of EXP's operands.
IGNORE is nonzero if the value is to be ignored. */
-rtx
+static rtx
iq2000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
enum machine_mode mode ATTRIBUTE_UNUSED,
int ignore ATTRIBUTE_UNUSED)
@@ -3263,11 +3264,12 @@ iq2000_expand_builtin (tree exp, rtx target, rtx subtarget ATTRIBUTE_UNUSED,
void
iq2000_setup_incoming_varargs (CUMULATIVE_ARGS cum, int mode ATTRIBUTE_UNUSED,
- tree type ATTRIBUTE_UNUSED, int *pretend_size,
- int no_rtl)
+ tree type ATTRIBUTE_UNUSED, int * pretend_size,
+ int no_rtl)
{
unsigned int iq2000_off = (! (cum).last_arg_fp);
unsigned int iq2000_fp_off = ((cum).last_arg_fp);
+
if (((cum).arg_words < MAX_ARGS_IN_REGISTERS - iq2000_off))
{
int iq2000_save_gp_regs
@@ -3303,11 +3305,10 @@ iq2000_setup_incoming_varargs (CUMULATIVE_ARGS cum, int mode ATTRIBUTE_UNUSED,
/* 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.
-*/
+ reference whose address is ADDR. ADDR is an RTL expression. */
void
-print_operand_address (FILE *file, rtx addr)
+print_operand_address (FILE * file, rtx addr)
{
if (!addr)
error ("PRINT_OPERAND_ADDRESS, null pointer");
@@ -3324,8 +3325,8 @@ print_operand_address (FILE *file, rtx addr)
case LO_SUM:
{
- register rtx arg0 = XEXP (addr, 0);
- register rtx arg1 = XEXP (addr, 1);
+ rtx arg0 = XEXP (addr, 0);
+ rtx arg1 = XEXP (addr, 1);
if (GET_CODE (arg0) != REG)
abort_with_insn (addr,
@@ -3339,10 +3340,10 @@ print_operand_address (FILE *file, rtx addr)
case PLUS:
{
- register rtx reg = 0;
- register rtx offset = 0;
- register rtx arg0 = XEXP (addr, 0);
- register rtx arg1 = XEXP (addr, 1);
+ rtx reg = 0;
+ rtx offset = 0;
+ rtx arg0 = XEXP (addr, 0);
+ rtx arg1 = XEXP (addr, 1);
if (GET_CODE (arg0) == REG)
{
@@ -3388,25 +3389,24 @@ print_operand_address (FILE *file, rtx addr)
}
}
-/* A C compound statement to output to stdio stream STREAM the
- assembler syntax for an instruction operand X. X is an RTL
- expression.
+/* A C compound statement to output to stdio stream FILE the
+ assembler syntax for an instruction operand OP.
- CODE is a value that can be used to specify one of several ways
+ LETTER 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
+ must be printed differently depending on the context. LETTER
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
+ then LETTER is 0; if the specification was `%LTR DIGIT' then LETTER
is the ASCII code for LTR.
- If X is a register, this macro should print the register's name.
+ If OP 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 null pointer for X and the punctuation character for LETTER.
The IQ2000 specific codes are:
@@ -3438,7 +3438,7 @@ print_operand_address (FILE *file, rtx addr)
void
print_operand (FILE *file, rtx op, int letter)
{
- register enum rtx_code code;
+ enum rtx_code code;
if (PRINT_OPERAND_PUNCT_VALID_P (letter))
{
@@ -3558,7 +3558,7 @@ print_operand (FILE *file, rtx op, int letter)
else if (letter == 'Z')
{
- register int regnum;
+ int regnum;
if (code != REG)
abort ();
@@ -3571,7 +3571,7 @@ print_operand (FILE *file, rtx op, int letter)
else if (code == REG || code == SUBREG)
{
- register int regnum;
+ int regnum;
if (code == REG)
regnum = REGNO (op);
@@ -3635,3 +3635,143 @@ print_operand (FILE *file, rtx op, int letter)
else
output_addr_const (file, op);
}
+
+static bool
+iq2000_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int * total)
+{
+ enum machine_mode mode = GET_MODE (x);
+
+ switch (code)
+ {
+ case MEM:
+ {
+ int num_words = (GET_MODE_SIZE (mode) > UNITS_PER_WORD) ? 2 : 1;
+
+ if (simple_memory_operand (x, mode))
+ return COSTS_N_INSNS (num_words);
+
+ * total = COSTS_N_INSNS (2 * num_words);
+ break;
+ }
+
+ case FFS:
+ * total = COSTS_N_INSNS (6);
+ break;
+
+ case AND:
+ case IOR:
+ case XOR:
+ case NOT:
+ * total = COSTS_N_INSNS (mode == DImode ? 2 : 1);
+ break;
+
+ case ASHIFT:
+ case ASHIFTRT:
+ case LSHIFTRT:
+ if (mode == DImode)
+ * total = COSTS_N_INSNS ((GET_CODE (XEXP (x, 1)) == CONST_INT) ? 4 : 12);
+ else
+ * total = COSTS_N_INSNS (1);
+ break;
+
+ case ABS:
+ if (mode == SFmode || mode == DFmode)
+ * total = COSTS_N_INSNS (1);
+ else
+ * total = COSTS_N_INSNS (4);
+ break;
+
+ case PLUS:
+ case MINUS:
+ if (mode == SFmode || mode == DFmode)
+ * total = COSTS_N_INSNS (6);
+ else if (mode == DImode)
+ * total = COSTS_N_INSNS (4);
+ else
+ * total = COSTS_N_INSNS (1);
+ break;
+
+ case NEG:
+ * total = (mode == DImode) ? 4 : 1;
+ break;
+
+ case MULT:
+ if (mode == SFmode)
+ * total = COSTS_N_INSNS (7);
+ else if (mode == DFmode)
+ * total = COSTS_N_INSNS (8);
+ else
+ * total = COSTS_N_INSNS (10);
+ break;
+
+ case DIV:
+ case MOD:
+ if (mode == SFmode)
+ * total = COSTS_N_INSNS (23);
+ else if (mode == DFmode)
+ * total = COSTS_N_INSNS (36);
+ else
+ * total = COSTS_N_INSNS (69);
+ break;
+
+ case UDIV:
+ case UMOD:
+ * total = COSTS_N_INSNS (69);
+ break;
+
+ case SIGN_EXTEND:
+ * total = COSTS_N_INSNS (2);
+ break;
+
+ case ZERO_EXTEND:
+ * total = COSTS_N_INSNS (1);
+ break;
+
+ case CONST_INT:
+ * total = 0;
+ break;
+
+ case LABEL_REF:
+ * total = COSTS_N_INSNS (2);
+ break;
+
+ case CONST:
+ {
+ rtx offset = const0_rtx;
+ rtx symref = eliminate_constant_term (XEXP (x, 0), & offset);
+
+ if (GET_CODE (symref) == LABEL_REF)
+ * total = COSTS_N_INSNS (2);
+ else if (GET_CODE (symref) != SYMBOL_REF)
+ * total = COSTS_N_INSNS (4);
+ /* let's be paranoid.... */
+ else if (INTVAL (offset) < -32768 || INTVAL (offset) > 32767)
+ * total = COSTS_N_INSNS (2);
+ else
+ * total = COSTS_N_INSNS (SYMBOL_REF_FLAG (symref) ? 1 : 2);
+ break;
+ }
+
+ case SYMBOL_REF:
+ * total = COSTS_N_INSNS (SYMBOL_REF_FLAG (x) ? 1 : 2);
+ break;
+
+ case CONST_DOUBLE:
+ {
+ rtx high, low;
+
+ split_double (x, & high, & low);
+
+ * total = COSTS_N_INSNS ( (high == CONST0_RTX (GET_MODE (high))
+ || low == CONST0_RTX (GET_MODE (low)))
+ ? 2 : 4);
+ break;
+ }
+
+ default:
+ return false;
+ }
+ return true;
+}
+
+#include "gt-iq2000.h"
diff --git a/gcc/config/iq2000/iq2000.h b/gcc/config/iq2000/iq2000.h
index f32d0c388c9..a54856a402b 100644
--- a/gcc/config/iq2000/iq2000.h
+++ b/gcc/config/iq2000/iq2000.h
@@ -21,7 +21,7 @@
/* Driver configuration. */
-#undef SWITCH_TAKES_ARG
+#undef SWITCH_TAKES_ARG
#define SWITCH_TAKES_ARG(CHAR) \
(DEFAULT_SWITCH_TAKES_ARG (CHAR) || (CHAR) == 'G')
@@ -38,28 +38,26 @@
#define TARGET_CPU_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__iq2000__"); \
- builtin_assert ("cpu=iq2000"); \
- builtin_assert ("machine=iq2000"); \
+ builtin_define ("__iq2000__"); \
+ builtin_assert ("cpu=iq2000"); \
+ builtin_assert ("machine=iq2000"); \
} \
while (0)
-
extern int target_flags;
-#define MASK_GPOPT 0x00000008 /* Optimize for global pointer */
-#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code */
+#define MASK_GPOPT 0x00000008 /* Optimize for global pointer. */
+#define MASK_EMBEDDED_DATA 0x00008000 /* Reduce RAM usage, not fast code. */
#define MASK_UNINIT_CONST_IN_RODATA \
0x00800000 /* Store uninitialized
- consts in rodata */
+ consts in rodata. */
/* Macros used in the machine description to test the flags. */
#define TARGET_STATS 0
- /* for embedded systems, optimize for
- reduced RAM space instead of for
- fastest code. */
+/* For embedded systems, optimize for reduced RAM space instead of for
+ fastest code. */
#define TARGET_EMBEDDED_DATA (target_flags & MASK_EMBEDDED_DATA)
#define TARGET_DEBUG_MODE (target_flags & 0)
@@ -134,23 +132,15 @@ extern int target_flags;
/* Storage Layout. */
-#define BITS_BIG_ENDIAN 0
-
-#define BYTES_BIG_ENDIAN 1
-
-#define WORDS_BIG_ENDIAN 1
-
-#define LIBGCC2_WORDS_BIG_ENDIAN 1
-
-#define BITS_PER_WORD 32
-
-#define MAX_BITS_PER_WORD 64
-
-#define UNITS_PER_WORD 4
-
-#define MIN_UNITS_PER_WORD 4
-
-#define POINTER_SIZE 32
+#define BITS_BIG_ENDIAN 0
+#define BYTES_BIG_ENDIAN 1
+#define WORDS_BIG_ENDIAN 1
+#define LIBGCC2_WORDS_BIG_ENDIAN 1
+#define BITS_PER_WORD 32
+#define MAX_BITS_PER_WORD 64
+#define UNITS_PER_WORD 4
+#define MIN_UNITS_PER_WORD 4
+#define POINTER_SIZE 32
/* 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,
@@ -177,7 +167,7 @@ extern int target_flags;
#define BIGGEST_ALIGNMENT 64
-#undef DATA_ALIGNMENT
+#undef DATA_ALIGNMENT
#define DATA_ALIGNMENT(TYPE, ALIGN) \
((((ALIGN) < BITS_PER_WORD) \
&& (TREE_CODE (TYPE) == ARRAY_TYPE \
@@ -201,27 +191,16 @@ extern int target_flags;
/* Layout of Source Language Data Types. */
-#define INT_TYPE_SIZE 32
-
-#define MAX_INT_TYPE_SIZE 32
-
-#define SHORT_TYPE_SIZE 16
-
-#define LONG_TYPE_SIZE 32
-
-#define LONG_LONG_TYPE_SIZE 64
-
-#define CHAR_TYPE_SIZE BITS_PER_UNIT
-
-#define FLOAT_TYPE_SIZE 32
-
-#define DOUBLE_TYPE_SIZE 64
-
-#define LONG_DOUBLE_TYPE_SIZE 64
-
-#define DEFAULT_SIGNED_CHAR 1
-
-#define MAX_WCHAR_TYPE_SIZE MAX_INT_TYPE_SIZE
+#define INT_TYPE_SIZE 32
+#define SHORT_TYPE_SIZE 16
+#define LONG_TYPE_SIZE 32
+#define LONG_LONG_TYPE_SIZE 64
+#define CHAR_TYPE_SIZE BITS_PER_UNIT
+#define FLOAT_TYPE_SIZE 32
+#define DOUBLE_TYPE_SIZE 64
+#define LONG_DOUBLE_TYPE_SIZE 64
+#define DEFAULT_SIGNED_CHAR 1
+#define MAX_WCHAR_TYPE_SIZE 32
/* Register Basics. */
@@ -255,15 +234,15 @@ extern int target_flags;
#define HARD_REGNO_NREGS(REGNO, MODE) \
((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD)
-#define HARD_REGNO_MODE_OK(REGNO, MODE) \
- ((REGNO_REG_CLASS (REGNO) == GR_REGS) \
- ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \
+#define HARD_REGNO_MODE_OK(REGNO, MODE) \
+ ((REGNO_REG_CLASS (REGNO) == GR_REGS) \
+ ? ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) <= 4 \
: ((REGNO) & 1) == 0 || GET_MODE_SIZE (MODE) == 4)
-#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 || \
+#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))
#define AVOID_CCMODE_COPIES
@@ -273,28 +252,28 @@ extern int target_flags;
enum reg_class
{
- NO_REGS, /* no registers in set */
- GR_REGS, /* integer registers */
- ALL_REGS, /* all registers */
- LIM_REG_CLASSES /* max value + 1 */
+ NO_REGS, /* No registers in set. */
+ GR_REGS, /* Integer registers. */
+ ALL_REGS, /* All registers. */
+ LIM_REG_CLASSES /* Max value + 1. */
};
#define GENERAL_REGS GR_REGS
#define N_REG_CLASSES (int) LIM_REG_CLASSES
-#define REG_CLASS_NAMES \
-{ \
- "NO_REGS", \
- "GR_REGS", \
- "ALL_REGS" \
+#define REG_CLASS_NAMES \
+{ \
+ "NO_REGS", \
+ "GR_REGS", \
+ "ALL_REGS" \
}
-#define REG_CLASS_CONTENTS \
-{ \
- { 0x00000000, 0x00000000 }, /* no registers */ \
- { 0xffffffff, 0x00000000 }, /* integer registers */ \
- { 0xffffffff, 0x00000001 } /* all registers */ \
+#define REG_CLASS_CONTENTS \
+{ \
+ { 0x00000000, 0x00000000 }, /* No registers, */ \
+ { 0xffffffff, 0x00000000 }, /* Integer registers. */ \
+ { 0xffffffff, 0x00000001 } /* All registers. */ \
}
#define REGNO_REG_CLASS(REGNO) \
@@ -305,22 +284,22 @@ enum reg_class
#define INDEX_REG_CLASS NO_REGS
#define REG_CLASS_FROM_LETTER(C) \
- ((C) == 'd' ? GR_REGS : \
- (C) == 'b' ? ALL_REGS : \
- (C) == 'y' ? GR_REGS : \
+ ((C) == 'd' ? GR_REGS : \
+ (C) == 'b' ? ALL_REGS : \
+ (C) == 'y' ? GR_REGS : \
NO_REGS)
#define REGNO_OK_FOR_INDEX_P(regno) 0
-#define PREFERRED_RELOAD_CLASS(X,CLASS) \
- ((CLASS) != ALL_REGS \
- ? (CLASS) \
- : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
- || GET_MODE_CLASS (GET_MODE (X)) == MODE_COMPLEX_FLOAT) \
- ? (GR_REGS) \
- : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
- || GET_MODE (X) == VOIDmode) \
- ? (GR_REGS) \
+#define PREFERRED_RELOAD_CLASS(X,CLASS) \
+ ((CLASS) != ALL_REGS \
+ ? (CLASS) \
+ : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_FLOAT \
+ || GET_MODE_CLASS (GET_MODE (X)) == MODE_COMPLEX_FLOAT) \
+ ? (GR_REGS) \
+ : ((GET_MODE_CLASS (GET_MODE (X)) == MODE_INT \
+ || GET_MODE (X) == VOIDmode) \
+ ? (GR_REGS) \
: (CLASS))))
#define SMALL_REGISTER_CLASSES 0
@@ -346,8 +325,7 @@ enum reg_class
`N' is used for constants 0xffffnnnn or 0xnnnnffff
- `O' is a 5 bit zero-extended integer.
-*/
+ `O' is a 5 bit zero-extended integer. */
#define CONST_OK_FOR_LETTER_P(VALUE, C) \
((C) == 'I' ? ((unsigned HOST_WIDE_INT) ((VALUE) + 0x8000) < 0x10000) \
@@ -412,18 +390,12 @@ enum reg_class
/* Register That Address the Stack Frame. */
-#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29)
-
-#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 1)
-
-#define HARD_FRAME_POINTER_REGNUM \
- (GP_REG_FIRST + 27)
-
-#define ARG_POINTER_REGNUM GP_REG_FIRST
-
-#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG_NUM
-
-#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)
+#define STACK_POINTER_REGNUM (GP_REG_FIRST + 29)
+#define FRAME_POINTER_REGNUM (GP_REG_FIRST + 1)
+#define HARD_FRAME_POINTER_REGNUM (GP_REG_FIRST + 27)
+#define ARG_POINTER_REGNUM GP_REG_FIRST
+#define RETURN_ADDRESS_POINTER_REGNUM RAP_REG_NUM
+#define STATIC_CHAIN_REGNUM (GP_REG_FIRST + 2)
/* Eliminating the Frame Pointer and the Arg Pointer. */
@@ -471,39 +443,40 @@ enum reg_class
/* Function Arguments in Registers. */
#define FUNCTION_ARG(CUM, MODE, TYPE, NAMED) \
- function_arg( &CUM, MODE, TYPE, NAMED)
+ function_arg (& CUM, MODE, TYPE, NAMED)
#define FUNCTION_ARG_PARTIAL_NREGS(CUM, MODE, TYPE, NAMED) \
- function_arg_partial_nregs (&CUM, MODE, TYPE, NAMED)
+ function_arg_partial_nregs (& CUM, MODE, TYPE, NAMED)
#define FUNCTION_ARG_PASS_BY_REFERENCE(CUM, MODE, TYPE, NAMED) \
- function_arg_pass_by_reference (&CUM, MODE, TYPE, NAMED)
+ function_arg_pass_by_reference (& CUM, MODE, TYPE, NAMED)
#define FUNCTION_ARG_CALLEE_COPIES(CUM, MODE, TYPE, NAMED) \
((NAMED) && FUNCTION_ARG_PASS_BY_REFERENCE (CUM, MODE, TYPE, NAMED))
#define MAX_ARGS_IN_REGISTERS 8
-typedef struct iq2000_args {
- int gp_reg_found; /* whether a gp register was found yet */
- unsigned int arg_number; /* argument number */
- unsigned int arg_words; /* # total words the arguments take */
- unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only) */
- int last_arg_fp; /* nonzero if last arg was FP (EABI only) */
- int fp_code; /* Mode of FP arguments */
- unsigned int num_adjusts; /* number of adjustments made */
+typedef struct iq2000_args
+{
+ int gp_reg_found; /* Whether a gp register was found yet. */
+ unsigned int arg_number; /* Argument number. */
+ unsigned int arg_words; /* # total words the arguments take. */
+ unsigned int fp_arg_words; /* # words for FP args (IQ2000_EABI only). */
+ int last_arg_fp; /* Nonzero if last arg was FP (EABI only). */
+ int fp_code; /* Mode of FP arguments. */
+ unsigned int num_adjusts; /* Number of adjustments made. */
/* Adjustments made to args pass in regs. */
- struct rtx_def *adjust[MAX_ARGS_IN_REGISTERS*2];
+ struct rtx_def * adjust[MAX_ARGS_IN_REGISTERS * 2];
} 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) \
+ init_cumulative_args (& CUM, FNTYPE, LIBNAME) \
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
- function_arg_advance (&CUM, MODE, TYPE, NAMED)
+ function_arg_advance (& CUM, MODE, TYPE, NAMED)
#define FUNCTION_ARG_PADDING(MODE, TYPE) \
(! BYTES_BIG_ENDIAN \
@@ -589,9 +562,6 @@ typedef struct iq2000_args {
#define STRICT_ARGUMENT_NAMING 1
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = ptr_type_node
-
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
iq2000_va_start (valist, nextarg)
@@ -644,24 +614,24 @@ typedef struct iq2000_args {
/* Addressing Modes. */
#define CONSTANT_ADDRESS_P(X) \
- ((GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
+ ( (GET_CODE (X) == LABEL_REF || GET_CODE (X) == SYMBOL_REF \
|| GET_CODE (X) == CONST_INT || GET_CODE (X) == HIGH \
|| (GET_CODE (X) == CONST)))
#define MAX_REGS_PER_ADDRESS 1
#ifdef REG_OK_STRICT
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ \
- if (iq2000_legitimate_address_p (MODE, X, 1)) \
- goto ADDR; \
-}
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+ { \
+ if (iq2000_legitimate_address_p (MODE, X, 1)) \
+ goto ADDR; \
+ }
#else
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ \
- if (iq2000_legitimate_address_p (MODE, X, 0)) \
- goto ADDR; \
-}
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+ { \
+ if (iq2000_legitimate_address_p (MODE, X, 0)) \
+ goto ADDR; \
+ }
#endif
#define REG_OK_FOR_INDEX_P(X) 0
@@ -678,7 +648,7 @@ typedef struct iq2000_args {
#define LEGITIMIZE_ADDRESS(X,OLDX,MODE,WIN) \
{ \
- register rtx xinsn = (X); \
+ rtx xinsn = (X); \
\
if (TARGET_DEBUG_B_MODE) \
{ \
@@ -697,10 +667,10 @@ typedef struct iq2000_args {
\
if (GET_CODE (xinsn) == PLUS) \
{ \
- register rtx xplus0 = XEXP (xinsn, 0); \
- register rtx xplus1 = XEXP (xinsn, 1); \
- register enum rtx_code code0 = GET_CODE (xplus0); \
- register enum rtx_code code1 = GET_CODE (xplus1); \
+ rtx xplus0 = XEXP (xinsn, 0); \
+ rtx xplus1 = XEXP (xinsn, 1); \
+ enum rtx_code code0 = GET_CODE (xplus0); \
+ enum rtx_code code1 = GET_CODE (xplus1); \
\
if (code0 != REG && code1 == REG) \
{ \
@@ -739,149 +709,6 @@ typedef struct iq2000_args {
/* Describing Relative Costs of Operations. */
-#define CONST_COSTS(X,CODE,OUTER_CODE) \
- case CONST_INT: \
- return 0; \
- \
- case LABEL_REF: \
- return COSTS_N_INSNS (2); \
- \
- case CONST: \
- { \
- rtx offset = const0_rtx; \
- rtx symref = eliminate_constant_term (XEXP (X, 0), &offset); \
- \
- if (GET_CODE (symref) == LABEL_REF) \
- return COSTS_N_INSNS (2); \
- \
- if (GET_CODE (symref) != SYMBOL_REF) \
- return COSTS_N_INSNS (4); \
- \
- /* let's be paranoid.... */ \
- if (INTVAL (offset) < -32768 || INTVAL (offset) > 32767) \
- return COSTS_N_INSNS (2); \
- \
- return COSTS_N_INSNS (SYMBOL_REF_FLAG (symref) ? 1 : 2); \
- } \
- \
- case SYMBOL_REF: \
- return COSTS_N_INSNS (SYMBOL_REF_FLAG (X) ? 1 : 2); \
- \
- case CONST_DOUBLE: \
- { \
- rtx high, low; \
- split_double (X, &high, &low); \
- return COSTS_N_INSNS ((high == CONST0_RTX (GET_MODE (high)) \
- || low == CONST0_RTX (GET_MODE (low))) \
- ? 2 : 4); \
- }
-
-#define RTX_COSTS(X,CODE,OUTER_CODE) \
- case MEM: \
- { \
- int num_words = (GET_MODE_SIZE (GET_MODE (X)) > UNITS_PER_WORD) ? 2 : 1; \
- if (simple_memory_operand (X, GET_MODE (X))) \
- return COSTS_N_INSNS (num_words); \
- \
- return COSTS_N_INSNS (2*num_words); \
- } \
- \
- case FFS: \
- return COSTS_N_INSNS (6); \
- \
- case NOT: \
- return COSTS_N_INSNS (GET_MODE (X) == DImode && 2); \
- \
- case AND: \
- case IOR: \
- case XOR: \
- if (GET_MODE (X) == DImode) \
- return COSTS_N_INSNS (2); \
- \
- break; \
- \
- case ASHIFT: \
- case ASHIFTRT: \
- case LSHIFTRT: \
- if (GET_MODE (X) == DImode) \
- return COSTS_N_INSNS ((GET_CODE (XEXP (X, 1)) == CONST_INT) ? 4 : 12); \
- \
- break; \
- \
- case ABS: \
- { \
- enum machine_mode xmode = GET_MODE (X); \
- if (xmode == SFmode || xmode == DFmode) \
- return COSTS_N_INSNS (1); \
- \
- return COSTS_N_INSNS (4); \
- } \
- \
- case PLUS: \
- case MINUS: \
- { \
- enum machine_mode xmode = GET_MODE (X); \
- if (xmode == SFmode || xmode == DFmode) \
- { \
- return COSTS_N_INSNS (6); \
- } \
- \
- if (xmode == DImode) \
- return COSTS_N_INSNS (4); \
- \
- break; \
- } \
- \
- case NEG: \
- if (GET_MODE (X) == DImode) \
- return 4; \
- \
- break; \
- \
- case MULT: \
- { \
- enum machine_mode xmode = GET_MODE (X); \
- if (xmode == SFmode) \
- { \
- return COSTS_N_INSNS (7); \
- } \
- \
- if (xmode == DFmode) \
- { \
- return COSTS_N_INSNS (8); \
- } \
- \
- return COSTS_N_INSNS (10); \
- } \
- \
- case DIV: \
- case MOD: \
- { \
- enum machine_mode xmode = GET_MODE (X); \
- if (xmode == SFmode) \
- { \
- return COSTS_N_INSNS (23); \
- } \
- \
- if (xmode == DFmode) \
- { \
- return COSTS_N_INSNS (36); \
- } \
- } \
- /* fall through */ \
- \
- case UDIV: \
- case UMOD: \
- return COSTS_N_INSNS (69); \
- \
- case SIGN_EXTEND: \
- return COSTS_N_INSNS (2); \
- \
- case ZERO_EXTEND: \
- return COSTS_N_INSNS (1);
-
-#define ADDRESS_COST(ADDR) (REG_P (ADDR) ? 1 : iq2000_address_cost (ADDR))
-
#define REGISTER_MOVE_COST(MODE, FROM, TO) 2
#define MEMORY_MOVE_COST(MODE,CLASS,TO_P) \
@@ -902,9 +729,9 @@ typedef struct iq2000_args {
/* Dividing the output into sections. */
-#define TEXT_SECTION_ASM_OP "\t.text" /* instructions */
+#define TEXT_SECTION_ASM_OP "\t.text" /* Instructions. */
-#define DATA_SECTION_ASM_OP "\t.data" /* large data */
+#define DATA_SECTION_ASM_OP "\t.data" /* Large data. */
/* The Overall Framework of an Assembler File. */
@@ -918,13 +745,9 @@ typedef struct iq2000_args {
/* Output and Generation of Labels. */
-#undef ASM_OUTPUT_INTERNAL_LABEL
-#define ASM_OUTPUT_INTERNAL_LABEL(STREAM,PREFIX,NUM) \
- fprintf (STREAM, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM)
-
#undef ASM_GENERATE_INTERNAL_LABEL
#define ASM_GENERATE_INTERNAL_LABEL(LABEL,PREFIX,NUM) \
- sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long)(NUM))
+ sprintf ((LABEL), "*%s%s%ld", (LOCAL_LABEL_PREFIX), (PREFIX), (long) (NUM))
#define GLOBAL_ASM_OP "\t.globl\t"
@@ -992,7 +815,6 @@ typedef struct iq2000_args {
#define DBR_OUTPUT_SEQEND(STREAM) \
do \
{ \
- dslots_jump_filled++; \
fputs ("\n", STREAM); \
} \
while (0)
@@ -1005,11 +827,13 @@ while (0)
/* Output of dispatch tables. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
-do { \
- fprintf (STREAM, "\t%s\t%sL%d\n", \
- Pmode == DImode ? ".dword" : ".word", \
- LOCAL_LABEL_PREFIX, VALUE); \
-} while (0)
+ do \
+ { \
+ fprintf (STREAM, "\t%s\t%sL%d\n", \
+ Pmode == DImode ? ".dword" : ".word", \
+ LOCAL_LABEL_PREFIX, VALUE); \
+ } \
+ while (0)
#define ASM_OUTPUT_ADDR_VEC_ELT(STREAM, VALUE) \
fprintf (STREAM, "\t%s\t%sL%d\n", \
@@ -1092,19 +916,19 @@ extern char call_used_regs[];
/* Comparison type. */
enum cmp_type
{
- CMP_SI, /* compare four byte integers */
- CMP_DI, /* compare eight byte integers */
- CMP_SF, /* compare single precision floats */
- CMP_DF, /* compare double precision floats */
- CMP_MAX /* max comparison type */
+ CMP_SI, /* Compare four byte integers. */
+ CMP_DI, /* Compare eight byte integers. */
+ CMP_SF, /* Compare single precision floats. */
+ CMP_DF, /* Compare double precision floats. */
+ CMP_MAX /* Max comparison type. */
};
/* Types of delay slot. */
enum delay_type
{
- DELAY_NONE, /* no delay slot */
- DELAY_LOAD, /* load from memory delay */
- DELAY_FCMP /* delay after doing c.<xx>.{d,s} */
+ DELAY_NONE, /* No delay slot. */
+ DELAY_LOAD, /* Load from memory delay. */
+ DELAY_FCMP /* Delay after doing c.<xx>.{d,s}. */
};
/* Which processor to schedule for. */
@@ -1117,36 +941,15 @@ enum processor_type
};
/* Recast the cpu class to be the cpu attribute. */
-#define iq2000_cpu_attr ((enum attr_cpu)iq2000_tune)
-
-extern char iq2000_print_operand_punct[]; /* print_operand punctuation chars */
-extern int num_source_filenames; /* current .file # */
-extern int iq2000_branch_likely; /* emit 'l' after br (branch likely) */
-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 iq2000_arch; /* which cpu to codegen for */
-extern enum processor_type iq2000_tune; /* which cpu to schedule for */
-extern int iq2000_isa; /* architectural level */
-extern const char *iq2000_cpu_string; /* for -mcpu=<xxx> */
-extern const char *iq2000_arch_string; /* for -march=<xxx> */
-extern int dslots_load_total; /* total # load related delay slots */
-extern int dslots_load_filled; /* # filled load delay slots */
-extern int dslots_jump_total; /* total # jump related delay slots */
-extern int dslots_jump_filled; /* # filled jump delay slots */
-extern int dslots_number_nops; /* # of nops needed by previous insn */
-extern int num_refs[3]; /* # 1/2/3 word references */
-extern struct rtx_def *iq2000_load_reg; /* register to check for load delay */
-extern struct rtx_def *iq2000_load_reg2; /* 2nd reg to check for load delay */
-extern struct rtx_def *iq2000_load_reg3; /* 3rd reg to check for load delay */
-extern struct rtx_def *iq2000_load_reg4; /* 4th reg to check for load delay */
+#define iq2000_cpu_attr ((enum attr_cpu) iq2000_tune)
/* Functions to change what output section we are using. */
extern void rdata_section (void);
extern void sdata_section (void);
-extern void sbss_section (void);
+extern void sbss_section (void);
-#define BITMASK_UPPER16 ((unsigned long)0xffff << 16) /* 0xffff0000 */
-#define BITMASK_LOWER16 ((unsigned long)0xffff) /* 0x0000ffff */
+#define BITMASK_UPPER16 ((unsigned long) 0xffff << 16) /* 0xffff0000 */
+#define BITMASK_LOWER16 ((unsigned long) 0xffff) /* 0x0000ffff */
#define GENERATE_BRANCHLIKELY (ISA_HAS_BRANCHLIKELY)
@@ -1265,10 +1068,10 @@ extern void sbss_section (void);
#ifndef STACK_ARGS_ADJUST
#define STACK_ARGS_ADJUST(SIZE) \
-{ \
- if (SIZE.constant < 4 * UNITS_PER_WORD) \
- SIZE.constant = 4 * UNITS_PER_WORD; \
-}
+ { \
+ if (SIZE.constant < 4 * UNITS_PER_WORD) \
+ SIZE.constant = 4 * UNITS_PER_WORD; \
+ }
#endif
@@ -1336,9 +1139,9 @@ extern void sbss_section (void);
#endif
#if 1
-#define GO_PRINTF(x) fprintf(stderr, (x))
-#define GO_PRINTF2(x,y) fprintf(stderr, (x), (y))
-#define GO_DEBUG_RTX(x) debug_rtx(x)
+#define GO_PRINTF(x) fprintf (stderr, (x))
+#define GO_PRINTF2(x,y) fprintf (stderr, (x), (y))
+#define GO_DEBUG_RTX(x) debug_rtx (x)
#else
#define GO_PRINTF(x)
@@ -1346,15 +1149,6 @@ extern void sbss_section (void);
#define GO_DEBUG_RTX(x)
#endif
-/* 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 if zero-extension is slow (more than one real instruction). */
-#define SLOW_ZERO_EXTEND
-
/* If defined, modifies the length assigned to instruction INSN as a
function of the context in which it is used. LENGTH is an lvalue
that contains the initially computed length of the insn and should
@@ -1375,7 +1169,7 @@ extern void sbss_section (void);
/* How to tell the debugger about changes of source files. */
#ifndef SET_FILE_NUMBER
-#define SET_FILE_NUMBER() ++num_source_filenames
+#define SET_FILE_NUMBER() ++ num_source_filenames
#endif
/* This is how to output a note the debugger telling it the line number
@@ -1385,28 +1179,41 @@ extern void sbss_section (void);
#define LABEL_AFTER_LOC(STREAM)
#endif
-/* Handle certain cpp directives used in header files on sysV. */
-#define SCCS_DIRECTIVE
-
/* Default to -G 8 */
#ifndef IQ2000_DEFAULT_GVALUE
#define IQ2000_DEFAULT_GVALUE 8
#endif
-#define SDATA_SECTION_ASM_OP "\t.sdata" /* small data */
-
-/* Given a decl node or constant node, choose the section to output it in
- and select that section. */
+#define SDATA_SECTION_ASM_OP "\t.sdata" /* Small data. */
-#undef TARGET_ASM_SELECT_SECTION
-#define TARGET_ASM_SELECT_SECTION iq2000_select_section
/* See iq2000_expand_prologue's use of loadgp for when this should be
true. */
#define DONT_ACCESS_GBLS_AFTER_EPILOGUE 0
+/* List of all IQ2000 punctuation characters used by print_operand. */
+extern char iq2000_print_operand_punct[256];
+
+/* The target cpu for optimization and scheduling. */
+extern enum processor_type iq2000_tune;
+
+/* Which instruction set architecture to use. */
+extern int iq2000_isa;
+
+/* Cached operands, and operator to compare for use in set/branch/trap
+ on condition codes. */
+extern rtx branch_cmp[2];
+
+/* What type of branch to use. */
+extern enum cmp_type branch_type;
+
+/* Strings to hold which cpu and instruction set architecture to use. */
+extern const char * iq2000_cpu_string; /* For -mcpu=<xxx>. */
+extern const char * iq2000_arch_string; /* For -march=<xxx>. */
+
+
enum iq2000_builtins
{
diff --git a/gcc/config/kfreebsdgnu.h b/gcc/config/kfreebsdgnu.h
index 59a68295c2a..ad8d68c3f21 100644
--- a/gcc/config/kfreebsdgnu.h
+++ b/gcc/config/kfreebsdgnu.h
@@ -23,7 +23,7 @@ Boston, MA 02111-1307, USA. */
#define WCHAR_TYPE "int"
#undef TARGET_OS_CPP_BUILTINS
-#define TARET_OS_CPP_BUILTINS() \
+#define TARGET_OS_CPP_BUILTINS() \
builtin_define ("__GNU_KFreeBSD__=0"); \
builtin_define ("__gnu_kfreebsd__=0"); \
builtin_define ("__FreeBSD_kernel__=5"); \
diff --git a/gcc/config/linux.h b/gcc/config/linux.h
index 2c85148c685..0f7ba1777e8 100644
--- a/gcc/config/linux.h
+++ b/gcc/config/linux.h
@@ -97,6 +97,16 @@ Boston, MA 02111-1307, USA. */
%{!p:%{!pg:%{!g*:-lc} %{g*:-lg}}}}"
#endif
+#define LINUX_TARGET_OS_CPP_BUILTINS() \
+ do { \
+ builtin_define ("__gnu_linux__"); \
+ builtin_define_std ("linux"); \
+ builtin_define_std ("unix"); \
+ builtin_assert ("system=linux"); \
+ builtin_assert ("system=unix"); \
+ builtin_assert ("system=posix"); \
+ } while (0)
+
#if !defined(USE_GNULIBC_1) && defined(HAVE_LD_EH_FRAME_HDR)
#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
#endif
diff --git a/gcc/config/m32r/m32r-protos.h b/gcc/config/m32r/m32r-protos.h
index ef7ba37d2b5..cdd9db3296a 100644
--- a/gcc/config/m32r/m32r-protos.h
+++ b/gcc/config/m32r/m32r-protos.h
@@ -22,77 +22,76 @@ Boston, MA 02111-1307, USA. */
complications. */
#define Mmode enum machine_mode
-extern void sbss_section PARAMS ((void));
-extern void sdata_section PARAMS ((void));
-extern void m32r_init PARAMS ((void));
-extern void m32r_init_expanders PARAMS ((void));
-extern unsigned m32r_compute_frame_size PARAMS ((int));
-extern int m32r_first_insn_address PARAMS ((void));
-extern void m32r_expand_prologue PARAMS ((void));
-extern void m32r_finalize_pic PARAMS ((void));
-extern int direct_return PARAMS ((void));
+extern void sbss_section (void);
+extern void sdata_section (void);
+extern void m32r_init (void);
+extern void m32r_init_expanders (void);
+extern unsigned m32r_compute_frame_size (int);
+extern int m32r_first_insn_address (void);
+extern void m32r_expand_prologue (void);
+extern void m32r_finalize_pic (void);
+extern int direct_return (void);
#ifdef TREE_CODE
-extern enum m32r_function_type m32r_compute_function_type PARAMS ((tree));
+extern enum m32r_function_type m32r_compute_function_type (tree);
#ifdef HAVE_MACHINE_MODES
-extern void m32r_setup_incoming_varargs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int *, int));
-extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *, Mmode, tree, int));
+extern void m32r_setup_incoming_varargs (CUMULATIVE_ARGS *, Mmode, tree, int *, int);
+extern int function_arg_partial_nregs (CUMULATIVE_ARGS *, Mmode, tree, int);
#endif
#endif /* TREE_CODE */
#ifdef RTX_CODE
-extern int easy_di_const PARAMS ((rtx));
-extern int easy_df_const PARAMS ((rtx));
-extern rtx gen_compare PARAMS ((enum rtx_code, rtx, rtx, int));
-extern rtx gen_split_move_double PARAMS ((rtx *));
-extern int m32r_address_code PARAMS ((rtx));
-extern void m32r_initialize_trampoline PARAMS ((rtx, rtx, rtx));
-extern int zero_and_one PARAMS ((rtx, rtx));
-extern char * emit_cond_move PARAMS ((rtx *, rtx));
-extern void m32r_output_block_move PARAMS ((rtx, rtx *));
-extern void m32r_expand_block_move PARAMS ((rtx *));
-extern void m32r_print_operand PARAMS ((FILE *, rtx, int));
-extern void m32r_print_operand_address PARAMS ((FILE *, rtx));
-extern int m32r_not_same_reg PARAMS ((rtx, rtx));
-extern int m32r_hard_regno_rename_ok PARAMS ((unsigned int,
- unsigned int));
+extern int easy_di_const (rtx);
+extern int easy_df_const (rtx);
+extern rtx gen_compare (enum rtx_code, rtx, rtx, int);
+extern rtx gen_split_move_double (rtx *);
+extern int m32r_address_code (rtx);
+extern void m32r_initialize_trampoline (rtx, rtx, rtx);
+extern int zero_and_one (rtx, rtx);
+extern char * emit_cond_move (rtx *, rtx);
+extern void m32r_output_block_move (rtx, rtx *);
+extern void m32r_expand_block_move (rtx *);
+extern void m32r_print_operand (FILE *, rtx, int);
+extern void m32r_print_operand_address (FILE *, rtx);
+extern int m32r_not_same_reg (rtx, rtx);
+extern int m32r_hard_regno_rename_ok (unsigned int, unsigned int);
#ifdef HAVE_MACHINE_MODES
-extern int call_address_operand PARAMS ((rtx, Mmode));
-extern int call_operand PARAMS ((rtx, Mmode));
-extern int symbolic_operand PARAMS ((rtx, Mmode));
-extern int small_data_operand PARAMS ((rtx, Mmode));
-extern int addr24_operand PARAMS ((rtx, Mmode));
-extern int addr32_operand PARAMS ((rtx, Mmode));
-extern int call26_operand PARAMS ((rtx, Mmode));
-extern int seth_add3_operand PARAMS ((rtx, Mmode));
-extern int cmp_int16_operand PARAMS ((rtx, Mmode));
-extern int uint16_operand PARAMS ((rtx, Mmode));
-extern int reg_or_int16_operand PARAMS ((rtx, Mmode));
-extern int reg_or_uint16_operand PARAMS ((rtx, Mmode));
-extern int reg_or_cmp_int16_operand PARAMS ((rtx, Mmode));
-extern int two_insn_const_operand PARAMS ((rtx, Mmode));
-extern int move_src_operand PARAMS ((rtx, Mmode));
-extern int move_double_src_operand PARAMS ((rtx, Mmode));
-extern int move_dest_operand PARAMS ((rtx, Mmode));
-extern int eqne_comparison_operator PARAMS ((rtx, Mmode));
-extern int signed_comparison_operator PARAMS ((rtx, Mmode));
-extern int memreg_operand PARAMS ((rtx, Mmode));
-extern int small_insn_p PARAMS ((rtx, Mmode));
-extern int large_insn_p PARAMS ((rtx, Mmode));
-extern int conditional_move_operand PARAMS ((rtx, Mmode));
-extern int carry_compare_operand PARAMS ((rtx, Mmode));
-extern int m32r_block_immediate_operand PARAMS ((rtx, Mmode));
-extern int extend_operand PARAMS ((rtx, Mmode));
-extern int reg_or_eq_int16_operand PARAMS ((rtx, Mmode));
-extern int int8_operand PARAMS ((rtx, Mmode));
-extern int reg_or_zero_operand PARAMS ((rtx, Mmode));
+extern int call_address_operand (rtx, Mmode);
+extern int call_operand (rtx, Mmode);
+extern int symbolic_operand (rtx, Mmode);
+extern int small_data_operand (rtx, Mmode);
+extern int addr24_operand (rtx, Mmode);
+extern int addr32_operand (rtx, Mmode);
+extern int call26_operand (rtx, Mmode);
+extern int seth_add3_operand (rtx, Mmode);
+extern int cmp_int16_operand (rtx, Mmode);
+extern int uint16_operand (rtx, Mmode);
+extern int reg_or_int16_operand (rtx, Mmode);
+extern int reg_or_uint16_operand (rtx, Mmode);
+extern int reg_or_cmp_int16_operand (rtx, Mmode);
+extern int two_insn_const_operand (rtx, Mmode);
+extern int move_src_operand (rtx, Mmode);
+extern int move_double_src_operand (rtx, Mmode);
+extern int move_dest_operand (rtx, Mmode);
+extern int eqne_comparison_operator (rtx, Mmode);
+extern int signed_comparison_operator (rtx, Mmode);
+extern int memreg_operand (rtx, Mmode);
+extern int small_insn_p (rtx, Mmode);
+extern int large_insn_p (rtx, Mmode);
+extern int conditional_move_operand (rtx, Mmode);
+extern int carry_compare_operand (rtx, Mmode);
+extern int m32r_block_immediate_operand (rtx, Mmode);
+extern int extend_operand (rtx, Mmode);
+extern int reg_or_eq_int16_operand (rtx, Mmode);
+extern int int8_operand (rtx, Mmode);
+extern int reg_or_zero_operand (rtx, Mmode);
#endif /* HAVE_MACHINE_MODES */
#ifdef TREE_CODE
-extern struct rtx_def * m32r_va_arg PARAMS ((tree, tree));
-extern int m32r_pass_by_reference PARAMS ((tree));
+extern struct rtx_def * m32r_va_arg (tree, tree);
+extern int m32r_pass_by_reference (tree);
#endif /* TREE_CODE */
#endif /* RTX_CODE */
diff --git a/gcc/config/m32r/m32r.c b/gcc/config/m32r/m32r.c
index dfea2fc74be..a5a2b26cf09 100644
--- a/gcc/config/m32r/m32r.c
+++ b/gcc/config/m32r/m32r.c
@@ -1,23 +1,23 @@
-/* Subroutines used for code generation on the Mitsubishi M32R cpu.
+/* Subroutines used for code generation on the Renesas M32R cpu.
Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of GCC.
+ 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 free software; you can redistribute it and/or modify it
+ under the 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.
+ 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. */
+ 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"
@@ -69,66 +69,66 @@ static int m32r_sched_odd_word_p;
#define LIT_NAME_P(NAME) ((NAME)[0] == '*' && (NAME)[1] == '.')
/* Forward declaration. */
-static void init_reg_tables PARAMS ((void));
-static void block_move_call PARAMS ((rtx, rtx, rtx));
-static int m32r_is_insn PARAMS ((rtx));
+static void init_reg_tables (void);
+static void block_move_call (rtx, rtx, rtx);
+static int m32r_is_insn (rtx);
const struct attribute_spec m32r_attribute_table[];
-static tree m32r_handle_model_attribute PARAMS ((tree *, tree, tree, int, bool *));
-static void m32r_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void m32r_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-
-static void m32r_file_start PARAMS ((void));
-
-static int m32r_adjust_cost PARAMS ((rtx, rtx, rtx, int));
-static int m32r_adjust_priority PARAMS ((rtx, int));
-static void m32r_sched_init PARAMS ((FILE *, int, int));
-static int m32r_sched_reorder PARAMS ((FILE *, int, rtx *, int *, int));
-static int m32r_variable_issue PARAMS ((FILE *, int, rtx, int));
-static int m32r_issue_rate PARAMS ((void));
-
-static void m32r_encode_section_info PARAMS ((tree, rtx, int));
-static bool m32r_in_small_data_p PARAMS ((tree));
-static void init_idents PARAMS ((void));
-static bool m32r_rtx_costs PARAMS ((rtx, int, int, int *));
+static tree m32r_handle_model_attribute (tree *, tree, tree, int, bool *);
+static void m32r_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void m32r_output_function_epilogue (FILE *, HOST_WIDE_INT);
+
+static void m32r_file_start (void);
+
+static int m32r_adjust_cost (rtx, rtx, rtx, int);
+static int m32r_adjust_priority (rtx, int);
+static void m32r_sched_init (FILE *, int, int);
+static int m32r_sched_reorder (FILE *, int, rtx *, int *, int);
+static int m32r_variable_issue (FILE *, int, rtx, int);
+static int m32r_issue_rate (void);
+
+static void m32r_encode_section_info (tree, rtx, int);
+static bool m32r_in_small_data_p (tree);
+static void init_idents (void);
+static bool m32r_rtx_costs (rtx, int, int, int *);
/* Initialize the GCC target structure. */
-#undef TARGET_ATTRIBUTE_TABLE
+#undef TARGET_ATTRIBUTE_TABLE
#define TARGET_ATTRIBUTE_TABLE m32r_attribute_table
-#undef TARGET_ASM_ALIGNED_HI_OP
+#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.hword\t"
-#undef TARGET_ASM_ALIGNED_SI_OP
+#undef TARGET_ASM_ALIGNED_SI_OP
#define TARGET_ASM_ALIGNED_SI_OP "\t.word\t"
-#undef TARGET_ASM_FUNCTION_PROLOGUE
+#undef TARGET_ASM_FUNCTION_PROLOGUE
#define TARGET_ASM_FUNCTION_PROLOGUE m32r_output_function_prologue
-#undef TARGET_ASM_FUNCTION_EPILOGUE
+#undef TARGET_ASM_FUNCTION_EPILOGUE
#define TARGET_ASM_FUNCTION_EPILOGUE m32r_output_function_epilogue
-#undef TARGET_ASM_FILE_START
+#undef TARGET_ASM_FILE_START
#define TARGET_ASM_FILE_START m32r_file_start
-#undef TARGET_SCHED_ADJUST_COST
+#undef TARGET_SCHED_ADJUST_COST
#define TARGET_SCHED_ADJUST_COST m32r_adjust_cost
-#undef TARGET_SCHED_ADJUST_PRIORITY
+#undef TARGET_SCHED_ADJUST_PRIORITY
#define TARGET_SCHED_ADJUST_PRIORITY m32r_adjust_priority
-#undef TARGET_SCHED_ISSUE_RATE
+#undef TARGET_SCHED_ISSUE_RATE
#define TARGET_SCHED_ISSUE_RATE m32r_issue_rate
-#undef TARGET_SCHED_VARIABLE_ISSUE
+#undef TARGET_SCHED_VARIABLE_ISSUE
#define TARGET_SCHED_VARIABLE_ISSUE m32r_variable_issue
-#undef TARGET_SCHED_INIT
+#undef TARGET_SCHED_INIT
#define TARGET_SCHED_INIT m32r_sched_init
-#undef TARGET_SCHED_REORDER
+#undef TARGET_SCHED_REORDER
#define TARGET_SCHED_REORDER m32r_sched_reorder
-#undef TARGET_ENCODE_SECTION_INFO
+#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m32r_encode_section_info
-#undef TARGET_IN_SMALL_DATA_P
+#undef TARGET_IN_SMALL_DATA_P
#define TARGET_IN_SMALL_DATA_P m32r_in_small_data_p
-#undef TARGET_RTX_COSTS
+#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS m32r_rtx_costs
-#undef TARGET_ADDRESS_COST
+#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -136,7 +136,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
/* Called by OVERRIDE_OPTIONS to initialize various things. */
void
-m32r_init ()
+m32r_init (void)
{
init_reg_tables ();
@@ -213,7 +213,7 @@ unsigned int m32r_mode_class [NUM_MACHINE_MODES];
enum reg_class m32r_regno_reg_class[FIRST_PSEUDO_REGISTER];
static void
-init_reg_tables ()
+init_reg_tables (void)
{
int i;
@@ -278,8 +278,7 @@ init_reg_tables ()
medium: addresses use 32 bits, use bl to make calls
large: addresses use 32 bits, use seth/add3/jl to make calls
- Grep for MODEL in m32r.h for more info.
-*/
+ Grep for MODEL in m32r.h for more info. */
static tree small_ident1;
static tree small_ident2;
@@ -289,7 +288,7 @@ static tree large_ident1;
static tree large_ident2;
static void
-init_idents ()
+init_idents (void)
{
if (small_ident1 == 0)
{
@@ -314,12 +313,9 @@ const struct attribute_spec m32r_attribute_table[] =
/* Handle an "model" attribute; arguments as in
struct attribute_spec.handler. */
static tree
-m32r_handle_model_attribute (node, name, args, flags, no_add_attrs)
- tree *node ATTRIBUTE_UNUSED;
- tree name;
- tree args;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+m32r_handle_model_attribute (tree *node ATTRIBUTE_UNUSED, tree name,
+ tree args, int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
tree arg;
@@ -351,10 +347,7 @@ m32r_handle_model_attribute (node, name, args, flags, no_add_attrs)
*/
static void
-m32r_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+m32r_encode_section_info (tree decl, rtx rtl, int first)
{
int extra_flags = 0;
tree model_attr;
@@ -411,8 +404,7 @@ m32r_encode_section_info (decl, rtl, first)
the object doesn't fit the linker will give an error. */
static bool
-m32r_in_small_data_p (decl)
- tree decl;
+m32r_in_small_data_p (tree decl)
{
tree section;
@@ -446,7 +438,7 @@ m32r_in_small_data_p (decl)
/* Do anything needed before RTL is emitted for each function. */
void
-m32r_init_expanders ()
+m32r_init_expanders (void)
{
/* ??? At one point there was code here. The function is left in
to make it easy to experiment. */
@@ -455,9 +447,7 @@ m32r_init_expanders ()
/* Acceptable arguments to the call insn. */
int
-call_address_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_address_operand (rtx op, enum machine_mode mode)
{
return symbolic_operand (op, mode);
@@ -466,9 +456,7 @@ call_address_operand (op, mode)
}
int
-call_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+call_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) != MEM)
return 0;
@@ -479,9 +467,7 @@ call_operand (op, mode)
/* Returns 1 if OP is a symbol reference. */
int
-symbolic_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -498,9 +484,7 @@ symbolic_operand (op, mode)
/* Return 1 if OP is a reference to an object in .sdata/.sbss. */
int
-small_data_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_data_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (! TARGET_SDATA_USE)
return 0;
@@ -521,9 +505,7 @@ small_data_operand (op, mode)
/* Return 1 if OP is a symbol that can use 24 bit addressing. */
int
-addr24_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+addr24_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
rtx sym;
@@ -555,9 +537,7 @@ addr24_operand (op, mode)
/* Return 1 if OP is a symbol that needs 32 bit addressing. */
int
-addr32_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+addr32_operand (rtx op, enum machine_mode mode)
{
rtx sym;
@@ -581,9 +561,7 @@ addr32_operand (op, mode)
/* Return 1 if OP is a function that can be called with the `bl' insn. */
int
-call26_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+call26_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SYMBOL_REF)
return SYMBOL_REF_MODEL (op) != M32R_MODEL_LARGE;
@@ -594,9 +572,7 @@ call26_operand (op, mode)
/* Returns 1 if OP is an acceptable operand for seth/add3. */
int
-seth_add3_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+seth_add3_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == SYMBOL_REF
|| GET_CODE (op) == LABEL_REF)
@@ -615,9 +591,7 @@ seth_add3_operand (op, mode)
/* Return true if OP is a signed 8 bit immediate value. */
int
-int8_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+int8_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -628,9 +602,7 @@ int8_operand (op, mode)
useful in comparisons. */
int
-cmp_int16_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+cmp_int16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -640,9 +612,7 @@ cmp_int16_operand (op, mode)
/* Return true if OP is an unsigned 16 bit immediate value. */
int
-uint16_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+uint16_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -652,9 +622,7 @@ uint16_operand (op, mode)
/* Return true if OP is a register or signed 16 bit value. */
int
-reg_or_int16_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_int16_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return register_operand (op, mode);
@@ -666,9 +634,7 @@ reg_or_int16_operand (op, mode)
/* Return true if OP is a register or an unsigned 16 bit value. */
int
-reg_or_uint16_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_uint16_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return register_operand (op, mode);
@@ -683,9 +649,7 @@ reg_or_uint16_operand (op, mode)
because that is special cased. */
int
-reg_or_eq_int16_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_eq_int16_operand (rtx op, enum machine_mode mode)
{
HOST_WIDE_INT value;
@@ -702,9 +666,7 @@ reg_or_eq_int16_operand (op, mode)
/* Return true if OP is a register or signed 16 bit value for compares. */
int
-reg_or_cmp_int16_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_cmp_int16_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return register_operand (op, mode);
@@ -716,9 +678,7 @@ reg_or_cmp_int16_operand (op, mode)
/* Return true if OP is a register or the constant 0. */
int
-reg_or_zero_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+reg_or_zero_operand (rtx op, enum machine_mode mode)
{
if (GET_CODE (op) == REG || GET_CODE (op) == SUBREG)
return register_operand (op, mode);
@@ -732,9 +692,7 @@ reg_or_zero_operand (op, mode)
/* Return true if OP is a const_int requiring two instructions to load. */
int
-two_insn_const_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+two_insn_const_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT)
return 0;
@@ -749,9 +707,7 @@ two_insn_const_operand (op, mode)
move source. */
int
-move_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_src_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -809,9 +765,7 @@ move_src_operand (op, mode)
move source. */
int
-move_double_src_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_double_src_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -841,9 +795,7 @@ move_double_src_operand (op, mode)
/* Return true if OP is an acceptable argument for a move destination. */
int
-move_dest_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+move_dest_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -870,8 +822,7 @@ move_dest_operand (op, mode)
It is used by the 'G' CONST_DOUBLE_OK_FOR_LETTER. */
int
-easy_di_const (op)
- rtx op;
+easy_di_const (rtx op)
{
rtx high_rtx, low_rtx;
HOST_WIDE_INT high, low;
@@ -891,8 +842,7 @@ easy_di_const (op)
It is used by the 'H' CONST_DOUBLE_OK_FOR_LETTER. */
int
-easy_df_const (op)
- rtx op;
+easy_df_const (rtx op)
{
REAL_VALUE_TYPE r;
long l[2];
@@ -909,9 +859,7 @@ easy_df_const (op)
/* Return 1 if OP is an EQ or NE comparison operator. */
int
-eqne_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+eqne_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -923,9 +871,7 @@ eqne_comparison_operator (op, mode)
/* Return 1 if OP is a signed comparison operator. */
int
-signed_comparison_operator (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+signed_comparison_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
enum rtx_code code = GET_CODE (op);
@@ -939,9 +885,7 @@ signed_comparison_operator (op, mode)
This is used in insn length calcs. */
int
-memreg_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+memreg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == MEM && GET_CODE (XEXP (op, 0)) == REG;
}
@@ -950,9 +894,7 @@ memreg_operand (op, mode)
operation. */
int
-extend_operand (op, mode)
- rtx op;
- enum machine_mode mode;
+extend_operand (rtx op, enum machine_mode mode)
{
rtx addr;
@@ -978,9 +920,7 @@ extend_operand (op, mode)
Allow const_int 0 as well, which is a placeholder for NOP slots. */
int
-small_insn_p (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+small_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) == CONST_INT && INTVAL (op) == 0)
return 1;
@@ -994,9 +934,7 @@ small_insn_p (op, mode)
/* Return nonzero if the operand is an insn that is a large insn. */
int
-large_insn_p (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+large_insn_p (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (! INSN_P (op))
return 0;
@@ -1009,8 +947,7 @@ large_insn_p (op, mode)
in this function. */
int
-m32r_pass_by_reference (type)
- tree type;
+m32r_pass_by_reference (tree type)
{
int size = int_size_in_bytes (type);
@@ -1028,12 +965,10 @@ m32r_pass_by_reference (type)
than being subsumed into the following branch instruction. */
rtx
-gen_compare (code, x, y, need_compare)
- enum rtx_code code;
- rtx x, y;
- int need_compare;
+gen_compare (enum rtx_code code, rtx x, rtx y, int need_compare)
{
- enum rtx_code compare_code, branch_code;
+ enum rtx_code compare_code;
+ enum rtx_code branch_code;
rtx cc_reg = gen_rtx_REG (CCmode, CARRY_REGNUM);
int must_swap = 0;
@@ -1060,23 +995,23 @@ gen_compare (code, x, y, need_compare)
{
case EQ:
if (GET_CODE (y) == CONST_INT
- && CMP_INT16_P (INTVAL (y)) /* reg equal to small const. */
+ && CMP_INT16_P (INTVAL (y)) /* Reg equal to small const. */
&& y != const0_rtx)
{
rtx tmp = gen_reg_rtx (SImode);
- emit_insn (gen_cmp_ne_small_const_insn (tmp, x, y));
+ emit_insn (gen_addsi3 (tmp, x, GEN_INT (-INTVAL (y))));
x = tmp;
y = const0_rtx;
}
- else if (CONSTANT_P (y)) /* reg equal to const. */
+ else if (CONSTANT_P (y)) /* Reg equal to const. */
{
rtx tmp = force_reg (GET_MODE (x), y);
y = tmp;
}
- if (register_operand (y, SImode) /* reg equal to reg. */
- || y == const0_rtx) /* req equal to zero. */
+ if (register_operand (y, SImode) /* Reg equal to reg. */
+ || y == const0_rtx) /* Reg equal to zero. */
{
emit_insn (gen_cmp_eqsi_insn (x, y));
@@ -1088,7 +1023,7 @@ gen_compare (code, x, y, need_compare)
if (register_operand (y, SImode)
|| (GET_CODE (y) == CONST_INT && CMP_INT16_P (INTVAL (y))))
{
- rtx tmp = gen_reg_rtx (SImode); /* reg compared to reg. */
+ rtx tmp = gen_reg_rtx (SImode); /* Reg compared to reg. */
switch (code)
{
@@ -1100,7 +1035,7 @@ gen_compare (code, x, y, need_compare)
if (y == const0_rtx)
tmp = const1_rtx;
else
- emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx));
+ emit_insn (gen_addsi3 (tmp, y, constm1_rtx));
emit_insn (gen_cmp_ltsi_insn (x, tmp));
code = EQ;
break;
@@ -1108,7 +1043,7 @@ gen_compare (code, x, y, need_compare)
if (GET_CODE (y) == CONST_INT)
tmp = gen_rtx (PLUS, SImode, y, const1_rtx);
else
- emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx));
+ emit_insn (gen_addsi3 (tmp, y, constm1_rtx));
emit_insn (gen_cmp_ltsi_insn (x, tmp));
code = NE;
break;
@@ -1128,7 +1063,7 @@ gen_compare (code, x, y, need_compare)
if (register_operand (y, SImode)
|| (GET_CODE (y) == CONST_INT && CMP_INT16_P (INTVAL (y))))
{
- rtx tmp = gen_reg_rtx (SImode); /* reg (unsigned) compared to reg. */
+ rtx tmp = gen_reg_rtx (SImode); /* Reg (unsigned) compared to reg. */
switch (code)
{
@@ -1140,7 +1075,7 @@ gen_compare (code, x, y, need_compare)
if (y == const0_rtx)
tmp = const1_rtx;
else
- emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx));
+ emit_insn (gen_addsi3 (tmp, y, constm1_rtx));
emit_insn (gen_cmp_ltusi_insn (x, tmp));
code = EQ;
break;
@@ -1148,7 +1083,7 @@ gen_compare (code, x, y, need_compare)
if (GET_CODE (y) == CONST_INT)
tmp = gen_rtx (PLUS, SImode, y, const1_rtx);
else
- emit_insn (gen_cmp_ne_small_const_insn (tmp, y, const1_rtx));
+ emit_insn (gen_addsi3 (tmp, y, constm1_rtx));
emit_insn (gen_cmp_ltusi_insn (x, tmp));
code = NE;
break;
@@ -1170,31 +1105,33 @@ gen_compare (code, x, y, need_compare)
}
else
{
- /* reg/reg equal comparison */
+ /* Reg/reg equal comparison. */
if (compare_code == EQ
&& register_operand (y, SImode))
return gen_rtx (code, CCmode, x, y);
- /* reg/zero signed comparison */
+ /* Reg/zero signed comparison. */
if ((compare_code == EQ || compare_code == LT)
&& y == const0_rtx)
return gen_rtx (code, CCmode, x, y);
- /* reg/smallconst equal comparison */
+ /* Reg/smallconst equal comparison. */
if (compare_code == EQ
&& GET_CODE (y) == CONST_INT
&& CMP_INT16_P (INTVAL (y)))
{
rtx tmp = gen_reg_rtx (SImode);
- emit_insn (gen_cmp_ne_small_const_insn (tmp, x, y));
+
+ emit_insn (gen_addsi3 (tmp, x, GEN_INT (-INTVAL (y))));
return gen_rtx (code, CCmode, tmp, const0_rtx);
}
- /* reg/const equal comparison */
+ /* Reg/const equal comparison. */
if (compare_code == EQ
&& CONSTANT_P (y))
{
rtx tmp = force_reg (GET_MODE (x), y);
+
return gen_rtx (code, CCmode, x, tmp);
}
}
@@ -1237,8 +1174,7 @@ gen_compare (code, x, y, need_compare)
/* Split a 2 word move (DI or DF) into component parts. */
rtx
-gen_split_move_double (operands)
- rtx operands[];
+gen_split_move_double (rtx operands[])
{
enum machine_mode mode = GET_MODE (operands[0]);
rtx dest = operands[0];
@@ -1258,7 +1194,7 @@ gen_split_move_double (operands)
{
int dregno = REGNO (dest);
- /* reg = reg */
+ /* Reg = reg. */
if (GET_CODE (src) == REG)
{
int sregno = REGNO (src);
@@ -1277,7 +1213,7 @@ gen_split_move_double (operands)
operand_subword (src, !reverse, TRUE, mode)));
}
- /* reg = constant */
+ /* Reg = constant. */
else if (GET_CODE (src) == CONST_INT || GET_CODE (src) == CONST_DOUBLE)
{
rtx words[2];
@@ -1291,7 +1227,7 @@ gen_split_move_double (operands)
words[1]));
}
- /* reg = mem */
+ /* Reg = mem. */
else if (GET_CODE (src) == MEM)
{
/* If the high-address word is used in the address, we must load it
@@ -1320,12 +1256,11 @@ gen_split_move_double (operands)
adjust_address (src, SImode,
!reverse * UNITS_PER_WORD)));
}
-
else
abort ();
}
- /* mem = reg */
+ /* Mem = reg. */
/* We used to optimize loads from single registers as
st r1,r3; st r2,+r3
@@ -1360,11 +1295,8 @@ gen_split_move_double (operands)
/* Implements the FUNCTION_ARG_PARTIAL_NREGS macro. */
int
-function_arg_partial_nregs (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
int ret;
unsigned int size =
@@ -1391,12 +1323,8 @@ function_arg_partial_nregs (cum, mode, type, named)
and mode MODE, and we rely on this fact. */
void
-m32r_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int *pretend_size;
- int no_rtl;
+m32r_setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int *pretend_size, int no_rtl)
{
int first_anon_arg;
@@ -1432,8 +1360,7 @@ m32r_setup_incoming_varargs (cum, mode, type, pretend_size, no_rtl)
/* Implement `va_arg'. */
rtx
-m32r_va_arg (valist, type)
- tree valist, type;
+m32r_va_arg (tree valist, tree type)
{
HOST_WIDE_INT size, rsize;
tree t;
@@ -1447,7 +1374,6 @@ m32r_va_arg (valist, type)
tree type_ptr, type_ptr_ptr;
/* Pass by reference. */
-
type_ptr = build_pointer_type (type);
type_ptr_ptr = build_pointer_type (type_ptr);
@@ -1463,7 +1389,6 @@ m32r_va_arg (valist, type)
else
{
/* Pass by value. */
-
if (size < UNITS_PER_WORD)
{
/* Care for bigendian correction on the aligned address. */
@@ -1492,11 +1417,8 @@ m32r_va_arg (valist, type)
}
static int
-m32r_adjust_cost (insn, link, dep_insn, cost)
- rtx insn ATTRIBUTE_UNUSED;
- rtx link ATTRIBUTE_UNUSED;
- rtx dep_insn ATTRIBUTE_UNUSED;
- int cost;
+m32r_adjust_cost (rtx insn ATTRIBUTE_UNUSED, rtx link ATTRIBUTE_UNUSED,
+ rtx dep_insn ATTRIBUTE_UNUSED, int cost)
{
return cost;
}
@@ -1505,8 +1427,7 @@ m32r_adjust_cost (insn, link, dep_insn, cost)
/* Return true if INSN is real instruction bearing insn. */
static int
-m32r_is_insn (insn)
- rtx insn;
+m32r_is_insn (rtx insn)
{
return (INSN_P (insn)
&& GET_CODE (PATTERN (insn)) != USE
@@ -1518,9 +1439,7 @@ m32r_is_insn (insn)
short instructions are scheduled ahead of the long ones. */
static int
-m32r_adjust_priority (insn, priority)
- rtx insn;
- int priority;
+m32r_adjust_priority (rtx insn, int priority)
{
if (m32r_is_insn (insn)
&& get_attr_insn_size (insn) != INSN_SIZE_SHORT)
@@ -1533,10 +1452,9 @@ m32r_adjust_priority (insn, priority)
/* Initialize for scheduling a group of instructions. */
static void
-m32r_sched_init (stream, verbose, max_ready)
- FILE * stream ATTRIBUTE_UNUSED;
- int verbose ATTRIBUTE_UNUSED;
- int max_ready ATTRIBUTE_UNUSED;
+m32r_sched_init (FILE * stream ATTRIBUTE_UNUSED,
+ int verbose ATTRIBUTE_UNUSED,
+ int max_ready ATTRIBUTE_UNUSED)
{
m32r_sched_odd_word_p = FALSE;
}
@@ -1545,12 +1463,8 @@ m32r_sched_init (stream, verbose, max_ready)
/* Reorder the schedulers priority list if needed */
static int
-m32r_sched_reorder (stream, verbose, ready, n_readyp, clock)
- FILE * stream;
- int verbose;
- rtx * ready;
- int *n_readyp;
- int clock ATTRIBUTE_UNUSED;
+m32r_sched_reorder (FILE * stream, int verbose, rtx * ready,
+ int *n_readyp, int clock ATTRIBUTE_UNUSED)
{
int n_ready = *n_readyp;
@@ -1568,11 +1482,11 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock)
if (n_ready > 1)
{
- rtx * long_head = (rtx *) alloca (sizeof (rtx) * n_ready);
+ rtx * long_head = alloca (sizeof (rtx) * n_ready);
rtx * long_tail = long_head;
- rtx * short_head = (rtx *) alloca (sizeof (rtx) * n_ready);
+ rtx * short_head = alloca (sizeof (rtx) * n_ready);
rtx * short_tail = short_head;
- rtx * new_head = (rtx *) alloca (sizeof (rtx) * n_ready);
+ rtx * new_head = alloca (sizeof (rtx) * n_ready);
rtx * new_tail = new_head + (n_ready - 1);
int i;
@@ -1611,19 +1525,19 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock)
}
/* If we are on an odd word, emit a single short instruction if
- we can */
+ we can. */
if (m32r_sched_odd_word_p && short_head != short_tail)
*new_tail-- = *short_head++;
- /* Now dump out all of the long instructions */
+ /* Now dump out all of the long instructions. */
while (long_head != long_tail)
*new_tail-- = *long_head++;
- /* Now dump out all of the short instructions */
+ /* Now dump out all of the short instructions. */
while (short_head != short_tail)
*new_tail-- = *short_head++;
- if (new_tail+1 != new_head)
+ if (new_tail + 1 != new_head)
abort ();
memcpy (ready, new_head, sizeof (rtx) * n_ready);
@@ -1657,9 +1571,10 @@ m32r_sched_reorder (stream, verbose, ready, n_readyp, clock)
This is sort of a lie. The m32r can issue only 1 long insn at
once, but it can issue 2 short insns. The default therefore is
set at 2, but this can be overridden by the command line option
- -missue-rate=1 */
+ -missue-rate=1. */
+
static int
-m32r_issue_rate ()
+m32r_issue_rate (void)
{
return ((TARGET_LOW_ISSUE_RATE) ? 1 : 2);
}
@@ -1667,12 +1582,9 @@ m32r_issue_rate ()
/* If we have a machine that can issue a variable # of instructions
per cycle, indicate how many more instructions can be issued
after the current one. */
+
static int
-m32r_variable_issue (stream, verbose, insn, how_many)
- FILE * stream;
- int verbose;
- rtx insn;
- int how_many;
+m32r_variable_issue (FILE * stream, int verbose, rtx insn, int how_many)
{
int orig_odd_word_p = m32r_sched_odd_word_p;
int short_p = FALSE;
@@ -1709,10 +1621,7 @@ m32r_variable_issue (stream, verbose, insn, how_many)
/* Cost functions. */
static bool
-m32r_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code ATTRIBUTE_UNUSED;
- int *total;
+m32r_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
{
switch (code)
{
@@ -1736,6 +1645,7 @@ m32r_rtx_costs (x, code, outer_code, total)
case CONST_DOUBLE:
{
rtx high, low;
+
split_double (x, &high, &low);
*total = COSTS_N_INSNS (!INT16_P (INTVAL (high))
+ !INT16_P (INTVAL (low)));
@@ -1764,8 +1674,7 @@ m32r_rtx_costs (x, code, outer_code, total)
call with DECL = NULL_TREE. */
enum m32r_function_type
-m32r_compute_function_type (decl)
- tree decl;
+m32r_compute_function_type (tree decl)
{
/* Cached value. */
static enum m32r_function_type fn_type = M32R_FUNCTION_UNKNOWN;
@@ -1838,23 +1747,22 @@ Notes:
containing anonymous args separately but that complicates things too
much (so it's not done).
3) The return address is saved after the register save area so as to have as
- many insns as possible between the restoration of `lr' and the `jmp lr'.
-*/
+ many insns as possible between the restoration of `lr' and the `jmp lr'. */
/* Structure to be filled in by m32r_compute_frame_size with register
save masks, and offsets for the current function. */
struct m32r_frame_info
{
- unsigned int total_size; /* # bytes that the entire frame takes up */
- unsigned int extra_size; /* # bytes of extra stuff */
- unsigned int pretend_size; /* # bytes we push and pretend caller did */
- unsigned int args_size; /* # bytes that outgoing arguments take up */
- unsigned int reg_size; /* # bytes needed to store regs */
- unsigned int var_size; /* # bytes that variables take up */
- unsigned int gmask; /* mask of saved gp registers */
- unsigned int save_fp; /* nonzero if fp must be saved */
- unsigned int save_lr; /* nonzero if lr (return addr) must be saved */
- int initialized; /* nonzero if frame size already calculated */
+ unsigned int total_size; /* # bytes that the entire frame takes up. */
+ unsigned int extra_size; /* # bytes of extra stuff. */
+ unsigned int pretend_size; /* # bytes we push and pretend caller did. */
+ unsigned int args_size; /* # bytes that outgoing arguments take up. */
+ unsigned int reg_size; /* # bytes needed to store regs. */
+ unsigned int var_size; /* # bytes that variables take up. */
+ unsigned int gmask; /* Mask of saved gp registers. */
+ unsigned int save_fp; /* Nonzero if fp must be saved. */
+ unsigned int save_lr; /* Nonzero if lr (return addr) must be saved. */
+ int initialized; /* Nonzero if frame size already calculated. */
};
/* Current frame information calculated by m32r_compute_frame_size. */
@@ -1864,7 +1772,7 @@ static struct m32r_frame_info current_frame_info;
static struct m32r_frame_info zero_frame_info;
#define FRAME_POINTER_MASK (1 << (FRAME_POINTER_REGNUM))
-#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM))
+#define RETURN_ADDR_MASK (1 << (RETURN_ADDR_REGNUM))
/* Tell prologue and epilogue if register REGNO should be saved / restored.
The return address and frame pointer are treated separately.
@@ -1874,10 +1782,10 @@ static struct m32r_frame_info zero_frame_info;
&& (regs_ever_live[regno] && (!call_used_regs[regno] || interrupt_p)))
#define MUST_SAVE_FRAME_POINTER (regs_ever_live[FRAME_POINTER_REGNUM])
-#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM] || current_function_profile)
+#define MUST_SAVE_RETURN_ADDR (regs_ever_live[RETURN_ADDR_REGNUM] || current_function_profile)
-#define SHORT_INSN_SIZE 2 /* size of small instructions */
-#define LONG_INSN_SIZE 4 /* size of long instructions */
+#define SHORT_INSN_SIZE 2 /* Size of small instructions. */
+#define LONG_INSN_SIZE 4 /* Size of long instructions. */
/* Return the bytes needed to compute the frame pointer from the current
stack pointer.
@@ -1885,8 +1793,7 @@ static struct m32r_frame_info zero_frame_info;
SIZE is the size needed for local variables. */
unsigned int
-m32r_compute_frame_size (size)
- int size; /* # of var. bytes allocated. */
+m32r_compute_frame_size (int size) /* # of var. bytes allocated. */
{
int regno;
unsigned int total_size, var_size, args_size, pretend_size, extra_size;
@@ -1909,7 +1816,6 @@ m32r_compute_frame_size (size)
interrupt_p = M32R_INTERRUPT_P (fn_type);
/* Calculate space needed for registers. */
-
for (regno = 0; regno < M32R_MAX_INT_REGS; regno++)
{
if (MUST_SAVE_REGISTER (regno, interrupt_p))
@@ -1951,7 +1857,7 @@ m32r_compute_frame_size (size)
function. If not specified, 0 is used. */
int
-m32r_first_insn_address ()
+m32r_first_insn_address (void)
{
if (! current_frame_info.initialized)
m32r_compute_frame_size (get_frame_size ());
@@ -1962,7 +1868,7 @@ m32r_first_insn_address ()
/* Expand the m32r prologue as a series of insns. */
void
-m32r_expand_prologue ()
+m32r_expand_prologue (void)
{
int regno;
int frame_size;
@@ -1989,7 +1895,6 @@ m32r_expand_prologue ()
}
/* Save any registers we need to and set up fp. */
-
if (current_frame_info.save_fp)
emit_insn (gen_movsi_push (stack_pointer_rtx, frame_pointer_rtx));
@@ -2014,13 +1919,14 @@ m32r_expand_prologue ()
+ current_frame_info.reg_size));
if (frame_size == 0)
- ; /* nothing to do */
+ ; /* Nothing to do. */
else if (frame_size <= 32768)
emit_insn (gen_addsi3 (stack_pointer_rtx, stack_pointer_rtx,
GEN_INT (-frame_size)));
else
{
rtx tmp = gen_rtx_REG (Pmode, PROLOGUE_TMP_REGNUM);
+
emit_insn (gen_movsi (tmp, GEN_INT (frame_size)));
emit_insn (gen_subsi3 (stack_pointer_rtx, stack_pointer_rtx, tmp));
}
@@ -2038,18 +1944,13 @@ m32r_expand_prologue ()
m32r_compute_frame_size which calculates the prolog size. */
static void
-m32r_output_function_prologue (file, size)
- FILE * file;
- HOST_WIDE_INT size;
+m32r_output_function_prologue (FILE * file, HOST_WIDE_INT size)
{
enum m32r_function_type fn_type = m32r_compute_function_type (current_function_decl);
/* If this is an interrupt handler, mark it as such. */
if (M32R_INTERRUPT_P (fn_type))
- {
- fprintf (file, "\t%s interrupt handler\n",
- ASM_COMMENT_START);
- }
+ fprintf (file, "\t%s interrupt handler\n", ASM_COMMENT_START);
if (! current_frame_info.initialized)
m32r_compute_frame_size (size);
@@ -2068,9 +1969,7 @@ m32r_output_function_prologue (file, size)
and regs. */
static void
-m32r_output_function_epilogue (file, size)
- FILE * file;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+m32r_output_function_epilogue (FILE * file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
int regno;
int noepilogue = FALSE;
@@ -2111,7 +2010,7 @@ m32r_output_function_epilogue (file, size)
{
unsigned int reg_offset = var_size + args_size;
if (reg_offset == 0)
- ; /* nothing to do */
+ ; /* Nothing to do. */
else if (reg_offset < 128)
fprintf (file, "\taddi %s,%s%d\n",
sp_str, IMMEDIATE_PREFIX, reg_offset);
@@ -2127,6 +2026,7 @@ m32r_output_function_epilogue (file, size)
else if (frame_pointer_needed)
{
unsigned int reg_offset = var_size + args_size;
+
if (reg_offset == 0)
fprintf (file, "\tmv %s,%s\n", sp_str, fp_str);
else if (reg_offset < 32768)
@@ -2167,11 +2067,6 @@ m32r_output_function_epilogue (file, size)
fprintf (file, "\tjmp %s\n", reg_names[RETURN_ADDR_REGNUM]);
}
-#if 0 /* no longer needed */
- /* Ensure the function cleanly ends on a 32 bit boundary. */
- fprintf (file, "\t.fillinsn\n");
-#endif
-
/* Reset state info for each function. */
current_frame_info = zero_frame_info;
m32r_compute_function_type (NULL_TREE);
@@ -2181,7 +2076,7 @@ m32r_output_function_epilogue (file, size)
epilogue. */
int
-direct_return ()
+direct_return (void)
{
if (!reload_completed)
return FALSE;
@@ -2193,14 +2088,14 @@ direct_return ()
}
-/* PIC */
+/* PIC. */
/* Emit special PIC prologues and epilogues. */
void
-m32r_finalize_pic ()
+m32r_finalize_pic (void)
{
- /* nothing to do */
+ /* Nothing to do. */
}
/* Nested function support. */
@@ -2210,15 +2105,14 @@ m32r_finalize_pic ()
CXT is an RTX for the static chain value for the function. */
void
-m32r_initialize_trampoline (tramp, fnaddr, cxt)
- rtx tramp ATTRIBUTE_UNUSED;
- rtx fnaddr ATTRIBUTE_UNUSED;
- rtx cxt ATTRIBUTE_UNUSED;
+m32r_initialize_trampoline (rtx tramp ATTRIBUTE_UNUSED,
+ rtx fnaddr ATTRIBUTE_UNUSED,
+ rtx cxt ATTRIBUTE_UNUSED)
{
}
static void
-m32r_file_start ()
+m32r_file_start (void)
{
default_file_start ();
@@ -2233,10 +2127,7 @@ m32r_file_start ()
For `%' followed by punctuation, CODE is the punctuation and X is null. */
void
-m32r_print_operand (file, x, code)
- FILE * file;
- rtx x;
- int code;
+m32r_print_operand (FILE * file, rtx x, int code)
{
rtx addr;
@@ -2281,11 +2172,11 @@ m32r_print_operand (file, x, code)
output_operand_lossage ("invalid operand to %%R code");
return;
- case 'H' : /* High word */
- case 'L' : /* Low word */
+ case 'H' : /* High word. */
+ case 'L' : /* Low word. */
if (GET_CODE (x) == REG)
{
- /* L = least significant word, H = most significant word */
+ /* L = least significant word, H = most significant word. */
if ((WORDS_BIG_ENDIAN != 0) ^ (code == 'L'))
fputs (reg_names[REGNO (x)], file);
else
@@ -2317,8 +2208,8 @@ m32r_print_operand (file, x, code)
return;
}
- case 'B' : /* Bottom half */
- case 'T' : /* Top half */
+ case 'B' : /* Bottom half. */
+ case 'T' : /* Top half. */
/* Output the argument to a `seth' insn (sets the Top half-word).
For constants output arguments to a seth/or3 pair to set Top and
Bottom halves. For symbols output arguments to a seth/add3 pair to
@@ -2393,12 +2284,6 @@ m32r_print_operand (file, x, code)
fputs (IMMEDIATE_PREFIX, file);
return;
-#if 0 /* ??? no longer used */
- case '@' :
- fputs (reg_names[SDA_REGNUM], file);
- return;
-#endif
-
case 0 :
/* Do nothing special. */
break;
@@ -2469,13 +2354,11 @@ m32r_print_operand (file, x, code)
/* Print a memory address as an operand to reference that memory location. */
void
-m32r_print_operand_address (file, addr)
- FILE * file;
- rtx addr;
+m32r_print_operand_address (FILE * file, rtx addr)
{
- register rtx base;
- register rtx index = 0;
- int offset = 0;
+ rtx base;
+ rtx index = 0;
+ int offset = 0;
switch (GET_CODE (addr))
{
@@ -2542,15 +2425,15 @@ m32r_print_operand_address (file, addr)
fputs (reg_names[REGNO (XEXP (addr, 0))], file);
break;
- case PRE_INC : /* Assume SImode */
+ case PRE_INC : /* Assume SImode. */
fprintf (file, "+%s", reg_names[REGNO (XEXP (addr, 0))]);
break;
- case PRE_DEC : /* Assume SImode */
+ case PRE_DEC : /* Assume SImode. */
fprintf (file, "-%s", reg_names[REGNO (XEXP (addr, 0))]);
break;
- case POST_INC : /* Assume SImode */
+ case POST_INC : /* Assume SImode. */
fprintf (file, "%s+", reg_names[REGNO (XEXP (addr, 0))]);
break;
@@ -2561,10 +2444,9 @@ m32r_print_operand_address (file, addr)
}
/* Return true if the operands are the constants 0 and 1. */
+
int
-zero_and_one (operand1, operand2)
- rtx operand1;
- rtx operand2;
+zero_and_one (rtx operand1, rtx operand2)
{
return
GET_CODE (operand1) == CONST_INT
@@ -2574,12 +2456,11 @@ zero_and_one (operand1, operand2)
}
/* Return nonzero if the operand is suitable for use in a conditional move sequence. */
+
int
-conditional_move_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+conditional_move_operand (rtx operand, enum machine_mode mode)
{
- /* Only defined for simple integers so far... */
+ /* Only defined for simple integers so far... */
if (mode != SImode && mode != HImode && mode != QImode)
return FALSE;
@@ -2603,11 +2484,10 @@ conditional_move_operand (operand, mode)
}
}
-/* Return true if the code is a test of the carry bit */
+/* Return true if the code is a test of the carry bit. */
+
int
-carry_compare_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+carry_compare_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
rtx x;
@@ -2633,10 +2513,9 @@ carry_compare_operand (op, mode)
conditional_move_operand() function above. The destination is operand[0].
The condition is operand [1]. The 'true' value is operand [2] and the
'false' value is operand [3]. */
+
char *
-emit_cond_move (operands, insn)
- rtx * operands;
- rtx insn ATTRIBUTE_UNUSED;
+emit_cond_move (rtx * operands, rtx insn ATTRIBUTE_UNUSED)
{
static char buffer [100];
const char * dest = reg_names [REGNO (operands [0])];
@@ -2671,10 +2550,9 @@ emit_cond_move (operands, insn)
/* Returns true if the registers contained in the two
rtl expressions are different. */
+
int
-m32r_not_same_reg (a, b)
- rtx a;
- rtx b;
+m32r_not_same_reg (rtx a, rtx b)
{
int reg_a = -1;
int reg_b = -2;
@@ -2696,11 +2574,9 @@ m32r_not_same_reg (a, b)
/* Use a library function to move some bytes. */
+
static void
-block_move_call (dest_reg, src_reg, bytes_rtx)
- rtx dest_reg;
- rtx src_reg;
- rtx bytes_rtx;
+block_move_call (rtx dest_reg, rtx src_reg, rtx bytes_rtx)
{
/* We want to pass the size as Pmode, which will normally be SImode
but will be DImode if we are using 64 bit longs and pointers. */
@@ -2738,8 +2614,7 @@ block_move_call (dest_reg, src_reg, bytes_rtx)
operands[3] is the alignment. */
void
-m32r_expand_block_move (operands)
- rtx operands[];
+m32r_expand_block_move (rtx operands[])
{
rtx orig_dst = operands[0];
rtx orig_src = operands[1];
@@ -2830,9 +2705,7 @@ m32r_expand_block_move (operands)
operands[4] is a temp register. */
void
-m32r_output_block_move (insn, operands)
- rtx insn ATTRIBUTE_UNUSED;
- rtx operands[];
+m32r_output_block_move (rtx insn ATTRIBUTE_UNUSED, rtx operands[])
{
HOST_WIDE_INT bytes = INTVAL (operands[2]);
int first_time;
@@ -2947,10 +2820,9 @@ m32r_output_block_move (insn, operands)
/* Return true if op is an integer constant, less than or equal to
MAX_MOVE_BYTES. */
+
int
-m32r_block_immediate_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m32r_block_immediate_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != CONST_INT
|| INTVAL (op) > MAX_MOVE_BYTES
@@ -2963,9 +2835,8 @@ m32r_block_immediate_operand (op, mode)
/* Return true if using NEW_REG in place of OLD_REG is ok. */
int
-m32r_hard_regno_rename_ok (old_reg, new_reg)
- unsigned int old_reg ATTRIBUTE_UNUSED;
- unsigned int new_reg;
+m32r_hard_regno_rename_ok (unsigned int old_reg ATTRIBUTE_UNUSED,
+ unsigned int new_reg)
{
/* Interrupt routines can't clobber any register that isn't already used. */
if (lookup_attribute ("interrupt", DECL_ATTRIBUTES (current_function_decl))
diff --git a/gcc/config/m32r/m32r.h b/gcc/config/m32r/m32r.h
index f3289d8ce84..1ed1f095df0 100644
--- a/gcc/config/m32r/m32r.h
+++ b/gcc/config/m32r/m32r.h
@@ -1,23 +1,23 @@
-/* Definitions of target machine for GNU compiler, Mitsubishi M32R cpu.
- Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+/* Definitions of target machine for GNU compiler, Renesas M32R cpu.
+ Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
Free Software Foundation, Inc.
-This file is part of GCC.
+ 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 free software; you can redistribute it and/or modify it
+ under the 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.
+ 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. */
+ 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. */
/* Things to do:
- longlong.h?
@@ -42,14 +42,18 @@ Boston, MA 02111-1307, USA. */
/* M32R/X overrides. */
/* Print subsidiary information on the compiler version in use. */
-#define TARGET_VERSION fprintf (stderr, " (m32r/x)");
+#define TARGET_VERSION fprintf (stderr, " (m32r/x/2)");
/* Additional flags for the preprocessor. */
-#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__} %{m32r:-U__M32RX__}"
+#define CPP_CPU_SPEC "%{m32rx:-D__M32RX__ -D__m32rx__ -U__M32R2__ -U__m32r2__} \
+%{m32r2:-D__M32R2__ -D__m32r2__ -U__M32RX__ -U__m32rx__} \
+%{m32r:-U__M32RX__ -U__m32rx__ -U__M32R2__ -U__m32r2__} \
+ "
+
/* Assembler switches. */
#define ASM_CPU_SPEC \
-"%{m32r} %{m32rx} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts"
+"%{m32r} %{m32rx} %{m32r2} %{!O0: %{O*: -O}} --no-warn-explicit-parallel-conflicts"
/* Use m32rx specific crt0/crtinit/crtfini files. */
#define STARTFILE_CPU_SPEC "%{!shared:crt0.o%s} %{m32rx:m32rx/crtinit.o%s} %{!m32rx:crtinit.o%s}"
@@ -58,7 +62,8 @@ Boston, MA 02111-1307, USA. */
/* Extra machine dependent switches. */
#define SUBTARGET_SWITCHES \
{ "32rx", TARGET_M32RX_MASK, "Compile for the m32rx" }, \
- { "32r", -TARGET_M32RX_MASK, "" },
+ { "32r2", TARGET_M32R2_MASK, "Compile for the m32r2" }, \
+ { "32r", -(TARGET_M32RX_MASK+TARGET_M32R2_MASK), "" },
/* Define this macro as a C expression for the initializer of an array of
strings to tell the driver program which options are defaults for this
@@ -223,6 +228,12 @@ extern int target_flags;
#undef TARGET_M32R
#define TARGET_M32R (! TARGET_M32RX)
+/* Support extended instruction set of m32r2. */
+#define TARGET_M32R2_MASK (1 << 6)
+#define TARGET_M32R2 (target_flags & TARGET_M32RX_MASK)
+#undef TARGET_M32R
+#define TARGET_M32R (! TARGET_M32RX && ! TARGET_M32R2)
+
/* Macro to define tables used to set the flags.
This is a list in braces of pairs in braces,
each pair being { "NAME", VALUE }
@@ -1710,7 +1721,6 @@ extern char m32r_punct_chars[256];
/* Generate DBX and DWARF debugging information. */
#define DBX_DEBUGGING_INFO 1
-#define DWARF_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
/* Prefer STABS (for now). */
diff --git a/gcc/config/m32r/m32r.md b/gcc/config/m32r/m32r.md
index 061e524e3a7..4c9bb6f1276 100644
--- a/gcc/config/m32r/m32r.md
+++ b/gcc/config/m32r/m32r.md
@@ -1,17 +1,17 @@
-;; Machine description of the Mitsubishi M32R cpu for GNU C compiler
-;; Copyright (C) 1996, 1997, 1998, 1999, 2001 Free Software Foundation, Inc.
+;; Machine description of the Renesas M32R cpu for GNU C compiler
+;; Copyright (C) 1996, 1997, 1998, 1999, 2001, 2003 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 free software; you can redistribute it and/or modify it
+;; under the 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.
+;; 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
@@ -72,8 +72,12 @@
(define_attr "m32rx" "no,yes"
(const (symbol_ref "(TARGET_M32RX != 0)")))
+(define_attr "m32r2" "no,yes"
+ (const (symbol_ref "(TARGET_M32R2 != 0)")))
+
(define_attr "m32rx_pipeline" "either,s,o,long,m32r"
- (cond [(eq_attr "m32rx" "no")
+ (cond [(and (eq_attr "m32rx" "no")
+ (eq_attr "m32r2" "no"))
(const_string "m32r")
(eq_attr "insn_size" "!short")
@@ -496,7 +500,7 @@
(define_split
[(set (match_operand:SI 0 "register_operand" "")
- (match_operand:SI 1 "seth_add3_operand" "i"))]
+ (match_operand:SI 1 "seth_add3_operand" ""))]
"TARGET_ADDR32"
[(set (match_dup 0)
(high:SI (match_dup 1)))
@@ -1180,7 +1184,7 @@
[(set (reg:SI 17)
(eq:SI (match_operand:SI 0 "register_operand" "r,r")
(match_operand:SI 1 "reg_or_zero_operand" "r,P")))]
- "TARGET_M32RX"
+ "TARGET_M32RX || TARGET_M32R2"
"@
cmpeq %0, %1
cmpz %0"
@@ -1237,23 +1241,6 @@
cmpui %0,%#%1"
[(set_attr "type" "int2,int4")
(set_attr "length" "2,4")])
-
-
-;; reg == small constant comparisons are best handled by putting the result
-;; of the comparison in a tmp reg and then using beqz/bnez.
-;; ??? The result register doesn't contain 0/STORE_FLAG_VALUE,
-;; it contains 0/nonzero.
-
-(define_insn "cmp_ne_small_const_insn"
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (ne:SI (match_operand:SI 1 "register_operand" "0,r")
- (match_operand:SI 2 "cmp_int16_operand" "N,P")))]
- ""
- "@
- addi %0,%#%N2
- add3 %0,%1,%#%N2"
- [(set_attr "type" "int2,int4")
- (set_attr "length" "2,4")])
;; These control RTL generation for conditional jump insns.
@@ -1612,7 +1599,7 @@
if (! register_operand (op1, mode))
op1 = force_reg (mode, op1);
- if (TARGET_M32RX)
+ if (TARGET_M32RX || TARGET_M32R2)
{
if (! reg_or_zero_operand (op2, mode))
op2 = force_reg (mode, op2);
@@ -1638,7 +1625,7 @@
(eq:SI (match_operand:SI 1 "register_operand" "%r")
(match_operand:SI 2 "reg_or_zero_operand" "rP")))
(clobber (reg:SI 17))]
- "TARGET_M32RX"
+ "TARGET_M32RX || TARGET_M32R2"
"#"
[(set_attr "type" "multi")
(set_attr "length" "6")])
@@ -1648,7 +1635,7 @@
(eq:SI (match_operand:SI 1 "register_operand" "")
(match_operand:SI 2 "reg_or_zero_operand" "")))
(clobber (reg:SI 17))]
- "TARGET_M32RX"
+ "TARGET_M32RX || TARGET_M32R2"
[(set (reg:SI 17)
(eq:SI (match_dup 1)
(match_dup 2)))
diff --git a/gcc/config/m32r/t-m32r b/gcc/config/m32r/t-m32r
index f8cff4abf5e..8770f1ea8a3 100644
--- a/gcc/config/m32r/t-m32r
+++ b/gcc/config/m32r/t-m32r
@@ -41,14 +41,16 @@ $(T)crtfini.o: $(srcdir)/config/m32r/initfini.c $(GCC_PASSES) $(CONFIG_H)
-o $(T)crtfini.o
m32rx:
mkdir $@
+m32r2:
+ mkdir $@
# -mmodel={small,medium} requires separate libraries.
# We don't build libraries for the large model, instead we use the medium
# libraries. The only difference is that the large model can handle jumps
# more than 26 signed bits away.
-MULTILIB_OPTIONS = mmodel=small/mmodel=medium m32r/m32rx
-MULTILIB_DIRNAMES = small medium m32r m32rx
+MULTILIB_OPTIONS = mmodel=small/mmodel=medium m32r/m32rx/m32r2
+MULTILIB_DIRNAMES = small medium m32r m32rx m32r2
MULTILIB_MATCHES = mmodel?medium=mmodel?large
# Set MULTILIB_EXTRA_OPTS so shipped libraries have small data in .sdata and
diff --git a/gcc/config/m68hc11/m68hc11-protos.h b/gcc/config/m68hc11/m68hc11-protos.h
index 73a539349f9..d4582ab803d 100644
--- a/gcc/config/m68hc11/m68hc11-protos.h
+++ b/gcc/config/m68hc11/m68hc11-protos.h
@@ -20,126 +20,118 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-extern int m68hc11_override_options PARAMS((void));
-extern int m68hc11_optimization_options PARAMS((int,int));
-extern void m68hc11_conditional_register_usage PARAMS((void));
-extern int hard_regno_mode_ok PARAMS((int, enum machine_mode));
-extern int m68hc11_hard_regno_rename_ok PARAMS((int, int));
+extern int m68hc11_override_options (void);
+extern int m68hc11_optimization_options (int,int);
+extern void m68hc11_conditional_register_usage (void);
+extern int hard_regno_mode_ok (int, enum machine_mode);
+extern int m68hc11_hard_regno_rename_ok (int, int);
-extern int m68hc11_total_frame_size PARAMS((void));
-extern int m68hc11_initial_frame_pointer_offset PARAMS((void));
-extern int m68hc11_initial_elimination_offset PARAMS((int, int));
+extern int m68hc11_total_frame_size (void);
+extern int m68hc11_initial_frame_pointer_offset (void);
+extern int m68hc11_initial_elimination_offset (int, int);
-extern void expand_prologue PARAMS((void));
-extern void expand_epilogue PARAMS((void));
+extern void expand_prologue (void);
+extern void expand_epilogue (void);
#ifdef TREE_CODE
-extern void m68hc11_function_arg_advance PARAMS((CUMULATIVE_ARGS*,
- enum machine_mode,
- tree,
- int));
+extern void m68hc11_function_arg_advance (CUMULATIVE_ARGS*,
+ enum machine_mode,
+ tree,
+ int);
#endif
#ifdef RTX_CODE
-extern void m68hc11_initialize_trampoline PARAMS((rtx, rtx, rtx));
+extern void m68hc11_initialize_trampoline (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));
+extern rtx m68hc11_expand_compare_and_branch (enum rtx_code, rtx, rtx, rtx);
+extern enum reg_class preferred_reload_class (rtx, enum reg_class);
-extern int m68hc11_go_if_legitimate_address PARAMS((rtx,
- enum machine_mode,
- int));
+extern int m68hc11_go_if_legitimate_address (rtx, enum machine_mode, int);
-extern int m68hc11_legitimize_address PARAMS((rtx*, rtx, enum machine_mode));
+extern int m68hc11_legitimize_address (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_notice_update_cc (rtx, rtx);
+extern void m68hc11_notice_keep_cc (rtx);
-extern void m68hc11_gen_movqi PARAMS((rtx, rtx*));
-extern void m68hc11_gen_movhi PARAMS((rtx, rtx*));
-extern void m68hc11_gen_rotate PARAMS((enum rtx_code, rtx, rtx*));
+extern void m68hc11_gen_movqi (rtx, rtx*);
+extern void m68hc11_gen_movhi (rtx, rtx*);
+extern void m68hc11_gen_rotate (enum rtx_code, rtx, rtx*);
-extern void m68hc11_output_swap PARAMS((rtx,rtx*));
+extern void m68hc11_output_swap (rtx, rtx*);
-extern int next_insn_test_reg PARAMS((rtx,rtx));
+extern int next_insn_test_reg (rtx, rtx);
-extern void print_operand PARAMS((FILE*,rtx,int));
-extern void print_operand_address PARAMS((FILE*,rtx));
+extern void print_operand (FILE*, rtx, int);
+extern void print_operand_address (FILE*, rtx);
-extern int m68hc11_reload_operands PARAMS((rtx*));
+extern int m68hc11_reload_operands (rtx*);
-extern int dead_register_here PARAMS((rtx, rtx));
+extern int dead_register_here (rtx, rtx);
-extern int push_pop_operand_p PARAMS((rtx));
-extern void m68hc11_split_move PARAMS((rtx, rtx, rtx));
-extern void m68hc11_split_compare_and_branch PARAMS((enum rtx_code,
- rtx, rtx, rtx));
-extern void aux_restore_IX_IY PARAMS((rtx));
-extern void aux_validate_IX_IY PARAMS((rtx));
+extern int push_pop_operand_p (rtx);
+extern void m68hc11_split_move (rtx, rtx, rtx);
+extern void m68hc11_split_compare_and_branch (enum rtx_code,
+ rtx, rtx, rtx);
-extern rtx m68hc11_gen_lowpart PARAMS((enum machine_mode, rtx));
-extern rtx m68hc11_gen_highpart PARAMS((enum machine_mode, rtx));
+extern rtx m68hc11_gen_lowpart (enum machine_mode, rtx);
+extern rtx m68hc11_gen_highpart (enum machine_mode, rtx);
#ifdef HAVE_MACHINE_MODES
-extern int m68hc11_memory_move_cost PARAMS((enum machine_mode, enum reg_class,
- int));
-extern int m68hc11_register_move_cost PARAMS((enum machine_mode,
- enum reg_class, enum reg_class));
-
-extern void m68hc11_emit_libcall PARAMS((const char*, enum rtx_code,
- enum machine_mode, enum machine_mode,
- int, rtx*));
-extern int m68hc11_small_indexed_indirect_p PARAMS((rtx, enum machine_mode));
-extern int m68hc11_symbolic_p PARAMS((rtx, enum machine_mode));
-extern int m68hc11_indirect_p PARAMS((rtx, enum machine_mode));
-extern int go_if_legitimate_address2 PARAMS((rtx, enum machine_mode, int));
-
-extern int reg_or_indexed_operand PARAMS((rtx,enum machine_mode));
-extern int tst_operand PARAMS((rtx,enum machine_mode));
-extern int cmp_operand PARAMS((rtx,enum machine_mode));
-extern int memory_indexed_operand PARAMS((rtx, enum machine_mode));
-
-extern void m68hc11_split_logical PARAMS((enum machine_mode, int, rtx*));
-
-extern int m68hc11_register_indirect_p PARAMS((rtx, enum machine_mode));
-
-extern int symbolic_memory_operand PARAMS((rtx, enum machine_mode));
-
-extern int memory_reload_operand PARAMS((rtx, enum machine_mode));
-extern int stack_register_operand PARAMS((rtx, enum machine_mode));
-extern int d_register_operand PARAMS((rtx, enum machine_mode));
-extern int hard_addr_reg_operand PARAMS((rtx, enum machine_mode));
-extern int arith_src_operand PARAMS((rtx, enum machine_mode));
-extern int m68hc11_logical_operator PARAMS((rtx, enum machine_mode));
-extern int m68hc11_arith_operator PARAMS((rtx, enum machine_mode));
-extern int m68hc11_non_shift_operator PARAMS((rtx, enum machine_mode));
-extern int m68hc11_shift_operator PARAMS((rtx, enum machine_mode));
-extern int m68hc11_unary_operator PARAMS((rtx, enum machine_mode));
-extern int m68hc11_eq_compare_operator PARAMS((rtx, enum machine_mode));
-extern int non_push_operand PARAMS((rtx, enum machine_mode));
-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 int m68hc11_memory_move_cost (enum machine_mode, enum reg_class, int);
+extern int m68hc11_register_move_cost (enum machine_mode,
+ enum reg_class, enum reg_class);
+
+extern void m68hc11_emit_libcall (const char*, enum rtx_code,
+ enum machine_mode, enum machine_mode,
+ int, rtx*);
+extern int m68hc11_small_indexed_indirect_p (rtx, enum machine_mode);
+extern int m68hc11_symbolic_p (rtx, enum machine_mode);
+extern int m68hc11_indirect_p (rtx, enum machine_mode);
+extern int go_if_legitimate_address2 (rtx, enum machine_mode, int);
+
+extern int reg_or_indexed_operand (rtx,enum machine_mode);
+extern int tst_operand (rtx,enum machine_mode);
+extern int cmp_operand (rtx,enum machine_mode);
+extern int memory_indexed_operand (rtx, enum machine_mode);
+
+extern void m68hc11_split_logical (enum machine_mode, int, rtx*);
+
+extern int m68hc11_register_indirect_p (rtx, enum machine_mode);
+
+extern int symbolic_memory_operand (rtx, enum machine_mode);
+
+extern int memory_reload_operand (rtx, enum machine_mode);
+extern int stack_register_operand (rtx, enum machine_mode);
+extern int d_register_operand (rtx, enum machine_mode);
+extern int hard_addr_reg_operand (rtx, enum machine_mode);
+extern int arith_src_operand (rtx, enum machine_mode);
+extern int m68hc11_logical_operator (rtx, enum machine_mode);
+extern int m68hc11_arith_operator (rtx, enum machine_mode);
+extern int m68hc11_non_shift_operator (rtx, enum machine_mode);
+extern int m68hc11_shift_operator (rtx, enum machine_mode);
+extern int m68hc11_unary_operator (rtx, enum machine_mode);
+extern int m68hc11_eq_compare_operator (rtx, enum machine_mode);
+extern int non_push_operand (rtx, enum machine_mode);
+extern int hard_reg_operand (rtx, enum machine_mode);
+extern int soft_reg_operand (rtx, enum machine_mode);
+extern int reg_or_some_mem_operand (rtx, enum machine_mode);
#if defined TREE_CODE
-extern void m68hc11_init_cumulative_args PARAMS((CUMULATIVE_ARGS*,
- tree,
- rtx));
-
-extern rtx m68hc11_function_arg PARAMS((const CUMULATIVE_ARGS* ,
- enum machine_mode,
- tree, int));
-extern int m68hc11_function_arg_pass_by_reference PARAMS((const CUMULATIVE_ARGS*,
- enum machine_mode,
- tree,
- int));
-extern int m68hc11_function_arg_padding PARAMS((enum machine_mode, tree));
-
-extern void m68hc11_function_epilogue PARAMS((FILE*,int));
-
-extern int m68hc11_is_far_symbol PARAMS((rtx));
-extern int m68hc11_is_trap_symbol PARAMS((rtx));
+extern void m68hc11_init_cumulative_args (CUMULATIVE_ARGS*, tree, rtx);
+
+extern rtx m68hc11_function_arg (const CUMULATIVE_ARGS* ,
+ enum machine_mode,
+ tree, int);
+extern int m68hc11_function_arg_pass_by_reference (const CUMULATIVE_ARGS*,
+ enum machine_mode,
+ tree,
+ int);
+extern int m68hc11_function_arg_padding (enum machine_mode, tree);
+
+extern void m68hc11_function_epilogue (FILE*,int);
+
+extern int m68hc11_is_far_symbol (rtx);
+extern int m68hc11_is_trap_symbol (rtx);
#endif /* TREE_CODE */
diff --git a/gcc/config/m68hc11/m68hc11.c b/gcc/config/m68hc11/m68hc11.c
index 3f1cb4f9941..9a8651dd440 100644
--- a/gcc/config/m68hc11/m68hc11.c
+++ b/gcc/config/m68hc11/m68hc11.c
@@ -59,34 +59,34 @@ Note:
#include "target.h"
#include "target-def.h"
-static void emit_move_after_reload PARAMS ((rtx, rtx, rtx));
-static rtx simplify_logical PARAMS ((enum machine_mode, int, rtx, rtx *));
-static void m68hc11_emit_logical PARAMS ((enum machine_mode, int, rtx *));
-static void m68hc11_reorg PARAMS ((void));
-static int go_if_legitimate_address_internal PARAMS((rtx, enum machine_mode,
- int));
-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_address_cost PARAMS ((rtx));
-static int m68hc11_shift_cost PARAMS ((enum machine_mode, rtx, int));
-static int m68hc11_rtx_costs_1 PARAMS ((rtx, enum rtx_code, enum rtx_code));
-static bool m68hc11_rtx_costs PARAMS ((rtx, int, int, int *));
-static int m68hc11_auto_inc_p PARAMS ((rtx));
-static tree m68hc11_handle_fntype_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static void emit_move_after_reload (rtx, rtx, rtx);
+static rtx simplify_logical (enum machine_mode, int, rtx, rtx *);
+static void m68hc11_emit_logical (enum machine_mode, int, rtx *);
+static void m68hc11_reorg (void);
+static int go_if_legitimate_address_internal (rtx, enum machine_mode, int);
+static int register_indirect_p (rtx, enum machine_mode, int);
+static rtx m68hc11_expand_compare (enum rtx_code, rtx, rtx);
+static int must_parenthesize (rtx);
+static int m68hc11_address_cost (rtx);
+static int m68hc11_shift_cost (enum machine_mode, rtx, int);
+static int m68hc11_rtx_costs_1 (rtx, enum rtx_code, enum rtx_code);
+static bool m68hc11_rtx_costs (rtx, int, int, int *);
+static int m68hc11_auto_inc_p (rtx);
+static tree m68hc11_handle_fntype_attribute (tree *, tree, tree, int, bool *);
const struct attribute_spec m68hc11_attribute_table[];
-void create_regs_rtx PARAMS ((void));
+void create_regs_rtx (void);
-static void asm_print_register PARAMS ((FILE *, int));
-static void m68hc11_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static void m68hc11_asm_out_constructor PARAMS ((rtx, int));
-static void m68hc11_asm_out_destructor PARAMS ((rtx, int));
-static void m68hc11_file_start PARAMS ((void));
-static void m68hc11_encode_section_info PARAMS((tree, rtx, int));
-static int autoinc_mode PARAMS((rtx));
-static int m68hc11_make_autoinc_notes PARAMS((rtx *, void *));
-static void m68hc11_init_libfuncs PARAMS ((void));
+static void asm_print_register (FILE *, int);
+static void m68hc11_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static void m68hc11_asm_out_constructor (rtx, int);
+static void m68hc11_asm_out_destructor (rtx, int);
+static void m68hc11_file_start (void);
+static void m68hc11_encode_section_info (tree, rtx, int);
+static unsigned int m68hc11_section_type_flags (tree, const char*, int);
+static int autoinc_mode (rtx);
+static int m68hc11_make_autoinc_notes (rtx *, void *);
+static void m68hc11_init_libfuncs (void);
/* Must be set to 1 to produce debug messages. */
int debug_m6811 = 0;
@@ -240,6 +240,9 @@ static int nb_soft_regs;
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO m68hc11_encode_section_info
+#undef TARGET_SECTION_TYPE_FLAGS
+#define TARGET_SECTION_TYPE_FLAGS m68hc11_section_type_flags
+
#undef TARGET_RTX_COSTS
#define TARGET_RTX_COSTS m68hc11_rtx_costs
#undef TARGET_ADDRESS_COST
@@ -254,7 +257,7 @@ static int nb_soft_regs;
struct gcc_target targetm = TARGET_INITIALIZER;
int
-m68hc11_override_options ()
+m68hc11_override_options (void)
{
memset (m68hc11_reg_valid_for_index, 0,
sizeof (m68hc11_reg_valid_for_index));
@@ -320,7 +323,7 @@ m68hc11_override_options ()
void
-m68hc11_conditional_register_usage ()
+m68hc11_conditional_register_usage (void)
{
int i;
int cnt = atoi (m68hc11_soft_reg_count);
@@ -353,7 +356,7 @@ static const char *const reg_class_names[] = REG_CLASS_NAMES;
void
-create_regs_rtx ()
+create_regs_rtx (void)
{
/* regs_inited = 1; */
ix_reg = gen_rtx (REG, HImode, HARD_X_REGNUM);
@@ -379,9 +382,7 @@ create_regs_rtx ()
registers. They may be stored in soft registers if there are
enough of them. */
int
-hard_regno_mode_ok (regno, mode)
- int regno;
- enum machine_mode mode;
+hard_regno_mode_ok (int regno, enum machine_mode mode)
{
switch (GET_MODE_SIZE (mode))
{
@@ -409,8 +410,7 @@ hard_regno_mode_ok (regno, mode)
}
int
-m68hc11_hard_regno_rename_ok (reg1, reg2)
- int reg1, reg2;
+m68hc11_hard_regno_rename_ok (int reg1, int reg2)
{
/* Don't accept renaming to Z register. We will replace it to
X,Y or D during machine reorg pass. */
@@ -426,9 +426,7 @@ m68hc11_hard_regno_rename_ok (reg1, reg2)
}
enum reg_class
-preferred_reload_class (operand, class)
- rtx operand;
- enum reg_class class;
+preferred_reload_class (rtx operand, enum reg_class class)
{
enum machine_mode mode;
@@ -546,10 +544,7 @@ preferred_reload_class (operand, class)
For 68hc11: n,r with n in [0..255] and r in A_REGS class
For 68hc12: n,r no constraint on the constant, r in A_REGS class. */
static int
-register_indirect_p (operand, mode, strict)
- rtx operand;
- enum machine_mode mode;
- int strict;
+register_indirect_p (rtx operand, enum machine_mode mode, int strict)
{
rtx base, offset;
@@ -611,9 +606,7 @@ register_indirect_p (operand, mode, strict)
/* Returns 1 if the operand fits in a 68HC11 indirect mode or in
a 68HC12 1-byte index addressing mode. */
int
-m68hc11_small_indexed_indirect_p (operand, mode)
- rtx operand;
- enum machine_mode mode;
+m68hc11_small_indexed_indirect_p (rtx operand, enum machine_mode mode)
{
rtx base, offset;
@@ -674,9 +667,7 @@ m68hc11_small_indexed_indirect_p (operand, mode)
}
int
-m68hc11_register_indirect_p (operand, mode)
- rtx operand;
- enum machine_mode mode;
+m68hc11_register_indirect_p (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) != MEM)
return 0;
@@ -687,10 +678,8 @@ m68hc11_register_indirect_p (operand, mode)
}
static int
-go_if_legitimate_address_internal (operand, mode, strict)
- rtx operand;
- enum machine_mode mode;
- int strict;
+go_if_legitimate_address_internal (rtx operand, enum machine_mode mode,
+ int strict)
{
if (CONSTANT_ADDRESS_P (operand) && TARGET_M6812)
{
@@ -717,10 +706,8 @@ go_if_legitimate_address_internal (operand, mode, strict)
}
int
-m68hc11_go_if_legitimate_address (operand, mode, strict)
- rtx operand;
- enum machine_mode mode;
- int strict;
+m68hc11_go_if_legitimate_address (rtx operand, enum machine_mode mode,
+ int strict)
{
int result;
@@ -752,18 +739,16 @@ m68hc11_go_if_legitimate_address (operand, mode, strict)
}
int
-m68hc11_legitimize_address (operand, old_operand, mode)
- rtx *operand ATTRIBUTE_UNUSED;
- rtx old_operand ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_legitimize_address (rtx *operand ATTRIBUTE_UNUSED,
+ rtx old_operand ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
return 0;
}
int
-m68hc11_reload_operands (operands)
- rtx operands[];
+m68hc11_reload_operands (rtx operands[])
{
enum machine_mode mode;
@@ -858,13 +843,9 @@ m68hc11_reload_operands (operands)
}
void
-m68hc11_emit_libcall (name, code, dmode, smode, noperands, operands)
- const char *name;
- enum rtx_code code;
- enum machine_mode dmode;
- enum machine_mode smode;
- int noperands;
- rtx *operands;
+m68hc11_emit_libcall (const char *name, enum rtx_code code,
+ enum machine_mode dmode, enum machine_mode smode,
+ int noperands, rtx *operands)
{
rtx ret;
rtx insns;
@@ -902,8 +883,7 @@ m68hc11_emit_libcall (name, code, dmode, smode, noperands, operands)
(same as auto_inc_p() in rtlanal.c but do not take into
account the stack). */
static int
-m68hc11_auto_inc_p (x)
- rtx x;
+m68hc11_auto_inc_p (rtx x)
{
return GET_CODE (x) == PRE_DEC
|| GET_CODE (x) == POST_INC
@@ -914,9 +894,7 @@ m68hc11_auto_inc_p (x)
/* Predicates for machine description. */
int
-memory_reload_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+memory_reload_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (operand) == MEM
&& GET_CODE (XEXP (operand, 0)) == PLUS
@@ -927,9 +905,7 @@ memory_reload_operand (operand, mode)
}
int
-tst_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+tst_operand (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) == MEM && reload_completed == 0)
{
@@ -941,9 +917,7 @@ tst_operand (operand, mode)
}
int
-cmp_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+cmp_operand (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) == MEM)
{
@@ -955,9 +929,7 @@ cmp_operand (operand, mode)
}
int
-non_push_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+non_push_operand (rtx operand, enum machine_mode mode)
{
if (general_operand (operand, mode) == 0)
return 0;
@@ -968,9 +940,7 @@ non_push_operand (operand, mode)
}
int
-reg_or_some_mem_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+reg_or_some_mem_operand (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) == MEM)
{
@@ -992,9 +962,7 @@ reg_or_some_mem_operand (operand, mode)
}
int
-m68hc11_symbolic_p (operand, mode)
- rtx operand;
- enum machine_mode mode;
+m68hc11_symbolic_p (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) == MEM)
{
@@ -1007,9 +975,7 @@ m68hc11_symbolic_p (operand, mode)
}
int
-m68hc11_indirect_p (operand, mode)
- rtx operand;
- enum machine_mode mode;
+m68hc11_indirect_p (rtx operand, enum machine_mode mode)
{
if (GET_CODE (operand) == MEM)
{
@@ -1028,17 +994,13 @@ m68hc11_indirect_p (operand, mode)
}
int
-stack_register_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+stack_register_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return SP_REG_P (operand);
}
int
-d_register_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+d_register_operand (rtx operand, enum machine_mode mode)
{
if (GET_MODE (operand) != mode && mode != VOIDmode)
return 0;
@@ -1053,9 +1015,7 @@ d_register_operand (operand, mode)
}
int
-hard_addr_reg_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+hard_addr_reg_operand (rtx operand, enum machine_mode mode)
{
if (GET_MODE (operand) != mode && mode != VOIDmode)
return 0;
@@ -1070,9 +1030,7 @@ hard_addr_reg_operand (operand, mode)
}
int
-hard_reg_operand (operand, mode)
- rtx operand;
- enum machine_mode mode;
+hard_reg_operand (rtx operand, enum machine_mode mode)
{
if (GET_MODE (operand) != mode && mode != VOIDmode)
return 0;
@@ -1086,9 +1044,7 @@ hard_reg_operand (operand, mode)
}
int
-memory_indexed_operand (operand, mode)
- rtx operand;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+memory_indexed_operand (rtx operand, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (operand) != MEM)
return 0;
@@ -1107,8 +1063,7 @@ memory_indexed_operand (operand, mode)
}
int
-push_pop_operand_p (operand)
- rtx operand;
+push_pop_operand_p (rtx operand)
{
if (GET_CODE (operand) != MEM)
{
@@ -1122,9 +1077,7 @@ push_pop_operand_p (operand)
reference and a constant. */
int
-symbolic_memory_operand (op, mode)
- register rtx op;
- enum machine_mode mode;
+symbolic_memory_operand (rtx op, enum machine_mode mode)
{
switch (GET_CODE (op))
{
@@ -1152,25 +1105,19 @@ symbolic_memory_operand (op, mode)
}
int
-m68hc11_eq_compare_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_eq_compare_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == EQ || GET_CODE (op) == NE;
}
int
-m68hc11_logical_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_logical_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR;
}
int
-m68hc11_arith_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_arith_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR
|| GET_CODE (op) == PLUS || GET_CODE (op) == MINUS
@@ -1180,9 +1127,7 @@ m68hc11_arith_operator (op, mode)
}
int
-m68hc11_non_shift_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_non_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == AND || GET_CODE (op) == IOR || GET_CODE (op) == XOR
|| GET_CODE (op) == PLUS || GET_CODE (op) == MINUS;
@@ -1190,9 +1135,7 @@ m68hc11_non_shift_operator (op, mode)
/* Return true if op is a shift operator. */
int
-m68hc11_shift_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_shift_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == ROTATE || GET_CODE (op) == ROTATERT
|| GET_CODE (op) == LSHIFTRT || GET_CODE (op) == ASHIFT
@@ -1200,9 +1143,7 @@ m68hc11_shift_operator (op, mode)
}
int
-m68hc11_unary_operator (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+m68hc11_unary_operator (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return GET_CODE (op) == NEG || GET_CODE (op) == NOT
|| GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND;
@@ -1218,10 +1159,7 @@ m68hc11_unary_operator (op, mode)
*/
void
-m68hc11_initialize_trampoline (tramp, fnaddr, cxt)
- rtx tramp;
- rtx fnaddr;
- rtx cxt;
+m68hc11_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
{
const char *static_chain_reg = reg_names[STATIC_CHAIN_REGNUM];
@@ -1276,12 +1214,10 @@ static rtx trap_handler_symbol = 0;
/* Handle an attribute requiring a FUNCTION_TYPE, FIELD_DECL or TYPE_DECL;
arguments as in struct attribute_spec.handler. */
static tree
-m68hc11_handle_fntype_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+m68hc11_handle_fntype_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_TYPE
&& TREE_CODE (*node) != METHOD_TYPE
@@ -1301,10 +1237,7 @@ m68hc11_handle_fntype_attribute (node, name, args, flags, no_add_attrs)
in SYMBOL_REF_FLAG. */
static void
-m68hc11_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first ATTRIBUTE_UNUSED;
+m68hc11_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
{
tree func_attr;
int trap_handler;
@@ -1337,9 +1270,21 @@ m68hc11_encode_section_info (decl, rtl, first)
SYMBOL_REF_FLAG (XEXP (rtl, 0)) = is_far;
}
+static unsigned int
+m68hc11_section_type_flags (tree decl, const char *name, int reloc)
+{
+ unsigned int flags = default_section_type_flags (decl, name, reloc);
+
+ if (strncmp (name, ".eeprom", 7) == 0)
+ {
+ flags |= SECTION_WRITE | SECTION_CODE | SECTION_OVERRIDE;
+ }
+
+ return flags;
+}
+
int
-m68hc11_is_far_symbol (sym)
- rtx sym;
+m68hc11_is_far_symbol (rtx sym)
{
if (GET_CODE (sym) == MEM)
sym = XEXP (sym, 0);
@@ -1348,8 +1293,7 @@ m68hc11_is_far_symbol (sym)
}
int
-m68hc11_is_trap_symbol (sym)
- rtx sym;
+m68hc11_is_trap_symbol (rtx sym)
{
if (GET_CODE (sym) == MEM)
sym = XEXP (sym, 0);
@@ -1366,11 +1310,10 @@ m68hc11_is_trap_symbol (sym)
SCz: I tried to pass DImode by reference but it seems that this
does not work very well. */
int
-m68hc11_function_arg_pass_by_reference (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- tree type;
- int named ATTRIBUTE_UNUSED;
+m68hc11_function_arg_pass_by_reference (const CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ tree type,
+ int named ATTRIBUTE_UNUSED)
{
return ((type && TREE_CODE (type) == ARRAY_TYPE)
/* Consider complex values as aggregates, so care for TCmode. */
@@ -1382,9 +1325,7 @@ m68hc11_function_arg_pass_by_reference (cum, mode, type, named)
/* Define the offset between two registers, one to be eliminated, and the
other its replacement, at the start of a routine. */
int
-m68hc11_initial_elimination_offset (from, to)
- int from;
- int to;
+m68hc11_initial_elimination_offset (int from, int to)
{
int trap_handler;
tree func_attr;
@@ -1451,10 +1392,7 @@ m68hc11_initial_elimination_offset (from, to)
For a library call, FNTYPE is 0. */
void
-m68hc11_init_cumulative_args (cum, fntype, libname)
- CUMULATIVE_ARGS *cum;
- tree fntype;
- rtx libname;
+m68hc11_init_cumulative_args (CUMULATIVE_ARGS *cum, tree fntype, rtx libname)
{
tree ret_type;
@@ -1507,11 +1445,8 @@ m68hc11_init_cumulative_args (cum, fntype, libname)
(TYPE is null for libcalls where that information may not be available.) */
void
-m68hc11_function_arg_advance (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+m68hc11_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
if (mode != BLKmode)
{
@@ -1548,11 +1483,8 @@ m68hc11_function_arg_advance (cum, mode, type, named)
(otherwise it is an extra parameter matching an ellipsis). */
struct rtx_def *
-m68hc11_function_arg (cum, mode, type, named)
- const CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type ATTRIBUTE_UNUSED;
- int named ATTRIBUTE_UNUSED;
+m68hc11_function_arg (const CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type ATTRIBUTE_UNUSED, int named ATTRIBUTE_UNUSED)
{
if (cum->words != 0)
{
@@ -1580,9 +1512,7 @@ m68hc11_function_arg (cum, mode, type, named)
Structures are stored left shifted in their argument slot. */
int
-m68hc11_function_arg_padding (mode, type)
- enum machine_mode mode;
- tree type;
+m68hc11_function_arg_padding (enum machine_mode mode, tree type)
{
if (type != 0 && AGGREGATE_TYPE_P (type))
return upward;
@@ -1597,8 +1527,7 @@ m68hc11_function_arg_padding (mode, type)
/* Emit a move after the reload pass has completed. This is used to
emit the prologue and epilogue. */
static void
-emit_move_after_reload (to, from, scratch)
- rtx to, from, scratch;
+emit_move_after_reload (rtx to, rtx from, rtx scratch)
{
rtx insn;
@@ -1640,7 +1569,7 @@ emit_move_after_reload (to, from, scratch)
}
int
-m68hc11_total_frame_size ()
+m68hc11_total_frame_size (void)
{
int size;
int regno;
@@ -1661,9 +1590,8 @@ m68hc11_total_frame_size ()
}
static void
-m68hc11_output_function_epilogue (out, size)
- FILE *out ATTRIBUTE_UNUSED;
- HOST_WIDE_INT size ATTRIBUTE_UNUSED;
+m68hc11_output_function_epilogue (FILE *out ATTRIBUTE_UNUSED,
+ HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
/* We catch the function epilogue generation to have a chance
to clear the z_replacement_completed flag. */
@@ -1671,7 +1599,7 @@ m68hc11_output_function_epilogue (out, size)
}
void
-expand_prologue ()
+expand_prologue (void)
{
tree func_attr;
int size;
@@ -1775,7 +1703,7 @@ expand_prologue ()
}
void
-expand_epilogue ()
+expand_epilogue (void)
{
int size;
register int regno;
@@ -1888,9 +1816,7 @@ expand_epilogue ()
fixed to work for constants and 68HC11 specific registers. */
rtx
-m68hc11_gen_lowpart (mode, x)
- enum machine_mode mode;
- rtx x;
+m68hc11_gen_lowpart (enum machine_mode mode, rtx x)
{
/* We assume that the low part of an auto-inc mode is the same with
the mode changed and that the caller split the larger mode in the
@@ -1965,9 +1891,7 @@ m68hc11_gen_lowpart (mode, x)
}
rtx
-m68hc11_gen_highpart (mode, x)
- enum machine_mode mode;
- rtx x;
+m68hc11_gen_highpart (enum machine_mode mode, rtx x)
{
/* We assume that the high part of an auto-inc mode is the same with
the mode changed and that the caller split the larger mode in the
@@ -2086,9 +2010,7 @@ m68hc11_gen_highpart (mode, x)
of code when we know that some register dies or can be clobbered. */
int
-dead_register_here (x, reg)
- rtx x;
- rtx reg;
+dead_register_here (rtx x, rtx reg)
{
rtx x_reg;
rtx p;
@@ -2166,9 +2088,7 @@ dead_register_here (x, reg)
/* Print the name of register 'regno' in the assembly file. */
static void
-asm_print_register (file, regno)
- FILE *file;
- int regno;
+asm_print_register (FILE *file, int regno)
{
const char *name = reg_names[regno];
@@ -2211,10 +2131,7 @@ asm_print_register (file, regno)
ignored. */
void
-print_operand (file, op, letter)
- FILE *file;
- rtx op;
- int letter;
+print_operand (FILE *file, rtx op, int letter)
{
if (letter == 't')
{
@@ -2367,8 +2284,7 @@ print_operand (file, op, letter)
around it. This must be done only if there is a symbol whose name
is a processor register. */
static int
-must_parenthesize (op)
- rtx op;
+must_parenthesize (rtx op)
{
const char *name;
@@ -2414,9 +2330,7 @@ must_parenthesize (op)
reference whose address is ADDR. ADDR is an RTL expression. */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
rtx base;
rtx offset;
@@ -2567,9 +2481,7 @@ print_operand_address (file, addr)
/* Splitting of some instructions. */
static rtx
-m68hc11_expand_compare (code, op0, op1)
- enum rtx_code code;
- rtx op0, op1;
+m68hc11_expand_compare (enum rtx_code code, rtx op0, rtx op1)
{
rtx ret = 0;
@@ -2586,9 +2498,8 @@ m68hc11_expand_compare (code, op0, op1)
}
rtx
-m68hc11_expand_compare_and_branch (code, op0, op1, label)
- enum rtx_code code;
- rtx op0, op1, label;
+m68hc11_expand_compare_and_branch (enum rtx_code code, rtx op0, rtx op1,
+ rtx label)
{
rtx tmp;
@@ -2740,8 +2651,7 @@ m68hc11_expand_compare_and_branch (code, op0, op1, label)
/* Return the increment/decrement mode of a MEM if it is such.
Return CONST if it is anything else. */
static int
-autoinc_mode (x)
- rtx x;
+autoinc_mode (rtx x)
{
if (GET_CODE (x) != MEM)
return CONST;
@@ -2757,9 +2667,7 @@ autoinc_mode (x)
}
static int
-m68hc11_make_autoinc_notes (x, data)
- rtx *x;
- void *data;
+m68hc11_make_autoinc_notes (rtx *x, void *data)
{
rtx insn;
@@ -2783,8 +2691,7 @@ m68hc11_make_autoinc_notes (x, data)
The scratch register 'scratch' is used as a temporary to load
store intermediate values. It must be a hard register. */
void
-m68hc11_split_move (to, from, scratch)
- rtx to, from, scratch;
+m68hc11_split_move (rtx to, rtx from, rtx scratch)
{
rtx low_to, low_from;
rtx high_to, high_from;
@@ -2990,11 +2897,7 @@ m68hc11_split_move (to, from, scratch)
}
static rtx
-simplify_logical (mode, code, operand, result)
- enum machine_mode mode;
- int code;
- rtx operand;
- rtx *result;
+simplify_logical (enum machine_mode mode, int code, rtx operand, rtx *result)
{
int val;
int mask;
@@ -3034,10 +2937,7 @@ simplify_logical (mode, code, operand, result)
}
static void
-m68hc11_emit_logical (mode, code, operands)
- enum machine_mode mode;
- int code;
- rtx *operands;
+m68hc11_emit_logical (enum machine_mode mode, int code, rtx *operands)
{
rtx result;
int need_copy;
@@ -3106,10 +3006,7 @@ m68hc11_emit_logical (mode, code, operands)
}
void
-m68hc11_split_logical (mode, code, operands)
- enum machine_mode mode;
- int code;
- rtx *operands;
+m68hc11_split_logical (enum machine_mode mode, int code, rtx *operands)
{
rtx low[4];
rtx high[4];
@@ -3157,9 +3054,7 @@ m68hc11_split_logical (mode, code, operands)
/* Code generation. */
void
-m68hc11_output_swap (insn, operands)
- rtx insn ATTRIBUTE_UNUSED;
- rtx operands[];
+m68hc11_output_swap (rtx insn ATTRIBUTE_UNUSED, rtx operands[])
{
/* We have to be careful with the cc_status. An address register swap
is generated for some comparison. The comparison is made with D
@@ -3211,9 +3106,7 @@ m68hc11_output_swap (insn, operands)
This is used to decide whether a move that set flags should be used
instead. */
int
-next_insn_test_reg (insn, reg)
- rtx insn;
- rtx reg;
+next_insn_test_reg (rtx insn, rtx reg)
{
rtx body;
@@ -3234,9 +3127,7 @@ next_insn_test_reg (insn, reg)
/* Generate the code to move a 16-bit operand into another one. */
void
-m68hc11_gen_movhi (insn, operands)
- rtx insn;
- rtx *operands;
+m68hc11_gen_movhi (rtx insn, rtx *operands)
{
int reg;
@@ -3650,9 +3541,7 @@ m68hc11_gen_movhi (insn, operands)
}
void
-m68hc11_gen_movqi (insn, operands)
- rtx insn;
- rtx *operands;
+m68hc11_gen_movqi (rtx insn, rtx *operands)
{
/* Move a register or memory to the same location.
This is possible because such insn can appear
@@ -3932,10 +3821,7 @@ m68hc11_gen_movqi (insn, operands)
The source and destination must be D or A and the shift must
be a constant. */
void
-m68hc11_gen_rotate (code, insn, operands)
- enum rtx_code code;
- rtx insn;
- rtx operands[];
+m68hc11_gen_rotate (enum rtx_code code, rtx insn, rtx operands[])
{
int val;
@@ -4014,9 +3900,7 @@ m68hc11_gen_rotate (code, insn, operands)
Do not alter them if the instruction would not alter the cc's. */
void
-m68hc11_notice_update_cc (exp, insn)
- rtx exp;
- rtx insn ATTRIBUTE_UNUSED;
+m68hc11_notice_update_cc (rtx exp, rtx insn ATTRIBUTE_UNUSED)
{
/* recognize SET insn's. */
if (GET_CODE (exp) == SET)
@@ -4116,8 +4000,7 @@ m68hc11_notice_update_cc (exp, insn)
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;
+m68hc11_notice_keep_cc (rtx reg)
{
if (reg == 0
|| cc_prev_status.value1 == 0
@@ -4192,10 +4075,10 @@ struct replace_info
int z_loaded_with_sp;
};
-static int m68hc11_check_z_replacement PARAMS ((rtx, struct replace_info *));
-static void m68hc11_find_z_replacement PARAMS ((rtx, struct replace_info *));
-static void m68hc11_z_replacement PARAMS ((rtx));
-static void m68hc11_reassign_regs PARAMS ((rtx));
+static int m68hc11_check_z_replacement (rtx, struct replace_info *);
+static void m68hc11_find_z_replacement (rtx, struct replace_info *);
+static void m68hc11_z_replacement (rtx);
+static void m68hc11_reassign_regs (rtx);
int z_replacement_completed = 0;
@@ -4205,9 +4088,7 @@ int z_replacement_completed = 0;
continue replacement in next insns. */
static int
-m68hc11_check_z_replacement (insn, info)
- rtx insn;
- struct replace_info *info;
+m68hc11_check_z_replacement (rtx insn, struct replace_info *info)
{
int this_insn_uses_ix;
int this_insn_uses_iy;
@@ -4770,9 +4651,7 @@ m68hc11_check_z_replacement (insn, info)
}
static void
-m68hc11_find_z_replacement (insn, info)
- rtx insn;
- struct replace_info *info;
+m68hc11_find_z_replacement (rtx insn, struct replace_info *info)
{
int reg;
@@ -4883,8 +4762,7 @@ m68hc11_find_z_replacement (insn, info)
Z and of the replacement register. */
static void
-m68hc11_z_replacement (insn)
- rtx insn;
+m68hc11_z_replacement (rtx insn)
{
rtx replace_reg_qi;
rtx replace_reg;
@@ -5094,8 +4972,7 @@ m68hc11_z_replacement (insn)
on the instruction. */
static void
-m68hc11_reassign_regs (first)
- rtx first;
+m68hc11_reassign_regs (rtx first)
{
rtx insn;
@@ -5159,7 +5036,7 @@ m68hc11_reassign_regs (first)
'z_replacement_completed' is set to 2. */
static void
-m68hc11_reorg ()
+m68hc11_reorg (void)
{
int split_done = 0;
rtx insn, first;
@@ -5277,10 +5154,8 @@ m68hc11_init_libfuncs (void)
/* Cost of moving memory. */
int
-m68hc11_memory_move_cost (mode, class, in)
- enum machine_mode mode;
- enum reg_class class;
- int in ATTRIBUTE_UNUSED;
+m68hc11_memory_move_cost (enum machine_mode mode, enum reg_class class,
+ int in ATTRIBUTE_UNUSED)
{
if (class <= H_REGS && class > NO_REGS)
{
@@ -5304,10 +5179,8 @@ m68hc11_memory_move_cost (mode, class, in)
have a move cost of 2. Setting a higher cost will force reload to check
the constraints. */
int
-m68hc11_register_move_cost (mode, from, to)
- enum machine_mode mode;
- enum reg_class from;
- enum reg_class to;
+m68hc11_register_move_cost (enum machine_mode mode, enum reg_class from,
+ enum reg_class to)
{
/* All costs are symmetric, so reduce cases by putting the
lower number class as the destination. */
@@ -5329,8 +5202,7 @@ m68hc11_register_move_cost (mode, from, to)
If ADDR is not a valid address, its cost is irrelevant. */
static int
-m68hc11_address_cost (addr)
- rtx addr;
+m68hc11_address_cost (rtx addr)
{
int cost = 4;
@@ -5411,10 +5283,7 @@ m68hc11_address_cost (addr)
}
static int
-m68hc11_shift_cost (mode, x, shift)
- enum machine_mode mode;
- rtx x;
- int shift;
+m68hc11_shift_cost (enum machine_mode mode, rtx x, int shift)
{
int total;
@@ -5443,10 +5312,8 @@ m68hc11_shift_cost (mode, x, shift)
}
static int
-m68hc11_rtx_costs_1 (x, code, outer_code)
- rtx x;
- enum rtx_code code;
- enum rtx_code outer_code ATTRIBUTE_UNUSED;
+m68hc11_rtx_costs_1 (rtx x, enum rtx_code code,
+ enum rtx_code outer_code ATTRIBUTE_UNUSED)
{
enum machine_mode mode = GET_MODE (x);
int extra_cost = 0;
@@ -5579,10 +5446,7 @@ m68hc11_rtx_costs_1 (x, code, outer_code)
}
static bool
-m68hc11_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+m68hc11_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -5634,7 +5498,7 @@ m68hc11_rtx_costs (x, code, outer_code, total)
static void
-m68hc11_file_start ()
+m68hc11_file_start (void)
{
default_file_start ();
@@ -5643,18 +5507,14 @@ m68hc11_file_start ()
static void
-m68hc11_asm_out_constructor (symbol, priority)
- rtx symbol;
- int priority;
+m68hc11_asm_out_constructor (rtx symbol, int priority)
{
default_ctor_section_asm_out_constructor (symbol, priority);
fprintf (asm_out_file, "\t.globl\t__do_global_ctors\n");
}
static void
-m68hc11_asm_out_destructor (symbol, priority)
- rtx symbol;
- int priority;
+m68hc11_asm_out_destructor (rtx symbol, int priority)
{
default_dtor_section_asm_out_destructor (symbol, priority);
fprintf (asm_out_file, "\t.globl\t__do_global_dtors\n");
diff --git a/gcc/config/m68hc11/m68hc11.h b/gcc/config/m68hc11/m68hc11.h
index 7efa0029a49..ba0a2c7eef1 100644
--- a/gcc/config/m68hc11/m68hc11.h
+++ b/gcc/config/m68hc11/m68hc11.h
@@ -1420,7 +1420,7 @@ extern unsigned char m68hc11_reg_valid_for_index[FIRST_PSEUDO_REGISTER];
macro is used in only one place: `find_reloads_address' in reload.c.
For M68HC11, we handle large displacements of a base register
- by splitting the addend accors an addhi3 insn.
+ by splitting the addend across an addhi3 insn.
For M68HC12, the 64K offset range is available.
*/
diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
index 5bf21c55e3d..03e637088fc 100644
--- a/gcc/config/m68k/linux.h
+++ b/gcc/config/m68k/linux.h
@@ -86,13 +86,9 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
builtin_define_std ("mc68000"); \
builtin_define_std ("mc68020"); \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=posix"); \
} \
while (0)
diff --git a/gcc/config/m68k/m68k.c b/gcc/config/m68k/m68k.c
index 565e41ff7cd..b99d1553bb3 100644
--- a/gcc/config/m68k/m68k.c
+++ b/gcc/config/m68k/m68k.c
@@ -43,6 +43,20 @@ Boston, MA 02111-1307, USA. */
#include "debug.h"
#include "flags.h"
+/* The ASM_DOT macro allows easy string pasting to handle the differences
+ between MOTOROLA and MIT syntaxes in asm_fprintf(), which doesn't
+ support the %. option. */
+#if MOTOROLA
+# define ASM_DOT "."
+# define ASM_DOTW ".w"
+# define ASM_DOTL ".l"
+#else
+# define ASM_DOT ""
+# define ASM_DOTW ""
+# define ASM_DOTL ""
+#endif
+
+
/* Structure describing stack frame layout. */
struct m68k_frame
{
@@ -462,15 +476,8 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
before actually allocating the space. */
if (current_function_limit_stack
&& GET_CODE (stack_limit_rtx) == SYMBOL_REF)
- {
-#if defined (MOTOROLA)
- asm_fprintf (stream, "\tcmp.l %I%s+%wd,%Rsp\n\ttrapcs\n",
- XSTR (stack_limit_rtx, 0), current_frame.size + 4);
-#else
- asm_fprintf (stream, "\tcmpl %I%s+%wd,%Rsp\n\ttrapcs\n",
- XSTR (stack_limit_rtx, 0), current_frame.size + 4);
-#endif
- }
+ asm_fprintf (stream, "\tcmp" ASM_DOT "l %I%s+%wd,%Rsp\n\ttrapcs\n",
+ XSTR (stack_limit_rtx, 0), current_frame.size + 4);
/* On ColdFire add register save into initial stack frame setup, if possible. */
fsize_with_regs = current_frame.size;
@@ -480,51 +487,25 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
if (frame_pointer_needed)
{
if (current_frame.size == 0 && TARGET_68040)
- {
/* on the 68040, pea + move is faster than link.w 0 */
-#ifdef MOTOROLA
- fprintf (stream, "\tpea (%s)\n\tmove.l %s,%s\n",
- reg_names[FRAME_POINTER_REGNUM],
- reg_names[STACK_POINTER_REGNUM],
- reg_names[FRAME_POINTER_REGNUM]);
-#else
- fprintf (stream, "\tpea %s@\n\tmovel %s,%s\n",
- reg_names[FRAME_POINTER_REGNUM],
- reg_names[STACK_POINTER_REGNUM],
- reg_names[FRAME_POINTER_REGNUM]);
-#endif
- }
+ fprintf (stream, MOTOROLA ?
+ "\tpea (%s)\n\tmove.l %s,%s\n" :
+ "\tpea %s@\n\tmovel %s,%s\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ reg_names[STACK_POINTER_REGNUM],
+ reg_names[FRAME_POINTER_REGNUM]);
else if (fsize_with_regs < 0x8000)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tlink.w %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#else
- asm_fprintf (stream, "\tlink %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I%wd\n",
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
else if (TARGET_68020)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tlink.l %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#else
- asm_fprintf (stream, "\tlink %s,%I%wd\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tlink" ASM_DOTL " %s,%I%wd\n",
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
else
- {
- /* Adding negative number is faster on the 68040. */
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tlink.w %s,%I0\n\tadd.l %I%wd,%Rsp\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#else
- asm_fprintf (stream, "\tlink %s,%I0\n\taddl %I%wd,%Rsp\n",
- reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
-#endif
- }
+ /* Adding negative number is faster on the 68040. */
+ asm_fprintf (stream, "\tlink" ASM_DOTW " %s,%I0\n"
+ "\tadd" ASM_DOT "l %I%wd,%Rsp\n",
+ reg_names[FRAME_POINTER_REGNUM], -fsize_with_regs);
+
if (dwarf2out_do_frame ())
{
char *l;
@@ -542,61 +523,32 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
if (fsize_with_regs <= 8)
{
if (!TARGET_COLDFIRE)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.w %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\tsubqw %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tsubq" ASM_DOT "w %I%wd,%Rsp\n",
+ fsize_with_regs);
else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tsubq.l %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\tsubql %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tsubq" ASM_DOT "l %I%wd,%Rsp\n",
+ fsize_with_regs);
}
else if (fsize_with_regs <= 16 && TARGET_CPU32)
- {
- /* On the CPU32 it is faster to use two subqw instructions to
- subtract a small integer (8 < N <= 16) to a register. */
-#ifdef MOTOROLA
- asm_fprintf (stream,
- "\tsubq.w %I8,%Rsp\n\tsubq.w %I%wd,%Rsp\n",
- fsize_with_regs - 8);
-#else
- asm_fprintf (stream, "\tsubqw %I8,%Rsp\n\tsubqw %I%wd,%Rsp\n",
- fsize_with_regs - 8);
-#endif
- }
+ /* On the CPU32 it is faster to use two subqw instructions to
+ subtract a small integer (8 < N <= 16) to a register. */
+ asm_fprintf (stream,
+ "\tsubq" ASM_DOT "w %I8,%Rsp\n"
+ "\tsubq" ASM_DOT "w %I%wd,%Rsp\n",
+ fsize_with_regs - 8);
else if (TARGET_68040)
- {
- /* Adding negative number is faster on the 68040. */
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", -fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", -fsize_with_regs);
-#endif
- }
+ /* Adding negative number is faster on the 68040. */
+ asm_fprintf (stream, "\tadd" ASM_DOT "w %I%wd,%Rsp\n",
+ -fsize_with_regs);
else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", -fsize_with_regs);
-#else
- asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", -fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, MOTOROLA ?
+ "\tlea (%wd,%Rsp),%Rsp\n" :
+ "\tlea %Rsp@(%wd),%Rsp\n",
+ -fsize_with_regs);
}
else /* fsize_with_regs >= 0x8000 */
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", -fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", -fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tadd" ASM_DOT "l %I%wd,%Rsp\n", -fsize_with_regs);
+
if (dwarf2out_do_frame ())
{
cfa_offset += current_frame.size + 4;
@@ -606,11 +558,11 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
if (current_frame.fpu_mask)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tfmovm %I0x%x,-(%Rsp)\n", current_frame.fpu_mask);
-#else
- asm_fprintf (stream, "\tfmovem %I0x%x,%Rsp@-\n", current_frame.fpu_mask);
-#endif
+ asm_fprintf (stream, MOTOROLA ?
+ "\tfmovm %I0x%x,-(%Rsp)\n" :
+ "\tfmovem %I0x%x,%Rsp@-\n",
+ current_frame.fpu_mask);
+
if (dwarf2out_do_frame ())
{
char *l = (char *) dwarf2out_cfi_label ();
@@ -630,15 +582,8 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
if (current_function_limit_stack)
{
if (REG_P (stack_limit_rtx))
- {
-#if defined (MOTOROLA)
- asm_fprintf (stream, "\tcmp.l %s,%Rsp\n\ttrapcs\n",
- reg_names[REGNO (stack_limit_rtx)]);
-#else
- asm_fprintf (stream, "\tcmpl %s,%Rsp\n\ttrapcs\n",
- reg_names[REGNO (stack_limit_rtx)]);
-#endif
- }
+ asm_fprintf (stream, "\tcmp" ASM_DOT "l %s,%Rsp\n\ttrapcs\n",
+ reg_names[REGNO (stack_limit_rtx)]);
else if (GET_CODE (stack_limit_rtx) != SYMBOL_REF)
warning ("stack limit expression is not supported");
}
@@ -655,12 +600,9 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
for (i = 0; i < 16; i++)
if (current_frame.reg_rev_mask & (1 << i))
{
- asm_fprintf (stream,
-#ifdef MOTOROLA
- "\t%Omove.l %s,-(%Rsp)\n",
-#else
- "\tmovel %s,%Rsp@-\n",
-#endif
+ asm_fprintf (stream, MOTOROLA ?
+ "\t%Omove.l %s,-(%Rsp)\n" :
+ "\tmovel %s,%Rsp@-\n",
reg_names[15 - i]);
if (dwarf2out_do_frame ())
{
@@ -676,27 +618,21 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
else if (current_frame.reg_rev_mask)
{
if (TARGET_COLDFIRE)
- {
- /* The ColdFire does not support the predecrement form of the
- MOVEM instruction, so we must adjust the stack pointer and
- then use the plain address register indirect mode.
- The required register save space was combined earlier with
- the fsize_with_regs amount. */
-
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l %I0x%x,(%Rsp)\n", current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %I0x%x,%Rsp@\n", current_frame.reg_mask);
-#endif
- }
+ /* The ColdFire does not support the predecrement form of the
+ MOVEM instruction, so we must adjust the stack pointer and
+ then use the plain address register indirect mode.
+ The required register save space was combined earlier with
+ the fsize_with_regs amount. */
+
+ asm_fprintf (stream, MOTOROLA ?
+ "\tmovm.l %I0x%x,(%Rsp)\n" :
+ "\tmoveml %I0x%x,%Rsp@\n",
+ current_frame.reg_mask);
else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l %I0x%x,-(%Rsp)\n", current_frame.reg_rev_mask);
-#else
- asm_fprintf (stream, "\tmoveml %I0x%x,%Rsp@-\n", current_frame.reg_rev_mask);
-#endif
- }
+ asm_fprintf (stream, MOTOROLA ?
+ "\tmovm.l %I0x%x,-(%Rsp)\n" :
+ "\tmoveml %I0x%x,%Rsp@-\n",
+ current_frame.reg_rev_mask);
if (dwarf2out_do_frame ())
{
char *l = (char *) dwarf2out_cfi_label ();
@@ -723,16 +659,17 @@ m68k_output_function_prologue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
}
else
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
- reg_names[PIC_OFFSET_TABLE_REGNUM]);
-#else
- asm_fprintf (stream, "\tmovel %I%U_GLOBAL_OFFSET_TABLE_, %s\n",
- reg_names[PIC_OFFSET_TABLE_REGNUM]);
- asm_fprintf (stream, "\tlea %Rpc@(0,%s:l),%s\n",
- reg_names[PIC_OFFSET_TABLE_REGNUM],
- reg_names[PIC_OFFSET_TABLE_REGNUM]);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\t%Olea (%Rpc, %U_GLOBAL_OFFSET_TABLE_@GOTPC), %s\n",
+ reg_names[PIC_OFFSET_TABLE_REGNUM]);
+ else
+ {
+ asm_fprintf (stream, "\tmovel %I%U_GLOBAL_OFFSET_TABLE_, %s\n",
+ reg_names[PIC_OFFSET_TABLE_REGNUM]);
+ asm_fprintf (stream, "\tlea %Rpc@(0,%s:l),%s\n",
+ reg_names[PIC_OFFSET_TABLE_REGNUM],
+ reg_names[PIC_OFFSET_TABLE_REGNUM]);
+ }
}
}
}
@@ -811,24 +748,9 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
/* Because the ColdFire doesn't support moveml with
complex address modes we make an extra correction here. */
if (TARGET_COLDFIRE)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l %I%d,%Ra1\n",
- -fsize - current_frame.offset);
-#else
- asm_fprintf (stream, "\tmovel %I%d,%Ra1\n",
- -fsize - current_frame.offset);
-#endif
- }
- else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l %I%wd,%Ra1\n", -fsize);
-#else
- asm_fprintf (stream, "\tmovel %I%wd,%Ra1\n", -fsize);
-#endif
- }
+ fsize += current_frame.offset;
+ asm_fprintf (stream, "\t%Omove" ASM_DOT "l %I%wd,%Ra1\n", -fsize);
fsize = 0, big = true;
}
if (current_frame.reg_no <= 2)
@@ -846,41 +768,34 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
{
if (big)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l -%wd(%s,%Ra1.l),%s\n",
- offset,
- reg_names[FRAME_POINTER_REGNUM],
- reg_names[i]);
-#else
- asm_fprintf (stream, "\tmovel %s@(-%wd,%Ra1:l),%s\n",
- reg_names[FRAME_POINTER_REGNUM],
- offset,
- reg_names[i]);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\t%Omove.l -%wd(%s,%Ra1.l),%s\n",
+ offset,
+ reg_names[FRAME_POINTER_REGNUM],
+ reg_names[i]);
+ else
+ asm_fprintf (stream, "\tmovel %s@(-%wd,%Ra1:l),%s\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset,
+ reg_names[i]);
}
else if (restore_from_sp)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l (%Rsp)+,%s\n",
- reg_names[i]);
-#else
- asm_fprintf (stream, "\tmovel %Rsp@+,%s\n",
- reg_names[i]);
-#endif
- }
+ asm_fprintf (stream, MOTOROLA ?
+ "\t%Omove.l (%Rsp)+,%s\n" :
+ "\tmovel %Rsp@+,%s\n",
+ reg_names[i]);
else
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\t%Omove.l -%wd(%s),%s\n",
- offset,
- reg_names[FRAME_POINTER_REGNUM],
- reg_names[i]);
-#else
- asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n",
- reg_names[FRAME_POINTER_REGNUM],
- offset,
- reg_names[i]);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\t%Omove.l -%wd(%s),%s\n",
+ offset,
+ reg_names[FRAME_POINTER_REGNUM],
+ reg_names[i]);
+ else
+ asm_fprintf (stream, "\tmovel %s@(-%wd),%s\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ offset,
+ reg_names[i]);
}
offset -= 4;
}
@@ -892,76 +807,66 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
{
if (big)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]);
- asm_fprintf (stream, "\tmovm.l (%Ra1),%I0x%x\n", current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\taddl %s,%Ra1\n", reg_names[FRAME_POINTER_REGNUM]);
- asm_fprintf (stream, "\tmoveml %Ra1@,%I0x%x\n", current_frame.reg_mask);
-#endif
+ asm_fprintf (stream, "\tadd" ASM_DOT "l %s,%Ra1\n",
+ reg_names[FRAME_POINTER_REGNUM]);
+ asm_fprintf (stream, MOTOROLA ?
+ "\tmovm.l (%Ra1),%I0x%x\n" :
+ "\tmoveml %Ra1@,%I0x%x\n",
+ current_frame.reg_mask);
}
else if (restore_from_sp)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l (%Rsp),%I0x%x\n", current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %Rsp@,%I0x%x\n", current_frame.reg_mask);
-#endif
- }
+ asm_fprintf (stream, MOTOROLA ?
+ "\tmovm.l (%Rsp),%I0x%x\n" :
+ "\tmoveml %Rsp@,%I0x%x\n",
+ current_frame.reg_mask);
else
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
- current_frame.offset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.offset + fsize,
- current_frame.reg_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
+ current_frame.offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.reg_mask);
+ else
+ asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.offset + fsize,
+ current_frame.reg_mask);
}
}
else /* !TARGET_COLDFIRE */
{
if (big)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n",
- current_frame.offset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.offset + fsize,
- current_frame.reg_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tmovm.l -%wd(%s,%Ra1.l),%I0x%x\n",
+ current_frame.offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.reg_mask);
+ else
+ asm_fprintf (stream, "\tmoveml %s@(-%wd,%Ra1:l),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.offset + fsize,
+ current_frame.reg_mask);
}
else if (restore_from_sp)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l (%Rsp)+,%I0x%x\n",
- current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %Rsp@+,%I0x%x\n",
+ asm_fprintf (stream, MOTOROLA ?
+ "\tmovm.l (%Rsp)+,%I0x%x\n" :
+ "\tmoveml %Rsp@+,%I0x%x\n",
current_frame.reg_mask);
-#endif
}
else
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
- current_frame.offset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.reg_mask);
-#else
- asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.offset + fsize,
- current_frame.reg_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tmovm.l -%wd(%s),%I0x%x\n",
+ current_frame.offset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.reg_mask);
+ else
+ asm_fprintf (stream, "\tmoveml %s@(-%wd),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.offset + fsize,
+ current_frame.reg_mask);
}
}
}
@@ -969,41 +874,38 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
{
if (big)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tfmovm -%wd(%s,%Ra1.l),%I0x%x\n",
- current_frame.foffset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.fpu_rev_mask);
-#else
- asm_fprintf (stream, "\tfmovem %s@(-%wd,%Ra1:l),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.foffset + fsize,
- current_frame.fpu_rev_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tfmovm -%wd(%s,%Ra1.l),%I0x%x\n",
+ current_frame.foffset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.fpu_rev_mask);
+ else
+ asm_fprintf (stream, "\tfmovem %s@(-%wd,%Ra1:l),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.foffset + fsize,
+ current_frame.fpu_rev_mask);
}
else if (restore_from_sp)
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tfmovm (%Rsp)+,%I0x%x\n",
- current_frame.fpu_rev_mask);
-#else
- asm_fprintf (stream, "\tfmovem %Rsp@+,%I0x%x\n",
- current_frame.fpu_rev_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tfmovm (%Rsp)+,%I0x%x\n",
+ current_frame.fpu_rev_mask);
+ else
+ asm_fprintf (stream, "\tfmovem %Rsp@+,%I0x%x\n",
+ current_frame.fpu_rev_mask);
}
else
{
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tfmovm -%wd(%s),%I0x%x\n",
- current_frame.foffset + fsize,
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.fpu_rev_mask);
-#else
- asm_fprintf (stream, "\tfmovem %s@(-%wd),%I0x%x\n",
- reg_names[FRAME_POINTER_REGNUM],
- current_frame.foffset + fsize,
- current_frame.fpu_rev_mask);
-#endif
+ if (MOTOROLA)
+ asm_fprintf (stream, "\tfmovm -%wd(%s),%I0x%x\n",
+ current_frame.foffset + fsize,
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.fpu_rev_mask);
+ else
+ asm_fprintf (stream, "\tfmovem %s@(-%wd),%I0x%x\n",
+ reg_names[FRAME_POINTER_REGNUM],
+ current_frame.foffset + fsize,
+ current_frame.fpu_rev_mask);
}
}
if (frame_pointer_needed)
@@ -1014,70 +916,36 @@ m68k_output_function_epilogue (FILE *stream, HOST_WIDE_INT size ATTRIBUTE_UNUSED
if (fsize_with_regs <= 8)
{
if (!TARGET_COLDFIRE)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.w %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddqw %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
- else /* TARGET_COLDFIRE */
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.l %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddql %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\taddq" ASM_DOT "w %I%wd,%Rsp\n",
+ fsize_with_regs);
+ else
+ asm_fprintf (stream, "\taddq" ASM_DOT "l %I%wd,%Rsp\n",
+ fsize_with_regs);
}
else if (fsize_with_regs <= 16 && TARGET_CPU32)
{
/* On the CPU32 it is faster to use two addqw instructions to
add a small integer (8 < N <= 16) to a register. */
-#ifdef MOTOROLA
- asm_fprintf (stream, "\taddq.w %I8,%Rsp\n\taddq.w %I%wd,%Rsp\n",
- fsize_with_regs - 8);
-#else
- asm_fprintf (stream, "\taddqw %I8,%Rsp\n\taddqw %I%wd,%Rsp\n",
+ asm_fprintf (stream, "\taddq" ASM_DOT "w %I8,%Rsp\n"
+ "\taddq" ASM_DOT "w %I%wd,%Rsp\n",
fsize_with_regs - 8);
-#endif
}
else if (fsize_with_regs < 0x8000)
{
if (TARGET_68040)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.w %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddw %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tadd" ASM_DOT "w %I%wd,%Rsp\n",
+ fsize_with_regs);
else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tlea (%wd,%Rsp),%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\tlea %Rsp@(%wd),%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, MOTOROLA ?
+ "\tlea (%wd,%Rsp),%Rsp\n" :
+ "\tlea %Rsp@(%wd),%Rsp\n",
+ fsize_with_regs);
}
else
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %I%wd,%Rsp\n", fsize_with_regs);
-#else
- asm_fprintf (stream, "\taddl %I%wd,%Rsp\n", fsize_with_regs);
-#endif
- }
+ asm_fprintf (stream, "\tadd" ASM_DOT "l %I%wd,%Rsp\n", fsize_with_regs);
}
if (current_function_calls_eh_return)
- {
-#ifdef MOTOROLA
- asm_fprintf (stream, "\tadd.l %Ra0,%Rsp\n");
-#else
- asm_fprintf (stream, "\taddl %Ra0,%Rsp\n");
-#endif
- }
+ asm_fprintf (stream, "\tadd" ASM_DOT"l %Ra0,%Rsp\n");
if (m68k_interrupt_function_p (current_function_decl))
fprintf (stream, "\trte\n");
else if (current_function_pops_args)
@@ -1173,84 +1041,74 @@ output_dbcc_and_branch (rtx *operands)
switch (GET_CODE (operands[3]))
{
case EQ:
-#ifdef MOTOROLA
- output_asm_insn ("dbeq %0,%l1\n\tjbeq %l2", operands);
-#else
- output_asm_insn ("dbeq %0,%l1\n\tjeq %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbeq %0,%l1\n\tjbeq %l2" :
+ "dbeq %0,%l1\n\tjeq %l2",
+ operands);
+ break;
case NE:
-#ifdef MOTOROLA
- output_asm_insn ("dbne %0,%l1\n\tjbne %l2", operands);
-#else
- output_asm_insn ("dbne %0,%l1\n\tjne %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbne %0,%l1\n\tjbne %l2" :
+ "dbne %0,%l1\n\tjne %l2",
+ operands);
+ break;
case GT:
-#ifdef MOTOROLA
- output_asm_insn ("dbgt %0,%l1\n\tjbgt %l2", operands);
-#else
- output_asm_insn ("dbgt %0,%l1\n\tjgt %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbgt %0,%l1\n\tjbgt %l2" :
+ "dbgt %0,%l1\n\tjgt %l2",
+ operands);
+ break;
case GTU:
-#ifdef MOTOROLA
- output_asm_insn ("dbhi %0,%l1\n\tjbhi %l2", operands);
-#else
- output_asm_insn ("dbhi %0,%l1\n\tjhi %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbhi %0,%l1\n\tjbhi %l2" :
+ "dbhi %0,%l1\n\tjhi %l2",
+ operands);
+ break;
case LT:
-#ifdef MOTOROLA
- output_asm_insn ("dblt %0,%l1\n\tjblt %l2", operands);
-#else
- output_asm_insn ("dblt %0,%l1\n\tjlt %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dblt %0,%l1\n\tjblt %l2" :
+ "dblt %0,%l1\n\tjlt %l2",
+ operands);
+ break;
case LTU:
-#ifdef MOTOROLA
- output_asm_insn ("dbcs %0,%l1\n\tjbcs %l2", operands);
-#else
- output_asm_insn ("dbcs %0,%l1\n\tjcs %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbcs %0,%l1\n\tjbcs %l2" :
+ "dbcs %0,%l1\n\tjcs %l2",
+ operands);
+ break;
case GE:
-#ifdef MOTOROLA
- output_asm_insn ("dbge %0,%l1\n\tjbge %l2", operands);
-#else
- output_asm_insn ("dbge %0,%l1\n\tjge %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbge %0,%l1\n\tjbge %l2" :
+ "dbge %0,%l1\n\tjge %l2",
+ operands);
+ break;
case GEU:
-#ifdef MOTOROLA
- output_asm_insn ("dbcc %0,%l1\n\tjbcc %l2", operands);
-#else
- output_asm_insn ("dbcc %0,%l1\n\tjcc %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbcc %0,%l1\n\tjbcc %l2" :
+ "dbcc %0,%l1\n\tjcc %l2",
+ operands);
+ break;
case LE:
-#ifdef MOTOROLA
- output_asm_insn ("dble %0,%l1\n\tjble %l2", operands);
-#else
- output_asm_insn ("dble %0,%l1\n\tjle %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dble %0,%l1\n\tjble %l2" :
+ "dble %0,%l1\n\tjle %l2",
+ operands);
+ break;
case LEU:
-#ifdef MOTOROLA
- output_asm_insn ("dbls %0,%l1\n\tjbls %l2", operands);
-#else
- output_asm_insn ("dbls %0,%l1\n\tjls %l2", operands);
-#endif
- break;
+ output_asm_insn (MOTOROLA ?
+ "dbls %0,%l1\n\tjbls %l2" :
+ "dbls %0,%l1\n\tjls %l2",
+ operands);
+ break;
default:
abort ();
@@ -1261,11 +1119,10 @@ output_dbcc_and_branch (rtx *operands)
switch (GET_MODE (operands[0]))
{
case SImode:
-#ifdef MOTOROLA
- output_asm_insn ("clr%.w %0\n\tsubq%.l %#1,%0\n\tjbpl %l1", operands);
-#else
- output_asm_insn ("clr%.w %0\n\tsubq%.l %#1,%0\n\tjpl %l1", operands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ "clr%.w %0\n\tsubq%.l %#1,%0\n\tjbpl %l1" :
+ "clr%.w %0\n\tsubq%.l %#1,%0\n\tjpl %l1",
+ operands);
break;
case HImode:
@@ -1312,18 +1169,17 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
loperands[4] = gen_label_rtx();
if (operand2 != const0_rtx)
{
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef SGS_CMP_ORDER
- output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands);
+ output_asm_insn ("cmp%.l %0,%2\n\tjbne %l4\n\tcmp%.l %1,%3", loperands);
#else
- output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands);
+ output_asm_insn ("cmp%.l %2,%0\n\tjbne %l4\n\tcmp%.l %3,%1", loperands);
#endif
-#else
+ else
#ifdef SGS_CMP_ORDER
- output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands);
+ output_asm_insn ("cmp%.l %0,%2\n\tjne %l4\n\tcmp%.l %1,%3", loperands);
#else
- output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands);
-#endif
+ output_asm_insn ("cmp%.l %2,%0\n\tjne %l4\n\tcmp%.l %3,%1", loperands);
#endif
}
else
@@ -1339,11 +1195,7 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
#endif
}
-#ifdef MOTOROLA
- output_asm_insn ("jbne %l4", loperands);
-#else
- output_asm_insn ("jne %l4", loperands);
-#endif
+ output_asm_insn (MOTOROLA ? "jbne %l4" : "jne %l4", loperands);
if (TARGET_68020 || TARGET_COLDFIRE || ! ADDRESS_REG_P (loperands[1]))
output_asm_insn ("tst%.l %1", loperands);
@@ -1375,11 +1227,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
case GT:
loperands[6] = gen_label_rtx();
-#ifdef MOTOROLA
- output_asm_insn ("shi %5\n\tjbra %l6", loperands);
-#else
- output_asm_insn ("shi %5\n\tjra %l6", loperands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ "shi %5\n\tjbra %l6" :
+ "shi %5\n\tjra %l6",
+ loperands);
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sgt %5", loperands);
@@ -1395,11 +1246,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
case LT:
loperands[6] = gen_label_rtx();
-#ifdef MOTOROLA
- output_asm_insn ("scs %5\n\tjbra %l6", loperands);
-#else
- output_asm_insn ("scs %5\n\tjra %l6", loperands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ "scs %5\n\tjbra %l6" :
+ "scs %5\n\tjra %l6",
+ loperands);
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("slt %5", loperands);
@@ -1415,11 +1265,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
case GE:
loperands[6] = gen_label_rtx();
-#ifdef MOTOROLA
- output_asm_insn ("scc %5\n\tjbra %l6", loperands);
-#else
- output_asm_insn ("scc %5\n\tjra %l6", loperands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ "scc %5\n\tjbra %l6" :
+ "scc %5\n\tjra %l6",
+ loperands);
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sge %5", loperands);
@@ -1435,11 +1284,10 @@ output_scc_di(rtx op, rtx operand1, rtx operand2, rtx dest)
case LE:
loperands[6] = gen_label_rtx();
-#ifdef MOTOROLA
- output_asm_insn ("sls %5\n\tjbra %l6", loperands);
-#else
- output_asm_insn ("sls %5\n\tjra %l6", loperands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ "sls %5\n\tjbra %l6" :
+ "sls %5\n\tjra %l6",
+ loperands);
(*targetm.asm_out.internal_label) (asm_out_file, "L",
CODE_LABEL_NUMBER (loperands[4]));
output_asm_insn ("sle %5", loperands);
@@ -1937,7 +1785,7 @@ output_move_himode (rtx *operands)
&& GET_CODE (XEXP (XEXP (operands[1], 0), 0)) != PLUS)
{
rtx labelref = XEXP (XEXP (operands[1], 0), 1);
-#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES)
+#if MOTOROLA && !defined (SGS_SWITCH_TABLES)
#ifdef SGS
asm_fprintf (asm_out_file, "\tset %LLI%d,.+2\n",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
@@ -2461,17 +2309,22 @@ output_addsi3 (rtx *operands)
return "lea 0(%1,%2.l),%0";
else
return "lea %c2(%1),%0";
-#elif defined(MOTOROLA)
- if (GET_CODE (operands[2]) == REG)
- return "lea (%1,%2.l),%0";
- else
- return "lea (%c2,%1),%0";
-#else /* not MOTOROLA (MIT syntax) */
- if (GET_CODE (operands[2]) == REG)
- return "lea %1@(0,%2:l),%0";
- else
- return "lea %1@(%c2),%0";
-#endif /* not MOTOROLA */
+#else /* !SGS */
+ if (MOTOROLA)
+ {
+ if (GET_CODE (operands[2]) == REG)
+ return "lea (%1,%2.l),%0";
+ else
+ return "lea (%c2,%1),%0";
+ }
+ else /* !MOTOROLA (MIT syntax) */
+ {
+ if (GET_CODE (operands[2]) == REG)
+ return "lea %1@(0,%2:l),%0";
+ else
+ return "lea %1@(%c2),%0";
+ }
+#endif /* !SGS */
}
if (GET_CODE (operands[2]) == CONST_INT)
{
@@ -2509,11 +2362,7 @@ output_addsi3 (rtx *operands)
if (TARGET_68040)
return "add%.w %2,%0";
else
-#ifdef MOTOROLA
- return "lea (%c2,%0),%0";
-#else
- return "lea %0@(%c2),%0";
-#endif
+ return MOTOROLA ? "lea (%c2,%0),%0" : "lea %0@(%c2),%0";
}
}
return "add%.l %2,%0";
@@ -2595,12 +2444,17 @@ notice_update_cc (rtx exp, rtx insn)
if (cc_status.value2 != 0)
switch (GET_CODE (cc_status.value2))
{
- case PLUS: case MINUS: case MULT:
- case DIV: case UDIV: case MOD: case UMOD: case NEG:
-#if 0 /* These instructions always clear the overflow bit */
case ASHIFT: case ASHIFTRT: case LSHIFTRT:
case ROTATE: case ROTATERT:
-#endif
+ /* These instructions always clear the overflow bit, and set
+ the carry to the bit shifted out. */
+ /* ??? We don't currently have a way to signal carry not valid,
+ nor do we check for it in the branch insns. */
+ CC_STATUS_INIT;
+ break;
+
+ case PLUS: case MINUS: case MULT:
+ case DIV: case UDIV: case MOD: case UMOD: case NEG:
if (GET_MODE (cc_status.value2) != VOIDmode)
cc_status.flags |= CC_NO_OVERFLOW;
break;
@@ -2813,60 +2667,31 @@ print_operand (FILE *file, rtx op, int letter)
{
if (letter == '.')
{
-#if defined (MOTOROLA)
- fprintf (file, ".");
-#endif
+ if (MOTOROLA)
+ fprintf (file, ".");
}
else if (letter == '#')
- {
- asm_fprintf (file, "%I");
- }
+ asm_fprintf (file, "%I");
else if (letter == '-')
- {
-#ifdef MOTOROLA
- asm_fprintf (file, "-(%Rsp)");
-#else
- asm_fprintf (file, "%Rsp@-");
-#endif
- }
+ asm_fprintf (file, MOTOROLA ? "-(%Rsp)" : "%Rsp@-");
else if (letter == '+')
- {
-#ifdef MOTOROLA
- asm_fprintf (file, "(%Rsp)+");
-#else
- asm_fprintf (file, "%Rsp@+");
-#endif
- }
+ asm_fprintf (file, MOTOROLA ? "(%Rsp)+" : "%Rsp@+");
else if (letter == '@')
- {
-#ifdef MOTOROLA
- asm_fprintf (file, "(%Rsp)");
-#else
- asm_fprintf (file, "%Rsp@");
-#endif
- }
+ asm_fprintf (file, MOTOROLA ? "(%Rsp)" : "%Rsp@");
else if (letter == '!')
- {
- asm_fprintf (file, "%Rfpcr");
- }
+ asm_fprintf (file, "%Rfpcr");
else if (letter == '$')
{
if (TARGET_68040_ONLY)
- {
- fprintf (file, "s");
- }
+ fprintf (file, "s");
}
else if (letter == '&')
{
if (TARGET_68040_ONLY)
- {
- fprintf (file, "d");
- }
+ fprintf (file, "d");
}
else if (letter == '/')
- {
- asm_fprintf (file, "%R");
- }
+ asm_fprintf (file, "%R");
else if (letter == 'o')
{
/* This is only for direct addresses with TARGET_PCREL */
@@ -2892,13 +2717,7 @@ print_operand (FILE *file, rtx op, int letter)
&& !(GET_CODE (XEXP (op, 0)) == CONST_INT
&& INTVAL (XEXP (op, 0)) < 0x8000
&& INTVAL (XEXP (op, 0)) >= -0x8000))
- {
-#ifdef MOTOROLA
- fprintf (file, ".l");
-#else
- fprintf (file, ":l");
-#endif
- }
+ fprintf (file, MOTOROLA ? ".l" : ":l");
}
else if (GET_CODE (op) == CONST_DOUBLE && GET_MODE (op) == SFmode)
{
@@ -2963,18 +2782,18 @@ print_operand (FILE *file, rtx op, int letter)
-fPIC code the offset is output in long mode (eg movel a5@(_foo:l), a0) */
#ifndef ASM_OUTPUT_CASE_FETCH
-#ifdef MOTOROLA
-#ifdef SGS
-#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
+# if MOTOROLA
+# ifdef SGS
+# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
asm_fprintf (file, "%LLD%d(%Rpc,%s.", labelno, regname)
-#else
-#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
+# else /* !SGS */
+# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
asm_fprintf (file, "%LL%d-%LLI%d.b(%Rpc,%s.", labelno, labelno, regname)
-#endif
-#else
-#define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
+# endif /* !SGS */
+# else /* !MOTOROLA */
+# define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\
asm_fprintf (file, "%Rpc@(%LL%d-%LLI%d-2:b,%s:", labelno, labelno, regname)
-#endif
+# endif /* !MOTOROLA */
#endif /* ASM_OUTPUT_CASE_FETCH */
void
@@ -2986,25 +2805,15 @@ print_operand_address (FILE *file, rtx addr)
switch (GET_CODE (addr))
{
case REG:
-#ifdef MOTOROLA
- fprintf (file, "(%s)", reg_names[REGNO (addr)]);
-#else
- fprintf (file, "%s@", reg_names[REGNO (addr)]);
-#endif
+ fprintf (file, MOTOROLA ? "(%s)" : "%s@", reg_names[REGNO (addr)]);
break;
case PRE_DEC:
-#ifdef MOTOROLA
- fprintf (file, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]);
-#else
- fprintf (file, "%s@-", reg_names[REGNO (XEXP (addr, 0))]);
-#endif
+ fprintf (file, MOTOROLA ? "-(%s)" : "%s@-",
+ reg_names[REGNO (XEXP (addr, 0))]);
break;
case POST_INC:
-#ifdef MOTOROLA
- fprintf (file, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]);
-#else
- fprintf (file, "%s@+", reg_names[REGNO (XEXP (addr, 0))]);
-#endif
+ fprintf (file, MOTOROLA ? "(%s)+" : "%s@+",
+ reg_names[REGNO (XEXP (addr, 0))]);
break;
case PLUS:
reg1 = reg2 = ireg = breg = offset = 0;
@@ -3124,13 +2933,7 @@ print_operand_address (FILE *file, rtx addr)
fprintf (file, "l");
}
if (scale != 1)
- {
-#ifdef MOTOROLA
- fprintf (file, "*%d", scale);
-#else
- fprintf (file, ":%d", scale);
-#endif
- }
+ fprintf (file, MOTOROLA ? "*%d" : ":%d", scale);
putc (')', file);
break;
}
@@ -3154,66 +2957,55 @@ print_operand_address (FILE *file, rtx addr)
{
abort ();
}
-#ifdef MOTOROLA
- if (addr != 0)
+ if (MOTOROLA)
{
- output_addr_const (file, addr);
- if (flag_pic && (breg == pic_offset_table_rtx))
+ if (addr != 0)
{
- fprintf (file, "@GOT");
- if (flag_pic == 1)
- fprintf (file, ".w");
+ output_addr_const (file, addr);
+ if (flag_pic && (breg == pic_offset_table_rtx))
+ {
+ fprintf (file, "@GOT");
+ if (flag_pic == 1)
+ fprintf (file, ".w");
+ }
}
+ fprintf (file, "(%s", reg_names[REGNO (breg)]);
+ if (ireg != 0)
+ putc (',', file);
}
- fprintf (file, "(%s", reg_names[REGNO (breg)]);
- if (ireg != 0)
- {
- putc (',', file);
- }
-#else
- fprintf (file, "%s@(", reg_names[REGNO (breg)]);
- if (addr != 0)
- {
- output_addr_const (file, addr);
- if ((flag_pic == 1) && (breg == pic_offset_table_rtx))
- fprintf (file, ":w");
- if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
- fprintf (file, ":l");
- }
- if (addr != 0 && ireg != 0)
+ else /* !MOTOROLA */
{
- putc (',', file);
- }
-#endif
+ fprintf (file, "%s@(", reg_names[REGNO (breg)]);
+ if (addr != 0)
+ {
+ output_addr_const (file, addr);
+ if (breg == pic_offset_table_rtx)
+ switch (flag_pic)
+ {
+ case 1:
+ fprintf (file, ":w"); break;
+ case 2:
+ fprintf (file, ":l"); break;
+ default:
+ break;
+ }
+ if (ireg != 0)
+ putc (',', file);
+ }
+ } /* !MOTOROLA */
if (ireg != 0 && GET_CODE (ireg) == MULT)
{
scale = INTVAL (XEXP (ireg, 1));
ireg = XEXP (ireg, 0);
}
if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND)
- {
-#ifdef MOTOROLA
- fprintf (file, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]);
-#else
- fprintf (file, "%s:w", reg_names[REGNO (XEXP (ireg, 0))]);
-#endif
- }
+ fprintf (file, MOTOROLA ? "%s.w" : "%s:w",
+ reg_names[REGNO (XEXP (ireg, 0))]);
else if (ireg != 0)
- {
-#ifdef MOTOROLA
- fprintf (file, "%s.l", reg_names[REGNO (ireg)]);
-#else
- fprintf (file, "%s:l", reg_names[REGNO (ireg)]);
-#endif
- }
+ fprintf (file, MOTOROLA ? "%s.l" : "%s:l",
+ reg_names[REGNO (ireg)]);
if (scale != 1)
- {
-#ifdef MOTOROLA
- fprintf (file, "*%d", scale);
-#else
- fprintf (file, ":%d", scale);
-#endif
- }
+ fprintf (file, MOTOROLA ? "*%d" : ":%d", scale);
putc (')', file);
break;
}
@@ -3232,16 +3024,15 @@ print_operand_address (FILE *file, rtx addr)
&& INTVAL (addr) < 0x8000
&& INTVAL (addr) >= -0x8000)
{
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef SGS
- /* Many SGS assemblers croak on size specifiers for constants. */
- fprintf (file, "%d", (int) INTVAL (addr));
-#else
- fprintf (file, "%d.w", (int) INTVAL (addr));
-#endif
+ /* Many SGS assemblers croak on size specifiers for constants. */
+ fprintf (file, "%d", (int) INTVAL (addr));
#else
- fprintf (file, "%d:w", (int) INTVAL (addr));
+ fprintf (file, "%d.w", (int) INTVAL (addr));
#endif
+ else /* !MOTOROLA */
+ fprintf (file, "%d:w", (int) INTVAL (addr));
}
else if (GET_CODE (addr) == CONST_INT)
{
@@ -3327,7 +3118,6 @@ strict_low_part_peephole_ok (enum machine_mode mode, rtx first_insn,
}
p = prev_nonnote_insn (p);
-
}
return false;
@@ -3648,23 +3438,20 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
const char *fmt;
if (delta > 0 && delta <= 8)
-#ifdef MOTOROLA
- asm_fprintf (file, "\taddq.l %I%d,4(%Rsp)\n", (int) delta);
-#else
- asm_fprintf (file, "\taddql %I%d,%Rsp@(4)\n", (int) delta);
-#endif
+ asm_fprintf (file, MOTOROLA ?
+ "\taddq.l %I%d,4(%Rsp)\n" :
+ "\taddql %I%d,%Rsp@(4)\n",
+ (int) delta);
else if (delta < 0 && delta >= -8)
-#ifdef MOTOROLA
- asm_fprintf (file, "\tsubq.l %I%d,4(%Rsp)\n", (int) -delta);
-#else
- asm_fprintf (file, "\tsubql %I%d,%Rsp@(4)\n", (int) -delta);
-#endif
+ asm_fprintf (file, MOTOROLA ?
+ "\tsubq.l %I%d,4(%Rsp)\n" :
+ "\tsubql %I%d,%Rsp@(4)\n",
+ (int) -delta);
else
-#ifdef MOTOROLA
- asm_fprintf (file, "\tadd.l %I%wd,4(%Rsp)\n", delta);
-#else
- asm_fprintf (file, "\taddl %I%wd,%Rsp@(4)\n", delta);
-#endif
+ asm_fprintf (file, MOTOROLA ?
+ "\tadd.l %I%wd,4(%Rsp)\n" :
+ "\taddl %I%wd,%Rsp@(4)\n",
+ delta);
xops[0] = DECL_RTL (function);
@@ -3675,22 +3462,19 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
fmt = "bra.l %o0";
else if ((flag_pic == 1) || TARGET_68020)
{
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef HPUX_ASM
- fmt = "bra.l %0";
-#else
-#ifdef USE_GAS
- fmt = "bra.l %0@PLTPC";
+ fmt = "bra.l %0";
+#elif defined(USE_GAS)
+ fmt = "bra.l %0@PLTPC";
#else
- fmt = "bra %0@PLTPC";
-#endif
+ fmt = "bra %0@PLTPC";
#endif
-#else
+ else /* !MOTOROLA */
#ifdef USE_GAS
- fmt = "bra.l %0";
+ fmt = "bra.l %0";
#else
- fmt = "jra %0,a1";
-#endif
+ fmt = "jra %0,a1";
#endif
}
else if (optimize_size || TARGET_ID_SHARED_LIBRARY)
@@ -3700,7 +3484,7 @@ m68k_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
}
else
{
-#if defined (MOTOROLA) && !defined (USE_GAS)
+#if MOTOROLA && !defined (USE_GAS)
fmt = "jmp %0";
#else
fmt = "jra %0";
diff --git a/gcc/config/m68k/m68k.h b/gcc/config/m68k/m68k.h
index d1f4243a2d2..423895de32c 100644
--- a/gcc/config/m68k/m68k.h
+++ b/gcc/config/m68k/m68k.h
@@ -20,6 +20,18 @@ 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. */
+/* We need to have MOTOROLA always defined (either 0 or 1) because we use
+ if-statements and ?: on it. This way we have compile-time error checking
+ for both the MOTOROLA and MIT code paths. We do rely on the host compiler
+ to optimize away all constant tests. */
+#ifdef MOTOROLA
+# undef MOTOROLA
+# define MOTOROLA 1 /* Use the Motorola assembly syntax. */
+# define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)")
+#else
+# define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)")
+# define MOTOROLA 0 /* Use the MIT assembly syntax. */
+#endif
/* Note that some other tm.h files include this one and then override
many of the definitions that relate to assembler syntax. */
@@ -103,13 +115,6 @@ Boston, MA 02111-1307, USA. */
/* Set the default */
#define INT_OP_GROUP INT_OP_DOT_WORD
-/* Print subsidiary information on the compiler version in use. */
-#ifdef MOTOROLA
-#define TARGET_VERSION fprintf (stderr, " (68k, Motorola syntax)");
-#else
-#define TARGET_VERSION fprintf (stderr, " (68k, MIT syntax)");
-#endif
-
/* Run-time compilation parameters selecting different hardware subsets. */
extern int target_flags;
@@ -208,7 +213,7 @@ extern int target_flags;
#define MASK_RTD (1<<16)
#define TARGET_RTD (target_flags & MASK_RTD)
-/* Support A5 relative data seperate from text.
+/* Support A5 relative data separate from text.
* This option implies -fPIC, however it inhibits the generation of the
* A5 save/restore in functions and the loading of a5 with a got pointer.
*/
@@ -1399,11 +1404,11 @@ __transfer_from_trampoline () \
#define NOTICE_UPDATE_CC(EXP,INSN) notice_update_cc (EXP, INSN)
#define OUTPUT_JUMP(NORMAL, FLOAT, NO_OV) \
-{ if (cc_prev_status.flags & CC_IN_68881) \
+do { if (cc_prev_status.flags & CC_IN_68881) \
return FLOAT; \
if (cc_prev_status.flags & CC_NO_OVERFLOW) \
return NO_OV; \
- return NORMAL; }
+ return NORMAL; } while (0)
/* Control the assembler format that we output. */
diff --git a/gcc/config/m68k/m68k.md b/gcc/config/m68k/m68k.md
index 5883f4ba35a..11f219c8266 100644
--- a/gcc/config/m68k/m68k.md
+++ b/gcc/config/m68k/m68k.md
@@ -698,18 +698,14 @@
if (!TARGET_68040 && !TARGET_68060)
return \"sub%.l %0,%0\";
else
- {
-#ifdef MOTOROLA
+ return MOTOROLA ?
#ifdef SGS
/* Many SGS assemblers croak on size specifiers for constants. */
- return \"lea 0,%0\";
-#else
- return \"lea 0.w,%0\";
-#endif
+ \"lea 0,%0\" :
#else
- return \"lea 0:w,%0\";
+ \"lea 0.w,%0\" :
#endif
- }
+ \"lea 0:w,%0\";
}
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && (!TARGET_68020 && !TARGET_COLDFIRE))
@@ -907,18 +903,14 @@
if (!TARGET_68040 && !TARGET_68060)
return \"sub%.l %0,%0\";
else
- {
-#ifdef MOTOROLA
+ return MOTOROLA ?
#ifdef SGS
/* Many SGS assemblers croak on size specifiers for constants. */
- return \"lea 0,%0\";
-#else
- return \"lea 0.w,%0\";
-#endif
+ \"lea 0,%0\" :
#else
- return \"lea 0:w,%0\";
+ \"lea 0.w,%0\" :
#endif
- }
+ \"lea 0:w,%0\";
}
/* moveq is faster on the 68000. */
if (DATA_REG_P (operands[0]) && !(TARGET_68020 || TARGET_COLDFIRE))
@@ -1448,29 +1440,26 @@
&& GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
-#ifdef MOTOROLA
+ return MOTOROLA ?
#ifdef SGS
- return \"clr%.l -(%0)\;move%.b %1,3(%0)\";
-#else
- return \"clr%.l -(%0)\;move%.b %1,(3,%0)\";
-#endif
+ \"clr%.l -(%0)\;move%.b %1,3(%0)\" :
#else
- return \"clrl %0@-\;moveb %1,%0@(3)\";
+ \"clr%.l -(%0)\;move%.b %1,(3,%0)\" :
#endif
+ \"clrl %0@-\;moveb %1,%0@(3)\";
+
}
else if (GET_CODE (operands[0]) == MEM
&& GET_CODE (XEXP (operands[0], 0)) == POST_INC)
{
operands[0] = XEXP (XEXP (operands[0], 0), 0);
-#ifdef MOTOROLA
+ return MOTOROLA ?
#ifdef SGS
- return \"clr%.l (%0)+\;move%.b %1,-1(%0)\";
+ \"clr%.l (%0)+\;move%.b %1,-1(%0)\" :
#else
- return \"clr%.l (%0)+\;move%.b %1,(-1,%0)\";
-#endif
-#else
- return \"clrl %0@+\;moveb %1,%0@(-1)\";
+ \"clr%.l (%0)+\;move%.b %1,(-1,%0)\" :
#endif
+ \"clrl %0@+\;moveb %1,%0@(-1)\";
}
else
{
@@ -2003,11 +1992,7 @@
operands[2] = gen_rtx_MEM (SImode, XEXP (XEXP (operands[0], 0), 0));
}
output_asm_insn (\"move%.l %1,%0\", operands);
-#ifdef MOTOROLA
- output_asm_insn (\"jbpl %l3\", operands);
-#else
- output_asm_insn (\"jpl %l3\", operands);
-#endif
+ output_asm_insn (MOTOROLA ? \"jbpl %l3\" : \"jpl %l3\", operands);
output_asm_insn (\"addq%.l %#1,%2\", operands);
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[3]));
@@ -2094,11 +2079,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
-#ifdef MOTOROLA
- return \"lea (%c2,%0),%0\";
-#else
- return \"lea %0@(%c2),%0\";
-#endif
+ return MOTOROLA ? \"lea (%c2,%0),%0\" : \"lea %0@(%c2),%0\";
}
return \"add%.w %2,%0\";
}")
@@ -2154,11 +2135,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
-#ifdef MOTOROLA
- return \"lea (%c1,%0),%0\";
-#else
- return \"lea %0@(%c1),%0\";
-#endif
+ return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\";
}
return \"add%.w %1,%0\";
}")
@@ -2208,11 +2185,7 @@
}
}
if (ADDRESS_REG_P (operands[0]) && !TARGET_68040)
-#ifdef MOTOROLA
- return \"lea (%c1,%0),%0\";
-#else
- return \"lea %0@(%c1),%0\";
-#endif
+ return MOTOROLA ? \"lea (%c1,%0),%0\" : \"lea %0@(%c1),%0\";
}
return \"add%.w %1,%0\";
}")
@@ -2621,11 +2594,7 @@
""
"*
{
-#if defined(MOTOROLA)
- return \"muls%.w %2,%0\";
-#else
- return \"muls %2,%0\";
-#endif
+ return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_insn "mulhisi3"
@@ -2637,11 +2606,7 @@
""
"*
{
-#if defined(MOTOROLA)
- return \"muls%.w %2,%0\";
-#else
- return \"muls %2,%0\";
-#endif
+ return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_insn ""
@@ -2652,11 +2617,7 @@
"INTVAL (operands[2]) >= -0x8000 && INTVAL (operands[2]) <= 0x7fff"
"*
{
-#if defined(MOTOROLA)
- return \"muls%.w %2,%0\";
-#else
- return \"muls %2,%0\";
-#endif
+ return MOTOROLA ? \"muls%.w %2,%0\" : \"muls %2,%0\";
}")
(define_expand "mulsi3"
@@ -2690,11 +2651,7 @@
""
"*
{
-#if defined(MOTOROLA)
- return \"mulu%.w %2,%0\";
-#else
- return \"mulu %2,%0\";
-#endif
+ return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\";
}")
(define_insn ""
@@ -2705,11 +2662,7 @@
"INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 0xffff"
"*
{
-#if defined(MOTOROLA)
- return \"mulu%.w %2,%0\";
-#else
- return \"mulu %2,%0\";
-#endif
+ return MOTOROLA ? \"mulu%.w %2,%0\" : \"mulu %2,%0\";
}")
;; We need a separate DEFINE_EXPAND for u?mulsidi3 to be able to use the
@@ -3182,11 +3135,10 @@
"!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
-#ifdef MOTOROLA
- output_asm_insn (\"ext%.l %0\;divs%.w %2,%0\", operands);
-#else
- output_asm_insn (\"extl %0\;divs %2,%0\", operands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ \"ext%.l %0\;divs%.w %2,%0\" :
+ \"extl %0\;divs %2,%0\",
+ operands);
if (!find_reg_note(insn, REG_UNUSED, operands[3]))
{
CC_STATUS_INIT;
@@ -3205,11 +3157,10 @@
"!TARGET_COLDFIRE || TARGET_CF_HWDIV"
"*
{
-#ifdef MOTOROLA
- output_asm_insn (\"and%.l %#0xFFFF,%0\;divu%.w %2,%0\", operands);
-#else
- output_asm_insn (\"and%.l %#0xFFFF,%0\;divu %2,%0\", operands);
-#endif
+ output_asm_insn (MOTOROLA ?
+ \"and%.l %#0xFFFF,%0\;divu%.w %2,%0\" :
+ \"and%.l %#0xFFFF,%0\;divu %2,%0\",
+ operands);
if (!find_reg_note(insn, REG_UNUSED, operands[3]))
{
CC_STATUS_INIT;
@@ -5663,22 +5614,19 @@
{
CC_STATUS_INIT;
if (which_alternative == 1)
-#ifdef MOTOROLA
- return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\";
-#else
- return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\";
-#endif
+ {
+ if (MOTOROLA)
+ return \"move%.l %0,%2\;or%.l %0,%2\;jbeq %l1\";
+ else
+ return \"move%.l %0,%2\;or%.l %0,%2\;jeq %l1\";
+ }
if ((cc_prev_status.value1
&& rtx_equal_p (cc_prev_status.value1, operands[0]))
|| (cc_prev_status.value2
&& rtx_equal_p (cc_prev_status.value2, operands[0])))
{
cc_status = cc_prev_status;
-#ifdef MOTOROLA
- return \"jbeq %l1\";
-#else
- return \"jeq %l1\";
-#endif
+ return MOTOROLA ? \"jbeq %l1\" : \"jeq %l1\";
}
if (GET_CODE (operands[0]) == REG)
operands[3] = gen_rtx_REG (SImode, REGNO (operands[0]) + 1);
@@ -5690,47 +5638,42 @@
{
if (reg_overlap_mentioned_p (operands[2], operands[3]))
{
-#ifdef MOTOROLA
- return \"or%.l %0,%2\;jbeq %l1\";
-#else
- return \"or%.l %0,%2\;jeq %l1\";
-#endif
+ if (MOTOROLA)
+ return \"or%.l %0,%2\;jbeq %l1\";
+ else
+ return \"or%.l %0,%2\;jeq %l1\";
}
else
{
-#ifdef MOTOROLA
- return \"or%.l %3,%2\;jbeq %l1\";
-#else
- return \"or%.l %3,%2\;jeq %l1\";
-#endif
+ if (MOTOROLA)
+ return \"or%.l %3,%2\;jbeq %l1\";
+ else
+ return \"or%.l %3,%2\;jeq %l1\";
}
}
-#ifdef MOTOROLA
- return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
-#else
- return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\";
-#endif
+ if (MOTOROLA)
+ return \"move%.l %0,%2\;or%.l %3,%2\;jbeq %l1\";
+ else
+ return \"move%.l %0,%2\;or%.l %3,%2\;jeq %l1\";
}
operands[4] = gen_label_rtx();
if (TARGET_68020 || TARGET_COLDFIRE)
{
-#ifdef MOTOROLA
- output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands);
-#else
- output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands);
-#endif
+ if (MOTOROLA)
+ output_asm_insn (\"tst%.l %0\;jbne %l4\;tst%.l %3\;jbeq %l1\", operands);
+ else
+ output_asm_insn (\"tst%.l %0\;jne %l4\;tst%.l %3\;jeq %l1\", operands);
}
else
{
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef SGS_CMP_ORDER
- output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands);
-#else
- output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands);
-#endif
+ output_asm_insn (\"cmp%.w %0,%#0\;jbne %l4\;cmp%.w %3,%#0\;jbeq %l1\", operands);
#else
- output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands);
+ output_asm_insn (\"cmp%.w %#0,%0\;jbne %l4\;cmp%.w %#0,%3\;jbeq %l1\", operands);
#endif
+ else
+ output_asm_insn (\"cmp%.w %#0,%0\;jne %l4\;cmp%.w %#0,%3\;jeq %l1\", operands);
}
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
CODE_LABEL_NUMBER (operands[4]));
@@ -5753,11 +5696,7 @@
&& rtx_equal_p (cc_prev_status.value2, operands[0])))
{
cc_status = cc_prev_status;
-#ifdef MOTOROLA
- return \"jbne %l1\";
-#else
- return \"jne %l1\";
-#endif
+ return MOTOROLA ? \"jbne %l1\" : \"jne %l1\";
}
CC_STATUS_INIT;
if (GET_CODE (operands[0]) == REG)
@@ -5770,46 +5709,41 @@
{
if (reg_overlap_mentioned_p (operands[2], operands[3]))
{
-#ifdef MOTOROLA
- return \"or%.l %0,%2\;jbne %l1\";
-#else
- return \"or%.l %0,%2\;jne %l1\";
-#endif
+ if (MOTOROLA)
+ return \"or%.l %0,%2\;jbne %l1\";
+ else
+ return \"or%.l %0,%2\;jne %l1\";
}
else
{
-#ifdef MOTOROLA
- return \"or%.l %3,%2\;jbne %l1\";
-#else
- return \"or%.l %3,%2\;jne %l1\";
-#endif
+ if (MOTOROLA)
+ return \"or%.l %3,%2\;jbne %l1\";
+ else
+ return \"or%.l %3,%2\;jne %l1\";
}
}
-#ifdef MOTOROLA
- return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
-#else
- return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\";
-#endif
+ if (MOTOROLA)
+ return \"move%.l %0,%2\;or%.l %3,%2\;jbne %l1\";
+ else
+ return \"move%.l %0,%2\;or%.l %3,%2\;jne %l1\";
}
if (TARGET_68020 || TARGET_COLDFIRE)
{
-#ifdef MOTOROLA
- return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\";
-#else
- return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\";
-#endif
+ if (MOTOROLA)
+ return \"tst%.l %0\;jbne %l1\;tst%.l %3\;jbne %l1\";
+ else
+ return \"tst%.l %0\;jne %l1\;tst%.l %3\;jne %l1\";
}
else
{
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef SGS_CMP_ORDER
- return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\";
+ return \"cmp%.w %0,%#0\;jbne %l1\;cmp%.w %3,%#0\;jbne %l1\";
#else
- return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\";
-#endif
-#else
- return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\";
+ return \"cmp%.w %#0,%0\;jbne %l1\;cmp%.w %#0,%3\;jbne %l1\";
#endif
+ else
+ return \"cmp%.w %#0,%0\;jne %l1\;cmp%.w %#0,%3\;jne %l1\";
}
} ")
@@ -5830,19 +5764,11 @@
cc_status = cc_prev_status;
if (cc_status.flags & CC_REVERSED)
{
-#ifdef MOTOROLA
- return \"jble %l1\";
-#else
- return \"jle %l1\";
-#endif
+ return MOTOROLA ? \"jble %l1\" : \"jle %l1\";
}
else
{
-#ifdef MOTOROLA
- return \"jbpl %l1\";
-#else
- return \"jpl %l1\";
-#endif
+ return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\";
}
}
CC_STATUS_INIT;
@@ -5858,11 +5784,7 @@
#endif
}
-#ifdef MOTOROLA
- return \"jbpl %l1\";
-#else
- return \"jpl %l1\";
-#endif
+ return MOTOROLA ? \"jbpl %l1\" : \"jpl %l1\";
} ")
(define_insn "blt0_di"
@@ -5882,19 +5804,11 @@
cc_status = cc_prev_status;
if (cc_status.flags & CC_REVERSED)
{
-#ifdef MOTOROLA
- return \"jbgt %l1\";
-#else
- return \"jgt %l1\";
-#endif
+ return MOTOROLA ? \"jbgt %l1\" : \"jgt %l1\";
}
else
{
-#ifdef MOTOROLA
- return \"jbmi %l1\";
-#else
- return \"jmi %l1\";
-#endif
+ return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\";
}
}
CC_STATUS_INIT;
@@ -5910,11 +5824,7 @@
#endif
}
-#ifdef MOTOROLA
- return \"jbmi %l1\";
-#else
- return \"jmi %l1\";
-#endif
+ return MOTOROLA ? \"jbmi %l1\" : \"jmi %l1\";
} ")
(define_insn "beq"
@@ -5926,11 +5836,10 @@
""
"*
{
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
-#else
- OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
+ else
+ OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
}")
(define_insn "bne"
@@ -5942,11 +5851,10 @@
""
"*
{
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
-#else
- OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
+ else
+ OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
}")
(define_insn "bgt"
@@ -5957,11 +5865,10 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0);
-#else
- OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0);
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbgt %l0\", \"fbgt %l0\", 0);
+ else
+ OUTPUT_JUMP (\"jgt %l0\", \"fjgt %l0\", 0);
")
(define_insn "bgtu"
@@ -5972,11 +5879,7 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- return \"jbhi %l0\";
-#else
- return \"jhi %l0\";
-#endif
+ return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\";
")
(define_insn "blt"
@@ -5987,11 +5890,10 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\");
-#else
- OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jblt %l0\", \"fblt %l0\", \"jbmi %l0\");
+ else
+ OUTPUT_JUMP (\"jlt %l0\", \"fjlt %l0\", \"jmi %l0\");
")
(define_insn "bltu"
@@ -6002,11 +5904,7 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- return \"jbcs %l0\";
-#else
- return \"jcs %l0\";
-#endif
+ return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\";
")
(define_insn "bge"
@@ -6017,11 +5915,10 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\");
-#else
- OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbge %l0\", \"fbge %l0\", \"jbpl %l0\");
+ else
+ OUTPUT_JUMP (\"jge %l0\", \"fjge %l0\", \"jpl %l0\");
")
(define_insn "bgeu"
@@ -6032,11 +5929,7 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- return \"jbcc %l0\";
-#else
- return \"jcc %l0\";
-#endif
+ return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\";
")
(define_insn "ble"
@@ -6047,11 +5940,10 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0);
-#else
- OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0);
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jble %l0\", \"fble %l0\", 0);
+ else
+ OUTPUT_JUMP (\"jle %l0\", \"fjle %l0\", 0);
")
(define_insn "bleu"
@@ -6062,11 +5954,7 @@
(pc)))]
""
"*
-#ifdef MOTOROLA
- return \"jbls %l0\";
-#else
- return \"jls %l0\";
-#endif
+ return MOTOROLA ? \"jbls %l0\" : \"jls %l0\";
")
(define_insn "bordered"
@@ -6078,11 +5966,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbor %l0";
-#else
- return "fjor %l0";
-#endif
+ return MOTOROLA ? "fbor %l0" : "fjor %l0";
})
(define_insn "bunordered"
@@ -6094,11 +5978,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbun %l0";
-#else
- return "fjun %l0";
-#endif
+ return MOTOROLA ? "fbun %l0" : "fjun %l0";
})
(define_insn "buneq"
@@ -6110,11 +5990,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbueq %l0";
-#else
- return "fjueq %l0";
-#endif
+ return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
})
(define_insn "bunge"
@@ -6126,11 +6002,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbuge %l0";
-#else
- return "fjuge %l0";
-#endif
+ return MOTOROLA ? "fbuge %l0" : "fjuge %l0";
})
(define_insn "bungt"
@@ -6142,11 +6014,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbugt %l0";
-#else
- return "fjugt %l0";
-#endif
+ return MOTOROLA ? "fbugt %l0" : "fjugt %l0";
})
(define_insn "bunle"
@@ -6158,11 +6026,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbule %l0";
-#else
- return "fjule %l0";
-#endif
+ return MOTOROLA ? "fbule %l0" : "fjule %l0";
})
(define_insn "bunlt"
@@ -6174,11 +6038,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbult %l0";
-#else
- return "fjult %l0";
-#endif
+ return MOTOROLA ? "fbult %l0" : "fjult %l0";
})
(define_insn "bltgt"
@@ -6190,11 +6050,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbogl %l0";
-#else
- return "fjogl %l0";
-#endif
+ return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
})
;; Negated conditional jump instructions.
@@ -6208,11 +6064,10 @@
""
"*
{
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
-#else
- OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbne %l0\", \"fbne %l0\", \"jbne %l0\");
+ else
+ OUTPUT_JUMP (\"jne %l0\", \"fjne %l0\", \"jne %l0\");
}")
(define_insn ""
@@ -6224,11 +6079,10 @@
""
"*
{
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
-#else
- OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbeq %l0\", \"fbeq %l0\", \"jbeq %l0\");
+ else
+ OUTPUT_JUMP (\"jeq %l0\", \"fjeq %l0\", \"jeq %l0\");
}")
(define_insn ""
@@ -6239,11 +6093,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0);
-#else
- OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0);
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jble %l0\", \"fbngt %l0\", 0);
+ else
+ OUTPUT_JUMP (\"jle %l0\", \"fjngt %l0\", 0);
")
(define_insn ""
@@ -6254,11 +6107,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- return \"jbls %l0\";
-#else
- return \"jls %l0\";
-#endif
+ return MOTOROLA ? \"jbls %l0\" : \"jls %l0\";
")
(define_insn ""
@@ -6269,11 +6118,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\");
-#else
- OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbge %l0\", \"fbnlt %l0\", \"jbpl %l0\");
+ else
+ OUTPUT_JUMP (\"jge %l0\", \"fjnlt %l0\", \"jpl %l0\");
")
(define_insn ""
@@ -6284,11 +6132,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- return \"jbcc %l0\";
-#else
- return \"jcc %l0\";
-#endif
+ return MOTOROLA ? \"jbcc %l0\" : \"jcc %l0\";
")
(define_insn ""
@@ -6299,11 +6143,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\");
-#else
- OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\");
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jblt %l0\", \"fbnge %l0\", \"jbmi %l0\");
+ else
+ OUTPUT_JUMP (\"jlt %l0\", \"fjnge %l0\", \"jmi %l0\");
")
(define_insn ""
@@ -6314,11 +6157,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- return \"jbcs %l0\";
-#else
- return \"jcs %l0\";
-#endif
+ return MOTOROLA ? \"jbcs %l0\" : \"jcs %l0\";
")
(define_insn ""
@@ -6329,11 +6168,10 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0);
-#else
- OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0);
-#endif
+ if (MOTOROLA)
+ OUTPUT_JUMP (\"jbgt %l0\", \"fbnle %l0\", 0);
+ else
+ OUTPUT_JUMP (\"jgt %l0\", \"fjnle %l0\", 0);
")
(define_insn ""
@@ -6344,11 +6182,7 @@
(label_ref (match_operand 0 "" ""))))]
""
"*
-#ifdef MOTOROLA
- return \"jbhi %l0\";
-#else
- return \"jhi %l0\";
-#endif
+ return MOTOROLA ? \"jbhi %l0\" : \"jhi %l0\";
")
(define_insn "*bordered_rev"
@@ -6360,11 +6194,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbun %l0";
-#else
- return "fjun %l0";
-#endif
+ return MOTOROLA ? "fbun %l0" : "fjun %l0";
})
(define_insn "*bunordered_rev"
@@ -6376,11 +6206,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbor %l0";
-#else
- return "fjor %l0";
-#endif
+ return MOTOROLA ? "fbor %l0" : "fjor %l0";
})
(define_insn "*buneq_rev"
@@ -6392,11 +6218,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbogl %l0";
-#else
- return "fjogl %l0";
-#endif
+ return MOTOROLA ? "fbogl %l0" : "fjogl %l0";
})
(define_insn "*bunge_rev"
@@ -6408,11 +6230,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbolt %l0";
-#else
- return "fjolt %l0";
-#endif
+ return MOTOROLA ? "fbolt %l0" : "fjolt %l0";
})
(define_insn "*bunle_rev"
@@ -6424,11 +6242,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbogt %l0";
-#else
- return "fjogt %l0";
-#endif
+ return MOTOROLA ? "fbogt %l0" : "fjogt %l0";
})
(define_insn "*bunlt_rev"
@@ -6440,11 +6254,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fboge %l0";
-#else
- return "fjoge %l0";
-#endif
+ return MOTOROLA ? "fboge %l0" : "fjoge %l0";
})
(define_insn "*bltgt_rev"
@@ -6456,11 +6266,7 @@
{
if (!(cc_prev_status.flags & CC_IN_68881))
abort ();
-#ifdef MOTOROLA
- return "fbueq %l0";
-#else
- return "fjueq %l0";
-#endif
+ return MOTOROLA ? "fbueq %l0" : "fjueq %l0";
})
;; Unconditional and other jump instructions
@@ -6469,11 +6275,7 @@
(label_ref (match_operand 0 "" "")))]
""
"*
-#ifdef MOTOROLA
- return \"jbra %l0\";
-#else
- return \"jra %l0\";
-#endif
+ return MOTOROLA ? \"jbra %l0\" : \"jra %l0\";
")
;; We support two different ways of handling dispatch tables.
@@ -6497,11 +6299,7 @@
(use (label_ref (match_operand 1 "" "")))]
""
"*
-#ifdef MOTOROLA
- return \"jmp (%0)\";
-#else
- return \"jmp %0@\";
-#endif
+ return MOTOROLA ? \"jmp (%0)\" : \"jmp %0@\";
")
;; Jump to variable address from dispatch table of relative addresses.
@@ -6542,28 +6340,16 @@
{
if (ADDRESS_REG_P (operands[0]))
{
-#ifdef MOTOROLA
- return \"jmp (2,pc,%0.l)\";
-#else
- return \"jmp pc@(2,%0:l)\";
-#endif
+ return MOTOROLA ? \"jmp (2,pc,%0.l)\" : \"jmp pc@(2,%0:l)\";
}
+ else if (MOTOROLA)
+ return \"ext%.l %0\;jmp (2,pc,%0.l)\";
else
- {
-#ifdef MOTOROLA
- return \"ext%.l %0\;jmp (2,pc,%0.l)\";
-#else
- return \"extl %0\;jmp pc@(2,%0:l)\";
-#endif
- }
+ return \"extl %0\;jmp pc@(2,%0:l)\";
}
else
{
-#ifdef MOTOROLA
- return \"jmp (2,pc,%0.w)\";
-#else
- return \"jmp pc@(2,%0:w)\";
-#endif
+ return MOTOROLA ? \"jmp (2,pc,%0.w)\" : \"jmp pc@(2,%0:w)\";
}
#endif
#endif
@@ -6588,21 +6374,19 @@
return \"dbra %0,%l1\";
if (GET_CODE (operands[0]) == MEM)
{
-#ifdef MOTOROLA
- return \"subq%.w %#1,%0\;jbcc %l1\";
-#else /* not MOTOROLA */
- return \"subqw %#1,%0\;jcc %l1\";
-#endif
+ if (MOTOROLA)
+ return \"subq%.w %#1,%0\;jbcc %l1\";
+ else
+ return \"subqw %#1,%0\;jcc %l1\";
}
-#ifdef MOTOROLA
+ if (MOTOROLA)
#ifdef SGS_CMP_ORDER
- return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
+ return \"subq%.w %#1,%0\;cmp%.w %0,%#-1\;jbne %l1\";
#else /* not SGS_CMP_ORDER */
- return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
-#endif
-#else /* not MOTOROLA */
- return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
+ return \"subq%.w %#1,%0\;cmp%.w %#-1,%0\;jbne %l1\";
#endif
+ else
+ return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
}")
(define_insn ""
@@ -6619,23 +6403,26 @@
"*
{
CC_STATUS_INIT;
-#ifdef MOTOROLA
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subq%.l %#1,%0\;jbcc %l1\";
+ if (MOTOROLA)
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subq%.l %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
- return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
+ return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#else /* not SGS_CMP_ORDER */
- return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
+ return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
-#else /* not MOTOROLA */
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subql %#1,%0\;jcc %l1\";
- return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
-#endif /* not MOTOROLA */
+ }
+ else
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subql %#1,%0\;jcc %l1\";
+ return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
+ }
}")
;; Two dbra patterns that use REG_NOTES info generated by strength_reduce.
@@ -6655,23 +6442,26 @@
"*
{
CC_STATUS_INIT;
-#ifdef MOTOROLA
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subq%.w %#1,%0\;jbcc %l1\";
+ if (MOTOROLA)
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subq%.w %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
- return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
+ return \"subq.w %#1,%0\;cmp.w %0,%#-1\;jbne %l1\";
#else /* not SGS_CMP_ORDER */
- return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
+ return \"subq.w %#1,%0\;cmp.w %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
-#else /* not MOTOROLA */
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subqw %#1,%0\;jcc %l1\";
- return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
-#endif /* not MOTOROLA */
+ }
+ else
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subqw %#1,%0\;jcc %l1\";
+ return \"subqw %#1,%0\;cmpw %#-1,%0\;jne %l1\";
+ }
}")
(define_expand "decrement_and_branch_until_zero"
@@ -6703,23 +6493,26 @@
"*
{
CC_STATUS_INIT;
-#ifdef MOTOROLA
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subq%.l %#1,%0\;jbcc %l1\";
+ if (MOTOROLA)
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\;clr%.w %0\;subq%.l %#1,%0\;jbcc %l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subq%.l %#1,%0\;jbcc %l1\";
#ifdef SGS_CMP_ORDER
- return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
+ return \"subq.l %#1,%0\;cmp.l %0,%#-1\;jbne %l1\";
#else /* not SGS_CMP_ORDER */
- return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
+ return \"subq.l %#1,%0\;cmp.l %#-1,%0\;jbne %l1\";
#endif /* not SGS_CMP_ORDER */
-#else /* not MOTOROLA */
- if (DATA_REG_P (operands[0]))
- return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
- if (GET_CODE (operands[0]) == MEM)
- return \"subql %#1,%0\;jcc %l1\";
- return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
-#endif /* not MOTOROLA */
+ }
+ else
+ {
+ if (DATA_REG_P (operands[0]))
+ return \"dbra %0,%l1\;clr%.w %0\;subql %#1,%0\;jcc %l1\";
+ if (GET_CODE (operands[0]) == MEM)
+ return \"subql %#1,%0\;jcc %l1\";
+ return \"subql %#1,%0\;cmpl %#-1,%0\;jne %l1\";
+ }
}")
@@ -6781,7 +6574,7 @@
"! flag_pic"
"*
-#if defined (MOTOROLA) && !defined (USE_GAS)
+#if MOTOROLA && !defined (USE_GAS)
return \"jsr %0\";
#else
return \"jbsr %0\";
@@ -6823,7 +6616,7 @@
;; Operand 2 not really used on the m68000.
"! flag_pic"
"*
-#if defined (MOTOROLA) && !defined (USE_GAS)
+#if MOTOROLA && !defined (USE_GAS)
return \"jsr %1\";
#else
return \"jbsr %1\";
@@ -6919,7 +6712,7 @@
&& GET_CODE (XEXP (operands[1], 0)) != PLUS)
{
rtx labelref = XEXP (operands[1], 1);
-#if defined (MOTOROLA) && !defined (SGS_SWITCH_TABLES)
+#if MOTOROLA && !defined (SGS_SWITCH_TABLES)
#ifdef SGS
asm_fprintf (asm_out_file, \"\\tset %LLI%d,.+2\\n\",
CODE_LABEL_NUMBER (XEXP (labelref, 0)));
@@ -6995,12 +6788,10 @@
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
- else
-#ifdef MOTOROLA
+ else if (MOTOROLA)
output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
-#else
+ else
output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
-#endif
}
else
output_asm_insn (\"add%.l %1,%0\", xoperands);
@@ -7042,14 +6833,10 @@
{
if (TARGET_68040)
output_asm_insn (\"add%.w %1,%0\", xoperands);
+ else if (MOTOROLA)
+ output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
else
- {
-#ifdef MOTOROLA
- output_asm_insn (\"lea (%c1,%0),%0\", xoperands);
-#else
- output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
-#endif
- }
+ output_asm_insn (\"lea %0@(%c1),%0\", xoperands);
}
else
output_asm_insn (\"add%.l %1,%0\", xoperands);
diff --git a/gcc/config/m68k/m68kelf.h b/gcc/config/m68k/m68kelf.h
index 6aebf3840e8..dfccef66c02 100644
--- a/gcc/config/m68k/m68kelf.h
+++ b/gcc/config/m68k/m68kelf.h
@@ -22,13 +22,6 @@ 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. */
-/* These are necessary for -fpic/-fPIC to work correctly. */
-#ifndef MOTOROLA
-#define MOTOROLA /* Use MOTOROLA syntax. */
-#endif
-#ifndef USE_GAS /* forces jsbr instead of jsr. */
-#define USE_GAS
-#endif
#ifndef SWBEG_ASM_OP
#define SWBEG_ASM_OP "\t.swbeg\t"
@@ -246,8 +239,6 @@ extern int switch_table_difference_label_flag;
fprintf ((FILE), "%s&%d\n", SWBEG_ASM_OP, XVECLEN (PATTERN (TABLE), 1));
/* end of stuff from m68kv4.h */
-#undef SGS_CMP_ORDER
-
#undef ENDFILE_SPEC
#define ENDFILE_SPEC "crtend.o%s"
diff --git a/gcc/config/m68k/netbsd-elf.h b/gcc/config/m68k/netbsd-elf.h
index 79569e3e65a..bbc8bdb20c8 100644
--- a/gcc/config/m68k/netbsd-elf.h
+++ b/gcc/config/m68k/netbsd-elf.h
@@ -143,9 +143,6 @@ while (0)
Here is a bunch of stuff lifted from m68kelf.h. We don't use that
file directly, because it has a lot of baggage we don't want. */
-#define MOTOROLA /* Use Motorola syntax */
-#define USE_GAS /* But GAS wants jbsr instead of jsr */
-
/* The prefix for register names. Note that REGISTER_NAMES
is supposed to include this prefix. Also note that this is NOT an
diff --git a/gcc/config/m68k/rtemself.h b/gcc/config/m68k/rtemself.h
index ea9ed2df249..5945f76c7e6 100644
--- a/gcc/config/m68k/rtemself.h
+++ b/gcc/config/m68k/rtemself.h
@@ -20,8 +20,6 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
-#define MOTOROLA /* Use Motorola syntax rather than MIT. */
-
/* Target OS builtins. */
#undef TARGET_OS_CPP_BUILTINS /* Defined in m68kemb.h. */
#define TARGET_OS_CPP_BUILTINS() \
diff --git a/gcc/config/m68k/uclinux.h b/gcc/config/m68k/uclinux.h
index 0231539281d..3ef0b9742a1 100644
--- a/gcc/config/m68k/uclinux.h
+++ b/gcc/config/m68k/uclinux.h
@@ -30,7 +30,7 @@ Boston, MA 02111-1307, USA. */
profiling, or libg.a. */
#undef LIB_SPEC
#define LIB_SPEC "\
-%{mid-shared-library:-R libc.gdb%s} -lc \
+%{mid-shared-library:-R libc.gdb%s -elf2flt -shared-lib-id 0} -lc \
"
/* we don't want a .eh_frame section. */
@@ -55,6 +55,8 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define_std ("unix"); \
builtin_define ("__gnu_linux__"); \
+ builtin_assert ("system=linux"); \
+ builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
if (TARGET_ID_SHARED_LIBRARY) \
builtin_define ("__ID_SHARED_LIBRARY__"); \
diff --git a/gcc/config/mcore/mcore-elf.h b/gcc/config/mcore/mcore-elf.h
index c879368d4a7..deb44d66be0 100644
--- a/gcc/config/mcore/mcore-elf.h
+++ b/gcc/config/mcore/mcore-elf.h
@@ -31,9 +31,6 @@ Boston, MA 02111-1307, USA. */
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-/* But allow DWARF 1 if the user wants it. */
-#define DWARF_DEBUGGING_INFO 1
-
#define EXPORTS_SECTION_ASM_OP "\t.section .exports"
#define SUBTARGET_EXTRA_SECTIONS in_exports
diff --git a/gcc/config/mips/_tilib.c b/gcc/config/mips/_tilib.c
index 7118f842588..25e326c86da 100644
--- a/gcc/config/mips/_tilib.c
+++ b/gcc/config/mips/_tilib.c
@@ -24,7 +24,7 @@ Boston, MA 02111-1307, USA. */
#include "coretypes.h"
#include "tm.h"
-#if _MIPS_SIM == 2 /* N32 */ || _MIPS_SIM == 3 /* 64 */
+#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
typedef int TItype __attribute__ ((mode (TI)));
typedef int DItype __attribute__ ((mode (DI)));
diff --git a/gcc/config/mips/iris6.h b/gcc/config/mips/iris6.h
index d708bcf5d96..5bac6e6fd60 100644
--- a/gcc/config/mips/iris6.h
+++ b/gcc/config/mips/iris6.h
@@ -423,12 +423,6 @@ while (0)
#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-/* Define the `__builtin_va_list' type for the ABI. On IRIX 6, this
- type is `char *'. */
-#undef BUILD_VA_LIST_TYPE
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = build_pointer_type (char_type_node)
-
#undef ASM_DECLARE_OBJECT_NAME
#define ASM_DECLARE_OBJECT_NAME mips_declare_object_name
@@ -442,8 +436,7 @@ while (0)
/* Profiling is supported via libprof1.a not -lc_p as in IRIX 3. */
/* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */
-#undef STARTFILE_SPEC
-#define STARTFILE_SPEC \
+#define IRIX6_STARTFILE_SPEC \
"%{!shared: \
%{mabi=32:%{pg:gcrt1.o%s} \
%{!pg:%{p:mcrt1.o%s libprof1.a%s}%{!p:crt1.o%s}}} \
@@ -467,8 +460,10 @@ while (0)
%{!p:/usr/lib32/mips4/crt1.o%s}}} \
%{!mips4:%{pg:/usr/lib32/mips3/gcrt1.o%s} \
%{!pg:%{p:/usr/lib32/mips3/mcrt1.o%s /usr/lib32/mips3/libprof1.a%s} \
- %{!p:/usr/lib32/mips3/crt1.o%s}}}}} \
- crtbegin.o%s"
+ %{!p:/usr/lib32/mips3/crt1.o%s}}}}}"
+
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%(irix6_startfile_spec) crtbegin.o%s"
#undef LIB_SPEC
#define LIB_SPEC \
@@ -487,10 +482,8 @@ while (0)
/* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */
-#undef ENDFILE_SPEC
-#define ENDFILE_SPEC \
- "crtend.o%s \
- %{!shared: \
+#define IRIX6_ENDFILE_SPEC \
+ "%{!shared: \
%{mabi=32:crtn.o%s}\
%{mabi=n32:%{mips4:/usr/lib32/mips4/crtn.o%s}\
%{!mips4:/usr/lib32/mips3/crtn.o%s}}\
@@ -499,6 +492,9 @@ while (0)
%{!mabi*:%{mips4:/usr/lib32/mips4/crtn.o%s}\
%{!mips4:/usr/lib32/mips3/crtn.o%s}}}"
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s %(irix6_endfile_spec)"
+
/* ??? If no mabi=X option give, but a mipsX option is, then should depend
on the mipsX option. */
#undef LINK_SPEC
@@ -522,3 +518,8 @@ do { \
} while (0)
#define MIPS_TFMODE_FORMAT mips_extended_format
+
+#undef SUBTARGET_EXTRA_SPECS
+#define SUBTARGET_EXTRA_SPECS \
+ { "irix6_startfile_spec", IRIX6_STARTFILE_SPEC }, \
+ { "irix6_endfile_spec", IRIX6_ENDFILE_SPEC },
diff --git a/gcc/config/mips/iris6gld.h b/gcc/config/mips/iris6gld.h
index 3ae5587c2fa..1e5ee2c9f96 100644
--- a/gcc/config/mips/iris6gld.h
+++ b/gcc/config/mips/iris6gld.h
@@ -44,8 +44,17 @@ Boston, MA 02111-1307, USA. */
%{static: -non_shared} \
%{!static: \
%{!shared: %{!non_shared: %{!call_shared: -call_shared}}}} \
-%{rpath} -init __do_global_ctors -fini __do_global_dtors \
+%{rpath} -init __gcc_init -fini __gcc_fini \
%{mabi=32: -melf32bsmip}%{mabi=n32: -melf32bmipn32}%{mabi=64: -melf64bmip}%{!mabi*: -melf32bmipn32}"
+#undef STARTFILE_SPEC
+#define STARTFILE_SPEC "%(irix6_startfile_spec) irix6-crti.o%s crtbegin.o%s"
+
+#undef ENDFILE_SPEC
+#define ENDFILE_SPEC "crtend.o%s irix6-crtn.o%s %(irix6_endfile_spec)"
+
/* The GNU linker supports one-only sections. */
#define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)
+
+#define INIT_SECTION_ASM_OP "\t.section\t.init,0x1,0x6,4,4"
+#define FINI_SECTION_ASM_OP "\t.section\t.fini,0x1,0x6,4,4"
diff --git a/gcc/config/mips/irix6-crti.asm b/gcc/config/mips/irix6-crti.asm
new file mode 100644
index 00000000000..5d8ede70390
--- /dev/null
+++ b/gcc/config/mips/irix6-crti.asm
@@ -0,0 +1,33 @@
+ .abicalls
+ .set noreorder
+ .set nomacro
+
+ .section .init,0x1,0x6,4,4
+ jr $31
+ nop
+
+ .globl __gcc_init
+__gcc_init:
+#if _MIPS_SIM == _ABIO32
+ addiu $sp,$sp,-16
+ sw $31,0($sp)
+#else
+ daddiu $sp,$sp,-16
+ sd $31,0($sp)
+ sd $28,8($sp)
+#endif
+
+ .section .fini,0x1,0x6,4,4
+ jr $31
+ nop
+
+ .globl __gcc_fini
+__gcc_fini:
+#if _MIPS_SIM == _ABIO32
+ addiu $sp,$sp,-16
+ sw $31,0($sp)
+#else
+ daddiu $sp,$sp,-16
+ sd $31,0($sp)
+ sd $28,8($sp)
+#endif
diff --git a/gcc/config/mips/irix6-crtn.asm b/gcc/config/mips/irix6-crtn.asm
new file mode 100644
index 00000000000..647e8e13e31
--- /dev/null
+++ b/gcc/config/mips/irix6-crtn.asm
@@ -0,0 +1,27 @@
+ .abicalls
+ .set noreorder
+ .set nomacro
+
+ .section .init,0x1,0x6,4,4
+#if _MIPS_SIM == _ABIO32
+ lw $31,0($sp)
+ jr $31
+ addiu $sp,$sp,16
+#else
+ ld $31,0($sp)
+ ld $28,8($sp)
+ jr $31
+ daddiu $sp,$sp,16
+#endif
+
+ .section .fini,0x1,0x6,4,4
+#if _MIPS_SIM == _ABIO32
+ lw $31,0($sp)
+ jr $31
+ addiu $sp,$sp,16
+#else
+ ld $31,0($sp)
+ ld $28,8($sp)
+ jr $31
+ daddiu $sp,$sp,16
+#endif
diff --git a/gcc/config/mips/irix6-libc-compat.c b/gcc/config/mips/irix6-libc-compat.c
deleted file mode 100644
index 47c72a8ec86..00000000000
--- a/gcc/config/mips/irix6-libc-compat.c
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Compensate for inconsistent structure return conventions on IRIX 6. */
-/* Compile this one with gcc. */
-/* 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.
-
-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. */
-
-/* GCC doesn't correctly implement the structure and union 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 return
- structures by value, so until the underlying bug is fixed, it is possible
- to work around it by providing wrappers for the few affected routines.
-
- 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 and then shifting the result as required.
-
- This is a rewrite of code created by Andy Polyakov. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-/* This must only be used for the N32 and N64 ABIs. O32 is correct. */
-
-#if _MIPS_SIM == _ABIN32 || _MIPS_SIM == _ABI64
-
-/* The affected return values need to be shifted by
-
- BITS_PER_WORD - (sizeof (value) * BITS_PER_UNIT).
-
- Since only 32-bit results are involved, the shift count is always 32. */
-#define SHIFT_BITS 32
-
-extern machreg_t _inet_makeaddr (machreg_t, machreg_t);
-
-/* <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;
-}
-
-#endif /* _ABIN32 || _ABI64 */
diff --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
index 48c5e3c908d..ae64020882e 100644
--- a/gcc/config/mips/linux.h
+++ b/gcc/config/mips/linux.h
@@ -55,12 +55,9 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do { \
- builtin_define ("__gnu_linux__"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
builtin_define ("__PIC__"); \
builtin_define ("__pic__"); \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_assert ("system=linux"); \
/* The GNU C++ standard library requires this. */ \
if (c_dialect_cxx ()) \
builtin_define ("_GNU_SOURCE"); \
diff --git a/gcc/config/mips/mips-protos.h b/gcc/config/mips/mips-protos.h
index 2e31138e127..a5daae09827 100644
--- a/gcc/config/mips/mips-protos.h
+++ b/gcc/config/mips/mips-protos.h
@@ -30,11 +30,12 @@ extern int mips_reg_mode_ok_for_base_p (rtx, enum machine_mode, int);
extern int mips_address_insns (rtx, enum machine_mode);
extern int mips_const_insns (rtx);
extern int mips_fetch_insns (rtx);
-extern bool mips_global_pic_constant_p (rtx);
extern bool mips_legitimate_address_p (enum machine_mode, rtx, int);
extern bool mips_legitimize_address (rtx *, enum machine_mode);
+extern rtx mips_gotoff_global (rtx);
+extern rtx mips_load_got_page (rtx);
+extern rtx mips_load_got_global (rtx, rtx);
extern bool mips_legitimize_move (enum machine_mode, rtx, rtx);
-extern rtx mips_delegitimize_address (rtx);
extern int m16_uimm3_b (rtx, enum machine_mode);
extern int m16_simm4_1 (rtx, enum machine_mode);
@@ -84,7 +85,6 @@ extern bool mips_pad_arg_upward (enum machine_mode, tree);
extern bool mips_pad_reg_upward (enum machine_mode, tree);
extern int mips_setup_incoming_varargs (const CUMULATIVE_ARGS *,
enum machine_mode, tree, int);
-extern tree mips_build_va_list (void);
extern void mips_va_start (tree, rtx);
extern struct rtx_def *mips_va_arg (tree, tree);
@@ -111,8 +111,9 @@ extern void mips_declare_object (FILE *, const char *, const char *,
extern void mips_declare_object_name (FILE *, const char *, tree);
extern void mips_finish_declare_object (FILE *, tree, int, int);
+extern rtx mips_rewrite_small_data (rtx);
extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT);
-extern int mips_initial_elimination_offset (int, int);
+extern HOST_WIDE_INT mips_initial_elimination_offset (int, int);
extern rtx mips_return_addr (int, rtx);
extern void mips_expand_prologue (void);
extern void mips_expand_epilogue (int);
diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index db087f144a6..ba358fcfbf6 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -52,6 +52,7 @@ Boston, MA 02111-1307, USA. */
#include "target.h"
#include "target-def.h"
#include "integrate.h"
+#include "langhooks.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
@@ -80,6 +81,25 @@ enum internal_test {
#define INTERNAL_SYMBOL_P(SYM) \
(XSTR (SYM, 0)[0] == '*' && XSTR (SYM, 0)[1] == LOCAL_LABEL_PREFIX[0])
+/* True if X is an unspec wrapper around a SYMBOL_REF or LABEL_REF. */
+#define UNSPEC_ADDRESS_P(X) \
+ (GET_CODE (X) == UNSPEC \
+ && XINT (X, 1) >= UNSPEC_ADDRESS_FIRST \
+ && XINT (X, 1) < UNSPEC_ADDRESS_FIRST + NUM_SYMBOL_TYPES)
+
+/* Extract the symbol or label from UNSPEC wrapper X. */
+#define UNSPEC_ADDRESS(X) \
+ XVECEXP (X, 0, 0)
+
+/* Extract the symbol type from UNSPEC wrapper X. */
+#define UNSPEC_ADDRESS_TYPE(X) \
+ ((enum mips_symbol_type) (XINT (X, 1) - UNSPEC_ADDRESS_FIRST))
+
+/* True if X is (const $gp). This is used to initialize the mips16
+ gp pseudo register. */
+#define CONST_GP_P(X) \
+ (GET_CODE (X) == CONST && XEXP (X, 0) == pic_offset_table_rtx)
+
/* The maximum distance between the top of the stack frame and the
value $sp has when we save & restore registers.
@@ -93,40 +113,7 @@ enum internal_test {
multi-instruction addu sequence. Use 0x7fe0 to work around this. */
#define MIPS_MAX_FIRST_STACK_STEP (TARGET_MIPS16 ? 0x100 : 0x7fe0)
-/* Classifies a non-literal integer constant.
-
- CONSTANT_NONE
- Not one of the constants below.
-
- CONSTANT_GP
- The global pointer, treated as a constant when TARGET_MIPS16.
- The rtx has the form:
-
- (const (reg $gp)).
-
- CONSTANT_RELOC
- A signed 16-bit relocation against either a symbol
- or a symbol plus an offset. The relocation has the form:
-
- (unspec [(SYMBOL) ...] RELOC)
-
- Any offset is added outside the unspec, such as:
-
- (plus (unspec [(SYMBOL) ...] RELOC) (const_int OFFSET))
-
- In either case, the whole expression is wrapped in a (const ...).
-
- CONSTANT_SYMBOLIC
- A reference to a symbol, possibly with an offset. */
-enum mips_constant_type {
- CONSTANT_NONE,
- CONSTANT_GP,
- CONSTANT_RELOC,
- CONSTANT_SYMBOLIC
-};
-
-
-/* Classifies a SYMBOL_REF or LABEL_REF.
+/* Classifies a SYMBOL_REF, LABEL_REF or UNSPEC address.
SYMBOL_GENERAL
Used when none of the below apply.
@@ -142,21 +129,40 @@ enum mips_constant_type {
the global offset table.
SYMBOL_GOT_GLOBAL
- Likewise non-local data. */
+ Likewise non-local data.
+
+ SYMBOL_GOTOFF_PAGE
+ An UNSPEC wrapper around a SYMBOL_GOT_LOCAL. It represents the
+ offset from _gp of a GOT page entry.
+
+ SYMBOL_GOTOFF_GLOBAL
+ An UNSPEC wrapper around a SYMBOL_GOT_GLOBAL. It represents the
+ the offset from _gp of the symbol's GOT entry.
+
+ SYMBOL_GOTOFF_CALL
+ Like SYMBOL_GOTOFF_GLOBAL, but used when calling a global function.
+ The GOT entry is allowed to point to a stub rather than to the
+ function itself.
+
+ SYMBOL_GOTOFF_LOADGP
+ An UNSPEC wrapper around a function's address. It represents the
+ offset of _gp from the start of the function. */
enum mips_symbol_type {
SYMBOL_GENERAL,
SYMBOL_SMALL_DATA,
SYMBOL_CONSTANT_POOL,
SYMBOL_GOT_LOCAL,
- SYMBOL_GOT_GLOBAL
+ SYMBOL_GOT_GLOBAL,
+ SYMBOL_GOTOFF_PAGE,
+ SYMBOL_GOTOFF_GLOBAL,
+ SYMBOL_GOTOFF_CALL,
+ SYMBOL_GOTOFF_LOADGP
};
+#define NUM_SYMBOL_TYPES (SYMBOL_GOTOFF_LOADGP + 1)
/* Classifies an address.
- ADDRESS_INVALID
- The address should be rejected as invalid.
-
ADDRESS_REG
A natural register + offset address. The register satisfies
mips_valid_base_register_p and the offset is a const_arith_operand.
@@ -171,7 +177,6 @@ enum mips_symbol_type {
ADDRESS_SYMBOLIC:
A constant symbolic address (equivalent to CONSTANT_SYMBOLIC). */
enum mips_address_type {
- ADDRESS_INVALID,
ADDRESS_REG,
ADDRESS_LO_SUM,
ADDRESS_CONST_INT,
@@ -184,32 +189,24 @@ typedef void (*mips_save_restore_fn) (rtx, rtx);
struct constant;
struct mips_arg_info;
-struct mips_constant_info;
struct mips_address_info;
struct mips_integer_op;
-static bool mips_reloc_offset_ok_p (int, HOST_WIDE_INT);
-static enum mips_constant_type
- mips_classify_constant (struct mips_constant_info *, rtx);
static enum mips_symbol_type mips_classify_symbol (rtx);
+static void mips_split_const (rtx, rtx *, HOST_WIDE_INT *);
+static bool mips_symbolic_constant_p (rtx, enum mips_symbol_type *);
static bool mips_valid_base_register_p (rtx, enum machine_mode, int);
-static bool mips_symbolic_address_p (rtx, HOST_WIDE_INT,
- enum machine_mode, int);
-static enum mips_address_type
- mips_classify_address (struct mips_address_info *, rtx,
- enum machine_mode, int, int);
-static bool mips_splittable_symbol_p (enum mips_symbol_type, HOST_WIDE_INT);
+static bool mips_symbolic_address_p (enum mips_symbol_type, enum machine_mode);
+static bool mips_classify_address (struct mips_address_info *, rtx,
+ enum machine_mode, int);
static int mips_symbol_insns (enum mips_symbol_type);
static bool mips16_unextended_reference_p (enum machine_mode mode, rtx, rtx);
-static rtx mips_reloc (rtx, int);
-static rtx mips_lui_reloc (rtx, int);
static rtx mips_force_temporary (rtx, rtx);
+static rtx mips_split_symbol (rtx, rtx);
+static rtx mips_unspec_address (rtx, enum mips_symbol_type);
+static rtx mips_unspec_offset_high (rtx, rtx, enum mips_symbol_type);
+static rtx mips_load_got (rtx, rtx, enum mips_symbol_type);
static rtx mips_add_offset (rtx, HOST_WIDE_INT);
-static rtx mips_load_got (rtx, rtx, int);
-static rtx mips_load_got16 (rtx, int);
-static rtx mips_load_got32 (rtx, rtx, int, int);
-static rtx mips_emit_high (rtx, rtx);
-static bool mips_legitimize_symbol (rtx, rtx *, int);
static unsigned int mips_build_shift (struct mips_integer_op *, HOST_WIDE_INT);
static unsigned int mips_build_lower (struct mips_integer_op *,
unsigned HOST_WIDE_INT);
@@ -233,10 +230,14 @@ static bool mips_get_unaligned_mem (rtx *, unsigned int, int, rtx *, rtx *);
static void mips_set_architecture (const struct mips_cpu_info *);
static void mips_set_tune (const struct mips_cpu_info *);
static struct machine_function *mips_init_machine_status (void);
-static const char *mips_reloc_string (int);
+static void print_operand_reloc (FILE *, rtx, const char **);
static bool mips_assemble_integer (rtx, unsigned int, int);
static void mips_file_start (void);
static void mips_file_end (void);
+static bool mips_rewrite_small_data_p (rtx);
+static int small_data_pattern_1 (rtx *, void *);
+static int mips_rewrite_small_data_1 (rtx *, void *);
+static bool mips_function_has_gp_insn (void);
static unsigned int mips_global_pointer (void);
static bool mips_save_reg_p (unsigned int);
static void mips_save_restore_reg (enum machine_mode, int, HOST_WIDE_INT,
@@ -246,7 +247,6 @@ static void mips_output_function_prologue (FILE *, HOST_WIDE_INT);
static void mips_set_frame_expr (rtx);
static rtx mips_frame_set (rtx, rtx);
static void mips_save_reg (rtx, rtx);
-static void mips_gp_insn (rtx, rtx);
static void mips_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void mips_restore_reg (rtx, rtx);
static int symbolic_expression_p (rtx);
@@ -256,7 +256,12 @@ static void mips_select_section (tree, int, unsigned HOST_WIDE_INT)
ATTRIBUTE_UNUSED;
static bool mips_in_small_data_p (tree);
static void mips_encode_section_info (tree, rtx, int);
-static rtx mips_sdata_pointer (void);
+static int mips_fpr_return_fields (tree, tree *);
+static bool mips_return_in_msb (tree);
+static rtx mips_return_fpr_pair (enum machine_mode mode,
+ enum machine_mode mode1, HOST_WIDE_INT,
+ enum machine_mode mode2, HOST_WIDE_INT);
+static rtx mips16_gp_pseudo_reg (void);
static void mips16_fp_args (FILE *, int, int);
static void build_mips16_function_stub (FILE *);
static void mips16_optimize_gp (void);
@@ -275,6 +280,7 @@ static int mips_adjust_cost (rtx, rtx, rtx, int);
static int mips_issue_rate (void);
static int mips_use_dfa_pipeline_interface (void);
static void mips_init_libfuncs (void);
+static tree mips_build_builtin_va_list (void);
#if TARGET_IRIX
static void irix_asm_named_section_1 (const char *, unsigned int,
@@ -294,21 +300,21 @@ static unsigned int irix_section_type_flags (tree, const char *, int);
struct mips_frame_info GTY(())
{
- long total_size; /* # bytes that the entire frame takes up */
- long var_size; /* # bytes that variables take up */
- long args_size; /* # bytes that outgoing arguments take up */
- long cprestore_size; /* # bytes that the .cprestore slot takes up */
- int gp_reg_size; /* # bytes needed to store gp regs */
- int fp_reg_size; /* # bytes needed to store fp regs */
- long mask; /* mask of saved gp registers */
- long fmask; /* mask of saved fp registers */
- long gp_save_offset; /* offset from vfp to store gp registers */
- long fp_save_offset; /* offset from vfp to store fp registers */
- long gp_sp_offset; /* offset from new sp to store gp registers */
- long fp_sp_offset; /* offset from new sp to store fp registers */
- int initialized; /* != 0 if frame size already calculated */
- int num_gp; /* number of gp registers saved */
- int num_fp; /* number of fp registers saved */
+ HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up */
+ HOST_WIDE_INT var_size; /* # bytes that variables take up */
+ HOST_WIDE_INT args_size; /* # bytes that outgoing arguments take up */
+ HOST_WIDE_INT cprestore_size; /* # bytes that the .cprestore slot takes up */
+ HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */
+ HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */
+ unsigned int mask; /* mask of saved gp registers */
+ unsigned int fmask; /* mask of saved fp registers */
+ HOST_WIDE_INT gp_save_offset; /* offset from vfp to store gp registers */
+ HOST_WIDE_INT fp_save_offset; /* offset from vfp to store fp registers */
+ HOST_WIDE_INT gp_sp_offset; /* offset from new sp to store gp registers */
+ HOST_WIDE_INT fp_sp_offset; /* offset from new sp to store fp registers */
+ bool initialized; /* true if frame size already calculated */
+ int num_gp; /* number of gp registers saved */
+ int num_fp; /* number of fp registers saved */
};
struct machine_function GTY(()) {
@@ -336,6 +342,9 @@ struct machine_function GTY(()) {
/* True if the whole function is suitable for .set noreorder and
.set nomacro. */
bool all_noreorder_p;
+
+ /* True if the function is known to have an instruction that needs $gp. */
+ bool has_gp_insn_p;
};
/* Information about a single argument. */
@@ -365,30 +374,8 @@ struct mips_arg_info
};
-/* Struct for recording constants. The meaning of the fields depends
- on a mips_constant_type:
-
- CONSTANT_NONE
- CONSTANT_GP
- No fields are valid.
-
- CONSTANT_SYMBOLIC
- SYMBOL is the referenced symbol and OFFSET is the constant offset.
-
- CONSTANT_RELOC
- SYMBOL and OFFSET are the same as for CONSTANT_SYMBOLIC. RELOC is
- the relocation number. */
-struct mips_constant_info
-{
- int reloc;
- rtx symbol;
- HOST_WIDE_INT offset;
-};
-
-
/* Information about an address described by mips_address_type.
- ADDRESS_INVALID
ADDRESS_CONST_INT
No fields are used.
@@ -397,16 +384,18 @@ struct mips_constant_info
ADDRESS_LO_SUM
REG is the register that contains the high part of the address,
- OFFSET is the symbolic address being referenced, and C contains
- the individual components of the symbolic address.
+ OFFSET is the symbolic address being referenced and SYMBOL_TYPE
+ is the type of OFFSET's symbol.
ADDRESS_SYMBOLIC
- C contains the symbol and offset. */
+ SYMBOL_TYPE is the type of symbol being referenced. */
+
struct mips_address_info
{
+ enum mips_address_type type;
rtx reg;
rtx offset;
- struct mips_constant_info c;
+ enum mips_symbol_type symbol_type;
};
@@ -555,6 +544,18 @@ static int mips_flag_delayed_branch;
static GTY (()) int mips_output_filename_first_time = 1;
+/* mips_split_p[X] is true if symbols of type X can be split by
+ mips_split_symbol(). */
+static bool mips_split_p[NUM_SYMBOL_TYPES];
+
+/* mips_lo_relocs[X] is the relocation to use when a symbol of type X
+ appears in a LO_SUM. It can be null if such LO_SUMs aren't valid or
+ if they are matched by a special .md file pattern. */
+static const char *mips_lo_relocs[NUM_SYMBOL_TYPES];
+
+/* Likewise for HIGHs. */
+static const char *mips_hi_relocs[NUM_SYMBOL_TYPES];
+
/* Hardware names for the registers. If -mrnames is used, this
will be overwritten with mips_sw_reg_names. */
@@ -569,7 +570,7 @@ char mips_reg_names[][8] =
"$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",
"$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31",
"hi", "lo", "", "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4",
- "$fcc5","$fcc6","$fcc7","", "", "", "", "",
+ "$fcc5","$fcc6","$fcc7","", "", "", "", "$fakec",
"$c0r0", "$c0r1", "$c0r2", "$c0r3", "$c0r4", "$c0r5", "$c0r6", "$c0r7",
"$c0r8", "$c0r9", "$c0r10","$c0r11","$c0r12","$c0r13","$c0r14","$c0r15",
"$c0r16","$c0r17","$c0r18","$c0r19","$c0r20","$c0r21","$c0r22","$c0r23",
@@ -598,7 +599,7 @@ char mips_sw_reg_names[][8] =
"$f16", "$f17", "$f18", "$f19", "$f20", "$f21", "$f22", "$f23",
"$f24", "$f25", "$f26", "$f27", "$f28", "$f29", "$f30", "$f31",
"hi", "lo", "", "$fcc0","$fcc1","$fcc2","$fcc3","$fcc4",
- "$fcc5","$fcc6","$fcc7","$rap", "", "", "", "",
+ "$fcc5","$fcc6","$fcc7","$rap", "", "", "", "$fakec",
"$c0r0", "$c0r1", "$c0r2", "$c0r3", "$c0r4", "$c0r5", "$c0r6", "$c0r7",
"$c0r8", "$c0r9", "$c0r10","$c0r11","$c0r12","$c0r13","$c0r14","$c0r15",
"$c0r16","$c0r17","$c0r18","$c0r19","$c0r20","$c0r21","$c0r22","$c0r23",
@@ -761,8 +762,6 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#define TARGET_RTX_COSTS mips_rtx_costs
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST mips_address_cost
-#undef TARGET_DELEGITIMIZE_ADDRESS
-#define TARGET_DELEGITIMIZE_ADDRESS mips_delegitimize_address
#undef TARGET_ENCODE_SECTION_INFO
#define TARGET_ENCODE_SECTION_INFO mips_encode_section_info
@@ -792,85 +791,13 @@ const struct mips_cpu_info mips_cpu_info_table[] = {
#undef TARGET_INIT_LIBFUNCS
#define TARGET_INIT_LIBFUNCS mips_init_libfuncs
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST mips_build_builtin_va_list
+#undef TARGET_RETURN_IN_MSB
+#define TARGET_RETURN_IN_MSB mips_return_in_msb
+
struct gcc_target targetm = TARGET_INITIALIZER;
-/* Return true if RELOC is a valid relocation number and OFFSET can be
- added to the relocation symbol.
-
- Note that OFFSET might not refer to part of the object. For example,
- in an expression like x[i - 0x12345], we might try to take the address
- of "x - 0x12345". */
-
-static bool
-mips_reloc_offset_ok_p (int reloc, HOST_WIDE_INT offset)
-{
- switch (reloc)
- {
- case RELOC_GOT_PAGE:
- /* The linker should provide enough page entries to cope with
- 16-bit offsets from a valid segment address. */
- return SMALL_OPERAND (offset);
-
- case RELOC_GOT_HI:
- case RELOC_GOT_LO:
- case RELOC_GOT_DISP:
- case RELOC_CALL16:
- case RELOC_CALL_HI:
- case RELOC_CALL_LO:
- case RELOC_LOADGP_HI:
- case RELOC_LOADGP_LO:
- /* These relocations should be applied to bare symbols only. */
- return offset == 0;
-
- default:
- return false;
- }
-}
-
-
-/* If X is one of the constants described by mips_constant_type,
- store its components in INFO and return its type. */
-
-static enum mips_constant_type
-mips_classify_constant (struct mips_constant_info *info, rtx x)
-{
- enum mips_constant_type type;
-
- type = CONSTANT_SYMBOLIC;
- info->offset = 0;
-
- if (GET_CODE (x) == CONST)
- {
- x = XEXP (x, 0);
-
- if (x == pic_offset_table_rtx)
- return CONSTANT_GP;
-
- while (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
- {
- info->offset += INTVAL (XEXP (x, 1));
- x = XEXP (x, 0);
- }
-
- if (TARGET_EXPLICIT_RELOCS
- && GET_CODE (x) == UNSPEC
- && mips_reloc_offset_ok_p (XINT (x, 1), info->offset))
- {
- info->reloc = XINT (x, 1);
- x = XVECEXP (x, 0, 0);
- type = CONSTANT_RELOC;
- }
- }
-
- if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
- {
- info->symbol = x;
- return type;
- }
- return CONSTANT_NONE;
-}
-
-
/* Classify symbol X, which must be a SYMBOL_REF or a LABEL_REF. */
static enum mips_symbol_type
@@ -918,6 +845,83 @@ mips_classify_symbol (rtx x)
}
+/* Split X into a base and a constant offset, storing them in *BASE
+ and *OFFSET respectively. */
+
+static void
+mips_split_const (rtx x, rtx *base, HOST_WIDE_INT *offset)
+{
+ *offset = 0;
+
+ if (GET_CODE (x) == CONST)
+ x = XEXP (x, 0);
+
+ if (GET_CODE (x) == PLUS && GET_CODE (XEXP (x, 1)) == CONST_INT)
+ {
+ *offset += INTVAL (XEXP (x, 1));
+ x = XEXP (x, 0);
+ }
+ *base = x;
+}
+
+
+/* Return true if X is a symbolic constant that can be calculated in
+ the same way as a bare symbol. If it is, store the type of the
+ symbol in *SYMBOL_TYPE. */
+
+static bool
+mips_symbolic_constant_p (rtx x, enum mips_symbol_type *symbol_type)
+{
+ HOST_WIDE_INT offset;
+
+ mips_split_const (x, &x, &offset);
+ if (UNSPEC_ADDRESS_P (x))
+ *symbol_type = UNSPEC_ADDRESS_TYPE (x);
+ else if (GET_CODE (x) == SYMBOL_REF || GET_CODE (x) == LABEL_REF)
+ *symbol_type = mips_classify_symbol (x);
+ else
+ return false;
+
+ if (offset == 0)
+ return true;
+
+ /* Check whether a nonzero offset is valid for the underlying
+ relocations. */
+ switch (*symbol_type)
+ {
+ case SYMBOL_GENERAL:
+ /* %hi() and %lo() can handle anything. */
+ return true;
+
+ case SYMBOL_SMALL_DATA:
+ /* Make sure that the offset refers to something within the
+ -G limit. If the offset is allowed to grow too much,
+ it could overflow the range of %gp_rel(). */
+ return (offset > 0 && offset < mips_section_threshold);
+
+ case SYMBOL_CONSTANT_POOL:
+ /* Similarly check the range of offsets for mips16 constant
+ pool entries. */
+ return (CONSTANT_POOL_ADDRESS_P (x)
+ && offset > 0
+ && offset < (int) GET_MODE_SIZE (get_pool_mode (x)));
+
+ case SYMBOL_GOT_LOCAL:
+ case SYMBOL_GOTOFF_PAGE:
+ /* The linker should provide enough local GOT entries for a
+ 16-bit offset. Larger offsets may lead to GOT overflow. */
+ return SMALL_OPERAND (offset);
+
+ case SYMBOL_GOT_GLOBAL:
+ case SYMBOL_GOTOFF_GLOBAL:
+ case SYMBOL_GOTOFF_CALL:
+ case SYMBOL_GOTOFF_LOADGP:
+ return false;
+ }
+ abort ();
+}
+
+
/* This function is used to implement REG_MODE_OK_FOR_BASE_P. */
int
@@ -943,155 +947,94 @@ mips_valid_base_register_p (rtx x, enum machine_mode mode, int strict)
}
-/* Return true if SYMBOL + OFFSET should be considered a legitimate
- address. LEA_P is true and MODE is word_mode if the address
- will be used in an LA or DLA macro. Otherwise MODE is the
- mode of the value being accessed.
-
- Some guiding principles:
-
- - Allow a nonzero offset when it takes no additional instructions.
- Ask for other offsets to be added separately.
-
- - Only allow multi-instruction load or store macros when MODE is
- word-sized or smaller. For other modes (including BLKmode)
- it is better to move the address into a register first. */
+/* Return true if symbols of type SYMBOL_TYPE can directly address a value
+ with mode MODE. This is used for both symbolic and LO_SUM addresses. */
static bool
-mips_symbolic_address_p (rtx symbol, HOST_WIDE_INT offset,
- enum machine_mode mode, int lea_p)
+mips_symbolic_address_p (enum mips_symbol_type symbol_type,
+ enum machine_mode mode)
{
- if (TARGET_EXPLICIT_RELOCS)
- return false;
-
- switch (mips_classify_symbol (symbol))
+ switch (symbol_type)
{
case SYMBOL_GENERAL:
- /* General symbols aren't valid addresses in mips16 code:
- they have to go into the constant pool. */
- return (!TARGET_MIPS16
- && !mips_split_addresses
- && SINGLE_WORD_MODE_P (mode));
+ return !TARGET_MIPS16;
case SYMBOL_SMALL_DATA:
- /* Small data references are normally OK for any address.
- But for mips16 code, we need to use a pseudo register
- instead of $gp as the base register. */
- return !TARGET_MIPS16;
+ return true;
case SYMBOL_CONSTANT_POOL:
- /* PC-relative addressing is only available for lw, sw, ld and sd.
- There's also a PC-relative add instruction. */
- return lea_p || GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8;
+ /* PC-relative addressing is only available for lw, sw, ld and sd. */
+ return GET_MODE_SIZE (mode) == 4 || GET_MODE_SIZE (mode) == 8;
+
+ case SYMBOL_GOT_LOCAL:
+ return true;
case SYMBOL_GOT_GLOBAL:
- /* The address of the symbol is stored in the GOT. We can load
- it using an LA or DLA instruction, but any offset is added
- afterwards. */
- return lea_p && offset == 0;
+ /* The address will have to be loaded from the GOT first. */
+ return false;
- case SYMBOL_GOT_LOCAL:
- /* The symbol is part of a block of local memory. We fetch the
- address of the local memory from the GOT and then add the
- offset for this symbol. This addition can take the form of an
- offset(base) address, so the symbol is a legitimate address. */
- return SINGLE_WORD_MODE_P (mode);
+ case SYMBOL_GOTOFF_PAGE:
+ case SYMBOL_GOTOFF_GLOBAL:
+ case SYMBOL_GOTOFF_CALL:
+ case SYMBOL_GOTOFF_LOADGP:
+ return true;
}
abort ();
}
-/* If X is a valid address, describe it in INFO and return its type.
- STRICT says to only allow hard registers. MODE and LEA_P are
- the same as for mips_symbolic_address_p. */
+/* Return true if X is a valid address for machine mode MODE. If it is,
+ fill in INFO appropriately. STRICT is true if we should only accept
+ hard base registers. */
-static enum mips_address_type
+static bool
mips_classify_address (struct mips_address_info *info, rtx x,
- enum machine_mode mode, int strict, int lea_p)
+ enum machine_mode mode, int strict)
{
switch (GET_CODE (x))
{
case REG:
case SUBREG:
- if (mips_valid_base_register_p (x, mode, strict))
- {
- info->reg = x;
- info->offset = const0_rtx;
- return ADDRESS_REG;
- }
- return ADDRESS_INVALID;
+ info->type = ADDRESS_REG;
+ info->reg = x;
+ info->offset = const0_rtx;
+ return mips_valid_base_register_p (info->reg, mode, strict);
case PLUS:
- if (mips_valid_base_register_p (XEXP (x, 0), mode, strict)
- && const_arith_operand (XEXP (x, 1), VOIDmode))
- {
- info->reg = XEXP (x, 0);
- info->offset = XEXP (x, 1);
- return ADDRESS_REG;
- }
- return ADDRESS_INVALID;
+ info->type = ADDRESS_REG;
+ info->reg = XEXP (x, 0);
+ info->offset = XEXP (x, 1);
+ return (mips_valid_base_register_p (info->reg, mode, strict)
+ && const_arith_operand (info->offset, VOIDmode));
case LO_SUM:
- if (SINGLE_WORD_MODE_P (mode)
- && mips_valid_base_register_p (XEXP (x, 0), mode, strict)
- && (mips_classify_constant (&info->c, XEXP (x, 1))
- == CONSTANT_SYMBOLIC)
- && mips_splittable_symbol_p (mips_classify_symbol (info->c.symbol),
- info->c.offset))
- {
- info->reg = XEXP (x, 0);
- info->offset = XEXP (x, 1);
- return ADDRESS_LO_SUM;
- }
- return ADDRESS_INVALID;
+ info->type = ADDRESS_LO_SUM;
+ info->reg = XEXP (x, 0);
+ info->offset = XEXP (x, 1);
+ return (mips_valid_base_register_p (info->reg, mode, strict)
+ && mips_symbolic_constant_p (info->offset, &info->symbol_type)
+ && mips_symbolic_address_p (info->symbol_type, mode)
+ && mips_lo_relocs[info->symbol_type] != 0);
case CONST_INT:
/* Small-integer addresses don't occur very often, but they
are legitimate if $0 is a valid base register. */
- if (!TARGET_MIPS16 && SMALL_INT (x))
- return ADDRESS_CONST_INT;
- return ADDRESS_INVALID;
+ info->type = ADDRESS_CONST_INT;
+ return !TARGET_MIPS16 && SMALL_INT (x);
case CONST:
case LABEL_REF:
case SYMBOL_REF:
- if (mips_classify_constant (&info->c, x) == CONSTANT_SYMBOLIC
- && mips_symbolic_address_p (info->c.symbol, info->c.offset,
- mode, lea_p))
- return ADDRESS_SYMBOLIC;
- return ADDRESS_INVALID;
-
- default:
- return ADDRESS_INVALID;
- }
-}
-
-/* Return true if symbols of the given type can be split into a
- high part and a LO_SUM. In the case of small data symbols,
- the high part will be $gp. */
-
-static bool
-mips_splittable_symbol_p (enum mips_symbol_type type, HOST_WIDE_INT offset)
-{
- switch (type)
- {
- case SYMBOL_GENERAL:
- return TARGET_EXPLICIT_RELOCS || mips_split_addresses;
-
- case SYMBOL_GOT_LOCAL:
- return TARGET_EXPLICIT_RELOCS && SMALL_OPERAND (offset);
-
- case SYMBOL_SMALL_DATA:
- return ((TARGET_EXPLICIT_RELOCS || TARGET_MIPS16)
- && (offset == 0
- || (offset > 0 && offset <= mips_section_threshold)));
+ info->type = ADDRESS_SYMBOLIC;
+ return (mips_symbolic_constant_p (x, &info->symbol_type)
+ && mips_symbolic_address_p (info->symbol_type, mode)
+ && !mips_split_p[info->symbol_type]);
default:
return false;
}
}
-
-
+
/* Return the number of instructions needed to load a symbol of the
given type into a register. If valid in an address, the same number
of instructions are needed for loads and stores. Treat extended
@@ -1103,6 +1046,11 @@ mips_symbol_insns (enum mips_symbol_type type)
switch (type)
{
case SYMBOL_GENERAL:
+ /* In mips16 code, general symbols must be fetched from the
+ constant pool. */
+ if (TARGET_MIPS16)
+ return 0;
+
/* When using 64-bit symbols, we need 5 preparatory instructions,
such as:
@@ -1124,17 +1072,6 @@ mips_symbol_insns (enum mips_symbol_type type)
extended instruction. */
return 2;
- case SYMBOL_GOT_GLOBAL:
- /* When using a small GOT, we just fetch the address using
- a gp-relative load. For a big GOT, we need a sequence
- such as:
-
- lui $at,%got_hi(symbol)
- daddu $at,$at,$gp
-
- and the final address is $at + %got_lo(symbol). */
- return (TARGET_XGOT ? 3 : 1);
-
case SYMBOL_GOT_LOCAL:
/* For o32 and o64, the sequence is:
@@ -1146,6 +1083,24 @@ mips_symbol_insns (enum mips_symbol_type type)
of GAS insert a nop in the n32/n64 sequences too so, for
simplicity, use the worst case of 3 instructions. */
return 3;
+
+ case SYMBOL_GOT_GLOBAL:
+ /* When using a small GOT, we just fetch the address using
+ a gp-relative load. For a big GOT, we need a sequence
+ such as:
+
+ lui $at,%got_hi(symbol)
+ daddu $at,$at,$gp
+
+ and the final address is $at + %got_lo(symbol). */
+ return (TARGET_XGOT ? 3 : 1);
+
+ case SYMBOL_GOTOFF_PAGE:
+ case SYMBOL_GOTOFF_GLOBAL:
+ case SYMBOL_GOTOFF_CALL:
+ case SYMBOL_GOTOFF_LOADGP:
+ /* Check whether the offset is a 16- or 32-bit value. */
+ return mips_split_p[type] ? 2 : 1;
}
abort ();
}
@@ -1189,27 +1144,25 @@ mips_address_insns (rtx x, enum machine_mode mode)
/* Each word of a multi-word value will be accessed individually. */
factor = (GET_MODE_SIZE (mode) + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
- switch (mips_classify_address (&addr, x, mode, 0, 0))
- {
- case ADDRESS_INVALID:
- return 0;
-
- case ADDRESS_REG:
- if (TARGET_MIPS16
- && !mips16_unextended_reference_p (mode, addr.reg, addr.offset))
- return factor * 2;
- return factor;
+ if (mips_classify_address (&addr, x, mode, false))
+ switch (addr.type)
+ {
+ case ADDRESS_REG:
+ if (TARGET_MIPS16
+ && !mips16_unextended_reference_p (mode, addr.reg, addr.offset))
+ return factor * 2;
+ return factor;
- case ADDRESS_LO_SUM:
- return (TARGET_MIPS16 ? factor * 2 : factor);
+ case ADDRESS_LO_SUM:
+ return (TARGET_MIPS16 ? factor * 2 : factor);
- case ADDRESS_CONST_INT:
- return factor;
+ case ADDRESS_CONST_INT:
+ return factor;
- case ADDRESS_SYMBOLIC:
- return factor * mips_symbol_insns (mips_classify_symbol (addr.c.symbol));
- }
- abort ();
+ case ADDRESS_SYMBOLIC:
+ return factor * mips_symbol_insns (addr.symbol_type);
+ }
+ return 0;
}
@@ -1218,13 +1171,21 @@ mips_address_insns (rtx x, enum machine_mode mode)
int
mips_const_insns (rtx x)
{
- struct mips_constant_info c;
struct mips_integer_op codes[MIPS_MAX_INTEGER_OPS];
+ enum mips_symbol_type symbol_type;
+ HOST_WIDE_INT offset;
switch (GET_CODE (x))
{
case CONSTANT_P_RTX:
+ return 1;
+
case HIGH:
+ if (TARGET_MIPS16
+ || !mips_symbolic_constant_p (XEXP (x, 0), &symbol_type)
+ || !mips_split_p[symbol_type])
+ return 0;
+
return 1;
case CONST_INT:
@@ -1244,20 +1205,37 @@ mips_const_insns (rtx x)
case CONST_DOUBLE:
return (!TARGET_MIPS16 && x == CONST0_RTX (GET_MODE (x)) ? 1 : 0);
- default:
- switch (mips_classify_constant (&c, x))
+ case CONST:
+ if (CONST_GP_P (x))
+ return 1;
+
+ /* See if we can refer to X directly. */
+ if (mips_symbolic_constant_p (x, &symbol_type))
+ return mips_symbol_insns (symbol_type);
+
+ /* Otherwise try splitting the constant into a base and offset.
+ 16-bit offsets can be added using an extra addiu. Larger offsets
+ must be calculated separately and then added to the base. */
+ mips_split_const (x, &x, &offset);
+ if (offset != 0)
{
- case CONSTANT_NONE:
- return 0;
+ int n = mips_const_insns (x);
+ if (n != 0)
+ {
+ if (SMALL_OPERAND (offset))
+ return n + 1;
+ else
+ return n + 1 + mips_build_integer (codes, offset);
+ }
+ }
+ return 0;
- case CONSTANT_GP:
- case CONSTANT_RELOC:
- return 1;
+ case SYMBOL_REF:
+ case LABEL_REF:
+ return mips_symbol_insns (mips_classify_symbol (x));
- case CONSTANT_SYMBOLIC:
- return mips_symbol_insns (mips_classify_symbol (c.symbol));
- }
- abort ();
+ default:
+ return 0;
}
}
@@ -1275,19 +1253,6 @@ mips_fetch_insns (rtx x)
}
-/* Return true if OP is a symbolic constant that refers to a
- global PIC symbol. */
-
-bool
-mips_global_pic_constant_p (rtx op)
-{
- struct mips_constant_info c;
-
- return (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC
- && mips_classify_symbol (c.symbol) == SYMBOL_GOT_GLOBAL);
-}
-
-
/* Return truth value of whether OP can be used as an operands
where a register or 16 bit unsigned integer is needed. */
@@ -1306,10 +1271,7 @@ uns_arith_operand (rtx op, enum machine_mode mode)
int
const_arith_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
- struct mips_constant_info c;
-
- return ((GET_CODE (op) == CONST_INT && SMALL_INT (op))
- || mips_classify_constant (&c, op) == CONSTANT_RELOC);
+ return GET_CODE (op) == CONST_INT && SMALL_INT (op);
}
@@ -1477,10 +1439,10 @@ pc_or_label_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
int
call_insn_operand (rtx op, enum machine_mode mode)
{
- struct mips_constant_info c;
+ enum mips_symbol_type symbol_type;
- if (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC)
- switch (mips_classify_symbol (c.symbol))
+ if (mips_symbolic_constant_p (op, &symbol_type))
+ switch (symbol_type)
{
case SYMBOL_GENERAL:
/* If -mlong-calls, force all calls to use register addressing. */
@@ -1492,7 +1454,7 @@ call_insn_operand (rtx op, enum machine_mode mode)
Using "la $25,foo; jal $25" would prevent the lazy binding
of "foo", so keep the address of global symbols with the
jal macro. */
- return c.offset == 0 && !TARGET_EXPLICIT_RELOCS;
+ return !TARGET_EXPLICIT_RELOCS;
default:
return false;
@@ -1507,15 +1469,35 @@ call_insn_operand (rtx op, enum machine_mode mode)
int
move_operand (rtx op, enum machine_mode mode)
{
- struct mips_constant_info c;
+ enum mips_symbol_type symbol_type;
- if (GET_CODE (op) == HIGH && TARGET_ABICALLS)
+ if (!general_operand (op, mode))
return false;
- if (GET_CODE (op) == CONST_INT && !TARGET_MIPS16)
- return (SMALL_INT (op) || SMALL_INT_UNSIGNED (op) || LUI_INT (op));
- if (mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC)
- return mips_symbolic_address_p (c.symbol, c.offset, word_mode, 1);
- return general_operand (op, mode);
+
+ switch (GET_CODE (op))
+ {
+ case CONST_INT:
+ /* When generating mips16 code, LEGITIMATE_CONSTANT_P rejects
+ CONST_INTs that can't be loaded using simple insns. */
+ if (TARGET_MIPS16)
+ return true;
+
+ /* Otherwise check whether the constant can be loaded in a single
+ instruction. */
+ return LUI_INT (op) || SMALL_INT (op) || SMALL_INT_UNSIGNED (op);
+
+ case CONST:
+ case SYMBOL_REF:
+ case LABEL_REF:
+ if (CONST_GP_P (op))
+ return true;
+
+ return (mips_symbolic_constant_p (op, &symbol_type)
+ && !mips_split_p[symbol_type]);
+
+ default:
+ return true;
+ }
}
@@ -1536,9 +1518,35 @@ consttable_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
int
symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
- struct mips_constant_info c;
+ enum mips_symbol_type symbol_type;
+
+ return mips_symbolic_constant_p (op, &symbol_type);
+}
+
+
+/* Return true if we're generating PIC and OP is a global symbol. */
+
+int
+global_got_operand (rtx op, enum machine_mode mode)
+{
+ enum mips_symbol_type symbol_type;
+
+ return ((mode == VOIDmode || mode == GET_MODE (op))
+ && mips_symbolic_constant_p (op, &symbol_type)
+ && symbol_type == SYMBOL_GOT_GLOBAL);
+}
+
+
+/* Likewise for local symbols. */
+
+int
+local_got_operand (rtx op, enum machine_mode mode)
+{
+ enum mips_symbol_type symbol_type;
- return mips_classify_constant (&c, op) == CONSTANT_SYMBOLIC;
+ return ((mode == VOIDmode || mode == GET_MODE (op))
+ && mips_symbolic_constant_p (op, &symbol_type)
+ && symbol_type == SYMBOL_GOT_LOCAL);
}
@@ -1552,8 +1560,8 @@ stack_operand (rtx op, enum machine_mode mode)
return ((mode == VOIDmode || mode == GET_MODE (op))
&& GET_CODE (op) == MEM
- && mips_classify_address (&addr, XEXP (op, 0),
- GET_MODE (op), false, true) == ADDRESS_REG
+ && mips_classify_address (&addr, XEXP (op, 0), GET_MODE (op), false)
+ && addr.type == ADDRESS_REG
&& addr.reg == stack_pointer_rtx);
}
@@ -1568,199 +1576,138 @@ mips_legitimate_address_p (enum machine_mode mode, rtx x, int strict)
{
struct mips_address_info addr;
- return mips_classify_address (&addr, x, mode, strict, 0) != ADDRESS_INVALID;
+ return mips_classify_address (&addr, x, mode, strict);
}
-/* Return an rtx that represents the effect of applying relocation
- RELOC to symbolic address ADDR. */
+/* Copy VALUE to a register and return that register. If new psuedos
+ are allowed, copy it into a new register, otherwise use DEST. */
static rtx
-mips_reloc (rtx addr, int reloc)
+mips_force_temporary (rtx dest, rtx value)
{
- struct mips_constant_info c;
- rtx x;
-
- if (mips_classify_constant (&c, addr) != CONSTANT_SYMBOLIC)
- abort ();
-
- x = gen_rtx_UNSPEC (VOIDmode, gen_rtvec (1, c.symbol), reloc);
- return plus_constant (gen_rtx_CONST (VOIDmode, x), c.offset);
+ if (!no_new_pseudos)
+ return force_reg (Pmode, value);
+ else
+ {
+ emit_move_insn (copy_rtx (dest), value);
+ return dest;
+ }
}
-/* Likewise, but shift the result left 16 bits. The expression can be
- used as the right hand side of an LUISI or LUIDI pattern. */
+/* Return a LO_SUM expression for ADDR. TEMP is as for mips_force_temporary
+ and is used to load the high part into a register. */
static rtx
-mips_lui_reloc (rtx addr, int reloc)
+mips_split_symbol (rtx temp, rtx addr)
{
- return gen_rtx_UNSPEC (Pmode,
- gen_rtvec (1, mips_reloc (addr, reloc)),
- UNSPEC_HIGH);
+ rtx high;
+
+ if (TARGET_MIPS16)
+ high = mips16_gp_pseudo_reg ();
+ else
+ high = mips_force_temporary (temp, gen_rtx_HIGH (Pmode, copy_rtx (addr)));
+ return gen_rtx_LO_SUM (Pmode, high, addr);
}
-/* Copy VALUE to a register and return that register. Use DEST as the
- register if non-null, otherwise create a new one.
- VALUE must be valid on the right hand side of a simple SET pattern.
- The operation happens in Pmode. */
+/* Return an UNSPEC address with underlying address ADDRESS and symbol
+ type SYMBOL_TYPE. */
static rtx
-mips_force_temporary (rtx dest, rtx value)
+mips_unspec_address (rtx address, enum mips_symbol_type symbol_type)
{
- if (dest == 0)
- return force_reg (Pmode, value);
- else
- {
- if (!rtx_equal_p (dest, value))
- emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (dest), value));
- return dest;
- }
+ rtx base;
+ HOST_WIDE_INT offset;
+
+ mips_split_const (address, &base, &offset);
+ base = gen_rtx_UNSPEC (Pmode, gen_rtvec (1, base),
+ UNSPEC_ADDRESS_FIRST + symbol_type);
+ return plus_constant (gen_rtx_CONST (Pmode, base), offset);
}
-/* Return a legitimate address for REG + OFFSET. This function will
- create a temporary register if OFFSET is not a SMALL_OPERAND. */
+/* If mips_unspec_address (ADDR, SYMBOL_TYPE) is a 32-bit value, add the
+ high part to BASE and return the result. Just return BASE otherwise.
+
+ The returned expression can be used as the first operand to a LO_SUM. */
static rtx
-mips_add_offset (rtx reg, HOST_WIDE_INT offset)
+mips_unspec_offset_high (rtx base, rtx addr, enum mips_symbol_type symbol_type)
{
- if (!SMALL_OPERAND (offset))
- reg = expand_simple_binop (GET_MODE (reg), PLUS,
- GEN_INT (CONST_HIGH_PART (offset)),
- reg, NULL, 0, OPTAB_WIDEN);
-
- return plus_constant (reg, CONST_LOW_PART (offset));
+ if (mips_split_p[symbol_type])
+ {
+ addr = gen_rtx_HIGH (Pmode, mips_unspec_address (addr, symbol_type));
+ base = force_reg (Pmode, expand_simple_binop (Pmode, PLUS, base, addr,
+ NULL, 0, OPTAB_WIDEN));
+ }
+ return base;
}
-/* Return the GOT entry whose address is given by %RELOC(ADDR)(BASE).
- BASE is a base register (such as $gp), ADDR is addresses being
- sought and RELOC is the relocation that should be used. */
+/* Return a memory reference for the GOT slot whose offset is given by
+ mips_unspec_address (ADDR, SYMBOL_TYPE). Register BASE contains the
+ high part of the offset plus $gp. */
static rtx
-mips_load_got (rtx base, rtx addr, int reloc)
+mips_load_got (rtx base, rtx addr, enum mips_symbol_type symbol_type)
{
- rtx mem;
+ rtx mem, offset;
- mem = gen_rtx_MEM (ptr_mode,
- gen_rtx_PLUS (Pmode, base, mips_reloc (addr, reloc)));
+ offset = mips_unspec_address (addr, symbol_type);
+ mem = gen_rtx_MEM (ptr_mode, gen_rtx_LO_SUM (Pmode, base, offset));
set_mem_alias_set (mem, mips_got_alias_set);
- /* GOT references can't trap. */
+ /* GOT entries are constant and references to them can't trap. */
+ RTX_UNCHANGING_P (mem) = 1;
MEM_NOTRAP_P (mem) = 1;
- /* If we allow a function's address to be lazily bound, its entry
- may change after the first call. Other entries are constant. */
- if (reloc != RELOC_CALL16 && reloc != RELOC_CALL_LO)
- RTX_UNCHANGING_P (mem) = 1;
-
return mem;
}
-/* Obtain the address of ADDR from the GOT using relocation RELOC.
- The returned address may be used on the right hand side of a SET. */
+/* Return the offset of ADDR's GOT entry from _gp. ADDR is a
+ global_got_operand. */
-static rtx
-mips_load_got16 (rtx addr, int reloc)
+rtx
+mips_gotoff_global (rtx addr)
{
- return mips_load_got (pic_offset_table_rtx, addr, reloc);
+ return mips_unspec_address (addr, SYMBOL_GOTOFF_GLOBAL);
}
-/* Like mips_load_got16, but for 32-bit offsets. HIGH_RELOC is the
- relocation that gives the high 16 bits of the offset and LOW_RELOC is
- the relocation that gives the low 16 bits. TEMP is a Pmode register
- to use a temporary, or null if new registers can be created at will. */
+/* Fetch the high part of local_got_operand ADDR from the GOT. */
-static rtx
-mips_load_got32 (rtx temp, rtx addr, int high_reloc, int low_reloc)
+rtx
+mips_load_got_page (rtx addr)
{
- rtx x;
-
- x = mips_force_temporary (temp, mips_lui_reloc (addr, high_reloc));
- x = mips_force_temporary (temp,
- gen_rtx_PLUS (Pmode, pic_offset_table_rtx, x));
- return mips_load_got (x, addr, low_reloc);
+ return mips_load_got (pic_offset_table_rtx, addr, SYMBOL_GOTOFF_PAGE);
}
-/* Copy the high part of ADDR into a register and return the register.
- Use DEST as the register if non-null. */
+/* Fetch the address of global_got_operand ADDR from the GOT. BASE is a
+ register that holds the address _gp + %got_hi(ADDR). */
-static rtx
-mips_emit_high (rtx dest, rtx addr)
+rtx
+mips_load_got_global (rtx base, rtx addr)
{
- rtx high, x;
-
- high = gen_rtx_HIGH (Pmode, addr);
- if (TARGET_ABICALLS)
- {
- x = mips_load_got16 (copy_rtx (addr), RELOC_GOT_PAGE);
- x = mips_force_temporary (dest, x);
- set_unique_reg_note (get_last_insn (), REG_EQUAL, high);
- }
- else
- x = mips_force_temporary (dest, high);
-
- return x;
+ return mips_load_got (base, addr, SYMBOL_GOTOFF_GLOBAL);
}
-/* See if *XLOC is a symbolic constant that can be reduced in some way.
- If it is, set *XLOC to the reduced expression and return true.
- The new expression will be both a legitimate address and a legitimate
- source operand for a mips.md SET pattern. If OFFSETABLE_P, the
- address will be offsetable.
-
- DEST is a register to use a temporary, or null if new registers
- can be created at will. */
+/* Return a legitimate address for REG + OFFSET. This function will
+ create a temporary register if OFFSET is not a SMALL_OPERAND. */
-static bool
-mips_legitimize_symbol (rtx dest, rtx *xloc, int offsetable_p)
+static rtx
+mips_add_offset (rtx reg, HOST_WIDE_INT offset)
{
- struct mips_constant_info c;
- enum mips_symbol_type symbol_type;
- rtx x;
-
- if (mips_classify_constant (&c, *xloc) != CONSTANT_SYMBOLIC)
- return false;
-
- symbol_type = mips_classify_symbol (c.symbol);
-
- /* If a non-offsetable address is OK, try splitting it into a
- high part and a LO_SUM. */
- if (!offsetable_p && mips_splittable_symbol_p (symbol_type, c.offset))
- {
- if (symbol_type == SYMBOL_SMALL_DATA)
- x = mips_sdata_pointer ();
- else
- x = mips_emit_high (dest, *xloc);
- if (x != 0)
- {
- *xloc = gen_rtx_LO_SUM (Pmode, x, copy_rtx (*xloc));
- return true;
- }
- }
-
- /* If the offset is nonzero, move the symbol into a register (always valid)
- and add the constant in afterwards. This requires an extra temporary if
- the offset isn't a signed 16-bit number.
-
- For mips16, it's better to force the constant into memory instead. */
- if (!TARGET_MIPS16
- && c.offset != 0
- && (SMALL_OPERAND (c.offset) || dest == 0))
- {
- x = (dest == 0 ? gen_reg_rtx (Pmode) : dest);
- emit_move_insn (copy_rtx (x), c.symbol);
- *xloc = mips_add_offset (x, c.offset);
- return true;
- }
+ if (!SMALL_OPERAND (offset))
+ reg = expand_simple_binop (GET_MODE (reg), PLUS,
+ GEN_INT (CONST_HIGH_PART (offset)),
+ reg, NULL, 0, OPTAB_WIDEN);
- return false;
+ return plus_constant (reg, CONST_LOW_PART (offset));
}
@@ -1772,8 +1719,16 @@ mips_legitimize_symbol (rtx dest, rtx *xloc, int offsetable_p)
bool
mips_legitimize_address (rtx *xloc, enum machine_mode mode)
{
- if (mips_legitimize_symbol (0, xloc, !SINGLE_WORD_MODE_P (mode)))
- return true;
+ enum mips_symbol_type symbol_type;
+
+ /* See if the address can split into a high part and a LO_SUM. */
+ if (mips_symbolic_constant_p (*xloc, &symbol_type)
+ && mips_symbolic_address_p (symbol_type, mode)
+ && mips_split_p[symbol_type])
+ {
+ *xloc = mips_split_symbol (0, *xloc);
+ return true;
+ }
if (GET_CODE (*xloc) == PLUS && GET_CODE (XEXP (*xloc, 1)) == CONST_INT)
{
@@ -1929,54 +1884,48 @@ mips_move_integer (rtx dest, unsigned HOST_WIDE_INT value)
static void
mips_legitimize_const_move (enum machine_mode mode, rtx dest, rtx src)
{
- rtx temp;
-
- temp = no_new_pseudos ? dest : 0;
-
- /* If generating PIC, the high part of an address is loaded from the GOT. */
- if (GET_CODE (src) == HIGH)
- {
- mips_emit_high (dest, XEXP (src, 0));
- return;
- }
+ rtx base;
+ HOST_WIDE_INT offset;
+ enum mips_symbol_type symbol_type;
+ /* Split moves of big integers into smaller pieces. In mips16 code,
+ it's better to force the constant into memory instead. */
if (GET_CODE (src) == CONST_INT && !TARGET_MIPS16)
{
mips_move_integer (dest, INTVAL (src));
return;
}
- /* Fetch global symbols from the GOT. */
- if (TARGET_EXPLICIT_RELOCS
- && GET_CODE (src) == SYMBOL_REF
- && mips_classify_symbol (src) == SYMBOL_GOT_GLOBAL)
+ /* See if the symbol can be split. For mips16, this is often worse than
+ forcing it in the constant pool since it needs the single-register form
+ of addiu or daddiu. */
+ if (!TARGET_MIPS16
+ && mips_symbolic_constant_p (src, &symbol_type)
+ && mips_split_p[symbol_type])
{
- if (TARGET_XGOT)
- src = mips_load_got32 (temp, src, RELOC_GOT_HI, RELOC_GOT_LO);
- else
- src = mips_load_got16 (src, RELOC_GOT_DISP);
- emit_insn (gen_rtx_SET (VOIDmode, dest, src));
+ emit_move_insn (dest, mips_split_symbol (dest, src));
return;
}
- /* Try handling the source operand as a symbolic address. */
- if (mips_legitimize_symbol (temp, &src, false))
+ /* If we have (const (plus symbol offset)), load the symbol first
+ and then add in the offset. This is usually better than forcing
+ the constant into memory, at least in non-mips16 code. */
+ mips_split_const (src, &base, &offset);
+ if (!TARGET_MIPS16
+ && offset != 0
+ && (!no_new_pseudos || SMALL_OPERAND (offset)))
{
- emit_insn (gen_rtx_SET (VOIDmode, dest, src));
+ base = mips_force_temporary (dest, base);
+ emit_move_insn (dest, mips_add_offset (base, offset));
return;
}
src = force_const_mem (mode, src);
/* When using explicit relocs, constant pool references are sometimes
- not legitimate addresses. mips_legitimize_symbol must be able to
- deal with all such cases. */
- if (GET_CODE (src) == MEM && !memory_operand (src, VOIDmode))
- {
- src = copy_rtx (src);
- if (!mips_legitimize_symbol (temp, &XEXP (src, 0), false))
- abort ();
- }
+ not legitimate addresses. */
+ if (!memory_operand (src, VOIDmode))
+ src = replace_equiv_address (src, mips_split_symbol (dest, XEXP (src, 0)));
emit_move_insn (dest, src);
}
@@ -2007,30 +1956,6 @@ mips_legitimize_move (enum machine_mode mode, rtx dest, rtx src)
}
return false;
}
-
-
-/* Convert GOT and GP-relative accesses back into their original form.
- Used by both TARGET_DELEGITIMIZE_ADDRESS and FIND_BASE_TERM. */
-
-rtx
-mips_delegitimize_address (rtx x)
-{
- struct mips_constant_info c;
-
- if (GET_CODE (x) == MEM
- && GET_CODE (XEXP (x, 0)) == PLUS
- && mips_classify_constant (&c, XEXP (XEXP (x, 0), 1)) == CONSTANT_RELOC
- && mips_classify_symbol (c.symbol) == SYMBOL_GOT_GLOBAL)
- return c.symbol;
-
- if (GET_CODE (x) == LO_SUM
- && XEXP (x, 0) == (TARGET_MIPS16
- ? cfun->machine->mips16_gp_pseudo_rtx
- : pic_offset_table_rtx))
- return XEXP (x, 1);
-
- return x;
-}
/* We need a lot of little routines to check constant values on the
mips16. These are used to figure out how long the instruction will
@@ -2257,17 +2182,17 @@ mips_rtx_costs (rtx x, int code, int outer_code, int *total)
case SYMBOL_REF:
case LABEL_REF:
case CONST_DOUBLE:
- if (((outer_code) == PLUS || (outer_code) == MINUS)
- && const_arith_operand (x, VOIDmode))
- {
- *total = 0;
- return true;
- }
+ if (LEGITIMATE_CONSTANT_P (x))
+ {
+ *total = COSTS_N_INSNS (1);
+ return true;
+ }
else
- {
- int n = mips_const_insns (x);
- return (n == 0 ? CONSTANT_POOL_COST : COSTS_N_INSNS (n));
- }
+ {
+ /* The value will need to be fetched from the constant pool. */
+ *total = CONSTANT_POOL_COST;
+ return true;
+ }
case MEM:
{
@@ -2554,7 +2479,7 @@ mips_subword (rtx op, int high_p)
}
if (GET_CODE (op) == MEM)
- return adjust_address (op, word_mode, byte);
+ return mips_rewrite_small_data (adjust_address (op, word_mode, byte));
return simplify_gen_subreg (word_mode, op, mode, byte);
}
@@ -2644,7 +2569,6 @@ const char *
mips_output_move (rtx dest, rtx src)
{
enum rtx_code dest_code, src_code;
- struct mips_constant_info c;
bool dbl_p;
dest_code = GET_CODE (dest);
@@ -2721,20 +2645,11 @@ mips_output_move (rtx dest, rtx src)
if (src_code == HIGH)
return "lui\t%0,%h1";
- switch (mips_classify_constant (&c, src))
- {
- case CONSTANT_NONE:
- break;
-
- case CONSTANT_GP:
- return "move\t%0,%1";
-
- case CONSTANT_RELOC:
- return "li\t%0,%1";
+ if (CONST_GP_P (src))
+ return "move\t%0,%1";
- case CONSTANT_SYMBOLIC:
- return (dbl_p ? "dla\t%0,%a1" : "la\t%0,%a1");
- }
+ if (symbolic_operand (src, VOIDmode))
+ return (dbl_p ? "dla\t%0,%1" : "la\t%0,%1");
}
if (src_code == REG && FP_REG_P (REGNO (src)))
{
@@ -3273,18 +3188,27 @@ mips_expand_call (rtx result, rtx addr, rtx args_size, rtx aux, int sibcall_p)
{
if (!call_insn_operand (addr, VOIDmode))
{
- /* When generating PIC, try to allow global functions to be
- lazily bound. */
+ /* If we're generating PIC, and this call is to a global function,
+ try to allow its address to be resolved lazily. This isn't
+ possible for NewABI sibcalls since the value of $gp on entry
+ to the stub would be our caller's gp, not ours. */
if (TARGET_EXPLICIT_RELOCS
- && GET_CODE (addr) == SYMBOL_REF
- && mips_classify_symbol (addr) == SYMBOL_GOT_GLOBAL)
+ && !(sibcall_p && TARGET_NEWABI)
+ && global_got_operand (addr, VOIDmode))
{
- if (TARGET_XGOT)
- addr = mips_load_got32 (0, addr, RELOC_CALL_HI, RELOC_CALL_LO);
+ rtx high, lo_sum_symbol;
+
+ high = mips_unspec_offset_high (pic_offset_table_rtx,
+ addr, SYMBOL_GOTOFF_CALL);
+ lo_sum_symbol = mips_unspec_address (addr, SYMBOL_GOTOFF_CALL);
+ addr = gen_reg_rtx (Pmode);
+ if (Pmode == SImode)
+ emit_insn (gen_load_callsi (addr, high, lo_sum_symbol));
else
- addr = mips_load_got16 (addr, RELOC_CALL16);
+ emit_insn (gen_load_calldi (addr, high, lo_sum_symbol));
}
- addr = force_reg (Pmode, addr);
+ else
+ addr = force_reg (Pmode, addr);
}
if (TARGET_MIPS16
@@ -3982,16 +3906,15 @@ mips_setup_incoming_varargs (const CUMULATIVE_ARGS *cum,
and two offsets, although we could have designed this with two pointers
and three offsets. */
-
-tree
-mips_build_va_list (void)
+static tree
+mips_build_builtin_va_list (void)
{
if (EABI_FLOAT_VARARGS_P)
{
tree f_ovfl, f_gtop, f_ftop, f_goff, f_foff, f_res, record;
tree array, index;
- record = make_node (RECORD_TYPE);
+ record = (*lang_hooks.types.make_type) (RECORD_TYPE);
f_ovfl = build_decl (FIELD_DECL, get_identifier ("__overflow_argptr"),
ptr_type_node);
@@ -4027,7 +3950,11 @@ mips_build_va_list (void)
layout_type (record);
return record;
}
+ else if (TARGET_IRIX && !TARGET_IRIX5)
+ /* On IRIX 6, this type is 'char *'. */
+ return build_pointer_type (char_type_node);
else
+ /* Otherwise, we use 'void *'. */
return ptr_type_node;
}
@@ -4678,6 +4605,7 @@ override_options (void)
switch ((int) mips_arch)
{
case PROCESSOR_R4100:
+ case PROCESSOR_R4111:
case PROCESSOR_R4120:
target_flags |= MASK_SOFT_FLOAT;
break;
@@ -4705,8 +4633,6 @@ override_options (void)
defaults for the N32/N64 ABIs. */
if (TARGET_IRIX && !TARGET_SGI_O32_AS)
{
- flag_gnu_linker = 1;
-
targetm.have_ctors_dtors = true;
targetm.asm_out.constructor = default_named_section_asm_out_constructor;
targetm.asm_out.destructor = default_named_section_asm_out_destructor;
@@ -4737,10 +4663,10 @@ override_options (void)
/* Adapt wording to IRIX version: IRIX 5 only had a single ABI,
so -mabi=32 isn't usually specified. */
if (TARGET_IRIX5)
- warning ("-g is only supported using GNU as,");
+ inform ("-g is only supported using GNU as,");
else
- warning ("-g is only supported using GNU as with -mabi=32,");
- warning ("-g option disabled");
+ inform ("-g is only supported using GNU as with -mabi=32,");
+ inform ("-g option disabled");
write_symbols = NO_DEBUG;
}
}
@@ -5028,6 +4954,68 @@ override_options (void)
/* Create a unique alias set for GOT references. */
mips_got_alias_set = new_alias_set ();
+
+ if (TARGET_EXPLICIT_RELOCS || mips_split_addresses)
+ {
+ mips_split_p[SYMBOL_GENERAL] = true;
+ mips_hi_relocs[SYMBOL_GENERAL] = "%hi(";
+ mips_lo_relocs[SYMBOL_GENERAL] = "%lo(";
+ }
+
+ if (TARGET_MIPS16)
+ {
+ /* The high part is provided by a pseudo copy of $gp. */
+ mips_split_p[SYMBOL_SMALL_DATA] = true;
+ mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gprel(";
+ }
+
+ if (TARGET_EXPLICIT_RELOCS)
+ {
+ /* Small data constants are kept whole until after reload,
+ then lowered by mips_rewrite_small_data. */
+ mips_lo_relocs[SYMBOL_SMALL_DATA] = "%gp_rel(";
+
+ mips_split_p[SYMBOL_GOT_LOCAL] = true;
+ if (TARGET_NEWABI)
+ {
+ mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got_page(";
+ mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%got_ofst(";
+ }
+ else
+ {
+ mips_lo_relocs[SYMBOL_GOTOFF_PAGE] = "%got(";
+ mips_lo_relocs[SYMBOL_GOT_LOCAL] = "%lo(";
+ }
+
+ if (TARGET_XGOT)
+ {
+ /* The HIGH and LO_SUM are matched by special .md patterns. */
+ mips_split_p[SYMBOL_GOT_GLOBAL] = true;
+
+ mips_split_p[SYMBOL_GOTOFF_GLOBAL] = true;
+ mips_hi_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_hi(";
+ mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_lo(";
+
+ mips_split_p[SYMBOL_GOTOFF_CALL] = true;
+ mips_hi_relocs[SYMBOL_GOTOFF_CALL] = "%call_hi(";
+ mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call_lo(";
+ }
+ else
+ {
+ if (TARGET_NEWABI)
+ mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got_disp(";
+ else
+ mips_lo_relocs[SYMBOL_GOTOFF_GLOBAL] = "%got(";
+ mips_lo_relocs[SYMBOL_GOTOFF_CALL] = "%call16(";
+ }
+ }
+
+ if (TARGET_NEWABI)
+ {
+ mips_split_p[SYMBOL_GOTOFF_LOADGP] = true;
+ mips_hi_relocs[SYMBOL_GOTOFF_LOADGP] = "%hi(%neg(%gp_rel(";
+ mips_lo_relocs[SYMBOL_GOTOFF_LOADGP] = "%lo(%neg(%gp_rel(";
+ }
}
/* Implement CONDITIONAL_REGISTER_USAGE. */
@@ -5208,8 +5196,6 @@ void
print_operand (FILE *file, rtx op, int letter)
{
register enum rtx_code code;
- struct mips_constant_info c;
- const char *reloc;
if (PRINT_OPERAND_PUNCT_VALID_P (letter))
{
@@ -5350,16 +5336,7 @@ print_operand (FILE *file, rtx op, int letter)
code = GET_CODE (op);
- if (letter == 'h')
- {
- if (GET_CODE (op) != HIGH)
- abort ();
- fputs ("%hi(", file);
- output_addr_const (file, XEXP (op, 0));
- fputc (')', file);
- }
-
- else if (letter == 'C')
+ if (letter == 'C')
switch (code)
{
case EQ: fputs ("eq", file); break;
@@ -5411,6 +5388,17 @@ print_operand (FILE *file, rtx op, int letter)
fatal_insn ("PRINT_OPERAND, invalid insn for %%W", op);
}
+ else if (letter == 'h')
+ {
+ if (GET_CODE (op) == HIGH)
+ op = XEXP (op, 0);
+
+ print_operand_reloc (file, op, mips_hi_relocs);
+ }
+
+ else if (letter == 'R')
+ print_operand_reloc (file, op, mips_lo_relocs);
+
else if (letter == 'S')
{
char buffer[100];
@@ -5483,62 +5471,40 @@ print_operand (FILE *file, rtx op, int letter)
else if (letter == 't')
fputs (code == EQ ? "t" : "f", file);
- else
- switch (mips_classify_constant (&c, op))
- {
- case CONSTANT_SYMBOLIC:
- if (letter == 'R')
- {
- if (mips_classify_symbol (c.symbol) == SYMBOL_SMALL_DATA)
- fputs (TARGET_MIPS16 ? "%gprel(" : "%gp_rel(", file);
- else if (TARGET_ABICALLS && TARGET_NEWABI)
- fputs ("%got_ofst(", file);
- else
- fputs ("%lo(", file);
- output_addr_const (file, op);
- fputc (')', file);
- break;
- }
- /* ... fall through ... */
+ else if (CONST_GP_P (op))
+ print_operand (file, XEXP (op, 0), letter);
- case CONSTANT_NONE:
- output_addr_const (file, op);
- break;
+ else
+ output_addr_const (file, op);
+}
- case CONSTANT_GP:
- fputs (reg_names[PIC_OFFSET_TABLE_REGNUM], file);
- break;
- case CONSTANT_RELOC:
- reloc = mips_reloc_string (c.reloc);
- fputs (reloc, file);
- output_addr_const (file, plus_constant (c.symbol, c.offset));
- while (*reloc != 0)
- if (*reloc++ == '(')
- fputc (')', file);
- }
-}
-
-/* Return the assembly operator used for the given type of relocation. */
+/* Print symbolic operand OP, which is part of a HIGH or LO_SUM.
+ RELOCS is the array of relocations to use. */
-static const char *
-mips_reloc_string (int reloc)
+static void
+print_operand_reloc (FILE *file, rtx op, const char **relocs)
{
- switch (reloc)
- {
- case RELOC_GOT_HI: return "%got_hi(";
- case RELOC_GOT_LO: return "%got_lo(";
- case RELOC_GOT_PAGE: return (TARGET_NEWABI ? "%got_page(" : "%got(");
- case RELOC_GOT_DISP: return (TARGET_NEWABI ? "%got_disp(" : "%got(");
- case RELOC_CALL16: return "%call16(";
- case RELOC_CALL_HI: return "%call_hi(";
- case RELOC_CALL_LO: return "%call_lo(";
- case RELOC_LOADGP_HI: return "%hi(%neg(%gp_rel(";
- case RELOC_LOADGP_LO: return "%lo(%neg(%gp_rel(";
- }
- abort ();
-}
+ enum mips_symbol_type symbol_type;
+ const char *p;
+ rtx base;
+ HOST_WIDE_INT offset;
+
+ if (!mips_symbolic_constant_p (op, &symbol_type) || relocs[symbol_type] == 0)
+ fatal_insn ("PRINT_OPERAND, invalid operand for relocation", op);
+ /* If OP uses an UNSPEC address, we want to print the inner symbol. */
+ mips_split_const (op, &base, &offset);
+ if (UNSPEC_ADDRESS_P (base))
+ op = plus_constant (UNSPEC_ADDRESS (base), offset);
+
+ fputs (relocs[symbol_type], file);
+ output_addr_const (file, op);
+ for (p = relocs[symbol_type]; *p != 0; p++)
+ if (*p == '(')
+ fputc (')', file);
+}
+
/* Output address operand X to FILE. */
void
@@ -5546,26 +5512,24 @@ print_operand_address (FILE *file, rtx x)
{
struct mips_address_info addr;
- switch (mips_classify_address (&addr, x, word_mode, 1, 1))
- {
- case ADDRESS_INVALID:
- abort ();
-
- case ADDRESS_REG:
- print_operand (file, addr.offset, 0);
- fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
- return;
+ if (mips_classify_address (&addr, x, word_mode, true))
+ switch (addr.type)
+ {
+ case ADDRESS_REG:
+ print_operand (file, addr.offset, 0);
+ fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
+ return;
- case ADDRESS_LO_SUM:
- print_operand (file, addr.offset, 'R');
- fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
- return;
+ case ADDRESS_LO_SUM:
+ print_operand (file, addr.offset, 'R');
+ fprintf (file, "(%s)", reg_names[REGNO (addr.reg)]);
+ return;
- case ADDRESS_CONST_INT:
- case ADDRESS_SYMBOLIC:
- output_addr_const (file, x);
- return;
- }
+ case ADDRESS_CONST_INT:
+ case ADDRESS_SYMBOLIC:
+ output_addr_const (file, x);
+ return;
+ }
abort ();
}
@@ -5611,14 +5575,7 @@ mips_output_external (FILE *file ATTRIBUTE_UNUSED, tree decl, const char *name)
extern_head = p;
}
- if (TARGET_IRIX && mips_abi == ABI_32
- && TREE_CODE (decl) == FUNCTION_DECL
- /* ??? Don't include alloca, since gcc will always expand it
- inline. If we don't do this, the C++ library fails to build. */
- && strcmp (name, "alloca")
- /* ??? Don't include __builtin_next_arg, because then gcc will not
- bootstrap under Irix 5.1. */
- && strcmp (name, "__builtin_next_arg"))
+ if (TARGET_IRIX && mips_abi == ABI_32 && TREE_CODE (decl) == FUNCTION_DECL)
{
p = (struct extern_list *) ggc_alloc (sizeof (struct extern_list));
p->next = extern_head;
@@ -5889,7 +5846,8 @@ mips_file_end (void)
name_tree = get_identifier (p->name);
/* Positively ensure only one .extern for any given symbol. */
- if (! TREE_ASM_WRITTEN (name_tree))
+ if (!TREE_ASM_WRITTEN (name_tree)
+ && TREE_SYMBOL_REFERENCED (name_tree))
{
TREE_ASM_WRITTEN (name_tree) = 1;
/* In IRIX 5 or IRIX 6 for the O32 ABI, we must output a
@@ -5987,6 +5945,93 @@ mips_finish_declare_object (FILE *stream, tree decl, int top_level, int at_end)
}
#endif
+/* Return true if X is a small data address that can be rewritten
+ as a LO_SUM. */
+
+static bool
+mips_rewrite_small_data_p (rtx x)
+{
+ enum mips_symbol_type symbol_type;
+
+ return (TARGET_EXPLICIT_RELOCS
+ && mips_symbolic_constant_p (x, &symbol_type)
+ && symbol_type == SYMBOL_SMALL_DATA);
+}
+
+
+/* A for_each_rtx callback for small_data_pattern. */
+
+static int
+small_data_pattern_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
+{
+ if (GET_CODE (*loc) == LO_SUM)
+ return -1;
+
+ return mips_rewrite_small_data_p (*loc);
+}
+
+/* Return true if OP refers to small data symbols directly, not through
+ a LO_SUM. */
+
+int
+small_data_pattern (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
+{
+ return (GET_CODE (op) != SEQUENCE
+ && for_each_rtx (&op, small_data_pattern_1, 0));
+}
+
+/* A for_each_rtx callback, used by mips_rewrite_small_data. */
+
+static int
+mips_rewrite_small_data_1 (rtx *loc, void *data ATTRIBUTE_UNUSED)
+{
+ if (mips_rewrite_small_data_p (*loc))
+ *loc = gen_rtx_LO_SUM (Pmode, pic_offset_table_rtx, *loc);
+
+ if (GET_CODE (*loc) == LO_SUM)
+ return -1;
+
+ return 0;
+}
+
+/* If possible, rewrite OP so that it refers to small data using
+ explicit relocations. */
+
+rtx
+mips_rewrite_small_data (rtx op)
+{
+ op = copy_insn (op);
+ for_each_rtx (&op, mips_rewrite_small_data_1, 0);
+ return op;
+}
+
+/* Return true if the current function has an insn that implicitly
+ refers to $gp. */
+
+static bool
+mips_function_has_gp_insn (void)
+{
+ /* Don't bother rechecking if we found one last time. */
+ if (!cfun->machine->has_gp_insn_p)
+ {
+ rtx insn;
+
+ push_topmost_sequence ();
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if (INSN_P (insn)
+ && GET_CODE (PATTERN (insn)) != USE
+ && GET_CODE (PATTERN (insn)) != CLOBBER
+ && (get_attr_got (insn) != GOT_UNSET
+ || small_data_pattern (PATTERN (insn), VOIDmode)))
+ break;
+ pop_topmost_sequence ();
+
+ cfun->machine->has_gp_insn_p = (insn != 0);
+ }
+ return cfun->machine->has_gp_insn_p;
+}
+
+
/* Return the register that should be used as the global pointer
within this function. Return 0 if the function doesn't need
a global pointer. */
@@ -6009,6 +6054,11 @@ mips_global_pointer (void)
if (current_function_profile)
return GLOBAL_POINTER_REGNUM;
+ /* If the function has a nonlocal goto, $gp must hold the correct
+ global pointer for the target function. */
+ if (current_function_has_nonlocal_goto)
+ return GLOBAL_POINTER_REGNUM;
+
/* If the gp is never referenced, there's no need to initialize it.
Note that reload can sometimes introduce constant pool references
into a function that otherwise didn't need them. For example,
@@ -6023,7 +6073,8 @@ mips_global_pointer (void)
In cases like these, reload will have added the constant to the pool
but no instruction will yet refer to it. */
if (!regs_ever_live[GLOBAL_POINTER_REGNUM]
- && !current_function_uses_const_pool)
+ && !current_function_uses_const_pool
+ && !mips_function_has_gp_insn ())
return 0;
/* We need a global pointer, but perhaps we can use a call-clobbered
@@ -6032,7 +6083,8 @@ mips_global_pointer (void)
for (regno = GP_REG_FIRST; regno <= GP_REG_LAST; regno++)
if (!regs_ever_live[regno]
&& call_used_regs[regno]
- && !fixed_regs[regno])
+ && !fixed_regs[regno]
+ && regno != PIC_FUNCTION_ADDR_REGNUM)
return regno;
return GLOBAL_POINTER_REGNUM;
@@ -6153,8 +6205,8 @@ compute_frame_size (HOST_WIDE_INT size)
HOST_WIDE_INT gp_reg_rounded; /* # bytes needed to store gp after rounding */
HOST_WIDE_INT gp_reg_size; /* # bytes needed to store gp regs */
HOST_WIDE_INT fp_reg_size; /* # bytes needed to store fp regs */
- long mask; /* mask of saved gp registers */
- long fmask; /* mask of saved fp registers */
+ unsigned int mask; /* mask of saved gp registers */
+ unsigned int fmask; /* mask of saved fp registers */
cfun->machine->global_pointer = mips_global_pointer ();
@@ -6187,7 +6239,7 @@ compute_frame_size (HOST_WIDE_INT size)
if (mips_save_reg_p (regno))
{
gp_reg_size += GET_MODE_SIZE (gpr_mode);
- mask |= 1L << (regno - GP_REG_FIRST);
+ mask |= 1 << (regno - GP_REG_FIRST);
}
/* We need to restore these for the handler. */
@@ -6200,7 +6252,7 @@ compute_frame_size (HOST_WIDE_INT size)
if (regno == INVALID_REGNUM)
break;
gp_reg_size += GET_MODE_SIZE (gpr_mode);
- mask |= 1L << (regno - GP_REG_FIRST);
+ mask |= 1 << (regno - GP_REG_FIRST);
}
}
@@ -6240,7 +6292,7 @@ compute_frame_size (HOST_WIDE_INT size)
if (mask)
{
- unsigned long offset;
+ HOST_WIDE_INT offset;
offset = (args_size + cprestore_size + var_size
+ gp_reg_size - GET_MODE_SIZE (gpr_mode));
@@ -6255,9 +6307,11 @@ compute_frame_size (HOST_WIDE_INT size)
if (fmask)
{
- unsigned long offset = (args_size + cprestore_size + var_size
- + gp_reg_rounded + fp_reg_size
- - FP_INC * UNITS_PER_FPREG);
+ HOST_WIDE_INT offset;
+
+ offset = (args_size + cprestore_size + var_size
+ + gp_reg_rounded + fp_reg_size
+ - FP_INC * UNITS_PER_FPREG);
cfun->machine->frame.fp_sp_offset = offset;
cfun->machine->frame.fp_save_offset = offset - total_size;
}
@@ -6275,10 +6329,10 @@ compute_frame_size (HOST_WIDE_INT size)
pointer or argument pointer. TO is either the stack pointer or
hard frame pointer. */
-int
+HOST_WIDE_INT
mips_initial_elimination_offset (int from, int to)
{
- int offset;
+ HOST_WIDE_INT offset;
compute_frame_size (get_frame_size ());
@@ -6423,12 +6477,15 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
{
/* .frame FRAMEREG, FRAMESIZE, RETREG */
fprintf (file,
- "\t.frame\t%s,%ld,%s\t\t# vars= %ld, regs= %d/%d, args= %ld, gp= %ld\n",
+ "\t.frame\t%s," HOST_WIDE_INT_PRINT_DEC ",%s\t\t"
+ "# vars= " HOST_WIDE_INT_PRINT_DEC ", regs= %d/%d"
+ ", args= " HOST_WIDE_INT_PRINT_DEC
+ ", gp= " HOST_WIDE_INT_PRINT_DEC "\n",
(reg_names[(frame_pointer_needed)
? HARD_FRAME_POINTER_REGNUM : STACK_POINTER_REGNUM]),
((frame_pointer_needed && TARGET_MIPS16)
- ? ((long) tsize - cfun->machine->frame.args_size)
- : (long) tsize),
+ ? tsize - cfun->machine->frame.args_size
+ : tsize),
reg_names[GP_REG_FIRST + 31],
cfun->machine->frame.var_size,
cfun->machine->frame.num_gp,
@@ -6437,9 +6494,10 @@ mips_output_function_prologue (FILE *file, HOST_WIDE_INT size ATTRIBUTE_UNUSED)
cfun->machine->frame.cprestore_size);
/* .mask MASK, GPOFFSET; .fmask FPOFFSET */
- fprintf (file, "\t.mask\t0x%08lx,%ld\n\t.fmask\t0x%08lx,%ld\n",
+ fprintf (file, "\t.mask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n",
cfun->machine->frame.mask,
- cfun->machine->frame.gp_save_offset,
+ cfun->machine->frame.gp_save_offset);
+ fprintf (file, "\t.fmask\t0x%08x," HOST_WIDE_INT_PRINT_DEC "\n",
cfun->machine->frame.fmask,
cfun->machine->frame.fp_save_offset);
@@ -6493,11 +6551,15 @@ mips_frame_set (rtx mem, rtx reg)
static void
mips_save_reg (rtx reg, rtx mem)
{
- if (GET_MODE (reg) == DFmode && mips_split_64bit_move_p (mem, reg))
+ if (GET_MODE (reg) == DFmode && !TARGET_FLOAT64)
{
rtx x1, x2;
- mips_split_64bit_move (mem, reg);
+ if (mips_split_64bit_move_p (mem, reg))
+ mips_split_64bit_move (mem, reg);
+ else
+ emit_move_insn (mem, reg);
+
x1 = mips_frame_set (mips_subword (mem, 0), mips_subword (reg, 0));
x2 = mips_frame_set (mips_subword (mem, 1), mips_subword (reg, 1));
mips_set_frame_expr (gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, x1, x2)));
@@ -6522,26 +6584,6 @@ mips_save_reg (rtx reg, rtx mem)
}
-/* Emit an instruction to move SRC into DEST. When generating
- explicit reloc code, mark the instruction as potentially dead. */
-
-static void
-mips_gp_insn (rtx dest, rtx src)
-{
- rtx insn;
-
- insn = emit_insn (gen_rtx_SET (VOIDmode, dest, src));
- if (TARGET_EXPLICIT_RELOCS)
- {
- /* compute_frame_size assumes that any function which uses the
- constant pool will need a gp. However, all constant
- pool references could be eliminated, in which case
- it is OK for flow to delete the gp load as well. */
- REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_MAYBE_DEAD, const0_rtx,
- REG_NOTES (insn));
- }
-}
-
/* Expand the prologue into a bunch of separate insns. */
void
@@ -6609,7 +6651,7 @@ mips_expand_prologue (void)
/* Set up the frame pointer, if we're using one. In mips16 code,
we point the frame pointer ahead of the outgoing argument area.
This should allow more variables & incoming arguments to be
- acceesed with unextended instructions. */
+ accessed with unextended instructions. */
if (frame_pointer_needed)
{
if (TARGET_MIPS16 && cfun->machine->frame.args_size != 0)
@@ -6632,19 +6674,12 @@ mips_expand_prologue (void)
/* If generating n32/n64 abicalls, emit the instructions to load $gp. */
if (TARGET_ABICALLS && TARGET_NEWABI && cfun->machine->global_pointer > 0)
{
- rtx fnsymbol, fnaddr;
-
- fnsymbol = XEXP (DECL_RTL (current_function_decl), 0);
- fnaddr = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
-
- mips_gp_insn (MIPS_PROLOGUE_TEMP (Pmode),
- mips_lui_reloc (fnsymbol, RELOC_LOADGP_HI));
- mips_gp_insn (MIPS_PROLOGUE_TEMP (Pmode),
- gen_rtx_PLUS (Pmode, MIPS_PROLOGUE_TEMP (Pmode), fnaddr));
- mips_gp_insn (pic_offset_table_rtx,
- gen_rtx_PLUS (Pmode, MIPS_PROLOGUE_TEMP (Pmode),
- mips_reloc (fnsymbol, RELOC_LOADGP_LO)));
+ rtx addr, offset, incoming_address;
+ addr = XEXP (DECL_RTL (current_function_decl), 0);
+ offset = mips_unspec_address (addr, SYMBOL_GOTOFF_LOADGP);
+ incoming_address = gen_rtx_REG (Pmode, PIC_FUNCTION_ADDR_REGNUM);
+ emit_insn (gen_loadgp (offset, incoming_address));
if (!TARGET_EXPLICIT_RELOCS)
emit_insn (gen_loadgp_blockage ());
}
@@ -7104,6 +7139,96 @@ mips_encode_section_info (tree decl, rtx rtl, int first)
default_encode_section_info (decl, rtl, first);
}
+/* See whether VALTYPE is a record whose fields should be returned in
+ floating-point registers. If so, return the number of fields and
+ list them in FIELDS (which should have two elements). Return 0
+ otherwise.
+
+ For n32 & n64, a structure with one or two fields is returned in
+ floating-point registers as long as every field has a floating-point
+ type. */
+
+static int
+mips_fpr_return_fields (tree valtype, tree *fields)
+{
+ tree field;
+ int i;
+
+ if (!TARGET_NEWABI)
+ return 0;
+
+ if (TREE_CODE (valtype) != RECORD_TYPE)
+ return 0;
+
+ i = 0;
+ for (field = TYPE_FIELDS (valtype); field != 0; field = TREE_CHAIN (field))
+ {
+ if (TREE_CODE (field) != FIELD_DECL)
+ continue;
+
+ if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE)
+ return 0;
+
+ if (i == 2)
+ return 0;
+
+ fields[i++] = field;
+ }
+ return i;
+}
+
+
+/* Implement TARGET_RETURN_IN_MSB. For n32 & n64, we should return
+ a value in the most significant part of $2/$3 if:
+
+ - the target is big-endian;
+
+ - the value has a structure or union type (we generalize this to
+ cover aggregates from other languages too); and
+
+ - the structure is not returned in floating-point registers. */
+
+static bool
+mips_return_in_msb (tree valtype)
+{
+ tree fields[2];
+
+ return (TARGET_NEWABI
+ && TARGET_BIG_ENDIAN
+ && AGGREGATE_TYPE_P (valtype)
+ && mips_fpr_return_fields (valtype, fields) == 0);
+}
+
+
+/* Return a composite value in a pair of floating-point registers.
+ MODE1 and OFFSET1 are the mode and byte offset for the first value,
+ likewise MODE2 and OFFSET2 for the second. MODE is the mode of the
+ complete value.
+
+ For n32 & n64, $f0 always holds the first value and $f2 the second.
+ Otherwise the values are packed together as closely as possible. */
+
+static rtx
+mips_return_fpr_pair (enum machine_mode mode,
+ enum machine_mode mode1, HOST_WIDE_INT offset1,
+ enum machine_mode mode2, HOST_WIDE_INT offset2)
+{
+ int inc;
+
+ inc = (TARGET_NEWABI ? 2 : FP_INC);
+ return gen_rtx_PARALLEL
+ (mode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode1, FP_RETURN),
+ GEN_INT (offset1)),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode2, FP_RETURN + inc),
+ GEN_INT (offset2))));
+
+}
+
+
/* Implement FUNCTION_VALUE and LIBCALL_VALUE. For normal calls,
VALTYPE is the return type and MODE is VOIDmode. For libcalls,
VALTYPE is null and MODE is the mode of the return value. */
@@ -7112,121 +7237,63 @@ rtx
mips_function_value (tree valtype, tree func ATTRIBUTE_UNUSED,
enum machine_mode mode)
{
- int reg = GP_RETURN;
- enum mode_class mclass;
- int unsignedp = 1;
-
if (valtype)
{
+ tree fields[2];
+ int unsignedp;
+
mode = TYPE_MODE (valtype);
unsignedp = TREE_UNSIGNED (valtype);
/* Since we define PROMOTE_FUNCTION_RETURN, we must promote
the mode just as PROMOTE_MODE does. */
mode = promote_mode (valtype, mode, &unsignedp, 1);
- }
- mclass = GET_MODE_CLASS (mode);
-
- if (mclass == MODE_FLOAT && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE)
- reg = FP_RETURN;
-
- else if (mclass == MODE_FLOAT && mode == TFmode)
- /* long doubles are really split between f0 and f2, not f1. Eek.
- Use DImode for each component, since GCC wants integer modes
- for subregs. */
- return gen_rtx_PARALLEL
- (VOIDmode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (DImode, FP_RETURN),
- GEN_INT (0)),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (DImode, FP_RETURN + 2),
- GEN_INT (GET_MODE_SIZE (mode) / 2))));
-
-
- else if (mclass == MODE_COMPLEX_FLOAT
- && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2)
- {
- enum machine_mode cmode = GET_MODE_INNER (mode);
-
- return gen_rtx_PARALLEL
- (VOIDmode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (cmode, FP_RETURN),
- GEN_INT (0)),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (cmode, FP_RETURN + FP_INC),
- GEN_INT (GET_MODE_SIZE (cmode)))));
- }
-
- else if (valtype && TREE_CODE (valtype) == RECORD_TYPE
- && 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
- the floating point registers. */
- tree field, fields[2];
- int i;
-
- for (i = 0, field = TYPE_FIELDS (valtype); field;
- field = TREE_CHAIN (field))
- {
- if (TREE_CODE (field) != FIELD_DECL)
- continue;
- if (TREE_CODE (TREE_TYPE (field)) != REAL_TYPE || i >= 2)
- break;
+ /* Handle structures whose fields are returned in $f0/$f2. */
+ switch (mips_fpr_return_fields (valtype, fields))
+ {
+ case 1:
+ return gen_rtx_REG (mode, FP_RETURN);
- fields[i++] = field;
+ case 2:
+ return mips_return_fpr_pair (mode,
+ TYPE_MODE (TREE_TYPE (fields[0])),
+ int_byte_position (fields[0]),
+ TYPE_MODE (TREE_TYPE (fields[1])),
+ int_byte_position (fields[1]));
}
- /* Must check i, so that we reject structures with no elements. */
- if (! field)
+ /* If a value is passed in the most significant part of a register, see
+ whether we have to round the mode up to a whole number of words. */
+ if (mips_return_in_msb (valtype))
{
- if (i == 1)
- {
- /* The structure has DImode, but we don't allow DImode values
- in FP registers, so we use a PARALLEL even though it isn't
- strictly necessary. */
- enum machine_mode field_mode = TYPE_MODE (TREE_TYPE (fields[0]));
-
- return gen_rtx_PARALLEL
- (mode,
- gen_rtvec (1,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (field_mode,
- FP_RETURN),
- const0_rtx)));
- }
-
- else if (i == 2)
+ HOST_WIDE_INT size = int_size_in_bytes (valtype);
+ if (size % UNITS_PER_WORD != 0)
{
- enum machine_mode first_mode
- = TYPE_MODE (TREE_TYPE (fields[0]));
- enum machine_mode second_mode
- = TYPE_MODE (TREE_TYPE (fields[1]));
- HOST_WIDE_INT first_offset = int_byte_position (fields[0]);
- HOST_WIDE_INT second_offset = int_byte_position (fields[1]);
-
- return gen_rtx_PARALLEL
- (mode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (first_mode,
- FP_RETURN),
- GEN_INT (first_offset)),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (second_mode,
- FP_RETURN + 2),
- GEN_INT (second_offset))));
+ size += UNITS_PER_WORD - size % UNITS_PER_WORD;
+ mode = mode_for_size (size * BITS_PER_UNIT, MODE_INT, 0);
}
}
}
- return gen_rtx_REG (mode, reg);
+ if (GET_MODE_CLASS (mode) == MODE_FLOAT
+ && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE)
+ return gen_rtx_REG (mode, FP_RETURN);
+
+ /* Handle long doubles for n32 & n64. */
+ if (mode == TFmode)
+ return mips_return_fpr_pair (mode,
+ DImode, 0,
+ DImode, GET_MODE_SIZE (mode) / 2);
+
+ if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
+ && GET_MODE_SIZE (mode) <= UNITS_PER_HWFPVALUE * 2)
+ return mips_return_fpr_pair (mode,
+ GET_MODE_INNER (mode), 0,
+ GET_MODE_INNER (mode),
+ GET_MODE_SIZE (mode) / 2);
+
+ return gen_rtx_REG (mode, GP_RETURN);
}
/* The implementation of FUNCTION_ARG_PASS_BY_REFERENCE. Return
@@ -7425,14 +7492,8 @@ mips_valid_pointer_mode (enum machine_mode mode)
hold the $gp value. */
static rtx
-mips_sdata_pointer (void)
+mips16_gp_pseudo_reg (void)
{
- if (TARGET_EXPLICIT_RELOCS)
- return pic_offset_table_rtx;
-
- if (!TARGET_MIPS16 || no_new_pseudos)
- return 0;
-
if (cfun->machine->mips16_gp_pseudo_rtx == NULL_RTX)
{
rtx const_gp;
diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
index 1b51913a022..e144d64bc41 100644
--- a/gcc/config/mips/mips.h
+++ b/gcc/config/mips/mips.h
@@ -476,7 +476,7 @@ extern const struct mips_cpu_info *mips_tune_info;
{ \
builtin_define ("_LANGUAGE_OBJECTIVE_C"); \
builtin_define ("__LANGUAGE_OBJECTIVE_C"); \
- /* Bizzare, but needed at least for Irix. */ \
+ /* Bizarre, but needed at least for Irix. */ \
builtin_define_std ("LANGUAGE_C"); \
builtin_define ("_LANGUAGE_C"); \
} \
@@ -1244,8 +1244,6 @@ extern const struct mips_cpu_info *mips_tune_info;
SFmode register saves. */
#define DWARF_CIE_DATA_ALIGNMENT 4
-#define FIND_BASE_TERM(X) mips_delegitimize_address (X)
-
/* Correct the offset of automatic variables and arguments. Note that
the MIPS debug format wants all automatic variables and arguments
to be in terms of the virtual frame pointer (stack pointer before
@@ -1470,7 +1468,8 @@ extern const struct mips_cpu_info *mips_tune_info;
- 8 condition code registers
- 2 accumulator registers (hi and lo)
- 32 registers each for coprocessors 0, 2 and 3
- - 6 dummy entries that were used at various times in the past. */
+ - FAKE_CALL_REGNO (see the comment above load_callsi for details)
+ - 5 dummy entries that were used at various times in the past. */
#define FIRST_PSEUDO_REGISTER 176
@@ -2028,9 +2027,7 @@ extern enum reg_class mips_char_to_class[256];
part of a call sequence and allow a global 'foo' to be lazily bound. */
#define DANGEROUS_FOR_LA25_P(OP) \
- (TARGET_ABICALLS \
- && !TARGET_EXPLICIT_RELOCS \
- && mips_global_pic_constant_p (OP))
+ (!TARGET_EXPLICIT_RELOCS && global_got_operand (OP, VOIDmode))
/* Letters in the range `Q' through `U' may be defined in a
machine-dependent fashion to stand for arbitrary operand types.
@@ -2234,7 +2231,7 @@ extern enum reg_class mips_char_to_class[256];
/* 1 if N is a possible register number for a function value.
On the MIPS, R2 R3 and F0 F2 are the only register thus used.
- Currently, R2 and F0 are only implemented here (C has no complex type) */
+ Currently, R2 and F0 are only implemented here (C has no complex type) */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == GP_RETURN || (N) == FP_RETURN \
|| (LONG_DOUBLE_TYPE_SIZE == 128 && FP_RETURN != GP_RETURN \
@@ -2321,9 +2318,7 @@ typedef struct mips_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.
-
-*/
+ For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM,FNTYPE,LIBNAME,INDIRECT) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME) \
@@ -2412,10 +2407,6 @@ typedef struct mips_args {
: ((LOC) + 15) & ~15)
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = mips_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
mips_va_start (valist, nextarg)
@@ -2802,7 +2793,11 @@ typedef struct mips_args {
#define PREDICATE_CODES \
{"uns_arith_operand", { REG, CONST_INT, SUBREG, ADDRESSOF }}, \
{"symbolic_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \
- {"const_arith_operand", { CONST, CONST_INT }}, \
+ {"global_got_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \
+ {"local_got_operand", { CONST, SYMBOL_REF, LABEL_REF }}, \
+ {"const_arith_operand", { CONST_INT }}, \
+ {"small_data_pattern", { SET, PARALLEL, UNSPEC, \
+ UNSPEC_VOLATILE }}, \
{"arith_operand", { REG, CONST_INT, CONST, SUBREG, ADDRESSOF }}, \
{"reg_or_0_operand", { REG, CONST_INT, CONST_DOUBLE, SUBREG, ADDRESSOF }}, \
{"small_int", { CONST_INT }}, \
diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md
index def0088fd1e..5b758c87693 100644
--- a/gcc/config/mips/mips.md
+++ b/gcc/config/mips/mips.md
@@ -53,20 +53,12 @@
(UNSPEC_LDR 23)
(UNSPEC_SDL 24)
(UNSPEC_SDR 25)
+ (UNSPEC_LOADGP 26)
+ (UNSPEC_LOAD_CALL 27)
- ;; Constants used in relocation unspecs. RELOC_GOT_PAGE and RELOC_GOT_DISP
- ;; are really only available for n32 and n64. However, it is convenient
- ;; to reuse them for SVR4 PIC, where they represent the local and global
- ;; forms of R_MIPS_GOT16.
- (RELOC_GOT_HI 100)
- (RELOC_GOT_LO 101)
- (RELOC_GOT_PAGE 102)
- (RELOC_GOT_DISP 103)
- (RELOC_CALL16 104)
- (RELOC_CALL_HI 105)
- (RELOC_CALL_LO 106)
- (RELOC_LOADGP_HI 107)
- (RELOC_LOADGP_LO 108)])
+ (UNSPEC_ADDRESS_FIRST 100)
+
+ (FAKE_CALL_REGNO 79)])
;; ....................
;;
@@ -74,6 +66,9 @@
;;
;; ....................
+(define_attr "got" "unset,xgot_high,load"
+ (const_string "unset"))
+
;; For jal instructions, this attribute is DIRECT when the target address
;; is symbolic and INDIRECT when it is a register.
(define_attr "jal" "unset,direct,indirect"
@@ -125,8 +120,8 @@
;; nop no operation
(define_attr "type"
"unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop"
- (cond [(eq_attr "jal" "!unset")
- (const_string "call")]
+ (cond [(eq_attr "jal" "!unset") (const_string "call")
+ (eq_attr "got" "load") (const_string "load")]
(const_string "unknown")))
;; Main data type used by the insn
@@ -179,6 +174,11 @@
(const_int 24)
] (const_int 12))
+ (eq_attr "got" "load")
+ (const_int 4)
+ (eq_attr "got" "xgot_high")
+ (const_int 8)
+
(eq_attr "type" "const")
(symbol_ref "mips_const_insns (operands[1]) * 4")
(eq_attr "type" "load")
@@ -883,7 +883,7 @@
rtx tmp = gen_reg_rtx (DImode);
emit_move_insn (tmp, operands[1]);
- emit_insn (gen_addsi3 (tmp, tmp, operands[2]));
+ emit_insn (gen_adddi3 (tmp, tmp, operands[2]));
emit_move_insn (operands[0], tmp);
DONE;
}
@@ -4061,8 +4061,8 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_lwl"
[(set (match_operand:SI 0 "register_operand" "=d")
- (unspec:SI [(match_operand:BLK 1 "general_operand" "m")
- (match_operand:QI 2 "general_operand" "m")]
+ (unspec:SI [(match_operand:BLK 1 "memory_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")]
UNSPEC_LWL))]
"!TARGET_MIPS16"
"lwl\t%0,%2"
@@ -4072,8 +4072,8 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_lwr"
[(set (match_operand:SI 0 "register_operand" "=d")
- (unspec:SI [(match_operand:BLK 1 "general_operand" "m")
- (match_operand:QI 2 "general_operand" "m")
+ (unspec:SI [(match_operand:BLK 1 "memory_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")
(match_operand:SI 3 "register_operand" "0")]
UNSPEC_LWR))]
"!TARGET_MIPS16"
@@ -4085,7 +4085,7 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_swl"
[(set (match_operand:BLK 0 "memory_operand" "=m")
(unspec:BLK [(match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:QI 2 "general_operand" "m")]
+ (match_operand:QI 2 "memory_operand" "m")]
UNSPEC_SWL))]
"!TARGET_MIPS16"
"swl\t%z1,%2"
@@ -4095,7 +4095,7 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_swr"
[(set (match_operand:BLK 0 "memory_operand" "+m")
(unspec:BLK [(match_operand:SI 1 "reg_or_0_operand" "dJ")
- (match_operand:QI 2 "general_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")
(match_dup 0)]
UNSPEC_SWR))]
"!TARGET_MIPS16"
@@ -4106,8 +4106,8 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_ldl"
[(set (match_operand:DI 0 "register_operand" "=d")
- (unspec:DI [(match_operand:BLK 1 "general_operand" "m")
- (match_operand:QI 2 "general_operand" "m")]
+ (unspec:DI [(match_operand:BLK 1 "memory_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")]
UNSPEC_LDL))]
"TARGET_64BIT && !TARGET_MIPS16"
"ldl\t%0,%2"
@@ -4116,8 +4116,8 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_ldr"
[(set (match_operand:DI 0 "register_operand" "=d")
- (unspec:DI [(match_operand:BLK 1 "general_operand" "m")
- (match_operand:QI 2 "general_operand" "m")
+ (unspec:DI [(match_operand:BLK 1 "memory_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")
(match_operand:DI 3 "register_operand" "0")]
UNSPEC_LDR))]
"TARGET_64BIT && !TARGET_MIPS16"
@@ -4129,7 +4129,7 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_sdl"
[(set (match_operand:BLK 0 "memory_operand" "=m")
(unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ")
- (match_operand:QI 2 "general_operand" "m")]
+ (match_operand:QI 2 "memory_operand" "m")]
UNSPEC_SDL))]
"TARGET_64BIT && !TARGET_MIPS16"
"sdl\t%z1,%2"
@@ -4139,7 +4139,7 @@ dsrl\t%3,%3,1\n\
(define_insn "mov_sdr"
[(set (match_operand:BLK 0 "memory_operand" "+m")
(unspec:BLK [(match_operand:DI 1 "reg_or_0_operand" "dJ")
- (match_operand:QI 2 "general_operand" "m")
+ (match_operand:QI 2 "memory_operand" "m")
(match_dup 0)]
UNSPEC_SDR))]
"TARGET_64BIT && !TARGET_MIPS16"
@@ -4147,31 +4147,109 @@ dsrl\t%3,%3,1\n\
[(set_attr "type" "store")
(set_attr "mode" "DI")])
+;; Insns to fetch a global symbol from a big GOT.
-;; Instructions for loading a relocation expression using "lui".
+(define_insn_and_split "*xgot_hisi"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (high:SI (match_operand:SI 1 "global_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS && TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (high:SI (match_dup 2)))
+ (set (match_dup 0) (plus:SI (match_dup 0) (match_dup 3)))]
+{
+ operands[2] = mips_gotoff_global (operands[1]);
+ operands[3] = pic_offset_table_rtx;
+}
+ [(set_attr "got" "xgot_high")])
-(define_insn "luisi"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (unspec:SI [(match_operand 1 "const_arith_operand" "")] UNSPEC_HIGH))]
- ""
- "lui\t%0,%1"
- [(set_attr "type" "arith")])
+(define_insn_and_split "*xgot_losi"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "d")
+ (match_operand:SI 2 "global_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS && TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 3))]
+ { operands[3] = mips_load_got_global (operands[1], operands[2]); }
+ [(set_attr "got" "load")])
-(define_insn "luidi"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (unspec:DI [(match_operand 1 "const_arith_operand" "")] UNSPEC_HIGH))]
- "TARGET_64BIT"
- "lui\t%0,%1"
- [(set_attr "type" "arith")])
+(define_insn_and_split "*xgot_hidi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (high:DI (match_operand:DI 1 "global_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS && TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (high:DI (match_dup 2)))
+ (set (match_dup 0) (plus:DI (match_dup 0) (match_dup 3)))]
+{
+ operands[2] = mips_gotoff_global (operands[1]);
+ operands[3] = pic_offset_table_rtx;
+}
+ [(set_attr "got" "xgot_high")])
+(define_insn_and_split "*xgot_lodi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "d")
+ (match_operand:DI 2 "global_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS && TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 3))]
+ { operands[3] = mips_load_got_global (operands[1], operands[2]); }
+ [(set_attr "got" "load")])
+
+;; Insns to fetch a global symbol from a normal GOT.
+
+(define_insn_and_split "*got_dispsi"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (match_operand:SI 1 "global_got_operand" ""))]
+ "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_load_got_global (pic_offset_table_rtx, operands[1]); }
+ [(set_attr "got" "load")])
+
+(define_insn_and_split "*got_dispdi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (match_operand:DI 1 "global_got_operand" ""))]
+ "TARGET_EXPLICIT_RELOCS && !TARGET_XGOT"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_load_got_global (pic_offset_table_rtx, operands[1]); }
+ [(set_attr "got" "load")])
+
+;; Insns for loading the high part of a local symbol.
+
+(define_insn_and_split "*got_pagesi"
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (high:SI (match_operand:SI 1 "local_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_load_got_page (operands[1]); }
+ [(set_attr "got" "load")])
+
+(define_insn_and_split "*got_pagedi"
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (high:DI (match_operand:DI 1 "local_got_operand" "")))]
+ "TARGET_EXPLICIT_RELOCS"
+ "#"
+ "&& reload_completed"
+ [(set (match_dup 0) (match_dup 2))]
+ { operands[2] = mips_load_got_page (operands[1]); }
+ [(set_attr "got" "load")])
;; Instructions for adding the low 16 bits of an address to a register.
;; Operand 2 is the address: print_operand works out which relocation
;; should be applied.
(define_insn "*lowsi"
- [(set (match_operand:SI 0 "register_operand" "=r")
- (lo_sum:SI (match_operand:SI 1 "register_operand" "r")
+ [(set (match_operand:SI 0 "register_operand" "=d")
+ (lo_sum:SI (match_operand:SI 1 "register_operand" "d")
(match_operand:SI 2 "immediate_operand" "")))]
"!TARGET_MIPS16"
"addiu\t%0,%1,%R2"
@@ -4179,8 +4257,8 @@ dsrl\t%3,%3,1\n\
(set_attr "mode" "SI")])
(define_insn "*lowdi"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (lo_sum:DI (match_operand:DI 1 "register_operand" "r")
+ [(set (match_operand:DI 0 "register_operand" "=d")
+ (lo_sum:DI (match_operand:DI 1 "register_operand" "d")
(match_operand:DI 2 "immediate_operand" "")))]
"!TARGET_MIPS16 && TARGET_64BIT"
"daddiu\t%0,%1,%R2"
@@ -5048,6 +5126,26 @@ dsrl\t%3,%3,1\n\
(set_attr "mode" "SF")
(set_attr "length" "4")])
+;; Insn to initialize $gp for n32/n64 abicalls. Operand 0 is the offset
+;; of _gp from the start of this function. Operand 1 is the incoming
+;; function address.
+(define_insn_and_split "loadgp"
+ [(unspec_volatile [(match_operand 0 "" "")
+ (match_operand 1 "register_operand" "")] UNSPEC_LOADGP)]
+ "TARGET_ABICALLS && TARGET_NEWABI"
+ "#"
+ ""
+ [(set (match_dup 2) (match_dup 3))
+ (set (match_dup 2) (match_dup 4))
+ (set (match_dup 2) (match_dup 5))]
+{
+ operands[2] = pic_offset_table_rtx;
+ operands[3] = gen_rtx_HIGH (Pmode, operands[0]);
+ operands[4] = gen_rtx_PLUS (Pmode, operands[2], operands[1]);
+ operands[5] = gen_rtx_LO_SUM (Pmode, operands[2], operands[0]);
+}
+ [(set_attr "length" "12")])
+
;; The use of gp is hidden when not using explicit relocations.
;; This blockage instruction prevents the gp load from being
;; scheduled after an implicit use of gp. It also prevents
@@ -8154,8 +8252,8 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/"
;; Normal return.
(define_insn "return_internal"
- [(use (match_operand 0 "pmode_register_operand" ""))
- (return)]
+ [(return)
+ (use (match_operand 0 "pmode_register_operand" ""))]
""
"%*j\t%0%/"
[(set_attr "type" "jump")
@@ -8236,6 +8334,42 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/"
;;
;; ....................
+;; Instructions to load a call address from the GOT. The address might
+;; point to a function or to a lazy binding stub. In the latter case,
+;; the stub will use the dynamic linker to resolve the function, which
+;; in turn will change the GOT entry to point to the function's real
+;; address.
+;;
+;; This means that every call, even pure and constant ones, can
+;; potentially modify the GOT entry. And once a stub has been called,
+;; we must not call it again.
+;;
+;; We represent this restriction using an imaginary fixed register that
+;; acts like a GOT version number. By making the register call-clobbered,
+;; we tell the target-independent code that the address could be changed
+;; by any call insn.
+(define_insn "load_callsi"
+ [(set (match_operand:SI 0 "register_operand" "=c")
+ (unspec:SI [(match_operand:SI 1 "register_operand" "r")
+ (match_operand:SI 2 "immediate_operand" "")
+ (reg:SI FAKE_CALL_REGNO)]
+ UNSPEC_LOAD_CALL))]
+ "TARGET_ABICALLS"
+ "lw\t%0,%R2(%1)"
+ [(set_attr "type" "load")
+ (set_attr "length" "4")])
+
+(define_insn "load_calldi"
+ [(set (match_operand:DI 0 "register_operand" "=c")
+ (unspec:DI [(match_operand:DI 1 "register_operand" "r")
+ (match_operand:DI 2 "immediate_operand" "")
+ (reg:DI FAKE_CALL_REGNO)]
+ UNSPEC_LOAD_CALL))]
+ "TARGET_ABICALLS"
+ "ld\t%0,%R2(%1)"
+ [(set_attr "type" "load")
+ (set_attr "length" "4")])
+
;; Sibling calls. All these patterns use jump instructions.
;; If TARGET_SIBCALLS, call_insn_operand will only accept constant
@@ -9038,3 +9172,9 @@ ld\t%2,%1-%S1(%2)\;daddu\t%2,%2,$31\;%*j\t%2%/"
[(set_attr "type" "branch")
(set_attr "mode" "none")
(set_attr "length" "8")])
+
+(define_split
+ [(match_operand 0 "small_data_pattern" "")]
+ "reload_completed"
+ [(match_dup 0)]
+ { operands[0] = mips_rewrite_small_data (operands[0]); })
diff --git a/gcc/config/mips/t-iris6 b/gcc/config/mips/t-iris6
index d157b3a0ca9..e6713106dba 100644
--- a/gcc/config/mips/t-iris6
+++ b/gcc/config/mips/t-iris6
@@ -1,22 +1,18 @@
# ??? If no mabi=X option given, but a mipsX option is, then should deal
# with that.
-MULTILIB_OPTIONS=mabi=32/mabi=n32/mabi=64
+MULTILIB_OPTIONS=mabi=n32/mabi=32/mabi=64
MULTILIB_DIRNAMES=
MULTILIB_MATCHES=
-MULTILIB_OSDIRNAMES=mabi=32 . mabi=64
+MULTILIB_OSDIRNAMES=. mabi=32 mabi=64
LIBGCC = stmp-multilib
INSTALL_LIBGCC = install-multilib
# For svr4 we build crtbegin.o and crtend.o which serve to add begin and
# end labels to the .ctors and .dtors section when we link using gcc.
-
EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o
-CRTSTUFF_T_CFLAGS=-g1
-# 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
+CRTSTUFF_T_CFLAGS=-g1
LIB2FUNCS_EXTRA = $(srcdir)/config/mips/_tilib.c
diff --git a/gcc/config/mips/t-iris6gld b/gcc/config/mips/t-iris6gld
new file mode 100644
index 00000000000..2926be0cb44
--- /dev/null
+++ b/gcc/config/mips/t-iris6gld
@@ -0,0 +1,9 @@
+$(T)irix6-crti.o: $(srcdir)/config/mips/irix6-crti.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $@ -x assembler-with-cpp $<
+
+$(T)irix6-crtn.o: $(srcdir)/config/mips/irix6-crtn.asm $(GCC_PASSES)
+ $(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
+ -c -o $@ -x assembler-with-cpp $<
+
+EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o irix6-crti.o irix6-crtn.o
diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h
index 59358df4386..0130498ce5a 100644
--- a/gcc/config/mn10300/linux.h
+++ b/gcc/config/mn10300/linux.h
@@ -23,16 +23,7 @@
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-#define TARGET_OS_CPP_BUILTINS() \
- do \
- { \
- builtin_define_std ("unix"); \
- builtin_define_std ("linux"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=unix"); \
- builtin_assert ("system=posix"); \
- } \
- while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
#undef CPP_SPEC
#define CPP_SPEC "%{mam33:-D__AM33__} %{!mam33:-D__AM33__=2 -D__AM33_2__} \
diff --git a/gcc/config/mn10300/mn10300-protos.h b/gcc/config/mn10300/mn10300-protos.h
index 8e843259b1f..1c6bc7a4095 100644
--- a/gcc/config/mn10300/mn10300-protos.h
+++ b/gcc/config/mn10300/mn10300-protos.h
@@ -22,41 +22,41 @@ Boston, MA 02111-1307, USA. */
#ifdef RTX_CODE
#ifdef TREE_CODE
-extern void mn10300_va_start PARAMS ((tree, rtx));
+extern void mn10300_va_start (tree, rtx);
#endif /* TREE_CODE */
-extern struct rtx_def *legitimize_address PARAMS ((rtx, rtx, enum machine_mode));
-extern rtx legitimize_pic_address (rtx, rtx);
+extern struct rtx_def *legitimize_address (rtx, rtx, enum machine_mode);
+extern rtx legitimize_pic_address (rtx, rtx);
extern int legitimate_pic_operand_p (rtx);
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern void mn10300_print_reg_list PARAMS ((FILE *, int));
-extern int mn10300_get_live_callee_saved_regs PARAMS ((void));
-extern void mn10300_gen_multiple_store PARAMS ((int));
-extern void notice_update_cc PARAMS ((rtx, rtx));
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode, rtx));
-extern const char *output_tst PARAMS ((rtx, rtx));
-extern int store_multiple_operation PARAMS ((rtx, enum machine_mode));
-extern int symbolic_operand PARAMS ((rtx, enum machine_mode));
-extern int call_address_operand PARAMS ((rtx, enum machine_mode));
-extern int impossible_plus_operand PARAMS ((rtx, enum machine_mode));
-extern int const_8bit_operand PARAMS ((rtx, enum machine_mode));
-
-extern bool mn10300_wide_const_load_uses_clr PARAMS ((rtx operands[2]));
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern void mn10300_print_reg_list (FILE *, int);
+extern int mn10300_get_live_callee_saved_regs (void);
+extern void mn10300_gen_multiple_store (int);
+extern void notice_update_cc (rtx, rtx);
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern const char *output_tst (rtx, rtx);
+extern int store_multiple_operation (rtx, enum machine_mode);
+extern int symbolic_operand (rtx, enum machine_mode);
+extern int call_address_operand (rtx, enum machine_mode);
+extern int impossible_plus_operand (rtx, enum machine_mode);
+extern int const_8bit_operand (rtx, enum machine_mode);
+
+extern bool mn10300_wide_const_load_uses_clr (rtx operands[2]);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern struct rtx_def *function_arg PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern int function_arg_partial_nregs PARAMS ((CUMULATIVE_ARGS *,
- enum machine_mode, tree, int));
-extern struct rtx_def *mn10300_va_arg PARAMS ((tree, tree));
+extern struct rtx_def *function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern int function_arg_partial_nregs (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+extern struct rtx_def *mn10300_va_arg (tree, tree);
#endif /* TREE_CODE */
-extern struct rtx_def *mn10300_builtin_saveregs PARAMS ((void));
-extern void expand_prologue PARAMS ((void));
-extern void expand_epilogue PARAMS ((void));
-extern int initial_offset PARAMS ((int, int));
-extern int can_use_return_insn PARAMS ((void));
-extern int mask_ok_for_mem_btst PARAMS ((int, int));
+extern struct rtx_def *mn10300_builtin_saveregs (void);
+extern void expand_prologue (void);
+extern void expand_epilogue (void);
+extern int initial_offset (int, int);
+extern int can_use_return_insn (void);
+extern int mask_ok_for_mem_btst (int, int);
diff --git a/gcc/config/mn10300/mn10300.c b/gcc/config/mn10300/mn10300.c
index ba8c6cc9b3c..1e200f9c578 100644
--- a/gcc/config/mn10300/mn10300.c
+++ b/gcc/config/mn10300/mn10300.c
@@ -65,10 +65,10 @@ int mn10300_protect_label;
|| regs_ever_live[16] || regs_ever_live[17]))
-static int mn10300_address_cost_1 PARAMS ((rtx, int *));
-static int mn10300_address_cost PARAMS ((rtx));
-static bool mn10300_rtx_costs PARAMS ((rtx, int, int, int *));
-static void mn10300_file_start PARAMS ((void));
+static int mn10300_address_cost_1 (rtx, int *);
+static int mn10300_address_cost (rtx);
+static bool mn10300_rtx_costs (rtx, int, int, int *);
+static void mn10300_file_start (void);
/* Initialize the GCC target structure. */
@@ -92,7 +92,7 @@ static void mn10300_encode_section_info (tree, rtx, int);
struct gcc_target targetm = TARGET_INITIALIZER;
static void
-mn10300_file_start ()
+mn10300_file_start (void)
{
default_file_start ();
@@ -107,10 +107,7 @@ mn10300_file_start ()
FILE. */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
switch (code)
{
@@ -437,9 +434,7 @@ print_operand (file, x, code)
/* Output assembly language output for the address ADDR to FILE. */
void
-print_operand_address (file, addr)
- FILE *file;
- rtx addr;
+print_operand_address (FILE *file, rtx addr)
{
switch (GET_CODE (addr))
{
@@ -477,7 +472,7 @@ print_operand_address (file, addr)
/* Count the number of FP registers that have to be saved. */
static int
-fp_regs_to_save ()
+fp_regs_to_save (void)
{
int i, n = 0;
@@ -498,9 +493,7 @@ fp_regs_to_save ()
bits 14 to 17 must have the same value. */
void
-mn10300_print_reg_list (file, mask)
- FILE *file;
- int mask;
+mn10300_print_reg_list (FILE *file, int mask)
{
int need_comma;
int i;
@@ -531,7 +524,7 @@ mn10300_print_reg_list (file, mask)
}
int
-can_use_return_insn ()
+can_use_return_insn (void)
{
/* size includes the fixed stack space needed for function calls. */
int size = get_frame_size () + current_function_outgoing_args_size;
@@ -558,7 +551,7 @@ can_use_return_insn ()
all of them will be included in the mask if any one of them is used. */
int
-mn10300_get_live_callee_saved_regs ()
+mn10300_get_live_callee_saved_regs (void)
{
int mask;
int i;
@@ -593,8 +586,7 @@ mn10300_get_live_callee_saved_regs ()
(reg:SI R1))) */
void
-mn10300_gen_multiple_store (mask)
- int mask;
+mn10300_gen_multiple_store (int mask)
{
if (mask != 0)
{
@@ -642,7 +634,7 @@ mn10300_gen_multiple_store (mask)
}
void
-expand_prologue ()
+expand_prologue (void)
{
HOST_WIDE_INT size;
@@ -917,7 +909,7 @@ expand_prologue ()
}
void
-expand_epilogue ()
+expand_epilogue (void)
{
HOST_WIDE_INT size;
@@ -1155,9 +1147,7 @@ expand_epilogue ()
/* Update the condition code from the insn. */
void
-notice_update_cc (body, insn)
- rtx body;
- rtx insn;
+notice_update_cc (rtx body, rtx insn)
{
switch (get_attr_cc (insn))
{
@@ -1220,9 +1210,7 @@ notice_update_cc (body, insn)
registers it saves. Return 0 otherwise. */
int
-store_multiple_operation (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+store_multiple_operation (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
int count;
int mask;
@@ -1298,9 +1286,7 @@ store_multiple_operation (op, mode)
/* Return true if OP is a valid call operand. */
int
-call_address_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+call_address_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (flag_pic)
return (EXTRA_CONSTRAINT (op, 'S') || GET_CODE (op) == REG);
@@ -1313,10 +1299,7 @@ call_address_operand (op, mode)
We might be able to simplify this. */
enum reg_class
-secondary_reload_class (class, mode, in)
- enum reg_class class;
- enum machine_mode mode;
- rtx in;
+secondary_reload_class (enum reg_class class, enum machine_mode mode, rtx in)
{
/* Memory loads less than a full word wide can't have an
address or stack pointer destination. They must use
@@ -1372,8 +1355,7 @@ secondary_reload_class (class, mode, in)
}
int
-initial_offset (from, to)
- int from, to;
+initial_offset (int from, int to)
{
/* The difference between the argument pointer and the frame pointer
is the size of the callee register save area. */
@@ -1426,7 +1408,7 @@ initial_offset (from, to)
/* Flush the argument registers to the stack for a stdarg function;
return the new argument pointer. */
rtx
-mn10300_builtin_saveregs ()
+mn10300_builtin_saveregs (void)
{
rtx offset, mem;
tree fntype = TREE_TYPE (current_function_decl);
@@ -1456,17 +1438,14 @@ mn10300_builtin_saveregs ()
}
void
-mn10300_va_start (valist, nextarg)
- tree valist;
- rtx nextarg;
+mn10300_va_start (tree valist, rtx nextarg)
{
nextarg = expand_builtin_saveregs ();
std_expand_builtin_va_start (valist, nextarg);
}
rtx
-mn10300_va_arg (valist, type)
- tree valist, type;
+mn10300_va_arg (tree valist, tree type)
{
HOST_WIDE_INT align, rsize;
tree t, ptr, pptr;
@@ -1505,11 +1484,8 @@ mn10300_va_arg (valist, type)
from a function. If the result is 0, the argument is pushed. */
rtx
-function_arg (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
rtx result = 0;
int size, align;
@@ -1558,11 +1534,8 @@ function_arg (cum, mode, type, named)
in registers and partially in memory. */
int
-function_arg_partial_nregs (cum, mode, type, named)
- CUMULATIVE_ARGS *cum;
- enum machine_mode mode;
- tree type;
- int named ATTRIBUTE_UNUSED;
+function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int named ATTRIBUTE_UNUSED)
{
int size, align;
@@ -1599,8 +1572,7 @@ function_arg_partial_nregs (cum, mode, type, named)
/* Output a tst insn. */
const char *
-output_tst (operand, insn)
- rtx operand, insn;
+output_tst (rtx operand, rtx insn)
{
rtx temp;
int past_call = 0;
@@ -1689,9 +1661,7 @@ output_tst (operand, insn)
}
int
-impossible_plus_operand (op, mode)
- rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+impossible_plus_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (GET_CODE (op) != PLUS)
return 0;
@@ -1707,9 +1677,7 @@ impossible_plus_operand (op, mode)
for the btst insn which may examine memory or a register (the memory
variant only allows an unsigned 8 bit integer). */
int
-const_8bit_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_8bit_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (GET_CODE (op) == CONST_INT
&& INTVAL (op) >= 0
@@ -1718,9 +1686,7 @@ const_8bit_operand (op, mode)
/* Return true if the operand is the 1.0f constant. */
int
-const_1f_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+const_1f_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
return (op == CONST1_RTX (SFmode));
}
@@ -1728,9 +1694,7 @@ const_1f_operand (op, mode)
/* Similarly, but when using a zero_extract pattern for a btst where
the source operand might end up in memory. */
int
-mask_ok_for_mem_btst (len, bit)
- int len;
- int bit;
+mask_ok_for_mem_btst (int len, int bit)
{
unsigned int mask = 0;
@@ -1752,9 +1716,7 @@ mask_ok_for_mem_btst (len, bit)
expressions will have one of a few well defined forms, so
we need only check those forms. */
int
-symbolic_operand (op, mode)
- register rtx op;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+symbolic_operand (register rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
{
switch (GET_CODE (op))
{
@@ -1787,10 +1749,8 @@ symbolic_operand (op, mode)
But on a few ports with segmented architectures and indexed addressing
(mn10300, hppa) it is used to rewrite certain problematical addresses. */
rtx
-legitimize_address (x, oldx, mode)
- rtx x;
- rtx oldx ATTRIBUTE_UNUSED;
- enum machine_mode mode ATTRIBUTE_UNUSED;
+legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
+ enum machine_mode mode ATTRIBUTE_UNUSED)
{
if (flag_pic && ! legitimate_pic_operand_p (x))
x = legitimize_pic_address (oldx, NULL_RTX);
@@ -1828,9 +1788,7 @@ legitimize_address (x, oldx, mode)
/* Convert a non-PIC address in `orig' to a PIC address using @GOT or
@GOTOFF in `reg'. */
rtx
-legitimize_pic_address (orig, reg)
- rtx orig;
- rtx reg;
+legitimize_pic_address (rtx orig, rtx reg)
{
if (GET_CODE (orig) == LABEL_REF
|| (GET_CODE (orig) == SYMBOL_REF
@@ -1857,8 +1815,7 @@ legitimize_pic_address (orig, reg)
/* Return zero if X references a SYMBOL_REF or LABEL_REF whose symbol
isn't protected by a PIC unspec; nonzero otherwise. */
int
-legitimate_pic_operand_p (x)
- rtx x;
+legitimate_pic_operand_p (rtx x)
{
register const char *fmt;
register int i;
@@ -1895,9 +1852,7 @@ legitimate_pic_operand_p (x)
}
static int
-mn10300_address_cost_1 (x, unsig)
- rtx x;
- int *unsig;
+mn10300_address_cost_1 (rtx x, int *unsig)
{
switch (GET_CODE (x))
{
@@ -1976,18 +1931,14 @@ mn10300_address_cost_1 (x, unsig)
}
static int
-mn10300_address_cost (x)
- rtx x;
+mn10300_address_cost (rtx x)
{
int s = 0;
return mn10300_address_cost_1 (x, &s);
}
static bool
-mn10300_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code;
- int *total;
+mn10300_rtx_costs (rtx x, int code, int outer_code, int *total)
{
switch (code)
{
@@ -2039,8 +1990,7 @@ mn10300_rtx_costs (x, code, outer_code, total)
movdf and movdi. */
bool
-mn10300_wide_const_load_uses_clr (operands)
- rtx operands[2];
+mn10300_wide_const_load_uses_clr (rtx operands[2])
{
long val[2];
@@ -2085,10 +2035,7 @@ mn10300_wide_const_load_uses_clr (operands)
may access it using GOTOFF instead of GOT. */
static void
-mn10300_encode_section_info (decl, rtl, first)
- tree decl;
- rtx rtl;
- int first;
+mn10300_encode_section_info (tree decl, rtx rtl, int first ATTRIBUTE_UNUSED)
{
rtx symbol;
diff --git a/gcc/config/netware.h b/gcc/config/netware.h
index 64278835f3d..241e92dcf7c 100644
--- a/gcc/config/netware.h
+++ b/gcc/config/netware.h
@@ -51,7 +51,6 @@ Boston, MA 02111-1307, USA. */
/* set debugging info */
#define DBX_DEBUGGING_INFO 1
#undef SDB_DEBUGGING_INFO
-#undef DWARF_DEBUGGING_INFO
#undef XCOFF_DEBUGGING_INFO
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
diff --git a/gcc/config/ns32k/ns32k-protos.h b/gcc/config/ns32k/ns32k-protos.h
index 9700a03667b..b5a2328c3c6 100644
--- a/gcc/config/ns32k/ns32k-protos.h
+++ b/gcc/config/ns32k/ns32k-protos.h
@@ -22,24 +22,24 @@ Boston, MA 02111-1307, USA. */
/* Prototypes for functions in ns32k.c */
#ifdef RTX_CODE
-extern enum reg_class secondary_reload_class PARAMS ((enum reg_class,
- enum machine_mode, rtx));
-extern int reg_or_mem_operand PARAMS ((rtx, enum machine_mode));
-
-extern void split_di PARAMS ((rtx[], int, rtx[], rtx[]));
-extern void expand_block_move PARAMS ((rtx[]));
-extern int global_symbolic_reference_mentioned_p PARAMS ((rtx, int));
-extern void print_operand PARAMS ((FILE *, rtx, int));
-extern void print_operand_address PARAMS ((FILE *, rtx));
-extern const char *output_move_double PARAMS ((rtx *));
-extern const char *output_shift_insn PARAMS ((rtx *));
-extern int symbolic_reference_mentioned_p PARAMS ((rtx));
+extern enum reg_class secondary_reload_class (enum reg_class,
+ enum machine_mode, rtx);
+extern int reg_or_mem_operand (rtx, enum machine_mode);
+
+extern void split_di (rtx[], int, rtx[], rtx[]);
+extern void expand_block_move (rtx[]);
+extern int global_symbolic_reference_mentioned_p (rtx, int);
+extern void print_operand (FILE *, rtx, int);
+extern void print_operand_address (FILE *, rtx);
+extern const char *output_move_double (rtx *);
+extern const char *output_shift_insn (rtx *);
+extern int symbolic_reference_mentioned_p (rtx);
#endif /* RTX_CODE */
#ifdef TREE_CODE
-extern int ns32k_return_pops_args PARAMS ((tree, tree, int));
+extern int ns32k_return_pops_args (tree, tree, int);
#endif /* TREE_CODE */
-extern int hard_regno_mode_ok PARAMS ((int, enum machine_mode));
-extern int register_move_cost PARAMS ((enum reg_class, enum reg_class));
-extern const char *output_move_dconst PARAMS ((int, const char *));
+extern int hard_regno_mode_ok (int, enum machine_mode);
+extern int register_move_cost (enum reg_class, enum reg_class);
+extern const char *output_move_dconst (int, const char *);
diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c
index bd4b561999c..e80724ecf40 100644
--- a/gcc/config/ns32k/ns32k.c
+++ b/gcc/config/ns32k/ns32k.c
@@ -64,15 +64,15 @@ const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER] =
static const char *const ns32k_out_reg_names[] = OUTPUT_REGISTER_NAMES;
-static rtx gen_indexed_expr PARAMS ((rtx, rtx, rtx));
-static const char *singlemove_string PARAMS ((rtx *));
-static void move_tail PARAMS ((rtx[], int, int));
-static tree ns32k_handle_fntype_attribute PARAMS ((tree *, tree, tree, int, bool *));
+static rtx gen_indexed_expr (rtx, rtx, rtx);
+static const char *singlemove_string (rtx *);
+static void move_tail (rtx[], int, int);
+static tree ns32k_handle_fntype_attribute (tree *, tree, tree, int, bool *);
const struct attribute_spec ns32k_attribute_table[];
-static void ns32k_output_function_prologue PARAMS ((FILE *, HOST_WIDE_INT));
-static void ns32k_output_function_epilogue PARAMS ((FILE *, HOST_WIDE_INT));
-static bool ns32k_rtx_costs PARAMS ((rtx, int, int, int *));
-static int ns32k_address_cost PARAMS ((rtx));
+static void ns32k_output_function_prologue (FILE *, HOST_WIDE_INT);
+static void ns32k_output_function_epilogue (FILE *, HOST_WIDE_INT);
+static bool ns32k_rtx_costs (rtx, int, int, int *);
+static int ns32k_address_cost (rtx);
/* Initialize the GCC target structure. */
#undef TARGET_ATTRIBUTE_TABLE
@@ -150,9 +150,7 @@ struct gcc_target targetm = TARGET_INITIALIZER;
#endif
static void
-ns32k_output_function_prologue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+ns32k_output_function_prologue (FILE *file, HOST_WIDE_INT size)
{
register int regno, g_regs_used = 0;
int used_regs_buf[8], *bufp = used_regs_buf;
@@ -330,9 +328,7 @@ ns32k_output_function_prologue (file, size)
#if !defined (MERLIN_TARGET) && !defined (UTEK_ASM)
static void
-ns32k_output_function_epilogue (file, size)
- FILE *file;
- HOST_WIDE_INT size;
+ns32k_output_function_epilogue (FILE *file, HOST_WIDE_INT size)
{
register int regno, g_regs_used = 0, f_regs_used = 0;
int used_regs_buf[8], *bufp = used_regs_buf;
@@ -472,9 +468,7 @@ ns32k_output_function_epilogue (file, size)
/* Value is 1 if hard register REGNO can hold a value of machine-mode MODE. */
int
-hard_regno_mode_ok (regno, mode)
- int regno;
- enum machine_mode mode;
+hard_regno_mode_ok (int regno, enum machine_mode mode)
{
int size = GET_MODE_UNIT_SIZE (mode);
@@ -498,10 +492,7 @@ hard_regno_mode_ok (regno, mode)
}
static bool
-ns32k_rtx_costs (x, code, outer_code, total)
- rtx x;
- int code, outer_code ATTRIBUTE_UNUSED;
- int *total;
+ns32k_rtx_costs (rtx x, int code, int outer_code ATTRIBUTE_UNUSED, int *total)
{
switch (code)
{
@@ -529,9 +520,8 @@ ns32k_rtx_costs (x, code, outer_code, total)
}
}
-int register_move_cost (CLASS1, CLASS2)
- enum reg_class CLASS1;
- enum reg_class CLASS2;
+int
+register_move_cost (enum reg_class CLASS1, enum reg_class CLASS2)
{
if (CLASS1 == NO_REGS || CLASS2 == NO_REGS)
return 2;
@@ -550,10 +540,10 @@ int register_move_cost (CLASS1, CLASS2)
#if 0
/* We made the insn definitions copy from floating point to general
registers via the stack. */
-int secondary_memory_needed (CLASS1, CLASS2, M)
- enum reg_class CLASS1;
- enum reg_class CLASS2;
- enum machine_mode M;
+int
+secondary_memory_needed (enum reg_class CLASS1,
+ enum reg_class CLASS2,
+ enum machine_mode M)
{
int ret = ((SUBSET_P (CLASS1, FP_REGS) && !SUBSET_P (CLASS2, FP_REGS))
|| (!SUBSET_P (CLASS1, FP_REGS) && SUBSET_P (CLASS2, FP_REGS)));
@@ -567,8 +557,7 @@ int secondary_memory_needed (CLASS1, CLASS2, M)
the default. */
static int
-ns32k_address_cost (operand)
- rtx operand;
+ns32k_address_cost (rtx operand)
{
int cost = 0;
@@ -623,10 +612,9 @@ ns32k_address_cost (operand)
NO_REGS is returned. */
enum reg_class
-secondary_reload_class (class, mode, in)
- enum reg_class class;
- enum machine_mode mode ATTRIBUTE_UNUSED;
- rtx in;
+secondary_reload_class (enum reg_class class,
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx in)
{
int regno = true_regnum (in);
@@ -646,8 +634,7 @@ secondary_reload_class (class, mode, in)
multiplier (for MULT). */
static rtx
-gen_indexed_expr (base, index, scale)
- rtx base, index, scale;
+gen_indexed_expr (rtx base, rtx index, rtx scale)
{
rtx addr;
@@ -669,10 +656,7 @@ gen_indexed_expr (base, index, scale)
that parallel "operands". */
void
-split_di (operands, num, lo_half, hi_half)
- rtx operands[];
- int num;
- rtx lo_half[], hi_half[];
+split_di (rtx operands[], int num, rtx lo_half[], rtx hi_half[])
{
while (num--)
{
@@ -699,8 +683,7 @@ split_di (operands, num, lo_half, hi_half)
for moving operands[1] into operands[0] as a fullword. */
static const char *
-singlemove_string (operands)
- rtx *operands;
+singlemove_string (rtx *operands)
{
if (GET_CODE (operands[1]) == CONST_INT
&& INTVAL (operands[1]) <= 7
@@ -710,8 +693,7 @@ singlemove_string (operands)
}
const char *
-output_move_double (operands)
- rtx *operands;
+output_move_double (rtx *operands)
{
enum anon1 { REGOP, OFFSOP, PUSHOP, CNSTOP, RNDOP } optype0, optype1;
rtx latehalf[2];
@@ -849,10 +831,7 @@ output_move_double (operands)
operands[3] is the alignment. */
static void
-move_tail (operands, bytes, offset)
- rtx operands[];
- int bytes;
- int offset;
+move_tail (rtx operands[], int bytes, int offset)
{
if (bytes & 2)
{
@@ -866,8 +845,7 @@ move_tail (operands, bytes, offset)
}
void
-expand_block_move (operands)
- rtx operands[];
+expand_block_move (rtx operands[])
{
rtx bytes_rtx = operands[2];
rtx align_rtx = operands[3];
@@ -994,9 +972,7 @@ expand_block_move (operands)
/* Returns 1 if OP contains a global symbol reference */
int
-global_symbolic_reference_mentioned_p (op, f)
- rtx op;
- int f;
+global_symbolic_reference_mentioned_p (rtx op, int f)
{
register const char *fmt;
register int i;
@@ -1034,8 +1010,7 @@ global_symbolic_reference_mentioned_p (op, f)
/* Returns 1 if OP contains a symbol reference */
int
-symbolic_reference_mentioned_p (op)
- rtx op;
+symbolic_reference_mentioned_p (rtx op)
{
register const char *fmt;
register int i;
@@ -1077,12 +1052,10 @@ const struct attribute_spec ns32k_attribute_table[] =
/* Handle an attribute requiring a FUNCTION_TYPE, FIELD_DECL or TYPE_DECL;
arguments as in struct attribute_spec.handler. */
static tree
-ns32k_handle_fntype_attribute (node, name, args, flags, no_add_attrs)
- tree *node;
- tree name;
- tree args ATTRIBUTE_UNUSED;
- int flags ATTRIBUTE_UNUSED;
- bool *no_add_attrs;
+ns32k_handle_fntype_attribute (tree *node, tree name,
+ tree args ATTRIBUTE_UNUSED,
+ int flags ATTRIBUTE_UNUSED,
+ bool *no_add_attrs)
{
if (TREE_CODE (*node) != FUNCTION_TYPE
&& TREE_CODE (*node) != FIELD_DECL
@@ -1115,10 +1088,7 @@ ns32k_handle_fntype_attribute (node, name, args, flags, no_add_attrs)
The attribute stdcall is equivalent to RET on a per module basis. */
int
-ns32k_return_pops_args (fundecl, funtype, size)
- tree fundecl ATTRIBUTE_UNUSED;
- tree funtype;
- int size;
+ns32k_return_pops_args (tree fundecl ATTRIBUTE_UNUSED, tree funtype, int size)
{
int rtd = TARGET_RTD;
@@ -1149,10 +1119,7 @@ ns32k_return_pops_args (fundecl, funtype, size)
/* XXX time 12% of cpu time is in fprintf for non optimizing */
void
-print_operand (file, x, code)
- FILE *file;
- rtx x;
- int code;
+print_operand (FILE *file, rtx x, int code)
{
if (code == '$')
PUT_IMMEDIATE_PREFIX (file);
@@ -1240,9 +1207,7 @@ print_operand (file, x, code)
90-11-25 Tatu Yl|nen <ylo@cs.hut.fi> */
void
-print_operand_address (file, addr)
- register FILE *file;
- register rtx addr;
+print_operand_address (register FILE *file, register rtx addr)
{
static const char scales[] = { 'b', 'w', 'd', 0, 'q', };
rtx offset, base, indexexp, tmp;
@@ -1524,8 +1489,7 @@ print_operand_address (file, addr)
better performance in many common cases by using other
techniques. */
const char *
-output_shift_insn (operands)
- rtx *operands;
+output_shift_insn (rtx *operands)
{
if (GET_CODE (operands[2]) == CONST_INT
&& INTVAL (operands[2]) > 0
@@ -1574,9 +1538,7 @@ output_shift_insn (operands)
}
const char *
-output_move_dconst (n, s)
- int n;
- const char *s;
+output_move_dconst (int n, const char *s)
{
static char r[32];
diff --git a/gcc/config/ns32k/ns32k.h b/gcc/config/ns32k/ns32k.h
index 69d756f70c5..091b138a18c 100644
--- a/gcc/config/ns32k/ns32k.h
+++ b/gcc/config/ns32k/ns32k.h
@@ -383,14 +383,7 @@ while (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.
-
- Early documentation says SI and DI are not tieable if some reg can
- be OK for SI but not for DI. However other ports (mips, i860, mvs
- and tahoe) don't meet the above criterion. Evidently the real
- requirement is somewhat laxer. Documentation was changed for gcc
- 2.8 but was not picked up by egcs (at least egcs 1.0). Having all
- integer modes tieable definitely generates faster code. */
+ for any hard reg, then this must be 0 for correct output. */
#define MODES_TIEABLE_P(MODE1, MODE2) \
((FLOAT_MODE_P(MODE1) && FLOAT_MODE_P(MODE2) \
diff --git a/gcc/config/pa/pa-linux.h b/gcc/config/pa/pa-linux.h
index 027c946dba3..c3808f1c34f 100644
--- a/gcc/config/pa/pa-linux.h
+++ b/gcc/config/pa/pa-linux.h
@@ -56,12 +56,8 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define ("__gnu_linux__"); \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
builtin_assert ("machine=bigendian"); \
- builtin_assert ("system=posix"); \
- builtin_assert ("system=unix"); \
} \
while (0)
@@ -121,14 +117,14 @@ Boston, MA 02111-1307, USA. */
#undef ASM_OUTPUT_ADDR_VEC_ELT
#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'.L%d,%%r1\n\tbe RR'.L%d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \
+ fprintf (FILE, "\t.word .L%d\n", VALUE); \
else \
fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
#undef ASM_OUTPUT_ADDR_DIFF_ELT
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'.L%d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \
+ fprintf (FILE, "\t.word .L%d-.L%d\n", VALUE, REL); \
else \
fprintf (FILE, "\tb .L%d\n\tnop\n", VALUE)
diff --git a/gcc/config/pa/pa-protos.h b/gcc/config/pa/pa-protos.h
index f5f15cb3fd3..9bf5e97e32c 100644
--- a/gcc/config/pa/pa-protos.h
+++ b/gcc/config/pa/pa-protos.h
@@ -40,6 +40,7 @@ extern const char *output_ior (rtx *);
extern const char *output_move_double (rtx *);
extern const char *output_fp_move_double (rtx *);
extern const char *output_block_move (rtx *, int);
+extern const char *output_block_clear (rtx *, int);
extern const char *output_cbranch (rtx *, int, int, int, rtx);
extern const char *output_lbranch (rtx, rtx);
extern const char *output_bb (rtx *, int, int, int, rtx, int);
@@ -63,6 +64,7 @@ extern struct rtx_def *gen_cmp_fp (enum rtx_code, rtx, rtx);
extern void hppa_encode_label (rtx);
extern int arith11_operand (rtx, enum machine_mode);
extern int adddi3_operand (rtx, enum machine_mode);
+extern int indexed_memory_operand (rtx, enum machine_mode);
extern int symbolic_expression_p (rtx);
extern int symbolic_memory_operand (rtx, enum machine_mode);
extern int pa_adjust_insn_length (rtx, int);
@@ -72,16 +74,16 @@ extern int arith5_operand (rtx, enum machine_mode);
extern int uint5_operand (rtx, enum machine_mode);
extern int pic_label_operand (rtx, enum machine_mode);
extern int plus_xor_ior_operator (rtx, enum machine_mode);
-extern int basereg_operand (rtx, enum machine_mode);
+extern int borx_reg_operand (rtx, enum machine_mode);
extern int shadd_operand (rtx, enum machine_mode);
extern int arith_operand (rtx, enum machine_mode);
extern int read_only_operand (rtx, enum machine_mode);
-extern int move_operand (rtx, enum machine_mode);
+extern int move_dest_operand (rtx, enum machine_mode);
+extern int move_src_operand (rtx, enum machine_mode);
extern int and_operand (rtx, enum machine_mode);
extern int ior_operand (rtx, enum machine_mode);
extern int arith32_operand (rtx, enum machine_mode);
extern int uint32_operand (rtx, enum machine_mode);
-extern int reg_or_nonsymb_mem_operand (rtx, enum machine_mode);
extern int reg_before_reload_operand (rtx, enum machine_mode);
extern int reg_or_0_operand (rtx, enum machine_mode);
extern int reg_or_0_or_nonsymb_mem_operand (rtx, enum machine_mode);
diff --git a/gcc/config/pa/pa.c b/gcc/config/pa/pa.c
index 366128c2c25..6cc3deb57e0 100644
--- a/gcc/config/pa/pa.c
+++ b/gcc/config/pa/pa.c
@@ -94,6 +94,7 @@ hppa_fpstore_bypass_p (rtx out_insn, rtx in_insn)
#endif
#endif
+static void copy_reg_pointer (rtx, rtx);
static int hppa_address_cost (rtx);
static bool hppa_rtx_costs (rtx, int, int, int *);
static inline rtx force_mode (enum machine_mode, rtx);
@@ -103,7 +104,8 @@ static int pa_can_combine_p (rtx, rtx, rtx, int, rtx, rtx, rtx);
static int forward_branch_p (rtx);
static int shadd_constant_p (int);
static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *);
-static int compute_movstrsi_length (rtx);
+static int compute_movstr_length (rtx);
+static int compute_clrstr_length (rtx);
static bool pa_assemble_integer (rtx, unsigned int, int);
static void remove_useless_addtr_insns (int);
static void store_reg (int, int, int);
@@ -380,6 +382,16 @@ pa_init_builtins (void)
#endif
}
+/* If FROM is a probable pointer register, mark TO as a probable
+ pointer register with the same pointer alignment as FROM. */
+
+static void
+copy_reg_pointer (rtx to, rtx from)
+{
+ if (REG_POINTER (from))
+ mark_reg_pointer (to, REGNO_POINTER_ALIGN (REGNO (from)));
+}
+
/* Return nonzero only if OP is a register of mode MODE,
or CONST0_RTX. */
int
@@ -447,21 +459,6 @@ symbolic_memory_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
|| GET_CODE (op) == HIGH || GET_CODE (op) == LABEL_REF);
}
-/* Return 1 if the operand is either a register or a memory operand that is
- not symbolic. */
-
-int
-reg_or_nonsymb_mem_operand (rtx op, enum machine_mode mode)
-{
- if (register_operand (op, mode))
- return 1;
-
- if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode))
- return 1;
-
- return 0;
-}
-
/* Return 1 if the operand is either a register, zero, or a memory operand
that is not symbolic. */
@@ -474,10 +471,24 @@ reg_or_0_or_nonsymb_mem_operand (rtx op, enum machine_mode mode)
if (op == CONST0_RTX (mode))
return 1;
- if (memory_operand (op, mode) && ! symbolic_memory_operand (op, mode))
- return 1;
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
- return 0;
+ if (GET_CODE (op) != MEM)
+ return 0;
+
+ /* Until problems with management of the REG_POINTER flag are resolved,
+ we need to delay creating move insns with unscaled indexed addresses
+ until CSE is not expected. */
+ if (!TARGET_NO_SPACE_REGS
+ && !cse_not_expected
+ && GET_CODE (XEXP (op, 0)) == PLUS
+ && REG_P (XEXP (XEXP (op, 0), 0))
+ && REG_P (XEXP (XEXP (op, 0), 1)))
+ return 0;
+
+ return (!symbolic_memory_operand (op, mode)
+ && memory_address_p (mode, XEXP (op, 0)));
}
/* Return 1 if the operand is a register operand or a non-symbolic memory
@@ -498,7 +509,7 @@ reg_before_reload_operand (rtx op, enum machine_mode mode)
if (reload_completed
&& memory_operand (op, mode)
- && ! symbolic_memory_operand (op, mode))
+ && !symbolic_memory_operand (op, mode))
return 1;
return 0;
@@ -515,10 +526,54 @@ cint_ok_for_move (HOST_WIDE_INT intval)
|| CONST_OK_FOR_LETTER_P (intval, 'K'));
}
-/* Accept anything that can be moved in one instruction into a general
- register. */
+/* Return 1 iff OP is an indexed memory operand. */
+int
+indexed_memory_operand (rtx op, enum machine_mode mode)
+{
+ if (GET_MODE (op) != mode)
+ return 0;
+
+ /* Before reload, a (SUBREG (MEM...)) forces reloading into a register. */
+ if (reload_completed && GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode))
+ return 0;
+
+ op = XEXP (op, 0);
+
+ return (memory_address_p (mode, op) && IS_INDEX_ADDR_P (op));
+}
+
+/* Accept anything that can be used as a destination operand for a
+ move instruction. We don't accept indexed memory operands since
+ they are supported only for floating point stores. */
int
-move_operand (rtx op, enum machine_mode mode)
+move_dest_operand (rtx op, enum machine_mode mode)
+{
+ if (register_operand (op, mode))
+ return 1;
+
+ if (GET_MODE (op) != mode)
+ return 0;
+
+ if (GET_CODE (op) == SUBREG)
+ op = SUBREG_REG (op);
+
+ if (GET_CODE (op) != MEM || symbolic_memory_operand (op, mode))
+ return 0;
+
+ op = XEXP (op, 0);
+
+ return (memory_address_p (mode, op)
+ && !IS_INDEX_ADDR_P (op)
+ && !IS_LO_SUM_DLT_ADDR_P (op));
+}
+
+/* Accept anything that can be used as a source operand for a move
+ instruction. */
+int
+move_src_operand (rtx op, enum machine_mode mode)
{
if (register_operand (op, mode))
return 1;
@@ -529,41 +584,26 @@ move_operand (rtx op, enum machine_mode mode)
if (GET_CODE (op) == CONST_INT)
return cint_ok_for_move (INTVAL (op));
+ if (GET_MODE (op) != mode)
+ return 0;
+
if (GET_CODE (op) == SUBREG)
op = SUBREG_REG (op);
+
if (GET_CODE (op) != MEM)
return 0;
- op = XEXP (op, 0);
-
- /* 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
- && GET_MODE (op) == Pmode)
- return 1;
-
- /* Since move_operand is only used for source operands, we can always
- allow scaled indexing! */
- if (! TARGET_DISABLE_INDEXING
- && GET_CODE (op) == PLUS
- && ((GET_CODE (XEXP (op, 0)) == MULT
- && GET_CODE (XEXP (XEXP (op, 0), 0)) == REG
- && GET_CODE (XEXP (XEXP (op, 0), 1)) == CONST_INT
- && INTVAL (XEXP (XEXP (op, 0), 1))
- == (HOST_WIDE_INT) GET_MODE_SIZE (mode)
- && GET_CODE (XEXP (op, 1)) == REG)
- || (GET_CODE (XEXP (op, 1)) == MULT
- &&GET_CODE (XEXP (XEXP (op, 1), 0)) == REG
- && GET_CODE (XEXP (XEXP (op, 1), 1)) == CONST_INT
- && INTVAL (XEXP (XEXP (op, 1), 1))
- == (HOST_WIDE_INT) GET_MODE_SIZE (mode)
- && GET_CODE (XEXP (op, 0)) == REG)))
- return 1;
+ /* Until problems with management of the REG_POINTER flag are resolved,
+ we need to delay creating move insns with unscaled indexed addresses
+ until CSE is not expected. */
+ if (!TARGET_NO_SPACE_REGS
+ && !cse_not_expected
+ && GET_CODE (XEXP (op, 0)) == PLUS
+ && REG_P (XEXP (XEXP (op, 0), 0))
+ && REG_P (XEXP (XEXP (op, 0), 1)))
+ return 0;
- return memory_address_p (mode, op);
+ return memory_address_p (mode, XEXP (op, 0));
}
/* Accept REG and any CONST_INT that can be moved in one instruction into a
@@ -574,10 +614,7 @@ reg_or_cint_move_operand (rtx op, enum machine_mode mode)
if (register_operand (op, mode))
return 1;
- if (GET_CODE (op) == CONST_INT)
- return cint_ok_for_move (INTVAL (op));
-
- return 0;
+ return (GET_CODE (op) == CONST_INT && cint_ok_for_move (INTVAL (op)));
}
int
@@ -830,6 +867,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
So instead we just emit the raw set, which avoids the movXX
expanders completely. */
+ mark_reg_pointer (reg, BITS_PER_UNIT);
emit_insn (gen_rtx_SET (VOIDmode, reg, orig));
current_function_uses_pic_offset_table = 1;
return reg;
@@ -860,6 +898,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
current_function_uses_pic_offset_table = 1;
MEM_NOTRAP_P (pic_ref) = 1;
RTX_UNCHANGING_P (pic_ref) = 1;
+ mark_reg_pointer (reg, BITS_PER_UNIT);
insn = emit_move_insn (reg, pic_ref);
/* Put a REG_EQUAL note on this insn, so that it can be optimized. */
@@ -884,7 +923,9 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
orig = legitimize_pic_address (XEXP (XEXP (orig, 0), 1), Pmode,
base == reg ? 0 : reg);
}
- else abort ();
+ else
+ abort ();
+
if (GET_CODE (orig) == CONST_INT)
{
if (INT_14_BITS (orig))
@@ -894,6 +935,7 @@ legitimize_pic_address (rtx orig, enum machine_mode mode, rtx reg)
pic_ref = gen_rtx_PLUS (Pmode, base, orig);
/* Likewise, should we set special REG_NOTEs here? */
}
+
return pic_ref;
}
@@ -954,6 +996,18 @@ hppa_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
{
rtx orig = x;
+ /* We need to canonicalize the order of operands in unscaled indexed
+ addresses since the code that checks if an address is valid doesn't
+ always try both orders. */
+ if (!TARGET_NO_SPACE_REGS
+ && GET_CODE (x) == PLUS
+ && GET_MODE (x) == Pmode
+ && REG_P (XEXP (x, 0))
+ && REG_P (XEXP (x, 1))
+ && REG_POINTER (XEXP (x, 0))
+ && !REG_POINTER (XEXP (x, 1)))
+ return gen_rtx_PLUS (Pmode, XEXP (x, 1), XEXP (x, 0));
+
if (flag_pic)
return legitimize_pic_address (x, mode, gen_reg_rtx (Pmode));
@@ -1422,6 +1476,36 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
register rtx operand1 = operands[1];
register rtx tem;
+ /* We can only handle indexed addresses in the destination operand
+ of floating point stores. Thus, we need to break out indexed
+ addresses from the destination operand. */
+ if (GET_CODE (operand0) == MEM && IS_INDEX_ADDR_P (XEXP (operand0, 0)))
+ {
+ /* This is only safe up to the beginning of life analysis. */
+ if (no_new_pseudos)
+ abort ();
+
+ tem = copy_to_mode_reg (Pmode, XEXP (operand0, 0));
+ operand0 = replace_equiv_address (operand0, tem);
+ }
+
+ /* On targets with non-equivalent space registers, break out unscaled
+ indexed addresses from the source operand before the final CSE.
+ We have to do this because the REG_POINTER flag is not correctly
+ carried through various optimization passes and CSE may substitute
+ a pseudo without the pointer set for one with the pointer set. As
+ a result, we loose various opportunites to create insns with
+ unscaled indexed addresses. */
+ if (!TARGET_NO_SPACE_REGS
+ && !cse_not_expected
+ && GET_CODE (operand1) == MEM
+ && GET_CODE (XEXP (operand1, 0)) == PLUS
+ && REG_P (XEXP (XEXP (operand1, 0), 0))
+ && REG_P (XEXP (XEXP (operand1, 0), 1)))
+ operand1
+ = replace_equiv_address (operand1,
+ copy_to_mode_reg (Pmode, XEXP (operand1, 0)));
+
if (scratch_reg
&& reload_in_progress && GET_CODE (operand0) == REG
&& REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
@@ -1460,6 +1544,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
&& ((tem = find_replacement (&XEXP (operand0, 0)))
!= XEXP (operand0, 0)))
operand0 = gen_rtx_MEM (GET_MODE (operand0), tem);
+
if (scratch_reg && reload_in_progress && GET_CODE (operand1) == MEM
&& ((tem = find_replacement (&XEXP (operand1, 0)))
!= XEXP (operand1, 0)))
@@ -1470,7 +1555,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
(subreg (mem (addr))) cases. */
if (fp_reg_operand (operand0, mode)
&& ((GET_CODE (operand1) == MEM
- && ! memory_address_p (DFmode, XEXP (operand1, 0)))
+ && !memory_address_p (DFmode, XEXP (operand1, 0)))
|| ((GET_CODE (operand1) == SUBREG
&& GET_CODE (XEXP (operand1, 0)) == MEM
&& !memory_address_p (DFmode, XEXP (XEXP (operand1, 0), 0)))))
@@ -1489,10 +1574,11 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
if (!memory_address_p (Pmode, XEXP (operand1, 0)))
{
emit_move_insn (scratch_reg, XEXP (XEXP (operand1, 0), 1));
- emit_move_insn (scratch_reg, gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)),
- Pmode,
- XEXP (XEXP (operand1, 0), 0),
- scratch_reg));
+ emit_move_insn (scratch_reg,
+ gen_rtx_fmt_ee (GET_CODE (XEXP (operand1, 0)),
+ Pmode,
+ XEXP (XEXP (operand1, 0), 0),
+ scratch_reg));
}
else
emit_move_insn (scratch_reg, XEXP (operand1, 0));
@@ -1505,7 +1591,8 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
&& ! memory_address_p (DFmode, XEXP (operand0, 0)))
|| ((GET_CODE (operand0) == SUBREG)
&& GET_CODE (XEXP (operand0, 0)) == MEM
- && !memory_address_p (DFmode, XEXP (XEXP (operand0, 0), 0))))
+ && !memory_address_p (DFmode,
+ XEXP (XEXP (operand0, 0), 0))))
&& scratch_reg)
{
if (GET_CODE (operand0) == SUBREG)
@@ -1617,7 +1704,7 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
emit_move_insn (operand0, scratch_reg);
return 1;
}
- /* Handle most common case: storing into a register. */
+ /* Handle the most common case: storing into a register. */
else if (register_operand (operand0, mode))
{
if (register_operand (operand1, mode)
@@ -1629,7 +1716,67 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
/* Only `general_operands' can come here, so MEM is ok. */
|| GET_CODE (operand1) == MEM)
{
- /* Run this case quickly. */
+ /* Various sets are created during RTL generation which don't
+ have the REG_POINTER flag correctly set. After the CSE pass,
+ instruction recognition can fail if we don't consistently
+ set this flag when performing register copies. This should
+ also improve the opportunities for creating insns that use
+ unscaled indexing. */
+ if (REG_P (operand0) && REG_P (operand1))
+ {
+ if (REG_POINTER (operand1)
+ && !REG_POINTER (operand0)
+ && !HARD_REGISTER_P (operand0))
+ copy_reg_pointer (operand0, operand1);
+ else if (REG_POINTER (operand0)
+ && !REG_POINTER (operand1)
+ && !HARD_REGISTER_P (operand1))
+ copy_reg_pointer (operand1, operand0);
+ }
+
+ /* When MEMs are broken out, the REG_POINTER flag doesn't
+ get set. In some cases, we can set the REG_POINTER flag
+ from the declaration for the MEM. */
+ if (REG_P (operand0)
+ && GET_CODE (operand1) == MEM
+ && !REG_POINTER (operand0))
+ {
+ tree decl = MEM_EXPR (operand1);
+
+ /* Set the register pointer flag and register alignment
+ if the declaration for this memory reference is a
+ pointer type. Fortran indirect argument references
+ are ignored. */
+ if (decl
+ && !(flag_argument_noalias > 1
+ && TREE_CODE (decl) == INDIRECT_REF
+ && TREE_CODE (TREE_OPERAND (decl, 0)) == PARM_DECL))
+ {
+ tree type;
+
+ /* If this is a COMPONENT_REF, use the FIELD_DECL from
+ tree operand 1. */
+ if (TREE_CODE (decl) == COMPONENT_REF)
+ decl = TREE_OPERAND (decl, 1);
+
+ type = TREE_TYPE (decl);
+ if (TREE_CODE (type) == ARRAY_TYPE)
+ type = get_inner_array_type (type);
+
+ if (POINTER_TYPE_P (type))
+ {
+ int align;
+
+ type = TREE_TYPE (type);
+ /* Using TYPE_ALIGN_OK is rather conservative as
+ only the ada frontend actually sets it. */
+ align = (TYPE_ALIGN_OK (type) ? TYPE_ALIGN (type)
+ : BITS_PER_UNIT);
+ mark_reg_pointer (operand0, align);
+ }
+ }
+ }
+
emit_insn (gen_rtx_SET (VOIDmode, operand0, operand1));
return 1;
}
@@ -1776,6 +1923,8 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
else
{
operands[1] = legitimize_pic_address (operand1, mode, temp);
+ if (REG_P (operand0) && REG_P (operands[1]))
+ copy_reg_pointer (operand0, operands[1]);
emit_insn (gen_rtx_SET (VOIDmode, operand0, operands[1]));
}
}
@@ -1803,9 +1952,10 @@ emit_move_sequence (rtx *operands, enum machine_mode mode, rtx scratch_reg)
Don't mark hard registers though. That loses. */
if (GET_CODE (operand0) == REG
&& REGNO (operand0) >= FIRST_PSEUDO_REGISTER)
- REG_POINTER (operand0) = 1;
+ mark_reg_pointer (operand0, BITS_PER_UNIT);
if (REGNO (temp) >= FIRST_PSEUDO_REGISTER)
- REG_POINTER (temp) = 1;
+ mark_reg_pointer (temp, BITS_PER_UNIT);
+
if (ishighonly)
set = gen_rtx_SET (mode, operand0, temp);
else
@@ -2431,8 +2581,8 @@ find_addr_reg (rtx addr)
OPERANDS[0] is the destination pointer as a REG, clobbered.
OPERANDS[1] is the source pointer as a REG, clobbered.
OPERANDS[2] is a register for temporary storage.
- OPERANDS[4] is the size as a CONST_INT
OPERANDS[3] is a register for temporary storage.
+ OPERANDS[4] is the size as a CONST_INT
OPERANDS[5] is the alignment safe to use, as a CONST_INT.
OPERANDS[6] is another temporary register. */
@@ -2442,15 +2592,43 @@ output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED)
int align = INTVAL (operands[5]);
unsigned long n_bytes = INTVAL (operands[4]);
- /* We can't move more than four bytes at a time because the PA
+ /* We can't move more than a word at a time because the PA
has no longer integer move insns. (Could use fp mem ops?) */
- if (align > 4)
- align = 4;
+ if (align > (TARGET_64BIT ? 8 : 4))
+ align = (TARGET_64BIT ? 8 : 4);
/* Note that we know each loop below will execute at least twice
(else we would have open-coded the copy). */
switch (align)
{
+ case 8:
+ /* Pre-adjust the loop counter. */
+ operands[4] = GEN_INT (n_bytes - 16);
+ output_asm_insn ("ldi %4,%2", operands);
+
+ /* Copying loop. */
+ output_asm_insn ("ldd,ma 8(%1),%3", operands);
+ output_asm_insn ("ldd,ma 8(%1),%6", operands);
+ output_asm_insn ("std,ma %3,8(%0)", operands);
+ output_asm_insn ("addib,>= -16,%2,.-12", operands);
+ output_asm_insn ("std,ma %6,8(%0)", operands);
+
+ /* Handle the residual. There could be up to 7 bytes of
+ residual to copy! */
+ if (n_bytes % 16 != 0)
+ {
+ operands[4] = GEN_INT (n_bytes % 8);
+ if (n_bytes % 16 >= 8)
+ output_asm_insn ("ldd,ma 8(%1),%3", operands);
+ if (n_bytes % 8 != 0)
+ output_asm_insn ("ldd 0(%1),%6", operands);
+ if (n_bytes % 16 >= 8)
+ output_asm_insn ("std,ma %3,8(%0)", operands);
+ if (n_bytes % 8 != 0)
+ output_asm_insn ("stdby,e %6,%4(%0)", operands);
+ }
+ return "";
+
case 4:
/* Pre-adjust the loop counter. */
operands[4] = GEN_INT (n_bytes - 8);
@@ -2536,7 +2714,7 @@ output_block_move (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED)
count insns rather than emit them. */
static int
-compute_movstrsi_length (rtx insn)
+compute_movstr_length (rtx insn)
{
rtx pat = PATTERN (insn);
unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 7), 0));
@@ -2545,8 +2723,8 @@ compute_movstrsi_length (rtx insn)
/* We can't move more than four bytes at a time because the PA
has no longer integer move insns. (Could use fp mem ops?) */
- if (align > 4)
- align = 4;
+ if (align > (TARGET_64BIT ? 8 : 4))
+ align = (TARGET_64BIT ? 8 : 4);
/* The basic copying loop. */
n_insns = 6;
@@ -2564,6 +2742,148 @@ compute_movstrsi_length (rtx insn)
/* Lengths are expressed in bytes now; each insn is 4 bytes. */
return n_insns * 4;
}
+
+/* Emit code to perform a block clear.
+
+ OPERANDS[0] is the destination pointer as a REG, clobbered.
+ OPERANDS[1] is a register for temporary storage.
+ OPERANDS[2] is the size as a CONST_INT
+ OPERANDS[3] is the alignment safe to use, as a CONST_INT. */
+
+const char *
+output_block_clear (rtx *operands, int size_is_constant ATTRIBUTE_UNUSED)
+{
+ int align = INTVAL (operands[3]);
+ unsigned long n_bytes = INTVAL (operands[2]);
+
+ /* We can't clear more than a word at a time because the PA
+ has no longer integer move insns. */
+ if (align > (TARGET_64BIT ? 8 : 4))
+ align = (TARGET_64BIT ? 8 : 4);
+
+ /* Note that we know each loop below will execute at least twice
+ (else we would have open-coded the copy). */
+ switch (align)
+ {
+ case 8:
+ /* Pre-adjust the loop counter. */
+ operands[2] = GEN_INT (n_bytes - 16);
+ output_asm_insn ("ldi %2,%1", operands);
+
+ /* Loop. */
+ output_asm_insn ("std,ma %%r0,8(%0)", operands);
+ output_asm_insn ("addib,>= -16,%1,.-4", operands);
+ output_asm_insn ("std,ma %%r0,8(%0)", operands);
+
+ /* Handle the residual. There could be up to 7 bytes of
+ residual to copy! */
+ if (n_bytes % 16 != 0)
+ {
+ operands[2] = GEN_INT (n_bytes % 8);
+ if (n_bytes % 16 >= 8)
+ output_asm_insn ("std,ma %%r0,8(%0)", operands);
+ if (n_bytes % 8 != 0)
+ output_asm_insn ("stdby,e %%r0,%2(%0)", operands);
+ }
+ return "";
+
+ case 4:
+ /* Pre-adjust the loop counter. */
+ operands[2] = GEN_INT (n_bytes - 8);
+ output_asm_insn ("ldi %2,%1", operands);
+
+ /* Loop. */
+ output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands);
+ output_asm_insn ("addib,>= -8,%1,.-4", operands);
+ output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands);
+
+ /* Handle the residual. There could be up to 7 bytes of
+ residual to copy! */
+ if (n_bytes % 8 != 0)
+ {
+ operands[2] = GEN_INT (n_bytes % 4);
+ if (n_bytes % 8 >= 4)
+ output_asm_insn ("{stws|stw},ma %%r0,4(%0)", operands);
+ if (n_bytes % 4 != 0)
+ output_asm_insn ("{stbys|stby},e %%r0,%2(%0)", operands);
+ }
+ return "";
+
+ case 2:
+ /* Pre-adjust the loop counter. */
+ operands[2] = GEN_INT (n_bytes - 4);
+ output_asm_insn ("ldi %2,%1", operands);
+
+ /* Loop. */
+ output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands);
+ output_asm_insn ("addib,>= -4,%1,.-4", operands);
+ output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands);
+
+ /* Handle the residual. */
+ if (n_bytes % 4 != 0)
+ {
+ if (n_bytes % 4 >= 2)
+ output_asm_insn ("{sths|sth},ma %%r0,2(%0)", operands);
+ if (n_bytes % 2 != 0)
+ output_asm_insn ("stb %%r0,0(%0)", operands);
+ }
+ return "";
+
+ case 1:
+ /* Pre-adjust the loop counter. */
+ operands[2] = GEN_INT (n_bytes - 2);
+ output_asm_insn ("ldi %2,%1", operands);
+
+ /* Loop. */
+ output_asm_insn ("{stbs|stb},ma %%r0,1(%0)", operands);
+ output_asm_insn ("addib,>= -2,%1,.-4", operands);
+ output_asm_insn ("{stbs|stb},ma %%r0,1(%0)", operands);
+
+ /* Handle the residual. */
+ if (n_bytes % 2 != 0)
+ output_asm_insn ("stb %%r0,0(%0)", operands);
+
+ return "";
+
+ default:
+ abort ();
+ }
+}
+
+/* Count the number of insns necessary to handle this block move.
+
+ Basic structure is the same as emit_block_move, except that we
+ count insns rather than emit them. */
+
+static int
+compute_clrstr_length (rtx insn)
+{
+ rtx pat = PATTERN (insn);
+ unsigned int align = INTVAL (XEXP (XVECEXP (pat, 0, 4), 0));
+ unsigned long n_bytes = INTVAL (XEXP (XVECEXP (pat, 0, 3), 0));
+ unsigned int n_insns = 0;
+
+ /* We can't clear more than a word at a time because the PA
+ has no longer integer move insns. */
+ if (align > (TARGET_64BIT ? 8 : 4))
+ align = (TARGET_64BIT ? 8 : 4);
+
+ /* The basic loop. */
+ n_insns = 4;
+
+ /* Residuals. */
+ if (n_bytes % (2 * align) != 0)
+ {
+ if ((n_bytes % (2 * align)) >= align)
+ n_insns++;
+
+ if ((n_bytes % align) != 0)
+ n_insns++;
+ }
+
+ /* Lengths are expressed in bytes now; each insn is 4 bytes. */
+ return n_insns * 4;
+}
const char *
@@ -3868,12 +4188,17 @@ hppa_pic_save_rtx (void)
void
hppa_profile_hook (int label_no)
{
+ /* We use SImode for the address of the function in both 32 and
+ 64-bit code to avoid having to provide DImode versions of the
+ lcla2 and load_offset_label_address insn patterns. */
+ rtx reg = gen_reg_rtx (SImode);
+ rtx label_rtx = gen_label_rtx ();
rtx begin_label_rtx, call_insn;
char begin_label_name[16];
ASM_GENERATE_INTERNAL_LABEL (begin_label_name, FUNC_BEGIN_PROLOG_LABEL,
label_no);
- begin_label_rtx = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (begin_label_name));
+ begin_label_rtx = gen_rtx_SYMBOL_REF (SImode, ggc_strdup (begin_label_name));
if (TARGET_64BIT)
emit_move_insn (arg_pointer_rtx,
@@ -3882,6 +4207,18 @@ hppa_profile_hook (int label_no)
emit_move_insn (gen_rtx_REG (word_mode, 26), gen_rtx_REG (word_mode, 2));
+ /* The address of the function is loaded into %r25 with a instruction-
+ relative sequence that avoids the use of relocations. The sequence
+ is split so that the load_offset_label_address instruction can
+ occupy the delay slot of the call to _mcount. */
+ if (TARGET_PA_20)
+ emit_insn (gen_lcla2 (reg, label_rtx));
+ else
+ emit_insn (gen_lcla1 (reg, label_rtx));
+
+ emit_insn (gen_load_offset_label_address (gen_rtx_REG (SImode, 25),
+ reg, begin_label_rtx, label_rtx));
+
#ifndef NO_PROFILE_COUNTERS
{
rtx count_label_rtx, addr, r24;
@@ -3894,35 +4231,31 @@ hppa_profile_hook (int label_no)
r24 = gen_rtx_REG (Pmode, 24);
emit_move_insn (r24, addr);
- /* %r25 is set from within the output pattern. */
call_insn =
- emit_call_insn (gen_call_profiler (gen_rtx_SYMBOL_REF (Pmode, "_mcount"),
- GEN_INT (TARGET_64BIT ? 24 : 12),
- begin_label_rtx));
+ emit_call_insn (gen_call (gen_rtx_MEM (Pmode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ "_mcount")),
+ GEN_INT (TARGET_64BIT ? 24 : 12)));
use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), r24);
}
#else
- /* %r25 is set from within the output pattern. */
+
call_insn =
- emit_call_insn (gen_call_profiler (gen_rtx_SYMBOL_REF (Pmode, "_mcount"),
- GEN_INT (TARGET_64BIT ? 16 : 8),
- begin_label_rtx));
+ emit_call_insn (gen_call (gen_rtx_MEM (Pmode,
+ gen_rtx_SYMBOL_REF (Pmode,
+ "_mcount")),
+ GEN_INT (TARGET_64BIT ? 16 : 8)));
+
#endif
+ use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), gen_rtx_REG (SImode, 25));
+ use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), gen_rtx_REG (SImode, 26));
+
/* Indicate the _mcount call cannot throw, nor will it execute a
non-local goto. */
REG_NOTES (call_insn)
= gen_rtx_EXPR_LIST (REG_EH_REGION, constm1_rtx, REG_NOTES (call_insn));
-
- if (flag_pic)
- {
- use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), pic_offset_table_rtx);
- if (TARGET_64BIT)
- use_reg (&CALL_INSN_FUNCTION_USAGE (call_insn), arg_pointer_rtx);
-
- emit_move_insn (pic_offset_table_rtx, hppa_pic_save_rtx ());
- }
}
/* Fetch the return address for the frame COUNT steps up from
@@ -4319,8 +4652,8 @@ pa_adjust_insn_length (rtx insn, int length)
/* Jumps inside switch tables which have unfilled delay slots need
adjustment. */
if (GET_CODE (insn) == JUMP_INSN
- && simplejump_p (insn)
- && GET_MODE (insn) == SImode)
+ && GET_CODE (pat) == PARALLEL
+ && get_attr_type (insn) == TYPE_BTABLE_BRANCH)
return 4;
/* Millicode insn with an unfilled delay slot. */
else if (GET_CODE (insn) == INSN
@@ -4337,7 +4670,15 @@ pa_adjust_insn_length (rtx insn, int length)
&& GET_CODE (XEXP (XVECEXP (pat, 0, 0), 1)) == MEM
&& GET_MODE (XEXP (XVECEXP (pat, 0, 0), 0)) == BLKmode
&& GET_MODE (XEXP (XVECEXP (pat, 0, 0), 1)) == BLKmode)
- return compute_movstrsi_length (insn) - 4;
+ return compute_movstr_length (insn) - 4;
+ /* Block clear 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
+ && XEXP (XVECEXP (pat, 0, 0), 1) == const0_rtx
+ && GET_MODE (XEXP (XVECEXP (pat, 0, 0), 0)) == BLKmode)
+ return compute_clrstr_length (insn) - 4;
/* Conditional branch with an unfilled delay slot. */
else if (GET_CODE (insn) == JUMP_INSN && ! simplejump_p (insn))
{
@@ -4637,8 +4978,14 @@ print_operand (FILE *file, rtx x, int code)
fputs (",ma", file);
break;
case PLUS:
- if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT
- || GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT)
+ if (GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG)
+ {
+ if (ASSEMBLER_DIALECT == 0)
+ fputs ("x", file);
+ }
+ else if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT
+ || GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT)
{
if (ASSEMBLER_DIALECT == 0)
fputs ("x,s", file);
@@ -4713,20 +5060,33 @@ print_operand (FILE *file, rtx x, int code)
base = XEXP (XEXP (x, 0), 0);
fprintf (file, "%d(%s)", size, reg_names [REGNO (base)]);
break;
- default:
- if (GET_CODE (XEXP (x, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT)
+ case PLUS:
+ if (GET_CODE (XEXP (XEXP (x, 0), 0)) == MULT)
fprintf (file, "%s(%s)",
reg_names [REGNO (XEXP (XEXP (XEXP (x, 0), 0), 0))],
reg_names [REGNO (XEXP (XEXP (x, 0), 1))]);
- else if (GET_CODE (XEXP (x, 0)) == PLUS
- && GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT)
+ else if (GET_CODE (XEXP (XEXP (x, 0), 1)) == MULT)
fprintf (file, "%s(%s)",
reg_names [REGNO (XEXP (XEXP (XEXP (x, 0), 1), 0))],
reg_names [REGNO (XEXP (XEXP (x, 0), 0))]);
+ else if (GET_CODE (XEXP (XEXP (x, 0), 0)) == REG
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == REG)
+ {
+ /* Because the REG_POINTER flag can get lost during reload,
+ GO_IF_LEGITIMATE_ADDRESS canonicalizes the order of the
+ index and base registers in the combined move patterns. */
+ rtx base = XEXP (XEXP (x, 0), 1);
+ rtx index = XEXP (XEXP (x, 0), 0);
+
+ fprintf (file, "%s(%s)",
+ reg_names [REGNO (index)], reg_names [REGNO (base)]);
+ }
else
output_address (XEXP (x, 0));
break;
+ default:
+ output_address (XEXP (x, 0));
+ break;
}
}
else
@@ -5579,6 +5939,12 @@ output_cbranch (rtx *operands, int nullify, int length, int negated, rtx insn)
if (next_real_insn (JUMP_LABEL (insn)) == next_real_insn (insn))
return "nop";
+ /* The doubleword form of the cmpib instruction doesn't have the LEU
+ and GTU conditions while the cmpb instruction does. Since we accept
+ zero for cmpb, we must ensure that we use cmpb for the comparison. */
+ if (GET_MODE (operands[1]) == DImode && operands[2] == const0_rtx)
+ operands[2] = gen_rtx_REG (DImode, 0);
+
/* If this is a long branch with its delay slot unfilled, set `nullify'
as it can nullify the delay slot and save a nop. */
if (length == 8 && dbr_sequence_length () == 0)
@@ -7646,32 +8012,33 @@ shadd_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
return (GET_CODE (op) == CONST_INT && shadd_constant_p (INTVAL (op)));
}
-/* Return 1 if OP is valid as a base register in a reg + reg address. */
+/* Return 1 if OP is valid as a base or index register in a
+ REG+REG address. */
int
-basereg_operand (rtx op, enum machine_mode mode)
+borx_reg_operand (rtx op, enum machine_mode mode)
{
- /* cse will create some unscaled indexed addresses, however; it
- generally isn't a win on the PA, so avoid creating unscaled
- indexed addresses until after cse is finished. */
- if (!cse_not_expected)
+ if (GET_CODE (op) != REG)
return 0;
- /* Allow any register when TARGET_NO_SPACE_REGS is in effect since
- we don't have to worry about the braindamaged implicit space
- register selection from the basereg. */
- if (TARGET_NO_SPACE_REGS)
- return (GET_CODE (op) == REG);
+ /* We must reject virtual registers as the only expressions that
+ can be instantiated are REG and REG+CONST. */
+ if (op == virtual_incoming_args_rtx
+ || op == virtual_stack_vars_rtx
+ || op == virtual_stack_dynamic_rtx
+ || op == virtual_outgoing_args_rtx
+ || op == virtual_cfa_rtx)
+ return 0;
/* While it's always safe to index off the frame pointer, it's not
- always profitable, particularly when the frame pointer is being
- eliminated. */
- if (! flag_omit_frame_pointer && op == frame_pointer_rtx)
- return 1;
+ profitable to do so when the frame pointer is being eliminated. */
+ if (!reload_completed
+ && flag_omit_frame_pointer
+ && !current_function_calls_alloca
+ && op == frame_pointer_rtx)
+ return 0;
- return (GET_CODE (op) == REG
- && REG_POINTER (op)
- && register_operand (op, mode));
+ return register_operand (op, mode);
}
/* Return 1 if this operand is anything other than a hard register. */
@@ -7848,7 +8215,8 @@ following_call (rtx insn)
The jump instructions within the table are special; we must be able
to identify them during assembly output (if the jumps don't get filled
we need to emit a nop rather than nullifying the delay slot)). We
- identify jumps in switch tables by marking the SET with DImode.
+ identify jumps in switch tables by using insns with the attribute
+ type TYPE_BTABLE_BRANCH.
We also surround the jump table itself with BEGIN_BRTAB and END_BRTAB
insns. This serves two purposes, first it prevents jump.c from
@@ -7874,7 +8242,7 @@ pa_reorg (void)
/* Find and explode all ADDR_VEC or ADDR_DIFF_VEC insns. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
- rtx pattern, tmp, location;
+ rtx pattern, tmp, location, label;
unsigned int length, i;
/* Find an ADDR_VEC or ADDR_DIFF_VEC insn to explode. */
@@ -7900,57 +8268,17 @@ pa_reorg (void)
location = NEXT_INSN (location);
if (GET_CODE (pattern) == ADDR_VEC)
- {
- /* Emit the jump itself. */
- tmp = gen_jump (XEXP (XVECEXP (pattern, 0, i), 0));
- tmp = emit_jump_insn_after (tmp, location);
- JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 0, i), 0);
- /* It is easy to rely on the branch table markers
- during assembly output to trigger the correct code
- for a switch table jump with an unfilled delay slot,
-
- However, that requires state and assumes that we look
- at insns in order.
-
- We can't make such assumptions when computing the length
- of instructions. Ugh. We could walk the insn chain to
- determine if this instruction is in a branch table, but
- that can get rather expensive, particularly during the
- branch shortening phase of the compiler.
-
- So instead we mark this jump as being special. This is
- far from ideal and knows that no code after this will
- muck around with the mode of the JUMP_INSN itself. */
- PUT_MODE (tmp, SImode);
- LABEL_NUSES (JUMP_LABEL (tmp))++;
- location = NEXT_INSN (location);
- }
+ label = XEXP (XVECEXP (pattern, 0, i), 0);
else
- {
- /* Emit the jump itself. */
- tmp = gen_jump (XEXP (XVECEXP (pattern, 1, i), 0));
- tmp = emit_jump_insn_after (tmp, location);
- JUMP_LABEL (tmp) = XEXP (XVECEXP (pattern, 1, i), 0);
- /* It is easy to rely on the branch table markers
- during assembly output to trigger the correct code
- for a switch table jump with an unfilled delay slot,
-
- However, that requires state and assumes that we look
- at insns in order.
-
- We can't make such assumptions when computing the length
- of instructions. Ugh. We could walk the insn chain to
- determine if this instruction is in a branch table, but
- that can get rather expensive, particularly during the
- branch shortening phase of the compiler.
-
- So instead we mark this jump as being special. This is
- far from ideal and knows that no code after this will
- muck around with the mode of the JUMP_INSN itself. */
- PUT_MODE (tmp, SImode);
- LABEL_NUSES (JUMP_LABEL (tmp))++;
- location = NEXT_INSN (location);
- }
+ label = XEXP (XVECEXP (pattern, 1, i), 0);
+
+ tmp = gen_short_jump (label);
+
+ /* Emit the jump itself. */
+ tmp = emit_jump_insn_after (tmp, location);
+ JUMP_LABEL (tmp) = label;
+ LABEL_NUSES (label)++;
+ location = NEXT_INSN (location);
/* Emit a BARRIER after the jump. */
emit_barrier_after (location);
@@ -7968,7 +8296,12 @@ pa_reorg (void)
}
else
{
- /* Sill need an end_brtab insn. */
+ /* Still need brtab marker insns. FIXME: the presence of these
+ markers disables output of the branch table to readonly memory,
+ and any alignment directives that might be needed. Possibly,
+ the begin_brtab insn should be output before the label for the
+ table. This doesn matter at the moment since the tables are
+ always output in the text section. */
for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
{
/* Find an ADDR_VEC insn. */
@@ -8612,10 +8945,8 @@ cmpib_comparison_operator (rtx op, enum machine_mode mode)
not be placed in the read-only data section. */
static void
-pa_select_section (exp, reloc, align)
- tree exp;
- int reloc;
- unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED;
+pa_select_section (tree exp, int reloc,
+ unsigned HOST_WIDE_INT align ATTRIBUTE_UNUSED)
{
if (TREE_CODE (exp) == VAR_DECL
&& TREE_READONLY (exp)
diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h
index ce69b3bc19b..312d58c4213 100644
--- a/gcc/config/pa/pa.h
+++ b/gcc/config/pa/pa.h
@@ -641,9 +641,9 @@ extern struct rtx_def *hppa_pic_save_rtx (void);
in some cases it is preferable to use a more restrictive class. */
#define PREFERRED_RELOAD_CLASS(X,CLASS) (CLASS)
-/* Return the register class of a scratch register needed to copy IN into
- or out of a register in CLASS in MODE. If it can be done directly
- NO_REGS is returned.
+/* Return the register class of a scratch register needed to copy
+ IN into a register in CLASS in MODE, or a register in CLASS in MODE
+ to IN. If it can be done directly NO_REGS is returned.
Avoid doing any work for the common case calls. */
@@ -993,7 +993,7 @@ extern int may_call_alloca;
#define TRAMPOLINE_TEMPLATE(FILE) \
{ \
- if (! TARGET_64BIT) \
+ if (!TARGET_64BIT) \
{ \
fputs ("\tldw 36(%r22),%r21\n", FILE); \
fputs ("\tbb,>=,n %r21,30,.+16\n", FILE); \
@@ -1003,10 +1003,20 @@ extern int may_call_alloca;
fputs ("\tdepwi 0,31,2,%r21\n", FILE); \
fputs ("\tldw 4(%r21),%r19\n", FILE); \
fputs ("\tldw 0(%r21),%r21\n", FILE); \
- fputs ("\tldsid (%r21),%r1\n", FILE); \
- fputs ("\tmtsp %r1,%sr0\n", FILE); \
- fputs ("\tbe 0(%sr0,%r21)\n", FILE); \
- fputs ("\tldw 40(%r22),%r29\n", FILE); \
+ if (TARGET_PA_20) \
+ { \
+ fputs ("\tbve (%r21)\n", FILE); \
+ fputs ("\tldw 40(%r22),%r29\n", FILE); \
+ fputs ("\t.word 0\n", FILE); \
+ fputs ("\t.word 0\n", FILE); \
+ } \
+ else \
+ { \
+ fputs ("\tldsid (%r21),%r1\n", FILE); \
+ fputs ("\tmtsp %r1,%sr0\n", FILE); \
+ fputs ("\tbe 0(%sr0,%r21)\n", FILE); \
+ fputs ("\tldw 40(%r22),%r29\n", FILE); \
+ } \
fputs ("\t.word 0\n", FILE); \
fputs ("\t.word 0\n", FILE); \
fputs ("\t.word 0\n", FILE); \
@@ -1029,16 +1039,21 @@ extern int may_call_alloca;
} \
}
-/* Length in units of the trampoline for entering a nested function.
+/* Length in units of the trampoline for entering a nested function. */
+
+#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
- Flush the cache entries corresponding to the first and last addresses
- of the trampoline. This is necessary as the trampoline may cross two
- cache lines.
+/* Length in units of the trampoline instruction code. */
- If the code part of the trampoline ever grows to > 32 bytes, then it
- will become necessary to hack on the cacheflush pattern in pa.md. */
+#define TRAMPOLINE_CODE_SIZE (TARGET_64BIT ? 24 : (TARGET_PA_20 ? 32 : 40))
-#define TRAMPOLINE_SIZE (TARGET_64BIT ? 72 : 52)
+/* Minimum length of a cache line. A length of 16 will work on all
+ PA-RISC processors. All PA 1.1 processors have a cache line of
+ 32 bytes. Most but not all PA 2.0 processors have a cache line
+ of 64 bytes. As cache flushes are expensive and we don't support
+ PA 1.0, we use a minimum length of 32. */
+
+#define MIN_CACHELINE_SIZE 32
/* Emit RTL insns to initialize the variable parts of a trampoline.
FNADDR is an RTX for the address of the function's pure code.
@@ -1048,55 +1063,87 @@ extern int may_call_alloca;
Move the static chain value to trampoline template at offset 40.
Move the trampoline address to trampoline template at offset 44.
Move r19 to trampoline template at offset 48. The latter two
- words create a plabel for the indirect call to the trampoline. */
+ words create a plabel for the indirect call to the trampoline.
+
+ A similar sequence is used for the 64-bit port but the plabel is
+ at the beginning of the trampoline.
+
+ Finally, the cache entries for the trampoline code are flushed.
+ This is necessary to ensure that the trampoline instruction sequence
+ is written to memory prior to any attempts at prefetching the code
+ sequence. */
#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \
{ \
- if (! TARGET_64BIT) \
+ rtx start_addr = gen_reg_rtx (Pmode); \
+ rtx end_addr = gen_reg_rtx (Pmode); \
+ rtx line_length = gen_reg_rtx (Pmode); \
+ rtx tmp; \
+ \
+ if (!TARGET_64BIT) \
{ \
- rtx start_addr, end_addr; \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 36)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 40)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \
\
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 36)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 40)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 44)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (TRAMP)); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 48)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), \
+ /* Create a fat pointer for the trampoline. */ \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 44)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), (TRAMP)); \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 48)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
gen_rtx_REG (Pmode, 19)); \
+ \
/* fdc and fic only use registers for the address to flush, \
- they do not accept integer displacements. */ \
- start_addr = force_reg (Pmode, (TRAMP)); \
- end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \
- emit_insn (gen_dcacheflush (start_addr, end_addr)); \
- end_addr = force_reg (Pmode, plus_constant (start_addr, 32)); \
- emit_insn (gen_icacheflush (start_addr, end_addr, start_addr, \
- gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));\
+ they do not accept integer displacements. We align the \
+ start and end addresses to the beginning of their respective \
+ cache lines to minimize the number of lines flushed. */ \
+ tmp = force_reg (Pmode, (TRAMP)); \
+ emit_insn (gen_andsi3 (start_addr, tmp, \
+ GEN_INT (-MIN_CACHELINE_SIZE))); \
+ tmp = force_reg (Pmode, \
+ plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \
+ emit_insn (gen_andsi3 (end_addr, tmp, \
+ GEN_INT (-MIN_CACHELINE_SIZE))); \
+ emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \
+ emit_insn (gen_dcacheflush (start_addr, end_addr, line_length)); \
+ emit_insn (gen_icacheflush (start_addr, end_addr, line_length, \
+ gen_reg_rtx (Pmode), \
+ gen_reg_rtx (Pmode), \
+ gen_reg_rtx (Pmode))); \
} \
else \
{ \
- rtx start_addr, end_addr; \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 56)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), (FNADDR)); \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 64)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), (CXT)); \
\
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 56)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (FNADDR)); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 64)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), (CXT)); \
/* Create a fat pointer for the trampoline. */ \
- end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), end_addr); \
- end_addr = gen_rtx_REG (Pmode, 27); \
- start_addr = memory_address (Pmode, plus_constant ((TRAMP), 24)); \
- emit_move_insn (gen_rtx_MEM (Pmode, start_addr), end_addr); \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 16)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
+ force_reg (Pmode, plus_constant ((TRAMP), 32))); \
+ tmp = memory_address (Pmode, plus_constant ((TRAMP), 24)); \
+ emit_move_insn (gen_rtx_MEM (Pmode, tmp), \
+ gen_rtx_REG (Pmode, 27)); \
+ \
/* fdc and fic only use registers for the address to flush, \
- they do not accept integer displacements. */ \
- start_addr = force_reg (Pmode, (TRAMP)); \
- end_addr = force_reg (Pmode, plus_constant ((TRAMP), 32)); \
- emit_insn (gen_dcacheflush (start_addr, end_addr)); \
- end_addr = force_reg (Pmode, plus_constant (start_addr, 32)); \
- emit_insn (gen_icacheflush (start_addr, end_addr, start_addr, \
- gen_reg_rtx (Pmode), gen_reg_rtx (Pmode)));\
+ they do not accept integer displacements. We align the \
+ start and end addresses to the beginning of their respective \
+ cache lines to minimize the number of lines flushed. */ \
+ tmp = force_reg (Pmode, plus_constant ((TRAMP), 32)); \
+ emit_insn (gen_anddi3 (start_addr, tmp, \
+ GEN_INT (-MIN_CACHELINE_SIZE))); \
+ tmp = force_reg (Pmode, \
+ plus_constant (tmp, TRAMPOLINE_CODE_SIZE - 1)); \
+ emit_insn (gen_anddi3 (end_addr, tmp, \
+ GEN_INT (-MIN_CACHELINE_SIZE))); \
+ emit_move_insn (line_length, GEN_INT (MIN_CACHELINE_SIZE)); \
+ emit_insn (gen_dcacheflush (start_addr, end_addr, line_length)); \
+ emit_insn (gen_icacheflush (start_addr, end_addr, line_length, \
+ gen_reg_rtx (Pmode), \
+ gen_reg_rtx (Pmode), \
+ gen_reg_rtx (Pmode))); \
} \
}
@@ -1198,83 +1245,87 @@ extern int may_call_alloca;
|| cint_ok_for_move (INTVAL (X)))) \
&& !function_label_operand (X, VOIDmode))
-/* Subroutine for EXTRA_CONSTRAINT.
+/* Subroutines for EXTRA_CONSTRAINT.
Return 1 iff OP is a pseudo which did not get a hard register and
we are running the reload pass. */
-
#define IS_RELOADING_PSEUDO_P(OP) \
((reload_in_progress \
&& GET_CODE (OP) == REG \
&& REGNO (OP) >= FIRST_PSEUDO_REGISTER \
&& reg_renumber [REGNO (OP)] < 0))
+/* Return 1 iff OP is a scaled or unscaled index address. */
+#define IS_INDEX_ADDR_P(OP) \
+ (GET_CODE (OP) == PLUS \
+ && GET_MODE (OP) == Pmode \
+ && (GET_CODE (XEXP (OP, 0)) == MULT \
+ || GET_CODE (XEXP (OP, 1)) == MULT \
+ || (REG_P (XEXP (OP, 0)) \
+ && REG_P (XEXP (OP, 1)))))
+
+/* Return 1 iff OP is a LO_SUM DLT address. */
+#define IS_LO_SUM_DLT_ADDR_P(OP) \
+ (GET_CODE (OP) == LO_SUM \
+ && GET_MODE (OP) == Pmode \
+ && REG_P (XEXP (OP, 0)) \
+ && REG_OK_FOR_BASE_P (XEXP (OP, 0)) \
+ && GET_CODE (XEXP (OP, 1)) == UNSPEC)
+
/* Optional extra constraints for this machine. Borrowed from sparc.h.
- For the HPPA, `Q' means that this is a memory operand but not a
- symbolic memory operand. Note that an unassigned pseudo register
- is such a memory operand. Needed because reload will generate
- these things in insns and then not re-recognize the insns, causing
- constrain_operands to fail.
+ `A' is a LO_SUM DLT memory operand.
+
+ `Q' is any memory operand that isn't a symbolic, indexed or lo_sum
+ memory operand. Note that an unassigned pseudo register is such a
+ memory operand. Needed because reload will generate these things
+ and then not re-recognize the insn, causing constrain_operands to
+ fail.
- `R' is used for scaled indexed addresses.
+ `R' is a scaled/unscaled indexed memory operand.
`S' is the constant 31.
- `T' is for fp loads and stores. */
-#define EXTRA_CONSTRAINT(OP, C) \
- ((C) == 'Q' ? \
- (IS_RELOADING_PSEUDO_P (OP) \
- || (GET_CODE (OP) == MEM \
- && (memory_address_p (GET_MODE (OP), XEXP (OP, 0))\
- || reload_in_progress) \
- && ! symbolic_memory_operand (OP, VOIDmode) \
- && !(GET_CODE (XEXP (OP, 0)) == PLUS \
- && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT\
- || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT))))\
- : ((C) == 'R' ? \
- (GET_CODE (OP) == MEM \
- && GET_CODE (XEXP (OP, 0)) == PLUS \
- && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT \
- || GET_CODE (XEXP (XEXP (OP, 0), 1)) == MULT) \
- && (move_operand (OP, GET_MODE (OP)) \
- || memory_address_p (GET_MODE (OP), XEXP (OP, 0))\
- || reload_in_progress)) \
- : ((C) == 'T' ? \
- (GET_CODE (OP) == MEM \
- /* Using DFmode forces only short displacements \
- to be recognized as valid in reg+d addresses. \
- However, this is not necessary for PA2.0 since\
- it has long FP loads/stores. \
- \
- FIXME: the ELF32 linker clobbers the LSB of \
- the FP register number in {fldw,fstw} insns. \
- Thus, we only allow long FP loads/stores on \
- TARGET_64BIT. */ \
- && memory_address_p ((TARGET_PA_20 \
- && !TARGET_ELF32 \
- ? GET_MODE (OP) \
- : DFmode), \
- XEXP (OP, 0)) \
- && !(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) \
- && !(GET_CODE (XEXP (OP, 0)) == PLUS \
- && (GET_CODE (XEXP (XEXP (OP, 0), 0)) == MULT\
- || 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))))))
+ `T' is for fp loads and stores.
+
+ `U' is the constant 63. */
+
+#define EXTRA_CONSTRAINT(OP, C) \
+ ((C) == 'Q' ? \
+ (IS_RELOADING_PSEUDO_P (OP) \
+ || (GET_CODE (OP) == MEM \
+ && (reload_in_progress \
+ || memory_address_p (GET_MODE (OP), XEXP (OP, 0))) \
+ && !symbolic_memory_operand (OP, VOIDmode) \
+ && !IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0)) \
+ && !IS_INDEX_ADDR_P (XEXP (OP, 0)))) \
+ : ((C) == 'A' ? \
+ (GET_CODE (OP) == MEM \
+ && IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0))) \
+ : ((C) == 'R' ? \
+ (GET_CODE (OP) == MEM \
+ && IS_INDEX_ADDR_P (XEXP (OP, 0))) \
+ : ((C) == 'T' ? \
+ (GET_CODE (OP) == MEM \
+ && !IS_LO_SUM_DLT_ADDR_P (XEXP (OP, 0)) \
+ && !IS_INDEX_ADDR_P (XEXP (OP, 0)) \
+ /* Using DFmode forces only short displacements \
+ to be recognized as valid in reg+d addresses. \
+ However, this is not necessary for PA2.0 since \
+ it has long FP loads/stores. \
+ \
+ FIXME: the ELF32 linker clobbers the LSB of \
+ the FP register number in {fldw,fstw} insns. \
+ Thus, we only allow long FP loads/stores on \
+ TARGET_64BIT. */ \
+ && memory_address_p ((TARGET_PA_20 && !TARGET_ELF32 \
+ ? GET_MODE (OP) \
+ : DFmode), \
+ XEXP (OP, 0))) \
+ : ((C) == 'S' ? \
+ (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 31) \
+ : ((C) == 'U' ? \
+ (GET_CODE (OP) == CONST_INT && INTVAL (OP) == 63) : 0))))))
/* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
@@ -1310,16 +1361,53 @@ extern int may_call_alloca;
#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.
-
- On the HP-PA, the actual legitimate addresses must be
- REG+REG, REG+(REG*SCALE) or REG+SMALLINT.
- But we can treat a SYMBOL_REF as legitimate if it is part of this
- function's constant-pool, because such addresses can actually
- be output as REG+SMALLINT.
+/* 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 HP PA-RISC, the legitimate address forms are REG+SMALLINT,
+ REG+REG, and REG+(REG*SCALE). The indexed address forms are only
+ available with floating point loads and stores, and integer loads.
+ We get better code by allowing indexed addresses in the initial
+ RTL generation.
+
+ The acceptance of indexed addresses as legitimate implies that we
+ must provide patterns for doing indexed integer stores, or the move
+ expanders must force the address of an indexed store to a register.
+ We have adopted the latter approach.
+
+ Another function of GO_IF_LEGITIMATE_ADDRESS is to ensure that
+ the base register is a valid pointer for indexed instructions.
+ On targets that have non-equivalent space registers, we have to
+ know at the time of assembler output which register in a REG+REG
+ pair is the base register. The REG_POINTER flag is sometimes lost
+ in reload and the following passes, so it can't be relied on during
+ code generation. Thus, we either have to canonicalize the order
+ of the registers in REG+REG indexed addresses, or treat REG+REG
+ addresses separately and provide patterns for both permutations.
+
+ The latter approach requires several hundred additional lines of
+ code in pa.md. The downside to canonicalizing is that a PLUS
+ in the wrong order can't combine to form to make a scaled indexed
+ memory operand. As we won't need to canonicalize the operands if
+ the REG_POINTER lossage can be fixed, it seems better canonicalize.
+
+ We initially break out scaled indexed addresses in canonical order
+ in emit_move_sequence. LEGITIMIZE_ADDRESS also canonicalizes
+ scaled indexed addresses during RTL generation. However, fold_rtx
+ has its own opinion on how the operands of a PLUS should be ordered.
+ If one of the operands is equivalent to a constant, it will make
+ that operand the second operand. As the base register is likely to
+ be equivalent to a SYMBOL_REF, we have made it the second operand.
+
+ GO_IF_LEGITIMATE_ADDRESS accepts REG+REG as legitimate when the
+ operands are in the order INDEX+BASE on targets with non-equivalent
+ space registers, and in any order on targets with equivalent space
+ registers. It accepts both MULT+BASE and BASE+MULT for scaled indexing.
+
+ We treat a SYMBOL_REF as legitimate if it is part of the current
+ function's constant-pool, because such addresses can actually be
+ output as REG+SMALLINT.
Note we only allow 5 bit immediates for access to a constant address;
doing so avoids losing for loading/storing a FP register at an address
@@ -1337,87 +1425,114 @@ extern int may_call_alloca;
#define VAL_14_BITS_P(X) ((unsigned HOST_WIDE_INT)(X) + 0x2000 < 0x4000)
#define INT_14_BITS(X) VAL_14_BITS_P (INTVAL (X))
-#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
-{ \
- if ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \
+/* These are the modes that we allow for scaled indexing. */
+#define MODE_OK_FOR_SCALED_INDEXING_P(MODE) \
+ ((TARGET_64BIT && (MODE) == DImode) \
+ || (MODE) == SImode \
+ || (MODE) == HImode \
+ || (!TARGET_SOFT_FLOAT && ((MODE) == DFmode || (MODE) == SFmode)))
+
+/* These are the modes that we allow for unscaled indexing. */
+#define MODE_OK_FOR_UNSCALED_INDEXING_P(MODE) \
+ ((TARGET_64BIT && (MODE) == DImode) \
+ || (MODE) == SImode \
+ || (MODE) == HImode \
+ || (MODE) == QImode \
+ || (!TARGET_SOFT_FLOAT && ((MODE) == DFmode || (MODE) == SFmode)))
+
+#define GO_IF_LEGITIMATE_ADDRESS(MODE, X, ADDR) \
+{ \
+ if ((REG_P (X) && REG_OK_FOR_BASE_P (X)) \
|| ((GET_CODE (X) == PRE_DEC || GET_CODE (X) == POST_DEC \
|| GET_CODE (X) == PRE_INC || GET_CODE (X) == POST_INC) \
- && REG_P (XEXP (X, 0)) \
- && REG_OK_FOR_BASE_P (XEXP (X, 0)))) \
- goto ADDR; \
- else if (GET_CODE (X) == PLUS) \
- { \
- rtx base = 0, index = 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)) \
- && REG_OK_FOR_BASE_P (XEXP (X, 1))) \
- base = XEXP (X, 1), index = XEXP (X, 0); \
- if (base != 0) \
- if (GET_CODE (index) == CONST_INT \
- && ((INT_14_BITS (index) \
- && (TARGET_SOFT_FLOAT \
- || (TARGET_PA_20 \
- && ((MODE == SFmode \
- && (INTVAL (index) % 4) == 0)\
- || (MODE == DFmode \
- && (INTVAL (index) % 8) == 0)))\
- || ((MODE) != SFmode && (MODE) != DFmode))) \
- || INT_5_BITS (index))) \
- goto ADDR; \
- if (! TARGET_SOFT_FLOAT \
- && ! TARGET_DISABLE_INDEXING \
- && base \
- && ((MODE) == SFmode || (MODE) == DFmode) \
- && GET_CODE (index) == MULT \
- && GET_CODE (XEXP (index, 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (index, 0)) \
- && GET_CODE (XEXP (index, 1)) == CONST_INT \
- && INTVAL (XEXP (index, 1)) == ((MODE) == SFmode ? 4 : 8))\
- goto ADDR; \
- } \
- else if (GET_CODE (X) == LO_SUM \
- && GET_CODE (XEXP (X, 0)) == REG \
- && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
- && CONSTANT_P (XEXP (X, 1)) \
- && (TARGET_SOFT_FLOAT \
- /* We can allow symbolic LO_SUM addresses\
- for PA2.0. */ \
- || (TARGET_PA_20 \
- && !TARGET_ELF32 \
- && GET_CODE (XEXP (X, 1)) != CONST_INT)\
- || ((MODE) != SFmode \
- && (MODE) != DFmode))) \
- goto ADDR; \
- else if (GET_CODE (X) == LO_SUM \
- && GET_CODE (XEXP (X, 0)) == SUBREG \
- && GET_CODE (SUBREG_REG (XEXP (X, 0))) == REG\
- && REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0)))\
- && CONSTANT_P (XEXP (X, 1)) \
- && (TARGET_SOFT_FLOAT \
- /* We can allow symbolic LO_SUM addresses\
- for PA2.0. */ \
- || (TARGET_PA_20 \
- && !TARGET_ELF32 \
- && GET_CODE (XEXP (X, 1)) != CONST_INT)\
- || ((MODE) != SFmode \
- && (MODE) != DFmode))) \
- goto ADDR; \
- else if (GET_CODE (X) == LABEL_REF \
- || (GET_CODE (X) == CONST_INT \
- && INT_5_BITS (X))) \
- goto ADDR; \
- /* Needed for -fPIC */ \
- 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 \
- && (TARGET_SOFT_FLOAT \
- || (TARGET_PA_20 && !TARGET_ELF32) \
- || ((MODE) != SFmode \
- && (MODE) != DFmode))) \
- goto ADDR; \
+ && REG_P (XEXP (X, 0)) \
+ && REG_OK_FOR_BASE_P (XEXP (X, 0)))) \
+ goto ADDR; \
+ else if (GET_CODE (X) == PLUS) \
+ { \
+ rtx base = 0, index = 0; \
+ if (REG_P (XEXP (X, 1)) \
+ && REG_OK_FOR_BASE_P (XEXP (X, 1))) \
+ base = XEXP (X, 1), index = XEXP (X, 0); \
+ else if (REG_P (XEXP (X, 0)) \
+ && REG_OK_FOR_BASE_P (XEXP (X, 0))) \
+ base = XEXP (X, 0), index = XEXP (X, 1); \
+ if (base \
+ && GET_CODE (index) == CONST_INT \
+ && ((INT_14_BITS (index) \
+ && (TARGET_SOFT_FLOAT \
+ || (TARGET_PA_20 \
+ && ((MODE == SFmode \
+ && (INTVAL (index) % 4) == 0) \
+ || (MODE == DFmode \
+ && (INTVAL (index) % 8) == 0))) \
+ || ((MODE) != SFmode && (MODE) != DFmode))) \
+ || INT_5_BITS (index))) \
+ goto ADDR; \
+ if (!TARGET_DISABLE_INDEXING \
+ /* Only accept the "canonical" INDEX+BASE operand order \
+ on targets with non-equivalent space registers. */ \
+ && (TARGET_NO_SPACE_REGS \
+ ? (base && REG_P (index)) \
+ : (base == XEXP (X, 1) && REG_P (index) \
+ && REG_POINTER (base) && !REG_POINTER (index))) \
+ && MODE_OK_FOR_UNSCALED_INDEXING_P (MODE) \
+ && REG_OK_FOR_INDEX_P (index) \
+ && borx_reg_operand (base, Pmode) \
+ && borx_reg_operand (index, Pmode)) \
+ goto ADDR; \
+ if (!TARGET_DISABLE_INDEXING \
+ && base \
+ && GET_CODE (index) == MULT \
+ && MODE_OK_FOR_SCALED_INDEXING_P (MODE) \
+ && REG_P (XEXP (index, 0)) \
+ && GET_MODE (XEXP (index, 0)) == Pmode \
+ && REG_OK_FOR_INDEX_P (XEXP (index, 0)) \
+ && GET_CODE (XEXP (index, 1)) == CONST_INT \
+ && INTVAL (XEXP (index, 1)) \
+ == (HOST_WIDE_INT) GET_MODE_SIZE (MODE) \
+ && borx_reg_operand (base, Pmode)) \
+ goto ADDR; \
+ } \
+ else if (GET_CODE (X) == LO_SUM \
+ && GET_CODE (XEXP (X, 0)) == REG \
+ && REG_OK_FOR_BASE_P (XEXP (X, 0)) \
+ && CONSTANT_P (XEXP (X, 1)) \
+ && (TARGET_SOFT_FLOAT \
+ /* We can allow symbolic LO_SUM addresses for PA2.0. */ \
+ || (TARGET_PA_20 \
+ && !TARGET_ELF32 \
+ && GET_CODE (XEXP (X, 1)) != CONST_INT) \
+ || ((MODE) != SFmode \
+ && (MODE) != DFmode))) \
+ goto ADDR; \
+ else if (GET_CODE (X) == LO_SUM \
+ && GET_CODE (XEXP (X, 0)) == SUBREG \
+ && GET_CODE (SUBREG_REG (XEXP (X, 0))) == REG \
+ && REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0))) \
+ && CONSTANT_P (XEXP (X, 1)) \
+ && (TARGET_SOFT_FLOAT \
+ /* We can allow symbolic LO_SUM addresses for PA2.0. */ \
+ || (TARGET_PA_20 \
+ && !TARGET_ELF32 \
+ && GET_CODE (XEXP (X, 1)) != CONST_INT) \
+ || ((MODE) != SFmode \
+ && (MODE) != DFmode))) \
+ goto ADDR; \
+ else if (GET_CODE (X) == LABEL_REF \
+ || (GET_CODE (X) == CONST_INT \
+ && INT_5_BITS (X))) \
+ goto ADDR; \
+ /* Needed for -fPIC */ \
+ 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 \
+ && (TARGET_SOFT_FLOAT \
+ || (TARGET_PA_20 && !TARGET_ELF32) \
+ || ((MODE) != SFmode \
+ && (MODE) != DFmode))) \
+ goto ADDR; \
}
/* Look for machine dependent ways to make the invalid address AD a
@@ -1550,11 +1665,14 @@ do { \
#define FUNCTION_NAME_P(NAME) (*(NAME) == '@')
-/* Specify the machine mode that this machine uses
- for the index in the tablejump instruction. */
-#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? TImode : DImode)
+/* Specify the machine mode that this machine uses for the index in the
+ tablejump instruction. For small tables, an element consists of a
+ ia-relative branch and its delay slot. When -mbig-switch is specified,
+ we use a 32-bit absolute address for non-pic code, and a 32-bit offset
+ for both 32 and 64-bit pic code. */
+#define CASE_VECTOR_MODE (TARGET_BIG_SWITCH ? SImode : DImode)
-/* Jump tables must be 32 bit aligned, no matter the size of the element. */
+/* Jump tables must be 32-bit aligned, no matter the size of the element. */
#define ADDR_VEC_ALIGN(ADDR_VEC) 2
/* Define this as 1 if `char' should by default be signed; else as 0. */
@@ -1673,6 +1791,12 @@ do { \
/* Control the assembler format that we output. */
+/* A C string constant describing how to begin a comment in the target
+ assembler language. The compiler assumes that the comment will end at
+ the end of the line. */
+
+#define ASM_COMMENT_START ";"
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -1718,35 +1842,41 @@ do { \
#define ASM_OUTPUT_ASCII(FILE, P, SIZE) \
output_ascii ((FILE), (P), (SIZE))
-/* This is how to output an element of a case-vector that is absolute.
- Note that this method makes filling these branch delay slots
- impossible. */
+/* Jump tables are always placed in the text section. Technically, it
+ is possible to put them in the readonly data section when -mbig-switch
+ is specified. This has the benefit of getting the table out of .text
+ and reducing branch lengths as a result. The downside is that an
+ additional insn (addil) is needed to access the table when generating
+ PIC code. The address difference table also has to use 32-bit
+ pc-relative relocations. Currently, GAS does not support these
+ relocations, although it is easily modified to do this operation.
+ The table entries need to look like "$L1+(.+8-$L0)-$PIC_pcrel$0"
+ when using ELF GAS. A simple difference can be used when using
+ SOM GAS or the HP assembler. The final downside is GDB complains
+ about the nesting of the label for the table when debugging. */
-#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
- if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldil LR'L$%04d,%%r1\n\tbe RR'L$%04d(%%sr4,%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE, VALUE); \
- else \
- fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE)
-
-/* Jump tables are executable code and live in the TEXT section on the PA. */
#define JUMP_TABLES_IN_TEXT_SECTION 1
-/* This is how to output an element of a case-vector that is relative.
- This must be defined correctly as it is used when generating PIC code.
+/* This is how to output an element of a case-vector that is absolute. */
- I believe it safe to use the same definition as ASM_OUTPUT_ADDR_VEC_ELT
- on the PA since ASM_OUTPUT_ADDR_VEC_ELT uses pc-relative jump instructions
- rather than a table of absolute addresses. */
+#define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\t.word L$%04d\n", VALUE); \
+ else \
+ fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE)
+
+/* This is how to output an element of a case-vector that is relative.
+ Since we always place jump tables in the text section, the difference
+ is absolute and requires no relocation. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
- if (TARGET_BIG_SWITCH) \
- fprintf (FILE, "\tstw %%r1,-16(%%r30)\n\tldw T'L$%04d(%%r19),%%r1\n\tbv %%r0(%%r1)\n\tldw -16(%%r30),%%r1\n", VALUE); \
- else \
+ if (TARGET_BIG_SWITCH) \
+ fprintf (FILE, "\t.word L$%04d-L$%04d\n", VALUE, REL); \
+ else \
fprintf (FILE, "\tb L$%04d\n\tnop\n", VALUE)
-/* This is how to output an assembler line
- that says to advance the location counter
- to a multiple of 2**LOG bytes. */
+/* 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) \
fprintf (FILE, "\t.align %d\n", (1<<(LOG)))
@@ -1856,16 +1986,17 @@ do { \
#define JMP_BUF_SIZE 50
#define PREDICATE_CODES \
- {"reg_or_0_operand", {SUBREG, REG, CONST_INT}}, \
+ {"reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_DOUBLE}}, \
{"call_operand_address", {LABEL_REF, SYMBOL_REF, CONST_INT, \
CONST_DOUBLE, CONST, HIGH, CONSTANT_P_RTX}}, \
+ {"indexed_memory_operand", {SUBREG, MEM}}, \
{"symbolic_operand", {SYMBOL_REF, LABEL_REF, CONST}}, \
{"symbolic_memory_operand", {SUBREG, MEM}}, \
{"reg_before_reload_operand", {REG, MEM}}, \
- {"reg_or_nonsymb_mem_operand", {SUBREG, REG, MEM}}, \
{"reg_or_0_or_nonsymb_mem_operand", {SUBREG, REG, MEM, CONST_INT, \
CONST_DOUBLE}}, \
- {"move_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, MEM}}, \
+ {"move_dest_operand", {SUBREG, REG, MEM}}, \
+ {"move_src_operand", {SUBREG, REG, CONSTANT_P_RTX, CONST_INT, MEM}}, \
{"reg_or_cint_move_operand", {SUBREG, REG, CONST_INT}}, \
{"pic_label_operand", {LABEL_REF, CONST}}, \
{"fp_reg_operand", {REG}}, \
@@ -1889,7 +2020,6 @@ do { \
{"pc_or_label_operand", {PC, LABEL_REF}}, \
{"plus_xor_ior_operator", {PLUS, XOR, IOR}}, \
{"shadd_operand", {CONST_INT}}, \
- {"basereg_operand", {REG}}, \
{"div_operand", {REG, CONST_INT}}, \
{"ireg_operand", {REG}}, \
{"cmpib_comparison_operator", {EQ, NE, LT, LE, LEU, \
diff --git a/gcc/config/pa/pa.md b/gcc/config/pa/pa.md
index 958c635670d..16356776188 100644
--- a/gcc/config/pa/pa.md
+++ b/gcc/config/pa/pa.md
@@ -32,7 +32,7 @@
;; type "binary" insns have two input operands (1,2) and one output (0)
(define_attr "type"
- "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch"
+ "move,unary,binary,shift,nullshift,compare,load,store,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,fpload,fpstore,fpalu,fpcc,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,multi,milli,parallel_branch"
(const_string "binary"))
(define_attr "pa_combine_type"
@@ -74,7 +74,7 @@
;; For conditional branches.
(define_attr "in_branch_delay" "false,true"
- (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
+ (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
(eq_attr "length" "4"))
(const_string "true")
(const_string "false")))
@@ -82,7 +82,7 @@
;; Disallow instructions which use the FPU since they will tie up the FPU
;; even if the instruction is nullified.
(define_attr "in_nullified_branch_delay" "false,true"
- (if_then_else (and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch")
+ (if_then_else (and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,fpcc,fpalu,fpmulsgl,fpmuldbl,fpdivsgl,fpdivdbl,fpsqrtsgl,fpsqrtdbl,parallel_branch")
(eq_attr "length" "4"))
(const_string "true")
(const_string "false")))
@@ -90,7 +90,7 @@
;; For calls and millicode calls. Allow unconditional branches in the
;; delay slot.
(define_attr "in_call_delay" "false,true"
- (cond [(and (eq_attr "type" "!uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
+ (cond [(and (eq_attr "type" "!uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
(eq_attr "length" "4"))
(const_string "true")
(eq_attr "type" "uncond_branch")
@@ -110,7 +110,7 @@
[(eq_attr "in_call_delay" "true") (nil) (nil)])
;; Return and other similar instructions.
-(define_delay (eq_attr "type" "branch,parallel_branch")
+(define_delay (eq_attr "type" "btable_branch,branch,parallel_branch")
[(eq_attr "in_branch_delay" "true") (nil) (nil)])
;; Floating point conditional branch delay slot description and
@@ -505,7 +505,7 @@
;; to assume have zero latency.
(define_insn_reservation "Z2" 0
(and
- (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl")
+ (eq_attr "type" "!load,fpload,store,fpstore,uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch,fpcc,fpalu,fpmulsgl,fpmuldbl,fpsqrtsgl,fpsqrtdbl,fpdivsgl,fpdivdbl")
(eq_attr "cpu" "8000"))
"inm_8000,rnm_8000")
@@ -513,7 +513,7 @@
;; retirement unit.
(define_insn_reservation "Z3" 0
(and
- (eq_attr "type" "uncond_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
+ (eq_attr "type" "uncond_branch,btable_branch,branch,cbranch,fbranch,call,dyncall,multi,milli,parallel_branch")
(eq_attr "cpu" "8000"))
"inm0_8000+inm1_8000,rnm0_8000+rnm1_8000")
@@ -2263,13 +2263,13 @@
}")
(define_insn ""
- [(set (match_operand:SI 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,r,Q,!*q,!f,f,*TR")
- (match_operand:SI 1 "move_operand"
- "A,r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))]
+ [(set (match_operand:SI 0 "move_dest_operand"
+ "=r,r,r,r,r,r,Q,!*q,!*f,*f,T")
+ (match_operand:SI 1 "move_src_operand"
+ "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"
+ && !TARGET_SOFT_FLOAT"
"@
ldw RT'%A1,%0
copy %1,%0
@@ -2287,10 +2287,155 @@
(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,r,Q,!*q")
- (match_operand:SI 1 "move_operand"
- "A,r,J,N,K,RQ,rM,!rM"))]
+ [(set (match_operand:SI 0 "indexed_memory_operand" "=R")
+ (match_operand:SI 1 "register_operand" "f"))]
+ "!TARGET_SOFT_FLOAT
+ && !TARGET_DISABLE_INDEXING
+ && reload_completed"
+ "fstw%F0 %1,%0"
+ [(set_attr "type" "fpstore")
+ (set_attr "pa_combine_type" "addmove")
+ (set_attr "length" "4")])
+
+; Rewrite RTL using an indexed store. This will allow the insn that
+; computes the address to be deleted if the register it sets is dead.
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 4))
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "reg_or_0_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 2 "register_operand" "")
+ (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 4))))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 4))
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 2 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 4))))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:SI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:SI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:DI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SI (match_dup 0))
+ (match_operand:SI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SI (plus:DI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "move_dest_operand"
+ "=r,r,r,r,r,r,Q,!*q")
+ (match_operand:SI 1 "move_src_operand"
+ "A,r,J,N,K,RQ,rM,!rM"))]
"(register_operand (operands[0], SImode)
|| reg_or_0_operand (operands[1], SImode))
&& TARGET_SOFT_FLOAT"
@@ -2307,26 +2452,32 @@
(set_attr "pa_combine_type" "addmove")
(set_attr "length" "4,4,4,4,4,4,4,4")])
+;; Load or store with base-register modification.
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
- (mem:SI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldwx|ldw} %2(%1),%0"
+ (mem:SI (plus:DI (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L"))))
+ (set (match_dup 1)
+ (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldw,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
+; And a zero extended variant.
(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 "basereg_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldwx|ldw} %1(%2),%0"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:SI
+ (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
+ (set (match_dup 1)
+ (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldw,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
-;; Load or store with base-register modification.
-
(define_expand "pre_load"
[(parallel [(set (match_operand:SI 0 "register_operand" "")
(mem (plus (match_operand 1 "register_operand" "")
@@ -2453,9 +2604,9 @@
;; Note since this pattern can be created at reload time (via movsi), all
;; the same rules for movsi apply here. (no new pseudos, no temporaries).
(define_insn ""
- [(set (match_operand 0 "pmode_register_operand" "=a")
+ [(set (match_operand 0 "pmode_register_operand" "=r")
(match_operand 1 "pic_label_operand" ""))]
- ""
+ "TARGET_PA_20"
"*
{
rtx xoperands[3];
@@ -2463,14 +2614,11 @@
xoperands[0] = operands[0];
xoperands[1] = operands[1];
- if (TARGET_SOM || ! TARGET_GAS)
- xoperands[2] = gen_label_rtx ();
+ xoperands[2] = gen_label_rtx ();
- output_asm_insn (\"{bl|b,l} .+8,%0\", xoperands);
- output_asm_insn (\"{depi|depwi} 0,31,2,%0\", xoperands);
- if (TARGET_SOM || ! TARGET_GAS)
- (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
- CODE_LABEL_NUMBER (xoperands[2]));
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xoperands[2]));
+ output_asm_insn (\"mfia %0\", xoperands);
/* If we're trying to load the address of a label that happens to be
close, then we can use a shorter sequence. */
@@ -2478,27 +2626,46 @@
&& INSN_ADDRESSES_SET_P ()
&& abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
- INSN_ADDRESSES (INSN_UID (insn))) < 8100)
+ output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
+ else
{
- /* Prefixing with R% here is wrong, it extracts just 11 bits and is
- always non-negative. */
- if (TARGET_SOM || ! TARGET_GAS)
- output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
- else
- output_asm_insn (\"ldo %1-$PIC_pcrel$0+8(%0),%0\", xoperands);
+ output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
+ output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
}
+ return \"\";
+}"
+ [(set_attr "type" "multi")
+ (set_attr "length" "12")]) ; 8 or 12
+
+(define_insn ""
+ [(set (match_operand 0 "pmode_register_operand" "=a")
+ (match_operand 1 "pic_label_operand" ""))]
+ "!TARGET_PA_20"
+ "*
+{
+ rtx xoperands[3];
+ extern FILE *asm_out_file;
+
+ xoperands[0] = operands[0];
+ xoperands[1] = operands[1];
+ xoperands[2] = gen_label_rtx ();
+
+ output_asm_insn (\"bl .+8,%0\", xoperands);
+ output_asm_insn (\"depi 0,31,2,%0\", xoperands);
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (xoperands[2]));
+
+ /* If we're trying to load the address of a label that happens to be
+ close, then we can use a shorter sequence. */
+ if (GET_CODE (operands[1]) == LABEL_REF
+ && INSN_ADDRESSES_SET_P ()
+ && abs (INSN_ADDRESSES (INSN_UID (XEXP (operands[1], 0)))
+ - INSN_ADDRESSES (INSN_UID (insn))) < 8100)
+ output_asm_insn (\"ldo %1-%2(%0),%0\", xoperands);
else
{
- if (TARGET_SOM || ! TARGET_GAS)
- {
- output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
- output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
- }
- else
- {
- output_asm_insn (\"addil L%%%1-$PIC_pcrel$0+8,%0\", xoperands);
- output_asm_insn (\"ldo R%%%1-$PIC_pcrel$0+12(%0),%0\",
- xoperands);
- }
+ output_asm_insn (\"addil L%%%1-%2,%0\", xoperands);
+ output_asm_insn (\"ldo R%%%1-%2(%0),%0\", xoperands);
}
return \"\";
}"
@@ -2699,8 +2866,10 @@
}")
(define_insn ""
- [(set (match_operand:HI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,!*q,!*f")
- (match_operand:HI 1 "move_operand" "r,J,N,K,RQ,rM,!rM,!*fM"))]
+ [(set (match_operand:HI 0 "move_dest_operand"
+ "=r,r,r,r,r,Q,!*q,!*f")
+ (match_operand:HI 1 "move_src_operand"
+ "r,J,N,K,RQ,rM,!rM,!*fM"))]
"register_operand (operands[0], HImode)
|| reg_or_0_operand (operands[1], HImode)"
"@
@@ -2718,31 +2887,37 @@
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
- (mem:HI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldhx|ldh} %2(%1),%0"
+ (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r")
+ (match_operand:SI 2 "int5_operand" "L"))))
+ (set (match_dup 1)
+ (plus:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "{ldhs|ldh},mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
- (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldhx|ldh} %1(%2),%0"
+ (mem:HI (plus:DI (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L"))))
+ (set (match_dup 1)
+ (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldh,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
-; Now zero extended variants.
+; And a zero extended variant.
(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r")
- (zero_extend:SI (mem:HI
- (plus:SI
- (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldhx|ldh} %2(%1),%0"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:HI
+ (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
+ (set (match_dup 1)
+ (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldh,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
@@ -2750,17 +2925,8 @@
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (mem:HI
(plus:SI
- (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldhx|ldh} %1(%2),%0"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r")
- (mem:HI (plus:SI (match_operand:SI 1 "register_operand" "+r")
- (match_operand:SI 2 "int5_operand" "L"))))
+ (match_operand:SI 1 "register_operand" "+r")
+ (match_operand:SI 2 "int5_operand" "L")))))
(set (match_dup 1)
(plus:SI (match_dup 1) (match_dup 2)))]
""
@@ -2768,17 +2934,16 @@
[(set_attr "type" "load")
(set_attr "length" "4")])
-; And a zero extended variant.
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
(zero_extend:SI (mem:HI
- (plus:SI
- (match_operand:SI 1 "register_operand" "+r")
- (match_operand:SI 2 "int5_operand" "L")))))
+ (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
(set (match_dup 1)
- (plus:SI (match_dup 1) (match_dup 2)))]
- ""
- "{ldhs|ldh},mb %2(%1),%0"
+ (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldh,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
@@ -2794,6 +2959,17 @@
(set_attr "length" "4")])
(define_insn ""
+ [(set (mem:HI (plus:DI (match_operand:DI 0 "register_operand" "+r")
+ (match_operand:DI 1 "int5_operand" "L")))
+ (match_operand:HI 2 "reg_or_0_operand" "rM"))
+ (set (match_dup 0)
+ (plus:DI (match_dup 0) (match_dup 1)))]
+ "TARGET_64BIT"
+ "sth,mb %r2,%1(%0)"
+ [(set_attr "type" "store")
+ (set_attr "length" "4")])
+
+(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r")
(plus:HI (match_operand:HI 1 "register_operand" "r")
(match_operand 2 "const_int_operand" "J")))]
@@ -2814,8 +2990,10 @@
}")
(define_insn ""
- [(set (match_operand:QI 0 "reg_or_nonsymb_mem_operand" "=r,r,r,r,r,Q,!*q,!*f")
- (match_operand:QI 1 "move_operand" "r,J,N,K,RQ,rM,!rM,!*fM"))]
+ [(set (match_operand:QI 0 "move_dest_operand"
+ "=r,r,r,r,r,Q,!*q,!*f")
+ (match_operand:QI 1 "move_src_operand"
+ "r,J,N,K,RQ,rM,!rM,!*fM"))]
"register_operand (operands[0], QImode)
|| reg_or_0_operand (operands[1], QImode)"
"@
@@ -2833,86 +3011,55 @@
(define_insn ""
[(set (match_operand:QI 0 "register_operand" "=r")
- (mem:QI (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %2(%1),%0"
+ (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r")
+ (match_operand:SI 2 "int5_operand" "L"))))
+ (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
+ ""
+ "{ldbs|ldb},mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
(define_insn ""
[(set (match_operand:QI 0 "register_operand" "=r")
- (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %1(%2),%0"
+ (mem:QI (plus:DI (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L"))))
+ (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldb,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
-; Indexed byte load with zero extension to SImode or HImode.
+; Now the same thing with zero extensions.
(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r")
- (zero_extend:SI (mem:QI
- (plus:SI
- (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %2(%1),%0"
+ [(set (match_operand:DI 0 "register_operand" "=r")
+ (zero_extend:DI (mem:QI (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
+ (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldb,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
- (zero_extend:SI (mem:QI
- (plus:SI
- (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %1(%2),%0"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r")
- (zero_extend:HI (mem:QI
- (plus:SI
- (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %2(%1),%0"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:HI 0 "register_operand" "=r")
- (zero_extend:HI (mem:QI
- (plus:SI
- (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r")))))]
- "! TARGET_DISABLE_INDEXING"
- "{ldbx|ldb} %1(%2),%0"
- [(set_attr "type" "load")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:QI 0 "register_operand" "=r")
- (mem:QI (plus:SI (match_operand:SI 1 "register_operand" "+r")
- (match_operand:SI 2 "int5_operand" "L"))))
+ (zero_extend:SI (mem:QI (plus:SI
+ (match_operand:SI 1 "register_operand" "+r")
+ (match_operand:SI 2 "int5_operand" "L")))))
(set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
""
"{ldbs|ldb},mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
-; Now the same thing with zero extensions.
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r")
- (zero_extend:SI (mem:QI (plus:SI
- (match_operand:SI 1 "register_operand" "+r")
- (match_operand:SI 2 "int5_operand" "L")))))
- (set (match_dup 1) (plus:SI (match_dup 1) (match_dup 2)))]
- ""
- "{ldbs|ldb},mb %2(%1),%0"
+ (zero_extend:SI (mem:QI (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
+ (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldb,mb %2(%1),%0"
[(set_attr "type" "load")
(set_attr "length" "4")])
@@ -2928,6 +3075,17 @@
(set_attr "length" "4")])
(define_insn ""
+ [(set (match_operand:HI 0 "register_operand" "=r")
+ (zero_extend:HI (mem:QI (plus:DI
+ (match_operand:DI 1 "register_operand" "+r")
+ (match_operand:DI 2 "int5_operand" "L")))))
+ (set (match_dup 1) (plus:DI (match_dup 1) (match_dup 2)))]
+ "TARGET_64BIT"
+ "ldb,mb %2(%1),%0"
+ [(set_attr "type" "load")
+ (set_attr "length" "4")])
+
+(define_insn ""
[(set (mem:QI (plus:SI (match_operand:SI 0 "register_operand" "+r")
(match_operand:SI 1 "int5_operand" "L")))
(match_operand:QI 2 "reg_or_0_operand" "rM"))
@@ -2938,21 +3096,32 @@
[(set_attr "type" "store")
(set_attr "length" "4")])
+(define_insn ""
+ [(set (mem:QI (plus:DI (match_operand:DI 0 "register_operand" "+r")
+ (match_operand:DI 1 "int5_operand" "L")))
+ (match_operand:QI 2 "reg_or_0_operand" "rM"))
+ (set (match_dup 0)
+ (plus:DI (match_dup 0) (match_dup 1)))]
+ "TARGET_64BIT"
+ "stb,mb %r2,%1(%0)"
+ [(set_attr "type" "store")
+ (set_attr "length" "4")])
+
;; The definition of this insn does not really explain what it does,
-;; but it should suffice
-;; that anything generated as this insn will be recognized as one
-;; and that it will not successfully combine with anything.
+;; but it should suffice that anything generated as this insn will be
+;; recognized as a movstrsi operation, and that it will not successfully
+;; combine with anything.
(define_expand "movstrsi"
[(parallel [(set (match_operand:BLK 0 "" "")
(match_operand:BLK 1 "" ""))
- (clobber (match_scratch:SI 7 ""))
- (clobber (match_scratch:SI 8 ""))
(clobber (match_dup 4))
(clobber (match_dup 5))
(clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
(use (match_operand:SI 2 "arith_operand" ""))
(use (match_operand:SI 3 "const_int_operand" ""))])]
- "!TARGET_64BIT"
+ "!TARGET_64BIT && optimize > 0"
"
{
int size, align;
@@ -2974,7 +3143,7 @@
If the size is large in respect to the known alignment, then use
the library routines.
- If the size is small in repsect to the known alignment, then open
+ If the size is small in respect to the known alignment, then open
code the copy (since that will lead to better scheduling).
Else use the block move pattern. */
@@ -2987,8 +3156,7 @@
align = INTVAL (operands[3]);
align = align > 4 ? 4 : align;
- /* If size/alignment > 8 (eg size is large in respect to alignment),
- then use the library routines. */
+ /* If size/alignment is large, then use the library routines. */
if (size / align > 16)
FAIL;
@@ -3006,28 +3174,470 @@
operands[4] = gen_reg_rtx (SImode);
operands[5] = gen_reg_rtx (SImode);
operands[6] = gen_reg_rtx (SImode);
- operands[7] = XEXP (operands[0], 0);
- operands[8] = XEXP (operands[1], 0);
+ operands[7] = gen_reg_rtx (SImode);
+ operands[8] = gen_reg_rtx (SImode);
}")
;; The operand constraints are written like this to support both compile-time
-;; and run-time determined byte count. If the count is run-time determined,
-;; the register with the byte count is clobbered by the copying code, and
-;; therefore it is forced to operand 2. If the count is compile-time
-;; determined, we need two scratch registers for the unrolled code.
-(define_insn "movstrsi_internal"
+;; and run-time determined byte counts. The expander and output_block_move
+;; only support compile-time determined counts at this time.
+;;
+;; If the count is run-time determined, the register with the byte count
+;; is clobbered by the copying code, and therefore it is forced to operand 2.
+;;
+;; We used to clobber operands 0 and 1. However, a change to regrename.c
+;; broke this semantic for pseudo registers. We can't use match_scratch
+;; as this requires two registers in the class R1_REGS when the MEMs for
+;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are
+;; forced to internally copy operands 0 and 1 to operands 7 and 8,
+;; respectively. We then split or peephole optimize after reload.
+(define_insn "movstrsi_prereload"
[(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
(mem:BLK (match_operand:SI 1 "register_operand" "r,r")))
- (clobber (match_scratch:SI 7 "=0,0"))
- (clobber (match_scratch:SI 8 "=1,1"))
(clobber (match_operand:SI 2 "register_operand" "=r,r")) ;loop cnt/tmp
- (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp
+ (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
(clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
+ (clobber (match_operand:SI 7 "register_operand" "=&r,&r")) ;item tmp3
+ (clobber (match_operand:SI 8 "register_operand" "=&r,&r")) ;item tmp4
(use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count
(use (match_operand:SI 5 "const_int_operand" "n,n"))] ;alignment
"!TARGET_64BIT"
+ "#"
+ [(set_attr "type" "multi,multi")])
+
+(define_split
+ [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
+ (mem:BLK (match_operand:SI 1 "register_operand" "")))
+ (clobber (match_operand:SI 2 "register_operand" ""))
+ (clobber (match_operand:SI 3 "register_operand" ""))
+ (clobber (match_operand:SI 6 "register_operand" ""))
+ (clobber (match_operand:SI 7 "register_operand" ""))
+ (clobber (match_operand:SI 8 "register_operand" ""))
+ (use (match_operand:SI 4 "arith_operand" ""))
+ (use (match_operand:SI 5 "const_int_operand" ""))])]
+ "!TARGET_64BIT && reload_completed && !flag_peephole2"
+ [(set (match_dup 7) (match_dup 0))
+ (set (match_dup 8) (match_dup 1))
+ (parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8)))
+ (clobber (match_dup 2))
+ (clobber (match_dup 3))
+ (clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
+ (use (match_dup 4))
+ (use (match_dup 5))
+ (const_int 0)])]
+ "")
+
+(define_peephole2
+ [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
+ (mem:BLK (match_operand:SI 1 "register_operand" "")))
+ (clobber (match_operand:SI 2 "register_operand" ""))
+ (clobber (match_operand:SI 3 "register_operand" ""))
+ (clobber (match_operand:SI 6 "register_operand" ""))
+ (clobber (match_operand:SI 7 "register_operand" ""))
+ (clobber (match_operand:SI 8 "register_operand" ""))
+ (use (match_operand:SI 4 "arith_operand" ""))
+ (use (match_operand:SI 5 "const_int_operand" ""))])]
+ "!TARGET_64BIT"
+ [(parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8)))
+ (clobber (match_dup 2))
+ (clobber (match_dup 3))
+ (clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
+ (use (match_dup 4))
+ (use (match_dup 5))
+ (const_int 0)])]
+ "
+{
+ if (dead_or_set_p (curr_insn, operands[0]))
+ operands[7] = operands[0];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[7], operands[0]));
+
+ if (dead_or_set_p (curr_insn, operands[1]))
+ operands[8] = operands[1];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[8], operands[1]));
+}")
+
+(define_insn "movstrsi_postreload"
+ [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
+ (mem:BLK (match_operand:SI 1 "register_operand" "r,r")))
+ (clobber (match_operand:SI 2 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_operand:SI 3 "register_operand" "=&r,&r")) ;item tmp1
+ (clobber (match_operand:SI 6 "register_operand" "=&r,&r")) ;item tmp2
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (use (match_operand:SI 4 "arith_operand" "J,2")) ;byte count
+ (use (match_operand:SI 5 "const_int_operand" "n,n")) ;alignment
+ (const_int 0)]
+ "!TARGET_64BIT && reload_completed"
+ "* return output_block_move (operands, !which_alternative);"
+ [(set_attr "type" "multi,multi")])
+
+(define_expand "movstrdi"
+ [(parallel [(set (match_operand:BLK 0 "" "")
+ (match_operand:BLK 1 "" ""))
+ (clobber (match_dup 4))
+ (clobber (match_dup 5))
+ (clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
+ (use (match_operand:DI 2 "arith_operand" ""))
+ (use (match_operand:DI 3 "const_int_operand" ""))])]
+ "TARGET_64BIT && optimize > 0"
+ "
+{
+ int size, align;
+
+ /* HP provides very fast block move library routine for the PA;
+ this routine includes:
+
+ 4x4 byte at a time block moves,
+ 1x4 byte at a time with alignment checked at runtime with
+ attempts to align the source and destination as needed
+ 1x1 byte loop
+
+ With that in mind, here's the heuristics to try and guess when
+ the inlined block move will be better than the library block
+ move:
+
+ If the size isn't constant, then always use the library routines.
+
+ If the size is large in respect to the known alignment, then use
+ the library routines.
+
+ If the size is small in respect to the known alignment, then open
+ code the copy (since that will lead to better scheduling).
+
+ Else use the block move pattern. */
+
+ /* Undetermined size, use the library routine. */
+ if (GET_CODE (operands[2]) != CONST_INT)
+ FAIL;
+
+ size = INTVAL (operands[2]);
+ align = INTVAL (operands[3]);
+ align = align > 8 ? 8 : align;
+
+ /* If size/alignment is large, then use the library routines. */
+ if (size / align > 16)
+ FAIL;
+
+ /* This does happen, but not often enough to worry much about. */
+ if (size / align < MOVE_RATIO)
+ FAIL;
+
+ /* Fall through means we're going to use our block move pattern. */
+ operands[0]
+ = replace_equiv_address (operands[0],
+ copy_to_mode_reg (DImode, XEXP (operands[0], 0)));
+ operands[1]
+ = replace_equiv_address (operands[1],
+ copy_to_mode_reg (DImode, XEXP (operands[1], 0)));
+ operands[4] = gen_reg_rtx (DImode);
+ operands[5] = gen_reg_rtx (DImode);
+ operands[6] = gen_reg_rtx (DImode);
+ operands[7] = gen_reg_rtx (DImode);
+ operands[8] = gen_reg_rtx (DImode);
+}")
+
+;; The operand constraints are written like this to support both compile-time
+;; and run-time determined byte counts. The expander and output_block_move
+;; only support compile-time determined counts at this time.
+;;
+;; If the count is run-time determined, the register with the byte count
+;; is clobbered by the copying code, and therefore it is forced to operand 2.
+;;
+;; We used to clobber operands 0 and 1. However, a change to regrename.c
+;; broke this semantic for pseudo registers. We can't use match_scratch
+;; as this requires two registers in the class R1_REGS when the MEMs for
+;; operands 0 and 1 are both equivalent to symbolic MEMs. Thus, we are
+;; forced to internally copy operands 0 and 1 to operands 7 and 8,
+;; respectively. We then split or peephole optimize after reload.
+(define_insn "movstrdi_prereload"
+ [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
+ (mem:BLK (match_operand:DI 1 "register_operand" "r,r")))
+ (clobber (match_operand:DI 2 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1
+ (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2
+ (clobber (match_operand:DI 7 "register_operand" "=&r,&r")) ;item tmp3
+ (clobber (match_operand:DI 8 "register_operand" "=&r,&r")) ;item tmp4
+ (use (match_operand:DI 4 "arith_operand" "J,2")) ;byte count
+ (use (match_operand:DI 5 "const_int_operand" "n,n"))] ;alignment
+ "TARGET_64BIT"
+ "#"
+ [(set_attr "type" "multi,multi")])
+
+(define_split
+ [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" ""))
+ (mem:BLK (match_operand:DI 1 "register_operand" "")))
+ (clobber (match_operand:DI 2 "register_operand" ""))
+ (clobber (match_operand:DI 3 "register_operand" ""))
+ (clobber (match_operand:DI 6 "register_operand" ""))
+ (clobber (match_operand:DI 7 "register_operand" ""))
+ (clobber (match_operand:DI 8 "register_operand" ""))
+ (use (match_operand:DI 4 "arith_operand" ""))
+ (use (match_operand:DI 5 "const_int_operand" ""))])]
+ "TARGET_64BIT && reload_completed && !flag_peephole2"
+ [(set (match_dup 7) (match_dup 0))
+ (set (match_dup 8) (match_dup 1))
+ (parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8)))
+ (clobber (match_dup 2))
+ (clobber (match_dup 3))
+ (clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
+ (use (match_dup 4))
+ (use (match_dup 5))
+ (const_int 0)])]
+ "")
+
+(define_peephole2
+ [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" ""))
+ (mem:BLK (match_operand:DI 1 "register_operand" "")))
+ (clobber (match_operand:DI 2 "register_operand" ""))
+ (clobber (match_operand:DI 3 "register_operand" ""))
+ (clobber (match_operand:DI 6 "register_operand" ""))
+ (clobber (match_operand:DI 7 "register_operand" ""))
+ (clobber (match_operand:DI 8 "register_operand" ""))
+ (use (match_operand:DI 4 "arith_operand" ""))
+ (use (match_operand:DI 5 "const_int_operand" ""))])]
+ "TARGET_64BIT"
+ [(parallel [(set (mem:BLK (match_dup 7)) (mem:BLK (match_dup 8)))
+ (clobber (match_dup 2))
+ (clobber (match_dup 3))
+ (clobber (match_dup 6))
+ (clobber (match_dup 7))
+ (clobber (match_dup 8))
+ (use (match_dup 4))
+ (use (match_dup 5))
+ (const_int 0)])]
+ "
+{
+ if (dead_or_set_p (curr_insn, operands[0]))
+ operands[7] = operands[0];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[7], operands[0]));
+
+ if (dead_or_set_p (curr_insn, operands[1]))
+ operands[8] = operands[1];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[8], operands[1]));
+}")
+
+(define_insn "movstrdi_postreload"
+ [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
+ (mem:BLK (match_operand:DI 1 "register_operand" "r,r")))
+ (clobber (match_operand:DI 2 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_operand:DI 3 "register_operand" "=&r,&r")) ;item tmp1
+ (clobber (match_operand:DI 6 "register_operand" "=&r,&r")) ;item tmp2
+ (clobber (match_dup 0))
+ (clobber (match_dup 1))
+ (use (match_operand:DI 4 "arith_operand" "J,2")) ;byte count
+ (use (match_operand:DI 5 "const_int_operand" "n,n")) ;alignment
+ (const_int 0)]
+ "TARGET_64BIT && reload_completed"
"* return output_block_move (operands, !which_alternative);"
[(set_attr "type" "multi,multi")])
+
+(define_expand "clrstrsi"
+ [(parallel [(set (match_operand:BLK 0 "" "")
+ (const_int 0))
+ (clobber (match_dup 3))
+ (clobber (match_dup 4))
+ (use (match_operand:SI 1 "arith_operand" ""))
+ (use (match_operand:SI 2 "const_int_operand" ""))])]
+ "!TARGET_64BIT && optimize > 0"
+ "
+{
+ int size, align;
+
+ /* Undetermined size, use the library routine. */
+ if (GET_CODE (operands[1]) != CONST_INT)
+ FAIL;
+
+ size = INTVAL (operands[1]);
+ align = INTVAL (operands[2]);
+ align = align > 4 ? 4 : align;
+
+ /* If size/alignment is large, then use the library routines. */
+ if (size / align > 16)
+ FAIL;
+
+ /* This does happen, but not often enough to worry much about. */
+ if (size / align < MOVE_RATIO)
+ FAIL;
+
+ /* Fall through means we're going to use our block clear pattern. */
+ operands[0]
+ = replace_equiv_address (operands[0],
+ copy_to_mode_reg (SImode, XEXP (operands[0], 0)));
+ operands[3] = gen_reg_rtx (SImode);
+ operands[4] = gen_reg_rtx (SImode);
+}")
+
+(define_insn "clrstrsi_prereload"
+ [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
+ (const_int 0))
+ (clobber (match_operand:SI 1 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_operand:SI 4 "register_operand" "=&r,&r")) ;tmp1
+ (use (match_operand:SI 2 "arith_operand" "J,1")) ;byte count
+ (use (match_operand:SI 3 "const_int_operand" "n,n"))] ;alignment
+ "!TARGET_64BIT"
+ "#"
+ [(set_attr "type" "multi,multi")])
+
+(define_split
+ [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
+ (const_int 0))
+ (clobber (match_operand:SI 1 "register_operand" ""))
+ (clobber (match_operand:SI 4 "register_operand" ""))
+ (use (match_operand:SI 2 "arith_operand" ""))
+ (use (match_operand:SI 3 "const_int_operand" ""))])]
+ "!TARGET_64BIT && reload_completed && !flag_peephole2"
+ [(set (match_dup 4) (match_dup 0))
+ (parallel [(set (mem:BLK (match_dup 4)) (const_int 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 4))
+ (use (match_dup 2))
+ (use (match_dup 3))
+ (const_int 0)])]
+ "")
+
+(define_peephole2
+ [(parallel [(set (mem:BLK (match_operand:SI 0 "register_operand" ""))
+ (const_int 0))
+ (clobber (match_operand:SI 1 "register_operand" ""))
+ (clobber (match_operand:SI 4 "register_operand" ""))
+ (use (match_operand:SI 2 "arith_operand" ""))
+ (use (match_operand:SI 3 "const_int_operand" ""))])]
+ "!TARGET_64BIT"
+ [(parallel [(set (mem:BLK (match_dup 4)) (const_int 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 4))
+ (use (match_dup 2))
+ (use (match_dup 3))
+ (const_int 0)])]
+ "
+{
+ if (dead_or_set_p (curr_insn, operands[0]))
+ operands[4] = operands[0];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[4], operands[0]));
+}")
+
+(define_insn "clrstrsi_postreload"
+ [(set (mem:BLK (match_operand:SI 0 "register_operand" "r,r"))
+ (const_int 0))
+ (clobber (match_operand:SI 1 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_dup 0))
+ (use (match_operand:SI 2 "arith_operand" "J,1")) ;byte count
+ (use (match_operand:SI 3 "const_int_operand" "n,n")) ;alignment
+ (const_int 0)]
+ "!TARGET_64BIT && reload_completed"
+ "* return output_block_clear (operands, !which_alternative);"
+ [(set_attr "type" "multi,multi")])
+
+(define_expand "clrstrdi"
+ [(parallel [(set (match_operand:BLK 0 "" "")
+ (const_int 0))
+ (clobber (match_dup 3))
+ (clobber (match_dup 4))
+ (use (match_operand:DI 1 "arith_operand" ""))
+ (use (match_operand:DI 2 "const_int_operand" ""))])]
+ "TARGET_64BIT && optimize > 0"
+ "
+{
+ int size, align;
+
+ /* Undetermined size, use the library routine. */
+ if (GET_CODE (operands[1]) != CONST_INT)
+ FAIL;
+
+ size = INTVAL (operands[1]);
+ align = INTVAL (operands[2]);
+ align = align > 8 ? 8 : align;
+
+ /* If size/alignment is large, then use the library routines. */
+ if (size / align > 16)
+ FAIL;
+
+ /* This does happen, but not often enough to worry much about. */
+ if (size / align < MOVE_RATIO)
+ FAIL;
+
+ /* Fall through means we're going to use our block clear pattern. */
+ operands[0]
+ = replace_equiv_address (operands[0],
+ copy_to_mode_reg (DImode, XEXP (operands[0], 0)));
+ operands[3] = gen_reg_rtx (DImode);
+ operands[4] = gen_reg_rtx (DImode);
+}")
+
+(define_insn "clrstrdi_prereload"
+ [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
+ (const_int 0))
+ (clobber (match_operand:DI 1 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_operand:DI 4 "register_operand" "=&r,&r")) ;item tmp1
+ (use (match_operand:DI 2 "arith_operand" "J,1")) ;byte count
+ (use (match_operand:DI 3 "const_int_operand" "n,n"))] ;alignment
+ "TARGET_64BIT"
+ "#"
+ [(set_attr "type" "multi,multi")])
+
+(define_split
+ [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" ""))
+ (const_int 0))
+ (clobber (match_operand:DI 1 "register_operand" ""))
+ (clobber (match_operand:DI 4 "register_operand" ""))
+ (use (match_operand:DI 2 "arith_operand" ""))
+ (use (match_operand:DI 3 "const_int_operand" ""))])]
+ "TARGET_64BIT && reload_completed && !flag_peephole2"
+ [(set (match_dup 4) (match_dup 0))
+ (parallel [(set (mem:BLK (match_dup 4)) (const_int 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 4))
+ (use (match_dup 2))
+ (use (match_dup 3))
+ (const_int 0)])]
+ "")
+
+(define_peephole2
+ [(parallel [(set (mem:BLK (match_operand:DI 0 "register_operand" ""))
+ (const_int 0))
+ (clobber (match_operand:DI 1 "register_operand" ""))
+ (clobber (match_operand:DI 4 "register_operand" ""))
+ (use (match_operand:DI 2 "arith_operand" ""))
+ (use (match_operand:DI 3 "const_int_operand" ""))])]
+ "TARGET_64BIT"
+ [(parallel [(set (mem:BLK (match_dup 4)) (const_int 0))
+ (clobber (match_dup 1))
+ (clobber (match_dup 4))
+ (use (match_dup 2))
+ (use (match_dup 3))
+ (const_int 0)])]
+ "
+{
+ if (dead_or_set_p (curr_insn, operands[0]))
+ operands[4] = operands[0];
+ else
+ emit_insn (gen_rtx_SET (VOIDmode, operands[4], operands[0]));
+}")
+
+(define_insn "clrstrdi_postreload"
+ [(set (mem:BLK (match_operand:DI 0 "register_operand" "r,r"))
+ (const_int 0))
+ (clobber (match_operand:DI 1 "register_operand" "=r,r")) ;loop cnt/tmp
+ (clobber (match_dup 0))
+ (use (match_operand:DI 2 "arith_operand" "J,1")) ;byte count
+ (use (match_operand:DI 3 "const_int_operand" "n,n")) ;alignment
+ (const_int 0)]
+ "TARGET_64BIT && reload_completed"
+ "* return output_block_clear (operands, !which_alternative);"
+ [(set_attr "type" "multi,multi")])
;; Floating point move insns
@@ -3046,7 +3656,7 @@
"GET_CODE (operands[1]) == CONST_DOUBLE
&& operands[1] != CONST0_RTX (DFmode)
&& !TARGET_64BIT
- && ! TARGET_SOFT_FLOAT"
+ && !TARGET_SOFT_FLOAT"
"* return (which_alternative == 0 ? output_move_double (operands)
: \"fldd%F1 %1,%0\");"
[(set_attr "type" "move,fpload")
@@ -3059,7 +3669,7 @@
"
{
if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT)
- operands[1] = force_const_mem (DFmode, operands[1]);
+ operands[1] = force_const_mem (DFmode, operands[1]);
if (emit_move_sequence (operands, DFmode, 0))
DONE;
@@ -3099,16 +3709,16 @@
}")
(define_insn ""
- [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
- "=f,*r,RQ,?o,?Q,f,*r,*r")
+ [(set (match_operand:DF 0 "move_dest_operand"
+ "=f,*r,Q,?o,?Q,f,*r,*r")
(match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand"
"fG,*rG,f,*r,*r,RQ,o,RQ"))]
"(register_operand (operands[0], DFmode)
|| reg_or_0_operand (operands[1], DFmode))
- && ! (GET_CODE (operands[1]) == CONST_DOUBLE
- && GET_CODE (operands[0]) == MEM)
- && ! TARGET_64BIT
- && ! TARGET_SOFT_FLOAT"
+ && !(GET_CODE (operands[1]) == CONST_DOUBLE
+ && GET_CODE (operands[0]) == MEM)
+ && !TARGET_64BIT
+ && !TARGET_SOFT_FLOAT"
"*
{
if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
@@ -3120,13 +3730,156 @@
(set_attr "length" "4,8,4,8,16,4,8,16")])
(define_insn ""
- [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
+ [(set (match_operand:DF 0 "indexed_memory_operand" "=R")
+ (match_operand:DF 1 "reg_or_0_operand" "f"))]
+ "!TARGET_SOFT_FLOAT
+ && !TARGET_DISABLE_INDEXING
+ && reload_completed"
+ "fstd%F0 %1,%0"
+ [(set_attr "type" "fpstore")
+ (set_attr "pa_combine_type" "addmove")
+ (set_attr "length" "4")])
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 8))
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 2 "register_operand" "")
+ (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 8))))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:SI (mult:SI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 8))
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 2 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 8))))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:SI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:SI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:DI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DF (match_dup 0))
+ (match_operand:DF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DF (plus:DI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:DF 0 "move_dest_operand"
"=r,?o,?Q,r,r")
(match_operand:DF 1 "reg_or_0_or_nonsymb_mem_operand"
- "rG,r,r,o,Q"))]
+ "rG,r,r,o,RQ"))]
"(register_operand (operands[0], DFmode)
|| reg_or_0_operand (operands[1], DFmode))
- && ! TARGET_64BIT
+ && !TARGET_64BIT
&& TARGET_SOFT_FLOAT"
"*
{
@@ -3136,13 +3889,13 @@
(set_attr "length" "8,8,16,8,16")])
(define_insn ""
- [(set (match_operand:DF 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,Q,!*q,!f,f,*TR")
- (match_operand:DF 1 "move_operand"
- "r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))]
+ [(set (match_operand:DF 0 "move_dest_operand"
+ "=!*r,*r,*r,*r,*r,Q,!*q,f,f,T")
+ (match_operand:DF 1 "move_src_operand"
+ "!*r,J,N,K,RQ,*rM,!*rM,fM,RT,f"))]
"(register_operand (operands[0], DFmode)
|| reg_or_0_operand (operands[1], DFmode))
- && ! TARGET_SOFT_FLOAT && TARGET_64BIT"
+ && !TARGET_SOFT_FLOAT && TARGET_64BIT"
"@
copy %1,%0
ldi %1,%0
@@ -3158,50 +3911,15 @@
(set_attr "pa_combine_type" "addmove")
(set_attr "length" "4,4,4,4,4,4,4,4,4,4")])
-(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=fx")
- (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{flddx|fldd} %2(%1),%0"
- [(set_attr "type" "fpload")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:DF 0 "register_operand" "=fx")
- (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{flddx|fldd} %1(%2),%0"
- [(set_attr "type" "fpload")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (mem:DF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r")))
- (match_operand:DF 0 "register_operand" "fx"))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fstdx|fstd} %0,%2(%1)"
- [(set_attr "type" "fpstore")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (mem:DF (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r")))
- (match_operand:DF 0 "register_operand" "fx"))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fstdx|fstd} %0,%1(%2)"
- [(set_attr "type" "fpstore")
- (set_attr "length" "4")])
-
+
(define_expand "movdi"
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand" "")
+ [(set (match_operand:DI 0 "general_operand" "")
(match_operand:DI 1 "general_operand" ""))]
""
"
{
if (GET_CODE (operands[1]) == CONST_DOUBLE && TARGET_64BIT)
- operands[1] = force_const_mem (DImode, operands[1]);
+ operands[1] = force_const_mem (DImode, operands[1]);
if (emit_move_sequence (operands, DImode, 0))
DONE;
@@ -3276,14 +3994,14 @@
(set_attr "length" "8")])
(define_insn ""
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
- "=r,o,Q,r,r,r,f,f,*TR")
+ [(set (match_operand:DI 0 "move_dest_operand"
+ "=r,o,Q,r,r,r,*f,*f,T")
(match_operand:DI 1 "general_operand"
- "rM,r,r,o*R,Q,i,fM,*TR,f"))]
+ "rM,r,r,o*R,Q,i,*fM,RT,*f"))]
"(register_operand (operands[0], DImode)
|| reg_or_0_operand (operands[1], DImode))
- && ! TARGET_64BIT
- && ! TARGET_SOFT_FLOAT"
+ && !TARGET_64BIT
+ && !TARGET_SOFT_FLOAT"
"*
{
if (FP_REG_P (operands[0]) || FP_REG_P (operands[1])
@@ -3295,13 +4013,13 @@
(set_attr "length" "8,8,16,8,16,16,4,4,4")])
(define_insn ""
- [(set (match_operand:DI 0 "reg_or_nonsymb_mem_operand"
- "=r,r,r,r,r,r,Q,!*q,!f,f,*TR")
- (match_operand:DI 1 "move_operand"
- "A,r,J,N,K,RQ,rM,!rM,!fM,*RT,f"))]
+ [(set (match_operand:DI 0 "move_dest_operand"
+ "=r,r,r,r,r,r,Q,!*q,!*f,*f,T")
+ (match_operand:DI 1 "move_src_operand"
+ "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"
+ && !TARGET_SOFT_FLOAT && TARGET_64BIT"
"@
ldd RT'%A1,%0
copy %1,%0
@@ -3319,13 +4037,93 @@
(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"
+ [(set (match_operand:DI 0 "indexed_memory_operand" "=R")
+ (match_operand:DI 1 "register_operand" "f"))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && !TARGET_DISABLE_INDEXING
+ && reload_completed"
+ "fstd%F0 %1,%0"
+ [(set_attr "type" "fpstore")
+ (set_attr "pa_combine_type" "addmove")
+ (set_attr "length" "4")])
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 8))
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DI (match_dup 0))
+ (match_operand:DI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DI (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 2 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 8))))
+ (set (mem:DI (match_dup 0))
+ (match_operand:DI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DI (plus:DI (mult:DI (match_dup 1) (const_int 8)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 8))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DI (match_dup 0))
+ (match_operand:DI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DI (plus:DI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:DI (match_dup 0))
+ (match_operand:DI 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:DI (plus:DI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:DI 0 "move_dest_operand"
"=r,o,Q,r,r,r")
(match_operand:DI 1 "general_operand"
"rM,r,r,o,Q,i"))]
"(register_operand (operands[0], DImode)
|| reg_or_0_operand (operands[1], DImode))
- && ! TARGET_64BIT
+ && !TARGET_64BIT
&& TARGET_SOFT_FLOAT"
"*
{
@@ -3416,26 +4214,169 @@
}")
(define_insn ""
- [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand"
- "=f,r,f,r,RQ,Q")
+ [(set (match_operand:SF 0 "move_dest_operand"
+ "=f,!*r,f,*r,Q,Q")
(match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand"
- "fG,rG,RQ,RQ,f,rG"))]
+ "fG,!*rG,RQ,RQ,f,*rG"))]
"(register_operand (operands[0], SFmode)
|| reg_or_0_operand (operands[1], SFmode))
- && ! TARGET_SOFT_FLOAT"
+ && !TARGET_SOFT_FLOAT"
"@
fcpy,sgl %f1,%0
copy %r1,%0
fldw%F1 %1,%0
ldw%M1 %1,%0
- fstw%F0 %r1,%0
+ fstw%F0 %1,%0
stw%M0 %r1,%0"
[(set_attr "type" "fpalu,move,fpload,load,fpstore,store")
(set_attr "pa_combine_type" "addmove")
(set_attr "length" "4,4,4,4,4,4")])
(define_insn ""
- [(set (match_operand:SF 0 "reg_or_nonsymb_mem_operand"
+ [(set (match_operand:SF 0 "indexed_memory_operand" "=R")
+ (match_operand:SF 1 "register_operand" "f"))]
+ "!TARGET_SOFT_FLOAT
+ && !TARGET_DISABLE_INDEXING
+ && reload_completed"
+ "fstw%F0 %1,%0"
+ [(set_attr "type" "fpstore")
+ (set_attr "pa_combine_type" "addmove")
+ (set_attr "length" "4")])
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 4))
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 2 "register_operand" "")
+ (mult:SI (match_operand:SI 1 "register_operand" "")
+ (const_int 4))))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:SI (mult:SI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (mult:SI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 4))
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 2 "register_operand" "")
+ (mult:DI (match_operand:DI 1 "register_operand" "")
+ (const_int 4))))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:DI (mult:DI (match_dup 1) (const_int 4)) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (mult:DI (match_dup 1) (const_int 4))
+ (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:SI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:SI 0 "register_operand" "")
+ (plus:SI (match_operand:SI 1 "register_operand" "")
+ (match_operand:SI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:SI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:SI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[1])
+ && (TARGET_NO_SPACE_REGS
+ || (!REG_POINTER (operands[1]) && REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:DI (match_dup 1) (match_dup 2)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 1) (match_dup 2)))]
+ "")
+
+(define_peephole2
+ [(set (match_operand:DI 0 "register_operand" "")
+ (plus:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))
+ (set (mem:SF (match_dup 0))
+ (match_operand:SF 3 "register_operand" ""))]
+ "!TARGET_SOFT_FLOAT
+ && TARGET_64BIT
+ && REG_OK_FOR_BASE_P (operands[2])
+ && (TARGET_NO_SPACE_REGS
+ || (REG_POINTER (operands[1]) && !REG_POINTER (operands[2])))
+ && FP_REGNO_P (REGNO (operands[3]))"
+ [(set (mem:SF (plus:DI (match_dup 2) (match_dup 1)))
+ (match_dup 3))
+ (set (match_dup 0) (plus:DI (match_dup 2) (match_dup 1)))]
+ "")
+
+(define_insn ""
+ [(set (match_operand:SF 0 "move_dest_operand"
"=r,r,Q")
(match_operand:SF 1 "reg_or_0_or_nonsymb_mem_operand"
"rG,RQ,rG"))]
@@ -3450,41 +4391,6 @@
(set_attr "pa_combine_type" "addmove")
(set_attr "length" "4,4,4")])
-(define_insn ""
- [(set (match_operand:SF 0 "register_operand" "=fx")
- (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fldwx|fldw} %2(%1),%0"
- [(set_attr "type" "fpload")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (match_operand:SF 0 "register_operand" "=fx")
- (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r"))))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fldwx|fldw} %1(%2),%0"
- [(set_attr "type" "fpload")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (mem:SF (plus:SI (match_operand:SI 1 "basereg_operand" "r")
- (match_operand:SI 2 "register_operand" "r")))
- (match_operand:SF 0 "register_operand" "fx"))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fstwx|fstw} %0,%2(%1)"
- [(set_attr "type" "fpstore")
- (set_attr "length" "4")])
-
-(define_insn ""
- [(set (mem:SF (plus:SI (match_operand:SI 1 "register_operand" "r")
- (match_operand:SI 2 "basereg_operand" "r")))
- (match_operand:SF 0 "register_operand" "fx"))]
- "! TARGET_DISABLE_INDEXING && ! TARGET_SOFT_FLOAT"
- "{fstwx|fstw} %0,%1(%2)"
- [(set_attr "type" "fpstore")
- (set_attr "length" "4")])
;;- zero extension instructions
@@ -3493,24 +4399,6 @@
;; memory operands. This gives us better overall code than just
;; having a pattern that does or does not accept memory operands.
-(define_expand "zero_extendhisi2"
- [(set (match_operand:SI 0 "register_operand" "")
- (zero_extend:SI
- (match_operand:HI 1 "register_operand" "")))]
- ""
- "")
-
-(define_insn ""
- [(set (match_operand:SI 0 "register_operand" "=r,r")
- (zero_extend:SI
- (match_operand:HI 1 "move_operand" "r,RQ")))]
- "GET_CODE (operands[1]) != CONST_INT"
- "@
- {extru|extrw,u} %1,31,16,%0
- ldh%M1 %1,%0"
- [(set_attr "type" "shift,load")
- (set_attr "length" "4,4")])
-
(define_expand "zero_extendqihi2"
[(set (match_operand:HI 0 "register_operand" "")
(zero_extend:HI
@@ -3521,7 +4409,7 @@
(define_insn ""
[(set (match_operand:HI 0 "register_operand" "=r,r")
(zero_extend:HI
- (match_operand:QI 1 "move_operand" "r,RQ")))]
+ (match_operand:QI 1 "move_src_operand" "r,RQ")))]
"GET_CODE (operands[1]) != CONST_INT"
"@
{extru|extrw,u} %1,31,8,%0
@@ -3539,7 +4427,7 @@
(define_insn ""
[(set (match_operand:SI 0 "register_operand" "=r,r")
(zero_extend:SI
- (match_operand:QI 1 "move_operand" "r,RQ")))]
+ (match_operand:QI 1 "move_src_operand" "r,RQ")))]
"GET_CODE (operands[1]) != CONST_INT"
"@
{extru|extrw,u} %1,31,8,%0
@@ -3547,29 +4435,77 @@
[(set_attr "type" "shift,load")
(set_attr "length" "4,4")])
-(define_insn "zero_extendqidi2"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI (match_operand:QI 1 "register_operand" "r")))]
+(define_expand "zero_extendhisi2"
+ [(set (match_operand:SI 0 "register_operand" "")
+ (zero_extend:SI
+ (match_operand:HI 1 "register_operand" "")))]
+ ""
+ "")
+
+(define_insn ""
+ [(set (match_operand:SI 0 "register_operand" "=r,r")
+ (zero_extend:SI
+ (match_operand:HI 1 "move_src_operand" "r,RQ")))]
+ "GET_CODE (operands[1]) != CONST_INT"
+ "@
+ {extru|extrw,u} %1,31,16,%0
+ ldh%M1 %1,%0"
+ [(set_attr "type" "shift,load")
+ (set_attr "length" "4,4")])
+
+(define_expand "zero_extendqidi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI
+ (match_operand:QI 1 "register_operand" "")))]
"TARGET_64BIT"
- "extrd,u %1,63,8,%0"
- [(set_attr "type" "shift")
- (set_attr "length" "4")])
+ "")
-(define_insn "zero_extendhidi2"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI (match_operand:HI 1 "register_operand" "r")))]
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (zero_extend:DI
+ (match_operand:QI 1 "move_src_operand" "r,RQ")))]
+ "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
+ "@
+ extrd,u %1,63,8,%0
+ ldb%M1 %1,%0"
+ [(set_attr "type" "shift,load")
+ (set_attr "length" "4,4")])
+
+(define_expand "zero_extendhidi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI
+ (match_operand:HI 1 "register_operand" "")))]
"TARGET_64BIT"
- "extrd,u %1,63,16,%0"
- [(set_attr "type" "shift")
- (set_attr "length" "4")])
+ "")
-(define_insn "zero_extendsidi2"
- [(set (match_operand:DI 0 "register_operand" "=r")
- (zero_extend:DI (match_operand:SI 1 "register_operand" "r")))]
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (zero_extend:DI
+ (match_operand:HI 1 "move_src_operand" "r,RQ")))]
+ "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
+ "@
+ extrd,u %1,63,16,%0
+ ldh%M1 %1,%0"
+ [(set_attr "type" "shift,load")
+ (set_attr "length" "4,4")])
+
+(define_expand "zero_extendsidi2"
+ [(set (match_operand:DI 0 "register_operand" "")
+ (zero_extend:DI
+ (match_operand:SI 1 "register_operand" "")))]
"TARGET_64BIT"
- "extrd,u %1,63,32,%0"
- [(set_attr "type" "shift")
- (set_attr "length" "4")])
+ "")
+
+(define_insn ""
+ [(set (match_operand:DI 0 "register_operand" "=r,r")
+ (zero_extend:DI
+ (match_operand:SI 1 "move_src_operand" "r,RQ")))]
+ "TARGET_64BIT && GET_CODE (operands[1]) != CONST_INT"
+ "@
+ extrd,u %1,63,32,%0
+ ldw%M1 %1,%0"
+ [(set_attr "type" "shift,load")
+ (set_attr "length" "4,4")])
;;- sign extension instructions
@@ -3874,7 +4810,7 @@
(match_operand:DI 2 "arith_operand" "r,J")))]
"TARGET_64BIT"
"@
- {addl|add,l} %1,%2,%0
+ add,l %1,%2,%0
ldo %2(%1),%0"
[(set_attr "type" "binary,binary")
(set_attr "pa_combine_type" "addmove")
@@ -4039,8 +4975,8 @@
;; The mulsi3 insns set up registers for the millicode call.
(define_expand "mulsi3"
- [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
- (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
+ [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
+ (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
(parallel [(set (reg:SI 29) (mult:SI (reg:SI 26) (reg:SI 25)))
(clobber (match_dup 3))
(clobber (reg:SI 26))
@@ -4051,14 +4987,15 @@
"
{
operands[4] = gen_rtx_REG (SImode, TARGET_64BIT ? 2 : 31);
- if (TARGET_PA_11 && ! TARGET_DISABLE_FPREGS && ! TARGET_SOFT_FLOAT)
+ if (TARGET_PA_11 && !TARGET_DISABLE_FPREGS && !TARGET_SOFT_FLOAT)
{
rtx scratch = gen_reg_rtx (DImode);
operands[1] = force_reg (SImode, operands[1]);
operands[2] = force_reg (SImode, operands[2]);
emit_insn (gen_umulsidi3 (scratch, operands[1], operands[2]));
- emit_insn (gen_rtx_SET (VOIDmode, operands[0],
- gen_rtx_SUBREG (SImode, scratch, GET_MODE_SIZE (SImode))));
+ emit_insn (gen_movsi (operands[0],
+ gen_rtx_SUBREG (SImode, scratch,
+ GET_MODE_SIZE (SImode))));
DONE;
}
operands[3] = gen_reg_rtx (SImode);
@@ -4163,8 +5100,8 @@
;;; Division and mod.
(define_expand "divsi3"
- [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
- (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
+ [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
+ (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
(parallel [(set (reg:SI 29) (div:SI (reg:SI 26) (reg:SI 25)))
(clobber (match_dup 3))
(clobber (match_dup 4))
@@ -4219,8 +5156,8 @@
(set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))])
(define_expand "udivsi3"
- [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
- (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
+ [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
+ (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
(parallel [(set (reg:SI 29) (udiv:SI (reg:SI 26) (reg:SI 25)))
(clobber (match_dup 3))
(clobber (match_dup 4))
@@ -4276,8 +5213,8 @@
(set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))])
(define_expand "modsi3"
- [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
- (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
+ [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
+ (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
(parallel [(set (reg:SI 29) (mod:SI (reg:SI 26) (reg:SI 25)))
(clobber (match_dup 3))
(clobber (match_dup 4))
@@ -4328,8 +5265,8 @@
(set (attr "length") (symbol_ref "attr_length_millicode_call (insn)"))])
(define_expand "umodsi3"
- [(set (reg:SI 26) (match_operand:SI 1 "move_operand" ""))
- (set (reg:SI 25) (match_operand:SI 2 "move_operand" ""))
+ [(set (reg:SI 26) (match_operand:SI 1 "move_src_operand" ""))
+ (set (reg:SI 25) (match_operand:SI 2 "move_src_operand" ""))
(parallel [(set (reg:SI 29) (umod:SI (reg:SI 26) (reg:SI 25)))
(clobber (match_dup 3))
(clobber (match_dup 4))
@@ -4385,15 +5322,25 @@
(define_expand "anddi3"
[(set (match_operand:DI 0 "register_operand" "")
- (and:DI (match_operand:DI 1 "arith_double_operand" "")
- (match_operand:DI 2 "arith_double_operand" "")))]
+ (and:DI (match_operand:DI 1 "and_operand" "")
+ (match_operand:DI 2 "and_operand" "")))]
""
"
{
- if (! register_operand (operands[1], DImode)
- || ! register_operand (operands[2], DImode))
- /* Let GCC break this into word-at-a-time operations. */
- FAIL;
+ if (TARGET_64BIT)
+ {
+ /* One operand must be a register operand. */
+ if (!register_operand (operands[1], DImode)
+ && !register_operand (operands[2], DImode))
+ FAIL;
+ }
+ else
+ {
+ /* Both operands must be register operands. */
+ if (!register_operand (operands[1], DImode)
+ || !register_operand (operands[2], DImode))
+ FAIL;
+ }
}")
(define_insn ""
@@ -4454,15 +5401,25 @@
(define_expand "iordi3"
[(set (match_operand:DI 0 "register_operand" "")
- (ior:DI (match_operand:DI 1 "arith_double_operand" "")
- (match_operand:DI 2 "arith_double_operand" "")))]
+ (ior:DI (match_operand:DI 1 "ior_operand" "")
+ (match_operand:DI 2 "ior_operand" "")))]
""
"
{
- if (! register_operand (operands[1], DImode)
- || ! register_operand (operands[2], DImode))
- /* Let GCC break this into word-at-a-time operations. */
- FAIL;
+ if (TARGET_64BIT)
+ {
+ /* One operand must be a register operand. */
+ if (!register_operand (operands[1], DImode)
+ && !register_operand (operands[2], DImode))
+ FAIL;
+ }
+ else
+ {
+ /* Both operands must be register operands. */
+ if (!register_operand (operands[1], DImode)
+ || !register_operand (operands[2], DImode))
+ FAIL;
+ }
}")
(define_insn ""
@@ -4525,15 +5482,11 @@
(define_expand "xordi3"
[(set (match_operand:DI 0 "register_operand" "")
- (xor:DI (match_operand:DI 1 "arith_double_operand" "")
- (match_operand:DI 2 "arith_double_operand" "")))]
+ (xor:DI (match_operand:DI 1 "register_operand" "")
+ (match_operand:DI 2 "register_operand" "")))]
""
"
{
- if (! register_operand (operands[1], DImode)
- || ! register_operand (operands[2], DImode))
- /* Let GCC break this into word-at-a-time operations. */
- FAIL;
}")
(define_insn ""
@@ -4595,12 +5548,10 @@
(define_expand "one_cmpldi2"
[(set (match_operand:DI 0 "register_operand" "")
- (not:DI (match_operand:DI 1 "arith_double_operand" "")))]
+ (not:DI (match_operand:DI 1 "register_operand" "")))]
""
"
{
- if (! register_operand (operands[1], DImode))
- FAIL;
}")
(define_insn ""
@@ -5695,35 +6646,48 @@
DONE;
}")
-;; Special because we use the value placed in %r2 by the bl instruction
-;; from within its delay slot to set the value for the 2nd parameter to
-;; the call.
-(define_insn "call_profiler"
- [(call (mem:SI (match_operand 0 "call_operand_address" ""))
- (match_operand 1 "" ""))
- (use (match_operand 2 "" ""))
- (use (reg:SI 25))
- (use (reg:SI 26))
- (clobber (reg:SI 2))]
+; Used by hppa_profile_hook to load the starting address of the current
+; function; operand 1 contains the address of the label in operand 3
+(define_insn "load_offset_label_address"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (plus:SI (match_operand:SI 1 "register_operand" "r")
+ (minus:SI (match_operand:SI 2 "" "")
+ (label_ref:SI (match_operand 3 "" "")))))]
""
+ "ldo %2-%l3(%1),%0"
+ [(set_attr "type" "multi")
+ (set_attr "length" "4")])
+
+; Output a code label and load its address.
+(define_insn "lcla1"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (label_ref:SI (match_operand 1 "" "")))
+ (const_int 0)]
+ "!TARGET_PA_20"
"*
{
- rtx xoperands[3];
-
- output_arg_descriptor (insn);
-
- xoperands[0] = operands[0];
- xoperands[1] = operands[2];
- xoperands[2] = gen_label_rtx ();
- output_asm_insn (\"{bl|b,l} %0,%%r2\;ldo %1-%2(%%r2),%%r25\", xoperands);
-
+ output_asm_insn (\"bl .+8,%0\;depi 0,31,2,%0\", operands);
(*targetm.asm_out.internal_label) (asm_out_file, \"L\",
- CODE_LABEL_NUMBER (xoperands[2]));
+ CODE_LABEL_NUMBER (operands[1]));
return \"\";
}"
[(set_attr "type" "multi")
(set_attr "length" "8")])
+(define_insn "lcla2"
+ [(set (match_operand:SI 0 "register_operand" "=r")
+ (label_ref:SI (match_operand 1 "" "")))
+ (const_int 0)]
+ "TARGET_PA_20"
+ "*
+{
+ (*targetm.asm_out.internal_label) (asm_out_file, \"L\",
+ CODE_LABEL_NUMBER (operands[1]));
+ return \"mfia %0\";
+}"
+ [(set_attr "type" "move")
+ (set_attr "length" "4")])
+
(define_insn "blockage"
[(unspec_volatile [(const_int 2)] 0)]
""
@@ -5735,9 +6699,6 @@
""
"*
{
- if (GET_MODE (insn) == SImode)
- return \"b %l0%#\";
-
/* An unconditional branch which can reach its target. */
if (get_attr_length (insn) != 24
&& get_attr_length (insn) != 16)
@@ -5761,6 +6722,24 @@
(const_int 24))]
(const_int 4)))])
+;;; Hope this is only within a function...
+(define_insn "indirect_jump"
+ [(set (pc) (match_operand 0 "register_operand" "r"))]
+ "GET_MODE (operands[0]) == word_mode"
+ "bv%* %%r0(%0)"
+ [(set_attr "type" "branch")
+ (set_attr "length" "4")])
+
+;;; This jump is used in branch tables where the insn length is fixed.
+;;; The length of this insn is adjusted if the delay slot is not filled.
+(define_insn "short_jump"
+ [(set (pc) (label_ref (match_operand 0 "" "")))
+ (const_int 0)]
+ ""
+ "b%* %l0%#"
+ [(set_attr "type" "btable_branch")
+ (set_attr "length" "4")])
+
;; Subroutines of "casesi".
;; operand 0 is index
;; operand 1 is the minimum bound
@@ -5782,14 +6761,13 @@
if (operands[1] != const0_rtx)
{
- rtx reg = gen_reg_rtx (SImode);
+ rtx index = gen_reg_rtx (SImode);
operands[1] = GEN_INT (-INTVAL (operands[1]));
if (!INT_14_BITS (operands[1]))
operands[1] = force_reg (SImode, operands[1]);
- emit_insn (gen_addsi3 (reg, operands[0], operands[1]));
-
- operands[0] = reg;
+ emit_insn (gen_addsi3 (index, operands[0], operands[1]));
+ operands[0] = index;
}
/* In 64bit mode we must make sure to wipe the upper bits of the register
@@ -5797,38 +6775,118 @@
high part of the register. */
if (TARGET_64BIT)
{
- rtx reg = gen_reg_rtx (DImode);
- emit_insn (gen_extendsidi2 (reg, operands[0]));
- operands[0] = gen_rtx_SUBREG (SImode, reg, 4);
+ rtx index = gen_reg_rtx (DImode);
+
+ emit_insn (gen_extendsidi2 (index, operands[0]));
+ operands[0] = gen_rtx_SUBREG (SImode, index, 4);
}
if (!INT_5_BITS (operands[2]))
operands[2] = force_reg (SImode, operands[2]);
+ /* This branch prevents us finding an insn for the delay slot of the
+ following vectored branch. It might be possible to use the delay
+ slot if an index value of -1 was used to transfer to the out-of-range
+ label. In order to do this, we would have to output the -1 vector
+ element after the delay insn. The casesi output code would have to
+ check if the casesi insn is in a delay branch sequence and output
+ the delay insn if one is found. If this was done, then it might
+ then be worthwhile to split the casesi patterns to improve scheduling.
+ However, it's not clear that all this extra complexity is worth
+ the effort. */
emit_insn (gen_cmpsi (operands[0], operands[2]));
emit_jump_insn (gen_bgtu (operands[4]));
+
if (TARGET_BIG_SWITCH)
{
- rtx temp = gen_reg_rtx (SImode);
- emit_move_insn (temp, gen_rtx_PLUS (SImode, operands[0], operands[0]));
- operands[0] = temp;
+ if (TARGET_64BIT)
+ {
+ rtx tmp1 = gen_reg_rtx (DImode);
+ rtx tmp2 = gen_reg_rtx (DImode);
+
+ emit_jump_insn (gen_casesi64p (operands[0], operands[3],
+ tmp1, tmp2));
+ }
+ else
+ {
+ rtx tmp1 = gen_reg_rtx (SImode);
+
+ if (flag_pic)
+ {
+ rtx tmp2 = gen_reg_rtx (SImode);
+
+ emit_jump_insn (gen_casesi32p (operands[0], operands[3],
+ tmp1, tmp2));
+ }
+ else
+ emit_jump_insn (gen_casesi32 (operands[0], operands[3], tmp1));
+ }
}
- emit_jump_insn (gen_casesi0 (operands[0], operands[3]));
+ else
+ emit_jump_insn (gen_casesi0 (operands[0], operands[3]));
DONE;
}")
+;;; The rtl for this pattern doesn't accurately describe what the insn
+;;; actually does, particularly when case-vector elements are exploded
+;;; in pa_reorg. However, the initial SET in these patterns must show
+;;; the connection of the insn to the following jump table.
(define_insn "casesi0"
- [(set (pc) (plus:SI
- (mem:SI (plus:SI (pc)
- (match_operand:SI 0 "register_operand" "r")))
- (label_ref (match_operand 1 "" ""))))]
+ [(set (pc) (mem:SI (plus:SI
+ (mult:SI (match_operand:SI 0 "register_operand" "r")
+ (const_int 4))
+ (label_ref (match_operand 1 "" "")))))]
""
- "blr %0,%%r0\;nop"
+ "blr,n %0,%%r0\;nop"
[(set_attr "type" "multi")
(set_attr "length" "8")])
-;; Need nops for the calls because execution is supposed to continue
-;; past; we don't want to nullify an instruction that we need.
+;;; 32-bit code, absolute branch table.
+(define_insn "casesi32"
+ [(set (pc) (mem:SI (plus:SI
+ (mult:SI (match_operand:SI 0 "register_operand" "r")
+ (const_int 4))
+ (label_ref (match_operand 1 "" "")))))
+ (clobber (match_operand:SI 2 "register_operand" "=&r"))]
+ "!TARGET_64BIT && TARGET_BIG_SWITCH"
+ "ldil L'%l1,%2\;ldo R'%l1(%2),%2\;{ldwx|ldw},s %0(%2),%2\;bv,n %%r0(%2)"
+ [(set_attr "type" "multi")
+ (set_attr "length" "16")])
+
+;;; 32-bit code, relative branch table.
+(define_insn "casesi32p"
+ [(set (pc) (mem:SI (plus:SI
+ (mult:SI (match_operand:SI 0 "register_operand" "r")
+ (const_int 4))
+ (label_ref (match_operand 1 "" "")))))
+ (clobber (match_operand:SI 2 "register_operand" "=&a"))
+ (clobber (match_operand:SI 3 "register_operand" "=&r"))]
+ "!TARGET_64BIT && TARGET_BIG_SWITCH"
+ "{bl .+8,%2\;depi 0,31,2,%2|mfia %2}\;ldo {16|20}(%2),%2\;\
+{ldwx|ldw},s %0(%2),%3\;{addl|add,l} %2,%3,%3\;bv,n %%r0(%3)"
+ [(set_attr "type" "multi")
+ (set (attr "length")
+ (if_then_else (ne (symbol_ref "TARGET_PA_20") (const_int 0))
+ (const_int 20)
+ (const_int 24)))])
+
+;;; 64-bit code, 32-bit relative branch table.
+(define_insn "casesi64p"
+ [(set (pc) (mem:DI (plus:DI
+ (mult:DI (sign_extend:DI
+ (match_operand:SI 0 "register_operand" "r"))
+ (const_int 8))
+ (label_ref (match_operand 1 "" "")))))
+ (clobber (match_operand:DI 2 "register_operand" "=&r"))
+ (clobber (match_operand:DI 3 "register_operand" "=&r"))]
+ "TARGET_64BIT && TARGET_BIG_SWITCH"
+ "mfia %2\;ldo 24(%2),%2\;ldw,s %0(%2),%3\;extrd,s %3,63,32,%3\;\
+add,l %2,%3,%3\;bv,n %%r0(%3)"
+ [(set_attr "type" "multi")
+ (set_attr "length" "24")])
+
+
+;; Call patterns.
;;- jump to subroutine
(define_expand "call"
@@ -7137,14 +8195,6 @@
DONE;
}")
-;;; Hope this is only within a function...
-(define_insn "indirect_jump"
- [(set (pc) (match_operand 0 "register_operand" "r"))]
- "GET_MODE (operands[0]) == word_mode"
- "bv%* %%r0(%0)"
- [(set_attr "type" "branch")
- (set_attr "length" "4")])
-
;;; Operands 2 and 3 are assumed to be CONST_INTs.
(define_expand "extzv"
[(set (match_operand 0 "register_operand" "")
@@ -7718,11 +8768,11 @@
;; Clean up turds left by reload.
(define_peephole
- [(set (match_operand 0 "reg_or_nonsymb_mem_operand" "")
+ [(set (match_operand 0 "move_dest_operand" "")
(match_operand 1 "register_operand" "fr"))
(set (match_operand 2 "register_operand" "fr")
(match_dup 0))]
- "! TARGET_SOFT_FLOAT
+ "!TARGET_SOFT_FLOAT
&& GET_CODE (operands[0]) == MEM
&& ! MEM_VOLATILE_P (operands[0])
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
@@ -7758,10 +8808,10 @@
(define_peephole
[(set (match_operand 0 "register_operand" "fr")
- (match_operand 1 "reg_or_nonsymb_mem_operand" ""))
+ (match_operand 1 "move_src_operand" ""))
(set (match_operand 2 "register_operand" "fr")
(match_dup 1))]
- "! TARGET_SOFT_FLOAT
+ "!TARGET_SOFT_FLOAT
&& GET_CODE (operands[1]) == MEM
&& ! MEM_VOLATILE_P (operands[1])
&& GET_MODE (operands[0]) == GET_MODE (operands[1])
@@ -7792,29 +8842,59 @@
return \"\";
}")
-;; Flush the I and D cache line found at the address in operand 0.
+;; Flush the I and D cache lines from the start address (operand0)
+;; to the end address (operand1). No lines are flushed if the end
+;; address is less than the start address (unsigned).
+;;
+;; Because the range of memory flushed is variable and the size of
+;; a MEM can only be a CONST_INT, the patterns specify that they
+;; perform an unspecified volatile operation on all memory.
+;;
+;; The address range for an icache flush must lie within a single
+;; space on targets with non-equivalent space registers.
+;;
;; This is used by the trampoline code for nested functions.
-;; So long as the trampoline itself is less than 32 bytes this
-;; is sufficient.
-
+;;
+;; Operand 0 contains the start address.
+;; Operand 1 contains the end address.
+;; Operand 2 contains the line length to use.
+;; Operand 3 contains the start address (clobbered).
+;; Operands 4 and 5 (icacheflush) are clobbered scratch registers.
(define_insn "dcacheflush"
- [(unspec_volatile [(const_int 1)] 0)
- (use (mem:SI (match_operand 0 "pmode_register_operand" "r")))
- (use (mem:SI (match_operand 1 "pmode_register_operand" "r")))]
+ [(const_int 1)
+ (unspec_volatile [(mem:BLK (scratch))] 0)
+ (use (match_operand 0 "pmode_register_operand" "r"))
+ (use (match_operand 1 "pmode_register_operand" "r"))
+ (use (match_operand 2 "pmode_register_operand" "r"))
+ (clobber (match_scratch 3 "=&0"))]
""
- "fdc 0(%0)\;fdc 0(%1)\;sync"
+ "*
+{
+ if (TARGET_64BIT)
+ return \"cmpb,*<<=,n %3,%1,.\;fdc,m %2(%3)\;sync\";
+ else
+ return \"cmpb,<<=,n %3,%1,.\;fdc,m %2(%3)\;sync\";
+}"
[(set_attr "type" "multi")
(set_attr "length" "12")])
(define_insn "icacheflush"
- [(unspec_volatile [(const_int 2)] 0)
- (use (mem:SI (match_operand 0 "pmode_register_operand" "r")))
- (use (mem:SI (match_operand 1 "pmode_register_operand" "r")))
+ [(const_int 2)
+ (unspec_volatile [(mem:BLK (scratch))] 0)
+ (use (match_operand 0 "pmode_register_operand" "r"))
+ (use (match_operand 1 "pmode_register_operand" "r"))
(use (match_operand 2 "pmode_register_operand" "r"))
- (clobber (match_operand 3 "pmode_register_operand" "=&r"))
- (clobber (match_operand 4 "pmode_register_operand" "=&r"))]
+ (clobber (match_scratch 3 "=&0"))
+ (clobber (match_operand 4 "pmode_register_operand" "=&r"))
+ (clobber (match_operand 5 "pmode_register_operand" "=&r"))]
""
- "mfsp %%sr0,%4\;ldsid (%2),%3\;mtsp %3,%%sr0\;fic 0(%%sr0,%0)\;fic 0(%%sr0,%1)\;sync\;mtsp %4,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop"
+ "*
+{
+ if (TARGET_64BIT)
+ return \"mfsp %%sr0,%5\;ldsid (%3),%4\;mtsp %4,%%sr0\;cmpb,*<<=,n %3,%1,.\;fic,m %2(%%sr0,%3)\;sync\;mtsp %5,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop\";
+ else
+ return \"mfsp %%sr0,%5\;ldsid (%3),%4\;mtsp %4,%%sr0\;cmpb,<<=,n %3,%1,.\;fic,m %2(%%sr0,%3)\;sync\;mtsp %5,%%sr0\;nop\;nop\;nop\;nop\;nop\;nop\";
+}"
[(set_attr "type" "multi")
(set_attr "length" "52")])
diff --git a/gcc/config/pa/som.h b/gcc/config/pa/som.h
index fae73922a98..ae52cd0a30e 100644
--- a/gcc/config/pa/som.h
+++ b/gcc/config/pa/som.h
@@ -234,7 +234,7 @@ do { \
#define EXTRA_SECTION_FUNCTIONS \
extern void readonly_data (void); \
void \
-readonly_data () \
+readonly_data (void) \
{ \
if (in_section != in_readonly_data) \
{ \
@@ -332,8 +332,8 @@ readonly_data () \
#define DO_GLOBAL_DTORS_BODY \
do { \
- extern void __gcc_plt_call (); \
- void (*reference)() = &__gcc_plt_call; \
+ extern void __gcc_plt_call (void); \
+ void (*reference)(void) = &__gcc_plt_call; \
func_ptr *p; \
__asm__ ("" : : "r" (reference)); \
for (p = __DTOR_LIST__ + 1; *p; ) \
diff --git a/gcc/config/ptx4.h b/gcc/config/ptx4.h
index c29d8d30fee..33e91d15135 100644
--- a/gcc/config/ptx4.h
+++ b/gcc/config/ptx4.h
@@ -33,7 +33,6 @@ Boston, MA 02111-1307, USA.
#undef PREFERRED_DEBUGGING_TYPE
#define PREFERRED_DEBUGGING_TYPE DWARF2_DEBUG
-#undef DWARF_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO 1
/* Cpp, assembler, linker, library, and startfile spec's. */
diff --git a/gcc/config/rs6000/aix.h b/gcc/config/rs6000/aix.h
index 97897b88ca7..e6d8e1f1c86 100644
--- a/gcc/config/rs6000/aix.h
+++ b/gcc/config/rs6000/aix.h
@@ -241,3 +241,8 @@
/* Print subsidiary information on the compiler version in use. */
#define TARGET_VERSION ;
+
+/* No version of AIX fully supports AltiVec or 64-bit instructions in
+ 32-bit mode. */
+#define OS_MISSING_POWERPC64 1
+#define OS_MISSING_ALTIVEC 1
diff --git a/gcc/config/rs6000/altivec.h b/gcc/config/rs6000/altivec.h
index d7718fee98b..c98d6ea3743 100644
--- a/gcc/config/rs6000/altivec.h
+++ b/gcc/config/rs6000/altivec.h
@@ -1094,7 +1094,7 @@ vec_vcmpgtub (vector unsigned char a1, vector unsigned char a2)
inline vector signed int
vec_cmple (vector float a1, vector float a2)
{
- return (vector signed int) __builtin_altivec_vcmpgefp ((vector float) a1, (vector float) a2);
+ return (vector signed int) __builtin_altivec_vcmpgefp ((vector float) a2, (vector float) a1);
}
/* vec_cmplt */
@@ -5526,7 +5526,7 @@ vec_all_nlt (vector float a1, vector float a2)
inline int
vec_all_numeric (vector float a1)
{
- return __builtin_altivec_vcmpeqfp_p (__CR6_EQ, a1, a1);
+ return __builtin_altivec_vcmpeqfp_p (__CR6_LT, a1, a1);
}
/* vec_any_eq */
@@ -6521,7 +6521,7 @@ __ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
((vector signed char) __builtin_altivec_vcmpgtub ((vector signed char) (a1), (vector signed char) (a2))), \
__altivec_link_error_invalid_argument ())
-#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a1), (a2))
+#define vec_cmple(a1, a2) __builtin_altivec_vcmpgefp ((a2), (a1))
#define vec_cmplt(a2, a1) \
__ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \
@@ -8343,7 +8343,7 @@ __ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \
#define vec_all_nlt(a1, a2) __builtin_altivec_vcmpgtfp_p (__CR6_EQ, (a2), (a1))
-#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_EQ, (a1), (a1))
+#define vec_all_numeric(a1) __builtin_altivec_vcmpeqfp_p (__CR6_LT, (a1), (a1))
#define vec_any_eq(a1, a2) \
__ch (__bin_args_eq (vector signed char, (a1), vector unsigned char, (a2)), \
diff --git a/gcc/config/rs6000/altivec.md b/gcc/config/rs6000/altivec.md
index 329e3b9b5b6..73d0417771d 100644
--- a/gcc/config/rs6000/altivec.md
+++ b/gcc/config/rs6000/altivec.md
@@ -113,26 +113,10 @@
(define_split
[(set (match_operand:V4SI 0 "nonimmediate_operand" "")
(match_operand:V4SI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
+ "TARGET_ALTIVEC && reload_completed
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-(define_split
- [(set (match_operand:V4SI 0 "nonimmediate_operand" "")
- (match_operand:V4SI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
- && gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
-"{
- rs6000_split_multireg_move (operands);
-}")
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_split
[(set (match_operand:V4SI 0 "altivec_register_operand" "")
@@ -175,26 +159,10 @@
(define_split
[(set (match_operand:V8HI 0 "nonimmediate_operand" "")
(match_operand:V8HI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
+ "TARGET_ALTIVEC && reload_completed
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-(define_split
- [(set (match_operand:V8HI 0 "nonimmediate_operand" "")
- (match_operand:V8HI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
- && gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
-"{
- rs6000_split_multireg_move (operands);
-}")
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_split
[(set (match_operand:V8HI 0 "altivec_register_operand" "")
@@ -237,26 +205,10 @@
(define_split
[(set (match_operand:V16QI 0 "nonimmediate_operand" "")
(match_operand:V16QI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
+ "TARGET_ALTIVEC && reload_completed
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-(define_split
- [(set (match_operand:V16QI 0 "nonimmediate_operand" "")
- (match_operand:V16QI 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
- && gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
-"{
- rs6000_split_multireg_move (operands);
-}")
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_split
[(set (match_operand:V16QI 0 "altivec_register_operand" "")
@@ -299,26 +251,10 @@
(define_split
[(set (match_operand:V4SF 0 "nonimmediate_operand" "")
(match_operand:V4SF 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && TARGET_POWERPC64
- && gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-(define_split
- [(set (match_operand:V4SF 0 "nonimmediate_operand" "")
- (match_operand:V4SF 1 "input_operand" ""))]
- "TARGET_ALTIVEC && reload_completed && !TARGET_POWERPC64
+ "TARGET_ALTIVEC && reload_completed
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
-"{
- rs6000_split_multireg_move (operands);
-}")
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_insn "get_vrsave_internal"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -670,7 +606,7 @@
(match_operand:V16QI 2 "register_operand" "v")
(match_operand:V4SI 3 "register_operand" "v")] 66))]
"TARGET_ALTIVEC"
- "vmsumubm %0,%1,%2,%3"
+ "vmsummbm %0,%1,%2,%3"
[(set_attr "type" "veccomplex")])
(define_insn "altivec_vmsumuhm"
diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
index 15e3f24c336..c77279d2142 100644
--- a/gcc/config/rs6000/darwin.h
+++ b/gcc/config/rs6000/darwin.h
@@ -71,6 +71,7 @@
#define SUBTARGET_OVERRIDE_OPTIONS \
do { \
rs6000_altivec_abi = 1; \
+ rs6000_altivec_vrsave = 1; \
if (DEFAULT_ABI == ABI_DARWIN) \
{ \
if (MACHO_DYNAMIC_NO_PIC_P) \
@@ -97,9 +98,14 @@ do { \
%{static: %{Zdynamic: %e conflicting code gen style switches are used}}\
%{!static:%{!mdynamic-no-pic:-fPIC}}"
+/* It's virtually impossible to predict all the possible combinations
+ of -mcpu and -maltivec and whatnot, so just supply
+ -force_cpusubtype_ALL if any are seen. Radar 3492132 against the
+ assembler is asking for a .machine directive so we could get this
+ really right. */
#define ASM_SPEC "-arch ppc \
%{Zforce_cpusubtype_ALL:-force_cpusubtype_ALL} \
- %{!Zforce_cpusubtype_ALL:%{faltivec:-force_cpusubtype_ALL}}"
+ %{!Zforce_cpusubtype_ALL:%{maltivec|mcpu=*|mpowerpc64:-force_cpusubtype_ALL}}"
#undef SUBTARGET_EXTRA_SPECS
#define SUBTARGET_EXTRA_SPECS \
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index 63471ea7b1f..338143c2dfc 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -74,17 +74,17 @@
rs6000_current_abi = ABI_AIX; \
error (INVALID_64BIT, "call"); \
} \
- if (TARGET_RELOCATABLE) \
+ if (target_flags & MASK_RELOCATABLE) \
{ \
target_flags &= ~MASK_RELOCATABLE; \
error (INVALID_64BIT, "relocatable"); \
} \
- if (TARGET_EABI) \
+ if (target_flags & MASK_EABI) \
{ \
target_flags &= ~MASK_EABI; \
error (INVALID_64BIT, "eabi"); \
} \
- if (TARGET_PROTOTYPE) \
+ if (target_flags & MASK_PROTOTYPE) \
{ \
target_flags &= ~MASK_PROTOTYPE; \
error (INVALID_64BIT, "prototype"); \
diff --git a/gcc/config/rs6000/rs6000-protos.h b/gcc/config/rs6000/rs6000-protos.h
index 35af1676152..79679f44a6c 100644
--- a/gcc/config/rs6000/rs6000-protos.h
+++ b/gcc/config/rs6000/rs6000-protos.h
@@ -125,7 +125,7 @@ extern int mfcr_operation (rtx, enum machine_mode);
extern int mtcrf_operation (rtx, enum machine_mode);
extern int lmw_operation (rtx, enum machine_mode);
extern struct rtx_def *create_TOC_reference (rtx);
-extern void rs6000_split_multireg_move (rtx *);
+extern void rs6000_split_multireg_move (rtx, rtx);
extern void rs6000_emit_move (rtx, rtx, enum machine_mode);
extern rtx rs6000_legitimize_address (rtx, rtx, enum machine_mode);
extern rtx rs6000_legitimize_reload_address (rtx, enum machine_mode,
@@ -134,6 +134,7 @@ extern int rs6000_legitimate_address (enum machine_mode, rtx, int);
extern bool rs6000_mode_dependent_address (rtx);
extern rtx rs6000_return_addr (int, rtx);
extern void rs6000_output_symbol_ref (FILE*, rtx);
+extern HOST_WIDE_INT rs6000_initial_elimination_offset (int, int);
extern rtx rs6000_machopic_legitimize_pic_address (rtx orig,
enum machine_mode mode, rtx reg);
@@ -166,10 +167,8 @@ extern enum direction function_arg_padding (enum machine_mode, tree);
extern void optimization_options (int, int);
extern void rs6000_override_options (const char *);
extern int direct_return (void);
-extern union tree_node *rs6000_build_va_list (void);
extern int first_reg_to_save (void);
extern int first_fp_reg_to_save (void);
-extern rs6000_stack_t *rs6000_stack_info (void);
extern void output_ascii (FILE *, const char *, int);
extern void rs6000_gen_section_name (char **, const char *, const char *);
extern void output_function_profiler (FILE *, int);
@@ -188,7 +187,7 @@ extern void rs6000_emit_prologue (void);
extern void rs6000_emit_load_toc_table (int);
extern void rs6000_aix_emit_builtin_unwind_init (void);
extern void rs6000_emit_epilogue (int);
-extern void debug_stack_info (rs6000_stack_t *);
+extern void rs6000_emit_eh_reg_restore (rtx, rtx);
extern const char * output_isel (rtx *);
extern int vrsave_operation (rtx, enum machine_mode);
extern int rs6000_register_move_cost (enum machine_mode,
@@ -202,4 +201,8 @@ extern int rs6000_tls_symbol_ref (rtx, enum machine_mode);
extern void rs6000_pragma_longcall (struct cpp_reader *);
extern void rs6000_cpu_cpp_builtins (struct cpp_reader *);
+#if TARGET_MACHO
+char *output_call (rtx, rtx *, int, int);
+#endif
+
#endif /* rs6000-protos.h */
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2387ea7d367..53c8b36a86d 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -70,6 +70,49 @@
#define min(A,B) ((A) < (B) ? (A) : (B))
#define max(A,B) ((A) > (B) ? (A) : (B))
+/* Structure used to define the rs6000 stack */
+typedef struct rs6000_stack {
+ int first_gp_reg_save; /* first callee saved GP register used */
+ int first_fp_reg_save; /* first callee saved FP register used */
+ int first_altivec_reg_save; /* first callee saved AltiVec register used */
+ int lr_save_p; /* true if the link reg needs to be saved */
+ int cr_save_p; /* true if the CR reg needs to be saved */
+ unsigned int vrsave_mask; /* mask of vec registers to save */
+ int toc_save_p; /* true if the TOC needs to be saved */
+ int push_p; /* true if we need to allocate stack space */
+ int calls_p; /* true if the function makes any calls */
+ enum rs6000_abi abi; /* which ABI to use */
+ int gp_save_offset; /* offset to save GP regs from initial SP */
+ int fp_save_offset; /* offset to save FP regs from initial SP */
+ int altivec_save_offset; /* offset to save AltiVec regs from initial SP */
+ int lr_save_offset; /* offset to save LR from initial SP */
+ int cr_save_offset; /* offset to save CR from initial SP */
+ int vrsave_save_offset; /* offset to save VRSAVE from initial SP */
+ int spe_gp_save_offset; /* offset to save spe 64-bit gprs */
+ 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 */
+ HOST_WIDE_INT vars_size; /* variable save area size */
+ int parm_size; /* outgoing parameter size */
+ int save_size; /* save area size */
+ int fixed_size; /* fixed size of stack frame */
+ int gp_size; /* size of saved GP registers */
+ int fp_size; /* size of saved FP registers */
+ int altivec_size; /* size of saved AltiVec registers */
+ int cr_size; /* size to hold CR if not in save_size */
+ int lr_size; /* size to hold LR if not in save_size */
+ int vrsave_size; /* size to hold VRSAVE if not in save_size */
+ int altivec_padding_size; /* size of altivec alignment padding if
+ not in save_size */
+ int spe_gp_size; /* size of 64-bit GPR save size for SPE */
+ int spe_padding_size;
+ int toc_size; /* size to hold TOC if not in save_size */
+ HOST_WIDE_INT total_size; /* total bytes allocated for stack */
+ int spe_64bit_regs_used;
+} rs6000_stack_t;
+
/* Target cpu type */
enum processor_type rs6000_cpu;
@@ -222,7 +265,7 @@ static void rs6000_frame_related (rtx, rtx, HOST_WIDE_INT, rtx, rtx);
static rtx spe_synthesize_frame_save (rtx);
static bool spe_func_has_64bit_regs_p (void);
static void emit_frame_save (rtx, rtx, enum machine_mode, unsigned int,
- int, int);
+ int, HOST_WIDE_INT);
static rtx gen_frame_mem_offset (enum machine_mode, rtx, int);
static void rs6000_emit_allocate_stack (HOST_WIDE_INT, int);
static unsigned rs6000_hash_constant (rtx);
@@ -235,6 +278,7 @@ static bool legitimate_small_data_p (enum machine_mode, rtx);
static bool legitimate_offset_address_p (enum machine_mode, rtx, int);
static bool legitimate_indexed_address_p (rtx, int);
static bool legitimate_indirect_address_p (rtx, int);
+static bool macho_lo_sum_memory_operand (rtx x, enum machine_mode mode);
static bool legitimate_lo_sum_address_p (enum machine_mode, rtx, int);
static struct machine_function * rs6000_init_machine_status (void);
static bool rs6000_assemble_integer (rtx, unsigned int, int);
@@ -316,6 +360,8 @@ static rtx spe_expand_builtin (tree, rtx, bool *);
static rtx spe_expand_predicate_builtin (enum insn_code, tree, rtx);
static rtx spe_expand_evsel_builtin (enum insn_code, tree, rtx);
static int rs6000_emit_int_cmove (rtx, rtx, rtx, rtx);
+static rs6000_stack_t *rs6000_stack_info (void);
+static void debug_stack_info (rs6000_stack_t *);
static rtx altivec_expand_builtin (tree, rtx, bool *);
static rtx altivec_expand_ld_builtin (tree, rtx, bool *);
@@ -347,9 +393,20 @@ static int rs6000_get_some_local_dynamic_name_1 (rtx *, void *);
static rtx rs6000_complex_function_value (enum machine_mode);
static rtx rs6000_spe_function_arg (CUMULATIVE_ARGS *,
enum machine_mode, tree);
+static rtx rs6000_mixed_function_arg (CUMULATIVE_ARGS *,
+ enum machine_mode, tree, int);
+static void rs6000_move_block_from_reg(int regno, rtx x, int nregs);
static void setup_incoming_varargs (CUMULATIVE_ARGS *,
enum machine_mode, tree,
int *, int);
+#if TARGET_MACHO
+static void macho_branch_islands (void);
+static void add_compiler_branch_island (tree, tree, int);
+static int no_previous_def (tree function_name);
+static tree get_prev_label (tree function_name);
+#endif
+
+static tree rs6000_build_builtin_va_list (void);
/* Hash table stuff for keeping track of TOC entries. */
@@ -554,6 +611,9 @@ static const char alt_reg_names[][8] =
#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED hook_bool_CUMULATIVE_ARGS_true
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST rs6000_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Override command line options. Mostly we process the processor
@@ -564,138 +624,79 @@ rs6000_override_options (const char *default_cpu)
{
size_t i, j;
struct rs6000_cpu_select *ptr;
+ int set_masks;
+
+ /* Simplifications for entries below. */
- /* Simplify the entries below by making a mask for any POWER
- variant and any PowerPC variant. */
+ enum {
+ POWERPC_BASE_MASK = MASK_POWERPC | MASK_NEW_MNEMONICS,
+ POWERPC_7400_MASK = POWERPC_BASE_MASK | MASK_PPC_GFXOPT | MASK_ALTIVEC
+ };
-#define POWER_MASKS (MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING)
-#define POWERPC_MASKS (MASK_POWERPC | MASK_PPC_GPOPT \
- | MASK_PPC_GFXOPT | MASK_POWERPC64)
-#define POWERPC_OPT_MASKS (MASK_PPC_GPOPT | MASK_PPC_GFXOPT)
+ /* This table occasionally claims that a processor does not support
+ a particular feature even though it does, but the feature is slower
+ than the alternative. Thus, it shouldn't be relied on as a
+ complete description of the processor's support.
+ Please keep this list in order, and don't forget to update the
+ documentation in invoke.texi when adding a new processor or
+ flag. */
static struct ptt
{
const char *const name; /* Canonical processor name. */
const enum processor_type processor; /* Processor type enum value. */
const int target_enable; /* Target flags to enable. */
- const int target_disable; /* Target flags to disable. */
} const processor_target_table[]
- = {{"common", PROCESSOR_COMMON, MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_MASKS},
- {"power", PROCESSOR_POWER,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"power2", PROCESSOR_POWER,
- MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING,
- POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"power3", PROCESSOR_PPC630,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS},
- {"power4", PROCESSOR_POWER4,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS},
- {"powerpc", PROCESSOR_POWERPC,
- MASK_POWERPC | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"powerpc64", PROCESSOR_POWERPC64,
- MASK_POWERPC | MASK_POWERPC64 | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS},
- {"rios", PROCESSOR_RIOS1,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"rios1", PROCESSOR_RIOS1,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"rsc", PROCESSOR_PPC601,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"rsc1", PROCESSOR_PPC601,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"rios2", PROCESSOR_RIOS2,
- MASK_POWER | MASK_MULTIPLE | MASK_STRING | MASK_POWER2,
- POWERPC_MASKS | MASK_NEW_MNEMONICS},
- {"rs64a", PROCESSOR_RS64A,
- MASK_POWERPC | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS},
- {"401", PROCESSOR_PPC403,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
+ = {{"401", PROCESSOR_PPC403, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"403", PROCESSOR_PPC403,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS | MASK_STRICT_ALIGN,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"405", PROCESSOR_PPC405,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"405fp", PROCESSOR_PPC405,
- MASK_POWERPC | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"440", PROCESSOR_PPC440,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"440fp", PROCESSOR_PPC440,
- MASK_POWERPC | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"505", PROCESSOR_MPCCORE,
- MASK_POWERPC | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
+ POWERPC_BASE_MASK | MASK_SOFT_FLOAT | MASK_STRICT_ALIGN},
+ {"405", PROCESSOR_PPC405, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"405fp", PROCESSOR_PPC405, POWERPC_BASE_MASK},
+ {"440", PROCESSOR_PPC440, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"440fp", PROCESSOR_PPC440, POWERPC_BASE_MASK},
+ {"505", PROCESSOR_MPCCORE, POWERPC_BASE_MASK},
{"601", PROCESSOR_PPC601,
- MASK_POWER | MASK_POWERPC | MASK_NEW_MNEMONICS | MASK_MULTIPLE | MASK_STRING,
- MASK_POWER2 | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"602", PROCESSOR_PPC603,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"603", PROCESSOR_PPC603,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"603e", PROCESSOR_PPC603,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"ec603e", PROCESSOR_PPC603,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"604", PROCESSOR_PPC604,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"604e", PROCESSOR_PPC604e,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"620", PROCESSOR_PPC620,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS},
- {"630", PROCESSOR_PPC630,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS},
- {"740", PROCESSOR_PPC750,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"750", PROCESSOR_PPC750,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"7400", PROCESSOR_PPC7400,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"7450", PROCESSOR_PPC7450,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"8540", PROCESSOR_PPC8540,
- MASK_POWERPC | MASK_PPC_GFXOPT | MASK_NEW_MNEMONICS,
- POWER_MASKS | MASK_PPC_GPOPT | MASK_POWERPC64},
- {"801", PROCESSOR_MPCCORE,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"821", PROCESSOR_MPCCORE,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"823", PROCESSOR_MPCCORE,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
- {"860", PROCESSOR_MPCCORE,
- MASK_POWERPC | MASK_SOFT_FLOAT | MASK_NEW_MNEMONICS,
- POWER_MASKS | POWERPC_OPT_MASKS | MASK_POWERPC64},
+ MASK_POWER | POWERPC_BASE_MASK | MASK_MULTIPLE | MASK_STRING},
+ {"602", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"603", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"603e", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"604", PROCESSOR_PPC604, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"604e", PROCESSOR_PPC604e, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"620", PROCESSOR_PPC620, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"630", PROCESSOR_PPC630, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"740", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"7400", PROCESSOR_PPC7400, POWERPC_7400_MASK},
+ {"7450", PROCESSOR_PPC7450, POWERPC_7400_MASK},
+ {"750", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"801", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"821", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"823", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"8540", PROCESSOR_PPC8540, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"860", PROCESSOR_MPCCORE, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
{"970", PROCESSOR_POWER4,
- MASK_POWERPC | POWERPC_OPT_MASKS | MASK_NEW_MNEMONICS,
- POWER_MASKS}};
+ POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
+ {"common", PROCESSOR_COMMON, MASK_NEW_MNEMONICS},
+ {"ec603e", PROCESSOR_PPC603, POWERPC_BASE_MASK | MASK_SOFT_FLOAT},
+ {"G3", PROCESSOR_PPC750, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"G4", PROCESSOR_PPC7450, POWERPC_7400_MASK},
+ {"G5", PROCESSOR_POWER4,
+ POWERPC_7400_MASK | MASK_PPC_GPOPT | MASK_MFCRF | MASK_POWERPC64},
+ {"power", PROCESSOR_POWER, MASK_POWER | MASK_MULTIPLE | MASK_STRING},
+ {"power2", PROCESSOR_POWER,
+ MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING},
+ {"power3", PROCESSOR_PPC630, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"power4", PROCESSOR_POWER4, POWERPC_BASE_MASK | MASK_PPC_GFXOPT},
+ {"powerpc", PROCESSOR_POWERPC, POWERPC_BASE_MASK},
+ {"powerpc64", PROCESSOR_POWERPC64,
+ POWERPC_BASE_MASK | MASK_POWERPC64},
+ {"rios", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING},
+ {"rios1", PROCESSOR_RIOS1, MASK_POWER | MASK_MULTIPLE | MASK_STRING},
+ {"rios2", PROCESSOR_RIOS2,
+ MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING},
+ {"rsc", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING},
+ {"rsc1", PROCESSOR_PPC601, MASK_POWER | MASK_MULTIPLE | MASK_STRING},
+ {"rs64a", PROCESSOR_RS64A, POWERPC_BASE_MASK},
+ };
const size_t ptt_size = ARRAY_SIZE (processor_target_table);
@@ -704,6 +705,28 @@ rs6000_override_options (const char *default_cpu)
/* Save current -mstring/-mno-string status. */
int string = TARGET_STRING;
+ /* Some OSs don't support saving the high part of 64-bit registers on
+ context switch. Other OSs don't support saving Altivec registers.
+ On those OSs, we don't touch the MASK_POWERPC64 or MASK_ALTIVEC
+ settings; if the user wants either, the user must explicitly specify
+ them and we won't interfere with the user's specification. */
+
+ enum {
+ POWER_MASKS = MASK_POWER | MASK_POWER2 | MASK_MULTIPLE | MASK_STRING,
+ POWERPC_MASKS = (POWERPC_BASE_MASK | MASK_PPC_GPOPT
+ | MASK_PPC_GFXOPT | MASK_POWERPC64 | MASK_ALTIVEC
+ | MASK_MFCRF)
+ };
+ set_masks = POWER_MASKS | POWERPC_MASKS | MASK_SOFT_FLOAT;
+#ifdef OS_MISSING_POWERPC64
+ if (OS_MISSING_POWERPC64)
+ set_masks &= ~MASK_POWERPC64;
+#endif
+#ifdef OS_MISSING_ALTIVEC
+ if (OS_MISSING_ALTIVEC)
+ set_masks &= ~MASK_ALTIVEC;
+#endif
+
/* Identify the processor type. */
rs6000_select[0].string = default_cpu;
rs6000_cpu = TARGET_POWERPC64 ? PROCESSOR_DEFAULT64 : PROCESSOR_DEFAULT;
@@ -721,8 +744,9 @@ rs6000_override_options (const char *default_cpu)
if (ptr->set_arch_p)
{
- target_flags |= processor_target_table[j].target_enable;
- target_flags &= ~processor_target_table[j].target_disable;
+ target_flags &= ~set_masks;
+ target_flags |= (processor_target_table[j].target_enable
+ & set_masks);
}
break;
}
@@ -2130,6 +2154,7 @@ reg_or_mem_operand (rtx op, enum machine_mode mode)
{
return (gpc_reg_operand (op, mode)
|| memory_operand (op, mode)
+ || macho_lo_sum_memory_operand (op, mode)
|| volatile_mem_operand (op, mode));
}
@@ -2423,7 +2448,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict)
case DFmode:
case DImode:
- if (TARGET_32BIT)
+ if (mode == DFmode || !TARGET_POWERPC64)
extra = 4;
else if (offset & 3)
return false;
@@ -2431,7 +2456,7 @@ legitimate_offset_address_p (enum machine_mode mode, rtx x, int strict)
case TFmode:
case TImode:
- if (TARGET_32BIT)
+ if (mode == TFmode || !TARGET_POWERPC64)
extra = 12;
else if (offset & 3)
return false;
@@ -2472,6 +2497,25 @@ legitimate_indirect_address_p (rtx x, int strict)
}
static bool
+macho_lo_sum_memory_operand (rtx x, enum machine_mode mode)
+{
+ if (!TARGET_MACHO || !flag_pic
+ || mode != SImode || GET_CODE(x) != MEM)
+ return false;
+ x = XEXP (x, 0);
+
+ if (GET_CODE (x) != LO_SUM)
+ return false;
+ if (GET_CODE (XEXP (x, 0)) != REG)
+ return false;
+ if (!INT_REG_OK_FOR_BASE_P (XEXP (x, 0), 0))
+ return false;
+ x = XEXP (x, 1);
+
+ return CONSTANT_P (x);
+}
+
+static bool
legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict)
{
if (GET_CODE (x) != LO_SUM)
@@ -2482,7 +2526,7 @@ legitimate_lo_sum_address_p (enum machine_mode mode, rtx x, int strict)
return false;
x = XEXP (x, 1);
- if (TARGET_ELF)
+ if (TARGET_ELF || TARGET_MACHO)
{
if (DEFAULT_ABI != ABI_AIX && flag_pic)
return false;
@@ -2606,8 +2650,8 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
|| ((TARGET_HARD_FLOAT && TARGET_FPRS) && mode == DFmode)))
{
rtx reg = gen_reg_rtx (Pmode);
- emit_insn (gen_elf_high (reg, (x)));
- return gen_rtx_LO_SUM (Pmode, reg, (x));
+ emit_insn (gen_elf_high (reg, x));
+ return gen_rtx_LO_SUM (Pmode, reg, x);
}
else if (TARGET_MACHO && TARGET_32BIT && TARGET_NO_TOC
&& ! flag_pic
@@ -2622,8 +2666,8 @@ rs6000_legitimize_address (rtx x, rtx oldx ATTRIBUTE_UNUSED,
&& mode != TImode)
{
rtx reg = gen_reg_rtx (Pmode);
- emit_insn (gen_macho_high (reg, (x)));
- return gen_rtx_LO_SUM (Pmode, reg, (x));
+ emit_insn (gen_macho_high (reg, x));
+ return gen_rtx_LO_SUM (Pmode, reg, x);
}
else if (TARGET_TOC
&& constant_pool_expr_p (x)
@@ -2863,6 +2907,9 @@ rs6000_tls_symbol_ref (rtx x, enum machine_mode mode ATTRIBUTE_UNUSED)
bool
rs6000_tls_referenced_p (rtx x)
{
+ if (! TARGET_HAVE_TLS)
+ return false;
+
return for_each_rtx (&x, &rs6000_tls_symbol_ref_1, 0);
}
@@ -3207,7 +3254,7 @@ rs6000_emit_set_long_const (rtx dest, HOST_WIDE_INT c1, HOST_WIDE_INT c2)
|| (ud4 == 0 && ud3 == 0 && ud2 == 0 && ! (ud1 & 0x8000)))
{
if (ud1 & 0x8000)
- emit_move_insn (dest, GEN_INT (((ud1 ^ 0x8000) - 0x8000)));
+ emit_move_insn (dest, GEN_INT (((ud1 ^ 0x8000) - 0x8000)));
else
emit_move_insn (dest, GEN_INT (ud1));
}
@@ -3368,7 +3415,26 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
/* Handle the case of CONSTANT_P_RTX. */
if (GET_CODE (operands[1]) == CONSTANT_P_RTX)
goto emit_set;
-
+
+ /* 128-bit constant floating-point values on Darwin should really be
+ loaded as two parts. */
+ if ((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128
+ && mode == TFmode && GET_CODE (operands[1]) == CONST_DOUBLE)
+ {
+ /* DImode is used, not DFmode, because simplify_gen_subreg doesn't
+ know how to get a DFmode SUBREG of a TFmode. */
+ rs6000_emit_move (simplify_gen_subreg (DImode, operands[0], mode, 0),
+ simplify_gen_subreg (DImode, operands[1], mode, 0),
+ DImode);
+ rs6000_emit_move (simplify_gen_subreg (DImode, operands[0], mode,
+ GET_MODE_SIZE (DImode)),
+ simplify_gen_subreg (DImode, operands[1], mode,
+ GET_MODE_SIZE (DImode)),
+ DImode);
+ return;
+ }
+
/* FIXME: In the long term, this switch statement should go away
and be replaced by a sequence of tests based on things like
mode == Pmode. */
@@ -3603,6 +3669,19 @@ rs6000_emit_move (rtx dest, rtx source, enum machine_mode mode)
emit_insn (gen_rtx_SET (VOIDmode, operands[0], operands[1]));
}
+/* Nonzero if we can use a floating-point register to pass this arg. */
+#define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \
+ (GET_MODE_CLASS (MODE) == MODE_FLOAT \
+ && (CUM)->fregno <= FP_ARG_MAX_REG \
+ && TARGET_HARD_FLOAT && TARGET_FPRS)
+
+/* Nonzero if we can use an AltiVec register to pass this arg. */
+#define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE,NAMED) \
+ (ALTIVEC_VECTOR_MODE (MODE) \
+ && (CUM)->vregno <= ALTIVEC_ARG_MAX_REG \
+ && TARGET_ALTIVEC_ABI \
+ && (NAMED))
+
/* Return a nonzero value to say to return the function value in
memory, just as large structures are always returned. TYPE will be
the data type of the value, and FNTYPE will be the type of the
@@ -3787,23 +3866,35 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode))
{
- if (named && cum->vregno <= ALTIVEC_ARG_MAX_REG)
+ if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named))
cum->vregno++;
- else
+
+ /* In variable-argument functions, vector arguments get GPRs allocated
+ even if they are going to be passed in a vector register. */
+ if (cum->stdarg && DEFAULT_ABI != ABI_V4)
{
int align;
- /* Vector parameters must be 16-byte aligned. This places them at
- 2 mod 4 in terms of words (on both ABIs). */
- align = ((6 - (cum->words & 3)) & 3);
+ /* Vector parameters must be 16-byte aligned. This places
+ them at 2 mod 4 in terms of words in 32-bit mode, since
+ the parameter save area starts at offset 24 from the
+ stack. In 64-bit mode, they just have to start on an
+ even word, since the parameter save area is 16-byte
+ aligned. Space for GPRs is reserved even if the argument
+ will be passed in memory. */
+ if (TARGET_32BIT)
+ align = ((6 - (cum->words & 3)) & 3);
+ else
+ align = cum->words & 1;
cum->words += align + RS6000_ARG_SIZE (mode, type);
-
+
if (TARGET_DEBUG_ARG)
{
fprintf (stderr, "function_adv: words = %2d, align=%d, ",
cum->words, align);
fprintf (stderr, "nargs = %4d, proto = %d, mode = %4s\n",
- cum->nargs_prototype, cum->prototype, GET_MODE_NAME (mode));
+ cum->nargs_prototype, cum->prototype,
+ GET_MODE_NAME (mode));
}
}
}
@@ -3890,6 +3981,7 @@ function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
}
/* Determine where to put a SIMD argument on the SPE. */
+
static rtx
rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
tree type)
@@ -3915,17 +4007,121 @@ rs6000_spe_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return gen_rtx_PARALLEL (mode, gen_rtvec (2, r1, r2));
}
else
- return NULL;
+ return NULL_RTX;
}
else
{
if (cum->sysv_gregno <= GP_ARG_MAX_REG)
return gen_rtx_REG (mode, cum->sysv_gregno);
else
- return NULL;
+ return NULL_RTX;
}
}
+/* Determine where to place an argument in 64-bit mode with 32-bit ABI. */
+
+static rtx
+rs6000_mixed_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
+ tree type, int align_words)
+{
+ if (mode == DFmode)
+ {
+ /* -mpowerpc64 with 32bit ABI splits up a DFmode argument
+ in vararg list into zero, one or two GPRs */
+ if (align_words >= GP_ARG_NUM_REG)
+ return gen_rtx_PARALLEL (DFmode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ NULL_RTX, const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode,
+ cum->fregno),
+ const0_rtx)));
+ else if (align_words + RS6000_ARG_SIZE (mode, type)
+ > GP_ARG_NUM_REG)
+ /* If this is partially on the stack, then we only
+ include the portion actually in registers here. */
+ return gen_rtx_PARALLEL (DFmode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words),
+ const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode,
+ cum->fregno),
+ const0_rtx)));
+
+ /* split a DFmode arg into two GPRs */
+ return gen_rtx_PARALLEL (DFmode,
+ gen_rtvec (3,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words),
+ const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words + 1),
+ GEN_INT (4)),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (mode, cum->fregno),
+ const0_rtx)));
+ }
+ /* -mpowerpc64 with 32bit ABI splits up a DImode argument into one
+ or two GPRs */
+ else if (mode == DImode)
+ {
+ if (align_words < GP_ARG_NUM_REG - 1)
+ return gen_rtx_PARALLEL (DImode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words),
+ const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words + 1),
+ GEN_INT (4))));
+ else if (align_words == GP_ARG_NUM_REG - 1)
+ return gen_rtx_PARALLEL (DImode,
+ gen_rtvec (2,
+ gen_rtx_EXPR_LIST (VOIDmode,
+ NULL_RTX, const0_rtx),
+ gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words),
+ const0_rtx)));
+ }
+ else if (mode == BLKmode && align_words <= (GP_ARG_NUM_REG - 1))
+ {
+ int k;
+ int size = int_size_in_bytes (type);
+ int no_units = ((size - 1) / 4) + 1;
+ int max_no_words = GP_ARG_NUM_REG - align_words;
+ int rtlvec_len = no_units < max_no_words ? no_units : max_no_words;
+ rtx *rtlvec = (rtx *) alloca (rtlvec_len * sizeof (rtx));
+
+ memset ((char *) rtlvec, 0, rtlvec_len * sizeof (rtx));
+
+ for (k=0; k < rtlvec_len; k++)
+ rtlvec[k] = gen_rtx_EXPR_LIST (VOIDmode,
+ gen_rtx_REG (SImode,
+ GP_ARG_MIN_REG
+ + align_words + k),
+ k == 0 ? const0_rtx : GEN_INT (k*4));
+
+ return gen_rtx_PARALLEL (BLKmode, gen_rtvec_v (k, rtlvec));
+ }
+
+ return NULL_RTX;
+}
+
/* 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.
@@ -3979,40 +4175,43 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
return GEN_INT (cum->call_cookie);
}
- if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode))
+ if (USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named))
+ return gen_rtx_REG (mode, cum->vregno);
+ else if (TARGET_ALTIVEC_ABI && ALTIVEC_VECTOR_MODE (mode))
{
- if (named && cum->vregno <= ALTIVEC_ARG_MAX_REG)
- return gen_rtx_REG (mode, cum->vregno);
- else if (named || abi == ABI_V4)
+ if (named || abi == ABI_V4)
return NULL_RTX;
else
{
/* Vector parameters to varargs functions under AIX or Darwin
get passed in memory and possibly also in GPRs. */
int align, align_words;
- rtx reg;
+ enum machine_mode part_mode = mode;
/* Vector parameters must be 16-byte aligned. This places them at
- 2 mod 4 in terms of words. */
- align = ((6 - (cum->words & 3)) & 3);
+ 2 mod 4 in terms of words in 32-bit mode, since the parameter
+ save area starts at offset 24 from the stack. In 64-bit mode,
+ they just have to start on an even word, since the parameter
+ save area is 16-byte aligned. */
+ if (TARGET_32BIT)
+ align = ((6 - (cum->words & 3)) & 3);
+ else
+ align = cum->words & 1;
align_words = cum->words + align;
/* Out of registers? Memory, then. */
if (align_words >= GP_ARG_NUM_REG)
return NULL_RTX;
- /* The vector value goes in both memory and GPRs. Varargs
- vector regs will always be saved in R5-R8 or R9-R12. */
- reg = gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words);
-
- return gen_rtx_PARALLEL (mode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- NULL_RTX,
- const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- reg,
- const0_rtx)));
+ /* The vector value goes in GPRs. Only the part of the
+ value in GPRs is reported here. */
+ if (align_words + CLASS_MAX_NREGS (mode, GENERAL_REGS)
+ > GP_ARG_NUM_REG)
+ /* Fortunately, there are only two possibilities, the value
+ is either wholly in GPRs or half in GPRs and half not. */
+ part_mode = DImode;
+
+ return gen_rtx_REG (part_mode, GP_ARG_MIN_REG + align_words);
}
}
else if (TARGET_SPE_ABI && TARGET_SPE && SPE_VECTOR_MODE (mode))
@@ -4025,7 +4224,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (cum->fregno <= FP_ARG_V4_MAX_REG)
return gen_rtx_REG (mode, cum->fregno);
else
- return NULL;
+ return NULL_RTX;
}
else
{
@@ -4047,7 +4246,7 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (gregno + n_words - 1 <= GP_ARG_MAX_REG)
return gen_rtx_REG (mode, gregno);
else
- return NULL;
+ return NULL_RTX;
}
}
else
@@ -4059,7 +4258,11 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
if (type && TREE_CODE (TYPE_SIZE (type)) != INTEGER_CST)
return NULL_RTX;
- if (USE_FP_FOR_ARG_P (*cum, mode, type))
+ if (TARGET_32BIT && TARGET_POWERPC64
+ && (mode == DFmode || mode == DImode || mode == BLKmode))
+ return rs6000_mixed_function_arg (cum, mode, type, align_words);
+
+ if (USE_FP_FOR_ARG_P (cum, mode, type))
{
if (! type
|| ((cum->nargs_prototype > 0)
@@ -4071,53 +4274,6 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
|| (align_words < GP_ARG_NUM_REG))))
return gen_rtx_REG (mode, cum->fregno);
- if (TARGET_32BIT && TARGET_POWERPC64 && mode == DFmode)
- {
- /* -mpowerpc64 with 32bit ABI splits up a DFmode argument
- in vararg list into zero, one or two GPRs */
- if (align_words >= GP_ARG_NUM_REG)
- return gen_rtx_PARALLEL (DFmode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- NULL_RTX, const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (mode,
- cum->fregno),
- const0_rtx)));
- else if (align_words + RS6000_ARG_SIZE (mode, type)
- > GP_ARG_NUM_REG)
- /* If this is partially on the stack, then we only
- include the portion actually in registers here. */
- return gen_rtx_PARALLEL (DFmode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words),
- const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (mode,
- cum->fregno),
- const0_rtx)));
-
- /* split a DFmode arg into two GPRs */
- return gen_rtx_PARALLEL (DFmode,
- gen_rtvec (3,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words),
- const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words + 1),
- GEN_INT (4)),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (mode, cum->fregno),
- const0_rtx)));
- }
-
return gen_rtx_PARALLEL (mode,
gen_rtvec (2,
gen_rtx_EXPR_LIST (VOIDmode,
@@ -4138,37 +4294,6 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
gen_rtx_REG (mode, cum->fregno),
const0_rtx)));
}
- /* -mpowerpc64 with 32bit ABI splits up a DImode argument into one
- or two GPRs */
- else if (TARGET_32BIT && TARGET_POWERPC64 && mode == DImode
- && align_words < GP_ARG_NUM_REG - 1)
- {
- return gen_rtx_PARALLEL (DImode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words),
- const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words + 1),
- GEN_INT (4))));
- }
- else if (TARGET_32BIT && TARGET_POWERPC64 && mode == DImode
- && align_words == GP_ARG_NUM_REG - 1)
- {
- return gen_rtx_PARALLEL (DImode,
- gen_rtvec (2,
- gen_rtx_EXPR_LIST (VOIDmode,
- NULL_RTX, const0_rtx),
- gen_rtx_EXPR_LIST (VOIDmode,
- gen_rtx_REG (SImode,
- GP_ARG_MIN_REG
- + align_words),
- const0_rtx)));
- }
else if (align_words < GP_ARG_NUM_REG)
return gen_rtx_REG (mode, GP_ARG_MIN_REG + align_words);
else
@@ -4182,13 +4307,13 @@ function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode,
int
function_arg_partial_nregs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
- tree type, int named ATTRIBUTE_UNUSED)
+ tree type, int named)
{
if (DEFAULT_ABI == ABI_V4)
return 0;
- if (USE_FP_FOR_ARG_P (*cum, mode, type)
- || USE_ALTIVEC_FOR_ARG_P (*cum, mode, type))
+ if (USE_FP_FOR_ARG_P (cum, mode, type)
+ || USE_ALTIVEC_FOR_ARG_P (cum, mode, type, named))
{
if (cum->nargs_prototype >= 0)
return 0;
@@ -4234,6 +4359,37 @@ function_arg_pass_by_reference (CUMULATIVE_ARGS *cum ATTRIBUTE_UNUSED,
}
return type && int_size_in_bytes (type) < 0;
}
+
+static void
+rs6000_move_block_from_reg(int regno, rtx x, int nregs)
+{
+ int i;
+ enum machine_mode reg_mode = TARGET_32BIT ? SImode : DImode;
+
+ if (nregs == 0)
+ return;
+
+ for (i = 0; i < nregs; i++)
+ {
+ rtx tem = adjust_address_nv (x, reg_mode, i*GET_MODE_SIZE(reg_mode));
+ if (reload_completed)
+ {
+ if (! strict_memory_address_p (reg_mode, XEXP (tem, 0)))
+ tem = NULL_RTX;
+ else
+ tem = simplify_gen_subreg (reg_mode, x, BLKmode,
+ i * GET_MODE_SIZE(reg_mode));
+ }
+ else
+ tem = replace_equiv_address (tem, XEXP (tem, 0));
+
+ if (tem == NULL_RTX)
+ abort ();
+
+ emit_move_insn (tem, gen_rtx_REG (reg_mode, regno + i));
+ }
+}
+
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments.
@@ -4257,19 +4413,10 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
int reg_size = TARGET_32BIT ? 4 : 8;
rtx save_area = NULL_RTX, mem;
int first_reg_offset, set;
- 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));
- /* For varargs, we do not want to skip the dummy va_dcl argument.
- For stdargs, we do want to skip the last named argument. */
+ /* Skip the last named argument. */
next_cum = *cum;
- if (stdarg_p)
- function_arg_advance (&next_cum, mode, type, 1);
+ function_arg_advance (&next_cum, mode, type, 1);
if (DEFAULT_ABI == ABI_V4)
{
@@ -4300,8 +4447,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
set_mem_alias_set (mem, set);
set_mem_align (mem, BITS_PER_WORD);
- move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem,
- GP_ARG_NUM_REG - first_reg_offset);
+ rs6000_move_block_from_reg (GP_ARG_MIN_REG + first_reg_offset, mem,
+ GP_ARG_NUM_REG - first_reg_offset);
}
/* Save FP registers if needed. */
@@ -4338,8 +4485,8 @@ setup_incoming_varargs (CUMULATIVE_ARGS *cum, enum machine_mode mode,
/* Create the va_list data type. */
-tree
-rs6000_build_va_list (void)
+static tree
+rs6000_build_builtin_va_list (void)
{
tree f_gpr, f_fpr, f_res, f_ovf, f_sav, record, type_decl;
@@ -5335,10 +5482,7 @@ altivec_expand_predicate_builtin (enum insn_code icode, const char *opcode,
}
static rtx
-altivec_expand_lv_builtin (icode, arglist, target)
- enum insn_code icode;
- tree arglist;
- rtx target;
+altivec_expand_lv_builtin (enum insn_code icode, tree arglist, rtx target)
{
rtx pat, addr;
tree arg0 = TREE_VALUE (arglist);
@@ -8135,7 +8279,8 @@ addrs_ok_for_quad_peep (rtx addr1, rtx addr2)
enum reg_class
secondary_reload_class (enum reg_class class,
- enum machine_mode mode ATTRIBUTE_UNUSED, rtx in)
+ enum machine_mode mode ATTRIBUTE_UNUSED,
+ rtx in)
{
int regno;
@@ -9840,73 +9985,72 @@ rs6000_emit_minmax (rtx dest, enum rtx_code code, rtx op0, rtx op1)
emit_move_insn (dest, target);
}
-/* Called by splitter for multireg moves.
- Input:
- operands[0] : Destination of move
- operands[1] : Source of move
+/* Emit instructions to move SRC to DST. Called by splitters for
+ multi-register moves. It will emit at most one instruction for
+ each register that is accessed; that is, it won't emit li/lis pairs
+ (or equivalent for 64-bit code). One of SRC or DST must be a hard
+ register. */
- Output:
- operands[2-n] : Destination slots
- operands[n-m] : Source slots
- where n = 2 + HARD_REGNO_NREGS (reg, GET_MODE (operands[0]))
- m = 2 + 2 * HARD_REGNO_NREGS (reg, GET_MODE (operands[0])) - 1
-
- Splits the move of operands[1] to operands[0].
- This is done, if GPRs are one of the operands. In this case
- a sequence of simple move insns has to be issued. The sequence of these
- move insns has to be done in correct order to avoid early clobber of the
- base register or destructive overlap of registers.
-*/
-
void
-rs6000_split_multireg_move (rtx *operands)
+rs6000_split_multireg_move (rtx dst, rtx src)
{
- int nregs, reg, i, j, used_update = 0;
- enum machine_mode mode;
- rtx dst = operands[0];
- rtx src = operands[1];
- rtx insn = 0;
-
- /* Calculate number to move (2/4 for 32/64 bit mode). */
-
- reg = REG_P (operands[0]) ? REGNO (operands[0]) : REGNO (operands[1]);
- mode = GET_MODE (operands[0]);
- nregs = HARD_REGNO_NREGS (reg, mode);
+ /* The register number of the first register being moved. */
+ int reg;
+ /* The mode that is to be moved. */
+ enum machine_mode mode;
+ /* The mode that the move is being done in, and its size. */
+ enum machine_mode reg_mode;
+ int reg_mode_size;
+ /* The number of registers that will be moved. */
+ int nregs;
+
+ reg = REG_P (dst) ? REGNO (dst) : REGNO (src);
+ mode = GET_MODE (dst);
+ nregs = HARD_REGNO_NREGS (reg, mode);
+ if (FP_REGNO_P (reg))
+ reg_mode = DFmode;
+ else if (ALTIVEC_REGNO_P (reg))
+ reg_mode = V16QImode;
+ else
+ reg_mode = word_mode;
+ reg_mode_size = GET_MODE_SIZE (reg_mode);
- if (REG_P (operands[1])
- && REG_P (operands[0])
- && (REGNO (operands[1]) < REGNO (operands[0])))
- {
- /* Move register range backwards, if we have destructive overlap. */
-
- j = nregs;
- for (i = 0; i < nregs; i++)
- {
- j--;
- operands[i+2] = operand_subword (operands[0], j, 0, mode);
- operands[i+2+nregs] =
- operand_subword (operands[1], j, 0, mode);
- }
- }
+ if (reg_mode_size * nregs != GET_MODE_SIZE (mode))
+ abort ();
+
+ if (REG_P (src) && REG_P (dst) && (REGNO (src) < REGNO (dst)))
+ {
+ /* Move register range backwards, if we might have destructive
+ overlap. */
+ int i;
+ for (i = nregs - 1; i >= 0; i--)
+ emit_insn (gen_rtx_SET (VOIDmode,
+ simplify_gen_subreg (reg_mode, dst, mode,
+ i * reg_mode_size),
+ simplify_gen_subreg (reg_mode, src, mode,
+ i * reg_mode_size)));
+ }
else
{
- j = -1;
+ int i;
+ int j = -1;
+ bool used_update = false;
- if (GET_CODE (operands[1]) == MEM)
+ if (GET_CODE (src) == MEM && INT_REGNO_P (reg))
{
rtx breg;
- if (GET_CODE (XEXP (operands[1], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[1], 0)) == PRE_DEC)
+ if (GET_CODE (XEXP (src, 0)) == PRE_INC
+ || GET_CODE (XEXP (src, 0)) == PRE_DEC)
{
rtx delta_rtx;
- breg = XEXP (XEXP (operands[1], 0), 0);
- delta_rtx = GET_CODE (XEXP (operands[1], 0)) == PRE_INC
- ? GEN_INT (GET_MODE_SIZE (GET_MODE (operands[1])))
- : GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[1])));
- insn = emit_insn (TARGET_32BIT
- ? gen_addsi3 (breg, breg, delta_rtx)
- : gen_adddi3 (breg, breg, delta_rtx));
+ breg = XEXP (XEXP (src, 0), 0);
+ delta_rtx = GET_CODE (XEXP (src, 0)) == PRE_INC
+ ? GEN_INT (GET_MODE_SIZE (GET_MODE (src)))
+ : GEN_INT (-GET_MODE_SIZE (GET_MODE (src)));
+ emit_insn (TARGET_32BIT
+ ? gen_addsi3 (breg, breg, delta_rtx)
+ : gen_adddi3 (breg, breg, delta_rtx));
src = gen_rtx_MEM (mode, breg);
}
@@ -9926,35 +10070,34 @@ rs6000_split_multireg_move (rtx *operands)
j = REGNO (breg) - REGNO (dst);
}
- if (GET_CODE (operands[0]) == MEM)
+ if (GET_CODE (dst) == MEM && INT_REGNO_P (reg))
{
rtx breg;
- if (GET_CODE (XEXP (operands[0], 0)) == PRE_INC
- || GET_CODE (XEXP (operands[0], 0)) == PRE_DEC)
+ if (GET_CODE (XEXP (dst, 0)) == PRE_INC
+ || GET_CODE (XEXP (dst, 0)) == PRE_DEC)
{
rtx delta_rtx;
- breg = XEXP (XEXP (operands[0], 0), 0);
- delta_rtx = GET_CODE (XEXP (operands[0], 0)) == PRE_INC
- ? GEN_INT (GET_MODE_SIZE (GET_MODE (operands[0])))
- : GEN_INT (-GET_MODE_SIZE (GET_MODE (operands[0])));
+ breg = XEXP (XEXP (dst, 0), 0);
+ delta_rtx = GET_CODE (XEXP (dst, 0)) == PRE_INC
+ ? GEN_INT (GET_MODE_SIZE (GET_MODE (dst)))
+ : GEN_INT (-GET_MODE_SIZE (GET_MODE (dst)));
/* We have to update the breg before doing the store.
Use store with update, if available. */
if (TARGET_UPDATE)
{
- insn = emit_insn (TARGET_32BIT
- ? gen_movsi_update (breg, breg, delta_rtx,
- operand_subword (src, 0, 0, mode))
- : gen_movdi_update (breg, breg, delta_rtx,
- operand_subword (src, 0, 0, mode)));
- used_update = 1;
+ rtx nsrc = simplify_gen_subreg (reg_mode, src, mode, 0);
+ emit_insn (TARGET_32BIT
+ ? gen_movsi_update (breg, breg, delta_rtx, nsrc)
+ : gen_movdi_update (breg, breg, delta_rtx, nsrc));
+ used_update = true;
}
else
- insn = emit_insn (TARGET_32BIT
- ? gen_addsi3 (breg, breg, delta_rtx)
- : gen_adddi3 (breg, breg, delta_rtx));
+ emit_insn (TARGET_32BIT
+ ? gen_addsi3 (breg, breg, delta_rtx)
+ : gen_adddi3 (breg, breg, delta_rtx));
dst = gen_rtx_MEM (mode, breg);
}
}
@@ -9966,15 +10109,16 @@ rs6000_split_multireg_move (rtx *operands)
if (j == nregs)
j = 0;
- operands[i+2] = operand_subword (dst, j, 0, mode);
- operands[i+2+nregs] = operand_subword (src, j, 0, mode);
-
+ /* If compiler already emited move of first word by
+ store with update, no need to do anything. */
if (j == 0 && used_update)
- {
- /* Already emited move of first word by
- store with update -> emit dead insn instead (r := r). */
- operands[i+2] = operands[i+2+nregs];
- }
+ continue;
+
+ emit_insn (gen_rtx_SET (VOIDmode,
+ simplify_gen_subreg (reg_mode, dst, mode,
+ j * reg_mode_size),
+ simplify_gen_subreg (reg_mode, src, mode,
+ j * reg_mode_size)));
}
}
}
@@ -10066,7 +10210,7 @@ compute_vrsave_mask (void)
them in again. More importantly, the mask we compute here is
used to generate CLOBBERs in the set_vrsave insn, and we do not
wish the argument registers to die. */
- for (i = cfun->args_info.vregno; i >= ALTIVEC_ARG_MIN_REG; --i)
+ for (i = cfun->args_info.vregno - 1; i >= ALTIVEC_ARG_MIN_REG; --i)
mask &= ~ALTIVEC_REG_BIT (i);
/* Similarly, remove the return value from the set. */
@@ -10186,14 +10330,14 @@ is_altivec_return_reg (rtx reg, void *xyes)
#define ABI_STACK_BOUNDARY STACK_BOUNDARY
#endif
-rs6000_stack_t *
+static rs6000_stack_t *
rs6000_stack_info (void)
{
static rs6000_stack_t info, zero_info;
rs6000_stack_t *info_ptr = &info;
int reg_size = TARGET_POWERPC64 ? 8 : 4;
int ehrd_size;
- int total_raw_size;
+ HOST_WIDE_INT total_raw_size;
/* Zero all fields portably. */
info = zero_info;
@@ -10525,7 +10669,7 @@ spe_func_has_64bit_regs_p (void)
return false;
}
-void
+static void
debug_stack_info (rs6000_stack_t *info)
{
const char *abi_string;
@@ -10614,13 +10758,15 @@ debug_stack_info (rs6000_stack_t *info)
fprintf (stderr, "\tvarargs_save_offset = %5d\n", info->varargs_save_offset);
if (info->total_size)
- fprintf (stderr, "\ttotal_size = %5d\n", info->total_size);
+ fprintf (stderr, "\ttotal_size = "HOST_WIDE_INT_PRINT_DEC"\n",
+ info->total_size);
if (info->varargs_size)
fprintf (stderr, "\tvarargs_size = %5d\n", info->varargs_size);
if (info->vars_size)
- fprintf (stderr, "\tvars_size = %5d\n", info->vars_size);
+ fprintf (stderr, "\tvars_size = "HOST_WIDE_INT_PRINT_DEC"\n",
+ info->vars_size);
if (info->parm_size)
fprintf (stderr, "\tparm_size = %5d\n", info->parm_size);
@@ -10736,11 +10882,7 @@ rs6000_ra_ever_killed (void)
rtx reg;
rtx insn;
- /* Irritatingly, there are two kinds of thunks -- those created with
- TARGET_ASM_OUTPUT_MI_THUNK and those with DECL_THUNK_P that go
- through the regular part of the compiler. This is a very hacky
- way to tell them apart. */
- if (current_function_is_thunk && !no_new_pseudos)
+ if (current_function_is_thunk)
return 0;
/* regs_ever_live has LR marked as used if any sibcalls are present,
@@ -10893,6 +11035,42 @@ rs6000_emit_load_toc_table (int fromprolog)
abort ();
}
+/* Emit instructions to restore the link register after determining where
+ its value has been stored. */
+
+void
+rs6000_emit_eh_reg_restore (rtx source, rtx scratch)
+{
+ rs6000_stack_t *info = rs6000_stack_info ();
+ rtx operands[2];
+
+ operands[0] = source;
+ operands[1] = scratch;
+
+ if (info->lr_save_p)
+ {
+ rtx frame_rtx = stack_pointer_rtx;
+ HOST_WIDE_INT sp_offset = 0;
+ rtx tmp;
+
+ 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;
+
+ 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]);
+}
+
int
get_TOC_alias_set (void)
{
@@ -10908,7 +11086,7 @@ get_TOC_alias_set (void)
load_toc_* patterns. */
int
-uses_TOC ()
+uses_TOC (void)
{
rtx insn;
@@ -11291,7 +11469,7 @@ generate_set_vrsave (rtx reg, rs6000_stack_t *info, int epiloguep)
static void
emit_frame_save (rtx frame_reg, rtx frame_ptr, enum machine_mode mode,
- unsigned int regno, int offset, int total_size)
+ unsigned int regno, int offset, HOST_WIDE_INT total_size)
{
rtx reg, offset_rtx, insn, mem, addr, int_rtx;
rtx replacea, replaceb;
@@ -11361,7 +11539,7 @@ rs6000_emit_prologue (void)
rtx sp_reg_rtx = gen_rtx_REG (Pmode, STACK_POINTER_REGNUM);
rtx frame_ptr_rtx = gen_rtx_REG (Pmode, 12);
rtx frame_reg_rtx = sp_reg_rtx;
- rtx cr_save_rtx = NULL;
+ rtx cr_save_rtx = NULL_RTX;
rtx insn;
int saving_FPRs_inline;
int using_store_multiple;
@@ -12234,7 +12412,8 @@ rs6000_output_function_epilogue (FILE *file,
}
}
-#if TARGET_OBJECT_FORMAT == OBJECT_MACHO
+#if TARGET_MACHO
+ macho_branch_islands ();
/* Mach-O doesn't support labels at the end of objects, so if
it looks like we might want one, insert a NOP. */
{
@@ -12313,8 +12492,7 @@ rs6000_output_function_epilogue (FILE *file,
official way to get this info, so we use language_string. C
is 0. C++ is 9. No number defined for Obj-C, so use the
value for C for now. There is no official value for Java,
- although IBM appears to be using 13. There is no official value
- for Chill, so we've chosen 44 pseudo-randomly. */
+ although IBM appears to be using 13. */
if (! strcmp (language_string, "GNU C")
|| ! strcmp (language_string, "GNU Objective-C"))
i = 0;
@@ -12328,8 +12506,6 @@ rs6000_output_function_epilogue (FILE *file,
i = 9;
else if (! strcmp (language_string, "GNU Java"))
i = 13;
- else if (! strcmp (language_string, "GNU CHILL"))
- i = 44;
else
abort ();
fprintf (file, "%d,", i);
@@ -13418,7 +13594,7 @@ rs6000_adjust_cost (rtx insn, rtx link, rtx dep_insn ATTRIBUTE_UNUSED,
}
/* The function returns a true if INSN is microcoded.
- Return false ptherwise. */
+ Return false otherwise. */
static bool
is_microcoded_insn (rtx insn)
@@ -13442,7 +13618,7 @@ is_microcoded_insn (rtx insn)
return false;
}
-/* The function returns a non-zero value if INSN can be scheduled only
+/* The function returns a nonzero value if INSN can be scheduled only
as the first insn in a dispatch group ("dispatch-slot restricted").
In this case, the returned value indicates how many dispatch slots
the insn occupies (at the beginning of the group).
@@ -13805,7 +13981,7 @@ get_next_active_insn (rtx insn, rtx tail)
return next_insn;
}
-/* Return whether the presence of INSN causes a dispatch group terminatation
+/* Return whether the presence of INSN causes a dispatch group termination
of group WHICH_GROUP.
If WHICH_GROUP == current_group, this function will return true if INSN
@@ -13847,7 +14023,7 @@ insn_terminates_group_p (rtx insn, enum group_termination which_group)
return false;
}
-/* Return true if it is recommended to keep NEXT_INSN "far" (in a seperate
+/* Return true if it is recommended to keep NEXT_INSN "far" (in a separate
dispatch group) from the insns in GROUP_INSNS. Return false otherwise. */
static bool
@@ -13885,7 +14061,7 @@ is_costly_group (rtx *group_insns, rtx next_insn)
one of the following schemes, depending on the value of the flag
-minsert_sched_nops = X:
(1) X == sched_finish_regroup_exact: insert exactly as many nops as needed
- in order to force NEXT_INSN into a seperate group.
+ in order to force NEXT_INSN into a separate group.
(2) X < sched_finish_regroup_exact: insert exactly X nops.
GROUP_END, CAN_ISSUE_MORE and GROUP_COUNT record the state after nop
insertion (has a group just ended, how many vacant issue slots remain in the
@@ -14167,9 +14343,7 @@ pad_groups (FILE *dump, int sched_verbose, rtx prev_head_insn, rtx tail)
After reload, it inserts nops at insn group bundling. */
static void
-rs6000_sched_finish (dump, sched_verbose)
- FILE *dump;
- int sched_verbose;
+rs6000_sched_finish (FILE *dump, int sched_verbose)
{
int n_groups;
@@ -14523,83 +14697,118 @@ symbolic_operand (rtx op)
}
#endif
-#ifdef RS6000_LONG_BRANCH
+#if TARGET_MACHO
-static tree stub_list = 0;
+static tree branch_island_list = 0;
-/* ADD_COMPILER_STUB adds the compiler generated stub for handling
- procedure calls to the linked list. */
+/* Remember to generate a branch island for far calls to the given
+ function. */
-void
-add_compiler_stub (tree label_name, tree function_name, int line_number)
+static void
+add_compiler_branch_island (tree label_name, tree function_name, int line_number)
{
- tree stub = build_tree_list (function_name, label_name);
- TREE_TYPE (stub) = build_int_2 (line_number, 0);
- TREE_CHAIN (stub) = stub_list;
- stub_list = stub;
+ tree branch_island = build_tree_list (function_name, label_name);
+ TREE_TYPE (branch_island) = build_int_2 (line_number, 0);
+ TREE_CHAIN (branch_island) = branch_island_list;
+ branch_island_list = branch_island;
}
-#define STUB_LABEL_NAME(STUB) TREE_VALUE (STUB)
-#define STUB_FUNCTION_NAME(STUB) TREE_PURPOSE (STUB)
-#define STUB_LINE_NUMBER(STUB) TREE_INT_CST_LOW (TREE_TYPE (STUB))
-
-/* OUTPUT_COMPILER_STUB outputs the compiler generated stub for
- handling procedure calls from the linked list and initializes the
- linked list. */
-
-void
-output_compiler_stub (void)
-{
- char tmp_buf[256];
- char label_buf[256];
- tree stub;
+#define BRANCH_ISLAND_LABEL_NAME(BRANCH_ISLAND) TREE_VALUE (BRANCH_ISLAND)
+#define BRANCH_ISLAND_FUNCTION_NAME(BRANCH_ISLAND) TREE_PURPOSE (BRANCH_ISLAND)
+#define BRANCH_ISLAND_LINE_NUMBER(BRANCH_ISLAND) \
+ TREE_INT_CST_LOW (TREE_TYPE (BRANCH_ISLAND))
- if (!flag_pic)
- for (stub = stub_list; stub; stub = TREE_CHAIN (stub))
- {
- fprintf (asm_out_file,
- "%s:\n", IDENTIFIER_POINTER(STUB_LABEL_NAME(stub)));
+/* Generate far-jump branch islands for everything on the
+ branch_island_list. Invoked immediately after the last instruction
+ of the epilogue has been emitted; the branch-islands must be
+ appended to, and contiguous with, the function body. Mach-O stubs
+ are generated in machopic_output_stub(). */
+static void
+macho_branch_islands (void)
+{
+ char tmp_buf[512];
+ tree branch_island;
+
+ for (branch_island = branch_island_list;
+ branch_island;
+ branch_island = TREE_CHAIN (branch_island))
+ {
+ const char *label =
+ IDENTIFIER_POINTER (BRANCH_ISLAND_LABEL_NAME (branch_island));
+ const char *name =
+ darwin_strip_name_encoding (
+ IDENTIFIER_POINTER (BRANCH_ISLAND_FUNCTION_NAME (branch_island)));
+ char name_buf[512];
+ /* Cheap copy of the details from the Darwin ASM_OUTPUT_LABELREF(). */
+ if (name[0] == '*' || name[0] == '&')
+ strcpy (name_buf, name+1);
+ else
+ {
+ name_buf[0] = '_';
+ strcpy (name_buf+1, name);
+ }
+ strcpy (tmp_buf, "\n");
+ strcat (tmp_buf, label);
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
- if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
- fprintf (asm_out_file, "\t.stabd 68,0,%d\n", STUB_LINE_NUMBER(stub));
+ if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
+ fprintf (asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n",
+ BRANCH_ISLAND_LINE_NUMBER(branch_island));
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
-
- if (IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub))[0] == '*')
- strcpy (label_buf,
- IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub))+1);
- else
- {
- label_buf[0] = '_';
- strcpy (label_buf+1,
- IDENTIFIER_POINTER (STUB_FUNCTION_NAME (stub)));
- }
-
- strcpy (tmp_buf, "lis r12,hi16(");
- strcat (tmp_buf, label_buf);
- strcat (tmp_buf, ")\n\tori r12,r12,lo16(");
- strcat (tmp_buf, label_buf);
- strcat (tmp_buf, ")\n\tmtctr r12\n\tbctr");
- output_asm_insn (tmp_buf, 0);
-
+ if (flag_pic)
+ {
+ strcat (tmp_buf, ":\n\tmflr r0\n\tbcl 20,31,");
+ strcat (tmp_buf, label);
+ strcat (tmp_buf, "_pic\n");
+ strcat (tmp_buf, label);
+ strcat (tmp_buf, "_pic:\n\tmflr r11\n");
+
+ strcat (tmp_buf, "\taddis r11,r11,ha16(");
+ strcat (tmp_buf, name_buf);
+ strcat (tmp_buf, " - ");
+ strcat (tmp_buf, label);
+ strcat (tmp_buf, "_pic)\n");
+
+ strcat (tmp_buf, "\tmtlr r0\n");
+
+ strcat (tmp_buf, "\taddi r12,r11,lo16(");
+ strcat (tmp_buf, name_buf);
+ strcat (tmp_buf, " - ");
+ strcat (tmp_buf, label);
+ strcat (tmp_buf, "_pic)\n");
+
+ strcat (tmp_buf, "\tmtctr r12\n\tbctr\n");
+ }
+ else
+ {
+ strcat (tmp_buf, ":\nlis r12,hi16(");
+ strcat (tmp_buf, name_buf);
+ strcat (tmp_buf, ")\n\tori r12,r12,lo16(");
+ strcat (tmp_buf, name_buf);
+ strcat (tmp_buf, ")\n\tmtctr r12\n\tbctr");
+ }
+ output_asm_insn (tmp_buf, 0);
#if defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)
- if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
- fprintf(asm_out_file, "\t.stabd 68,0,%d\n", STUB_LINE_NUMBER (stub));
+ if (write_symbols == DBX_DEBUG || write_symbols == XCOFF_DEBUG)
+ fprintf(asm_out_file, "\t.stabd 68,0," HOST_WIDE_INT_PRINT_UNSIGNED "\n",
+ BRANCH_ISLAND_LINE_NUMBER (branch_island));
#endif /* DBX_DEBUGGING_INFO || XCOFF_DEBUGGING_INFO */
- }
+ }
- stub_list = 0;
+ branch_island_list = 0;
}
/* NO_PREVIOUS_DEF checks in the link list whether the function name is
already there or not. */
-int
+static int
no_previous_def (tree function_name)
{
- tree stub;
- for (stub = stub_list; stub; stub = TREE_CHAIN (stub))
- if (function_name == STUB_FUNCTION_NAME (stub))
+ tree branch_island;
+ for (branch_island = branch_island_list;
+ branch_island;
+ branch_island = TREE_CHAIN (branch_island))
+ if (function_name == BRANCH_ISLAND_FUNCTION_NAME (branch_island))
return 0;
return 1;
}
@@ -14607,13 +14816,15 @@ no_previous_def (tree function_name)
/* GET_PREV_LABEL gets the label name from the previous definition of
the function. */
-tree
+static tree
get_prev_label (tree function_name)
{
- tree stub;
- for (stub = stub_list; stub; stub = TREE_CHAIN (stub))
- if (function_name == STUB_FUNCTION_NAME (stub))
- return STUB_LABEL_NAME (stub);
+ tree branch_island;
+ for (branch_island = branch_island_list;
+ branch_island;
+ branch_island = TREE_CHAIN (branch_island))
+ if (function_name == BRANCH_ISLAND_FUNCTION_NAME (branch_island))
+ return BRANCH_ISLAND_LABEL_NAME (branch_island);
return 0;
}
@@ -14623,13 +14834,14 @@ get_prev_label (tree function_name)
CALL_DEST is the routine we are calling. */
char *
-output_call (rtx insn, rtx call_dest, int operand_number)
+output_call (rtx insn, rtx *operands, int dest_operand_number, int cookie_operand_number)
{
static char buf[256];
- if (GET_CODE (call_dest) == SYMBOL_REF && TARGET_LONG_BRANCH && !flag_pic)
+ if (GET_CODE (operands[dest_operand_number]) == SYMBOL_REF
+ && (INTVAL (operands[cookie_operand_number]) & CALL_LONG))
{
tree labelname;
- tree funname = get_identifier (XSTR (call_dest, 0));
+ tree funname = get_identifier (XSTR (operands[dest_operand_number], 0));
if (no_previous_def (funname))
{
@@ -14643,23 +14855,25 @@ output_call (rtx insn, rtx call_dest, int operand_number)
for (; insn && GET_CODE (insn) != NOTE; insn = PREV_INSN (insn));
if (insn)
line_number = NOTE_LINE_NUMBER (insn);
- add_compiler_stub (labelname, funname, line_number);
+ add_compiler_branch_island (labelname, funname, line_number);
}
else
labelname = get_prev_label (funname);
+ /* "jbsr foo, L42" is Mach-O for "Link as 'bl foo' if a 'bl'
+ instruction will reach 'foo', otherwise link as 'bl L42'".
+ "L42" should be a 'branch island', that will do a far jump to
+ 'foo'. Branch islands are generated in
+ macho_branch_islands(). */
sprintf (buf, "jbsr %%z%d,%.246s",
- operand_number, IDENTIFIER_POINTER (labelname));
- return buf;
+ dest_operand_number, IDENTIFIER_POINTER (labelname));
}
else
- {
- sprintf (buf, "bl %%z%d", operand_number);
- return buf;
- }
+ sprintf (buf, "bl %%z%d", dest_operand_number);
+ return buf;
}
-#endif /* RS6000_LONG_BRANCH */
+#endif /* TARGET_MACHO */
/* Generate PIC and indirect symbol stubs. */
@@ -14746,9 +14960,13 @@ rs6000_machopic_legitimize_pic_address (rtx orig, enum machine_mode mode,
if (GET_CODE (XEXP (orig, 0)) == PLUS)
{
+ /* Use a different reg for the intermediate value, as
+ it will be marked UNCHANGING. */
+ rtx reg_temp = no_new_pseudos ? reg : gen_reg_rtx (Pmode);
+
base =
rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 0),
- Pmode, reg);
+ Pmode, reg_temp);
offset =
rs6000_machopic_legitimize_pic_address (XEXP (XEXP (orig, 0), 1),
Pmode, reg);
@@ -14791,14 +15009,8 @@ toc_section (void)
static unsigned int
rs6000_elf_section_type_flags (tree decl, const char *name, int reloc)
{
- unsigned int flags
- = default_section_type_flags_1 (decl, name, reloc,
- flag_pic || DEFAULT_ABI == ABI_AIX);
-
- if (TARGET_RELOCATABLE)
- flags |= SECTION_WRITE;
-
- return flags;
+ return default_section_type_flags_1 (decl, name, reloc,
+ flag_pic || DEFAULT_ABI == ABI_AIX);
}
/* Record an element in the table of global constructors. SYMBOL is
@@ -15452,7 +15664,7 @@ rs6000_function_value (tree valtype, tree func ATTRIBUTE_UNUSED)
if ((INTEGRAL_TYPE_P (valtype)
&& TYPE_PRECISION (valtype) < BITS_PER_WORD)
|| POINTER_TYPE_P (valtype))
- mode = word_mode;
+ mode = TARGET_32BIT ? SImode : DImode;
else
mode = TYPE_MODE (valtype);
@@ -15490,6 +15702,28 @@ rs6000_libcall_value (enum machine_mode mode)
return gen_rtx_REG (mode, regno);
}
+/* Define the offset between two registers, FROM to be eliminated and its
+ replacement TO, at the start of a routine. */
+HOST_WIDE_INT
+rs6000_initial_elimination_offset (int from, int to)
+{
+ rs6000_stack_t *info = rs6000_stack_info ();
+ HOST_WIDE_INT offset;
+
+ if (from == FRAME_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ offset = info->push_p ? 0 : -info->total_size;
+ else if (from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
+ offset = info->total_size;
+ else if (from == ARG_POINTER_REGNUM && to == STACK_POINTER_REGNUM)
+ offset = info->push_p ? info->total_size : 0;
+ else if (from == RS6000_PIC_OFFSET_TABLE_REGNUM)
+ offset = 0;
+ else
+ abort ();
+
+ return offset;
+}
+
/* Return true if TYPE is of type __ev64_opaque__. */
static bool
diff --git a/gcc/config/rs6000/rs6000.h b/gcc/config/rs6000/rs6000.h
index 3665b0a3fb5..761873dc63e 100644
--- a/gcc/config/rs6000/rs6000.h
+++ b/gcc/config/rs6000/rs6000.h
@@ -84,11 +84,15 @@
%{mcpu=740: -mppc} \
%{mcpu=7400: -mppc} \
%{mcpu=7450: -mppc} \
+%{mcpu=G4: -mppc} \
%{mcpu=750: -mppc} \
+%{mcpu=G3: -mppc} \
%{mcpu=801: -mppc} \
%{mcpu=821: -mppc} \
%{mcpu=823: -mppc} \
%{mcpu=860: -mppc} \
+%{mcpu=970: -mpower4} \
+%{mcpu=G5: -mpower4} \
%{mcpu=8540: -me500} \
%{maltivec: -maltivec}"
@@ -183,7 +187,10 @@ extern int target_flags;
/* Return small structures in memory (as the AIX ABI requires). */
#define MASK_AIX_STRUCT_RET 0x00040000
-/* The only remaining free bits are 0x00780000. sysv4.h uses
+/* Use single field mfcr instruction. */
+#define MASK_MFCRF 0x00080000
+
+/* The only remaining free bits are 0x00700000. sysv4.h uses
0x00800000 -> 0x40000000, and 0x80000000 is not available
because target_flags is signed. */
@@ -206,6 +213,17 @@ extern int target_flags;
#define TARGET_ALTIVEC (target_flags & MASK_ALTIVEC)
#define TARGET_AIX_STRUCT_RET (target_flags & MASK_AIX_STRUCT_RET)
+/* Define TARGET_MFCRF if the target assembler supports the optional
+ field operand for mfcr and the target processor supports the
+ instruction. */
+
+#ifdef HAVE_AS_MFCRF
+#define TARGET_MFCRF (target_flags & MASK_MFCRF)
+#else
+#define TARGET_MFCRF 0
+#endif
+
+
#define TARGET_32BIT (! TARGET_64BIT)
#define TARGET_HARD_FLOAT (! TARGET_SOFT_FLOAT)
#define TARGET_UPDATE (! TARGET_NO_UPDATE)
@@ -255,19 +273,19 @@ extern int target_flags;
{"powerpc-gpopt", MASK_POWERPC | MASK_PPC_GPOPT, \
N_("Use PowerPC General Purpose group optional instructions")},\
{"no-powerpc-gpopt", - MASK_PPC_GPOPT, \
- N_("Don't use PowerPC General Purpose group optional instructions")},\
+ N_("Do not use PowerPC General Purpose group optional instructions")},\
{"powerpc-gfxopt", MASK_POWERPC | MASK_PPC_GFXOPT, \
N_("Use PowerPC Graphics group optional instructions")},\
{"no-powerpc-gfxopt", - MASK_PPC_GFXOPT, \
- N_("Don't use PowerPC Graphics group optional instructions")},\
+ N_("Do not use PowerPC Graphics group optional instructions")},\
{"powerpc64", MASK_POWERPC64, \
N_("Use PowerPC-64 instruction set")}, \
{"no-powerpc64", - MASK_POWERPC64, \
- N_("Don't use PowerPC-64 instruction set")}, \
+ N_("Do not use PowerPC-64 instruction set")}, \
{"altivec", MASK_ALTIVEC , \
N_("Use AltiVec instructions")}, \
{"no-altivec", - MASK_ALTIVEC , \
- N_("Don't use AltiVec instructions")}, \
+ N_("Do not use AltiVec instructions")}, \
{"new-mnemonics", MASK_NEW_MNEMONICS, \
N_("Use new mnemonics for PowerPC architecture")},\
{"old-mnemonics", -MASK_NEW_MNEMONICS, \
@@ -278,11 +296,11 @@ extern int target_flags;
{"fp-in-toc", - MASK_NO_FP_IN_TOC, \
N_("Place floating point constants in TOC")}, \
{"no-fp-in-toc", MASK_NO_FP_IN_TOC, \
- N_("Don't place floating point constants in TOC")},\
+ N_("Do not place floating point constants in TOC")},\
{"sum-in-toc", - MASK_NO_SUM_IN_TOC, \
N_("Place symbol+offset constants in TOC")}, \
{"no-sum-in-toc", MASK_NO_SUM_IN_TOC, \
- N_("Don't place symbol+offset constants in TOC")},\
+ N_("Do not place symbol+offset constants in TOC")},\
{"minimal-toc", MASK_MINIMAL_TOC, \
"Use only one TOC entry per procedure"}, \
{"minimal-toc", - (MASK_NO_FP_IN_TOC | MASK_NO_SUM_IN_TOC), \
@@ -290,9 +308,9 @@ extern int target_flags;
{"no-minimal-toc", - MASK_MINIMAL_TOC, \
N_("Place variable addresses in the regular TOC")},\
{"hard-float", - MASK_SOFT_FLOAT, \
- N_("Use hardware fp")}, \
+ N_("Use hardware floating point")}, \
{"soft-float", MASK_SOFT_FLOAT, \
- N_("Do not use hardware fp")}, \
+ N_("Do not use hardware floating point")}, \
{"multiple", MASK_MULTIPLE, \
N_("Generate load/store multiple instructions")}, \
{"no-multiple", - MASK_MULTIPLE, \
@@ -308,11 +326,11 @@ extern int target_flags;
{"fused-madd", - MASK_NO_FUSED_MADD, \
N_("Generate fused multiply/add instructions")},\
{"no-fused-madd", MASK_NO_FUSED_MADD, \
- N_("Don't generate fused multiply/add instructions")},\
+ N_("Do not generate fused multiply/add instructions")},\
{"sched-prolog", MASK_SCHED_PROLOG, \
""}, \
{"no-sched-prolog", -MASK_SCHED_PROLOG, \
- N_("Don't schedule the start and end of the procedure")},\
+ N_("Do not schedule the start and end of the procedure")},\
{"sched-epilog", MASK_SCHED_PROLOG, \
""}, \
{"no-sched-epilog", -MASK_SCHED_PROLOG, \
@@ -322,9 +340,13 @@ extern int target_flags;
{"svr4-struct-return", - MASK_AIX_STRUCT_RET, \
N_("Return small structures in registers (SVR4 default)")},\
{"no-aix-struct-return", - MASK_AIX_STRUCT_RET, \
- ""},\
+ ""}, \
{"no-svr4-struct-return", MASK_AIX_STRUCT_RET, \
- ""},\
+ ""}, \
+ {"mfcrf", MASK_MFCRF, \
+ N_("Generate single field mfcr instruction")}, \
+ {"no-mfcrf", - MASK_MFCRF, \
+ N_("Do not generate single field mfcr instruction")},\
SUBTARGET_SWITCHES \
{"", TARGET_DEFAULT | MASK_SCHED_PROLOG, \
""}}
@@ -525,16 +547,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
#define DEFAULT_SCHED_FINISH_NOP_INSERTION_SCHEME \
(rs6000_cpu == PROCESSOR_POWER4 ? sched_finish_regroup_exact : sched_finish_none)
-/* Define TARGET_MFCRF if the target assembler supports the optional
- field operand for mfcr and the target processor supports the
- instruction. */
-
-#ifdef HAVE_AS_MFCRF
-#define TARGET_MFCRF (rs6000_cpu == PROCESSOR_POWER4)
-#else
-#define TARGET_MFCRF 0
-#endif
-
#define TARGET_LONG_DOUBLE_128 (rs6000_long_double_type_size == 128)
#define TARGET_ALTIVEC_ABI rs6000_altivec_abi
#define TARGET_ALTIVEC_VRSAVE rs6000_altivec_vrsave
@@ -551,7 +563,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
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
+ Do not use this macro to turn on various extra optimizations for
`-O'. That is what `OPTIMIZATION_OPTIONS' is for.
On the RS/6000 this is used to define the target cpu type. */
@@ -604,7 +616,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
#define PROMOTE_MODE(MODE,UNSIGNEDP,TYPE) \
if (GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
- (MODE) = word_mode;
+ (MODE) = TARGET_32BIT ? SImode : DImode;
/* Define this if most significant bit is lowest numbered
in instructions that operate on numbered bit-fields. */
@@ -625,7 +637,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
#define MAX_BITS_PER_WORD 64
/* Width of a word, in units (bytes). */
-#define UNITS_PER_WORD (TARGET_32BIT ? 4 : 8)
+#define UNITS_PER_WORD (! TARGET_POWERPC64 ? 4 : 8)
#ifdef IN_LIBGCC2
#define MIN_UNITS_PER_WORD UNITS_PER_WORD
#else
@@ -988,8 +1000,6 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
POWER and PowerPC GPRs hold 32 bits worth;
PowerPC64 GPRs and FPRs point register holds 64 bits worth. */
-#define UNITS_PER_GPR_WORD (! TARGET_POWERPC64 ? 4 : 8)
-
#define HARD_REGNO_NREGS(REGNO, MODE) \
(FP_REGNO_P (REGNO) \
? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
@@ -997,7 +1007,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
? ((GET_MODE_SIZE (MODE) + UNITS_PER_SPE_WORD - 1) / UNITS_PER_SPE_WORD) \
: ALTIVEC_REGNO_P (REGNO) \
? ((GET_MODE_SIZE (MODE) + UNITS_PER_ALTIVEC_WORD - 1) / UNITS_PER_ALTIVEC_WORD) \
- : ((GET_MODE_SIZE (MODE) + UNITS_PER_GPR_WORD - 1) / UNITS_PER_GPR_WORD))
+ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
#define HARD_REGNO_CALL_PART_CLOBBERED(REGNO, MODE) \
((TARGET_32BIT && TARGET_POWERPC64 \
@@ -1042,7 +1052,7 @@ extern enum rs6000_nop_insertion rs6000_sched_insert_nops;
: SPE_SIMD_REGNO_P (REGNO) && TARGET_SPE && SPE_VECTOR_MODE (MODE) ? 1 \
: CR_REGNO_P (REGNO) ? GET_MODE_CLASS (MODE) == MODE_CC \
: XER_REGNO_P (REGNO) ? (MODE) == PSImode \
- : GET_MODE_SIZE (MODE) <= UNITS_PER_GPR_WORD)
+ : GET_MODE_SIZE (MODE) <= UNITS_PER_WORD)
/* Value is 1 if it is a good idea to tie two pseudo registers
when one has mode MODE1 and one has mode MODE2.
@@ -1465,16 +1475,19 @@ enum reg_class
#define CLASS_MAX_NREGS(CLASS, MODE) \
(((CLASS) == FLOAT_REGS) \
? ((GET_MODE_SIZE (MODE) + UNITS_PER_FP_WORD - 1) / UNITS_PER_FP_WORD) \
- : ((GET_MODE_SIZE (MODE) + UNITS_PER_GPR_WORD - 1) / UNITS_PER_GPR_WORD))
+ : ((GET_MODE_SIZE (MODE) + UNITS_PER_WORD - 1) / UNITS_PER_WORD))
/* Return a class of registers that cannot change FROM mode to TO mode. */
-#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
- (GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
- ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \
+#define CANNOT_CHANGE_MODE_CLASS(FROM, TO, CLASS) \
+ (((DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN) \
+ && GET_MODE_SIZE (FROM) >= 8 && GET_MODE_SIZE (TO) >= 8) \
+ ? 0 \
+ : GET_MODE_SIZE (FROM) != GET_MODE_SIZE (TO) \
+ ? reg_classes_intersect_p (FLOAT_REGS, CLASS) \
: (TARGET_SPE && (SPE_VECTOR_MODE (FROM) + SPE_VECTOR_MODE (TO)) == 1) \
- ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \
+ ? reg_classes_intersect_p (GENERAL_REGS, CLASS) \
: 0)
/* Stack layout; function entry, exit and calling. */
@@ -1489,49 +1502,6 @@ enum rs6000_abi {
extern enum rs6000_abi rs6000_current_abi; /* available for use by subtarget */
-/* Structure used to define the rs6000 stack */
-typedef struct rs6000_stack {
- int first_gp_reg_save; /* first callee saved GP register used */
- int first_fp_reg_save; /* first callee saved FP register used */
- int first_altivec_reg_save; /* first callee saved AltiVec register used */
- int lr_save_p; /* true if the link reg needs to be saved */
- int cr_save_p; /* true if the CR reg needs to be saved */
- unsigned int vrsave_mask; /* mask of vec registers to save */
- int toc_save_p; /* true if the TOC needs to be saved */
- int push_p; /* true if we need to allocate stack space */
- int calls_p; /* true if the function makes any calls */
- enum rs6000_abi abi; /* which ABI to use */
- int gp_save_offset; /* offset to save GP regs from initial SP */
- int fp_save_offset; /* offset to save FP regs from initial SP */
- int altivec_save_offset; /* offset to save AltiVec regs from initial SP */
- int lr_save_offset; /* offset to save LR from initial SP */
- int cr_save_offset; /* offset to save CR from initial SP */
- int vrsave_save_offset; /* offset to save VRSAVE from initial SP */
- int spe_gp_save_offset; /* offset to save spe 64-bit gprs */
- 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 */
- int parm_size; /* outgoing parameter size */
- int save_size; /* save area size */
- int fixed_size; /* fixed size of stack frame */
- int gp_size; /* size of saved GP registers */
- int fp_size; /* size of saved FP registers */
- int altivec_size; /* size of saved AltiVec registers */
- int cr_size; /* size to hold CR if not in save_size */
- int lr_size; /* size to hold LR if not in save_size */
- int vrsave_size; /* size to hold VRSAVE if not in save_size */
- int altivec_padding_size; /* size of altivec alignment padding if
- not in save_size */
- int spe_gp_size; /* size of 64-bit GPR save size for SPE */
- int spe_padding_size;
- int toc_size; /* size to hold TOC if not in save_size */
- int total_size; /* total bytes allocated for stack */
- int spe_64bit_regs_used;
-} rs6000_stack_t;
-
/* Define this if pushing a word on the stack
makes the stack pointer a smaller address. */
#define STACK_GROWS_DOWNWARD
@@ -1766,10 +1736,12 @@ typedef struct rs6000_args
/* Define intermediate macro to compute the size (in registers) of an argument
for the RS/6000. */
+#define UNITS_PER_ARG (TARGET_32BIT ? 4 : 8)
+
#define RS6000_ARG_SIZE(MODE, TYPE) \
((MODE) != BLKmode \
- ? (GET_MODE_SIZE (MODE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD \
- : (int_size_in_bytes (TYPE) + (UNITS_PER_WORD - 1)) / UNITS_PER_WORD)
+ ? (GET_MODE_SIZE (MODE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG \
+ : (int_size_in_bytes (TYPE) + (UNITS_PER_ARG - 1)) / UNITS_PER_ARG)
/* Initialize a variable CUM of type CUMULATIVE_ARGS
for a call to a function whose data type is FNTYPE.
@@ -1796,18 +1768,6 @@ typedef struct rs6000_args
#define FUNCTION_ARG_ADVANCE(CUM, MODE, TYPE, NAMED) \
function_arg_advance (&CUM, MODE, TYPE, NAMED)
-/* Nonzero if we can use a floating-point register to pass this arg. */
-#define USE_FP_FOR_ARG_P(CUM,MODE,TYPE) \
- (GET_MODE_CLASS (MODE) == MODE_FLOAT \
- && (CUM).fregno <= FP_ARG_MAX_REG \
- && TARGET_HARD_FLOAT && TARGET_FPRS)
-
-/* Nonzero if we can use an AltiVec register to pass this arg. */
-#define USE_ALTIVEC_FOR_ARG_P(CUM,MODE,TYPE) \
- (ALTIVEC_VECTOR_MODE (MODE) \
- && (CUM).vregno <= ALTIVEC_ARG_MAX_REG \
- && TARGET_ALTIVEC_ABI)
-
/* 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.
@@ -1871,10 +1831,6 @@ typedef struct rs6000_args
the ABIs at the moment. For now, only AIX gets fixed. */
#define SPLIT_COMPLEX_ARGS (DEFAULT_ABI == ABI_AIX)
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = rs6000_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
rs6000_va_start (valist, nextarg)
@@ -1996,21 +1952,8 @@ typedef struct rs6000_args
/* Define the offset between two registers, one to be eliminated, and the other
its replacement, at the start of a routine. */
-#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
-{ \
- rs6000_stack_t *info = rs6000_stack_info (); \
- \
- if ((FROM) == FRAME_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
- (OFFSET) = (info->push_p) ? 0 : - info->total_size; \
- else if ((FROM) == ARG_POINTER_REGNUM && (TO) == FRAME_POINTER_REGNUM) \
- (OFFSET) = info->total_size; \
- else if ((FROM) == ARG_POINTER_REGNUM && (TO) == STACK_POINTER_REGNUM) \
- (OFFSET) = (info->push_p) ? info->total_size : 0; \
- else if ((FROM) == RS6000_PIC_OFFSET_TABLE_REGNUM) \
- (OFFSET) = 0; \
- else \
- abort (); \
-}
+#define INITIAL_ELIMINATION_OFFSET(FROM, TO, OFFSET) \
+ ((OFFSET) = rs6000_initial_elimination_offset(FROM, TO))
/* Addressing modes, and classification of registers for them. */
@@ -2288,6 +2231,9 @@ do { \
between pointers and any other objects of this machine mode. */
#define Pmode (TARGET_32BIT ? SImode : DImode)
+/* Supply definition of STACK_SIZE_MODE for allocate_dynamic_stack_space. */
+#define STACK_SIZE_MODE (TARGET_32BIT ? SImode : DImode)
+
/* Mode of a function address in a call instruction (for indexing purposes).
Doesn't matter on RS/6000. */
#define FUNCTION_MODE SImode
diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 73a87871733..3ab0465a316 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -1020,7 +1020,7 @@
(match_operand:SI 2 "reg_or_short_operand" "r,I,r,I"))
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r,r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
{cax.|add.} %3,%1,%2
{ai.|addic.} %3,%1,%2
@@ -1035,7 +1035,7 @@
(match_operand:SI 2 "reg_or_short_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3)
(plus:SI (match_dup 1)
(match_dup 2)))
@@ -1052,7 +1052,7 @@
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
(plus:SI (match_dup 1)
(match_dup 2)))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
{cax.|add.} %0,%1,%2
{ai.|addic.} %0,%1,%2
@@ -1068,7 +1068,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(plus:SI (match_dup 1) (match_dup 2)))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(plus:SI (match_dup 1)
(match_dup 2)))
@@ -1109,7 +1109,7 @@
(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
(const_int 0)))
(clobber (match_scratch:SI 2 "=r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
nor. %2,%1,%1
#"
@@ -1121,7 +1121,7 @@
(compare:CC (not:SI (match_operand:SI 1 "gpc_reg_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 2 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 2)
(not:SI (match_dup 1)))
(set (match_dup 0)
@@ -1135,7 +1135,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(not:SI (match_dup 1)))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
nor. %0,%1,%1
#"
@@ -1148,7 +1148,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(not:SI (match_dup 1)))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(not:SI (match_dup 1)))
(set (match_dup 2)
@@ -1191,7 +1191,7 @@
(match_operand:SI 2 "gpc_reg_operand" "r,r"))
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "TARGET_POWERPC && ! TARGET_POWERPC64"
+ "TARGET_POWERPC && TARGET_32BIT"
"@
subf. %3,%2,%1
#"
@@ -1204,7 +1204,7 @@
(match_operand:SI 2 "gpc_reg_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3)
(minus:SI (match_dup 1)
(match_dup 2)))
@@ -1235,7 +1235,7 @@
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(minus:SI (match_dup 1)
(match_dup 2)))]
- "TARGET_POWERPC && ! TARGET_POWERPC64"
+ "TARGET_POWERPC && TARGET_32BIT"
"@
subf. %0,%2,%1
#"
@@ -1250,7 +1250,7 @@
(set (match_operand:SI 0 "gpc_reg_operand" "")
(minus:SI (match_dup 1)
(match_dup 2)))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(minus:SI (match_dup 1)
(match_dup 2)))
@@ -1563,7 +1563,7 @@
(compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" "r,r"))
(const_int 0)))
(clobber (match_scratch:SI 2 "=r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
neg. %2,%1
#"
@@ -1575,7 +1575,7 @@
(compare:CC (neg:SI (match_operand:SI 1 "gpc_reg_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 2 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 2)
(neg:SI (match_dup 1)))
(set (match_dup 0)
@@ -1589,7 +1589,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(neg:SI (match_dup 1)))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
neg. %0,%1
#"
@@ -1602,7 +1602,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(neg:SI (match_dup 1)))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(neg:SI (match_dup 1)))
(set (match_dup 2)
@@ -2225,7 +2225,7 @@
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r,r,r,r,r,r,r"))
(clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
and. %3,%1,%2
{andil.|andi.} %3,%1,%b2
@@ -2304,7 +2304,7 @@
(and:SI (match_dup 1)
(match_dup 2)))
(clobber (match_scratch:CC 4 "=X,X,X,X,X,x,x,X"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
and. %0,%1,%2
{andil.|andi.} %0,%1,%b2
@@ -2516,7 +2516,7 @@
(match_operand:SI 2 "gpc_reg_operand" "r,r")])
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %3,%1,%2
#"
@@ -2530,7 +2530,7 @@
(match_operand:SI 2 "gpc_reg_operand" "")])
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3) (match_dup 4))
(set (match_dup 0)
(compare:CC (match_dup 3)
@@ -2545,7 +2545,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(match_dup 4))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %0,%1,%2
#"
@@ -2560,7 +2560,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(match_dup 4))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0) (match_dup 4))
(set (match_dup 3)
(compare:CC (match_dup 0)
@@ -2604,7 +2604,7 @@
(match_operand:SI 2 "gpc_reg_operand" "r,r")])
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %3,%2,%1
#"
@@ -2618,7 +2618,7 @@
(match_operand:SI 2 "gpc_reg_operand" "")])
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3) (match_dup 4))
(set (match_dup 0)
(compare:CC (match_dup 3)
@@ -2633,7 +2633,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(match_dup 4))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %0,%2,%1
#"
@@ -2648,7 +2648,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(match_dup 4))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0) (match_dup 4))
(set (match_dup 3)
(compare:CC (match_dup 0)
@@ -2670,7 +2670,7 @@
(not:SI (match_operand:SI 2 "gpc_reg_operand" "r,r"))])
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %3,%1,%2
#"
@@ -2684,7 +2684,7 @@
(not:SI (match_operand:SI 2 "gpc_reg_operand" ""))])
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3) (match_dup 4))
(set (match_dup 0)
(compare:CC (match_dup 3)
@@ -2699,7 +2699,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(match_dup 4))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
%q4. %0,%1,%2
#"
@@ -2714,7 +2714,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(match_dup 4))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0) (match_dup 4))
(set (match_dup 3)
(compare:CC (match_dup 0)
@@ -3618,7 +3618,7 @@
(match_operand:SI 2 "reg_or_cint_operand" "ri,ri"))
(const_int 0)))
(clobber (match_scratch:SI 3 "=r,r"))]
- "! TARGET_POWER && ! TARGET_POWERPC64"
+ "! TARGET_POWER && TARGET_32BIT"
"@
{sl|slw}%I2. %3,%1,%h2
#"
@@ -3631,7 +3631,7 @@
(match_operand:SI 2 "reg_or_cint_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
+ "! TARGET_POWER && TARGET_32BIT && reload_completed"
[(set (match_dup 3)
(ashift:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -3680,7 +3680,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r")
(ashift:SI (match_dup 1) (match_dup 2)))]
- "! TARGET_POWER && ! TARGET_POWERPC64"
+ "! TARGET_POWER && TARGET_32BIT"
"@
{sl|slw}%I2. %0,%1,%h2
#"
@@ -3694,7 +3694,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(ashift:SI (match_dup 1) (match_dup 2)))]
- "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
+ "! TARGET_POWER && TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(ashift:SI (match_dup 1) (match_dup 2)))
(set (match_dup 3)
@@ -3851,7 +3851,7 @@
(match_operand:SI 2 "reg_or_cint_operand" "O,ri,O,ri"))
(const_int 0)))
(clobber (match_scratch:SI 3 "=X,r,X,r"))]
- "! TARGET_POWER && ! TARGET_POWERPC64"
+ "! TARGET_POWER && TARGET_32BIT"
"@
mr. %1,%1
{sr|srw}%I2. %3,%1,%h2
@@ -3866,7 +3866,7 @@
(match_operand:SI 2 "reg_or_cint_operand" ""))
(const_int 0)))
(clobber (match_scratch:SI 3 ""))]
- "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
+ "! TARGET_POWER && TARGET_32BIT && reload_completed"
[(set (match_dup 3)
(lshiftrt:SI (match_dup 1) (match_dup 2)))
(set (match_dup 0)
@@ -3917,7 +3917,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r,r")
(lshiftrt:SI (match_dup 1) (match_dup 2)))]
- "! TARGET_POWER && ! TARGET_POWERPC64"
+ "! TARGET_POWER && TARGET_32BIT"
"@
mr. %0,%1
{sr|srw}%I2. %0,%1,%h2
@@ -3933,7 +3933,7 @@
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "")
(lshiftrt:SI (match_dup 1) (match_dup 2)))]
- "! TARGET_POWER && ! TARGET_POWERPC64 && reload_completed"
+ "! TARGET_POWER && TARGET_32BIT && reload_completed"
[(set (match_dup 0)
(lshiftrt:SI (match_dup 1) (match_dup 2)))
(set (match_dup 3)
@@ -7739,7 +7739,7 @@
(compare:CC (match_operand:SI 1 "gpc_reg_operand" "0,r,r")
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "=r,r,r") (match_dup 1))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
{cmpi|cmpwi} %2,%0,0
mr. %0,%1
@@ -7752,7 +7752,7 @@
(compare:CC (match_operand:SI 1 "gpc_reg_operand" "")
(const_int 0)))
(set (match_operand:SI 0 "gpc_reg_operand" "") (match_dup 1))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 0) (match_dup 1))
(set (match_dup 2)
(compare:CC (match_dup 0)
@@ -8159,16 +8159,18 @@
[(set_attr "type" "*,load,store,*,*,*")
(set_attr "length" "8,8,8,8,12,16")])
+; ld/std require word-aligned displacements, so use offsettable constraint.
+; List o->r and r->o before r->r for reload.
(define_insn "*movdf_hardfloat64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=!r,??r,m,f,f,m,!cl,!r,!r,!r,!r")
- (match_operand:DF 1 "input_operand" "r,m,r,f,m,f,r,h,G,H,F"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=o,??r,!r,f,f,m,!cl,!r,!r,!r,!r")
+ (match_operand:DF 1 "input_operand" "r,o,r,f,m,f,r,h,G,H,F"))]
"TARGET_POWERPC64 && TARGET_HARD_FLOAT && TARGET_FPRS
&& (gpc_reg_operand (operands[0], DFmode)
|| gpc_reg_operand (operands[1], DFmode))"
"@
- mr %0,%1
- ld%U1%X1 %0,%1
std%U0%X0 %1,%0
+ ld%U1%X1 %0,%1
+ mr %0,%1
fmr %0,%1
lfd%U1%X1 %0,%1
stfd%U0%X0 %1,%0
@@ -8181,8 +8183,8 @@
(set_attr "length" "4,4,4,4,4,4,4,4,8,12,16")])
(define_insn "*movdf_softfloat64"
- [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r")
- (match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F"))]
+ [(set (match_operand:DF 0 "nonimmediate_operand" "=r,cl,r,r,m,r,r,r,*h")
+ (match_operand:DF 1 "input_operand" "r,r,h,m,r,G,H,F,0"))]
"TARGET_POWERPC64 && (TARGET_SOFT_FLOAT || !TARGET_FPRS)
&& (gpc_reg_operand (operands[0], DFmode)
|| gpc_reg_operand (operands[1], DFmode))"
@@ -8194,127 +8196,39 @@
std%U0%X0 %1,%0
#
#
- #"
- [(set_attr "type" "*,*,*,load,store,*,*,*")
- (set_attr "length" "4,4,4,4,4,8,12,16")])
+ #
+ nop"
+ [(set_attr "type" "*,*,*,load,store,*,*,*,*")
+ (set_attr "length" "4,4,4,4,4,8,12,16,4")])
(define_expand "movtf"
[(set (match_operand:TF 0 "general_operand" "")
(match_operand:TF 1 "any_operand" ""))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"{ rs6000_emit_move (operands[0], operands[1], TFmode); DONE; }")
-(define_insn "*movtf_internal"
- [(set (match_operand:TF 0 "nonimmediate_operand" "=f,f,m,!r,!r,!r")
- (match_operand:TF 1 "input_operand" "f,m,f,G,H,F"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128
+; It's important to list the o->f and f->o moves before f->f because
+; otherwise reload, given m->f, will try to pick f->f and reload it,
+; which doesn't make progress.
+(define_insn_and_split "*movtf_internal"
+ [(set (match_operand:TF 0 "nonimmediate_operand" "=o,f,f,rm,r")
+ (match_operand:TF 1 "input_operand" "f,o,f,r,mGHF"))]
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128
&& (gpc_reg_operand (operands[0], TFmode)
|| gpc_reg_operand (operands[1], TFmode))"
- "*
-{
- switch (which_alternative)
- {
- default:
- abort ();
- case 0:
- /* We normally copy the low-numbered register first. However, if
- the first register operand 0 is the same as the second register of
- operand 1, we must copy in the opposite order. */
- if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
- return \"fmr %L0,%L1\;fmr %0,%1\";
- else
- return \"fmr %0,%1\;fmr %L0,%L1\";
- case 1:
- return \"lfd %0,%1\;lfd %L0,%Y1\";
- case 2:
- return \"stfd %1,%0\;stfd %L1,%Y0\";
- case 3:
- case 4:
- case 5:
- return \"#\";
- }
-}"
- [(set_attr "type" "fp,fpload,fpstore,*,*,*")
- (set_attr "length" "8,8,8,12,16,20")])
-
-(define_split
- [(set (match_operand:TF 0 "gpc_reg_operand" "")
- (match_operand:TF 1 "easy_fp_constant" ""))]
- "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
- && TARGET_HARD_FLOAT && TARGET_FPRS && ! TARGET_POWERPC64
- && TARGET_LONG_DOUBLE_128 && reload_completed
- && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
- || (GET_CODE (operands[0]) == SUBREG
- && GET_CODE (SUBREG_REG (operands[0])) == REG
- && REGNO (SUBREG_REG (operands[0])) <= 31))"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
- "
-{
- long l[4];
- REAL_VALUE_TYPE rv;
-
- REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
- REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, l);
-
- operands[2] = operand_subword (operands[0], 0, 0, TFmode);
- operands[3] = operand_subword (operands[0], 1, 0, TFmode);
- operands[4] = operand_subword (operands[0], 2, 0, TFmode);
- operands[5] = operand_subword (operands[0], 3, 0, TFmode);
- operands[6] = gen_int_mode (l[0], SImode);
- operands[7] = gen_int_mode (l[1], SImode);
- operands[8] = gen_int_mode (l[2], SImode);
- operands[9] = gen_int_mode (l[3], SImode);
-}")
-
-(define_split
- [(set (match_operand:TF 0 "gpc_reg_operand" "")
- (match_operand:TF 1 "easy_fp_constant" ""))]
- "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
- && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_POWERPC64
- && TARGET_LONG_DOUBLE_128 && reload_completed
- && ((GET_CODE (operands[0]) == REG && REGNO (operands[0]) <= 31)
- || (GET_CODE (operands[0]) == SUBREG
- && GET_CODE (SUBREG_REG (operands[0])) == REG
- && REGNO (SUBREG_REG (operands[0])) <= 31))"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
- "
-{
- long l[4];
- REAL_VALUE_TYPE rv;
-#if HOST_BITS_PER_WIDE_INT >= 64
- HOST_WIDE_INT val;
-#endif
-
- REAL_VALUE_FROM_CONST_DOUBLE (rv, operands[1]);
- REAL_VALUE_TO_TARGET_LONG_DOUBLE (rv, l);
-
- operands[2] = gen_lowpart (DImode, operands[0]);
- operands[3] = gen_highpart (DImode, operands[0]);
-#if HOST_BITS_PER_WIDE_INT >= 64
- val = ((HOST_WIDE_INT)(unsigned long)l[0] << 32
- | ((HOST_WIDE_INT)(unsigned long)l[1]));
- operands[4] = gen_int_mode (val, DImode);
-
- val = ((HOST_WIDE_INT)(unsigned long)l[2] << 32
- | ((HOST_WIDE_INT)(unsigned long)l[3]));
- operands[5] = gen_int_mode (val, DImode);
-#else
- operands[4] = immed_double_const (l[1], l[0], DImode);
- operands[5] = immed_double_const (l[3], l[2], DImode);
-#endif
-}")
+ "#"
+ "reload_completed"
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; }
+ [(set_attr "length" "8,8,8,20,20")])
(define_insn "extenddftf2"
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(float_extend:TF (match_operand:DF 1 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"*
{
if (REGNO (operands[0]) == REGNO (operands[1]))
@@ -8327,8 +8241,8 @@
(define_insn "extendsftf2"
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(float_extend:TF (match_operand:SF 1 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"*
{
if (REGNO (operands[0]) == REGNO (operands[1]))
@@ -8341,8 +8255,8 @@
(define_insn "trunctfdf2"
[(set (match_operand:DF 0 "gpc_reg_operand" "=f")
(float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"fadd %0,%1,%L1"
[(set_attr "type" "fp")
(set_attr "length" "8")])
@@ -8351,8 +8265,8 @@
[(set (match_operand:SF 0 "gpc_reg_operand" "=f")
(float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "f")))
(clobber (match_scratch:DF 2 "=f"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
- && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"#"
"&& reload_completed"
[(set (match_dup 2)
@@ -8365,7 +8279,8 @@
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(float:TF (match_operand:DI 1 "gpc_reg_operand" "*f")))
(clobber (match_scratch:DF 2 "=f"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_POWERPC64
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"#"
"&& reload_completed"
@@ -8379,8 +8294,8 @@
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(float:TF (match_operand:SI 1 "gpc_reg_operand" "r")))
(clobber (match_scratch:DF 2 "=f"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"#"
"&& reload_completed"
[(set (match_dup 2)
@@ -8393,7 +8308,8 @@
[(set (match_operand:DI 0 "gpc_reg_operand" "=*f")
(fix:DI (match_operand:TF 1 "gpc_reg_operand" "f")))
(clobber (match_scratch:DF 2 "=f"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_POWERPC64
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_POWERPC64
&& TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"#"
"&& reload_completed"
@@ -8407,8 +8323,8 @@
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(fix:SI (match_operand:TF 1 "gpc_reg_operand" "f")))
(clobber (match_scratch:DF 2 "=f"))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"#"
"&& reload_completed"
[(set (match_dup 2)
@@ -8420,8 +8336,8 @@
(define_insn "negtf2"
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(neg:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"*
{
if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -8435,8 +8351,8 @@
(define_insn "abstf2"
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(abs:TF (match_operand:TF 1 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"*
{
if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -8450,8 +8366,8 @@
(define_insn ""
[(set (match_operand:TF 0 "gpc_reg_operand" "=f")
(neg:TF (abs:TF (match_operand:TF 1 "gpc_reg_operand" "f"))))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"*
{
if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
@@ -8524,31 +8440,12 @@
}")
(define_split
- [(set (match_operand:DI 0 "gpc_reg_operand" "")
- (match_operand:DI 1 "const_double_operand" ""))]
- "HOST_BITS_PER_WIDE_INT == 32 && ! TARGET_POWERPC64 && reload_completed"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
- "
-{
- operands[2] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN == 0,
- DImode);
- operands[3] = operand_subword_force (operands[0], WORDS_BIG_ENDIAN != 0,
- DImode);
- operands[4] = GEN_INT (CONST_DOUBLE_HIGH (operands[1]));
- operands[5] = GEN_INT (CONST_DOUBLE_LOW (operands[1]));
-}")
-
-(define_split
[(set (match_operand:DI 0 "nonimmediate_operand" "")
(match_operand:DI 1 "input_operand" ""))]
"reload_completed && !TARGET_POWERPC64
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_split
[(set (match_operand:TI 0 "gpc_reg_operand" "")
@@ -8777,28 +8674,10 @@
(define_split
[(set (match_operand:TI 0 "nonimmediate_operand" "")
(match_operand:TI 1 "input_operand" ""))]
- "reload_completed && TARGET_POWERPC64
- && gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 4))
- (set (match_dup 3) (match_dup 5))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-(define_split
- [(set (match_operand:TI 0 "nonimmediate_operand" "")
- (match_operand:TI 1 "input_operand" ""))]
- "reload_completed && !TARGET_POWERPC64
+ "reload_completed
&& gpr_or_gpr_p (operands[0], operands[1])"
- [(set (match_dup 2) (match_dup 6))
- (set (match_dup 3) (match_dup 7))
- (set (match_dup 4) (match_dup 8))
- (set (match_dup 5) (match_dup 9))]
-"{
- rs6000_split_multireg_move (operands);
-}")
-
-
+ [(pc)]
+{ rs6000_split_multireg_move (operands[0], operands[1]); DONE; })
(define_expand "load_multiple"
[(match_par_dup 3 [(set (match_operand:SI 0 "" "")
@@ -10270,7 +10149,7 @@
if (GET_CODE (operands[0]) != SYMBOL_REF
|| (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[0]))
- || (INTVAL (operands[2]) & CALL_LONG) != 0)
+ || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[2]) & CALL_LONG) != 0))
{
if (INTVAL (operands[2]) & CALL_LONG)
operands[0] = rs6000_longcall_ref (operands[0]);
@@ -10318,7 +10197,7 @@
if (GET_CODE (operands[1]) != SYMBOL_REF
|| (DEFAULT_ABI == ABI_AIX && !SYMBOL_REF_FUNCTION_P (operands[1]))
- || (INTVAL (operands[3]) & CALL_LONG) != 0)
+ || (DEFAULT_ABI != ABI_DARWIN && (INTVAL (operands[3]) & CALL_LONG) != 0))
{
if (INTVAL (operands[3]) & CALL_LONG)
operands[1] = rs6000_longcall_ref (operands[1]);
@@ -10573,9 +10452,9 @@
(match_operand 1 "" "g,g"))
(use (match_operand:SI 2 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 3 "=l,l"))]
- "(DEFAULT_ABI == ABI_V4
- || DEFAULT_ABI == ABI_DARWIN)
- && (INTVAL (operands[2]) & CALL_LONG) == 0"
+ "(DEFAULT_ABI == ABI_DARWIN
+ || (DEFAULT_ABI == ABI_V4
+ && (INTVAL (operands[2]) & CALL_LONG) == 0))"
{
if (INTVAL (operands[2]) & CALL_V4_SET_FP_ARGS)
output_asm_insn ("crxor 6,6,6", operands);
@@ -10583,7 +10462,11 @@
else if (INTVAL (operands[2]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn ("creqv 6,6,6", operands);
+#if TARGET_MACHO
+ return output_call(insn, operands, 0, 2);
+#else
return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z0@plt" : "bl %z0";
+#endif
}
[(set_attr "type" "branch,branch")
(set_attr "length" "4,8")])
@@ -10614,9 +10497,9 @@
(match_operand 2 "" "g,g")))
(use (match_operand:SI 3 "immediate_operand" "O,n"))
(clobber (match_scratch:SI 4 "=l,l"))]
- "(DEFAULT_ABI == ABI_V4
- || DEFAULT_ABI == ABI_DARWIN)
- && (INTVAL (operands[3]) & CALL_LONG) == 0"
+ "(DEFAULT_ABI == ABI_DARWIN
+ || (DEFAULT_ABI == ABI_V4
+ && (INTVAL (operands[3]) & CALL_LONG) == 0))"
{
if (INTVAL (operands[3]) & CALL_V4_SET_FP_ARGS)
output_asm_insn ("crxor 6,6,6", operands);
@@ -10624,7 +10507,11 @@
else if (INTVAL (operands[3]) & CALL_V4_CLEAR_FP_ARGS)
output_asm_insn ("creqv 6,6,6", operands);
+#if TARGET_MACHO
+ return output_call(insn, operands, 1, 3);
+#else
return (DEFAULT_ABI == ABI_V4 && flag_pic) ? "bl %z1@plt" : "bl %z1";
+#endif
}
[(set_attr "type" "branch,branch")
(set_attr "length" "4,8")])
@@ -10977,8 +10864,8 @@
(define_expand "cmptf"
[(set (cc0) (compare (match_operand:TF 0 "gpc_reg_operand" "")
(match_operand:TF 1 "gpc_reg_operand" "")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT
- && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"
{
rs6000_compare_op0 = operands[0];
@@ -11343,8 +11230,8 @@
[(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "f")
(match_operand:TF 2 "gpc_reg_operand" "f")))]
- "DEFAULT_ABI == ABI_AIX && TARGET_HARD_FLOAT && TARGET_FPRS
- && TARGET_LONG_DOUBLE_128"
+ "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
+ && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
"fcmpu %0,%1,%2\;bne %0,$+4\;fcmpu %0,%L1,%L2"
[(set_attr "type" "fpcompare")
(set_attr "length" "12")])
@@ -11401,7 +11288,7 @@
(const_int 0)))
(set (match_operand:SI 3 "gpc_reg_operand" "=r,r")
(match_op_dup 1 [(match_dup 2) (const_int 0)]))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"@
mfcr %3%Q2\;{rlinm.|rlwinm.} %3,%3,%J1,1
#"
@@ -11416,7 +11303,7 @@
(const_int 0)))
(set (match_operand:SI 3 "gpc_reg_operand" "")
(match_op_dup 1 [(match_dup 2) (const_int 0)]))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(set (match_dup 3)
(match_op_dup 1 [(match_dup 2) (const_int 0)]))
(set (match_dup 0)
@@ -12133,7 +12020,7 @@
[(set (match_operand:SI 0 "gpc_reg_operand" "=r")
(leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_short_operand" "rI")))]
- "! TARGET_POWERPC64"
+ "TARGET_32BIT"
"{sf%I2|subf%I2c} %0,%1,%2\;{cal %0,0(0)|li %0,0}\;{ae|adde} %0,%0,%0"
[(set_attr "length" "12")])
@@ -12208,21 +12095,6 @@
"")
(define_insn ""
- [(set (match_operand:CC 3 "cc_reg_operand" "=x,?y")
- (compare:CC
- (leu:DI (match_operand:DI 1 "gpc_reg_operand" "r,r")
- (match_operand:DI 2 "reg_or_short_operand" "rI,rI"))
- (const_int 0)))
- (set (match_operand:DI 0 "gpc_reg_operand" "=r,r")
- (leu:DI (match_dup 1) (match_dup 2)))]
- "TARGET_64BIT"
- "@
- subf%I2c %0,%1,%2\;li %0,0\;adde. %0,%0,%0
- #"
- [(set_attr "type" "compare")
- (set_attr "length" "12,16")])
-
-(define_insn ""
[(set (match_operand:SI 0 "gpc_reg_operand" "=&r")
(plus:SI (leu:SI (match_operand:SI 1 "gpc_reg_operand" "r")
(match_operand:SI 2 "reg_or_short_operand" "rI"))
@@ -14299,7 +14171,7 @@
(const_int -1)))
(clobber (match_scratch:CC 3 ""))
(clobber (match_scratch:SI 4 ""))]
- "! TARGET_POWERPC64 && reload_completed"
+ "TARGET_32BIT && reload_completed"
[(parallel [(set (match_dup 3)
(compare:CC (plus:SI (match_dup 1)
(const_int -1))
@@ -14325,7 +14197,7 @@
(plus:SI (match_dup 1) (const_int -1)))
(clobber (match_scratch:CC 3 ""))
(clobber (match_scratch:SI 4 ""))]
- "! TARGET_POWERPC64 && reload_completed
+ "TARGET_32BIT && reload_completed
&& ! gpc_reg_operand (operands[0], SImode)"
[(parallel [(set (match_dup 3)
(compare:CC (plus:SI (match_dup 1)
@@ -14397,63 +14269,6 @@
"
{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
const0_rtx); }")
-
-; These two are for 64-bit hardware running 32-bit mode.
-; We don't use the add. instruction in this mode.
-(define_split
- [(set (pc)
- (if_then_else (match_operator 2 "comparison_operator"
- [(match_operand:SI 1 "gpc_reg_operand" "")
- (const_int 1)])
- (match_operand 5 "" "")
- (match_operand 6 "" "")))
- (set (match_operand:SI 0 "gpc_reg_operand" "")
- (plus:SI (match_dup 1)
- (const_int -1)))
- (clobber (match_scratch:CC 3 ""))
- (clobber (match_scratch:SI 4 ""))]
- "TARGET_POWERPC64 && TARGET_32BIT && reload_completed"
- [(set (match_dup 0)
- (plus:SI (match_dup 1)
- (const_int -1)))
- (set (match_dup 3)
- (compare:CC (match_dup 0)
- (const_int 0)))
- (set (pc) (if_then_else (match_dup 7)
- (match_dup 5)
- (match_dup 6)))]
- "
-{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
- const0_rtx); }")
-
-(define_split
- [(set (pc)
- (if_then_else (match_operator 2 "comparison_operator"
- [(match_operand:SI 1 "gpc_reg_operand" "")
- (const_int 1)])
- (match_operand 5 "" "")
- (match_operand 6 "" "")))
- (set (match_operand:SI 0 "nonimmediate_operand" "")
- (plus:SI (match_dup 1) (const_int -1)))
- (clobber (match_scratch:CC 3 ""))
- (clobber (match_scratch:SI 4 ""))]
- "TARGET_POWERPC64 && TARGET_32BIT && reload_completed
- && ! gpc_reg_operand (operands[0], SImode)"
- [(set (match_dup 4)
- (plus:SI (match_dup 1)
- (const_int -1)))
- (set (match_dup 3)
- (compare:CC (match_dup 4)
- (const_int 0)))
- (set (match_dup 0)
- (match_dup 4))
- (set (pc) (if_then_else (match_dup 7)
- (match_dup 5)
- (match_dup 6)))]
- "
-{ operands[7] = gen_rtx (GET_CODE (operands[2]), VOIDmode, operands[3],
- const0_rtx); }")
-
(define_insn "trap"
[(trap_if (const_int 1) (const_int 0))]
@@ -14698,30 +14513,7 @@
[(const_int 0)]
"
{
- rs6000_stack_t *info = rs6000_stack_info ();
-
- if (info->lr_save_p)
- {
- rtx frame_rtx = stack_pointer_rtx;
- int sp_offset = 0;
- rtx tmp;
-
- 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;
-
- 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]);
+ rs6000_emit_eh_reg_restore (operands[0], operands[1]);
DONE;
}")
diff --git a/gcc/config/rs6000/sysv4.h b/gcc/config/rs6000/sysv4.h
index 45928e4498b..a49a1ca6516 100644
--- a/gcc/config/rs6000/sysv4.h
+++ b/gcc/config/rs6000/sysv4.h
@@ -199,6 +199,8 @@ do { \
rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "netbsd")) \
rs6000_current_abi = ABI_V4; \
+ else if (!strcmp (rs6000_abi_name, "openbsd")) \
+ rs6000_current_abi = ABI_V4; \
else if (!strcmp (rs6000_abi_name, "i960-old")) \
{ \
rs6000_current_abi = ABI_V4; \
@@ -389,6 +391,21 @@ do { \
#undef STACK_BOUNDARY
#define STACK_BOUNDARY (TARGET_ALTIVEC_ABI ? 128 : 64)
+/* Define this macro if you wish to preserve a certain alignment for
+ the stack pointer, greater than what the hardware enforces. The
+ definition is a C expression for the desired alignment (measured
+ in bits). This macro must evaluate to a value equal to or larger
+ than STACK_BOUNDARY.
+ For the SYSV ABI and variants the alignment of the stack pointer
+ is usually controlled manually in rs6000.c. However, to maintain
+ alignment across alloca () in all circumstances,
+ PREFERRED_STACK_BOUNDARY needs to be set as well.
+ This has the additional advantage of allowing a bigger maximum
+ alignment of user objects on the stack. */
+
+#undef PREFERRED_STACK_BOUNDARY
+#define PREFERRED_STACK_BOUNDARY 128
+
/* Real stack boundary as mandated by the appropriate ABI. */
#define ABI_STACK_BOUNDARY ((TARGET_EABI && !TARGET_ALTIVEC_ABI) ? 64 : 128)
@@ -453,7 +470,7 @@ do { \
#define TOC_SECTION_FUNCTION \
void \
-toc_section () \
+toc_section (void) \
{ \
if (in_section != in_toc) \
{ \
@@ -495,14 +512,14 @@ toc_section () \
} \
\
extern int in_toc_section (void); \
-int in_toc_section () \
+int in_toc_section (void) \
{ \
return in_section == in_toc; \
}
#define SDATA_SECTION_FUNCTION \
void \
-sdata_section () \
+sdata_section (void) \
{ \
if (in_section != in_sdata) \
{ \
@@ -513,7 +530,7 @@ sdata_section () \
#define SDATA2_SECTION_FUNCTION \
void \
-sdata2_section () \
+sdata2_section (void) \
{ \
if (in_section != in_sdata2) \
{ \
@@ -524,7 +541,7 @@ sdata2_section () \
#define SBSS_SECTION_FUNCTION \
void \
-sbss_section () \
+sbss_section (void) \
{ \
if (in_section != in_sbss) \
{ \
@@ -535,7 +552,7 @@ sbss_section () \
#define INIT_SECTION_FUNCTION \
void \
-init_section () \
+init_section (void) \
{ \
if (in_section != in_init) \
{ \
@@ -546,7 +563,7 @@ init_section () \
#define FINI_SECTION_FUNCTION \
void \
-fini_section () \
+fini_section (void) \
{ \
if (in_section != in_fini) \
{ \
@@ -793,6 +810,7 @@ extern int fixuplabelno;
mcall-aixdesc | \
mcall-freebsd | \
mcall-netbsd | \
+ mcall-openbsd | \
mcall-linux | \
mcall-gnu :-mbig; \
mcall-i960-old :-mlittle}"
@@ -815,6 +833,7 @@ extern int fixuplabelno;
mcall-aixdesc | \
mcall-freebsd | \
mcall-netbsd | \
+ mcall-openbsd | \
mcall-linux | \
mcall-gnu : -mbig %(cc1_endian_big); \
mcall-i960-old : -mlittle %(cc1_endian_little); \
@@ -827,7 +846,8 @@ extern int fixuplabelno;
%{mcall-i960-old: -meabi } \
%{mcall-linux: -mno-eabi } \
%{mcall-gnu: -mno-eabi } \
- %{mcall-netbsd: -mno-eabi }}} \
+ %{mcall-netbsd: -mno-eabi } \
+ %{mcall-openbsd: -mno-eabi }}} \
%{msdata: -msdata=default} \
%{mno-sdata: -msdata=none} \
%{profile: -p}"
@@ -860,6 +880,7 @@ extern int fixuplabelno;
mcall-linux : %(link_start_linux) ; \
mcall-gnu : %(link_start_gnu) ; \
mcall-netbsd : %(link_start_netbsd) ; \
+ mcall-openbsd: %(link_start_openbsd) ; \
: %(link_start_default) }"
#define LINK_START_DEFAULT_SPEC ""
@@ -917,6 +938,7 @@ extern int fixuplabelno;
mcall-linux : %(link_os_linux) ; \
mcall-gnu : %(link_os_gnu) ; \
mcall-netbsd : %(link_os_netbsd) ; \
+ mcall-openbsd: %(link_os_openbsd) ; \
: %(link_os_default) }"
#define LINK_OS_DEFAULT_SPEC ""
@@ -933,6 +955,7 @@ extern int fixuplabelno;
mcall-linux : %(cpp_os_linux) ; \
mcall-gnu : %(cpp_os_gnu) ; \
mcall-netbsd : %(cpp_os_netbsd) ; \
+ mcall-openbsd: %(cpp_os_openbsd) ; \
: %(cpp_os_default) }"
#define CPP_OS_DEFAULT_SPEC ""
@@ -949,6 +972,7 @@ extern int fixuplabelno;
mcall-linux : %(startfile_linux) ; \
mcall-gnu : %(startfile_gnu) ; \
mcall-netbsd : %(startfile_netbsd) ; \
+ mcall-openbsd: %(startfile_openbsd) ; \
: %(startfile_default) }"
#define STARTFILE_DEFAULT_SPEC ""
@@ -965,6 +989,7 @@ extern int fixuplabelno;
mcall-linux : %(lib_linux) ; \
mcall-gnu : %(lib_gnu) ; \
mcall-netbsd : %(lib_netbsd) ; \
+ mcall-openbsd: %(lib_openbsd) ; \
: %(lib_default) }"
#define LIB_DEFAULT_SPEC ""
@@ -981,6 +1006,7 @@ extern int fixuplabelno;
mcall-linux : crtsavres.o%s %(endfile_linux) ; \
mcall-gnu : crtsavres.o%s %(endfile_gnu) ; \
mcall-netbsd : crtsavres.o%s %(endfile_netbsd) ; \
+ mcall-openbsd: crtsavres.o%s %(endfile_openbsd) ; \
: %(crtsavres_default) %(endfile_default) }"
#define CRTSAVRES_DEFAULT_SPEC "crtsavres.o%s"
@@ -1098,7 +1124,7 @@ extern int fixuplabelno;
%{!ansi: \
%{!std=*:-Dunix -D__unix -Dlinux -D__linux} \
%{std=gnu*:-Dunix -D__unix -Dlinux -D__linux}}} \
--Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
+-Asystem=linux -Asystem=unix -Asystem=posix %{pthread:-D_REENTRANT}"
/* GNU/Hurd support. */
#define LIB_GNU_SPEC "%{mnewlib: --start-group -lgnu -lc --end-group } \
@@ -1148,6 +1174,34 @@ ncrtn.o%s"
#define CPP_OS_NETBSD_SPEC "\
-D__powerpc__ -D__NetBSD__ -D__KPRINTF_ATTRIBUTE__"
+/* OpenBSD support. */
+#ifndef LIB_OPENBSD_SPEC
+#define LIB_OPENBSD_SPEC "%{!shared:%{pthread:-lpthread%{p:_p}%{!p:%{pg:_p}}}} %{!shared:-lc%{p:_p}%{!p:%{pg:_p}}}"
+#endif
+
+#ifndef STARTFILE_OPENBSD_SPEC
+#define STARTFILE_OPENBSD_SPEC "\
+%{!shared: %{pg:gcrt0.o%s} %{!pg:%{p:gcrt0.o%s} %{!p:crt0.o%s}}} \
+%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}"
+#endif
+
+#ifndef ENDFILE_OPENBSD_SPEC
+#define ENDFILE_OPENBSD_SPEC "\
+%{!shared:crtend.o%s} %{shared:crtendS.o%s}"
+#endif
+
+#ifndef LINK_START_OPENBSD_SPEC
+#define LINK_START_OPENBSD_SPEC "-Ttext 0x400074"
+#endif
+
+#ifndef LINK_OS_OPENBSD_SPEC
+#define LINK_OS_OPENBSD_SPEC ""
+#endif
+
+#ifndef CPP_OS_OPENBSD_SPEC
+#define CPP_OS_OPENBSD_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_POSIX_THREADS}"
+#endif
+
/* WindISS support. */
#define LIB_WINDISS_SPEC "--start-group -li -lcfp -lwindiss -lram -limpl -limpfp --end-group"
@@ -1180,6 +1234,7 @@ ncrtn.o%s"
{ "lib_gnu", LIB_GNU_SPEC }, \
{ "lib_linux", LIB_LINUX_SPEC }, \
{ "lib_netbsd", LIB_NETBSD_SPEC }, \
+ { "lib_openbsd", LIB_OPENBSD_SPEC }, \
{ "lib_windiss", LIB_WINDISS_SPEC }, \
{ "lib_default", LIB_DEFAULT_SPEC }, \
{ "startfile_ads", STARTFILE_ADS_SPEC }, \
@@ -1190,6 +1245,7 @@ ncrtn.o%s"
{ "startfile_gnu", STARTFILE_GNU_SPEC }, \
{ "startfile_linux", STARTFILE_LINUX_SPEC }, \
{ "startfile_netbsd", STARTFILE_NETBSD_SPEC }, \
+ { "startfile_openbsd", STARTFILE_OPENBSD_SPEC }, \
{ "startfile_windiss", STARTFILE_WINDISS_SPEC }, \
{ "startfile_default", STARTFILE_DEFAULT_SPEC }, \
{ "endfile_ads", ENDFILE_ADS_SPEC }, \
@@ -1200,6 +1256,7 @@ ncrtn.o%s"
{ "endfile_gnu", ENDFILE_GNU_SPEC }, \
{ "endfile_linux", ENDFILE_LINUX_SPEC }, \
{ "endfile_netbsd", ENDFILE_NETBSD_SPEC }, \
+ { "endfile_openbsd", ENDFILE_OPENBSD_SPEC }, \
{ "endfile_windiss", ENDFILE_WINDISS_SPEC }, \
{ "endfile_default", ENDFILE_DEFAULT_SPEC }, \
{ "link_path", LINK_PATH_SPEC }, \
@@ -1214,6 +1271,7 @@ ncrtn.o%s"
{ "link_start_gnu", LINK_START_GNU_SPEC }, \
{ "link_start_linux", LINK_START_LINUX_SPEC }, \
{ "link_start_netbsd", LINK_START_NETBSD_SPEC }, \
+ { "link_start_openbsd", LINK_START_OPENBSD_SPEC }, \
{ "link_start_windiss", LINK_START_WINDISS_SPEC }, \
{ "link_start_default", LINK_START_DEFAULT_SPEC }, \
{ "link_os", LINK_OS_SPEC }, \
@@ -1225,6 +1283,7 @@ ncrtn.o%s"
{ "link_os_linux", LINK_OS_LINUX_SPEC }, \
{ "link_os_gnu", LINK_OS_GNU_SPEC }, \
{ "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
+ { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
{ "link_os_windiss", LINK_OS_WINDISS_SPEC }, \
{ "link_os_default", LINK_OS_DEFAULT_SPEC }, \
{ "cc1_endian_big", CC1_ENDIAN_BIG_SPEC }, \
@@ -1238,6 +1297,7 @@ ncrtn.o%s"
{ "cpp_os_gnu", CPP_OS_GNU_SPEC }, \
{ "cpp_os_linux", CPP_OS_LINUX_SPEC }, \
{ "cpp_os_netbsd", CPP_OS_NETBSD_SPEC }, \
+ { "cpp_os_openbsd", CPP_OS_OPENBSD_SPEC }, \
{ "cpp_os_windiss", CPP_OS_WINDISS_SPEC }, \
{ "cpp_os_default", CPP_OS_DEFAULT_SPEC }, \
SUBSUBTARGET_EXTRA_SPECS
diff --git a/gcc/config/rs6000/t-darwin b/gcc/config/rs6000/t-darwin
index 7aca023302f..490b633ec3b 100644
--- a/gcc/config/rs6000/t-darwin
+++ b/gcc/config/rs6000/t-darwin
@@ -1,2 +1,3 @@
# Library code must include trampoline support.
LIB2FUNCS_EXTRA = $(srcdir)/config/rs6000/darwin-tramp.asm
+
diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
index e7e3b2ed995..9a6db9d76c1 100644
--- a/gcc/config/s390/linux.h
+++ b/gcc/config/s390/linux.h
@@ -53,11 +53,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_assert ("system=linux"); \
- builtin_assert ("system=unix"); \
- builtin_define ("__gnu_linux__"); \
+ LINUX_TARGET_OS_CPP_BUILTINS(); \
if (flag_pic) \
{ \
builtin_define ("__PIC__"); \
diff --git a/gcc/config/s390/s390-protos.h b/gcc/config/s390/s390-protos.h
index e99de323336..c45ff4dcd0f 100644
--- a/gcc/config/s390/s390-protos.h
+++ b/gcc/config/s390/s390-protos.h
@@ -30,7 +30,8 @@ extern void s390_emit_epilogue (void);
extern void s390_function_profiler (FILE *, int);
#ifdef RTX_CODE
-extern int s390_extra_constraint (rtx, int);
+extern int s390_extra_constraint_str (rtx, int, const char *);
+extern int s390_const_ok_for_constraint_p (HOST_WIDE_INT, int, const char *);
extern int const0_operand (rtx, enum machine_mode);
extern int consttable_operand (rtx, enum machine_mode);
extern int larl_operand (rtx, enum machine_mode);
@@ -40,10 +41,8 @@ extern int shift_count_operand (rtx, enum machine_mode);
extern int bras_sym_operand (rtx, enum machine_mode);
extern int load_multiple_operation (rtx, enum machine_mode);
extern int store_multiple_operation (rtx, enum machine_mode);
-extern int s390_single_hi (rtx, enum machine_mode, int);
-extern int s390_extract_hi (rtx, enum machine_mode, int);
-extern int s390_single_qi (rtx, enum machine_mode, int);
-extern int s390_extract_qi (rtx, enum machine_mode, int);
+extern int s390_single_part (rtx, enum machine_mode, enum machine_mode, int);
+extern unsigned HOST_WIDE_INT s390_extract_part (rtx, enum machine_mode, int);
extern bool s390_split_ok_p (rtx, rtx, enum machine_mode, int);
extern int tls_symbolic_operand (rtx);
@@ -97,9 +96,9 @@ extern int s390_agen_dep_p (rtx, rtx);
extern int s390_function_arg_pass_by_reference (enum machine_mode, tree);
extern void s390_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
-extern tree s390_build_va_list (void);
#ifdef RTX_CODE
extern rtx s390_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
+extern rtx s390_function_value (tree, enum machine_mode);
extern void s390_va_start (tree, rtx);
extern rtx s390_va_arg (tree, tree);
#endif /* RTX_CODE */
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index 63c2208fbeb..b79a2675909 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -60,6 +60,7 @@ static void s390_select_rtx_section (enum machine_mode, rtx,
static void s390_encode_section_info (tree, rtx, int);
static bool s390_cannot_force_const_mem (rtx);
static rtx s390_delegitimize_address (rtx);
+static bool s390_return_in_memory (tree, tree);
static void s390_init_builtins (void);
static rtx s390_expand_builtin (tree, rtx, rtx, enum machine_mode, int);
static void s390_output_mi_thunk (FILE *, tree, HOST_WIDE_INT,
@@ -76,6 +77,7 @@ static bool s390_rtx_costs (rtx, int, int, int *);
static int s390_address_cost (rtx);
static void s390_reorg (void);
static bool s390_valid_pointer_mode (enum machine_mode);
+static tree s390_build_builtin_va_list (void);
#undef TARGET_ASM_ALIGNED_HI_OP
#define TARGET_ASM_ALIGNED_HI_OP "\t.word\t"
@@ -106,6 +108,9 @@ static bool s390_valid_pointer_mode (enum machine_mode);
#undef TARGET_DELEGITIMIZE_ADDRESS
#define TARGET_DELEGITIMIZE_ADDRESS s390_delegitimize_address
+#undef TARGET_RETURN_IN_MEMORY
+#define TARGET_RETURN_IN_MEMORY s390_return_in_memory
+
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS s390_init_builtins
#undef TARGET_EXPAND_BUILTIN
@@ -140,6 +145,9 @@ static bool s390_valid_pointer_mode (enum machine_mode);
#undef TARGET_VALID_POINTER_MODE
#define TARGET_VALID_POINTER_MODE s390_valid_pointer_mode
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST s390_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
extern int reload_completed;
@@ -186,8 +194,7 @@ struct machine_function GTY(())
/* Set, if some of the fprs 8-15 need to be saved (64 bit abi). */
int save_fprs_p;
- /* Set if return address needs to be saved because the current
- function uses __builtin_return_addr (0). */
+ /* Set if return address needs to be saved. */
bool save_return_addr_p;
/* Number of first and last gpr to be saved, restored. */
@@ -216,12 +223,12 @@ static const char *get_some_local_dynamic_name (void);
static int get_some_local_dynamic_name_1 (rtx *, void *);
static int reg_used_in_mem_p (int, rtx);
static int addr_generation_dependency_p (rtx, rtx);
-static int s390_split_branches (rtx, bool *);
+static int s390_split_branches (void);
static void find_constant_pool_ref (rtx, rtx *);
static void replace_constant_pool_ref (rtx *, rtx, rtx);
static rtx find_ltrel_base (rtx);
static void replace_ltrel_base (rtx *, rtx);
-static void s390_optimize_prolog (bool, bool);
+static void s390_optimize_prolog (bool);
static int find_unused_clobbered_reg (void);
static void s390_frame_info (void);
static rtx save_fpr (rtx, int, int);
@@ -365,7 +372,7 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
case EQ:
case NE:
if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL (XEXP (op0, 1)), 'K'))
+ && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K"))
return CCAPmode;
if ((GET_CODE (op0) == PLUS || GET_CODE (op0) == MINUS
|| GET_CODE (op1) == NEG)
@@ -401,7 +408,7 @@ s390_select_ccmode (enum rtx_code code, rtx op0, rtx op1)
case GE:
case GT:
if (GET_CODE (op0) == PLUS && GET_CODE (XEXP (op0, 1)) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL (XEXP (op0, 1)), 'K'))
+ && CONST_OK_FOR_CONSTRAINT_P (INTVAL (XEXP (op0, 1)), 'K', "K"))
{
if (INTVAL (XEXP((op0), 1)) < 0)
return CCANmode;
@@ -751,198 +758,68 @@ s390_branch_condition_mnemonic (rtx code, int inv)
return mnemonic[mask];
}
-/* If OP is an integer constant of mode MODE with exactly one
- HImode subpart unequal to DEF, return the number of that
- subpart. As a special case, all HImode subparts of OP are
- equal to DEF, return zero. Otherwise, return -1. */
-
-int
-s390_single_hi (rtx op, enum machine_mode mode, int def)
-{
- if (GET_CODE (op) == CONST_INT)
- {
- unsigned HOST_WIDE_INT value = 0;
- int n_parts = GET_MODE_SIZE (mode) / 2;
- int i, part = -1;
-
- for (i = 0; i < n_parts; i++)
- {
- if (i == 0)
- value = (unsigned HOST_WIDE_INT) INTVAL (op);
- else
- value >>= 16;
-
- if ((value & 0xffff) != (unsigned)(def & 0xffff))
- {
- if (part != -1)
- return -1;
- else
- part = i;
- }
- }
-
- return part == -1 ? 0 : (n_parts - 1 - part);
- }
-
- else if (GET_CODE (op) == CONST_DOUBLE
- && GET_MODE (op) == VOIDmode)
- {
- unsigned HOST_WIDE_INT value = 0;
- int n_parts = GET_MODE_SIZE (mode) / 2;
- int i, part = -1;
-
- for (i = 0; i < n_parts; i++)
- {
- if (i == 0)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op);
- else if (i == HOST_BITS_PER_WIDE_INT / 16)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op);
- else
- value >>= 16;
-
- if ((value & 0xffff) != (unsigned)(def & 0xffff))
- {
- if (part != -1)
- return -1;
- else
- part = i;
- }
- }
-
- return part == -1 ? 0 : (n_parts - 1 - part);
- }
-
- return -1;
-}
-
-/* Extract the HImode part number PART from integer
- constant OP of mode MODE. */
+/* Return the part of op which has a value different from def.
+ The size of the part is determined by mode.
+ Use this function only if you already know that op really
+ contains such a part. */
-int
-s390_extract_hi (rtx op, enum machine_mode mode, int part)
+unsigned HOST_WIDE_INT
+s390_extract_part (rtx op, enum machine_mode mode, int def)
{
- int n_parts = GET_MODE_SIZE (mode) / 2;
- if (part < 0 || part >= n_parts)
- abort();
- else
- part = n_parts - 1 - part;
-
- if (GET_CODE (op) == CONST_INT)
- {
- unsigned HOST_WIDE_INT value = (unsigned HOST_WIDE_INT) INTVAL (op);
- return ((value >> (16 * part)) & 0xffff);
- }
- else if (GET_CODE (op) == CONST_DOUBLE
- && GET_MODE (op) == VOIDmode)
+ unsigned HOST_WIDE_INT value = 0;
+ int max_parts = HOST_BITS_PER_WIDE_INT / GET_MODE_BITSIZE (mode);
+ int part_bits = GET_MODE_BITSIZE (mode);
+ unsigned HOST_WIDE_INT part_mask = (1 << part_bits) - 1;
+ int i;
+
+ for (i = 0; i < max_parts; i++)
{
- unsigned HOST_WIDE_INT value;
- if (part < HOST_BITS_PER_WIDE_INT / 16)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op);
+ if (i == 0)
+ value = (unsigned HOST_WIDE_INT) INTVAL (op);
else
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op),
- part -= HOST_BITS_PER_WIDE_INT / 16;
-
- return ((value >> (16 * part)) & 0xffff);
+ value >>= part_bits;
+
+ if ((value & part_mask) != (def & part_mask))
+ return value & part_mask;
}
-
+
abort ();
}
/* If OP is an integer constant of mode MODE with exactly one
- QImode subpart unequal to DEF, return the number of that
- subpart. As a special case, all QImode subparts of OP are
- equal to DEF, return zero. Otherwise, return -1. */
+ part of mode PART_MODE unequal to DEF, return the number of that
+ part. Otherwise, return -1. */
int
-s390_single_qi (rtx op, enum machine_mode mode, int def)
-{
- if (GET_CODE (op) == CONST_INT)
- {
- unsigned HOST_WIDE_INT value = 0;
- int n_parts = GET_MODE_SIZE (mode);
- int i, part = -1;
-
- for (i = 0; i < n_parts; i++)
- {
- if (i == 0)
- value = (unsigned HOST_WIDE_INT) INTVAL (op);
- else
- value >>= 8;
-
- if ((value & 0xff) != (unsigned)(def & 0xff))
- {
- if (part != -1)
- return -1;
- else
- part = i;
- }
- }
-
- return part == -1 ? 0 : (n_parts - 1 - part);
- }
-
- else if (GET_CODE (op) == CONST_DOUBLE
- && GET_MODE (op) == VOIDmode)
- {
- unsigned HOST_WIDE_INT value = 0;
- int n_parts = GET_MODE_SIZE (mode);
- int i, part = -1;
-
- for (i = 0; i < n_parts; i++)
- {
- if (i == 0)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op);
- else if (i == HOST_BITS_PER_WIDE_INT / 8)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op);
- else
- value >>= 8;
-
- if ((value & 0xff) != (unsigned)(def & 0xff))
- {
- if (part != -1)
- return -1;
- else
- part = i;
- }
- }
-
- return part == -1 ? 0 : (n_parts - 1 - part);
- }
-
- return -1;
-}
-
-/* Extract the QImode part number PART from integer
- constant OP of mode MODE. */
-
-int
-s390_extract_qi (rtx op, enum machine_mode mode, int part)
-{
- int n_parts = GET_MODE_SIZE (mode);
- if (part < 0 || part >= n_parts)
- abort();
- else
- part = n_parts - 1 - part;
-
- if (GET_CODE (op) == CONST_INT)
- {
- unsigned HOST_WIDE_INT value = (unsigned HOST_WIDE_INT) INTVAL (op);
- return ((value >> (8 * part)) & 0xff);
- }
- else if (GET_CODE (op) == CONST_DOUBLE
- && GET_MODE (op) == VOIDmode)
- {
- unsigned HOST_WIDE_INT value;
- if (part < HOST_BITS_PER_WIDE_INT / 8)
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_LOW (op);
+s390_single_part (rtx op,
+ enum machine_mode mode,
+ enum machine_mode part_mode,
+ int def)
+{
+ unsigned HOST_WIDE_INT value = 0;
+ int n_parts = GET_MODE_SIZE (mode) / GET_MODE_SIZE (part_mode);
+ unsigned HOST_WIDE_INT part_mask = (1 << GET_MODE_BITSIZE (part_mode)) - 1;
+ int i, part = -1;
+
+ if (GET_CODE (op) != CONST_INT)
+ return -1;
+
+ for (i = 0; i < n_parts; i++)
+ {
+ if (i == 0)
+ value = (unsigned HOST_WIDE_INT) INTVAL (op);
else
- value = (unsigned HOST_WIDE_INT) CONST_DOUBLE_HIGH (op),
- part -= HOST_BITS_PER_WIDE_INT / 8;
-
- return ((value >> (8 * part)) & 0xff);
+ value >>= GET_MODE_BITSIZE (part_mode);
+
+ if ((value & part_mask) != (def & part_mask))
+ {
+ if (part != -1)
+ return -1;
+ else
+ part = i;
+ }
}
-
- abort ();
+ return part == -1 ? -1 : n_parts - 1 - part;
}
/* Check whether we can (and want to) split a double-word
@@ -1344,10 +1221,13 @@ s390_short_displacement (rtx disp)
/* Return true if OP is a valid operand for a C constraint. */
int
-s390_extra_constraint (rtx op, int c)
+s390_extra_constraint_str (rtx op, int c, const char * str)
{
struct s390_address addr;
+ if (c != str[0])
+ abort ();
+
switch (c)
{
case 'Q':
@@ -1433,6 +1313,78 @@ s390_extra_constraint (rtx op, int c)
return 1;
}
+/* Return true if VALUE matches the constraint STR. */
+
+int
+s390_const_ok_for_constraint_p (HOST_WIDE_INT value,
+ int c,
+ const char * str)
+{
+ enum machine_mode mode, part_mode;
+ int def;
+ unsigned char part;
+
+ if (c != str[0])
+ abort ();
+
+ switch (str[0])
+ {
+ case 'I':
+ return (unsigned int)value < 256;
+
+ case 'J':
+ return (unsigned int)value < 4096;
+
+ case 'K':
+ return value >= -32768 && value < 32768;
+
+ case 'L':
+ return (TARGET_LONG_DISPLACEMENT ?
+ (value >= -524288 && value <= 524287)
+ : (value >= 0 && value <= 4095));
+ case 'M':
+ return value == 2147483647;
+
+ case 'N':
+ part = str[1] - '0';
+
+ switch (str[2])
+ {
+ case 'H': part_mode = HImode; break;
+ case 'Q': part_mode = QImode; break;
+ default: return 0;
+ }
+
+ switch (str[3])
+ {
+ case 'H': mode = HImode; break;
+ case 'S': mode = SImode; break;
+ case 'D': mode = DImode; break;
+ default: return 0;
+ }
+
+ switch (str[4])
+ {
+ case '0': def = 0; break;
+ case 'F': def = -1; break;
+ default: return 0;
+ }
+
+ if (GET_MODE_SIZE (mode) <= GET_MODE_SIZE (part_mode))
+ return 0;
+
+ if (s390_single_part (GEN_INT (value), mode, part_mode, def) != part)
+ return 0;
+
+ break;
+
+ default:
+ return 0;
+ }
+
+ return 1;
+}
+
/* Compute a (partial) cost for rtx X. Return true if the complete
cost has been computed, and false if subexpressions should be
scanned. In either case, *TOTAL contains the cost result. */
@@ -1857,12 +1809,12 @@ legitimate_reload_constant_p (register rtx op)
/* Accept l(g)hi operands. */
if (GET_CODE (op) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL (op), 'K'))
+ && CONST_OK_FOR_CONSTRAINT_P (INTVAL (op), 'K', "K"))
return 1;
/* Accept lliXX operands. */
if (TARGET_ZARCH
- && s390_single_hi (op, DImode, 0) >= 0)
+ && s390_single_part (op, DImode, HImode, 0) >= 0)
return 1;
/* Accept larl operands. */
@@ -3484,7 +3436,9 @@ print_operand_address (FILE *file, rtx addr)
'b': print integer X as if it's an unsigned byte.
'x': print integer X as if it's an unsigned word.
- 'h': print integer X as if it's a signed word. */
+ 'h': print integer X as if it's a signed word.
+ 'i': print the first nonzero HImode part of X.
+ 'j': print the first HImode part unequal to 0xffff of X. */
void
print_operand (FILE *file, rtx x, int code)
@@ -3600,6 +3554,12 @@ print_operand (FILE *file, rtx x, int code)
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x) & 0xffff);
else if (code == 'h')
fprintf (file, HOST_WIDE_INT_PRINT_DEC, ((INTVAL (x) & 0xffff) ^ 0x8000) - 0x8000);
+ else if (code == 'i')
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ s390_extract_part (x, HImode, 0));
+ else if (code == 'j')
+ fprintf (file, HOST_WIDE_INT_PRINT_DEC,
+ s390_extract_part (x, HImode, -1));
else
fprintf (file, HOST_WIDE_INT_PRINT_DEC, INTVAL (x));
break;
@@ -3878,15 +3838,12 @@ s390_sched_reorder2 (FILE *dump ATTRIBUTE_UNUSED,
/* Split all branches that exceed the maximum distance.
- Returns true if this created a new literal pool entry.
-
- Code generated by this routine is allowed to use
- TEMP_REG as temporary scratch register. If this is
- done, TEMP_USED is set to true. */
+ Returns true if this created a new literal pool entry. */
static int
-s390_split_branches (rtx temp_reg, bool *temp_used)
+s390_split_branches (void)
{
+ rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
int new_literal = 0;
rtx insn, pat, tmp, target;
rtx *label;
@@ -3924,19 +3881,14 @@ s390_split_branches (rtx temp_reg, bool *temp_used)
else
continue;
- if (get_attr_length (insn) <= (TARGET_CPU_ZARCH ? 6 : 4))
+ if (get_attr_length (insn) <= 4)
continue;
- *temp_used = 1;
+ /* We are going to use the return register as scratch register,
+ make sure it will be saved/restored by the prologue/epilogue. */
+ cfun->machine->save_return_addr_p = 1;
- if (TARGET_CPU_ZARCH)
- {
- tmp = emit_insn_before (gen_rtx_SET (Pmode, temp_reg, *label), insn);
- INSN_ADDRESSES_NEW (tmp, -1);
-
- target = temp_reg;
- }
- else if (!flag_pic)
+ if (!flag_pic)
{
new_literal = 1;
tmp = force_const_mem (Pmode, *label);
@@ -5019,12 +4971,10 @@ s390_output_pool_entry (FILE *file, rtx exp, enum machine_mode mode,
/* Rework the prolog/epilog to avoid saving/restoring
registers unnecessarily. BASE_USED specifies whether
- the literal pool base register needs to be saved,
- TEMP_USED specifies whether the return register needs
- to be saved. */
+ the literal pool base register needs to be saved. */
static void
-s390_optimize_prolog (bool base_used, bool temp_used)
+s390_optimize_prolog (bool base_used)
{
int save_first, save_last, restore_first, restore_last;
int i, j;
@@ -5032,17 +4982,9 @@ s390_optimize_prolog (bool base_used, bool temp_used)
/* Recompute regs_ever_live data for special registers. */
regs_ever_live[BASE_REGISTER] = base_used;
- regs_ever_live[RETURN_REGNUM] = temp_used;
+ regs_ever_live[RETURN_REGNUM] = cfun->machine->save_return_addr_p;
regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0;
- /* In non-leaf functions, the prolog/epilog code relies
- on RETURN_REGNUM being saved in any case. We also need
- to save the return register if __builtin_return_address (0)
- was used in the current function. */
- if (!current_function_is_leaf
- || cfun->machine->save_return_addr_p)
- regs_ever_live[RETURN_REGNUM] = 1;
-
/* Find first and last gpr to be saved. */
@@ -5089,7 +5031,7 @@ s390_optimize_prolog (bool base_used, bool temp_used)
/* If all special registers are in fact used, there's nothing we
can do, so no point in walking the insn list. */
if (i <= BASE_REGISTER && j >= BASE_REGISTER
- && i <= RETURN_REGNUM && j >= RETURN_REGNUM)
+ && (TARGET_CPU_ZARCH || (i <= RETURN_REGNUM && j >= RETURN_REGNUM)))
return;
@@ -5104,10 +5046,9 @@ s390_optimize_prolog (bool base_used, bool temp_used)
if (GET_CODE (insn) != INSN)
continue;
- if (GET_CODE (PATTERN (insn)) != PARALLEL)
- continue;
- if (store_multiple_operation (PATTERN (insn), VOIDmode))
+ if (GET_CODE (PATTERN (insn)) == PARALLEL
+ && store_multiple_operation (PATTERN (insn), VOIDmode))
{
set = XVECEXP (PATTERN (insn), 0, 0);
first = REGNO (SET_SRC (set));
@@ -5118,9 +5059,31 @@ s390_optimize_prolog (bool base_used, bool temp_used)
if (GET_CODE (base) != REG || off < 0)
continue;
- if (first > BASE_REGISTER && first > RETURN_REGNUM)
+ if (first > BASE_REGISTER || last < BASE_REGISTER)
continue;
- if (last < BASE_REGISTER && last < RETURN_REGNUM)
+
+ if (save_first != -1)
+ {
+ new_insn = save_gprs (base, off, save_first, save_last);
+ new_insn = emit_insn_before (new_insn, insn);
+ INSN_ADDRESSES_NEW (new_insn, -1);
+ }
+
+ remove_insn (insn);
+ continue;
+ }
+
+ if (GET_CODE (PATTERN (insn)) == SET
+ && GET_CODE (SET_SRC (PATTERN (insn))) == REG
+ && REGNO (SET_SRC (PATTERN (insn))) == BASE_REGISTER
+ && GET_CODE (SET_DEST (PATTERN (insn))) == MEM)
+ {
+ set = PATTERN (insn);
+ offset = const0_rtx;
+ base = eliminate_constant_term (XEXP (SET_DEST (set), 0), &offset);
+ off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD;
+
+ if (GET_CODE (base) != REG || off < 0)
continue;
if (save_first != -1)
@@ -5131,9 +5094,11 @@ s390_optimize_prolog (bool base_used, bool temp_used)
}
remove_insn (insn);
+ continue;
}
- if (load_multiple_operation (PATTERN (insn), VOIDmode))
+ if (GET_CODE (PATTERN (insn)) == PARALLEL
+ && load_multiple_operation (PATTERN (insn), VOIDmode))
{
set = XVECEXP (PATTERN (insn), 0, 0);
first = REGNO (SET_DEST (set));
@@ -5144,9 +5109,31 @@ s390_optimize_prolog (bool base_used, bool temp_used)
if (GET_CODE (base) != REG || off < 0)
continue;
- if (first > BASE_REGISTER && first > RETURN_REGNUM)
+ if (first > BASE_REGISTER || last < BASE_REGISTER)
continue;
- if (last < BASE_REGISTER && last < RETURN_REGNUM)
+
+ if (restore_first != -1)
+ {
+ new_insn = restore_gprs (base, off, restore_first, restore_last);
+ new_insn = emit_insn_before (new_insn, insn);
+ INSN_ADDRESSES_NEW (new_insn, -1);
+ }
+
+ remove_insn (insn);
+ continue;
+ }
+
+ if (GET_CODE (PATTERN (insn)) == SET
+ && GET_CODE (SET_DEST (PATTERN (insn))) == REG
+ && REGNO (SET_DEST (PATTERN (insn))) == BASE_REGISTER
+ && GET_CODE (SET_SRC (PATTERN (insn))) == MEM)
+ {
+ set = PATTERN (insn);
+ offset = const0_rtx;
+ base = eliminate_constant_term (XEXP (SET_SRC (set), 0), &offset);
+ off = INTVAL (offset) - BASE_REGISTER * UNITS_PER_WORD;
+
+ if (GET_CODE (base) != REG || off < 0)
continue;
if (restore_first != -1)
@@ -5157,6 +5144,7 @@ s390_optimize_prolog (bool base_used, bool temp_used)
}
remove_insn (insn);
+ continue;
}
}
}
@@ -5166,9 +5154,7 @@ s390_optimize_prolog (bool base_used, bool temp_used)
static void
s390_reorg (void)
{
- rtx temp_reg = gen_rtx_REG (Pmode, RETURN_REGNUM);
rtx base_reg = gen_rtx_REG (Pmode, BASE_REGISTER);
- bool temp_used = false;
bool base_used = false;
bool pool_overflow = false;
@@ -5234,8 +5220,9 @@ s390_reorg (void)
/* Split out-of-range branches. If this has created new
literal pool entries, cancel current chunk list and
- recompute it. */
- if (s390_split_branches (temp_reg, &temp_used))
+ recompute it. zSeries machines have large branch
+ instructions, so we never need to split a branch. */
+ if (!TARGET_CPU_ZARCH && s390_split_branches ())
{
if (pool_overflow)
s390_chunkify_cancel (pool);
@@ -5259,7 +5246,7 @@ s390_reorg (void)
break;
}
- s390_optimize_prolog (base_used, temp_used);
+ s390_optimize_prolog (base_used);
}
@@ -5305,7 +5292,6 @@ find_unused_clobbered_reg (void)
static void
s390_frame_info (void)
{
- char gprs_ever_live[16];
int i, j;
HOST_WIDE_INT fsize = get_frame_size ();
@@ -5332,31 +5318,42 @@ s390_frame_info (void)
|| current_function_stdarg)
cfun->machine->frame_size += STARTING_FRAME_OFFSET;
+ /* If we use the return register, we'll need to make sure
+ it is going to be saved/restored. */
+
+ if (!current_function_is_leaf
+ || regs_ever_live[RETURN_REGNUM])
+ cfun->machine->save_return_addr_p = 1;
+
/* Find first and last gpr to be saved. Note that at this point,
- we assume the return register and the base register always
- need to be saved. This is done because the usage of these
+ we assume the base register and -on S/390- the return register
+ always need to be saved. This is done because the usage of these
register might change even after the prolog was emitted.
If it turns out later that we really don't need them, the
prolog/epilog code is modified again. */
- for (i = 0; i < 16; i++)
- gprs_ever_live[i] = regs_ever_live[i] && !global_regs[i];
-
- if (flag_pic)
- gprs_ever_live[PIC_OFFSET_TABLE_REGNUM] =
- regs_ever_live[PIC_OFFSET_TABLE_REGNUM];
- gprs_ever_live[BASE_REGISTER] = 1;
- gprs_ever_live[RETURN_REGNUM] = 1;
- gprs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0;
+ regs_ever_live[BASE_REGISTER] = 1;
+ if (!TARGET_CPU_ZARCH || cfun->machine->save_return_addr_p)
+ regs_ever_live[RETURN_REGNUM] = 1;
+ regs_ever_live[STACK_POINTER_REGNUM] = cfun->machine->frame_size > 0;
for (i = 6; i < 16; i++)
- if (gprs_ever_live[i])
- break;
+ if (regs_ever_live[i])
+ if (!global_regs[i]
+ || i == STACK_POINTER_REGNUM
+ || i == RETURN_REGNUM
+ || i == BASE_REGISTER
+ || (flag_pic && i == (int)PIC_OFFSET_TABLE_REGNUM))
+ break;
for (j = 15; j > i; j--)
- if (gprs_ever_live[j])
- break;
-
+ if (regs_ever_live[j])
+ if (!global_regs[j]
+ || j == STACK_POINTER_REGNUM
+ || j == RETURN_REGNUM
+ || j == BASE_REGISTER
+ || (flag_pic && j == (int)PIC_OFFSET_TABLE_REGNUM))
+ break;
/* Save / Restore from gpr i to j. */
cfun->machine->first_save_gpr = i;
@@ -5648,7 +5645,7 @@ s390_emit_prologue (void)
}
else
{
- if (!CONST_OK_FOR_LETTER_P (INTVAL (frame_off), 'K'))
+ if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K"))
frame_off = force_const_mem (Pmode, frame_off);
insn = emit_insn (gen_add2_insn (stack_pointer_rtx, frame_off));
@@ -5843,7 +5840,7 @@ s390_emit_epilogue (void)
}
else
{
- if (!CONST_OK_FOR_LETTER_P (INTVAL (frame_off), 'K'))
+ if (!CONST_OK_FOR_CONSTRAINT_P (INTVAL (frame_off), 'K', "K"))
frame_off = force_const_mem (Pmode, frame_off);
insn = emit_insn (gen_add2_insn (frame_pointer, frame_off));
@@ -5907,7 +5904,9 @@ s390_emit_epilogue (void)
/* Fetch return address from stack before load multiple,
this will do good for scheduling. */
- if (!current_function_is_leaf)
+ if (cfun->machine->save_return_addr_p
+ || (cfun->machine->first_restore_gpr < BASE_REGISTER
+ && cfun->machine->last_save_gpr > RETURN_REGNUM))
{
int return_regnum = find_unused_clobbered_reg();
if (!return_regnum)
@@ -5967,6 +5966,10 @@ s390_function_arg_size (enum machine_mode mode, tree type)
static bool
s390_function_arg_float (enum machine_mode mode, tree type)
{
+ int size = s390_function_arg_size (mode, type);
+ if (size > 8)
+ return false;
+
/* Soft-float changes the ABI: no floating-point registers are used. */
if (TARGET_SOFT_FLOAT)
return false;
@@ -6001,6 +6004,39 @@ s390_function_arg_float (enum machine_mode mode, tree type)
return TREE_CODE (type) == REAL_TYPE;
}
+/* Return true if a function argument of type TYPE and mode MODE
+ is to be passed in an integer register, or a pair of integer
+ registers, if available. */
+
+static bool
+s390_function_arg_integer (enum machine_mode mode, tree type)
+{
+ int size = s390_function_arg_size (mode, type);
+ if (size > 8)
+ return false;
+
+ /* No type info available for some library calls ... */
+ if (!type)
+ return GET_MODE_CLASS (mode) == MODE_INT
+ || (TARGET_SOFT_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT);
+
+ /* We accept small integral (and similar) types. */
+ if (INTEGRAL_TYPE_P (type)
+ || POINTER_TYPE_P (type)
+ || TREE_CODE (type) == OFFSET_TYPE
+ || (TARGET_SOFT_FLOAT && TREE_CODE (type) == REAL_TYPE))
+ return true;
+
+ /* We also accept structs of size 1, 2, 4, 8 that are not
+ passed in floating-point registers. */
+ if (AGGREGATE_TYPE_P (type)
+ && exact_log2 (size) >= 0
+ && !s390_function_arg_float (mode, type))
+ return true;
+
+ return false;
+}
+
/* 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,
@@ -6011,15 +6047,16 @@ int
s390_function_arg_pass_by_reference (enum machine_mode mode, tree type)
{
int size = s390_function_arg_size (mode, type);
+ if (size > 8)
+ return true;
if (type)
{
- if (AGGREGATE_TYPE_P (type) &&
- size != 1 && size != 2 && size != 4 && size != 8
- && !s390_function_arg_float (mode, type))
+ if (AGGREGATE_TYPE_P (type) && exact_log2 (size) < 0)
return 1;
- if (TREE_CODE (type) == COMPLEX_TYPE)
+ if (TREE_CODE (type) == COMPLEX_TYPE
+ || TREE_CODE (type) == VECTOR_TYPE)
return 1;
}
@@ -6044,11 +6081,13 @@ s390_function_arg_advance (CUMULATIVE_ARGS *cum, enum machine_mode mode,
{
cum->fprs += 1;
}
- else
+ else if (s390_function_arg_integer (mode, type))
{
int size = s390_function_arg_size (mode, type);
cum->gprs += ((size + UNITS_PER_WORD-1) / UNITS_PER_WORD);
}
+ else
+ abort ();
}
/* Define where to put the arguments to a function.
@@ -6084,7 +6123,7 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
else
return gen_rtx (REG, mode, cum->fprs + 16);
}
- else
+ else if (s390_function_arg_integer (mode, type))
{
int size = s390_function_arg_size (mode, type);
int n_gprs = (size + UNITS_PER_WORD-1) / UNITS_PER_WORD;
@@ -6094,6 +6133,68 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
else
return gen_rtx (REG, mode, cum->gprs + 2);
}
+
+ /* After the real arguments, expand_call calls us once again
+ with a void_type_node type. Whatever we return here is
+ passed as operand 2 to the call expanders.
+
+ We don't need this feature ... */
+ else if (type == void_type_node)
+ return const0_rtx;
+
+ abort ();
+}
+
+/* Return true if return values of type TYPE should be returned
+ in a memory buffer whose address is passed by the caller as
+ hidden first argument. */
+
+static bool
+s390_return_in_memory (tree type, tree fundecl ATTRIBUTE_UNUSED)
+{
+ /* We accept small integral (and similar) types. */
+ if (INTEGRAL_TYPE_P (type)
+ || POINTER_TYPE_P (type)
+ || TREE_CODE (type) == OFFSET_TYPE
+ || TREE_CODE (type) == REAL_TYPE)
+ return int_size_in_bytes (type) > 8;
+
+ /* Aggregates and similar constructs are always returned
+ in memory. */
+ if (AGGREGATE_TYPE_P (type)
+ || TREE_CODE (type) == COMPLEX_TYPE
+ || TREE_CODE (type) == VECTOR_TYPE)
+ return true;
+
+ /* ??? We get called on all sorts of random stuff from
+ aggregate_value_p. We can't abort, but it's not clear
+ what's safe to return. Pretend it's a struct I guess. */
+ return true;
+}
+
+/* Define where to return a (scalar) value of type TYPE.
+ If TYPE is null, define where to return a (scalar)
+ value of mode MODE from a libcall. */
+
+rtx
+s390_function_value (tree type, enum machine_mode mode)
+{
+ if (type)
+ {
+ int unsignedp = TREE_UNSIGNED (type);
+ mode = promote_mode (type, TYPE_MODE (type), &unsignedp, 1);
+ }
+
+ if (GET_MODE_CLASS (mode) != MODE_INT
+ && GET_MODE_CLASS (mode) != MODE_FLOAT)
+ abort ();
+ if (GET_MODE_SIZE (mode) > 8)
+ abort ();
+
+ if (TARGET_HARD_FLOAT && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ return gen_rtx_REG (mode, 16);
+ else
+ return gen_rtx_REG (mode, 2);
}
@@ -6107,7 +6208,6 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
long __fpr;
void *__overflow_arg_area;
void *__reg_save_area;
-
} va_list[1];
where __gpr and __fpr hold the number of general purpose
@@ -6119,8 +6219,8 @@ s390_function_arg (CUMULATIVE_ARGS *cum, enum machine_mode mode, tree type,
saves all registers used for argument passing into this
area if the function uses variable arguments. */
-tree
-s390_build_va_list (void)
+static tree
+s390_build_builtin_va_list (void)
{
tree f_gpr, f_fpr, f_ovf, f_sav, record, type_decl;
@@ -6749,9 +6849,9 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
{
/* Setup literal pool pointer if required. */
if ((!DISP_IN_RANGE (delta)
- && !CONST_OK_FOR_LETTER_P (delta, 'K'))
+ && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K"))
|| (!DISP_IN_RANGE (vcall_offset)
- && !CONST_OK_FOR_LETTER_P (vcall_offset, 'K')))
+ && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")))
{
op[5] = gen_label_rtx ();
output_asm_insn ("larl\t%4,%5", op);
@@ -6760,11 +6860,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
/* Add DELTA to this pointer. */
if (delta)
{
- if (CONST_OK_FOR_LETTER_P (delta, 'J'))
+ if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J"))
output_asm_insn ("la\t%1,%2(%1)", op);
else if (DISP_IN_RANGE (delta))
output_asm_insn ("lay\t%1,%2(%1)", op);
- else if (CONST_OK_FOR_LETTER_P (delta, 'K'))
+ else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K"))
output_asm_insn ("aghi\t%1,%2", op);
else
{
@@ -6781,7 +6881,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("lg\t%4,0(%1)", op);
output_asm_insn ("ag\t%1,%3(%4)", op);
}
- else if (CONST_OK_FOR_LETTER_P (vcall_offset, 'K'))
+ else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))
{
output_asm_insn ("lghi\t%4,%3", op);
output_asm_insn ("ag\t%4,0(%1)", op);
@@ -6824,9 +6924,9 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
/* Setup base pointer if required. */
if (!vcall_offset
|| (!DISP_IN_RANGE (delta)
- && !CONST_OK_FOR_LETTER_P (delta, 'K'))
+ && !CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K"))
|| (!DISP_IN_RANGE (delta)
- && !CONST_OK_FOR_LETTER_P (vcall_offset, 'K')))
+ && !CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K")))
{
op[5] = gen_label_rtx ();
output_asm_insn ("basr\t%4,0", op);
@@ -6837,11 +6937,11 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
/* Add DELTA to this pointer. */
if (delta)
{
- if (CONST_OK_FOR_LETTER_P (delta, 'J'))
+ if (CONST_OK_FOR_CONSTRAINT_P (delta, 'J', "J"))
output_asm_insn ("la\t%1,%2(%1)", op);
else if (DISP_IN_RANGE (delta))
output_asm_insn ("lay\t%1,%2(%1)", op);
- else if (CONST_OK_FOR_LETTER_P (delta, 'K'))
+ else if (CONST_OK_FOR_CONSTRAINT_P (delta, 'K', "K"))
output_asm_insn ("ahi\t%1,%2", op);
else
{
@@ -6853,7 +6953,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
/* Perform vcall adjustment. */
if (vcall_offset)
{
- if (CONST_OK_FOR_LETTER_P (vcall_offset, 'J'))
+ if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'J', "J"))
{
output_asm_insn ("lg\t%4,0(%1)", op);
output_asm_insn ("a\t%1,%3(%4)", op);
@@ -6863,7 +6963,7 @@ s390_output_mi_thunk (FILE *file, tree thunk ATTRIBUTE_UNUSED,
output_asm_insn ("lg\t%4,0(%1)", op);
output_asm_insn ("ay\t%1,%3(%4)", op);
}
- else if (CONST_OK_FOR_LETTER_P (vcall_offset, 'K'))
+ else if (CONST_OK_FOR_CONSTRAINT_P (vcall_offset, 'K', "K"))
{
output_asm_insn ("lhi\t%4,%3", op);
output_asm_insn ("a\t%4,0(%1)", op);
diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h
index 1463b5035b6..cbe02d657f8 100644
--- a/gcc/config/s390/s390.h
+++ b/gcc/config/s390/s390.h
@@ -313,7 +313,7 @@ if (INTEGRAL_MODE_P (MODE) && \
GPRs 6-15 are always call-saved.
GPR 12 is fixed if used as GOT pointer.
GPR 13 is always fixed (as literal pool pointer).
- GPR 14 is always fixed (as return address).
+ GPR 14 is always fixed on S/390 machines (as return address).
GPR 15 is always fixed (as stack pointer).
The 'fake' hard registers are call-clobbered and fixed.
@@ -364,6 +364,11 @@ do \
fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
} \
+ if (TARGET_CPU_ZARCH) \
+ { \
+ fixed_regs[RETURN_REGNUM] = 0; \
+ call_used_regs[RETURN_REGNUM] = 0; \
+ } \
if (TARGET_64BIT) \
{ \
for (i = 24; i < 32; i++) \
@@ -378,7 +383,7 @@ do \
/* Preferred register allocation order. */
#define REG_ALLOC_ORDER \
-{ 1, 2, 3, 4, 5, 0, 14, 13, 12, 11, 10, 9, 8, 7, 6, \
+{ 1, 2, 3, 4, 5, 0, 13, 12, 11, 10, 9, 8, 7, 6, 14, \
16, 17, 18, 19, 20, 21, 22, 23, \
24, 25, 26, 27, 28, 29, 30, 31, \
15, 32, 33, 34 }
@@ -531,21 +536,20 @@ extern const enum reg_class regclass_map[FIRST_PSEUDO_REGISTER];
(C) == 'd' ? GENERAL_REGS : \
(C) == 'f' ? FP_REGS : NO_REGS)
-#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)
+#define CONST_OK_FOR_CONSTRAINT_P(VALUE, C, STR) \
+ s390_const_ok_for_constraint_p ((VALUE), (C), (STR))
-#define CONST_DOUBLE_OK_FOR_LETTER_P(VALUE, C) 1
+#define CONST_DOUBLE_OK_FOR_CONSTRAINT_P(VALUE, C, STR) 1
-#define EXTRA_CONSTRAINT(OP, C) \
- s390_extra_constraint ((OP), (C))
+#define EXTRA_CONSTRAINT_STR(OP, C, STR) \
+ s390_extra_constraint_str ((OP), (C), (STR))
#define EXTRA_MEMORY_CONSTRAINT(C, STR) \
((C) == 'Q' || (C) == 'R' || (C) == 'S' || (C) == 'T')
#define EXTRA_ADDRESS_CONSTRAINT(C, STR) \
((C) == 'U' || (C) == 'W' || (C) == 'Y')
+#define CONSTRAINT_LEN(C, STR) \
+ ((C) == 'N' ? 5 : DEFAULT_CONSTRAINT_LEN ((C), (STR)))
/* Stack layout and calling conventions. */
@@ -702,34 +706,15 @@ CUMULATIVE_ARGS;
/* Scalar return values. */
-/* We return scalars in general purpose register 2 for integral values,
- and floating point register 0 for fp values. */
-#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 RET_REG(MODE) ((GET_MODE_CLASS (MODE) == MODE_INT \
- || TARGET_SOFT_FLOAT ) ? 2 : 16)
-#define LIBCALL_VALUE(MODE) gen_rtx (REG, MODE, RET_REG (MODE))
+#define FUNCTION_VALUE(VALTYPE, FUNC) \
+ s390_function_value ((VALTYPE), VOIDmode)
+
+#define LIBCALL_VALUE(MODE) \
+ s390_function_value (NULL, (MODE))
/* Only gpr 2 and fpr 0 are ever used as return registers. */
#define FUNCTION_VALUE_REGNO_P(N) ((N) == 2 || (N) == 16)
-
-/* Aggregate return values. */
-
-/* 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)
-
/* Structure value address is passed as invisible first argument (gpr 2). */
#define STRUCT_VALUE 0
@@ -750,9 +735,6 @@ CUMULATIVE_ARGS;
/* Implementing the varargs macros. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = s390_build_va_list ()
-
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
s390_va_start (valist, nextarg)
diff --git a/gcc/config/s390/s390.md b/gcc/config/s390/s390.md
index 7cf926e5cae..215848b9f1d 100644
--- a/gcc/config/s390/s390.md
+++ b/gcc/config/s390/s390.md
@@ -28,17 +28,42 @@
;; 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.
+;; L -- Value appropriate as displacement.
+;; (0..4095) for short displacement
+;; (-524288..524287) for long displacement
+;; M -- Constant integer with a value of 0x7fffffff.
+;; N -- Multiple letter constraint followed by 4 parameter letters.
+;; 0..9: number of the part counting from most to least significant
+;; H,Q: mode of the part
+;; D,S,H: mode of the containing operand
+;; 0,F: value of the other parts (F - all bits set)
+;;
+;; The constraint matches if the specified part of a constant
+;; has a value different from its other parts.
+;; Q -- Memory reference without index register and with short displacement.
+;; R -- Memory reference with index register and short displacement.
+;; S -- Memory reference without index register but with long displacement.
+;; T -- Memory reference with index register and long displacement.
+;; U -- Pointer with short displacement.
+;; W -- Pointer with long displacement.
+;; Y -- Shift count operand.
;;
;; 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)).
+;; %C: print opcode suffix for branch condition.
+;; %D: print opcode suffix for inverse branch condition.
+;; %J: print tls_load/tls_gdcall/tls_ldcall suffix
+;; %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 an unsigned byte.
+;; %x: print integer X as if it's an unsigned word.
+;; %h: print integer X as if it's a signed word.
+;; %i: print the first nonzero HImode part of X
+;; %j: print the first HImode part unequal to 0xffff of X
+
;;
;; We have a special constraint for pattern matching.
;;
@@ -79,6 +104,9 @@
(UNSPEC_TP 510)
(UNSPEC_TLSLDM_NTPOFF 511)
(UNSPEC_TLS_LOAD 512)
+
+ ; String Functions
+ (UNSPEC_SRST 600)
])
;;
@@ -430,10 +458,10 @@
(match_operand:DI 1 "immediate_operand" "n,n"))
(match_operand:DI 2 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
- && s390_single_qi (operands[1], DImode, 0) >= 0"
+ && s390_single_part (operands[1], DImode, QImode, 0) >= 0"
{
- int part = s390_single_qi (operands[1], DImode, 0);
- operands[1] = GEN_INT (s390_extract_qi (operands[1], DImode, part));
+ int part = s390_single_part (operands[1], DImode, QImode, 0);
+ operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
@@ -447,10 +475,10 @@
(match_operand:SI 1 "immediate_operand" "n,n"))
(match_operand:SI 2 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
- && s390_single_qi (operands[1], SImode, 0) >= 0"
+ && s390_single_part (operands[1], SImode, QImode, 0) >= 0"
{
- int part = s390_single_qi (operands[1], SImode, 0);
- operands[1] = GEN_INT (s390_extract_qi (operands[1], SImode, part));
+ int part = s390_single_part (operands[1], SImode, QImode, 0);
+ operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
@@ -464,10 +492,10 @@
(match_operand:SI 1 "immediate_operand" "n,n"))
(match_operand:SI 2 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 0))
- && s390_single_qi (operands[1], HImode, 0) >= 0"
+ && s390_single_part (operands[1], HImode, QImode, 0) >= 0"
{
- int part = s390_single_qi (operands[1], HImode, 0);
- operands[1] = GEN_INT (s390_extract_qi (operands[1], HImode, part));
+ int part = s390_single_part (operands[1], HImode, QImode, 0);
+ operands[1] = GEN_INT (s390_extract_part (operands[1], QImode, 0));
operands[0] = gen_rtx_MEM (QImode,
plus_constant (XEXP (operands[0], 0), part));
@@ -488,45 +516,30 @@
(define_insn "*tmdi_reg"
[(set (reg 33)
- (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d")
- (match_operand:DI 1 "immediate_operand" "n"))
- (match_operand:DI 2 "immediate_operand" "n")))]
+ (compare (and:DI (match_operand:DI 0 "nonimmediate_operand" "d,d,d,d")
+ (match_operand:DI 1 "immediate_operand"
+ "N0HD0,N1HD0,N2HD0,N3HD0"))
+ (match_operand:DI 2 "immediate_operand" "n,n,n,n")))]
"TARGET_64BIT
&& s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
- && s390_single_hi (operands[1], DImode, 0) >= 0"
-{
- int part = s390_single_hi (operands[1], DImode, 0);
- operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part));
-
- switch (part)
- {
- case 0: return "tmhh\t%0,%x1";
- case 1: return "tmhl\t%0,%x1";
- case 2: return "tmlh\t%0,%x1";
- case 3: return "tmll\t%0,%x1";
- default: abort ();
- }
-}
+ && s390_single_part (operands[1], DImode, HImode, 0) >= 0"
+ "@
+ tmhh\t%0,%i1
+ tmhl\t%0,%i1
+ tmlh\t%0,%i1
+ tmll\t%0,%i1"
[(set_attr "op_type" "RI")])
(define_insn "*tmsi_reg"
[(set (reg 33)
- (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d")
- (match_operand:SI 1 "immediate_operand" "n"))
- (match_operand:SI 2 "immediate_operand" "n")))]
+ (compare (and:SI (match_operand:SI 0 "nonimmediate_operand" "d,d")
+ (match_operand:SI 1 "immediate_operand" "N0HS0,N1HS0"))
+ (match_operand:SI 2 "immediate_operand" "n,n")))]
"s390_match_ccmode (insn, s390_tm_ccmode (operands[1], operands[2], 1))
- && s390_single_hi (operands[1], SImode, 0) >= 0"
-{
- int part = s390_single_hi (operands[1], SImode, 0);
- operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part));
-
- switch (part)
- {
- case 0: return "tmh\t%0,%x1";
- case 1: return "tml\t%0,%x1";
- default: abort ();
- }
-}
+ && s390_single_part (operands[1], SImode, HImode, 0) >= 0"
+ "@
+ tmh\t%0,%i1
+ tml\t%0,%i1"
[(set_attr "op_type" "RI")])
(define_insn "*tmhi_full"
@@ -1039,47 +1052,6 @@
operands[1] = force_const_mem (DImode, operands[1]);
})
-(define_insn "*movdi_lhi"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (match_operand:DI 1 "immediate_operand" "K"))]
- "TARGET_64BIT
- && GET_CODE (operands[1]) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
- && !FP_REG_P (operands[0])"
- "lghi\t%0,%h1"
- [(set_attr "op_type" "RI")])
-
-(define_insn "*movdi_lli"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (match_operand:DI 1 "immediate_operand" "n"))]
- "TARGET_64BIT && s390_single_hi (operands[1], DImode, 0) >= 0
- && !FP_REG_P (operands[0])"
-{
- int part = s390_single_hi (operands[1], DImode, 0);
- operands[1] = GEN_INT (s390_extract_hi (operands[1], DImode, part));
-
- switch (part)
- {
- case 0: return "llihh\t%0,%x1";
- case 1: return "llihl\t%0,%x1";
- case 2: return "llilh\t%0,%x1";
- case 3: return "llill\t%0,%x1";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
-
-(define_insn "*movdi_lay"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (match_operand:DI 1 "address_operand" "p"))]
- "TARGET_64BIT
- && TARGET_LONG_DISPLACEMENT
- && GET_CODE (operands[1]) == CONST_INT
- && !FP_REG_P (operands[0])"
- "lay\t%0,%a1"
- [(set_attr "op_type" "RXY")
- (set_attr "type" "la")])
-
(define_insn "*movdi_larl"
[(set (match_operand:DI 0 "register_operand" "=d")
(match_operand:DI 1 "larl_operand" "X"))]
@@ -1090,10 +1062,18 @@
(set_attr "type" "larl")])
(define_insn "*movdi_64"
- [(set (match_operand:DI 0 "nonimmediate_operand" "=d,d,m,!*f,!*f,!*f,!R,!T,?Q")
- (match_operand:DI 1 "general_operand" "d,m,d,*f,R,T,*f,*f,?Q"))]
+ [(set (match_operand:DI 0 "nonimmediate_operand"
+ "=d,d,d,d,d,d,d,d,m,!*f,!*f,!*f,!R,!T,?Q")
+ (match_operand:DI 1 "general_operand"
+ "K,N0HD0,N1HD0,N2HD0,N3HD0,L,d,m,d,*f,R,T,*f,*f,?Q"))]
"TARGET_64BIT"
"@
+ lghi\t%0,%h1
+ llihh\t%0,%i1
+ llihl\t%0,%i1
+ llilh\t%0,%i1
+ llill\t%0,%i1
+ lay\t%0,%a1
lgr\t%0,%1
lg\t%0,%1
stg\t%1,%0
@@ -1103,8 +1083,9 @@
std\t%1,%0
stdy\t%1,%0
mvc\t%O0(8,%R0),%1"
- [(set_attr "op_type" "RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
- (set_attr "type" "lr,load,store,floadd,floadd,floadd,fstored,fstored,cs")])
+ [(set_attr "op_type" "RI,RI,RI,RI,RI,RXY,RRE,RXY,RXY,RR,RX,RXY,RX,RXY,SS")
+ (set_attr "type" "*,*,*,*,*,la,lr,load,store,floadd,floadd,floadd,
+ fstored,fstored,cs")])
(define_insn "*movdi_31"
[(set (match_operand:DI 0 "nonimmediate_operand" "=d,Q,d,o,!*f,!*f,!*f,!R,!T,Q")
@@ -1224,43 +1205,6 @@
operands[1] = force_const_mem (SImode, operands[1]);
})
-(define_insn "*movsi_lhi"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (match_operand:SI 1 "immediate_operand" "K"))]
- "GET_CODE (operands[1]) == CONST_INT
- && CONST_OK_FOR_LETTER_P (INTVAL (operands[1]), 'K')
- && !FP_REG_P (operands[0])"
- "lhi\t%0,%h1"
- [(set_attr "op_type" "RI")])
-
-(define_insn "*movsi_lli"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (match_operand:SI 1 "immediate_operand" "n"))]
- "TARGET_ZARCH && s390_single_hi (operands[1], SImode, 0) >= 0
- && !FP_REG_P (operands[0])"
-{
- int part = s390_single_hi (operands[1], SImode, 0);
- operands[1] = GEN_INT (s390_extract_hi (operands[1], SImode, part));
-
- switch (part)
- {
- case 0: return "llilh\t%0,%x1";
- case 1: return "llill\t%0,%x1";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
-
-(define_insn "*movsi_lay"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (match_operand:SI 1 "address_operand" "p"))]
- "TARGET_LONG_DISPLACEMENT
- && GET_CODE (operands[1]) == CONST_INT
- && !FP_REG_P (operands[0])"
- "lay\t%0,%a1"
- [(set_attr "op_type" "RXY")
- (set_attr "type" "la")])
-
(define_insn "*movsi_larl"
[(set (match_operand:SI 0 "register_operand" "=d")
(match_operand:SI 1 "larl_operand" "X"))]
@@ -1270,11 +1214,17 @@
[(set_attr "op_type" "RIL")
(set_attr "type" "larl")])
-(define_insn "*movsi"
- [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
- (match_operand:SI 1 "general_operand" "d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
- ""
+(define_insn "*movsi_zarch"
+ [(set (match_operand:SI 0 "nonimmediate_operand"
+ "=d,d,d,d,d,d,d,R,T,!*f,!*f,!*f,!R,!T,?Q")
+ (match_operand:SI 1 "general_operand"
+ "K,N0HS0,N1HS0,L,d,R,T,d,d,*f,R,T,*f,*f,?Q"))]
+ "TARGET_ZARCH"
"@
+ lhi\t%0,%h1
+ llilh\t%0,%i1
+ llill\t%0,%i1
+ lay\t%0,%a1
lr\t%0,%1
l\t%0,%1
ly\t%0,%1
@@ -1286,8 +1236,24 @@
ste\t%1,%0
stey\t%1,%0
mvc\t%O0(4,%R0),%1"
- [(set_attr "op_type" "RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
- (set_attr "type" "lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
+ [(set_attr "op_type" "RI,RI,RI,RXY,RR,RX,RXY,RX,RXY,RR,RX,RXY,RX,RXY,SS")
+ (set_attr "type" "*,*,*,la,lr,load,load,store,store,floads,floads,floads,fstores,fstores,cs")])
+
+(define_insn "*movsi_esa"
+ [(set (match_operand:SI 0 "nonimmediate_operand" "=d,d,d,R,!*f,!*f,!R,?Q")
+ (match_operand:SI 1 "general_operand" "K,d,R,d,*f,R,*f,?Q"))]
+ "!TARGET_ZARCH"
+ "@
+ lhi\t%0,%h1
+ lr\t%0,%1
+ l\t%0,%1
+ st\t%1,%0
+ ler\t%0,%1
+ le\t%0,%1
+ ste\t%1,%0
+ mvc\t%O0(4,%R0),%1"
+ [(set_attr "op_type" "RI,RR,RX,RX,RR,RX,RX,SS")
+ (set_attr "type" "*,lr,load,store,floads,floads,fstores,cs")])
(define_peephole2
[(set (match_operand:SI 0 "register_operand" "")
@@ -1313,7 +1279,8 @@
always sign-extends (at least) to SImode. */
if (optimize && !no_new_pseudos
&& register_operand (operands[0], VOIDmode)
- && memory_operand (operands[1], VOIDmode))
+ && GET_CODE (operands[1]) == MEM
+ && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
{
rtx tmp = gen_reg_rtx (SImode);
rtx ext = gen_rtx_SIGN_EXTEND (SImode, operands[1]);
@@ -1360,7 +1327,8 @@
is just as fast as a QImode load. */
if (TARGET_ZARCH && optimize && !no_new_pseudos
&& register_operand (operands[0], VOIDmode)
- && memory_operand (operands[1], VOIDmode))
+ && GET_CODE (operands[1]) == MEM
+ && GET_CODE (XEXP (operands[1], 0)) != ADDRESSOF)
{
rtx tmp = gen_reg_rtx (word_mode);
rtx ext = gen_rtx_ZERO_EXTEND (word_mode, operands[1]);
@@ -1769,6 +1737,82 @@
;;
;
+; strlenM instruction pattern(s).
+;
+
+(define_expand "strlendi"
+ [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
+ (parallel
+ [(set (match_dup 4)
+ (unspec:DI [(const_int 0)
+ (match_operand:BLK 1 "memory_operand" "")
+ (reg:QI 0)
+ (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
+ (clobber (scratch:DI))
+ (clobber (reg:CC 33))])
+ (parallel
+ [(set (match_operand:DI 0 "register_operand" "")
+ (minus:DI (match_dup 4) (match_dup 5)))
+ (clobber (reg:CC 33))])]
+ "TARGET_64BIT"
+{
+ operands[4] = gen_reg_rtx (DImode);
+ operands[5] = gen_reg_rtx (DImode);
+ emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
+ operands[1] = replace_equiv_address (operands[1], operands[5]);
+})
+
+(define_insn "*strlendi"
+ [(set (match_operand:DI 0 "register_operand" "=a")
+ (unspec:DI [(match_operand:DI 2 "general_operand" "0")
+ (mem:BLK (match_operand:DI 3 "register_operand" "1"))
+ (reg:QI 0)
+ (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
+ (clobber (match_scratch:DI 1 "=a"))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "srst\t%0,%1\;jo\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "type" "vs")
+ (set_attr "length" "8")])
+
+(define_expand "strlensi"
+ [(set (reg:QI 0) (match_operand:QI 2 "immediate_operand" ""))
+ (parallel
+ [(set (match_dup 4)
+ (unspec:SI [(const_int 0)
+ (match_operand:BLK 1 "memory_operand" "")
+ (reg:QI 0)
+ (match_operand 3 "immediate_operand" "")] UNSPEC_SRST))
+ (clobber (scratch:SI))
+ (clobber (reg:CC 33))])
+ (parallel
+ [(set (match_operand:SI 0 "register_operand" "")
+ (minus:SI (match_dup 4) (match_dup 5)))
+ (clobber (reg:CC 33))])]
+ "!TARGET_64BIT"
+{
+ operands[4] = gen_reg_rtx (SImode);
+ operands[5] = gen_reg_rtx (SImode);
+ emit_move_insn (operands[5], force_operand (XEXP (operands[1], 0), NULL_RTX));
+ operands[1] = replace_equiv_address (operands[1], operands[5]);
+})
+
+(define_insn "*strlensi"
+ [(set (match_operand:SI 0 "register_operand" "=a")
+ (unspec:SI [(match_operand:SI 2 "general_operand" "0")
+ (mem:BLK (match_operand:SI 3 "register_operand" "1"))
+ (reg:QI 0)
+ (match_operand 4 "immediate_operand" "")] UNSPEC_SRST))
+ (clobber (match_scratch:SI 1 "=a"))
+ (clobber (reg:CC 33))]
+ "!TARGET_64BIT"
+ "srst\t%0,%1\;jo\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "type" "vs")
+ (set_attr "length" "8")])
+
+;
; movstrM instruction pattern(s).
;
@@ -2115,9 +2159,10 @@
(use (match_dup 2))
(use (match_dup 3))]
"TARGET_64BIT"
- "clcl\t%0,%1"
- [(set_attr "op_type" "RR")
- (set_attr "type" "vs")])
+ "clcle\t%0,%1,0\;jo\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "type" "vs")
+ (set_attr "length" "8")])
(define_insn "*cmpmem_long_31"
[(clobber (match_operand:DI 0 "register_operand" "=d"))
@@ -2128,9 +2173,10 @@
(use (match_dup 2))
(use (match_dup 3))]
"!TARGET_64BIT"
- "clcl\t%0,%1"
- [(set_attr "op_type" "RR")
- (set_attr "type" "vs")])
+ "clcle\t%0,%1,0\;jo\t.-4"
+ [(set_attr "op_type" "NN")
+ (set_attr "type" "vs")
+ (set_attr "length" "8")])
; Convert condition code to integer in range (-1, 0, 1)
@@ -2155,13 +2201,13 @@
"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 ("jh\t.+16", operands);
+ output_asm_insn ("jl\t.+8", 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 "length" "20")
(set_attr "type" "other")])
@@ -2501,14 +2547,12 @@
llgt\t%0,%1"
[(set_attr "op_type" "RRE,RXE")])
-(define_insn_and_split "*llgt_sisi_split"
- [(set (match_operand:SI 0 "register_operand" "=d,d")
- (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,m")
+(define_split
+ [(set (match_operand:SI 0 "register_operand" "")
+ (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
(const_int 2147483647)))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
+ "TARGET_64BIT && reload_completed"
[(set (match_dup 0)
(and:SI (match_dup 1)
(const_int 2147483647)))]
@@ -2524,14 +2568,12 @@
llgt\t%0,%N1"
[(set_attr "op_type" "RRE,RXE")])
-(define_insn_and_split "*llgt_didi_split"
- [(set (match_operand:DI 0 "register_operand" "=d,d")
- (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o")
+(define_split
+ [(set (match_operand:DI 0 "register_operand" "")
+ (and:DI (match_operand:DI 1 "nonimmediate_operand" "")
(const_int 2147483647)))
(clobber (reg:CC 33))]
- "TARGET_64BIT"
- "#"
- "&& reload_completed"
+ "TARGET_64BIT && reload_completed"
[(set (match_dup 0)
(and:DI (match_dup 1)
(const_int 2147483647)))]
@@ -3191,7 +3233,7 @@
(plus:DI (match_dup 1) (match_dup 2)))]
"TARGET_64BIT
&& s390_match_ccmode (insn, CCAmode)
- && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
+ && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
"aghi\t%0,%h2"
[(set_attr "op_type" "RI")])
@@ -3419,7 +3461,7 @@
(set (match_operand:SI 0 "register_operand" "=d")
(plus:SI (match_dup 1) (match_dup 2)))]
"s390_match_ccmode (insn, CCAmode)
- && CONST_OK_FOR_LETTER_P (INTVAL (operands[2]), 'K')"
+ && CONST_OK_FOR_CONSTRAINT_P (INTVAL (operands[2]), 'K', \"K\")"
"ahi\t%0,%h2"
[(set_attr "op_type" "RI")])
@@ -5007,37 +5049,23 @@
ng\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
-(define_insn "*anddi3_ni"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (and:DI (match_operand:DI 1 "nonimmediate_operand" "0")
- (match_operand:DI 2 "immediate_operand" "n")))
- (clobber (reg:CC 33))]
- "TARGET_64BIT && s390_single_hi (operands[2], DImode, -1) >= 0"
-{
- int part = s390_single_hi (operands[2], DImode, -1);
- operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
-
- switch (part)
- {
- case 0: return "nihh\t%0,%x2";
- case 1: return "nihl\t%0,%x2";
- case 2: return "nilh\t%0,%x2";
- case 3: return "nill\t%0,%x2";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
-
(define_insn "anddi3"
- [(set (match_operand:DI 0 "register_operand" "=d,d")
- (and:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
- (match_operand:DI 2 "general_operand" "d,m")))
- (clobber (reg:CC 33))]
- "TARGET_64BIT"
- "@
- ngr\t%0,%2
- ng\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d,d,d")
+ (and:DI (match_operand:DI 1 "nonimmediate_operand" "d,o,0,0,0,0,0,0")
+ (match_operand:DI 2 "general_operand"
+ "M,M,N0HDF,N1HDF,N2HDF,N3HDF,d,m")))
+ (clobber (reg:CC 33))]
+ "TARGET_64BIT"
+ "@
+ #
+ #
+ nihh\t%0,%j2
+ nihl\t%0,%j2
+ nilh\t%0,%j2
+ nill\t%0,%j2
+ ngr\t%0,%2
+ ng\t%0,%2"
+ [(set_attr "op_type" "RRE,RXE,RI,RI,RI,RI,RRE,RXY")])
(define_insn "*anddi3_ss"
[(set (match_operand:DI 0 "s_operand" "=Q")
@@ -5088,36 +5116,41 @@
ny\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
-(define_insn "*andsi3_ni"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (and:SI (match_operand:SI 1 "nonimmediate_operand" "0")
- (match_operand:SI 2 "immediate_operand" "n")))
- (clobber (reg:CC 33))]
- "TARGET_ZARCH && s390_single_hi (operands[2], SImode, -1) >= 0"
-{
- int part = s390_single_hi (operands[2], SImode, -1);
- operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
-
- switch (part)
- {
- case 0: return "nilh\t%0,%x2";
- case 1: return "nill\t%0,%x2";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
+(define_expand "andsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "register_operand" "")
+ (and:SI (match_operand:SI 1 "nonimmediate_operand" "")
+ (match_operand:SI 2 "general_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
-(define_insn "andsi3"
- [(set (match_operand:SI 0 "register_operand" "=d,d,d")
- (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
- (match_operand:SI 2 "general_operand" "d,R,T")))
+(define_insn "*andsi3_zarch"
+ [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d,d,d")
+ (and:SI (match_operand:SI 1 "nonimmediate_operand" "d,o,0,0,0,0,0")
+ (match_operand:SI 2 "general_operand" "M,M,N0HSF,N1HSF,d,R,T")))
(clobber (reg:CC 33))]
- ""
+ "TARGET_ZARCH"
"@
+ #
+ #
+ nilh\t%0,%j2
+ nill\t%0,%j2
nr\t%0,%2
n\t%0,%2
ny\t%0,%2"
- [(set_attr "op_type" "RR,RX,RXY")])
+ [(set_attr "op_type" "RRE,RXE,RI,RI,RR,RX,RXY")])
+
+(define_insn "*andsi3_esa"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (and:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0")
+ (match_operand:SI 2 "general_operand" "d,R")))
+ (clobber (reg:CC 33))]
+ "!TARGET_ZARCH"
+ "@
+ nr\t%0,%2
+ n\t%0,%2"
+ [(set_attr "op_type" "RR,RX")])
(define_insn "*andsi3_ss"
[(set (match_operand:SI 0 "s_operand" "=Q")
@@ -5261,37 +5294,20 @@
og\t%0,%2"
[(set_attr "op_type" "RRE,RXY")])
-(define_insn "*iordi3_oi"
- [(set (match_operand:DI 0 "register_operand" "=d")
- (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0")
- (match_operand:DI 2 "immediate_operand" "n")))
- (clobber (reg:CC 33))]
- "TARGET_64BIT && s390_single_hi (operands[2], DImode, 0) >= 0"
-{
- int part = s390_single_hi (operands[2], DImode, 0);
- operands[2] = GEN_INT (s390_extract_hi (operands[2], DImode, part));
-
- switch (part)
- {
- case 0: return "oihh\t%0,%x2";
- case 1: return "oihl\t%0,%x2";
- case 2: return "oilh\t%0,%x2";
- case 3: return "oill\t%0,%x2";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
-
(define_insn "iordi3"
- [(set (match_operand:DI 0 "register_operand" "=d,d")
- (ior:DI (match_operand:DI 1 "nonimmediate_operand" "%0,0")
- (match_operand:DI 2 "general_operand" "d,m")))
+ [(set (match_operand:DI 0 "register_operand" "=d,d,d,d,d,d")
+ (ior:DI (match_operand:DI 1 "nonimmediate_operand" "0,0,0,0,0,0")
+ (match_operand:DI 2 "general_operand" "N0HD0,N1HD0,N2HD0,N3HD0,d,m")))
(clobber (reg:CC 33))]
"TARGET_64BIT"
"@
+ oihh\t%0,%i2
+ oihl\t%0,%i2
+ oilh\t%0,%i2
+ oill\t%0,%i2
ogr\t%0,%2
og\t%0,%2"
- [(set_attr "op_type" "RRE,RXY")])
+ [(set_attr "op_type" "RI,RI,RI,RI,RRE,RXY")])
(define_insn "*iordi3_ss"
[(set (match_operand:DI 0 "s_operand" "=Q")
@@ -5342,36 +5358,39 @@
oy\t%0,%2"
[(set_attr "op_type" "RR,RX,RXY")])
-(define_insn "*iorsi3_oi"
- [(set (match_operand:SI 0 "register_operand" "=d")
- (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0")
- (match_operand:SI 2 "immediate_operand" "n")))
- (clobber (reg:CC 33))]
- "TARGET_ZARCH && s390_single_hi (operands[2], SImode, 0) >= 0"
-{
- int part = s390_single_hi (operands[2], SImode, 0);
- operands[2] = GEN_INT (s390_extract_hi (operands[2], SImode, part));
-
- switch (part)
- {
- case 0: return "oilh\t%0,%x2";
- case 1: return "oill\t%0,%x2";
- default: abort ();
- }
-}
- [(set_attr "op_type" "RI")])
+(define_expand "iorsi3"
+ [(parallel
+ [(set (match_operand:SI 0 "register_operand" "")
+ (ior:SI (match_operand:SI 1 "nonimmediate_operand" "")
+ (match_operand:SI 2 "general_operand" "")))
+ (clobber (reg:CC 33))])]
+ ""
+ "")
-(define_insn "iorsi3"
- [(set (match_operand:SI 0 "register_operand" "=d,d,d")
- (ior:SI (match_operand:SI 1 "nonimmediate_operand" "%0,0,0")
- (match_operand:SI 2 "general_operand" "d,R,T")))
+(define_insn "iorsi3_zarch"
+ [(set (match_operand:SI 0 "register_operand" "=d,d,d,d,d")
+ (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0,0,0,0")
+ (match_operand:SI 2 "general_operand" "N0HS0,N1HS0,d,R,T")))
(clobber (reg:CC 33))]
- ""
+ "TARGET_ZARCH"
"@
+ oilh\t%0,%i2
+ oill\t%0,%i2
or\t%0,%2
o\t%0,%2
oy\t%0,%2"
- [(set_attr "op_type" "RR,RX,RXY")])
+ [(set_attr "op_type" "RI,RI,RR,RX,RXY")])
+
+(define_insn "iorsi3_esa"
+ [(set (match_operand:SI 0 "register_operand" "=d,d")
+ (ior:SI (match_operand:SI 1 "nonimmediate_operand" "0,0")
+ (match_operand:SI 2 "general_operand" "d,R")))
+ (clobber (reg:CC 33))]
+ "!TARGET_ZARCH"
+ "@
+ or\t%0,%2
+ o\t%0,%2"
+ [(set_attr "op_type" "RR,RX")])
(define_insn "*iorsi3_ss"
[(set (match_operand:SI 0 "s_operand" "=Q")
@@ -6596,6 +6615,8 @@
return "#";
else if (get_attr_length (insn) == 4)
return "brct\t%1,%l0";
+ else if (TARGET_CPU_ZARCH)
+ return "ahi\t%1,-1\;jgne\t%l0";
else
abort ();
}
@@ -6675,37 +6696,13 @@
else if (get_attr_length (insn) == 4)
return "brctg\t%1,%l0";
else
- abort ();
+ return "aghi\t%1,-1\;jgne\t%l0";
}
[(set_attr "op_type" "RI")
(set_attr "type" "branch")
(set (attr "length")
(if_then_else (lt (abs (minus (pc) (match_dup 0))) (const_int 60000))
- (const_int 4) (const_int 12)))])
-
-(define_insn "*doloop_di_long"
- [(set (pc)
- (if_then_else
- (ne (match_operand:DI 1 "register_operand" "d,d")
- (const_int 1))
- (match_operand 0 "address_operand" "U,U")
- (pc)))
- (set (match_operand:DI 2 "register_operand" "=1,?*m*d")
- (plus:DI (match_dup 1) (const_int -1)))
- (clobber (match_scratch:DI 3 "=X,&d"))
- (clobber (reg:CC 33))]
- ""
-{
- if (get_attr_op_type (insn) == OP_TYPE_RRE)
- return "bctgr\t%1,%0";
- else
- return "bctg\t%1,%a0";
-}
- [(set (attr "op_type")
- (if_then_else (match_operand 0 "register_operand" "")
- (const_string "RRE") (const_string "RXE")))
- (set_attr "type" "branch")
- (set_attr "atype" "agen")])
+ (const_int 4) (const_int 10)))])
(define_split
[(set (pc)
@@ -7499,7 +7496,7 @@
;; Instruction definition to extend a 31-bit pointer into a 64-bit
-;; pointer. This is used for compatability.
+;; pointer. This is used for compatibility.
(define_expand "ptr_extend"
[(set (match_operand:DI 0 "register_operand" "=r")
diff --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
index da423516b16..d28e0c24680 100644
--- a/gcc/config/sh/linux.h
+++ b/gcc/config/sh/linux.h
@@ -57,6 +57,8 @@ do { \
builtin_define_std ("unix"); \
builtin_define ("__gnu_linux__"); \
builtin_define_std ("linux"); \
+ builtin_assert ("system=linux"); \
+ builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} while (0)
diff --git a/gcc/config/sh/netbsd-elf.h b/gcc/config/sh/netbsd-elf.h
index a9c2cb58e6f..975feb0f7dd 100644
--- a/gcc/config/sh/netbsd-elf.h
+++ b/gcc/config/sh/netbsd-elf.h
@@ -93,6 +93,8 @@ Boston, MA 02111-1307, USA. */
#define TARGET_DEFAULT \
(TARGET_CPU_DEFAULT | USERMODE_BIT | TARGET_ENDIAN_DEFAULT)
+/* Define because we use the label and we do not need them. */
+#define NO_PROFILE_COUNTERS
#undef FUNCTION_PROFILER
#define FUNCTION_PROFILER(STREAM,LABELNO) \
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index 81501b07d4b..ec723bda127 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -97,16 +97,13 @@ extern int sh_insn_length_adjustment (rtx);
extern int sh_can_redirect_branch (rtx, rtx);
extern void sh_expand_unop_v2sf (enum rtx_code, rtx, rtx);
extern void sh_expand_binop_v2sf (enum rtx_code, rtx, rtx, rtx);
+extern int sh_expand_t_scc (enum rtx_code code, rtx target);
#ifdef TREE_CODE
extern void sh_va_start (tree, rtx);
extern rtx sh_va_arg (tree, tree);
#endif /* TREE_CODE */
#endif /* RTX_CODE */
-#ifdef TREE_CODE
-extern tree sh_build_va_list (void);
-#endif /* TREE_CODE */
-
extern const char *output_jump_label_table (void);
extern int sh_handle_pragma (int (*)(void), void (*)(int), const char *);
extern struct rtx_def *get_fpscr_rtx (void);
@@ -142,5 +139,6 @@ extern rtx sh_get_pr_initial_val (void);
extern rtx sh_function_arg (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern void sh_function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree, int);
extern int sh_pass_in_reg_p (CUMULATIVE_ARGS *, enum machine_mode, tree);
+extern const char *sh_pch_valid_p (const void *data_p, size_t sz);
#endif /* ! GCC_SH_PROTOS_H */
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 4207719dc44..0015f7029a4 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -48,6 +48,7 @@ Boston, MA 02111-1307, USA. */
#include "basic-block.h"
#include "ra.h"
#include "cfglayout.h"
+#include "intl.h"
int code_for_indirect_jump_scratch = CODE_FOR_indirect_jump_scratch;
@@ -246,6 +247,7 @@ static rtx sh_builtin_saveregs (void);
static void sh_setup_incoming_varargs (CUMULATIVE_ARGS *, enum machine_mode, tree, int *, int);
static bool sh_strict_argument_naming (CUMULATIVE_ARGS *);
static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
+static tree sh_build_builtin_va_list (void);
/* Initialize the GCC target structure. */
@@ -345,6 +347,12 @@ static bool sh_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
#undef TARGET_PRETEND_OUTGOING_VARARGS_NAMED
#define TARGET_PRETEND_OUTGOING_VARARGS_NAMED sh_pretend_outgoing_varargs_named
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST sh_build_builtin_va_list
+
+#undef TARGET_PCH_VALID_P
+#define TARGET_PCH_VALID_P sh_pch_valid_p
+
struct gcc_target targetm = TARGET_INITIALIZER;
/* Print the operand address in x to the stream. */
@@ -5911,8 +5919,8 @@ sh_builtin_saveregs (void)
/* Define the `__builtin_va_list' type for the ABI. */
-tree
-sh_build_va_list (void)
+static tree
+sh_build_builtin_va_list (void)
{
tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack;
tree record;
@@ -5921,7 +5929,7 @@ sh_build_va_list (void)
|| TARGET_HITACHI || sh_cfun_attr_renesas_p ())
return ptr_type_node;
- record = make_node (RECORD_TYPE);
+ record = (*lang_hooks.types.make_type) (RECORD_TYPE);
f_next_o = build_decl (FIELD_DECL, get_identifier ("__va_next_o"),
ptr_type_node);
@@ -6833,6 +6841,90 @@ sh_cfun_interrupt_handler_p (void)
DECL_ATTRIBUTES (current_function_decl))
!= NULL_TREE);
}
+
+/* ??? target_switches in toplev.c is static, hence we have to duplicate it. */
+static const struct
+{
+ const char *const name;
+ const int value;
+ const char *const description;
+}
+sh_target_switches[] = TARGET_SWITCHES;
+#define target_switches sh_target_switches
+
+/* Like default_pch_valid_p, but take flag_mask into account. */
+const char *
+sh_pch_valid_p (const void *data_p, size_t len)
+{
+ const char *data = (const char *)data_p;
+ const char *flag_that_differs = NULL;
+ size_t i;
+ int old_flags;
+ int flag_mask
+ = (SH1_BIT | SH2_BIT | SH3_BIT | SH_E_BIT | HARD_SH4_BIT | FPU_SINGLE_BIT
+ | SH4_BIT | HITACHI_BIT | LITTLE_ENDIAN_BIT);
+
+ /* -fpic and -fpie also usually make a PCH invalid. */
+ if (data[0] != flag_pic)
+ return _("created and used with different settings of -fpic");
+ if (data[1] != flag_pie)
+ return _("created and used with different settings of -fpie");
+ data += 2;
+
+ /* Check target_flags. */
+ memcpy (&old_flags, data, sizeof (target_flags));
+ if (((old_flags ^ target_flags) & flag_mask) != 0)
+ {
+ for (i = 0; i < ARRAY_SIZE (target_switches); i++)
+ {
+ int bits;
+
+ bits = target_switches[i].value;
+ if (bits < 0)
+ bits = -bits;
+ bits &= flag_mask;
+ if ((target_flags & bits) != (old_flags & bits))
+ {
+ flag_that_differs = target_switches[i].name;
+ goto make_message;
+ }
+ }
+ abort ();
+ }
+ data += sizeof (target_flags);
+ len -= sizeof (target_flags);
+
+ /* Check string options. */
+#ifdef TARGET_OPTIONS
+ for (i = 0; i < ARRAY_SIZE (target_options); i++)
+ {
+ const char *str = *target_options[i].variable;
+ size_t l;
+ if (! str)
+ str = "";
+ l = strlen (str) + 1;
+ if (len < l || memcmp (data, str, l) != 0)
+ {
+ flag_that_differs = target_options[i].prefix;
+ goto make_message;
+ }
+ data += l;
+ len -= l;
+ }
+#endif
+
+ return NULL;
+
+ make_message:
+ {
+ char *r;
+ asprintf (&r, _("created and used with differing settings of `-m%s'"),
+ flag_that_differs);
+ if (r == NULL)
+ return _("out of memory");
+ return r;
+ }
+}
/* Predicates used by the templates. */
@@ -8806,6 +8898,15 @@ sh_register_operand (rtx op, enum machine_mode mode)
return register_operand (op, mode);
}
+int
+cmpsi_operand (rtx op, enum machine_mode mode)
+{
+ if (GET_CODE (op) == REG && REGNO (op) == T_REG
+ && GET_MODE (op) == SImode)
+ return 1;
+ return arith_operand (op, mode);
+}
+
static rtx emit_load_ptr (rtx, rtx);
static rtx
@@ -9037,4 +9138,33 @@ sh_get_pr_initial_val (void)
return val;
}
+int
+sh_expand_t_scc (enum rtx_code code, rtx target)
+{
+ rtx result = target;
+ HOST_WIDE_INT val;
+
+ if (GET_CODE (sh_compare_op0) != REG || REGNO (sh_compare_op0) != T_REG
+ || GET_CODE (sh_compare_op1) != CONST_INT)
+ return 0;
+ if (GET_CODE (result) != REG)
+ result = gen_reg_rtx (SImode);
+ val = INTVAL (sh_compare_op1);
+ if ((code == EQ && val == 1) || (code == NE && val == 0))
+ emit_insn (gen_movt (result));
+ else if ((code == EQ && val == 0) || (code == NE && val == 1))
+ {
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, result));
+ emit_insn (gen_subc (result, result, result));
+ emit_insn (gen_addsi3 (result, result, GEN_INT (1)));
+ }
+ else if (code == EQ || code == NE)
+ emit_insn (gen_move_insn (result, GEN_INT (code == NE)));
+ else
+ return 0;
+ if (result != target)
+ emit_move_insn (target, result);
+ return 1;
+}
+
#include "gt-sh.h"
diff --git a/gcc/config/sh/sh.h b/gcc/config/sh/sh.h
index 4ccff4b3531..9c73b9e714d 100644
--- a/gcc/config/sh/sh.h
+++ b/gcc/config/sh/sh.h
@@ -2033,10 +2033,6 @@ struct sh_args {
/* Perform any needed actions needed for a function that is receiving a
variable number of arguments. */
-/* Define the `__builtin_va_list' type for the ABI. */
-#define BUILD_VA_LIST_TYPE(VALIST) \
- (VALIST) = sh_build_va_list ()
-
/* Implement `va_start' for varargs and stdarg. */
#define EXPAND_BUILTIN_VA_START(valist, nextarg) \
sh_va_start (valist, nextarg)
@@ -2879,7 +2875,7 @@ struct sh_args {
used to use the encodings 245..260, but that doesn't make sense:
PR_REG and PR_MEDIA_REG are actually the same register, and likewise
the FP registers stay the same when switching between compact and media
- mode. Hence, we also need to use the same dwarf frame coloumns.
+ mode. Hence, we also need to use the same dwarf frame columns.
Likewise, we need to support unwind information for SHmedia registers
even in compact code. */
#define SH_DBX_REGISTER_NUMBER(REGNO) \
@@ -3149,6 +3145,7 @@ extern int rtx_equal_function_value_matters;
{"arith_reg_or_0_operand", {SUBREG, REG, CONST_INT, CONST_VECTOR}}, \
{"binary_float_operator", {PLUS, MINUS, MULT, DIV}}, \
{"binary_logical_operator", {AND, IOR, XOR}}, \
+ {"cmpsi_operand", {SUBREG, REG, CONST_INT}}, \
{"commutative_float_operator", {PLUS, MULT}}, \
{"equality_comparison_operator", {EQ,NE}}, \
{"extend_reg_operand", {SUBREG, REG, TRUNCATE}}, \
@@ -3246,7 +3243,8 @@ extern int rtx_equal_function_value_matters;
: FP_MODE_NONE)
#define MODE_AFTER(MODE, INSN) \
- (recog_memoized (INSN) >= 0 \
+ (TARGET_HITACHI \
+ && recog_memoized (INSN) >= 0 \
&& get_attr_fp_set (INSN) != FP_SET_NONE \
? get_attr_fp_set (INSN) \
: (MODE))
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index bad8c66edc9..aa63209dbf6 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -705,11 +705,14 @@
(define_expand "cmpsi"
[(set (reg:SI T_REG)
- (compare (match_operand:SI 0 "arith_operand" "")
+ (compare (match_operand:SI 0 "cmpsi_operand" "")
(match_operand:SI 1 "arith_operand" "")))]
"TARGET_SH1"
"
{
+ if (GET_CODE (operands[0]) == REG && REGNO (operands[0]) == T_REG
+ && GET_CODE (operands[1]) != CONST_INT)
+ operands[0] = copy_to_mode_reg (SImode, operands[0]);
sh_compare_op0 = operands[0];
sh_compare_op1 = operands[1];
DONE;
@@ -1167,7 +1170,9 @@
(match_operand:SI 2 "arith_reg_operand" "r"))
(reg:SI T_REG)))
(set (reg:SI T_REG)
- (gtu:SI (minus:SI (match_dup 1) (match_dup 2)) (match_dup 1)))]
+ (gtu:SI (minus:SI (minus:SI (match_dup 1) (match_dup 2))
+ (reg:SI T_REG))
+ (match_dup 1)))]
"TARGET_SH1"
"subc %2,%0"
[(set_attr "type" "arith")])
@@ -3163,7 +3168,7 @@
(define_expand "extendhisi2"
[(set (match_operand:SI 0 "arith_reg_operand" "=r,r")
- (sign_extend:SI (match_operand:HI 1 "general_extend_operand" "r,m")))]
+ (sign_extend:SI (match_operand:HI 1 "general_extend_operand" "r,m")))]
""
"")
@@ -3173,7 +3178,7 @@
"TARGET_SH1"
"@
exts.w %1,%0
- mov.w %1,%0"
+ mov.w %1,%0"
[(set_attr "type" "arith,load")])
(define_insn "*extendhisi2_media"
@@ -3277,7 +3282,7 @@
(truncate:QI (match_operand:DI 1 "register_operand" "r,r")))]
"TARGET_SHMEDIA"
"@
- and %1, 255, %0
+ andi %1, 255, %0
st%M0.b %m0, %1"
[(set_attr "type" "arith_media,store")])
@@ -4395,7 +4400,7 @@
[(set (match_operand:SF 0 "register_operand" "")
(match_operand:SF 1 "register_operand" ""))
(use (match_operand:PSI 2 "fpscr_operand" ""))
- (clobber (match_scratch:SI 3 "X"))]
+ (clobber (match_scratch:SI 3 ""))]
"TARGET_SH2E && reload_completed
&& true_regnum (operands[0]) == true_regnum (operands[1])"
[(set (match_dup 0) (match_dup 0))]
@@ -4406,7 +4411,7 @@
[(set (match_operand:DF 0 "register_operand" "")
(match_operand:DF 1 "register_operand" ""))
(use (match_operand:PSI 2 "fpscr_operand" ""))
- (clobber (match_scratch:SI 3 "X"))]
+ (clobber (match_scratch:SI 3 ""))]
"TARGET_SH4 && ! TARGET_FMOVD && reload_completed
&& FP_OR_XD_REGISTER_P (true_regnum (operands[0]))
&& FP_OR_XD_REGISTER_P (true_regnum (operands[1]))"
@@ -4801,7 +4806,7 @@
i * GET_MODE_SIZE (V2SFmode)));
else
{
- x = gen_rtx_SUBREG (V2SFmode, operands[0], i * 2);
+ x = gen_rtx_SUBREG (V2SFmode, operands[0], i * 8);
alter_subreg (&x);
}
@@ -4811,7 +4816,7 @@
i * GET_MODE_SIZE (V2SFmode)));
else
{
- y = gen_rtx_SUBREG (V2SFmode, operands[1], i * 2);
+ y = gen_rtx_SUBREG (V2SFmode, operands[1], i * 8);
alter_subreg (&y);
}
@@ -7446,6 +7451,10 @@ mov.l\\t1f,r0\\n\\
}
DONE;
}
+ if (sh_expand_t_scc (EQ, operands[0]))
+ DONE;
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (EQ);
}")
@@ -7492,6 +7501,8 @@ mov.l\\t1f,r0\\n\\
}
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (LT);
}")
@@ -7594,6 +7605,8 @@ mov.l\\t1f,r0\\n\\
}
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (GT);
}")
@@ -7646,6 +7659,8 @@ mov.l\\t1f,r0\\n\\
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
{
if (TARGET_IEEE)
@@ -7685,6 +7700,8 @@ mov.l\\t1f,r0\\n\\
sh_compare_op0, sh_compare_op1));
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (GTU);
}")
@@ -7709,6 +7726,8 @@ mov.l\\t1f,r0\\n\\
sh_compare_op1, sh_compare_op0));
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (LTU);
}")
@@ -7738,6 +7757,8 @@ mov.l\\t1f,r0\\n\\
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (LEU);
}")
@@ -7768,6 +7789,8 @@ mov.l\\t1f,r0\\n\\
DONE;
}
+ if (! rtx_equal_function_value_matters)
+ FAIL;
operands[1] = prepare_scc_operands (GEU);
}")
@@ -7815,8 +7838,12 @@ mov.l\\t1f,r0\\n\\
DONE;
}
- operands[1] = prepare_scc_operands (EQ);
- operands[2] = gen_reg_rtx (SImode);
+ if (sh_expand_t_scc (NE, operands[0]))
+ DONE;
+ if (! rtx_equal_function_value_matters)
+ FAIL;
+ operands[1] = prepare_scc_operands (EQ);
+ operands[2] = gen_reg_rtx (SImode);
}")
(define_expand "sunordered"
@@ -9450,9 +9477,10 @@ mov.l\\t1f,r0\\n\\
if (unit_size < 2)
{
if (GET_CODE (operands[1]) == CONST_INT && GET_CODE (elt1) == CONST_INT)
- operands[1] = GEN_INT (TARGET_LITTLE_ENDIAN
- ? INTVAL (operands[1]) + (INTVAL (elt1) << 8)
- : (INTVAL (operands[1]) << 8) + INTVAL (elt1));
+ operands[1]
+ = GEN_INT (TARGET_LITTLE_ENDIAN
+ ? (INTVAL (operands[1]) & 0xff) + (INTVAL (elt1) << 8)
+ : (INTVAL (operands[1]) << 8) + (INTVAL (elt1) & 0xff));
else
{
operands[0] = gen_rtx_REG (V2QImode, true_regnum (operands[0]));
@@ -10560,7 +10588,7 @@ mov.l\\t1f,r0\\n\\
(vec_select:SF (mult:V4SF (match_dup 1) (match_dup 2))
(parallel [(const_int 3)])))))]
"TARGET_SHMEDIA"
- "fipr %1, %2, %0"
+ "fipr.s %1, %2, %0"
[(set_attr "type" "fparith_media")])
(define_insn "fsrra_s"
@@ -10586,7 +10614,7 @@ mov.l\\t1f,r0\\n\\
(const_int 14) (const_int 3)]))
(vec_select:V4SF (match_dup 2)
(parallel [(const_int 1) (const_int 2)
- (const_int 3) (const_int 0)]))))
+ (const_int 3) (const_int 0)]))))
(plus:V4SF
(mult:V4SF
(vec_select:V4SF (match_dup 1)
@@ -10603,7 +10631,7 @@ mov.l\\t1f,r0\\n\\
(parallel [(const_int 3) (const_int 0)
(const_int 1) (const_int 2)]))))))]
"TARGET_SHMEDIA"
- "ftrv %1, %2, %0"
+ "ftrv.s %1, %2, %0"
[(set_attr "type" "fparith_media")])
(define_insn "nsb"
@@ -10689,6 +10717,19 @@ mov.l\\t1f,r0\\n\\
"byterev %1, %0"
[(set_attr "type" "arith_media")])
+(define_insn "prefetch"
+ [(prefetch (match_operand:QI 0 "address_operand" "p")
+ (match_operand:SI 1 "const_int_operand" "n")
+ (match_operand:SI 2 "const_int_operand" "n"))]
+ "TARGET_SHMEDIA"
+ "*
+{
+ operands[0] = gen_rtx_MEM (QImode, operands[0]);
+ output_asm_insn (\"ld%M0.b %m0,r63\", operands);
+ return \"\";
+}"
+ [(set_attr "type" "other")])
+
;; The following description models the
;; SH4 pipeline using the DFA based scheduler.
;; The DFA based description is better way to model
diff --git a/gcc/config/sol2.h b/gcc/config/sol2.h
index 49dc1ce2ae4..8728cb79274 100644
--- a/gcc/config/sol2.h
+++ b/gcc/config/sol2.h
@@ -119,8 +119,8 @@ Boston, MA 02111-1307, USA. */
#undef STARTFILE_ARCH_SPEC
#define STARTFILE_ARCH_SPEC STARTFILE_ARCH32_SPEC
-#undef LINK_ARCH32_SPEC
-#define LINK_ARCH32_SPEC \
+#undef LINK_ARCH32_SPEC_BASE
+#define LINK_ARCH32_SPEC_BASE \
"%{G:-G} \
%{YP,*} \
%{R*} \
@@ -132,6 +132,9 @@ Boston, MA 02111-1307, USA. */
%{!YP,*:%{p|pg:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
%{!p:%{!pg:-Y P,/usr/ccs/lib:/usr/lib}}}}"
+#undef LINK_ARCH32_SPEC
+#define LINK_ARCH32_SPEC LINK_ARCH32_SPEC_BASE
+
#undef LINK_ARCH_SPEC
#define LINK_ARCH_SPEC LINK_ARCH32_SPEC
diff --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
index ac1cc12ad3b..8af7c5a0259 100644
--- a/gcc/config/sparc/linux.h
+++ b/gcc/config/sparc/linux.h
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("unix"); \
builtin_define_std ("linux"); \
builtin_define ("__gnu_linux__"); \
+ builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} \
diff --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
index c7c45dcdd98..2969880edad 100644
--- a/gcc/config/sparc/linux64.h
+++ b/gcc/config/sparc/linux64.h
@@ -26,6 +26,7 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("linux"); \
builtin_define ("_LONGLONG"); \
builtin_define ("__gnu_linux__"); \
+ builtin_assert ("system=linux"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=posix"); \
} \
@@ -264,10 +265,6 @@ Boston, MA 02111-1307, USA. */
#undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(REGNO) (REGNO)
-/* System V Release 4 uses DWARF debugging info. Buf DWARF1 doesn't do
- 64-bit anything, so we use DWARF2. */
-
-#undef DWARF_DEBUGGING_INFO
#define DWARF2_DEBUGGING_INFO 1
#define DBX_DEBUGGING_INFO 1
diff --git a/gcc/config/sparc/liteelf.h b/gcc/config/sparc/liteelf.h
index b33690727b3..49a2089b211 100644
--- a/gcc/config/sparc/liteelf.h
+++ b/gcc/config/sparc/liteelf.h
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
/* Default to dwarf2 in ELF. */
-#define DWARF_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
diff --git a/gcc/config/sparc/sol2-bi.h b/gcc/config/sparc/sol2-bi.h
index 7b6ee855272..0a763748d85 100644
--- a/gcc/config/sparc/sol2-bi.h
+++ b/gcc/config/sparc/sol2-bi.h
@@ -133,7 +133,7 @@
* This should be the same as in sol2.h, except with "/sparcv9"
* appended to the paths and /usr/ccs/lib is no longer necessary
*/
-#define LINK_ARCH64_SPEC \
+#define LINK_ARCH64_SPEC_BASE \
"%{mcmodel=medlow:-M /usr/lib/ld/sparcv9/map.below4G} \
%{G:-G} \
%{YP,*} \
@@ -146,12 +146,30 @@
%{!YP,*:%{p|pg:-Y P,/usr/lib/libp/sparcv9:/usr/lib/sparcv9} \
%{!p:%{!pg:-Y P,/usr/lib/sparcv9}}}}"
+#define LINK_ARCH64_SPEC LINK_ARCH64_SPEC_BASE
+
#undef LINK_ARCH_SPEC
+#if DISABLE_MULTILIB
+#if DEFAULT_ARCH32_P
+#define LINK_ARCH_SPEC "\
+%{m32:%(link_arch32)} \
+%{m64:%edoes not support multilib} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+#else
+#define LINK_ARCH_SPEC "\
+%{m32:%edoes not support multilib} \
+%{m64:%(link_arch64)} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+#endif
+#else
#define LINK_ARCH_SPEC "\
%{m32:%(link_arch32)} \
%{m64:%(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
+#endif
#define LINK_ARCH_DEFAULT_SPEC \
(DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
diff --git a/gcc/config/sparc/sol2-gld-bi.h b/gcc/config/sparc/sol2-gld-bi.h
index eab63a9a7c7..aa9a40bdfcb 100644
--- a/gcc/config/sparc/sol2-gld-bi.h
+++ b/gcc/config/sparc/sol2-gld-bi.h
@@ -1,9 +1,34 @@
/* Definitions of target machine for GCC, for bi-arch SPARC
running Solaris 2 using the GNU linker. */
+#undef LINK_ARCH32_SPEC
+#define LINK_ARCH32_SPEC \
+ LINK_ARCH32_SPEC_BASE "%{!static: -rpath-link %R/usr/lib}"
+
+#undef LINK_ARCH64_SPEC
+#define LINK_ARCH64_SPEC \
+ LINK_ARCH64_SPEC_BASE "%{!static: -rpath-link %R/usr/lib/sparcv9}"
+
#undef LINK_ARCH_SPEC
+#if DISABLE_MULTILIB
+#if DEFAULT_ARCH32_P
#define LINK_ARCH_SPEC "\
%{m32:-m elf32_sparc %(link_arch32)} \
+%{m64:%edoes not support multilib} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+#else
+#define LINK_ARCH_SPEC "\
+%{m32:%edoes not support multilib} \
%{m64:-m elf64_sparc %(link_arch64)} \
%{!m32:%{!m64:%(link_arch_default)}} \
"
+#endif
+#else
+#define LINK_ARCH_SPEC "\
+%{m32:-m elf32_sparc %(link_arch32)} \
+%{m64:-m elf64_sparc %(link_arch64)} \
+%{!m32:%{!m64:%(link_arch_default)}} \
+"
+#endif
+
diff --git a/gcc/config/sparc/sol2-gld.h b/gcc/config/sparc/sol2-gld.h
index aed94e5c475..eb422cb8667 100644
--- a/gcc/config/sparc/sol2-gld.h
+++ b/gcc/config/sparc/sol2-gld.h
@@ -4,3 +4,6 @@
/* Undefine this so that attribute((init_priority)) works. */
#undef CTORS_SECTION_ASM_OP
#undef DTORS_SECTION_ASM_OP
+
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 1
diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h
index 47204f4710e..53c364daade 100644
--- a/gcc/config/sparc/sol2.h
+++ b/gcc/config/sparc/sol2.h
@@ -98,6 +98,10 @@ Boston, MA 02111-1307, USA. */
#define ASM_PREFERRED_EH_DATA_FORMAT(CODE,GLOBAL) \
((flag_pic || GLOBAL) ? DW_EH_PE_aligned : DW_EH_PE_absptr)
#endif
+
+/* The Solaris linker doesn't understand constructor priorities. */
+#undef SUPPORTS_INIT_PRIORITY
+#define SUPPORTS_INIT_PRIORITY 0
/* ??? This does not work in SunOS 4.x, so it is not enabled in sparc.h.
Instead, it is enabled here, because it does work under Solaris. */
diff --git a/gcc/config/sparc/sol26-sld.h b/gcc/config/sparc/sol26-sld.h
index 74b54335011..2e7fed9424c 100644
--- a/gcc/config/sparc/sol26-sld.h
+++ b/gcc/config/sparc/sol26-sld.h
@@ -1,6 +1,5 @@
-/* Up through Solaris 2.6, the system linker does not work with DWARF
- or DWARF2, since it does not have working support for relocations
- to unaligned data. */
+/* Up through Solaris 2.6, the system linker does not work with DWARF2
+ since it does not have working support for relocations to unaligned
+ data. */
-#undef DWARF_DEBUGGING_INFO
#undef DWARF2_DEBUGGING_INFO
diff --git a/gcc/config/sparc/sp86x-elf.h b/gcc/config/sparc/sp86x-elf.h
index 04ed624cf72..593400d0dd2 100644
--- a/gcc/config/sparc/sp86x-elf.h
+++ b/gcc/config/sparc/sp86x-elf.h
@@ -29,7 +29,6 @@ Boston, MA 02111-1307, USA. */
/* Default to dwarf2 in ELF. */
-#define DWARF_DEBUGGING_INFO 1
#define DWARF2_DEBUGGING_INFO 1
#undef PREFERRED_DEBUGGING_TYPE
diff --git a/gcc/config/sparc/sparc-protos.h b/gcc/config/sparc/sparc-protos.h
index 4b9582d96b8..12c5d2d8969 100644
--- a/gcc/config/sparc/sparc-protos.h
+++ b/gcc/config/sparc/sparc-protos.h
@@ -1,7 +1,7 @@
-/* Prototypes of target machine for GCC, for Sun SPARC.
- Copyright (C) 1999, 2000 Free Software Foundation, Inc.
+/* Prototypes of target machine for SPARC.
+ Copyright (C) 1999, 2000, 2003 Free Software Foundation, Inc.
Contributed by Michael Tiemann (tiemann@cygnus.com).
- 64 bit SPARC V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
+ 64-bit SPARC-V9 support by Michael Tiemann, Jim Wilson, and Doug Evans,
at Cygnus Support.
This file is part of GCC.
@@ -51,19 +51,15 @@ extern enum direction function_arg_padding (enum machine_mode, tree);
extern void load_pic_register (void);
extern void order_regs_for_local_alloc (void);
-extern int compute_frame_size (int, int);
+extern HOST_WIDE_INT compute_frame_size (HOST_WIDE_INT, int);
extern int check_pic (int);
extern int short_branch (int, int);
extern int sparc_flat_epilogue_delay_slots (void);
-extern unsigned long sparc_flat_compute_frame_size (int);
+extern HOST_WIDE_INT sparc_flat_compute_frame_size (HOST_WIDE_INT);
extern void sparc_profile_hook (int);
extern void sparc_override_options (void);
extern int leaf_return_peephole_ok (void);
extern void sparc_output_scratch_registers (FILE *);
-extern void sparc_flat_save_restore (FILE *, const char *,
- unsigned int, unsigned long,
- unsigned long, const char *,
- const char *, unsigned long);
#ifdef RTX_CODE
extern enum machine_mode select_cc_mode (enum rtx_code, rtx, rtx);
diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 82244d8daba..a3fdcc6cdb2 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -67,8 +67,8 @@ Boston, MA 02111-1307, USA. */
scheduling (to see what can go in a delay slot).
APPARENT_FSIZE is the size of the stack less the register save area and less
the outgoing argument area. It is used when saving call preserved regs. */
-static int apparent_fsize;
-static int actual_fsize;
+static HOST_WIDE_INT apparent_fsize;
+static HOST_WIDE_INT actual_fsize;
/* Number of live general or floating point registers needed to be
saved (as 4-byte quantities). */
@@ -131,12 +131,12 @@ struct machine_function GTY(())
too big for reg+constant addressing. */
static const char *frame_base_name;
-static int frame_base_offset;
+static HOST_WIDE_INT frame_base_offset;
static void sparc_init_modes (void);
-static int save_regs (FILE *, int, int, const char *, int, int, int);
+static int save_regs (FILE *, int, int, const char *, int, int, HOST_WIDE_INT);
static int restore_regs (FILE *, int, int, const char *, int, int);
-static void build_big_number (FILE *, int, const char *);
+static void build_big_number (FILE *, HOST_WIDE_INT, const char *);
static int function_arg_slotno (const CUMULATIVE_ARGS *, enum machine_mode,
tree, int, int, int *, int *);
@@ -155,6 +155,10 @@ static void sparc_output_function_prologue (FILE *, HOST_WIDE_INT);
static void sparc_output_function_epilogue (FILE *, HOST_WIDE_INT);
static void sparc_flat_function_epilogue (FILE *, HOST_WIDE_INT);
static void sparc_flat_function_prologue (FILE *, HOST_WIDE_INT);
+static void sparc_flat_save_restore (FILE *, const char *, int,
+ unsigned long, unsigned long,
+ const char *, const char *,
+ HOST_WIDE_INT);
static void sparc_nonflat_function_epilogue (FILE *, HOST_WIDE_INT, int);
static void sparc_nonflat_function_prologue (FILE *, HOST_WIDE_INT, int);
#ifdef OBJECT_FORMAT_ELF
@@ -3994,7 +3998,7 @@ sparc_init_modes (void)
static int
save_regs (FILE *file, int low, int high, const char *base,
- int offset, int n_regs, int real_offset)
+ int offset, int n_regs, HOST_WIDE_INT real_offset)
{
int i;
@@ -4101,8 +4105,8 @@ restore_regs (FILE *file, int low, int high, const char *base,
/* Compute the frame size required by the function. This function is called
during the reload pass and also by output_function_prologue(). */
-int
-compute_frame_size (int size, int leaf_function)
+HOST_WIDE_INT
+compute_frame_size (HOST_WIDE_INT size, int leaf_function)
{
int n_regs = 0, i;
int outgoing_args_size = (current_function_outgoing_args_size
@@ -4156,32 +4160,97 @@ compute_frame_size (int size, int leaf_function)
return SPARC_STACK_ALIGN (actual_fsize);
}
-/* Build a (32 bit) big number in a register. */
-/* ??? We may be able to use the set macro here too. */
+/* Build big number NUM in register REG and output the result to FILE.
+ REG is guaranteed to be the only clobbered register. The function
+ will very likely emit several instructions, so it must not be called
+ from within a delay slot. */
static void
-build_big_number (FILE *file, int num, const char *reg)
+build_big_number (FILE *file, HOST_WIDE_INT num, const char *reg)
{
- if (num >= 0 || ! TARGET_ARCH64)
+#if HOST_BITS_PER_WIDE_INT == 64
+ HOST_WIDE_INT high_bits = (num >> 32) & 0xffffffff;
+
+ if (high_bits == 0
+#else
+ if (num >= 0
+#endif
+ || ! TARGET_ARCH64)
{
- fprintf (file, "\tsethi\t%%hi(%d), %s\n", num, reg);
+ /* We don't use the 'set' macro because it appears to be broken
+ in the Solaris 7 assembler. */
+ fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n",
+ num, reg);
if ((num & 0x3ff) != 0)
- fprintf (file, "\tor\t%s, %%lo(%d), %s\n", reg, num, reg);
+ fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n",
+ reg, num, reg);
}
+#if HOST_BITS_PER_WIDE_INT == 64
+ else if (high_bits == 0xffffffff) /* && TARGET_ARCH64 */
+#else
else /* num < 0 && TARGET_ARCH64 */
+#endif
{
/* Sethi does not sign extend, so we must use a little trickery
to use it for negative numbers. Invert the constant before
loading it in, then use xor immediate to invert the loaded bits
(along with the upper 32 bits) to the desired constant. This
works because the sethi and immediate fields overlap. */
- int asize = num;
- int inv = ~asize;
- int low = -0x400 + (asize & 0x3FF);
+ HOST_WIDE_INT inv = ~num;
+ HOST_WIDE_INT low = -0x400 + (num & 0x3ff);
- fprintf (file, "\tsethi\t%%hi(%d), %s\n\txor\t%s, %d, %s\n",
- inv, reg, reg, low, reg);
+ fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n",
+ inv, reg);
+ fprintf (file, "\txor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n",
+ reg, low, reg);
+ }
+#if HOST_BITS_PER_WIDE_INT == 64
+ else /* TARGET_ARCH64 */
+ {
+ /* We don't use the 'setx' macro because if requires a scratch register.
+ This is the translation of sparc_emit_set_const64_longway into asm.
+ Hopefully we will soon have prologue/epilogue emitted as RTL. */
+ HOST_WIDE_INT low1 = (num >> (32 - 12)) & 0xfff;
+ HOST_WIDE_INT low2 = (num >> (32 - 12 - 12)) & 0xfff;
+ HOST_WIDE_INT low3 = (num >> (32 - 12 - 12 - 8)) & 0x0ff;
+ int to_shift = 12;
+
+ /* We don't use the 'set' macro because it appears to be broken
+ in the Solaris 7 assembler. */
+ fprintf (file, "\tsethi\t%%hi("HOST_WIDE_INT_PRINT_DEC"), %s\n",
+ high_bits, reg);
+ if ((high_bits & 0x3ff) != 0)
+ fprintf (file, "\tor\t%s, %%lo("HOST_WIDE_INT_PRINT_DEC"), %s\n",
+ reg, high_bits, reg);
+
+ if (low1 != 0)
+ {
+ fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg);
+ fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n",
+ reg, low1, reg);
+ to_shift = 12;
+ }
+ else
+ {
+ to_shift += 12;
+ }
+ if (low2 != 0)
+ {
+ fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg);
+ fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n",
+ reg, low2, reg);
+ to_shift = 8;
+ }
+ else
+ {
+ to_shift += 8;
+ }
+ fprintf (file, "\tsllx\t%s, %d, %s\n", reg, to_shift, reg);
+ if (low3 != 0)
+ fprintf (file, "\tor\t%s, "HOST_WIDE_INT_PRINT_DEC", %s\n",
+ reg, low3, reg);
}
+#endif
}
/* Output any necessary .register pseudo-ops. */
@@ -4266,11 +4335,13 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size,
else if (! leaf_function)
{
if (actual_fsize <= 4096)
- fprintf (file, "\tsave\t%%sp, -%d, %%sp\n", actual_fsize);
+ fprintf (file, "\tsave\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
+ actual_fsize);
else if (actual_fsize <= 8192)
{
fprintf (file, "\tsave\t%%sp, -4096, %%sp\n");
- fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096);
+ fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
+ actual_fsize - 4096);
}
else
{
@@ -4281,11 +4352,13 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size,
else /* leaf function */
{
if (actual_fsize <= 4096)
- fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize);
+ fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
+ actual_fsize);
else if (actual_fsize <= 8192)
{
fprintf (file, "\tadd\t%%sp, -4096, %%sp\n");
- fprintf (file, "\tadd\t%%sp, -%d, %%sp\n", actual_fsize - 4096);
+ fprintf (file, "\tadd\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
+ actual_fsize - 4096);
}
else
{
@@ -4322,7 +4395,8 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size,
/* Call saved registers are saved just above the outgoing argument area. */
if (num_gfregs)
{
- int offset, real_offset, n_regs;
+ HOST_WIDE_INT offset, real_offset;
+ int n_regs;
const char *base;
real_offset = -apparent_fsize;
@@ -4356,7 +4430,8 @@ sparc_nonflat_function_prologue (FILE *file, HOST_WIDE_INT size,
static void
output_restore_regs (FILE *file, int leaf_function ATTRIBUTE_UNUSED)
{
- int offset, n_regs;
+ HOST_WIDE_INT offset;
+ int n_regs;
const char *base;
offset = -apparent_fsize + frame_base_offset;
@@ -4518,16 +4593,16 @@ sparc_nonflat_function_epilogue (FILE *file,
else if (actual_fsize == 0)
fprintf (file, "\t%s\n\tnop\n", ret);
else if (actual_fsize <= 4096)
- fprintf (file, "\t%s\n\tsub\t%%sp, -%d, %%sp\n", ret, actual_fsize);
+ fprintf (file, "\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
+ ret, actual_fsize);
else if (actual_fsize <= 8192)
- fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -%d, %%sp\n",
+ fprintf (file, "\tsub\t%%sp, -4096, %%sp\n\t%s\n\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n",
ret, actual_fsize - 4096);
- else if ((actual_fsize & 0x3ff) == 0)
- fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n",
- actual_fsize, ret);
- else
- fprintf (file, "\tsethi\t%%hi(%d), %%g1\n\tor\t%%g1, %%lo(%d), %%g1\n\t%s\n\tadd\t%%sp, %%g1, %%sp\n",
- actual_fsize, actual_fsize, ret);
+ else
+ {
+ build_big_number (file, actual_fsize, "%g1");
+ fprintf (file, "\t%s\n\tadd\t%%sp, %%g1, %%sp\n", ret);
+ }
output_vectors:
sparc_output_deferred_case_vectors ();
@@ -4575,7 +4650,7 @@ output_sibcall (rtx insn, rtx call_operand)
#else
int spare_slot = ((TARGET_ARCH32 || TARGET_CM_MEDLOW) && ! flag_pic);
#endif
- int size = 0;
+ HOST_WIDE_INT size = 0;
if ((actual_fsize || ! spare_slot) && delay_slot)
{
@@ -4598,15 +4673,9 @@ output_sibcall (rtx insn, rtx call_operand)
fputs ("\tsub\t%sp, -4096, %sp\n", asm_out_file);
size = actual_fsize - 4096;
}
- else if ((actual_fsize & 0x3ff) == 0)
- fprintf (asm_out_file,
- "\tsethi\t%%hi(%d), %%g1\n\tadd\t%%sp, %%g1, %%sp\n",
- actual_fsize);
else
{
- fprintf (asm_out_file,
- "\tsethi\t%%hi(%d), %%g1\n\tor\t%%g1, %%lo(%d), %%g1\n",
- actual_fsize, actual_fsize);
+ build_big_number (asm_out_file, actual_fsize, "%g1");
fputs ("\tadd\t%%sp, %%g1, %%sp\n", asm_out_file);
}
}
@@ -4615,14 +4684,14 @@ output_sibcall (rtx insn, rtx call_operand)
output_asm_insn ("sethi\t%%hi(%a0), %%g1", operands);
output_asm_insn ("jmpl\t%%g1 + %%lo(%a0), %%g0", operands);
if (size)
- fprintf (asm_out_file, "\t sub\t%%sp, -%d, %%sp\n", size);
+ fprintf (asm_out_file, "\t sub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size);
else if (! delay_slot)
fputs ("\t nop\n", asm_out_file);
}
else
{
if (size)
- fprintf (asm_out_file, "\tsub\t%%sp, -%d, %%sp\n", size);
+ fprintf (asm_out_file, "\tsub\t%%sp, -"HOST_WIDE_INT_PRINT_DEC", %%sp\n", size);
/* Use or with rs2 %%g0 instead of mov, so that as/ld can optimize
it into branch if possible. */
output_asm_insn ("or\t%%o7, %%g0, %%g1", operands);
@@ -5433,9 +5502,15 @@ function_arg_partial_nregs (const struct sparc_args *cum,
|| (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT
&& ! (TARGET_FPU && named)))
{
+ /* The complex types are passed as packed types. */
+ if (GET_MODE_SIZE (mode) <= UNITS_PER_WORD)
+ return 0;
+
if (GET_MODE_ALIGNMENT (mode) == 128)
{
slotno += slotno & 1;
+
+ /* ??? The mode needs 3 slots? */
if (slotno == SPARC_INT_ARG_MAX - 2)
return 1;
}
@@ -5476,7 +5551,8 @@ function_arg_pass_by_reference (const struct sparc_args *cum ATTRIBUTE_UNUSED,
else
{
return ((type && TREE_CODE (type) == ARRAY_TYPE)
- /* Consider complex values as aggregates, so care for TCmode. */
+ /* Consider complex values as aggregates, so care
+ for CTImode and TCmode. */
|| GET_MODE_SIZE (mode) > 16
|| (type
&& AGGREGATE_TYPE_P (type)
@@ -5521,14 +5597,6 @@ function_arg_advance (struct sparc_args *cum, enum machine_mode mode,
else /* passed by reference */
++cum->words;
}
- else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_INT)
- {
- cum->words += 2;
- }
- else if (GET_MODE_CLASS (mode) == MODE_COMPLEX_FLOAT)
- {
- cum->words += GET_MODE_SIZE (mode) / UNITS_PER_WORD;
- }
else
{
cum->words += (mode != BLKmode
@@ -5661,17 +5729,19 @@ sparc_va_arg (tree valist, tree type)
if (TYPE_ALIGN (type) >= 2 * (unsigned) BITS_PER_WORD)
align = 2 * UNITS_PER_WORD;
- if (AGGREGATE_TYPE_P (type))
+ /* Consider complex values as aggregates, so care
+ for CTImode and TCmode. */
+ if ((unsigned HOST_WIDE_INT) size > 16)
{
- if ((unsigned HOST_WIDE_INT) size > 16)
- {
- indirect = 1;
- size = rsize = UNITS_PER_WORD;
- align = 0;
- }
- /* SPARC v9 ABI states that structures up to 8 bytes in size are
- given one 8 byte slot. */
- else if (size == 0)
+ indirect = 1;
+ size = rsize = UNITS_PER_WORD;
+ align = 0;
+ }
+ else if (AGGREGATE_TYPE_P (type))
+ {
+ /* SPARC-V9 ABI states that structures up to 16 bytes in size
+ are given whole slots as needed. */
+ if (size == 0)
size = rsize = UNITS_PER_WORD;
else
size = rsize;
@@ -6529,7 +6599,7 @@ mems_ok_for_ldd_peep (rtx mem1, rtx mem2, rtx dependent_reg_rtx)
{
rtx addr1, addr2;
unsigned int reg1;
- int offset1;
+ HOST_WIDE_INT offset1;
/* The mems cannot be volatile. */
if (MEM_VOLATILE_P (mem1) || MEM_VOLATILE_P (mem2))
@@ -6651,7 +6721,7 @@ print_operand (FILE *file, rtx x, int code)
/* Print out what we are using as the frame pointer. This might
be %fp, or might be %sp+offset. */
/* ??? What if offset is too big? Perhaps the caller knows it isn't? */
- fprintf (file, "%s+%d", frame_base_name, frame_base_offset);
+ fprintf (file, "%s+"HOST_WIDE_INT_PRINT_DEC, frame_base_name, frame_base_offset);
return;
case '&':
/* Print some local dynamic TLS name. */
@@ -7086,7 +7156,7 @@ sparc_type_code (register tree type)
void
sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
{
- /* SPARC 32 bit trampoline:
+ /* SPARC 32-bit trampoline:
sethi %hi(fn), %g1
sethi %hi(static), %g2
@@ -7096,10 +7166,6 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
SETHI i,r = 00rr rrr1 00ii iiii iiii iiii iiii iiii
JMPL r+i,d = 10dd ddd1 1100 0rrr rr1i iiii iiii iiii
*/
-#ifdef TRANSFER_FROM_TRAMPOLINE
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
-#endif
emit_move_insn
(gen_rtx_MEM (SImode, plus_constant (tramp, 0)),
@@ -7138,21 +7204,25 @@ sparc_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
&& sparc_cpu != PROCESSOR_ULTRASPARC3)
emit_insn (gen_flush (validize_mem (gen_rtx_MEM (SImode,
plus_constant (tramp, 8)))));
+
+ /* Call __enable_execute_stack after writing onto the stack to make sure
+ the stack address is accessible. */
+#ifdef TRANSFER_FROM_TRAMPOLINE
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
+ LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+#endif
+
}
-/* The 64 bit version is simpler because it makes more sense to load the
+/* The 64-bit version is simpler because it makes more sense to load the
values as "immediate" data out of the trampoline. It's also easier since
we can read the PC without clobbering a register. */
void
sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
{
-#ifdef TRANSFER_FROM_TRAMPOLINE
- emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
- LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
-#endif
+ /* SPARC 64-bit trampoline:
- /*
rd %pc, %g1
ldx [%g1+24], %g5
jmp %g5
@@ -7175,6 +7245,13 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
if (sparc_cpu != PROCESSOR_ULTRASPARC
&& sparc_cpu != PROCESSOR_ULTRASPARC3)
emit_insn (gen_flushdi (validize_mem (gen_rtx_MEM (DImode, plus_constant (tramp, 8)))));
+
+ /* Call __enable_execute_stack after writing onto the stack to make sure
+ the stack address is accessible. */
+#ifdef TRANSFER_FROM_TRAMPOLINE
+ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"),
+ LCT_NORMAL, VOIDmode, 1, tramp, Pmode);
+#endif
}
/* Subroutines to support a flat (single) register window calling
@@ -7243,16 +7320,16 @@ sparc64_initialize_trampoline (rtx tramp, rtx fnaddr, rtx cxt)
struct sparc_frame_info
{
- unsigned long total_size; /* # bytes that the entire frame takes up. */
- unsigned long var_size; /* # bytes that variables take up. */
- unsigned long args_size; /* # bytes that outgoing arguments take up. */
- unsigned long extra_size; /* # bytes of extra gunk. */
- unsigned int gp_reg_size; /* # bytes needed to store gp regs. */
- unsigned int fp_reg_size; /* # bytes needed to store fp regs. */
+ HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */
+ HOST_WIDE_INT var_size; /* # bytes that variables take up. */
+ int args_size; /* # bytes that outgoing arguments take up. */
+ int extra_size; /* # bytes of extra gunk. */
+ int gp_reg_size; /* # bytes needed to store gp regs. */
+ int fp_reg_size; /* # bytes needed to store fp regs. */
unsigned long gmask; /* Mask of saved gp registers. */
unsigned long fmask; /* Mask of saved fp registers. */
- unsigned long reg_offset; /* Offset from new sp to store regs. */
- int initialized; /* Nonzero if frame size already calculated. */
+ int reg_offset; /* Offset from new sp to store regs. */
+ int initialized; /* Nonzero if frame size already calculated. */
};
/* Current frame information calculated by sparc_flat_compute_frame_size. */
@@ -7297,20 +7374,20 @@ sparc_flat_must_save_register_p (int regno)
/* Return the bytes needed to compute the frame pointer from the current
stack pointer. */
-unsigned long
-sparc_flat_compute_frame_size (int size)
+HOST_WIDE_INT
+sparc_flat_compute_frame_size (HOST_WIDE_INT size)
/* # of var. bytes allocated. */
{
int regno;
- unsigned long total_size; /* # bytes that the entire frame takes up. */
- unsigned long var_size; /* # bytes that variables take up. */
- unsigned long args_size; /* # bytes that outgoing arguments take up. */
- unsigned long extra_size; /* # extra bytes. */
- unsigned int gp_reg_size; /* # bytes needed to store gp regs. */
- unsigned int fp_reg_size; /* # bytes needed to store fp regs. */
+ HOST_WIDE_INT total_size; /* # bytes that the entire frame takes up. */
+ HOST_WIDE_INT var_size; /* # bytes that variables take up. */
+ int args_size; /* # bytes that outgoing arguments take up. */
+ int extra_size; /* # extra bytes. */
+ int gp_reg_size; /* # bytes needed to store gp regs. */
+ int fp_reg_size; /* # bytes needed to store fp regs. */
unsigned long gmask; /* Mask of saved gp registers. */
unsigned long fmask; /* Mask of saved fp registers. */
- unsigned long reg_offset; /* Offset to register save area. */
+ int reg_offset; /* Offset to register save area. */
int need_aligned_p; /* 1 if need the save area 8 byte aligned. */
/* This is the size of the 16 word reg save area, 1 word struct addr
@@ -7416,12 +7493,11 @@ sparc_flat_compute_frame_size (int size)
WORD_OP is either "st" for save, "ld" for restore.
DOUBLEWORD_OP is either "std" for save, "ldd" for restore. */
-void
-sparc_flat_save_restore (FILE *file, const char *base_reg,
- unsigned int offset, long unsigned int gmask,
- long unsigned int fmask, const char *word_op,
- const char *doubleword_op,
- long unsigned int base_offset)
+static void
+sparc_flat_save_restore (FILE *file, const char *base_reg, int offset,
+ unsigned long gmask, unsigned long fmask,
+ const char *word_op, const char *doubleword_op,
+ HOST_WIDE_INT base_offset)
{
int regno;
@@ -7525,7 +7601,8 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
/* This is only for the human reader. */
fprintf (file, "\t%s#PROLOGUE# 0\n", ASM_COMMENT_START);
- fprintf (file, "\t%s# vars= %ld, regs= %d/%d, args= %d, extra= %ld\n",
+ fprintf (file, "\t%s# vars= "HOST_WIDE_INT_PRINT_DEC", "
+ "regs= %d/%d, args= %d, extra= %d\n",
ASM_COMMENT_START,
current_frame_info.var_size,
current_frame_info.gp_reg_size / 4,
@@ -7556,7 +7633,7 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
after %i7 so gdb won't have to look too far to find it. */
if (size > 0)
{
- unsigned int reg_offset = current_frame_info.reg_offset;
+ int reg_offset = current_frame_info.reg_offset;
const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM];
static const char *const t1_str = "%g1";
@@ -7572,26 +7649,26 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
the gdb folk first. */
/* Is the entire register save area offsettable from %sp? */
- if (reg_offset < 4096 - 64 * (unsigned) UNITS_PER_WORD)
+ if (reg_offset < 4096 - 64 * UNITS_PER_WORD)
{
if (size <= 4096)
{
- fprintf (file, "\tadd\t%s, %d, %s\n",
- sp_str, (int) -size, sp_str);
+ fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n",
+ sp_str, size, sp_str);
if (gmask & HARD_FRAME_POINTER_MASK)
{
fprintf (file, "\tst\t%s, [%s+%d]\n",
fp_str, sp_str, reg_offset);
- fprintf (file, "\tsub\t%s, %d, %s\t%s# set up frame pointer\n",
- sp_str, (int) -size, fp_str, ASM_COMMENT_START);
+ fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s"
+ "\t%s# set up frame pointer\n",
+ sp_str, size, fp_str, ASM_COMMENT_START);
reg_offset += 4;
}
}
else
{
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC
- ", %s\n\tsub\t%s, %s, %s\n",
- size, t1_str, sp_str, t1_str, sp_str);
+ build_big_number (file, size, t1_str);
+ fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str);
if (gmask & HARD_FRAME_POINTER_MASK)
{
fprintf (file, "\tst\t%s, [%s+%d]\n",
@@ -7629,33 +7706,40 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
else
{
/* Subtract %sp in two steps, but make sure there is always a
- 64 byte register save area, and %sp is properly aligned. */
+ 64-byte register save area, and %sp is properly aligned. */
+
/* Amount to decrement %sp by, the first time. */
- unsigned HOST_WIDE_INT size1 = ((size - reg_offset + 64) + 15) & -16;
- /* Offset to register save area from %sp. */
- unsigned HOST_WIDE_INT offset = size1 - (size - reg_offset);
+ HOST_WIDE_INT size1 = ((size - reg_offset + 64) + 15) & -16;
+
+ /* Amount to decrement %sp by, the second time. */
+ HOST_WIDE_INT size2 = size - size1;
+
+ /* Offset to register save area from %sp after first decrement. */
+ int offset = (int)(size1 - (size - reg_offset));
if (size1 <= 4096)
{
- fprintf (file, "\tadd\t%s, %d, %s\n",
- sp_str, (int) -size1, sp_str);
+ fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n",
+ sp_str, size1, sp_str);
if (gmask & HARD_FRAME_POINTER_MASK)
{
- fprintf (file, "\tst\t%s, [%s+%d]\n\tsub\t%s, %d, %s\t%s# set up frame pointer\n",
- fp_str, sp_str, (int) offset, sp_str, (int) -size1,
+ fprintf (file, "\tst\t%s, [%s+%d]\n"
+ "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s"
+ "\t%s# set up frame pointer\n",
+ fp_str, sp_str, offset, sp_str, size1,
fp_str, ASM_COMMENT_START);
offset += 4;
}
}
else
{
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC
- ", %s\n\tsub\t%s, %s, %s\n",
- size1, t1_str, sp_str, t1_str, sp_str);
+ build_big_number (file, size1, t1_str);
+ fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str);
if (gmask & HARD_FRAME_POINTER_MASK)
{
- fprintf (file, "\tst\t%s, [%s+%d]\n\tadd\t%s, %s, %s\t%s# set up frame pointer\n",
- fp_str, sp_str, (int) offset, sp_str, t1_str,
+ fprintf (file, "\tst\t%s, [%s+%d]\n"
+ "\tadd\t%s, %s, %s\t%s# set up frame pointer\n",
+ fp_str, sp_str, offset, sp_str, t1_str,
fp_str, ASM_COMMENT_START);
offset += 4;
}
@@ -7675,7 +7759,7 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
if (gmask & RETURN_ADDR_MASK)
{
fprintf (file, "\tst\t%s, [%s+%d]\n",
- reg_names[RETURN_ADDR_REGNUM], sp_str, (int) offset);
+ reg_names[RETURN_ADDR_REGNUM], sp_str, offset);
if (dwarf2out_do_frame ())
/* offset - size1 == reg_offset - size
if reg_offset were updated above like offset. */
@@ -7686,9 +7770,14 @@ sparc_flat_function_prologue (FILE *file, HOST_WIDE_INT size)
gmask & ~(HARD_FRAME_POINTER_MASK | RETURN_ADDR_MASK),
current_frame_info.fmask,
"st", "std", -size1);
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC
- ", %s\n\tsub\t%s, %s, %s\n",
- size - size1, t1_str, sp_str, t1_str, sp_str);
+ if (size2 <= 4096)
+ fprintf (file, "\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n",
+ sp_str, size2, sp_str);
+ else
+ {
+ build_big_number (file, size2, t1_str);
+ fprintf (file, "\tsub\t%s, %s, %s\n", sp_str, t1_str, sp_str);
+ }
if (dwarf2out_do_frame ())
if (! (gmask & HARD_FRAME_POINTER_MASK))
dwarf2out_def_cfa ("", STACK_POINTER_REGNUM, size);
@@ -7734,8 +7823,8 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
if (!noepilogue)
{
- unsigned HOST_WIDE_INT reg_offset = current_frame_info.reg_offset;
- unsigned HOST_WIDE_INT size1;
+ int reg_offset = current_frame_info.reg_offset;
+ int reg_offset1;
const char *const sp_str = reg_names[STACK_POINTER_REGNUM];
const char *const fp_str = reg_names[HARD_FRAME_POINTER_REGNUM];
static const char *const t1_str = "%g1";
@@ -7744,37 +7833,43 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
slots for most of the loads, also see if we can fill the final
delay slot if not otherwise filled by the reload sequence. */
- if (size > 4095)
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC ", %s\n",
- size, t1_str);
+ if (size > 4096)
+ build_big_number (file, size, t1_str);
if (frame_pointer_needed)
{
- if (size > 4095)
+ if (size > 4096)
fprintf (file,"\tsub\t%s, %s, %s\t\t%s# sp not trusted here\n",
fp_str, t1_str, sp_str, ASM_COMMENT_START);
else
- fprintf (file,"\tsub\t%s, %d, %s\t\t%s# sp not trusted here\n",
- fp_str, (int) size, sp_str, ASM_COMMENT_START);
+ fprintf (file,"\tadd\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s"
+ "\t\t%s# sp not trusted here\n",
+ fp_str, size, sp_str, ASM_COMMENT_START);
}
/* Is the entire register save area offsettable from %sp? */
- if (reg_offset < 4096 - 64 * (unsigned) UNITS_PER_WORD)
+ if (reg_offset < 4096 - 64 * UNITS_PER_WORD)
{
- size1 = 0;
+ reg_offset1 = 0;
}
else
{
/* Restore %sp in two steps, but make sure there is always a
- 64 byte register save area, and %sp is properly aligned. */
+ 64-byte register save area, and %sp is properly aligned. */
+
/* Amount to increment %sp by, the first time. */
- size1 = ((reg_offset - 64 - 16) + 15) & -16;
+ reg_offset1 = ((reg_offset - 64 - 16) + 15) & -16;
+
/* Offset to register save area from %sp. */
- reg_offset = size1 - reg_offset;
+ reg_offset = reg_offset1 - reg_offset;
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC
- ", %s\n\tadd\t%s, %s, %s\n",
- size1, t1_str, sp_str, t1_str, sp_str);
+ if (reg_offset1 > 4096)
+ {
+ build_big_number (file, reg_offset1, t1_str);
+ fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str);
+ }
+ else
+ fprintf (file, "\tsub\t%s, -%d, %s\n", sp_str, reg_offset1, sp_str);
}
/* We must restore the frame pointer and return address reg first
@@ -7782,13 +7877,13 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
if (current_frame_info.gmask & HARD_FRAME_POINTER_MASK)
{
fprintf (file, "\tld\t[%s+%d], %s\n",
- sp_str, (int) reg_offset, fp_str);
+ sp_str, reg_offset, fp_str);
reg_offset += 4;
}
if (current_frame_info.gmask & RETURN_ADDR_MASK)
{
fprintf (file, "\tld\t[%s+%d], %s\n",
- sp_str, (int) reg_offset, reg_names[RETURN_ADDR_REGNUM]);
+ sp_str, reg_offset, reg_names[RETURN_ADDR_REGNUM]);
reg_offset += 4;
}
@@ -7800,12 +7895,11 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
/* If we had to increment %sp in two steps, record it so the second
restoration in the epilogue finishes up. */
- if (size1 > 0)
+ if (reg_offset1 > 0)
{
- size -= size1;
- if (size > 4095)
- fprintf (file, "\tset\t" HOST_WIDE_INT_PRINT_DEC ", %s\n",
- size, t1_str);
+ size -= reg_offset1;
+ if (size > 4096)
+ build_big_number (file, size, t1_str);
}
if (current_function_returns_struct)
@@ -7825,11 +7919,12 @@ sparc_flat_function_epilogue (FILE *file, HOST_WIDE_INT size)
final_scan_insn (XEXP (epilogue_delay, 0), file, 1, -2, 1);
}
- else if (size > 4095)
+ else if (size > 4096)
fprintf (file, "\tadd\t%s, %s, %s\n", sp_str, t1_str, sp_str);
else if (size > 0)
- fprintf (file, "\tadd\t%s, %d, %s\n", sp_str, (int) size, sp_str);
+ fprintf (file, "\tsub\t%s, -"HOST_WIDE_INT_PRINT_DEC", %s\n",
+ sp_str, size, sp_str);
else
fprintf (file, "\tnop\n");
@@ -8990,10 +9085,17 @@ sparc_output_mi_thunk (FILE *file, tree thunk_fndecl ATTRIBUTE_UNUSED,
if (!SPARC_SIMM13_P (delta))
{
rtx scratch = gen_rtx_REG (Pmode, 1);
- if (TARGET_ARCH64)
- sparc_emit_set_const64 (scratch, delta_rtx);
+
+ if (input_operand (delta_rtx, GET_MODE (scratch)))
+ emit_insn (gen_rtx_SET (VOIDmode, scratch, delta_rtx));
else
- sparc_emit_set_const32 (scratch, delta_rtx);
+ {
+ if (TARGET_ARCH64)
+ sparc_emit_set_const64 (scratch, delta_rtx);
+ else
+ sparc_emit_set_const32 (scratch, delta_rtx);
+ }
+
delta_rtx = scratch;
}
diff --git a/gcc/config/sparc/sparc.h b/gcc/config/sparc/sparc.h
index d2a37f3cd60..06fd5ee328a 100644
--- a/gcc/config/sparc/sparc.h
+++ b/gcc/config/sparc/sparc.h
@@ -34,13 +34,13 @@ Boston, MA 02111-1307, USA. */
builtin_define_std ("sparc"); \
if (TARGET_64BIT) \
{ \
- builtin_assert ("cpu=sparc"); \
- builtin_assert ("machine=sparc"); \
+ builtin_assert ("cpu=sparc64"); \
+ builtin_assert ("machine=sparc64"); \
} \
else \
{ \
- builtin_assert ("cpu=sparc64"); \
- builtin_assert ("machine=sparc64"); \
+ builtin_assert ("cpu=sparc"); \
+ builtin_assert ("machine=sparc"); \
} \
} \
while (0)
diff --git a/gcc/config/sparc/sparc.md b/gcc/config/sparc/sparc.md
index 46bd35809a9..b3a7dfaf447 100644
--- a/gcc/config/sparc/sparc.md
+++ b/gcc/config/sparc/sparc.md
@@ -7686,7 +7686,7 @@
emit_insn (gen_rtx_USE (VOIDmode, valreg2));
/* Construct the return. */
- expand_null_return ();
+ expand_naked_return ();
DONE;
})
@@ -8641,7 +8641,7 @@
"TARGET_TLS && TARGET_ARCH64"
"xor\\t%1, %%tle_lox10(%a2), %0")
-;; Now patterns combinding tldo_add{32,64} with some integer loads or stores
+;; Now patterns combining tldo_add{32,64} with some integer loads or stores
(define_insn "*tldo_ldub_sp32"
[(set (match_operand:QI 0 "register_operand" "=r")
(mem:QI (plus:SI (unspec:SI [(match_operand:SI 2 "register_operand" "r")
diff --git a/gcc/config/stormy16/stormy16-protos.h b/gcc/config/stormy16/stormy16-protos.h
index 70e63633855..ac47238fbc8 100644
--- a/gcc/config/stormy16/stormy16-protos.h
+++ b/gcc/config/stormy16/stormy16-protos.h
@@ -39,7 +39,6 @@ extern rtx xstormy16_function_arg
# endif
extern void xstormy16_setup_incoming_varargs
(CUMULATIVE_ARGS, int, tree, int *);
-extern tree xstormy16_build_va_list (void);
#endif
#if defined (TREE_CODE) && defined (RTX_CODE)
diff --git a/gcc/config/stormy16/stormy16.c b/gcc/config/stormy16/stormy16.c
index 1961f0a9d01..de60b0005f5 100644
--- a/gcc/config/stormy16/stormy16.c
+++ b/gcc/config/stormy16/stormy16.c
@@ -1251,8 +1251,8 @@ xstormy16_setup_incoming_varargs (CUMULATIVE_ARGS cum ATTRIBUTE_UNUSED,
for arguments that have not been passed in registers.
To keep the layout nice, the pointer is first in the structure. */
-tree
-xstormy16_build_va_list (void)
+static tree
+xstormy16_build_builtin_va_list (void)
{
tree f_1, f_2, record, type_decl;
@@ -2211,4 +2211,7 @@ xstormy16_expand_builtin(tree exp, rtx target,
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST xstormy16_address_cost
+#undef TARGET_BUILD_BUILTIN_VA_LIST_TYPE
+#define TARGET_BUILD_BUILTIN_VA_LIST_TYPE xstormy16_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
diff --git a/gcc/config/stormy16/stormy16.h b/gcc/config/stormy16/stormy16.h
index 3d1ab50756f..088c7eb5cea 100644
--- a/gcc/config/stormy16/stormy16.h
+++ b/gcc/config/stormy16/stormy16.h
@@ -496,11 +496,6 @@ enum reg_class
if (! SECOND_TIME) \
xstormy16_setup_incoming_varargs (ARGS_SO_FAR, MODE, TYPE, & PRETEND_ARGS_SIZE)
-/* Build up the stdarg/varargs va_list type tree, assigning it to NODE. If not
- defined, it is assumed that va_list is a void * pointer. */
-#define BUILD_VA_LIST_TYPE(NODE) \
- ((NODE) = xstormy16_build_va_list ())
-
/* Implement the stdarg/varargs va_start macro. STDARG_P is nonzero if this
is stdarg.h instead of varargs.h. VALIST is the tree of the va_list
variable to initialize. NEXTARG is the machine independent notion of the
diff --git a/gcc/config/t-darwin b/gcc/config/t-darwin
index 8743fc1fa6d..a7076ab295d 100644
--- a/gcc/config/t-darwin
+++ b/gcc/config/t-darwin
@@ -20,3 +20,5 @@ $(T)crt2$(objext): $(srcdir)/config/darwin-crt2.c $(GCC_PASSES) \
LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-darwin.c \
$(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
+
+TARGET_LIBGCC2_CFLAGS = -fPIC
diff --git a/gcc/config/t-libunwind b/gcc/config/t-libunwind
index be50bc481c5..2204ae316d7 100644
--- a/gcc/config/t-libunwind
+++ b/gcc/config/t-libunwind
@@ -1 +1,5 @@
-LIB2ADDEH = $(srcdir)/unwind-libunwind.c $(srcdir)/unwind-sjlj.c
+# Override the default value from t-slibgcc-elf-ver and mention -lunwind
+# so that the resulting libgcc_s.so has the necessary DT_NEEDED entry for
+# libunwind.
+SHLIB_LC = -lunwind -lc
+LIB2ADDEH = $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
diff --git a/gcc/config/t-slibgcc-darwin b/gcc/config/t-slibgcc-darwin
new file mode 100644
index 00000000000..f27fae4948c
--- /dev/null
+++ b/gcc/config/t-slibgcc-darwin
@@ -0,0 +1,30 @@
+# Build a shared libgcc library with the darwin linker.
+SHLIB_MINOR = 1
+SHLIB_REVISION = 0
+SHLIB_VERSTRING = -compatibility_version $(SHLIB_MINOR) -current_version $(SHLIB_MINOR).$(SHLIB_REVISION)
+SHLIB_EXT = .dylib
+SHLIB_SOLINK = @shlib_base_name@.dylib
+SHLIB_SONAME = @shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
+SHLIB_NAME = @shlib_dir@@shlib_so_name@.$(SHLIB_MINOR).$(SHLIB_REVISION).dylib
+SHLIB_MAP = @shlib_map_file@
+SHLIB_OBJS = @shlib_objs@
+SHLIB_SLIBDIR_QUAL = @shlib_slibdir_qual@
+
+SHLIB_LINK = $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) -dynamiclib -nodefaultlibs \
+ -Wl,-install_name,$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME) \
+ -Wl,-flat_namespace -o $(SHLIB_NAME) \
+ $(SHLIB_VERSTRING) \
+ @multilib_flags@ $(SHLIB_OBJS) -lc && \
+ rm -f $(SHLIB_SOLINK) && \
+ $(LN_S) $(SHLIB_NAME) $(SHLIB_SOLINK)
+# $(slibdir) double quoted to protect it from expansion while building
+# libgcc.mk. We want this delayed until actual install time.
+SHLIB_INSTALL = \
+ $$(SHELL) $$(srcdir)/mkinstalldirs $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL); \
+ $(INSTALL_DATA) $(SHLIB_NAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SONAME); \
+ rm -f $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK); \
+ $(LN_S) $(SHLIB_SONAME) \
+ $$(DESTDIR)$$(slibdir)$(SHLIB_SLIBDIR_QUAL)/$(SHLIB_SOLINK)
+SHLIB_MKMAP = $(srcdir)/mkmap-symver.awk
+SHLIB_MAPFILES = $(srcdir)/libgcc-darwin.ver
diff --git a/gcc/config/v850/v850.c b/gcc/config/v850/v850.c
index 6c6cece5be9..5163c377eb4 100644
--- a/gcc/config/v850/v850.c
+++ b/gcc/config/v850/v850.c
@@ -2270,7 +2270,7 @@ v850_encode_data_area (tree decl, rtx symbol)
{
int flags;
- /* Map explict sections into the appropriate attribute */
+ /* Map explicit sections into the appropriate attribute */
if (v850_get_data_area (decl) == DATA_AREA_NORMAL)
{
if (DECL_SECTION_NAME (decl))
@@ -3155,8 +3155,8 @@ pattern_is_ok_for_prepare (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
return 0;
/* If the register is being pushed somewhere other than the stack
- space just aquired by the first operand then abandon this quest.
- Note: the test is <= becuase both values are negative. */
+ space just acquired by the first operand then abandon this quest.
+ Note: the test is <= because both values are negative. */
if (INTVAL (XEXP (plus, 1))
<= INTVAL (XEXP (SET_SRC (XVECEXP (op, 0, 0)), 1)))
return 0;
diff --git a/gcc/config/v850/v850.h b/gcc/config/v850/v850.h
index 4d681d41b9d..76f0920fda7 100644
--- a/gcc/config/v850/v850.h
+++ b/gcc/config/v850/v850.h
@@ -1349,7 +1349,7 @@ zbss_section () \
can appear in the "ghs section" pragma. These names are used to index
into the GHS_default_section_names[] and GHS_current_section_names[]
that are defined in v850.c, and so the ordering of each must remain
- consistant.
+ consistent.
These arrays give the default and current names for each kind of
section defined by the GHS pragmas. The current names can be changed
diff --git a/gcc/config/v850/v850.md b/gcc/config/v850/v850.md
index ba058a45e76..b359c723002 100644
--- a/gcc/config/v850/v850.md
+++ b/gcc/config/v850/v850.md
@@ -368,7 +368,11 @@
(sign_extend:SI (match_operand:HI 1 "register_operand" ""))
(sign_extend:SI (match_operand:HI 2 "nonmemory_operand" ""))))]
""
- "")
+ "if (GET_CODE (operands[2]) == CONST_INT)
+ {
+ emit_insn (gen_mulhisi3_internal2 (operands[0], operands[1], operands[2]));
+ DONE;
+ }")
(define_insn "*mulhisi3_internal1"
[(set (match_operand:SI 0 "register_operand" "=r")
@@ -381,13 +385,11 @@
(set_attr "cc" "none_0hit")
(set_attr "type" "mult")])
-;; ??? Sign extending constants isn't valid. Fix?
-
-(define_insn "*mulhisi3_internal2"
+(define_insn "mulhisi3_internal2"
[(set (match_operand:SI 0 "register_operand" "=r,r")
(mult:SI
(sign_extend:SI (match_operand:HI 1 "register_operand" "%0,r"))
- (sign_extend:SI (match_operand 2 "const_int_operand" "J,K"))))]
+ (match_operand:HI 2 "const_int_operand" "J,K")))]
""
"@
mulh %2,%0
@@ -1714,7 +1716,7 @@
"TARGET_V850E && !TARGET_DISABLE_CALLT"
;; The CALLT instruction stores the next address of CALLT to CTPC register
;; without saving its previous value. So if the interrupt handler
- ;; or its caller could possibily execute the CALLT insn, save_interrupt
+ ;; or its caller could possibly execute the CALLT insn, save_interrupt
;; MUST NOT be called via CALLT.
"*
{
diff --git a/gcc/config/vax/vax.c b/gcc/config/vax/vax.c
index dd22e33bbf7..f572652fade 100644
--- a/gcc/config/vax/vax.c
+++ b/gcc/config/vax/vax.c
@@ -38,6 +38,7 @@ Boston, MA 02111-1307, USA. */
#include "optabs.h"
#include "flags.h"
#include "debug.h"
+#include "toplev.h"
#include "tm_p.h"
#include "target.h"
#include "target-def.h"
@@ -152,7 +153,7 @@ static void
vax_init_libfuncs (void)
{
set_optab_libfunc (udiv_optab, SImode, TARGET_ELF ? "*__udiv" : "*udiv");
- set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__umod" : "*umod");
+ set_optab_libfunc (umod_optab, SImode, TARGET_ELF ? "*__urem" : "*urem");
}
/* This is like nonimmediate_operand with a restriction on the type of MEM. */
diff --git a/gcc/config/vax/vax.h b/gcc/config/vax/vax.h
index 0bbcc277724..35d865d0f8a 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, 2001, 2002 Free Software Foundation, Inc.
+ 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -933,6 +933,12 @@ enum reg_class { NO_REGS, ALL_REGS, LIM_REG_CLASSES };
/* Control the assembler format that we output. */
+/* A C string constant describing how to begin a comment in the target
+ assembler language. The compiler assumes that the comment will end at
+ the end of the line. */
+
+#define ASM_COMMENT_START "#"
+
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@@ -1106,7 +1112,13 @@ VAX operand formatting codes:
/* The purpose of D is to get around a quirk or bug in VAX assembler
whereby -1 in a 64-bit immediate operand means 0x00000000ffffffff,
- which is not a 64-bit minus one. */
+ which is not a 64-bit minus one. As a workaround, we output negative
+ values in hex. */
+#if HOST_BITS_PER_WIDE_INT == 64
+# define NEG_HWI_PRINT_HEX16 HOST_WIDE_INT_PRINT_HEX
+#else
+# define NEG_HWI_PRINT_HEX16 "0xffffffff%08lx"
+#endif
#define PRINT_OPERAND_PUNCT_VALID_P(CODE) \
((CODE) == '#' || (CODE) == '|')
@@ -1118,7 +1130,7 @@ VAX operand formatting codes:
else if (CODE == 'C') \
fputs (rev_cond_name (X), FILE); \
else if (CODE == 'D' && GET_CODE (X) == CONST_INT && INTVAL (X) < 0) \
- fprintf (FILE, "$0xffffffff%08x", INTVAL (X)); \
+ fprintf (FILE, "$" NEG_HWI_PRINT_HEX16, INTVAL (X)); \
else if (CODE == 'P' && GET_CODE (X) == CONST_INT) \
fprintf (FILE, "$" HOST_WIDE_INT_PRINT_DEC, INTVAL (X) + 1); \
else if (CODE == 'N' && GET_CODE (X) == CONST_INT) \
diff --git a/gcc/config/vxlib.c b/gcc/config/vxlib.c
index 89e0c3514d9..20a257e02c4 100644
--- a/gcc/config/vxlib.c
+++ b/gcc/config/vxlib.c
@@ -198,7 +198,7 @@ tsd_init (void)
/* External interface */
/* Store in KEYP a value which can be passed to __gthread_setspecific/
- __gthread_getspecific to store and retrive a value which is
+ __gthread_getspecific to store and retrieve a value which is
specific to each calling thread. If DTOR is not NULL, it will be
called when a thread terminates with a non-NULL specific value for
this key, with the value as its sole argument. */
diff --git a/gcc/config/vxworks.h b/gcc/config/vxworks.h
index 339acecc20c..085eb8ce648 100644
--- a/gcc/config/vxworks.h
+++ b/gcc/config/vxworks.h
@@ -62,4 +62,3 @@ Boston, MA 02111-1307, USA. */
/* Only supported debug format is Dwarf2. */
#undef DBX_DEBUGGING_INFO
-#undef DWARF_DEBUGGING_INFO
diff --git a/gcc/config/xtensa/elf.h b/gcc/config/xtensa/elf.h
index 849be87edb0..1ef309bfa8c 100644
--- a/gcc/config/xtensa/elf.h
+++ b/gcc/config/xtensa/elf.h
@@ -21,7 +21,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define TARGET_SECTION_TYPE_FLAGS xtensa_multibss_section_type_flags
-/* Don't assume anything about the header files. */
+/* Don't assume anything about the header files. */
#define NO_IMPLICIT_EXTERN_C
#undef ASM_APP_ON
diff --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
index ef5aae04f63..0b3b077eca9 100644
--- a/gcc/config/xtensa/linux.h
+++ b/gcc/config/xtensa/linux.h
@@ -19,13 +19,7 @@ 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. */
-#define TARGET_OS_CPP_BUILTINS() \
- do { \
- builtin_define_std ("linux"); \
- builtin_define_std ("unix"); \
- builtin_define ("__gnu_linux__"); \
- builtin_assert ("system=posix"); \
- } while (0)
+#define TARGET_OS_CPP_BUILTINS() LINUX_TARGET_OS_CPP_BUILTINS()
#undef SUBTARGET_CPP_SPEC
#define SUBTARGET_CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{pthread:-D_REENTRANT}"
diff --git a/gcc/config/xtensa/xtensa-protos.h b/gcc/config/xtensa/xtensa-protos.h
index 9c37c417991..cf7f09075c9 100644
--- a/gcc/config/xtensa/xtensa-protos.h
+++ b/gcc/config/xtensa/xtensa-protos.h
@@ -22,7 +22,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifndef __XTENSA_PROTOS_H__
#define __XTENSA_PROTOS_H__
-/* Functions to test whether an immediate fits in a given field. */
+/* Functions to test whether an immediate fits in a given field. */
extern int xtensa_simm7 (int);
extern int xtensa_simm8 (int);
extern int xtensa_simm8x256 (int);
@@ -96,7 +96,6 @@ extern int a7_overlap_mentioned_p (rtx);
extern void function_arg_advance (CUMULATIVE_ARGS *, enum machine_mode, tree);
extern struct rtx_def *function_arg (CUMULATIVE_ARGS *, enum machine_mode,
tree, int);
-extern tree xtensa_build_va_list (void);
#endif /* TREE_CODE */
extern int xtensa_mask_immediate (int);
diff --git a/gcc/config/xtensa/xtensa.c b/gcc/config/xtensa/xtensa.c
index 23798b00191..e8926c9c1e3 100644
--- a/gcc/config/xtensa/xtensa.c
+++ b/gcc/config/xtensa/xtensa.c
@@ -205,6 +205,7 @@ static unsigned int xtensa_multibss_section_type_flags (tree, const char *,
static void xtensa_select_rtx_section (enum machine_mode, rtx,
unsigned HOST_WIDE_INT);
static bool xtensa_rtx_costs (rtx, int, int, int *);
+static tree xtensa_build_builtin_va_list (void);
static int current_function_arg_words;
static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
@@ -233,6 +234,9 @@ static const int reg_nonleaf_alloc_order[FIRST_PSEUDO_REGISTER] =
#undef TARGET_ADDRESS_COST
#define TARGET_ADDRESS_COST hook_int_rtx_0
+#undef TARGET_BUILD_BUILTIN_VA_LIST
+#define TARGET_BUILD_BUILTIN_VA_LIST xtensa_build_builtin_va_list
+
struct gcc_target targetm = TARGET_INITIALIZER;
@@ -596,7 +600,7 @@ move_operand (rtx op, enum machine_mode mode)
case SImode:
if (TARGET_CONST16)
return CONSTANT_P (op);
- /* fall through */
+ /* Fall through. */
case HImode:
case QImode:
@@ -648,12 +652,12 @@ constantpool_address_p (rtx addr)
{
rtx offset;
- /* only handle (PLUS (SYM, OFFSET)) form */
+ /* Only handle (PLUS (SYM, OFFSET)) form. */
addr = XEXP (addr, 0);
if (GET_CODE (addr) != PLUS)
return FALSE;
- /* make sure the address is word aligned */
+ /* Make sure the address is word aligned. */
offset = XEXP (addr, 1);
if ((GET_CODE (offset) != CONST_INT)
|| ((INTVAL (offset) & 3) != 0))
@@ -724,7 +728,7 @@ xtensa_extend_reg (rtx dst, rtx src)
rtx temp = gen_reg_rtx (SImode);
rtx shift = GEN_INT (BITS_PER_WORD - GET_MODE_BITSIZE (GET_MODE (src)));
- /* generate paradoxical subregs as needed so that the modes match */
+ /* Generate paradoxical subregs as needed so that the modes match. */
src = simplify_gen_subreg (SImode, src, GET_MODE (src), 0);
dst = simplify_gen_subreg (SImode, dst, GET_MODE (dst), 0);
@@ -1076,14 +1080,14 @@ gen_conditional_move (rtx cmp)
if (boolean_operator (cmp, VOIDmode))
{
- /* swap the operands to make const0 second */
+ /* 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 not comparing against zero, emit a comparison (subtract). */
if (op1 != const0_rtx)
{
op0 = expand_binop (SImode, sub_optab, op0, op1,
@@ -1093,7 +1097,7 @@ gen_conditional_move (rtx cmp)
}
else if (branch_operator (cmp, VOIDmode))
{
- /* swap the operands to make const0 second */
+ /* Swap the operands to make const0 second. */
if (op0 == const0_rtx)
{
op0 = op1;
@@ -1375,26 +1379,26 @@ xtensa_expand_block_move (rtx *operands)
int align = XINT (operands[3], 0);
int num_pieces, move_ratio;
- /* If this is not a fixed size move, just call memcpy */
+ /* If this is not a fixed size move, just call memcpy. */
if (!optimize || (GET_CODE (operands[2]) != CONST_INT))
return 0;
- /* Anything to move? */
+ /* 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 */
+ /* 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 */
+ num_pieces = (bytes / align) + (bytes % align); /* Close enough anyway. */
if (num_pieces >= move_ratio)
return 0;
- /* make sure the memory addresses are valid */
+ /* Make sure the memory addresses are valid. */
operands[0] = validize_mem (dest);
operands[1] = validize_mem (src);
@@ -1404,10 +1408,10 @@ xtensa_expand_block_move (rtx *operands)
}
-/* 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 */
+/* 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
{
@@ -1463,7 +1467,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots)
if (bytes < item_size)
{
- /* find a smaller item_size which we can load & store */
+ /* 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);
@@ -1471,7 +1475,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots)
stname = xtensa_st_opcodes[(int) mode];
}
- /* record the load instruction opcode and operands */
+ /* 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))
@@ -1481,7 +1485,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots)
ldinsns[n].operands[1] = mem;
sprintf (ldinsns[n].template, "%s\t%%0, %%1", ldname);
- /* record the store instruction opcode and operands */
+ /* 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))
@@ -1495,7 +1499,7 @@ xtensa_emit_block_move (rtx *operands, rtx *tmpregs, int delay_slots)
bytes -= item_size;
}
- /* now output the loads followed by the stores */
+ /* 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++)
@@ -1513,7 +1517,7 @@ xtensa_find_mode_for_size (unsigned item_size)
{
mode = VOIDmode;
- /* find mode closest to but not bigger than item_size */
+ /* 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)
@@ -1527,7 +1531,7 @@ xtensa_find_mode_for_size (unsigned item_size)
&& xtensa_st_opcodes[(int) mode])
break;
- /* cannot load & store this mode; try something smaller */
+ /* Cannot load & store this mode; try something smaller. */
item_size -= 1;
}
@@ -1541,8 +1545,8 @@ xtensa_expand_nonlocal_goto (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 */
+ /* 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);
@@ -1581,10 +1585,10 @@ xtensa_setup_frame_addresses (void)
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
+ targeting that label will target the nop (and thus remain in the loop),
+ instead of targeting 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
+ branch is targeting 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
@@ -1785,7 +1789,7 @@ override_options (void)
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 */
+ /* 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";
@@ -2318,8 +2322,8 @@ xtensa_return_addr (int count, rtx frame)
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)
+static tree
+xtensa_build_builtin_va_list (void)
{
tree f_stk, f_reg, f_ndx, record, type_decl;
@@ -2362,7 +2366,7 @@ xtensa_builtin_saveregs (void)
if (gp_left == 0)
return const0_rtx;
- /* allocate the general-purpose register space */
+ /* Allocate the general-purpose register space. */
gp_regs = assign_stack_local
(BLKmode, MAX_ARGS_IN_REGISTERS * UNITS_PER_WORD, -1);
set_mem_alias_set (gp_regs, get_varargs_alias_set ());
@@ -2658,8 +2662,8 @@ order_regs_for_local_alloc (void)
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 */
+ /* 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;
@@ -2668,11 +2672,11 @@ order_regs_for_local_alloc (void)
for (i = 0; i < num_arg_regs; i++)
reg_alloc_order[nxt++] = GP_ARG_FIRST + i;
- /* list the coprocessor registers in order */
+ /* List the coprocessor registers in order. */
for (i = 0; i < BR_REG_NUM; i++)
reg_alloc_order[nxt++] = BR_REG_FIRST + i;
- /* list the FP registers in order for now */
+ /* List the FP registers in order for now. */
for (i = 0; i < 16; i++)
reg_alloc_order[nxt++] = FP_REG_FIRST + i;
@@ -2817,7 +2821,7 @@ xtensa_rtx_costs (rtx x, int code, int outer_code, int *total)
case LSHIFTRT:
case ROTATE:
case ROTATERT:
- /* no way to tell if X is the 2nd operand so be conservative */
+ /* No way to tell if X is the 2nd operand so be conservative. */
default: break;
}
if (xtensa_simm12b (INTVAL (x)))
@@ -2944,7 +2948,7 @@ xtensa_rtx_costs (rtx x, int code, int outer_code, int *total)
return true;
}
}
- /* fall through */
+ /* Fall through. */
case UDIV:
case UMOD:
diff --git a/gcc/config/xtensa/xtensa.h b/gcc/config/xtensa/xtensa.h
index 621dd5fbbb6..a7f470ec0b5 100644
--- a/gcc/config/xtensa/xtensa.h
+++ b/gcc/config/xtensa/xtensa.h
@@ -142,10 +142,10 @@ extern unsigned xtensa_current_frame_size;
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 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 this if most significant word of a multiword number is the lowest. */
#define WORDS_BIG_ENDIAN (TARGET_BIG_ENDIAN != 0)
#define MAX_BITS_PER_WORD 32
@@ -271,11 +271,11 @@ extern unsigned xtensa_current_frame_size;
#define FIRST_PSEUDO_REGISTER 36
-/* Return the stabs register number to use for REGNO. */
+/* 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. */
+ 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, \
@@ -326,18 +326,18 @@ extern unsigned xtensa_current_frame_size;
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. */
+ not windowed, we still prefer call-used registers, if there are any. */
extern const char xtensa_leaf_regs[FIRST_PSEUDO_REGISTER];
#define LEAF_REGISTERS xtensa_leaf_regs
/* For Xtensa, no remapping is necessary, but this macro must be
- defined if LEAF_REGISTERS is defined. */
+ defined if LEAF_REGISTERS is defined. */
#define LEAF_REG_REMAP(REGNO) (REGNO)
-/* this must be declared if LEAF_REGISTERS is set */
+/* This must be declared if LEAF_REGISTERS is set. */
extern int leaf_function;
-/* Internal macros to classify a register number. */
+/* Internal macros to classify a register number. */
/* 16 address registers + fake registers */
#define GP_REG_FIRST 0
@@ -372,7 +372,7 @@ extern int leaf_function;
((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. */
+ MODE. */
extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
#define HARD_REGNO_MODE_OK(REGNO, MODE) \
@@ -397,7 +397,7 @@ extern char xtensa_hard_regno_mode_ok[][FIRST_PSEUDO_REGISTER];
/* 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. */
+ 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.
@@ -518,7 +518,7 @@ extern const enum reg_class xtensa_regno_to_class[FIRST_PSEUDO_REGISTER];
/* SMALL_REGISTER_CLASSES is required for Xtensa, because all of the
16 AR registers may be explicitly used in the RTL, as either
- incoming or outgoing arguments. */
+ incoming or outgoing arguments. */
#define SMALL_REGISTER_CLASSES 1
@@ -599,7 +599,7 @@ extern enum reg_class xtensa_char_to_class[256];
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. */
+ GO_IF_LEGITIMATE_ADDRESS. */
#define EXTRA_CONSTRAINT(OP, CODE) \
((GET_CODE (OP) != MEM) ? \
@@ -714,7 +714,7 @@ extern enum reg_class xtensa_char_to_class[256];
/* 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. */
+ PROMOTE_MODE. */
#define XTENSA_LIBCALL_VALUE(MODE, OUTGOINGP) \
gen_rtx_REG ((GET_MODE_CLASS (MODE) == MODE_INT \
&& GET_MODE_SIZE (MODE) < UNITS_PER_WORD) \
@@ -750,7 +750,7 @@ extern enum reg_class xtensa_char_to_class[256];
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. */
+ register numbers. */
#define FUNCTION_VALUE_REGNO_P(N) \
((N) == GP_RETURN)
@@ -759,7 +759,7 @@ extern enum reg_class xtensa_char_to_class[256];
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. */
+ the stack. */
#define FUNCTION_ARG_REGNO_P(N) \
((N) >= GP_OUTGOING_ARG_FIRST && (N) <= GP_OUTGOING_ARG_LAST)
@@ -767,14 +767,14 @@ extern enum reg_class xtensa_char_to_class[256];
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. */
+ 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. */
+ For a library call, FNTYPE is 0. */
#define INIT_CUMULATIVE_ARGS(CUM, FNTYPE, LIBNAME, INDIRECT) \
init_cumulative_args (&CUM, FNTYPE, LIBNAME)
@@ -816,7 +816,7 @@ typedef struct xtensa_args {
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. */
+ into the wrong part of the register. */
#define MUST_PASS_IN_STACK(MODE, TYPE) \
((TYPE) != 0 \
@@ -835,7 +835,7 @@ typedef struct xtensa_args {
values contain window size information in the two most significant
bits; we assume that _mcount will mask off those bits. The call to
_mcount uses a window size of 8 to make sure that it doesn't clobber
- any incoming argument values. */
+ any incoming argument values. */
#define NO_PROFILE_COUNTERS 1
@@ -865,7 +865,7 @@ typedef struct xtensa_args {
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. */
+ 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 */
@@ -930,15 +930,11 @@ typedef struct xtensa_args {
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'. */
+ contains the value to use as the return of '__builtin_saveregs'. */
#define EXPAND_BUILTIN_SAVEREGS \
xtensa_builtin_saveregs
@@ -966,7 +962,7 @@ typedef struct xtensa_args {
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. */
+ builtin functions are used. */
#define SETUP_FRAME_ADDRESSES xtensa_setup_frame_addresses
@@ -980,14 +976,14 @@ typedef struct xtensa_args {
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. */
+ 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. */
+ 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
@@ -1002,7 +998,7 @@ typedef struct xtensa_args {
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. */
+ be scaled. */
#define REGNO_OK_FOR_BASE_P(NUM) \
(GP_REG_P (NUM) || GP_REG_P ((unsigned) reg_renumber[NUM]))
@@ -1016,7 +1012,7 @@ typedef struct xtensa_args {
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. */
+ register is that the index register may be scaled. */
#ifdef REG_OK_STRICT
@@ -1095,7 +1091,7 @@ typedef struct xtensa_args {
|| (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. */
+ 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
@@ -1183,7 +1179,7 @@ typedef struct xtensa_args {
#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. */
+ is done just by pretending it is already truncated. */
#define TRULY_NOOP_TRUNCATION(OUTPREC, INPREC) 1
/* Specify the machine mode that pointers have.
@@ -1249,7 +1245,7 @@ typedef struct xtensa_args {
/* 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). */
+ This sequence is indexed by compiler's hard-register-number (see above). */
#define REGISTER_NAMES \
{ \
"a0", "sp", "a2", "a3", "a4", "a5", "a6", "a7", \
@@ -1263,7 +1259,7 @@ typedef struct xtensa_args {
/* 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. */
+ to refer to registers using alternate names. */
#define ADDITIONAL_REGISTER_NAMES \
{ \
{ "a1", 1 + GP_REG_FIRST } \
@@ -1306,7 +1302,7 @@ typedef struct xtensa_args {
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. */
+ This is used for pc-relative code. */
#define ASM_OUTPUT_ADDR_DIFF_ELT(STREAM, BODY, VALUE, REL) \
do { \
fprintf (STREAM, "%s%sL%u-%sL%u\n", integer_asm_op (4, TRUE), \
@@ -1336,7 +1332,7 @@ typedef struct xtensa_args {
/* 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. */
+ prefix. */
#define ASM_OUTPUT_POOL_PROLOGUE(FILE, FUNNAME, FUNDECL, SIZE) \
do { \
tree fnsection; \
@@ -1371,7 +1367,7 @@ typedef struct xtensa_args {
goto JUMPTO; \
} while (0)
-/* How to start an assembler comment. */
+/* How to start an assembler comment. */
#define ASM_COMMENT_START "#"
/* Exception handling TODO!! */
diff --git a/gcc/configure b/gcc/configure
index e539c125d94..09b733dc1da 100755
--- a/gcc/configure
+++ b/gcc/configure
@@ -46,6 +46,8 @@ ac_help="$ac_help
optimization. Values are opt, noopt,
default is noopt"
ac_help="$ac_help
+ --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering"
+ac_help="$ac_help
--with-stabs arrange to use stabs instead of host debug format"
ac_help="$ac_help
--enable-multilib enable library support for multiple ABIs"
@@ -657,7 +659,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:663: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -678,7 +680,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:684: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -696,7 +698,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:702: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -775,7 +777,7 @@ test "$program_transform_name" = "" && program_transform_name="s,x,x,"
# - 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:779: checking LIBRARY_PATH variable" >&5
+echo "configure:781: checking LIBRARY_PATH variable" >&5
case ${LIBRARY_PATH} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
library_path_setting="contains current directory"
@@ -800,7 +802,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:804: checking GCC_EXEC_PREFIX variable" >&5
+echo "configure:806: checking GCC_EXEC_PREFIX variable" >&5
case ${GCC_EXEC_PREFIX} in
[:\;]* | *[:\;] | *[:\;][:\;]* | *[:\;]. | .[:\;]*| . | *[:\;].[:\;]* )
gcc_exec_prefix_setting="contains current directory"
@@ -927,7 +929,7 @@ EOF
fi
echo $ac_n "checking whether a default linker was specified""... $ac_c" 1>&6
-echo "configure:931: checking whether a default linker was specified" >&5
+echo "configure:933: 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
@@ -971,7 +973,7 @@ EOF
fi
echo $ac_n "checking whether a default assembler was specified""... $ac_c" 1>&6
-echo "configure:975: checking whether a default assembler was specified" >&5
+echo "configure:977: 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
@@ -990,7 +992,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:994: checking for $ac_word" >&5
+echo "configure:996: 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
@@ -1020,7 +1022,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:1024: checking for $ac_word" >&5
+echo "configure:1026: 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
@@ -1071,7 +1073,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:1075: checking for $ac_word" >&5
+echo "configure:1077: 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
@@ -1103,7 +1105,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1107: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:1109: 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.
@@ -1114,12 +1116,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 1118 "configure"
+#line 1120 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:1123: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1125: \"$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
@@ -1145,12 +1147,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:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:1151: 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:1154: checking whether we are using GNU C" >&5
+echo "configure:1156: 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
@@ -1159,7 +1161,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1163: \"$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:1165: \"$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
@@ -1178,7 +1180,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:1182: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1184: 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
@@ -1211,10 +1213,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:1215: checking whether $CC and cc understand -c and -o together" >&5
+echo "configure:1217: 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:1218: checking whether cc understands -c and -o together" >&5
+echo "configure:1220: 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]/_/'`"
@@ -1226,16 +1228,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:1230: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+if { (eval echo configure:1232: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1233: \"$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:1236: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ if { ac_try='cc -c conftest.c 1>&5'; { (eval echo configure:1238: \"$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:1238: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
- test -f conftest.o && { (eval echo configure:1239: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
+ if { (eval echo configure:1240: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } &&
+ test -f conftest.o && { (eval echo configure:1241: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; };
then
# cc works too.
:
@@ -1275,21 +1277,21 @@ fi
# -------------------------
echo $ac_n "checking whether ${CC-cc} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1279: checking whether ${CC-cc} accepts -Wno-long-long" >&5
+echo "configure:1281: 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 1286 "configure"
+#line 1288 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1293: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1295: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_prog_cc_no_long_long=yes
else
@@ -1305,7 +1307,7 @@ fi
echo "$ac_t""$ac_cv_prog_cc_no_long_long" 1>&6
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:1309: checking how to run the C preprocessor" >&5
+echo "configure:1311: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -1320,13 +1322,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 1324 "configure"
+#line 1326 "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:1330: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1332: \"$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
:
@@ -1337,13 +1339,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 1341 "configure"
+#line 1343 "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:1347: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1349: \"$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
:
@@ -1354,13 +1356,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 1358 "configure"
+#line 1360 "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:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:1366: \"$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
:
@@ -1385,21 +1387,21 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1389: checking for inline" >&5
+echo "configure:1391: 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 1396 "configure"
+#line 1398 "configure"
#include "confdefs.h"
int main() {
} $ac_kw foo() {
; return 0; }
EOF
-if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1405: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_inline=$ac_kw; break
else
@@ -1426,19 +1428,19 @@ esac
echo $ac_n "checking for long long int""... $ac_c" 1>&6
-echo "configure:1430: checking for long long int" >&5
+echo "configure:1432: checking for long long int" >&5
if eval "test \"`echo '$''{'ac_cv_c_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1435 "configure"
+#line 1437 "configure"
#include "confdefs.h"
int main() {
long long int i;
; return 0; }
EOF
-if { (eval echo configure:1442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1444: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_long_long=yes
else
@@ -1458,19 +1460,19 @@ EOF
fi
echo $ac_n "checking for __int64""... $ac_c" 1>&6
-echo "configure:1462: checking for __int64" >&5
+echo "configure:1464: checking for __int64" >&5
if eval "test \"`echo '$''{'ac_cv_c___int64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 1467 "configure"
+#line 1469 "configure"
#include "confdefs.h"
int main() {
__int64 i;
; return 0; }
EOF
-if { (eval echo configure:1474: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c___int64=yes
else
@@ -1491,19 +1493,19 @@ EOF
fi
echo $ac_n "checking for built-in _Bool""... $ac_c" 1>&6
-echo "configure:1495: checking for built-in _Bool" >&5
+echo "configure:1497: 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 1500 "configure"
+#line 1502 "configure"
#include "confdefs.h"
int main() {
_Bool foo;
; return 0; }
EOF
-if { (eval echo configure:1507: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c__bool=yes
else
@@ -1527,13 +1529,13 @@ fi
# sizeof(char) is 1 by definition.
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:1531: checking size of void *" >&5
+echo "configure:1533: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1537 "configure"
+#line 1539 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1543,7 +1545,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1547: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1549: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -1566,13 +1568,13 @@ EOF
echo $ac_n "checking size of short""... $ac_c" 1>&6
-echo "configure:1570: checking size of short" >&5
+echo "configure:1572: checking size of short" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1576 "configure"
+#line 1578 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1582,7 +1584,7 @@ int main() {
switch (0) case 0: case (sizeof (short) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1586: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1588: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_short=$ac_size
else
@@ -1605,13 +1607,13 @@ EOF
echo $ac_n "checking size of int""... $ac_c" 1>&6
-echo "configure:1609: checking size of int" >&5
+echo "configure:1611: checking size of int" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1615 "configure"
+#line 1617 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1621,7 +1623,7 @@ int main() {
switch (0) case 0: case (sizeof (int) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1625: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1627: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_int=$ac_size
else
@@ -1644,13 +1646,13 @@ EOF
echo $ac_n "checking size of long""... $ac_c" 1>&6
-echo "configure:1648: checking size of long" >&5
+echo "configure:1650: checking size of long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1654 "configure"
+#line 1656 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1660,7 +1662,7 @@ int main() {
switch (0) case 0: case (sizeof (long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1664: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1666: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long=$ac_size
else
@@ -1684,13 +1686,13 @@ EOF
if test $ac_cv_c_long_long = yes; then
echo $ac_n "checking size of long long""... $ac_c" 1>&6
-echo "configure:1688: checking size of long long" >&5
+echo "configure:1690: checking size of long long" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1694 "configure"
+#line 1696 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1700,7 +1702,7 @@ int main() {
switch (0) case 0: case (sizeof (long long) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1704: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1706: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_long=$ac_size
else
@@ -1725,13 +1727,13 @@ EOF
fi
if test $ac_cv_c___int64 = yes; then
echo $ac_n "checking size of __int64""... $ac_c" 1>&6
-echo "configure:1729: checking size of __int64" >&5
+echo "configure:1731: checking size of __int64" >&5
if eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 1735 "configure"
+#line 1737 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -1741,7 +1743,7 @@ int main() {
switch (0) case 0: case (sizeof (__int64) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:1745: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof___int64=$ac_size
else
@@ -1777,10 +1779,11 @@ else
fi
+
# Extract the first word of "${ac_tool_prefix}gnatbind", so it can be a program name with args.
set dummy ${ac_tool_prefix}gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1784: checking for $ac_word" >&5
+echo "configure:1787: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1812,7 +1815,7 @@ if test -n "$ac_tool_prefix"; then
# Extract the first word of "gnatbind", so it can be a program name with args.
set dummy gnatbind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1816: checking for $ac_word" >&5
+echo "configure:1819: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_GNATBIND'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1844,77 +1847,43 @@ else
fi
fi
-echo $ac_n "checking for compiler driver that understands Ada""... $ac_c" 1>&6
-echo "configure:1849: checking for compiler driver that understands Ada" >&5
-if eval "test \"`echo '$''{'gcc_cv_prog_adac'+set}'`\" = set"; then
+echo $ac_n "checking whether compiler driver understands Ada""... $ac_c" 1>&6
+echo "configure:1852: checking whether compiler driver understands Ada" >&5
+if eval "test \"`echo '$''{'gcc_cv_cc_supports_ada'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat >conftest.adb <<EOF
procedure conftest is begin null; end conftest;
EOF
-gcc_cv_prog_adac=no
-# Have to do ac_tool_prefix and user overrides by hand.
-for cand in ${ADAC+"$ADAC"} ${CC+"$CC"} \
- ${ac_tool_prefix}gcc gcc \
- ${ac_tool_prefix}cc cc \
- ${ac_tool_prefix}gnatgcc gnatgcc \
- ${ac_tool_prefix}gnatcc gnatcc \
- ${ac_tool_prefix}adagcc adagcc \
- ${ac_tool_prefix}adacc adacc ; do
- # There is a bug in all released versions of GCC which causes the
- # driver to exit successfully when the appropriate language module
- # has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
- # Therefore we must check for the error message as well as an
- # unsuccessful exit.
- errors=`($cand -c conftest.adb) 2>&1 || echo failure`
- if test x"$errors" = x; then
- gcc_cv_prog_adac=$cand
- break
- fi
-done
+gcc_cv_cc_supports_ada=no
+# There is a bug in old released versions of GCC which causes the
+# driver to exit successfully when the appropriate language module
+# has not been installed. This is fixed in 2.95.4, 3.0.2, and 3.1.
+# Therefore we must check for the error message as well as an
+# unsuccessful exit.
+errors=`(${CC} -c conftest.adb) 2>&1 || echo failure`
+if test x"$errors" = x; then
+ gcc_cv_cc_supports_ada=yes
+ break
+fi
rm -f conftest.*
fi
-echo "$ac_t""$gcc_cv_prog_adac" 1>&6
-ADAC=$gcc_cv_prog_adac
-
+echo "$ac_t""$gcc_cv_cc_supports_ada" 1>&6
-if test x$GNATBIND != xno && test x$ADAC != xno; then
+if test x$GNATBIND != xno && test x$gcc_cv_supports_ada != xno; then
have_gnat=yes
else
have_gnat=no
fi
-if test x$have_gnat != xno ; then
-echo $ac_n "checking whether ${ADAC} accepts -Wno-long-long""... $ac_c" 1>&6
-echo "configure:1892: checking whether ${ADAC} accepts -Wno-long-long" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_adac_no_long_long'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
- cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
- ac_cv_prog_adac_no_long_long=yes
-else
- ac_cv_prog_adac_no_long_long=no
-fi
-rm -f conftest*
-fi
-
-echo "$ac_t""$ac_cv_prog_adac_no_long_long" 1>&6
-else
- ac_cv_prog_adac_no_long_long=yes
-fi
-
# ---------------------
# Warnings and checking
# ---------------------
strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes && \
- test $ac_cv_prog_adac_no_long_long = yes ; then
+if test $ac_cv_prog_cc_no_long_long = yes ; then
strict1_warn="-pedantic -Wno-long-long"
fi
@@ -2030,68 +1999,95 @@ EOF
fi
valgrind_path_defines=
valgrind_command=
+
+ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
+echo "configure:2006: checking for valgrind.h" >&5
+if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2011 "configure"
+#include "confdefs.h"
+#include <valgrind.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:2016: \"$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
+ have_valgrind_h=yes
+else
+ echo "$ac_t""no" 1>&6
+have_valgrind_h=no
+fi
+
+
if test x$ac_checking_valgrind != x ; then
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
- echo $ac_n "checking for VALGRIND_DISCARD in <memcheck.h>""... $ac_c" 1>&6
-echo "configure:2038: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
+ echo $ac_n "checking for VALGRIND_DISCARD in <valgrind/memcheck.h>""... $ac_c" 1>&6
+echo "configure:2043: checking for VALGRIND_DISCARD in <valgrind/memcheck.h>" >&5
cat > conftest.$ac_ext <<EOF
-#line 2040 "configure"
+#line 2045 "configure"
#include "confdefs.h"
-#include <memcheck.h>
+#include <valgrind/memcheck.h>
#ifndef VALGRIND_DISCARD
#error VALGRIND_DISCARD not defined
#endif
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2048: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2053: \"$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*
- gcc_cv_header_memcheck_h=yes
+ gcc_cv_header_valgrind_memcheck_h=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- gcc_cv_header_memcheck_h=no
+ gcc_cv_header_valgrind_memcheck_h=no
fi
rm -f conftest*
- echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
- ac_safe=`echo "valgrind.h" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for valgrind.h""... $ac_c" 1>&6
-echo "configure:2064: checking for valgrind.h" >&5
-if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
-else
+ echo "$ac_t""$gcc_cv_header_valgrind_memcheck_h" 1>&6
+ echo $ac_n "checking for VALGRIND_DISCARD in <memcheck.h>""... $ac_c" 1>&6
+echo "configure:2068: checking for VALGRIND_DISCARD in <memcheck.h>" >&5
cat > conftest.$ac_ext <<EOF
-#line 2069 "configure"
+#line 2070 "configure"
#include "confdefs.h"
-#include <valgrind.h>
+#include <memcheck.h>
+#ifndef VALGRIND_DISCARD
+#error VALGRIND_DISCARD not defined
+#endif
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2074: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2078: \"$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"
+ gcc_cv_header_memcheck_h=yes
else
echo "$ac_err" >&5
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_header_$ac_safe=no"
+ gcc_cv_header_memcheck_h=no
fi
rm -f conftest*
-fi
-if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- have_valgrind_h=yes
-else
- echo "$ac_t""no" 1>&6
-have_valgrind_h=no
-fi
-
+ echo "$ac_t""$gcc_cv_header_memcheck_h" 1>&6
# Prepare PATH_SEPARATOR.
# The user is always right.
@@ -2124,7 +2120,7 @@ rm -f conf$$.file
# Extract the first word of "valgrind", so it can be a program name with args.
set dummy valgrind; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2128: checking for $ac_word" >&5
+echo "configure:2124: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_valgrind_path'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2157,8 +2153,11 @@ else
echo "$ac_t""no" 1>&6
fi
- if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
- { echo "configure: error: *** Can't find both valgrind and valgrind.h/memcheck.h" 1>&2; exit 1; }
+ if test "x$valgrind_path" = "x" \
+ || (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ { echo "configure: error: *** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h" 1>&2; exit 1; }
fi
valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
valgrind_command="$valgrind_path -q"
@@ -2166,6 +2165,12 @@ fi
#define ENABLE_VALGRIND_CHECKING 1
EOF
+ if test $gcc_cv_header_valgrind_memcheck_h = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_VALGRIND_MEMCHECK_H 1
+EOF
+
+ fi
if test $gcc_cv_header_memcheck_h = yes; then
cat >> confdefs.h <<\EOF
#define HAVE_MEMCHECK_H 1
@@ -2197,6 +2202,21 @@ fi
+# Check whether --enable-gather-detailed-mem-stats or --disable-gather-detailed-mem-stats was given.
+if test "${enable_gather_detailed_mem_stats+set}" = set; then
+ enableval="$enable_gather_detailed_mem_stats"
+ :
+else
+ enable_gather_detailed_mem_stats=no
+fi
+
+if test x$enable_gather_detailed_mem_stats = xyes ; then
+ cat >> confdefs.h <<\EOF
+#define GATHER_STATISTICS 1
+EOF
+
+fi
+
# -------------------------------
# Miscenalleous configure options
# -------------------------------
@@ -2350,7 +2370,7 @@ fi
# -------------------------
echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:2354: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2374: 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
@@ -2383,7 +2403,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:2387: checking for $ac_word" >&5
+echo "configure:2407: 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
@@ -2412,8 +2432,14 @@ fi
test -n "$AWK" && break
done
+# We need awk to run opts.sh (to create options.c and options.h).
+# Bail out if it's missing.
+case ${AWK} in
+ "") { echo "configure: error: can't build without awk, bailing out" 1>&2; exit 1; } ;;
+esac
+
echo $ac_n "checking whether ln works""... $ac_c" 1>&6
-echo "configure:2417: checking whether ln works" >&5
+echo "configure:2443: 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
@@ -2445,7 +2471,7 @@ else
fi
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:2449: checking whether ln -s works" >&5
+echo "configure:2475: 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
@@ -2479,7 +2505,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:2483: checking for $ac_word" >&5
+echo "configure:2509: 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
@@ -2517,7 +2543,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:2521: checking for a BSD compatible install" >&5
+echo "configure:2547: 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
@@ -2569,7 +2595,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
# See if cmp has --ignore-initial.
echo $ac_n "checking for cmp's capabilities""... $ac_c" 1>&6
-echo "configure:2573: checking for cmp's capabilities" >&5
+echo "configure:2599: checking for cmp's capabilities" >&5
if eval "test \"`echo '$''{'gcc_cv_prog_cmp_skip'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2605,7 +2631,7 @@ make_compare_target=$gcc_cv_prog_cmp_skip
# 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:2609: checking for $ac_word" >&5
+echo "configure:2635: 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
@@ -2644,7 +2670,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:2648: checking for $ac_word" >&5
+echo "configure:2674: 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
@@ -2673,13 +2699,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:2677: checking for modern makeinfo" >&5
+echo "configure:2703: 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:2683: version of makeinfo is $ac_prog_version" >&5
+ echo "configure:2709: version of makeinfo is $ac_prog_version" >&5
case $ac_prog_version in
'') gcc_cv_prog_makeinfo_modern=no;;
4.[2-9]*)
@@ -2707,7 +2733,7 @@ fi
# Is pod2man recent enough to regenerate manpages?
echo $ac_n "checking for recent Pod::Man""... $ac_c" 1>&6
-echo "configure:2711: checking for recent Pod::Man" >&5
+echo "configure:2737: 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
@@ -2723,7 +2749,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:2727: checking for $ac_word" >&5
+echo "configure:2753: 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
@@ -2760,7 +2786,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:2764: checking for $ac_word" >&5
+echo "configure:2790: 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
@@ -2794,12 +2820,12 @@ fi
# --------------------
echo $ac_n "checking for GNU C library""... $ac_c" 1>&6
-echo "configure:2798: checking for GNU C library" >&5
+echo "configure:2824: 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 2803 "configure"
+#line 2829 "configure"
#include "confdefs.h"
#include <features.h>
int main() {
@@ -2809,7 +2835,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:2813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2839: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_glibc=yes
else
@@ -2830,12 +2856,12 @@ EOF
fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2834: checking for ANSI C header files" >&5
+echo "configure:2860: 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 2839 "configure"
+#line 2865 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2843,7 +2869,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2847: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2873: \"$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*
@@ -2860,7 +2886,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 2864 "configure"
+#line 2890 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2878,7 +2904,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 2882 "configure"
+#line 2908 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2899,7 +2925,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2903 "configure"
+#line 2929 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2910,7 +2936,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2914: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2940: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2934,12 +2960,12 @@ EOF
fi
echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2938: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2964: 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 2943 "configure"
+#line 2969 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/time.h>
@@ -2948,7 +2974,7 @@ int main() {
struct tm *tp;
; return 0; }
EOF
-if { (eval echo configure:2952: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2978: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_time=yes
else
@@ -2969,19 +2995,19 @@ EOF
fi
echo $ac_n "checking for working stdbool.h""... $ac_c" 1>&6
-echo "configure:2973: checking for working stdbool.h" >&5
+echo "configure:2999: 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 2978 "configure"
+#line 3004 "configure"
#include "confdefs.h"
#include <stdbool.h>
int main() {
bool foo = false;
; return 0; }
EOF
-if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3011: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_stdbool_h=yes
else
@@ -3002,12 +3028,12 @@ EOF
fi
echo $ac_n "checking whether string.h and strings.h may both be included""... $ac_c" 1>&6
-echo "configure:3006: checking whether string.h and strings.h may both be included" >&5
+echo "configure:3032: 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 3011 "configure"
+#line 3037 "configure"
#include "confdefs.h"
#include <string.h>
#include <strings.h>
@@ -3015,7 +3041,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:3019: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_string=yes
else
@@ -3036,12 +3062,12 @@ EOF
fi
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:3040: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:3066: 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 3045 "configure"
+#line 3071 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -3057,7 +3083,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:3061: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3087: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -3084,17 +3110,17 @@ for ac_hdr in limits.h stddef.h string.h strings.h stdlib.h time.h \
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3088: checking for $ac_hdr" >&5
+echo "configure:3114: 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 3093 "configure"
+#line 3119 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3098: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3124: \"$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*
@@ -3124,17 +3150,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:3128: checking for thread.h" >&5
+echo "configure:3154: 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 3133 "configure"
+#line 3159 "configure"
#include "confdefs.h"
#include <thread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3138: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3164: \"$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*
@@ -3158,17 +3184,17 @@ fi
ac_safe=`echo "pthread.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for pthread.h""... $ac_c" 1>&6
-echo "configure:3162: checking for pthread.h" >&5
+echo "configure:3188: 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 3167 "configure"
+#line 3193 "configure"
#include "confdefs.h"
#include <pthread.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3198: \"$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*
@@ -3193,12 +3219,12 @@ fi
# These tests can't be done till we know if we have limits.h.
echo $ac_n "checking for CHAR_BIT""... $ac_c" 1>&6
-echo "configure:3197: checking for CHAR_BIT" >&5
+echo "configure:3223: checking for CHAR_BIT" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_char_bit'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3202 "configure"
+#line 3228 "configure"
#include "confdefs.h"
#ifdef HAVE_LIMITS_H
#include <limits.h>
@@ -3223,7 +3249,7 @@ fi
echo "$ac_t""$gcc_cv_decl_char_bit" 1>&6
if test $gcc_cv_decl_char_bit = no; then
echo $ac_n "checking number of bits in a byte""... $ac_c" 1>&6
-echo "configure:3227: checking number of bits in a byte" >&5
+echo "configure:3253: checking number of bits in a byte" >&5
if eval "test \"`echo '$''{'gcc_cv_c_nbby'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3231,7 +3257,7 @@ else
gcc_cv_c_nbby=
while test $i -lt 65; do
cat > conftest.$ac_ext <<EOF
-#line 3235 "configure"
+#line 3261 "configure"
#include "confdefs.h"
int main() {
@@ -3241,7 +3267,7 @@ switch(0) {
; }
; return 0; }
EOF
-if { (eval echo configure:3245: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_c_nbby=$i; break
else
@@ -3266,14 +3292,14 @@ EOF
fi
fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3270: checking whether byte ordering is bigendian" >&5
+echo "configure:3296: 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 3277 "configure"
+#line 3303 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3284,11 +3310,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3288: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3314: \"$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 3292 "configure"
+#line 3318 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3299,7 +3325,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3303: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3329: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3319,7 +3345,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3323 "configure"
+#line 3349 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3332,7 +3358,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3362: \"$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
@@ -3350,7 +3376,7 @@ fi
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = unknown; then
echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:3354: checking to probe for byte ordering" >&5
+echo "configure:3380: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3430,7 +3456,7 @@ esac
# These libraries may be used by collect2.
# We may need a special search path to get them linked.
echo $ac_n "checking for collect2 libraries""... $ac_c" 1>&6
-echo "configure:3434: checking for collect2 libraries" >&5
+echo "configure:3460: checking for collect2 libraries" >&5
if eval "test \"`echo '$''{'gcc_cv_collect2_libs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3441,7 +3467,7 @@ for libs in '' -lld -lmld \
do
LIBS="$libs"
cat > conftest.$ac_ext <<EOF
-#line 3445 "configure"
+#line 3471 "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
@@ -3452,7 +3478,7 @@ int main() {
ldopen()
; return 0; }
EOF
-if { (eval echo configure:3456: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
gcc_cv_collect2_libs="$libs"; break
else
@@ -3478,14 +3504,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing exc_resume""... $ac_c" 1>&6
-echo "configure:3482: checking for library containing exc_resume" >&5
+echo "configure:3508: checking for library containing exc_resume" >&5
if eval "test \"`echo '$''{'ac_cv_search_exc_resume'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_exc_resume="no"
cat > conftest.$ac_ext <<EOF
-#line 3489 "configure"
+#line 3515 "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
@@ -3496,7 +3522,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3500: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3526: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_exc_resume="none required"
else
@@ -3507,7 +3533,7 @@ rm -f conftest*
test "$ac_cv_search_exc_resume" = "no" && for i in exc; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3511 "configure"
+#line 3537 "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
@@ -3518,7 +3544,7 @@ int main() {
exc_resume()
; return 0; }
EOF
-if { (eval echo configure:3522: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_exc_resume="-l$i"
break
@@ -3548,14 +3574,14 @@ save_LIBS="$LIBS"
LIBS=
echo $ac_n "checking for library containing ldexp""... $ac_c" 1>&6
-echo "configure:3552: checking for library containing ldexp" >&5
+echo "configure:3578: checking for library containing ldexp" >&5
if eval "test \"`echo '$''{'ac_cv_search_ldexp'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_ldexp="no"
cat > conftest.$ac_ext <<EOF
-#line 3559 "configure"
+#line 3585 "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
@@ -3566,7 +3592,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3596: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_ldexp="none required"
else
@@ -3577,7 +3603,7 @@ rm -f conftest*
test "$ac_cv_search_ldexp" = "no" && for i in m; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3581 "configure"
+#line 3607 "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
@@ -3588,7 +3614,7 @@ int main() {
ldexp()
; return 0; }
EOF
-if { (eval echo configure:3592: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3618: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_ldexp="-l$i"
break
@@ -3615,12 +3641,12 @@ LIBS="$save_LIBS"
# 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:3619: checking for inttypes.h" >&5
+echo "configure:3645: 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 3624 "configure"
+#line 3650 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <inttypes.h>
@@ -3628,7 +3654,7 @@ int main() {
intmax_t i = -1;
; return 0; }
EOF
-if { (eval echo configure:3632: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3658: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_header_inttypes_h=yes
else
@@ -3656,12 +3682,12 @@ for ac_func in times clock dup2 kill getrlimit setrlimit atoll atoq \
setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3660: checking for $ac_func" >&5
+echo "configure:3686: 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 3665 "configure"
+#line 3691 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3684,7 +3710,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3688: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3714: \"$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
@@ -3711,7 +3737,7 @@ done
if test x$ac_cv_func_mbstowcs = xyes; then
echo $ac_n "checking whether mbstowcs works""... $ac_c" 1>&6
-echo "configure:3715: checking whether mbstowcs works" >&5
+echo "configure:3741: checking whether mbstowcs works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mbstowcs_works'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3719,7 +3745,7 @@ else
gcc_cv_func_mbstowcs_works=yes
else
cat > conftest.$ac_ext <<EOF
-#line 3723 "configure"
+#line 3749 "configure"
#include "confdefs.h"
#include <stdlib.h>
int main()
@@ -3728,7 +3754,7 @@ int main()
return 0;
}
EOF
-if { (eval echo configure:3732: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_func_mbstowcs_works=yes
else
@@ -3752,12 +3778,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:3756: checking for ssize_t" >&5
+echo "configure:3782: 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 3761 "configure"
+#line 3787 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -3788,12 +3814,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:3792: checking for uid_t in sys/types.h" >&5
+echo "configure:3818: 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 3797 "configure"
+#line 3823 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3822,7 +3848,7 @@ EOF
fi
echo $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6
-echo "configure:3826: checking type of array argument to getgroups" >&5
+echo "configure:3852: 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
@@ -3830,7 +3856,7 @@ else
ac_cv_type_getgroups=cross
else
cat > conftest.$ac_ext <<EOF
-#line 3834 "configure"
+#line 3860 "configure"
#include "confdefs.h"
/* Thanks to Mike Rendell for this test. */
@@ -3855,7 +3881,7 @@ main()
}
EOF
-if { (eval echo configure:3859: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3885: \"$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
@@ -3869,7 +3895,7 @@ fi
if test $ac_cv_type_getgroups = cross; then
cat > conftest.$ac_ext <<EOF
-#line 3873 "configure"
+#line 3899 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -3910,7 +3936,7 @@ fi
echo $ac_n "checking whether the printf functions support %p""... $ac_c" 1>&6
-echo "configure:3914: checking whether the printf functions support %p" >&5
+echo "configure:3940: 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
@@ -3918,7 +3944,7 @@ else
gcc_cv_func_printf_ptr=no
else
cat > conftest.$ac_ext <<EOF
-#line 3922 "configure"
+#line 3948 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -3931,7 +3957,7 @@ int main()
return (p != q);
}
EOF
-if { (eval echo configure:3935: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3961: \"$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
@@ -3961,7 +3987,7 @@ if test $ac_cv_header_sys_mman_h != yes \
gcc_cv_func_mmap_anon=no
else
echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6
-echo "configure:3965: checking whether read-only mmap of a plain file works" >&5
+echo "configure:3991: checking whether read-only mmap of a plain file works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_file'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3971,7 +3997,7 @@ else
# read() to the same fd. The only system known to have a problem here
# is VMS, where text files have record structure.
case "$host_os" in
- vms*)
+ vms* | ultrix*)
gcc_cv_func_mmap_file=no ;;
*)
gcc_cv_func_mmap_file=yes;;
@@ -3980,7 +4006,7 @@ fi
echo "$ac_t""$gcc_cv_func_mmap_file" 1>&6
echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6
-echo "configure:3984: checking whether mmap from /dev/zero works" >&5
+echo "configure:4010: checking whether mmap from /dev/zero works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_dev_zero'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4006,12 +4032,12 @@ echo "$ac_t""$gcc_cv_func_mmap_dev_zero" 1>&6
# Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6
-echo "configure:4010: checking for MAP_ANON(YMOUS)" >&5
+echo "configure:4036: checking for MAP_ANON(YMOUS)" >&5
if eval "test \"`echo '$''{'gcc_cv_decl_map_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4015 "configure"
+#line 4041 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/mman.h>
@@ -4025,7 +4051,7 @@ int main() {
int n = MAP_ANONYMOUS;
; return 0; }
EOF
-if { (eval echo configure:4029: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4055: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_decl_map_anon=yes
else
@@ -4043,7 +4069,7 @@ echo "$ac_t""$gcc_cv_decl_map_anon" 1>&6
gcc_cv_func_mmap_anon=no
else
echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6
-echo "configure:4047: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+echo "configure:4073: checking whether mmap with MAP_ANON(YMOUS) works" >&5
if eval "test \"`echo '$''{'gcc_cv_func_mmap_anon'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4093,12 +4119,12 @@ case "${host}" in
;;
esac
echo $ac_n "checking for pid_t""... $ac_c" 1>&6
-echo "configure:4097: checking for pid_t" >&5
+echo "configure:4123: 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 4102 "configure"
+#line 4128 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -4127,17 +4153,17 @@ fi
ac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for vfork.h""... $ac_c" 1>&6
-echo "configure:4131: checking for vfork.h" >&5
+echo "configure:4157: 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 4136 "configure"
+#line 4162 "configure"
#include "confdefs.h"
#include <vfork.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4141: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4167: \"$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*
@@ -4162,18 +4188,18 @@ else
fi
echo $ac_n "checking for working vfork""... $ac_c" 1>&6
-echo "configure:4166: checking for working vfork" >&5
+echo "configure:4192: 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:4172: checking for vfork" >&5
+echo "configure:4198: 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 4177 "configure"
+#line 4203 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char vfork(); below. */
@@ -4196,7 +4222,7 @@ vfork();
; return 0; }
EOF
-if { (eval echo configure:4200: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4226: \"$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
@@ -4218,7 +4244,7 @@ fi
ac_cv_func_vfork_works=$ac_cv_func_vfork
else
cat > conftest.$ac_ext <<EOF
-#line 4222 "configure"
+#line 4248 "configure"
#include "confdefs.h"
/* Thanks to Paul Eggert for this test. */
#include <stdio.h>
@@ -4313,7 +4339,7 @@ main() {
}
}
EOF
-if { (eval echo configure:4317: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:4343: \"$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
@@ -4351,8 +4377,49 @@ if test "${with_libiconv_prefix+set}" = set; then
fi
+ for ac_hdr in iconv.h
+do
+ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
+echo "configure:4385: 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 4390 "configure"
+#include "confdefs.h"
+#include <$ac_hdr>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4395: \"$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
+fi
+done
+
+
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:4356: checking for iconv" >&5
+echo "configure:4423: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4360,7 +4427,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 4364 "configure"
+#line 4431 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4370,7 +4437,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4374: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4441: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -4382,7 +4449,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 4386 "configure"
+#line 4453 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -4392,7 +4459,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:4396: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4463: \"$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
@@ -4413,13 +4480,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:4417: checking for iconv declaration" >&5
+echo "configure:4484: 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 4423 "configure"
+#line 4490 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -4438,7 +4505,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:4442: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4509: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -4471,19 +4538,19 @@ LIBICONV_DEP=
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:4475: checking for LC_MESSAGES" >&5
+echo "configure:4542: 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 4480 "configure"
+#line 4547 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:4487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4554: \"$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
@@ -4514,12 +4581,12 @@ for ac_func in getenv atol sbrk abort atof getcwd getwd \
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4518: checking whether $ac_func is declared" >&5
+echo "configure:4585: 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 4523 "configure"
+#line 4590 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4533,7 +4600,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4537: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4638,12 +4705,12 @@ for ac_func in getrlimit setrlimit getrusage
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4642: checking whether $ac_func is declared" >&5
+echo "configure:4709: 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 4647 "configure"
+#line 4714 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4661,7 +4728,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4665: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4732: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4700,7 +4767,7 @@ fi
cat > conftest.$ac_ext <<EOF
-#line 4704 "configure"
+#line 4771 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4713,7 +4780,7 @@ int main() {
rlim_t l = 0;
; return 0; }
EOF
-if { (eval echo configure:4717: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4784: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
:
else
echo "configure: failed program was:" >&5
@@ -4730,12 +4797,12 @@ for ac_func in ldgetname
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4734: checking whether $ac_func is declared" >&5
+echo "configure:4801: 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 4739 "configure"
+#line 4806 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4753,7 +4820,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4824: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4789,12 +4856,12 @@ for ac_func in times
do
ac_tr_decl=HAVE_DECL_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
echo $ac_n "checking whether $ac_func is declared""... $ac_c" 1>&6
-echo "configure:4793: checking whether $ac_func is declared" >&5
+echo "configure:4860: 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 4798 "configure"
+#line 4865 "configure"
#include "confdefs.h"
#undef $ac_tr_decl
#define $ac_tr_decl 1
@@ -4812,7 +4879,7 @@ char *(*pfn) = (char *(*)) $ac_func ;
#endif
; return 0; }
EOF
-if { (eval echo configure:4816: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4883: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
eval "gcc_cv_have_decl_$ac_func=yes"
else
@@ -4846,13 +4913,13 @@ fi
# More time-related stuff.
echo $ac_n "checking for struct tms""... $ac_c" 1>&6
-echo "configure:4850: checking for struct tms" >&5
+echo "configure:4917: checking for struct tms" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tms'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4856 "configure"
+#line 4923 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4865,7 +4932,7 @@ int main() {
struct tms tms;
; return 0; }
EOF
-if { (eval echo configure:4869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4936: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tms=yes
else
@@ -4888,13 +4955,13 @@ fi
# use gcc_cv_* here because this doesn't match the behavior of AC_CHECK_TYPE.
# revisit after autoconf 2.50.
echo $ac_n "checking for clock_t""... $ac_c" 1>&6
-echo "configure:4892: checking for clock_t" >&5
+echo "configure:4959: checking for clock_t" >&5
if eval "test \"`echo '$''{'gcc_cv_type_clock_t'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4898 "configure"
+#line 4965 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4904,7 +4971,7 @@ int main() {
clock_t x;
; return 0; }
EOF
-if { (eval echo configure:4908: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:4975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_type_clock_t=yes
else
@@ -4925,12 +4992,12 @@ EOF
fi
echo $ac_n "checking for uchar""... $ac_c" 1>&6
-echo "configure:4929: checking for uchar" >&5
+echo "configure:4996: checking for uchar" >&5
if eval "test \"`echo '$''{'gcc_cv_type_uchar'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4934 "configure"
+#line 5001 "configure"
#include "confdefs.h"
#include "ansidecl.h"
@@ -4941,7 +5008,7 @@ if ((uchar *)0) return 0;
if (sizeof(uchar)) return 0;
; return 0; }
EOF
-if { (eval echo configure:4945: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5012: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_type_uchar=yes
else
@@ -4971,7 +5038,7 @@ if test "${enable_initfini_array+set}" = set; then
else
echo $ac_n "checking for .preinit_array/.init_array/.fini_array support""... $ac_c" 1>&6
-echo "configure:4975: checking for .preinit_array/.init_array/.fini_array support" >&5
+echo "configure:5042: checking for .preinit_array/.init_array/.fini_array support" >&5
if eval "test \"`echo '$''{'gcc_cv_initfini_array'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -4979,7 +5046,7 @@ else
gcc_cv_initfini_array=no
else
cat > conftest.$ac_ext <<EOF
-#line 4983 "configure"
+#line 5050 "configure"
#include "confdefs.h"
static int x = -1;
@@ -4987,7 +5054,7 @@ int main (void) { return x; }
int foo (void) { x = 0; }
int (*fp) (void) __attribute__ ((section (".init_array"))) = foo;
EOF
-if { (eval echo configure:4991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:5058: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
gcc_cv_initfini_array=yes
else
@@ -5015,12 +5082,12 @@ fi
# mkdir takes a single argument on some systems.
echo $ac_n "checking if mkdir takes one argument""... $ac_c" 1>&6
-echo "configure:5019: checking if mkdir takes one argument" >&5
+echo "configure:5086: 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 5024 "configure"
+#line 5091 "configure"
#include "confdefs.h"
#include <sys/types.h>
@@ -5037,7 +5104,7 @@ int main() {
mkdir ("foo", 0);
; return 0; }
EOF
-if { (eval echo configure:5041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
gcc_cv_mkdir_takes_one_arg=no
else
@@ -5078,7 +5145,7 @@ fi
if test x$host = x$target; then
echo $ac_n "checking for main in -lunwind""... $ac_c" 1>&6
-echo "configure:5082: checking for main in -lunwind" >&5
+echo "configure:5149: checking for main in -lunwind" >&5
ac_lib_var=`echo unwind'_'main | sed 'y%./+-%__p_%'`
if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -5086,14 +5153,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lunwind $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5090 "configure"
+#line 5157 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:5097: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5164: \"$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
@@ -5407,7 +5474,7 @@ if test -f ../intl/config.intl; then
. ../intl/config.intl
fi
echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6
-echo "configure:5411: checking whether NLS is requested" >&5
+echo "configure:5478: checking whether NLS is requested" >&5
if test x"$USE_NLS" != xyes; then
echo "$ac_t""no" 1>&6
else
@@ -5418,7 +5485,7 @@ EOF
echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6
-echo "configure:5422: checking for catalogs to be installed" >&5
+echo "configure:5489: checking for catalogs to be installed" >&5
# Look for .po and .gmo files in the source directory.
CATALOGS=
XLINGUAS=
@@ -5468,7 +5535,7 @@ fi
case $host_os in
win32 | pe | cygwin* | mingw32* | uwin*)
echo $ac_n "checking whether windows registry support is requested""... $ac_c" 1>&6
-echo "configure:5472: checking whether windows registry support is requested" >&5
+echo "configure:5539: 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
@@ -5477,14 +5544,14 @@ EOF
echo "$ac_t""yes" 1>&6
echo $ac_n "checking for library containing RegOpenKeyExA""... $ac_c" 1>&6
-echo "configure:5481: checking for library containing RegOpenKeyExA" >&5
+echo "configure:5548: checking for library containing RegOpenKeyExA" >&5
if eval "test \"`echo '$''{'ac_cv_search_RegOpenKeyExA'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
ac_func_search_save_LIBS="$LIBS"
ac_cv_search_RegOpenKeyExA="no"
cat > conftest.$ac_ext <<EOF
-#line 5488 "configure"
+#line 5555 "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
@@ -5495,7 +5562,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:5499: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5566: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="none required"
else
@@ -5506,7 +5573,7 @@ rm -f conftest*
test "$ac_cv_search_RegOpenKeyExA" = "no" && for i in advapi32; do
LIBS="-l$i $ac_func_search_save_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5510 "configure"
+#line 5577 "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
@@ -5517,7 +5584,7 @@ int main() {
RegOpenKeyExA()
; return 0; }
EOF
-if { (eval echo configure:5521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5588: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_search_RegOpenKeyExA="-l$i"
break
@@ -5559,7 +5626,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:5563: checking registry key on windows hosts" >&5
+echo "configure:5630: checking registry key on windows hosts" >&5
cat >> confdefs.h <<EOF
#define WIN32_REGISTRY_KEY "$gcc_cv_win32_registry_key"
EOF
@@ -5823,7 +5890,7 @@ esac
# build->target assembler and hope that it will have the same features
# as the host->target assembler we'll be using.
echo $ac_n "checking what assembler to use""... $ac_c" 1>&6
-echo "configure:5827: checking what assembler to use" >&5
+echo "configure:5894: checking what assembler to use" >&5
in_tree_gas=no
gcc_cv_as=
gcc_cv_gas_major_version=
@@ -5947,7 +6014,7 @@ esac
# build->target linker and hope that it will have the same features
# as the host->target linker we'll be using.
echo $ac_n "checking what linker to use""... $ac_c" 1>&6
-echo "configure:5951: checking what linker to use" >&5
+echo "configure:6018: checking what linker to use" >&5
in_tree_ld=no
gcc_cv_ld=
gcc_cv_gld_major_version=
@@ -6055,7 +6122,7 @@ esac
# Figure out what nm we will be using.
gcc_cv_binutils_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/binutils
echo $ac_n "checking what nm to use""... $ac_c" 1>&6
-echo "configure:6059: checking what nm to use" >&5
+echo "configure:6126: checking what nm to use" >&5
in_tree_nm=no
if test -x nm$host_exeext; then
gcc_cv_nm=./nm$host_exeext
@@ -6078,7 +6145,7 @@ esac
# Figure out what objdump we will be using.
echo $ac_n "checking what objdump to use""... $ac_c" 1>&6
-echo "configure:6082: checking what objdump to use" >&5
+echo "configure:6149: checking what objdump to use" >&5
in_tree_objdump=no
if test -x objdump$host_exeext; then
gcc_cv_objdump=./objdump$host_exeext
@@ -6103,7 +6170,7 @@ esac
# Figure out what assembler alignment features are present.
echo $ac_n "checking assembler for .balign and .p2align""... $ac_c" 1>&6
-echo "configure:6107: checking assembler for .balign and .p2align" >&5
+echo "configure:6174: checking assembler for .balign and .p2align" >&5
if eval "test \"`echo '$''{'gcc_cv_as_balign_and_p2align'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6115,7 +6182,7 @@ fi
elif test x$gcc_cv_as != x; then
echo '.balign 4
.p2align 2' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6186: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_balign_and_p2align=yes
else
@@ -6135,7 +6202,7 @@ EOF
fi
echo $ac_n "checking assembler for .p2align with maximum skip""... $ac_c" 1>&6
-echo "configure:6139: checking assembler for .p2align with maximum skip" >&5
+echo "configure:6206: checking assembler for .p2align with maximum skip" >&5
if eval "test \"`echo '$''{'gcc_cv_as_max_skip_p2align'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6146,7 +6213,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo '.p2align 4,,7' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6150: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6217: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_max_skip_p2align=yes
else
@@ -6166,7 +6233,7 @@ EOF
fi
echo $ac_n "checking assembler for working .subsection -1""... $ac_c" 1>&6
-echo "configure:6170: checking assembler for working .subsection -1" >&5
+echo "configure:6237: checking assembler for working .subsection -1" >&5
if eval "test \"`echo '$''{'gcc_cv_as_subsection_m1'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6181,7 +6248,7 @@ fi
.subsection -1
conftest_label2: .word 0
.previous' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6185: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6252: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
if test x$gcc_cv_nm != x; then
$gcc_cv_nm conftest.o | grep conftest_label1 > conftest.nm1
@@ -6209,7 +6276,7 @@ EOF
fi
echo $ac_n "checking assembler for .weak""... $ac_c" 1>&6
-echo "configure:6213: checking assembler for .weak" >&5
+echo "configure:6280: checking assembler for .weak" >&5
if eval "test \"`echo '$''{'gcc_cv_as_weak'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6220,7 +6287,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo ' .weak foobar' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6224: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6291: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_weak=yes
else
@@ -6247,7 +6314,7 @@ fi
# to be safe.
# The gcc_GAS_CHECK_FEATURE call just sets a cache variable.
echo $ac_n "checking assembler for .hidden""... $ac_c" 1>&6
-echo "configure:6251: checking assembler for .hidden" >&5
+echo "configure:6318: checking assembler for .hidden" >&5
if eval "test \"`echo '$''{'gcc_cv_as_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6260,7 +6327,7 @@ fi
elif test x$gcc_cv_as != x; then
echo ' .hidden foobar
foobar:' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6264: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6331: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_hidden=yes
else
@@ -6275,7 +6342,7 @@ echo "$ac_t""$gcc_cv_as_hidden" 1>&6
echo $ac_n "checking linker for .hidden support""... $ac_c" 1>&6
-echo "configure:6279: checking linker for .hidden support" >&5
+echo "configure:6346: checking linker for .hidden support" >&5
if eval "test \"`echo '$''{'gcc_cv_ld_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6319,8 +6386,14 @@ else
fi
fi
else
- # non-GNU linkers don't seem to support .hidden yet
- gcc_cv_ld_hidden=no
+ case "${target}" in
+ hppa64*-*-hpux*)
+ gcc_cv_ld_hidden=yes
+ ;;
+ *)
+ gcc_cv_ld_hidden=no
+ ;;
+ esac
fi
fi
fi
@@ -6338,7 +6411,7 @@ fi
# Check if we have .[us]leb128, and support symbol arithmetic with it.
echo $ac_n "checking assembler for .sleb128 and .uleb128""... $ac_c" 1>&6
-echo "configure:6342: checking assembler for .sleb128 and .uleb128" >&5
+echo "configure:6415: checking assembler for .sleb128 and .uleb128" >&5
if eval "test \"`echo '$''{'gcc_cv_as_leb128'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6355,7 +6428,7 @@ L1:
.uleb128 1280
.sleb128 -1010
L2:' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6359: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6432: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
# GAS versions before 2.11 do not support uleb128,
# despite appearing to.
@@ -6391,7 +6464,7 @@ fi
# GAS versions up to and including 2.11.0 may mis-optimize
# .eh_frame data.
echo $ac_n "checking assembler for eh_frame optimization""... $ac_c" 1>&6
-echo "configure:6395: checking assembler for eh_frame optimization" >&5
+echo "configure:6468: checking assembler for eh_frame optimization" >&5
if eval "test \"`echo '$''{'gcc_cv_as_eh_frame'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6434,7 +6507,7 @@ __FRAME_BEGIN__:
.byte 0x4
.4byte .L1-.LFB1
.LEFDE1:' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6438: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6511: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
cat > conftest.lit <<EOF
0000 10000000 00000000 017a0001 781a0004 .........z..x...
@@ -6455,7 +6528,7 @@ EOF
|| cmp conftest.big conftest.got > /dev/null 2>&1; }
then
gcc_cv_as_eh_frame=yes
- elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6459: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
+ elif { ac_try='$gcc_cv_as -o conftest.o --traditional-format /dev/null'; { (eval echo configure:6532: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }; then
gcc_cv_as_eh_frame=buggy
else
# Uh oh, what do we do now?
@@ -6480,7 +6553,7 @@ EOF
fi
echo $ac_n "checking assembler for section merging support""... $ac_c" 1>&6
-echo "configure:6484: checking assembler for section merging support" >&5
+echo "configure:6557: checking assembler for section merging support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_shf_merge'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6492,7 +6565,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo '.section .rodata.str, "aMS", @progbits, 1' > conftest.s
- if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6496: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6569: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_shf_merge=yes
else
@@ -6730,7 +6803,7 @@ if test -z "$tls_first_major"; then
: # If we don't have a check, assume no support.
else
echo $ac_n "checking assembler for thread-local storage support""... $ac_c" 1>&6
-echo "configure:6734: checking assembler for thread-local storage support" >&5
+echo "configure:6807: checking assembler for thread-local storage support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_tls'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6741,7 +6814,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
- if { ac_try='$gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6745: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as $tls_as_opt --fatal-warnings -o conftest.o conftest.s >&5'; { (eval echo configure:6818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_tls=yes
else
@@ -6767,7 +6840,7 @@ case "$target" in
# All TARGET_ABI_OSF targets.
alpha*-*-osf* | alpha*-*-linux* | alpha*-*-*bsd*)
echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
-echo "configure:6771: checking assembler for explicit relocation support" >&5
+echo "configure:6844: checking assembler for explicit relocation support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_alpha_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6790,7 +6863,7 @@ fi
ldah $1, d($29) !gprelhigh
lda $1, d($1) !gprellow
lda $29, 0($29) !gpdisp!3' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6867: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_alpha_explicit_relocs=yes
else
@@ -6812,14 +6885,14 @@ fi
sparc*-*-*)
echo $ac_n "checking assembler for .register""... $ac_c" 1>&6
-echo "configure:6816: checking assembler for .register" >&5
+echo "configure:6889: checking assembler for .register" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_register_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gcc_cv_as_sparc_register_op=no
if test x$gcc_cv_as != x; then
echo '.register %g2, #scratch' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6823: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:6896: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_sparc_register_op=yes
else
@@ -6839,14 +6912,14 @@ EOF
fi
echo $ac_n "checking assembler for -relax option""... $ac_c" 1>&6
-echo "configure:6843: checking assembler for -relax option" >&5
+echo "configure:6916: checking assembler for -relax option" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_relax'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gcc_cv_as_sparc_relax=no
if test x$gcc_cv_as != x; then
echo '.text' > conftest.s
- if { ac_try='$gcc_cv_as -relax -o conftest.o conftest.s >&5'; { (eval echo configure:6850: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -relax -o conftest.o conftest.s >&5'; { (eval echo configure:6923: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_sparc_relax=yes
else
@@ -6866,7 +6939,7 @@ EOF
fi
echo $ac_n "checking assembler for unaligned pcrel relocs""... $ac_c" 1>&6
-echo "configure:6870: checking assembler for unaligned pcrel relocs" >&5
+echo "configure:6943: checking assembler for unaligned pcrel relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6879,7 +6952,7 @@ foo:
.align 4
.byte 0
.uaword %r_disp32(foo)' > conftest.s
- if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6883: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
if test x$gcc_cv_ld != x \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1; then
@@ -6902,7 +6975,7 @@ EOF
echo $ac_n "checking assembler for unaligned pcrel relocs against hidden symbols""... $ac_c" 1>&6
-echo "configure:6906: checking assembler for unaligned pcrel relocs against hidden symbols" >&5
+echo "configure:6979: checking assembler for unaligned pcrel relocs against hidden symbols" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_ua_pcrel_hidden'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6917,7 +6990,7 @@ else
.hidden foo
foo:
.skip 4' > conftest.s
- if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6921: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -K PIC -o conftest.o conftest.s >&5'; { (eval echo configure:6994: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
if test x$gcc_cv_ld != x && test x$gcc_cv_objdump != x \
&& $gcc_cv_ld -o conftest conftest.o -G > /dev/null 2>&1 \
@@ -6950,7 +7023,7 @@ fi
fi # unaligned pcrel relocs
echo $ac_n "checking assembler for offsetable %lo()""... $ac_c" 1>&6
-echo "configure:6954: checking assembler for offsetable %lo()" >&5
+echo "configure:7027: checking assembler for offsetable %lo()" >&5
if eval "test \"`echo '$''{'gcc_cv_as_sparc_offsetable_lo10'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6959,7 +7032,7 @@ else
echo '.text
or %g1, %lo(ab) + 12, %g1
or %g1, %lo(ab + 12), %g1' > conftest.s
- if { ac_try='$gcc_cv_as -xarch=v9 -o conftest.o conftest.s >&5'; { (eval echo configure:6963: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -xarch=v9 -o conftest.o conftest.s >&5'; { (eval echo configure:7036: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
if test x$gcc_cv_objdump != x \
&& %gcc_cv_objdump -s -j .text conftest.o 2> /dev/null \
@@ -6985,7 +7058,7 @@ fi
i[34567]86-*-* | x86_64-*-*)
echo $ac_n "checking assembler for filds and fists mnemonics""... $ac_c" 1>&6
-echo "configure:6989: checking assembler for filds and fists mnemonics" >&5
+echo "configure:7062: checking assembler for filds and fists mnemonics" >&5
if eval "test \"`echo '$''{'gcc_cv_as_ix86_filds_fists'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6996,7 +7069,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo 'filds mem; fists mem' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7000: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7073: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_ix86_filds_fists=yes
else
@@ -7016,14 +7089,14 @@ EOF
fi
echo $ac_n "checking assembler for cmov syntax""... $ac_c" 1>&6
-echo "configure:7020: checking assembler for cmov syntax" >&5
+echo "configure:7093: checking assembler for cmov syntax" >&5
if eval "test \"`echo '$''{'gcc_cv_as_ix86_cmov_sun_syntax'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
gcc_cv_as_ix86_cmov_sun_syntax=no
if test x$gcc_cv_as != x; then
echo 'cmovl.l %edx, %eax' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7027: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7100: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_ix86_cmov_sun_syntax=yes
else
@@ -7045,7 +7118,7 @@ fi
# This one is used unconditionally by i386.[ch]; it is to be defined
# to 1 if the feature is present, 0 otherwise.
echo $ac_n "checking assembler for GOTOFF in data""... $ac_c" 1>&6
-echo "configure:7049: checking assembler for GOTOFF in data" >&5
+echo "configure:7122: checking assembler for GOTOFF in data" >&5
if eval "test \"`echo '$''{'gcc_cv_as_ix86_gotoff_in_data'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7060,7 +7133,7 @@ fi
nop
.data
.long .L0@GOTOFF' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7064: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7137: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_ix86_gotoff_in_data=yes
else
@@ -7081,7 +7154,7 @@ EOF
ia64*-*-*)
echo $ac_n "checking assembler for ltoffx and ldxmov relocs""... $ac_c" 1>&6
-echo "configure:7085: checking assembler for ltoffx and ldxmov relocs" >&5
+echo "configure:7158: checking assembler for ltoffx and ldxmov relocs" >&5
if eval "test \"`echo '$''{'gcc_cv_as_ia64_ltoffx_ldxmov_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7095,7 +7168,7 @@ fi
addl r15 = @ltoffx(x#), gp
;;
ld8.mov r16 = [r15], x#' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_ia64_ltoffx_ldxmov_relocs=yes
else
@@ -7125,7 +7198,7 @@ fi
mfcr 3,128"
echo $ac_n "checking assembler for mfcr field support""... $ac_c" 1>&6
-echo "configure:7129: checking assembler for mfcr field support" >&5
+echo "configure:7202: checking assembler for mfcr field support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_powerpc_mfcrf'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7136,7 +7209,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7140: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7213: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_powerpc_mfcrf=yes
else
@@ -7158,7 +7231,7 @@ fi
mips*-*-*)
echo $ac_n "checking assembler for explicit relocation support""... $ac_c" 1>&6
-echo "configure:7162: checking assembler for explicit relocation support" >&5
+echo "configure:7235: checking assembler for explicit relocation support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_mips_explicit_relocs'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7169,7 +7242,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo ' lw $4,%gp_rel(foo)($4)' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7246: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_mips_explicit_relocs=yes
else
@@ -7199,7 +7272,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
- | xstormy16*-*-* | cris-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-*)
insn="nop"
;;
ia64*-*-*)
@@ -7215,7 +7288,7 @@ if test x"$insn" != x; then
.loc 1 3 0
$insn"
echo $ac_n "checking assembler for dwarf2 debug_line support""... $ac_c" 1>&6
-echo "configure:7219: checking assembler for dwarf2 debug_line support" >&5
+echo "configure:7292: checking assembler for dwarf2 debug_line support" >&5
if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_debug_line'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7227,7 +7300,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo "$conftest_s" > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7231: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7304: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
# ??? This fails with non-gnu grep. Maybe use objdump?
if grep debug_line conftest.o > /dev/null 2>&1; then
@@ -7249,7 +7322,7 @@ echo "$ac_t""$gcc_cv_as_dwarf2_debug_line" 1>&6
# by DW_AT_decl_file. Approximate this test by testing if
# the assembler bitches if the same index is assigned twice.
echo $ac_n "checking assembler for buggy dwarf2 .file directive""... $ac_c" 1>&6
-echo "configure:7253: checking assembler for buggy dwarf2 .file directive" >&5
+echo "configure:7326: checking assembler for buggy dwarf2 .file directive" >&5
if eval "test \"`echo '$''{'gcc_cv_as_dwarf2_file_buggy'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7257,7 +7330,7 @@ else
if test x$gcc_cv_as != x; then
echo ' .file 1 "foo.s"
.file 1 "bar.s"' > conftest.s
- if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7261: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as -o conftest.o conftest.s >&5'; { (eval echo configure:7334: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_dwarf2_file_buggy=yes
else
@@ -7280,7 +7353,7 @@ EOF
fi
echo $ac_n "checking assembler for --gdwarf2 option""... $ac_c" 1>&6
-echo "configure:7284: checking assembler for --gdwarf2 option" >&5
+echo "configure:7357: checking assembler for --gdwarf2 option" >&5
if eval "test \"`echo '$''{'gcc_cv_as_gdwarf2_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7292,7 +7365,7 @@ else
fi
elif test x$gcc_cv_as != x; then
echo "$insn" > conftest.s
- if { ac_try='$gcc_cv_as --gdwarf2 -o conftest.o conftest.s >&5'; { (eval echo configure:7296: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as --gdwarf2 -o conftest.o conftest.s >&5'; { (eval echo configure:7369: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
gcc_cv_as_gdwarf2_flag=yes
else
@@ -7312,7 +7385,7 @@ EOF
fi
echo $ac_n "checking assembler for --gstabs option""... $ac_c" 1>&6
-echo "configure:7316: checking assembler for --gstabs option" >&5
+echo "configure:7389: checking assembler for --gstabs option" >&5
if eval "test \"`echo '$''{'gcc_cv_as_gstabs_flag'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7324,12 +7397,12 @@ else
fi
elif test x$gcc_cv_as != x; then
echo "$insn" > conftest.s
- if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s >&5'; { (eval echo configure:7328: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s >&5'; { (eval echo configure:7401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then
# The native Solaris 9/Intel assembler doesn't understand --gstabs
# and warns about it, but still exits successfully. So check for
# this.
- if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null'; { (eval echo configure:7333: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
+ if { ac_try='$gcc_cv_as --gstabs -o conftest.o conftest.s 2>&1 | grep -i warning > /dev/null'; { (eval echo configure:7406: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; }
then :
else gcc_cv_as_gstabs_flag=yes
fi
@@ -7351,7 +7424,7 @@ fi
fi
echo $ac_n "checking linker read-only and read-write section mixing""... $ac_c" 1>&6
-echo "configure:7355: checking linker read-only and read-write section mixing" >&5
+echo "configure:7428: checking linker read-only and read-write section mixing" >&5
gcc_cv_ld_ro_rw_mix=unknown
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 10 -o "$gcc_cv_gld_major_version" -gt 2 \
@@ -7390,7 +7463,7 @@ fi
echo "$ac_t""$gcc_cv_ld_ro_rw_mix" 1>&6
echo $ac_n "checking linker PT_GNU_EH_FRAME support""... $ac_c" 1>&6
-echo "configure:7394: checking linker PT_GNU_EH_FRAME support" >&5
+echo "configure:7467: checking linker PT_GNU_EH_FRAME support" >&5
gcc_cv_ld_eh_frame_hdr=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 12 -o "$gcc_cv_gld_major_version" -gt 2 \
@@ -7412,7 +7485,7 @@ fi
echo "$ac_t""$gcc_cv_ld_eh_frame_hdr" 1>&6
echo $ac_n "checking linker position independent executable support""... $ac_c" 1>&6
-echo "configure:7416: checking linker position independent executable support" >&5
+echo "configure:7489: checking linker position independent executable support" >&5
gcc_cv_ld_pie=no
if test $in_tree_ld = yes ; then
if test "$gcc_cv_gld_major_version" -eq 2 -a "$gcc_cv_gld_minor_version" -ge 15 -o "$gcc_cv_gld_major_version" -gt 2 \
@@ -7433,39 +7506,6 @@ EOF
fi
echo "$ac_t""$gcc_cv_ld_pie" 1>&6
-# Miscellaneous target-specific checks.
-case "$target" in
- mips*-*-*)
- echo $ac_n "checking whether libgloss uses STARTUP directives consistently""... $ac_c" 1>&6
-echo "configure:7441: checking whether libgloss uses STARTUP directives consistently" >&5
- gcc_cv_mips_libgloss_startup=no
- gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
- if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
- else
- test_prefix=$exec_prefix
- fi
- for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_noncanonical/lib/idt.ld
- do
- if grep '^STARTUP' $f > /dev/null 2>&1; then
- gcc_cv_mips_libgloss_startup=yes
- break
- fi
- done
- if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
- cat >> confdefs.h <<\EOF
-#define HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES 1
-EOF
-
- fi
- echo "$ac_t""$gcc_cv_mips_libgloss_startup" 1>&6
- ;;
-esac
-
if test x$with_sysroot = x && test x$host = x$target \
&& test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
cat >> confdefs.h <<EOF
@@ -7639,7 +7679,7 @@ fi
echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6
-echo "configure:7643: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:7683: 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"
@@ -7759,9 +7799,9 @@ done
rm -f Make-hooks
touch Make-hooks
target_list="all.build all.cross start.encap rest.encap tags \
- install-normal install-common install-info install-man \
+ install-normal install-common install-man \
uninstall \
- mostlyclean clean distclean extraclean maintainer-clean \
+ mostlyclean clean distclean maintainer-clean \
stage1 stage2 stage3 stage4 stageprofile stagefeedback"
for t in $target_list
do
@@ -8103,7 +8143,6 @@ s%@NO_MINUS_C_MINUS_O@%$NO_MINUS_C_MINUS_O%g
s%@OUTPUT_OPTION@%$OUTPUT_OPTION%g
s%@CPP@%$CPP%g
s%@GNATBIND@%$GNATBIND%g
-s%@ADAC@%$ADAC%g
s%@strict1_warn@%$strict1_warn%g
s%@warn_cflags@%$warn_cflags%g
s%@WERROR@%$WERROR%g
@@ -8453,9 +8492,9 @@ symbolic_link='$symbolic_link'
EOF
cat >> $CONFIG_STATUS <<\EOF
-case x$CONFIG_HEADERS in
-xauto-host.h:config.in)
-echo > cstamp-h ;;
+case ${CONFIG_HEADERS} in
+ *auto-host.h:config.in*)
+ echo > cstamp-h ;;
esac
# Make sure all the subdirs exist.
for d in $subdirs
diff --git a/gcc/configure.in b/gcc/configure.in
index f424f03b6fc..9c071de7fe6 100644
--- a/gcc/configure.in
+++ b/gcc/configure.in
@@ -284,29 +284,12 @@ fi
# See if GNAT has been installed
gcc_AC_PROG_GNAT
-if test x$have_gnat != xno ; then
-AC_CACHE_CHECK(whether ${ADAC} accepts -Wno-long-long,
-ac_cv_prog_adac_no_long_long,
-[cat >conftest.adb <<EOF
-procedure conftest is begin null; end conftest;
-EOF
-if $ADAC -Wno-long-long -c conftest.adb 1>&5 2>&5 ; then
- ac_cv_prog_adac_no_long_long=yes
-else
- ac_cv_prog_adac_no_long_long=no
-fi
-rm -f conftest*])
-else
- ac_cv_prog_adac_no_long_long=yes
-fi
-
# ---------------------
# Warnings and checking
# ---------------------
strict1_warn=
-if test $ac_cv_prog_cc_no_long_long = yes && \
- test $ac_cv_prog_adac_no_long_long = yes ; then
+if test $ac_cv_prog_cc_no_long_long = yes ; then
strict1_warn="-pedantic -Wno-long-long"
fi
AC_SUBST(strict1_warn)
@@ -414,9 +397,24 @@ if test x$ac_fold_checking != x ; then
fi
valgrind_path_defines=
valgrind_command=
+
+dnl # This check AC_REQUIREs various stuff, so it *must not* be inside
+dnl # an if statement. This was the source of very frustrating bugs
+dnl # in converting to autoconf 2.5x!
+AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
+
if test x$ac_checking_valgrind != x ; then
# It is certainly possible that there's valgrind but no valgrind.h.
# GCC relies on making annotations so we must have both.
+ AC_MSG_CHECKING(for VALGRIND_DISCARD in <valgrind/memcheck.h>)
+ AC_TRY_CPP(
+ [#include <valgrind/memcheck.h>
+#ifndef VALGRIND_DISCARD
+#error VALGRIND_DISCARD not defined
+#endif],
+ [gcc_cv_header_valgrind_memcheck_h=yes],
+ [gcc_cv_header_valgrind_memcheck_h=no])
+ AC_MSG_RESULT($gcc_cv_header_valgrind_memcheck_h)
AC_MSG_CHECKING(for VALGRIND_DISCARD in <memcheck.h>)
AC_TRY_CPP(
[#include <memcheck.h>
@@ -426,17 +424,23 @@ if test x$ac_checking_valgrind != x ; then
[gcc_cv_header_memcheck_h=yes],
gcc_cv_header_memcheck_h=no)
AC_MSG_RESULT($gcc_cv_header_memcheck_h)
- AC_CHECK_HEADER(valgrind.h, have_valgrind_h=yes, have_valgrind_h=no)
AM_PATH_PROG_WITH_TEST(valgrind_path, valgrind,
[$ac_dir/$ac_word --version | grep valgrind- >/dev/null 2>&1])
- if test "x$valgrind_path" = "x" || (test $have_valgrind_h = no && test $gcc_cv_header_memcheck_h = no); then
- AC_MSG_ERROR([*** Can't find both valgrind and valgrind.h/memcheck.h])
+ if test "x$valgrind_path" = "x" \
+ || (test $have_valgrind_h = no \
+ && test $gcc_cv_header_memcheck_h = no \
+ && test $gcc_cv_header_valgrind_memcheck_h = no); then
+ AC_MSG_ERROR([*** Can't find both valgrind and valgrind/memcheck.h, memcheck.h or valgrind.h])
fi
valgrind_path_defines=-DVALGRIND_PATH='\"'$valgrind_path'\"'
valgrind_command="$valgrind_path -q"
AC_DEFINE(ENABLE_VALGRIND_CHECKING, 1,
[Define if you want to run subprograms and generated programs
through valgrind (a memory checker). This is extremely expensive.])
+ if test $gcc_cv_header_valgrind_memcheck_h = yes; then
+ AC_DEFINE(HAVE_VALGRIND_MEMCHECK_H, 1,
+ [Define if valgrind's valgrind/memcheck.h header is installed.])
+ fi
if test $gcc_cv_header_memcheck_h = yes; then
AC_DEFINE(HAVE_MEMCHECK_H, 1,
[Define if valgrind's memcheck.h header is installed.])
@@ -467,6 +471,14 @@ esac],
[coverage_flags=""])
AC_SUBST(coverage_flags)
+AC_ARG_ENABLE(gather-detailed-mem-stats,
+[ --enable-gather-detailed-mem-stats enable detailed memory allocation stats gathering], [],
+[enable_gather_detailed_mem_stats=no])
+if test x$enable_gather_detailed_mem_stats = xyes ; then
+ AC_DEFINE(GATHER_STATISTICS, 1,
+ [Define to enable detailed memory allocation stats gathering.])
+fi
+
# -------------------------------
# Miscenalleous configure options
# -------------------------------
@@ -586,6 +598,12 @@ AC_PROG_MAKE_SET
# Find some useful tools
AC_PROG_AWK
+# We need awk to run opts.sh (to create options.c and options.h).
+# Bail out if it's missing.
+case ${AWK} in
+ "") AC_MSG_ERROR([can't build without awk, bailing out]) ;;
+esac
+
gcc_AC_PROG_LN
gcc_AC_PROG_LN_S
AC_PROG_RANLIB
@@ -1872,8 +1890,14 @@ changequote(,)dnl
changequote([,])dnl
fi
else
- # non-GNU linkers don't seem to support .hidden yet
- gcc_cv_ld_hidden=no
+ case "${target}" in
+ hppa64*-*-hpux*)
+ gcc_cv_ld_hidden=yes
+ ;;
+ *)
+ gcc_cv_ld_hidden=no
+ ;;
+ esac
fi
fi])
libgcc_visibility=no
@@ -2387,7 +2411,7 @@ esac
case "$target" in
i?86*-*-* | mips*-*-* | alpha*-*-* | powerpc*-*-* | sparc*-*-* | m68*-*-* \
| x86_64*-*-* | hppa*-*-* | arm*-*-* | strongarm*-*-* | xscale*-*-* \
- | xstormy16*-*-* | cris-*-*)
+ | xstormy16*-*-* | cris-*-* | xtensa-*-*)
insn="nop"
;;
ia64*-*-*)
@@ -2523,36 +2547,6 @@ if test x"$gcc_cv_ld_pie" = xyes; then
fi
AC_MSG_RESULT($gcc_cv_ld_pie)
-# Miscellaneous target-specific checks.
-case "$target" in
- mips*-*-*)
- AC_MSG_CHECKING(whether libgloss uses STARTUP directives consistently)
- gcc_cv_mips_libgloss_startup=no
- gcc_cv_libgloss_srcdir=`echo $srcdir | sed -e 's,/gcc$,,'`/libgloss
- if test "x$exec_prefix" = xNONE; then
- if test "x$prefix" = xNONE; then
- test_prefix=/usr/local
- else
- test_prefix=$prefix
- fi
- else
- test_prefix=$exec_prefix
- fi
- for f in $gcc_cv_libgloss_srcdir/mips/idt.ld $test_prefix/$target_noncanonical/lib/idt.ld
- do
- if grep '^STARTUP' $f > /dev/null 2>&1; then
- gcc_cv_mips_libgloss_startup=yes
- break
- fi
- done
- if test x"$gcc_cv_mips_libgloss_startup" = xyes; then
- AC_DEFINE(HAVE_MIPS_LIBGLOSS_STARTUP_DIRECTIVES, 1,
- [Define if your MIPS libgloss linker scripts consistently include STARTUP directives.])
- fi
- AC_MSG_RESULT($gcc_cv_mips_libgloss_startup)
- ;;
-esac
-
if test x$with_sysroot = x && test x$host = x$target \
&& test "$prefix" != "/usr" && test "x$prefix" != "x$local_prefix" ; then
AC_DEFINE_UNQUOTED(PREFIX_INCLUDE_DIR, "$prefix/include",
@@ -2844,7 +2838,7 @@ touch Make-hooks
target_list="all.build all.cross start.encap rest.encap tags \
install-normal install-common install-man \
uninstall \
- mostlyclean clean distclean extraclean maintainer-clean \
+ mostlyclean clean distclean maintainer-clean \
stage1 stage2 stage3 stage4 stageprofile stagefeedback"
for t in $target_list
do
@@ -3029,9 +3023,9 @@ fi
# and configure language subdirectories
AC_OUTPUT($all_outputs,
[
-case x$CONFIG_HEADERS in
-xauto-host.h:config.in)
-echo > cstamp-h ;;
+case ${CONFIG_HEADERS} in
+ *auto-host.h:config.in*)
+ echo > cstamp-h ;;
esac
# Make sure all the subdirs exist.
for d in $subdirs
diff --git a/gcc/conflict.c b/gcc/conflict.c
index c832b7df52c..a23bad35c19 100644
--- a/gcc/conflict.c
+++ b/gcc/conflict.c
@@ -435,9 +435,9 @@ conflict_graph_compute (regset regs, partition p)
AND_REG_SET (live, regs);
/* Walk the instruction stream backwards. */
- head = bb->head;
- insn = bb->end;
- for (insn = bb->end; insn != head; insn = PREV_INSN (insn))
+ head = BB_HEAD (bb);
+ insn = BB_END (bb);
+ for (insn = BB_END (bb); insn != head; insn = PREV_INSN (insn))
{
int born_reg;
int live_reg;
diff --git a/gcc/coverage.c b/gcc/coverage.c
index b02c97c15d6..8b43d6af24e 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -154,7 +154,7 @@ read_counts_file (void)
counts_entry_t *summaried = NULL;
unsigned seen_summary = 0;
gcov_unsigned_t tag;
- int error = 0;
+ int is_error = 0;
if (!gcov_open (da_file_name, 1))
return;
@@ -250,17 +250,26 @@ read_counts_file (void)
entry->summary.num = n_counts;
entry->counts = xcalloc (n_counts, sizeof (gcov_type));
}
- else if (entry->checksum != checksum
- || entry->summary.num != n_counts)
+ else if (entry->checksum != checksum)
{
- warning ("coverage mismatch for function %u", fn_ident);
+ error ("coverage mismatch for function %u while reading execution counters.",
+ fn_ident);
+ error ("checksum is %x instead of %x", entry->checksum, checksum);
+ htab_delete (counts_hash);
+ break;
+ }
+ else if (entry->summary.num != n_counts)
+ {
+ error ("coverage mismatch for function %u while reading execution counters.",
+ fn_ident);
+ error ("number of counters is %d instead of %d", entry->summary.num, n_counts);
htab_delete (counts_hash);
break;
}
else if (elt.ctr >= GCOV_COUNTERS_SUMMABLE)
{
- warning ("cannot merge separate %s counters for function %u",
- ctr_names[elt.ctr], fn_ident);
+ error ("cannot merge separate %s counters for function %u",
+ ctr_names[elt.ctr], fn_ident);
goto skip_merge;
}
@@ -278,14 +287,14 @@ read_counts_file (void)
skip_merge:;
}
gcov_sync (offset, length);
- if ((error = gcov_is_error ()))
+ if ((is_error = gcov_is_error ()))
break;
}
if (!gcov_is_eof ())
{
- warning (error < 0 ? "`%s' has overflowed" : "`%s' is corrupted",
- da_file_name);
+ error (is_error < 0 ? "`%s' has overflowed" : "`%s' is corrupted",
+ da_file_name);
htab_delete (counts_hash);
}
@@ -299,6 +308,7 @@ get_coverage_counts (unsigned counter, unsigned expected,
const struct gcov_ctr_summary **summary)
{
counts_entry_t *entry, elt;
+ gcov_unsigned_t checksum = -1;
/* No hash table, no counts. */
if (!counts_hash)
@@ -306,8 +316,8 @@ get_coverage_counts (unsigned counter, unsigned expected,
static int warned = 0;
if (!warned++)
- warning ("file %s not found, execution counts assumed to be zero",
- da_file_name);
+ inform ("file %s not found, execution counts assumed to be zero",
+ da_file_name);
return NULL;
}
@@ -321,12 +331,22 @@ get_coverage_counts (unsigned counter, unsigned expected,
return 0;
}
- if (expected != entry->summary.num
- || compute_checksum () != entry->checksum)
+ checksum = compute_checksum ();
+ if (entry->checksum != checksum)
{
- warning ("coverage mismatch for `%s'", IDENTIFIER_POINTER
- (DECL_ASSEMBLER_NAME (current_function_decl)));
- return NULL;
+ error ("coverage mismatch for function '%s' while reading counter '%s'.",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
+ ctr_names[counter]);
+ error ("checksum is %x instead of %x", entry->checksum, checksum);
+ return 0;
+ }
+ else if (entry->summary.num != expected)
+ {
+ error ("coverage mismatch for function '%s' while reading counter '%s'.",
+ IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)),
+ ctr_names[counter]);
+ error ("number of counters is %d instead of %d", entry->summary.num, expected);
+ return 0;
}
if (summary)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 0b7e80975b9..919aefc0c6b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,753 @@
+2004-02-11 Mark Mitchell <mark@codesourcery.com>
+
+ * repo.c (IDENTIFIER_REPO_USED): Use tree flag 5.
+ (IDENTIFIER_REPO_CHOSEN): Use tree flag 6.
+ (extract_string): Use double quotes, rather than single quotes, on
+ Windows.
+
+2003-11-05 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (cxx_push_function_context): Do not set
+ current_function_is_thunk.
+ * method.c (use_thunk): Set CALL_FROM_THUNK on the call to the
+ actual function.
+
+2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13507
+ * decl.c (duplicate_decls): Use build_type_attribute_variant to
+ merge attributes.
+
+ PR c++/13494
+ * tree.c (build_cplus_array_type_1): Only build a minimal array
+ type for dependent types or domains.
+
+2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12774
+ * typeck.c (comp_array_types): Fold non-dependent domains for
+ ABI-1.
+
+2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13289
+ * semantics.c (finish_id_expression): Only check if the type of
+ a template argument is integral or enumeration when it is not
+ dependent.
+
+2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12403
+ * parser.c (cp_parser_template_declaration_after_export): Set up
+ template specialization scope in case of explicit specialization.
+
+2003-12-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13081
+ * decl.c (duplicate_decls): Preserve inline-ness when redeclaring
+ a function template.
+
+ PR c++/12613
+ * decl.c (reshape_init): Reject GNU colon-style designated
+ initializers in arrays.
+
+ PR c++/13009
+ * call.c (build_special_member_call): Do not assume that we have a
+ pointer to the complete object in an assignment operator.
+
+2003-12-28 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/13070
+ * decl.c (duplicate_decls): When setting the type of an anticipated
+ declaration, merge the existing type attributes.
+
+2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/13268, c++/13339
+ * class.c (add_method): Return early when method is error_mark_node.
+ * pt.c (tsubst_friend_function): Return early when new_friend is
+ error_mark_node.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-lang.c (cp_expr_size): Return zero for empty classes.
+
+ * cp-tree.h (warn_if_uknown_interface): Remove unused function.
+ * decl2.c (warn_if_unknown_interface): Likewise.
+
+2003-12-23 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13387
+ * cp-lang.c (cxx_get_alias_set): Correct logic for a base type.
+
+2003-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ * decl.c (start_function): Do not check
+ flag_alt_external_templates or flag_external_templates.
+ * decl2.c (warn_if_unknown_interface): Likewise.
+ * lex.c (extract_interface_info): Likewise.
+ * pt.c (lookup_template_class): Likewise.
+
+ PR c++/12862
+ * name-lookup.c (pushdecl): Look up all namespace-scope entities
+ in their corresponding namespace.
+
+ PR c++/12397
+ * typeck.c (finish_class_member_access_expr): Don't tree
+ IDENTIFIER_NODEs as non-dependent expressions.
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c++/5050
+ * tree.c (cp_start_inlining): Remove.
+ (cp_end_inlining): Remove.
+ * cp-lang.c (LANG_HOOKS_TREE_INLINING_START_INLINING): Do not define.
+ (LANG_HOOKS_TREE_INLINING_END_INLINING): Do not define.
+ * cp-tree.h (cp_start_inlining): Do not declare.
+ (cp_end_inlining): Do not declare.
+
+2003-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12479
+ * parser.c (cp_parser_declaration_seq_opt): Only issue "extra ;"
+ pedwarn when not in a system header.
+
+2003-12-21 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (cp_tree_index): Remove CPTI_RECORD_TYPE,
+ CPTI_UNION_TYPE, CPTI_ENUM_TYPE.
+ (record_type_node): Remove.
+ (union_type_node): Likewise.
+ (enum_type_node): Likewise.
+ * decl.c: Remove mention of above tree nodes in comment.
+ * lex.c (cxx_init): Do not assign to record_type_node,
+ union_type_node, or enum_type_node. Simplify handling of
+ class_type_node.
+
+ PR c++/11554
+ * init.c (sort_mem_initializers): Add warning.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * call.c: Fix comment formatting.
+ * class.c: Likewise.
+ * cp-tree.h: Likewise.
+ * cvt.c: Likewise.
+ * cxx-pretty-print.c: Likewise.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * error.c: Likewise.
+ * except.c: Likewise.
+ * init.c: Likewise.
+ * name-lookup.c: Likewise.
+ * parser.c: Likewise.
+ * pt.c: Likewise.
+ * rtti.c: Likewise.
+ * semantics.c: Likewise.
+ * typeck.c: Likewise.
+ * typeck2.c: Likewise.
+
+2003-12-19 Kazu Hirata <kazu@cs.umass.edu>
+
+ * cvt.c: Remove uses of "register" specifier in
+ declarations of arguments and local variables.
+ * decl.c: Likewise.
+ * decl2.c: Likewise.
+ * expr.c: Likewise.
+ * friend.c: Likewise.
+ * lex.c: Likewise.
+ * name-lookup.c: Likewise.
+ * repo.c: Likewise.
+ * search.c: Likewise.
+ * tree.c: Likewise.
+ * typeck.c: Likewise.
+ * typeck2.c: Likewise.
+
+2003-12-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12795
+ * name-lookup.c (pushdecl): Do not treated any functions as being
+ "nested" in C++.
+
+2003-12-19 Jason Merrill <jason@redhat.com>
+
+ PR c++/13371
+ * typeck.c (build_modify_expr): Stabilize lhs if we're narrowing.
+ * cvt.c (convert_to_void): Don't warn about the RHS of a comma
+ being useless if TREE_NO_UNUSED_WARNING is set.
+
+2003-12-18 Richard Henderson <rth@redhat.com>
+
+ * cp-tree.h (struct lang_type_header): Remove __extension__.
+
+2003-12-18 Jason Merrill <jason@redhat.com>
+
+ PR c++/12253
+ * init.c (build_vec_init): Initialization of an element from
+ an initializer list is also a full-expression.
+
+ * parser.c, pt.c, semantics.c: Rename constant_expression_p
+ to integral_constant_expression_p.
+
+2003-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13262
+ * pt.c (instantiate_decl): Wrap push_nested_class and
+ pop_nested_class around cp_finish_decl call for static member
+ variable.
+
+2003-12-18 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/9154
+ * parser.c (cp_parser_template_argument): A type-id followed by '>>'
+ is just an user typo, and should be accepted as last resort if any
+ other parsing fails.
+ (cp_parser_enclosed_template_argument_list): If the argument list is
+ parsed correctly, but the next token is '>>', emit a diagnostic.
+ (cp_parser_next_token_ends_template_argument): Accept '>>' as
+ delimiter of template argument, it will be later detected as a typo.
+
+2003-12-17 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in: Replace cp/g++.1 with $(docobjdir)/g++.1.
+
+2003-12-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10603
+ PR c++/12827
+ * parser.c (cp_parser_error): Help c_parse_error print good
+ messages if the next token is a keyword.
+ (cp_parser_parameter_declaration_list): When resynchronizing after
+ a bad parameter declaration, stop if a comma is found.
+ (cp_parser_parameter_declaration): Avoid backtracking.
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
+2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9043
+ C++ ABI change: Mangling array indices in templates.
+ * decl.c (compute_array_index_type): Reorganize for earlier
+ template errors. Use value_dependent_expression_p for abi-2.
+ * mangle.c (write_array_type): Check broken mangling for
+ expression indices on abi-1
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * decl.c (reshape_init): Recover quickly from errors.
+
+ PR c++/13275
+ * lex.c (reswords): Add "__offsetof" and "__offsetof__".
+ * parser.c (cp_parser): Add in_offsetof_p.
+ (cp_parser_new): Initialize it.
+ (cp_parser_primary_expression): Handle __offsetof__ (...).
+ (cp_parser_postfix_expression): Allow casts to pointer type and
+ uses of "->" in a constant expression if implementing offsetof.
+ (cp_parser_unary_expression): Allow the use of "&" in a constant
+ expression if implementing offsetof.
+
+2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD
+ if the declaration comes from an using declaration.
+
+2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * semantics.c (finish_id_expression): Refactor the code to handle
+ template parameters, and emit a more informative error message
+ when they are used within an integral constant expression.
+
+2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13387
+ * class.c (finish_struct_1): Compute mode and alias set for
+ CLASSTYPE_AS_BASE.
+ * call.c (build_over_call): Use CLASSTYPE_AS_BASE for trivial
+ assignment of a class, as necessary.
+ * cp-lang.c (cxx_get_alias_set): The alias set as a base is the
+ same as for the complete type.
+
+ PR c++/13242
+ C++ ABI change. Mangling template parameters of reference type
+ * mangle.c (write_template_args): Remove unreachable code.
+ (write_template_arg): Look through an argument of reference type.
+
+2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): always construct an OVERLOAD
+ if the declaration comes from an using declaration.
+
+2003-12-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10926
+ * decl2.c (grokfield): Robustify.
+
+ PR c++/11116
+ * parser.c (cp_parser_throw_expression): Determine whether or not
+ an assignment-expression is present by doing one-token lookahead.
+
+ PR c++/13269
+ * parser.c (cp_parser_function_definition_after_declarator): Stop
+ scanning tokens when reaching EOF.
+
+ PR c++/12989
+ * typeck.c (cxx_sizeof_or_alignof_expr): Robustify.
+
+ PR c++/13310
+ * pt.c (dependent_template_p): Handle OVERLOADs.
+
+2003-12-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13243
+ PR c++/12573
+ * parser.c (cp_parser_postfix_expression): Tighten handling of
+ integral constant expressions.
+ (cp_parser_unary_expression): Likewise.
+ * pt.c (value_dependent_expression_p): Remove handling for
+ COMPONENT_REFs.
+
+2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * class.c (add_method): Disallow destructor for java classes.
+ * decl.c (xref_basetypes): Check java class inheritance.
+ * decl2.c (check_java_method): Skip artificial params.
+
+ PR c++/13241
+ C++ ABI change. Mangling of symbols in expressions.
+ * mangle.c (write_mangled_name): Add top_level flag. Rework for
+ nested and unnested mangling. Deal with abi version 1 and version
+ 2 differences.
+ (write_expression): Adjust write_mangled_name call.
+ (mangle_decl_string): Use write_mangled_name for all non-type decls.
+
+2003-12-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10779
+ PR c++/12160
+ * parser.c (struct cp_parser): Add in_template_argument_list_p.
+ (cp_parser_error): Use c_parse_error.
+ (cp_parser_name_lookup_error): New function.
+ (cp_parser_new): Initialize it.
+ (cp_parser_declarator): Add parenthesized_p parameter.
+ (cp_parser_nested_name_specifier_opt): Use
+ cp_parser_name_lookup_error.
+ (cp_parser_parenthesized_expression_list): Improve comments.
+ (cp_parser_condition): Adjust call to cp_parser_declarator.
+ (cp_parser_template_parameter): Adjust call to
+ cp_parser_parameter_declaration.
+ (cp_parser_template_argument_list): Set
+ in_template_argument_list_p.
+ (cp_parser_explicit_instantiation): Adjust call to
+ cp_parser_declarator.
+ (cp_parser_simple_type_specifier): Remove unncessary code.
+ (cp_parser_using_declaration): Use cp_parser_name_lookup_error.
+ (cp_parser_init_declarator): Handle member function definitions.
+ (cp_parser_direct_declarator): Adjust call to
+ cp_parser_declarator.
+ (cp_parser_type_id): Adjust call to cp_parser_declarator.
+ (cp_parser_parameter_declaration_list): Avoid backtracking where
+ possible.
+ (cp_parser_parameter_declaration): Add parenthesized_p parameter.
+ (cp_parser_function_definition): Remove.
+ (cp_parser_member_declaration): Do not backtrack to look for
+ function definitions.
+ (cp_parser_exception_declaration): Adjust call to
+ cp_parser_declarator.
+ (cp_parser_single_declaration): Handle function definitions via
+ cp_parser_init_declarator.
+ (cp_parser_save_member_function_body): New function.
+
+2003-12-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13106
+ * decl.c (finish_function): Check if return type is dependent before
+ issuing no return statement warning.
+
+2003-12-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13118
+ * cp-tree.h (lang_decl_u): Add thunk_alias member.
+ (THUNK_VIRTUAL_OFFSET): Must be a FUNCTION_DECL.
+ (THUNK_ALIAS_P): Remove.
+ (THUNK_ALIAS): Adjust.
+ * class.c (update_vtable_entry_for_fn): Get the vbase within the
+ overriding function's return type.
+ (dump_thunk): Adjust THUNK_ALIAS printing.
+ (build_vtbl_initializer): Adjust THUNK_ALIAS use.
+ * method.c (make_thunk): Revert 12881 test change. Clear
+ THUNK_ALIAS.
+ (finish_thunk): Adjust THUNK_ALIAS setting.
+ (use_thunk): Adjust THUNK_ALIAS use.
+ * semantics.c (emit_associated_thunks): Likewise.
+
+ PR c++/13114, c++/13115
+ * class.c (layout_empty_base): Propagate the move of an empty base
+ to offset zero.
+
+ PR c++/12881
+ * method.c (make_thunk): Deal with thunk aliases when searching
+ for a thunk. Robustify assertion.
+
+2003-12-11 Nathan Sidwell <nathan@codesourcery.com>
+
+ * mangle.c (conv_type_names): Holds IDENTIFIER_NODEs only.
+ (hash_type): Use TYPE_UID of the identifier's type.
+ (compare_type): Adjust.
+ (mangle_conv_op_name_for_type): Store identifier nodes only, use
+ TYPE_UID has hash value.
+
+2003-12-10 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-tree.h (DECL_CONV_FN_P): Check that DECL_NAME is non-NULL.
+
+2003-12-08 Matt Austern <austern@apple.com>
+
+ PR c/13134
+ * decl.c (duplicate_decls): Copy visibility flag when appropriate.
+
+2003-12-09 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * init.c (build_new_1): Deal with an OVERLOAD set when
+ looking up for _Jv_AllocObject.
+ * except.c (build_throw): Likewise for _Jv_Throw.
+
+2003-12-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/11971
+ * tree.c (build_local_temp): Split out from build_cplus_new.
+ (force_target_expr): New fn.
+ * call.c (call_builtin_trap): Call it. Take a type parm.
+ (convert_arg_to_ellipsis): Pass it.
+ (build_x_va_arg): Use call_builtin_trap.
+
+ PR c++/11929
+ * call.c (magic_varargs_p): New fn.
+ (build_over_call): Do no ellipsis conversions for arguments to
+ functions with magic varargs.
+
+ * name-lookup.c, init.c, except.c: Revert Giovanni's patch from
+ yesterday.
+
+ Give the anonymous namespace a null DECL_NAME.
+ * cp-tree.h: Don't declare anonymous_namespace_name.
+ * decl.c: Don't define it.
+ * dump.c (cp_dump_tree): Don't check for it.
+ * cxx-pretty-print.c (pp_cxx_original_namespace_definition): Likewise.
+ * error.c (dump_decl): Likewise.
+ * name-lookup.c: Define it here.
+ (push_namespace): Put it in DECL_ASSEMBLER_NAME instead.
+ * mangle.c (write_unqualified_name): Adjust.
+
+2003-12-07 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): Always construct an
+ OVERLOAD unless the declaration is a built-in.
+ (set_namespace_binding): While binding OVERLOADs with only one
+ declaration, we still need to call supplement_binding.
+ * init.c (build_new_1): Deal with an OVERLOAD set when
+ looking up for _Jv_AllocObject.
+ * except.c (build_throw): Likewise for _Jv_Throw.
+
+2003-12-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13323
+ * class.c (same_signature_p): Handle conversion operators
+ correctly.
+ (check_for_override): Likewise.
+
+2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (GXX_CROSS_NAME, CXX_CROSS_NAME): Delete.
+ (c++.install_common, cp/g++.1, c++.install-man): Adjust for above.
+ (c++.uninstall): Likewise.
+
+2003-12-05 Danny Smith <dannysmith@gcc.gnu.org>
+ Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13305
+ * parser.c (cp_parser_elaborated_type_specifier): Accept
+ attributes.
+
+2003-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13314
+ * parser.c (cp_parser_class_specifier): Match push_scope/pop_scope
+ calls.
+ (cp_parser_class_head): Likewise.
+
+2003-12-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13166
+ * parser.c (cp_parser_late_parsing_default_args): Make sure the
+ context is a class before calling push_nested_class and
+ pop_nested_class.
+
+2003-12-03 James E Wilson <wilson@specifixinc.com>
+
+ * g++spec.c (lang_specific_driver): Delete USE_LIBUNWIND_EXCEPTIONS
+ support.
+
+2003-12-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9127
+ * cp-tree.h (at_namespace_scope_p): New function.
+ * parser.c (cp_parser_class_head): Handle invalid explicit
+ specializations.
+ * search.c (at_namespace_scope_p): New function.
+
+ PR c++/13179
+ * semantics.c (finish_handler_parms): Do not call eh_type_info for
+ types used in templates.
+
+ PR c++/10771
+ * parser.c (cp_parser_check_for_invalid_template_id): New
+ function.
+ (cp_parser_simple_type_specifier): Use it.
+ (cp_parser_elaborated_type_specifier): Likewise.
+ (cp_parser_class_head): Likewise.
+
+2003-12-02 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/10126
+ * pt.c (convert_nontype_argument): Handle default conversions
+ while converting a pointer to member function.
+
+2003-12-02 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/12573
+ * pt.c (value_dependent_expression_p): Handle COMPONENT_REFs by
+ looking into them recursively.
+
+2003-12-02 Richard Henderson <rth@redhat.com>
+
+ * name-lookup.h (struct cp_binding_level): Use ENUM_BITFIELD.
+ * parser.c (struct cp_token): Likewise.
+ (struct cp_parser_token_tree_map_node): Likewise.
+ * lex.c (struct resword): Move const after ENUM_BITFIELD.
+
+2003-11-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9849
+ * parser.c (cp_lexer_prev_token): New function.
+ (cp_parser_skip_to_closing_parenthesis): Add consume_paren
+ parameter.
+ (cp_parser_nested_name_specifier_opt): Add is_declaration
+ parameter.
+ (cp_parser_nested_name_specifier): Likewise.
+ (cp_parser_class_or_namespace_name): Likewise.
+ (cp_parser_class_name): Likewise.
+ (cp_parser_template_id): Likewise.
+ (cp_parser_template_name): Likewise.
+ (cp_parser_id_expression): Adjust calls to
+ cp_parser_nested_name_specifier_op, cp_parser_template_id,
+ cp_parser_class_name.
+ (cp_parser_unqualified_id): Likewise.
+ (cp_parser_postfix_expression): Likewise.
+ (cp_parser_pseudo_destructor_name): Likewise.
+ (cp_parser_cast_expression): Likewise.
+ (cp_parser_mem_initializer_id): Likewise.
+ (cp_parser_simple_type_specifier): Likewise.
+ (cp_parser_type_name): Likewise.
+ (cp_parser_elaborated_type_specifier): Likewise.
+ (cp_parser_qualified_namespace_specifier): Likewise.
+ (cp_parser_using_declaration): Likewise.
+ (cp_parser_using_directive): Likewise.
+ (cp_parser_ptr_operator): Likewise.
+ (cp_parser_declarator_id): Likewise.
+ (cp_parser_class_head): Likewise.
+ (cp_parser_base_specifier): Likewise.
+ (cp_parser_constructor_declarator_p): Likewise.
+ (cp_parser_direct_declarator): Fix typo in comment.
+ (cp_parser_parenthesized_expression_list): Adjust call to
+ cp_parser_skip_to_closing_parenthesis.
+ (cp_parser_selection_statement): Likewise.
+
+2003-11-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12924
+ * typeck.c (finish_class_member_access_expr): Handle TEMPLATE_ID_EXPR
+ with OVERLOAD and DECL nodes as the first operand.
+
+2003-11-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * pt.c (tsubst) <ARRAY_REF>: Remove erroneous argument to build_nt.
+
+2003-11-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5369
+ * friend.c (is_friend): Handle member function of a class
+ template as template friend.
+ (do_friend): Likewise.
+ * decl2.c (check_classfn): Add template_header_p parameter.
+ * decl.c (start_decl): Adjust check_classfn call.
+ (grokfndecl): Likewise.
+ * pt.c (is_specialization_of_friend): New function.
+ (uses_template_parms_level): Likewise.
+ (push_template_decl_real): Use uses_template_parms_level.
+ (tsubst_friend_function): Adjust check_classfn call.
+ * cp-tree.h (check_classfn): Adjust declaration.
+ (uses_template_parms_level): Add declaration.
+ (is_specialization_of_friend): Likewise.
+
+2003-11-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12515
+ * pt.c (build_non_dependent_expr): Handle GNU extension to ?:
+ operator.
+
+2003-11-21 Jan Hubicka <jh@suse.cz>
+
+ * parser.c (cp_parser_postfix_expression): Initialize 's' to
+ NULL_TREE.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (c++.extraclean): Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (check-g++, lang_checks): Add.
+
+2003-11-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12932
+ * class.c (currently_open_derived_class): Check if
+ current_class_type is NULL_TREE.
+ * semantics.c (finish_call_expr): Check if
+ currently_open_derived_class returns NULL_TREE.
+ * cp-tree.h (DERIVED_FROM_P): Add parenthesis around PARENT
+ parameter.
+
+2003-11-17 Jason Merrill <jason@redhat.com>
+
+ * init.c (build_new_1): Preevaluate placement args.
+ * call.c (build_op_delete_call): Don't expose placement args to
+ overload resolution.
+
+2003-11-16 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (c++.tags): Create TAGS.sub files in each directory
+ and TAGS files that include them for each front end.
+
+2003-11-15 Bernardo Innocenti <bernie@develer.com>
+
+ PR c++/2294
+ * name-lookup.c: Revert previous patch for PR c++/2294 to prevent
+ build failure on libjava.
+
+2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/2294
+ * name-lookup.c (push_overloaded_decl): Always construct an OVERLOAD
+ unless the declaration is a built-in.
+ (set_namespace_binding): While binding OVERLOADs with only one
+ declaration, we still need to call supplement_binding.
+
+2003-11-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12762
+ * parser.c (cp_parser_enclosed_template_argument_list): New
+ function.
+ (cp_parser_template_id): Use it.
+ (cp_parser_simple_type_specifier): Recognize invalid template
+ syntax.
+
+2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/2094
+ * pt.c (unify): Add support for PTRMEM_CST and
+ FIELD_DECL unification.
+
+2003-11-13 Richard Earnshaw <rearnsha@arm.com>
+
+ * decl.c (grokfndecl): Change OK to type tree.
+
+2003-11-12 Mark Mitchell <mark@codesourcery.com>
+
+ * tree.c (build_target_expr_with_type): Treate VA_ARG_EXPR like
+ CONSTRUCTOR.
+
+ * decl.c (cp_make_fname_decl): When creating a top-level
+ __FUNCTION__-like symbol, do register it with pushdecl.
+
+ * decl.c (finish_case_label): Do not check that we are within a
+ switch statement here.
+ * parser.c (struct cp_parser): Add in_iteration_statement_p and
+ in_switch_statement_p.
+ (cp_parser_new): Initialize them.
+ (cp_parser_labeled_statement): Check validity of case labels
+ here.
+ (cp_parser_selection_statement): Set in_switch_statement_p.
+ (cp_parser_iteration_statement): Set in_iteration_statement_p.
+ (cp_parser_jump_statement): Check validity of break/continue
+ statements here.
+
+ PR c++/12735
+ * cp-tree.h (duplicate_decls): Return a tree.
+ * decl.c (duplicate_decls): Clarify documentation. Return
+ error_mark_node to indicate a failed redeclaration.
+ * friend.c (do_friend): Handle that case.
+ * name-lookup.c (pushdecl): Likewise.
+
+2003-11-11 Jason Merrill <jason@redhat.com>
+
+ * cp-tree.h (DECL_NAMESPACE_ASSOCIATIONS): New macro.
+ * name-lookup.c (parse_using_directive): New fn.
+ (is_associated_namespace): New fn.
+ (arg_assoc_namespace): Also check associated namespaces.
+ * name-lookup.h: Declare new fns.
+ * pt.c (maybe_process_partial_specialization): Allow
+ specialization in associated namespace.
+ * parser.c (cp_parser_using_directive): Accept attributes. Use
+ parse_using_directive.
+
+2003-11-10 Richard Henderson <rth@redhat.com>
+
+ * cvt.c (convert_to_void): Use void_zero_node after overload failure.
+
+2003-11-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
+
+ PR c++/12832
+ * name-lookup.c (supplement_binding): Gracefully handle names
+ used at non-class scope prior declaration.
+
+2003-11-06 Matt Austern <austern@apple.com>
+
+ * decl.c (duplicate_decls): copy DECL_VISIBILITY field.
+ * method.c (use_thunk): give thunk same visibility as function.
+ * optimize.c (maybe_clone_body): copy DECL_VISIBILITY field.
+
+2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11616
+ * pt.c (instantiate_pending_templates): Save and restore
+ input_location.
+
+2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/2019
+ * friend.c (add_friend): Don't display previous declaration in
+ case of duplicate friend warning.
+
+2003-11-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/9810
+ * call.c (build_over_call): Check access using primary template
+ if FN is a member function template.
+
+2003-11-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12796
+ * class.c (handle_using_decl): Set input_location before calling
+ error_not_base_type.
+
2003-10-26 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10371
@@ -4591,7 +5341,7 @@
pointers to member functions.
PR c++/8534
- * decl.c (build_ptrmemfunc_type): Do not allow default arugments
+ * decl.c (build_ptrmemfunc_type): Do not allow default arguments
in pointer-to-member-function types.
2003-03-10 Gabriel Dos Reis <gdr@integrable-solutions.net>
@@ -17326,7 +18076,7 @@
* search.c (dfs_get_pure_virtuals): Use BV_FN.
* semantics.c (emit_associated_thunks): New function.
(expand_body): Use it.
- * ir.texi: Adjust decriptions of thunks.
+ * ir.texi: Adjust descriptions of thunks.
2000-06-22 Jason Merrill <jason@redhat.com>
diff --git a/gcc/cp/ChangeLog.1 b/gcc/cp/ChangeLog.1
index 4b4afd31526..01ef399698c 100644
--- a/gcc/cp/ChangeLog.1
+++ b/gcc/cp/ChangeLog.1
@@ -1386,7 +1386,7 @@ Wed May 10 00:55:59 1995 Jason Merrill <jason@phydeaux.cygnus.com>
Tue May 9 19:10:33 1995 Mike Stump <mrs@cygnus.com>
* decl2.c: Add flag_new_for_scope for new -ffor-scope flag.
- * parse.y (FOR): Conditionalize the pushing and poping of scope for
+ * parse.y (FOR): Conditionalize the pushing and popping of scope for
the for-init-statement upon the new flag_new_for_scope.
* parse.y (try_block): Simplify and use compstmt.
@@ -7211,7 +7211,7 @@ Thu Mar 31 19:50:35 1994 Jason Merrill <jason@deneb.cygnus.com>
Thu Mar 31 16:20:16 1994 Kung Hsu <kung@mexican.cygnus.com>
* decl2.c (grok_func_init): Do not abort as rtl for pur virtual
- fucntions. They can be defined somewhere else.
+ functions. They can be defined somewhere else.
Sat Jan 23 23:23:26 1994 Stephen R. van den Berg <berg@pool.informatik.rwth-aachen.de>
diff --git a/gcc/cp/ChangeLog.2 b/gcc/cp/ChangeLog.2
index 26dc387a37e..7cb4adafa89 100644
--- a/gcc/cp/ChangeLog.2
+++ b/gcc/cp/ChangeLog.2
@@ -13405,7 +13405,7 @@ Tue Jan 27 16:42:21 1998 Mark Mitchell <mmitchell@usa.net>
(classtype_mangled_name): Likewise.
(lookup_template_class): Likewise.
(tsubst): Likewise.
- (more_specialized): Take explict template arguments as a
+ (more_specialized): Take explicit template arguments as a
parameter.
(most_specialized): Likewise.
(get_bindings): Likewise. Check that return types match before
@@ -13627,7 +13627,7 @@ Mon Jan 19 22:40:03 1998 Mark Mitchell <mmitchell@usa.net>
(instantiate_template): Use retrieve_specialization.
(do_decl_instantiation): Likewise.
(instantiate_decl): Likewise.
- (type_unification): Improve handling of explict template
+ (type_unification): Improve handling of explicit template
arguments.
* tree.c (mapcar): Return error_mark_node, rather than aborting,
on VAR_DECLS, FUNCTION_DECLS, and CONST_DECLS.
@@ -20213,7 +20213,7 @@ Tue Jan 16 11:39:40 1996 Jason Merrill <jason@yorick.cygnus.com>
Tue Jan 16 11:09:42 1996 Mike Stump <mrs@cygnus.com>
- * decl.c (poplevel): When poping a level, don't give a warning for
+ * decl.c (poplevel): When popping a level, don't give a warning for
any subblocks that already exist.
Tue Jan 16 00:25:33 1996 Jason Merrill <jason@yorick.cygnus.com>
diff --git a/gcc/cp/Make-lang.in b/gcc/cp/Make-lang.in
index 8017bbba3a7..1947311a9a2 100644
--- a/gcc/cp/Make-lang.in
+++ b/gcc/cp/Make-lang.in
@@ -25,7 +25,7 @@
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
# foo.uninstall,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -42,10 +42,6 @@ GXX_INSTALL_NAME = `echo g++|sed '$(program_transform_name)'`
CXX_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo c++|sed '$(program_transform_name)'`
GXX_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo g++|sed '$(program_transform_name)'`
-# Actual names to use when installing a cross-compiler.
-CXX_CROSS_NAME = `echo c++|sed '$(program_transform_cross_name)'`
-GXX_CROSS_NAME = `echo g++|sed '$(program_transform_cross_name)'`
-
#
# Define the names for selecting c++ in LANGUAGES.
# Note that it would be nice to move the dependency on g++
@@ -114,9 +110,14 @@ c++.start.encap: g++$(exeext)
c++.rest.encap:
c++.tags: force
- cd $(srcdir)/cp; etags *.c *.h
+ cd $(srcdir)/cp; etags -o TAGS.sub *.c *.h --language=none \
+ --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' cp-tree.def; \
+ etags --include TAGS.sub --include ../TAGS.sub
+
+generated-manpages:: $(docobjdir)/g++.1
-generated-manpages:: cp/g++.1
+check-c++ : check-g++
+lang_checks += check-g++
#
# Install hooks:
@@ -128,14 +129,14 @@ c++.install-normal:
# Install the driver program as $(target)-g++
# and also as either g++ (if native) or $(tooldir)/bin/g++.
c++.install-common: installdirs
+ -rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
+ -$(INSTALL_PROGRAM) g++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
+ -chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
+ -rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext)
+ -( cd $(DESTDIR)$(bindir) && \
+ $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) )
-if [ -f cc1plus$(exeext) ] ; then \
if [ -f g++-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(CXX_CROSS_NAME)$(exeext); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GXX_CROSS_NAME)$(exeext) $(CXX_CROSS_NAME)$(exeext) ); \
if [ -d $(DESTDIR)$(gcc_tooldir)/bin/. ] ; then \
rm -f $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \
$(INSTALL_PROGRAM) g++-cross$(exeext) $(DESTDIR)$(gcc_tooldir)/bin/g++$(exeext); \
@@ -144,12 +145,6 @@ c++.install-common: installdirs
$(LN) g++$(exeext) c++$(exeext) ); \
else true; fi; \
else \
- rm -f $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) g++$(exeext) $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext); \
- rm -f $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext); \
- ( cd $(DESTDIR)$(bindir) && \
- $(LN) $(GXX_INSTALL_NAME)$(exeext) $(CXX_INSTALL_NAME)$(exeext) ); \
rm -f $(DESTDIR)$(bindir)/$(GXX_TARGET_INSTALL_NAME)$(exeext); \
( cd $(DESTDIR)$(bindir) && \
$(LN) $(GXX_INSTALL_NAME)$(exeext) $(GXX_TARGET_INSTALL_NAME)$(exeext) ); \
@@ -159,47 +154,33 @@ c++.install-common: installdirs
fi ; \
fi
-cp/g++.1:
+$(docobjdir)/g++.1:
-rm -f $@
- if [ "$(ALL)" = all.cross ]; then \
- echo ".so man1/$(GCC_CROSS_NAME).1" > $@ ; \
- else \
- echo ".so man1/$(GCC_INSTALL_NAME).1" > $@ ; \
- fi
+ -echo ".so man1/$(GCC_INSTALL_NAME).1" > $@
-c++.install-man: installdirs cp/g++.1
+c++.install-man: installdirs $(docobjdir)/g++.1
-if [ -f cc1plus$(exeext) ] ; then \
- if [ -f g++-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
- $(INSTALL_DATA) cp/g++.1 $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext); \
- else \
- rm -f $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
- $(INSTALL_DATA) cp/g++.1 $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
- fi; \
+ rm -f $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(docobjdir)/g++.1 $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext); \
else true; fi
c++.uninstall:
-rm -rf $(DESTDIR)$(bindir)/$(CXX_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(CXX_CROSS_NAME)$(exeext)
-rm -rf $(DESTDIR)$(bindir)/$(GXX_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(GXX_CROSS_NAME)$(exeext)
-rm -rf $(DESTDIR)$(man1dir)/$(GXX_INSTALL_NAME)$(man1ext)
- -rm -rf $(DESTDIR)$(man1dir)/$(GXX_CROSS_NAME)$(man1ext)
#
# Clean hooks:
# A lot of the ancillary files are deleted by the main makefile.
# We just have to delete files specific to us.
c++.mostlyclean:
- -rm -f cp/g++.1
+ -rm -f $(docobjdir)/g++.1
-rm -f cp/*$(objext)
-rm -f cp/*$(coverageexts)
c++.clean:
c++.distclean:
-rm -f cp/config.status cp/Makefile
-c++.extraclean:
c++.maintainer-clean:
#
# Stage hooks:
diff --git a/gcc/cp/call.c b/gcc/cp/call.c
index e7bbd22fc45..5e759259015 100644
--- a/gcc/cp/call.c
+++ b/gcc/cp/call.c
@@ -104,11 +104,12 @@ static tree direct_reference_binding (tree, tree);
static bool promoted_arithmetic_type_p (tree);
static tree conditional_conversion (tree, tree);
static char *name_as_c_string (tree, tree, bool *);
-static tree call_builtin_trap (void);
+static tree call_builtin_trap (tree);
static tree prep_operand (tree);
static void add_candidates (tree, tree, tree, bool, tree, tree,
int, struct z_candidate **);
static tree merge_conversion_sequences (tree, tree);
+static bool magic_varargs_p (tree);
tree
build_vfield_ref (tree datum, tree type)
@@ -1743,7 +1744,7 @@ add_builtin_candidate (struct z_candidate **candidates, enum tree_code code,
type1 = type2;
break;
}
- /* FALLTHROUGH */
+ /* Fall through. */
case LT_EXPR:
case GT_EXPR:
case LE_EXPR:
@@ -2036,7 +2037,7 @@ add_builtin_candidates (struct z_candidate **candidates, enum tree_code code,
case GT_EXPR:
case GE_EXPR:
enum_p = 1;
- /* FALLTHROUGH */
+ /* Fall through. */
default:
ref1 = 0;
@@ -3408,7 +3409,7 @@ prep_operand (tree operand)
CANDIDATES. The ARGS are the arguments provided to the call,
without any implicit object parameter. The EXPLICIT_TARGS are
explicit template arguments provided. TEMPLATE_ONLY is true if
- only template fucntions should be considered. CONVERSION_PATH,
+ only template functions should be considered. CONVERSION_PATH,
ACCESS_PATH, and FLAGS are as for add_function_candidate. */
static void
@@ -3824,10 +3825,6 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
/* Find the allocation function that is being called. */
call_expr = placement;
- /* Sometimes we have a COMPOUND_EXPR, rather than a simple
- CALL_EXPR. */
- while (TREE_CODE (call_expr) == COMPOUND_EXPR)
- call_expr = TREE_OPERAND (call_expr, 1);
/* Extract the function. */
alloc_fn = get_callee_fndecl (call_expr);
my_friendly_assert (alloc_fn != NULL_TREE, 20020327);
@@ -3910,7 +3907,15 @@ build_op_delete_call (enum tree_code code, tree addr, tree size,
args = tree_cons (NULL_TREE, addr,
build_tree_list (NULL_TREE, size));
- return build_function_call (fn, args);
+ if (placement)
+ {
+ /* The placement args might not be suitable for overload
+ resolution at this point, so build the call directly. */
+ mark_used (fn);
+ return build_cxx_call (fn, args, args);
+ }
+ else
+ return build_function_call (fn, args);
}
/* If we are doing placement delete we do nothing if we don't find a
@@ -4097,7 +4102,7 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
case RVALUE_CONV:
if (! IS_AGGR_TYPE (totype))
return expr;
- /* else fall through */
+ /* Else fall through. */
case BASE_CONV:
if (TREE_CODE (convs) == BASE_CONV && !NEED_TEMPORARY_P (convs))
{
@@ -4187,16 +4192,18 @@ convert_like_real (tree convs, tree expr, tree fn, int argnum, int inner,
LOOKUP_NORMAL|LOOKUP_NO_CONVERSION);
}
-/* Build a call to __builtin_trap which can be used in an expression. */
+/* Build a call to __builtin_trap which can be used as an expression of
+ type TYPE. */
static tree
-call_builtin_trap (void)
+call_builtin_trap (tree type)
{
tree fn = IDENTIFIER_GLOBAL_VALUE (get_identifier ("__builtin_trap"));
my_friendly_assert (fn != NULL, 20030927);
fn = build_call (fn, NULL_TREE);
- fn = build (COMPOUND_EXPR, integer_type_node, fn, integer_zero_node);
+ fn = build (COMPOUND_EXPR, type, fn, error_mark_node);
+ fn = force_target_expr (type, fn);
return fn;
}
@@ -4235,7 +4242,7 @@ convert_arg_to_ellipsis (tree arg)
warning ("cannot pass objects of non-POD type `%#T' through `...'; \
call will abort at runtime",
TREE_TYPE (arg));
- arg = call_builtin_trap ();
+ arg = call_builtin_trap (TREE_TYPE (arg));
}
return arg;
@@ -4257,8 +4264,10 @@ build_x_va_arg (tree expr, tree type)
if (! pod_type_p (type))
{
/* Undefined behavior [expr.call] 5.2.2/7. */
- warning ("cannot receive objects of non-POD type `%#T' through `...'",
- type);
+ warning ("cannot receive objects of non-POD type `%#T' through `...'; \
+call will abort at runtime",
+ type);
+ return call_builtin_trap (type);
}
return build_va_arg (expr, type);
@@ -4364,6 +4373,29 @@ convert_for_arg_passing (tree type, tree val)
return val;
}
+/* Returns true iff FN is a function with magic varargs, i.e. ones for
+ which no conversions at all should be done. This is true for some
+ builtins which don't act like normal functions. */
+
+static bool
+magic_varargs_p (tree fn)
+{
+ if (DECL_BUILT_IN (fn))
+ switch (DECL_FUNCTION_CODE (fn))
+ {
+ case BUILT_IN_CLASSIFY_TYPE:
+ case BUILT_IN_CONSTANT_P:
+ case BUILT_IN_NEXT_ARG:
+ case BUILT_IN_STDARG_START:
+ case BUILT_IN_VA_START:
+ return true;
+
+ default:;
+ }
+
+ return false;
+}
+
/* Subroutine of the various build_*_call functions. Overload resolution
has chosen a winning candidate CAND; build up a CALL_EXPR accordingly.
ARGS is a TREE_LIST of the unconverted arguments to the call. FLAGS is a
@@ -4387,7 +4419,39 @@ build_over_call (struct z_candidate *cand, int flags)
joust (cand, WRAPPER_ZC (TREE_VALUE (val)), 1);
if (DECL_FUNCTION_MEMBER_P (fn))
- perform_or_defer_access_check (cand->access_path, fn);
+ {
+ /* If FN is a template function, two cases must be considered.
+ For example:
+
+ struct A {
+ protected:
+ template <class T> void f();
+ };
+ template <class T> struct B {
+ protected:
+ void g();
+ };
+ struct C : A, B<int> {
+ using A::f; // #1
+ using B<int>::g; // #2
+ };
+
+ In case #1 where `A::f' is a member template, DECL_ACCESS is
+ recorded in the primary template but not in its specialization.
+ We check access of FN using its primary template.
+
+ In case #2, where `B<int>::g' has a DECL_TEMPLATE_INFO simply
+ because it is a member of class template B, DECL_ACCESS is
+ recorded in the specialization `B<int>::g'. We cannot use its
+ primary template because `B<T>::g' and `B<int>::g' may have
+ different access. */
+ if (DECL_TEMPLATE_INFO (fn)
+ && is_member_template (DECL_TI_TEMPLATE (fn)))
+ perform_or_defer_access_check (cand->access_path,
+ DECL_TI_TEMPLATE (fn));
+ else
+ perform_or_defer_access_check (cand->access_path, fn);
+ }
if (args && TREE_CODE (args) != TREE_LIST)
args = build_tree_list (NULL_TREE, args);
@@ -4481,10 +4545,14 @@ build_over_call (struct z_candidate *cand, int flags)
/* Ellipsis */
for (; arg; arg = TREE_CHAIN (arg))
- converted_args
- = tree_cons (NULL_TREE,
- convert_arg_to_ellipsis (TREE_VALUE (arg)),
- converted_args);
+ {
+ tree a = TREE_VALUE (arg);
+ if (magic_varargs_p (fn))
+ /* Do no conversions for magic varargs. */;
+ else
+ a = convert_arg_to_ellipsis (a);
+ converted_args = tree_cons (NULL_TREE, a, converted_args);
+ }
converted_args = nreverse (converted_args);
@@ -4563,9 +4631,30 @@ build_over_call (struct z_candidate *cand, int flags)
{
tree to = stabilize_reference
(build_indirect_ref (TREE_VALUE (converted_args), 0));
+ tree type = TREE_TYPE (to);
+ tree as_base = CLASSTYPE_AS_BASE (type);
arg = build_indirect_ref (TREE_VALUE (TREE_CHAIN (converted_args)), 0);
- val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
+ if (tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (as_base)))
+ val = build (MODIFY_EXPR, TREE_TYPE (to), to, arg);
+ else
+ {
+ /* We must only copy the non-tail padding parts. Use
+ CLASSTYPE_AS_BASE for the bitwise copy. */
+ tree to_as_base, arg_as_base, base_ptr_type;
+
+ to = save_expr (to);
+ base_ptr_type = build_pointer_type (as_base);
+ to_as_base = build_indirect_ref
+ (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, to, 0)), 0);
+ arg_as_base = build_indirect_ref
+ (build_nop (base_ptr_type, build_unary_op (ADDR_EXPR, arg, 0)), 0);
+
+ val = build (MODIFY_EXPR, as_base, to_as_base, arg_as_base);
+ val = build (COMPOUND_EXPR, type, convert_to_void (val, NULL), to);
+ TREE_USED (val) = 1;
+ }
+
return val;
}
@@ -4776,14 +4865,23 @@ build_special_member_call (tree instance, tree name, tree args,
|| name == deleting_dtor_identifier)
my_friendly_assert (args == NULL_TREE, 20020712);
- /* We must perform the conversion here so that we do not
- subsequently check to see whether BINFO is an accessible
- base. (It is OK for a constructor to call a constructor in
- an inaccessible base as long as the constructor being called
- is accessible.) */
+ /* Convert to the base class, if necessary. */
if (!same_type_ignoring_top_level_qualifiers_p
(TREE_TYPE (instance), BINFO_TYPE (binfo)))
- instance = convert_to_base_statically (instance, binfo);
+ {
+ if (name != ansi_assopname (NOP_EXPR))
+ /* For constructors and destructors, either the base is
+ non-virtual, or it is virtual but we are doing the
+ conversion from a constructor or destructor for the
+ complete object. In either case, we can convert
+ statically. */
+ instance = convert_to_base_statically (instance, binfo);
+ else
+ /* However, for assignment operators, we must convert
+ dynamically if the base is virtual. */
+ instance = build_base_path (PLUS_EXPR, instance,
+ binfo, /*nonnull=*/1);
+ }
}
my_friendly_assert (instance != NULL_TREE, 20020712);
diff --git a/gcc/cp/class.c b/gcc/cp/class.c
index a053956ad9a..2928dd33071 100644
--- a/gcc/cp/class.c
+++ b/gcc/cp/class.c
@@ -725,12 +725,18 @@ modify_vtable_entry (tree t,
void
add_method (tree type, tree method, int error_p)
{
- int using = (DECL_CONTEXT (method) != type);
+ int using;
int len;
int slot;
tree method_vec;
- int template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL
- && DECL_TEMPLATE_CONV_FN_P (method));
+ int template_conv_p;
+
+ if (method == error_mark_node)
+ return;
+
+ using = (DECL_CONTEXT (method) != type);
+ template_conv_p = (TREE_CODE (method) == TEMPLATE_DECL
+ && DECL_TEMPLATE_CONV_FN_P (method));
if (!CLASSTYPE_METHOD_VEC (type))
/* Make a new method vector. We start with 8 entries. We must
@@ -755,6 +761,12 @@ add_method (tree type, tree method, int error_p)
{
slot = CLASSTYPE_DESTRUCTOR_SLOT;
TYPE_HAS_DESTRUCTOR (type) = 1;
+
+ if (TYPE_FOR_JAVA (type))
+ error (DECL_ARTIFICIAL (method)
+ ? "Java class '%T' cannot have an implicit non-trivial destructor"
+ : "Java class '%T' cannot have a destructor",
+ DECL_CONTEXT (method));
}
else
{
@@ -1109,7 +1121,11 @@ handle_using_decl (tree using_decl, tree t)
binfo = lookup_base (t, ctype, ba_any, NULL);
if (! binfo)
{
+ location_t saved_loc = input_location;
+
+ input_location = DECL_SOURCE_LOCATION (using_decl);
error_not_base_type (ctype, t);
+ input_location = saved_loc;
return;
}
@@ -1173,7 +1189,7 @@ handle_using_decl (tree using_decl, tree t)
return;
}
- /* Make type T see field decl FDECL with access ACCESS.*/
+ /* Make type T see field decl FDECL with access ACCESS. */
if (flist)
for (; flist; flist = OVL_NEXT (flist))
{
@@ -1896,7 +1912,11 @@ same_signature_p (tree fndecl, tree base_fndecl)
if (DECL_DESTRUCTOR_P (base_fndecl) || DECL_DESTRUCTOR_P (fndecl))
return 0;
- if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl))
+ if (DECL_NAME (fndecl) == DECL_NAME (base_fndecl)
+ || (DECL_CONV_FN_P (fndecl)
+ && DECL_CONV_FN_P (base_fndecl)
+ && same_type_p (DECL_CONV_FN_TYPE (fndecl),
+ DECL_CONV_FN_TYPE (base_fndecl))))
{
tree types, base_types;
types = TYPE_ARG_TYPES (TREE_TYPE (fndecl));
@@ -2160,13 +2180,22 @@ update_vtable_entry_for_fn (tree t, tree binfo, tree fn, tree* virtuals,
if (DECL_THUNK_P (fn))
{
+ my_friendly_assert (DECL_RESULT_THUNK_P (fn), 20031211);
fixed_offset = ssize_int (THUNK_FIXED_OFFSET (fn));
virtual_offset = THUNK_VIRTUAL_OFFSET (fn);
}
else
fixed_offset = virtual_offset = NULL_TREE;
- if (!virtual_offset)
+ if (virtual_offset)
+ /* Find the equivalent binfo within the return type of the
+ overriding function. We will want the vbase offset from
+ there. */
+ virtual_offset =
+ TREE_VALUE (purpose_member
+ (BINFO_TYPE (virtual_offset),
+ CLASSTYPE_VBASECLASSES (TREE_TYPE (over_return))));
+ else
{
/* There was no existing virtual thunk (which takes
precedence). */
@@ -2435,7 +2464,8 @@ check_for_override (tree decl, tree ctype)
override a virtual function from a base class. */
return;
if ((DECL_DESTRUCTOR_P (decl)
- || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl)))
+ || IDENTIFIER_VIRTUAL_P (DECL_NAME (decl))
+ || DECL_CONV_FN_P (decl))
&& look_for_overrides (ctype, decl)
&& !DECL_STATIC_FUNCTION_P (decl))
/* Set DECL_VINDEX to a value that is neither an INTEGER_CST nor
@@ -3567,14 +3597,18 @@ layout_empty_base (tree binfo, tree eoc, splay_tree offsets)
/* This routine should only be used for empty classes. */
my_friendly_assert (is_empty_class (basetype), 20000321);
alignment = ssize_int (CLASSTYPE_ALIGN_UNIT (basetype));
-
- if (abi_version_at_least (2))
- BINFO_OFFSET (binfo) = size_zero_node;
- if (warn_abi && !integer_zerop (BINFO_OFFSET (binfo)))
- warning ("offset of empty base `%T' may not be ABI-compliant and may"
- "change in a future version of GCC",
- BINFO_TYPE (binfo));
+ if (!integer_zerop (BINFO_OFFSET (binfo)))
+ {
+ if (abi_version_at_least (2))
+ propagate_binfo_offsets
+ (binfo, size_diffop (size_zero_node, BINFO_OFFSET (binfo)));
+ else if (warn_abi)
+ warning ("offset of empty base `%T' may not be ABI-compliant and may"
+ "change in a future version of GCC",
+ BINFO_TYPE (binfo));
+ }
+
/* This is an empty base class. We first try to put it at offset
zero. */
if (layout_conflict_p (binfo,
@@ -5011,7 +5045,7 @@ finish_struct_1 (tree t)
bases and members and add implicitly generated methods. */
check_bases_and_members (t);
- /* Find the key method */
+ /* Find the key method. */
if (TYPE_CONTAINS_VPTR_P (t))
{
CLASSTYPE_KEY_METHOD (t) = key_method (t);
@@ -5024,6 +5058,10 @@ finish_struct_1 (tree t)
/* Layout the class itself. */
layout_class_type (t, &virtuals);
+ if (CLASSTYPE_AS_BASE (t) != t)
+ /* We use the base type for trivial assignments, and hence it
+ needs a mode. */
+ compute_record_mode (CLASSTYPE_AS_BASE (t));
/* Make sure that we get our own copy of the vfield FIELD_DECL. */
vfield = TYPE_VFIELD (t);
@@ -5581,6 +5619,9 @@ currently_open_derived_class (tree t)
if (dependent_type_p (t))
return NULL_TREE;
+ if (!current_class_type)
+ return NULL_TREE;
+
if (DERIVED_FROM_P (t, current_class_type))
return current_class_type;
@@ -6592,7 +6633,7 @@ dump_class_hierarchy_1 (FILE *stream, int flags, tree t)
fprintf (stream, "\n");
}
-/* Debug interface to heirarchy dumping. */
+/* Debug interface to hierarchy dumping. */
extern void
debug_class (tree t)
@@ -6699,11 +6740,7 @@ dump_thunk (FILE *stream, int indent, tree thunk)
!DECL_THUNK_P (thunk) ? "function"
: DECL_THIS_THUNK_P (thunk) ? "this-thunk" : "covariant-thunk",
name ? IDENTIFIER_POINTER (name) : "<unset>");
- if (!DECL_THUNK_P (thunk))
- /*NOP*/;
- else if (THUNK_ALIAS_P (thunk))
- fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk));
- else
+ if (DECL_THUNK_P (thunk))
{
HOST_WIDE_INT fixed_adjust = THUNK_FIXED_OFFSET (thunk);
tree virtual_adjust = THUNK_VIRTUAL_OFFSET (thunk);
@@ -6718,6 +6755,8 @@ dump_thunk (FILE *stream, int indent, tree thunk)
fprintf (stream, " vbase=" HOST_WIDE_INT_PRINT_DEC "(%s)",
tree_low_cst (BINFO_VPTR_FIELD (virtual_adjust), 0),
type_as_string (BINFO_TYPE (virtual_adjust), TFF_SCOPE));
+ if (THUNK_ALIAS (thunk))
+ fprintf (stream, " alias to %p", (void *)THUNK_ALIAS (thunk));
}
fprintf (stream, "\n");
for (thunks = DECL_THUNKS (thunk); thunks; thunks = TREE_CHAIN (thunks))
@@ -7390,7 +7429,7 @@ build_vtbl_initializer (tree binfo,
{
if (!DECL_NAME (fn))
finish_thunk (fn);
- if (THUNK_ALIAS_P (fn))
+ if (THUNK_ALIAS (fn))
{
fn = THUNK_ALIAS (fn);
BV_FN (v) = fn;
diff --git a/gcc/cp/cp-lang.c b/gcc/cp/cp-lang.c
index 92e6b914b3e..f1f5eedcc54 100644
--- a/gcc/cp/cp-lang.c
+++ b/gcc/cp/cp-lang.c
@@ -156,10 +156,6 @@ static void cxx_initialize_diagnostics (diagnostic_context *);
#define LANG_HOOKS_TREE_INLINING_ANON_AGGR_TYPE_P anon_aggr_type_p
#undef LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P
#define LANG_HOOKS_TREE_INLINING_VAR_MOD_TYPE_P cp_var_mod_type_p
-#undef LANG_HOOKS_TREE_INLINING_START_INLINING
-#define LANG_HOOKS_TREE_INLINING_START_INLINING cp_start_inlining
-#undef LANG_HOOKS_TREE_INLINING_END_INLINING
-#define LANG_HOOKS_TREE_INLINING_END_INLINING cp_end_inlining
#undef LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS
#define LANG_HOOKS_TREE_INLINING_ESTIMATE_NUM_INSNS c_estimate_num_insns
#undef LANG_HOOKS_TREE_DUMP_DUMP_TREE_FN
@@ -296,6 +292,12 @@ ok_to_generate_alias_set_for_type (tree t)
static HOST_WIDE_INT
cxx_get_alias_set (tree t)
{
+ if (TREE_CODE (t) == RECORD_TYPE
+ && TYPE_CONTEXT (t) && CLASS_TYPE_P (TYPE_CONTEXT (t))
+ && CLASSTYPE_AS_BASE (TYPE_CONTEXT (t)) == t)
+ /* The base variant of a type must be in the same alias set as the
+ complete type. */
+ return get_alias_set (TYPE_CONTEXT (t));
if (/* It's not yet safe to use alias sets for some classes in C++. */
!ok_to_generate_alias_set_for_type (t)
@@ -345,7 +347,9 @@ cp_expr_size (tree exp)
abort ();
/* This would be wrong for a type with virtual bases, but they are
caught by the abort above. */
- return CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp));
+ return (is_empty_class (TREE_TYPE (exp))
+ ? size_zero_node
+ : CLASSTYPE_SIZE_UNIT (TREE_TYPE (exp)));
}
else
/* Use the default code. */
diff --git a/gcc/cp/cp-tree.h b/gcc/cp/cp-tree.h
index 06031600239..91e38f48223 100644
--- a/gcc/cp/cp-tree.h
+++ b/gcc/cp/cp-tree.h
@@ -521,9 +521,6 @@ enum cp_tree_index
CPTI_BASE_DESC_TYPE,
CPTI_CLASS_TYPE,
- CPTI_RECORD_TYPE,
- CPTI_UNION_TYPE,
- CPTI_ENUM_TYPE,
CPTI_UNKNOWN_TYPE,
CPTI_VTBL_TYPE,
CPTI_VTBL_PTR_TYPE,
@@ -602,9 +599,6 @@ extern GTY(()) tree cp_global_trees[CPTI_MAX];
#define base_desc_type_node cp_global_trees[CPTI_BASE_DESC_TYPE]
#define class_type_node cp_global_trees[CPTI_CLASS_TYPE]
-#define record_type_node cp_global_trees[CPTI_RECORD_TYPE]
-#define union_type_node cp_global_trees[CPTI_UNION_TYPE]
-#define enum_type_node cp_global_trees[CPTI_ENUM_TYPE]
#define unknown_type_node cp_global_trees[CPTI_UNKNOWN_TYPE]
#define vtbl_type_node cp_global_trees[CPTI_VTBL_TYPE]
#define vtbl_ptr_type_node cp_global_trees[CPTI_VTBL_PTR_TYPE]
@@ -1000,7 +994,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* Nonzero iff TYPE is derived from PARENT. Ignores accessibility and
ambiguity issues. */
#define DERIVED_FROM_P(PARENT, TYPE) \
- (lookup_base ((TYPE), PARENT, ba_any, NULL) != NULL_TREE)
+ (lookup_base ((TYPE), (PARENT), ba_any, NULL) != NULL_TREE)
/* Nonzero iff TYPE is uniquely derived from PARENT. Ignores
accessibility. */
#define UNIQUELY_DERIVED_FROM_P(PARENT, TYPE) \
@@ -1017,7 +1011,7 @@ enum languages { lang_c, lang_cplusplus, lang_java };
/* This is a few header flags for 'struct lang_type'. Actually,
all but the first are used only for lang_type_class; they
are put in this structure to save space. */
-__extension__ struct lang_type_header GTY(())
+struct lang_type_header GTY(())
{
CHAR_BITFIELD is_lang_type_class : 1;
@@ -1357,7 +1351,7 @@ struct lang_type GTY(())
#define TYPE_HAS_DEFAULT_CONSTRUCTOR(NODE) \
(LANG_TYPE_CLASS_CHECK (NODE)->h.has_default_ctor)
-/* Nonzero means that this type contains a mutable member */
+/* Nonzero means that this type contains a mutable member. */
#define CLASSTYPE_HAS_MUTABLE(NODE) (LANG_TYPE_CLASS_CHECK (NODE)->has_mutable)
#define TYPE_HAS_MUTABLE_P(NODE) (cp_has_mutable_p (NODE))
@@ -1634,12 +1628,17 @@ struct lang_decl_flags GTY(())
unsigned this_thunk_p : 1;
union lang_decl_u {
- /* In a FUNCTION_DECL, VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this
- is DECL_TEMPLATE_INFO. */
+ /* In a FUNCTION_DECL for which DECL_THUNK_P does not hold,
+ VAR_DECL, TYPE_DECL, or TEMPLATE_DECL, this is
+ DECL_TEMPLATE_INFO. */
tree GTY ((tag ("0"))) template_info;
/* In a NAMESPACE_DECL, this is NAMESPACE_LEVEL. */
struct cp_binding_level * GTY ((tag ("1"))) level;
+
+ /* In a FUNCTION_DECL for which DECL_THUNK_P holds, this is
+ THUNK_ALIAS. */
+ tree GTY ((tag ("2"))) thunk_alias;
} GTY ((desc ("%1.u1sel"))) u;
union lang_decl_u2 {
@@ -1840,7 +1839,7 @@ struct lang_decl GTY(())
/* Nonzero if NODE is a user-defined conversion operator. */
#define DECL_CONV_FN_P(NODE) \
- (IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
+ (DECL_NAME (NODE) && IDENTIFIER_TYPENAME_P (DECL_NAME (NODE)))
/* If FN is a conversion operator, the type to which it converts.
Otherwise, NULL_TREE. */
@@ -2063,6 +2062,11 @@ struct lang_decl GTY(())
of a namespace, to record the transitive closure of using namespace. */
#define DECL_NAMESPACE_USERS(NODE) DECL_INITIAL (NAMESPACE_DECL_CHECK (NODE))
+/* In a NAMESPACE_DECL, the list of namespaces which have associated
+ themselves with this one. */
+#define DECL_NAMESPACE_ASSOCIATIONS(NODE) \
+ (NAMESPACE_DECL_CHECK (NODE)->decl.saved_tree)
+
/* In a NAMESPACE_DECL, points to the original namespace if this is
a namespace alias. */
#define DECL_NAMESPACE_ALIAS(NODE) \
@@ -2854,12 +2858,17 @@ struct lang_decl GTY(())
for the result pointer adjustment.
The constant adjustment is given by THUNK_FIXED_OFFSET. If the
- vcall or vbase offset is required, the index into the vtable is given by
- THUNK_VIRTUAL_OFFSET.
-
- Due to ordering constraints in class layout, it is possible to have
- equivalent covariant thunks. THUNK_ALIAS_P and THUNK_ALIAS are used
- in those cases. */
+ vcall or vbase offset is required, THUNK_VIRTUAL_OFFSET is
+ used. For this pointer adjusting thunks, it is the vcall offset
+ into the vtable. For result pointer adjusting thunks it is the
+ binfo of the virtual base to convert to. Use that binfo's vbase
+ offset.
+
+ It is possible to have equivalent covariant thunks. These are
+ distinct virtual covariant thunks whose vbase offsets happen to
+ have the same value. THUNK_ALIAS is used to pick one as the
+ canonical thunk, which will get all the this pointer adjusting
+ thunks attached to it. */
/* An integer indicating how many bytes should be subtracted from the
this or result pointer when this function is called. */
@@ -2877,15 +2886,11 @@ struct lang_decl GTY(())
binfos.) */
#define THUNK_VIRTUAL_OFFSET(DECL) \
- (LANG_DECL_U2_CHECK (VAR_OR_FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset)
-
-/* A thunk which is equivalent to another thunk. */
-#define THUNK_ALIAS_P(DECL) \
- (THUNK_VIRTUAL_OFFSET (DECL) && DECL_P (THUNK_VIRTUAL_OFFSET (DECL)))
+ (LANG_DECL_U2_CHECK (FUNCTION_DECL_CHECK (DECL), 0)->virtual_offset)
-/* When THUNK_ALIAS_P is true, this indicates the thunk which is
- aliased. */
-#define THUNK_ALIAS(DECL) THUNK_VIRTUAL_OFFSET (DECL)
+/* A thunk which is equivalent to another thunk. */
+#define THUNK_ALIAS(DECL) \
+ (DECL_LANG_SPECIFIC (FUNCTION_DECL_CHECK (DECL))->decl_flags.u.thunk_alias)
/* For thunk NODE, this is the FUNCTION_DECL thunked to. */
#define THUNK_TARGET(NODE) \
@@ -2935,7 +2940,7 @@ typedef enum cp_lvalue_kind {
clk_ordinary = 1, /* An ordinary lvalue. */
clk_class = 2, /* An rvalue of class-type. */
clk_bitfield = 4, /* An lvalue for a bit-field. */
- clk_packed = 8 /* An lvalue for a packed field. */
+ clk_packed = 8 /* An lvalue for a packed field. */
} cp_lvalue_kind;
/* Various kinds of template specialization, instantiation, etc. */
@@ -3080,8 +3085,6 @@ extern GTY(()) tree error_mark_list;
extern GTY(()) tree integer_two_node;
extern GTY(()) tree integer_three_node;
-extern GTY(()) tree anonymous_namespace_name;
-
/* The number of function bodies which we are currently processing.
(Zero if we are at namespace scope, one inside the body of a
function, two inside the body of a function in a local class, etc.) */
@@ -3618,7 +3621,7 @@ extern void pushtag (tree, tree, int);
extern tree make_anon_name (void);
extern void clear_anon_tags (void);
extern int decls_match (tree, tree);
-extern int duplicate_decls (tree, tree);
+extern tree duplicate_decls (tree, tree);
extern tree pushdecl_top_level (tree);
extern tree pushdecl_top_level_and_finish (tree, tree);
extern tree push_using_decl (tree, tree);
@@ -3689,6 +3692,7 @@ extern int walk_namespaces (walk_namespaces_fn,
extern int wrapup_globals_for_namespace (tree, void *);
extern tree create_implicit_typedef (tree, tree);
extern tree maybe_push_decl (tree);
+extern tree force_target_expr (tree, tree);
extern tree build_target_expr_with_type (tree, tree);
extern int local_variable_p (tree);
extern int nonstatic_local_decl_p (tree);
@@ -3706,14 +3710,13 @@ extern GTY(()) tree last_function_parms;
/* in decl2.c */
extern bool check_java_method (tree);
extern int grok_method_quals (tree, tree, tree);
-extern void warn_if_unknown_interface (tree);
extern void grok_x_components (tree);
extern void maybe_retrofit_in_chrg (tree);
extern void maybe_make_one_only (tree);
extern void grokclassfn (tree, tree, enum overload_flags, tree);
extern tree grok_array_decl (tree, tree);
extern tree delete_sanity (tree, tree, int, int);
-extern tree check_classfn (tree, tree);
+extern tree check_classfn (tree, tree, bool);
extern void check_member_template (tree);
extern tree grokfield (tree, tree, tree, tree, tree);
extern tree grokbitfield (tree, tree, tree);
@@ -3872,6 +3875,7 @@ extern void redeclare_class_template (tree, tree);
extern tree lookup_template_class (tree, tree, tree, tree, int, tsubst_flags_t);
extern tree lookup_template_function (tree, tree);
extern int uses_template_parms (tree);
+extern int uses_template_parms_level (tree, int);
extern tree instantiate_class_template (tree);
extern tree instantiate_template (tree, tree, tsubst_flags_t);
extern int fn_type_unification (tree, tree, tree, tree, tree, unification_kind_t, int);
@@ -3889,6 +3893,7 @@ extern int is_member_template (tree);
extern int comp_template_parms (tree, tree);
extern int template_class_depth (tree);
extern int is_specialization_of (tree, tree);
+extern bool is_specialization_of_friend (tree, tree);
extern int comp_template_args (tree, tree);
extern void maybe_process_partial_specialization (tree);
extern void maybe_check_template_type (tree);
@@ -3959,6 +3964,7 @@ extern void reinit_search_statistics (void);
extern tree current_scope (void);
extern int at_function_scope_p (void);
extern bool at_class_scope_p (void);
+extern bool at_namespace_scope_p (void);
extern tree context_for_name_lookup (tree);
extern tree lookup_conversions (tree);
extern tree binfo_for_vtable (tree);
@@ -4162,8 +4168,6 @@ extern int cp_is_overload_p (tree);
extern int cp_auto_var_in_fn_p (tree,tree);
extern tree cp_copy_res_decl_for_inlining (tree, tree, tree, void*,
int*, tree);
-extern int cp_start_inlining (tree);
-extern void cp_end_inlining (tree);
/* in typeck.c */
extern int string_conv_p (tree, tree, int);
diff --git a/gcc/cp/cvt.c b/gcc/cp/cvt.c
index cf69b95a333..4672830ed60 100644
--- a/gcc/cp/cvt.c
+++ b/gcc/cp/cvt.c
@@ -76,8 +76,8 @@ static void warn_ref_binding (tree, tree, tree);
static tree
cp_convert_to_pointer (tree type, tree expr, bool force)
{
- register tree intype = TREE_TYPE (expr);
- register enum tree_code form;
+ tree intype = TREE_TYPE (expr);
+ enum tree_code form;
tree rval;
if (IS_AGGR_TYPE (intype))
@@ -306,8 +306,8 @@ cp_convert_to_pointer (tree type, tree expr, bool force)
static tree
convert_to_pointer_force (tree type, tree expr)
{
- register tree intype = TREE_TYPE (expr);
- register enum tree_code form = TREE_CODE (intype);
+ tree intype = TREE_TYPE (expr);
+ enum tree_code form = TREE_CODE (intype);
if (form == POINTER_TYPE)
{
@@ -449,8 +449,8 @@ tree
convert_to_reference (tree reftype, tree expr, int convtype,
int flags, tree decl)
{
- register tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype));
- register tree intype;
+ tree type = TYPE_MAIN_VARIANT (TREE_TYPE (reftype));
+ tree intype;
tree rval = NULL_TREE;
tree rval_as_conversion = NULL_TREE;
bool can_convert_intype_to_type;
@@ -612,8 +612,8 @@ cp_convert (tree type, tree expr)
tree
ocp_convert (tree type, tree expr, int convtype, int flags)
{
- register tree e = expr;
- register enum tree_code code = TREE_CODE (type);
+ tree e = expr;
+ enum tree_code code = TREE_CODE (type);
if (error_operand_p (e) || type == error_mark_node)
return error_mark_node;
@@ -817,7 +817,8 @@ convert_to_void (tree expr, const char *implicit)
/* The second part of a compound expr contains the value. */
tree op1 = TREE_OPERAND (expr,1);
tree new_op1 = convert_to_void
- (op1, implicit ? "right-hand operand of comma" : NULL);
+ (op1, (implicit && !TREE_NO_UNUSED_WARNING (expr)
+ ? "right-hand operand of comma" : NULL));
if (new_op1 != op1)
{
@@ -834,7 +835,7 @@ convert_to_void (tree expr, const char *implicit)
/* These have already decayed to rvalue. */
break;
- case CALL_EXPR: /* we have a special meaning for volatile void fn() */
+ case CALL_EXPR: /* We have a special meaning for volatile void fn(). */
break;
case INDIRECT_REF:
@@ -883,6 +884,7 @@ convert_to_void (tree expr, const char *implicit)
of an overloaded function, and this is not one of them. */
pedwarn ("%s cannot resolve address of overloaded function",
implicit ? implicit : "void cast");
+ expr = void_zero_node;
}
else if (implicit && probe == expr && is_overloaded_fn (probe))
/* Only warn when there is no &. */
@@ -943,8 +945,8 @@ convert (tree type, tree expr)
tree
convert_force (tree type, tree expr, int convtype)
{
- register tree e = expr;
- register enum tree_code code = TREE_CODE (type);
+ tree e = expr;
+ enum tree_code code = TREE_CODE (type);
if (code == REFERENCE_TYPE)
return fold (convert_to_reference (type, e, CONV_C_CAST, LOOKUP_COMPLAIN,
diff --git a/gcc/cp/cxx-pretty-print.c b/gcc/cp/cxx-pretty-print.c
index ca8c603c0e3..53c677ab88a 100644
--- a/gcc/cp/cxx-pretty-print.c
+++ b/gcc/cp/cxx-pretty-print.c
@@ -619,7 +619,7 @@ pp_cxx_pm_expression (cxx_pretty_printer *pp, tree t)
pp_cxx_qualified_id (pp, t);
break;
}
- /* else fall through */
+ /* Else fall through. */
case MEMBER_REF:
case DOTSTAR_EXPR:
pp_cxx_pm_expression (pp, TREE_OPERAND (t, 0));
@@ -1055,7 +1055,7 @@ pp_cxx_ptr_operator (cxx_pretty_printer *pp, tree t)
pp_cxx_cv_qualifier_seq (pp, t);
break;
}
- /* else fall trhough. */
+ /* else fall through. */
default:
pp_unsupported_tree (pp, t);
@@ -1479,7 +1479,7 @@ static void
pp_cxx_original_namespace_definition (cxx_pretty_printer *pp, tree t)
{
pp_cxx_identifier (pp, "namespace");
- if (DECL_NAME (t) != anonymous_namespace_name)
+ if (DECL_NAME (t))
pp_cxx_unqualified_id (pp, t);
pp_cxx_whitespace (pp);
pp_cxx_left_brace (pp);
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 2bd6ff335bc..92f3a75975c 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -140,7 +140,7 @@ tree error_mark_list;
tree ptm_desc_type_node;
tree base_desc_type_node;
- tree class_type_node, record_type_node, union_type_node, enum_type_node;
+ tree class_type_node;
tree unknown_type_node;
Array type `vtable_entry_type[]'
@@ -228,10 +228,6 @@ struct named_label_list GTY(())
#define named_labels cp_function_chain->x_named_labels
-/* The name of the anonymous namespace, throughout this translation
- unit. */
-tree anonymous_namespace_name;
-
/* The number of function bodies which we are currently processing.
(Zero if we are at namespace scope, one inside the body of a
function, two inside the body of a function in a local class, etc.) */
@@ -429,7 +425,7 @@ pop_labels (tree block)
tree
poplevel (int keep, int reverse, int functionbody)
{
- register tree link;
+ tree link;
/* The chain of decls was accumulated in reverse order.
Put it into forward order, just for cleanliness. */
tree decls;
@@ -1137,14 +1133,14 @@ warn_extern_redeclared_static (tree newdecl, tree olddecl)
cp_pedwarn_at ("previous declaration of `%D'", olddecl);
}
-/* Handle when a new declaration NEWDECL has the same name as an old
- one OLDDECL in the same binding contour. Prints an error message
- if appropriate.
+/* If NEWDECL is a redeclaration of OLDDECL, merge the declarations.
+ If the redeclaration is invalid, a diagnostic is issued, and the
+ error_mark_node is returned. Otherwise, OLDDECL is returned.
- If safely possible, alter OLDDECL to look like NEWDECL, and return 1.
- Otherwise, return 0. */
+ If NEWDECL is not a redeclaration of OLDDECL, NULL_TREE is
+ returned. */
-int
+tree
duplicate_decls (tree newdecl, tree olddecl)
{
unsigned olddecl_uid = DECL_UID (olddecl);
@@ -1152,7 +1148,7 @@ duplicate_decls (tree newdecl, tree olddecl)
int new_defines_function = 0;
if (newdecl == olddecl)
- return 1;
+ return olddecl;
types_match = decls_match (newdecl, olddecl);
@@ -1205,7 +1201,7 @@ duplicate_decls (tree newdecl, tree olddecl)
{
/* Avoid warnings redeclaring anticipated built-ins. */
if (DECL_ANTICIPATED (olddecl))
- return 0;
+ return NULL_TREE;
/* If you declare a built-in or predefined function name as static,
the old definition is overridden, but optionally warn this was a
@@ -1217,7 +1213,7 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_BUILT_IN (olddecl) ? "built-in" : "library",
olddecl);
/* Discard the old built-in function. */
- return 0;
+ return NULL_TREE;
}
/* If the built-in is not ansi, then programs can override
it even globally without an error. */
@@ -1230,7 +1226,7 @@ duplicate_decls (tree newdecl, tree olddecl)
error ("conflicts with built-in declaration `%#D'",
olddecl);
}
- return 0;
+ return NULL_TREE;
}
else if (!types_match)
{
@@ -1257,7 +1253,7 @@ duplicate_decls (tree newdecl, tree olddecl)
}
else
/* Discard the old built-in function. */
- return 0;
+ return NULL_TREE;
/* Replace the old RTL to avoid problems with inlining. */
SET_DECL_RTL (olddecl, DECL_RTL (newdecl));
@@ -1265,7 +1261,14 @@ duplicate_decls (tree newdecl, tree olddecl)
/* Even if the types match, prefer the new declarations type
for anticipated built-ins, for exception lists, etc... */
else if (DECL_ANTICIPATED (olddecl))
- TREE_TYPE (olddecl) = TREE_TYPE (newdecl);
+ {
+ tree type = TREE_TYPE (newdecl);
+ tree attribs = (*targetm.merge_type_attributes)
+ (TREE_TYPE (olddecl), type);
+
+ type = build_type_attribute_variant (type, attribs);
+ TREE_TYPE (newdecl) = TREE_TYPE (olddecl) = type;
+ }
/* Whether or not the builtin can throw exceptions has no
bearing on this declarator. */
@@ -1302,14 +1305,14 @@ duplicate_decls (tree newdecl, tree olddecl)
get shadowed, and know that if we need to find a TYPE_DECL
for a given name, we can look in the IDENTIFIER_TYPE_VALUE
slot of the identifier. */
- return 0;
+ return NULL_TREE;
}
if ((TREE_CODE (newdecl) == FUNCTION_DECL
&& DECL_FUNCTION_TEMPLATE_P (olddecl))
|| (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_FUNCTION_TEMPLATE_P (newdecl)))
- return 0;
+ return NULL_TREE;
error ("`%#D' redeclared as different kind of symbol", newdecl);
if (TREE_CODE (olddecl) == TREE_LIST)
@@ -1319,14 +1322,14 @@ duplicate_decls (tree newdecl, tree olddecl)
/* New decl is completely inconsistent with the old one =>
tell caller to replace the old one. */
- return 0;
+ return NULL_TREE;
}
else if (!types_match)
{
if (CP_DECL_CONTEXT (newdecl) != CP_DECL_CONTEXT (olddecl))
/* These are certainly not duplicate declarations; they're
from different scopes. */
- return 0;
+ return NULL_TREE;
if (TREE_CODE (newdecl) == TEMPLATE_DECL)
{
@@ -1354,7 +1357,7 @@ duplicate_decls (tree newdecl, tree olddecl)
error ("new declaration `%#D'", newdecl);
cp_error_at ("ambiguates old declaration `%#D'", olddecl);
}
- return 0;
+ return NULL_TREE;
}
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
@@ -1371,7 +1374,7 @@ duplicate_decls (tree newdecl, tree olddecl)
cp_error_at ("ambiguates old declaration `%#D'", olddecl);
}
else
- return 0;
+ return NULL_TREE;
}
/* Already complained about this, so don't do so again. */
@@ -1381,7 +1384,7 @@ duplicate_decls (tree newdecl, tree olddecl)
error ("conflicting declaration '%#D'", newdecl);
cp_error_at ("'%D' has a previous declaration as `%#D'",
olddecl, olddecl);
- return false;
+ return NULL_TREE;
}
}
else if (TREE_CODE (newdecl) == FUNCTION_DECL
@@ -1401,7 +1404,7 @@ duplicate_decls (tree newdecl, tree olddecl)
can occur if we instantiate a template class, and then
specialize one of its methods. This situation is valid, but
the declarations must be merged in the usual way. */
- return 0;
+ return NULL_TREE;
else if (TREE_CODE (newdecl) == FUNCTION_DECL
&& ((DECL_TEMPLATE_INSTANTIATION (olddecl)
&& !DECL_USE_TEMPLATE (newdecl))
@@ -1409,12 +1412,20 @@ duplicate_decls (tree newdecl, tree olddecl)
&& !DECL_USE_TEMPLATE (olddecl))))
/* One of the declarations is a template instantiation, and the
other is not a template at all. That's OK. */
- return 0;
+ return NULL_TREE;
else if (TREE_CODE (newdecl) == NAMESPACE_DECL
&& DECL_NAMESPACE_ALIAS (newdecl)
&& DECL_NAMESPACE_ALIAS (newdecl) == DECL_NAMESPACE_ALIAS (olddecl))
- /* Redeclaration of namespace alias, ignore it. */
- return 1;
+ /* In [namespace.alias] we have:
+
+ In a declarative region, a namespace-alias-definition can be
+ used to redefine a namespace-alias declared in that declarative
+ region to refer only to the namespace to which it already
+ refers.
+
+ Therefore, if we encounter a second alias directive for the same
+ alias, we can just ignore the second directive. */
+ return olddecl;
else
{
const char *errmsg = redeclaration_error_message (newdecl, olddecl);
@@ -1426,7 +1437,7 @@ duplicate_decls (tree newdecl, tree olddecl)
&& namespace_bindings_p ())
? "`%#D' previously defined here"
: "`%#D' previously declared here", olddecl);
- return 0;
+ return error_mark_node;
}
else if (TREE_CODE (olddecl) == FUNCTION_DECL
&& DECL_INITIAL (olddecl) != NULL_TREE
@@ -1506,7 +1517,7 @@ duplicate_decls (tree newdecl, tree olddecl)
if (TREE_CODE (olddecl) == TYPE_DECL
&& (DECL_IMPLICIT_TYPEDEF_P (olddecl)
|| DECL_IMPLICIT_TYPEDEF_P (newdecl)))
- return 0;
+ return NULL_TREE;
/* If new decl is `static' and an `extern' was seen previously,
warn about it. */
@@ -1552,8 +1563,8 @@ duplicate_decls (tree newdecl, tree olddecl)
/* Deal with C++: must preserve virtual function table size. */
if (TREE_CODE (olddecl) == TYPE_DECL)
{
- register tree newtype = TREE_TYPE (newdecl);
- register tree oldtype = TREE_TYPE (olddecl);
+ tree newtype = TREE_TYPE (newdecl);
+ tree oldtype = TREE_TYPE (olddecl);
if (newtype != error_mark_node && oldtype != error_mark_node
&& TYPE_LANG_SPECIFIC (newtype) && TYPE_LANG_SPECIFIC (oldtype))
@@ -1585,7 +1596,15 @@ duplicate_decls (tree newdecl, tree olddecl)
= DECL_SOURCE_LOCATION (newdecl);
}
- return 1;
+ if (DECL_FUNCTION_TEMPLATE_P (newdecl))
+ {
+ DECL_INLINE (DECL_TEMPLATE_RESULT (olddecl))
+ |= DECL_INLINE (DECL_TEMPLATE_RESULT (newdecl));
+ DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (olddecl))
+ |= DECL_DECLARED_INLINE_P (DECL_TEMPLATE_RESULT (newdecl));
+ }
+
+ return olddecl;
}
if (types_match)
@@ -1852,6 +1871,19 @@ duplicate_decls (tree newdecl, tree olddecl)
DECL_COMMON (newdecl) = DECL_COMMON (olddecl);
COPY_DECL_ASSEMBLER_NAME (olddecl, newdecl);
+ /* If either declaration has a nondefault visibility, use it. */
+ if (DECL_VISIBILITY (olddecl) != VISIBILITY_DEFAULT)
+ {
+ if (DECL_VISIBILITY (newdecl) != VISIBILITY_DEFAULT
+ && DECL_VISIBILITY (newdecl) != DECL_VISIBILITY (olddecl))
+ {
+ warning ("%J'%D': visibility attribute ignored because it",
+ newdecl, newdecl);
+ warning ("%Jconflicts with previous declaration here", olddecl);
+ }
+ DECL_VISIBILITY (newdecl) = DECL_VISIBILITY (olddecl);
+ }
+
if (TREE_CODE (newdecl) == FUNCTION_DECL)
{
int function_size;
@@ -1913,7 +1945,7 @@ duplicate_decls (tree newdecl, tree olddecl)
&& TREE_STATIC (olddecl))))
make_decl_rtl (olddecl, NULL);
- return 1;
+ return olddecl;
}
/* Generate an implicit declaration for identifier FUNCTIONID
@@ -1922,7 +1954,7 @@ duplicate_decls (tree newdecl, tree olddecl)
tree
implicitly_declare (tree functionid)
{
- register tree decl;
+ tree decl;
/* We used to reuse an old implicit decl here,
but this loses with inline functions because it can clobber
@@ -2331,7 +2363,7 @@ define_label (location_t location, tree name)
{
tree decl = lookup_label (name);
struct named_label_list *ent;
- register struct cp_binding_level *p;
+ struct cp_binding_level *p;
timevar_push (TV_NAME_LOOKUP);
for (ent = named_labels; ent; ent = ent->next)
@@ -2422,19 +2454,7 @@ tree
finish_case_label (tree low_value, tree high_value)
{
tree cond, r;
- register struct cp_binding_level *p;
-
- if (! switch_stack)
- {
- if (high_value)
- error ("case label not within a switch statement");
- else if (low_value)
- error ("case label `%E' not within a switch statement",
- low_value);
- else
- error ("`default' label not within a switch statement");
- return NULL_TREE;
- }
+ struct cp_binding_level *p;
if (processing_template_decl)
{
@@ -3098,7 +3118,7 @@ cxx_init_decl_processing (void)
/* Generate an initializer for a function naming variable from
NAME. NAME may be NULL, to indicate a dependent name. TYPE_P is
- filled in with the type of the init. */
+ filled in with the type of the init. */
tree
cp_fname_init (const char* name, tree *type_p)
@@ -3160,9 +3180,10 @@ cp_make_fname_decl (tree id, int type_dep)
while (b->level_chain->kind != sk_function_parms)
b = b->level_chain;
pushdecl_with_scope (decl, b);
+ cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
}
-
- cp_finish_decl (decl, init, NULL_TREE, LOOKUP_ONLYCONVERTING);
+ else
+ pushdecl_top_level_and_finish (decl, init);
return decl;
}
@@ -3371,7 +3392,7 @@ fixup_anonymous_aggr (tree t)
{
tree *q;
- /* Wipe out memory of synthesized methods */
+ /* Wipe out memory of synthesized methods. */
TYPE_HAS_CONSTRUCTOR (t) = 0;
TYPE_HAS_DEFAULT_CONSTRUCTOR (t) = 0;
TYPE_HAS_INIT_REF (t) = 0;
@@ -3435,7 +3456,7 @@ check_tag_decl (tree declspecs)
int saw_friend = 0;
int saw_typedef = 0;
tree ob_modifier = NULL_TREE;
- register tree link;
+ tree link;
/* If a class, struct, or enum type is declared by the DECLSPECS
(i.e, if a class-specifier, enum-specifier, or non-typename
elaborated-type-specifier appears in the DECLSPECS),
@@ -3632,7 +3653,7 @@ start_decl (tree declarator,
tree prefix_attributes)
{
tree decl;
- register tree type, tem;
+ tree type, tem;
tree context;
/* This should only be done once on the top most decl. */
@@ -3758,7 +3779,9 @@ start_decl (tree declarator,
}
else
{
- tree field = check_classfn (context, decl);
+ tree field = check_classfn (context, decl,
+ processing_template_decl
+ > template_class_depth (context));
if (field && duplicate_decls (decl, field))
decl = field;
}
@@ -4263,8 +4286,11 @@ reshape_init (tree type, tree *initp)
empty class shall have the form of an empty
initializer-list {}. */
if (!brace_enclosed_p)
- error ("initializer for `%T' must be brace-enclosed",
- type);
+ {
+ error ("initializer for `%T' must be brace-enclosed",
+ type);
+ return error_mark_node;
+ }
}
else
{
@@ -4289,6 +4315,8 @@ reshape_init (tree type, tree *initp)
break;
field_init = reshape_init (TREE_TYPE (field), initp);
+ if (field_init == error_mark_node)
+ return error_mark_node;
TREE_CHAIN (field_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = field_init;
/* [dcl.init.aggr]
@@ -4319,10 +4347,22 @@ reshape_init (tree type, tree *initp)
tree element_init;
element_init = reshape_init (TREE_TYPE (type), initp);
+ if (element_init == error_mark_node)
+ return error_mark_node;
TREE_CHAIN (element_init) = CONSTRUCTOR_ELTS (new_init);
CONSTRUCTOR_ELTS (new_init) = element_init;
if (TREE_PURPOSE (element_init))
- index = TREE_PURPOSE (element_init);
+ {
+ tree next_index = TREE_PURPOSE (element_init);
+ if (TREE_CODE (next_index) == IDENTIFIER_NODE)
+ {
+ error ("name `%D' used in a GNU-style designated "
+ "initializer for an array", next_index);
+ TREE_PURPOSE (element_init) = NULL_TREE;
+ }
+ else
+ index = next_index;
+ }
}
}
else
@@ -4528,7 +4568,7 @@ make_rtl_for_nonlocal_decl (tree decl, tree init, const char* asmspec)
/* Set the DECL_ASSEMBLER_NAME for the variable. */
if (asmspec)
{
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (asmspec));
+ change_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. */
@@ -4910,7 +4950,7 @@ cp_finish_decl (tree decl, tree init, tree asmspec_tree, int flags)
mark_referenced (DECL_ASSEMBLER_NAME (decl));
}
-/* This is here for a midend callback from c-common.c */
+/* This is here for a midend callback from c-common.c. */
void
finish_decl (tree decl, tree init, tree asmspec_tree)
@@ -5271,7 +5311,7 @@ start_handler_parms (tree declspecs, tree declarator)
int
complete_array_type (tree type, tree initial_value, int do_default)
{
- register tree maxindex = NULL_TREE;
+ tree maxindex = NULL_TREE;
int value = 0;
if (initial_value)
@@ -5663,7 +5703,9 @@ grokfndecl (tree ctype,
{
tree old_decl;
- old_decl = check_classfn (ctype, decl);
+ old_decl = check_classfn (ctype, decl,
+ processing_template_decl
+ > template_class_depth (ctype));
if (old_decl && TREE_CODE (old_decl) == TEMPLATE_DECL)
/* Because grokfndecl is always supposed to return a
@@ -5685,7 +5727,7 @@ grokfndecl (tree ctype,
if (old_decl)
{
- bool ok;
+ tree ok;
/* Since we've smashed OLD_DECL to its
DECL_TEMPLATE_RESULT, we must do the same to DECL. */
@@ -5972,48 +6014,35 @@ check_static_variable_definition (tree decl, tree type)
tree
compute_array_index_type (tree name, tree size)
{
+ tree type = TREE_TYPE (size);
tree itype;
- /* 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
- that is not a constant; we don't even simplify `1 + 2' when
- processing a template. */
- if (processing_template_decl)
+ /* The array bound must be an integer type. */
+ if (!dependent_type_p (type) && !INTEGRAL_TYPE_P (type))
{
- /* Resolve a qualified reference to an enumerator or static
- const data member of ours. */
- if (TREE_CODE (size) == SCOPE_REF
- && TREE_OPERAND (size, 0) == current_class_type)
- {
- tree t = lookup_field (current_class_type,
- TREE_OPERAND (size, 1), 0, false);
- if (t)
- size = t;
- }
-
- return build_index_type (build_min (MINUS_EXPR, sizetype,
- size, integer_one_node));
+ if (name)
+ error ("size of array `%D' has non-integral type `%T'", name, type);
+ else
+ error ("size of array has non-integral type `%T'", type);
+ size = integer_one_node;
+ type = TREE_TYPE (size);
}
+ if (abi_version_at_least (2)
+ /* We should only handle value dependent expressions specially. */
+ ? value_dependent_expression_p (size)
+ /* But for abi-1, we handled all instances in templates. This
+ effects the manglings produced. */
+ : processing_template_decl)
+ return build_index_type (build_min (MINUS_EXPR, sizetype,
+ 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
- && TREE_CODE (TREE_TYPE (size)) != BOOLEAN_TYPE)
- {
- if (name)
- error ("size of array `%D' has non-integer type", name);
- else
- error ("size of array has non-integer type");
- size = integer_one_node;
- }
-
/* Normally, the array-bound will be a constant. */
if (TREE_CODE (size) == INTEGER_CST)
{
@@ -6055,38 +6084,36 @@ compute_array_index_type (tree name, tree size)
else
error ("size of array is not an integral constant-expression");
}
+ else if (pedantic)
+ {
+ if (name)
+ pedwarn ("ISO C++ forbids variable-size array `%D'", name);
+ else
+ pedwarn ("ISO C++ forbids variable-size array");
+ }
- /* Compute the index of the largest element in the array. It is
- one less than the number of elements in the array. */
- itype
- = fold (cp_build_binary_op (MINUS_EXPR,
- cp_convert (ssizetype, size),
- cp_convert (ssizetype,
- integer_one_node)));
-
- /* Check for variable-sized arrays. We allow such things as an
- extension, even though they are not allowed in ANSI/ISO C++. */
- if (!TREE_CONSTANT (itype))
+ if (processing_template_decl && !TREE_CONSTANT (size))
+ /* A variable sized array. */
+ itype = build_min (MINUS_EXPR, sizetype, size, integer_one_node);
+ else
{
- if (pedantic)
+ /* Compute the index of the largest element in the array. It is
+ one less than the number of elements in the array. */
+ itype
+ = fold (cp_build_binary_op (MINUS_EXPR,
+ cp_convert (ssizetype, size),
+ cp_convert (ssizetype, integer_one_node)));
+ if (!TREE_CONSTANT (itype))
+ /* A variable sized array. */
+ itype = variable_size (itype);
+ /* Make sure that there was no overflow when creating to a signed
+ index type. (For example, on a 32-bit machine, an array with
+ size 2^32 - 1 is too big.) */
+ else if (TREE_OVERFLOW (itype))
{
- if (name)
- pedwarn ("ISO C++ forbids variable-size array `%D'",
- name);
- else
- pedwarn ("ISO C++ forbids variable-size array");
+ error ("overflow in array dimension");
+ TREE_OVERFLOW (itype) = 0;
}
-
- /* Create a variable-sized array index type. */
- itype = variable_size (itype);
- }
- /* Make sure that there was no overflow when creating to a signed
- index type. (For example, on a 32-bit machine, an array with
- size 2^32 - 1 is too big.) */
- else if (TREE_OVERFLOW (itype))
- {
- error ("overflow in array dimension");
- TREE_OVERFLOW (itype) = 0;
}
/* Create and return the appropriate index type. */
@@ -6348,7 +6375,7 @@ grokdeclarator (tree declarator,
and get it as a string, for an error message. */
{
tree *next = &declarator;
- register tree decl;
+ tree decl;
name = NULL;
while (next && *next)
@@ -6672,8 +6699,8 @@ grokdeclarator (tree declarator,
for (spec = declspecs; spec; spec = TREE_CHAIN (spec))
{
- register int i;
- register tree id;
+ int i;
+ tree id;
/* Certain parse errors slip through. For example,
`int class;' is not caught by the parser. Try
@@ -6777,7 +6804,7 @@ grokdeclarator (tree declarator,
error ("two or more data types in declaration of `%s'", name);
else if (TREE_CODE (id) == IDENTIFIER_NODE)
{
- register tree t = lookup_name (id, 1);
+ tree t = lookup_name (id, 1);
if (!t || TREE_CODE (t) != TYPE_DECL)
error ("`%s' fails to be a typedef or built in type",
IDENTIFIER_POINTER (id));
@@ -7086,7 +7113,7 @@ grokdeclarator (tree declarator,
else if (RIDBIT_SETP (RID_TYPEDEF, specbits))
;
else if (decl_context == FIELD
- /* C++ allows static class elements */
+ /* C++ allows static class elements. */
&& RIDBIT_SETP (RID_STATIC, specbits))
/* C++ also allows inlines and signed and unsigned elements,
but in those cases we don't come in here. */
@@ -7096,7 +7123,7 @@ grokdeclarator (tree declarator,
if (decl_context == FIELD)
{
tree tmp = NULL_TREE;
- register int op = 0;
+ int op = 0;
if (declarator)
{
@@ -7472,7 +7499,7 @@ grokdeclarator (tree declarator,
if (TREE_TYPE (declarator))
{
- register tree typemodlist;
+ tree typemodlist;
int erred = 0;
int constp = 0;
int volatilep = 0;
@@ -7991,7 +8018,7 @@ grokdeclarator (tree declarator,
}
{
- register tree decl;
+ tree decl;
if (decl_context == PARM)
{
@@ -8194,7 +8221,7 @@ grokdeclarator (tree declarator,
return void_type_node;
}
- /* Structure field. It may not be a function, except for C++ */
+ /* Structure field. It may not be a function, except for C++. */
if (decl == NULL_TREE)
{
@@ -8419,7 +8446,7 @@ require_complete_types_for_parms (tree parms)
for (; parms; parms = TREE_CHAIN (parms))
{
if (VOID_TYPE_P (TREE_TYPE (parms)))
- /* grokparms will have already issued an error */
+ /* grokparms will have already issued an error. */
TREE_TYPE (parms) = error_mark_node;
else if (complete_type_or_else (TREE_TYPE (parms), parms))
{
@@ -9283,7 +9310,7 @@ xref_tag (enum tag_types tag_code, tree name, tree attributes,
bool globalize, bool template_header_p)
{
enum tree_code code;
- register tree t;
+ tree t;
struct cp_binding_level *b = current_binding_level;
tree context = NULL_TREE;
@@ -9615,7 +9642,15 @@ xref_basetypes (tree ref, tree base_list)
inheritance order chain. */
copy_base_binfos (TYPE_BINFO (ref), ref, NULL_TREE);
CLASSTYPE_VBASECLASSES (ref) = nreverse (CLASSTYPE_VBASECLASSES (ref));
-
+
+ if (TYPE_FOR_JAVA (ref))
+ {
+ if (TYPE_USES_MULTIPLE_INHERITANCE (ref))
+ error ("Java class '%T' cannot have multiple bases", ref);
+ if (CLASSTYPE_VBASECLASSES (ref))
+ error ("Java class '%T' cannot have virtual bases", ref);
+ }
+
/* Unmark all the types. */
while (i--)
{
@@ -9641,7 +9676,7 @@ xref_basetypes (tree ref, tree base_list)
tree
start_enum (tree name)
{
- register tree enumtype = NULL_TREE;
+ tree enumtype = NULL_TREE;
struct cp_binding_level *b = current_binding_level;
/* If this is the real definition for a previous forward reference,
@@ -10217,7 +10252,19 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
/* A specialization is not used to guide overload resolution. */
if (!DECL_TEMPLATE_SPECIALIZATION (decl1)
&& ! DECL_FUNCTION_MEMBER_P (decl1))
- decl1 = pushdecl (decl1);
+ {
+ tree olddecl = pushdecl (decl1);
+
+ if (olddecl == error_mark_node)
+ /* If something went wrong when registering the declaration,
+ use DECL1; we have to have a FUNCTION_DECL to use when
+ parsing the body of the function. */
+ ;
+ else
+ /* Otherwise, OLDDECL is either a previous declaration of
+ the same function or DECL1 itself. */
+ decl1 = olddecl;
+ }
else
{
/* We need to set the DECL_CONTEXT. */
@@ -10288,8 +10335,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
If it belongs to someone else's interface, it is also external.
This only affects inlines and template instantiations. */
else if (interface_unknown == 0
- && (! DECL_TEMPLATE_INSTANTIATION (decl1)
- || flag_alt_external_templates))
+ && ! DECL_TEMPLATE_INSTANTIATION (decl1))
{
if (DECL_DECLARED_INLINE_P (decl1)
|| DECL_TEMPLATE_INSTANTIATION (decl1)
@@ -10310,8 +10356,7 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
DECL_INTERFACE_KNOWN (decl1) = 1;
}
else if (interface_unknown && interface_only
- && (! DECL_TEMPLATE_INSTANTIATION (decl1)
- || flag_alt_external_templates))
+ && ! DECL_TEMPLATE_INSTANTIATION (decl1))
{
/* If MULTIPLE_SYMBOL_SPACES is defined and we saw a #pragma
interface, we will have interface_only set but not
@@ -10365,8 +10410,8 @@ start_function (tree declspecs, tree declarator, tree attrs, int flags)
static void
store_parm_decls (tree current_function_parms)
{
- register tree fndecl = current_function_decl;
- register tree parm;
+ tree fndecl = current_function_decl;
+ tree parm;
/* This is a chain of any other decls that came in among the parm
declarations. If a parm is declared with enum {foo, bar} x;
@@ -10642,7 +10687,7 @@ finish_function_body (tree compstmt)
tree
finish_function (int flags)
{
- register tree fndecl = current_function_decl;
+ tree fndecl = current_function_decl;
tree fntype, ctype = NULL_TREE;
int inclass_inline = (flags & 2) != 0;
int nested;
@@ -10797,6 +10842,7 @@ finish_function (int flags)
/* Complain if there's just no return statement. */
if (warn_return_type
&& TREE_CODE (TREE_TYPE (fntype)) != VOID_TYPE
+ && !dependent_type_p (TREE_TYPE (fntype))
&& !current_function_returns_value && !current_function_returns_null
/* Don't complain if we abort or throw. */
&& !current_function_returns_abnormally
@@ -10915,7 +10961,7 @@ start_method (tree declspecs, tree declarator, tree attrlist)
cp_finish_decl (fndecl, NULL_TREE, NULL_TREE, 0);
- /* Make a place for the parms */
+ /* Make a place for the parms. */
begin_scope (sk_function_parms, fndecl);
DECL_IN_AGGR_P (fndecl) = 1;
@@ -10937,10 +10983,10 @@ start_method (tree declspecs, tree declarator, tree attrlist)
tree
finish_method (tree decl)
{
- register tree fndecl = decl;
+ tree fndecl = decl;
tree old_initial;
- register tree link;
+ tree link;
if (decl == void_type_node)
return decl;
@@ -11128,8 +11174,6 @@ cxx_push_function_context (struct function * f)
{
tree fn = f->decl;
- current_function_is_thunk = DECL_THUNK_P (fn);
-
if (DECL_SAVED_FUNCTION_DATA (fn))
{
/* If we already parsed this function, and we're just expanding it
diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c
index 7be1c1402c9..4068826a9a9 100644
--- a/gcc/cp/decl2.c
+++ b/gcc/cp/decl2.c
@@ -156,36 +156,6 @@ grok_method_quals (tree ctype, tree function, tree quals)
return this_quals;
}
-/* Warn when -fexternal-templates is used and #pragma
- interface/implementation is not used all the times it should be,
- inform the user. */
-
-void
-warn_if_unknown_interface (tree decl)
-{
- static int already_warned = 0;
- if (already_warned++)
- return;
-
- if (flag_alt_external_templates)
- {
- tree til = tinst_for_decl ();
- location_t saved_loc = input_location;
-
- if (til)
- {
- input_line = TINST_LINE (til);
- input_filename = TINST_FILE (til);
- }
- warning ("template `%#D' instantiated in file without #pragma interface",
- decl);
- input_location = saved_loc;
- }
- else
- cp_warning_at ("template `%#D' defined in file without #pragma interface",
- decl);
-}
-
/* A subroutine of the parser, to handle a component list. */
void
@@ -622,12 +592,20 @@ check_java_method (tree method)
bool jerr = false;
tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (method));
tree ret_type = TREE_TYPE (TREE_TYPE (method));
+
if (!acceptable_java_type (ret_type))
{
error ("Java method '%D' has non-Java return type `%T'",
method, ret_type);
jerr = true;
}
+
+ arg_types = TREE_CHAIN (arg_types);
+ if (DECL_HAS_IN_CHARGE_PARM_P (method))
+ arg_types = TREE_CHAIN (arg_types);
+ if (DECL_HAS_VTT_PARM_P (method))
+ arg_types = TREE_CHAIN (arg_types);
+
for (; arg_types != NULL_TREE; arg_types = TREE_CHAIN (arg_types))
{
tree type = TREE_VALUE (arg_types);
@@ -643,10 +621,12 @@ check_java_method (tree method)
/* Sanity check: report error if this function FUNCTION is not
really a member of the class (CTYPE) it is supposed to belong to.
- CNAME is the same here as it is for grokclassfn above. */
+ CNAME is the same here as it is for grokclassfn above.
+ TEMPLATE_HEADER_P is true when this declaration comes with a
+ template header. */
tree
-check_classfn (tree ctype, tree function)
+check_classfn (tree ctype, tree function, bool template_header_p)
{
int ix;
int is_template;
@@ -669,7 +649,7 @@ check_classfn (tree ctype, tree function)
/* OK, is this a definition of a member template? */
is_template = (TREE_CODE (function) == TEMPLATE_DECL
- || (processing_template_decl - template_class_depth (ctype)));
+ || template_header_p);
ix = lookup_fnfields_1 (complete_type (ctype),
DECL_CONSTRUCTOR_P (function) ? ctor_identifier :
@@ -872,10 +852,8 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
init = NULL_TREE;
value = grokdeclarator (declarator, declspecs, FIELD, init != 0, &attrlist);
- if (! value || value == error_mark_node)
+ if (! value || error_operand_p (value))
/* friend or constructor went bad. */
- return value;
- if (TREE_TYPE (value) == error_mark_node)
return error_mark_node;
if (TREE_CODE (value) == TYPE_DECL && init)
@@ -971,7 +949,11 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
if (processing_template_decl
&& (TREE_CODE (value) == VAR_DECL || TREE_CODE (value) == FUNCTION_DECL))
- value = push_template_decl (value);
+ {
+ value = push_template_decl (value);
+ if (error_operand_p (value))
+ return error_mark_node;
+ }
if (attrlist)
cplus_decl_attributes (&value, attrlist, 0);
@@ -1000,7 +982,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
/* This must override the asm specifier which was placed
by grokclassfn. Lay this out fresh. */
SET_DECL_RTL (value, NULL_RTX);
- SET_DECL_ASSEMBLER_NAME (value, get_identifier (asmspec));
+ change_decl_assembler_name (value, get_identifier (asmspec));
}
if (!DECL_FRIEND_P (value))
grok_special_member_properties (value);
@@ -1025,8 +1007,7 @@ grokfield (tree declarator, tree declspecs, tree init, tree asmspec_tree,
tree
grokbitfield (tree declarator, tree declspecs, tree width)
{
- register tree value = grokdeclarator (declarator, declspecs, BITFIELD,
- 0, NULL);
+ tree value = grokdeclarator (declarator, declspecs, BITFIELD, 0, NULL);
if (! value) return NULL_TREE; /* friends went bad. */
@@ -1295,12 +1276,12 @@ coerce_new_type (tree type)
{
case 2:
args = tree_cons (NULL_TREE, size_type_node, args);
- /* FALLTHROUGH */
+ /* Fall through. */
case 1:
type = build_exception_variant
(build_function_type (ptr_type_node, args),
TYPE_RAISES_EXCEPTIONS (type));
- /* FALLTHROUGH */
+ /* Fall through. */
default:;
}
return type;
@@ -1329,12 +1310,12 @@ coerce_delete_type (tree type)
{
case 2:
args = tree_cons (NULL_TREE, ptr_type_node, args);
- /* FALLTHROUGH */
+ /* Fall through. */
case 1:
type = build_exception_variant
(build_function_type (void_type_node, args),
TYPE_RAISES_EXCEPTIONS (type));
- /* FALLTHROUGH */
+ /* Fall through. */
default:;
}
diff --git a/gcc/cp/dump.c b/gcc/cp/dump.c
index b48f25b7752..17b30c94367 100644
--- a/gcc/cp/dump.c
+++ b/gcc/cp/dump.c
@@ -230,11 +230,6 @@ cp_dump_tree (void* dump_info, tree t)
dump_child ("tynm", TREE_TYPE (t));
return true;
}
- else if (t == anonymous_namespace_name)
- {
- dump_string (di, "unnamed");
- return true;
- }
break;
case OFFSET_TYPE:
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index 1c44324c640..bb6ff341572 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -331,7 +331,7 @@ dump_type (tree t, int flags)
? DECL_ORIGINAL_TYPE (t) : TREE_TYPE (t), flags);
break;
}
- /* else fallthrough */
+ /* Else fall through. */
case TEMPLATE_DECL:
case NAMESPACE_DECL:
@@ -644,7 +644,7 @@ dump_type_suffix (tree t, int flags)
dump_type_suffix (TREE_TYPE (t), flags);
break;
- /* Can only be reached through function pointer */
+ /* Can only be reached through function pointer. */
case FUNCTION_TYPE:
case METHOD_TYPE:
{
@@ -788,7 +788,7 @@ dump_decl (tree t, int flags)
dump_type (DECL_CONTEXT (t), flags);
break;
}
- /* else fall through */
+ /* Else fall through. */
case FIELD_DECL:
case PARM_DECL:
dump_simple_decl (t, TREE_TYPE (t), flags);
@@ -805,7 +805,7 @@ dump_decl (tree t, int flags)
else
{
dump_scope (CP_DECL_CONTEXT (t), flags);
- if (DECL_NAME (t) == anonymous_namespace_name)
+ if (DECL_NAME (t) == NULL_TREE)
pp_identifier (cxx_pp, "<unnamed>");
else
pp_tree_identifier (cxx_pp, DECL_NAME (t));
@@ -1050,7 +1050,7 @@ dump_function_decl (tree t, int flags)
if (DECL_CLASS_SCOPE_P (t))
cname = DECL_CONTEXT (t);
- /* this is for partially instantiated template methods */
+ /* This is for partially instantiated template methods. */
else if (TREE_CODE (fntype) == METHOD_TYPE)
cname = TREE_TYPE (TREE_VALUE (parmtypes));
@@ -1269,7 +1269,7 @@ dump_template_parms (tree info, int primary, int flags)
pp_template_argument_list_end (cxx_pp);
}
-/* Print out a list of initializers (subr of dump_expr) */
+/* Print out a list of initializers (subr of dump_expr). */
static void
dump_expr_list (tree l, int flags)
@@ -1596,7 +1596,7 @@ dump_expr (tree t, int flags)
pp_right_paren (cxx_pp);
break;
}
- /* else FALLTHRU */
+ /* Else fall through. */
}
dump_expr (TREE_OPERAND (t, 0), flags | TFF_EXPR_IN_PARENS);
break;
diff --git a/gcc/cp/except.c b/gcc/cp/except.c
index 1dc149a8685..03a3274e90a 100644
--- a/gcc/cp/except.c
+++ b/gcc/cp/except.c
@@ -296,7 +296,7 @@ choose_personality_routine (enum languages lang)
return;
case chose_none:
- ; /* proceed to language selection */
+ ; /* Proceed to language selection. */
}
switch (lang)
@@ -645,7 +645,12 @@ build_throw (tree exp)
tmp = build_function_type (ptr_type_node, tmp);
fn = push_throw_library_fn (fn, tmp);
}
-
+ else if (really_overloaded_fn (fn))
+ {
+ error ("`%D' should never be overloaded", fn);
+ return error_mark_node;
+ }
+ fn = OVL_CURRENT (fn);
exp = build_function_call (fn, tree_cons (NULL_TREE, exp, NULL_TREE));
}
else if (exp)
@@ -887,7 +892,7 @@ can_convert_eh (tree to, tree from)
if (TREE_CODE (to) == VOID_TYPE)
return 1;
- /* else fall through */
+ /* Else fall through. */
}
if (CLASS_TYPE_P (to) && CLASS_TYPE_P (from)
diff --git a/gcc/cp/expr.c b/gcc/cp/expr.c
index 630f0789073..06a2e0c2146 100644
--- a/gcc/cp/expr.c
+++ b/gcc/cp/expr.c
@@ -78,8 +78,8 @@ rtx
cxx_expand_expr (tree exp, rtx target, enum machine_mode tmode, int modifier)
{
tree type = TREE_TYPE (exp);
- register enum machine_mode mode = TYPE_MODE (type);
- register enum tree_code code = TREE_CODE (exp);
+ enum machine_mode mode = TYPE_MODE (type);
+ enum tree_code code = TREE_CODE (exp);
rtx ret;
/* No sense saving up arithmetic to be done
diff --git a/gcc/cp/friend.c b/gcc/cp/friend.c
index 1b3d4b46233..46616b13608 100644
--- a/gcc/cp/friend.c
+++ b/gcc/cp/friend.c
@@ -39,7 +39,7 @@ int
is_friend (tree type, tree supplicant)
{
int declp;
- register tree list;
+ tree list;
tree context;
if (supplicant == NULL_TREE || type == NULL_TREE)
@@ -60,25 +60,15 @@ is_friend (tree type, tree supplicant)
tree friends = FRIEND_DECLS (list);
for (; friends ; friends = TREE_CHAIN (friends))
{
- if (TREE_VALUE (friends) == NULL_TREE)
- continue;
+ tree friend = TREE_VALUE (friends);
- if (supplicant == TREE_VALUE (friends))
- return 1;
+ if (friend == NULL_TREE)
+ continue;
- /* Temporarily, we are more lenient to deal with
- nested friend functions, for which there can be
- more than one FUNCTION_DECL, despite being the
- same function. When that's fixed, this bit can
- go. */
- if (DECL_FUNCTION_MEMBER_P (supplicant)
- && same_type_p (TREE_TYPE (supplicant),
- TREE_TYPE (TREE_VALUE (friends))))
+ if (supplicant == friend)
return 1;
- if (TREE_CODE (TREE_VALUE (friends)) == TEMPLATE_DECL
- && is_specialization_of (supplicant,
- TREE_VALUE (friends)))
+ if (is_specialization_of_friend (supplicant, friend))
return 1;
}
break;
@@ -158,12 +148,8 @@ add_friend (tree type, tree decl, bool complain)
if (decl == TREE_VALUE (friends))
{
if (complain)
- {
- warning ("`%D' is already a friend of class `%T'",
- decl, type);
- cp_warning_at ("previous friend declaration of `%D'",
- TREE_VALUE (friends));
- }
+ warning ("`%D' is already a friend of class `%T'",
+ decl, type);
return;
}
}
@@ -342,8 +328,6 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
tree attrlist, enum overload_flags flags, tree quals,
int funcdef_flag)
{
- int is_friend_template = 0;
-
/* Every decl that gets here is a friend of something. */
DECL_FRIEND_P (decl) = 1;
@@ -357,39 +341,70 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
if (TREE_CODE (decl) != FUNCTION_DECL)
abort ();
- is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P ();
-
if (ctype)
{
+ /* CLASS_TEMPLATE_DEPTH counts the number of template headers for
+ the enclosing class. FRIEND_DEPTH counts the number of template
+ headers used for this friend declaration. TEMPLATE_MEMBER_P is
+ true if a template header in FRIEND_DEPTH is intended for
+ DECLARATOR. For example, the code
+
+ template <class T> struct A {
+ template <class U> struct B {
+ template <class V> template <class W>
+ friend void C<V>::f(W);
+ };
+ };
+
+ will eventually give the following results
+
+ 1. CLASS_TEMPLATE_DEPTH equals 2 (for `T' and `U').
+ 2. FRIEND_DEPTH equals 2 (for `V' and `W').
+ 3. TEMPLATE_MEMBER_P is true (for `W'). */
+
+ int class_template_depth = template_class_depth (current_class_type);
+ int friend_depth = processing_template_decl - class_template_depth;
+ /* We will figure this out later. */
+ bool template_member_p = false;
+
tree cname = TYPE_NAME (ctype);
if (TREE_CODE (cname) == TYPE_DECL)
cname = DECL_NAME (cname);
/* A method friend. */
- if (flags == NO_SPECIAL && ctype && declarator == cname)
+ if (flags == NO_SPECIAL && declarator == cname)
DECL_CONSTRUCTOR_P (decl) = 1;
/* This will set up DECL_ARGUMENTS for us. */
grokclassfn (ctype, decl, flags, quals);
- if (is_friend_template)
- decl = DECL_TI_TEMPLATE (push_template_decl (decl));
- else if (DECL_TEMPLATE_INFO (decl))
- ;
- else if (template_class_depth (current_class_type))
- decl = push_template_decl_real (decl, /*is_friend=*/1);
-
- /* We can't do lookup in a type that involves template
- parameters. Instead, we rely on tsubst_friend_function
- to check the validity of the declaration later. */
- if (processing_template_decl)
- add_friend (current_class_type, decl, /*complain=*/true);
+ if (friend_depth)
+ {
+ if (!uses_template_parms_level (ctype, class_template_depth
+ + friend_depth))
+ template_member_p = true;
+ }
+
/* A nested class may declare a member of an enclosing class
to be a friend, so we do lookup here even if CTYPE is in
the process of being defined. */
- else if (COMPLETE_TYPE_P (ctype) || TYPE_BEING_DEFINED (ctype))
+ if (class_template_depth
+ || COMPLETE_TYPE_P (ctype)
+ || TYPE_BEING_DEFINED (ctype))
{
- decl = check_classfn (ctype, decl);
+ if (DECL_TEMPLATE_INFO (decl))
+ /* DECL is a template specialization. No need to
+ build a new TEMPLATE_DECL. */
+ ;
+ else if (class_template_depth)
+ /* We rely on tsubst_friend_function to check the
+ validity of the declaration later. */
+ decl = push_template_decl_real (decl, /*is_friend=*/1);
+ else
+ decl = check_classfn (ctype, decl, template_member_p);
+
+ if (template_member_p && decl && TREE_CODE (decl) == FUNCTION_DECL)
+ decl = DECL_TI_TEMPLATE (decl);
if (decl)
add_friend (current_class_type, decl, /*complain=*/true);
@@ -402,6 +417,8 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
@@ or possibly a friend from a base class ?!? */
else if (TREE_CODE (decl) == FUNCTION_DECL)
{
+ int is_friend_template = PROCESSING_REAL_TEMPLATE_DECL_P ();
+
/* Friends must all go through the overload machinery,
even though they may not technically be overloaded.
@@ -459,6 +476,9 @@ do_friend (tree ctype, tree declarator, tree decl, tree parmdecls,
}
}
+ if (decl == error_mark_node)
+ return error_mark_node;
+
add_friend (current_class_type,
is_friend_template ? DECL_TI_TEMPLATE (decl) : decl,
/*complain=*/true);
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 4951ff3211e..e6c9ee6892a 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -302,13 +302,6 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
{
arglist[j++] = saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX;
added_libraries++;
-#ifdef USE_LIBUNWIND_EXCEPTIONS
-# ifndef LIBUNWIND
-# define LIBUNWIND "-lunwind"
-# endif
- arglist[j++] = LIBUNWIND;
- added_libraries++;
-#endif
}
if (saw_math)
arglist[j++] = saw_math;
diff --git a/gcc/cp/init.c b/gcc/cp/init.c
index 735215377a3..f717fb23507 100644
--- a/gcc/cp/init.c
+++ b/gcc/cp/init.c
@@ -514,6 +514,7 @@ sort_mem_initializers (tree t, tree mem_inits)
cp_warning_at (" `%#D'", subobject);
else
warning (" base `%T'", subobject);
+ warning (" when initialized here");
}
/* Look again, from the beginning of the list. */
@@ -1121,7 +1122,7 @@ build_aggr_init (tree exp, tree init, int flags)
}
if (TREE_CODE (exp) == VAR_DECL || TREE_CODE (exp) == PARM_DECL)
- /* just know that we've seen something for this node */
+ /* Just know that we've seen something for this node. */
TREE_USED (exp) = 1;
TREE_TYPE (exp) = TYPE_MAIN_VARIANT (type);
@@ -1499,7 +1500,7 @@ build_offset_ref (tree type, tree name, bool address_p)
if (TREE_CODE (t) != TEMPLATE_ID_EXPR && !really_overloaded_fn (t))
{
- /* Get rid of a potential OVERLOAD around it */
+ /* Get rid of a potential OVERLOAD around it. */
t = OVL_CURRENT (t);
/* Unique functions are handled easily. */
@@ -1687,7 +1688,7 @@ build_new (tree placement, tree decl, tree init, int use_global_new)
if (absdcl && TREE_CODE (absdcl) == ARRAY_REF)
{
- /* probably meant to be a vec new */
+ /* Probably meant to be a vec new. */
tree this_nelts;
while (TREE_OPERAND (absdcl, 0)
@@ -1842,7 +1843,7 @@ build_java_class_ref (tree type)
jclass_node = TREE_TYPE (jclass_node);
}
- /* Mangle the class$ field */
+ /* Mangle the class$ field. */
{
tree field;
for (field = TYPE_FIELDS (type); field; field = TREE_CHAIN (field))
@@ -2005,11 +2006,18 @@ build_new_1 (tree exp)
tree class_size = size_in_bytes (true_type);
static const char alloc_name[] = "_Jv_AllocObject";
use_java_new = 1;
- alloc_decl = IDENTIFIER_GLOBAL_VALUE (get_identifier (alloc_name));
- if (alloc_decl == NULL_TREE)
- fatal_error ("call to Java constructor with `%s' undefined",
- alloc_name);
-
+ if (!get_global_value_if_present (get_identifier (alloc_name),
+ &alloc_decl))
+ {
+ error ("call to Java constructor with `%s' undefined", alloc_name);
+ return error_mark_node;
+ }
+ else if (really_overloaded_fn (alloc_decl))
+ {
+ error ("`%D' should never be overloaded", alloc_decl);
+ return error_mark_node;
+ }
+ alloc_decl = OVL_CURRENT (alloc_decl);
class_addr = build1 (ADDR_EXPR, jclass_node, class_decl);
alloc_call = (build_function_call
(alloc_decl,
@@ -2060,13 +2068,22 @@ build_new_1 (tree exp)
if (alloc_call == error_mark_node)
return error_mark_node;
- /* The ALLOC_CALL should be a CALL_EXPR -- or a COMPOUND_EXPR whose
- right-hand-side is ultimately a CALL_EXPR -- and the first
- operand should be the address of a known FUNCTION_DECL. */
- t = alloc_call;
- while (TREE_CODE (t) == COMPOUND_EXPR)
- t = TREE_OPERAND (t, 1);
- alloc_fn = get_callee_fndecl (t);
+ /* In the simple case, we can stop now. */
+ pointer_type = build_pointer_type (type);
+ if (!cookie_size && !is_initialized)
+ return build_nop (pointer_type, alloc_call);
+
+ /* While we're working, use a pointer to the type we've actually
+ allocated. Store the result of the call in a variable so that we
+ can use it more than once. */
+ full_pointer_type = build_pointer_type (full_type);
+ alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call));
+ alloc_node = TARGET_EXPR_SLOT (alloc_expr);
+
+ /* Strip any COMPOUND_EXPRs from ALLOC_CALL. */
+ while (TREE_CODE (alloc_call) == COMPOUND_EXPR)
+ alloc_call = TREE_OPERAND (alloc_call, 1);
+ alloc_fn = get_callee_fndecl (alloc_call);
my_friendly_assert (alloc_fn != NULL_TREE, 20020325);
/* Now, check to see if this function is actually a placement
@@ -2083,6 +2100,27 @@ build_new_1 (tree exp)
= (type_num_arguments (TREE_TYPE (alloc_fn)) > 1
|| varargs_function_p (alloc_fn));
+ /* Preevaluate the placement args so that we don't reevaluate them for a
+ placement delete. */
+ if (placement_allocation_fn_p)
+ {
+ tree inits = NULL_TREE;
+ t = TREE_CHAIN (TREE_OPERAND (alloc_call, 1));
+ for (; t; t = TREE_CHAIN (t))
+ if (TREE_SIDE_EFFECTS (TREE_VALUE (t)))
+ {
+ tree init;
+ TREE_VALUE (t) = stabilize_expr (TREE_VALUE (t), &init);
+ if (inits)
+ inits = build (COMPOUND_EXPR, void_type_node, inits, init);
+ else
+ inits = init;
+ }
+ if (inits)
+ alloc_expr = build (COMPOUND_EXPR, TREE_TYPE (alloc_expr), inits,
+ alloc_expr);
+ }
+
/* unless an allocation function is declared with an empty excep-
tion-specification (_except.spec_), throw(), it indicates failure to
allocate storage by throwing a bad_alloc exception (clause _except_,
@@ -2096,18 +2134,6 @@ build_new_1 (tree exp)
nothrow = TYPE_NOTHROW_P (TREE_TYPE (alloc_fn));
check_new = (flag_check_new || nothrow) && ! use_java_new;
- /* In the simple case, we can stop now. */
- pointer_type = build_pointer_type (type);
- if (!cookie_size && !is_initialized)
- return build_nop (pointer_type, alloc_call);
-
- /* While we're working, use a pointer to the type we've actually
- allocated. Store the result of the call in a variable so that we
- can use it more than once. */
- full_pointer_type = build_pointer_type (full_type);
- alloc_expr = get_target_expr (build_nop (full_pointer_type, alloc_call));
- alloc_node = TARGET_EXPR_SLOT (alloc_expr);
-
if (cookie_size)
{
tree cookie;
@@ -2578,11 +2604,13 @@ build_vec_init (tree base, tree maxindex, tree init, int from_array)
num_initialized_elts++;
+ current_stmt_tree ()->stmts_are_full_exprs_p = 1;
if (IS_AGGR_TYPE (type) || TREE_CODE (type) == ARRAY_TYPE)
finish_expr_stmt (build_aggr_init (baseref, elt, 0));
else
finish_expr_stmt (build_modify_expr (baseref, NOP_EXPR,
elt));
+ current_stmt_tree ()->stmts_are_full_exprs_p = 0;
finish_expr_stmt (build_unary_op (PREINCREMENT_EXPR, base, 0));
finish_expr_stmt (build_unary_op (PREDECREMENT_EXPR, iterator, 0));
@@ -2828,7 +2856,7 @@ build_delete (tree type, tree addr, special_function_kind auto_delete,
if (TREE_SIDE_EFFECTS (addr))
addr = save_expr (addr);
- /* throw away const and volatile on target type of addr */
+ /* Throw away const and volatile on target type of addr. */
addr = convert_force (build_pointer_type (type), addr, 0);
}
else if (TREE_CODE (type) == ARRAY_TYPE)
@@ -3088,7 +3116,8 @@ build_vec_delete (tree base, tree maxindex,
}
else if (TREE_CODE (type) == ARRAY_TYPE)
{
- /* get the total number of things in the array, maxindex is a bad name */
+ /* Get the total number of things in the array, maxindex is a
+ bad name. */
maxindex = array_type_nelts_total (type);
type = strip_array_types (type);
base = build_unary_op (ADDR_EXPR, base, 1);
diff --git a/gcc/cp/lex.c b/gcc/cp/lex.c
index 6d5482330b2..d22f5b063c1 100644
--- a/gcc/cp/lex.c
+++ b/gcc/cp/lex.c
@@ -231,7 +231,7 @@ init_operators (void)
struct resword
{
const char *const word;
- const ENUM_BITFIELD(rid) rid : 16;
+ ENUM_BITFIELD(rid) const rid : 16;
const unsigned int disable : 16;
};
@@ -266,6 +266,8 @@ static const struct resword reswords[] =
{ "__inline__", RID_INLINE, 0 },
{ "__label__", RID_LABEL, 0 },
{ "__null", RID_NULL, 0 },
+ { "__offsetof", RID_OFFSETOF, 0 },
+ { "__offsetof__", RID_OFFSETOF, 0 },
{ "__real", RID_REALPART, 0 },
{ "__real__", RID_REALPART, 0 },
{ "__restrict", RID_RESTRICT, 0 },
@@ -403,21 +405,7 @@ cxx_init (void)
current_function_decl = NULL;
- class_type_node = build_int_2 (class_type, 0);
- TREE_TYPE (class_type_node) = class_type_node;
- ridpointers[(int) RID_CLASS] = class_type_node;
-
- record_type_node = build_int_2 (record_type, 0);
- TREE_TYPE (record_type_node) = record_type_node;
- ridpointers[(int) RID_STRUCT] = record_type_node;
-
- union_type_node = build_int_2 (union_type, 0);
- TREE_TYPE (union_type_node) = union_type_node;
- ridpointers[(int) RID_UNION] = union_type_node;
-
- enum_type_node = build_int_2 (enum_type, 0);
- TREE_TYPE (enum_type_node) = enum_type_node;
- ridpointers[(int) RID_ENUM] = enum_type_node;
+ class_type_node = ridpointers[(int) RID_CLASS];
cxx_init_decl_processing ();
@@ -448,18 +436,9 @@ cxx_init (void)
void
extract_interface_info (void)
{
- struct c_fileinfo *finfo = 0;
-
- if (flag_alt_external_templates)
- {
- tree til = tinst_for_decl ();
-
- if (til)
- finfo = get_fileinfo (TINST_FILE (til));
- }
- if (!finfo)
- finfo = get_fileinfo (input_filename);
+ struct c_fileinfo *finfo;
+ finfo = get_fileinfo (input_filename);
interface_only = finfo->interface_only;
interface_unknown = finfo->interface_unknown;
}
@@ -836,7 +815,7 @@ copy_type (tree type)
tree
cxx_make_type (enum tree_code code)
{
- register tree t = make_node (code);
+ tree t = make_node (code);
/* Create lang_type structure. */
if (IS_AGGR_TYPE_CODE (code)
diff --git a/gcc/cp/mangle.c b/gcc/cp/mangle.c
index 15334f321e3..b34c309c827 100644
--- a/gcc/cp/mangle.c
+++ b/gcc/cp/mangle.c
@@ -158,7 +158,7 @@ static void mangle_call_offset (const tree, const tree);
/* Functions for emitting mangled representations of things. */
-static void write_mangled_name (const tree);
+static void write_mangled_name (const tree, bool);
static void write_encoding (const tree);
static void write_name (tree, const int);
static void write_unscoped_name (const tree);
@@ -602,27 +602,66 @@ find_substitution (tree node)
}
-/* <mangled-name> ::= _Z <encoding> */
+/* TOP_LEVEL is true, if this is being called at outermost level of
+ mangling. It should be false when mangling a decl appearing in an
+ expression within some other mangling.
+
+ <mangled-name> ::= _Z <encoding> */
static inline void
-write_mangled_name (const tree decl)
+write_mangled_name (const tree decl, bool top_level)
{
MANGLE_TRACE_TREE ("mangled-name", decl);
- if (DECL_LANG_SPECIFIC (decl)
- && DECL_EXTERN_C_FUNCTION_P (decl)
- && ! DECL_OVERLOADED_OPERATOR_P (decl))
- /* The standard notes:
- "The <encoding> of an extern "C" function is treated like
- global-scope data, i.e. as its <source-name> without a type."
- We cannot write overloaded operators that way though,
- because it contains characters invalid in assembler. */
- write_source_name (DECL_NAME (decl));
+ 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))
+ {
+ unmangled_name:;
+
+ if (top_level)
+ write_string (IDENTIFIER_POINTER (DECL_NAME (decl)));
+ else
+ {
+ /* The standard notes: "The <encoding> of an extern "C"
+ function is treated like global-scope data, i.e. as its
+ <source-name> without a type." We cannot write
+ overloaded operators that way though, because it contains
+ characters invalid in assembler. */
+ if (abi_version_at_least (2))
+ write_string ("_Z");
+ else
+ G.need_abi_warning = true;
+ write_source_name (DECL_NAME (decl));
+ }
+ }
+ else if (TREE_CODE (decl) == VAR_DECL
+ /* The names of global variables aren't mangled. */
+ && (CP_DECL_CONTEXT (decl) == global_namespace
+ /* And neither are `extern "C"' variables. */
+ || DECL_EXTERN_C_P (decl)))
+ {
+ if (top_level || abi_version_at_least (2))
+ goto unmangled_name;
+ else
+ {
+ G.need_abi_warning = true;
+ goto mangled_name;
+ }
+ }
else
- /* C++ name; needs to be mangled. */
{
+ mangled_name:;
write_string ("_Z");
write_encoding (decl);
+ if (DECL_LANG_SPECIFIC (decl)
+ && (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
+ || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl)))
+ /* We need a distinct mangled name for these entities, but
+ we should never actually output it. So, we append some
+ characters the assembler won't like. */
+ write_string (" *INTERNAL* ");
}
}
@@ -991,6 +1030,8 @@ write_unqualified_name (const tree decl)
write_special_name_constructor (decl);
else if (DECL_LANG_SPECIFIC (decl) != NULL && DECL_DESTRUCTOR_P (decl))
write_special_name_destructor (decl);
+ else if (DECL_NAME (decl) == NULL_TREE)
+ write_source_name (DECL_ASSEMBLER_NAME (decl));
else if (DECL_CONV_FN_P (decl))
{
/* Conversion operator. Handle it right here.
@@ -1804,37 +1845,25 @@ write_class_enum_type (const tree type)
static void
write_template_args (tree args)
{
+ int i;
+ int length = TREE_VEC_LENGTH (args);
+
MANGLE_TRACE_TREE ("template-args", args);
write_char ('I');
- if (TREE_CODE (args) == TREE_VEC)
- {
- int i;
- int length = TREE_VEC_LENGTH (args);
- my_friendly_assert (length > 0, 20000422);
+ my_friendly_assert (length > 0, 20000422);
- if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
- {
- /* We have nested template args. We want the innermost template
- argument list. */
- args = TREE_VEC_ELT (args, length - 1);
- length = TREE_VEC_LENGTH (args);
- }
- for (i = 0; i < length; ++i)
- write_template_arg (TREE_VEC_ELT (args, i));
- }
- else
+ if (TREE_CODE (TREE_VEC_ELT (args, 0)) == TREE_VEC)
{
- my_friendly_assert (TREE_CODE (args) == TREE_LIST, 20021014);
-
- while (args)
- {
- write_template_arg (TREE_VALUE (args));
- args = TREE_CHAIN (args);
- }
+ /* We have nested template args. We want the innermost template
+ argument list. */
+ args = TREE_VEC_ELT (args, length - 1);
+ length = TREE_VEC_LENGTH (args);
}
-
+ for (i = 0; i < length; ++i)
+ write_template_arg (TREE_VEC_ELT (args, i));
+
write_char ('E');
}
@@ -1893,7 +1922,7 @@ write_expression (tree expr)
if (code == CONST_DECL)
G.need_abi_warning = 1;
write_char ('L');
- write_mangled_name (expr);
+ write_mangled_name (expr, false);
write_char ('E');
}
else if (TREE_CODE (expr) == SIZEOF_EXPR
@@ -2112,7 +2141,7 @@ write_template_arg (tree node)
MANGLE_TRACE_TREE ("template-arg", node);
- /* A template template paramter's argument list contains TREE_LIST
+ /* A template template parameter's argument list contains TREE_LIST
nodes of which the value field is the the actual argument. */
if (code == TREE_LIST)
{
@@ -2124,6 +2153,20 @@ write_template_arg (tree node)
code = TREE_CODE (node);
}
}
+
+ if (TREE_CODE (node) == NOP_EXPR
+ && TREE_CODE (TREE_TYPE (node)) == REFERENCE_TYPE)
+ {
+ /* Template parameters can be of reference type. To maintain
+ internal consistency, such arguments use a conversion from
+ address of object to reference type. */
+ my_friendly_assert (TREE_CODE (TREE_OPERAND (node, 0)) == ADDR_EXPR,
+ 20031215);
+ if (abi_version_at_least (2))
+ node = TREE_OPERAND (TREE_OPERAND (node, 0), 0);
+ else
+ G.need_abi_warning = 1;
+ }
if (TYPE_P (node))
write_type (node);
@@ -2199,7 +2242,20 @@ write_array_type (const tree type)
write_unsigned_number (tree_low_cst (max, 1));
}
else
- write_expression (TREE_OPERAND (max, 0));
+ {
+ max = TREE_OPERAND (max, 0);
+ if (!abi_version_at_least (2))
+ {
+ /* value_dependent_expression_p presumes nothing is
+ dependent when PROCESSING_TEMPLATE_DECL is zero. */
+ ++processing_template_decl;
+ if (!value_dependent_expression_p (max))
+ G.need_abi_warning = 1;
+ --processing_template_decl;
+ }
+ write_expression (max);
+ }
+
}
write_char ('_');
write_type (TREE_TYPE (type));
@@ -2363,29 +2419,9 @@ mangle_decl_string (const tree 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);
- if (DECL_LANG_SPECIFIC (decl)
- && (DECL_MAYBE_IN_CHARGE_DESTRUCTOR_P (decl)
- || DECL_MAYBE_IN_CHARGE_CONSTRUCTOR_P (decl)))
- /* We need a distinct mangled name for these entities, but
- we should never actually output it. So, we append some
- characters the assembler won't like. */
- write_string (" *INTERNAL* ");
- }
-
+ write_mangled_name (decl, true);
+
result = finish_mangling (/*warn=*/true);
if (DEBUG_MANGLE)
fprintf (stderr, "mangle_decl_string = '%s'\n\n", result);
@@ -2600,8 +2636,8 @@ mangle_thunk (tree fn_decl, const int this_adjusting, tree fixed_offset,
}
/* This hash table maps TYPEs to the IDENTIFIER for a conversion
- operator to TYPE. The nodes are TREE_LISTs whose TREE_PURPOSE is
- the TYPE and whose TREE_VALUE is the IDENTIFIER. */
+ operator to TYPE. The nodes are IDENTIFIERs whose TREE_TYPE is the
+ TYPE. */
static GTY ((param_is (union tree_node))) htab_t conv_type_names;
@@ -2610,7 +2646,7 @@ static GTY ((param_is (union tree_node))) htab_t conv_type_names;
static hashval_t
hash_type (const void *val)
{
- return htab_hash_pointer (TREE_PURPOSE ((tree) val));
+ return (hashval_t) TYPE_UID (TREE_TYPE ((tree) val));
}
/* Compare VAL1 (a node in the table) with VAL2 (a TYPE). */
@@ -2618,7 +2654,7 @@ hash_type (const void *val)
static int
compare_type (const void *val1, const void *val2)
{
- return TREE_PURPOSE ((tree) val1) == (tree) val2;
+ return TREE_TYPE ((tree) val1) == (tree) val2;
}
/* Return an identifier for the mangled unqualified name for a
@@ -2630,29 +2666,32 @@ mangle_conv_op_name_for_type (const tree type)
{
void **slot;
tree identifier;
- char buffer[64];
if (conv_type_names == NULL)
conv_type_names = htab_create_ggc (31, &hash_type, &compare_type, NULL);
slot = htab_find_slot_with_hash (conv_type_names, type,
- htab_hash_pointer (type), INSERT);
- if (*slot)
- return TREE_VALUE ((tree) *slot);
-
- /* Create a unique name corresponding to TYPE. */
- sprintf (buffer, "operator %lu",
- (unsigned long) htab_elements (conv_type_names));
- identifier = get_identifier (buffer);
- *slot = build_tree_list (type, identifier);
+ (hashval_t) TYPE_UID (type), INSERT);
+ identifier = (tree)*slot;
+ if (!identifier)
+ {
+ char buffer[64];
+
+ /* Create a unique name corresponding to TYPE. */
+ sprintf (buffer, "operator %lu",
+ (unsigned long) htab_elements (conv_type_names));
+ identifier = get_identifier (buffer);
+ *slot = identifier;
+
+ /* Hang TYPE off the identifier so it can be found easily later
+ when performing conversions. */
+ TREE_TYPE (identifier) = type;
+
+ /* Set bits on the identifier so we know later it's a conversion. */
+ IDENTIFIER_OPNAME_P (identifier) = 1;
+ IDENTIFIER_TYPENAME_P (identifier) = 1;
+ }
- /* Set bits on the identifier so we know later it's a conversion. */
- IDENTIFIER_OPNAME_P (identifier) = 1;
- IDENTIFIER_TYPENAME_P (identifier) = 1;
- /* Hang TYPE off the identifier so it can be found easily later when
- performing conversions. */
- TREE_TYPE (identifier) = type;
-
return identifier;
}
diff --git a/gcc/cp/method.c b/gcc/cp/method.c
index c6651e84880..f06896b0451 100644
--- a/gcc/cp/method.c
+++ b/gcc/cp/method.c
@@ -125,19 +125,24 @@ make_thunk (tree function, bool this_adjusting,
will be a BINFO. */
for (thunk = DECL_THUNKS (function); thunk; thunk = TREE_CHAIN (thunk))
if (DECL_THIS_THUNK_P (thunk) == this_adjusting
- && THUNK_FIXED_OFFSET (thunk) == d
- && (this_adjusting
- ? (!THUNK_VIRTUAL_OFFSET (thunk) == !virtual_offset
- && (!virtual_offset
- || tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk),
- virtual_offset)))
- : THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset))
+ && THUNK_FIXED_OFFSET (thunk) == d
+ && !virtual_offset == !THUNK_VIRTUAL_OFFSET (thunk)
+ && (!virtual_offset
+ || (this_adjusting
+ ? tree_int_cst_equal (THUNK_VIRTUAL_OFFSET (thunk),
+ virtual_offset)
+ : THUNK_VIRTUAL_OFFSET (thunk) == virtual_offset)))
return thunk;
/* All thunks must be created before FUNCTION is actually emitted;
the ABI requires that all thunks be emitted together with the
function to which they transfer control. */
my_friendly_assert (!TREE_ASM_WRITTEN (function), 20021025);
+ /* Likewise, we can only be adding thunks to a function declared in
+ the class currently being laid out. */
+ my_friendly_assert (TYPE_SIZE (DECL_CONTEXT (function))
+ && TYPE_BEING_DEFINED (DECL_CONTEXT (function)),
+ 20031211);
thunk = build_decl (FUNCTION_DECL, NULL_TREE, TREE_TYPE (function));
DECL_LANG_SPECIFIC (thunk) = DECL_LANG_SPECIFIC (function);
@@ -154,6 +159,7 @@ make_thunk (tree function, bool this_adjusting,
THUNK_TARGET (thunk) = function;
THUNK_FIXED_OFFSET (thunk) = d;
THUNK_VIRTUAL_OFFSET (thunk) = virtual_offset;
+ THUNK_ALIAS (thunk) = NULL_TREE;
/* The thunk itself is not a constructor or destructor, even if
the thing it is thunking to is. */
@@ -213,7 +219,7 @@ finish_thunk (tree thunk)
if (DECL_NAME (cov_probe) == name)
{
my_friendly_assert (!DECL_THUNKS (thunk), 20031023);
- THUNK_ALIAS (thunk) = (THUNK_ALIAS_P (cov_probe)
+ THUNK_ALIAS (thunk) = (THUNK_ALIAS (cov_probe)
? THUNK_ALIAS (cov_probe) : cov_probe);
break;
}
@@ -335,7 +341,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* We should never be using an alias, always refer to the
aliased thunk. */
- my_friendly_assert (!THUNK_ALIAS_P (thunk_fndecl), 20031023);
+ my_friendly_assert (!THUNK_ALIAS (thunk_fndecl), 20031023);
if (TREE_ASM_WRITTEN (thunk_fndecl))
return;
@@ -383,6 +389,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
/* The linkage of the function may have changed. FIXME in linkage
rewrite. */
TREE_PUBLIC (thunk_fndecl) = TREE_PUBLIC (function);
+ DECL_VISIBILITY (thunk_fndecl) = DECL_VISIBILITY (function);
if (flag_syntax_only)
{
@@ -480,6 +487,7 @@ use_thunk (tree thunk_fndecl, bool emit_p)
t = tree_cons (NULL_TREE, a, t);
t = nreverse (t);
t = build_call (alias, t);
+ CALL_FROM_THUNK_P (t) = 1;
if (!this_adjusting)
t = thunk_adjust (t, /*this_adjusting=*/0,
fixed_offset, virtual_offset);
diff --git a/gcc/cp/name-lookup.c b/gcc/cp/name-lookup.c
index add0d55d405..0be758f450d 100644
--- a/gcc/cp/name-lookup.c
+++ b/gcc/cp/name-lookup.c
@@ -48,6 +48,10 @@ static tree push_using_directive (tree);
tree global_namespace;
+/* The name of the anonymous namespace, throughout this translation
+ unit. */
+GTY(()) tree anonymous_namespace_name;
+
/* Compute the chain index of a binding_entry given the HASH value of its
name and the total COUNT of chains. COUNT is assumed to be a power
@@ -435,10 +439,13 @@ supplement_binding (cxx_binding *binding, tree decl)
if (TREE_CODE (decl) == TYPE_DECL && DECL_ARTIFICIAL (decl))
/* The new name is the type name. */
binding->type = decl;
- else if (!bval)
- /* This situation arises when push_class_level_binding moves an
- inherited type-binding out of the way to make room for a new
- value binding. */
+ else if (!bval || bval == error_mark_node)
+ /* VALUE is null when push_class_level_binding moves an inherited
+ type-binding out of the way to make room for a new value binding.
+ It is an error_mark_node when DECL's name has been used in a
+ non-class scope prior declaration. In that case, we should have
+ already issued a diagnostic; for graceful error recovery purpose,
+ pretend this was the intended declaration for that name. */
binding->value = decl;
else if (TREE_CODE (bval) == TYPE_DECL && DECL_ARTIFICIAL (bval))
{
@@ -518,7 +525,7 @@ add_decl_to_level (tree decl, cxx_scope *b)
b->names = decl;
b->names_size++;
- /* If appropriate, add decl to separate list of statics */
+ /* If appropriate, add decl to separate list of statics. */
if (b->kind == sk_namespace)
if ((TREE_CODE (decl) == VAR_DECL && TREE_STATIC (decl))
|| (TREE_CODE (decl) == FUNCTION_DECL
@@ -538,8 +545,8 @@ add_decl_to_level (tree decl, cxx_scope *b)
tree
pushdecl (tree x)
{
- register tree t;
- register tree name;
+ tree t;
+ tree name;
int need_new_binding;
timevar_push (TV_NAME_LOOKUP);
@@ -555,7 +562,7 @@ pushdecl (tree x)
if (current_function_decl && x != current_function_decl
/* A local declaration for a function doesn't constitute
nesting. */
- && !(TREE_CODE (x) == FUNCTION_DECL && !DECL_INITIAL (x))
+ && TREE_CODE (x) != FUNCTION_DECL
/* A local declaration for an `extern' variable is in the
scope of the current namespace, not the current
function. */
@@ -583,8 +590,7 @@ pushdecl (tree x)
/* In case this decl was explicitly namespace-qualified, look it
up in its namespace context. */
- if (TREE_CODE (x) == VAR_DECL && DECL_NAMESPACE_SCOPE_P (x)
- && namespace_bindings_p ())
+ if (DECL_NAMESPACE_SCOPE_P (x) && namespace_bindings_p ())
t = namespace_binding (name, DECL_CONTEXT (x));
else
t = lookup_name_current_level (name);
@@ -677,33 +683,38 @@ pushdecl (tree x)
/* Throw away the redeclaration. */
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
}
- else if (TREE_CODE (t) != TREE_CODE (x))
- {
- if (duplicate_decls (x, t))
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
- }
- else if (duplicate_decls (x, t))
- {
- if (TREE_CODE (t) == TYPE_DECL)
- SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t));
- else if (TREE_CODE (t) == FUNCTION_DECL)
- check_default_args (t);
-
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
- }
- else if (DECL_MAIN_P (x))
+ else
{
- /* A redeclaration of main, but not a duplicate of the
- previous one.
-
- [basic.start.main]
+ tree olddecl = duplicate_decls (x, t);
+
+ /* If the redeclaration failed, we can stop at this
+ point. */
+ if (olddecl == error_mark_node)
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, error_mark_node);
+
+ if (olddecl)
+ {
+ if (TREE_CODE (t) == TYPE_DECL)
+ SET_IDENTIFIER_TYPE_VALUE (name, TREE_TYPE (t));
+ else if (TREE_CODE (t) == FUNCTION_DECL)
+ check_default_args (t);
- This function shall not be overloaded. */
- cp_error_at ("invalid redeclaration of `%D'", t);
- error ("as `%D'", x);
- /* We don't try to push this declaration since that
- causes a crash. */
- POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x);
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, t);
+ }
+ else if (DECL_MAIN_P (x))
+ {
+ /* A redeclaration of main, but not a duplicate of the
+ previous one.
+
+ [basic.start.main]
+
+ This function shall not be overloaded. */
+ cp_error_at ("invalid redeclaration of `%D'", t);
+ error ("as `%D'", x);
+ /* We don't try to push this declaration since that
+ causes a crash. */
+ POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, x);
+ }
}
}
@@ -1257,7 +1268,7 @@ begin_scope (scope_kind kind, tree entity)
case sk_template_spec:
scope->explicit_spec_p = true;
kind = sk_template_parms;
- /* fall through */
+ /* Fall through. */
case sk_template_parms:
case sk_block:
case sk_try:
@@ -1799,7 +1810,7 @@ make_anon_name (void)
void
clear_anon_tags (void)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
static int last_cnt = 0;
/* Fast out if no new anon names were declared. */
@@ -1897,7 +1908,7 @@ push_using_decl (tree scope, tree name)
tree
pushdecl_with_scope (tree x, cxx_scope *level)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
tree function_decl = current_function_decl;
timevar_push (TV_NAME_LOOKUP);
@@ -1979,7 +1990,7 @@ push_overloaded_decl (tree decl, int flags)
error ("`%#D' conflicts with previous using declaration `%#D'",
decl, fn);
- if (duplicate_decls (decl, fn))
+ if (duplicate_decls (decl, fn) == fn)
POP_TIMEVAR_AND_RETURN (TV_NAME_LOOKUP, fn);
}
}
@@ -1994,7 +2005,11 @@ push_overloaded_decl (tree decl, int flags)
}
}
- if (old || TREE_CODE (decl) == TEMPLATE_DECL)
+ if (old || TREE_CODE (decl) == TEMPLATE_DECL
+ /* If it's a using declaration, we always need to build an OVERLOAD,
+ because it's the only way to remember that the declaration comes
+ from 'using', and have the lookup behave correctly. */
+ || (flags & PUSH_USING))
{
if (old && TREE_CODE (old) != OVERLOAD)
new_binding = ovl_cons (decl, ovl_cons (old, NULL_TREE));
@@ -2319,7 +2334,7 @@ tree
lookup_tag (enum tree_code form, tree name,
cxx_scope *binding_level, int thislevel_only)
{
- register struct cp_binding_level *level;
+ struct cp_binding_level *level;
/* Nonzero if, we should look past a template parameter level, even
if THISLEVEL_ONLY. */
int allow_template_parms_p = 1;
@@ -2328,7 +2343,7 @@ lookup_tag (enum tree_code form, tree name,
timevar_push (TV_NAME_LOOKUP);
for (level = binding_level; level; level = level->level_chain)
{
- register tree tail;
+ tree tail;
if (type_is_anonymous && level->type_decls != NULL)
{
tree type = binding_table_find_anon_type (level->type_decls, name);
@@ -2431,7 +2446,7 @@ lookup_tag (enum tree_code form, tree name,
tree
lookup_tag_reverse (tree type, tree name)
{
- register struct cp_binding_level *level;
+ struct cp_binding_level *level;
timevar_push (TV_NAME_LOOKUP);
for (level = current_binding_level; level; level = level->level_chain)
@@ -2515,7 +2530,7 @@ pushlevel_class (void)
void
poplevel_class (void)
{
- register struct cp_binding_level *level = class_binding_level;
+ struct cp_binding_level *level = class_binding_level;
tree shadowed;
timevar_push (TV_NAME_LOOKUP);
@@ -2975,6 +2990,7 @@ push_namespace (tree name)
tree d = NULL_TREE;
int need_new = 1;
int implicit_use = 0;
+ bool anon = !name;
timevar_push (TV_NAME_LOOKUP);
@@ -2984,7 +3000,7 @@ push_namespace (tree name)
my_friendly_assert (global_namespace != NULL && name != global_scope_name,
20030531);
- if (!name)
+ if (anon)
{
/* The name of anonymous namespace is unique for the translation
unit. */
@@ -3019,6 +3035,12 @@ push_namespace (tree name)
d = build_lang_decl (NAMESPACE_DECL, name, void_type_node);
DECL_CONTEXT (d) = FROB_CONTEXT (current_namespace);
d = pushdecl (d);
+ if (anon)
+ {
+ /* Clear DECL_NAME for the benefit of debugging back ends. */
+ SET_DECL_ASSEMBLER_NAME (d, name);
+ DECL_NAME (d) = NULL_TREE;
+ }
begin_scope (sk_namespace, d);
}
else
@@ -3134,8 +3156,8 @@ do_namespace_alias (tree alias, tree namespace)
tree
pushdecl_namespace_level (tree x)
{
- register struct cp_binding_level *b = current_binding_level;
- register tree t;
+ struct cp_binding_level *b = current_binding_level;
+ tree t;
timevar_push (TV_NAME_LOOKUP);
t = pushdecl_with_scope (x, NAMESPACE_LEVEL (current_namespace));
@@ -3283,6 +3305,33 @@ do_using_directive (tree namespace)
add_using_namespace (current_namespace, namespace, 0);
}
+/* Deal with a using-directive seen by the parser. Currently we only
+ handle attributes here, since they cannot appear inside a template. */
+
+void
+parse_using_directive (tree namespace, tree attribs)
+{
+ tree a;
+
+ do_using_directive (namespace);
+
+ for (a = attribs; a; a = TREE_CHAIN (a))
+ {
+ tree name = TREE_PURPOSE (a);
+ if (is_attribute_p ("strong", name))
+ {
+ if (!toplevel_bindings_p ())
+ error ("strong using only meaningful at namespace scope");
+ else
+ DECL_NAMESPACE_ASSOCIATIONS (namespace)
+ = tree_cons (current_namespace, 0,
+ DECL_NAMESPACE_ASSOCIATIONS (namespace));
+ }
+ else
+ warning ("`%D' attribute directive ignored", name);
+ }
+}
+
/* Like pushdecl, only it places X in the global scope if appropriate.
Calls cp_finish_decl to register the variable, initializing it with
*INIT, if INIT is non-NULL. */
@@ -3927,7 +3976,7 @@ lookup_name_current_level (tree name)
static tree
lookup_type_current_level (tree name)
{
- register tree t = NULL_TREE;
+ tree t = NULL_TREE;
timevar_push (TV_NAME_LOOKUP);
my_friendly_assert (current_binding_level->kind != sk_namespace,
@@ -4008,6 +4057,34 @@ add_function (struct arg_lookup *k, tree fn)
return false;
}
+/* Returns true iff CURRENT has declared itself to be an associated
+ namespace of SCOPE via a strong using-directive (or transitive chain
+ thereof). Both are namespaces. */
+
+bool
+is_associated_namespace (tree current, tree scope)
+{
+ tree seen = NULL_TREE;
+ tree todo = NULL_TREE;
+ tree t;
+ while (1)
+ {
+ if (scope == current)
+ return true;
+ seen = tree_cons (scope, NULL_TREE, seen);
+ for (t = DECL_NAMESPACE_ASSOCIATIONS (scope); t; t = TREE_CHAIN (t))
+ if (!purpose_member (TREE_PURPOSE (t), seen))
+ todo = tree_cons (TREE_PURPOSE (t), NULL_TREE, todo);
+ if (todo)
+ {
+ scope = TREE_PURPOSE (todo);
+ todo = TREE_CHAIN (todo);
+ }
+ else
+ return false;
+ }
+}
+
/* Add functions of a namespace to the lookup structure.
Returns true on error. */
@@ -4019,6 +4096,12 @@ arg_assoc_namespace (struct arg_lookup *k, tree scope)
if (purpose_member (scope, k->namespaces))
return 0;
k->namespaces = tree_cons (scope, NULL_TREE, k->namespaces);
+
+ /* Check out our super-users. */
+ for (value = DECL_NAMESPACE_ASSOCIATIONS (scope); value;
+ value = TREE_CHAIN (value))
+ if (arg_assoc_namespace (k, TREE_PURPOSE (value)))
+ return true;
value = namespace_binding (k->name, scope);
if (!value)
@@ -4407,7 +4490,7 @@ maybe_process_template_type_declaration (tree type, int globalize,
void
pushtag (tree name, tree type, int globalize)
{
- register struct cp_binding_level *b;
+ struct cp_binding_level *b;
timevar_push (TV_NAME_LOOKUP);
b = current_binding_level;
@@ -4430,7 +4513,7 @@ pushtag (tree name, tree type, int globalize)
/* Do C++ gratuitous typedefing. */
if (IDENTIFIER_TYPE_VALUE (name) != type)
{
- register tree d = NULL_TREE;
+ tree d = NULL_TREE;
int in_class = 0;
tree context = TYPE_CONTEXT (type);
diff --git a/gcc/cp/name-lookup.h b/gcc/cp/name-lookup.h
index 36643b26d29..8c8b04057f6 100644
--- a/gcc/cp/name-lookup.h
+++ b/gcc/cp/name-lookup.h
@@ -211,7 +211,7 @@ struct cp_binding_level GTY(())
/* The kind of scope that this object represents. However, a
SK_TEMPLATE_SPEC scope is represented with KIND set to
SK_TEMPALTE_PARMS and EXPLICIT_SPEC_P set to true. */
- enum scope_kind kind : 4;
+ ENUM_BITFIELD (scope_kind) kind : 4;
/* True if this scope is an SK_TEMPLATE_SPEC scope. This field is
only valid if KIND == SK_TEMPLATE_PARMS. */
@@ -306,6 +306,8 @@ extern void do_local_using_decl (tree);
extern tree do_class_using_decl (tree);
extern void do_using_directive (tree);
extern tree lookup_arg_dependent (tree, tree, tree);
+extern bool is_associated_namespace (tree, tree);
+extern void parse_using_directive (tree, tree);
/* Set *DECL to the (non-hidden) declaration for ID at global scope,
diff --git a/gcc/cp/optimize.c b/gcc/cp/optimize.c
index 2b7df6c5244..7dc57ce31a3 100644
--- a/gcc/cp/optimize.c
+++ b/gcc/cp/optimize.c
@@ -158,6 +158,7 @@ maybe_clone_body (tree 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);
+ DECL_VISIBILITY (clone) = DECL_VISIBILITY (fn);
/* Adjust the parameter names and locations. */
parm = DECL_ARGUMENTS (fn);
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c
index 9b040f557d0..46907ecb5bb 100644
--- a/gcc/cp/parser.c
+++ b/gcc/cp/parser.c
@@ -68,10 +68,10 @@
typedef struct cp_token GTY (())
{
/* The kind of token. */
- enum cpp_ttype type : 8;
+ ENUM_BITFIELD (cpp_ttype) type : 8;
/* If this token is a keyword, this value indicates which keyword.
Otherwise, this value is RID_MAX. */
- enum rid keyword : 8;
+ ENUM_BITFIELD (rid) keyword : 8;
/* The value associated with this token, if any. */
tree value;
/* The location at which this token was found. */
@@ -219,6 +219,8 @@ static int cp_lexer_saving_tokens
(const cp_lexer *);
static cp_token *cp_lexer_next_token
(cp_lexer *, cp_token *);
+static cp_token *cp_lexer_prev_token
+ (cp_lexer *, cp_token *);
static ptrdiff_t cp_lexer_token_difference
(cp_lexer *, cp_token *, cp_token *);
static cp_token *cp_lexer_read_token
@@ -419,6 +421,17 @@ cp_lexer_next_token (cp_lexer* lexer, cp_token* token)
return token;
}
+/* TOKEN points into the circular token buffer. Return a pointer to
+ the previous token in the buffer. */
+
+static inline cp_token *
+cp_lexer_prev_token (cp_lexer* lexer, cp_token* token)
+{
+ if (token == lexer->buffer)
+ token = lexer->buffer_end;
+ return token - 1;
+}
+
/* nonzero if we are presently saving tokens. */
static int
@@ -1063,9 +1076,9 @@ typedef enum cp_parser_declarator_kind
typedef struct cp_parser_token_tree_map_node
{
/* The token type. */
- enum cpp_ttype token_type : 8;
+ ENUM_BITFIELD (cpp_ttype) token_type : 8;
/* The corresponding tree code. */
- enum tree_code tree_type : 8;
+ ENUM_BITFIELD (tree_code) tree_type : 8;
} cp_parser_token_tree_map_node;
/* A complete map consists of several ordinary entries, followed by a
@@ -1205,17 +1218,20 @@ typedef struct cp_parser GTY(())
/* TRUE if we are parsing an integral constant-expression. See
[expr.const] for a precise definition. */
- bool constant_expression_p;
+ bool integral_constant_expression_p;
/* TRUE if we are parsing an integral constant-expression -- but a
non-constant expression should be permitted as well. This flag
is used when parsing an array bound so that GNU variable-length
arrays are tolerated. */
- bool allow_non_constant_expression_p;
+ bool allow_non_integral_constant_expression_p;
/* TRUE if ALLOW_NON_CONSTANT_EXPRESSION_P is TRUE and something has
been seen that makes the expression non-constant. */
- bool non_constant_expression_p;
+ bool non_integral_constant_expression_p;
+
+ /* TRUE if we are parsing the argument to "__offsetof__". */
+ bool in_offsetof_p;
/* TRUE if local variable names and `this' are forbidden in the
current context. */
@@ -1230,6 +1246,17 @@ typedef struct cp_parser GTY(())
direct-declarator. */
bool in_declarator_p;
+ /* TRUE if we are presently parsing a template-argument-list. */
+ bool in_template_argument_list_p;
+
+ /* TRUE if we are presently parsing the body of an
+ iteration-statement. */
+ bool in_iteration_statement_p;
+
+ /* TRUE if we are presently parsing the body of a switch
+ statement. */
+ bool in_switch_statement_p;
+
/* If non-NULL, then we are parsing a construct where new type
definitions are not permitted. The string stored here will be
issued as an error message if a type is defined. */
@@ -1301,11 +1328,11 @@ static tree cp_parser_id_expression
static tree cp_parser_unqualified_id
(cp_parser *, bool, bool, bool);
static tree cp_parser_nested_name_specifier_opt
- (cp_parser *, bool, bool, bool);
+ (cp_parser *, bool, bool, bool, bool);
static tree cp_parser_nested_name_specifier
- (cp_parser *, bool, bool, bool);
-static tree cp_parser_class_or_namespace_name
(cp_parser *, bool, bool, bool, bool);
+static tree cp_parser_class_or_namespace_name
+ (cp_parser *, bool, bool, bool, bool, bool);
static tree cp_parser_postfix_expression
(cp_parser *, bool);
static tree cp_parser_parenthesized_expression_list
@@ -1449,7 +1476,7 @@ static void cp_parser_linkage_specification
static tree cp_parser_init_declarator
(cp_parser *, tree, tree, bool, bool, int, bool *);
static tree cp_parser_declarator
- (cp_parser *, cp_parser_declarator_kind, int *);
+ (cp_parser *, cp_parser_declarator_kind, int *, bool *);
static tree cp_parser_direct_declarator
(cp_parser *, cp_parser_declarator_kind, int *);
static enum tree_code cp_parser_ptr_operator
@@ -1469,9 +1496,7 @@ static tree cp_parser_parameter_declaration_clause
static tree cp_parser_parameter_declaration_list
(cp_parser *);
static tree cp_parser_parameter_declaration
- (cp_parser *, bool);
-static tree cp_parser_function_definition
- (cp_parser *, bool *);
+ (cp_parser *, bool, bool *);
static void cp_parser_function_body
(cp_parser *);
static tree cp_parser_initializer
@@ -1487,7 +1512,7 @@ static bool cp_parser_ctor_initializer_opt_and_function_body
/* Classes [gram.class] */
static tree cp_parser_class_name
- (cp_parser *, bool, bool, bool, bool, bool);
+ (cp_parser *, bool, bool, bool, bool, bool, bool);
static tree cp_parser_class_specifier
(cp_parser *);
static tree cp_parser_class_head
@@ -1545,9 +1570,9 @@ static tree cp_parser_template_parameter
static tree cp_parser_type_parameter
(cp_parser *);
static tree cp_parser_template_id
- (cp_parser *, bool, bool);
+ (cp_parser *, bool, bool, bool);
static tree cp_parser_template_name
- (cp_parser *, bool, bool);
+ (cp_parser *, bool, bool, bool, bool *);
static tree cp_parser_template_argument_list
(cp_parser *);
static tree cp_parser_template_argument
@@ -1623,6 +1648,10 @@ static tree cp_parser_single_declaration
(cp_parser *, bool, bool *);
static tree cp_parser_functional_cast
(cp_parser *, tree);
+static tree cp_parser_save_member_function_body
+ (cp_parser *, tree, tree, tree);
+static tree cp_parser_enclosed_template_argument_list
+ (cp_parser *);
static void cp_parser_save_default_args
(cp_parser *, tree);
static void cp_parser_late_parsing_for_member
@@ -1673,18 +1702,22 @@ static bool cp_parser_committed_to_tentative_parse
(cp_parser *);
static void cp_parser_error
(cp_parser *, const char *);
+static void cp_parser_name_lookup_error
+ (cp_parser *, tree, tree, const char *);
static bool cp_parser_simulate_error
(cp_parser *);
static void cp_parser_check_type_definition
(cp_parser *);
static void cp_parser_check_for_definition_in_return_type
(tree, int);
-static tree cp_parser_non_constant_expression
+static void cp_parser_check_for_invalid_template_id
+ (cp_parser *, tree);
+static tree cp_parser_non_integral_constant_expression
(const char *);
static bool cp_parser_diagnose_invalid_type_name
(cp_parser *);
static int cp_parser_skip_to_closing_parenthesis
- (cp_parser *, bool, bool);
+ (cp_parser *, bool, bool, bool);
static void cp_parser_skip_to_end_of_statement
(cp_parser *);
static void cp_parser_consume_semicolon_at_end_of_statement
@@ -1735,7 +1768,47 @@ cp_parser_error (cp_parser* parser, const char* message)
{
/* Output the MESSAGE -- unless we're parsing tentatively. */
if (!cp_parser_simulate_error (parser))
- error (message);
+ {
+ cp_token *token;
+ token = cp_lexer_peek_token (parser->lexer);
+ c_parse_error (message,
+ /* Because c_parser_error does not understand
+ CPP_KEYWORD, keywords are treated like
+ identifiers. */
+ (token->type == CPP_KEYWORD ? CPP_NAME : token->type),
+ token->value);
+ }
+}
+
+/* Issue an error about name-lookup failing. NAME is the
+ IDENTIFIER_NODE DECL is the result of
+ the lookup (as returned from cp_parser_lookup_name). DESIRED is
+ the thing that we hoped to find. */
+
+static void
+cp_parser_name_lookup_error (cp_parser* parser,
+ tree name,
+ tree decl,
+ const char* desired)
+{
+ /* If name lookup completely failed, tell the user that NAME was not
+ declared. */
+ if (decl == error_mark_node)
+ {
+ if (parser->scope && parser->scope != global_namespace)
+ error ("`%D::%D' has not been declared",
+ parser->scope, name);
+ else if (parser->scope == global_namespace)
+ error ("`::%D' has not been declared", name);
+ else
+ error ("`%D' has not been declared", name);
+ }
+ else if (parser->scope && parser->scope != global_namespace)
+ error ("`%D::%D' %s", parser->scope, name, desired);
+ else if (parser->scope == global_namespace)
+ error ("`::%D' %s", name, desired);
+ else
+ error ("`%D' %s", name, desired);
}
/* If we are parsing tentatively, remember that an error has occurred
@@ -1790,11 +1863,59 @@ cp_parser_check_for_definition_in_return_type (tree declarator,
error ("new types may not be defined in a return type");
}
+/* A type-specifier (TYPE) has been parsed which cannot be followed by
+ "<" in any valid C++ program. If the next token is indeed "<",
+ issue a message warning the user about what appears to be an
+ invalid attempt to form a template-id. */
+
+static void
+cp_parser_check_for_invalid_template_id (cp_parser* parser,
+ tree type)
+{
+ ptrdiff_t start;
+ cp_token *token;
+
+ if (cp_lexer_next_token_is (parser->lexer, CPP_LESS))
+ {
+ if (TYPE_P (type))
+ error ("`%T' is not a template", type);
+ else if (TREE_CODE (type) == IDENTIFIER_NODE)
+ error ("`%s' is not a template", IDENTIFIER_POINTER (type));
+ else
+ error ("invalid template-id");
+ /* Remember the location of the invalid "<". */
+ if (cp_parser_parsing_tentatively (parser)
+ && !cp_parser_committed_to_tentative_parse (parser))
+ {
+ token = cp_lexer_peek_token (parser->lexer);
+ token = cp_lexer_prev_token (parser->lexer, token);
+ start = cp_lexer_token_difference (parser->lexer,
+ parser->lexer->first_token,
+ token);
+ }
+ else
+ start = -1;
+ /* Consume the "<". */
+ cp_lexer_consume_token (parser->lexer);
+ /* Parse the template arguments. */
+ cp_parser_enclosed_template_argument_list (parser);
+ /* Permanently remove the invalid template arguments so that
+ this error message is not issued again. */
+ if (start >= 0)
+ {
+ token = cp_lexer_advance_token (parser->lexer,
+ parser->lexer->first_token,
+ start);
+ cp_lexer_purge_tokens_after (parser->lexer, token);
+ }
+ }
+}
+
/* Issue an error message about the fact that THING appeared in a
constant-expression. Returns ERROR_MARK_NODE. */
static tree
-cp_parser_non_constant_expression (const char *thing)
+cp_parser_non_integral_constant_expression (const char *thing)
{
error ("%s cannot appear in a constant-expression", thing);
return error_mark_node;
@@ -1880,7 +2001,9 @@ cp_parser_diagnose_invalid_type_name (cp_parser *parser)
static int
cp_parser_skip_to_closing_parenthesis (cp_parser *parser,
- bool recovering, bool or_comma)
+ bool recovering,
+ bool or_comma,
+ bool consume_paren)
{
unsigned paren_depth = 0;
unsigned brace_depth = 0;
@@ -1897,28 +2020,22 @@ cp_parser_skip_to_closing_parenthesis (cp_parser *parser,
if (cp_lexer_next_token_is (parser->lexer, CPP_EOF))
return 0;
- if (recovering)
+ token = cp_lexer_peek_token (parser->lexer);
+
+ /* This matches the processing in skip_to_end_of_statement. */
+ if (token->type == CPP_SEMICOLON && !brace_depth)
+ return 0;
+ if (token->type == CPP_OPEN_BRACE)
+ ++brace_depth;
+ if (token->type == CPP_CLOSE_BRACE)
{
- token = cp_lexer_peek_token (parser->lexer);
-
- /* This matches the processing in skip_to_end_of_statement */
- if (token->type == CPP_SEMICOLON && !brace_depth)
+ if (!brace_depth--)
return 0;
- if (token->type == CPP_OPEN_BRACE)
- ++brace_depth;
- if (token->type == CPP_CLOSE_BRACE)
- {
- if (!brace_depth--)
- return 0;
- }
- if (or_comma && token->type == CPP_COMMA
- && !brace_depth && !paren_depth)
- return -1;
}
+ if (recovering && or_comma && token->type == CPP_COMMA
+ && !brace_depth && !paren_depth)
+ return -1;
- /* Consume the token. */
- token = cp_lexer_consume_token (parser->lexer);
-
if (!brace_depth)
{
/* If it is an `(', we have entered another level of nesting. */
@@ -1926,8 +2043,15 @@ cp_parser_skip_to_closing_parenthesis (cp_parser *parser,
++paren_depth;
/* If it is a `)', then we might be done. */
else if (token->type == CPP_CLOSE_PAREN && !paren_depth--)
- return 1;
+ {
+ if (consume_paren)
+ cp_lexer_consume_token (parser->lexer);
+ return 1;
+ }
}
+
+ /* Consume the token. */
+ cp_lexer_consume_token (parser->lexer);
}
}
@@ -2105,9 +2229,12 @@ cp_parser_new (void)
parser->default_arg_ok_p = true;
/* We are not parsing a constant-expression. */
- parser->constant_expression_p = false;
- parser->allow_non_constant_expression_p = false;
- parser->non_constant_expression_p = false;
+ parser->integral_constant_expression_p = false;
+ parser->allow_non_integral_constant_expression_p = false;
+ parser->non_integral_constant_expression_p = false;
+
+ /* We are not parsing offsetof. */
+ parser->in_offsetof_p = false;
/* Local variable names are not forbidden. */
parser->local_variables_forbidden_p = false;
@@ -2118,6 +2245,15 @@ cp_parser_new (void)
/* We are not processing a declarator. */
parser->in_declarator_p = false;
+ /* We are not processing a template-argument-list. */
+ parser->in_template_argument_list_p = false;
+
+ /* We are not in an iteration statement. */
+ parser->in_iteration_statement_p = false;
+
+ /* We are not in a switch statement. */
+ parser->in_switch_statement_p = false;
+
/* The unparsed function queue is empty. */
parser->unparsed_functions_queues = build_tree_list (NULL_TREE, NULL_TREE);
@@ -2322,11 +2458,11 @@ cp_parser_primary_expression (cp_parser *parser,
return error_mark_node;
}
/* Pointers cannot appear in constant-expressions. */
- if (parser->constant_expression_p)
+ if (parser->integral_constant_expression_p)
{
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("`this'");
- parser->non_constant_expression_p = true;
+ if (!parser->allow_non_integral_constant_expression_p)
+ return cp_parser_non_integral_constant_expression ("`this'");
+ parser->non_integral_constant_expression_p = true;
}
return finish_this_expr ();
@@ -2369,15 +2505,38 @@ cp_parser_primary_expression (cp_parser *parser,
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
/* Using `va_arg' in a constant-expression is not
allowed. */
- if (parser->constant_expression_p)
+ if (parser->integral_constant_expression_p)
{
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("`va_arg'");
- parser->non_constant_expression_p = true;
+ if (!parser->allow_non_integral_constant_expression_p)
+ return cp_parser_non_integral_constant_expression ("`va_arg'");
+ parser->non_integral_constant_expression_p = true;
}
return build_x_va_arg (expression, type);
}
+ case RID_OFFSETOF:
+ {
+ tree expression;
+ bool saved_in_offsetof_p;
+
+ /* Consume the "__offsetof__" token. */
+ cp_lexer_consume_token (parser->lexer);
+ /* Consume the opening `('. */
+ cp_parser_require (parser, CPP_OPEN_PAREN, "`('");
+ /* Parse the parenthesized (almost) constant-expression. */
+ saved_in_offsetof_p = parser->in_offsetof_p;
+ parser->in_offsetof_p = true;
+ expression
+ = cp_parser_constant_expression (parser,
+ /*allow_non_constant_p=*/false,
+ /*non_constant_p=*/NULL);
+ parser->in_offsetof_p = saved_in_offsetof_p;
+ /* Consume the closing ')'. */
+ cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
+
+ return expression;
+ }
+
default:
cp_parser_error (parser, "expected primary-expression");
return error_mark_node;
@@ -2454,9 +2613,9 @@ cp_parser_primary_expression (cp_parser *parser,
decl = finish_id_expression (id_expression, decl, parser->scope,
idk, qualifying_class,
- parser->constant_expression_p,
- parser->allow_non_constant_expression_p,
- &parser->non_constant_expression_p,
+ parser->integral_constant_expression_p,
+ parser->allow_non_integral_constant_expression_p,
+ &parser->non_integral_constant_expression_p,
&error_msg);
if (error_msg)
cp_parser_error (parser, error_msg);
@@ -2527,7 +2686,8 @@ cp_parser_id_expression (cp_parser *parser,
= (cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
check_dependency_p,
- /*type_p=*/false)
+ /*type_p=*/false,
+ /*is_declarator=*/false)
!= NULL_TREE);
/* If there is a nested-name-specifier, then we are looking at
the first qualified-id production. */
@@ -2580,7 +2740,8 @@ cp_parser_id_expression (cp_parser *parser,
/* Try a template-id. */
id = cp_parser_template_id (parser,
/*template_keyword_p=*/false,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ declarator_p);
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
return id;
@@ -2654,7 +2815,8 @@ cp_parser_unqualified_id (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Try a template-id. */
id = cp_parser_template_id (parser, template_keyword_p,
- check_dependency_p);
+ check_dependency_p,
+ declarator_p);
/* If it worked, we're done. */
if (cp_parser_parse_definitely (parser))
return id;
@@ -2664,7 +2826,8 @@ cp_parser_unqualified_id (cp_parser* parser,
case CPP_TEMPLATE_ID:
return cp_parser_template_id (parser, template_keyword_p,
- check_dependency_p);
+ check_dependency_p,
+ declarator_p);
case CPP_COMPL:
{
@@ -2736,7 +2899,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency=*/false,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ declarator_p);
if (cp_parser_parse_definitely (parser))
return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
}
@@ -2753,7 +2917,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency=*/false,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ declarator_p);
if (cp_parser_parse_definitely (parser))
return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
}
@@ -2770,7 +2935,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency=*/false,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ declarator_p);
if (cp_parser_parse_definitely (parser))
return build_nt (BIT_NOT_EXPR, TREE_TYPE (type_decl));
}
@@ -2784,7 +2950,8 @@ cp_parser_unqualified_id (cp_parser* parser,
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency=*/false,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ declarator_p);
/* If an error occurred, assume that the name of the
destructor is the same as the name of the qualifying
class. That allows us to keep parsing after running
@@ -2816,7 +2983,8 @@ cp_parser_unqualified_id (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Try a template-id. */
id = cp_parser_template_id (parser, template_keyword_p,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ declarator_p);
/* If that worked, we're done. */
if (cp_parser_parse_definitely (parser))
return id;
@@ -2853,13 +3021,17 @@ cp_parser_unqualified_id (cp_parser* parser,
Sets PARSER->SCOPE to the class (TYPE) or namespace
(NAMESPACE_DECL) specified by the nested-name-specifier, or leaves
it unchanged if there is no nested-name-specifier. Returns the new
- scope iff there is a nested-name-specifier, or NULL_TREE otherwise. */
+ scope iff there is a nested-name-specifier, or NULL_TREE otherwise.
+
+ If IS_DECLARATION is TRUE, the nested-name-specifier is known to be
+ part of a declaration and/or decl-specifier. */
static tree
cp_parser_nested_name_specifier_opt (cp_parser *parser,
bool typename_keyword_p,
bool check_dependency_p,
- bool type_p)
+ bool type_p,
+ bool is_declaration)
{
bool success = false;
tree access_check = NULL_TREE;
@@ -2958,7 +3130,8 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
typename_keyword_p,
template_keyword_p,
check_dependency_p,
- type_p);
+ type_p,
+ is_declaration);
/* Look for the `::' token. */
cp_parser_require (parser, CPP_SCOPE, "`::'");
@@ -2991,24 +3164,10 @@ cp_parser_nested_name_specifier_opt (cp_parser *parser,
if (TREE_CODE (decl) == TEMPLATE_DECL)
error ("`%D' used without template parameters",
decl);
- else if (parser->scope)
- {
- if (TYPE_P (parser->scope))
- error ("`%T::%D' is not a class-name or "
- "namespace-name",
- parser->scope, token->value);
- else if (parser->scope == global_namespace)
- error ("`::%D' is not a class-name or "
- "namespace-name",
- token->value);
- else
- error ("`%D::%D' is not a class-name or "
- "namespace-name",
- parser->scope, token->value);
- }
else
- error ("`%D' is not a class-name or namespace-name",
- token->value);
+ cp_parser_name_lookup_error
+ (parser, token->value, decl,
+ "is not a class or namespace");
parser->scope = NULL_TREE;
error_p = true;
/* Treat this as a successful nested-name-specifier
@@ -3085,7 +3244,8 @@ static tree
cp_parser_nested_name_specifier (cp_parser *parser,
bool typename_keyword_p,
bool check_dependency_p,
- bool type_p)
+ bool type_p,
+ bool is_declaration)
{
tree scope;
@@ -3093,7 +3253,8 @@ cp_parser_nested_name_specifier (cp_parser *parser,
scope = cp_parser_nested_name_specifier_opt (parser,
typename_keyword_p,
check_dependency_p,
- type_p);
+ type_p,
+ is_declaration);
/* If it was not present, issue an error message. */
if (!scope)
{
@@ -3127,7 +3288,8 @@ cp_parser_class_or_namespace_name (cp_parser *parser,
bool typename_keyword_p,
bool template_keyword_p,
bool check_dependency_p,
- bool type_p)
+ bool type_p,
+ bool is_declaration)
{
tree saved_scope;
tree saved_qualifying_scope;
@@ -3151,7 +3313,8 @@ cp_parser_class_or_namespace_name (cp_parser *parser,
template_keyword_p,
type_p,
check_dependency_p,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ is_declaration);
/* If that didn't work, try for a namespace-name. */
if (!only_class_p && !cp_parser_parse_definitely (parser))
{
@@ -3263,15 +3426,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* Only type conversions to integral or enumeration types
can be used in constant-expressions. */
- if (parser->constant_expression_p
+ if (parser->integral_constant_expression_p
&& !dependent_type_p (type)
- && !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
+ && !INTEGRAL_OR_ENUMERATION_TYPE_P (type)
+ /* A cast to pointer or reference type is allowed in the
+ implementation of "offsetof". */
+ && !(parser->in_offsetof_p && POINTER_TYPE_P (type)))
{
- if (!parser->allow_non_constant_expression_p)
- return (cp_parser_non_constant_expression
+ if (!parser->allow_non_integral_constant_expression_p)
+ return (cp_parser_non_integral_constant_expression
("a cast to a type other than an integral or "
"enumeration type"));
- parser->non_constant_expression_p = true;
+ parser->non_integral_constant_expression_p = true;
}
switch (keyword)
@@ -3356,7 +3522,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
cp_parser_nested_name_specifier (parser,
/*typename_keyword_p=*/true,
/*check_dependency_p=*/true,
- /*type_p=*/true);
+ /*type_p=*/true,
+ /*is_declaration=*/true);
/* Look for the optional `template' keyword. */
template_p = cp_parser_optional_template_keyword (parser);
/* We don't know whether we're looking at a template-id or an
@@ -3364,7 +3531,8 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
cp_parser_parse_tentatively (parser);
/* Try a template-id. */
id = cp_parser_template_id (parser, template_p,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ /*is_declaration=*/true);
/* If that didn't work, try an identifier. */
if (!cp_parser_parse_definitely (parser))
id = cp_parser_identifier (parser);
@@ -3506,6 +3674,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
postfix_expression
= grok_array_decl (postfix_expression, index);
idk = CP_ID_KIND_NONE;
+ /* Array references are not permitted in
+ constant-expressions. */
+ if (parser->integral_constant_expression_p)
+ {
+ if (!parser->allow_non_integral_constant_expression_p)
+ postfix_expression
+ = cp_parser_non_integral_constant_expression ("an array reference");
+ parser->non_integral_constant_expression_p = true;
+ }
}
break;
@@ -3524,11 +3701,15 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* Function calls are not permitted in
constant-expressions. */
- if (parser->constant_expression_p)
+ if (parser->integral_constant_expression_p)
{
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("a function call");
- parser->non_constant_expression_p = true;
+ if (!parser->allow_non_integral_constant_expression_p)
+ {
+ postfix_expression
+ = cp_parser_non_integral_constant_expression ("a function call");
+ break;
+ }
+ parser->non_integral_constant_expression_p = true;
}
koenig_p = false;
@@ -3606,6 +3787,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
bool dependent_p;
bool template_p;
tree scope = NULL_TREE;
+ enum cpp_ttype token_type = token->type;
/* If this is a `->' operator, dereference the pointer. */
if (token->type == CPP_DEREF)
@@ -3693,7 +3875,7 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* Otherwise, try the pseudo-destructor-name production. */
else
{
- tree s;
+ tree s = NULL_TREE;
tree type;
/* Parse the pseudo-destructor-name. */
@@ -3708,6 +3890,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
object on the left-hand side of the `.' or `->'
operator. */
parser->context->object_type = NULL_TREE;
+ /* These operators may not appear in constant-expressions. */
+ if (parser->integral_constant_expression_p
+ /* The "->" operator is allowed in the implementation
+ of "offsetof". */
+ && !(parser->in_offsetof_p && token_type == CPP_DEREF))
+ {
+ if (!parser->allow_non_integral_constant_expression_p)
+ postfix_expression
+ = (cp_parser_non_integral_constant_expression
+ (token_type == CPP_DEREF ? "'->'" : "`.'"));
+ parser->non_integral_constant_expression_p = true;
+ }
}
break;
@@ -3715,17 +3909,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* postfix-expression ++ */
/* Consume the `++' token. */
cp_lexer_consume_token (parser->lexer);
- /* Increments may not appear in constant-expressions. */
- if (parser->constant_expression_p)
- {
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("an increment");
- parser->non_constant_expression_p = true;
- }
/* Generate a representation for the complete expression. */
postfix_expression
= finish_increment_expr (postfix_expression,
POSTINCREMENT_EXPR);
+ /* Increments may not appear in constant-expressions. */
+ if (parser->integral_constant_expression_p)
+ {
+ if (!parser->allow_non_integral_constant_expression_p)
+ postfix_expression
+ = cp_parser_non_integral_constant_expression ("an increment");
+ parser->non_integral_constant_expression_p = true;
+ }
idk = CP_ID_KIND_NONE;
break;
@@ -3733,17 +3928,18 @@ cp_parser_postfix_expression (cp_parser *parser, bool address_p)
/* postfix-expression -- */
/* Consume the `--' token. */
cp_lexer_consume_token (parser->lexer);
- /* Decrements may not appear in constant-expressions. */
- if (parser->constant_expression_p)
- {
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("a decrement");
- parser->non_constant_expression_p = true;
- }
/* Generate a representation for the complete expression. */
postfix_expression
= finish_increment_expr (postfix_expression,
POSTDECREMENT_EXPR);
+ /* Decrements may not appear in constant-expressions. */
+ if (parser->integral_constant_expression_p)
+ {
+ if (!parser->allow_non_integral_constant_expression_p)
+ postfix_expression
+ = cp_parser_non_integral_constant_expression ("a decrement");
+ parser->non_integral_constant_expression_p = true;
+ }
idk = CP_ID_KIND_NONE;
break;
@@ -3856,7 +4052,10 @@ cp_parser_parenthesized_expression_list (cp_parser* parser,
skip_comma:;
/* We try and resync to an unnested comma, as that will give the
user better diagnostics. */
- ending = cp_parser_skip_to_closing_parenthesis (parser, true, true);
+ ending = cp_parser_skip_to_closing_parenthesis (parser,
+ /*recovering=*/true,
+ /*or_comma=*/true,
+ /*consume_paren=*/true);
if (ending < 0)
goto get_comma;
if (!ending)
@@ -3897,7 +4096,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser,
= (cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false)
+ /*type_p=*/false,
+ /*is_declaration=*/true)
!= NULL_TREE);
/* Now, if we saw a nested-name-specifier, we might be doing the
second production. */
@@ -3909,7 +4109,8 @@ cp_parser_pseudo_destructor_name (cp_parser* parser,
/* Parse the template-id. */
cp_parser_template_id (parser,
/*template_keyword_p=*/true,
- /*check_dependency_p=*/false);
+ /*check_dependency_p=*/false,
+ /*is_declaration=*/true);
/* Look for the `::' token. */
cp_parser_require (parser, CPP_SCOPE, "`::'");
}
@@ -4081,6 +4282,8 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p)
if (unary_operator != ERROR_MARK)
{
tree cast_expression;
+ tree expression = error_mark_node;
+ const char *non_constant_p = NULL;
/* Consume the operator token. */
token = cp_lexer_consume_token (parser->lexer);
@@ -4091,32 +4294,43 @@ cp_parser_unary_expression (cp_parser *parser, bool address_p)
switch (unary_operator)
{
case INDIRECT_REF:
- return build_x_indirect_ref (cast_expression, "unary *");
-
+ non_constant_p = "`*'";
+ expression = build_x_indirect_ref (cast_expression, "unary *");
+ break;
+
case ADDR_EXPR:
+ /* The "&" operator is allowed in the implementation of
+ "offsetof". */
+ if (!parser->in_offsetof_p)
+ non_constant_p = "`&'";
+ /* Fall through. */
case BIT_NOT_EXPR:
- return build_x_unary_op (unary_operator, cast_expression);
-
+ expression = build_x_unary_op (unary_operator, cast_expression);
+ break;
+
case PREINCREMENT_EXPR:
case PREDECREMENT_EXPR:
- if (parser->constant_expression_p)
- {
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression (PREINCREMENT_EXPR
- ? "an increment"
- : "a decrement");
- parser->non_constant_expression_p = true;
- }
+ non_constant_p = (unary_operator == PREINCREMENT_EXPR
+ ? "`++'" : "`--'");
/* Fall through. */
case CONVERT_EXPR:
case NEGATE_EXPR:
case TRUTH_NOT_EXPR:
- return finish_unary_op_expr (unary_operator, cast_expression);
+ expression = finish_unary_op_expr (unary_operator, cast_expression);
+ break;
default:
abort ();
- return error_mark_node;
}
+
+ if (non_constant_p && parser->integral_constant_expression_p)
+ {
+ if (!parser->allow_non_integral_constant_expression_p)
+ return cp_parser_non_integral_constant_expression (non_constant_p);
+ parser->non_integral_constant_expression_p = true;
+ }
+
+ return expression;
}
return cp_parser_postfix_expression (parser, address_p);
@@ -4487,7 +4701,8 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p)
If we find the closing `)', and the next token is a `{', then
we are looking at a compound-literal. */
compound_literal_p
- = (cp_parser_skip_to_closing_parenthesis (parser, false, false)
+ = (cp_parser_skip_to_closing_parenthesis (parser, false, false,
+ /*consume_paren=*/true)
&& cp_lexer_next_token_is (parser->lexer, CPP_OPEN_BRACE));
/* Roll back the tokens we skipped. */
cp_lexer_rollback_tokens (parser->lexer);
@@ -4525,15 +4740,15 @@ cp_parser_cast_expression (cp_parser *parser, bool address_p)
/* Only type conversions to integral or enumeration types
can be used in constant-expressions. */
- if (parser->constant_expression_p
+ if (parser->integral_constant_expression_p
&& !dependent_type_p (type)
&& !INTEGRAL_OR_ENUMERATION_TYPE_P (type))
{
- if (!parser->allow_non_constant_expression_p)
- return (cp_parser_non_constant_expression
+ if (!parser->allow_non_integral_constant_expression_p)
+ return (cp_parser_non_integral_constant_expression
("a casts to a type other than an integral or "
"enumeration type"));
- parser->non_constant_expression_p = true;
+ parser->non_integral_constant_expression_p = true;
}
/* Perform the cast. */
expr = build_c_cast (type, expr);
@@ -4887,11 +5102,11 @@ cp_parser_assignment_expression (cp_parser* parser)
rhs = cp_parser_assignment_expression (parser);
/* An assignment may not appear in a
constant-expression. */
- if (parser->constant_expression_p)
+ if (parser->integral_constant_expression_p)
{
- if (!parser->allow_non_constant_expression_p)
- return cp_parser_non_constant_expression ("an assignment");
- parser->non_constant_expression_p = true;
+ if (!parser->allow_non_integral_constant_expression_p)
+ return cp_parser_non_integral_constant_expression ("an assignment");
+ parser->non_integral_constant_expression_p = true;
}
/* Build the assignment expression. */
expr = build_x_modify_expr (expr,
@@ -5030,12 +5245,12 @@ cp_parser_expression (cp_parser* parser)
/* Consume the `,'. */
cp_lexer_consume_token (parser->lexer);
/* A comma operator cannot appear in a constant-expression. */
- if (parser->constant_expression_p)
+ if (parser->integral_constant_expression_p)
{
- if (!parser->allow_non_constant_expression_p)
+ if (!parser->allow_non_integral_constant_expression_p)
expression
- = cp_parser_non_constant_expression ("a comma operator");
- parser->non_constant_expression_p = true;
+ = cp_parser_non_integral_constant_expression ("a comma operator");
+ parser->non_integral_constant_expression_p = true;
}
}
@@ -5057,9 +5272,9 @@ cp_parser_constant_expression (cp_parser* parser,
bool allow_non_constant_p,
bool *non_constant_p)
{
- bool saved_constant_expression_p;
- bool saved_allow_non_constant_expression_p;
- bool saved_non_constant_expression_p;
+ bool saved_integral_constant_expression_p;
+ bool saved_allow_non_integral_constant_expression_p;
+ bool saved_non_integral_constant_expression_p;
tree expression;
/* It might seem that we could simply parse the
@@ -5080,14 +5295,14 @@ cp_parser_constant_expression (cp_parser* parser,
will fold this operation to an INTEGER_CST for `3'. */
/* Save the old settings. */
- saved_constant_expression_p = parser->constant_expression_p;
- saved_allow_non_constant_expression_p
- = parser->allow_non_constant_expression_p;
- saved_non_constant_expression_p = parser->non_constant_expression_p;
+ saved_integral_constant_expression_p = parser->integral_constant_expression_p;
+ saved_allow_non_integral_constant_expression_p
+ = parser->allow_non_integral_constant_expression_p;
+ saved_non_integral_constant_expression_p = parser->non_integral_constant_expression_p;
/* We are now parsing a constant-expression. */
- parser->constant_expression_p = true;
- parser->allow_non_constant_expression_p = allow_non_constant_p;
- parser->non_constant_expression_p = false;
+ parser->integral_constant_expression_p = true;
+ parser->allow_non_integral_constant_expression_p = allow_non_constant_p;
+ parser->non_integral_constant_expression_p = false;
/* Although the grammar says "conditional-expression", we parse an
"assignment-expression", which also permits "throw-expression"
and the use of assignment operators. In the case that
@@ -5099,12 +5314,12 @@ cp_parser_constant_expression (cp_parser* parser,
constant. */
expression = cp_parser_assignment_expression (parser);
/* Restore the old settings. */
- parser->constant_expression_p = saved_constant_expression_p;
- parser->allow_non_constant_expression_p
- = saved_allow_non_constant_expression_p;
+ parser->integral_constant_expression_p = saved_integral_constant_expression_p;
+ parser->allow_non_integral_constant_expression_p
+ = saved_allow_non_integral_constant_expression_p;
if (allow_non_constant_p)
- *non_constant_p = parser->non_constant_expression_p;
- parser->non_constant_expression_p = saved_non_constant_expression_p;
+ *non_constant_p = parser->non_integral_constant_expression_p;
+ parser->non_integral_constant_expression_p = saved_non_integral_constant_expression_p;
return expression;
}
@@ -5228,7 +5443,7 @@ static tree
cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p)
{
cp_token *token;
- tree statement = NULL_TREE;
+ tree statement = error_mark_node;
/* The next token should be an identifier. */
token = cp_lexer_peek_token (parser->lexer);
@@ -5251,16 +5466,20 @@ cp_parser_labeled_statement (cp_parser* parser, bool in_statement_expr_p)
expr = cp_parser_constant_expression (parser,
/*allow_non_constant_p=*/false,
NULL);
- /* Create the label. */
- statement = finish_case_label (expr, NULL_TREE);
+ if (!parser->in_switch_statement_p)
+ error ("case label `%E' not within a switch statement", expr);
+ else
+ statement = finish_case_label (expr, NULL_TREE);
}
break;
case RID_DEFAULT:
/* Consume the `default' token. */
cp_lexer_consume_token (parser->lexer);
- /* Create the label. */
- statement = finish_case_label (NULL_TREE, NULL_TREE);
+ if (!parser->in_switch_statement_p)
+ error ("case label not within a switch statement");
+ else
+ statement = finish_case_label (NULL_TREE, NULL_TREE);
break;
default:
@@ -5410,7 +5629,8 @@ cp_parser_selection_statement (cp_parser* parser)
condition = cp_parser_condition (parser);
/* Look for the `)'. */
if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"))
- cp_parser_skip_to_closing_parenthesis (parser, true, false);
+ cp_parser_skip_to_closing_parenthesis (parser, true, false,
+ /*consume_paren=*/true);
if (keyword == RID_IF)
{
@@ -5443,12 +5663,16 @@ cp_parser_selection_statement (cp_parser* parser)
else
{
tree body;
+ bool in_switch_statement_p;
/* Add the condition. */
finish_switch_cond (condition, statement);
/* Parse the body of the switch-statement. */
+ in_switch_statement_p = parser->in_switch_statement_p;
+ parser->in_switch_statement_p = true;
body = cp_parser_implicitly_scoped_statement (parser);
+ parser->in_switch_statement_p = in_switch_statement_p;
/* Now we're all done with the switch-statement. */
finish_switch_stmt (statement);
@@ -5506,7 +5730,8 @@ cp_parser_condition (cp_parser* parser)
/* Parse the declarator. */
declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
- /*ctor_dtor_or_conv_p=*/NULL);
+ /*ctor_dtor_or_conv_p=*/NULL,
+ /*parenthesized_p=*/NULL);
/* Parse the attributes. */
attributes = cp_parser_attributes_opt (parser);
/* Parse the asm-specification. */
@@ -5564,12 +5789,18 @@ cp_parser_iteration_statement (cp_parser* parser)
cp_token *token;
enum rid keyword;
tree statement;
+ bool in_iteration_statement_p;
+
/* Peek at the next token. */
token = cp_parser_require (parser, CPP_KEYWORD, "iteration-statement");
if (!token)
return error_mark_node;
+ /* Remember whether or not we are already within an iteration
+ statement. */
+ in_iteration_statement_p = parser->in_iteration_statement_p;
+
/* See what kind of keyword it is. */
keyword = token->keyword;
switch (keyword)
@@ -5588,7 +5819,9 @@ cp_parser_iteration_statement (cp_parser* parser)
/* Look for the `)'. */
cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'");
/* Parse the dependent statement. */
+ parser->in_iteration_statement_p = true;
cp_parser_already_scoped_statement (parser);
+ parser->in_iteration_statement_p = in_iteration_statement_p;
/* We're done with the while-statement. */
finish_while_stmt (statement);
}
@@ -5601,7 +5834,9 @@ cp_parser_iteration_statement (cp_parser* parser)
/* Begin the do-statement. */
statement = begin_do_stmt ();
/* Parse the body of the do-statement. */
+ parser->in_iteration_statement_p = true;
cp_parser_implicitly_scoped_statement (parser);
+ parser->in_iteration_statement_p = in_iteration_statement_p;
finish_do_body (statement);
/* Look for the `while' keyword. */
cp_parser_require_keyword (parser, RID_WHILE, "`while'");
@@ -5646,7 +5881,9 @@ cp_parser_iteration_statement (cp_parser* parser)
cp_parser_require (parser, CPP_CLOSE_PAREN, "`;'");
/* Parse the body of the for-statement. */
+ parser->in_iteration_statement_p = true;
cp_parser_already_scoped_statement (parser);
+ parser->in_iteration_statement_p = in_iteration_statement_p;
/* We're done with the for-statement. */
finish_for_stmt (statement);
@@ -5727,12 +5964,25 @@ cp_parser_jump_statement (cp_parser* parser)
switch (keyword)
{
case RID_BREAK:
- statement = finish_break_stmt ();
+ if (!parser->in_switch_statement_p
+ && !parser->in_iteration_statement_p)
+ {
+ error ("break statement not within loop or switch");
+ statement = error_mark_node;
+ }
+ else
+ statement = finish_break_stmt ();
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
break;
case RID_CONTINUE:
- statement = finish_continue_stmt ();
+ if (!parser->in_iteration_statement_p)
+ {
+ error ("continue statement not within a loop");
+ statement = error_mark_node;
+ }
+ else
+ statement = finish_continue_stmt ();
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
break;
@@ -5878,7 +6128,7 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
{
/* A declaration consisting of a single semicolon is
invalid. Allow it unless we're being pedantic. */
- if (pedantic)
+ if (pedantic && !in_system_header)
pedwarn ("extra `;'");
cp_lexer_consume_token (parser->lexer);
continue;
@@ -6875,7 +7125,8 @@ cp_parser_mem_initializer_id (cp_parser* parser)
= (cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/true,
/*check_dependency_p=*/true,
- /*type_p=*/true)
+ /*type_p=*/true,
+ /*is_declaration=*/true)
!= NULL_TREE);
/* If there is a `::' operator or a nested-name-specifier, then we
are definitely looking for a class-name. */
@@ -6885,7 +7136,8 @@ cp_parser_mem_initializer_id (cp_parser* parser)
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency_p=*/true,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ /*is_declaration=*/true);
/* Otherwise, we could also be looking for an ordinary identifier. */
cp_parser_parse_tentatively (parser);
/* Try a class-name. */
@@ -6894,7 +7146,8 @@ cp_parser_mem_initializer_id (cp_parser* parser)
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency_p=*/true,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ /*is_declaration=*/true);
/* If we found one, we're done. */
if (cp_parser_parse_definitely (parser))
return id;
@@ -7306,7 +7559,8 @@ cp_parser_template_parameter (cp_parser* parser)
of the template parameter-list rather than a greater-than
operator. */
return
- cp_parser_parameter_declaration (parser, /*template_parm_p=*/true);
+ cp_parser_parameter_declaration (parser, /*template_parm_p=*/true,
+ /*parenthesized_p=*/NULL);
}
/* Parse a type-parameter.
@@ -7458,18 +7712,16 @@ cp_parser_type_parameter (cp_parser* parser)
static tree
cp_parser_template_id (cp_parser *parser,
bool template_keyword_p,
- bool check_dependency_p)
+ bool check_dependency_p,
+ bool is_declaration)
{
tree template;
tree arguments;
- tree saved_scope;
- tree saved_qualifying_scope;
- tree saved_object_scope;
tree template_id;
- bool saved_greater_than_is_operator_p;
ptrdiff_t start_of_id;
tree access_check = NULL_TREE;
cp_token *next_token;
+ bool is_identifier;
/* If the next token corresponds to a template-id, there is no need
to reparse it. */
@@ -7514,12 +7766,15 @@ cp_parser_template_id (cp_parser *parser,
push_deferring_access_checks (dk_deferred);
/* Parse the template-name. */
+ is_identifier = false;
template = cp_parser_template_name (parser, template_keyword_p,
- check_dependency_p);
- if (template == error_mark_node)
+ check_dependency_p,
+ is_declaration,
+ &is_identifier);
+ if (template == error_mark_node || is_identifier)
{
pop_deferring_access_checks ();
- return error_mark_node;
+ return template;
}
/* Look for the `<' that starts the template-argument-list. */
@@ -7529,33 +7784,8 @@ cp_parser_template_id (cp_parser *parser,
return error_mark_node;
}
- /* [temp.names]
-
- When parsing a template-id, the first non-nested `>' is taken as
- the end of the template-argument-list rather than a greater-than
- operator. */
- saved_greater_than_is_operator_p
- = parser->greater_than_is_operator_p;
- parser->greater_than_is_operator_p = false;
- /* Parsing the argument list may modify SCOPE, so we save it
- here. */
- saved_scope = parser->scope;
- saved_qualifying_scope = parser->qualifying_scope;
- saved_object_scope = parser->object_scope;
- /* Parse the template-argument-list itself. */
- if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER))
- arguments = NULL_TREE;
- else
- arguments = cp_parser_template_argument_list (parser);
- /* Look for the `>' that ends the template-argument-list. */
- cp_parser_require (parser, CPP_GREATER, "`>'");
- /* The `>' token might be a greater-than operator again now. */
- parser->greater_than_is_operator_p
- = saved_greater_than_is_operator_p;
- /* Restore the SAVED_SCOPE. */
- parser->scope = saved_scope;
- parser->qualifying_scope = saved_qualifying_scope;
- parser->object_scope = saved_object_scope;
+ /* Parse the arguments. */
+ arguments = cp_parser_enclosed_template_argument_list (parser);
/* Build a representation of the specialization. */
if (TREE_CODE (template) == IDENTIFIER_NODE)
@@ -7641,7 +7871,9 @@ cp_parser_template_id (cp_parser *parser,
static tree
cp_parser_template_name (cp_parser* parser,
bool template_keyword_p,
- bool check_dependency_p)
+ bool check_dependency_p,
+ bool is_declaration,
+ bool *is_identifier)
{
tree identifier;
tree decl;
@@ -7679,9 +7911,70 @@ cp_parser_template_name (cp_parser* parser,
correctly. We would treat `S' as a template -- if it were `S<T>'
-- but we do not if there is no `<'. */
- if (template_keyword_p && processing_template_decl
+
+ if (processing_template_decl
&& cp_lexer_next_token_is (parser->lexer, CPP_LESS))
- return identifier;
+ {
+ /* In a declaration, in a dependent context, we pretend that the
+ "template" keyword was present in order to improve error
+ recovery. For example, given:
+
+ template <typename T> void f(T::X<int>);
+
+ we want to treat "X<int>" as a template-id. */
+ if (is_declaration
+ && !template_keyword_p
+ && parser->scope && TYPE_P (parser->scope)
+ && dependent_type_p (parser->scope))
+ {
+ ptrdiff_t start;
+ cp_token* token;
+ /* Explain what went wrong. */
+ error ("non-template `%D' used as template", identifier);
+ error ("(use `%T::template %D' to indicate that it is a template)",
+ parser->scope, identifier);
+ /* If parsing tentatively, find the location of the "<"
+ token. */
+ if (cp_parser_parsing_tentatively (parser)
+ && !cp_parser_committed_to_tentative_parse (parser))
+ {
+ cp_parser_simulate_error (parser);
+ token = cp_lexer_peek_token (parser->lexer);
+ token = cp_lexer_prev_token (parser->lexer, token);
+ start = cp_lexer_token_difference (parser->lexer,
+ parser->lexer->first_token,
+ token);
+ }
+ else
+ start = -1;
+ /* Parse the template arguments so that we can issue error
+ messages about them. */
+ cp_lexer_consume_token (parser->lexer);
+ cp_parser_enclosed_template_argument_list (parser);
+ /* Skip tokens until we find a good place from which to
+ continue parsing. */
+ cp_parser_skip_to_closing_parenthesis (parser,
+ /*recovering=*/true,
+ /*or_comma=*/true,
+ /*consume_paren=*/false);
+ /* If parsing tentatively, permanently remove the
+ template argument list. That will prevent duplicate
+ error messages from being issued about the missing
+ "template" keyword. */
+ if (start >= 0)
+ {
+ token = cp_lexer_advance_token (parser->lexer,
+ parser->lexer->first_token,
+ start);
+ cp_lexer_purge_tokens_after (parser->lexer, token);
+ }
+ if (is_identifier)
+ *is_identifier = true;
+ return identifier;
+ }
+ if (template_keyword_p)
+ return identifier;
+ }
/* Look up the name. */
decl = cp_parser_lookup_name (parser, identifier,
@@ -7745,7 +8038,10 @@ cp_parser_template_argument_list (cp_parser* parser)
unsigned alloced = 10;
tree *arg_ary = fixed_args;
tree vec;
+ bool saved_in_template_argument_list_p;
+ saved_in_template_argument_list_p = parser->in_template_argument_list_p;
+ parser->in_template_argument_list_p = true;
do
{
tree argument;
@@ -7779,6 +8075,7 @@ cp_parser_template_argument_list (cp_parser* parser)
if (arg_ary != fixed_args)
free (arg_ary);
+ parser->in_template_argument_list_p = saved_in_template_argument_list_p;
return vec;
}
@@ -7804,6 +8101,7 @@ cp_parser_template_argument (cp_parser* parser)
tree argument;
bool template_p;
bool address_p;
+ bool maybe_type_id = false;
cp_token *token;
cp_id_kind idk;
tree qualifying_class;
@@ -7820,13 +8118,35 @@ cp_parser_template_argument (cp_parser* parser)
Therefore, we try a type-id first. */
cp_parser_parse_tentatively (parser);
argument = cp_parser_type_id (parser);
- /* If the next token isn't a `,' or a `>', then this argument wasn't
- really finished. */
- if (!cp_parser_next_token_ends_template_argument_p (parser))
- cp_parser_error (parser, "expected template-argument");
- /* If that worked, we're done. */
- if (cp_parser_parse_definitely (parser))
- return argument;
+ /* If there was no error parsing the type-id but the next token is a '>>',
+ we probably found a typo for '> >'. But there are type-id which are
+ also valid expressions. For instance:
+
+ struct X { int operator >> (int); };
+ template <int V> struct Foo {};
+ Foo<X () >> 5> r;
+
+ Here 'X()' is a valid type-id of a function type, but the user just
+ wanted to write the expression "X() >> 5". Thus, we remember that we
+ found a valid type-id, but we still try to parse the argument as an
+ expression to see what happens. */
+ if (!cp_parser_error_occurred (parser)
+ && cp_lexer_next_token_is (parser->lexer, CPP_RSHIFT))
+ {
+ maybe_type_id = true;
+ cp_parser_abort_tentative_parse (parser);
+ }
+ else
+ {
+ /* If the next token isn't a `,' or a `>', then this argument wasn't
+ really finished. This means that the argument is not a valid
+ type-id. */
+ if (!cp_parser_next_token_ends_template_argument_p (parser))
+ cp_parser_error (parser, "expected template-argument");
+ /* If that worked, we're done. */
+ if (cp_parser_parse_definitely (parser))
+ return argument;
+ }
/* We're still not sure what the argument will be. */
cp_parser_parse_tentatively (parser);
/* Try a template. */
@@ -7941,12 +8261,27 @@ cp_parser_template_argument (cp_parser* parser)
cp_parser_error (parser, "invalid non-type template argument");
return error_mark_node;
}
- /* The argument must be a constant-expression. */
+ /* If the argument wasn't successfully parsed as a type-id followed
+ by '>>', the argument can only be a constant expression now.
+ Otherwise, we try parsing the constant-expression tentatively,
+ because the argument could really be a type-id. */
+ if (maybe_type_id)
+ cp_parser_parse_tentatively (parser);
argument = cp_parser_constant_expression (parser,
/*allow_non_constant_p=*/false,
/*non_constant_p=*/NULL);
- /* If it's non-dependent, simplify it. */
- return cp_parser_fold_non_dependent_expr (argument);
+ argument = cp_parser_fold_non_dependent_expr (argument);
+ if (!maybe_type_id)
+ return argument;
+ if (!cp_parser_next_token_ends_template_argument_p (parser))
+ cp_parser_error (parser, "expected template-argument");
+ if (cp_parser_parse_definitely (parser))
+ return argument;
+ /* We did our best to parse the argument as a non type-id, but that
+ was the only alternative that matched (albeit with a '>' after
+ it). We can assume it's just a typo from the user, and a
+ diagnostic will then be issued. */
+ return cp_parser_type_id (parser);
}
/* Parse an explicit-instantiation.
@@ -8025,7 +8360,8 @@ cp_parser_explicit_instantiation (cp_parser* parser)
/* Parse the declarator. */
declarator
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
- /*ctor_dtor_or_conv_p=*/NULL);
+ /*ctor_dtor_or_conv_p=*/NULL,
+ /*parenthesized_p=*/NULL);
cp_parser_check_for_definition_in_return_type (declarator,
declares_class_or_enum);
decl = grokdeclarator (declarator, decl_specifiers,
@@ -8344,7 +8680,8 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags,
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/false);
/* If we have seen a nested-name-specifier, and the next token
is `template', then we are using the template-id production. */
if (parser->scope
@@ -8353,7 +8690,8 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags,
/* Look for the template-id. */
type = cp_parser_template_id (parser,
/*template_keyword_p=*/true,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ /*is_declaration=*/false);
/* If the template-id did not name a type, we are out of
luck. */
if (TREE_CODE (type) != TYPE_DECL)
@@ -8364,12 +8702,7 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags,
}
/* Otherwise, look for a type-name. */
else
- {
- type = cp_parser_type_name (parser);
- if (type == error_mark_node)
- type = NULL_TREE;
- }
-
+ type = cp_parser_type_name (parser);
/* If it didn't work out, we don't have a TYPE. */
if ((flags & CP_PARSER_FLAGS_OPTIONAL)
&& !cp_parser_parse_definitely (parser))
@@ -8383,6 +8716,12 @@ cp_parser_simple_type_specifier (cp_parser* parser, cp_parser_flags flags,
return error_mark_node;
}
+ /* There is no valid C++ program where a non-template type is
+ followed by a "<". That usually indicates that the user thought
+ that the type was a template. */
+ if (type && type != error_mark_node)
+ cp_parser_check_for_invalid_template_id (parser, TREE_TYPE (type));
+
return type;
}
@@ -8415,7 +8754,8 @@ cp_parser_type_name (cp_parser* parser)
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency_p=*/true,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ /*is_declaration=*/false);
/* If it's not a class-name, keep looking. */
if (!cp_parser_parse_definitely (parser))
{
@@ -8429,7 +8769,9 @@ cp_parser_type_name (cp_parser* parser)
/* Issue an error if we did not find a type-name. */
if (TREE_CODE (type_decl) != TYPE_DECL)
{
- cp_parser_error (parser, "expected type-name");
+ if (!cp_parser_simulate_error (parser))
+ cp_parser_name_lookup_error (parser, identifier, type_decl,
+ "is not a type");
type_decl = error_mark_node;
}
/* Remember that the name was used in the definition of the
@@ -8456,6 +8798,14 @@ cp_parser_type_name (cp_parser* parser)
typename :: [opt] nested-name-specifier template [opt]
template-id
+ GNU extension:
+
+ elaborated-type-specifier:
+ class-key attributes :: [opt] nested-name-specifier [opt] identifier
+ class-key attributes :: [opt] nested-name-specifier [opt]
+ template [opt] template-id
+ enum attributes :: [opt] nested-name-specifier [opt] identifier
+
If IS_FRIEND is TRUE, then this elaborated-type-specifier is being
declared `friend'. If IS_DECLARATION is TRUE, then this
elaborated-type-specifier appears in a decl-specifiers-seq, i.e.,
@@ -8471,6 +8821,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
enum tag_types tag_type;
tree identifier;
tree type = NULL_TREE;
+ tree attributes = NULL_TREE;
/* See if we're looking at the `enum' keyword. */
if (cp_lexer_next_token_is_keyword (parser->lexer, RID_ENUM))
@@ -8479,6 +8830,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
cp_lexer_consume_token (parser->lexer);
/* Remember that it's an enumeration type. */
tag_type = enum_type;
+ /* Parse the attributes. */
+ attributes = cp_parser_attributes_opt (parser);
}
/* Or, it might be `typename'. */
else if (cp_lexer_next_token_is_keyword (parser->lexer,
@@ -8498,6 +8851,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
tag_type = cp_parser_class_key (parser);
if (tag_type == none_type)
return error_mark_node;
+ /* Parse the attributes. */
+ attributes = cp_parser_attributes_opt (parser);
}
/* Look for the `::' operator. */
@@ -8509,7 +8864,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
if (cp_parser_nested_name_specifier (parser,
/*typename_keyword_p=*/true,
/*check_dependency_p=*/true,
- /*type_p=*/true)
+ /*type_p=*/true,
+ is_declaration)
== error_mark_node)
return error_mark_node;
}
@@ -8520,7 +8876,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/true,
/*check_dependency_p=*/true,
- /*type_p=*/true);
+ /*type_p=*/true,
+ is_declaration);
/* For everything but enumeration types, consider a template-id. */
if (tag_type != enum_type)
{
@@ -8535,7 +8892,8 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
cp_parser_parse_tentatively (parser);
/* Parse the template-id. */
decl = cp_parser_template_id (parser, template_p,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ is_declaration);
/* If we didn't find a template-id, look for an ordinary
identifier. */
if (!template_p && !cp_parser_parse_definitely (parser))
@@ -8664,7 +9022,7 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
declaration context. */
type = xref_tag (tag_type, identifier,
- /*attributes=*/NULL_TREE,
+ attributes,
(is_friend
|| !is_declaration
|| cp_lexer_next_token_is_not (parser->lexer,
@@ -8674,6 +9032,11 @@ cp_parser_elaborated_type_specifier (cp_parser* parser,
}
if (tag_type != enum_type)
cp_parser_check_class_key (tag_type, type);
+
+ /* A "<" cannot follow an elaborated type specifier. If that
+ happens, the user was probably trying to form a template-id. */
+ cp_parser_check_for_invalid_template_id (parser, type);
+
return type;
}
@@ -8963,7 +9326,8 @@ cp_parser_qualified_namespace_specifier (cp_parser* parser)
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/true);
return cp_parser_namespace_name (parser);
}
@@ -9009,14 +9373,16 @@ cp_parser_using_declaration (cp_parser* parser)
if (typename_p || !global_scope_p)
cp_parser_nested_name_specifier (parser, typename_p,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/true);
/* Otherwise, we could be in either of the two productions. In that
case, treat the nested-name-specifier as optional. */
else
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/true);
/* Parse the unqualified-id. */
identifier = cp_parser_unqualified_id (parser,
@@ -9050,13 +9416,7 @@ cp_parser_using_declaration (cp_parser* parser)
{
decl = cp_parser_lookup_name_simple (parser, identifier);
if (decl == error_mark_node)
- {
- if (parser->scope && parser->scope != global_namespace)
- error ("`%D::%D' has not been declared",
- parser->scope, identifier);
- else
- error ("`::%D' has not been declared", identifier);
- }
+ cp_parser_name_lookup_error (parser, identifier, decl, NULL);
else if (scope)
do_local_using_decl (decl);
else
@@ -9078,6 +9438,7 @@ static void
cp_parser_using_directive (cp_parser* parser)
{
tree namespace_decl;
+ tree attribs;
/* Look for the `using' keyword. */
cp_parser_require_keyword (parser, RID_USING, "`using'");
@@ -9089,11 +9450,14 @@ cp_parser_using_directive (cp_parser* parser)
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/true);
/* Get the namespace being used. */
namespace_decl = cp_parser_namespace_name (parser);
+ /* And any specified attributes. */
+ attribs = cp_parser_attributes_opt (parser);
/* Update the symbol table. */
- do_using_directive (namespace_decl);
+ parse_using_directive (namespace_decl, attribs);
/* Look for the final `;'. */
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
}
@@ -9219,7 +9583,8 @@ cp_parser_asm_definition (cp_parser* parser)
}
/* Look for the closing `)'. */
if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"))
- cp_parser_skip_to_closing_parenthesis (parser, true, false);
+ cp_parser_skip_to_closing_parenthesis (parser, true, false,
+ /*consume_paren=*/true);
cp_parser_require (parser, CPP_SEMICOLON, "`;'");
/* Create the ASM_STMT. */
@@ -9249,6 +9614,16 @@ cp_parser_asm_definition (cp_parser* parser)
init-declarator:
declarator asm-specification [opt] attributes [opt] initializer [opt]
+ function-definition:
+ decl-specifier-seq [opt] declarator ctor-initializer [opt]
+ function-body
+ decl-specifier-seq [opt] declarator function-try-block
+
+ GNU Extension:
+
+ function-definition:
+ __extension__ function-definition
+
The DECL_SPECIFIERS and PREFIX_ATTRIBUTES apply to this declarator.
Returns a representation of the entity declared. If MEMBER_P is TRUE,
then this declarator appears in a class scope. The new DECL created
@@ -9298,7 +9673,8 @@ cp_parser_init_declarator (cp_parser* parser,
/* Parse the declarator. */
declarator
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
- &ctor_dtor_or_conv_p);
+ &ctor_dtor_or_conv_p,
+ /*parenthesized_p=*/NULL);
/* Gather up the deferred checks. */
stop_deferring_access_checks ();
@@ -9356,8 +9732,15 @@ cp_parser_init_declarator (cp_parser* parser,
*function_definition_p = true;
/* Parse the function definition. */
- decl = (cp_parser_function_definition_from_specifiers_and_declarator
- (parser, decl_specifiers, prefix_attributes, declarator));
+ if (member_p)
+ decl = cp_parser_save_member_function_body (parser,
+ decl_specifiers,
+ declarator,
+ prefix_attributes);
+ else
+ decl
+ = (cp_parser_function_definition_from_specifiers_and_declarator
+ (parser, decl_specifiers, prefix_attributes, declarator));
return decl;
}
@@ -9560,12 +9943,16 @@ cp_parser_init_declarator (cp_parser* parser,
semantic analysis, rather than parsing, but that makes it difficult
to handle something like `f()'. We want to notice that there are
no decl-specifiers, and therefore realize that this is an
- expression, not a declaration.) */
+ expression, not a declaration.)
+
+ If PARENTHESIZED_P is non-NULL, *PARENTHESIZED_P is set to true iff
+ the declarator is a direct-declarator of the form "(...)". */
static tree
cp_parser_declarator (cp_parser* parser,
cp_parser_declarator_kind dcl_kind,
- int* ctor_dtor_or_conv_p)
+ int* ctor_dtor_or_conv_p,
+ bool* parenthesized_p)
{
cp_token *token;
tree declarator;
@@ -9594,6 +9981,10 @@ cp_parser_declarator (cp_parser* parser,
/* If that worked, then we have a ptr-operator. */
if (cp_parser_parse_definitely (parser))
{
+ /* If a ptr-operator was found, then this declarator was not
+ parenthesized. */
+ if (parenthesized_p)
+ *parenthesized_p = true;
/* The dependent declarator is optional if we are parsing an
abstract-declarator. */
if (dcl_kind != CP_PARSER_DECLARATOR_NAMED)
@@ -9601,7 +9992,8 @@ cp_parser_declarator (cp_parser* parser,
/* Parse the dependent declarator. */
declarator = cp_parser_declarator (parser, dcl_kind,
- /*ctor_dtor_or_conv_p=*/NULL);
+ /*ctor_dtor_or_conv_p=*/NULL,
+ /*parenthesized_p=*/NULL);
/* If we are parsing an abstract-declarator, we must handle the
case where the dependent declarator is absent. */
@@ -9622,8 +10014,13 @@ cp_parser_declarator (cp_parser* parser,
}
/* Everything else is a direct-declarator. */
else
- declarator = cp_parser_direct_declarator (parser, dcl_kind,
- ctor_dtor_or_conv_p);
+ {
+ if (parenthesized_p)
+ *parenthesized_p = cp_lexer_next_token_is (parser->lexer,
+ CPP_OPEN_PAREN);
+ declarator = cp_parser_direct_declarator (parser, dcl_kind,
+ ctor_dtor_or_conv_p);
+ }
if (attributes && declarator != error_mark_node)
declarator = tree_cons (attributes, declarator, NULL_TREE);
@@ -9797,7 +10194,8 @@ cp_parser_direct_declarator (cp_parser* parser,
cp_lexer_consume_token (parser->lexer);
/* Parse the nested declarator. */
declarator
- = cp_parser_declarator (parser, dcl_kind, ctor_dtor_or_conv_p);
+ = cp_parser_declarator (parser, dcl_kind, ctor_dtor_or_conv_p,
+ /*parenthesized_p=*/NULL);
first = false;
/* Expect a `)'. */
if (!cp_parser_require (parser, CPP_CLOSE_PAREN, "`)'"))
@@ -9853,7 +10251,7 @@ cp_parser_direct_declarator (cp_parser* parser,
}
else if (first && dcl_kind != CP_PARSER_DECLARATOR_ABSTRACT)
{
- /* Parse a declarator_id */
+ /* Parse a declarator-id */
if (dcl_kind == CP_PARSER_DECLARATOR_EITHER)
cp_parser_parse_tentatively (parser);
declarator = cp_parser_declarator_id (parser);
@@ -10040,7 +10438,8 @@ cp_parser_ptr_operator (cp_parser* parser,
cp_parser_nested_name_specifier (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/true,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/false);
/* If we found it, and the next token is a `*', then we are
indeed looking at a pointer-to-member operator. */
if (!cp_parser_error_occurred (parser)
@@ -10207,7 +10606,8 @@ cp_parser_type_id (cp_parser* parser)
cp_parser_parse_tentatively (parser);
/* Look for the declarator. */
abstract_declarator
- = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_ABSTRACT, NULL);
+ = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_ABSTRACT, NULL,
+ /*parenthesized_p=*/NULL);
/* Check to see if there really was a declarator. */
if (!cp_parser_parse_definitely (parser))
abstract_declarator = NULL_TREE;
@@ -10383,9 +10783,12 @@ cp_parser_parameter_declaration_list (cp_parser* parser)
while (true)
{
tree parameter;
+ bool parenthesized_p;
/* Parse the parameter. */
parameter
- = cp_parser_parameter_declaration (parser, /*template_parm_p=*/false);
+ = cp_parser_parameter_declaration (parser,
+ /*template_parm_p=*/false,
+ &parenthesized_p);
/* If a parse error occurred parsing the parameter declaration,
then the entire parameter-declaration-list is erroneous. */
@@ -10415,10 +10818,37 @@ cp_parser_parameter_declaration_list (cp_parser* parser)
/* Otherwise, there must be more parameters. Consume the
`,'. */
cp_lexer_consume_token (parser->lexer);
+ /* When parsing something like:
+
+ int i(float f, double d)
+
+ we can tell after seeing the declaration for "f" that we
+ are not looking at an initialization of a variable "i",
+ but rather at the declaration of a function "i".
+
+ Due to the fact that the parsing of template arguments
+ (as specified to a template-id) requires backtracking we
+ cannot use this technique when inside a template argument
+ list. */
+ if (!parser->in_template_argument_list_p
+ && cp_parser_parsing_tentatively (parser)
+ && !cp_parser_committed_to_tentative_parse (parser)
+ /* However, a parameter-declaration of the form
+ "foat(f)" (which is a valid declaration of a
+ parameter "f") can also be interpreted as an
+ expression (the conversion of "f" to "float"). */
+ && !parenthesized_p)
+ cp_parser_commit_to_tentative_parse (parser);
}
else
{
cp_parser_error (parser, "expected `,' or `...'");
+ if (!cp_parser_parsing_tentatively (parser)
+ || cp_parser_committed_to_tentative_parse (parser))
+ cp_parser_skip_to_closing_parenthesis (parser,
+ /*recovering=*/true,
+ /*or_comma=*/false,
+ /*consume_paren=*/false);
break;
}
}
@@ -10441,14 +10871,18 @@ cp_parser_parameter_declaration_list (cp_parser* parser)
is not interpreted as a greater-than operator.)
Returns a TREE_LIST representing the parameter-declaration. The
- TREE_VALUE is a representation of the decl-specifier-seq and
- declarator. In particular, the TREE_VALUE will be a TREE_LIST
- whose TREE_PURPOSE represents the decl-specifier-seq and whose
- TREE_VALUE represents the declarator. */
+ TREE_PURPOSE is the default argument expression, or NULL_TREE if
+ there is no default argument. The TREE_VALUE is a representation
+ of the decl-specifier-seq and declarator. In particular, the
+ TREE_VALUE will be a TREE_LIST whose TREE_PURPOSE represents the
+ decl-specifier-seq and whose TREE_VALUE represents the declarator.
+ If PARENTHESIZED_P is non-NULL, *PARENTHESIZED_P is set to true iff
+ the declarator is of the form "(p)". */
static tree
cp_parser_parameter_declaration (cp_parser *parser,
- bool template_parm_p)
+ bool template_parm_p,
+ bool *parenthesized_p)
{
int declares_class_or_enum;
bool greater_than_is_operator_p;
@@ -10498,16 +10932,31 @@ cp_parser_parameter_declaration (cp_parser *parser,
|| token->type == CPP_EQ
|| token->type == CPP_ELLIPSIS
|| token->type == CPP_GREATER)
- declarator = NULL_TREE;
+ {
+ declarator = NULL_TREE;
+ if (parenthesized_p)
+ *parenthesized_p = false;
+ }
/* Otherwise, there should be a declarator. */
else
{
bool saved_default_arg_ok_p = parser->default_arg_ok_p;
parser->default_arg_ok_p = false;
+ /* After seeing a decl-specifier-seq, if the next token is not a
+ "(", there is no possibility that the code is a valid
+ expression initializer. Therefore, if parsing tentatively,
+ we commit at this point. */
+ if (!parser->in_template_argument_list_p
+ && cp_parser_parsing_tentatively (parser)
+ && !cp_parser_committed_to_tentative_parse (parser)
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_PAREN))
+ cp_parser_commit_to_tentative_parse (parser);
+ /* Parse the declarator. */
declarator = cp_parser_declarator (parser,
CP_PARSER_DECLARATOR_EITHER,
- /*ctor_dtor_or_conv_p=*/NULL);
+ /*ctor_dtor_or_conv_p=*/NULL,
+ parenthesized_p);
parser->default_arg_ok_p = saved_default_arg_ok_p;
/* After the declarator, allow more attributes. */
attributes = chainon (attributes, cp_parser_attributes_opt (parser));
@@ -10661,184 +11110,6 @@ cp_parser_parameter_declaration (cp_parser *parser,
return parameter;
}
-/* Parse a function-definition.
-
- function-definition:
- decl-specifier-seq [opt] declarator ctor-initializer [opt]
- function-body
- decl-specifier-seq [opt] declarator function-try-block
-
- GNU Extension:
-
- function-definition:
- __extension__ function-definition
-
- Returns the FUNCTION_DECL for the function. If FRIEND_P is
- non-NULL, *FRIEND_P is set to TRUE iff the function was declared to
- be a `friend'. */
-
-static tree
-cp_parser_function_definition (cp_parser* parser, bool* friend_p)
-{
- tree decl_specifiers;
- tree attributes;
- tree declarator;
- tree fn;
- cp_token *token;
- int declares_class_or_enum;
- bool member_p;
- /* The saved value of the PEDANTIC flag. */
- int saved_pedantic;
-
- /* Any pending qualification must be cleared by our caller. It is
- more robust to force the callers to clear PARSER->SCOPE than to
- do it here since if the qualification is in effect here, it might
- also end up in effect elsewhere that it is not intended. */
- my_friendly_assert (!parser->scope, 20010821);
-
- /* Handle `__extension__'. */
- if (cp_parser_extension_opt (parser, &saved_pedantic))
- {
- /* Parse the function-definition. */
- fn = cp_parser_function_definition (parser, friend_p);
- /* Restore the PEDANTIC flag. */
- pedantic = saved_pedantic;
-
- return fn;
- }
-
- /* Check to see if this definition appears in a class-specifier. */
- member_p = (at_class_scope_p ()
- && TYPE_BEING_DEFINED (current_class_type));
- /* Defer access checks in the decl-specifier-seq until we know what
- function is being defined. There is no need to do this for the
- definition of member functions; we cannot be defining a member
- from another class. */
- push_deferring_access_checks (member_p ? dk_no_check: dk_deferred);
-
- /* Parse the decl-specifier-seq. */
- decl_specifiers
- = cp_parser_decl_specifier_seq (parser,
- CP_PARSER_FLAGS_OPTIONAL,
- &attributes,
- &declares_class_or_enum);
- /* Figure out whether this declaration is a `friend'. */
- if (friend_p)
- *friend_p = cp_parser_friend_p (decl_specifiers);
-
- /* Parse the declarator. */
- declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
- /*ctor_dtor_or_conv_p=*/NULL);
-
- /* Gather up any access checks that occurred. */
- stop_deferring_access_checks ();
-
- /* If something has already gone wrong, we may as well stop now. */
- if (declarator == error_mark_node)
- {
- /* Skip to the end of the function, or if this wasn't anything
- like a function-definition, to a `;' in the hopes of finding
- a sensible place from which to continue parsing. */
- cp_parser_skip_to_end_of_block_or_statement (parser);
- pop_deferring_access_checks ();
- return error_mark_node;
- }
-
- /* The next character should be a `{' (for a simple function
- definition), a `:' (for a ctor-initializer), or `try' (for a
- function-try block). */
- token = cp_lexer_peek_token (parser->lexer);
- if (!cp_parser_token_starts_function_definition_p (token))
- {
- /* Issue the error-message. */
- cp_parser_error (parser, "expected function-definition");
- /* Skip to the next `;'. */
- cp_parser_skip_to_end_of_block_or_statement (parser);
-
- pop_deferring_access_checks ();
- return error_mark_node;
- }
-
- cp_parser_check_for_definition_in_return_type (declarator,
- declares_class_or_enum);
-
- /* If we are in a class scope, then we must handle
- function-definitions specially. In particular, we save away the
- tokens that make up the function body, and parse them again
- later, in order to handle code like:
-
- struct S {
- int f () { return i; }
- int i;
- };
-
- Here, we cannot parse the body of `f' until after we have seen
- the declaration of `i'. */
- if (member_p)
- {
- cp_token_cache *cache;
-
- /* Create the function-declaration. */
- fn = start_method (decl_specifiers, declarator, attributes);
- /* If something went badly wrong, bail out now. */
- if (fn == error_mark_node)
- {
- /* If there's a function-body, skip it. */
- if (cp_parser_token_starts_function_definition_p
- (cp_lexer_peek_token (parser->lexer)))
- cp_parser_skip_to_end_of_block_or_statement (parser);
- pop_deferring_access_checks ();
- return error_mark_node;
- }
-
- /* Remember it, if there default args to post process. */
- cp_parser_save_default_args (parser, fn);
-
- /* Create a token cache. */
- cache = cp_token_cache_new ();
- /* Save away the tokens that make up the body of the
- function. */
- cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0);
- /* Handle function try blocks. */
- while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH))
- cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0);
-
- /* Save away the inline definition; we will process it when the
- class is complete. */
- DECL_PENDING_INLINE_INFO (fn) = cache;
- DECL_PENDING_INLINE_P (fn) = 1;
-
- /* We need to know that this was defined in the class, so that
- friend templates are handled correctly. */
- DECL_INITIALIZED_IN_CLASS_P (fn) = 1;
-
- /* We're done with the inline definition. */
- finish_method (fn);
-
- /* Add FN to the queue of functions to be parsed later. */
- TREE_VALUE (parser->unparsed_functions_queues)
- = tree_cons (NULL_TREE, fn,
- TREE_VALUE (parser->unparsed_functions_queues));
-
- pop_deferring_access_checks ();
- return fn;
- }
-
- /* Check that the number of template-parameter-lists is OK. */
- if (!cp_parser_check_declarator_template_parameters (parser,
- declarator))
- {
- cp_parser_skip_to_end_of_block_or_statement (parser);
- pop_deferring_access_checks ();
- return error_mark_node;
- }
-
- fn = cp_parser_function_definition_from_specifiers_and_declarator
- (parser, decl_specifiers, attributes, declarator);
- pop_deferring_access_checks ();
- return fn;
-}
-
/* Parse a function-body.
function-body:
@@ -11085,7 +11356,8 @@ cp_parser_class_name (cp_parser *parser,
bool template_keyword_p,
bool type_p,
bool check_dependency_p,
- bool class_head_p)
+ bool class_head_p,
+ bool is_declaration)
{
tree decl;
tree scope;
@@ -11150,7 +11422,8 @@ cp_parser_class_name (cp_parser *parser,
{
/* Try a template-id. */
decl = cp_parser_template_id (parser, template_keyword_p,
- check_dependency_p);
+ check_dependency_p,
+ is_declaration);
if (decl == error_mark_node)
return error_mark_node;
}
@@ -11237,6 +11510,8 @@ cp_parser_class_specifier (cp_parser* parser)
parser->num_template_parameter_lists = 0;
/* Start the class. */
+ if (nested_name_specifier_p)
+ push_scope (CP_DECL_CONTEXT (TYPE_MAIN_DECL (type)));
type = begin_class_definition (type);
if (type == error_mark_node)
/* If the type is erroneous, skip the entire body of the class. */
@@ -11374,6 +11649,7 @@ cp_parser_class_head (cp_parser* parser,
bool template_id_p = false;
bool qualified_p = false;
bool invalid_nested_name_p = false;
+ bool invalid_explicit_specialization_p = false;
unsigned num_templates;
/* Assume no nested-name-specifier will be present. */
@@ -11410,7 +11686,8 @@ cp_parser_class_head (cp_parser* parser,
= cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/false,
- /*type_p=*/false);
+ /*type_p=*/false,
+ /*is_declaration=*/false);
/* If there was a nested-name-specifier, then there *must* be an
identifier. */
if (nested_name_specifier)
@@ -11438,7 +11715,8 @@ cp_parser_class_head (cp_parser* parser,
/*template_keyword_p=*/false,
/*type_p=*/true,
/*check_dependency_p=*/false,
- /*class_head_p=*/true);
+ /*class_head_p=*/true,
+ /*is_declaration=*/false);
/* If that didn't work, ignore the nested-name-specifier. */
if (!cp_parser_parse_definitely (parser))
{
@@ -11479,7 +11757,8 @@ cp_parser_class_head (cp_parser* parser,
/* Check for a template-id. */
id = cp_parser_template_id (parser,
/*template_keyword_p=*/false,
- /*check_dependency_p=*/true);
+ /*check_dependency_p=*/true,
+ /*is_declaration=*/true);
/* If that didn't work, it could still be an identifier. */
if (!cp_parser_parse_definitely (parser))
{
@@ -11497,6 +11776,8 @@ cp_parser_class_head (cp_parser* parser,
pop_deferring_access_checks ();
+ cp_parser_check_for_invalid_template_id (parser, id);
+
/* If it's not a `:' or a `{' then we can't really be looking at a
class-head, since a class-head only appears as part of a
class-specifier. We have to detect this situation before calling
@@ -11517,12 +11798,31 @@ cp_parser_class_head (cp_parser* parser,
else if (invalid_nested_name_p)
cp_parser_error (parser,
"qualified name does not name a class");
+ /* An explicit-specialization must be preceded by "template <>". If
+ it is not, try to recover gracefully. */
+ if (at_namespace_scope_p ()
+ && parser->num_template_parameter_lists == 0
+ && template_id_p)
+ {
+ error ("an explicit specialization must be preceded by 'template <>'");
+ invalid_explicit_specialization_p = true;
+ /* Take the same action that would have been taken by
+ cp_parser_explicit_specialization. */
+ ++parser->num_template_parameter_lists;
+ begin_specialization ();
+ }
+ /* There must be no "return" statements between this point and the
+ end of this function; set "type "to the correct return value and
+ use "goto done;" to return. */
/* Make sure that the right number of template parameters were
present. */
if (!cp_parser_check_template_parameters (parser, num_templates))
- /* If something went wrong, there is no point in even trying to
- process the class-definition. */
- return NULL_TREE;
+ {
+ /* If something went wrong, there is no point in even trying to
+ process the class-definition. */
+ type = NULL_TREE;
+ goto done;
+ }
/* Look up the type. */
if (template_id_p)
@@ -11574,7 +11874,8 @@ cp_parser_class_head (cp_parser* parser,
{
error ("declaration of `%D' in `%D' which does not "
"enclose `%D'", type, scope, nested_name_specifier);
- return NULL_TREE;
+ type = NULL_TREE;
+ goto done;
}
/* [dcl.meaning]
@@ -11600,7 +11901,10 @@ cp_parser_class_head (cp_parser* parser,
type = push_template_decl (type);
type = TREE_TYPE (type);
if (nested_name_specifier)
- *nested_name_specifier_p = true;
+ {
+ *nested_name_specifier_p = true;
+ pop_scope (nested_name_specifier);
+ }
}
/* Indicate whether this class was declared as a `class' or as a
`struct'. */
@@ -11633,6 +11937,12 @@ cp_parser_class_head (cp_parser* parser,
if (nested_name_specifier)
pop_scope (nested_name_specifier);
+ done:
+ if (invalid_explicit_specialization_p)
+ {
+ end_specialization ();
+ --parser->num_template_parameter_lists;
+ }
return type;
}
@@ -11775,10 +12085,6 @@ cp_parser_member_declaration (cp_parser* parser)
return;
}
- /* We can't tell whether we're looking at a declaration or a
- function-definition. */
- cp_parser_parse_tentatively (parser);
-
/* Parse the decl-specifier-seq. */
decl_specifiers
= cp_parser_decl_specifier_seq (parser,
@@ -11945,7 +12251,8 @@ cp_parser_member_declaration (cp_parser* parser)
/* Parse the declarator. */
declarator
= cp_parser_declarator (parser, CP_PARSER_DECLARATOR_NAMED,
- &ctor_dtor_or_conv_p);
+ &ctor_dtor_or_conv_p,
+ /*parenthesized_p=*/NULL);
/* If something went wrong parsing the declarator, make sure
that we at least consume some tokens. */
@@ -11953,7 +12260,15 @@ cp_parser_member_declaration (cp_parser* parser)
{
/* Skip to the end of the statement. */
cp_parser_skip_to_end_of_statement (parser);
- break;
+ /* If the next token is not a semicolon, that is
+ probably because we just skipped over the body of
+ a function. So, we consume a semicolon if
+ present, but do not issue an error message if it
+ is not present. */
+ if (cp_lexer_next_token_is (parser->lexer,
+ CPP_SEMICOLON))
+ cp_lexer_consume_token (parser->lexer);
+ return;
}
cp_parser_check_for_definition_in_return_type
@@ -11994,13 +12309,8 @@ cp_parser_member_declaration (cp_parser* parser)
if (TREE_CODE (declarator) == CALL_EXPR)
initializer = cp_parser_pure_specifier (parser);
else
- {
- /* This declaration cannot be a function
- definition. */
- cp_parser_commit_to_tentative_parse (parser);
- /* Parse the initializer. */
- initializer = cp_parser_constant_initializer (parser);
- }
+ /* Parse the initializer. */
+ initializer = cp_parser_constant_initializer (parser);
}
/* Otherwise, there is no initializer. */
else
@@ -12013,7 +12323,28 @@ cp_parser_member_declaration (cp_parser* parser)
that we are looking at a member-declarator. */
if (cp_parser_token_starts_function_definition_p
(cp_lexer_peek_token (parser->lexer)))
- decl = error_mark_node;
+ {
+ /* The grammar does not allow a pure-specifier to be
+ used when a member function is defined. (It is
+ possible that this fact is an oversight in the
+ standard, since a pure function may be defined
+ outside of the class-specifier. */
+ if (initializer)
+ error ("pure-specifier on function-definition");
+ decl = cp_parser_save_member_function_body (parser,
+ decl_specifiers,
+ declarator,
+ attributes);
+ /* If the member was not a friend, declare it here. */
+ if (!friend_p)
+ finish_member_declaration (decl);
+ /* Peek at the next token. */
+ token = cp_lexer_peek_token (parser->lexer);
+ /* If the next token is a semicolon, consume it. */
+ if (token->type == CPP_SEMICOLON)
+ cp_lexer_consume_token (parser->lexer);
+ return;
+ }
else
{
/* Create the declaration. */
@@ -12064,23 +12395,7 @@ cp_parser_member_declaration (cp_parser* parser)
}
}
- /* If everything went well, look for the `;'. */
- if (cp_parser_parse_definitely (parser))
- {
- cp_parser_require (parser, CPP_SEMICOLON, "`;'");
- return;
- }
-
- /* Parse the function-definition. */
- decl = cp_parser_function_definition (parser, &friend_p);
- /* If the member was not a friend, declare it here. */
- if (!friend_p)
- finish_member_declaration (decl);
- /* Peek at the next token. */
- token = cp_lexer_peek_token (parser->lexer);
- /* If the next token is a semicolon, consume it. */
- if (token->type == CPP_SEMICOLON)
- cp_lexer_consume_token (parser->lexer);
+ cp_parser_require (parser, CPP_SEMICOLON, "`;'");
}
/* Parse a pure-specifier.
@@ -12300,7 +12615,8 @@ cp_parser_base_specifier (cp_parser* parser)
cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/true,
/*check_dependency_p=*/true,
- /*type_p=*/true);
+ /*type_p=*/true,
+ /*is_declaration=*/true);
/* If the base class is given by a qualified name, assume that names
we see are type names or templates, as appropriate. */
class_scope_p = (parser->scope && TYPE_P (parser->scope));
@@ -12312,7 +12628,8 @@ cp_parser_base_specifier (cp_parser* parser)
template_p,
/*type_p=*/true,
/*check_dependency_p=*/true,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ /*is_declaration=*/true);
if (type == error_mark_node)
return error_mark_node;
@@ -12538,7 +12855,8 @@ cp_parser_exception_declaration (cp_parser* parser)
declarator = NULL_TREE;
else
declarator = cp_parser_declarator (parser, CP_PARSER_DECLARATOR_EITHER,
- /*ctor_dtor_or_conv_p=*/NULL);
+ /*ctor_dtor_or_conv_p=*/NULL,
+ /*parenthesized_p=*/NULL);
/* Restore the saved message. */
parser->type_definition_forbidden_message = saved_message;
@@ -12557,15 +12875,21 @@ static tree
cp_parser_throw_expression (cp_parser* parser)
{
tree expression;
+ cp_token* token;
cp_parser_require_keyword (parser, RID_THROW, "`throw'");
- /* We can't be sure if there is an assignment-expression or not. */
- cp_parser_parse_tentatively (parser);
- /* Try it. */
- expression = cp_parser_assignment_expression (parser);
- /* If it didn't work, this is just a rethrow. */
- if (!cp_parser_parse_definitely (parser))
+ token = cp_lexer_peek_token (parser->lexer);
+ /* Figure out whether or not there is an assignment-expression
+ following the "throw" keyword. */
+ if (token->type == CPP_COMMA
+ || token->type == CPP_SEMICOLON
+ || token->type == CPP_CLOSE_PAREN
+ || token->type == CPP_CLOSE_SQUARE
+ || token->type == CPP_CLOSE_BRACE
+ || token->type == CPP_COLON)
expression = NULL_TREE;
+ else
+ expression = cp_parser_assignment_expression (parser);
return build_throw (expression);
}
@@ -13403,7 +13727,8 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
= (cp_parser_nested_name_specifier_opt (parser,
/*typename_keyword_p=*/false,
/*check_dependency_p=*/false,
- /*type_p=*/false)
+ /*type_p=*/false,
+ /*is_declaration=*/false)
!= NULL_TREE);
/* Outside of a class-specifier, there must be a
nested-name-specifier. */
@@ -13431,7 +13756,8 @@ cp_parser_constructor_declarator_p (cp_parser *parser, bool friend_p)
/*template_keyword_p=*/false,
/*type_p=*/false,
/*check_dependency_p=*/false,
- /*class_head_p=*/false);
+ /*class_head_p=*/false,
+ /*is_declaration=*/false);
/* If there was no class-name, then this is not a constructor. */
constructor_p = !cp_parser_error_occurred (parser);
}
@@ -13578,7 +13904,8 @@ cp_parser_function_definition_after_declarator (cp_parser* parser,
/* Issue an error message. */
error ("named return values are no longer supported");
/* Skip tokens until we reach the start of the function body. */
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF))
cp_lexer_consume_token (parser->lexer);
}
/* The `extern' in `extern "C" void f () { ... }' does not apply to
@@ -13634,19 +13961,23 @@ cp_parser_template_declaration_after_export (cp_parser* parser, bool member_p)
if (!cp_parser_require (parser, CPP_LESS, "`<'"))
return;
- /* Parse the template parameters. */
- begin_template_parm_list ();
/* If the next token is `>', then we have an invalid
specialization. Rather than complain about an invalid template
parameter, issue an error message here. */
if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER))
{
cp_parser_error (parser, "invalid explicit specialization");
+ begin_specialization ();
parameter_list = NULL_TREE;
}
else
- parameter_list = cp_parser_template_parameter_list (parser);
- parameter_list = end_template_parm_list (parameter_list);
+ {
+ /* Parse the template parameters. */
+ begin_template_parm_list ();
+ parameter_list = cp_parser_template_parameter_list (parser);
+ parameter_list = end_template_parm_list (parameter_list);
+ }
+
/* Look for the `>'. */
cp_parser_skip_until_found (parser, CPP_GREATER, "`>'");
/* We just processed one more parameter list. */
@@ -13712,10 +14043,8 @@ cp_parser_single_declaration (cp_parser* parser,
tree decl = NULL_TREE;
tree decl_specifiers;
tree attributes;
+ bool function_definition_p = false;
- /* Parse the dependent declaration. We don't know yet
- whether it will be a function-definition. */
- cp_parser_parse_tentatively (parser);
/* Defer access checks until we know what is being declared. */
push_deferring_access_checks (dk_deferred);
@@ -13726,6 +14055,8 @@ cp_parser_single_declaration (cp_parser* parser,
CP_PARSER_FLAGS_OPTIONAL,
&attributes,
&declares_class_or_enum);
+ if (friend_p)
+ *friend_p = cp_parser_friend_p (decl_specifiers);
/* Gather up the access checks that occurred the
decl-specifier-seq. */
stop_deferring_access_checks ();
@@ -13755,10 +14086,10 @@ cp_parser_single_declaration (cp_parser* parser,
decl = cp_parser_init_declarator (parser,
decl_specifiers,
attributes,
- /*function_definition_allowed_p=*/false,
+ /*function_definition_allowed_p=*/true,
member_p,
declares_class_or_enum,
- /*function_definition_p=*/NULL);
+ &function_definition_p);
pop_deferring_access_checks ();
@@ -13768,18 +14099,9 @@ cp_parser_single_declaration (cp_parser* parser,
parser->qualifying_scope = NULL_TREE;
parser->object_scope = NULL_TREE;
/* Look for a trailing `;' after the declaration. */
- if (!cp_parser_require (parser, CPP_SEMICOLON, "`;'")
- && cp_parser_committed_to_tentative_parse (parser))
+ if (!function_definition_p
+ && !cp_parser_require (parser, CPP_SEMICOLON, "`;'"))
cp_parser_skip_to_end_of_block_or_statement (parser);
- /* If it worked, set *FRIEND_P based on the DECL_SPECIFIERS. */
- if (cp_parser_parse_definitely (parser))
- {
- if (friend_p)
- *friend_p = cp_parser_friend_p (decl_specifiers);
- }
- /* Otherwise, try a function-definition. */
- else
- decl = cp_parser_function_definition (parser, friend_p);
return decl;
}
@@ -13807,6 +14129,132 @@ cp_parser_functional_cast (cp_parser* parser, tree type)
return build_functional_cast (type, expression_list);
}
+/* Save the tokens that make up the body of a member function defined
+ in a class-specifier. The DECL_SPECIFIERS and DECLARATOR have
+ already been parsed. The ATTRIBUTES are any GNU "__attribute__"
+ specifiers applied to the declaration. Returns the FUNCTION_DECL
+ for the member function. */
+
+tree
+cp_parser_save_member_function_body (cp_parser* parser,
+ tree decl_specifiers,
+ tree declarator,
+ tree attributes)
+{
+ cp_token_cache *cache;
+ tree fn;
+
+ /* Create the function-declaration. */
+ fn = start_method (decl_specifiers, declarator, attributes);
+ /* If something went badly wrong, bail out now. */
+ if (fn == error_mark_node)
+ {
+ /* If there's a function-body, skip it. */
+ if (cp_parser_token_starts_function_definition_p
+ (cp_lexer_peek_token (parser->lexer)))
+ cp_parser_skip_to_end_of_block_or_statement (parser);
+ return error_mark_node;
+ }
+
+ /* Remember it, if there default args to post process. */
+ cp_parser_save_default_args (parser, fn);
+
+ /* Create a token cache. */
+ cache = cp_token_cache_new ();
+ /* Save away the tokens that make up the body of the
+ function. */
+ cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0);
+ /* Handle function try blocks. */
+ while (cp_lexer_next_token_is_keyword (parser->lexer, RID_CATCH))
+ cp_parser_cache_group (parser, cache, CPP_CLOSE_BRACE, /*depth=*/0);
+
+ /* Save away the inline definition; we will process it when the
+ class is complete. */
+ DECL_PENDING_INLINE_INFO (fn) = cache;
+ DECL_PENDING_INLINE_P (fn) = 1;
+
+ /* We need to know that this was defined in the class, so that
+ friend templates are handled correctly. */
+ DECL_INITIALIZED_IN_CLASS_P (fn) = 1;
+
+ /* We're done with the inline definition. */
+ finish_method (fn);
+
+ /* Add FN to the queue of functions to be parsed later. */
+ TREE_VALUE (parser->unparsed_functions_queues)
+ = tree_cons (NULL_TREE, fn,
+ TREE_VALUE (parser->unparsed_functions_queues));
+
+ return fn;
+}
+
+/* Parse a template-argument-list, as well as the trailing ">" (but
+ not the opening ">"). See cp_parser_template_argument_list for the
+ return value. */
+
+static tree
+cp_parser_enclosed_template_argument_list (cp_parser* parser)
+{
+ tree arguments;
+ tree saved_scope;
+ tree saved_qualifying_scope;
+ tree saved_object_scope;
+ bool saved_greater_than_is_operator_p;
+
+ /* [temp.names]
+
+ When parsing a template-id, the first non-nested `>' is taken as
+ the end of the template-argument-list rather than a greater-than
+ operator. */
+ saved_greater_than_is_operator_p
+ = parser->greater_than_is_operator_p;
+ parser->greater_than_is_operator_p = false;
+ /* Parsing the argument list may modify SCOPE, so we save it
+ here. */
+ saved_scope = parser->scope;
+ saved_qualifying_scope = parser->qualifying_scope;
+ saved_object_scope = parser->object_scope;
+ /* Parse the template-argument-list itself. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_GREATER))
+ arguments = NULL_TREE;
+ else
+ arguments = cp_parser_template_argument_list (parser);
+ /* Look for the `>' that ends the template-argument-list. If we find
+ a '>>' instead, it's probably just a typo. */
+ if (cp_lexer_next_token_is (parser->lexer, CPP_RSHIFT))
+ {
+ if (!saved_greater_than_is_operator_p)
+ {
+ /* If we're in a nested template argument list, the '>>' has to be
+ a typo for '> >'. We emit the error message, but we continue
+ parsing and we push a '>' as next token, so that the argument
+ list will be parsed correctly.. */
+ cp_token* token;
+ error ("`>>' should be `> >' within a nested template argument list");
+ token = cp_lexer_peek_token (parser->lexer);
+ token->type = CPP_GREATER;
+ }
+ else
+ {
+ /* If this is not a nested template argument list, the '>>' is
+ a typo for '>'. Emit an error message and continue. */
+ error ("spurious `>>', use `>' to terminate a template argument list");
+ cp_lexer_consume_token (parser->lexer);
+ }
+ }
+ else
+ cp_parser_require (parser, CPP_GREATER, "`>'");
+ /* The `>' token might be a greater-than operator again now. */
+ parser->greater_than_is_operator_p
+ = saved_greater_than_is_operator_p;
+ /* Restore the SAVED_SCOPE. */
+ parser->scope = saved_scope;
+ parser->qualifying_scope = saved_qualifying_scope;
+ parser->object_scope = saved_object_scope;
+
+ return arguments;
+}
+
/* MEMBER_FUNCTION is a member function, or a friend. If default
arguments, or the body of the function have not yet been parsed,
parse them now. */
@@ -13948,10 +14396,10 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
parser->local_variables_forbidden_p = true;
/* Parse the assignment-expression. */
- if (DECL_CONTEXT (fn))
+ if (DECL_CLASS_SCOPE_P (fn))
push_nested_class (DECL_CONTEXT (fn));
TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser);
- if (DECL_CONTEXT (fn))
+ if (DECL_CLASS_SCOPE_P (fn))
pop_nested_class ();
/* Restore saved state. */
@@ -13975,7 +14423,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
static const char *format;
tree expr = NULL_TREE;
const char *saved_message;
- bool saved_constant_expression_p;
+ bool saved_integral_constant_expression_p;
/* Initialize FORMAT the first time we get here. */
if (!format)
@@ -13994,8 +14442,8 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
/* The restrictions on constant-expressions do not apply inside
sizeof expressions. */
- saved_constant_expression_p = parser->constant_expression_p;
- parser->constant_expression_p = false;
+ saved_integral_constant_expression_p = parser->integral_constant_expression_p;
+ parser->integral_constant_expression_p = false;
/* Do not actually evaluate the expression. */
++skip_evaluation;
@@ -14042,7 +14490,7 @@ cp_parser_sizeof_operand (cp_parser* parser, enum rid keyword)
free ((char *) parser->type_definition_forbidden_message);
/* And restore the old one. */
parser->type_definition_forbidden_message = saved_message;
- parser->constant_expression_p = saved_constant_expression_p;
+ parser->integral_constant_expression_p = saved_integral_constant_expression_p;
return expr;
}
@@ -14235,7 +14683,9 @@ cp_parser_next_token_starts_class_definition_p (cp_parser *parser)
}
/* Returns TRUE iff the next token is the "," or ">" ending a
- template-argument. */
+ template-argument. ">>" is also accepted (after the full
+ argument was parsed) because it's probably a typo for "> >",
+ and there is a specific diagnostic for this. */
static bool
cp_parser_next_token_ends_template_argument_p (cp_parser *parser)
@@ -14243,7 +14693,8 @@ cp_parser_next_token_ends_template_argument_p (cp_parser *parser)
cp_token *token;
token = cp_lexer_peek_token (parser->lexer);
- return (token->type == CPP_COMMA || token->type == CPP_GREATER);
+ return (token->type == CPP_COMMA || token->type == CPP_GREATER
+ || token->type == CPP_RSHIFT);
}
/* Returns the kind of tag indicated by TOKEN, if it is a class-key,
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 600d2402f3e..3c0e7d80213 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -731,8 +731,10 @@ maybe_process_partial_specialization (tree type)
if (CLASSTYPE_IMPLICIT_INSTANTIATION (type)
&& !COMPLETE_TYPE_P (type))
{
- if (current_namespace
- != decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type)))
+ tree tpl_ns = decl_namespace_context (CLASSTYPE_TI_TEMPLATE (type));
+ if (is_associated_namespace (current_namespace, tpl_ns))
+ /* Same or super-using namespace. */;
+ else
{
pedwarn ("specializing `%#T' in different namespace", type);
cp_pedwarn_at (" from definition of `%#D'",
@@ -874,6 +876,140 @@ is_specialization_of (tree decl, tree tmpl)
return 0;
}
+/* Returns nonzero iff DECL is a specialization of friend declaration
+ FRIEND according to [temp.friend]. */
+
+bool
+is_specialization_of_friend (tree decl, tree friend)
+{
+ bool need_template = true;
+ int template_depth;
+
+ my_friendly_assert (TREE_CODE (decl) == FUNCTION_DECL, 0);
+
+ /* For [temp.friend/6] when FRIEND is an ordinary member function
+ of a template class, we want to check if DECL is a specialization
+ if this. */
+ if (TREE_CODE (friend) == FUNCTION_DECL
+ && DECL_TEMPLATE_INFO (friend)
+ && !DECL_USE_TEMPLATE (friend))
+ {
+ friend = DECL_TI_TEMPLATE (friend);
+ need_template = false;
+ }
+
+ /* There is nothing to do if this is not a template friend. */
+ if (TREE_CODE (friend) != TEMPLATE_DECL)
+ return 0;
+
+ if (is_specialization_of (decl, friend))
+ return 1;
+
+ /* [temp.friend/6]
+ A member of a class template may be declared to be a friend of a
+ non-template class. In this case, the corresponding member of
+ every specialization of the class template is a friend of the
+ class granting friendship.
+
+ For example, given a template friend declaration
+
+ template <class T> friend void A<T>::f();
+
+ the member function below is considered a friend
+
+ template <> struct A<int> {
+ void f();
+ };
+
+ For this type of template friend, TEMPLATE_DEPTH below will be
+ nonzero. To determine if DECL is a friend of FRIEND, we first
+ check if the enclosing class is a specialization of another. */
+
+ template_depth = template_class_depth (DECL_CONTEXT (friend));
+ if (template_depth
+ && DECL_CLASS_SCOPE_P (decl)
+ && is_specialization_of (TYPE_NAME (DECL_CONTEXT (decl)),
+ CLASSTYPE_TI_TEMPLATE (DECL_CONTEXT (friend))))
+ {
+ /* Next, we check the members themselves. In order to handle
+ a few tricky cases like
+
+ template <class T> friend void A<T>::g(T t);
+ template <class T> template <T t> friend void A<T>::h();
+
+ we need to figure out what ARGS is (corresponding to `T' in above
+ examples) from DECL for later processing. */
+
+ tree context = DECL_CONTEXT (decl);
+ tree args = NULL_TREE;
+ int current_depth = 0;
+ while (current_depth < template_depth)
+ {
+ if (CLASSTYPE_TEMPLATE_INFO (context))
+ {
+ if (current_depth == 0)
+ args = TYPE_TI_ARGS (context);
+ else
+ args = add_to_template_args (TYPE_TI_ARGS (context), args);
+ current_depth++;
+ }
+ context = TYPE_CONTEXT (context);
+ }
+
+ if (TREE_CODE (decl) == FUNCTION_DECL)
+ {
+ bool is_template;
+ tree friend_type;
+ tree decl_type;
+ tree friend_args_type;
+ tree decl_args_type;
+
+ /* Make sure that both DECL and FRIEND are templates or
+ non-templates. */
+ is_template = DECL_TEMPLATE_INFO (decl)
+ && PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (decl));
+ if (need_template ^ is_template)
+ return 0;
+ else if (is_template)
+ {
+ /* If both are templates, check template parameter list. */
+ tree friend_parms
+ = tsubst_template_parms (DECL_TEMPLATE_PARMS (friend),
+ args, tf_none);
+ if (!comp_template_parms
+ (DECL_TEMPLATE_PARMS (DECL_TI_TEMPLATE (decl)),
+ friend_parms))
+ return 0;
+
+ decl_type = TREE_TYPE (DECL_TI_TEMPLATE (decl));
+ }
+ else
+ decl_type = TREE_TYPE (decl);
+
+ friend_type = tsubst_function_type (TREE_TYPE (friend), args,
+ tf_none, NULL_TREE);
+ if (friend_type == error_mark_node)
+ return 0;
+
+ /* Check if return types match. */
+ if (!same_type_p (TREE_TYPE (decl_type), TREE_TYPE (friend_type)))
+ return 0;
+
+ /* Check if function parameter types match, ignoring the
+ `this' parameter. */
+ friend_args_type = TYPE_ARG_TYPES (friend_type);
+ decl_args_type = TYPE_ARG_TYPES (decl_type);
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend))
+ friend_args_type = TREE_CHAIN (friend_args_type);
+ if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ decl_args_type = TREE_CHAIN (decl_args_type);
+ if (compparms (decl_args_type, friend_args_type))
+ return 1;
+ }
+ }
+ return 0;
+}
+
/* Register the specialization SPEC as a specialization of TMPL with
the indicated ARGS. Returns SPEC, or an equivalent prior
declaration, if available. */
@@ -2087,7 +2223,7 @@ process_template_parm (tree list, tree next)
else
{
t = make_aggr_type (TEMPLATE_TYPE_PARM);
- /* parm is either IDENTIFIER_NODE or NULL_TREE */
+ /* parm is either IDENTIFIER_NODE or NULL_TREE. */
decl = build_decl (TYPE_DECL, parm, t);
}
@@ -2859,10 +2995,8 @@ push_template_decl_real (tree decl, int is_friend)
/* It is a conversion operator. See if the type converted to
depends on innermost template operands. */
- if (for_each_template_parm (TREE_TYPE (TREE_TYPE (tmpl)),
- template_parm_this_level_p,
- &depth,
- NULL))
+ if (uses_template_parms_level (TREE_TYPE (TREE_TYPE (tmpl)),
+ depth))
DECL_TEMPLATE_CONV_FN_P (tmpl) = 1;
}
}
@@ -3306,8 +3440,9 @@ convert_nontype_argument (tree type, tree expr)
if (expr == error_mark_node)
return error_mark_node;
- my_friendly_assert (same_type_p (type, TREE_TYPE (expr)),
- 0);
+ if (!same_type_p (type, TREE_TYPE (expr)))
+ return error_mark_node;
+
return expr;
}
break;
@@ -3754,7 +3889,7 @@ mangle_class_name_for_template (const char* name, tree parms, tree arglist)
cat (IDENTIFIER_POINTER (DECL_NAME (arg)));
}
else
- /* Output the parameter declaration */
+ /* Output the parameter declaration. */
cat (type_as_string (arg, TFF_CHASE_TYPEDEF));
continue;
}
@@ -4350,19 +4485,7 @@ lookup_template_class (tree d1,
is set up. */
if (TREE_CODE (t) != ENUMERAL_TYPE)
DECL_NAME (type_decl) = classtype_mangled_name (t);
- if (!is_partial_instantiation)
- {
- /* For backwards compatibility; code that uses
- -fexternal-templates expects looking up a template to
- instantiate it. I think DDD still relies on this.
- (jason 8/20/1998) */
- if (TREE_CODE (t) != ENUMERAL_TYPE
- && flag_external_templates
- && CLASSTYPE_INTERFACE_KNOWN (TREE_TYPE (template))
- && ! CLASSTYPE_INTERFACE_ONLY (TREE_TYPE (template)))
- add_pending_template (t);
- }
- else
+ if (is_partial_instantiation)
/* If the type makes use of template parameters, the
code that generates debugging information will crash. */
DECL_IGNORED_P (TYPE_STUB_DECL (t)) = 1;
@@ -4495,7 +4618,7 @@ for_each_template_parm_r (tree* tp, int* walk_subtrees, void* d)
break;
case TEMPLATE_DECL:
- /* A template template parameter is encountered */
+ /* A template template parameter is encountered. */
if (DECL_TEMPLATE_TEMPLATE_PARM_P (t)
&& for_each_template_parm (TREE_TYPE (t), fn, data, pfd->visited))
return error_mark_node;
@@ -4600,12 +4723,22 @@ for_each_template_parm (tree t, tree_fn_t fn, void* data, htab_t visited)
return result;
}
+/* Returns true if T depends on any template parameter. */
+
int
uses_template_parms (tree t)
{
return for_each_template_parm (t, 0, 0, NULL);
}
+/* Returns true if T depends on any template parameter with level LEVEL. */
+
+int
+uses_template_parms_level (tree t, int level)
+{
+ return for_each_template_parm (t, template_parm_this_level_p, &level, NULL);
+}
+
static int tinst_depth;
extern int max_tinst_depth;
#ifdef GATHER_STATISTICS
@@ -4764,6 +4897,9 @@ tsubst_friend_function (tree decl, tree args)
Then, in S<int>, template <class U> void f(int, U) is not an
instantiation of anything. */
+ if (new_friend == error_mark_node)
+ return error_mark_node;
+
DECL_USE_TEMPLATE (new_friend) = 0;
if (TREE_CODE (decl) == TEMPLATE_DECL)
{
@@ -4915,7 +5051,7 @@ tsubst_friend_function (tree decl, tree args)
/* Check to see that the declaration is really present, and,
possibly obtain an improved declaration. */
tree fn = check_classfn (DECL_CONTEXT (new_friend),
- new_friend);
+ new_friend, false);
if (fn)
new_friend = fn;
@@ -5134,24 +5270,7 @@ instantiate_class_template (tree type)
args = inner_args;
}
- if (flag_external_templates)
- {
- if (flag_alt_external_templates)
- {
- CLASSTYPE_INTERFACE_ONLY (type) = interface_only;
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X (type, interface_unknown);
- }
- else
- {
- CLASSTYPE_INTERFACE_ONLY (type) = CLASSTYPE_INTERFACE_ONLY (pattern);
- SET_CLASSTYPE_INTERFACE_UNKNOWN_X
- (type, CLASSTYPE_INTERFACE_UNKNOWN (pattern));
- }
- }
- else
- {
- SET_CLASSTYPE_INTERFACE_UNKNOWN (type);
- }
+ SET_CLASSTYPE_INTERFACE_UNKNOWN (type);
/* Set the input location to the template definition. This is needed
if tsubsting causes an error. */
@@ -5610,7 +5729,7 @@ tsubst_aggr_type (tree t,
if (TYPE_PTRMEMFUNC_P (t))
return tsubst (TYPE_PTRMEMFUNC_FN_TYPE (t), args, complain, in_decl);
- /* else fall through */
+ /* Else fall through. */
case ENUMERAL_TYPE:
case UNION_TYPE:
if (TYPE_TEMPLATE_INFO (t))
@@ -6547,7 +6666,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
else if (TREE_CODE (t) == BOUND_TEMPLATE_TEMPLATE_PARM)
{
/* We are processing a type constructed from
- a template template parameter */
+ a template template parameter. */
tree argvec = tsubst (TYPE_TI_ARGS (t),
args, complain, in_decl);
if (argvec == error_mark_node)
@@ -6977,7 +7096,7 @@ tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
if (e1 == error_mark_node || e2 == error_mark_node)
return error_mark_node;
- return build_nt (ARRAY_REF, e1, e2, tsubst_expr);
+ return build_nt (ARRAY_REF, e1, e2);
}
case CALL_EXPR:
@@ -7907,7 +8026,7 @@ tsubst_copy_and_build (tree t,
tree decl;
cp_id_kind idk;
tree qualifying_class;
- bool non_constant_expression_p;
+ bool non_integral_constant_expression_p;
const char *error_msg;
if (IDENTIFIER_TYPENAME_P (t))
@@ -7927,9 +8046,9 @@ tsubst_copy_and_build (tree t,
decl = finish_id_expression (t, decl, NULL_TREE,
&idk,
&qualifying_class,
- /*constant_expression_p=*/false,
- /*allow_non_constant_expression_p=*/false,
- &non_constant_expression_p,
+ /*integral_constant_expression_p=*/false,
+ /*allow_non_integral_constant_expression_p=*/false,
+ &non_integral_constant_expression_p,
&error_msg);
if (error_msg)
error (error_msg);
@@ -8482,7 +8601,7 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
deferring all checks until we have the FUNCTION_DECL. */
push_deferring_access_checks (dk_deferred);
- /* substitute template parameters */
+ /* Substitute template parameters. */
fndecl = tsubst (DECL_TEMPLATE_RESULT (gen_tmpl),
targ_ptr, complain, gen_tmpl);
@@ -8497,9 +8616,6 @@ instantiate_template (tree tmpl, tree targ_ptr, tsubst_flags_t complain)
template, not the most general template. */
DECL_TI_TEMPLATE (fndecl) = tmpl;
- if (flag_external_templates)
- add_pending_template (fndecl);
-
/* If we've just instantiated the main entry point for a function,
instantiate all the alternate entry points as well. We do this
by cloning the instantiation of the main entry point, not by
@@ -8910,7 +9026,7 @@ type_unification_real (tree tparms,
are present, and the parm list isn't variadic. */
if (args && args != void_list_node && parms == void_list_node)
return 1;
- /* Fail if parms are left and they don't have default values. */
+ /* Fail if parms are left and they don't have default values. */
if (parms
&& parms != void_list_node
&& TREE_PURPOSE (parms) == NULL_TREE)
@@ -9615,6 +9731,27 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
TREE_VEC_ELT (targs, idx) = arg;
return 0;
+ case PTRMEM_CST:
+ {
+ /* A pointer-to-member constant can be unified only with
+ another constant. */
+ if (TREE_CODE (arg) != PTRMEM_CST)
+ return 1;
+
+ /* Just unify the class member. It would be useless (and possibly
+ wrong, depending on the strict flags) to unify also
+ PTRMEM_CST_CLASS, because we want to be sure that both parm and
+ arg refer to the same variable, even if through different
+ classes. For instance:
+
+ struct A { int x; };
+ struct B : A { };
+
+ Unification of &A::x and &B::x must succeed. */
+ return unify (tparms, targs, PTRMEM_CST_MEMBER (parm),
+ PTRMEM_CST_MEMBER (arg), strict);
+ }
+
case POINTER_TYPE:
{
if (TREE_CODE (arg) != POINTER_TYPE)
@@ -9803,6 +9940,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
return 1;
return 0;
+ case FIELD_DECL:
case TEMPLATE_DECL:
/* Matched cases are handled by the ARG == PARM test above. */
return 1;
@@ -9826,7 +9964,7 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
return unify (tparms, targs, t1, t, strict);
}
- /* else fall through */
+ /* Else fall through. */
default:
if (IS_EXPR_CODE_CLASS (TREE_CODE_CLASS (TREE_CODE (parm))))
@@ -10362,9 +10500,6 @@ do_decl_instantiation (tree decl, tree storage)
return;
}
- if (flag_external_templates)
- return;
-
if (storage == NULL_TREE)
;
else if (storage == ridpointers[(int) RID_EXTERN])
@@ -10433,11 +10568,6 @@ do_type_instantiation (tree t, tree storage, tsubst_flags_t complain)
complete_type (t);
- /* With -fexternal-templates, explicit instantiations are treated the same
- as implicit ones. */
- if (flag_external_templates)
- return;
-
if (!COMPLETE_TYPE_P (t))
{
if (complain & tf_error)
@@ -10820,22 +10950,6 @@ instantiate_decl (tree d, int defer_ok)
else
repo_template_used (d);
- if (flag_external_templates && ! DECL_INTERFACE_KNOWN (d))
- {
- if (flag_alt_external_templates)
- {
- if (interface_unknown)
- warn_if_unknown_interface (d);
- }
- else if (DECL_INTERFACE_KNOWN (code_pattern))
- {
- DECL_INTERFACE_KNOWN (d) = 1;
- DECL_NOT_REALLY_EXTERN (d) = ! DECL_EXTERNAL (code_pattern);
- }
- else
- warn_if_unknown_interface (code_pattern);
- }
-
if (at_eof)
import_export_decl (d);
}
@@ -10948,10 +11062,20 @@ instantiate_decl (tree d, int defer_ok)
/* Mark D as instantiated so that recursive calls to
instantiate_decl do not try to instantiate it again. */
DECL_TEMPLATE_INSTANTIATED (d) = 1;
+ /* This is done in analogous to `start_decl'. It is
+ required for correct access checking. */
+ push_nested_class (DECL_CONTEXT (d));
cp_finish_decl (d,
(!DECL_INITIALIZED_IN_CLASS_P (d)
? DECL_INITIAL (d) : NULL_TREE),
NULL_TREE, 0);
+ /* Normally, pop_nested_class is called by cp_finish_decl
+ above. But when instantiate_decl is triggered during
+ instantiate_class_template processing, its DECL_CONTEXT
+ is still not completed yet, and pop_nested_class isn't
+ called. */
+ if (!COMPLETE_TYPE_P (DECL_CONTEXT (d)))
+ pop_nested_class ();
}
}
else if (TREE_CODE (d) == FUNCTION_DECL)
@@ -11037,6 +11161,7 @@ instantiate_pending_templates (void)
tree last = NULL_TREE;
int instantiated_something = 0;
int reconsider;
+ location_t saved_loc = input_location;
do
{
@@ -11111,6 +11236,7 @@ instantiate_pending_templates (void)
}
while (reconsider);
+ input_location = saved_loc;
return instantiated_something;
}
@@ -11743,6 +11869,17 @@ any_dependent_template_arguments_p (tree args)
bool
dependent_template_p (tree tmpl)
{
+ if (TREE_CODE (tmpl) == OVERLOAD)
+ {
+ while (tmpl)
+ {
+ if (dependent_template_p (OVL_FUNCTION (tmpl)))
+ return true;
+ tmpl = OVL_CHAIN (tmpl);
+ }
+ return false;
+ }
+
/* Template template parameters are dependent. */
if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl)
|| TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM)
@@ -11867,7 +12004,9 @@ build_non_dependent_expr (tree expr)
return build (COND_EXPR,
TREE_TYPE (expr),
TREE_OPERAND (expr, 0),
- build_non_dependent_expr (TREE_OPERAND (expr, 1)),
+ (TREE_OPERAND (expr, 1)
+ ? build_non_dependent_expr (TREE_OPERAND (expr, 1))
+ : build_non_dependent_expr (TREE_OPERAND (expr, 0))),
build_non_dependent_expr (TREE_OPERAND (expr, 2)));
if (TREE_CODE (expr) == COMPOUND_EXPR
&& !COMPOUND_EXPR_OVERLOADED (expr))
diff --git a/gcc/cp/ptree.c b/gcc/cp/ptree.c
index 6dbf0605a48..7979504e3fd 100644
--- a/gcc/cp/ptree.c
+++ b/gcc/cp/ptree.c
@@ -150,8 +150,10 @@ cxx_print_binding (FILE *stream, cxx_binding *binding, const char *prefix)
void
cxx_print_identifier (FILE *file, tree node, int indent)
{
+ indent_to (file, indent);
cxx_print_binding (file, IDENTIFIER_NAMESPACE_BINDINGS (node), "bindings");
print_node (file, "class", IDENTIFIER_CLASS_VALUE (node), indent + 4);
+ indent_to (file, indent);
cxx_print_binding (file, IDENTIFIER_BINDING (node), "local bindings");
print_node (file, "label", IDENTIFIER_LABEL_VALUE (node), indent + 4);
print_node (file, "template", IDENTIFIER_TEMPLATE (node), indent + 4);
diff --git a/gcc/cp/repo.c b/gcc/cp/repo.c
index 7b7b48cecd5..c97cf422304 100644
--- a/gcc/cp/repo.c
+++ b/gcc/cp/repo.c
@@ -53,8 +53,8 @@ static const char *old_args, *old_dir, *old_main;
static struct obstack temporary_obstack;
-#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_3 (NODE))
-#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_4 (NODE))
+#define IDENTIFIER_REPO_USED(NODE) (TREE_LANG_FLAG_5 (NODE))
+#define IDENTIFIER_REPO_CHOSEN(NODE) (TREE_LANG_FLAG_6 (NODE))
#if 0
/* Record the flags used to compile this translation unit. */
@@ -211,6 +211,12 @@ extract_string (char **pp)
int backquote = 0;
int inside = 0;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define QUOTE_CHAR '"'
+#else
+#define QUOTE_CHAR '\''
+#endif
+
for (;;)
{
char c = *p;
@@ -223,7 +229,7 @@ extract_string (char **pp)
break;
else if (! inside && c == '\\')
backquote = 1;
- else if (c == '\'')
+ else if (c == QUOTE_CHAR)
inside = !inside;
else
obstack_1grow (&temporary_obstack, c);
@@ -267,7 +273,7 @@ get_base_filename (const char *filename)
static void
open_repo_file (const char *filename)
{
- register const char *p;
+ const char *p;
const char *s = get_base_filename (filename);
if (s == NULL)
diff --git a/gcc/cp/rtti.c b/gcc/cp/rtti.c
index 391a581ad98..a965383ad4e 100644
--- a/gcc/cp/rtti.c
+++ b/gcc/cp/rtti.c
@@ -1065,7 +1065,7 @@ get_pseudo_ti_init (tree type, tree var_desc, bool *non_public_p)
else
offset = BINFO_OFFSET (base_binfo);
- /* combine offset and flags into one field */
+ /* Combine offset and flags into one field. */
offset = cp_build_binary_op (LSHIFT_EXPR, offset,
build_int_2 (8, 0));
offset = cp_build_binary_op (BIT_IOR_EXPR, offset,
diff --git a/gcc/cp/search.c b/gcc/cp/search.c
index dc8ef9046ec..15927c69166 100644
--- a/gcc/cp/search.c
+++ b/gcc/cp/search.c
@@ -125,7 +125,7 @@ push_search_level (struct stack_level *stack, struct obstack *obstack)
static struct search_level *
pop_search_level (struct stack_level *obstack)
{
- register struct search_level *stack = pop_stack_level (obstack);
+ struct search_level *stack = pop_stack_level (obstack);
return stack;
}
@@ -422,7 +422,7 @@ get_dynamic_cast_base_type (tree subtype, tree target)
tree
lookup_field_1 (tree type, tree name, bool want_type)
{
- register tree field;
+ tree field;
if (TREE_CODE (type) == TEMPLATE_TYPE_PARM
|| TREE_CODE (type) == BOUND_TEMPLATE_TEMPLATE_PARM
@@ -580,6 +580,16 @@ at_class_scope_p (void)
return cs && TYPE_P (cs);
}
+/* Returns true if the innermost active scope is a namespace scope. */
+
+bool
+at_namespace_scope_p (void)
+{
+ /* We are in a namespace scope if we are not it a class scope or a
+ function scope. */
+ return !current_scope();
+}
+
/* Return the scope of DECL, as appropriate when doing name-lookup. */
tree
diff --git a/gcc/cp/semantics.c b/gcc/cp/semantics.c
index 13d873430ea..4cf0261aff2 100644
--- a/gcc/cp/semantics.c
+++ b/gcc/cp/semantics.c
@@ -960,7 +960,7 @@ finish_handler_parms (tree decl, tree handler)
type = expand_start_catch_block (decl);
HANDLER_TYPE (handler) = type;
- if (type)
+ if (!processing_template_decl && type)
mark_used (eh_type_info (type));
}
@@ -1232,7 +1232,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
type = TREE_TYPE (type);
else
{
- /* Set the cv qualifiers */
+ /* Set the cv qualifiers. */
int quals = cp_type_quals (TREE_TYPE (current_class_ref));
if (DECL_MUTABLE_P (decl))
@@ -1263,7 +1263,7 @@ finish_non_static_data_member (tree decl, tree object, tree qualifying_scope)
}
}
- /* If PROCESSING_TEMPLATE_DECL is non-zero here, then
+ /* If PROCESSING_TEMPLATE_DECL is nonzero here, then
QUALIFYING_SCOPE is also non-null. Wrap this in a SCOPE_REF
for now. */
if (processing_template_decl)
@@ -1638,6 +1638,8 @@ finish_call_expr (tree fn, tree args, bool disallow_virtual, bool koenig_p)
if (DECL_FUNCTION_MEMBER_P (f))
{
tree type = currently_open_derived_class (DECL_CONTEXT (f));
+ if (!type)
+ type = DECL_CONTEXT (f);
fn = build_baselink (TYPE_BINFO (type),
TYPE_BINFO (type),
fn, /*optype=*/NULL_TREE);
@@ -2322,9 +2324,9 @@ finish_id_expression (tree id_expression,
tree scope,
cp_id_kind *idk,
tree *qualifying_class,
- bool constant_expression_p,
- bool allow_non_constant_expression_p,
- bool *non_constant_expression_p,
+ bool integral_constant_expression_p,
+ bool allow_non_integral_constant_expression_p,
+ bool *non_integral_constant_expression_p,
const char **error_msg)
{
/* Initialize the output parameters. */
@@ -2390,12 +2392,31 @@ finish_id_expression (tree id_expression,
}
/* If the name resolved to a template parameter, there is no
- need to look it up again later. Similarly, we resolve
- enumeration constants to their underlying values. */
- if (TREE_CODE (decl) == CONST_DECL)
+ need to look it up again later. */
+ if ((TREE_CODE (decl) == CONST_DECL && DECL_TEMPLATE_PARM_P (decl))
+ || TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
{
*idk = CP_ID_KIND_NONE;
- if (DECL_TEMPLATE_PARM_P (decl) || !processing_template_decl)
+ if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX)
+ decl = TEMPLATE_PARM_DECL (decl);
+ if (integral_constant_expression_p
+ && !dependent_type_p (TREE_TYPE (decl))
+ && !INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
+ {
+ if (!allow_non_integral_constant_expression_p)
+ error ("template parameter `%D' of type `%T' is not allowed in "
+ "an integral constant expression because it is not of "
+ "integral or enumeration type", decl, TREE_TYPE (decl));
+ *non_integral_constant_expression_p = true;
+ }
+ return DECL_INITIAL (decl);
+ }
+ /* Similarly, we resolve enumeration constants to their
+ underlying values. */
+ else if (TREE_CODE (decl) == CONST_DECL)
+ {
+ *idk = CP_ID_KIND_NONE;
+ if (!processing_template_decl)
return DECL_INITIAL (decl);
return decl;
}
@@ -2490,8 +2511,8 @@ finish_id_expression (tree id_expression,
/* Since this name was dependent, the expression isn't
constant -- yet. No error is issued because it might
be constant when things are instantiated. */
- if (constant_expression_p)
- *non_constant_expression_p = true;
+ if (integral_constant_expression_p)
+ *non_integral_constant_expression_p = true;
if (TYPE_P (scope) && dependent_type_p (scope))
return build_nt (SCOPE_REF, scope, id_expression);
else if (TYPE_P (scope) && DECL_P (decl))
@@ -2507,37 +2528,33 @@ finish_id_expression (tree id_expression,
/* Since this name was dependent, the expression isn't
constant -- yet. No error is issued because it might be
constant when things are instantiated. */
- if (constant_expression_p)
- *non_constant_expression_p = true;
+ if (integral_constant_expression_p)
+ *non_integral_constant_expression_p = true;
*idk = CP_ID_KIND_UNQUALIFIED_DEPENDENT;
return id_expression;
}
/* Only certain kinds of names are allowed in constant
- expression. Enumerators have already been handled above. */
- if (constant_expression_p)
+ expression. Enumerators and template parameters
+ have already been handled above. */
+ if (integral_constant_expression_p)
{
- /* Non-type template parameters of integral or enumeration
- type are OK. */
- if (TREE_CODE (decl) == TEMPLATE_PARM_INDEX
- && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl)))
- ;
- /* Const variables or static data members of integral or
- enumeration types initialized with constant expressions
- are OK. */
- else if (TREE_CODE (decl) == VAR_DECL
- && CP_TYPE_CONST_P (TREE_TYPE (decl))
- && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))
- && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
+ /* Const variables or static data members of integral or
+ enumeration types initialized with constant expressions
+ are OK. */
+ if (TREE_CODE (decl) == VAR_DECL
+ && CP_TYPE_CONST_P (TREE_TYPE (decl))
+ && INTEGRAL_OR_ENUMERATION_TYPE_P (TREE_TYPE (decl))
+ && DECL_INITIALIZED_BY_CONSTANT_EXPRESSION_P (decl))
;
else
{
- if (!allow_non_constant_expression_p)
+ if (!allow_non_integral_constant_expression_p)
{
error ("`%D' cannot appear in a constant-expression", decl);
return error_mark_node;
}
- *non_constant_expression_p = true;
+ *non_integral_constant_expression_p = true;
}
}
@@ -2834,7 +2851,7 @@ emit_associated_thunks (tree fn)
for (thunk = DECL_THUNKS (fn); thunk; thunk = TREE_CHAIN (thunk))
{
- if (!THUNK_ALIAS_P (thunk))
+ if (!THUNK_ALIAS (thunk))
{
use_thunk (thunk, /*emit_p=*/1);
if (DECL_RESULT_THUNK_P (thunk))
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c
index 63fdb948c7f..bedbbe96b44 100644
--- a/gcc/cp/tree.c
+++ b/gcc/cp/tree.c
@@ -49,6 +49,7 @@ static tree build_target_expr (tree, tree);
static tree count_trees_r (tree *, int *, void *);
static tree verify_stmt_tree_r (tree *, int *, void *);
static tree find_tree_r (tree *, int *, void *);
+static tree build_local_temp (tree);
static tree handle_java_interface_attribute (tree *, tree, tree, int, bool *);
static tree handle_com_interface_attribute (tree *, tree, tree, int, bool *);
@@ -242,6 +243,19 @@ build_target_expr (tree decl, tree value)
return t;
}
+/* Return an undeclared local temporary of type TYPE for use in building a
+ TARGET_EXPR. */
+
+static tree
+build_local_temp (tree type)
+{
+ tree slot = build_decl (VAR_DECL, NULL_TREE, type);
+ DECL_ARTIFICIAL (slot) = 1;
+ DECL_CONTEXT (slot) = current_function_decl;
+ layout_decl (slot, 0);
+ return slot;
+}
+
/* INIT is a CALL_EXPR which needs info about its target.
TYPE is the type that this initialization should appear to have.
@@ -269,10 +283,7 @@ build_cplus_new (tree type, tree init)
&& TREE_CODE (TREE_OPERAND (fn, 0)) == FUNCTION_DECL
&& DECL_CONSTRUCTOR_P (TREE_OPERAND (fn, 0)));
- slot = build_decl (VAR_DECL, NULL_TREE, type);
- DECL_ARTIFICIAL (slot) = 1;
- DECL_CONTEXT (slot) = current_function_decl;
- layout_decl (slot, 0);
+ slot = build_local_temp (type);
/* We split the CALL_EXPR into its function and its arguments here.
Then, in expand_expr, we put them back together. The reason for
@@ -306,26 +317,33 @@ tree
build_target_expr_with_type (tree init, tree type)
{
tree slot;
- tree rval;
if (TREE_CODE (init) == TARGET_EXPR)
return init;
else if (CLASS_TYPE_P (type) && !TYPE_HAS_TRIVIAL_INIT_REF (type)
&& TREE_CODE (init) != COND_EXPR
- && TREE_CODE (init) != CONSTRUCTOR)
+ && TREE_CODE (init) != CONSTRUCTOR
+ && TREE_CODE (init) != VA_ARG_EXPR)
/* We need to build up a copy constructor call. COND_EXPR is a special
case because we already have copies on the arms and we don't want
another one here. A CONSTRUCTOR is aggregate initialization, which
- is handled separately. */
+ is handled separately. A VA_ARG_EXPR is magic creation of an
+ aggregate; there's no additional work to be done. */
return force_rvalue (init);
- slot = build_decl (VAR_DECL, NULL_TREE, type);
- DECL_ARTIFICIAL (slot) = 1;
- DECL_CONTEXT (slot) = current_function_decl;
- layout_decl (slot, 0);
- rval = build_target_expr (slot, init);
+ slot = build_local_temp (type);
+ return build_target_expr (slot, init);
+}
- return rval;
+/* Like the above function, but without the checking. This function should
+ only be used by code which is deliberately trying to subvert the type
+ system, such as call_builtin_trap. */
+
+tree
+force_target_expr (tree type, tree init)
+{
+ tree slot = build_local_temp (type);
+ return build_target_expr (slot, init);
}
/* Like build_target_expr_with_type, but use the type of INIT. */
@@ -345,14 +363,9 @@ build_cplus_array_type_1 (tree elt_type, tree index_type)
if (elt_type == error_mark_node || index_type == error_mark_node)
return error_mark_node;
- /* Don't do the minimal thing just because processing_template_decl is
- set; we want to give string constants the right type immediately, so
- we don't have to fix them up at instantiation time. */
- if ((processing_template_decl
- && index_type && TYPE_MAX_VALUE (index_type)
- && TREE_CODE (TYPE_MAX_VALUE (index_type)) != INTEGER_CST)
- || uses_template_parms (elt_type)
- || (index_type && uses_template_parms (index_type)))
+ if (dependent_type_p (elt_type)
+ || (index_type
+ && value_dependent_expression_p (TYPE_MAX_VALUE (index_type))))
{
t = make_node (ARRAY_TYPE);
TREE_TYPE (t) = elt_type;
@@ -1277,9 +1290,9 @@ break_out_target_exprs (tree t)
tree
build_min_nt (enum tree_code code, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, code);
@@ -1303,9 +1316,9 @@ build_min_nt (enum tree_code code, ...)
tree
build_min (enum tree_code code, tree tt, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, tt);
@@ -1334,9 +1347,9 @@ build_min (enum tree_code code, tree tt, ...)
tree
build_min_non_dep (enum tree_code code, tree non_dep, ...)
{
- register tree t;
- register int length;
- register int i;
+ tree t;
+ int length;
+ int i;
va_list p;
va_start (p, non_dep);
@@ -1436,7 +1449,7 @@ decl_namespace_context (tree decl)
bool
cp_tree_equal (tree t1, tree t2)
{
- register enum tree_code code1, code2;
+ enum tree_code code1, code2;
if (t1 == t2)
return true;
@@ -1978,7 +1991,7 @@ cp_walk_subtrees (tree* tp,
case TYPENAME_TYPE:
case TYPEOF_TYPE:
case BASELINK:
- /* None of thse have subtrees other than those already walked
+ /* None of these have subtrees other than those already walked
above. */
*walk_subtrees_p = 0;
break;
@@ -2176,28 +2189,6 @@ cp_copy_res_decl_for_inlining (tree result,
return var;
}
-/* Record that we're about to start inlining FN, and return nonzero if
- that's OK. Used for lang_hooks.tree_inlining.start_inlining. */
-
-int
-cp_start_inlining (tree fn)
-{
- if (DECL_TEMPLATE_INSTANTIATION (fn))
- return push_tinst_level (fn);
- else
- return 1;
-}
-
-/* Record that we're done inlining FN. Used for
- lang_hooks.tree_inlining.end_inlining. */
-
-void
-cp_end_inlining (tree fn ATTRIBUTE_UNUSED )
-{
- if (DECL_TEMPLATE_INSTANTIATION (fn))
- pop_tinst_level ();
-}
-
/* Initialize tree.c. */
void
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 26c6f2c33a6..ff397c0417d 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -579,8 +579,8 @@ composite_pointer_type (tree t1, tree t2, tree arg1, tree arg2,
tree
merge_types (tree t1, tree t2)
{
- register enum tree_code code1;
- register enum tree_code code2;
+ enum tree_code code1;
+ enum tree_code code2;
tree attributes;
/* Save time if the two types are the same. */
@@ -857,6 +857,7 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration)
{
tree d1;
tree d2;
+ tree max1, max2;
if (t1 == t2)
return true;
@@ -887,8 +888,27 @@ comp_array_types (tree t1, tree t2, bool allow_redeclaration)
return allow_redeclaration;
/* Check that the dimensions are the same. */
- return (cp_tree_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2))
- && cp_tree_equal (TYPE_MAX_VALUE (d1), TYPE_MAX_VALUE (d2)));
+
+ if (!cp_tree_equal (TYPE_MIN_VALUE (d1), TYPE_MIN_VALUE (d2)))
+ return false;
+ max1 = TYPE_MAX_VALUE (d1);
+ max2 = TYPE_MAX_VALUE (d2);
+ if (processing_template_decl && !abi_version_at_least (2)
+ && !value_dependent_expression_p (max1)
+ && !value_dependent_expression_p (max2))
+ {
+ /* With abi-1 we do not fold non-dependent array bounds, (and
+ consequently mangle them incorrectly). We must therefore
+ fold them here, to verify the domains have the same
+ value. */
+ max1 = fold (max1);
+ max2 = fold (max2);
+ }
+
+ if (!cp_tree_equal (max1, max2))
+ return false;
+
+ return true;
}
/* Return true if T1 and T2 are related as allowed by STRICT. STRICT
@@ -900,7 +920,7 @@ comptypes (tree t1, tree t2, int strict)
if (t1 == t2)
return true;
- /* Suppress errors caused by previously reported errors */
+ /* Suppress errors caused by previously reported errors. */
if (t1 == error_mark_node || t2 == error_mark_node)
return false;
@@ -974,7 +994,7 @@ comptypes (tree t1, tree t2, int strict)
return true;
/* Don't check inheritance. */
strict = COMPARE_STRICT;
- /* fall through */
+ /* Fall through. */
case RECORD_TYPE:
case UNION_TYPE:
@@ -995,7 +1015,7 @@ comptypes (tree t1, tree t2, int strict)
if (!comptypes (TYPE_OFFSET_BASETYPE (t1), TYPE_OFFSET_BASETYPE (t2),
strict & ~COMPARE_REDECLARATION))
return false;
- /* FALLTHROUGH*/
+ /* Fall through. */
case POINTER_TYPE:
case REFERENCE_TYPE:
@@ -1233,6 +1253,7 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op)
}
if (TREE_CODE (e) == COMPONENT_REF
+ && TREE_CODE (TREE_OPERAND (e, 1)) == FIELD_DECL
&& DECL_C_BIT_FIELD (TREE_OPERAND (e, 1)))
{
error ("invalid application of `%s' to a bit-field", op_name);
@@ -1264,8 +1285,8 @@ cxx_sizeof_or_alignof_expr (tree e, enum tree_code op)
tree
decay_conversion (tree exp)
{
- register tree type;
- register enum tree_code code;
+ tree type;
+ enum tree_code code;
type = TREE_TYPE (exp);
code = TREE_CODE (type);
@@ -1316,7 +1337,7 @@ decay_conversion (tree exp)
return build_unary_op (ADDR_EXPR, exp, 0);
if (code == ARRAY_TYPE)
{
- register tree adr;
+ tree adr;
tree ptrtype;
if (TREE_CODE (exp) == INDIRECT_REF)
@@ -1808,6 +1829,9 @@ finish_class_member_access_expr (tree object, tree name)
{
if (/* If OBJECT_TYPE is dependent, so is OBJECT.NAME. */
dependent_type_p (object_type)
+ /* If NAME is just an IDENTIFIER_NODE, then the expression
+ is dependent. */
+ || TREE_CODE (object) == IDENTIFIER_NODE
/* If NAME is "f<args>", where either 'f' or 'args' is
dependent, then the expression is dependent. */
|| (TREE_CODE (name) == TEMPLATE_ID_EXPR
@@ -1860,6 +1884,11 @@ finish_class_member_access_expr (tree object, tree name)
is_template_id = true;
template_args = TREE_OPERAND (name, 1);
name = TREE_OPERAND (name, 0);
+
+ if (TREE_CODE (name) == OVERLOAD)
+ name = DECL_NAME (get_first_fn (name));
+ else if (DECL_P (name))
+ name = DECL_NAME (name);
}
if (TREE_CODE (name) == SCOPE_REF)
@@ -2004,7 +2033,7 @@ build_x_indirect_ref (tree expr, const char *errorstring)
tree
build_indirect_ref (tree ptr, const char *errorstring)
{
- register tree pointer, type;
+ tree pointer, type;
if (ptr == error_mark_node)
return error_mark_node;
@@ -2342,8 +2371,8 @@ get_member_function_from_ptrfunc (tree *instance_ptrptr, tree function)
tree
build_function_call (tree function, tree params)
{
- register tree fntype, fndecl;
- register tree coerced_params;
+ tree fntype, fndecl;
+ tree coerced_params;
tree result;
tree name = NULL_TREE, assembler_name = NULL_TREE;
int is_method;
@@ -2460,8 +2489,8 @@ build_function_call (tree function, tree params)
tree
convert_arguments (tree typelist, tree values, tree fndecl, int flags)
{
- register tree typetail, valtail;
- register tree result = NULL_TREE;
+ tree typetail, valtail;
+ tree result = NULL_TREE;
const char *called_thing = 0;
int i = 0;
@@ -2486,8 +2515,8 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
valtail;
valtail = TREE_CHAIN (valtail), i++)
{
- register tree type = typetail ? TREE_VALUE (typetail) : 0;
- register tree val = TREE_VALUE (valtail);
+ tree type = typetail ? TREE_VALUE (typetail) : 0;
+ tree val = TREE_VALUE (valtail);
if (val == error_mark_node)
return error_mark_node;
@@ -2577,7 +2606,7 @@ convert_arguments (tree typelist, tree values, tree fndecl, int flags)
if (typetail != 0 && typetail != void_list_node)
{
- /* See if there are default arguments that can be used */
+ /* See if there are default arguments that can be used. */
if (TREE_PURPOSE (typetail)
&& TREE_CODE (TREE_PURPOSE (typetail)) != DEFAULT_ARG)
{
@@ -2671,17 +2700,17 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
int convert_p ATTRIBUTE_UNUSED)
{
tree op0, op1;
- register enum tree_code code0, code1;
+ enum tree_code code0, code1;
tree type0, type1;
/* Expression code to give to the expression when it is built.
Normally this is CODE, which is what the caller asked for,
but in some special cases we change it. */
- register enum tree_code resultcode = code;
+ enum tree_code resultcode = code;
/* Data type in which the computation is to be performed.
In the simplest cases this is the common type of the arguments. */
- register tree result_type = NULL;
+ tree result_type = NULL;
/* Nonzero means operands have already been type-converted
in whatever way is necessary.
@@ -3390,8 +3419,8 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
build_type = result_type;
{
- register tree result = build (resultcode, build_type, op0, op1);
- register tree folded;
+ tree result = build (resultcode, build_type, op0, op1);
+ tree folded;
folded = fold (result);
if (folded == result)
@@ -3406,8 +3435,7 @@ build_binary_op (enum tree_code code, tree orig_op0, tree orig_op1,
of pointer PTROP and integer INTOP. */
static tree
-cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop,
- register tree intop)
+cp_pointer_int_sum (enum tree_code resultcode, tree ptrop, tree intop)
{
tree res_type = TREE_TYPE (ptrop);
@@ -3425,9 +3453,9 @@ cp_pointer_int_sum (enum tree_code resultcode, register tree ptrop,
The resulting tree has type int. */
static tree
-pointer_diff (register tree op0, register tree op1, register tree ptrtype)
+pointer_diff (tree op0, tree op1, tree ptrtype)
{
- register tree result, folded;
+ tree result, folded;
tree restype = ptrdiff_type_node;
tree target_type = TREE_TYPE (ptrtype);
@@ -3496,7 +3524,7 @@ build_x_unary_op (enum tree_code code, tree xarg)
&& ((IS_AGGR_TYPE_CODE (TREE_CODE (TREE_TYPE (xarg)))
&& !COMPLETE_TYPE_P (TREE_TYPE (xarg)))
|| (TREE_CODE (xarg) == OFFSET_REF)))
- /* don't look for a function */;
+ /* Don't look for a function. */;
else
exp = build_new_op (code, LOOKUP_NORMAL, xarg, NULL_TREE, NULL_TREE);
if (!exp && code == ADDR_EXPR)
@@ -3624,8 +3652,8 @@ tree
build_unary_op (enum tree_code code, tree xarg, int noconvert)
{
/* No default_conversion here. It causes trouble for ADDR_EXPR. */
- register tree arg = xarg;
- register tree argtype = 0;
+ tree arg = xarg;
+ tree argtype = 0;
const char *errstring = NULL;
tree val;
@@ -3763,7 +3791,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
0);
{
- register tree inc;
+ tree inc;
tree result_type = TREE_TYPE (arg);
arg = get_unwidened (arg, 0);
@@ -3902,7 +3930,7 @@ build_unary_op (enum tree_code code, tree xarg, int noconvert)
return arg;
}
- /* For &x[y], return x+y */
+ /* For &x[y], return x+y. */
if (TREE_CODE (arg) == ARRAY_REF)
{
if (!cxx_mark_addressable (TREE_OPERAND (arg, 0)))
@@ -4208,7 +4236,7 @@ unary_complex_lvalue (enum tree_code code, tree arg)
bool
cxx_mark_addressable (tree exp)
{
- register tree x = exp;
+ tree x = exp;
while (1)
switch (TREE_CODE (x))
@@ -4225,10 +4253,10 @@ cxx_mark_addressable (tree exp)
if (x == current_class_ptr)
{
error ("cannot take the address of `this', which is an rvalue expression");
- TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later */
+ TREE_ADDRESSABLE (x) = 1; /* so compiler doesn't die later. */
return true;
}
- /* FALLTHRU */
+ /* Fall through. */
case VAR_DECL:
/* Caller should not be trying to mark initialized
@@ -4237,7 +4265,7 @@ cxx_mark_addressable (tree exp)
|| DECL_IN_AGGR_P (x) == 0
|| TREE_STATIC (x)
|| DECL_EXTERNAL (x), 314);
- /* FALLTHRU */
+ /* Fall through. */
case CONST_DECL:
case RESULT_DECL:
@@ -4744,7 +4772,7 @@ build_const_cast (tree type, tree expr)
tree
build_c_cast (tree type, tree expr)
{
- register tree value = expr;
+ tree value = expr;
tree otype;
if (type == error_mark_node || expr == error_mark_node)
@@ -4909,11 +4937,11 @@ build_c_cast (tree type, tree expr)
tree
build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
- register tree result;
+ tree result;
tree newrhs = rhs;
tree lhstype = TREE_TYPE (lhs);
tree olhstype = lhstype;
- tree olhs = lhs;
+ tree olhs = NULL_TREE;
/* Avoid duplicate error messages from operands that had errors. */
if (lhs == error_mark_node || rhs == error_mark_node)
@@ -4922,7 +4950,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
/* Handle control structure constructs used as "lvalues". */
switch (TREE_CODE (lhs))
{
- /* Handle --foo = 5; as these are valid constructs in C++ */
+ /* Handle --foo = 5; as these are valid constructs in C++. */
case PREDECREMENT_EXPR:
case PREINCREMENT_EXPR:
if (TREE_SIDE_EFFECTS (TREE_OPERAND (lhs, 0)))
@@ -5001,7 +5029,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
return result;
}
else if (! IS_AGGR_TYPE (lhstype))
- /* Do the default thing */;
+ /* Do the default thing. */;
else
{
result = build_special_member_call (lhs, complete_ctor_identifier,
@@ -5028,7 +5056,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
{
/* `operator=' is not an inheritable operator. */
if (! IS_AGGR_TYPE (lhstype))
- /* Do the default thing */;
+ /* Do the default thing. */;
else
{
result = build_new_op (MODIFY_EXPR, LOOKUP_NORMAL,
@@ -5143,6 +5171,15 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
if (lhstype != TREE_TYPE (lhs))
{
+ /* Avoid warnings converting integral types back into enums for
+ enum bit fields. */
+ if (TREE_CODE (lhstype) == INTEGER_TYPE
+ && TREE_CODE (olhstype) == ENUMERAL_TYPE)
+ {
+ if (TREE_SIDE_EFFECTS (lhs))
+ lhs = stabilize_reference (lhs);
+ olhs = lhs;
+ }
lhs = copy_node (lhs);
TREE_TYPE (lhs) = lhstype;
}
@@ -5215,10 +5252,7 @@ build_modify_expr (tree lhs, enum tree_code modifycode, tree rhs)
if (olhstype == TREE_TYPE (result))
return result;
- /* Avoid warnings converting integral types back into enums
- for enum bit fields. */
- if (TREE_CODE (TREE_TYPE (result)) == INTEGER_TYPE
- && TREE_CODE (olhstype) == ENUMERAL_TYPE)
+ if (olhs)
{
result = build (COMPOUND_EXPR, olhstype, result, olhs);
TREE_NO_UNUSED_WARNING (result) = 1;
@@ -5577,8 +5611,8 @@ static tree
convert_for_assignment (tree type, tree rhs,
const char *errtype, tree fndecl, int parmnum)
{
- register tree rhstype;
- register enum tree_code coder;
+ tree rhstype;
+ enum tree_code coder;
/* Strip NON_LVALUE_EXPRs since we aren't using as an lvalue. */
if (TREE_CODE (rhs) == NON_LVALUE_EXPR)
@@ -5676,9 +5710,9 @@ tree
convert_for_initialization (tree exp, tree type, tree rhs, int flags,
const char *errtype, tree fndecl, int parmnum)
{
- register enum tree_code codel = TREE_CODE (type);
- register tree rhstype;
- register enum tree_code coder;
+ enum tree_code codel = TREE_CODE (type);
+ tree rhstype;
+ enum tree_code coder;
/* build_c_cast puts on a NOP_EXPR to make the result not an lvalue.
Strip such NOP_EXPRs, since RHS is used in non-lvalue context. */
@@ -5761,10 +5795,10 @@ c_expand_asm_operands (tree string, tree outputs, tree inputs, tree clobbers,
int vol, location_t locus)
{
int noutputs = list_length (outputs);
- register int i;
+ int i;
/* o[I] is the place that output number I should be written. */
- register tree *o = alloca (noutputs * sizeof (tree));
- register tree tail;
+ tree *o = alloca (noutputs * sizeof (tree));
+ tree tail;
/* Record the contents of OUTPUTS before it is modified. */
for (i = 0, tail = outputs; tail; tail = TREE_CHAIN (tail), i++)
@@ -5984,8 +6018,9 @@ check_return_expr (tree retval)
returned expression uses the chosen variable somehow. And people expect
this restriction, anyway. (jason 2000-11-19)
- See finish_function, genrtl_start_function, and declare_return_variable
- for other pieces of this optimization. */
+ See finish_function, cxx_expand_function_start, and
+ cp_copy_res_decl_for_inlining for other pieces of this
+ optimization. */
if (fn_returns_value_p && flag_elide_constructors)
{
@@ -6174,7 +6209,7 @@ cp_type_quals (tree type)
return TYPE_QUALS (type);
}
-/* Returns nonzero if the TYPE contains a mutable member */
+/* Returns nonzero if the TYPE contains a mutable member. */
bool
cp_has_mutable_p (tree type)
diff --git a/gcc/cp/typeck2.c b/gcc/cp/typeck2.c
index 859fc26f63b..f839dddb300 100644
--- a/gcc/cp/typeck2.c
+++ b/gcc/cp/typeck2.c
@@ -306,7 +306,7 @@ cxx_incomplete_type_error (tree value, tree type)
tree
store_init_value (tree decl, tree init)
{
- register tree value, type;
+ tree value, type;
/* If variable's type was invalidly declared, just ignore it. */
@@ -470,8 +470,7 @@ digest_init (tree type, tree init, tree* tail)
if (TYPE_DOMAIN (type) != 0
&& TREE_CONSTANT (TYPE_SIZE (type)))
{
- register int size
- = TREE_INT_CST_LOW (TYPE_SIZE (type));
+ int size = TREE_INT_CST_LOW (TYPE_SIZE (type));
size = (size + BITS_PER_UNIT - 1) / BITS_PER_UNIT;
/* In C it is ok to subtract 1 from the length of the string
because it's ok to ignore the terminating null char that is
@@ -577,11 +576,11 @@ digest_init (tree type, tree init, tree* tail)
static tree
process_init_constructor (tree type, tree init, tree* elts)
{
- register tree tail;
+ tree tail;
/* List of the elements of the result constructor,
in reverse order. */
- register tree members = NULL;
- register tree next1;
+ tree members = NULL;
+ tree next1;
tree result;
int allconstant = 1;
int allsimple = 1;
@@ -605,8 +604,8 @@ process_init_constructor (tree type, tree init, tree* elts)
if (TREE_CODE (type) == ARRAY_TYPE || TREE_CODE (type) == VECTOR_TYPE)
{
- register long len;
- register int i;
+ long len;
+ int i;
if (TREE_CODE (type) == ARRAY_TYPE)
{
@@ -616,7 +615,7 @@ process_init_constructor (tree type, tree init, tree* elts)
- TREE_INT_CST_LOW (TYPE_MIN_VALUE (domain))
+ 1);
else
- len = -1; /* Take as many as there are */
+ len = -1; /* Take as many as there are. */
}
else
{
@@ -696,7 +695,7 @@ process_init_constructor (tree type, tree init, tree* elts)
}
else if (TREE_CODE (type) == RECORD_TYPE)
{
- register tree field;
+ tree field;
if (tail)
{
@@ -817,7 +816,7 @@ process_init_constructor (tree type, tree init, tree* elts)
/* If the initializer was empty, use default zero initialization. */
&& tail)
{
- register tree field = TYPE_FIELDS (type);
+ tree field = TYPE_FIELDS (type);
/* Find the first named field. ANSI decided in September 1990
that only named fields count here. */
@@ -1132,7 +1131,7 @@ build_functional_cast (tree exp, tree parms)
if (! IS_AGGR_TYPE (type))
{
- /* this must build a C cast */
+ /* This must build a C cast. */
if (parms == NULL_TREE)
parms = integer_zero_node;
else
diff --git a/gcc/cppcharset.c b/gcc/cppcharset.c
index 2eeffca26d6..6b69fed639e 100644
--- a/gcc/cppcharset.c
+++ b/gcc/cppcharset.c
@@ -337,7 +337,7 @@ one_utf8_to_utf16 (iconv_t bigend, const uchar **inbufp, size_t *inbytesleftp,
uchar **outbufp, size_t *outbytesleftp)
{
int rval;
- cppchar_t s;
+ cppchar_t s = 0;
const uchar *save_inbuf = *inbufp;
size_t save_inbytesleft = *inbytesleftp;
uchar *outbuf = *outbufp;
@@ -649,18 +649,18 @@ init_iconv_desc (cpp_reader *pfile, const char *to, const char *from)
if (ret.cd == (iconv_t) -1)
{
if (errno == EINVAL)
- cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */
+ cpp_error (pfile, CPP_DL_ERROR, /* XXX should be DL_SORRY */
"conversion from %s to %s not supported by iconv",
from, to);
else
- cpp_errno (pfile, DL_ERROR, "iconv_open");
+ cpp_errno (pfile, CPP_DL_ERROR, "iconv_open");
ret.func = convert_no_conversion;
}
}
else
{
- cpp_error (pfile, DL_ERROR, /* XXX should be DL_SORRY */
+ cpp_error (pfile, CPP_DL_ERROR, /* XXX should be DL_SORRY */
"no iconv implementation, cannot convert from %s to %s",
from, to);
ret.func = convert_no_conversion;
@@ -804,10 +804,10 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
const uchar *base = str - 2;
if (!CPP_OPTION (pfile, cplusplus) && !CPP_OPTION (pfile, c99))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"universal character names are only valid in C++ and C99");
else if (CPP_WTRADITIONAL (pfile) && identifier_pos == 0)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"the meaning of '\\%c' is different in traditional C",
(int) str[-1]);
@@ -833,7 +833,8 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
if (length)
{
/* We'll error when we try it out as the start of an identifier. */
- cpp_error (pfile, DL_ERROR, "incomplete universal character name %.*s",
+ cpp_error (pfile, CPP_DL_ERROR,
+ "incomplete universal character name %.*s",
(int) (str - base), base);
result = 1;
}
@@ -844,7 +845,8 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
|| (result & 0x80000000)
|| (result >= 0xD800 && result <= 0xDFFF))
{
- cpp_error (pfile, DL_ERROR, "%.*s is not a valid universal character",
+ cpp_error (pfile, CPP_DL_ERROR,
+ "%.*s is not a valid universal character",
(int) (str - base), base);
result = 1;
}
@@ -853,11 +855,11 @@ _cpp_valid_ucn (cpp_reader *pfile, const uchar **pstr,
int validity = ucn_valid_in_identifier (pfile, result);
if (validity == 0)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"universal character %.*s is not valid in an identifier",
(int) (str - base), base);
else if (validity == 2 && identifier_pos == 1)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"universal character %.*s is not valid at the start of an identifier",
(int) (str - base), base);
}
@@ -892,10 +894,12 @@ convert_ucn (cpp_reader *pfile, const uchar *from, const uchar *limit,
if (rval)
{
errno = rval;
- cpp_errno (pfile, DL_ERROR, "converting UCN to source character set");
+ cpp_errno (pfile, CPP_DL_ERROR,
+ "converting UCN to source character set");
}
else if (!APPLY_CONVERSION (cvt, buf, 6 - bytesleft, tbuf))
- cpp_errno (pfile, DL_ERROR, "converting UCN to execution character set");
+ cpp_errno (pfile, CPP_DL_ERROR,
+ "converting UCN to execution character set");
return from;
}
@@ -959,7 +963,7 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit,
size_t mask = width_to_mask (width);
if (CPP_WTRADITIONAL (pfile))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"the meaning of '\\x' is different in traditional C");
from++; /* skip 'x' */
@@ -976,14 +980,14 @@ convert_hex (cpp_reader *pfile, const uchar *from, const uchar *limit,
if (!digits_found)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"\\x used with no following hex digits");
return from;
}
if (overflow | (n != (n & mask)))
{
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"hex escape sequence out of range");
n &= mask;
}
@@ -1022,7 +1026,7 @@ convert_oct (cpp_reader *pfile, const uchar *from, const uchar *limit,
if (n != (n & mask))
{
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"octal escape sequence out of range");
n &= mask;
}
@@ -1090,14 +1094,14 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
case 'a':
if (CPP_WTRADITIONAL (pfile))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"the meaning of '\\a' is different in traditional C");
c = charconsts[0];
break;
case 'e': case 'E':
if (CPP_PEDANTIC (pfile))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"non-ISO-standard escape sequence, '\\%c'", (int) c);
c = charconsts[2];
break;
@@ -1105,16 +1109,16 @@ convert_escape (cpp_reader *pfile, const uchar *from, const uchar *limit,
default:
unknown:
if (ISGRAPH (c))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"unknown escape sequence '\\%c'", (int) c);
else
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"unknown escape sequence: '\\%03o'", (int) c);
}
/* Now convert what we have to the execution character set. */
if (!APPLY_CONVERSION (cvt, &c, 1, tbuf))
- cpp_errno (pfile, DL_ERROR,
+ cpp_errno (pfile, CPP_DL_ERROR,
"converting escape sequence to execution character set");
return from + 1;
@@ -1174,7 +1178,7 @@ cpp_interpret_string (cpp_reader *pfile, const cpp_string *from, size_t count,
return true;
fail:
- cpp_errno (pfile, DL_ERROR, "converting to execution character set");
+ cpp_errno (pfile, CPP_DL_ERROR, "converting to execution character set");
free (tbuf.text);
return false;
}
@@ -1236,10 +1240,11 @@ narrow_str_to_charconst (cpp_reader *pfile, cpp_string str,
if (i > max_chars)
{
i = max_chars;
- cpp_error (pfile, DL_WARNING, "character constant too long for its type");
+ cpp_error (pfile, CPP_DL_WARNING,
+ "character constant too long for its type");
}
else if (i > 1 && CPP_OPTION (pfile, warn_multichar))
- cpp_error (pfile, DL_WARNING, "multi-character character constant");
+ cpp_error (pfile, CPP_DL_WARNING, "multi-character character constant");
/* Multichar constants are of type int and therefore signed. */
if (i > 1)
@@ -1298,7 +1303,8 @@ wide_str_to_charconst (cpp_reader *pfile, cpp_string str,
character exactly fills a wchar_t, so a multi-character wide
character constant is guaranteed to overflow. */
if (off > 0)
- cpp_error (pfile, DL_WARNING, "character constant too long for its type");
+ cpp_error (pfile, CPP_DL_WARNING,
+ "character constant too long for its type");
/* Truncate the constant to its natural width, and simultaneously
sign- or zero-extend to the full width of cppchar_t. */
@@ -1330,7 +1336,7 @@ cpp_interpret_charconst (cpp_reader *pfile, const cpp_token *token,
/* an empty constant will appear as L'' or '' */
if (token->val.str.len == (size_t) (2 + wide))
{
- cpp_error (pfile, DL_ERROR, "empty character constant");
+ cpp_error (pfile, CPP_DL_ERROR, "empty character constant");
return 0;
}
else if (!cpp_interpret_string (pfile, &token->val.str, 1, &str, wide))
diff --git a/gcc/cpperror.c b/gcc/cpperror.c
index 4926cb24ac5..61763cc1826 100644
--- a/gcc/cpperror.c
+++ b/gcc/cpperror.c
@@ -72,43 +72,43 @@ int
_cpp_begin_message (cpp_reader *pfile, int code, fileline line,
unsigned int column)
{
- int level = DL_EXTRACT (code);
+ int level = CPP_DL_EXTRACT (code);
switch (level)
{
- case DL_WARNING:
- case DL_PEDWARN:
+ case CPP_DL_WARNING:
+ case CPP_DL_PEDWARN:
if (CPP_IN_SYSTEM_HEADER (pfile)
&& ! CPP_OPTION (pfile, warn_system_headers))
return 0;
/* Fall through. */
- case DL_WARNING_SYSHDR:
+ case CPP_DL_WARNING_SYSHDR:
if (CPP_OPTION (pfile, warnings_are_errors)
- || (level == DL_PEDWARN && CPP_OPTION (pfile, pedantic_errors)))
+ || (level == CPP_DL_PEDWARN && CPP_OPTION (pfile, pedantic_errors)))
{
if (CPP_OPTION (pfile, inhibit_errors))
return 0;
- level = DL_ERROR;
+ level = CPP_DL_ERROR;
pfile->errors++;
}
else if (CPP_OPTION (pfile, inhibit_warnings))
return 0;
break;
- case DL_ERROR:
+ case CPP_DL_ERROR:
if (CPP_OPTION (pfile, inhibit_errors))
return 0;
/* ICEs cannot be inhibited. */
- case DL_ICE:
+ case CPP_DL_ICE:
pfile->errors++;
break;
}
print_location (pfile, line, column);
- if (DL_WARNING_P (level))
+ if (CPP_DL_WARNING_P (level))
fputs (_("warning: "), stderr);
- else if (level == DL_ICE)
+ else if (level == CPP_DL_ICE)
fputs (_("internal error: "), stderr);
return 1;
diff --git a/gcc/cppexp.c b/gcc/cppexp.c
index b4f1dcc8960..c6f1f1d39a5 100644
--- a/gcc/cppexp.c
+++ b/gcc/cppexp.c
@@ -71,9 +71,10 @@ static void check_promotion (cpp_reader *, const struct op *);
/* With -O2, gcc appears to produce nice code, moving the error
message load and subsequent jump completely out of the main path. */
#define SYNTAX_ERROR(msgid) \
- do { cpp_error (pfile, DL_ERROR, msgid); goto syntax_error; } while(0)
+ do { cpp_error (pfile, CPP_DL_ERROR, msgid); goto syntax_error; } while(0)
#define SYNTAX_ERROR2(msgid, arg) \
- do { cpp_error (pfile, DL_ERROR, msgid, arg); goto syntax_error; } while(0)
+ do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \
+ while(0)
/* Subroutine of cpp_classify_number. S points to a float suffix of
length LEN, possibly zero. Returns 0 for an invalid suffix, or a
@@ -213,7 +214,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
if (float_flag != NOT_FLOAT)
{
if (radix == 16 && CPP_PEDANTIC (pfile) && !CPP_OPTION (pfile, c99))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"use of C99 hexadecimal floating constant");
if (float_flag == AFTER_EXPON)
@@ -235,7 +236,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
result = interpret_float_suffix (str, limit - str);
if (result == 0)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"invalid suffix \"%.*s\" on floating constant",
(int) (limit - str), str);
return CPP_N_INVALID;
@@ -245,7 +246,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
if (limit != str
&& CPP_WTRADITIONAL (pfile)
&& ! cpp_sys_macro_p (pfile))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"traditional C rejects the \"%.*s\" suffix",
(int) (limit - str), str);
@@ -256,7 +257,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
result = interpret_int_suffix (str, limit - str);
if (result == 0)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"invalid suffix \"%.*s\" on integer constant",
(int) (limit - str), str);
return CPP_N_INVALID;
@@ -270,7 +271,7 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
int large = (result & CPP_N_WIDTH) == CPP_N_LARGE;
if (u_or_i || (large && CPP_OPTION (pfile, warn_long_long)))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"traditional C rejects the \"%.*s\" suffix",
(int) (limit - str), str);
}
@@ -278,13 +279,15 @@ cpp_classify_number (cpp_reader *pfile, const cpp_token *token)
if ((result & CPP_N_WIDTH) == CPP_N_LARGE
&& ! CPP_OPTION (pfile, c99)
&& CPP_OPTION (pfile, warn_long_long))
- cpp_error (pfile, DL_PEDWARN, "use of C99 long long integer constant");
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "use of C99 long long integer constant");
result |= CPP_N_INTEGER;
}
if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile))
- cpp_error (pfile, DL_PEDWARN, "imaginary constants are a GCC extension");
+ cpp_error (pfile, CPP_DL_PEDWARN,
+ "imaginary constants are a GCC extension");
if (radix == 10)
result |= CPP_N_DECIMAL;
@@ -369,7 +372,7 @@ cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token,
}
if (overflow)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"integer constant is too large for its type");
/* If too big to be signed, consider it unsigned. Only warn for
decimal numbers. Traditional numbers were always signed (but
@@ -381,7 +384,7 @@ cpp_interpret_integer (cpp_reader *pfile, const cpp_token *token,
&& !num_positive (result, precision))
{
if (base == 10)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"integer constant is so large that it is unsigned");
result.unsignedp = true;
}
@@ -464,13 +467,13 @@ parse_defined (cpp_reader *pfile)
node = token->val.node;
if (paren && cpp_get_token (pfile)->type != CPP_CLOSE_PAREN)
{
- cpp_error (pfile, DL_ERROR, "missing ')' after \"defined\"");
+ cpp_error (pfile, CPP_DL_ERROR, "missing ')' after \"defined\"");
node = 0;
}
}
else
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"operator \"defined\" requires an identifier");
if (token->flags & NAMED_OP)
{
@@ -478,7 +481,7 @@ parse_defined (cpp_reader *pfile)
op.flags = 0;
op.type = token->type;
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"(\"%s\" is an alternative token for \"%s\" in C++)",
cpp_token_as_text (pfile, token),
cpp_token_as_text (pfile, &op));
@@ -488,7 +491,7 @@ parse_defined (cpp_reader *pfile)
if (node)
{
if (pfile->context != initial_context && CPP_PEDANTIC (pfile))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"this use of \"defined\" may not be portable");
_cpp_mark_macro_used (node);
@@ -524,13 +527,13 @@ eval_token (cpp_reader *pfile, const cpp_token *token)
switch (temp & CPP_N_CATEGORY)
{
case CPP_N_FLOATING:
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"floating constant in preprocessor expression");
break;
case CPP_N_INTEGER:
if (!(temp & CPP_N_IMAGINARY))
return cpp_interpret_integer (pfile, token, temp);
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"imaginary number in preprocessor expression");
break;
@@ -576,7 +579,7 @@ eval_token (cpp_reader *pfile, const cpp_token *token)
result.high = 0;
result.low = 0;
if (CPP_OPTION (pfile, warn_undef) && !pfile->state.skip_eval)
- cpp_error (pfile, DL_WARNING, "\"%s\" is not defined",
+ cpp_error (pfile, CPP_DL_WARNING, "\"%s\" is not defined",
NODE_NAME (token->val.node));
}
break;
@@ -805,7 +808,7 @@ _cpp_parse_expr (cpp_reader *pfile)
if (top != pfile->op_stack)
{
- cpp_error (pfile, DL_ICE, "unbalanced stack in #if");
+ cpp_error (pfile, CPP_DL_ICE, "unbalanced stack in #if");
syntax_error:
return false; /* Return false on syntax error. */
}
@@ -824,7 +827,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
if (top->op <= CPP_EQ || top->op > CPP_LAST_CPP_OP + 2)
{
bad_op:
- cpp_error (pfile, DL_ICE, "impossible operator '%u'", top->op);
+ cpp_error (pfile, CPP_DL_ICE, "impossible operator '%u'", top->op);
return 0;
}
@@ -916,7 +919,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
case CPP_OPEN_PAREN:
if (op != CPP_CLOSE_PAREN)
{
- cpp_error (pfile, DL_ERROR, "missing ')' in expression");
+ cpp_error (pfile, CPP_DL_ERROR, "missing ')' in expression");
return 0;
}
top--;
@@ -937,7 +940,7 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
continue;
case CPP_QUERY:
- cpp_error (pfile, DL_ERROR, "'?' without following ':'");
+ cpp_error (pfile, CPP_DL_ERROR, "'?' without following ':'");
return 0;
default:
@@ -946,13 +949,13 @@ reduce (cpp_reader *pfile, struct op *top, enum cpp_ttype op)
top--;
if (top->value.overflow && !pfile->state.skip_eval)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"integer overflow in preprocessor expression");
}
if (op == CPP_CLOSE_PAREN)
{
- cpp_error (pfile, DL_ERROR, "missing '(' in expression");
+ cpp_error (pfile, CPP_DL_ERROR, "missing '(' in expression");
return 0;
}
@@ -983,12 +986,12 @@ check_promotion (cpp_reader *pfile, const struct op *op)
if (op->value.unsignedp)
{
if (!num_positive (op[-1].value, CPP_OPTION (pfile, precision)))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"the left operand of \"%s\" changes sign when promoted",
cpp_token_as_text (pfile, op->token));
}
else if (!num_positive (op->value, CPP_OPTION (pfile, precision)))
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"the right operand of \"%s\" changes sign when promoted",
cpp_token_as_text (pfile, op->token));
}
@@ -1246,7 +1249,7 @@ num_unary_op (cpp_reader *pfile, cpp_num num, enum cpp_ttype op)
{
case CPP_UPLUS:
if (CPP_WTRADITIONAL (pfile) && !pfile->state.skip_eval)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"traditional C rejects the unary plus operator");
num.overflow = false;
break;
@@ -1345,7 +1348,7 @@ num_binary_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
/* Comma. */
default: /* case CPP_COMMA: */
if (CPP_PEDANTIC (pfile) && !pfile->state.skip_eval)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"comma operator in operand of #if");
lhs = rhs;
break;
@@ -1477,7 +1480,7 @@ num_div_op (cpp_reader *pfile, cpp_num lhs, cpp_num rhs, enum cpp_ttype op)
else
{
if (!pfile->state.skip_eval)
- cpp_error (pfile, DL_ERROR, "division by zero in #if");
+ cpp_error (pfile, CPP_DL_ERROR, "division by zero in #if");
return lhs;
}
diff --git a/gcc/cppfiles.c b/gcc/cppfiles.c
index 00834aadc4b..b5b5461b9ee 100644
--- a/gcc/cppfiles.c
+++ b/gcc/cppfiles.c
@@ -154,8 +154,10 @@ struct file_hash_entry
};
static bool open_file (_cpp_file *file);
-static bool pch_open_file (cpp_reader *pfile, _cpp_file *file);
-static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file);
+static bool pch_open_file (cpp_reader *pfile, _cpp_file *file,
+ bool *invalid_pch);
+static bool find_file_in_dir (cpp_reader *pfile, _cpp_file *file,
+ bool *invalid_pch);
static bool read_file_guts (cpp_reader *pfile, _cpp_file *file);
static bool read_file (cpp_reader *pfile, _cpp_file *file);
static bool should_stack_file (cpp_reader *, _cpp_file *file, bool import);
@@ -170,7 +172,8 @@ static cpp_dir *make_cpp_dir (cpp_reader *, const char *dir_name, int sysp);
static void allocate_file_hash_entries (cpp_reader *pfile);
static struct file_hash_entry *new_file_hash_entry (cpp_reader *pfile);
static int report_missing_guard (void **slot, void *b);
-static int hash_string_eq (const void *p, const void *q);
+static hashval_t file_hash_hash (const void *p);
+static int file_hash_eq (const void *p, const void *q);
static char *read_filename_string (int ch, FILE *f);
static void read_name_map (cpp_dir *dir);
static char *remap_filename (cpp_reader *pfile, _cpp_file *file);
@@ -234,9 +237,13 @@ open_file (_cpp_file *file)
return false;
}
-/* Temporary PCH intercept of opening a file. */
+/* Temporary PCH intercept of opening a file. Try to find a PCH file
+ based on FILE->name and FILE->dir, and test those found for
+ validity using PFILE->cb.valid_pch. Return true iff a valid file is
+ found. Set *INVALID_PCH if a PCH file is found but wasn't valid. */
+
static bool
-pch_open_file (cpp_reader *pfile, _cpp_file *file)
+pch_open_file (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
{
static const char extension[] = ".gch";
const char *path = file->path;
@@ -285,6 +292,7 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file)
closedir (pchdir);
}
file->pch |= valid;
+ *invalid_pch |= ! valid;
}
if (valid)
@@ -297,9 +305,11 @@ pch_open_file (cpp_reader *pfile, _cpp_file *file)
/* Try to open the path FILE->name appended to FILE->dir. This is
where remap and PCH intercept the file lookup process. Return true
- if the file was found, whether or not the open was successful. */
+ if the file was found, whether or not the open was successful.
+ Set *INVALID_PCH to true if a PCH file is found but wasn't valid. */
+
static bool
-find_file_in_dir (cpp_reader *pfile, _cpp_file *file)
+find_file_in_dir (cpp_reader *pfile, _cpp_file *file, bool *invalid_pch)
{
char *path;
@@ -309,7 +319,7 @@ find_file_in_dir (cpp_reader *pfile, _cpp_file *file)
path = append_file_to_dir (file->name, file->dir);
file->path = path;
- if (pch_open_file (pfile, file))
+ if (pch_open_file (pfile, file, invalid_pch))
return true;
if (open_file (file))
@@ -351,13 +361,16 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f
{
struct file_hash_entry *entry, **hash_slot;
_cpp_file *file;
+ bool invalid_pch = false;
/* Ensure we get no confusion between cached files and directories. */
if (start_dir == NULL)
- cpp_error (pfile, DL_ICE, "NULL directory in find_file");
+ cpp_error (pfile, CPP_DL_ICE, "NULL directory in find_file");
hash_slot = (struct file_hash_entry **)
- htab_find_slot (pfile->file_hash, fname, INSERT);
+ htab_find_slot_with_hash (pfile->file_hash, fname,
+ htab_hash_string (fname),
+ INSERT);
/* First check the cache before we resort to memory allocation. */
entry = search_cache (*hash_slot, start_dir);
@@ -369,13 +382,21 @@ _cpp_find_file (cpp_reader *pfile, const char *fname, cpp_dir *start_dir, bool f
/* Try each path in the include chain. */
for (; !fake ;)
{
- if (find_file_in_dir (pfile, file))
+ if (find_file_in_dir (pfile, file, &invalid_pch))
break;
file->dir = file->dir->next;
if (file->dir == NULL)
{
open_file_failed (pfile, file);
+ if (invalid_pch)
+ {
+ cpp_error (pfile, CPP_DL_ERROR,
+ "one or more PCH files were found, but they were invalid");
+ if (!cpp_get_options (pfile)->warn_invalid_pch)
+ cpp_error (pfile, CPP_DL_ERROR,
+ "use -Winvalid-pch for more information");
+ }
break;
}
@@ -432,7 +453,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file)
if (S_ISBLK (file->st.st_mode))
{
- cpp_error (pfile, DL_ERROR, "%s is a block device", file->path);
+ cpp_error (pfile, CPP_DL_ERROR, "%s is a block device", file->path);
return false;
}
@@ -449,7 +470,7 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file)
does not bite us. */
if (file->st.st_size > INTTYPE_MAXIMUM (ssize_t))
{
- cpp_error (pfile, DL_ERROR, "%s is too large", file->path);
+ cpp_error (pfile, CPP_DL_ERROR, "%s is too large", file->path);
return false;
}
@@ -478,12 +499,13 @@ read_file_guts (cpp_reader *pfile, _cpp_file *file)
if (count < 0)
{
- cpp_errno (pfile, DL_ERROR, file->path);
+ cpp_errno (pfile, CPP_DL_ERROR, file->path);
return false;
}
if (regular && total != size && STAT_SIZE_RELIABLE (file->st))
- cpp_error (pfile, DL_WARNING, "%s is shorter than expected", file->path);
+ cpp_error (pfile, CPP_DL_WARNING,
+ "%s is shorter than expected", file->path);
/* Shrink buffer if we allocated substantially too much. */
if (total + 4096 < size)
@@ -675,7 +697,7 @@ search_path_head (cpp_reader *pfile, const char *fname, int angle_brackets,
return make_cpp_dir (pfile, dir_name_of_file (file), pfile->map->sysp);
if (dir == NULL)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"no include path in which to search for %s", fname);
return dir;
@@ -732,9 +754,9 @@ open_file_failed (cpp_reader *pfile, _cpp_file *file)
/* If we are outputting dependencies but not for this file then
don't error because we can still produce correct output. */
if (CPP_OPTION (pfile, deps.style) && ! print_dep)
- cpp_errno (pfile, DL_WARNING, file->path);
+ cpp_errno (pfile, CPP_DL_WARNING, file->path);
else
- cpp_errno (pfile, DL_ERROR, file->path);
+ cpp_errno (pfile, CPP_DL_ERROR, file->path);
}
}
@@ -778,7 +800,9 @@ make_cpp_dir (cpp_reader *pfile, const char *dir_name, int sysp)
cpp_dir *dir;
hash_slot = (struct file_hash_entry **)
- htab_find_slot (pfile->file_hash, dir_name, INSERT);
+ htab_find_slot_with_hash (pfile->file_hash, dir_name,
+ htab_hash_string (dir_name),
+ INSERT);
/* Have we already hashed this directory? */
for (entry = *hash_slot; entry; entry = entry->next)
@@ -829,7 +853,8 @@ cpp_included (cpp_reader *pfile, const char *fname)
{
struct file_hash_entry *entry;
- entry = htab_find (pfile->file_hash, fname);
+ entry = htab_find_with_hash (pfile->file_hash, fname,
+ htab_hash_string (fname));
while (entry && (entry->start_dir == NULL || entry->u.file->err_no))
entry = entry->next;
@@ -837,9 +862,24 @@ cpp_included (cpp_reader *pfile, const char *fname)
return entry != NULL;
}
+/* Calculate the hash value of a file hash entry P. */
+
+static hashval_t
+file_hash_hash (const void *p)
+{
+ struct file_hash_entry *entry = (struct file_hash_entry *) p;
+ const char *hname;
+ if (entry->start_dir)
+ hname = entry->u.file->name;
+ else
+ hname = entry->u.dir->name;
+
+ return htab_hash_string (hname);
+}
+
/* Compare a string Q against a file hash entry P. */
static int
-hash_string_eq (const void *p, const void *q)
+file_hash_eq (const void *p, const void *q)
{
struct file_hash_entry *entry = (struct file_hash_entry *) p;
const char *fname = (const char *) q;
@@ -857,7 +897,7 @@ hash_string_eq (const void *p, const void *q)
void
_cpp_init_files (cpp_reader *pfile)
{
- pfile->file_hash = htab_create_alloc (127, htab_hash_string, hash_string_eq,
+ pfile->file_hash = htab_create_alloc (127, file_hash_hash, file_hash_eq,
NULL, xcalloc, free);
allocate_file_hash_entries (pfile);
}
diff --git a/gcc/cpphash.h b/gcc/cpphash.h
index 734d3bba4d9..80cb04c5f52 100644
--- a/gcc/cpphash.h
+++ b/gcc/cpphash.h
@@ -25,7 +25,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "hashtable.h"
-#ifdef HAVE_ICONV
+#if defined HAVE_ICONV_H && defined HAVE_ICONV
#include <iconv.h>
#else
#define HAVE_ICONV 0
diff --git a/gcc/cppinit.c b/gcc/cppinit.c
index a2e85b2d2e9..13326886778 100644
--- a/gcc/cppinit.c
+++ b/gcc/cppinit.c
@@ -383,36 +383,37 @@ static void sanity_checks (cpp_reader *pfile)
type precisions made by cpplib. */
test--;
if (test < 1)
- cpp_error (pfile, DL_ICE, "cppchar_t must be an unsigned type");
+ cpp_error (pfile, CPP_DL_ICE, "cppchar_t must be an unsigned type");
if (CPP_OPTION (pfile, precision) > max_precision)
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"preprocessor arithmetic has maximum precision of %lu bits;"
" target requires %lu bits",
(unsigned long) max_precision,
(unsigned long) CPP_OPTION (pfile, precision));
if (CPP_OPTION (pfile, precision) < CPP_OPTION (pfile, int_precision))
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"CPP arithmetic must be at least as precise as a target int");
if (CPP_OPTION (pfile, char_precision) < 8)
- cpp_error (pfile, DL_ICE, "target char is less than 8 bits wide");
+ cpp_error (pfile, CPP_DL_ICE, "target char is less than 8 bits wide");
if (CPP_OPTION (pfile, wchar_precision) < CPP_OPTION (pfile, char_precision))
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"target wchar_t is narrower than target char");
if (CPP_OPTION (pfile, int_precision) < CPP_OPTION (pfile, char_precision))
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"target int is narrower than target char");
/* This is assumed in eval_token() and could be fixed if necessary. */
if (sizeof (cppchar_t) > sizeof (cpp_num_part))
- cpp_error (pfile, DL_ICE, "CPP half-integer narrower than CPP character");
+ cpp_error (pfile, CPP_DL_ICE,
+ "CPP half-integer narrower than CPP character");
if (CPP_OPTION (pfile, wchar_precision) > BITS_PER_CPPCHAR_T)
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"CPP on this host cannot handle wide character constants over"
" %lu bits, but the target requires %lu bits",
(unsigned long) BITS_PER_CPPCHAR_T,
diff --git a/gcc/cpplex.c b/gcc/cpplex.c
index 3701415aa32..783732fa444 100644
--- a/gcc/cpplex.c
+++ b/gcc/cpplex.c
@@ -270,12 +270,12 @@ _cpp_process_line_notes (cpp_reader *pfile, int in_comment)
if (note->type == '\\' || note->type == ' ')
{
if (note->type == ' ' && !in_comment)
- cpp_error_with_line (pfile, DL_WARNING, pfile->line, col,
+ cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line, col,
"backslash and newline separated by space");
if (buffer->next_line > buffer->rlimit)
{
- cpp_error_with_line (pfile, DL_PEDWARN, pfile->line, col,
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line, col,
"backslash-newline at end of file");
/* Prevent "no newline at end of file" warning. */
buffer->next_line = buffer->rlimit;
@@ -290,14 +290,14 @@ _cpp_process_line_notes (cpp_reader *pfile, int in_comment)
&& (!in_comment || warn_in_comment (pfile, note)))
{
if (CPP_OPTION (pfile, trigraphs))
- cpp_error_with_line (pfile, DL_WARNING, pfile->line, col,
+ cpp_error_with_line (pfile, CPP_DL_WARNING, pfile->line, col,
"trigraph ??%c converted to %c",
note->type,
(int) _cpp_trigraph_map[note->type]);
else
{
cpp_error_with_line
- (pfile, DL_WARNING, pfile->line, col,
+ (pfile, CPP_DL_WARNING, pfile->line, col,
"trigraph ??%c ignored, use -trigraphs to enable",
note->type);
}
@@ -342,7 +342,7 @@ _cpp_skip_block_comment (cpp_reader *pfile)
&& cur[0] == '*' && cur[1] != '/')
{
buffer->cur = cur;
- cpp_error_with_line (pfile, DL_WARNING,
+ cpp_error_with_line (pfile, CPP_DL_WARNING,
pfile->line, CPP_BUF_COL (buffer),
"\"/*\" within comment");
}
@@ -396,7 +396,7 @@ skip_whitespace (cpp_reader *pfile, cppchar_t c)
else if (c == '\0')
saw_NUL = true;
else if (pfile->state.in_directive && CPP_PEDANTIC (pfile))
- cpp_error_with_line (pfile, DL_PEDWARN, pfile->line,
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line,
CPP_BUF_COL (buffer),
"%s in preprocessing directive",
c == '\f' ? "form feed" : "vertical tab");
@@ -407,7 +407,7 @@ skip_whitespace (cpp_reader *pfile, cppchar_t c)
while (is_nvspace (c));
if (saw_NUL)
- cpp_error (pfile, DL_WARNING, "null character(s) ignored");
+ cpp_error (pfile, CPP_DL_WARNING, "null character(s) ignored");
buffer->cur--;
}
@@ -442,7 +442,7 @@ forms_identifier_p (cpp_reader *pfile, int first)
if (CPP_OPTION (pfile, warn_dollars) && !pfile->state.skipping)
{
CPP_OPTION (pfile, warn_dollars) = 0;
- cpp_error (pfile, DL_PEDWARN, "'$' in identifier or number");
+ cpp_error (pfile, CPP_DL_PEDWARN, "'$' in identifier or number");
}
return true;
@@ -489,14 +489,14 @@ lex_identifier (cpp_reader *pfile, const uchar *base)
{
/* It is allowed to poison the same identifier twice. */
if ((result->flags & NODE_POISONED) && !pfile->state.poisoned_ok)
- cpp_error (pfile, DL_ERROR, "attempt to use poisoned \"%s\"",
+ cpp_error (pfile, CPP_DL_ERROR, "attempt to use poisoned \"%s\"",
NODE_NAME (result));
/* Constraint 6.10.3.5: __VA_ARGS__ should only appear in the
replacement list of a variadic macro. */
if (result == pfile->spec_nodes.n__VA_ARGS__
&& !pfile->state.va_args_ok)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"__VA_ARGS__ can only appear in the expansion"
" of a C99 variadic macro");
}
@@ -592,7 +592,8 @@ lex_string (cpp_reader *pfile, cpp_token *token, const uchar *base)
}
if (saw_NUL && !pfile->state.skipping)
- cpp_error (pfile, DL_WARNING, "null character(s) preserved in literal");
+ cpp_error (pfile, CPP_DL_WARNING,
+ "null character(s) preserved in literal");
pfile->buffer->cur = cur;
create_literal (pfile, token, base, cur - base, type);
@@ -771,7 +772,7 @@ _cpp_get_fresh_line (cpp_reader *pfile)
{
/* Only warn once. */
buffer->next_line = buffer->rlimit;
- cpp_error_with_line (pfile, DL_PEDWARN, pfile->line - 1,
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->line - 1,
CPP_BUF_COLUMN (buffer, buffer->cur),
"no newline at end of file");
}
@@ -912,7 +913,7 @@ _cpp_lex_direct (cpp_reader *pfile)
if (c == '*')
{
if (_cpp_skip_block_comment (pfile))
- cpp_error (pfile, DL_ERROR, "unterminated comment");
+ cpp_error (pfile, CPP_DL_ERROR, "unterminated comment");
}
else if (c == '/' && (CPP_OPTION (pfile, cplusplus_comments)
|| CPP_IN_SYSTEM_HEADER (pfile)))
@@ -922,15 +923,15 @@ _cpp_lex_direct (cpp_reader *pfile)
if (CPP_OPTION (pfile, lang) == CLK_GNUC89 && CPP_PEDANTIC (pfile)
&& ! buffer->warned_cplusplus_comments)
{
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"C++ style comments are not allowed in ISO C90");
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"(this will be reported only once per input file)");
buffer->warned_cplusplus_comments = 1;
}
if (skip_line_comment (pfile) && CPP_OPTION (pfile, warn_comments))
- cpp_error (pfile, DL_WARNING, "multi-line comment");
+ cpp_error (pfile, CPP_DL_WARNING, "multi-line comment");
}
else if (c == '=')
{
@@ -1193,7 +1194,8 @@ cpp_spell_token (cpp_reader *pfile, const cpp_token *token,
break;
case SPELL_NONE:
- cpp_error (pfile, DL_ICE, "unspellable token %s", TOKEN_NAME (token));
+ cpp_error (pfile, CPP_DL_ICE,
+ "unspellable token %s", TOKEN_NAME (token));
break;
}
diff --git a/gcc/cpplib.c b/gcc/cpplib.c
index 7fba1f3e96b..2b213cb461a 100644
--- a/gcc/cpplib.c
+++ b/gcc/cpplib.c
@@ -215,7 +215,7 @@ static void
check_eol (cpp_reader *pfile)
{
if (! SEEN_EOL () && _cpp_lex_token (pfile)->type != CPP_EOF)
- cpp_error (pfile, DL_PEDWARN, "extra tokens at end of #%s directive",
+ cpp_error (pfile, CPP_DL_PEDWARN, "extra tokens at end of #%s directive",
pfile->directive->name);
}
@@ -272,14 +272,17 @@ prepare_directive_trad (cpp_reader *pfile)
&& ! (pfile->directive->flags & EXPAND));
bool was_skipping = pfile->state.skipping;
- pfile->state.skipping = false;
pfile->state.in_expression = (pfile->directive == &dtable[T_IF]
|| pfile->directive == &dtable[T_ELIF]);
+ if (pfile->state.in_expression)
+ pfile->state.skipping = false;
+
if (no_expand)
pfile->state.prevent_expansion++;
_cpp_scan_out_logical_line (pfile, NULL);
if (no_expand)
pfile->state.prevent_expansion--;
+
pfile->state.skipping = was_skipping;
_cpp_overlay_buffer (pfile, pfile->out.base,
pfile->out.cur - pfile->out.base);
@@ -298,7 +301,7 @@ directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented)
if (CPP_PEDANTIC (pfile)
&& ! pfile->state.skipping
&& dir->origin == EXTENSION)
- cpp_error (pfile, DL_PEDWARN, "#%s is a GCC extension", dir->name);
+ cpp_error (pfile, CPP_DL_PEDWARN, "#%s is a GCC extension", dir->name);
/* Traditionally, a directive is ignored unless its # is in
column 1. Therefore in code intended to work with K+R
@@ -309,14 +312,14 @@ directive_diagnostics (cpp_reader *pfile, const directive *dir, int indented)
if (CPP_WTRADITIONAL (pfile))
{
if (dir == &dtable[T_ELIF])
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"suggest not using #elif in traditional C");
else if (indented && dir->origin == KANDR)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"traditional C ignores #%s with the # indented",
dir->name);
else if (!indented && dir->origin != KANDR)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"suggest hiding #%s from traditional C with an indented #",
dir->name);
}
@@ -338,7 +341,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
if (was_parsing_args)
{
if (CPP_OPTION (pfile, pedantic))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"embedding a directive within macro arguments is not portable");
pfile->state.parsing_args = 0;
pfile->state.prevent_expansion = 0;
@@ -358,7 +361,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
dir = &linemarker_dir;
if (CPP_PEDANTIC (pfile) && ! CPP_OPTION (pfile, preprocessed)
&& ! pfile->state.skipping)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"style of line directive is a GCC extension");
}
@@ -409,7 +412,7 @@ _cpp_handle_directive (cpp_reader *pfile, int indented)
if (CPP_OPTION (pfile, lang) == CLK_ASM)
skip = 0;
else if (!pfile->state.skipping)
- cpp_error (pfile, DL_ERROR, "invalid preprocessing directive #%s",
+ cpp_error (pfile, CPP_DL_ERROR, "invalid preprocessing directive #%s",
cpp_token_as_text (pfile, dname));
}
@@ -477,20 +480,20 @@ lex_macro_node (cpp_reader *pfile)
cpp_hashnode *node = token->val.node;
if (node == pfile->spec_nodes.n_defined)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"\"defined\" cannot be used as a macro name");
else if (! (node->flags & NODE_POISONED))
return node;
}
else if (token->flags & NAMED_OP)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"\"%s\" cannot be used as a macro name as it is an operator in C++",
NODE_NAME (token->val.node));
else if (token->type == CPP_EOF)
- cpp_error (pfile, DL_ERROR, "no macro name given in #%s directive",
+ cpp_error (pfile, CPP_DL_ERROR, "no macro name given in #%s directive",
pfile->directive->name);
else
- cpp_error (pfile, DL_ERROR, "macro names must be identifiers");
+ cpp_error (pfile, CPP_DL_ERROR, "macro names must be identifiers");
return NULL;
}
@@ -520,21 +523,26 @@ do_undef (cpp_reader *pfile)
{
cpp_hashnode *node = lex_macro_node (pfile);
- /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified identifier
- is not currently defined as a macro name. */
- if (node && node->type == NT_MACRO)
+ if (node)
{
if (pfile->cb.undef)
pfile->cb.undef (pfile, pfile->directive_line, node);
- if (node->flags & NODE_WARN)
- cpp_error (pfile, DL_WARNING, "undefining \"%s\"", NODE_NAME (node));
+ /* 6.10.3.5 paragraph 2: [#undef] is ignored if the specified
+ identifier is not currently defined as a macro name. */
+ if (node->type == NT_MACRO)
+ {
+ if (node->flags & NODE_WARN)
+ cpp_error (pfile, CPP_DL_WARNING,
+ "undefining \"%s\"", NODE_NAME (node));
- if (CPP_OPTION (pfile, warn_unused_macros))
- _cpp_warn_if_unused_macro (pfile, node, NULL);
+ if (CPP_OPTION (pfile, warn_unused_macros))
+ _cpp_warn_if_unused_macro (pfile, node, NULL);
- _cpp_free_definition (node);
+ _cpp_free_definition (node);
+ }
}
+
check_eol (pfile);
}
@@ -598,7 +606,7 @@ glue_header_name (cpp_reader *pfile)
break;
if (token->type == CPP_EOF)
{
- cpp_error (pfile, DL_ERROR, "missing terminating > character");
+ cpp_error (pfile, CPP_DL_ERROR, "missing terminating > character");
break;
}
@@ -651,7 +659,7 @@ parse_include (cpp_reader *pfile, int *pangle_brackets)
dir = U"pragma dependency";
else
dir = pfile->directive->name;
- cpp_error (pfile, DL_ERROR, "#%s expects \"FILENAME\" or <FILENAME>",
+ cpp_error (pfile, CPP_DL_ERROR, "#%s expects \"FILENAME\" or <FILENAME>",
dir);
return NULL;
@@ -674,7 +682,7 @@ do_include_common (cpp_reader *pfile, enum include_type type)
/* Prevent #include recursion. */
if (pfile->line_maps.depth >= CPP_STACK_MAX)
- cpp_error (pfile, DL_ERROR, "#include nested too deeply");
+ cpp_error (pfile, CPP_DL_ERROR, "#include nested too deeply");
else
{
/* Get out of macro context, if we are. */
@@ -711,7 +719,7 @@ do_include_next (cpp_reader *pfile)
search logic. */
if (! pfile->buffer->prev)
{
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"#include_next in primary source file");
type = IT_INCLUDE;
}
@@ -738,7 +746,7 @@ read_flag (cpp_reader *pfile, unsigned int last)
}
if (token->type != CPP_EOF)
- cpp_error (pfile, DL_ERROR, "invalid flag \"%s\" in line directive",
+ cpp_error (pfile, CPP_DL_ERROR, "invalid flag \"%s\" in line directive",
cpp_token_as_text (pfile, token));
return 0;
}
@@ -782,14 +790,14 @@ do_line (cpp_reader *pfile)
|| strtoul_for_line (token->val.str.text, token->val.str.len,
&new_lineno))
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"\"%s\" after #line is not a positive integer",
cpp_token_as_text (pfile, token));
return;
}
if (CPP_PEDANTIC (pfile) && (new_lineno == 0 || new_lineno > cap))
- cpp_error (pfile, DL_PEDWARN, "line number out of range");
+ cpp_error (pfile, CPP_DL_PEDWARN, "line number out of range");
token = cpp_get_token (pfile);
if (token->type == CPP_STRING)
@@ -801,7 +809,7 @@ do_line (cpp_reader *pfile)
}
else if (token->type != CPP_EOF)
{
- cpp_error (pfile, DL_ERROR, "\"%s\" is not a valid filename",
+ cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename",
cpp_token_as_text (pfile, token));
return;
}
@@ -835,7 +843,8 @@ do_linemarker (cpp_reader *pfile)
|| strtoul_for_line (token->val.str.text, token->val.str.len,
&new_lineno))
{
- cpp_error (pfile, DL_ERROR, "\"%s\" after # is not a positive integer",
+ cpp_error (pfile, CPP_DL_ERROR,
+ "\"%s\" after # is not a positive integer",
cpp_token_as_text (pfile, token));
return;
}
@@ -873,7 +882,7 @@ do_linemarker (cpp_reader *pfile)
}
else if (token->type != CPP_EOF)
{
- cpp_error (pfile, DL_ERROR, "\"%s\" is not a valid filename",
+ cpp_error (pfile, CPP_DL_ERROR, "\"%s\" is not a valid filename",
cpp_token_as_text (pfile, token));
return;
}
@@ -918,14 +927,14 @@ do_diagnostic (cpp_reader *pfile, int code, int print_dir)
static void
do_error (cpp_reader *pfile)
{
- do_diagnostic (pfile, DL_ERROR, 1);
+ do_diagnostic (pfile, CPP_DL_ERROR, 1);
}
static void
do_warning (cpp_reader *pfile)
{
/* We want #warning diagnostics to be emitted in system headers too. */
- do_diagnostic (pfile, DL_WARNING_SYSHDR, 1);
+ do_diagnostic (pfile, CPP_DL_WARNING_SYSHDR, 1);
}
/* Report program identification. */
@@ -935,7 +944,7 @@ do_ident (cpp_reader *pfile)
const cpp_token *str = cpp_get_token (pfile);
if (str->type != CPP_STRING)
- cpp_error (pfile, DL_ERROR, "invalid #ident directive");
+ cpp_error (pfile, CPP_DL_ERROR, "invalid #ident directive");
else if (pfile->cb.ident)
pfile->cb.ident (pfile, pfile->directive_line, &str->val.str);
@@ -1014,14 +1023,14 @@ cpp_register_pragma (cpp_reader *pfile, const char *space, const char *name,
{
if (entry->is_nspace)
clash:
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"registering \"%s\" as both a pragma and a pragma namespace",
NODE_NAME (node));
else if (space)
- cpp_error (pfile, DL_ICE, "#pragma %s %s is already registered",
+ cpp_error (pfile, CPP_DL_ICE, "#pragma %s %s is already registered",
space, name);
else
- cpp_error (pfile, DL_ICE, "#pragma %s is already registered", name);
+ cpp_error (pfile, CPP_DL_ICE, "#pragma %s is already registered", name);
}
else
insert_pragma_entry (pfile, chain, node, handler);
@@ -1166,7 +1175,7 @@ static void
do_pragma_once (cpp_reader *pfile)
{
if (pfile->buffer->prev == NULL)
- cpp_error (pfile, DL_WARNING, "#pragma once in main file");
+ cpp_error (pfile, CPP_DL_WARNING, "#pragma once in main file");
check_eol (pfile);
_cpp_mark_file_once_only (pfile, pfile->buffer->file);
@@ -1188,7 +1197,8 @@ do_pragma_poison (cpp_reader *pfile)
break;
if (tok->type != CPP_NAME)
{
- cpp_error (pfile, DL_ERROR, "invalid #pragma GCC poison directive");
+ cpp_error (pfile, CPP_DL_ERROR,
+ "invalid #pragma GCC poison directive");
break;
}
@@ -1197,7 +1207,7 @@ do_pragma_poison (cpp_reader *pfile)
continue;
if (hp->type == NT_MACRO)
- cpp_error (pfile, DL_WARNING, "poisoning existing macro \"%s\"",
+ cpp_error (pfile, CPP_DL_WARNING, "poisoning existing macro \"%s\"",
NODE_NAME (hp));
_cpp_free_definition (hp);
hp->flags |= NODE_POISONED | NODE_DIAGNOSTIC;
@@ -1217,7 +1227,7 @@ do_pragma_system_header (cpp_reader *pfile)
cpp_buffer *buffer = pfile->buffer;
if (buffer->prev == 0)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"#pragma system_header ignored outside include file");
else
{
@@ -1242,14 +1252,15 @@ do_pragma_dependency (cpp_reader *pfile)
ordering = _cpp_compare_file_date (pfile, fname, angle_brackets);
if (ordering < 0)
- cpp_error (pfile, DL_WARNING, "cannot find source file %s", fname);
+ cpp_error (pfile, CPP_DL_WARNING, "cannot find source file %s", fname);
else if (ordering > 0)
{
- cpp_error (pfile, DL_WARNING, "current file is older than %s", fname);
+ cpp_error (pfile, CPP_DL_WARNING,
+ "current file is older than %s", fname);
if (cpp_get_token (pfile)->type != CPP_EOF)
{
_cpp_backup_tokens (pfile, 1);
- do_diagnostic (pfile, DL_WARNING, 0);
+ do_diagnostic (pfile, CPP_DL_WARNING, 0);
}
}
@@ -1358,7 +1369,7 @@ _cpp_do__Pragma (cpp_reader *pfile)
if (string)
destringize_and_run (pfile, &string->val.str);
else
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"_Pragma takes a parenthesized string literal");
}
@@ -1437,13 +1448,13 @@ do_else (cpp_reader *pfile)
struct if_stack *ifs = buffer->if_stack;
if (ifs == NULL)
- cpp_error (pfile, DL_ERROR, "#else without #if");
+ cpp_error (pfile, CPP_DL_ERROR, "#else without #if");
else
{
if (ifs->type == T_ELSE)
{
- cpp_error (pfile, DL_ERROR, "#else after #else");
- cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0,
+ cpp_error (pfile, CPP_DL_ERROR, "#else after #else");
+ cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0,
"the conditional began here");
}
ifs->type = T_ELSE;
@@ -1470,13 +1481,13 @@ do_elif (cpp_reader *pfile)
struct if_stack *ifs = buffer->if_stack;
if (ifs == NULL)
- cpp_error (pfile, DL_ERROR, "#elif without #if");
+ cpp_error (pfile, CPP_DL_ERROR, "#elif without #if");
else
{
if (ifs->type == T_ELSE)
{
- cpp_error (pfile, DL_ERROR, "#elif after #else");
- cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0,
+ cpp_error (pfile, CPP_DL_ERROR, "#elif after #else");
+ cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0,
"the conditional began here");
}
ifs->type = T_ELIF;
@@ -1505,7 +1516,7 @@ do_endif (cpp_reader *pfile)
struct if_stack *ifs = buffer->if_stack;
if (ifs == NULL)
- cpp_error (pfile, DL_ERROR, "#endif without #if");
+ cpp_error (pfile, CPP_DL_ERROR, "#endif without #if");
else
{
/* Only check EOL if was not originally skipping. */
@@ -1582,7 +1593,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type)
if (type == T_UNASSERT && paren->type == CPP_EOF)
return 0;
- cpp_error (pfile, DL_ERROR, "missing '(' after predicate");
+ cpp_error (pfile, CPP_DL_ERROR, "missing '(' after predicate");
return 1;
}
@@ -1597,7 +1608,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type)
if (token->type == CPP_EOF)
{
- cpp_error (pfile, DL_ERROR, "missing ')' to complete answer");
+ cpp_error (pfile, CPP_DL_ERROR, "missing ')' to complete answer");
return 1;
}
@@ -1617,7 +1628,7 @@ parse_answer (cpp_reader *pfile, struct answer **answerp, int type)
if (acount == 0)
{
- cpp_error (pfile, DL_ERROR, "predicate's answer is empty");
+ cpp_error (pfile, CPP_DL_ERROR, "predicate's answer is empty");
return 1;
}
@@ -1644,9 +1655,9 @@ parse_assertion (cpp_reader *pfile, struct answer **answerp, int type)
*answerp = 0;
predicate = cpp_get_token (pfile);
if (predicate->type == CPP_EOF)
- cpp_error (pfile, DL_ERROR, "assertion without predicate");
+ cpp_error (pfile, CPP_DL_ERROR, "assertion without predicate");
else if (predicate->type != CPP_NAME)
- cpp_error (pfile, DL_ERROR, "predicate must be an identifier");
+ cpp_error (pfile, CPP_DL_ERROR, "predicate must be an identifier");
else if (parse_answer (pfile, answerp, type) == 0)
{
unsigned int len = NODE_LEN (predicate->val.node);
@@ -1730,7 +1741,7 @@ do_assert (cpp_reader *pfile)
{
if (*find_answer (node, new_answer))
{
- cpp_error (pfile, DL_WARNING, "\"%s\" re-asserted",
+ cpp_error (pfile, CPP_DL_WARNING, "\"%s\" re-asserted",
NODE_NAME (node) + 1);
return;
}
@@ -1940,7 +1951,7 @@ _cpp_pop_buffer (cpp_reader *pfile)
/* Walk back up the conditional stack till we reach its level at
entry to this file, issuing error messages. */
for (ifs = buffer->if_stack; ifs; ifs = ifs->next)
- cpp_error_with_line (pfile, DL_ERROR, ifs->line, 0,
+ cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0,
"unterminated #%s", dtable[ifs->type].name);
/* In case of a missing #endif. */
diff --git a/gcc/cpplib.h b/gcc/cpplib.h
index 15187c49078..5f189245eb5 100644
--- a/gcc/cpplib.h
+++ b/gcc/cpplib.h
@@ -219,7 +219,7 @@ struct cpp_options
/* Nonzero means use extra default include directories for C++. */
unsigned char cplusplus;
- /* Nonzero means handle cplusplus style comments */
+ /* Nonzero means handle cplusplus style comments. */
unsigned char cplusplus_comments;
/* Nonzero means define __OBJC__, treat @ as a special token, and
@@ -655,21 +655,21 @@ cpp_num cpp_num_sign_extend (cpp_num, size_t);
with a line number of zero. */
/* Warning, an error with -Werror. */
-#define DL_WARNING 0x00
-/* Same as DL_WARNING, except it is not suppressed in system headers. */
-#define DL_WARNING_SYSHDR 0x01
+#define CPP_DL_WARNING 0x00
+/* Same as CPP_DL_WARNING, except it is not suppressed in system headers. */
+#define CPP_DL_WARNING_SYSHDR 0x01
/* Warning, an error with -pedantic-errors or -Werror. */
-#define DL_PEDWARN 0x02
+#define CPP_DL_PEDWARN 0x02
/* An error. */
-#define DL_ERROR 0x03
+#define CPP_DL_ERROR 0x03
/* An internal consistency check failed. Prints "internal error: ",
- otherwise the same as DL_ERROR. */
-#define DL_ICE 0x04
+ otherwise the same as CPP_DL_ERROR. */
+#define CPP_DL_ICE 0x04
/* Extracts a diagnostic level from an int. */
-#define DL_EXTRACT(l) (l & 0xf)
+#define CPP_DL_EXTRACT(l) (l & 0xf)
/* Nonzero if a diagnostic level is one of the warnings. */
-#define DL_WARNING_P(l) (DL_EXTRACT (l) >= DL_WARNING \
- && DL_EXTRACT (l) <= DL_PEDWARN)
+#define CPP_DL_WARNING_P(l) (CPP_DL_EXTRACT (l) >= CPP_DL_WARNING \
+ && CPP_DL_EXTRACT (l) <= CPP_DL_PEDWARN)
/* N.B. The error-message-printer prototypes have not been nicely
formatted because exgettext needs to see 'msgid' on the same line
diff --git a/gcc/cppmacro.c b/gcc/cppmacro.c
index 43f688ab7a0..efae0f094e1 100644
--- a/gcc/cppmacro.c
+++ b/gcc/cppmacro.c
@@ -81,7 +81,7 @@ _cpp_warn_if_unused_macro (cpp_reader *pfile, cpp_hashnode *node,
if (!macro->used
&& MAIN_FILE_P (linemap_lookup (&pfile->line_maps, macro->line)))
- cpp_error_with_line (pfile, DL_WARNING, macro->line, 0,
+ cpp_error_with_line (pfile, CPP_DL_WARNING, macro->line, 0,
"macro \"%s\" is not used", NODE_NAME (node));
}
@@ -122,7 +122,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
switch (node->value.builtin)
{
default:
- cpp_error (pfile, DL_ICE, "invalid built-in macro \"%s\"",
+ cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"",
NODE_NAME (node));
break;
@@ -217,7 +217,7 @@ _cpp_builtin_macro_text (cpp_reader *pfile, cpp_hashnode *node)
}
else
{
- cpp_errno (pfile, DL_WARNING,
+ cpp_errno (pfile, CPP_DL_WARNING,
"could not determine date and time");
pfile->date = U"\"??? ?? ????\"";
@@ -277,7 +277,7 @@ builtin_macro (cpp_reader *pfile, cpp_hashnode *node)
pfile->cur_token = _cpp_temp_token (pfile);
push_token_context (pfile, NULL, _cpp_lex_direct (pfile), 1);
if (pfile->buffer->cur != pfile->buffer->rlimit)
- cpp_error (pfile, DL_ICE, "invalid built-in macro \"%s\"",
+ cpp_error (pfile, CPP_DL_ICE, "invalid built-in macro \"%s\"",
NODE_NAME (node));
_cpp_pop_buffer (pfile);
@@ -389,7 +389,7 @@ stringify_arg (cpp_reader *pfile, macro_arg *arg)
/* Ignore the final \ of invalid string literals. */
if (backslash_count & 1)
{
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"invalid string literal, ignoring final '\\'");
dest--;
}
@@ -472,7 +472,7 @@ paste_all_tokens (cpp_reader *pfile, const cpp_token *lhs)
/* Mandatory error for all apart from assembler. */
if (CPP_OPTION (pfile, lang) != CLK_ASM)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"pasting \"%s\" and \"%s\" does not give a valid preprocessing token",
cpp_token_as_text (pfile, lhs),
cpp_token_as_text (pfile, rhs));
@@ -510,17 +510,17 @@ _cpp_arguments_ok (cpp_reader *pfile, cpp_macro *macro, const cpp_hashnode *node
if (argc + 1 == macro->paramc && macro->variadic)
{
if (CPP_PEDANTIC (pfile) && ! macro->syshdr)
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"ISO C99 requires rest arguments to be used");
return true;
}
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"macro \"%s\" requires %u arguments, but only %u given",
NODE_NAME (node), macro->paramc, argc);
}
else
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"macro \"%s\" passed %u arguments, but takes just %u",
NODE_NAME (node), argc, macro->paramc);
@@ -631,7 +631,7 @@ collect_args (cpp_reader *pfile, const cpp_hashnode *node)
callers at the end of an -include-d file. */
if (pfile->context->prev || pfile->state.in_directive)
_cpp_backup_tokens (pfile, 1);
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"unterminated argument list invoking macro \"%s\"",
NODE_NAME (node));
}
@@ -734,7 +734,7 @@ enter_macro_context (cpp_reader *pfile, cpp_hashnode *node)
if (buff == NULL)
{
if (CPP_WTRADITIONAL (pfile) && ! node->value.macro->syshdr)
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"function-like macro \"%s\" must be used with arguments in traditional C",
NODE_NAME (node));
@@ -1238,7 +1238,7 @@ _cpp_save_parameter (cpp_reader *pfile, cpp_macro *macro, cpp_hashnode *node)
/* Constraint 6.10.3.6 - duplicate parameter names. */
if (node->flags & NODE_MACRO_ARG)
{
- cpp_error (pfile, DL_ERROR, "duplicate macro parameter \"%s\"",
+ cpp_error (pfile, CPP_DL_ERROR, "duplicate macro parameter \"%s\"",
NODE_NAME (node));
return true;
}
@@ -1282,7 +1282,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro)
&& ! CPP_OPTION (pfile, discard_comments_in_macro_exp))
continue;
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"\"%s\" may not appear in macro parameter list",
cpp_token_as_text (pfile, token));
return false;
@@ -1290,7 +1290,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro)
case CPP_NAME:
if (prev_ident)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"macro parameters must be comma-separated");
return false;
}
@@ -1308,7 +1308,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro)
case CPP_COMMA:
if (!prev_ident)
{
- cpp_error (pfile, DL_ERROR, "parameter name missing");
+ cpp_error (pfile, CPP_DL_ERROR, "parameter name missing");
return false;
}
prev_ident = 0;
@@ -1322,11 +1322,11 @@ parse_params (cpp_reader *pfile, cpp_macro *macro)
pfile->spec_nodes.n__VA_ARGS__);
pfile->state.va_args_ok = 1;
if (! CPP_OPTION (pfile, c99) && CPP_OPTION (pfile, pedantic))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"anonymous variadic macros were introduced in C99");
}
else if (CPP_OPTION (pfile, pedantic))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"ISO C does not permit named variadic macros");
/* We're at the end, and just expect a closing parenthesis. */
@@ -1336,7 +1336,7 @@ parse_params (cpp_reader *pfile, cpp_macro *macro)
/* Fall through. */
case CPP_EOF:
- cpp_error (pfile, DL_ERROR, "missing ')' in macro parameter list");
+ cpp_error (pfile, CPP_DL_ERROR, "missing ')' in macro parameter list");
return false;
}
}
@@ -1398,7 +1398,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
macro->fun_like = 1;
}
else if (ctoken->type != CPP_EOF && !(ctoken->flags & PREV_WHITE))
- cpp_error (pfile, DL_PEDWARN,
+ cpp_error (pfile, CPP_DL_PEDWARN,
"ISO C requires whitespace after the macro name");
if (macro->fun_like)
@@ -1426,7 +1426,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
/* Let assembler get away with murder. */
else if (CPP_OPTION (pfile, lang) != CLK_ASM)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"'#' is not followed by a macro parameter");
return false;
}
@@ -1445,7 +1445,7 @@ create_iso_definition (cpp_reader *pfile, cpp_macro *macro)
if (macro->count == 0 || token->type == CPP_EOF)
{
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"'##' cannot appear at either end of a macro expansion");
return false;
}
@@ -1529,11 +1529,11 @@ _cpp_create_definition (cpp_reader *pfile, cpp_hashnode *node)
if (warn_of_redefinition (pfile, node, macro))
{
- cpp_error_with_line (pfile, DL_PEDWARN, pfile->directive_line, 0,
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN, pfile->directive_line, 0,
"\"%s\" redefined", NODE_NAME (node));
if (node->type == NT_MACRO && !(node->flags & NODE_BUILTIN))
- cpp_error_with_line (pfile, DL_PEDWARN,
+ cpp_error_with_line (pfile, CPP_DL_PEDWARN,
node->value.macro->line, 0,
"this is the location of the previous definition");
}
@@ -1584,7 +1584,7 @@ check_trad_stringification (cpp_reader *pfile, const cpp_macro *macro,
if (NODE_LEN (node) == len
&& !memcmp (p, NODE_NAME (node), len))
{
- cpp_error (pfile, DL_WARNING,
+ cpp_error (pfile, CPP_DL_WARNING,
"macro argument \"%s\" would be stringified in traditional C",
NODE_NAME (node));
break;
@@ -1607,7 +1607,7 @@ cpp_macro_definition (cpp_reader *pfile, const cpp_hashnode *node)
if (node->type != NT_MACRO || (node->flags & NODE_BUILTIN))
{
- cpp_error (pfile, DL_ICE,
+ cpp_error (pfile, CPP_DL_ICE,
"invalid hash type %d in cpp_macro_definition", node->type);
return 0;
}
diff --git a/gcc/cpppch.c b/gcc/cpppch.c
index 71c7aae98dd..872908de0bd 100644
--- a/gcc/cpppch.c
+++ b/gcc/cpppch.c
@@ -80,7 +80,8 @@ write_macdef (cpp_reader *pfile, cpp_hashnode *hn, void *file_p)
if (fwrite (&s, sizeof (s), 1, f) != 1
|| fwrite (defn, 1, s.definition_length, f) != s.definition_length)
{
- cpp_errno (pfile, DL_ERROR, "while writing precompiled header");
+ cpp_errno (pfile, CPP_DL_ERROR,
+ "while writing precompiled header");
return 0;
}
}
@@ -328,7 +329,7 @@ cpp_write_pch_deps (cpp_reader *r, FILE *f)
if (fwrite (&z, sizeof (z), 1, f) != 1
|| fwrite (ss->definedstrs, ss->hashsize, 1, f) != 1)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
free (ss->definedstrs);
@@ -352,7 +353,7 @@ cpp_write_pch_state (cpp_reader *r, FILE *f)
memset (&z, 0, sizeof (z));
if (fwrite (&z, sizeof (z), 1, f) != 1)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
@@ -361,7 +362,7 @@ cpp_write_pch_state (cpp_reader *r, FILE *f)
if (deps_save (r->deps, f) != 0)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
@@ -458,7 +459,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
|| h->flags & NODE_POISONED)
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' not defined",
name, m.name_length, namebuf);
goto fail;
@@ -470,7 +471,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
|| memcmp (namebuf, newdefn, m.definition_length) != 0)
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' defined as `%s' not `%.*s'",
name, m.name_length, namebuf, newdefn + m.name_length,
m.definition_length - m.name_length,
@@ -511,7 +512,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
else
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%s' is defined",
name, first);
goto fail;
@@ -525,7 +526,7 @@ cpp_valid_state (cpp_reader *r, const char *name, int fd)
return 0;
error:
- cpp_errno (r, DL_ERROR, "while reading precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header");
return -1;
fail:
@@ -711,6 +712,6 @@ cpp_read_state (cpp_reader *r, const char *name, FILE *f,
return 0;
error:
- cpp_errno (r, DL_ERROR, "while reading precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header");
return -1;
}
diff --git a/gcc/cpptrad.c b/gcc/cpptrad.c
index e2ccb0bdcbd..08636edb7a5 100644
--- a/gcc/cpptrad.c
+++ b/gcc/cpptrad.c
@@ -158,7 +158,7 @@ copy_comment (cpp_reader *pfile, const uchar *cur, int in_define)
unterminated = _cpp_skip_block_comment (pfile);
if (unterminated)
- cpp_error_with_line (pfile, DL_ERROR, from_line, 0,
+ cpp_error_with_line (pfile, CPP_DL_ERROR, from_line, 0,
"unterminated comment");
/* Comments in directives become spaces so that tokens are properly
@@ -350,6 +350,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
unsigned int c, paren_depth = 0, quote;
enum ls lex_state = ls_none;
bool header_ok;
+ const uchar *start_of_input_line;
fmacro.buff = NULL;
@@ -359,6 +360,9 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
RLIMIT (pfile->context) = pfile->buffer->rlimit;
pfile->out.cur = pfile->out.base;
pfile->out.first_line = pfile->line;
+ /* start_of_input_line is needed to make sure that directives really,
+ really start at the first character of the line. */
+ start_of_input_line = pfile->buffer->cur;
new_context:
context = pfile->context;
cur = CUR (context);
@@ -581,7 +585,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
break;
case '#':
- if (out - 1 == pfile->out.base
+ if (cur - 1 == start_of_input_line
/* A '#' from a macro doesn't start a directive. */
&& !pfile->context->prev
&& !pfile->state.in_directive)
@@ -667,7 +671,7 @@ _cpp_scan_out_logical_line (cpp_reader *pfile, cpp_macro *macro)
_cpp_release_buff (pfile, fmacro.buff);
if (lex_state == ls_fun_close)
- cpp_error_with_line (pfile, DL_ERROR, fmacro.line, 0,
+ cpp_error_with_line (pfile, CPP_DL_ERROR, fmacro.line, 0,
"unterminated argument list invoking macro \"%s\"",
NODE_NAME (fmacro.node));
return result;
@@ -736,7 +740,7 @@ recursive_macro (cpp_reader *pfile, cpp_hashnode *node)
}
if (recursing)
- cpp_error (pfile, DL_ERROR,
+ cpp_error (pfile, CPP_DL_ERROR,
"detected recursion whilst expanding macro \"%s\"",
NODE_NAME (node));
@@ -903,6 +907,9 @@ scan_parameters (cpp_reader *pfile, cpp_macro *macro)
break;
}
+ if (!ok)
+ cpp_error (pfile, CPP_DL_ERROR, "syntax error in macro parameter list");
+
CUR (pfile->context) = cur + (*cur == ')');
return ok;
@@ -978,14 +985,17 @@ _cpp_create_trad_definition (cpp_reader *pfile, cpp_macro *macro)
/* Is this a function-like macro? */
if (* CUR (context) == '(')
{
+ bool ok = scan_parameters (pfile, macro);
+
+ /* Remember the params so we can clear NODE_MACRO_ARG flags. */
+ macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff);
+
/* Setting macro to NULL indicates an error occurred, and
prevents unnecessary work in _cpp_scan_out_logical_line. */
- if (!scan_parameters (pfile, macro))
+ if (!ok)
macro = NULL;
else
{
- /* Success. Commit the parameter array. */
- macro->params = (cpp_hashnode **) BUFF_FRONT (pfile->a_buff);
BUFF_FRONT (pfile->a_buff) = (uchar *) &macro->params[macro->paramc];
macro->fun_like = 1;
}
diff --git a/gcc/crtstuff.c b/gcc/crtstuff.c
index a5c46d602a5..b9a29a0ba60 100644
--- a/gcc/crtstuff.c
+++ b/gcc/crtstuff.c
@@ -120,15 +120,16 @@ call_ ## FUNC (void) \
/* References to __register_frame_info and __deregister_frame_info should
be weak in this file if at all possible. */
-extern void __register_frame_info (void *, struct object *)
+extern void __register_frame_info (const void *, struct object *)
TARGET_ATTRIBUTE_WEAK;
-extern void __register_frame_info_bases (void *, struct object *,
+extern void __register_frame_info_bases (const void *, struct object *,
void *, void *)
TARGET_ATTRIBUTE_WEAK;
-extern void *__deregister_frame_info (void *)
+extern void *__deregister_frame_info (const void *)
TARGET_ATTRIBUTE_WEAK;
-extern void *__deregister_frame_info_bases (void *)
+extern void *__deregister_frame_info_bases (const void *)
TARGET_ATTRIBUTE_WEAK;
+extern void __do_global_ctors_1 (void);
/* Likewise for _Jv_RegisterClasses. */
extern void _Jv_RegisterClasses (void *) TARGET_ATTRIBUTE_WEAK;
@@ -361,6 +362,8 @@ __do_global_ctors_aux (void) /* prologue goes in .init section */
#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+extern void __do_global_dtors (void);
+
/* This case is used by the Irix 6 port, which supports named sections but
not an SVR4-style .fini section. __do_global_dtors can be non-static
in this case because we protect it with -hidden_symbol. */
@@ -507,10 +510,11 @@ asm (TEXT_SECTION_ASM_OP);
#elif defined(HAS_INIT_SECTION) /* ! INIT_SECTION_ASM_OP */
+extern void __do_global_ctors (void);
+
/* This case is used by the Irix 6 port, which supports named sections but
not an SVR4-style .init section. __do_global_ctors can be non-static
in this case because we protect it with -hidden_symbol. */
-extern void __do_global_ctors_1(void);
void
__do_global_ctors (void)
{
diff --git a/gcc/cse.c b/gcc/cse.c
index 7612a5a7ed5..4b0f1eced4c 100644
--- a/gcc/cse.c
+++ b/gcc/cse.c
@@ -5827,6 +5827,16 @@ cse_insn (rtx insn, rtx libcall_insn)
enum machine_mode mode
= GET_MODE (src) == VOIDmode ? GET_MODE (dest) : GET_MODE (src);
+ /* It's possible that we have a source value known to be
+ constant but don't have a REG_EQUAL note on the insn.
+ Lack of a note will mean src_eqv_elt will be NULL. This
+ can happen where we've generated a SUBREG to access a
+ CONST_INT that is already in a register in a wider mode.
+ Ensure that the source expression is put in the proper
+ constant class. */
+ if (!classp)
+ classp = sets[i].src_const_elt;
+
if (sets[i].src_elt == 0)
{
/* Don't put a hard register source into the table if this is
@@ -6676,6 +6686,10 @@ cse_set_around_loop (rtx x, rtx insn, rtx loop_start)
}
else
{
+ if (CONSTANT_P (SET_SRC (set))
+ && ! find_reg_equal_equiv_note (insn))
+ set_unique_reg_note (insn, REG_EQUAL,
+ SET_SRC (set));
if (control_flow_insn_p (p))
/* p can cause a control flow transfer so it
is the last insn of a basic block. We can't
diff --git a/gcc/dbxout.c b/gcc/dbxout.c
index ef04c831134..dee3839974a 100644
--- a/gcc/dbxout.c
+++ b/gcc/dbxout.c
@@ -185,19 +185,28 @@ enum binclstatus {BINCL_NOT_REQUIRED, BINCL_PENDING, BINCL_PROCESSED};
pair of the file number and the type number within the file.
This is a stack of input files. */
-struct dbx_file GTY(())
+struct dbx_file
{
struct dbx_file *next;
int file_number;
int next_type_number;
- enum binclstatus bincl_status; /* Keep track of lazy bincl. */
- const char *pending_bincl_name; /* Name of bincl. */
- struct dbx_file *prev; /* Chain to traverse all pending bincls. */
+ enum binclstatus bincl_status; /* Keep track of lazy bincl. */
+ const char *pending_bincl_name; /* Name of bincl. */
+ struct dbx_file *prev; /* Chain to traverse all pending bincls. */
};
-/* This is the top of the stack. */
-
-static GTY(()) struct dbx_file *current_file;
+/* This is the top of the stack.
+
+ This is not saved for PCH, because restoring a PCH should not change it.
+ next_file_number does have to be saved, because the PCH may use some
+ file numbers; however, just before restoring a PCH, next_file_number
+ should always be 0 because we should not have needed any file numbers
+ yet. */
+
+#if (defined (DBX_DEBUGGING_INFO) || defined (XCOFF_DEBUGGING_INFO)) \
+ && defined (DBX_USE_BINCL)
+static struct dbx_file *current_file;
+#endif
/* This is the next file number to use. */
@@ -513,7 +522,7 @@ dbxout_init (const char *input_file_name)
next_type_number = 1;
#ifdef DBX_USE_BINCL
- current_file = ggc_alloc (sizeof *current_file);
+ current_file = xmalloc (sizeof *current_file);
current_file->next = NULL;
current_file->file_number = 0;
current_file->next_type_number = 1;
@@ -625,7 +634,7 @@ dbxout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
const char *filename ATTRIBUTE_UNUSED)
{
#ifdef DBX_USE_BINCL
- struct dbx_file *n = ggc_alloc (sizeof *n);
+ struct dbx_file *n = xmalloc (sizeof *n);
n->next = current_file;
n->next_type_number = 1;
diff --git a/gcc/defaults.h b/gcc/defaults.h
index 0070c6d7586..afe788cdd26 100644
--- a/gcc/defaults.h
+++ b/gcc/defaults.h
@@ -382,10 +382,6 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
#define POINTER_SIZE BITS_PER_WORD
#endif
-#ifndef BUILD_VA_LIST_TYPE
-#define BUILD_VA_LIST_TYPE(X) ((X) = ptr_type_node)
-#endif
-
#ifndef PIC_OFFSET_TABLE_REGNUM
#define PIC_OFFSET_TABLE_REGNUM INVALID_REGNUM
#endif
@@ -489,7 +485,7 @@ do { fputs (integer_asm_op (POINTER_SIZE / UNITS_PER_WORD, TRUE), FILE); \
PREFERRED_DEBUGGING_TYPE to choose a format in a system-dependent way.
This is one long line cause VAXC can't handle a \-newline. */
-#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO))
+#if 1 < (defined (DBX_DEBUGGING_INFO) + defined (SDB_DEBUGGING_INFO) + defined (DWARF2_DEBUGGING_INFO) + defined (XCOFF_DEBUGGING_INFO) + defined (VMS_DEBUGGING_INFO))
#ifndef PREFERRED_DEBUGGING_TYPE
You Lose! You must define PREFERRED_DEBUGGING_TYPE!
#endif /* no PREFERRED_DEBUGGING_TYPE */
@@ -689,4 +685,15 @@ You Lose! You must define PREFERRED_DEBUGGING_TYPE!
fprintf ((FILE), "%s", reg_names[REGNO (RTX)])
#endif
+#ifndef LOCAL_REGNO
+#define LOCAL_REGNO(REGNO) 0
+#endif
+
+/* 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. */
+#ifndef EXIT_IGNORE_STACK
+#define EXIT_IGNORE_STACK 0
+#endif
+
#endif /* ! GCC_DEFAULTS_H */
diff --git a/gcc/df.c b/gcc/df.c
index ae99d8eb64f..96c8ad8dbd2 100644
--- a/gcc/df.c
+++ b/gcc/df.c
@@ -971,7 +971,7 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type,
return;
case MEM:
- df_uses_record (df, &XEXP (x, 0), DF_REF_REG_MEM_LOAD, bb, insn, flags);
+ df_uses_record (df, &XEXP (x, 0), DF_REF_REG_MEM_LOAD, bb, insn, 0);
return;
case SUBREG:
@@ -987,7 +987,6 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type,
/* ... Fall through ... */
case REG:
- /* See a REG (or SUBREG) other than being set. */
df_ref_record (df, x, loc, insn, ref_type, flags);
return;
@@ -999,14 +998,12 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type,
switch (GET_CODE (dst))
{
- enum df_ref_flags use_flags;
case SUBREG:
if ((df->flags & DF_FOR_REGALLOC) == 0
&& read_modify_subreg_p (dst))
{
- use_flags = DF_REF_READ_WRITE;
df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb,
- insn, use_flags);
+ insn, DF_REF_READ_WRITE);
break;
}
/* ... FALLTHRU ... */
@@ -1025,9 +1022,8 @@ df_uses_record (struct df *df, rtx *loc, enum df_ref_type ref_type,
dst = XEXP (dst, 0);
if (GET_CODE (dst) != SUBREG)
abort ();
- use_flags = DF_REF_READ_WRITE;
df_uses_record (df, &SUBREG_REG (dst), DF_REF_REG_USE, bb,
- insn, use_flags);
+ insn, DF_REF_READ_WRITE);
break;
case ZERO_EXTRACT:
case SIGN_EXTRACT:
@@ -1219,14 +1215,14 @@ df_bb_refs_record (struct df *df, basic_block bb)
rtx insn;
/* Scan the block an insn at a time from beginning to end. */
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
{
/* Record defs within INSN. */
df_insn_refs_record (df, bb, insn);
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
@@ -1259,7 +1255,7 @@ df_bb_reg_def_chain_create (struct df *df, basic_block bb)
scan the basic blocks in reverse order so that the first defs
appear at the start of the chain. */
- for (insn = bb->end; insn && insn != PREV_INSN (bb->head);
+ for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn))
{
struct df_link *link;
@@ -1311,7 +1307,7 @@ df_bb_reg_use_chain_create (struct df *df, basic_block bb)
/* Scan in forward order so that the last uses appear at the start
of the chain. */
- for (insn = bb->head; insn && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
struct df_link *link;
@@ -1364,7 +1360,7 @@ df_bb_du_chain_create (struct df *df, basic_block bb, bitmap ru)
/* For each def in BB create a linked list (chain) of uses
reached from the def. */
- for (insn = bb->end; insn && insn != PREV_INSN (bb->head);
+ for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn))
{
struct df_link *def_link;
@@ -1441,7 +1437,7 @@ df_bb_ud_chain_create (struct df *df, basic_block bb)
/* For each use in BB create a linked list (chain) of defs
that reach the use. */
- for (insn = bb->head; insn && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
unsigned int uid = INSN_UID (insn);
@@ -1551,7 +1547,7 @@ df_bb_rd_local_compute (struct df *df, basic_block bb)
struct bb_info *bb_info = DF_BB_INFO (df, bb);
rtx insn;
- for (insn = bb->head; insn && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
unsigned int uid = INSN_UID (insn);
@@ -1615,7 +1611,7 @@ df_bb_ru_local_compute (struct df *df, basic_block bb)
rtx insn;
- for (insn = bb->end; insn && insn != PREV_INSN (bb->head);
+ for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn))
{
unsigned int uid = INSN_UID (insn);
@@ -1678,7 +1674,7 @@ df_bb_lr_local_compute (struct df *df, basic_block bb)
struct bb_info *bb_info = DF_BB_INFO (df, bb);
rtx insn;
- for (insn = bb->end; insn && insn != PREV_INSN (bb->head);
+ for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn))
{
unsigned int uid = INSN_UID (insn);
@@ -1733,7 +1729,7 @@ df_bb_reg_info_compute (struct df *df, basic_block bb, bitmap live)
bitmap_copy (live, bb_info->lr_out);
- for (insn = bb->end; insn && insn != PREV_INSN (bb->head);
+ for (insn = BB_END (bb); insn && insn != PREV_INSN (BB_HEAD (bb));
insn = PREV_INSN (insn))
{
unsigned int uid = INSN_UID (insn);
@@ -1799,13 +1795,13 @@ df_bb_luids_set (struct df *df, basic_block bb)
/* The LUIDs are monotonically increasing for each basic block. */
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
DF_INSN_LUID (df, insn) = luid++;
DF_INSN_LUID (df, insn) = luid;
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
return luid;
@@ -2100,7 +2096,7 @@ df_bb_refs_update (struct df *df, basic_block bb)
a bitmap for insns_modified saves memory and avoids queuing
duplicates. */
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
unsigned int uid;
@@ -2116,7 +2112,7 @@ df_bb_refs_update (struct df *df, basic_block bb)
count++;
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
return count;
@@ -2252,14 +2248,14 @@ df_bb_refs_unlink (struct df *df, basic_block bb)
rtx insn;
/* Scan the block an insn at a time from beginning to end. */
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
{
/* Unlink refs for INSN. */
df_insn_refs_unlink (df, bb, insn);
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
@@ -2298,7 +2294,7 @@ df_insn_delete (struct df *df, basic_block bb ATTRIBUTE_UNUSED, rtx insn)
handle the JUMP_LABEL? */
/* We should not be deleting the NOTE_INSN_BASIC_BLOCK or label. */
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
abort ();
/* Delete the insn. */
@@ -2595,7 +2591,7 @@ df_pattern_emit_before (struct df *df, rtx pattern, basic_block bb, rtx insn)
rtx prev_insn = PREV_INSN (insn);
/* We should not be inserting before the start of the block. */
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
abort ();
ret_insn = emit_insn_before (pattern, insn);
if (ret_insn == insn)
diff --git a/gcc/diagnostic.c b/gcc/diagnostic.c
index c29867a60b3..badad530e6e 100644
--- a/gcc/diagnostic.c
+++ b/gcc/diagnostic.c
@@ -66,7 +66,7 @@ diagnostic_context *global_dc = &global_diagnostic_context;
#define bug_report_request \
"Please submit a full bug report,\n\
with preprocessed source if appropriate.\n\
-See %s for instructions.\n"
+Send email to %s for instructions.\n"
/* Return a malloc'd string containing MSG formatted a la printf. The
diff --git a/gcc/doc/.cvsignore b/gcc/doc/.cvsignore
deleted file mode 100644
index 169b3ef6992..00000000000
--- a/gcc/doc/.cvsignore
+++ /dev/null
@@ -1,7 +0,0 @@
-*.info*
-gcc.1
-cpp.1
-gcov.1
-gfdl.7
-gpl.7
-fsf-funding.7
diff --git a/gcc/doc/c-tree.texi b/gcc/doc/c-tree.texi
index 29ccaec317d..9151fec67f5 100644
--- a/gcc/doc/c-tree.texi
+++ b/gcc/doc/c-tree.texi
@@ -788,7 +788,7 @@ This predicate holds whenever its argument represents a class-type with
default constructor.
@item CLASSTYPE_HAS_MUTABLE
-@item TYPE_HAS_MUTABLE_P
+@itemx TYPE_HAS_MUTABLE_P
These predicates hold for a class-type having a mutable data member.
@item CLASSTYPE_NON_POD_P
@@ -1546,10 +1546,10 @@ This is used for branch prediction.
Used to represent a C++ @code{catch} block. The @code{HANDLER_TYPE}
is the type of exception that will be caught by this handler; it is
-equal (by pointer equality) to @code{CATCH_ALL_TYPE} if this handler
-is for all types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for
-the catch parameter, and @code{HANDLER_BODY} is the
-@code{COMPOUND_STMT} for the block itself.
+equal (by pointer equality) to @code{NULL} if this handler is for all
+types. @code{HANDLER_PARMS} is the @code{DECL_STMT} for the catch
+parameter, and @code{HANDLER_BODY} is the @code{COMPOUND_STMT} for the
+block itself.
@item IF_STMT
@@ -1991,7 +1991,7 @@ real part and the second operand is the imaginary part.
These nodes represent the conjugate of their operand.
@item REALPART_EXPR
-@item IMAGPART_EXPR
+@itemx IMAGPART_EXPR
These nodes represent respectively the real and the imaginary parts
of complex numbers (their sole argument).
@@ -2234,10 +2234,7 @@ 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
@code{FIELD_DECL} and the @code{TREE_VALUE} of each node will be the
-expression used to initialize that field. You should not depend on the
-fields appearing in any particular order, nor should you assume that all
-fields will be represented. Unrepresented fields may be assigned any
-value.
+expression used to initialize that field.
If the @code{TREE_TYPE} of the @code{CONSTRUCTOR} is an
@code{ARRAY_TYPE}, then the @code{TREE_PURPOSE} of each element in the
@@ -2247,8 +2244,10 @@ again, the @code{TREE_VALUE} is the corresponding initializer. If the
@code{TREE_PURPOSE} is @code{NULL_TREE}, then the initializer is for the
next available array element.
-Conceptually, before any initialization is done, the entire area of
-storage is initialized to zero.
+In the front end, you should not depend on the fields appearing in any
+particular order. However, in the middle end, fields must appear in
+declaration order. You should not assume that all fields will be
+represented. Unrepresented fields will be set to zero.
@item COMPOUND_LITERAL_EXPR
@findex COMPOUND_LITERAL_EXPR_DECL_STMT
diff --git a/gcc/doc/contrib.texi b/gcc/doc/contrib.texi
index 6d6377b4b0d..80399ed784f 100644
--- a/gcc/doc/contrib.texi
+++ b/gcc/doc/contrib.texi
@@ -36,6 +36,9 @@ port.
Alasdair Baird for various bug fixes.
@item
+Giovanni Bajo for analyzing lots of complicated C++ problem reports.
+
+@item
Peter Barada for his work to improve code generation for new
ColdFire cores.
@@ -309,6 +312,9 @@ the c30/c40 ports functional. Lots of loop and unroll improvements and
fixes.
@item
+Dara Hazeghi for wading through myriads of target-specific bug reports.
+
+@item
Kate Hedstrom for staking the g77 folks with an initial testsuite.
@item
@@ -339,6 +345,9 @@ Steve Holmgren for MachTen patches.
Jan Hubicka for his x86 port improvements.
@item
+Falk Hueffner for working on C and optimization bug reports.
+
+@item
Bernardo Innocenti for his m68k work, including merging of
ColdFire improvements and uClinux support.
@@ -555,7 +564,8 @@ Linux kernels.
Mike Moreton for his various Java patches.
@item
-David Mosberger-Tang for various Alpha improvements.
+David Mosberger-Tang for various Alpha improvements, and for the initial
+IA-64 port.
@item
Stephen Moshier contributed the floating point emulator that assists in
@@ -636,6 +646,9 @@ out lots of problems we need to solve, maintenance of the web pages, and
taking care of documentation maintenance in general.
@item
+Andrew Pinski for processing bug reports by the dozen.
+
+@item
Ovidiu Predescu for his work on the Objective-C front end and runtime
libraries.
diff --git a/gcc/doc/cpp.texi b/gcc/doc/cpp.texi
index 2db1ee1ff11..0ab1b3203ec 100644
--- a/gcc/doc/cpp.texi
+++ b/gcc/doc/cpp.texi
@@ -2086,7 +2086,7 @@ runtime is used, this macro is not defined, so that you can use this
macro to determine which runtime (NeXT or GNU) is being used.
@item __LP64__
-@item _LP64
+@itemx _LP64
These macros are defined, with value 1, if (and only if) the compilation
is for a target where @code{long int} and pointer both use 64-bits and
@code{int} uses 32-bit.
diff --git a/gcc/doc/cppopts.texi b/gcc/doc/cppopts.texi
index 4d509e859d1..2e7f50e37a6 100644
--- a/gcc/doc/cppopts.texi
+++ b/gcc/doc/cppopts.texi
@@ -456,8 +456,6 @@ Append @var{dir} to the prefix specified previously with
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}
@opindex isystem
Search @var{dir} for header files, after all directories specified by
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index e2982929e58..ac038554b9a 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -884,6 +884,11 @@ and later return that value, without knowing what data type
the function tried to return (as long as your caller expects
that data type).
+However, these built-in functions may interact badly with some
+sophisticated features or other extensions of the language. It
+is, therefore, not recommended to use them outside very simple
+functions acting as mere forwarders for their arguments.
+
@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
@@ -1069,7 +1074,8 @@ This will work with all versions of GCC@.
Compound expressions, conditional expressions and casts are allowed as
lvalues provided their operands are lvalues. This means that you can take
-their addresses or store values into them.
+their addresses or store values into them. All these extensions are
+deprecated.
Standard C++ allows compound expressions and conditional expressions
as lvalues, and permits casts to reference type, so use of this
@@ -3907,18 +3913,19 @@ 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
-operand and list it with the output operands.
-
-When the constraints for the read-write operand (or the operand in which
-only some of the bits are to be changed) allows a register, you may, as
-an alternative, logically split its function into two separate operands,
-one input operand and one write-only output operand. The connection
-between them is expressed by constraints which say they need to be in
-the same location when the instruction executes. You can use the same C
-expression for both operands, or different expressions. For example,
-here we write the (fictitious) @samp{combine} instruction with
-@code{bar} as its read-only source operand and @code{foo} as its
-read-write destination:
+operand and list it with the output operands. You should only use
+read-write operands when the constraints for the operand (or the
+operand in which only some of the bits are to be changed) allow a
+register.
+
+You may, as an alternative, logically split its function into two
+separate operands, one input operand and one write-only output
+operand. The connection between them is expressed by constraints
+which say they need to be in the same location when the instruction
+executes. You can use the same C expression for both operands, or
+different expressions. For example, here we write the (fictitious)
+@samp{combine} instruction with @code{bar} as its read-only source
+operand and @code{foo} as its read-write destination:
@example
asm ("combine %2,%0" : "=r" (foo) : "0" (foo), "g" (bar));
@@ -4721,8 +4728,8 @@ architecture does not allow for this specific SIMD type, gcc will
produce code that uses 4 @code{SIs}.
The types defined in this manner can be used with a subset of normal C
-operations. Currently, gcc will allow using the following operators on
-these types: @code{+, -, *, /, unary minus}@.
+operations. Currently, gcc will allow using the following operators
+on these types: @code{+, -, *, /, unary minus, ^, |, &, ~}@.
The operations behave like C++ @code{valarrays}. Addition is defined as
the addition of the corresponding elements of the operands. For
@@ -4738,9 +4745,10 @@ v4si a, b, c;
c = a + b;
@end example
-Subtraction, multiplication, and division operate in a similar manner.
-Likewise, the result of using the unary minus operator on a vector type
-is a vector whose elements are the negative value of the corresponding
+Subtraction, multiplication, division, and the logical operations
+operate in a similar manner. Likewise, the result of using the unary
+minus or complement operators on a vector type is a vector whose
+elements are the negative or complemented values of the corresponding
elements in the operand.
You can declare variables and use them in function calls and returns, as
@@ -7648,6 +7656,8 @@ Predefined Macros,cpp,The GNU 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.
+* Strong Using:: Strong using-directives for namespace composition.
+* Offsetof:: Special syntax for implementing @code{offsetof}.
* Java Exceptions:: Tweaking exception handling to work with Java.
* Deprecated Features:: Things will disappear from g++.
* Backwards Compatibility:: Compatibilities with earlier definitions of C++.
@@ -8248,6 +8258,64 @@ interface table mechanism, instead of regular virtual table dispatch.
@end table
+See also @xref{Strong Using}.
+
+@node Strong Using
+@section Strong Using
+
+A using-directive with @code{__attribute ((strong))} is stronger
+than a normal using-directive in two ways:
+
+@itemize @bullet
+@item
+Templates from the used namespace can be specialized as though they were members of the using namespace.
+
+@item
+The using namespace is considered an associated namespace of all
+templates in the used namespace for purposes of argument-dependent
+name lookup.
+@end itemize
+
+This is useful for composing a namespace transparently from
+implementation namespaces. For example:
+
+@smallexample
+namespace std @{
+ namespace debug @{
+ template <class T> struct A @{ @};
+ @}
+ using namespace debug __attribute ((__strong__));
+ template <> struct A<int> @{ @}; // ok to specialize
+
+ template <class T> void f (A<T>);
+@}
+
+int main()
+@{
+ f (std::A<float>()); // lookup finds std::f
+ f (std::A<int>());
+@}
+@end smallexample
+
+@node Offsetof
+@section Offsetof
+
+G++ uses a syntactic extension to implement the @code{offsetof} macro.
+
+In particular:
+
+@smallexample
+ __offsetof__ (expression)
+@end smallexample
+
+is equivalent to the parenthesized expression, except that the
+expression is considered an integral constant expression even if it
+contains certain operators that are not normally permitted in an
+integral constant expression. Users should never use
+@code{__offsetof__} directly; the only valid use of
+@code{__offsetof__} is to implement the @code{offsetof} macro in
+@code{<stddef.h>}.
+
@node Java Exceptions
@section Java Exceptions
diff --git a/gcc/doc/gcov.texi b/gcc/doc/gcov.texi
index 731a37a871f..8f0a23cae5d 100644
--- a/gcc/doc/gcov.texi
+++ b/gcc/doc/gcov.texi
@@ -249,8 +249,8 @@ information needed by gcov. These additional files are placed in the
directory where the object file is located.
Running the program will cause profile output to be generated. For each
-source file compiled with @option{-fprofile-arcs}, an accompanying @file{.da}
-file will be placed in the object file directory.
+source file compiled with @option{-fprofile-arcs}, an accompanying
+@file{.gcda} file will be placed in the object file directory.
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
@@ -410,7 +410,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 @file{.da} file, the count for the
+executed again without removing the @file{.gcda} 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
@@ -418,9 +418,9 @@ 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 @file{.da} files is saved immediately before the program
+The data in the @file{.gcda} 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
+profiling code first attempts to read in an existing @file{.gcda} 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.
@@ -463,6 +463,28 @@ executed 100 times. In one sense this result is correct, because there
was only one instruction representing all four of these lines. However,
the output does not indicate how many times the result was 0 and how
many times the result was 1.
+
+Inlineable functions can create unexpected line counts. Line counts are
+shown for the source code of the inlineable function, but what is shown
+depends on where the function is inlined, or if it is not inlined at all.
+
+If the function is not inlined, the compiler must emit an out of line
+copy of the function, in any object file that needs it. If
+@file{fileA.o} and @file{fileB.o} both contain out of line bodies of a
+particular inlineable function, they will also both contain coverage
+counts for that function. When @file{fileA.o} and @file{fileB.o} are
+linked together, the linker will, on many systems, select one of those
+out of line bodies for all calls to that function, and remove or ignore
+the other. Unfortunately, it will not remove the coverage counters for
+the unused function body. Hence when instrumented, all but one use of
+that function will show zero counts.
+
+If the function is inlined in several places, the block structure in
+each location might not be the same. For instance, a condition might
+now be calculable at compile time in some instances. Because the
+coverage of all the uses of the inline function will be shown for the
+same source lines, the line counts themselves might seem inconsistent.
+
@c man end
@node Gcov Data Files
diff --git a/gcc/doc/gty.texi b/gcc/doc/gty.texi
index 6d4f8394f42..56ce597f8dc 100644
--- a/gcc/doc/gty.texi
+++ b/gcc/doc/gty.texi
@@ -132,8 +132,19 @@ field really isn't ever used.
@itemx default
The type machinery needs to be told which field of a @code{union} is
-currently active. This is done by giving each field a constant @code{tag}
-value, and then specifying a discriminator using @code{desc}. For example,
+currently active. This is done by giving each field a constant
+@code{tag} value, and then specifying a discriminator using @code{desc}.
+The value of the expression given by @code{desc} is compared against
+each @code{tag} value, each of which should be different. If no
+@code{tag} is matched, the field marked with @code{default} is used if
+there is one, otherwise no field in the union will be marked.
+
+In the @code{desc} option, the ``current structure'' is the union that
+it discriminates. Use @code{%1} to mean the structure containing it.
+(There are no escapes available to the @code{tag} option, since it's
+supposed to be a constant.)
+
+For example,
@smallexample
struct tree_binding GTY(())
@{
@@ -141,19 +152,15 @@ struct tree_binding GTY(())
union tree_binding_u @{
tree GTY ((tag ("0"))) scope;
struct cp_binding_level * GTY ((tag ("1"))) level;
- @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) scope;
+ @} GTY ((desc ("BINDING_HAS_LEVEL_P ((tree)&%0)"))) xscope;
tree value;
@};
@end smallexample
-In the @code{desc} option, the ``current structure'' is the union that
-it discriminates. Use @code{%1} to mean the structure containing it.
-(There are no escapes available to the @code{tag} option, since it's
-supposed to be a constant.)
-
-Each @code{tag} should be different. If no @code{tag} is matched,
-the field marked with @code{default} is used if there is one, otherwise
-no field in the union will be marked.
+In this example, the value of BINDING_HAS_LEVEL_P when applied to a
+@code{struct tree_binding *} is presumed to be 0 or 1. If 1, the type
+mechanism will treat the field @code{level} as being present and if 0,
+will treat the field @code{scope} as being present.
@findex param_is
@findex use_param
diff --git a/gcc/doc/include/gcc-common.texi b/gcc/doc/include/gcc-common.texi
index 7bc6de85a99..2d934bda540 100644
--- a/gcc/doc/include/gcc-common.texi
+++ b/gcc/doc/include/gcc-common.texi
@@ -1,10 +1,10 @@
-@c Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+@c Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@c Common values used in the GCC manuals:
-@set version-GCC 3.4
+@set version-GCC 3.4.0
@c DEVELOPMENT is set to indicate an in-development version,
@c as compared to a release version. When making a release
diff --git a/gcc/doc/install-old.texi b/gcc/doc/install-old.texi
index 4a695a19f2e..0a4afbe451f 100644
--- a/gcc/doc/install-old.texi
+++ b/gcc/doc/install-old.texi
@@ -21,13 +21,10 @@ main manual.
@ifnothtml
@menu
* Configurations:: Configurations Supported by GCC.
-* Cross-Compiler:: Building and installing a cross-compiler.
-* VMS Install:: See below for installation on VMS.
@end menu
@end ifnothtml
Here is the procedure for installing GCC on a GNU or Unix system.
-See @ref{VMS Install}, for VMS systems.
@enumerate
@item
@@ -59,8 +56,7 @@ 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}.)
+the same as the host machine.
Here is an example:
@@ -92,7 +88,7 @@ section before proceeding any further with the installation of GCC@.
@end enumerate
@ifnothtml
-@node Configurations, Cross-Compiler, , Old
+@node Configurations, , , Old
@section Configurations Supported by GCC
@end ifnothtml
@html
@@ -196,518 +192,3 @@ 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 GCC on VMS@.
-@end table
-
-@ifnothtml
-@node Cross-Compiler, VMS Install, Configurations, Old
-@section Building and Installing a Cross-Compiler
-@end ifnothtml
-@html
-<h2>@anchor{Cross-Compiler}Building and Installing a Cross-Compiler</h2>
-@end html
-@cindex cross-compiler, installation
-
-GCC 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. GCC 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 GCC generates assembler code, you probably need a
-cross-assembler that GCC 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.
-
-@ifnothtml
-@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
-@end ifnothtml
-
-@ifnothtml
-@node Steps of Cross, Configure Cross, , Cross-Compiler
-@subsection Steps of Cross-Compilation
-@end ifnothtml
-@html
-<h2>Steps of Cross-Compilation</h2>
-@end html
-
-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 GCC@. This
-requires a suitable cross-assembler and cross-linker. For some targets,
-the GNU assembler and linker are available.
-
-@ifnothtml
-@node Configure Cross, Tools and Libraries, Steps of Cross, Cross-Compiler
-@subsection Configuring a Cross-Compiler
-@end ifnothtml
-@html
-<h2>Configuring a Cross-Compiler</h2>
-@end html
-
-To build GCC 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
-
-@ifnothtml
-@node Tools and Libraries, Cross Headers, Configure Cross, Cross-Compiler
-@subsection Tools and Libraries for a Cross-Compiler
-@end ifnothtml
-@html
-<h2>Tools and Libraries for a Cross-Compiler</h2>
-@end html
-
-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 GCC 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 GCC, then build and install
-them. They install their executables automatically into the proper
-directory. Alas, they do not support all the targets that GCC
-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 GCC copies
-all the files in that subdirectory into the proper place for GCC 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
-
-@ifnothtml
-@node Cross Headers, Build Cross, Tools and Libraries, Cross-Compiler
-@subsection Cross-Compilers and Header Files
-@end ifnothtml
-@html
-<h2>Cross-Compilers and Header Files</h2>
-@end html
-
-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 GCC (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, you should 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
-GCC@.) 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
-
-@ifnothtml
-@node Build Cross, , Cross Headers, Cross-Compiler
-@subsection Actually Building the Cross-Compiler
-@end ifnothtml
-@html
-<h2>Actually Building the Cross-Compiler</h2>
-@end html
-
-Now you can proceed just as for compiling a single-machine compiler
-through the step of building stage 1.
-
-Do not try to build stage 2 for a cross-compiler. It doesn't work to
-rebuild GCC 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 GCC 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.
-
-@ifnothtml
-@node VMS Install, , Cross-Compiler, Old
-@section Installing GCC on VMS
-@end ifnothtml
-@html
-<h2>@anchor{VMS Install}Installing GCC on VMS</h2>
-@end html
-@cindex VMS installation
-@cindex installing GCC on VMS
-
-The VMS version of GCC 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 GCC as follows:
-
-@enumerate
-@item
-Define the VMS logical names @samp{GNU_CC} and @samp{GNU_CC_INCLUDE}
-to point to the directories where the GCC 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 GCC, 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{bconfig.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, or submit the file
-@file{make-gcc.com} to a batch queue. If you wish to build the GNU C++
-compiler as well as the GCC 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 GCC with a previous version of GCC,
-you also should check to see that you have the newest version of the
-assembler}. In particular, GCC version 2 treats global constant
-variables slightly differently from GCC 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.
-
-@item
-If you want to build GCC 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 GCC to produce binary object modules
-and is not included in the GCC 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 GCC 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
-GCC sources. GAS is also included in @file{gcc-vms}, as is Bison.
-
-Once you have successfully built GCC 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 GCC, 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, GCC 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 GCC is compiled with
-VAX C, to avoid a problem in case @file{gcclib.olb} is not yet
-available.
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index 4b89617f0f5..2ed8cecab4d 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -43,7 +43,7 @@
@end ifset
@c Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-@c 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+@c 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@c *** Converted to texinfo by Dean Wakerley, dean@wakerley.com
@c Include everything if we're not making html
@@ -287,16 +287,24 @@ systems' @command{tar} programs will also work, only try GNU
@heading Tools/packages necessary for modifying GCC
@table @asis
-@item autoconf version 2.13 (NO earlier or later versions) and
+@item autoconf versions 2.13 and 2.57
@itemx GNU m4 version 1.4 (or later)
Necessary when modifying @file{configure.in}, @file{aclocal.m4}, etc.@:
-to regenerate @file{configure} and @file{config.in} files
+to regenerate @file{configure} and @file{config.in} files. Most
+directories require autoconf 2.13 (exactly), but @file{libiberty},
+@file{fastjar}, and @file{libstdc++-v3} require autoconf 2.57 (exactly).
-@item automake version ???
+@item automake versions 1.4-p? and 1.7.?
Necessary when modifying a @file{Makefile.am} file to regenerate its
-associated @file{Makefile.in}
+associated @file{Makefile.in}. Most directories require a 1.4 series
+automake; @file{libstdc++-v3} and @file{fastjar} requires a 1.7 series
+automake.
+
+@item gettext version 0.12 (or later)
+
+Needed to regenerate @file{gcc.pot}.
@item gperf version 2.7.2 (or later)
@@ -362,8 +370,10 @@ snapshots of the development sources are also available via FTP.
@item perl version 5.6.1 (or later)
Necessary when regenerating @file{Makefile} dependencies in libiberty.
-Necessary when regenerating something with intl??? (pod2man???)
-Other stuff???
+Necessary when regenerating @file{libiberty/functions.texi}.
+Necessary when generating manpages from Texinfo manuals.
+Used by various scripts to generate some files included in CVS (mainly
+Unicode-related and rarely changing) from source tables.
@item GNU diffutils version 2.7 (or later)
@@ -915,12 +925,13 @@ and SPARC@.
@itemx --with-arch=@var{cpu}
@itemx --with-tune=@var{cpu}
@itemx --with-abi=@var{abi}
+@itemx --with-fpu=@var{type}
@itemx --with-float=@var{type}
These configure options provide default values for the @option{-mschedule=},
-@option{-march=}, @option{-mtune=}, and @option{-mabi=} options and for
-@option{-mhard-float} or @option{-msoft-float}. As with @option{--with-cpu},
-which switches will be accepted and acceptable values of the arguments depend
-on the target.
+@option{-march=}, @option{-mtune=}, @option{-mabi=}, and @option{-mfpu=}
+options and for @option{-mhard-float} or @option{-msoft-float}. As with
+@option{--with-cpu}, which switches will be accepted and acceptable values
+of the arguments depend on the target.
@item --enable-altivec
Specify that the target supports AltiVec vector enhancements. This
@@ -1062,12 +1073,12 @@ specifying @var{list}; the categories of checks available are
@samp{misc}, @samp{tree}, @samp{gc}, @samp{rtl}, @samp{rtlflag},
@samp{fold}, @samp{gcac} and @samp{valgrind}. The check @samp{valgrind}
requires the external @command{valgrind} simulator, available from
-@uref{http://developer.kde.org/~sewardj/}. The default when @var{list} is
+@uref{http://valgrind.kde.org/}. The default when @var{list} is
not specified is @samp{misc,tree,gc,rtlflag}; the checks @samp{rtl},
@samp{gcac} and @samp{valgrind} are very expensive.
@item --enable-coverage
-@item --enable-coverage=@var{level}
+@itemx --enable-coverage=@var{level}
With this option, the compiler is built to collect self coverage
information, every time it is run. This is for internal development
purposes, and only works when the compiler is being built with gcc. The
@@ -1077,6 +1088,11 @@ want to disable optimization, for performance analysis you want to
enable optimization. When coverage is enabled, the default level is
without optimization.
+@item --enable-gather-detailed-mem-stats
+When this option is specfied more detailed information on memory
+allocation is gathered. This information is printed when using
+@option{-fmem-report}.
+
@item --enable-nls
@itemx --disable-nls
The @option{--enable-nls} option enables Native Language Support (NLS),
@@ -1347,6 +1363,49 @@ Build runtime libraries using the compiler from the previous step.
Note that if an error occurs in any step the make process will exit.
+If you are not building GNU binutils in the same source tree as GCC,
+you will need a cross-assembler and cross-linker installed before
+configuring GCC@. Put them in the directory
+@file{@var{prefix}/@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 GCC 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.
+Configure it with the same @option{--host} and @option{--target}
+options that you use for configuring GCC, then build and install
+them. They install their executables automatically into the proper
+directory. Alas, they do not support all the targets that GCC
+supports.
+
+If you are not building a C library in the same source tree as GCC,
+you should also provide the target libraries and headers before
+configuring GCC, specifying the directories with
+@option{--with-sysroot} or @option{--with-headers} and
+@option{--with-libs}. Many targets also require ``start files'' such
+as @file{crt0.o} and
+@file{crtn.o} which are linked into each executable. 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.
+
@section Building in parallel
You can use @samp{make bootstrap MAKE="make -j 2" -j 2}, or just
@@ -1361,38 +1420,23 @@ this is especially true for slow drives and network filesystems.
In order to build GNAT, the Ada compiler, you need a working GNAT
compiler (GNAT version 3.14 or later, or GCC version 3.1 or later),
+including GNAT tools such as @command{gnatmake} and @command{gnatlink},
since the Ada front end is written in Ada (with some
GNAT-specific extensions), and GNU make.
-However, you do not need a full installation of GNAT, just the GNAT
-binary @file{gnat1}, a copy of @file{gnatbind}, and a compiler driver
-which can deal with Ada input (by invoking the @file{gnat1} binary).
-You can specify this compiler driver by setting the @env{ADAC}
-environment variable at the configure step. @command{configure} can
-detect the driver automatically if it has got a common name such as
-@command{gcc} or @command{gnatgcc}. Of course, you still need a working
-C compiler (the compiler driver can be different or not).
@command{configure} does not test whether the GNAT installation works
and has a sufficiently recent version; if too old a GNAT version is
installed, the build will fail unless @option{--enable-languages} is
used to disable building the Ada front end.
-Additional build tools (such as @command{gnatmake}) or a working GNAT
-run-time library installation are usually @emph{not} required. However,
-if you want to bootstrap the compiler using a minimal version of GNAT,
-you have to issue the following commands before invoking @samp{make
-bootstrap} (this assumes that you start with an unmodified and consistent
-source distribution):
-
-@example
- cd @var{srcdir}/gcc/ada
- touch treeprs.ads [es]info.h nmake.ad[bs]
-@end example
-
At the moment, the GNAT library and several tools for GNAT are not built
-by @samp{make bootstrap}. You have to invoke
+by @samp{make bootstrap}. For a native build, you have to invoke
@samp{make gnatlib_and_tools} in the @file{@var{objdir}/gcc}
subdirectory before proceeding with the next steps.
+For a cross build, you need to invoke
+@samp{make gnatlib cross-gnattools ada.all.cross}. For a canadian
+cross you only need to invoke @samp{make cross-gnattools}; the GNAT
+library would be the same as the one built for the cross compiler.
For example, you can build a native Ada compiler by issuing the
following commands (assuming @command{make} is GNU make):
@@ -1400,8 +1444,6 @@ following commands (assuming @command{make} is GNU make):
@example
cd @var{objdir}
@var{srcdir}/configure --enable-languages=c,ada
- cd @var{srcdir}/gcc/ada
- touch treeprs.ads [es]info.h nmake.ad[bs]
cd @var{objdir}
make bootstrap
cd gcc
@@ -2585,20 +2627,6 @@ Versions of libstdc++-v3 starting with 3.2.1 require bugfixes present
in glibc 2.2.5 and later. More information is available in the
libstdc++-v3 documentation.
-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.
-
-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 completely unusable. This
-will definitely 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
<hr />
@end html
@@ -2705,6 +2733,9 @@ have installed.
IA-64 processor (also known as IPF, or Itanium Processor Family)
running GNU/Linux.
+If you are using the optional libunwind library, then you must use
+libunwind 0.96 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:
@@ -2948,6 +2979,12 @@ configure for @samp{mipsel-elf} as a workaround. The
@samp{mips*-*-linux*} target continues to use the MIPS II routines. More
work on this is expected in future releases.
+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.
+
@html
<hr />
@end html
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index f5f59382371..9e3d915c0a3 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -174,8 +174,7 @@ in the following sections.
@gccoptlist{-fabi-version=@var{n} -fno-access-control -fcheck-new @gol
-fconserve-space -fno-const-strings @gol
-fno-elide-constructors @gol
--fno-enforce-eh-specs -fexternal-templates @gol
--falt-external-templates @gol
+-fno-enforce-eh-specs @gol
-ffor-scope -fno-for-scope -fno-gnu-keywords @gol
-fno-implicit-templates @gol
-fno-implicit-inline-templates @gol
@@ -218,7 +217,7 @@ in the following sections.
-Werror -Werror-implicit-function-declaration @gol
-Wfloat-equal -Wformat -Wformat=2 @gol
-Wno-format-extra-args -Wformat-nonliteral @gol
--Wformat-security -Wno-format-y2k @gol
+-Wformat-security -Wformat-y2k @gol
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int @gol
-Wimport -Wno-import -Winit-self -Winline @gol
-Wno-invalid-offsetof -Winvalid-pch @gol
@@ -253,7 +252,7 @@ in the following sections.
-feliminate-unused-debug-symbols -fmem-report -fprofile-arcs @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
-ftest-coverage -ftime-report @gol
--g -g@var{level} -gcoff -gdwarf -gdwarf-1 -gdwarf-1+ -gdwarf-2 @gol
+-g -g@var{level} -gcoff -gdwarf-2 @gol
-ggdb -gstabs -gstabs+ -gvms -gxcoff -gxcoff+ @gol
-p -pg -print-file-name=@var{library} -print-libgcc-file-name @gol
-print-multi-directory -print-multi-lib @gol
@@ -282,6 +281,7 @@ in the following sections.
-fno-trapping-math -fno-zero-initialized-in-bss @gol
-fomit-frame-pointer -foptimize-register-move @gol
-foptimize-sibling-calls -fprefetch-loop-arrays @gol
+-fprofile-generate -fprofile-use @gol
-freduce-all-givs -fregmove -frename-registers @gol
-freorder-blocks -freorder-functions @gol
-frerun-cse-after-loop -frerun-loop-opt @gol
@@ -291,7 +291,7 @@ in the following sections.
-fsched-stalled-insns=@var{n} -sched-stalled-insns-dep=@var{n} @gol
-fsched2-use-superblocks @gol
-fsched2-use-traces -fsignaling-nans @gol
--fsingle-precision-constant -fssa -fssa-ccp -fssa-dce @gol
+-fsingle-precision-constant @gol
-fstrength-reduce -fstrict-aliasing -ftracer -fthread-jumps @gol
-funroll-all-loops -funroll-loops -fpeel-loops @gol
-funswitch-loops -fold-unroll-loops -fold-unroll-all-loops @gol
@@ -375,9 +375,9 @@ in the following sections.
-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
+-mfloat-abi=@var{name} soft-float -mhard-float -mfpe @gol
-mthumb-interwork -mno-thumb-interwork @gol
--mcpu=@var{name} -march=@var{name} -mfpe=@var{name} @gol
+-mcpu=@var{name} -march=@var{name} -mfpu=@var{name} @gol
-mstructure-size-boundary=@var{n} @gol
-mabort-on-noreturn @gol
-mlong-calls -mno-long-calls @gol
@@ -400,7 +400,7 @@ in the following sections.
-mno-crt0 -mrelax}
@emph{M32R/D Options}
-@gccoptlist{-m32rx -m32r -mcode-model=@var{model-type} @gol
+@gccoptlist{-m32r2 -m32rx -m32r -mcode-model=@var{model-type} @gol
-msdata=@var{sdata-type} -G @var{num}}
@emph{M88K Options}
@@ -675,7 +675,7 @@ in the following sections.
-fnon-call-exceptions -funwind-tables @gol
-fasynchronous-unwind-tables @gol
-finhibit-size-directive -finstrument-functions @gol
--fno-common -fno-ident -fno-gnu-linker @gol
+-fno-common -fno-ident @gol
-fpcc-struct-return -fpic -fPIC -fpie -fPIE @gol
-freg-struct-return -fshared-data -fshort-enums @gol
-fshort-double -fshort-wchar @gol
@@ -1049,7 +1049,7 @@ names @samp{c9x} and @samp{iso9899:199x} are deprecated.
Default, ISO C90 plus GNU extensions (including some C99 features).
@item gnu99
-@item gnu9x
+@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.
@@ -1245,6 +1245,8 @@ write into string constants.
Writing into string constants is a very bad idea; ``constants'' should
be constant.
+
+This option is deprecated.
@end table
@node C++ Dialect Options
@@ -1273,11 +1275,12 @@ Here is a list of options that are @emph{only} for compiling C++ programs:
@item -fabi-version=@var{n}
@opindex fabi-version
-Use version @var{n} of the C++ ABI. Version 1 is the version of the C++
-ABI that first appeared in G++ 3.2. Version 0 will always be the
-version that conforms most closely to the C++ ABI specification.
-Therefore, the ABI obtained using version 0 will change as ABI bugs are
-fixed.
+Use version @var{n} of the C++ ABI. Version 2 is the version of the
+C++ ABI that first appeared in G++ 3.4. Version 1 is the version of
+the C++ ABI that first appeared in G++ 3.2. Version 0 will always be
+the version that conforms most closely to the C++ ABI specification.
+Therefore, the ABI obtained using version 0 will change as ABI bugs
+are fixed.
The default is version 1.
@@ -1336,24 +1339,6 @@ 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 @samp{#pragma interface} and @samp{implementation} to apply to
-template instantiation; template instances are emitted or not according
-to the location of the template definition. @xref{Template
-Instantiation}, for more information.
-
-This option is deprecated.
-
-@item -falt-external-templates
-@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.
-
-This option is deprecated.
-
@item -ffor-scope
@itemx -fno-for-scope
@opindex ffor-scope
@@ -2125,14 +2110,14 @@ Since @option{-Wformat} also checks for null format arguments for
several functions, @option{-Wformat} also implies @option{-Wnonnull}.
@option{-Wformat} is included in @option{-Wall}. For more control over some
-aspects of format checking, the options @option{-Wno-format-y2k},
+aspects of format checking, the options @option{-Wformat-y2k},
@option{-Wno-format-extra-args}, @option{-Wno-format-zero-length},
@option{-Wformat-nonliteral}, @option{-Wformat-security}, and
@option{-Wformat=2} are available, but are not included in @option{-Wall}.
-@item -Wno-format-y2k
-@opindex Wno-format-y2k
-If @option{-Wformat} is specified, do not warn about @code{strftime}
+@item -Wformat-y2k
+@opindex Wformat-y2k
+If @option{-Wformat} is specified, also warn about @code{strftime}
formats which may yield only a two-digit year.
@item -Wno-format-extra-args
@@ -2176,7 +2161,7 @@ included in @option{-Wformat-nonliteral}.)
@opindex Wformat=2
Enable @option{-Wformat} plus format checks not included in
@option{-Wformat}. Currently equivalent to @samp{-Wformat
--Wformat-nonliteral -Wformat-security}.
+-Wformat-nonliteral -Wformat-security -Wformat-y2k}.
@item -Wnonnull
@opindex Wnonnull
@@ -3040,8 +3025,7 @@ 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 @option{-gstabs+}, @option{-gstabs},
-@option{-gxcoff+}, @option{-gxcoff}, @option{-gdwarf-1+}, @option{-gdwarf-1},
-or @option{-gvms} (see below).
+@option{-gxcoff+}, @option{-gxcoff}, or @option{-gvms} (see below).
Unlike most other C compilers, GCC allows you to use @option{-g} with
@option{-O}. The shortcuts taken by optimized code may occasionally
@@ -3103,23 +3087,6 @@ 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.
-
-This option is deprecated.
-
-@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
-crash or refuse to read the program.
-
-This option is deprecated.
-
@item -gdwarf-2
@opindex gdwarf-2
Produce debugging information in DWARF version 2 format (if that is
@@ -3149,9 +3116,9 @@ present in the program. Some debuggers support macro expansion when
you use @option{-g3}.
Note that in order to avoid confusion between DWARF1 debug level 2,
-and DWARF2, neither @option{-gdwarf} nor @option{-gdwarf-2} accept
-a concatenated debug level. Instead use an additional @option{-g@var{level}}
-option to change the debug level for DWARF1 or DWARF2.
+and DWARF2 @option{-gdwarf-2} does not accept a concatenated debug
+level. Instead use an additional @option{-g@var{level}} option to
+change the debug level for DWARF2.
@item -feliminate-dwarf2-dups
@opindex feliminate-dwarf2-dups
@@ -3265,7 +3232,7 @@ for most of the dumps are made by appending a pass number and a word to
the @var{dumpname}. @var{dumpname} is generated from the name of the
output file, if explicitly specified and it is not an executable,
otherwise it is the basename of the source file. In both cases any
-suffix is removed (e.g. @file{foo.00.rtl} or @file{foo.01.sibling}).
+suffix is removed (e.g. @file{foo.01.rtl} or @file{foo.02.sibling}).
Here are the possible letters for use in @var{letters}, and their
meanings:
@@ -3275,47 +3242,43 @@ meanings:
Annotate the assembler output with miscellaneous debugging information.
@item b
@opindex db
-Dump after computing branch probabilities, to @file{@var{file}.16.bp}.
+Dump after computing branch probabilities, to @file{@var{file}.12.bp}.
@item B
@opindex dB
-Dump after block reordering, to @file{@var{file}.32.bbro}.
+Dump after block reordering, to @file{@var{file}.30.bbro}.
@item c
@opindex dc
-Dump after instruction combination, to the file @file{@var{file}.22.combine}.
+Dump after instruction combination, to the file @file{@var{file}.20.combine}.
@item C
@opindex dC
-Dump after the first if conversion, to the file @file{@var{file}.17.ce1}.
-Also dump after the second if conversion, to the file @file{@var{file}.23.ce2}.
+Dump after the first if conversion, to the file @file{@var{file}.14.ce1}.
+Also dump after the second if conversion, to the file @file{@var{file}.21.ce2}.
@item d
@opindex dd
-Dump after branch target load optimization, to to @file{@var{file}.34.btl}.
-Also dump after delayed branch scheduling, to @file{@var{file}.37.dbr}.
+Dump after branch target load optimization, to to @file{@var{file}.32.btl}.
+Also dump after delayed branch scheduling, to @file{@var{file}.36.dbr}.
@item D
@opindex dD
Dump all macro definitions, at the end of preprocessing, in addition to
normal output.
-@item e
-@opindex de
-Dump after SSA optimizations, to @file{@var{file}.05.ssa} and
-@file{@var{file}.010.ussa}.
@item E
@opindex dE
-Dump after the second if conversion, to @file{@var{file}.33.ce3}.
+Dump after the second if conversion, to @file{@var{file}.31.ce3}.
@item f
@opindex df
-Dump after control and data flow analysis, to @file{@var{file}.15.cfg}.
-Also dump after life analysis, to @file{@var{file}.21.life}.
+Dump after control and data flow analysis, to @file{@var{file}.11.cfg}.
+Also dump after life analysis, to @file{@var{file}.19.life}.
@item F
@opindex dF
-Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.11.addressof}.
+Dump after purging @code{ADDRESSOF} codes, to @file{@var{file}.07.addressof}.
@item g
@opindex dg
-Dump after global register allocation, to @file{@var{file}.27.greg}.
+Dump after global register allocation, to @file{@var{file}.25.greg}.
@item G
@opindex dG
-Dump after GCSE, to @file{@var{file}.12.gcse}.
+Dump after GCSE, to @file{@var{file}.08.gcse}.
Also dump after jump bypassing and control flow optimizations, to
-@file{@var{file}.14.bypass}.
+@file{@var{file}.10.bypass}.
@item h
@opindex dh
Dump after finalization of EH handling code, to @file{@var{file}.03.eh}.
@@ -3327,66 +3290,65 @@ Dump after sibling call optimizations, to @file{@var{file}.02.sibling}.
Dump after the first jump optimization, to @file{@var{file}.04.jump}.
@item k
@opindex dk
-Dump after conversion from registers to stack, to @file{@var{file}.36.stack}.
+Dump after conversion from registers to stack, to @file{@var{file}.34.stack}.
@item l
@opindex dl
-Dump after local register allocation, to @file{@var{file}.26.lreg}.
+Dump after local register allocation, to @file{@var{file}.24.lreg}.
@item L
@opindex dL
-Dump after loop optimization passes, to @file{@var{file}.13.loop} and
-@file{@var{file}.19.loop2}.
+Dump after loop optimization passes, to @file{@var{file}.09.loop} and
+@file{@var{file}.16.loop2}.
@item M
@opindex dM
Dump after performing the machine dependent reorganization pass, to
-@file{@var{file}.37.mach}.
+@file{@var{file}.35.mach}.
@item n
@opindex dn
-Dump after register renumbering, to @file{@var{file}.31.rnreg}.
+Dump after register renumbering, to @file{@var{file}.29.rnreg}.
@item N
@opindex dN
-Dump after the register move pass, to @file{@var{file}.24.regmove}.
+Dump after the register move pass, to @file{@var{file}.22.regmove}.
@item o
@opindex do
-Dump after post-reload optimizations, to @file{@var{file}.28.postreload}.
+Dump after post-reload optimizations, to @file{@var{file}.26.postreload}.
@item r
@opindex dr
Dump after RTL generation, to @file{@var{file}.01.rtl}.
@item R
@opindex dR
-Dump after the second scheduling pass, to @file{@var{file}.35.sched2}.
+Dump after the second scheduling pass, to @file{@var{file}.33.sched2}.
@item s
@opindex ds
Dump after CSE (including the jump optimization that sometimes follows
-CSE), to @file{@var{file}.019.cse}.
+CSE), to @file{@var{file}.06.cse}.
@item S
@opindex dS
-Dump after the first scheduling pass, to @file{@var{file}.25.sched}.
+Dump after the first scheduling pass, to @file{@var{file}.23.sched}.
@item t
@opindex dt
Dump after the second CSE pass (including the jump optimization that
-sometimes follows CSE), to @file{@var{file}.20.cse2}.
+sometimes follows CSE), to @file{@var{file}.18.cse2}.
@item T
@opindex dT
-Dump after running tracer, to @file{@var{file}.18.tracer}.
+Dump after running tracer, to @file{@var{file}.15.tracer}.
@item u
@opindex du
-Dump after null pointer elimination pass to @file{@var{file}.018.null}.
+Dump after null pointer elimination pass to @file{@var{file}.05.null}.
@item U
@opindex dU
Dump callgraph and unit-at-a-time optimization @file{@var{file}.00.unit}.
+@item V
+@opindex dV
+Dump after the value profile transformations, to @file{@var{file}.13.vpt}.
@item w
@opindex dw
-Dump after the second flow pass, to @file{@var{file}.29.flow2}.
-@item W
-@opindex dW
-Dump after SSA conditional constant propagation, to
-@file{@var{file}.06.ssaccp}.
-@item X
-@opindex dX
-Dump after SSA dead code elimination, to @file{@var{file}.07.ssadce}.
+Dump after the second flow pass, to @file{@var{file}.27.flow2}.
@item z
@opindex dz
-Dump after the peephole pass, to @file{@var{file}.30.peephole2}.
+Dump after the peephole pass, to @file{@var{file}.28.peephole2}.
+@item Z
+@opindex dZ
+Dump after constructing the web, to @file{@var{file}.17.web}.
@item a
@opindex da
Produce all the dumps listed above.
@@ -3691,7 +3653,7 @@ also turns on the following optimization flags:
-fpeephole2 @gol
-freorder-blocks -freorder-functions @gol
-fstrict-aliasing @gol
--funit-at-a-time -fweb @gol
+-funit-at-a-time @gol
-falign-functions -falign-jumps @gol
-falign-loops -falign-labels}
@@ -3829,8 +3791,6 @@ The @option{-finline-limit=@var{n}} option sets some of these parameters
as follows:
@table @gcctabopt
- @item max-inline-insns
- is set to @var{n}.
@item max-inline-insns-single
is set to @var{n}/2.
@item max-inline-insns-auto
@@ -3841,8 +3801,7 @@ as follows:
is set to @var{n}.
@end table
-Using @option{-finline-limit=600} thus results in the default settings
-for these parameters. See below for a documentation of the individual
+See below for a documentation of the individual
parameters controlling inlining.
@emph{Note:} pseudo instruction represents, in this particular context, an
@@ -4401,6 +4360,21 @@ and occasionally eliminate the copy.
Disabled at levels @option{-O}, @option{-O2}, @option{-O3}, @option{-Os}.
+@item -fprofile-generate
+@opindex fprofile-generate
+Enable options usually used for instrumenting application to produce profile usefull
+for later recompilation profile feedback based optimization.
+
+The following options are enabled: @code{-fprofile-arcs}, @code{-fprofile-values}, @code{-fvpt}
+
+@item -fprofile-use
+@opindex fprofile-use
+Enable profile feedback directed optimizations, and optimizations
+generally profitable only with profile feedback available.
+
+The following options are enabled: @code{-fbranch-probabilities},
+@code{-fvpt}, @code{-funroll-loops}, @code{-fpeel-loops}, @code{-ftracer}.
+
@end table
The following options control compiler behavior regarding floating
@@ -4677,23 +4651,6 @@ 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 @option{-g}.
-@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. Users should not
-specify this option, since it is not yet ready for production use.
-
-@item -fssa-ccp
-@opindex fssa-ccp
-Perform Sparse Conditional Constant Propagation in SSA form. Requires
-@option{-fssa}. Like @option{-fssa}, this is an experimental feature.
-
-@item -fssa-dce
-@opindex fssa-dce
-Perform aggressive dead-code elimination in SSA form. Requires @option{-fssa}.
-Like @option{-fssa}, this is an experimental feature.
-
@item -fbranch-target-load-optimize
@opindex fbranch-target-load-optimize
Perform branch target register load optimization before prologue / epilogue
@@ -4707,9 +4664,6 @@ a separate optimization pass.
Perform branch target register load optimization after prologue / epilogue
threading.
-
-
-
@item --param @var{name}=@var{value}
@opindex param
In some places, GCC uses various constants to control the amount of
@@ -4776,17 +4730,6 @@ by the compiler will be investigated. To those functions, a different
be applied.
The default value is 150.
-@item max-inline-insns
-The tree inliner does decrease the allowable size for single functions
-to be inlined after we already inlined the number of instructions
-given here by repeated inlining. This number should be a factor of
-two or more larger than the single function limit.
-Higher numbers result in better runtime performance, but incur higher
-compile-time resource (CPU time, memory) requirements and result in
-larger binaries. Very high values are not advisable, as too large
-binaries may adversely affect runtime performance.
-The default value is 200.
-
@item large-function-insns
The limit specifying really large functions. For functions greater than this
limit inlining is constrained by @option{--param large-function-growth}.
@@ -4811,7 +4754,6 @@ than tree inlining), you can set the maximum allowable size (counted
in RTL instructions) for the RTL inliner with this parameter.
The default value is 600.
-
@item max-unrolled-insns
The maximum number of instructions that a loop should have if that loop
is unrolled, and if the loop is unrolled, it determines how many times
@@ -6578,6 +6520,16 @@ this option. In particular, you need to compile @file{libgcc.a}, the
library that comes with GCC, with @option{-msoft-float} in order for
this to work.
+@item -mfloat-abi=@var{name}
+@opindex mfloat-abi
+Specifies which ABI to use for floating point values. Permissible values
+are: @samp{soft}, @samp{softfp} and @samp{hard}.
+
+@samp{soft} and @samp{hard} are equivalent to @option{-msoft-float}
+and @option{-mhard-float} respectively. @samp{softfp} allows the generation
+of floating point instructions, but still uses the soft-float calling
+conventions.
+
@item -mlittle-endian
@opindex mlittle-endian
Generate code for a processor running in little-endian mode. This is
@@ -6676,16 +6628,23 @@ name to determine what kind of instructions it can emit when generating
assembly code. This option can be used in conjunction with or instead
of the @option{-mcpu=} option. Permissible names are: @samp{armv2},
@samp{armv2a}, @samp{armv3}, @samp{armv3m}, @samp{armv4}, @samp{armv4t},
-@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6j},
+@samp{armv5}, @samp{armv5t}, @samp{armv5te}, @samp{armv6}, @samp{armv6j},
@samp{iwmmxt}, @samp{ep9312}.
-@item -mfpe=@var{number}
+@item -mfpu=@var{name}
+@itemx -mfpe=@var{number}
@itemx -mfp=@var{number}
+@opindex mfpu
@opindex mfpe
@opindex mfp
-This specifies the version of the floating point emulation available on
-the target. Permissible values are 2 and 3. @option{-mfp=} is a synonym
-for @option{-mfpe=}, for compatibility with older versions of GCC@.
+This specifies what floating point hardware (or hardware emulation) is
+available on the target. Permissible names are: @samp{fpa}, @samp{fpe2},
+@samp{fpe3}, @samp{maverick}, @samp{vfp}. @option{-mfp} and @option{-mfpe}
+are synonyms for @option{-mpfu}=@samp{fpe}@var{number}, for compatibility
+with older versions of GCC@.
+
+If @option{-msoft-float} is specified this specifies the format of
+floating point values.
@item -mstructure-size-boundary=@var{n}
@opindex mstructure-size-boundary
@@ -6877,9 +6836,13 @@ This option makes symbolic debugging impossible.
@subsection M32R/D Options
@cindex M32R/D options
-These @option{-m} options are defined for Mitsubishi M32R/D architectures:
+These @option{-m} options are defined for Renesas M32R/D architectures:
@table @gcctabopt
+@item -m32r2
+@opindex m32r2
+Generate code for the M32R/2@.
+
@item -m32rx
@opindex m32rx
Generate code for the M32R/X@.
@@ -7275,12 +7238,15 @@ should normally not specify either @option{-mnew-mnemonics} or
@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},
-@samp{rsc}, @samp{rios2}, @samp{rs64a}, @samp{601}, @samp{602},
-@samp{603}, @samp{603e}, @samp{604}, @samp{604e}, @samp{620},
-@samp{630}, @samp{740}, @samp{7400}, @samp{7450}, @samp{750},
-@samp{power}, @samp{power2}, @samp{powerpc}, @samp{403}, @samp{505},
-@samp{801}, @samp{821}, @samp{823}, and @samp{860} and @samp{common}.
+Supported values for @var{cpu_type} are @samp{401}, @samp{403},
+@samp{405}, @samp{405fp}, @samp{440}, @samp{440fp}, @samp{505},
+@samp{601}, @samp{602}, @samp{603}, @samp{603e}, @samp{604},
+@samp{604e}, @samp{620}, @samp{630}, @samp{740}, @samp{7400},
+@samp{7450}, @samp{750}, @samp{801}, @samp{821}, @samp{823},
+@samp{860}, @samp{970}, @samp{common}, @samp{ec603e}, @samp{G3},
+@samp{G4}, @samp{G5}, @samp{power}, @samp{power2}, @samp{power3},
+@samp{power4}, @samp{powerpc}, @samp{powerpc64}, @samp{rios},
+@samp{rios1}, @samp{rios2}, @samp{rsc}, and @samp{rs64a}.
@option{-mcpu=common} selects a completely generic processor. Code
generated under this option will run on any POWER or PowerPC processor.
@@ -7298,43 +7264,23 @@ The other options specify a specific processor. Code generated under
those options will run best on that processor, and may not run at all on
others.
-The @option{-mcpu} options automatically enable or disable other
-@option{-m} options as follows:
-
-@table @samp
-@item common
-@option{-mno-power}, @option{-mno-powerpc}
-
-@item power
-@itemx power2
-@itemx rios1
-@itemx rios2
-@itemx rsc
-@option{-mpower}, @option{-mno-powerpc}, @option{-mno-new-mnemonics}
-
-@item powerpc
-@itemx rs64a
-@itemx 602
-@itemx 603
-@itemx 603e
-@itemx 604
-@itemx 620
-@itemx 630
-@itemx 740
-@itemx 7400
-@itemx 7450
-@itemx 750
-@itemx 505
-@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}
-
-@item 601
-@option{-mpower}, @option{-mpowerpc}, @option{-mnew-mnemonics}
-
-@item 403
-@itemx 821
-@itemx 860
-@option{-mno-power}, @option{-mpowerpc}, @option{-mnew-mnemonics}, @option{-msoft-float}
-@end table
+The @option{-mcpu} options automatically enable or disable the
+following options: @option{-maltivec}, @option{-mhard-float},
+@option{-mmfcrf}, @option{-mmultiple}, @option{-mnew-mnemonics},
+@option{-mpower}, @option{-mpower2}, @option{-mpowerpc64},
+@option{-mpowerpc-gpopt}, @option{-mpowerpc-gfxopt},
+@option{-mstring}. The particular options set for any particular CPU
+will vary between compiler versions, depending on what setting seems
+to produce optimal code for that CPU; it doesn't necessarily reflect
+the actual hardware's capabilities. If you wish to set an individual
+option to a particular value, you may specify it after the
+@option{-mcpu} option, like @samp{-mcpu=970 -mno-altivec}.
+
+On AIX, the @option{-maltivec} and @option{-mpowerpc64} options are
+not enabled or disabled by the @option{-mcpu} option at present, since
+AIX does not have full support for these options. You may still
+enable or disable them individually if you're sure it'll work in your
+environment.
@item -mtune=@var{cpu_type}
@opindex mtune
@@ -7819,6 +7765,10 @@ generate slower code. As of this writing, the AIX linker can do this,
as can the GNU linker for PowerPC/64. It is planned to add this feature
to the GNU linker for 32-bit PowerPC systems as well.
+On Mach-O (Darwin) systems, this option directs the compiler emit to
+the glue for every direct call, and the Darwin linker decides whether
+to use or discard it.
+
In the future, we may cause GCC to ignore all longcall specifications
when the linker is known to generate glue.
@@ -7863,62 +7813,62 @@ This specifies the @var{executable} that will be loading the build
output file being linked. See man ld(1) for more information.
@item -allowable_client @var{client_name}
-@item -arch_only
-
-@item -client_name
-@item -compatibility_version
-@item -current_version
-@item -dependency-file
-@item -dylib_file
-@item -dylinker_install_name
-@item -dynamic
-@item -dynamiclib
-@item -exported_symbols_list
-@item -filelist
-@item -flat_namespace
-@item -force_cpusubtype_ALL
-@item -force_flat_namespace
-@item -headerpad_max_install_names
-@item -image_base
-@item -init
-@item -install_name
-@item -keep_private_externs
-@item -multi_module
-@item -multiply_defined
-@item -multiply_defined_unused
-@item -noall_load
-@item -nofixprebinding
-@item -nomultidefs
-@item -noprebind
-@item -noseglinkedit
-@item -pagezero_size
-@item -prebind
-@item -prebind_all_twolevel_modules
-@item -private_bundle
-@item -read_only_relocs
-@item -sectalign
-@item -sectobjectsymbols
-@item -whyload
-@item -seg1addr
-@item -sectcreate
-@item -sectobjectsymbols
-@item -sectorder
-@item -seg_addr_table
-@item -seg_addr_table_filename
-@item -seglinkedit
-@item -segprot
-@item -segs_read_only_addr
-@item -segs_read_write_addr
-@item -single_module
-@item -static
-@item -sub_library
-@item -sub_umbrella
-@item -twolevel_namespace
-@item -umbrella
-@item -undefined
-@item -unexported_symbols_list
-@item -weak_reference_mismatches
-@item -whatsloaded
+@itemx -arch_only
+
+@itemx -client_name
+@itemx -compatibility_version
+@itemx -current_version
+@itemx -dependency-file
+@itemx -dylib_file
+@itemx -dylinker_install_name
+@itemx -dynamic
+@itemx -dynamiclib
+@itemx -exported_symbols_list
+@itemx -filelist
+@itemx -flat_namespace
+@itemx -force_cpusubtype_ALL
+@itemx -force_flat_namespace
+@itemx -headerpad_max_install_names
+@itemx -image_base
+@itemx -init
+@itemx -install_name
+@itemx -keep_private_externs
+@itemx -multi_module
+@itemx -multiply_defined
+@itemx -multiply_defined_unused
+@itemx -noall_load
+@itemx -nofixprebinding
+@itemx -nomultidefs
+@itemx -noprebind
+@itemx -noseglinkedit
+@itemx -pagezero_size
+@itemx -prebind
+@itemx -prebind_all_twolevel_modules
+@itemx -private_bundle
+@itemx -read_only_relocs
+@itemx -sectalign
+@itemx -sectobjectsymbols
+@itemx -whyload
+@itemx -seg1addr
+@itemx -sectcreate
+@itemx -sectobjectsymbols
+@itemx -sectorder
+@itemx -seg_addr_table
+@itemx -seg_addr_table_filename
+@itemx -seglinkedit
+@itemx -segprot
+@itemx -segs_read_only_addr
+@itemx -segs_read_write_addr
+@itemx -single_module
+@itemx -static
+@itemx -sub_library
+@itemx -sub_umbrella
+@itemx -twolevel_namespace
+@itemx -umbrella
+@itemx -undefined
+@itemx -unexported_symbols_list
+@itemx -weak_reference_mismatches
+@itemx -whatsloaded
@opindex allowable_client
@opindex arch_only
@@ -7977,7 +7927,7 @@ output file being linked. See man ld(1) for more information.
@opindex weak_reference_mismatches
@opindex whatsloaded
-This options are available for Darwin linker. Darwin linker man page
+These options are available for Darwin linker. Darwin linker man page
describes them in detail.
@end table
@@ -8636,7 +8586,7 @@ and will not be binary compatible with structures in code compiled
without that switch.
@item -m96bit-long-double
-@item -m128bit-long-double
+@itemx -m128bit-long-double
@opindex m96bit-long-double
@opindex m128bit-long-double
These switches control the size of @code{long double} type. The i386
@@ -9435,7 +9385,7 @@ Supported values for @var{cpu_type} are
@table @samp
@item ev4
-@item ev45
+@itemx ev45
@itemx 21064
Schedules as an EV4 and has no instruction set extensions.
@@ -9457,7 +9407,7 @@ Schedules as an EV5 and supports the BWX and MAX extensions.
Schedules as an EV6 and supports the BWX, FIX, and MAX extensions.
@item ev67
-@item 21264a
+@itemx 21264a
Schedules as an EV6 and supports the BWX, CIX, FIX, and MAX extensions.
@end table
@@ -9513,7 +9463,7 @@ These @samp{-m} options are defined for the H8/300 implementations:
@opindex mrelax
Shorten some address references at link time, when possible; uses the
linker option @option{-relax}. @xref{H8/300,, @code{ld} and the H8/300,
-ld.info, Using ld}, for a fuller description.
+ld, Using ld}, for a fuller description.
@item -mh
@opindex mh
@@ -9707,7 +9657,7 @@ parameters for machine type @var{cpu_type}. Supported values for
TMS320C40.
@item -mbig-memory
-@item -mbig
+@itemx -mbig
@itemx -msmall-memory
@itemx -msmall
@opindex mbig-memory
@@ -10799,7 +10749,7 @@ Use 32-bit @code{int}.
Use 64-bit @code{float}. This is the default.
@item -mfloat32
-@item -mno-float64
+@itemx -mno-float64
@opindex mfloat32
@opindex mno-float64
Use 32-bit @code{float}.
@@ -11320,17 +11270,6 @@ program will work on other systems which always work this way.
@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
-you want to use a non-GNU linker, which also requires using the
-@command{collect2} program to make sure the system linker includes
-constructors and destructors. (@command{collect2} is included in the GCC
-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
@@ -11719,7 +11658,7 @@ the headers it contains change.
A precompiled header file will be searched for when @code{#include} is
seen in the compilation. As it searches for the included file
-(@pxref{Search Path,,Search Path,cpp.info,The C Preprocessor}) the
+(@pxref{Search Path,,Search Path,cpp,The C Preprocessor}) the
compiler looks for a precompiled header in each directory just before it
looks for the include file in that directory. The name searched for is
the name specified in the @code{#include} with @samp{.gch} appended. If
diff --git a/gcc/doc/makefile.texi b/gcc/doc/makefile.texi
index 3ab98c08da7..1995e5824a3 100644
--- a/gcc/doc/makefile.texi
+++ b/gcc/doc/makefile.texi
@@ -1,4 +1,4 @@
-@c Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+@c Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
@c This is part of the GCC manual.
@c For copying conditions, see the file gcc.texi.
@@ -26,9 +26,6 @@ That, and all the other files built by @samp{make all}.
@item distclean
That, and all the files created by @command{configure}.
-@item extraclean
-That, and any temporary or intermediate files, like emacs backup files.
-
@item maintainer-clean
Distclean plus any file that can be generated from other files. Note
that additional tools may be required beyond what is normally needed to
diff --git a/gcc/doc/md.texi b/gcc/doc/md.texi
index ce59a0fd5ed..3f376fb1513 100644
--- a/gcc/doc/md.texi
+++ b/gcc/doc/md.texi
@@ -1340,6 +1340,9 @@ available on some particular machines.
@item f
Floating-point register
+@item w
+VFP floating-point register
+
@item F
One of the floating-point constants 0.0, 0.5, 1.0, 2.0, 3.0, 4.0, 5.0
or 10.0
@@ -1376,6 +1379,9 @@ An item in the constant pool
A symbol in the text segment of the current file
@end table
+@item U
+A memory reference suitable for VFP load/store insns (reg+constant offset)
+
@item AVR family---@file{avr.h}
@table @code
@item l
@@ -1439,7 +1445,7 @@ Constant integer 1
A floating point constant 0.0
@end table
-@item IBM RS6000---@file{rs6000.h}
+@item PowerPC and IBM RS6000---@file{rs6000.h}
@table @code
@item b
Address base register
@@ -1447,6 +1453,9 @@ Address base register
@item f
Floating point register
+@item v
+Vector register
+
@item h
@samp{MQ}, @samp{CTR}, or @samp{LINK} register
@@ -2196,13 +2205,52 @@ Unsigned 12-bit constant (0--4095)
Signed 16-bit constant (@minus{}32768--32767)
@item L
-Unsigned 16-bit constant (0--65535)
+Value appropriate as displacement.
+@table @code
+ @item (0..4095)
+ for short displacement
+ @item (-524288..524287)
+ for long displacement
+@end table
+
+@item M
+Constant integer with a value of 0x7fffffff.
+
+@item N
+Multiple letter constraint followed by 4 parameter letters.
+@table @code
+ @item 0..9:
+ number of the part counting from most to least significant
+ @item H,Q:
+ mode of the part
+ @item D,S,H:
+ mode of the containing operand
+ @item 0,F:
+ value of the other parts (F - all bits set)
+@end table
+The constraint matches if the specified part of a constant
+has a value different from it's other parts.
@item Q
-Memory reference without index register
+Memory reference without index register and with short displacement.
+
+@item R
+Memory reference with index register and short displacement.
@item S
-Symbolic constant suitable for use with the @code{larl} instruction
+Memory reference without index register but with long displacement.
+
+@item T
+Memory reference with index register and long displacement.
+
+@item U
+Pointer with short displacement.
+
+@item W
+Pointer with long displacement.
+
+@item Y
+Shift count operand.
@end table
diff --git a/gcc/doc/passes.texi b/gcc/doc/passes.texi
index ad07f60841e..6bbc61c2822 100644
--- a/gcc/doc/passes.texi
+++ b/gcc/doc/passes.texi
@@ -237,57 +237,6 @@ the second conditional test. The source code for this pass is in
@file{jump.c}. This optimization is only performed if
@option{-fthread-jumps} is enabled.
-@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 Conditional Constant Propagation
-@cindex Conditional Constant Propagation, SSA based
-@cindex conditional constant propagation
-@opindex fssa-ccp
-@item
-SSA Conditional Constant Propagation. Turned on by the @option{-fssa-ccp}
-option. This pass performs conditional constant propagation to simplify
-instructions including conditional branches. This pass is more aggressive
-than the constant propagation done by the CSE and GCSE passes, but operates
-in linear time.
-
-@opindex dW
-The option @option{-dW} causes a debugging dump of the RTL code after
-this pass. This dump file's name is made by appending @samp{.ssaccp} to
-the input file name.
-
-@cindex SSA DCE
-@cindex DCE, SSA based
-@cindex dead code elimination
-@opindex fssa-dce
-@item
-SSA Aggressive Dead Code Elimination. Turned on by the @option{-fssa-dce}
-option. This pass performs elimination of code considered unnecessary because
-it has no externally visible effects on the program. 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{.ssadce} to
-the input file name.
-@end itemize
-
@cindex common subexpression elimination
@cindex constant propagation
@item
diff --git a/gcc/doc/sourcebuild.texi b/gcc/doc/sourcebuild.texi
index c29a64efeba..eba00ddd4c6 100644
--- a/gcc/doc/sourcebuild.texi
+++ b/gcc/doc/sourcebuild.texi
@@ -551,7 +551,9 @@ specified in @code{outputs} in @file{config-lang.in}, although this is
deprecated). Some hooks are defined by using a double-colon rule for
@code{@var{hook}}, rather than by using a target of form
@code{@var{lang}.@var{hook}}. These hooks are called ``double-colon
-hooks'' below.
+hooks'' below. It also adds any testsuite targets that can use the
+standard rule in @file{gcc/Makefile.in} to the variable
+@code{lang_checks}.
@table @code
@item all.build
@@ -600,14 +602,11 @@ anything.
@item mostlyclean
@itemx clean
@itemx distclean
-@itemx extraclean
@itemx maintainer-clean
-Except for @code{extraclean}, the language parts of the standard GNU
+The language parts of the standard GNU
@samp{*clean} targets. @xref{Standard Targets, , Standard Targets for
Users, standards, GNU Coding Standards}, for details of the standard
-targets. @code{extraclean} does @code{distclean} and also deletes
-anything likely to be found in the source directory that shouldn't be
-in the distribution. For GCC, @code{maintainer-clean} should delete
+targets. For GCC, @code{maintainer-clean} should delete
all generated files in the source directory that are not checked into
CVS, but should not delete anything checked into CVS@.
@item stage1
@@ -778,6 +777,7 @@ here; FIXME: document the others.
@menu
* Test Idioms:: Idioms used in test suite code.
+* Ada Tests:: The Ada language test suites.
* C Tests:: The C language test suites.
* libgcj Tests:: The Java library test suites.
* gcov Testing:: Support for testing gcov.
@@ -860,6 +860,39 @@ unfortunately, the mechanisms for this differ by directory.
FIXME: discuss non-C test suites here.
+@node Ada Tests
+@subsection Ada Language Test Suites
+
+The Ada test suite includes executable tests from the ACATS 2.5 test
+suite, publicly available at @uref{http://www.adaic.org/compilers/acats/2.5}
+
+These tests are integrated in the GCC test suite in the
+@file{gcc/testsuite/ada/acats} directory, and
+enabled automatically when running @code{make check}, assuming
+the Ada language has been enabled when configuring GCC.
+
+You can also run the Ada test suite independently, using
+@code{make check-ada}, or run a subset of the tests by specifying which
+chapter to run, e.g:
+
+@smallexample
+$ make check-ada CHAPTERS="c3 c9"
+@end smallexample
+
+The tests are organized by directory, each directory corresponding to
+a chapter of the Ada Reference Manual. So for example, c9 corresponds
+to chapter 9, which deals with tasking features of the language.
+
+There is also an extra chapter called @file{gcc} containing a template for
+creating new executable tests.
+
+The tests are run using two 'sh' scripts: run_acats and run_all.sh
+To run the tests using a simulator or a cross target, see the small
+customization section at the top of run_all.sh
+
+These tests are run using the build tree: they can be run without doing
+a @code{make install}.
+
@node C Tests
@subsection C Language Test Suites
diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi
index 09f8295e9ee..6b8ad5ecabe 100644
--- a/gcc/doc/tm.texi
+++ b/gcc/doc/tm.texi
@@ -329,7 +329,7 @@ et al, within sysroot+suffix.
@defmac SYSROOT_HEADERS_SUFFIX_SPEC
Define this macro to add a headers_suffix to the target sysroot when
GCC is configured with a sysroot. This will cause GCC to pass the
-updated sysroot+headers_suffix to CPP@, causing it to search for
+updated sysroot+headers_suffix to CPP, causing it to search for
usr/include, et al, within sysroot+headers_suffix.
@end defmac
@@ -3052,6 +3052,19 @@ For proper signal handling in Java this macro is accompanied by
@code{MAKE_THROW_FRAME}, defined in @file{libjava/include/*-signal.h} headers.
@end defmac
+@defmac MD_HANDLE_UNWABI (@var{context}, @var{fs})
+This macro allows the target to add operating system specific code to the
+call-frame unwinder to handle the IA-64 @code{.unwabi} unwinding directive,
+usually used for signal or interrupt frames.
+
+This macro is called from @code{uw_update_context} in @file{unwind-ia64.c}.
+@var{context} is an @code{_Unwind_Context};
+@var{fs} is an @code{_Unwind_FrameState}. Examine @code{fs->unwabi}
+for the abi and context in the @code{.unwabi} directive. If the
+@code{.unwabi} directive can be handled, the register save addresses should
+be updated in @var{fs}.
+@end defmac
+
@node Stack Checking
@subsection Specifying How Stack Checking is Done
@@ -3798,13 +3811,6 @@ be passed in a pair of floating point registers, even though a complex
float would fit in one 64-bit floating point register.
@end defmac
-@defmac LOAD_ARGS_REVERSED
-If defined, the order in which arguments are loaded into their
-respective argument registers is reversed so that the last
-argument is loaded first. This macro only affects arguments
-passed in registers.
-@end defmac
-
@node Scalar Return
@subsection How Scalar Function Values Are Returned
@cindex return values in registers
@@ -3903,6 +3909,18 @@ need more space than is implied by @code{FUNCTION_VALUE_REGNO_P} for
saving and restoring an arbitrary return value.
@end defmac
+@deftypefn {Target Hook} bool TARGET_RETURN_IN_MSB (tree @var{type})
+This hook should return true if values of type @var{type} are returned
+at the most significant end of a register (in other words, if they are
+padded at the least significant end). You can assume that @var{type}
+is returned in a register; the caller is required to check this.
+
+Note that the register provided by @code{FUNCTION_VALUE} must be able
+to hold the complete return value. For example, if a 1-, 2- or 3-byte
+structure is returned at the most significant end of a 4-byte register,
+@code{FUNCTION_VALUE} should provide an @code{SImode} rtx.
+@end deftypefn
+
@node Aggregate Return
@subsection How Large Values Are Returned
@cindex aggregates as return values
@@ -3985,14 +4003,6 @@ If you enable it, GCC can save registers around function calls. This
makes it possible to use call-clobbered registers to hold variables that
must live across calls.
-@defmac DEFAULT_CALLER_SAVES
-Define this macro if function calls on the target machine do not preserve
-any registers; in other words, if @code{CALL_USED_REGISTERS} has 1
-for all registers. When defined, this macro enables @option{-fcaller-saves}
-by default for all optimization levels. It has no effect for optimization
-levels 2 and higher, where @option{-fcaller-saves} is the default.
-@end defmac
-
@defmac CALLER_SAVE_PROFITABLE (@var{refs}, @var{calls})
A C expression to determine whether it is worthwhile to consider placing
a pseudo-register in a call-clobbered hard register and saving and
@@ -4171,7 +4181,8 @@ function.
Define this macro as a C expression that is nonzero if the return
instruction or the function epilogue ignores the value of the stack
pointer; in other words, if it is safe to delete an instruction to
-adjust the stack pointer before a return from the function.
+adjust the stack pointer before a return from the function. The
+default is 0.
Note that this macro's value is relevant only for functions for which
frame pointers are maintained. It is never safe to delete a final
@@ -7200,12 +7211,6 @@ writing conditional output routines in those patterns.
If this macro is not defined, it is equivalent to a null statement.
@end defmac
-@defmac FINAL_PRESCAN_LABEL
-If defined, @code{FINAL_PRESCAN_INSN} will be called on each
-@code{CODE_LABEL}. In that case, @var{opvec} will be a null pointer and
-@var{noperands} will be zero.
-@end defmac
-
@defmac PRINT_OPERAND (@var{stream}, @var{x}, @var{code})
A C compound statement to output to stdio stream @var{stream} the
assembler syntax for an instruction operand @var{x}. @var{x} is an
@@ -7688,8 +7693,7 @@ 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 @option{-gstabs},
-@option{-gcoff}, @option{-gdwarf-1}, @option{-gdwarf-2}, @option{-gxcoff},
-or @option{-gvms}.
+@option{-gcoff}, @option{-gdwarf-2}, @option{-gxcoff}, or @option{-gvms}.
@end defmac
@node DBX Options
@@ -7965,11 +7969,6 @@ Define this macro if GCC should produce COFF-style debugging output
for SDB in response to the @option{-g} option.
@end defmac
-@defmac DWARF_DEBUGGING_INFO
-Define this macro if GCC should produce dwarf format debugging output
-in response to the @option{-g} option.
-@end defmac
-
@defmac DWARF2_DEBUGGING_INFO
Define this macro if GCC should produce dwarf version 2 format
debugging output in response to the @option{-g} option.
@@ -8935,15 +8934,6 @@ A C statement that adds to @var{clobbers} @code{STRING_CST} trees for
any hard regs the port wishes to automatically clobber for all asms.
@end defmac
-@defmac MAX_INTEGER_COMPUTATION_MODE
-Define this to the largest integer machine mode which can be used for
-operations other than load, store and copy operations.
-
-You need only define this macro if the target holds values larger than
-@code{word_mode} in general purpose registers. Most targets should not define
-this macro.
-@end defmac
-
@defmac MATH_LIBRARY
Define this macro as a C string constant for the linker argument to link
in the system math library, or @samp{""} if the target does not have a
diff --git a/gcc/dojump.c b/gcc/dojump.c
index 2ed014bacf9..6b9569bb024 100644
--- a/gcc/dojump.c
+++ b/gcc/dojump.c
@@ -57,7 +57,6 @@ init_pending_stack_adjust (void)
void
clear_pending_stack_adjust (void)
{
-#ifdef EXIT_IGNORE_STACK
if (optimize > 0
&& (! flag_omit_frame_pointer || current_function_calls_alloca)
&& EXIT_IGNORE_STACK
@@ -67,7 +66,6 @@ clear_pending_stack_adjust (void)
stack_pointer_delta -= pending_stack_adjust,
pending_stack_adjust = 0;
}
-#endif
}
/* Pop any previously-pushed arguments that have not been popped yet. */
@@ -128,10 +126,6 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
tree type;
enum machine_mode mode;
-#ifdef MAX_INTEGER_COMPUTATION_MODE
- check_max_integer_computation_mode (exp);
-#endif
-
emit_queue ();
switch (code)
@@ -584,7 +578,14 @@ do_jump (tree exp, rtx if_false_label, rtx if_true_label)
{
/* The RTL optimizers prefer comparisons against pseudos. */
if (GET_CODE (temp) == SUBREG)
- temp = copy_to_reg (temp);
+ {
+ /* Compare promoted variables in their promoted mode. */
+ if (SUBREG_PROMOTED_VAR_P (temp)
+ && GET_CODE (XEXP (temp, 0)) == REG)
+ temp = XEXP (temp, 0);
+ else
+ temp = copy_to_reg (temp);
+ }
do_compare_rtx_and_jump (temp, CONST0_RTX (GET_MODE (temp)),
NE, TREE_UNSIGNED (TREE_TYPE (exp)),
GET_MODE (temp), NULL_RTX,
diff --git a/gcc/dominance.c b/gcc/dominance.c
index 38182ef5318..1b6c9fd8f42 100644
--- a/gcc/dominance.c
+++ b/gcc/dominance.c
@@ -43,16 +43,8 @@
#include "errors.h"
#include "et-forest.h"
-struct dominance_info
-{
- et_forest_t forest;
- varray_type varray;
-};
-
-#define BB_NODE(info, bb) \
- ((et_forest_node_t)VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2))
-#define SET_BB_NODE(info, bb, node) \
- (VARRAY_GENERIC_PTR ((info)->varray, (bb)->index + 2) = (node))
+/* Whether the dominators and the postdominators are available. */
+enum dom_state dom_computed[2];
/* We name our nodes with integers, beginning with 1. Zero is reserved for
'undefined' or 'end of list'. The name of each node is given by the dfs
@@ -124,7 +116,7 @@ static void compress (struct dom_info *, TBB);
static TBB eval (struct dom_info *, TBB);
static void link_roots (struct dom_info *, TBB, TBB);
static void calc_idoms (struct dom_info *, enum cdi_direction);
-void debug_dominance_info (dominance_info);
+void debug_dominance_info (enum cdi_direction);
/* Helper macro for allocating and initializing an array,
for aesthetic reasons. */
@@ -526,172 +518,250 @@ calc_idoms (struct dom_info *di, enum cdi_direction reverse)
di->dom[v] = di->dom[di->dom[v]];
}
-/* The main entry point into this module. IDOM is an integer array with room
- for last_basic_block integers, DOMS is a preallocated sbitmap array having
- room for last_basic_block^2 bits, and POST is true if the caller wants to
- know post-dominators.
+/* Assign dfs numbers starting from NUM to NODE and its sons. */
+
+static void
+assign_dfs_numbers (struct et_node *node, int *num)
+{
+ struct et_node *son;
+
+ node->dfs_num_in = (*num)++;
+
+ if (node->son)
+ {
+ assign_dfs_numbers (node->son, num);
+ for (son = node->son->right; son != node->son; son = son->right)
+ assign_dfs_numbers (son, num);
+ }
- On return IDOM[i] will be the BB->index of the immediate (post) dominator
- of basic block i, and DOMS[i] will have set bit j if basic block j is a
- (post)dominator for block i.
+ node->dfs_num_out = (*num)++;
+}
- Either IDOM or DOMS may be NULL (meaning the caller is not interested in
- immediate resp. all dominators). */
+/* Compute the data neccesary for fast resolving of dominator queries in a
+ static dominator tree. */
-dominance_info
-calculate_dominance_info (enum cdi_direction reverse)
+static void
+compute_dom_fast_query (enum cdi_direction dir)
+{
+ int num = 0;
+ basic_block bb;
+
+ if (dom_computed[dir] < DOM_NO_FAST_QUERY)
+ abort ();
+
+ if (dom_computed[dir] == DOM_OK)
+ return;
+
+ FOR_ALL_BB (bb)
+ {
+ if (!bb->dom[dir]->father)
+ assign_dfs_numbers (bb->dom[dir], &num);
+ }
+
+ dom_computed[dir] = DOM_OK;
+}
+
+/* The main entry point into this module. DIR is set depending on whether
+ we want to compute dominators or postdominators. */
+
+void
+calculate_dominance_info (enum cdi_direction dir)
{
struct dom_info di;
- dominance_info info;
basic_block b;
- /* Allocate structure for dominance information. */
- info = xmalloc (sizeof (struct dominance_info));
- info->forest = et_forest_create ();
- VARRAY_GENERIC_PTR_INIT (info->varray, last_basic_block + 3, "dominance info");
+ if (dom_computed[dir] == DOM_OK)
+ return;
- /* Add the two well-known basic blocks. */
- SET_BB_NODE (info, ENTRY_BLOCK_PTR, et_forest_add_node (info->forest,
- ENTRY_BLOCK_PTR));
- SET_BB_NODE (info, EXIT_BLOCK_PTR, et_forest_add_node (info->forest,
- EXIT_BLOCK_PTR));
- FOR_EACH_BB (b)
- SET_BB_NODE (info, b, et_forest_add_node (info->forest, b));
+ if (dom_computed[dir] != DOM_NO_FAST_QUERY)
+ {
+ if (dom_computed[dir] != DOM_NONE)
+ free_dominance_info (dir);
- init_dom_info (&di);
- calc_dfs_tree (&di, reverse);
- calc_idoms (&di, reverse);
+ FOR_ALL_BB (b)
+ {
+ b->dom[dir] = et_new_tree (b);
+ }
+ init_dom_info (&di);
+ calc_dfs_tree (&di, dir);
+ calc_idoms (&di, dir);
- FOR_EACH_BB (b)
- {
- TBB d = di.dom[di.dfs_order[b->index]];
+ FOR_EACH_BB (b)
+ {
+ TBB d = di.dom[di.dfs_order[b->index]];
+
+ if (di.dfs_to_bb[d])
+ et_set_father (b->dom[dir], di.dfs_to_bb[d]->dom[dir]);
+ }
- if (di.dfs_to_bb[d])
- et_forest_add_edge (info->forest, BB_NODE (info, di.dfs_to_bb[d]), BB_NODE (info, b));
+ free_dom_info (&di);
+ dom_computed[dir] = DOM_NO_FAST_QUERY;
}
- free_dom_info (&di);
- return info;
+ compute_dom_fast_query (dir);
}
-/* Free dominance information. */
+/* Free dominance information for direction DIR. */
void
-free_dominance_info (dominance_info info)
+free_dominance_info (enum cdi_direction dir)
{
basic_block bb;
- /* Allow users to create new basic block without setting up the dominance
- information for them. */
- FOR_EACH_BB (bb)
- if (bb->index < (int)(info->varray->num_elements - 2)
- && BB_NODE (info, bb))
- delete_from_dominance_info (info, bb);
- delete_from_dominance_info (info, ENTRY_BLOCK_PTR);
- delete_from_dominance_info (info, EXIT_BLOCK_PTR);
- et_forest_delete (info->forest);
- VARRAY_GROW (info->varray, 0);
- free (info);
+ if (!dom_computed[dir])
+ return;
+
+ FOR_ALL_BB (bb)
+ {
+ delete_from_dominance_info (dir, bb);
+ }
+
+ dom_computed[dir] = DOM_NONE;
}
/* Return the immediate dominator of basic block BB. */
basic_block
-get_immediate_dominator (dominance_info dom, basic_block bb)
+get_immediate_dominator (enum cdi_direction dir, basic_block bb)
{
- return et_forest_node_value (dom->forest,
- et_forest_parent (dom->forest,
- BB_NODE (dom, bb)));
+ struct et_node *node = bb->dom[dir];
+
+ if (!dom_computed[dir])
+ abort ();
+
+ if (!node->father)
+ return NULL;
+
+ return node->father->data;
}
/* Set the immediate dominator of the block possibly removing
existing edge. NULL can be used to remove any edge. */
inline void
-set_immediate_dominator (dominance_info dom, basic_block bb, basic_block dominated_by)
+set_immediate_dominator (enum cdi_direction dir, basic_block bb,
+ basic_block dominated_by)
{
- void *aux_bb_node;
- et_forest_node_t bb_node = BB_NODE (dom, bb);
+ struct et_node *node = bb->dom[dir];
+
+ if (!dom_computed[dir])
+ abort ();
- aux_bb_node = et_forest_parent (dom->forest, bb_node);
- if (aux_bb_node)
- et_forest_remove_edge (dom->forest, aux_bb_node, bb_node);
- if (dominated_by != NULL)
+ if (node->father)
{
- if (bb == dominated_by)
- abort ();
- if (!et_forest_add_edge (dom->forest, BB_NODE (dom, dominated_by), bb_node))
- abort ();
+ if (node->father->data == dominated_by)
+ return;
+ et_split (node);
}
+
+ if (dominated_by)
+ et_set_father (node, dominated_by->dom[dir]);
+
+ if (dom_computed[dir] == DOM_OK)
+ dom_computed[dir] = DOM_NO_FAST_QUERY;
}
-/* Store all basic blocks dominated by BB into BBS and return their number. */
+/* Store all basic blocks immediatelly dominated by BB into BBS and return
+ their number. */
int
-get_dominated_by (dominance_info dom, basic_block bb, basic_block **bbs)
+get_dominated_by (enum cdi_direction dir, basic_block bb, basic_block **bbs)
{
- int n, i;
+ int n;
+ struct et_node *node = bb->dom[dir], *son = node->son, *ason;
+
+ if (!dom_computed[dir])
+ abort ();
+
+ if (!son)
+ {
+ *bbs = NULL;
+ return 0;
+ }
+
+ for (ason = son->right, n = 1; ason != son; ason = ason->right)
+ n++;
+
+ *bbs = xmalloc (n * sizeof (basic_block));
+ (*bbs)[0] = son->data;
+ for (ason = son->right, n = 1; ason != son; ason = ason->right)
+ (*bbs)[n++] = ason->data;
- *bbs = xmalloc (n_basic_blocks * sizeof (basic_block));
- n = et_forest_enumerate_sons (dom->forest, BB_NODE (dom, bb), (et_forest_node_t *)*bbs);
- for (i = 0; i < n; i++)
- (*bbs)[i] = et_forest_node_value (dom->forest, (et_forest_node_t)(*bbs)[i]);
return n;
}
/* Redirect all edges pointing to BB to TO. */
void
-redirect_immediate_dominators (dominance_info dom, basic_block bb, basic_block to)
+redirect_immediate_dominators (enum cdi_direction dir, basic_block bb,
+ basic_block to)
{
- et_forest_node_t *bbs = xmalloc (n_basic_blocks * sizeof (basic_block));
- et_forest_node_t node = BB_NODE (dom, bb);
- et_forest_node_t node2 = BB_NODE (dom, to);
- int n = et_forest_enumerate_sons (dom->forest, node, bbs);
- int i;
+ struct et_node *bb_node = bb->dom[dir], *to_node = to->dom[dir], *son;
+
+ if (!dom_computed[dir])
+ abort ();
- for (i = 0; i < n; i++)
+ if (!bb_node->son)
+ return;
+
+ while (bb_node->son)
{
- et_forest_remove_edge (dom->forest, node, bbs[i]);
- et_forest_add_edge (dom->forest, node2, bbs[i]);
+ son = bb_node->son;
+
+ et_split (son);
+ et_set_father (son, to_node);
}
- free (bbs);
+
+ if (dom_computed[dir] == DOM_OK)
+ dom_computed[dir] = DOM_NO_FAST_QUERY;
}
/* Find first basic block in the tree dominating both BB1 and BB2. */
basic_block
-nearest_common_dominator (dominance_info dom, basic_block bb1, basic_block bb2)
+nearest_common_dominator (enum cdi_direction dir, basic_block bb1, basic_block bb2)
{
+ if (!dom_computed[dir])
+ abort ();
+
if (!bb1)
return bb2;
if (!bb2)
return bb1;
- return et_forest_node_value (dom->forest,
- et_forest_common_ancestor (dom->forest,
- BB_NODE (dom, bb1),
- BB_NODE (dom,
- bb2)));
+
+ return et_nca (bb1->dom[dir], bb2->dom[dir])->data;
}
/* Return TRUE in case BB1 is dominated by BB2. */
bool
-dominated_by_p (dominance_info dom, basic_block bb1, basic_block bb2)
+dominated_by_p (enum cdi_direction dir, basic_block bb1, basic_block bb2)
{
- return nearest_common_dominator (dom, bb1, bb2) == bb2;
+ struct et_node *n1 = bb1->dom[dir], *n2 = bb2->dom[dir];
+
+ if (!dom_computed[dir])
+ abort ();
+
+ if (dom_computed[dir] == DOM_OK)
+ return (n1->dfs_num_in >= n2->dfs_num_in
+ && n1->dfs_num_out <= n2->dfs_num_out);
+
+ return et_below (n1, n2);
}
/* Verify invariants of dominator structure. */
void
-verify_dominators (dominance_info dom)
+verify_dominators (enum cdi_direction dir)
{
int err = 0;
basic_block bb;
+ if (!dom_computed[dir])
+ abort ();
+
FOR_EACH_BB (bb)
{
basic_block dom_bb;
- dom_bb = recount_dominator (dom, bb);
- if (dom_bb != get_immediate_dominator (dom, bb))
+ dom_bb = recount_dominator (dir, bb);
+ if (dom_bb != get_immediate_dominator (dir, bb))
{
error ("dominator of %d should be %d, not %d",
- bb->index, dom_bb->index, get_immediate_dominator(dom, bb)->index);
+ bb->index, dom_bb->index, get_immediate_dominator(dir, bb)->index);
err = 1;
}
}
@@ -701,15 +771,18 @@ verify_dominators (dominance_info dom)
/* Recount dominator of BB. */
basic_block
-recount_dominator (dominance_info dom, basic_block bb)
+recount_dominator (enum cdi_direction dir, basic_block bb)
{
basic_block dom_bb = NULL;
edge e;
+ if (!dom_computed[dir])
+ abort ();
+
for (e = bb->pred; e; e = e->pred_next)
{
- if (!dominated_by_p (dom, e->src, bb))
- dom_bb = nearest_common_dominator (dom, dom_bb, e->src);
+ if (!dominated_by_p (dir, e->src, bb))
+ dom_bb = nearest_common_dominator (dir, dom_bb, e->src);
}
return dom_bb;
@@ -718,50 +791,85 @@ recount_dominator (dominance_info dom, basic_block bb)
/* Iteratively recount dominators of BBS. The change is supposed to be local
and not to grow further. */
void
-iterate_fix_dominators (dominance_info dom, basic_block *bbs, int n)
+iterate_fix_dominators (enum cdi_direction dir, basic_block *bbs, int n)
{
int i, changed = 1;
basic_block old_dom, new_dom;
+ if (!dom_computed[dir])
+ abort ();
+
while (changed)
{
changed = 0;
for (i = 0; i < n; i++)
{
- old_dom = get_immediate_dominator (dom, bbs[i]);
- new_dom = recount_dominator (dom, bbs[i]);
+ old_dom = get_immediate_dominator (dir, bbs[i]);
+ new_dom = recount_dominator (dir, bbs[i]);
if (old_dom != new_dom)
{
changed = 1;
- set_immediate_dominator (dom, bbs[i], new_dom);
+ set_immediate_dominator (dir, bbs[i], new_dom);
}
}
}
}
void
-add_to_dominance_info (dominance_info dom, basic_block bb)
+add_to_dominance_info (enum cdi_direction dir, basic_block bb)
{
- VARRAY_GROW (dom->varray, last_basic_block + 3);
-#ifdef ENABLE_CHECKING
- if (BB_NODE (dom, bb))
+ if (!dom_computed[dir])
abort ();
-#endif
- SET_BB_NODE (dom, bb, et_forest_add_node (dom->forest, bb));
+
+ if (bb->dom[dir])
+ abort ();
+
+ bb->dom[dir] = et_new_tree (bb);
+
+ if (dom_computed[dir] == DOM_OK)
+ dom_computed[dir] = DOM_NO_FAST_QUERY;
}
void
-delete_from_dominance_info (dominance_info dom, basic_block bb)
+delete_from_dominance_info (enum cdi_direction dir, basic_block bb)
+{
+ if (!dom_computed[dir])
+ abort ();
+
+ et_free_tree (bb->dom[dir]);
+ bb->dom[dir] = NULL;
+
+ if (dom_computed[dir] == DOM_OK)
+ dom_computed[dir] = DOM_NO_FAST_QUERY;
+}
+
+/* Returns the first son of BB in the dominator or postdominator tree
+ as determined by DIR. */
+
+basic_block
+first_dom_son (enum cdi_direction dir, basic_block bb)
{
- et_forest_remove_node (dom->forest, BB_NODE (dom, bb));
- SET_BB_NODE (dom, bb, NULL);
+ struct et_node *son = bb->dom[dir]->son;
+
+ return son ? son->data : NULL;
+}
+
+/* Returns the next dominance son after BB in the dominator or postdominator
+ tree as determined by DIR, or NULL if it was the last one. */
+
+basic_block
+next_dom_son (enum cdi_direction dir, basic_block bb)
+{
+ struct et_node *next = bb->dom[dir]->right;
+
+ return next->father->son == next ? NULL : next->data;
}
void
-debug_dominance_info (dominance_info dom)
+debug_dominance_info (enum cdi_direction dir)
{
basic_block bb, bb2;
FOR_EACH_BB (bb)
- if ((bb2 = get_immediate_dominator (dom, bb)))
+ if ((bb2 = get_immediate_dominator (dir, bb)))
fprintf (stderr, "%i %i\n", bb->index, bb2->index);
}
diff --git a/gcc/doschk.c b/gcc/doschk.c
deleted file mode 100644
index d024efc14ce..00000000000
--- a/gcc/doschk.c
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
-** DosFCheck - check file names for DOS consistency
-**
-** Distribute freely, it only encourages DOS compatibility!
-** - DJ Delorie
-*/
-
-/* This file is not part of GCC. */
-
-#include <stdio.h>
-#ifdef __MSDOS__
-#include <alloc.h>
-#else
-#include <malloc.h>
-#endif
-#include <ctype.h>
-#include <string.h>
-
-typedef struct ENT
-{
- struct ENT *next;
- char *dos_name;
- char *full_name;
- char *path;
- int tagged;
-} ENT;
-
-ENT *eroot = 0;
-
-int first_inv = 1;
-int first_msg = 1;
-
-/****************************************************************\
- * Utility routines *
-\****************************************************************/
-
-void
-invalid_msg ()
-{
- if (first_inv)
- {
- if (first_msg)
- first_msg = 0;
- else
- putchar ('\n');
- printf ("The following files are not valid DOS file names:\n");
- first_inv = 0;
- }
-}
-
-ENT *
-alloc_ent ()
-{
- ENT *rv = (ENT *)malloc (sizeof (ENT));
- if (rv == 0)
- {
- fprintf (stderr, "Unable to allocate memory for an ENT\n");
- exit (1);
- }
- memset (rv, 0, sizeof (ENT));
- return rv;
-}
-
-void
-fill_ent (ent, path)
-ENT *ent;
-char *path;
-{
- char *first = path;
- char *null = path+strlen (path);
- char *last_slash = strrchr (path, '/');
- char *cp, *dp;
- int dots_seen, chars_seen;
-
- if (last_slash+1 == null)
- {
- * --null = '\0';
- last_slash = strrchr (path, '/');
- }
-
- if (!last_slash)
- {
- last_slash = first-1;
- }
-
- if (null-last_slash < 13)
- ent->dos_name = (char *)malloc (null-last_slash);
- else
- ent->dos_name = (char *)malloc (13);
- ent->full_name = (char *)malloc (null-last_slash);
- ent->path = (char *)malloc (last_slash-first+1);
-
- strcpy (ent->full_name, last_slash+1);
- if (last_slash > first)
- {
- strncpy (ent->path, first, last_slash-first);
- ent->path[last_slash-first] = '\0';
- }
- else
- *ent->path = '\0';
-
- cp = last_slash+1;
- dp = ent->dos_name;
- dots_seen = 0;
- chars_seen = 0;
- while (1)
- {
- if (! *cp)
- break;
- switch (*cp)
- {
- case '.':
- if (cp == last_slash+1 && strcmp (last_slash+1, "."))
- {
- invalid_msg ();
- printf ("%s - file name cannot start with dot\n", path);
- *dp = 0;
- break;
- }
- if (dots_seen == 1)
- {
- invalid_msg ();
- printf ("%s - too many dots\n", path);
- *dp = '\0';
- break;
- }
- *dp++ = '.';
- chars_seen = 0;
- dots_seen++;
- break;
- case '"':
- case '*':
- case '+':
- case ',':
- case ';':
- case '<':
- case '=':
- case '>':
- case '?':
- case '[':
- case '\\':
- case ']':
- case '|':
- invalid_msg ();
- printf ("%s - invalid character `%c'\n", path, *cp);
- *dp++ = '?';
- chars_seen++;
- break;
- default:
- if (dots_seen)
- {
- if (chars_seen >= 3)
- break;
- }
- else
- if (chars_seen >= 8)
- break;
- if ((*cp <= ' ') || (*cp >= 0x7f))
- {
- invalid_msg ();
- printf ("%s - invalid character `%c'\n", path, *cp);
- *dp++ = '?';
- chars_seen++;
- break;
- }
- if (islower (*cp))
- *dp++ = toupper (*cp);
- else
- *dp++ = *cp;
- chars_seen++;
- break;
- }
- cp++;
- }
- *dp++ = '\0';
-}
-
-int
-compare_ent_dosname (e1, e2)
-ENT **e1;
-ENT **e2;
-{
- int r = strcmp ((*e1)->dos_name, (*e2)->dos_name);
- if (r == 0)
- r = strcmp ((*e1)->path, (*e2)->path);
- if (r == 0)
- r = strcmp ((*e1)->full_name, (*e2)->full_name);
- return r;
-}
-
-int
-compare_ent_fullname (e1, e2)
-ENT **e1;
-ENT **e2;
-{
- int r = strncmp ((*e1)->full_name, (*e2)->full_name, 14);
- if (r == 0)
- r = strcmp ((*e1)->path, (*e2)->path);
- if (r == 0)
- r = strcmp ((*e1)->full_name, (*e2)->full_name);
- return r;
-}
-
-char *
-mpath (ent)
-ENT *ent;
-{
- static char buf[500];
- if (ent->path && ent->path[0])
- sprintf (buf, "%s/%s", ent->path, ent->full_name);
- else
- return ent->full_name;
- return buf;
-}
-
-/****************************************************************\
- * List handling routines *
-\****************************************************************/
-
-void
-add_ent (ent)
-ENT *ent;
-{
- ent->next = eroot;
- eroot = ent;
-}
-
-void
-handle_input (line)
-char *line;
-{
- ENT *ent = alloc_ent ();
- fill_ent (ent, line);
- add_ent (ent);
-}
-
-void
-display_problems ()
-{
- ENT **elist, *ent;
- int ecount, i, first, first_err;
-
- for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++);
- elist = (ENT **)malloc (sizeof (ENT *) * ecount);
- for (ecount=0, ent=eroot; ent; ent=ent->next, ecount++)
- elist[ecount] = ent;
-
- qsort (elist, ecount, sizeof (ENT *), compare_ent_dosname);
-
- first = 1;
- first_err = 1;
- for (i=0; i<ecount-1; i++)
- {
- if ((strcmp (elist[i]->dos_name, elist[i+1]->dos_name) == 0)
- && (strcmp (elist[i]->path, elist[i+1]->path) == 0))
- {
- if (first_err)
- {
- if (first_msg)
- first_msg = 0;
- else
- putchar ('\n');
- printf ("The following resolve to the same DOS file names:\n");
- first_err = 0;
- }
- if (first)
- {
- printf ("%14s : %s\n", elist[i]->dos_name, mpath (elist[i]));
- first = 0;
- }
- printf ("\t\t %s\n", mpath (elist[i+1]));
- }
- else
- first = 1;
- }
-
- qsort (elist, ecount, sizeof (ENT *), compare_ent_fullname);
-
- first = 1;
- first_err = 1;
- for (i=0; i<ecount-1; i++)
- {
- if ((strncmp (elist[i]->full_name, elist[i+1]->full_name, 14) == 0)
- && (strcmp (elist[i]->path, elist[i+1]->path) == 0))
- {
- if (first_err)
- {
- if (first_msg)
- first_msg = 0;
- else
- putchar ('\n');
- printf ("The following resolve to the same SysV file names:\n");
- first_err = 0;
- }
- if (first)
- {
- printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i]));
- first = 0;
- elist[i]->tagged = 1;
- }
- printf ("\t\t %s\n", mpath (elist[i+1]));
- elist[i+1]->tagged = 1;
- }
- else
- first = 1;
- }
-
- first_err = 1;
- for (i=0; i<ecount; i++)
- {
- if ((strlen (elist[i]->full_name) > 14) && !elist[i]->tagged)
- {
- if (first_err)
- {
- if (first_msg)
- first_msg = 0;
- else
- putchar ('\n');
- printf ("The following file names are too long for SysV:\n");
- first_err = 0;
- }
- printf ("%.14s : %s\n", elist[i]->full_name, mpath (elist[i]));
- }
- }
-}
-
-/****************************************************************\
- * Main entry point *
-\****************************************************************/
-
-main (argc, argv)
-int argc;
-char **argv;
-{
- FILE *input = stdin;
- if (argc > 1)
- {
- input = fopen (argv[1], "r");
- if (!input)
- {
- perror (argv[1]);
- exit (1);
- }
- }
- while (1)
- {
- char line[500];
- char *lp;
- fgets (line, 500, input);
- if (feof (input))
- break;
- lp = line+strlen (line);
- while ((lp != line) && (*lp <= ' '))
- lp--;
- lp[1] = 0;
- handle_input (line);
- }
- display_problems ();
-}
-
diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c
index a99b2f650c4..fc9f0496793 100644
--- a/gcc/dwarf2out.c
+++ b/gcc/dwarf2out.c
@@ -3332,6 +3332,7 @@ typedef struct die_struct GTY(())
dw_die_ref die_parent;
dw_die_ref die_child;
dw_die_ref die_sib;
+ dw_die_ref die_definition; /* ref from a specification to its definition */
dw_offset die_offset;
unsigned long die_abbrev;
int die_mark;
@@ -3599,6 +3600,7 @@ static void add_AT_string (dw_die_ref, enum dwarf_attribute, const char *);
static inline const char *AT_string (dw_attr_ref);
static int AT_string_form (dw_attr_ref);
static void add_AT_die_ref (dw_die_ref, enum dwarf_attribute, dw_die_ref);
+static void add_AT_specification (dw_die_ref, dw_die_ref);
static inline dw_die_ref AT_ref (dw_attr_ref);
static inline int AT_ref_external (dw_attr_ref);
static inline void set_AT_ref_external (dw_attr_ref, int);
@@ -3738,7 +3740,7 @@ static void push_decl_scope (tree);
static void pop_decl_scope (void);
static dw_die_ref scope_die_for (tree, dw_die_ref);
static inline int local_scope_p (dw_die_ref);
-static inline int class_scope_p (dw_die_ref);
+static inline int class_or_namespace_scope_p (dw_die_ref);
static void add_type_attribute (dw_die_ref, tree, int, int, dw_die_ref);
static const char *type_tag (tree);
static tree member_declared_type (tree);
@@ -3776,7 +3778,11 @@ static void gen_tagged_type_instantiation_die (tree, dw_die_ref);
static void gen_block_die (tree, dw_die_ref, int);
static void decls_for_scope (tree, dw_die_ref, int);
static int is_redundant_typedef (tree);
+static void gen_namespace_die (tree);
static void gen_decl_die (tree, dw_die_ref);
+static dw_die_ref force_namespace_die (tree);
+static dw_die_ref setup_namespace_context (tree, dw_die_ref);
+static void declare_in_namespace (tree, dw_die_ref);
static unsigned lookup_filename (const char *);
static void init_file_table (void);
static void retry_incomplete_types (void);
@@ -3866,7 +3872,7 @@ static int maybe_emit_file (int);
/* Definitions of defaults for formats and names of various special
(artificial) labels which may be generated within this file (when the -g
- options is used and DWARF_DEBUGGING_INFO is in effect.
+ options is used and DWARF2_DEBUGGING_INFO is in effect.
If necessary, these may be overridden from within the tm.h file, but
typically, overriding these defaults is unnecessary. */
@@ -4032,6 +4038,8 @@ dwarf_tag_name (unsigned int tag)
return "DW_TAG_namelist";
case DW_TAG_namelist_item:
return "DW_TAG_namelist_item";
+ case DW_TAG_namespace:
+ return "DW_TAG_namespace";
case DW_TAG_packed_type:
return "DW_TAG_packed_type";
case DW_TAG_subprogram:
@@ -4664,6 +4672,18 @@ add_AT_die_ref (dw_die_ref die, enum dwarf_attribute attr_kind, dw_die_ref targ_
add_dwarf_attr (die, attr);
}
+/* Add an AT_specification attribute to a DIE, and also make the back
+ pointer from the specification to the definition. */
+
+static inline void
+add_AT_specification (dw_die_ref die, dw_die_ref targ_die)
+{
+ add_AT_die_ref (die, DW_AT_specification, targ_die);
+ if (targ_die->die_definition)
+ abort ();
+ targ_die->die_definition = die;
+}
+
static inline dw_die_ref
AT_ref (dw_attr_ref a)
{
@@ -8768,6 +8788,9 @@ loc_descriptor_from_tree (tree loc, int addressp)
}
break;
+ case EXPR_WITH_FILE_LOCATION:
+ return loc_descriptor_from_tree (EXPR_WFL_NODE (loc), addressp);
+
default:
/* Leave front-end specific codes as simply unknown. This comes
up, for instance, with the C STMT_EXPR. */
@@ -9442,6 +9465,33 @@ add_location_or_const_value_attribute (dw_die_ref die, tree decl)
add_AT_location_description (die, DW_AT_location, descr);
break;
+ case PARALLEL:
+ {
+ rtvec par_elems = XVEC (rtl, 0);
+ int num_elem = GET_NUM_ELEM (par_elems);
+ enum machine_mode mode;
+ int i;
+
+ /* Create the first one, so we have something to add to. */
+ descr = loc_descriptor (XEXP (RTVEC_ELT (par_elems, 0), 0));
+ mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, 0), 0));
+ add_loc_descr (&descr,
+ new_loc_descr (DW_OP_piece, GET_MODE_SIZE (mode), 0));
+ for (i = 1; i < num_elem; i++)
+ {
+ dw_loc_descr_ref temp;
+
+ temp = loc_descriptor (XEXP (RTVEC_ELT (par_elems, i), 0));
+ add_loc_descr (&descr, temp);
+ mode = GET_MODE (XEXP (RTVEC_ELT (par_elems, i), 0));
+ add_loc_descr (&descr,
+ new_loc_descr (DW_OP_piece,
+ GET_MODE_SIZE (mode), 0));
+ }
+ }
+ add_AT_location_description (die, DW_AT_location, descr);
+ break;
+
default:
abort ();
}
@@ -9979,9 +10029,14 @@ scope_die_for (tree t, dw_die_ref context_die)
containing_scope = TYPE_CONTEXT (t);
- /* Ignore namespaces for the moment. */
+ /* Use the containing namespace if it was passed in (for a declaration). */
if (containing_scope && TREE_CODE (containing_scope) == NAMESPACE_DECL)
- containing_scope = NULL_TREE;
+ {
+ if (context_die == lookup_decl_die (containing_scope))
+ /* OK */;
+ else
+ containing_scope = NULL_TREE;
+ }
/* Ignore function type "scopes" from the C frontend. They mean that
a tagged type is local to a parmlist of a function declarator, but
@@ -10031,14 +10086,16 @@ local_scope_p (dw_die_ref context_die)
return 0;
}
-/* Returns nonzero if CONTEXT_DIE is a class. */
+/* Returns nonzero if CONTEXT_DIE is a class or namespace, for deciding
+ whether or not to treat a DIE in this context as a declaration. */
static inline int
-class_scope_p (dw_die_ref context_die)
+class_or_namespace_scope_p (dw_die_ref context_die)
{
return (context_die
&& (context_die->die_tag == DW_TAG_structure_type
- || context_die->die_tag == DW_TAG_union_type));
+ || context_die->die_tag == DW_TAG_union_type
+ || context_die->die_tag == DW_TAG_namespace));
}
/* Many forms of DIEs require a "type description" attribute. This
@@ -10186,7 +10243,7 @@ gen_array_type_die (tree type, dw_die_ref context_die)
/* The SGI compilers handle arrays of unknown bound by setting
AT_declaration and not emitting any subrange DIEs. */
if (! TYPE_DOMAIN (type))
- add_AT_unsigned (array_die, DW_AT_declaration, 1);
+ add_AT_flag (array_die, DW_AT_declaration, 1);
else
#endif
add_subscript_info (array_die, type);
@@ -10558,7 +10615,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
tree outer_scope;
dw_die_ref old_die = lookup_decl_die (decl);
int declaration = (current_function_decl != decl
- || class_scope_p (context_die));
+ || class_or_namespace_scope_p (context_die));
/* It is possible to have both DECL_ABSTRACT and DECLARATION be true if we
started to generate the abstract instance of an inline, decided to output
@@ -10567,7 +10624,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
we'll get back to the abstract instance when done with the class. */
/* The class-scope declaration DIE must be the primary DIE. */
- if (origin && declaration && class_scope_p (context_die))
+ if (origin && declaration && class_or_namespace_scope_p (context_die))
{
origin = NULL;
if (old_die)
@@ -10629,7 +10686,7 @@ gen_subprogram_die (tree decl, dw_die_ref context_die)
else
{
subr_die = new_die (DW_TAG_subprogram, context_die, decl);
- add_AT_die_ref (subr_die, DW_AT_specification, old_die);
+ add_AT_specification (subr_die, old_die);
if (get_AT_unsigned (old_die, DW_AT_decl_file) != file_index)
add_AT_unsigned (subr_die, DW_AT_decl_file, file_index);
if (get_AT_unsigned (old_die, DW_AT_decl_line)
@@ -10832,7 +10889,7 @@ gen_variable_die (tree decl, dw_die_ref context_die)
dw_die_ref old_die = lookup_decl_die (decl);
int declaration = (DECL_EXTERNAL (decl)
- || class_scope_p (context_die));
+ || class_or_namespace_scope_p (context_die));
if (origin != NULL)
add_abstract_origin_attribute (var_die, origin);
@@ -10849,7 +10906,7 @@ gen_variable_die (tree decl, dw_die_ref context_die)
&& get_AT_flag (old_die, DW_AT_declaration) == 1)
{
/* This is a definition of a C++ class level static. */
- add_AT_die_ref (var_die, DW_AT_specification, old_die);
+ add_AT_specification (var_die, old_die);
if (DECL_NAME (decl))
{
unsigned file_index = lookup_filename (DECL_SOURCE_FILE (decl));
@@ -10885,7 +10942,7 @@ gen_variable_die (tree decl, dw_die_ref context_die)
if (declaration)
add_AT_flag (var_die, DW_AT_declaration, 1);
- if (class_scope_p (context_die) || DECL_ABSTRACT (decl))
+ if (class_or_namespace_scope_p (context_die) || DECL_ABSTRACT (decl))
equate_decl_number_to_die (decl, var_die);
if (! declaration && ! DECL_ABSTRACT (decl))
@@ -10916,14 +10973,15 @@ gen_label_die (tree decl, dw_die_ref context_die)
equate_decl_number_to_die (decl, lbl_die);
else
{
- insn = DECL_RTL (decl);
+ insn = DECL_RTL_IF_SET (decl);
/* Deleted labels are programmer specified labels which have been
eliminated because of various optimizations. We still emit them
here so that it is possible to put breakpoints on them. */
- if (GET_CODE (insn) == CODE_LABEL
- || ((GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
+ if (insn
+ && (GET_CODE (insn) == CODE_LABEL
+ || ((GET_CODE (insn) == NOTE
+ && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL))))
{
/* When optimization is enabled (via -O) some parts of the compiler
(e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which
@@ -11274,12 +11332,14 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die)
int complete = (TYPE_SIZE (type)
&& (! TYPE_STUB_DECL (type)
|| ! TYPE_DECL_SUPPRESS_DEBUG (TYPE_STUB_DECL (type))));
+ int ns_decl = (context_die && context_die->die_tag == DW_TAG_namespace);
if (type_die && ! complete)
return;
if (TYPE_CONTEXT (type) != NULL_TREE
- && AGGREGATE_TYPE_P (TYPE_CONTEXT (type)))
+ && (AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
+ || TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL))
nested = 1;
scope_die = scope_die_for (type, context_die);
@@ -11294,7 +11354,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die)
scope_die, type);
equate_type_number_to_die (type, type_die);
if (old_die)
- add_AT_die_ref (type_die, DW_AT_specification, old_die);
+ add_AT_specification (type_die, old_die);
else
add_name_attribute (type_die, type_tag (type));
}
@@ -11303,7 +11363,7 @@ gen_struct_or_union_type_die (tree type, dw_die_ref context_die)
/* If this type has been completed, then give it a byte_size attribute and
then give a list of members. */
- if (complete)
+ if (complete && !ns_decl)
{
/* Prevent infinite recursion in cases where the type of some member of
this type is expressed in terms of this type itself. */
@@ -11528,7 +11588,10 @@ gen_type_die (tree type, dw_die_ref context_die)
need_pop = 1;
}
else
- need_pop = 0;
+ {
+ declare_in_namespace (type, context_die);
+ need_pop = 0;
+ }
if (TREE_CODE (type) == ENUMERAL_TYPE)
gen_enumeration_type_die (type, context_die);
@@ -11761,6 +11824,98 @@ is_redundant_typedef (tree decl)
return 0;
}
+/* Returns the DIE for namespace NS or aborts.
+
+ Note that namespaces don't really have a lexical context, so there's no
+ need to pass in a context_die. They always go inside their containing
+ namespace, or comp_unit_die if none. */
+
+static dw_die_ref
+force_namespace_die (tree ns)
+{
+ dw_die_ref ns_die;
+
+ dwarf2out_decl (ns);
+ ns_die = lookup_decl_die (ns);
+ if (!ns_die)
+ abort();
+
+ return ns_die;
+}
+
+/* Force out any required namespaces to be able to output DECL,
+ and return the new context_die for it, if it's changed. */
+
+static dw_die_ref
+setup_namespace_context (tree thing, dw_die_ref context_die)
+{
+ tree context = DECL_P (thing) ? DECL_CONTEXT (thing) : TYPE_CONTEXT (thing);
+ if (context && TREE_CODE (context) == NAMESPACE_DECL)
+ /* Force out the namespace. */
+ context_die = force_namespace_die (context);
+
+ return context_die;
+}
+
+/* Emit a declaration DIE for THING (which is either a DECL or a tagged
+ type) within its namespace, if appropriate.
+
+ For compatibility with older debuggers, namespace DIEs only contain
+ declarations; all definitions are emitted at CU scope. */
+
+static void
+declare_in_namespace (tree thing, dw_die_ref context_die)
+{
+ dw_die_ref ns_context;
+
+ if (debug_info_level <= DINFO_LEVEL_TERSE)
+ return;
+
+ ns_context = setup_namespace_context (thing, context_die);
+
+ if (ns_context != context_die)
+ {
+ if (DECL_P (thing))
+ gen_decl_die (thing, ns_context);
+ else
+ gen_type_die (thing, ns_context);
+ }
+}
+
+/* Generate a DIE for a namespace or namespace alias. */
+
+static void
+gen_namespace_die (tree decl)
+{
+ dw_die_ref context_die = setup_namespace_context (decl, comp_unit_die);
+
+ /* Namespace aliases have a DECL_ABSTRACT_ORIGIN of the namespace
+ they are an alias of. */
+ if (DECL_ABSTRACT_ORIGIN (decl) == NULL)
+ {
+ /* Output a real namespace. */
+ dw_die_ref namespace_die
+ = new_die (DW_TAG_namespace, context_die, decl);
+ add_name_and_src_coords_attributes (namespace_die, decl);
+ equate_decl_number_to_die (decl, namespace_die);
+ }
+ else
+ {
+ /* Output a namespace alias. */
+
+ /* Force out the namespace we are an alias of, if necessary. */
+ dw_die_ref origin_die
+ = force_namespace_die (DECL_ABSTRACT_ORIGIN (decl));
+
+ /* Now create the namespace alias DIE. */
+ dw_die_ref namespace_die
+ = new_die (DW_TAG_imported_declaration, context_die, decl);
+ add_name_and_src_coords_attributes (namespace_die, decl);
+ add_AT_die_ref (namespace_die, DW_AT_import, origin_die);
+ equate_decl_number_to_die (decl, namespace_die);
+ }
+}
+
/* Generate Dwarf debug information for a decl described by DECL. */
static void
@@ -11796,7 +11951,7 @@ gen_decl_die (tree decl, dw_die_ref context_die)
emit info for the abstract instance and set up to refer to it. */
else if (cgraph_function_possibly_inlined_p (decl)
&& ! DECL_ABSTRACT (decl)
- && ! class_scope_p (context_die)
+ && ! class_or_namespace_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. */
@@ -11821,6 +11976,9 @@ gen_decl_die (tree decl, dw_die_ref context_die)
origin = decl_class_context (decl);
if (origin != NULL_TREE)
gen_type_die_for_member (origin, decl, context_die);
+
+ /* And its containing namespace. */
+ declare_in_namespace (decl, context_die);
}
/* Now output a DIE to represent the function itself. */
@@ -11872,6 +12030,9 @@ gen_decl_die (tree decl, dw_die_ref context_die)
if (origin != NULL_TREE)
gen_type_die_for_member (origin, decl, context_die);
+ /* And its containing namespace. */
+ declare_in_namespace (decl, context_die);
+
/* Now output the DIE to represent the data object itself. This gets
complicated because of the possibility that the VAR_DECL really
represents an inlined instance of a formal parameter for an inline
@@ -11900,7 +12061,7 @@ gen_decl_die (tree decl, dw_die_ref context_die)
break;
case NAMESPACE_DECL:
- /* Ignore for now. */
+ gen_namespace_die (decl);
break;
default:
@@ -12023,6 +12184,13 @@ dwarf2out_decl (tree decl)
return;
break;
+ case NAMESPACE_DECL:
+ if (debug_info_level <= DINFO_LEVEL_TERSE)
+ return;
+ if (lookup_decl_die (decl) != NULL)
+ return;
+ break;
+
case TYPE_DECL:
/* Don't emit stubs for types unless they are needed by other DIEs. */
if (TYPE_DECL_SUPPRESS_DEBUG (decl))
@@ -12503,6 +12671,11 @@ prune_unused_types_mark (dw_die_ref die, int dokids)
/* Mark any referenced nodes. */
prune_unused_types_walk_attribs (die);
+
+ /* If this node is a specification,
+ also mark the definition, if it exists. */
+ if (get_AT_flag (die, DW_AT_declaration) && die->die_definition)
+ prune_unused_types_mark (die->die_definition, 1);
}
if (dokids && die->die_mark != 2)
diff --git a/gcc/dwarfout.c b/gcc/dwarfout.c
deleted file mode 100644
index 5200af5aaf6..00000000000
--- a/gcc/dwarfout.c
+++ /dev/null
@@ -1,6396 +0,0 @@
-/* Output Dwarf format symbol table information from GCC.
- Copyright (C) 1992, 1993, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- 2002, 2003 Free Software Foundation, Inc.
- Contributed by Ron Guilmette (rfg@monkeys.com) of Network Computing Devices.
-
-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. */
-
-/*
-
- 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 a 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"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-#ifdef DWARF_DEBUGGING_INFO
-#include "dwarf.h"
-#include "tree.h"
-#include "flags.h"
-#include "function.h"
-#include "rtl.h"
-#include "hard-reg-set.h"
-#include "insn-config.h"
-#include "reload.h"
-#include "output.h"
-#include "dwarf2asm.h"
-#include "toplev.h"
-#include "tm_p.h"
-#include "debug.h"
-#include "target.h"
-#include "langhooks.h"
-
-/* 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
- file. */
-
-/* Note that the implementation of C++ support herein is (as yet) unfinished.
- If you want to try to complete it, more power to you. */
-
-/* How to start an assembler comment. */
-#ifndef ASM_COMMENT_START
-#define ASM_COMMENT_START ";#"
-#endif
-
-/* Define a macro which returns nonzero for any tagged type which is
- used (directly or indirectly) in the specification of either some
- function's return type or some formal parameter of some function.
- We use this macro when we are operating in "terse" mode to help us
- know what tagged types have to be represented in Dwarf (even in
- terse mode) and which ones don't.
-
- A flag bit with this meaning really should be a part of the normal
- GCC ..._TYPE nodes, but at the moment, there is no such bit defined
- for these nodes. For now, we have to just fake it. It it safe for
- us to simply return zero for all complete tagged types (which will
- get forced out anyway if they were used in the specification of some
- formal or return type) and nonzero for all incomplete tagged types.
-*/
-
-#define TYPE_USED_FOR_FUNCTION(tagged_type) (TYPE_SIZE (tagged_type) == 0)
-
-/* Define a macro which returns nonzero for a TYPE_DECL which was
- implicitly generated for a tagged type.
-
- Note that unlike the gcc front end (which generates a NULL named
- TYPE_DECL node for each complete tagged type, each array type, and
- each function type node created) the g++ front end generates a
- _named_ TYPE_DECL node for each tagged type node created.
- These TYPE_DECLs have DECL_ARTIFICIAL set, so we know not to
- generate a DW_TAG_typedef DIE for them. */
-#define TYPE_DECL_IS_STUB(decl) \
- (DECL_NAME (decl) == NULL \
- || (DECL_ARTIFICIAL (decl) \
- && is_tagged_type (TREE_TYPE (decl)) \
- && decl == TYPE_STUB_DECL (TREE_TYPE (decl))))
-
-/* Maximum size (in bytes) of an artificially generated label. */
-
-#define MAX_ARTIFICIAL_LABEL_BYTES 30
-
-/* Structure to keep track of source filenames. */
-
-struct filename_entry {
- unsigned number;
- const char * name;
-};
-
-typedef struct filename_entry filename_entry;
-
-/* Pointer to an array of elements, each one having the structure above. */
-
-static filename_entry *filename_table;
-
-/* Total number of entries in the table (i.e. array) pointed to by
- `filename_table'. This is the *total* and includes both used and
- unused slots. */
-
-static unsigned ft_entries_allocated;
-
-/* Number of entries in the filename_table which are actually in use. */
-
-static unsigned ft_entries;
-
-/* Size (in elements) of increments by which we may expand the filename
- table. Actually, a single hunk of space of this size should be enough
- for most typical programs. */
-
-#define FT_ENTRIES_INCREMENT 64
-
-/* Local pointer to the name of the main input file. Initialized in
- dwarfout_init. */
-
-static const char *primary_filename;
-
-/* Counter to generate unique names for DIEs. */
-
-static unsigned next_unused_dienum = 1;
-
-/* Number of the DIE which is currently being generated. */
-
-static unsigned current_dienum;
-
-/* Number to use for the special "pubname" label on the next DIE which
- represents a function or data object defined in this compilation
- unit which has "extern" linkage. */
-
-static int next_pubname_number = 0;
-
-#define NEXT_DIE_NUM pending_sibling_stack[pending_siblings-1]
-
-/* Pointer to a dynamically allocated list of pre-reserved and still
- pending sibling DIE numbers. Note that this list will grow as needed. */
-
-static unsigned *pending_sibling_stack;
-
-/* Counter to keep track of the number of pre-reserved and still pending
- sibling DIE numbers. */
-
-static unsigned pending_siblings;
-
-/* The currently allocated size of the above list (expressed in number of
- list elements). */
-
-static unsigned pending_siblings_allocated;
-
-/* Size (in elements) of increments by which we may expand the pending
- sibling stack. Actually, a single hunk of space of this size should
- be enough for most typical programs. */
-
-#define PENDING_SIBLINGS_INCREMENT 64
-
-/* Nonzero if we are performing our file-scope finalization pass and if
- we should force out Dwarf descriptions of any and all file-scope
- tagged types which are still incomplete types. */
-
-static int finalizing = 0;
-
-/* A pointer to the base of a list of pending types which we haven't
- generated DIEs for yet, but which we will have to come back to
- later on. */
-
-static tree *pending_types_list;
-
-/* Number of elements currently allocated for the pending_types_list. */
-
-static unsigned pending_types_allocated;
-
-/* Number of elements of pending_types_list currently in use. */
-
-static unsigned pending_types;
-
-/* Size (in elements) of increments by which we may expand the pending
- types list. Actually, a single hunk of space of this size should
- be enough for most typical programs. */
-
-#define PENDING_TYPES_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
-
-/* Pointer to an artificial RECORD_TYPE which we create in dwarfout_init.
- This is used in a hack to help us get the DIEs describing types of
- formal parameters to come *after* all of the DIEs describing the formal
- parameters themselves. That's necessary in order to be compatible
- with what the brain-damaged svr4 SDB debugger requires. */
-
-static tree fake_containing_scope;
-
-/* A pointer to the ..._DECL node which we have most recently been working
- on. We keep this around just in case something about it looks screwy
- and we want to tell the user what the source coordinates for the actual
- declaration are. */
-
-static tree dwarf_last_decl;
-
-/* A flag indicating that we are emitting the member declarations of a
- class, so member functions and variables should not be entirely emitted.
- This is a kludge to avoid passing a second argument to output_*_die. */
-
-static int in_class;
-
-/* Forward declarations for functions defined in this file. */
-
-static void dwarfout_init (const char *);
-static void dwarfout_finish (const char *);
-static void dwarfout_define (unsigned int, const char *);
-static void dwarfout_undef (unsigned int, const char *);
-static void dwarfout_start_source_file (unsigned, const char *);
-static void dwarfout_start_source_file_check (unsigned, const char *);
-static void dwarfout_end_source_file (unsigned);
-static void dwarfout_end_source_file_check (unsigned);
-static void dwarfout_begin_block (unsigned, unsigned);
-static void dwarfout_end_block (unsigned, unsigned);
-static void dwarfout_end_epilogue (unsigned int, const char *);
-static void dwarfout_source_line (unsigned int, const char *);
-static void dwarfout_end_prologue (unsigned int, const char *);
-static void dwarfout_end_function (unsigned int);
-static void dwarfout_function_decl (tree);
-static void dwarfout_global_decl (tree);
-static void dwarfout_deferred_inline_function (tree);
-static void dwarfout_file_scope_decl (tree , int);
-static const char *dwarf_tag_name (unsigned);
-static const char *dwarf_attr_name (unsigned);
-static const char *dwarf_stack_op_name (unsigned);
-static const char *dwarf_typemod_name (unsigned);
-static const char *dwarf_fmt_byte_name (unsigned);
-static const char *dwarf_fund_type_name (unsigned);
-static tree decl_ultimate_origin (tree);
-static tree block_ultimate_origin (tree);
-static tree decl_class_context (tree);
-#if 0
-static void output_unsigned_leb128 (unsigned long);
-static void output_signed_leb128 (long);
-#endif
-static int fundamental_type_code (tree);
-static tree root_type_1 (tree, int);
-static tree root_type (tree);
-static void write_modifier_bytes_1 (tree, int, int, int);
-static void write_modifier_bytes (tree, int, int);
-static inline int type_is_fundamental (tree);
-static void equate_decl_number_to_die_number (tree);
-static inline void equate_type_number_to_die_number (tree);
-static void output_reg_number (rtx);
-static void output_mem_loc_descriptor (rtx);
-static void output_loc_descriptor (rtx);
-static void output_bound_representation (tree, unsigned, char);
-static void output_enumeral_list (tree);
-static inline HOST_WIDE_INT ceiling (HOST_WIDE_INT, unsigned int);
-static inline tree field_type (tree);
-static inline unsigned int simple_type_align_in_bits (tree);
-static inline unsigned HOST_WIDE_INT simple_type_size_in_bits (tree);
-static HOST_WIDE_INT field_byte_offset (tree);
-static inline void sibling_attribute (void);
-static void location_attribute (rtx);
-static void data_member_location_attribute (tree);
-static void const_value_attribute (rtx);
-static void location_or_const_value_attribute (tree);
-static inline void name_attribute (const char *);
-static inline void fund_type_attribute (unsigned);
-static void mod_fund_type_attribute (tree, int, int);
-static inline void user_def_type_attribute (tree);
-static void mod_u_d_type_attribute (tree, int, int);
-#ifdef USE_ORDERING_ATTRIBUTE
-static inline void ordering_attribute (unsigned);
-#endif /* defined(USE_ORDERING_ATTRIBUTE) */
-static void subscript_data_attribute (tree);
-static void byte_size_attribute (tree);
-static inline void bit_offset_attribute (tree);
-static inline void bit_size_attribute (tree);
-static inline void element_list_attribute (tree);
-static inline void stmt_list_attribute (const char *);
-static inline void low_pc_attribute (const char *);
-static inline void high_pc_attribute (const char *);
-static inline void body_begin_attribute (const char *);
-static inline void body_end_attribute (const char *);
-static inline void language_attribute (unsigned);
-static inline void member_attribute (tree);
-#if 0
-static inline void string_length_attribute (tree);
-#endif
-static inline void comp_dir_attribute (const char *);
-static inline void sf_names_attribute (const char *);
-static inline void src_info_attribute (const char *);
-static inline void mac_info_attribute (const char *);
-static inline void prototyped_attribute (tree);
-static inline void producer_attribute (const char *);
-static inline void inline_attribute (tree);
-static inline void containing_type_attribute (tree);
-static inline void abstract_origin_attribute (tree);
-#ifdef DWARF_DECL_COORDINATES
-static inline void src_coords_attribute (unsigned, unsigned);
-#endif /* defined(DWARF_DECL_COORDINATES) */
-static inline void pure_or_virtual_attribute (tree);
-static void name_and_src_coords_attributes (tree);
-static void type_attribute (tree, int, int);
-static const char *type_tag (tree);
-static inline void dienum_push (void);
-static inline void dienum_pop (void);
-static inline tree member_declared_type (tree);
-static const char *function_start_label (tree);
-static void output_array_type_die (void *);
-static void output_set_type_die (void *);
-#if 0
-static void output_entry_point_die (void *);
-#endif
-static void output_inlined_enumeration_type_die (void *);
-static void output_inlined_structure_type_die (void *);
-static void output_inlined_union_type_die (void *);
-static void output_enumeration_type_die (void *);
-static void output_formal_parameter_die (void *);
-static void output_global_subroutine_die (void *);
-static void output_global_variable_die (void *);
-static void output_label_die (void *);
-static void output_lexical_block_die (void *);
-static void output_inlined_subroutine_die (void *);
-static void output_local_variable_die (void *);
-static void output_member_die (void *);
-#if 0
-static void output_pointer_type_die (void *);
-static void output_reference_type_die (void *);
-#endif
-static void output_ptr_to_mbr_type_die (void *);
-static void output_compile_unit_die (void *);
-static void output_string_type_die (void *);
-static void output_inheritance_die (void *);
-static void output_structure_type_die (void *);
-static void output_local_subroutine_die (void *);
-static void output_subroutine_type_die (void *);
-static void output_typedef_die (void *);
-static void output_union_type_die (void *);
-static void output_unspecified_parameters_die (void *);
-static void output_padded_null_die (void *);
-static void output_die (void (*)(void *), void *);
-static void end_sibling_chain (void);
-static void output_formal_types (tree);
-static void pend_type (tree);
-static int type_ok_for_scope (tree, tree);
-static void output_pending_types_for_scope (tree);
-static void output_type (tree, tree);
-static void output_tagged_type_instantiation (tree);
-static void output_block (tree, int);
-static void output_decls_for_scope (tree, int);
-static void output_decl (tree, tree);
-static void shuffle_filename_entry (filename_entry *);
-static void generate_new_sfname_entry (void);
-static unsigned lookup_filename (const char *);
-static void generate_srcinfo_entry (unsigned, unsigned);
-static void generate_macinfo_entry (unsigned int, rtx, const char *);
-static int is_pseudo_reg (rtx);
-static tree type_main_variant (tree);
-static int is_tagged_type (tree);
-static int is_redundant_typedef (tree);
-static void add_incomplete_type (tree);
-static void retry_incomplete_types (void);
-
-/* Definitions of defaults for assembler-dependent names of various
- pseudo-ops and section names.
-
- Theses may be overridden in your tm.h file (if necessary) for your
- particular assembler. The default values provided here correspond to
- what is expected by "standard" AT&T System V.4 assemblers. */
-
-#ifndef FILE_ASM_OP
-#define FILE_ASM_OP "\t.file\t"
-#endif
-#ifndef SET_ASM_OP
-#define SET_ASM_OP "\t.set\t"
-#endif
-
-/* Pseudo-ops for pushing the current section onto the section stack (and
- simultaneously changing to a new section) and for popping back to the
- section we were in immediately before this one. Note that most svr4
- assemblers only maintain a one level stack... you can push all the
- sections you want, but you can only pop out one level. (The sparc
- svr4 assembler is an exception to this general rule.) That's
- OK because we only use at most one level of the section stack herein. */
-
-#ifndef PUSHSECTION_ASM_OP
-#define PUSHSECTION_ASM_OP "\t.section\t"
-#endif
-#ifndef POPSECTION_ASM_OP
-#define POPSECTION_ASM_OP "\t.previous"
-#endif
-
-/* The default format used by the ASM_OUTPUT_PUSH_SECTION macro (see below)
- to print the PUSHSECTION_ASM_OP and the section name. The default here
- works for almost all svr4 assemblers, except for the sparc, where the
- section name must be enclosed in double quotes. (See sparcv4.h.) */
-
-#ifndef PUSHSECTION_FORMAT
-#define PUSHSECTION_FORMAT "%s%s\n"
-#endif
-
-#ifndef DEBUG_SECTION
-#define DEBUG_SECTION ".debug"
-#endif
-#ifndef LINE_SECTION
-#define LINE_SECTION ".line"
-#endif
-#ifndef DEBUG_SFNAMES_SECTION
-#define DEBUG_SFNAMES_SECTION ".debug_sfnames"
-#endif
-#ifndef DEBUG_SRCINFO_SECTION
-#define DEBUG_SRCINFO_SECTION ".debug_srcinfo"
-#endif
-#ifndef DEBUG_MACINFO_SECTION
-#define DEBUG_MACINFO_SECTION ".debug_macinfo"
-#endif
-#ifndef DEBUG_PUBNAMES_SECTION
-#define DEBUG_PUBNAMES_SECTION ".debug_pubnames"
-#endif
-#ifndef DEBUG_ARANGES_SECTION
-#define DEBUG_ARANGES_SECTION ".debug_aranges"
-#endif
-#ifndef TEXT_SECTION_NAME
-#define TEXT_SECTION_NAME ".text"
-#endif
-#ifndef DATA_SECTION_NAME
-#define DATA_SECTION_NAME ".data"
-#endif
-#ifndef DATA1_SECTION_NAME
-#define DATA1_SECTION_NAME ".data1"
-#endif
-#ifndef RODATA_SECTION_NAME
-#define RODATA_SECTION_NAME ".rodata"
-#endif
-#ifndef RODATA1_SECTION_NAME
-#define RODATA1_SECTION_NAME ".rodata1"
-#endif
-#ifndef BSS_SECTION_NAME
-#define BSS_SECTION_NAME ".bss"
-#endif
-
-/* Definitions of defaults for formats and names of various special
- (artificial) labels which may be generated within this file (when
- the -g options is used and DWARF_DEBUGGING_INFO is in effect.
-
- If necessary, these may be overridden from within your tm.h file,
- but typically, you should never need to override these.
-
- These labels have been hacked (temporarily) so that they all begin with
- a `.L' sequence so as to appease the stock sparc/svr4 assembler and the
- stock m88k/svr4 assembler, both of which need to see .L at the start of
- a label in order to prevent that label from going into the linker symbol
- table). When I get time, I'll have to fix this the right way so that we
- will use ASM_GENERATE_INTERNAL_LABEL and (*targetm.asm_out.internal_label) herein,
- but that will require a rather massive set of changes. For the moment,
- the following definitions out to produce the right results for all svr4
- and svr3 assemblers. -- rfg
-*/
-
-#ifndef TEXT_BEGIN_LABEL
-#define TEXT_BEGIN_LABEL "*.L_text_b"
-#endif
-#ifndef TEXT_END_LABEL
-#define TEXT_END_LABEL "*.L_text_e"
-#endif
-
-#ifndef DATA_BEGIN_LABEL
-#define DATA_BEGIN_LABEL "*.L_data_b"
-#endif
-#ifndef DATA_END_LABEL
-#define DATA_END_LABEL "*.L_data_e"
-#endif
-
-#ifndef DATA1_BEGIN_LABEL
-#define DATA1_BEGIN_LABEL "*.L_data1_b"
-#endif
-#ifndef DATA1_END_LABEL
-#define DATA1_END_LABEL "*.L_data1_e"
-#endif
-
-#ifndef RODATA_BEGIN_LABEL
-#define RODATA_BEGIN_LABEL "*.L_rodata_b"
-#endif
-#ifndef RODATA_END_LABEL
-#define RODATA_END_LABEL "*.L_rodata_e"
-#endif
-
-#ifndef RODATA1_BEGIN_LABEL
-#define RODATA1_BEGIN_LABEL "*.L_rodata1_b"
-#endif
-#ifndef RODATA1_END_LABEL
-#define RODATA1_END_LABEL "*.L_rodata1_e"
-#endif
-
-#ifndef BSS_BEGIN_LABEL
-#define BSS_BEGIN_LABEL "*.L_bss_b"
-#endif
-#ifndef BSS_END_LABEL
-#define BSS_END_LABEL "*.L_bss_e"
-#endif
-
-#ifndef LINE_BEGIN_LABEL
-#define LINE_BEGIN_LABEL "*.L_line_b"
-#endif
-#ifndef LINE_LAST_ENTRY_LABEL
-#define LINE_LAST_ENTRY_LABEL "*.L_line_last"
-#endif
-#ifndef LINE_END_LABEL
-#define LINE_END_LABEL "*.L_line_e"
-#endif
-
-#ifndef DEBUG_BEGIN_LABEL
-#define DEBUG_BEGIN_LABEL "*.L_debug_b"
-#endif
-#ifndef SFNAMES_BEGIN_LABEL
-#define SFNAMES_BEGIN_LABEL "*.L_sfnames_b"
-#endif
-#ifndef SRCINFO_BEGIN_LABEL
-#define SRCINFO_BEGIN_LABEL "*.L_srcinfo_b"
-#endif
-#ifndef MACINFO_BEGIN_LABEL
-#define MACINFO_BEGIN_LABEL "*.L_macinfo_b"
-#endif
-
-#ifndef DEBUG_ARANGES_BEGIN_LABEL
-#define DEBUG_ARANGES_BEGIN_LABEL "*.L_debug_aranges_begin"
-#endif
-#ifndef DEBUG_ARANGES_END_LABEL
-#define DEBUG_ARANGES_END_LABEL "*.L_debug_aranges_end"
-#endif
-
-#ifndef DIE_BEGIN_LABEL_FMT
-#define DIE_BEGIN_LABEL_FMT "*.L_D%u"
-#endif
-#ifndef DIE_END_LABEL_FMT
-#define DIE_END_LABEL_FMT "*.L_D%u_e"
-#endif
-#ifndef PUB_DIE_LABEL_FMT
-#define PUB_DIE_LABEL_FMT "*.L_P%u"
-#endif
-#ifndef BLOCK_BEGIN_LABEL_FMT
-#define BLOCK_BEGIN_LABEL_FMT "*.L_B%u"
-#endif
-#ifndef BLOCK_END_LABEL_FMT
-#define BLOCK_END_LABEL_FMT "*.L_B%u_e"
-#endif
-#ifndef SS_BEGIN_LABEL_FMT
-#define SS_BEGIN_LABEL_FMT "*.L_s%u"
-#endif
-#ifndef SS_END_LABEL_FMT
-#define SS_END_LABEL_FMT "*.L_s%u_e"
-#endif
-#ifndef EE_BEGIN_LABEL_FMT
-#define EE_BEGIN_LABEL_FMT "*.L_e%u"
-#endif
-#ifndef EE_END_LABEL_FMT
-#define EE_END_LABEL_FMT "*.L_e%u_e"
-#endif
-#ifndef MT_BEGIN_LABEL_FMT
-#define MT_BEGIN_LABEL_FMT "*.L_t%u"
-#endif
-#ifndef MT_END_LABEL_FMT
-#define MT_END_LABEL_FMT "*.L_t%u_e"
-#endif
-#ifndef LOC_BEGIN_LABEL_FMT
-#define LOC_BEGIN_LABEL_FMT "*.L_l%u"
-#endif
-#ifndef LOC_END_LABEL_FMT
-#define LOC_END_LABEL_FMT "*.L_l%u_e"
-#endif
-#ifndef BOUND_BEGIN_LABEL_FMT
-#define BOUND_BEGIN_LABEL_FMT "*.L_b%u_%u_%c"
-#endif
-#ifndef BOUND_END_LABEL_FMT
-#define BOUND_END_LABEL_FMT "*.L_b%u_%u_%c_e"
-#endif
-#ifndef BODY_BEGIN_LABEL_FMT
-#define BODY_BEGIN_LABEL_FMT "*.L_b%u"
-#endif
-#ifndef BODY_END_LABEL_FMT
-#define BODY_END_LABEL_FMT "*.L_b%u_e"
-#endif
-#ifndef FUNC_END_LABEL_FMT
-#define FUNC_END_LABEL_FMT "*.L_f%u_e"
-#endif
-#ifndef TYPE_NAME_FMT
-#define TYPE_NAME_FMT "*.L_T%u"
-#endif
-#ifndef DECL_NAME_FMT
-#define DECL_NAME_FMT "*.L_E%u"
-#endif
-#ifndef LINE_CODE_LABEL_FMT
-#define LINE_CODE_LABEL_FMT "*.L_LC%u"
-#endif
-#ifndef SFNAMES_ENTRY_LABEL_FMT
-#define SFNAMES_ENTRY_LABEL_FMT "*.L_F%u"
-#endif
-#ifndef LINE_ENTRY_LABEL_FMT
-#define LINE_ENTRY_LABEL_FMT "*.L_LE%u"
-#endif
-
-/* Definitions of defaults for various types of primitive assembly language
- output operations.
-
- If necessary, these may be overridden from within your tm.h file,
- but typically, you shouldn't need to override these. */
-
-#ifndef ASM_OUTPUT_PUSH_SECTION
-#define ASM_OUTPUT_PUSH_SECTION(FILE, SECTION) \
- fprintf ((FILE), PUSHSECTION_FORMAT, PUSHSECTION_ASM_OP, SECTION)
-#endif
-
-#ifndef ASM_OUTPUT_POP_SECTION
-#define ASM_OUTPUT_POP_SECTION(FILE) \
- fprintf ((FILE), "%s\n", POPSECTION_ASM_OP)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA2
-#define ASM_OUTPUT_DWARF_DELTA2(FILE,LABEL1,LABEL2) \
- dw2_asm_output_delta (2, LABEL1, LABEL2, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DELTA4
-#define ASM_OUTPUT_DWARF_DELTA4(FILE,LABEL1,LABEL2) \
- dw2_asm_output_delta (4, LABEL1, LABEL2, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_TAG
-#define ASM_OUTPUT_DWARF_TAG(FILE,TAG) \
- dw2_asm_output_data (2, TAG, "%s", dwarf_tag_name (TAG));
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ATTRIBUTE
-#define ASM_OUTPUT_DWARF_ATTRIBUTE(FILE,ATTR) \
- dw2_asm_output_data (2, ATTR, "%s", dwarf_attr_name (ATTR))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_STACK_OP
-#define ASM_OUTPUT_DWARF_STACK_OP(FILE,OP) \
- dw2_asm_output_data (1, OP, "%s", dwarf_stack_op_name (OP))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_FUND_TYPE
-#define ASM_OUTPUT_DWARF_FUND_TYPE(FILE,FT) \
- dw2_asm_output_data (2, FT, "%s", dwarf_fund_type_name (FT))
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_FMT_BYTE
-#define ASM_OUTPUT_DWARF_FMT_BYTE(FILE,FMT) \
- dw2_asm_output_data (1, FMT, "%s", dwarf_fmt_byte_name (FMT));
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_TYPE_MODIFIER
-#define ASM_OUTPUT_DWARF_TYPE_MODIFIER(FILE,MOD) \
- dw2_asm_output_data (1, MOD, "%s", dwarf_typemod_name (MOD));
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR
-#define ASM_OUTPUT_DWARF_ADDR(FILE,LABEL) \
- dw2_asm_output_addr (4, LABEL, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_ADDR_CONST
-#define ASM_OUTPUT_DWARF_ADDR_CONST(FILE,RTX) \
- dw2_asm_output_addr_rtx (4, RTX, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_REF
-#define ASM_OUTPUT_DWARF_REF(FILE,LABEL) \
- dw2_asm_output_addr (4, LABEL, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA1
-#define ASM_OUTPUT_DWARF_DATA1(FILE,VALUE) \
- dw2_asm_output_data (1, VALUE, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA2
-#define ASM_OUTPUT_DWARF_DATA2(FILE,VALUE) \
- dw2_asm_output_data (2, VALUE, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA4
-#define ASM_OUTPUT_DWARF_DATA4(FILE,VALUE) \
- dw2_asm_output_data (4, VALUE, NULL)
-#endif
-
-#ifndef ASM_OUTPUT_DWARF_DATA8
-#define ASM_OUTPUT_DWARF_DATA8(FILE,HIGH_VALUE,LOW_VALUE) \
- dw2_asm_output_data (8, VALUE, NULL)
-#endif
-
-/* ASM_OUTPUT_DWARF_STRING is defined to output an ascii string, but to
- NOT issue a trailing newline. We define ASM_OUTPUT_DWARF_STRING_NEWLINE
- based on whether ASM_OUTPUT_DWARF_STRING is defined or not. If it is
- defined, we call it, then issue the line feed. If not, we supply a
- default definition of calling ASM_OUTPUT_ASCII */
-
-#ifndef ASM_OUTPUT_DWARF_STRING
-#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
- ASM_OUTPUT_ASCII ((FILE), P, strlen (P)+1)
-#else
-#define ASM_OUTPUT_DWARF_STRING_NEWLINE(FILE,P) \
- ASM_OUTPUT_DWARF_STRING (FILE,P), ASM_OUTPUT_DWARF_STRING (FILE,"\n")
-#endif
-
-
-/* The debug hooks structure. */
-const struct gcc_debug_hooks dwarf_debug_hooks =
-{
- dwarfout_init,
- dwarfout_finish,
- dwarfout_define,
- dwarfout_undef,
- dwarfout_start_source_file_check,
- dwarfout_end_source_file_check,
- dwarfout_begin_block,
- dwarfout_end_block,
- debug_true_tree, /* ignore_block */
- dwarfout_source_line, /* source_line */
- dwarfout_source_line, /* begin_prologue */
- dwarfout_end_prologue,
- dwarfout_end_epilogue,
- debug_nothing_tree, /* begin_function */
- dwarfout_end_function,
- dwarfout_function_decl,
- dwarfout_global_decl,
- dwarfout_deferred_inline_function,
- debug_nothing_tree, /* outlining_inline_function */
- debug_nothing_rtx, /* label */
- debug_nothing_int /* handle_pch */
-};
-
-/************************ general utility functions **************************/
-
-static inline int
-is_pseudo_reg (rtx rtl)
-{
- return (((GET_CODE (rtl) == REG) && (REGNO (rtl) >= FIRST_PSEUDO_REGISTER))
- || ((GET_CODE (rtl) == SUBREG)
- && (REGNO (SUBREG_REG (rtl)) >= FIRST_PSEUDO_REGISTER)));
-}
-
-static inline tree
-type_main_variant (tree type)
-{
- type = TYPE_MAIN_VARIANT (type);
-
- /* There really should be only one main variant among any group of variants
- of a given type (and all of the MAIN_VARIANT values for all members of
- the group should point to that one type) but sometimes the C front-end
- messes this up for array types, so we work around that bug here. */
-
- if (TREE_CODE (type) == ARRAY_TYPE)
- {
- while (type != TYPE_MAIN_VARIANT (type))
- type = TYPE_MAIN_VARIANT (type);
- }
-
- return type;
-}
-
-/* Return nonzero if the given type node represents a tagged type. */
-
-static inline int
-is_tagged_type (tree type)
-{
- enum tree_code code = TREE_CODE (type);
-
- return (code == RECORD_TYPE || code == UNION_TYPE
- || code == QUAL_UNION_TYPE || code == ENUMERAL_TYPE);
-}
-
-static const char *
-dwarf_tag_name (unsigned int tag)
-{
- switch (tag)
- {
- case TAG_padding: return "TAG_padding";
- case TAG_array_type: return "TAG_array_type";
- case TAG_class_type: return "TAG_class_type";
- case TAG_entry_point: return "TAG_entry_point";
- case TAG_enumeration_type: return "TAG_enumeration_type";
- case TAG_formal_parameter: return "TAG_formal_parameter";
- case TAG_global_subroutine: return "TAG_global_subroutine";
- case TAG_global_variable: return "TAG_global_variable";
- case TAG_label: return "TAG_label";
- case TAG_lexical_block: return "TAG_lexical_block";
- case TAG_local_variable: return "TAG_local_variable";
- case TAG_member: return "TAG_member";
- case TAG_pointer_type: return "TAG_pointer_type";
- case TAG_reference_type: return "TAG_reference_type";
- case TAG_compile_unit: return "TAG_compile_unit";
- case TAG_string_type: return "TAG_string_type";
- case TAG_structure_type: return "TAG_structure_type";
- case TAG_subroutine: return "TAG_subroutine";
- case TAG_subroutine_type: return "TAG_subroutine_type";
- case TAG_typedef: return "TAG_typedef";
- case TAG_union_type: return "TAG_union_type";
- case TAG_unspecified_parameters: return "TAG_unspecified_parameters";
- case TAG_variant: return "TAG_variant";
- case TAG_common_block: return "TAG_common_block";
- case TAG_common_inclusion: return "TAG_common_inclusion";
- case TAG_inheritance: return "TAG_inheritance";
- case TAG_inlined_subroutine: return "TAG_inlined_subroutine";
- case TAG_module: return "TAG_module";
- case TAG_ptr_to_member_type: return "TAG_ptr_to_member_type";
- case TAG_set_type: return "TAG_set_type";
- case TAG_subrange_type: return "TAG_subrange_type";
- case TAG_with_stmt: return "TAG_with_stmt";
-
- /* GNU extensions. */
-
- case TAG_format_label: return "TAG_format_label";
- case TAG_namelist: return "TAG_namelist";
- case TAG_function_template: return "TAG_function_template";
- case TAG_class_template: return "TAG_class_template";
-
- default: return "TAG_<unknown>";
- }
-}
-
-static const char *
-dwarf_attr_name (unsigned int attr)
-{
- switch (attr)
- {
- case AT_sibling: return "AT_sibling";
- case AT_location: return "AT_location";
- case AT_name: return "AT_name";
- case AT_fund_type: return "AT_fund_type";
- case AT_mod_fund_type: return "AT_mod_fund_type";
- case AT_user_def_type: return "AT_user_def_type";
- case AT_mod_u_d_type: return "AT_mod_u_d_type";
- case AT_ordering: return "AT_ordering";
- case AT_subscr_data: return "AT_subscr_data";
- case AT_byte_size: return "AT_byte_size";
- case AT_bit_offset: return "AT_bit_offset";
- case AT_bit_size: return "AT_bit_size";
- case AT_element_list: return "AT_element_list";
- case AT_stmt_list: return "AT_stmt_list";
- case AT_low_pc: return "AT_low_pc";
- case AT_high_pc: return "AT_high_pc";
- case AT_language: return "AT_language";
- case AT_member: return "AT_member";
- case AT_discr: return "AT_discr";
- case AT_discr_value: return "AT_discr_value";
- case AT_string_length: return "AT_string_length";
- case AT_common_reference: return "AT_common_reference";
- case AT_comp_dir: return "AT_comp_dir";
- case AT_const_value_string: return "AT_const_value_string";
- case AT_const_value_data2: return "AT_const_value_data2";
- case AT_const_value_data4: return "AT_const_value_data4";
- case AT_const_value_data8: return "AT_const_value_data8";
- case AT_const_value_block2: return "AT_const_value_block2";
- case AT_const_value_block4: return "AT_const_value_block4";
- case AT_containing_type: return "AT_containing_type";
- case AT_default_value_addr: return "AT_default_value_addr";
- case AT_default_value_data2: return "AT_default_value_data2";
- case AT_default_value_data4: return "AT_default_value_data4";
- case AT_default_value_data8: return "AT_default_value_data8";
- case AT_default_value_string: return "AT_default_value_string";
- case AT_friends: return "AT_friends";
- case AT_inline: return "AT_inline";
- case AT_is_optional: return "AT_is_optional";
- case AT_lower_bound_ref: return "AT_lower_bound_ref";
- case AT_lower_bound_data2: return "AT_lower_bound_data2";
- case AT_lower_bound_data4: return "AT_lower_bound_data4";
- case AT_lower_bound_data8: return "AT_lower_bound_data8";
- case AT_private: return "AT_private";
- case AT_producer: return "AT_producer";
- case AT_program: return "AT_program";
- case AT_protected: return "AT_protected";
- case AT_prototyped: return "AT_prototyped";
- case AT_public: return "AT_public";
- case AT_pure_virtual: return "AT_pure_virtual";
- case AT_return_addr: return "AT_return_addr";
- case AT_abstract_origin: return "AT_abstract_origin";
- case AT_start_scope: return "AT_start_scope";
- case AT_stride_size: return "AT_stride_size";
- case AT_upper_bound_ref: return "AT_upper_bound_ref";
- case AT_upper_bound_data2: return "AT_upper_bound_data2";
- case AT_upper_bound_data4: return "AT_upper_bound_data4";
- case AT_upper_bound_data8: return "AT_upper_bound_data8";
- case AT_virtual: return "AT_virtual";
-
- /* GNU extensions */
-
- case AT_sf_names: return "AT_sf_names";
- case AT_src_info: return "AT_src_info";
- case AT_mac_info: return "AT_mac_info";
- case AT_src_coords: return "AT_src_coords";
- case AT_body_begin: return "AT_body_begin";
- case AT_body_end: return "AT_body_end";
-
- default: return "AT_<unknown>";
- }
-}
-
-static const char *
-dwarf_stack_op_name (unsigned int op)
-{
- switch (op)
- {
- case OP_REG: return "OP_REG";
- case OP_BASEREG: return "OP_BASEREG";
- case OP_ADDR: return "OP_ADDR";
- case OP_CONST: return "OP_CONST";
- case OP_DEREF2: return "OP_DEREF2";
- case OP_DEREF4: return "OP_DEREF4";
- case OP_ADD: return "OP_ADD";
- default: return "OP_<unknown>";
- }
-}
-
-static const char *
-dwarf_typemod_name (unsigned int mod)
-{
- switch (mod)
- {
- case MOD_pointer_to: return "MOD_pointer_to";
- case MOD_reference_to: return "MOD_reference_to";
- case MOD_const: return "MOD_const";
- case MOD_volatile: return "MOD_volatile";
- default: return "MOD_<unknown>";
- }
-}
-
-static const char *
-dwarf_fmt_byte_name (unsigned int fmt)
-{
- switch (fmt)
- {
- case FMT_FT_C_C: return "FMT_FT_C_C";
- case FMT_FT_C_X: return "FMT_FT_C_X";
- case FMT_FT_X_C: return "FMT_FT_X_C";
- case FMT_FT_X_X: return "FMT_FT_X_X";
- case FMT_UT_C_C: return "FMT_UT_C_C";
- case FMT_UT_C_X: return "FMT_UT_C_X";
- case FMT_UT_X_C: return "FMT_UT_X_C";
- case FMT_UT_X_X: return "FMT_UT_X_X";
- case FMT_ET: return "FMT_ET";
- default: return "FMT_<unknown>";
- }
-}
-
-static const char *
-dwarf_fund_type_name (unsigned int ft)
-{
- switch (ft)
- {
- case FT_char: return "FT_char";
- case FT_signed_char: return "FT_signed_char";
- case FT_unsigned_char: return "FT_unsigned_char";
- case FT_short: return "FT_short";
- case FT_signed_short: return "FT_signed_short";
- case FT_unsigned_short: return "FT_unsigned_short";
- case FT_integer: return "FT_integer";
- case FT_signed_integer: return "FT_signed_integer";
- case FT_unsigned_integer: return "FT_unsigned_integer";
- case FT_long: return "FT_long";
- case FT_signed_long: return "FT_signed_long";
- case FT_unsigned_long: return "FT_unsigned_long";
- case FT_pointer: return "FT_pointer";
- case FT_float: return "FT_float";
- case FT_dbl_prec_float: return "FT_dbl_prec_float";
- case FT_ext_prec_float: return "FT_ext_prec_float";
- case FT_complex: return "FT_complex";
- case FT_dbl_prec_complex: return "FT_dbl_prec_complex";
- case FT_void: return "FT_void";
- case FT_boolean: return "FT_boolean";
- case FT_ext_prec_complex: return "FT_ext_prec_complex";
- case FT_label: return "FT_label";
-
- /* GNU extensions. */
-
- case FT_long_long: return "FT_long_long";
- case FT_signed_long_long: return "FT_signed_long_long";
- case FT_unsigned_long_long: return "FT_unsigned_long_long";
-
- case FT_int8: return "FT_int8";
- case FT_signed_int8: return "FT_signed_int8";
- case FT_unsigned_int8: return "FT_unsigned_int8";
- case FT_int16: return "FT_int16";
- case FT_signed_int16: return "FT_signed_int16";
- case FT_unsigned_int16: return "FT_unsigned_int16";
- case FT_int32: return "FT_int32";
- case FT_signed_int32: return "FT_signed_int32";
- case FT_unsigned_int32: return "FT_unsigned_int32";
- case FT_int64: return "FT_int64";
- case FT_signed_int64: return "FT_signed_int64";
- case FT_unsigned_int64: return "FT_unsigned_int64";
- case FT_int128: return "FT_int128";
- case FT_signed_int128: return "FT_signed_int128";
- case FT_unsigned_int128: return "FT_unsigned_int128";
-
- case FT_real32: return "FT_real32";
- case FT_real64: return "FT_real64";
- case FT_real96: return "FT_real96";
- case FT_real128: return "FT_real128";
-
- default: return "FT_<unknown>";
- }
-}
-
-/* Determine the "ultimate origin" of a decl. The decl may be an
- inlined instance of an inlined instance of a decl which is local
- to an inline function, so we have to trace all of the way back
- through the origin chain to find out what sort of node actually
- served as the original seed for the given block. */
-
-static tree
-decl_ultimate_origin (tree decl)
-{
-#ifdef ENABLE_CHECKING
- if (DECL_FROM_INLINE (DECL_ORIGIN (decl)))
- /* Since the DECL_ABSTRACT_ORIGIN for a DECL is supposed to be the
- most distant ancestor, this should never happen. */
- abort ();
-#endif
-
- return DECL_ABSTRACT_ORIGIN (decl);
-}
-
-/* Determine the "ultimate origin" of a block. The block may be an
- inlined instance of an inlined instance of a block which is local
- to an inline function, so we have to trace all of the way back
- through the origin chain to find out what sort of node actually
- served as the original seed for the given block. */
-
-static tree
-block_ultimate_origin (tree block)
-{
- tree immediate_origin = BLOCK_ABSTRACT_ORIGIN (block);
-
- if (immediate_origin == NULL)
- return NULL;
- else
- {
- tree ret_val;
- tree lookahead = immediate_origin;
-
- do
- {
- ret_val = lookahead;
- lookahead = (TREE_CODE (ret_val) == BLOCK)
- ? BLOCK_ABSTRACT_ORIGIN (ret_val)
- : NULL;
- }
- while (lookahead != NULL && lookahead != ret_val);
- return ret_val;
- }
-}
-
-/* Get the class to which DECL belongs, if any. In g++, the DECL_CONTEXT
- of a virtual function may refer to a base class, so we check the 'this'
- parameter. */
-
-static tree
-decl_class_context (tree decl)
-{
- tree context = NULL_TREE;
- if (TREE_CODE (decl) != FUNCTION_DECL || ! DECL_VINDEX (decl))
- context = DECL_CONTEXT (decl);
- else
- context = TYPE_MAIN_VARIANT
- (TREE_TYPE (TREE_VALUE (TYPE_ARG_TYPES (TREE_TYPE (decl)))));
-
- if (context && !TYPE_P (context))
- context = NULL_TREE;
-
- return context;
-}
-
-#if 0
-static void
-output_unsigned_leb128 (unsigned long value)
-{
- unsigned long orig_value = value;
-
- do
- {
- unsigned byte = (value & 0x7f);
-
- value >>= 7;
- if (value != 0) /* more bytes to follow */
- byte |= 0x80;
- dw2_asm_output_data (1, byte, "\t%s ULEB128 number - value = %lu",
- orig_value);
- }
- while (value != 0);
-}
-
-static void
-output_signed_leb128 (long value)
-{
- long orig_value = value;
- int negative = (value < 0);
- int more;
-
- do
- {
- unsigned byte = (value & 0x7f);
-
- value >>= 7;
- if (negative)
- value |= 0xfe000000; /* manually sign extend */
- if (((value == 0) && ((byte & 0x40) == 0))
- || ((value == -1) && ((byte & 0x40) == 1)))
- more = 0;
- else
- {
- byte |= 0x80;
- more = 1;
- }
- dw2_asm_output_data (1, byte, "\t%s SLEB128 number - value = %ld",
- orig_value);
- }
- while (more);
-}
-#endif
-
-/**************** utility functions for attribute functions ******************/
-
-/* Given a pointer to a tree node for some type, return a Dwarf fundamental
- type code for the given type.
-
- This routine must only be called for GCC type nodes that correspond to
- Dwarf fundamental types.
-
- The current Dwarf draft specification calls for Dwarf fundamental types
- to accurately reflect the fact that a given type was either a "plain"
- integral type or an explicitly "signed" integral type. Unfortunately,
- we can't always do this, because GCC may already have thrown away the
- information about the precise way in which the type was originally
- specified, as in:
-
- typedef signed int my_type;
-
- struct s { my_type f; };
-
- Since we may be stuck here without enough information to do exactly
- what is called for in the Dwarf draft specification, we do the best
- that we can under the circumstances and always use the "plain" integral
- fundamental type codes for int, short, and long types. That's probably
- good enough. The additional accuracy called for in the current DWARF
- draft specification is probably never even useful in practice. */
-
-static int
-fundamental_type_code (tree type)
-{
- if (TREE_CODE (type) == ERROR_MARK)
- return 0;
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- return FT_void;
-
- case VOID_TYPE:
- return FT_void;
-
- case INTEGER_TYPE:
- /* Carefully distinguish all the standard types of C,
- without messing up if the language is not C.
- Note that we check only for the names that contain spaces;
- other names might occur by coincidence in other languages. */
- if (TYPE_NAME (type) != 0
- && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (type)) != 0
- && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
- {
- const char *const name =
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
-
- if (!strcmp (name, "unsigned char"))
- return FT_unsigned_char;
- if (!strcmp (name, "signed char"))
- return FT_signed_char;
- if (!strcmp (name, "unsigned int"))
- return FT_unsigned_integer;
- if (!strcmp (name, "short int"))
- return FT_short;
- if (!strcmp (name, "short unsigned int"))
- return FT_unsigned_short;
- if (!strcmp (name, "long int"))
- return FT_long;
- if (!strcmp (name, "long unsigned int"))
- return FT_unsigned_long;
- if (!strcmp (name, "long long int"))
- return FT_long_long; /* Not grok'ed by svr4 SDB */
- if (!strcmp (name, "long long unsigned int"))
- return FT_unsigned_long_long; /* Not grok'ed by svr4 SDB */
- }
-
- /* Most integer types will be sorted out above, however, for the
- sake of special `array index' integer types, the following code
- is also provided. */
-
- if (TYPE_PRECISION (type) == INT_TYPE_SIZE)
- return (TREE_UNSIGNED (type) ? FT_unsigned_integer : FT_integer);
-
- if (TYPE_PRECISION (type) == LONG_TYPE_SIZE)
- return (TREE_UNSIGNED (type) ? FT_unsigned_long : FT_long);
-
- if (TYPE_PRECISION (type) == LONG_LONG_TYPE_SIZE)
- return (TREE_UNSIGNED (type) ? FT_unsigned_long_long : FT_long_long);
-
- if (TYPE_PRECISION (type) == SHORT_TYPE_SIZE)
- return (TREE_UNSIGNED (type) ? FT_unsigned_short : FT_short);
-
- if (TYPE_PRECISION (type) == CHAR_TYPE_SIZE)
- return (TREE_UNSIGNED (type) ? FT_unsigned_char : FT_char);
-
- if (TYPE_MODE (type) == TImode)
- return (TREE_UNSIGNED (type) ? FT_unsigned_int128 : FT_int128);
-
- /* In C++, __java_boolean is an INTEGER_TYPE with precision == 1 */
- if (TYPE_PRECISION (type) == 1)
- return FT_boolean;
-
- abort ();
-
- case REAL_TYPE:
- /* Carefully distinguish all the standard types of C,
- without messing up if the language is not C. */
- if (TYPE_NAME (type) != 0
- && TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && DECL_NAME (TYPE_NAME (type)) != 0
- && TREE_CODE (DECL_NAME (TYPE_NAME (type))) == IDENTIFIER_NODE)
- {
- const char *const name =
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
-
- /* Note that here we can run afoul of a serious bug in "classic"
- svr4 SDB debuggers. They don't seem to understand the
- FT_ext_prec_float type (even though they should). */
-
- if (!strcmp (name, "long double"))
- return FT_ext_prec_float;
- }
-
- if (TYPE_PRECISION (type) == DOUBLE_TYPE_SIZE)
- {
- /* On the SH, when compiling with -m3e or -m4-single-only, both
- float and double are 32 bits. But since the debugger doesn't
- know about the subtarget, it always thinks double is 64 bits.
- So we have to tell the debugger that the type is float to
- make the output of the 'print' command etc. readable. */
- if (DOUBLE_TYPE_SIZE == FLOAT_TYPE_SIZE && FLOAT_TYPE_SIZE == 32)
- return FT_float;
- return FT_dbl_prec_float;
- }
- if (TYPE_PRECISION (type) == FLOAT_TYPE_SIZE)
- return FT_float;
-
- /* Note that here we can run afoul of a serious bug in "classic"
- svr4 SDB debuggers. They don't seem to understand the
- FT_ext_prec_float type (even though they should). */
-
- if (TYPE_PRECISION (type) == LONG_DOUBLE_TYPE_SIZE)
- return FT_ext_prec_float;
- abort ();
-
- case COMPLEX_TYPE:
- return FT_complex; /* GNU FORTRAN COMPLEX type. */
-
- case CHAR_TYPE:
- return FT_char; /* GNU Pascal CHAR type. Not used in C. */
-
- case BOOLEAN_TYPE:
- return FT_boolean; /* GNU FORTRAN BOOLEAN type. */
-
- default:
- abort (); /* No other TREE_CODEs are Dwarf fundamental types. */
- }
- return 0;
-}
-
-/* Given a pointer to an arbitrary ..._TYPE tree node, return a pointer to
- the Dwarf "root" type for the given input type. The Dwarf "root" type
- of a given type is generally the same as the given type, except that if
- the given type is a pointer or reference type, then the root type of
- the given type is the root type of the "basis" type for the pointer or
- reference type. (This definition of the "root" type is recursive.)
- Also, the root type of a `const' qualified type or a `volatile'
- qualified type is the root type of the given type without the
- qualifiers. */
-
-static tree
-root_type_1 (tree type, int count)
-{
- /* Give up after searching 1000 levels, in case this is a recursive
- pointer type. Such types are possible in Ada, but it is not possible
- to represent them in DWARF1 debug info. */
- if (count > 1000)
- return error_mark_node;
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- return error_mark_node;
-
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- return root_type_1 (TREE_TYPE (type), count+1);
-
- default:
- return type;
- }
-}
-
-static tree
-root_type (tree type)
-{
- type = root_type_1 (type, 0);
- if (type != error_mark_node)
- type = type_main_variant (type);
- return type;
-}
-
-/* Given a pointer to an arbitrary ..._TYPE tree node, write out a sequence
- of zero or more Dwarf "type-modifier" bytes applicable to the type. */
-
-static void
-write_modifier_bytes_1 (tree type, int decl_const, int decl_volatile, int count)
-{
- if (TREE_CODE (type) == ERROR_MARK)
- return;
-
- /* Give up after searching 1000 levels, in case this is a recursive
- pointer type. Such types are possible in Ada, but it is not possible
- to represent them in DWARF1 debug info. */
- if (count > 1000)
- return;
-
- if (TYPE_READONLY (type) || decl_const)
- ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_const);
- if (TYPE_VOLATILE (type) || decl_volatile)
- ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_volatile);
- switch (TREE_CODE (type))
- {
- case POINTER_TYPE:
- ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_pointer_to);
- write_modifier_bytes_1 (TREE_TYPE (type), 0, 0, count+1);
- return;
-
- case REFERENCE_TYPE:
- ASM_OUTPUT_DWARF_TYPE_MODIFIER (asm_out_file, MOD_reference_to);
- write_modifier_bytes_1 (TREE_TYPE (type), 0, 0, count+1);
- return;
-
- case ERROR_MARK:
- default:
- return;
- }
-}
-
-static void
-write_modifier_bytes (tree type, int decl_const, int decl_volatile)
-{
- write_modifier_bytes_1 (type, decl_const, decl_volatile, 0);
-}
-
-/* Given a pointer to an arbitrary ..._TYPE tree node, return nonzero if the
- given input type is a Dwarf "fundamental" type. Otherwise return zero. */
-
-static inline int
-type_is_fundamental (tree type)
-{
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- case VOID_TYPE:
- case INTEGER_TYPE:
- case REAL_TYPE:
- case COMPLEX_TYPE:
- case BOOLEAN_TYPE:
- case CHAR_TYPE:
- return 1;
-
- case SET_TYPE:
- case ARRAY_TYPE:
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- case ENUMERAL_TYPE:
- case FUNCTION_TYPE:
- case METHOD_TYPE:
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- case FILE_TYPE:
- case OFFSET_TYPE:
- case LANG_TYPE:
- case VECTOR_TYPE:
- return 0;
-
- default:
- abort ();
- }
- return 0;
-}
-
-/* Given a pointer to some ..._DECL tree node, generate an assembly language
- equate directive which will associate a symbolic name with the current DIE.
-
- The name used is an artificial label generated from the DECL_UID number
- associated with the given decl node. The name it gets equated to is the
- symbolic label that we (previously) output at the start of the DIE that
- we are currently generating.
-
- Calling this function while generating some "decl related" form of DIE
- makes it possible to later refer to the DIE which represents the given
- decl simply by re-generating the symbolic name from the ..._DECL node's
- UID number. */
-
-static void
-equate_decl_number_to_die_number (tree decl)
-{
- /* In the case where we are generating a DIE for some ..._DECL node
- which represents either some inline function declaration or some
- entity declared within an inline function declaration/definition,
- setup a symbolic name for the current DIE so that we have a name
- for this DIE that we can easily refer to later on within
- AT_abstract_origin attributes. */
-
- char decl_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char die_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (decl_label, DECL_NAME_FMT, DECL_UID (decl));
- sprintf (die_label, DIE_BEGIN_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DEF (asm_out_file, decl_label, die_label);
-}
-
-/* Given a pointer to some ..._TYPE tree node, generate an assembly language
- equate directive which will associate a symbolic name with the current DIE.
-
- The name used is an artificial label generated from the TYPE_UID number
- associated with the given type node. The name it gets equated to is the
- symbolic label that we (previously) output at the start of the DIE that
- we are currently generating.
-
- Calling this function while generating some "type related" form of DIE
- makes it easy to later refer to the DIE which represents the given type
- simply by re-generating the alternative name from the ..._TYPE node's
- UID number. */
-
-static inline void
-equate_type_number_to_die_number (tree type)
-{
- char type_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char die_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- /* We are generating a DIE to represent the main variant of this type
- (i.e the type without any const or volatile qualifiers) so in order
- to get the equate to come out right, we need to get the main variant
- itself here. */
-
- type = type_main_variant (type);
-
- sprintf (type_label, TYPE_NAME_FMT, TYPE_UID (type));
- sprintf (die_label, DIE_BEGIN_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DEF (asm_out_file, type_label, die_label);
-}
-
-static void
-output_reg_number (rtx rtl)
-{
- unsigned regno = REGNO (rtl);
-
- if (regno >= DWARF_FRAME_REGISTERS)
- {
- warning ("%Jinternal regno botch: '%D' has regno = %d\n",
- dwarf_last_decl, dwarf_last_decl, regno);
- regno = 0;
- }
- dw2_assemble_integer (4, GEN_INT (DBX_REGISTER_NUMBER (regno)));
- if (flag_debug_asm)
- {
- fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START);
- PRINT_REG (rtl, 0, asm_out_file);
- }
- fputc ('\n', asm_out_file);
-}
-
-/* The following routine is a nice and simple transducer. It converts the
- RTL for a variable or parameter (resident in memory) into an equivalent
- Dwarf representation of a mechanism for getting the address of that same
- variable onto the top of a hypothetical "address evaluation" stack.
-
- When creating memory location descriptors, we are effectively trans-
- forming the RTL for a memory-resident object into its Dwarf postfix
- expression equivalent. This routine just recursively descends an
- RTL tree, turning it into Dwarf postfix code as it goes. */
-
-static void
-output_mem_loc_descriptor (rtx rtl)
-{
- /* Note that for a dynamically sized array, the location we will
- generate a description of here will be the lowest numbered location
- which is actually within the array. That's *not* necessarily the
- same as the zeroth element of the array. */
-
- rtl = (*targetm.delegitimize_address) (rtl);
-
- switch (GET_CODE (rtl))
- {
- case SUBREG:
-
- /* The case of a subreg may arise when we have a local (register)
- variable or a formal (register) parameter which doesn't quite
- fill 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 = SUBREG_REG (rtl);
- /* Drop thru. */
-
- case REG:
-
- /* Whenever a register number forms a part of the description of
- the method for calculating the (dynamic) address of a memory
- resident object, DWARF rules require the register number to
- be referred to as a "base register". This distinction is not
- based in any way upon what category of register the hardware
- believes the given register belongs to. This is strictly
- DWARF terminology we're dealing with here.
-
- Note that in cases where the location of a memory-resident data
- object could be expressed as:
-
- OP_ADD (OP_BASEREG (basereg), OP_CONST (0))
-
- the actual DWARF location descriptor that we generate may just
- be OP_BASEREG (basereg). This may look deceptively like the
- object in question was allocated to a register (rather than
- in memory) so DWARF consumers need to be aware of the subtle
- distinction between OP_REG and OP_BASEREG. */
-
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_BASEREG);
- output_reg_number (rtl);
- break;
-
- case MEM:
- output_mem_loc_descriptor (XEXP (rtl, 0));
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_DEREF4);
- break;
-
- case CONST:
- case SYMBOL_REF:
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADDR);
- ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, rtl);
- break;
-
- case PLUS:
- output_mem_loc_descriptor (XEXP (rtl, 0));
- output_mem_loc_descriptor (XEXP (rtl, 1));
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADD);
- break;
-
- case CONST_INT:
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_CONST);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, INTVAL (rtl));
- break;
-
- case MULT:
- /* If a pseudo-reg is optimized away, it is possible for it to
- be replaced with a MEM containing a multiply. Use a GNU extension
- to describe it. */
- output_mem_loc_descriptor (XEXP (rtl, 0));
- output_mem_loc_descriptor (XEXP (rtl, 1));
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_MULT);
- break;
-
- default:
- abort ();
- }
-}
-
-/* Output a proper Dwarf location descriptor for a variable or parameter
- which is either allocated in a register or in a memory location. For
- a register, we just generate an OP_REG and the register number. For a
- memory location we provide a Dwarf postfix expression describing how to
- generate the (dynamic) address of the object onto the address stack. */
-
-static void
-output_loc_descriptor (rtx rtl)
-{
- switch (GET_CODE (rtl))
- {
- case SUBREG:
-
- /* The case of a subreg may arise when we have a local (register)
- variable or a formal (register) parameter which doesn't quite
- fill 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 = SUBREG_REG (rtl);
- /* Drop thru. */
-
- case REG:
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_REG);
- output_reg_number (rtl);
- break;
-
- case MEM:
- output_mem_loc_descriptor (XEXP (rtl, 0));
- break;
-
- default:
- abort (); /* Should never happen */
- }
-}
-
-/* Given a tree node describing an array bound (either lower or upper)
- output a representation for that bound. DIM_NUM is used for
- multi-dimensional arrays and U_OR_L designates upper or lower
- bound. */
-
-static void
-output_bound_representation (tree bound, unsigned int dim_num, char u_or_l)
-{
- switch (TREE_CODE (bound))
- {
-
- case ERROR_MARK:
- return;
-
- /* All fixed-bounds are represented by INTEGER_CST nodes. */
-
- case INTEGER_CST:
- if (host_integerp (bound, 0))
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, tree_low_cst (bound, 0));
- break;
-
- default:
-
- /* Dynamic bounds may be represented by NOP_EXPR nodes containing
- SAVE_EXPR nodes, in which case we can do something, or as
- an expression, which we cannot represent. */
- {
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (begin_label, BOUND_BEGIN_LABEL_FMT,
- current_dienum, dim_num, u_or_l);
-
- sprintf (end_label, BOUND_END_LABEL_FMT,
- current_dienum, dim_num, u_or_l);
-
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* If optimization is turned on, the SAVE_EXPRs that describe
- how to access the upper bound values are essentially bogus.
- They only describe (at best) how to get at these values at
- the points in the generated code right after they have just
- been computed. Worse yet, in the typical case, the upper
- bound values will not even *be* computed in the optimized
- code, so these SAVE_EXPRs are entirely bogus.
-
- In order to compensate for this fact, we check here to see
- if optimization is enabled, and if so, we effectively create
- an empty location description for the (unknown and unknowable)
- upper bound.
-
- This should not cause too much trouble for existing (stupid?)
- debuggers because they have to deal with empty upper bounds
- location descriptions anyway in order to be able to deal with
- incomplete array types.
-
- Of course an intelligent debugger (GDB?) should be able to
- comprehend that a missing upper bound specification in a
- array type used for a storage class `auto' local array variable
- indicates that the upper bound is both unknown (at compile-
- time) and unknowable (at run-time) due to optimization. */
-
- if (! optimize)
- {
- while (TREE_CODE (bound) == NOP_EXPR
- || TREE_CODE (bound) == CONVERT_EXPR)
- bound = TREE_OPERAND (bound, 0);
-
- if (TREE_CODE (bound) == SAVE_EXPR
- && SAVE_EXPR_RTL (bound))
- output_loc_descriptor
- (eliminate_regs (SAVE_EXPR_RTL (bound), 0, NULL_RTX));
- }
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
- }
- break;
-
- }
-}
-
-/* Recursive function to output a sequence of value/name pairs for
- enumeration constants in reversed order. This is called from
- enumeration_type_die. */
-
-static void
-output_enumeral_list (tree link)
-{
- if (link)
- {
- output_enumeral_list (TREE_CHAIN (link));
-
- if (host_integerp (TREE_VALUE (link), 0))
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- tree_low_cst (TREE_VALUE (link), 0));
-
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
- IDENTIFIER_POINTER (TREE_PURPOSE (link)));
- }
-}
-
-/* Given an unsigned value, round it up to the lowest multiple of `boundary'
- which is not less than the value itself. */
-
-static inline HOST_WIDE_INT
-ceiling (HOST_WIDE_INT value, unsigned int boundary)
-{
- return (((value + boundary - 1) / boundary) * boundary);
-}
-
-/* Given a pointer to what is assumed to be a FIELD_DECL node, return a
- pointer to the declared type for the relevant field variable, or return
- `integer_type_node' if the given node turns out to be an ERROR_MARK node. */
-
-static inline tree
-field_type (tree decl)
-{
- tree type;
-
- if (TREE_CODE (decl) == ERROR_MARK)
- return integer_type_node;
-
- type = DECL_BIT_FIELD_TYPE (decl);
- if (type == NULL)
- type = TREE_TYPE (decl);
- return type;
-}
-
-/* Given a pointer to a tree node, assumed to be some kind of a ..._TYPE
- node, return the alignment in bits for the type, or else return
- BITS_PER_WORD if the node actually turns out to be an ERROR_MARK node. */
-
-static inline unsigned int
-simple_type_align_in_bits (tree type)
-{
- return (TREE_CODE (type) != ERROR_MARK) ? TYPE_ALIGN (type) : BITS_PER_WORD;
-}
-
-/* Given a pointer to a tree node, assumed to be some kind of a ..._TYPE
- node, return the size in bits for the type if it is a constant, or
- else return the alignment for the type if the type's size is not
- constant, or else return BITS_PER_WORD if the type actually turns out
- to be an ERROR_MARK node. */
-
-static inline unsigned HOST_WIDE_INT
-simple_type_size_in_bits (tree type)
-{
- tree type_size_tree;
-
- if (TREE_CODE (type) == ERROR_MARK)
- return BITS_PER_WORD;
- type_size_tree = TYPE_SIZE (type);
-
- if (type_size_tree == NULL_TREE)
- return 0;
- if (! host_integerp (type_size_tree, 1))
- return TYPE_ALIGN (type);
- return tree_low_cst (type_size_tree, 1);
-}
-
-/* Given a pointer to what is assumed to be a FIELD_DECL node, compute and
- return the byte offset of the lowest addressed byte of the "containing
- object" for the given FIELD_DECL, or return 0 if we are unable to deter-
- mine what that offset is, either because the argument turns out to be a
- pointer to an ERROR_MARK node, or because the offset is actually variable.
- (We can't handle the latter case just yet.) */
-
-static HOST_WIDE_INT
-field_byte_offset (tree decl)
-{
- unsigned int type_align_in_bytes;
- unsigned int type_align_in_bits;
- unsigned HOST_WIDE_INT type_size_in_bits;
- HOST_WIDE_INT object_offset_in_align_units;
- HOST_WIDE_INT object_offset_in_bits;
- HOST_WIDE_INT object_offset_in_bytes;
- tree type;
- tree field_size_tree;
- HOST_WIDE_INT bitpos_int;
- HOST_WIDE_INT deepest_bitpos;
- unsigned HOST_WIDE_INT field_size_in_bits;
-
- if (TREE_CODE (decl) == ERROR_MARK)
- return 0;
-
- if (TREE_CODE (decl) != FIELD_DECL)
- abort ();
-
- type = field_type (decl);
- field_size_tree = DECL_SIZE (decl);
-
- /* The size could be unspecified if there was an error, or for
- a flexible array member. */
- if (! field_size_tree)
- field_size_tree = bitsize_zero_node;
-
- /* We cannot yet cope with fields whose positions or sizes are variable,
- so for now, when we see such things, we simply return 0. Someday,
- we may be able to handle such cases, but it will be damn difficult. */
-
- if (! host_integerp (bit_position (decl), 0)
- || ! host_integerp (field_size_tree, 1))
- return 0;
-
- bitpos_int = int_bit_position (decl);
- field_size_in_bits = tree_low_cst (field_size_tree, 1);
-
- type_size_in_bits = simple_type_size_in_bits (type);
- type_align_in_bits = simple_type_align_in_bits (type);
- type_align_in_bytes = type_align_in_bits / BITS_PER_UNIT;
-
- /* Note that the GCC front-end doesn't make any attempt to keep track
- of the starting bit offset (relative to the start of the containing
- structure type) of the hypothetical "containing object" for a bit-
- field. Thus, when computing the byte offset value for the start of
- the "containing object" of a bit-field, we must deduce this infor-
- mation on our own.
-
- This can be rather tricky to do in some cases. For example, handling
- the following structure type definition when compiling for an i386/i486
- target (which only aligns long long's to 32-bit boundaries) can be very
- tricky:
-
- struct S {
- int field1;
- long long field2:31;
- };
-
- Fortunately, there is a simple rule-of-thumb which can be used in such
- cases. When compiling for an i386/i486, GCC will allocate 8 bytes for
- the structure shown above. It decides to do this based upon one simple
- rule for bit-field allocation. Quite simply, GCC allocates each "con-
- taining object" for each bit-field at the first (i.e. lowest addressed)
- legitimate alignment boundary (based upon the required minimum alignment
- for the declared type of the field) which it can possibly use, subject
- to the condition that there is still enough available space remaining
- in the containing object (when allocated at the selected point) to
- fully accommodate all of the bits of the bit-field itself.
-
- This simple rule makes it obvious why GCC allocates 8 bytes for each
- object of the structure type shown above. When looking for a place to
- allocate the "containing object" for `field2', the compiler simply tries
- to allocate a 64-bit "containing object" at each successive 32-bit
- boundary (starting at zero) until it finds a place to allocate that 64-
- bit field such that at least 31 contiguous (and previously unallocated)
- bits remain within that selected 64 bit field. (As it turns out, for
- the example above, the compiler finds that it is OK to allocate the
- "containing object" 64-bit field at bit-offset zero within the
- structure type.)
-
- Here we attempt to work backwards from the limited set of facts we're
- given, and we try to deduce from those facts, where GCC must have
- believed that the containing object started (within the structure type).
-
- The value we deduce is then used (by the callers of this routine) to
- generate AT_location and AT_bit_offset attributes for fields (both
- bit-fields and, in the case of AT_location, regular fields as well). */
-
- /* Figure out the bit-distance from the start of the structure to the
- "deepest" bit of the bit-field. */
- deepest_bitpos = bitpos_int + field_size_in_bits;
-
- /* This is the tricky part. Use some fancy footwork to deduce where the
- lowest addressed bit of the containing object must be. */
- object_offset_in_bits
- = ceiling (deepest_bitpos, type_align_in_bits) - type_size_in_bits;
-
- /* Compute the offset of the containing object in "alignment units". */
- object_offset_in_align_units = object_offset_in_bits / type_align_in_bits;
-
- /* Compute the offset of the containing object in bytes. */
- object_offset_in_bytes = object_offset_in_align_units * type_align_in_bytes;
-
- /* The above code assumes that the field does not cross an alignment
- boundary. This can happen if PCC_BITFIELD_TYPE_MATTERS is not defined,
- or if the structure is packed. If this happens, then we get an object
- which starts after the bitfield, which means that the bit offset is
- negative. Gdb fails when given negative bit offsets. We avoid this
- by recomputing using the first bit of the bitfield. This will give
- us an object which does not completely contain the bitfield, but it
- will be aligned, and it will contain the first bit of the bitfield.
-
- However, only do this for a BYTES_BIG_ENDIAN target. For a
- ! BYTES_BIG_ENDIAN target, bitpos_int + field_size_in_bits is the first
- first bit of the bitfield. If we recompute using bitpos_int + 1 below,
- then we end up computing the object byte offset for the wrong word of the
- desired bitfield, which in turn causes the field offset to be negative
- in bit_offset_attribute. */
- if (BYTES_BIG_ENDIAN
- && object_offset_in_bits > bitpos_int)
- {
- deepest_bitpos = bitpos_int + 1;
- object_offset_in_bits
- = ceiling (deepest_bitpos, type_align_in_bits) - type_size_in_bits;
- object_offset_in_align_units = (object_offset_in_bits
- / type_align_in_bits);
- object_offset_in_bytes = (object_offset_in_align_units
- * type_align_in_bytes);
- }
-
- return object_offset_in_bytes;
-}
-
-/****************************** attributes *********************************/
-
-/* The following routines are responsible for writing out the various types
- of Dwarf attributes (and any following data bytes associated with them).
- These routines are listed in order based on the numerical codes of their
- associated attributes. */
-
-/* Generate an AT_sibling attribute. */
-
-static inline void
-sibling_attribute (void)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_sibling);
- sprintf (label, DIE_BEGIN_LABEL_FMT, NEXT_DIE_NUM);
- ASM_OUTPUT_DWARF_REF (asm_out_file, label);
-}
-
-/* Output the form of location attributes suitable for whole variables and
- whole parameters. Note that the location attributes for struct fields
- are generated by the routine `data_member_location_attribute' below. */
-
-static void
-location_attribute (rtx rtl)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_location);
- sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, LOC_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* Handle a special case. If we are about to output a location descriptor
- for a variable or parameter which has been optimized out of existence,
- don't do that. Instead we output a zero-length location descriptor
- value as part of the location attribute.
-
- A variable which has been optimized out of existence will have a
- DECL_RTL value which denotes a pseudo-reg.
-
- Currently, in some rare cases, variables can have DECL_RTL values
- which look like (MEM (REG pseudo-reg#)). These cases are due to
- bugs elsewhere in the compiler. We treat such cases
- as if the variable(s) in question had been optimized out of existence.
-
- Note that in all cases where we wish to express the fact that a
- variable has been optimized out of existence, we do not simply
- suppress the generation of the entire location attribute because
- the absence of a location attribute in certain kinds of DIEs is
- used to indicate something else entirely... i.e. that the DIE
- represents an object declaration, but not a definition. So saith
- the PLSIG.
- */
-
- if (! is_pseudo_reg (rtl)
- && (GET_CODE (rtl) != MEM || ! is_pseudo_reg (XEXP (rtl, 0))))
- output_loc_descriptor (rtl);
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-/* Output the specialized form of location attribute used for data members
- of struct and union types.
-
- In the special case of a FIELD_DECL node which represents a bit-field,
- the "offset" part of this special location descriptor must indicate the
- distance in bytes from the lowest-addressed byte of the containing
- struct or union type to the lowest-addressed byte of the "containing
- object" for the bit-field. (See the `field_byte_offset' function above.)
-
- For any given bit-field, the "containing object" is a hypothetical
- object (of some integral or enum type) within which the given bit-field
- lives. The type of this hypothetical "containing object" is always the
- same as the declared type of the individual bit-field itself (for GCC
- anyway... the DWARF spec doesn't actually mandate this).
-
- Note that it is the size (in bytes) of the hypothetical "containing
- object" which will be given in the AT_byte_size attribute for this
- bit-field. (See the `byte_size_attribute' function below.) It is
- also used when calculating the value of the AT_bit_offset attribute.
- (See the `bit_offset_attribute' function below.) */
-
-static void
-data_member_location_attribute (tree t)
-{
- unsigned object_offset_in_bytes;
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- if (TREE_CODE (t) == TREE_VEC)
- object_offset_in_bytes = tree_low_cst (BINFO_OFFSET (t), 0);
- else
- object_offset_in_bytes = field_byte_offset (t);
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_location);
- sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, LOC_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_CONST);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, object_offset_in_bytes);
- ASM_OUTPUT_DWARF_STACK_OP (asm_out_file, OP_ADD);
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-/* Output an AT_const_value attribute for a variable or a parameter which
- does not have a "location" either in memory or in a register. These
- things can arise in GNU C when a constant is passed as an actual
- parameter to an inlined function. They can also arise in C++ where
- declared constants do not necessarily get memory "homes". */
-
-static void
-const_value_attribute (rtx rtl)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_const_value_block4);
- sprintf (begin_label, LOC_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, LOC_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- 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. Since we no longer have
- precise mode information for these constants, we always just
- output them using 4 bytes. */
-
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, (unsigned) INTVAL (rtl));
- break;
-
- case CONST_DOUBLE:
- /* Note that a CONST_DOUBLE rtx could represent either an integer
- or a floating-point constant. A CONST_DOUBLE is used whenever
- the constant requires more than one word in order to be adequately
- represented. In all such cases, the original mode of the constant
- value is preserved as the mode of the CONST_DOUBLE rtx, but for
- simplicity we always just output CONST_DOUBLEs using 8 bytes. */
-
- ASM_OUTPUT_DWARF_DATA8 (asm_out_file,
- (unsigned int) CONST_DOUBLE_HIGH (rtl),
- (unsigned int) CONST_DOUBLE_LOW (rtl));
- break;
-
- case CONST_STRING:
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, XSTR (rtl, 0));
- break;
-
- case SYMBOL_REF:
- case LABEL_REF:
- case CONST:
- ASM_OUTPUT_DWARF_ADDR_CONST (asm_out_file, rtl);
- break;
-
- case PLUS:
- /* In cases where an inlined instance of an inline function is passed
- the address of an `auto' variable (which is local to the caller)
- we can get a situation where the DECL_RTL of the artificial
- local variable (for the inlining) which acts as a stand-in for
- the corresponding formal parameter (of the inline function)
- will look like (plus:SI (reg:SI FRAME_PTR) (const_int ...)).
- This is not exactly a compile-time constant expression, but it
- isn't the address of the (artificial) local variable either.
- Rather, it represents the *value* which the artificial local
- variable always has during its lifetime. We currently have no
- way to represent such quasi-constant values in Dwarf, so for now
- we just punt and generate an AT_const_value attribute with form
- FORM_BLOCK4 and a length of zero. */
- break;
-
- default:
- abort (); /* No other kinds of rtx should be possible here. */
- }
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-/* Generate *either* an AT_location attribute or else an AT_const_value
- data attribute for a variable or a parameter. We generate the
- AT_const_value attribute only in those cases where the given
- variable or parameter does not have a true "location" either in
- memory or in a register. This can happen (for example) when a
- constant is passed as an actual argument in a call to an inline
- function. (It's possible that these things can crop up in other
- ways also.) Note that one type of constant value which can be
- passed into an inlined function is a constant pointer. This can
- happen for example if an actual argument in an inlined function
- call evaluates to a compile-time constant address. */
-
-static void
-location_or_const_value_attribute (tree decl)
-{
- rtx rtl;
-
- if (TREE_CODE (decl) == ERROR_MARK)
- return;
-
- if ((TREE_CODE (decl) != VAR_DECL) && (TREE_CODE (decl) != PARM_DECL))
- {
- /* Should never happen. */
- abort ();
- return;
- }
-
- /* 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. DECL_RTL
- normally indicates where the parameter lives during most of the activa-
- tion of the function. If optimization is enabled however, this could
- be either NULL or else a pseudo-reg. Both of those cases indicate that
- the parameter doesn't really live anywhere (as far as the code generation
- parts of GCC are concerned) during most of the function's activation.
- That will happen (for example) if the parameter is never referenced
- within the function.
-
- We could just generate a location descriptor here for all non-NULL
- non-pseudo values of DECL_RTL and ignore all of the rest, but we can
- be a little nicer than that if we also consider DECL_INCOMING_RTL in
- cases where DECL_RTL is NULL or is a pseudo-reg.
-
- Note however that we can only get away with using DECL_INCOMING_RTL as
- a backup substitute for DECL_RTL in certain limited cases. In cases
- where DECL_ARG_TYPE(decl) indicates the same type as TREE_TYPE(decl)
- we can be sure that the parameter was passed using the same type as it
- is declared to have within the function, and that its DECL_INCOMING_RTL
- points us to a place where a value of that type is passed. In cases
- where DECL_ARG_TYPE(decl) and TREE_TYPE(decl) are different types
- however, we cannot (in general) use DECL_INCOMING_RTL as a backup
- substitute for DECL_RTL because in these cases, DECL_INCOMING_RTL
- points us to a value of some type which is *different* from the type
- of the parameter itself. Thus, if we tried to use DECL_INCOMING_RTL
- to generate a location attribute in such cases, the debugger would
- end up (for example) trying to fetch a `float' from a place which
- actually contains the first part of a `double'. That would lead to
- really incorrect and confusing output at debug-time, and we don't
- want that now do we?
-
- So in general, we DO NOT use DECL_INCOMING_RTL as a backup for DECL_RTL
- in cases where DECL_ARG_TYPE(decl) != TREE_TYPE(decl). There are a
- couple of cute exceptions however. On little-endian machines we can
- get away with using DECL_INCOMING_RTL even when DECL_ARG_TYPE(decl) is
- not the same as TREE_TYPE(decl) but only when DECL_ARG_TYPE(decl) is
- an integral type which is smaller than TREE_TYPE(decl). These cases
- arise when (on a little-endian machine) a non-prototyped function has
- a parameter declared to be of type `short' or `char'. In such cases,
- TREE_TYPE(decl) will be `short' or `char', DECL_ARG_TYPE(decl) will be
- `int', and DECL_INCOMING_RTL will point to the lowest-order byte of the
- passed `int' value. If the debugger then uses that address to fetch a
- `short' or a `char' (on a little-endian machine) the result will be the
- correct data, so we allow for such exceptional cases below.
-
- Note that our goal here is to describe the place where the given formal
- parameter lives during most of the function's activation (i.e. between
- the end of the prologue and the start of the epilogue). We'll do that
- as best as we can. Note however that if the given formal parameter is
- modified sometime during the execution of the function, then a stack
- backtrace (at debug-time) will show the function as having been called
- with the *new* value rather than the value which was originally passed
- in. This happens rarely enough that it is not a major problem, but it
- *is* a problem, and I'd like to fix it. A future version of dwarfout.c
- may generate two additional attributes for any given TAG_formal_parameter
- DIE which will describe the "passed type" and the "passed location" for
- the given formal parameter in addition to the attributes we now generate
- to indicate the "declared type" and the "active location" for each
- parameter. This additional set of attributes could be used by debuggers
- for stack backtraces.
-
- Separately, note that sometimes DECL_RTL can be NULL and DECL_INCOMING_RTL
- can be NULL also. This happens (for example) for inlined-instances of
- inline function formal parameters which are never referenced. This really
- shouldn't be happening. All PARM_DECL nodes should get valid non-NULL
- DECL_INCOMING_RTL values, but integrate.c doesn't currently generate
- these values for inlined instances of inline function parameters, so
- when we see such cases, we are just out-of-luck for the time
- being (until integrate.c gets fixed).
- */
-
- /* Use DECL_RTL as the "location" unless we find something better. */
- rtl = DECL_RTL (decl);
-
- if (TREE_CODE (decl) == PARM_DECL)
- if (rtl == NULL_RTX || is_pseudo_reg (rtl))
- {
- /* This decl represents a formal parameter which was optimized out. */
- tree declared_type = type_main_variant (TREE_TYPE (decl));
- tree passed_type = type_main_variant (DECL_ARG_TYPE (decl));
-
- /* Note that DECL_INCOMING_RTL may be NULL in here, but we handle
- *all* cases where (rtl == NULL_RTX) just below. */
-
- if (declared_type == passed_type)
- rtl = DECL_INCOMING_RTL (decl);
- else if (! BYTES_BIG_ENDIAN)
- if (TREE_CODE (declared_type) == INTEGER_TYPE)
- /* NMS WTF? */
- if (TYPE_SIZE (declared_type) <= TYPE_SIZE (passed_type))
- rtl = DECL_INCOMING_RTL (decl);
- }
-
- if (rtl == NULL_RTX)
- return;
-
- rtl = eliminate_regs (rtl, 0, NULL_RTX);
-#ifdef LEAF_REG_REMAP
- if (current_function_uses_only_leaf_regs)
- leaf_renumber_regs_insn (rtl);
-#endif
-
- switch (GET_CODE (rtl))
- {
- case ADDRESSOF:
- /* The address of a variable that was optimized away; don't emit
- anything. */
- break;
-
- case CONST_INT:
- case CONST_DOUBLE:
- case CONST_STRING:
- case SYMBOL_REF:
- case LABEL_REF:
- case CONST:
- case PLUS: /* DECL_RTL could be (plus (reg ...) (const_int ...)) */
- const_value_attribute (rtl);
- break;
-
- case MEM:
- case REG:
- case SUBREG:
- location_attribute (rtl);
- break;
-
- case CONCAT:
- /* ??? CONCAT is used for complex variables, which may have the real
- part stored in one place and the imag part stored somewhere else.
- DWARF1 has no way to describe a variable that lives in two different
- places, so we just describe where the first part lives, and hope that
- the second part is stored after it. */
- location_attribute (XEXP (rtl, 0));
- break;
-
- default:
- abort (); /* Should never happen. */
- }
-}
-
-/* Generate an AT_name attribute given some string value to be included as
- the value of the attribute. */
-
-static inline void
-name_attribute (const char *name_string)
-{
- if (name_string && *name_string)
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_name);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, name_string);
- }
-}
-
-static inline void
-fund_type_attribute (unsigned int ft_code)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_fund_type);
- ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, ft_code);
-}
-
-static void
-mod_fund_type_attribute (tree type, int decl_const, int decl_volatile)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mod_fund_type);
- sprintf (begin_label, MT_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, MT_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
- write_modifier_bytes (type, decl_const, decl_volatile);
- ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file,
- fundamental_type_code (root_type (type)));
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-static inline void
-user_def_type_attribute (tree type)
-{
- char ud_type_name[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_user_def_type);
- sprintf (ud_type_name, TYPE_NAME_FMT, TYPE_UID (type));
- ASM_OUTPUT_DWARF_REF (asm_out_file, ud_type_name);
-}
-
-static void
-mod_u_d_type_attribute (tree type, int decl_const, int decl_volatile)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char ud_type_name[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mod_u_d_type);
- sprintf (begin_label, MT_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, MT_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
- write_modifier_bytes (type, decl_const, decl_volatile);
- sprintf (ud_type_name, TYPE_NAME_FMT, TYPE_UID (root_type (type)));
- ASM_OUTPUT_DWARF_REF (asm_out_file, ud_type_name);
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-#ifdef USE_ORDERING_ATTRIBUTE
-static inline void
-ordering_attribute (unsigned ordering)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_ordering);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, ordering);
-}
-#endif /* defined(USE_ORDERING_ATTRIBUTE) */
-
-/* Note that the block of subscript information for an array type also
- includes information about the element type of type given array type. */
-
-static void
-subscript_data_attribute (tree type)
-{
- unsigned dimension_number;
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_subscr_data);
- sprintf (begin_label, SS_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, SS_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* The GNU compilers represent multidimensional array types as sequences
- of one dimensional array types whose element types are themselves array
- types. Here we squish that down, so that each multidimensional array
- type gets only one array_type DIE in the Dwarf debugging info. The
- draft Dwarf specification say that we are allowed to do this kind
- of compression in C (because there is no difference between an
- array or arrays and a multidimensional array in C) but for other
- source languages (e.g. Ada) we probably shouldn't do this. */
-
- for (dimension_number = 0;
- TREE_CODE (type) == ARRAY_TYPE;
- type = TREE_TYPE (type), dimension_number++)
- {
- tree domain = TYPE_DOMAIN (type);
-
- /* Arrays come in three flavors. Unspecified bounds, fixed
- bounds, and (in GNU C only) variable bounds. Handle all
- three forms here. */
-
- if (domain)
- {
- /* We have an array type with specified bounds. */
-
- tree lower = TYPE_MIN_VALUE (domain);
- tree upper = TYPE_MAX_VALUE (domain);
-
- /* Handle only fundamental types as index types for now. */
- if (! type_is_fundamental (domain))
- abort ();
-
- /* Output the representation format byte for this dimension. */
- ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file,
- FMT_CODE (1, TREE_CODE (lower) == INTEGER_CST,
- upper && TREE_CODE (upper) == INTEGER_CST));
-
- /* Output the index type for this dimension. */
- ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file,
- fundamental_type_code (domain));
-
- /* Output the representation for the lower bound. */
- output_bound_representation (lower, dimension_number, 'l');
-
- /* Output the representation for the upper bound. */
- if (upper)
- output_bound_representation (upper, dimension_number, 'u');
- else
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0);
- }
- else
- {
- /* We have an array type with an unspecified length. For C and
- C++ we can assume that this really means that (a) the index
- type is an integral type, and (b) the lower bound is zero.
- Note that Dwarf defines the representation of an unspecified
- (upper) bound as being a zero-length location description. */
-
- /* Output the array-bounds format byte. */
-
- ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, FMT_FT_C_X);
-
- /* Output the (assumed) index type. */
-
- ASM_OUTPUT_DWARF_FUND_TYPE (asm_out_file, FT_integer);
-
- /* Output the (assumed) lower bound (constant) value. */
-
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
-
- /* Output the (empty) location description for the upper bound. */
-
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0);
- }
- }
-
- /* Output the prefix byte that says that the element type is coming up. */
-
- ASM_OUTPUT_DWARF_FMT_BYTE (asm_out_file, FMT_ET);
-
- /* Output a representation of the type of the elements of this array type. */
-
- type_attribute (type, 0, 0);
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-static void
-byte_size_attribute (tree tree_node)
-{
- unsigned size;
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_byte_size);
- switch (TREE_CODE (tree_node))
- {
- case ERROR_MARK:
- size = 0;
- break;
-
- case ENUMERAL_TYPE:
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- case ARRAY_TYPE:
- size = int_size_in_bytes (tree_node);
- break;
-
- case FIELD_DECL:
- /* For a data member of a struct or union, the AT_byte_size is
- generally given as the number of bytes normally allocated for
- an object of the *declared* type of the member itself. This
- is true even for bit-fields. */
- size = simple_type_size_in_bits (field_type (tree_node))
- / BITS_PER_UNIT;
- break;
-
- default:
- abort ();
- }
-
- /* Note that `size' might be -1 when we get to this point. If it
- is, that indicates that the byte size of the entity in question
- is variable. We have no good way of expressing this fact in Dwarf
- at the present time, so just let the -1 pass on through. */
-
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, size);
-}
-
-/* For a FIELD_DECL node which represents a bit-field, output an attribute
- which specifies the distance in bits from the highest order bit of the
- "containing object" for the bit-field to the highest order bit of the
- bit-field itself.
-
- For any given bit-field, the "containing object" is a hypothetical
- object (of some integral or enum type) within which the given bit-field
- lives. The type of this hypothetical "containing object" is always the
- same as the declared type of the individual bit-field itself.
-
- The determination of the exact location of the "containing object" for
- a bit-field is rather complicated. It's handled by the `field_byte_offset'
- function (above).
-
- Note that it is the size (in bytes) of the hypothetical "containing
- object" which will be given in the AT_byte_size attribute for this
- bit-field. (See `byte_size_attribute' above.) */
-
-static inline void
-bit_offset_attribute (tree decl)
-{
- HOST_WIDE_INT object_offset_in_bytes = field_byte_offset (decl);
- tree type = DECL_BIT_FIELD_TYPE (decl);
- HOST_WIDE_INT bitpos_int;
- HOST_WIDE_INT highest_order_object_bit_offset;
- HOST_WIDE_INT highest_order_field_bit_offset;
- HOST_WIDE_INT bit_offset;
-
- /* Must be a bit field. */
- if (!type
- || TREE_CODE (decl) != FIELD_DECL)
- abort ();
-
- /* We can't yet handle bit-fields whose offsets or sizes are variable, so
- if we encounter such things, just return without generating any
- attribute whatsoever. */
-
- if (! host_integerp (bit_position (decl), 0)
- || ! host_integerp (DECL_SIZE (decl), 1))
- return;
-
- bitpos_int = int_bit_position (decl);
-
- /* Note that the bit offset is always the distance (in bits) from the
- highest-order bit of the "containing object" to the highest-order
- bit of the bit-field itself. Since the "high-order end" of any
- object or field is different on big-endian and little-endian machines,
- the computation below must take account of these differences. */
-
- highest_order_object_bit_offset = object_offset_in_bytes * BITS_PER_UNIT;
- highest_order_field_bit_offset = bitpos_int;
-
- if (! BYTES_BIG_ENDIAN)
- {
- highest_order_field_bit_offset += tree_low_cst (DECL_SIZE (decl), 1);
- highest_order_object_bit_offset += simple_type_size_in_bits (type);
- }
-
- bit_offset =
- (! BYTES_BIG_ENDIAN
- ? highest_order_object_bit_offset - highest_order_field_bit_offset
- : highest_order_field_bit_offset - highest_order_object_bit_offset);
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_bit_offset);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, bit_offset);
-}
-
-/* For a FIELD_DECL node which represents a bit field, output an attribute
- which specifies the length in bits of the given field. */
-
-static inline void
-bit_size_attribute (tree decl)
-{
- /* Must be a field and a bit field. */
- if (TREE_CODE (decl) != FIELD_DECL
- || ! DECL_BIT_FIELD_TYPE (decl))
- abort ();
-
- if (host_integerp (DECL_SIZE (decl), 1))
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_bit_size);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- tree_low_cst (DECL_SIZE (decl), 1));
- }
-}
-
-/* The following routine outputs the `element_list' attribute for enumeration
- type DIEs. The element_lits attribute includes the names and values of
- all of the enumeration constants associated with the given enumeration
- type. */
-
-static inline void
-element_list_attribute (tree element)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_element_list);
- sprintf (begin_label, EE_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, EE_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* Here we output a list of value/name pairs for each enumeration constant
- defined for this enumeration type (as required), but we do it in REVERSE
- order. The order is the one required by the draft #5 Dwarf specification
- published by the UI/PLSIG. */
-
- output_enumeral_list (element); /* Recursively output the whole list. */
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-/* Generate an AT_stmt_list attribute. These are normally present only in
- DIEs with a TAG_compile_unit tag. */
-
-static inline void
-stmt_list_attribute (const char *label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_stmt_list);
- /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, label);
-}
-
-/* Generate an AT_low_pc attribute for a label DIE, a lexical_block DIE or
- for a subroutine DIE. */
-
-static inline void
-low_pc_attribute (const char *asm_low_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_low_pc);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_low_label);
-}
-
-/* Generate an AT_high_pc attribute for a lexical_block DIE or for a
- subroutine DIE. */
-
-static inline void
-high_pc_attribute (const char *asm_high_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_high_pc);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_high_label);
-}
-
-/* Generate an AT_body_begin attribute for a subroutine DIE. */
-
-static inline void
-body_begin_attribute (const char *asm_begin_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_body_begin);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_begin_label);
-}
-
-/* Generate an AT_body_end attribute for a subroutine DIE. */
-
-static inline void
-body_end_attribute (const char *asm_end_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_body_end);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, asm_end_label);
-}
-
-/* Generate an AT_language attribute given a LANG value. These attributes
- are used only within TAG_compile_unit DIEs. */
-
-static inline void
-language_attribute (unsigned int language_code)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_language);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, language_code);
-}
-
-static inline void
-member_attribute (tree context)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- /* Generate this attribute only for members in C++. */
-
- if (context != NULL && is_tagged_type (context))
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_member);
- sprintf (label, TYPE_NAME_FMT, TYPE_UID (context));
- ASM_OUTPUT_DWARF_REF (asm_out_file, label);
- }
-}
-
-#if 0
-#ifndef SL_BEGIN_LABEL_FMT
-#define SL_BEGIN_LABEL_FMT "*.L_sl%u"
-#endif
-#ifndef SL_END_LABEL_FMT
-#define SL_END_LABEL_FMT "*.L_sl%u_e"
-#endif
-
-static inline void
-string_length_attribute (tree upper_bound)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_string_length);
- sprintf (begin_label, SL_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, SL_END_LABEL_FMT, current_dienum);
- ASM_OUTPUT_DWARF_DELTA2 (asm_out_file, end_label, begin_label);
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
- output_bound_representation (upper_bound, 0, 'u');
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-#endif
-
-static inline void
-comp_dir_attribute (const char *dirname)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_comp_dir);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);
-}
-
-static inline void
-sf_names_attribute (const char *sf_names_start_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_sf_names);
- /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, sf_names_start_label);
-}
-
-static inline void
-src_info_attribute (const char *src_info_start_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_src_info);
- /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, src_info_start_label);
-}
-
-static inline void
-mac_info_attribute (const char *mac_info_start_label)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_mac_info);
- /* Don't use ASM_OUTPUT_DWARF_DATA4 here. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, mac_info_start_label);
-}
-
-static inline void
-prototyped_attribute (tree func_type)
-{
- if ((strcmp (lang_hooks.name, "GNU C") == 0)
- && (TYPE_ARG_TYPES (func_type) != NULL))
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_prototyped);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
-}
-
-static inline void
-producer_attribute (const char *producer)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_producer);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, producer);
-}
-
-static inline void
-inline_attribute (tree decl)
-{
- if (DECL_INLINE (decl))
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_inline);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
-}
-
-static inline void
-containing_type_attribute (tree containing_type)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_containing_type);
- sprintf (label, TYPE_NAME_FMT, TYPE_UID (containing_type));
- ASM_OUTPUT_DWARF_REF (asm_out_file, label);
-}
-
-static inline void
-abstract_origin_attribute (tree origin)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_abstract_origin);
- switch (TREE_CODE_CLASS (TREE_CODE (origin)))
- {
- case 'd':
- sprintf (label, DECL_NAME_FMT, DECL_UID (origin));
- break;
-
- case 't':
- sprintf (label, TYPE_NAME_FMT, TYPE_UID (origin));
- break;
-
- default:
- abort (); /* Should never happen. */
-
- }
- ASM_OUTPUT_DWARF_REF (asm_out_file, label);
-}
-
-#ifdef DWARF_DECL_COORDINATES
-static inline void
-src_coords_attribute (unsigned src_fileno, unsigned src_lineno)
-{
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_src_coords);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, src_fileno);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, src_lineno);
-}
-#endif /* defined(DWARF_DECL_COORDINATES) */
-
-static inline void
-pure_or_virtual_attribute (tree func_decl)
-{
- if (DECL_VIRTUAL_P (func_decl))
- {
-#if 0 /* DECL_ABSTRACT_VIRTUAL_P is C++-specific. */
- if (DECL_ABSTRACT_VIRTUAL_P (func_decl))
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_pure_virtual);
- else
-#endif
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
-}
-
-/************************* end of attributes *****************************/
-
-/********************* utility routines for DIEs *************************/
-
-/* Output an AT_name attribute and an AT_src_coords attribute for the
- given decl, but only if it actually has a name. */
-
-static void
-name_and_src_coords_attributes (tree decl)
-{
- tree decl_name = DECL_NAME (decl);
-
- if (decl_name && IDENTIFIER_POINTER (decl_name))
- {
- name_attribute (IDENTIFIER_POINTER (decl_name));
-#ifdef DWARF_DECL_COORDINATES
- {
- register unsigned file_index;
-
- /* This is annoying, but we have to pop out of the .debug section
- for a moment while we call `lookup_filename' because calling it
- may cause a temporary switch into the .debug_sfnames section and
- most svr4 assemblers are not smart enough to be able to nest
- section switches to any depth greater than one. Note that we
- also can't skirt this issue by delaying all output to the
- .debug_sfnames section unit the end of compilation because that
- would cause us to have inter-section forward references and
- Fred Fish sez that m68k/svr4 assemblers botch those. */
-
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- file_index = lookup_filename (DECL_SOURCE_FILE (decl));
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
-
- src_coords_attribute (file_index, DECL_SOURCE_LINE (decl));
- }
-#endif /* defined(DWARF_DECL_COORDINATES) */
- }
-}
-
-/* Many forms of DIEs contain a "type description" part. The following
- routine writes out these "type descriptor" parts. */
-
-static void
-type_attribute (tree type, int decl_const, int decl_volatile)
-{
- enum tree_code code = TREE_CODE (type);
- int root_type_modified;
-
- if (code == ERROR_MARK)
- return;
-
- /* Handle a special case. For functions whose return type is void,
- we generate *no* type attribute. (Note that no object may have
- type `void', so this only applies to function return types. */
-
- if (code == VOID_TYPE)
- return;
-
- /* If this is a subtype, find the underlying type. Eventually,
- this should write out the appropriate subtype info. */
- while ((code == INTEGER_TYPE || code == REAL_TYPE)
- && TREE_TYPE (type) != 0)
- type = TREE_TYPE (type), code = TREE_CODE (type);
-
- root_type_modified = (code == POINTER_TYPE || code == REFERENCE_TYPE
- || decl_const || decl_volatile
- || TYPE_READONLY (type) || TYPE_VOLATILE (type));
-
- if (type_is_fundamental (root_type (type)))
- {
- if (root_type_modified)
- mod_fund_type_attribute (type, decl_const, decl_volatile);
- else
- fund_type_attribute (fundamental_type_code (type));
- }
- else
- {
- if (root_type_modified)
- mod_u_d_type_attribute (type, decl_const, decl_volatile);
- else
- /* We have to get the type_main_variant here (and pass that to the
- `user_def_type_attribute' routine) because the ..._TYPE node we
- have might simply be a *copy* of some original type node (where
- the copy was created to help us keep track of typedef names)
- and that copy might have a different TYPE_UID from the original
- ..._TYPE node. (Note that when `equate_type_number_to_die_number'
- is labeling a given type DIE for future reference, it always and
- only creates labels for DIEs representing *main variants*, and it
- never even knows about non-main-variants.) */
- user_def_type_attribute (type_main_variant (type));
- }
-}
-
-/* Given a tree pointer to a struct, class, union, or enum type node, return
- a pointer to the (string) tag name for the given type, or zero if the
- type was declared without a tag. */
-
-static const char *
-type_tag (tree type)
-{
- const char *name = 0;
-
- if (TYPE_NAME (type) != 0)
- {
- tree t = 0;
-
- /* Find the IDENTIFIER_NODE for the type name. */
- if (TREE_CODE (TYPE_NAME (type)) == IDENTIFIER_NODE)
- t = TYPE_NAME (type);
-
- /* The g++ front end makes the TYPE_NAME of *each* tagged type point to
- a TYPE_DECL node, regardless of whether or not a `typedef' was
- involved. */
- else if (TREE_CODE (TYPE_NAME (type)) == TYPE_DECL
- && ! DECL_IGNORED_P (TYPE_NAME (type)))
- t = DECL_NAME (TYPE_NAME (type));
-
- /* Now get the name as a string, or invent one. */
- if (t != 0)
- name = IDENTIFIER_POINTER (t);
- }
-
- return (name == 0 || *name == '\0') ? 0 : name;
-}
-
-static inline void
-dienum_push (void)
-{
- /* Start by checking if the pending_sibling_stack needs to be expanded.
- If necessary, expand it. */
-
- if (pending_siblings == pending_siblings_allocated)
- {
- pending_siblings_allocated += PENDING_SIBLINGS_INCREMENT;
- pending_sibling_stack
- = xrealloc (pending_sibling_stack,
- pending_siblings_allocated * sizeof(unsigned));
- }
-
- pending_siblings++;
- NEXT_DIE_NUM = next_unused_dienum++;
-}
-
-/* Pop the sibling stack so that the most recently pushed DIEnum becomes the
- NEXT_DIE_NUM. */
-
-static inline void
-dienum_pop (void)
-{
- pending_siblings--;
-}
-
-static inline tree
-member_declared_type (tree member)
-{
- return (DECL_BIT_FIELD_TYPE (member))
- ? DECL_BIT_FIELD_TYPE (member)
- : TREE_TYPE (member);
-}
-
-/* Get the function's label, as described by its RTL.
- This may be different from the DECL_NAME name used
- in the source file. */
-
-static const char *
-function_start_label (tree decl)
-{
- rtx x;
- const char *fnname;
-
- x = DECL_RTL (decl);
- if (GET_CODE (x) != MEM)
- abort ();
- x = XEXP (x, 0);
- if (GET_CODE (x) != SYMBOL_REF)
- abort ();
- fnname = XSTR (x, 0);
- return fnname;
-}
-
-
-/******************************* DIEs ************************************/
-
-/* Output routines for individual types of DIEs. */
-
-/* Note that every type of DIE (except a null DIE) gets a sibling. */
-
-static void
-output_array_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_array_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
-
- /* I believe that we can default the array ordering. SDB will probably
- do the right things even if AT_ordering is not present. It's not
- even an issue until we start to get into multidimensional arrays
- anyway. If SDB is ever caught doing the Wrong Thing for multi-
- dimensional arrays, then we'll have to put the AT_ordering attribute
- back in. (But if and when we find out that we need to put these in,
- we will only do so for multidimensional arrays. After all, we don't
- want to waste space in the .debug section now do we?) */
-
-#ifdef USE_ORDERING_ATTRIBUTE
- ordering_attribute (ORD_row_major);
-#endif /* defined(USE_ORDERING_ATTRIBUTE) */
-
- subscript_data_attribute (type);
-}
-
-static void
-output_set_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_set_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
- type_attribute (TREE_TYPE (type), 0, 0);
-}
-
-#if 0
-/* Implement this when there is a GNU FORTRAN or GNU Ada front end. */
-
-static void
-output_entry_point_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_entry_point);
- sibling_attribute ();
- dienum_push ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- name_and_src_coords_attributes (decl);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (TREE_TYPE (decl)), 0, 0);
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- low_pc_attribute (function_start_label (decl));
-}
-#endif
-
-/* Output a DIE to represent an inlined instance of an enumeration type. */
-
-static void
-output_inlined_enumeration_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_enumeration_type);
- sibling_attribute ();
- if (!TREE_ASM_WRITTEN (type))
- abort ();
- abstract_origin_attribute (type);
-}
-
-/* Output a DIE to represent an inlined instance of a structure type. */
-
-static void
-output_inlined_structure_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_structure_type);
- sibling_attribute ();
- if (!TREE_ASM_WRITTEN (type))
- abort ();
- abstract_origin_attribute (type);
-}
-
-/* Output a DIE to represent an inlined instance of a union type. */
-
-static void
-output_inlined_union_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_union_type);
- sibling_attribute ();
- if (!TREE_ASM_WRITTEN (type))
- abort ();
- abstract_origin_attribute (type);
-}
-
-/* Output a DIE to represent an enumeration type. Note that these DIEs
- include all of the information about the enumeration values also.
- This information is encoded into the element_list attribute. */
-
-static void
-output_enumeration_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_enumeration_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- name_attribute (type_tag (type));
- member_attribute (TYPE_CONTEXT (type));
-
- /* Handle a GNU C/C++ extension, i.e. incomplete enum types. If the
- given enum type is incomplete, do not generate the AT_byte_size
- attribute or the AT_element_list attribute. */
-
- if (COMPLETE_TYPE_P (type))
- {
- byte_size_attribute (type);
- element_list_attribute (TYPE_FIELDS (type));
- }
-}
-
-/* Output a DIE to represent either a real live formal parameter decl or
- to represent just the type of some formal parameter position in some
- function type.
-
- Note that this routine is a bit unusual because its argument may be
- a ..._DECL node (i.e. either a PARM_DECL or perhaps a VAR_DECL which
- represents an inlining of some PARM_DECL) or else some sort of a
- ..._TYPE node. If it's the former then this function is being called
- to output a DIE to represent a formal parameter object (or some inlining
- thereof). If it's the latter, then this function is only being called
- to output a TAG_formal_parameter DIE to stand as a placeholder for some
- formal argument type of some subprogram type. */
-
-static void
-output_formal_parameter_die (void *arg)
-{
- tree node = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_formal_parameter);
- sibling_attribute ();
-
- switch (TREE_CODE_CLASS (TREE_CODE (node)))
- {
- case 'd': /* We were called with some kind of a ..._DECL node. */
- {
- register tree origin = decl_ultimate_origin (node);
-
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- name_and_src_coords_attributes (node);
- type_attribute (TREE_TYPE (node),
- TREE_READONLY (node), TREE_THIS_VOLATILE (node));
- }
- if (DECL_ABSTRACT (node))
- equate_decl_number_to_die_number (node);
- else
- location_or_const_value_attribute (node);
- }
- break;
-
- case 't': /* We were called with some kind of a ..._TYPE node. */
- type_attribute (node, 0, 0);
- break;
-
- default:
- abort (); /* Should never happen. */
- }
-}
-
-/* Output a DIE to represent a declared function (either file-scope
- or block-local) which has "external linkage" (according to ANSI-C). */
-
-static void
-output_global_subroutine_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_global_subroutine);
- sibling_attribute ();
- dienum_push ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- tree type = TREE_TYPE (decl);
-
- name_and_src_coords_attributes (decl);
- inline_attribute (decl);
- prototyped_attribute (type);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (type), 0, 0);
- pure_or_virtual_attribute (decl);
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- {
- if (! DECL_EXTERNAL (decl) && ! in_class
- && decl == current_function_decl)
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- low_pc_attribute (function_start_label (decl));
- sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no);
- high_pc_attribute (label);
- if (use_gnu_debug_info_extensions)
- {
- sprintf (label, BODY_BEGIN_LABEL_FMT,
- current_function_funcdef_no);
- body_begin_attribute (label);
- sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no);
- body_end_attribute (label);
- }
- }
- }
-}
-
-/* Output a DIE to represent a declared data object (either file-scope
- or block-local) which has "external linkage" (according to ANSI-C). */
-
-static void
-output_global_variable_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_global_variable);
- sibling_attribute ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- name_and_src_coords_attributes (decl);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (decl),
- TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- {
- if (! DECL_EXTERNAL (decl) && ! in_class
- && current_function_decl == decl_function_context (decl))
- location_or_const_value_attribute (decl);
- }
-}
-
-static void
-output_label_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_label);
- sibling_attribute ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- name_and_src_coords_attributes (decl);
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- {
- rtx insn = DECL_RTL (decl);
-
- /* Deleted labels are programmer specified labels which have been
- eliminated because of various optimizations. We still emit them
- here so that it is possible to put breakpoints on them. */
- if (GET_CODE (insn) == CODE_LABEL
- || ((GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED_LABEL)))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- /* When optimization is enabled (via -O) some parts of the compiler
- (e.g. jump.c and cse.c) may try to delete CODE_LABEL insns which
- represent source-level labels which were explicitly declared by
- the user. This really shouldn't be happening though, so catch
- it if it ever does happen. */
-
- if (INSN_DELETED_P (insn))
- abort (); /* Should never happen. */
-
- ASM_GENERATE_INTERNAL_LABEL (label, "L", CODE_LABEL_NUMBER (insn));
- low_pc_attribute (label);
- }
- }
-}
-
-static void
-output_lexical_block_die (void *arg)
-{
- tree stmt = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_lexical_block);
- sibling_attribute ();
- dienum_push ();
- if (! BLOCK_ABSTRACT (stmt))
- {
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (begin_label, BLOCK_BEGIN_LABEL_FMT, BLOCK_NUMBER (stmt));
- low_pc_attribute (begin_label);
- sprintf (end_label, BLOCK_END_LABEL_FMT, BLOCK_NUMBER (stmt));
- high_pc_attribute (end_label);
- }
-}
-
-static void
-output_inlined_subroutine_die (void *arg)
-{
- tree stmt = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inlined_subroutine);
- sibling_attribute ();
- dienum_push ();
- abstract_origin_attribute (block_ultimate_origin (stmt));
- if (! BLOCK_ABSTRACT (stmt))
- {
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (begin_label, BLOCK_BEGIN_LABEL_FMT, BLOCK_NUMBER (stmt));
- low_pc_attribute (begin_label);
- sprintf (end_label, BLOCK_END_LABEL_FMT, BLOCK_NUMBER (stmt));
- high_pc_attribute (end_label);
- }
-}
-
-/* Output a DIE to represent a declared data object (either file-scope
- or block-local) which has "internal linkage" (according to ANSI-C). */
-
-static void
-output_local_variable_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_local_variable);
- sibling_attribute ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- name_and_src_coords_attributes (decl);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (decl),
- TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- location_or_const_value_attribute (decl);
-}
-
-static void
-output_member_die (void *arg)
-{
- tree decl = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_member);
- sibling_attribute ();
- name_and_src_coords_attributes (decl);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (member_declared_type (decl),
- TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
- if (DECL_BIT_FIELD_TYPE (decl)) /* If this is a bit field... */
- {
- byte_size_attribute (decl);
- bit_size_attribute (decl);
- bit_offset_attribute (decl);
- }
- data_member_location_attribute (decl);
-}
-
-#if 0
-/* Don't generate either pointer_type DIEs or reference_type DIEs. Use
- modified types instead.
-
- We keep this code here just in case these types of DIEs may be
- needed to represent certain things in other languages (e.g. Pascal)
- someday. */
-
-static void
-output_pointer_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_pointer_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
- type_attribute (TREE_TYPE (type), 0, 0);
-}
-
-static void
-output_reference_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_reference_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
- type_attribute (TREE_TYPE (type), 0, 0);
-}
-#endif
-
-static void
-output_ptr_to_mbr_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_ptr_to_member_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
- containing_type_attribute (TYPE_OFFSET_BASETYPE (type));
- type_attribute (TREE_TYPE (type), 0, 0);
-}
-
-static void
-output_compile_unit_die (void *arg)
-{
- const char *main_input_filename = arg;
- const char *language_string = lang_hooks.name;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_compile_unit);
- sibling_attribute ();
- dienum_push ();
- name_attribute (main_input_filename);
-
- {
- char producer[250];
-
- sprintf (producer, "%s %s", language_string, version_string);
- producer_attribute (producer);
- }
-
- if (strcmp (language_string, "GNU C++") == 0)
- language_attribute (LANG_C_PLUS_PLUS);
- else if (strcmp (language_string, "GNU Ada") == 0)
- language_attribute (LANG_ADA83);
- else if (strcmp (language_string, "GNU F77") == 0)
- language_attribute (LANG_FORTRAN77);
- else if (strcmp (language_string, "GNU Pascal") == 0)
- language_attribute (LANG_PASCAL83);
- else if (strcmp (language_string, "GNU Java") == 0)
- language_attribute (LANG_JAVA);
- else
- language_attribute (LANG_C89);
- low_pc_attribute (TEXT_BEGIN_LABEL);
- high_pc_attribute (TEXT_END_LABEL);
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- stmt_list_attribute (LINE_BEGIN_LABEL);
-
- {
- const char *wd = get_src_pwd ();
- if (wd)
- comp_dir_attribute (wd);
- }
-
- if (debug_info_level >= DINFO_LEVEL_NORMAL && use_gnu_debug_info_extensions)
- {
- sf_names_attribute (SFNAMES_BEGIN_LABEL);
- src_info_attribute (SRCINFO_BEGIN_LABEL);
- if (debug_info_level >= DINFO_LEVEL_VERBOSE)
- mac_info_attribute (MACINFO_BEGIN_LABEL);
- }
-}
-
-static void
-output_string_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_string_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- member_attribute (TYPE_CONTEXT (type));
- /* This is a fixed length string. */
- byte_size_attribute (type);
-}
-
-static void
-output_inheritance_die (void *arg)
-{
- tree binfo = ((tree *)arg)[0];
- tree access = ((tree *)arg)[1];
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_inheritance);
- sibling_attribute ();
- type_attribute (BINFO_TYPE (binfo), 0, 0);
- data_member_location_attribute (binfo);
- if (TREE_VIA_VIRTUAL (binfo))
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_virtual);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
- if (access == access_public_node)
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_public);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
- else if (access == access_protected_node)
- {
- ASM_OUTPUT_DWARF_ATTRIBUTE (asm_out_file, AT_protected);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- }
-}
-
-static void
-output_structure_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_structure_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- name_attribute (type_tag (type));
- member_attribute (TYPE_CONTEXT (type));
-
- /* If this type has been completed, then give it a byte_size attribute
- and prepare to give a list of members. Otherwise, don't do either of
- these things. In the latter case, we will not be generating a list
- of members (since we don't have any idea what they might be for an
- incomplete type). */
-
- if (COMPLETE_TYPE_P (type))
- {
- dienum_push ();
- byte_size_attribute (type);
- }
-}
-
-/* Output a DIE to represent a declared function (either file-scope
- or block-local) which has "internal linkage" (according to ANSI-C). */
-
-static void
-output_local_subroutine_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_subroutine);
- sibling_attribute ();
- dienum_push ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- tree type = TREE_TYPE (decl);
-
- name_and_src_coords_attributes (decl);
- inline_attribute (decl);
- prototyped_attribute (type);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (type), 0, 0);
- pure_or_virtual_attribute (decl);
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
- else
- {
- /* Avoid getting screwed up in cases where a function was declared
- static but where no definition was ever given for it. */
-
- if (TREE_ASM_WRITTEN (decl))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
- low_pc_attribute (function_start_label (decl));
- sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no);
- high_pc_attribute (label);
- if (use_gnu_debug_info_extensions)
- {
- sprintf (label, BODY_BEGIN_LABEL_FMT,
- current_function_funcdef_no);
- body_begin_attribute (label);
- sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no);
- body_end_attribute (label);
- }
- }
- }
-}
-
-static void
-output_subroutine_type_die (void *arg)
-{
- tree type = arg;
- tree return_type = TREE_TYPE (type);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_subroutine_type);
- sibling_attribute ();
- dienum_push ();
- equate_type_number_to_die_number (type);
- prototyped_attribute (type);
- member_attribute (TYPE_CONTEXT (type));
- type_attribute (return_type, 0, 0);
-}
-
-static void
-output_typedef_die (void *arg)
-{
- tree decl = arg;
- tree origin = decl_ultimate_origin (decl);
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_typedef);
- sibling_attribute ();
- if (origin != NULL)
- abstract_origin_attribute (origin);
- else
- {
- name_and_src_coords_attributes (decl);
- member_attribute (DECL_CONTEXT (decl));
- type_attribute (TREE_TYPE (decl),
- TREE_READONLY (decl), TREE_THIS_VOLATILE (decl));
- }
- if (DECL_ABSTRACT (decl))
- equate_decl_number_to_die_number (decl);
-}
-
-static void
-output_union_type_die (void *arg)
-{
- tree type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_union_type);
- sibling_attribute ();
- equate_type_number_to_die_number (type);
- name_attribute (type_tag (type));
- member_attribute (TYPE_CONTEXT (type));
-
- /* If this type has been completed, then give it a byte_size attribute
- and prepare to give a list of members. Otherwise, don't do either of
- these things. In the latter case, we will not be generating a list
- of members (since we don't have any idea what they might be for an
- incomplete type). */
-
- if (COMPLETE_TYPE_P (type))
- {
- dienum_push ();
- byte_size_attribute (type);
- }
-}
-
-/* Generate a special type of DIE used as a stand-in for a trailing ellipsis
- at the end of an (ANSI prototyped) formal parameters list. */
-
-static void
-output_unspecified_parameters_die (void *arg)
-{
- tree decl_or_type = arg;
-
- ASM_OUTPUT_DWARF_TAG (asm_out_file, TAG_unspecified_parameters);
- sibling_attribute ();
-
- /* This kludge is here only for the sake of being compatible with what
- the USL CI5 C compiler does. The specification of Dwarf Version 1
- doesn't say that TAG_unspecified_parameters DIEs should contain any
- attributes other than the AT_sibling attribute, but they are certainly
- allowed to contain additional attributes, and the CI5 compiler
- generates AT_name, AT_fund_type, and AT_location attributes within
- TAG_unspecified_parameters DIEs which appear in the child lists for
- DIEs representing function definitions, so we do likewise here. */
-
- if (TREE_CODE (decl_or_type) == FUNCTION_DECL && DECL_INITIAL (decl_or_type))
- {
- name_attribute ("...");
- fund_type_attribute (FT_pointer);
- /* location_attribute (?); */
- }
-}
-
-static void
-output_padded_null_die (void *arg ATTRIBUTE_UNUSED)
-{
- ASM_OUTPUT_ALIGN (asm_out_file, 2); /* 2**2 == 4 */
-}
-
-/*************************** end of DIEs *********************************/
-
-/* Generate some type of DIE. This routine generates the generic outer
- wrapper stuff which goes around all types of DIE's (regardless of their
- TAGs. All forms of DIEs start with a DIE-specific label, followed by a
- DIE-length word, followed by the guts of the DIE itself. After the guts
- of the DIE, there must always be a terminator label for the DIE. */
-
-static void
-output_die (void (*die_specific_output_function) (void *), void *param)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
- char end_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- current_dienum = NEXT_DIE_NUM;
- NEXT_DIE_NUM = next_unused_dienum;
-
- sprintf (begin_label, DIE_BEGIN_LABEL_FMT, current_dienum);
- sprintf (end_label, DIE_END_LABEL_FMT, current_dienum);
-
- /* Write a label which will act as the name for the start of this DIE. */
-
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* Write the DIE-length word. */
-
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, end_label, begin_label);
-
- /* Fill in the guts of the DIE. */
-
- next_unused_dienum++;
- die_specific_output_function (param);
-
- /* Write a label which will act as the name for the end of this DIE. */
-
- ASM_OUTPUT_LABEL (asm_out_file, end_label);
-}
-
-static void
-end_sibling_chain (void)
-{
- char begin_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- current_dienum = NEXT_DIE_NUM;
- NEXT_DIE_NUM = next_unused_dienum;
-
- sprintf (begin_label, DIE_BEGIN_LABEL_FMT, current_dienum);
-
- /* Write a label which will act as the name for the start of this DIE. */
-
- ASM_OUTPUT_LABEL (asm_out_file, begin_label);
-
- /* Write the DIE-length word. */
-
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 4);
-
- dienum_pop ();
-}
-
-/* Generate a list of nameless TAG_formal_parameter DIEs (and perhaps a
- TAG_unspecified_parameters DIE) to represent the types of the formal
- parameters as specified in some function type specification (except
- for those which appear as part of a function *definition*).
-
- Note that we must be careful here to output all of the parameter
- DIEs *before* we output any DIEs needed to represent the types of
- the formal parameters. This keeps svr4 SDB happy because it
- (incorrectly) thinks that the first non-parameter DIE it sees ends
- the formal parameter list. */
-
-static void
-output_formal_types (tree function_or_method_type)
-{
- tree link;
- tree formal_type = NULL;
- tree first_parm_type = TYPE_ARG_TYPES (function_or_method_type);
-
- /* Set TREE_ASM_WRITTEN while processing the parameters, lest we
- get bogus recursion when outputting tagged types local to a
- function declaration. */
- int save_asm_written = TREE_ASM_WRITTEN (function_or_method_type);
- TREE_ASM_WRITTEN (function_or_method_type) = 1;
-
- /* 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 AT_member
- attribute of the parent TAG_subroutine_type DIE. */
-
- if (TREE_CODE (function_or_method_type) == METHOD_TYPE)
- first_parm_type = TREE_CHAIN (first_parm_type);
-
- /* Make our first pass over the list of formal parameter types and output
- a TAG_formal_parameter DIE for each one. */
-
- for (link = first_parm_type; link; link = TREE_CHAIN (link))
- {
- formal_type = TREE_VALUE (link);
- if (formal_type == void_type_node)
- break;
-
- /* Output a (nameless) DIE to represent the formal parameter itself. */
-
- output_die (output_formal_parameter_die, formal_type);
- }
-
- /* If this function type has an ellipsis, add a TAG_unspecified_parameters
- DIE to the end of the parameter list. */
-
- if (formal_type != void_type_node)
- output_die (output_unspecified_parameters_die, function_or_method_type);
-
- /* Make our second (and final) pass over the list of formal parameter types
- and output DIEs to represent those types (as necessary). */
-
- for (link = TYPE_ARG_TYPES (function_or_method_type);
- link;
- link = TREE_CHAIN (link))
- {
- formal_type = TREE_VALUE (link);
- if (formal_type == void_type_node)
- break;
-
- output_type (formal_type, function_or_method_type);
- }
-
- TREE_ASM_WRITTEN (function_or_method_type) = save_asm_written;
-}
-
-/* Remember a type in the pending_types_list. */
-
-static void
-pend_type (tree type)
-{
- if (pending_types == pending_types_allocated)
- {
- pending_types_allocated += PENDING_TYPES_INCREMENT;
- pending_types_list
- = xrealloc (pending_types_list,
- sizeof (tree) * pending_types_allocated);
- }
- pending_types_list[pending_types++] = type;
-
- /* Mark the pending type as having been output already (even though
- it hasn't been). This prevents the type from being added to the
- pending_types_list more than once. */
-
- TREE_ASM_WRITTEN (type) = 1;
-}
-
-/* Return nonzero if it is legitimate to output DIEs to represent a
- given type while we are generating the list of child DIEs for some
- DIE (e.g. a function or lexical block DIE) associated with a given scope.
-
- See the comments within the function for a description of when it is
- considered legitimate to output DIEs for various kinds of types.
-
- Note that TYPE_CONTEXT(type) may be NULL (to indicate global scope)
- or it may point to a BLOCK node (for types local to a block), or to a
- FUNCTION_DECL node (for types local to the heading of some function
- definition), or to a FUNCTION_TYPE node (for types local to the
- prototyped parameter list of a function type specification), or to a
- RECORD_TYPE, UNION_TYPE, or QUAL_UNION_TYPE node
- (in the case of C++ nested types).
-
- The `scope' parameter should likewise be NULL or should point to a
- BLOCK node, a FUNCTION_DECL node, a FUNCTION_TYPE node, a RECORD_TYPE
- node, a UNION_TYPE node, or a QUAL_UNION_TYPE node.
-
- This function is used only for deciding when to "pend" and when to
- "un-pend" types to/from the pending_types_list.
-
- Note that we sometimes make use of this "type pending" feature in a
- rather twisted way to temporarily delay the production of DIEs for the
- types of formal parameters. (We do this just to make svr4 SDB happy.)
- It order to delay the production of DIEs representing types of formal
- parameters, callers of this function supply `fake_containing_scope' as
- the `scope' parameter to this function. Given that fake_containing_scope
- is a tagged type which is *not* the containing scope for *any* other type,
- the desired effect is achieved, i.e. output of DIEs representing types
- is temporarily suspended, and any type DIEs which would have otherwise
- been output are instead placed onto the pending_types_list. Later on,
- we force these (temporarily pended) types to be output simply by calling
- `output_pending_types_for_scope' with an actual argument equal to the
- true scope of the types we temporarily pended. */
-
-static inline int
-type_ok_for_scope (tree type, tree scope)
-{
- /* Tagged types (i.e. struct, union, and enum types) must always be
- output only in the scopes where they actually belong (or else the
- scoping of their own tag names and the scoping of their member
- names will be incorrect). Non-tagged-types on the other hand can
- generally be output anywhere, except that svr4 SDB really doesn't
- want to see them nested within struct or union types, so here we
- say it is always OK to immediately output any such a (non-tagged)
- type, so long as we are not within such a context. Note that the
- only kinds of non-tagged types which we will be dealing with here
- (for C and C++ anyway) will be array types and function types. */
-
- return is_tagged_type (type)
- ? (TYPE_CONTEXT (type) == scope
- /* Ignore namespaces for the moment. */
- || (scope == NULL_TREE
- && TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
- || (scope == NULL_TREE && is_tagged_type (TYPE_CONTEXT (type))
- && TREE_ASM_WRITTEN (TYPE_CONTEXT (type))))
- : (scope == NULL_TREE || ! is_tagged_type (scope));
-}
-
-/* Output any pending types (from the pending_types list) which we can output
- now (taking into account the scope that we are working on now).
-
- For each type output, remove the given type from the pending_types_list
- *before* we try to output it.
-
- Note that we have to process the list in beginning-to-end order,
- because the call made here to output_type may cause yet more types
- to be added to the end of the list, and we may have to output some
- of them too. */
-
-static void
-output_pending_types_for_scope (tree containing_scope)
-{
- unsigned i;
-
- for (i = 0; i < pending_types; )
- {
- tree type = pending_types_list[i];
-
- if (type_ok_for_scope (type, containing_scope))
- {
- tree *mover;
- tree *limit;
-
- pending_types--;
- limit = &pending_types_list[pending_types];
- for (mover = &pending_types_list[i]; mover < limit; mover++)
- *mover = *(mover+1);
-
- /* Un-mark the type as having been output already (because it
- hasn't been, really). Then call output_type to generate a
- Dwarf representation of it. */
-
- TREE_ASM_WRITTEN (type) = 0;
- output_type (type, containing_scope);
-
- /* Don't increment the loop counter in this case because we
- have shifted all of the subsequent pending types down one
- element in the pending_types_list array. */
- }
- else
- i++;
- }
-}
-
-/* Remember a type in the incomplete_types_list. */
-
-static void
-add_incomplete_type (tree type)
-{
- if (incomplete_types == incomplete_types_allocated)
- {
- incomplete_types_allocated += INCOMPLETE_TYPES_INCREMENT;
- incomplete_types_list
- = xrealloc (incomplete_types_list,
- sizeof (tree) * incomplete_types_allocated);
- }
-
- incomplete_types_list[incomplete_types++] = type;
-}
-
-/* Walk through the list of incomplete types again, trying once more to
- emit full debugging info for them. */
-
-static void
-retry_incomplete_types (void)
-{
- tree type;
-
- finalizing = 1;
- while (incomplete_types)
- {
- --incomplete_types;
- type = incomplete_types_list[incomplete_types];
- output_type (type, NULL_TREE);
- }
-}
-
-static void
-output_type (tree type, tree containing_scope)
-{
- if (type == 0 || type == error_mark_node)
- return;
-
- /* We are going to output a DIE to represent the unqualified version of
- this type (i.e. without any const or volatile qualifiers) so get
- the main variant (i.e. the unqualified version) of this type now. */
-
- type = type_main_variant (type);
-
- if (TREE_ASM_WRITTEN (type))
- {
- if (finalizing && AGGREGATE_TYPE_P (type))
- {
- tree member;
-
- /* Some of our nested types might not have been defined when we
- were written out before; force them out now. */
-
- for (member = TYPE_FIELDS (type); member;
- member = TREE_CHAIN (member))
- if (TREE_CODE (member) == TYPE_DECL
- && ! TREE_ASM_WRITTEN (TREE_TYPE (member)))
- output_type (TREE_TYPE (member), containing_scope);
- }
- return;
- }
-
- /* If this is a nested type whose containing class hasn't been
- written out yet, writing it out will cover this one, too. */
-
- if (TYPE_CONTEXT (type)
- && TYPE_P (TYPE_CONTEXT (type))
- && ! TREE_ASM_WRITTEN (TYPE_CONTEXT (type)))
- {
- output_type (TYPE_CONTEXT (type), containing_scope);
- return;
- }
-
- /* Don't generate any DIEs for this type now unless it is OK to do so
- (based upon what `type_ok_for_scope' tells us). */
-
- if (! type_ok_for_scope (type, containing_scope))
- {
- pend_type (type);
- return;
- }
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- break;
-
- case VECTOR_TYPE:
- output_type (TYPE_DEBUG_REPRESENTATION_TYPE (type), containing_scope);
- break;
-
- case POINTER_TYPE:
- case REFERENCE_TYPE:
- /* Prevent infinite recursion in cases where this is a recursive
- type. Recursive types are possible in Ada. */
- TREE_ASM_WRITTEN (type) = 1;
- /* For these types, all that is required is that we output a DIE
- (or a set of DIEs) to represent the "basis" type. */
- output_type (TREE_TYPE (type), containing_scope);
- break;
-
- case OFFSET_TYPE:
- /* This code is used for C++ pointer-to-data-member types. */
- /* Output a description of the relevant class type. */
- output_type (TYPE_OFFSET_BASETYPE (type), containing_scope);
- /* Output a description of the type of the object pointed to. */
- output_type (TREE_TYPE (type), containing_scope);
- /* Now output a DIE to represent this pointer-to-data-member type
- itself. */
- output_die (output_ptr_to_mbr_type_die, type);
- break;
-
- case SET_TYPE:
- output_type (TYPE_DOMAIN (type), containing_scope);
- output_die (output_set_type_die, type);
- break;
-
- case FILE_TYPE:
- output_type (TREE_TYPE (type), containing_scope);
- abort (); /* No way to represent these in Dwarf yet! */
- break;
-
- case FUNCTION_TYPE:
- /* Force out return type (in case it wasn't forced out already). */
- output_type (TREE_TYPE (type), containing_scope);
- output_die (output_subroutine_type_die, type);
- output_formal_types (type);
- end_sibling_chain ();
- break;
-
- case METHOD_TYPE:
- /* Force out return type (in case it wasn't forced out already). */
- output_type (TREE_TYPE (type), containing_scope);
- output_die (output_subroutine_type_die, type);
- output_formal_types (type);
- end_sibling_chain ();
- break;
-
- case ARRAY_TYPE:
- if (TYPE_STRING_FLAG (type) && TREE_CODE(TREE_TYPE(type)) == CHAR_TYPE)
- {
- output_type (TREE_TYPE (type), containing_scope);
- output_die (output_string_type_die, type);
- }
- else
- {
- tree element_type;
-
- element_type = TREE_TYPE (type);
- while (TREE_CODE (element_type) == ARRAY_TYPE)
- element_type = TREE_TYPE (element_type);
-
- output_type (element_type, containing_scope);
- output_die (output_array_type_die, type);
- }
- break;
-
- case ENUMERAL_TYPE:
- case RECORD_TYPE:
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
-
- /* For a non-file-scope tagged type, we can always go ahead and
- output a Dwarf description of this type right now, even if
- the type in question is still incomplete, because if this
- local type *was* ever completed anywhere within its scope,
- that complete definition would already have been attached to
- this RECORD_TYPE, UNION_TYPE, QUAL_UNION_TYPE or ENUMERAL_TYPE
- node by the time we reach this point. That's true because of the
- way the front-end does its processing of file-scope declarations (of
- functions and class types) within which other types might be
- nested. The C and C++ front-ends always gobble up such "local
- scope" things en-mass before they try to output *any* debugging
- information for any of the stuff contained inside them and thus,
- we get the benefit here of what is (in effect) a pre-resolution
- of forward references to tagged types in local scopes.
-
- Note however that for file-scope tagged types we cannot assume
- that such pre-resolution of forward references has taken place.
- A given file-scope tagged type may appear to be incomplete when
- we reach this point, but it may yet be given a full definition
- (at file-scope) later on during compilation. In order to avoid
- generating a premature (and possibly incorrect) set of Dwarf
- DIEs for such (as yet incomplete) file-scope tagged types, we
- generate nothing at all for as-yet incomplete file-scope tagged
- types here unless we are making our special "finalization" pass
- for file-scope things at the very end of compilation. At that
- time, we will certainly know as much about each file-scope tagged
- type as we are ever going to know, so at that point in time, we
- can safely generate correct Dwarf descriptions for these file-
- scope tagged types. */
-
- if (!COMPLETE_TYPE_P (type)
- && (TYPE_CONTEXT (type) == NULL
- || AGGREGATE_TYPE_P (TYPE_CONTEXT (type))
- || TREE_CODE (TYPE_CONTEXT (type)) == NAMESPACE_DECL)
- && !finalizing)
- {
- /* We don't need to do this for function-local types. */
- if (! decl_function_context (TYPE_STUB_DECL (type)))
- add_incomplete_type (type);
- return; /* EARLY EXIT! Avoid setting TREE_ASM_WRITTEN. */
- }
-
- /* Prevent infinite recursion in cases where the type of some
- member of this type is expressed in terms of this type itself. */
-
- TREE_ASM_WRITTEN (type) = 1;
-
- /* Output a DIE to represent the tagged type itself. */
-
- switch (TREE_CODE (type))
- {
- case ENUMERAL_TYPE:
- output_die (output_enumeration_type_die, type);
- return; /* a special case -- nothing left to do so just return */
-
- case RECORD_TYPE:
- output_die (output_structure_type_die, type);
- break;
-
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- output_die (output_union_type_die, type);
- break;
-
- default:
- abort (); /* Should never happen. */
- }
-
- /* If this is not an incomplete type, output descriptions of
- each of its members.
-
- Note that as we output the DIEs necessary to represent the
- members of this record or union type, we will also be trying
- to output DIEs to represent the *types* of those members.
- However the `output_type' function (above) will specifically
- avoid generating type DIEs for member types *within* the list
- of member DIEs for this (containing) type except for those
- types (of members) which are explicitly marked as also being
- members of this (containing) type themselves. The g++ front-
- end can force any given type to be treated as a member of some
- other (containing) type by setting the TYPE_CONTEXT of the
- given (member) type to point to the TREE node representing the
- appropriate (containing) type.
- */
-
- if (COMPLETE_TYPE_P (type))
- {
- tree binfo = TYPE_BINFO (type);
-
- /* First output info about the base classes. */
- if (binfo)
- {
- tree bases = BINFO_BASETYPES (binfo);
- tree accesses = BINFO_BASEACCESSES (binfo);
- register int n_bases = BINFO_N_BASETYPES (binfo);
- register int i;
-
- for (i = 0; i < n_bases; i++)
- {
- tree arg[2];
-
- arg[0] = TREE_VEC_ELT (bases, i);
- arg[1] = (accesses ? TREE_VEC_ELT (accesses, i)
- : access_public_node);
- output_type (BINFO_TYPE (binfo), containing_scope);
- output_die (output_inheritance_die, arg);
- }
- }
-
- ++in_class;
-
- {
- tree normal_member;
-
- /* Now output info about the data members and type members. */
-
- for (normal_member = TYPE_FIELDS (type);
- normal_member;
- normal_member = TREE_CHAIN (normal_member))
- output_decl (normal_member, type);
- }
-
- {
- tree func_member;
-
- /* Now output info about the function members (if any). */
-
- for (func_member = TYPE_METHODS (type);
- func_member;
- func_member = TREE_CHAIN (func_member))
- {
- /* Don't include clones in the member list. */
- if (DECL_ABSTRACT_ORIGIN (func_member))
- continue;
-
- output_decl (func_member, type);
- }
- }
-
- --in_class;
-
- /* RECORD_TYPEs, UNION_TYPEs, and QUAL_UNION_TYPEs are themselves
- scopes (at least in C++) so we must now output any nested
- pending types which are local just to this type. */
-
- output_pending_types_for_scope (type);
-
- end_sibling_chain (); /* Terminate member chain. */
- }
-
- break;
-
- case VOID_TYPE:
- case INTEGER_TYPE:
- case REAL_TYPE:
- case COMPLEX_TYPE:
- case BOOLEAN_TYPE:
- case CHAR_TYPE:
- break; /* No DIEs needed for fundamental types. */
-
- case LANG_TYPE: /* No Dwarf representation currently defined. */
- break;
-
- default:
- abort ();
- }
-
- TREE_ASM_WRITTEN (type) = 1;
-}
-
-static void
-output_tagged_type_instantiation (tree type)
-{
- if (type == 0 || type == error_mark_node)
- return;
-
- /* We are going to output a DIE to represent the unqualified version of
- this type (i.e. without any const or volatile qualifiers) so make
- sure that we have the main variant (i.e. the unqualified version) of
- this type now. */
-
- if (type != type_main_variant (type))
- abort ();
-
- if (!TREE_ASM_WRITTEN (type))
- abort ();
-
- switch (TREE_CODE (type))
- {
- case ERROR_MARK:
- break;
-
- case ENUMERAL_TYPE:
- output_die (output_inlined_enumeration_type_die, type);
- break;
-
- case RECORD_TYPE:
- output_die (output_inlined_structure_type_die, type);
- break;
-
- case UNION_TYPE:
- case QUAL_UNION_TYPE:
- output_die (output_inlined_union_type_die, type);
- break;
-
- default:
- abort (); /* Should never happen. */
- }
-}
-
-/* Output a TAG_lexical_block DIE followed by DIEs to represent all of
- the things which are local to the given block. */
-
-static void
-output_block (tree stmt, int depth)
-{
- int must_output_die = 0;
- tree origin;
- enum tree_code origin_code;
-
- /* Ignore blocks never really used to make RTL. */
-
- if (! stmt || ! TREE_USED (stmt)
- || (!TREE_ASM_WRITTEN (stmt) && !BLOCK_ABSTRACT (stmt)))
- return;
-
- /* Determine the "ultimate origin" of this block. This block may be an
- inlined instance of an inlined instance of inline function, so we
- have to trace all of the way back through the origin chain to find
- out what sort of node actually served as the original seed for the
- creation of the current block. */
-
- origin = block_ultimate_origin (stmt);
- origin_code = (origin != NULL) ? TREE_CODE (origin) : ERROR_MARK;
-
- /* Determine if we need to output any Dwarf DIEs at all to represent this
- block. */
-
- if (origin_code == FUNCTION_DECL)
- /* The outer scopes for inlinings *must* always be represented. We
- generate TAG_inlined_subroutine DIEs for them. (See below.) */
- must_output_die = 1;
- else
- {
- /* In the case where the current block represents an inlining of the
- "body block" of an inline function, we must *NOT* output any DIE
- for this block because we have already output a DIE to represent
- the whole inlined function scope and the "body block" of any
- function doesn't really represent a different scope according to
- ANSI C rules. So we check here to make sure that this block does
- not represent a "body block inlining" before trying to set the
- `must_output_die' flag. */
-
- if (! is_body_block (origin ? origin : stmt))
- {
- /* Determine if this block directly contains any "significant"
- local declarations which we will need to output DIEs for. */
-
- if (debug_info_level > DINFO_LEVEL_TERSE)
- /* We are not in terse mode so *any* local declaration counts
- as being a "significant" one. */
- must_output_die = (BLOCK_VARS (stmt) != NULL);
- else
- {
- tree decl;
-
- /* We are in terse mode, so only local (nested) function
- definitions count as "significant" local declarations. */
-
- for (decl = BLOCK_VARS (stmt); decl; decl = TREE_CHAIN (decl))
- if (TREE_CODE (decl) == FUNCTION_DECL && DECL_INITIAL (decl))
- {
- must_output_die = 1;
- break;
- }
- }
- }
- }
-
- /* It would be a waste of space to generate a Dwarf TAG_lexical_block
- DIE for any block which contains no significant local declarations
- at all. Rather, in such cases we just call `output_decls_for_scope'
- so that any needed Dwarf info for any sub-blocks will get properly
- generated. Note that in terse mode, our definition of what constitutes
- a "significant" local declaration gets restricted to include only
- inlined function instances and local (nested) function definitions. */
-
- if (origin_code == FUNCTION_DECL && BLOCK_ABSTRACT (stmt))
- /* We don't care about an abstract inlined subroutine. */;
- else if (must_output_die)
- {
- output_die ((origin_code == FUNCTION_DECL)
- ? output_inlined_subroutine_die
- : output_lexical_block_die,
- stmt);
- output_decls_for_scope (stmt, depth);
- end_sibling_chain ();
- }
- else
- output_decls_for_scope (stmt, depth);
-}
-
-/* Output all of the decls declared within a given scope (also called
- a `binding contour') and (recursively) all of it's sub-blocks. */
-
-static void
-output_decls_for_scope (tree stmt, int depth)
-{
- /* Ignore blocks never really used to make RTL. */
-
- if (! stmt || ! TREE_USED (stmt))
- return;
-
- /* Output the DIEs to represent all of the data objects, functions,
- typedefs, and tagged types declared directly within this block
- but not within any nested sub-blocks. */
-
- {
- tree decl;
-
- for (decl = BLOCK_VARS (stmt); decl; decl = TREE_CHAIN (decl))
- output_decl (decl, stmt);
- }
-
- output_pending_types_for_scope (stmt);
-
- /* Output the DIEs to represent all sub-blocks (and the items declared
- therein) of this block. */
-
- {
- tree subblocks;
-
- for (subblocks = BLOCK_SUBBLOCKS (stmt);
- subblocks;
- subblocks = BLOCK_CHAIN (subblocks))
- output_block (subblocks, depth + 1);
- }
-}
-
-/* Is this a typedef we can avoid emitting? */
-
-static inline int
-is_redundant_typedef (tree decl)
-{
- if (TYPE_DECL_IS_STUB (decl))
- return 1;
- if (DECL_ARTIFICIAL (decl)
- && DECL_CONTEXT (decl)
- && is_tagged_type (DECL_CONTEXT (decl))
- && TREE_CODE (TYPE_NAME (DECL_CONTEXT (decl))) == TYPE_DECL
- && DECL_NAME (decl) == DECL_NAME (TYPE_NAME (DECL_CONTEXT (decl))))
- /* Also ignore the artificial member typedef for the class name. */
- return 1;
- return 0;
-}
-
-/* Output Dwarf .debug information for a decl described by DECL. */
-
-static void
-output_decl (tree decl, tree containing_scope)
-{
- /* Make a note of the decl node we are going to be working on. We may
- need to give the user the source coordinates of where it appeared in
- case we notice (later on) that something about it looks screwy. */
-
- dwarf_last_decl = decl;
-
- if (TREE_CODE (decl) == ERROR_MARK)
- return;
-
- /* If a structure is declared within an initialization, e.g. as the
- operand of a sizeof, then it will not have a name. We don't want
- to output a DIE for it, as the tree nodes are in the temporary obstack */
-
- if ((TREE_CODE (TREE_TYPE (decl)) == RECORD_TYPE
- || TREE_CODE (TREE_TYPE (decl)) == UNION_TYPE)
- && ((DECL_NAME (decl) == 0 && TYPE_NAME (TREE_TYPE (decl)) == 0)
- || (TYPE_FIELDS (TREE_TYPE (decl))
- && (TREE_CODE (TYPE_FIELDS (TREE_TYPE (decl))) == ERROR_MARK))))
- return;
-
- /* If this ..._DECL node is marked to be ignored, then ignore it. */
-
- if (DECL_IGNORED_P (decl))
- return;
-
- switch (TREE_CODE (decl))
- {
- case CONST_DECL:
- /* The individual enumerators of an enum type get output when we
- output the Dwarf representation of the relevant enum type itself. */
- break;
-
- case FUNCTION_DECL:
- /* If we are in terse mode, don't output any DIEs to represent
- mere function declarations. Also, if we are conforming
- to the DWARF version 1 specification, don't output DIEs for
- mere function declarations. */
-
- if (DECL_INITIAL (decl) == NULL_TREE)
-#if (DWARF_VERSION > 1)
- if (debug_info_level <= DINFO_LEVEL_TERSE)
-#endif
- break;
-
- /* Before we describe the FUNCTION_DECL itself, make sure that we
- have described its return type. */
-
- output_type (TREE_TYPE (TREE_TYPE (decl)), containing_scope);
-
- {
- /* And its containing type. */
- register tree origin = decl_class_context (decl);
- if (origin)
- output_type (origin, containing_scope);
- }
-
- /* If we're emitting an out-of-line copy of an inline function,
- set up to refer to the abstract instance emitted from
- dwarfout_deferred_inline_function. */
- if (DECL_INLINE (decl) && ! DECL_ABSTRACT (decl)
- && ! (containing_scope && TYPE_P (containing_scope)))
- set_decl_origin_self (decl);
-
- /* If the following DIE will represent a function definition for a
- function with "extern" linkage, output a special "pubnames" DIE
- label just ahead of the actual DIE. A reference to this label
- was already generated in the .debug_pubnames section sub-entry
- for this function definition. */
-
- if (TREE_PUBLIC (decl))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number++);
- ASM_OUTPUT_LABEL (asm_out_file, label);
- }
-
- /* Now output a DIE to represent the function itself. */
-
- output_die (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl)
- ? output_global_subroutine_die
- : output_local_subroutine_die,
- decl);
-
- /* Now output descriptions of the arguments for this function.
- This gets (unnecessarily?) complex because of the fact that
- the DECL_ARGUMENT list for a FUNCTION_DECL doesn't indicate
- cases where there was a trailing `...' at the end of the formal
- parameter list. In order to find out if there was a trailing
- ellipsis or not, we must instead look at the type associated
- with the FUNCTION_DECL. This will be a node of type FUNCTION_TYPE.
- If the chain of type nodes hanging off of this FUNCTION_TYPE node
- ends with a void_type_node then there should *not* be an ellipsis
- at the end. */
-
- /* In the case where we are describing a mere function declaration, all
- we need to do here (and all we *can* do here) is to describe
- the *types* of its formal parameters. */
-
- if (decl != current_function_decl || in_class)
- output_formal_types (TREE_TYPE (decl));
- else
- {
- /* Generate DIEs to represent all known formal parameters. */
-
- tree arg_decls = DECL_ARGUMENTS (decl);
- tree parm;
-
- /* WARNING! Kludge zone ahead! Here we have a special
- hack for svr4 SDB compatibility. Instead of passing the
- current FUNCTION_DECL node as the second parameter (i.e.
- the `containing_scope' parameter) to `output_decl' (as
- we ought to) we instead pass a pointer to our own private
- fake_containing_scope node. That node is a RECORD_TYPE
- node which NO OTHER TYPE may ever actually be a member of.
-
- This pointer will ultimately get passed into `output_type'
- as its `containing_scope' parameter. `Output_type' will
- then perform its part in the hack... i.e. it will pend
- the type of the formal parameter onto the pending_types
- list. Later on, when we are done generating the whole
- sequence of formal parameter DIEs for this function
- definition, we will un-pend all previously pended types
- of formal parameters for this function definition.
-
- This whole kludge prevents any type DIEs from being
- mixed in with the formal parameter DIEs. That's good
- because svr4 SDB believes that the list of formal
- parameter DIEs for a function ends wherever the first
- non-formal-parameter DIE appears. Thus, we have to
- keep the formal parameter DIEs segregated. They must
- all appear (consecutively) at the start of the list of
- children for the DIE representing the function definition.
- Then (and only then) may we output any additional DIEs
- needed to represent the types of these formal parameters.
- */
-
- /*
- When generating DIEs, generate the unspecified_parameters
- DIE instead if we come across the arg "__builtin_va_alist"
- */
-
- for (parm = arg_decls; parm; parm = TREE_CHAIN (parm))
- if (TREE_CODE (parm) == PARM_DECL)
- {
- if (DECL_NAME(parm) &&
- !strcmp(IDENTIFIER_POINTER(DECL_NAME(parm)),
- "__builtin_va_alist") )
- output_die (output_unspecified_parameters_die, decl);
- else
- output_decl (parm, fake_containing_scope);
- }
-
- /*
- Now that we have finished generating all of the DIEs to
- represent the formal parameters themselves, force out
- any DIEs needed to represent their types. We do this
- simply by un-pending all previously pended types which
- can legitimately go into the chain of children DIEs for
- the current FUNCTION_DECL.
- */
-
- output_pending_types_for_scope (decl);
-
- /*
- Decide whether we need an unspecified_parameters DIE at the end.
- There are 2 more cases to do this for:
- 1) the ansi ... declaration - this is detectable when the end
- of the arg list is not a void_type_node
- 2) an unprototyped function declaration (not a definition). This
- just means that we have no info about the parameters at all.
- */
-
- {
- tree fn_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
-
- if (fn_arg_types)
- {
- /* This is the prototyped case, check for.... */
- if (TREE_VALUE (tree_last (fn_arg_types)) != void_type_node)
- output_die (output_unspecified_parameters_die, decl);
- }
- else
- {
- /* This is unprototyped, check for undefined (just declaration). */
- if (!DECL_INITIAL (decl))
- output_die (output_unspecified_parameters_die, decl);
- }
- }
-
- /* Output Dwarf info for all of the stuff within the body of the
- function (if it has one - it may be just a declaration). */
-
- {
- tree outer_scope = DECL_INITIAL (decl);
-
- if (outer_scope && TREE_CODE (outer_scope) != ERROR_MARK)
- {
- /* Note that here, `outer_scope' is a pointer to the outermost
- BLOCK node created to represent a function.
- This outermost BLOCK actually represents the outermost
- binding contour for the function, i.e. the contour in which
- the function's formal parameters and labels get declared.
-
- Curiously, it appears that the front end doesn't actually
- put the PARM_DECL nodes for the current function onto the
- BLOCK_VARS list for this outer scope. (They are strung
- off of the DECL_ARGUMENTS list for the function instead.)
- The BLOCK_VARS list for the `outer_scope' does provide us
- with a list of the LABEL_DECL nodes for the function however,
- and we output DWARF info for those here.
-
- Just within the `outer_scope' there will be a BLOCK node
- representing the function's outermost pair of curly braces,
- and any blocks used for the base and member initializers of
- a C++ constructor function. */
-
- output_decls_for_scope (outer_scope, 0);
-
- /* Finally, force out any pending types which are local to the
- outermost block of this function definition. These will
- all have a TYPE_CONTEXT which points to the FUNCTION_DECL
- node itself. */
-
- output_pending_types_for_scope (decl);
- }
- }
- }
-
- /* Generate a terminator for the list of stuff `owned' by this
- function. */
-
- end_sibling_chain ();
-
- break;
-
- case TYPE_DECL:
- /* If we are in terse mode, don't generate any DIEs to represent
- any actual typedefs. Note that even when we are in terse mode,
- we must still output DIEs to represent those tagged types which
- are used (directly or indirectly) in the specification of either
- a return type or a formal parameter type of some function. */
-
- if (debug_info_level <= DINFO_LEVEL_TERSE)
- if (! TYPE_DECL_IS_STUB (decl)
- || (! TYPE_USED_FOR_FUNCTION (TREE_TYPE (decl)) && ! in_class))
- return;
-
- /* In the special case of a TYPE_DECL node representing
- the declaration of some type tag, if the given TYPE_DECL is
- marked as having been instantiated from some other (original)
- TYPE_DECL node (e.g. one which was generated within the original
- definition of an inline function) we have to generate a special
- (abbreviated) TAG_structure_type, TAG_union_type, or
- TAG_enumeration-type DIE here. */
-
- if (TYPE_DECL_IS_STUB (decl) && DECL_ABSTRACT_ORIGIN (decl))
- {
- output_tagged_type_instantiation (TREE_TYPE (decl));
- return;
- }
-
- output_type (TREE_TYPE (decl), containing_scope);
-
- if (! is_redundant_typedef (decl))
- /* Output a DIE to represent the typedef itself. */
- output_die (output_typedef_die, decl);
- break;
-
- case LABEL_DECL:
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- output_die (output_label_die, decl);
- break;
-
- case VAR_DECL:
- /* If we are conforming to the DWARF version 1 specification, don't
- generated any DIEs to represent mere external object declarations. */
-
-#if (DWARF_VERSION <= 1)
- if (DECL_EXTERNAL (decl) && ! TREE_PUBLIC (decl))
- break;
-#endif
-
- /* If we are in terse mode, don't generate any DIEs to represent
- any variable declarations or definitions. */
-
- if (debug_info_level <= DINFO_LEVEL_TERSE)
- break;
-
- /* Output any DIEs that are needed to specify the type of this data
- object. */
-
- output_type (TREE_TYPE (decl), containing_scope);
-
- {
- /* And its containing type. */
- register tree origin = decl_class_context (decl);
- if (origin)
- output_type (origin, containing_scope);
- }
-
- /* If the following DIE will represent a data object definition for a
- data object with "extern" linkage, output a special "pubnames" DIE
- label just ahead of the actual DIE. A reference to this label
- was already generated in the .debug_pubnames section sub-entry
- for this data object definition. */
-
- if (TREE_PUBLIC (decl) && ! DECL_ABSTRACT (decl))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number++);
- ASM_OUTPUT_LABEL (asm_out_file, label);
- }
-
- /* Now output the DIE to represent the data object itself. This gets
- complicated because of the possibility that the VAR_DECL really
- represents an inlined instance of a formal parameter for an inline
- function. */
-
- {
- void (*func) (void *);
- register tree origin = decl_ultimate_origin (decl);
-
- if (origin != NULL && TREE_CODE (origin) == PARM_DECL)
- func = output_formal_parameter_die;
- else
- {
- if (TREE_PUBLIC (decl) || DECL_EXTERNAL (decl))
- func = output_global_variable_die;
- else
- func = output_local_variable_die;
- }
- output_die (func, decl);
- }
- break;
-
- case FIELD_DECL:
- /* Ignore the nameless fields that are used to skip bits. */
- if (DECL_NAME (decl) != 0)
- {
- output_type (member_declared_type (decl), containing_scope);
- output_die (output_member_die, decl);
- }
- break;
-
- case PARM_DECL:
- /* Force out the type of this formal, if it was not forced out yet.
- Note that here we can run afoul of a bug in "classic" svr4 SDB.
- It should be able to grok the presence of type DIEs within a list
- of TAG_formal_parameter DIEs, but it doesn't. */
-
- output_type (TREE_TYPE (decl), containing_scope);
- output_die (output_formal_parameter_die, decl);
- break;
-
- case NAMESPACE_DECL:
- /* Ignore for now. */
- break;
-
- default:
- abort ();
- }
-}
-
-/* Output debug information for a function. */
-static void
-dwarfout_function_decl (tree decl)
-{
- dwarfout_file_scope_decl (decl, 0);
-}
-
-/* Debug information for a global DECL. Called from toplev.c after
- compilation proper has finished. */
-static void
-dwarfout_global_decl (tree decl)
-{
- /* Output DWARF information for file-scope tentative data object
- declarations, file-scope (extern) function declarations (which
- had no corresponding body) and file-scope tagged type
- declarations and definitions which have not yet been forced out. */
-
- if (TREE_CODE (decl) != FUNCTION_DECL || !DECL_INITIAL (decl))
- dwarfout_file_scope_decl (decl, 1);
-}
-
-/* DECL is an inline function, whose body is present, but which is not
- being output at this point. (We're putting that off until we need
- to do it.) */
-static void
-dwarfout_deferred_inline_function (tree 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 ((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);
- if (! was_abstract)
- set_decl_abstract_flags (decl, 0);
-
- /* Reset CURRENT_FUNCTION_DECL. */
- current_function_decl = saved_cfd;
- }
-}
-
-static void
-dwarfout_file_scope_decl (tree decl, int set_finalizing)
-{
- if (TREE_CODE (decl) == ERROR_MARK)
- return;
-
- /* If this ..._DECL node is marked to be ignored, then ignore it. */
-
- if (DECL_IGNORED_P (decl))
- return;
-
- switch (TREE_CODE (decl))
- {
- case FUNCTION_DECL:
-
- /* Ignore this FUNCTION_DECL if it refers to a builtin declaration of
- a builtin function. Explicit programmer-supplied declarations of
- these same functions should NOT be ignored however. */
-
- if (DECL_EXTERNAL (decl) && DECL_FUNCTION_CODE (decl))
- return;
-
- /* What we would really like to do here is to filter out all mere
- file-scope declarations of file-scope functions which are never
- referenced later within this translation unit (and keep all of
- ones that *are* referenced later on) but we aren't clairvoyant,
- so we have no idea which functions will be referenced in the
- future (i.e. later on within the current translation unit).
- So here we just ignore all file-scope function declarations
- which are not also definitions. If and when the debugger needs
- to know something about these functions, it will have to hunt
- around and find the DWARF information associated with the
- *definition* of the function.
-
- Note that we can't just check `DECL_EXTERNAL' to find out which
- FUNCTION_DECL nodes represent definitions and which ones represent
- mere declarations. We have to check `DECL_INITIAL' instead. That's
- because the C front-end supports some weird semantics for "extern
- inline" function definitions. These can get inlined within the
- current translation unit (an thus, we need to generate DWARF info
- for their abstract instances so that the DWARF info for the
- concrete inlined instances can have something to refer to) but
- the compiler never generates any out-of-lines instances of such
- things (despite the fact that they *are* definitions). The
- important point is that the C front-end marks these "extern inline"
- functions as DECL_EXTERNAL, but we need to generate DWARF for them
- anyway.
-
- Note that the C++ front-end also plays some similar games for inline
- function definitions appearing within include files which also
- contain `#pragma interface' pragmas. */
-
- if (DECL_INITIAL (decl) == NULL_TREE)
- return;
-
- if (TREE_PUBLIC (decl)
- && ! DECL_EXTERNAL (decl)
- && ! DECL_ABSTRACT (decl))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- /* Output a .debug_pubnames entry for a public function
- defined in this compilation unit. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION);
- sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- break;
-
- case VAR_DECL:
-
- /* Ignore this VAR_DECL if it refers to a file-scope extern data
- object declaration and if the declaration was never even
- referenced from within this entire compilation unit. We
- suppress these DIEs in order to save space in the .debug section
- (by eliminating entries which are probably useless). Note that
- we must not suppress block-local extern declarations (whether
- used or not) because that would screw-up the debugger's name
- lookup mechanism and cause it to miss things which really ought
- to be in scope at a given point. */
-
- if (DECL_EXTERNAL (decl) && !TREE_USED (decl))
- return;
-
- if (TREE_PUBLIC (decl)
- && ! DECL_EXTERNAL (decl)
- && GET_CODE (DECL_RTL (decl)) == MEM
- && ! DECL_ABSTRACT (decl))
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- {
- /* Output a .debug_pubnames entry for a public variable
- defined in this compilation unit. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION);
- sprintf (label, PUB_DIE_LABEL_FMT, next_pubname_number);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
- IDENTIFIER_POINTER (DECL_NAME (decl)));
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- if (DECL_INITIAL (decl) == NULL)
- {
- /* Output a .debug_aranges entry for a public variable
- which is tentatively defined in this compilation unit. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file,
- IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl)));
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file,
- (unsigned) int_size_in_bytes (TREE_TYPE (decl)));
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
- }
-
- /* If we are in terse mode, don't generate any DIEs to represent
- any variable declarations or definitions. */
-
- if (debug_info_level <= DINFO_LEVEL_TERSE)
- return;
-
- break;
-
- case TYPE_DECL:
- /* Don't bother trying to generate any DIEs to represent any of the
- normal built-in types for the language we are compiling, except
- in cases where the types in question are *not* DWARF fundamental
- types. We make an exception in the case of non-fundamental types
- for the sake of Objective-C (and perhaps C++) because the GNU
- front-ends for these languages may in fact create certain "built-in"
- types which are (for example) RECORD_TYPEs. In such cases, we
- really need to output these (non-fundamental) types because other
- DIEs may contain references to them. */
-
- /* Also ignore language dependent types here, because they are probably
- also built-in types. If we didn't ignore them, then we would get
- references to undefined labels because output_type doesn't support
- them. So, for now, we need to ignore them to avoid assembler
- errors. */
-
- /* ??? This code is different than the equivalent code in dwarf2out.c.
- The dwarf2out.c code is probably more correct. */
-
- if (DECL_SOURCE_LINE (decl) == 0
- && (type_is_fundamental (TREE_TYPE (decl))
- || TREE_CODE (TREE_TYPE (decl)) == LANG_TYPE))
- return;
-
- /* If we are in terse mode, don't generate any DIEs to represent
- any actual typedefs. Note that even when we are in terse mode,
- we must still output DIEs to represent those tagged types which
- are used (directly or indirectly) in the specification of either
- a return type or a formal parameter type of some function. */
-
- if (debug_info_level <= DINFO_LEVEL_TERSE)
- if (! TYPE_DECL_IS_STUB (decl)
- || ! TYPE_USED_FOR_FUNCTION (TREE_TYPE (decl)))
- return;
-
- break;
-
- default:
- return;
- }
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
- finalizing = set_finalizing;
- output_decl (decl, NULL_TREE);
-
- /* NOTE: The call above to `output_decl' may have caused one or more
- file-scope named types (i.e. tagged types) to be placed onto the
- pending_types_list. We have to get those types off of that list
- at some point, and this is the perfect time to do it. If we didn't
- take them off now, they might still be on the list when cc1 finally
- exits. That might be OK if it weren't for the fact that when we put
- types onto the pending_types_list, we set the TREE_ASM_WRITTEN flag
- for these types, and that causes them never to be output unless
- `output_pending_types_for_scope' takes them off of the list and un-sets
- their TREE_ASM_WRITTEN flags. */
-
- output_pending_types_for_scope (NULL_TREE);
-
- /* The above call should have totally emptied the pending_types_list
- if this is not a nested function or class. If this is a nested type,
- then the remaining pending_types will be emitted when the containing type
- is handled. */
-
- if (! DECL_CONTEXT (decl))
- {
- if (pending_types != 0)
- abort ();
- }
-
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-}
-
-/* Output a marker (i.e. a label) for the beginning of the generated code
- for a lexical block. */
-
-static void
-dwarfout_begin_block (unsigned int line ATTRIBUTE_UNUSED,
- unsigned int blocknum)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- function_section (current_function_decl);
- sprintf (label, BLOCK_BEGIN_LABEL_FMT, blocknum);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-}
-
-/* Output a marker (i.e. a label) for the end of the generated code
- for a lexical block. */
-
-static void
-dwarfout_end_block (unsigned int line ATTRIBUTE_UNUSED, unsigned int blocknum)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- function_section (current_function_decl);
- sprintf (label, BLOCK_END_LABEL_FMT, blocknum);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-}
-
-/* Output a marker (i.e. a label) for the point in the generated code where
- the real body of the function begins (after parameters have been moved
- to their home locations). */
-
-static void
-dwarfout_end_prologue (unsigned int line ATTRIBUTE_UNUSED,
- const char *file ATTRIBUTE_UNUSED)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- if (! use_gnu_debug_info_extensions)
- return;
-
- function_section (current_function_decl);
- sprintf (label, BODY_BEGIN_LABEL_FMT, current_function_funcdef_no);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-}
-
-/* Output a marker (i.e. a label) for the point in the generated code where
- the real body of the function ends (just before the epilogue code). */
-
-static void
-dwarfout_end_function (unsigned int line ATTRIBUTE_UNUSED)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- if (! use_gnu_debug_info_extensions)
- return;
- function_section (current_function_decl);
- sprintf (label, BODY_END_LABEL_FMT, current_function_funcdef_no);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-}
-
-/* Output a marker (i.e. a label) for the absolute end of the generated code
- for a function definition. This gets called *after* the epilogue code
- has been generated. */
-
-static void
-dwarfout_end_epilogue (unsigned int line ATTRIBUTE_UNUSED,
- const char *file ATTRIBUTE_UNUSED)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- /* Output a label to mark the endpoint of the code generated for this
- function. */
-
- sprintf (label, FUNC_END_LABEL_FMT, current_function_funcdef_no);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-}
-
-static void
-shuffle_filename_entry (filename_entry *new_zeroth)
-{
- filename_entry temp_entry;
- filename_entry *limit_p;
- filename_entry *move_p;
-
- if (new_zeroth == &filename_table[0])
- return;
-
- temp_entry = *new_zeroth;
-
- /* Shift entries up in the table to make room at [0]. */
-
- limit_p = &filename_table[0];
- for (move_p = new_zeroth; move_p > limit_p; move_p--)
- *move_p = *(move_p-1);
-
- /* Install the found entry at [0]. */
-
- filename_table[0] = temp_entry;
-}
-
-/* Create a new (string) entry for the .debug_sfnames section. */
-
-static void
-generate_new_sfname_entry (void)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION);
- sprintf (label, SFNAMES_ENTRY_LABEL_FMT, filename_table[0].number);
- ASM_OUTPUT_LABEL (asm_out_file, label);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file,
- filename_table[0].name
- ? filename_table[0].name
- : "");
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-}
-
-/* Lookup a filename (in the list of filenames that we know about here in
- dwarfout.c) and return its "index". The index of each (known) filename
- is just a unique number which is associated with only that one filename.
- We need such numbers for the sake of generating labels (in the
- .debug_sfnames section) and references to those unique labels (in the
- .debug_srcinfo and .debug_macinfo sections).
-
- If the filename given as an argument is not found in our current list,
- add it to the list and assign it the next available unique index number.
-
- Whatever we do (i.e. whether we find a pre-existing filename or add a new
- one), we shuffle the filename found (or added) up to the zeroth entry of
- our list of filenames (which is always searched linearly). We do this so
- as to optimize the most common case for these filename lookups within
- dwarfout.c. The most common case by far is the case where we call
- lookup_filename to lookup the very same filename that we did a lookup
- on the last time we called lookup_filename. We make sure that this
- common case is fast because such cases will constitute 99.9% of the
- lookups we ever do (in practice).
-
- If we add a new filename entry to our table, we go ahead and generate
- the corresponding entry in the .debug_sfnames section right away.
- Doing so allows us to avoid tickling an assembler bug (present in some
- m68k assemblers) which yields assembly-time errors in cases where the
- difference of two label addresses is taken and where the two labels
- are in a section *other* than the one where the difference is being
- calculated, and where at least one of the two symbol references is a
- forward reference. (This bug could be tickled by our .debug_srcinfo
- entries if we don't output their corresponding .debug_sfnames entries
- before them.) */
-
-static unsigned
-lookup_filename (const char *file_name)
-{
- filename_entry *search_p;
- filename_entry *limit_p = &filename_table[ft_entries];
-
- for (search_p = filename_table; search_p < limit_p; search_p++)
- if (!strcmp (file_name, search_p->name))
- {
- /* When we get here, we have found the filename that we were
- looking for in the filename_table. Now we want to make sure
- that it gets moved to the zero'th entry in the table (if it
- is not already there) so that subsequent attempts to find the
- same filename will find it as quickly as possible. */
-
- shuffle_filename_entry (search_p);
- return filename_table[0].number;
- }
-
- /* We come here whenever we have a new filename which is not registered
- in the current table. Here we add it to the table. */
-
- /* 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 (ft_entries == ft_entries_allocated)
- {
- ft_entries_allocated += FT_ENTRIES_INCREMENT;
- filename_table
- = xrealloc (filename_table,
- ft_entries_allocated * sizeof (filename_entry));
- }
-
- /* Initially, add the new entry at the end of the filename table. */
-
- filename_table[ft_entries].number = ft_entries;
- filename_table[ft_entries].name = xstrdup (file_name);
-
- /* Shuffle the new entry into filename_table[0]. */
-
- shuffle_filename_entry (&filename_table[ft_entries]);
-
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- generate_new_sfname_entry ();
-
- ft_entries++;
- return filename_table[0].number;
-}
-
-static void
-generate_srcinfo_entry (unsigned int line_entry_num, unsigned int files_entry_num)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION);
- sprintf (label, LINE_ENTRY_LABEL_FMT, line_entry_num);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, LINE_BEGIN_LABEL);
- sprintf (label, SFNAMES_ENTRY_LABEL_FMT, files_entry_num);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, SFNAMES_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-}
-
-static void
-dwarfout_source_line (unsigned int line, const char *filename)
-{
- if (debug_info_level >= DINFO_LEVEL_NORMAL
- /* We can't emit line number info for functions in separate sections,
- because the assembler can't subtract labels in different sections. */
- && DECL_SECTION_NAME (current_function_decl) == NULL_TREE)
- {
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
- static unsigned last_line_entry_num = 0;
- static unsigned prev_file_entry_num = (unsigned) -1;
- unsigned this_file_entry_num;
-
- function_section (current_function_decl);
- sprintf (label, LINE_CODE_LABEL_FMT, ++last_line_entry_num);
- ASM_OUTPUT_LABEL (asm_out_file, label);
-
- fputc ('\n', asm_out_file);
-
- if (use_gnu_debug_info_extensions)
- this_file_entry_num = lookup_filename (filename);
- else
- this_file_entry_num = (unsigned) -1;
-
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION);
- if (this_file_entry_num != prev_file_entry_num)
- {
- char line_entry_label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- sprintf (line_entry_label, LINE_ENTRY_LABEL_FMT, last_line_entry_num);
- ASM_OUTPUT_LABEL (asm_out_file, line_entry_label);
- }
-
- {
- const char *tail = strrchr (filename, '/');
-
- if (tail != NULL)
- filename = tail;
- }
-
- dw2_asm_output_data (4, line, "%s:%u", filename, line);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0xffff);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, label, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (this_file_entry_num != prev_file_entry_num)
- generate_srcinfo_entry (last_line_entry_num, this_file_entry_num);
- prev_file_entry_num = this_file_entry_num;
- }
-}
-
-/* Generate an entry in the .debug_macinfo section. */
-
-static void
-generate_macinfo_entry (unsigned int type, rtx offset, const char *string)
-{
- if (! use_gnu_debug_info_extensions)
- return;
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION);
- assemble_integer (gen_rtx_PLUS (SImode, GEN_INT (type << 24), offset),
- 4, BITS_PER_UNIT, 1);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, string);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-}
-
-/* Wrapper for toplev.c callback to check debug info level. */
-static void
-dwarfout_start_source_file_check (unsigned int line, const char *filename)
-{
- if (debug_info_level == DINFO_LEVEL_VERBOSE)
- dwarfout_start_source_file (line, filename);
-}
-
-static void
-dwarfout_start_source_file (unsigned int line ATTRIBUTE_UNUSED,
- const char *filename)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
- const char *label1, *label2;
-
- sprintf (label, SFNAMES_ENTRY_LABEL_FMT, lookup_filename (filename));
- label1 = (*label == '*') + label;
- label2 = (*SFNAMES_BEGIN_LABEL == '*') + SFNAMES_BEGIN_LABEL;
- generate_macinfo_entry (MACINFO_start,
- gen_rtx_MINUS (Pmode,
- gen_rtx_SYMBOL_REF (Pmode, label1),
- gen_rtx_SYMBOL_REF (Pmode, label2)),
- "");
-}
-
-/* Wrapper for toplev.c callback to check debug info level. */
-static void
-dwarfout_end_source_file_check (unsigned int lineno)
-{
- if (debug_info_level == DINFO_LEVEL_VERBOSE)
- dwarfout_end_source_file (lineno);
-}
-
-static void
-dwarfout_end_source_file (unsigned int lineno)
-{
- generate_macinfo_entry (MACINFO_resume, GEN_INT (lineno), "");
-}
-
-/* Called from check_newline in c-parse.y. The `buffer' parameter
- contains the tail part of the directive line, i.e. the part which
- is past the initial whitespace, #, whitespace, directive-name,
- whitespace part. */
-
-static void
-dwarfout_define (unsigned int lineno, const char *buffer)
-{
- static int initialized = 0;
-
- if (!initialized)
- {
- dwarfout_start_source_file (0, primary_filename);
- initialized = 1;
- }
- generate_macinfo_entry (MACINFO_define, GEN_INT (lineno), buffer);
-}
-
-/* Called from check_newline in c-parse.y. The `buffer' parameter
- contains the tail part of the directive line, i.e. the part which
- is past the initial whitespace, #, whitespace, directive-name,
- whitespace part. */
-
-static void
-dwarfout_undef (unsigned int lineno, const char *buffer)
-{
- generate_macinfo_entry (MACINFO_undef, GEN_INT (lineno), buffer);
-}
-
-/* Set up for Dwarf output at the start of compilation. */
-
-static void
-dwarfout_init (const char *main_input_filename)
-{
- warning ("support for the DWARF1 debugging format is deprecated");
-
- /* Remember the name of the primary input file. */
-
- primary_filename = main_input_filename;
-
- /* Allocate the initial hunk of the pending_sibling_stack. */
-
- pending_sibling_stack
- = xmalloc (PENDING_SIBLINGS_INCREMENT * sizeof (unsigned));
- pending_siblings_allocated = PENDING_SIBLINGS_INCREMENT;
- pending_siblings = 1;
-
- /* Allocate the initial hunk of the filename_table. */
-
- filename_table = xmalloc (FT_ENTRIES_INCREMENT * sizeof (filename_entry));
- ft_entries_allocated = FT_ENTRIES_INCREMENT;
- ft_entries = 0;
-
- /* Allocate the initial hunk of the pending_types_list. */
-
- pending_types_list = xmalloc (PENDING_TYPES_INCREMENT * sizeof (tree));
- pending_types_allocated = PENDING_TYPES_INCREMENT;
- pending_types = 0;
-
- /* Create an artificial RECORD_TYPE node which we can use in our hack
- to get the DIEs representing types of formal parameters to come out
- only *after* the DIEs for the formal parameters themselves. */
-
- fake_containing_scope = make_node (RECORD_TYPE);
-
- /* Output a starting label for the .text section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, TEXT_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- /* Output a starting label for the .data section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, DATA_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
-#if 0 /* GNU C doesn't currently use .data1. */
- /* Output a starting label for the .data1 section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA1_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, DATA1_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-#endif
-
- /* Output a starting label for the .rodata section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, RODATA_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
-#if 0 /* GNU C doesn't currently use .rodata1. */
- /* Output a starting label for the .rodata1 section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA1_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, RODATA1_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-#endif
-
- /* Output a starting label for the .bss section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, BSS_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, BSS_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- {
- if (use_gnu_debug_info_extensions)
- {
- /* Output a starting label and an initial (compilation directory)
- entry for the .debug_sfnames section. The starting label will be
- referenced by the initial entry in the .debug_srcinfo section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SFNAMES_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, SFNAMES_BEGIN_LABEL);
- {
- const char *pwd = get_src_pwd ();
- char *dirname;
-
- if (!pwd)
- fatal_error ("can't get current directory: %m");
-
- dirname = concat (pwd, "/", NULL);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, dirname);
- free (dirname);
- }
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- if (debug_info_level >= DINFO_LEVEL_VERBOSE
- && use_gnu_debug_info_extensions)
- {
- /* Output a starting label for the .debug_macinfo section. This
- label will be referenced by the AT_mac_info attribute in the
- TAG_compile_unit DIE. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, MACINFO_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- /* Generate the initial entry for the .line section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, LINE_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, LINE_END_LABEL, LINE_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (use_gnu_debug_info_extensions)
- {
- /* Generate the initial entry for the .debug_srcinfo section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, SRCINFO_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, LINE_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, SFNAMES_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_END_LABEL);
-#ifdef DWARF_TIMESTAMPS
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, time (NULL));
-#else
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, -1);
-#endif
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- /* Generate the initial entry for the .debug_pubnames section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, DEBUG_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- /* Generate the initial entry for the .debug_aranges section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file,
- DEBUG_ARANGES_END_LABEL,
- DEBUG_ARANGES_BEGIN_LABEL);
- ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DATA1 (asm_out_file, 1);
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, DEBUG_BEGIN_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- /* Setup first DIE number == 1. */
- NEXT_DIE_NUM = next_unused_dienum++;
-
- /* Generate the initial DIE for the .debug section. Note that the
- (string) value given in the AT_name attribute of the TAG_compile_unit
- DIE will (typically) be a relative pathname and that this pathname
- should be taken as being relative to the directory from which the
- compiler was invoked when the given (base) source file was compiled. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, DEBUG_BEGIN_LABEL);
- output_die (output_compile_unit_die, (void *) main_input_filename);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- fputc ('\n', asm_out_file);
-}
-
-/* Output stuff that dwarf requires at the end of every file. */
-
-static void
-dwarfout_finish (const char *main_input_filename ATTRIBUTE_UNUSED)
-{
- char label[MAX_ARTIFICIAL_LABEL_BYTES];
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SECTION);
- retry_incomplete_types ();
- fputc ('\n', asm_out_file);
-
- /* Mark the end of the chain of siblings which represent all file-scope
- declarations in this compilation unit. */
-
- /* The (null) DIE which represents the terminator for the (sibling linked)
- list of file-scope items is *special*. Normally, we would just call
- end_sibling_chain at this point in order to output a word with the
- value `4' and that word would act as the terminator for the list of
- DIEs describing file-scope items. Unfortunately, if we were to simply
- do that, the label that would follow this DIE in the .debug section
- (i.e. `..D2') would *not* be properly aligned (as it must be on some
- machines) to a 4 byte boundary.
-
- In order to force the label `..D2' to get aligned to a 4 byte boundary,
- the trick used is to insert extra (otherwise useless) padding bytes
- into the (null) DIE that we know must precede the ..D2 label in the
- .debug section. The amount of padding required can be anywhere between
- 0 and 3 bytes. The length word at the start of this DIE (i.e. the one
- with the padding) would normally contain the value 4, but now it will
- also have to include the padding bytes, so it will instead have some
- value in the range 4..7.
-
- Fortunately, the rules of Dwarf say that any DIE whose length word
- contains *any* value less than 8 should be treated as a null DIE, so
- this trick works out nicely. Clever, eh? Don't give me any credit
- (or blame). I didn't think of this scheme. I just conformed to it.
- */
-
- output_die (output_padded_null_die, (void *) 0);
- dienum_pop ();
-
- sprintf (label, DIE_BEGIN_LABEL_FMT, NEXT_DIE_NUM);
- ASM_OUTPUT_LABEL (asm_out_file, label); /* should be ..D2 */
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- /* Output a terminator label for the .text section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, TEXT_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, TEXT_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- /* Output a terminator label for the .data section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, DATA_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
-#if 0 /* GNU C doesn't currently use .data1. */
- /* Output a terminator label for the .data1 section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DATA1_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, DATA1_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-#endif
-
- /* Output a terminator label for the .rodata section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, RODATA_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
-#if 0 /* GNU C doesn't currently use .rodata1. */
- /* Output a terminator label for the .rodata1 section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, RODATA1_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, RODATA1_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-#endif
-
- /* Output a terminator label for the .bss section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, BSS_SECTION_NAME);
- ASM_OUTPUT_LABEL (asm_out_file, BSS_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (debug_info_level >= DINFO_LEVEL_NORMAL)
- {
- /* Output a terminating entry for the .line section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, LINE_SECTION);
- ASM_OUTPUT_LABEL (asm_out_file, LINE_LAST_ENTRY_LABEL);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_DATA2 (asm_out_file, 0xffff);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, TEXT_END_LABEL, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_LABEL (asm_out_file, LINE_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- if (use_gnu_debug_info_extensions)
- {
- /* Output a terminating entry for the .debug_srcinfo section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_SRCINFO_SECTION);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file,
- LINE_LAST_ENTRY_LABEL, LINE_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, -1);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- if (debug_info_level >= DINFO_LEVEL_VERBOSE)
- {
- /* Output terminating entries for the .debug_macinfo section. */
-
- dwarfout_end_source_file (0);
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_MACINFO_SECTION);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- /* Generate the terminating entry for the .debug_pubnames section. */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_PUBNAMES_SECTION);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_STRING_NEWLINE (asm_out_file, "");
- ASM_OUTPUT_POP_SECTION (asm_out_file);
-
- /* Generate the terminating entries for the .debug_aranges section.
-
- Note that we want to do this only *after* we have output the end
- labels (for the various program sections) which we are going to
- refer to here. This allows us to work around a bug in the m68k
- svr4 assembler. That assembler gives bogus assembly-time errors
- if (within any given section) you try to take the difference of
- two relocatable symbols, both of which are located within some
- other section, and if one (or both?) of the symbols involved is
- being forward-referenced. By generating the .debug_aranges
- entries at this late point in the assembly output, we skirt the
- issue simply by avoiding forward-references.
- */
-
- fputc ('\n', asm_out_file);
- ASM_OUTPUT_PUSH_SECTION (asm_out_file, DEBUG_ARANGES_SECTION);
-
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, TEXT_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, TEXT_END_LABEL, TEXT_BEGIN_LABEL);
-
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, DATA_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, DATA_END_LABEL, DATA_BEGIN_LABEL);
-
-#if 0 /* GNU C doesn't currently use .data1. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, DATA1_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, DATA1_END_LABEL,
- DATA1_BEGIN_LABEL);
-#endif
-
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, RODATA_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, RODATA_END_LABEL,
- RODATA_BEGIN_LABEL);
-
-#if 0 /* GNU C doesn't currently use .rodata1. */
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, RODATA1_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, RODATA1_END_LABEL,
- RODATA1_BEGIN_LABEL);
-#endif
-
- ASM_OUTPUT_DWARF_ADDR (asm_out_file, BSS_BEGIN_LABEL);
- ASM_OUTPUT_DWARF_DELTA4 (asm_out_file, BSS_END_LABEL, BSS_BEGIN_LABEL);
-
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
- ASM_OUTPUT_DWARF_DATA4 (asm_out_file, 0);
-
- ASM_OUTPUT_LABEL (asm_out_file, DEBUG_ARANGES_END_LABEL);
- ASM_OUTPUT_POP_SECTION (asm_out_file);
- }
-
- /* There should not be any pending types left at the end. We need
- this now because it may not have been checked on the last call to
- dwarfout_file_scope_decl. */
- if (pending_types != 0)
- abort ();
-}
-
-#endif /* DWARF_DEBUGGING_INFO */
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 1f355e8a400..6558fa73fe9 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -77,7 +77,7 @@ static GTY(()) int label_num = 1;
static int last_label_num;
-/* Value label_num had when set_new_first_and_last_label_number was called.
+/* Value label_num had when set_new_last_label_num was called.
If label_num has not changed since then, last_label_num is valid. */
static int base_label_num;
@@ -180,7 +180,6 @@ static rtx make_jump_insn_raw (rtx);
static rtx make_call_insn_raw (rtx);
static rtx find_line_note (rtx);
static rtx change_address_1 (rtx, enum machine_mode, rtx, int);
-static void unshare_all_rtl_1 (rtx);
static void unshare_all_decls (tree);
static void reset_used_decls (tree);
static void mark_label_nuses (rtx);
@@ -199,6 +198,7 @@ static reg_attrs *get_reg_attrs (tree, int);
static tree component_ref_for_mem_expr (tree);
static rtx gen_const_vector_0 (enum machine_mode);
static rtx gen_complex_constant_part (enum machine_mode, rtx, int);
+static void copy_rtx_if_shared_1 (rtx *orig);
/* Probability of the conditional branch currently proceeded by try_split.
Set to -1 otherwise. */
@@ -971,7 +971,7 @@ mark_reg_pointer (rtx reg, int align)
REGNO_POINTER_ALIGN (REGNO (reg)) = align;
}
else if (align && align < REGNO_POINTER_ALIGN (REGNO (reg)))
- /* We can no-longer be sure just how aligned this pointer is */
+ /* We can no-longer be sure just how aligned this pointer is. */
REGNO_POINTER_ALIGN (REGNO (reg)) = align;
}
@@ -1323,7 +1323,7 @@ subreg_realpart_p (rtx x)
abort ();
return ((unsigned int) SUBREG_BYTE (x)
- < GET_MODE_UNIT_SIZE (GET_MODE (SUBREG_REG (x))));
+ < (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (SUBREG_REG (x))));
}
/* Assuming that X is an rtx (e.g., MEM, REG or SUBREG) for a value,
@@ -1356,6 +1356,8 @@ gen_lowpart (enum machine_mode mode, rtx x)
/* The following exposes the use of "x" to CSE. */
if (GET_MODE_SIZE (GET_MODE (x)) <= UNITS_PER_WORD
&& SCALAR_INT_MODE_P (GET_MODE (x))
+ && TRULY_NOOP_TRUNCATION (GET_MODE_BITSIZE (mode),
+ GET_MODE_BITSIZE (GET_MODE (x)))
&& ! no_new_pseudos)
return gen_lowpart (mode, force_reg (GET_MODE (x), x));
@@ -1389,7 +1391,7 @@ gen_highpart (enum machine_mode mode, rtx x)
/* This case loses if X is a subreg. To catch bugs early,
complain if an invalid MODE is used even in other cases. */
if (msize > UNITS_PER_WORD
- && msize != GET_MODE_UNIT_SIZE (GET_MODE (x)))
+ && msize != (unsigned int) GET_MODE_UNIT_SIZE (GET_MODE (x)))
abort ();
result = simplify_gen_subreg (mode, x, GET_MODE (x),
@@ -1825,6 +1827,8 @@ set_mem_attributes_minus_bitpos (rtx ref, tree t, int objectp,
return;
type = TYPE_P (t) ? t : TREE_TYPE (t);
+ if (type == error_mark_node)
+ return;
/* If we have already set DECL_RTL = ref, get_alias_set will get the
wrong answer, as it assumes that DECL_RTL already has the right alias
@@ -2402,17 +2406,6 @@ set_new_first_and_last_insn (rtx first, rtx last)
cur_insn_uid++;
}
-/* Set the range of label numbers found in the current function.
- This is used when belatedly compiling an inline function. */
-
-void
-set_new_first_and_last_label_num (int first, int last)
-{
- base_label_num = label_num;
- first_label_num = first;
- last_label_num = last;
-}
-
/* Set the last label number found in the current function.
This is used when belatedly compiling an inline function. */
@@ -2448,7 +2441,7 @@ unshare_all_rtl (tree fndecl, rtx insn)
unshare_all_decls (DECL_INITIAL (fndecl));
/* Unshare just about everything else. */
- unshare_all_rtl_1 (insn);
+ unshare_all_rtl_in_chain (insn);
/* Make sure the addresses of stack slots found outside the insn chain
(such as, in DECL_RTL of a variable) are not shared
@@ -2490,11 +2483,138 @@ unshare_all_rtl_again (rtx insn)
unshare_all_rtl (cfun->decl, insn);
}
+/* Check that ORIG is not marked when it should not be and mark ORIG as in use,
+ Recursively does the same for subexpressions. */
+
+static void
+verify_rtx_sharing (rtx orig, rtx insn)
+{
+ rtx x = orig;
+ int i;
+ enum rtx_code code;
+ const char *format_ptr;
+
+ if (x == 0)
+ return;
+
+ code = GET_CODE (x);
+
+ /* These types may be freely shared. */
+
+ switch (code)
+ {
+ case REG:
+ case QUEUED:
+ case CONST_INT:
+ case CONST_DOUBLE:
+ case CONST_VECTOR:
+ case SYMBOL_REF:
+ case LABEL_REF:
+ case CODE_LABEL:
+ case PC:
+ case CC0:
+ case SCRATCH:
+ /* SCRATCH must be shared because they represent distinct values. */
+ return;
+
+ case CONST:
+ /* CONST can be shared if it contains a SYMBOL_REF. If it contains
+ a LABEL_REF, it isn't sharable. */
+ if (GET_CODE (XEXP (x, 0)) == PLUS
+ && GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
+ && GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
+ return;
+ break;
+
+ case MEM:
+ /* A MEM is allowed to be shared if its address is constant. */
+ if (CONSTANT_ADDRESS_P (XEXP (x, 0))
+ || reload_completed || reload_in_progress)
+ return;
+
+ break;
+
+ default:
+ break;
+ }
+
+ /* This rtx may not be shared. If it has already been seen,
+ replace it with a copy of itself. */
+
+ if (RTX_FLAG (x, used))
+ {
+ error ("Invalid rtl sharing found in the insn");
+ debug_rtx (insn);
+ error ("Shared rtx");
+ debug_rtx (x);
+ abort ();
+ }
+ RTX_FLAG (x, used) = 1;
+
+ /* Now scan the subexpressions recursively. */
+
+ format_ptr = GET_RTX_FORMAT (code);
+
+ for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ {
+ switch (*format_ptr++)
+ {
+ case 'e':
+ verify_rtx_sharing (XEXP (x, i), insn);
+ break;
+
+ case 'E':
+ if (XVEC (x, i) != NULL)
+ {
+ int j;
+ int len = XVECLEN (x, i);
+
+ for (j = 0; j < len; j++)
+ {
+ /* We allow sharing of ASM_OPERANDS inside single instruction. */
+ if (j && GET_CODE (XVECEXP (x, i, j)) == SET
+ && GET_CODE (SET_SRC (XVECEXP (x, i, j))) == ASM_OPERANDS)
+ verify_rtx_sharing (SET_DEST (XVECEXP (x, i, j)), insn);
+ else
+ verify_rtx_sharing (XVECEXP (x, i, j), insn);
+ }
+ }
+ break;
+ }
+ }
+ return;
+}
+
+/* Go through all the RTL insn bodies and check that there is no unexpected
+ sharing in between the subexpressions. */
+
+void
+verify_rtl_sharing (void)
+{
+ rtx p;
+
+ for (p = get_insns (); p; p = NEXT_INSN (p))
+ if (INSN_P (p))
+ {
+ reset_used_flags (PATTERN (p));
+ reset_used_flags (REG_NOTES (p));
+ reset_used_flags (LOG_LINKS (p));
+ }
+
+ for (p = get_insns (); p; p = NEXT_INSN (p))
+ if (INSN_P (p))
+ {
+ verify_rtx_sharing (PATTERN (p), p);
+ verify_rtx_sharing (REG_NOTES (p), p);
+ verify_rtx_sharing (LOG_LINKS (p), p);
+ }
+}
+
/* Go through all the RTL insn bodies and copy any invalid shared structure.
Assumes the mark bits are cleared at entry. */
-static void
-unshare_all_rtl_1 (rtx insn)
+void
+unshare_all_rtl_in_chain (rtx insn)
{
for (; insn; insn = NEXT_INSN (insn))
if (INSN_P (insn))
@@ -2640,19 +2760,36 @@ copy_most_rtx (rtx orig, rtx may_share)
}
/* Mark ORIG as in use, and return a copy of it if it was already in use.
- Recursively does the same for subexpressions. */
+ Recursively does the same for subexpressions. Uses
+ copy_rtx_if_shared_1 to reduce stack space. */
rtx
copy_rtx_if_shared (rtx orig)
{
- rtx x = orig;
+ copy_rtx_if_shared_1 (&orig);
+ return orig;
+}
+
+/* Mark *ORIG1 as in use, and set it to a copy of it if it was already in
+ use. Recursively does the same for subexpressions. */
+
+static void
+copy_rtx_if_shared_1 (rtx *orig1)
+{
+ rtx x;
int i;
enum rtx_code code;
+ rtx *last_ptr;
const char *format_ptr;
int copied = 0;
+ int length;
+
+ /* Repeat is used to turn tail-recursion into iteration. */
+repeat:
+ x = *orig1;
if (x == 0)
- return 0;
+ return;
code = GET_CODE (x);
@@ -2666,12 +2803,13 @@ copy_rtx_if_shared (rtx orig)
case CONST_DOUBLE:
case CONST_VECTOR:
case SYMBOL_REF:
+ case LABEL_REF:
case CODE_LABEL:
case PC:
case CC0:
case SCRATCH:
/* SCRATCH must be shared because they represent distinct values. */
- return x;
+ return;
case CONST:
/* CONST can be shared if it contains a SYMBOL_REF. If it contains
@@ -2679,7 +2817,7 @@ copy_rtx_if_shared (rtx orig)
if (GET_CODE (XEXP (x, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (x, 0), 0)) == SYMBOL_REF
&& GET_CODE (XEXP (XEXP (x, 0), 1)) == CONST_INT)
- return x;
+ return;
break;
case INSN:
@@ -2688,21 +2826,7 @@ copy_rtx_if_shared (rtx orig)
case NOTE:
case BARRIER:
/* The chain of insns is not being copied. */
- return x;
-
- case MEM:
- /* A MEM is allowed to be shared if its address is constant.
-
- We used to allow sharing of MEMs which referenced
- virtual_stack_vars_rtx or virtual_incoming_args_rtx, but
- that can lose. instantiate_virtual_regs will not unshare
- the MEMs, and combine may change the structure of the address
- because it looks safe and profitable in one context, but
- in some other context it creates unrecognizable RTL. */
- if (CONSTANT_ADDRESS_P (XEXP (x, 0)))
- return x;
-
- break;
+ return;
default:
break;
@@ -2728,13 +2852,17 @@ copy_rtx_if_shared (rtx orig)
must be copied if X was copied. */
format_ptr = GET_RTX_FORMAT (code);
-
- for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ length = GET_RTX_LENGTH (code);
+ last_ptr = NULL;
+
+ for (i = 0; i < length; i++)
{
switch (*format_ptr++)
{
case 'e':
- XEXP (x, i) = copy_rtx_if_shared (XEXP (x, i));
+ if (last_ptr)
+ copy_rtx_if_shared_1 (last_ptr);
+ last_ptr = &XEXP (x, i);
break;
case 'E':
@@ -2742,16 +2870,30 @@ copy_rtx_if_shared (rtx orig)
{
int j;
int len = XVECLEN (x, i);
-
+
+ /* Copy the vector iff I copied the rtx and the length
+ is nonzero. */
if (copied && len > 0)
XVEC (x, i) = gen_rtvec_v (len, XVEC (x, i)->elem);
+
+ /* Call recsusively on all inside the vector. */
for (j = 0; j < len; j++)
- XVECEXP (x, i, j) = copy_rtx_if_shared (XVECEXP (x, i, j));
+ {
+ if (last_ptr)
+ copy_rtx_if_shared_1 (last_ptr);
+ last_ptr = &XVECEXP (x, i, j);
+ }
}
break;
}
}
- return x;
+ *orig1 = x;
+ if (last_ptr)
+ {
+ orig1 = last_ptr;
+ goto repeat;
+ }
+ return;
}
/* Clear all the USED bits in X to allow copy_rtx_if_shared to be used
@@ -2763,7 +2905,10 @@ reset_used_flags (rtx x)
int i, j;
enum rtx_code code;
const char *format_ptr;
+ int length;
+ /* Repeat is used to turn tail-recursion into iteration. */
+repeat:
if (x == 0)
return;
@@ -2801,11 +2946,18 @@ reset_used_flags (rtx x)
RTX_FLAG (x, used) = 0;
format_ptr = GET_RTX_FORMAT (code);
- for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ length = GET_RTX_LENGTH (code);
+
+ for (i = 0; i < length; i++)
{
switch (*format_ptr++)
{
case 'e':
+ if (i == length-1)
+ {
+ x = XEXP (x, i);
+ goto repeat;
+ }
reset_used_flags (XEXP (x, i));
break;
@@ -2816,6 +2968,69 @@ reset_used_flags (rtx x)
}
}
}
+
+/* Set all the USED bits in X to allow copy_rtx_if_shared to be used
+ to look for shared sub-parts. */
+
+void
+set_used_flags (rtx x)
+{
+ int i, j;
+ enum rtx_code code;
+ const char *format_ptr;
+
+ if (x == 0)
+ return;
+
+ code = GET_CODE (x);
+
+ /* These types may be freely shared so we needn't do any resetting
+ for them. */
+
+ switch (code)
+ {
+ case REG:
+ case QUEUED:
+ case CONST_INT:
+ case CONST_DOUBLE:
+ case CONST_VECTOR:
+ case SYMBOL_REF:
+ case CODE_LABEL:
+ case PC:
+ case CC0:
+ return;
+
+ case INSN:
+ case JUMP_INSN:
+ case CALL_INSN:
+ case NOTE:
+ case LABEL_REF:
+ case BARRIER:
+ /* The chain of insns is not being copied. */
+ return;
+
+ default:
+ break;
+ }
+
+ RTX_FLAG (x, used) = 1;
+
+ format_ptr = GET_RTX_FORMAT (code);
+ for (i = 0; i < GET_RTX_LENGTH (code); i++)
+ {
+ switch (*format_ptr++)
+ {
+ case 'e':
+ set_used_flags (XEXP (x, i));
+ break;
+
+ case 'E':
+ for (j = 0; j < XVECLEN (x, i); j++)
+ set_used_flags (XVECEXP (x, i, j));
+ break;
+ }
+ }
+}
/* Copy X if necessary so that it won't be altered by changes in OTHER.
Return X or the rtx for the pseudo reg the value of X was copied into.
@@ -3582,12 +3797,12 @@ add_insn_after (rtx insn, rtx after)
bb->flags |= BB_DIRTY;
/* Should not happen as first in the BB is always
either NOTE or LABEL. */
- if (bb->end == after
+ if (BB_END (bb) == after
/* Avoid clobbering of structure when creating new BB. */
&& GET_CODE (insn) != BARRIER
&& (GET_CODE (insn) != NOTE
|| NOTE_LINE_NUMBER (insn) != NOTE_INSN_BASIC_BLOCK))
- bb->end = insn;
+ BB_END (bb) = insn;
}
NEXT_INSN (after) = insn;
@@ -3650,7 +3865,7 @@ add_insn_before (rtx insn, rtx before)
bb->flags |= BB_DIRTY;
/* Should not happen as first in the BB is always
either NOTE or LABEl. */
- if (bb->head == insn
+ if (BB_HEAD (bb) == insn
/* Avoid clobbering of structure when creating new BB. */
&& GET_CODE (insn) != BARRIER
&& (GET_CODE (insn) != NOTE
@@ -3725,16 +3940,16 @@ remove_insn (rtx insn)
{
if (INSN_P (insn))
bb->flags |= BB_DIRTY;
- if (bb->head == insn)
+ if (BB_HEAD (bb) == insn)
{
/* Never ever delete the basic block note without deleting whole
basic block. */
if (GET_CODE (insn) == NOTE)
abort ();
- bb->head = next;
+ BB_HEAD (bb) = next;
}
- if (bb->end == insn)
- bb->end = prev;
+ if (BB_END (bb) == insn)
+ BB_END (bb) = prev;
}
}
@@ -3827,13 +4042,13 @@ reorder_insns (rtx from, rtx to, rtx after)
if (GET_CODE (from) != BARRIER
&& (bb2 = BLOCK_FOR_INSN (from)))
{
- if (bb2->end == to)
- bb2->end = prev;
+ if (BB_END (bb2) == to)
+ BB_END (bb2) = prev;
bb2->flags |= BB_DIRTY;
}
- if (bb->end == after)
- bb->end = to;
+ if (BB_END (bb) == after)
+ BB_END (bb) = to;
for (x = from; x != NEXT_INSN (to); x = NEXT_INSN (x))
set_block_for_insn (x, bb);
@@ -4222,8 +4437,8 @@ emit_insn_after_1 (rtx first, rtx after)
set_block_for_insn (last, bb);
if (GET_CODE (last) != BARRIER)
set_block_for_insn (last, bb);
- if (bb->end == after)
- bb->end = last;
+ if (BB_END (bb) == after)
+ BB_END (bb) = last;
}
else
for (last = first; NEXT_INSN (last); last = NEXT_INSN (last))
diff --git a/gcc/et-forest.c b/gcc/et-forest.c
index ffdce1d76bd..ea7793f83b3 100644
--- a/gcc/et-forest.c
+++ b/gcc/et-forest.c
@@ -30,638 +30,714 @@ Boston, MA 02111-1307, USA.
#include "et-forest.h"
#include "alloc-pool.h"
-struct et_forest_occurrence;
-typedef struct et_forest_occurrence* et_forest_occurrence_t;
+/* We do not enable this with ENABLE_CHECKING, since it is awfully slow. */
+#undef DEBUG_ET
-/* The ET-forest type. */
-struct et_forest
-{
- /* Linked list of nodes is used to destroy the structure. */
- int nnodes;
- alloc_pool node_pool;
- alloc_pool occur_pool;
-};
+#ifdef DEBUG_ET
+#include "basic-block.h"
+#endif
-/* Single occurrence of node in ET-forest.
- A single node may have multiple occurrences.
- */
-struct et_forest_occurrence
+/* The occurence of a node in the et tree. */
+struct et_occ
{
- /* Parent in the splay-tree. */
- et_forest_occurrence_t parent;
+ struct et_node *of; /* The node. */
+
+ struct et_occ *parent; /* Parent in the splay-tree. */
+ struct et_occ *prev; /* Left son in the splay-tree. */
+ struct et_occ *next; /* Right son in the splay-tree. */
+
+ int depth; /* The depth of the node is the sum of depth
+ fields on the path to the root. */
+ int min; /* The minimum value of the depth in the subtree
+ is obtained by adding sum of depth fields
+ on the path to the root. */
+ struct et_occ *min_occ; /* The occurence in the subtree with the minimal
+ depth. */
+};
- /* Children in the splay-tree. */
- et_forest_occurrence_t left, right;
+static alloc_pool et_nodes;
+static alloc_pool et_occurences;
- /* Counts of vertices in the two splay-subtrees. */
- int count_left, count_right;
+/* Changes depth of OCC to D. */
- /* Next occurrence of this node in the sequence. */
- et_forest_occurrence_t next;
+static inline void
+set_depth (struct et_occ *occ, int d)
+{
+ if (!occ)
+ return;
- /* The node, which this occurrence is of. */
- et_forest_node_t node;
-};
+ occ->min += d - occ->depth;
+ occ->depth = d;
+}
+/* Adds D to the depth of OCC. */
-/* ET-forest node. */
-struct et_forest_node
+static inline void
+set_depth_add (struct et_occ *occ, int d)
{
- et_forest_t forest;
- void *value;
-
- /* First and last occurrence of this node in the sequence. */
- et_forest_occurrence_t first, last;
-};
+ if (!occ)
+ return;
+ occ->min += d;
+ occ->depth += d;
+}
-static et_forest_occurrence_t splay (et_forest_occurrence_t);
-static void remove_all_occurrences (et_forest_t, et_forest_node_t);
-static inline et_forest_occurrence_t find_leftmost_node
- (et_forest_occurrence_t);
-static inline et_forest_occurrence_t find_rightmost_node
- (et_forest_occurrence_t);
-static int calculate_value (et_forest_occurrence_t);
+/* Sets prev field of OCC to P. */
-/* Return leftmost node present in the tree roted by OCC. */
-static inline et_forest_occurrence_t
-find_leftmost_node (et_forest_occurrence_t occ)
+static inline void
+set_prev (struct et_occ *occ, struct et_occ *t)
{
- while (occ->left)
- occ = occ->left;
+#ifdef DEBUG_ET
+ if (occ == t)
+ abort ();
+#endif
- return occ;
+ occ->prev = t;
+ if (t)
+ t->parent = occ;
}
-/* Return rightmost node present in the tree roted by OCC. */
-static inline et_forest_occurrence_t
-find_rightmost_node (et_forest_occurrence_t occ)
+/* Sets next field of OCC to P. */
+
+static inline void
+set_next (struct et_occ *occ, struct et_occ *t)
{
- while (occ->right)
- occ = occ->right;
- return occ;
+#ifdef DEBUG_ET
+ if (occ == t)
+ abort ();
+#endif
+
+ occ->next = t;
+ if (t)
+ t->parent = occ;
}
+/* Recompute minimum for occurence OCC. */
-/* Operation splay for splay tree structure representing occurrences. */
-static et_forest_occurrence_t
-splay (et_forest_occurrence_t node)
+static inline void
+et_recomp_min (struct et_occ *occ)
{
- et_forest_occurrence_t parent;
- et_forest_occurrence_t grandparent;
+ struct et_occ *mson = occ->prev;
- while (1)
- {
- parent = node->parent;
+ if (!mson
+ || (occ->next
+ && mson->min > occ->next->min))
+ mson = occ->next;
- if (! parent)
- return node; /* node == root. */
+ if (mson && mson->min < 0)
+ {
+ occ->min = mson->min + occ->depth;
+ occ->min_occ = mson->min_occ;
+ }
+ else
+ {
+ occ->min = occ->depth;
+ occ->min_occ = occ;
+ }
+}
- grandparent = parent->parent;
+#ifdef DEBUG_ET
+/* Checks whether neighbourhood of OCC seems sane. */
- if (! grandparent)
- break;
+static void
+et_check_occ_sanity (struct et_occ *occ)
+{
+ if (!occ)
+ return;
- /* Now there are four possible combinations: */
+ if (occ->parent == occ)
+ abort ();
- if (node == parent->left)
- {
- if (parent == grandparent->left)
- {
- et_forest_occurrence_t node1, node2;
- int count1, count2;
-
- node1 = node->right;
- count1 = node->count_right;
- node2 = parent->right;
- count2 = parent->count_right;
-
- grandparent->left = node2;
- grandparent->count_left = count2;
- if (node2)
- node2->parent = grandparent;
- parent->left = node1;
- parent->count_left = count1;
- if (node1)
- node1->parent = parent;
- parent->right = grandparent;
- parent->count_right = count2 + grandparent->count_right + 1;
- node->right = parent;
- node->count_right = count1 + parent->count_right + 1;
-
- node->parent = grandparent->parent;
- parent->parent = node;
- grandparent->parent = parent;
-
- if (node->parent)
- {
- if (node->parent->left == grandparent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
- }
- else
- {
- /* parent == grandparent->right && node == parent->left*/
- et_forest_occurrence_t node1, node2;
- int count1, count2;
-
- node1 = node->left;
- count1 = node->count_left;
- node2 = node->right;
- count2 = node->count_right;
-
- grandparent->right = node1;
- grandparent->count_right = count1;
- if (node1)
- node1->parent = grandparent;
- parent->left = node2;
- parent->count_left = count2;
- if (node2)
- node2->parent = parent;
- node->left = grandparent;
- node->count_left = grandparent->count_left + count1 + 1;
- node->right = parent;
- node->count_right = parent->count_right + count2 + 1;
-
- node->parent = grandparent->parent;
- parent->parent = node;
- grandparent->parent = node;
-
- if (node->parent)
- {
- if (node->parent->left == grandparent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
- }
- }
- else
- {
- /* node == parent->right. */
- if (parent == grandparent->left)
- {
- et_forest_occurrence_t node1, node2;
- int count1, count2;
-
- node1 = node->left;
- count1 = node->count_left;
- node2 = node->right;
- count2 = node->count_right;
-
- parent->right = node1;
- parent->count_right = count1;
- if (node1)
- node1->parent = parent;
- grandparent->left = node2;
- grandparent->count_left = count2;
- if (node2)
- node2->parent = grandparent;
- node->left = parent;
- node->count_left = parent->count_left + count1 + 1;
- node->right = grandparent;
- node->count_right = grandparent->count_right + count2 + 1;
-
- node->parent = grandparent->parent;
- parent->parent = node;
- grandparent->parent = node;
-
- if (node->parent)
- {
- if (node->parent->left == grandparent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
- }
- else
- {
- /* parent == grandparent->right && node == parent->right*/
- et_forest_occurrence_t node1, node2;
- int count1, count2;
-
- node1 = node->left;
- count1 = node->count_left;
- node2 = parent->left;
- count2 = parent->count_left;
-
- grandparent->right = node2;
- grandparent->count_right = count2;
- if (node2)
- node2->parent = grandparent;
- parent->right = node1;
- parent->count_right = count1;
- if (node1)
- node1->parent = parent;
- parent->left = grandparent;
- parent->count_left = count2 + grandparent->count_left + 1;
- node->left = parent;
- node->count_left = count1 + parent->count_left + 1;
-
- node->parent = grandparent->parent;
- parent->parent = node;
- grandparent->parent = parent;
-
- if (node->parent)
- {
- if (node->parent->left == grandparent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
- }
- }
+ if (occ->prev == occ)
+ abort ();
- }
+ if (occ->next == occ)
+ abort ();
- /* parent == root. */
- /* There are two possible combinations: */
+ if (occ->next && occ->next == occ->prev)
+ abort ();
- if (node == parent->left)
+ if (occ->next)
{
- et_forest_occurrence_t node1;
- int count1;
-
- node1 = node->right;
- count1 = node->count_right;
-
- parent->left = node1;
- parent->count_left = count1;
- if (node1)
- node1->parent = parent;
- node->right = parent;
- node->count_right = parent->count_right + 1 + count1;
- node->parent = parent->parent; /* the same as = 0; */
- parent->parent = node;
-
- if (node->parent)
- {
- if (node->parent->left == parent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
+ if (occ->next == occ->parent)
+ abort ();
+
+ if (occ->next->parent != occ)
+ abort ();
}
- else
+
+ if (occ->prev)
{
- /* node == parent->right. */
- et_forest_occurrence_t node1;
- int count1;
-
- node1 = node->left;
- count1 = node->count_left;
-
- parent->right = node1;
- parent->count_right = count1;
- if (node1)
- node1->parent = parent;
- node->left = parent;
- node->count_left = parent->count_left + 1 + count1;
- node->parent = parent->parent; /* the same as = 0; */
- parent->parent = node;
-
- if (node->parent)
- {
- if (node->parent->left == parent)
- node->parent->left = node;
- else
- node->parent->right = node;
- }
+ if (occ->prev == occ->parent)
+ abort ();
+
+ if (occ->prev->parent != occ)
+ abort ();
}
- return node;
+ if (occ->parent
+ && occ->parent->prev != occ
+ && occ->parent->next != occ)
+ abort ();
}
-/* Remove all occurrences of the given node before destroying the node. */
+/* Checks whether tree rooted at OCC is sane. */
+
static void
-remove_all_occurrences (et_forest_t forest, et_forest_node_t forest_node)
+et_check_sanity (struct et_occ *occ)
{
- et_forest_occurrence_t first = forest_node->first;
- et_forest_occurrence_t last = forest_node->last;
- et_forest_occurrence_t node;
+ et_check_occ_sanity (occ);
+ if (occ->prev)
+ et_check_sanity (occ->prev);
+ if (occ->next)
+ et_check_sanity (occ->next);
+}
- splay (first);
+/* Checks whether tree containing OCC is sane. */
- if (first->left)
- first->left->parent = 0;
- if (first->right)
- first->right->parent = 0;
+static void
+et_check_tree_sanity (struct et_occ *occ)
+{
+ while (occ->parent)
+ occ = occ->parent;
- if (last != first)
- {
- splay (last);
+ et_check_sanity (occ);
+}
- if (last->left)
- last->left->parent = 0;
- if (last->right)
- last->right->parent = 0;
- }
+/* For recording the paths. */
- if (last->right && first->left) /* actually, first->left would suffice. */
- {
- /* Need to join them. */
- et_forest_occurrence_t prev_node, next_node;
-
- prev_node = splay (find_rightmost_node (first->left));
- next_node = splay (find_leftmost_node (last->right));
- /* prev_node and next_node are consecutive occurrences
- of the same node. */
- if (prev_node->next != next_node)
- abort ();
+static int len;
+static void *datas[100000];
+static int depths[100000];
- prev_node->right = next_node->right;
- prev_node->count_right = next_node->count_right;
- prev_node->next = next_node->next;
- if (prev_node->right)
- prev_node->right->parent = prev_node;
+/* Records the path represented by OCC, with depth incremented by DEPTH. */
- if (prev_node->node->last == next_node)
- prev_node->node->last = prev_node;
+static int
+record_path_before_1 (struct et_occ *occ, int depth)
+{
+ int mn, m;
- pool_free (forest->occur_pool, next_node);
+ depth += occ->depth;
+ mn = depth;
+
+ if (occ->prev)
+ {
+ m = record_path_before_1 (occ->prev, depth);
+ if (m < mn)
+ mn = m;
}
- if (first != last)
+ fprintf (stderr, "%d (%d); ", ((basic_block) occ->of->data)->index, depth);
+ depths[len] = depth;
+ datas[len] = occ->of;
+ len++;
+
+ if (occ->next)
{
- node = first->next;
+ m = record_path_before_1 (occ->next, depth);
+ if (m < mn)
+ mn = m;
+ }
- while (node != last)
- {
- et_forest_occurrence_t next_node;
+ if (mn != occ->min + depth - occ->depth)
+ abort ();
- splay (node);
+ return mn;
+}
- if (node->left)
- node->left->parent = 0;
- if (node->right)
- node->right->parent = 0;
+/* Records the path represented by a tree containing OCC. */
- next_node = node->next;
- pool_free (forest->occur_pool, node);
- node = next_node;
- }
- }
+static void
+record_path_before (struct et_occ *occ)
+{
+ while (occ->parent)
+ occ = occ->parent;
- pool_free (forest->occur_pool, first);
- if (first != last)
- pool_free (forest->occur_pool, last);
+ len = 0;
+ record_path_before_1 (occ, 0);
+ fprintf (stderr, "\n");
}
-/* Calculate ET value of the given node. */
-static inline int
-calculate_value (et_forest_occurrence_t node)
+/* Checks whether the path represented by OCC, with depth incremented by DEPTH,
+ was not changed since the last recording. */
+
+static int
+check_path_after_1 (struct et_occ *occ, int depth)
{
- int value = node->count_left;
+ int mn, m;
+
+ depth += occ->depth;
+ mn = depth;
- while (node->parent)
+ if (occ->next)
{
- if (node == node->parent->right)
- value += node->parent->count_left + 1;
+ m = check_path_after_1 (occ->next, depth);
+ if (m < mn)
+ mn = m;
+ }
- node = node->parent;
+ len--;
+ if (depths[len] != depth
+ || datas[len] != occ->of)
+ abort ();
+
+ if (occ->prev)
+ {
+ m = check_path_after_1 (occ->prev, depth);
+ if (m < mn)
+ mn = m;
}
- return value;
+ if (mn != occ->min + depth - occ->depth)
+ abort ();
+
+ return mn;
}
+/* Checks whether the path represented by a tree containing OCC was
+ not changed since the last recording. */
+
+static void
+check_path_after (struct et_occ *occ)
+{
+ while (occ->parent)
+ occ = occ->parent;
+
+ check_path_after_1 (occ, 0);
+ if (len != 0)
+ abort ();
+}
+#endif
+/* Splay the occurence OCC to the root of the tree. */
-/* Create ET-forest structure. */
-et_forest_t
-et_forest_create (void)
+static inline void
+et_splay (struct et_occ *occ)
{
- et_forest_t forest = xmalloc (sizeof (struct et_forest));
+ struct et_occ *f, *gf, *ggf;
+ int occ_depth, f_depth, gf_depth;
+
+#ifdef DEBUG_ET
+ record_path_before (occ);
+ et_check_tree_sanity (occ);
+#endif
+
+ while (occ->parent)
+ {
+ occ_depth = occ->depth;
- forest->nnodes = 0;
- forest->occur_pool = create_alloc_pool ("et_forest_occurrence pool", sizeof (struct et_forest_occurrence), 300);
- forest->node_pool = create_alloc_pool ("et_forest_node pool", sizeof (struct et_forest_node), 300);
- return forest;
-}
+ f = occ->parent;
+ f_depth = f->depth;
+ gf = f->parent;
+ if (!gf)
+ {
+ set_depth_add (occ, f_depth);
+ occ->min_occ = f->min_occ;
+ occ->min = f->min;
-/* Deallocate the structure. */
-void
-et_forest_delete (et_forest_t forest)
+ if (f->prev == occ)
+ {
+ /* zig */
+ set_prev (f, occ->next);
+ set_next (occ, f);
+ set_depth_add (f->prev, occ_depth);
+ }
+ else
+ {
+ /* zag */
+ set_next (f, occ->prev);
+ set_prev (occ, f);
+ set_depth_add (f->next, occ_depth);
+ }
+ set_depth (f, -occ_depth);
+ occ->parent = NULL;
+
+ et_recomp_min (f);
+#ifdef DEBUG_ET
+ et_check_tree_sanity (occ);
+ check_path_after (occ);
+#endif
+ return;
+ }
+
+ gf_depth = gf->depth;
+
+ set_depth_add (occ, f_depth + gf_depth);
+ occ->min_occ = gf->min_occ;
+ occ->min = gf->min;
+
+ ggf = gf->parent;
+
+ if (gf->prev == f)
+ {
+ if (f->prev == occ)
+ {
+ /* zig zig */
+ set_prev (gf, f->next);
+ set_prev (f, occ->next);
+ set_next (occ, f);
+ set_next (f, gf);
+
+ set_depth (f, -occ_depth);
+ set_depth_add (f->prev, occ_depth);
+ set_depth (gf, -f_depth);
+ set_depth_add (gf->prev, f_depth);
+ }
+ else
+ {
+ /* zag zig */
+ set_prev (gf, occ->next);
+ set_next (f, occ->prev);
+ set_prev (occ, f);
+ set_next (occ, gf);
+
+ set_depth (f, -occ_depth);
+ set_depth_add (f->next, occ_depth);
+ set_depth (gf, -occ_depth - f_depth);
+ set_depth_add (gf->prev, occ_depth + f_depth);
+ }
+ }
+ else
+ {
+ if (f->prev == occ)
+ {
+ /* zig zag */
+ set_next (gf, occ->prev);
+ set_prev (f, occ->next);
+ set_prev (occ, gf);
+ set_next (occ, f);
+
+ set_depth (f, -occ_depth);
+ set_depth_add (f->prev, occ_depth);
+ set_depth (gf, -occ_depth - f_depth);
+ set_depth_add (gf->next, occ_depth + f_depth);
+ }
+ else
+ {
+ /* zag zag */
+ set_next (gf, f->prev);
+ set_next (f, occ->prev);
+ set_prev (occ, f);
+ set_prev (f, gf);
+
+ set_depth (f, -occ_depth);
+ set_depth_add (f->next, occ_depth);
+ set_depth (gf, -f_depth);
+ set_depth_add (gf->next, f_depth);
+ }
+ }
+
+ occ->parent = ggf;
+ if (ggf)
+ {
+ if (ggf->prev == gf)
+ ggf->prev = occ;
+ else
+ ggf->next = occ;
+ }
+
+ et_recomp_min (gf);
+ et_recomp_min (f);
+#ifdef DEBUG_ET
+ et_check_tree_sanity (occ);
+#endif
+ }
+
+#ifdef DEBUG_ET
+ et_check_sanity (occ);
+ check_path_after (occ);
+#endif
+}
+
+/* Create a new et tree occurence of NODE. */
+
+static struct et_occ *
+et_new_occ (struct et_node *node)
{
- if (forest->nnodes)
- abort ();
- free_alloc_pool (forest->occur_pool);
- free_alloc_pool (forest->node_pool);
- free (forest);
+ struct et_occ *nw;
+
+ if (!et_occurences)
+ et_occurences = create_alloc_pool ("et_occ pool", sizeof (struct et_occ), 300);
+ nw = pool_alloc (et_occurences);
+
+ nw->of = node;
+ nw->parent = NULL;
+ nw->prev = NULL;
+ nw->next = NULL;
+
+ nw->depth = 0;
+ nw->min_occ = nw;
+ nw->min = 0;
+
+ return nw;
}
-/* Create new node with VALUE and return the edge.
- Return NULL when memory allocation failed. */
-et_forest_node_t
-et_forest_add_node (et_forest_t forest, void *value)
+/* Create a new et tree containing DATA. */
+
+struct et_node *
+et_new_tree (void *data)
{
- /* Create node with one occurrence. */
- et_forest_node_t node;
- et_forest_occurrence_t occ;
-
- node = pool_alloc (forest->node_pool);
- occ = pool_alloc (forest->occur_pool);
-
- node->first = node->last = occ;
- node->value = value;
- forest->nnodes++;
-
- occ->node = node;
- occ->left = occ->right = occ->parent = 0;
- occ->next = 0;
- occ->count_left = occ->count_right = 0;
- return node;
+ struct et_node *nw;
+
+ if (!et_nodes)
+ et_nodes = create_alloc_pool ("et_node pool", sizeof (struct et_node), 300);
+ nw = pool_alloc (et_nodes);
+
+ nw->data = data;
+ nw->father = NULL;
+ nw->left = NULL;
+ nw->right = NULL;
+ nw->son = NULL;
+
+ nw->rightmost_occ = et_new_occ (nw);
+ nw->parent_occ = NULL;
+
+ return nw;
}
-/* Add new edge to the tree, return 1 if successful.
- 0 indicates that creation of the edge will close the cycle in graph. */
-int
-et_forest_add_edge (et_forest_t forest ATTRIBUTE_UNUSED,
- et_forest_node_t parent_node, et_forest_node_t child_node)
+/* Releases et tree T. */
+
+void
+et_free_tree (struct et_node *t)
{
- et_forest_occurrence_t new_occ, parent_occ, child_occ;
+ while (t->son)
+ et_split (t->son);
- if (! parent_node || ! child_node)
- abort ();
+ if (t->father)
+ et_split (t);
- parent_occ = parent_node->first;
- child_occ = child_node->first;
-
- splay (parent_occ);
- splay (child_occ);
-
- if (parent_occ->parent)
- return 0; /* Both child and parent are in the same tree. */
-
- if (child_occ->left)
- abort (); /* child must be root of its containing tree. */
-
- new_occ = pool_alloc (forest->occur_pool);
-
- new_occ->node = parent_node;
- new_occ->left = child_occ;
- new_occ->count_left = child_occ->count_right + 1; /* count_left is 0. */
- new_occ->right = parent_occ->right;
- new_occ->count_right = parent_occ->count_right;
- new_occ->parent = parent_occ;
- new_occ->next = parent_occ->next;
- child_occ->parent = new_occ;
- parent_occ->right = new_occ;
- parent_occ->count_right = new_occ->count_left + new_occ->count_right + 1;
- parent_occ->next = new_occ;
- if (new_occ->right)
- new_occ->right->parent = new_occ;
-
- if (parent_node->last == parent_occ)
- parent_node->last = new_occ;
- return 1;
+ pool_free (et_occurences, t->rightmost_occ);
+ pool_free (et_nodes, t);
}
-/* Remove NODE from the tree and all connected edges. */
+/* Sets father of et tree T to FATHER. */
+
void
-et_forest_remove_node (et_forest_t forest, et_forest_node_t node)
+et_set_father (struct et_node *t, struct et_node *father)
{
- remove_all_occurrences (forest, node);
- forest->nnodes--;
+ struct et_node *left, *right;
+ struct et_occ *rmost, *left_part, *new_f_occ, *p;
- pool_free (forest->node_pool, node);
-}
+ /* Update the path represented in the splay tree. */
+ new_f_occ = et_new_occ (father);
-/* Remove edge from the tree, return 1 if successful,
- 0 indicates nonexisting edge. */
-int
-et_forest_remove_edge (et_forest_t forest ATTRIBUTE_UNUSED,
- et_forest_node_t parent_node,
- et_forest_node_t child_node)
-{
- et_forest_occurrence_t parent_pre_occ, parent_post_occ;
+ rmost = father->rightmost_occ;
+ et_splay (rmost);
- splay (child_node->first);
+ left_part = rmost->prev;
- if (! child_node->first->left)
- return 0;
+ p = t->rightmost_occ;
+ et_splay (p);
- parent_pre_occ = find_rightmost_node (child_node->first->left);
- if (parent_pre_occ->node != parent_node)
- abort ();
+ set_prev (new_f_occ, left_part);
+ set_next (new_f_occ, p);
+
+ p->depth++;
+ p->min++;
+ et_recomp_min (new_f_occ);
- splay (parent_pre_occ);
- parent_pre_occ->right->parent = 0;
+ set_prev (rmost, new_f_occ);
- parent_post_occ = parent_pre_occ->next;
- splay (parent_post_occ);
+ if (new_f_occ->min + rmost->depth < rmost->min)
+ {
+ rmost->min = new_f_occ->min + rmost->depth;
+ rmost->min_occ = new_f_occ->min_occ;
+ }
- parent_post_occ->left->parent = 0;
+ t->parent_occ = new_f_occ;
- parent_pre_occ->right = parent_post_occ->right;
- parent_pre_occ->count_right = parent_post_occ->count_right;
- if (parent_post_occ->right)
- parent_post_occ->right->parent = parent_pre_occ;
+ /* Update the tree. */
+ t->father = father;
+ right = father->son;
+ if (right)
+ left = right->left;
+ else
+ left = right = t;
- parent_pre_occ->next = parent_post_occ->next;
+ left->right = t;
+ right->left = t;
+ t->left = left;
+ t->right = right;
- if (parent_post_occ == parent_node->last)
- parent_node->last = parent_pre_occ;
+ father->son = t;
- pool_free (forest->occur_pool, parent_post_occ);
- return 1;
+#ifdef DEBUG_ET
+ et_check_tree_sanity (rmost);
+ record_path_before (rmost);
+#endif
}
-/* Return the parent of the NODE if any, NULL otherwise. */
-et_forest_node_t
-et_forest_parent (et_forest_t forest ATTRIBUTE_UNUSED, et_forest_node_t node)
+/* Splits the edge from T to its father. */
+
+void
+et_split (struct et_node *t)
{
- splay (node->first);
+ struct et_node *father = t->father;
+ struct et_occ *r, *l, *rmost, *p_occ;
- if (node->first->left)
- return find_rightmost_node (node->first->left)->node;
- else
- return 0;
-}
+ /* Update the path represented by the splay tree. */
+ rmost = t->rightmost_occ;
+ et_splay (rmost);
+ for (r = rmost->next; r->prev; r = r->prev)
+ continue;
+ et_splay (r);
-/* Return nearest common ancestor of NODE1 and NODE2.
- Return NULL of they are in different trees. */
-et_forest_node_t
-et_forest_common_ancestor (et_forest_t forest ATTRIBUTE_UNUSED,
- et_forest_node_t node1, et_forest_node_t node2)
-{
- int value1, value2, max_value;
- et_forest_node_t ancestor;
+ r->prev->parent = NULL;
+ p_occ = t->parent_occ;
+ et_splay (p_occ);
+ t->parent_occ = NULL;
- if (node1 == node2)
- return node1;
+ l = p_occ->prev;
+ p_occ->next->parent = NULL;
- if (! node1 || ! node2)
- abort ();
+ set_prev (r, l);
- splay (node1->first);
- splay (node2->first);
+ et_recomp_min (r);
- if (! node1->first->parent) /* The two vertices are in different trees. */
- return 0;
+ et_splay (rmost);
+ rmost->depth = 0;
+ rmost->min = 0;
- value2 = calculate_value (node2->first);
- value1 = calculate_value (node1->first);
+ pool_free (et_occurences, p_occ);
- if (value1 < value2)
+ /* Update the tree. */
+ if (father->son == t)
+ father->son = t->right;
+ if (father->son == t)
+ father->son = NULL;
+ else
{
- ancestor = node1;
- max_value = value2;
+ t->left->right = t->right;
+ t->right->left = t->left;
+ }
+ t->left = t->right = NULL;
+ t->father = NULL;
+
+#ifdef DEBUG_ET
+ et_check_tree_sanity (rmost);
+ record_path_before (rmost);
+
+ et_check_tree_sanity (r);
+ record_path_before (r);
+#endif
+}
+
+/* Finds the nearest common ancestor of the nodes N1 and N2. */
+
+struct et_node *
+et_nca (struct et_node *n1, struct et_node *n2)
+{
+ struct et_occ *o1 = n1->rightmost_occ, *o2 = n2->rightmost_occ, *om;
+ struct et_occ *l, *r, *ret;
+ int mn;
+
+ if (n1 == n2)
+ return n1;
+
+ et_splay (o1);
+ l = o1->prev;
+ r = o1->next;
+ if (l)
+ l->parent = NULL;
+ if (r)
+ r->parent = NULL;
+ et_splay (o2);
+
+ if (l == o2 || (l && l->parent != NULL))
+ {
+ ret = o2->next;
+
+ set_prev (o1, o2);
+ if (r)
+ r->parent = o1;
}
else
{
- ancestor = node2;
- max_value = value1;
+ ret = o2->prev;
+
+ set_next (o1, o2);
+ if (l)
+ l->parent = o1;
}
- while (calculate_value (ancestor->last) < max_value)
+ if (0 < o2->depth)
{
- /* Find parent node. */
- splay (ancestor->first);
- ancestor = find_rightmost_node (ancestor->first->left) ->node;
+ om = o1;
+ mn = o1->depth;
+ }
+ else
+ {
+ om = o2;
+ mn = o2->depth + o1->depth;
}
- return ancestor;
-}
+#ifdef DEBUG_ET
+ et_check_tree_sanity (o2);
+#endif
-/* Return the value pointer of node set during it's creation. */
-void *
-et_forest_node_value (et_forest_t forest ATTRIBUTE_UNUSED,
- et_forest_node_t node)
-{
- /* Alloc threading NULL as a special node of the forest. */
- if (!node)
- return NULL;
- return node->value;
+ if (ret && ret->min + o1->depth + o2->depth < mn)
+ return ret->min_occ->of;
+ else
+ return om->of;
}
-/* Find all sons of NODE and store them into ARRAY allocated by the caller.
- Return number of nodes found. */
-int
-et_forest_enumerate_sons (et_forest_t forest ATTRIBUTE_UNUSED,
- et_forest_node_t node, et_forest_node_t *array)
+/* Checks whether the node UP is an ancestor of the node DOWN. */
+
+bool
+et_below (struct et_node *down, struct et_node *up)
{
- int n = 0;
- et_forest_occurrence_t occ = node->first, stop = node->last, occ1;
+ struct et_occ *u = up->rightmost_occ, *d = down->rightmost_occ;
+ struct et_occ *l, *r;
+
+ if (up == down)
+ return true;
+
+ et_splay (u);
+ l = u->prev;
+ r = u->next;
+
+ if (!l)
+ return false;
+
+ l->parent = NULL;
+
+ if (r)
+ r->parent = NULL;
- /* Parent is the rightmost node of the left successor.
- Look for all occurrences having no right successor
- and lookup the sons. */
- while (occ != stop)
+ et_splay (d);
+
+ if (l == d || l->parent != NULL)
{
- splay (occ);
- if (occ->right)
- {
- occ1 = find_leftmost_node (occ->right);
- if (occ1->node->first == occ1)
- array[n++] = occ1->node;
- }
- occ = occ->next;
+ if (r)
+ r->parent = u;
+ set_prev (u, d);
+#ifdef DEBUG_ET
+ et_check_tree_sanity (u);
+#endif
}
- return n;
+ else
+ {
+ l->parent = u;
+
+ /* In case O1 and O2 are in two different trees, we must just restore the
+ original state. */
+ if (r && r->parent != NULL)
+ set_next (u, d);
+ else
+ set_next (u, r);
+
+#ifdef DEBUG_ET
+ et_check_tree_sanity (u);
+#endif
+ return false;
+ }
+
+ if (0 >= d->depth)
+ return false;
+
+ return !d->next || d->next->min + d->depth >= 0;
}
diff --git a/gcc/et-forest.h b/gcc/et-forest.h
index 66aec4897c0..833146d6147 100644
--- a/gcc/et-forest.h
+++ b/gcc/et-forest.h
@@ -20,7 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
for tree operations (insertion and removal of nodes and edges) and
poly-logarithmic time for nearest common ancestor.
- ET tree stores its structue as a sequence of symbols obtained
+ ET tree stores its structure as a sequence of symbols obtained
by dfs(root)
dfs (node)
@@ -55,26 +55,28 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
extern "C" {
#endif /* __cplusplus */
-typedef struct et_forest *et_forest_t;
-typedef struct et_forest_node *et_forest_node_t;
-
-extern et_forest_t et_forest_create (void);
-
-extern void et_forest_delete (et_forest_t);
-
-extern et_forest_node_t et_forest_add_node (et_forest_t, void *);
-extern int et_forest_add_edge (et_forest_t, et_forest_node_t,
- et_forest_node_t);
-extern void et_forest_remove_node (et_forest_t, et_forest_node_t);
-extern int et_forest_remove_edge (et_forest_t, et_forest_node_t,
- et_forest_node_t);
-extern et_forest_node_t et_forest_parent (et_forest_t, et_forest_node_t);
-extern et_forest_node_t et_forest_common_ancestor (et_forest_t,
- et_forest_node_t,
- et_forest_node_t);
-extern void * et_forest_node_value (et_forest_t, et_forest_node_t);
-extern int et_forest_enumerate_sons (et_forest_t, et_forest_node_t,
- et_forest_node_t *);
+/* The node representing the node in an et tree. */
+struct et_node
+{
+ void *data; /* The data represented by the node. */
+
+ int dfs_num_in, dfs_num_out; /* Number of the node in the dfs ordering. */
+
+ struct et_node *father; /* Father of the node. */
+ struct et_node *son; /* The first of the sons of the node. */
+ struct et_node *left;
+ struct et_node *right; /* The brothers of the node. */
+
+ struct et_occ *rightmost_occ; /* The rightmost occurence. */
+ struct et_occ *parent_occ; /* The occurence of the parent node. */
+};
+
+struct et_node *et_new_tree (void *data);
+void et_free_tree (struct et_node *);
+void et_set_father (struct et_node *, struct et_node *);
+void et_split (struct et_node *);
+struct et_node *et_nca (struct et_node *, struct et_node *);
+bool et_below (struct et_node *, struct et_node *);
#ifdef __cplusplus
}
diff --git a/gcc/except.c b/gcc/except.c
index edbcda10cf4..5958eae290f 100644
--- a/gcc/except.c
+++ b/gcc/except.c
@@ -2047,8 +2047,12 @@ sjlj_emit_function_enter (rtx dispatch_label)
if (cfun->uses_eh_lsda)
{
char buf[20];
+ rtx sym;
+
ASM_GENERATE_INTERNAL_LABEL (buf, "LLSDA", current_function_funcdef_no);
- emit_move_insn (mem, gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf)));
+ sym = gen_rtx_SYMBOL_REF (Pmode, ggc_strdup (buf));
+ SYMBOL_REF_FLAGS (sym) = SYMBOL_FLAG_LOCAL;
+ emit_move_insn (mem, sym);
}
else
emit_move_insn (mem, const0_rtx);
diff --git a/gcc/explow.c b/gcc/explow.c
index 56f9a3ff04a..9e04bd896f9 100644
--- a/gcc/explow.c
+++ b/gcc/explow.c
@@ -444,7 +444,7 @@ memory_address (enum machine_mode mode, rtx x)
x = convert_memory_address (Pmode, x);
- /* By passing constant addresses thru registers
+ /* By passing constant addresses through registers
we get a chance to cse them. */
if (! cse_not_expected && CONSTANT_P (x) && CONSTANT_ADDRESS_P (x))
x = force_reg (Pmode, x);
diff --git a/gcc/expmed.c b/gcc/expmed.c
index cb30ff35db6..98a26a14c1e 100644
--- a/gcc/expmed.c
+++ b/gcc/expmed.c
@@ -326,17 +326,13 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
If the target is memory, storing any naturally aligned field can be
done with a simple store. For targets that support fast unaligned
- memory, any naturally sized, unit aligned field can be done directly.
-
- It's okay if the requested bitsize is greater than fieldmode's
- bitsize; that just means the mode has padding bits. */
+ memory, any naturally sized, unit aligned field can be done directly. */
byte_offset = (bitnum % BITS_PER_WORD) / BITS_PER_UNIT
+ (offset * UNITS_PER_WORD);
if (bitpos == 0
- && GET_MODE_BITSIZE (fieldmode) != 0
- && bitsize >= GET_MODE_BITSIZE (fieldmode)
+ && bitsize == GET_MODE_BITSIZE (fieldmode)
&& (GET_CODE (op0) != MEM
? ((GET_MODE_SIZE (fieldmode) >= UNITS_PER_WORD
|| GET_MODE_SIZE (GET_MODE (op0)) == GET_MODE_SIZE (fieldmode))
@@ -1033,12 +1029,9 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
if (GET_CODE (op0) == REG
&& mode == GET_MODE (op0)
&& bitnum == 0
- && GET_MODE_BITSIZE (GET_MODE (op0)) != 0
- && bitsize >= GET_MODE_BITSIZE (GET_MODE (op0)))
+ && bitsize == GET_MODE_BITSIZE (GET_MODE (op0)))
{
- /* We're trying to extract a full register from itself.
- (If the requested bitsize is greater than the bitsize of op0,
- that just means op0's mode has padding bits.) */
+ /* We're trying to extract a full register from itself. */
return op0;
}
@@ -1086,13 +1079,18 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
If that's wrong, the solution is to test for it and set TARGET to 0
if needed. */
- mode1 = (VECTOR_MODE_P (tmode)
- ? mode
- : mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0));
+ /* Only scalar integer modes can be converted via subregs. There is an
+ additional problem for FP modes here in that they can have a precision
+ which is different from the size. mode_for_size uses precision, but
+ we want a mode based on the size, so we must avoid calling it for FP
+ modes. */
+ mode1 = (SCALAR_INT_MODE_P (tmode)
+ ? mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0)
+ : mode);
if (((bitsize >= BITS_PER_WORD && bitsize == GET_MODE_BITSIZE (mode)
&& bitpos % BITS_PER_WORD == 0)
- || (mode_for_size (bitsize, GET_MODE_CLASS (tmode), 0) != BLKmode
+ || (mode1 != BLKmode
/* ??? The big endian test here is wrong. This is correct
if the value is in a register, and if mode_for_size is not
the same mode as op0. This causes us to get unnecessarily
diff --git a/gcc/expr.c b/gcc/expr.c
index cd37495badd..93ab7e0c796 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -47,6 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "langhooks.h"
#include "intl.h"
#include "tm_p.h"
+#include "target.h"
/* Decide whether a function's arguments should be processed
from first to last or from last to first.
@@ -605,9 +606,9 @@ convert_move (rtx to, rtx from, int unsignedp)
rtx value, insns;
convert_optab tab;
- if (GET_MODE_BITSIZE (from_mode) < GET_MODE_BITSIZE (to_mode))
+ if (GET_MODE_PRECISION (from_mode) < GET_MODE_PRECISION (to_mode))
tab = sext_optab;
- else if (GET_MODE_BITSIZE (from_mode) > GET_MODE_BITSIZE (to_mode))
+ else if (GET_MODE_PRECISION (from_mode) > GET_MODE_PRECISION (to_mode))
tab = trunc_optab;
else
abort ();
@@ -2121,10 +2122,10 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
set of registers starting with SRCREG into TGTBLK. If TGTBLK
is null, a stack temporary is created. TGTBLK is returned.
- The primary purpose of this routine is to handle functions
- that return BLKmode structures in registers. Some machines
- (the PA for example) want to return all small structures
- in registers regardless of the structure's alignment. */
+ The purpose of this routine is to handle functions that return
+ BLKmode structures in registers. Some machines (the PA for example)
+ want to return all small structures in registers regardless of the
+ structure's alignment. */
rtx
copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type)
@@ -2132,7 +2133,7 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type)
unsigned HOST_WIDE_INT bytes = int_size_in_bytes (type);
rtx src = NULL, dst = NULL;
unsigned HOST_WIDE_INT bitsize = MIN (TYPE_ALIGN (type), BITS_PER_WORD);
- unsigned HOST_WIDE_INT bitpos, xbitpos, big_endian_correction = 0;
+ unsigned HOST_WIDE_INT bitpos, xbitpos, padding_correction = 0;
if (tgtblk == 0)
{
@@ -2150,13 +2151,20 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type)
&& GET_MODE_SIZE (GET_MODE (srcreg)) < UNITS_PER_WORD)
srcreg = convert_to_mode (word_mode, srcreg, TREE_UNSIGNED (type));
- /* Structures whose size is not a multiple of a word are aligned
- to the least significant byte (to the right). On a BYTES_BIG_ENDIAN
- machine, this means we must skip the empty high order bytes when
- calculating the bit offset. */
- if (BYTES_BIG_ENDIAN
- && bytes % UNITS_PER_WORD)
- big_endian_correction
+ /* If the structure doesn't take up a whole number of words, see whether
+ SRCREG is padded on the left or on the right. If it's on the left,
+ set PADDING_CORRECTION to the number of bits to skip.
+
+ In most ABIs, the structure will be returned at the least end of
+ the register, which translates to right padding on little-endian
+ targets and left padding on big-endian targets. The opposite
+ holds if the structure is returned at the most significant
+ end of the register. */
+ if (bytes % UNITS_PER_WORD != 0
+ && (targetm.calls.return_in_msb (type)
+ ? !BYTES_BIG_ENDIAN
+ : BYTES_BIG_ENDIAN))
+ padding_correction
= (BITS_PER_WORD - ((bytes % UNITS_PER_WORD) * BITS_PER_UNIT));
/* Copy the structure BITSIZE bites at a time.
@@ -2164,15 +2172,15 @@ copy_blkmode_from_reg (rtx tgtblk, rtx srcreg, tree type)
We could probably emit more efficient code for machines which do not use
strict alignment, but it doesn't seem worth the effort at the current
time. */
- for (bitpos = 0, xbitpos = big_endian_correction;
+ for (bitpos = 0, xbitpos = padding_correction;
bitpos < bytes * BITS_PER_UNIT;
bitpos += bitsize, xbitpos += bitsize)
{
/* We need a new source operand each time xbitpos is on a
- word boundary and when xbitpos == big_endian_correction
+ word boundary and when xbitpos == padding_correction
(the first time through). */
if (xbitpos % BITS_PER_WORD == 0
- || xbitpos == big_endian_correction)
+ || xbitpos == padding_correction)
src = operand_subword_force (srcreg, xbitpos / BITS_PER_WORD,
GET_MODE (srcreg));
@@ -3466,9 +3474,19 @@ emit_push_insn (rtx x, enum machine_mode mode, tree type, rtx size,
rtx temp;
int used = partial * UNITS_PER_WORD;
- int offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
+ int offset;
int skip;
+ if (reg && GET_CODE (reg) == PARALLEL)
+ {
+ /* Use the size of the elt to compute offset. */
+ rtx elt = XEXP (XVECEXP (reg, 0, 0), 0);
+ used = partial * GET_MODE_SIZE (GET_MODE (elt));
+ offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
+ }
+ else
+ offset = used % (PARM_BOUNDARY / BITS_PER_UNIT);
+
if (size == 0)
abort ();
@@ -3826,7 +3844,11 @@ expand_assignment (tree to, tree from, int want_value)
}
if (TREE_CODE (to) == COMPONENT_REF
- && TREE_READONLY (TREE_OPERAND (to, 1)))
+ && TREE_READONLY (TREE_OPERAND (to, 1))
+ /* We can't assert that a MEM won't be set more than once
+ if the component is not addressable because another
+ non-addressable component may be referenced by the same MEM. */
+ && ! (GET_CODE (to_rtx) == MEM && ! can_address_p (to)))
{
if (to_rtx == orig_to_rtx)
to_rtx = copy_rtx (to_rtx);
@@ -4621,7 +4643,10 @@ store_constructor (tree exp, rtx target, int cleared, HOST_WIDE_INT size)
highest_pow2_factor (offset));
}
- if (TREE_READONLY (field))
+ /* If the constructor has been cleared, setting RTX_UNCHANGING_P
+ on the MEM might lead to scheduling the clearing after the
+ store. */
+ if (TREE_READONLY (field) && !cleared)
{
if (GET_CODE (to_rtx) == MEM)
to_rtx = copy_rtx (to_rtx);
@@ -5918,60 +5943,6 @@ var_rtx (tree exp)
return 0;
}
}
-
-#ifdef MAX_INTEGER_COMPUTATION_MODE
-
-void
-check_max_integer_computation_mode (tree exp)
-{
- enum tree_code code;
- enum machine_mode mode;
-
- /* Strip any NOPs that don't change the mode. */
- STRIP_NOPS (exp);
- code = TREE_CODE (exp);
-
- /* We must allow conversions of constants to MAX_INTEGER_COMPUTATION_MODE. */
- if (code == NOP_EXPR
- && TREE_CODE (TREE_OPERAND (exp, 0)) == INTEGER_CST)
- return;
-
- /* First check the type of the overall operation. We need only look at
- unary, binary and relational operations. */
- if (TREE_CODE_CLASS (code) == '1'
- || TREE_CODE_CLASS (code) == '2'
- || TREE_CODE_CLASS (code) == '<')
- {
- mode = TYPE_MODE (TREE_TYPE (exp));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && mode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
- }
-
- /* Check operand of a unary op. */
- if (TREE_CODE_CLASS (code) == '1')
- {
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && mode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
- }
-
- /* Check operands of a binary/comparison op. */
- if (TREE_CODE_CLASS (code) == '2' || TREE_CODE_CLASS (code) == '<')
- {
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 0)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && mode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
-
- mode = TYPE_MODE (TREE_TYPE (TREE_OPERAND (exp, 1)));
- if (GET_MODE_CLASS (mode) == MODE_INT
- && mode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
- }
-}
-#endif
/* Return the highest power of two that EXP is known to be a multiple of.
This is used in updating alignment of MEMs in array references. */
@@ -6275,49 +6246,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
target = 0;
}
-#ifdef MAX_INTEGER_COMPUTATION_MODE
- /* Only check stuff here if the mode we want is different from the mode
- of the expression; if it's the same, check_max_integer_computation_mode
- will handle it. Do we really need to check this stuff at all? */
-
- if (target
- && GET_MODE (target) != mode
- && TREE_CODE (exp) != INTEGER_CST
- && TREE_CODE (exp) != PARM_DECL
- && TREE_CODE (exp) != ARRAY_REF
- && TREE_CODE (exp) != ARRAY_RANGE_REF
- && TREE_CODE (exp) != COMPONENT_REF
- && TREE_CODE (exp) != BIT_FIELD_REF
- && TREE_CODE (exp) != INDIRECT_REF
- && TREE_CODE (exp) != CALL_EXPR
- && TREE_CODE (exp) != VAR_DECL
- && TREE_CODE (exp) != RTL_EXPR)
- {
- enum machine_mode mode = GET_MODE (target);
-
- if (GET_MODE_CLASS (mode) == MODE_INT
- && mode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
- }
-
- if (tmode != mode
- && TREE_CODE (exp) != INTEGER_CST
- && TREE_CODE (exp) != PARM_DECL
- && TREE_CODE (exp) != ARRAY_REF
- && TREE_CODE (exp) != ARRAY_RANGE_REF
- && TREE_CODE (exp) != COMPONENT_REF
- && TREE_CODE (exp) != BIT_FIELD_REF
- && TREE_CODE (exp) != INDIRECT_REF
- && TREE_CODE (exp) != VAR_DECL
- && TREE_CODE (exp) != CALL_EXPR
- && TREE_CODE (exp) != RTL_EXPR
- && GET_MODE_CLASS (tmode) == MODE_INT
- && tmode > MAX_INTEGER_COMPUTATION_MODE)
- internal_error ("unsupported wide integer operation");
-
- check_max_integer_computation_mode (exp);
-#endif
-
/* If will do cse, generate all results into pseudo registers
since 1) that allows cse to find more things
and 2) otherwise cse could produce an insn the machine
@@ -6943,7 +6871,8 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
&& modifier != EXPAND_MEMORY
&& TREE_READONLY (array) && ! TREE_SIDE_EFFECTS (array)
&& TREE_CODE (array) == VAR_DECL && DECL_INITIAL (array)
- && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK)
+ && TREE_CODE (DECL_INITIAL (array)) != ERROR_MARK
+ && targetm.binds_local_p (array))
{
if (TREE_CODE (index) == INTEGER_CST)
{
@@ -7130,10 +7059,9 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
offset_rtx = convert_to_mode (ptr_mode, offset_rtx, 0);
#endif
- /* A constant address in OP0 can have VOIDmode, we must not try
- to call force_reg for that case. Avoid that case. */
- if (GET_CODE (op0) == MEM
- && GET_MODE (op0) == BLKmode
+ if (GET_MODE (op0) == BLKmode
+ /* A constant address in OP0 can have VOIDmode, we must
+ not try to call force_reg in that case. */
&& GET_MODE (XEXP (op0, 0)) != VOIDmode
&& bitsize != 0
&& (bitpos % bitsize) == 0
@@ -7190,7 +7118,10 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
fetch it as a bit field. */
|| (mode1 != BLKmode
&& (((TYPE_ALIGN (TREE_TYPE (tem)) < GET_MODE_ALIGNMENT (mode)
- || (bitpos % GET_MODE_ALIGNMENT (mode) != 0))
+ || (bitpos % GET_MODE_ALIGNMENT (mode) != 0)
+ || (GET_CODE (op0) == MEM
+ && (MEM_ALIGN (op0) < GET_MODE_ALIGNMENT (mode1)
+ || (bitpos % GET_MODE_ALIGNMENT (mode1) != 0))))
&& ((modifier == EXPAND_CONST_ADDRESS
|| modifier == EXPAND_INITIALIZER)
? STRICT_ALIGNMENT
@@ -7854,16 +7785,6 @@ expand_expr (tree exp, rtx target, enum machine_mode tmode,
op0 = expand_expr (TREE_OPERAND (exp, 0), subtarget, VOIDmode,
EXPAND_SUM);
- /* If we knew for certain that this is arithmetic for an array
- reference, and we knew the bounds of the array, then we could
- apply the distributive law across (PLUS X C) for constant C.
- Without such knowledge, we risk overflowing the computation
- when both X and C are large, but X+C isn't. */
- /* ??? Could perhaps special-case EXP being unsigned and C being
- positive. In that case we are certain that X+C is no smaller
- than X and so the transformed expression will overflow iff the
- original would have. */
-
if (GET_CODE (op0) != REG)
op0 = force_operand (op0, NULL_RTX);
if (GET_CODE (op0) != REG)
@@ -9328,7 +9249,7 @@ expand_increment (tree exp, int post, int ignore)
{
/* We have a true reference to the value in OP0.
If there is an insn to add or subtract in this mode, queue it.
- Queueing the increment insn avoids the register shuffling
+ Queuing the increment insn avoids the register shuffling
that often results if we must increment now and first save
the old value for subsequent use. */
@@ -9775,7 +9696,7 @@ do_tablejump (rtx index, enum machine_mode mode, rtx range, rtx table_label,
if (mode != Pmode)
index = convert_to_mode (Pmode, index, 1);
- /* Don't let a MEM slip thru, because then INDEX that comes
+ /* Don't let a MEM slip through, because then INDEX that comes
out of PIC_CASE_VECTOR_ADDRESS won't be a valid address,
and break_out_memory_refs will go to work on it and mess it up. */
#ifdef PIC_CASE_VECTOR_ADDRESS
diff --git a/gcc/expr.h b/gcc/expr.h
index c598ff7193a..abd7f5b049d 100644
--- a/gcc/expr.h
+++ b/gcc/expr.h
@@ -331,6 +331,7 @@ extern rtx gen_cond_trap (enum rtx_code, rtx, rtx, rtx);
/* Functions from builtins.c: */
extern rtx expand_builtin (tree, rtx, rtx, enum machine_mode, int);
+extern tree std_build_builtin_va_list (void);
extern void std_expand_builtin_va_start (tree, rtx);
extern rtx std_expand_builtin_va_arg (tree, tree);
extern rtx expand_builtin_va_arg (tree, tree);
diff --git a/gcc/f/.cvsignore b/gcc/f/.cvsignore
deleted file mode 100644
index ef942f0cd74..00000000000
--- a/gcc/f/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-g77.info*
-g77.1
diff --git a/gcc/f/ChangeLog b/gcc/f/ChangeLog
index 12cdc27cf27..3dcc5628f70 100644
--- a/gcc/f/ChangeLog
+++ b/gcc/f/ChangeLog
@@ -1,3 +1,66 @@
+2003-12-29 Roger Sayle <roger@eyesopen.com>
+
+ PR fortran/12632
+ * com.c (ffecom_subscript_check_): Take as an extra argument the
+ (possibly NULL) decl of the array. Don't create unnecessary tree
+ nodes if the array index is known to be safe at compile-time.
+ If the array index is unsafe, force the array decl into memory to
+ avoid RTL expansion problems.
+ (ffecom_array_ref_): Update calls to ffecom_subscript_check_.
+ (ffecom_char_args_x_): Likewise.
+
+2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (G77_CROSS_NAME): Delete.
+ (g77.install_common, g77.install-man, g77.uninstall): Adjust for above.
+
+2003-11-30 Andreas Jaeger <aj@suse.de>
+
+ * Make-lang.in (f77.rebuilt): Fix dependency on g77.info.
+
+2003-11-24 Toon Moene <toon@moene.indiv.nluug.nl>
+
+ PR fortran/12633
+ * expr.c (ffeexpr_reduced_ugly2log_): Revert
+ change allowing logical .and. logical to be
+ integer in expressions when -fugly-logint.
+
+2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (f77.extraclean): Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (check-f77, lang_checks): Add.
+
+2003-11-16 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (f77.tags): Create TAGS.sub files in each directory
+ and TAGS files that include them for each front end.
+
+2003-11-12 Andreas Jaeger <aj@suse.de>
+
+ * intdoc.in (Signal Intrinsic (subroutine)): Fix texinfo warning
+ using @code.
+ * intdoc.texi: Regenerated.
+
+2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (dvi): Move targets to $(docobjdir).
+ (g77.dvi): Simplify rule.
+ (g77.info): Sinplify rule.
+ (g77.1): Delete.
+ (g77.pod): New intermediate rule.
+
+2003-10-31 Jakub Jelinek <jakub@redhat.com>
+
+ * com.c (ffecom_sym_transform_): Set tree type of offset
+ to ssizetype.
+
2003-10-21 Kelley Cook <kcook@gcc.gnu.org>
* Make-lang.in (f/g77.1): Honor $(docobjdir).
diff --git a/gcc/f/Make-lang.in b/gcc/f/Make-lang.in
index a5256c893c3..b54b83c1f5e 100644
--- a/gcc/f/Make-lang.in
+++ b/gcc/f/Make-lang.in
@@ -1,4 +1,4 @@
-# Top level makefile fragment for GNU Fortran. -*-makefile-*-
+# Top level -*- makefile -*- fragment for GNU Fortran.
# Copyright (C) 1995, 1996, 1997, 1998, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
#This file is part of GNU Fortran.
@@ -24,7 +24,7 @@
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
# foo.uninstall,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -40,9 +40,6 @@
# Actual name to use when installing a native compiler.
G77_INSTALL_NAME = `echo g77|sed '$(program_transform_name)'`
-# Actual name to use when installing a cross-compiler.
-G77_CROSS_NAME = `echo g77|sed '$(program_transform_cross_name)'`
-
# 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.
@@ -61,7 +58,7 @@ F77 f77: f771$(exeext)
f77.install-normal \
f77.install-common f77.install-man \
f77.uninstall f77.mostlyclean f77.clean f77.distclean \
- f77.extraclean f77.maintainer-clean f77.rebuilt \
+ f77.maintainer-clean f77.rebuilt \
f77.stage1 f77.stage2 f77.stage3 f77.stage4 \
f77.stageprofile f77.stagefeedback
@@ -146,12 +143,16 @@ f77.start.encap: g77$(exeext)
f77.rest.encap:
f77.tags: force
- cd $(srcdir)/f; etags *.c *.h
+ cd $(srcdir)/f; etags -o TAGS.sub *.c *.h; \
+ etags --include TAGS.sub --include ../TAGS.sub
info:: $(docobjdir)/g77.info
-dvi:: f/g77.dvi
+dvi:: $(docobjdir)/g77.dvi
generated-manpages:: $(docobjdir)/g77.1
+check-f77 : check-g77
+lang_checks += check-g77
+
# g77 documentation.
$(docobjdir)/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
$(srcdir)/f/ffe.texi $(srcdir)/f/invoke.texi \
@@ -163,25 +164,22 @@ $(docobjdir)/g77.info: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
stmp-docobjdir
if [ x$(BUILD_INFO) = xinfo ]; then \
rm -f $(@)*; \
- cd $(srcdir)/f && $(MAKEINFO) -I../doc/include -o $@ g77.texi; \
+ $(MAKEINFO) -I$(docdir)/include -I$(srcdir)/f -o $@ $<; \
else true; fi
-f/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
+$(docobjdir)/g77.dvi: $(srcdir)/f/g77.texi $(srcdir)/f/bugs.texi \
$(srcdir)/f/ffe.texi $(srcdir)/f/invoke.texi \
$(srcdir)/f/news.texi $(srcdir)/f/intdoc.texi \
$(srcdir)/f/root.texi $(docdir)/include/fdl.texi \
$(docdir)/include/gpl.texi \
$(docdir)/include/funding.texi \
- $(docdir)/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- cd f && $(TEXI2DVI) -I $$s/doc/include $$s/f/g77.texi
+ $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -I $(srcdir)/f -I $(docdir)/include -o $@ $<
-$(docobjdir)/g77.1: $(srcdir)/f/invoke.texi
- -$(TEXI2POD) < $(srcdir)/f/invoke.texi > f/g77.pod; \
- ($(POD2MAN) --section=1 f/g77.pod > f/g77.1.T$$$$ && \
- mv -f f/g77.1.T$$$$ $(docobjdir)/g77.1) || \
- (rm -f f/g77.1.T$$$$ && exit 1); \
- rm -f f/g77.pod; \
+.INTERMEDIATE: g77.pod
+g77.pod: f/invoke.texi
+ -$(TEXI2POD) < $< > $@
# This dance is all about producing accurate documentation for g77's
# intrinsics with minimum fuss. f/ansify appends "\n\" to C strings
@@ -238,7 +236,7 @@ $(srcdir)/f/NEWS: f/news0.texi f/news.texi f/root.texi
cd $(srcdir)/f; $(MAKEINFO) -D NEWSONLY --no-header --no-split \
--no-validate -I../doc/include -o NEWS news0.texi
-f77.rebuilt: f/g77.info $(srcdir)/f/BUGS \
+f77.rebuilt: $(docobjdir)/g77.info $(srcdir)/f/BUGS \
$(srcdir)/f/NEWS
#
@@ -251,15 +249,9 @@ f77.install-normal:
# and also as either g77 (if native) or $(tooldir)/bin/g77.
f77.install-common: installdirs
-if [ -f f771$(exeext) ] ; then \
- if [ -f g77-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) g77-cross$(exeext) $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \
- else \
- rm -f $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) g77$(exeext) $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
- fi ; \
+ rm -f $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) g77$(exeext) $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
+ chmod a+x $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
else true; fi
@if [ -f f77-install-ok -o -f $(srcdir)/f77-install-ok ]; then \
echo ''; \
@@ -275,15 +267,9 @@ install-info:: $(DESTDIR)$(infodir)/g77.info
f77.install-man: $(GENERATED_MANPAGES) installdirs
-if [ -f f771$(exeext) ] ; then \
- if [ -f g77-cross$(exeext) ] ; then \
- rm -f $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
- else \
- rm -f $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
- fi; \
+ rm -f $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(docobjdir)/g77.1 $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
else true; fi
f77.uninstall: installdirs
@@ -292,9 +278,7 @@ f77.uninstall: installdirs
install-info --delete --info-dir=$(DESTDIR)$(infodir) $(DESTDIR)$(infodir)/g77.info || : ; \
else : ; fi
rm -rf $(DESTDIR)$(bindir)/$(G77_INSTALL_NAME)$(exeext); \
- rm -rf $(DESTDIR)$(bindir)/$(G77_CROSS_NAME)$(exeext); \
rm -rf $(DESTDIR)$(man1dir)/$(G77_INSTALL_NAME)$(man1ext); \
- rm -rf $(DESTDIR)$(man1dir)/$(G77_CROSS_NAME)$(man1ext); \
rm -rf $(DESTDIR)$(infodir)/g77.info*
#
# Clean hooks:
@@ -312,9 +296,8 @@ f77.clean:
-rm -f g77spec.o
f77.distclean:
-rm -f f/Makefile
-f77.extraclean:
f77.maintainer-clean:
- -rm -f f/g77.info* f/g77.*aux f/TAGS f/BUGS f/NEWS f/intdoc.texi
+ -rm -f f/g77.info* f/g77.*aux f/TAGS f/TAGS.sub f/BUGS f/NEWS f/intdoc.texi
#
# Stage hooks:
# The main makefile has already created stage?/f.
diff --git a/gcc/f/com.c b/gcc/f/com.c
index e992cb90b77..a64ef86b172 100644
--- a/gcc/f/com.c
+++ b/gcc/f/com.c
@@ -638,15 +638,16 @@ static GTY(()) tree shadowed_labels;
/* Return the subscript expression, modified to do range-checking.
- `array' is the array to be checked against.
+ `array' is the array type to be checked against.
`element' is the subscript expression to check.
`dim' is the dimension number (starting at 0).
`total_dims' is the total number of dimensions (0 for CHARACTER substring).
+ `item' is the array decl or NULL_TREE.
*/
static tree
ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
- const char *array_name)
+ const char *array_name, tree item)
{
tree low = TYPE_MIN_VALUE (TYPE_DOMAIN (array));
tree high = TYPE_MAX_VALUE (TYPE_DOMAIN (array));
@@ -713,6 +714,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
}
}
+ /* If the array index is safe at compile-time, return element. */
+ if (integer_nonzerop (cond))
+ return element;
+
{
int len;
char *proc;
@@ -807,13 +812,10 @@ ffecom_subscript_check_ (tree array, tree element, int dim, int total_dims,
TREE_SIDE_EFFECTS (die) = 1;
die = convert (void_type_node, die);
- element = ffecom_3 (COND_EXPR,
- TREE_TYPE (element),
- cond,
- element,
- die);
+ if (integer_zerop (cond) && item)
+ ffe_mark_addressable (item);
- return element;
+ return ffecom_3 (COND_EXPR, TREE_TYPE (element), cond, element, die);
}
/* Return the computed element of an array reference.
@@ -899,7 +901,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE);
if (flag_bounds_check)
element = ffecom_subscript_check_ (array, element, i, total_dims,
- array_name);
+ array_name, item);
if (element == error_mark_node)
return element;
@@ -945,7 +947,7 @@ ffecom_arrayref_ (tree item, ffebld expr, int want_ptr)
element = ffecom_expr_ (dims[i], NULL, NULL, NULL, FALSE, TRUE);
if (flag_bounds_check)
element = ffecom_subscript_check_ (array, element, i, total_dims,
- array_name);
+ array_name, item);
if (element == error_mark_node)
return element;
@@ -2037,7 +2039,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
end_tree = ffecom_expr (end);
if (flag_bounds_check)
end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0,
- char_name);
+ char_name, NULL_TREE);
end_tree = convert (ffecom_f2c_ftnlen_type_node,
end_tree);
@@ -2055,7 +2057,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
start_tree = ffecom_expr (start);
if (flag_bounds_check)
start_tree = ffecom_subscript_check_ (array, start_tree, 0, 0,
- char_name);
+ char_name, NULL_TREE);
start_tree = convert (ffecom_f2c_ftnlen_type_node,
start_tree);
@@ -2088,7 +2090,7 @@ ffecom_char_args_x_ (tree *xitem, tree *length, ffebld expr, bool with_null)
end_tree = ffecom_expr (end);
if (flag_bounds_check)
end_tree = ffecom_subscript_check_ (array, end_tree, 1, 0,
- char_name);
+ char_name, NULL_TREE);
end_tree = convert (ffecom_f2c_ftnlen_type_node,
end_tree);
@@ -7919,6 +7921,7 @@ ffecom_sym_transform_ (ffesymbol s)
{
ffetargetOffset offset;
ffestorag cst;
+ tree toffset;
cst = ffestorag_parent (st);
assert (cst == ffesymbol_storage (cs));
@@ -7935,9 +7938,10 @@ ffecom_sym_transform_ (ffesymbol s)
ffecom_1 (ADDR_EXPR,
build_pointer_type (TREE_TYPE (ct)),
ct));
+ toffset = build_int_2 (offset, 0);
+ TREE_TYPE (toffset) = ssizetype;
t = ffecom_2 (PLUS_EXPR, TREE_TYPE (t),
- t,
- build_int_2 (offset, 0));
+ t, toffset);
t = convert (build_pointer_type (type),
t);
TREE_CONSTANT (t) = 1;
diff --git a/gcc/f/expr.c b/gcc/f/expr.c
index 6aeddafe4c2..f7ee46bb56b 100644
--- a/gcc/f/expr.c
+++ b/gcc/f/expr.c
@@ -10593,24 +10593,6 @@ ffeexpr_reduced_ugly2log_ (ffebld reduced, ffeexprExpr_ l, ffeexprExpr_ op,
/* else Leave it alone. */
}
- if (lbt == FFEINFO_basictypeLOGICAL)
- {
- ffebld_set_left (reduced, ffeexpr_convert (ffebld_left (reduced),
- l->token, op->token, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT, 0,
- FFETARGET_charactersizeNONE,
- FFEEXPR_contextLET));
- }
-
- if (rbt == FFEINFO_basictypeLOGICAL)
- {
- ffebld_set_right (reduced, ffeexpr_convert (ffebld_right (reduced),
- r->token, op->token, FFEINFO_basictypeINTEGER,
- FFEINFO_kindtypeINTEGERDEFAULT, 0,
- FFETARGET_charactersizeNONE,
- FFEEXPR_contextLET));
- }
-
return reduced;
}
diff --git a/gcc/f/intdoc.in b/gcc/f/intdoc.in
index 55d426ad930..6f2423f6cac 100644
--- a/gcc/f/intdoc.in
+++ b/gcc/f/intdoc.in
@@ -2401,7 +2401,7 @@ See @code{signal(2)}.
Note that @var{@2@} will be called using C conventions,
so the value of its argument in Fortran terms
-Fortran terms is obtained by applying @code{%LOC()} (or @var{LOC()}) to it.
+Fortran terms is obtained by applying @code{%LOC()} (or @code{LOC()}) to it.
The value returned by @code{signal(2)} is written to @var{@3@}, if
that argument is supplied.
@@ -2451,7 +2451,7 @@ See @code{signal(2)}.
Note that @var{@2@} will be called using C conventions,
so the value of its argument in Fortran terms
-is obtained by applying @code{%LOC()} (or @var{LOC()}) to it.
+is obtained by applying @code{%LOC()} (or @code{LOC()}) to it.
The value returned by @code{signal(2)} is returned.
diff --git a/gcc/f/intdoc.texi b/gcc/f/intdoc.texi
index 7de42578d1a..e657510a060 100644
--- a/gcc/f/intdoc.texi
+++ b/gcc/f/intdoc.texi
@@ -9500,7 +9500,7 @@ See @code{signal(2)}.
Note that @var{Handler} will be called using C conventions,
so the value of its argument in Fortran terms
-Fortran terms is obtained by applying @code{%LOC()} (or @var{LOC()}) to it.
+Fortran terms is obtained by applying @code{%LOC()} (or @code{LOC()}) to it.
The value returned by @code{signal(2)} is written to @var{Status}, if
that argument is supplied.
@@ -9579,7 +9579,7 @@ See @code{signal(2)}.
Note that @var{Handler} will be called using C conventions,
so the value of its argument in Fortran terms
-is obtained by applying @code{%LOC()} (or @var{LOC()}) to it.
+is obtained by applying @code{%LOC()} (or @code{LOC()}) to it.
The value returned by @code{signal(2)} is returned.
diff --git a/gcc/final.c b/gcc/final.c
index 20ceff8b7c0..3310a40d691 100644
--- a/gcc/final.c
+++ b/gcc/final.c
@@ -170,9 +170,15 @@ CC_STATUS cc_prev_status;
char regs_ever_live[FIRST_PSEUDO_REGISTER];
+/* Like regs_ever_live, but 1 if a reg is set or clobbered from an asm.
+ Unlike regs_ever_live, elements of this array corresponding to
+ eliminable regs like the frame pointer are set if an asm sets them. */
+
+char regs_asm_clobbered[FIRST_PSEUDO_REGISTER];
+
/* Nonzero means current function must be given a frame pointer.
- Set in stmt.c if anything is allocated on the stack there.
- Set in reload1.c if anything is allocated on the stack there. */
+ Initialized in function.c to 0. Set only in reload1.c as per
+ the needs of the function. */
int frame_pointer_needed;
@@ -667,7 +673,7 @@ compute_alignments (void)
FOR_EACH_BB (bb)
{
- rtx label = bb->head;
+ rtx label = BB_HEAD (bb);
int fallthru_frequency = 0, branch_frequency = 0, has_fallthru = 0;
edge e;
@@ -1336,19 +1342,6 @@ final_start_function (rtx first ATTRIBUTE_UNUSED, FILE *file,
this_is_asm_operands = 0;
-#ifdef NON_SAVING_SETJMP
- /* A function that calls setjmp should save and restore all the
- call-saved registers on a system where longjmp clobbers them. */
- if (NON_SAVING_SETJMP && current_function_calls_setjmp)
- {
- int i;
-
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (!call_used_regs[i])
- regs_ever_live[i] = 1;
- }
-#endif
-
last_filename = locator_file (prologue_locator);
last_linenum = locator_line (prologue_locator);
@@ -1437,7 +1430,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
function_section (current_function_decl);
#if defined(ASM_OUTPUT_REG_PUSH)
- if (sval && GET_CODE (svrtx) == REG)
+ if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG)
ASM_OUTPUT_REG_PUSH (file, REGNO (svrtx));
#endif
@@ -1468,7 +1461,7 @@ profile_function (FILE *file ATTRIBUTE_UNUSED)
#endif
#if defined(ASM_OUTPUT_REG_PUSH)
- if (sval && GET_CODE (svrtx) == REG)
+ if (sval && svrtx != NULL_RTX && GET_CODE (svrtx) == REG)
ASM_OUTPUT_REG_POP (file, REGNO (svrtx));
#endif
}
@@ -1847,10 +1840,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (prescan > 0)
break;
-#ifdef FINAL_PRESCAN_LABEL
- FINAL_PRESCAN_INSN (insn, NULL, 0);
-#endif
-
if (LABEL_NAME (insn))
(*debug_hooks->label) (insn);
@@ -1918,7 +1907,7 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
/* An INSN, JUMP_INSN or CALL_INSN.
First check for special kinds that recog doesn't recognize. */
- if (GET_CODE (body) == USE /* These are just declarations */
+ if (GET_CODE (body) == USE /* These are just declarations. */
|| GET_CODE (body) == CLOBBER)
break;
@@ -2153,10 +2142,6 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED,
if (optimize)
{
-#if 0
- rtx set = single_set (insn);
-#endif
-
if (set
&& GET_CODE (SET_DEST (set)) == CC0
&& insn != last_ignored_compare)
diff --git a/gcc/fix-header.c b/gcc/fix-header.c
index 7fdecb5d150..ad23793a406 100644
--- a/gcc/fix-header.c
+++ b/gcc/fix-header.c
@@ -645,7 +645,7 @@ read_scan_file (char *in_fname, int argc, char **argv)
}
if (i < argc)
- cpp_error (scan_in, DL_ERROR, "invalid option `%s'", argv[i]);
+ cpp_error (scan_in, CPP_DL_ERROR, "invalid option `%s'", argv[i]);
if (cpp_errors (scan_in))
exit (FATAL_EXIT_CODE);
diff --git a/gcc/fixinc/fixincl.x b/gcc/fixinc/fixincl.x
index 08e29593334..160960563ab 100644
--- a/gcc/fixinc/fixincl.x
+++ b/gcc/fixinc/fixincl.x
@@ -2,11 +2,11 @@
*
* DO NOT EDIT THIS FILE (fixincl.x)
*
- * It has been AutoGen-ed Saturday October 25, 2003 at 10:36:26 AM PDT
+ * It has been AutoGen-ed Thursday December 18, 2003 at 01:49:23 PM PST
* From the definitions inclhack.def
* and the template file fixincl
*/
-/* DO NOT CVS-MERGE THIS FILE, EITHER Sat Oct 25 10:36:26 PDT 2003
+/* DO NOT CVS-MERGE THIS FILE, EITHER Thu Dec 18 13:49:23 PST 2003
*
* You must regenerate it. Use the ./genfixes script.
*
@@ -15,7 +15,7 @@
* certain ANSI-incompatible system header files which are fixed to work
* correctly with ANSI C and placed in a directory that GNU C will search.
*
- * This file contains 161 fixup descriptions.
+ * This file contains 163 fixup descriptions.
*
* See README for more information.
*
@@ -975,6 +975,43 @@ static const char* apzAlpha_SbrkPatch[] = {
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Alpha_Wchar fix
+ */
+tSCC zAlpha_WcharName[] =
+ "alpha_wchar";
+
+/*
+ * File name selection pattern
+ */
+tSCC zAlpha_WcharList[] =
+ "|wchar.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzAlpha_WcharMachs[] = {
+ "alpha*-dec-osf4*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zAlpha_WcharSelect0[] =
+ "#define wcstok wcstok_r";
+
+#define ALPHA_WCHAR_TEST_CT 1
+static tTestDesc aAlpha_WcharTests[] = {
+ { TT_EGREP, zAlpha_WcharSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Alpha_Wchar
+ */
+static const char* apzAlpha_WcharPatch[] = { "sed",
+ "-e", "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@",
+ "-e", "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Avoid_Bool_Define fix
*/
tSCC zAvoid_Bool_DefineName[] =
@@ -1494,6 +1531,44 @@ extern \"C\" {\n\
/* * * * * * * * * * * * * * * * * * * * * * * * * *
*
+ * Description of Darwin_Private_Extern fix
+ */
+tSCC zDarwin_Private_ExternName[] =
+ "darwin_private_extern";
+
+/*
+ * File name selection pattern
+ */
+tSCC zDarwin_Private_ExternList[] =
+ "|mach-o/dyld.h|";
+/*
+ * Machine/OS name selection pattern
+ */
+tSCC* apzDarwin_Private_ExternMachs[] = {
+ "*-*-darwin*",
+ (const char*)NULL };
+
+/*
+ * content selection pattern - do fix if pattern found
+ */
+tSCC zDarwin_Private_ExternSelect0[] =
+ "__private_extern__ [a-z_]+ _dyld_";
+
+#define DARWIN_PRIVATE_EXTERN_TEST_CT 1
+static tTestDesc aDarwin_Private_ExternTests[] = {
+ { TT_EGREP, zDarwin_Private_ExternSelect0, (regex_t*)NULL }, };
+
+/*
+ * Fix Command Arguments for Darwin_Private_Extern
+ */
+static const char* apzDarwin_Private_ExternPatch[] = {
+ "format",
+ "extern",
+ "__private_extern__",
+ (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
* Description of Dec_Intern_Asm fix
*/
tSCC zDec_Intern_AsmName[] =
@@ -4384,8 +4459,7 @@ static tTestDesc aStdio_Va_ListTests[] = {
* Fix Command Arguments for Stdio_Va_List
*/
static const char* apzStdio_Va_ListPatch[] = { "sed",
- "-e", "s@ va_list @ __gnuc_va_list @\n\
-s@ va_list)@ __gnuc_va_list)@\n\
+ "-e", "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n\
s@(va_list)&@(__gnuc_va_list)\\&@\n\
s@ _VA_LIST_));@ __gnuc_va_list));@\n\
s@ __VA_LIST__));@ __gnuc_va_list));@\n\
@@ -6379,9 +6453,9 @@ static const char* apzX11_SprintfPatch[] = {
*
* List of all fixes
*/
-#define REGEX_COUNT 181
+#define REGEX_COUNT 183
#define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT 161
+#define FIX_COUNT 163
/*
* Enumerate the fixes
@@ -6408,6 +6482,7 @@ typedef enum {
ALPHA_PTHREAD_FIXIDX,
ALPHA_PTHREAD_GCC_FIXIDX,
ALPHA_SBRK_FIXIDX,
+ ALPHA_WCHAR_FIXIDX,
AVOID_BOOL_DEFINE_FIXIDX,
AVOID_BOOL_TYPE_FIXIDX,
AVOID_WCHAR_T_TYPE_FIXIDX,
@@ -6421,6 +6496,7 @@ typedef enum {
CTRL_QUOTES_DEF_FIXIDX,
CTRL_QUOTES_USE_FIXIDX,
CXX_UNREADY_FIXIDX,
+ DARWIN_PRIVATE_EXTERN_FIXIDX,
DEC_INTERN_ASM_FIXIDX,
DJGPP_WCHAR_H_FIXIDX,
ECD_CURSOR_FIXIDX,
@@ -6656,6 +6732,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
ALPHA_SBRK_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aAlpha_SbrkTests, apzAlpha_SbrkPatch, 0 },
+ { zAlpha_WcharName, zAlpha_WcharList,
+ apzAlpha_WcharMachs,
+ ALPHA_WCHAR_TEST_CT, FD_MACH_ONLY,
+ aAlpha_WcharTests, apzAlpha_WcharPatch, 0 },
+
{ zAvoid_Bool_DefineName, zAvoid_Bool_DefineList,
apzAvoid_Bool_DefineMachs,
AVOID_BOOL_DEFINE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
@@ -6721,6 +6802,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = {
CXX_UNREADY_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
aCxx_UnreadyTests, apzCxx_UnreadyPatch, 0 },
+ { zDarwin_Private_ExternName, zDarwin_Private_ExternList,
+ apzDarwin_Private_ExternMachs,
+ DARWIN_PRIVATE_EXTERN_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+ aDarwin_Private_ExternTests, apzDarwin_Private_ExternPatch, 0 },
+
{ zDec_Intern_AsmName, zDec_Intern_AsmList,
apzDec_Intern_AsmMachs,
DEC_INTERN_ASM_TEST_CT, FD_MACH_ONLY,
diff --git a/gcc/fixinc/inclhack.def b/gcc/fixinc/inclhack.def
index 432d0166512..95a5534d15f 100644
--- a/gcc/fixinc/inclhack.def
+++ b/gcc/fixinc/inclhack.def
@@ -634,6 +634,23 @@ fix = {
/*
+ * Change external names of wcstok/wcsftime via asm instead of macros on
+ * Tru64 UNIX V4.0.
+ */
+fix = {
+ hackname = alpha_wchar;
+ files = wchar.h;
+
+ mach = "alpha*-dec-osf4*";
+ select = "#define wcstok wcstok_r";
+ sed = "s@#define wcstok wcstok_r@extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__(\"wcstok_r\");@";
+ sed = "s@#define wcsftime __wcsftime_isoc@extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__(\"__wcsftime_isoc\");@";
+ test_text = "#define wcstok wcstok_r\n"
+ "#define wcsftime __wcsftime_isoc";
+};
+
+
+/*
* For C++, avoid any typedef or macro definition of bool,
* and use the built in type instead.
* HP/UX 10.20 also has it in curses_colr/curses.h.
@@ -919,6 +936,24 @@ fix = {
/*
+ * __private_extern__ doesn't exist in FSF GCC. Even if it did,
+ * why would you ever put it in a system header file?
+ */
+fix = {
+ hackname = darwin_private_extern;
+ mach = "*-*-darwin*";
+ files = mach-o/dyld.h;
+ select = "__private_extern__ [a-z_]+ _dyld_";
+ c_fix = format;
+ c_fix_arg = "extern";
+ c_fix_arg = "__private_extern__";
+ test_text = "__private_extern__ int _dyld_func_lookup(\n"
+ "const char *dyld_func_name,\n"
+ "unsigned long *address);\n";
+};
+
+
+/*
* Fix <c_asm.h> on Digital UNIX V4.0:
* It contains a prototype for a DEC C internal asm() function,
* clashing with gcc's asm keyword. So protect this with __DECC.
@@ -2469,8 +2504,7 @@ fix = {
* instead of va_list.
* Don't claim to have defined va_list.
*/
- sed = "s@ va_list @ __gnuc_va_list @\n"
- "s@ va_list)@ __gnuc_va_list)@\n"
+ sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n"
"s@(va_list)&@(__gnuc_va_list)\\&@\n"
"s@ _VA_LIST_));@ __gnuc_va_list));@\n"
"s@ __VA_LIST__));@ __gnuc_va_list));@\n"
diff --git a/gcc/fixinc/tests/base/wchar.h b/gcc/fixinc/tests/base/wchar.h
new file mode 100644
index 00000000000..5c0b9dfe86a
--- /dev/null
+++ b/gcc/fixinc/tests/base/wchar.h
@@ -0,0 +1,15 @@
+/* DO NOT EDIT THIS FILE.
+
+ It has been auto-edited by fixincludes from:
+
+ "fixinc/tests/inc/wchar.h"
+
+ This had to be done to correct non-standard usages in the
+ original, manufacturer supplied header file. */
+
+
+
+#if defined( ALPHA_WCHAR_CHECK )
+extern wchar_t *wcstok __((wchar_t *, const wchar_t *, wchar_t **)) __asm__("wcstok_r");
+extern size_t wcsftime __((wchar_t *, size_t, const wchar_t *, const struct tm *)) __asm__("__wcsftime_isoc");
+#endif /* ALPHA_WCHAR_CHECK */
diff --git a/gcc/flags.h b/gcc/flags.h
index c2b2fad8f17..f172ec34a8b 100644
--- a/gcc/flags.h
+++ b/gcc/flags.h
@@ -549,10 +549,6 @@ extern int flag_dump_rtl_in_asm;
in generated assembly code. */
extern int flag_leading_underscore;
-/* -fgnu-linker specifies use of the GNU linker for initializations.
- -fno-gnu-linker says that collect will be used. */
-extern int flag_gnu_linker;
-
/* Tag all structures with __attribute__(packed) */
extern int flag_pack_struct;
diff --git a/gcc/flow.c b/gcc/flow.c
index 2694a0b07e0..c146310cb0a 100644
--- a/gcc/flow.c
+++ b/gcc/flow.c
@@ -136,20 +136,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "recog.h"
#include "expr.h"
-#include "ssa.h"
#include "timevar.h"
#include "obstack.h"
#include "splay-tree.h"
-/* 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. */
-#ifndef EXIT_IGNORE_STACK
-#define EXIT_IGNORE_STACK 0
-#endif
-
#ifndef HAVE_epilogue
#define HAVE_epilogue 0
#endif
@@ -160,9 +151,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define HAVE_sibcall_epilogue 0
#endif
-#ifndef LOCAL_REGNO
-#define LOCAL_REGNO(REGNO) 0
-#endif
#ifndef EPILOGUE_USES
#define EPILOGUE_USES(REGNO) 0
#endif
@@ -293,7 +281,6 @@ static void notice_stack_pointer_modification_1 (rtx, rtx, void *);
static void notice_stack_pointer_modification (rtx);
static void mark_reg (rtx, void *);
static void mark_regs_live_at_end (regset);
-static int set_phi_alternative_reg (rtx, int, int, void *);
static void calculate_global_regs_live (sbitmap, sbitmap, int);
static void propagate_block_delete_insn (rtx);
static rtx propagate_block_delete_libcall (rtx, rtx);
@@ -328,6 +315,7 @@ static void add_to_mem_set_list (struct propagate_block_info *, rtx);
static int invalidate_mems_from_autoinc (rtx *, void *);
static void invalidate_mems_from_set (struct propagate_block_info *, rtx);
static void clear_log_links (sbitmap);
+static int count_or_remove_death_notes_bb (basic_block, int);
void
@@ -380,7 +368,7 @@ first_insn_after_basic_block_note (basic_block block)
rtx insn;
/* Get the first instruction in the block. */
- insn = block->head;
+ insn = BB_HEAD (block);
if (insn == NULL_RTX)
return NULL_RTX;
@@ -465,7 +453,10 @@ life_analysis (rtx f, FILE *file, int flags)
is not immediately handy. */
if (flags & PROP_REG_INFO)
- memset (regs_ever_live, 0, sizeof (regs_ever_live));
+ {
+ memset (regs_ever_live, 0, sizeof (regs_ever_live));
+ memset (regs_asm_clobbered, 0, sizeof (regs_asm_clobbered));
+ }
update_life_info (NULL, UPDATE_LIFE_GLOBAL, flags);
/* Clean up. */
@@ -506,7 +497,7 @@ verify_wide_reg_1 (rtx *px, void *pregno)
static void
verify_wide_reg (int regno, basic_block bb)
{
- rtx head = bb->head, end = bb->end;
+ rtx head = BB_HEAD (bb), end = BB_END (bb);
while (1)
{
@@ -596,6 +587,9 @@ verify_local_live_at_start (regset new_live_at_start, basic_block bb)
generates subregs of a multi-word pseudo, current life analysis will
lose the kill. So we _can_ have a pseudo go live. How irritating.
+ It is also not true when a peephole decides that it doesn't need one
+ or more of the inputs.
+
Including PROP_REG_INFO does not properly refresh regs_ever_live
unless the caller resets it to zero. */
@@ -820,7 +814,7 @@ delete_noop_moves (rtx f ATTRIBUTE_UNUSED)
FOR_EACH_BB (bb)
{
- for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = next)
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb)); insn = next)
{
next = NEXT_INSN (insn);
if (INSN_P (insn) && noop_move_p (insn))
@@ -1033,20 +1027,6 @@ mark_regs_live_at_end (regset set)
diddle_return_value (mark_reg, set);
}
-/* Callback function for for_each_successor_phi. DATA is a regset.
- Sets the SRC_REGNO, the regno of the phi alternative for phi node
- INSN, in the regset. */
-
-static int
-set_phi_alternative_reg (rtx insn ATTRIBUTE_UNUSED,
- int dest_regno ATTRIBUTE_UNUSED, int src_regno,
- void *data)
-{
- regset live = (regset) data;
- SET_REGNO_REG_SET (live, src_regno);
- return 0;
-}
-
/* Propagate global life info around the graph of basic blocks. Begin
considering blocks with their corresponding bit set in BLOCKS_IN.
If BLOCKS_IN is null, consider it the universal set.
@@ -1208,14 +1188,6 @@ calculate_global_regs_live (sbitmap blocks_in, sbitmap blocks_out, int flags)
SET_REGNO_REG_SET (new_live_at_end, PIC_OFFSET_TABLE_REGNUM);
}
- /* Regs used in phi nodes are not included in
- global_live_at_start, since they are live only along a
- particular edge. Set those regs that are live because of a
- phi node alternative corresponding to this particular block. */
- if (in_ssa_form)
- for_each_successor_phi (bb, &set_phi_alternative_reg,
- new_live_at_end);
-
if (bb == ENTRY_BLOCK_PTR)
{
COPY_REG_SET (bb->global_live_at_end, new_live_at_end);
@@ -1864,8 +1836,8 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
/* If this block ends in a conditional branch, for each register
live from one side of the branch and not the other, record the
register as conditionally dead. */
- if (GET_CODE (bb->end) == JUMP_INSN
- && any_condjump_p (bb->end))
+ if (GET_CODE (BB_END (bb)) == JUMP_INSN
+ && any_condjump_p (BB_END (bb)))
{
regset_head diff_head;
regset diff = INITIALIZE_REG_SET (diff_head);
@@ -1890,7 +1862,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
else
{
/* This can happen with a conditional jump to the next insn. */
- if (JUMP_LABEL (bb->end) != bb_true->head)
+ if (JUMP_LABEL (BB_END (bb)) != BB_HEAD (bb_true))
abort ();
/* Simplest way to do nothing. */
@@ -1902,7 +1874,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
bb_false->global_live_at_start, BITMAP_XOR))
{
/* Extract the condition from the branch. */
- rtx set_src = SET_SRC (pc_set (bb->end));
+ rtx set_src = SET_SRC (pc_set (BB_END (bb)));
rtx cond_true = XEXP (set_src, 0);
rtx reg = XEXP (cond_true, 0);
@@ -1971,7 +1943,7 @@ init_propagate_block_info (basic_block bb, regset live, regset local_set,
&& ! current_function_calls_eh_return)))
{
rtx insn, set;
- for (insn = bb->end; insn != bb->head; insn = PREV_INSN (insn))
+ for (insn = BB_END (bb); insn != BB_HEAD (bb); insn = PREV_INSN (insn))
if (GET_CODE (insn) == INSN
&& (set = single_set (insn))
&& GET_CODE (SET_DEST (set)) == MEM)
@@ -2051,7 +2023,7 @@ propagate_block (basic_block bb, regset live, regset local_set,
/* Scan the block an insn at a time from end to beginning. */
changed = 0;
- for (insn = bb->end;; insn = prev)
+ for (insn = BB_END (bb); ; insn = prev)
{
/* If this is a call to `setjmp' et al, warn if any
non-volatile datum is live. */
@@ -2066,7 +2038,7 @@ propagate_block (basic_block bb, regset live, regset local_set,
else
changed |= NEXT_INSN (prev) != insn;
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
break;
}
@@ -2465,6 +2437,7 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
rtx cond = NULL_RTX;
rtx link;
enum rtx_code code;
+ int flags = pbi->flags;
if (insn)
for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
@@ -2473,14 +2446,17 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
mark_set_1 (pbi, SET, XEXP (link, 0),
(GET_CODE (x) == COND_EXEC
? COND_EXEC_TEST (x) : NULL_RTX),
- insn, pbi->flags);
+ insn, flags);
}
retry:
switch (code = GET_CODE (x))
{
case SET:
+ if (GET_CODE (XEXP (x, 1)) == ASM_OPERANDS)
+ flags |= PROP_ASM_SCAN;
+ /* Fall through */
case CLOBBER:
- mark_set_1 (pbi, code, SET_DEST (x), cond, insn, pbi->flags);
+ mark_set_1 (pbi, code, SET_DEST (x), cond, insn, flags);
return;
case COND_EXEC:
@@ -2492,7 +2468,9 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
{
int i;
- for (i = XVECLEN (x, 0) - 1; i >= 0; i--)
+ /* We must scan forwards. If we have an asm, we need to set
+ the PROP_ASM_SCAN flag before scanning the clobbers. */
+ for (i = 0; i < XVECLEN (x, 0); i++)
{
rtx sub = XVECEXP (x, 0, i);
switch (code = GET_CODE (sub))
@@ -2503,13 +2481,24 @@ mark_set_regs (struct propagate_block_info *pbi, rtx x, rtx insn)
cond = COND_EXEC_TEST (sub);
sub = COND_EXEC_CODE (sub);
- if (GET_CODE (sub) != SET && GET_CODE (sub) != CLOBBER)
- break;
- /* Fall through. */
+ if (GET_CODE (sub) == SET)
+ goto mark_set;
+ if (GET_CODE (sub) == CLOBBER)
+ goto mark_clob;
+ break;
case SET:
+ mark_set:
+ if (GET_CODE (XEXP (sub, 1)) == ASM_OPERANDS)
+ flags |= PROP_ASM_SCAN;
+ /* Fall through */
case CLOBBER:
- mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, pbi->flags);
+ mark_clob:
+ mark_set_1 (pbi, code, SET_DEST (sub), cond, insn, flags);
+ break;
+
+ case ASM_OPERANDS:
+ flags |= PROP_ASM_SCAN;
break;
default:
@@ -2733,6 +2722,9 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c
{
for (i = regno_first; i <= regno_last; i++)
regs_ever_live[i] = 1;
+ if (flags & PROP_ASM_SCAN)
+ for (i = regno_first; i <= regno_last; i++)
+ regs_asm_clobbered[i] = 1;
}
else
{
@@ -2818,6 +2810,14 @@ mark_set_1 (struct propagate_block_info *pbi, enum rtx_code code, rtx reg, rtx c
{
if (flags & (PROP_LOG_LINKS | PROP_AUTOINC))
pbi->reg_next_use[regno_first] = 0;
+
+ if ((flags & PROP_REG_INFO) != 0
+ && (flags & PROP_ASM_SCAN) != 0
+ && regno_first < FIRST_PSEUDO_REGISTER)
+ {
+ for (i = regno_first; i <= regno_last; i++)
+ regs_asm_clobbered[i] = 1;
+ }
}
/* If this is the last pass and this is a SCRATCH, show it will be dying
@@ -3311,8 +3311,8 @@ attempt_auto_inc (struct propagate_block_info *pbi, rtx inc, rtx insn,
new insn(s) and do the updates. */
emit_insn_before (insns, insn);
- if (pbi->bb->head == insn)
- pbi->bb->head = insns;
+ if (BB_HEAD (pbi->bb) == insn)
+ BB_HEAD (pbi->bb) = insns;
/* INCR will become a NOTE and INSN won't contain a
use of INCR_REG. If a use of INCR_REG was just placed in
@@ -3908,14 +3908,6 @@ mark_used_regs (struct propagate_block_info *pbi, rtx x, rtx cond, rtx insn)
x = COND_EXEC_CODE (x);
goto retry;
- case PHI:
- /* We _do_not_ want to scan operands of phi nodes. Operands of
- a phi function are evaluated only when control reaches this
- block along a particular edge. Therefore, regs that appear
- as arguments to phi should not be added to the global live at
- start. */
- return;
-
default:
break;
}
@@ -4197,65 +4189,95 @@ int
count_or_remove_death_notes (sbitmap blocks, int kill)
{
int count = 0;
+ int i;
basic_block bb;
- FOR_EACH_BB_REVERSE (bb)
+
+ /* This used to be a loop over all the blocks with a membership test
+ inside the loop. That can be amazingly expensive on a large CFG
+ when only a small number of bits are set in BLOCKs (for example,
+ the calls from the scheduler typically have very few bits set).
+
+ For extra credit, someone should convert BLOCKS to a bitmap rather
+ than an sbitmap. */
+ if (blocks)
{
- rtx insn;
+ EXECUTE_IF_SET_IN_SBITMAP (blocks, 0, i,
+ {
+ count += count_or_remove_death_notes_bb (BASIC_BLOCK (i), kill);
+ });
+ }
+ else
+ {
+ FOR_EACH_BB (bb)
+ {
+ count += count_or_remove_death_notes_bb (bb, kill);
+ }
+ }
- if (blocks && ! TEST_BIT (blocks, bb->index))
- continue;
+ return count;
+}
+
+/* Optionally removes all the REG_DEAD and REG_UNUSED notes from basic
+ block BB. Returns a count of the number of registers that died. */
- for (insn = bb->head;; insn = NEXT_INSN (insn))
+static int
+count_or_remove_death_notes_bb (basic_block bb, int kill)
+{
+ int count = 0;
+ rtx insn;
+
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
+ {
+ if (INSN_P (insn))
{
- if (INSN_P (insn))
- {
- rtx *pprev = &REG_NOTES (insn);
- rtx link = *pprev;
+ rtx *pprev = &REG_NOTES (insn);
+ rtx link = *pprev;
- while (link)
+ while (link)
+ {
+ switch (REG_NOTE_KIND (link))
{
- switch (REG_NOTE_KIND (link))
+ case REG_DEAD:
+ if (GET_CODE (XEXP (link, 0)) == REG)
+ {
+ rtx reg = XEXP (link, 0);
+ int n;
+
+ if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
+ n = 1;
+ else
+ n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
+ count += n;
+ }
+
+ /* Fall through. */
+
+ case REG_UNUSED:
+ if (kill)
{
- case REG_DEAD:
- if (GET_CODE (XEXP (link, 0)) == REG)
- {
- rtx reg = XEXP (link, 0);
- int n;
-
- if (REGNO (reg) >= FIRST_PSEUDO_REGISTER)
- n = 1;
- else
- n = HARD_REGNO_NREGS (REGNO (reg), GET_MODE (reg));
- count += n;
- }
- /* Fall through. */
-
- case REG_UNUSED:
- if (kill)
- {
- rtx next = XEXP (link, 1);
- free_EXPR_LIST_node (link);
- *pprev = link = next;
- break;
- }
- /* Fall through. */
-
- default:
- pprev = &XEXP (link, 1);
- link = *pprev;
+ rtx next = XEXP (link, 1);
+ free_EXPR_LIST_node (link);
+ *pprev = link = next;
break;
}
+ /* Fall through. */
+
+ default:
+ pprev = &XEXP (link, 1);
+ link = *pprev;
+ break;
}
}
-
- if (insn == bb->end)
- break;
}
+
+ if (insn == BB_END (bb))
+ break;
}
return count;
}
+
/* Clear LOG_LINKS fields of insns in a selected blocks or whole chain
if blocks is NULL. */
@@ -4276,7 +4298,7 @@ clear_log_links (sbitmap blocks)
{
basic_block bb = BASIC_BLOCK (i);
- for (insn = bb->head; insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
if (INSN_P (insn))
free_INSN_LIST_list (&LOG_LINKS (insn));
diff --git a/gcc/fold-const.c b/gcc/fold-const.c
index f248cd6ba51..7a939c49666 100644
--- a/gcc/fold-const.c
+++ b/gcc/fold-const.c
@@ -4433,8 +4433,11 @@ extract_muldiv_1 (tree t, tree c, enum tree_code code, tree wide_type)
if (code == MULT_EXPR
|| integer_zerop (const_binop (TRUNC_MOD_EXPR, op1, c, 0)))
{
- op1 = const_binop (code, convert (ctype, op1), convert (ctype, c), 0);
- if (op1 == 0 || TREE_OVERFLOW (op1))
+ op1 = const_binop (code, convert (ctype, op1),
+ convert (ctype, c), 0);
+ /* We allow the constant to overflow with wrapping semantics. */
+ if (op1 == 0
+ || (TREE_OVERFLOW (op1) && ! flag_wrapv))
break;
}
else
@@ -5036,7 +5039,7 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
int bitnum = tree_log2 (TREE_OPERAND (arg0, 1));
enum machine_mode operand_mode = TYPE_MODE (type);
int ops_unsigned;
- tree signed_type, unsigned_type;
+ tree signed_type, unsigned_type, intermediate_type;
tree arg00;
/* If we have (A & C) != 0 where C is the sign bit of A, convert
@@ -5082,22 +5085,23 @@ fold_single_bit_test (enum tree_code code, tree arg0, tree arg1,
signed_type = (*lang_hooks.types.type_for_mode) (operand_mode, 0);
unsigned_type = (*lang_hooks.types.type_for_mode) (operand_mode, 1);
+ intermediate_type = ops_unsigned ? unsigned_type : signed_type;
+ inner = convert (intermediate_type, inner);
if (bitnum != 0)
- inner = build (RSHIFT_EXPR, ops_unsigned ? unsigned_type : signed_type,
+ inner = build (RSHIFT_EXPR, intermediate_type,
inner, size_int (bitnum));
if (code == EQ_EXPR)
- inner = build (BIT_XOR_EXPR, ops_unsigned ? unsigned_type : signed_type,
+ inner = build (BIT_XOR_EXPR, intermediate_type,
inner, integer_one_node);
/* Put the AND last so it can combine with more things. */
- inner = build (BIT_AND_EXPR, ops_unsigned ? unsigned_type : signed_type,
+ inner = build (BIT_AND_EXPR, intermediate_type,
inner, integer_one_node);
/* Make sure to return the proper type. */
- if (TREE_TYPE (inner) != result_type)
- inner = convert (result_type, inner);
+ inner = convert (result_type, inner);
return inner;
}
@@ -5201,9 +5205,6 @@ fold (tree expr)
if (kind == 'c')
return t;
-#ifdef MAX_INTEGER_COMPUTATION_MODE
- check_max_integer_computation_mode (expr);
-#endif
orig_t = t;
if (code == NOP_EXPR || code == FLOAT_EXPR || code == CONVERT_EXPR)
@@ -7714,7 +7715,8 @@ fold (tree expr)
&& (optimize || TREE_CODE (arg1) == INTEGER_CST))
{
t1 = optimize_bit_field_compare (code, type, arg0, arg1);
- return t1 ? t1 : t;
+ if (t1)
+ return t1;
}
/* If this is a comparison of complex values and either or both sides
@@ -7862,9 +7864,17 @@ fold (tree expr)
/* Pedantic ANSI C says that a conditional expression is never an lvalue,
so all simple results must be passed through pedantic_non_lvalue. */
if (TREE_CODE (arg0) == INTEGER_CST)
- return pedantic_non_lvalue
- (TREE_OPERAND (t, (integer_zerop (arg0) ? 2 : 1)));
- else if (operand_equal_p (arg1, TREE_OPERAND (expr, 2), 0))
+ {
+ tem = TREE_OPERAND (t, (integer_zerop (arg0) ? 2 : 1));
+ /* Only optimize constant conditions when the selected branch
+ has the same type as the COND_EXPR. This avoids optimizing
+ away "c ? x : throw", where the throw has a void type. */
+ if (! VOID_TYPE_P (TREE_TYPE (tem))
+ || VOID_TYPE_P (TREE_TYPE (t)))
+ return pedantic_non_lvalue (tem);
+ return t;
+ }
+ if (operand_equal_p (arg1, TREE_OPERAND (expr, 2), 0))
return pedantic_omit_one_operand (type, arg1, arg0);
/* If we have A op B ? A : C, we may be able to convert this to a
diff --git a/gcc/function.c b/gcc/function.c
index 6531c022f9e..1da182af4dc 100644
--- a/gcc/function.c
+++ b/gcc/function.c
@@ -295,7 +295,7 @@ static tree split_complex_args (tree);
static void set_insn_locators (rtx, int) ATTRIBUTE_UNUSED;
/* Pointer to chain of `struct function' for containing functions. */
-static GTY(()) struct function *outer_function_chain;
+struct function *outer_function_chain;
/* List of insns that were postponed by purge_addressof_1. */
static rtx postponed_insns;
@@ -452,6 +452,7 @@ free_after_compilation (struct function *f)
f->x_nonlocal_goto_stack_level = NULL;
f->x_cleanup_label = NULL;
f->x_return_label = NULL;
+ f->x_naked_return_label = NULL;
f->computed_goto_common_label = NULL;
f->computed_goto_common_reg = NULL;
f->x_save_expr_regs = NULL;
@@ -2091,7 +2092,23 @@ fixup_var_refs_1 (rtx var, enum machine_mode promoted_mode, rtx *loc, rtx insn,
replacement = find_fixup_replacement (replacements, x);
if (replacement->new)
{
+ enum machine_mode mode = GET_MODE (x);
*loc = replacement->new;
+
+ /* Careful! We may have just replaced a SUBREG by a MEM, which
+ means that the insn may have become invalid again. We can't
+ in this case make a new replacement since we already have one
+ and we must deal with MATCH_DUPs. */
+ if (GET_CODE (replacement->new) == MEM)
+ {
+ INSN_CODE (insn) = -1;
+ if (recog_memoized (insn) >= 0)
+ return;
+
+ fixup_var_refs_1 (replacement->new, mode, &PATTERN (insn),
+ insn, replacements, no_share);
+ }
+
return;
}
@@ -2851,7 +2868,17 @@ gen_mem_addressof (rtx reg, tree decl, int rescan)
fixup_var_refs (reg, GET_MODE (reg), TREE_UNSIGNED (type), reg, 0);
}
else if (rescan)
- fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0);
+ {
+ /* This can only happen during reload. Clear the same flag bits as
+ reload. */
+ MEM_VOLATILE_P (reg) = 0;
+ RTX_UNCHANGING_P (reg) = 0;
+ MEM_IN_STRUCT_P (reg) = 0;
+ MEM_SCALAR_P (reg) = 0;
+ MEM_ATTRS (reg) = 0;
+
+ fixup_var_refs (reg, GET_MODE (reg), 0, reg, 0);
+ }
return reg;
}
@@ -2929,6 +2956,7 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone,
int i, j;
const char *fmt;
bool result = true;
+ bool libcall = false;
/* Re-start here to avoid recursion in common cases. */
restart:
@@ -2937,6 +2965,10 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone,
if (x == 0)
return true;
+ /* Is this a libcall? */
+ if (!insn)
+ libcall = REG_NOTE_KIND (*loc) == REG_RETVAL;
+
code = GET_CODE (x);
/* If we don't return in any of the cases below, we will recurse inside
@@ -3070,28 +3102,27 @@ purge_addressof_1 (rtx *loc, rtx insn, int force, int store, int may_postpone,
which can be succinctly described with a simple SUBREG.
Note that removing the REG_EQUAL note is not an option
on the last insn of a libcall, so we must do a replacement. */
- if (! purge_addressof_replacements
- && ! purge_bitfield_addressof_replacements)
+
+ /* In compile/990107-1.c:7 compiled at -O1 -m1 for sh-elf,
+ we got
+ (mem:DI (addressof:SI (reg/v:DF 160) 159 0x401c8510)
+ [0 S8 A32]), which can be expressed with a simple
+ same-size subreg */
+ if ((GET_MODE_SIZE (GET_MODE (x))
+ <= GET_MODE_SIZE (GET_MODE (sub)))
+ /* Again, invalid pointer casts (as in
+ compile/990203-1.c) can require paradoxical
+ subregs. */
+ || (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
+ && (GET_MODE_SIZE (GET_MODE (x))
+ > GET_MODE_SIZE (GET_MODE (sub)))
+ && libcall))
{
- /* In compile/990107-1.c:7 compiled at -O1 -m1 for sh-elf,
- we got
- (mem:DI (addressof:SI (reg/v:DF 160) 159 0x401c8510)
- [0 S8 A32]), which can be expressed with a simple
- same-size subreg */
- if ((GET_MODE_SIZE (GET_MODE (x))
- == GET_MODE_SIZE (GET_MODE (sub)))
- /* Again, invalid pointer casts (as in
- compile/990203-1.c) can require paradoxical
- subregs. */
- || (GET_MODE_SIZE (GET_MODE (x)) > UNITS_PER_WORD
- && (GET_MODE_SIZE (GET_MODE (x))
- > GET_MODE_SIZE (GET_MODE (sub)))))
- {
- *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
- return true;
- }
- /* ??? Are there other cases we should handle? */
+ *loc = gen_rtx_SUBREG (GET_MODE (x), sub, 0);
+ return true;
}
+ /* ??? Are there other cases we should handle? */
+
/* Sometimes we may not be able to find the replacement. For
example when the original insn was a MEM in a wider mode,
and the note is part of a sign extension of a narrowed
@@ -4256,7 +4287,7 @@ assign_parms (tree fndecl)
the function returns a structure. */
tree function_result_decl = 0;
int varargs_setup = 0;
- int reg_parm_stack_space = 0;
+ int reg_parm_stack_space ATTRIBUTE_UNUSED = 0;
rtx conversion_insns = 0;
/* Nonzero if function takes extra anonymous args.
@@ -4700,6 +4731,40 @@ assign_parms (tree fndecl)
Set DECL_RTL to that place. */
+ if (GET_CODE (entry_parm) == PARALLEL && nominal_mode != BLKmode
+ && XVECLEN (entry_parm, 0) > 1)
+ {
+ /* Reconstitute objects the size of a register or larger using
+ register operations instead of the stack. */
+ rtx parmreg = gen_reg_rtx (nominal_mode);
+
+ if (REG_P (parmreg))
+ {
+ unsigned int regno = REGNO (parmreg);
+
+ emit_group_store (parmreg, entry_parm, TREE_TYPE (parm),
+ int_size_in_bytes (TREE_TYPE (parm)));
+ SET_DECL_RTL (parm, parmreg);
+
+ if (regno >= max_parm_reg)
+ {
+ rtx *new;
+ int old_max_parm_reg = max_parm_reg;
+
+ /* It's slow to expand this one register at a time,
+ but it's also rare and we need max_parm_reg to be
+ precisely correct. */
+ max_parm_reg = regno + 1;
+ new = ggc_realloc (parm_reg_stack_loc,
+ max_parm_reg * sizeof (rtx));
+ memset (new + old_max_parm_reg, 0,
+ (max_parm_reg - old_max_parm_reg) * sizeof (rtx));
+ parm_reg_stack_loc = new;
+ parm_reg_stack_loc[regno] = stack_parm;
+ }
+ }
+ }
+
if (nominal_mode == BLKmode
#ifdef BLOCK_REG_PADDING
|| (locate.where_pad == (BYTES_BIG_ENDIAN ? upward : downward)
@@ -4723,7 +4788,8 @@ assign_parms (tree fndecl)
assign_stack_local if space was not allocated in the argument
list. If it was, this will not work if PARM_BOUNDARY is not
a multiple of BITS_PER_WORD. It isn't clear how to fix this
- if it becomes a problem. */
+ if it becomes a problem. Exception is when BLKmode arrives
+ with arguments not conforming to word_mode. */
if (stack_parm == 0)
{
@@ -4731,7 +4797,9 @@ assign_parms (tree fndecl)
PUT_MODE (stack_parm, GET_MODE (entry_parm));
set_mem_attributes (stack_parm, parm, 1);
}
-
+ else if (GET_CODE (entry_parm) == PARALLEL
+ && GET_MODE(entry_parm) == BLKmode)
+ ;
else if (PARM_BOUNDARY % BITS_PER_WORD != 0)
abort ();
@@ -4794,7 +4862,10 @@ assign_parms (tree fndecl)
move_block_from_reg (REGNO (entry_parm), mem,
size_stored / UNITS_PER_WORD);
}
- SET_DECL_RTL (parm, stack_parm);
+ /* If parm is already bound to register pair, don't change
+ this binding. */
+ if (! DECL_RTL_SET_P (parm))
+ SET_DECL_RTL (parm, stack_parm);
}
else if (! ((! optimize
&& ! DECL_REGISTER (parm))
@@ -4943,13 +5014,13 @@ assign_parms (tree fndecl)
else if (passed_pointer
&& FUNCTION_ARG_CALLEE_COPIES (args_so_far,
- TYPE_MODE (DECL_ARG_TYPE (parm)),
- DECL_ARG_TYPE (parm),
+ TYPE_MODE (TREE_TYPE (passed_type)),
+ TREE_TYPE (passed_type),
named_arg)
- && ! TREE_ADDRESSABLE (DECL_ARG_TYPE (parm)))
+ && ! TREE_ADDRESSABLE (TREE_TYPE (passed_type)))
{
rtx copy;
- tree type = DECL_ARG_TYPE (parm);
+ tree type = TREE_TYPE (passed_type);
/* This sequence may involve a library call perhaps clobbering
registers that haven't been copied to pseudos yet. */
@@ -6337,8 +6408,6 @@ allocate_struct_function (tree fndecl)
DECL_SAVED_INSNS (fndecl) = cfun;
cfun->decl = fndecl;
- current_function_name = (*lang_hooks.decl_printable_name) (fndecl, 2);
-
result = DECL_RESULT (fndecl);
if (aggregate_value_p (result, fndecl))
{
@@ -6681,7 +6750,7 @@ expand_function_start (tree subr, int parms_have_cleanups)
tem = decl_function_context (tem);
if (tem == 0)
break;
- /* Chain thru stack frames, assuming pointer to next lexical frame
+ /* Chain through stack frames, assuming pointer to next lexical frame
is found at the place we always store it. */
#ifdef FRAME_GROWS_DOWNWARD
last_ptr = plus_constant (last_ptr,
@@ -6986,16 +7055,14 @@ expand_function_end (void)
/* 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. */
-#ifdef EXIT_IGNORE_STACK
- if (! EXIT_IGNORE_STACK)
-#endif
- if (current_function_calls_alloca)
- {
- rtx tem = 0;
+ if (! EXIT_IGNORE_STACK
+ && current_function_calls_alloca)
+ {
+ rtx tem = 0;
- emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn);
- emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX);
- }
+ emit_stack_save (SAVE_FUNCTION, &tem, parm_birth_insn);
+ emit_stack_restore (SAVE_FUNCTION, tem, NULL_RTX);
+ }
/* 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
@@ -7107,6 +7174,11 @@ expand_function_end (void)
cfun->x_clobber_return_insn = after;
}
+ /* Output the label for the naked return from the function, if one is
+ expected. This is currently used only by __builtin_return. */
+ if (naked_return_label)
+ emit_label (naked_return_label);
+
/* ??? 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
@@ -7246,9 +7318,9 @@ sibcall_epilogue_contains (rtx insn)
static void
emit_return_into_block (basic_block bb, rtx line_note)
{
- emit_jump_insn_after (gen_return (), bb->end);
+ emit_jump_insn_after (gen_return (), BB_END (bb));
if (line_note)
- emit_note_copy_after (line_note, PREV_INSN (bb->end));
+ emit_note_copy_after (line_note, PREV_INSN (BB_END (bb)));
}
#endif /* HAVE_return */
@@ -7292,9 +7364,12 @@ struct epi_info
rtx equiv_reg_src; /* If nonzero, the value that SP_EQUIV_REG
should be set to once we no longer need
its value. */
+ rtx const_equiv[FIRST_PSEUDO_REGISTER]; /* Any known constant equivalences
+ for registers. */
};
static void handle_epilogue_set (rtx, struct epi_info *);
+static void update_epilogue_consts (rtx, rtx, void *);
static void emit_equiv_load (struct epi_info *);
/* Modify INSN, a list of one or more insns that is part of the epilogue, to
@@ -7307,8 +7382,7 @@ keep_stack_depressed (rtx insns)
struct epi_info info;
rtx insn, next;
- /* If the epilogue is just a single instruction, it ust be OK as is. */
-
+ /* If the epilogue is just a single instruction, it must be OK as is. */
if (NEXT_INSN (insns) == NULL_RTX)
return insns;
@@ -7320,6 +7394,9 @@ keep_stack_depressed (rtx insns)
info.sp_offset = 0;
info.equiv_reg_src = 0;
+ for (j = 0; j < FIRST_PSEUDO_REGISTER; j++)
+ info.const_equiv[j] = 0;
+
insn = insns;
next = NULL_RTX;
while (insn != NULL_RTX)
@@ -7411,7 +7488,8 @@ keep_stack_depressed (rtx insns)
&& !refers_to_regno_p (regno,
regno + HARD_REGNO_NREGS (regno,
Pmode),
- info.equiv_reg_src, NULL))
+ info.equiv_reg_src, NULL)
+ && info.const_equiv[regno] == 0)
break;
if (regno == FIRST_PSEUDO_REGISTER)
@@ -7467,6 +7545,8 @@ keep_stack_depressed (rtx insns)
info.sp_equiv_reg = info.new_sp_equiv_reg;
info.sp_offset = info.new_sp_offset;
+ /* Now update any constants this insn sets. */
+ note_stores (PATTERN (insn), update_epilogue_consts, &info);
insn = next;
}
@@ -7490,11 +7570,18 @@ handle_epilogue_set (rtx set, struct epi_info *p)
if (SET_DEST (set) != stack_pointer_rtx)
abort ();
- if (GET_CODE (SET_SRC (set)) == PLUS
- && GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
+ if (GET_CODE (SET_SRC (set)) == PLUS)
{
p->new_sp_equiv_reg = XEXP (SET_SRC (set), 0);
- p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1));
+ if (GET_CODE (XEXP (SET_SRC (set), 1)) == CONST_INT)
+ p->new_sp_offset = INTVAL (XEXP (SET_SRC (set), 1));
+ else if (GET_CODE (XEXP (SET_SRC (set), 1)) == REG
+ && REGNO (XEXP (SET_SRC (set), 1)) < FIRST_PSEUDO_REGISTER
+ && p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))] != 0)
+ p->new_sp_offset
+ = INTVAL (p->const_equiv[REGNO (XEXP (SET_SRC (set), 1))]);
+ else
+ abort ();
}
else
p->new_sp_equiv_reg = SET_SRC (set), p->new_sp_offset = 0;
@@ -7517,11 +7604,16 @@ handle_epilogue_set (rtx set, struct epi_info *p)
there seems little point in handling that case. Note that we have
to allow for the case where we are setting the register set in
the previous part of a PARALLEL inside a single insn. But use the
- old offset for any updates within this insn. */
+ old offset for any updates within this insn. We must allow for the case
+ where the register is being set in a different (usually wider) mode than
+ Pmode). */
else if (p->new_sp_equiv_reg != 0 && reg_set_p (p->new_sp_equiv_reg, set))
{
- if (!rtx_equal_p (p->new_sp_equiv_reg, SET_DEST (set))
- || p->equiv_reg_src != 0)
+ if (p->equiv_reg_src != 0
+ || GET_CODE (p->new_sp_equiv_reg) != REG
+ || GET_CODE (SET_DEST (set)) != REG
+ || GET_MODE_BITSIZE (GET_MODE (SET_DEST (set))) > BITS_PER_WORD
+ || REGNO (p->new_sp_equiv_reg) != REGNO (SET_DEST (set)))
abort ();
else
p->equiv_reg_src
@@ -7544,15 +7636,38 @@ handle_epilogue_set (rtx set, struct epi_info *p)
}
}
+/* Update the tracking information for registers set to constants. */
+
+static void
+update_epilogue_consts (rtx dest, rtx x, void *data)
+{
+ struct epi_info *p = (struct epi_info *) data;
+
+ if (GET_CODE (dest) != REG || REGNO (dest) >= FIRST_PSEUDO_REGISTER)
+ return;
+ else if (GET_CODE (x) == CLOBBER || ! rtx_equal_p (dest, SET_DEST (x))
+ || GET_CODE (SET_SRC (x)) != CONST_INT)
+ p->const_equiv[REGNO (dest)] = 0;
+ else
+ p->const_equiv[REGNO (dest)] = SET_SRC (x);
+}
+
/* Emit an insn to do the load shown in p->equiv_reg_src, if needed. */
static void
emit_equiv_load (struct epi_info *p)
{
if (p->equiv_reg_src != 0)
- emit_move_insn (p->sp_equiv_reg, p->equiv_reg_src);
+ {
+ rtx dest = p->sp_equiv_reg;
+
+ if (GET_MODE (p->equiv_reg_src) != GET_MODE (dest))
+ dest = gen_rtx_REG (GET_MODE (p->equiv_reg_src),
+ REGNO (p->sp_equiv_reg));
- p->equiv_reg_src = 0;
+ emit_move_insn (dest, p->equiv_reg_src);
+ p->equiv_reg_src = 0;
+ }
}
#endif
@@ -7630,7 +7745,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
last = e->src;
/* Verify that there are no active instructions in the last block. */
- label = last->end;
+ label = BB_END (last);
while (label && GET_CODE (label) != CODE_LABEL)
{
if (active_insn_p (label))
@@ -7638,7 +7753,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
label = PREV_INSN (label);
}
- if (last->head == label && GET_CODE (label) == CODE_LABEL)
+ if (BB_HEAD (last) == label && GET_CODE (label) == CODE_LABEL)
{
rtx epilogue_line_note = NULL_RTX;
@@ -7662,7 +7777,7 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
if (bb == ENTRY_BLOCK_PTR)
continue;
- jump = bb->end;
+ jump = BB_END (bb);
if ((GET_CODE (jump) != JUMP_INSN) || JUMP_LABEL (jump) != label)
continue;
@@ -7697,9 +7812,9 @@ thread_prologue_and_epilogue_insns (rtx f ATTRIBUTE_UNUSED)
/* Emit a return insn for the exit fallthru block. Whether
this is still reachable will be determined later. */
- emit_barrier_after (last->end);
+ emit_barrier_after (BB_END (last));
emit_return_into_block (last, epilogue_line_note);
- epilogue_end = last->end;
+ epilogue_end = BB_END (last);
last->succ->flags &= ~EDGE_FALLTHRU;
goto epilogue_done;
}
@@ -7755,7 +7870,7 @@ epilogue_done:
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
{
basic_block bb = e->src;
- rtx insn = bb->end;
+ rtx insn = BB_END (bb);
rtx i;
rtx newinsn;
@@ -7812,7 +7927,7 @@ epilogue_done:
}
/* Find the last line number note in the first block. */
- for (insn = ENTRY_BLOCK_PTR->next_bb->end;
+ for (insn = BB_END (ENTRY_BLOCK_PTR->next_bb);
insn != prologue_end && insn;
insn = PREV_INSN (insn))
if (GET_CODE (insn) == NOTE && NOTE_LINE_NUMBER (insn) > 0)
diff --git a/gcc/function.h b/gcc/function.h
index 9c06d95a095..44fcb3fc378 100644
--- a/gcc/function.h
+++ b/gcc/function.h
@@ -183,9 +183,6 @@ struct function GTY(())
/* For function.c. */
- /* Name of this function. */
- const char *name;
-
/* Points to the FUNCTION_DECL of this function. */
tree decl;
@@ -270,6 +267,11 @@ struct function GTY(())
on machines which require execution of the epilogue on all returns. */
rtx x_return_label;
+ /* Label that will go on the end of function epilogue.
+ Jumping to this label serves as a "naked return" instruction
+ on machines which require execution of the epilogue on all returns. */
+ rtx x_naked_return_label;
+
/* Label and register for unswitching computed gotos. */
rtx computed_goto_common_label;
rtx computed_goto_common_reg;
@@ -455,9 +457,10 @@ struct function GTY(())
/* 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. */
+ /* Nonzero if the current function is a thunk, i.e., a lightweight
+ function implemented by the output_mi_thunk hook) that just
+ adjusts one of its arguments and forwards to another
+ function. */
unsigned int is_thunk : 1;
/* This bit is used by the exception handling logic. It is set if all
@@ -519,6 +522,9 @@ struct function GTY(())
/* The function currently being compiled. */
extern GTY(()) struct function *cfun;
+/* Pointer to chain of `struct function' for containing functions. */
+extern GTY(()) struct function *outer_function_chain;
+
/* Nonzero if we've already converted virtual regs to hard regs. */
extern int virtuals_instantiated;
@@ -526,7 +532,6 @@ extern int virtuals_instantiated;
extern int trampolines_created;
/* For backward compatibility... eventually these should all go away. */
-#define current_function_name (cfun->name)
#define current_function_pops_args (cfun->pops_args)
#define current_function_returns_struct (cfun->returns_struct)
#define current_function_returns_pcc_struct (cfun->returns_pcc_struct)
@@ -563,6 +568,7 @@ extern int trampolines_created;
#define parm_reg_stack_loc (cfun->x_parm_reg_stack_loc)
#define cleanup_label (cfun->x_cleanup_label)
#define return_label (cfun->x_return_label)
+#define naked_return_label (cfun->x_naked_return_label)
#define save_expr_regs (cfun->x_save_expr_regs)
#define stack_slot_list (cfun->x_stack_slot_list)
#define parm_birth_insn (cfun->x_parm_birth_insn)
diff --git a/gcc/future.options b/gcc/future.options
deleted file mode 100644
index 6654dd0b84e..00000000000
--- a/gcc/future.options
+++ /dev/null
@@ -1,40 +0,0 @@
-From: friedman@gnu.ai.mit.edu (Noah Friedman)
-To: roland@gnu.ai.mit.edu (Roland McGrath),
- rms@gnu.ai.mit.edu (Richard Stallman),
- jimb@gnu.ai.mit.edu (Jim Blandy),
- mib@gnu.ai.mit.edu (Michael Bushnell)
-Cc: cgw@sol.acs.unt.edu (chris williams),
- clc@gnu.ai.mit.edu (Christian Longshore Claiborn)
-Subject: Some gcc options we'd like to see.
-Date: Mon, 28 Jun 93 00:45:09 EST
-Reply-To: friedman@gnu.ai.mit.edu
-
--Waggravate-return
--Wcast-spell
--Wcaste-align
--Win
--Wmissing-protons
--Wredundant-repetitions
--antsy
--fbungee-jump
--fexpensive-operations
--fextra-strength
--fjesus-saves
--fkeep-programmers-inline
--fno-peeping-toms
--fruit-roll-ups
--fshort-enough
--mno-dialogue
--pedophile
--vomit-frame-pointer
-
-From: Alexandre Oliva <aoliva@redhat.com>
-Date: 06 Jan 2002 17:37:07 -0200
-
-On Jan 2, 2002, in a long, heated thread concerning the interpretation
-of certain passages of the C standard, jtv <jtv@xs4all.nl> wrote:
-
-> (Yes, I'm a pedant. I'm pining for the day when gcc will support the
-> options "-ffascist -Wanal")
-
-How about introducing the options `-flame -War' :-)
diff --git a/gcc/gcc.c b/gcc/gcc.c
index b54fc0796f7..20d54074f24 100644
--- a/gcc/gcc.c
+++ b/gcc/gcc.c
@@ -73,6 +73,7 @@ compilation is specified by a string called a "spec". */
#include "config.h"
#include "system.h"
#include "coretypes.h"
+#include "multilib.h" /* before tm.h */
#include "tm.h"
#include <signal.h>
#if ! defined( SIGCHLD ) && defined( SIGCLD )
@@ -676,7 +677,7 @@ proper position among the other output files. */
%{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\
%(linker) %l " LINK_PIE_SPEC "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
%{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
- %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs:-lgcov}\
+ %{static:} %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate:-lgcov}\
%{!nostdlib:%{!nodefaultlibs:%(link_gcc_c_sequence)}}\
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} }}}}}}"
#endif
@@ -791,7 +792,6 @@ static const char *multilib_select;
static const char *multilib_matches;
static const char *multilib_defaults;
static const char *multilib_exclusions;
-#include "multilib.h"
/* Check whether a particular argument is a default argument. */
@@ -1633,12 +1633,14 @@ init_spec (void)
#else
"-lgcc_s%M"
#endif
+ ,
+ "-lgcc",
+ "-lgcc_eh"
#ifdef USE_LIBUNWIND_EXCEPTIONS
" -lunwind"
#endif
- ,
- "-lgcc",
- "-lgcc_eh");
+ );
+
p += 5;
in_sep = 0;
}
@@ -1654,7 +1656,11 @@ init_spec (void)
#endif
,
"libgcc.a%s",
- "libgcc_eh.a%s");
+ "libgcc_eh.a%s"
+#ifdef USE_LIBUNWIND_EXCEPTIONS
+ " -lunwind"
+#endif
+ );
p += 10;
in_sep = 0;
}
@@ -2678,7 +2684,14 @@ execute (void)
}
fflush (stderr);
if (verbose_only_flag != 0)
- return 0;
+ {
+ /* verbose_only_flag should act as if the spec was
+ executed, so increment execution_count before
+ returning. This prevents spurious warnings about
+ unused linker input files, etc. */
+ execution_count++;
+ return 0;
+ }
#ifdef DEBUG
notice ("\nGo ahead? (y or n) ");
fflush (stderr);
@@ -2809,7 +2822,7 @@ execute (void)
fatal ("\
Internal error: %s (program %s)\n\
Please submit a full bug report.\n\
-See %s for instructions.",
+Send email to %s for instructions.",
strsignal (WTERMSIG (status)), commands[j].prog,
bug_report_url);
signal_count++;
@@ -4082,29 +4095,41 @@ set_collect_gcc_options (void)
if (switches[i].live_cond == SWITCH_IGNORE)
continue;
- obstack_grow (&collect_obstack, "'-", 2);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define QUOTE_STR "\""
+#define QUOTE_CHAR '"'
+#define QUOTED_QUOTE_STR "\"\\\"\""
+#else
+#define QUOTE_STR "\'"
+#define QUOTE_CHAR '\''
+#define QUOTED_QUOTE_STR "'\\''"
+#endif
+
+ obstack_grow (&collect_obstack, QUOTE_STR "-", 2);
q = switches[i].part1;
- while ((p = strchr (q, '\'')))
+ while ((p = strchr (q, QUOTE_CHAR)))
{
obstack_grow (&collect_obstack, q, p - q);
- obstack_grow (&collect_obstack, "'\\''", 4);
+ obstack_grow (&collect_obstack, QUOTED_QUOTE_STR,
+ strlen (QUOTED_QUOTE_STR));
q = ++p;
}
obstack_grow (&collect_obstack, q, strlen (q));
- obstack_grow (&collect_obstack, "'", 1);
+ obstack_grow (&collect_obstack, QUOTE_STR, 1);
for (args = switches[i].args; args && *args; args++)
{
- obstack_grow (&collect_obstack, " '", 2);
+ obstack_grow (&collect_obstack, " " QUOTE_STR, 2);
q = *args;
- while ((p = strchr (q, '\'')))
+ while ((p = strchr (q, QUOTE_CHAR)))
{
obstack_grow (&collect_obstack, q, p - q);
- obstack_grow (&collect_obstack, "'\\''", 4);
+ obstack_grow (&collect_obstack, QUOTED_QUOTE_STR,
+ strlen (QUOTED_QUOTE_STR));
q = ++p;
}
obstack_grow (&collect_obstack, q, strlen (q));
- obstack_grow (&collect_obstack, "'", 1);
+ obstack_grow (&collect_obstack, QUOTE_STR, 1);
}
}
obstack_grow (&collect_obstack, "\0", 1);
diff --git a/gcc/gcov.c b/gcc/gcov.c
index d3037c775b8..f95334a4319 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -906,7 +906,7 @@ read_graph_file (void)
}
gcov_close ();
- /* We built everything backwards, so nreverse them all */
+ /* We built everything backwards, so nreverse them all. */
/* Reverse sources. Not strictly necessary, but we'll then process
them in the 'expected' order. */
diff --git a/gcc/gcse.c b/gcc/gcse.c
index 3e09f02252b..cf845af0da7 100644
--- a/gcc/gcse.c
+++ b/gcc/gcse.c
@@ -150,6 +150,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "toplev.h"
#include "rtl.h"
+#include "tree.h"
#include "tm_p.h"
#include "regs.h"
#include "hard-reg-set.h"
@@ -160,6 +161,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "basic-block.h"
#include "output.h"
#include "function.h"
+#include "langhooks.h"
#include "expr.h"
#include "except.h"
#include "ggc.h"
@@ -468,7 +470,7 @@ struct ls_expr
struct ls_expr * next; /* Next in the list. */
int invalid; /* Invalid for some reason. */
int index; /* If it maps to a bitmap index. */
- int hash_index; /* Index when in a hash table. */
+ unsigned int hash_index; /* Index when in a hash table. */
rtx reaching_reg; /* Register to use when re-writing. */
};
@@ -679,6 +681,7 @@ static void compute_ld_motion_mems (void);
static void trim_ld_motion_mems (void);
static void update_ld_motion_stores (struct expr *);
static void reg_set_info (rtx, rtx, void *);
+static void reg_clear_last_set (rtx, rtx, void *);
static bool store_ops_ok (rtx, int *);
static rtx extract_mentioned_regs (rtx);
static rtx extract_mentioned_regs_helper (rtx, rtx);
@@ -853,7 +856,8 @@ gcse_main (rtx f, FILE *file)
if (file)
{
fprintf (file, "GCSE of %s: %d basic blocks, ",
- current_function_name, n_basic_blocks);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ n_basic_blocks);
fprintf (file, "%d pass%s, %d bytes\n\n",
pass, pass > 1 ? "es" : "", max_pass_bytes);
}
@@ -1513,12 +1517,14 @@ oprs_available_p (rtx x, rtx insn)
MODE is only used if X is a CONST_INT. DO_NOT_RECORD_P is a boolean
indicating if a volatile operand is found or if the expression contains
- something we don't want to insert in the table.
+ something we don't want to insert in the table. HASH_TABLE_SIZE is
+ the current size of the hash table to be probed.
??? One might want to merge this with canon_hash. Later. */
static unsigned int
-hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p, int hash_table_size)
+hash_expr (rtx x, enum machine_mode mode, int *do_not_record_p,
+ int hash_table_size)
{
unsigned int hash;
@@ -2200,12 +2206,12 @@ hash_scan_set (rtx pat, rtx insn, struct hash_table *table)
/* A copy is not available if its src or dest is subsequently
modified. Here we want to search from INSN+1 on, but
oprs_available_p searches from INSN on. */
- && (insn == BLOCK_END (BLOCK_NUM (insn))
+ && (insn == BB_END (BLOCK_FOR_INSN (insn))
|| ((tmp = next_nonnote_insn (insn)) != NULL_RTX
&& oprs_available_p (pat, tmp))))
insert_set_in_table (pat, insn, table);
}
- /* In case of store we want to consider the memory value as avaiable in
+ /* In case of store we want to consider the memory value as available in
the REG stored in that memory. This makes it possible to remove
redundant loads from due to stores to the same location. */
else if (flag_gcse_las && GET_CODE (src) == REG && GET_CODE (dest) == MEM)
@@ -2507,8 +2513,8 @@ compute_hash_table_work (struct hash_table *table)
??? hard-reg reg_set_in_block computation
could be moved to compute_sets since they currently don't change. */
- for (insn = current_bb->head;
- insn && insn != NEXT_INSN (current_bb->end);
+ for (insn = BB_HEAD (current_bb);
+ insn && insn != NEXT_INSN (BB_END (current_bb));
insn = NEXT_INSN (insn))
{
if (! INSN_P (insn))
@@ -2538,12 +2544,12 @@ compute_hash_table_work (struct hash_table *table)
if (table->set_p
&& implicit_sets[current_bb->index] != NULL_RTX)
hash_scan_set (implicit_sets[current_bb->index],
- current_bb->head, table);
+ BB_HEAD (current_bb), table);
/* The next pass builds the hash table. */
- for (insn = current_bb->head, in_libcall_block = 0;
- insn && insn != NEXT_INSN (current_bb->end);
+ for (insn = BB_HEAD (current_bb), in_libcall_block = 0;
+ insn && insn != NEXT_INSN (BB_END (current_bb));
insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
@@ -3537,8 +3543,8 @@ classic_gcse (void)
start of the block]. */
reset_opr_set_tables ();
- for (insn = bb->head;
- insn != NULL && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
/* Is insn of form (set (pseudo-reg) ...)? */
@@ -3610,7 +3616,8 @@ one_classic_gcse_pass (int pass)
{
fprintf (gcse_file, "\n");
fprintf (gcse_file, "GCSE of %s, pass %d: %d bytes needed, %d substs,",
- current_function_name, pass, bytes_used, gcse_subst_count);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ pass, bytes_used, gcse_subst_count);
fprintf (gcse_file, "%d insns created\n", gcse_create_count);
}
@@ -4474,8 +4481,8 @@ cprop (int alter_jumps)
start of the block]. */
reset_opr_set_tables ();
- for (insn = bb->head;
- insn != NULL && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
@@ -4556,6 +4563,38 @@ fis_get_condition (rtx jump)
return tmp;
}
+/* Check the comparison COND to see if we can safely form an implicit set from
+ it. COND is either an EQ or NE comparison. */
+
+static bool
+implicit_set_cond_p (rtx cond)
+{
+ enum machine_mode mode = GET_MODE (XEXP (cond, 0));
+ rtx cst = XEXP (cond, 1);
+
+ /* We can't perform this optimization if either operand might be or might
+ contain a signed zero. */
+ if (HONOR_SIGNED_ZEROS (mode))
+ {
+ /* It is sufficient to check if CST is or contains a zero. We must
+ handle float, complex, and vector. If any subpart is a zero, then
+ the optimization can't be performed. */
+ /* ??? The complex and vector checks are not implemented yet. We just
+ always return zero for them. */
+ if (GET_CODE (cst) == CONST_DOUBLE)
+ {
+ REAL_VALUE_TYPE d;
+ REAL_VALUE_FROM_CONST_DOUBLE (d, cst);
+ if (REAL_VALUES_EQUAL (d, dconst0))
+ return 0;
+ }
+ else
+ return 0;
+ }
+
+ return gcse_constant_p (cst);
+}
+
/* Find the implicit sets of a function. An "implicit set" is a constraint
on the value of a variable, implied by a conditional jump. For example,
following "if (x == 2)", the then branch may be optimized as though the
@@ -4575,13 +4614,13 @@ find_implicit_sets (void)
/* Check for more than one successor. */
if (bb->succ && bb->succ->succ_next)
{
- cond = fis_get_condition (bb->end);
+ cond = fis_get_condition (BB_END (bb));
if (cond
&& (GET_CODE (cond) == EQ || GET_CODE (cond) == NE)
&& GET_CODE (XEXP (cond, 0)) == REG
&& REGNO (XEXP (cond, 0)) >= FIRST_PSEUDO_REGISTER
- && gcse_constant_p (XEXP (cond, 1)))
+ && implicit_set_cond_p (cond))
{
dest = GET_CODE (cond) == EQ ? BRANCH_EDGE (bb)->dest
: FALLTHRU_EDGE (bb)->dest;
@@ -4650,7 +4689,8 @@ one_cprop_pass (int pass, int cprop_jumps, int bypass_jumps)
if (gcse_file)
{
fprintf (gcse_file, "CPROP of %s, pass %d: %d bytes needed, ",
- current_function_name, pass, bytes_used);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ pass, bytes_used);
fprintf (gcse_file, "%d const props, %d copy props\n\n",
const_prop_count, copy_prop_count);
}
@@ -4898,8 +4938,8 @@ bypass_conditional_jumps (void)
if (bb->pred && bb->pred->pred_next)
{
setcc = NULL_RTX;
- for (insn = bb->head;
- insn != NULL && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
if (GET_CODE (insn) == INSN)
{
@@ -5190,7 +5230,7 @@ process_insert_insn (struct expr *expr)
static void
insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
{
- rtx insn = bb->end;
+ rtx insn = BB_END (bb);
rtx new_insn;
rtx reg = expr->reaching_reg;
int regno = REGNO (reg);
@@ -5271,7 +5311,7 @@ insert_insn_end_bb (struct expr *expr, basic_block bb, int pre)
/* Since different machines initialize their parameter registers
in different orders, assume nothing. Collect the set of all
parameter registers. */
- insn = find_first_parameter_load (insn, bb->head);
+ insn = find_first_parameter_load (insn, BB_HEAD (bb));
/* If we found all the parameter loads, then we want to insert
before the first parameter load.
@@ -5752,7 +5792,8 @@ one_pre_gcse_pass (int pass)
if (gcse_file)
{
fprintf (gcse_file, "\nPRE GCSE of %s, pass %d: %d bytes needed, ",
- current_function_name, pass, bytes_used);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ pass, bytes_used);
fprintf (gcse_file, "%d substs, %d insns created\n",
gcse_subst_count, gcse_create_count);
}
@@ -5831,7 +5872,7 @@ compute_transpout (void)
/* Note that flow inserted a nop a the end of basic blocks that
end in call instructions for reasons other than abnormal
control flow. */
- if (GET_CODE (bb->end) != CALL_INSN)
+ if (GET_CODE (BB_END (bb)) != CALL_INSN)
continue;
for (i = 0; i < expr_hash_table.size; i++)
@@ -5913,8 +5954,8 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin,
/* Scan each insn in the basic block looking for memory references and
register sets. */
- stop_insn = NEXT_INSN (current_block->end);
- for (insn = current_block->head;
+ stop_insn = NEXT_INSN (BB_HEAD (current_block));
+ for (insn = BB_HEAD (current_block);
insn != stop_insn;
insn = NEXT_INSN (insn))
{
@@ -5969,7 +6010,7 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin,
against zero. */
FOR_EACH_BB (bb)
{
- rtx last_insn = bb->end;
+ rtx last_insn = BB_END (bb);
rtx condition, earliest;
int compare_and_branch;
@@ -6019,7 +6060,7 @@ delete_null_pointer_checks_1 (unsigned int *block_reg, sbitmap *nonnull_avin,
delete_insn (earliest);
purge_dead_edges (bb);
- /* Don't check this block again. (Note that BLOCK_END is
+ /* Don't check this block again. (Note that BB_END is
invalid here; we deleted the last instruction in the
block.) */
block_reg[bb->index] = 0;
@@ -6085,7 +6126,7 @@ delete_null_pointer_checks (rtx f ATTRIBUTE_UNUSED)
block_reg = xcalloc (last_basic_block, sizeof (int));
FOR_EACH_BB (bb)
{
- rtx last_insn = bb->end;
+ rtx last_insn = BB_END (bb);
rtx condition, earliest, reg;
/* We only want conditional branches. */
@@ -6146,9 +6187,6 @@ static sbitmap *hoist_vbeout;
/* Hoistable expressions. */
static sbitmap *hoist_exprs;
-/* Dominator bitmaps. */
-dominance_info dominators;
-
/* ??? We could compute post dominators and run this algorithm in
reverse to perform tail merging, doing so would probably be
more effective than the tail merging code in jump.c.
@@ -6185,7 +6223,7 @@ free_code_hoist_mem (void)
sbitmap_vector_free (hoist_exprs);
sbitmap_vector_free (transpout);
- free_dominance_info (dominators);
+ free_dominance_info (CDI_DOMINATORS);
}
/* Compute the very busy expressions at entry/exit from each block.
@@ -6234,7 +6272,7 @@ compute_code_hoist_data (void)
compute_local_properties (transp, comp, antloc, &expr_hash_table);
compute_transpout ();
compute_code_hoist_vbeinout ();
- dominators = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
if (gcse_file)
fprintf (gcse_file, "\n");
}
@@ -6326,7 +6364,7 @@ hoist_code (void)
int found = 0;
int insn_inserted_p;
- domby_len = get_dominated_by (dominators, bb, &domby);
+ domby_len = get_dominated_by (CDI_DOMINATORS, bb, &domby);
/* Examine each expression that is very busy at the exit of this
block. These are the potentially hoistable expressions. */
for (i = 0; i < hoist_vbeout[bb->index]->n_bits; i++)
@@ -6519,28 +6557,29 @@ one_code_hoisting_pass (void)
static struct ls_expr *
ldst_entry (rtx x)
{
+ int do_not_record_p = 0;
struct ls_expr * ptr;
+ unsigned int hash;
- for (ptr = first_ls_expr(); ptr != NULL; ptr = next_ls_expr (ptr))
- if (expr_equiv_p (ptr->pattern, x))
- break;
+ hash = hash_expr_1 (x, GET_MODE (x), & do_not_record_p);
- if (!ptr)
- {
- ptr = xmalloc (sizeof (struct ls_expr));
+ for (ptr = pre_ldst_mems; ptr != NULL; ptr = ptr->next)
+ if (ptr->hash_index == hash && expr_equiv_p (ptr->pattern, x))
+ return ptr;
- ptr->next = pre_ldst_mems;
- ptr->expr = NULL;
- ptr->pattern = x;
- ptr->pattern_regs = NULL_RTX;
- ptr->loads = NULL_RTX;
- ptr->stores = NULL_RTX;
- ptr->reaching_reg = NULL_RTX;
- ptr->invalid = 0;
- ptr->index = 0;
- ptr->hash_index = 0;
- pre_ldst_mems = ptr;
- }
+ ptr = xmalloc (sizeof (struct ls_expr));
+
+ ptr->next = pre_ldst_mems;
+ ptr->expr = NULL;
+ ptr->pattern = x;
+ ptr->pattern_regs = NULL_RTX;
+ ptr->loads = NULL_RTX;
+ ptr->stores = NULL_RTX;
+ ptr->reaching_reg = NULL_RTX;
+ ptr->invalid = 0;
+ ptr->index = 0;
+ ptr->hash_index = hash;
+ pre_ldst_mems = ptr;
return ptr;
}
@@ -6743,8 +6782,8 @@ compute_ld_motion_mems (void)
FOR_EACH_BB (bb)
{
- for (insn = bb->head;
- insn && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -6800,56 +6839,41 @@ compute_ld_motion_mems (void)
static void
trim_ld_motion_mems (void)
{
- struct ls_expr * last = NULL;
- struct ls_expr * ptr = first_ls_expr ();
+ struct ls_expr * * last = & pre_ldst_mems;
+ struct ls_expr * ptr = pre_ldst_mems;
while (ptr != NULL)
{
- int del = ptr->invalid;
- struct expr * expr = NULL;
+ struct expr * expr;
/* Delete if entry has been made invalid. */
- if (!del)
+ if (! ptr->invalid)
{
- unsigned int i;
-
- del = 1;
/* Delete if we cannot find this mem in the expression list. */
- for (i = 0; i < expr_hash_table.size && del; i++)
- {
- for (expr = expr_hash_table.table[i];
- expr != NULL;
- expr = expr->next_same_hash)
- if (expr_equiv_p (expr->expr, ptr->pattern))
- {
- del = 0;
- break;
- }
- }
- }
+ unsigned int hash = ptr->hash_index % expr_hash_table.size;
- if (del)
- {
- if (last != NULL)
- {
- last->next = ptr->next;
- free_ldst_entry (ptr);
- ptr = last->next;
- }
- else
- {
- pre_ldst_mems = pre_ldst_mems->next;
- free_ldst_entry (ptr);
- ptr = pre_ldst_mems;
- }
+ for (expr = expr_hash_table.table[hash];
+ expr != NULL;
+ expr = expr->next_same_hash)
+ if (expr_equiv_p (expr->expr, ptr->pattern))
+ break;
}
else
+ expr = (struct expr *) 0;
+
+ if (expr)
{
/* Set the expression field if we are keeping it. */
- last = ptr;
ptr->expr = expr;
+ last = & ptr->next;
ptr = ptr->next;
}
+ else
+ {
+ *last = ptr->next;
+ free_ldst_entry (ptr);
+ ptr = * last;
+ }
}
/* Show the world what we've found. */
@@ -6933,17 +6957,41 @@ static sbitmap * st_antloc;
/* Global holding the number of store expressions we are dealing with. */
static int num_stores;
-/* Checks to set if we need to mark a register set. Called from note_stores. */
+/* Checks to set if we need to mark a register set. Called from
+ note_stores. */
static void
reg_set_info (rtx dest, rtx setter ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
+ void *data)
{
+ sbitmap bb_reg = data;
+
if (GET_CODE (dest) == SUBREG)
dest = SUBREG_REG (dest);
if (GET_CODE (dest) == REG)
- regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn);
+ {
+ regvec[REGNO (dest)] = INSN_UID (compute_store_table_current_insn);
+ if (bb_reg)
+ SET_BIT (bb_reg, REGNO (dest));
+ }
+}
+
+/* Clear any mark that says that this insn sets dest. Called from
+ note_stores. */
+
+static void
+reg_clear_last_set (rtx dest, rtx setter ATTRIBUTE_UNUSED,
+ void *data)
+{
+ int *dead_vec = data;
+
+ if (GET_CODE (dest) == SUBREG)
+ dest = SUBREG_REG (dest);
+
+ if (GET_CODE (dest) == REG &&
+ dead_vec[REGNO (dest)] == INSN_UID (compute_store_table_current_insn))
+ dead_vec[REGNO (dest)] = 0;
}
/* Return zero if some of the registers in list X are killed
@@ -7143,7 +7191,7 @@ find_moveable_store (rtx insn, int *regs_set_before, int *regs_set_after)
failed last time. */
if (LAST_AVAIL_CHECK_FAILURE (ptr))
{
- for (tmp = bb->end;
+ for (tmp = BB_END (bb);
tmp != insn && tmp != LAST_AVAIL_CHECK_FAILURE (ptr);
tmp = PREV_INSN (tmp))
continue;
@@ -7177,18 +7225,17 @@ compute_store_table (void)
max_gcse_regno);
sbitmap_vector_zero (reg_set_in_block, last_basic_block);
pre_ldst_mems = 0;
- last_set_in = xmalloc (sizeof (int) * max_gcse_regno);
+ last_set_in = xcalloc (max_gcse_regno, sizeof (int));
already_set = xmalloc (sizeof (int) * max_gcse_regno);
/* Find all the stores we care about. */
FOR_EACH_BB (bb)
{
/* First compute the registers set in this block. */
- memset (last_set_in, 0, sizeof (int) * max_gcse_regno);
regvec = last_set_in;
- for (insn = bb->head;
- insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
if (! INSN_P (insn))
@@ -7206,24 +7253,22 @@ compute_store_table (void)
for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
if (clobbers_all
|| TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
- last_set_in[regno] = INSN_UID (insn);
+ {
+ last_set_in[regno] = INSN_UID (insn);
+ SET_BIT (reg_set_in_block[bb->index], regno);
+ }
}
pat = PATTERN (insn);
compute_store_table_current_insn = insn;
- note_stores (pat, reg_set_info, NULL);
+ note_stores (pat, reg_set_info, reg_set_in_block[bb->index]);
}
- /* Record the set registers. */
- for (regno = 0; regno < max_gcse_regno; regno++)
- if (last_set_in[regno])
- SET_BIT (reg_set_in_block[bb->index], regno);
-
/* Now find the stores. */
memset (already_set, 0, sizeof (int) * max_gcse_regno);
regvec = already_set;
- for (insn = bb->head;
- insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
if (! INSN_P (insn))
@@ -7251,11 +7296,32 @@ compute_store_table (void)
find_moveable_store (insn, already_set, last_set_in);
/* Unmark regs that are no longer set. */
- for (regno = 0; regno < max_gcse_regno; regno++)
- if (last_set_in[regno] == INSN_UID (insn))
- last_set_in[regno] = 0;
+ compute_store_table_current_insn = insn;
+ note_stores (pat, reg_clear_last_set, last_set_in);
+ if (GET_CODE (insn) == CALL_INSN)
+ {
+ bool clobbers_all = false;
+#ifdef NON_SAVING_SETJMP
+ if (NON_SAVING_SETJMP
+ && find_reg_note (insn, REG_SETJMP, NULL_RTX))
+ clobbers_all = true;
+#endif
+
+ for (regno = 0; regno < FIRST_PSEUDO_REGISTER; regno++)
+ if ((clobbers_all
+ || TEST_HARD_REG_BIT (regs_invalidated_by_call, regno))
+ && last_set_in[regno] == INSN_UID (insn))
+ last_set_in[regno] = 0;
+ }
}
+#ifdef ENABLE_CHECKING
+ /* last_set_in should now be all-zero. */
+ for (regno = 0; regno < max_gcse_regno; regno++)
+ if (last_set_in[regno] != 0)
+ abort ();
+#endif
+
/* Clear temporary marks. */
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
{
@@ -7435,7 +7501,7 @@ static bool
store_killed_after (rtx x, rtx x_regs, rtx insn, basic_block bb,
int *regs_set_after, rtx *fail_insn)
{
- rtx last = bb->end, act;
+ rtx last = BB_END (bb), act;
if (!store_ops_ok (x_regs, regs_set_after))
{
@@ -7464,7 +7530,7 @@ static bool
store_killed_before (rtx x, rtx x_regs, rtx insn, basic_block bb,
int *regs_set_before)
{
- rtx first = bb->head;
+ rtx first = BB_HEAD (bb);
if (!store_ops_ok (x_regs, regs_set_before))
return true;
@@ -7539,7 +7605,7 @@ build_store_vectors (void)
for (ptr = first_ls_expr (); ptr != NULL; ptr = next_ls_expr (ptr))
{
- if (store_killed_after (ptr->pattern, ptr->pattern_regs, bb->head,
+ if (store_killed_after (ptr->pattern, ptr->pattern_regs, BB_HEAD (bb),
bb, regs_set_in_block, NULL))
{
/* It should not be necessary to consider the expression
@@ -7565,14 +7631,14 @@ build_store_vectors (void)
}
/* Insert an instruction at the beginning of a basic block, and update
- the BLOCK_HEAD if needed. */
+ the BB_HEAD if needed. */
static void
insert_insn_start_bb (rtx insn, basic_block bb)
{
/* Insert at start of successor block. */
- rtx prev = PREV_INSN (bb->head);
- rtx before = bb->head;
+ rtx prev = PREV_INSN (BB_HEAD (bb));
+ rtx before = BB_HEAD (bb);
while (before != 0)
{
if (GET_CODE (before) != CODE_LABEL
@@ -7580,7 +7646,7 @@ insert_insn_start_bb (rtx insn, basic_block bb)
|| NOTE_LINE_NUMBER (before) != NOTE_INSN_BASIC_BLOCK))
break;
prev = before;
- if (prev == bb->end)
+ if (prev == BB_END (bb))
break;
before = NEXT_INSN (before);
}
@@ -7715,9 +7781,9 @@ remove_reachable_equiv_notes (basic_block bb, struct ls_expr *smexpr)
last = XEXP (last, 0);
}
else
- last = NEXT_INSN (bb->end);
+ last = NEXT_INSN (BB_END (bb));
- for (insn = bb->head; insn != last; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn != last; insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
note = find_reg_equal_equiv_note (insn);
@@ -7771,7 +7837,7 @@ replace_store_insn (rtx reg, rtx del, basic_block bb, struct ls_expr *smexpr)
/* Now we must handle REG_EQUAL notes whose contents is equal to the mem;
they are no longer accurate provided that they are reached by this
definition, so drop them. */
- for (; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn))
+ for (; insn != NEXT_INSN (BB_END (bb)); insn = NEXT_INSN (insn))
if (INSN_P (insn))
{
set = single_set (insn);
@@ -7926,7 +7992,7 @@ bypass_jumps (FILE *file)
if (file)
dump_flow_info (file);
- /* Return if there's nothing to do, or it is too expensive */
+ /* Return if there's nothing to do, or it is too expensive. */
if (n_basic_blocks <= 1 || is_too_expensive (_ ("jump bypassing disabled")))
return 0;
@@ -7956,7 +8022,8 @@ bypass_jumps (FILE *file)
if (file)
{
fprintf (file, "BYPASS of %s: %d basic blocks, ",
- current_function_name, n_basic_blocks);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ n_basic_blocks);
fprintf (file, "%d bytes\n\n", bytes_used);
}
diff --git a/gcc/genattrtab.c b/gcc/genattrtab.c
index 7024c01793b..ccf82c68a2a 100644
--- a/gcc/genattrtab.c
+++ b/gcc/genattrtab.c
@@ -100,6 +100,16 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define ATTR_PERMANENT_P(RTX) (RTX_FLAG((RTX), integrated))
#define ATTR_EQ_ATTR_P(RTX) (RTX_FLAG((RTX), volatil))
+#if 0
+#define strcmp_check(S1, S2) ((S1) == (S2) \
+ ? 0 \
+ : (strcmp ((S1), (S2)) \
+ ? 1 \
+ : (abort (), 0)))
+#else
+#define strcmp_check(S1, S2) ((S1) != (S2))
+#endif
+
#include "bconfig.h"
#include "system.h"
#include "coretypes.h"
@@ -339,6 +349,10 @@ static rtx true_rtx, false_rtx;
/* Used to reduce calls to `strcmp' */
static char *alternative_name;
+static const char *length_str;
+static const char *delay_type_str;
+static const char *delay_1_0_str;
+static const char *num_delay_slots_str;
/* Indicate that REG_DEAD notes are valid if dead_or_set_p is ever
called. */
@@ -365,6 +379,8 @@ int optimize = 0;
(EXP) = (XSTR ((EXP), 1) == current_alternative_string \
? true_rtx : false_rtx);
+#define DEF_ATTR_STRING(S) (attr_string ((S), strlen (S)))
+
/* These are referenced by rtlanal.c and hence need to be defined somewhere.
They won't actually be used. */
@@ -407,7 +423,6 @@ static rtx test_for_current_value (struct dimension *, int);
static rtx simplify_with_current_value (rtx, struct dimension *, int);
static rtx simplify_with_current_value_aux (rtx);
static void clear_struct_flag (rtx);
-static int count_sub_rtxs (rtx, int);
static void remove_insn_ent (struct attr_value *, struct insn_ent *);
static void insert_insn_ent (struct attr_value *, struct insn_ent *);
static rtx insert_right_side (enum rtx_code, rtx, rtx, int, int);
@@ -450,7 +465,7 @@ static int write_expr_attr_cache (rtx, struct attr_desc *);
static void write_toplevel_expr (rtx);
static void write_const_num_delay_slots (void);
static char *next_comma_elt (const char **);
-static struct attr_desc *find_attr (const char *, int);
+static struct attr_desc *find_attr (const char **, int);
static struct attr_value *find_most_used (struct attr_desc *);
static rtx find_single_value (struct attr_desc *);
static void extend_range (struct range *, int, int);
@@ -459,6 +474,13 @@ static const char *attr_numeral (int);
static int attr_equal_p (rtx, rtx);
static rtx attr_copy_rtx (rtx);
static int attr_rtx_cost (rtx);
+static bool attr_alt_subset_p (rtx, rtx);
+static bool attr_alt_subset_of_compl_p (rtx, rtx);
+static rtx attr_alt_intersection (rtx, rtx);
+static rtx attr_alt_union (rtx, rtx);
+static rtx attr_alt_complement (rtx);
+static bool attr_alt_bit_p (rtx, int);
+static rtx mk_attr_alt (int);
#define oballoc(size) obstack_alloc (hash_obstack, size)
@@ -606,8 +628,7 @@ attr_rtx_1 (enum rtx_code code, va_list p)
{
char *arg0 = va_arg (p, char *);
- if (code == SYMBOL_REF)
- arg0 = attr_string (arg0, strlen (arg0));
+ arg0 = DEF_ATTR_STRING (arg0);
hashcode = ((HOST_WIDE_INT) code + RTL_HASH (arg0));
for (h = attr_hash_table[hashcode % RTL_HASH_SIZE]; h; h = h->next)
@@ -736,14 +757,13 @@ attr_printf (unsigned int len, const char *fmt, ...)
vsprintf (str, fmt, p);
va_end (p);
- return attr_string (str, strlen (str));
+ return DEF_ATTR_STRING (str);
}
static rtx
attr_eq (const char *name, const char *value)
{
- return attr_rtx (EQ_ATTR, attr_string (name, strlen (name)),
- attr_string (value, strlen (value)));
+ return attr_rtx (EQ_ATTR, DEF_ATTR_STRING (name), DEF_ATTR_STRING (value));
}
static const char *
@@ -916,16 +936,11 @@ check_attr_test (rtx exp, int is_const, int lineno)
else if (n_comma_elts (XSTR (exp, 1)) == 1)
{
- attr = find_attr (XSTR (exp, 0), 0);
+ attr = find_attr (&XSTR (exp, 0), 0);
if (attr == NULL)
{
if (! strcmp (XSTR (exp, 0), "alternative"))
- {
- XSTR (exp, 0) = alternative_name;
- /* This can't be simplified any further. */
- ATTR_IND_SIMPLIFIED_P (exp) = 1;
- return exp;
- }
+ return mk_attr_alt (1 << atoi (XSTR (exp, 1)));
else
fatal ("unknown attribute `%s' in EQ_ATTR", XSTR (exp, 0));
}
@@ -965,16 +980,29 @@ check_attr_test (rtx exp, int is_const, int lineno)
}
else
{
- /* Make an IOR tree of the possible values. */
- orexp = false_rtx;
- name_ptr = XSTR (exp, 1);
- while ((p = next_comma_elt (&name_ptr)) != NULL)
+ if (! strcmp (XSTR (exp, 0), "alternative"))
{
- newexp = attr_eq (XSTR (exp, 0), p);
- orexp = insert_right_side (IOR, orexp, newexp, -2, -2);
+ int set = 0;
+
+ name_ptr = XSTR (exp, 1);
+ while ((p = next_comma_elt (&name_ptr)) != NULL)
+ set |= 1 << atoi (p);
+
+ return mk_attr_alt (set);
}
+ else
+ {
+ /* Make an IOR tree of the possible values. */
+ orexp = false_rtx;
+ name_ptr = XSTR (exp, 1);
+ while ((p = next_comma_elt (&name_ptr)) != NULL)
+ {
+ newexp = attr_eq (XSTR (exp, 0), p);
+ orexp = insert_right_side (IOR, orexp, newexp, -2, -2);
+ }
- return check_attr_test (orexp, is_const, lineno);
+ return check_attr_test (orexp, is_const, lineno);
+ }
}
break;
@@ -1166,7 +1194,7 @@ check_attr_value (rtx exp, struct attr_desc *attr)
case ATTR:
{
- struct attr_desc *attr2 = find_attr (XSTR (exp, 0), 0);
+ struct attr_desc *attr2 = find_attr (&XSTR (exp, 0), 0);
if (attr2 == NULL)
{
message_with_line (attr ? attr->lineno : 0,
@@ -1326,7 +1354,7 @@ check_defs (void)
if (value == NULL_RTX)
continue;
- if ((attr = find_attr (XSTR (XEXP (value, 0), 0), 0)) == NULL)
+ if ((attr = find_attr (&XSTR (XEXP (value, 0), 0), 0)) == NULL)
{
message_with_line (id->lineno, "unknown attribute %s",
XSTR (XEXP (value, 0), 0));
@@ -1364,6 +1392,8 @@ make_canonical (struct attr_desc *attr, rtx exp)
fatal ("(attr_value \"*\") used in invalid context");
exp = attr->default_val->value;
}
+ else
+ XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0));
break;
@@ -1424,6 +1454,17 @@ copy_boolean (rtx exp)
if (GET_CODE (exp) == AND || GET_CODE (exp) == IOR)
return attr_rtx (GET_CODE (exp), copy_boolean (XEXP (exp, 0)),
copy_boolean (XEXP (exp, 1)));
+ if (GET_CODE (exp) == MATCH_OPERAND)
+ {
+ XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1));
+ XSTR (exp, 2) = DEF_ATTR_STRING (XSTR (exp, 2));
+ }
+ else if (GET_CODE (exp) == EQ_ATTR)
+ {
+ XSTR (exp, 0) = DEF_ATTR_STRING (XSTR (exp, 0));
+ XSTR (exp, 1) = DEF_ATTR_STRING (XSTR (exp, 1));
+ }
+
return exp;
}
@@ -1504,7 +1545,7 @@ expand_delays (void)
= make_numeric_value (XVECLEN (delay->def, 1) / 3);
}
- make_internal_attr ("*num_delay_slots", condexp, ATTR_NONE);
+ make_internal_attr (num_delay_slots_str, condexp, ATTR_NONE);
/* If more than one delay type, do the same for computing the delay type. */
if (num_delays > 1)
@@ -1519,7 +1560,7 @@ expand_delays (void)
XVECEXP (condexp, 0, i + 1) = make_numeric_value (delay->num);
}
- make_internal_attr ("*delay_type", condexp, ATTR_SPECIAL);
+ make_internal_attr (delay_type_str, condexp, ATTR_SPECIAL);
}
/* For each delay possibility and delay slot, compute an eligibility
@@ -2186,6 +2227,7 @@ encode_units_mask (rtx x)
case PC:
case CC0:
case EQ_ATTR:
+ case EQ_ATTR_ALT:
return x;
default:
@@ -2239,8 +2281,8 @@ fill_attr (struct attr_desc *attr)
value = NULL;
if (XVEC (id->def, id->vec_idx))
for (i = 0; i < XVECLEN (id->def, id->vec_idx); i++)
- if (! strcmp (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0),
- attr->name))
+ if (! strcmp_check (XSTR (XEXP (XVECEXP (id->def, id->vec_idx, i), 0), 0),
+ attr->name))
value = XEXP (XVECEXP (id->def, id->vec_idx, i), 1);
if (value == NULL)
@@ -2337,9 +2379,12 @@ substitute_address (rtx exp, rtx (*no_address_fn) (rtx),
static void
make_length_attrs (void)
{
- static const char *const new_names[] = {"*insn_default_length",
- "*insn_variable_length_p",
- "*insn_current_length"};
+ static const char *new_names[] =
+ {
+ "*insn_default_length",
+ "*insn_variable_length_p",
+ "*insn_current_length"
+ };
static rtx (*const no_address_fn[]) (rtx) = {identity_fn, zero_fn, zero_fn};
static rtx (*const address_fn[]) (rtx) = {max_fn, one_fn, identity_fn};
size_t i;
@@ -2349,7 +2394,7 @@ make_length_attrs (void)
/* See if length attribute is defined. If so, it must be numeric. Make
it special so we don't output anything for it. */
- length_attr = find_attr ("length", 0);
+ length_attr = find_attr (&length_str, 0);
if (length_attr == 0)
return;
@@ -2366,7 +2411,7 @@ make_length_attrs (void)
substitute_address (length_attr->default_val->value,
no_address_fn[i], address_fn[i]),
ATTR_NONE);
- new_attr = find_attr (new_names[i], 0);
+ new_attr = find_attr (&new_names[i], 0);
for (av = length_attr->first_value; av; av = av->next)
for (ie = av->first_insn; ie; ie = ie->next)
{
@@ -2412,7 +2457,7 @@ max_fn (rtx exp)
static void
write_length_unit_log (void)
{
- struct attr_desc *length_attr = find_attr ("length", 0);
+ struct attr_desc *length_attr = find_attr (&length_str, 0);
struct attr_value *av;
struct insn_ent *ie;
unsigned int length_unit_log, length_or;
@@ -2496,6 +2541,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index)
/* If test is false, discard it and its value. */
for (j = i; j < len - 2; j++)
tests[j] = tests[j + 2];
+ i -= 2;
len -= 2;
}
@@ -2512,6 +2558,7 @@ simplify_cond (rtx exp, int insn_code, int insn_index)
for (j = i; j < len - 2; j++)
tests[j] = tests[j + 2];
len -= 2;
+ i -= 2;
}
else
@@ -2682,6 +2729,16 @@ compute_alternative_mask (rtx exp, enum rtx_code code)
&& XSTR (exp, 0) == alternative_name)
string = XSTR (exp, 1);
+ else if (GET_CODE (exp) == EQ_ATTR_ALT)
+ {
+ if (code == AND && XINT (exp, 1))
+ return XINT (exp, 0);
+
+ if (code == IOR && !XINT (exp, 1))
+ return XINT (exp, 0);
+
+ return 0;
+ }
else
return 0;
@@ -2696,17 +2753,7 @@ compute_alternative_mask (rtx exp, enum rtx_code code)
static rtx
make_alternative_compare (int mask)
{
- rtx newexp;
- int i;
-
- /* Find the bit. */
- for (i = 0; (mask & (1 << i)) == 0; i++)
- ;
-
- newexp = attr_rtx (EQ_ATTR, alternative_name, attr_numeral (i));
- ATTR_IND_SIMPLIFIED_P (newexp) = 1;
-
- return newexp;
+ return mk_attr_alt (mask);
}
/* If we are processing an (eq_attr "attr" "value") test, we find the value
@@ -2728,7 +2775,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
if (GET_CODE (value) == CONST_STRING)
{
- if (! strcmp (XSTR (value, 0), XSTR (exp, 1)))
+ if (! strcmp_check (XSTR (value, 0), XSTR (exp, 1)))
newexp = true_rtx;
else
newexp = false_rtx;
@@ -2752,7 +2799,7 @@ evaluate_eq_attr (rtx exp, rtx value, int insn_code, int insn_index)
newexp = attr_rtx (EQ, value,
attr_rtx (SYMBOL_REF,
- attr_string (string, strlen (string))));
+ DEF_ATTR_STRING (string)));
}
else if (GET_CODE (value) == COND)
{
@@ -2853,7 +2900,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
right = simplify_and_tree (XEXP (exp, 1), pterm, insn_code, insn_index);
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
{
- newexp = attr_rtx (GET_CODE (exp), left, right);
+ newexp = attr_rtx (AND, left, right);
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
}
@@ -2876,7 +2923,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
if (left != XEXP (exp, 0) || right != XEXP (exp, 1))
{
- newexp = attr_rtx (GET_CODE (exp), left, right);
+ newexp = attr_rtx (IOR, left, right);
exp = simplify_test_exp_in_temp (newexp, insn_code, insn_index);
}
@@ -2894,12 +2941,26 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
else if (GET_CODE (*pterm) == NOT && exp == XEXP (*pterm, 0))
return false_rtx;
+ else if (GET_CODE (exp) == EQ_ATTR_ALT && GET_CODE (*pterm) == EQ_ATTR_ALT)
+ {
+ if (attr_alt_subset_p (*pterm, exp))
+ return true_rtx;
+
+ if (attr_alt_subset_of_compl_p (*pterm, exp))
+ return false_rtx;
+
+ if (attr_alt_subset_p (exp, *pterm))
+ *pterm = true_rtx;
+
+ return exp;
+ }
+
else if (GET_CODE (exp) == EQ_ATTR && GET_CODE (*pterm) == EQ_ATTR)
{
if (XSTR (exp, 0) != XSTR (*pterm, 0))
return exp;
- if (! strcmp (XSTR (exp, 1), XSTR (*pterm, 1)))
+ if (! strcmp_check (XSTR (exp, 1), XSTR (*pterm, 1)))
return true_rtx;
else
return false_rtx;
@@ -2911,7 +2972,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
if (XSTR (*pterm, 0) != XSTR (XEXP (exp, 0), 0))
return exp;
- if (! strcmp (XSTR (*pterm, 1), XSTR (XEXP (exp, 0), 1)))
+ if (! strcmp_check (XSTR (*pterm, 1), XSTR (XEXP (exp, 0), 1)))
return false_rtx;
else
return true_rtx;
@@ -2923,7 +2984,7 @@ simplify_and_tree (rtx exp, rtx *pterm, int insn_code, int insn_index)
if (XSTR (exp, 0) != XSTR (XEXP (*pterm, 0), 0))
return exp;
- if (! strcmp (XSTR (exp, 1), XSTR (XEXP (*pterm, 0), 1)))
+ if (! strcmp_check (XSTR (exp, 1), XSTR (XEXP (*pterm, 0), 1)))
return false_rtx;
else
*pterm = true_rtx;
@@ -3037,9 +3098,13 @@ attr_rtx_cost (rtx x)
return 10;
else
return 0;
+
+ case EQ_ATTR_ALT:
+ return 0;
+
case EQ_ATTR:
/* Alternatives don't result into function call. */
- if (!strcmp (XSTR (x, 0), "alternative"))
+ if (!strcmp_check (XSTR (x, 0), alternative_name))
return 0;
else
return 5;
@@ -3087,6 +3152,146 @@ simplify_test_exp_in_temp (rtx exp, int insn_code, int insn_index)
return attr_copy_rtx (x);
}
+/* Returns true if S1 is a subset of S2. */
+
+static bool
+attr_alt_subset_p (rtx s1, rtx s2)
+{
+ switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
+ {
+ case (0 << 1) | 0:
+ return !(XINT (s1, 0) &~ XINT (s2, 0));
+
+ case (0 << 1) | 1:
+ return !(XINT (s1, 0) & XINT (s2, 0));
+
+ case (1 << 1) | 0:
+ return false;
+
+ case (1 << 1) | 1:
+ return !(XINT (s2, 0) &~ XINT (s1, 0));
+
+ default:
+ abort ();
+ }
+}
+
+/* Returns true if S1 is a subset of complement of S2. */
+
+static bool attr_alt_subset_of_compl_p (rtx s1, rtx s2)
+{
+ switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
+ {
+ case (0 << 1) | 0:
+ return !(XINT (s1, 0) & XINT (s2, 0));
+
+ case (0 << 1) | 1:
+ return !(XINT (s1, 0) & ~XINT (s2, 0));
+
+ case (1 << 1) | 0:
+ return !(XINT (s2, 0) &~ XINT (s1, 0));
+
+ case (1 << 1) | 1:
+ return false;
+
+ default:
+ abort ();
+ }
+}
+
+/* Return EQ_ATTR_ALT expression representing intersection of S1 and S2. */
+
+static rtx
+attr_alt_intersection (rtx s1, rtx s2)
+{
+ rtx result = rtx_alloc (EQ_ATTR_ALT);
+
+ switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
+ {
+ case (0 << 1) | 0:
+ XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0);
+ break;
+ case (0 << 1) | 1:
+ XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0);
+ break;
+ case (1 << 1) | 0:
+ XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0);
+ break;
+ case (1 << 1) | 1:
+ XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0);
+ break;
+ default:
+ abort ();
+ }
+ XINT (result, 1) = XINT (s1, 1) & XINT (s2, 1);
+
+ return result;
+}
+
+/* Return EQ_ATTR_ALT expression representing union of S1 and S2. */
+
+static rtx
+attr_alt_union (rtx s1, rtx s2)
+{
+ rtx result = rtx_alloc (EQ_ATTR_ALT);
+
+ switch ((XINT (s1, 1) << 1) | XINT (s2, 1))
+ {
+ case (0 << 1) | 0:
+ XINT (result, 0) = XINT (s1, 0) | XINT (s2, 0);
+ break;
+ case (0 << 1) | 1:
+ XINT (result, 0) = XINT (s2, 0) & ~XINT (s1, 0);
+ break;
+ case (1 << 1) | 0:
+ XINT (result, 0) = XINT (s1, 0) & ~XINT (s2, 0);
+ break;
+ case (1 << 1) | 1:
+ XINT (result, 0) = XINT (s1, 0) & XINT (s2, 0);
+ break;
+ default:
+ abort ();
+ }
+
+ XINT (result, 1) = XINT (s1, 1) | XINT (s2, 1);
+ return result;
+}
+
+/* Return EQ_ATTR_ALT expression representing complement of S. */
+
+static rtx
+attr_alt_complement (rtx s)
+{
+ rtx result = rtx_alloc (EQ_ATTR_ALT);
+
+ XINT (result, 0) = XINT (s, 0);
+ XINT (result, 1) = 1 - XINT (s, 1);
+
+ return result;
+}
+
+/* Tests whether a bit B belongs to the set represented by S. */
+
+static bool
+attr_alt_bit_p (rtx s, int b)
+{
+ return XINT (s, 1) ^ ((XINT (s, 0) >> b) & 1);
+}
+
+/* Return EQ_ATTR_ALT expression representing set containing elements set
+ in E. */
+
+static rtx
+mk_attr_alt (int e)
+{
+ rtx result = rtx_alloc (EQ_ATTR_ALT);
+
+ XINT (result, 0) = e;
+ XINT (result, 1) = 0;
+
+ return result;
+}
+
/* Given an expression, see if it can be simplified for a particular insn
code based on the values of other attributes being tested. This can
eliminate nested get_attr_... calls.
@@ -3105,6 +3310,7 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
struct insn_ent *ie;
int i;
rtx newexp = exp;
+ bool left_alt, right_alt;
/* Don't re-simplify something we already simplified. */
if (ATTR_IND_SIMPLIFIED_P (exp) || ATTR_CURR_SIMPLIFIED_P (exp))
@@ -3122,6 +3328,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
if (left == false_rtx)
return false_rtx;
+ if (GET_CODE (left) == EQ_ATTR_ALT
+ && GET_CODE (right) == EQ_ATTR_ALT)
+ {
+ exp = attr_alt_intersection (left, right);
+ return simplify_test_exp (exp, insn_code, insn_index);
+ }
+
/* If either side is an IOR and we have (eq_attr "alternative" ..")
present on both sides, apply the distributive law since this will
yield simplifications. */
@@ -3161,15 +3374,25 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
/* See if all or all but one of the insn's alternatives are specified
in this tree. Optimize if so. */
- else if (insn_code >= 0
- && (GET_CODE (left) == AND
- || (GET_CODE (left) == NOT
- && GET_CODE (XEXP (left, 0)) == EQ_ATTR
- && XSTR (XEXP (left, 0), 0) == alternative_name)
- || GET_CODE (right) == AND
- || (GET_CODE (right) == NOT
- && GET_CODE (XEXP (right, 0)) == EQ_ATTR
- && XSTR (XEXP (right, 0), 0) == alternative_name)))
+ if (GET_CODE (left) == NOT)
+ left_alt = (GET_CODE (XEXP (left, 0)) == EQ_ATTR
+ && XSTR (XEXP (left, 0), 0) == alternative_name);
+ else
+ left_alt = (GET_CODE (left) == EQ_ATTR_ALT
+ && XINT (left, 1));
+
+ if (GET_CODE (right) == NOT)
+ right_alt = (GET_CODE (XEXP (right, 0)) == EQ_ATTR
+ && XSTR (XEXP (right, 0), 0) == alternative_name);
+ else
+ right_alt = (GET_CODE (right) == EQ_ATTR_ALT
+ && XINT (right, 1));
+
+ if (insn_code >= 0
+ && (GET_CODE (left) == AND
+ || left_alt
+ || GET_CODE (right) == AND
+ || right_alt))
{
i = compute_alternative_mask (exp, AND);
if (i & ~insn_alternatives[insn_code])
@@ -3211,6 +3434,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
if (right == true_rtx)
return true_rtx;
+ if (GET_CODE (left) == EQ_ATTR_ALT
+ && GET_CODE (right) == EQ_ATTR_ALT)
+ {
+ exp = attr_alt_union (left, right);
+ return simplify_test_exp (exp, insn_code, insn_index);
+ }
+
right = simplify_or_tree (right, &left, insn_code, insn_index);
if (left == XEXP (exp, 0) && right == XEXP (exp, 1))
left = simplify_or_tree (left, &right, insn_code, insn_index);
@@ -3249,9 +3479,13 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
else if (insn_code >= 0
&& (GET_CODE (left) == IOR
+ || (GET_CODE (left) == EQ_ATTR_ALT
+ && !XINT (left, 1))
|| (GET_CODE (left) == EQ_ATTR
&& XSTR (left, 0) == alternative_name)
|| GET_CODE (right) == IOR
+ || (GET_CODE (right) == EQ_ATTR_ALT
+ && !XINT (right, 1))
|| (GET_CODE (right) == EQ_ATTR
&& XSTR (right, 0) == alternative_name)))
{
@@ -3301,11 +3535,17 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
if (left == false_rtx)
return true_rtx;
- else if (left == true_rtx)
+ if (left == true_rtx)
return false_rtx;
+ if (GET_CODE (left) == EQ_ATTR_ALT)
+ {
+ exp = attr_alt_complement (left);
+ return simplify_test_exp (exp, insn_code, insn_index);
+ }
+
/* Try to apply De`Morgan's laws. */
- else if (GET_CODE (left) == IOR)
+ if (GET_CODE (left) == IOR)
{
newexp = attr_rtx (AND,
attr_rtx (NOT, XEXP (left, 0)),
@@ -3327,16 +3567,30 @@ simplify_test_exp (rtx exp, int insn_code, int insn_index)
}
break;
+ case EQ_ATTR_ALT:
+ if (current_alternative_string)
+ return attr_alt_bit_p (exp, atoi (current_alternative_string)) ? true_rtx : false_rtx;
+
+ if (!XINT (exp, 0))
+ return XINT (exp, 1) ? true_rtx : false_rtx;
+ break;
+
case EQ_ATTR:
if (current_alternative_string && XSTR (exp, 0) == alternative_name)
return (XSTR (exp, 1) == current_alternative_string
? true_rtx : false_rtx);
+ if (XSTR (exp, 0) == alternative_name)
+ {
+ newexp = mk_attr_alt (1 << atoi (XSTR (exp, 1)));
+ break;
+ }
+
/* Look at the value for this insn code in the specified attribute.
We normally can replace this comparison with the condition that
would give this insn the values being tested for. */
if (XSTR (exp, 0) != alternative_name
- && (attr = find_attr (XSTR (exp, 0), 0)) != NULL)
+ && (attr = find_attr (&XSTR (exp, 0), 0)) != NULL)
for (av = attr->first_value; av; av = av->next)
for (ie = av->first_insn; ie; ie = ie->next)
if (ie->insn_code == insn_code)
@@ -3500,7 +3754,10 @@ simplify_by_exploding (rtx exp)
const char *name = XSTR (XEXP (list, 0), 0);
rtx *prev;
- if ((space[ndim].attr = find_attr (name, 0)) == 0
+ space[ndim].attr = find_attr (&name, 0);
+ XSTR (XEXP (list, 0), 0) = name;
+
+ if (space[ndim].attr == 0
|| space[ndim].attr->is_numeric)
{
unmark_used_attributes (list, space, ndim);
@@ -3512,7 +3769,7 @@ simplify_by_exploding (rtx exp)
space[ndim].values = 0;
prev = &list;
for (link = list; link; link = *prev)
- if (! strcmp (XSTR (XEXP (link, 0), 0), name))
+ if (! strcmp_check (XSTR (XEXP (link, 0), 0), name))
{
space[ndim].num_values++;
*prev = XEXP (link, 1);
@@ -3954,65 +4211,6 @@ clear_struct_flag (rtx x)
}
}
-/* Return the number of RTX objects making up the expression X.
- But if we count more than MAX objects, stop counting. */
-
-static int
-count_sub_rtxs (rtx x, int max)
-{
- int i;
- int j;
- enum rtx_code code;
- const char *fmt;
- int total = 0;
-
- code = GET_CODE (x);
-
- switch (code)
- {
- case REG:
- case QUEUED:
- case CONST_INT:
- case CONST_DOUBLE:
- case CONST_VECTOR:
- case SYMBOL_REF:
- case CODE_LABEL:
- case PC:
- case CC0:
- case EQ_ATTR:
- case ATTR_FLAG:
- return 1;
-
- default:
- break;
- }
-
- /* Compare the elements. If any pair of corresponding elements
- fail to match, return 0 for the whole things. */
-
- fmt = GET_RTX_FORMAT (code);
- for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
- {
- if (total >= max)
- return total;
-
- switch (fmt[i])
- {
- case 'V':
- case 'E':
- for (j = 0; j < XVECLEN (x, i); j++)
- total += count_sub_rtxs (XVECEXP (x, i, j), max);
- break;
-
- case 'e':
- total += count_sub_rtxs (XEXP (x, i), max);
- break;
- }
- }
- return total;
-
-}
-
/* Create table entries for DEFINE_ATTR. */
static void
@@ -4025,7 +4223,7 @@ gen_attr (rtx exp, int lineno)
/* Make a new attribute structure. Check for duplicate by looking at
attr->default_val, since it is initialized by this routine. */
- attr = find_attr (XSTR (exp, 0), 1);
+ attr = find_attr (&XSTR (exp, 0), 1);
if (attr->default_val)
{
message_with_line (lineno, "duplicate definition for attribute %s",
@@ -4067,7 +4265,7 @@ gen_attr (rtx exp, int lineno)
XEXP (exp, 2) = XEXP (XEXP (exp, 2), 0);
}
- if (! strcmp (attr->name, "length") && ! attr->is_numeric)
+ if (! strcmp_check (attr->name, length_str) && ! attr->is_numeric)
{
message_with_line (lineno,
"`length' attribute must take numeric values");
@@ -4311,6 +4509,8 @@ gen_unit (rtx def, int lineno)
unit->first_lineno = lineno;
units = unit;
}
+ else
+ XSTR (def, 0) = unit->name;
/* Make a new operation class structure entry and initialize it. */
op = oballoc (sizeof (struct function_unit_op));
@@ -4490,6 +4690,52 @@ write_test_expr (rtx exp, int flags)
write_test_expr (XEXP (exp, 0), flags);
break;
+ case EQ_ATTR_ALT:
+ {
+ int set = XINT (exp, 0), bit = 0;
+
+ if (flags & 1)
+ fatal ("EQ_ATTR_ALT not valid inside comparison");
+
+ if (!set)
+ fatal ("Empty EQ_ATTR_ALT should be optimized out");
+
+ if (!(set & (set - 1)))
+ {
+ if (!(set & 0xffff))
+ {
+ bit += 16;
+ set >>= 16;
+ }
+ if (!(set & 0xff))
+ {
+ bit += 8;
+ set >>= 8;
+ }
+ if (!(set & 0xf))
+ {
+ bit += 4;
+ set >>= 4;
+ }
+ if (!(set & 0x3))
+ {
+ bit += 2;
+ set >>= 2;
+ }
+ if (!(set & 1))
+ bit++;
+
+ printf ("which_alternative %s= %d",
+ XINT (exp, 1) ? "!" : "=", bit);
+ }
+ else
+ {
+ printf ("%s((1 << which_alternative) & 0x%x)",
+ XINT (exp, 1) ? "!" : "", set);
+ }
+ }
+ break;
+
/* Comparison test of an attribute with a value. Most of these will
have been removed by optimization. Handle "alternative"
specially and give error if EQ_ATTR present inside a comparison. */
@@ -4503,7 +4749,7 @@ write_test_expr (rtx exp, int flags)
break;
}
- attr = find_attr (XSTR (exp, 0), 0);
+ attr = find_attr (&XSTR (exp, 0), 0);
if (! attr)
abort ();
@@ -4710,10 +4956,14 @@ walk_attr_value (rtx exp)
must_extract = 1;
return;
+ case EQ_ATTR_ALT:
+ must_extract = must_constrain = 1;
+ break;
+
case EQ_ATTR:
if (XSTR (exp, 0) == alternative_name)
must_extract = must_constrain = 1;
- else if (strcmp (XSTR (exp, 0), "length") == 0)
+ else if (strcmp_check (XSTR (exp, 0), length_str) == 0)
length_used = 1;
return;
@@ -5176,7 +5426,7 @@ write_attr_value (struct attr_desc *attr, rtx value)
case ATTR:
{
- struct attr_desc *attr2 = find_attr (XSTR (value, 0), 0);
+ struct attr_desc *attr2 = find_attr (&XSTR (value, 0), 0);
printf ("get_attr_%s (%s)", attr2->name,
(attr2->is_const ? "" : "insn"));
}
@@ -5250,6 +5500,7 @@ write_eligible_delay (const char *kind)
struct delay_desc *delay;
int max_slots;
char str[50];
+ const char *pstr;
struct attr_desc *attr;
struct attr_value *av, *common_av;
int i;
@@ -5278,7 +5529,7 @@ write_eligible_delay (const char *kind)
if (num_delays > 1)
{
- attr = find_attr ("*delay_type", 0);
+ attr = find_attr (&delay_type_str, 0);
if (! attr)
abort ();
common_av = find_most_used (attr);
@@ -5307,7 +5558,7 @@ write_eligible_delay (const char *kind)
printf (" switch (recog_memoized (insn))\n");
printf (" {\n");
- attr = find_attr ("*delay_1_0", 0);
+ attr = find_attr (&delay_1_0_str, 0);
if (! attr)
abort ();
common_av = find_most_used (attr);
@@ -5337,7 +5588,8 @@ write_eligible_delay (const char *kind)
printf ("\t{\n");
sprintf (str, "*%s_%d_%d", kind, delay->num, i / 3);
- attr = find_attr (str, 0);
+ pstr = str;
+ attr = find_attr (&pstr, 0);
if (! attr)
abort ();
common_av = find_most_used (attr);
@@ -5441,6 +5693,7 @@ write_complex_function (struct function_unit *unit,
struct attr_value *av, *common_av;
rtx value;
char str[256];
+ const char *pstr;
int using_case;
int i;
@@ -5458,7 +5711,8 @@ write_complex_function (struct function_unit *unit,
if (strlen (unit->name) + sizeof "*_cases" > 256)
abort ();
sprintf (str, "*%s_cases", unit->name);
- case_attr = find_attr (str, 0);
+ pstr = str;
+ case_attr = find_attr (&pstr, 0);
if (! case_attr)
abort ();
common_av = find_most_used (case_attr);
@@ -5492,7 +5746,8 @@ write_complex_function (struct function_unit *unit,
printf (" case %d:\n", i);
sprintf (str, "*%s_%s_%d", unit->name, connection, i);
- attr = find_attr (str, 0);
+ pstr = str;
+ attr = find_attr (&pstr, 0);
if (! attr)
abort ();
@@ -5544,13 +5799,15 @@ next_comma_elt (const char **pstr)
}
/* Return a `struct attr_desc' pointer for a given named attribute. If CREATE
- is nonzero, build a new attribute, if one does not exist. */
+ is nonzero, build a new attribute, if one does not exist. *NAME_P is
+ replaced by a pointer to a canonical copy of the string. */
static struct attr_desc *
-find_attr (const char *name, int create)
+find_attr (const char **name_p, int create)
{
struct attr_desc *attr;
int index;
+ const char *name = *name_p;
/* Before we resort to using `strcmp', see if the string address matches
anywhere. In most cases, it should have been canonicalized to do so. */
@@ -5565,19 +5822,24 @@ find_attr (const char *name, int create)
/* Otherwise, do it the slow way. */
for (attr = attrs[index]; attr; attr = attr->next)
if (name[0] == attr->name[0] && ! strcmp (name, attr->name))
- return attr;
+ {
+ *name_p = attr->name;
+ return attr;
+ }
if (! create)
return NULL;
attr = oballoc (sizeof (struct attr_desc));
- attr->name = attr_string (name, strlen (name));
+ attr->name = DEF_ATTR_STRING (name);
attr->first_value = attr->default_val = NULL;
attr->is_numeric = attr->negative_ok = attr->is_const = attr->is_special = 0;
attr->unsigned_p = attr->func_units_p = attr->blockage_p = attr->static_p = 0;
attr->next = attrs[index];
attrs[index] = attr;
+ *name_p = attr->name;
+
return attr;
}
@@ -5588,7 +5850,7 @@ make_internal_attr (const char *name, rtx value, int special)
{
struct attr_desc *attr;
- attr = find_attr (name, 1);
+ attr = find_attr (&name, 1);
if (attr->default_val)
abort ();
@@ -5693,7 +5955,7 @@ copy_rtx_unchanging (rtx orig)
static void
write_const_num_delay_slots (void)
{
- struct attr_desc *attr = find_attr ("*num_delay_slots", 0);
+ struct attr_desc *attr = find_attr (&num_delay_slots_str, 0);
struct attr_value *av;
struct insn_ent *ie;
@@ -5751,7 +6013,11 @@ main (int argc, char **argv)
ATTR_IND_SIMPLIFIED_P (true_rtx) = ATTR_IND_SIMPLIFIED_P (false_rtx) = 1;
ATTR_PERMANENT_P (true_rtx) = ATTR_PERMANENT_P (false_rtx) = 1;
- alternative_name = attr_string ("alternative", strlen ("alternative"));
+ alternative_name = DEF_ATTR_STRING ("alternative");
+ length_str = DEF_ATTR_STRING ("length");
+ delay_type_str = DEF_ATTR_STRING ("*delay_type");
+ delay_1_0_str = DEF_ATTR_STRING ("*delay_1_0");
+ num_delay_slots_str = DEF_ATTR_STRING ("*num_delay_slots");
printf ("/* Generated automatically by the program `genattrtab'\n\
from the machine description file `md'. */\n\n");
@@ -5934,7 +6200,7 @@ from the machine description file `md'. */\n\n");
insn_alts_p
= (attr->name [0] == '*'
- && strcmp (&attr->name [1], INSN_ALTS_FUNC_NAME) == 0);
+ && strcmp (&attr->name[1], INSN_ALTS_FUNC_NAME) == 0);
if (insn_alts_p)
printf ("\n#if AUTOMATON_ALTS\n");
write_attr_get (attr);
diff --git a/gcc/genautomata.c b/gcc/genautomata.c
index a5783e6f80d..b343d6e65ba 100644
--- a/gcc/genautomata.c
+++ b/gcc/genautomata.c
@@ -6282,7 +6282,7 @@ merge_states (automaton_t automaton, vla_ptr_t *equiv_classes)
}
}
/* Its is important that alt states were sorted before and
- after merging to have the same quering results. */
+ after merging to have the same querying results. */
new_state->component_states = uniq_sort_alt_states (alt_states);
}
else
diff --git a/gcc/genemit.c b/gcc/genemit.c
index 8a821d67bc2..0e695d2729c 100644
--- a/gcc/genemit.c
+++ b/gcc/genemit.c
@@ -32,7 +32,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static int max_opno;
static int max_dup_opno;
static int max_scratch_opno;
-static int register_constraints;
static int insn_code_number;
static int insn_index_number;
@@ -83,10 +82,6 @@ max_operand_1 (rtx x)
code = GET_CODE (x);
- if (code == MATCH_OPERAND && XSTR (x, 2) != 0 && *XSTR (x, 2) != '\0')
- register_constraints = 1;
- if (code == MATCH_SCRATCH && XSTR (x, 1) != 0 && *XSTR (x, 1) != '\0')
- register_constraints = 1;
if (code == MATCH_OPERAND || code == MATCH_OPERATOR
|| code == MATCH_PARALLEL)
max_opno = MAX (max_opno, XINT (x, 0));
@@ -376,9 +371,7 @@ gen_insn (rtx insn, int lineno)
printf ("/* %s:%d */\n", read_rtx_filename, lineno);
- /* Find out how many operands this function has,
- and also whether any of them have register constraints. */
- register_constraints = 0;
+ /* Find out how many operands this function has. */
operands = max_operand_vec (insn, 1);
if (max_dup_opno >= operands)
fatal ("match_dup operand number has no match_operand");
@@ -396,7 +389,7 @@ gen_insn (rtx insn, int lineno)
printf (")\n");
printf ("{\n");
- /* Output code to construct and return the rtl for the instruction body */
+ /* Output code to construct and return the rtl for the instruction body. */
if (XVECLEN (insn, 1) == 1)
{
@@ -431,10 +424,7 @@ gen_expand (rtx expand)
if (XVEC (expand, 1) == 0)
fatal ("define_expand for %s lacks a pattern", XSTR (expand, 0));
- /* Find out how many operands this function has,
- and also whether any of them have register constraints. */
- register_constraints = 0;
-
+ /* Find out how many operands this function has. */
operands = max_operand_vec (expand, 1);
/* Output the function name and argument declarations. */
diff --git a/gcc/gengtype-lex.l b/gcc/gengtype-lex.l
index 3b82ff5ec78..2f526599685 100644
--- a/gcc/gengtype-lex.l
+++ b/gcc/gengtype-lex.l
@@ -146,7 +146,7 @@ ITYPE {IWORD}({WS}{IWORD})*
update_lineno (yytext, yyleng);
}
-[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?PARAMS {
+[^[:alnum:]_]typedef{WS}{ID}{WS}?"*"?{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?PARAMS {
char *namestart;
size_t namelen;
struct type *t;
@@ -162,7 +162,7 @@ ITYPE {IWORD}({WS}{IWORD})*
update_lineno (yytext, yyleng);
}
-[^[:alnum:]_]typedef{WS}{ID}{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?"(" {
+[^[:alnum:]_]typedef{WS}{ID}{WS}?"*"?{WS}?"("{WS}?"*"{WS}?{ID}{WS}?")"{WS}?"(" {
char *namestart;
size_t namelen;
struct type *t;
diff --git a/gcc/gengtype.c b/gcc/gengtype.c
index c663a8a3add..784d551fb8a 100644
--- a/gcc/gengtype.c
+++ b/gcc/gengtype.c
@@ -1087,7 +1087,7 @@ open_base_files (void)
"config.h", "system.h", "coretypes.h", "tm.h", "varray.h",
"hashtab.h", "splay-tree.h", "bitmap.h", "tree.h", "rtl.h",
"function.h", "insn-config.h", "expr.h", "hard-reg-set.h",
- "basic-block.h", "cselib.h", "insn-addr.h", "ssa.h", "optabs.h",
+ "basic-block.h", "cselib.h", "insn-addr.h", "optabs.h",
"libfuncs.h", "debug.h", "ggc.h", "cgraph.h",
NULL
};
@@ -2914,10 +2914,10 @@ main(int argc ATTRIBUTE_UNUSED, char **argv ATTRIBUTE_UNUSED)
do_scalar_typedef ("uint8", &pos);
do_scalar_typedef ("jword", &pos);
do_scalar_typedef ("JCF_u2", &pos);
+ do_scalar_typedef ("void", &pos);
+
+ do_typedef ("PTR", create_pointer (resolve_typedef ("void", &pos)), &pos);
- do_typedef ("PTR", create_pointer (create_scalar_type ("void",
- strlen ("void"))),
- &pos);
do_typedef ("HARD_REG_SET", create_array (
create_scalar_type ("unsigned long", strlen ("unsigned long")),
"2"), &pos);
diff --git a/gcc/genmodes.c b/gcc/genmodes.c
index 13456555be6..a09e4527065 100644
--- a/gcc/genmodes.c
+++ b/gcc/genmodes.c
@@ -56,7 +56,7 @@ struct mode_data
const char *name; /* printable mode name -- SI, not SImode */
enum mode_class class; /* this mode class */
- unsigned int bitsize; /* size in bits, equiv to TYPE_PRECISION */
+ unsigned int precision; /* size in bits, equiv to TYPE_PRECISION */
unsigned int bytesize; /* storage size in addressable units */
unsigned int ncomponents; /* number of subunits */
unsigned int alignment; /* mode alignment */
@@ -262,13 +262,13 @@ enum requirement { SET, UNSET, OPTIONAL };
static void
validate_mode (struct mode_data *m,
- enum requirement r_bitsize,
+ enum requirement r_precision,
enum requirement r_bytesize,
enum requirement r_component,
enum requirement r_ncomponents,
enum requirement r_format)
{
- validate_field (m, bitsize);
+ validate_field (m, precision);
validate_field (m, bytesize);
validate_field (m, component);
validate_field (m, ncomponents);
@@ -304,7 +304,7 @@ complete_mode (struct mode_data *m)
validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
- m->bitsize = 0;
+ m->precision = 0;
m->bytesize = 0;
m->ncomponents = 0;
m->component = 0;
@@ -316,7 +316,7 @@ complete_mode (struct mode_data *m)
validate_mode (m, UNSET, UNSET, UNSET, UNSET, UNSET);
m->bytesize = 4;
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0;
break;
@@ -328,7 +328,7 @@ complete_mode (struct mode_data *m)
validate_mode (m, OPTIONAL, SET, UNSET, UNSET,
m->class == MODE_FLOAT ? SET : UNSET);
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0;
break;
@@ -340,7 +340,7 @@ complete_mode (struct mode_data *m)
m->bytesize = m->component->bytesize;
- m->ncomponents = 0;
+ m->ncomponents = 1;
m->component = 0; /* ??? preserve this */
break;
@@ -349,8 +349,8 @@ complete_mode (struct mode_data *m)
/* Complex modes should have a component indicated, but no more. */
validate_mode (m, UNSET, UNSET, SET, UNSET, UNSET);
m->ncomponents = 2;
- if (m->component->bitsize != (unsigned int)-1)
- m->bitsize = 2 * m->component->bitsize;
+ if (m->component->precision != (unsigned int)-1)
+ m->precision = 2 * m->component->precision;
m->bytesize = 2 * m->component->bytesize;
break;
@@ -358,8 +358,8 @@ complete_mode (struct mode_data *m)
case MODE_VECTOR_FLOAT:
/* Vector modes should have a component and a number of components. */
validate_mode (m, UNSET, UNSET, SET, SET, UNSET);
- if (m->component->bitsize != (unsigned int)-1)
- m->bitsize = m->ncomponents * m->component->bitsize;
+ if (m->component->precision != (unsigned int)-1)
+ m->precision = m->ncomponents * m->component->precision;
m->bytesize = m->ncomponents * m->component->bytesize;
break;
@@ -413,7 +413,7 @@ make_complex_modes (enum mode_class class,
for (m = modes[class]; m; m = m->next)
{
/* Skip BImode. FIXME: BImode probably shouldn't be MODE_INT. */
- if (m->bitsize == 1)
+ if (m->precision == 1)
continue;
if (strlen (m->name) >= sizeof buf)
@@ -479,7 +479,7 @@ make_vector_modes (enum mode_class class, unsigned int width,
not be necessary. */
if (class == MODE_FLOAT && m->bytesize == 1)
continue;
- if (class == MODE_INT && m->bitsize == 1)
+ if (class == MODE_INT && m->precision == 1)
continue;
if ((size_t)snprintf (buf, sizeof buf, "V%u%s", ncomponents, m->name)
@@ -515,12 +515,12 @@ make_special_mode (enum mode_class class, const char *name,
static void
make_int_mode (const char *name,
- unsigned int bitsize, unsigned int bytesize,
+ unsigned int precision, unsigned int bytesize,
const char *file, unsigned int line)
{
struct mode_data *m = new_mode (MODE_INT, name, file, line);
m->bytesize = bytesize;
- m->bitsize = bitsize;
+ m->precision = precision;
}
#define FLOAT_MODE(N, Y, F) FRACTIONAL_FLOAT_MODE (N, -1, Y, F)
@@ -529,13 +529,13 @@ make_int_mode (const char *name,
static void
make_float_mode (const char *name,
- unsigned int bitsize, unsigned int bytesize,
+ unsigned int precision, unsigned int bytesize,
const char *format,
const char *file, unsigned int line)
{
struct mode_data *m = new_mode (MODE_FLOAT, name, file, line);
m->bytesize = bytesize;
- m->bitsize = bitsize;
+ m->precision = precision;
m->format = format;
}
@@ -565,7 +565,7 @@ reset_float_format (const char *name, const char *format,
make_partial_integer_mode (#M, "P" #M, -1, __FILE__, __LINE__)
static void ATTRIBUTE_UNUSED
make_partial_integer_mode (const char *base, const char *name,
- unsigned int bitsize,
+ unsigned int precision,
const char *file, unsigned int line)
{
struct mode_data *m;
@@ -582,7 +582,7 @@ make_partial_integer_mode (const char *base, const char *name,
}
m = new_mode (MODE_PARTIAL_INT, name, file, line);
- m->bitsize = bitsize;
+ m->precision = precision;
m->component = component;
}
@@ -645,18 +645,18 @@ create_modes (void)
/* Processing. */
/* Sort a list of modes into the order needed for the WIDER field:
- major sort by bitsize, minor sort by component bitsize.
+ major sort by precision, minor sort by component precision.
For instance:
QI < HI < SI < DI < TI
V4QI < V2HI < V8QI < V4HI < V2SI.
- If the bitsize is not set, sort by the bytesize. A mode with
- bitsize set gets sorted before a mode without bitsize set, if
+ If the precision is not set, sort by the bytesize. A mode with
+ precision set gets sorted before a mode without precision set, if
they have the same bytesize; this is the right thing because
- the bitsize must always be smaller than the bytesize * BITS_PER_UNIT.
+ the precision must always be smaller than the bytesize * BITS_PER_UNIT.
We don't have to do anything special to get this done -- an unset
- bitsize shows up as (unsigned int)-1, i.e. UINT_MAX. */
+ precision shows up as (unsigned int)-1, i.e. UINT_MAX. */
static int
cmp_modes (const void *a, const void *b)
{
@@ -668,9 +668,9 @@ cmp_modes (const void *a, const void *b)
else if (m->bytesize < n->bytesize)
return -1;
- if (m->bitsize > n->bitsize)
+ if (m->precision > n->precision)
return 1;
- else if (m->bitsize < n->bitsize)
+ else if (m->precision < n->precision)
return -1;
if (!m->component && !n->component)
@@ -681,9 +681,9 @@ cmp_modes (const void *a, const void *b)
else if (m->component->bytesize < n->component->bytesize)
return -1;
- if (m->component->bitsize > n->component->bitsize)
+ if (m->component->precision > n->component->precision)
return 1;
- else if (m->component->bitsize < n->component->bitsize)
+ else if (m->component->precision < n->component->precision)
return -1;
return 0;
@@ -802,7 +802,7 @@ enum machine_mode\n{");
end will try to use it for bitfields in structures and the
like, which we do not want. Only the target md file should
generate BImode widgets. */
- if (first && first->bitsize == 1)
+ if (first && first->precision == 1)
first = first->next;
if (first && last)
@@ -892,16 +892,16 @@ emit_mode_class (void)
}
static void
-emit_mode_bitsize (void)
+emit_mode_precision (void)
{
enum mode_class c;
struct mode_data *m;
- print_decl ("unsigned short", "mode_bitsize", "NUM_MACHINE_MODES");
+ print_decl ("unsigned short", "mode_precision", "NUM_MACHINE_MODES");
for_all_modes (c, m)
- if (m->bitsize != (unsigned int)-1)
- tagged_printf ("%u", m->bitsize, m->name);
+ if (m->precision != (unsigned int)-1)
+ tagged_printf ("%u", m->precision, m->name);
else
tagged_printf ("%u*BITS_PER_UNIT", m->bytesize, m->name);
@@ -968,8 +968,8 @@ emit_mode_mask (void)
: ((unsigned HOST_WIDE_INT) 1 << (m)) - 1\n");
for_all_modes (c, m)
- if (m->bitsize != (unsigned int)-1)
- tagged_printf ("MODE_MASK (%u)", m->bitsize, m->name);
+ if (m->precision != (unsigned int)-1)
+ tagged_printf ("MODE_MASK (%u)", m->precision, m->name);
else
tagged_printf ("MODE_MASK (%u*BITS_PER_UNIT)", m->bytesize, m->name);
@@ -1020,7 +1020,7 @@ emit_class_narrowest_mode (void)
/* Bleah, all this to get the comment right for MIN_MODE_INT. */
tagged_printf ("MIN_%s", mode_class_names[c],
modes[c]
- ? (modes[c]->bitsize != 1
+ ? (modes[c]->precision != 1
? modes[c]->name
: (modes[c]->next
? modes[c]->next->name
@@ -1156,7 +1156,7 @@ emit_insn_modes_c (void)
emit_insn_modes_c_header ();
emit_mode_name ();
emit_mode_class ();
- emit_mode_bitsize ();
+ emit_mode_precision ();
emit_mode_size ();
emit_mode_nunits ();
emit_mode_wider ();
diff --git a/gcc/genmultilib b/gcc/genmultilib
index b5ffa9d4d52..3cac4e9ad7a 100644
--- a/gcc/genmultilib
+++ b/gcc/genmultilib
@@ -323,6 +323,7 @@ for combo in ${combinations}; do
osdirout=`echo ${osdirout} | sed -e 's|^/||' -e 's|/$||g'`
if [ "x${enable_multilib}" != xyes ]; then
dirout=".:${osdirout}"
+ disable_multilib=yes
else
case "${osdirout}" in
!*)
@@ -403,6 +404,12 @@ moptions=`echo ${options} | sed -e 's,[ ][ ]*, ,g'`
echo ""
echo "static const char *multilib_options = \"${moptions}\";"
+# Finally output the disable flag if specified
+if [ "x${disable_multilib}" = xyes ]; then
+ echo ""
+ echo "#define DISABLE_MULTILIB 1"
+fi
+
cd ..
rm -r tmpmultilib.$$
diff --git a/gcc/genrecog.c b/gcc/genrecog.c
index 76f37496107..208ea8e57f2 100644
--- a/gcc/genrecog.c
+++ b/gcc/genrecog.c
@@ -633,7 +633,7 @@ validate_pattern (rtx pattern, rtx insn, rtx set, int set_code)
if (GET_CODE (dest) == STRICT_LOW_PART)
dest = XEXP (dest, 0);
- /* Find the referant for a DUP. */
+ /* Find the referent for a DUP. */
if (GET_CODE (dest) == MATCH_DUP
|| GET_CODE (dest) == MATCH_OP_DUP
@@ -1734,6 +1734,20 @@ write_afterward (struct decision *start, struct decision *afterward,
}
}
+/* Emit a HOST_WIDE_INT as an integer constant expression. We need to take
+ special care to avoid "decimal constant is so large that it is unsigned"
+ warnings in the resulting code. */
+
+static void
+print_host_wide_int (HOST_WIDE_INT val)
+{
+ HOST_WIDE_INT min = (unsigned HOST_WIDE_INT)1 << (HOST_BITS_PER_WIDE_INT-1);
+ if (val == min)
+ printf ("(" HOST_WIDE_INT_PRINT_DEC_C "-1)", val + 1);
+ else
+ printf (HOST_WIDE_INT_PRINT_DEC_C, val);
+}
+
/* Emit a switch statement, if possible, for an initial sequence of
nodes at START. Return the first node yet untested. */
@@ -1907,7 +1921,7 @@ write_switch (struct decision *start, int depth)
case DT_elt_one_int:
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
- printf (HOST_WIDE_INT_PRINT_DEC_C, p->tests->u.intval);
+ print_host_wide_int (p->tests->u.intval);
break;
default:
abort ();
@@ -1964,7 +1978,7 @@ write_cond (struct decision_test *p, int depth,
case DT_elt_zero_wide:
case DT_elt_zero_wide_safe:
printf ("XWINT (x%d, 0) == ", depth);
- printf (HOST_WIDE_INT_PRINT_DEC_C, p->u.intval);
+ print_host_wide_int (p->u.intval);
break;
case DT_veclen_ge:
diff --git a/gcc/gensupport.c b/gcc/gensupport.c
index 23f8e3f32cd..fede14a5130 100644
--- a/gcc/gensupport.c
+++ b/gcc/gensupport.c
@@ -259,7 +259,7 @@ process_include (rtx desc, int lineno)
fclose (input_file);
}
-/* Process a top level rtx in some way, queueing as appropriate. */
+/* Process a top level rtx in some way, queuing as appropriate. */
static void
process_rtx (rtx desc, int lineno)
@@ -842,7 +842,7 @@ process_define_cond_exec (void)
static char *
save_string (const char *s, int len)
{
- register char *result = xmalloc (len + 1);
+ char *result = xmalloc (len + 1);
memcpy (result, s, len);
result[len] = 0;
diff --git a/gcc/ggc-common.c b/gcc/ggc-common.c
index eab766e0378..ecd6624487c 100644
--- a/gcc/ggc-common.c
+++ b/gcc/ggc-common.c
@@ -48,10 +48,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#endif
#ifdef ENABLE_VALGRIND_CHECKING
-# ifdef HAVE_MEMCHECK_H
-# include <memcheck.h>
+# ifdef HAVE_VALGRIND_MEMCHECK_H
+# include <valgrind/memcheck.h>
+# elif defined HAVE_MEMCHECK_H
+# include <memcheck.h>
# else
-# include <valgrind.h>
+# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
diff --git a/gcc/ggc-page.c b/gcc/ggc-page.c
index 198b73364bf..bf18e3f00d7 100644
--- a/gcc/ggc-page.c
+++ b/gcc/ggc-page.c
@@ -31,10 +31,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "timevar.h"
#include "params.h"
#ifdef ENABLE_VALGRIND_CHECKING
-# ifdef HAVE_MEMCHECK_H
-# include <memcheck.h>
+# ifdef HAVE_VALGRIND_MEMCHECK_H
+# include <valgrind/memcheck.h>
+# elif defined HAVE_MEMCHECK_H
+# include <memcheck.h>
# else
-# include <valgrind.h>
+# include <valgrind.h>
# endif
#else
/* Avoid #ifdef:s when we can help it. */
@@ -185,7 +187,7 @@ static const size_t extra_order_size_table[] = {
sizeof (struct tree_list),
TREE_EXP_SIZE (2),
RTL_SIZE (2), /* MEM, PLUS, etc. */
- RTL_SIZE (9), /* INSN, CALL_INSN, JUMP_INSN */
+ RTL_SIZE (9), /* INSN */
};
/* The total number of orders. */
@@ -399,13 +401,12 @@ static struct globals
zero otherwise. We allocate them all together, to enable a
better runtime data access pattern. */
unsigned long **save_in_use;
-
#ifdef GATHER_STATISTICS
struct
{
- /* Total memory allocated with ggc_alloc */
+ /* Total memory allocated with ggc_alloc. */
unsigned long long total_allocated;
- /* Total overhead for memory to be allocated with ggc_alloc */
+ /* Total overhead for memory to be allocated with ggc_alloc. */
unsigned long long total_overhead;
/* Total allocations and overhead for sizes less than 32, 64 and 128.
@@ -421,6 +422,9 @@ static struct globals
unsigned long long total_allocated_under128;
unsigned long long total_overhead_under128;
+ /* The allocations for each of the allocation orders. */
+ unsigned long long total_allocated_per_order[NUM_ORDERS];
+
/* The overhead for each of the allocation orders. */
unsigned long long total_overhead_per_order[NUM_ORDERS];
} stats;
@@ -1169,8 +1173,9 @@ ggc_alloc (size_t size)
#ifdef GATHER_STATISTICS
{
G.stats.total_overhead += OBJECT_SIZE (order) - size;
- G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size;
G.stats.total_allocated += OBJECT_SIZE(order);
+ G.stats.total_overhead_per_order[order] += OBJECT_SIZE (order) - size;
+ G.stats.total_allocated_per_order[order] += OBJECT_SIZE (order);
if (size <= 32){
G.stats.total_overhead_under32 += OBJECT_SIZE (order) - size;
@@ -1399,6 +1404,20 @@ init_ggc (void)
G.save_in_use = xmalloc (G.by_depth_max * sizeof (unsigned long *));
}
+/* Start a new GGC zone. */
+
+struct alloc_zone *
+new_ggc_zone (const char *name ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+/* Destroy a GGC zone. */
+void
+destroy_ggc_zone (struct alloc_zone *zone ATTRIBUTE_UNUSED)
+{
+}
+
/* Increment the `GC context'. Objects allocated in an outer context
are never freed, eliminating the need to register their roots. */
@@ -1828,6 +1847,8 @@ ggc_print_statistics (void)
/* Collect some information about the various sizes of
allocation. */
+ fprintf (stderr,
+ "Memory still allocated at the end of the compilation process\n");
fprintf (stderr, "%-5s %10s %10s %10s\n",
"Size", "Allocated", "Used", "Overhead");
for (i = 0; i < NUM_ORDERS; ++i)
@@ -1869,6 +1890,8 @@ ggc_print_statistics (void)
#ifdef GATHER_STATISTICS
{
+ fprintf (stderr, "\nTotal allocations and overheads during the compilation process\n");
+
fprintf (stderr, "Total Overhead: %10lld\n",
G.stats.total_overhead);
fprintf (stderr, "Total Allocated: %10lld\n",
@@ -1888,9 +1911,13 @@ ggc_print_statistics (void)
G.stats.total_allocated_under128);
for (i = 0; i < NUM_ORDERS; i++)
- if (G.stats.total_overhead_per_order[i])
- fprintf (stderr, "Total Overhead page size %7d: %10lld\n",
- OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
+ if (G.stats.total_allocated_per_order[i])
+ {
+ fprintf (stderr, "Total Overhead page size %7d: %10lld\n",
+ OBJECT_SIZE (i), G.stats.total_overhead_per_order[i]);
+ fprintf (stderr, "Total Allocated page size %7d: %10lld\n",
+ OBJECT_SIZE (i), G.stats.total_allocated_per_order[i]);
+ }
}
#endif
}
@@ -2107,7 +2134,7 @@ ggc_pch_read (FILE *f, void *addr)
/* We've just read in a PCH file. So, every object that used to be
allocated is now free. */
clear_marks ();
-#ifdef GGC_POISON
+#ifdef ENABLE_GC_CHECKING
poison_pages ();
#endif
diff --git a/gcc/ggc-simple.c b/gcc/ggc-simple.c
index eee33a568af..2f75021f42d 100644
--- a/gcc/ggc-simple.c
+++ b/gcc/ggc-simple.c
@@ -344,6 +344,20 @@ init_ggc (void)
{
}
+/* Start a new GGC zone. */
+
+struct alloc_zone *
+new_ggc_zone (const char *name ATTRIBUTE_UNUSED)
+{
+ return NULL;
+}
+
+/* Destroy a GGC zone. */
+void
+destroy_ggc_zone (struct alloc_zone *zone ATTRIBUTE_UNUSED)
+{
+}
+
/* Start a new GGC context. Memory allocated in previous contexts
will not be collected while the new context is active. */
diff --git a/gcc/ggc-zone.c b/gcc/ggc-zone.c
index 897389e0286..a709edf5931 100644
--- a/gcc/ggc-zone.c
+++ b/gcc/ggc-zone.c
@@ -36,7 +36,13 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "bitmap.h"
#ifdef ENABLE_VALGRIND_CHECKING
-#include <valgrind/memcheck.h>
+# ifdef HAVE_VALGRIND_MEMCHECK_H
+# include <valgrind/memcheck.h>
+# elif defined HAVE_MEMCHECK_H
+# include <memcheck.h>
+# else
+# include <valgrind.h>
+# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)
@@ -83,7 +89,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
If we track inter-zone pointers, we can mark single zones at a
time.
If we have a zone where we guarantee no inter-zone pointers, we
- could mark that zone seperately.
+ could mark that zone separately.
The garbage zone should not be marked, and we should return 1 in
ggc_set_mark for any object in the garbage zone, which cuts off
marking quickly. */
@@ -238,7 +244,6 @@ struct max_alignment {
#define LOOKUP_L2(p) \
(((size_t) (p) >> G.lg_pagesize) & ((1 << PAGE_L2_BITS) - 1))
-struct alloc_zone;
/* A page_entry records the status of an allocation page. */
typedef struct page_entry
{
@@ -262,7 +267,7 @@ typedef struct page_entry
#endif
/* Number of bytes on the page unallocated. Only used during
- collection, and even then large pages merely set this non-zero. */
+ collection, and even then large pages merely set this nonzero. */
size_t bytes_free;
/* Context depth of this page. */
@@ -271,6 +276,7 @@ typedef struct page_entry
/* Does this page contain small objects, or one large object? */
bool large_p;
+ /* The zone that this page entry belongs to. */
struct alloc_zone *zone;
} page_entry;
@@ -375,8 +381,11 @@ struct alloc_zone
/* Next zone in the linked list of zones. */
struct alloc_zone *next_zone;
- /* Return true if this zone was collected during this collection. */
+ /* True if this zone was collected during this collection. */
bool was_collected;
+
+ /* True if this zone should be destroyed after the next collection. */
+ bool dead;
} main_zone;
struct alloc_zone *rtl_zone;
@@ -995,20 +1004,26 @@ ggc_alloc_zone_1 (size_t size, struct alloc_zone *zone, short type)
return result;
}
-/* Allocate a SIZE of chunk memory of GTE type, into an approriate zone
+/* Allocate a SIZE of chunk memory of GTE type, into an appropriate zone
for that type. */
void *
ggc_alloc_typed (enum gt_types_enum gte, size_t size)
{
- if (gte == gt_ggc_e_14lang_tree_node)
- return ggc_alloc_zone_1 (size, tree_zone, gte);
- else if (gte == gt_ggc_e_7rtx_def)
- return ggc_alloc_zone_1 (size, rtl_zone, gte);
- else if (gte == gt_ggc_e_9rtvec_def)
- return ggc_alloc_zone_1 (size, rtl_zone, gte);
- else
- return ggc_alloc_zone_1 (size, &main_zone, gte);
+ switch (gte)
+ {
+ case gt_ggc_e_14lang_tree_node:
+ return ggc_alloc_zone_1 (size, tree_zone, gte);
+
+ case gt_ggc_e_7rtx_def:
+ return ggc_alloc_zone_1 (size, rtl_zone, gte);
+
+ case gt_ggc_e_9rtvec_def:
+ return ggc_alloc_zone_1 (size, rtl_zone, gte);
+
+ default:
+ return ggc_alloc_zone_1 (size, &main_zone, gte);
+ }
}
/* Normal ggc_alloc simply allocates into the main zone. */
@@ -1127,26 +1142,16 @@ ggc_get_size (const void *p)
/* Initialize the ggc-zone-mmap allocator. */
void
-init_ggc ()
+init_ggc (void)
{
- /* Create the zones. */
+ /* Set up the main zone by hand. */
main_zone.name = "Main zone";
G.zones = &main_zone;
- rtl_zone = xcalloc (1, sizeof (struct alloc_zone));
- rtl_zone->name = "RTL zone";
- /* The main zone's connected to the ... rtl_zone */
- G.zones->next_zone = rtl_zone;
-
- garbage_zone = xcalloc (1, sizeof (struct alloc_zone));
- garbage_zone->name = "Garbage zone";
- /* The rtl zone's connected to the ... garbage zone */
- rtl_zone->next_zone = garbage_zone;
-
- tree_zone = xcalloc (1, sizeof (struct alloc_zone));
- tree_zone->name = "Tree zone";
- /* The garbage zone's connected to ... the tree zone */
- garbage_zone->next_zone = tree_zone;
+ /* Allocate the default zones. */
+ rtl_zone = new_ggc_zone ("RTL zone");
+ tree_zone = new_ggc_zone ("Tree zone");
+ garbage_zone = new_ggc_zone ("Garbage zone");
G.pagesize = getpagesize();
G.lg_pagesize = exact_log2 (G.pagesize);
@@ -1191,11 +1196,42 @@ init_ggc ()
#endif
}
+/* Start a new GGC zone. */
+
+struct alloc_zone *
+new_ggc_zone (const char * name)
+{
+ struct alloc_zone *new_zone = xcalloc (1, sizeof (struct alloc_zone));
+ new_zone->name = name;
+ new_zone->next_zone = G.zones->next_zone;
+ G.zones->next_zone = new_zone;
+ return new_zone;
+}
+
+/* Destroy a GGC zone. */
+void
+destroy_ggc_zone (struct alloc_zone * dead_zone)
+{
+ struct alloc_zone *z;
+
+ for (z = G.zones; z && z->next_zone != dead_zone; z = z->next_zone)
+ /* Just find that zone. */ ;
+
+#ifdef ENABLE_CHECKING
+ /* We should have found the zone in the list. Anything else is fatal. */
+ if (!z)
+ abort ();
+#endif
+
+ /* z is dead, baby. z is dead. */
+ z->dead= true;
+}
+
/* Increment the `GC context'. Objects allocated in an outer context
are never freed, eliminating the need to register their roots. */
void
-ggc_push_context ()
+ggc_push_context (void)
{
struct alloc_zone *zone;
for (zone = G.zones; zone; zone = zone->next_zone)
@@ -1228,15 +1264,15 @@ ggc_pop_context_1 (struct alloc_zone *zone)
/* Any remaining pages in the popped context are lowered to the new
current context; i.e. objects allocated in the popped context and
left over are imported into the previous context. */
- for (p = zone->pages; p != NULL; p = p->next)
- if (p->context_depth > depth)
- p->context_depth = depth;
+ for (p = zone->pages; p != NULL; p = p->next)
+ if (p->context_depth > depth)
+ p->context_depth = depth;
}
/* Pop all the zone contexts. */
void
-ggc_pop_context ()
+ggc_pop_context (void)
{
struct alloc_zone *zone;
for (zone = G.zones; zone; zone = zone->next_zone)
@@ -1282,7 +1318,7 @@ sweep_pages (struct alloc_zone *zone)
}
/* Large pages are all or none affairs. Either they are
- completely empty, or they are completeley full.
+ completely empty, or they are completely full.
Thus, if the above didn't catch it, we need not do anything
except remove the mark and reset the bytes_free.
@@ -1371,19 +1407,24 @@ sweep_pages (struct alloc_zone *zone)
static bool
ggc_collect_1 (struct alloc_zone *zone, bool need_marking)
{
- /* Avoid frequent unnecessary work by skipping collection if the
- total allocations haven't expanded much since the last
- collection. */
- float allocated_last_gc =
- MAX (zone->allocated_last_gc, (size_t)PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024);
+ if (!zone->dead)
+ {
+ /* Avoid frequent unnecessary work by skipping collection if the
+ total allocations haven't expanded much since the last
+ collection. */
+ float allocated_last_gc =
+ MAX (zone->allocated_last_gc,
+ (size_t) PARAM_VALUE (GGC_MIN_HEAPSIZE) * 1024);
- float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100;
+ float min_expand = allocated_last_gc * PARAM_VALUE (GGC_MIN_EXPAND) / 100;
- if (zone->allocated < allocated_last_gc + min_expand)
- return false;
+ if (zone->allocated < allocated_last_gc + min_expand)
+ return false;
+ }
if (!quiet_flag)
- fprintf (stderr, " {%s GC %luk -> ", zone->name, (unsigned long) zone->allocated / 1024);
+ fprintf (stderr, " {%s GC %luk -> ",
+ zone->name, (unsigned long) zone->allocated / 1024);
/* Zero the total allocated bytes. This will be recalculated in the
sweep phase. */
@@ -1402,7 +1443,6 @@ ggc_collect_1 (struct alloc_zone *zone, bool need_marking)
zone->was_collected = true;
zone->allocated_last_gc = zone->allocated;
-
if (!quiet_flag)
fprintf (stderr, "%luk}", (unsigned long) zone->allocated / 1024);
return true;
@@ -1430,10 +1470,12 @@ calculate_average_page_survival (struct alloc_zone *zone)
structures. */
static inline void
-check_cookies ()
+check_cookies (void)
{
#ifdef COOKIE_CHECKING
page_entry *p;
+ struct alloc_zone *zone;
+
for (zone = G.zones; zone; zone = zone->next_zone)
{
for (p = zone->pages; p; p = p->next)
@@ -1459,7 +1501,7 @@ check_cookies ()
/* Top level collection routine. */
void
-ggc_collect ()
+ggc_collect (void)
{
struct alloc_zone *zone;
bool marked = false;
@@ -1470,6 +1512,7 @@ ggc_collect ()
/* Start by possibly collecting the main zone. */
main_zone.was_collected = false;
marked |= ggc_collect_1 (&main_zone, true);
+
/* In order to keep the number of collections down, we don't
collect other zones unless we are collecting the main zone. This
gives us roughly the same number of collections as we used to
@@ -1481,36 +1524,30 @@ ggc_collect ()
if (main_zone.was_collected)
{
- check_cookies ();
- rtl_zone->was_collected = false;
- marked |= ggc_collect_1 (rtl_zone, !marked);
- check_cookies ();
- tree_zone->was_collected = false;
- marked |= ggc_collect_1 (tree_zone, !marked);
- check_cookies ();
- garbage_zone->was_collected = false;
- marked |= ggc_collect_1 (garbage_zone, !marked);
+ struct alloc_zone *zone;
+
+ for (zone = main_zone.next_zone; zone; zone = zone->next_zone)
+ {
+ check_cookies ();
+ zone->was_collected = false;
+ marked |= ggc_collect_1 (zone, !marked);
+ }
}
/* Print page survival stats, if someone wants them. */
if (GGC_DEBUG_LEVEL >= 2)
{
- if (rtl_zone->was_collected)
- {
- f = calculate_average_page_survival (rtl_zone);
- printf ("Average RTL page survival is %f\n", f);
- }
- if (main_zone.was_collected)
- {
- f = calculate_average_page_survival (&main_zone);
- printf ("Average main page survival is %f\n", f);
- }
- if (tree_zone->was_collected)
+ for (zone = G.zones; zone; zone = zone->next_zone)
{
- f = calculate_average_page_survival (tree_zone);
- printf ("Average tree page survival is %f\n", f);
+ if (zone->was_collected)
+ {
+ f = calculate_average_page_survival (zone);
+ printf ("Average page survival in zone `%s' is %f\n",
+ zone->name, f);
+ }
}
}
+
/* Since we don't mark zone at a time right now, marking in any
zone means marking in every zone. So we have to clear all the
marks in all the zones that weren't collected already. */
@@ -1552,13 +1589,34 @@ ggc_collect ()
}
}
}
+
+ /* Free dead zones. */
+ for (zone = G.zones; zone && zone->next_zone; zone = zone->next_zone)
+ {
+ if (zone->next_zone->dead)
+ {
+ struct alloc_zone *dead_zone = zone->next_zone;
+
+ printf ("Zone `%s' is dead and will be freed.\n", dead_zone->name);
+
+ /* The zone must be empty. */
+ if (dead_zone->allocated != 0)
+ abort ();
+
+ /* Unchain the dead zone, release all its pages and free it. */
+ zone->next_zone = zone->next_zone->next_zone;
+ release_pages (dead_zone);
+ free (dead_zone);
+ }
+ }
+
timevar_pop (TV_GC);
}
/* Print allocation statistics. */
void
-ggc_print_statistics ()
+ggc_print_statistics (void)
{
}
@@ -1570,7 +1628,6 @@ struct ggc_pch_data
} d;
size_t base;
size_t written;
-
};
/* Initialize the PCH datastructure. */
@@ -1655,7 +1712,7 @@ ggc_pch_write_object (struct ggc_pch_data *d ATTRIBUTE_UNUSED,
if (!is_string)
{
struct alloc_chunk *chunk = (struct alloc_chunk *) ((char *)x - CHUNK_OVERHEAD);
- size = chunk->size;
+ size = ggc_get_size (x);
if (fwrite (chunk, size + CHUNK_OVERHEAD, 1, f) != 1)
fatal_error ("can't write PCH file: %m");
d->written += size + CHUNK_OVERHEAD;
diff --git a/gcc/ggc.h b/gcc/ggc.h
index 4f25f7373c2..8add2da33ba 100644
--- a/gcc/ggc.h
+++ b/gcc/ggc.h
@@ -141,9 +141,18 @@ extern void init_stringpool (void);
/* A GC implementation must provide these functions. They are internal
to the GC system. */
+/* Forward declare the zone structure. Only ggc_zone implements this. */
+struct alloc_zone;
+
/* Initialize the garbage collector. */
extern void init_ggc (void);
+/* Start a new GGC zone. */
+extern struct alloc_zone *new_ggc_zone (const char *);
+
+/* Free a complete GGC zone, destroying everything in it. */
+extern void destroy_ggc_zone (struct alloc_zone *);
+
/* Start a new GGC context. Memory allocated in previous contexts
will not be collected while the new context is active. */
extern void ggc_push_context (void);
@@ -193,8 +202,6 @@ extern void ggc_pch_read (FILE *, void *);
/* Allocation. */
-/* Zone structure. */
-struct alloc_zone;
/* For single pass garbage. */
extern struct alloc_zone *garbage_zone;
/* For regular rtl allocations. */
@@ -206,7 +213,7 @@ extern struct alloc_zone *tree_zone;
extern void *ggc_alloc (size_t);
/* Allocate an object into the specified allocation zone. */
extern void *ggc_alloc_zone (size_t, struct alloc_zone *);
-/* Allocate an object of the specified type and size. */
+/* Allocate an object of the specified type and size. */
extern void *ggc_alloc_typed (enum gt_types_enum, size_t);
/* Like ggc_alloc, but allocates cleared memory. */
extern void *ggc_alloc_cleared (size_t);
diff --git a/gcc/ginclude/stddef.h b/gcc/ginclude/stddef.h
index d19d78a3140..1bb3e90bc9b 100644
--- a/gcc/ginclude/stddef.h
+++ b/gcc/ginclude/stddef.h
@@ -413,21 +413,12 @@ typedef __WINT_TYPE__ wint_t;
#ifndef __cplusplus
#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
#else
-/* In C++ a POD type can have a user defined address-of operator, and
- that will break offsetof. C++ core defect 273 addresses this and
- claims that reinterpret_casts to char & type are sufficient to
- overcome this problem.
-
- (reinterpret_cast <size_t>
- (&reinterpret_cast <char &>(static_cast <TYPE *> (0)->MEMBER)))
-
- But, such casts are not permitted in integral constant expressions,
- which offsetof is supposed to be.
-
- It appears that offsetof is unimplementable in C++ without a
- compiler extension. */
-#define offsetof(TYPE, MEMBER) (reinterpret_cast <size_t> \
- (&static_cast<TYPE *> (0)->MEMBER))
+/* The cast to "char &" below avoids problems with user-defined
+ "operator &", which can appear in a POD type. */
+#define offsetof(TYPE, MEMBER) \
+ (__offsetof__ (reinterpret_cast <size_t> \
+ (&reinterpret_cast <char &> \
+ (static_cast<TYPE *> (0)->MEMBER))))
#endif /* C++ */
#endif /* _STDDEF_H was defined this time */
diff --git a/gcc/global.c b/gcc/global.c
index c808e207406..de765b36731 100644
--- a/gcc/global.c
+++ b/gcc/global.c
@@ -323,9 +323,7 @@ global_alloc (FILE *file)
#endif
int need_fp
= (! flag_omit_frame_pointer
-#ifdef EXIT_IGNORE_STACK
|| (current_function_calls_alloca && EXIT_IGNORE_STACK)
-#endif
|| FRAME_POINTER_REQUIRED);
size_t i;
@@ -343,22 +341,48 @@ global_alloc (FILE *file)
#ifdef ELIMINABLE_REGS
for (i = 0; i < ARRAY_SIZE (eliminables); i++)
{
- SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from);
+ bool cannot_elim
+ = (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to)
+ || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp));
+
+ if (!regs_asm_clobbered[eliminables[i].from])
+ {
+ SET_HARD_REG_BIT (eliminable_regset, eliminables[i].from);
- if (! CAN_ELIMINATE (eliminables[i].from, eliminables[i].to)
- || (eliminables[i].to == STACK_POINTER_REGNUM && need_fp))
- SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from);
+ if (cannot_elim)
+ SET_HARD_REG_BIT (no_global_alloc_regs, eliminables[i].from);
+ }
+ else if (cannot_elim)
+ error ("%s cannot be used in asm here",
+ reg_names[eliminables[i].from]);
+ else
+ regs_ever_live[eliminables[i].from] = 1;
}
#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
- SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
- if (need_fp)
- SET_HARD_REG_BIT (no_global_alloc_regs, HARD_FRAME_POINTER_REGNUM);
+ if (!regs_asm_clobbered[HARD_FRAME_POINTER_REGNUM])
+ {
+ SET_HARD_REG_BIT (eliminable_regset, HARD_FRAME_POINTER_REGNUM);
+ if (need_fp)
+ SET_HARD_REG_BIT (no_global_alloc_regs, HARD_FRAME_POINTER_REGNUM);
+ }
+ else if (need_fp)
+ error ("%s cannot be used in asm here",
+ reg_names[HARD_FRAME_POINTER_REGNUM]);
+ else
+ regs_ever_live[HARD_FRAME_POINTER_REGNUM] = 1;
#endif
#else
- SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM);
- if (need_fp)
- SET_HARD_REG_BIT (no_global_alloc_regs, FRAME_POINTER_REGNUM);
+ if (!regs_asm_clobbered[FRAME_POINTER_REGNUM])
+ {
+ SET_HARD_REG_BIT (eliminable_regset, FRAME_POINTER_REGNUM);
+ if (need_fp)
+ SET_HARD_REG_BIT (no_global_alloc_regs, FRAME_POINTER_REGNUM);
+ }
+ else if (need_fp)
+ error ("%s cannot be used in asm here", reg_names[FRAME_POINTER_REGNUM]);
+ else
+ regs_ever_live[FRAME_POINTER_REGNUM] = 1;
#endif
/* Track which registers have already been used. Start with registers
@@ -732,7 +756,7 @@ global_conflicts (void)
}
}
- insn = b->head;
+ insn = BB_HEAD (b);
/* Scan the code of this basic block, noting which allocnos
and hard regs are born or die. When one is born,
@@ -832,7 +856,7 @@ global_conflicts (void)
}
}
- if (insn == b->end)
+ if (insn == BB_END (b))
break;
insn = NEXT_INSN (insn);
}
@@ -1781,7 +1805,7 @@ build_insn_chain (rtx first)
{
struct insn_chain *c;
- if (first == b->head)
+ if (first == BB_HEAD (b))
{
int i;
@@ -1843,7 +1867,7 @@ build_insn_chain (rtx first)
}
}
- if (first == b->end)
+ if (first == BB_END (b))
b = b->next_bb;
/* Stop after we pass the end of the last basic block. Verify that
diff --git a/gcc/graph.c b/gcc/graph.c
index 9ff50c18130..483cc7e35a1 100644
--- a/gcc/graph.c
+++ b/gcc/graph.c
@@ -25,9 +25,11 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "tm.h"
#include "rtl.h"
+#include "tree.h"
#include "flags.h"
#include "output.h"
#include "function.h"
+#include "langhooks.h"
#include "hard-reg-set.h"
#include "basic-block.h"
#include "toplev.h"
@@ -55,7 +57,8 @@ start_fct (FILE *fp)
case vcg:
fprintf (fp, "\
graph: { title: \"%s\"\nfolding: 1\nhidden: 2\nnode: { title: \"%s.0\" }\n",
- current_function_name, current_function_name);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2));
break;
case no_graph:
break;
@@ -71,7 +74,8 @@ start_bb (FILE *fp, int bb)
fprintf (fp, "\
graph: {\ntitle: \"%s.BB%d\"\nfolding: 1\ncolor: lightblue\n\
label: \"basic block %d",
- current_function_name, bb, bb);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ bb, bb);
break;
case no_graph:
break;
@@ -113,8 +117,9 @@ node_data (FILE *fp, rtx tmp_rtx)
case vcg:
fprintf (fp, "\
edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n",
- current_function_name,
- current_function_name, XINT (tmp_rtx, 0));
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ XINT (tmp_rtx, 0));
break;
case no_graph:
break;
@@ -126,7 +131,8 @@ edge: { sourcename: \"%s.0\" targetname: \"%s.%d\" }\n",
case vcg:
fprintf (fp, "node: {\n title: \"%s.%d\"\n color: %s\n \
label: \"%s %d\n",
- current_function_name, XINT (tmp_rtx, 0),
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ XINT (tmp_rtx, 0),
GET_CODE (tmp_rtx) == NOTE ? "lightgrey"
: GET_CODE (tmp_rtx) == INSN ? "green"
: GET_CODE (tmp_rtx) == JUMP_INSN ? "darkgreen"
@@ -178,8 +184,11 @@ draw_edge (FILE *fp, int from, int to, int bb_edge, int class)
color = "color: green ";
fprintf (fp,
"edge: { sourcename: \"%s.%d\" targetname: \"%s.%d\" %s",
- current_function_name, from,
- current_function_name, to, color);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ from,
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2),
+ to,
+ color);
if (class)
fprintf (fp, "class: %d ", class);
fputs ("}\n", fp);
@@ -209,7 +218,7 @@ end_fct (FILE *fp)
{
case vcg:
fprintf (fp, "node: { title: \"%s.999999\" label: \"END\" }\n}\n",
- current_function_name);
+ (*lang_hooks.decl_printable_name) (current_function_decl, 2));
break;
case no_graph:
break;
@@ -260,14 +269,14 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
FOR_EACH_BB_REVERSE (bb)
{
rtx x;
- start[INSN_UID (bb->head)] = bb->index;
- end[INSN_UID (bb->end)] = bb->index;
- for (x = bb->head; x != NULL_RTX; x = NEXT_INSN (x))
+ start[INSN_UID (BB_HEAD (bb))] = bb->index;
+ end[INSN_UID (BB_END (bb))] = bb->index;
+ for (x = BB_HEAD (bb); x != NULL_RTX; x = NEXT_INSN (x))
{
in_bb_p[INSN_UID (x)]
= (in_bb_p[INSN_UID (x)] == NOT_IN_BB)
? IN_ONE_BB : IN_MULTIPLE_BB;
- if (x == bb->end)
+ if (x == BB_END (bb))
break;
}
}
@@ -321,7 +330,7 @@ print_rtl_graph_with_bb (const char *base, const char *suffix, rtx rtx_first)
{
if (e->dest != EXIT_BLOCK_PTR)
{
- rtx block_head = e->dest->head;
+ rtx block_head = BB_HEAD (e->dest);
draw_edge (fp, INSN_UID (tmp_rtx),
INSN_UID (block_head),
diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index f75894ac3be..5e11b39d507 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -123,8 +123,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
This pass must update information that subsequent passes expect to
be correct. Namely: reg_n_refs, reg_n_sets, reg_n_deaths,
- reg_n_calls_crossed, and reg_live_length. Also, BLOCK_HEAD,
- BLOCK_END.
+ reg_n_calls_crossed, and reg_live_length. Also, BB_HEAD, BB_END.
The information in the line number notes is carefully retained by
this pass. Notes that refer to the starting and ending of
@@ -973,7 +972,7 @@ priority (rtx insn)
}
/* Macros and functions for keeping the priority queue sorted, and
- dealing with queueing and dequeueing of instructions. */
+ dealing with queuing and dequeuing of instructions. */
#define SCHED_SORT(READY, N_READY) \
do { if ((N_READY) == 2) \
@@ -1432,8 +1431,8 @@ void
get_block_head_tail (int b, rtx *headp, rtx *tailp)
{
/* HEAD and TAIL delimit the basic block being scheduled. */
- rtx head = BLOCK_HEAD (b);
- rtx tail = BLOCK_END (b);
+ rtx head = BB_HEAD (BASIC_BLOCK (b));
+ rtx tail = BB_END (BASIC_BLOCK (b));
/* Don't include any notes or labels at the beginning of the
basic block, or notes at the ends of basic blocks. */
@@ -1872,7 +1871,7 @@ ok_for_early_queue_removal (rtx insn)
/* Remove insns from the queue, before they become "ready" with respect
- to FU latency considerations. */
+ to FU latency considerations. */
static int
early_queue_to_ready (state_t state, struct ready_list *ready)
@@ -2791,7 +2790,7 @@ sched_init (FILE *dump_file)
h_i_d[0].luid = 0;
luid = 1;
FOR_EACH_BB (b)
- for (insn = b->head;; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn))
{
INSN_LUID (insn) = luid;
@@ -2803,7 +2802,7 @@ sched_init (FILE *dump_file)
if (GET_CODE (insn) != NOTE)
++luid;
- if (insn == b->end)
+ if (insn == BB_END (b))
break;
}
@@ -2825,7 +2824,7 @@ sched_init (FILE *dump_file)
FOR_EACH_BB (b)
{
- for (line = b->head; line; line = PREV_INSN (line))
+ for (line = BB_HEAD (b); line; line = PREV_INSN (line))
if (GET_CODE (line) == NOTE && NOTE_LINE_NUMBER (line) > 0)
{
line_note_head[b->index] = line;
@@ -2833,7 +2832,7 @@ sched_init (FILE *dump_file)
}
/* Do a forward search as well, since we won't get to see the first
notes in a basic block. */
- for (line = b->head; line; line = NEXT_INSN (line))
+ for (line = BB_HEAD (b); line; line = NEXT_INSN (line))
{
if (INSN_P (line))
break;
@@ -2852,16 +2851,16 @@ sched_init (FILE *dump_file)
/* ??? Add a NOTE after the last insn of the last basic block. It is not
known why this is done. */
- insn = EXIT_BLOCK_PTR->prev_bb->end;
+ insn = BB_END (EXIT_BLOCK_PTR->prev_bb);
if (NEXT_INSN (insn) == 0
|| (GET_CODE (insn) != NOTE
&& GET_CODE (insn) != CODE_LABEL
/* Don't emit a NOTE if it would end up before a BARRIER. */
&& GET_CODE (NEXT_INSN (insn)) != BARRIER))
{
- emit_note_after (NOTE_INSN_DELETED, EXIT_BLOCK_PTR->prev_bb->end);
+ emit_note_after (NOTE_INSN_DELETED, BB_END (EXIT_BLOCK_PTR->prev_bb));
/* Make insn to appear outside BB. */
- EXIT_BLOCK_PTR->prev_bb->end = PREV_INSN (EXIT_BLOCK_PTR->prev_bb->end);
+ BB_END (EXIT_BLOCK_PTR->prev_bb) = PREV_INSN (BB_END (EXIT_BLOCK_PTR->prev_bb));
}
/* Compute INSN_REG_WEIGHT for all blocks. We must do this before
diff --git a/gcc/ifcvt.c b/gcc/ifcvt.c
index fe3806066b1..2b10e18628e 100644
--- a/gcc/ifcvt.c
+++ b/gcc/ifcvt.c
@@ -84,9 +84,6 @@ static int cond_exec_changed_p;
/* True if life data ok at present. */
static bool life_data_ok;
-/* The post-dominator relation on the original block numbers. */
-static dominance_info post_dominators;
-
/* Forward references. */
static int count_bb_insns (basic_block);
static rtx first_active_insn (basic_block);
@@ -123,6 +120,7 @@ mark_loop_exit_edges (void)
edge e;
flow_loops_find (&loops, LOOP_TREE);
+ free_dominance_info (CDI_DOMINATORS);
if (loops.num > 1)
{
@@ -148,14 +146,14 @@ static int
count_bb_insns (basic_block bb)
{
int count = 0;
- rtx insn = bb->head;
+ rtx insn = BB_HEAD (bb);
while (1)
{
if (GET_CODE (insn) == CALL_INSN || GET_CODE (insn) == INSN)
count++;
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
insn = NEXT_INSN (insn);
}
@@ -168,18 +166,18 @@ count_bb_insns (basic_block bb)
static rtx
first_active_insn (basic_block bb)
{
- rtx insn = bb->head;
+ rtx insn = BB_HEAD (bb);
if (GET_CODE (insn) == CODE_LABEL)
{
- if (insn == bb->end)
+ if (insn == BB_END (bb))
return NULL_RTX;
insn = NEXT_INSN (insn);
}
while (GET_CODE (insn) == NOTE)
{
- if (insn == bb->end)
+ if (insn == BB_END (bb))
return NULL_RTX;
insn = NEXT_INSN (insn);
}
@@ -195,8 +193,8 @@ first_active_insn (basic_block bb)
static rtx
last_active_insn (basic_block bb, int skip_use_p)
{
- rtx insn = bb->end;
- rtx head = bb->head;
+ rtx insn = BB_END (bb);
+ rtx head = BB_HEAD (bb);
while (GET_CODE (insn) == NOTE
|| GET_CODE (insn) == JUMP_INSN
@@ -407,13 +405,13 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
/* Find the conditional jump to the ELSE or JOIN part, and isolate
the test. */
- test_expr = cond_exec_get_condition (test_bb->end);
+ test_expr = cond_exec_get_condition (BB_END (test_bb));
if (! test_expr)
return FALSE;
/* If the conditional jump is more than just a conditional jump,
then we can not do conditional execution conversion on this block. */
- if (! onlyjump_p (test_bb->end))
+ if (! onlyjump_p (BB_END (test_bb)))
return FALSE;
/* Collect the bounds of where we're to search, skipping any labels, jumps
@@ -440,7 +438,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
true_expr = test_expr;
- false_code = reversed_comparison_code (true_expr, test_bb->end);
+ false_code = reversed_comparison_code (true_expr, BB_END (test_bb));
if (false_code != UNKNOWN)
false_expr = gen_rtx_fmt_ee (false_code, GET_MODE (true_expr),
XEXP (true_expr, 0), XEXP (true_expr, 1));
@@ -452,12 +450,12 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
conditional execution register from a comparison, it can do so here. */
IFCVT_MODIFY_TESTS (ce_info, true_expr, false_expr);
- /* See if the conversion failed */
+ /* See if the conversion failed. */
if (!true_expr || !false_expr)
goto fail;
#endif
- true_prob_val = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX);
+ true_prob_val = find_reg_note (BB_END (test_bb), REG_BR_PROB, NULL_RTX);
if (true_prob_val)
{
true_prob_val = XEXP (true_prob_val, 0);
@@ -491,11 +489,11 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
/* If the conditional jump is more than just a conditional jump, then
we can not do conditional execution conversion on this block. */
- if (! onlyjump_p (bb->end))
+ if (! onlyjump_p (BB_END (bb)))
goto fail;
/* Find the conditional jump and isolate the test. */
- t = cond_exec_get_condition (bb->end);
+ t = cond_exec_get_condition (BB_END (bb));
if (! t)
goto fail;
@@ -521,7 +519,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
#ifdef IFCVT_MODIFY_MULTIPLE_TESTS
IFCVT_MODIFY_MULTIPLE_TESTS (ce_info, bb, t, f);
- /* See if the conversion failed */
+ /* See if the conversion failed. */
if (!t || !f)
goto fail;
#endif
@@ -563,7 +561,7 @@ cond_exec_process_if_block (ce_if_block_t * ce_info,
}
#ifdef IFCVT_MODIFY_FINAL
- /* Do any machine dependent final modifications */
+ /* Do any machine dependent final modifications. */
IFCVT_MODIFY_FINAL (ce_info);
#endif
@@ -602,6 +600,7 @@ struct noce_if_info
};
static rtx noce_emit_store_flag (struct noce_if_info *, rtx, int, int);
+static int noce_try_move (struct noce_if_info *);
static int noce_try_store_flag (struct noce_if_info *);
static int noce_try_addcc (struct noce_if_info *);
static int noce_try_store_flag_constants (struct noce_if_info *);
@@ -674,7 +673,9 @@ noce_emit_store_flag (struct noce_if_info *if_info, rtx x, int reversep,
|| code == GEU || code == GTU), normalize);
}
-/* Emit instruction to move an rtx into STRICT_LOW_PART. */
+/* Emit instruction to move an rtx, possibly into STRICT_LOW_PART.
+ X is the destination/target and Y is the value to copy. */
+
static void
noce_emit_move_insn (rtx x, rtx y)
{
@@ -697,6 +698,60 @@ noce_emit_move_insn (rtx x, rtx y)
GET_MODE_BITSIZE (inmode));
}
+/* Unshare sequence SEQ produced by if conversion. We care to mark
+ all arguments that may be shared with outer instruction stream. */
+static void
+unshare_ifcvt_sequence (struct noce_if_info *if_info, rtx seq)
+{
+ set_used_flags (if_info->x);
+ set_used_flags (if_info->cond);
+ unshare_all_rtl_in_chain (seq);
+}
+
+/* Convert "if (a != b) x = a; else x = b" into "x = a" and
+ "if (a == b) x = a; else x = b" into "x = b". */
+
+static int
+noce_try_move (struct noce_if_info *if_info)
+{
+ rtx cond = if_info->cond;
+ enum rtx_code code = GET_CODE (cond);
+ rtx y, seq;
+
+ if (code != NE && code != EQ)
+ return FALSE;
+
+ /* This optimization isn't valid if either A or B could be a NaN
+ or a signed zero. */
+ if (HONOR_NANS (GET_MODE (if_info->x))
+ || HONOR_SIGNED_ZEROS (GET_MODE (if_info->x)))
+ return FALSE;
+
+ /* Check whether the operands of the comparison are A and in
+ either order. */
+ if ((rtx_equal_p (if_info->a, XEXP (cond, 0))
+ && rtx_equal_p (if_info->b, XEXP (cond, 1)))
+ || (rtx_equal_p (if_info->a, XEXP (cond, 1))
+ && rtx_equal_p (if_info->b, XEXP (cond, 0))))
+ {
+ y = (code == EQ) ? if_info->a : if_info->b;
+
+ /* Avoid generating the move if the source is the destination. */
+ if (! rtx_equal_p (if_info->x, y))
+ {
+ start_sequence ();
+ noce_emit_move_insn (if_info->x, y);
+ seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
+ end_sequence ();
+ emit_insn_before_setloc (seq, if_info->jump,
+ INSN_LOCATOR (if_info->insn_a));
+ }
+ return TRUE;
+ }
+ return FALSE;
+}
+
/* Convert "if (test) x = 1; else x = 0".
Only try 0 and STORE_FLAG_VALUE here. Other combinations will be
@@ -731,6 +786,7 @@ noce_try_store_flag (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
emit_insn_before_setloc (seq, if_info->jump, INSN_LOCATOR (if_info->insn_a));
@@ -861,6 +917,7 @@ noce_try_store_flag_constants (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
if (seq_contains_jump (seq))
@@ -898,9 +955,11 @@ noce_try_addcc (struct noce_if_info *if_info)
{
start_sequence ();
target = emit_conditional_add (if_info->x, code,
- XEXP (cond, 0), XEXP (cond, 1),
+ XEXP (cond, 0),
+ XEXP (cond, 1),
VOIDmode,
- if_info->b, XEXP (if_info->a, 1),
+ if_info->b,
+ XEXP (if_info->a, 1),
GET_MODE (if_info->x),
(code == LTU || code == GEU
|| code == LEU || code == GTU));
@@ -910,6 +969,7 @@ noce_try_addcc (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
emit_insn_before_setloc (seq, if_info->jump,
INSN_LOCATOR (if_info->insn_a));
@@ -948,6 +1008,7 @@ noce_try_addcc (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
if (seq_contains_jump (seq))
@@ -991,7 +1052,8 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
reversep, -1);
if (target)
target = expand_simple_binop (GET_MODE (if_info->x), AND,
- if_info->x, target, if_info->x, 0,
+ if_info->x,
+ target, if_info->x, 0,
OPTAB_WIDEN);
if (target)
@@ -1000,6 +1062,7 @@ noce_try_store_flag_mask (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
if (seq_contains_jump (seq))
@@ -1097,6 +1160,7 @@ noce_try_cmove (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
emit_insn_before_setloc (seq, if_info->jump,
INSN_LOCATOR (if_info->insn_a));
@@ -1214,7 +1278,9 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
if (is_mem)
{
tmp = gen_reg_rtx (GET_MODE (b));
- tmp = emit_insn (gen_rtx_SET (VOIDmode, tmp, b));
+ tmp = emit_insn (gen_rtx_SET (VOIDmode,
+ tmp,
+ b));
}
else if (! insn_b)
goto end_seq_and_fail;
@@ -1259,6 +1325,7 @@ noce_try_cmove_arith (struct noce_if_info *if_info)
noce_emit_move_insn (x, target);
tmp = get_insns ();
+ unshare_ifcvt_sequence (if_info, tmp);
end_sequence ();
emit_insn_before_setloc (tmp, if_info->jump, INSN_LOCATOR (if_info->insn_a));
return TRUE;
@@ -1504,6 +1571,7 @@ noce_try_minmax (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
if (seq_contains_jump (seq))
@@ -1559,7 +1627,7 @@ noce_try_abs (struct noce_if_info *if_info)
{
rtx insn, note = NULL;
for (insn = earliest;
- insn != if_info->test_bb->head;
+ insn != BB_HEAD (if_info->test_bb);
insn = PREV_INSN (insn))
if (INSN_P (insn)
&& ((note = find_reg_note (insn, REG_EQUAL, c))
@@ -1606,7 +1674,7 @@ noce_try_abs (struct noce_if_info *if_info)
target = expand_abs_nojump (GET_MODE (if_info->x), b, if_info->x, 1);
- /* ??? It's a quandry whether cmove would be better here, especially
+ /* ??? It's a quandary whether cmove would be better here, especially
for integers. Perhaps combine will clean things up. */
if (target && negate)
target = expand_simple_unop (GET_MODE (target), NEG, target, if_info->x, 0);
@@ -1621,6 +1689,7 @@ noce_try_abs (struct noce_if_info *if_info)
noce_emit_move_insn (if_info->x, target);
seq = get_insns ();
+ unshare_ifcvt_sequence (if_info, seq);
end_sequence ();
if (seq_contains_jump (seq))
@@ -1758,7 +1827,7 @@ noce_process_if_block (struct ce_if_block * ce_info)
}
/* If this is not a standard conditional jump, we can't parse it. */
- jump = test_bb->end;
+ jump = BB_END (test_bb);
cond = noce_get_condition (jump, &if_info.cond_earliest);
if (! cond)
return FALSE;
@@ -1874,8 +1943,8 @@ noce_process_if_block (struct ce_if_block * ce_info)
{
rtx note;
- if (else_bb && insn_b == else_bb->end)
- else_bb->end = PREV_INSN (insn_b);
+ if (else_bb && insn_b == BB_END (else_bb))
+ BB_END (else_bb) = PREV_INSN (insn_b);
reorder_insns (insn_b, insn_b, PREV_INSN (jump));
/* If there was a REG_EQUAL note, delete it since it may have been
@@ -1894,6 +1963,27 @@ noce_process_if_block (struct ce_if_block * ce_info)
goto success;
}
+ /* Disallow the "if (...) x = a;" form (with an implicit "else x = x;")
+ for most optimizations if writing to x may trap, i.e. its a memory
+ other than a static var or a stack slot. */
+ if (! set_b
+ && GET_CODE (orig_x) == MEM
+ && ! MEM_NOTRAP_P (orig_x)
+ && rtx_addr_can_trap_p (XEXP (orig_x, 0)))
+ {
+ if (HAVE_conditional_move)
+ {
+ if (noce_try_cmove (&if_info))
+ goto success;
+ if (! HAVE_conditional_execution
+ && noce_try_cmove_arith (&if_info))
+ goto success;
+ }
+ return FALSE;
+ }
+
+ if (noce_try_move (&if_info))
+ goto success;
if (noce_try_store_flag (&if_info))
goto success;
if (noce_try_minmax (&if_info))
@@ -1940,11 +2030,13 @@ noce_process_if_block (struct ce_if_block * ce_info)
if (orig_x != x)
{
start_sequence ();
- noce_emit_move_insn (copy_rtx (orig_x), x);
+ noce_emit_move_insn (orig_x, x);
insn_b = get_insns ();
+ set_used_flags (orig_x);
+ unshare_all_rtl_in_chain (insn_b);
end_sequence ();
- emit_insn_after_setloc (insn_b, test_bb->end, INSN_LOCATOR (insn_a));
+ emit_insn_after_setloc (insn_b, BB_END (test_bb), INSN_LOCATOR (insn_a));
}
/* Merge the blocks! */
@@ -2011,8 +2103,8 @@ merge_if_block (struct ce_if_block * ce_info)
{
bb = fallthru;
fallthru = block_fallthru (bb);
- if (post_dominators)
- delete_from_dominance_info (post_dominators, bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, bb);
merge_blocks (combo_bb, bb);
num_true_changes++;
}
@@ -2028,8 +2120,8 @@ merge_if_block (struct ce_if_block * ce_info)
if (combo_bb->global_live_at_end)
COPY_REG_SET (combo_bb->global_live_at_end,
then_bb->global_live_at_end);
- if (post_dominators)
- delete_from_dominance_info (post_dominators, then_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, then_bb);
merge_blocks (combo_bb, then_bb);
num_true_changes++;
}
@@ -2039,8 +2131,8 @@ merge_if_block (struct ce_if_block * ce_info)
get their addresses taken. */
if (else_bb)
{
- if (post_dominators)
- delete_from_dominance_info (post_dominators, else_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, else_bb);
merge_blocks (combo_bb, else_bb);
num_true_changes++;
}
@@ -2050,7 +2142,7 @@ merge_if_block (struct ce_if_block * ce_info)
if (! join_bb)
{
- rtx last = combo_bb->end;
+ rtx last = BB_END (combo_bb);
/* The outgoing edge for the current COMBO block should already
be correct. Verify this. */
@@ -2096,8 +2188,8 @@ merge_if_block (struct ce_if_block * ce_info)
COPY_REG_SET (combo_bb->global_live_at_end,
join_bb->global_live_at_end);
- if (post_dominators)
- delete_from_dominance_info (post_dominators, join_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, join_bb);
merge_blocks (combo_bb, join_bb);
num_true_changes++;
}
@@ -2177,7 +2269,7 @@ find_if_header (basic_block test_bb, int pass)
&& find_cond_trap (test_bb, then_edge, else_edge))
goto success;
- if (post_dominators
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY
&& (! HAVE_conditional_execution || reload_completed))
{
if (find_if_case_1 (test_bb, then_edge, else_edge))
@@ -2241,8 +2333,8 @@ block_jumps_and_fallthru_p (basic_block cur_bb, basic_block target_bb)
together for conditional execution support. ??? we should support
conditional execution support across calls for IA-64 some day, but
for now it makes the code simpler. */
- end = cur_bb->end;
- insn = cur_bb->head;
+ end = BB_END (cur_bb);
+ insn = BB_HEAD (cur_bb);
while (insn != NULL_RTX)
{
@@ -2373,7 +2465,7 @@ find_if_block (struct ce_if_block * ce_info)
if (then_succ != NULL_EDGE
&& (then_succ->succ_next != NULL_EDGE
|| (then_succ->flags & EDGE_COMPLEX)
- || (flow2_completed && tablejump_p (then_bb->end, NULL, NULL))))
+ || (flow2_completed && tablejump_p (BB_END (then_bb), NULL, NULL))))
return FALSE;
/* If the THEN block has no successors, conditional execution can still
@@ -2386,11 +2478,11 @@ find_if_block (struct ce_if_block * ce_info)
{
if (else_bb->pred->pred_next == NULL_EDGE)
{
- rtx last_insn = then_bb->end;
+ rtx last_insn = BB_END (then_bb);
while (last_insn
&& GET_CODE (last_insn) == NOTE
- && last_insn != then_bb->head)
+ && last_insn != BB_HEAD (then_bb))
last_insn = PREV_INSN (last_insn);
if (last_insn
@@ -2421,7 +2513,7 @@ find_if_block (struct ce_if_block * ce_info)
&& else_bb->pred->pred_next == NULL_EDGE
&& else_succ->succ_next == NULL_EDGE
&& ! (else_succ->flags & EDGE_COMPLEX)
- && ! (flow2_completed && tablejump_p (else_bb->end, NULL, NULL)))
+ && ! (flow2_completed && tablejump_p (BB_END (else_bb), NULL, NULL)))
join_bb = else_succ->dest;
/* Otherwise it is not an IF-THEN or IF-THEN-ELSE combination. */
@@ -2435,15 +2527,15 @@ find_if_block (struct ce_if_block * ce_info)
fprintf (rtl_dump_file, "\nIF-THEN%s block found, pass %d, start block %d [insn %d], then %d [%d]",
(else_bb) ? "-ELSE" : "",
ce_info->pass,
- test_bb->index, (test_bb->head) ? (int)INSN_UID (test_bb->head) : -1,
- then_bb->index, (then_bb->head) ? (int)INSN_UID (then_bb->head) : -1);
+ test_bb->index, (BB_HEAD (test_bb)) ? (int)INSN_UID (BB_HEAD (test_bb)) : -1,
+ then_bb->index, (BB_HEAD (then_bb)) ? (int)INSN_UID (BB_HEAD (then_bb)) : -1);
if (else_bb)
fprintf (rtl_dump_file, ", else %d [%d]",
- else_bb->index, (else_bb->head) ? (int)INSN_UID (else_bb->head) : -1);
+ else_bb->index, (BB_HEAD (else_bb)) ? (int)INSN_UID (BB_HEAD (else_bb)) : -1);
fprintf (rtl_dump_file, ", join %d [%d]",
- join_bb->index, (join_bb->head) ? (int)INSN_UID (join_bb->head) : -1);
+ join_bb->index, (BB_HEAD (join_bb)) ? (int)INSN_UID (BB_HEAD (join_bb)) : -1);
if (ce_info->num_multiple_test_blocks > 0)
fprintf (rtl_dump_file, ", %d %s block%s last test %d [%d]",
@@ -2451,8 +2543,8 @@ find_if_block (struct ce_if_block * ce_info)
(ce_info->and_and_p) ? "&&" : "||",
(ce_info->num_multiple_test_blocks == 1) ? "" : "s",
ce_info->last_test_bb->index,
- ((ce_info->last_test_bb->head)
- ? (int)INSN_UID (ce_info->last_test_bb->head)
+ ((BB_HEAD (ce_info->last_test_bb))
+ ? (int)INSN_UID (BB_HEAD (ce_info->last_test_bb))
: -1));
fputc ('\n', rtl_dump_file);
@@ -2513,7 +2605,7 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
}
/* If this is not a standard conditional jump, we can't parse it. */
- jump = test_bb->end;
+ jump = BB_END (test_bb);
cond = noce_get_condition (jump, &cond_earliest);
if (! cond)
return FALSE;
@@ -2537,7 +2629,8 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
}
/* Attempt to generate the conditional trap. */
- seq = gen_cond_trap (code, XEXP (cond, 0), XEXP (cond, 1),
+ seq = gen_cond_trap (code, XEXP (cond, 0),
+ XEXP (cond, 1),
TRAP_CODE (PATTERN (trap)));
if (seq == NULL)
return FALSE;
@@ -2551,8 +2644,8 @@ find_cond_trap (basic_block test_bb, edge then_edge, edge else_edge)
remove_edge (trap_bb == then_bb ? then_edge : else_edge);
if (trap_bb->pred == NULL)
{
- if (post_dominators)
- delete_from_dominance_info (post_dominators, trap_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, trap_bb);
delete_block (trap_bb);
}
@@ -2603,7 +2696,7 @@ block_has_only_trap (basic_block bb)
/* The only instruction in the THEN block must be the trap. */
trap = first_active_insn (bb);
- if (! (trap == bb->end
+ if (! (trap == BB_END (bb)
&& GET_CODE (PATTERN (trap)) == TRAP_IF
&& TRAP_CONDITION (PATTERN (trap)) == const_true_rtx))
return NULL_RTX;
@@ -2736,8 +2829,8 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
new_bb = redirect_edge_and_branch_force (FALLTHRU_EDGE (test_bb), else_bb);
then_bb_index = then_bb->index;
- if (post_dominators)
- delete_from_dominance_info (post_dominators, then_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, then_bb);
delete_block (then_bb);
/* Make rest of code believe that the newly created block is the THEN_BB
@@ -2746,8 +2839,8 @@ find_if_case_1 (basic_block test_bb, edge then_edge, edge else_edge)
{
new_bb->index = then_bb_index;
BASIC_BLOCK (then_bb_index) = new_bb;
- if (post_dominators)
- add_to_dominance_info (post_dominators, new_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ add_to_dominance_info (CDI_POST_DOMINATORS, new_bb);
}
/* We've possibly created jump to next insn, cleanup_cfg will solve that
later. */
@@ -2785,11 +2878,11 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
return FALSE;
/* ELSE is predicted or SUCC(ELSE) postdominates THEN. */
- note = find_reg_note (test_bb->end, REG_BR_PROB, NULL_RTX);
+ note = find_reg_note (BB_END (test_bb), REG_BR_PROB, NULL_RTX);
if (note && INTVAL (XEXP (note, 0)) >= REG_BR_PROB_BASE / 2)
;
else if (else_succ->dest->index < 0
- || dominated_by_p (post_dominators, then_bb,
+ || dominated_by_p (CDI_POST_DOMINATORS, then_bb,
else_succ->dest))
;
else
@@ -2816,8 +2909,8 @@ find_if_case_2 (basic_block test_bb, edge then_edge, edge else_edge)
then_bb->global_live_at_start,
else_bb->global_live_at_end, BITMAP_IOR);
- if (post_dominators)
- delete_from_dominance_info (post_dominators, else_bb);
+ if (dom_computed[CDI_POST_DOMINATORS] >= DOM_NO_FAST_QUERY)
+ delete_from_dominance_info (CDI_POST_DOMINATORS, else_bb);
delete_block (else_bb);
num_true_changes++;
@@ -2852,11 +2945,11 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
{
rtx head, end, jump, earliest, old_dest, new_label = NULL_RTX;
- jump = test_bb->end;
+ jump = BB_END (test_bb);
/* Find the extent of the real code in the merge block. */
- head = merge_bb->head;
- end = merge_bb->end;
+ head = BB_HEAD (merge_bb);
+ end = BB_END (merge_bb);
if (GET_CODE (head) == CODE_LABEL)
head = NEXT_INSN (head);
@@ -2886,8 +2979,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
if (HAVE_conditional_execution)
{
/* In the conditional execution case, we have things easy. We know
- the condition is reversible. We don't have to check life info,
- becase we're going to conditionally execute the code anyway.
+ the condition is reversible. We don't have to check life info
+ because we're going to conditionally execute the code anyway.
All that's left is making sure the insns involved can actually
be predicated. */
@@ -3076,8 +3169,8 @@ dead_or_predicable (basic_block test_bb, basic_block merge_bb,
/* Move the insns out of MERGE_BB to before the branch. */
if (head != NULL)
{
- if (end == merge_bb->end)
- merge_bb->end = PREV_INSN (head);
+ if (end == BB_END (merge_bb))
+ BB_END (merge_bb) = PREV_INSN (head);
if (squeeze_notes (&head, &end))
return TRUE;
@@ -3122,11 +3215,9 @@ if_convert (int x_life_data_ok)
free_basic_block_vars (1);
/* Compute postdominators if we think we'll use them. */
- post_dominators = NULL;
if (HAVE_conditional_execution || life_data_ok)
- {
- post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS);
- }
+ calculate_dominance_info (CDI_POST_DOMINATORS);
+
if (life_data_ok)
clear_bb_flags ();
@@ -3163,8 +3254,7 @@ if_convert (int x_life_data_ok)
fprintf (rtl_dump_file, "\n\n========== no more changes\n");
#endif
- if (post_dominators)
- free_dominance_info (post_dominators);
+ free_dominance_info (CDI_POST_DOMINATORS);
if (rtl_dump_file)
fflush (rtl_dump_file);
diff --git a/gcc/integrate.c b/gcc/integrate.c
index fa5d71efa00..f317627e487 100644
--- a/gcc/integrate.c
+++ b/gcc/integrate.c
@@ -172,6 +172,9 @@ function_cannot_inline_p (tree fndecl)
if (current_function_calls_alloca)
return N_("function using alloca cannot be inline");
+ if (current_function_calls_longjmp)
+ return N_("function using longjmp cannot be inline");
+
if (current_function_calls_setjmp)
return N_("function using setjmp cannot be inline");
diff --git a/gcc/java/.cvsignore b/gcc/java/.cvsignore
deleted file mode 100644
index dab65347a77..00000000000
--- a/gcc/java/.cvsignore
+++ /dev/null
@@ -1,10 +0,0 @@
-parse.c
-parse-scan.c
-gcj.info*
-gcj.1
-gcjh.1
-jv-scan.1
-jcf-dump.1
-gij.1
-jv-convert.1
-rmic.1 rmiregistry.1
diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog
index d3388a95267..2fa7728ebde 100644
--- a/gcc/java/ChangeLog
+++ b/gcc/java/ChangeLog
@@ -1,3 +1,233 @@
+2003-12-25 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * parse.y (catch_clause_parameter): Fix typo.
+
+ PR java/13404
+ * parse.y: (catch_clause_parameter): Return early if $3, aka
+ formal_parameter, is null.
+
+2003-12-20 Kazu Hirata <kazu@cs.umass.edu>
+
+ * class.c: Remove uses of "register" specifier in
+ declarations of arguments and local variables.
+ * decl.c: Likewise.
+ * expr.c: Likewise.
+ * gjavah.c: Likewise.
+ * jcf-dump.c: Likewise.
+ * jcf-io.c: Likewise.
+ * jcf-parse.c: Likewise.
+ * jcf-write.c: Likewise.
+ * keyword.h: Likewise.
+ * parse.y: Likewise.
+ * typeck.c: Likewise.
+ * verify.c: Likewise.
+
+2003-12-06 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (GCJ_CROSS_NAME): Delete.
+ (java.install_common, java.install-man): Adjust for above.
+ (java.uninstall): Likewise.
+
+2003-12-03 Michael Koch <konqueror@gmx.de>
+
+ * class.c (make_class_data):
+ Push field value to 'hack_signers' instead of 'signers'.
+ * decl.c (java_init_decl_processing):
+ Push field 'hack_signers' instead of 'signers'.
+
+2003-12-03 Zack Weinberg <zack@codesourcery.com>
+
+ * lex.h: Check both HAVE_ICONV and HAVE_ICONV_H before
+ including iconv.h.
+
+2003-12-03 Ralph Loader <rcl@ihug.co.nz>
+
+ PR java/12374:
+ * parse.y (qualify_ambiguous_name): Remove lots of broken
+ field access processing - there's no need to do that here,
+ because we have resolve_field_access. Remove
+ RESOLVE_EXPRESSION_NAME_P as it isn't used anywhere else.
+ * java-tree.h: Remove RESOLVE_EXPRESSION_NAME_P as it isn't
+ used.
+
+2003-12-01 Jeff Sturm <jsturm@one-point.com>
+
+ Fix PR java/13237
+ * parse.y (java_complete_lhs): Save location prior to patching
+ CALL_EXPR.
+
+2003-11-25 Mohan Embar <gnustuff@thisiscool.com>
+
+ PR java/12548
+ * resource.c (write_resource_constructor): Append
+ "_resource" to constructor identifier name.
+
+2003-11-25 Jeff Sturm <jsturm@one-point.com>
+
+ Fix PR java/13183.
+ * constants.c (cpool_for_class): New function.
+ (outgoing_cpool): Remove global variable.
+ (alloc_name_constant): Use cpool_for_class.
+ (build_constants_constructor): Likewise.
+ * decl.c (java_expand_body): Set current_class.
+ * java-tree.h (outgoing_cpool) Remove declaration.
+ (init_outgoing_cpool): Likewise.
+ * jcf-parse.c (init_outgoing_cpool): Remove function.
+ (parse_class_file): Don't call init_outgoing_cpool.
+ * parse.y (java_complete_expand_methods): Don't call
+ init_outgoing_cpool. Don't save outgoing_cpool.
+ (java_expand_classes): Don't restore outgoing_cpool.
+ (java_finish_classes): Likewise.
+
+2003-11-24 Mohan Embar <gnustuff@thisiscool.com>
+
+ * Make-lang.in: (java.install-common) Add
+ symlink for $(target_noncanonical)-gcjh for
+ native builds.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (java.extraclean): Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (check-java): Add.
+
+2003-11-19 Jeff Sturm <jsturm@one-point.com>
+
+ Fix PR java/13024.
+ * except.c (prepare_eh_table_type): Allocate variable-sized
+ buffer `buf' with alloca.
+
+2003-11-17 Jeff Sturm <jsturm@one-point.com>
+
+ Fix PR java/12857.
+
+ decl.c (java_init_decl_processing): Don't initialize
+ class_not_found_type_node, no_class_def_found_type_node.
+
+ java-tree.h (JTI_CLASS_NOT_FOUND_TYPE_NODE,
+ JTI_NO_CLASS_DEF_FOUND_TYPE_NODE): Remove from java_tree_index.
+ (class_not_found_type_node, no_class_def_found_type_node):
+ Don't define.
+
+ parse.y (build_dot_class_method_invocation): Add this_class
+ argument. Qualify method invocations to a different class.
+ (create_new_parser_context): Initialize saved_data_ctx to 0.
+ (java_parser_context_save_global): Initialize saved_data_ctx to 1.
+ (build_dot_class_method): Don't load classes. Register
+ incomplete types.
+ (build_incomplete_class_ref): Special cases for interfaces
+ and inner classes. Move build_dot_class_method call to here...
+ (patch_incomplete_class_ref): ...from here. Pass current_class
+ to build_dot_class_method_invocation.
+ (build_assertion): Pass class_type to
+ build_dot_class_method_invocation.
+ (encapsulate_with_try_catch): Handle EXPR_WITH_FILE_LOCATION node.
+
+2003-11-17 Jeff Sturm <jsturm@one-point.com>
+
+ Fix PR java/12739.
+ * java-tree.h (BLOCK_EMPTY_P): Define.
+ * parse.y (java_complete_lhs): Check for empty blocks
+ in TRY_FINALLY_EXPR case.
+
+2003-11-17 Andrew Haley <aph@redhat.com>
+
+ * java-tree.h (LOCAL_VAR_OUT_OF_SCOPE_P): New.
+ (struct lang_decl_var:freed): New variable.
+ * decl.c (poplevel): Mark local vars that have gone out of scope.
+ (push_jvm_slot): Don't use the RTL of a var that has gone out of
+ scope.
+
+2003-11-16 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (java.tags): Create TAGS.sub files in each directory
+ and TAGS files that include them for each front end.
+
+2003-11-15 Tom Tromey <tromey@redhat.com>
+
+ * gjavah.c (print_stub_or_jni): Pass `env' to FatalError.
+
+2003-11-12 Jason Merrill <jason@redhat.com>
+
+ PR optimization/12547
+ * lang.c (java_tree_inlining_walk_subtrees): Just walk
+ BLOCK_EXPR_BODY directly.
+
+2003-11-12 Andrew Haley <aph@redhat.com>
+
+ PR java/11045
+ * parse.y (fold_constant_for_init): Check that we really do have a
+ constant.
+
+ PR java/11533
+ * lang.c (merge_init_test_initialization): Clear DECL_INITIAL for
+ init_test_decls being inlined.
+
+ PR java/12890:
+ * parse.y (do_resolve_class): Check return value from
+ breakdown_qualified().
+
+2003-11-11 Tom Tromey <tromey@redhat.com>
+
+ PR java/12915:
+ * parse.y (merge_string_cste): Handle case where we have a
+ pointer that happens to be zero, not null_pointer_node.
+
+2003-11-10 Tom Tromey <tromey@redhat.com>
+
+ * jcf-parse.c (classify_zip_file): Correctly compare
+ filename_length against length of manifest file's name.
+
+2003-11-08 Tom Tromey <tromey@redhat.com>
+
+ PR java/12894:
+ * jcf-parse.c (classify_zip_file): Only skip MANIFEST.MF file.
+
+2003-11-06 Andrew Haley <aph@redhat.com>
+
+ * expr.c (java_stack_swap): Make sure destination stack slots are
+ of the correct type.
+
+2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (dvi): Move targets to $(docobjdir).
+ (gcj.dvi): Simplify rule and adjust target.
+ (gcj.info): Simplify rule.
+ (gcj.pod): New intermediate rule.
+ (gcjh.pod): Likewise.
+ (jv-scan.pod): Likewise.
+ (jcf-dump.pod): Likewise.
+ (gij.pod): Likewise.
+ (jv-convert.pod): Likewise.
+ (rmic.pod): Likewise.
+ (rmiregistry.pod): Likewise.
+ (gcj.1): Delete.
+ (gcjh.1): Delete.
+ (jv-scan.1): Delete.
+ (jcf-dump.1): Delete.
+ (gij.1): Delete.
+ (jv-convert.1): Delete.
+ (rmic.1): Delete.
+ (rmiregistry.1): Delete.
+
+2003-11-02 Jeff Sturm <jsturm@one-point.com>
+
+ Fixes PR java/12866.
+ * parse.y (resolve_qualified_expression_name): Move test
+ for outer field access methods from here...
+ (check_thrown_exceptions) ...to here.
+
+2003-11-01 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Delete.
+
+2003-10-28 Frank Ch. Eigler <fche@redhat.com>
+
+ * verify.c (verify_jvm_instructions): Don't warn about legal
+ eh binding regions generated for example by jdk 1.4.1.
+
2003-10-24 David S. Miller <davem@redhat.com>
* jcf-parse.c (jcf_parse): Fix args to fatal_error().
@@ -117,7 +347,7 @@
(atable_syms_decl): New.
(enum java_tree_index): Add JTI_ATABLE_METHODS, JTI_ATABLE_DECL,
JTI_ATABLE_SYMS_DECL. Rename JTI_METHOD_SYMBOL* to JTI_SYMBOL*.
- (symbol_*type): Rename method_symbol* to symbol*type.
+ (symbol_*type): Rename method_symbol* to symbol*type.
(emit_offset_symbol_table): Delete.
(emit_symbol_table): New.
(get_symbol_table_index): New.
@@ -134,7 +364,7 @@
(emit_symbol_table): Rename from emit_offset_symbol_table.
Parameterize to allow re-use by different types of symbol table.
(build_symbol_entry): Renamed from build_method_symbols_entry.
-
+
2003-09-30 Roger Sayle <roger@eyesopen.com>
* jcf-write.c (generate_bytecode_insns): Implement evaluate-once
@@ -197,17 +427,17 @@
2003-09-21 Richard Henderson <rth@redhat.com>
- * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
+ * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
resource.c: Revert.
2003-09-21 Richard Henderson <rth@redhat.com>
- * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
+ * class.c, decl.c, jcf-parse.c, jcf-write.c, parse.y,
resource.c: Update for DECL_SOURCE_LOCATION rename and change to const.
2003-09-20 Richard Henderson <rth@redhat.com>
- * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
+ * check-init.c, class.c, decl.c, expr.c: Use %J in diagnostics.
2003-09-18 Roger Sayle <roger@eyesopen.com>
@@ -233,18 +463,18 @@
2003-09-16 Bryce McKinlay <bryce@mckinlay.net.nz>
- * class.c (add_miranda_methods): Ensure super-interfaces are laid
+ * class.c (add_miranda_methods): Ensure super-interfaces are laid
out. Fix for PR java/12254.
2003-09-11 Richard Henderson <rth@redhat.com>
- * parse.y (source_end_java_method): Update for new
- cgraph_finalize_function argument.
+ * parse.y (source_end_java_method): Update for new
+ cgraph_finalize_function argument.
2003-09-09 Richard Henderson <rth@redhat.com>
- * parse.y (source_end_java_method): Update call to
- cgraph_finalize_function.
+ * parse.y (source_end_java_method): Update call to
+ cgraph_finalize_function.
2003-09-03 Jeff Sturm <jsturm@one-point.com>
@@ -292,8 +522,8 @@
2003-08-20 Andrew Haley <aph@redhat.com>
- * except.c (prepare_eh_table_type): Use new encoding for exception
- handlers when using -fno-assume-compiled.
+ * except.c (prepare_eh_table_type): Use new encoding for exception
+ handlers when using -fno-assume-compiled.
2003-08-13 Tom Tromey <tromey@redhat.com>
diff --git a/gcc/java/Make-lang.in b/gcc/java/Make-lang.in
index ab732310960..fc6adf9c15f 100644
--- a/gcc/java/Make-lang.in
+++ b/gcc/java/Make-lang.in
@@ -1,4 +1,4 @@
-# Top level makefile fragment for the GNU compiler for the Java(TM)
+# Top level -*- makefile -*- fragment for the GNU compiler for the Java(TM)
# language.
# Copyright (C) 1996, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -29,7 +29,7 @@
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
# foo.uninstall,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -43,9 +43,7 @@
# Actual names to use when installing a native compiler.
JAVA_INSTALL_NAME = `echo gcj|sed '$(program_transform_name)'`
JAVA_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcj|sed '$(program_transform_name)'`
-
-# Actual names to use when installing a cross-compiler.
-JAVA_CROSS_NAME = `echo gcj|sed '$(program_transform_cross_name)'`
+GCJH_TARGET_INSTALL_NAME = $(target_noncanonical)-`echo gcjh|sed '$(program_transform_name)'`
GCJ = gcj
@@ -158,15 +156,20 @@ java.rest.encap:
java.tags: force
- cd $(srcdir)/java; etags *.y *.c *.h --language=none --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' java-tree.def
+ cd $(srcdir)/java; etags -o TAGS.sub *.y *.c *.h --language=none \
+ --regex='/DEFTREECODE [(]\([A-Z_]+\)/\1/' java-tree.def; \
+ etags --include TAGS.sub --include ../TAGS.sub
+
info:: $(docobjdir)/gcj.info
-dvi:: java/gcj.dvi
+dvi:: $(docobjdir)/gcj.dvi
generated-manpages:: $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 \
$(docobjdir)/jv-scan.1 $(docobjdir)/jcf-dump.1 \
$(docobjdir)/gij.1 $(docobjdir)/jv-convert.1 \
$(docobjdir)/rmic.1 $(docobjdir)/rmiregistry.1
+check-java :
+
# Install hooks:
# jc1, gcj, jvgenmain, and gcjh are installed elsewhere as part
# of $(COMPILERS).
@@ -174,16 +177,19 @@ generated-manpages:: $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1 \
# Nothing to do here.
java.install-normal:
+# Install gcj as well as the target-independent tools.
+# For a native build, we special-case gcjh and also install
+# its explicitly-prefixed variant. This allows us to write
+# portable makefiles for both cross builds (where gcjh *must*
+# be explicitly prefixed) and native builds.
java.install-common: installdirs
-if [ -f $(GCJ)$(exeext) ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
+ $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
+ chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
if [ -f $(GCJ)-cross$(exeext) ]; then \
- rm -f $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
- $(INSTALL_PROGRAM) $(GCJ)-cross$(exeext) $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext); \
+ true; \
else \
- rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
- $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
- chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
rm -f $(DESTDIR)$(bindir)/$(JAVA_TARGET_INSTALL_NAME)$(exeext); \
( cd $(DESTDIR)$(bindir) && \
$(LN) $(JAVA_INSTALL_NAME)$(exeext) $(JAVA_TARGET_INSTALL_NAME)$(exeext) ); \
@@ -195,6 +201,11 @@ java.install-common: installdirs
rm -f $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
$(INSTALL_PROGRAM) $$tool$(exeext) $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
chmod a+x $(DESTDIR)$(bindir)/$$tool_transformed_name$(exeext); \
+ if [ $$tool = gcjh ]; then \
+ rm -f $(DESTDIR)$(bindir)/$(GCJH_TARGET_INSTALL_NAME)$(exeext); \
+ ( cd $(DESTDIR)$(bindir) && \
+ $(LN) $$tool_transformed_name$(exeext) $(GCJH_TARGET_INSTALL_NAME)$(exeext) ); \
+ fi; \
fi ; \
done
@@ -202,9 +213,7 @@ java.install-man:
java.uninstall:
-rm -rf $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext)
- -rm -rf $(DESTDIR)$(bindir)/$(JAVA_CROSS_NAME)$(exeext)
-rm -rf $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext)
- -rm -rf $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/gcjh$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/jv-scan$(man1ext)
-rm -rf $(DESTDIR)$(man1dir)/jcf-dump$(man1ext)
@@ -226,7 +235,6 @@ java.clean:
java.distclean:
-rm -f java/config.status java/Makefile
-rm -f java/parse.output
-java.extraclean:
java.maintainer-clean:
-rm -f $(parsedir)/java/parse.c $(parsedir)/java/parse-scan.c java/parse.output java/y.tab.c
-rm -f $(docobjdir)/gcj.1 $(docobjdir)/gcjh.1
@@ -354,87 +362,44 @@ java/java-tree-inline.o: tree-inline.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
$(srcdir)/tree-inline.c -o $@
# Documentation
-$(docobjdir)/gcj.info: $(srcdir)/java/gcj.texi $(docdir)/include/fdl.texi \
+$(docobjdir)/gcj.info: java/gcj.texi $(docdir)/include/fdl.texi \
$(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi stmp-docobjdir
if test "x$(BUILD_INFO)" = xinfo; then \
- rm -f $(docobjdir)/gcj.info*; \
- $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir)/include \
- -o $(docobjdir)/gcj.info $(srcdir)/java/gcj.texi; \
+ rm -f doc/gcj.info*; \
+ $(MAKEINFO) $(MAKEINFOFLAGS) -I $(docdir)/include -o $@ $<; \
else true; fi
-java/gcj.dvi: $(srcdir)/java/gcj.texi $(srcdir)/doc/include/fdl.texi \
- $(srcdir)/doc/include/gpl.texi $(srcdir)/doc/include/gcc-common.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- cd java && $(TEXI2DVI) -I $$s/doc/include $$s/java/gcj.texi
-
-$(docobjdir)/gcj.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D gcj < $(srcdir)/java/gcj.texi > java/gcj.pod
- -($(POD2MAN) --section=1 java/gcj.pod > java/gcj.1.T$$$$ && \
- mv -f java/gcj.1.T$$$$ $(docobjdir)/gcj.1) || \
- (rm -f java/gcj.1.T$$$$ && exit 1)
- -rm -f java/gcj.pod
-
-$(docobjdir)/gcjh.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D gcjh < $(srcdir)/java/gcj.texi > java/gcjh.pod
- -($(POD2MAN) --section=1 java/gcjh.pod > java/gcjh.1.T$$$$ && \
- mv -f java/gcjh.1.T$$$$ $(docobjdir)/gcjh.1) || \
- (rm -f java/gcjh.1.T$$$$ && exit 1)
- -rm -f java/gcjh.pod
-
-$(docobjdir)/jv-scan.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D jv-scan < $(srcdir)/java/gcj.texi > java/jv-scan.pod
- -($(POD2MAN) --section=1 java/jv-scan.pod > java/jv-scan.1.T$$$$ && \
- mv -f java/jv-scan.1.T$$$$ $(docobjdir)/jv-scan.1) || \
- (rm -f java/jv-scan.1.T$$$$ && exit 1)
- -rm -f java/jv-scan.pod
-
-$(docobjdir)/jcf-dump.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D jcf-dump < $(srcdir)/java/gcj.texi > java/jcf-dump.pod
- -($(POD2MAN) --section=1 java/jcf-dump.pod > java/jcf-dump.1.T$$$$ && \
- mv -f java/jcf-dump.1.T$$$$ $(docobjdir)/jcf-dump.1) || \
- (rm -f java/jcf-dump.1.T$$$$ && exit 1)
- -rm -f java/jcf-dump.pod
-
-$(docobjdir)/gij.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D gij < $(srcdir)/java/gcj.texi > java/gij.pod
- -($(POD2MAN) --section=1 java/gij.pod > java/gij.1.T$$$$ && \
- mv -f java/gij.1.T$$$$ $(docobjdir)/gij.1) || \
- (rm -f java/gij.1.T$$$$ && exit 1)
- -rm -f java/gij.pod
-
-$(docobjdir)/jv-convert.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D jv-convert < $(srcdir)/java/gcj.texi > java/jv-convert.pod
- -($(POD2MAN) --section=1 java/jv-convert.pod > java/jv-convert.1.T$$$$ && \
- mv -f java/jv-convert.1.T$$$$ $(docobjdir)/jv-convert.1) || \
- (rm -f java/jv-convert.1.T$$$$ && exit 1)
- -rm -f java/jv-convert.pod
-
-$(docobjdir)/rmic.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D rmic < $(srcdir)/java/gcj.texi > java/rmic.pod
- -($(POD2MAN) --section=1 java/rmic.pod > java/rmic.1.T$$$$ && \
- mv -f java/rmic.1.T$$$$ $(docobjdir)/rmic.1) || \
- (rm -f java/rmic.1.T$$$$ && exit 1)
- -rm -f java/rmic.pod
-
-$(docobjdir)/rmiregistry.1: $(srcdir)/java/gcj.texi stmp-docobjdir
- -$(TEXI2POD) -D rmiregistry < $(srcdir)/java/gcj.texi > java/rmiregistry.pod
- -($(POD2MAN) --section=1 java/rmiregistry.pod > java/rmiregistry.1.T$$$$ && \
- mv -f java/rmiregistry.1.T$$$$ $(docobjdir)/rmiregistry.1) || \
- (rm -f java/rmiregistry.1.T$$$$ && exit 1)
- -rm -f java/rmiregistry.pod
+$(docobjdir)/gcj.dvi: java/gcj.texi $(docdir)/include/fdl.texi \
+ $(docdir)/include/gpl.texi $(docdir)/include/gcc-common.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -I $(docdir)/include -o $@ $<
+
+.INTERMEDIATE: gcj.pod gcjh.pod jv-scan.pod jcf-dump.pod gij.pod \
+ jv-convert.pod rmic.pod rmiregistry.pod
+
+gcj.pod: java/gcj.texi
+ -$(TEXI2POD) -D gcj < $< > $@
+gcjh.pod: java/gcj.texi
+ -$(TEXI2POD) -D gcjh < $< > $@
+jv-scan.pod: java/gcj.texi
+ -$(TEXI2POD) -D jv-scan < $< > $@
+jcf-dump.pod: java/gcj.texi
+ -$(TEXI2POD) -D jcf-dump < $< > $@
+gij.pod: java/gcj.texi
+ -$(TEXI2POD) -D gij < $< > $@
+jv-convert.pod: java/gcj.texi
+ -$(TEXI2POD) -D jv-convert < $< > $@
+rmic.pod: java/gcj.texi
+ -$(TEXI2POD) -D rmic < $< > $@
+rmiregistry.pod: java/gcj.texi
+ -$(TEXI2POD) -D rmiregistry < $< > $@
# Install the man pages.
java.install-man: installdirs $(GENERATED_JAVA_MANPAGES)
-if [ -f $(GCJ)$(exeext) ]; then \
- if [ -f $(GCJ)-cross$(exeext) ]; then \
- rm -f $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_CROSS_NAME)$(man1ext); \
- else \
- rm -f $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
- $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
- chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
- fi ; \
+ rm -f $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
+ $(INSTALL_DATA) $(docobjdir)/gcj.1 $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
+ chmod a-x $(DESTDIR)$(man1dir)/$(JAVA_INSTALL_NAME)$(man1ext); \
fi
-rm -f $(DESTDIR)$(man1dir)/gcjh$(man1ext)
-$(INSTALL_DATA) $(docobjdir)/gcjh.1 $(DESTDIR)$(man1dir)/gcjh$(man1ext)
diff --git a/gcc/java/class.c b/gcc/java/class.c
index 2aacbd42e04..6c772e0a808 100644
--- a/gcc/java/class.c
+++ b/gcc/java/class.c
@@ -723,8 +723,8 @@ strLengthUtf8 (char *str, int len)
static int32
hashUtf8String (const char *str, int len)
{
- register const unsigned char* ptr = (const unsigned char*) str;
- register const unsigned char *limit = ptr + len;
+ const unsigned char* ptr = (const unsigned char*) str;
+ const unsigned char *limit = ptr + len;
int32 hash = 0;
for (; ptr < limit;)
{
@@ -1568,7 +1568,7 @@ make_class_data (tree type)
PUSH_FIELD_VALUE (cons, "idt", null_pointer_node);
PUSH_FIELD_VALUE (cons, "arrayclass", null_pointer_node);
PUSH_FIELD_VALUE (cons, "protectionDomain", null_pointer_node);
- PUSH_FIELD_VALUE (cons, "signers", null_pointer_node);
+ PUSH_FIELD_VALUE (cons, "hack_signers", null_pointer_node);
PUSH_FIELD_VALUE (cons, "chain", null_pointer_node);
FINISH_RECORD_CONSTRUCTOR (cons);
diff --git a/gcc/java/constants.c b/gcc/java/constants.c
index 274a8bfd91b..8a1fe1bb4ea 100644
--- a/gcc/java/constants.c
+++ b/gcc/java/constants.c
@@ -37,6 +37,7 @@ static int find_class_or_string_constant (CPool *, int, tree);
static int find_name_and_type_constant (CPool *, tree, tree);
static tree get_tag_node (int);
static tree build_constant_data_ref (void);
+static CPool *cpool_for_class (tree);
/* Set the INDEX'th constant in CPOOL to have the given TAG and VALUE. */
@@ -315,8 +316,6 @@ write_constant_pool (CPool *cpool, unsigned char *buffer, int length)
abort ();
}
-CPool *outgoing_cpool;
-
static GTY(()) tree tag_nodes[13];
static tree
get_tag_node (int tag)
@@ -328,6 +327,21 @@ get_tag_node (int tag)
return tag_nodes[tag];
}
+/* Given a class, return its constant pool, creating one if necessary. */
+
+static CPool *
+cpool_for_class (tree class)
+{
+ CPool *cpool = TYPE_CPOOL (class);
+
+ if (cpool == NULL)
+ {
+ cpool = ggc_alloc_cleared (sizeof (struct CPool));
+ TYPE_CPOOL (class) = cpool;
+ }
+ return cpool;
+}
+
/* Look for a constant pool entry that matches TAG and NAME.
Creates a new entry if not found.
TAG is one of CONSTANT_Utf8, CONSTANT_String or CONSTANT_Class.
@@ -337,6 +351,7 @@ get_tag_node (int tag)
int
alloc_name_constant (int tag, tree name)
{
+ CPool *outgoing_cpool = cpool_for_class (current_class);
return find_tree_constant (outgoing_cpool, tag, name);
}
@@ -414,6 +429,7 @@ build_ref_from_constant_pool (int index)
tree
build_constants_constructor (void)
{
+ CPool *outgoing_cpool = cpool_for_class (current_class);
tree tags_value, data_value;
tree cons;
tree tags_list = NULL_TREE;
diff --git a/gcc/java/decl.c b/gcc/java/decl.c
index e23cb120c3a..46bb2248b6d 100644
--- a/gcc/java/decl.c
+++ b/gcc/java/decl.c
@@ -94,7 +94,7 @@ int current_pc;
void
indent (void)
{
- register unsigned i;
+ unsigned i;
for (i = 0; i < binding_depth*2; i++)
putc (' ', stderr);
@@ -116,7 +116,8 @@ push_jvm_slot (int index, tree decl)
tmp = TREE_VEC_ELT (decl_map, index);
while (tmp != NULL_TREE)
{
- if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp)))
+ if (TYPE_MODE (type) == TYPE_MODE (TREE_TYPE (tmp))
+ && ! LOCAL_VAR_OUT_OF_SCOPE_P (tmp))
rtl = DECL_RTL_IF_SET (tmp);
if (rtl != NULL)
break;
@@ -391,7 +392,7 @@ create_primitive_vtable (const char *name)
void
java_init_decl_processing (void)
{
- register tree endlink;
+ tree endlink;
tree field = NULL_TREE;
tree t;
@@ -552,10 +553,6 @@ java_init_decl_processing (void)
lookup_class (get_identifier ("java.lang.RuntimeException"));
error_exception_type_node =
lookup_class (get_identifier ("java.lang.Error"));
- class_not_found_type_node =
- lookup_class (get_identifier ("java.lang.ClassNotFoundException"));
- no_class_def_found_type_node =
- lookup_class (get_identifier ("java.lang.NoClassDefFoundError"));
rawdata_ptr_type_node
= promote_type (lookup_class (get_identifier ("gnu.gcj.RawData")));
@@ -731,7 +728,7 @@ java_init_decl_processing (void)
PUSH_FIELD (class_type_node, field, "idt", ptr_type_node);
PUSH_FIELD (class_type_node, field, "arrayclass", ptr_type_node);
PUSH_FIELD (class_type_node, field, "protectionDomain", ptr_type_node);
- PUSH_FIELD (class_type_node, field, "signers", ptr_type_node);
+ PUSH_FIELD (class_type_node, field, "hack_signers", ptr_type_node);
PUSH_FIELD (class_type_node, field, "chain", ptr_type_node);
for (t = TYPE_FIELDS (class_type_node); t != NULL_TREE; t = TREE_CHAIN (t))
FIELD_PRIVATE (t) = 1;
@@ -969,7 +966,7 @@ java_init_decl_processing (void)
tree
lookup_name (tree name)
{
- register tree val;
+ tree val;
if (current_binding_level != global_binding_level
&& IDENTIFIER_LOCAL_VALUE (name))
val = IDENTIFIER_LOCAL_VALUE (name);
@@ -984,7 +981,7 @@ lookup_name (tree name)
static tree
lookup_name_current_level (tree name)
{
- register tree t;
+ tree t;
if (current_binding_level == global_binding_level)
return IDENTIFIER_GLOBAL_VALUE (name);
@@ -1004,8 +1001,8 @@ lookup_name_current_level (tree name)
void
push_labeled_block (tree lb)
{
- register tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb));
- register struct binding_level *b = current_binding_level;
+ tree name = DECL_NAME (LABELED_BLOCK_LABEL (lb));
+ struct binding_level *b = current_binding_level;
tree oldlocal = IDENTIFIER_LOCAL_VALUE (name);
if (oldlocal != 0)
b->shadowed = tree_cons (name, oldlocal, b->shadowed);
@@ -1045,9 +1042,9 @@ pop_labeled_block (void)
tree
pushdecl (tree x)
{
- register tree t;
- register tree name = DECL_NAME (x);
- register struct binding_level *b = current_binding_level;
+ tree t;
+ tree name = DECL_NAME (x);
+ struct binding_level *b = current_binding_level;
if (TREE_CODE (x) != TYPE_DECL)
DECL_CONTEXT (x) = current_function_decl;
@@ -1162,8 +1159,8 @@ pushdecl_force_head (tree x)
tree
pushdecl_top_level (tree x)
{
- register tree t;
- register struct binding_level *b = current_binding_level;
+ tree t;
+ struct binding_level *b = current_binding_level;
current_binding_level = global_binding_level;
t = pushdecl (x);
@@ -1202,7 +1199,7 @@ make_binding_level (void)
void
pushlevel (int unused ATTRIBUTE_UNUSED)
{
- register struct binding_level *newlevel = NULL_BINDING_LEVEL;
+ struct binding_level *newlevel = NULL_BINDING_LEVEL;
#if 0
/* If this is the top level of a function,
@@ -1258,7 +1255,7 @@ pushlevel (int unused ATTRIBUTE_UNUSED)
tree
poplevel (int keep, int reverse, int functionbody)
{
- register tree link;
+ tree link;
/* The chain of decls was accumulated in reverse order.
Put it into forward order, just for cleanliness. */
tree decls;
@@ -1266,6 +1263,7 @@ poplevel (int keep, int reverse, int functionbody)
tree block = 0;
tree decl;
int block_previously_created;
+ {
#if defined(DEBUG_JAVA_BINDING_LEVELS)
binding_depth--;
@@ -1306,12 +1304,13 @@ poplevel (int keep, int reverse, int functionbody)
&& 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.
-
- DECL_ABSTRACT_ORIGIN can be set to itself if warn_return_type is
- true, since then the decl goes through save_for_inline_copying. */
+ /* 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.
+
+ DECL_ABSTRACT_ORIGIN can be set to itself if
+ warn_return_type is true, since then the decl goes
+ through save_for_inline_copying. */
if (DECL_ABSTRACT_ORIGIN (decl) != 0
&& DECL_ABSTRACT_ORIGIN (decl) != decl)
TREE_ADDRESSABLE (DECL_ABSTRACT_ORIGIN (decl)) = 1;
@@ -1322,6 +1321,11 @@ poplevel (int keep, int reverse, int functionbody)
pop_function_context ();
}
}
+ else if (TREE_CODE (decl) == VAR_DECL
+ && DECL_LANG_SPECIFIC (decl) != NULL
+ && DECL_LOCAL_SLOT_NUMBER (decl))
+ LOCAL_VAR_OUT_OF_SCOPE_P (decl) = 1;
+ }
/* If there were any declarations in that level,
or if this level is a function body,
@@ -1390,7 +1394,7 @@ poplevel (int keep, int reverse, int functionbody)
#if 0
for (link = named_labels; link; link = TREE_CHAIN (link))
{
- register tree label = TREE_VALUE (link);
+ tree label = TREE_VALUE (link);
if (DECL_INITIAL (label) == 0)
{
@@ -1413,7 +1417,7 @@ poplevel (int keep, int reverse, int functionbody)
/* Pop the current level, and free the structure for reuse. */
{
- register struct binding_level *level = current_binding_level;
+ struct binding_level *level = current_binding_level;
current_binding_level = current_binding_level->level_chain;
level->level_chain = free_binding_level;
@@ -1856,6 +1860,7 @@ java_expand_body (tree fndecl)
current_function_decl = fndecl;
input_location = DECL_SOURCE_LOCATION (fndecl);
+ current_class = DECL_CONTEXT (fndecl);
timevar_push (TV_EXPAND);
diff --git a/gcc/java/except.c b/gcc/java/except.c
index dc97b42fabf..c0fa800c262 100644
--- a/gcc/java/except.c
+++ b/gcc/java/except.c
@@ -312,6 +312,10 @@ tree
prepare_eh_table_type (tree type)
{
tree exp;
+ const char *name;
+ char *buf;
+ tree decl;
+ tree utf8_ref;
/* The "type" (match_info) in a (Java) exception table is a pointer to:
* a) NULL - meaning match any type in a try-finally.
@@ -323,10 +327,9 @@ prepare_eh_table_type (tree type)
exp = NULL_TREE;
else if (is_compiled_class (type) && !flag_indirect_dispatch)
{
- char buf[64];
- tree decl;
- sprintf (buf, "%s_ref",
- IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type))));
+ name = IDENTIFIER_POINTER (DECL_NAME (TYPE_NAME (type)));
+ buf = alloca (strlen (name) + 5);
+ sprintf (buf, "%s_ref", name);
decl = build_decl (VAR_DECL, get_identifier (buf), ptr_type_node);
TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
@@ -342,11 +345,10 @@ prepare_eh_table_type (tree type)
}
else
{
- tree decl;
- tree utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
- char buf[64];
- sprintf (buf, "%s_ref",
- IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0))));
+ utf8_ref = build_utf8_ref (DECL_NAME (TYPE_NAME (type)));
+ name = IDENTIFIER_POINTER (DECL_NAME (TREE_OPERAND (utf8_ref, 0)));
+ buf = alloca (strlen (name) + 5);
+ sprintf (buf, "%s_ref", name);
decl = build_decl (VAR_DECL, get_identifier (buf), utf8const_ptr_type);
TREE_STATIC (decl) = 1;
DECL_ARTIFICIAL (decl) = 1;
diff --git a/gcc/java/expr.c b/gcc/java/expr.c
index e5654e79b6f..533b88c39b3 100644
--- a/gcc/java/expr.c
+++ b/gcc/java/expr.c
@@ -206,7 +206,7 @@ static void
flush_quick_stack (void)
{
int stack_index = stack_pointer;
- register tree prev, cur, next;
+ tree prev, cur, next;
/* First reverse the quick_stack, and count the number of slots it has. */
for (cur = quick_stack, prev = NULL_TREE; cur != NULL_TREE; cur = next)
@@ -503,8 +503,9 @@ java_stack_swap (void)
decl1 = find_stack_slot (stack_pointer - 1, type1);
decl2 = find_stack_slot (stack_pointer - 2, type2);
temp = copy_to_reg (DECL_RTL (decl1));
- emit_move_insn (DECL_RTL (decl1), DECL_RTL (decl2));
- emit_move_insn (DECL_RTL (decl2), temp);
+ emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 1, type2)),
+ DECL_RTL (decl2));
+ emit_move_insn (DECL_RTL (find_stack_slot (stack_pointer - 2, type1)), temp);
stack_type_map[stack_pointer - 1] = type2;
stack_type_map[stack_pointer - 2] = type1;
}
diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c
index 10c5ef851fb..b9a34e3bbdb 100644
--- a/gcc/java/gjavah.c
+++ b/gcc/java/gjavah.c
@@ -1370,7 +1370,7 @@ print_c_decl (FILE* stream, JCF* jcf, int name_index, int signature_index,
{
int length = JPOOL_UTF_LENGTH (jcf, signature_index);
const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index);
- register const unsigned char *str = str0;
+ const unsigned char *str = str0;
const unsigned char *limit = str + length;
int need_space = 0;
int is_method = str[0] == '(';
@@ -1430,7 +1430,7 @@ print_full_cxx_name (FILE* stream, JCF* jcf, int name_index,
{
int length = JPOOL_UTF_LENGTH (jcf, signature_index);
const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index);
- register const unsigned char *str = str0;
+ const unsigned char *str = str0;
const unsigned char *limit = str + length;
int need_space = 0;
int is_method = str[0] == '(';
@@ -1541,7 +1541,7 @@ print_stub_or_jni (FILE* stream, JCF* jcf, int name_index,
{
int length = JPOOL_UTF_LENGTH (jcf, signature_index);
const unsigned char *str0 = JPOOL_UTF_DATA (jcf, signature_index);
- register const unsigned char *str = str0;
+ const unsigned char *str = str0;
const unsigned char *limit = str + length;
int need_space = 0;
int is_method = str[0] == '(';
@@ -1597,7 +1597,7 @@ print_stub_or_jni (FILE* stream, JCF* jcf, int name_index,
if (stubs)
{
if (flag_jni)
- fputs ("\n{\n (*env)->FatalError (\"", stream);
+ fputs ("\n{\n (*env)->FatalError (env, \"", stream);
else
fputs ("\n{\n throw new ::java::lang::UnsupportedOperationException (JvNewStringLatin1 (\"", stream);
print_name_for_stub_or_jni (stream, jcf, name_index,
diff --git a/gcc/java/java-tree.h b/gcc/java/java-tree.h
index 7b5a397ecdb..88be2a03441 100644
--- a/gcc/java/java-tree.h
+++ b/gcc/java/java-tree.h
@@ -44,7 +44,6 @@ struct JCF;
/* Usage of TREE_LANG_FLAG_?:
0: IS_A_SINGLE_IMPORT_CLASSFILE_NAME_P (in IDENTIFIER_NODE)
- RESOLVE_EXPRESSION_NAME_P (in EXPR_WITH_FILE_LOCATION)
FOR_LOOP_P (in LOOP_EXPR)
SUPPRESS_UNREACHABLE_ERROR (for other _EXPR nodes)
ANONYMOUS_CLASS_P (in RECORD_TYPE)
@@ -308,8 +307,6 @@ enum java_tree_index
JTI_RUNTIME_EXCEPTION_TYPE_NODE,
JTI_ERROR_EXCEPTION_TYPE_NODE,
JTI_RAWDATA_PTR_TYPE_NODE,
- JTI_CLASS_NOT_FOUND_TYPE_NODE,
- JTI_NO_CLASS_DEF_FOUND_TYPE_NODE,
JTI_BYTE_ARRAY_TYPE_NODE,
JTI_SHORT_ARRAY_TYPE_NODE,
@@ -492,10 +489,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
java_global_trees[JTI_ERROR_EXCEPTION_TYPE_NODE]
#define rawdata_ptr_type_node \
java_global_trees[JTI_RAWDATA_PTR_TYPE_NODE]
-#define class_not_found_type_node \
- java_global_trees[JTI_CLASS_NOT_FOUND_TYPE_NODE]
-#define no_class_def_found_type_node \
- java_global_trees[JTI_NO_CLASS_DEF_FOUND_TYPE_NODE]
#define byte_array_type_node \
java_global_trees[JTI_BYTE_ARRAY_TYPE_NODE]
@@ -700,9 +693,6 @@ extern GTY(()) tree java_global_trees[JTI_MAX];
#define nativecode_ptr_type_node ptr_type_node
-/* They need to be reset before processing each class */
-extern GTY(()) struct CPool *outgoing_cpool;
-
#define wfl_operator \
java_global_trees[JTI_WFL_OPERATOR]
@@ -947,6 +937,9 @@ union lang_tree_node
/* True if NODE is a class initialization flag. */
#define LOCAL_CLASS_INITIALIZATION_FLAG_P(NODE) \
(DECL_LANG_SPECIFIC (NODE) && LOCAL_CLASS_INITIALIZATION_FLAG(NODE))
+/* True if NODE is a variable that is out of scope. */
+#define LOCAL_VAR_OUT_OF_SCOPE_P(NODE) \
+ (DECL_LANG_SPECIFIC(NODE)->u.v.freed)
/* Create a DECL_LANG_SPECIFIC if necessary. */
#define MAYBE_CREATE_VAR_LANG_DECL_SPECIFIC(T) \
if (DECL_LANG_SPECIFIC (T) == NULL) \
@@ -1031,6 +1024,7 @@ struct lang_decl_var GTY(())
tree wfl; /* Original wfl */
unsigned int final_iud : 1; /* Final initialized upon declaration */
unsigned int cif : 1; /* True: decl is a class initialization flag */
+ unsigned int freed; /* Decl is no longer in scope. */
};
/* This is what 'lang_decl' really points to. */
@@ -1221,7 +1215,6 @@ extern int enclosing_context_p (tree, tree);
extern void complete_start_java_method (tree);
extern tree build_result_decl (tree);
extern void emit_handlers (void);
-extern void init_outgoing_cpool (void);
extern void make_class_data (tree);
extern void register_class (void);
extern int alloc_name_constant (int, tree);
@@ -1556,9 +1549,6 @@ extern tree *type_map;
feature a finalizer method. */
#define HAS_FINALIZER_P(EXPR) TREE_LANG_FLAG_3 (EXPR)
-/* True if EXPR (a WFL in that case) resolves into an expression name */
-#define RESOLVE_EXPRESSION_NAME_P(WFL) TREE_LANG_FLAG_0 (WFL)
-
/* True if EXPR (a LOOP_EXPR in that case) is part of a for statement */
#define FOR_LOOP_P(EXPR) TREE_LANG_FLAG_0 (EXPR)
@@ -1727,6 +1717,8 @@ while (0)
#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 BLOCK_EMPTY_P(NODE) \
+ (TREE_CODE (NODE) == BLOCK && BLOCK_EXPR_BODY (NODE) == empty_stmt_node)
#define BUILD_MONITOR_ENTER(WHERE, ARG) \
{ \
diff --git a/gcc/java/jcf-dump.c b/gcc/java/jcf-dump.c
index a87dd401e0f..a95f122ac19 100644
--- a/gcc/java/jcf-dump.c
+++ b/gcc/java/jcf-dump.c
@@ -615,7 +615,7 @@ print_constant (FILE *out, JCF *jcf, int index, int verbosity)
break;
case CONSTANT_Utf8:
{
- register const unsigned char *str = JPOOL_UTF_DATA (jcf, index);
+ const unsigned char *str = JPOOL_UTF_DATA (jcf, index);
int length = JPOOL_UTF_LENGTH (jcf, index);
if (verbosity > 0)
{ /* Print as 8-bit bytes. */
diff --git a/gcc/java/jcf-io.c b/gcc/java/jcf-io.c
index fb8d00fa9fb..101be8ee1d3 100644
--- a/gcc/java/jcf-io.c
+++ b/gcc/java/jcf-io.c
@@ -619,7 +619,7 @@ jcf_print_char (FILE *stream, int ch)
/* Print UTF8 string at STR of length LENGTH bytes to STREAM. */
void
-jcf_print_utf8 (FILE *stream, register const unsigned char *str, int length)
+jcf_print_utf8 (FILE *stream, const unsigned char *str, int length)
{
const unsigned char * limit = str + length;
while (str < limit)
@@ -713,7 +713,7 @@ format_uint (char *buffer, uint64 value, int base)
{
#define WRITE_BUF_SIZE (4 + sizeof(uint64) * 8)
char buf[WRITE_BUF_SIZE];
- register char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */
+ char *buf_ptr = buf+WRITE_BUF_SIZE; /* End of buf. */
int chars_written;
int i;
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c
index fa77efebb8b..a3fa2124f82 100644
--- a/gcc/java/jcf-parse.c
+++ b/gcc/java/jcf-parse.c
@@ -693,12 +693,6 @@ load_inner_classes (tree cur_class)
}
}
-void
-init_outgoing_cpool (void)
-{
- outgoing_cpool = ggc_alloc_cleared (sizeof (struct CPool));
-}
-
static void
parse_class_file (void)
{
@@ -710,7 +704,6 @@ parse_class_file (void)
input_filename = DECL_SOURCE_FILE (TYPE_NAME (current_class));
input_line = 0;
(*debug_hooks->start_source_file) (input_line, input_filename);
- init_outgoing_cpool ();
/* Currently we always have to emit calls to _Jv_InitClass when
compiling from class files. */
@@ -760,8 +753,8 @@ parse_class_file (void)
input_line = 0;
if (DECL_LINENUMBERS_OFFSET (method))
{
- register int i;
- register unsigned char *ptr;
+ int i;
+ unsigned char *ptr;
JCF_SEEK (jcf, DECL_LINENUMBERS_OFFSET (method));
linenumber_count = i = JCF_readu2 (jcf);
linenumber_table = ptr = jcf->read_ptr;
@@ -1172,10 +1165,9 @@ classify_zip_file (struct ZipDirectory *zdir)
".class", 6))
return 1;
- /* For now we drop the manifest and other information. Maybe it
- would make more sense to compile it in? */
- if (zdir->filename_length > 8
- && !strncmp (class_name_in_zip_dir, "META-INF/", 9))
+ /* For now we drop the manifest, but not other information. */
+ if (zdir->filename_length == 20
+ && !strncmp (class_name_in_zip_dir, "META-INF/MANIFEST.MF", 20))
return 0;
/* Drop directory entries. */
diff --git a/gcc/java/jcf-write.c b/gcc/java/jcf-write.c
index 578fa4aa826..74ebc1aa886 100644
--- a/gcc/java/jcf-write.c
+++ b/gcc/java/jcf-write.c
@@ -559,9 +559,9 @@ localvar_alloc (tree decl, struct jcf_partial *state)
struct jcf_block *start_label = get_jcf_label_here (state);
int wide = TYPE_IS_WIDE (TREE_TYPE (decl));
int index;
- register struct localvar_info *info;
- register struct localvar_info **ptr = localvar_buffer;
- register struct localvar_info **limit
+ struct localvar_info *info;
+ struct localvar_info **ptr = localvar_buffer;
+ struct localvar_info **limit
= (struct localvar_info**) state->localvars.ptr;
for (index = 0; ptr < limit; index++, ptr++)
{
@@ -602,8 +602,8 @@ maybe_free_localvar (tree decl, struct jcf_partial *state, int really)
{
struct jcf_block *end_label = get_jcf_label_here (state);
int index = DECL_LOCAL_INDEX (decl);
- register struct localvar_info **ptr = &localvar_buffer [index];
- register struct localvar_info *info = *ptr;
+ struct localvar_info **ptr = &localvar_buffer [index];
+ struct localvar_info *info = *ptr;
int wide = TYPE_IS_WIDE (TREE_TYPE (decl));
info->end_label = end_label;
diff --git a/gcc/java/keyword.h b/gcc/java/keyword.h
index 0339df18f93..49eda19f451 100644
--- a/gcc/java/keyword.h
+++ b/gcc/java/keyword.h
@@ -51,7 +51,7 @@ inline
#endif
#endif
static unsigned int
-hash (register const char *str, register unsigned int len)
+hash (const char *str, unsigned int len)
{
static const unsigned char asso_values[] =
{
@@ -82,7 +82,7 @@ hash (register const char *str, register unsigned int len)
86, 86, 86, 86, 86, 86, 86, 86, 86, 86,
86, 86, 86, 86, 86, 86
};
- register int hval = len;
+ int hval = len;
switch (hval)
{
@@ -102,7 +102,7 @@ hash (register const char *str, register unsigned int len)
__inline
#endif
const struct java_keyword *
-java_keyword (register const char *str, register unsigned int len)
+java_keyword (const char *str, unsigned int len)
{
static const struct java_keyword wordlist[] =
{
@@ -175,11 +175,11 @@ java_keyword (register const char *str, register unsigned int len)
if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
{
- register int key = hash (str, len);
+ int key = hash (str, len);
if (key <= MAX_HASH_VALUE && key >= 0)
{
- register const char *s = wordlist[key].name;
+ const char *s = wordlist[key].name;
if (*str == *s && !strcmp (str + 1, s + 1))
return &wordlist[key];
diff --git a/gcc/java/lang.c b/gcc/java/lang.c
index 615d250c018..c2494daacea 100644
--- a/gcc/java/lang.c
+++ b/gcc/java/lang.c
@@ -840,21 +840,14 @@ java_tree_inlining_walk_subtrees (tree *tp ATTRIBUTE_UNUSED,
switch (code)
{
case BLOCK:
- if (BLOCK_EXPR_BODY (t))
- {
- tree *prev = &BLOCK_EXPR_BODY (*tp);
- while (*prev)
- {
- WALK_SUBTREE (*prev);
- prev = &TREE_CHAIN (*prev);
- }
- }
+ WALK_SUBTREE (BLOCK_EXPR_BODY (t));
return NULL_TREE;
- break;
default:
return NULL_TREE;
}
+
+ #undef WALK_SUBTREE
}
/* Called from unsafe_for_reeval. */
@@ -926,6 +919,24 @@ merge_init_test_initialization (void **entry, void *x)
if (!*init_test_decl)
*init_test_decl = (tree)n->value;
+ /* This fixes a weird case.
+
+ The front end assumes that once we have called a method that
+ initializes some class, we can assume the class is initialized. It
+ does this by setting the DECL_INITIAL of the init_test_decl for that
+ class, and no initializations are emitted for that class.
+
+ However, what if the method that is suppoed to do the initialization
+ is itself inlined in the caller? When expanding the called method
+ we'll assume that the class initalization has already been done,
+ because the DECL_INITIAL of the init_test_decl is set.
+
+ To fix this we remove the DECL_INITIAL (in the caller scope) of all
+ the init_test_decls corresponding to classes initialized by the
+ inlined method. This makes the caller no longer assume that the
+ method being inlined does any class initializations. */
+ DECL_INITIAL (*init_test_decl) = NULL;
+
return true;
}
diff --git a/gcc/java/lex.h b/gcc/java/lex.h
index 037d044afd5..c339cc13e51 100644
--- a/gcc/java/lex.h
+++ b/gcc/java/lex.h
@@ -35,7 +35,7 @@ extern FILE *finput;
/* A Unicode character, as read from the input file */
typedef unsigned short unicode_t;
-#ifdef HAVE_ICONV
+#if defined HAVE_ICONV_H && defined HAVE_ICONV
#include <iconv.h>
#endif /* HAVE_ICONV */
diff --git a/gcc/java/parse.y b/gcc/java/parse.y
index 3f63300fbc5..c8b4596a587 100644
--- a/gcc/java/parse.y
+++ b/gcc/java/parse.y
@@ -326,7 +326,7 @@ static void patch_anonymous_class (tree, tree, tree);
static void add_inner_class_fields (tree, tree);
static tree build_dot_class_method (tree);
-static tree build_dot_class_method_invocation (tree);
+static tree build_dot_class_method_invocation (tree, tree);
static void create_new_parser_context (int);
static tree maybe_build_class_init_for_field (tree, tree);
@@ -1905,15 +1905,24 @@ catch_clause_parameter:
formal_parameter (CCBP). The formal parameter is
declared initialized by the appropriate function
call */
- tree ccpb = enter_block ();
- 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));
- $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb);
- EXPR_WFL_LINECOL ($$) = $1.location;
+ tree ccpb;
+ tree init;
+ if ($3)
+ {
+ ccpb = enter_block ();
+ 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));
+ $$ = build1 (CATCH_EXPR, NULL_TREE, ccpb);
+ EXPR_WFL_LINECOL ($$) = $1.location;
+ }
+ else
+ {
+ $$ = error_mark_node;
+ }
}
| CATCH_TK error
{yyerror ("'(' expected"); RECOVER; $$ = NULL_TREE;}
@@ -2660,7 +2669,9 @@ create_new_parser_context (int copy_from_previous)
if (copy_from_previous)
{
memcpy (new, ctxp, sizeof (struct parser_ctxt));
- new->saved_data_ctx = 1;
+ /* This flag, indicating the context saves global values,
+ should only be set by java_parser_context_save_global. */
+ new->saved_data_ctx = 0;
}
else
memset (new, 0, sizeof (struct parser_ctxt));
@@ -2733,7 +2744,10 @@ java_parser_context_save_global (void)
/* If this context already stores data, create a new one suitable
for data storage. */
else if (ctxp->saved_data)
- create_new_parser_context (1);
+ {
+ create_new_parser_context (1);
+ ctxp->saved_data_ctx = 1;
+ }
ctxp->lineno = input_line;
ctxp->class_type = current_class;
@@ -5109,7 +5123,7 @@ create_jdep_list (struct parser_ctxt *ctxp)
static jdeplist *
reverse_jdep_list (struct parser_ctxt *ctxp)
{
- register jdeplist *prev = NULL, *current, *next;
+ jdeplist *prev = NULL, *current, *next;
for (current = ctxp->classd_list; current; current = next)
{
next = current->next;
@@ -5718,14 +5732,16 @@ do_resolve_class (tree enclosing, tree class_type, tree decl, tree cl)
class and then treat Id as a member type. If we can't find Q
as a class then we fall through. */
tree q, left, left_type, right;
- breakdown_qualified (&left, &right, TYPE_NAME (class_type));
- BUILD_PTR_FROM_NAME (left_type, left);
- q = do_resolve_class (enclosing, left_type, decl, cl);
- if (q)
+ if (breakdown_qualified (&left, &right, TYPE_NAME (class_type)) == 0)
{
- enclosing = q;
- saved_enclosing_type = TREE_TYPE (q);
- BUILD_PTR_FROM_NAME (class_type, right);
+ BUILD_PTR_FROM_NAME (left_type, left);
+ q = do_resolve_class (enclosing, left_type, decl, cl);
+ if (q)
+ {
+ enclosing = q;
+ saved_enclosing_type = TREE_TYPE (q);
+ BUILD_PTR_FROM_NAME (class_type, right);
+ }
}
}
@@ -7682,9 +7698,6 @@ java_complete_expand_methods (tree class_decl)
current_class = TREE_TYPE (class_decl);
- /* Initialize a new constant pool */
- init_outgoing_cpool ();
-
/* Pre-expand <clinit> to figure whether we really need it or
not. If we do need it, we pre-expand the static fields so they're
ready to be used somewhere else. <clinit> will be fully expanded
@@ -7768,9 +7781,6 @@ java_complete_expand_methods (tree class_decl)
if (DECL_CONSTRUCTOR_P (decl)
&& verify_constructor_circularity (decl, decl))
break;
-
- /* Save the constant pool. We'll need to restore it later. */
- TYPE_CPOOL (current_class) = outgoing_cpool;
}
/* Attempt to create <clinit>. Pre-expand static fields so they can be
@@ -8722,7 +8732,7 @@ build_dot_class_method (tree class)
{
#define BWF(S) build_wfl_node (get_identifier ((S)))
#define MQN(X,Y) make_qualified_name ((X), (Y), 0)
- tree args, tmp, saved_current_function_decl, mdecl;
+ tree args, tmp, saved_current_function_decl, mdecl, qual_name;
tree stmt, throw_stmt;
if (!get_message_wfl)
@@ -8739,15 +8749,17 @@ build_dot_class_method (tree class)
/* Build the qualified name java.lang.Class.forName */
tmp = MQN (MQN (MQN (BWF ("java"),
BWF ("lang")), BWF ("Class")), BWF ("forName"));
- load_class (class_not_found_type_node, 1);
- load_class (no_class_def_found_type_node, 1);
/* Create the "class$" function */
mdecl = create_artificial_method (class, ACC_STATIC,
build_pointer_type (class_type_node),
classdollar_identifier_node, args);
- DECL_FUNCTION_THROWS (mdecl) =
- build_tree_list (NULL_TREE, no_class_def_found_type_node);
+ qual_name = MQN (MQN (BWF ("java"), BWF ("lang")),
+ BWF ("NoClassDefFoundError"));
+ DECL_FUNCTION_THROWS (mdecl) = build_tree_list (NULL_TREE, qual_name);
+ register_incomplete_type (JDEP_EXCEPTION, qual_name, NULL_TREE, NULL_TREE);
+ JDEP_GET_PATCH (CLASSD_LAST (ctxp->classd_list)) =
+ &TREE_VALUE (DECL_FUNCTION_THROWS (mdecl));
/* We start by building the try block. We need to build:
return (java.lang.Class.forName (type)); */
@@ -8770,8 +8782,9 @@ build_dot_class_method (tree class)
throw_stmt = build1 (THROW_EXPR, NULL_TREE, throw_stmt);
/* Encapsulate STMT in a try block. The catch clause executes THROW_STMT */
- stmt = encapsulate_with_try_catch (0, class_not_found_type_node,
- stmt, throw_stmt);
+ qual_name = MQN (MQN (BWF ("java"), BWF ("lang")),
+ BWF ("ClassNotFoundException"));
+ stmt = encapsulate_with_try_catch (0, qual_name, stmt, throw_stmt);
fix_method_argument_names (args, mdecl);
layout_class_method (class, NULL_TREE, mdecl, NULL_TREE);
@@ -8786,9 +8799,10 @@ build_dot_class_method (tree class)
}
static tree
-build_dot_class_method_invocation (tree type)
+build_dot_class_method_invocation (tree this_class, tree type)
{
- tree sig_id, s;
+ tree dot_class_method = TYPE_DOT_CLASS (this_class);
+ tree sig_id, s, t;
if (TYPE_ARRAY_P (type))
sig_id = build_java_signature (type);
@@ -8801,8 +8815,14 @@ build_dot_class_method_invocation (tree type)
s = build_string (IDENTIFIER_LENGTH (sig_id),
IDENTIFIER_POINTER (sig_id));
- return build_method_invocation (build_wfl_node (classdollar_identifier_node),
- build_tree_list (NULL_TREE, s));
+ t = build_method_invocation (build_wfl_node (DECL_NAME (dot_class_method)),
+ build_tree_list (NULL_TREE, s));
+ if (DECL_CONTEXT (dot_class_method) != this_class)
+ {
+ tree class_name = DECL_NAME (TYPE_NAME (DECL_CONTEXT (dot_class_method)));
+ t = make_qualified_primary (build_wfl_node (class_name), t, 0);
+ }
+ return t;
}
/* This section of the code deals with constructor. */
@@ -9140,7 +9160,6 @@ java_expand_classes (void)
current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (TREE_VALUE (current));
- outgoing_cpool = TYPE_CPOOL (current_class);
if (flag_emit_class_files)
write_classfile (current_class);
if (flag_emit_xref)
@@ -9162,7 +9181,6 @@ java_finish_classes (void)
for (current = ctxp->class_list; current; current = TREE_CHAIN (current))
{
current_class = TREE_TYPE (current);
- outgoing_cpool = TYPE_CPOOL (current_class);
finish_class ();
}
}
@@ -9601,10 +9619,7 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl,
instantiation using a primary qualified by a `new' */
RESTORE_THIS_AND_CURRENT_CLASS;
- /* EH check. No check on access$<n> functions */
- if (location
- && !OUTER_FIELD_ACCESS_IDENTIFIER_P
- (DECL_NAME (current_function_decl)))
+ if (location)
{
tree arguments = NULL_TREE;
if (TREE_CODE (qual_wfl) == CALL_EXPR
@@ -9796,7 +9811,6 @@ resolve_qualified_expression_name (tree wfl, tree *found_decl,
list = TREE_CHAIN (q);
while (list)
{
- RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (list)) = 1;
RESOLVE_PACKAGE_NAME_P (QUAL_WFL (list)) = 0;
list = TREE_CHAIN (list);
}
@@ -11237,7 +11251,7 @@ static GTY(()) tree m2_arg_cache;
static int
argument_types_convertible (tree m1, tree m2_or_arglist)
{
- register tree m1_arg, m2_arg;
+ tree m1_arg, m2_arg;
SKIP_THIS_AND_ARTIFICIAL_PARMS (m1_arg, m1)
@@ -11274,211 +11288,58 @@ argument_types_convertible (tree m1, tree m2_or_arglist)
/* Qualification routines */
+/* Given a name x.y.z, look up x locally. If it's found, save the
+ decl. If it's not found, mark the name as RESOLVE_PACKAGE_NAME_P,
+ so that we later try and load the appropriate classes. */
static void
qualify_ambiguous_name (tree id)
{
- tree qual, qual_wfl, name = NULL_TREE, decl, ptr_type = NULL_TREE,
- saved_current_class;
- int again, super_found = 0, this_found = 0, new_array_found = 0;
- int code;
-
- /* We first qualify the first element, then derive qualification of
- others based on the first one. If the first element is qualified
- by a resolution (field or type), this resolution is stored in the
- QUAL_RESOLUTION of the qual element being examined. We need to
- save the current_class since the use of SUPER might change the
- its value. */
- saved_current_class = current_class;
- qual = EXPR_WFL_QUALIFICATION (id);
- do {
+ tree name, decl;
- /* Simple qualified expression feature a qual_wfl that is a
- WFL. Expression derived from a primary feature more complicated
- things like a CALL_EXPR. Expression from primary need to be
- worked out to extract the part on which the qualification will
- take place. */
- qual_wfl = QUAL_WFL (qual);
- switch (TREE_CODE (qual_wfl))
- {
- case CALL_EXPR:
- qual_wfl = TREE_OPERAND (qual_wfl, 0);
- if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION
- || (EXPR_WFL_QUALIFICATION (qual_wfl)
- && TREE_CODE (EXPR_WFL_QUALIFICATION (qual_wfl)) == TREE_LIST))
- {
- qual = EXPR_WFL_QUALIFICATION (qual_wfl);
- qual_wfl = QUAL_WFL (qual);
- }
- break;
- case NEW_ARRAY_EXPR:
- case NEW_ANONYMOUS_ARRAY_EXPR:
- qual = TREE_CHAIN (qual);
- again = new_array_found = 1;
- continue;
- case CONVERT_EXPR:
- break;
- case NEW_CLASS_EXPR:
- qual_wfl = TREE_OPERAND (qual_wfl, 0);
- break;
- case ARRAY_REF:
- while (TREE_CODE (qual_wfl) == ARRAY_REF)
- qual_wfl = TREE_OPERAND (qual_wfl, 0);
- break;
- case STRING_CST:
- qual = TREE_CHAIN (qual);
- qual_wfl = QUAL_WFL (qual);
- break;
- case CLASS_LITERAL:
- qual = TREE_CHAIN (qual);
- qual_wfl = QUAL_WFL (qual);
- break;
- default:
- /* Fix for -Wall. Just break doing nothing */
- break;
- }
-
- ptr_type = current_class;
- again = 0;
- code = TREE_CODE (qual_wfl);
-
- /* Pos evaluation: non WFL leading expression nodes */
- if (code == CONVERT_EXPR
- && TREE_CODE (TREE_TYPE (qual_wfl)) == EXPR_WITH_FILE_LOCATION)
- name = EXPR_WFL_NODE (TREE_TYPE (qual_wfl));
-
- 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 == CONVERT_EXPR
- && TREE_CODE (TREE_OPERAND (qual_wfl, 0)) == CALL_EXPR
- && (TREE_CODE (TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 0))
- == EXPR_WITH_FILE_LOCATION))
- name = TREE_OPERAND (TREE_OPERAND (qual_wfl, 0), 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));
+ /* We inspect the first item of the qualification list. As a sanity
+ check, make sure that it is an identfier node. */
+ tree qual = EXPR_WFL_QUALIFICATION (id);
+ tree qual_wfl = QUAL_WFL (qual);
- else if (code == TREE_LIST)
- name = EXPR_WFL_NODE (TREE_PURPOSE (qual_wfl));
+ if (TREE_CODE (qual_wfl) != EXPR_WITH_FILE_LOCATION)
+ return;
- else if (code == STRING_CST || code == CONDITIONAL_EXPR
- || code == PLUS_EXPR)
- {
- qual = TREE_CHAIN (qual);
- qual_wfl = QUAL_WFL (qual);
- again = 1;
- }
- else
- {
- name = EXPR_WFL_NODE (qual_wfl);
- if (!name)
- {
- qual = EXPR_WFL_QUALIFICATION (qual_wfl);
- again = 1;
- }
- }
+ name = EXPR_WFL_NODE (qual_wfl);
- /* If we have a THIS (from a primary), we set the context accordingly */
- if (name == this_identifier_node)
- {
- /* This isn't really elegant. One more added irregularity
- before I start using COMPONENT_REF (hopefully very soon.) */
- if (TREE_CODE (TREE_PURPOSE (qual)) == ARRAY_REF
- && TREE_CODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) ==
- EXPR_WITH_FILE_LOCATION
- && EXPR_WFL_NODE (TREE_OPERAND (TREE_PURPOSE (qual), 0)) ==
- this_identifier_node)
- {
- qual = TREE_OPERAND (TREE_PURPOSE (qual), 0);
- qual = EXPR_WFL_QUALIFICATION (qual);
- }
- qual = TREE_CHAIN (qual);
- qual_wfl = QUAL_WFL (qual);
- if (TREE_CODE (qual_wfl) == CALL_EXPR)
- again = 1;
- 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 */
- if (name == super_identifier_node)
- {
- current_class = CLASSTYPE_SUPER (ptr_type);
- /* Check that there is such a thing as a super class. If not,
- return. The error will be caught later on, during the
- resolution */
- if (!current_class)
- {
- current_class = saved_current_class;
- return;
- }
- qual = TREE_CHAIN (qual);
- /* Do one more iteration to set things up */
- super_found = again = 1;
- }
- } while (again);
+ /* If we don't have an identifier, or we have a 'this' or 'super',
+ then field access processing is all we need : there is nothing
+ for us to do. */
+ if (!name || TREE_CODE (name) != IDENTIFIER_NODE ||
+ name == this_identifier_node ||
+ name == super_identifier_node)
+ return;
/* If name appears within the scope of a local variable declaration
- or parameter declaration, then it is an expression name. We don't
- carry this test out if we're in the context of the use of SUPER
- or THIS */
- if (!this_found && !super_found
- && TREE_CODE (name) != STRING_CST && TREE_CODE (name) != INTEGER_CST
- && (decl = IDENTIFIER_LOCAL_VALUE (name)))
- {
- RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
+ or parameter declaration, or is a field within an enclosing
+ class, then it is an expression name. Save the decl and let
+ resolve_field_access do it's work. */
+ if ((decl = IDENTIFIER_LOCAL_VALUE (name)) ||
+ (decl = lookup_field_wrapper (current_class, name)))
+ {
QUAL_RESOLUTION (qual) = decl;
+ return;
}
- /* If within the class/interface NAME was found to be used there
- exists a (possibly inherited) field named NAME, then this is an
- 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))
- || name == length_identifier_node)
- {
- RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
- QUAL_RESOLUTION (qual) = (new_array_found ? NULL_TREE : decl);
- }
-
- /* We reclassify NAME as yielding to a type name resolution if:
- - NAME is a class/interface declared within the compilation
- unit containing NAME,
- - NAME is imported via a single-type-import declaration,
- - NAME is declared in an another compilation unit of the package
- of the compilation unit containing NAME,
- - NAME is declared by exactly on type-import-on-demand declaration
- of the compilation unit containing NAME.
- - NAME is actually a STRING_CST.
- This can't happen if the expression was qualified by `this.' */
- else if (! this_found &&
- (TREE_CODE (name) == STRING_CST ||
- TREE_CODE (name) == INTEGER_CST ||
- (decl = resolve_and_layout (name, NULL_TREE))))
+ /* If name is a known class name (either declared or imported), mark
+ us as a type name. */
+ if ((decl = resolve_and_layout (name, NULL_TREE)))
{
RESOLVE_TYPE_NAME_P (qual_wfl) = 1;
QUAL_RESOLUTION (qual) = decl;
}
- /* 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)) == MODIFY_EXPR)
- RESOLVE_EXPRESSION_NAME_P (qual_wfl) = 1;
-
/* Check here that NAME isn't declared by more than one
type-import-on-demand declaration of the compilation unit
containing NAME. FIXME */
- /* Otherwise, NAME is reclassified as a package name */
+ /* We couldn't find a declaration for the name. Assume for now that
+ we have a qualified class name that needs to be loaded from an
+ external class file. */
else
RESOLVE_PACKAGE_NAME_P (qual_wfl) = 1;
@@ -11489,21 +11350,14 @@ qualify_ambiguous_name (tree id)
{
if (RESOLVE_PACKAGE_NAME_P (qual_wfl))
RESOLVE_PACKAGE_NAME_P (QUAL_WFL (qual)) = 1;
- else
- RESOLVE_EXPRESSION_NAME_P (QUAL_WFL (qual)) = 1;
}
/* Store the global qualification for the ambiguous part of ID back
into ID fields */
- if (RESOLVE_EXPRESSION_NAME_P (qual_wfl))
- RESOLVE_EXPRESSION_NAME_P (id) = 1;
- else if (RESOLVE_TYPE_NAME_P (qual_wfl))
+ if (RESOLVE_TYPE_NAME_P (qual_wfl))
RESOLVE_TYPE_NAME_P (id) = 1;
else if (RESOLVE_PACKAGE_NAME_P (qual_wfl))
RESOLVE_PACKAGE_NAME_P (id) = 1;
-
- /* Restore the current class */
- current_class = saved_current_class;
}
static int
@@ -11720,9 +11574,13 @@ java_complete_lhs (tree node)
case TRY_FINALLY_EXPR:
COMPLETE_CHECK_OP_0 (node);
COMPLETE_CHECK_OP_1 (node);
- if (TREE_OPERAND (node, 0) == empty_stmt_node)
+ /* Reduce try/finally nodes with an empty try block. */
+ if (TREE_OPERAND (node, 0) == empty_stmt_node
+ || BLOCK_EMPTY_P (TREE_OPERAND (node, 0)))
return TREE_OPERAND (node, 1);
- if (TREE_OPERAND (node, 1) == empty_stmt_node)
+ /* Likewise for an empty finally block. */
+ if (TREE_OPERAND (node, 1) == empty_stmt_node
+ || BLOCK_EMPTY_P (TREE_OPERAND (node, 1)))
return TREE_OPERAND (node, 0);
CAN_COMPLETE_NORMALLY (node)
= (CAN_COMPLETE_NORMALLY (TREE_OPERAND (node, 0))
@@ -12043,6 +11901,7 @@ java_complete_lhs (tree node)
int from_super = (EXPR_WFL_NODE (TREE_OPERAND (node, 0)) ==
super_identifier_node);
tree arguments;
+ int location = EXPR_WFL_LINECOL (node);
node = patch_method_invocation (node, NULL_TREE, NULL_TREE,
from_super, 0, &decl);
@@ -12054,8 +11913,7 @@ java_complete_lhs (tree node)
arguments = TREE_VALUE (TREE_OPERAND (node, 1));
else
arguments = NULL_TREE;
- check_thrown_exceptions (EXPR_WFL_LINECOL (node), decl,
- arguments);
+ check_thrown_exceptions (location, decl, arguments);
/* If we call this(...), register signature and positions */
if (in_this)
DECL_CONSTRUCTOR_CALLS (current_function_decl) =
@@ -12081,8 +11939,8 @@ java_complete_lhs (tree node)
/* When we have a primitype type, or a string and we're not
emitting a class file, we actually don't want to generate
anything for the assignment. */
- if (value != NULL_TREE &&
- (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) ||
+ if (value != NULL_TREE &&
+ (JPRIMITIVE_TYPE_P (TREE_TYPE (value)) ||
(TREE_TYPE (value) == string_ptr_type_node &&
! flag_emit_class_files)))
{
@@ -13844,7 +13702,9 @@ merge_string_cste (tree op1, tree op2, int after)
string = boolean_true;
else if (op2 == boolean_false_node)
string = boolean_false;
- else if (op2 == null_pointer_node)
+ else if (op2 == null_pointer_node
+ || (integer_zerop (op2)
+ && TREE_CODE (TREE_TYPE (op2)) == POINTER_TYPE))
/* FIXME: null is not a compile-time constant, so it is only safe to
merge if the overall expression is non-constant. However, this
code always merges without checking the overall expression. */
@@ -14094,6 +13954,44 @@ static tree
build_incomplete_class_ref (int location, tree class_name)
{
tree node = build1 (CLASS_LITERAL, NULL_TREE, class_name);
+ tree class_decl = GET_CPC ();
+ tree this_class = TREE_TYPE (class_decl);
+
+ /* Generate the synthetic static method `class$'. (Previously we
+ deferred this, causing different method tables to be emitted
+ for native code and bytecode.) */
+ if (!TYPE_DOT_CLASS (this_class)
+ && !JPRIMITIVE_TYPE_P (class_name)
+ && !(TREE_CODE (class_name) == VOID_TYPE))
+ {
+ tree target_class;
+
+ if (CLASS_INTERFACE (TYPE_NAME (this_class)))
+ {
+ /* For interfaces, adding a static 'class$' method directly
+ is illegal. So create an inner class to contain the new
+ method. Empirically this matches the behavior of javac. */
+ tree t = build_wfl_node (DECL_NAME (TYPE_NAME (object_type_node)));
+ tree inner = create_anonymous_class (0, t);
+ target_class = TREE_TYPE (inner);
+ end_class_declaration (1);
+ }
+ else
+ {
+ /* For inner classes, add a 'class$' method to their outermost
+ context, creating it if necessary. */
+ while (INNER_CLASS_DECL_P (class_decl))
+ class_decl = DECL_CONTEXT (class_decl);
+ target_class = TREE_TYPE (class_decl);
+ }
+
+ if (TYPE_DOT_CLASS (target_class) == NULL_TREE)
+ build_dot_class_method (target_class);
+
+ if (this_class != target_class)
+ TYPE_DOT_CLASS (this_class) = TYPE_DOT_CLASS (target_class);
+ }
+
EXPR_WFL_LINECOL (node) = location;
return node;
}
@@ -14108,12 +14006,6 @@ patch_incomplete_class_ref (tree node)
if (!(ref_type = resolve_type_during_patch (type)))
return error_mark_node;
- /* Generate the synthetic static method `class$'. (Previously we
- deferred this, causing different method tables to be emitted
- for native code and bytecode.) */
- if (!TYPE_DOT_CLASS (current_class))
- build_dot_class_method (current_class);
-
/* If we're not emitting class files and we know ref_type is a
compiled class, build a direct reference. */
if ((! flag_emit_class_files && is_compiled_class (ref_type))
@@ -14129,7 +14021,7 @@ patch_incomplete_class_ref (tree node)
/* If we're emitting class files and we have to deal with non
primitive types, we invoke the synthetic static method `class$'. */
- ref_type = build_dot_class_method_invocation (ref_type);
+ ref_type = build_dot_class_method_invocation (current_class, ref_type);
return java_complete_tree (ref_type);
}
@@ -15393,7 +15285,7 @@ build_assertion (int location, tree condition, tree value)
if (!TYPE_DOT_CLASS (class_type))
build_dot_class_method (class_type);
- classdollar = build_dot_class_method_invocation (class_type);
+ classdollar = build_dot_class_method_invocation (class_type, class_type);
/* Call CLASS.desiredAssertionStatus(). */
id = build_wfl_node (get_identifier ("desiredAssertionStatus"));
@@ -15451,7 +15343,7 @@ build_assertion (int location, tree condition, tree value)
catches TYPE and executes CATCH_STMTS. */
static tree
-encapsulate_with_try_catch (int location, tree type, tree try_stmts,
+encapsulate_with_try_catch (int location, tree type_or_name, tree try_stmts,
tree catch_stmts)
{
tree try_block, catch_clause_param, catch_block, catch;
@@ -15460,8 +15352,20 @@ encapsulate_with_try_catch (int location, tree type, tree try_stmts,
try_block = build_expr_block (try_stmts, NULL_TREE);
/* Build a catch block: we need a catch clause parameter */
- catch_clause_param = build_decl (VAR_DECL,
- wpv_id, build_pointer_type (type));
+ if (TREE_CODE (type_or_name) == EXPR_WITH_FILE_LOCATION)
+ {
+ tree catch_type = obtain_incomplete_type (type_or_name);
+ jdep *dep;
+ catch_clause_param = build_decl (VAR_DECL, wpv_id, catch_type);
+ register_incomplete_type (JDEP_VARIABLE, type_or_name,
+ catch_clause_param, catch_type);
+ dep = CLASSD_LAST (ctxp->classd_list);
+ JDEP_GET_PATCH (dep) = &TREE_TYPE (catch_clause_param);
+ }
+ else
+ catch_clause_param = build_decl (VAR_DECL, wpv_id,
+ build_pointer_type (type_or_name));
+
/* And a block */
catch_block = build_expr_block (NULL_TREE, catch_clause_param);
@@ -15783,6 +15687,10 @@ check_thrown_exceptions (int location, tree decl, tree this_expr)
tree throws;
int is_array_call = 0;
+ /* Skip check within generated methods, such as access$<n>. */
+ if (OUTER_FIELD_ACCESS_IDENTIFIER_P (DECL_NAME (current_function_decl)))
+ return;
+
if (this_expr != NULL_TREE
&& TREE_CODE (TREE_TYPE (this_expr)) == POINTER_TYPE
&& TYPE_ARRAY_P (TREE_TYPE (TREE_TYPE (this_expr))))
@@ -16084,7 +15992,11 @@ fold_constant_for_init (tree node, tree context)
if (val == NULL_TREE || ! TREE_CONSTANT (val))
return NULL_TREE;
TREE_OPERAND (node, 0) = val;
- return patch_unaryop (node, op0);
+ val = patch_unaryop (node, op0);
+ if (! TREE_CONSTANT (val))
+ return NULL_TREE;
+ return val;
+
break;
case COND_EXPR:
@@ -16215,8 +16127,8 @@ attach_init_test_initialization_flags (void **entry, void *ptr)
return true;
}
-/* This function is called for each classes that is known definitely
- assigned when a given static method was called. This function
+/* This function is called for each class that is known definitely
+ initialized when a given static method was called. This function
augments a compound expression (INFO) storing all assignment to
initialized static class flags if a flag already existed, otherwise
a new one is created. */
diff --git a/gcc/java/resource.c b/gcc/java/resource.c
index b71a6709f5e..5d4b72a13ae 100644
--- a/gcc/java/resource.c
+++ b/gcc/java/resource.c
@@ -105,12 +105,16 @@ write_resource_constructor (void)
tree init_name, init_type, init_decl;
tree iter;
location_t saved_loc = input_location;
+ char *resource_ctor_name;
/* Only do work if required. */
if (resources == NULL_TREE)
return;
- init_name = get_file_function_name ('I');
+ resource_ctor_name = concat (IDENTIFIER_POINTER (get_file_function_name ('I')),
+ "_resource", NULL);
+ init_name = get_identifier (resource_ctor_name);
+ free (resource_ctor_name);
init_type = build_function_type (void_type_node, end_params_node);
init_decl = build_decl (FUNCTION_DECL, init_name, init_type);
diff --git a/gcc/java/typeck.c b/gcc/java/typeck.c
index 972cb8b3686..ddee2ba198b 100644
--- a/gcc/java/typeck.c
+++ b/gcc/java/typeck.c
@@ -112,7 +112,7 @@ convert_ieee_real_to_integer (tree type, tree expr)
tree
convert (tree type, tree expr)
{
- register enum tree_code code = TREE_CODE (type);
+ enum tree_code code = TREE_CODE (type);
if (!expr)
return error_mark_node;
@@ -244,7 +244,7 @@ java_unsigned_type (tree type)
bool
java_mark_addressable (tree exp)
{
- register tree x = exp;
+ tree x = exp;
while (1)
switch (TREE_CODE (x))
{
@@ -480,7 +480,7 @@ parse_signature_type (const unsigned char **ptr, const unsigned char *limit)
case 'L':
{
const unsigned char *start = ++(*ptr);
- register const unsigned char *str = start;
+ const unsigned char *str = start;
for ( ; ; str++)
{
if (str >= limit)
diff --git a/gcc/java/verify.c b/gcc/java/verify.c
index a5375bf1357..abcdac8c4d8 100644
--- a/gcc/java/verify.c
+++ b/gcc/java/verify.c
@@ -423,7 +423,7 @@ verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length)
char *pmessage;
int i;
int index;
- register unsigned char *p;
+ unsigned char *p;
struct eh_range *prev_eh_ranges = NULL_EH_RANGE;
struct eh_range *eh_ranges;
tree return_type = TREE_TYPE (TREE_TYPE (current_function_decl));
@@ -473,9 +473,6 @@ verify_jvm_instructions (JCF* jcf, const unsigned char *byte_ops, long length)
return 0;
}
- if (handler_pc >= start_pc && handler_pc < end_pc)
- warning ("exception handler inside code that is being protected");
-
add_handler (start_pc, end_pc,
lookup_label (handler_pc),
catch_type == 0 ? NULL_TREE
diff --git a/gcc/langhooks-def.h b/gcc/langhooks-def.h
index cf241602f44..6a9f68c86f0 100644
--- a/gcc/langhooks-def.h
+++ b/gcc/langhooks-def.h
@@ -83,7 +83,7 @@ extern tree lhd_tree_inlining_copy_res_decl_for_inlining (tree, tree, tree,
extern int lhd_tree_inlining_anon_aggr_type_p (tree);
extern int lhd_tree_inlining_start_inlining (tree);
extern void lhd_tree_inlining_end_inlining (tree);
-extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree);
+extern tree lhd_tree_inlining_convert_parm_for_inlining (tree, tree, tree, int);
extern void lhd_initialize_diagnostics (struct diagnostic_context *);
extern tree lhd_callgraph_analyze_expr (tree *, int *, tree);
diff --git a/gcc/langhooks.c b/gcc/langhooks.c
index a1d60f9ff5e..e31c1fbbd10 100644
--- a/gcc/langhooks.c
+++ b/gcc/langhooks.c
@@ -420,7 +420,8 @@ lhd_tree_inlining_end_inlining (tree fn ATTRIBUTE_UNUSED)
tree
lhd_tree_inlining_convert_parm_for_inlining (tree parm ATTRIBUTE_UNUSED,
tree value,
- tree fndecl ATTRIBUTE_UNUSED)
+ tree fndecl ATTRIBUTE_UNUSED,
+ int argnum ATTRIBUTE_UNUSED)
{
return value;
}
@@ -544,7 +545,6 @@ lhd_print_error_function (diagnostic_context *context, const char *file)
(context->printer, "In function `%s':",
(*lang_hooks.decl_printable_name) (current_function_decl, 2));
}
- pp_newline (context->printer);
diagnostic_set_last_function (context);
pp_flush (context->printer);
diff --git a/gcc/langhooks.h b/gcc/langhooks.h
index cb5941ff3eb..ce6b7a6b1c7 100644
--- a/gcc/langhooks.h
+++ b/gcc/langhooks.h
@@ -47,7 +47,7 @@ struct lang_hooks_for_tree_inlining
bool (*var_mod_type_p) (tree);
int (*start_inlining) (tree);
void (*end_inlining) (tree);
- tree (*convert_parm_for_inlining) (tree, tree, tree);
+ tree (*convert_parm_for_inlining) (tree, tree, tree, int);
int (*estimate_num_insns) (tree);
};
diff --git a/gcc/lcm.c b/gcc/lcm.c
index 68b49efb015..c8669049a6a 100644
--- a/gcc/lcm.c
+++ b/gcc/lcm.c
@@ -1058,8 +1058,8 @@ optimize_mode_switching (FILE *file)
REG_SET_TO_HARD_REG_SET (live_now,
bb->global_live_at_start);
- for (insn = bb->head;
- insn != NULL && insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb);
+ insn != NULL && insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
@@ -1093,7 +1093,7 @@ optimize_mode_switching (FILE *file)
/* Check for blocks without ANY mode requirements. */
if (last_mode == no_mode)
{
- ptr = new_seginfo (no_mode, bb->end, bb->index, live_now);
+ ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now);
add_seginfo (info + bb->index, ptr);
}
}
@@ -1201,8 +1201,8 @@ optimize_mode_switching (FILE *file)
if (eg->flags & EDGE_ABNORMAL)
{
emited = true;
- if (GET_CODE (src_bb->end) == JUMP_INSN)
- emit_insn_before (mode_set, src_bb->end);
+ if (GET_CODE (BB_END (src_bb)) == JUMP_INSN)
+ emit_insn_before (mode_set, BB_END (src_bb));
/* It doesn't make sense to switch to normal mode
after a CALL_INSN, so we're going to abort if we
find one. The cases in which a CALL_INSN may
@@ -1214,8 +1214,8 @@ optimize_mode_switching (FILE *file)
the call (it wouldn't make sense, anyway). In
the case of EH edges, EH entry points also start
in normal mode, so a similar reasoning applies. */
- else if (GET_CODE (src_bb->end) == INSN)
- emit_insn_after (mode_set, src_bb->end);
+ else if (GET_CODE (BB_END (src_bb)) == INSN)
+ emit_insn_after (mode_set, BB_END (src_bb));
else
abort ();
bb_info[j][src_bb->index].computing = mode;
diff --git a/gcc/libgcc-darwin.ver b/gcc/libgcc-darwin.ver
new file mode 100644
index 00000000000..5aba34efbdc
--- /dev/null
+++ b/gcc/libgcc-darwin.ver
@@ -0,0 +1,213 @@
+GCC_3.0 {
+ # libgcc1 integer symbols
+ ___absvsi2
+ ___addvsi3
+ ___ashlsi3
+ ___ashrsi3
+ ___divsi3
+ ___lshrsi3
+ ___modsi3
+ ___mulsi3
+ ___mulvsi3
+ ___negvsi2
+ ___subvsi3
+ ___udivsi3
+ ___umodsi3
+
+ # libgcc1 floating point symbols
+ ___addsf3
+ ___adddf3
+ ___addxf3
+ ___addtf3
+ ___divsf3
+ ___divdf3
+ ___divxf3
+ ___divtf3
+ ___eqsf2
+ ___eqdf2
+ ___eqxf2
+ ___eqtf2
+ ___extenddfxf2
+ ___extenddftf2
+ ___extendsfdf2
+ ___extendsfxf2
+ ___extendsftf2
+ ___fixsfsi
+ ___fixdfsi
+ ___fixxfsi
+ ___fixtfsi
+ ___floatsisf
+ ___floatsidf
+ ___floatsixf
+ ___floatsitf
+ ___gesf2
+ ___gedf2
+ ___gexf2
+ ___getf2
+ ___gtsf2
+ ___gtdf2
+ ___gtxf2
+ ___gttf2
+ ___lesf2
+ ___ledf2
+ ___lexf2
+ ___letf2
+ ___ltsf2
+ ___ltdf2
+ ___ltxf2
+ ___lttf2
+ ___mulsf3
+ ___muldf3
+ ___mulxf3
+ ___multf3
+ ___negsf2
+ ___negdf2
+ ___negxf2
+ ___negtf2
+ ___nesf2
+ ___nedf2
+ ___nexf2
+ ___netf2
+ ___subsf3
+ ___subdf3
+ ___subxf3
+ ___subtf3
+ ___truncdfsf2
+ ___truncxfsf2
+ ___trunctfsf2
+ ___truncxfdf2
+ ___trunctfdf2
+
+ # libgcc2 DImode arithmetic (for 32-bit targets).
+ ___absvdi2
+ ___addvdi3
+ ___ashldi3
+ ___ashrdi3
+ ___cmpdi2
+ ___divdi3
+ ___ffsdi2
+ ___fixdfdi
+ ___fixsfdi
+ ___fixtfdi
+ ___fixxfdi
+ ___fixunsdfdi
+ ___fixunsdfsi
+ ___fixunssfsi
+ ___fixunssfdi
+ ___fixunstfdi
+ ___fixunstfsi
+ ___fixunsxfdi
+ ___fixunsxfsi
+ ___floatdidf
+ ___floatdisf
+ ___floatdixf
+ ___floatditf
+ ___lshrdi3
+ ___moddi3
+ ___muldi3
+ ___mulvdi3
+ ___negdi2
+ ___negvdi2
+ ___subvdi3
+ ___ucmpdi2
+ ___udivdi3
+ ___udivmoddi4
+ ___umoddi3
+
+ # libgcc2 TImode arithmetic (for 64-bit targets).
+ ___ashlti3
+ ___ashrti3
+ ___cmpti2
+ ___divti3
+ ___ffsti2
+ ___fixdfti
+ ___fixsfti
+ ___fixtfti
+ ___fixxfti
+ ___lshrti3
+ ___modti3
+ ___multi3
+ ___negti2
+ ___ucmpti2
+ ___udivmodti4
+ ___udivti3
+ ___umodti3
+ ___fixunsdfti
+ ___fixunssfti
+ ___fixunstfti
+ ___fixunsxfti
+ ___floattidf
+ ___floattisf
+ ___floattixf
+ ___floattitf
+
+ # Used to deal with trampoline initialization on some platforms
+ ___clear_cache
+
+ # EH symbols
+ __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
+ ___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
+
+ # SjLj EH symbols
+ __Unwind_SjLj_Register
+ __Unwind_SjLj_Unregister
+ __Unwind_SjLj_RaiseException
+ __Unwind_SjLj_ForcedUnwind
+ __Unwind_SjLj_Resume
+}
+
+%inherit GCC_3.3 GCC_3.0
+GCC_3.3 {
+ __Unwind_FindEnclosingFunction
+ __Unwind_GetCFA
+ __Unwind_Backtrace
+ __Unwind_Resume_or_Rethrow
+ __Unwind_SjLj_Resume_or_Rethrow
+}
+
+%inherit GCC_3.3.1 GCC_3.3
+GCC_3.3.1 {
+ __gcc_personality_sj0
+ __gcc_personality_v0
+}
+
+%inherit GCC_3.3.2 GCC_3.3.1
+GCC_3.3.2 {
+}
+
+%inherit GCC_3.4 GCC_3.3
+GCC_3.4 {
+ # bit scanning and counting built-ins
+ ___clzsi2
+ ___clzdi2
+ ___clzti2
+ ___ctzsi2
+ ___ctzdi2
+ ___ctzti2
+ ___popcountsi2
+ ___popcountdi2
+ ___popcountti2
+ ___paritysi2
+ ___paritydi2
+ ___parityti2
+}
diff --git a/gcc/libgcc2.c b/gcc/libgcc2.c
index 05cb315cb9d..34171ad9002 100644
--- a/gcc/libgcc2.c
+++ b/gcc/libgcc2.c
@@ -63,13 +63,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
DWtype
__negdi2 (DWtype u)
{
- DWunion w;
- DWunion uu;
-
- uu.ll = u;
-
- w.s.low = -uu.s.low;
- w.s.high = -uu.s.high - ((UWtype) w.s.low > 0);
+ const DWunion uu = {.ll = u};
+ const DWunion w = { {.low = -uu.s.low,
+ .high = -uu.s.high - ((UWtype) -uu.s.low > 0) } };
return w.ll;
}
@@ -79,9 +75,7 @@ __negdi2 (DWtype u)
Wtype
__addvsi3 (Wtype a, Wtype b)
{
- Wtype w;
-
- w = a + b;
+ const Wtype w = a + b;
if (b >= 0 ? w < a : w > a)
abort ();
@@ -94,9 +88,7 @@ __addvsi3 (Wtype a, Wtype b)
DWtype
__addvdi3 (DWtype a, DWtype b)
{
- DWtype w;
-
- w = a + b;
+ const DWtype w = a + b;
if (b >= 0 ? w < a : w > a)
abort ();
@@ -109,9 +101,7 @@ __addvdi3 (DWtype a, DWtype b)
Wtype
__subvsi3 (Wtype a, Wtype b)
{
- DWtype w;
-
- w = a - b;
+ const DWtype w = a - b;
if (b >= 0 ? w > a : w < a)
abort ();
@@ -124,9 +114,7 @@ __subvsi3 (Wtype a, Wtype b)
DWtype
__subvdi3 (DWtype a, DWtype b)
{
- DWtype w;
-
- w = a - b;
+ const DWtype w = a - b;
if (b >= 0 ? w > a : w < a)
abort ();
@@ -140,9 +128,7 @@ __subvdi3 (DWtype a, DWtype b)
Wtype
__mulvsi3 (Wtype a, Wtype b)
{
- DWtype w;
-
- w = (DWtype) a * (DWtype) b;
+ const DWtype w = (DWtype) a * (DWtype) b;
if (((a >= 0) == (b >= 0))
? (UDWtype) w > (UDWtype) (((DWtype) 1 << (WORD_SIZE - 1)) - 1)
@@ -157,9 +143,7 @@ __mulvsi3 (Wtype a, Wtype b)
Wtype
__negvsi2 (Wtype a)
{
- Wtype w;
-
- w = -a;
+ const Wtype w = -a;
if (a >= 0 ? w > 0 : w < 0)
abort ();
@@ -172,9 +156,7 @@ __negvsi2 (Wtype a)
DWtype
__negvdi2 (DWtype a)
{
- DWtype w;
-
- w = -a;
+ const DWtype w = -a;
if (a >= 0 ? w > 0 : w < 0)
abort ();
@@ -230,10 +212,8 @@ __mulvdi3 (DWtype u, DWtype v)
{
/* The unchecked multiplication needs 3 Wtype x Wtype multiplications,
but the checked multiplication needs only two. */
- DWunion uu, vv;
-
- uu.ll = u;
- vv.ll = v;
+ const DWunion uu = {.ll = u};
+ const DWunion vv = {.ll = v};
if (__builtin_expect (uu.s.high == uu.s.low >> (WORD_SIZE - 1), 1))
{
@@ -247,10 +227,11 @@ __mulvdi3 (DWtype u, DWtype v)
else
{
/* Two multiplications. */
- DWunion w0, w1;
+ DWunion w0 = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low};
+ DWunion w1 = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.high};
- w0.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.low;
- w1.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.high;
if (vv.s.high < 0)
w1.s.high -= uu.s.low;
if (uu.s.low < 0)
@@ -269,10 +250,11 @@ __mulvdi3 (DWtype u, DWtype v)
{
/* v fits into a single Wtype. */
/* Two multiplications. */
- DWunion w0, w1;
+ DWunion w0 = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low};
+ DWunion w1 = {.ll = (UDWtype) (UWtype) uu.s.high
+ * (UDWtype) (UWtype) vv.s.low};
- w0.ll = (UDWtype) (UWtype) uu.s.low * (UDWtype) (UWtype) vv.s.low;
- w1.ll = (UDWtype) (UWtype) uu.s.high * (UDWtype) (UWtype) vv.s.low;
if (uu.s.high < 0)
w1.s.high -= vv.s.low;
if (vv.s.low < 0)
@@ -293,10 +275,8 @@ __mulvdi3 (DWtype u, DWtype v)
{
if (uu.s.high == 0 && vv.s.high == 0)
{
- DWtype w;
-
- w = (UDWtype) (UWtype) uu.s.low
- * (UDWtype) (UWtype) vv.s.low;
+ const DWtype w = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low;
if (__builtin_expect (w >= 0, 1))
return w;
}
@@ -305,10 +285,9 @@ __mulvdi3 (DWtype u, DWtype v)
{
if (uu.s.high == 0 && vv.s.high == (Wtype) -1)
{
- DWunion ww;
+ DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low};
- ww.ll = (UDWtype) (UWtype) uu.s.low
- * (UDWtype) (UWtype) vv.s.low;
ww.s.high -= uu.s.low;
if (__builtin_expect (ww.s.high < 0, 1))
return ww.ll;
@@ -321,10 +300,9 @@ __mulvdi3 (DWtype u, DWtype v)
{
if (uu.s.high == (Wtype) -1 && vv.s.high == 0)
{
- DWunion ww;
+ DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low};
- ww.ll = (UDWtype) (UWtype) uu.s.low
- * (UDWtype) (UWtype) vv.s.low;
ww.s.high -= vv.s.low;
if (__builtin_expect (ww.s.high < 0, 1))
return ww.ll;
@@ -334,10 +312,9 @@ __mulvdi3 (DWtype u, DWtype v)
{
if (uu.s.high == (Wtype) -1 && vv.s.high == (Wtype) - 1)
{
- DWunion ww;
+ DWunion ww = {.ll = (UDWtype) (UWtype) uu.s.low
+ * (UDWtype) (UWtype) vv.s.low};
- ww.ll = (UDWtype) (UWtype) uu.s.low
- * (UDWtype) (UWtype) vv.s.low;
ww.s.high -= uu.s.low;
ww.s.high -= vv.s.low;
if (__builtin_expect (ww.s.high >= 0, 1))
@@ -360,16 +337,13 @@ __mulvdi3 (DWtype u, DWtype v)
DWtype
__lshrdi3 (DWtype u, word_type b)
{
- DWunion w;
- word_type bm;
- DWunion uu;
-
if (b == 0)
return u;
- uu.ll = u;
+ const DWunion uu = {.ll = u};
+ const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+ DWunion w;
- bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
if (bm <= 0)
{
w.s.high = 0;
@@ -377,7 +351,7 @@ __lshrdi3 (DWtype u, word_type b)
}
else
{
- UWtype carries = (UWtype) uu.s.high << bm;
+ const UWtype carries = (UWtype) uu.s.high << bm;
w.s.high = (UWtype) uu.s.high >> b;
w.s.low = ((UWtype) uu.s.low >> b) | carries;
@@ -391,16 +365,13 @@ __lshrdi3 (DWtype u, word_type b)
DWtype
__ashldi3 (DWtype u, word_type b)
{
- DWunion w;
- word_type bm;
- DWunion uu;
-
if (b == 0)
return u;
- uu.ll = u;
+ const DWunion uu = {.ll = u};
+ const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+ DWunion w;
- bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
if (bm <= 0)
{
w.s.low = 0;
@@ -408,7 +379,7 @@ __ashldi3 (DWtype u, word_type b)
}
else
{
- UWtype carries = (UWtype) uu.s.low >> bm;
+ const UWtype carries = (UWtype) uu.s.low >> bm;
w.s.low = (UWtype) uu.s.low << b;
w.s.high = ((UWtype) uu.s.high << b) | carries;
@@ -422,16 +393,13 @@ __ashldi3 (DWtype u, word_type b)
DWtype
__ashrdi3 (DWtype u, word_type b)
{
- DWunion w;
- word_type bm;
- DWunion uu;
-
if (b == 0)
return u;
- uu.ll = u;
+ const DWunion uu = {.ll = u};
+ const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
+ DWunion w;
- bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
if (bm <= 0)
{
/* w.s.high = 1..1 or 0..0 */
@@ -440,7 +408,7 @@ __ashrdi3 (DWtype u, word_type b)
}
else
{
- UWtype carries = (UWtype) uu.s.high << bm;
+ const UWtype carries = (UWtype) uu.s.high << bm;
w.s.high = uu.s.high >> b;
w.s.low = ((UWtype) uu.s.low >> b) | carries;
@@ -472,10 +440,9 @@ extern int __ffsDI2 (DWtype u);
int
__ffsDI2 (DWtype u)
{
- DWunion uu;
+ const DWunion uu = {.ll = u};
UWtype word, count, add;
- uu.ll = u;
if (uu.s.low != 0)
word = uu.s.low, add = 0;
else if (uu.s.high != 0)
@@ -492,13 +459,10 @@ __ffsDI2 (DWtype u)
DWtype
__muldi3 (DWtype u, DWtype v)
{
- DWunion w;
- DWunion uu, vv;
+ const DWunion uu = {.ll = u};
+ const DWunion vv = {.ll = v};
+ DWunion w = {.ll = __umulsidi3 (uu.s.low, vv.s.low)};
- uu.ll = u,
- vv.ll = v;
-
- w.ll = __umulsidi3 (uu.s.low, vv.s.low);
w.s.high += ((UWtype) uu.s.low * (UWtype) vv.s.high
+ (UWtype) uu.s.high * (UWtype) vv.s.low);
@@ -667,11 +631,10 @@ extern int __clzDI2 (UDWtype x);
int
__clzDI2 (UDWtype x)
{
- DWunion uu;
+ const DWunion uu = {.ll = x};
UWtype word;
Wtype ret, add;
- uu.ll = x;
if (uu.s.high)
word = uu.s.high, add = 0;
else
@@ -702,11 +665,10 @@ extern int __ctzDI2 (UDWtype x);
int
__ctzDI2 (UDWtype x)
{
- DWunion uu;
+ const DWunion uu = {.ll = x};
UWtype word;
Wtype ret, add;
- uu.ll = x;
if (uu.s.low)
word = uu.s.low, add = 0;
else
@@ -794,11 +756,8 @@ extern int __parityDI2 (UDWtype x);
int
__parityDI2 (UDWtype x)
{
- DWunion uu;
- UWtype nx;
-
- uu.ll = x;
- nx = uu.s.low ^ uu.s.high;
+ const DWunion uu = {.ll = x};
+ UWtype nx = uu.s.low ^ uu.s.high;
#if W_TYPE_SIZE > 64
# error "fill out the table"
@@ -825,16 +784,13 @@ static inline __attribute__ ((__always_inline__))
UDWtype
__udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
{
- DWunion ww;
- DWunion nn, dd;
+ const DWunion nn = {.ll = n};
+ const DWunion dd = {.ll = d};
DWunion rr;
UWtype d0, d1, n0, n1, n2;
UWtype q0, q1;
UWtype b, bm;
- nn.ll = n;
- dd.ll = d;
-
d0 = dd.s.low;
d1 = dd.s.high;
n0 = nn.s.low;
@@ -1034,8 +990,7 @@ __udivmoddi4 (UDWtype n, UDWtype d, UDWtype *rp)
}
}
- ww.s.low = q0;
- ww.s.high = q1;
+ const DWunion ww = {{.low = q0, .high = q1}};
return ww.ll;
}
#endif
@@ -1045,12 +1000,10 @@ DWtype
__divdi3 (DWtype u, DWtype v)
{
word_type c = 0;
- DWunion uu, vv;
+ DWunion uu = {.ll = u};
+ DWunion vv = {.ll = v};
DWtype w;
- uu.ll = u;
- vv.ll = v;
-
if (uu.s.high < 0)
c = ~c,
uu.ll = -uu.ll;
@@ -1071,12 +1024,10 @@ DWtype
__moddi3 (DWtype u, DWtype v)
{
word_type c = 0;
- DWunion uu, vv;
+ DWunion uu = {.ll = u};
+ DWunion vv = {.ll = v};
DWtype w;
- uu.ll = u;
- vv.ll = v;
-
if (uu.s.high < 0)
c = ~c,
uu.ll = -uu.ll;
@@ -1115,9 +1066,8 @@ __udivdi3 (UDWtype n, UDWtype d)
word_type
__cmpdi2 (DWtype a, DWtype b)
{
- DWunion au, bu;
-
- au.ll = a, bu.ll = b;
+ const DWunion au = {.ll = a};
+ const DWunion bu = {.ll = b};
if (au.s.high < bu.s.high)
return 0;
@@ -1135,9 +1085,8 @@ __cmpdi2 (DWtype a, DWtype b)
word_type
__ucmpdi2 (DWtype a, DWtype b)
{
- DWunion au, bu;
-
- au.ll = a, bu.ll = b;
+ const DWunion au = {.ll = a};
+ const DWunion bu = {.ll = b};
if ((UWtype) au.s.high < (UWtype) bu.s.high)
return 0;
@@ -1158,17 +1107,14 @@ __ucmpdi2 (DWtype a, DWtype b)
DWtype
__fixunstfDI (TFtype a)
{
- TFtype b;
- UDWtype v;
-
if (a < 0)
return 0;
/* Compute high word of result, as a flonum. */
- b = (a / HIGH_WORD_COEFF);
+ const TFtype b = (a / HIGH_WORD_COEFF);
/* Convert that to fixed (but not to DWtype!),
and shift it into the high word. */
- v = (UWtype) b;
+ UDWtype v = (UWtype) b;
v <<= WORD_SIZE;
/* Remove high part from the TFtype, leaving the low part as flonum. */
a -= (TFtype)v;
@@ -1200,17 +1146,14 @@ __fixtfdi (TFtype a)
DWtype
__fixunsxfDI (XFtype a)
{
- XFtype b;
- UDWtype v;
-
if (a < 0)
return 0;
/* Compute high word of result, as a flonum. */
- b = (a / HIGH_WORD_COEFF);
+ const XFtype b = (a / HIGH_WORD_COEFF);
/* Convert that to fixed (but not to DWtype!),
and shift it into the high word. */
- v = (UWtype) b;
+ UDWtype v = (UWtype) b;
v <<= WORD_SIZE;
/* Remove high part from the XFtype, leaving the low part as flonum. */
a -= (XFtype)v;
@@ -1242,17 +1185,15 @@ __fixxfdi (XFtype a)
DWtype
__fixunsdfDI (DFtype a)
{
- UWtype hi, lo;
-
/* Get high part of result. The division here will just moves the radix
point and will not cause any rounding. Then the conversion to integral
type chops result as desired. */
- hi = a / HIGH_WORD_COEFF;
+ const UWtype hi = a / HIGH_WORD_COEFF;
/* Get low part of result. Convert `hi' to floating type and scale it back,
then subtract this from the number being converted. This leaves the low
part. Convert that to integral type. */
- lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
+ const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
/* Assemble result from the two parts. */
return ((UDWtype) hi << WORD_SIZE) | lo;
@@ -1279,18 +1220,17 @@ __fixunssfDI (SFtype original_a)
/* Convert the SFtype to a DFtype, because that is surely not going
to lose any bits. Some day someone else can write a faster version
that avoids converting to DFtype, and verify it really works right. */
- DFtype a = original_a;
- UWtype hi, lo;
+ const DFtype a = original_a;
/* Get high part of result. The division here will just moves the radix
point and will not cause any rounding. Then the conversion to integral
type chops result as desired. */
- hi = a / HIGH_WORD_COEFF;
+ const UWtype hi = a / HIGH_WORD_COEFF;
/* Get low part of result. Convert `hi' to floating type and scale it back,
then subtract this from the number being converted. This leaves the low
part. Convert that to integral type. */
- lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
+ const UWtype lo = (a - ((DFtype) hi) * HIGH_WORD_COEFF);
/* Assemble result from the two parts. */
return ((UDWtype) hi << WORD_SIZE) | lo;
@@ -1315,9 +1255,7 @@ __fixsfdi (SFtype a)
XFtype
__floatdixf (DWtype u)
{
- XFtype d;
-
- d = (Wtype) (u >> WORD_SIZE);
+ XFtype d = (Wtype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
@@ -1334,9 +1272,7 @@ __floatdixf (DWtype u)
TFtype
__floatditf (DWtype u)
{
- TFtype d;
-
- d = (Wtype) (u >> WORD_SIZE);
+ TFtype d = (Wtype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
@@ -1353,9 +1289,7 @@ __floatditf (DWtype u)
DFtype
__floatdidf (DWtype u)
{
- DFtype d;
-
- d = (Wtype) (u >> WORD_SIZE);
+ DFtype d = (Wtype) (u >> WORD_SIZE);
d *= HIGH_HALFWORD_COEFF;
d *= HIGH_HALFWORD_COEFF;
d += (UWtype) (u & (HIGH_WORD_COEFF - 1));
@@ -1376,11 +1310,6 @@ __floatdidf (DWtype u)
SFtype
__floatdisf (DWtype u)
{
- /* Do the calculation in DFmode
- so that we don't lose any of the precision of the high word
- while multiplying it. */
- DFtype f;
-
/* Protect against double-rounding error.
Represent any low-order bits, that might be truncated in DFmode,
by a bit that won't be lost. The bit can go in anywhere below the
@@ -1401,7 +1330,10 @@ __floatdisf (DWtype u)
}
}
}
- f = (Wtype) (u >> WORD_SIZE);
+ /* Do the calculation in DFmode
+ so that we don't lose any of the precision of the high word
+ while multiplying it. */
+ DFtype f = (Wtype) (u >> WORD_SIZE);
f *= HIGH_HALFWORD_COEFF;
f *= HIGH_HALFWORD_COEFF;
f += (UWtype) (u & (HIGH_WORD_COEFF - 1));
@@ -1510,7 +1442,7 @@ __gcc_bcmp (const unsigned char *s1, const unsigned char *s2, size_t size)
{
while (size > 0)
{
- unsigned char c1 = *s1++, c2 = *s2++;
+ const unsigned char c1 = *s1++, c2 = *s2++;
if (c1 != c2)
return c1 - c2;
size--;
@@ -1690,8 +1622,9 @@ __do_global_ctors (void)
For systems which support a .init section we use the .init section
to run __do_global_ctors, so we need not do anything here. */
+extern void SYMBOL__MAIN (void);
void
-SYMBOL__MAIN ()
+SYMBOL__MAIN (void)
{
/* Support recursive calls to `main': run initializers just once. */
static int initialized;
diff --git a/gcc/libgcc2.h b/gcc/libgcc2.h
index 7f608d66080..0bd6d2eac6d 100644
--- a/gcc/libgcc2.h
+++ b/gcc/libgcc2.h
@@ -69,15 +69,15 @@ typedef unsigned int UQItype __attribute__ ((mode (QI)));
typedef int HItype __attribute__ ((mode (HI)));
typedef unsigned int UHItype __attribute__ ((mode (HI)));
#if MIN_UNITS_PER_WORD > 1
-/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1 */
+/* These typedefs are usually forbidden on dsp's with UNITS_PER_WORD 1. */
typedef int SItype __attribute__ ((mode (SI)));
typedef unsigned int USItype __attribute__ ((mode (SI)));
#if LONG_LONG_TYPE_SIZE > 32
-/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 2 */
+/* 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
-/* These typedefs are usually forbidden on archs with UNITS_PER_WORD 4 */
+/* 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)));
#endif
diff --git a/gcc/line-map.c b/gcc/line-map.c
index f04350d7806..521c4e5c843 100644
--- a/gcc/line-map.c
+++ b/gcc/line-map.c
@@ -1,5 +1,5 @@
/* Map logical line numbers to (source file, line number) pairs.
- Copyright (C) 2001
+ Copyright (C) 2001, 2003
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -75,7 +75,7 @@ linemap_free (struct line_maps *set)
const struct line_map *
linemap_add (struct line_maps *set, enum lc_reason reason,
- unsigned int sysp, unsigned int from_line,
+ unsigned int sysp, source_location from_line,
const char *to_file, unsigned int to_line)
{
struct line_map *map;
@@ -166,7 +166,7 @@ linemap_add (struct line_maps *set, enum lc_reason reason,
the list is sorted and we can use a binary search. */
const struct line_map *
-linemap_lookup (struct line_maps *set, unsigned int line)
+linemap_lookup (struct line_maps *set, source_location line)
{
unsigned int md, mn = 0, mx = set->used;
diff --git a/gcc/line-map.h b/gcc/line-map.h
index b53f5e06be6..c57f51a6624 100644
--- a/gcc/line-map.h
+++ b/gcc/line-map.h
@@ -1,5 +1,5 @@
/* Map logical line numbers to (source file, line number) pairs.
- Copyright (C) 2001
+ Copyright (C) 2001, 2003
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
@@ -32,8 +32,9 @@ enum lc_reason {LC_ENTER = 0, LC_LEAVE, LC_RENAME};
/* A logical line number, i,e, an "index" into a line_map. */
/* Long-term, we want to use this to replace struct location_s (in input.h),
- and effectively typedef fileline location_t. */
-typedef unsigned int fileline;
+ and effectively typedef source_location location_t. */
+typedef unsigned int source_location;
+typedef source_location fileline; /* deprecated name */
/* The logical line FROM_LINE maps to physical source file TO_FILE at
line TO_LINE, and subsequently one-to-one until the next line_map
@@ -47,7 +48,7 @@ struct line_map
{
const char *to_file;
unsigned int to_line;
- fileline from_line;
+ source_location from_line;
int included_from;
ENUM_BITFIELD (lc_reason) reason : CHAR_BIT;
unsigned char sysp;
@@ -92,11 +93,12 @@ extern void linemap_free (struct line_maps *);
maps, so any stored line_map pointers should not be used. */
extern const struct line_map *linemap_add
(struct line_maps *, enum lc_reason, unsigned int sysp,
- fileline from_line, const char *to_file, unsigned int to_line);
+ source_location from_line, const char *to_file, unsigned int to_line);
/* Given a logical line, returns the map from which the corresponding
(source file, line) pair can be deduced. */
-extern const struct line_map *linemap_lookup (struct line_maps *, fileline);
+extern const struct line_map *linemap_lookup
+ (struct line_maps *, source_location);
/* Print the file names and line numbers of the #include commands
which led to the map MAP, if any, to stderr. Nothing is output if
diff --git a/gcc/local-alloc.c b/gcc/local-alloc.c
index c5c2506e9ca..f3caba4f6a6 100644
--- a/gcc/local-alloc.c
+++ b/gcc/local-alloc.c
@@ -108,7 +108,7 @@ struct qty
/* Number of words needed to hold the data in given quantity.
This depends on its machine mode. It is used for these purposes:
- 1. It is used in computing the relative importances of qtys,
+ 1. It is used in computing the relative importance of qtys,
which determines the order in which we look for regs for them.
2. It is used in rules that prevent tying several registers of
different sizes in a way that is geometrically impossible
@@ -809,7 +809,9 @@ update_equiv_regs (void)
{
loop_depth = bb->loop_depth;
- for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb);
+ insn != NEXT_INSN (BB_END (bb));
+ insn = NEXT_INSN (insn))
{
rtx note;
rtx set;
@@ -1023,7 +1025,9 @@ update_equiv_regs (void)
FOR_EACH_BB_REVERSE (bb)
{
loop_depth = bb->loop_depth;
- for (insn = bb->end; insn != PREV_INSN (bb->head); insn = PREV_INSN (insn))
+ for (insn = BB_END (bb);
+ insn != PREV_INSN (BB_HEAD (bb));
+ insn = PREV_INSN (insn))
{
rtx link;
@@ -1117,8 +1121,8 @@ update_equiv_regs (void)
REG_N_CALLS_CROSSED (regno) = 0;
REG_LIVE_LENGTH (regno) = 2;
- if (insn == bb->head)
- bb->head = PREV_INSN (insn);
+ if (insn == BB_HEAD (bb))
+ BB_HEAD (bb) = PREV_INSN (insn);
/* Remember to clear REGNO from all basic block's live
info. */
@@ -1204,13 +1208,13 @@ block_alloc (int b)
/* Count the instructions in the basic block. */
- insn = BLOCK_END (b);
+ insn = BB_END (BASIC_BLOCK (b));
while (1)
{
if (GET_CODE (insn) != NOTE)
if (++insn_count > max_uid)
abort ();
- if (insn == BLOCK_HEAD (b))
+ if (insn == BB_HEAD (BASIC_BLOCK (b)))
break;
insn = PREV_INSN (insn);
}
@@ -1227,7 +1231,7 @@ block_alloc (int b)
and assigns quantities to registers.
It computes which registers to tie. */
- insn = BLOCK_HEAD (b);
+ insn = BB_HEAD (BASIC_BLOCK (b));
while (1)
{
if (GET_CODE (insn) != NOTE)
@@ -1459,7 +1463,7 @@ block_alloc (int b)
IOR_HARD_REG_SET (regs_live_at[2 * insn_number], regs_live);
IOR_HARD_REG_SET (regs_live_at[2 * insn_number + 1], regs_live);
- if (insn == BLOCK_END (b))
+ if (insn == BB_END (BASIC_BLOCK (b)))
break;
insn = NEXT_INSN (insn);
@@ -2289,11 +2293,7 @@ post_mark_life (int regno, enum machine_mode mode, int life, int birth,
int death)
{
int j = HARD_REGNO_NREGS (regno, mode);
-#ifdef HARD_REG_SET
- /* Declare it register if it's a scalar. */
- register
-#endif
- HARD_REG_SET this_reg;
+ HARD_REG_SET this_reg;
CLEAR_HARD_REG_SET (this_reg);
while (--j >= 0)
diff --git a/gcc/longlong.h b/gcc/longlong.h
index 2fb68e7c373..8a7d3dfc083 100644
--- a/gcc/longlong.h
+++ b/gcc/longlong.h
@@ -186,7 +186,7 @@ do { \
UDItype __umulsidi3 (USItype, USItype);
#endif
-#if defined (__arm__) && W_TYPE_SIZE == 32
+#if defined (__arm__) && !defined (__thumb__) && W_TYPE_SIZE == 32
#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
__asm__ ("adds %1, %4, %5\n\tadc %0, %2, %3" \
: "=r" ((USItype) (sh)), \
diff --git a/gcc/loop-init.c b/gcc/loop-init.c
index 13285a31e61..0b882d9e163 100644
--- a/gcc/loop-init.c
+++ b/gcc/loop-init.c
@@ -53,7 +53,9 @@ loop_optimizer_init (FILE *dumpfile)
/* No loops. */
flow_loops_free (loops);
+ free_dominance_info (CDI_DOMINATORS);
free (loops);
+
/* Make chain. */
FOR_EACH_BB (bb)
if (bb->next_bb != EXIT_BLOCK_PTR)
@@ -81,7 +83,7 @@ loop_optimizer_init (FILE *dumpfile)
flow_loops_dump (loops, dumpfile, NULL, 1);
#ifdef ENABLE_CHECKING
- verify_dominators (loops->cfg.dom);
+ verify_dominators (CDI_DOMINATORS);
verify_loop_structure (loops);
#endif
@@ -105,6 +107,7 @@ loop_optimizer_finalize (struct loops *loops, FILE *dumpfile)
/* Clean up. */
flow_loops_free (loops);
+ free_dominance_info (CDI_DOMINATORS);
free (loops);
/* Finalize changes. */
diff --git a/gcc/loop-unroll.c b/gcc/loop-unroll.c
index dde3c7439af..6c796af577c 100644
--- a/gcc/loop-unroll.c
+++ b/gcc/loop-unroll.c
@@ -68,14 +68,12 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static void decide_unrolling_and_peeling (struct loops *, int);
static void peel_loops_completely (struct loops *, int);
-static void decide_peel_simple (struct loops *, struct loop *, int);
-static void decide_peel_once_rolling (struct loops *, struct loop *, int);
-static void decide_peel_completely (struct loops *, struct loop *, int);
-static void decide_unroll_stupid (struct loops *, struct loop *, int);
-static void decide_unroll_constant_iterations (struct loops *,
- struct loop *, int);
-static void decide_unroll_runtime_iterations (struct loops *, struct loop *,
- int);
+static void decide_peel_simple (struct loop *, int);
+static void decide_peel_once_rolling (struct loop *, int);
+static void decide_peel_completely (struct loop *, int);
+static void decide_unroll_stupid (struct loop *, int);
+static void decide_unroll_constant_iterations (struct loop *, int);
+static void decide_unroll_runtime_iterations (struct loop *, int);
static void peel_loop_simple (struct loops *, struct loop *);
static void peel_loop_completely (struct loops *, struct loop *);
static void unroll_loop_stupid (struct loops *, struct loop *);
@@ -140,7 +138,7 @@ unroll_and_peel_loops (struct loops *loops, int flags)
if (check)
{
#ifdef ENABLE_CHECKING
- verify_dominators (loops->cfg.dom);
+ verify_dominators (CDI_DOMINATORS);
verify_loop_structure (loops);
#endif
}
@@ -178,15 +176,15 @@ peel_loops_completely (struct loops *loops, int flags)
loop->ninsns = num_loop_insns (loop);
- decide_peel_once_rolling (loops, loop, flags);
+ decide_peel_once_rolling (loop, flags);
if (loop->lpt_decision.decision == LPT_NONE)
- decide_peel_completely (loops, loop, flags);
+ decide_peel_completely (loop, flags);
if (loop->lpt_decision.decision == LPT_PEEL_COMPLETELY)
{
peel_loop_completely (loops, loop);
#ifdef ENABLE_CHECKING
- verify_dominators (loops->cfg.dom);
+ verify_dominators (CDI_DOMINATORS);
verify_loop_structure (loops);
#endif
}
@@ -254,13 +252,13 @@ decide_unrolling_and_peeling (struct loops *loops, int flags)
/* Try transformations one by one in decreasing order of
priority. */
- decide_unroll_constant_iterations (loops, loop, flags);
+ decide_unroll_constant_iterations (loop, flags);
if (loop->lpt_decision.decision == LPT_NONE)
- decide_unroll_runtime_iterations (loops, loop, flags);
+ decide_unroll_runtime_iterations (loop, flags);
if (loop->lpt_decision.decision == LPT_NONE)
- decide_unroll_stupid (loops, loop, flags);
+ decide_unroll_stupid (loop, flags);
if (loop->lpt_decision.decision == LPT_NONE)
- decide_peel_simple (loops, loop, flags);
+ decide_peel_simple (loop, flags);
loop = next;
}
@@ -269,8 +267,7 @@ decide_unrolling_and_peeling (struct loops *loops, int flags)
/* Decide whether the LOOP is once rolling and suitable for complete
peeling. */
static void
-decide_peel_once_rolling (struct loops *loops, struct loop *loop,
- int flags ATTRIBUTE_UNUSED)
+decide_peel_once_rolling (struct loop *loop, int flags ATTRIBUTE_UNUSED)
{
if (rtl_dump_file)
fprintf (rtl_dump_file, ";; Considering peeling once rolling loop\n");
@@ -284,7 +281,7 @@ decide_peel_once_rolling (struct loops *loops, struct loop *loop,
}
/* Check for simple loops. */
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
/* Check number of iterations. */
@@ -303,8 +300,7 @@ decide_peel_once_rolling (struct loops *loops, struct loop *loop,
/* Decide whether the LOOP is suitable for complete peeling. */
static void
-decide_peel_completely (struct loops *loops, struct loop *loop,
- int flags ATTRIBUTE_UNUSED)
+decide_peel_completely (struct loop *loop, int flags ATTRIBUTE_UNUSED)
{
unsigned npeel;
@@ -352,7 +348,7 @@ decide_peel_completely (struct loops *loops, struct loop *loop,
/* Check for simple loops. */
if (!loop->has_desc)
{
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
}
@@ -441,8 +437,7 @@ peel_loop_completely (struct loops *loops, struct loop *loop)
/* Decide whether to unroll LOOP iterating constant number of times and how much. */
static void
-decide_unroll_constant_iterations (struct loops *loops, struct loop *loop,
- int flags)
+decide_unroll_constant_iterations (struct loop *loop, int flags)
{
unsigned nunroll, nunroll_by_av, best_copies, best_unroll = -1, n_copies, i;
@@ -475,7 +470,7 @@ decide_unroll_constant_iterations (struct loops *loops, struct loop *loop,
/* Check for simple loops. */
if (!loop->has_desc)
{
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
}
@@ -649,8 +644,7 @@ unroll_loop_constant_iterations (struct loops *loops, struct loop *loop)
/* Decide whether to unroll LOOP iterating runtime computable number of times
and how much. */
static void
-decide_unroll_runtime_iterations (struct loops *loops, struct loop *loop,
- int flags)
+decide_unroll_runtime_iterations (struct loop *loop, int flags)
{
unsigned nunroll, nunroll_by_av, i;
@@ -683,7 +677,7 @@ decide_unroll_runtime_iterations (struct loops *loops, struct loop *loop,
/* Check for simple loops. */
if (!loop->has_desc)
{
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
}
@@ -774,7 +768,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
unsigned nldom;
basic_block *ldom;
- nldom = get_dominated_by (loops->cfg.dom, body[i], &ldom);
+ nldom = get_dominated_by (CDI_DOMINATORS, body[i], &ldom);
for (j = 0; j < nldom; j++)
if (!flow_bb_inside_loop_p (loop, ldom[j]))
dom_bbs[n_dom_bbs++] = ldom[j];
@@ -821,7 +815,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
end_sequence ();
/* Precondition the loop. */
- loop_split_edge_with (loop_preheader_edge (loop), init_code, loops);
+ loop_split_edge_with (loop_preheader_edge (loop), init_code);
remove_edges = xcalloc (max_unroll + n_peel + 1, sizeof (edge));
n_remove_edges = 0;
@@ -844,7 +838,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
/* Record the place where switch will be built for preconditioning. */
swtch = loop_split_edge_with (loop_preheader_edge (loop),
- NULL_RTX, loops);
+ NULL_RTX);
for (i = 0; i < n_peel; i++)
{
@@ -862,8 +856,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
j = n_peel - i - (extra_zero_check ? 0 : 1);
p = REG_BR_PROB_BASE / (i + 2);
- preheader = loop_split_edge_with (loop_preheader_edge (loop),
- NULL_RTX, loops);
+ preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX);
label = block_label (preheader);
start_sequence ();
do_compare_rtx_and_jump (copy_rtx (niter), GEN_INT (j), EQ, 0,
@@ -879,8 +872,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
branch_code = get_insns ();
end_sequence ();
- swtch = loop_split_edge_with (swtch->pred, branch_code, loops);
- set_immediate_dominator (loops->cfg.dom, preheader, swtch);
+ swtch = loop_split_edge_with (swtch->pred, branch_code);
+ set_immediate_dominator (CDI_DOMINATORS, preheader, swtch);
swtch->succ->probability = REG_BR_PROB_BASE - p;
e = make_edge (swtch, preheader,
swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP);
@@ -892,8 +885,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
/* Add branch for zero iterations. */
p = REG_BR_PROB_BASE / (max_unroll + 1);
swtch = ezc_swtch;
- preheader = loop_split_edge_with (loop_preheader_edge (loop),
- NULL_RTX, loops);
+ preheader = loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX);
label = block_label (preheader);
start_sequence ();
do_compare_rtx_and_jump (copy_rtx (niter), const0_rtx, EQ, 0,
@@ -909,8 +901,8 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
branch_code = get_insns ();
end_sequence ();
- swtch = loop_split_edge_with (swtch->succ, branch_code, loops);
- set_immediate_dominator (loops->cfg.dom, preheader, swtch);
+ swtch = loop_split_edge_with (swtch->succ, branch_code);
+ set_immediate_dominator (CDI_DOMINATORS, preheader, swtch);
swtch->succ->probability = REG_BR_PROB_BASE - p;
e = make_edge (swtch, preheader,
swtch->succ->flags & EDGE_IRREDUCIBLE_LOOP);
@@ -918,7 +910,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
}
/* Recount dominators for outer blocks. */
- iterate_fix_dominators (loops->cfg.dom, dom_bbs, n_dom_bbs);
+ iterate_fix_dominators (CDI_DOMINATORS, dom_bbs, n_dom_bbs);
/* And unroll loop. */
@@ -946,7 +938,7 @@ unroll_loop_runtime_iterations (struct loops *loops, struct loop *loop)
/* Decide whether to simply peel LOOP and how much. */
static void
-decide_peel_simple (struct loops *loops, struct loop *loop, int flags)
+decide_peel_simple (struct loop *loop, int flags)
{
unsigned npeel;
@@ -975,7 +967,7 @@ decide_peel_simple (struct loops *loops, struct loop *loop, int flags)
/* Check for simple loops. */
if (!loop->has_desc)
{
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
}
@@ -1062,7 +1054,7 @@ peel_loop_simple (struct loops *loops, struct loop *loop)
/* Decide whether to unroll LOOP stupidly and how much. */
static void
-decide_unroll_stupid (struct loops *loops, struct loop *loop, int flags)
+decide_unroll_stupid (struct loop *loop, int flags)
{
unsigned nunroll, nunroll_by_av, i;
@@ -1095,7 +1087,7 @@ decide_unroll_stupid (struct loops *loops, struct loop *loop, int flags)
/* Check for simple loops. */
if (!loop->has_desc)
{
- loop->simple = simple_loop_p (loops, loop, &loop->desc);
+ loop->simple = simple_loop_p (loop, &loop->desc);
loop->has_desc = 1;
}
diff --git a/gcc/loop-unswitch.c b/gcc/loop-unswitch.c
index c1971c6f4c0..4cfaa2f6255 100644
--- a/gcc/loop-unswitch.c
+++ b/gcc/loop-unswitch.c
@@ -81,7 +81,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
static struct loop *unswitch_loop (struct loops *, struct loop *,
basic_block);
static void unswitch_single_loop (struct loops *, struct loop *, rtx, int);
-static bool may_unswitch_on_p (struct loops *, basic_block, struct loop *,
+static bool may_unswitch_on_p (basic_block, struct loop *,
basic_block *);
static rtx reversed_condition (rtx);
@@ -107,7 +107,7 @@ unswitch_loops (struct loops *loops)
unswitch_single_loop (loops, loop, NULL_RTX, 0);
#ifdef ENABLE_CHECKING
- verify_dominators (loops->cfg.dom);
+ verify_dominators (CDI_DOMINATORS);
verify_loop_structure (loops);
#endif
}
@@ -117,8 +117,7 @@ unswitch_loops (struct loops *loops)
basic blocks (for what it means see comments below). List of basic blocks
inside LOOP is provided in BODY to save time. */
static bool
-may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop,
- basic_block *body)
+may_unswitch_on_p (basic_block bb, struct loop *loop, basic_block *body)
{
rtx test;
unsigned i;
@@ -126,7 +125,7 @@ may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop,
/* BB must end in a simple conditional jump. */
if (!bb->succ || !bb->succ->succ_next || bb->succ->succ_next->succ_next)
return false;
- if (!any_condjump_p (bb->end))
+ if (!any_condjump_p (BB_END (bb)))
return false;
/* With branches inside loop. */
@@ -136,17 +135,17 @@ may_unswitch_on_p (struct loops *loops, basic_block bb, struct loop *loop,
/* It must be executed just once each iteration (because otherwise we
are unable to update dominator/irreducible loop information correctly). */
- if (!just_once_each_iteration_p (loops, loop, bb))
+ if (!just_once_each_iteration_p (loop, bb))
return false;
/* Condition must be invariant. We use just a stupid test of invariantness
of the condition: all used regs must not be modified inside loop body. */
- test = get_condition (bb->end, NULL, true);
+ test = get_condition (BB_END (bb), NULL, true);
if (!test)
return false;
for (i = 0; i < loop->num_nodes; i++)
- if (modified_between_p (test, body[i]->head, NEXT_INSN (body[i]->end)))
+ if (modified_between_p (test, BB_HEAD (body[i]), NEXT_INSN (BB_END (body[i]))))
return false;
return true;
@@ -239,7 +238,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
/* Find a bb to unswitch on. */
bbs = get_loop_body (loop);
for (i = 0; i < loop->num_nodes; i++)
- if (may_unswitch_on_p (loops, bbs[i], loop, bbs))
+ if (may_unswitch_on_p (bbs[i], loop, bbs))
break;
if (i == loop->num_nodes)
@@ -248,7 +247,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
return;
}
- if (!(cond = get_condition (bbs[i]->end, &split_before, true)))
+ if (!(cond = get_condition (BB_END (bbs[i]), &split_before, true)))
abort ();
rcond = reversed_condition (cond);
@@ -295,7 +294,7 @@ unswitch_single_loop (struct loops *loops, struct loop *loop,
rconds = cond_checked;
/* Separate condition in a single basic block. */
- bb = split_loop_bb (loops, bbs[i], PREV_INSN (split_before))->dest;
+ bb = split_loop_bb (bbs[i], PREV_INSN (split_before))->dest;
free (bbs);
true_first = !(bb->succ->flags & EDGE_FALLTHRU);
if (rtl_dump_file)
@@ -335,7 +334,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on)
if (!unswitch_on->succ || !unswitch_on->succ->succ_next ||
unswitch_on->succ->succ_next->succ_next)
abort ();
- if (!just_once_each_iteration_p (loops, loop, unswitch_on))
+ if (!just_once_each_iteration_p (loop, unswitch_on))
abort ();
if (loop->inner)
abort ();
@@ -345,7 +344,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on)
abort ();
/* Will we be able to perform redirection? */
- if (!any_condjump_p (unswitch_on->end))
+ if (!any_condjump_p (BB_END (unswitch_on)))
return NULL;
if (!cfg_layout_can_duplicate_bb_p (unswitch_on))
return NULL;
@@ -382,7 +381,7 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on)
switch_bb->succ->flags &= ~EDGE_IRREDUCIBLE_LOOP;
switch_bb->succ->succ_next->flags &= ~EDGE_IRREDUCIBLE_LOOP;
}
- add_to_dominance_info (loops->cfg.dom, switch_bb);
+ add_to_dominance_info (CDI_DOMINATORS, switch_bb);
unswitch_on->rbi->copy = unswitch_on_alt;
/* Loopify from the copy of LOOP body, constructing the new loop. */
@@ -402,5 +401,9 @@ unswitch_loop (struct loops *loops, struct loop *loop, basic_block unswitch_on)
fix_loop_placement (loop);
fix_loop_placement (nloop);
+ /* Preserve the simple loop preheaders. */
+ loop_split_edge_with (loop_preheader_edge (loop), NULL_RTX);
+ loop_split_edge_with (loop_preheader_edge (nloop), NULL_RTX);
+
return nloop;
}
diff --git a/gcc/loop.c b/gcc/loop.c
index 667833d64a5..4ee83447a69 100644
--- a/gcc/loop.c
+++ b/gcc/loop.c
@@ -255,6 +255,7 @@ static void count_one_set (struct loop_regs *, rtx, rtx, rtx *);
static void note_addr_stored (rtx, rtx, void *);
static void note_set_pseudo_multiple_uses (rtx, rtx, void *);
static int loop_reg_used_before_p (const struct loop *, rtx, rtx);
+static rtx find_regs_nested (rtx, rtx);
static void scan_loop (struct loop*, int);
#if 0
static void replace_call_address (rtx, rtx, rtx);
@@ -573,6 +574,32 @@ next_insn_in_loop (const struct loop *loop, rtx insn)
return insn;
}
+/* Find any register references hidden inside X and add them to
+ the dependency list DEPS. This is used to look inside CLOBBER (MEM
+ when checking whether a PARALLEL can be pulled out of a loop. */
+
+static rtx
+find_regs_nested (rtx deps, rtx x)
+{
+ enum rtx_code code = GET_CODE (x);
+ if (code == REG)
+ deps = gen_rtx_EXPR_LIST (VOIDmode, x, deps);
+ else
+ {
+ const char *fmt = GET_RTX_FORMAT (code);
+ int i, j;
+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
+ {
+ if (fmt[i] == 'e')
+ deps = find_regs_nested (deps, XEXP (x, i));
+ else if (fmt[i] == 'E')
+ for (j = 0; j < XVECLEN (x, i); j++)
+ deps = find_regs_nested (deps, XVECEXP (x, i, j));
+ }
+ }
+ return deps;
+}
+
/* Optimize one loop described by LOOP. */
/* ??? Could also move memory writes out of loops if the destination address
@@ -776,7 +803,9 @@ scan_loop (struct loop *loop, int flags)
}
/* For parallels, add any possible uses to the dependencies, as
- we can't move the insn without resolving them first. */
+ we can't move the insn without resolving them first.
+ MEMs inside CLOBBERs may also reference registers; these
+ count as implicit uses. */
if (GET_CODE (PATTERN (p)) == PARALLEL)
{
for (i = 0; i < XVECLEN (PATTERN (p), 0); i++)
@@ -786,6 +815,10 @@ scan_loop (struct loop *loop, int flags)
dependencies
= gen_rtx_EXPR_LIST (VOIDmode, XEXP (x, 0),
dependencies);
+ else if (GET_CODE (x) == CLOBBER
+ && GET_CODE (XEXP (x, 0)) == MEM)
+ dependencies = find_regs_nested (dependencies,
+ XEXP (XEXP (x, 0), 0));
}
}
@@ -2113,7 +2146,8 @@ move_movables (struct loop *loop, struct loop_movables *movables,
/* The SET_SRC might not be invariant, so we must
use the REG_EQUAL note. */
start_sequence ();
- emit_move_insn (m->set_dest, m->set_src);
+ emit_move_insn (m->insert_temp ? newreg : m->set_dest,
+ m->set_src);
seq = get_insns ();
end_sequence ();
@@ -3298,8 +3332,14 @@ loop_invariant_p (const struct loop *loop, rtx x)
return 0;
/* Out-of-range regs can occur when we are called from unrolling.
- These have always been created by the unroller and are set in
- the loop, hence are never invariant. */
+ These registers created by the unroller are set in the loop,
+ hence are never invariant.
+ Other out-of-range regs can be generated by load_mems; those that
+ are written to in the loop are not invariant, while those that are
+ not written to are invariant. It would be easy for load_mems
+ to set n_times_set correctly for these registers, however, there
+ is no easy way to distinguish them from registers created by the
+ unroller. */
if (REGNO (x) >= (unsigned) regs->num)
return 0;
@@ -5647,7 +5687,7 @@ record_biv (struct loop *loop, struct induction *v, rtx insn, rtx dest_reg,
/* Set initial value to the reg itself. */
bl->initial_value = dest_reg;
bl->final_value = 0;
- /* We haven't seen the initializing insn yet */
+ /* We haven't seen the initializing insn yet. */
bl->init_insn = 0;
bl->init_set = 0;
bl->initial_test = 0;
@@ -6095,6 +6135,10 @@ update_giv_derive (const struct loop *loop, rtx p)
if (GET_CODE (p) == CODE_LABEL || GET_CODE (p) == JUMP_INSN
|| biv->insn == p)
{
+ /* Skip if location is the same as a previous one. */
+ if (biv->same)
+ continue;
+
for (giv = bl->giv; giv; giv = giv->next_iv)
{
/* If cant_derive is already true, there is no point in
@@ -6223,7 +6267,7 @@ basic_induction_var (const struct loop *loop, rtx x, enum machine_mode mode,
/* convert_modes can emit new instructions, e.g. when arg is a loop
invariant MEM and dest_reg has a different mode.
These instructions would be emitted after the end of the function
- and then *inc_val would be an unitialized pseudo.
+ and then *inc_val would be an uninitialized pseudo.
Detect this and bail in this case.
Other alternatives to solve this can be introducing a convert_modes
variant which is allowed to fail but not allowed to emit new
@@ -7196,6 +7240,9 @@ express_from (struct induction *g1, struct induction *g2)
&& GET_CODE (g2->mult_val) == CONST_INT)
{
if (g1->mult_val == const0_rtx
+ || (g1->mult_val == constm1_rtx
+ && INTVAL (g2->mult_val)
+ == (HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1))
|| INTVAL (g2->mult_val) % INTVAL (g1->mult_val) != 0)
return NULL_RTX;
mult = GEN_INT (INTVAL (g2->mult_val) / INTVAL (g1->mult_val));
@@ -8017,6 +8064,22 @@ check_dbra_loop (struct loop *loop, int insn_count)
break;
}
+ /* Try swapping the comparison to identify a suitable biv. */
+ if (!bl)
+ for (bl = ivs->list; bl; bl = bl->next)
+ if (bl->biv_count == 1
+ && ! bl->biv->maybe_multiple
+ && bl->biv->dest_reg == XEXP (comparison, 1)
+ && ! reg_used_between_p (regno_reg_rtx[bl->regno], bl->biv->insn,
+ first_compare))
+ {
+ comparison = gen_rtx_fmt_ee (swap_condition (GET_CODE (comparison)),
+ VOIDmode,
+ XEXP (comparison, 1),
+ XEXP (comparison, 0));
+ break;
+ }
+
if (! bl)
return 0;
@@ -10678,18 +10741,18 @@ loop_dump_aux (const struct loop *loop, FILE *file,
/* Print diagnostics to compare our concept of a loop with
what the loop notes say. */
- if (! PREV_INSN (loop->first->head)
- || GET_CODE (PREV_INSN (loop->first->head)) != NOTE
- || NOTE_LINE_NUMBER (PREV_INSN (loop->first->head))
+ if (! PREV_INSN (BB_HEAD (loop->first))
+ || GET_CODE (PREV_INSN (BB_HEAD (loop->first))) != NOTE
+ || NOTE_LINE_NUMBER (PREV_INSN (BB_HEAD (loop->first)))
!= NOTE_INSN_LOOP_BEG)
fprintf (file, ";; No NOTE_INSN_LOOP_BEG at %d\n",
- INSN_UID (PREV_INSN (loop->first->head)));
- if (! NEXT_INSN (loop->last->end)
- || GET_CODE (NEXT_INSN (loop->last->end)) != NOTE
- || NOTE_LINE_NUMBER (NEXT_INSN (loop->last->end))
+ INSN_UID (PREV_INSN (BB_HEAD (loop->first))));
+ if (! NEXT_INSN (BB_END (loop->last))
+ || GET_CODE (NEXT_INSN (BB_END (loop->last))) != NOTE
+ || NOTE_LINE_NUMBER (NEXT_INSN (BB_END (loop->last)))
!= NOTE_INSN_LOOP_END)
fprintf (file, ";; No NOTE_INSN_LOOP_END at %d\n",
- INSN_UID (NEXT_INSN (loop->last->end)));
+ INSN_UID (NEXT_INSN (BB_END (loop->last))));
if (loop->start)
{
diff --git a/gcc/machmode.def b/gcc/machmode.def
index 0b762497d00..0b6c6771dba 100644
--- a/gcc/machmode.def
+++ b/gcc/machmode.def
@@ -47,7 +47,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
A MODE argument must be the printable name of a machine mode,
without quotation marks or trailing "mode". For instance, SI.
- A BITSIZE, BYTESIZE, or COUNT argument must be a positive integer
+ A PRECISION, BYTESIZE, or COUNT argument must be a positive integer
constant.
A FORMAT argument must be one of the real_mode_format structures
@@ -78,18 +78,18 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
declares MODE to be of class INT and BYTESIZE bytes wide.
All of the bits of its representation are significant.
- FRACTIONAL_INT_MODE (MODE, BITSIZE, BYTESIZE);
+ FRACTIONAL_INT_MODE (MODE, PRECISION, BYTESIZE);
declares MODE to be of class INT, BYTESIZE bytes wide in
- storage, but with only BITSIZE significant bits.
+ storage, but with only PRECISION significant bits.
FLOAT_MODE (MODE, BYTESIZE, FORMAT);
declares MODE to be of class FLOAT and BYTESIZE bytes wide,
using floating point format FORMAT.
All of the bits of its representation are significant.
- FRACTIONAL_FLOAT_MODE (MODE, BITSIZE, BYTESIZE, FORMAT);
+ FRACTIONAL_FLOAT_MODE (MODE, PRECISION, BYTESIZE, FORMAT);
declares MODE to be of class FLOAT, BYTESIZE bytes wide in
- storage, but with only BITSIZE significant bits, using
+ storage, but with only PRECISION significant bits, using
floating point format FORMAT.
RESET_FLOAT_FORMAT (MODE, FORMAT);
@@ -101,7 +101,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
declares a mode of class PARTIAL_INT with the same size as
MODE (which must be an INT mode). The name of the new mode
is made by prefixing a P to the name MODE. This statement
- may grow a BITSIZE argument in the future.
+ may grow a PRECISION argument in the future.
VECTOR_MODE (CLASS, MODE, COUNT);
Declare a vector mode whose component mode is MODE (of class
diff --git a/gcc/machmode.h b/gcc/machmode.h
index 16f979818c3..c978c0a9b52 100644
--- a/gcc/machmode.h
+++ b/gcc/machmode.h
@@ -76,15 +76,15 @@ extern const unsigned char mode_class[NUM_MACHINE_MODES];
#define SCALAR_FLOAT_MODE_P(MODE) \
(GET_MODE_CLASS (MODE) == MODE_FLOAT)
-/* Get the size in bytes of an object of mode MODE. */
+/* Get the size in bytes and bits of an object of mode MODE. */
extern CONST_MODE_SIZE unsigned char mode_size[NUM_MACHINE_MODES];
-#define GET_MODE_SIZE(MODE) mode_size[MODE]
+#define GET_MODE_SIZE(MODE) ((unsigned short) mode_size[MODE])
+#define GET_MODE_BITSIZE(MODE) ((unsigned short) (GET_MODE_SIZE (MODE) * BITS_PER_UNIT))
-/* Get the size in bits of an object of mode MODE. */
-
-extern const unsigned short mode_bitsize[NUM_MACHINE_MODES];
-#define GET_MODE_BITSIZE(MODE) mode_bitsize[MODE]
+/* Get the number of value bits of an object of mode MODE. */
+extern const unsigned short mode_precision[NUM_MACHINE_MODES];
+#define GET_MODE_PRECISION(MODE) mode_precision[MODE]
/* Get a bitmask containing 1 for all bits in a word
that fit within mode MODE. */
diff --git a/gcc/mklibgcc.in b/gcc/mklibgcc.in
index 28ea8532fa7..72c6c226986 100644
--- a/gcc/mklibgcc.in
+++ b/gcc/mklibgcc.in
@@ -388,6 +388,7 @@ EOF
fi
shlib_so_name="$shlib_base_name"
shlib_dir=
+ shlib_slibdir_qual=
if [ -n "$MULTILIB_OSDIRNAMES" ]; then
if [ "$dir" != . ]; then
gcc_multilib_dir=`./xgcc -B./ $flags --print-multi-directory`
@@ -397,8 +398,12 @@ EOF
os_multilib_base=`echo $os_multilib_dir | sed -n "s~/${gcc_multilib_sup}\$~~p"`
if [ -z "$os_multilib_base" ]; then
shlib_so_name=libgcc_s
+ if [ "$os_multilib_dir" != "." ]; then
+ shlib_slibdir_qual="/$os_multilib_dir"
+ fi
else
shlib_so_name=libgcc_s_`echo $gcc_multilib_sup | sed s,/,_,g`
+ shlib_slibdir_qual="/$os_multilib_base"
fi
fi
fi
@@ -411,7 +416,8 @@ EOF
-e "s%@shlib_base_name@%$shlib_base_name%g" \
-e "s%@shlib_map_file@%$mapfile%g" \
-e "s%@shlib_so_name@%$shlib_so_name%g" \
- -e "s%@shlib_dir@%$shlib_dir%g"
+ -e "s%@shlib_dir@%$shlib_dir%g" \
+ -e "s%@shlib_slibdir_qual@%%g"
elif [ "$SHLIB_MULTILIB" = "$dir" ]; then
shlib_base_name="libgcc_s";
echo ""
@@ -423,7 +429,8 @@ EOF
-e "s%@shlib_base_name@%$shlib_base_name%g" \
-e "s%@shlib_map_file@%$mapfile%g" \
-e "s%@shlib_so_name@%$shlib_base_name%g" \
- -e "s%@shlib_dir@%%g"
+ -e "s%@shlib_dir@%%g" \
+ -e "s%@shlib_slibdir_qual@%%g"
fi
fi
done
diff --git a/gcc/objc/.cvsignore b/gcc/objc/.cvsignore
deleted file mode 100644
index 040661a9677..00000000000
--- a/gcc/objc/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-objc-parse.y
-objc-parse.c
diff --git a/gcc/objc/Make-lang.in b/gcc/objc/Make-lang.in
index cdacd4e79a4..fe92a50cf03 100644
--- a/gcc/objc/Make-lang.in
+++ b/gcc/objc/Make-lang.in
@@ -25,7 +25,7 @@
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
# foo.uninstall,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -104,7 +104,10 @@ objc.start.encap:
objc.rest.encap:
objc.tags: force
- cd $(srcdir)/objc; etags *.y *.c *.h
+ cd $(srcdir)/objc; etags -o TAGS.sub *.y *.c *.h; \
+ etags --include TAGS.sub --include ../TAGS.sub
+
+lang_checks += check-objc
#
# Install hooks:
@@ -131,7 +134,6 @@ objc.distclean:
-rm -f objc/Makefile objc/Make-host objc/Make-target
-rm -f objc/config.status objc/config.cache
-rm -f objc-parse.output
-objc.extraclean:
objc.maintainer-clean:
-rm -f $(parsedir)/objc/objc-parse.y
-rm -f $(parsedir)/objc/objc-parse.c $(parsedir)/objc/objc-parse.output
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index ad2b69a9f56..c552bada9de 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -5654,7 +5654,7 @@ build_message_expr (tree mess)
/* Look up method SEL_NAME that would be suitable for receiver
of type 'id' (if IS_CLASS is zero) or 'Class' (if IS_CLASS is
- non-zero), and report on any duplicates. */
+ nonzero), and report on any duplicates. */
static tree
lookup_method_in_hash_lists (tree sel_name, int is_class)
diff --git a/gcc/optabs.c b/gcc/optabs.c
index 1410ed2d209..3a5705f9334 100644
--- a/gcc/optabs.c
+++ b/gcc/optabs.c
@@ -5371,7 +5371,7 @@ init_optabs (void)
abs_optab->handlers[TYPE_MODE (complex_double_type_node)].libfunc
= init_one_libfunc ("cabs");
- /* The ffs function op[1erates on `int'. */
+ /* The ffs function operates on `int'. */
ffs_optab->handlers[(int) mode_for_size (INT_TYPE_SIZE, MODE_INT, 0)].libfunc
= init_one_libfunc ("ffs");
diff --git a/gcc/opts.c b/gcc/opts.c
index dafd37104b4..e0583691e13 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -148,6 +148,13 @@ static unsigned int columns = 80;
/* What to print when a switch has no documentation. */
static const char undocumented_msg[] = N_("This switch lacks documentation");
+/* Used for bookkeeping on whether user set these flags so
+ -fprofile-use/-fprofile-generate does not use them. */
+static bool profile_arc_flag_set, flag_profile_values_set;
+static bool flag_unroll_loops_set, flag_tracer_set;
+static bool flag_value_profile_transformations_set;
+static bool flag_peel_loops_set, flag_branch_probabilities_set;
+
/* Input file names. */
const char **in_fnames;
unsigned num_in_fnames;
@@ -882,6 +889,7 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_fbranch_probabilities:
+ flag_branch_probabilities_set = true;
flag_branch_probabilities = value;
break;
@@ -1023,10 +1031,6 @@ common_handle_option (size_t scode, const char *arg,
flag_gcse_las = value;
break;
- case OPT_fgnu_linker:
- flag_gnu_linker = value;
- break;
-
case OPT_fguess_branch_probability:
flag_guess_branch_prob = value;
break;
@@ -1057,7 +1061,6 @@ common_handle_option (size_t scode, const char *arg,
case OPT_finline_limit_:
case OPT_finline_limit_eq:
- set_param_value ("max-inline-insns", value);
set_param_value ("max-inline-insns-single", value / 2);
set_param_value ("max-inline-insns-auto", value / 2);
set_param_value ("max-inline-insns-rtl", value);
@@ -1140,6 +1143,7 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_fpeel_loops:
+ flag_peel_loops_set = true;
flag_peel_loops = value;
break;
@@ -1172,14 +1176,41 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_fprofile_arcs:
+ profile_arc_flag_set = true;
profile_arc_flag = value;
break;
+ case OPT_fprofile_use:
+ if (!flag_branch_probabilities_set)
+ flag_branch_probabilities = value;
+ if (!flag_profile_values_set)
+ flag_profile_values = value;
+ if (!flag_unroll_loops_set)
+ flag_unroll_loops = value;
+ if (!flag_peel_loops_set)
+ flag_peel_loops = value;
+ if (!flag_tracer_set)
+ flag_tracer = value;
+ if (!flag_value_profile_transformations_set)
+ flag_value_profile_transformations = value;
+ break;
+
+ case OPT_fprofile_generate:
+ if (!profile_arc_flag_set)
+ profile_arc_flag = value;
+ if (!flag_profile_values_set)
+ flag_profile_values = value;
+ if (!flag_value_profile_transformations_set)
+ flag_value_profile_transformations = value;
+ break;
+
case OPT_fprofile_values:
+ flag_profile_values_set = true;
flag_profile_values = value;
break;
case OPT_fvpt:
+ flag_value_profile_transformations_set = value;
flag_value_profile_transformations = value;
break;
@@ -1300,18 +1331,6 @@ common_handle_option (size_t scode, const char *arg,
flag_single_precision_constant = value;
break;
- case OPT_fssa:
- flag_ssa = value;
- break;
-
- case OPT_fssa_ccp:
- flag_ssa_ccp = value;
- break;
-
- case OPT_fssa_dce:
- flag_ssa_dce = value;
- break;
-
case OPT_fstack_check:
flag_stack_check = value;
break;
@@ -1375,6 +1394,7 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_ftracer:
+ flag_tracer_set = true;
flag_tracer = value;
break;
@@ -1395,6 +1415,7 @@ common_handle_option (size_t scode, const char *arg,
break;
case OPT_funroll_loops:
+ flag_unroll_loops_set = true;
flag_unroll_loops = value;
break;
@@ -1438,19 +1459,6 @@ common_handle_option (size_t scode, const char *arg,
set_debug_level (SDB_DEBUG, false, arg);
break;
- case OPT_gdwarf:
- if (*arg)
- {
- error ("use -gdwarf -gN for DWARF v1 level N, "
- "and -gdwarf-2 for DWARF v2" );
- break;
- }
-
- /* Fall through. */
- case OPT_gdwarf_:
- set_debug_level (DWARF_DEBUG, code == OPT_gdwarf_, arg);
- break;
-
case OPT_gdwarf_2:
set_debug_level (DWARF2_DEBUG, false, arg);
break;
@@ -1846,7 +1854,7 @@ wrap_help (const char *help, const char *item, unsigned int item_width)
len = i;
else if ((help[i] == '-' || help[i] == '/')
&& help[i + 1] != ' '
- && ISALPHA (help[i - 1]))
+ && i > 0 && ISALPHA (help[i - 1]))
len = i + 1;
}
}
diff --git a/gcc/params.def b/gcc/params.def
index b08603b1f29..d665ad57ba4 100644
--- a/gcc/params.def
+++ b/gcc/params.def
@@ -39,7 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
of a function counted in internal gcc instructions (not in
real machine instructions) that is eligible for inlining
by the tree inliner.
- The default value is 100.
+ The default value is 500.
Only functions marked inline (or methods defined in the class
definition for C++) are affected by this, unless you set the
-finline-functions (included in -O3) compiler option.
@@ -59,31 +59,12 @@ DEFPARAM (PARAM_MAX_INLINE_INSNS_SINGLE,
that is applied to functions marked inlined (or defined in the
class declaration in C++) given by the "max-inline-insns-single"
parameter.
- The default value is 100. */
+ The default value is 150. */
DEFPARAM (PARAM_MAX_INLINE_INSNS_AUTO,
"max-inline-insns-auto",
"The maximum number of instructions when automatically inlining",
150)
-/* The repeated inlining limit. After this number of instructions
- (in the internal gcc representation, not real machine instructions)
- got inlined by repeated inlining, gcc starts to decrease the maximum
- number of inlinable instructions in the tree inliner.
- This is done by a linear function, see "max-inline-slope" parameter.
- It is necessary in order to limit the compile-time resources, that
- could otherwise become very high.
- It is recommended to set this value to twice the value of the single
- function limit (set by the "max-inline-insns-single" parameter) or
- higher. The default value is 200.
- Higher values mean that more inlining is done, resulting in
- better performance of the code, at the expense of higher
- compile-time resource (time, memory) requirements and larger
- binaries. */
-DEFPARAM (PARAM_MAX_INLINE_INSNS,
- "max-inline-insns",
- "The maximum number of instructions by repeated inlining before gcc starts to throttle inlining",
- 200)
-
/* For languages that (still) use the RTL inliner, we can specify
limits for the RTL inliner separately.
The parameter here defines the maximum number of RTL instructions
diff --git a/gcc/po/ChangeLog b/gcc/po/ChangeLog
index 3989883e4e0..2c5543ee9f6 100644
--- a/gcc/po/ChangeLog
+++ b/gcc/po/ChangeLog
@@ -1,3 +1,16 @@
+2003-12-19 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * de.po: Update.
+
+2003-11-26 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * de.po: Update.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * exgettext: Use --copyright-holder and --msgid-bugs-address.
+ * gcc.pot: Regenerate.
+
2003-10-26 Joseph S. Myers <jsm@polyomino.org.uk>
* nl.po: Update.
diff --git a/gcc/po/de.po b/gcc/po/de.po
index a2eea254424..31dd8b570e9 100644
--- a/gcc/po/de.po
+++ b/gcc/po/de.po
@@ -1,16 +1,15 @@
# German translation of gcc messages.
# Copyright © 2002, 2003 Free Software Foundation, Inc.
# Karl Eichwalder <ke@suse.de>, 2002, 2003.
+# Roland Stigge <stigge@antcom.de>, 2003.
# This file is distributed under the same license as the gcc package.
#
-# Wer möchte an dieser Übersetzung arbeiten? Bitte bei de@li.org melden!
-#
msgid ""
msgstr ""
-"Project-Id-Version: gcc 3.3-b20021230\n"
+"Project-Id-Version: gcc 3.3.2\n"
"POT-Creation-Date: 2003-10-24 13:20+0200\n"
-"PO-Revision-Date: 2003-01-06 20:10+0100\n"
-"Last-Translator: Karl Eichwalder <ke@suse.de>\n"
+"PO-Revision-Date: 2003-12-15 21:30+0100\n"
+"Last-Translator: Roland Stigge <stigge@antcom.de>\n"
"Language-Team: German <de@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
@@ -29,12 +28,12 @@ msgstr "falsche Anzahl an Argumenten für das Attribut »%s« angegeben"
#: attribs.c:210
#, c-format
msgid "`%s' attribute does not apply to types"
-msgstr ""
+msgstr "Attribut »%s« kann nicht auf Typen angewandt werden"
#: attribs.c:247
#, c-format
msgid "`%s' attribute only applies to function types"
-msgstr ""
+msgstr "Attribut »%s« kann nur auf Funktionstypen angewandt werden"
#: attribs.c:404 c-common.c:5275 c-common.c:5297 c-common.c:5319
#: c-common.c:5350 c-common.c:5372 c-common.c:5397 c-common.c:5423
@@ -51,23 +50,23 @@ msgstr "Attribut »%s« wird ignoriert"
#: builtins.c:285
msgid "offset outside bounds of constant string"
-msgstr ""
+msgstr "Adressabstand ist außerhalb der Grenzen der konstanten Zeichenkette"
#: builtins.c:765
msgid "second arg to `__builtin_prefetch' must be a constant"
-msgstr ""
+msgstr "Zweites Argument für »__builtin_prefetch« muss eine Konstante sein"
#: builtins.c:772
msgid "invalid second arg to __builtin_prefetch; using zero"
-msgstr ""
+msgstr "Ungültiges zweites Argument für »__builtin_prefetch«; benutze Null"
#: builtins.c:779
msgid "third arg to `__builtin_prefetch' must be a constant"
-msgstr ""
+msgstr "Drittes Argument für »__builtin_prefetch« muss eine Konstante sein"
#: builtins.c:786
msgid "invalid third arg to __builtin_prefetch; using zero"
-msgstr ""
+msgstr "Ungültiges drittes Argument für »__builtin_prefetch«; benutze Null"
#. ??? We used to try and build up a call to the out of line function,
#. guessing about what registers needed saving etc. This became much
@@ -78,41 +77,41 @@ msgstr ""
#. weird and make the backend absorb the evil.
#: builtins.c:2875
msgid "__builtin_saveregs not supported by this target"
-msgstr ""
+msgstr "__builtin_saveregs wird von diesem Ziel nicht unterstützt"
#: builtins.c:2917
msgid "argument of `__builtin_args_info' must be constant"
-msgstr ""
+msgstr "Argument von »__builtin_args_info« muss konstant sein"
#: builtins.c:2923
msgid "argument of `__builtin_args_info' out of range"
-msgstr ""
+msgstr "Argument von »__builtin_args_info« außerhalb des Wertebereichs"
#: builtins.c:2929
msgid "missing argument in `__builtin_args_info'"
-msgstr ""
+msgstr "Fehlendes Argument in »__builtin_args_info«"
#: builtins.c:2960
msgid "`va_start' used in function with fixed args"
-msgstr ""
+msgstr "»va_start« in Funktion mit fester Parameterzahl verwendet"
#: builtins.c:2979
msgid "second parameter of `va_start' not last named argument"
-msgstr ""
+msgstr "Zweiter Parameter von »va_start« ist nicht letztgenanntes Argument"
#. 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:2984
msgid "`__builtin_next_arg' called without an argument"
-msgstr ""
+msgstr "»__builtin_next_arg« ohne Argument gerufen"
#: builtins.c:3070
msgid "too many arguments to function `va_start'"
-msgstr ""
+msgstr "Zu viele Argumente für »va_start«"
#: builtins.c:3172
msgid "first argument to `va_arg' not of type `va_list'"
-msgstr ""
+msgstr "Erstes Argument für »va_arg« nicht vom Typ »va_list«"
#. Unfortunately, this is merely undefined, rather than a constraint
#. violation, so we cannot make this an error. If this call is never
@@ -120,685 +119,685 @@ msgstr ""
#: builtins.c:3204
#, c-format
msgid "`%s' is promoted to `%s' when passed through `...'"
-msgstr ""
+msgstr "»%s« auf »%s« gesetzt beim Durchlaufen von »...«"
#: builtins.c:3209
#, c-format
msgid "(so you should pass `%s' not `%s' to `va_arg')"
-msgstr ""
+msgstr "(Sie sollten also »%s« statt »%s« an »va_arg« übergeben)"
#: builtins.c:3340
msgid "invalid arg to `__builtin_frame_address'"
-msgstr ""
+msgstr "Ungültiges Argument für »__builtin_frame_address«"
#: builtins.c:3342
msgid "invalid arg to `__builtin_return_address'"
-msgstr ""
+msgstr "Ungültiges Argument für »__builtin_return_address«"
#: builtins.c:3356
msgid "unsupported arg to `__builtin_frame_address'"
-msgstr ""
+msgstr "Nicht unterstütztes Argument für »__builtin_frame_address«"
#: builtins.c:3358
msgid "unsupported arg to `__builtin_return_address'"
-msgstr ""
+msgstr "Nicht unterstütztes Argument für »__builtin_return_address«"
#: builtins.c:3530
msgid "second arg to `__builtin_expect' must be a constant"
-msgstr ""
+msgstr "Zweites Argument für »__builtin_expect« muss eine Konstante sein"
#: builtins.c:4028
msgid "__builtin_longjmp second argument must be 1"
-msgstr ""
+msgstr "Zweites Argument für __builtin_longjmp muss 1 sein"
#. just do library call, if unknown builtin
#: builtins.c:4092 c-common.c:4459
#, c-format
msgid "built-in function `%s' not currently supported"
-msgstr ""
+msgstr "Eingebaute Funktion »%s« gegenwärtig nicht unterstützt"
#: builtins.c:4165
msgid "target format does not support infinity"
-msgstr ""
+msgstr "Zielformat unterstützt nicht »unendlich«"
#: c-common.c:1168
#, c-format
msgid "`%s' is not defined outside of function scope"
-msgstr ""
+msgstr "»%s« ist außerhalb des Funktionsgültigkeitsbereiches undefiniert"
#: c-common.c:1189
#, c-format
msgid "string length `%d' is greater than the length `%d' ISO C%d compilers are required to support"
-msgstr ""
+msgstr "Zeichenkettenlänge »%d« ist größer als die Länge »%d«, die von ISO-C%d-Compilern unterstützt werden muss"
#: c-common.c:1247
msgid "concatenation of string literals with __FUNCTION__ is deprecated"
-msgstr ""
+msgstr "Verkettung von Zeichenkettenliteralen mit __FUNCTION__ ist veraltet"
#: c-common.c:1343
msgid "overflow in constant expression"
-msgstr ""
+msgstr "Ãœberlauf in Konstanten-Ausdruck"
#: c-common.c:1364
msgid "integer overflow in expression"
-msgstr ""
+msgstr "Ganzzahlüberlauf in Ausdruck"
#: c-common.c:1373
msgid "floating point overflow in expression"
-msgstr ""
+msgstr "Fließkommaüberlauf in Ausdruck"
#: c-common.c:1379
msgid "vector overflow in expression"
-msgstr ""
+msgstr "Vektorüberlauf in Ausdruck"
#. This detects cases like converting -129 or 256 to unsigned char.
#: c-common.c:1402
msgid "large integer implicitly truncated to unsigned type"
-msgstr ""
+msgstr "Große Ganzzahl implizit auf vorzeichenlosen Typen abgeschnitten"
#: c-common.c:1404
msgid "negative integer implicitly converted to unsigned type"
-msgstr ""
+msgstr "Negative Ganzzahl implizit in vorzeichenlosen Typen konvertiert"
#: c-common.c:1452
msgid "overflow in implicit constant conversion"
-msgstr ""
+msgstr "Ãœberlauf in impliziter Konstantenkonvertierung"
#: c-common.c:1600
#, c-format
msgid "operation on `%s' may be undefined"
-msgstr ""
+msgstr "Operation auf »%s« könnte undefiniert sein"
#: c-common.c:1891
msgid "expression statement has incomplete type"
-msgstr ""
+msgstr "Ausdrucksanweisung hat unvollständigen Typ"
#: c-common.c:1924
msgid "case label does not reduce to an integer constant"
-msgstr ""
+msgstr "case-Marke reduziert nicht auf Ganzzahlkonstante"
#: c-common.c:2228
msgid "invalid truth-value expression"
-msgstr ""
+msgstr "Ungültiger Wahrheitswert-Ausdruck"
#: c-common.c:2279
#, c-format
msgid "invalid operands to binary %s"
-msgstr ""
+msgstr "Ungültige Operanden für binäres %s"
#: c-common.c:2513
msgid "comparison is always false due to limited range of data type"
-msgstr ""
+msgstr "Vergleich ist durch beschränkten Wertebereich des Datentyps stets »unwahr«"
#: c-common.c:2515
msgid "comparison is always true due to limited range of data type"
-msgstr ""
+msgstr "Vergleich ist durch beschränkten Wertebereich des Datentyps stets »wahr«"
#: c-common.c:2585
msgid "comparison of unsigned expression >= 0 is always true"
-msgstr ""
+msgstr "Vergleich eines vorzeichenlosen Ausdrucks >= 0 ist stets »wahr«"
#: c-common.c:2594
msgid "comparison of unsigned expression < 0 is always false"
-msgstr ""
+msgstr "Vergleich eines vorzeichenlosen Ausdrucks < 0 ist stets »unwahr«"
#: c-common.c:2641
msgid "pointer of type `void *' used in arithmetic"
-msgstr ""
+msgstr "Zeiger auf Typen »void *« in Arithmetik verwendet"
#: c-common.c:2647
msgid "pointer to a function used in arithmetic"
-msgstr ""
+msgstr "Zeiger auf Funktion in Arithmetik verwendet"
#: c-common.c:2653
msgid "pointer to member function used in arithmetic"
-msgstr ""
+msgstr "Zeiger auf member-Funktion in Arithmetik verwendet"
#: c-common.c:2659
msgid "pointer to a member used in arithmetic"
-msgstr ""
+msgstr "Zeiger auf member in Arithmetik verwendet"
#: c-common.c:2746 f/com.c:14762
msgid "struct type value used where scalar is required"
-msgstr ""
+msgstr "Wert eines struct-Typs anstelle des geforderten Skalars verwendet"
#: c-common.c:2750 f/com.c:14766
msgid "union type value used where scalar is required"
-msgstr ""
+msgstr "Wert eines union-Typs anstelle des geforderten Skalars verwendet"
#: c-common.c:2754 f/com.c:14770
msgid "array type value used where scalar is required"
-msgstr ""
+msgstr "Wert eines array-Typs anstelle des geforderten Skalars verwendet"
#: c-common.c:2874 f/com.c:14903
msgid "suggest parentheses around assignment used as truth value"
-msgstr ""
+msgstr "Schlage Klammern um Zuweisung, die als Wahrheitswert verwendet wird, vor"
#: c-common.c:2918 c-common.c:2950
msgid "invalid use of `restrict'"
-msgstr ""
+msgstr "Ungültige Verwendung von »restrict«"
#: c-common.c:3064
msgid "invalid application of `sizeof' to a function type"
-msgstr ""
+msgstr "Ungültige Anwendung von »sizeof« auf einen Funktionstypen"
#: c-common.c:3074
#, c-format
msgid "invalid application of `%s' to a void type"
-msgstr ""
+msgstr "Ungültige Anwendung von »%s« auf einen void-Typen"
#: c-common.c:3080
#, c-format
msgid "invalid application of `%s' to an incomplete type"
-msgstr ""
+msgstr "Ungültige Anwendung von »%s« auf einen unvollständigen Typen"
#: c-common.c:3121
msgid "`__alignof' applied to a bit-field"
-msgstr ""
+msgstr "»__alignof« auf Bitfeld angewandt"
#: c-common.c:3618
#, c-format
msgid "cannot disable built-in function `%s'"
-msgstr ""
+msgstr "Kann eingebaute Funktion »%s« nicht abschalten"
#: c-common.c:3787 c-typeck.c:1748
#, c-format
msgid "too few arguments to function `%s'"
-msgstr ""
+msgstr "Zu wenig Argumente für Funktion »%s«"
#: c-common.c:3793 c-typeck.c:1601
#, c-format
msgid "too many arguments to function `%s'"
-msgstr ""
+msgstr "Zu viele Argumente für Funktion »%s«"
#: c-common.c:3812
#, c-format
msgid "non-floating-point argument to function `%s'"
-msgstr ""
+msgstr "Nicht-Fließkomma-Argument für Funktion »%s«"
#: c-common.c:4081
msgid "pointers are not permitted as case values"
-msgstr ""
+msgstr "Zeiger sind nicht als case-Werte zugelassen"
#: c-common.c:4087
msgid "ISO C++ forbids range expressions in switch statements"
-msgstr ""
+msgstr "ISO-C++ verbietet Wertebereichsausdrücke in switch-Anweisungen"
#: c-common.c:4089
msgid "ISO C forbids range expressions in switch statements"
-msgstr ""
+msgstr "ISO-C verbietet Wertebereichsausdrücke in switch-Anweisungen"
#: c-common.c:4119
msgid "empty range specified"
-msgstr ""
+msgstr "Leerer Wertebereich angegeben"
#: c-common.c:4170
msgid "duplicate (or overlapping) case value"
-msgstr ""
+msgstr "Doppelte (oder sich überschneidende) case-Werte"
#: c-common.c:4172
msgid "this is the first entry overlapping that value"
-msgstr ""
+msgstr "Dies ist der erste Eintrag, der diesen Wert überschneidet"
#: c-common.c:4176
msgid "duplicate case value"
-msgstr ""
+msgstr "Doppelter case-Wert"
#: c-common.c:4177
msgid "previously used here"
-msgstr ""
+msgstr "bereits hier verwendet"
#: c-common.c:4181
msgid "multiple default labels in one switch"
-msgstr ""
+msgstr "Mehrere Standardmarken in einem »switch«"
#: c-common.c:4182
msgid "this is the first default label"
-msgstr ""
+msgstr "Dies ist die erste Standardmarke"
#: c-common.c:4210
msgid "ISO C++ forbids taking the address of a label"
-msgstr ""
+msgstr "ISO-C++ verbietet die Adresse einer Marke"
#: c-common.c:4212
msgid "ISO C forbids taking the address of a label"
-msgstr ""
+msgstr "ISO-C verbietet die Adresse einer Marke"
#: c-common.c:5235
#, c-format
msgid "declaration of `%s' shadows %s"
-msgstr ""
+msgstr "Deklaration von »%s« verdeckt %s"
#: c-common.c:5654
#, c-format
msgid "unknown machine mode `%s'"
-msgstr ""
+msgstr "Unbekannter Maschinenzustand »%s«"
#: c-common.c:5657
#, c-format
msgid "no data type for mode `%s'"
-msgstr ""
+msgstr "Kein Datentyp für Zustand »%s«"
#: c-common.c:5666 c-common.c:6316
#, c-format
msgid "unable to emulate '%s'"
-msgstr ""
+msgstr "»%s« kann nicht emuliert werden"
#: c-common.c:5702
msgid "section attribute cannot be specified for local variables"
-msgstr ""
+msgstr "Abschnitts-Attribut kann nicht für lokale Variablen angegeben werden"
#: c-common.c:5713
#, c-format
msgid "section of `%s' conflicts with previous declaration"
-msgstr ""
+msgstr "Abschnitt von »%s« in Konflikt mit vorheriger Deklaration"
#: c-common.c:5722
#, c-format
msgid "section attribute not allowed for `%s'"
-msgstr ""
+msgstr "Abschnitts-Attribute nicht erlaubt für »%s«"
#: c-common.c:5729
msgid "section attributes are not supported for this target"
-msgstr ""
+msgstr "Abschnitts-Attribute werden für dieses Ziel nicht unterstützt"
#: c-common.c:5771
msgid "requested alignment is not a constant"
-msgstr ""
+msgstr "Verlangte Ausrichtung ist keine Konstante"
#: c-common.c:5776
msgid "requested alignment is not a power of 2"
-msgstr ""
+msgstr "Verlangte Ausrichtung ist keine Zweierpotenz"
#: c-common.c:5781
msgid "requested alignment is too large"
-msgstr ""
+msgstr "Verlangte Ausrichtung ist zu groß"
#: c-common.c:5808
#, c-format
msgid "alignment may not be specified for `%s'"
-msgstr ""
+msgstr "Für »%s« darf keine Ausrichtung angegeben werden"
#: c-common.c:5853
#, c-format
msgid "`%s' defined both normally and as an alias"
-msgstr ""
+msgstr "»%s« sowohl normal als auch als Alias definiert"
#: c-common.c:5863
msgid "alias arg not a string"
-msgstr ""
+msgstr "Alias-Argument ist keine Zeichenkette"
#: c-common.c:5910
msgid "visibility arg not a string"
-msgstr ""
+msgstr "Sichtbarkeitsargument ist keine Zeichenkette"
#: c-common.c:5919
msgid "visibility arg must be one of \"default\", \"hidden\", \"protected\" or \"internal\""
-msgstr ""
+msgstr "Sichtbarkeitsargument muss »default«, »hidden«, »protected« oder »internal« sein"
#: c-common.c:5953
msgid "tls_model arg not a string"
-msgstr ""
+msgstr "Argument für tls_model ist keine Zeichenkette"
#: c-common.c:5962
msgid "tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-dynamic\" or \"global-dynamic\""
-msgstr ""
+msgstr "Argument für tls_model muss »local-exec«, »initial-exec«, »local-dynamic« oder »global-dynamic« sein"
#: c-common.c:5987 c-common.c:6043
#, c-format
msgid "`%s' attribute applies only to functions"
-msgstr ""
+msgstr "Attribut »%s« kann nur auf Funktionen angewandt werden"
#: c-common.c:5994 c-common.c:6050
#, c-format
msgid "can't set `%s' attribute after definition"
-msgstr ""
+msgstr "Kann Attribut »%s« nicht nach der Definition setzen"
#: c-common.c:6114
msgid "cleanup arg not an identifier"
-msgstr ""
+msgstr "Argument für cleanup ist kein Bezeichner"
#: c-common.c:6121
msgid "cleanup arg not a function"
-msgstr ""
+msgstr "Argument für cleanup ist keine Funktion"
#: c-common.c:6183
#, c-format
msgid "`%s' attribute ignored for `%s'"
-msgstr ""
+msgstr "Attribut »%s« ignoriert für »%s«"
#: c-common.c:6248
#, c-format
msgid "invalid vector type for attribute `%s'"
-msgstr ""
+msgstr "Ungültiger Vektortyp für Attribut »%s«"
#: c-common.c:6272 c-common.c:6304
msgid "no vector mode with the size and type specified could be found"
-msgstr ""
+msgstr "Vektorzustand mit der angegebenen Größe und dem angegebenen Typ konnte nicht gefunden werden"
#: c-common.c:6403
msgid "nonnull attribute without arguments on a non-prototype"
-msgstr ""
+msgstr "Nicht-Null-Attribut ohne Argumente für einen Nicht-Prototyp"
#: c-common.c:6418
#, c-format
msgid "nonnull argument has invalid operand number (arg %lu)"
-msgstr ""
+msgstr "Nicht-Null-Argument hat ungültige Operandenzahl (Argument %lu)"
#: c-common.c:6437
#, c-format
msgid "nonnull argument with out-of-range operand number (arg %lu, operand %lu)"
-msgstr ""
+msgstr "Nicht-Null-Argument mit Operandenzahl außerhalb des Wertebereiches (Argument %lu, Operand %lu)"
#: c-common.c:6445
#, c-format
msgid "nonnull argument references non-pointer operand (arg %lu, operand %lu)"
-msgstr ""
+msgstr "Nicht-Null-Argument referenziert Nicht-Zeiger-Operanden (Argument %lu, Operand %lu)"
#: c-common.c:6531
#, c-format
msgid "null argument where non-null required (arg %lu)"
-msgstr ""
+msgstr "Null-Argument, wo Nicht-Null erwartet (Argument %lu)"
#: c-convert.c:80 c-typeck.c:988 c-typeck.c:4059 cp/typeck.c:1615
#: cp/typeck.c:5939
msgid "void value not ignored as it ought to be"
-msgstr ""
+msgstr "void-Wert nicht ignoriert wie es sein sollte"
#: c-convert.c:112 java/typeck.c:150
msgid "conversion to non-scalar type requested"
-msgstr ""
+msgstr "Konvertierung zu Nicht-Skalar-Typ verlangt"
#: c-decl.c:340
#, c-format
msgid "array `%s' assumed to have one element"
-msgstr ""
+msgstr "Feld »%s« als einelementig betrachtet"
#: c-decl.c:526
#, c-format
msgid "`struct %s' incomplete in scope ending here"
-msgstr ""
+msgstr "»struct %s« im Gültigkeitsbereich, der hier endet, unvollständig"
#: c-decl.c:529
#, c-format
msgid "`union %s' incomplete in scope ending here"
-msgstr ""
+msgstr "»union %s« im Gültigkeitsbereich, der hier endet, unvollständig"
#: c-decl.c:532
#, c-format
msgid "`enum %s' incomplete in scope ending here"
-msgstr ""
+msgstr "»enum %s« im Gültigkeitsbereich, der hier endet, unvollständig"
#: c-decl.c:646 c-decl.c:771 java/decl.c:1403
#, c-format
msgid "label `%s' used but not defined"
-msgstr ""
+msgstr "Marke »%s« verwendet, aber nicht definiert"
#: c-decl.c:652 c-decl.c:778 java/decl.c:1409
#, c-format
msgid "label `%s' defined but not used"
-msgstr ""
+msgstr "Marke »%s« definiert aber nicht verwendet"
#: c-decl.c:893 cp/decl.c:3335
#, c-format
msgid "function `%s' redeclared as inline"
-msgstr ""
+msgstr "Funktion »%s« als inline redeklariert"
#: c-decl.c:895 cp/decl.c:3337
#, c-format
msgid "previous declaration of function `%s' with attribute noinline"
-msgstr ""
+msgstr "Vorherige Deklaration der Funktion »%s« mit Attribut noinline"
#: c-decl.c:902 cp/decl.c:3344
#, c-format
msgid "function `%s' redeclared with attribute noinline"
-msgstr ""
+msgstr "Funktion »%s« redeklariert mit Attribut noinline"
#: c-decl.c:904 cp/decl.c:3346
#, c-format
msgid "previous declaration of function `%s' was inline"
-msgstr ""
+msgstr "Vorherige Deklaration der Funktion »%s« war inline"
#: c-decl.c:933 c-decl.c:979
#, c-format
msgid "shadowing built-in function `%s'"
-msgstr ""
+msgstr "Eingebaute Funktion »%s« überdeckt"
#: c-decl.c:935
#, c-format
msgid "shadowing library function `%s'"
-msgstr ""
+msgstr "Bibliotheksfunktion »%s« überdeckt"
#: c-decl.c:941
#, c-format
msgid "library function `%s' declared as non-function"
-msgstr ""
+msgstr "Bibliotheksfunktion »%s« als Nicht-Funktion deklariert"
#: c-decl.c:945 c-decl.c:948
#, c-format
msgid "built-in function `%s' declared as non-function"
-msgstr ""
+msgstr "Eingebaute Funktion »%s« als Nicht-Funktion deklariert"
#: c-decl.c:952 objc/objc-act.c:2384 objc/objc-act.c:6154
#, c-format
msgid "`%s' redeclared as different kind of symbol"
-msgstr ""
+msgstr "»%s« redeklariert als andere Symbolart"
#: c-decl.c:953 c-decl.c:1144 c-decl.c:1158 c-decl.c:1165 c-decl.c:1310
#: objc/objc-act.c:2386 objc/objc-act.c:6156 objc/objc-act.c:6211
#, c-format
msgid "previous declaration of `%s'"
-msgstr ""
+msgstr "Vorherige Deklaration von »%s«"
#. If types don't match for a built-in, throw away the built-in.
#: c-decl.c:1048
#, c-format
msgid "conflicting types for built-in function `%s'"
-msgstr ""
+msgstr "In Konflikt stehende Typen für eingebaute Funktion »%s«"
#: c-decl.c:1091 c-decl.c:1110
#, c-format
msgid "conflicting types for `%s'"
-msgstr ""
+msgstr "In Konflikt stehende Typen für »%s«"
#: c-decl.c:1133
msgid "a parameter list with an ellipsis can't match an empty parameter name list declaration"
-msgstr ""
+msgstr "Eine Parameterliste mit Auslassung passt nicht zu einer leeren Parameternamenslistendeklaration"
#: c-decl.c:1139
msgid "an argument type that has a default promotion can't match an empty parameter name list declaration"
-msgstr ""
+msgstr "Ein Argumenttyp mit Standard-promotion passt nicht zu leerer Parameternamenslistendeklaration"
#: c-decl.c:1157
#, c-format
msgid "thread-local declaration of `%s' follows non thread-local declaration"
-msgstr ""
+msgstr "Thread-lokale Deklaration von »%s« folgt nicht-Thread-lokaler Deklaration"
#: c-decl.c:1164
#, c-format
msgid "non thread-local declaration of `%s' follows thread-local declaration"
-msgstr ""
+msgstr "Nicht-Thread-lokale Deklaration von »%s« folgt Thread-lokaler Deklaration"
#: c-decl.c:1175 c-decl.c:1198
#, c-format
msgid "redefinition of `%s'"
-msgstr ""
+msgstr "Redefinition von »%s«"
#: c-decl.c:1178
#, c-format
msgid "redeclaration of `%s'"
-msgstr ""
+msgstr "Redeklaration von »%s«"
#: c-decl.c:1181
#, c-format
msgid "conflicting declarations of `%s'"
-msgstr ""
+msgstr "In Konflikt stehende Deklarationen von »%s«"
#: c-decl.c:1225
#, c-format
msgid "prototype for `%s' follows"
-msgstr ""
+msgstr "Prototyp für »%s« folgt"
#: c-decl.c:1226 c-decl.c:1234 c-decl.c:1245
msgid "non-prototype definition here"
-msgstr ""
+msgstr "Nicht-Prototyp-Definition hier"
#: c-decl.c:1233
#, c-format
msgid "prototype for `%s' follows and number of arguments doesn't match"
-msgstr ""
+msgstr "Prototyp für »%s« folgt und Anzahl der Argumente passt nicht"
#: c-decl.c:1243
#, c-format
msgid "prototype for `%s' follows and argument %d doesn't match"
-msgstr ""
+msgstr "Prototyp für »%s« folgt und Argument %d passt nicht"
#: c-decl.c:1261
#, c-format
msgid "`%s' declared inline after being called"
-msgstr ""
+msgstr "»%s« als inline deklariert nachdem es aufgerufen wurde"
#: c-decl.c:1267
#, c-format
msgid "`%s' declared inline after its definition"
-msgstr ""
+msgstr "»%s« nach der Definition als inline deklariert"
#: c-decl.c:1274
#, c-format
msgid "static declaration for `%s' follows non-static"
-msgstr ""
+msgstr "Statische Deklaration für »%s« folgt Nicht-static"
#: c-decl.c:1282
#, c-format
msgid "non-static declaration for `%s' follows static"
-msgstr ""
+msgstr "Nicht-static-Deklaration für »%s« folgt static"
#: c-decl.c:1289
#, c-format
msgid "const declaration for `%s' follows non-const"
-msgstr ""
+msgstr "const-Deklaration für »%s« folgt Nicht-const"
#: c-decl.c:1296
#, c-format
msgid "type qualifiers for `%s' conflict with previous decl"
-msgstr ""
+msgstr "Typ-Kennzeichner für »%s« stehen in Konflikt mit vorheriger Deklaration"
#: c-decl.c:1309
#, c-format
msgid "redundant redeclaration of `%s' in same scope"
-msgstr ""
+msgstr "Redundante Redeklaration von »%s« im selben Gültigkeitsbereich"
#: c-decl.c:1619 java/decl.c:1102
#, c-format
msgid "declaration of `%s' shadows a parameter"
-msgstr ""
+msgstr "Deklaration von »%s« überdeckt einen Parameter"
#: c-decl.c:1622 java/decl.c:1105
#, c-format
msgid "declaration of `%s' shadows a symbol from the parameter list"
-msgstr ""
+msgstr "Deklaration von »%s« überdeckt ein Symbol aus der Parameterliste"
#: c-decl.c:1643 cp/decl.c:4479
msgid "a parameter"
-msgstr ""
+msgstr "Ein Parameter"
#: c-decl.c:1645 cp/decl.c:4496
msgid "a previous local"
-msgstr ""
+msgstr "Ein vorheriges »local«"
#. XXX shadow warnings in outer-more namespaces
#: c-decl.c:1649 cp/decl.c:4500
msgid "a global declaration"
-msgstr ""
+msgstr "Eine globale Deklaration"
#: c-decl.c:1693
#, c-format
msgid "nested extern declaration of `%s'"
-msgstr ""
+msgstr "Geschachtelte extern-Deklaration von »%s«"
#: c-decl.c:1712 java/decl.c:1055
#, c-format
msgid "`%s' used prior to declaration"
-msgstr ""
+msgstr "»%s« bereits vor Deklaration benutzt"
#: c-decl.c:1726 c-decl.c:1901
#, c-format
msgid "`%s' was declared implicitly `extern' and later `static'"
-msgstr ""
+msgstr "»%s« wurde implizit als »extern« und später als »static« deklariert"
#: c-decl.c:1829 cp/decl.c:4336
msgid "type mismatch with previous external decl"
-msgstr ""
+msgstr "Typen passen nicht zu vorheriger externer Deklaration"
#: c-decl.c:1830
#, c-format
msgid "previous external decl of `%s'"
-msgstr ""
+msgstr "Vorherige externe Deklaration von »%s«"
#: c-decl.c:1843
msgid "type mismatch with previous implicit declaration"
-msgstr ""
+msgstr "Typen passen nicht zu vorheriger impliziter Deklaration"
#: c-decl.c:1845
#, c-format
msgid "previous implicit declaration of `%s'"
-msgstr ""
+msgstr "Vorherige implizite Deklaration von »%s«"
#: c-decl.c:1880
#, c-format
msgid "`%s' was previously implicitly declared to return `int'"
-msgstr ""
+msgstr "»%s« wurde bereits implizit deklariert, »int« zurückzugeben"
#: c-decl.c:1905
#, c-format
msgid "`%s' was declared `extern' and later `static'"
-msgstr ""
+msgstr "»%s« wurde »extern« deklariert und später »static«"
#: c-decl.c:1929
#, c-format
msgid "extern declaration of `%s' doesn't match global one"
-msgstr ""
+msgstr "extern-Deklaration von »%s« passt nicht zu globaler Deklaration"
#: c-decl.c:1971
#, c-format
msgid "`%s' locally external but globally static"
-msgstr ""
+msgstr "»%s« ist lokal extern, aber global »static«"
#: c-decl.c:2095
#, c-format
msgid "function `%s' was previously declared within a block"
-msgstr ""
+msgstr "Funktion »%s« wurde bereits innerhalb eines Blockes deklariert"
#: c-decl.c:2115 c-decl.c:2117
#, c-format
msgid "implicit declaration of function `%s'"
-msgstr ""
+msgstr "Implizite Deklaration der Funktion »%s«"
#: c-decl.c:2196
#, c-format
msgid "label %s referenced outside of any function"
-msgstr ""
+msgstr "Marke %s außerhalb einer Funktion referenziert"
#: c-decl.c:2253
#, c-format
msgid "duplicate label declaration `%s'"
-msgstr ""
+msgstr "Doppelte Markendeklaration »%s«"
#: c-decl.c:2256
msgid "this is a previous declaration"
-msgstr ""
+msgstr "Dies ist eine vorherige Deklaration"
#: c-decl.c:2679
msgid "unnamed struct/union that defines no instances"
-msgstr ""
+msgstr "Unbenannte struct/union, die keine Instanzen definiert"
#: c-decl.c:2698
msgid "useless keyword or type name in empty declaration"
-msgstr ""
+msgstr "Nutzloses Schlüsselwort oder Typenname in leerer Deklaration"
#: c-decl.c:2705
msgid "two types specified in one empty declaration"
-msgstr ""
+msgstr "Zwei Typen in einer leeren Deklaration angegeben"
#: c-decl.c:2710 c-parse.y:753 c-parse.y:755 parse.y:766 parse.y:1853
#: objc-parse.y:799 objc-parse.y:801 objc-parse.y:3042
@@ -807,100 +806,99 @@ msgstr "leere Deklaration"
#: c-decl.c:2740
msgid "ISO C90 does not support `static' or type qualifiers in parameter array declarators"
-msgstr ""
+msgstr "ISO-C90 unterstützt kein »static« oder Typkennzeichner in Parameterfelddeklaratoren"
#: c-decl.c:2742
-#, fuzzy
msgid "ISO C90 does not support `[*]' array declarators"
-msgstr "ISO C89 unterstützt nicht »long long«"
+msgstr "ISO-C90 unterstützt nicht »[*]«-Felddeklaratoren"
#: c-decl.c:2745
msgid "GCC does not yet properly implement `[*]' array declarators"
-msgstr ""
+msgstr "GCC implementiert nocht keine richtigen »[*]«-Felddeklaratoren"
#: c-decl.c:2764
msgid "static or type qualifiers in abstract declarator"
-msgstr ""
+msgstr "static oder Typkennzeichner in abstraktem Deklarator"
#: c-decl.c:2838
#, c-format
msgid "`%s' is usually a function"
-msgstr ""
+msgstr "»%s« ist üblicherweise eine Funktion"
#: c-decl.c:2847
#, c-format
msgid "typedef `%s' is initialized (use __typeof__ instead)"
-msgstr ""
+msgstr "typedef »%s« ist initialisiert (benutzen Sie stattdessen __typeof__)"
#: c-decl.c:2853
#, c-format
msgid "function `%s' is initialized like a variable"
-msgstr ""
+msgstr "Funktion »%s« ist wie eine Variable initialisiert"
#. DECL_INITIAL in a PARM_DECL is really DECL_ARG_TYPE.
#: c-decl.c:2860
#, c-format
msgid "parameter `%s' is initialized"
-msgstr ""
+msgstr "Parameter »%s« ist initialisiert"
#: c-decl.c:2880 c-typeck.c:4895
msgid "variable-sized object may not be initialized"
-msgstr ""
+msgstr "Objekt variabler Größe darf nicht initialisiert werden"
#: c-decl.c:2886
#, c-format
msgid "variable `%s' has initializer but incomplete type"
-msgstr ""
+msgstr "Variable »%s« hat Initialisierung aber unvollständigen Typ"
#: c-decl.c:2892
#, c-format
msgid "elements of array `%s' have incomplete type"
-msgstr ""
+msgstr "Elemente des Feldes »%s« haben unvollständigen Typ"
#: c-decl.c:2905
#, c-format
msgid "declaration of `%s' has `extern' and is initialized"
-msgstr ""
+msgstr "Deklaration von »%s« hat »extern« und ist initialisiert"
#: c-decl.c:2954 c-decl.c:5828 cp/decl.c:7760 cp/decl.c:14339
#, c-format
msgid "inline function `%s' given attribute noinline"
-msgstr ""
+msgstr "inline-Funktion »%s« wurde das Attribut »noinline« gegeben"
#: c-decl.c:3028
#, c-format
msgid "initializer fails to determine size of `%s'"
-msgstr ""
+msgstr "Initialisierung scheitert an Größenbestimmung von »%s«"
#: c-decl.c:3033
#, c-format
msgid "array size missing in `%s'"
-msgstr ""
+msgstr "Feldgröße in »%s« fehlt"
#: c-decl.c:3049
#, c-format
msgid "zero or negative size array `%s'"
-msgstr ""
+msgstr "Feldgröße von »%s« ist null oder negativ"
#: c-decl.c:3077
#, c-format
msgid "storage size of `%s' isn't known"
-msgstr ""
+msgstr "Speichergröße von »%s« unbekannt"
#: c-decl.c:3087
#, c-format
msgid "storage size of `%s' isn't constant"
-msgstr ""
+msgstr "Speichergröße von »%s« unbekannt"
#: c-decl.c:3147
#, c-format
msgid "ignoring asm-specifier for non-static local variable `%s'"
-msgstr ""
+msgstr "Ignoriere asm-Symbol für lokale Nicht-static Variable »%s«"
#: c-decl.c:3247
#, c-format
msgid "ISO C forbids parameter `%s' shadowing typedef"
-msgstr ""
+msgstr "ISO-C verbietet typedef verdeckenden Parameter »%s«"
#: c-decl.c:3592 cp/decl.c:10880
msgid "`long long long' is too long for GCC"
@@ -908,1100 +906,1099 @@ msgstr "»long long long« ist für GCC zu lang"
#: c-decl.c:3597
msgid "ISO C90 does not support `long long'"
-msgstr "ISO C90 unterstützt nicht »long long«"
+msgstr "ISO-C90 unterstützt nicht »long long«"
#: c-decl.c:3606 c-decl.c:3609 cp/decl.c:10885
#, c-format
msgid "duplicate `%s'"
-msgstr ""
+msgstr "Doppeltes »%s«"
#: c-decl.c:3619 cp/decl.c:10892
msgid "`__thread' before `extern'"
-msgstr ""
+msgstr "»__thread« vor »extern«"
#: c-decl.c:3621 cp/decl.c:10894
msgid "`__thread' before `static'"
-msgstr ""
+msgstr "»__thread« vor »static«"
#: c-decl.c:3629 cp/decl.c:10921
#, c-format
msgid "two or more data types in declaration of `%s'"
-msgstr ""
+msgstr "Zwei oder mehr Datentypen in Deklaration von »%s«"
#: c-decl.c:3649 cp/decl.c:10926
#, c-format
msgid "`%s' fails to be a typedef or built in type"
-msgstr ""
+msgstr "»%s« ist kein typedef oder eingebauter Typ"
#: c-decl.c:3688
#, c-format
msgid "type defaults to `int' in declaration of `%s'"
-msgstr ""
+msgstr "»int« ist Standardtyp in Deklaration von »%s«"
#: c-decl.c:3717
#, c-format
msgid "both long and short specified for `%s'"
-msgstr ""
+msgstr "Sowohl »long« als auch »short« für »%s« angegeben"
#: c-decl.c:3721 cp/decl.c:11041
#, c-format
msgid "long or short specified with char for `%s'"
-msgstr ""
+msgstr "»long« oder »short« mit »char« für »%s« angegeben"
#: c-decl.c:3728 cp/decl.c:11045
#, c-format
msgid "long or short specified with floating type for `%s'"
-msgstr ""
+msgstr "»long« oder »short« mit Fließkommatyp für »%s« angegeben"
#: c-decl.c:3731
msgid "the only valid combination is `long double'"
-msgstr ""
+msgstr "Die einzig gültige Kombination ist »long double«"
#: c-decl.c:3737
#, c-format
msgid "both signed and unsigned specified for `%s'"
-msgstr ""
+msgstr "Sowohl »signed« als auch »unsigned« für »%s« angegeben"
#: c-decl.c:3739 cp/decl.c:11034
#, c-format
msgid "long, short, signed or unsigned invalid for `%s'"
-msgstr ""
+msgstr "long, short, signed oder unsigned ist ungültig für »%s«"
#: c-decl.c:3745 cp/decl.c:11054
#, c-format
msgid "long, short, signed or unsigned used invalidly for `%s'"
-msgstr ""
+msgstr "long, short, signed oder unsigned ungültig verwendet für »%s«"
#: c-decl.c:3763 cp/decl.c:11075
#, c-format
msgid "complex invalid for `%s'"
-msgstr ""
+msgstr "complex ungültig für »%s«"
#: c-decl.c:3805
msgid "ISO C90 does not support complex types"
-msgstr "ISO C90 unterstützt nicht komplexe Typen"
+msgstr "ISO-C90 unterstützt nicht komplexe Typen"
#: c-decl.c:3817
msgid "ISO C does not support plain `complex' meaning `double complex'"
-msgstr ""
+msgstr "ISO-C unterstützt nicht »double complex« bedeutendes »complex«"
#: c-decl.c:3823 c-decl.c:3835
msgid "ISO C does not support complex integer types"
-msgstr ""
+msgstr "ISO-C unterstützt keine komplexen Ganzzahltypen"
#: c-decl.c:3850 c-decl.c:4316 cp/decl.c:11688
msgid "duplicate `const'"
-msgstr ""
+msgstr "Doppeltes »const«"
#: c-decl.c:3852 c-decl.c:4320 cp/decl.c:11692
msgid "duplicate `restrict'"
-msgstr ""
+msgstr "Doppeltes »restrict«"
#: c-decl.c:3854 c-decl.c:4318 cp/decl.c:11690
msgid "duplicate `volatile'"
-msgstr ""
+msgstr "Doppeltes »volatile«"
#: c-decl.c:3882 cp/decl.c:11238
#, c-format
msgid "multiple storage classes in declaration of `%s'"
-msgstr ""
+msgstr "Mehrere Speicherklassen in Deklaration von »%s«"
#: c-decl.c:3892
msgid "function definition declared `auto'"
-msgstr ""
+msgstr "Funktionsdefinition deklarierte »auto«"
#: c-decl.c:3894
msgid "function definition declared `register'"
-msgstr ""
+msgstr "Funktionsdefinition deklarierte »register«"
#: c-decl.c:3896
msgid "function definition declared `typedef'"
-msgstr ""
+msgstr "Funktionsdefinition deklarierte »typedef«"
#: c-decl.c:3898
msgid "function definition declared `__thread'"
-msgstr ""
+msgstr "Funktionsdefinition deklarierte »__thread«"
#: c-decl.c:3911
#, c-format
msgid "storage class specified for structure field `%s'"
-msgstr ""
+msgstr "Speicherklasse für Strukturfeld »%s« angegeben"
#: c-decl.c:3915 cp/decl.c:11285
#, c-format
msgid "storage class specified for parameter `%s'"
-msgstr ""
+msgstr "Speicherklasse für Parameter »%s« angegeben"
#: c-decl.c:3918 cp/decl.c:11287
msgid "storage class specified for typename"
-msgstr ""
+msgstr "Speicherklasse für Typnamen angegeben"
#: c-decl.c:3930 cp/decl.c:11302
#, c-format
msgid "`%s' initialized and declared `extern'"
-msgstr ""
+msgstr "»%s« initialisiert und als »extern« deklariert"
#: c-decl.c:3932 cp/decl.c:11305
#, c-format
msgid "`%s' has both `extern' and initializer"
-msgstr ""
+msgstr "»%s« hat sowohl »extern« als auch Initialisierung"
#: c-decl.c:3937 cp/decl.c:11313
#, c-format
msgid "top-level declaration of `%s' specifies `auto'"
-msgstr ""
+msgstr "Deklaration höchster Ebene von »%s« spezifiziert »auto«"
#: c-decl.c:3942 cp/decl.c:11309
#, c-format
msgid "nested function `%s' declared `extern'"
-msgstr ""
+msgstr "Geschachtelte Funktion »%s« als »extern« deklariert"
#: c-decl.c:3948 cp/decl.c:11319
#, c-format
msgid "function-scope `%s' implicitly auto and declared `__thread'"
-msgstr ""
+msgstr "Funktions-Gültigkeitsbereich »%s« ist implizit auto und deklarierte »__thread«"
#. Only the innermost declarator (making a parameter be of
#. array type which is converted to pointer type)
#. may have static or type qualifiers.
#: c-decl.c:3987 c-decl.c:4188
msgid "static or type qualifiers in non-parameter array declarator"
-msgstr ""
+msgstr "»static« oder Typkennzeichner in Nicht-Parameter-Felddeklarator"
#: c-decl.c:4031
#, c-format
msgid "declaration of `%s' as array of voids"
-msgstr ""
+msgstr "Deklaration von »%s« als Feld von voids"
#: c-decl.c:4037
#, c-format
msgid "declaration of `%s' as array of functions"
-msgstr ""
+msgstr "Deklaration von »%s« als Feld von Funtionen"
#: c-decl.c:4042 c-decl.c:5332
msgid "invalid use of structure with flexible array member"
-msgstr ""
+msgstr "Ungültige Verwendung einer Struktur mit flexiblem Feld"
#: c-decl.c:4061
#, c-format
msgid "size of array `%s' has non-integer type"
-msgstr ""
+msgstr "Feldgröße von »%s« hat Nicht-Ganzzahltyp"
#: c-decl.c:4066
#, c-format
msgid "ISO C forbids zero-size array `%s'"
-msgstr ""
+msgstr "ISO-C verbietet Feld »%s« der Größe null"
#: c-decl.c:4073
#, c-format
msgid "size of array `%s' is negative"
-msgstr ""
+msgstr "Feldgröße von »%s« ist negativ"
#: c-decl.c:4086
#, c-format
msgid "ISO C90 forbids array `%s' whose size can't be evaluated"
-msgstr ""
+msgstr "ISO-C90 verbietet Feld »%s«, dessen Größe nicht ausgewertet werden kann"
#: c-decl.c:4089
#, c-format
msgid "ISO C90 forbids variable-size array `%s'"
-msgstr ""
+msgstr "ISO-C90 verbietet Feld »%s« variabler Größe"
#: c-decl.c:4119 c-decl.c:4342 cp/decl.c:11897
#, c-format
msgid "size of array `%s' is too large"
-msgstr ""
+msgstr "Feldgröße von »%s« ist zu groß"
#: c-decl.c:4145
-#, fuzzy
msgid "ISO C90 does not support flexible array members"
-msgstr "ISO C90 unterstützt nicht komplexe Typen"
+msgstr "ISO-C90 unterstützt keine flexiblen Felder als Mitglied"
#: c-decl.c:4155
msgid "array type has incomplete element type"
-msgstr ""
+msgstr "Feldtyp hat unvollständigen Elementtypen"
#: c-decl.c:4162 c-decl.c:4392
msgid "ISO C forbids const or volatile function types"
-msgstr ""
+msgstr "ISO-C verbietet const oder volatile Funktionstypen"
#: c-decl.c:4208 cp/decl.c:11445
#, c-format
msgid "`%s' declared as function returning a function"
-msgstr ""
+msgstr "»%s« als Funktion, die eine Funktion zurückgibt, deklariert"
#: c-decl.c:4213 cp/decl.c:11450
#, c-format
msgid "`%s' declared as function returning an array"
-msgstr ""
+msgstr "»%s« als Funktion, die ein Feld zurückgibt, deklariert"
#: c-decl.c:4241
msgid "ISO C forbids qualified void function return type"
-msgstr ""
+msgstr "ISO-C verbietet qualifiziertes void als Funktions-Rückgabetypen"
#: c-decl.c:4245
msgid "type qualifiers ignored on function return type"
-msgstr ""
+msgstr "Typkennzeichner ignoriert an Funktions-Rückgabewert"
#: c-decl.c:4274 c-decl.c:4357 c-decl.c:4481 c-decl.c:4573
msgid "ISO C forbids qualified function types"
-msgstr ""
+msgstr "ISO-C verbietet qualifizierte Funktionstypen"
#: c-decl.c:4314 cp/decl.c:11684
msgid "invalid type modifier within pointer declarator"
-msgstr ""
+msgstr "Ungültiger Typmodifizierer innerhalb Zeigerdeklarator"
#: c-decl.c:4412 cp/decl.c:12182
#, c-format
msgid "variable or field `%s' declared void"
-msgstr ""
+msgstr "Variable oder Feld »%s« als »void« deklariert"
#: c-decl.c:4445
msgid "attributes in parameter array declarator ignored"
-msgstr ""
+msgstr "Attribute in Parameterfeld ignoriert"
#: c-decl.c:4470
msgid "invalid type modifier within array declarator"
-msgstr ""
+msgstr "Ungültiger Typmodifizierer in Felddeklarator"
#: c-decl.c:4515
#, c-format
msgid "field `%s' declared as a function"
-msgstr ""
+msgstr "Feld »%s« als Funktion deklariert"
#: c-decl.c:4521
#, c-format
msgid "field `%s' has incomplete type"
-msgstr ""
+msgstr "Feld »%s« hat unvollständigen Typen"
#: c-decl.c:4553 c-decl.c:4555 c-decl.c:4557 c-decl.c:4564
#, c-format
msgid "invalid storage class for function `%s'"
-msgstr ""
+msgstr "Ungültige Speicherklasse für Funktion »%s«"
#: c-decl.c:4579
msgid "`noreturn' function returns non-void value"
-msgstr ""
+msgstr "»noreturn«-Funktion gibt nicht-void-Wert zurück"
#: c-decl.c:4594
msgid "cannot inline function `main'"
-msgstr ""
+msgstr "»main« ist nicht als »inline« möglich"
#: c-decl.c:4649
#, c-format
msgid "variable `%s' declared `inline'"
-msgstr ""
+msgstr "Variable »%s« als »inline« deklariert"
#. A mere warning is sure to result in improper semantics
#. at runtime. Don't bother to allow this to compile.
#: c-decl.c:4677 cp/decl.c:9951
msgid "thread-local storage not supported for this target"
-msgstr ""
+msgstr "Thread-lokaler Speicher wird für dieses Ziel nicht unterstützt"
#: c-decl.c:4732 c-decl.c:5880
msgid "function declaration isn't a prototype"
-msgstr ""
+msgstr "Funktionsdeklaration ist kein Prototyp"
#: c-decl.c:4738
msgid "parameter names (without types) in function declaration"
-msgstr ""
+msgstr "Parameternamen (ohne Typen) in Funktionsdeklaration"
#: c-decl.c:4770 c-decl.c:6250
#, c-format
msgid "parameter `%s' has incomplete type"
-msgstr ""
+msgstr "Parameter »%s« hat unvollständigen Typen"
#: c-decl.c:4773
msgid "parameter has incomplete type"
-msgstr ""
+msgstr "Parameter hat unvollständigen Typen"
#: c-decl.c:4794
#, c-format
msgid "parameter `%s' points to incomplete type"
-msgstr ""
+msgstr "Parameter »%s« zeigt auf unvollständigen Typen"
#: c-decl.c:4797
msgid "parameter points to incomplete type"
-msgstr ""
+msgstr "Parameter zeigt auf unvollständigen Typen"
#: c-decl.c:4862
#, c-format
msgid "parameter `%s' has just a forward declaration"
-msgstr ""
+msgstr "Parameter »%s« hat nur eine Vorwärtsdeklaration"
#: c-decl.c:4903
msgid "`void' in parameter list must be the entire list"
-msgstr ""
+msgstr "»void« in Parameterliste muss die gesamte Liste sein"
#: c-decl.c:4934
#, c-format
msgid "`struct %s' declared inside parameter list"
-msgstr ""
+msgstr "»struct %s« innerhalb Parameterliste deklariert"
#: c-decl.c:4937
#, c-format
msgid "`union %s' declared inside parameter list"
-msgstr ""
+msgstr "»union %s« innerhalb Parameterliste deklariert"
#: c-decl.c:4940
#, c-format
msgid "`enum %s' declared inside parameter list"
-msgstr ""
+msgstr "»enum %s« innerhalb Parameterliste deklariert"
#: c-decl.c:4947
msgid "anonymous struct declared inside parameter list"
-msgstr ""
+msgstr "Anonymes »struct« innerhalb Parameterliste deklariert"
#: c-decl.c:4949
msgid "anonymous union declared inside parameter list"
-msgstr ""
+msgstr "Anonymes »union« innerhalb Parameterliste deklariert"
#: c-decl.c:4951
msgid "anonymous enum declared inside parameter list"
-msgstr ""
+msgstr "Anonymes »enum« innerhalb Parameterliste deklariert"
#: c-decl.c:4955
msgid "its scope is only this definition or declaration, which is probably not what you want"
-msgstr ""
+msgstr "Sein Gültigkeitsbereich umfasst nur diese Definition bzw. Deklaration, was Sie wahrscheinlich nicht wollten"
#: c-decl.c:5032
#, c-format
msgid "redefinition of `union %s'"
-msgstr ""
+msgstr "Redefinition von »union %s«"
#: c-decl.c:5034
#, c-format
msgid "redefinition of `struct %s'"
-msgstr ""
+msgstr "Redefinition von »struct %s«"
#: c-decl.c:5105 cp/decl.c:7532
msgid "declaration does not declare anything"
-msgstr ""
+msgstr "Deklaration deklariert nichts"
#: c-decl.c:5169 c-decl.c:5172
#, c-format
msgid "%s defined inside parms"
-msgstr ""
+msgstr "%s innerhalb Parameter definiert"
#: c-decl.c:5170 c-decl.c:5173 c-decl.c:5184
msgid "union"
-msgstr ""
+msgstr "union"
#: c-decl.c:5170 c-decl.c:5173
msgid "structure"
-msgstr ""
+msgstr "Struktur"
#: c-decl.c:5183
#, c-format
msgid "%s has no %s"
-msgstr ""
+msgstr "%s hat kein %s"
#: c-decl.c:5184
msgid "struct"
-msgstr ""
+msgstr "struct"
#: c-decl.c:5185
msgid "named members"
-msgstr ""
+msgstr "benannte Member"
#: c-decl.c:5185
msgid "members"
-msgstr ""
+msgstr "Member"
#: c-decl.c:5224
#, c-format
msgid "nested redefinition of `%s'"
-msgstr ""
+msgstr "Verschachtelte Redefinition von »%s«"
#: c-decl.c:5237
#, c-format
msgid "bit-field `%s' width not an integer constant"
-msgstr ""
+msgstr "Breite des Bitfeldes »%s« ist keine Ganzzahlkonstante"
#: c-decl.c:5248
#, c-format
msgid "bit-field `%s' has invalid type"
-msgstr ""
+msgstr "Bitfeld »%s« hat ungültigen Typen"
#: c-decl.c:5260
#, c-format
msgid "bit-field `%s' type invalid in ISO C"
-msgstr ""
+msgstr "Typ des Bitfeldes »%s« ist ungültig in ISO-C"
#: c-decl.c:5271
#, c-format
msgid "negative width in bit-field `%s'"
-msgstr ""
+msgstr "Negative Breite in Bitfeld »%s«"
#: c-decl.c:5273
#, c-format
msgid "width of `%s' exceeds its type"
-msgstr ""
+msgstr "Breite von »%s« überschreitet dessen Typen"
#: c-decl.c:5275
#, c-format
msgid "zero width for bit-field `%s'"
-msgstr ""
+msgstr "Breite null für Bitfeld »%s«"
#: c-decl.c:5289
#, c-format
msgid "`%s' is narrower than values of its type"
-msgstr ""
+msgstr "»%s« ist schmaler als die Werte seines Typs"
#: c-decl.c:5323
msgid "flexible array member in union"
-msgstr ""
+msgstr "Flexibler Feld-Member in union"
#: c-decl.c:5325
msgid "flexible array member not at end of struct"
-msgstr ""
+msgstr "Flexibler Feld-Member nicht am Ende von struct"
#: c-decl.c:5327
msgid "flexible array member in otherwise empty struct"
-msgstr ""
+msgstr "Flexibler Feld-Member in ansonsten leerem struct"
#: c-decl.c:5357
#, c-format
msgid "duplicate member `%s'"
-msgstr ""
+msgstr "Doppelter Member »%s«"
#: c-decl.c:5448
msgid "union cannot be made transparent"
-msgstr ""
+msgstr "union kann nicht transparent gemacht werden"
#. This enum is a named one that has been declared already.
#: c-decl.c:5558
#, c-format
msgid "redeclaration of `enum %s'"
-msgstr ""
+msgstr "Redeklaration von »enum %s«"
#: c-decl.c:5592
msgid "enum defined inside parms"
-msgstr ""
+msgstr "enum innerhalb von Parametern definiert"
#: c-decl.c:5625
msgid "enumeration values exceed range of largest integer"
-msgstr ""
+msgstr "Aufzählungswerte überschreiten Wertebereich des größten Ganzzahltypen"
#: c-decl.c:5734
#, c-format
msgid "enumerator value for `%s' not integer constant"
-msgstr ""
+msgstr "Aufzählungswert für »%s« ist keine Ganzzahlkonstante"
#: c-decl.c:5747
msgid "overflow in enumeration values"
-msgstr ""
+msgstr "Überlauf in Aufzählungswerten"
#: c-decl.c:5752
msgid "ISO C restricts enumerator values to range of `int'"
-msgstr ""
+msgstr "ISO-C beschränkt Aufzählungswerte auf Bereich von »int«"
#: c-decl.c:5834
msgid "return type is an incomplete type"
-msgstr ""
+msgstr "Rückgabetyp ist unvollständig"
#: c-decl.c:5842
msgid "return type defaults to `int'"
-msgstr ""
+msgstr "Rückgabetyp ist auf »int« voreingestellt"
#: c-decl.c:5889
#, c-format
msgid "no previous prototype for `%s'"
-msgstr ""
+msgstr "Kein vorheriger Prototyp für »%s«"
#: c-decl.c:5896
#, c-format
msgid "`%s' was used with no prototype before its definition"
-msgstr ""
+msgstr "»%s« wurde vor seiner Definition ohne Prototyp verwendet"
#: c-decl.c:5902
#, c-format
msgid "no previous declaration for `%s'"
-msgstr ""
+msgstr "Keine vorherige Deklaration für »%s«"
#: c-decl.c:5909
#, c-format
msgid "`%s' was used with no declaration before its definition"
-msgstr ""
+msgstr "»%s« wurde vor seiner Definition ohne Deklaration verwendet"
#: c-decl.c:5933 c-decl.c:6486
#, c-format
msgid "return type of `%s' is not `int'"
-msgstr ""
+msgstr "Rückgabetyp von »%s« ist nicht »int«"
#: c-decl.c:5949
#, c-format
msgid "first argument of `%s' should be `int'"
-msgstr ""
+msgstr "Erstes Argument von »%s« sollte »int« sein"
#: c-decl.c:5958
#, c-format
msgid "second argument of `%s' should be `char **'"
-msgstr ""
+msgstr "Zweites Argument von »%s« sollte »char **« sein"
#: c-decl.c:5967
#, c-format
msgid "third argument of `%s' should probably be `char **'"
-msgstr ""
+msgstr "Drittes Argument von »%s« sollte wahrscheinlich »char **« sein"
#: c-decl.c:5976
#, c-format
msgid "`%s' takes only zero or two arguments"
-msgstr ""
+msgstr "»%s« benötigt entweder null oder zwei Argumente"
#: c-decl.c:5979
#, c-format
msgid "`%s' is normally a non-static function"
-msgstr ""
+msgstr "»%s« ist normalerweise eine Nicht-static-Funktion"
#: c-decl.c:6077
msgid "parm types given both in parmlist and separately"
-msgstr ""
+msgstr "Parametertypen sowohl in Parameterliste als auch separat angegeben"
#: c-decl.c:6098
msgid "parameter name omitted"
-msgstr ""
+msgstr "Parametername ausgelassen"
#: c-decl.c:6102 c-decl.c:6204
#, c-format
msgid "parameter `%s' declared void"
-msgstr ""
+msgstr "Parameter »%s« als void deklariert"
#: c-decl.c:6178
msgid "parameter name missing from parameter list"
-msgstr ""
+msgstr "Parametername fehlt in Parameterliste"
#: c-decl.c:6197
#, c-format
msgid "multiple parameters named `%s'"
-msgstr ""
+msgstr "Mehrere Parameter wurden »%s« genannt"
#: c-decl.c:6219 c-decl.c:6221
#, c-format
msgid "type of `%s' defaults to `int'"
-msgstr ""
+msgstr "Typ von »%s« auf »int« voreingestellt"
#: c-decl.c:6257
#, c-format
msgid "declaration for parameter `%s' but no such parameter"
-msgstr ""
+msgstr "Nicht vorhandener Parameter »%s« deklariert"
#: c-decl.c:6305
msgid "number of arguments doesn't match prototype"
-msgstr ""
+msgstr "Anzahl der Argumente passt nicht zum Prototypen"
#: c-decl.c:6335
#, c-format
msgid "promoted argument `%s' doesn't match prototype"
-msgstr ""
+msgstr "Weitergegebenes Argument »%s« passt nicht zum Prototypen"
#: c-decl.c:6345
#, c-format
msgid "argument `%s' doesn't match prototype"
-msgstr ""
+msgstr "Argument »%s« passt nicht zum Prototypen"
#: c-decl.c:6518 cp/decl.c:15049
msgid "no return statement in function returning non-void"
-msgstr ""
+msgstr "Keine return-Anweisung in nicht void zurückgebender Funktion"
#: c-decl.c:6525
msgid "this function may return with or without a value"
-msgstr ""
+msgstr "Diese Funktion kann mit oder ohne Wert zurückkehren"
#: c-decl.c:6729
#, c-format
msgid "size of return value of `%s' is %u bytes"
-msgstr ""
+msgstr "Größe des Rückgabewertes von »%s« ist %u Bytes"
#: c-decl.c:6733
#, c-format
msgid "size of return value of `%s' is larger than %d bytes"
-msgstr ""
+msgstr "Größe des Rückgabewertes von »%s« ist größer als %d Bytes"
#. 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:6791
msgid "`for' loop initial declaration used outside C99 mode"
-msgstr ""
+msgstr "Anfangsdeklaration in »for«-Schleife außerhalb C99-Modus verwendet"
#: c-decl.c:6815
#, c-format
msgid "`struct %s' declared in `for' loop initial declaration"
-msgstr ""
+msgstr "»struct %s« in Anfangsdeklaration einer »for«-Schleife deklariert"
#: c-decl.c:6818
#, c-format
msgid "`union %s' declared in `for' loop initial declaration"
-msgstr ""
+msgstr "»union %s« in Anfangsdeklaration einer »for«-Schleife deklariert"
#: c-decl.c:6821
#, c-format
msgid "`enum %s' declared in `for' loop initial declaration"
-msgstr ""
+msgstr "»enum %s« in Anfangsdeklaration einer »for«-Schleife deklariert"
#: c-decl.c:6829
#, c-format
msgid "declaration of non-variable `%s' in `for' loop initial declaration"
-msgstr ""
+msgstr "Deklaration der Nicht-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife"
#: c-decl.c:6831
#, c-format
msgid "declaration of static variable `%s' in `for' loop initial declaration"
-msgstr ""
+msgstr "Deklaration der »static«-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife"
#: c-decl.c:6833
#, c-format
msgid "declaration of `extern' variable `%s' in `for' loop initial declaration"
-msgstr ""
+msgstr "Deklaration der »extern«-Variablen »%s« in Anfangsdeklaration einer »for«-Schleife"
#: c-format.c:109 c-format.c:191
msgid "format string arg not a string type"
-msgstr ""
+msgstr "Format-Zeichenkettenargument ist kein Zeichenkettentyp"
#: c-format.c:124
msgid "args to be formatted is not '...'"
-msgstr ""
+msgstr "Zu formatierendes Argument ist nicht »...«"
#: c-format.c:133
msgid "strftime formats cannot format arguments"
-msgstr ""
+msgstr "strftime-Formate können keine Argumente formatieren"
#: c-format.c:168 c-format.c:270
msgid "format string has invalid operand number"
-msgstr ""
+msgstr "Formatzeichenkette hat ungültige Operandenzahl"
#: c-format.c:202
msgid "function does not return string type"
-msgstr ""
+msgstr "Funktion gibt keinen Zeichenkettentypen zurück"
#: c-format.c:233
msgid "unrecognized format specifier"
-msgstr ""
+msgstr "Unerkannte Formatangabe"
#: c-format.c:246
#, c-format
msgid "`%s' is an unrecognized format function type"
-msgstr ""
+msgstr "»%s« ist ein nicht erkannter Formatfunktionstyp"
#: c-format.c:280
msgid "format string arg follows the args to be formatted"
-msgstr ""
+msgstr "Format-Zeichenkettenargument folgt den zu formatierenden Argumenten"
#: c-format.c:601
msgid "` ' flag"
-msgstr ""
+msgstr "» «-Kennzeichen"
#: c-format.c:601
msgid "the ` ' printf flag"
-msgstr ""
+msgstr "Das » «-printf-Kennzeichen"
#: c-format.c:602 c-format.c:673
msgid "`+' flag"
-msgstr ""
+msgstr "»+«-Kennzeichen"
#: c-format.c:602
msgid "the `+' printf flag"
-msgstr ""
+msgstr "Das »+«-printf-Kennzeichen"
#: c-format.c:603 c-format.c:649
msgid "`#' flag"
-msgstr ""
+msgstr "»#«-Kennzeichen"
#: c-format.c:603
msgid "the `#' printf flag"
-msgstr ""
+msgstr "Das »#«-printf-Kennzeichen"
#: c-format.c:604 c-format.c:647
msgid "`0' flag"
-msgstr ""
+msgstr "»0«-Kennzeichen"
#: c-format.c:604
msgid "the `0' printf flag"
-msgstr ""
+msgstr "Das »0«-printf-Kennzeichen"
#: c-format.c:605 c-format.c:646 c-format.c:676
msgid "`-' flag"
-msgstr ""
+msgstr "»-«-Kennzeichen"
#: c-format.c:605
msgid "the `-' printf flag"
-msgstr ""
+msgstr "Das »-«-printf-Kennzeichen"
#: c-format.c:606 c-format.c:630
msgid "`'' flag"
-msgstr ""
+msgstr "»'«-Kennzeichen"
#: c-format.c:606
msgid "the `'' printf flag"
-msgstr ""
+msgstr "Das »'«-printf-Kennzeichen"
#: c-format.c:607 c-format.c:631
msgid "`I' flag"
-msgstr ""
+msgstr "»I«-Kennzeichen"
#: c-format.c:607
msgid "the `I' printf flag"
-msgstr ""
+msgstr "Das »I«-printf-Kennzeichen"
#: c-format.c:608 c-format.c:628 c-format.c:650 c-format.c:677 c-format.c:1702
msgid "field width"
-msgstr ""
+msgstr "Feldbreite"
#: c-format.c:608
msgid "field width in printf format"
-msgstr ""
+msgstr "Feldbreite im printf-Format"
#: c-format.c:609
msgid "precision"
-msgstr ""
+msgstr "Präzision"
#: c-format.c:609
msgid "precision in printf format"
-msgstr ""
+msgstr "Präzision im printf-Format"
#: c-format.c:610 c-format.c:629 c-format.c:680
msgid "length modifier"
-msgstr ""
+msgstr "Längenmodifizierer"
#: c-format.c:610
msgid "length modifier in printf format"
-msgstr ""
+msgstr "Längenmodifizierer im printf-Format"
#: c-format.c:626
msgid "assignment suppression"
-msgstr ""
+msgstr "Zuweisungsunterdrückung"
#: c-format.c:626
msgid "the assignment suppression scanf feature"
-msgstr ""
+msgstr "Das scanf-Merkmal der Zuweisungsunterdrückung"
#: c-format.c:627
msgid "`a' flag"
-msgstr ""
+msgstr "»a«-Kennzeichen"
#: c-format.c:627
msgid "the `a' scanf flag"
-msgstr ""
+msgstr "Das »a«-scanf-Kennzeichen"
#: c-format.c:628
msgid "field width in scanf format"
-msgstr ""
+msgstr "Feldbreite im scanf-Format"
#: c-format.c:629
msgid "length modifier in scanf format"
-msgstr ""
+msgstr "Längenmodifizierer im scanf-Format"
#: c-format.c:630
msgid "the `'' scanf flag"
-msgstr ""
+msgstr "Das »'«-scanf-Kennzeichen"
#: c-format.c:631
msgid "the `I' scanf flag"
-msgstr ""
+msgstr "Das »I«-scanf-Kennzeichen"
#: c-format.c:645
msgid "`_' flag"
-msgstr ""
+msgstr "»_«-Kennzeichen"
#: c-format.c:645
msgid "the `_' strftime flag"
-msgstr ""
+msgstr "Das »_«-strftime-Kennzeichen"
#: c-format.c:646
msgid "the `-' strftime flag"
-msgstr ""
+msgstr "Das »-«-strftime-Kennzeichen"
#: c-format.c:647
msgid "the `0' strftime flag"
-msgstr ""
+msgstr "Das »0«-strftime-Kennzeichen"
#: c-format.c:648 c-format.c:672
msgid "`^' flag"
-msgstr ""
+msgstr "»^«-Kennzeichen"
#: c-format.c:648
msgid "the `^' strftime flag"
-msgstr ""
+msgstr "Das »^«-strftime-Kennzeichen"
#: c-format.c:649
msgid "the `#' strftime flag"
-msgstr ""
+msgstr "Das »#«-strftime-Kennzeichen"
#: c-format.c:650
msgid "field width in strftime format"
-msgstr ""
+msgstr "Feldbreite im strftime-Format"
#: c-format.c:651
msgid "`E' modifier"
-msgstr ""
+msgstr "»E«-Modifizierer"
#: c-format.c:651
msgid "the `E' strftime modifier"
-msgstr ""
+msgstr "Der »E«-strftime-Modifizierer"
#: c-format.c:652
msgid "`O' modifier"
-msgstr ""
+msgstr "»O«-Modifizierer"
#: c-format.c:652
msgid "the `O' strftime modifier"
-msgstr ""
+msgstr "Der »O«-strftime-Modifizierer"
#: c-format.c:653
msgid "the `O' modifier"
-msgstr ""
+msgstr "Der »O«-Modifizierer"
#: c-format.c:671
msgid "fill character"
-msgstr ""
+msgstr "Füllzeichen"
#: c-format.c:671
msgid "fill character in strfmon format"
-msgstr ""
+msgstr "Füllzeichen im strfmon-Format"
#: c-format.c:672
msgid "the `^' strfmon flag"
-msgstr ""
+msgstr "Das »^«-strfmon-Kennzeichen"
#: c-format.c:673
msgid "the `+' strfmon flag"
-msgstr ""
+msgstr "Das »+«-strfmon-Kennzeichen"
#: c-format.c:674
msgid "`(' flag"
-msgstr ""
+msgstr "»(«-Kennzeichen"
#: c-format.c:674
msgid "the `(' strfmon flag"
-msgstr ""
+msgstr "Das »(«-strfmon-Kennzeichen"
#: c-format.c:675
msgid "`!' flag"
-msgstr ""
+msgstr "»!«-Kennzeichen"
#: c-format.c:675
msgid "the `!' strfmon flag"
-msgstr ""
+msgstr "Das »!«-strfmon-Kennzeichen"
#: c-format.c:676
msgid "the `-' strfmon flag"
-msgstr ""
+msgstr "Das »-«-strfmon-Kennzeichen"
#: c-format.c:677
msgid "field width in strfmon format"
-msgstr ""
+msgstr "Feldbreite im strfmon-Format"
#: c-format.c:678
msgid "left precision"
-msgstr ""
+msgstr "Linke Präzision"
#: c-format.c:678
msgid "left precision in strfmon format"
-msgstr ""
+msgstr "Linke Präzision im strfmon-Format"
#: c-format.c:679
msgid "right precision"
-msgstr ""
+msgstr "Rechte Präzision"
#: c-format.c:679
msgid "right precision in strfmon format"
-msgstr ""
+msgstr "Rechte Präzision im strfmon-Format"
#: c-format.c:680
msgid "length modifier in strfmon format"
-msgstr ""
+msgstr "Längenmodifizierer im strfmon-Format"
#: c-format.c:983
#, c-format
msgid "function might be possible candidate for `%s' format attribute"
-msgstr ""
+msgstr "Funktion könnte möglicher Kandidat für Formatattribut »%s« sein"
#: c-format.c:1107 c-format.c:1128 c-format.c:2112
msgid "missing $ operand number in format"
-msgstr ""
+msgstr "Fehlende $-Operandennummer im Format"
#: c-format.c:1138
#, c-format
msgid "%s does not support %%n$ operand number formats"
-msgstr ""
+msgstr "%s unterstützt nicht %%n$-Operandennummerformate"
#: c-format.c:1145
msgid "operand number out of range in format"
-msgstr ""
+msgstr "Operandennummer außerhalb des Wertebereiches im Format"
#: c-format.c:1168
#, c-format
msgid "format argument %d used more than once in %s format"
-msgstr ""
+msgstr "Formatargument %d mehr als einmal im %s-Format verwendet"
#: c-format.c:1218
#, c-format
msgid "format argument %d unused before used argument %d in $-style format"
-msgstr ""
+msgstr "Formatargument %d nicht verwendet vor benutztem Argument %d im $-Stil-Format"
#: c-format.c:1322
msgid "format not a string literal, format string not checked"
-msgstr ""
+msgstr "Format ist kein Zeichenkettenliteral, Formatzeichenkette ungeprüft"
#: c-format.c:1336
msgid "format not a string literal and no format arguments"
-msgstr ""
+msgstr "Format ist kein Zeichenkettenliteral, und keine Formatargumente"
#: c-format.c:1338
msgid "format not a string literal, argument types not checked"
-msgstr ""
+msgstr "Format ist kein Zeichenkettenliteral, Argumenttypen ungeprüft"
#: c-format.c:1351
msgid "too many arguments for format"
-msgstr ""
+msgstr "Zu viele Argumente für Format"
#: c-format.c:1354
msgid "unused arguments in $-style format"
-msgstr ""
+msgstr "Unbenutzte Argumente in $-Stil-Format"
#: c-format.c:1357
#, c-format
msgid "zero-length %s format string"
-msgstr ""
+msgstr "Format-Zeichenkette %s der Länge null"
#: c-format.c:1361
msgid "format is a wide character string"
-msgstr ""
+msgstr "Format ist »wide character«-Zeichenkette"
#: c-format.c:1364
msgid "unterminated format string"
-msgstr ""
+msgstr "Unbeendete Formatzeichenkette"
#: c-format.c:1581
msgid "embedded `\\0' in format"
-msgstr ""
+msgstr "Eingebettetes »\\0« im Format"
#: c-format.c:1596
#, c-format
msgid "spurious trailing `%%' in format"
-msgstr ""
+msgstr "Störendes letztes »%%« im Format"
#: c-format.c:1635 c-format.c:1872
#, c-format
msgid "repeated %s in format"
-msgstr ""
+msgstr "Wiederholtes %s im Format"
#: c-format.c:1648
msgid "missing fill character at end of strfmon format"
-msgstr ""
+msgstr "Fehlendes Füllzeichen am Ende des strfmon-Formates"
#: c-format.c:1687 c-format.c:1786 c-format.c:2066 c-format.c:2119
msgid "too few arguments for format"
-msgstr ""
+msgstr "Zu wenig Argumente für Format"
#: c-format.c:1728
#, c-format
msgid "zero width in %s format"
-msgstr ""
+msgstr "Breite null im Format %s"
#: c-format.c:1747
#, c-format
msgid "empty left precision in %s format"
-msgstr ""
+msgstr "Leere linke Präzision im Format %s"
#: c-format.c:1801
msgid "field precision"
-msgstr ""
+msgstr "Feldpräzision"
#: c-format.c:1816
#, c-format
msgid "empty precision in %s format"
-msgstr ""
+msgstr "Fehlende Präzision im Format %s"
#: c-format.c:1856
#, c-format
msgid "%s does not support the `%s' %s length modifier"
-msgstr ""
+msgstr "%s unterstützt nicht den Längenmodifizierer »%s« %s"
#: c-format.c:1906
msgid "conversion lacks type at end of format"
-msgstr ""
+msgstr "Konvertierung fehlt der Typ am Ende des Formates"
#: c-format.c:1917
#, c-format
msgid "unknown conversion type character `%c' in format"
-msgstr ""
+msgstr "Unbekanntes Konvertierungstyp-Zeichen »%c« im Format"
#: c-format.c:1920
#, c-format
msgid "unknown conversion type character 0x%x in format"
-msgstr ""
+msgstr "Unbekanntes Konvertierungstyp-Zeichen 0x%x im Format"
#: c-format.c:1927
#, c-format
msgid "%s does not support the `%%%c' %s format"
-msgstr ""
+msgstr "%s unterstützt nicht das Format »%%%c« %s"
#: c-format.c:1943
#, c-format
msgid "%s used with `%%%c' %s format"
-msgstr ""
+msgstr "%s verwendet mit Format »%%%c« %s"
#: c-format.c:1952
#, c-format
msgid "%s does not support %s"
-msgstr ""
+msgstr "%s unterstützt nicht %s"
#: c-format.c:1961
#, c-format
msgid "%s does not support %s with the `%%%c' %s format"
-msgstr ""
+msgstr "%s unterstützt nicht %s mit dem Format »%%%c« %s"
#: c-format.c:1994
#, c-format
msgid "%s ignored with %s and `%%%c' %s format"
-msgstr ""
+msgstr "%s ignoriert mit %s und Format »%%%c« %s"
#: c-format.c:1998
#, c-format
msgid "%s ignored with %s in %s format"
-msgstr ""
+msgstr "%s ignoriert mit %s im Format %s"
#: c-format.c:2004
#, c-format
msgid "use of %s and %s together with `%%%c' %s format"
-msgstr ""
+msgstr "Verwendung von %s und %s zusammen mit »%%%c« %s Format"
#: c-format.c:2008
#, c-format
msgid "use of %s and %s together in %s format"
-msgstr ""
+msgstr "Verwendung von %s und %s zusammen im Format %s"
#: c-format.c:2027
#, c-format
msgid "`%%%c' yields only last 2 digits of year in some locales"
-msgstr ""
+msgstr "»%%%c« liefert in manchen Locales nur die letzten 2 Ziffern des Jahres"
#: c-format.c:2030
#, c-format
msgid "`%%%c' yields only last 2 digits of year"
-msgstr ""
+msgstr "»%%%c« liefert nur die letzten 2 Ziffern des Jahres"
#. The end of the format string was reached.
#: c-format.c:2046
#, c-format
msgid "no closing `]' for `%%[' format"
-msgstr ""
+msgstr "Kein schließendes »]« für »%%[«-Format"
#: c-format.c:2059
#, c-format
msgid "use of `%s' length modifier with `%c' type character"
-msgstr ""
+msgstr "Verwendung des »%s«-Längenmodifizierers mit »%c«-Typ-Zeichen"
#: c-format.c:2080
#, c-format
msgid "%s does not support the `%%%s%c' %s format"
-msgstr ""
+msgstr "%s unterstützt nicht das Format »%%%s%c« %s"
#: c-format.c:2095
msgid "operand number specified with suppressed assignment"
-msgstr ""
+msgstr "Operandennummer mit unterdrückter Zuweisung angegeben"
#: c-format.c:2097
msgid "operand number specified for format taking no argument"
@@ -4907,7 +4904,7 @@ msgid ""
"See %s for instructions.\n"
msgstr ""
"Bitte senden Sie einen vollständigen Fehlerbericht auf Englisch ein;\n"
-"bearbeiten Sie die Quellen zunächst mit eine Präprozessor, wenn es\n"
+"bearbeiten Sie die Quellen zunächst mit einem Präprozessor, wenn es\n"
"dienlich ist.\n"
"Fehler in der deutschen Ãœbersetzung sind an de@li.org zu melden.\n"
"\n"
diff --git a/gcc/po/exgettext b/gcc/po/exgettext
index 93f65c34370..c2be7d4cd59 100644
--- a/gcc/po/exgettext
+++ b/gcc/po/exgettext
@@ -162,4 +162,6 @@ END {
echo "running xgettext..." >&2
$xgettext --default-domain=$package --directory=$srcdir \
--add-comments `cat $kopt` --files-from=$posr \
+ --copyright-holder="Free Software Foundation, Inc." \
+ --msgid-bugs-address="http://gcc.gnu.org/bugs.html" \
--language=c -o po/$package.pot
diff --git a/gcc/po/gcc.pot b/gcc/po/gcc.pot
index f6e9e95d072..da74e005f71 100644
--- a/gcc/po/gcc.pot
+++ b/gcc/po/gcc.pot
@@ -1,5 +1,5 @@
# SOME DESCRIPTIVE TITLE.
-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
+# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
@@ -7,8 +7,8 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
-"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2003-10-25 21:33+0000\n"
+"Report-Msgid-Bugs-To: http://gcc.gnu.org/bugs.html\n"
+"POT-Creation-Date: 2003-11-20 10:14+0000\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"
@@ -39,12 +39,12 @@ msgstr ""
#: attribs.c:416 c-common.c:4353 c-common.c:4372 c-common.c:4390
#: c-common.c:4417 c-common.c:4436 c-common.c:4459 c-common.c:4482
#: c-common.c:4508 c-common.c:4542 c-common.c:4586 c-common.c:4614
-#: c-common.c:4642 c-common.c:4661 c-common.c:4916 c-common.c:4935
-#: c-common.c:4974 c-common.c:5041 c-common.c:5087 c-common.c:5145
-#: c-common.c:5176 c-common.c:5522 c-common.c:5545 c-common.c:5584
-#: config/arm/arm.c:2236 config/arm/arm.c:2263 config/avr/avr.c:4561
-#: config/h8300/h8300.c:4279 config/h8300/h8300.c:4302 config/i386/i386.c:1589
-#: config/i386/i386.c:15177 config/i386/winnt.c:86 config/ia64/ia64.c:1057
+#: c-common.c:4642 c-common.c:4661 c-common.c:4916 c-common.c:4938
+#: c-common.c:4973 c-common.c:5040 c-common.c:5086 c-common.c:5144
+#: c-common.c:5175 c-common.c:5521 c-common.c:5544 c-common.c:5583
+#: config/arm/arm.c:2233 config/arm/arm.c:2260 config/avr/avr.c:4561
+#: config/h8300/h8300.c:4279 config/h8300/h8300.c:4302 config/i386/i386.c:1593
+#: config/i386/i386.c:15269 config/i386/winnt.c:86 config/ia64/ia64.c:1057
#: config/ip2k/ip2k.c:3214
#, c-format
msgid "`%s' attribute ignored"
@@ -70,83 +70,83 @@ msgstr ""
msgid "invalid third arg to __builtin_prefetch; using zero"
msgstr ""
-#: builtins.c:3806
+#: builtins.c:3810
msgid "argument of `__builtin_args_info' must be constant"
msgstr ""
-#: builtins.c:3812
+#: builtins.c:3816
msgid "argument of `__builtin_args_info' out of range"
msgstr ""
-#: builtins.c:3818
+#: builtins.c:3822
msgid "missing argument in `__builtin_args_info'"
msgstr ""
-#: builtins.c:3834
+#: builtins.c:3838
msgid "`va_start' used in function with fixed args"
msgstr ""
-#: builtins.c:3853
+#: builtins.c:3857
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:3858
+#: builtins.c:3862
msgid "`__builtin_next_arg' called without an argument"
msgstr ""
-#: builtins.c:3939
+#: builtins.c:3951
msgid "too many arguments to function `va_start'"
msgstr ""
-#: builtins.c:4039
+#: builtins.c:4051
msgid "first argument to `va_arg' not of type `va_list'"
msgstr ""
#. Unfortunately, this is merely undefined, rather than a constraint
#. violation, so we cannot make this an error. If this call is never
#. executed, the program is still strictly conforming.
-#: builtins.c:4071
+#: builtins.c:4083
#, c-format
msgid "`%s' is promoted to `%s' when passed through `...'"
msgstr ""
-#: builtins.c:4076
+#: builtins.c:4088
#, c-format
msgid "(so you should pass `%s' not `%s' to `va_arg')"
msgstr ""
-#: builtins.c:4193
+#: builtins.c:4205
msgid "invalid arg to `__builtin_frame_address'"
msgstr ""
-#: builtins.c:4195
+#: builtins.c:4207
msgid "invalid arg to `__builtin_return_address'"
msgstr ""
-#: builtins.c:4209
+#: builtins.c:4221
msgid "unsupported arg to `__builtin_frame_address'"
msgstr ""
-#: builtins.c:4211
+#: builtins.c:4223
msgid "unsupported arg to `__builtin_return_address'"
msgstr ""
-#: builtins.c:4371
+#: builtins.c:4383
msgid "second arg to `__builtin_expect' must be a constant"
msgstr ""
-#: builtins.c:5316
+#: builtins.c:5328
msgid "__builtin_longjmp second argument must be 1"
msgstr ""
-#: builtins.c:5411
+#: builtins.c:5423
#, c-format
msgid "built-in function `%s' not currently supported"
msgstr ""
-#: builtins.c:5551
+#: builtins.c:5563
msgid "target format does not support infinity"
msgstr ""
@@ -248,15 +248,15 @@ msgstr ""
msgid "pointer to a member used in arithmetic"
msgstr ""
-#: c-common.c:2626 f/com.c:14730
+#: c-common.c:2626 f/com.c:14732
msgid "struct type value used where scalar is required"
msgstr ""
-#: c-common.c:2630 f/com.c:14734
+#: c-common.c:2630 f/com.c:14736
msgid "union type value used where scalar is required"
msgstr ""
-#: c-common.c:2634 f/com.c:14738
+#: c-common.c:2634 f/com.c:14740
msgid "array type value used where scalar is required"
msgstr ""
@@ -266,7 +266,7 @@ msgstr ""
msgid "the address of `%D', will always evaluate as `true'"
msgstr ""
-#: c-common.c:2765 f/com.c:14870
+#: c-common.c:2765 f/com.c:14872
msgid "suggest parentheses around assignment used as truth value"
msgstr ""
@@ -400,7 +400,7 @@ msgstr ""
msgid "invalid pointer mode `%s'"
msgstr ""
-#: c-common.c:4709 c-common.c:5273
+#: c-common.c:4709 c-common.c:5272
#, c-format
msgid "unable to emulate '%s'"
msgstr ""
@@ -445,82 +445,82 @@ msgstr ""
msgid "alias arg not a string"
msgstr ""
-#: c-common.c:4945
+#: c-common.c:4944
msgid "visibility arg not a string"
msgstr ""
-#: c-common.c:4954
+#: c-common.c:4957
msgid ""
"visibility arg must be one of \"default\", \"hidden\", \"protected\" or "
"\"internal\""
msgstr ""
-#: c-common.c:4984
+#: c-common.c:4983
msgid "tls_model arg not a string"
msgstr ""
-#: c-common.c:4993
+#: c-common.c:4992
msgid ""
"tls_model arg must be one of \"local-exec\", \"initial-exec\", \"local-"
"dynamic\" or \"global-dynamic\""
msgstr ""
-#: c-common.c:5015 c-common.c:5061
+#: c-common.c:5014 c-common.c:5060
msgid "%J'%E' attribute applies only to functions"
msgstr ""
-#: c-common.c:5020 c-common.c:5066
+#: c-common.c:5019 c-common.c:5065
msgid "%Jcan't set '%E' attribute after definition"
msgstr ""
-#: c-common.c:5142
+#: c-common.c:5141
#, c-format
msgid "`%s' attribute ignored for `%s'"
msgstr ""
-#: c-common.c:5205
+#: c-common.c:5204
#, c-format
msgid "invalid vector type for attribute `%s'"
msgstr ""
-#: c-common.c:5229 c-common.c:5261
+#: c-common.c:5228 c-common.c:5260
msgid "no vector mode with the size and type specified could be found"
msgstr ""
-#: c-common.c:5363
+#: c-common.c:5362
msgid "nonnull attribute without arguments on a non-prototype"
msgstr ""
-#: c-common.c:5378
+#: c-common.c:5377
#, c-format
msgid "nonnull argument has invalid operand number (arg %lu)"
msgstr ""
-#: c-common.c:5397
+#: c-common.c:5396
#, c-format
msgid ""
"nonnull argument with out-of-range operand number (arg %lu, operand %lu)"
msgstr ""
-#: c-common.c:5405
+#: c-common.c:5404
#, c-format
msgid "nonnull argument references non-pointer operand (arg %lu, operand %lu)"
msgstr ""
-#: c-common.c:5485
+#: c-common.c:5484
#, c-format
msgid "null argument where non-null required (arg %lu)"
msgstr ""
-#: c-common.c:5556
+#: c-common.c:5555
msgid "cleanup arg not an identifier"
msgstr ""
-#: c-common.c:5563
+#: c-common.c:5562
msgid "cleanup arg not a function"
msgstr ""
-#: c-convert.c:82 c-typeck.c:1192 c-typeck.c:3355 cp/typeck.c:1307
+#: c-convert.c:82 c-typeck.c:1192 c-typeck.c:3348 cp/typeck.c:1307
#: cp/typeck.c:5605 treelang/tree-convert.c:79
msgid "void value not ignored as it ought to be"
msgstr ""
@@ -797,7 +797,7 @@ msgstr ""
msgid "parameter `%s' is initialized"
msgstr ""
-#: c-decl.c:2621 c-typeck.c:4162
+#: c-decl.c:2621 c-typeck.c:4157
msgid "variable-sized object may not be initialized"
msgstr ""
@@ -811,7 +811,7 @@ msgstr ""
msgid "elements of array `%s' have incomplete type"
msgstr ""
-#: c-decl.c:2702 c-decl.c:5460 cp/decl.c:3727 cp/decl.c:10099
+#: c-decl.c:2702 c-decl.c:5460 cp/decl.c:3725 cp/decl.c:10097
msgid "%Jinline function '%D' given attribute noinline"
msgstr ""
@@ -843,7 +843,7 @@ msgstr ""
msgid "ISO C forbids forward parameter declarations"
msgstr ""
-#: c-decl.c:3351 cp/decl.c:6737
+#: c-decl.c:3351 cp/decl.c:6735
msgid "`long long long' is too long for GCC"
msgstr ""
@@ -851,25 +851,25 @@ msgstr ""
msgid "ISO C90 does not support `long long'"
msgstr ""
-#: c-decl.c:3365 c-decl.c:3368 cp/decl.c:6742
+#: c-decl.c:3365 c-decl.c:3368 cp/decl.c:6740
#, c-format
msgid "duplicate `%s'"
msgstr ""
-#: c-decl.c:3378 cp/decl.c:6748
+#: c-decl.c:3378 cp/decl.c:6746
msgid "`__thread' before `extern'"
msgstr ""
-#: c-decl.c:3380 cp/decl.c:6750
+#: c-decl.c:3380 cp/decl.c:6748
msgid "`__thread' before `static'"
msgstr ""
-#: c-decl.c:3388 cp/decl.c:6777
+#: c-decl.c:3388 cp/decl.c:6775
#, c-format
msgid "two or more data types in declaration of `%s'"
msgstr ""
-#: c-decl.c:3408 cp/decl.c:6782
+#: c-decl.c:3408 cp/decl.c:6780
#, c-format
msgid "`%s' fails to be a typedef or built in type"
msgstr ""
@@ -884,12 +884,12 @@ msgstr ""
msgid "both long and short specified for `%s'"
msgstr ""
-#: c-decl.c:3480 cp/decl.c:6882
+#: c-decl.c:3480 cp/decl.c:6880
#, c-format
msgid "long or short specified with char for `%s'"
msgstr ""
-#: c-decl.c:3487 cp/decl.c:6886
+#: c-decl.c:3487 cp/decl.c:6884
#, c-format
msgid "long or short specified with floating type for `%s'"
msgstr ""
@@ -903,17 +903,17 @@ msgstr ""
msgid "both signed and unsigned specified for `%s'"
msgstr ""
-#: c-decl.c:3498 cp/decl.c:6875
+#: c-decl.c:3498 cp/decl.c:6873
#, c-format
msgid "long, short, signed or unsigned invalid for `%s'"
msgstr ""
-#: c-decl.c:3504 cp/decl.c:6895
+#: c-decl.c:3504 cp/decl.c:6893
#, c-format
msgid "long, short, signed or unsigned used invalidly for `%s'"
msgstr ""
-#: c-decl.c:3522 cp/decl.c:6916
+#: c-decl.c:3522 cp/decl.c:6914
#, c-format
msgid "complex invalid for `%s'"
msgstr ""
@@ -930,19 +930,19 @@ msgstr ""
msgid "ISO C does not support complex integer types"
msgstr ""
-#: c-decl.c:3609 c-decl.c:4067 cp/decl.c:7508
+#: c-decl.c:3609 c-decl.c:4067 cp/decl.c:7506
msgid "duplicate `const'"
msgstr ""
-#: c-decl.c:3611 c-decl.c:4071 cp/decl.c:7512
+#: c-decl.c:3611 c-decl.c:4071 cp/decl.c:7510
msgid "duplicate `restrict'"
msgstr ""
-#: c-decl.c:3613 c-decl.c:4069 cp/decl.c:7510
+#: c-decl.c:3613 c-decl.c:4069 cp/decl.c:7508
msgid "duplicate `volatile'"
msgstr ""
-#: c-decl.c:3641 cp/decl.c:7079
+#: c-decl.c:3641 cp/decl.c:7077
#, c-format
msgid "multiple storage classes in declaration of `%s'"
msgstr ""
@@ -968,21 +968,21 @@ msgstr ""
msgid "storage class specified for structure field `%s'"
msgstr ""
-#: c-decl.c:3674 cp/decl.c:7124
+#: c-decl.c:3674 cp/decl.c:7122
#, c-format
msgid "storage class specified for parameter `%s'"
msgstr ""
-#: c-decl.c:3677 cp/decl.c:7126
+#: c-decl.c:3677 cp/decl.c:7124
msgid "storage class specified for typename"
msgstr ""
-#: c-decl.c:3689 cp/decl.c:7141
+#: c-decl.c:3689 cp/decl.c:7139
#, c-format
msgid "`%s' initialized and declared `extern'"
msgstr ""
-#: c-decl.c:3691 cp/decl.c:7144
+#: c-decl.c:3691 cp/decl.c:7142
#, c-format
msgid "`%s' has both `extern' and initializer"
msgstr ""
@@ -992,12 +992,12 @@ msgstr ""
msgid "file-scope declaration of `%s' specifies `auto'"
msgstr ""
-#: c-decl.c:3701 cp/decl.c:7148
+#: c-decl.c:3701 cp/decl.c:7146
#, c-format
msgid "nested function `%s' declared `extern'"
msgstr ""
-#: c-decl.c:3707 cp/decl.c:7158
+#: c-decl.c:3707 cp/decl.c:7156
#, c-format
msgid "function-scope `%s' implicitly auto and declared `__thread'"
msgstr ""
@@ -1048,7 +1048,7 @@ msgstr ""
msgid "ISO C90 forbids variable-size array `%s'"
msgstr ""
-#: c-decl.c:3878 c-decl.c:4093 cp/decl.c:7682
+#: c-decl.c:3878 c-decl.c:4093 cp/decl.c:7680
#, c-format
msgid "size of array `%s' is too large"
msgstr ""
@@ -1061,12 +1061,12 @@ msgstr ""
msgid "array type has incomplete element type"
msgstr ""
-#: c-decl.c:3959 cp/decl.c:7279
+#: c-decl.c:3959 cp/decl.c:7277
#, c-format
msgid "`%s' declared as function returning a function"
msgstr ""
-#: c-decl.c:3964 cp/decl.c:7284
+#: c-decl.c:3964 cp/decl.c:7282
#, c-format
msgid "`%s' declared as function returning an array"
msgstr ""
@@ -1083,7 +1083,7 @@ msgstr ""
msgid "ISO C forbids qualified function types"
msgstr ""
-#: c-decl.c:4065 cp/decl.c:7504
+#: c-decl.c:4065 cp/decl.c:7502
msgid "invalid type modifier within pointer declarator"
msgstr ""
@@ -1091,7 +1091,7 @@ msgstr ""
msgid "ISO C forbids const or volatile function types"
msgstr ""
-#: c-decl.c:4163 cp/decl.c:7964
+#: c-decl.c:4163 cp/decl.c:7962
#, c-format
msgid "variable or field `%s' declared void"
msgstr ""
@@ -1137,7 +1137,7 @@ msgstr ""
#. A mere warning is sure to result in improper semantics
#. at runtime. Don't bother to allow this to compile.
-#: c-decl.c:4429 cp/decl.c:5820
+#: c-decl.c:4429 cp/decl.c:5818
msgid "thread-local storage not supported for this target"
msgstr ""
@@ -1198,7 +1198,7 @@ msgstr ""
msgid "redefinition of `struct %s'"
msgstr ""
-#: c-decl.c:4805 cp/decl.c:3500
+#: c-decl.c:4805 cp/decl.c:3498
msgid "declaration does not declare anything"
msgstr ""
@@ -1416,7 +1416,7 @@ msgstr ""
msgid "argument \"%D\" doesn't match prototype"
msgstr ""
-#: c-decl.c:6101 cp/decl.c:10807
+#: c-decl.c:6101 cp/decl.c:10817
msgid "no return statement in function returning non-void"
msgstr ""
@@ -2169,34 +2169,34 @@ msgstr ""
msgid "YYDEBUG not defined"
msgstr ""
-#: c-opts.c:1251
+#: c-opts.c:1252
#, c-format
msgid "opening dependency file %s: %m"
msgstr ""
-#: c-opts.c:1261
+#: c-opts.c:1262
#, c-format
msgid "closing dependency file %s: %m"
msgstr ""
-#: c-opts.c:1264
+#: c-opts.c:1265
#, c-format
msgid "when writing output to %s: %m"
msgstr ""
-#: c-opts.c:1334
+#: c-opts.c:1335
msgid "to generate dependencies you must specify either -M or -MM"
msgstr ""
-#: c-opts.c:1398
+#: c-opts.c:1403
msgid "<built-in>"
msgstr ""
-#: c-opts.c:1413
+#: c-opts.c:1418
msgid "<command line>"
msgstr ""
-#: c-pch.c:111 graph.c:402 toplev.c:1516 toplev.c:4468 f/com.c:14198
+#: c-pch.c:111 graph.c:402 toplev.c:1516 toplev.c:4480 f/com.c:14200
#: java/jcf-parse.c:890 java/jcf-parse.c:1037 java/lex.c:1828
#: objc/objc-act.c:503
#, c-format
@@ -2370,11 +2370,11 @@ msgstr ""
msgid "asm declaration conflicts with previous rename"
msgstr ""
-#: c-semantics.c:595
+#: c-semantics.c:595 cp/parser.c:5769
msgid "break statement not within loop or switch"
msgstr ""
-#: c-semantics.c:613
+#: c-semantics.c:613 cp/parser.c:5780
msgid "continue statement not within a loop"
msgstr ""
@@ -2392,7 +2392,7 @@ msgid ""
"own scope.)"
msgstr ""
-#: c-semantics.c:741 c-typeck.c:6179 cp/semantics.c:1055
+#: c-semantics.c:741 c-typeck.c:6174 cp/semantics.c:1055
#, c-format
msgid "%s qualifier ignored on asm"
msgstr ""
@@ -2671,543 +2671,543 @@ msgstr ""
#. Use `%s' to print the string in case there are any escape
#. characters in the message.
-#: c-typeck.c:2535 c-typeck.c:3915 c-typeck.c:3930 c-typeck.c:3945
+#: c-typeck.c:2535 c-typeck.c:3910 c-typeck.c:3925 c-typeck.c:3940
#: final.c:2779 final.c:2781 gcc.c:4561 rtl-error.c:109 toplev.c:1371
-#: config/cris/cris.c:544 cp/parser.c:1768 cp/typeck.c:4072 java/expr.c:356
-#: java/verify.c:1459 java/verify.c:1460 java/verify.c:1475
+#: config/cris/cris.c:544 cp/parser.c:1778 cp/typeck.c:4072 java/expr.c:356
+#: java/verify.c:1456 java/verify.c:1457 java/verify.c:1472
#, c-format
msgid "%s"
msgstr ""
-#: c-typeck.c:2592
-msgid "ISO C forbids use of conditional expressions as lvalues"
+#: c-typeck.c:2591
+msgid "use of conditional expressions as lvalues is deprecated"
msgstr ""
-#: c-typeck.c:2596
-msgid "ISO C forbids use of compound expressions as lvalues"
+#: c-typeck.c:2594
+msgid "use of compound expressions as lvalues is deprecated"
msgstr ""
-#: c-typeck.c:2599
+#: c-typeck.c:2597
msgid "use of cast expressions as lvalues is deprecated"
msgstr ""
-#: c-typeck.c:2614
+#: c-typeck.c:2612
#, c-format
msgid "%s of read-only member `%s'"
msgstr ""
-#: c-typeck.c:2618
+#: c-typeck.c:2616
#, c-format
msgid "%s of read-only variable `%s'"
msgstr ""
-#: c-typeck.c:2621
+#: c-typeck.c:2619
#, c-format
msgid "%s of read-only location"
msgstr ""
-#: c-typeck.c:2639
+#: c-typeck.c:2637
#, c-format
msgid "cannot take address of bit-field `%s'"
msgstr ""
-#: c-typeck.c:2667 treelang/treetree.c:946
+#: c-typeck.c:2665 treelang/treetree.c:946
#, c-format
msgid "global register variable `%s' used in nested function"
msgstr ""
-#: c-typeck.c:2671 treelang/treetree.c:950
+#: c-typeck.c:2669 treelang/treetree.c:950
#, c-format
msgid "register variable `%s' used in nested function"
msgstr ""
-#: c-typeck.c:2678 treelang/treetree.c:957
+#: c-typeck.c:2676 treelang/treetree.c:957
#, c-format
msgid "address of global register variable `%s' requested"
msgstr ""
-#: c-typeck.c:2690
+#: c-typeck.c:2688
msgid "cannot put object with volatile field into register"
msgstr ""
-#: c-typeck.c:2694 treelang/treetree.c:962
+#: c-typeck.c:2692 treelang/treetree.c:962
#, c-format
msgid "address of register variable `%s' requested"
msgstr ""
-#: c-typeck.c:2779
+#: c-typeck.c:2777
msgid "signed and unsigned type in conditional expression"
msgstr ""
-#: c-typeck.c:2786
+#: c-typeck.c:2784
msgid "ISO C forbids conditional expr with only one void side"
msgstr ""
-#: c-typeck.c:2802 c-typeck.c:2809
+#: c-typeck.c:2800 c-typeck.c:2807
msgid "ISO C forbids conditional expr between `void *' and function pointer"
msgstr ""
-#: c-typeck.c:2815
+#: c-typeck.c:2813
msgid "pointer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2822 c-typeck.c:2832
+#: c-typeck.c:2820 c-typeck.c:2830
msgid "pointer/integer type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2846
+#: c-typeck.c:2844
msgid "type mismatch in conditional expression"
msgstr ""
-#: c-typeck.c:2906
+#: c-typeck.c:2904
msgid "left-hand operand of comma expression has no effect"
msgstr ""
-#: c-typeck.c:2942
+#: c-typeck.c:2935
msgid "cast specifies array type"
msgstr ""
-#: c-typeck.c:2948
+#: c-typeck.c:2941
msgid "cast specifies function type"
msgstr ""
-#: c-typeck.c:2958
+#: c-typeck.c:2951
msgid "ISO C forbids casting nonscalar to the same type"
msgstr ""
-#: c-typeck.c:2976
+#: c-typeck.c:2969
msgid "ISO C forbids casts to union type"
msgstr ""
-#: c-typeck.c:2984
+#: c-typeck.c:2977
msgid "cast to union type from type not present in union"
msgstr ""
-#: c-typeck.c:3035
+#: c-typeck.c:3028
msgid "cast adds new qualifiers to function type"
msgstr ""
#. There are qualifiers present in IN_OTYPE that are not
#. present in IN_TYPE.
-#: c-typeck.c:3040
+#: c-typeck.c:3033
msgid "cast discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3055
+#: c-typeck.c:3048
msgid "cast increases required alignment of target type"
msgstr ""
-#: c-typeck.c:3061 cp/typeck.c:4850
+#: c-typeck.c:3054 cp/typeck.c:4850
msgid "cast from pointer to integer of different size"
msgstr ""
-#: c-typeck.c:3066
+#: c-typeck.c:3059
msgid "cast does not match function type"
msgstr ""
-#: c-typeck.c:3073 cp/typeck.c:4857
+#: c-typeck.c:3066 cp/typeck.c:4857
msgid "cast to pointer from integer of different size"
msgstr ""
-#: c-typeck.c:3085
+#: c-typeck.c:3078
msgid "type-punning to incomplete type might break strict-aliasing rules"
msgstr ""
-#: c-typeck.c:3089
+#: c-typeck.c:3082
msgid "dereferencing type-punned pointer will break strict-aliasing rules"
msgstr ""
#. Now we have handled acceptable kinds of LHS that are not truly lvalues.
#. Reject anything strange now.
-#: c-typeck.c:3248
+#: c-typeck.c:3241
msgid "invalid lvalue in assignment"
msgstr ""
#. Convert new value to destination type.
-#: c-typeck.c:3257 c-typeck.c:3282 c-typeck.c:3299 cp/typeck.c:4969
+#: c-typeck.c:3250 c-typeck.c:3275 c-typeck.c:3292 cp/typeck.c:4969
#: cp/typeck.c:5113
msgid "assignment"
msgstr ""
-#: c-typeck.c:3366
+#: c-typeck.c:3359
msgid "cannot pass rvalue to reference parameter"
msgstr ""
-#: c-typeck.c:3475 c-typeck.c:3551
+#: c-typeck.c:3468 c-typeck.c:3544
#, c-format
msgid "%s makes qualified function pointer from unqualified"
msgstr ""
-#: c-typeck.c:3479 c-typeck.c:3531
+#: c-typeck.c:3472 c-typeck.c:3524
#, c-format
msgid "%s discards qualifiers from pointer target type"
msgstr ""
-#: c-typeck.c:3485
+#: c-typeck.c:3478
msgid "ISO C prohibits argument conversion to union type"
msgstr ""
-#: c-typeck.c:3523
+#: c-typeck.c:3516
#, c-format
msgid "ISO C forbids %s between function pointer and `void *'"
msgstr ""
-#: c-typeck.c:3540
+#: c-typeck.c:3533
#, c-format
msgid "pointer targets in %s differ in signedness"
msgstr ""
-#: c-typeck.c:3556
+#: c-typeck.c:3549
#, c-format
msgid "%s from incompatible pointer type"
msgstr ""
-#: c-typeck.c:3562 c-typeck.c:4066 cp/typeck.c:1336
+#: c-typeck.c:3555 c-typeck.c:4061 cp/typeck.c:1336
msgid "invalid use of non-lvalue array"
msgstr ""
-#: c-typeck.c:3577
+#: c-typeck.c:3570
#, c-format
msgid "%s makes pointer from integer without a cast"
msgstr ""
-#: c-typeck.c:3585
+#: c-typeck.c:3578
#, c-format
msgid "%s makes integer from pointer without a cast"
msgstr ""
-#: c-typeck.c:3599 c-typeck.c:3602
+#: c-typeck.c:3592 c-typeck.c:3595
#, c-format
msgid "incompatible type for argument %d of `%s'"
msgstr ""
-#: c-typeck.c:3606
+#: c-typeck.c:3599
#, c-format
msgid "incompatible type for argument %d of indirect function call"
msgstr ""
-#: c-typeck.c:3610
+#: c-typeck.c:3603
#, c-format
msgid "incompatible types in %s"
msgstr ""
#. Function name is known; supply it.
-#: c-typeck.c:3664
+#: c-typeck.c:3659
#, c-format
msgid "passing arg of `%s'"
msgstr ""
#. Function name unknown (call through ptr).
-#: c-typeck.c:3673
+#: c-typeck.c:3668
msgid "passing arg of pointer to function"
msgstr ""
#. Function name is known; supply it.
-#: c-typeck.c:3681
+#: c-typeck.c:3676
#, c-format
msgid "passing arg %d of `%s'"
msgstr ""
#. Function name unknown (call through ptr); just give arg number.
-#: c-typeck.c:3690
+#: c-typeck.c:3685
#, c-format
msgid "passing arg %d of pointer to function"
msgstr ""
-#: c-typeck.c:3747
+#: c-typeck.c:3742
msgid "traditional C rejects automatic aggregate initialization"
msgstr ""
-#: c-typeck.c:3918 c-typeck.c:3933 c-typeck.c:3948
+#: c-typeck.c:3913 c-typeck.c:3928 c-typeck.c:3943
#, c-format
msgid "(near initialization for `%s')"
msgstr ""
-#: c-typeck.c:3997 cp/typeck2.c:458
+#: c-typeck.c:3992 cp/typeck2.c:458
msgid "char-array initialized from wide string"
msgstr ""
-#: c-typeck.c:4004 cp/typeck2.c:465
+#: c-typeck.c:3999 cp/typeck2.c:465
msgid "int-array initialized from non-wide string"
msgstr ""
-#: c-typeck.c:4022 cp/typeck2.c:481
+#: c-typeck.c:4017 cp/typeck2.c:481
msgid "initializer-string for array of chars is too long"
msgstr ""
-#: c-typeck.c:4089
+#: c-typeck.c:4084
msgid "array initialized from non-constant array expression"
msgstr ""
-#: c-typeck.c:4106 c-typeck.c:4108 c-typeck.c:4124 c-typeck.c:4145
-#: c-typeck.c:5525
+#: c-typeck.c:4101 c-typeck.c:4103 c-typeck.c:4119 c-typeck.c:4140
+#: c-typeck.c:5520
msgid "initializer element is not constant"
msgstr ""
-#: c-typeck.c:4140
+#: c-typeck.c:4135
msgid "initialization"
msgstr ""
-#: c-typeck.c:4151 c-typeck.c:5530
+#: c-typeck.c:4146 c-typeck.c:5525
msgid "initializer element is not computable at load time"
msgstr ""
-#: c-typeck.c:4166 cp/typeck2.c:558
+#: c-typeck.c:4161 cp/typeck2.c:558
msgid "invalid initializer"
msgstr ""
-#: c-typeck.c:4449 cp/decl.c:4424
+#: c-typeck.c:4444 cp/decl.c:4422
msgid "opaque vector types cannot be initialized"
msgstr ""
-#: c-typeck.c:4643
+#: c-typeck.c:4638
msgid "extra brace group at end of initializer"
msgstr ""
-#: c-typeck.c:4663
+#: c-typeck.c:4658
msgid "missing braces around initializer"
msgstr ""
-#: c-typeck.c:4723
+#: c-typeck.c:4718
msgid "braces around scalar initializer"
msgstr ""
-#: c-typeck.c:4770
+#: c-typeck.c:4765
msgid "initialization of flexible array member in a nested context"
msgstr ""
-#: c-typeck.c:4772
+#: c-typeck.c:4767
msgid "initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:4803
+#: c-typeck.c:4798
msgid "missing initializer"
msgstr ""
-#: c-typeck.c:4829
+#: c-typeck.c:4824
msgid "empty scalar initializer"
msgstr ""
-#: c-typeck.c:4834
+#: c-typeck.c:4829
msgid "extra elements in scalar initializer"
msgstr ""
-#: c-typeck.c:4919
+#: c-typeck.c:4914
msgid "initialization designators may not nest"
msgstr ""
-#: c-typeck.c:4940 c-typeck.c:5008
+#: c-typeck.c:4935 c-typeck.c:5003
msgid "array index in non-array initializer"
msgstr ""
-#: c-typeck.c:4945 c-typeck.c:5061
+#: c-typeck.c:4940 c-typeck.c:5056
msgid "field name not in record or union initializer"
msgstr ""
-#: c-typeck.c:5004 c-typeck.c:5006
+#: c-typeck.c:4999 c-typeck.c:5001
msgid "nonconstant array index in initializer"
msgstr ""
-#: c-typeck.c:5010 c-typeck.c:5013
+#: c-typeck.c:5005 c-typeck.c:5008
msgid "array index in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5024
+#: c-typeck.c:5019
msgid "empty index range in initializer"
msgstr ""
-#: c-typeck.c:5033
+#: c-typeck.c:5028
msgid "array index range in initializer exceeds array bounds"
msgstr ""
-#: c-typeck.c:5073
+#: c-typeck.c:5068
#, c-format
msgid "unknown field `%s' specified in initializer"
msgstr ""
-#: c-typeck.c:5109 c-typeck.c:5130 c-typeck.c:5592
+#: c-typeck.c:5104 c-typeck.c:5125 c-typeck.c:5587
msgid "initialized field with side-effects overwritten"
msgstr ""
-#: c-typeck.c:5800
+#: c-typeck.c:5795
msgid "excess elements in char array initializer"
msgstr ""
-#: c-typeck.c:5807 c-typeck.c:5853
+#: c-typeck.c:5802 c-typeck.c:5848
msgid "excess elements in struct initializer"
msgstr ""
-#: c-typeck.c:5868
+#: c-typeck.c:5863
msgid "non-static initialization of a flexible array member"
msgstr ""
-#: c-typeck.c:5935
+#: c-typeck.c:5930
msgid "excess elements in union initializer"
msgstr ""
-#: c-typeck.c:5956
+#: c-typeck.c:5951
msgid "traditional C rejects initialization of unions"
msgstr ""
-#: c-typeck.c:6019
+#: c-typeck.c:6014
msgid "excess elements in array initializer"
msgstr ""
-#: c-typeck.c:6048
+#: c-typeck.c:6043
msgid "excess elements in vector initializer"
msgstr ""
-#: c-typeck.c:6070
+#: c-typeck.c:6065
msgid "excess elements in scalar initializer"
msgstr ""
-#: c-typeck.c:6157
+#: c-typeck.c:6152
msgid "argument of `asm' is not a constant string"
msgstr ""
-#: c-typeck.c:6172
+#: c-typeck.c:6167
msgid "asm template is not a string constant"
msgstr ""
-#: c-typeck.c:6204
+#: c-typeck.c:6199
msgid "invalid lvalue in asm statement"
msgstr ""
-#: c-typeck.c:6276
+#: c-typeck.c:6271
msgid "modification by `asm'"
msgstr ""
-#: c-typeck.c:6294 cp/typeck.c:5883
+#: c-typeck.c:6289 cp/typeck.c:5883
msgid "function declared `noreturn' has a `return' statement"
msgstr ""
-#: c-typeck.c:6301
+#: c-typeck.c:6296
msgid "`return' with no value, in function returning non-void"
msgstr ""
-#: c-typeck.c:6307
+#: c-typeck.c:6302
msgid "`return' with a value, in function returning void"
msgstr ""
-#: c-typeck.c:6311
+#: c-typeck.c:6306
msgid "return"
msgstr ""
-#: c-typeck.c:6363
+#: c-typeck.c:6358
msgid "function returns address of local variable"
msgstr ""
-#: c-typeck.c:6418 cp/semantics.c:734
+#: c-typeck.c:6413 cp/semantics.c:734
msgid "switch quantity not an integer"
msgstr ""
-#: c-typeck.c:6428
+#: c-typeck.c:6423
msgid "`long' switch expression not converted to `int' in ISO C"
msgstr ""
-#: c-typeck.c:6469 cp/decl.c:2430
+#: c-typeck.c:6464 cp/parser.c:5281
msgid "case label not within a switch statement"
msgstr ""
-#: c-typeck.c:6471 cp/decl.c:2435
+#: c-typeck.c:6466
msgid "`default' label not within a switch statement"
msgstr ""
-#: c-typeck.c:6623 c-typeck.c:6657
+#: c-typeck.c:6618 c-typeck.c:6652
msgid "division by zero"
msgstr ""
-#: c-typeck.c:6702 cp/typeck.c:2888
+#: c-typeck.c:6697 cp/typeck.c:2888
msgid "right shift count is negative"
msgstr ""
-#: c-typeck.c:6709 cp/typeck.c:2894
+#: c-typeck.c:6704 cp/typeck.c:2894
msgid "right shift count >= width of type"
msgstr ""
-#: c-typeck.c:6730 cp/typeck.c:2913
+#: c-typeck.c:6725 cp/typeck.c:2913
msgid "left shift count is negative"
msgstr ""
-#: c-typeck.c:6733 cp/typeck.c:2915
+#: c-typeck.c:6728 cp/typeck.c:2915
msgid "left shift count >= width of type"
msgstr ""
-#: c-typeck.c:6754
+#: c-typeck.c:6749
msgid "shift count is negative"
msgstr ""
-#: c-typeck.c:6756
+#: c-typeck.c:6751
msgid "shift count >= width of type"
msgstr ""
-#: c-typeck.c:6773 cp/typeck.c:2950
+#: c-typeck.c:6768 cp/typeck.c:2950
msgid "comparing floating point with == or != is unsafe"
msgstr ""
-#: c-typeck.c:6799 c-typeck.c:6805
+#: c-typeck.c:6794 c-typeck.c:6800
msgid "ISO C forbids comparison of `void *' with function pointer"
msgstr ""
-#: c-typeck.c:6808 c-typeck.c:6848 c-typeck.c:6876
+#: c-typeck.c:6803 c-typeck.c:6843 c-typeck.c:6871
msgid "comparison of distinct pointer types lacks a cast"
msgstr ""
-#: c-typeck.c:6822 c-typeck.c:6827 c-typeck.c:6896 c-typeck.c:6901
+#: c-typeck.c:6817 c-typeck.c:6822 c-typeck.c:6891 c-typeck.c:6896
msgid "comparison between pointer and integer"
msgstr ""
-#: c-typeck.c:6843 c-typeck.c:6871
+#: c-typeck.c:6838 c-typeck.c:6866
msgid "ISO C forbids ordered comparisons of pointers to functions"
msgstr ""
-#: c-typeck.c:6868
+#: c-typeck.c:6863
msgid "comparison of complete and incomplete pointers"
msgstr ""
-#: c-typeck.c:6884 c-typeck.c:6891
+#: c-typeck.c:6879 c-typeck.c:6886
msgid "ordered comparison of pointer with integer zero"
msgstr ""
-#: c-typeck.c:6915 cp/typeck.c:3086
+#: c-typeck.c:6910 cp/typeck.c:3086
msgid "unordered comparison on non-floating point argument"
msgstr ""
-#: c-typeck.c:7125
+#: c-typeck.c:7120
msgid "comparison between signed and unsigned"
msgstr ""
-#: c-typeck.c:7171 cp/typeck.c:3333
+#: c-typeck.c:7166 cp/typeck.c:3333
msgid "comparison of promoted ~unsigned with constant"
msgstr ""
-#: c-typeck.c:7179 cp/typeck.c:3341
+#: c-typeck.c:7174 cp/typeck.c:3341
msgid "comparison of promoted ~unsigned with unsigned"
msgstr ""
-#: calls.c:1814 tree-inline.c:1328
+#: calls.c:1837 tree-inline.c:1335
msgid "%Jinlining failed in call to '%F'"
msgstr ""
-#: calls.c:1815 calls.c:2155 tree-inline.c:1329
+#: calls.c:1838 calls.c:2206 tree-inline.c:1336
msgid "called from here"
msgstr ""
-#: calls.c:2154
+#: calls.c:2205
msgid "%Jcan't inline call to '%F'"
msgstr ""
-#: calls.c:2163
+#: calls.c:2214
msgid ""
"ignoring return value of `%D', declared with attribute warn_unused_result"
msgstr ""
-#: calls.c:2176
+#: calls.c:2227
msgid ""
"ignoring return value of function declared with attribute warn_unused_result"
msgstr ""
-#: calls.c:2186
+#: calls.c:2237
msgid "function call has aggregate value"
msgstr ""
@@ -3251,7 +3251,7 @@ msgstr ""
msgid "verify_flow_info: Basic block %d succ edge is corrupted"
msgstr ""
-#: cfg.c:907 cfgrtl.c:1943
+#: cfg.c:907 cfgrtl.c:1973
#, c-format
msgid "Wrong amount of branch edges after unconditional jump %i"
msgstr ""
@@ -3330,120 +3330,124 @@ msgstr ""
msgid "Edge from %d to %d should not be marked irreducible."
msgstr ""
-#: cfgrtl.c:1849
+#: cfgrtl.c:1879
#, c-format
msgid "end insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:1863
+#: cfgrtl.c:1893
#, c-format
msgid "insn %d is in multiple basic blocks (%d and %d)"
msgstr ""
-#: cfgrtl.c:1875
+#: cfgrtl.c:1905
#, c-format
msgid "head insn %d for block %d not found in the insn stream"
msgstr ""
-#: cfgrtl.c:1897
+#: cfgrtl.c:1927
msgid "verify_flow_info: REG_BR_PROB does not match cfg %wi %i"
msgstr ""
-#: cfgrtl.c:1925
+#: cfgrtl.c:1955
#, c-format
msgid "Missing REG_EH_REGION note in the end of bb %i"
msgstr ""
-#: cfgrtl.c:1933
+#: cfgrtl.c:1963
#, c-format
msgid "Too many outgoing branch edges from bb %i"
msgstr ""
-#: cfgrtl.c:1938
+#: cfgrtl.c:1968
#, c-format
msgid "Fallthru edge after unconditional jump %i"
msgstr ""
-#: cfgrtl.c:1949
+#: cfgrtl.c:1979
#, c-format
msgid "Wrong amount of branch edges after conditional jump %i"
msgstr ""
-#: cfgrtl.c:1954
+#: cfgrtl.c:1984
#, c-format
msgid "Call edges for non-call insn in bb %i"
msgstr ""
-#: cfgrtl.c:1963
+#: cfgrtl.c:1993
#, c-format
msgid "Abnormal edges for no purpose in bb %i"
msgstr ""
-#: cfgrtl.c:1973
+#: cfgrtl.c:2003
#, c-format
msgid "insn %d inside basic block %d but block_for_insn is NULL"
msgstr ""
-#: cfgrtl.c:1977
+#: cfgrtl.c:2007
#, c-format
msgid "insn %d inside basic block %d but block_for_insn is %i"
msgstr ""
-#: cfgrtl.c:1991 cfgrtl.c:2001
+#: cfgrtl.c:2021 cfgrtl.c:2031
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK is missing for block %d"
msgstr ""
-#: cfgrtl.c:2014
+#: cfgrtl.c:2044
#, c-format
msgid "NOTE_INSN_BASIC_BLOCK %d in middle of basic block %d"
msgstr ""
-#: cfgrtl.c:2024
+#: cfgrtl.c:2054
#, c-format
msgid "in basic block %d:"
msgstr ""
-#: cfgrtl.c:2025
+#: cfgrtl.c:2055
msgid "flow control insn inside a basic block"
msgstr ""
-#: cfgrtl.c:2071
+#: cfgrtl.c:2101
#, c-format
msgid "missing barrier after block %i"
msgstr ""
-#: cfgrtl.c:2084
+#: cfgrtl.c:2114
#, c-format
msgid "verify_flow_info: Incorrect blocks for fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2099
+#: cfgrtl.c:2129
#, c-format
msgid "verify_flow_info: Incorrect fallthru %i->%i"
msgstr ""
-#: cfgrtl.c:2101
+#: cfgrtl.c:2131
msgid "wrong insn in the fallthru edge"
msgstr ""
-#: cfgrtl.c:2118
+#: cfgrtl.c:2148
msgid "basic blocks not laid down consecutively"
msgstr ""
-#: cfgrtl.c:2143
+#: cfgrtl.c:2173
msgid "insn outside basic block"
msgstr ""
-#: cfgrtl.c:2151
+#: cfgrtl.c:2181
msgid "return not followed by barrier"
msgstr ""
-#: cfgrtl.c:2158
+#: cfgrtl.c:2188
#, c-format
msgid "number of bb notes in insn chain (%d) != n_basic_blocks (%d)"
msgstr ""
+#: cgraph.c:463
+msgid "%D renamed after being referenced in assembly"
+msgstr ""
+
#: collect2.c:406
msgid "internal error"
msgstr ""
@@ -3624,7 +3628,7 @@ msgstr ""
msgid "library lib%s not found"
msgstr ""
-#: combine.c:13052
+#: combine.c:13014
#, c-format
msgid ""
";; Combiner statistics: %d attempts, %d substitutions (%d requiring new "
@@ -3633,7 +3637,7 @@ msgid ""
"\n"
msgstr ""
-#: combine.c:13061
+#: combine.c:13023
#, c-format
msgid ""
"\n"
@@ -3757,87 +3761,86 @@ msgstr ""
msgid "the meaning of '\\%c' is different in traditional C"
msgstr ""
-#. We'll error when we try it out as the start of an identifier.
-#: cppcharset.c:836
+#: cppcharset.c:837
#, c-format
msgid "incomplete universal character name %.*s"
msgstr ""
-#: cppcharset.c:847
+#: cppcharset.c:849
#, c-format
msgid "%.*s is not a valid universal character"
msgstr ""
-#: cppcharset.c:857
+#: cppcharset.c:859
#, c-format
msgid "universal character %.*s is not valid in an identifier"
msgstr ""
-#: cppcharset.c:861
+#: cppcharset.c:863
#, c-format
msgid "universal character %.*s is not valid at the start of an identifier"
msgstr ""
-#: cppcharset.c:895
+#: cppcharset.c:898
msgid "converting UCN to source character set"
msgstr ""
-#: cppcharset.c:898
+#: cppcharset.c:902
msgid "converting UCN to execution character set"
msgstr ""
-#: cppcharset.c:963
+#: cppcharset.c:967
msgid "the meaning of '\\x' is different in traditional C"
msgstr ""
-#: cppcharset.c:980 f/lex.c:580
+#: cppcharset.c:984 f/lex.c:580
msgid "\\x used with no following hex digits"
msgstr ""
-#: cppcharset.c:987
+#: cppcharset.c:991
msgid "hex escape sequence out of range"
msgstr ""
-#: cppcharset.c:1026
+#: cppcharset.c:1030
msgid "octal escape sequence out of range"
msgstr ""
-#: cppcharset.c:1094
+#: cppcharset.c:1098
msgid "the meaning of '\\a' is different in traditional C"
msgstr ""
-#: cppcharset.c:1101
+#: cppcharset.c:1105
#, c-format
msgid "non-ISO-standard escape sequence, '\\%c'"
msgstr ""
-#: cppcharset.c:1109
+#: cppcharset.c:1113
#, c-format
msgid "unknown escape sequence '\\%c'"
msgstr ""
-#: cppcharset.c:1112
+#: cppcharset.c:1116
#, c-format
msgid "unknown escape sequence: '\\%03o'"
msgstr ""
-#: cppcharset.c:1118
+#: cppcharset.c:1122
msgid "converting escape sequence to execution character set"
msgstr ""
-#: cppcharset.c:1177
+#: cppcharset.c:1181
msgid "converting to execution character set"
msgstr ""
-#: cppcharset.c:1239 cppcharset.c:1301
+#: cppcharset.c:1244 cppcharset.c:1307
msgid "character constant too long for its type"
msgstr ""
-#: cppcharset.c:1242
+#: cppcharset.c:1247
msgid "multi-character character constant"
msgstr ""
-#: cppcharset.c:1333
+#: cppcharset.c:1339
msgid "empty character constant"
msgstr ""
@@ -3853,187 +3856,195 @@ msgstr ""
msgid "stdout"
msgstr ""
-#: cppexp.c:191
+#: cppexp.c:192
msgid "too many decimal points in number"
msgstr ""
-#: cppexp.c:211
+#: cppexp.c:212
#, c-format
msgid "invalid digit \"%c\" in octal constant"
msgstr ""
-#: cppexp.c:217
+#: cppexp.c:218
msgid "use of C99 hexadecimal floating constant"
msgstr ""
-#: cppexp.c:226
+#: cppexp.c:227
msgid "exponent has no digits"
msgstr ""
-#: cppexp.c:233
+#: cppexp.c:234
msgid "hexadecimal floating constants require an exponent"
msgstr ""
-#: cppexp.c:239
+#: cppexp.c:240
#, c-format
msgid "invalid suffix \"%.*s\" on floating constant"
msgstr ""
-#: cppexp.c:249 cppexp.c:274
+#: cppexp.c:250 cppexp.c:275
#, c-format
msgid "traditional C rejects the \"%.*s\" suffix"
msgstr ""
-#: cppexp.c:260
+#: cppexp.c:261
#, c-format
msgid "invalid suffix \"%.*s\" on integer constant"
msgstr ""
-#: cppexp.c:281
+#: cppexp.c:283
msgid "use of C99 long long integer constant"
msgstr ""
-#: cppexp.c:287
+#: cppexp.c:290
msgid "imaginary constants are a GCC extension"
msgstr ""
-#: cppexp.c:373
+#: cppexp.c:376
msgid "integer constant is too large for its type"
msgstr ""
-#: cppexp.c:385
+#: cppexp.c:388
msgid "integer constant is so large that it is unsigned"
msgstr ""
-#: cppexp.c:467
+#: cppexp.c:470
msgid "missing ')' after \"defined\""
msgstr ""
-#: cppexp.c:474
+#: cppexp.c:477
msgid "operator \"defined\" requires an identifier"
msgstr ""
-#: cppexp.c:482
+#: cppexp.c:485
#, c-format
msgid "(\"%s\" is an alternative token for \"%s\" in C++)"
msgstr ""
-#: cppexp.c:492
+#: cppexp.c:495
msgid "this use of \"defined\" may not be portable"
msgstr ""
-#: cppexp.c:528
+#: cppexp.c:531
msgid "floating constant in preprocessor expression"
msgstr ""
-#: cppexp.c:534
+#: cppexp.c:537
msgid "imaginary number in preprocessor expression"
msgstr ""
-#: cppexp.c:579
+#: cppexp.c:582
#, c-format
msgid "\"%s\" is not defined"
msgstr ""
-#: cppexp.c:711 cppexp.c:740
+#: cppexp.c:714 cppexp.c:743
#, c-format
msgid "missing binary operator before token \"%s\""
msgstr ""
-#: cppexp.c:731
+#: cppexp.c:734
#, c-format
msgid "token \"%s\" is not valid in preprocessor expressions"
msgstr ""
-#: cppexp.c:750
+#: cppexp.c:753
msgid "void expression between '(' and ')'"
msgstr ""
-#: cppexp.c:753
+#: cppexp.c:756
msgid "#if with no expression"
msgstr ""
-#: cppexp.c:755
+#: cppexp.c:758
#, c-format
msgid "operator '%s' has no right operand"
msgstr ""
-#: cppexp.c:781
+#: cppexp.c:784
msgid " ':' without preceding '?'"
msgstr ""
-#: cppexp.c:808
+#: cppexp.c:811
msgid "unbalanced stack in #if"
msgstr ""
-#: cppexp.c:827
+#: cppexp.c:830
#, c-format
msgid "impossible operator '%u'"
msgstr ""
-#: cppexp.c:919
+#: cppexp.c:922
msgid "missing ')' in expression"
msgstr ""
-#: cppexp.c:940
+#: cppexp.c:943
msgid "'?' without following ':'"
msgstr ""
-#: cppexp.c:950
+#: cppexp.c:953
msgid "integer overflow in preprocessor expression"
msgstr ""
-#: cppexp.c:955
+#: cppexp.c:958
msgid "missing '(' in expression"
msgstr ""
-#: cppexp.c:987
+#: cppexp.c:990
#, c-format
msgid "the left operand of \"%s\" changes sign when promoted"
msgstr ""
-#: cppexp.c:992
+#: cppexp.c:995
#, c-format
msgid "the right operand of \"%s\" changes sign when promoted"
msgstr ""
-#: cppexp.c:1250
+#: cppexp.c:1253
msgid "traditional C rejects the unary plus operator"
msgstr ""
-#: cppexp.c:1349
+#: cppexp.c:1352
msgid "comma operator in operand of #if"
msgstr ""
-#: cppexp.c:1480
+#: cppexp.c:1483
msgid "division by zero in #if"
msgstr ""
-#: cppfiles.c:357
+#: cppfiles.c:367
msgid "NULL directory in find_file"
msgstr ""
-#: cppfiles.c:435
+#: cppfiles.c:392
+msgid "one or more PCH files were found, but they were invalid"
+msgstr ""
+
+#: cppfiles.c:395
+msgid "use -Winvalid-pch for more information"
+msgstr ""
+
+#: cppfiles.c:453
#, c-format
msgid "%s is a block device"
msgstr ""
-#: cppfiles.c:452
+#: cppfiles.c:470
#, c-format
msgid "%s is too large"
msgstr ""
-#: cppfiles.c:486
+#: cppfiles.c:505
#, c-format
msgid "%s is shorter than expected"
msgstr ""
-#: cppfiles.c:679
+#: cppfiles.c:698
#, c-format
msgid "no include path in which to search for %s"
msgstr ""
-#: cppfiles.c:921
+#: cppfiles.c:940
msgid "Multiple include guards may be useful for:\n"
msgstr ""
@@ -4064,11 +4075,11 @@ msgstr ""
msgid "target int is narrower than target char"
msgstr ""
-#: cppinit.c:412
+#: cppinit.c:413
msgid "CPP half-integer narrower than CPP character"
msgstr ""
-#: cppinit.c:416
+#: cppinit.c:417
#, c-format
msgid ""
"CPP on this host cannot handle wide character constants over %lu bits, but "
@@ -4092,27 +4103,27 @@ msgstr ""
msgid "__VA_ARGS__ can only appear in the expansion of a C99 variadic macro"
msgstr ""
-#: cpplex.c:595
+#: cpplex.c:596
msgid "null character(s) preserved in literal"
msgstr ""
-#: cpplex.c:915
+#: cpplex.c:916
msgid "unterminated comment"
msgstr ""
-#: cpplex.c:926
+#: cpplex.c:927
msgid "C++ style comments are not allowed in ISO C90"
msgstr ""
-#: cpplex.c:928
+#: cpplex.c:929
msgid "(this will be reported only once per input file)"
msgstr ""
-#: cpplex.c:933
+#: cpplex.c:934
msgid "multi-line comment"
msgstr ""
-#: cpplex.c:1196
+#: cpplex.c:1198
#, c-format
msgid "unspellable token %s"
msgstr ""
@@ -4172,143 +4183,143 @@ msgstr ""
msgid "macro names must be identifiers"
msgstr ""
-#: cpplib.c:531
+#: cpplib.c:532
#, c-format
msgid "undefining \"%s\""
msgstr ""
-#: cpplib.c:601
+#: cpplib.c:602
msgid "missing terminating > character"
msgstr ""
-#: cpplib.c:654
+#: cpplib.c:655
#, c-format
msgid "#%s expects \"FILENAME\" or <FILENAME>"
msgstr ""
-#: cpplib.c:677
+#: cpplib.c:678
msgid "#include nested too deeply"
msgstr ""
-#: cpplib.c:715
+#: cpplib.c:716
msgid "#include_next in primary source file"
msgstr ""
-#: cpplib.c:741
+#: cpplib.c:742
#, c-format
msgid "invalid flag \"%s\" in line directive"
msgstr ""
-#: cpplib.c:786
+#: cpplib.c:787
#, c-format
msgid "\"%s\" after #line is not a positive integer"
msgstr ""
-#: cpplib.c:792
+#: cpplib.c:793
msgid "line number out of range"
msgstr ""
-#: cpplib.c:804 cpplib.c:876
+#: cpplib.c:805 cpplib.c:878
#, c-format
msgid "\"%s\" is not a valid filename"
msgstr ""
-#: cpplib.c:838
+#: cpplib.c:840
#, c-format
msgid "\"%s\" after # is not a positive integer"
msgstr ""
-#: cpplib.c:938
+#: cpplib.c:940
msgid "invalid #ident directive"
msgstr ""
-#: cpplib.c:1018
+#: cpplib.c:1020
#, c-format
msgid "registering \"%s\" as both a pragma and a pragma namespace"
msgstr ""
-#: cpplib.c:1021
+#: cpplib.c:1023
#, c-format
msgid "#pragma %s %s is already registered"
msgstr ""
-#: cpplib.c:1024
+#: cpplib.c:1026
#, c-format
msgid "#pragma %s is already registered"
msgstr ""
-#: cpplib.c:1169
+#: cpplib.c:1171
msgid "#pragma once in main file"
msgstr ""
-#: cpplib.c:1191
+#: cpplib.c:1194
msgid "invalid #pragma GCC poison directive"
msgstr ""
-#: cpplib.c:1200
+#: cpplib.c:1203
#, c-format
msgid "poisoning existing macro \"%s\""
msgstr ""
-#: cpplib.c:1221
+#: cpplib.c:1224
msgid "#pragma system_header ignored outside include file"
msgstr ""
-#: cpplib.c:1245
+#: cpplib.c:1248
#, c-format
msgid "cannot find source file %s"
msgstr ""
-#: cpplib.c:1248
+#: cpplib.c:1252
#, c-format
msgid "current file is older than %s"
msgstr ""
-#: cpplib.c:1362
+#: cpplib.c:1366
msgid "_Pragma takes a parenthesized string literal"
msgstr ""
-#: cpplib.c:1440
+#: cpplib.c:1444
msgid "#else without #if"
msgstr ""
-#: cpplib.c:1445
+#: cpplib.c:1449
msgid "#else after #else"
msgstr ""
-#: cpplib.c:1473
+#: cpplib.c:1477
msgid "#elif without #if"
msgstr ""
-#: cpplib.c:1478
+#: cpplib.c:1482
msgid "#elif after #else"
msgstr ""
-#: cpplib.c:1508
+#: cpplib.c:1512
msgid "#endif without #if"
msgstr ""
-#: cpplib.c:1585
+#: cpplib.c:1589
msgid "missing '(' after predicate"
msgstr ""
-#: cpplib.c:1600
+#: cpplib.c:1604
msgid "missing ')' to complete answer"
msgstr ""
-#: cpplib.c:1620
+#: cpplib.c:1624
msgid "predicate's answer is empty"
msgstr ""
-#: cpplib.c:1647
+#: cpplib.c:1651
msgid "assertion without predicate"
msgstr ""
-#: cpplib.c:1649
+#: cpplib.c:1653
msgid "predicate must be an identifier"
msgstr ""
-#: cpplib.c:1733
+#: cpplib.c:1737
#, c-format
msgid "\"%s\" re-asserted"
msgstr ""
@@ -4407,26 +4418,26 @@ msgstr ""
msgid "invalid hash type %d in cpp_macro_definition"
msgstr ""
-#: cpppch.c:83 cpppch.c:331 cpppch.c:355 cpppch.c:364
+#: cpppch.c:84 cpppch.c:332 cpppch.c:356 cpppch.c:365
msgid "while writing precompiled header"
msgstr ""
-#: cpppch.c:462
+#: cpppch.c:463
#, c-format
msgid "%s: not used because `%.*s' not defined"
msgstr ""
-#: cpppch.c:474
+#: cpppch.c:475
#, c-format
msgid "%s: not used because `%.*s' defined as `%s' not `%.*s'"
msgstr ""
-#: cpppch.c:515
+#: cpppch.c:516
#, c-format
msgid "%s: not used because `%s' is defined"
msgstr ""
-#: cpppch.c:528 cpppch.c:714
+#: cpppch.c:529 cpppch.c:715
msgid "while reading precompiled header"
msgstr ""
@@ -4439,7 +4450,7 @@ msgstr ""
msgid "too many input files"
msgstr ""
-#: cpptrad.c:740
+#: cpptrad.c:744
#, c-format
msgid "detected recursion whilst expanding macro \"%s\""
msgstr ""
@@ -4498,7 +4509,7 @@ msgstr ""
msgid "can't access imaginary part of complex value in hard register"
msgstr ""
-#: emit-rtl.c:3468
+#: emit-rtl.c:3456
msgid "ICE: emit_insn used where emit_jump_insn needed:\n"
msgstr ""
@@ -4511,11 +4522,11 @@ msgstr ""
msgid "exception handling disabled, use -fexceptions to enable"
msgstr ""
-#: except.c:2919
+#: except.c:2923
msgid "argument of `__builtin_eh_return_regno' must be constant"
msgstr ""
-#: except.c:3050
+#: except.c:3054
msgid "__builtin_eh_return not supported on this target"
msgstr ""
@@ -4523,24 +4534,24 @@ msgstr ""
msgid "stack limits not supported on this target"
msgstr ""
-#: expr.c:2981
+#: expr.c:2989
msgid "function using short complex types cannot be inline"
msgstr ""
-#: expr.c:5948 expr.c:5957 expr.c:5966 expr.c:5971 expr.c:6300 expr.c:6316
+#: expr.c:5960 expr.c:5969 expr.c:5978 expr.c:5983 expr.c:6312 expr.c:6328
msgid "unsupported wide integer operation"
msgstr ""
-#: expr.c:6359
+#: expr.c:6371
msgid "%Jprior parameter's size depends on '%D'"
msgstr ""
-#: expr.c:6722
+#: expr.c:6734
msgid "returned value in block_exit_expr"
msgstr ""
#. We can't make a bitwise copy of this object, so fail.
-#: expr.c:8866
+#: expr.c:8869
msgid "cannot take the address of an unaligned member"
msgstr ""
@@ -4585,12 +4596,12 @@ msgstr ""
#. We can't handle floating point constants;
#. PRINT_OPERAND must handle them.
-#: final.c:3223 vmsdbgout.c:467 config/i386/i386.c:6651
+#: final.c:3223 vmsdbgout.c:467 config/i386/i386.c:6712
#: config/pdp11/pdp11.c:1645
msgid "floating constant misused"
msgstr ""
-#: final.c:3279 vmsdbgout.c:524 config/i386/i386.c:6729
+#: final.c:3279 vmsdbgout.c:524 config/i386/i386.c:6790
#: config/pdp11/pdp11.c:1692
msgid "invalid expression as operand"
msgstr ""
@@ -4629,7 +4640,7 @@ msgstr ""
msgid "`and' of mutually exclusive equal-tests is always 0"
msgstr ""
-#: fold-const.c:8324
+#: fold-const.c:8328
msgid "fold check: original tree changed by fold"
msgstr ""
@@ -4637,27 +4648,27 @@ msgstr ""
msgid "%Jsize of variable '%D' is too large"
msgstr ""
-#: function.c:3706
+#: function.c:3710
msgid "impossible constraint in `asm'"
msgstr ""
-#: function.c:5626
+#: function.c:5630
msgid "%J'%D' might be used uninitialized in this function"
msgstr ""
-#: function.c:5633
+#: function.c:5637
msgid "%Jvariable '%D' might be clobbered by `longjmp' or `vfork'"
msgstr ""
-#: function.c:5652
+#: function.c:5656
msgid "%Jargument '%D' might be clobbered by `longjmp' or `vfork'"
msgstr ""
-#: function.c:6428
+#: function.c:6432
msgid "function returns an aggregate"
msgstr ""
-#: function.c:6911
+#: function.c:6915
msgid "%Junused parameter '%D'"
msgstr ""
@@ -5800,38 +5811,39 @@ msgstr ""
msgid "usage: %s [-h|-m] > file"
msgstr ""
-#: ggc-common.c:396 ggc-common.c:404 ggc-common.c:485 ggc-common.c:505
-#: ggc-page.c:1984 ggc-page.c:2016 ggc-page.c:2023
+#: ggc-common.c:398 ggc-common.c:406 ggc-common.c:487 ggc-common.c:507
+#: ggc-page.c:2005 ggc-page.c:2037 ggc-page.c:2044 ggc-zone.c:1668
+#: ggc-zone.c:1674 ggc-zone.c:1679 ggc-zone.c:1686
#, c-format
msgid "can't write PCH file: %m"
msgstr ""
-#: ggc-common.c:498
+#: ggc-common.c:500
#, c-format
msgid "can't get position in PCH file: %m"
msgstr ""
-#: ggc-common.c:508
+#: ggc-common.c:510
#, c-format
msgid "can't write padding to PCH file: %m"
msgstr ""
-#: ggc-common.c:561 ggc-common.c:569 ggc-common.c:576 ggc-common.c:579
-#: ggc-common.c:652 ggc-common.c:655 ggc-page.c:2111
+#: ggc-common.c:563 ggc-common.c:571 ggc-common.c:578 ggc-common.c:581
+#: ggc-common.c:654 ggc-common.c:657 ggc-page.c:2132 ggc-zone.c:1698
#, c-format
msgid "can't read PCH file: %m"
msgstr ""
-#: ggc-common.c:679
+#: ggc-common.c:681
msgid "had to relocate PCH"
msgstr ""
-#: ggc-page.c:1301
+#: ggc-page.c:1322
#, c-format
msgid "open /dev/zero: %m"
msgstr ""
-#: ggc-page.c:2001 ggc-page.c:2007
+#: ggc-page.c:2022 ggc-page.c:2028
msgid "can't write PCH file"
msgstr ""
@@ -5966,61 +5978,61 @@ msgstr ""
msgid "-Wuninitialized is not supported without -O"
msgstr ""
-#: opts.c:1330
+#: opts.c:1329
#, c-format
msgid "unrecognized register name \"%s\""
msgstr ""
-#: opts.c:1374
+#: opts.c:1373
#, c-format
msgid "unknown tls-model \"%s\""
msgstr ""
-#: opts.c:1444
+#: opts.c:1443
msgid "use -gdwarf -gN for DWARF v1 level N, and -gdwarf-2 for DWARF v2"
msgstr ""
-#: opts.c:1522
+#: opts.c:1521
#, c-format
msgid "%s: --param arguments should be of the form NAME=VALUE"
msgstr ""
-#: opts.c:1527
+#: opts.c:1526
#, c-format
msgid "invalid --param value `%s'"
msgstr ""
-#: opts.c:1623
+#: opts.c:1622
msgid "target system does not support debug output"
msgstr ""
-#: opts.c:1630
+#: opts.c:1629
#, c-format
msgid "debug format \"%s\" conflicts with prior selection"
msgstr ""
-#: opts.c:1646
+#: opts.c:1645
#, c-format
msgid "unrecognised debug output level \"%s\""
msgstr ""
-#: opts.c:1648
+#: opts.c:1647
#, c-format
msgid "debug output level %s is too high"
msgstr ""
-#: opts.c:1667
+#: opts.c:1666
msgid "The following options are language-independent:\n"
msgstr ""
-#: opts.c:1674
+#: opts.c:1673
#, c-format
msgid ""
"The %s front end recognizes the following options:\n"
"\n"
msgstr ""
-#: opts.c:1688
+#: opts.c:1687
msgid "The --param option recognizes the following as parameters:\n"
msgstr ""
@@ -6396,7 +6408,7 @@ msgstr ""
msgid "can't use '%s' as a %s register"
msgstr ""
-#: regclass.c:764 config/ia64/ia64.c:4417 config/ia64/ia64.c:4424
+#: regclass.c:764 config/ia64/ia64.c:4473 config/ia64/ia64.c:4480
#, c-format
msgid "unknown register name: %s"
msgstr ""
@@ -6433,23 +6445,23 @@ msgstr ""
msgid "validate_value_data: [%u] Non-empty reg in chain (%s %u %i)"
msgstr ""
-#: reload.c:1250
+#: reload.c:1251
msgid "cannot reload integer constant operand in `asm'"
msgstr ""
-#: reload.c:1272
+#: reload.c:1273
msgid "impossible register constraint in `asm'"
msgstr ""
-#: reload.c:3479
+#: reload.c:3501
msgid "`&' constraint used with no register class"
msgstr ""
-#: reload.c:3647
+#: reload.c:3669
msgid "unable to generate reloads for:"
msgstr ""
-#: reload.c:3648 reload.c:3862
+#: reload.c:3670 reload.c:3884
msgid "inconsistent operand constraints in an `asm'"
msgstr ""
@@ -6543,148 +6555,148 @@ msgstr ""
msgid "RTL flag check: %s used with unexpected rtx code `%s' in %s, at %s:%d"
msgstr ""
-#: stmt.c:740
+#: stmt.c:748
#, c-format
msgid "jump to `%s' invalidly jumps into binding contour"
msgstr ""
-#: stmt.c:967 stmt.c:3691
+#: stmt.c:975 stmt.c:3739
msgid "%Jlabel '%D' used before containing binding contour"
msgstr ""
-#: stmt.c:1146
+#: stmt.c:1154
msgid "output operand constraint lacks `='"
msgstr ""
-#: stmt.c:1161
+#: stmt.c:1169
#, c-format
msgid "output constraint `%c' for operand %d is not at the beginning"
msgstr ""
-#: stmt.c:1183
+#: stmt.c:1191
msgid "operand constraint contains incorrectly positioned '+' or '='"
msgstr ""
-#: stmt.c:1189 stmt.c:1287
+#: stmt.c:1197 stmt.c:1295
#, c-format
msgid "`%%' constraint used with last operand"
msgstr ""
-#: stmt.c:1208
+#: stmt.c:1216
msgid "matching constraint not valid in output operand"
msgstr ""
-#: stmt.c:1278
+#: stmt.c:1286
#, c-format
msgid "input operand constraint contains `%c'"
msgstr ""
-#: stmt.c:1318
+#: stmt.c:1326
msgid "matching constraint references invalid operand number"
msgstr ""
-#: stmt.c:1356
+#: stmt.c:1364
#, c-format
msgid "invalid punctuation `%c' in constraint"
msgstr ""
-#: stmt.c:1405
+#: stmt.c:1413
#, c-format
msgid "asm-specifier for variable `%s' conflicts with asm clobber list"
msgstr ""
-#: stmt.c:1495
+#: stmt.c:1503
#, c-format
msgid "unknown register name `%s' in `asm'"
msgstr ""
-#: stmt.c:1503
+#: stmt.c:1511
#, c-format
msgid "PIC register `%s' clobbered in `asm'"
msgstr ""
-#: stmt.c:1552
+#: stmt.c:1560
#, c-format
msgid "more than %d operands in `asm'"
msgstr ""
-#: stmt.c:1614
+#: stmt.c:1622
#, c-format
msgid "output number %d not directly addressable"
msgstr ""
-#: stmt.c:1692
+#: stmt.c:1700
#, c-format
msgid "asm operand %d probably doesn't match constraints"
msgstr ""
-#: stmt.c:1702
+#: stmt.c:1710
#, c-format
msgid "use of memory input without lvalue in asm operand %d is deprecated"
msgstr ""
-#: stmt.c:1853
+#: stmt.c:1861
msgid "asm clobber conflict with output operand"
msgstr ""
-#: stmt.c:1858
+#: stmt.c:1866
msgid "asm clobber conflict with input operand"
msgstr ""
-#: stmt.c:1892
+#: stmt.c:1900
msgid "too many alternatives in `asm'"
msgstr ""
-#: stmt.c:1904
+#: stmt.c:1912
msgid "operand constraints for `asm' differ in number of alternatives"
msgstr ""
-#: stmt.c:1956
+#: stmt.c:1964
#, c-format
msgid "duplicate asm operand name '%s'"
msgstr ""
-#: stmt.c:2054
+#: stmt.c:2062
msgid "missing close brace for named operand"
msgstr ""
-#: stmt.c:2082
+#: stmt.c:2090
#, c-format
msgid "undefined named operand '%s'"
msgstr ""
-#: stmt.c:2138
+#: stmt.c:2146
msgid "%Hstatement with no effect"
msgstr ""
-#: stmt.c:2293
+#: stmt.c:2301
msgid "%Hvalue computed is not used"
msgstr ""
-#: stmt.c:3631
+#: stmt.c:3679
msgid "%Junused variable '%D'"
msgstr ""
-#: stmt.c:4404
+#: stmt.c:4452
msgid "%Hunreachable code at beginning of %s"
msgstr ""
-#: stmt.c:5032
+#: stmt.c:5080
#, c-format
msgid "enumeration value `%s' not handled in switch"
msgstr ""
-#: stmt.c:5057 stmt.c:5077
+#: stmt.c:5105 stmt.c:5125
#, c-format
msgid "case value `%ld' not in enumerated type"
msgstr ""
-#: stmt.c:5060 stmt.c:5080
+#: stmt.c:5108 stmt.c:5128
#, c-format
msgid "case value `%ld' not in enumerated type `%s'"
msgstr ""
-#: stmt.c:5297
+#: stmt.c:5345
msgid "switch missing default case"
msgstr ""
@@ -6738,7 +6750,7 @@ msgstr ""
msgid "packed attribute is unnecessary"
msgstr ""
-#: targhooks.c:158
+#: targhooks.c:161
msgid "__builtin_saveregs not supported by this target"
msgstr ""
@@ -6820,71 +6832,71 @@ msgstr ""
msgid "%J'%F' declared `static' but never defined"
msgstr ""
-#: toplev.c:1736
+#: toplev.c:1740
msgid "%J'%D' defined but not used"
msgstr ""
-#: toplev.c:1757 toplev.c:1774
+#: toplev.c:1761 toplev.c:1778
#, c-format
msgid "`%s' is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:1777
+#: toplev.c:1781
#, c-format
msgid "`%s' is deprecated"
msgstr ""
-#: toplev.c:1780
+#: toplev.c:1784
#, c-format
msgid "type is deprecated (declared at %s:%d)"
msgstr ""
-#: toplev.c:1783
+#: toplev.c:1787
msgid "type is deprecated"
msgstr ""
-#: toplev.c:1980
+#: toplev.c:1984
#, c-format
msgid "invalid register name `%s' for register variable"
msgstr ""
-#: toplev.c:3586
+#: toplev.c:3590
msgid ""
"branch target register load optimization is not intended to be run twice"
msgstr ""
-#: toplev.c:3753
+#: toplev.c:3757
msgid ""
"\n"
"Target specific options:\n"
msgstr ""
-#: toplev.c:3767 toplev.c:3786
+#: toplev.c:3771 toplev.c:3790
#, c-format
msgid " -m%-23s [undocumented]\n"
msgstr ""
-#: toplev.c:3795
+#: toplev.c:3799
msgid ""
"\n"
"There are undocumented target specific options as well.\n"
msgstr ""
-#: toplev.c:3797
+#: toplev.c:3801
msgid " They exist, but they are not documented.\n"
msgstr ""
-#: toplev.c:3852
+#: toplev.c:3856
#, c-format
msgid "unrecognized gcc debugging option: %c"
msgstr ""
-#: toplev.c:3914 config/rs6000/rs6000.c:881
+#: toplev.c:3918 config/rs6000/rs6000.c:943
#, c-format
msgid "invalid option `%s'"
msgstr ""
-#: toplev.c:3929
+#: toplev.c:3933
#, c-format
msgid ""
"%s%s%s version %s (%s)\n"
@@ -6892,95 +6904,95 @@ msgid ""
"%s%s%s version %s (%s) compiled by CC.\n"
msgstr ""
-#: toplev.c:3936
+#: toplev.c:3940
#, c-format
msgid ""
"%s%sGGC heuristics: --param ggc-min-expand=%d --param ggc-min-heapsize=%d\n"
msgstr ""
-#: toplev.c:3988
+#: toplev.c:3992
msgid "options passed: "
msgstr ""
-#: toplev.c:4017
+#: toplev.c:4021
msgid "options enabled: "
msgstr ""
-#: toplev.c:4075 java/jcf-write.c:3422
+#: toplev.c:4079 java/jcf-write.c:3422
#, c-format
msgid "can't open %s for writing: %m"
msgstr ""
-#: toplev.c:4152
+#: toplev.c:4162 config/sh/sh.c:6869
msgid "created and used with different settings of -fpic"
msgstr ""
-#: toplev.c:4154
+#: toplev.c:4164 config/sh/sh.c:6871
msgid "created and used with different settings of -fpie"
msgstr ""
-#: toplev.c:4203
+#: toplev.c:4215 config/sh/sh.c:6921
#, c-format
msgid "created and used with differing settings of `-m%s'"
msgstr ""
-#: toplev.c:4206
+#: toplev.c:4218 config/sh/sh.c:6924
msgid "out of memory"
msgstr ""
-#: toplev.c:4387
+#: toplev.c:4399
msgid "instruction scheduling not supported on this target machine"
msgstr ""
-#: toplev.c:4391
+#: toplev.c:4403
msgid "this target machine does not have delayed branches"
msgstr ""
-#: toplev.c:4405
+#: toplev.c:4417
#, c-format
msgid "-f%sleading-underscore not supported on this target machine"
msgstr ""
-#: toplev.c:4458
+#: toplev.c:4470
#, c-format
msgid "target system does not support the \"%s\" debug format"
msgstr ""
-#: toplev.c:4475
+#: toplev.c:4487
msgid "-ffunction-sections not supported for this target"
msgstr ""
-#: toplev.c:4480
+#: toplev.c:4492
msgid "-fdata-sections not supported for this target"
msgstr ""
-#: toplev.c:4487
+#: toplev.c:4499
msgid "-ffunction-sections disabled; it makes profiling impossible"
msgstr ""
-#: toplev.c:4494
+#: toplev.c:4506
msgid "-fprefetch-loop-arrays not supported for this target"
msgstr ""
-#: toplev.c:4500
+#: toplev.c:4512
msgid ""
"-fprefetch-loop-arrays not supported for this target (try -march switches)"
msgstr ""
-#: toplev.c:4509
+#: toplev.c:4521
msgid "-fprefetch-loop-arrays is not supported with -Os"
msgstr ""
-#: toplev.c:4515
+#: toplev.c:4527
msgid "-ffunction-sections may affect debugging on some targets"
msgstr ""
-#: toplev.c:4617
+#: toplev.c:4629
#, c-format
msgid "error writing to %s: %m"
msgstr ""
-#: toplev.c:4619 java/jcf-parse.c:909 java/jcf-write.c:3429
+#: toplev.c:4631 java/jcf-parse.c:909 java/jcf-write.c:3429
#, c-format
msgid "error closing %s: %m"
msgstr ""
@@ -6995,43 +7007,43 @@ msgstr ""
msgid "ignoring unknown option `%.*s' in `-fdump-%s'"
msgstr ""
-#: tree-inline.c:1011
+#: tree-inline.c:1016
msgid ""
"%Jfunction '%F' can never be inlined because it uses alloca (override using "
"the always_inline attribute)"
msgstr ""
-#: tree-inline.c:1024
+#: tree-inline.c:1029
msgid "%Jfunction '%F' can never be inlined because it uses setjmp"
msgstr ""
-#: tree-inline.c:1038
+#: tree-inline.c:1044
msgid ""
"%Jfunction '%F' can never be inlined because it uses variable argument lists"
msgstr ""
-#: tree-inline.c:1053
+#: tree-inline.c:1060
msgid ""
"%Jfunction '%F' can never be inlined because it uses setjmp-longjmp "
"exception handling"
msgstr ""
-#: tree-inline.c:1071
+#: tree-inline.c:1078
msgid ""
"%Jfunction '%F' can never be inlined because it contains a nested function"
msgstr ""
-#: tree-inline.c:1088
+#: tree-inline.c:1095
msgid ""
"%Jfunction '%F' can never be inlined because it contains a computed goto"
msgstr ""
-#: tree-inline.c:1098
+#: tree-inline.c:1105
msgid ""
"%Jfunction '%F' can never be inlined because it contains a nonlocal goto"
msgstr ""
-#: tree-inline.c:1121
+#: tree-inline.c:1128
msgid ""
"%Jfunction '%F' can never be inlined because it uses variable sized variables"
msgstr ""
@@ -7044,34 +7056,34 @@ msgstr ""
msgid "%Jsize of return value of '%D' is larger than %wd bytes"
msgstr ""
-#: tree.c:3785
+#: tree.c:3793
msgid "arrays of functions are not meaningful"
msgstr ""
-#: tree.c:3840
+#: tree.c:3848
msgid "function return type cannot be function"
msgstr ""
-#: tree.c:4669
+#: tree.c:4677
msgid "invalid initializer for bit string"
msgstr ""
-#: tree.c:4721
+#: tree.c:4729
#, c-format
msgid "tree check: expected %s, have %s in %s, at %s:%d"
msgstr ""
-#: tree.c:4734
+#: tree.c:4742
#, c-format
msgid "tree check: expected class '%c', have '%c' (%s) in %s, at %s:%d"
msgstr ""
-#: tree.c:4747
+#: tree.c:4755
#, c-format
msgid "tree check: accessed elt %d of tree_vec with %d elts in %s, at %s:%d"
msgstr ""
-#: tree.c:4759
+#: tree.c:4767
#, c-format
msgid "tree check: accessed operand %d of %s with %d operands in %s, at %s:%d"
msgstr ""
@@ -7192,154 +7204,148 @@ msgstr ""
msgid "The maximum number of instructions when automatically inlining"
msgstr ""
-#: params.def:84
-msgid ""
-"The maximum number of instructions by repeated inlining before gcc starts to "
-"throttle inlining"
-msgstr ""
-
-#: params.def:94
+#: params.def:75
msgid "The maximum number of instructions for the RTL inliner"
msgstr ""
-#: params.def:105
+#: params.def:86
msgid "The maximum number of instructions to consider to fill a delay slot"
msgstr ""
-#: params.def:116
+#: params.def:97
msgid ""
"The maximum number of instructions to consider to find accurate live "
"register information"
msgstr ""
-#: params.def:126
+#: params.def:107
msgid "The maximum length of scheduling's pending operations list"
msgstr ""
-#: params.def:131
+#: params.def:112
msgid "The size of function body to be considered large"
msgstr ""
-#: params.def:135
+#: params.def:116
msgid "Maximal growth due to inlining of large function (in percent)"
msgstr ""
-#: params.def:139
+#: params.def:120
msgid ""
"how much can given compilation unit grow because of the inlining (in percent)"
msgstr ""
-#: params.def:146
+#: params.def:127
msgid "The maximum amount of memory to be allocated by GCSE"
msgstr ""
-#: params.def:151
+#: params.def:132
msgid "The maximum number of passes to make when doing GCSE"
msgstr ""
-#: params.def:158
+#: params.def:139
msgid "The maximum number of instructions to consider to unroll in a loop"
msgstr ""
-#: params.def:164
+#: params.def:145
msgid ""
"The maximum number of instructions to consider to unroll in a loop on average"
msgstr ""
-#: params.def:169
+#: params.def:150
msgid "The maximum number of unrollings of a single loop"
msgstr ""
-#: params.def:174
+#: params.def:155
msgid "The maximum number of insns of a peeled loop"
msgstr ""
-#: params.def:179
+#: params.def:160
msgid "The maximum number of peelings of a single loop"
msgstr ""
-#: params.def:184
+#: params.def:165
msgid "The maximum number of insns of a completely peeled loop"
msgstr ""
-#: params.def:189
+#: params.def:170
msgid ""
"The maximum number of peelings of a single loop that is peeled completely"
msgstr ""
-#: params.def:194
+#: params.def:175
msgid "The maximum number of insns of a peeled loop that rolls only once"
msgstr ""
-#: params.def:200
+#: params.def:181
msgid "The maximum number of insns of an unswitched loop"
msgstr ""
-#: params.def:205
+#: params.def:186
msgid "The maximum number of unswitchings in a single loop"
msgstr ""
-#: params.def:210
+#: params.def:191
msgid ""
"Select fraction of the maximal count of repetitions of basic block in "
"program given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:215
+#: params.def:196
msgid ""
"Select fraction of the maximal frequency of executions of basic block in "
"function given basic block needs to have to be considered hot"
msgstr ""
-#: params.def:220
+#: params.def:201
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is available"
msgstr ""
-#: params.def:225
+#: params.def:206
msgid ""
"The percentage of function, weighted by execution frequency, that must be "
"covered by trace formation. Used when profile feedback is not available"
msgstr ""
-#: params.def:230
+#: params.def:211
msgid "Maximal code growth caused by tail duplication (in percent)"
msgstr ""
-#: params.def:234
+#: params.def:215
msgid ""
"Stop reverse growth if the reverse probability of best edge is less than "
"this threshold (in percent)"
msgstr ""
-#: params.def:239
+#: params.def:220
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is available"
msgstr ""
-#: params.def:244
+#: params.def:225
msgid ""
"Stop forward growth if the probability of best edge is less than this "
"threshold (in percent). Used when profile feedback is not available"
msgstr ""
-#: params.def:251
+#: params.def:232
msgid "The maximum number of incoming edges to consider for crossjumping"
msgstr ""
-#: params.def:257
+#: params.def:238
msgid "The maximum length of path considered in cse"
msgstr ""
-#: params.def:270
+#: params.def:251
msgid ""
"Minimum heap expansion to trigger garbage collection, as a percentage of the "
"total size of the heap"
msgstr ""
-#: params.def:276
+#: params.def:257
msgid "Minimum heap size before we start collecting garbage, in kilobytes"
msgstr ""
@@ -7372,6 +7378,12 @@ msgstr ""
msgid "junk at end of '#pragma unused'"
msgstr ""
+#: config/darwin.c:1347
+msgid ""
+"internal and protected visibility attributes not supportedin this "
+"configuration; ignored"
+msgstr ""
+
#: config/lynx-ng.h:97 config/lynx.h:116 config/rs6000/lynx.h:73
msgid "-msystem-v and -p are incompatible"
msgstr ""
@@ -7412,7 +7424,7 @@ msgstr ""
msgid "bad value `%s' for -mfp-trap-mode switch"
msgstr ""
-#: config/alpha/alpha.c:324 config/rs6000/rs6000.c:1035
+#: config/alpha/alpha.c:324 config/rs6000/rs6000.c:1097
#, c-format
msgid "bad value `%s' for -mtls-size switch"
msgstr ""
@@ -7448,90 +7460,90 @@ msgstr ""
msgid "bad value `%s' for -mmemory-latency"
msgstr ""
-#: config/alpha/alpha.c:5402
+#: config/alpha/alpha.c:5386
#, c-format
msgid "invalid %%H value"
msgstr ""
-#: config/alpha/alpha.c:5423
+#: config/alpha/alpha.c:5407
#, c-format
msgid "invalid %%J value"
msgstr ""
-#: config/alpha/alpha.c:5439 config/ia64/ia64.c:4013
+#: config/alpha/alpha.c:5423 config/ia64/ia64.c:4069
#, c-format
msgid "invalid %%r value"
msgstr ""
-#: config/alpha/alpha.c:5449 config/rs6000/rs6000.c:8720
-#: config/xtensa/xtensa.c:1971
+#: config/alpha/alpha.c:5433 config/rs6000/rs6000.c:8880
+#: config/xtensa/xtensa.c:1975
#, c-format
msgid "invalid %%R value"
msgstr ""
-#: config/alpha/alpha.c:5455 config/rs6000/rs6000.c:8639
-#: config/xtensa/xtensa.c:1938
+#: config/alpha/alpha.c:5439 config/rs6000/rs6000.c:8799
+#: config/xtensa/xtensa.c:1942
#, c-format
msgid "invalid %%N value"
msgstr ""
-#: config/alpha/alpha.c:5463 config/rs6000/rs6000.c:8667
+#: config/alpha/alpha.c:5447 config/rs6000/rs6000.c:8827
#, c-format
msgid "invalid %%P value"
msgstr ""
-#: config/alpha/alpha.c:5471
+#: config/alpha/alpha.c:5455
#, c-format
msgid "invalid %%h value"
msgstr ""
-#: config/alpha/alpha.c:5479 config/xtensa/xtensa.c:1964
+#: config/alpha/alpha.c:5463 config/xtensa/xtensa.c:1968
#, c-format
msgid "invalid %%L value"
msgstr ""
-#: config/alpha/alpha.c:5518 config/rs6000/rs6000.c:8621
+#: config/alpha/alpha.c:5502 config/rs6000/rs6000.c:8781
#, c-format
msgid "invalid %%m value"
msgstr ""
-#: config/alpha/alpha.c:5526 config/rs6000/rs6000.c:8629
+#: config/alpha/alpha.c:5510 config/rs6000/rs6000.c:8789
#, c-format
msgid "invalid %%M value"
msgstr ""
-#: config/alpha/alpha.c:5570
+#: config/alpha/alpha.c:5554
#, c-format
msgid "invalid %%U value"
msgstr ""
-#: config/alpha/alpha.c:5582 config/alpha/alpha.c:5596
-#: config/rs6000/rs6000.c:8728
+#: config/alpha/alpha.c:5566 config/alpha/alpha.c:5580
+#: config/rs6000/rs6000.c:8888
#, c-format
msgid "invalid %%s value"
msgstr ""
-#: config/alpha/alpha.c:5619
+#: config/alpha/alpha.c:5603
#, c-format
msgid "invalid %%C value"
msgstr ""
-#: config/alpha/alpha.c:5656 config/rs6000/rs6000.c:8478
+#: config/alpha/alpha.c:5640 config/rs6000/rs6000.c:8638
#, c-format
msgid "invalid %%E value"
msgstr ""
-#: config/alpha/alpha.c:5681 config/alpha/alpha.c:5729
+#: config/alpha/alpha.c:5665 config/alpha/alpha.c:5713
msgid "unknown relocation unspec"
msgstr ""
-#: config/alpha/alpha.c:5690 config/rs6000/rs6000.c:9041
+#: config/alpha/alpha.c:5674 config/rs6000/rs6000.c:9201
#, c-format
msgid "invalid %%xn code"
msgstr ""
-#: config/alpha/alpha.c:6618 config/alpha/alpha.c:6621 config/s390/s390.c:6470
-#: config/s390/s390.c:6473
+#: config/alpha/alpha.c:6602 config/alpha/alpha.c:6605 config/s390/s390.c:6619
+#: config/s390/s390.c:6622
msgid "bad builtin fcode"
msgstr ""
@@ -7541,13 +7553,13 @@ msgstr ""
#. 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:286 config/i386/i386.h:327 config/i386/i386.h:329
-#: config/i386/i386.h:331 config/ns32k/ns32k.h:140 config/rs6000/rs6000.h:293
+#: config/i386/i386.h:331 config/ns32k/ns32k.h:140 config/rs6000/rs6000.h:297
#: config/s390/s390.h:123 config/sparc/sparc.h:537 config/sparc/sparc.h:542
msgid "Use hardware fp"
msgstr ""
#: config/alpha/alpha.h:287 config/i386/i386.h:328 config/i386/i386.h:330
-#: config/rs6000/rs6000.h:295 config/sparc/sparc.h:539
+#: config/rs6000/rs6000.h:299 config/sparc/sparc.h:539
#: config/sparc/sparc.h:544
msgid "Do not use hardware fp"
msgstr ""
@@ -7659,7 +7671,7 @@ msgstr ""
msgid "Tune expected memory latency"
msgstr ""
-#: config/alpha/alpha.h:365 config/ia64/ia64.h:243 config/rs6000/sysv4.h:90
+#: config/alpha/alpha.h:365 config/ia64/ia64.h:258 config/rs6000/sysv4.h:90
msgid "Specify bit size of immediate TLS offsets"
msgstr ""
@@ -7668,38 +7680,38 @@ msgstr ""
msgid "bad value (%s) for -mcpu switch"
msgstr ""
-#: config/arc/arc.c:371
+#: config/arc/arc.c:369
#, c-format
msgid "argument of `%s' attribute is not a string constant"
msgstr ""
-#: config/arc/arc.c:378
+#: config/arc/arc.c:376
#, c-format
msgid "argument of `%s' attribute is not \"ilink1\" or \"ilink2\""
msgstr ""
-#: config/arc/arc.c:1772 config/m32r/m32r.c:2281
+#: config/arc/arc.c:1713 config/m32r/m32r.c:2281
#, c-format
msgid "invalid operand to %%R code"
msgstr ""
-#: config/arc/arc.c:1804 config/m32r/m32r.c:2304
+#: config/arc/arc.c:1745 config/m32r/m32r.c:2304
#, c-format
msgid "invalid operand to %%H/%%L code"
msgstr ""
-#: config/arc/arc.c:1827 config/m32r/m32r.c:2375
+#: config/arc/arc.c:1768 config/m32r/m32r.c:2375
#, c-format
msgid "invalid operand to %%U code"
msgstr ""
-#: config/arc/arc.c:1838
+#: config/arc/arc.c:1779
#, c-format
msgid "invalid operand to %%V code"
msgstr ""
#. Unknown flag.
-#: config/arc/arc.c:1845 config/m32r/m32r.c:2408 config/sparc/sparc.c:6857
+#: config/arc/arc.c:1786 config/m32r/m32r.c:2408 config/sparc/sparc.c:6858
msgid "invalid operand output code"
msgstr ""
@@ -7708,7 +7720,7 @@ msgstr ""
msgid "switch -mcpu=%s conflicts with -march= switch"
msgstr ""
-#: config/arm/arm.c:529 config/rs6000/rs6000.c:731 config/sparc/sparc.c:419
+#: config/arm/arm.c:529 config/rs6000/rs6000.c:793 config/sparc/sparc.c:419
#, c-format
msgid "bad value (%s) for %s switch"
msgstr ""
@@ -7792,36 +7804,36 @@ msgstr ""
msgid "unable to use '%s' for PIC register"
msgstr ""
-#: config/arm/arm.c:2204 config/arm/arm.c:2222 config/avr/avr.c:4580
-#: config/c4x/c4x.c:4445 config/h8300/h8300.c:4255 config/i386/i386.c:1561
-#: config/i386/i386.c:1607 config/ip2k/ip2k.c:3234
-#: config/m68hc11/m68hc11.c:1291 config/m68k/m68k.c:319
+#: config/arm/arm.c:2201 config/arm/arm.c:2219 config/avr/avr.c:4580
+#: config/c4x/c4x.c:4445 config/h8300/h8300.c:4255 config/i386/i386.c:1565
+#: config/i386/i386.c:1611 config/ip2k/ip2k.c:3234
+#: config/m68hc11/m68hc11.c:1227 config/m68k/m68k.c:344
#: config/mcore/mcore.c:3374 config/ns32k/ns32k.c:1091
-#: config/rs6000/rs6000.c:14300 config/sh/sh.c:6715 config/sh/sh.c:6736
-#: config/sh/sh.c:6771 config/stormy16/stormy16.c:2073 config/v850/v850.c:2173
+#: config/rs6000/rs6000.c:14496 config/sh/sh.c:6723 config/sh/sh.c:6744
+#: config/sh/sh.c:6779 config/stormy16/stormy16.c:2073 config/v850/v850.c:2173
#, c-format
msgid "`%s' attribute only applies to functions"
msgstr ""
-#: config/arm/arm.c:10450
+#: config/arm/arm.c:10455
msgid "unable to compute real location of stacked parameter"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:11078 config/arm/arm.c:11115
+#: config/arm/arm.c:11083 config/arm/arm.c:11120
msgid "selector must be an immediate"
msgstr ""
#. @@@ better error message
-#: config/arm/arm.c:11158 config/i386/i386.c:14096 config/i386/i386.c:14130
+#: config/arm/arm.c:11163 config/i386/i386.c:14189 config/i386/i386.c:14223
msgid "mask must be an immediate"
msgstr ""
-#: config/arm/arm.c:11821
+#: config/arm/arm.c:11826
msgid "no low registers available for popping high registers"
msgstr ""
-#: config/arm/arm.c:12066
+#: config/arm/arm.c:12071
msgid "interrupt Service Routines cannot be coded in Thumb mode"
msgstr ""
@@ -8643,61 +8655,61 @@ msgstr ""
msgid "Together with -fpic and -fPIC, do not use GOTPLT references"
msgstr ""
-#: config/d30v/d30v.c:215
+#: config/d30v/d30v.c:219
#, c-format
msgid "bad modes_tieable_p for register %s, mode1 %s, mode2 %s"
msgstr ""
-#: config/d30v/d30v.c:2675
+#: config/d30v/d30v.c:2679
msgid "bad insn to d30v_print_operand_address:"
msgstr ""
-#: config/d30v/d30v.c:2692 config/d30v/d30v.c:2753 config/d30v/d30v.c:2774
-#: config/d30v/d30v.c:2792
+#: config/d30v/d30v.c:2696 config/d30v/d30v.c:2757 config/d30v/d30v.c:2778
+#: config/d30v/d30v.c:2796
msgid "bad insn to d30v_print_operand_memory_reference:"
msgstr ""
-#: config/d30v/d30v.c:2860
+#: config/d30v/d30v.c:2864
msgid "bad insn to d30v_print_operand, 'f' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2869
+#: config/d30v/d30v.c:2873
msgid "bad insn to d30v_print_operand, 'A' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2876
+#: config/d30v/d30v.c:2880
msgid "bad insn to d30v_print_operand, 'M' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2930
+#: config/d30v/d30v.c:2934
msgid "bad insn to print_operand, 'F' or 'T' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2941
+#: config/d30v/d30v.c:2945
msgid "bad insn to print_operand, 'B' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2948
+#: config/d30v/d30v.c:2952
msgid "bad insn to print_operand, 'E' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2966
+#: config/d30v/d30v.c:2970
msgid "bad insn to print_operand, 'R' modifier:"
msgstr ""
-#: config/d30v/d30v.c:2975 config/d30v/d30v.c:2983
+#: config/d30v/d30v.c:2979 config/d30v/d30v.c:2987
msgid "bad insn to print_operand, 's' modifier:"
msgstr ""
-#: config/d30v/d30v.c:3012
+#: config/d30v/d30v.c:3016
msgid "bad insn in d30v_print_operand, 0 case"
msgstr ""
-#: config/d30v/d30v.c:3310
+#: config/d30v/d30v.c:3314
msgid "d30v_emit_comparison"
msgstr ""
-#: config/d30v/d30v.c:3354
+#: config/d30v/d30v.c:3358
msgid "bad call to d30v_move_2words"
msgstr ""
@@ -8880,46 +8892,46 @@ msgstr ""
msgid "trampolines not yet implemented"
msgstr ""
-#: config/fr30/fr30.c:455
+#: config/fr30/fr30.c:456
msgid "fr30_print_operand_address: unhandled address"
msgstr ""
-#: config/fr30/fr30.c:482
+#: config/fr30/fr30.c:483
#, c-format
msgid "fr30_print_operand: unrecognized %%p code"
msgstr ""
-#: config/fr30/fr30.c:502
+#: config/fr30/fr30.c:503
#, c-format
msgid "fr30_print_operand: unrecognized %%b code"
msgstr ""
-#: config/fr30/fr30.c:523
+#: config/fr30/fr30.c:524
#, c-format
msgid "fr30_print_operand: unrecognized %%B code"
msgstr ""
-#: config/fr30/fr30.c:531
+#: config/fr30/fr30.c:532
#, c-format
msgid "fr30_print_operand: invalid operand to %%A code"
msgstr ""
-#: config/fr30/fr30.c:548
+#: config/fr30/fr30.c:549
#, c-format
msgid "fr30_print_operand: invalid %%x code"
msgstr ""
-#: config/fr30/fr30.c:555
+#: config/fr30/fr30.c:556
#, c-format
msgid "fr30_print_operand: invalid %%F code"
msgstr ""
-#: config/fr30/fr30.c:572
+#: config/fr30/fr30.c:573
msgid "fr30_print_operand: unknown code"
msgstr ""
-#: config/fr30/fr30.c:601 config/fr30/fr30.c:610 config/fr30/fr30.c:621
-#: config/fr30/fr30.c:634
+#: config/fr30/fr30.c:602 config/fr30/fr30.c:611 config/fr30/fr30.c:622
+#: config/fr30/fr30.c:635
msgid "fr30_print_operand: unhandled MEM"
msgstr ""
@@ -8927,136 +8939,136 @@ msgstr ""
msgid "Assume small address space"
msgstr ""
-#: config/frv/frv.c:415 config/frv/frv.c:433
+#: config/frv/frv.c:391 config/frv/frv.c:409
#, c-format
msgid "Unknown cpu: -mcpu=%s"
msgstr ""
-#: config/frv/frv.c:456
+#: config/frv/frv.c:432
msgid "-fpic and -gdwarf are incompatible (-fpic and -g/-gdwarf-2 are fine)"
msgstr ""
-#: config/frv/frv.c:2465
+#: config/frv/frv.c:2395
msgid "Bad insn to frv_print_operand_address:"
msgstr ""
-#: config/frv/frv.c:2478
+#: config/frv/frv.c:2406
msgid "Bad register to frv_print_operand_memory_reference_reg:"
msgstr ""
-#: config/frv/frv.c:2519 config/frv/frv.c:2529 config/frv/frv.c:2538
-#: config/frv/frv.c:2566 config/frv/frv.c:2579 config/frv/frv.c:2583
+#: config/frv/frv.c:2444 config/frv/frv.c:2454 config/frv/frv.c:2463
+#: config/frv/frv.c:2491 config/frv/frv.c:2504 config/frv/frv.c:2508
msgid "Bad insn to frv_print_operand_memory_reference:"
msgstr ""
-#: config/frv/frv.c:2725
+#: config/frv/frv.c:2646
msgid "Bad insn in frv_print_operand, bad const_double"
msgstr ""
-#: config/frv/frv.c:2770
+#: config/frv/frv.c:2691
msgid "Bad insn to frv_print_operand, 'C' modifier:"
msgstr ""
-#: config/frv/frv.c:2793
+#: config/frv/frv.c:2714
msgid "Bad insn to frv_print_operand, 'c' modifier:"
msgstr ""
-#: config/frv/frv.c:2818
+#: config/frv/frv.c:2739
msgid "Bad insn to frv_print_operand, 'e' modifier:"
msgstr ""
-#: config/frv/frv.c:2826
+#: config/frv/frv.c:2747
msgid "Bad insn to frv_print_operand, 'F' modifier:"
msgstr ""
-#: config/frv/frv.c:2842
+#: config/frv/frv.c:2763
msgid "Bad insn to frv_print_operand, 'f' modifier:"
msgstr ""
-#: config/frv/frv.c:2895
+#: config/frv/frv.c:2816
msgid "Bad insn to frv_print_operand, 'L' modifier:"
msgstr ""
-#: config/frv/frv.c:2908
+#: config/frv/frv.c:2829
msgid "Bad insn to frv_print_operand, 'M/N' modifier:"
msgstr ""
-#: config/frv/frv.c:2929
+#: config/frv/frv.c:2850
msgid "Bad insn to frv_print_operand, 'O' modifier:"
msgstr ""
-#: config/frv/frv.c:2947
+#: config/frv/frv.c:2868
msgid "Bad insn to frv_print_operand, P modifier:"
msgstr ""
-#: config/frv/frv.c:2967
+#: config/frv/frv.c:2888
msgid "Bad insn in frv_print_operand, z case"
msgstr ""
-#: config/frv/frv.c:2995
+#: config/frv/frv.c:2916
msgid "Bad insn in frv_print_operand, 0 case"
msgstr ""
-#: config/frv/frv.c:3000
+#: config/frv/frv.c:2921
msgid "frv_print_operand: unknown code"
msgstr ""
-#: config/frv/frv.c:5683
+#: config/frv/frv.c:5471
msgid "Bad output_move_single operand"
msgstr ""
-#: config/frv/frv.c:5812
+#: config/frv/frv.c:5598
msgid "Bad output_move_double operand"
msgstr ""
-#: config/frv/frv.c:5956
+#: config/frv/frv.c:5740
msgid "Bad output_condmove_single operand"
msgstr ""
-#: config/frv/frv.c:8300
+#: config/frv/frv.c:8019
msgid "frv_registers_update"
msgstr ""
-#: config/frv/frv.c:8460
+#: config/frv/frv.c:8176
msgid "frv_registers_used_p"
msgstr ""
-#: config/frv/frv.c:8589
+#: config/frv/frv.c:8302
msgid "frv_registers_set_p"
msgstr ""
-#: config/frv/frv.c:9188
+#: config/frv/frv.c:8898
msgid "accumulator is not a constant integer"
msgstr ""
-#: config/frv/frv.c:9193
+#: config/frv/frv.c:8903
msgid "accumulator number is out of bounds"
msgstr ""
-#: config/frv/frv.c:9204
+#: config/frv/frv.c:8914
#, c-format
msgid "inappropriate accumulator for `%s'"
msgstr ""
-#: config/frv/frv.c:9270
+#: config/frv/frv.c:8974
#, c-format
msgid "`%s' expects a constant argument"
msgstr ""
-#: config/frv/frv.c:9275
+#: config/frv/frv.c:8979
#, c-format
msgid "constant argument out of range for `%s'"
msgstr ""
-#: config/frv/frv.c:9655
+#: config/frv/frv.c:9326
msgid "media functions are not available unless -mmedia is used"
msgstr ""
-#: config/frv/frv.c:9667
+#: config/frv/frv.c:9338
msgid "this media function is only available on the fr500"
msgstr ""
-#: config/frv/frv.c:9695
+#: config/frv/frv.c:9366
msgid "this media function is only available on the fr400"
msgstr ""
@@ -9170,169 +9182,169 @@ msgstr ""
msgid "Do not generate char instructions"
msgstr ""
-#: config/i386/i386.c:1151
+#: config/i386/i386.c:1155
#, c-format
msgid "code model %s not supported in PIC mode"
msgstr ""
-#: config/i386/i386.c:1161 config/sparc/sparc.c:382
+#: config/i386/i386.c:1165 config/sparc/sparc.c:382
#, c-format
msgid "bad value (%s) for -mcmodel= switch"
msgstr ""
-#: config/i386/i386.c:1176
+#: config/i386/i386.c:1180
#, c-format
msgid "bad value (%s) for -masm= switch"
msgstr ""
-#: config/i386/i386.c:1179
+#: config/i386/i386.c:1183
#, c-format
msgid "code model `%s' not supported in the %s bit mode"
msgstr ""
-#: config/i386/i386.c:1182
+#: config/i386/i386.c:1186
msgid "code model `large' not supported yet"
msgstr ""
-#: config/i386/i386.c:1184
+#: config/i386/i386.c:1188
#, c-format
msgid "%i-bit mode not compiled in"
msgstr ""
-#: config/i386/i386.c:1211 config/i386/i386.c:1223
+#: config/i386/i386.c:1215 config/i386/i386.c:1227
msgid "CPU you selected does not support x86-64 instruction set"
msgstr ""
-#: config/i386/i386.c:1216 config/iq2000/iq2000.c:1806
+#: config/i386/i386.c:1220 config/iq2000/iq2000.c:1806
#, c-format
msgid "bad value (%s) for -march= switch"
msgstr ""
-#: config/i386/i386.c:1229
+#: config/i386/i386.c:1233
#, c-format
msgid "bad value (%s) for -mtune= switch"
msgstr ""
-#: config/i386/i386.c:1246
+#: config/i386/i386.c:1250
#, c-format
msgid "-mregparm=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:1259
+#: config/i386/i386.c:1263
msgid "-malign-loops is obsolete, use -falign-loops"
msgstr ""
-#: config/i386/i386.c:1264 config/i386/i386.c:1277 config/i386/i386.c:1290
+#: config/i386/i386.c:1268 config/i386/i386.c:1281 config/i386/i386.c:1294
#, c-format
msgid "-malign-loops=%d is not between 0 and %d"
msgstr ""
-#: config/i386/i386.c:1272
+#: config/i386/i386.c:1276
msgid "-malign-jumps is obsolete, use -falign-jumps"
msgstr ""
-#: config/i386/i386.c:1285
+#: config/i386/i386.c:1289
msgid "-malign-functions is obsolete, use -falign-functions"
msgstr ""
-#: config/i386/i386.c:1323
+#: config/i386/i386.c:1327
#, c-format
msgid "-mpreferred-stack-boundary=%d is not between %d and 12"
msgstr ""
-#: config/i386/i386.c:1335
+#: config/i386/i386.c:1339
#, c-format
msgid "-mbranch-cost=%d is not between 0 and 5"
msgstr ""
-#: config/i386/i386.c:1347
+#: config/i386/i386.c:1351
#, c-format
msgid "bad value (%s) for -mtls-dialect= switch"
msgstr ""
-#: config/i386/i386.c:1376
+#: config/i386/i386.c:1380
msgid "-malign-double makes no sense in the 64bit mode"
msgstr ""
-#: config/i386/i386.c:1378
+#: config/i386/i386.c:1382
msgid "-mrtd calling convention not supported in the 64bit mode"
msgstr ""
-#: config/i386/i386.c:1400 config/i386/i386.c:1411
+#: config/i386/i386.c:1404 config/i386/i386.c:1415
msgid "SSE instruction set disabled, using 387 arithmetics"
msgstr ""
-#: config/i386/i386.c:1416
+#: config/i386/i386.c:1420
msgid "387 instruction set disabled, using SSE arithmetics"
msgstr ""
-#: config/i386/i386.c:1423
+#: config/i386/i386.c:1427
#, c-format
msgid "bad value (%s) for -mfpmath= switch"
msgstr ""
-#: config/i386/i386.c:1571 config/i386/i386.c:1582
+#: config/i386/i386.c:1575 config/i386/i386.c:1586
msgid "fastcall and stdcall attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:1575 config/i386/i386.c:1631
+#: config/i386/i386.c:1579 config/i386/i386.c:1635
msgid "fastcall and regparm attributes are not compatible"
msgstr ""
-#: config/i386/i386.c:1618
+#: config/i386/i386.c:1622
#, c-format
msgid "`%s' attribute requires an integer constant argument"
msgstr ""
-#: config/i386/i386.c:1624
+#: config/i386/i386.c:1628
#, c-format
msgid "argument to `%s' attribute larger than %d"
msgstr ""
-#: config/i386/i386.c:2771
+#: config/i386/i386.c:2780
msgid "SSE vector return without SSE enabled changes the ABI"
msgstr ""
-#: config/i386/i386.c:6723
+#: config/i386/i386.c:6784
msgid "invalid UNSPEC as operand"
msgstr ""
-#: config/i386/i386.c:6974
+#: config/i386/i386.c:7038
msgid "extended registers have no high halves"
msgstr ""
-#: config/i386/i386.c:6989
+#: config/i386/i386.c:7053
msgid "unsupported operand size for extended register"
msgstr ""
-#: config/i386/i386.c:7299
+#: config/i386/i386.c:7368
msgid ""
"operand is neither a constant nor a condition code, invalid operand code 'c'"
msgstr ""
-#: config/i386/i386.c:7345
+#: config/i386/i386.c:7414
#, c-format
msgid "invalid operand code `%c'"
msgstr ""
-#: config/i386/i386.c:7390
+#: config/i386/i386.c:7459
msgid "invalid constraints for operand"
msgstr ""
-#: config/i386/i386.c:11787
+#: config/i386/i386.c:11859
msgid "unknown insn mode"
msgstr ""
-#: config/i386/i386.c:13898 config/i386/i386.c:13934
+#: config/i386/i386.c:13991 config/i386/i386.c:14027
#, c-format
msgid "selector must be an integer constant in the range 0..%i"
msgstr ""
-#: config/i386/i386.c:14162
+#: config/i386/i386.c:14255
msgid "shift must be an immediate"
msgstr ""
-#: config/i386/i386.c:15186
+#: config/i386/i386.c:15278
#, c-format
msgid "`%s' incompatible attribute ignored"
msgstr ""
@@ -9626,7 +9638,7 @@ 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:459 config/ia64/ia64.h:245 config/rs6000/rs6000.h:412
+#: config/i386/i386.h:459 config/ia64/ia64.h:260 config/rs6000/rs6000.h:416
#: config/s390/s390.h:145 config/sparc/sparc.h:650
msgid "Schedule code for given CPU"
msgstr ""
@@ -9732,19 +9744,19 @@ msgstr ""
msgid "sorry, not implemented: #pragma noalign NAME"
msgstr ""
-#: config/i960/i960.c:130 config/i960/i960.c:140
+#: config/i960/i960.c:134 config/i960/i960.c:144
msgid "conflicting architectures defined - using C series"
msgstr ""
-#: config/i960/i960.c:135
+#: config/i960/i960.c:139
msgid "conflicting architectures defined - using K series"
msgstr ""
-#: config/i960/i960.c:150
+#: config/i960/i960.c:154
msgid "iC2.0 and iC3.0 are incompatible - using iC3.0"
msgstr ""
-#: config/i960/i960.c:1452 config/m68k/m68k.c:652 config/rs6000/rs6000.c:11039
+#: config/i960/i960.c:1456 config/m68k/m68k.c:599 config/rs6000/rs6000.c:11237
msgid "stack limit expression is not supported"
msgstr ""
@@ -9901,33 +9913,41 @@ msgstr ""
msgid "%Jaddress area attribute cannot be specified for functions"
msgstr ""
-#: config/ia64/ia64.c:4058
+#: config/ia64/ia64.c:4114
msgid "ia64_print_operand: unknown code"
msgstr ""
-#: config/ia64/ia64.c:4405
+#: config/ia64/ia64.c:4461
msgid "value of -mfixed-range must have form REG1-REG2"
msgstr ""
-#: config/ia64/ia64.c:4432
+#: config/ia64/ia64.c:4488
#, c-format
msgid "%s-%s is an empty range"
msgstr ""
-#: config/ia64/ia64.c:4480
+#: config/ia64/ia64.c:4536
msgid "cannot optimize floating point division for both latency and throughput"
msgstr ""
-#: config/ia64/ia64.c:4486
+#: config/ia64/ia64.c:4542
msgid "cannot optimize integer division for both latency and throughput"
msgstr ""
-#: config/ia64/ia64.c:4498
+#: config/ia64/ia64.c:4548
+msgid "cannot optimize square root for both latency and throughput"
+msgstr ""
+
+#: config/ia64/ia64.c:4554
+msgid "not yet implemented: latency-optimized inline square root"
+msgstr ""
+
+#: config/ia64/ia64.c:4566
#, c-format
msgid "bad value (%s) for -mtls-size= switch"
msgstr ""
-#: config/ia64/ia64.c:4514
+#: config/ia64/ia64.c:4582
#, c-format
msgid "bad value (%s) for -tune= switch"
msgstr ""
@@ -9935,99 +9955,107 @@ 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:152
+#: config/ia64/ia64.h:163
msgid "Generate big endian code"
msgstr ""
-#: config/ia64/ia64.h:154 config/mcore/mcore.h:154
+#: config/ia64/ia64.h:165 config/mcore/mcore.h:154
msgid "Generate little endian code"
msgstr ""
-#: config/ia64/ia64.h:156
+#: config/ia64/ia64.h:167
msgid "Generate code for GNU as"
msgstr ""
-#: config/ia64/ia64.h:158
+#: config/ia64/ia64.h:169
msgid "Generate code for Intel as"
msgstr ""
-#: config/ia64/ia64.h:160
+#: config/ia64/ia64.h:171
msgid "Generate code for GNU ld"
msgstr ""
-#: config/ia64/ia64.h:162
+#: config/ia64/ia64.h:173
msgid "Generate code for Intel ld"
msgstr ""
-#: config/ia64/ia64.h:164
+#: config/ia64/ia64.h:175
msgid "Generate code without GP reg"
msgstr ""
-#: config/ia64/ia64.h:166
+#: config/ia64/ia64.h:177
msgid "Emit stop bits before and after volatile extended asms"
msgstr ""
-#: config/ia64/ia64.h:168
+#: config/ia64/ia64.h:179
msgid "Don't emit stop bits before and after volatile extended asms"
msgstr ""
-#: config/ia64/ia64.h:170
+#: config/ia64/ia64.h:181
msgid "Emit code for Itanium (TM) processor B step"
msgstr ""
-#: config/ia64/ia64.h:172
+#: config/ia64/ia64.h:183
msgid "Use in/loc/out register names"
msgstr ""
-#: config/ia64/ia64.h:174
+#: config/ia64/ia64.h:185
msgid "Disable use of sdata/scommon/sbss"
msgstr ""
-#: config/ia64/ia64.h:176
+#: config/ia64/ia64.h:187
msgid "Enable use of sdata/scommon/sbss"
msgstr ""
-#: config/ia64/ia64.h:178
+#: config/ia64/ia64.h:189
msgid "gp is constant (but save/restore gp on indirect calls)"
msgstr ""
-#: config/ia64/ia64.h:180
+#: config/ia64/ia64.h:191
msgid "Generate self-relocatable code"
msgstr ""
-#: config/ia64/ia64.h:182
+#: config/ia64/ia64.h:193
msgid "Generate inline floating point division, optimize for latency"
msgstr ""
-#: config/ia64/ia64.h:184
+#: config/ia64/ia64.h:195
msgid "Generate inline floating point division, optimize for throughput"
msgstr ""
-#: config/ia64/ia64.h:186
+#: config/ia64/ia64.h:197
msgid "Generate inline integer division, optimize for latency"
msgstr ""
-#: config/ia64/ia64.h:188
+#: config/ia64/ia64.h:199
msgid "Generate inline integer division, optimize for throughput"
msgstr ""
-#: config/ia64/ia64.h:190
+#: config/ia64/ia64.h:201
+msgid "Generate inline square root, optimize for latency"
+msgstr ""
+
+#: config/ia64/ia64.h:203
+msgid "Generate inline square root, optimize for throughput"
+msgstr ""
+
+#: config/ia64/ia64.h:205
msgid "Enable Dwarf 2 line debug info via GNU as"
msgstr ""
-#: config/ia64/ia64.h:192
+#: config/ia64/ia64.h:207
msgid "Disable Dwarf 2 line debug info via GNU as"
msgstr ""
-#: config/ia64/ia64.h:194
+#: config/ia64/ia64.h:209
msgid "Enable earlier placing stop bits for better scheduling"
msgstr ""
-#: config/ia64/ia64.h:196
+#: config/ia64/ia64.h:211
msgid "Disable earlier placing stop bits"
msgstr ""
-#: config/ia64/ia64.h:241
+#: config/ia64/ia64.h:256
msgid "Specify range of registers to make fixed"
msgstr ""
@@ -10055,7 +10083,7 @@ msgstr ""
msgid "argument `%d' is not a constant"
msgstr ""
-#: config/iq2000/iq2000.c:3313 config/xtensa/xtensa.c:2053
+#: config/iq2000/iq2000.c:3313 config/xtensa/xtensa.c:2057
msgid "PRINT_OPERAND_ADDRESS, null pointer"
msgstr ""
@@ -10064,8 +10092,8 @@ msgstr ""
msgid "PRINT_OPERAND: Unknown punctuation '%c'"
msgstr ""
-#: config/iq2000/iq2000.c:3478 config/mips/mips.c:5347
-#: config/xtensa/xtensa.c:1907
+#: config/iq2000/iq2000.c:3478 config/mips/mips.c:5324
+#: config/xtensa/xtensa.c:1911
msgid "PRINT_OPERAND null pointer"
msgstr ""
@@ -10074,12 +10102,12 @@ msgstr ""
msgid "invalid %%P operand"
msgstr ""
-#: config/iq2000/iq2000.c:3555 config/rs6000/rs6000.c:8657
+#: config/iq2000/iq2000.c:3555 config/rs6000/rs6000.c:8817
#, c-format
msgid "invalid %%p value"
msgstr ""
-#: config/iq2000/iq2000.c:3619 config/mips/mips.c:5475
+#: config/iq2000/iq2000.c:3619 config/mips/mips.c:5454
#, c-format
msgid "invalid use of %%d, %%x, or %%X"
msgstr ""
@@ -10167,7 +10195,7 @@ msgid "post-increment address is not a register"
msgstr ""
#: config/m32r/m32r.c:2514 config/m32r/m32r.c:2530
-#: config/rs6000/rs6000.c:14497
+#: config/rs6000/rs6000.c:14693
msgid "bad address"
msgstr ""
@@ -10200,54 +10228,54 @@ msgstr ""
msgid "Small data area: none, sdata, use"
msgstr ""
-#: config/m68hc11/m68hc11.c:266
+#: config/m68hc11/m68hc11.c:269
#, c-format
msgid "-f%s ignored for 68HC11/68HC12 (not supported)"
msgstr ""
-#: config/m68hc11/m68hc11.c:1327
+#: config/m68hc11/m68hc11.c:1260
msgid "`trap' and `far' attributes are not compatible, ignoring `far'"
msgstr ""
-#: config/m68hc11/m68hc11.c:1333
+#: config/m68hc11/m68hc11.c:1266
msgid "`trap' attribute is already used"
msgstr ""
#. !!!! SCz wrong here.
-#: config/m68hc11/m68hc11.c:3331 config/m68hc11/m68hc11.c:3717
+#: config/m68hc11/m68hc11.c:3222 config/m68hc11/m68hc11.c:3606
msgid "move insn not handled"
msgstr ""
-#: config/m68hc11/m68hc11.c:3563 config/m68hc11/m68hc11.c:3647
-#: config/m68hc11/m68hc11.c:3920
+#: config/m68hc11/m68hc11.c:3454 config/m68hc11/m68hc11.c:3538
+#: config/m68hc11/m68hc11.c:3809
msgid "invalid register in the move instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3597
+#: config/m68hc11/m68hc11.c:3488
msgid "invalid operand in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3894
+#: config/m68hc11/m68hc11.c:3783
msgid "invalid register in the instruction"
msgstr ""
-#: config/m68hc11/m68hc11.c:3927
+#: config/m68hc11/m68hc11.c:3816
msgid "operand 1 must be a hard register"
msgstr ""
-#: config/m68hc11/m68hc11.c:3944
+#: config/m68hc11/m68hc11.c:3830
msgid "invalid rotate insn"
msgstr ""
-#: config/m68hc11/m68hc11.c:4365
+#: config/m68hc11/m68hc11.c:4246
msgid "registers IX, IY and Z used in the same INSN"
msgstr ""
-#: config/m68hc11/m68hc11.c:4702 config/m68hc11/m68hc11.c:5005
+#: config/m68hc11/m68hc11.c:4583 config/m68hc11/m68hc11.c:4883
msgid "cannot do z-register replacement"
msgstr ""
-#: config/m68hc11/m68hc11.c:5068
+#: config/m68hc11/m68hc11.c:4946
msgid "invalid Z register replacement for insn"
msgstr ""
@@ -10324,35 +10352,35 @@ msgstr ""
msgid "Indicate the number of soft registers available"
msgstr ""
-#: config/m68k/m68k.c:213
+#: config/m68k/m68k.c:238
#, c-format
msgid "-malign-loops=%d is not between 1 and %d"
msgstr ""
-#: config/m68k/m68k.c:224
+#: config/m68k/m68k.c:249
msgid "-mshared-library-id= specified without -mid-shared-library"
msgstr ""
-#: config/m68k/m68k.c:227
+#: config/m68k/m68k.c:252
#, c-format
msgid "-mshared-library-id=%d is not between 0 and %d"
msgstr ""
-#: config/m68k/m68k.c:241
+#: config/m68k/m68k.c:266
msgid "cannot specify both -msep-data and -mid-shared-library"
msgstr ""
-#: config/m68k/m68k.c:256
+#: config/m68k/m68k.c:281
#, c-format
msgid "-malign-jumps=%d is not between 1 and %d"
msgstr ""
-#: config/m68k/m68k.c:267
+#: config/m68k/m68k.c:292
#, c-format
msgid "-malign-functions=%d is not between 1 and %d"
msgstr ""
-#: config/m68k/m68k.c:276
+#: config/m68k/m68k.c:301
msgid "-fPIC is not currently supported on the 68000 or 68010\n"
msgstr ""
@@ -10550,159 +10578,163 @@ msgstr ""
msgid "Maximum amount for a single stack increment operation"
msgstr ""
-#: config/mips/mips.c:3118 config/xtensa/xtensa.c:988
-#: config/xtensa/xtensa.c:1020 config/xtensa/xtensa.c:1029
+#: config/mips/mips.c:3036 config/xtensa/xtensa.c:992
+#: config/xtensa/xtensa.c:1024 config/xtensa/xtensa.c:1033
msgid "bad test"
msgstr ""
-#: config/mips/mips.c:4564
+#: config/mips/mips.c:4480
#, c-format
msgid "bad value (%s) for -mabi= switch"
msgstr ""
-#: config/mips/mips.c:4587
+#: config/mips/mips.c:4503
#, c-format
msgid ""
"-mips%s conflicts with the other architecture options, which specify a MIPS%"
"d processor"
msgstr ""
-#: config/mips/mips.c:4606
+#: config/mips/mips.c:4522
#, c-format
msgid "-march=%s is not compatible with the selected ABI"
msgstr ""
-#: config/mips/mips.c:4621
+#: config/mips/mips.c:4537
msgid "-mgp64 used with a 32-bit processor"
msgstr ""
-#: config/mips/mips.c:4623
+#: config/mips/mips.c:4539
msgid "-mgp32 used with a 64-bit ABI"
msgstr ""
-#: config/mips/mips.c:4625
+#: config/mips/mips.c:4541
msgid "-mgp64 used with a 32-bit ABI"
msgstr ""
-#: config/mips/mips.c:4643 config/mips/mips.c:4645 config/mips/mips.c:4647
-#: config/mips/mips.c:4776
+#: config/mips/mips.c:4559 config/mips/mips.c:4561 config/mips/mips.c:4563
+#: config/mips/mips.c:4693
#, c-format
msgid "unsupported combination: %s"
msgstr ""
-#: config/mips/mips.c:4740
+#: config/mips/mips.c:4657
msgid "-g is only supported using GNU as,"
msgstr ""
-#: config/mips/mips.c:4742
+#: config/mips/mips.c:4659
msgid "-g is only supported using GNU as with -mabi=32,"
msgstr ""
-#: config/mips/mips.c:4743 config/pa/pa.c:352
+#: config/mips/mips.c:4660 config/pa/pa.c:353
msgid "-g option disabled"
msgstr ""
-#: config/mips/mips.c:4771
+#: config/mips/mips.c:4688
msgid ""
"generation of Branch Likely instructions enabled, but not supported by "
"architecture"
msgstr ""
-#: config/mips/mips.c:4788
+#: config/mips/mips.c:4705
msgid "-G is incompatible with PIC code which is the default"
msgstr ""
-#: config/mips/mips.c:4816
+#: config/mips/mips.c:4733
msgid "-membedded-pic and -mabicalls are incompatible"
msgstr ""
-#: config/mips/mips.c:4819
+#: config/mips/mips.c:4736
msgid "-G and -membedded-pic are incompatible"
msgstr ""
-#: config/mips/mips.c:4851
+#: config/mips/mips.c:4768
msgid "non-PIC n64 with explicit relocations"
msgstr ""
-#: config/mips/mips.c:5155
+#: config/mips/mips.c:5134
msgid "mips_debugger_offset called with non stack/frame/arg pointer"
msgstr ""
-#: config/mips/mips.c:5284
+#: config/mips/mips.c:5261
#, c-format
msgid "internal error: %%) found without a %%( in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5298
+#: config/mips/mips.c:5275
#, c-format
msgid "internal error: %%] found without a %%[ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5311
+#: config/mips/mips.c:5288
#, c-format
msgid "internal error: %%> found without a %%< in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5324
+#: config/mips/mips.c:5301
#, c-format
msgid "internal error: %%} found without a %%{ in assembler pattern"
msgstr ""
-#: config/mips/mips.c:5338
+#: config/mips/mips.c:5315
#, c-format
msgid "PRINT_OPERAND: unknown punctuation '%c'"
msgstr ""
-#: config/mips/mips.c:5376
+#: config/mips/mips.c:5344
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%C"
msgstr ""
-#: config/mips/mips.c:5393
+#: config/mips/mips.c:5361
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%N"
msgstr ""
-#: config/mips/mips.c:5402
+#: config/mips/mips.c:5370
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%F"
msgstr ""
-#: config/mips/mips.c:5411
+#: config/mips/mips.c:5379
#, c-format
msgid "PRINT_OPERAND, invalid insn for %%W"
msgstr ""
-#: config/mips/mips.c:7902
+#: config/mips/mips.c:5485
+msgid "PRINT_OPERAND, invalid operand for relocation"
+msgstr ""
+
+#: config/mips/mips.c:7951
#, c-format
msgid "can not handle inconsistent calls to `%s'"
msgstr ""
-#: config/mips/mips.c:9129
+#: config/mips/mips.c:9178
msgid "the cpu name must be lower case"
msgstr ""
-#: config/mips/mips.c:9151
+#: config/mips/mips.c:9200
#, c-format
msgid "bad value (%s) for %s"
msgstr ""
-#: config/mips/mips.c:9420
+#: config/mips/mips.c:9469
#, c-format
msgid "can't rewind temp file: %m"
msgstr ""
-#: config/mips/mips.c:9424
+#: config/mips/mips.c:9473
#, c-format
msgid "can't write to output file: %m"
msgstr ""
-#: config/mips/mips.c:9427
+#: config/mips/mips.c:9476
#, c-format
msgid "can't read from temp file: %m"
msgstr ""
-#: config/mips/mips.c:9430
+#: config/mips/mips.c:9479
#, c-format
msgid "can't close temp file: %m"
msgstr ""
@@ -10863,11 +10895,11 @@ msgstr ""
msgid "Don't use multiply accumulate"
msgstr ""
-#: config/mips/mips.h:583 config/rs6000/rs6000.h:311
+#: config/mips/mips.h:583 config/rs6000/rs6000.h:315
msgid "Don't generate fused multiply/add instructions"
msgstr ""
-#: config/mips/mips.h:585 config/rs6000/rs6000.h:309
+#: config/mips/mips.h:585 config/rs6000/rs6000.h:313
msgid "Generate fused multiply/add instructions"
msgstr ""
@@ -10945,7 +10977,7 @@ msgstr ""
#. Output assembler code to FILE to increment profiler label # LABELNO
#. for profiling a function entry.
-#: config/mips/mips.h:2433
+#: config/mips/mips.h:2425
msgid "mips16 function profiling"
msgstr ""
@@ -11216,29 +11248,29 @@ msgstr ""
msgid "No \"Small register classes\" kludge"
msgstr ""
-#: config/pa/pa.c:303
+#: config/pa/pa.c:304
#, c-format
msgid ""
"unknown -mschedule= option (%s).\n"
"Valid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n"
msgstr ""
-#: config/pa/pa.c:328
+#: config/pa/pa.c:329
#, c-format
msgid ""
"unknown -march= option (%s).\n"
"Valid options are 1.0, 1.1, and 2.0\n"
msgstr ""
-#: config/pa/pa.c:341
+#: config/pa/pa.c:342
msgid "PIC code generation is not supported in the portable runtime model\n"
msgstr ""
-#: config/pa/pa.c:346
+#: config/pa/pa.c:347
msgid "PIC code generation is not compatible with fast indirect calls\n"
msgstr ""
-#: config/pa/pa.c:351
+#: config/pa/pa.c:352
msgid "-g is only supported when using GAS on this processor,"
msgstr ""
@@ -11503,152 +11535,152 @@ msgstr ""
msgid "junk at end of #pragma longcall"
msgstr ""
-#: config/rs6000/rs6000.c:765
+#: config/rs6000/rs6000.c:827
msgid "-mmultiple is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:772
+#: config/rs6000/rs6000.c:834
msgid "-mstring is not supported on little endian systems"
msgstr ""
-#: config/rs6000/rs6000.c:786
+#: config/rs6000/rs6000.c:848
#, c-format
msgid "unknown -mdebug-%s switch"
msgstr ""
-#: config/rs6000/rs6000.c:798
+#: config/rs6000/rs6000.c:860
#, c-format
msgid "unknown -mtraceback arg `%s'; expecting `full', `partial' or `none'"
msgstr ""
-#: config/rs6000/rs6000.c:809
+#: config/rs6000/rs6000.c:871
#, c-format
msgid "Unknown switch -mlong-double-%s"
msgstr ""
-#: config/rs6000/rs6000.c:980
+#: config/rs6000/rs6000.c:1042
#, c-format
msgid "unknown -m%s= option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:997
+#: config/rs6000/rs6000.c:1059
#, c-format
msgid "not configured for ABI: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:1003
+#: config/rs6000/rs6000.c:1065
#, c-format
msgid "unknown ABI specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:1017
+#: config/rs6000/rs6000.c:1079
#, c-format
msgid "unknown -malign-XXXXX option specified: '%s'"
msgstr ""
-#: config/rs6000/rs6000.c:5134
+#: config/rs6000/rs6000.c:5297
msgid "argument 1 must be a 5-bit signed literal"
msgstr ""
-#: config/rs6000/rs6000.c:5236 config/rs6000/rs6000.c:5862
+#: config/rs6000/rs6000.c:5399 config/rs6000/rs6000.c:6022
msgid "argument 2 must be a 5-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:5276
+#: config/rs6000/rs6000.c:5439
msgid "argument 1 of __builtin_altivec_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:5330
+#: config/rs6000/rs6000.c:5493
msgid "argument 1 of __builtin_altivec_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:5461
+#: config/rs6000/rs6000.c:5621
msgid "argument 3 must be a 4-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:5631
+#: config/rs6000/rs6000.c:5791
#, c-format
msgid "argument to `%s' must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:5744
+#: config/rs6000/rs6000.c:5904
msgid "argument to dss must be a 2-bit unsigned literal"
msgstr ""
-#: config/rs6000/rs6000.c:5982
+#: config/rs6000/rs6000.c:6142
msgid "argument 1 of __builtin_spe_predicate must be a constant"
msgstr ""
-#: config/rs6000/rs6000.c:6055
+#: config/rs6000/rs6000.c:6215
msgid "argument 1 of __builtin_spe_predicate is out of range"
msgstr ""
-#: config/rs6000/rs6000.c:8487
+#: config/rs6000/rs6000.c:8647
#, c-format
msgid "invalid %%f value"
msgstr ""
-#: config/rs6000/rs6000.c:8496
+#: config/rs6000/rs6000.c:8656
#, c-format
msgid "invalid %%F value"
msgstr ""
-#: config/rs6000/rs6000.c:8505
+#: config/rs6000/rs6000.c:8665
#, c-format
msgid "invalid %%G value"
msgstr ""
-#: config/rs6000/rs6000.c:8540
+#: config/rs6000/rs6000.c:8700
#, c-format
msgid "invalid %%j code"
msgstr ""
-#: config/rs6000/rs6000.c:8550
+#: config/rs6000/rs6000.c:8710
#, c-format
msgid "invalid %%J code"
msgstr ""
-#: config/rs6000/rs6000.c:8560
+#: config/rs6000/rs6000.c:8720
#, c-format
msgid "invalid %%k value"
msgstr ""
-#: config/rs6000/rs6000.c:8580 config/xtensa/xtensa.c:1957
+#: config/rs6000/rs6000.c:8740 config/xtensa/xtensa.c:1961
#, c-format
msgid "invalid %%K value"
msgstr ""
-#: config/rs6000/rs6000.c:8647
+#: config/rs6000/rs6000.c:8807
#, c-format
msgid "invalid %%O value"
msgstr ""
-#: config/rs6000/rs6000.c:8694
+#: config/rs6000/rs6000.c:8854
#, c-format
msgid "invalid %%q value"
msgstr ""
-#: config/rs6000/rs6000.c:8738
+#: config/rs6000/rs6000.c:8898
#, c-format
msgid "invalid %%S value"
msgstr ""
-#: config/rs6000/rs6000.c:8780
+#: config/rs6000/rs6000.c:8940
#, c-format
msgid "invalid %%T value"
msgstr ""
-#: config/rs6000/rs6000.c:8790
+#: config/rs6000/rs6000.c:8950
#, c-format
msgid "invalid %%u value"
msgstr ""
-#: config/rs6000/rs6000.c:8799 config/xtensa/xtensa.c:1927
+#: config/rs6000/rs6000.c:8959 config/xtensa/xtensa.c:1931
#, c-format
msgid "invalid %%v value"
msgstr ""
-#: config/rs6000/rs6000.c:13255
+#: config/rs6000/rs6000.c:13453
msgid "no profiling of 64-bit code for this ABI"
msgstr ""
@@ -11692,12 +11724,12 @@ msgstr ""
#. The Darwin ABI always includes AltiVec, can't be (validly) turned
#. off.
-#: config/rs6000/darwin.h:79
+#: config/rs6000/darwin.h:80
msgid "-mdynamic-no-pic overrides -fpic or -fPIC"
msgstr ""
#. Darwin doesn't support -fpic.
-#: config/rs6000/darwin.h:85
+#: config/rs6000/darwin.h:86
msgid "-fpic is not supported; -fPIC assumed"
msgstr ""
@@ -11716,183 +11748,183 @@ 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:241
+#: config/rs6000/rs6000.h:245
msgid "Use POWER instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:244
+#: config/rs6000/rs6000.h:248
msgid "Use POWER2 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:246
+#: config/rs6000/rs6000.h:250
msgid "Do not use POWER2 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:249
+#: config/rs6000/rs6000.h:253
msgid "Do not use POWER instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:251
+#: config/rs6000/rs6000.h:255
msgid "Use PowerPC instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:254
+#: config/rs6000/rs6000.h:258
msgid "Do not use PowerPC instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:256
+#: config/rs6000/rs6000.h:260
msgid "Use PowerPC General Purpose group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:258
+#: config/rs6000/rs6000.h:262
msgid "Don't use PowerPC General Purpose group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:260
+#: config/rs6000/rs6000.h:264
msgid "Use PowerPC Graphics group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:262
+#: config/rs6000/rs6000.h:266
msgid "Don't use PowerPC Graphics group optional instructions"
msgstr ""
-#: config/rs6000/rs6000.h:264
+#: config/rs6000/rs6000.h:268
msgid "Use PowerPC-64 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:266
+#: config/rs6000/rs6000.h:270
msgid "Don't use PowerPC-64 instruction set"
msgstr ""
-#: config/rs6000/rs6000.h:268
+#: config/rs6000/rs6000.h:272
msgid "Use AltiVec instructions"
msgstr ""
-#: config/rs6000/rs6000.h:270
+#: config/rs6000/rs6000.h:274
msgid "Don't use AltiVec instructions"
msgstr ""
-#: config/rs6000/rs6000.h:272
+#: config/rs6000/rs6000.h:276
msgid "Use new mnemonics for PowerPC architecture"
msgstr ""
-#: config/rs6000/rs6000.h:274
+#: config/rs6000/rs6000.h:278
msgid "Use old mnemonics for PowerPC architecture"
msgstr ""
-#: config/rs6000/rs6000.h:277
+#: config/rs6000/rs6000.h:281
msgid "Put everything in the regular TOC"
msgstr ""
-#: config/rs6000/rs6000.h:279
+#: config/rs6000/rs6000.h:283
msgid "Place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:281
+#: config/rs6000/rs6000.h:285
msgid "Don't place floating point constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:283
+#: config/rs6000/rs6000.h:287
msgid "Place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:285
+#: config/rs6000/rs6000.h:289
msgid "Don't place symbol+offset constants in TOC"
msgstr ""
-#: config/rs6000/rs6000.h:291
+#: config/rs6000/rs6000.h:295
msgid "Place variable addresses in the regular TOC"
msgstr ""
-#: config/rs6000/rs6000.h:297
+#: config/rs6000/rs6000.h:301
msgid "Generate load/store multiple instructions"
msgstr ""
-#: config/rs6000/rs6000.h:299
+#: config/rs6000/rs6000.h:303
msgid "Do not generate load/store multiple instructions"
msgstr ""
-#: config/rs6000/rs6000.h:301
+#: config/rs6000/rs6000.h:305
msgid "Generate string instructions for block moves"
msgstr ""
-#: config/rs6000/rs6000.h:303
+#: config/rs6000/rs6000.h:307
msgid "Do not generate string instructions for block moves"
msgstr ""
-#: config/rs6000/rs6000.h:305
+#: config/rs6000/rs6000.h:309
msgid "Generate load/store with update instructions"
msgstr ""
-#: config/rs6000/rs6000.h:307
+#: config/rs6000/rs6000.h:311
msgid "Do not generate load/store with update instructions"
msgstr ""
-#: config/rs6000/rs6000.h:315
+#: config/rs6000/rs6000.h:319
msgid "Don't schedule the start and end of the procedure"
msgstr ""
-#: config/rs6000/rs6000.h:321
+#: config/rs6000/rs6000.h:325
msgid "Return all structures in memory (AIX default)"
msgstr ""
-#: config/rs6000/rs6000.h:323
+#: config/rs6000/rs6000.h:327
msgid "Return small structures in registers (SVR4 default)"
msgstr ""
-#: config/rs6000/rs6000.h:410 config/sparc/sparc.h:648
+#: config/rs6000/rs6000.h:414 config/sparc/sparc.h:648
msgid "Use features of and schedule code for given CPU"
msgstr ""
-#: config/rs6000/rs6000.h:413
+#: config/rs6000/rs6000.h:417
msgid "Enable debug output"
msgstr ""
-#: config/rs6000/rs6000.h:415
+#: config/rs6000/rs6000.h:419
msgid "Select full, part, or no traceback table"
msgstr ""
-#: config/rs6000/rs6000.h:416
+#: config/rs6000/rs6000.h:420
msgid "Specify ABI to use"
msgstr ""
-#: config/rs6000/rs6000.h:418
+#: config/rs6000/rs6000.h:422
msgid "Specify size of long double (64 or 128 bits)"
msgstr ""
-#: config/rs6000/rs6000.h:420
+#: config/rs6000/rs6000.h:424
msgid "Specify yes/no if isel instructions should be generated"
msgstr ""
-#: config/rs6000/rs6000.h:422
+#: config/rs6000/rs6000.h:426
msgid "Specify yes/no if SPE SIMD instructions should be generated"
msgstr ""
-#: config/rs6000/rs6000.h:424
+#: config/rs6000/rs6000.h:428
msgid "Specify yes/no if using floating point in the GPRs"
msgstr ""
-#: config/rs6000/rs6000.h:426
+#: config/rs6000/rs6000.h:430
msgid "Specify yes/no if VRSAVE instructions should be generated for AltiVec"
msgstr ""
-#: config/rs6000/rs6000.h:428
+#: config/rs6000/rs6000.h:432
msgid "Avoid all range limits on call instructions"
msgstr ""
-#: config/rs6000/rs6000.h:431
+#: config/rs6000/rs6000.h:435
msgid "Determine which dependences between insns are considered costly"
msgstr ""
-#: config/rs6000/rs6000.h:433
+#: config/rs6000/rs6000.h:437
msgid "Specify which post scheduling nop insertion scheme to apply"
msgstr ""
-#: config/rs6000/rs6000.h:435
+#: config/rs6000/rs6000.h:439
msgid "Specify alignment of structure fields default/natural"
msgstr ""
-#: config/rs6000/rs6000.h:437
+#: config/rs6000/rs6000.h:441
msgid "Specify scheduling priority for dispatch slot restricted insns"
msgstr ""
@@ -11908,7 +11940,7 @@ 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:1950
+#: config/rs6000/rs6000.h:1895
msgid "RETURN_ADDRESS_OFFSET not supported"
msgstr ""
@@ -12020,94 +12052,94 @@ msgstr ""
#.
#. The macro SUBTARGET_OVERRIDE_OPTIONS is provided for subtargets, to
#. get control.
-#: config/rs6000/sysv4.h:212
+#: config/rs6000/sysv4.h:214
#, c-format
msgid "bad value for -mcall-%s"
msgstr ""
-#: config/rs6000/sysv4.h:228
+#: config/rs6000/sysv4.h:230
#, c-format
msgid "bad value for -msdata=%s"
msgstr ""
-#: config/rs6000/sysv4.h:245
+#: config/rs6000/sysv4.h:247
#, c-format
msgid "-mrelocatable and -msdata=%s are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:254
+#: config/rs6000/sysv4.h:256
#, c-format
msgid "-f%s and -msdata=%s are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:263
+#: config/rs6000/sysv4.h:265
#, c-format
msgid "-msdata=%s and -mcall-%s are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:272
+#: config/rs6000/sysv4.h:274
msgid "-mrelocatable and -mno-minimal-toc are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:278
+#: config/rs6000/sysv4.h:280
#, c-format
msgid "-mrelocatable and -mcall-%s are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:285
+#: config/rs6000/sysv4.h:287
#, c-format
msgid "-fPIC and -mcall-%s are incompatible"
msgstr ""
-#: config/rs6000/sysv4.h:292
+#: config/rs6000/sysv4.h:294
msgid "-mcall-aixdesc must be big endian"
msgstr ""
-#: config/rs6000/sysv4.h:307
+#: config/rs6000/sysv4.h:309
#, c-format
msgid "-m%s not supported in this configuration"
msgstr ""
-#: config/s390/s390.c:1048
+#: config/s390/s390.c:1057
#, c-format
msgid "Unknown cpu used in -march=%s."
msgstr ""
-#: config/s390/s390.c:1067
+#: config/s390/s390.c:1076
#, c-format
msgid "Unknown cpu used in -mtune=%s."
msgstr ""
-#: config/s390/s390.c:1072
+#: config/s390/s390.c:1081
#, c-format
msgid "z/Architecture mode not supported on %s."
msgstr ""
-#: config/s390/s390.c:1074
+#: config/s390/s390.c:1083
msgid "64-bit ABI not supported in ESA/390 mode."
msgstr ""
-#: config/s390/s390.c:3388
+#: config/s390/s390.c:3397
msgid "invalid UNSPEC as operand (1)"
msgstr ""
-#: config/s390/s390.c:3436
+#: config/s390/s390.c:3445
msgid "invalid UNSPEC as operand (2)"
msgstr ""
-#: config/s390/s390.c:3442
+#: config/s390/s390.c:3451
msgid "UNKNOWN in s390_output_symbolic_const !?"
msgstr ""
-#: config/s390/s390.c:3458
+#: config/s390/s390.c:3467
msgid "Cannot decompose address."
msgstr ""
-#: config/s390/s390.c:3621
+#: config/s390/s390.c:3630
msgid "UNKNOWN in print_operand !?"
msgstr ""
-#: config/s390/s390.c:5313
+#: config/s390/s390.c:5348
msgid "Total size of local variables exceeds architecture limit."
msgstr ""
@@ -12175,28 +12207,28 @@ msgstr ""
msgid "enable fused multiply/add instructions"
msgstr ""
-#: config/sh/sh.c:5819
+#: config/sh/sh.c:5827
msgid "__builtin_saveregs not supported by this subtarget"
msgstr ""
-#: config/sh/sh.c:6721
+#: config/sh/sh.c:6729
msgid "attribute interrupt_handler is not compatible with -m5-compact"
msgstr ""
#. The sp_switch attribute only has meaning for interrupt functions.
-#: config/sh/sh.c:6743 config/sh/sh.c:6778
+#: config/sh/sh.c:6751 config/sh/sh.c:6786
#, c-format
msgid "`%s' attribute only applies to interrupt functions"
msgstr ""
#. The argument must be a constant string.
-#: config/sh/sh.c:6750
+#: config/sh/sh.c:6758
#, c-format
msgid "`%s' attribute argument not a string constant"
msgstr ""
#. The argument must be a constant integer.
-#: config/sh/sh.c:6785
+#: config/sh/sh.c:6793
#, c-format
msgid "`%s' attribute argument not an integer constant"
msgstr ""
@@ -12221,56 +12253,56 @@ msgstr ""
msgid "-mcmodel= is not supported on 32 bit systems"
msgstr ""
-#: config/sparc/sparc.c:6665 config/sparc/sparc.c:6671
+#: config/sparc/sparc.c:6666 config/sparc/sparc.c:6672
#, c-format
msgid "invalid %%Y operand"
msgstr ""
-#: config/sparc/sparc.c:6741
+#: config/sparc/sparc.c:6742
#, c-format
msgid "invalid %%A operand"
msgstr ""
-#: config/sparc/sparc.c:6751
+#: config/sparc/sparc.c:6752
#, c-format
msgid "invalid %%B operand"
msgstr ""
-#: config/sparc/sparc.c:6790
+#: config/sparc/sparc.c:6791
#, c-format
msgid "invalid %%c operand"
msgstr ""
-#: config/sparc/sparc.c:6791
+#: config/sparc/sparc.c:6792
#, c-format
msgid "invalid %%C operand"
msgstr ""
-#: config/sparc/sparc.c:6812
+#: config/sparc/sparc.c:6813
#, c-format
msgid "invalid %%d operand"
msgstr ""
-#: config/sparc/sparc.c:6813
+#: config/sparc/sparc.c:6814
#, c-format
msgid "invalid %%D operand"
msgstr ""
-#: config/sparc/sparc.c:6829
+#: config/sparc/sparc.c:6830
#, c-format
msgid "invalid %%f operand"
msgstr ""
-#: config/sparc/sparc.c:6843
+#: config/sparc/sparc.c:6844
#, c-format
msgid "invalid %%s operand"
msgstr ""
-#: config/sparc/sparc.c:6897
+#: config/sparc/sparc.c:6898
msgid "long long constant not a valid immediate operand"
msgstr ""
-#: config/sparc/sparc.c:6900
+#: config/sparc/sparc.c:6901
msgid "floating point constant not a valid immediate operand"
msgstr ""
@@ -12651,56 +12683,56 @@ msgstr ""
msgid "Set the max size of data eligible for the ZDA area"
msgstr ""
-#: config/xtensa/xtensa.c:1786
+#: config/xtensa/xtensa.c:1790
msgid "boolean registers required for the floating-point option"
msgstr ""
-#: config/xtensa/xtensa.c:1840
+#: config/xtensa/xtensa.c:1844
#, c-format
msgid "-f%s is not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:1845
+#: config/xtensa/xtensa.c:1849
msgid "PIC is required but not supported with CONST16 instructions"
msgstr ""
-#: config/xtensa/xtensa.c:1915
+#: config/xtensa/xtensa.c:1919
#, c-format
msgid "invalid %%D value"
msgstr ""
-#: config/xtensa/xtensa.c:1952
+#: config/xtensa/xtensa.c:1956
msgid "invalid mask"
msgstr ""
-#: config/xtensa/xtensa.c:1978
+#: config/xtensa/xtensa.c:1982
#, c-format
msgid "invalid %%x value"
msgstr ""
-#: config/xtensa/xtensa.c:1985
+#: config/xtensa/xtensa.c:1989
#, c-format
msgid "invalid %%d value"
msgstr ""
-#: config/xtensa/xtensa.c:2006 config/xtensa/xtensa.c:2016
+#: config/xtensa/xtensa.c:2010 config/xtensa/xtensa.c:2020
#, c-format
msgid "invalid %%t/%%b value"
msgstr ""
-#: config/xtensa/xtensa.c:2058
+#: config/xtensa/xtensa.c:2062
msgid "invalid address"
msgstr ""
-#: config/xtensa/xtensa.c:2083
+#: config/xtensa/xtensa.c:2087
msgid "no register in address"
msgstr ""
-#: config/xtensa/xtensa.c:2091
+#: config/xtensa/xtensa.c:2095
msgid "address offset not a constant"
msgstr ""
-#: config/xtensa/xtensa.c:2755
+#: config/xtensa/xtensa.c:2759
msgid "only uninitialized variables can be placed in a .bss section"
msgstr ""
@@ -12744,12 +12776,12 @@ msgstr ""
msgid "Use direct CALLn instructions for fast calls"
msgstr ""
-#: ada/misc.c:238
+#: ada/misc.c:239
#, c-format
msgid "missing argument to \"-%s\""
msgstr ""
-#: ada/misc.c:274
+#: ada/misc.c:280
msgid "`-gnat' misspelled as `-gant'"
msgstr ""
@@ -12765,7 +12797,7 @@ msgstr ""
msgid "destructor name `~%T' does not match type `%T' of expression"
msgstr ""
-#: cp/call.c:397 cp/call.c:4951
+#: cp/call.c:397 cp/call.c:4987
msgid "request for member `%D' in `%E', which is of non-aggregate type `%T'"
msgstr ""
@@ -12897,146 +12929,146 @@ msgstr ""
msgid "comparison between `%#T' and `%#T'"
msgstr ""
-#: cp/call.c:3921
+#: cp/call.c:3925
msgid "no suitable `operator %s' for `%T'"
msgstr ""
-#: cp/call.c:3938
+#: cp/call.c:3942
msgid "`%+#D' is private"
msgstr ""
-#: cp/call.c:3940
+#: cp/call.c:3944
msgid "`%+#D' is protected"
msgstr ""
-#: cp/call.c:3942
+#: cp/call.c:3946
msgid "`%+#D' is inaccessible"
msgstr ""
-#: cp/call.c:3943
+#: cp/call.c:3947
msgid "within this context"
msgstr ""
-#: cp/call.c:3986
+#: cp/call.c:3990
msgid "invalid conversion from `%T' to `%T'"
msgstr ""
-#: cp/call.c:3988 cp/call.c:4126 cp/call.c:4128
+#: cp/call.c:3992 cp/call.c:4130 cp/call.c:4132
msgid " initializing argument %P of `%D'"
msgstr ""
-#: cp/call.c:4050 cp/call.c:4054
+#: cp/call.c:4054 cp/call.c:4058
msgid " initializing argument %P of `%D' from result of `%D'"
msgstr ""
-#: cp/call.c:4060 cp/call.c:4063
+#: cp/call.c:4064 cp/call.c:4067
msgid " initializing temporary from result of `%D'"
msgstr ""
-#: cp/call.c:4148
+#: cp/call.c:4152
msgid "cannot bind bitfield `%E' to `%T'"
msgstr ""
-#: cp/call.c:4151
+#: cp/call.c:4155
msgid "cannot bind packed field `%E' to `%T'"
msgstr ""
-#: cp/call.c:4154
+#: cp/call.c:4158
msgid "cannot bind rvalue `%E' to `%T'"
msgstr ""
#. Undefined behavior [expr.call] 5.2.2/7. We used to just warn
#. here and do a bitwise copy, but now cp_expr_size will abort if we
#. try to do that.
-#: cp/call.c:4235
+#: cp/call.c:4239
msgid ""
"cannot pass objects of non-POD type `%#T' through `...'; call will abort at "
"runtime"
msgstr ""
#. Undefined behavior [expr.call] 5.2.2/7.
-#: cp/call.c:4260
+#: cp/call.c:4264
msgid "cannot receive objects of non-POD type `%#T' through `...'"
msgstr ""
-#: cp/call.c:4298
+#: cp/call.c:4302
msgid "the default argument for parameter %d of `%D' has not yet been parsed"
msgstr ""
-#: cp/call.c:4423
+#: cp/call.c:4459
msgid "passing `%T' as `this' argument of `%#D' discards qualifiers"
msgstr ""
-#: cp/call.c:4442
+#: cp/call.c:4478
msgid "`%T' is not an accessible base of `%T'"
msgstr ""
-#: cp/call.c:4685
+#: cp/call.c:4721
msgid "could not find class$ field in java interface type `%T'"
msgstr ""
-#: cp/call.c:4925
+#: cp/call.c:4961
msgid "call to non-function `%D'"
msgstr ""
-#: cp/call.c:5029
+#: cp/call.c:5065
msgid "no matching function for call to `%T::%s(%A)%#V'"
msgstr ""
-#: cp/call.c:5046
+#: cp/call.c:5082
#, c-format
msgid "call of overloaded `%s(%A)' is ambiguous"
msgstr ""
-#: cp/call.c:5067
+#: cp/call.c:5103
msgid "cannot call member function `%D' without object"
msgstr ""
-#: cp/call.c:5653
+#: cp/call.c:5689
msgid "passing `%T' chooses `%T' over `%T'"
msgstr ""
-#: cp/call.c:5655 cp/name-lookup.c:4004
+#: cp/call.c:5691 cp/name-lookup.c:4039
msgid " in call to `%D'"
msgstr ""
-#: cp/call.c:5712
+#: cp/call.c:5748
msgid "choosing `%D' over `%D'"
msgstr ""
-#: cp/call.c:5713
+#: cp/call.c:5749
msgid " for conversion from `%T' to `%T'"
msgstr ""
-#: cp/call.c:5715
+#: cp/call.c:5751
msgid " because conversion sequence for the argument is better"
msgstr ""
-#: cp/call.c:5835
+#: cp/call.c:5871
msgid ""
"ISO C++ says that these are ambiguous, even though the worst conversion for "
"the first is better than the worst conversion for the second:"
msgstr ""
-#: cp/call.c:5839
+#: cp/call.c:5875
msgid "candidate 1:"
msgstr ""
-#: cp/call.c:5840
+#: cp/call.c:5876
msgid "candidate 2:"
msgstr ""
-#: cp/call.c:5949
+#: cp/call.c:5985
msgid "could not convert `%E' to `%T'"
msgstr ""
-#: cp/call.c:6054
+#: cp/call.c:6090
msgid ""
"invalid initialization of non-const reference of type '%T' from a temporary "
"of type '%T'"
msgstr ""
-#: cp/call.c:6058
+#: cp/call.c:6094
msgid ""
"invalid initialization of reference of type '%T' from expression of type '%T'"
msgstr ""
@@ -13079,204 +13111,204 @@ msgstr ""
msgid "conflicting access specifications for field `%s', ignored"
msgstr ""
-#: cp/class.c:1118
+#: cp/class.c:1122
msgid "`%D' names constructor"
msgstr ""
-#: cp/class.c:1123
+#: cp/class.c:1127
msgid "`%D' invalid in `%T'"
msgstr ""
-#: cp/class.c:1131
+#: cp/class.c:1135
msgid "no members matching `%D' in `%#T'"
msgstr ""
-#: cp/class.c:1163 cp/class.c:1171
+#: cp/class.c:1167 cp/class.c:1175
msgid "`%D' invalid in `%#T'"
msgstr ""
-#: cp/class.c:1164
+#: cp/class.c:1168
msgid " because of local method `%#D' with same name"
msgstr ""
-#: cp/class.c:1172
+#: cp/class.c:1176
msgid " because of local member `%#D' with same name"
msgstr ""
-#: cp/class.c:1242
+#: cp/class.c:1246
msgid "base class `%#T' has a non-virtual destructor"
msgstr ""
-#: cp/class.c:1262
+#: cp/class.c:1266
msgid ""
"base `%T' with only non-default constructor in class without a constructor"
msgstr ""
-#: cp/class.c:1646
+#: cp/class.c:1650
msgid "all member functions in class `%T' are private"
msgstr ""
-#: cp/class.c:1657
+#: cp/class.c:1661
msgid "`%#T' only defines a private destructor and has no friends"
msgstr ""
-#: cp/class.c:1699
+#: cp/class.c:1703
msgid "`%#T' only defines private constructors and has no friends"
msgstr ""
-#: cp/class.c:2080
+#: cp/class.c:2084
msgid "no unique final overrider for `%D' in `%T'"
msgstr ""
#. Here we know it is a hider, and no overrider exists.
-#: cp/class.c:2515
+#: cp/class.c:2519
msgid "`%D' was hidden"
msgstr ""
-#: cp/class.c:2516
+#: cp/class.c:2520
msgid " by `%D'"
msgstr ""
-#: cp/class.c:2557
+#: cp/class.c:2561
msgid "ISO C++ forbids member `%D' with same name as enclosing class"
msgstr ""
-#: cp/class.c:2562 cp/decl2.c:1186
+#: cp/class.c:2566 cp/decl2.c:1186
msgid "`%#D' invalid; an anonymous union can only have non-static data members"
msgstr ""
-#: cp/class.c:2568 cp/decl2.c:1193
+#: cp/class.c:2572 cp/decl2.c:1193
msgid "private member `%#D' in anonymous union"
msgstr ""
-#: cp/class.c:2571 cp/decl2.c:1195
+#: cp/class.c:2575 cp/decl2.c:1195
msgid "protected member `%#D' in anonymous union"
msgstr ""
-#: cp/class.c:2690
+#: cp/class.c:2694
msgid ""
"vtable layout for class `%T' may not be ABI-compliant and may change in a "
"future version of GCC due to implicit virtual destructor"
msgstr ""
-#: cp/class.c:2750
+#: cp/class.c:2754
msgid "bit-field `%#D' with non-integral type"
msgstr ""
-#: cp/class.c:2770
+#: cp/class.c:2774
msgid "bit-field `%D' width not an integer constant"
msgstr ""
-#: cp/class.c:2776
+#: cp/class.c:2780
msgid "negative width in bit-field `%D'"
msgstr ""
-#: cp/class.c:2781
+#: cp/class.c:2785
msgid "zero width for bit-field `%D'"
msgstr ""
-#: cp/class.c:2787
+#: cp/class.c:2791
msgid "width of `%D' exceeds its type"
msgstr ""
-#: cp/class.c:2796
+#: cp/class.c:2800
msgid "`%D' is too small to hold all values of `%#T'"
msgstr ""
-#: cp/class.c:2858
+#: cp/class.c:2862
msgid "member `%#D' with constructor not allowed in union"
msgstr ""
-#: cp/class.c:2861
+#: cp/class.c:2865
msgid "member `%#D' with destructor not allowed in union"
msgstr ""
-#: cp/class.c:2864
+#: cp/class.c:2868
msgid "member `%#D' with copy assignment operator not allowed in union"
msgstr ""
-#: cp/class.c:2891
+#: cp/class.c:2895
msgid "multiple fields in union `%T' initialized"
msgstr ""
-#: cp/class.c:2960
+#: cp/class.c:2964
msgid "ignoring packed attribute on unpacked non-POD field `%#D'"
msgstr ""
-#: cp/class.c:3012
+#: cp/class.c:3016
msgid "field `%D' in local class cannot be static"
msgstr ""
-#: cp/class.c:3018
+#: cp/class.c:3022
msgid "field `%D' invalidly declared function type"
msgstr ""
-#: cp/class.c:3025
+#: cp/class.c:3029
msgid "field `%D' invalidly declared method type"
msgstr ""
#. Unions cannot have static members.
-#: cp/class.c:3043
+#: cp/class.c:3047
msgid "field `%D' declared static in union"
msgstr ""
-#: cp/class.c:3070
+#: cp/class.c:3074
msgid "non-static reference `%#D' in class without a constructor"
msgstr ""
-#: cp/class.c:3105
+#: cp/class.c:3109
msgid "non-static const member `%#D' in class without a constructor"
msgstr ""
-#: cp/class.c:3120
+#: cp/class.c:3124
msgid "field `%#D' with same name as class"
msgstr ""
-#: cp/class.c:3138
+#: cp/class.c:3142
msgid "`%#T' has pointer data members"
msgstr ""
-#: cp/class.c:3142
+#: cp/class.c:3146
msgid " but does not override `%T(const %T&)'"
msgstr ""
-#: cp/class.c:3144
+#: cp/class.c:3148
msgid " or `operator=(const %T&)'"
msgstr ""
-#: cp/class.c:3147
+#: cp/class.c:3151
msgid " but does not override `operator=(const %T&)'"
msgstr ""
-#: cp/class.c:3574
+#: cp/class.c:3578
msgid ""
"offset of empty base `%T' may not be ABI-compliant and maychange in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:3683
+#: cp/class.c:3687
msgid "class `%T' will be considered nearly empty in a future version of GCC"
msgstr ""
-#: cp/class.c:3770
+#: cp/class.c:3774
msgid "initializer specified for non-virtual method `%D'"
msgstr ""
-#: cp/class.c:4455
+#: cp/class.c:4459
msgid ""
"offset of virtual base `%T' is not ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4545
+#: cp/class.c:4549
msgid "direct base `%T' inaccessible in `%T' due to ambiguity"
msgstr ""
-#: cp/class.c:4558
+#: cp/class.c:4562
msgid "virtual base `%T' inaccessible in `%T' due to ambiguity"
msgstr ""
-#: cp/class.c:4732
+#: cp/class.c:4736
msgid ""
"size assigned to `%T' may not be ABI-compliant and may change in a future "
"version of GCC"
@@ -13284,77 +13316,77 @@ msgstr ""
#. Versions of G++ before G++ 3.4 did not reset the
#. DECL_MODE.
-#: cp/class.c:4771
+#: cp/class.c:4775
msgid ""
"the offset of `%D' may not be ABI-compliant and may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4794
+#: cp/class.c:4798
msgid ""
"offset of `%D' is not ABI-compliant and may change in a future version of GCC"
msgstr ""
-#: cp/class.c:4803
+#: cp/class.c:4807
msgid ""
"`%D' contains empty classes which may cause base classes to be placed at "
"different locations in a future version of GCC"
msgstr ""
-#: cp/class.c:4862
+#: cp/class.c:4866
msgid ""
"layout of classes derived from empty class `%T' may change in a future "
"version of GCC"
msgstr ""
-#: cp/class.c:4990 cp/semantics.c:2027
+#: cp/class.c:4994 cp/semantics.c:2036
msgid "redefinition of `%#T'"
msgstr ""
-#: cp/class.c:5156
+#: cp/class.c:5160
msgid "`%#T' has virtual functions but non-virtual destructor"
msgstr ""
-#: cp/class.c:5235
+#: cp/class.c:5239
msgid "trying to finish struct, but kicked out due to previous parse errors"
msgstr ""
-#: cp/class.c:5674
+#: cp/class.c:5681
#, c-format
msgid "language string `\"%s\"' not recognized"
msgstr ""
-#: cp/class.c:5762
+#: cp/class.c:5769
msgid ""
"cannot resolve overloaded function `%D' based on conversion to type `%T'"
msgstr ""
-#: cp/class.c:5887
+#: cp/class.c:5894
msgid "no matches converting function `%D' to type `%#T'"
msgstr ""
-#: cp/class.c:5910
+#: cp/class.c:5917
msgid "converting overloaded function `%D' to type `%#T' is ambiguous"
msgstr ""
-#: cp/class.c:5936
+#: cp/class.c:5943
msgid "assuming pointer to member `%D'"
msgstr ""
-#: cp/class.c:5939
+#: cp/class.c:5946
#, c-format
msgid "(a pointer to member can only be formed with `&%E')"
msgstr ""
-#: cp/class.c:5984 cp/class.c:6166 cp/class.c:6173
+#: cp/class.c:5991 cp/class.c:6173 cp/class.c:6180
msgid "not enough type information"
msgstr ""
-#: cp/class.c:6001
+#: cp/class.c:6008
msgid "argument of type `%T' does not match `%T'"
msgstr ""
-#: cp/class.c:6150
+#: cp/class.c:6157
msgid "invalid operation on uninstantiated type"
msgstr ""
@@ -13363,11 +13395,11 @@ msgstr ""
#. A name N used in a class S shall refer to the same declaration
#. in its context and when re-evaluated in the completed scope of
#. S.
-#: cp/class.c:6410 cp/decl.c:1229 cp/name-lookup.c:488 cp/pt.c:1957
+#: cp/class.c:6417 cp/decl.c:1229 cp/name-lookup.c:491 cp/pt.c:1959
msgid "declaration of `%#D'"
msgstr ""
-#: cp/class.c:6411
+#: cp/class.c:6418
msgid "changes meaning of `%D' from `%+#D'"
msgstr ""
@@ -13447,25 +13479,25 @@ msgid "%s cannot resolve address of overloaded function"
msgstr ""
#. Only warn when there is no &.
-#: cp/cvt.c:889
+#: cp/cvt.c:890
#, c-format
msgid "%s is a reference, not call, to function `%E'"
msgstr ""
-#: cp/cvt.c:896
+#: cp/cvt.c:897
#, c-format
msgid "%s has no effect"
msgstr ""
-#: cp/cvt.c:1007
+#: cp/cvt.c:1008
msgid "converting NULL to non-pointer type"
msgstr ""
-#: cp/cvt.c:1079
+#: cp/cvt.c:1080
msgid "ambiguous default type conversion from `%T'"
msgstr ""
-#: cp/cvt.c:1081
+#: cp/cvt.c:1082
msgid " candidate conversions include `%D' and `%D'"
msgstr ""
@@ -13484,7 +13516,7 @@ msgstr ""
msgid "label `%D' defined but not used"
msgstr ""
-#: cp/decl.c:1137 cp/decl.c:1548
+#: cp/decl.c:1137 cp/decl.c:1556
msgid "previous declaration of `%D'"
msgstr ""
@@ -13528,7 +13560,7 @@ msgstr ""
msgid "declaration of template `%#D'"
msgstr ""
-#: cp/decl.c:1340 cp/name-lookup.c:489
+#: cp/decl.c:1340 cp/name-lookup.c:492
msgid "conflicts with previous declaration `%#D'"
msgstr ""
@@ -13552,57 +13584,57 @@ msgstr ""
msgid "'%D' has a previous declaration as `%#D'"
msgstr ""
-#: cp/decl.c:1427
+#: cp/decl.c:1435
msgid "`%#D' previously defined here"
msgstr ""
-#: cp/decl.c:1428
+#: cp/decl.c:1436
msgid "`%#D' previously declared here"
msgstr ""
#. Prototype decl follows defn w/o prototype.
-#: cp/decl.c:1437
+#: cp/decl.c:1445
msgid "prototype for `%#D'"
msgstr ""
-#: cp/decl.c:1438
+#: cp/decl.c:1446
msgid "%Jfollows non-prototype definition here"
msgstr ""
-#: cp/decl.c:1450
+#: cp/decl.c:1458
msgid "previous declaration of `%#D' with %L linkage"
msgstr ""
-#: cp/decl.c:1452
+#: cp/decl.c:1460
msgid "conflicts with new declaration with %L linkage"
msgstr ""
-#: cp/decl.c:1475 cp/decl.c:1482
+#: cp/decl.c:1483 cp/decl.c:1490
msgid "default argument given for parameter %d of `%#D'"
msgstr ""
-#: cp/decl.c:1477 cp/decl.c:1484
+#: cp/decl.c:1485 cp/decl.c:1492
msgid "after previous specification in `%#D'"
msgstr ""
-#: cp/decl.c:1493
+#: cp/decl.c:1501
msgid "`%#D' was used before it was declared inline"
msgstr ""
-#: cp/decl.c:1494
+#: cp/decl.c:1502
msgid "%Jprevious non-inline declaration here"
msgstr ""
-#: cp/decl.c:1547
+#: cp/decl.c:1555
msgid "redundant redeclaration of `%D' in same scope"
msgstr ""
-#: cp/decl.c:1630
+#: cp/decl.c:1638
#, c-format
msgid "declaration of `%F' throws different exceptions"
msgstr ""
-#: cp/decl.c:1632
+#: cp/decl.c:1640
#, c-format
msgid "than previous declaration `%F'"
msgstr ""
@@ -13615,500 +13647,495 @@ msgstr ""
#. that specialization that would cause an implicit
#. instantiation to take place, in every translation unit in
#. which such a use occurs.
-#: cp/decl.c:1779
+#: cp/decl.c:1787
msgid "explicit specialization of %D after first use"
msgstr ""
-#: cp/decl.c:1944
+#: cp/decl.c:1953
msgid "implicit declaration of function `%#D'"
msgstr ""
-#: cp/decl.c:2092
+#: cp/decl.c:2101
#, c-format
msgid "label `%s' referenced outside of any function"
msgstr ""
-#: cp/decl.c:2189 cp/decl.c:2213 cp/decl.c:2301
+#: cp/decl.c:2198 cp/decl.c:2222 cp/decl.c:2310
msgid "jump to label `%D'"
msgstr ""
-#: cp/decl.c:2191 cp/decl.c:2215
+#: cp/decl.c:2200 cp/decl.c:2224
msgid "jump to case label"
msgstr ""
-#: cp/decl.c:2194 cp/decl.c:2218
+#: cp/decl.c:2203 cp/decl.c:2227
msgid "%H from here"
msgstr ""
-#: cp/decl.c:2199
+#: cp/decl.c:2208
msgid " crosses initialization of `%#D'"
msgstr ""
-#: cp/decl.c:2202 cp/decl.c:2317
+#: cp/decl.c:2211 cp/decl.c:2326
msgid " enters scope of non-POD `%#D'"
msgstr ""
-#: cp/decl.c:2222 cp/decl.c:2321
+#: cp/decl.c:2231 cp/decl.c:2330
msgid " enters try block"
msgstr ""
-#: cp/decl.c:2224 cp/decl.c:2323
+#: cp/decl.c:2233 cp/decl.c:2332
msgid " enters catch block"
msgstr ""
-#: cp/decl.c:2302
+#: cp/decl.c:2311
msgid " from here"
msgstr ""
#. Can't skip init of __exception_info.
-#: cp/decl.c:2313
+#: cp/decl.c:2322
msgid "%J enters catch block"
msgstr ""
-#: cp/decl.c:2315
+#: cp/decl.c:2324
msgid " skips initialization of `%#D'"
msgstr ""
-#: cp/decl.c:2349
+#: cp/decl.c:2358
msgid "label named wchar_t"
msgstr ""
-#: cp/decl.c:2352
+#: cp/decl.c:2361
msgid "duplicate label `%D'"
msgstr ""
-#: cp/decl.c:2432
-#, c-format
-msgid "case label `%E' not within a switch statement"
-msgstr ""
-
-#: cp/decl.c:2592 cp/parser.c:2992
+#: cp/decl.c:2589 cp/parser.c:3008
msgid "`%D' used without template parameters"
msgstr ""
-#: cp/decl.c:2602 cp/decl.c:2618 cp/decl.c:2706
+#: cp/decl.c:2599 cp/decl.c:2615 cp/decl.c:2703
msgid "no class template named `%#T' in `%#T'"
msgstr ""
-#: cp/decl.c:2639 cp/decl.c:2649 cp/decl.c:2669
+#: cp/decl.c:2636 cp/decl.c:2646 cp/decl.c:2666
msgid "no type named `%#T' in `%#T'"
msgstr ""
-#: cp/decl.c:3395
+#: cp/decl.c:3393
msgid "%Jan anonymous union cannot have function members"
msgstr ""
-#: cp/decl.c:3413
+#: cp/decl.c:3411
msgid "member %#D' with constructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3416
+#: cp/decl.c:3414
msgid "member %#D' with destructor not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3419
+#: cp/decl.c:3417
msgid ""
"member %#D' with copy assignment operator not allowed in anonymous aggregate"
msgstr ""
-#: cp/decl.c:3459
+#: cp/decl.c:3457
msgid "redeclaration of C++ built-in type `%T'"
msgstr ""
-#: cp/decl.c:3497
+#: cp/decl.c:3495
msgid "multiple types in one declaration"
msgstr ""
-#: cp/decl.c:3523
+#: cp/decl.c:3521
msgid "missing type-name in typedef-declaration"
msgstr ""
-#: cp/decl.c:3531
+#: cp/decl.c:3529
msgid "ISO C++ prohibits anonymous structs"
msgstr ""
-#: cp/decl.c:3538
+#: cp/decl.c:3536
msgid "`%D' can only be specified for functions"
msgstr ""
-#: cp/decl.c:3540
+#: cp/decl.c:3538
msgid "`%D' can only be specified inside a class"
msgstr ""
-#: cp/decl.c:3542
+#: cp/decl.c:3540
msgid "`%D' can only be specified for constructors"
msgstr ""
-#: cp/decl.c:3545
+#: cp/decl.c:3543
msgid "`%D' can only be specified for objects and functions"
msgstr ""
-#: cp/decl.c:3687 cp/decl2.c:883
+#: cp/decl.c:3685 cp/decl2.c:883
msgid "typedef `%D' is initialized (use __typeof__ instead)"
msgstr ""
-#: cp/decl.c:3692
+#: cp/decl.c:3690
msgid "function `%#D' is initialized like a variable"
msgstr ""
-#: cp/decl.c:3704
+#: cp/decl.c:3702
msgid "declaration of `%#D' has `extern' and is initialized"
msgstr ""
-#: cp/decl.c:3737
+#: cp/decl.c:3735
msgid "`%#D' is not a static member of `%#T'"
msgstr ""
-#: cp/decl.c:3743
+#: cp/decl.c:3741
msgid "ISO C++ does not permit `%T::%D' to be defined as `%T::%D'"
msgstr ""
-#: cp/decl.c:3754
+#: cp/decl.c:3752
msgid "duplicate initialization of %D"
msgstr ""
-#: cp/decl.c:3783
+#: cp/decl.c:3781
msgid "declaration of `%#D' outside of class is not definition"
msgstr ""
-#: cp/decl.c:3834
+#: cp/decl.c:3832
msgid "variable `%#D' has initializer but incomplete type"
msgstr ""
-#: cp/decl.c:3842 cp/decl.c:4385
+#: cp/decl.c:3840 cp/decl.c:4383
msgid "elements of array `%#D' have incomplete type"
msgstr ""
-#: cp/decl.c:3858
+#: cp/decl.c:3856
msgid "aggregate `%#D' has incomplete type and cannot be defined"
msgstr ""
-#: cp/decl.c:3900
+#: cp/decl.c:3898
msgid "`%D' declared as reference but not initialized"
msgstr ""
-#: cp/decl.c:3906
+#: cp/decl.c:3904
msgid "ISO C++ forbids use of initializer list to initialize reference `%D'"
msgstr ""
-#: cp/decl.c:3934
+#: cp/decl.c:3932
msgid "cannot initialize `%T' from `%T'"
msgstr ""
-#: cp/decl.c:3966
+#: cp/decl.c:3964
msgid "initializer fails to determine size of `%D'"
msgstr ""
-#: cp/decl.c:3971
+#: cp/decl.c:3969
msgid "array size missing in `%D'"
msgstr ""
-#: cp/decl.c:3983
+#: cp/decl.c:3981
msgid "zero-size array `%D'"
msgstr ""
#. An automatic variable with an incomplete type: that is an error.
#. Don't talk about array types here, since we took care of that
#. message in grokdeclarator.
-#: cp/decl.c:4020
+#: cp/decl.c:4018
msgid "storage size of `%D' isn't known"
msgstr ""
-#: cp/decl.c:4042
+#: cp/decl.c:4040
msgid "storage size of `%D' isn't constant"
msgstr ""
-#: cp/decl.c:4097
+#: cp/decl.c:4095
msgid ""
"sorry: semantics of inline function static data `%#D' are wrong (you'll wind "
"up with multiple copies)"
msgstr ""
-#: cp/decl.c:4098
+#: cp/decl.c:4096
msgid "%J you can work around this by removing the initializer"
msgstr ""
-#: cp/decl.c:4124
+#: cp/decl.c:4122
msgid "uninitialized const `%D'"
msgstr ""
-#: cp/decl.c:4203
+#: cp/decl.c:4201
msgid "brace-enclosed initializer used to initialize `%T'"
msgstr ""
-#: cp/decl.c:4266
+#: cp/decl.c:4264
msgid "initializer for `%T' must be brace-enclosed"
msgstr ""
-#: cp/decl.c:4281
+#: cp/decl.c:4279
msgid "ISO C++ does not allow designated initializers"
msgstr ""
-#: cp/decl.c:4285
+#: cp/decl.c:4283
msgid "`%T' has no non-static data member named `%D'"
msgstr ""
-#: cp/decl.c:4342
+#: cp/decl.c:4340
msgid "too many initializers for `%T'"
msgstr ""
-#: cp/decl.c:4379
+#: cp/decl.c:4377
msgid "variable-sized object `%D' may not be initialized"
msgstr ""
-#: cp/decl.c:4390
+#: cp/decl.c:4388
msgid "`%D' has incomplete type"
msgstr ""
-#: cp/decl.c:4445
+#: cp/decl.c:4443
msgid "`%D' must be initialized by constructor, not by `{...}'"
msgstr ""
-#: cp/decl.c:4486
+#: cp/decl.c:4484
msgid "structure `%D' with uninitialized const members"
msgstr ""
-#: cp/decl.c:4488
+#: cp/decl.c:4486
msgid "structure `%D' with uninitialized reference members"
msgstr ""
-#: cp/decl.c:4669
+#: cp/decl.c:4667
msgid "assignment (not initialization) in declaration"
msgstr ""
-#: cp/decl.c:4686
+#: cp/decl.c:4684
msgid "cannot initialize `%D' to namespace `%D'"
msgstr ""
-#: cp/decl.c:4736
+#: cp/decl.c:4734
msgid "shadowing previous type declaration of `%#D'"
msgstr ""
-#: cp/decl.c:4772
+#: cp/decl.c:4770
msgid "`%D' cannot be thread-local because it has non-POD type `%T'"
msgstr ""
-#: cp/decl.c:4787
+#: cp/decl.c:4785
msgid "`%D' is thread-local and so cannot be dynamically initialized"
msgstr ""
-#: cp/decl.c:5258
+#: cp/decl.c:5256
msgid "invalid catch parameter"
msgstr ""
-#: cp/decl.c:5372
+#: cp/decl.c:5370
msgid "destructor for alien class `%T' cannot be a member"
msgstr ""
-#: cp/decl.c:5375
+#: cp/decl.c:5373
msgid "constructor for alien class `%T' cannot be a member"
msgstr ""
-#: cp/decl.c:5397
+#: cp/decl.c:5395
msgid "`%D' declared as a `virtual' %s"
msgstr ""
-#: cp/decl.c:5399
+#: cp/decl.c:5397
msgid "`%D' declared as an `inline' %s"
msgstr ""
-#: cp/decl.c:5401
+#: cp/decl.c:5399
msgid ""
"`const' and `volatile' function specifiers on `%D' invalid in %s declaration"
msgstr ""
-#: cp/decl.c:5404
+#: cp/decl.c:5402
msgid "`%D' declared as a friend"
msgstr ""
-#: cp/decl.c:5410
+#: cp/decl.c:5408
msgid "`%D' declared with an exception specification"
msgstr ""
-#: cp/decl.c:5489
+#: cp/decl.c:5487
msgid "cannot declare `::main' to be a template"
msgstr ""
-#: cp/decl.c:5491
+#: cp/decl.c:5489
msgid "cannot declare `::main' to be inline"
msgstr ""
-#: cp/decl.c:5493
+#: cp/decl.c:5491
msgid "cannot declare `::main' to be static"
msgstr ""
-#: cp/decl.c:5496
+#: cp/decl.c:5494
msgid "`main' must return `int'"
msgstr ""
-#: cp/decl.c:5524
+#: cp/decl.c:5522
msgid "non-local function `%#D' uses anonymous type"
msgstr ""
-#: cp/decl.c:5527
+#: cp/decl.c:5525
msgid ""
"`%#D' does not refer to the unqualified type, so it is not used for linkage"
msgstr ""
-#: cp/decl.c:5533
+#: cp/decl.c:5531
msgid "non-local function `%#D' uses local type `%T'"
msgstr ""
-#: cp/decl.c:5557
+#: cp/decl.c:5555
msgid "%smember function `%D' cannot have `%T' method qualifier"
msgstr ""
-#: cp/decl.c:5581
+#: cp/decl.c:5579
msgid "defining explicit specialization `%D' in friend declaration"
msgstr ""
#. Something like `template <class T> friend void f<T>()'.
-#: cp/decl.c:5591
+#: cp/decl.c:5589
msgid "invalid use of template-id `%D' in declaration of primary template"
msgstr ""
-#: cp/decl.c:5618
+#: cp/decl.c:5616
msgid ""
"default arguments are not allowed in declaration of friend template "
"specialization `%D'"
msgstr ""
-#: cp/decl.c:5625
+#: cp/decl.c:5623
msgid ""
"`inline' is not allowed in declaration of friend template specialization `%D'"
msgstr ""
-#: cp/decl.c:5684
+#: cp/decl.c:5682
msgid "definition of implicitly-declared `%D'"
msgstr ""
-#: cp/decl.c:5702 cp/decl2.c:764
+#: cp/decl.c:5700 cp/decl2.c:764
msgid "no `%#D' member function declared in class `%T'"
msgstr ""
-#: cp/decl.c:5836
+#: cp/decl.c:5834
msgid "non-local variable `%#D' uses local type `%T'"
msgstr ""
-#: cp/decl.c:5951
+#: cp/decl.c:5949
msgid ""
"invalid in-class initialization of static data member of non-integral type `%"
"T'"
msgstr ""
-#: cp/decl.c:5960
+#: cp/decl.c:5958
msgid "ISO C++ forbids in-class initialization of non-const static member `%D'"
msgstr ""
-#: cp/decl.c:5963
+#: cp/decl.c:5961
msgid ""
"ISO C++ forbids initialization of member constant `%D' of non-integral type `"
"%T'"
msgstr ""
-#: cp/decl.c:6011
+#: cp/decl.c:6009
msgid "size of array `%D' has non-integer type"
msgstr ""
-#: cp/decl.c:6013
+#: cp/decl.c:6011
msgid "size of array has non-integer type"
msgstr ""
-#: cp/decl.c:6033
+#: cp/decl.c:6031
msgid "size of array `%D' is negative"
msgstr ""
-#: cp/decl.c:6035
+#: cp/decl.c:6033
msgid "size of array is negative"
msgstr ""
-#: cp/decl.c:6044
+#: cp/decl.c:6042
msgid "ISO C++ forbids zero-size array `%D'"
msgstr ""
-#: cp/decl.c:6046
+#: cp/decl.c:6044
msgid "ISO C++ forbids zero-size array"
msgstr ""
-#: cp/decl.c:6053
+#: cp/decl.c:6051
msgid "size of array `%D' is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:6056
+#: cp/decl.c:6054
msgid "size of array is not an integral constant-expression"
msgstr ""
-#: cp/decl.c:6074
+#: cp/decl.c:6072
msgid "ISO C++ forbids variable-size array `%D'"
msgstr ""
-#: cp/decl.c:6077
+#: cp/decl.c:6075
msgid "ISO C++ forbids variable-size array"
msgstr ""
-#: cp/decl.c:6088
+#: cp/decl.c:6086
msgid "overflow in array dimension"
msgstr ""
-#: cp/decl.c:6181
+#: cp/decl.c:6179
msgid "declaration of `%D' as %s"
msgstr ""
-#: cp/decl.c:6183
+#: cp/decl.c:6181
#, c-format
msgid "creating %s"
msgstr ""
-#: cp/decl.c:6195
+#: cp/decl.c:6193
msgid ""
"declaration of `%D' as multidimensional array must have bounds for all "
"dimensions except the first"
msgstr ""
-#: cp/decl.c:6198
+#: cp/decl.c:6196
msgid ""
"multidimensional array must have bounds for all dimensions except the first"
msgstr ""
-#: cp/decl.c:6226
+#: cp/decl.c:6224
msgid "return type specification for constructor invalid"
msgstr ""
-#: cp/decl.c:6233
+#: cp/decl.c:6231
msgid "return type specification for destructor invalid"
msgstr ""
-#: cp/decl.c:6239
+#: cp/decl.c:6237
msgid "operator `%T' declared to return `%T'"
msgstr ""
-#: cp/decl.c:6241
+#: cp/decl.c:6239
msgid "return type specified for `operator %T'"
msgstr ""
-#: cp/decl.c:6384
+#: cp/decl.c:6382
msgid "destructors must be member functions"
msgstr ""
-#: cp/decl.c:6403
+#: cp/decl.c:6401
msgid "destructor `%T' must match class name `%T'"
msgstr ""
-#: cp/decl.c:6466
+#: cp/decl.c:6464
msgid "declarator-id missing; using reserved word `%D'"
msgstr ""
-#: cp/decl.c:6520
+#: cp/decl.c:6518
msgid "type `%T' is not derived from type `%T'"
msgstr ""
#. Parse error puts this typespec where
#. a declarator should go.
-#: cp/decl.c:6583
+#: cp/decl.c:6581
msgid "`%T' specified as declarator-id"
msgstr ""
-#: cp/decl.c:6585
+#: cp/decl.c:6583
msgid " perhaps you want `%T' for a constructor"
msgstr ""
@@ -14116,300 +14143,300 @@ msgstr ""
#. decl-specifier like in
#. std::allocator alloc;
#. Handle that gracefully.
-#: cp/decl.c:6607
+#: cp/decl.c:6605
#, c-format
msgid "invalid use of template-name '%E' in a declarator"
msgstr ""
-#: cp/decl.c:6627
+#: cp/decl.c:6625
msgid "declaration of `%D' as non-function"
msgstr ""
-#: cp/decl.c:6704
+#: cp/decl.c:6702
msgid "`bool' is now a keyword"
msgstr ""
-#: cp/decl.c:6706
+#: cp/decl.c:6704
msgid "extraneous `%T' ignored"
msgstr ""
-#: cp/decl.c:6722 cp/decl.c:6766
+#: cp/decl.c:6720 cp/decl.c:6764
msgid "multiple declarations `%T' and `%T'"
msgstr ""
-#: cp/decl.c:6735
+#: cp/decl.c:6733
msgid "ISO C++ does not support `long long'"
msgstr ""
-#: cp/decl.c:6839 cp/decl.c:6842
+#: cp/decl.c:6837 cp/decl.c:6840
#, c-format
msgid "ISO C++ forbids declaration of `%s' with no type"
msgstr ""
-#: cp/decl.c:6873
+#: cp/decl.c:6871
#, c-format
msgid "short, signed or unsigned invalid for `%s'"
msgstr ""
-#: cp/decl.c:6878
+#: cp/decl.c:6876
#, c-format
msgid "long and short specified together for `%s'"
msgstr ""
-#: cp/decl.c:6889
+#: cp/decl.c:6887
#, c-format
msgid "signed and unsigned given together for `%s'"
msgstr ""
-#: cp/decl.c:6998
+#: cp/decl.c:6996
msgid "qualifiers are not allowed on declaration of `operator %T'"
msgstr ""
-#: cp/decl.c:7020
+#: cp/decl.c:7018
msgid "member `%D' cannot be declared both virtual and static"
msgstr ""
-#: cp/decl.c:7029
+#: cp/decl.c:7027
msgid "`%T::%D' is not a valid declarator"
msgstr ""
-#: cp/decl.c:7041
+#: cp/decl.c:7039
msgid "storage class specifiers invalid in parameter declarations"
msgstr ""
-#: cp/decl.c:7045
+#: cp/decl.c:7043
msgid "typedef declaration invalid in parameter declaration"
msgstr ""
-#: cp/decl.c:7058
+#: cp/decl.c:7056
msgid "virtual outside class declaration"
msgstr ""
-#: cp/decl.c:7117
+#: cp/decl.c:7115
#, c-format
msgid "storage class specified for %s `%s'"
msgstr ""
-#: cp/decl.c:7152
+#: cp/decl.c:7150
#, c-format
msgid "top-level declaration of `%s' specifies `auto'"
msgstr ""
-#: cp/decl.c:7164
+#: cp/decl.c:7162
msgid "storage class specifiers invalid in friend function declarations"
msgstr ""
-#: cp/decl.c:7329
+#: cp/decl.c:7327
msgid "destructor cannot be static member function"
msgstr ""
-#: cp/decl.c:7332
+#: cp/decl.c:7330
#, c-format
msgid "destructors may not be `%s'"
msgstr ""
-#: cp/decl.c:7353
+#: cp/decl.c:7351
msgid "constructor cannot be static member function"
msgstr ""
-#: cp/decl.c:7356
+#: cp/decl.c:7354
msgid "constructors cannot be declared virtual"
msgstr ""
-#: cp/decl.c:7361
+#: cp/decl.c:7359
#, c-format
msgid "constructors may not be `%s'"
msgstr ""
-#: cp/decl.c:7371
+#: cp/decl.c:7369
msgid "return value type specifier for constructor ignored"
msgstr ""
-#: cp/decl.c:7390
+#: cp/decl.c:7388
#, c-format
msgid "can't initialize friend function `%s'"
msgstr ""
#. Cannot be both friend and virtual.
-#: cp/decl.c:7394
+#: cp/decl.c:7392
msgid "virtual functions cannot be friends"
msgstr ""
-#: cp/decl.c:7399
+#: cp/decl.c:7397
msgid "friend declaration not in class definition"
msgstr ""
-#: cp/decl.c:7401
+#: cp/decl.c:7399
#, c-format
msgid "can't define friend function `%s' in a local class definition"
msgstr ""
-#: cp/decl.c:7422
+#: cp/decl.c:7420
msgid "destructors may not have parameters"
msgstr ""
-#: cp/decl.c:7442 cp/decl.c:7449
+#: cp/decl.c:7440 cp/decl.c:7447
msgid "cannot declare reference to `%#T'"
msgstr ""
-#: cp/decl.c:7443
+#: cp/decl.c:7441
msgid "cannot declare pointer to `%#T'"
msgstr ""
-#: cp/decl.c:7448
+#: cp/decl.c:7446
msgid "cannot declare pointer to `%#T' member"
msgstr ""
-#: cp/decl.c:7586
+#: cp/decl.c:7584
msgid "extra qualification `%T::' on member `%s' ignored"
msgstr ""
-#: cp/decl.c:7598
+#: cp/decl.c:7596
msgid "cannot declare member function `%T::%s' within `%T'"
msgstr ""
-#: cp/decl.c:7613
+#: cp/decl.c:7611
msgid "cannot declare member `%T::%s' within `%T'"
msgstr ""
-#: cp/decl.c:7693
+#: cp/decl.c:7691
msgid "data member may not have variably modified type `%T'"
msgstr ""
-#: cp/decl.c:7695
+#: cp/decl.c:7693
msgid "parameter may not have variably modified type `%T'"
msgstr ""
#. [dcl.fct.spec] The explicit specifier shall only be used in
#. declarations of constructors within a class definition.
-#: cp/decl.c:7703
+#: cp/decl.c:7701
msgid "only declarations of constructors can be `explicit'"
msgstr ""
-#: cp/decl.c:7711
+#: cp/decl.c:7709
#, c-format
msgid "non-member `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:7716
+#: cp/decl.c:7714
#, c-format
msgid "non-object member `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:7722
+#: cp/decl.c:7720
#, c-format
msgid "function `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:7727
+#: cp/decl.c:7725
#, c-format
msgid "static `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:7732
+#: cp/decl.c:7730
#, c-format
msgid "const `%s' cannot be declared `mutable'"
msgstr ""
-#: cp/decl.c:7745
+#: cp/decl.c:7743
msgid "template-id `%D' used as a declarator"
msgstr ""
-#: cp/decl.c:7766
+#: cp/decl.c:7764
msgid "ISO C++ forbids nested type `%D' with same name as enclosing class"
msgstr ""
-#: cp/decl.c:7774
+#: cp/decl.c:7772
msgid "%Jtypedef name may not be a nested-name-specifier"
msgstr ""
-#: cp/decl.c:7820
+#: cp/decl.c:7818
msgid "%Jinvalid type qualifier for non-member function type"
msgstr ""
-#: cp/decl.c:7884
+#: cp/decl.c:7882
msgid "type qualifiers specified for friend class declaration"
msgstr ""
-#: cp/decl.c:7889
+#: cp/decl.c:7887
msgid "`inline' specified for friend class declaration"
msgstr ""
-#: cp/decl.c:7897
+#: cp/decl.c:7895
msgid "template parameters cannot be friends"
msgstr ""
-#: cp/decl.c:7899
+#: cp/decl.c:7897
msgid "friend declaration requires class-key, i.e. `friend class %T::%D'"
msgstr ""
-#: cp/decl.c:7903
+#: cp/decl.c:7901
msgid "friend declaration requires class-key, i.e. `friend %#T'"
msgstr ""
-#: cp/decl.c:7916
+#: cp/decl.c:7914
msgid "trying to make class `%T' a friend of global scope"
msgstr ""
-#: cp/decl.c:7927
+#: cp/decl.c:7925
msgid "invalid qualifiers on non-member function type"
msgstr ""
-#: cp/decl.c:7946
+#: cp/decl.c:7944
msgid "abstract declarator `%T' used as declaration"
msgstr ""
-#: cp/decl.c:7958
+#: cp/decl.c:7956
msgid "unnamed variable or field declared void"
msgstr ""
-#: cp/decl.c:7967
+#: cp/decl.c:7965
msgid "variable or field declared void"
msgstr ""
-#: cp/decl.c:7977
+#: cp/decl.c:7975
msgid "cannot use `::' in parameter declaration"
msgstr ""
#. Something like struct S { int N::j; };
-#: cp/decl.c:8022
+#: cp/decl.c:8020
msgid "invalid use of `::'"
msgstr ""
-#: cp/decl.c:8034
+#: cp/decl.c:8032
msgid "function `%D' cannot be declared friend"
msgstr ""
-#: cp/decl.c:8046
+#: cp/decl.c:8044
msgid "can't make `%D' into a method -- not in a class"
msgstr ""
-#: cp/decl.c:8055
+#: cp/decl.c:8053
msgid "function `%D' declared virtual inside a union"
msgstr ""
-#: cp/decl.c:8067
+#: cp/decl.c:8065
msgid "`%D' cannot be declared virtual, since it is always static"
msgstr ""
-#: cp/decl.c:8144
+#: cp/decl.c:8142
msgid "field `%D' has incomplete type"
msgstr ""
-#: cp/decl.c:8146
+#: cp/decl.c:8144
msgid "name `%T' has incomplete type"
msgstr ""
-#: cp/decl.c:8155
+#: cp/decl.c:8153
msgid " in instantiation of template `%T'"
msgstr ""
-#: cp/decl.c:8165
+#: cp/decl.c:8163
#, c-format
msgid "`%s' is neither function nor member function; cannot be declared friend"
msgstr ""
-#: cp/decl.c:8176
+#: cp/decl.c:8174
msgid "member functions are implicitly friends of their class"
msgstr ""
@@ -14425,102 +14452,102 @@ msgstr ""
#. the rest of the compiler does not correctly
#. handle the initialization unless the member is
#. static so we make it static below.
-#: cp/decl.c:8217
+#: cp/decl.c:8215
msgid "ISO C++ forbids initialization of member `%D'"
msgstr ""
-#: cp/decl.c:8219
+#: cp/decl.c:8217
msgid "making `%D' static"
msgstr ""
-#: cp/decl.c:8242
+#: cp/decl.c:8240
msgid ""
"ISO C++ forbids static data member `%D' with same name as enclosing class"
msgstr ""
-#: cp/decl.c:8282
+#: cp/decl.c:8280
#, c-format
msgid "storage class `auto' invalid for function `%s'"
msgstr ""
-#: cp/decl.c:8284
+#: cp/decl.c:8282
#, c-format
msgid "storage class `register' invalid for function `%s'"
msgstr ""
-#: cp/decl.c:8286
+#: cp/decl.c:8284
#, c-format
msgid "storage class `__thread' invalid for function `%s'"
msgstr ""
-#: cp/decl.c:8297
+#: cp/decl.c:8295
#, c-format
msgid ""
"storage class `static' invalid for function `%s' declared out of global scope"
msgstr ""
-#: cp/decl.c:8299
+#: cp/decl.c:8297
#, c-format
msgid ""
"storage class `inline' invalid for function `%s' declared out of global scope"
msgstr ""
-#: cp/decl.c:8306
+#: cp/decl.c:8304
#, c-format
msgid "virtual non-class function `%s'"
msgstr ""
-#: cp/decl.c:8336
+#: cp/decl.c:8334
msgid "cannot declare member function `%D' to have static linkage"
msgstr ""
#. FIXME need arm citation
-#: cp/decl.c:8342
+#: cp/decl.c:8340
msgid "cannot declare static function inside another function"
msgstr ""
-#: cp/decl.c:8370
+#: cp/decl.c:8368
msgid ""
"`static' may not be used when defining (as opposed to declaring) a static "
"data member"
msgstr ""
-#: cp/decl.c:8376
+#: cp/decl.c:8374
msgid "static member `%D' declared `register'"
msgstr ""
-#: cp/decl.c:8381
+#: cp/decl.c:8379
msgid "cannot explicitly declare member `%#D' to have extern linkage"
msgstr ""
-#: cp/decl.c:8523
+#: cp/decl.c:8521
msgid "default argument for `%#D' has type `%T'"
msgstr ""
-#: cp/decl.c:8526
+#: cp/decl.c:8524
msgid "default argument for parameter of type `%T' has type `%T'"
msgstr ""
-#: cp/decl.c:8543
+#: cp/decl.c:8541
msgid "default argument `%E' uses local variable `%D'"
msgstr ""
-#: cp/decl.c:8587
+#: cp/decl.c:8585
#, c-format
msgid "invalid string constant `%E'"
msgstr ""
-#: cp/decl.c:8589
+#: cp/decl.c:8587
msgid ""
"invalid integer constant in parameter list, did you forget to give parameter "
"name?"
msgstr ""
-#: cp/decl.c:8627
+#: cp/decl.c:8625
msgid "parameter `%D' invalidly declared method type"
msgstr ""
-#: cp/decl.c:8651
+#: cp/decl.c:8649
msgid "parameter `%D' includes %s to array of unknown bound `%T'"
msgstr ""
@@ -14539,94 +14566,94 @@ msgstr ""
#. or implicitly defined), there's no need to worry about their
#. existence. Theoretically, they should never even be
#. instantiated, but that's hard to forestall.
-#: cp/decl.c:8810
+#: cp/decl.c:8808
msgid "invalid constructor; you probably meant `%T (const %T&)'"
msgstr ""
-#: cp/decl.c:8950
+#: cp/decl.c:8948
msgid "`%D' must be a nonstatic member function"
msgstr ""
-#: cp/decl.c:8956
+#: cp/decl.c:8954
msgid ""
"`%D' must be either a non-static member function or a non-member function"
msgstr ""
-#: cp/decl.c:8973
+#: cp/decl.c:8971
msgid "`%D' must have an argument of class or enumerated type"
msgstr ""
-#: cp/decl.c:9008
+#: cp/decl.c:9006
#, c-format
msgid "conversion to %s%s will never use a type conversion operator"
msgstr ""
#. 13.4.0.3
-#: cp/decl.c:9015
+#: cp/decl.c:9013
msgid "ISO C++ prohibits overloading operator ?:"
msgstr ""
-#: cp/decl.c:9065
+#: cp/decl.c:9063
msgid "postfix `%D' must take `int' as its argument"
msgstr ""
-#: cp/decl.c:9069
+#: cp/decl.c:9067
msgid "postfix `%D' must take `int' as its second argument"
msgstr ""
-#: cp/decl.c:9076
+#: cp/decl.c:9074
msgid "`%D' must take either zero or one argument"
msgstr ""
-#: cp/decl.c:9078
+#: cp/decl.c:9076
msgid "`%D' must take either one or two arguments"
msgstr ""
-#: cp/decl.c:9099
+#: cp/decl.c:9097
msgid "prefix `%D' should return `%T'"
msgstr ""
-#: cp/decl.c:9105
+#: cp/decl.c:9103
msgid "postfix `%D' should return `%T'"
msgstr ""
-#: cp/decl.c:9114
+#: cp/decl.c:9112
msgid "`%D' must take `void'"
msgstr ""
-#: cp/decl.c:9116 cp/decl.c:9124
+#: cp/decl.c:9114 cp/decl.c:9122
msgid "`%D' must take exactly one argument"
msgstr ""
-#: cp/decl.c:9126
+#: cp/decl.c:9124
msgid "`%D' must take exactly two arguments"
msgstr ""
-#: cp/decl.c:9134
+#: cp/decl.c:9132
msgid "user-defined `%D' always evaluates both arguments"
msgstr ""
-#: cp/decl.c:9148
+#: cp/decl.c:9146
msgid "`%D' should return by value"
msgstr ""
-#: cp/decl.c:9160 cp/decl.c:9163
+#: cp/decl.c:9158 cp/decl.c:9161
msgid "`%D' cannot have default arguments"
msgstr ""
-#: cp/decl.c:9223
+#: cp/decl.c:9221
msgid "using typedef-name `%D' after `%s'"
msgstr ""
-#: cp/decl.c:9229
+#: cp/decl.c:9227
msgid "using template type parameter `%T' after `%s'"
msgstr ""
-#: cp/decl.c:9237
+#: cp/decl.c:9235
msgid "`%T' referred to as `%s'"
msgstr ""
-#: cp/decl.c:9243
+#: cp/decl.c:9241
msgid "`%T' referred to as enum"
msgstr ""
@@ -14637,35 +14664,35 @@ msgstr ""
#. void f(class C); // No template header here
#.
#. then the required template argument is missing.
-#: cp/decl.c:9258
+#: cp/decl.c:9256
msgid "template argument required for `%s %T'"
msgstr ""
-#: cp/decl.c:9404
+#: cp/decl.c:9402
msgid "use of enum `%#D' without previous declaration"
msgstr ""
-#: cp/decl.c:9481
+#: cp/decl.c:9479
msgid "derived union `%T' invalid"
msgstr ""
-#: cp/decl.c:9534
+#: cp/decl.c:9532
msgid "base type `%T' fails to be a struct or class type"
msgstr ""
-#: cp/decl.c:9542
+#: cp/decl.c:9540
msgid "recursive type `%T' undefined"
msgstr ""
-#: cp/decl.c:9544
+#: cp/decl.c:9542
msgid "duplicate base type `%T' invalid"
msgstr ""
-#: cp/decl.c:9656
+#: cp/decl.c:9654
msgid "multiple definition of `%#T'"
msgstr ""
-#: cp/decl.c:9657
+#: cp/decl.c:9655
msgid "%Jprevious definition here"
msgstr ""
@@ -14673,47 +14700,47 @@ msgstr ""
#.
#. IF no integral type can represent all the enumerator values, the
#. enumeration is ill-formed.
-#: cp/decl.c:9792
+#: cp/decl.c:9790
msgid "no integral type can represent all of the enumerator values for `%T'"
msgstr ""
-#: cp/decl.c:9882
+#: cp/decl.c:9880
msgid "enumerator value for `%D' not integer constant"
msgstr ""
-#: cp/decl.c:9902
+#: cp/decl.c:9900
msgid "overflow in enumeration values at `%D'"
msgstr ""
-#: cp/decl.c:9971
+#: cp/decl.c:9969
msgid "return type `%#T' is incomplete"
msgstr ""
-#: cp/decl.c:10091
+#: cp/decl.c:10089
msgid "return type for `main' changed to `int'"
msgstr ""
-#: cp/decl.c:10121
+#: cp/decl.c:10119
msgid "`%D' implicitly declared before its definition"
msgstr ""
-#: cp/decl.c:10143 cp/typeck.c:5968
+#: cp/decl.c:10141 cp/typeck.c:5968
msgid "`operator=' should return a reference to `*this'"
msgstr ""
-#: cp/decl.c:10404
+#: cp/decl.c:10414
msgid "parameter `%D' declared void"
msgstr ""
-#: cp/decl.c:10869
+#: cp/decl.c:10879
msgid "invalid member function declaration"
msgstr ""
-#: cp/decl.c:10886
+#: cp/decl.c:10896
msgid "`%D' is already defined in class `%T'"
msgstr ""
-#: cp/decl.c:11099
+#: cp/decl.c:11109
msgid "static member function `%#D' declared with type qualifiers"
msgstr ""
@@ -14775,7 +14802,7 @@ msgstr ""
msgid "invalid use of `virtual' in template declaration of `%#D'"
msgstr ""
-#: cp/decl2.c:579 cp/pt.c:2694
+#: cp/decl2.c:579 cp/pt.c:2696
msgid "template declaration of `%#D'"
msgstr ""
@@ -14929,61 +14956,57 @@ msgstr ""
msgid "`...' handler must be the last handler for its try block"
msgstr ""
-#: cp/friend.c:162
+#: cp/friend.c:161
msgid "`%D' is already a friend of class `%T'"
msgstr ""
-#: cp/friend.c:164
-msgid "previous friend declaration of `%D'"
-msgstr ""
-
-#: cp/friend.c:216
+#: cp/friend.c:212
msgid "invalid type `%T' declared `friend'"
msgstr ""
#. [temp.friend]
#. Friend declarations shall not declare partial
#. specializations.
-#: cp/friend.c:232
+#: cp/friend.c:228
msgid "partial specialization `%T' declared `friend'"
msgstr ""
-#: cp/friend.c:242
+#: cp/friend.c:238
msgid "class `%T' is implicitly friends with itself"
msgstr ""
#. template <class T> friend typename S<T>::X;
-#: cp/friend.c:260
+#: cp/friend.c:256
msgid "typename type `%#T' declared `friend'"
msgstr ""
#. template <class T> friend class T;
-#: cp/friend.c:266
+#: cp/friend.c:262
msgid "template parameter type `%T' declared `friend'"
msgstr ""
#. template <class T> friend class A; where A is not a template
-#: cp/friend.c:272
+#: cp/friend.c:268
msgid "`%#T' is not a template"
msgstr ""
-#: cp/friend.c:291
+#: cp/friend.c:287
msgid "`%D' is already a friend of `%T'"
msgstr ""
-#: cp/friend.c:301
+#: cp/friend.c:297
msgid "`%T' is already a friend of `%T'"
msgstr ""
-#: cp/friend.c:398
+#: cp/friend.c:394
msgid "member `%D' declared as friend before type `%T' defined"
msgstr ""
-#: cp/friend.c:453
+#: cp/friend.c:449
msgid "friend declaration `%#D' declares a non-template function"
msgstr ""
-#: cp/friend.c:456
+#: cp/friend.c:452
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-"
@@ -15166,27 +15189,27 @@ msgstr ""
msgid "call to Java constructor with `%s' undefined"
msgstr ""
-#: cp/init.c:2143
+#: cp/init.c:2161
msgid "ISO C++ forbids initialization in array new"
msgstr ""
-#: cp/init.c:2167
+#: cp/init.c:2185
msgid "ISO C++ forbids aggregate initializer to new"
msgstr ""
-#: cp/init.c:2610
+#: cp/init.c:2628
msgid "initializer ends prematurely"
msgstr ""
-#: cp/init.c:2667
+#: cp/init.c:2685
msgid "cannot initialize multi-dimensional array with initializer"
msgstr ""
-#: cp/init.c:2840
+#: cp/init.c:2858
msgid "unknown array size in delete"
msgstr ""
-#: cp/init.c:3104
+#: cp/init.c:3122
msgid "type to vector delete is neither pointer or array type"
msgstr ""
@@ -15269,24 +15292,24 @@ msgstr ""
msgid "the mangled name of `%D' will change in a future version of GCC"
msgstr ""
-#: cp/method.c:449
+#: cp/method.c:450
msgid "generic thunk code fails for method `%#D' which uses `...'"
msgstr ""
-#: cp/method.c:672
+#: cp/method.c:673
msgid "non-static const member `%#D', can't use default assignment operator"
msgstr ""
-#: cp/method.c:677
+#: cp/method.c:678
msgid ""
"non-static reference member `%#D', can't use default assignment operator"
msgstr ""
-#: cp/name-lookup.c:643
+#: cp/name-lookup.c:646
msgid "`%#D' used prior to declaration"
msgstr ""
-#: cp/name-lookup.c:674
+#: cp/name-lookup.c:677
msgid "redeclaration of `wchar_t' as `%T'"
msgstr ""
@@ -15296,212 +15319,220 @@ msgstr ""
#. [basic.start.main]
#.
#. This function shall not be overloaded.
-#: cp/name-lookup.c:702
+#: cp/name-lookup.c:709
msgid "invalid redeclaration of `%D'"
msgstr ""
-#: cp/name-lookup.c:703
+#: cp/name-lookup.c:710
msgid "as `%D'"
msgstr ""
-#: cp/name-lookup.c:790
+#: cp/name-lookup.c:798
msgid "type mismatch with previous external decl of `%#D'"
msgstr ""
-#: cp/name-lookup.c:791
+#: cp/name-lookup.c:799
msgid "previous external decl of `%#D'"
msgstr ""
-#: cp/name-lookup.c:833
+#: cp/name-lookup.c:841
msgid "`%D' was previously implicitly declared to return `int'"
msgstr ""
-#: cp/name-lookup.c:891
+#: cp/name-lookup.c:899
msgid "extern declaration of `%#D' doesn't match"
msgstr ""
-#: cp/name-lookup.c:892
+#: cp/name-lookup.c:900
msgid "global declaration `%#D'"
msgstr ""
-#: cp/name-lookup.c:928
+#: cp/name-lookup.c:936
msgid "declaration of `%#D' shadows a parameter"
msgstr ""
-#: cp/name-lookup.c:949
+#: cp/name-lookup.c:957
#, c-format
msgid "declaration of `%s' shadows a member of `this'"
msgstr ""
-#: cp/name-lookup.c:1125
+#: cp/name-lookup.c:1133
msgid "name lookup of `%D' changed"
msgstr ""
-#: cp/name-lookup.c:1127
+#: cp/name-lookup.c:1135
msgid " matches this `%D' under ISO standard rules"
msgstr ""
-#: cp/name-lookup.c:1129
+#: cp/name-lookup.c:1137
msgid " matches this `%D' under old rules"
msgstr ""
-#: cp/name-lookup.c:1143 cp/name-lookup.c:1150
+#: cp/name-lookup.c:1151 cp/name-lookup.c:1158
msgid "name lookup of `%D' changed for new ISO `for' scoping"
msgstr ""
-#: cp/name-lookup.c:1145
+#: cp/name-lookup.c:1153
msgid " cannot use obsolete binding at `%D' because it has a destructor"
msgstr ""
-#: cp/name-lookup.c:1152
+#: cp/name-lookup.c:1160
msgid " using obsolete binding at `%D'"
msgstr ""
-#: cp/name-lookup.c:1205
+#: cp/name-lookup.c:1213
#, c-format
msgid "%s %s(%E) %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1208
+#: cp/name-lookup.c:1216
#, c-format
msgid "%s %s %p %d\n"
msgstr ""
-#: cp/name-lookup.c:1327
+#: cp/name-lookup.c:1335
msgid "XXX is_class_level != (current_scope == class_scope)\n"
msgstr ""
-#: cp/name-lookup.c:1964
+#: cp/name-lookup.c:1972
msgid "`%#D' hides constructor for `%#T'"
msgstr ""
-#: cp/name-lookup.c:1979
+#: cp/name-lookup.c:1987
msgid "`%#D' conflicts with previous using declaration `%#D'"
msgstr ""
-#: cp/name-lookup.c:1991
+#: cp/name-lookup.c:1999
msgid "previous non-function declaration `%#D'"
msgstr ""
-#: cp/name-lookup.c:1992
+#: cp/name-lookup.c:2000
msgid "conflicts with function declaration `%#D'"
msgstr ""
#. 7.3.3/5
#. A using-declaration shall not name a template-id.
-#: cp/name-lookup.c:2069
+#: cp/name-lookup.c:2077
msgid "a using-declaration cannot specify a template-id. Try `using %D'"
msgstr ""
-#: cp/name-lookup.c:2075
+#: cp/name-lookup.c:2083
msgid "namespace `%D' not allowed in using-declaration"
msgstr ""
#. It's a nested name with template parameter dependent scope.
#. This can only be using-declaration for class member.
-#: cp/name-lookup.c:2083 cp/name-lookup.c:2105 cp/name-lookup.c:3275
+#: cp/name-lookup.c:2091 cp/name-lookup.c:2113 cp/name-lookup.c:3283
msgid "`%T' is not a namespace"
msgstr ""
-#: cp/name-lookup.c:2129
+#: cp/name-lookup.c:2137
msgid "`%D' not declared"
msgstr ""
#. If the OLD_FN was really declared, the
#. declarations don't match.
-#: cp/name-lookup.c:2141 cp/name-lookup.c:2183 cp/name-lookup.c:2208
+#: cp/name-lookup.c:2149 cp/name-lookup.c:2191 cp/name-lookup.c:2216
msgid "`%D' is already declared in this scope"
msgstr ""
-#: cp/name-lookup.c:2214
+#: cp/name-lookup.c:2222
msgid "using declaration `%D' introduced ambiguous type `%T'"
msgstr ""
#. Definition isn't the kind we were looking for.
-#: cp/name-lookup.c:2374 cp/name-lookup.c:2393
+#: cp/name-lookup.c:2382 cp/name-lookup.c:2401
msgid "`%#D' redeclared as %C"
msgstr ""
-#: cp/name-lookup.c:2803
+#: cp/name-lookup.c:2811
msgid "using-declaration for non-member at class scope"
msgstr ""
-#: cp/name-lookup.c:2810
+#: cp/name-lookup.c:2818
msgid "using-declaration cannot name destructor"
msgstr ""
-#: cp/name-lookup.c:2906
+#: cp/name-lookup.c:2914
msgid "declaration of `%D' not in a namespace surrounding `%D'"
msgstr ""
-#: cp/name-lookup.c:2946
+#: cp/name-lookup.c:2954
msgid "`%D' should have been declared inside `%D'"
msgstr ""
-#: cp/name-lookup.c:3009
+#: cp/name-lookup.c:3017
msgid "namespace alias `%D' not allowed here, assuming `%D'"
msgstr ""
#. The parser did not find it, so it's not there.
-#: cp/name-lookup.c:3118
+#: cp/name-lookup.c:3126
msgid "unknown namespace `%D'"
msgstr ""
-#: cp/name-lookup.c:3269
+#: cp/name-lookup.c:3277
msgid "namespace `%T' undeclared"
msgstr ""
-#: cp/name-lookup.c:3415
+#: cp/name-lookup.c:3310
+msgid "strong using only meaningful at namespace scope"
+msgstr ""
+
+#: cp/name-lookup.c:3317
+msgid "`%D' attribute directive ignored"
+msgstr ""
+
+#: cp/name-lookup.c:3450
msgid "use of `%D' is ambiguous"
msgstr ""
-#: cp/name-lookup.c:3416
+#: cp/name-lookup.c:3451
msgid " first declared as `%#D' here"
msgstr ""
-#: cp/name-lookup.c:3419
+#: cp/name-lookup.c:3454
msgid " also declared as `%#D' here"
msgstr ""
-#: cp/name-lookup.c:3434
+#: cp/name-lookup.c:3469
msgid "`%D' denotes an ambiguous type"
msgstr ""
-#: cp/name-lookup.c:3435
+#: cp/name-lookup.c:3470
msgid "%J first type here"
msgstr ""
-#: cp/name-lookup.c:3436
+#: cp/name-lookup.c:3471
msgid "%J other type here"
msgstr ""
#. This happens for A::B where B is a template, and there are no
#. template arguments.
-#: cp/name-lookup.c:3501 cp/typeck.c:1742
+#: cp/name-lookup.c:3536 cp/typeck.c:1742
msgid "invalid use of `%D'"
msgstr ""
-#: cp/name-lookup.c:3542
+#: cp/name-lookup.c:3577
msgid "`%D::%D' is not a template"
msgstr ""
-#: cp/name-lookup.c:3559
+#: cp/name-lookup.c:3594
msgid "`%D' undeclared in namespace `%D'"
msgstr ""
-#: cp/name-lookup.c:4002
+#: cp/name-lookup.c:4037
msgid "`%D' is not a function,"
msgstr ""
-#: cp/name-lookup.c:4003
+#: cp/name-lookup.c:4038
msgid " conflict with `%D'"
msgstr ""
-#: cp/name-lookup.c:4704
+#: cp/name-lookup.c:4773
msgid "XXX entering pop_everything ()\n"
msgstr ""
-#: cp/name-lookup.c:4713
+#: cp/name-lookup.c:4782
msgid "XXX leaving pop_everything ()\n"
msgstr ""
@@ -15509,178 +15540,187 @@ msgstr ""
msgid "invalid token"
msgstr ""
-#: cp/parser.c:1790
+#: cp/parser.c:1800
msgid "new types may not be defined in a return type"
msgstr ""
-#: cp/parser.c:1799
+#: cp/parser.c:1809
#, c-format
msgid "%s cannot appear in a constant-expression"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:1826
+#: cp/parser.c:1836
#, c-format
msgid "`%s' does not name a type"
msgstr ""
-#: cp/parser.c:1857
+#: cp/parser.c:1867
msgid "(perhaps `typename %T::%s' was intended)"
msgstr ""
-#: cp/parser.c:2261
+#: cp/parser.c:2277
msgid "ISO C++ forbids braced-groups within expressions"
msgstr ""
-#: cp/parser.c:2270
+#: cp/parser.c:2286
msgid "statement-expressions are allowed only inside functions"
msgstr ""
-#: cp/parser.c:2321
+#: cp/parser.c:2337
msgid "`this' may not be used in this context"
msgstr ""
-#: cp/parser.c:2448
+#: cp/parser.c:2464
msgid "local variable `%D' may not appear in this context"
msgstr ""
-#: cp/parser.c:2804
+#: cp/parser.c:2820
msgid "typedef-name `%D' used as destructor declarator"
msgstr ""
-#: cp/parser.c:2997
+#: cp/parser.c:3013
msgid "`%T::%D' is not a class-name or namespace-name"
msgstr ""
-#: cp/parser.c:3001
+#: cp/parser.c:3017
msgid "`::%D' is not a class-name or namespace-name"
msgstr ""
-#: cp/parser.c:3005
+#: cp/parser.c:3021
msgid "`%D::%D' is not a class-name or namespace-name"
msgstr ""
-#: cp/parser.c:3010
+#: cp/parser.c:3026
msgid "`%D' is not a class-name or namespace-name"
msgstr ""
-#: cp/parser.c:3438
+#: cp/parser.c:3454
msgid "ISO C++ forbids compound-literals"
msgstr ""
-#: cp/parser.c:4352
+#: cp/parser.c:4368
msgid "expression in new-declarator must have integral or enumeration type"
msgstr ""
-#: cp/parser.c:4524
+#: cp/parser.c:4540
msgid "use of old-style cast"
msgstr ""
-#: cp/parser.c:5762
+#: cp/parser.c:5271
+#, c-format
+msgid "case label `%E' not within a switch statement"
+msgstr ""
+
+#: cp/parser.c:5811
msgid "ISO C++ forbids computed gotos"
msgstr ""
-#: cp/parser.c:5882
+#: cp/parser.c:5931
msgid "extra `;'"
msgstr ""
-#: cp/parser.c:6177
+#: cp/parser.c:6226
msgid "mixing declarations and function-definitions is forbidden"
msgstr ""
-#: cp/parser.c:6311
+#: cp/parser.c:6360
msgid "duplicate `friend'"
msgstr ""
-#: cp/parser.c:6769
+#: cp/parser.c:6818
msgid "only constructors take base initializers"
msgstr ""
-#: cp/parser.c:6820
+#: cp/parser.c:6869
msgid "anachronistic old-style base class initializer"
msgstr ""
#. Warn that we do not support `export'.
-#: cp/parser.c:7210
+#: cp/parser.c:7259
msgid "keyword `export' not implemented, and will be ignored"
msgstr ""
-#: cp/parser.c:8493
+#: cp/parser.c:8411 cp/pt.c:3993
+msgid "`%T' is not a template"
+msgstr ""
+
+#: cp/parser.c:8528
msgid "using `typename' outside of template"
msgstr ""
-#: cp/parser.c:8609
+#: cp/parser.c:8644
msgid "expected type-name"
msgstr ""
-#: cp/parser.c:8760
+#: cp/parser.c:8795
msgid "comma at end of enumerator list"
msgstr ""
#. [namespace.udecl]
#.
#. A using declaration shall not name a template-id.
-#: cp/parser.c:9036
+#: cp/parser.c:9071
msgid "a template-id may not appear in a using-declaration"
msgstr ""
-#: cp/parser.c:9055
+#: cp/parser.c:9090
msgid "`%D::%D' has not been declared"
msgstr ""
-#: cp/parser.c:9058 cp/semantics.c:2282
+#: cp/parser.c:9093 cp/semantics.c:2291
msgid "`::%D' has not been declared"
msgstr ""
-#: cp/parser.c:9352
+#: cp/parser.c:9390
msgid "an asm-specification is not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:9354
+#: cp/parser.c:9392
msgid "attributes are not allowed on a function-definition"
msgstr ""
-#: cp/parser.c:9469
+#: cp/parser.c:9507
msgid "attributes after parenthesized initializer ignored"
msgstr ""
-#: cp/parser.c:10587
+#: cp/parser.c:10625
msgid "file ends in default argument"
msgstr ""
-#: cp/parser.c:10643
+#: cp/parser.c:10681
msgid "deprecated use of default argument for parameter of non-function"
msgstr ""
-#: cp/parser.c:10646
+#: cp/parser.c:10684
msgid "default arguments are only permitted for function parameters"
msgstr ""
-#: cp/parser.c:11575
+#: cp/parser.c:11613
msgid "declaration of `%D' in `%D' which does not enclose `%D'"
msgstr ""
-#: cp/parser.c:11587
+#: cp/parser.c:11625
msgid "extra qualification ignored"
msgstr ""
-#: cp/parser.c:11807
+#: cp/parser.c:11845
msgid "extra semicolon"
msgstr ""
-#: cp/parser.c:11825
+#: cp/parser.c:11863
msgid "a class-key must be used when declaring a friend"
msgstr ""
-#: cp/parser.c:11856
+#: cp/parser.c:11894
msgid "friend declaration does not name a class or function"
msgstr ""
-#: cp/parser.c:13080
+#: cp/parser.c:13118
msgid "reference to `%D' is ambiguous"
msgstr ""
-#: cp/parser.c:13252
+#: cp/parser.c:13290
msgid "too few template-parameter-lists"
msgstr ""
@@ -15688,35 +15728,35 @@ msgstr ""
#. something like:
#.
#. template <class T> template <class U> void S::f();
-#: cp/parser.c:13267
+#: cp/parser.c:13305
msgid "too many template-parameter-lists"
msgstr ""
#. If begin_function_definition didn't like the definition, skip
#. the entire function.
-#: cp/parser.c:13542
+#: cp/parser.c:13580
msgid "invalid function declaration"
msgstr ""
#. Issue an error message.
-#: cp/parser.c:13579
+#: cp/parser.c:13617
msgid "named return values are no longer supported"
msgstr ""
-#: cp/parser.c:14129
+#: cp/parser.c:14212
#, c-format
msgid "expected %s"
msgstr ""
-#: cp/parser.c:14275
+#: cp/parser.c:14358
msgid "`%s' tag used in naming `%#T'"
msgstr ""
-#: cp/parser.c:14295
+#: cp/parser.c:14378
msgid "%D redeclared with different access"
msgstr ""
-#: cp/parser.c:14312
+#: cp/parser.c:14395
msgid "`template' (as a disambiguator) is only allowed within templates"
msgstr ""
@@ -15736,81 +15776,81 @@ msgstr ""
msgid "enclosing class templates are not explicitly specialized"
msgstr ""
-#: cp/pt.c:737 cp/pt.c:778
+#: cp/pt.c:739 cp/pt.c:780
msgid "specializing `%#T' in different namespace"
msgstr ""
-#: cp/pt.c:738 cp/pt.c:779
+#: cp/pt.c:740 cp/pt.c:781
msgid " from definition of `%#D'"
msgstr ""
-#: cp/pt.c:746
+#: cp/pt.c:748
msgid "specialization of `%T' after instantiation"
msgstr ""
-#: cp/pt.c:793
+#: cp/pt.c:795
msgid "specialization `%T' after instantiation `%T'"
msgstr ""
-#: cp/pt.c:805
+#: cp/pt.c:807
msgid "explicit specialization of non-template `%T'"
msgstr ""
-#: cp/pt.c:931
+#: cp/pt.c:933
msgid "specialization of %D after instantiation"
msgstr ""
-#: cp/pt.c:1056
+#: cp/pt.c:1058
msgid "%s %+#D"
msgstr ""
-#: cp/pt.c:1105
+#: cp/pt.c:1107
msgid "`%D' is not a function template"
msgstr ""
-#: cp/pt.c:1244
+#: cp/pt.c:1246
msgid "template-id `%D' for `%+D' does not match any template declaration"
msgstr ""
-#: cp/pt.c:1252
+#: cp/pt.c:1254
msgid "ambiguous template specialization `%D' for `%+D'"
msgstr ""
#. This case handles bogus declarations like template <>
#. template <class T> void f<int>();
-#: cp/pt.c:1475 cp/pt.c:1549
+#: cp/pt.c:1477 cp/pt.c:1551
msgid "template-id `%D' in declaration of primary template"
msgstr ""
-#: cp/pt.c:1488
+#: cp/pt.c:1490
msgid "template parameter list used in explicit instantiation"
msgstr ""
-#: cp/pt.c:1494
+#: cp/pt.c:1496
msgid "definition provided for explicit instantiation"
msgstr ""
-#: cp/pt.c:1500
+#: cp/pt.c:1502
msgid "too many template parameter lists in declaration of `%D'"
msgstr ""
-#: cp/pt.c:1516
+#: cp/pt.c:1518
msgid "too few template parameter lists in declaration of `%D'"
msgstr ""
-#: cp/pt.c:1533
+#: cp/pt.c:1535
msgid "explicit specialization not preceded by `template <>'"
msgstr ""
-#: cp/pt.c:1546
+#: cp/pt.c:1548
msgid "partial specialization `%D' of function template"
msgstr ""
-#: cp/pt.c:1578
+#: cp/pt.c:1580
msgid "default argument specified in explicit specialization"
msgstr ""
-#: cp/pt.c:1582
+#: cp/pt.c:1584
msgid "template specialization with C linkage"
msgstr ""
@@ -15822,106 +15862,106 @@ msgstr ""
#. program is ill-formed.
#.
#. Similar language is found in [temp.explicit].
-#: cp/pt.c:1666
+#: cp/pt.c:1668
msgid "specialization of implicitly-declared special member function"
msgstr ""
-#: cp/pt.c:1710
+#: cp/pt.c:1712
msgid "no member function `%D' declared in `%T'"
msgstr ""
#. There are two many template parameter lists.
-#: cp/pt.c:1865
+#: cp/pt.c:1867
msgid "too many template parameter lists in declaration of `%T'"
msgstr ""
-#: cp/pt.c:1958
+#: cp/pt.c:1960
msgid " shadows template parm `%#D'"
msgstr ""
-#: cp/pt.c:2355
+#: cp/pt.c:2357
msgid "template parameters not used in partial specialization:"
msgstr ""
-#: cp/pt.c:2359
+#: cp/pt.c:2361
msgid " `%D'"
msgstr ""
-#: cp/pt.c:2371
+#: cp/pt.c:2373
msgid "partial specialization `%T' does not specialize any template arguments"
msgstr ""
-#: cp/pt.c:2396
+#: cp/pt.c:2398
#, c-format
msgid "template argument `%E' involves template parameter(s)"
msgstr ""
-#: cp/pt.c:2440
+#: cp/pt.c:2442
msgid "type `%T' of template argument `%E' depends on template parameter(s)"
msgstr ""
-#: cp/pt.c:2525
+#: cp/pt.c:2527
msgid "no default argument for `%D'"
msgstr ""
-#: cp/pt.c:2674
+#: cp/pt.c:2676
msgid "template with C linkage"
msgstr ""
-#: cp/pt.c:2677
+#: cp/pt.c:2679
msgid "template class without a name"
msgstr ""
#. [temp.mem]
#.
#. A destructor shall not be a member template.
-#: cp/pt.c:2684
+#: cp/pt.c:2686
msgid "destructor `%D' declared as member template"
msgstr ""
-#: cp/pt.c:2764
+#: cp/pt.c:2766
msgid "`%D' does not declare a template type"
msgstr ""
-#: cp/pt.c:2770
+#: cp/pt.c:2772
msgid "template definition of non-template `%#D'"
msgstr ""
-#: cp/pt.c:2811
+#: cp/pt.c:2813
msgid "expected %d levels of template parms for `%#D', got %d"
msgstr ""
-#: cp/pt.c:2823
+#: cp/pt.c:2825
msgid "got %d template parameters for `%#D'"
msgstr ""
-#: cp/pt.c:2826
+#: cp/pt.c:2828
msgid "got %d template parameters for `%#T'"
msgstr ""
-#: cp/pt.c:2828
+#: cp/pt.c:2830
#, c-format
msgid " but %d required"
msgstr ""
-#: cp/pt.c:2908
+#: cp/pt.c:2910
msgid "`%T' is not a template type"
msgstr ""
-#: cp/pt.c:2924
+#: cp/pt.c:2926
msgid "previous declaration `%D'"
msgstr ""
-#: cp/pt.c:2925
+#: cp/pt.c:2927
#, c-format
msgid "used %d template parameter%s instead of %d"
msgstr ""
-#: cp/pt.c:2941
+#: cp/pt.c:2943
msgid "template parameter `%#D'"
msgstr ""
-#: cp/pt.c:2942
+#: cp/pt.c:2944
msgid "redeclared here as `%#D'"
msgstr ""
@@ -15929,279 +15969,275 @@ msgstr ""
#.
#. A template-parameter may not be given default arguments
#. by two different declarations in the same scope.
-#: cp/pt.c:2952
+#: cp/pt.c:2954
msgid "redefinition of default argument for `%#D'"
msgstr ""
-#: cp/pt.c:2953
+#: cp/pt.c:2955
msgid "%J original definition appeared here"
msgstr ""
-#: cp/pt.c:3042
+#: cp/pt.c:3044
#, c-format
msgid "`%E' is not a valid template argument"
msgstr ""
-#: cp/pt.c:3046
+#: cp/pt.c:3048
msgid "it must be the address of a function with external linkage"
msgstr ""
-#: cp/pt.c:3048
+#: cp/pt.c:3050
msgid "it must be the address of an object with external linkage"
msgstr ""
-#: cp/pt.c:3051
+#: cp/pt.c:3053
msgid "it must be a pointer-to-member of the form `&X::Y'"
msgstr ""
-#: cp/pt.c:3062
+#: cp/pt.c:3064
#, c-format
msgid ""
"string literal %E is not a valid template argument because it is the address "
"of an object with static linkage"
msgstr ""
-#: cp/pt.c:3077
+#: cp/pt.c:3079
#, c-format
msgid "address of non-extern `%E' cannot be used as template argument"
msgstr ""
-#: cp/pt.c:3086
+#: cp/pt.c:3088
#, c-format
msgid "non-constant `%E' cannot be used as template argument"
msgstr ""
-#: cp/pt.c:3094
+#: cp/pt.c:3096
msgid "type '%T' cannot be used as a value for a non-type template-parameter"
msgstr ""
-#: cp/pt.c:3097
+#: cp/pt.c:3099
msgid "invalid use of '%D' as a non-type template-argument"
msgstr ""
-#: cp/pt.c:3099
+#: cp/pt.c:3101
#, c-format
msgid "invalid use of '%E' as a non-type template-argument"
msgstr ""
-#: cp/pt.c:3463
+#: cp/pt.c:3465
#, c-format
msgid "to refer to a type member of a template parameter, use `typename %E'"
msgstr ""
-#: cp/pt.c:3476 cp/pt.c:3494 cp/pt.c:3533
+#: cp/pt.c:3478 cp/pt.c:3496 cp/pt.c:3535
msgid "type/value mismatch at argument %d in template parameter list for `%D'"
msgstr ""
-#: cp/pt.c:3479
+#: cp/pt.c:3481
msgid " expected a constant of type `%T', got `%T'"
msgstr ""
-#: cp/pt.c:3483
+#: cp/pt.c:3485
#, c-format
msgid " expected a class template, got `%E'"
msgstr ""
-#: cp/pt.c:3485
+#: cp/pt.c:3487
#, c-format
msgid " expected a type, got `%E'"
msgstr ""
-#: cp/pt.c:3497
+#: cp/pt.c:3499
msgid " expected a type, got `%T'"
msgstr ""
-#: cp/pt.c:3499
+#: cp/pt.c:3501
msgid " expected a class template, got `%T'"
msgstr ""
-#: cp/pt.c:3535
+#: cp/pt.c:3537
msgid " expected a template of type `%D', got `%D'"
msgstr ""
-#: cp/pt.c:3570
+#: cp/pt.c:3572
msgid "could not convert template argument `%E' to `%T'"
msgstr ""
-#: cp/pt.c:3610
+#: cp/pt.c:3612
#, c-format
msgid "wrong number of template arguments (%d, should be %d)"
msgstr ""
-#: cp/pt.c:3614
+#: cp/pt.c:3616
msgid "provided for `%D'"
msgstr ""
-#: cp/pt.c:3642
+#: cp/pt.c:3644
#, c-format
msgid "template argument %d is invalid"
msgstr ""
-#: cp/pt.c:3863
+#: cp/pt.c:3865
msgid "non-template used as template"
msgstr ""
-#: cp/pt.c:3991
-msgid "`%T' is not a template"
-msgstr ""
-
-#: cp/pt.c:4003
+#: cp/pt.c:4005
msgid "non-template type `%T' used as a template"
msgstr ""
-#: cp/pt.c:4005
+#: cp/pt.c:4007
msgid "for template declaration `%D'"
msgstr ""
-#: cp/pt.c:4634
+#: cp/pt.c:4636
msgid ""
"template instantiation depth exceeds maximum of %d (use -ftemplate-depth-NN "
"to increase the maximum) instantiating `%D'"
msgstr ""
-#: cp/pt.c:5071
+#: cp/pt.c:5073
msgid "ambiguous class template instantiation for `%#T'"
msgstr ""
-#: cp/pt.c:5077
+#: cp/pt.c:5079
msgid "%s %+#T"
msgstr ""
-#: cp/pt.c:6088 cp/pt.c:6208
+#: cp/pt.c:6090 cp/pt.c:6210
msgid "instantiation of `%D' as type `%T'"
msgstr ""
-#: cp/pt.c:6250
+#: cp/pt.c:6252
msgid "invalid parameter type `%T'"
msgstr ""
-#: cp/pt.c:6252
+#: cp/pt.c:6254
msgid "in declaration `%D'"
msgstr ""
-#: cp/pt.c:6326
+#: cp/pt.c:6328
msgid "creating pointer to member function of non-class type `%T'"
msgstr ""
-#: cp/pt.c:6482
+#: cp/pt.c:6484
msgid "creating array with size zero"
msgstr ""
-#: cp/pt.c:6496
+#: cp/pt.c:6498
#, c-format
msgid "creating array with size zero (`%E')"
msgstr ""
-#: cp/pt.c:6735
+#: cp/pt.c:6737
msgid "forming reference to void"
msgstr ""
-#: cp/pt.c:6737
+#: cp/pt.c:6739
msgid "forming %s to reference type `%T'"
msgstr ""
-#: cp/pt.c:6774
+#: cp/pt.c:6776
msgid "creating pointer to member of non-class type `%T'"
msgstr ""
-#: cp/pt.c:6780
+#: cp/pt.c:6782
msgid "creating pointer to member reference type `%T'"
msgstr ""
-#: cp/pt.c:6865
+#: cp/pt.c:6867
msgid "creating array of `%T'"
msgstr ""
-#: cp/pt.c:6908
+#: cp/pt.c:6910
msgid "`%T' is not a class, struct, or union type"
msgstr ""
-#: cp/pt.c:7021
+#: cp/pt.c:7023
#, c-format
msgid "use of `%s' in template"
msgstr ""
-#: cp/pt.c:7132
+#: cp/pt.c:7134
#, c-format
msgid "`%E' names a type, but a non-type is expected"
msgstr ""
-#: cp/pt.c:8391
+#: cp/pt.c:8393
msgid "`%T' uses anonymous type"
msgstr ""
-#: cp/pt.c:8393
+#: cp/pt.c:8395
msgid "`%T' uses local type `%T'"
msgstr ""
-#: cp/pt.c:8401
+#: cp/pt.c:8403
msgid "`%T' is a variably modified type"
msgstr ""
-#: cp/pt.c:8412
+#: cp/pt.c:8414
#, c-format
msgid "integral expression `%E' is not constant"
msgstr ""
-#: cp/pt.c:8417
+#: cp/pt.c:8419
msgid " trying to instantiate `%D'"
msgstr ""
-#: cp/pt.c:8936
+#: cp/pt.c:8938
msgid "incomplete type unification"
msgstr ""
-#: cp/pt.c:9861
+#: cp/pt.c:9885
#, c-format
msgid "use of `%s' in template type unification"
msgstr ""
-#: cp/pt.c:10289 cp/pt.c:10361
+#: cp/pt.c:10313 cp/pt.c:10385
msgid "explicit instantiation of non-template `%#D'"
msgstr ""
-#: cp/pt.c:10305 cp/pt.c:10356
+#: cp/pt.c:10329 cp/pt.c:10380
msgid "no matching template for `%D' found"
msgstr ""
-#: cp/pt.c:10311
+#: cp/pt.c:10335
msgid "explicit instantiation of `%#D'"
msgstr ""
-#: cp/pt.c:10348
+#: cp/pt.c:10372
msgid "duplicate explicit instantiation of `%#D'"
msgstr ""
-#: cp/pt.c:10373
+#: cp/pt.c:10397
msgid "ISO C++ forbids the use of `extern' on explicit instantiations"
msgstr ""
-#: cp/pt.c:10377 cp/pt.c:10463
+#: cp/pt.c:10401 cp/pt.c:10487
msgid "storage class `%D' applied to template instantiation"
msgstr ""
-#: cp/pt.c:10430
+#: cp/pt.c:10454
msgid "explicit instantiation of non-template type `%T'"
msgstr ""
-#: cp/pt.c:10444
+#: cp/pt.c:10468
msgid "explicit instantiation of `%#T' before definition of template"
msgstr ""
-#: cp/pt.c:10452
+#: cp/pt.c:10476
#, c-format
msgid "ISO C++ forbids the use of `%s' on explicit instantiations"
msgstr ""
-#: cp/pt.c:10496
+#: cp/pt.c:10520
msgid "duplicate explicit instantiation of `%#T'"
msgstr ""
-#: cp/pt.c:10898
+#: cp/pt.c:10922
msgid "explicit instantiation of `%D' but no definition available"
msgstr ""
-#: cp/pt.c:11316
+#: cp/pt.c:11342
msgid "`%#T' is not a valid type for a template constant parameter"
msgstr ""
@@ -16301,105 +16337,105 @@ msgstr ""
msgid "object missing in reference to `%D'"
msgstr ""
-#: cp/semantics.c:1697
+#: cp/semantics.c:1706
msgid "arguments to destructor are not allowed"
msgstr ""
-#: cp/semantics.c:1745
+#: cp/semantics.c:1754
msgid "`this' is unavailable for static member functions"
msgstr ""
-#: cp/semantics.c:1751
+#: cp/semantics.c:1760
msgid "invalid use of `this' in non-member function"
msgstr ""
-#: cp/semantics.c:1753
+#: cp/semantics.c:1762
msgid "invalid use of `this' at top level"
msgstr ""
-#: cp/semantics.c:1780
+#: cp/semantics.c:1789
msgid "calling type `%T' like a method"
msgstr ""
-#: cp/semantics.c:1813
+#: cp/semantics.c:1822
msgid "invalid qualifying scope in pseudo-destructor name"
msgstr ""
-#: cp/semantics.c:1819
+#: cp/semantics.c:1828
msgid "`%E' is not of type `%T'"
msgstr ""
-#: cp/semantics.c:1930
+#: cp/semantics.c:1939
msgid "template type parameters must use the keyword `class' or `typename'"
msgstr ""
-#: cp/semantics.c:1967
+#: cp/semantics.c:1976
msgid "invalid default template argument"
msgstr ""
-#: cp/semantics.c:2002
+#: cp/semantics.c:2011
msgid "definition of `%#T' inside template parameter list"
msgstr ""
-#: cp/semantics.c:2013
+#: cp/semantics.c:2022
msgid "invalid definition of qualified type `%T'"
msgstr ""
-#: cp/semantics.c:2028
+#: cp/semantics.c:2037
msgid "previous definition of `%#T'"
msgstr ""
-#: cp/semantics.c:2223
+#: cp/semantics.c:2232
msgid "invalid base-class specification"
msgstr ""
-#: cp/semantics.c:2232
+#: cp/semantics.c:2241
msgid "base class `%T' has cv qualifiers"
msgstr ""
-#: cp/semantics.c:2264
+#: cp/semantics.c:2273
msgid "multiple declarators in template declaration"
msgstr ""
-#: cp/semantics.c:2275
+#: cp/semantics.c:2284
msgid "incomplete type `%T' used in nested name specifier"
msgstr ""
-#: cp/semantics.c:2277 cp/typeck.c:1585
+#: cp/semantics.c:2286 cp/typeck.c:1585
msgid "`%D' is not a member of `%T'"
msgstr ""
-#: cp/semantics.c:2280
+#: cp/semantics.c:2289
msgid "`%D' is not a member of `%D'"
msgstr ""
-#: cp/semantics.c:2530
+#: cp/semantics.c:2539
msgid "`%D' cannot appear in a constant-expression"
msgstr ""
-#: cp/semantics.c:2539
+#: cp/semantics.c:2548
msgid "use of namespace `%D' as expression"
msgstr ""
-#: cp/semantics.c:2544
+#: cp/semantics.c:2553
msgid "use of class template `%T' as expression"
msgstr ""
#. Ambiguous reference to base members.
-#: cp/semantics.c:2550
+#: cp/semantics.c:2559
msgid "request for member `%D' is ambiguous in multiple inheritance lattice"
msgstr ""
-#: cp/semantics.c:2610
+#: cp/semantics.c:2619
#, c-format
msgid "use of %s from containing function"
msgstr ""
-#: cp/semantics.c:2613
+#: cp/semantics.c:2622
msgid " `%#D' declared here"
msgstr ""
-#: cp/semantics.c:2664
+#: cp/semantics.c:2673
#, c-format
msgid "type of `%E' is unknown"
msgstr ""
@@ -16409,50 +16445,50 @@ msgstr ""
msgid "non-lvalue in %s"
msgstr ""
-#: cp/tree.c:526
+#: cp/tree.c:528
msgid "`%V' qualifiers cannot be applied to `%T'"
msgstr ""
-#: cp/tree.c:1816
+#: cp/tree.c:1818
#, c-format
msgid "`%s' attribute can only be applied to Java class definitions"
msgstr ""
-#: cp/tree.c:1845
+#: cp/tree.c:1847
#, c-format
msgid "`%s' attribute can only be applied to class definitions"
msgstr ""
-#: cp/tree.c:1851
+#: cp/tree.c:1853
#, c-format
msgid "`%s' is obsolete; g++ vtables are now COM-compatible by default"
msgstr ""
-#: cp/tree.c:1875
+#: cp/tree.c:1877
msgid "requested init_priority is not an integer constant"
msgstr ""
-#: cp/tree.c:1896
+#: cp/tree.c:1898
#, c-format
msgid ""
"can only use `%s' attribute on file-scope definitions of objects of class "
"type"
msgstr ""
-#: cp/tree.c:1904
+#: cp/tree.c:1906
msgid "requested init_priority is out of range"
msgstr ""
-#: cp/tree.c:1914
+#: cp/tree.c:1916
msgid "requested init_priority is reserved for internal use"
msgstr ""
-#: cp/tree.c:1924
+#: cp/tree.c:1926
#, c-format
msgid "`%s' attribute is not supported on this platform"
msgstr ""
-#: cp/tree.c:2450
+#: cp/tree.c:2452
#, c-format
msgid "lang_* check: failed in %s, at %s:%d"
msgstr ""
@@ -17106,7 +17142,7 @@ msgid "call to function which throws incomplete type `%#T'"
msgstr ""
#. XXX Not i18n clean.
-#: cp/cp-tree.h:3747
+#: cp/cp-tree.h:3752
#, c-format
msgid "%s is deprecated, please see the documentation for details"
msgstr ""
@@ -17140,61 +17176,61 @@ msgstr ""
msgid "ASSIGN'ed label cannot fit into `%A' at %0 -- using wider sibling"
msgstr ""
-#: f/com.c:11561
+#: f/com.c:11563
msgid "no INTEGER type can hold a pointer on this configuration"
msgstr ""
-#: f/com.c:11835
+#: f/com.c:11837
#, c-format
msgid "configuration: REAL, INTEGER, and LOGICAL are %d bits wide,"
msgstr ""
-#: f/com.c:11837
+#: f/com.c:11839
#, c-format
msgid "and pointers are %d bits wide, but g77 doesn't yet work"
msgstr ""
-#: f/com.c:11839
+#: f/com.c:11841
msgid "properly unless they all are 32 bits wide"
msgstr ""
-#: f/com.c:11840
+#: f/com.c:11842
msgid "Please keep this in mind before you report bugs."
msgstr ""
#. I/O will probably crash.
-#: f/com.c:11848
+#: f/com.c:11850
#, c-format
msgid "configuration: char * holds %d bits, but ftnlen only %d"
msgstr ""
#. ASSIGN 10 TO I will crash.
-#: f/com.c:11857
+#: f/com.c:11859
#, c-format
msgid ""
"configuration: char * holds %d bits, but INTEGER only %d --\n"
" ASSIGN statement might fail"
msgstr ""
-#: f/com.c:13673
+#: f/com.c:13675
msgid "In statement function"
msgstr ""
-#: f/com.c:13683
+#: f/com.c:13685
msgid "Outside of any program unit:\n"
msgstr ""
-#: f/com.c:15279
+#: f/com.c:15281
#, no-c-format
msgid "%A from %B at %0%C"
msgstr ""
-#: f/com.c:15589
+#: f/com.c:15591
#, no-c-format
msgid "At %0, INCLUDE file %A exists, but is not readable"
msgstr ""
-#: f/com.c:15624
+#: f/com.c:15626
#, no-c-format
msgid "At %0, INCLUDE nesting too deep"
msgstr ""
@@ -18427,129 +18463,129 @@ msgstr ""
msgid "%Jnon-static method '%D' overrides static method"
msgstr ""
-#: java/decl.c:1061
+#: java/decl.c:1058
msgid "%J'%D' used prior to declaration"
msgstr ""
-#: java/decl.c:1102
+#: java/decl.c:1099
#, c-format
msgid "declaration of `%s' shadows a parameter"
msgstr ""
-#: java/decl.c:1105
+#: java/decl.c:1102
#, c-format
msgid "declaration of `%s' shadows a symbol from the parameter list"
msgstr ""
-#: java/decl.c:1397
+#: java/decl.c:1401
msgid "%Jlabel '%D' used but not defined"
msgstr ""
-#: java/decl.c:1402
+#: java/decl.c:1406
msgid "%Jlabel '%D' defined but not used"
msgstr ""
-#: java/decl.c:1530
+#: java/decl.c:1534
msgid "%JIn %D: overlapped variable and exception ranges at %d"
msgstr ""
-#: java/decl.c:1608
+#: java/decl.c:1612
msgid "bad type in parameter debug info"
msgstr ""
-#: java/decl.c:1617
+#: java/decl.c:1621
msgid "%Jbad PC range for debug info for local '%D'"
msgstr ""
-#: java/expr.c:518
+#: java/expr.c:519
msgid "stack underflow - dup* operation"
msgstr ""
-#: java/expr.c:1468
+#: java/expr.c:1469
#, c-format
msgid ""
"reference `%s' is ambiguous: appears in interface `%s' and interface `%s'"
msgstr ""
-#: java/expr.c:1496
+#: java/expr.c:1497
#, c-format
msgid "field `%s' not found"
msgstr ""
-#: java/expr.c:1654
+#: java/expr.c:1655
msgid "ret instruction not implemented"
msgstr ""
-#: java/expr.c:1809
+#: java/expr.c:1810
#, c-format
msgid "method '%s' not found in class"
msgstr ""
-#: java/expr.c:2009
+#: java/expr.c:2010
#, c-format
msgid "failed to find class '%s'"
msgstr ""
-#: java/expr.c:2019
+#: java/expr.c:2020
#, c-format
msgid "class '%s' has no method named '%s' matching signature '%s'"
msgstr ""
-#: java/expr.c:2029
+#: java/expr.c:2030
msgid "invokestatic on non static method"
msgstr ""
-#: java/expr.c:2034
+#: java/expr.c:2035
msgid "invokestatic on abstract method"
msgstr ""
-#: java/expr.c:2042
+#: java/expr.c:2043
msgid "invoke[non-static] on static method"
msgstr ""
-#: java/expr.c:2341
+#: java/expr.c:2342
#, c-format
msgid "missing field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2347
+#: java/expr.c:2348
#, c-format
msgid "mismatching signature for field '%s' in '%s'"
msgstr ""
-#: java/expr.c:2369
+#: java/expr.c:2370
msgid "%Jassignment to final field '%D' not in field's class"
msgstr ""
-#: java/expr.c:2374
+#: java/expr.c:2375
msgid "%Jassignment to final static field `%D' not in class initializer"
msgstr ""
-#: java/expr.c:2382
+#: java/expr.c:2383
msgid "%Jassignment to final field '%D' not in constructor"
msgstr ""
-#: java/expr.c:2624
+#: java/expr.c:2625
#, c-format
msgid "can't expand %s"
msgstr ""
-#: java/expr.c:2796
+#: java/expr.c:2797
msgid "invalid PC in line number table"
msgstr ""
-#: java/expr.c:2842
+#: java/expr.c:2843
#, c-format
msgid "unreachable bytecode from %d to before %d"
msgstr ""
-#: java/expr.c:2880
+#: java/expr.c:2881
#, c-format
msgid "unreachable bytecode from %d to the end of the method"
msgstr ""
#. duplicate code from LOAD macro
-#: java/expr.c:3194
+#: java/expr.c:3195
msgid "unrecogized wide sub-instruction"
msgstr ""
@@ -18646,7 +18682,7 @@ msgstr ""
msgid "bad zip/jar file %s"
msgstr ""
-#: java/jcf-parse.c:1256
+#: java/jcf-parse.c:1255
#, c-format
msgid "error while reading %s from zip file"
msgstr ""
@@ -18753,16 +18789,12 @@ msgstr ""
msgid "bad pc in exception_table"
msgstr ""
-#: java/verify.c:477
-msgid "exception handler inside code that is being protected"
-msgstr ""
-
-#: java/verify.c:1387
+#: java/verify.c:1384
#, c-format
msgid "unknown opcode %d@pc=%d during verification"
msgstr ""
-#: java/verify.c:1457 java/verify.c:1470 java/verify.c:1474
+#: java/verify.c:1454 java/verify.c:1467 java/verify.c:1471
#, c-format
msgid "verification error at PC=%d"
msgstr ""
@@ -19325,1412 +19357,1412 @@ msgstr ""
msgid "Warn about \"extern\" declarations not at file scope"
msgstr ""
-#: options.c:261
+#: options.c:258
msgid ""
"Warn when non-templatized friend functions are declared within a template"
msgstr ""
-#: options.c:264
+#: options.c:261
msgid "Warn about non-virtual destructors"
msgstr ""
-#: options.c:270
+#: options.c:267
msgid "Warn if a C-style cast is used in a program"
msgstr ""
-#: options.c:273
+#: options.c:270
msgid "Warn if an old-style parameter definition is used"
msgstr ""
-#: options.c:276
+#: options.c:273
msgid "Warn if .class files are out of date"
msgstr ""
-#: options.c:279
+#: options.c:276
msgid "Warn about overloaded virtual function names"
msgstr ""
-#: options.c:282
+#: options.c:279
msgid "Warn when the packed attribute has no effect on struct layout"
msgstr ""
-#: options.c:285
+#: options.c:282
msgid "Warn when padding is required to align structure members"
msgstr ""
-#: options.c:288
+#: options.c:285
msgid "Warn about possibly missing parentheses"
msgstr ""
-#: options.c:291
+#: options.c:288
msgid "Warn when converting the type of pointers to member functions"
msgstr ""
-#: options.c:294
+#: options.c:291
msgid "Warn about function pointer arithmetic"
msgstr ""
-#: options.c:297
+#: options.c:294
msgid "Warn if inherited methods are unimplemented"
msgstr ""
-#: options.c:300
+#: options.c:297
msgid "Warn about multiple declarations of the same object"
msgstr ""
-#: options.c:303
+#: options.c:300
msgid "Warn if modifiers are specified when not necessary"
msgstr ""
-#: options.c:306
+#: options.c:303
msgid "Warn when the compiler reorders code"
msgstr ""
-#: options.c:309
+#: options.c:306
msgid ""
"Warn whenever a function's return type defaults to \"int\" (C), or about "
"inconsistent return types (C++)"
msgstr ""
-#: options.c:312
+#: options.c:309
msgid "Warn if a selector has multiple methods"
msgstr ""
-#: options.c:315
+#: options.c:312
msgid "Warn about possible violations of sequence point rules"
msgstr ""
-#: options.c:318
+#: options.c:315
msgid "Warn when one local variable shadows another"
msgstr ""
-#: options.c:321
+#: options.c:318
msgid "Warn about signed-unsigned comparisons"
msgstr ""
-#: options.c:324
+#: options.c:321
msgid "Warn when overload promotes from unsigned to signed"
msgstr ""
-#: options.c:327
+#: options.c:324
msgid "Warn about code which might break strict aliasing rules"
msgstr ""
-#: options.c:330
+#: options.c:327
msgid "Warn about unprototyped function declarations"
msgstr ""
-#: options.c:333
+#: options.c:330
msgid "Warn about constructs with surprising meanings"
msgstr ""
-#: options.c:336
+#: options.c:333
msgid "Warn about enumerated switches, with no default, missing a case"
msgstr ""
-#: options.c:339
+#: options.c:336
msgid "Warn about enumerated switches missing a \"default:\" statement"
msgstr ""
-#: options.c:342
+#: options.c:339
msgid "Warn about all enumerated switches missing a specific case"
msgstr ""
-#: options.c:345
+#: options.c:342
msgid "Warn when synthesis behavior differs from Cfront"
msgstr ""
-#: options.c:348
+#: options.c:345
msgid "Do not suppress warnings from system headers"
msgstr ""
-#: options.c:351
+#: options.c:348
msgid "Warn about features not present in traditional C"
msgstr ""
-#: options.c:360
+#: options.c:357
msgid "Warn if an undefined macro is used in an #if directive"
msgstr ""
-#: options.c:363
+#: options.c:360
msgid "Warn about uninitialized automatic variables"
msgstr ""
-#: options.c:366
+#: options.c:363
msgid "Warn about unrecognized pragmas"
msgstr ""
-#: options.c:369
+#: options.c:366
msgid "Warn about code that will never be executed"
msgstr ""
-#: options.c:372
+#: options.c:369
msgid "Enable all -Wunused- warnings"
msgstr ""
-#: options.c:375
+#: options.c:372
msgid "Warn when a function is unused"
msgstr ""
-#: options.c:378
+#: options.c:375
msgid "Warn when a label is unused"
msgstr ""
-#: options.c:381
+#: options.c:378
msgid "Warn about macros defined in the main file that are not used"
msgstr ""
-#: options.c:384
+#: options.c:381
msgid "Warn when a function parameter is unused"
msgstr ""
-#: options.c:387
+#: options.c:384
msgid "Warn when an expression value is unused"
msgstr ""
-#: options.c:390
+#: options.c:387
msgid "Warn when a variable is unused"
msgstr ""
-#: options.c:393
+#: options.c:390
msgid "Give strings the type \"array of char\""
msgstr ""
-#: options.c:396
+#: options.c:393
msgid ""
"A synonym for -std=c89. In a future version of GCC it will become "
"synonymous with -std=c99 instead"
msgstr ""
-#: options.c:399
+#: options.c:396
msgid "-aux-info <file>\tEmit declaration information into <file>"
msgstr ""
-#: options.c:411
+#: options.c:408
msgid "-d<letters>\tEnable dumps from specific passes of the compiler"
msgstr ""
-#: options.c:414
+#: options.c:411
msgid "-dumpbase <file>\tSet the file basename to be used for dumps"
msgstr ""
-#: options.c:417
+#: options.c:414
msgid "--CLASSPATH\tDeprecated; use --classpath instead"
msgstr ""
-#: options.c:432
+#: options.c:429
msgid "Enforce class member access control semantics"
msgstr ""
-#: options.c:435
+#: options.c:432
msgid "Align the start of functions"
msgstr ""
-#: options.c:441
+#: options.c:438
msgid "Align labels which are only reached by jumping"
msgstr ""
-#: options.c:447
+#: options.c:444
msgid "Align all labels"
msgstr ""
-#: options.c:453
+#: options.c:450
msgid "Align the start of loops"
msgstr ""
-#: options.c:462
+#: options.c:459
msgid "Change when template instances are emitted"
msgstr ""
-#: options.c:465
+#: options.c:462
msgid "Specify that arguments may alias each other and globals"
msgstr ""
-#: options.c:468
+#: options.c:465
msgid "Assume arguments may alias globals but not each other"
msgstr ""
-#: options.c:471
+#: options.c:468
msgid "Assume arguments alias neither each other nor globals"
msgstr ""
-#: options.c:474
+#: options.c:471
msgid "Recognize the \"asm\" keyword"
msgstr ""
-#: options.c:486
+#: options.c:483
msgid "Generate unwind tables that are exact at each instruction boundary"
msgstr ""
-#: options.c:489
+#: options.c:486
msgid ""
"Do not treat local variables and COMMON blocks as if they were named in SAVE "
"statements"
msgstr ""
-#: options.c:492
+#: options.c:489
msgid ""
"Backslashes in character and hollerith constants are special (not C-style)"
msgstr ""
-#: options.c:495
+#: options.c:492
msgid "Delete libU77 intrinsics with bad interfaces"
msgstr ""
-#: options.c:498
+#: options.c:495
msgid "Disable libU77 intrinsics with bad interfaces"
msgstr ""
-#: options.c:501
+#: options.c:498
msgid "Enable libU77 intrinsics with bad interfaces"
msgstr ""
-#: options.c:504
+#: options.c:501
msgid "Hide libU77 intrinsics with bad interfaces"
msgstr ""
-#: options.c:507
+#: options.c:504
msgid "--bootclasspath=<path>\tReplace system path"
msgstr ""
-#: options.c:510
+#: options.c:507
msgid "Generate code to check bounds before indexing arrays"
msgstr ""
-#: options.c:513
+#: options.c:510
msgid "Replace add, compare, branch with branch on count register"
msgstr ""
-#: options.c:516
+#: options.c:513
msgid "Use profiling information for branch probabilities"
msgstr ""
-#: options.c:519
+#: options.c:516
msgid ""
"Perform branch target load optimization before prologue / epilogue threading"
msgstr ""
-#: options.c:522
+#: options.c:519
msgid ""
"Perform branch target load optimization after prologue / epilogue threading"
msgstr ""
-#: options.c:525
+#: options.c:522
msgid "Recognize built-in functions"
msgstr ""
-#: options.c:531
+#: options.c:528
msgid ""
"-fcall-saved-<register>\tMark <register> as being preserved across functions"
msgstr ""
-#: options.c:534
+#: options.c:531
msgid ""
"-fcall-used-<register>\tMark <register> as being corrupted by function calls"
msgstr ""
-#: options.c:537
+#: options.c:534
msgid "Save registers around function calls"
msgstr ""
-#: options.c:540
+#: options.c:537
msgid "Program written in strict mixed-case"
msgstr ""
-#: options.c:543
+#: options.c:540
msgid "Compile as if program written in lowercase"
msgstr ""
-#: options.c:546
+#: options.c:543
msgid "Preserve case used in program"
msgstr ""
-#: options.c:549
+#: options.c:546
msgid "Program written in lowercase"
msgstr ""
-#: options.c:552
+#: options.c:549
msgid "Program written in uppercase"
msgstr ""
-#: options.c:555
+#: options.c:552
msgid "Compile as if program written in uppercase"
msgstr ""
-#: options.c:558
+#: options.c:555
msgid "Check the return value of new"
msgstr ""
-#: options.c:564
+#: options.c:561
msgid "--classpath=<path>\tSet class path"
msgstr ""
-#: options.c:567
+#: options.c:564
msgid "Do not put uninitialized globals in the common section"
msgstr ""
-#: options.c:573
+#: options.c:570
msgid "Allow the arguments of the '?' operator to have different types"
msgstr ""
-#: options.c:576
+#: options.c:573
msgid "Reduce the size of object files"
msgstr ""
-#: options.c:579
+#: options.c:576
msgid "Make string literals \"const char[]\" not \"char[]\""
msgstr ""
-#: options.c:582
+#: options.c:579
msgid "-fconst-string-class=<name>\tUse class <name> for constant strings"
msgstr ""
-#: options.c:585
+#: options.c:582
msgid "Perform a register copy-propagation optimization pass"
msgstr ""
-#: options.c:588
+#: options.c:585
msgid "Perform cross-jumping optimization"
msgstr ""
-#: options.c:591
+#: options.c:588
msgid "When running CSE, follow jumps to their targets"
msgstr ""
-#: options.c:594
+#: options.c:591
msgid "When running CSE, follow conditional jumps"
msgstr ""
-#: options.c:597
+#: options.c:594
msgid "Place data items into their own section"
msgstr ""
-#: options.c:600
+#: options.c:597
msgid ""
"Emit special debugging information for COMMON and EQUIVALENCE (disabled)"
msgstr ""
-#: options.c:603
+#: options.c:600
msgid "Inline member functions by default"
msgstr ""
-#: options.c:606
+#: options.c:603
msgid "Defer popping functions args from stack until later"
msgstr ""
-#: options.c:609
+#: options.c:606
msgid "Attempt to fill delay slots of branch instructions"
msgstr ""
-#: options.c:612
+#: options.c:609
msgid "Delete useless null pointer checks"
msgstr ""
-#: options.c:615
+#: options.c:612
msgid ""
"-fdiagnostics-show-location=[once|every-line]\tHow often to emit source "
"location at the beginning of line-wrapped diagnostics"
msgstr ""
-#: options.c:618
+#: options.c:615
msgid "Allow '$' in symbol names"
msgstr ""
-#: options.c:621
+#: options.c:618
msgid "Permit '$' as an identifier character"
msgstr ""
-#: options.c:627
+#: options.c:624
msgid ""
"Suppress output of instruction numbers and line number notes in debugging "
"dumps"
msgstr ""
-#: options.c:633
+#: options.c:630
msgid "Perform DWARF2 duplicate elimination"
msgstr ""
+#: options.c:633
#: options.c:636
-#: options.c:639
msgid "Perform unused type elimination in debug info"
msgstr ""
-#: options.c:648
+#: options.c:645
msgid "Have front end emulate COMPLEX arithmetic to avoid bugs"
msgstr ""
-#: options.c:651
+#: options.c:648
msgid ""
"--encoding=<encoding>\tChoose input encoding (defaults from your locale)"
msgstr ""
-#: options.c:654
+#: options.c:651
msgid "Generate code to check exception specifications"
msgstr ""
-#: options.c:660
+#: options.c:657
msgid "Enable exception handling"
msgstr ""
-#: options.c:663
+#: options.c:660
msgid ""
"-fexec-charset=<cset>\tConvert all strings and character constants to "
"character set <cset>"
msgstr ""
-#: options.c:666
+#: options.c:663
msgid "Perform a number of minor, expensive optimizations"
msgstr ""
-#: options.c:675
+#: options.c:672
msgid "f2c-compatible code can be generated"
msgstr ""
-#: options.c:678
+#: options.c:675
msgid "Delete non-FORTRAN-77 intrinsics f2c supports"
msgstr ""
-#: options.c:681
+#: options.c:678
msgid "Disable non-FORTRAN-77 intrinsics f2c supports"
msgstr ""
-#: options.c:684
+#: options.c:681
msgid "Enable non-FORTRAN-77 intrinsics f2c supports"
msgstr ""
-#: options.c:687
+#: options.c:684
msgid "Hide non-FORTRAN-77 intrinsics f2c supports"
msgstr ""
-#: options.c:690
+#: options.c:687
msgid "Unsupported; generate libf2c-calling code"
msgstr ""
-#: options.c:693
+#: options.c:690
msgid "Program is written in typical FORTRAN 66 dialect"
msgstr ""
-#: options.c:696
+#: options.c:693
msgid "Program is written in typical Unix-f77 dialect"
msgstr ""
-#: options.c:699
+#: options.c:696
msgid "Program is written in Fortran-90-ish dialect"
msgstr ""
-#: options.c:702
+#: options.c:699
msgid "Delete non-FORTRAN-77 intrinsics F90 supports"
msgstr ""
-#: options.c:705
+#: options.c:702
msgid "Disable non-FORTRAN-77 intrinsics F90 supports"
msgstr ""
-#: options.c:708
+#: options.c:705
msgid "Enable non-FORTRAN-77 intrinsics F90 supports"
msgstr ""
-#: options.c:711
+#: options.c:708
msgid "Hide non-FORTRAN-77 intrinsics F90 supports"
msgstr ""
-#: options.c:723
+#: options.c:720
msgid "Assume no NaNs or infinities are generated"
msgstr ""
-#: options.c:726
+#: options.c:723
msgid ""
"-ffixed-<register>\tMark <register> as being unavailable to the compiler"
msgstr ""
-#: options.c:732
+#: options.c:729
msgid "ffixed-line-length-<number>\tSet the maximum line length to <number>"
msgstr ""
-#: options.c:735
+#: options.c:732
msgid "Unsupported; affects code generation of arrays"
msgstr ""
-#: options.c:738
+#: options.c:735
msgid "Do not store floats in registers"
msgstr ""
-#: options.c:741
+#: options.c:738
msgid "Scope of for-init-statement variables is local to the loop"
msgstr ""
-#: options.c:744
+#: options.c:741
msgid "Copy memory address constants into registers before use"
msgstr ""
-#: options.c:747
+#: options.c:744
msgid "Always check for non gcj generated classes archives"
msgstr ""
-#: options.c:750
+#: options.c:747
msgid "Copy memory operands into registers before use"
msgstr ""
-#: options.c:753
+#: options.c:750
msgid "Generate code to check subscript and substring bounds"
msgstr ""
-#: options.c:756
+#: options.c:753
msgid "Program is written in Fortran-90-ish free form"
msgstr ""
-#: options.c:759
+#: options.c:756
msgid "Do not assume that standard C libraries and \"main\" exist"
msgstr ""
-#: options.c:762
+#: options.c:759
msgid "Allow function addresses to be held in registers"
msgstr ""
-#: options.c:765
+#: options.c:762
msgid "Place each function into its own section"
msgstr ""
-#: options.c:768
+#: options.c:765
msgid "Perform global common subexpression elimination"
msgstr ""
-#: options.c:771
+#: options.c:768
msgid ""
"Perform redundant load after store elimination in global common "
"subexpression elimination"
msgstr ""
-#: options.c:774
+#: options.c:771
msgid ""
"Perform enhanced load motion during global common subexpression elimination"
msgstr ""
-#: options.c:777
+#: options.c:774
msgid "Perform store motion after global common subexpression elimination"
msgstr ""
-#: options.c:780
+#: options.c:777
msgid "Enable fatal diagnostics about inter-procedural problems"
msgstr ""
-#: options.c:783
+#: options.c:780
msgid "Delete non-FORTRAN-77 intrinsics g77 supports"
msgstr ""
-#: options.c:786
+#: options.c:783
msgid "Disable non-FORTRAN 77 intrinsics F90 supports"
msgstr ""
-#: options.c:789
+#: options.c:786
msgid "Enable non-FORTRAN 77 intrinsics F90 supports"
msgstr ""
-#: options.c:792
+#: options.c:789
msgid "Hide non-FORTRAN 77 intrinsics F90 supports"
msgstr ""
-#: options.c:795
+#: options.c:792
msgid "Recognize GNU-defined keywords"
msgstr ""
-#: options.c:798
+#: options.c:795
msgid "Output GNU ld formatted global initializers"
msgstr ""
-#: options.c:801
+#: options.c:798
msgid "Generate code for GNU runtime environment"
msgstr ""
-#: options.c:804
+#: options.c:801
msgid "Enable guessing of branch probabilities"
msgstr ""
-#: options.c:819
+#: options.c:816
msgid "Assume normal C execution environment"
msgstr ""
-#: options.c:822
+#: options.c:819
msgid "Enable support for huge objects"
msgstr ""
-#: options.c:825
+#: options.c:822
msgid "Process #ident directives"
msgstr ""
-#: options.c:828
+#: options.c:825
msgid "Perform conversion of conditional jumps to branchless equivalents"
msgstr ""
-#: options.c:831
+#: options.c:828
msgid "Perform conversion of conditional jumps to conditional execution"
msgstr ""
-#: options.c:834
+#: options.c:831
msgid "Export functions even if they can be inlined"
msgstr ""
-#: options.c:837
+#: options.c:834
msgid "Emit implicit instantiations of inline templates"
msgstr ""
-#: options.c:840
+#: options.c:837
msgid "Emit implicit instantiations of templates"
msgstr ""
-#: options.c:843
+#: options.c:840
msgid "Use offset tables for virtual method calls"
msgstr ""
-#: options.c:846
+#: options.c:843
msgid "Do not generate .size directives"
msgstr ""
-#: options.c:849
+#: options.c:846
msgid "Initialize local vars and arrays to zero"
msgstr ""
-#: options.c:852
+#: options.c:849
msgid "Pay attention to the \"inline\" keyword"
msgstr ""
-#: options.c:861
+#: options.c:858
msgid ""
"-finline-limit=<number>\tLimit the size of inlined functions to <number>"
msgstr ""
-#: options.c:864
+#: options.c:861
msgid "Instrument function entry and exit with profiling calls"
msgstr ""
-#: options.c:867
+#: options.c:864
msgid "Intrinsics letters in arbitrary cases"
msgstr ""
-#: options.c:870
+#: options.c:867
msgid "Intrinsics spelled as e.g. SqRt"
msgstr ""
-#: options.c:873
+#: options.c:870
msgid "Intrinsics in lowercase"
msgstr ""
-#: options.c:876
+#: options.c:873
msgid "Intrinsics in uppercase"
msgstr ""
-#: options.c:879
+#: options.c:876
msgid "Assume native functions are implemented using JNI"
msgstr ""
-#: options.c:882
+#: options.c:879
msgid "Generate code for functions even if they are fully inlined"
msgstr ""
-#: options.c:885
+#: options.c:882
msgid "Emit static const variables even if they are not used"
msgstr ""
-#: options.c:891
+#: options.c:888
msgid "Give external symbols a leading underscore"
msgstr ""
-#: options.c:894
+#: options.c:891
msgid "Perform loop optimizations"
msgstr ""
-#: options.c:897
+#: options.c:894
msgid "Language keyword letters in arbitrary cases"
msgstr ""
-#: options.c:900
+#: options.c:897
msgid "Language keywords spelled as e.g. IOStat"
msgstr ""
-#: options.c:903
+#: options.c:900
msgid "Language keywords in lowercase"
msgstr ""
-#: options.c:906
+#: options.c:903
msgid "Language keywords in uppercase"
msgstr ""
-#: options.c:909
+#: options.c:906
msgid "Set errno after built-in math functions"
msgstr ""
-#: options.c:912
+#: options.c:909
msgid "Report on permanent memory allocation"
msgstr ""
-#: options.c:915
+#: options.c:912
msgid "Attempt to merge identical constants and constant variables"
msgstr ""
-#: options.c:918
+#: options.c:915
msgid "Attempt to merge identical constants across compilation units"
msgstr ""
-#: options.c:921
+#: options.c:918
msgid ""
"-fmessage-length=<number>\tLimit diagnostics to <number> characters per "
"line. 0 suppresses line-wrapping"
msgstr ""
-#: options.c:924
+#: options.c:921
msgid "Delete MIL-STD 1753 intrinsics"
msgstr ""
-#: options.c:927
+#: options.c:924
msgid "Disable MIL-STD 1753 intrinsics"
msgstr ""
-#: options.c:930
+#: options.c:927
msgid "Enable MIL-STD 1753 intrinsics"
msgstr ""
-#: options.c:933
+#: options.c:930
msgid "Hide MIL-STD 1753 intrinsics"
msgstr ""
-#: options.c:936
+#: options.c:933
msgid "Force all loop invariant computations out of loops"
msgstr ""
-#: options.c:939
+#: options.c:936
msgid "Don't warn about uses of Microsoft extensions"
msgstr ""
-#: options.c:948
+#: options.c:945
msgid "Use graph-coloring register allocation"
msgstr ""
-#: options.c:951
+#: options.c:948
msgid "Generate code for NeXT (Apple Mac OS X) runtime environment"
msgstr ""
-#: options.c:954
+#: options.c:951
msgid "Assume that receivers of Objective-C messages may be nil"
msgstr ""
-#: options.c:957
+#: options.c:954
msgid "Support synchronous non-call exceptions"
msgstr ""
-#: options.c:966
+#: options.c:963
msgid "Enable Objective-C exception and synchronization syntax"
msgstr ""
-#: options.c:969
-#: options.c:1296
+#: options.c:966
+#: options.c:1293
msgid "Perform loop unrolling for all loops"
msgstr ""
-#: options.c:972
-#: options.c:1299
+#: options.c:969
+#: options.c:1296
msgid "Perform loop unrolling when iteration count is known"
msgstr ""
-#: options.c:975
+#: options.c:972
msgid "When possible do not generate stack frames"
msgstr ""
-#: options.c:978
+#: options.c:975
msgid "Take at least one trip through each iterative DO loop"
msgstr ""
-#: options.c:981
+#: options.c:978
msgid "Recognize C++ kewords like \"compl\" and \"xor\""
msgstr ""
-#: options.c:984
+#: options.c:981
msgid "Do the full register move optimization pass"
msgstr ""
-#: options.c:987
+#: options.c:984
msgid "Optimize sibling and tail recursive calls"
msgstr ""
-#: options.c:990
+#: options.c:987
msgid "Enable optimization of static class initialization code"
msgstr ""
-#: options.c:993
+#: options.c:990
msgid "Enable optional diagnostics"
msgstr ""
-#: options.c:999
+#: options.c:996
msgid "Pack structure members together without holes"
msgstr ""
-#: options.c:1002
+#: options.c:999
msgid "Return small aggregates in memory, not registers"
msgstr ""
-#: options.c:1008
+#: options.c:1005
msgid "Warn about use of (only a few for now) Fortran extensions"
msgstr ""
-#: options.c:1011
+#: options.c:1008
msgid "Perform loop peeling"
msgstr ""
-#: options.c:1014
+#: options.c:1011
msgid "Enable machine specific peephole optimizations"
msgstr ""
-#: options.c:1017
+#: options.c:1014
msgid "Enable an RTL peephole pass before sched2"
msgstr ""
-#: options.c:1020
+#: options.c:1017
msgid "Downgrade conformance errors to warnings"
msgstr ""
-#: options.c:1023
+#: options.c:1020
msgid "Generate position-independent code if possible"
msgstr ""
-#: options.c:1026
+#: options.c:1023
msgid "Generate position-independent code for executables if possible"
msgstr ""
-#: options.c:1029
+#: options.c:1026
msgid "Generate prefetch instructions, if available, for arrays in loops"
msgstr ""
-#: options.c:1035
+#: options.c:1032
msgid "Enable basic program profiling code"
msgstr ""
-#: options.c:1038
+#: options.c:1035
msgid "Insert arc-based program profiling code"
msgstr ""
-#: options.c:1041
+#: options.c:1038
msgid "Insert code to profile values of expressions"
msgstr ""
-#: options.c:1047
+#: options.c:1044
msgid "-frandom-seed=<string>\tMake compile reproducible using <string>"
msgstr ""
-#: options.c:1050
+#: options.c:1047
msgid "Strength reduce all loop general induction variables"
msgstr ""
-#: options.c:1053
+#: options.c:1050
msgid "Return small aggregates in registers"
msgstr ""
-#: options.c:1056
+#: options.c:1053
msgid "Enables a register move optimization"
msgstr ""
-#: options.c:1059
+#: options.c:1056
msgid "Perform a register renaming optimization pass"
msgstr ""
-#: options.c:1062
+#: options.c:1059
msgid "Reorder basic blocks to improve code placement"
msgstr ""
-#: options.c:1065
+#: options.c:1062
msgid "Reorder functions to improve code placement"
msgstr ""
-#: options.c:1068
+#: options.c:1065
msgid ""
"Used in Fix-and-Continue mode to indicate that object files may be swapped "
"in at runtime"
msgstr ""
-#: options.c:1071
+#: options.c:1068
msgid "Enable automatic template instantiation"
msgstr ""
-#: options.c:1074
+#: options.c:1071
msgid "Add a common subexpression elimination pass after loop optimizations"
msgstr ""
-#: options.c:1077
+#: options.c:1074
msgid "Run the loop optimizer twice"
msgstr ""
-#: options.c:1080
+#: options.c:1077
msgid "Disable optimizations that assume default FP rounding behavior"
msgstr ""
-#: options.c:1083
+#: options.c:1080
msgid "Generate run time type descriptor information"
msgstr ""
-#: options.c:1086
+#: options.c:1083
msgid "Enable scheduling across basic blocks"
msgstr ""
-#: options.c:1089
+#: options.c:1086
msgid "Allow speculative motion of non-loads"
msgstr ""
-#: options.c:1092
+#: options.c:1089
msgid "Allow speculative motion of some loads"
msgstr ""
-#: options.c:1095
+#: options.c:1092
msgid "Allow speculative motion of more loads"
msgstr ""
-#: options.c:1098
+#: options.c:1095
msgid "Allow premature scheduling of queued insns"
msgstr ""
-#: options.c:1101
+#: options.c:1098
msgid ""
"Set dependence distance checking in premature scheduling of queued insns"
msgstr ""
-#: options.c:1104
+#: options.c:1101
msgid ""
"-fsched-stalled-insns-dep=<number> Set dependence distance checking in "
"premature scheduling of queued insns"
msgstr ""
-#: options.c:1107
+#: options.c:1104
msgid ""
"-fsched-stalled-insns=<number> Set number of queued insns that can be "
"prematurely scheduled"
msgstr ""
-#: options.c:1110
+#: options.c:1107
msgid "-fsched-verbose=<number>\tSet the verbosity level of the scheduler"
msgstr ""
-#: options.c:1113
+#: options.c:1110
msgid "If scheduling post reload, do superblock scheduling"
msgstr ""
-#: options.c:1116
+#: options.c:1113
msgid "If scheduling post reload, do trace scheduling"
msgstr ""
-#: options.c:1119
+#: options.c:1116
msgid "Reschedule instructions before register allocation"
msgstr ""
-#: options.c:1122
+#: options.c:1119
msgid "Reschedule instructions after register allocation"
msgstr ""
-#: options.c:1125
+#: options.c:1122
msgid "Allow appending a second underscore to externals"
msgstr ""
-#: options.c:1128
+#: options.c:1125
msgid "Mark data as shared rather than private"
msgstr ""
-#: options.c:1131
+#: options.c:1128
msgid "Use the same size for double as for float"
msgstr ""
-#: options.c:1134
+#: options.c:1131
msgid "Use the narrowest integer type possible for enumeration types"
msgstr ""
-#: options.c:1137
+#: options.c:1134
msgid "Force the underlying type for \"wchar_t\" to be \"unsigned short\""
msgstr ""
-#: options.c:1143
+#: options.c:1140
msgid "Disable optimizations observable by IEEE signaling NaNs"
msgstr ""
-#: options.c:1146
+#: options.c:1143
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield signed"
msgstr ""
-#: options.c:1149
+#: options.c:1146
msgid "Make \"char\" signed by default"
msgstr ""
-#: options.c:1152
+#: options.c:1149
msgid "Do not print names of program units as they are compiled"
msgstr ""
-#: options.c:1155
+#: options.c:1152
msgid "Convert floating point constants to single precision constants"
msgstr ""
-#: options.c:1158
+#: options.c:1155
msgid "Internally convert most source to lowercase"
msgstr ""
-#: options.c:1161
+#: options.c:1158
msgid "Internally preserve source case"
msgstr ""
-#: options.c:1164
+#: options.c:1161
msgid "Internally convert most source to uppercase"
msgstr ""
-#: options.c:1170
+#: options.c:1167
msgid "Enable static single assignment optimizations"
msgstr ""
-#: options.c:1173
+#: options.c:1170
msgid "Enable SSA conditional constant propagation"
msgstr ""
-#: options.c:1176
+#: options.c:1173
msgid "Enable aggressive SSA dead code elimination"
msgstr ""
-#: options.c:1179
+#: options.c:1176
msgid "Insert stack checking code into the program"
msgstr ""
-#: options.c:1185
+#: options.c:1182
msgid ""
"-fstack-limit-register=<register>\tTrap if the stack goes past <register>"
msgstr ""
-#: options.c:1188
+#: options.c:1185
msgid "-fstack-limit-symbol=<name>\tTrap if the stack goes past symbol <name>"
msgstr ""
-#: options.c:1191
+#: options.c:1188
msgid "Display statistics accumulated during compilation"
msgstr ""
-#: options.c:1194
+#: options.c:1191
msgid "Enable assignability checks for stores into object arrays"
msgstr ""
-#: options.c:1197
+#: options.c:1194
msgid "Perform strength reduction optimizations"
msgstr ""
-#: options.c:1200
+#: options.c:1197
msgid "Assume strict aliasing rules apply"
msgstr ""
-#: options.c:1209
+#: options.c:1206
msgid "Symbol names spelled in mixed case"
msgstr ""
-#: options.c:1212
+#: options.c:1209
msgid "Symbol names in lowercase"
msgstr ""
-#: options.c:1215
+#: options.c:1212
msgid "Symbol names in uppercase"
msgstr ""
-#: options.c:1218
+#: options.c:1215
msgid "Check for syntax errors, then stop"
msgstr ""
-#: options.c:1221
+#: options.c:1218
msgid "-ftabstop=<number>\tDistance between tab stops for column reporting"
msgstr ""
-#: options.c:1224
+#: options.c:1221
msgid "-ftemplate-depth-<number>\tSpecify maximum template instantiation depth"
msgstr ""
-#: options.c:1227
+#: options.c:1224
msgid "Create data files needed by \"gcov\""
msgstr ""
-#: options.c:1233
+#: options.c:1230
msgid "Perform jump threading optimizations"
msgstr ""
-#: options.c:1236
+#: options.c:1233
msgid "Report the time taken by each compiler pass"
msgstr ""
-#: options.c:1239
+#: options.c:1236
msgid ""
"-ftls-model=[global-dynamic|local-dynamic|initial-exec|local-exec]\tSet the "
"default thread-local storage code generation model"
msgstr ""
-#: options.c:1242
+#: options.c:1239
msgid "Perform superblock formation via tail duplication"
msgstr ""
-#: options.c:1245
+#: options.c:1242
msgid "Assume floating-point operations can trap"
msgstr ""
-#: options.c:1248
+#: options.c:1245
msgid "Trap for signed overflow in addition, subtraction and multiplication"
msgstr ""
-#: options.c:1251
+#: options.c:1248
msgid "Make prefix-radix non-decimal constants be typeless"
msgstr ""
-#: options.c:1254
+#: options.c:1251
msgid "Allow all ugly features"
msgstr ""
-#: options.c:1257
+#: options.c:1254
msgid "Hollerith and typeless can be passed as arguments"
msgstr ""
-#: options.c:1260
+#: options.c:1257
msgid "Allow ordinary copying of ASSIGN'ed vars"
msgstr ""
-#: options.c:1263
+#: options.c:1260
msgid "Dummy array dimensioned to (1) is assumed-size"
msgstr ""
-#: options.c:1266
+#: options.c:1263
msgid "Trailing comma in procedure call denotes null argument"
msgstr ""
-#: options.c:1269
+#: options.c:1266
msgid "Allow REAL(Z) and AIMAG(Z) given DOUBLE COMPLEX Z"
msgstr ""
-#: options.c:1272
+#: options.c:1269
msgid "Initialization via DATA and PARAMETER is not type-compatible"
msgstr ""
-#: options.c:1275
+#: options.c:1272
msgid "Allow INTEGER and LOGICAL interchangeability"
msgstr ""
-#: options.c:1278
+#: options.c:1275
msgid "Append underscores to externals"
msgstr ""
-#: options.c:1281
+#: options.c:1278
msgid "Compile whole compilation unit at a time"
msgstr ""
-#: options.c:1284
+#: options.c:1281
msgid "Delete libU77 intrinsics"
msgstr ""
-#: options.c:1287
+#: options.c:1284
msgid "Disable libU77 intrinsics"
msgstr ""
-#: options.c:1290
+#: options.c:1287
msgid "Enable libU77 intrinsics"
msgstr ""
-#: options.c:1293
+#: options.c:1290
msgid "Hide libU77 intrinsics"
msgstr ""
-#: options.c:1302
+#: options.c:1299
msgid "Allow math optimizations that may violate IEEE or ISO standards"
msgstr ""
-#: options.c:1305
+#: options.c:1302
msgid "When \"signed\" or \"unsigned\" is not given make the bitfield unsigned"
msgstr ""
-#: options.c:1308
+#: options.c:1305
msgid "Make \"char\" unsigned by default"
msgstr ""
-#: options.c:1311
+#: options.c:1308
msgid "Perform loop unswitching"
msgstr ""
-#: options.c:1314
+#: options.c:1311
msgid "Just generate unwind tables for exception handling"
msgstr ""
-#: options.c:1320
+#: options.c:1317
msgid "Use __cxa_atexit to register destructors"
msgstr ""
-#: options.c:1326
+#: options.c:1323
msgid "Add extra commentary to assembler output"
msgstr ""
-#: options.c:1329
+#: options.c:1326
msgid "Print g77-specific version information and run internal tests"
msgstr ""
-#: options.c:1332
+#: options.c:1329
msgid "Use expression value profiles in optimizations"
msgstr ""
-#: options.c:1335
+#: options.c:1332
msgid "Discard unused virtual functions"
msgstr ""
-#: options.c:1338
+#: options.c:1335
msgid "Implement vtables using thunks"
msgstr ""
-#: options.c:1341
+#: options.c:1338
msgid "Program is written in VXT (Digital-like) FORTRAN"
msgstr ""
-#: options.c:1344
+#: options.c:1341
msgid "Delete non-FORTRAN-77 intrinsics VXT FORTRAN supports"
msgstr ""
-#: options.c:1347
+#: options.c:1344
msgid "Disable non-FORTRAN-77 intrinsics VXT FORTRAN supports"
msgstr ""
-#: options.c:1350
+#: options.c:1347
msgid "Enable non-FORTRAN-77 intrinsics VXT FORTRAN supports"
msgstr ""
-#: options.c:1353
+#: options.c:1350
msgid "Hide non-FORTRAN-77 intrinsics VXT FORTRAN supports"
msgstr ""
-#: options.c:1359
+#: options.c:1356
msgid "Emit common-like symbols as weak symbols"
msgstr ""
-#: options.c:1362
+#: options.c:1359
msgid "Construct webs and split unrelated uses of single variable"
msgstr ""
-#: options.c:1365
+#: options.c:1362
msgid ""
"-fwide-exec-charset=<cset>\tConvert all wide strings and character constants "
"to character set <cset>"
msgstr ""
-#: options.c:1368
+#: options.c:1365
msgid "Generate a #line directive pointing at the current working directory"
msgstr ""
-#: options.c:1371
+#: options.c:1368
msgid "Assume signed arithmetic overflow wraps around"
msgstr ""
-#: options.c:1374
+#: options.c:1371
msgid "Store strings in writable data section"
msgstr ""
-#: options.c:1377
+#: options.c:1374
msgid "Emit cross referencing information"
msgstr ""
-#: options.c:1380
+#: options.c:1377
msgid "Print internal debugging-related information"
msgstr ""
-#: options.c:1383
+#: options.c:1380
msgid "Put zero initialized data in the bss section"
msgstr ""
-#: options.c:1386
+#: options.c:1383
msgid ""
"Generate lazy class lookup (via objc_getClass()) for use in Zero-Link mode"
msgstr ""
-#: options.c:1389
+#: options.c:1386
msgid "Treat initial values of 0 like non-zero values"
msgstr ""
-#: options.c:1392
+#: options.c:1389
msgid "Generate debug information in default format"
msgstr ""
-#: options.c:1398
+#: options.c:1395
msgid "Generate debug information in COFF format"
msgstr ""
-#: options.c:1401
+#: options.c:1398
msgid "Generate debug information in DWARF v1 format"
msgstr ""
-#: options.c:1404
+#: options.c:1401
msgid "Generate debug information in extended DWARF v1 format"
msgstr ""
-#: options.c:1407
+#: options.c:1404
msgid "Generate debug information in DWARF v2 format"
msgstr ""
-#: options.c:1410
+#: options.c:1407
msgid "Dump declarations to a .decl file"
msgstr ""
-#: options.c:1413
+#: options.c:1410
msgid "Generate debug information in default extended format"
msgstr ""
-#: options.c:1416
+#: options.c:1413
msgid "-gnat<options>\tSpecify options to GNAT"
msgstr ""
-#: options.c:1419
+#: options.c:1416
msgid "Generate debug information in STABS format"
msgstr ""
-#: options.c:1422
+#: options.c:1419
msgid "Generate debug information in extended STABS format"
msgstr ""
-#: options.c:1425
+#: options.c:1422
msgid "Generate debug information in VMS format"
msgstr ""
-#: options.c:1428
+#: options.c:1425
msgid "Generate debug information in XCOFF format"
msgstr ""
-#: options.c:1431
+#: options.c:1428
msgid "Generate debug information in extended XCOFF format"
msgstr ""
-#: options.c:1434
+#: options.c:1431
msgid "-idirafter <dir>\tAdd <dir> to the end of the system include path"
msgstr ""
-#: options.c:1437
+#: options.c:1434
msgid "-imacros <file>\tAccept definition of macros in <file>"
msgstr ""
-#: options.c:1440
+#: options.c:1437
msgid "-include <file>\tInclude the contents of <file> before other files"
msgstr ""
-#: options.c:1443
+#: options.c:1440
msgid "-iprefix <path>\tSpecify <path> as a prefix for next two options"
msgstr ""
-#: options.c:1446
+#: options.c:1443
msgid "-isysroot <dir>\tSet <dir> to be the system root directory"
msgstr ""
-#: options.c:1449
+#: options.c:1446
msgid "-isystem <dir>\tAdd <dir> to the start of the system include path"
msgstr ""
-#: options.c:1452
+#: options.c:1449
msgid "-iwithprefix <dir>\tAdd <dir> to the end of the system include path"
msgstr ""
-#: options.c:1455
+#: options.c:1452
msgid "-iwithprefixbefore <dir>\tAdd <dir> to the end of the main include path"
msgstr ""
-#: options.c:1467
+#: options.c:1464
msgid ""
"Do not search standard system include directories (those specified with -"
"isystem will still be used)"
msgstr ""
-#: options.c:1470
+#: options.c:1467
msgid "Do not search standard system include directories for C++"
msgstr ""
@@ -20824,42 +20856,52 @@ msgstr ""
msgid "Suppress warnings"
msgstr ""
-#: config/i386/cygwin.h:29
-msgid "mno-cygwin and mno-win32 are not compatible"
+#: config/rs6000/darwin.h:98
+msgid " conflicting code gen style switches are used"
msgstr ""
-#: config/i386/cygwin.h:70 config/i386/mingw32.h:58
-msgid "shared and mdll are not compatible"
+#: gcc.c:742
+msgid "GCC does not support -C or -CC without -E"
msgstr ""
-#: config/rs6000/sysv4.h:1054 config/i386/freebsd-aout.h:215
-msgid "`-p' not supported; use `-pg' and gprof(1)"
+#: gcc.c:766 java/jvspec.c:80 ada/lang-specs.h:34
+msgid "-pg and -fomit-frame-pointer are incompatible"
msgstr ""
-#: f/lang-specs.h:38
-msgid "GCC does not support -C without using -E"
+#: gcc.c:915
+msgid "-E required when input is from standard input"
msgstr ""
-#: f/lang-specs.h:39
-msgid "GCC does not support -CC without using -E"
+#: config/arm/arm.h:197
+msgid "-mapcs-26 and -mapcs-32 may not be used together"
msgstr ""
-#: config/sparc/linux64.h:207 config/sparc/linux64.h:218
-#: config/sparc/netbsd-elf.h:140 config/sparc/netbsd-elf.h:159
-#: config/sparc/sol2-bi.h:166 config/sparc/sol2-bi.h:176
-msgid "may not use both -m32 and -m64"
+#: config/arm/arm.h:199
+msgid "-msoft-float and -mhard_float may not be used together"
msgstr ""
-#: config/i386/sco5.h:192
-msgid "-pg not supported on this platform"
+#: config/arm/arm.h:201
+msgid "-mbig-endian and -mlittle-endian may not be used together"
msgstr ""
-#: config/i386/sco5.h:193
-msgid "-p and -pp specified - pick one"
+#: java/lang-specs.h:34
+msgid "-fjni and -femit-class-files are incompatible"
msgstr ""
-#: config/i386/sco5.h:267
-msgid "-G and -static are mutually exclusive"
+#: java/lang-specs.h:35
+msgid "-fjni and -femit-class-file are incompatible"
+msgstr ""
+
+#: java/lang-specs.h:36 java/lang-specs.h:37
+msgid "-femit-class-file should used along with -fsyntax-only"
+msgstr ""
+
+#: config/mips/mips.h:975
+msgid "-pipe is not supported"
+msgstr ""
+
+#: config/mips/mips.h:1129 config/arc/arc.h:63
+msgid "may not use both -EB and -EL"
msgstr ""
#: config/darwin.h:215
@@ -20898,78 +20940,68 @@ msgstr ""
msgid "-private_bundle not allowed with -dynamiclib"
msgstr ""
-#: config/vax/netbsd-elf.h:42
-msgid "The -shared option is not currently supported for VAX ELF."
-msgstr ""
-
-#: config/vax/vax.h:50 config/vax/vax.h:51
-msgid "profiling not supported with -mg\n"
-msgstr ""
-
-#: config/arc/arc.h:63 config/mips/mips.h:1129
-msgid "may not use both -EB and -EL"
-msgstr ""
-
-#: config/mcore/mcore.h:65
-msgid "the m210 does not have little endian support"
-msgstr ""
-
-#: config/mips/mips.h:975
-msgid "-pipe is not supported"
+#: config/i386/mingw32.h:58 config/i386/cygwin.h:70
+msgid "shared and mdll are not compatible"
msgstr ""
#: treelang/lang-specs.h:52
msgid "-pg or -p and -fomit-frame-pointer are incompatible"
msgstr ""
-#: config/arm/arm.h:197
-msgid "-mapcs-26 and -mapcs-32 may not be used together"
+#: config/mips/r3900.h:35
+msgid "-mhard-float not supported"
msgstr ""
-#: config/arm/arm.h:199
-msgid "-msoft-float and -mhard_float may not be used together"
+#: config/mips/r3900.h:37
+msgid "-msingle-float and -msoft-float can not both be specified"
msgstr ""
-#: config/arm/arm.h:201
-msgid "-mbig-endian and -mlittle-endian may not be used together"
+#: f/lang-specs.h:38
+msgid "GCC does not support -C without using -E"
msgstr ""
-#: ada/lang-specs.h:34 java/jvspec.c:80 gcc.c:766
-msgid "-pg and -fomit-frame-pointer are incompatible"
+#: f/lang-specs.h:39
+msgid "GCC does not support -CC without using -E"
msgstr ""
-#: ada/lang-specs.h:36
-msgid "one of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada"
+#: config/rs6000/sysv4.h:1080 config/i386/freebsd-aout.h:215
+msgid "`-p' not supported; use `-pg' and gprof(1)"
msgstr ""
-#: config/mips/r3900.h:35
-msgid "-mhard-float not supported"
+#: config/vax/netbsd-elf.h:42
+msgid "The -shared option is not currently supported for VAX ELF."
msgstr ""
-#: config/mips/r3900.h:37
-msgid "-msingle-float and -msoft-float can not both be specified"
+#: config/sparc/linux64.h:207 config/sparc/linux64.h:218
+#: config/sparc/netbsd-elf.h:140 config/sparc/netbsd-elf.h:159
+#: config/sparc/sol2-bi.h:166 config/sparc/sol2-bi.h:176
+msgid "may not use both -m32 and -m64"
msgstr ""
-#: java/lang-specs.h:34
-msgid "-fjni and -femit-class-files are incompatible"
+#: config/vax/vax.h:50 config/vax/vax.h:51
+msgid "profiling not supported with -mg\n"
msgstr ""
-#: java/lang-specs.h:35
-msgid "-fjni and -femit-class-file are incompatible"
+#: config/i386/sco5.h:192
+msgid "-pg not supported on this platform"
msgstr ""
-#: java/lang-specs.h:36 java/lang-specs.h:37
-msgid "-femit-class-file should used along with -fsyntax-only"
+#: config/i386/sco5.h:193
+msgid "-p and -pp specified - pick one"
msgstr ""
-#: config/rs6000/darwin.h:97
-msgid " conflicting code gen style switches are used"
+#: config/i386/sco5.h:267
+msgid "-G and -static are mutually exclusive"
msgstr ""
-#: gcc.c:742
-msgid "GCC does not support -C or -CC without -E"
+#: config/i386/cygwin.h:29
+msgid "mno-cygwin and mno-win32 are not compatible"
msgstr ""
-#: gcc.c:915
-msgid "-E required when input is from standard input"
+#: ada/lang-specs.h:36
+msgid "one of -c, -S, -gnatc, -gnatz, or -gnats is required for Ada"
+msgstr ""
+
+#: config/mcore/mcore.h:65
+msgid "the m210 does not have little endian support"
msgstr ""
diff --git a/gcc/postreload.c b/gcc/postreload.c
index f5a987a7f0d..835a7218b36 100644
--- a/gcc/postreload.c
+++ b/gcc/postreload.c
@@ -664,7 +664,7 @@ reload_combine (void)
FOR_EACH_BB_REVERSE (bb)
{
- insn = bb->head;
+ insn = BB_HEAD (bb);
if (GET_CODE (insn) == CODE_LABEL)
{
HARD_REG_SET live;
@@ -718,7 +718,9 @@ reload_combine (void)
... (MEM (PLUS (REGZ) (REGY)))... .
First, check that we have (set (REGX) (PLUS (REGX) (REGY)))
- and that we know all uses of REGX before it dies. */
+ and that we know all uses of REGX before it dies.
+ Also, explicitly check that REGX != REGY; our life information
+ does not yet show whether REGY changes in this insn. */
set = single_set (insn);
if (set != NULL_RTX
&& GET_CODE (SET_DEST (set)) == REG
@@ -728,6 +730,7 @@ reload_combine (void)
&& GET_CODE (SET_SRC (set)) == PLUS
&& GET_CODE (XEXP (SET_SRC (set), 1)) == REG
&& rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set))
+ && !rtx_equal_p (XEXP (SET_SRC (set), 1), SET_DEST (set))
&& last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid)
{
rtx reg = SET_DEST (set);
@@ -1196,14 +1199,12 @@ reload_cse_move2add (rtx first)
else if (rtx_cost (new_src, PLUS) < rtx_cost (src, SET)
&& have_add2_insn (reg, new_src))
{
- rtx newpat = gen_add2_insn (reg, new_src);
- if (INSN_P (newpat) && NEXT_INSN (newpat) == NULL_RTX)
- newpat = PATTERN (newpat);
- /* If it was the first insn of a sequence or
- some other emitted insn, validate_change will
- reject it. */
- validate_change (insn, &PATTERN (insn),
- newpat, 0);
+ rtx newpat = gen_rtx_SET (VOIDmode,
+ reg,
+ gen_rtx_PLUS (GET_MODE (reg),
+ reg,
+ new_src));
+ validate_change (insn, &PATTERN (insn), newpat, 0);
}
else
{
@@ -1285,10 +1286,11 @@ reload_cse_move2add (rtx first)
< COSTS_N_INSNS (1) + rtx_cost (src3, SET))
&& have_add2_insn (reg, new_src))
{
- rtx newpat = gen_add2_insn (reg, new_src);
- if (INSN_P (newpat)
- && NEXT_INSN (newpat) == NULL_RTX)
- newpat = PATTERN (newpat);
+ rtx newpat = gen_rtx_SET (VOIDmode,
+ reg,
+ gen_rtx_PLUS (GET_MODE (reg),
+ reg,
+ new_src));
success
= validate_change (next, &PATTERN (next),
newpat, 0);
diff --git a/gcc/predict.c b/gcc/predict.c
index 243c814775d..74a1f24c3ad 100644
--- a/gcc/predict.c
+++ b/gcc/predict.c
@@ -72,10 +72,8 @@ static void estimate_loops_at_level (struct loop *loop);
static void propagate_freq (struct loop *);
static void estimate_bb_frequencies (struct loops *);
static void counts_to_freqs (void);
-static void process_note_predictions (basic_block, int *, dominance_info,
- dominance_info);
-static void process_note_prediction (basic_block, int *, dominance_info,
- dominance_info, int, int);
+static void process_note_predictions (basic_block, int *);
+static void process_note_prediction (basic_block, int *, int, int);
static bool last_basic_block_p (basic_block);
static void compute_function_frequency (void);
static void choose_function_section (void);
@@ -154,9 +152,9 @@ static bool
predicted_by_p (basic_block bb, enum br_predictor predictor)
{
rtx note;
- if (!INSN_P (bb->end))
+ if (!INSN_P (BB_END (bb)))
return false;
- for (note = REG_NOTES (bb->end); note; note = XEXP (note, 1))
+ for (note = REG_NOTES (BB_END (bb)); note; note = XEXP (note, 1))
if (REG_NOTE_KIND (note) == REG_BR_PRED
&& INTVAL (XEXP (XEXP (note, 0), 0)) == (int)predictor)
return true;
@@ -199,7 +197,7 @@ void
predict_edge (edge e, enum br_predictor predictor, int probability)
{
rtx last_insn;
- last_insn = e->src->end;
+ last_insn = BB_END (e->src);
/* We can store the branch prediction information only about
conditional jumps. */
@@ -393,13 +391,12 @@ combine_predictions_for_insn (rtx insn, basic_block bb)
void
estimate_probability (struct loops *loops_info)
{
- dominance_info dominators, post_dominators;
basic_block bb;
unsigned i;
connect_infinite_loops_to_exit ();
- dominators = calculate_dominance_info (CDI_DOMINATORS);
- post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_POST_DOMINATORS);
/* Try to predict out blocks in a loop that are not part of a
natural loop. */
@@ -412,11 +409,10 @@ estimate_probability (struct loops *loops_info)
struct loop_desc desc;
unsigned HOST_WIDE_INT niter;
- flow_loop_scan (loops_info, loop, LOOP_EXIT_EDGES);
+ flow_loop_scan (loop, LOOP_EXIT_EDGES);
exits = loop->num_exits;
- if (simple_loop_p (loops_info, loop, &desc)
- && desc.const_iter)
+ if (simple_loop_p (loop, &desc) && desc.const_iter)
{
int prob;
niter = desc.niter + 1;
@@ -445,7 +441,7 @@ estimate_probability (struct loops *loops_info)
statements construct loops via "non-loop" constructs
in the source language and are better to be handled
separately. */
- if (!can_predict_insn_p (bb->end)
+ if (!can_predict_insn_p (BB_END (bb))
|| predicted_by_p (bb, PRED_CONTINUE))
continue;
@@ -476,7 +472,7 @@ estimate_probability (struct loops *loops_info)
/* Attempt to predict conditional jumps using a number of heuristics. */
FOR_EACH_BB (bb)
{
- rtx last_insn = bb->end;
+ rtx last_insn = BB_END (bb);
rtx cond, earliest;
edge e;
@@ -500,8 +496,8 @@ estimate_probability (struct loops *loops_info)
/* Look for block we are guarding (ie we dominate it,
but it doesn't postdominate us). */
if (e->dest != EXIT_BLOCK_PTR && e->dest != bb
- && dominated_by_p (dominators, e->dest, e->src)
- && !dominated_by_p (post_dominators, e->src, e->dest))
+ && dominated_by_p (CDI_DOMINATORS, e->dest, e->src)
+ && !dominated_by_p (CDI_POST_DOMINATORS, e->src, e->dest))
{
rtx insn;
@@ -509,7 +505,7 @@ estimate_probability (struct loops *loops_info)
is improbable. This is because such calls are often used
to signal exceptional situations such as printing error
messages. */
- for (insn = e->dest->head; insn != NEXT_INSN (e->dest->end);
+ for (insn = BB_HEAD (e->dest); insn != NEXT_INSN (BB_END (e->dest));
insn = NEXT_INSN (insn))
if (GET_CODE (insn) == CALL_INSN
/* Constant and pure calls are hardly used to signalize
@@ -613,13 +609,12 @@ estimate_probability (struct loops *loops_info)
/* Attach the combined probability to each conditional jump. */
FOR_EACH_BB (bb)
- if (GET_CODE (bb->end) == JUMP_INSN
- && any_condjump_p (bb->end)
+ if (GET_CODE (BB_END (bb)) == JUMP_INSN
+ && any_condjump_p (BB_END (bb))
&& bb->succ->succ_next != NULL)
- combine_predictions_for_insn (bb->end, bb);
+ combine_predictions_for_insn (BB_END (bb), bb);
- free_dominance_info (post_dominators);
- free_dominance_info (dominators);
+ free_dominance_info (CDI_POST_DOMINATORS);
remove_fake_edges ();
estimate_bb_frequencies (loops_info);
@@ -719,10 +714,7 @@ last_basic_block_p (basic_block bb)
on demand, so -1 may be there in case this was not needed yet). */
static void
-process_note_prediction (basic_block bb, int *heads,
- dominance_info dominators,
- dominance_info post_dominators, int pred,
- int flags)
+process_note_prediction (basic_block bb, int *heads, int pred, int flags)
{
edge e;
int y;
@@ -736,18 +728,18 @@ process_note_prediction (basic_block bb, int *heads,
find first dominator that we do not post-dominate (we are
using already known members of heads array). */
basic_block ai = bb;
- basic_block next_ai = get_immediate_dominator (dominators, bb);
+ basic_block next_ai = get_immediate_dominator (CDI_DOMINATORS, bb);
int head;
while (heads[next_ai->index] < 0)
{
- if (!dominated_by_p (post_dominators, next_ai, bb))
+ if (!dominated_by_p (CDI_POST_DOMINATORS, next_ai, bb))
break;
heads[next_ai->index] = ai->index;
ai = next_ai;
- next_ai = get_immediate_dominator (dominators, next_ai);
+ next_ai = get_immediate_dominator (CDI_DOMINATORS, next_ai);
}
- if (!dominated_by_p (post_dominators, next_ai, bb))
+ if (!dominated_by_p (CDI_POST_DOMINATORS, next_ai, bb))
head = next_ai->index;
else
head = heads[next_ai->index];
@@ -765,11 +757,11 @@ process_note_prediction (basic_block bb, int *heads,
/* Now find the edge that leads to our branch and aply the prediction. */
- if (y == last_basic_block || !can_predict_insn_p (BASIC_BLOCK (y)->end))
+ if (y == last_basic_block || !can_predict_insn_p (BB_END (BASIC_BLOCK (y))))
return;
for (e = BASIC_BLOCK (y)->succ; e; e = e->succ_next)
if (e->dest->index >= 0
- && dominated_by_p (post_dominators, e->dest, bb))
+ && dominated_by_p (CDI_POST_DOMINATORS, e->dest, bb))
predict_edge_def (e, pred, taken);
}
@@ -778,9 +770,7 @@ process_note_prediction (basic_block bb, int *heads,
process_note_prediction. */
static void
-process_note_predictions (basic_block bb, int *heads,
- dominance_info dominators,
- dominance_info post_dominators)
+process_note_predictions (basic_block bb, int *heads)
{
rtx insn;
edge e;
@@ -790,8 +780,8 @@ process_note_predictions (basic_block bb, int *heads,
int was_bb_head = 0;
int noreturn_block = 1;
- for (insn = bb->end; insn;
- was_bb_head |= (insn == bb->head), insn = PREV_INSN (insn))
+ for (insn = BB_END (bb); insn;
+ was_bb_head |= (insn == BB_HEAD (bb)), insn = PREV_INSN (insn))
{
if (GET_CODE (insn) != NOTE)
{
@@ -813,8 +803,6 @@ process_note_predictions (basic_block bb, int *heads,
/* Process single prediction note. */
process_note_prediction (bb,
heads,
- dominators,
- post_dominators,
alg, (int) NOTE_PREDICTION_FLAGS (insn));
delete_insn (insn);
}
@@ -827,10 +815,7 @@ process_note_predictions (basic_block bb, int *heads,
/* This block ended from other reasons than because of return.
If it is because of noreturn call, this should certainly not
be taken. Otherwise it is probably some error recovery. */
- process_note_prediction (bb,
- heads,
- dominators,
- post_dominators, PRED_NORETURN, NOT_TAKEN);
+ process_note_prediction (bb, heads, PRED_NORETURN, NOT_TAKEN);
}
}
@@ -841,15 +826,14 @@ void
note_prediction_to_br_prob (void)
{
basic_block bb;
- dominance_info post_dominators, dominators;
int *heads;
/* To enable handling of noreturn blocks. */
add_noreturn_fake_exit_edges ();
connect_infinite_loops_to_exit ();
- post_dominators = calculate_dominance_info (CDI_POST_DOMINATORS);
- dominators = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_POST_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
heads = xmalloc (sizeof (int) * last_basic_block);
memset (heads, -1, sizeof (int) * last_basic_block);
@@ -858,10 +842,10 @@ note_prediction_to_br_prob (void)
/* Process all prediction notes. */
FOR_EACH_BB (bb)
- process_note_predictions (bb, heads, dominators, post_dominators);
+ process_note_predictions (bb, heads);
- free_dominance_info (post_dominators);
- free_dominance_info (dominators);
+ free_dominance_info (CDI_POST_DOMINATORS);
+ free_dominance_info (CDI_DOMINATORS);
free (heads);
remove_fake_edges ();
@@ -878,8 +862,8 @@ typedef struct block_info_def
/* To keep queue of basic blocks to process. */
basic_block next;
- /* True if block needs to be visited in prop_freqency. */
- int tovisit:1;
+ /* True if block needs to be visited in propagate_freq. */
+ unsigned int tovisit:1;
/* Number of predecessors we need to visit first. */
int npredecessors;
@@ -893,7 +877,7 @@ typedef struct edge_info_def
then computed as 1 / (1 - back_edge_prob). */
sreal back_edge_prob;
/* True if the edge is an loopback edge in the natural loop. */
- int back_edge:1;
+ unsigned int back_edge:1;
} *edge_info;
#define BLOCK_INFO(B) ((block_info) (B)->aux)
@@ -1105,7 +1089,7 @@ expensive_function_p (int threshold)
{
rtx insn;
- for (insn = bb->head; insn != NEXT_INSN (bb->end);
+ for (insn = BB_HEAD (bb); insn != NEXT_INSN (BB_END (bb));
insn = NEXT_INSN (insn))
if (active_insn_p (insn))
{
@@ -1149,7 +1133,7 @@ estimate_bb_frequencies (struct loops *loops)
notes. */
FOR_EACH_BB (bb)
{
- rtx last_insn = bb->end;
+ rtx last_insn = BB_END (bb);
if (!can_predict_insn_p (last_insn))
{
diff --git a/gcc/predict.def b/gcc/predict.def
index 238e0f262fc..25c51025e31 100644
--- a/gcc/predict.def
+++ b/gcc/predict.def
@@ -1,6 +1,5 @@
-/* This file contains the definitions and documentation for the
- builtins used in the GNU compiler.
- Copyright (C) 2001 Free Software Foundation, Inc.
+/* Definitions for the branch prediction routines in the GNU compiler.
+ Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
diff --git a/gcc/predict.h b/gcc/predict.h
index 6ac7d7f28b8..d0741dc704d 100644
--- a/gcc/predict.h
+++ b/gcc/predict.h
@@ -1,5 +1,4 @@
-/* This file contains the definitions and documentation for the
- builtins used in the GNU compiler.
+/* Definitions for branch prediction routines in the GNU compiler.
Copyright (C) 2001, 2003 Free Software Foundation, Inc.
This file is part of GCC.
@@ -40,7 +39,7 @@ enum prediction
extern void predict_insn_def (rtx, enum br_predictor, enum prediction);
extern void predict_insn (rtx, enum br_predictor, int);
-/* Avoid unneeded dependency on basic_block.h */
+/* Avoid unneeded dependency on basic_block.h. */
#ifdef BASIC_BLOCK
extern void predict_edge (edge, enum br_predictor, int);
extern void predict_edge_def (edge, enum br_predictor, enum prediction);
diff --git a/gcc/pretty-print.c b/gcc/pretty-print.c
index 43e440979c0..993fde7a6d6 100644
--- a/gcc/pretty-print.c
+++ b/gcc/pretty-print.c
@@ -343,6 +343,7 @@ pp_base_flush (pretty_printer *pp)
pp_clear_state (pp);
fputc ('\n', pp->buffer->stream);
fflush (pp->buffer->stream);
+ pp_needs_newline (pp) = false;
}
/* Sets the number of maximum characters per line PRETTY-PRINTER can
@@ -472,7 +473,7 @@ pp_base_last_position_in_text (const pretty_printer *pp)
}
/* Return the amount of characters PRETTY-PRINTER can accept to
- make a full line. Meaningfull only in line-wrapping mode. */
+ make a full line. Meaningful only in line-wrapping mode. */
int
pp_base_remaining_character_count_for_line (pretty_printer *pp)
{
diff --git a/gcc/pretty-print.h b/gcc/pretty-print.h
index 80affe83e6f..1691aec274a 100644
--- a/gcc/pretty-print.h
+++ b/gcc/pretty-print.h
@@ -234,7 +234,7 @@ struct pretty_print_info
#define pp_buffer(PP) pp_base (PP)->buffer
/* Clients that directly derive from pretty_printer need to override
- this macro to return a pointer to the base pretty_printer structrure. */
+ this macro to return a pointer to the base pretty_printer structure. */
#define pp_base(PP) (PP)
extern void pp_construct (pretty_printer *, const char *, int);
diff --git a/gcc/print-rtl.c b/gcc/print-rtl.c
index 4d05136cf3f..5c3b8d4443e 100644
--- a/gcc/print-rtl.c
+++ b/gcc/print-rtl.c
@@ -386,7 +386,7 @@ print_rtx (rtx in_rtx)
if (GET_CODE (in_rtx) == REG && value < FIRST_PSEUDO_REGISTER)
{
fputc (' ', outfile);
- PRINT_REG (in_rtx, 0, outfile);
+ PRINT_REG (in_rtx, -1, outfile);
}
else if (GET_CODE (in_rtx) == REG
&& value <= LAST_VIRTUAL_REGISTER)
diff --git a/gcc/profile.c b/gcc/profile.c
index 625a904a428..b7b39a2f5a8 100644
--- a/gcc/profile.c
+++ b/gcc/profile.c
@@ -502,7 +502,7 @@ compute_branch_probabilities (void)
}
for (e = bb->succ; e; e = e->succ_next)
{
- /* Function may return twice in the cased the called fucntion is
+ /* Function may return twice in the cased the called function is
setjmp or calls fork, but we can't represent this by extra
edge from the entry, since extra edge from the exit is
already present. We get negative frequency from the entry
@@ -512,10 +512,10 @@ compute_branch_probabilities (void)
|| (e->count > bb->count
&& e->dest != EXIT_BLOCK_PTR))
{
- rtx insn = bb->end;
+ rtx insn = BB_END (bb);
while (GET_CODE (insn) != CALL_INSN
- && insn != bb->head
+ && insn != BB_HEAD (bb)
&& keep_with_call_p (insn))
insn = PREV_INSN (insn);
if (GET_CODE (insn) == CALL_INSN)
@@ -534,7 +534,7 @@ compute_branch_probabilities (void)
for (e = bb->succ; e; e = e->succ_next)
e->probability = (e->count * REG_BR_PROB_BASE + bb->count / 2) / bb->count;
if (bb->index >= 0
- && any_condjump_p (bb->end)
+ && any_condjump_p (BB_END (bb))
&& bb->succ->succ_next)
{
int prob;
@@ -554,15 +554,15 @@ compute_branch_probabilities (void)
index = 19;
hist_br_prob[index]++;
- note = find_reg_note (bb->end, REG_BR_PROB, 0);
+ note = find_reg_note (BB_END (bb), REG_BR_PROB, 0);
/* There may be already note put by some other pass, such
as builtin_expect expander. */
if (note)
XEXP (note, 0) = GEN_INT (prob);
else
- REG_NOTES (bb->end)
+ REG_NOTES (BB_END (bb))
= gen_rtx_EXPR_LIST (REG_BR_PROB, GEN_INT (prob),
- REG_NOTES (bb->end));
+ REG_NOTES (BB_END (bb)));
num_branches++;
}
}
@@ -594,7 +594,7 @@ compute_branch_probabilities (void)
e->probability = REG_BR_PROB_BASE / total;
}
if (bb->index >= 0
- && any_condjump_p (bb->end)
+ && any_condjump_p (BB_END (bb))
&& bb->succ->succ_next)
num_branches++, num_never_executed;
}
@@ -892,7 +892,7 @@ branch_prob (void)
FOR_EACH_BB (bb)
{
- rtx insn = bb->head;
+ rtx insn = BB_HEAD (bb);
int ignore_next_note = 0;
offset = 0;
@@ -905,7 +905,7 @@ branch_prob (void)
else
insn = NEXT_INSN (insn);
- while (insn != bb->end)
+ while (insn != BB_END (bb))
{
if (GET_CODE (insn) == NOTE)
{
diff --git a/gcc/ra-build.c b/gcc/ra-build.c
index 896570ebf91..a305921c250 100644
--- a/gcc/ra-build.c
+++ b/gcc/ra-build.c
@@ -884,7 +884,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e)
use->live_over_abnormal = 1;
bitmap_set_bit (live_at_end[e->src->index], DF_REF_ID (use->wp->ref));
info_pred = (struct ra_bb_info *) e->src->aux;
- next_insn = e->src->end;
+ next_insn = BB_END (e->src);
/* If the last insn of the pred. block doesn't completely define the
current use, we need to check the block. */
@@ -899,7 +899,7 @@ live_in_edge (struct df *df, struct curr_use *use, edge e)
creation to later. */
bitmap_set_bit (info_pred->live_throughout,
DF_REF_ID (use->wp->ref));
- next_insn = e->src->head;
+ next_insn = BB_HEAD (e->src);
}
return next_insn;
}
@@ -1033,7 +1033,7 @@ livethrough_conflicts_bb (basic_block bb)
/* First collect the IDs of all defs, count the number of death
containing insns, and if there's some call_insn here. */
all_defs = BITMAP_XMALLOC ();
- for (insn = bb->head; insn; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
{
@@ -1048,7 +1048,7 @@ livethrough_conflicts_bb (basic_block bb)
if (GET_CODE (insn) == CALL_INSN)
contains_call = 1;
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
@@ -2674,10 +2674,10 @@ detect_webs_set_in_cond_jump (void)
{
basic_block bb;
FOR_EACH_BB (bb)
- if (GET_CODE (bb->end) == JUMP_INSN)
+ if (GET_CODE (BB_END (bb)) == JUMP_INSN)
{
struct df_link *link;
- for (link = DF_INSN_DEFS (df, bb->end); link; link = link->next)
+ for (link = DF_INSN_DEFS (df, BB_END (bb)); link; link = link->next)
if (link->ref && DF_REF_REGNO (link->ref) >= FIRST_PSEUDO_REGISTER)
{
struct web *web = def2web[DF_REF_ID (link->ref)];
diff --git a/gcc/ra-colorize.c b/gcc/ra-colorize.c
index f0d028118d7..fd4660ab9e0 100644
--- a/gcc/ra-colorize.c
+++ b/gcc/ra-colorize.c
@@ -618,7 +618,7 @@ ok (struct web *target, struct web *source)
{
/* The main webs do _not_ conflict, only some parts of both. This
means, that 4 is possibly true, so we need to check this too.
- For this we go thru all sub conflicts between T and C, and see if
+ For this we go through all sub conflicts between T and C, and see if
the target part of C already conflicts with S. When this is not
the case we disallow coalescing. */
struct sub_conflict *sl;
@@ -1214,7 +1214,7 @@ calculate_dont_begin (struct web *web, HARD_REG_SET *result)
}
}
/* The next if() only gets true, if there was no wl->sub at all, in
- which case we are only making one go thru this loop with W being
+ which case we are only making one go through this loop with W being
a whole web. */
if (!sl)
break;
@@ -1433,7 +1433,7 @@ colorize_one_web (struct web *web, int hard)
even if we spill this one here, the situation won't become better
in the next iteration. It probably will have the same conflicts,
those will have the same colors, and we would come here again, for
- all parts, in which this one gets splitted by the spill. This
+ all parts, in which this one gets split by the spill. This
can result in endless iteration spilling the same register again and
again. That's why we try to find a neighbor, which spans more
instructions that ourself, and got a color, and try to spill _that_.
@@ -1826,7 +1826,7 @@ try_recolor_web (struct web *web)
else if (web2->type == SELECT)
/* This means, that WEB2 once was a part of a coalesced
web, which got spilled in the above colorize_one_web()
- call, and whose parts then got splitted and put back
+ call, and whose parts then got split and put back
onto the SELECT stack. As the cause for that splitting
(the coloring of WEB) was worthless, we should again
coalesce the parts, as they were before. For now we
diff --git a/gcc/ra-debug.c b/gcc/ra-debug.c
index acddbe128cd..26aac12df0e 100644
--- a/gcc/ra-debug.c
+++ b/gcc/ra-debug.c
@@ -528,11 +528,12 @@ ra_debug_bbi (int bbi)
{
basic_block bb = BASIC_BLOCK (bbi);
rtx insn;
- for (insn = bb->head; insn; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn))
{
- ra_print_rtx_top (stderr, insn, (insn == bb->head || insn == bb->end));
+ ra_print_rtx_top (stderr, insn,
+ (insn == BB_HEAD (bb) || insn == BB_END (bb)));
fprintf (stderr, "\n");
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
@@ -911,7 +912,7 @@ dump_static_insn_cost (FILE *file, const char *message, const char *prefix)
{
unsigned HOST_WIDE_INT block_cost = bb->frequency;
rtx insn, set;
- for (insn = bb->head; insn; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); insn; insn = NEXT_INSN (insn))
{
/* Yes, yes. We don't calculate the costs precisely.
Only for "simple enough" insns. Those containing single
@@ -950,7 +951,7 @@ dump_static_insn_cost (FILE *file, const char *message, const char *prefix)
pcost->count++;
}
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
diff --git a/gcc/ra-rewrite.c b/gcc/ra-rewrite.c
index e958f1794ba..44fde7ddd2f 100644
--- a/gcc/ra-rewrite.c
+++ b/gcc/ra-rewrite.c
@@ -444,8 +444,8 @@ rewrite_program (bitmap new_deaths)
end_sequence ();
emit_insn_before (insns, insn);
- if (bb->head == insn)
- bb->head = NEXT_INSN (prev);
+ if (BB_HEAD (bb) == insn)
+ BB_HEAD (bb) = NEXT_INSN (prev);
for (insn = PREV_INSN (insn); insn != prev;
insn = PREV_INSN (insn))
{
@@ -492,8 +492,8 @@ rewrite_program (bitmap new_deaths)
if (insns)
{
emit_insn_after (insns, insn);
- if (bb->end == insn)
- bb->end = PREV_INSN (following);
+ if (BB_END (bb) == insn)
+ BB_END (bb) = PREV_INSN (following);
for (insn = insns; insn != following; insn = NEXT_INSN (insn))
{
set_block_for_insn (insn, bb);
@@ -685,8 +685,8 @@ insert_stores (bitmap new_deaths)
if (insns)
{
emit_insn_after (insns, insn);
- if (bb->end == insn)
- bb->end = PREV_INSN (following);
+ if (BB_END (bb) == insn)
+ BB_END (bb) = PREV_INSN (following);
for (ni = insns; ni != following; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
@@ -941,8 +941,8 @@ emit_loads (struct rewrite_info *ri, int nl_first_reload, rtx last_block_insn)
rtx foll = NEXT_INSN (after);
bb = BLOCK_FOR_INSN (after);
emit_insn_after (ni, after);
- if (bb->end == after)
- bb->end = PREV_INSN (foll);
+ if (BB_END (bb) == after)
+ BB_END (bb) = PREV_INSN (foll);
for (ni = NEXT_INSN (after); ni != foll; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
@@ -954,8 +954,8 @@ emit_loads (struct rewrite_info *ri, int nl_first_reload, rtx last_block_insn)
rtx prev = PREV_INSN (before);
bb = BLOCK_FOR_INSN (before);
emit_insn_before (ni, before);
- if (bb->head == before)
- bb->head = NEXT_INSN (prev);
+ if (BB_HEAD (bb) == before)
+ BB_HEAD (bb) = NEXT_INSN (prev);
for (; ni != before; ni = NEXT_INSN (ni))
{
set_block_for_insn (ni, bb);
diff --git a/gcc/ra.c b/gcc/ra.c
index 01ce6dc067f..5884197dca2 100644
--- a/gcc/ra.c
+++ b/gcc/ra.c
@@ -455,9 +455,7 @@ init_ra (void)
#endif
int need_fp
= (! flag_omit_frame_pointer
-#ifdef EXIT_IGNORE_STACK
|| (current_function_calls_alloca && EXIT_IGNORE_STACK)
-#endif
|| FRAME_POINTER_REQUIRED);
ra_colorize_init ();
@@ -665,7 +663,7 @@ reg_alloc (void)
for (e = EXIT_BLOCK_PTR->pred; e; e = e->pred_next)
{
basic_block bb = e->src;
- last = bb->end;
+ last = BB_END (bb);
if (!INSN_P (last) || GET_CODE (PATTERN (last)) != USE)
{
rtx insns;
diff --git a/gcc/real.c b/gcc/real.c
index 7609d996152..f7af346db60 100644
--- a/gcc/real.c
+++ b/gcc/real.c
@@ -858,6 +858,8 @@ do_divide (REAL_VALUE_TYPE *r, const REAL_VALUE_TYPE *a,
else
rr = r;
+ /* Make sure all fields in the result are initialized. */
+ get_zero (rr, 0);
rr->class = rvc_normal;
rr->sign = sign;
@@ -2534,9 +2536,10 @@ encode_ieee_single (const struct real_format *fmt, long *buf,
const REAL_VALUE_TYPE *r)
{
unsigned long image, sig, exp;
+ unsigned long sign = r->sign;
bool denormal = (r->sig[SIGSZ-1] & SIG_MSB) == 0;
- image = r->sign << 31;
+ image = sign << 31;
sig = (r->sig[SIGSZ-1] >> (HOST_BITS_PER_LONG - 24)) & 0x7fffff;
switch (r->class)
diff --git a/gcc/recog.c b/gcc/recog.c
index 02ae71d5d53..7df8d3300fe 100644
--- a/gcc/recog.c
+++ b/gcc/recog.c
@@ -1746,6 +1746,7 @@ asm_operand_ok (rtx op, const char *constraint)
case 'X':
result = 1;
+ break;
case 'g':
if (general_operand (op, VOIDmode))
@@ -1764,20 +1765,16 @@ asm_operand_ok (rtx op, const char *constraint)
result = 1;
}
#ifdef EXTRA_CONSTRAINT_STR
- if (EXTRA_CONSTRAINT_STR (op, c, constraint))
+ else if (EXTRA_CONSTRAINT_STR (op, c, constraint))
+ result = 1;
+ else if (EXTRA_MEMORY_CONSTRAINT (c, constraint)
+ /* Every memory operand can be reloaded to fit. */
+ && memory_operand (op, VOIDmode))
+ result = 1;
+ else if (EXTRA_ADDRESS_CONSTRAINT (c, constraint)
+ /* Every address operand can be reloaded to fit. */
+ && address_operand (op, VOIDmode))
result = 1;
- if (EXTRA_MEMORY_CONSTRAINT (c, constraint))
- {
- /* Every memory operand can be reloaded to fit. */
- if (memory_operand (op, VOIDmode))
- result = 1;
- }
- if (EXTRA_ADDRESS_CONSTRAINT (c, constraint))
- {
- /* Every address operand can be reloaded to fit. */
- if (address_operand (op, VOIDmode))
- result = 1;
- }
#endif
break;
}
@@ -1970,7 +1967,7 @@ extract_insn_cached (rtx insn)
extract_insn (insn);
recog_data.insn = insn;
}
-/* Do cached extract_insn, constrain_operand and complain about failures.
+/* Do cached extract_insn, constrain_operands and complain about failures.
Used by insn_attrtab. */
void
extract_constrain_insn_cached (rtx insn)
@@ -1980,7 +1977,7 @@ extract_constrain_insn_cached (rtx insn)
&& !constrain_operands (reload_completed))
fatal_insn_not_found (insn);
}
-/* Do cached constrain_operand and complain about failures. */
+/* Do cached constrain_operands and complain about failures. */
int
constrain_operands_cached (int strict)
{
@@ -2096,7 +2093,10 @@ preprocess_constraints (void)
{
int i;
- memset (recog_op_alt, 0, sizeof recog_op_alt);
+ for (i = 0; i < recog_data.n_operands; i++)
+ memset (recog_op_alt[i], 0, (recog_data.n_alternatives
+ * sizeof (struct operand_alternative)));
+
for (i = 0; i < recog_data.n_operands; i++)
{
int j;
@@ -2535,27 +2535,20 @@ constrain_operands (int strict)
else if (EXTRA_CONSTRAINT_STR (op, c, p))
win = 1;
- if (EXTRA_MEMORY_CONSTRAINT (c, p))
- {
- /* Every memory operand can be reloaded to fit. */
- if (strict < 0 && GET_CODE (op) == MEM)
- win = 1;
-
- /* Before reload, accept what reload can turn into mem. */
- if (strict < 0 && CONSTANT_P (op))
- win = 1;
-
- /* During reload, accept a pseudo */
- if (reload_in_progress && GET_CODE (op) == REG
- && REGNO (op) >= FIRST_PSEUDO_REGISTER)
- win = 1;
- }
- if (EXTRA_ADDRESS_CONSTRAINT (c, p))
- {
- /* Every address operand can be reloaded to fit. */
- if (strict < 0)
- win = 1;
- }
+ else if (EXTRA_MEMORY_CONSTRAINT (c, p)
+ /* Every memory operand can be reloaded to fit. */
+ && ((strict < 0 && GET_CODE (op) == MEM)
+ /* Before reload, accept what reload can turn
+ into mem. */
+ || (strict < 0 && CONSTANT_P (op))
+ /* During reload, accept a pseudo */
+ || (reload_in_progress && GET_CODE (op) == REG
+ && REGNO (op) >= FIRST_PSEUDO_REGISTER)))
+ win = 1;
+ else if (EXTRA_ADDRESS_CONSTRAINT (c, p)
+ /* Every address operand can be reloaded to fit. */
+ && strict < 0)
+ win = 1;
#endif
break;
}
@@ -2649,61 +2642,42 @@ reg_fits_class_p (rtx operand, enum reg_class class, int offset,
return 0;
}
-/* Split single instruction. Helper function for split_all_insns.
- Return last insn in the sequence if successful, or NULL if unsuccessful. */
+/* Split single instruction. Helper function for split_all_insns and
+ split_all_insns_noflow. Return last insn in the sequence if successful,
+ or NULL if unsuccessful. */
+
static rtx
split_insn (rtx insn)
{
- rtx set;
- if (!INSN_P (insn))
- ;
- /* Don't split no-op move insns. These should silently
- disappear later in final. Splitting such insns would
- break the code that handles REG_NO_CONFLICT blocks. */
+ /* Split insns here to get max fine-grain parallelism. */
+ rtx first = PREV_INSN (insn);
+ rtx last = try_split (PATTERN (insn), insn, 1);
- else if ((set = single_set (insn)) != NULL && set_noop_p (set))
- {
- /* Nops get in the way while scheduling, so delete them
- now if register allocation has already been done. It
- is too risky to try to do this before register
- allocation, and there are unlikely to be very many
- nops then anyways. */
- if (reload_completed)
- delete_insn_and_edges (insn);
- }
- else
- {
- /* Split insns here to get max fine-grain parallelism. */
- rtx first = PREV_INSN (insn);
- rtx last = try_split (PATTERN (insn), insn, 1);
+ if (last == insn)
+ return NULL_RTX;
+
+ /* try_split returns the NOTE that INSN became. */
+ PUT_CODE (insn, NOTE);
+ NOTE_SOURCE_FILE (insn) = 0;
+ NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- if (last != insn)
+ /* ??? Coddle to md files that generate subregs in post-reload
+ splitters instead of computing the proper hard register. */
+ if (reload_completed && first != last)
+ {
+ first = NEXT_INSN (first);
+ for (;;)
{
- /* try_split returns the NOTE that INSN became. */
- PUT_CODE (insn, NOTE);
- NOTE_SOURCE_FILE (insn) = 0;
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
-
- /* ??? Coddle to md files that generate subregs in post-
- reload splitters instead of computing the proper
- hard register. */
- if (reload_completed && first != last)
- {
- first = NEXT_INSN (first);
- while (1)
- {
- if (INSN_P (first))
- cleanup_subreg_operands (first);
- if (first == last)
- break;
- first = NEXT_INSN (first);
- }
- }
- return last;
+ if (INSN_P (first))
+ cleanup_subreg_operands (first);
+ if (first == last)
+ break;
+ first = NEXT_INSN (first);
}
}
- return NULL_RTX;
+ return last;
}
+
/* Split all insns in the function. If UPD_LIFE, update life info after. */
void
@@ -2722,26 +2696,54 @@ split_all_insns (int upd_life)
rtx insn, next;
bool finish = false;
- for (insn = bb->head; !finish ; insn = next)
+ for (insn = BB_HEAD (bb); !finish ; insn = next)
{
- rtx last;
-
/* Can't use `next_real_insn' because that might go across
CODE_LABELS and short-out basic blocks. */
next = NEXT_INSN (insn);
- finish = (insn == bb->end);
- last = split_insn (insn);
- if (last)
+ finish = (insn == BB_END (bb));
+ if (INSN_P (insn))
{
- /* The split sequence may include barrier, but the
- BB boundary we are interested in will be set to previous
- one. */
-
- while (GET_CODE (last) == BARRIER)
- last = PREV_INSN (last);
- SET_BIT (blocks, bb->index);
- changed = true;
- insn = last;
+ rtx set = single_set (insn);
+
+ /* Don't split no-op move insns. These should silently
+ disappear later in final. Splitting such insns would
+ break the code that handles REG_NO_CONFLICT blocks. */
+ if (set && set_noop_p (set))
+ {
+ /* Nops get in the way while scheduling, so delete them
+ now if register allocation has already been done. It
+ is too risky to try to do this before register
+ allocation, and there are unlikely to be very many
+ nops then anyways. */
+ if (reload_completed)
+ {
+ /* If the no-op set has a REG_UNUSED note, we need
+ to update liveness information. */
+ if (find_reg_note (insn, REG_UNUSED, NULL_RTX))
+ {
+ SET_BIT (blocks, bb->index);
+ changed = true;
+ }
+ /* ??? Is life info affected by deleting edges? */
+ delete_insn_and_edges (insn);
+ }
+ }
+ else
+ {
+ rtx last = split_insn (insn);
+ if (last)
+ {
+ /* The split sequence may include barrier, but the
+ BB boundary we are interested in will be set to
+ previous one. */
+
+ while (GET_CODE (last) == BARRIER)
+ last = PREV_INSN (last);
+ SET_BIT (blocks, bb->index);
+ changed = true;
+ }
+ }
}
}
}
@@ -2778,9 +2780,28 @@ split_all_insns_noflow (void)
for (insn = get_insns (); insn; insn = next)
{
next = NEXT_INSN (insn);
- split_insn (insn);
+ if (INSN_P (insn))
+ {
+ /* Don't split no-op move insns. These should silently
+ disappear later in final. Splitting such insns would
+ break the code that handles REG_NO_CONFLICT blocks. */
+ rtx set = single_set (insn);
+ if (set && set_noop_p (set))
+ {
+ /* Nops get in the way while scheduling, so delete them
+ now if register allocation has already been done. It
+ is too risky to try to do this before register
+ allocation, and there are unlikely to be very many
+ nops then anyways.
+
+ ??? Should we use delete_insn when the CFG isn't valid? */
+ if (reload_completed)
+ delete_insn_and_edges (insn);
+ }
+ else
+ split_insn (insn);
+ }
}
- return;
}
#ifdef HAVE_peephole2
@@ -3021,7 +3042,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
pbi = init_propagate_block_info (bb, live, NULL, NULL, PROP_DEATH_NOTES);
#endif
- for (insn = bb->end; ; insn = prev)
+ for (insn = BB_END (bb); ; insn = prev)
{
prev = PREV_INSN (insn);
if (INSN_P (insn))
@@ -3137,7 +3158,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
XEXP (note, 0),
REG_NOTES (x));
- if (x != bb->end && eh_edge)
+ if (x != BB_END (bb) && eh_edge)
{
edge nfte, nehe;
int flags;
@@ -3221,7 +3242,7 @@ peephole2_optimize (FILE *dump_file ATTRIBUTE_UNUSED)
}
}
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
break;
}
diff --git a/gcc/recog.h b/gcc/recog.h
index b4f47430bed..749c64b4d90 100644
--- a/gcc/recog.h
+++ b/gcc/recog.h
@@ -221,7 +221,7 @@ struct insn_operand_data
const char *const constraint;
- const ENUM_BITFIELD(machine_mode) mode : 16;
+ ENUM_BITFIELD(machine_mode) const mode : 16;
const char strict_low;
diff --git a/gcc/reg-stack.c b/gcc/reg-stack.c
index 50bc63fcb0c..228723b8ac5 100644
--- a/gcc/reg-stack.c
+++ b/gcc/reg-stack.c
@@ -249,13 +249,13 @@ static void remove_regno_note (rtx, enum reg_note, unsigned int);
static int get_hard_regnum (stack, rtx);
static rtx emit_pop_insn (rtx, stack, rtx, enum emit_where);
static void emit_swap_insn (rtx, stack, rtx);
-static void move_for_stack_reg (rtx, stack, rtx);
+static bool move_for_stack_reg (rtx, stack, rtx);
static int swap_rtx_condition_1 (rtx);
static int swap_rtx_condition (rtx);
static void compare_for_stack_reg (rtx, stack, rtx);
-static void subst_stack_regs_pat (rtx, stack, rtx);
+static bool subst_stack_regs_pat (rtx, stack, rtx);
static void subst_asm_stack_regs (rtx, stack);
-static void subst_stack_regs (rtx, stack);
+static bool subst_stack_regs (rtx, stack);
static void change_stack (rtx, stack, stack, enum emit_where);
static int convert_regs_entry (void);
static void convert_regs_exit (void);
@@ -336,7 +336,7 @@ next_flags_user (rtx insn)
/* Search forward looking for the first use of this value.
Stop at block boundaries. */
- while (insn != current_block->end)
+ while (insn != BB_END (current_block))
{
insn = NEXT_INSN (insn);
@@ -973,10 +973,10 @@ emit_swap_insn (rtx insn, stack regstack, rtx reg)
/* Find the previous insn involving stack regs, but don't pass a
block boundary. */
i1 = NULL;
- if (current_block && insn != current_block->head)
+ if (current_block && insn != BB_HEAD (current_block))
{
rtx tmp = PREV_INSN (insn);
- rtx limit = PREV_INSN (current_block->head);
+ rtx limit = PREV_INSN (BB_HEAD (current_block));
while (tmp != limit)
{
if (GET_CODE (tmp) == CODE_LABEL
@@ -1022,21 +1022,23 @@ emit_swap_insn (rtx insn, stack regstack, rtx reg)
if (i1)
emit_insn_after (swap_rtx, i1);
else if (current_block)
- emit_insn_before (swap_rtx, current_block->head);
+ emit_insn_before (swap_rtx, BB_HEAD (current_block));
else
emit_insn_before (swap_rtx, insn);
}
/* Handle a move to or from a stack register in PAT, which is in INSN.
- REGSTACK is the current stack. */
+ REGSTACK is the current stack. Return whether a control flow insn
+ was deleted in the process. */
-static void
+static bool
move_for_stack_reg (rtx insn, stack regstack, rtx pat)
{
rtx *psrc = get_true_reg (&SET_SRC (pat));
rtx *pdest = get_true_reg (&SET_DEST (pat));
rtx src, dest;
rtx note;
+ bool control_flow_insn_deleted = false;
src = *psrc; dest = *pdest;
@@ -1066,21 +1068,17 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
If so, just pop the src. */
if (find_regno_note (insn, REG_UNUSED, REGNO (dest)))
+ emit_pop_insn (insn, regstack, src, EMIT_AFTER);
+ else
{
- emit_pop_insn (insn, regstack, src, EMIT_AFTER);
-
- delete_insn (insn);
- return;
+ regstack->reg[i] = REGNO (dest);
+ SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest));
+ CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src));
}
- regstack->reg[i] = REGNO (dest);
-
- SET_HARD_REG_BIT (regstack->reg_set, REGNO (dest));
- CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src));
-
+ control_flow_insn_deleted |= control_flow_insn_p (insn);
delete_insn (insn);
-
- return;
+ return control_flow_insn_deleted;
}
/* The source reg does not die. */
@@ -1095,8 +1093,9 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
if (find_regno_note (insn, REG_UNUSED, REGNO (dest)))
emit_pop_insn (insn, regstack, dest, EMIT_AFTER);
+ control_flow_insn_deleted |= control_flow_insn_p (insn);
delete_insn (insn);
- return;
+ return control_flow_insn_deleted;
}
/* The destination ought to be dead. */
@@ -1124,7 +1123,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
regstack->top--;
CLEAR_HARD_REG_BIT (regstack->reg_set, REGNO (src));
}
- else if ((GET_MODE (src) == XFmode || GET_MODE (src) == TFmode)
+ else if ((GET_MODE (src) == XFmode)
&& regstack->top < REG_STACK_SIZE - 1)
{
/* A 387 cannot write an XFmode value to a MEM without
@@ -1137,10 +1136,7 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
rtx push_rtx, push_insn;
rtx top_stack_reg = FP_MODE_REG (FIRST_STACK_REG, GET_MODE (src));
- if (GET_MODE (src) == TFmode)
- push_rtx = gen_movtf (top_stack_reg, top_stack_reg);
- else
- push_rtx = gen_movxf (top_stack_reg, top_stack_reg);
+ push_rtx = gen_movxf (top_stack_reg, top_stack_reg);
push_insn = emit_insn_before (push_rtx, insn);
REG_NOTES (insn) = gen_rtx_EXPR_LIST (REG_DEAD, top_stack_reg,
REG_NOTES (insn));
@@ -1168,6 +1164,8 @@ move_for_stack_reg (rtx insn, stack regstack, rtx pat)
}
else
abort ();
+
+ return control_flow_insn_deleted;
}
/* Swap the condition on a branch, if there is one. Return true if we
@@ -1234,7 +1232,7 @@ swap_rtx_condition (rtx insn)
/* Search forward looking for the first use of this value.
Stop at block boundaries. */
- while (insn != current_block->end)
+ while (insn != BB_END (current_block))
{
insn = NEXT_INSN (insn);
if (INSN_P (insn) && reg_mentioned_p (dest, insn))
@@ -1379,12 +1377,14 @@ compare_for_stack_reg (rtx insn, stack regstack, rtx pat_src)
}
/* Substitute new registers in PAT, which is part of INSN. REGSTACK
- is the current register layout. */
+ is the current register layout. Return whether a control flow insn
+ was deleted in the process. */
-static void
+static bool
subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
{
rtx *dest, *src;
+ bool control_flow_insn_deleted = false;
switch (GET_CODE (pat))
{
@@ -1396,7 +1396,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
&& find_regno_note (insn, REG_DEAD, REGNO (*src)))
{
emit_pop_insn (insn, regstack, *src, EMIT_AFTER);
- return;
+ return control_flow_insn_deleted;
}
/* ??? Uninitialized USE should not happen. */
else if (get_hard_regnum (regstack, *src) == -1)
@@ -1446,7 +1446,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
FP_MODE_REG (REGNO (*dest), SFmode),
nan);
PATTERN (insn) = pat;
- move_for_stack_reg (insn, regstack, pat);
+ control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat);
}
if (! note && COMPLEX_MODE_P (GET_MODE (*dest))
&& get_hard_regnum (regstack, FP_MODE_REG (REGNO (*dest), DFmode)) == -1)
@@ -1455,7 +1455,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
FP_MODE_REG (REGNO (*dest) + 1, SFmode),
nan);
PATTERN (insn) = pat;
- move_for_stack_reg (insn, regstack, pat);
+ control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat);
}
}
}
@@ -1478,7 +1478,7 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
&& (GET_CODE (*src) == REG || GET_CODE (*src) == MEM
|| GET_CODE (*src) == CONST_DOUBLE)))
{
- move_for_stack_reg (insn, regstack, pat);
+ control_flow_insn_deleted |= move_for_stack_reg (insn, regstack, pat);
break;
}
@@ -1882,6 +1882,8 @@ subst_stack_regs_pat (rtx insn, stack regstack, rtx pat)
default:
break;
}
+
+ return control_flow_insn_deleted;
}
/* Substitute hard regnums for any stack regs in INSN, which has
@@ -2179,12 +2181,14 @@ subst_asm_stack_regs (rtx insn, stack regstack)
/* Substitute stack hard reg numbers for stack virtual registers in
INSN. Non-stack register numbers are not changed. REGSTACK is the
current stack content. Insns may be emitted as needed to arrange the
- stack for the 387 based on the contents of the insn. */
+ stack for the 387 based on the contents of the insn. Return whether
+ a control flow insn was deleted in the process. */
-static void
+static bool
subst_stack_regs (rtx insn, stack regstack)
{
rtx *note_link, note;
+ bool control_flow_insn_deleted = false;
int i;
if (GET_CODE (insn) == CALL_INSN)
@@ -2225,25 +2229,27 @@ subst_stack_regs (rtx insn, stack regstack)
Any REG_UNUSED notes will be handled by subst_asm_stack_regs. */
subst_asm_stack_regs (insn, regstack);
- return;
+ return control_flow_insn_deleted;
}
if (GET_CODE (PATTERN (insn)) == PARALLEL)
for (i = 0; i < XVECLEN (PATTERN (insn), 0); i++)
{
if (stack_regs_mentioned_p (XVECEXP (PATTERN (insn), 0, i)))
- subst_stack_regs_pat (insn, regstack,
- XVECEXP (PATTERN (insn), 0, i));
+ control_flow_insn_deleted
+ |= subst_stack_regs_pat (insn, regstack,
+ XVECEXP (PATTERN (insn), 0, i));
}
else
- subst_stack_regs_pat (insn, regstack, PATTERN (insn));
+ control_flow_insn_deleted
+ |= subst_stack_regs_pat (insn, regstack, PATTERN (insn));
}
/* subst_stack_regs_pat may have deleted a no-op insn. If so, any
REG_UNUSED will already have been dealt with, so just return. */
if (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn))
- return;
+ return control_flow_insn_deleted;
/* If there is a REG_UNUSED note on a stack register on this insn,
the indicated reg must be popped. The REG_UNUSED note is removed,
@@ -2259,6 +2265,8 @@ subst_stack_regs (rtx insn, stack regstack)
}
else
note_link = &XEXP (note, 1);
+
+ return control_flow_insn_deleted;
}
/* Change the organization of the stack so that it fits a new basic
@@ -2284,7 +2292,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where)
if (where == EMIT_AFTER)
{
- if (current_block && current_block->end == insn)
+ if (current_block && BB_END (current_block) == insn)
update_end = 1;
insn = NEXT_INSN (insn);
}
@@ -2367,7 +2375,7 @@ change_stack (rtx insn, stack old, stack new, enum emit_where where)
}
if (update_end)
- current_block->end = PREV_INSN (insn);
+ BB_END (current_block) = PREV_INSN (insn);
}
/* Print stack configuration. */
@@ -2528,7 +2536,7 @@ compensate_edge (edge e, FILE *file)
/* change_stack kills values in regstack. */
tmpstack = regstack;
- change_stack (block->end, &tmpstack, target_stack, EMIT_AFTER);
+ change_stack (BB_END (block), &tmpstack, target_stack, EMIT_AFTER);
return false;
}
@@ -2599,8 +2607,8 @@ compensate_edge (edge e, FILE *file)
/* change_stack kills values in regstack. */
tmpstack = regstack;
- change_stack (block->end, &tmpstack, target_stack,
- (GET_CODE (block->end) == JUMP_INSN
+ change_stack (BB_END (block), &tmpstack, target_stack,
+ (GET_CODE (BB_END (block)) == JUMP_INSN
? EMIT_BEFORE : EMIT_AFTER));
}
else
@@ -2641,6 +2649,7 @@ convert_regs_1 (FILE *file, basic_block block)
int deleted, inserted, reg;
rtx insn, next;
edge e, beste = NULL;
+ bool control_flow_insn_deleted = false;
inserted = 0;
deleted = 0;
@@ -2705,7 +2714,7 @@ convert_regs_1 (FILE *file, basic_block block)
/* Process all insns in this block. Keep track of NEXT so that we
don't process insns emitted while substituting in INSN. */
- next = block->head;
+ next = BB_HEAD (block);
regstack = bi->stack_in;
do
{
@@ -2715,7 +2724,7 @@ convert_regs_1 (FILE *file, basic_block block)
/* Ensure we have not missed a block boundary. */
if (next == NULL)
abort ();
- if (insn == block->end)
+ if (insn == BB_END (block))
next = NULL;
/* Don't bother processing unless there is a stack reg
@@ -2729,8 +2738,7 @@ convert_regs_1 (FILE *file, basic_block block)
INSN_UID (insn));
print_stack (file, &regstack);
}
- subst_stack_regs (insn, &regstack);
- deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn));
+ control_flow_insn_deleted |= subst_stack_regs (insn, &regstack);
}
}
while (next);
@@ -2745,7 +2753,7 @@ convert_regs_1 (FILE *file, basic_block block)
print_stack (file, &regstack);
}
- insn = block->end;
+ insn = BB_END (block);
if (GET_CODE (insn) == JUMP_INSN)
insn = PREV_INSN (insn);
@@ -2769,8 +2777,7 @@ convert_regs_1 (FILE *file, basic_block block)
set = gen_rtx_SET (VOIDmode, FP_MODE_REG (reg, SFmode),
nan);
insn = emit_insn_after (set, insn);
- subst_stack_regs (insn, &regstack);
- deleted |= (GET_CODE (insn) == NOTE || INSN_DELETED_P (insn));
+ control_flow_insn_deleted |= subst_stack_regs (insn, &regstack);
}
}
@@ -2780,12 +2787,18 @@ convert_regs_1 (FILE *file, basic_block block)
called at the end of convert_regs. The order in which we process the
blocks ensures that we never delete an already processed edge.
+ Note that, at this point, the CFG may have been damaged by the emission
+ of instructions after an abnormal call, which moves the basic block end
+ (and is the reason why we call fixup_abnormal_edges later). So we must
+ be sure that the trapping insn has been deleted before trying to purge
+ dead edges, otherwise we risk purging valid edges.
+
??? We are normally supposed not to delete trapping insns, so we pretend
that the insns deleted above don't actually trap. It would have been
better to detect this earlier and avoid creating the EH edge in the first
place, still, but we don't have enough information at that time. */
- if (deleted)
+ if (control_flow_insn_deleted)
purge_dead_edges (block);
/* Something failed if the stack lives don't match. If we had malformed
diff --git a/gcc/regclass.c b/gcc/regclass.c
index f16f03aa1b6..2e4dc61be32 100644
--- a/gcc/regclass.c
+++ b/gcc/regclass.c
@@ -321,10 +321,7 @@ init_reg_sets_1 (void)
{
for (j = 0; j < N_REG_CLASSES; j++)
{
-#ifdef HARD_REG_SET
- register /* Declare it register if it's a scalar. */
-#endif
- HARD_REG_SET c;
+ HARD_REG_SET c;
int k;
COPY_HARD_REG_SET (c, reg_class_contents[i]);
@@ -355,10 +352,7 @@ init_reg_sets_1 (void)
{
for (j = 0; j < N_REG_CLASSES; j++)
{
-#ifdef HARD_REG_SET
- register /* Declare it register if it's a scalar. */
-#endif
- HARD_REG_SET c;
+ HARD_REG_SET c;
int k;
COPY_HARD_REG_SET (c, reg_class_contents[i]);
@@ -1085,8 +1079,8 @@ scan_one_insn (rtx insn, int pass)
{
basic_block b;
FOR_EACH_BB (b)
- if (insn == b->head)
- b->head = newinsn;
+ if (insn == BB_HEAD (b))
+ BB_HEAD (b) = newinsn;
}
/* This makes one more setting of new insns's dest. */
@@ -1240,10 +1234,10 @@ regclass (rtx f, int nregs, FILE *dump)
aggressive than the assumptions made elsewhere and is being
tried as an experiment. */
frequency = REG_FREQ_FROM_BB (bb);
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
insn = scan_one_insn (insn, pass);
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
}
@@ -2293,21 +2287,20 @@ reg_scan (rtx f, unsigned int nregs, int repeat ATTRIBUTE_UNUSED)
{
rtx insn;
+ timevar_push (TV_REG_SCAN);
+
allocate_reg_info (nregs, TRUE, FALSE);
max_parallel = 3;
max_set_parallel = 0;
- timevar_push (TV_REG_SCAN);
-
for (insn = f; insn; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == INSN
- || GET_CODE (insn) == CALL_INSN
- || GET_CODE (insn) == JUMP_INSN)
+ if (INSN_P (insn))
{
- if (GET_CODE (PATTERN (insn)) == PARALLEL
- && XVECLEN (PATTERN (insn), 0) > max_parallel)
- max_parallel = XVECLEN (PATTERN (insn), 0);
- reg_scan_mark_refs (PATTERN (insn), insn, 0, 0);
+ rtx pat = PATTERN (insn);
+ if (GET_CODE (pat) == PARALLEL
+ && XVECLEN (pat, 0) > max_parallel)
+ max_parallel = XVECLEN (pat, 0);
+ reg_scan_mark_refs (pat, insn, 0, 0);
if (REG_NOTES (insn))
reg_scan_mark_refs (REG_NOTES (insn), insn, 1, 0);
@@ -2331,14 +2324,13 @@ reg_scan_update (rtx first, rtx last, unsigned int old_max_regno)
allocate_reg_info (max_reg_num (), FALSE, FALSE);
for (insn = first; insn != last; insn = NEXT_INSN (insn))
- if (GET_CODE (insn) == INSN
- || GET_CODE (insn) == CALL_INSN
- || GET_CODE (insn) == JUMP_INSN)
+ if (INSN_P (insn))
{
- if (GET_CODE (PATTERN (insn)) == PARALLEL
- && XVECLEN (PATTERN (insn), 0) > max_parallel)
- max_parallel = XVECLEN (PATTERN (insn), 0);
- reg_scan_mark_refs (PATTERN (insn), insn, 0, old_max_regno);
+ rtx pat = PATTERN (insn);
+ if (GET_CODE (pat) == PARALLEL
+ && XVECLEN (pat, 0) > max_parallel)
+ max_parallel = XVECLEN (pat, 0);
+ reg_scan_mark_refs (pat, insn, 0, old_max_regno);
if (REG_NOTES (insn))
reg_scan_mark_refs (REG_NOTES (insn), insn, 1, old_max_regno);
@@ -2414,6 +2406,8 @@ reg_scan_mark_refs (rtx x, rtx insn, int note_flag, unsigned int min_regno)
REG_N_SETS (REGNO (reg))++;
REG_N_REFS (REGNO (reg))++;
}
+ else if (GET_CODE (reg) == MEM)
+ reg_scan_mark_refs (XEXP (reg, 0), insn, note_flag, min_regno);
}
break;
@@ -2546,10 +2540,7 @@ reg_class_subset_p (enum reg_class c1, enum reg_class c2)
int
reg_classes_intersect_p (enum reg_class c1, enum reg_class c2)
{
-#ifdef HARD_REG_SET
- register
-#endif
- HARD_REG_SET c;
+ HARD_REG_SET c;
if (c1 == c2) return 1;
diff --git a/gcc/regmove.c b/gcc/regmove.c
index 8696d3a5ed1..c6c30d10706 100644
--- a/gcc/regmove.c
+++ b/gcc/regmove.c
@@ -256,8 +256,8 @@ mark_flags_life_zones (rtx flags)
rtx insn, end;
int live;
- insn = block->head;
- end = block->end;
+ insn = BB_HEAD (block);
+ end = BB_END (block);
/* Look out for the (unlikely) case of flags being live across
basic block boundaries. */
@@ -810,7 +810,7 @@ copy_src_to_dest (rtx insn, rtx src, rtx dest, int old_max_uid)
bb = regmove_bb_head[insn_uid];
if (bb >= 0)
{
- BLOCK_HEAD (bb) = move_insn;
+ BB_HEAD (BASIC_BLOCK (bb)) = move_insn;
regmove_bb_head[insn_uid] = -1;
}
}
@@ -1061,7 +1061,7 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
regmove_bb_head = xmalloc (sizeof (int) * (old_max_uid + 1));
for (i = old_max_uid; i >= 0; i--) regmove_bb_head[i] = -1;
FOR_EACH_BB (bb)
- regmove_bb_head[INSN_UID (bb->head)] = bb->index;
+ regmove_bb_head[INSN_UID (BB_HEAD (bb))] = bb->index;
/* A forward/backward pass. Replace output operands with input operands. */
@@ -1491,13 +1491,13 @@ regmove_optimize (rtx f, int nregs, FILE *regmove_dump_file)
ends. Fix that here. */
FOR_EACH_BB (bb)
{
- rtx end = bb->end;
+ rtx end = BB_END (bb);
rtx new = end;
rtx next = NEXT_INSN (new);
while (next != 0 && INSN_UID (next) >= old_max_uid
- && (bb->next_bb == EXIT_BLOCK_PTR || bb->next_bb->head != next))
+ && (bb->next_bb == EXIT_BLOCK_PTR || BB_HEAD (bb->next_bb) != next))
new = next, next = NEXT_INSN (new);
- bb->end = new;
+ BB_END (bb) = new;
}
done:
@@ -2304,9 +2304,9 @@ combine_stack_adjustments_for_block (basic_block bb)
struct record_stack_memrefs_data data;
bool end_of_block = false;
- for (insn = bb->head; !end_of_block ; insn = next)
+ for (insn = BB_HEAD (bb); !end_of_block ; insn = next)
{
- end_of_block = insn == bb->end;
+ end_of_block = insn == BB_END (bb);
next = NEXT_INSN (insn);
if (! INSN_P (insn))
diff --git a/gcc/regrename.c b/gcc/regrename.c
index 4e93fab796b..1c6ad8d9614 100644
--- a/gcc/regrename.c
+++ b/gcc/regrename.c
@@ -149,7 +149,7 @@ merge_overlapping_regs (basic_block b, HARD_REG_SET *pset,
HARD_REG_SET live;
REG_SET_TO_HARD_REG_SET (live, b->global_live_at_start);
- insn = b->head;
+ insn = BB_HEAD (b);
while (t)
{
/* Search forward until the next reference to the register to be
@@ -729,7 +729,7 @@ build_def_use (basic_block bb)
open_chains = closed_chains = NULL;
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
if (INSN_P (insn))
{
@@ -954,7 +954,7 @@ build_def_use (basic_block bb)
scan_rtx (insn, &XEXP (note, 0), NO_REGS, terminate_dead,
OP_IN, 0);
}
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
@@ -1339,15 +1339,20 @@ find_oldest_value_reg (enum reg_class class, rtx reg, struct value_data *vd)
{
enum machine_mode oldmode = vd->e[i].mode;
rtx new;
-
- if (TEST_HARD_REG_BIT (reg_class_contents[class], i)
- && (new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i,
- regno)))
- {
- ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg);
- REG_ATTRS (new) = REG_ATTRS (reg);
- return new;
- }
+ int j;
+
+ for (j = 0; j < HARD_REGNO_NREGS (regno, mode); ++j)
+ if (!TEST_HARD_REG_BIT (reg_class_contents[class], i + j))
+ return NULL_RTX;
+
+ new = maybe_mode_change (oldmode, vd->e[regno].mode, mode, i,
+ regno);
+ if (new)
+ {
+ ORIGINAL_REGNO (new) = ORIGINAL_REGNO (reg);
+ REG_ATTRS (new) = REG_ATTRS (reg);
+ return new;
+ }
}
return NULL_RTX;
@@ -1525,7 +1530,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
bool changed = false;
rtx insn;
- for (insn = bb->head; ; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb); ; insn = NEXT_INSN (insn))
{
int n_ops, i, alt, predicated;
bool is_asm;
@@ -1533,7 +1538,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
if (! INSN_P (insn))
{
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
else
continue;
@@ -1709,7 +1714,7 @@ copyprop_hardreg_forward_1 (basic_block bb, struct value_data *vd)
if (set && REG_P (SET_DEST (set)) && REG_P (SET_SRC (set)))
copy_value (SET_DEST (set), SET_SRC (set), vd);
- if (insn == bb->end)
+ if (insn == BB_END (bb))
break;
}
@@ -1734,7 +1739,7 @@ copyprop_hardreg_forward (void)
/* If a block has a single predecessor, that we've already
processed, begin with the value data that was live at
the end of the predecessor block. */
- /* ??? Ought to use more intelligent queueing of blocks. */
+ /* ??? Ought to use more intelligent queuing of blocks. */
if (bb->pred)
for (bbp = bb; bbp && bbp != bb->pred->src; bbp = bbp->prev_bb);
if (bb->pred
diff --git a/gcc/regs.h b/gcc/regs.h
index b2aeb5fb02c..9c9edccb26b 100644
--- a/gcc/regs.h
+++ b/gcc/regs.h
@@ -153,11 +153,14 @@ extern bitmap_head subregs_of_mode;
extern short *reg_renumber;
-/* Vector indexed by hardware reg
- saying whether that reg is ever used. */
+/* Vector indexed by hardware reg saying whether that reg is ever used. */
extern char regs_ever_live[FIRST_PSEUDO_REGISTER];
+/* Like regs_ever_live, but saying whether reg is set by asm statements. */
+
+extern char regs_asm_clobbered[FIRST_PSEUDO_REGISTER];
+
/* For each hard register, the widest mode object that it can contain.
This will be a MODE_INT mode if the register can hold integers. Otherwise
it will be a MODE_FLOAT or a MODE_CC mode, whichever is valid for the
diff --git a/gcc/reload.c b/gcc/reload.c
index 59852ba2b5e..13f6900ce3d 100644
--- a/gcc/reload.c
+++ b/gcc/reload.c
@@ -3264,17 +3264,18 @@ find_reloads (rtx insn, int replace, int ind_levels, int live_known,
win = 1;
/* If the address was already reloaded,
we win as well. */
- if (GET_CODE (operand) == MEM && address_reloaded[i])
+ else if (GET_CODE (operand) == MEM
+ && address_reloaded[i])
win = 1;
/* Likewise if the address will be reloaded because
reg_equiv_address is nonzero. For reg_equiv_mem
we have to check. */
- if (GET_CODE (operand) == REG
- && REGNO (operand) >= FIRST_PSEUDO_REGISTER
- && reg_renumber[REGNO (operand)] < 0
- && ((reg_equiv_mem[REGNO (operand)] != 0
- && EXTRA_CONSTRAINT_STR (reg_equiv_mem[REGNO (operand)], c, p))
- || (reg_equiv_address[REGNO (operand)] != 0)))
+ else if (GET_CODE (operand) == REG
+ && REGNO (operand) >= FIRST_PSEUDO_REGISTER
+ && reg_renumber[REGNO (operand)] < 0
+ && ((reg_equiv_mem[REGNO (operand)] != 0
+ && EXTRA_CONSTRAINT_STR (reg_equiv_mem[REGNO (operand)], c, p))
+ || (reg_equiv_address[REGNO (operand)] != 0)))
win = 1;
/* If we didn't already win, we can reload
@@ -4883,7 +4884,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
&& GET_CODE (XEXP (ad, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (ad, 0), 0)) == REG
&& REGNO (XEXP (XEXP (ad, 0), 0)) < FIRST_PSEUDO_REGISTER
- && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode)
+ && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 0), mode)
+ || XEXP (XEXP (ad, 0), 0) == frame_pointer_rtx
+#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 0) == hard_frame_pointer_rtx
+#endif
+#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 0) == arg_pointer_rtx
+#endif
+ || XEXP (XEXP (ad, 0), 0) == stack_pointer_rtx)
&& ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 1)))
{
*loc = ad = gen_rtx_PLUS (GET_MODE (ad),
@@ -4903,7 +4912,15 @@ find_reloads_address (enum machine_mode mode, rtx *memrefloc, rtx ad,
&& GET_CODE (XEXP (ad, 0)) == PLUS
&& GET_CODE (XEXP (XEXP (ad, 0), 1)) == REG
&& REGNO (XEXP (XEXP (ad, 0), 1)) < FIRST_PSEUDO_REGISTER
- && REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode)
+ && (REG_MODE_OK_FOR_BASE_P (XEXP (XEXP (ad, 0), 1), mode)
+ || XEXP (XEXP (ad, 0), 1) == frame_pointer_rtx
+#if FRAME_POINTER_REGNUM != HARD_FRAME_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 1) == hard_frame_pointer_rtx
+#endif
+#if FRAME_POINTER_REGNUM != ARG_POINTER_REGNUM
+ || XEXP (XEXP (ad, 0), 1) == arg_pointer_rtx
+#endif
+ || XEXP (XEXP (ad, 0), 1) == stack_pointer_rtx)
&& ! maybe_memory_address_p (mode, ad, &XEXP (XEXP (ad, 0), 0)))
{
*loc = ad = gen_rtx_PLUS (GET_MODE (ad),
@@ -6273,8 +6290,22 @@ reg_overlap_mentioned_for_reload_p (rtx x, rtx in)
|| GET_CODE (x) == CC0)
return reg_mentioned_p (x, in);
else if (GET_CODE (x) == PLUS)
- return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
- || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));
+ {
+ /* We actually want to know if X is mentioned somewhere inside IN.
+ We must not say that (plus (sp) (const_int 124)) is in
+ (plus (sp) (const_int 64)), since that can lead to incorrect reload
+ allocation when spuriously changing a RELOAD_FOR_OUTPUT_ADDRESS
+ into a RELOAD_OTHER on behalf of another RELOAD_OTHER. */
+ while (GET_CODE (in) == MEM)
+ in = XEXP (in, 0);
+ if (GET_CODE (in) == REG)
+ return 0;
+ else if (GET_CODE (in) == PLUS)
+ return (reg_overlap_mentioned_for_reload_p (x, XEXP (in, 0))
+ || reg_overlap_mentioned_for_reload_p (x, XEXP (in, 1)));
+ else return (reg_overlap_mentioned_for_reload_p (XEXP (x, 0), in)
+ || reg_overlap_mentioned_for_reload_p (XEXP (x, 1), in));
+ }
else
abort ();
diff --git a/gcc/reload1.c b/gcc/reload1.c
index ecab52b68ee..9a0ad894746 100644
--- a/gcc/reload1.c
+++ b/gcc/reload1.c
@@ -77,10 +77,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
reload needs, spilling, assigning reload registers to use for
fixing up each insn, and generating the new insns to copy values
into the reload registers. */
-
-#ifndef LOCAL_REGNO
-#define LOCAL_REGNO(REGNO) 0
-#endif
/* During reload_as_needed, element N contains a REG rtx for the hard reg
into which reg N has been reloaded (perhaps for a previous insn). */
@@ -142,6 +138,11 @@ static HARD_REG_SET reg_reloaded_valid;
This is only valid if reg_reloaded_contents is set and valid. */
static HARD_REG_SET reg_reloaded_dead;
+/* Indicate whether the register's current value is one that is not
+ safe to retain across a call, even for registers that are normally
+ call-saved. */
+static HARD_REG_SET reg_reloaded_call_part_clobbered;
+
/* Number of spill-regs so far; number of valid elements of spill_regs. */
static int n_spills;
@@ -293,12 +294,12 @@ struct elim_table
{
int from; /* Register number to be eliminated. */
int to; /* Register number used as replacement. */
- int initial_offset; /* Initial difference between values. */
+ HOST_WIDE_INT initial_offset; /* Initial difference between values. */
int can_eliminate; /* Nonzero if this elimination can be done. */
int can_eliminate_previous; /* Value of CAN_ELIMINATE in previous scan over
insns made by reload. */
- int offset; /* Current offset between the two regs. */
- int previous_offset; /* Offset at end of previous insn. */
+ HOST_WIDE_INT offset; /* Current offset between the two regs. */
+ HOST_WIDE_INT previous_offset;/* Offset at end of previous insn. */
int ref_outside_mem; /* "to" has been referenced outside a MEM. */
rtx from_rtx; /* REG rtx for the register to be eliminated.
We cannot simply compare the number since
@@ -352,7 +353,7 @@ static int num_eliminable_invariants;
static int first_label_num;
static char *offsets_known_at;
-static int (*offsets_at)[NUM_ELIMINABLE_REGS];
+static HOST_WIDE_INT (*offsets_at)[NUM_ELIMINABLE_REGS];
/* Number of labels in the current function. */
@@ -673,6 +674,17 @@ reload (rtx first, int global)
if (! call_used_regs[i] && ! fixed_regs[i] && ! LOCAL_REGNO (i))
regs_ever_live[i] = 1;
+#ifdef NON_SAVING_SETJMP
+ /* A function that calls setjmp should save and restore all the
+ call-saved registers on a system where longjmp clobbers them. */
+ if (NON_SAVING_SETJMP && current_function_calls_setjmp)
+ {
+ for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
+ if (! call_used_regs[i])
+ regs_ever_live[i] = 1;
+ }
+#endif
+
/* Find all the pseudo registers that didn't get hard regs
but do have known equivalent constants or memory slots.
These include parameters (known equivalent to parameter slots)
@@ -698,9 +710,7 @@ reload (rtx first, int global)
/* Look for REG_EQUIV notes; record what each pseudo is equivalent to.
Also find all paradoxical subregs and find largest such for each pseudo.
On machines with small register classes, record hard registers that
- are used for user variables. These can never be used for spills.
- Also look for a "constant" REG_SETJMP. This means that all
- caller-saved registers must be marked live. */
+ are used for user variables. These can never be used for spills. */
num_eliminable_invariants = 0;
for (insn = first; insn; insn = NEXT_INSN (insn))
@@ -714,12 +724,6 @@ reload (rtx first, int global)
&& GET_MODE (insn) != VOIDmode)
PUT_MODE (insn, VOIDmode);
- if (GET_CODE (insn) == CALL_INSN
- && find_reg_note (insn, REG_SETJMP, NULL))
- for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
- if (! call_used_regs[i])
- regs_ever_live[i] = 1;
-
if (set != 0 && GET_CODE (SET_DEST (set)) == REG)
{
rtx note = find_reg_note (insn, REG_EQUIV, NULL_RTX);
@@ -816,7 +820,7 @@ reload (rtx first, int global)
allocate would occasionally cause it to exceed the stack limit and
cause a core dump. */
offsets_known_at = xmalloc (num_labels);
- offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (int));
+ offsets_at = xmalloc (num_labels * NUM_ELIMINABLE_REGS * sizeof (HOST_WIDE_INT));
/* Alter each pseudo-reg rtx to contain its hard reg number.
Assign stack slots to the pseudos that lack hard regs or equivalents.
@@ -1249,6 +1253,14 @@ reload (rtx first, int global)
by this, so unshare everything here. */
unshare_all_rtl_again (first);
+#ifdef STACK_BOUNDARY
+ /* init_emit has set the alignment of the hard frame pointer
+ to STACK_BOUNDARY. It is very likely no longer valid if
+ the hard frame pointer was used for register allocation. */
+ if (!frame_pointer_needed)
+ REGNO_POINTER_ALIGN (HARD_FRAME_POINTER_REGNUM) = BITS_PER_UNIT;
+#endif
+
return failure;
}
@@ -2897,7 +2909,7 @@ eliminate_regs_in_insn (rtx insn, int replace)
{
rtx base = SET_SRC (old_set);
rtx base_insn = insn;
- int offset = 0;
+ HOST_WIDE_INT offset = 0;
while (base != ep->to_rtx)
{
@@ -2980,7 +2992,7 @@ eliminate_regs_in_insn (rtx insn, int replace)
&& REGNO (XEXP (SET_SRC (old_set), 0)) < FIRST_PSEUDO_REGISTER)
{
rtx reg = XEXP (SET_SRC (old_set), 0);
- int offset = INTVAL (XEXP (SET_SRC (old_set), 1));
+ HOST_WIDE_INT offset = INTVAL (XEXP (SET_SRC (old_set), 1));
for (ep = reg_eliminate; ep < &reg_eliminate[NUM_ELIMINABLE_REGS]; ep++)
if (ep->from_rtx == reg && ep->can_eliminate)
@@ -3263,7 +3275,7 @@ mark_not_eliminable (rtx dest, rtx x, void *data ATTRIBUTE_UNUSED)
static void
verify_initial_elim_offsets (void)
{
- int t;
+ HOST_WIDE_INT t;
#ifdef ELIMINABLE_REGS
struct elim_table *ep;
@@ -3436,7 +3448,6 @@ init_elim_table (void)
/* Does this function require a frame pointer? */
frame_pointer_needed = (! flag_omit_frame_pointer
-#ifdef EXIT_IGNORE_STACK
/* ?? If EXIT_IGNORE_STACK is set, we will not save
and restore sp for alloca. So we can't eliminate
the frame pointer in that case. At some point,
@@ -3444,7 +3455,6 @@ init_elim_table (void)
sp-adjusting insns for this case. */
|| (current_function_calls_alloca
&& EXIT_IGNORE_STACK)
-#endif
|| FRAME_POINTER_REQUIRED);
num_eliminable = 0;
@@ -3752,6 +3762,7 @@ reload_as_needed (int live_known)
reg_last_reload_reg = xcalloc (max_regno, sizeof (rtx));
reg_has_output_reload = xmalloc (max_regno);
CLEAR_HARD_REG_SET (reg_reloaded_valid);
+ CLEAR_HARD_REG_SET (reg_reloaded_call_part_clobbered);
set_initial_elim_offsets ();
@@ -3999,9 +4010,13 @@ reload_as_needed (int live_known)
CLEAR_HARD_REG_SET (reg_reloaded_valid);
/* Don't assume a reload reg is still good after a call insn
- if it is a call-used reg. */
+ if it is a call-used reg, or if it contains a value that will
+ be partially clobbered by the call. */
else if (GET_CODE (insn) == CALL_INSN)
+ {
AND_COMPL_HARD_REG_SET (reg_reloaded_valid, call_used_reg_set);
+ AND_COMPL_HARD_REG_SET (reg_reloaded_valid, reg_reloaded_call_part_clobbered);
+ }
}
/* Clean up. */
@@ -4056,6 +4071,7 @@ forget_old_reloads_1 (rtx x, rtx ignored ATTRIBUTE_UNUSED,
|| ! TEST_HARD_REG_BIT (reg_is_output_reload, regno + i))
{
CLEAR_HARD_REG_BIT (reg_reloaded_valid, regno + i);
+ CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, regno + i);
spill_reg_store[regno + i] = 0;
}
}
@@ -7038,7 +7054,10 @@ emit_reload_insns (struct insn_chain *chain)
If consecutive registers are used, clear them all. */
for (k = 0; k < nr; k++)
+ {
CLEAR_HARD_REG_BIT (reg_reloaded_valid, i + k);
+ CLEAR_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k);
+ }
/* Maybe the spill reg contains a copy of reload_out. */
if (rld[r].out != 0
@@ -7085,6 +7104,8 @@ emit_reload_insns (struct insn_chain *chain)
: nregno + k);
reg_reloaded_insn[i + k] = insn;
SET_HARD_REG_BIT (reg_reloaded_valid, i + k);
+ if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (out)))
+ SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k);
}
}
@@ -7102,14 +7123,16 @@ emit_reload_insns (struct insn_chain *chain)
{
int nregno;
int nnr;
+ rtx in;
if (GET_CODE (rld[r].in) == REG
&& REGNO (rld[r].in) >= FIRST_PSEUDO_REGISTER)
- nregno = REGNO (rld[r].in);
+ in = rld[r].in;
else if (GET_CODE (rld[r].in_reg) == REG)
- nregno = REGNO (rld[r].in_reg);
+ in = rld[r].in_reg;
else
- nregno = REGNO (XEXP (rld[r].in_reg, 0));
+ in = XEXP (rld[r].in_reg, 0);
+ nregno = REGNO (in);
nnr = (nregno >= FIRST_PSEUDO_REGISTER ? 1
: HARD_REGNO_NREGS (nregno,
@@ -7141,6 +7164,8 @@ emit_reload_insns (struct insn_chain *chain)
: nregno + k);
reg_reloaded_insn[i + k] = insn;
SET_HARD_REG_BIT (reg_reloaded_valid, i + k);
+ if (HARD_REGNO_CALL_PART_CLOBBERED (i + k, GET_MODE (in)))
+ SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered, i + k);
}
}
}
@@ -7227,6 +7252,10 @@ emit_reload_insns (struct insn_chain *chain)
reg_reloaded_insn[src_regno + nr] = store_insn;
CLEAR_HARD_REG_BIT (reg_reloaded_dead, src_regno + nr);
SET_HARD_REG_BIT (reg_reloaded_valid, src_regno + nr);
+ if (HARD_REGNO_CALL_PART_CLOBBERED (src_regno + nr,
+ GET_MODE (src_reg)))
+ SET_HARD_REG_BIT (reg_reloaded_call_part_clobbered,
+ src_regno + nr);
SET_HARD_REG_BIT (reg_is_output_reload, src_regno + nr);
if (note)
SET_HARD_REG_BIT (reg_reloaded_died, src_regno);
@@ -7956,9 +7985,10 @@ fixup_abnormal_edges (void)
== (EDGE_ABNORMAL | EDGE_EH))
break;
}
- if (e && GET_CODE (bb->end) != CALL_INSN && !can_throw_internal (bb->end))
+ if (e && GET_CODE (BB_END (bb)) != CALL_INSN
+ && !can_throw_internal (BB_END (bb)))
{
- rtx insn = bb->end, stop = NEXT_INSN (bb->end);
+ rtx insn = BB_END (bb), stop = NEXT_INSN (BB_END (bb));
rtx next;
for (e = bb->succ; e; e = e->succ_next)
if (e->flags & EDGE_FALLTHRU)
@@ -7967,11 +7997,11 @@ fixup_abnormal_edges (void)
be already deleted. */
while ((GET_CODE (insn) == INSN || GET_CODE (insn) == NOTE)
&& !can_throw_internal (insn)
- && insn != bb->head)
+ && insn != BB_HEAD (bb))
insn = PREV_INSN (insn);
if (GET_CODE (insn) != CALL_INSN && !can_throw_internal (insn))
abort ();
- bb->end = insn;
+ BB_END (bb) = insn;
inserted = true;
insn = NEXT_INSN (insn);
while (insn && insn != stop)
diff --git a/gcc/reorg.c b/gcc/reorg.c
index 6a13fe0634b..46b66577980 100644
--- a/gcc/reorg.c
+++ b/gcc/reorg.c
@@ -2427,10 +2427,8 @@ fill_simple_delay_slots (int non_jumps_p)
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
SET_HARD_REG_BIT (needed.regs, HARD_FRAME_POINTER_REGNUM);
#endif
-#ifdef EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK
|| current_function_sp_is_unchanging)
-#endif
SET_HARD_REG_BIT (needed.regs, STACK_POINTER_REGNUM);
}
else
diff --git a/gcc/resource.c b/gcc/resource.c
index 2aab94c525d..240cf232334 100644
--- a/gcc/resource.c
+++ b/gcc/resource.c
@@ -155,7 +155,7 @@ find_basic_block (rtx insn, int search_limit)
insn = next_nonnote_insn (insn))
{
FOR_EACH_BB (bb)
- if (insn == bb->head)
+ if (insn == BB_HEAD (bb))
return bb->index;
}
@@ -616,7 +616,7 @@ find_dead_or_set_registers (rtx target, struct resources *res,
/* Given X, a part of an insn, and a pointer to a `struct resource',
RES, indicate which resources are modified by the insn. If
MARK_TYPE is MARK_SRC_DEST_CALL, also mark resources potentially
- set by the called routine. If MARK_TYPE is MARK_DEST, only mark SET_DESTs
+ set by the called routine.
If IN_DEST is nonzero, it means we are inside a SET. Otherwise,
objects are being referenced instead of set.
@@ -716,8 +716,7 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
|| GET_CODE (SET_SRC (x)) != CALL),
mark_type);
- if (mark_type != MARK_DEST)
- mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST);
+ mark_set_resources (SET_SRC (x), res, 0, MARK_SRC_DEST);
return;
case CLOBBER:
@@ -747,12 +746,9 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
case SIGN_EXTRACT:
case ZERO_EXTRACT:
- if (! (mark_type == MARK_DEST && in_dest))
- {
- mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST);
- mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST);
- mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST);
- }
+ mark_set_resources (XEXP (x, 0), res, in_dest, MARK_SRC_DEST);
+ mark_set_resources (XEXP (x, 1), res, 0, MARK_SRC_DEST);
+ mark_set_resources (XEXP (x, 2), res, 0, MARK_SRC_DEST);
return;
case MEM:
@@ -799,13 +795,6 @@ mark_set_resources (rtx x, struct resources *res, int in_dest,
}
return;
- case STRICT_LOW_PART:
- if (! (mark_type == MARK_DEST && in_dest))
- {
- mark_set_resources (XEXP (x, 0), res, 0, MARK_SRC_DEST);
- return;
- }
-
case UNSPEC_VOLATILE:
case ASM_INPUT:
/* Traditional asm's are always volatile. */
@@ -924,7 +913,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
information, we can get it from there unless the insn at the
start of the basic block has been deleted. */
if (tinfo && tinfo->block != -1
- && ! INSN_DELETED_P (BLOCK_HEAD (tinfo->block)))
+ && ! INSN_DELETED_P (BB_HEAD (BASIC_BLOCK (tinfo->block))))
b = tinfo->block;
}
@@ -990,7 +979,7 @@ mark_target_live_regs (rtx insns, rtx target, struct resources *res)
/* Get starting and ending insn, handling the case where each might
be a SEQUENCE. */
- start_insn = (b == 0 ? insns : BLOCK_HEAD (b));
+ start_insn = (b == 0 ? insns : BB_HEAD (BASIC_BLOCK (b)));
stop_insn = target;
if (GET_CODE (start_insn) == INSN
@@ -1178,10 +1167,8 @@ init_resource_info (rtx epilogue_insn)
#if HARD_FRAME_POINTER_REGNUM != FRAME_POINTER_REGNUM
SET_HARD_REG_BIT (end_of_function_needs.regs, HARD_FRAME_POINTER_REGNUM);
#endif
-#ifdef EXIT_IGNORE_STACK
if (! EXIT_IGNORE_STACK
|| current_function_sp_is_unchanging)
-#endif
SET_HARD_REG_BIT (end_of_function_needs.regs, STACK_POINTER_REGNUM);
}
else
diff --git a/gcc/resource.h b/gcc/resource.h
index b738a0c504f..96eff6ed1ff 100644
--- a/gcc/resource.h
+++ b/gcc/resource.h
@@ -37,8 +37,7 @@ struct resources
enum mark_resource_type
{
MARK_SRC_DEST = 0,
- MARK_SRC_DEST_CALL = 1,
- MARK_DEST = 2
+ MARK_SRC_DEST_CALL = 1
};
extern void mark_target_live_regs (rtx, rtx, struct resources *);
diff --git a/gcc/rtl.c b/gcc/rtl.c
index 72ff89f6ace..313e2cb2b5c 100644
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -138,6 +138,14 @@ const char * const reg_note_name[] =
"REG_VTABLE_REF"
};
+
+#ifdef GATHER_STATISTICS
+static int rtx_alloc_counts[(int) LAST_AND_UNUSED_RTX_CODE];
+static int rtx_alloc_sizes[(int) LAST_AND_UNUSED_RTX_CODE];
+static int rtvec_alloc_counts;
+static int rtvec_alloc_sizes;
+#endif
+
/* Allocate an rtx vector of N elements.
Store the length, and initialize all elements to zero. */
@@ -152,6 +160,12 @@ rtvec_alloc (int n)
memset (&rt->elem[0], 0, n * sizeof (rtx));
PUT_NUM_ELEM (rt, n);
+
+#ifdef GATHER_STATISTICS
+ rtvec_alloc_counts++;
+ rtvec_alloc_sizes += n * sizeof (rtx);
+#endif
+
return rt;
}
@@ -171,6 +185,12 @@ rtx_alloc (RTX_CODE code)
memset (rt, 0, RTX_HDR_SIZE);
PUT_CODE (rt, code);
+
+#ifdef GATHER_STATISTICS
+ rtx_alloc_counts[code]++;
+ rtx_alloc_sizes[code] += RTX_SIZE (code);
+#endif
+
return rt;
}
@@ -357,7 +377,7 @@ rtx_equal_p (rtx x, rtx y)
}
/* Compare the elements. If any pair of corresponding elements
- fail to match, return 0 for the whole things. */
+ fail to match, return 0 for the whole thing. */
fmt = GET_RTX_FORMAT (code);
for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--)
@@ -417,6 +437,36 @@ rtx_equal_p (rtx x, rtx y)
}
return 1;
}
+
+void dump_rtx_statistics (void)
+{
+#ifdef GATHER_STATISTICS
+ int i;
+ int total_counts = 0;
+ int total_sizes = 0;
+ fprintf (stderr, "\nRTX Kind Count Bytes\n");
+ fprintf (stderr, "---------------------------------------\n");
+ for (i = 0; i < LAST_AND_UNUSED_RTX_CODE; i++)
+ if (rtx_alloc_counts[i])
+ {
+ fprintf (stderr, "%-20s %7d %10d\n", GET_RTX_NAME (i),
+ rtx_alloc_counts[i], rtx_alloc_sizes[i]);
+ total_counts += rtx_alloc_counts[i];
+ total_sizes += rtx_alloc_sizes[i];
+ }
+ if (rtvec_alloc_counts)
+ {
+ fprintf (stderr, "%-20s %7d %10d\n", "rtvec",
+ rtvec_alloc_counts, rtvec_alloc_sizes);
+ total_counts += rtvec_alloc_counts;
+ total_sizes += rtvec_alloc_sizes;
+ }
+ fprintf (stderr, "---------------------------------------\n");
+ fprintf (stderr, "%-20s %7d %10d\n",
+ "Total", total_counts, total_sizes);
+ fprintf (stderr, "---------------------------------------\n");
+#endif
+}
#if defined ENABLE_RTL_CHECKING && (GCC_VERSION >= 2007)
void
diff --git a/gcc/rtl.def b/gcc/rtl.def
index a7de17beea5..f97f8e98c8a 100644
--- a/gcc/rtl.def
+++ b/gcc/rtl.def
@@ -582,6 +582,10 @@ DEF_RTL_EXPR(SET_ATTR_ALTERNATIVE, "set_attr_alternative", "sE", 'x')
attribute name and the second is the comparison value. */
DEF_RTL_EXPR(EQ_ATTR, "eq_attr", "ss", 'x')
+/* A special case of the above representing a set of alternatives. The first
+ operand is bitmap of the set, the second one is the default value. */
+DEF_RTL_EXPR(EQ_ATTR_ALT, "eq_attr_alt", "ii", 'x')
+
/* A conditional expression which is true if the specified flag is
true for the insn being scheduled in reorg.
@@ -621,17 +625,17 @@ DEF_RTL_EXPR(BARRIER, "barrier", "iuu000000", 'x')
/* Holds a label that is followed by instructions.
Operand:
- 5: is used in jump.c for the use-count of the label.
- 6: is used in flow.c to point to the chain of label_ref's to this label.
- 7: is a number that is unique in the entire compilation.
- 8: is the user-given name of the label, if any. */
+ 4: is used in jump.c for the use-count of the label.
+ 5: is used in flow.c to point to the chain of label_ref's to this label.
+ 6: is a number that is unique in the entire compilation.
+ 7: is the user-given name of the label, if any. */
DEF_RTL_EXPR(CODE_LABEL, "code_label", "iuuB00is", 'x')
/* Say where in the code a source line starts, for symbol table's sake.
Operand:
- 5: filename, if line number > 0, note-specific data otherwise.
- 6: line number if > 0, enum note_insn otherwise.
- 7: unique number if line number == note_insn_deleted_label. */
+ 4: filename, if line number > 0, note-specific data otherwise.
+ 5: line number if > 0, enum note_insn otherwise.
+ 6: unique number if line number == note_insn_deleted_label. */
DEF_RTL_EXPR(NOTE, "note", "iuuB0ni", 'x')
/* ----------------------------------------------------------------------
@@ -1208,20 +1212,6 @@ DEF_RTL_EXPR(SS_TRUNCATE, "ss_truncate", "e", '1')
/* Unsigned saturating truncate. */
DEF_RTL_EXPR(US_TRUNCATE, "us_truncate", "e", '1')
-/* The SSA phi operator.
-
- The argument is a vector of 2N rtxes. Element 2N+1 is a CONST_INT
- containing the block number of the predecessor through which control
- has passed when the register at element 2N is used.
-
- Note that PHI may only appear at the beginning of a basic block.
-
- ??? There may be multiple PHI insns, but they are all evaluated
- in parallel. This probably ought to be changed to use a real
- PARALLEL, as that would be less confusing and more in the spirit
- of canonical RTL. It is, however, easier to manipulate this way. */
-DEF_RTL_EXPR(PHI, "phi", "E", 'x')
-
/*
Local variables:
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 8967193d51f..12c70509923 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -249,10 +249,10 @@ struct rtx_def GTY((chain_next ("RTX_NEXT (&%h)"),
/* Define macros to access the `code' field of the rtx. */
#define GET_CODE(RTX) ((enum rtx_code) (RTX)->code)
-#define PUT_CODE(RTX, CODE) ((RTX)->code = (ENUM_BITFIELD(rtx_code)) (CODE))
+#define PUT_CODE(RTX, CODE) ((RTX)->code = (CODE))
#define GET_MODE(RTX) ((enum machine_mode) (RTX)->mode)
-#define PUT_MODE(RTX, MODE) ((RTX)->mode = (ENUM_BITFIELD(machine_mode)) (MODE))
+#define PUT_MODE(RTX, MODE) ((RTX)->mode = (MODE))
/* RTL vector. These appear inside RTX's when there is a need
for a variable number of things. The principle use is inside
@@ -1457,6 +1457,7 @@ extern void set_reg_attrs_for_parm (rtx, rtx);
extern rtx rtx_alloc (RTX_CODE);
extern rtvec rtvec_alloc (int);
extern rtx copy_rtx (rtx);
+extern void dump_rtx_statistics (void);
/* In emit-rtl.c */
extern rtx copy_rtx_if_shared (rtx);
@@ -1742,7 +1743,7 @@ rtx alloc_EXPR_LIST (int, rtx, rtx);
/* regclass.c */
/* Maximum number of parallel sets and clobbers in any insn in this fn.
- Always at least 3, since the combiner could put that many togetherm
+ Always at least 3, since the combiner could put that many together
and we want this to remain correct for all the remaining passes. */
extern int max_parallel;
@@ -2036,6 +2037,7 @@ extern void delete_insns_since (rtx);
extern void mark_reg_pointer (rtx, int);
extern void mark_user_reg (rtx);
extern void reset_used_flags (rtx);
+extern void set_used_flags (rtx);
extern void reorder_insns (rtx, rtx, rtx);
extern void reorder_insns_nobb (rtx, rtx, rtx);
extern int get_max_uid (void);
@@ -2048,9 +2050,10 @@ extern void pop_topmost_sequence (void);
extern int subreg_realpart_p (rtx);
extern void reverse_comparison (rtx);
extern void set_new_first_and_last_insn (rtx, rtx);
-extern void set_new_first_and_last_label_num (int, int);
extern void set_new_last_label_num (int);
extern void unshare_all_rtl_again (rtx);
+extern void unshare_all_rtl_in_chain (rtx);
+extern void verify_rtl_sharing (void);
extern void set_first_insn (rtx);
extern void set_last_insn (rtx);
extern void link_cc0_insns (rtx);
@@ -2084,7 +2087,7 @@ extern void dump_combine_stats (FILE *);
extern void dump_combine_total_stats (FILE *);
#endif
/* In web.c */
-extern void web_main PARAMS ((void));
+extern void web_main (void);
/* In sched.c. */
#ifdef BUFSIZ
@@ -2130,6 +2133,7 @@ extern void purge_hard_subreg_sets (rtx);
/* In stmt.c */
extern void set_file_and_line_for_stmt (location_t);
extern void expand_null_return (void);
+extern void expand_naked_return (void);
extern void emit_jump (rtx);
extern int preserve_subexpressions_p (void);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index 0a0d4d4a51a..6268305c904 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -133,10 +133,14 @@ rtx_unstable_p (rtx x)
int
rtx_varies_p (rtx x, int for_alias)
{
- RTX_CODE code = GET_CODE (x);
+ RTX_CODE code;
int i;
const char *fmt;
+ if (!x)
+ return 0;
+
+ code = GET_CODE (x);
switch (code)
{
case MEM:
diff --git a/gcc/sbitmap.c b/gcc/sbitmap.c
index 3cec45de627..1d27a871097 100644
--- a/gcc/sbitmap.c
+++ b/gcc/sbitmap.c
@@ -250,9 +250,16 @@ sbitmap_not (sbitmap dst, sbitmap src)
unsigned int i, n = dst->size;
sbitmap_ptr dstp = dst->elms;
sbitmap_ptr srcp = src->elms;
+ unsigned int last_bit;
for (i = 0; i < n; i++)
*dstp++ = ~*srcp++;
+
+ /* Zero all bits past n_bits, by ANDing dst with sbitmap_ones. */
+ last_bit = src->n_bits % SBITMAP_ELT_BITS;
+ if (last_bit)
+ dst->elms[n-1] = dst->elms[n-1]
+ & ((SBITMAP_ELT_TYPE)-1 >> (SBITMAP_ELT_BITS - last_bit));
}
/* Set the bits in DST to be the difference between the bits
@@ -298,7 +305,7 @@ sbitmap_a_and_b_cg (sbitmap dst, sbitmap a, sbitmap b)
for (i = 0; i < n; i++)
{
SBITMAP_ELT_TYPE tmp = *ap++ & *bp++;
- changed = *dstp ^ tmp;
+ changed |= *dstp ^ tmp;
*dstp++ = tmp;
}
@@ -332,7 +339,7 @@ sbitmap_a_xor_b_cg (sbitmap dst, sbitmap a, sbitmap b)
for (i = 0; i < n; i++)
{
SBITMAP_ELT_TYPE tmp = *ap++ ^ *bp++;
- changed = *dstp ^ tmp;
+ changed |= *dstp ^ tmp;
*dstp++ = tmp;
}
@@ -366,7 +373,7 @@ sbitmap_a_or_b_cg (sbitmap dst, sbitmap a, sbitmap b)
for (i = 0; i < n; i++)
{
SBITMAP_ELT_TYPE tmp = *ap++ | *bp++;
- changed = *dstp ^ tmp;
+ changed |= *dstp ^ tmp;
*dstp++ = tmp;
}
diff --git a/gcc/sched-ebb.c b/gcc/sched-ebb.c
index e005f74160a..2d4f125e62f 100644
--- a/gcc/sched-ebb.c
+++ b/gcc/sched-ebb.c
@@ -218,8 +218,8 @@ add_missing_bbs (rtx before, basic_block first, basic_block last)
{
before = emit_note_before (NOTE_INSN_BASIC_BLOCK, before);
NOTE_BASIC_BLOCK (before) = last;
- last->head = before;
- last->end = before;
+ BB_HEAD (last) = before;
+ BB_END (last) = before;
update_bb_for_insn (last);
}
}
@@ -233,10 +233,10 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head,
rtx tail)
{
rtx insn = head;
- rtx last_inside = bb->head;
+ rtx last_inside = BB_HEAD (bb);
rtx aftertail = NEXT_INSN (tail);
- head = bb->head;
+ head = BB_HEAD (bb);
for (; insn != aftertail; insn = NEXT_INSN (insn))
{
@@ -299,9 +299,9 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head,
if (f)
{
last = curr_bb = split_edge (f);
- h = curr_bb->head;
- curr_bb->head = head;
- curr_bb->end = insn;
+ h = BB_HEAD (curr_bb);
+ BB_HEAD (curr_bb) = head;
+ BB_END (curr_bb) = insn;
/* Edge splitting created misplaced BASIC_BLOCK note, kill
it. */
delete_insn (h);
@@ -324,9 +324,9 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head,
}
else
{
- curr_bb->head = head;
- curr_bb->end = insn;
- add_missing_bbs (curr_bb->head, bb, curr_bb->prev_bb);
+ BB_HEAD (curr_bb) = head;
+ BB_END (curr_bb) = insn;
+ add_missing_bbs (BB_HEAD (curr_bb), bb, curr_bb->prev_bb);
}
note = GET_CODE (head) == CODE_LABEL ? NEXT_INSN (head) : head;
NOTE_BASIC_BLOCK (note) = curr_bb;
@@ -337,7 +337,7 @@ fix_basic_block_boundaries (basic_block bb, basic_block last, rtx head,
break;
}
}
- add_missing_bbs (last->next_bb->head, bb, last);
+ add_missing_bbs (BB_HEAD (last->next_bb), bb, last);
return bb->prev_bb;
}
@@ -442,7 +442,7 @@ add_deps_for_risky_insns (rtx head, rtx tail)
bb = bb->aux;
if (!bb)
break;
- prev = bb->end;
+ prev = BB_END (bb);
}
}
/* FALLTHRU */
@@ -585,15 +585,15 @@ schedule_ebbs (FILE *dump_file)
/* Schedule every region in the subroutine. */
FOR_EACH_BB (bb)
{
- rtx head = bb->head;
+ rtx head = BB_HEAD (bb);
rtx tail;
for (;;)
{
edge e;
- tail = bb->end;
+ tail = BB_END (bb);
if (bb->next_bb == EXIT_BLOCK_PTR
- || GET_CODE (bb->next_bb->head) == CODE_LABEL)
+ || GET_CODE (BB_HEAD (bb->next_bb)) == CODE_LABEL)
break;
for (e = bb->succ; e; e = e->succ_next)
if ((e->flags & EDGE_FALLTHRU) != 0)
diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c
index 0b89e35ee3e..b8e474d0b44 100644
--- a/gcc/sched-rgn.c
+++ b/gcc/sched-rgn.c
@@ -155,7 +155,7 @@ static int *containing_rgn;
void debug_regions (void);
static void find_single_block_region (void);
-static void find_rgns (struct edge_list *, dominance_info);
+static void find_rgns (struct edge_list *);
static int too_large (int, int *, int *);
extern void debug_live (int, int);
@@ -343,7 +343,7 @@ is_cfg_nonregular (void)
the cfg not well structured. */
/* Check for labels referred to other thn by jumps. */
FOR_EACH_BB (b)
- for (insn = b->head;; insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (b); ; insn = NEXT_INSN (insn))
{
code = GET_CODE (insn);
if (GET_RTX_CLASS (code) == 'i' && code != JUMP_INSN)
@@ -357,7 +357,7 @@ is_cfg_nonregular (void)
return 1;
}
- if (insn == b->end)
+ if (insn == BB_END (b))
break;
}
@@ -558,8 +558,8 @@ static int
too_large (int block, int *num_bbs, int *num_insns)
{
(*num_bbs)++;
- (*num_insns) += (INSN_LUID (BLOCK_END (block)) -
- INSN_LUID (BLOCK_HEAD (block)));
+ (*num_insns) += (INSN_LUID (BB_END (BASIC_BLOCK (block))) -
+ INSN_LUID (BB_HEAD (BASIC_BLOCK (block))));
if ((*num_bbs > MAX_RGN_BLOCKS) || (*num_insns > MAX_RGN_INSNS))
return 1;
else
@@ -613,7 +613,7 @@ too_large (int block, int *num_bbs, int *num_insns)
of edge tables. That would simplify it somewhat. */
static void
-find_rgns (struct edge_list *edge_list, dominance_info dom)
+find_rgns (struct edge_list *edge_list)
{
int *max_hdr, *dfs_nr, *stack, *degree;
char no_loops = 1;
@@ -827,7 +827,7 @@ find_rgns (struct edge_list *edge_list, dominance_info dom)
{
/* Now verify that the block is dominated by the loop
header. */
- if (!dominated_by_p (dom, jbb, bb))
+ if (!dominated_by_p (CDI_DOMINATORS, jbb, bb))
break;
}
}
@@ -852,8 +852,8 @@ find_rgns (struct edge_list *edge_list, dominance_info dom)
/* Estimate # insns, and count # blocks in the region. */
num_bbs = 1;
- num_insns = (INSN_LUID (bb->end)
- - INSN_LUID (bb->head));
+ num_insns = (INSN_LUID (BB_END (bb))
+ - INSN_LUID (BB_HEAD (bb)));
/* Find all loop latches (blocks with back edges to the loop
header) or all the leaf blocks in the cfg has no loops.
@@ -1839,28 +1839,28 @@ can_schedule_ready_p (rtx insn)
/* Update source block boundaries. */
b1 = BLOCK_FOR_INSN (insn);
- if (insn == b1->head && insn == b1->end)
+ if (insn == BB_HEAD (b1) && insn == BB_END (b1))
{
/* We moved all the insns in the basic block.
Emit a note after the last insn and update the
begin/end boundaries to point to the note. */
rtx note = emit_note_after (NOTE_INSN_DELETED, insn);
- b1->head = note;
- b1->end = note;
+ BB_HEAD (b1) = note;
+ BB_END (b1) = note;
}
- else if (insn == b1->end)
+ else if (insn == BB_END (b1))
{
/* We took insns from the end of the basic block,
so update the end of block boundary so that it
points to the first insn we did not move. */
- b1->end = PREV_INSN (insn);
+ BB_END (b1) = PREV_INSN (insn);
}
- else if (insn == b1->head)
+ else if (insn == BB_HEAD (b1))
{
/* We took insns from the start of the basic block,
so update the start of block boundary so that
it points to the first insn we did not move. */
- b1->head = NEXT_INSN (insn);
+ BB_HEAD (b1) = NEXT_INSN (insn);
}
}
else
@@ -2036,7 +2036,7 @@ add_branch_dependences (rtx head, rtx tail)
end since moving them results in worse register allocation. Uses remain
at the end to ensure proper register allocation.
- cc0 setters remaim at the end because they can't be moved away from
+ cc0 setters remain at the end because they can't be moved away from
their cc0 user.
Insns setting CLASS_LIKELY_SPILLED_P registers (usually return values)
@@ -2516,10 +2516,10 @@ schedule_region (int rgn)
sched_rgn_n_insns += sched_n_insns;
/* Update target block boundaries. */
- if (head == BLOCK_HEAD (b))
- BLOCK_HEAD (b) = current_sched_info->head;
- if (tail == BLOCK_END (b))
- BLOCK_END (b) = current_sched_info->tail;
+ if (head == BB_HEAD (BASIC_BLOCK (b)))
+ BB_HEAD (BASIC_BLOCK (b)) = current_sched_info->head;
+ if (tail == BB_END (BASIC_BLOCK (b)))
+ BB_END (BASIC_BLOCK (b)) = current_sched_info->tail;
/* Clean up. */
if (current_nr_blocks > 1)
@@ -2597,7 +2597,6 @@ init_regions (void)
}
else
{
- dominance_info dom;
struct edge_list *edge_list;
/* The scheduler runs after estimate_probabilities; therefore, we
@@ -2607,7 +2606,7 @@ init_regions (void)
edge_list = create_edge_list ();
/* Compute the dominators and post dominators. */
- dom = calculate_dominance_info (CDI_DOMINATORS);
+ calculate_dominance_info (CDI_DOMINATORS);
/* build_control_flow will return nonzero if it detects unreachable
blocks or any other irregularity with the cfg which prevents
@@ -2615,7 +2614,7 @@ init_regions (void)
if (build_control_flow (edge_list) != 0)
find_single_block_region ();
else
- find_rgns (edge_list, dom);
+ find_rgns (edge_list);
if (sched_verbose >= 3)
debug_regions ();
@@ -2625,7 +2624,7 @@ init_regions (void)
/* For now. This will move as more and more of haifa is converted
to using the cfg code in flow.c. */
- free_dominance_info (dom);
+ free_dominance_info (CDI_DOMINATORS);
}
}
diff --git a/gcc/sched-vis.c b/gcc/sched-vis.c
index 55741d14c0b..9174c8bf2ff 100644
--- a/gcc/sched-vis.c
+++ b/gcc/sched-vis.c
@@ -80,7 +80,7 @@ insn_print_units (rtx insn)
}
/* MAX_VISUAL_LINES is the maximum number of lines in visualization table
- of a basic block. If more lines are needed, table is splitted to two.
+ of a basic block. If more lines are needed, table is split to two.
n_visual_lines is the number of lines printed so far for a block.
visual_tbl contains the block visualization info.
vis_no_unit holds insns in a cycle that are not mapped to any unit. */
diff --git a/gcc/sibcall.c b/gcc/sibcall.c
index ec85cb23786..81509ee9b56 100644
--- a/gcc/sibcall.c
+++ b/gcc/sibcall.c
@@ -597,7 +597,7 @@ optimize_sibling_and_tail_recursive_calls (void)
/* Walk forwards through the last normal block and see if it
does nothing except fall into the exit block. */
- for (insn = EXIT_BLOCK_PTR->prev_bb->head;
+ for (insn = BB_HEAD (EXIT_BLOCK_PTR->prev_bb);
insn;
insn = NEXT_INSN (insn))
{
@@ -685,7 +685,7 @@ optimize_sibling_and_tail_recursive_calls (void)
&& call_block->succ->dest != alternate_exit)
/* If this call doesn't end the block, there are operations at
the end of the block which we must execute after returning. */
- || ! call_ends_block_p (insn, call_block->end))
+ || ! call_ends_block_p (insn, BB_END (call_block)))
sibcall = 0, tailrecursion = 0;
/* Select a set of insns to implement the call and emit them.
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index ee75e3497ca..ffa87cd785f 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -1031,6 +1031,15 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
&& GET_CODE (XEXP (XEXP (op, 0), 1)) == LABEL_REF)
return XEXP (op, 0);
+ /* Check for a sign extension of a subreg of a promoted
+ variable, where the promotion is sign-extended, and the
+ target mode is the same as the variable's promotion. */
+ if (GET_CODE (op) == SUBREG
+ && SUBREG_PROMOTED_VAR_P (op)
+ && ! SUBREG_PROMOTED_UNSIGNED_P (op)
+ && GET_MODE (XEXP (op, 0)) == mode)
+ return XEXP (op, 0);
+
#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
if (! POINTERS_EXTEND_UNSIGNED
&& mode == Pmode && GET_MODE (op) == ptr_mode
@@ -1043,8 +1052,17 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
#endif
break;
-#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
case ZERO_EXTEND:
+ /* Check for a zero extension of a subreg of a promoted
+ variable, where the promotion is zero-extended, and the
+ target mode is the same as the variable's promotion. */
+ if (GET_CODE (op) == SUBREG
+ && SUBREG_PROMOTED_VAR_P (op)
+ && SUBREG_PROMOTED_UNSIGNED_P (op)
+ && GET_MODE (XEXP (op, 0)) == mode)
+ return XEXP (op, 0);
+
+#if defined(POINTERS_EXTEND_UNSIGNED) && !defined(HAVE_ptr_extend)
if (POINTERS_EXTEND_UNSIGNED > 0
&& mode == Pmode && GET_MODE (op) == ptr_mode
&& (CONSTANT_P (op)
@@ -1053,8 +1071,8 @@ simplify_unary_operation (enum rtx_code code, enum machine_mode mode,
&& REG_POINTER (SUBREG_REG (op))
&& GET_MODE (SUBREG_REG (op)) == Pmode)))
return convert_memory_address (Pmode, op);
- break;
#endif
+ break;
default:
break;
@@ -2821,18 +2839,33 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
if (GET_CODE (op0) == CONST_INT)
return op0 != const0_rtx ? op1 : op2;
- /* Convert a == b ? b : a to "a". */
- if (GET_CODE (op0) == NE && ! side_effects_p (op0)
- && !HONOR_NANS (mode)
- && rtx_equal_p (XEXP (op0, 0), op1)
- && rtx_equal_p (XEXP (op0, 1), op2))
+ /* Convert c ? a : a into "a". */
+ if (rtx_equal_p (op1, op2) && ! side_effects_p (op0))
+ return op1;
+
+ /* Convert a != b ? a : b into "a". */
+ if (GET_CODE (op0) == NE
+ && ! side_effects_p (op0)
+ && ! HONOR_NANS (mode)
+ && ! HONOR_SIGNED_ZEROS (mode)
+ && ((rtx_equal_p (XEXP (op0, 0), op1)
+ && rtx_equal_p (XEXP (op0, 1), op2))
+ || (rtx_equal_p (XEXP (op0, 0), op2)
+ && rtx_equal_p (XEXP (op0, 1), op1))))
return op1;
- else if (GET_CODE (op0) == EQ && ! side_effects_p (op0)
- && !HONOR_NANS (mode)
- && rtx_equal_p (XEXP (op0, 1), op1)
- && rtx_equal_p (XEXP (op0, 0), op2))
+
+ /* Convert a == b ? a : b into "b". */
+ if (GET_CODE (op0) == EQ
+ && ! side_effects_p (op0)
+ && ! HONOR_NANS (mode)
+ && ! HONOR_SIGNED_ZEROS (mode)
+ && ((rtx_equal_p (XEXP (op0, 0), op1)
+ && rtx_equal_p (XEXP (op0, 1), op2))
+ || (rtx_equal_p (XEXP (op0, 0), op2)
+ && rtx_equal_p (XEXP (op0, 1), op1))))
return op2;
- else if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0))
+
+ if (GET_RTX_CLASS (GET_CODE (op0)) == '<' && ! side_effects_p (op0))
{
enum machine_mode cmp_mode = (GET_MODE (XEXP (op0, 0)) == VOIDmode
? GET_MODE (XEXP (op0, 1))
@@ -2874,6 +2907,7 @@ simplify_ternary_operation (enum rtx_code code, enum machine_mode mode,
}
}
break;
+
case VEC_MERGE:
if (GET_MODE (op0) != mode
|| GET_MODE (op1) != mode
@@ -3286,7 +3320,7 @@ simplify_subreg (enum machine_mode outermode, rtx op,
of real and imaginary part. */
if (GET_CODE (op) == CONCAT)
{
- int is_realpart = byte < GET_MODE_UNIT_SIZE (innermode);
+ int is_realpart = byte < (unsigned int) GET_MODE_UNIT_SIZE (innermode);
rtx part = is_realpart ? XEXP (op, 0) : XEXP (op, 1);
unsigned int final_offset;
rtx res;
diff --git a/gcc/ssa-ccp.c b/gcc/ssa-ccp.c
deleted file mode 100644
index 7ff305a9d3d..00000000000
--- a/gcc/ssa-ccp.c
+++ /dev/null
@@ -1,1206 +0,0 @@
-/* Conditional constant propagation pass for the GNU compiler.
- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
- Original framework by Daniel Berlin <dan@cgsoftware.com>
- Fleshed out and major cleanups by Jeff Law <law@redhat.com>
-
-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. */
-
-/* Conditional constant propagation.
-
- References:
-
- Constant propagation with conditional branches,
- Wegman and Zadeck, ACM TOPLAS 13(2):181-210.
-
- Building an Optimizing Compiler,
- Robert Morgan, Butterworth-Heinemann, 1998, Section 8.9.
-
- Advanced Compiler Design and Implementation,
- Steven Muchnick, Morgan Kaufmann, 1997, Section 12.6
-
- The overall structure is as follows:
-
- 1. Run a simple SSA based DCE pass to remove any dead code.
- 2. Run CCP to compute what registers are known constants
- and what edges are not executable. Remove unexecutable
- edges from the CFG and simplify PHI nodes.
- 3. Replace registers with constants where possible.
- 4. Remove unreachable blocks computed in step #2.
- 5. Another simple SSA DCE pass to remove dead code exposed
- by CCP.
-
- When we exit, we are still in SSA form.
-
-
- Potential further enhancements:
-
- 1. Handle SUBREGs, STRICT_LOW_PART, etc in destinations more
- gracefully.
-
- 2. Handle insns with multiple outputs more gracefully.
-
- 3. Handle CONST_DOUBLE and symbolic constants.
-
- 4. Fold expressions after performing constant substitutions. */
-
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-#include "rtl.h"
-#include "hard-reg-set.h"
-#include "basic-block.h"
-#include "ssa.h"
-#include "insn-config.h"
-#include "recog.h"
-#include "output.h"
-#include "errors.h"
-#include "ggc.h"
-#include "df.h"
-#include "function.h"
-
-/* Possible lattice values. */
-
-typedef enum
-{
- UNDEFINED,
- CONSTANT,
- VARYING
-} latticevalue;
-
-/* Main structure for CCP.
-
- Contains the lattice value and, if it's a constant, the constant
- value. */
-typedef struct
-{
- latticevalue lattice_val;
- rtx const_value;
-} value;
-
-/* Array of values indexed by register number. */
-static value *values;
-
-/* A bitmap to keep track of executable blocks in the CFG. */
-static sbitmap executable_blocks;
-
-/* A bitmap for all executable edges in the CFG. */
-static sbitmap executable_edges;
-
-/* Array of edges on the work list. */
-static edge *edge_info;
-
-/* We need an edge list to be able to get indexes easily. */
-static struct edge_list *edges;
-
-/* For building/following use-def and def-use chains. */
-static struct df *df_analyzer;
-
-/* Current edge we are operating on, from the worklist */
-static edge flow_edges;
-
-/* Bitmap of SSA edges which will need reexamination as their definition
- has changed. */
-static sbitmap ssa_edges;
-
-/* Simple macros to simplify code */
-#define SSA_NAME(x) REGNO (SET_DEST (x))
-#define EIE(x,y) EDGE_INDEX (edges, x, y)
-
-static void visit_phi_node (rtx, basic_block);
-static void visit_expression (rtx, basic_block);
-static void defs_to_undefined (rtx);
-static void defs_to_varying (rtx);
-static void examine_flow_edges (void);
-static int mark_references (rtx *, void *);
-static void follow_def_use_chains (void);
-static void optimize_unexecutable_edges (struct edge_list *, sbitmap);
-static void ssa_ccp_substitute_constants (void);
-static void ssa_ccp_df_delete_unreachable_insns (void);
-static void ssa_fast_dce (struct df *);
-
-/* Loop through the PHI_NODE's parameters for BLOCK and compare their
- lattice values to determine PHI_NODE's lattice value. */
-static void
-visit_phi_node (rtx phi_node, basic_block block)
-{
- unsigned int i;
- rtx phi_node_expr = NULL;
- unsigned int phi_node_name = SSA_NAME (PATTERN (phi_node));
- latticevalue phi_node_lattice_val = UNDEFINED;
- rtx pat = PATTERN (phi_node);
- rtvec phi_vec = XVEC (SET_SRC (pat), 0);
- unsigned int num_elem = GET_NUM_ELEM (phi_vec);
-
- for (i = 0; i < num_elem; i += 2)
- {
- if (TEST_BIT (executable_edges,
- EIE (BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, i + 1))),
- block)))
- {
- unsigned int current_parm
- = REGNO (RTVEC_ELT (phi_vec, i));
-
- latticevalue current_parm_lattice_val
- = values[current_parm].lattice_val;
-
- /* If any node is VARYING, then new value of PHI_NODE
- is VARYING. */
- if (current_parm_lattice_val == VARYING)
- {
- phi_node_lattice_val = VARYING;
- phi_node_expr = NULL;
- break;
- }
-
- /* If we have more than one distinct constant, then the new
- value of PHI_NODE is VARYING. */
- if (current_parm_lattice_val == CONSTANT
- && phi_node_lattice_val == CONSTANT
- && values[current_parm].const_value != phi_node_expr)
- {
- phi_node_lattice_val = VARYING;
- phi_node_expr = NULL;
- break;
- }
-
- /* If the current value of PHI_NODE is UNDEFINED and one
- node in PHI_NODE is CONSTANT, then the new value of the
- PHI is that CONSTANT. Note this can turn into VARYING
- if we find another distinct constant later. */
- if (phi_node_lattice_val == UNDEFINED
- && phi_node_expr == NULL
- && current_parm_lattice_val == CONSTANT)
- {
- phi_node_expr = values[current_parm].const_value;
- phi_node_lattice_val = CONSTANT;
- continue;
- }
- }
- }
-
- /* If the value of PHI_NODE changed, then we will need to
- re-execute uses of the output of PHI_NODE. */
- if (phi_node_lattice_val != values[phi_node_name].lattice_val)
- {
- values[phi_node_name].lattice_val = phi_node_lattice_val;
- values[phi_node_name].const_value = phi_node_expr;
- SET_BIT (ssa_edges, phi_node_name);
- }
-}
-
-/* Sets all defs in an insn to UNDEFINED. */
-static void
-defs_to_undefined (rtx insn)
-{
- struct df_link *currdef;
- for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef;
- currdef = currdef->next)
- {
- if (values[DF_REF_REGNO (currdef->ref)].lattice_val != UNDEFINED)
- SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref));
- values[DF_REF_REGNO (currdef->ref)].lattice_val = UNDEFINED;
- }
-}
-
-/* Sets all defs in an insn to VARYING. */
-static void
-defs_to_varying (rtx insn)
-{
- struct df_link *currdef;
- for (currdef = DF_INSN_DEFS (df_analyzer, insn); currdef;
- currdef = currdef->next)
- {
- if (values[DF_REF_REGNO (currdef->ref)].lattice_val != VARYING)
- SET_BIT (ssa_edges, DF_REF_REGNO (currdef->ref));
- values[DF_REF_REGNO (currdef->ref)].lattice_val = VARYING;
- }
-}
-
-/* Go through the expression, call the appropriate evaluation routines
- to attempt cprop */
-static void
-visit_expression (rtx insn, basic_block block)
-{
- rtx src, dest, set;
-
-
- /* Ugh. CALL_INSNs may end a basic block and have multiple edges
- leading out from them.
-
- Mark all the outgoing edges as executable, then fall into the
- normal processing below. */
- if (GET_CODE (insn) == CALL_INSN && block->end == insn)
- {
- edge curredge;
-
- for (curredge = block->succ; curredge;
- curredge = curredge->succ_next)
- {
- int index = EIE (curredge->src, curredge->dest);
-
- if (TEST_BIT (executable_edges, index))
- continue;
-
- SET_BIT (executable_edges, index);
- edge_info[index] = flow_edges;
- flow_edges = curredge;
- }
- }
-
- set = single_set (insn);
- if (! set)
- {
- defs_to_varying (insn);
- return;
- }
-
- src = SET_SRC (set);
- dest = SET_DEST (set);
-
- /* We may want to refine this some day. */
- if (GET_CODE (dest) != REG && dest != pc_rtx)
- {
- defs_to_varying (insn);
- return;
- }
-
- /* Hard registers are not put in SSA form and thus we must consider
- them varying. All the more reason to avoid hard registers in
- RTL until as late as possible in the compilation. */
- if (GET_CODE (dest) == REG && REGNO (dest) < FIRST_PSEUDO_REGISTER)
- {
- defs_to_varying (insn);
- return;
- }
-
- /* If this is assigning DEST to a constant, record that fact. */
- if (GET_CODE (src) == CONST_INT && GET_CODE (insn) == INSN)
- {
- unsigned int resultreg = REGNO (dest);
-
- values[resultreg].lattice_val = CONSTANT;
- values[resultreg].const_value = SET_SRC (PATTERN (insn));
- SET_BIT (ssa_edges, resultreg);
- }
-
- /* If this is a copy operation, then we can copy the lattice values. */
- else if (GET_CODE (src) == REG && GET_CODE (dest) == REG)
- {
- unsigned int old_value = REGNO (src);
- latticevalue old_lattice_value = values[old_value].lattice_val;
- unsigned int new_value = REGNO (dest);
-
- /* Unless the lattice value is going to change, don't bother
- adding the "new value" into the worklist. */
- if (values[new_value].lattice_val != old_lattice_value
- || values[new_value].const_value != values[old_value].const_value)
- SET_BIT (ssa_edges, new_value);
-
- /* Copy the old lattice node info into the new value lattice node. */
- values[new_value].lattice_val = old_lattice_value;
- values[new_value].const_value = values[old_value].const_value;
- }
-
- /* Handle jumps. */
- else if (GET_CODE (insn) == JUMP_INSN)
- {
- rtx x = pc_set (insn);
- if (GET_CODE (src) != IF_THEN_ELSE)
- {
- edge curredge;
-
- /* This is a computed jump, table jump, or an unconditional
- jump. For all these cases we want to mark all successor
- blocks as executable if they have not already been
- marked.
-
- One day we may try do better with switch tables and
- other computed jumps. */
- for (curredge = block->succ; curredge;
- curredge = curredge->succ_next)
- {
- int index = EIE (curredge->src, curredge->dest);
-
- if (TEST_BIT (executable_edges, index))
- continue;
-
- SET_BIT (executable_edges, index);
- edge_info[index] = flow_edges;
- flow_edges = curredge;
- }
- }
- else
- {
- edge curredge;
- enum rtx_code comparison_code;
- rtx comparison_src0;
- rtx comparison_src1;
-
- comparison_code = GET_CODE (XEXP (src, 0));
- comparison_src0 = XEXP (XEXP (src, 0), 0);
- comparison_src1 = XEXP (XEXP (src, 0), 1);
-
- /* If either operand is undefined, then there is nothing to
- do right now. If/when operands are later defined we will
- revaluate the condition and take the appropriate action. */
- if ((GET_CODE (comparison_src0) == REG
- && values[REGNO (comparison_src0)].lattice_val == UNDEFINED)
- || (GET_CODE (comparison_src1) == REG
- && values[REGNO (comparison_src1)].lattice_val == UNDEFINED))
- return;
-
- /* If either operand is varying, then we must consider all
- paths as executable. */
- if ((GET_CODE (comparison_src0) == REG
- && values[REGNO (comparison_src0)].lattice_val == VARYING)
- || (GET_CODE (comparison_src1) == REG
- && values[REGNO (comparison_src1)].lattice_val == VARYING))
- {
- for (curredge = block->succ; curredge;
- curredge = curredge->succ_next)
- {
- int index = EIE (curredge->src, curredge->dest);
-
- if (TEST_BIT (executable_edges, index))
- continue;
-
- SET_BIT (executable_edges, index);
- edge_info[index] = flow_edges;
- flow_edges = curredge;
- }
- return;
- }
-
- /* Try to simplify the comparison. */
- if (GET_CODE (comparison_src0) == REG
- && values[REGNO (comparison_src0)].lattice_val == CONSTANT)
- comparison_src0 = values[REGNO (comparison_src0)].const_value;
-
- if (GET_CODE (comparison_src1) == REG
- && values[REGNO (comparison_src1)].lattice_val == CONSTANT)
- comparison_src1 = values[REGNO (comparison_src1)].const_value;
-
- x = simplify_ternary_operation (IF_THEN_ELSE,
- VOIDmode,
- GET_MODE (XEXP (src, 0)),
- gen_rtx (comparison_code,
- GET_MODE (XEXP (src, 0)),
- comparison_src0,
- comparison_src1),
- XEXP (src, 1),
- XEXP (src, 2));
-
- /* Walk through all the outgoing edges from this block and see
- which (if any) we should mark as executable. */
- for (curredge = block->succ; curredge;
- curredge = curredge->succ_next)
- {
- int index = EIE (curredge->src, curredge->dest);
-
- if (TEST_BIT (executable_edges, index))
- continue;
-
- /* If we were unable to simplify the expression at this
- point, it's highly unlikely we'll be able to simplify
- it later. So consider all edges as executable if the
- expression did not simplify.
-
- If the expression simplified to (pc), then we know we
- will take the fall-thru edge, so mark it. Similarly,
- if the expression simplified to (label_ref ...), then
- we know the branch will be taken and we mark that
- edge as taken. */
- if (!x
- || (x == pc_rtx
- && (curredge->flags & EDGE_FALLTHRU))
- || (GET_CODE (x) == LABEL_REF
- && ! (curredge->flags & EDGE_FALLTHRU)))
- {
- SET_BIT (executable_edges, index);
- edge_info[index] = flow_edges;
- flow_edges = curredge;
- }
- }
- }
- }
- else if (!PHI_NODE_P (insn))
- {
- rtx simplified = NULL;
-
- /* We've got some kind of INSN. If it's simple, try to evaluate
- it and record the results.
-
- We already know this insn is a single_set and that it sets
- a pseudo register. So we just need to extract the source
- arguments, simplify them to constants if possible, then
- simplify the expression as a whole if possible. */
- switch (GET_RTX_CLASS (GET_CODE (src)))
- {
- case '<':
- {
- rtx src0 = XEXP (src, 0);
- rtx src1 = XEXP (src, 1);
- enum machine_mode mode;
-
- /* If either is undefined, then the result is undefined. */
- if ((GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == UNDEFINED)
- || (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == UNDEFINED))
- {
- defs_to_undefined (insn);
- break;
- }
-
- /* Determine the mode for the operation before we simplify
- our arguments to constants. */
- mode = GET_MODE (src0);
- if (mode == VOIDmode)
- mode = GET_MODE (src1);
-
- /* Simplify source operands to whatever known values they
- may have. */
- if (GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == CONSTANT)
- src0 = values[REGNO (src0)].const_value;
-
- if (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == CONSTANT)
- src1 = values[REGNO (src1)].const_value;
-
- /* See if the simplifier can determine if this operation
- computes a constant value. */
- simplified = simplify_relational_operation (GET_CODE (src),
- mode, src0, src1);
- break;
-
- }
-
- case '1':
- {
- rtx src0 = XEXP (src, 0);
- enum machine_mode mode0 = GET_MODE (src0);
-
- /* If the operand is undefined, then the result is undefined. */
- if (GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == UNDEFINED)
- {
- defs_to_undefined (insn);
- break;
- }
-
- /* Simplify source operands to whatever known values they
- may have. */
- if (GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == CONSTANT)
- src0 = values[REGNO (src0)].const_value;
-
- /* See if the simplifier can determine if this operation
- computes a constant value. */
- simplified = simplify_unary_operation (GET_CODE (src),
- GET_MODE (src),
- src0,
- mode0);
- break;
- }
-
- case '2':
- case 'c':
- {
- rtx src0 = XEXP (src, 0);
- rtx src1 = XEXP (src, 1);
-
- /* If either is undefined, then the result is undefined. */
- if ((GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == UNDEFINED)
- || (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == UNDEFINED))
- {
- defs_to_undefined (insn);
- break;
- }
-
- /* Simplify source operands to whatever known values they
- may have. */
- if (GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == CONSTANT)
- src0 = values[REGNO (src0)].const_value;
-
- if (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == CONSTANT)
- src1 = values[REGNO (src1)].const_value;
-
- /* See if the simplifier can determine if this operation
- computes a constant value. */
- simplified = simplify_binary_operation (GET_CODE (src),
- GET_MODE (src),
- src0, src1);
- break;
- }
-
- case '3':
- case 'b':
- {
- rtx src0 = XEXP (src, 0);
- rtx src1 = XEXP (src, 1);
- rtx src2 = XEXP (src, 2);
-
- /* If either is undefined, then the result is undefined. */
- if ((GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == UNDEFINED)
- || (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == UNDEFINED)
- || (GET_CODE (src2) == REG
- && values[REGNO (src2)].lattice_val == UNDEFINED))
- {
- defs_to_undefined (insn);
- break;
- }
-
- /* Simplify source operands to whatever known values they
- may have. */
- if (GET_CODE (src0) == REG
- && values[REGNO (src0)].lattice_val == CONSTANT)
- src0 = values[REGNO (src0)].const_value;
-
- if (GET_CODE (src1) == REG
- && values[REGNO (src1)].lattice_val == CONSTANT)
- src1 = values[REGNO (src1)].const_value;
-
- if (GET_CODE (src2) == REG
- && values[REGNO (src2)].lattice_val == CONSTANT)
- src2 = values[REGNO (src2)].const_value;
-
- /* See if the simplifier can determine if this operation
- computes a constant value. */
- simplified = simplify_ternary_operation (GET_CODE (src),
- GET_MODE (src),
- GET_MODE (src),
- src0, src1, src2);
- break;
- }
-
- default:
- defs_to_varying (insn);
- }
-
- if (simplified && GET_CODE (simplified) == CONST_INT)
- {
- if (values[REGNO (dest)].lattice_val != CONSTANT
- || values[REGNO (dest)].const_value != simplified)
- SET_BIT (ssa_edges, REGNO (dest));
-
- values[REGNO (dest)].lattice_val = CONSTANT;
- values[REGNO (dest)].const_value = simplified;
- }
- else
- defs_to_varying (insn);
- }
-}
-
-/* Iterate over the FLOW_EDGES work list. Simulate the target block
- for each edge. */
-static void
-examine_flow_edges (void)
-{
- while (flow_edges != NULL)
- {
- basic_block succ_block;
- rtx curr_phi_node;
-
- /* Pull the next block to simulate off the worklist. */
- succ_block = flow_edges->dest;
- flow_edges = edge_info[EIE (flow_edges->src, flow_edges->dest)];
-
- /* There is nothing to do for the exit block. */
- if (succ_block == EXIT_BLOCK_PTR)
- continue;
-
- /* Always simulate PHI nodes, even if we have simulated this block
- before. Note that all PHI nodes are consecutive within a block. */
- for (curr_phi_node = first_insn_after_basic_block_note (succ_block);
- PHI_NODE_P (curr_phi_node);
- curr_phi_node = NEXT_INSN (curr_phi_node))
- visit_phi_node (curr_phi_node, succ_block);
-
- /* If this is the first time we've simulated this block, then we
- must simulate each of its insns. */
- if (!TEST_BIT (executable_blocks, succ_block->index))
- {
- rtx currinsn;
- edge succ_edge = succ_block->succ;
-
- /* Note that we have simulated this block. */
- SET_BIT (executable_blocks, succ_block->index);
-
- /* Simulate each insn within the block. */
- currinsn = succ_block->head;
- while (currinsn != succ_block->end)
- {
- if (INSN_P (currinsn))
- visit_expression (currinsn, succ_block);
-
- currinsn = NEXT_INSN (currinsn);
- }
-
- /* Don't forget the last insn in the block. */
- if (INSN_P (currinsn))
- visit_expression (currinsn, succ_block);
-
- /* If we haven't looked at the next block, and it has a
- single successor, add it onto the worklist. This is because
- if we only have one successor, we know it gets executed,
- so we don't have to wait for cprop to tell us. */
- if (succ_edge != NULL
- && succ_edge->succ_next == NULL
- && !TEST_BIT (executable_edges,
- EIE (succ_edge->src, succ_edge->dest)))
- {
- SET_BIT (executable_edges,
- EIE (succ_edge->src, succ_edge->dest));
- edge_info[EIE (succ_edge->src, succ_edge->dest)] = flow_edges;
- flow_edges = succ_edge;
- }
- }
- }
-}
-
-/* Follow the def-use chains for each definition on the worklist and
- simulate the uses of the definition. */
-
-static void
-follow_def_use_chains (void)
-{
- /* Iterate over all the entries on the SSA_EDGES worklist. */
- while (sbitmap_first_set_bit (ssa_edges) >= 0)
- {
- int member;
- struct df_link *curruse;
-
- /* Pick an entry off the worklist (it does not matter which
- entry we pick). */
- member = sbitmap_first_set_bit (ssa_edges);
- RESET_BIT (ssa_edges, member);
-
- /* Iterate through all the uses of this entry. */
- for (curruse = df_analyzer->regs[member].uses; curruse;
- curruse = curruse->next)
- {
- rtx useinsn;
-
- useinsn = DF_REF_INSN (curruse->ref);
- if (PHI_NODE_P (useinsn))
- {
- if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn)))
- visit_phi_node (useinsn, BLOCK_FOR_INSN (useinsn));
- }
- else
- {
- if (TEST_BIT (executable_blocks, BLOCK_NUM (useinsn)))
- visit_expression (useinsn, BLOCK_FOR_INSN (useinsn));
- }
- }
- }
-}
-
-/* Examine each edge to see if we were able to prove any were
- not executable.
-
- If an edge is not executable, then we can remove its alternative
- in PHI nodes as the destination of the edge, we can simplify the
- conditional branch at the source of the edge, and we can remove
- the edge from the CFG. Note we do not delete unreachable blocks
- yet as the DF analyzer can not deal with that yet. */
-static void
-optimize_unexecutable_edges (struct edge_list *edges,
- sbitmap executable_edges)
-{
- int i;
- basic_block bb;
-
- for (i = 0; i < NUM_EDGES (edges); i++)
- {
- if (!TEST_BIT (executable_edges, i))
- {
- edge edge = INDEX_EDGE (edges, i);
-
- if (edge->flags & EDGE_ABNORMAL)
- continue;
-
- /* We found an edge that is not executable. First simplify
- the PHI nodes in the target block. */
- if (edge->dest != EXIT_BLOCK_PTR)
- {
- rtx insn = first_insn_after_basic_block_note (edge->dest);
-
- while (PHI_NODE_P (insn))
- {
- remove_phi_alternative (PATTERN (insn), edge->src);
- if (rtl_dump_file)
- fprintf (rtl_dump_file,
- "Removing alternative for bb %d of phi %d\n",
- edge->src->index, SSA_NAME (PATTERN (insn)));
- insn = NEXT_INSN (insn);
- }
- }
- if (rtl_dump_file)
- fprintf (rtl_dump_file,
- "Removing unexecutable edge from %d to %d\n",
- edge->src->index, edge->dest->index);
- /* Since the edge was not executable, remove it from the CFG. */
- remove_edge (edge);
- }
- }
-
- /* We have removed all the unexecutable edges from the CFG. Fix up
- the conditional jumps at the end of any affected block.
-
- We have three cases to deal with:
-
- a. Both outgoing edges are not executable. This happens if the
- source block is not reachable. We will deal with this by
- deleting all the insns in the block later.
-
- b. The fall-thru edge is not executable. In this case we
- change the conditional jump into an unconditional jump and
- add a BARRIER after the unconditional jump. Note that since
- we are working on generic RTL we can change the jump in-place
- instead of dealing with the headache of reemitting the jump.
-
- c. The branch taken edge is not executable. In this case
- we turn the jump into (set (pc) (pc)) which is a nop-jump
- and we will remove the unrecognizable insn later.
-
- In cases B & C we are removing uses of registers, so make sure
- to note those changes for the DF analyzer. */
-
- FOR_EACH_BB (bb)
- {
- rtx insn = bb->end;
- edge edge = bb->succ;
-
- /* If we have no predecessors, then this block is unreachable and
- will be cleaned up when we remove unreachable blocks. */
- if (bb->pred == NULL || GET_CODE (insn) != JUMP_INSN)
- continue;
-
- /* If this block ends in a conditional jump, but only has one
- successor, then the jump needs adjustment. */
- if (condjump_p (insn) && ! simplejump_p (insn)
- && bb->succ && bb->succ->succ_next == NULL)
- {
- /* If the fallthru edge is the executable edge, then turn
- this jump into a nop jump, otherwise make it an unconditional
- jump to its target. */
- if (edge->flags & EDGE_FALLTHRU)
- {
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- }
- else
- {
- SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (Pmode,
- JUMP_LABEL (insn));
- emit_barrier_after (insn);
- INSN_CODE (insn) = -1;
- }
-
- /* Inform the DF analyzer that this insn changed. */
- df_insn_modify (df_analyzer, BLOCK_FOR_INSN (insn), insn);
- }
- }
-}
-
-/* Perform substitution of known values for pseudo registers.
-
- ??? Note we do not do simplifications or constant folding here, it
- is unlikely that any significant simplifications can be done here
- anyway. Consider that if the simplification would result in an
- expression that produces a constant value that the value would
- have been discovered and recorded already.
-
- We perform two transformations. First, we initialize pseudos to their
- known constant values at their definition point. Second, we try to
- replace uses with the known constant value. */
-
-static void
-ssa_ccp_substitute_constants (void)
-{
- unsigned int i;
-
- for (i = FIRST_PSEUDO_REGISTER; i < VARRAY_SIZE (ssa_definition); i++)
- {
- if (values[i].lattice_val == CONSTANT)
- {
- rtx def = VARRAY_RTX (ssa_definition, i);
- rtx set = single_set (def);
- struct df_link *curruse;
-
- if (! set)
- continue;
-
- /* Do not try to simplify PHI nodes down to a constant load.
- That will be done later as we translate out of SSA. Also,
- doing that here could violate the rule that all PHI nodes
- are consecutive at the start of the basic block.
-
- Don't do anything to nodes that were already sets to
- constants. */
- if (! PHI_NODE_P (def)
- && ! ((GET_CODE (def) == INSN
- && GET_CODE (SET_SRC (set)) == CONST_INT)))
- {
- if (rtl_dump_file)
- fprintf (rtl_dump_file,
- "Register %d is now set to a constant\n",
- SSA_NAME (PATTERN (def)));
- SET_SRC (set) = values[i].const_value;
- INSN_CODE (def) = -1;
- df_insn_modify (df_analyzer, BLOCK_FOR_INSN (def), def);
- }
-
- /* Iterate through all the uses of this entry and try replacements
- there too. Note it is not particularly profitable to try
- and fold/simplify expressions here as most of the common
- cases were handled above. */
- for (curruse = df_analyzer->regs[i].uses;
- curruse;
- curruse = curruse->next)
- {
- rtx useinsn;
-
- useinsn = DF_REF_INSN (curruse->ref);
-
- if (!INSN_DELETED_P (useinsn)
- && ! (GET_CODE (useinsn) == NOTE
- && NOTE_LINE_NUMBER (useinsn) == NOTE_INSN_DELETED)
- && (GET_CODE (useinsn) == INSN
- || GET_CODE (useinsn) == JUMP_INSN))
- {
-
- if (validate_replace_src (regno_reg_rtx [i],
- values[i].const_value,
- useinsn))
- {
- if (rtl_dump_file)
- fprintf (rtl_dump_file,
- "Register %d in insn %d replaced with constant\n",
- i, INSN_UID (useinsn));
- INSN_CODE (useinsn) = -1;
- df_insn_modify (df_analyzer,
- BLOCK_FOR_INSN (useinsn),
- useinsn);
- }
-
- }
- }
- }
- }
-}
-
-/* Now find all unreachable basic blocks. All the insns in those
- blocks are unreachable, so delete them and mark any necessary
- updates for the DF analyzer. */
-
-static void
-ssa_ccp_df_delete_unreachable_insns (void)
-{
- basic_block b;
-
- /* Use the CFG to find all the reachable blocks. */
- find_unreachable_blocks ();
-
- /* Now we know what blocks are not reachable. Mark all the insns
- in those blocks as deleted for the DF analyzer. We'll let the
- normal flow code actually remove the unreachable blocks. */
- FOR_EACH_BB_REVERSE (b)
- {
- if (!(b->flags & BB_REACHABLE))
- {
- rtx start = b->head;
- rtx end = b->end;
- rtx tmp;
-
- /* Include any jump table following the basic block. */
- end = b->end;
- if (tablejump_p (end, NULL, &tmp))
- end = tmp;
-
- while (1)
- {
- rtx next = NEXT_INSN (start);
-
- if (GET_CODE (start) == INSN
- || GET_CODE (start) == CALL_INSN
- || GET_CODE (start) == JUMP_INSN)
- df_insn_delete (df_analyzer, BLOCK_FOR_INSN (start), start);
-
- if (start == end)
- break;
- start = next;
- }
- }
- }
-}
-
-
-/* Main entry point for SSA Conditional Constant Propagation.
-
- Long term it should accept as input the specific flow graph to
- operate on so that it can be called for sub-graphs. */
-
-void
-ssa_const_prop (void)
-{
- unsigned int i;
- edge curredge;
-
- /* We need alias analysis (for what?) */
- init_alias_analysis ();
-
- df_analyzer = df_init ();
- df_analyse (df_analyzer, 0,
- DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
-
- /* Perform a quick and dirty dead code elimination pass. This is not
- as aggressive as it could be, but it's good enough to clean up a
- lot of unwanted junk and it is fast. */
- ssa_fast_dce (df_analyzer);
-
- /* Build an edge list from the CFG. */
- edges = create_edge_list ();
-
- /* Initialize the values array with everything as undefined. */
- values = xmalloc (VARRAY_SIZE (ssa_definition) * sizeof (value));
- for (i = 0; i < VARRAY_SIZE (ssa_definition); i++)
- {
- if (i < FIRST_PSEUDO_REGISTER)
- values[i].lattice_val = VARYING;
- else
- values[i].lattice_val = UNDEFINED;
- values[i].const_value = NULL;
- }
-
- ssa_edges = sbitmap_alloc (VARRAY_SIZE (ssa_definition));
- sbitmap_zero (ssa_edges);
-
- executable_blocks = sbitmap_alloc (last_basic_block);
- sbitmap_zero (executable_blocks);
-
- executable_edges = sbitmap_alloc (NUM_EDGES (edges));
- sbitmap_zero (executable_edges);
-
- edge_info = xmalloc (NUM_EDGES (edges) * sizeof (edge));
- flow_edges = ENTRY_BLOCK_PTR->succ;
-
- /* Add the successors of the entry block to the edge worklist. That
- is enough of a seed to get SSA-CCP started. */
- for (curredge = ENTRY_BLOCK_PTR->succ; curredge;
- curredge = curredge->succ_next)
- {
- int index = EIE (curredge->src, curredge->dest);
- SET_BIT (executable_edges, index);
- edge_info[index] = curredge->succ_next;
- }
-
- /* Iterate until until the worklists are empty. */
- do
- {
- examine_flow_edges ();
- follow_def_use_chains ();
- }
- while (flow_edges != NULL);
-
- /* Now perform substitutions based on the known constant values. */
- ssa_ccp_substitute_constants ();
-
- /* Remove unexecutable edges from the CFG and make appropriate
- adjustments to PHI nodes. */
- optimize_unexecutable_edges (edges, executable_edges);
-
- /* Now remove all unreachable insns and update the DF information.
- as appropriate. */
- ssa_ccp_df_delete_unreachable_insns ();
-
-#if 0
- /* The DF analyzer expects the number of blocks to remain constant,
- so we can't remove unreachable blocks.
-
- Code the DF analyzer calls expects there to be no unreachable
- blocks in the CFG. So we can't leave unreachable blocks in the
- CFG.
-
- So, there is no way to do an incremental update of the DF data
- at this point. */
- df_analyse (df_analyzer, 0,
- DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
-#endif
-
- /* Clean up any dead code exposed by SSA-CCP, do this after updating
- the dataflow information! */
- ssa_fast_dce (df_analyzer);
-
- free (values);
- values = NULL;
-
- free (edge_info);
- edge_info = NULL;
-
- sbitmap_free (executable_blocks);
- executable_blocks = NULL;
-
- sbitmap_free (ssa_edges);
- ssa_edges = NULL;
-
- free_edge_list (edges);
- edges = NULL;
-
- sbitmap_free (executable_edges);
- executable_edges = NULL;
-
- df_finish (df_analyzer);
- end_alias_analysis ();
-}
-
-static int
-mark_references (rtx *current_rtx, void *data)
-{
- rtx x = *current_rtx;
- sbitmap worklist = (sbitmap) data;
-
- if (x == NULL_RTX)
- return 0;
-
- if (GET_CODE (x) == SET)
- {
- rtx dest = SET_DEST (x);
-
- if (GET_CODE (dest) == STRICT_LOW_PART
- || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == SIGN_EXTRACT
- || GET_CODE (dest) == ZERO_EXTRACT)
- {
- rtx reg;
-
- reg = dest;
-
- while (GET_CODE (reg) == STRICT_LOW_PART
- || GET_CODE (reg) == SUBREG
- || GET_CODE (reg) == SIGN_EXTRACT
- || GET_CODE (reg) == ZERO_EXTRACT)
- reg = XEXP (reg, 0);
-
- if (GET_CODE (reg) == REG)
- SET_BIT (worklist, REGNO (reg));
- }
-
- if (GET_CODE (dest) == REG)
- {
- for_each_rtx (&SET_SRC (x), mark_references, data);
- return -1;
- }
-
- return 0;
- }
- else if (GET_CODE (x) == REG)
- {
- SET_BIT (worklist, REGNO (x));
- return -1;
- }
- else if (GET_CODE (x) == CLOBBER)
- return -1;
- else
- return 0;
-}
-
-static void
-ssa_fast_dce (struct df *df)
-{
- sbitmap worklist = sbitmap_alloc (VARRAY_SIZE (ssa_definition));
- sbitmap_ones (worklist);
-
- /* Iterate on the worklist until there's no definitions left to
- examine. */
- while (sbitmap_first_set_bit (worklist) >= 0)
- {
- struct df_link *curruse;
- int reg, found_use;
-
- /* Remove an item from the worklist. */
- reg = sbitmap_first_set_bit (worklist);
- RESET_BIT (worklist, reg);
-
- /* We never consider deleting assignments to hard regs or things
- which do not have SSA definitions, or things we have already
- deleted, or things with unusual side effects. */
- if (reg < FIRST_PSEUDO_REGISTER
- || ! VARRAY_RTX (ssa_definition, reg)
- || INSN_DELETED_P (VARRAY_RTX (ssa_definition, reg))
- || (GET_CODE (VARRAY_RTX (ssa_definition, reg)) == NOTE
- && (NOTE_LINE_NUMBER (VARRAY_RTX (ssa_definition, reg))
- == NOTE_INSN_DELETED))
- || side_effects_p (PATTERN (VARRAY_RTX (ssa_definition, reg))))
- continue;
-
- /* Iterate over the uses of this register. If we can not find
- any uses that have not been deleted, then the definition of
- this register is dead. */
- found_use = 0;
- for (curruse = df->regs[reg].uses; curruse; curruse = curruse->next)
- {
- if (curruse->ref
- && DF_REF_INSN (curruse->ref)
- && ! INSN_DELETED_P (DF_REF_INSN (curruse->ref))
- && ! (GET_CODE (DF_REF_INSN (curruse->ref)) == NOTE
- && (NOTE_LINE_NUMBER (DF_REF_INSN (curruse->ref))
- == NOTE_INSN_DELETED))
- && DF_REF_INSN (curruse->ref) != VARRAY_RTX (ssa_definition, reg))
- {
- found_use = 1;
- break;
- }
- }
-
- /* If we did not find a use of this register, then the definition
- of this register is dead. */
-
- if (! found_use)
- {
- rtx def = VARRAY_RTX (ssa_definition, reg);
-
- /* Add all registers referenced by INSN to the work
- list. */
- for_each_rtx (&PATTERN (def), mark_references, worklist);
-
- /* Inform the analyzer that this insn is going to be
- deleted. */
- df_insn_delete (df, BLOCK_FOR_INSN (def), def);
-
- VARRAY_RTX (ssa_definition, reg) = NULL;
- }
- }
-
- sbitmap_free (worklist);
-
- /* Update the use-def chains in the df_analyzer as needed. */
- df_analyse (df_analyzer, 0,
- DF_RD_CHAIN | DF_RU_CHAIN | DF_REG_INFO | DF_HARD_REGS);
-}
diff --git a/gcc/ssa-dce.c b/gcc/ssa-dce.c
deleted file mode 100644
index c308c7793b6..00000000000
--- a/gcc/ssa-dce.c
+++ /dev/null
@@ -1,713 +0,0 @@
-/* Dead-code elimination pass for the GNU compiler.
- Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
- Written by Jeffrey D. Oldham <oldham@codesourcery.com>.
-
-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. */
-
-/* Dead-code elimination is the removal of instructions which have no
- impact on the program's output. "Dead instructions" have no impact
- on the program's output, while "necessary instructions" may have
- impact on the output.
-
- The algorithm consists of three phases:
- 1) marking as necessary all instructions known to be necessary,
- e.g., writing a value to memory,
- 2) propagating necessary instructions, e.g., the instructions
- giving values to operands in necessary instructions, and
- 3) removing dead instructions (except replacing dead conditionals
- with unconditional jumps).
-
- Side Effects:
- The last step can require adding labels, deleting insns, and
- modifying basic block structures. Some conditional jumps may be
- converted to unconditional jumps so the control-flow graph may be
- out-of-date.
-
- Edges from some infinite loops to the exit block can be added to
- the control-flow graph, but will be removed after this pass is
- complete.
-
- It Does Not Perform:
- We decided to not simultaneously perform jump optimization and dead
- loop removal during dead-code elimination. Thus, all jump
- instructions originally present remain after dead-code elimination
- but 1) unnecessary conditional jump instructions are changed to
- unconditional jump instructions and 2) all unconditional jump
- instructions remain.
-
- Assumptions:
- 1) SSA has been performed.
- 2) The basic block and control-flow graph structures are accurate.
- 3) The flow graph permits constructing an edge_list.
- 4) note rtxes should be saved.
-
- Unfinished:
- When replacing unnecessary conditional jumps with unconditional
- jumps, the control-flow graph is not updated. It should be.
-
- References:
- Building an Optimizing Compiler
- Robert Morgan
- Butterworth-Heinemann, 1998
- Section 8.9
-*/
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-#include "rtl.h"
-#include "hard-reg-set.h"
-#include "basic-block.h"
-#include "ssa.h"
-#include "insn-config.h"
-#include "recog.h"
-#include "output.h"
-
-
-/* A map from blocks to the edges on which they are control dependent. */
-typedef struct {
- /* A dynamically allocated array. The Nth element corresponds to
- the block with index N + 2. The Ith bit in the bitmap is set if
- that block is dependent on the Ith edge. */
- bitmap *data;
- /* The number of elements in the array. */
- int length;
-} control_dependent_block_to_edge_map_s, *control_dependent_block_to_edge_map;
-
-/* Local function prototypes. */
-static control_dependent_block_to_edge_map control_dependent_block_to_edge_map_create
- (size_t num_basic_blocks);
-static void set_control_dependent_block_to_edge_map_bit
- (control_dependent_block_to_edge_map c, basic_block bb, int edge_index);
-static void control_dependent_block_to_edge_map_free
- (control_dependent_block_to_edge_map c);
-static void find_all_control_dependences
- (struct edge_list *el, dominance_info pdom,
- control_dependent_block_to_edge_map cdbte);
-static void find_control_dependence
- (struct edge_list *el, int edge_index, dominance_info pdom,
- control_dependent_block_to_edge_map cdbte);
-static basic_block find_pdom (dominance_info pdom, basic_block block);
-static int inherently_necessary_register_1 (rtx *current_rtx, void *data);
-static int inherently_necessary_register (rtx current_rtx);
-static int find_inherently_necessary (rtx current_rtx);
-static int propagate_necessity_through_operand (rtx *current_rtx, void *data);
-static void note_inherently_necessary_set (rtx, rtx, void *);
-
-/* Unnecessary insns are indicated using insns' in_struct bit. */
-
-/* Indicate INSN is dead-code; returns nothing. */
-#define KILL_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 1
-/* Indicate INSN is necessary, i.e., not dead-code; returns nothing. */
-#define RESURRECT_INSN(INSN) INSN_DEAD_CODE_P(INSN) = 0
-/* Return nonzero if INSN is unnecessary. */
-#define UNNECESSARY_P(INSN) INSN_DEAD_CODE_P(INSN)
-static void mark_all_insn_unnecessary (void);
-/* Execute CODE with free variable INSN for all unnecessary insns in
- an unspecified order, producing no output. */
-#define EXECUTE_IF_UNNECESSARY(INSN, CODE) \
-{ \
- rtx INSN; \
- \
- for (INSN = get_insns (); INSN != NULL_RTX; INSN = NEXT_INSN (INSN)) \
- if (INSN_P (insn) && INSN_DEAD_CODE_P (INSN)) \
- { \
- CODE; \
- } \
-}
-
-/* Find the label beginning block BB. */
-static rtx find_block_label (basic_block bb);
-/* Remove INSN, updating its basic block structure. */
-static void delete_insn_bb (rtx insn);
-
-/* Recording which blocks are control dependent on which edges. We
- expect each block to be control dependent on very few edges so we
- use a bitmap for each block recording its edges. An array holds
- the bitmap. Its position 0 entry holds the bitmap for block
- INVALID_BLOCK+1 so that all blocks, including the entry and exit
- blocks can participate in the data structure. */
-
-/* Create a control_dependent_block_to_edge_map, given the number
- NUM_BASIC_BLOCKS of non-entry, non-exit basic blocks, e.g.,
- n_basic_blocks. This memory must be released using
- control_dependent_block_to_edge_map_free (). */
-
-static control_dependent_block_to_edge_map
-control_dependent_block_to_edge_map_create (size_t num_basic_blocks)
-{
- int i;
- control_dependent_block_to_edge_map c
- = xmalloc (sizeof (control_dependent_block_to_edge_map_s));
- c->length = num_basic_blocks - (INVALID_BLOCK+1);
- c->data = xmalloc ((size_t) c->length*sizeof (bitmap));
- for (i = 0; i < c->length; ++i)
- c->data[i] = BITMAP_XMALLOC ();
-
- return c;
-}
-
-/* Indicate block BB is control dependent on an edge with index
- EDGE_INDEX in the mapping C of blocks to edges on which they are
- control-dependent. */
-
-static void
-set_control_dependent_block_to_edge_map_bit (control_dependent_block_to_edge_map c,
- basic_block bb, int edge_index)
-{
- if (bb->index - (INVALID_BLOCK+1) >= c->length)
- abort ();
-
- bitmap_set_bit (c->data[bb->index - (INVALID_BLOCK+1)],
- edge_index);
-}
-
-/* Execute CODE for each edge (given number EDGE_NUMBER within the
- CODE) for which the block containing INSN is control dependent,
- returning no output. CDBTE is the mapping of blocks to edges on
- which they are control-dependent. */
-
-#define EXECUTE_IF_CONTROL_DEPENDENT(CDBTE, INSN, EDGE_NUMBER, CODE) \
- EXECUTE_IF_SET_IN_BITMAP \
- (CDBTE->data[BLOCK_NUM (INSN) - (INVALID_BLOCK+1)], 0, \
- EDGE_NUMBER, CODE)
-
-/* Destroy a control_dependent_block_to_edge_map C. */
-
-static void
-control_dependent_block_to_edge_map_free (control_dependent_block_to_edge_map c)
-{
- int i;
- for (i = 0; i < c->length; ++i)
- BITMAP_XFREE (c->data[i]);
- free (c);
-}
-
-/* Record all blocks' control dependences on all edges in the edge
- list EL, ala Morgan, Section 3.6. The mapping PDOM of blocks to
- their postdominators are used, and results are stored in CDBTE,
- which should be empty. */
-
-static void
-find_all_control_dependences (struct edge_list *el, dominance_info pdom,
- control_dependent_block_to_edge_map cdbte)
-{
- int i;
-
- for (i = 0; i < NUM_EDGES (el); ++i)
- find_control_dependence (el, i, pdom, cdbte);
-}
-
-/* Determine all blocks' control dependences on the given edge with
- edge_list EL index EDGE_INDEX, ala Morgan, Section 3.6. The
- mapping PDOM of blocks to their postdominators are used, and
- results are stored in CDBTE, which is assumed to be initialized
- with zeros in each (block b', edge) position. */
-
-static void
-find_control_dependence (struct edge_list *el, int edge_index,
- dominance_info pdom,
- control_dependent_block_to_edge_map cdbte)
-{
- basic_block current_block;
- basic_block ending_block;
-
- if (INDEX_EDGE_PRED_BB (el, edge_index) == EXIT_BLOCK_PTR)
- abort ();
- ending_block =
- (INDEX_EDGE_PRED_BB (el, edge_index) == ENTRY_BLOCK_PTR)
- ? ENTRY_BLOCK_PTR->next_bb
- : find_pdom (pdom, INDEX_EDGE_PRED_BB (el, edge_index));
-
- for (current_block = INDEX_EDGE_SUCC_BB (el, edge_index);
- current_block != ending_block && current_block != EXIT_BLOCK_PTR;
- current_block = find_pdom (pdom, current_block))
- {
- set_control_dependent_block_to_edge_map_bit (cdbte,
- current_block,
- edge_index);
- }
-}
-
-/* Find the immediate postdominator PDOM of the specified basic block
- BLOCK. This function is necessary because some blocks have
- negative numbers. */
-
-static basic_block
-find_pdom (dominance_info pdom, basic_block block)
-{
- if (!block)
- abort ();
- if (block->index == INVALID_BLOCK)
- abort ();
-
- if (block == ENTRY_BLOCK_PTR)
- return ENTRY_BLOCK_PTR->next_bb;
- else if (block == EXIT_BLOCK_PTR)
- return EXIT_BLOCK_PTR;
- else
- {
- basic_block bb = get_immediate_dominator (pdom, block);
- if (!bb)
- return EXIT_BLOCK_PTR;
- return bb;
- }
-}
-
-/* Determine if the given CURRENT_RTX uses a hard register not
- converted to SSA. Returns nonzero only if it uses such a hard
- register. DATA is not used.
-
- The program counter (PC) is not considered inherently necessary
- since code should be position-independent and thus not depend on
- particular PC values. */
-
-static int
-inherently_necessary_register_1 (rtx *current_rtx,
- void *data ATTRIBUTE_UNUSED)
-{
- rtx x = *current_rtx;
-
- if (x == NULL_RTX)
- return 0;
- switch (GET_CODE (x))
- {
- case CLOBBER:
- /* Do not traverse the rest of the clobber. */
- return -1;
- break;
- case PC:
- return 0;
- break;
- case REG:
- if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)) || x == pc_rtx)
- return 0;
- else
- return !0;
- break;
- default:
- return 0;
- break;
- }
-}
-
-/* Return nonzero if the insn CURRENT_RTX is inherently necessary. */
-
-static int
-inherently_necessary_register (rtx current_rtx)
-{
- return for_each_rtx (&current_rtx,
- &inherently_necessary_register_1, NULL);
-}
-
-
-/* Called via note_stores for each store in an insn. Note whether
- or not a particular store is inherently necessary. Store a
- nonzero value in inherently_necessary_p if such a store is found. */
-
-static void
-note_inherently_necessary_set (rtx dest, rtx set ATTRIBUTE_UNUSED, void *data)
-{
- int *inherently_necessary_set_p = (int *) data;
-
- while (GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == STRICT_LOW_PART
- || GET_CODE (dest) == ZERO_EXTRACT
- || GET_CODE (dest) == SIGN_EXTRACT)
- dest = XEXP (dest, 0);
-
- if (GET_CODE (dest) == MEM
- || GET_CODE (dest) == UNSPEC
- || GET_CODE (dest) == UNSPEC_VOLATILE)
- *inherently_necessary_set_p = 1;
-}
-
-/* Mark X as inherently necessary if appropriate. For example,
- function calls and storing values into memory are inherently
- necessary. This function is to be used with for_each_rtx ().
- Return nonzero iff inherently necessary. */
-
-static int
-find_inherently_necessary (rtx x)
-{
- if (x == NULL_RTX)
- return 0;
- else if (inherently_necessary_register (x))
- return !0;
- else
- switch (GET_CODE (x))
- {
- case CALL_INSN:
- case BARRIER:
- case PREFETCH:
- return !0;
- case CODE_LABEL:
- case NOTE:
- return 0;
- case JUMP_INSN:
- return JUMP_TABLE_DATA_P (x) || computed_jump_p (x) != 0;
- case INSN:
- {
- int inherently_necessary_set = 0;
- note_stores (PATTERN (x),
- note_inherently_necessary_set,
- &inherently_necessary_set);
-
- /* If we found an inherently necessary set or an asm
- instruction, then we consider this insn inherently
- necessary. */
- return (inherently_necessary_set
- || GET_CODE (PATTERN (x)) == ASM_INPUT
- || asm_noperands (PATTERN (x)) >= 0);
- }
- default:
- /* Found an impossible insn type. */
- abort ();
- break;
- }
-}
-
-/* Propagate necessity through REG and SUBREG operands of CURRENT_RTX.
- This function is called with for_each_rtx () on necessary
- instructions. The DATA must be a varray of unprocessed
- instructions. */
-
-static int
-propagate_necessity_through_operand (rtx *current_rtx, void *data)
-{
- rtx x = *current_rtx;
- varray_type *unprocessed_instructions = (varray_type *) data;
-
- if (x == NULL_RTX)
- return 0;
- switch ( GET_CODE (x))
- {
- case REG:
- if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)))
- {
- rtx insn = VARRAY_RTX (ssa_definition, REGNO (x));
- if (insn != NULL_RTX && UNNECESSARY_P (insn))
- {
- RESURRECT_INSN (insn);
- VARRAY_PUSH_RTX (*unprocessed_instructions, insn);
- }
- }
- return 0;
-
- default:
- return 0;
- }
-}
-
-/* Indicate all insns initially assumed to be unnecessary. */
-
-static void
-mark_all_insn_unnecessary (void)
-{
- rtx insn;
- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) {
- if (INSN_P (insn))
- KILL_INSN (insn);
- }
-
-}
-
-/* Find the label beginning block BB, adding one if necessary. */
-
-static rtx
-find_block_label (basic_block bb)
-{
- rtx insn = bb->head;
- if (LABEL_P (insn))
- return insn;
- else
- {
- rtx new_label = emit_label_before (gen_label_rtx (), insn);
- if (insn == bb->head)
- bb->head = new_label;
- return new_label;
- }
-}
-
-/* Remove INSN, updating its basic block structure. */
-
-static void
-delete_insn_bb (rtx insn)
-{
- if (!insn)
- abort ();
-
- /* Do not actually delete anything that is not an INSN.
-
- We can get here because we only consider INSNs as
- potentially necessary. We leave it to later passes
- to remove unnecessary notes, unused labels, etc. */
- if (! INSN_P (insn))
- return;
-
- delete_insn (insn);
-}
-
-/* Perform the dead-code elimination. */
-
-void
-ssa_eliminate_dead_code (void)
-{
- rtx insn;
- basic_block bb;
- /* Necessary instructions with operands to explore. */
- varray_type unprocessed_instructions;
- /* Map element (b,e) is nonzero if the block is control dependent on
- edge. "cdbte" abbreviates control dependent block to edge. */
- control_dependent_block_to_edge_map cdbte;
- /* Element I is the immediate postdominator of block I. */
- dominance_info pdom;
- struct edge_list *el;
-
- /* Initialize the data structures. */
- mark_all_insn_unnecessary ();
- VARRAY_RTX_INIT (unprocessed_instructions, 64,
- "unprocessed instructions");
- cdbte = control_dependent_block_to_edge_map_create (last_basic_block);
-
- /* Prepare for use of BLOCK_NUM (). */
- connect_infinite_loops_to_exit ();
-
- /* Compute control dependence. */
- pdom = calculate_dominance_info (CDI_POST_DOMINATORS);
- el = create_edge_list ();
- find_all_control_dependences (el, pdom, cdbte);
-
- /* Find inherently necessary instructions. */
- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn))
- if (find_inherently_necessary (insn) && INSN_P (insn))
- {
- RESURRECT_INSN (insn);
- VARRAY_PUSH_RTX (unprocessed_instructions, insn);
- }
-
- /* Propagate necessity using the operands of necessary instructions. */
- while (VARRAY_ACTIVE_SIZE (unprocessed_instructions) > 0)
- {
- rtx current_instruction;
- int edge_number;
-
- current_instruction = VARRAY_TOP_RTX (unprocessed_instructions);
- VARRAY_POP (unprocessed_instructions);
-
- /* Make corresponding control dependent edges necessary. */
- /* Assume the only JUMP_INSN is the block's last insn. It appears
- that the last instruction of the program need not be a
- JUMP_INSN. */
-
- if (INSN_P (current_instruction)
- && !JUMP_TABLE_DATA_P (current_instruction))
- {
- /* Notes and labels contain no interesting operands. */
- EXECUTE_IF_CONTROL_DEPENDENT
- (cdbte, current_instruction, edge_number,
- {
- rtx jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end;
- if (GET_CODE (jump_insn) == JUMP_INSN
- && UNNECESSARY_P (jump_insn))
- {
- RESURRECT_INSN (jump_insn);
- VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn);
- }
- });
-
- /* Propagate through the operands. */
- for_each_rtx (&current_instruction,
- &propagate_necessity_through_operand,
- &unprocessed_instructions);
-
- /* PHI nodes are somewhat special in that each PHI alternative
- has data and control dependencies. The data dependencies
- are handled via propagate_necessity_through_operand. We
- handle the control dependency here.
-
- We consider the control dependent edges leading to the
- predecessor block associated with each PHI alternative
- as necessary. */
- if (PHI_NODE_P (current_instruction))
- {
- rtvec phi_vec = XVEC (SET_SRC (PATTERN (current_instruction)), 0);
- int num_elem = GET_NUM_ELEM (phi_vec);
- int v;
-
- for (v = num_elem - 2; v >= 0; v -= 2)
- {
- basic_block bb;
-
- bb = BASIC_BLOCK (INTVAL (RTVEC_ELT (phi_vec, v + 1)));
- EXECUTE_IF_CONTROL_DEPENDENT
- (cdbte, bb->end, edge_number,
- {
- rtx jump_insn;
-
- jump_insn = (INDEX_EDGE_PRED_BB (el, edge_number))->end;
- if (((GET_CODE (jump_insn) == JUMP_INSN))
- && UNNECESSARY_P (jump_insn))
- {
- RESURRECT_INSN (jump_insn);
- VARRAY_PUSH_RTX (unprocessed_instructions, jump_insn);
- }
- });
-
- }
- }
- }
- }
-
- /* Remove the unnecessary instructions. */
- EXECUTE_IF_UNNECESSARY (insn,
- {
- if (any_condjump_p (insn))
- {
- basic_block bb = BLOCK_FOR_INSN (insn);
- basic_block pdom_bb = find_pdom (pdom, bb);
- rtx lbl;
- edge e;
-
- /* Egad. The immediate post dominator is the exit block. We
- would like to optimize this conditional jump to jump directly
- to the exit block. That can be difficult as we may not have
- a suitable CODE_LABEL that allows us to fall unmolested into
- the exit block.
-
- So, we just delete the conditional branch by turning it into
- a deleted note. That is safe, but just not as optimal as
- it could be. */
- if (pdom_bb == EXIT_BLOCK_PTR)
- {
- /* Since we're going to just delete the branch, we need
- look at all the edges and remove all those which are not
- a fallthru edge. */
- e = bb->succ;
- while (e)
- {
- edge temp = e;
-
- e = e->succ_next;
- if ((temp->flags & EDGE_FALLTHRU) == 0)
- {
- /* We've found a non-fallthru edge, find any PHI nodes
- at the target and clean them up. */
- if (temp->dest != EXIT_BLOCK_PTR)
- {
- rtx insn
- = first_insn_after_basic_block_note (temp->dest);
-
- while (PHI_NODE_P (insn))
- {
- remove_phi_alternative (PATTERN (insn), temp->src);
- insn = NEXT_INSN (insn);
- }
- }
-
- remove_edge (temp);
- }
- }
-
- /* Now "delete" the conditional jump. */
- PUT_CODE (insn, NOTE);
- NOTE_LINE_NUMBER (insn) = NOTE_INSN_DELETED;
- continue;
- }
-
- /* We've found a conditional branch that is unnecessary.
-
- First, remove all outgoing edges from this block, updating
- PHI nodes as appropriate. */
- e = bb->succ;
- while (e)
- {
- edge temp = e;
-
- e = e->succ_next;
-
- if (temp->flags & EDGE_ABNORMAL)
- continue;
-
- /* We found an edge that is not executable. First simplify
- the PHI nodes in the target block. */
- if (temp->dest != EXIT_BLOCK_PTR)
- {
- rtx insn = first_insn_after_basic_block_note (temp->dest);
-
- while (PHI_NODE_P (insn))
- {
- remove_phi_alternative (PATTERN (insn), temp->src);
- insn = NEXT_INSN (insn);
- }
- }
-
- remove_edge (temp);
- }
-
- /* Create an edge from this block to the post dominator.
- What about the PHI nodes at the target? */
- make_edge (bb, pdom_bb, 0);
-
- /* Third, transform this insn into an unconditional
- jump to the label for the immediate postdominator. */
- lbl = find_block_label (pdom_bb);
- SET_SRC (PATTERN (insn)) = gen_rtx_LABEL_REF (VOIDmode, lbl);
- INSN_CODE (insn) = -1;
- JUMP_LABEL (insn) = lbl;
- LABEL_NUSES (lbl)++;
-
- /* A barrier must follow any unconditional jump. Barriers
- are not in basic blocks so this must occur after
- deleting the conditional jump. */
- emit_barrier_after (insn);
- }
- else if (!JUMP_P (insn))
- delete_insn_bb (insn);
- });
-
- /* Remove fake edges from the CFG. */
- remove_fake_edges ();
-
- /* Find any blocks with no successors and ensure they are followed
- by a BARRIER. delete_insn has the nasty habit of deleting barriers
- when deleting insns. */
- FOR_EACH_BB (bb)
- {
- if (bb->succ == NULL)
- {
- rtx next = NEXT_INSN (bb->end);
-
- if (!next || GET_CODE (next) != BARRIER)
- emit_barrier_after (bb->end);
- }
- }
- /* Release allocated memory. */
- for (insn = get_insns (); insn != NULL_RTX; insn = NEXT_INSN (insn)) {
- if (INSN_P (insn))
- RESURRECT_INSN (insn);
- }
-
- if (VARRAY_ACTIVE_SIZE (unprocessed_instructions) != 0)
- abort ();
- control_dependent_block_to_edge_map_free (cdbte);
- free (pdom);
- free_edge_list (el);
-}
diff --git a/gcc/ssa.c b/gcc/ssa.c
deleted file mode 100644
index c12cdbe7afb..00000000000
--- a/gcc/ssa.c
+++ /dev/null
@@ -1,2214 +0,0 @@
-/* Static Single Assignment conversion routines for the GNU compiler.
- Copyright (C) 2000, 2001, 2002, 2003
- 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. */
-
-/* References:
-
- Building an Optimizing Compiler
- Robert Morgan
- Butterworth-Heinemann, 1998
-
- Static Single Assignment Construction
- Preston Briggs, Tim Harvey, Taylor Simpson
- Technical Report, Rice University, 1995
- ftp://ftp.cs.rice.edu/public/preston/optimizer/SSA.ps.gz. */
-
-#include "config.h"
-#include "system.h"
-#include "coretypes.h"
-#include "tm.h"
-
-#include "rtl.h"
-#include "expr.h"
-#include "varray.h"
-#include "partition.h"
-#include "sbitmap.h"
-#include "hashtab.h"
-#include "regs.h"
-#include "hard-reg-set.h"
-#include "flags.h"
-#include "function.h"
-#include "real.h"
-#include "insn-config.h"
-#include "recog.h"
-#include "basic-block.h"
-#include "output.h"
-#include "ssa.h"
-
-/* TODO:
-
- Handle subregs better, maybe. For now, if a reg that's set in a
- subreg expression is duplicated going into SSA form, an extra copy
- is inserted first that copies the entire reg into the duplicate, so
- that the other bits are preserved. This isn't strictly SSA, since
- at least part of the reg is assigned in more than one place (though
- they are adjacent).
-
- ??? What to do about strict_low_part. Probably I'll have to split
- them out of their current instructions first thing.
-
- Actually the best solution may be to have a kind of "mid-level rtl"
- in which the RTL encodes exactly what we want, without exposing a
- lot of niggling processor details. At some later point we lower
- the representation, calling back into optabs to finish any necessary
- expansion. */
-
-/* All pseudo-registers and select hard registers are converted to SSA
- form. When converting out of SSA, these select hard registers are
- guaranteed to be mapped to their original register number. Each
- machine's .h file should define CONVERT_HARD_REGISTER_TO_SSA_P
- indicating which hard registers should be converted.
-
- When converting out of SSA, temporaries for all registers are
- partitioned. The partition is checked to ensure that all uses of
- the same hard register in the same machine mode are in the same
- class. */
-
-/* If conservative_reg_partition is nonzero, use a conservative
- register partitioning algorithm (which leaves more regs after
- emerging from SSA) instead of the coalescing one. This is being
- left in for a limited time only, as a debugging tool until the
- coalescing algorithm is validated. */
-
-static int conservative_reg_partition;
-
-/* This flag is set when the CFG is in SSA form. */
-int in_ssa_form = 0;
-
-/* Element I is the single instruction that sets register I. */
-varray_type ssa_definition;
-
-/* Element I-PSEUDO is the normal register that originated the ssa
- register in question. */
-varray_type ssa_rename_from;
-
-/* Element I is the normal register that originated the ssa
- register in question.
-
- A hash table stores the (register, rtl) pairs. These are each
- xmalloc'ed and deleted when the hash table is destroyed. */
-htab_t ssa_rename_from_ht;
-
-/* The running target ssa register for a given pseudo register.
- (Pseudo registers appear in only one mode.) */
-static rtx *ssa_rename_to_pseudo;
-/* Similar, but for hard registers. A hard register can appear in
- many modes, so we store an equivalent pseudo for each of the
- modes. */
-static rtx ssa_rename_to_hard[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
-
-/* ssa_rename_from maps pseudo registers to the original corresponding
- RTL. It is implemented as using a hash table. */
-
-typedef struct {
- unsigned int reg;
- rtx original;
-} ssa_rename_from_pair;
-
-struct ssa_rename_from_hash_table_data {
- sbitmap canonical_elements;
- partition reg_partition;
-};
-
-static rtx gen_sequence (void);
-static void ssa_rename_from_initialize (void);
-static rtx ssa_rename_from_lookup (int reg);
-static unsigned int original_register (unsigned int regno);
-static void ssa_rename_from_insert (unsigned int reg, rtx r);
-static void ssa_rename_from_free (void);
-typedef int (*srf_trav) (int regno, rtx r, sbitmap canonical_elements,
- partition reg_partition);
-static void ssa_rename_from_traverse (htab_trav callback_function,
- sbitmap canonical_elements, partition reg_partition);
-/*static Avoid warning message. */ void ssa_rename_from_print (void);
-static int ssa_rename_from_print_1 (void **slot, void *data);
-static hashval_t ssa_rename_from_hash_function (const void * srfp);
-static int ssa_rename_from_equal (const void *srfp1, const void *srfp2);
-static void ssa_rename_from_delete (void *srfp);
-
-static rtx ssa_rename_to_lookup (rtx reg);
-static void ssa_rename_to_insert (rtx reg, rtx r);
-
-/* The number of registers that were live on entry to the SSA routines. */
-static unsigned int ssa_max_reg_num;
-
-/* Local function prototypes. */
-
-struct rename_context;
-
-static inline rtx * phi_alternative (rtx, int);
-static void compute_dominance_frontiers_1 (sbitmap *frontiers,
- dominance_info idom, int bb,
- sbitmap done);
-static void find_evaluations_1 (rtx dest, rtx set, void *data);
-static void find_evaluations (sbitmap *evals, int nregs);
-static void compute_iterated_dominance_frontiers (sbitmap *idfs,
- sbitmap *frontiers,
- sbitmap *evals, int nregs);
-static void insert_phi_node (int regno, int b);
-static void insert_phi_nodes (sbitmap *idfs, sbitmap *evals, int nregs);
-static void create_delayed_rename (struct rename_context *, rtx *);
-static void apply_delayed_renames (struct rename_context *);
-static int rename_insn_1 (rtx *ptr, void *data);
-static void rename_block (int b, dominance_info dom);
-static void rename_registers (int nregs, dominance_info idom);
-
-static inline int ephi_add_node (rtx reg, rtx *nodes, int *n_nodes);
-static int * ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack);
-static void ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes);
-static void ephi_create (int t, sbitmap visited, sbitmap *pred,
- sbitmap *succ, rtx *nodes);
-static void eliminate_phi (edge e, partition reg_partition);
-static int make_regs_equivalent_over_bad_edges (int bb,
- partition reg_partition);
-
-/* These are used only in the conservative register partitioning
- algorithms. */
-static int make_equivalent_phi_alternatives_equivalent
- (int bb, partition reg_partition);
-static partition compute_conservative_reg_partition (void);
-static int record_canonical_element_1 (void **srfp, void *data);
-static int check_hard_regs_in_partition (partition reg_partition);
-
-/* These are used in the register coalescing algorithm. */
-static int coalesce_if_unconflicting (partition p, conflict_graph conflicts,
- int reg1, int reg2);
-static int coalesce_regs_in_copies (basic_block bb, partition p,
- conflict_graph conflicts);
-static int coalesce_reg_in_phi (rtx, int dest_regno, int src_regno,
- void *data);
-static int coalesce_regs_in_successor_phi_nodes (basic_block bb,
- partition p,
- conflict_graph conflicts);
-static partition compute_coalesced_reg_partition (void);
-static int mark_reg_in_phi (rtx *ptr, void *data);
-static void mark_phi_and_copy_regs (regset phi_set);
-
-static int rename_equivalent_regs_in_insn (rtx *ptr, void *data);
-static void rename_equivalent_regs (partition reg_partition);
-
-/* Deal with hard registers. */
-static int conflicting_hard_regs_p (int reg1, int reg2);
-
-/* ssa_rename_to maps registers and machine modes to SSA pseudo registers. */
-
-/* Find the register associated with REG in the indicated mode. */
-
-static rtx
-ssa_rename_to_lookup (rtx reg)
-{
- if (!HARD_REGISTER_P (reg))
- return ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER];
- else
- return ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)];
-}
-
-/* Store a new value mapping REG to R in ssa_rename_to. */
-
-static void
-ssa_rename_to_insert (rtx reg, rtx r)
-{
- if (!HARD_REGISTER_P (reg))
- ssa_rename_to_pseudo[REGNO (reg) - FIRST_PSEUDO_REGISTER] = r;
- else
- ssa_rename_to_hard[REGNO (reg)][GET_MODE (reg)] = r;
-}
-
-/* Prepare ssa_rename_from for use. */
-
-static void
-ssa_rename_from_initialize (void)
-{
- /* We use an arbitrary initial hash table size of 64. */
- ssa_rename_from_ht = htab_create (64,
- &ssa_rename_from_hash_function,
- &ssa_rename_from_equal,
- &ssa_rename_from_delete);
-}
-
-/* Find the REG entry in ssa_rename_from. Return NULL_RTX if no entry is
- found. */
-
-static rtx
-ssa_rename_from_lookup (int reg)
-{
- ssa_rename_from_pair srfp;
- ssa_rename_from_pair *answer;
- srfp.reg = reg;
- srfp.original = NULL_RTX;
- answer = htab_find_with_hash (ssa_rename_from_ht, (void *) &srfp, reg);
- return (answer == 0 ? NULL_RTX : answer->original);
-}
-
-/* Find the number of the original register specified by REGNO. If
- the register is a pseudo, return the original register's number.
- Otherwise, return this register number REGNO. */
-
-static unsigned int
-original_register (unsigned int regno)
-{
- rtx original_rtx = ssa_rename_from_lookup (regno);
- return original_rtx != NULL_RTX ? REGNO (original_rtx) : regno;
-}
-
-/* Add mapping from R to REG to ssa_rename_from even if already present. */
-
-static void
-ssa_rename_from_insert (unsigned int reg, rtx r)
-{
- void **slot;
- ssa_rename_from_pair *srfp = xmalloc (sizeof (ssa_rename_from_pair));
- srfp->reg = reg;
- srfp->original = r;
- slot = htab_find_slot_with_hash (ssa_rename_from_ht, (const void *) srfp,
- reg, INSERT);
- if (*slot != 0)
- free ((void *) *slot);
- *slot = srfp;
-}
-
-/* Apply the CALLBACK_FUNCTION to each element in ssa_rename_from.
- CANONICAL_ELEMENTS and REG_PARTITION pass data needed by the only
- current use of this function. */
-
-static void
-ssa_rename_from_traverse (htab_trav callback_function,
- sbitmap canonical_elements, partition reg_partition)
-{
- struct ssa_rename_from_hash_table_data srfhd;
- srfhd.canonical_elements = canonical_elements;
- srfhd.reg_partition = reg_partition;
- htab_traverse (ssa_rename_from_ht, callback_function, (void *) &srfhd);
-}
-
-/* Destroy ssa_rename_from. */
-
-static void
-ssa_rename_from_free (void)
-{
- htab_delete (ssa_rename_from_ht);
-}
-
-/* Print the contents of ssa_rename_from. */
-
-/* static Avoid erroneous error message. */
-void
-ssa_rename_from_print (void)
-{
- printf ("ssa_rename_from's hash table contents:\n");
- htab_traverse (ssa_rename_from_ht, &ssa_rename_from_print_1, NULL);
-}
-
-/* Print the contents of the hash table entry SLOT, passing the unused
- attribute DATA. Used as a callback function with htab_traverse (). */
-
-static int
-ssa_rename_from_print_1 (void **slot, void *data ATTRIBUTE_UNUSED)
-{
- ssa_rename_from_pair * p = *slot;
- printf ("ssa_rename_from maps pseudo %i to original %i.\n",
- p->reg, REGNO (p->original));
- return 1;
-}
-
-/* Given a hash entry SRFP, yield a hash value. */
-
-static hashval_t
-ssa_rename_from_hash_function (const void *srfp)
-{
- return ((const ssa_rename_from_pair *) srfp)->reg;
-}
-
-/* Test whether two hash table entries SRFP1 and SRFP2 are equal. */
-
-static int
-ssa_rename_from_equal (const void *srfp1, const void *srfp2)
-{
- return ssa_rename_from_hash_function (srfp1) ==
- ssa_rename_from_hash_function (srfp2);
-}
-
-/* Delete the hash table entry SRFP. */
-
-static void
-ssa_rename_from_delete (void *srfp)
-{
- free (srfp);
-}
-
-/* Given the SET of a PHI node, return the address of the alternative
- for predecessor block C. */
-
-static inline rtx *
-phi_alternative (rtx set, int c)
-{
- rtvec phi_vec = XVEC (SET_SRC (set), 0);
- int v;
-
- for (v = GET_NUM_ELEM (phi_vec) - 2; v >= 0; v -= 2)
- if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c)
- return &RTVEC_ELT (phi_vec, v);
-
- return NULL;
-}
-
-/* Given the SET of a phi node, remove the alternative for predecessor
- block C. Return nonzero on success, or zero if no alternative is
- found for C. */
-
-int
-remove_phi_alternative (rtx set, basic_block block)
-{
- rtvec phi_vec = XVEC (SET_SRC (set), 0);
- int num_elem = GET_NUM_ELEM (phi_vec);
- int v, c;
-
- c = block->index;
- for (v = num_elem - 2; v >= 0; v -= 2)
- if (INTVAL (RTVEC_ELT (phi_vec, v + 1)) == c)
- {
- if (v < num_elem - 2)
- {
- RTVEC_ELT (phi_vec, v) = RTVEC_ELT (phi_vec, num_elem - 2);
- RTVEC_ELT (phi_vec, v + 1) = RTVEC_ELT (phi_vec, num_elem - 1);
- }
- PUT_NUM_ELEM (phi_vec, num_elem - 2);
- return 1;
- }
-
- return 0;
-}
-
-/* For all registers, find all blocks in which they are set.
-
- This is the transform of what would be local kill information that
- we ought to be getting from flow. */
-
-static sbitmap *fe_evals;
-static int fe_current_bb;
-
-static void
-find_evaluations_1 (rtx dest, rtx set ATTRIBUTE_UNUSED,
- void *data ATTRIBUTE_UNUSED)
-{
- if (GET_CODE (dest) == REG
- && CONVERT_REGISTER_TO_SSA_P (REGNO (dest)))
- SET_BIT (fe_evals[REGNO (dest)], fe_current_bb);
-}
-
-static void
-find_evaluations (sbitmap *evals, int nregs)
-{
- basic_block bb;
-
- sbitmap_vector_zero (evals, nregs);
- fe_evals = evals;
-
- FOR_EACH_BB_REVERSE (bb)
- {
- rtx p, last;
-
- fe_current_bb = bb->index;
- p = bb->head;
- last = bb->end;
- while (1)
- {
- if (INSN_P (p))
- note_stores (PATTERN (p), find_evaluations_1, NULL);
-
- if (p == last)
- break;
- p = NEXT_INSN (p);
- }
- }
-}
-
-/* Computing the Dominance Frontier:
-
- As described in Morgan, section 3.5, this may be done simply by
- walking the dominator tree bottom-up, computing the frontier for
- the children before the parent. When considering a block B,
- there are two cases:
-
- (1) A flow graph edge leaving B that does not lead to a child
- of B in the dominator tree must be a block that is either equal
- to B or not dominated by B. Such blocks belong in the frontier
- of B.
-
- (2) Consider a block X in the frontier of one of the children C
- of B. If X is not equal to B and is not dominated by B, it
- is in the frontier of B.
-*/
-
-static void
-compute_dominance_frontiers_1 (sbitmap *frontiers, dominance_info idom,
- int bb, sbitmap done)
-{
- basic_block b = BASIC_BLOCK (bb);
- edge e;
- basic_block c;
-
- SET_BIT (done, bb);
- sbitmap_zero (frontiers[bb]);
-
- /* Do the frontier of the children first. Not all children in the
- dominator tree (blocks dominated by this one) are children in the
- CFG, so check all blocks. */
- FOR_EACH_BB (c)
- if (get_immediate_dominator (idom, c)->index == bb
- && ! TEST_BIT (done, c->index))
- compute_dominance_frontiers_1 (frontiers, idom, c->index, done);
-
- /* Find blocks conforming to rule (1) above. */
- for (e = b->succ; e; e = e->succ_next)
- {
- if (e->dest == EXIT_BLOCK_PTR)
- continue;
- if (get_immediate_dominator (idom, e->dest)->index != bb)
- SET_BIT (frontiers[bb], e->dest->index);
- }
-
- /* Find blocks conforming to rule (2). */
- FOR_EACH_BB (c)
- if (get_immediate_dominator (idom, c)->index == bb)
- {
- int x;
- EXECUTE_IF_SET_IN_SBITMAP (frontiers[c->index], 0, x,
- {
- if (get_immediate_dominator (idom, BASIC_BLOCK (x))->index != bb)
- SET_BIT (frontiers[bb], x);
- });
- }
-}
-
-void
-compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom)
-{
- sbitmap done = sbitmap_alloc (last_basic_block);
- sbitmap_zero (done);
-
- compute_dominance_frontiers_1 (frontiers, idom, 0, done);
-
- sbitmap_free (done);
-}
-
-/* Computing the Iterated Dominance Frontier:
-
- This is the set of merge points for a given register.
-
- This is not particularly intuitive. See section 7.1 of Morgan, in
- particular figures 7.3 and 7.4 and the immediately surrounding text.
-*/
-
-static void
-compute_iterated_dominance_frontiers (sbitmap *idfs, sbitmap *frontiers,
- sbitmap *evals, int nregs)
-{
- sbitmap worklist;
- int reg, passes = 0;
-
- worklist = sbitmap_alloc (last_basic_block);
-
- for (reg = 0; reg < nregs; ++reg)
- {
- sbitmap idf = idfs[reg];
- int b, changed;
-
- /* Start the iterative process by considering those blocks that
- evaluate REG. We'll add their dominance frontiers to the
- IDF, and then consider the blocks we just added. */
- sbitmap_copy (worklist, evals[reg]);
-
- /* Morgan's algorithm is incorrect here. Blocks that evaluate
- REG aren't necessarily in REG's IDF. Start with an empty IDF. */
- sbitmap_zero (idf);
-
- /* Iterate until the worklist is empty. */
- do
- {
- changed = 0;
- passes++;
- EXECUTE_IF_SET_IN_SBITMAP (worklist, 0, b,
- {
- RESET_BIT (worklist, b);
- /* For each block on the worklist, add to the IDF all
- blocks on its dominance frontier that aren't already
- on the IDF. Every block that's added is also added
- to the worklist. */
- sbitmap_union_of_diff (worklist, worklist, frontiers[b], idf);
- sbitmap_a_or_b (idf, idf, frontiers[b]);
- changed = 1;
- });
- }
- while (changed);
- }
-
- sbitmap_free (worklist);
-
- if (rtl_dump_file)
- {
- fprintf (rtl_dump_file,
- "Iterated dominance frontier: %d passes on %d regs.\n",
- passes, nregs);
- }
-}
-
-/* Insert the phi nodes. */
-
-static void
-insert_phi_node (int regno, int bb)
-{
- basic_block b = BASIC_BLOCK (bb);
- edge e;
- int npred, i;
- rtvec vec;
- rtx phi, reg;
- rtx insn;
- int end_p;
-
- /* Find out how many predecessors there are. */
- for (e = b->pred, npred = 0; e; e = e->pred_next)
- if (e->src != ENTRY_BLOCK_PTR)
- npred++;
-
- /* If this block has no "interesting" preds, then there is nothing to
- do. Consider a block that only has the entry block as a pred. */
- if (npred == 0)
- return;
-
- /* This is the register to which the phi function will be assigned. */
- reg = regno_reg_rtx[regno];
-
- /* Construct the arguments to the PHI node. The use of pc_rtx is just
- a placeholder; we'll insert the proper value in rename_registers. */
- vec = rtvec_alloc (npred * 2);
- for (e = b->pred, i = 0; e ; e = e->pred_next, i += 2)
- if (e->src != ENTRY_BLOCK_PTR)
- {
- RTVEC_ELT (vec, i + 0) = pc_rtx;
- RTVEC_ELT (vec, i + 1) = GEN_INT (e->src->index);
- }
-
- phi = gen_rtx_PHI (VOIDmode, vec);
- phi = gen_rtx_SET (VOIDmode, reg, phi);
-
- insn = first_insn_after_basic_block_note (b);
- end_p = PREV_INSN (insn) == b->end;
- emit_insn_before (phi, insn);
- if (end_p)
- b->end = PREV_INSN (insn);
-}
-
-static void
-insert_phi_nodes (sbitmap *idfs, sbitmap *evals ATTRIBUTE_UNUSED, int nregs)
-{
- int reg;
-
- for (reg = 0; reg < nregs; ++reg)
- if (CONVERT_REGISTER_TO_SSA_P (reg))
- {
- int b;
- EXECUTE_IF_SET_IN_SBITMAP (idfs[reg], 0, b,
- {
- if (REGNO_REG_SET_P (BASIC_BLOCK (b)->global_live_at_start, reg))
- insert_phi_node (reg, b);
- });
- }
-}
-
-/* Rename the registers to conform to SSA.
-
- This is essentially the algorithm presented in Figure 7.8 of Morgan,
- with a few changes to reduce pattern search time in favor of a bit
- more memory usage. */
-
-/* One of these is created for each set. It will live in a list local
- to its basic block for the duration of that block's processing. */
-struct rename_set_data
-{
- struct rename_set_data *next;
- /* This is the SET_DEST of the (first) SET that sets the REG. */
- rtx *reg_loc;
- /* This is what used to be at *REG_LOC. */
- rtx old_reg;
- /* This is the REG that will replace OLD_REG. It's set only
- when the rename data is moved onto the DONE_RENAMES queue. */
- rtx new_reg;
- /* This is what to restore ssa_rename_to_lookup (old_reg) to. It is
- usually the previous contents of ssa_rename_to_lookup (old_reg). */
- rtx prev_reg;
- /* This is the insn that contains all the SETs of the REG. */
- rtx set_insn;
-};
-
-/* This struct is used to pass information to callback functions while
- renaming registers. */
-struct rename_context
-{
- struct rename_set_data *new_renames;
- struct rename_set_data *done_renames;
- rtx current_insn;
-};
-
-/* Queue the rename of *REG_LOC. */
-static void
-create_delayed_rename (struct rename_context *c, rtx *reg_loc)
-{
- struct rename_set_data *r;
- r = xmalloc (sizeof(*r));
-
- if (GET_CODE (*reg_loc) != REG
- || !CONVERT_REGISTER_TO_SSA_P (REGNO (*reg_loc)))
- abort ();
-
- r->reg_loc = reg_loc;
- r->old_reg = *reg_loc;
- r->prev_reg = ssa_rename_to_lookup(r->old_reg);
- r->set_insn = c->current_insn;
- r->next = c->new_renames;
- c->new_renames = r;
-}
-
-/* This is part of a rather ugly hack to allow the pre-ssa regno to be
- reused. If, during processing, a register has not yet been touched,
- ssa_rename_to[regno][machno] will be NULL. Now, in the course of pushing
- and popping values from ssa_rename_to, when we would ordinarily
- pop NULL back in, we pop RENAME_NO_RTX. We treat this exactly the
- same as NULL, except that it signals that the original regno has
- already been reused. */
-#define RENAME_NO_RTX pc_rtx
-
-/* Move all the entries from NEW_RENAMES onto DONE_RENAMES by
- applying all the renames on NEW_RENAMES. */
-
-static void
-apply_delayed_renames (struct rename_context *c)
-{
- struct rename_set_data *r;
- struct rename_set_data *last_r = NULL;
-
- for (r = c->new_renames; r != NULL; r = r->next)
- {
- int new_regno;
-
- /* Failure here means that someone has a PARALLEL that sets
- a register twice (bad!). */
- if (ssa_rename_to_lookup (r->old_reg) != r->prev_reg)
- abort ();
- /* Failure here means we have changed REG_LOC before applying
- the rename. */
- /* For the first set we come across, reuse the original regno. */
- if (r->prev_reg == NULL_RTX && !HARD_REGISTER_P (r->old_reg))
- {
- r->new_reg = r->old_reg;
- /* We want to restore RENAME_NO_RTX rather than NULL_RTX. */
- r->prev_reg = RENAME_NO_RTX;
- }
- else
- r->new_reg = gen_reg_rtx (GET_MODE (r->old_reg));
- new_regno = REGNO (r->new_reg);
- ssa_rename_to_insert (r->old_reg, r->new_reg);
-
- if (new_regno >= (int) ssa_definition->num_elements)
- {
- int new_limit = new_regno * 5 / 4;
- VARRAY_GROW (ssa_definition, new_limit);
- }
-
- VARRAY_RTX (ssa_definition, new_regno) = r->set_insn;
- ssa_rename_from_insert (new_regno, r->old_reg);
- last_r = r;
- }
- if (last_r != NULL)
- {
- last_r->next = c->done_renames;
- c->done_renames = c->new_renames;
- c->new_renames = NULL;
- }
-}
-
-/* Part one of the first step of rename_block, called through for_each_rtx.
- Mark pseudos that are set for later update. Transform uses of pseudos. */
-
-static int
-rename_insn_1 (rtx *ptr, void *data)
-{
- rtx x = *ptr;
- struct rename_context *context = data;
-
- if (x == NULL_RTX)
- return 0;
-
- switch (GET_CODE (x))
- {
- case SET:
- {
- rtx *destp = &SET_DEST (x);
- rtx dest = SET_DEST (x);
-
- /* An assignment to a paradoxical SUBREG does not read from
- the destination operand, and thus does not need to be
- wrapped into a SEQUENCE when translating into SSA form.
- We merely strip off the SUBREG and proceed normally for
- this case. */
- if (GET_CODE (dest) == SUBREG
- && (GET_MODE_SIZE (GET_MODE (dest))
- > GET_MODE_SIZE (GET_MODE (SUBREG_REG (dest))))
- && GET_CODE (SUBREG_REG (dest)) == REG
- && CONVERT_REGISTER_TO_SSA_P (REGNO (SUBREG_REG (dest))))
- {
- destp = &XEXP (dest, 0);
- dest = XEXP (dest, 0);
- }
-
- /* Some SETs also use the REG specified in their LHS.
- These can be detected by the presence of
- STRICT_LOW_PART, SUBREG, SIGN_EXTRACT, and ZERO_EXTRACT
- in the LHS. Handle these by changing
- (set (subreg (reg foo)) ...)
- into
- (sequence [(set (reg foo_1) (reg foo))
- (set (subreg (reg foo_1)) ...)])
-
- FIXME: Much of the time this is too much. For some constructs
- we know that the output register is strictly an output
- (paradoxical SUBREGs and some libcalls for example).
-
- For those cases we are better off not making the false
- dependency. */
- if (GET_CODE (dest) == STRICT_LOW_PART
- || GET_CODE (dest) == SUBREG
- || GET_CODE (dest) == SIGN_EXTRACT
- || GET_CODE (dest) == ZERO_EXTRACT)
- {
- rtx i, reg;
- reg = dest;
-
- while (GET_CODE (reg) == STRICT_LOW_PART
- || GET_CODE (reg) == SUBREG
- || GET_CODE (reg) == SIGN_EXTRACT
- || GET_CODE (reg) == ZERO_EXTRACT)
- reg = XEXP (reg, 0);
-
- if (GET_CODE (reg) == REG
- && CONVERT_REGISTER_TO_SSA_P (REGNO (reg)))
- {
- /* Generate (set reg reg), and do renaming on it so
- that it becomes (set reg_1 reg_0), and we will
- replace reg with reg_1 in the SUBREG. */
-
- struct rename_set_data *saved_new_renames;
- saved_new_renames = context->new_renames;
- context->new_renames = NULL;
- i = emit_insn (gen_rtx_SET (VOIDmode, reg, reg));
- for_each_rtx (&i, rename_insn_1, data);
- apply_delayed_renames (context);
- context->new_renames = saved_new_renames;
- }
- }
- else if (GET_CODE (dest) == REG
- && CONVERT_REGISTER_TO_SSA_P (REGNO (dest)))
- {
- /* We found a genuine set of an interesting register. Tag
- it so that we can create a new name for it after we finish
- processing this insn. */
-
- create_delayed_rename (context, destp);
-
- /* Since we do not wish to (directly) traverse the
- SET_DEST, recurse through for_each_rtx for the SET_SRC
- and return. */
- if (GET_CODE (x) == SET)
- for_each_rtx (&SET_SRC (x), rename_insn_1, data);
- return -1;
- }
-
- /* Otherwise, this was not an interesting destination. Continue
- on, marking uses as normal. */
- return 0;
- }
-
- case REG:
- if (CONVERT_REGISTER_TO_SSA_P (REGNO (x))
- && REGNO (x) < ssa_max_reg_num)
- {
- rtx new_reg = ssa_rename_to_lookup (x);
-
- if (new_reg != RENAME_NO_RTX && new_reg != NULL_RTX)
- {
- if (GET_MODE (x) != GET_MODE (new_reg))
- abort ();
- *ptr = new_reg;
- }
- else
- {
- /* Undefined value used, rename it to a new pseudo register so
- that it cannot conflict with an existing register. */
- *ptr = gen_reg_rtx (GET_MODE (x));
- }
- }
- return -1;
-
- case CLOBBER:
- /* There is considerable debate on how CLOBBERs ought to be
- handled in SSA. For now, we're keeping the CLOBBERs, which
- means that we don't really have SSA form. There are a couple
- of proposals for how to fix this problem, but neither is
- implemented yet. */
- {
- rtx dest = XCEXP (x, 0, CLOBBER);
- if (REG_P (dest))
- {
- if (CONVERT_REGISTER_TO_SSA_P (REGNO (dest))
- && REGNO (dest) < ssa_max_reg_num)
- {
- rtx new_reg = ssa_rename_to_lookup (dest);
- if (new_reg != NULL_RTX && new_reg != RENAME_NO_RTX)
- XCEXP (x, 0, CLOBBER) = new_reg;
- }
- /* Stop traversing. */
- return -1;
- }
- else
- /* Continue traversing. */
- return 0;
- }
-
- case PHI:
- /* Never muck with the phi. We do that elsewhere, special-like. */
- return -1;
-
- default:
- /* Anything else, continue traversing. */
- return 0;
- }
-}
-
-static rtx
-gen_sequence (void)
-{
- rtx first_insn = get_insns ();
- rtx result;
- rtx tem;
- int i;
- int len;
-
- /* Count the insns in the chain. */
- len = 0;
- for (tem = first_insn; tem; tem = NEXT_INSN (tem))
- len++;
-
- result = gen_rtx_SEQUENCE (VOIDmode, rtvec_alloc (len));
-
- for (i = 0, tem = first_insn; tem; tem = NEXT_INSN (tem), i++)
- XVECEXP (result, 0, i) = tem;
-
- return result;
-}
-
-static void
-rename_block (int bb, dominance_info idom)
-{
- basic_block b = BASIC_BLOCK (bb);
- edge e;
- rtx insn, next, last;
- struct rename_set_data *set_data = NULL;
- basic_block c;
-
- /* Step One: Walk the basic block, adding new names for sets and
- replacing uses. */
-
- next = b->head;
- last = b->end;
- do
- {
- insn = next;
- if (INSN_P (insn))
- {
- struct rename_context context;
- context.done_renames = set_data;
- context.new_renames = NULL;
- context.current_insn = insn;
-
- start_sequence ();
- for_each_rtx (&PATTERN (insn), rename_insn_1, &context);
- for_each_rtx (&REG_NOTES (insn), rename_insn_1, &context);
-
- /* Sometimes, we end up with a sequence of insns that
- SSA needs to treat as a single insn. Wrap these in a
- SEQUENCE. (Any notes now get attached to the SEQUENCE,
- not to the old version inner insn.) */
- if (get_insns () != NULL_RTX)
- {
- rtx seq;
- int i;
-
- emit (PATTERN (insn));
- seq = gen_sequence ();
- /* We really want a SEQUENCE of SETs, not a SEQUENCE
- of INSNs. */
- for (i = 0; i < XVECLEN (seq, 0); i++)
- XVECEXP (seq, 0, i) = PATTERN (XVECEXP (seq, 0, i));
- PATTERN (insn) = seq;
- }
- end_sequence ();
-
- apply_delayed_renames (&context);
- set_data = context.done_renames;
- }
-
- next = NEXT_INSN (insn);
- }
- while (insn != last);
-
- /* Step Two: Update the phi nodes of this block's successors. */
-
- for (e = b->succ; e; e = e->succ_next)
- {
- if (e->dest == EXIT_BLOCK_PTR)
- continue;
-
- insn = first_insn_after_basic_block_note (e->dest);
-
- while (PHI_NODE_P (insn))
- {
- rtx phi = PATTERN (insn);
- rtx reg;
-
- /* Find out which of our outgoing registers this node is
- intended to replace. Note that if this is not the first PHI
- node to have been created for this register, we have to
- jump through rename links to figure out which register
- we're talking about. This can easily be recognized by
- noting that the regno is new to this pass. */
- reg = SET_DEST (phi);
- if (REGNO (reg) >= ssa_max_reg_num)
- reg = ssa_rename_from_lookup (REGNO (reg));
- if (reg == NULL_RTX)
- abort ();
- reg = ssa_rename_to_lookup (reg);
-
- /* It is possible for the variable to be uninitialized on
- edges in. Reduce the arity of the PHI so that we don't
- consider those edges. */
- if (reg == NULL || reg == RENAME_NO_RTX)
- {
- if (! remove_phi_alternative (phi, b))
- abort ();
- }
- else
- {
- /* When we created the PHI nodes, we did not know what mode
- the register should be. Now that we've found an original,
- we can fill that in. */
- if (GET_MODE (SET_DEST (phi)) == VOIDmode)
- PUT_MODE (SET_DEST (phi), GET_MODE (reg));
- else if (GET_MODE (SET_DEST (phi)) != GET_MODE (reg))
- abort ();
-
- *phi_alternative (phi, bb) = reg;
- }
-
- insn = NEXT_INSN (insn);
- }
- }
-
- /* Step Three: Do the same to the children of this block in
- dominator order. */
-
- FOR_EACH_BB (c)
- if (get_immediate_dominator (idom, c)->index == bb)
- rename_block (c->index, idom);
-
- /* Step Four: Update the sets to refer to their new register,
- and restore ssa_rename_to to its previous state. */
-
- while (set_data)
- {
- struct rename_set_data *next;
- rtx old_reg = *set_data->reg_loc;
-
- if (*set_data->reg_loc != set_data->old_reg)
- abort ();
- *set_data->reg_loc = set_data->new_reg;
-
- ssa_rename_to_insert (old_reg, set_data->prev_reg);
-
- next = set_data->next;
- free (set_data);
- set_data = next;
- }
-}
-
-static void
-rename_registers (int nregs, dominance_info idom)
-{
- VARRAY_RTX_INIT (ssa_definition, nregs * 3, "ssa_definition");
- ssa_rename_from_initialize ();
-
- ssa_rename_to_pseudo = alloca (nregs * sizeof(rtx));
- memset (ssa_rename_to_pseudo, 0, nregs * sizeof(rtx));
- memset (ssa_rename_to_hard, 0,
- FIRST_PSEUDO_REGISTER * NUM_MACHINE_MODES * sizeof (rtx));
-
- rename_block (0, idom);
-
- /* ??? Update basic_block_live_at_start, and other flow info
- as needed. */
-
- ssa_rename_to_pseudo = NULL;
-}
-
-/* The main entry point for moving to SSA. */
-
-void
-convert_to_ssa (void)
-{
- /* Element I is the set of blocks that set register I. */
- sbitmap *evals;
-
- /* Dominator bitmaps. */
- sbitmap *dfs;
- sbitmap *idfs;
-
- /* Element I is the immediate dominator of block I. */
- dominance_info idom;
-
- int nregs;
-
- basic_block bb;
-
- /* Don't do it twice. */
- if (in_ssa_form)
- abort ();
-
- /* Need global_live_at_{start,end} up to date. Do not remove any
- dead code. We'll let the SSA optimizers do that. */
- life_analysis (get_insns (), NULL, 0);
-
- idom = calculate_dominance_info (CDI_DOMINATORS);
-
- if (rtl_dump_file)
- {
- fputs (";; Immediate Dominators:\n", rtl_dump_file);
- FOR_EACH_BB (bb)
- fprintf (rtl_dump_file, ";\t%3d = %3d\n", bb->index,
- get_immediate_dominator (idom, bb)->index);
- fflush (rtl_dump_file);
- }
-
- /* Compute dominance frontiers. */
-
- dfs = sbitmap_vector_alloc (last_basic_block, last_basic_block);
- compute_dominance_frontiers (dfs, idom);
-
- if (rtl_dump_file)
- {
- dump_sbitmap_vector (rtl_dump_file, ";; Dominance Frontiers:",
- "; Basic Block", dfs, last_basic_block);
- fflush (rtl_dump_file);
- }
-
- /* Compute register evaluations. */
-
- ssa_max_reg_num = max_reg_num ();
- nregs = ssa_max_reg_num;
- evals = sbitmap_vector_alloc (nregs, last_basic_block);
- find_evaluations (evals, nregs);
-
- /* Compute the iterated dominance frontier for each register. */
-
- idfs = sbitmap_vector_alloc (nregs, last_basic_block);
- compute_iterated_dominance_frontiers (idfs, dfs, evals, nregs);
-
- if (rtl_dump_file)
- {
- dump_sbitmap_vector (rtl_dump_file, ";; Iterated Dominance Frontiers:",
- "; Register", idfs, nregs);
- fflush (rtl_dump_file);
- }
-
- /* Insert the phi nodes. */
-
- insert_phi_nodes (idfs, evals, nregs);
-
- /* Rename the registers to satisfy SSA. */
-
- rename_registers (nregs, idom);
-
- /* All done! Clean up and go home. */
-
- sbitmap_vector_free (dfs);
- sbitmap_vector_free (evals);
- sbitmap_vector_free (idfs);
- in_ssa_form = 1;
-
- reg_scan (get_insns (), max_reg_num (), 1);
- free_dominance_info (idom);
-}
-
-/* REG is the representative temporary of its partition. Add it to the
- set of nodes to be processed, if it hasn't been already. Return the
- index of this register in the node set. */
-
-static inline int
-ephi_add_node (rtx reg, rtx *nodes, int *n_nodes)
-{
- int i;
- for (i = *n_nodes - 1; i >= 0; --i)
- if (REGNO (reg) == REGNO (nodes[i]))
- return i;
-
- nodes[i = (*n_nodes)++] = reg;
- return i;
-}
-
-/* Part one of the topological sort. This is a forward (downward) search
- through the graph collecting a stack of nodes to process. Assuming no
- cycles, the nodes at top of the stack when we are finished will have
- no other dependencies. */
-
-static int *
-ephi_forward (int t, sbitmap visited, sbitmap *succ, int *tstack)
-{
- int s;
-
- SET_BIT (visited, t);
-
- EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s,
- {
- if (! TEST_BIT (visited, s))
- tstack = ephi_forward (s, visited, succ, tstack);
- });
-
- *tstack++ = t;
- return tstack;
-}
-
-/* Part two of the topological sort. The is a backward search through
- a cycle in the graph, copying the data forward as we go. */
-
-static void
-ephi_backward (int t, sbitmap visited, sbitmap *pred, rtx *nodes)
-{
- int p;
-
- SET_BIT (visited, t);
-
- EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p,
- {
- if (! TEST_BIT (visited, p))
- {
- ephi_backward (p, visited, pred, nodes);
- emit_move_insn (nodes[p], nodes[t]);
- }
- });
-}
-
-/* Part two of the topological sort. Create the copy for a register
- and any cycle of which it is a member. */
-
-static void
-ephi_create (int t, sbitmap visited, sbitmap *pred, sbitmap *succ, rtx *nodes)
-{
- rtx reg_u = NULL_RTX;
- int unvisited_predecessors = 0;
- int p;
-
- /* Iterate through the predecessor list looking for unvisited nodes.
- If there are any, we have a cycle, and must deal with that. At
- the same time, look for a visited predecessor. If there is one,
- we won't need to create a temporary. */
-
- EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p,
- {
- if (! TEST_BIT (visited, p))
- unvisited_predecessors = 1;
- else if (!reg_u)
- reg_u = nodes[p];
- });
-
- if (unvisited_predecessors)
- {
- /* We found a cycle. Copy out one element of the ring (if necessary),
- then traverse the ring copying as we go. */
-
- if (!reg_u)
- {
- reg_u = gen_reg_rtx (GET_MODE (nodes[t]));
- emit_move_insn (reg_u, nodes[t]);
- }
-
- EXECUTE_IF_SET_IN_SBITMAP (pred[t], 0, p,
- {
- if (! TEST_BIT (visited, p))
- {
- ephi_backward (p, visited, pred, nodes);
- emit_move_insn (nodes[p], reg_u);
- }
- });
- }
- else
- {
- /* No cycle. Just copy the value from a successor. */
-
- int s;
- EXECUTE_IF_SET_IN_SBITMAP (succ[t], 0, s,
- {
- SET_BIT (visited, t);
- emit_move_insn (nodes[t], nodes[s]);
- return;
- });
- }
-}
-
-/* Convert the edge to normal form. */
-
-static void
-eliminate_phi (edge e, partition reg_partition)
-{
- int n_nodes;
- sbitmap *pred, *succ;
- sbitmap visited;
- rtx *nodes;
- int *stack, *tstack;
- rtx insn;
- int i;
-
- /* Collect an upper bound on the number of registers needing processing. */
-
- insn = first_insn_after_basic_block_note (e->dest);
-
- n_nodes = 0;
- while (PHI_NODE_P (insn))
- {
- insn = next_nonnote_insn (insn);
- n_nodes += 2;
- }
-
- if (n_nodes == 0)
- return;
-
- /* Build the auxiliary graph R(B).
-
- The nodes of the graph are the members of the register partition
- present in Phi(B). There is an edge from FIND(T0)->FIND(T1) for
- each T0 = PHI(...,T1,...), where T1 is for the edge from block C. */
-
- nodes = alloca (n_nodes * sizeof(rtx));
- pred = sbitmap_vector_alloc (n_nodes, n_nodes);
- succ = sbitmap_vector_alloc (n_nodes, n_nodes);
- sbitmap_vector_zero (pred, n_nodes);
- sbitmap_vector_zero (succ, n_nodes);
-
- insn = first_insn_after_basic_block_note (e->dest);
-
- n_nodes = 0;
- for (; PHI_NODE_P (insn); insn = next_nonnote_insn (insn))
- {
- rtx* preg = phi_alternative (PATTERN (insn), e->src->index);
- rtx tgt = SET_DEST (PATTERN (insn));
- rtx reg;
-
- /* There may be no phi alternative corresponding to this edge.
- This indicates that the phi variable is undefined along this
- edge. */
- if (preg == NULL)
- continue;
- reg = *preg;
-
- if (GET_CODE (reg) != REG || GET_CODE (tgt) != REG)
- abort ();
-
- reg = regno_reg_rtx[partition_find (reg_partition, REGNO (reg))];
- tgt = regno_reg_rtx[partition_find (reg_partition, REGNO (tgt))];
- /* If the two registers are already in the same partition,
- nothing will need to be done. */
- if (reg != tgt)
- {
- int ireg, itgt;
-
- ireg = ephi_add_node (reg, nodes, &n_nodes);
- itgt = ephi_add_node (tgt, nodes, &n_nodes);
-
- SET_BIT (pred[ireg], itgt);
- SET_BIT (succ[itgt], ireg);
- }
- }
-
- if (n_nodes == 0)
- goto out;
-
- /* Begin a topological sort of the graph. */
-
- visited = sbitmap_alloc (n_nodes);
- sbitmap_zero (visited);
-
- tstack = stack = alloca (n_nodes * sizeof (int));
-
- for (i = 0; i < n_nodes; ++i)
- if (! TEST_BIT (visited, i))
- tstack = ephi_forward (i, visited, succ, tstack);
-
- sbitmap_zero (visited);
-
- /* As we find a solution to the tsort, collect the implementation
- insns in a sequence. */
- start_sequence ();
-
- while (tstack != stack)
- {
- i = *--tstack;
- if (! TEST_BIT (visited, i))
- ephi_create (i, visited, pred, succ, nodes);
- }
-
- insn = get_insns ();
- end_sequence ();
- insert_insn_on_edge (insn, e);
- if (rtl_dump_file)
- fprintf (rtl_dump_file, "Emitting copy on edge (%d,%d)\n",
- e->src->index, e->dest->index);
-
- sbitmap_free (visited);
-out:
- sbitmap_vector_free (pred);
- sbitmap_vector_free (succ);
-}
-
-/* For basic block B, consider all phi insns which provide an
- alternative corresponding to an incoming abnormal critical edge.
- Place the phi alternative corresponding to that abnormal critical
- edge in the same register class as the destination of the set.
-
- From Morgan, p. 178:
-
- For each abnormal critical edge (C, B),
- if T0 = phi (T1, ..., Ti, ..., Tm) is a phi node in B,
- and C is the ith predecessor of B,
- then T0 and Ti must be equivalent.
-
- Return nonzero iff any such cases were found for which the two
- regs were not already in the same class. */
-
-static int
-make_regs_equivalent_over_bad_edges (int bb, partition reg_partition)
-{
- int changed = 0;
- basic_block b = BASIC_BLOCK (bb);
- rtx phi;
-
- /* Advance to the first phi node. */
- phi = first_insn_after_basic_block_note (b);
-
- /* Scan all the phi nodes. */
- for (;
- PHI_NODE_P (phi);
- phi = next_nonnote_insn (phi))
- {
- edge e;
- int tgt_regno;
- rtx set = PATTERN (phi);
- rtx tgt = SET_DEST (set);
-
- /* The set target is expected to be an SSA register. */
- if (GET_CODE (tgt) != REG
- || !CONVERT_REGISTER_TO_SSA_P (REGNO (tgt)))
- abort ();
- tgt_regno = REGNO (tgt);
-
- /* Scan incoming abnormal critical edges. */
- for (e = b->pred; e; e = e->pred_next)
- if ((e->flags & EDGE_ABNORMAL) && EDGE_CRITICAL_P (e))
- {
- rtx *alt = phi_alternative (set, e->src->index);
- int alt_regno;
-
- /* If there is no alternative corresponding to this edge,
- the value is undefined along the edge, so just go on. */
- if (alt == 0)
- continue;
-
- /* The phi alternative is expected to be an SSA register. */
- if (GET_CODE (*alt) != REG
- || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt)))
- abort ();
- alt_regno = REGNO (*alt);
-
- /* If the set destination and the phi alternative aren't
- already in the same class... */
- if (partition_find (reg_partition, tgt_regno)
- != partition_find (reg_partition, alt_regno))
- {
- /* ... make them such. */
- if (conflicting_hard_regs_p (tgt_regno, alt_regno))
- /* It is illegal to unify a hard register with a
- different register. */
- abort ();
-
- partition_union (reg_partition,
- tgt_regno, alt_regno);
- ++changed;
- }
- }
- }
-
- return changed;
-}
-
-/* Consider phi insns in basic block BB pairwise. If the set target
- of both insns are equivalent pseudos, make the corresponding phi
- alternatives in each phi corresponding equivalent.
-
- Return nonzero if any new register classes were unioned. */
-
-static int
-make_equivalent_phi_alternatives_equivalent (int bb, partition reg_partition)
-{
- int changed = 0;
- basic_block b = BASIC_BLOCK (bb);
- rtx phi;
-
- /* Advance to the first phi node. */
- phi = first_insn_after_basic_block_note (b);
-
- /* Scan all the phi nodes. */
- for (;
- PHI_NODE_P (phi);
- phi = next_nonnote_insn (phi))
- {
- rtx set = PATTERN (phi);
- /* The regno of the destination of the set. */
- int tgt_regno = REGNO (SET_DEST (PATTERN (phi)));
-
- rtx phi2 = next_nonnote_insn (phi);
-
- /* Scan all phi nodes following this one. */
- for (;
- PHI_NODE_P (phi2);
- phi2 = next_nonnote_insn (phi2))
- {
- rtx set2 = PATTERN (phi2);
- /* The regno of the destination of the set. */
- int tgt2_regno = REGNO (SET_DEST (set2));
-
- /* Are the set destinations equivalent regs? */
- if (partition_find (reg_partition, tgt_regno) ==
- partition_find (reg_partition, tgt2_regno))
- {
- edge e;
- /* Scan over edges. */
- for (e = b->pred; e; e = e->pred_next)
- {
- int pred_block = e->src->index;
- /* Identify the phi alternatives from both phi
- nodes corresponding to this edge. */
- rtx *alt = phi_alternative (set, pred_block);
- rtx *alt2 = phi_alternative (set2, pred_block);
-
- /* If one of the phi nodes doesn't have a
- corresponding alternative, just skip it. */
- if (alt == 0 || alt2 == 0)
- continue;
-
- /* Both alternatives should be SSA registers. */
- if (GET_CODE (*alt) != REG
- || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt)))
- abort ();
- if (GET_CODE (*alt2) != REG
- || !CONVERT_REGISTER_TO_SSA_P (REGNO (*alt2)))
- abort ();
-
- /* If the alternatives aren't already in the same
- class ... */
- if (partition_find (reg_partition, REGNO (*alt))
- != partition_find (reg_partition, REGNO (*alt2)))
- {
- /* ... make them so. */
- if (conflicting_hard_regs_p (REGNO (*alt), REGNO (*alt2)))
- /* It is illegal to unify a hard register with
- a different register. */
- abort ();
-
- partition_union (reg_partition,
- REGNO (*alt), REGNO (*alt2));
- ++changed;
- }
- }
- }
- }
- }
-
- return changed;
-}
-
-/* Compute a conservative partition of outstanding pseudo registers.
- See Morgan 7.3.1. */
-
-static partition
-compute_conservative_reg_partition (void)
-{
- basic_block bb;
- int changed = 0;
-
- /* We don't actually work with hard registers, but it's easier to
- carry them around anyway rather than constantly doing register
- number arithmetic. */
- partition p =
- partition_new (ssa_definition->num_elements);
-
- /* The first priority is to make sure registers that might have to
- be copied on abnormal critical edges are placed in the same
- partition. This saves us from having to split abnormal critical
- edges. */
- FOR_EACH_BB_REVERSE (bb)
- changed += make_regs_equivalent_over_bad_edges (bb->index, p);
-
- /* Now we have to insure that corresponding arguments of phi nodes
- assigning to corresponding regs are equivalent. Iterate until
- nothing changes. */
- while (changed > 0)
- {
- changed = 0;
- FOR_EACH_BB_REVERSE (bb)
- changed += make_equivalent_phi_alternatives_equivalent (bb->index, p);
- }
-
- return p;
-}
-
-/* The following functions compute a register partition that attempts
- to eliminate as many reg copies and phi node copies as possible by
- coalescing registers. This is the strategy:
-
- 1. As in the conservative case, the top priority is to coalesce
- registers that otherwise would cause copies to be placed on
- abnormal critical edges (which isn't possible).
-
- 2. Figure out which regs are involved (in the LHS or RHS) of
- copies and phi nodes. Compute conflicts among these regs.
-
- 3. Walk around the instruction stream, placing two regs in the
- same class of the partition if one appears on the LHS and the
- other on the RHS of a copy or phi node and the two regs don't
- conflict. The conflict information of course needs to be
- updated.
-
- 4. If anything has changed, there may be new opportunities to
- coalesce regs, so go back to 2.
-*/
-
-/* If REG1 and REG2 don't conflict in CONFLICTS, place them in the
- same class of partition P, if they aren't already. Update
- CONFLICTS appropriately.
-
- Returns one if REG1 and REG2 were placed in the same class but were
- not previously; zero otherwise.
-
- See Morgan figure 11.15. */
-
-static int
-coalesce_if_unconflicting (partition p, conflict_graph conflicts,
- int reg1, int reg2)
-{
- int reg;
-
- /* Work only on SSA registers. */
- if (!CONVERT_REGISTER_TO_SSA_P (reg1) || !CONVERT_REGISTER_TO_SSA_P (reg2))
- return 0;
-
- /* Find the canonical regs for the classes containing REG1 and
- REG2. */
- reg1 = partition_find (p, reg1);
- reg2 = partition_find (p, reg2);
-
- /* If they're already in the same class, there's nothing to do. */
- if (reg1 == reg2)
- return 0;
-
- /* If the regs conflict, our hands are tied. */
- if (conflicting_hard_regs_p (reg1, reg2) ||
- conflict_graph_conflict_p (conflicts, reg1, reg2))
- return 0;
-
- /* We're good to go. Put the regs in the same partition. */
- partition_union (p, reg1, reg2);
-
- /* Find the new canonical reg for the merged class. */
- reg = partition_find (p, reg1);
-
- /* Merge conflicts from the two previous classes. */
- conflict_graph_merge_regs (conflicts, reg, reg1);
- conflict_graph_merge_regs (conflicts, reg, reg2);
-
- return 1;
-}
-
-/* For each register copy insn in basic block BB, place the LHS and
- RHS regs in the same class in partition P if they do not conflict
- according to CONFLICTS.
-
- Returns the number of changes that were made to P.
-
- See Morgan figure 11.14. */
-
-static int
-coalesce_regs_in_copies (basic_block bb, partition p, conflict_graph conflicts)
-{
- int changed = 0;
- rtx insn;
- rtx end = bb->end;
-
- /* Scan the instruction stream of the block. */
- for (insn = bb->head; insn != end; insn = NEXT_INSN (insn))
- {
- rtx pattern;
- rtx src;
- rtx dest;
-
- /* If this isn't a set insn, go to the next insn. */
- if (GET_CODE (insn) != INSN)
- continue;
- pattern = PATTERN (insn);
- if (GET_CODE (pattern) != SET)
- continue;
-
- src = SET_SRC (pattern);
- dest = SET_DEST (pattern);
-
- /* We're only looking for copies. */
- if (GET_CODE (src) != REG || GET_CODE (dest) != REG)
- continue;
-
- /* Coalesce only if the reg modes are the same. As long as
- each reg's rtx is unique, it can have only one mode, so two
- pseudos of different modes can't be coalesced into one.
-
- FIXME: We can probably get around this by inserting SUBREGs
- where appropriate, but for now we don't bother. */
- if (GET_MODE (src) != GET_MODE (dest))
- continue;
-
- /* Found a copy; see if we can use the same reg for both the
- source and destination (and thus eliminate the copy,
- ultimately). */
- changed += coalesce_if_unconflicting (p, conflicts,
- REGNO (src), REGNO (dest));
- }
-
- return changed;
-}
-
-struct phi_coalesce_context
-{
- partition p;
- conflict_graph conflicts;
- int changed;
-};
-
-/* Callback function for for_each_successor_phi. If the set
- destination and the phi alternative regs do not conflict, place
- them in the same partition class. DATA is a pointer to a
- phi_coalesce_context struct. */
-
-static int
-coalesce_reg_in_phi (rtx insn ATTRIBUTE_UNUSED, int dest_regno,
- int src_regno, void *data)
-{
- struct phi_coalesce_context *context =
- (struct phi_coalesce_context *) data;
-
- /* Attempt to use the same reg, if they don't conflict. */
- context->changed
- += coalesce_if_unconflicting (context->p, context->conflicts,
- dest_regno, src_regno);
- return 0;
-}
-
-/* For each alternative in a phi function corresponding to basic block
- BB (in phi nodes in successor block to BB), place the reg in the
- phi alternative and the reg to which the phi value is set into the
- same class in partition P, if allowed by CONFLICTS.
-
- Return the number of changes that were made to P.
-
- See Morgan figure 11.14. */
-
-static int
-coalesce_regs_in_successor_phi_nodes (basic_block bb, partition p,
- conflict_graph conflicts)
-{
- struct phi_coalesce_context context;
- context.p = p;
- context.conflicts = conflicts;
- context.changed = 0;
-
- for_each_successor_phi (bb, &coalesce_reg_in_phi, &context);
-
- return context.changed;
-}
-
-/* Compute and return a partition of pseudos. Where possible,
- non-conflicting pseudos are placed in the same class.
-
- The caller is responsible for deallocating the returned partition. */
-
-static partition
-compute_coalesced_reg_partition (void)
-{
- basic_block bb;
- int changed = 0;
- regset_head phi_set_head;
- regset phi_set = &phi_set_head;
-
- partition p =
- partition_new (ssa_definition->num_elements);
-
- /* The first priority is to make sure registers that might have to
- be copied on abnormal critical edges are placed in the same
- partition. This saves us from having to split abnormal critical
- edges (which can't be done). */
- FOR_EACH_BB_REVERSE (bb)
- make_regs_equivalent_over_bad_edges (bb->index, p);
-
- INIT_REG_SET (phi_set);
-
- do
- {
- conflict_graph conflicts;
-
- changed = 0;
-
- /* Build the set of registers involved in phi nodes, either as
- arguments to the phi function or as the target of a set. */
- CLEAR_REG_SET (phi_set);
- mark_phi_and_copy_regs (phi_set);
-
- /* Compute conflicts. */
- conflicts = conflict_graph_compute (phi_set, p);
-
- /* FIXME: Better would be to process most frequently executed
- blocks first, so that most frequently executed copies would
- be more likely to be removed by register coalescing. But any
- order will generate correct, if non-optimal, results. */
- FOR_EACH_BB_REVERSE (bb)
- {
- changed += coalesce_regs_in_copies (bb, p, conflicts);
- changed +=
- coalesce_regs_in_successor_phi_nodes (bb, p, conflicts);
- }
-
- conflict_graph_delete (conflicts);
- }
- while (changed > 0);
-
- FREE_REG_SET (phi_set);
-
- return p;
-}
-
-/* Mark the regs in a phi node. PTR is a phi expression or one of its
- components (a REG or a CONST_INT). DATA is a reg set in which to
- set all regs. Called from for_each_rtx. */
-
-static int
-mark_reg_in_phi (rtx *ptr, void *data)
-{
- rtx expr = *ptr;
- regset set = (regset) data;
-
- switch (GET_CODE (expr))
- {
- case REG:
- SET_REGNO_REG_SET (set, REGNO (expr));
- /* Fall through. */
- case CONST_INT:
- case PHI:
- return 0;
- default:
- abort ();
- }
-}
-
-/* Mark in PHI_SET all pseudos that are used in a phi node -- either
- set from a phi expression, or used as an argument in one. Also
- mark regs that are the source or target of a reg copy. Uses
- ssa_definition. */
-
-static void
-mark_phi_and_copy_regs (regset phi_set)
-{
- unsigned int reg;
-
- /* Scan the definitions of all regs. */
- for (reg = 0; reg < VARRAY_SIZE (ssa_definition); ++reg)
- if (CONVERT_REGISTER_TO_SSA_P (reg))
- {
- rtx insn = VARRAY_RTX (ssa_definition, reg);
- rtx pattern;
- rtx src;
-
- if (insn == NULL
- || (GET_CODE (insn) == NOTE
- && NOTE_LINE_NUMBER (insn) == NOTE_INSN_DELETED))
- continue;
- pattern = PATTERN (insn);
- /* Sometimes we get PARALLEL insns. These aren't phi nodes or
- copies. */
- if (GET_CODE (pattern) != SET)
- continue;
- src = SET_SRC (pattern);
-
- if (GET_CODE (src) == REG)
- {
- /* It's a reg copy. */
- SET_REGNO_REG_SET (phi_set, reg);
- SET_REGNO_REG_SET (phi_set, REGNO (src));
- }
- else if (GET_CODE (src) == PHI)
- {
- /* It's a phi node. Mark the reg being set. */
- SET_REGNO_REG_SET (phi_set, reg);
- /* Mark the regs used in the phi function. */
- for_each_rtx (&src, mark_reg_in_phi, phi_set);
- }
- /* ... else nothing to do. */
- }
-}
-
-/* Rename regs in insn PTR that are equivalent. DATA is the register
- partition which specifies equivalences. */
-
-static int
-rename_equivalent_regs_in_insn (rtx *ptr, void* data)
-{
- rtx x = *ptr;
- partition reg_partition = (partition) data;
-
- if (x == NULL_RTX)
- return 0;
-
- switch (GET_CODE (x))
- {
- case REG:
- if (CONVERT_REGISTER_TO_SSA_P (REGNO (x)))
- {
- unsigned int regno = REGNO (x);
- unsigned int new_regno = partition_find (reg_partition, regno);
- rtx canonical_element_rtx = ssa_rename_from_lookup (new_regno);
-
- if (canonical_element_rtx != NULL_RTX &&
- HARD_REGISTER_P (canonical_element_rtx))
- {
- if (REGNO (canonical_element_rtx) != regno)
- *ptr = canonical_element_rtx;
- }
- else if (regno != new_regno)
- {
- rtx new_reg = regno_reg_rtx[new_regno];
- if (GET_MODE (x) != GET_MODE (new_reg))
- abort ();
- *ptr = new_reg;
- }
- }
- return -1;
-
- case PHI:
- /* No need to rename the phi nodes. We'll check equivalence
- when inserting copies. */
- return -1;
-
- default:
- /* Anything else, continue traversing. */
- return 0;
- }
-}
-
-/* Record the register's canonical element stored in SRFP in the
- canonical_elements sbitmap packaged in DATA. This function is used
- as a callback function for traversing ssa_rename_from. */
-
-static int
-record_canonical_element_1 (void **srfp, void *data)
-{
- unsigned int reg = ((ssa_rename_from_pair *) *srfp)->reg;
- sbitmap canonical_elements =
- ((struct ssa_rename_from_hash_table_data *) data)->canonical_elements;
- partition reg_partition =
- ((struct ssa_rename_from_hash_table_data *) data)->reg_partition;
-
- SET_BIT (canonical_elements, partition_find (reg_partition, reg));
- return 1;
-}
-
-/* For each class in the REG_PARTITION corresponding to a particular
- hard register and machine mode, check that there are no other
- classes with the same hard register and machine mode. Returns
- nonzero if this is the case, i.e., the partition is acceptable. */
-
-static int
-check_hard_regs_in_partition (partition reg_partition)
-{
- /* CANONICAL_ELEMENTS has a nonzero bit if a class with the given register
- number and machine mode has already been seen. This is a
- problem with the partition. */
- sbitmap canonical_elements;
- int element_index;
- int already_seen[FIRST_PSEUDO_REGISTER][NUM_MACHINE_MODES];
- int reg;
- int mach_mode;
-
- /* Collect a list of canonical elements. */
- canonical_elements = sbitmap_alloc (max_reg_num ());
- sbitmap_zero (canonical_elements);
- ssa_rename_from_traverse (&record_canonical_element_1,
- canonical_elements, reg_partition);
-
- /* We have not seen any hard register uses. */
- for (reg = 0; reg < FIRST_PSEUDO_REGISTER; ++reg)
- for (mach_mode = 0; mach_mode < NUM_MACHINE_MODES; ++mach_mode)
- already_seen[reg][mach_mode] = 0;
-
- /* Check for classes with the same hard register and machine mode. */
- EXECUTE_IF_SET_IN_SBITMAP (canonical_elements, 0, element_index,
- {
- rtx hard_reg_rtx = ssa_rename_from_lookup (element_index);
- if (hard_reg_rtx != NULL_RTX &&
- HARD_REGISTER_P (hard_reg_rtx) &&
- already_seen[REGNO (hard_reg_rtx)][GET_MODE (hard_reg_rtx)] != 0)
- /* Two distinct partition classes should be mapped to the same
- hard register. */
- return 0;
- });
-
- sbitmap_free (canonical_elements);
-
- return 1;
-}
-
-/* Rename regs that are equivalent in REG_PARTITION. Also collapse
- any SEQUENCE insns. */
-
-static void
-rename_equivalent_regs (partition reg_partition)
-{
- basic_block b;
-
- FOR_EACH_BB_REVERSE (b)
- {
- rtx next = b->head;
- rtx last = b->end;
- rtx insn;
-
- do
- {
- insn = next;
- if (INSN_P (insn))
- {
- for_each_rtx (&PATTERN (insn),
- rename_equivalent_regs_in_insn,
- reg_partition);
- for_each_rtx (&REG_NOTES (insn),
- rename_equivalent_regs_in_insn,
- reg_partition);
-
- if (GET_CODE (PATTERN (insn)) == SEQUENCE)
- {
- rtx s = PATTERN (insn);
- int slen = XVECLEN (s, 0);
- int i;
-
- if (slen <= 1)
- abort ();
-
- PATTERN (insn) = XVECEXP (s, 0, slen-1);
- for (i = 0; i < slen - 1; i++)
- emit_insn_before (XVECEXP (s, 0, i), insn);
- }
- }
-
- next = NEXT_INSN (insn);
- }
- while (insn != last);
- }
-}
-
-/* The main entry point for moving from SSA. */
-
-void
-convert_from_ssa (void)
-{
- basic_block b, bb;
- partition reg_partition;
- rtx insns = get_insns ();
-
- /* Need global_live_at_{start,end} up to date. There should not be
- any significant dead code at this point, except perhaps dead
- stores. So do not take the time to perform dead code elimination.
-
- Register coalescing needs death notes, so generate them. */
- life_analysis (insns, NULL, PROP_DEATH_NOTES);
-
- /* Figure out which regs in copies and phi nodes don't conflict and
- therefore can be coalesced. */
- if (conservative_reg_partition)
- reg_partition = compute_conservative_reg_partition ();
- else
- reg_partition = compute_coalesced_reg_partition ();
-
- if (!check_hard_regs_in_partition (reg_partition))
- /* Two separate partitions should correspond to the same hard
- register but do not. */
- abort ();
-
- rename_equivalent_regs (reg_partition);
-
- /* Eliminate the PHI nodes. */
- FOR_EACH_BB_REVERSE (b)
- {
- edge e;
-
- for (e = b->pred; e; e = e->pred_next)
- if (e->src != ENTRY_BLOCK_PTR)
- eliminate_phi (e, reg_partition);
- }
-
- partition_delete (reg_partition);
-
- /* Actually delete the PHI nodes. */
- FOR_EACH_BB_REVERSE (bb)
- {
- rtx insn = bb->head;
-
- while (1)
- {
- /* If this is a PHI node delete it. */
- if (PHI_NODE_P (insn))
- {
- if (insn == bb->end)
- bb->end = PREV_INSN (insn);
- insn = delete_insn (insn);
- }
- /* Since all the phi nodes come at the beginning of the
- block, if we find an ordinary insn, we can stop looking
- for more phi nodes. */
- else if (INSN_P (insn))
- break;
- /* If we've reached the end of the block, stop. */
- else if (insn == bb->end)
- break;
- else
- insn = NEXT_INSN (insn);
- }
- }
-
- /* Commit all the copy nodes needed to convert out of SSA form. */
- commit_edge_insertions ();
-
- in_ssa_form = 0;
-
- count_or_remove_death_notes (NULL, 1);
-
- /* Deallocate the data structures. */
- ssa_definition = 0;
- ssa_rename_from_free ();
-}
-
-/* Scan phi nodes in successors to BB. For each such phi node that
- has a phi alternative value corresponding to BB, invoke FN. FN
- is passed the entire phi node insn, the regno of the set
- destination, the regno of the phi argument corresponding to BB,
- and DATA.
-
- If FN ever returns nonzero, stops immediately and returns this
- value. Otherwise, returns zero. */
-
-int
-for_each_successor_phi (basic_block bb, successor_phi_fn fn, void *data)
-{
- edge e;
-
- if (bb == EXIT_BLOCK_PTR)
- return 0;
-
- /* Scan outgoing edges. */
- for (e = bb->succ; e != NULL; e = e->succ_next)
- {
- rtx insn;
-
- basic_block successor = e->dest;
- if (successor == ENTRY_BLOCK_PTR
- || successor == EXIT_BLOCK_PTR)
- continue;
-
- /* Advance to the first non-label insn of the successor block. */
- insn = first_insn_after_basic_block_note (successor);
-
- if (insn == NULL)
- continue;
-
- /* Scan phi nodes in the successor. */
- for ( ; PHI_NODE_P (insn); insn = NEXT_INSN (insn))
- {
- int result;
- rtx phi_set = PATTERN (insn);
- rtx *alternative = phi_alternative (phi_set, bb->index);
- rtx phi_src;
-
- /* This phi function may not have an alternative
- corresponding to the incoming edge, indicating the
- assigned variable is not defined along the edge. */
- if (alternative == NULL)
- continue;
- phi_src = *alternative;
-
- /* Invoke the callback. */
- result = (*fn) (insn, REGNO (SET_DEST (phi_set)),
- REGNO (phi_src), data);
-
- /* Terminate if requested. */
- if (result != 0)
- return result;
- }
- }
-
- return 0;
-}
-
-/* Assuming the ssa_rename_from mapping has been established, yields
- nonzero if 1) only one SSA register of REG1 and REG2 comes from a
- hard register or 2) both SSA registers REG1 and REG2 come from
- different hard registers. */
-
-static int
-conflicting_hard_regs_p (int reg1, int reg2)
-{
- int orig_reg1 = original_register (reg1);
- int orig_reg2 = original_register (reg2);
- if (HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2)
- && orig_reg1 != orig_reg2)
- return 1;
- if (HARD_REGISTER_NUM_P (orig_reg1) && !HARD_REGISTER_NUM_P (orig_reg2))
- return 1;
- if (!HARD_REGISTER_NUM_P (orig_reg1) && HARD_REGISTER_NUM_P (orig_reg2))
- return 1;
-
- return 0;
-}
diff --git a/gcc/ssa.h b/gcc/ssa.h
deleted file mode 100644
index ab3cdf1a789..00000000000
--- a/gcc/ssa.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Static Single Assignment (SSA) definitions for GCC
- Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
- Written by Jeffrey D. Oldham <oldham@codesourcery.com>.
-
-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. */
-
-
-/* Main SSA routines. */
-extern void convert_to_ssa (void);
-extern void convert_from_ssa (void);
-typedef int (*successor_phi_fn) (rtx, int, int, void *);
-extern int for_each_successor_phi (basic_block bb, successor_phi_fn,
- void *);
-void compute_dominance_frontiers (sbitmap *frontiers, dominance_info idom);
-extern int remove_phi_alternative (rtx, basic_block);
-
-
-/* Optimizations. */
-/* In ssa-dce.c */
-extern void ssa_eliminate_dead_code (void);
-
-/* In ssa-ccp.c */
-extern void ssa_const_prop (void);
-
-
-/* SSA definitions and uses. */
-/* This flag is set when the CFG is in SSA form. */
-extern int in_ssa_form;
-
-/* Element I is the single instruction that sets register I. */
-extern GTY(()) varray_type ssa_definition;
-
-/* Element I is an INSN_LIST of instructions that use register I. */
-extern varray_type ssa_uses;
-
-
-/* Specify which hard registers should be converted. */
-
-/* All pseudo-registers (having register number >=
- FIRST_PSEUDO_REGISTER) and hard registers satisfying
- CONVERT_HARD_REGISTER_TO_SSA_P are converted to SSA form. */
-
-/* Given a hard register number REG_NO, return nonzero if and only if
- the register should be converted to SSA. */
-
-#ifndef CONVERT_HARD_REGISTER_TO_SSA_P
-#define CONVERT_HARD_REGISTER_TO_SSA_P(REG_NO) (0) /* default of no hard registers */
-#endif /* CONVERT_HARD_REGISTER_TO_SSA_P */
-
-/* Given a register number REG_NO, return nonzero if and only if the
- register should be converted to SSA. */
-
-#define CONVERT_REGISTER_TO_SSA_P(REG_NO) \
- ((!HARD_REGISTER_NUM_P (REG_NO)) || \
- (CONVERT_HARD_REGISTER_TO_SSA_P (REG_NO)))
diff --git a/gcc/stmt.c b/gcc/stmt.c
index 718f2558e7d..7b388dd6c1d 100644
--- a/gcc/stmt.c
+++ b/gcc/stmt.c
@@ -403,6 +403,7 @@ static bool check_unique_operand_names (tree, tree);
static char *resolve_operand_name_1 (char *, tree, tree);
static void expand_null_return_1 (rtx);
static enum br_predictor return_prediction (rtx);
+static rtx shift_return_value (rtx);
static void expand_value_return (rtx);
static int tail_recursion_args (tree, tree);
static void expand_cleanups (tree, int, int);
@@ -646,6 +647,13 @@ expand_goto (tree label)
else
#endif
{
+ emit_insn (gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ gen_rtx_SCRATCH (VOIDmode))));
+ emit_insn (gen_rtx_CLOBBER (VOIDmode,
+ gen_rtx_MEM (BLKmode,
+ hard_frame_pointer_rtx)));
+
/* Restore frame pointer for containing function.
This sets the actual hard register used for the frame pointer
to the location of the function's incoming static chain info.
@@ -1246,6 +1254,9 @@ parse_output_constraint (const char **constraint_p, int operand_num,
break;
}
+ if (*is_inout && !*allows_reg)
+ warning ("read-write constraint does not allow a register");
+
return true;
}
@@ -1261,6 +1272,7 @@ parse_input_constraint (const char **constraint_p, int input_num,
const char *orig_constraint = constraint;
size_t c_len = strlen (constraint);
size_t j;
+ bool saw_match = false;
/* Assume the constraint doesn't allow the use of either
a register or memory. */
@@ -1312,6 +1324,8 @@ parse_input_constraint (const char **constraint_p, int input_num,
char *end;
unsigned long match;
+ saw_match = true;
+
match = strtoul (constraint + j, &end, 10);
if (match >= (unsigned long) noutputs)
{
@@ -1376,6 +1390,9 @@ parse_input_constraint (const char **constraint_p, int input_num,
break;
}
+ if (saw_match && !*allows_reg)
+ warning ("matching constraint does not allow a register");
+
return true;
}
@@ -1704,13 +1721,16 @@ expand_asm_operands (tree string, tree outputs, tree inputs,
if (CONSTANT_P (op))
{
- op = force_const_mem (TYPE_MODE (type), op);
- op = validize_mem (op);
+ rtx mem = force_const_mem (TYPE_MODE (type), op);
+ if (mem)
+ op = validize_mem (mem);
+ else
+ op = force_reg (TYPE_MODE (type), op);
}
- else if (GET_CODE (op) == REG
- || GET_CODE (op) == SUBREG
- || GET_CODE (op) == ADDRESSOF
- || GET_CODE (op) == CONCAT)
+ if (GET_CODE (op) == REG
+ || GET_CODE (op) == SUBREG
+ || GET_CODE (op) == ADDRESSOF
+ || GET_CODE (op) == CONCAT)
{
tree qual_type = build_qualified_type (type,
(TYPE_QUALS (type)
@@ -2874,6 +2894,26 @@ expand_null_return (void)
expand_null_return_1 (last_insn);
}
+/* Generate RTL to return directly from the current function.
+ (That is, we bypass any return value.) */
+
+void
+expand_naked_return (void)
+{
+ rtx last_insn, end_label;
+
+ last_insn = get_last_insn ();
+ end_label = naked_return_label;
+
+ clear_pending_stack_adjust ();
+ do_pending_stack_adjust ();
+ clear_last_expr ();
+
+ if (end_label == 0)
+ end_label = naked_return_label = gen_label_rtx ();
+ expand_goto_internal (NULL_TREE, end_label, last_insn);
+}
+
/* Try to guess whether the value of return means error code. */
static enum br_predictor
return_prediction (rtx val)
@@ -2902,6 +2942,34 @@ return_prediction (rtx val)
return PRED_NO_PREDICTION;
}
+
+/* If the current function returns values in the most significant part
+ of a register, shift return value VAL appropriately. The mode of
+ the function's return type is known not to be BLKmode. */
+
+static rtx
+shift_return_value (rtx val)
+{
+ tree type;
+
+ type = TREE_TYPE (DECL_RESULT (current_function_decl));
+ if (targetm.calls.return_in_msb (type))
+ {
+ rtx target;
+ HOST_WIDE_INT shift;
+
+ target = DECL_RTL (DECL_RESULT (current_function_decl));
+ shift = (GET_MODE_BITSIZE (GET_MODE (target))
+ - BITS_PER_UNIT * int_size_in_bytes (type));
+ if (shift > 0)
+ val = expand_binop (GET_MODE (target), ashl_optab,
+ gen_lowpart (GET_MODE (target), val),
+ GEN_INT (shift), target, 1, OPTAB_WIDEN);
+ }
+ return val;
+}
+
+
/* Generate RTL to return from the current function, with value VAL. */
static void
@@ -3066,7 +3134,7 @@ expand_return (tree retval)
{
int i;
unsigned HOST_WIDE_INT bitpos, xbitpos;
- unsigned HOST_WIDE_INT big_endian_correction = 0;
+ unsigned HOST_WIDE_INT padding_correction = 0;
unsigned HOST_WIDE_INT bytes
= int_size_in_bytes (TREE_TYPE (retval_rhs));
int n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
@@ -3083,25 +3151,33 @@ expand_return (tree retval)
return;
}
- /* Structures whose size is not a multiple of a word are aligned
- to the least significant byte (to the right). On a BYTES_BIG_ENDIAN
- machine, this means we must skip the empty high order bytes when
- calculating the bit offset. */
- if (BYTES_BIG_ENDIAN
- && bytes % UNITS_PER_WORD)
- big_endian_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD)
- * BITS_PER_UNIT));
+ /* If the structure doesn't take up a whole number of words, see
+ whether the register value should be padded on the left or on
+ the right. Set PADDING_CORRECTION to the number of padding
+ bits needed on the left side.
+
+ In most ABIs, the structure will be returned at the least end of
+ the register, which translates to right padding on little-endian
+ targets and left padding on big-endian targets. The opposite
+ holds if the structure is returned at the most significant
+ end of the register. */
+ if (bytes % UNITS_PER_WORD != 0
+ && (targetm.calls.return_in_msb (TREE_TYPE (retval_rhs))
+ ? !BYTES_BIG_ENDIAN
+ : BYTES_BIG_ENDIAN))
+ padding_correction = (BITS_PER_WORD - ((bytes % UNITS_PER_WORD)
+ * BITS_PER_UNIT));
/* Copy the structure BITSIZE bits at a time. */
- for (bitpos = 0, xbitpos = big_endian_correction;
+ for (bitpos = 0, xbitpos = padding_correction;
bitpos < bytes * BITS_PER_UNIT;
bitpos += bitsize, xbitpos += bitsize)
{
/* We need a new destination pseudo each time xbitpos is
- on a word boundary and when xbitpos == big_endian_correction
+ on a word boundary and when xbitpos == padding_correction
(the first time through). */
if (xbitpos % BITS_PER_WORD == 0
- || xbitpos == big_endian_correction)
+ || xbitpos == padding_correction)
{
/* Generate an appropriate register. */
dst = gen_reg_rtx (word_mode);
@@ -3128,21 +3204,25 @@ expand_return (tree retval)
BITS_PER_WORD);
}
- /* Find the smallest integer mode large enough to hold the
- entire structure and use that mode instead of BLKmode
- on the USE insn for the return register. */
- for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
- tmpmode != VOIDmode;
- tmpmode = GET_MODE_WIDER_MODE (tmpmode))
- /* Have we found a large enough mode? */
- if (GET_MODE_SIZE (tmpmode) >= bytes)
- break;
+ tmpmode = GET_MODE (result_rtl);
+ if (tmpmode == BLKmode)
+ {
+ /* Find the smallest integer mode large enough to hold the
+ entire structure and use that mode instead of BLKmode
+ on the USE insn for the return register. */
+ for (tmpmode = GET_CLASS_NARROWEST_MODE (MODE_INT);
+ tmpmode != VOIDmode;
+ tmpmode = GET_MODE_WIDER_MODE (tmpmode))
+ /* Have we found a large enough mode? */
+ if (GET_MODE_SIZE (tmpmode) >= bytes)
+ break;
- /* No suitable mode found. */
- if (tmpmode == VOIDmode)
- abort ();
+ /* No suitable mode found. */
+ if (tmpmode == VOIDmode)
+ abort ();
- PUT_MODE (result_rtl, tmpmode);
+ PUT_MODE (result_rtl, tmpmode);
+ }
if (GET_MODE_SIZE (tmpmode) < GET_MODE_SIZE (word_mode))
result_reg_mode = word_mode;
@@ -3175,7 +3255,7 @@ expand_return (tree retval)
val = force_not_mem (val);
emit_queue ();
/* Return the calculated value, doing cleanups first. */
- expand_value_return (val);
+ expand_value_return (shift_return_value (val));
}
else
{
@@ -3487,6 +3567,14 @@ expand_nl_handler_label (rtx slot, rtx before_insn)
static void
expand_nl_goto_receiver (void)
{
+ /* Clobber the FP when we get here, so we have to make sure it's
+ marked as used by this function. */
+ emit_insn (gen_rtx_USE (VOIDmode, hard_frame_pointer_rtx));
+
+ /* Mark the static chain as clobbered here so life information
+ doesn't get messed up for it. */
+ emit_insn (gen_rtx_CLOBBER (VOIDmode, static_chain_rtx));
+
#ifdef HAVE_nonlocal_goto
if (! HAVE_nonlocal_goto)
#endif
@@ -3535,6 +3623,13 @@ expand_nl_goto_receiver (void)
if (HAVE_nonlocal_goto_receiver)
emit_insn (gen_nonlocal_goto_receiver ());
#endif
+
+ /* @@@ 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. Specifically, the update of the frame pointer must
+ happen immediately, not later. So emit an ASM_INPUT to act as blockage
+ insn. */
+ emit_insn (gen_rtx_ASM_INPUT (VOIDmode, ""));
}
/* Make handlers for nonlocal gotos taking place in the function calls in
diff --git a/gcc/stor-layout.c b/gcc/stor-layout.c
index 6e128e3560d..1272a0cbbcc 100644
--- a/gcc/stor-layout.c
+++ b/gcc/stor-layout.c
@@ -203,10 +203,10 @@ variable_size (tree size)
#define MAX_FIXED_MODE_SIZE GET_MODE_BITSIZE (DImode)
#endif
-/* Return the machine mode to use for a nonscalar of SIZE bits.
- The mode must be in class CLASS, and have exactly that many bits.
- If LIMIT is nonzero, modes of wider than MAX_FIXED_MODE_SIZE will not
- be used. */
+/* Return the machine mode to use for a nonscalar of SIZE bits. The
+ mode must be in class CLASS, and have exactly that many value bits;
+ it may have padding as well. If LIMIT is nonzero, modes of wider
+ than MAX_FIXED_MODE_SIZE will not be used. */
enum machine_mode
mode_for_size (unsigned int size, enum mode_class class, int limit)
@@ -219,7 +219,7 @@ mode_for_size (unsigned int size, enum mode_class class, int limit)
/* Get the first mode which has this size, in the specified class. */
for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
- if (GET_MODE_BITSIZE (mode) == size)
+ if (GET_MODE_PRECISION (mode) == size)
return mode;
return BLKmode;
@@ -242,7 +242,7 @@ mode_for_size_tree (tree size, enum mode_class class, int limit)
}
/* Similar, but never return BLKmode; return the narrowest mode that
- contains at least the requested number of bits. */
+ contains at least the requested number of value bits. */
enum machine_mode
smallest_mode_for_size (unsigned int size, enum mode_class class)
@@ -253,7 +253,7 @@ smallest_mode_for_size (unsigned int size, enum mode_class class)
specified class. */
for (mode = GET_CLASS_NARROWEST_MODE (class); mode != VOIDmode;
mode = GET_MODE_WIDER_MODE (mode))
- if (GET_MODE_BITSIZE (mode) >= size)
+ if (GET_MODE_PRECISION (mode) >= size)
return mode;
abort ();
@@ -435,7 +435,9 @@ layout_decl (tree decl, unsigned int known_align)
enum machine_mode xmode
= mode_for_size_tree (DECL_SIZE (decl), MODE_INT, 1);
- if (xmode != BLKmode && known_align >= GET_MODE_ALIGNMENT (xmode))
+ if (xmode != BLKmode
+ && (known_align == 0
+ || known_align >= GET_MODE_ALIGNMENT (xmode)))
{
DECL_ALIGN (decl) = MAX (GET_MODE_ALIGNMENT (xmode),
DECL_ALIGN (decl));
@@ -453,7 +455,7 @@ layout_decl (tree decl, unsigned int known_align)
else if (DECL_PACKED (decl) && DECL_USER_ALIGN (decl))
/* Don't touch DECL_ALIGN. For other packed fields, go ahead and
round up; we'll reduce it again below. We want packing to
- supercede USER_ALIGN inherited from the type, but defer to
+ supersede USER_ALIGN inherited from the type, but defer to
alignment explicitly specified on the field decl. */;
else
do_type_align (type, decl);
diff --git a/gcc/system.h b/gcc/system.h
index d0a9eab00db..a62e2a68faa 100644
--- a/gcc/system.h
+++ b/gcc/system.h
@@ -251,28 +251,6 @@ extern int errno;
#include <sys/wait.h>
#endif
-#ifndef WIFSIGNALED
-#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
-#endif
-#ifndef WTERMSIG
-#define WTERMSIG(S) ((S) & 0x7f)
-#endif
-#ifndef WIFEXITED
-#define WIFEXITED(S) (((S) & 0xff) == 0)
-#endif
-#ifndef WEXITSTATUS
-#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
-#endif
-#ifndef WSTOPSIG
-#define WSTOPSIG WEXITSTATUS
-#endif
-#ifndef WCOREDUMP
-#define WCOREDUMP(S) ((S) & WCOREFLG)
-#endif
-#ifndef WCOREFLG
-#define WCOREFLG 0200
-#endif
-
/* The HAVE_DECL_* macros are three-state, undefined, 0 or 1. If they
are defined to 0 then we must provide the relevant declaration
here. These checks will be in the undefined state while configure
@@ -490,8 +468,8 @@ extern int snprintf (char *, size_t, const char *, ...);
FIXME: provide a complete autoconf test for buggy enum bitfields. */
#if (GCC_VERSION > 2000)
-#define ENUM_BITFIELD(TYPE) enum TYPE
-#define CHAR_BITFIELD unsigned char
+#define ENUM_BITFIELD(TYPE) __extension__ enum TYPE
+#define CHAR_BITFIELD __extension__ unsigned char
#else
#define ENUM_BITFIELD(TYPE) unsigned int
#define CHAR_BITFIELD unsigned int
@@ -594,7 +572,8 @@ typedef char _Bool;
ASM_SIMPLIFY_DWARF_ADDR INIT_TARGET_OPTABS INIT_SUBTARGET_OPTABS \
INIT_GOFAST_OPTABS MULSI3_LIBCALL MULDI3_LIBCALL DIVSI3_LIBCALL \
DIVDI3_LIBCALL UDIVSI3_LIBCALL UDIVDI3_LIBCALL MODSI3_LIBCALL \
- MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL
+ MODDI3_LIBCALL UMODSI3_LIBCALL UMODDI3_LIBCALL BUILD_VA_LIST_TYPE \
+ PRETEND_OUTGOING_VARARGS_NAMED
/* Other obsolete target macros, or macros that used to be in target
headers and were not used, and may be obsolete or may never have
@@ -618,7 +597,9 @@ typedef char _Bool;
DBX_WORKING_DIRECTORY INSN_CACHE_DEPTH INSN_CACHE_SIZE \
INSN_CACHE_LINE_WIDTH INIT_SECTION_PREAMBLE NEED_ATEXIT ON_EXIT \
EXIT_BODY OBJECT_FORMAT_ROSE MULTIBYTE_CHARS MAP_CHARACTER \
- LIBGCC_NEEDS_DOUBLE
+ LIBGCC_NEEDS_DOUBLE FINAL_PRESCAN_LABEL DEFAULT_CALLER_SAVES \
+ LOAD_ARGS_REVERSED MAX_INTEGER_COMPUTATION_MODE \
+ CONVERT_HARD_REGISTER_TO_SSA_P
/* Hooks that are no longer used. */
#pragma GCC poison LANG_HOOKS_FUNCTION_MARK LANG_HOOKS_FUNCTION_FREE \
diff --git a/gcc/target-def.h b/gcc/target-def.h
index 5c7fcb0b9df..9ff668d3f14 100644
--- a/gcc/target-def.h
+++ b/gcc/target-def.h
@@ -316,6 +316,8 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_MACHINE_DEPENDENT_REORG 0
+#define TARGET_BUILD_BUILTIN_VA_LIST std_build_builtin_va_list
+
#define TARGET_GET_PCH_VALIDITY default_get_pch_validity
#define TARGET_PCH_VALID_P default_pch_valid_p
@@ -325,6 +327,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define TARGET_STRUCT_VALUE_RTX default_struct_value_rtx
#define TARGET_RETURN_IN_MEMORY default_return_in_memory
+#define TARGET_RETURN_IN_MSB hook_bool_tree_false
#define TARGET_EXPAND_BUILTIN_SAVEREGS default_expand_builtin_saveregs
#define TARGET_SETUP_INCOMING_VARARGS default_setup_incoming_varargs
@@ -337,6 +340,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_PROMOTE_PROTOTYPES, \
TARGET_STRUCT_VALUE_RTX, \
TARGET_RETURN_IN_MEMORY, \
+ TARGET_RETURN_IN_MSB, \
TARGET_EXPAND_BUILTIN_SAVEREGS, \
TARGET_SETUP_INCOMING_VARARGS, \
TARGET_STRICT_ARGUMENT_NAMING, \
@@ -377,6 +381,7 @@ Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
TARGET_ADDRESS_COST, \
TARGET_DWARF_REGISTER_SPAN, \
TARGET_MACHINE_DEPENDENT_REORG, \
+ TARGET_BUILD_BUILTIN_VA_LIST, \
TARGET_GET_PCH_VALIDITY, \
TARGET_PCH_VALID_P, \
TARGET_HAVE_NAMED_SECTIONS, \
diff --git a/gcc/target.h b/gcc/target.h
index 0b19445456a..93935374c15 100644
--- a/gcc/target.h
+++ b/gcc/target.h
@@ -207,7 +207,7 @@ struct gcc_target
correspondingly starts and finishes. The function defined by
init_dfa_pre_cycle_insn and init_dfa_post_cycle_insn are used
to initialize the corresponding insns. The default values of
- the memebers result in not changing the automaton state when
+ the members result in not changing the automaton state when
the new simulated processor cycle correspondingly starts and
finishes. */
void (* init_dfa_pre_cycle_insn) (void);
@@ -262,9 +262,8 @@ struct gcc_target
fourth argument is the cost of the dependence as estimated by
the scheduler. The last argument is the distance in cycles
between the already scheduled insn (first parameter) and the
- the second insn (second parameter).
- */
- bool (* is_costly_dependence) PARAMS ((rtx, rtx, rtx, int, int));
+ the second insn (second parameter). */
+ bool (* is_costly_dependence) (rtx, rtx, rtx, int, int);
} sched;
/* Given two decls, merge their attributes and return the result. */
@@ -382,6 +381,9 @@ struct gcc_target
delayed-branch scheduling. */
void (* machine_dependent_reorg) (void);
+ /* Create the __builtin_va_list type. */
+ tree (* build_builtin_va_list) (void);
+
/* Validity-checking routines for PCH files, target-specific.
get_pch_validity returns a pointer to the data to be stored,
and stores the size in its argument. pch_valid_p gets the same
@@ -424,6 +426,7 @@ struct gcc_target
bool (*promote_prototypes) (tree fntype);
rtx (*struct_value_rtx) (tree fndecl, int incoming);
bool (*return_in_memory) (tree type, tree fndecl);
+ bool (*return_in_msb) (tree type);
rtx (*expand_builtin_saveregs) (void);
/* Returns pretend_argument_size. */
void (*setup_incoming_varargs) (CUMULATIVE_ARGS *ca, enum machine_mode mode,
diff --git a/gcc/targhooks.c b/gcc/targhooks.c
index 1000abb5d24..18d3be3ad0c 100644
--- a/gcc/targhooks.c
+++ b/gcc/targhooks.c
@@ -185,20 +185,25 @@ default_strict_argument_naming (CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
bool
default_pretend_outgoing_varargs_named(CUMULATIVE_ARGS *ca ATTRIBUTE_UNUSED)
{
-#ifdef PRETEND_OUTGOING_VARARGS_NAMED
- return PRETEND_OUTGOING_VARARGS_NAMED;
-#else
#ifdef SETUP_INCOMING_VARARGS
return 1;
#else
return (targetm.calls.setup_incoming_varargs != default_setup_incoming_varargs);
#endif
-#endif
}
/* Generic hook that takes a CUMULATIVE_ARGS pointer and returns true. */
+
bool
hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS * a ATTRIBUTE_UNUSED)
{
return true;
}
+
+/* Generic hook that takes a machine mode and returns true. */
+
+bool
+hook_bool_machine_mode_true (enum machine_mode a ATTRIBUTE_UNUSED)
+{
+ return true;
+}
diff --git a/gcc/targhooks.h b/gcc/targhooks.h
index 724abe82ab4..e5c5a2a5596 100644
--- a/gcc/targhooks.h
+++ b/gcc/targhooks.h
@@ -33,3 +33,4 @@ extern bool default_strict_argument_naming (CUMULATIVE_ARGS *);
extern bool default_pretend_outgoing_varargs_named (CUMULATIVE_ARGS *);
extern bool hook_bool_CUMULATIVE_ARGS_true (CUMULATIVE_ARGS *);
+extern bool hook_bool_machine_mode_true (enum machine_mode);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 47a7512c64f..f8697027d00 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,1020 @@
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
+ * gcc.c-torture/compile/libcall-1.c: New test.
+
+2004-02-18 Paul Brook <paul@codesourcery.com>
+
+ PR debug/12934
+ * gcc.dg/debug/debug-7.c: New test.
+
+2004-01-07 Richard Earnshaw <rearnsha@arm.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/abi/vbase10.C: Use -mstructure-size-boundary=8 on ARM.
+
+2003-12-29 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.pt/static11.C: Correct XFAIL syntax.
+
+ * gcc.dg/builtins-config.h: Include <ctype.h>, not <limits.h>.
+
+2003-12-28 Mark Mitchell <mark@codesourcery.com>
+
+ * gcc.dg/const-elim-1.c: XFAIL on arm-*-*.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/bprob/bprob.exp: Load target-supports.exp
+ * g77.dg/bprob/bprob.exp: Likewise.
+ * gcc.misc-tests/bprob.exp: Likewise.
+ * gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float
+ variants on systems where the library does not provide that
+ functionality.
+ * gcc.dg/builtins-20.c: Use builtins-config.h.
+ * gcc.dg/builtins-config.h: New file.
+
+ * lib/gcc-dg.exp (dg-require-profiling): New function.
+ * lib/target-supports.exp (check_profiling_available): Likewise.
+ * g++.dg/bprob/bprob.exp: Use check_profiling_available.
+ * g77.dg/bprob/bprob.exp: Likewise.
+ * gcc.misc-tests/bprob.exp: Likewise.
+ * g++.old-deja/g++.law/profile1.C: Use dg-require-profiling.
+ * gcc.dg/20021014-1.c: Likewise.
+ * gcc.dg/nest.c: Likewise.
+
+ * g++.dg/lookup/java1.C: Use -fdollars-in-identifiers when
+ compiling.
+ * g++.dg/lookup/java2.C: Likewise.
+ * gcc.dg/cpp/lexident.c: Likewise.
+
+2003-12-30 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/abi/vbase10.C: XFAIL on arm*-*-*.
+
+2003-12-30 Kazu Hirata <kazu@cs.umass.edu>
+
+ * g++.old-deja/g++.jason/thunk2.C: Remove traces of dead
+ ports.
+ * g++.old-deja/g++.jason/thunk3.C: Likewise.
+ * g++.old-deja/g++.law/profile1.C: Likewise.
+ * gcc.c-torture/compile/981006-1.c: Likewise.
+ * gcc.c-torture/execute/loop-2e.x: Likewise.
+ * gcc.c-torture/execute/loop-2f.x: Remove.
+ * gcc.c-torture/execute/loop-2g.x: Likewise.
+ * gcc.c-torture/execute/strct-varg-1.x: Likewise.
+ * gcc.dg/20020312-2.c: Remove traces of dead ports.
+
+2003-12-30 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13507
+ * g++.dg/ext/attrib11.C: New test.
+
+ PR c++/13494
+ * g++.dg/template/array2-1.C: New test.
+ * g++.dg/template/array2-2.C: New test.
+
+2003-12-29 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.pt/static11.C: Correct XFAIL syntax.
+
+2003-12-29 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12774
+ * g++.dg/template/array1-1.C: New test.
+ * g++.dg/template/array1-2.C: New test.
+
+2003-12-29 Roger Sayle <roger@eyesopen.com>
+
+ PR fortran/12632
+ * g77.dg/12632.f: New test case.
+
+2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13289
+ * g++.dg/parse/nontype1.C: New test.
+
+2003-12-29 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12403
+ * g++.dg/parse/explicit1.C: New test.
+ * g++.old-deja/g++.pt/explicit71.C: Adjust expected error.
+
+2003-12-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13081
+ * g++.dg/opt/inline6.C: New test.
+
+ PR c++/12613
+ * g++.dg/parse/error9.C: New test.
+
+ * gcc.dg/const-elim-1.c: XFAIL on arm-*-*.
+
+2003-12-28 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13009
+ * g++.dg/init/assign1.C: New test.
+
+2003-12-28 Roger Sayle <roger@eyesopen.com>
+
+ PR c++/13070
+ * g++.dg/warn/format3.C: New test case.
+
+2003-12-27 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ * gcc.c-torture/compile/20031227-1.c: New test.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/bprob/bprob.exp: Load target-supports.exp
+ * g77.dg/bprob/bprob.exp: Likewise.
+ * gcc.misc-tests/bprob.exp: Likewise.
+ * gcc.dg/builtins-18.c: Use builtins-config.h. Do not test float
+ variants on systems where the library does not provide that
+ functionality.
+ * gcc.dg/builtins-20.c: Use builtins-config.h.
+ * gcc.dg/builtins-config.h: New file.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * lib/gcc-dg.exp (dg-require-profiling): New function.
+ * lib/target-supports.exp (check_profiling_available): Likewise.
+ * g++.dg/bprob/bprob.exp: Use check_profiling_available.
+ * g77.dg/bprob/bprob.exp: Likewise.
+ * gcc.misc-tests/bprob.exp: Likewise.
+ * g++.old-deja/g++.law/profile1.C: Use dg-require-profiling.
+ * gcc.dg/20021014-1.c: Likewise.
+ * gcc.dg/nest.c: Likewise.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/lookup/java1.C: Use -fdollars-in-identifiers when
+ compiling.
+ * g++.dg/lookup/java2.C: Likewise.
+ * gcc.dg/cpp/lexident.c: Likewise.
+
+2003-12-23 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/compile/20020604-1.c: XFAIL on H8 if -mn is
+ given.
+ * gcc.c-torture/compile/961203-1.c: Likewise.
+ * gcc.c-torture/compile/980506-1.c: Likewise.
+
+2003-12-23 Zack Weinberg <zack@codesourcery.com>
+
+ * lib/gcc-dg.exp (dg-prune-output): New annotation.
+ (additional_prunes): New global.
+ (gcc-dg-prune): Handle additional per-test pruning.
+ (dg-test): Clear additional_prunes between tests.
+
+ * gcc.c-torture/compile/920625-1.c: Remove xfail. Use
+ dg-prune-output to avoid spurious failures from assembler
+ complaining about nonexistent WAW violations.
+ * gcc.c-torture/compile/981223-1.c: Remove dg-options line.
+ Use dg-prune-output to avoid spurious failures from assembler
+ warning about Itanium B-step errata.
+
+2003-12-23 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/abi/macro0.C: New test.
+ * g++.dg/abi/macro1.C: Likewise.
+ * g++.dg/abi/macro2.C: Likewise.
+
+ * g++.dg/abi/bitfield5.C: Add explicit -fabi-version=1 option.
+ * g++.dg/abi/bitfield7.C: Likewise.
+ * g++.dg/abi/dtor2.C: Likewise.
+ * g++.dg/abi/mangle11.C: Likewise.
+ * g++.dg/abi/mangle12.C: Likewise.
+ * g++.dg/abi/mangle14.C: Likewise.
+ * g++.dg/abi/mangle17.C: Likewise.
+ * g++.dg/abi/vbase10.C: Likewise.
+ * g++.dg/abi/vbase14.C: Likewise.
+ * g++.dg/template/qualttp17.C: Likewise.
+
+2003-12-21 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/11995
+ * gcc.dg/20031223-1.c: New test.
+
+2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/noreturn-7.c: New test.
+
+2003-12-23 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/null-pointer-1.c: New test.
+
+2003-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.old-deja/g++.jason/template18.C: Remove.
+ * g++.old-deja/g++.jason/template37.C: Likewise.
+
+ PR c++/12862
+ * g++.dg/lookup/ns1.C: New test.
+
+ PR c++/12397
+ * g++.dg/template/lookup3.C: New test.
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * g++.dg/template/recurse1.C: New test
+
+2003-12-22 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12479
+ * g++.dg/parse/semicolon1.C: New test.
+ * g++.dg/parse/semicolon1.h: Likewise.
+
+2003-12-22 Fariborz Jahanian <fjahanian@apple.com>
+
+ * gcc.dg/darwin-misaligned.c: New test.
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR c/9163
+ * gcc.dg/20031222-1.c: New test.
+
+2003-12-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13438
+ * g++.dg/parse/error8.C: New test.
+
+ PR c++/11554
+ * testsuite/g++.dg/warn/ctor-init-1.C: New test.
+
+2003-12-21 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/compile/20020910-1.c: Disable if __INT_MAX is
+ too small.
+ * gcc.c-torture/compile/930217-1.c: Likewise.
+ * gcc.c-torture/compile/930513-1.c: Likewise.
+ * gcc.c-torture/execute/920908-2.c: Likewise.
+ * gcc.c-torture/execute/921204-1.c: Likewise.
+ * gcc.c-torture/execute/930621-1.c: Likewise.
+ * gcc.c-torture/execute/930630-1.c: Likewise.
+ * gcc.c-torture/execute/931031-1.c: Likewise.
+ * gcc.c-torture/execute/980602-2.c: Likewise.
+ * gcc.c-torture/execute/comp-goto-1.c: Likewise.
+ * gcc.c-torture/execute/compndlit-1.c: Likewise.
+ * gcc.c-torture/execute/extzvsi.c: Likewise.
+ * gcc.c-torture/unsorted/ext.c: Likewise.
+
+2003-12-20 Andrew Pinski <pinskia@gcc.gnu.org>
+
+ PR target/12749
+ * gcc.c-torture/compile/20031220-2.c: New test case.
+
+2003-12-20 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/13031
+ * gcc.c-torture/compile/20031220-1.c: New test case.
+
+2003-12-20 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/cast-function-1.c: New test.
+
+2003-12-19 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/format/ext-1.c: Allow 'I' flag on floating point decimal
+ formats.
+
+2003-12-19 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12795
+ * g++.dg/ext/attrib10.C: New test.
+
+2003-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/cleanup-10.c: New test.
+ * gcc.dg/cleanup-11.c: New test.
+
+2003-12-19 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/13239
+ * g++.dg/opt/expect1.C: New test.
+
+2003-12-19 Hartmut Penner <hpenner@de.ibm.com>
+
+ * gcc.dg/altivec-varargs-1.c: Enable testcase on ppc linux.
+
+2003-12-18 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR debug/12923
+ * gcc.dg/20031218-1.c: New test.
+
+ PR debug/12389
+ * gcc.dg/20031218-2.c: New test.
+ * gcc.dg/20031218-3.c: New test.
+
+ * g++.dg/abi/mangle18-1.C: Modify regexp to test for `[: \t\n]' at end
+ of label name and allow for USER_LABEL_PREFIX == "_" names.
+ * g++.dg/abi/mangle18-2.C: Likewise.
+ * g++.dg/abi/mangle19-1.C: Likewise.
+ * g++.dg/abi/mangle19-2.C: Likewise.
+ * g++.dg/abi/mangle20-1.C: Likewise.
+ * g++.dg/abi/mangle20-2.C: Likewise.
+
+2003-12-18 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/bitfld-1.c: Expect warnings for enum bitfields.
+
+2003-12-18 Steven Bosscher <steven@gcc.gnu.org>
+ Dan Kegel <dank@kegel.com>
+
+ PR other/12009
+ * g++.dg/compat/compat.exp: Do not set LD_LIBRARY_PATH when
+ testing a cross compiler, it causes spurious compile failures.
+ * lib/g++.exp: Likewise.
+
+2003-12-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13262
+ * g++.dg/template/access13.C: New test.
+
+2003-12-18 Ulrich Weigand <uweigand@de.ibm.com>
+
+ * gcc.dg/20031216-1.c: New test.
+
+2003-12-18 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/9154
+ * g++.dg/template/error10.C: New test.
+
+2003-12-18 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/eh/simd-1.C: XFAIL on SPARC.
+ * g++.dg/eh/simd-2.C: Likewise.
+
+2003-12-17 James E Wilson <wilson@specifixinc.com>
+ Roger Sayle <roger@eyesopen.com>
+
+ * gcc.c-torture/execute/ieee/mzero5.c: New.
+
+2003-12-17 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10603
+ * g++.dg/parse/error6.C: New test.
+
+ PR c++/12827
+ * g++.dg/parse/error7.C: New test.
+
+2003-12-17 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * lib/gcc-dg.exp (gcc-dg-debug-runtest): Do not run debug-[12].c
+ at -O with stabs debugging formats.
+ * gcc.dg/debug/debug-1.c: Turn 'p' into a global variable.
+ * gcc.dg/debug/debug-2.c: Likewise.
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12696
+ * g++.dg/init/error1.C: New test.
+
+ PR c++/12218
+ * g++.dg/init/pm3.C: New test.
+
+2003-12-17 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/3347
+ * gcc.dg/bitfld-8.c: New test.
+
+2003-12-16 James Lemke <jim@wasabisystems.com>
+
+ * gcc.dg/arm-scd42-[123].c: New tests.
+
+2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/9043
+ * g++.dg/abi/mangle20-1.C: New test.
+ * g++.dg/abi/mangle20-2.C: New test.
+
+2003-12-16 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13275
+ * g++.dg/other/offsetof2.C: Remove XFAIL.
+ * g++.dg/parse/offsetof1.C: New test.
+ * g++.gd/parse/offsetof2.C: Likewise.
+
+2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * g++.dg/template/nontype3.C: New test.
+ * g++.dg/template/static2.C: Tweaked the dg-error clause.
+
+2003-12-16 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ * g++.dg/warn/noreturn-3.C: Also test instantiation.
+
+2003-12-16 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13387
+ * g++.dg/expr/assign1.C: New test.
+
+ PR c++/13242
+ * g++.dg/abi/mangle19-1.C: New test.
+ * g++.dg/abi/mangle19-2.C: New test.
+
+2003-12-16 Hartmut Penner <hpenner@de.ibm.com>
+
+ * testsuite/gcc.dg/altivec-10.c: Test vec_cmple and vec_all_numeric.
+
+2003-12-16 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/execute/20031216-1.c: New test.
+
+2003-12-16 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * g++.dg/template/ptrmem7.C: Simplified the test case to not hit
+ an ICE regression.
+
+2003-12-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10926
+ * g++.dg/template/error9.C: New test.
+
+ PR c++/11116
+ * g++.dg/template/error8.C: New test.
+
+2003-12-15 Roger Sayle <roger@eyesopen.com>
+
+ PR middle-end/13400
+ * gcc.c-torture/execute/20031215-1.c: New test case.
+
+2003-12-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13269
+ * g++.dg/parse/error5.C: New test.
+
+ PR c++/12989
+ * g++.dg/expr/sizeof1.C: New test.
+
+ PR c++/13310
+ * g++.dg/template/crash15.C: New test.
+
+2003-12-15 Geoffrey Keating <geoffk@apple.com>
+
+ * g++.old-deja/g++.pt/vaarg3.C: Don't expect an error for passing
+ a non-POD type as the last named parameter of a varargs function.
+
+2003-12-15 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13243
+ PR c++/12573
+ * g++.dg/template/crash14.C: New test.
+ * g++.dg/template/dependent-expr3.C: Add dg-error markers.
+
+2003-12-15 Nathan Sidwell <nathan@codesourcery.com>
+
+ * g++.dg/other/java1.C: New test.
+
+ PR c++/13241
+ * g++.dg/abi/mangle18-1.C: New test.
+ * g++.dg/abi/mangle18-2.C: New test.
+
+2003-12-15 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
+
+ PR optimization/10312
+ * gcc.c-torture/execute/20031214-1.c: New.
+
+2003-12-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/10779
+ PR c++/12160
+ * g++.dg/parse/error3.C: New test.
+ * g++.dg/parse/error4.C: Likewise.
+ * g++.dg/abi/mangle4.C: Tweak error messages.
+ * g++.dg/lookup/using5.C: Likewise.
+ * g++.dg/other/error2.C: Likewise.
+ * g++.dg/parse/typename5.C: Likewise.
+ * g++.dg/parse/undefined1.C: Likewise.
+ * g++.dg/template/arg2.C: Likewise.
+ * g++.dg/template/ttp3.C: Likewise.
+ * g++.dg/template/type1.C: Likewise.
+ * g++.old-deja/g++.other/crash32.C: Likewise.
+ * g++.old-djea/g++.pt/defarg8.C: Likewise.
+
+2003-12-14 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13106
+ * g++.dg/warn/noreturn-3.C: New test.
+
+2003-12-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/13118
+ * g++.dg/abi/covariant3.C: New.
+
+2003-12-12 Jakub Jelinek <jakub@redhat.com>
+
+ * g++.dg/eh/ia64-1.C: New test.
+
+2003-12-12 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/13037
+ * g77.f-torture/execute/13037.f: New test case.
+
+2003-12-12 Nathan Sidwell <nathan@codesourcery.com>
+
+ PR c++/12881
+ * g++.dg/abi/covariant2.C: New.
+
+2003-12-12 Neil Booth <neil@daikokuya.co.uk>
+
+ * testsuite/gcc.dg/cpp/trad/macro.c: New tests.
+
+2003-12-11 Zack Weinberg <zack@codesourcery.com>
+
+ * gcc.c-torture/execute/wchar_t-1.x: Delete.
+
+2003-12-10 Robert Schiele <rschiele@uni-mannheim.de>
+
+ PR other/10819
+ * lib/gcc.exp (default_gcc_version): Do not match NL/CR characters
+ to fix Bug 10819.
+ * lib/g++.exp (g++_version): Likewise.
+ * lib/g77.exp (g77_version): Likewise.
+ * lib/objc.exp (default_objc_version): Likewise.
+
+2003-12-10 Richard Henderson <rth@redhat.com>
+
+ * gcc.c-torture/execute/wchar_t-1.c: Convert to utf-8.
+
+ * gcc.dg/intermod-1.c: Adjust assembler scan pattern for alpha.
+
+2003-12-08 Matt Austern <austern@apple.com>
+
+ PR c/13134
+ * lib/gcc-dg.exp (dg-require-visibility): Define.
+ * lib/target-supports (check_visibility_available): Define.
+ * gcc.dg/visibility-1.c: New test.
+ * gcc.dg/visibility-2.c: Likewise.
+ * gcc.dg/visibility-3.c: Likewise.
+ * gcc.dg/visibility-4.c: Likewise.
+ * gcc.dg/visibility-5.c: Likewise.
+ * gcc.dg/visibility-6.c: Likewise.
+ * g++.dg/ext/visibility-1.C: Likewise.
+ * g++.dg/ext/visibility-2.C: Likewise.
+ * g++.dg/ext/visibility-3.C: Likewise.
+ * g++.dg/ext/visibility-4.C: Likewise.
+ * g++.dg/ext/visibility-5.C: Likewise.
+ * g++.dg/ext/visibility-6.C: Likewise.
+
+2003-12-07 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ * g++.dg/lookup/java1.C: New test.
+ * g++.dg/lookup/java2.C: New test.
+
+2003-12-07 Falk Hueffner <falk@debian.org>
+
+ * g++.dg/opt/noreturn-1.C: New test.
+
+2003-12-07 Wolfgang Bangerth <bangerth@dealii.org>
+
+ * gcc.dg/overflow-1.c: New test.
+
+2003-12-07 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g77.f-torture/compile/13060.f: New test.
+
+2003-12-06 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13323
+ * g++.dg/inherit/operator2.C: New test.
+
+2003-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13305
+ * g++.dg/ext/attrib9.C: New test.
+
+2003-12-05 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13314
+ * g++.dg/template/error7.C: New test.
+
+2003-12-05 Stuart Menefy <stuart.menefy@st.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
+
+ PR target/13302
+ * g++.dg/other/struct-va_list.C: New test.
+
+2003-12-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/13166
+ * g++.dg/parse/defarg6.C: New test.
+
+2003-12-05 Hans-Peter Nilsson <hp@axis.com>
+
+ PR target/13256
+ * gcc.c-torture/execute/20031201-1.c: New test.
+
+2003-12-05 Arnaud Charlet <charlet@act-europe.fr>
+
+ * ada/acats/run_acats: Add checks against missing gnatlib/gnattools.
+
+2003-12-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-return-1.c: New test.
+
+2003-12-04 Stuart Menefy <stuart.menefy@st.com>
+ J"orn Rennecke <joern.rennecke@superh.com>
+
+ PR optimization/13260
+ * gcc.c-torture/execute/20031204-1.c: New test.
+
+2003-12-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9127
+ * g++.dg/template/error6.C: New test.
+
+2003-12-03 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.dg/20031202-1.c: New test.
+
+2003-12-03 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/13179
+ * g++.dg/template/eh1.C: New test.
+
+ PR c++/10771
+ * g++.dg/template/error5.C: New test.
+
+2003-12-02 David Ung <davidu@mips.com>
+
+ * gcc.dg/compat/vector-check.h: Corrected type for var
+ g_##TMODE
+
+2003-12-02 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/10126
+ * g++.dg/template/ptrmem8.C: New test.
+
+2003-12-02 Giovanni Bajo <giovannibajo@gcc.gnu.org>
+
+ PR c++/12573
+ * g++.dg/template/dependent-expr3.C: New test.
+
+2003-12-01 James Lemke <jim@wasabisystems.com>
+
+ * gcc.dg/arm-g2.c: New test.
+
+2003-12-01 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/11634
+ * gcc.dg/20031201-2.c: New test case.
+
+2003-12-01 Zack Weinberg <zack@codesourcery.com>
+
+ PR 11433
+ * objc.dg/proto-lossage-3.m: New test.
+
+2003-12-01 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/12628
+ * gcc.dg/20031201-1.c: New test case.
+
+2003-12-01 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/unaligned-1.c: New test.
+
+2003-11-30 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/9849
+ * g++.dg/template/error4.C: New test.
+ * g++.dg/template/nested3.C: Adjust error markers.
+
+2003-11-30 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/cpp/assert4.c: Check more #system assertions.
+
+2003-11-29 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/10333
+ * gcc.dg/bitfld-7.c: New test.
+
+2003-11-29 Richard Sandiford <rsandifo@redhat.com>
+
+ * gcc.dg/tls/asm-1.C: New test.
+
+2003-11-28 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/cpp/assert4.c: Update.
+
+2003-11-28 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-apply2.c: Set size of stack argument data to 64.
+ * gcc.dg/builtin-apply3.c: New test.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * lib/compat.exp (compat-obj): New xfaildata parameter.
+ Use it to set compiler_conditional_xfail_data before compiling.
+ (compat-get-options): Handle dg-xfail-if.
+ (compat-execute): Retrieve XFAIL data and pass them to compat-obj.
+ * gcc.dg/compat/vector-1_x.c: XFAIL on SPARC.
+ * gcc.dg/compat/vector-1_y.c: Likewise.
+ * gcc.dg/compat/vector-2_x.c: Likewise.
+ * gcc.dg/compat/vector-2_y.c: Likewise.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/reg-stack4.C: New test.
+
+2003-11-27 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/builtin-apply2.c: New test.
+
+2003-11-26 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/compile/20031023-4.c: Don't XFAIL on SPARC64.
+
+2003-11-23 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12924
+ * g++.dg/template/template-id-2.C: New test.
+
+2003-11-22 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/5369
+ * g++.dg/template/memfriend1.C: New test.
+ * g++.dg/template/memfriend2.C: Likewise.
+ * g++.dg/template/memfriend3.C: Likewise.
+ * g++.dg/template/memfriend4.C: Likewise.
+ * g++.dg/template/memfriend5.C: Likewise.
+ * g++.dg/template/memfriend6.C: Likewise.
+ * g++.dg/template/memfriend7.C: Likewise.
+ * g++.dg/template/memfriend8.C: Likewise.
+ * g++.old-deja/g++.pt/friend44.C: Remove a bogus error.
+
+2003-11-21 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12515
+ * g++.dg/ext/cond1.C: New test.
+
+2003-11-20 Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/20020201-2.c: Remove.
+ * gcc.dg/20020201-4.c: Remove.
+ * gcc.dg/20020304-1.c: Remove.
+
+2003-11-19 Nathanael Nerode <neroden@gcc.gnu.org>
+
+ * gcc.dg/cpp/trad/xwin1.c: New test case.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * g++.dg/compat/compat.exp: Add DYLD_LIBRARY_PATH for darwin.
+ * lib/g77.exp: Likewise.
+ * lib/objc.exp: Likewise.
+ * lib/g++.exp: Likewise, add -multiply_defined suppress flag
+ for darwin.
+
+2003-11-18 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12932
+ * g++.dg/template/static5.C: New test.
+
+2003-11-18 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/nested-func-1.c: New test.
+
+2003-11-16 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * gcc.dg/cpp/assert4.c: New test.
+
+2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/2294
+ * g++.dg/lookup/using9.c: New test.
+
+2003-11-14 Mark Mitchell <mark@codesourcery.com>
+
+ PR c++/12762
+ * g++.dg/template/error3.C: New test.
+
+2003-11-14 Arnaud Charlet <charlet@act-europe.fr>
+
+ PR ada/13035
+ * ada/acats/run_acats, run_all.sh: Fix syntax error.
+ No longer use a wrapper for gcc, since this does not work under
+ Windows.
+
+2003-11-14 Giovanni Bajo <giovannibajo@libero.it>
+
+ PR c++/2094
+ * g++.dg/template/ptrmem7.C: New test.
+
+2003-11-13 Andrew Pinski <apinski@apple.com>
+
+ * gcc.c-torture/compile/20031113-1.c: New test.
+
+2003-11-13 Mark Mitchell <mark@codesourcery.com>
+ Kean Johnston <jkj@sco.com>
+
+ PR c/13029
+ * gcc.dg/unused-4.c: Update.
+
+2003-11-13 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * g++.dg/opt/const3.C: New test.
+
+2003-11-13 Jan Hubicka <jh@suse.cz>
+
+ * gcc.c-torture/compile/20031112-1.c: New test.
+
+2003-11-12 Mark Mitchell <mark@codesourcery.com>
+
+ * g++.dg/parse/crash10.C: Remove bogus error marker.
+
+2003-11-12 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * ada/acats/run_acats (host_gnatmake): Use type in a /bin/sh script.
+ (host_gcc): Likewise.
+ (ROOT): Honor $PWDCMD.
+ (BASE): Likewise.
+ * ada/acats/run_all.sh (dir): Honor $PWDCMD.
+
+2003-11-12 Catherine Moore <clm@redhat.com>
+
+ * gcc.c-torture/execute/20020720-1.x: Add xfail for frv-*-*.
+
+2003-11-12 Andreas Jaeger <aj@suse.de>
+ Jakub Jelinek <jakub@redhat.com>
+ Andrew Pinski <pinskia@physics.uc.edu>
+ Richard Henderson <rth@redhat.com>
+
+ * gcc.dg/c90-const-expr-2.c (foo): Avoid extra warning on 64-bit
+ systems.
+ * gcc.dg/c99-const-expr-2.c (foo): Likewise.
+
+ * gcc.dg/20030926-1.c: Make it work on x86_64 systems.
+ * gcc.dg/i386-pentium4-not-mull.c: Likewise.
+
+2003-11-11 Andreas Jaeger <aj@suse.de>
+
+ * gcc.c-torture/execute/20020720-1.x: Test passes also on x86_64.
+
+ * gcc.c-torture/execute/20020227-1.x: Test passes also on x86_64.
+
+2003-11-10 Arnaud Charlet <charlet@act-europe.fr>
+
+ * ada/acats/run_all.sh: Add handling of unsupported (tasking) tests.
+ Clean ups.
+
+2003-11-10 Waldek Hebisch <hebisch@math.uni.wroc.pl>
+
+ * gcc.dg/trampoline-1.c: New test.
+
+2003-11-09 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * gcc.c-torture/compile/200031109-1.c: New test.
+
+2003-11-08 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ PR c/3190
+ PR c/8714
+ * gcc.dg/format/c90-strftime-1.c, gcc.dg/format/c90-strftime-2.c,
+ gcc.dg/format/c99-strftime-1.c, gcc.dg/format/ext3.c,
+ gcc.dg/format/no-y2k-1.c: Update.
+
+2003-11-08 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/10467
+ * gcc.dg/20031108-1.c: New test case.
+
+2003-11-07 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/pch/warn-1.c: Allow for more helpful error message.
+
+2003-11-08 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/compound-lvalue-1.c: New test.
+ * gcc.dg/c90-const-expr-2.c, gcc.dg/c99-const-expr-2.c: Remove
+ some XFAILs.
+
+2003-11-06 Geoffrey Keating <geoffk@apple.com>
+
+ * gcc.dg/altivec-varargs-1.c: New test.
+
+2003-11-05 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.c-torture/compile/20031023-4.c: XFAIL on SPARC64
+ * gcc.c-torture/compile/simd-5.c: XFAIL on SPARC64 at -O0 and -O1.
+ * gcc.c-torture/execute/simd-4.x: New file. XFAIL on SPARC at -O0.
+ * gcc.c-torture/execute/va-arg-25.x: New file. XFAIL on SPARC.
+ * gcc.dg/uninit-C.c: XFAIL on non 64-bit Solaris versions.
+
+2003-11-05 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * gcc.dg/cond-lvalue-1.c: New test.
+
+2003-11-05 Gernot Hillier <gernot.hillier@siemens.com>
+
+ * g++.old-deja/g++.pt/asm1.C: Enable for e.g. x86_64-*-linux-gnu.
+
+2003-11-05 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/11616
+ * g++.dg/template/instantiate5.C: New test.
+
+2003-11-03 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/12726
+ * g++.dg/ext/complit2.C: Replace test with self-contained version.
+ * ChangeLog: Add missing first entry for above test.
+
+2003-11-02 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/9810
+ * g++.dg/template/using8.C: New test.
+ * g++.old-deja/g++.other/access11.C: Adjust expected error location.
+
+2003-11-02 Roger Sayle <roger@eyesopen.com>
+
+ PR optimization/10817
+ * gcc.c-torture/compile/20031102-1.c: New test case.
+
+2003-11-02 Kazu Hirata <kazu@cs.umass.edu>
+
+ * gcc.c-torture/execute/va-arg-25.c: Enable only if INT_MAX ==
+ 2147483647.
+
+2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/20031102-1.c: New test.
+
+2003-11-02 Eric Botcazou <ebotcazou@libertysurf.fr>
+
+ * gcc.dg/complex-1.c: New test.
+
+2003-11-01 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+ PR c++/12796
+ * g++.dg/template/crash13.C: Adjust expected error location.
+ * g++.old-deja/g++.brendan/ns1.C: Likewise.
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ * g++.dg/bprob/bprob.exp: Disable test on arm-elf configs.
+
+2003-10-31 Josef Zlomek <zlomekj@suse.cz>
+
+ PR/10239
+ * gcc.c-torture/compile/20031031-2.c: New test.
+
+2003-10-31 Josef Zlomek <zlomekj@suse.cz>
+
+ PR/11640
+ * gcc.c-torture/compile/20031031-1.c: New test.
+
+2003-10-31 Richard Earnshaw <rearnsha@arm.com>
+
+ * g77.dg/bprob/bprob.exp: Disable test on arm-elf configs.
+ * gcc.misc-tests/bprob.exp: Likewise.
+ * g77.dg/execute/20001201.x, 6367.x, io0.x, io1.x, u77-test.x: XFAIL
+ the execution test on arm-elf configs.
+ * g77.dg/execute/10197.x: New file. XFAIL the execution test on
+ configs that don't support scratch files.
+ * g77.dg/execute/u77-test.x: XFAIL compilation on arm-elf configs.
+
+2003-10-30 Arnaud Charlet <charlet@act-europe.fr>
+
+ * ada/acats/run_all.sh: Do not print PASS messages to stdout, as
+ done by dejagnu.
+
+2003-10-29 Arnaud Charlet <charlet@act-europe.fr>
+
+ * ada/acats/run_all.sh: Redirect mv output to /dev/null
+ Avoid non pure sh syntax. Add more logging.
+
+ * ada/acats/norun.lst: Disable cdd2a03, since it is expected to
+ fail.
+
+2003-10-28 Franz Sirl <Franz.Sirl-kernel@lauterbach.com>
+
+ PR libgcj/10610
+ * gcc.dg/ppc-stackalign-1.c: New test.
+
+2003-10-28 Arnaud Charlet <charlet@act-europe.fr>
+
+ * ada/acats/run_all.sh: Change output to be more compliant with
+ dejagnu framework.
+ Create acats.sum and acats.log files under testsuite/ada/acats
+ Only run [a-z]* directories, to filter out e.g. CVS.
+ Redirect build output to log file.
+
+2003-10-27 Arnaud Charlet <charlet@act-europe.fr>
+
+ * README.ada: Removed, integrated in ../doc/sourcebuild.texi
+
+2003-10-27 Arnaud Charlet <charlet@act-europe.fr>
+
+ PR ada/5909:
+ * README.ada, ada/acats: Import ACATS 2.5 for GCC Ada test suite.
+
+2003-10-27 Jakub Jelinek <jakub@redhat.com>
+
+ * gcc.c-torture/compile/20031023-1.c: New test.
+ * gcc.c-torture/compile/20031023-2.c: New test.
+ * gcc.c-torture/compile/20031023-3.c: New test.
+ * gcc.c-torture/compile/20031023-4.c: New test.
+
2003-10-26 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10371
@@ -27,6 +1044,16 @@
* g++.dg/inherit/covariant10.C: New test.
* g++.dg/inherit/covariant11.C: New test.
+2003-10-23 Jason Merrill <jason@redhat.com>
+
+ PR c++/12726
+ * g++.dg/ext/complit2.C: New test.
+
+2003-10-20 Falk Hueffner <falk.hueffner@student.uni-tuebingen.de>
+
+ PR target/12654
+ * gcc.c-torture/execute/20031020-1.c: New test.
+
2003-10-20 Zdenek Dvorak <rakdver@atrey.karlin.mff.cuni.cz>
* gcc.dg/old-style-asm-1.c: Also check for (set (pc) on lines
@@ -126,7 +1153,7 @@
objc.dg/try-catch-4.m: Run on non-Darwin targets.
* objc.dg/zero-link-2.m: Remove blank line.
* objc.dg/zero-link-3.m: New test case.
-
+
2003-10-13 Geoffrey Keating <geoffk@apple.com>
* g77.f-torture/execute/980520-1.x: XFAIL at -O0.
@@ -220,10 +1247,10 @@
PR c++/10147
* g++.dg/other/error4.C: Update error messages.
* g++.dg/template/ptrmem4.C: Likewise.
-
+
PR c++/12337
* g++.dg/init/new9.C: New test.
-
+
PR c++/12334, c++/12236, c++/8656
* g++.dg/ext/attrib8.C: New test.
@@ -231,7 +1258,7 @@
* gcc.dg/debug/dwarf2-3.h: New test.
* gcc.dg/debug/dwarf2-3.c: New test case for -feliminate-dwarf2-dups.
-
+
2003-10-06 Wolfgang Bangerth <bangerth@ticam.utexas.edu>
* g++.dg/opt/cfg2.C: New test.
@@ -289,7 +1316,7 @@
2003-09-29 Richard Henderson <rth@redhat.com>
- * g++.dg/init/array10.C: Add dg-options.
+ * g++.dg/init/array10.C: Add dg-options.
2003-09-29 Eric Botcazou <ebotcazou@libertysurf.fr>
@@ -352,7 +1379,7 @@
objc.dg/method-{1-2}.m, objc.dg/proto-hier-1.m,
objc.dg/proto-lossage-1.m: Adjust for message wording changes.
* objc.dg/const-str-1.m: Fix constant string layout.
-
+
2003-09-24 Alexandre Oliva <aoliva@redhat.com>
* gcc.dg/cpp/Wunknown-pragmas-1.c: New test.
@@ -503,7 +1530,7 @@
2003-09-09 Devang Patel <dpatel@apple.com>
* gcc.dg/darwin-ld-6.c: New test.
-
+
2003-09-09 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/torture/builtin-explog-1.c: New testcase.
@@ -566,7 +1593,7 @@
PR c++/11507
* g++.dg/lookup/scoped7.C: New test.
-
+
PR c++/9574
* g++.dg/other/static1.C: New test.
@@ -575,10 +1602,10 @@
PR c++/11432
* g++.dg/template/crash10.C: New test.
-
+
PR c++/2478
* g++.dg/overload/VLA.C: New test.
-
+
PR c++/10804
* g++.dg/template/call1.C: New test.
@@ -615,7 +1642,7 @@
2003-09-05 Andrew Pinski <pinskia@physics.uc.edu>
- * g++.old-deja/g++.ext/pretty2.C: Update for change
+ * g++.old-deja/g++.ext/pretty2.C: Update for change
in __FUNCTION__.
* g++.old-deja/g++.ext/pretty3.C: Likewise.
@@ -623,7 +1650,7 @@
PR c++/11922
* g++/dg/template/qualified-id1.C: New test.
-
+
PR c++/12037
* g++.dg/warn/noeffect4.C: New test.
@@ -632,7 +1659,7 @@
* g++.dg/ext/fnname1.C: New test. (__func__ for C++.)
* g++.dg/ext/fnname2.C: Likewise.
* g++.dg/ext/fnname3.C: Likewise.
-
+
2003-09-04 Mark Mitchell <mark@codesourcery.com>
* g++.dg/expr/lval1.C: New test.
@@ -652,7 +1679,7 @@
PR c++/11553
* g++.dg/parse/friend3.C: New test.
-
+
2003-09-02 Mark Mitchell <mark@codesourcery.com>
PR c++/11847
@@ -961,7 +1988,7 @@
PR c++/11670
* g++.dg/expr/cast2.C: New test.
-
+
PR c++/10530
* g++.dg/template/dependent-name2.C: New test.
@@ -1026,7 +2053,7 @@
* gcc.dg/torture/builtin-math-1.c: New test taken from
bits of gcc.dg/builtins-3.c, gcc.dg/builtins-5.c and also some
additional cases.
-
+
* gcc.dg/builtins-3.c, gcc.dg/builtins-4.c, gcc.dg/builtins-5.c:
Delete.
@@ -1091,7 +2118,7 @@
* gcc.dg/tls/opt-7.c: New test.
2003-07-31 Andrew Pinski <pinskia@physics.uc.edu>
-
+
* g++.old-deja/g++.other/crash18.C: Remove.
2003-07-31 Nathan Sidwell <nathan@codesourcery.com>
@@ -2463,7 +3490,7 @@
2003-06-03 Glen Nakamura <glen@imodulo.com>
- * gcc.dg/20020525-1.c: Replace 0x5a5a5a5a with -1.
+ * gcc.dg/20020525-1.c: Replace 0x5a5a5a5a with -1.
2003-06-03 J"orn Rennecke <joern.rennecke@superh.com>
@@ -5764,7 +6791,7 @@
2002-10-21 Mark Mitchell <mark@codesourcery.com>
- * g++.dg/init/array6.C: Add additional tests.
+ * g++.dg/init/array6.C: Add additional tests.
2002-10-21 Ulrich Weigand <uweigand@de.ibm.com>
diff --git a/gcc/testsuite/g++.dg/abi/bitfield5.C b/gcc/testsuite/g++.dg/abi/bitfield5.C
index eed76e649e6..e754f0ddf22 100644
--- a/gcc/testsuite/g++.dg/abi/bitfield5.C
+++ b/gcc/testsuite/g++.dg/abi/bitfield5.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
struct A {
virtual void f();
diff --git a/gcc/testsuite/g++.dg/abi/bitfield7.C b/gcc/testsuite/g++.dg/abi/bitfield7.C
index 9868cfce198..b5b656ffa47 100644
--- a/gcc/testsuite/g++.dg/abi/bitfield7.C
+++ b/gcc/testsuite/g++.dg/abi/bitfield7.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
union U { // { dg-warning "ABI" }
int i: 4096; // { dg-warning "exceeds" }
diff --git a/gcc/testsuite/g++.dg/abi/covariant2.C b/gcc/testsuite/g++.dg/abi/covariant2.C
new file mode 100644
index 00000000000..87eb2a2708c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/covariant2.C
@@ -0,0 +1,32 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Dec 2003 <nathan@codesourcery.com>
+// Origin: grigory@stl.sarov.ru
+
+// PR c++/12881. ICE in thunk generation
+
+struct c1 {};
+
+struct c3 : virtual c1
+{
+ virtual c1* f6() {};
+ int i;
+};
+
+struct c6 : virtual c3 { };
+
+struct c7 : c3
+{
+ virtual c3* f6() {};
+};
+
+struct c24 : virtual c7
+{
+ virtual c6* f6();
+};
+
+c6* c24::f6() { return 0; }
+
+struct c31 : c24 {};
+
diff --git a/gcc/testsuite/g++.dg/abi/covariant3.C b/gcc/testsuite/g++.dg/abi/covariant3.C
new file mode 100644
index 00000000000..178157c58b2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/covariant3.C
@@ -0,0 +1,85 @@
+// { dg-do run }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 12 Dec 2003 <nathan@codesourcery.com>
+// Origin: grigory@stl.sarov.ru
+
+// PR c++/13118. Missing covariant thunk.
+
+struct c0 {};
+struct c1 : virtual c0 {
+ virtual c0* f6();
+};
+
+struct c5 {
+ virtual void foo();
+};
+
+struct c10 : virtual c1 {
+ virtual void foo();
+};
+
+struct c1a : c1 {}; // disambiguation
+
+struct c11 : virtual c10, c1a {
+ int i;
+ virtual c1* f6 () = 0;
+};
+
+struct c18 : c5, virtual c1 {
+ virtual void bar();
+};
+
+struct c28 : virtual c0, virtual c11 {
+ virtual c18* f6();
+};
+
+c0 *c1::f6 () {}
+void c5::foo () {}
+void c10::foo () {}
+void c18::bar () {}
+
+c18 ret;
+
+c18 *c28::f6 ()
+{
+ return &ret;
+}
+
+bool check_c1 (c1 *ptr)
+{
+ c0 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c10 (c10 *ptr)
+{
+ c0 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c11 (c11 *ptr)
+{
+ c1 *r = ptr->f6 ();
+ return r != &ret;
+}
+bool check_c28 (c28 *ptr)
+{
+ c18 *r = ptr->f6 ();
+ return r != &ret;
+}
+
+int main ()
+{
+ c28 obj;
+
+ if (check_c1 (static_cast<c1a *> (&obj)))
+ return 1;
+ if (check_c1 (static_cast<c10 *> (&obj)))
+ return 2;
+ if (check_c10 (&obj))
+ return 3;
+ if (check_c11 (&obj))
+ return 4;
+ if (check_c28 (&obj))
+ return 5;
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/abi/dtor2.C b/gcc/testsuite/g++.dg/abi/dtor2.C
index f4a1336fefa..6b89cc8eae0 100644
--- a/gcc/testsuite/g++.dg/abi/dtor2.C
+++ b/gcc/testsuite/g++.dg/abi/dtor2.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
struct A {
virtual void a ();
diff --git a/gcc/testsuite/g++.dg/abi/macro0.C b/gcc/testsuite/g++.dg/abi/macro0.C
new file mode 100644
index 00000000000..6c391e6891b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/macro0.C
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=0" }
+
+#if __GXX_ABI_VERSION != 999999
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
diff --git a/gcc/testsuite/g++.dg/abi/macro1.C b/gcc/testsuite/g++.dg/abi/macro1.C
new file mode 100644
index 00000000000..871208da3ad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/macro1.C
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=1" }
+
+#if __GXX_ABI_VERSION != 102
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
diff --git a/gcc/testsuite/g++.dg/abi/macro2.C b/gcc/testsuite/g++.dg/abi/macro2.C
new file mode 100644
index 00000000000..9f0af9cff34
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/macro2.C
@@ -0,0 +1,5 @@
+// { dg-options "-fabi-version=2" }
+
+#if __GXX_ABI_VERSION != 1002
+#error "Incorrect value of __GXX_ABI_VERSION"
+#endif
diff --git a/gcc/testsuite/g++.dg/abi/mangle11.C b/gcc/testsuite/g++.dg/abi/mangle11.C
index f7151171d30..a049a956671 100644
--- a/gcc/testsuite/g++.dg/abi/mangle11.C
+++ b/gcc/testsuite/g++.dg/abi/mangle11.C
@@ -1,4 +1,4 @@
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
template <typename Q>
void f (typename Q::X) {}
diff --git a/gcc/testsuite/g++.dg/abi/mangle12.C b/gcc/testsuite/g++.dg/abi/mangle12.C
index 772b58b7a39..406a13b3f79 100644
--- a/gcc/testsuite/g++.dg/abi/mangle12.C
+++ b/gcc/testsuite/g++.dg/abi/mangle12.C
@@ -1,4 +1,4 @@
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
template <template <typename> class Q>
void f (typename Q<int>::X) {}
diff --git a/gcc/testsuite/g++.dg/abi/mangle14.C b/gcc/testsuite/g++.dg/abi/mangle14.C
index 8e2bfddde76..1205ac45fe0 100644
--- a/gcc/testsuite/g++.dg/abi/mangle14.C
+++ b/gcc/testsuite/g++.dg/abi/mangle14.C
@@ -1,5 +1,5 @@
// { dg-do compile }
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
struct A {
template <typename T> int f ();
diff --git a/gcc/testsuite/g++.dg/abi/mangle17.C b/gcc/testsuite/g++.dg/abi/mangle17.C
index 6f8e387e1d7..994da88edca 100644
--- a/gcc/testsuite/g++.dg/abi/mangle17.C
+++ b/gcc/testsuite/g++.dg/abi/mangle17.C
@@ -1,4 +1,4 @@
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
enum E { e = 3 };
diff --git a/gcc/testsuite/g++.dg/abi/mangle18-1.C b/gcc/testsuite/g++.dg/abi/mangle18-1.C
new file mode 100644
index 00000000000..a1be5e48c33
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle18-1.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Nov 2003 <nathan@codesourcery.com>
+
+// PR 13241
+// mangled template arguments that are external objects incorrectly
+
+extern "C" void Foo ();
+namespace NMS
+{
+ extern "C" int V;
+}
+
+template <void (*)()> struct S {};
+template <int *> struct T {};
+
+void f (S<Foo>){}
+// { dg-final { scan-assembler "\n_?_Z1f1SIXadL_Z3FooEEE\[: \t\n\]" } }
+
+void g (T<&NMS::V>){}
+// { dg-final { scan-assembler "\n_?_Z1g1TIXadL_Z1VEEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle18-2.C b/gcc/testsuite/g++.dg/abi/mangle18-2.C
new file mode 100644
index 00000000000..a231d495fef
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle18-2.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Nov 2003 <nathan@codesourcery.com>
+
+// PR 13241
+// mangled template arguments that are external objects incorrectly
+
+extern "C" void Foo ();
+namespace NMS
+{
+ extern "C" int V;
+}
+
+template <void (*)()> struct S {};
+template <int *> struct T {};
+
+void f (S<Foo>){} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1f1SIXadL3FooEEE\[: \t\n\]" } }
+
+void g (T<&NMS::V>){} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1g1TIXadL_ZN3NMS1VEEEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle19-1.C b/gcc/testsuite/g++.dg/abi/mangle19-1.C
new file mode 100644
index 00000000000..c7ab2cbb9b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle19-1.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
+
+// PR 13242
+// mangled template arguments that are external objects incorrectly
+
+extern int N;
+template <int &> struct S {};
+void n (S<N>) {}
+// { dg-final { scan-assembler "\n_?_Z1n1SILZ1NEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle19-2.C b/gcc/testsuite/g++.dg/abi/mangle19-2.C
new file mode 100644
index 00000000000..f0855e69d34
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle19-2.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
+
+// PR 13242
+// mangled template arguments that are external objects incorrectly
+
+extern int N;
+template <int &> struct S {};
+void n (S<N>) {} // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1n1SIXadL_Z1NEEE\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle20-1.C b/gcc/testsuite/g++.dg/abi/mangle20-1.C
new file mode 100644
index 00000000000..1985fe3c941
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle20-1.C
@@ -0,0 +1,19 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
+
+// PR 9043
+// mangled array types in templates
+
+template <int I> void f(int (*)[2]) {}
+template <int I> void g(int (*)[I+2]) {}
+
+static const int I=1;
+static const int J=2;
+
+template void f<1>(int (*)[2]);
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPA2_i\[: \t\n\]" } }
+template void g<1>(int (*)[3]);
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle20-2.C b/gcc/testsuite/g++.dg/abi/mangle20-2.C
new file mode 100644
index 00000000000..bf3d189bf0c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/abi/mangle20-2.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1 -Wabi" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
+
+// PR 9043
+// mangled array types in templates
+
+template <int I> void f(int (*)[2]) {}
+template <int I> void g(int (*)[I+2]) {}
+
+template void f<1>(int (*)[2]); // { dg-warning "mangled name" }
+// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPALi2E_i\[: \t\n\]" } }
+template void g<1>(int (*)[3]);
+// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/mangle4.C b/gcc/testsuite/g++.dg/abi/mangle4.C
index d4b5936825c..3ce224716db 100644
--- a/gcc/testsuite/g++.dg/abi/mangle4.C
+++ b/gcc/testsuite/g++.dg/abi/mangle4.C
@@ -18,7 +18,7 @@ int main()
C<static_cast<const A*>(&b)> c; // { dg-error "" }
D<&b> d;
E<const_cast<B*>(&b)> e; // { dg-error "" }
- f(d, c); // { dg-error "" }
- g(d, e); // { dg-error "" }
+ f(d, c);
+ g(d, e);
}
diff --git a/gcc/testsuite/g++.dg/abi/vbase10.C b/gcc/testsuite/g++.dg/abi/vbase10.C
index 3c110be7188..a0d113ade79 100644
--- a/gcc/testsuite/g++.dg/abi/vbase10.C
+++ b/gcc/testsuite/g++.dg/abi/vbase10.C
@@ -1,5 +1,10 @@
// { dg-do compile }
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
+// On ARM processors, the alignment of B will be 4 even though it
+// contains only a single "char". That would avoids the situation
+// that the warning below is designed to catch. We therefore
+// explicitly set the default structure alignment to 1.
+// { dg-options "-Wabi -fabi-version=1 -mstructure-size-boundary=8" { target arm*-*-* } }
struct A { virtual void f(); char c1; };
struct B { B(); char c2; };
diff --git a/gcc/testsuite/g++.dg/abi/vbase14.C b/gcc/testsuite/g++.dg/abi/vbase14.C
index 99290b85720..320d5ba77dc 100644
--- a/gcc/testsuite/g++.dg/abi/vbase14.C
+++ b/gcc/testsuite/g++.dg/abi/vbase14.C
@@ -1,4 +1,4 @@
-// { dg-options "-Wabi" }
+// { dg-options "-Wabi -fabi-version=1" }
struct E1 {};
struct E2 : public E1 {}; // { dg-warning "layout" }
diff --git a/gcc/testsuite/g++.dg/bprob/bprob.exp b/gcc/testsuite/g++.dg/bprob/bprob.exp
index 4e26e3bbede..bef57836cf1 100644
--- a/gcc/testsuite/g++.dg/bprob/bprob.exp
+++ b/gcc/testsuite/g++.dg/bprob/bprob.exp
@@ -17,10 +17,11 @@
# Test the functionality of programs compiled with profile-directed block
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
+load_lib target-supports.exp
+
# Some targets don't have any implementation of __bb_init_func or are
# missing other needed machinery.
-if { [istarget mmix-*-*]
- || [istarget cris-*-*] } {
+if { ![check_profiling_available] } {
return
}
diff --git a/gcc/testsuite/g++.dg/compat/compat.exp b/gcc/testsuite/g++.dg/compat/compat.exp
index f6c1bbdec70..94da38c77de 100644
--- a/gcc/testsuite/g++.dg/compat/compat.exp
+++ b/gcc/testsuite/g++.dg/compat/compat.exp
@@ -43,10 +43,13 @@ proc compat-fix-library-path { } {
global ld_library_path
# See comments in lib/g++.exp for why this is needed.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
+ if {![is_remote target]} {
+ # See comments in lib/g++.exp for why this is needed.
+ setenv LD_LIBRARY_PATH $ld_library_path
+ setenv SHLIB_PATH $ld_library_path
+ setenv LD_LIBRARYN32_PATH $ld_library_path
+ setenv LD_LIBRARY64_PATH $ld_library_path
+ }
}
#
diff --git a/gcc/testsuite/g++.dg/eh/dtor2.C b/gcc/testsuite/g++.dg/eh/dtor2.C
new file mode 100644
index 00000000000..9555b3789af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/dtor2.C
@@ -0,0 +1,30 @@
+// PR c++/12751
+// tree-ssa eh lowering bug ran a destructor twice for one object
+// { dg-do run }
+
+static int check;
+
+struct Y {
+ Y();
+ ~Y();
+};
+
+void foo() {
+ Y y1;
+ Y y2;
+ switch(0) {
+ case 1: {
+ Y y3;
+ return;
+ }
+ }
+}
+
+Y::Y() { ++check; }
+Y::~Y() { --check; }
+
+int main()
+{
+ foo ();
+ return check;
+}
diff --git a/gcc/testsuite/g++.dg/eh/ia64-1.C b/gcc/testsuite/g++.dg/eh/ia64-1.C
new file mode 100644
index 00000000000..a1b731c8d80
--- /dev/null
+++ b/gcc/testsuite/g++.dg/eh/ia64-1.C
@@ -0,0 +1,50 @@
+// Test whether call saved float and branch regs are restored properly
+// { dg-do run { target ia64-*-* } }
+// { dg-options "-O2" }
+
+extern "C" void abort (void);
+
+char buf[128];
+
+void __attribute__((noinline))
+bar (void)
+{
+ throw 1;
+}
+
+void __attribute__((noinline))
+foo (void)
+{
+ bar ();
+ bar ();
+}
+
+int
+main (void)
+{
+ register double f2 __asm ("f2");
+ register double f3 __asm ("f3");
+ register double f4 __asm ("f4");
+ register double f5 __asm ("f5");
+ register double f16 __asm ("f16");
+ register double f17 __asm ("f17");
+ register void *b1 __asm ("b1");
+ register void *b2 __asm ("b2");
+ register void *b3 __asm ("b3");
+ register void *b4 __asm ("b4");
+ register void *b5 __asm ("b5");
+ f2 = 12.0; f3 = 13.0; f4 = 14.0; f5 = 15.0; f16 = 16.0; f17 = 17.0;
+ b1 = &buf[1]; b2 = &buf[2]; b3 = &buf[3]; b4 = &buf[4]; b5 = &buf[5];
+ try
+ {
+ foo ();
+ }
+ catch (...) {}
+ if (f2 != 12.0 || f3 != 13.0 || f4 != 14.0
+ || f5 != 15.0 || f16 != 16.0 || f17 != 17.0)
+ abort ();
+ if (b1 != &buf[1] || b2 != &buf[2] || b3 != &buf[3]
+ || b4 != &buf[4] || b5 != &buf[5])
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/eh/simd-1.C b/gcc/testsuite/g++.dg/eh/simd-1.C
index 1e15b4d5d1a..9cad5ad9d10 100644
--- a/gcc/testsuite/g++.dg/eh/simd-1.C
+++ b/gcc/testsuite/g++.dg/eh/simd-1.C
@@ -2,6 +2,7 @@
// Contributed by Aldy Hernandez (aldy@quesejoda.com).
// { dg-options "-O" }
// { dg-do run }
+// { dg-error "" "PR target/12916" { target sparc*-*-* } 10 }
typedef int __attribute__((mode(V2SI))) vecint;
diff --git a/gcc/testsuite/g++.dg/eh/simd-2.C b/gcc/testsuite/g++.dg/eh/simd-2.C
index 39f8dc80f23..81c4025a12e 100644
--- a/gcc/testsuite/g++.dg/eh/simd-2.C
+++ b/gcc/testsuite/g++.dg/eh/simd-2.C
@@ -3,6 +3,7 @@
// { dg-options "-O" }
// { dg-options "-O -w" { target i?86-*-* } }
// { dg-do run }
+// { dg-error "" "PR target/12916" { target sparc*-*-* } 11 }
typedef int __attribute__((mode(V4SI))) vecint;
diff --git a/gcc/testsuite/g++.dg/expr/assign1.C b/gcc/testsuite/g++.dg/expr/assign1.C
new file mode 100644
index 00000000000..7eb37e523ac
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/assign1.C
@@ -0,0 +1,34 @@
+// { dg-do run }
+
+// Contributed by Nathan Sidwell 15 Dec 2003 <nathan@codesourcery.com>
+// Origin: Tasso Karkanis <Tasso.Karkanis@rogers.com>
+// PR c++/13387. Clobbered tail padding of base
+
+inline void *operator new (__SIZE_TYPE__, void *ptr)
+{
+ return ptr;
+}
+
+struct Base {
+ Base() : i(0), c(0) {}
+ int i;
+ char c;
+};
+
+struct Sub : Base {
+ Sub () : d(0) {}
+ char d;
+};
+
+int main() {
+ Sub sub;
+ char base_alias[sizeof (Base)];
+ Base *base;
+
+ for (unsigned ix = sizeof base_alias; ix--;)
+ base_alias[ix] = 0x55;
+ base = new (&base_alias) Base ();
+
+ static_cast <Base &> (sub) = *base;
+ return sub.d;
+}
diff --git a/gcc/testsuite/g++.dg/expr/sizeof1.C b/gcc/testsuite/g++.dg/expr/sizeof1.C
new file mode 100644
index 00000000000..fa84481fabf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/expr/sizeof1.C
@@ -0,0 +1,7 @@
+// PR c++/12989
+
+struct A
+{
+ int foo() { return sizeof(bar); } // { dg-error "" }
+ int bar();
+};
diff --git a/gcc/testsuite/g++.dg/ext/attrib10.C b/gcc/testsuite/g++.dg/ext/attrib10.C
new file mode 100644
index 00000000000..6d04cb855b7
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib10.C
@@ -0,0 +1,7 @@
+// PR c++/12795
+
+void foo()
+{
+ extern void bar () __attribute__ ((__alias__ ("BAR")));
+ bar ();
+}
diff --git a/gcc/testsuite/g++.dg/ext/attrib11.C b/gcc/testsuite/g++.dg/ext/attrib11.C
new file mode 100644
index 00000000000..26bc7907c2e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib11.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 30 Dec 2003 <nathan@codesourcery.com>
+
+
+// PR c++/13507, spurious warning due to attribute clobbering
+extern "C" {
+ extern int printf (__const char *__restrict __format, ...) throw ();
+ extern int scanf (__const char *__restrict __format, ...) throw ();
+}
+
+void foo(unsigned int x)
+{
+ printf ("%d\n", x);
+}
diff --git a/gcc/testsuite/g++.dg/ext/attrib9.C b/gcc/testsuite/g++.dg/ext/attrib9.C
new file mode 100644
index 00000000000..ee6fdb1d375
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/attrib9.C
@@ -0,0 +1,5 @@
+class __attribute__((unused)) C;
+struct __attribute__((unused)) S;
+union __attribute__((unused)) U;
+enum e {};
+enum __attribute__((unused)) e;
diff --git a/gcc/testsuite/g++.dg/ext/complit2.C b/gcc/testsuite/g++.dg/ext/complit2.C
index a8fe874360a..9fe00c42ea0 100644
--- a/gcc/testsuite/g++.dg/ext/complit2.C
+++ b/gcc/testsuite/g++.dg/ext/complit2.C
@@ -1,17 +1,22 @@
// PR c++/12726
+// Origin: Vladimir Zidar <mr_W@mindnever.org>
+// Reduced version: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-options "" }
-#include <string>
-
-struct foobar {
- std::string s;
-};
-
-int main(int argc, char **argv)
+struct A
{
- foobar fb;
+ A();
+ A(const A&);
+ A(int);
+};
- fb = (foobar) { "abcd" };
+struct B
+{
+ A a;
+};
- return 0;
+void foo()
+{
+ B b;
+ b = (B){0};
}
diff --git a/gcc/testsuite/g++.dg/ext/cond1.C b/gcc/testsuite/g++.dg/ext/cond1.C
new file mode 100644
index 00000000000..ec342121edf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/cond1.C
@@ -0,0 +1,4 @@
+// PR c++/12515
+// { dg-do compile }
+// { dg-options "" }
+template<int> void foo() { 0 ?: 0; }
diff --git a/gcc/testsuite/g++.dg/ext/visibility-1.C b/gcc/testsuite/g++.dg/ext/visibility-1.C
new file mode 100644
index 00000000000..d579eb27206
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-1.C
@@ -0,0 +1,8 @@
+/* Test visibility attribute on function definition. */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */
+
+void
+__attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc/testsuite/g++.dg/ext/visibility-2.C b/gcc/testsuite/g++.dg/ext/visibility-2.C
new file mode 100644
index 00000000000..89e853c4dc5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-2.C
@@ -0,0 +1,7 @@
+/* Test that visibility attribute on declaration extends to definition. */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */
+
+void __attribute__((visibility ("hidden"))) foo();
+
+void foo() { }
diff --git a/gcc/testsuite/g++.dg/ext/visibility-3.C b/gcc/testsuite/g++.dg/ext/visibility-3.C
new file mode 100644
index 00000000000..d0cc8912efb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-3.C
@@ -0,0 +1,7 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc/testsuite/g++.dg/ext/visibility-4.C b/gcc/testsuite/g++.dg/ext/visibility-4.C
new file mode 100644
index 00000000000..d217bc9ec5d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-4.C
@@ -0,0 +1,8 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int __attribute__ ((visibility ("hidden")))
+xyzzy;
+
+int xyzzy = 5;
diff --git a/gcc/testsuite/g++.dg/ext/visibility-5.C b/gcc/testsuite/g++.dg/ext/visibility-5.C
new file mode 100644
index 00000000000..9cdc8021e47
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-5.C
@@ -0,0 +1,11 @@
+/* Test visibility attribute on definition of a function that has
+ already had a forward declaration. */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*_Z3foov" } } */
+
+void foo();
+
+void
+ __attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc/testsuite/g++.dg/ext/visibility-6.C b/gcc/testsuite/g++.dg/ext/visibility-6.C
new file mode 100644
index 00000000000..6e8f0ce1135
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-6.C
@@ -0,0 +1,10 @@
+/* Test visibility attribute on definition of global variable that has
+ already had a forward declaration. */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int xyzzy;
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc/testsuite/g++.dg/ext/visibility-7.C b/gcc/testsuite/g++.dg/ext/visibility-7.C
new file mode 100644
index 00000000000..40acb72463f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ext/visibility-7.C
@@ -0,0 +1,11 @@
+/* Test warning from conflicting visibility specifications. */
+/* { dg-do compile { target *86-*-linux* } } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int
+__attribute__((visibility ("hidden")))
+xyzzy; /* { dg-warning "previous declaration here" "" } */
+
+int
+__attribute__((visibility ("protected")))
+xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */
diff --git a/gcc/testsuite/g++.dg/inherit/operator2.C b/gcc/testsuite/g++.dg/inherit/operator2.C
new file mode 100644
index 00000000000..09407e1b489
--- /dev/null
+++ b/gcc/testsuite/g++.dg/inherit/operator2.C
@@ -0,0 +1,22 @@
+typedef int INT_TYPEDEF;
+
+template<class T>
+class TypedIfc
+{
+public:
+ virtual ~TypedIfc() { }
+ virtual operator const T&() const = 0;
+ virtual const T& operator= (const T& t) = 0;
+};
+
+template<class Tnative>
+class NullIfc : public TypedIfc<Tnative>
+{
+public:
+ const Tnative& operator= (const Tnative& t) { return t; }
+ operator const Tnative&() const { return *(Tnative *)0; }
+};
+
+typedef TypedIfc<INT_TYPEDEF> INT_TYPEDEFIfc;
+
+NullIfc<int> i32;
diff --git a/gcc/testsuite/g++.dg/init/array12.C b/gcc/testsuite/g++.dg/init/array12.C
new file mode 100644
index 00000000000..3bb48002967
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/array12.C
@@ -0,0 +1,28 @@
+// PR c++/12253
+// Bug: We were failing to destroy the temporary A passed to the
+// constructor for b[0] before going on to construct b[1].
+
+// { dg-do run }
+
+extern "C" int printf (const char *, ...);
+
+int c;
+int r;
+
+struct A
+{
+ A() { printf ("A()\n"); if (c++) r = 1; }
+ A(const A&) { printf ("A(const A&)\n"); ++c; }
+ ~A() { printf ("~A()\n"); --c; }
+};
+
+struct B
+{
+ B(int, const A& = A()) { printf ("B()\n"); }
+};
+
+int main()
+{
+ B b[] = { 0, 0 };
+ return r;
+}
diff --git a/gcc/testsuite/g++.dg/init/assign1.C b/gcc/testsuite/g++.dg/init/assign1.C
new file mode 100644
index 00000000000..690a481910a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/assign1.C
@@ -0,0 +1,30 @@
+// PR c++/13009
+// { dg-do run }
+
+struct A {
+ char a;
+};
+
+struct B: public virtual A {
+ #if 0 // this piece of code works around the problem
+ B& operator= (const B& other)
+ {
+ A::operator= (other);
+ }
+ #endif
+};
+
+struct C: public B {
+ char c;
+};
+
+int main() {
+ B b;
+ b.a = 'b';
+ C c;
+ c.a = c.c = 'c';
+
+ c.B::operator= (b);
+ if (c.a != 'b' || c.c != 'c')
+ return 1;
+}
diff --git a/gcc/testsuite/g++.dg/init/bitfield2.C b/gcc/testsuite/g++.dg/init/bitfield2.C
new file mode 100644
index 00000000000..e54b2e423fb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/bitfield2.C
@@ -0,0 +1,33 @@
+// PR c++/13371
+// Bug: We were failing to properly protect the lhs on the line marked
+// "here" from multiple evaluation.
+
+// { dg-do run }
+
+extern "C" int printf (const char *, ...);
+
+enum E { E1, E2 };
+
+struct A
+{
+ E e : 8;
+ unsigned char c;
+};
+
+A ar[2];
+
+int c;
+
+int f()
+{
+ ++c;
+ printf ("f()\n");
+ return 0;
+}
+
+int main()
+{
+ ar[0].c = 0xff;
+ ar[f()].e = E1; // here
+ return (c != 1 || ar[0].c != 0xff);
+}
diff --git a/gcc/testsuite/g++.dg/init/cleanup1.C b/gcc/testsuite/g++.dg/init/cleanup1.C
new file mode 100644
index 00000000000..517af15c673
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/cleanup1.C
@@ -0,0 +1,16 @@
+// PR c++/13033
+
+// We failed to treat the for increment expression as a full-expression,
+// which broke gimplification.
+
+struct QDomNode {
+ virtual ~QDomNode();
+ QDomNode nextSibling() const;
+ bool isNull() const;
+};
+
+void processNode(QDomNode n)
+{
+ for (; !n.isNull(); n = n.nextSibling())
+ ;
+}
diff --git a/gcc/testsuite/g++.dg/init/cleanup2.C b/gcc/testsuite/g++.dg/init/cleanup2.C
new file mode 100644
index 00000000000..e62364be15b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/cleanup2.C
@@ -0,0 +1,19 @@
+// PR c++/12526
+
+// We decided that the call to strcmp has no side-effects because strcmp is
+// pure, even though the first argument has side-effects. As a result, we
+// stripped the CLEANUP_POINT_EXPR. Hilarity ensued.
+
+extern "C" int strcmp (const char *, const char *);
+
+struct A {
+ A(int);
+ const char *str();
+ ~A();
+};
+
+void printQueryI()
+{
+ if(!strcmp(A(1).str(), "foo"))
+ { }
+}
diff --git a/gcc/testsuite/g++.dg/init/error1.C b/gcc/testsuite/g++.dg/init/error1.C
new file mode 100644
index 00000000000..e930fc75c5e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/error1.C
@@ -0,0 +1,7 @@
+// PR c++/12696
+
+struct A {
+ static float b[10]; // { dg-error "" }
+}
+
+float A::b[] = {1,2,3}; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/init/placement1.C b/gcc/testsuite/g++.dg/init/placement1.C
new file mode 100644
index 00000000000..382fae8ed43
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/placement1.C
@@ -0,0 +1,10 @@
+// PR c++/11266
+// We were expanding the same TARGET_EXPR twice, for placement new and
+// delete.
+
+void* operator new (__SIZE_TYPE__, void*) throw();
+void operator delete (void*, void*) throw();
+
+struct A { A(); };
+
+void foo() { new(new A)A; }
diff --git a/gcc/testsuite/g++.dg/init/placement2.C b/gcc/testsuite/g++.dg/init/placement2.C
new file mode 100644
index 00000000000..7a9d6d082ba
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/placement2.C
@@ -0,0 +1,22 @@
+// Bug: We were calling f() twice, for both the placement new and placement
+// delete calls.
+
+// { dg-do run }
+
+void* operator new (__SIZE_TYPE__ sz, void*) { return operator new (sz); }
+void operator delete (void* p, void*) { operator delete (p); }
+
+struct A { A() { throw 1; } };
+
+int c;
+void *f() { ++c; return 0; }
+
+int main()
+{
+ try
+ {
+ new (f()) A;
+ }
+ catch (...) {}
+ return c != 1;
+}
diff --git a/gcc/testsuite/g++.dg/init/pm3.C b/gcc/testsuite/g++.dg/init/pm3.C
new file mode 100644
index 00000000000..980790db346
--- /dev/null
+++ b/gcc/testsuite/g++.dg/init/pm3.C
@@ -0,0 +1,10 @@
+// PR c++/12218
+// { dg-do run }
+
+struct C { int i, j; };
+typedef int C::*mPtr;
+extern const mPtr should_be_0 = &C::i;
+extern const mPtr should_be_4 = &C::j;
+
+int main () {
+}
diff --git a/gcc/testsuite/g++.dg/lookup/java1.C b/gcc/testsuite/g++.dg/lookup/java1.C
new file mode 100644
index 00000000000..4b740085afb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/java1.C
@@ -0,0 +1,68 @@
+// { dg-do compile }
+// { dg-options "-fdollars-in-identifiers" }
+// Origin: Giovanni Bajo <giovannibajo at libero dot it>
+// Make sure that Java special functions can be called correctly.
+
+extern "Java"
+{
+ typedef __java_int jint;
+ namespace java
+ {
+ namespace lang
+ {
+ class Class;
+ class Object;
+ class Throwable {};
+ class Foo;
+ }
+ }
+}
+
+typedef struct java::lang::Object* jobject;
+typedef struct java::lang::Throwable* jthrowable;
+typedef class java::lang::Class* jclass;
+using java::lang::Foo;
+
+class Foo : public java::lang::Throwable
+{
+public:
+ static ::java::lang::Class class$;
+};
+
+
+/*
+ * Step 1: no declarations. A declaration for _Jv_Throw is created.
+ */
+
+void Bar1(void)
+{
+ Foo* f = new java::lang::Foo; // { dg-error "call to Java constructor" }
+ throw (f);
+}
+
+
+/*
+ * Step 2: constructor declaration
+ */
+
+extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
+
+void Bar2(void)
+{
+ Foo* f = new java::lang::Foo;
+ throw (f);
+}
+
+
+/*
+ * Step 3: overloads
+ */
+
+jobject _Jv_AllocObject (jclass, jint, float) __attribute__((__malloc__));
+void _Jv_Throw (int, float) __attribute__ ((__noreturn__));
+
+void Bar3(void)
+{
+ Foo* f = new java::lang::Foo; // { dg-error "should never be overloaded" }
+ throw (f); // { dg-error "should never be overloaded" }
+}
diff --git a/gcc/testsuite/g++.dg/lookup/java2.C b/gcc/testsuite/g++.dg/lookup/java2.C
new file mode 100644
index 00000000000..a779bf64dd9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/java2.C
@@ -0,0 +1,47 @@
+// { dg-do compile }
+// { dg-options "-fdollars-in-identifiers" }
+// Origin: Giovanni Bajo <giovannibajo at libero dot it>
+// Make sure that Java special functions can be called correctly.
+// (continue from java1.C)
+
+extern "Java"
+{
+ typedef __java_int jint;
+ namespace java
+ {
+ namespace lang
+ {
+ class Class;
+ class Object;
+ class Throwable {};
+ class Foo;
+ }
+ }
+}
+
+typedef struct java::lang::Object* jobject;
+typedef struct java::lang::Throwable* jthrowable;
+typedef class java::lang::Class* jclass;
+using java::lang::Foo;
+
+class Foo : public java::lang::Throwable
+{
+public:
+ static ::java::lang::Class class$;
+};
+
+/*
+ * Step 4: Manual declaration of _Jv_Throw
+ * This is the last case we need to test. In the other file we're testing
+ * the compiler is able to generate an artifical declaration for this
+ * function, so we need to test here if it works with a normal declaration.
+ */
+
+extern "C" jobject _Jv_AllocObject (jclass, jint) __attribute__((__malloc__));
+extern "C" void _Jv_Throw (jthrowable) __attribute__ ((__noreturn__));
+
+void Bar4(void)
+{
+ Foo* f = new java::lang::Foo;
+ throw (f);
+}
diff --git a/gcc/testsuite/g++.dg/lookup/ns1.C b/gcc/testsuite/g++.dg/lookup/ns1.C
new file mode 100644
index 00000000000..feeaf751cad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/ns1.C
@@ -0,0 +1,22 @@
+// PR c++/12862
+
+typedef int Thingo;
+
+namespace A
+{
+ void
+ Thingo();
+}
+
+void
+A::Thingo()
+{
+ ;
+}
+
+int
+main()
+{
+ A::Thingo();
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/lookup/used-before-declaration.C b/gcc/testsuite/g++.dg/lookup/used-before-declaration.C
new file mode 100644
index 00000000000..c1469ead01f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/used-before-declaration.C
@@ -0,0 +1,5 @@
+// Copyroght (C) 2003 Free Software Foundation
+// Origin: PR/12832, Jonathan Wakely <redi@gcc.gnu.org>
+
+void f() { g(); } // { dg-error "undeclared" "" }
+void g() { } // { dg-error "used" "" }
diff --git a/gcc/testsuite/g++.dg/lookup/using5.C b/gcc/testsuite/g++.dg/lookup/using5.C
index 8aab55b84cb..b443b97742f 100644
--- a/gcc/testsuite/g++.dg/lookup/using5.C
+++ b/gcc/testsuite/g++.dg/lookup/using5.C
@@ -13,5 +13,5 @@ template <typename> struct A
template <typename T> struct B : A<T>
{
- using X::foo; // { dg-error "not a class-name|nested-name-specifier|non-member" }
+ using X::foo; // { dg-error "declared|nested-name-specifier|non-member" }
};
diff --git a/gcc/testsuite/g++.dg/lookup/using9.C b/gcc/testsuite/g++.dg/lookup/using9.C
new file mode 100644
index 00000000000..c62267519b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/lookup/using9.C
@@ -0,0 +1,30 @@
+// { dg-do compile }
+// Origin: C++ Standard Draft (7.3.3/12)
+// PR c++/2294: using declarations should not conflict, but only cause
+// an ambiguous overload set to be created.
+
+namespace B {
+ void f(int); // { dg-error "note" }
+ void f(double); // { dg-error "note" }
+}
+
+namespace C {
+ void f(int); // { dg-error "note" }
+ void f(double); // { dg-error "note" }
+ void f(char); // { dg-error "note" }
+}
+
+void h()
+{
+ using B::f;
+ using C::f;
+ f('h');
+ f(1); // { dg-error "ambiguous" }
+ void f(int); // { dg-error "previous using declaration" }
+}
+
+void m()
+{
+ void f(int);
+ using B::f; // { dg-error "already declared" }
+}
diff --git a/gcc/testsuite/g++.dg/opt/const3.C b/gcc/testsuite/g++.dg/opt/const3.C
new file mode 100644
index 00000000000..a3539ab15c8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/const3.C
@@ -0,0 +1,44 @@
+// PR optimization/12926
+// This failed on SPARC64 because the assignments to the bit-fields
+// were wrongly swapped in the constructor.
+
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern void abort(void);
+
+typedef __SIZE_TYPE__ size_t;
+
+void *my_out;
+
+struct A
+{
+ enum Type {P, U, S};
+
+ int foo1(void *, const char *);
+ int foo2(int, const Type);
+
+ A (const size_t size, const Type type): mSize(size), mType(type)
+ {
+ foo2(foo1(my_out, "type = "), type);
+ foo2(foo1(my_out, "mType = "), mType);
+ }
+
+ const size_t mSize : 8*sizeof(size_t) - 3;
+ Type mType : 2;
+};
+
+int i;
+
+int A::foo1(void *ios, const char *str) { }
+int A::foo2(int v, const Type t) { i=0; }
+
+int main()
+{
+ A testa(2, A::S);
+
+ if (testa.mType != A::S)
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/g++.dg/opt/expect1.C b/gcc/testsuite/g++.dg/opt/expect1.C
new file mode 100644
index 00000000000..90a871f377a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/expect1.C
@@ -0,0 +1,17 @@
+// PR c++/13239
+// { dg-do run }
+// { dg-options "-O2" }
+
+extern "C" void abort (void);
+
+struct Y {
+ int i;
+};
+
+bool foo () { return true; }
+Y bar () { Y y = {0}; return y; }
+
+int main ()
+{
+ __builtin_expect (foo () && (bar ().i) == 0, 0) ? 0 : (abort (), 1);
+}
diff --git a/gcc/testsuite/g++.dg/opt/inline6.C b/gcc/testsuite/g++.dg/opt/inline6.C
new file mode 100644
index 00000000000..21872210558
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/inline6.C
@@ -0,0 +1,14 @@
+// PR c++/13081
+// { dg-options "-O2" }
+// { dg-final { scan-assembler-not "foo" } }
+
+template<typename T> T foo(T);
+
+template<typename T> inline T foo(T t)
+{
+ return t;
+}
+
+void bar (long& l) {
+ l = foo(l);
+}
diff --git a/gcc/testsuite/g++.dg/opt/noreturn-1.C b/gcc/testsuite/g++.dg/opt/noreturn-1.C
new file mode 100644
index 00000000000..9b2fc0cf16a
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/noreturn-1.C
@@ -0,0 +1,87 @@
+// PR optimization/12965
+// Origin: <qboosh@pld-linux.org>
+// Reduced testcase: Falk Hueffner <falk@debian.org>
+
+// This ICEd on Alpha because the reload pass emitted save/restore
+// insns around a no-return call.
+
+// { dg-do compile }
+// { dg-options "-O2" }
+
+template <typename _Alloc> class allocator;
+template <class _CharT> struct char_traits;
+template <typename _CharT,
+ typename _Traits = char_traits<_CharT>,
+ typename _Alloc = allocator<_CharT> >
+class basic_string;
+typedef basic_string<char> string;
+
+static inline int __exchange_and_add(volatile int * __mem, int __val) {
+ int __result;
+ asm("" : "=&r"(__result));
+ return __result;
+}
+
+template<typename _Tp> struct allocator {
+ allocator() throw() { }
+ allocator(const allocator &) throw() {}
+};
+
+template<typename _CharT, typename _Traits, typename _Alloc>
+struct basic_string {
+ typedef _Alloc allocator_type;
+ struct _Rep {
+ int _M_references;
+ void _M_dispose(const _Alloc & __a) {
+ if (__exchange_and_add(&_M_references, -1) <= 0)
+ _M_destroy(__a);
+ } void _M_destroy(const _Alloc &) throw();
+ };
+ struct _Alloc_hider : _Alloc {
+ _CharT *_M_p;
+ };
+ mutable _Alloc_hider _M_dataplus;
+ _CharT *_M_data() const { return _M_dataplus._M_p; }
+ _Rep *_M_rep() const {
+ return &((reinterpret_cast<_Rep *>(_M_data()))[-1]);
+ }
+ basic_string();
+ basic_string(const _CharT * __s, const _Alloc & __a = _Alloc());
+ ~basic_string() {
+ _M_rep()->_M_dispose(this->get_allocator());
+ }
+ allocator_type get_allocator() const { return _M_dataplus; }
+};
+
+struct Egeneric {
+ void stack(const string & passage, const string & message = "") { }
+};
+
+struct infinint {
+ void detruit() throw(Egeneric);
+ template<class T> void infinint_from(T a) throw(Egeneric);
+ infinint(long a = 0) throw(Egeneric) {
+ try {
+ infinint_from(a);
+ } catch(Egeneric& e) {
+ e.stack("infinint::infinint", "long");
+ }
+ }
+ ~infinint() throw(Egeneric) {
+ try {
+ detruit();
+ } catch(Egeneric& e) { }
+ }
+};
+
+struct inode {
+ string x;
+ infinint a, c;
+ infinint ea_offset;
+ inode();
+};
+
+inode::inode()
+{
+ ea_offset = 0;
+}
diff --git a/gcc/testsuite/g++.dg/opt/reg-stack4.C b/gcc/testsuite/g++.dg/opt/reg-stack4.C
new file mode 100644
index 00000000000..7b461d8a6f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/reg-stack4.C
@@ -0,0 +1,29 @@
+// PR target/12900
+// Origin: <snyder@fnal.gov>
+
+// This used to fail on x86 because the reg-stack pass
+// deleted a valid edge.
+
+// { dg-do compile }
+// { dg-options "-mtune=i586 -O2" { target i?86-*-* } }
+
+struct array {
+ double data;
+ virtual ~array();
+};
+
+double glob;
+double ext1(double);
+int nmuons;
+
+void track_match()
+{
+ array vecdca;
+ if (glob < 10) return;
+ double p = glob*5;
+ double phi = vecdca.data;
+ ext1 (vecdca.data-glob);
+ ext1 (phi*2);
+ if (1 < p)
+ ++nmuons;
+}
diff --git a/gcc/testsuite/g++.dg/other/error2.C b/gcc/testsuite/g++.dg/other/error2.C
index 391115ddc6d..ea6c5203ecb 100644
--- a/gcc/testsuite/g++.dg/other/error2.C
+++ b/gcc/testsuite/g++.dg/other/error2.C
@@ -10,5 +10,5 @@ namespace N
class B { friend void operator>>(int, class B); };
class N { friend void operator>>(int,class N); };
}
-void N::operator>>(int, N::B) // { dg-error "`B' is not a member of|non-function|primary-expression" "" }
+void N::operator>>(int, N::B) // { dg-error "N::N::B" }
{ } // { dg-error "" "" }
diff --git a/gcc/testsuite/g++.dg/other/java1.C b/gcc/testsuite/g++.dg/other/java1.C
new file mode 100644
index 00000000000..38b5e0c3070
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/java1.C
@@ -0,0 +1,22 @@
+// { dg-options "-w -ansi -pedantic" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 23 Oct 2003 <nathan@codesourcery.com>
+
+extern "Java" {
+ class One
+ {
+ ~One (); // { dg-error "cannot have a destructor" "" }
+ One ();
+ };
+
+ class Two {};
+
+ class Three : One {}; // { dg-error "cannot have an implicit" "" }
+
+ class Four : Two {};
+
+ class Five : Two, Four {}; // { dg-error "cannot have multiple bases" "" }
+
+ class Six : virtual Two {}; // { dg-error "cannot have virtual base" "" }
+}
diff --git a/gcc/testsuite/g++.dg/other/offsetof2.C b/gcc/testsuite/g++.dg/other/offsetof2.C
index 64b4fbdc84d..3ab63981d9b 100644
--- a/gcc/testsuite/g++.dg/other/offsetof2.C
+++ b/gcc/testsuite/g++.dg/other/offsetof2.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail *-*-* } }
+// { dg-do run }
// { dg-options -Wold-style-cast }
// Copyright (C) 2003 Free Software Foundation, Inc.
@@ -6,8 +6,6 @@
// DR273 POD can have an operator&, offsetof is still required to work
-// XFAILED - you can't write offsetof without an extension
-
#include <stddef.h>
struct POD1
diff --git a/gcc/testsuite/g++.dg/other/stdarg2.C b/gcc/testsuite/g++.dg/other/stdarg2.C
new file mode 100644
index 00000000000..99e904013f1
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/stdarg2.C
@@ -0,0 +1,12 @@
+// PR c++/11929
+// Bug: We were complaining about the call to va_start because o is of
+// non-POD type.
+
+struct s {
+ s(int);
+};
+
+void test(s o, ...) {
+ __builtin_va_list varg;
+ __builtin_va_start(varg, o);
+}
diff --git a/gcc/testsuite/g++.dg/other/struct-va_list.C b/gcc/testsuite/g++.dg/other/struct-va_list.C
new file mode 100644
index 00000000000..769b909ff46
--- /dev/null
+++ b/gcc/testsuite/g++.dg/other/struct-va_list.C
@@ -0,0 +1,8 @@
+// { dg-do compile }
+// PR target/13302
+
+#include <stdarg.h>
+
+struct NumArgState{
+ va_list ap;
+};
diff --git a/gcc/testsuite/g++.dg/parse/crash10.C b/gcc/testsuite/g++.dg/parse/crash10.C
index 3278ecedad3..878139fa0de 100644
--- a/gcc/testsuite/g++.dg/parse/crash10.C
+++ b/gcc/testsuite/g++.dg/parse/crash10.C
@@ -5,8 +5,6 @@
// PR c++ 10953. ICE
-// { dg-error "" "" { target *-*-* } 14 }
-
class
{
typename:: // { dg-error "" "" }
diff --git a/gcc/testsuite/g++.dg/parse/dce1.C b/gcc/testsuite/g++.dg/parse/dce1.C
new file mode 100644
index 00000000000..f4de52257bc
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/dce1.C
@@ -0,0 +1,13 @@
+/* Make sure that dead code isn't eliminated too early, avoiding
+ detection of errors. */
+/* { dg-do compile } */
+
+void foo(void)
+{
+ if (0)
+ break; /* { dg-error "" } */
+ if (1)
+ ;
+ else
+ continue; /* { dg-error "" } */
+}
diff --git a/gcc/testsuite/g++.dg/parse/defarg6.C b/gcc/testsuite/g++.dg/parse/defarg6.C
new file mode 100644
index 00000000000..827b605b77e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/defarg6.C
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+// Origin: Falk Hueffner <falk@debian.org>
+
+// PR c++/13166: ICE default function argument for friend declaration.
+
+namespace sc_dt {
+ class sc_length_param {
+ friend int compare_unsigned(int if_v_signed = 0) {}
+ };
+}
diff --git a/gcc/testsuite/g++.dg/parse/error3.C b/gcc/testsuite/g++.dg/parse/error3.C
new file mode 100644
index 00000000000..a052346d8ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error3.C
@@ -0,0 +1,6 @@
+// PR c++/10779
+
+static void InstantiateConstraint(const float&, unsigned,
+ void(*AddFunction)(const TYPE&,bool&, // { dg-error "" }
+ char*, char*,
+ unsigned*)); // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/error4.C b/gcc/testsuite/g++.dg/parse/error4.C
new file mode 100644
index 00000000000..511209d9ab9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error4.C
@@ -0,0 +1,7 @@
+// PR c++/12160
+
+struct X {
+ virtual void f(int,
+ itn, // { dg-error "declared" }
+ int); // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/error5.C b/gcc/testsuite/g++.dg/parse/error5.C
new file mode 100644
index 00000000000..81356ced1b0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error5.C
@@ -0,0 +1,4 @@
+// PR c++/13269
+
+class Foo { int foo() return 0; } }; // { dg-error "" }
+
diff --git a/gcc/testsuite/g++.dg/parse/error6.C b/gcc/testsuite/g++.dg/parse/error6.C
new file mode 100644
index 00000000000..3a1666995eb
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error6.C
@@ -0,0 +1,6 @@
+// PR c++/10603
+
+int f(int not) { // { dg-error "!" }
+ return 1-not; // { dg-error "" }
+}
+
diff --git a/gcc/testsuite/g++.dg/parse/error7.C b/gcc/testsuite/g++.dg/parse/error7.C
new file mode 100644
index 00000000000..50e7f84dca5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error7.C
@@ -0,0 +1,4 @@
+// PR c++/12827
+
+void f(int x
+ int y); // { dg-error "," }
diff --git a/gcc/testsuite/g++.dg/parse/error8.C b/gcc/testsuite/g++.dg/parse/error8.C
new file mode 100644
index 00000000000..125f2e42c6b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error8.C
@@ -0,0 +1,4 @@
+// PR c++/13438
+
+struct A { friend typename struct B; }; // { dg-error "" }
+
diff --git a/gcc/testsuite/g++.dg/parse/error9.C b/gcc/testsuite/g++.dg/parse/error9.C
new file mode 100644
index 00000000000..aa9109fd22b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/error9.C
@@ -0,0 +1,5 @@
+// PR c++/12613
+// { dg-options "" }
+
+enum { FOO = 1, BAR = 2 };
+int a[] = { FOO: 1, BAR: 2 }; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/parse/explicit1.C b/gcc/testsuite/g++.dg/parse/explicit1.C
new file mode 100644
index 00000000000..ced2adc3dc0
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/explicit1.C
@@ -0,0 +1,11 @@
+// { dg-do compile }
+
+// Origin: stefaandr@hotmail.com
+
+// PR c++/12403: ICE when explicit specialization is not in
+// namespace scope.
+
+struct foo {
+ template<typename T> void bar (T &t) {}
+ template<> void bar<double>(double &t) {} // { dg-error "explicit|non-namespace|member" }
+};
diff --git a/gcc/testsuite/g++.dg/parse/nontype1.C b/gcc/testsuite/g++.dg/parse/nontype1.C
new file mode 100644
index 00000000000..e721700af50
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/nontype1.C
@@ -0,0 +1,9 @@
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+// { dg-do compile }
+
+// PR c++/13289: Incorrectly reject non-type template argument that has
+// dependent type
+
+template <class T, T t> class C {};
+template <class T, T t> class D { C<T, t-1> c; };
diff --git a/gcc/testsuite/g++.dg/parse/offsetof1.C b/gcc/testsuite/g++.dg/parse/offsetof1.C
new file mode 100644
index 00000000000..ae9d3110aba
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/offsetof1.C
@@ -0,0 +1,11 @@
+#include <stddef.h>
+
+template <bool> struct StaticAssert;
+template <> struct StaticAssert<true> {};
+
+struct MyPOD
+{
+ int a; int b; int c;
+};
+
+StaticAssert<(offsetof(MyPOD, a) == 0)> s;
diff --git a/gcc/testsuite/g++.dg/parse/offsetof2.C b/gcc/testsuite/g++.dg/parse/offsetof2.C
new file mode 100644
index 00000000000..4552d39fea2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/offsetof2.C
@@ -0,0 +1,12 @@
+#include <cstddef>
+
+struct choke_me
+{
+ int size;
+ char storage[1];
+};
+
+struct offset_is_broken
+{
+ static const int offset = offsetof(choke_me, storage);
+};
diff --git a/gcc/testsuite/g++.dg/parse/semicolon1.C b/gcc/testsuite/g++.dg/parse/semicolon1.C
new file mode 100644
index 00000000000..22c1e86e2cf
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/semicolon1.C
@@ -0,0 +1,4 @@
+// PR c++/12479
+// { dg-options "-pedantic" }
+
+#include "semicolon1.h"
diff --git a/gcc/testsuite/g++.dg/parse/semicolon1.h b/gcc/testsuite/g++.dg/parse/semicolon1.h
new file mode 100644
index 00000000000..0487fc7838c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/parse/semicolon1.h
@@ -0,0 +1,2 @@
+#pragma GCC system_header
+;
diff --git a/gcc/testsuite/g++.dg/parse/typename5.C b/gcc/testsuite/g++.dg/parse/typename5.C
index 70a2814a44f..6b2ed894a86 100644
--- a/gcc/testsuite/g++.dg/parse/typename5.C
+++ b/gcc/testsuite/g++.dg/parse/typename5.C
@@ -8,5 +8,5 @@ template <typename> struct A {};
template <typename> struct B
{
- typedef A<typename X::Y> C; // { dg-error "not a class-name|invalid|no type" }
+ typedef A<typename X::Y> C; // { dg-error "declared|invalid|no type" }
};
diff --git a/gcc/testsuite/g++.dg/parse/undefined1.C b/gcc/testsuite/g++.dg/parse/undefined1.C
index 324c575b9b0..0ae4e88777c 100644
--- a/gcc/testsuite/g++.dg/parse/undefined1.C
+++ b/gcc/testsuite/g++.dg/parse/undefined1.C
@@ -7,4 +7,4 @@ struct foo
foo(X) {} // { dg-error "" }
foo(X y, int) : x() {} // { dg-error "" }
-}; // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/template/access13.C b/gcc/testsuite/g++.dg/template/access13.C
new file mode 100644
index 00000000000..3a1442bb0e2
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/access13.C
@@ -0,0 +1,16 @@
+// { dg-do compile }
+
+// Origin: Francesco Monica <fmonica@ce.unipr.it>
+
+// PR c++/13262: Access checking during instantiation of static data
+// member.
+
+template <typename T> class Aclass {
+ private:
+ Aclass() {}
+ static Aclass instance;
+};
+
+template <typename T> Aclass<T> Aclass<T>::instance;
+
+template class Aclass<int>;
diff --git a/gcc/testsuite/g++.dg/template/arg2.C b/gcc/testsuite/g++.dg/template/arg2.C
index 5a4ff275cf3..dbed54d2131 100644
--- a/gcc/testsuite/g++.dg/template/arg2.C
+++ b/gcc/testsuite/g++.dg/template/arg2.C
@@ -10,5 +10,5 @@ template <typename T> class X {};
void fn ()
{
class L {};
- X<L> f; // { dg-error "uses local type|trying to instantiate|expected" "" }
+ X<L> f; // { dg-error "uses local type|trying to instantiate|no type" "" }
}
diff --git a/gcc/testsuite/g++.dg/template/array1-1.C b/gcc/testsuite/g++.dg/template/array1-1.C
new file mode 100644
index 00000000000..97fe7cde25d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/array1-1.C
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1" }
+
+// Contributed by Nathan Sidwell 22 Dec 2003 <nathan@codesourcery.com>
+// Origin: Roger Sayle <roger@eyesopen.com>
+
+// PR c++/12774 Array domains compared unequal
+
+void Foo(double r[3][3])
+{
+}
+
+void Baz()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+template <class T>
+void Bar()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+int main()
+{
+ Baz();
+ Bar<int>();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/array1-2.C b/gcc/testsuite/g++.dg/template/array1-2.C
new file mode 100644
index 00000000000..7214517b3c6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/array1-2.C
@@ -0,0 +1,32 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Contributed by Nathan Sidwell 22 Dec 2003 <nathan@codesourcery.com>
+// Origin: Roger Sayle <roger@eyesopen.com>
+
+// PR c++/12774 Array domains compared unequal
+
+void Foo(double r[3][3])
+{
+}
+
+void Baz()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+template <class T>
+void Bar()
+{
+ double m[3][3];
+ Foo(m);
+}
+
+int main()
+{
+ Baz();
+ Bar<int>();
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/array2-1.C b/gcc/testsuite/g++.dg/template/array2-1.C
new file mode 100644
index 00000000000..2980a1fd186
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/array2-1.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=1" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2003 <nathan@codesourcery.com>
+
+// PR c++/13494. ICE
+
+template<typename T>
+int foo(int d[][4])
+{
+ return d[0][0];
+}
+
diff --git a/gcc/testsuite/g++.dg/template/array2-2.C b/gcc/testsuite/g++.dg/template/array2-2.C
new file mode 100644
index 00000000000..dd3e7f0e265
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/array2-2.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// { dg-options "-fabi-version=2" }
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+// Contributed by Nathan Sidwell 29 Dec 2003 <nathan@codesourcery.com>
+
+// PR c++/13494. ICE
+
+template<typename T>
+int foo(int d[][4])
+{
+ return d[0][0];
+}
+
diff --git a/gcc/testsuite/g++.dg/template/crash13.C b/gcc/testsuite/g++.dg/template/crash13.C
index 1d2a1f5dde0..50ec37f2eae 100644
--- a/gcc/testsuite/g++.dg/template/crash13.C
+++ b/gcc/testsuite/g++.dg/template/crash13.C
@@ -10,9 +10,9 @@ template<typename, typename T=void> struct A
};
template <typename T> struct C
-{ // { dg-error "not a base type" }
+{
typedef typename A<T>::B X;
- X::Y;
+ X::Y; // { dg-error "not a base type" }
};
C<void> c; // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/template/crash14.C b/gcc/testsuite/g++.dg/template/crash14.C
new file mode 100644
index 00000000000..7b3af045fa9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash14.C
@@ -0,0 +1,3 @@
+template <int T> class foo { public: foo() { } class Z { };};
+template <int I[2]> void dep7(foo<I[0]> *) { } // { dg-error "" }
+
diff --git a/gcc/testsuite/g++.dg/template/crash15.C b/gcc/testsuite/g++.dg/template/crash15.C
new file mode 100644
index 00000000000..e0aad73c73e
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/crash15.C
@@ -0,0 +1,9 @@
+// PR c++/13310
+
+struct A {};
+
+template <typename> void foo()
+{
+ A a;
+ a.foo<int>(); // { dg-error "" }
+}
diff --git a/gcc/testsuite/g++.dg/template/dependent-expr3.C b/gcc/testsuite/g++.dg/template/dependent-expr3.C
new file mode 100644
index 00000000000..2e8b805ead8
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/dependent-expr3.C
@@ -0,0 +1,14 @@
+// { dg-do compile }
+// Origin: jbrandmeyer at users dot sourceforge dot net
+// PR c++/12573: COMPONENT_REFs must be inspected for dependness.
+
+template <bool> struct S;
+
+template <typename K> struct Y : K {
+ int x;
+};
+
+template <class T> struct Z {
+ S< (bool)(&static_cast<Y<T> *>(0)->x == 0) > // { dg-error "" }
+ s; // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/template/eh1.C b/gcc/testsuite/g++.dg/template/eh1.C
new file mode 100644
index 00000000000..134a0e7a665
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/eh1.C
@@ -0,0 +1,6 @@
+template <class T>
+void foo()
+{
+ try {}
+ catch(T e) {}
+}
diff --git a/gcc/testsuite/g++.dg/template/error10.C b/gcc/testsuite/g++.dg/template/error10.C
new file mode 100644
index 00000000000..a25c4bbddb9
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error10.C
@@ -0,0 +1,70 @@
+// { dg-do compile }
+// Origin: <tilps at hotmail dot com>
+// c++/9154: poor error message for ">>" vs "> >" in template argument list
+
+
+/*
+ * Test that the error message is issued properly
+ */
+template <class T>
+class A {};
+
+A<A<int>> blah; // { dg-error "should be `> >' within" }
+A<int>> blah2; // { dg-error "spurious `>>'" }
+
+
+/*
+ * Test that a few valid constructs containing a ">>" token in a
+ * template argument list are handled correctly.
+ */
+template <int N>
+void B(void) {}
+
+int Btest()
+{
+ B<256 >> 4>();
+}
+
+template <int N = 123>>4>
+struct C {};
+
+template <int> struct D {};
+template <typename> struct E {};
+
+E<D< 1>>2 > > E1;
+
+const int x = 0;
+E<D< 1>>x > > E2;
+
+template <int> struct F {
+ typedef int I;
+};
+
+template <typename T = F< 1>>2 >::I>
+struct G {};
+
+/*
+ * In this special case, a valid type-id (H() is a function type) is followed
+ * by '>>', but the argument should still be parsed as an expression, which
+ * will then be rejected as non-constant expression.
+ */
+struct H
+{
+ int operator >>(int);
+};
+
+template <int V> struct L {};
+L<H() >> 5> l; // { dg-error "" "non-constant" }
+
+
+/*
+ * This case used to not emit the nice error message because of a typo
+ * in the code.
+ */
+template <void (*)(void)>
+struct K {};
+
+void KFunc(void);
+
+A<K<&KFunc>> k1; // { dg-error "should be `> >' within" }
+K<&KFunc>> k2; // { dg-error "spurious `>>'" }
diff --git a/gcc/testsuite/g++.dg/template/error3.C b/gcc/testsuite/g++.dg/template/error3.C
new file mode 100644
index 00000000000..d3ee5990850
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error3.C
@@ -0,0 +1,5 @@
+// PR 12762
+
+template <typename> struct A { A() {}};
+typedef A<int> Ac;
+Ac<double> a; // { dg-error "template" }
diff --git a/gcc/testsuite/g++.dg/template/error4.C b/gcc/testsuite/g++.dg/template/error4.C
new file mode 100644
index 00000000000..a3196ee8e77
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error4.C
@@ -0,0 +1,8 @@
+template<class T> struct C1
+{
+ template<class U> struct C2
+ { class Type { }; };
+};
+
+template<class T, class U>
+void foo(typename C1<T>::C2<U>::Type *) { } // { dg-error "template" }
diff --git a/gcc/testsuite/g++.dg/template/error5.C b/gcc/testsuite/g++.dg/template/error5.C
new file mode 100644
index 00000000000..0c793509da4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error5.C
@@ -0,0 +1,6 @@
+template <typename T>
+struct X<T*> { // { dg-error "not a template" }
+ typedef int Y;
+};
+
+extern struct Z<int> s; // { dg-error "not a template" }
diff --git a/gcc/testsuite/g++.dg/template/error6.C b/gcc/testsuite/g++.dg/template/error6.C
new file mode 100644
index 00000000000..7560dcfb51f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error6.C
@@ -0,0 +1,13 @@
+template<int n>
+struct tento {
+ enum {value = 10*tento<n-1>::value};
+};
+
+struct tento<0> { // { dg-error "" }
+ enum {value=1};
+};
+
+int main() {
+ if (tento<4>::value != 10000) return -1;
+}
+
diff --git a/gcc/testsuite/g++.dg/template/error7.C b/gcc/testsuite/g++.dg/template/error7.C
new file mode 100644
index 00000000000..3c1a0e1f21b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error7.C
@@ -0,0 +1,6 @@
+// PR c++/13314
+// { dg-options "-O2" }
+
+struct A { template <int> struct B; };
+struct A::B {}; // { dg-error "" }
+A::B<0> b; // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/error8.C b/gcc/testsuite/g++.dg/template/error8.C
new file mode 100644
index 00000000000..30872a2e953
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error8.C
@@ -0,0 +1,7 @@
+// PR c++/11116
+
+template <typename T> struct S {};
+
+void f() {
+ throw S (); // { dg-error "template" }
+}
diff --git a/gcc/testsuite/g++.dg/template/error9.C b/gcc/testsuite/g++.dg/template/error9.C
new file mode 100644
index 00000000000..60f550a7ca6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/error9.C
@@ -0,0 +1,7 @@
+// PR c++/10926
+
+struct Foo
+{
+ template <int i>
+ ~Foo(); // { dg-error "" }
+};
diff --git a/gcc/testsuite/g++.dg/template/instantiate5.C b/gcc/testsuite/g++.dg/template/instantiate5.C
new file mode 100644
index 00000000000..8d076356294
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/instantiate5.C
@@ -0,0 +1,24 @@
+// { dg-do compile }
+
+// Origin: Volker Reichelt <reichelt@gcc.gnu.org>
+
+// PR c++/11616: Incorrect line number in diagnostics
+
+template <int> struct A
+{
+ static const int i=0;
+};
+
+int baz() { return A<0>::i; }
+
+struct B
+{
+ static void foo (int); // { dg-error "candidates" }
+};
+
+template <typename T> struct C
+{
+ virtual void bar() const { T::foo(); } // { dg-error "no matching function" }
+};
+
+C<B> c; // { dg-error "instantiated" }
diff --git a/gcc/testsuite/g++.dg/template/lookup3.C b/gcc/testsuite/g++.dg/template/lookup3.C
new file mode 100644
index 00000000000..c96a0b0b981
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/lookup3.C
@@ -0,0 +1,16 @@
+// PR c++/12397
+
+struct foo { };
+
+template <typename T> struct bar
+{
+ bar(){}
+ int i;
+ bar (const bar<T>& foo) : i (foo.i) {}
+};
+
+int main()
+{
+ bar<int> b1;
+ bar<int> b2(b1);
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend1.C b/gcc/testsuite/g++.dg/template/memfriend1.C
new file mode 100644
index 00000000000..f4541279c8b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend1.C
@@ -0,0 +1,54 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function of class template as friend
+
+template<class T> struct A
+{
+ void f();
+};
+
+class C {
+ int i;
+ template<class T> friend void A<T>::f();
+};
+
+template<class T> struct A<T*>
+{
+ void f();
+};
+
+template<> struct A<char>
+{
+ void f();
+};
+
+template<class T> void A<T>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template<class T> void A<T*>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+void A<char>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A<int> a1;
+ a1.f();
+ A<int *> a2;
+ a2.f();
+ A<char> a3;
+ a3.f();
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend2.C b/gcc/testsuite/g++.dg/template/memfriend2.C
new file mode 100644
index 00000000000..364ad7d7864
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend2.C
@@ -0,0 +1,61 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function template of class template as friend
+
+template <class T> struct A
+{
+ template <class U> void f();
+};
+
+class C {
+ int i;
+ template <class T> template <class U> friend void A<T>::f();
+};
+
+template <class T> struct A<T*>
+{
+ template <class U> void f();
+};
+
+template <> struct A<char>
+{
+ template <class U> void f();
+};
+
+template <class T> template <class U> void A<T>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <class T> template <class U> void A<T*>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <class U> void A<char>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A<char>::f<int>()
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A<int> a1;
+ a1.f<char>();
+ A<int *> a2;
+ a2.f<char>();
+ A<char> a3;
+ a3.f<char>();
+ a3.f<int>();
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend3.C b/gcc/testsuite/g++.dg/template/memfriend3.C
new file mode 100644
index 00000000000..3ea8c84cf25
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend3.C
@@ -0,0 +1,55 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function of class template as friend
+
+template<class T> struct A
+{
+ void f(T);
+};
+
+class C {
+ int i;
+ template<class T> friend void A<T>::f(T);
+};
+
+template<class T> struct A<T*>
+{
+ void f(T*);
+};
+
+template<> struct A<char>
+{
+ void f(char);
+};
+
+template<class T> void A<T>::f(T)
+{
+ C c;
+ c.i = 0;
+}
+
+template<class T> void A<T*>::f(T*)
+{
+ C c;
+ c.i = 0;
+}
+
+void A<char>::f(char)
+{
+ C c;
+ c.i = 0;
+}
+
+int main()
+{
+ A<int> a1;
+ a1.f(0);
+ A<int *> a2;
+ int *p = 0;
+ a2.f(p);
+ A<char> a3;
+ a3.f('a');
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend4.C b/gcc/testsuite/g++.dg/template/memfriend4.C
new file mode 100644
index 00000000000..5c006fe84f3
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend4.C
@@ -0,0 +1,63 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function of class template as friend
+
+template<class T> struct A
+{
+ template <T t> void f();
+};
+
+class C {
+ int i;
+ template<class T> template <T t> friend void A<T>::f();
+};
+
+template<class T> struct A<T*>
+{
+ template <T* t> void f();
+};
+
+template<> struct A<char>
+{
+ template <char t> void f();
+};
+
+template<class T> template <T t> void A<T>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template<class T> template <T* t> void A<T*>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <char t> void A<char>::f()
+{
+ C c;
+ c.i = 0;
+}
+
+template <> void A<char>::f<'b'>()
+{
+ C c;
+ c.i = 0;
+}
+
+int d2 = 0;
+
+int main()
+{
+ A<int> a1;
+ a1.f<0>();
+ A<int *> a2;
+ a2.f<&d2>();
+ A<char> a3;
+ a3.f<'a'>();
+ a3.f<'b'>();
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend5.C b/gcc/testsuite/g++.dg/template/memfriend5.C
new file mode 100644
index 00000000000..38c2fb93fad
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend5.C
@@ -0,0 +1,31 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member template function of member class template as friend
+
+template <class T> struct A {
+ template <class U> struct B {
+ template <class V> void f(V);
+ };
+};
+
+class X {
+ int i;
+ template <class T> template <class U> template <class V>
+ friend void A<T>::B<U>::f(V);
+};
+
+template <class T> template <class U> template <class V>
+ void A<T>::B<U>::f(V)
+{
+ X x;
+ x.i = 0;
+}
+
+int main()
+{
+ A<char>::B<char> a1;
+ a1.f(0);
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend6.C b/gcc/testsuite/g++.dg/template/memfriend6.C
new file mode 100644
index 00000000000..21d799605ec
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend6.C
@@ -0,0 +1,23 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function of class template as friend
+// Erroneous case: mismatch during declaration
+
+template <class T> struct A {
+ template <class U> void f(U); // { dg-error "candidate" }
+ void g(); // { dg-error "candidate" }
+ void h(); // { dg-error "candidate" }
+ void i(int); // { dg-error "candidate" }
+};
+
+class C {
+ int ii;
+ template <class U> friend void A<U>::f(U); // { dg-error "not match" }
+ template <class U> template <class V>
+ friend void A<U>::g(); // { dg-error "not match" }
+ template <class U> friend int A<U>::h(); // { dg-error "not match" }
+ template <class U> friend void A<U>::i(char); // { dg-error "not match" }
+};
diff --git a/gcc/testsuite/g++.dg/template/memfriend7.C b/gcc/testsuite/g++.dg/template/memfriend7.C
new file mode 100644
index 00000000000..aed029500af
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend7.C
@@ -0,0 +1,133 @@
+// { dg-do compile }
+
+// Copyright (C) 2003 Free Software Foundation
+// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
+
+// Member function of class template as friend
+// Erroneous case: mismatch during specialization
+
+template <class T> struct A {
+ template <class U> void f(U);
+ void g();
+ void h();
+ void i(int);
+ template <T t> void j();
+};
+
+class C {
+ int ii; // { dg-error "private" }
+ template <class U> template <class V>
+ friend void A<U>::f(V);
+ template <class U> friend void A<U>::g();
+ template <class U> friend void A<U>::h();
+ template <class U> friend void A<U>::i(int);
+ template <class U> template <U t>
+ friend void A<U>::j();
+};
+
+template <class T> struct A<T*> {
+ void f(int);
+ template <class U> void g();
+ int h();
+ void i(char);
+ template <int> void j();
+};
+
+template <class T> void A<T*>::f(int)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <class T> template <class U> void A<T*>::g()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <class T> int A<T*>::h()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <class T> void A<T*>::i(char)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <class T> template <int> void A<T*>::j()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> struct A<char> {
+ void f(int);
+ template <class U> void g();
+ int h();
+ void i(char);
+ template <int> void j();
+};
+
+void A<char>::f(int)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <class U> void A<char>::g()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> void A<char>::g<int>()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+int A<char>::h()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+void A<char>::i(char)
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <int> void A<char>::j()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+template <> void A<char>::j<0>()
+{
+ C c;
+ c.ii = 0; // { dg-error "context" }
+}
+
+int main()
+{
+ A<int *> a1;
+ a1.f(0); // { dg-error "instantiated" }
+ a1.g<char>(); // { dg-error "instantiated" }
+ a1.g<int>(); // { dg-error "instantiated" }
+ a1.h(); // { dg-error "instantiated" }
+ a1.i('a'); // { dg-error "instantiated" }
+ a1.j<1>(); // { dg-error "instantiated" }
+ A<char> a2;
+ a2.f(0);
+ a2.g<char>(); // { dg-error "instantiated" }
+ a2.g<int>();
+ a2.h();
+ a2.i('a');
+ a2.j<1>(); // { dg-error "instantiated" }
+ a2.j<0>();
+}
diff --git a/gcc/testsuite/g++.dg/template/memfriend8.C b/gcc/testsuite/g++.dg/template/memfriend8.C
new file mode 100644
index 00000000000..886096b9d54
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/memfriend8.C
@@ -0,0 +1,25 @@
+// { dg-do compile }
+
+// Origin: Martin Sebor <sebor@roguewave.com>
+
+// PR c++/5369: Member function of class template as friend
+
+template <class T>
+struct S
+{
+ int foo () {
+ return S<int>::bar ();
+ }
+
+private:
+
+ template <class U>
+ friend int S<U>::foo ();
+
+ static int bar () { return 0; }
+};
+
+int main ()
+{
+ S<char>().foo ();
+}
diff --git a/gcc/testsuite/g++.dg/template/nested3.C b/gcc/testsuite/g++.dg/template/nested3.C
index 1c45d645290..0094783166a 100644
--- a/gcc/testsuite/g++.dg/template/nested3.C
+++ b/gcc/testsuite/g++.dg/template/nested3.C
@@ -5,13 +5,13 @@ class A {
int _k;
};
T1 _t1;
- T2 _t2;
+ T2 _t2; // { dg-error "instantiated" }
};
template <class U>
-class B {
+class B { // { dg-error "" }
class SubB1 {
- B _i;
+ B _i; // { dg-error "" }
};
class SubB2 {
@@ -22,7 +22,7 @@ class B {
int main() {
- B<char> objB;
+ B<char> objB; // { dg-error "instantiated" }
return 0;
}
diff --git a/gcc/testsuite/g++.dg/template/nontype3.C b/gcc/testsuite/g++.dg/template/nontype3.C
new file mode 100644
index 00000000000..15a204fa6e4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/nontype3.C
@@ -0,0 +1,37 @@
+// { dg-do compile }
+// Origin: <drow at gcc dot gnu dot org>,
+// <giovannibajo at gcc dot gnu dot org>
+// c++/13243: Template parameters of non integral or enumeration type can't be
+// used for integral constant expressions. ADDR_EXPR and INDIRECT_REF are
+// invalid too.
+
+template <int T> class foo {};
+template <int *T> class bar {};
+
+template <int *PI>
+void dep5(bar<PI> *);
+
+template <int *PI>
+void dep6(bar<PI+1> *); // { dg-error "" "integral or enumeration" }
+
+template <int I>
+void dep7(bar<I+1> *);
+
+template <int *PI>
+void dep8(foo< *PI > *); // { dg-error "" "integral or enumeration" }
+
+template <int PI[1]>
+void dep9(foo< *PI > *); // { dg-error "" "integral or enumeration" }
+
+template <int PI[1]>
+void dep9a(foo< sizeof(*PI) > *);
+
+template <int PI[1]>
+void dep10(foo< PI[0] > *); // { dg-error "" "integral or enumeration" }
+
+template <int I>
+void dep11(foo< *&I > *); // { dg-error "" "constant-expression" }
+
+template <int I>
+void dep12(foo< (&I)[4] > *); // { dg-error "" "constant-expression" }
+
diff --git a/gcc/testsuite/g++.dg/template/ptrmem7.C b/gcc/testsuite/g++.dg/template/ptrmem7.C
new file mode 100644
index 00000000000..cd907f21264
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem7.C
@@ -0,0 +1,29 @@
+// { dg-do compile }
+// Origin: <togawa at acm dot arg>
+// c++/2094: unsupported 'ptrmem_cst' in type unification
+
+struct R
+{
+ int i;
+};
+
+struct S
+{
+ int i;
+ int j;
+};
+
+struct S2 : S
+{};
+
+template<int S::*p, typename>
+struct X
+{
+ X ();
+ template<typename U> X(const X<p,U> &);
+};
+
+X<&S::i,S> x = X<&S::i,S>();
+X<&S::i,S> x2 = X<&S2::i,S>();
+X<&S::i,S> y = X<&S::j,S>(); // { dg-error "" }
+X<&S::i,S> z = X<&R::i,S>(); // { dg-error "" }
diff --git a/gcc/testsuite/g++.dg/template/ptrmem8.C b/gcc/testsuite/g++.dg/template/ptrmem8.C
new file mode 100644
index 00000000000..c0a1fa3a1ca
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/ptrmem8.C
@@ -0,0 +1,20 @@
+// { dg-do compile }
+// Origin: <marco dot franzen at bigfoot dot com>
+// PR c++/10126: Handle ptmf default conversions while matching a template
+// argument
+
+struct B
+{
+ int I () const;
+ int I ();
+};
+
+struct D : B {};
+
+template <int (D::*fun)() const> int Get();
+
+int main ()
+{
+ Get<&B::I>(); // { dg-error "no matching function" }
+ Get<&D::I>(); // { dg-error "no matching function" }
+}
diff --git a/gcc/testsuite/g++.dg/template/qualttp17.C b/gcc/testsuite/g++.dg/template/qualttp17.C
index 4766c53847d..4d79c9a7653 100644
--- a/gcc/testsuite/g++.dg/template/qualttp17.C
+++ b/gcc/testsuite/g++.dg/template/qualttp17.C
@@ -1,7 +1,7 @@
// Copyright (C) 2001 Free Software Foundation
// Contributed by Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
// { dg-do compile }
-// { dg-options "-fno-inline" }
+// { dg-options "-fno-inline -fabi-version=1" }
struct A
{
diff --git a/gcc/testsuite/g++.dg/template/recurse1.C b/gcc/testsuite/g++.dg/template/recurse1.C
new file mode 100644
index 00000000000..4789983affe
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/recurse1.C
@@ -0,0 +1,16 @@
+// PR c++/5050
+// Origin: georg.wild@gmx.de
+// Reduced by: tbagot@bluearc.com and Nathanael C. Nerode <neroden@twcny.rr.com>
+// Test for that excessive template recursion does not occur
+// because of optimization.
+// { dg-options "-ftemplate-depth-1 -O" }
+
+ struct ostream {
+ template<class T> ostream& foo( const T & )
+ { return *this; }
+ };
+
+ void foo() {
+ ostream os;
+ (os.foo(1)).foo(2);
+ }
diff --git a/gcc/testsuite/g++.dg/template/static2.C b/gcc/testsuite/g++.dg/template/static2.C
index d18c1a7fb4e..881f07ce95a 100644
--- a/gcc/testsuite/g++.dg/template/static2.C
+++ b/gcc/testsuite/g++.dg/template/static2.C
@@ -4,7 +4,7 @@ template<int A::* P>
class B
{
public:
- static int A::* const p = P; // { dg-error "in-class" }
+ static int A::* const p = P; // { dg-error "" }
};
class A
diff --git a/gcc/testsuite/g++.dg/template/static5.C b/gcc/testsuite/g++.dg/template/static5.C
new file mode 100644
index 00000000000..05eaf8fbd55
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/static5.C
@@ -0,0 +1,17 @@
+// { dg-do compile }
+
+// Origin: Mirek Fidler <cxl@ntllib.org>
+// Wolfgang Bangerth <bangerth@ticam.utexas.edu>
+
+// PR c++/12932: ICE address of static function as template argument
+
+struct Test {
+ static void fun();
+};
+
+template <void (*fun)()>
+void foo () { (*fun)(); }
+
+
+template
+void foo<Test::fun> ();
diff --git a/gcc/testsuite/g++.dg/template/template-id-2.C b/gcc/testsuite/g++.dg/template/template-id-2.C
new file mode 100644
index 00000000000..1bc378c14e6
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/template-id-2.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Richard Guenther <rguenth@tat.physik.uni-tuebingen.de>
+
+// PR c++/12924
+
+template<typename> struct A {};
+
+template<> struct A<void>
+{
+ template<typename T> void foo()
+ {
+ A<T> a;
+ a.template foo<int>(); // { dg-error "no member" }
+ }
+};
+
+void bar()
+{
+ A<void> a;
+ a.foo<int>(); // { dg-error "instantiated" }
+}
diff --git a/gcc/testsuite/g++.dg/template/ttp3.C b/gcc/testsuite/g++.dg/template/ttp3.C
index cc3128cfc95..a7f231a7fb0 100644
--- a/gcc/testsuite/g++.dg/template/ttp3.C
+++ b/gcc/testsuite/g++.dg/template/ttp3.C
@@ -23,4 +23,4 @@ class List { };
// This next line should just do a lookup of 'class List', and then
// get a type/value mismatch. Instead we try and push 'class List'
// into the global namespace and get a redeclaration error.
-vector<class List > data; // { dg-error "invalid|required|expected" "" }
+vector<class List > data; // { dg-error "invalid|required|declaration" "" }
diff --git a/gcc/testsuite/g++.dg/template/type1.C b/gcc/testsuite/g++.dg/template/type1.C
index 98a4bd3bf03..b74d975ac49 100644
--- a/gcc/testsuite/g++.dg/template/type1.C
+++ b/gcc/testsuite/g++.dg/template/type1.C
@@ -5,4 +5,4 @@ struct A {
};
int A::B::c; // { dg-error "parameters" }
-int A::C::d; // { dg-error "class" }
+int A::C::d; // { dg-error "declared" }
diff --git a/gcc/testsuite/g++.dg/template/using8.C b/gcc/testsuite/g++.dg/template/using8.C
new file mode 100644
index 00000000000..a79158710f5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/template/using8.C
@@ -0,0 +1,22 @@
+// { dg-do compile }
+
+// Origin: Sergey Shandar <comer@pisem.net>
+
+// PR c++/9810: Access checking for member function template
+// appeared in using declaration.
+
+struct A
+{
+ template<class R> void F(R) {}
+};
+
+struct B: private A
+{
+ using A::F;
+};
+
+int main()
+{
+ B b;
+ b.F(3);
+}
diff --git a/gcc/testsuite/g++.dg/warn/ctor-init-1.C b/gcc/testsuite/g++.dg/warn/ctor-init-1.C
new file mode 100644
index 00000000000..0796972fcb5
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/ctor-init-1.C
@@ -0,0 +1,9 @@
+// PR c++/11554
+// { dg-options "-Wall" }
+
+struct Y {
+ Y ();
+ int i1, i2; // { dg-warning "" }
+};
+
+Y::Y () : i2(0), i1(0) {} // { dg-warning "" }
diff --git a/gcc/testsuite/g++.dg/warn/format3.C b/gcc/testsuite/g++.dg/warn/format3.C
new file mode 100644
index 00000000000..0bdaaee1772
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/format3.C
@@ -0,0 +1,12 @@
+// PR c++/13070
+// { dg-do compile }
+// { dg-options "-Wformat" }
+
+extern "C" int printf (const char*, ...);
+
+int main()
+{
+ printf("%d\n", 1, 1); // { dg-warning "too many" "printf warning" }
+ return 0;
+}
+
diff --git a/gcc/testsuite/g++.dg/warn/noreturn-3.C b/gcc/testsuite/g++.dg/warn/noreturn-3.C
new file mode 100644
index 00000000000..828935c12ee
--- /dev/null
+++ b/gcc/testsuite/g++.dg/warn/noreturn-3.C
@@ -0,0 +1,13 @@
+// { dg-do compile }
+// { dg-options "-Wall" }
+
+// Origin: stip@mathematik.uni-ulm.de
+// Andrew Pinski <pinskia@gcc.gnu.org>
+
+// PR c++/13106: No return warning when return type is a dependent type.
+
+template <typename T> T dummy() { }
+
+int main() {
+ dummy<void>();
+}
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/ns1.C b/gcc/testsuite/g++.old-deja/g++.brendan/ns1.C
index 5e7329075f2..5b6ea386184 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/ns1.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/ns1.C
@@ -12,7 +12,7 @@ class C
};
class D2 : public B
-{ // { dg-error "" } type C is not a base type for type D2
- using B::f; // ok: B is a base of D
- using C::g; // error: C isn't a base of D2
+{
+ using B::f; // ok: B is a base of D2
+ using C::g; // { dg-error "not a base type" }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
index 34eb37b373c..907474e13fa 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/badalloc1.C
@@ -1,5 +1,5 @@
// { dg-do run { xfail xstormy16-*-* *-*-darwin* } }
-// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2002, 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 6 June 2000 <nathan@codesourcery.com>
// Check we can throw a bad_alloc exception when malloc dies.
@@ -14,8 +14,15 @@ extern "C" void *memcpy(void *, const void *, size_t);
#ifdef STACK_SIZE
const int arena_size = 256;
#else
+#ifdef __FreeBSD__
+// FreeBSD with threads requires even more space at initialization time.
+#include "bits/c++config.h"
+#include "bits/gthr.h"
+const int arena_size = 131072;
+#else
const int arena_size = 32768;
#endif
+#endif
struct object
{
@@ -98,6 +105,17 @@ void fn_catchthrow() throw(int)
int main()
{
+#ifdef __FreeBSD__
+// FreeBSD with threads fails the test unless each thread primes itself.
+ if (__gthread_active_p())
+ {
+ try{fn_throw();}
+ catch(int a){}
+ }
+// This was added to test with well-known idiom to detect regressions here
+// rather than always failing with -pthread.
+#endif
+
fail = 1;
try{fn_throw();}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template18.C b/gcc/testsuite/g++.old-deja/g++.jason/template18.C
deleted file mode 100644
index bf293ed2b86..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.jason/template18.C
+++ /dev/null
@@ -1,18 +0,0 @@
-// { dg-do link }
-// { dg-options "-g -fno-inline -Wno-deprecated -fexternal-templates" }
-// GROUPS passed templates
-// Bug: g++ emits template instances when it shouldn't.
-// Suppressed-instantiation tests like this are known to break on
-// Cygwin, because of the MULTIPLE_SYMBOL_SPACES stuff. This is OK.
-
-
-#pragma implementation "irrelevant_file"
-#line 1 "template18.h"
-#pragma interface
-template <class T> inline T min (T a, T b) { return a<b?a:b; }
-#line 13 "template18.C"
-
-main()
-{
- min (1, 1); // { dg-error "" "" { target *-*-* } 0 } should produce an undefined symbol error.
-}
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/template37.C b/gcc/testsuite/g++.old-deja/g++.jason/template37.C
deleted file mode 100644
index 23309a46b68..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.jason/template37.C
+++ /dev/null
@@ -1,40 +0,0 @@
-// { dg-do run }
-// { dg-options "-Wno-deprecated -fexternal-templates" }
-// { dg-warning "switch.*deprecated" "" { target *-*-* } 0 }
-
-// PRMS Id: 9930
-// Test of -fexternal-templates hackery in new template code
-
- #pragma implementation "foo.hh"
- #pragma interface "foo.hh"
-
- template<class T>
- class ONE
- {
- public:
- static void func();
- };
-
- template<class T>
- void ONE<T>::func()
- {
- }
-
- template <>
- class ONE<int>
- {
- public:
- static void func();
- };
-
- void ONE<int>::func()
- {
- }
-
-int main()
- {
- ONE<char>::func();
- ONE<int>::func();
-
- return 0;
- }
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
index a52ec2e865e..01a2ec696db 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk2.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail m68k-motorola-sysv m88k-motorola-sysv3 } }
+// { dg-do run }
// { dg-options "-fPIC" }
// Test that non-variadic function calls using thunks and PIC work right.
diff --git a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
index 9a4cffcdc56..8b8104969a3 100644
--- a/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
+++ b/gcc/testsuite/g++.old-deja/g++.jason/thunk3.C
@@ -1,4 +1,4 @@
-// { dg-do run { xfail mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff m68k-motorola-sysv m88k-motorola-sysv3 mn10300-*-* mn10200-*-* v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa-*-* } }
+// { dg-do run { xfail mips*-*-* rs6000-*-* powerpc-*-eabi m68k-*-coff mn10300-*-* v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa-*-* } }
// Test that variadic function calls using thunks work right.
// Note that this will break on any target that uses the generic thunk
// support, because it doesn't support variadic functions.
diff --git a/gcc/testsuite/g++.old-deja/g++.law/profile1.C b/gcc/testsuite/g++.old-deja/g++.law/profile1.C
index 24a79b438a6..9ca4a915469 100644
--- a/gcc/testsuite/g++.old-deja/g++.law/profile1.C
+++ b/gcc/testsuite/g++.old-deja/g++.law/profile1.C
@@ -1,4 +1,5 @@
-// { dg-do run { xfail m68k-motorola-sysv m88k-motorola-sysv3 mips*-*-* i[3456]86-*-sco3.2v5* } }
+// { dg-do run { xfail mips*-*-* i[3456]86-*-sco3.2v5* } }
+// { dg-require-profiling "" }
// { dg-options "-pg" }
// { dg-options "-pg -static" { target hppa*-*-hpux* } }
// GROUPS passed profiling
diff --git a/gcc/testsuite/g++.old-deja/g++.other/access11.C b/gcc/testsuite/g++.old-deja/g++.other/access11.C
index 72fc333c1af..fb9782405bc 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/access11.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/access11.C
@@ -5,12 +5,12 @@
class A
{
private:
- template <class T> void g(T t) {}
+ template <class T> void g(T t) {} // { dg-error "" } private
int i;
};
template <>
-void A::g<int>(int t) { i = 1; } // { dg-error "" } private
+void A::g<int>(int t) { i = 1; }
int main()
{
diff --git a/gcc/testsuite/g++.old-deja/g++.other/crash32.C b/gcc/testsuite/g++.old-deja/g++.other/crash32.C
index ad2139665a0..b9c4cf98c06 100644
--- a/gcc/testsuite/g++.old-deja/g++.other/crash32.C
+++ b/gcc/testsuite/g++.old-deja/g++.other/crash32.C
@@ -6,7 +6,7 @@ struct foo
enum e
{
not // { dg-error "" }
- }; // { dg-bogus "" "" { xfail *-*-* } }
+ }; // { dg-bogus "" }
~foo(); // { dg-bogus "" "" { xfail *-*-* } }
void x (foo *&a, bool b = (unsigned char)0);
}; // { dg-bogus "" "" { xfail *-*-* } }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
index 6cf869d5d6b..24cf653ceb4 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/asm1.C
@@ -1,4 +1,4 @@
-// { dg-do assemble { target i?86-*-linux* x86_64-*-linux } }
+// { dg-do assemble { target i?86-*-linux* x86_64-*-linux* } }
// Origin: "Weidmann, Nicholas" <nicholas.weidmann@swx.ch>
template<int i> int foo(int v)
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
index f60fffa99a6..239672dec43 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/defarg8.C
@@ -7,11 +7,11 @@
// so)
template <class T> class foo1;
-template <class T, class U> class foo2;
+template <class T, class U> class foo2; // { dg-error "" }
struct bar {
template <class T, class U>
- bar(int i = foo1<T>::baz, // { dg-bogus "" "" { xfail *-*-* } } -
+ bar(int i = foo1<T>::baz, // { dg-bogus "" } -
int j = int(foo2<T, U>::baz), // ok
- int k = foo2<T, U>::baz) {} // this is the problematic one.
+ int k = foo2<T, U>::baz) {} // { dg-error "" }
};
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C
index 25ba9ff564c..03b879433b5 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit71.C
@@ -12,4 +12,4 @@ class bug {
};
template <class X>
template <> // { dg-error "" } invalid specialization
-class bug<X>::a<char> {};
+class bug<X>::a<char> {}; // { dg-error "" }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/friend44.C b/gcc/testsuite/g++.old-deja/g++.pt/friend44.C
index c82c7e7824c..1f791729061 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/friend44.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/friend44.C
@@ -23,7 +23,7 @@ public:
template <class T> int A<T>::f (T)
{
B b;
- return b.a; // { dg-bogus "" "" { xfail *-*-* } }
+ return b.a;
}
template <class T> int A<T>::AI::f (T)
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static11.C b/gcc/testsuite/g++.old-deja/g++.pt/static11.C
index 1b037667674..cb5ee3a1a49 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static11.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static11.C
@@ -1,12 +1,11 @@
-// { dg-do run }
-// Bug: g++ was failing to destroy C<int>::a because it was using two
-// different sentry variables for construction and destruction.
-//
// Some targets (e.g. those with "set_board_info needs_status_wrapper 1"
// in their dejagnu baseboard description) require that the status is
// final when exit is entered (or main returns), and not "overruled" by a
// destructor calling _exit. It's not really worth it to handle that.
-// Skip if target: mmix-knuth-mmixware xtensa-*-elf*
+// { dg-do run { xfail mmix-knuth-mmixware xtensa-*-elf* arm*-*-elf } }
+
+// Bug: g++ was failing to destroy C<int>::a because it was using two
+// different sentry variables for construction and destruction.
extern "C" void _exit (int);
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
index f76def0d229..b812554e38c 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
@@ -12,7 +12,7 @@ template <class Type>
void PrintArgs (Type somearg, ...)
{
va_list argp;
-va_start (argp, somearg); // { dg-error "" } cannot pass non-POD
+va_start (argp, somearg);
Type value;
value = va_arg (argp, Type); // { dg-error "" } cannot pass non-POD
va_end (argp);
diff --git a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C b/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
deleted file mode 100644
index c27aa8d2df7..00000000000
--- a/gcc/testsuite/g++.old-deja/g++.robertl/eb42.C
+++ /dev/null
@@ -1,19 +0,0 @@
-//Build don't link:
-#include <vector>
-#include <algorithm>
-
-template <class T> class Expr
-{
-public :
-Expr(){};
-Expr(const T&){};
-};
-
-template <class T >
-inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
-
-int main()
-{
- std::vector<int> a(3);
- std::sort( a.begin(), a.end(), compare ); // ERROR - no matching function
-}
diff --git a/gcc/testsuite/g77.dg/12632.f b/gcc/testsuite/g77.dg/12632.f
new file mode 100644
index 00000000000..6801229eace
--- /dev/null
+++ b/gcc/testsuite/g77.dg/12632.f
@@ -0,0 +1,6 @@
+C { dg-do compile }
+C { dg-options "-fbounds-check" }
+ INTEGER I(1)
+ I(2) = 0 ! { dg-error "out of defined range" "out of defined range" }
+ END
+
diff --git a/gcc/testsuite/g77.dg/bprob/bprob.exp b/gcc/testsuite/g77.dg/bprob/bprob.exp
index ae52506f6cd..6eb45be2e36 100644
--- a/gcc/testsuite/g77.dg/bprob/bprob.exp
+++ b/gcc/testsuite/g77.dg/bprob/bprob.exp
@@ -17,10 +17,11 @@
# Test the functionality of programs compiled with profile-directed block
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
+load_lib target-supports.exp
+
# Some targets don't have any implementation of __bb_init_func or are
# missing other needed machinery.
-if { [istarget mmix-*-*]
- || [istarget cris-*-*] } {
+if { ![check_profiling_available] } {
return
}
diff --git a/gcc/testsuite/g77.f-torture/compile/13060.f b/gcc/testsuite/g77.f-torture/compile/13060.f
new file mode 100644
index 00000000000..200117b0271
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/compile/13060.f
@@ -0,0 +1,13 @@
+ subroutine geo2()
+ implicit none
+
+ integer ms,n,ne(2)
+
+ ne(1) = 1
+ ne(2) = 2
+ ms = 1
+
+ call call_me(ne(1)*ne(1))
+
+ n = ne(ms)
+ end
diff --git a/gcc/testsuite/g77.f-torture/execute/10197.x b/gcc/testsuite/g77.f-torture/execute/10197.x
new file mode 100644
index 00000000000..6a69a3aadab
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/execute/10197.x
@@ -0,0 +1,13 @@
+# Scratch files aren't implemented for mmixware
+# (_stat is a stub and files can't be deleted).
+# Similar restrictions exist for most simulators.
+
+if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscale*-*-elf"]
+ || [istarget "cris-*-elf"] } {
+ set torture_execute_xfail [istarget]
+}
+
+return 0
diff --git a/gcc/testsuite/g77.f-torture/execute/13037.f b/gcc/testsuite/g77.f-torture/execute/13037.f
new file mode 100644
index 00000000000..daafc528754
--- /dev/null
+++ b/gcc/testsuite/g77.f-torture/execute/13037.f
@@ -0,0 +1,58 @@
+c PR optimization/13037
+c Contributed by Kirill Smelkov
+c bug symptom: zeta(kkzc) seems to reference to zeta(kkzc-1) instead
+c with gcc-3.2.2 it is OK, so it is a regression.
+c
+ subroutine bug1(expnt)
+ implicit none
+
+ double precision zeta
+ common /bug1_area/zeta(3)
+
+ double precision expnt(3)
+
+
+ integer k, kkzc
+
+ kkzc=0
+ do k=1,3
+ kkzc = kkzc + 1
+ zeta(kkzc) = expnt(k)
+ enddo
+
+c the following line activates the bug
+ call bug1_activator(kkzc)
+ end
+
+
+c dummy subroutine
+ subroutine bug1_activator(inum)
+ implicit none
+ integer inum
+ end
+
+
+c test driver
+ program test_bug1
+ implicit none
+
+ double precision zeta
+ common /bug1_area/zeta(3)
+
+ double precision expnt(3)
+
+ zeta(1) = 0.0d0
+ zeta(2) = 0.0d0
+ zeta(3) = 0.0d0
+
+ expnt(1) = 1.0d0
+ expnt(2) = 2.0d0
+ expnt(3) = 3.0d0
+
+ call bug1(expnt)
+ if ((zeta(1).ne.1) .or. (zeta(2).ne.2) .or. (zeta(3).ne.3)) then
+ call abort
+ endif
+
+ end
+
diff --git a/gcc/testsuite/g77.f-torture/execute/20001201.x b/gcc/testsuite/g77.f-torture/execute/20001201.x
index 7087bab4960..6a69a3aadab 100644
--- a/gcc/testsuite/g77.f-torture/execute/20001201.x
+++ b/gcc/testsuite/g77.f-torture/execute/20001201.x
@@ -3,6 +3,9 @@
# Similar restrictions exist for most simulators.
if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscale*-*-elf"]
|| [istarget "cris-*-elf"] } {
set torture_execute_xfail [istarget]
}
diff --git a/gcc/testsuite/g77.f-torture/execute/6367.x b/gcc/testsuite/g77.f-torture/execute/6367.x
index 7087bab4960..42fc7da02ae 100644
--- a/gcc/testsuite/g77.f-torture/execute/6367.x
+++ b/gcc/testsuite/g77.f-torture/execute/6367.x
@@ -3,6 +3,9 @@
# Similar restrictions exist for most simulators.
if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscalearm*-*-elf"]
|| [istarget "cris-*-elf"] } {
set torture_execute_xfail [istarget]
}
diff --git a/gcc/testsuite/g77.f-torture/execute/io0.x b/gcc/testsuite/g77.f-torture/execute/io0.x
index 7087bab4960..6a69a3aadab 100644
--- a/gcc/testsuite/g77.f-torture/execute/io0.x
+++ b/gcc/testsuite/g77.f-torture/execute/io0.x
@@ -3,6 +3,9 @@
# Similar restrictions exist for most simulators.
if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscale*-*-elf"]
|| [istarget "cris-*-elf"] } {
set torture_execute_xfail [istarget]
}
diff --git a/gcc/testsuite/g77.f-torture/execute/io1.x b/gcc/testsuite/g77.f-torture/execute/io1.x
index 7087bab4960..6a69a3aadab 100644
--- a/gcc/testsuite/g77.f-torture/execute/io1.x
+++ b/gcc/testsuite/g77.f-torture/execute/io1.x
@@ -3,6 +3,9 @@
# Similar restrictions exist for most simulators.
if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscale*-*-elf"]
|| [istarget "cris-*-elf"] } {
set torture_execute_xfail [istarget]
}
diff --git a/gcc/testsuite/g77.f-torture/execute/u77-test.x b/gcc/testsuite/g77.f-torture/execute/u77-test.x
index 469732f518d..e4b89008c25 100644
--- a/gcc/testsuite/g77.f-torture/execute/u77-test.x
+++ b/gcc/testsuite/g77.f-torture/execute/u77-test.x
@@ -2,6 +2,9 @@
# link time.
if { [istarget "mmix-knuth-mmixware"]
+ || [istarget "arm*-*-elf"]
+ || [istarget "strongarm*-*-elf"]
+ || [istarget "xscale*-*-elf"]
|| [istarget "cris-*-elf"] } {
set torture_compile_xfail [istarget]
}
diff --git a/gcc/testsuite/gcc.c-torture/compile/200031109-1.c b/gcc/testsuite/gcc.c-torture/compile/200031109-1.c
new file mode 100644
index 00000000000..d1d495bac18
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/200031109-1.c
@@ -0,0 +1,11 @@
+/* For a short time on the tree-ssa branch this would warn that
+ value was not initialized as it was optimizing !(value = (m?1:2))
+ to 0 and not setting value before. */
+
+int t(int m)
+{
+ int value;
+ if (!(value = (m?1:2)))
+ value = 0;
+ return value;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c b/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
index 488a1b403d3..ef24e1cf139 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020604-1.c
@@ -1,5 +1,5 @@
/* The array is too big. */
-/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
/* { dg-do assemble { xfail m6811-*-* m6812-*-* } } */
/* PR c/6957
diff --git a/gcc/testsuite/gcc.c-torture/compile/20020910-1.c b/gcc/testsuite/gcc.c-torture/compile/20020910-1.c
index 31398ea3d45..092809b769c 100644
--- a/gcc/testsuite/gcc.c-torture/compile/20020910-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/20020910-1.c
@@ -1,3 +1,8 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int a;
+#else
unsigned int x0 = 0;
typedef struct {
@@ -11,4 +16,4 @@ static void foo (void)
{
yy.field1 = (unsigned int ) (&x0);
}
-
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-1.c b/gcc/testsuite/gcc.c-torture/compile/20031023-1.c
new file mode 100644
index 00000000000..67f8ea9181a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-1.c
@@ -0,0 +1,66 @@
+#ifndef ASIZE
+# define ASIZE 0x10000000000UL
+#endif
+
+#include <limits.h>
+
+#if LONG_MAX < 8 * ASIZE
+# undef ASIZE
+# define ASIZE 4096
+#endif
+
+extern void abort (void);
+
+int __attribute__((noinline))
+foo (const char *s)
+{
+ if (!s)
+ return 1;
+ if (s[0] != 'a')
+ abort ();
+ s += ASIZE - 1;
+ if (s[0] != 'b')
+ abort ();
+ return 0;
+}
+
+int (*fn) (const char *) = foo;
+
+int __attribute__((noinline))
+bar (void)
+{
+ char s[ASIZE];
+ s[0] = 'a';
+ s[ASIZE - 1] = 'b';
+ foo (s);
+ foo (s);
+ return 0;
+}
+
+int __attribute__((noinline))
+baz (long i)
+{
+ if (i)
+ return fn (0);
+ else
+ {
+ char s[ASIZE];
+ s[0] = 'a';
+ s[ASIZE - 1] = 'b';
+ foo (s);
+ foo (s);
+ return fn (0);
+ }
+}
+
+int
+main (void)
+{
+ if (bar ())
+ abort ();
+ if (baz (0) != 1)
+ abort ();
+ if (baz (1) != 1)
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-2.c b/gcc/testsuite/gcc.c-torture/compile/20031023-2.c
new file mode 100644
index 00000000000..663e447157e
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-2.c
@@ -0,0 +1,2 @@
+#define ASIZE 0x1000000000UL
+#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-3.c b/gcc/testsuite/gcc.c-torture/compile/20031023-3.c
new file mode 100644
index 00000000000..f4a16c73c0d
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-3.c
@@ -0,0 +1,2 @@
+#define ASIZE 0x100000000UL
+#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031023-4.c b/gcc/testsuite/gcc.c-torture/compile/20031023-4.c
new file mode 100644
index 00000000000..5c61f3743d4
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031023-4.c
@@ -0,0 +1,2 @@
+#define ASIZE 0x80000000UL
+#include "20031023-1.c"
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031031-1.c b/gcc/testsuite/gcc.c-torture/compile/20031031-1.c
new file mode 100644
index 00000000000..e641b78a358
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031031-1.c
@@ -0,0 +1,36 @@
+/* PR/11640 */
+
+int
+internal_insn_latency (int insn_code, int insn2_code)
+{
+ switch (insn_code)
+ {
+ case 256:
+ switch (insn2_code)
+ {
+ case 267:
+ return 8;
+ case 266:
+ return 8;
+ case 265:
+ return 8;
+ case 264:
+ return 8;
+ case 263:
+ return 8;
+ }
+ break;
+ case 273:
+ switch (insn2_code)
+ {
+ case 267:
+ return 5;
+ case 266:
+ return 5;
+ case 277:
+ return 3;
+ }
+ break;
+ }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031031-2.c b/gcc/testsuite/gcc.c-torture/compile/20031031-2.c
new file mode 100644
index 00000000000..d69dc75cad8
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031031-2.c
@@ -0,0 +1,36 @@
+/* PR/10239 */
+
+enum node_type
+{
+ INITIAL = 0, FREE,
+ PRECOLORED,
+ SIMPLIFY, SIMPLIFY_SPILL, SIMPLIFY_FAT, FREEZE, SPILL,
+ SELECT,
+ SPILLED, COALESCED, COLORED,
+ LAST_NODE_TYPE
+};
+
+inline void
+put_web (enum node_type type)
+{
+ switch (type)
+ {
+ case INITIAL:
+ case FREE:
+ case FREEZE:
+ case SPILL:
+ foo ();
+ break;
+ case PRECOLORED:
+ bar ();
+ break;
+ default:
+ baz ();
+ }
+}
+
+void
+reset_lists ()
+{
+ put_web (INITIAL);
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031102-1.c b/gcc/testsuite/gcc.c-torture/compile/20031102-1.c
new file mode 100644
index 00000000000..e32b8bd8612
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031102-1.c
@@ -0,0 +1,12 @@
+/* PR optimization/10817.
+ Check that the following code doesn't cause any problems
+ for GCC's if-conversion passes. */
+
+int foo(int t)
+{
+ int result = 0;
+ if (t != 0)
+ result = t;
+ return result;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031112-1.c b/gcc/testsuite/gcc.c-torture/compile/20031112-1.c
new file mode 100644
index 00000000000..466b29edf69
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031112-1.c
@@ -0,0 +1,2 @@
+extern __inline int __finite (double __value) { return 0; }
+extern __typeof (__finite) __finite __asm__ ("" "__GI___finite");
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031113-1.c b/gcc/testsuite/gcc.c-torture/compile/20031113-1.c
new file mode 100644
index 00000000000..74c031c3d86
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031113-1.c
@@ -0,0 +1,21 @@
+/* On Darwin, the stub for simple_cst_equal was not being emitted at all
+ causing the as to die and not create an object file. */
+
+int
+attribute_list_contained ()
+{
+ return (simple_cst_equal ());
+}
+int
+simple_cst_list_equal ()
+{
+ return (simple_cst_equal ());
+}
+
+
+int __attribute__((noinline))
+simple_cst_equal ()
+{
+ return simple_cst_list_equal ();
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031208-1.c b/gcc/testsuite/gcc.c-torture/compile/20031208-1.c
new file mode 100644
index 00000000000..02586dfe1c0
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031208-1.c
@@ -0,0 +1,6 @@
+extern int foo(int, ...);
+int bar(void) {
+ long double l = 1.2345E6;
+ foo(0, l);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031220-1.c b/gcc/testsuite/gcc.c-torture/compile/20031220-1.c
new file mode 100644
index 00000000000..026a2687fd6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031220-1.c
@@ -0,0 +1,21 @@
+/* PR optimization/13031 */
+/* The following code used to ICE on alphaev67-*-* at -O2 with an
+ unrecognizable instruction, caused by local register allocation
+ substituting a register for a constant in a conditional branch. */
+
+void emit(int, int);
+int f(void);
+static int signals[5];
+
+static inline void select(int sel, void *klass)
+{
+ emit(klass ? 0 : f(), signals[sel ? 0 : 1]);
+}
+
+void all(void *gil, void *l, void *icon)
+{
+ while (l)
+ if (icon)
+ select(0, gil);
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031220-2.c b/gcc/testsuite/gcc.c-torture/compile/20031220-2.c
new file mode 100644
index 00000000000..45c82779400
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031220-2.c
@@ -0,0 +1,44 @@
+/* PR target/12749
+ Orgin: Matt Thomas <matt@3am-software.com>
+ This used to cause GCC to write out an instruction for i386 when using a L64 host
+ which gas could not handle because GCC would write a full 64bit hex string out. */
+
+
+float fabsf (float);
+typedef int __int32_t;
+typedef unsigned int __uint32_t;
+typedef union
+{
+ float value;
+ __uint32_t word;
+} ieee_float_shape_type;
+extern float __ieee754_expf (float);
+extern float __ieee754_sinhf (float);
+static const float one = 1.0, shuge = 1.0e37;
+float
+__ieee754_sinhf(float x)
+{
+ float t,w,h;
+ __int32_t ix,jx;
+ do { ieee_float_shape_type gf_u; gf_u.value = (x); (jx) = gf_u.word; } while (0);
+ ix = jx&0x7fffffff;
+ if(ix>=0x7f800000) return x+x;
+ h = 0.5;
+ if (jx<0) h = -h;
+ if (ix < 0x41b00000) {
+ if (ix<0x31800000)
+ if(shuge+x>one) return x;
+ t = expm1f(fabsf(x));
+ if(ix<0x3f800000) return h*((float)2.0*t-t*t/(t+one));
+ return h*(t+t/(t+one));
+ }
+ if (ix < 0x42b17180) return h*__ieee754_expf(fabsf(x));
+ if (ix<=0x42b2d4fc) {
+ w = __ieee754_expf((float)0.5*fabsf(x));
+ t = h*w;
+ return t*w;
+ }
+ return x*shuge;
+}
+
+
diff --git a/gcc/testsuite/gcc.c-torture/compile/20031227-1.c b/gcc/testsuite/gcc.c-torture/compile/20031227-1.c
new file mode 100644
index 00000000000..41597bd18e6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/20031227-1.c
@@ -0,0 +1,17 @@
+/* PR opt/13159 -- test unswitching a loop multiple times. */
+
+void
+foo (void)
+{
+ long j, k, p, g;
+
+ while (p)
+ {
+ while (k < 0 && j < 0)
+ ;
+ if (g)
+ ;
+ else if (g)
+ ;
+ }
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/920625-1.c b/gcc/testsuite/gcc.c-torture/compile/920625-1.c
index 137e0dc1f17..6a52b029bad 100644
--- a/gcc/testsuite/gcc.c-torture/compile/920625-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/920625-1.c
@@ -11,7 +11,11 @@
(p7) mov r14 = r0
that appears to be a WAW violation. */
-/* { dg-xfail-if "missing .pred.rel.mutex directive" "ia64-*-*" { "-O1" "-O2" "-O3" "-Os" } { "" } } */
+
+/* { dg-prune-output "Assembler messages" } */
+/* { dg-prune-output "violate\[^\n\]*dependency" } */
+/* { dg-prune-output "first path encountering" } */
+/* { dg-prune-output "location of the conflicting" } */
typedef unsigned long int unsigned_word;
typedef signed long int signed_word;
diff --git a/gcc/testsuite/gcc.c-torture/compile/930217-1.c b/gcc/testsuite/gcc.c-torture/compile/930217-1.c
index 70f4a4897c4..0f64a040712 100644
--- a/gcc/testsuite/gcc.c-torture/compile/930217-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/930217-1.c
@@ -1,3 +1,8 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int a;
+#else
double g ();
typedef union {
struct {
@@ -12,3 +17,4 @@ f(x, n)
((s *)&x)->u.e -= n;
x = g((double)x, -n);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/compile/930513-1.c b/gcc/testsuite/gcc.c-torture/compile/930513-1.c
index 2e106ae43a9..463fd89b401 100644
--- a/gcc/testsuite/gcc.c-torture/compile/930513-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/930513-1.c
@@ -1,3 +1,8 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int a;
+#else
struct s {
int f1 : 26;
int f2 : 8;
@@ -7,3 +12,4 @@ f (struct s *x)
{
return x->f2++ == 0;
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/compile/961203-1.c b/gcc/testsuite/gcc.c-torture/compile/961203-1.c
index 1d879292e51..40cac8e3d05 100644
--- a/gcc/testsuite/gcc.c-torture/compile/961203-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/961203-1.c
@@ -1,6 +1,6 @@
/* The structure is too large for the xstormy16 - won't fit in 16
bits. */
-/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
/* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
struct s {
diff --git a/gcc/testsuite/gcc.c-torture/compile/980506-1.c b/gcc/testsuite/gcc.c-torture/compile/980506-1.c
index fd3496af309..9bc2d8afc3e 100644
--- a/gcc/testsuite/gcc.c-torture/compile/980506-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/980506-1.c
@@ -1,5 +1,5 @@
/* The arrays are too large for the xstormy16 - won't fit in 16 bits. */
-/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" } { "" } } */
+/* { dg-xfail-if "The array too big" { "h8300-*-*" } { "-mno-h" "-mn" } { "" } } */
/* { dg-do assemble { xfail xstormy16-*-* m6811-*-* m6812-*-* } } */
unsigned char TIFFFax2DMode[20][256];
diff --git a/gcc/testsuite/gcc.c-torture/compile/981006-1.c b/gcc/testsuite/gcc.c-torture/compile/981006-1.c
index d71637328db..718fa881af5 100644
--- a/gcc/testsuite/gcc.c-torture/compile/981006-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/981006-1.c
@@ -6,7 +6,7 @@
/* { dg-do assemble } */
/* For MIPS at least, pic is needed to trigger the problem. */
/* { dg-options "-w -Wuninitialized -Werror -fpic" } */
-/* { dg-options "-w -Wuninitialized -Werror" { target rs6000-*-aix* powerpc*-*-aix* arm*-*-* xscale*-*-* strongarm*-*-* fr30-*-* sh-*-hms sh-*-coff h8300*-*-* mn10200*-*-* cris-*-elf* cris-*-aout* mmix-*-* } } */
+/* { dg-options "-w -Wuninitialized -Werror" { target rs6000-*-aix* powerpc*-*-aix* arm*-*-* xscale*-*-* strongarm*-*-* fr30-*-* sh-*-hms sh-*-coff h8300*-*-* cris-*-elf* cris-*-aout* mmix-*-* } } */
int foo (int a, int b)
{
diff --git a/gcc/testsuite/gcc.c-torture/compile/981223-1.c b/gcc/testsuite/gcc.c-torture/compile/981223-1.c
index d0939f62eaf..b6289480749 100644
--- a/gcc/testsuite/gcc.c-torture/compile/981223-1.c
+++ b/gcc/testsuite/gcc.c-torture/compile/981223-1.c
@@ -1,11 +1,11 @@
/* The problem on IA-64 is that the assembler emits
Warning: Additional NOP may be necessary to workaround Itanium
- processor A/B step errata
+ processor A/B step errata */
+
+/* { dg-prune-output "Assembler messages" } */
+/* { dg-prune-output "Additional NOP may be necessary" } */
- This can be fixed by adding "-mb-step" to the command line, which
- does in fact add the extra nop. */
-/* { dg-options "-w -mb-step" { target ia64-*-* } } */
__complex__ float
func (__complex__ float x)
diff --git a/gcc/testsuite/gcc.c-torture/compile/libcall-1.c b/gcc/testsuite/gcc.c-torture/compile/libcall-1.c
new file mode 100644
index 00000000000..c1b1cfc6139
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/compile/libcall-1.c
@@ -0,0 +1,14 @@
+/* Failed on ARM because rtx_varies_p didn't like the REG_EQUAL notes
+ generated for libcalls.
+ http://gcc.gnu.org/ml/gcc-patches/2004-02/msg01518.html */
+static const char digs[] = "0123456789ABCDEF";
+int __attribute__((pure)) bar();
+
+int foo (int i)
+{
+ int len;
+ if (i)
+ return 0;
+ len = bar();
+ return digs[len];
+}
diff --git a/gcc/testsuite/gcc.c-torture/compile/simd-5.c b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
index d82b504a505..1575dc1a8d4 100644
--- a/gcc/testsuite/gcc.c-torture/compile/simd-5.c
+++ b/gcc/testsuite/gcc.c-torture/compile/simd-5.c
@@ -1,7 +1,7 @@
-/* On SPARC64/SPARC-V9 it fails, except with -m32. */
-/* { dg-xfail-if "PR target/9200" { "sparc64-*-*" "sparcv9-*-*" } { "*" } { "-m32" } } */
-/* On regular SPARC it doesn't fail, except with -m64. */
-/* { dg-xfail-if "PR target/9200" { "sparc-*-*" } { "-m64" } { "" } } */
+/* On SPARC64/SPARC-V9 it fails at -O0 and -O1, except with -m32. */
+/* { dg-xfail-if "PR target/9200" { "sparc64-*-*" "sparcv9-*-*" } { "-O0" "-O1" } { "-m32" } } */
+/* On regular SPARC it doesn't fail, except with -m64 at -O0 and -O1. */
+/* { dg-xfail-if "PR target/9200" { "sparc-*-*" } { "-m64 -O0" "-m64 -O1" } { "" } } */
#define vector64 __attribute__((vector_size(8)))
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020227-1.x b/gcc/testsuite/gcc.c-torture/execute/20020227-1.x
index 72adedff865..4e7194792cd 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020227-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/20020227-1.x
@@ -24,8 +24,8 @@ if { [istarget "sparc64-*-*"] || [istarget "sparcv9-*-*"] } {
{ "-O0" "-O1" }
}
}
-} elseif { [istarget "powerpc64-*-*"] } {
- # PowerPC-64 doesn't fail at any optimization level.
+} elseif { [istarget "powerpc64-*-*"] || [istarget "x86_64-*-*"] } {
+ # PowerPC-64 and x86_64 do not fail at any optimization level.
} elseif { [istarget "*64*-*-*"] || [istarget "alpha*-*-*"]
|| [istarget "mmix-*-*"] || [istarget "mips*-*-irix6*"] } {
# Other 64-bit targets fail at all optimization levels.
diff --git a/gcc/testsuite/gcc.c-torture/execute/20020720-1.x b/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
index 58e311c0d3c..2520c74f2b4 100644
--- a/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
+++ b/gcc/testsuite/gcc.c-torture/execute/20020720-1.x
@@ -16,7 +16,7 @@ set torture_eval_before_compile {
set compiler_conditional_xfail_data {
"This test fails to optimize completely on certain platforms." \
{ "xtensa-*-*" "sh-*-*" "arm*-*-*" "strongarm*-*-*" "xscale*-*-*" \
- "h8300*-*-*" "x86_64-*-*" "cris-*-*" } \
+ "h8300*-*-*" "cris-*-*" "frv-*-*" } \
{ "*" } \
{ "-O0" }
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031201-1.c b/gcc/testsuite/gcc.c-torture/execute/20031201-1.c
new file mode 100644
index 00000000000..7c8e0ea290f
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031201-1.c
@@ -0,0 +1,76 @@
+/* Copyright (C) 2003 Free Software Foundation.
+ PR target/13256
+ STRICT_LOW_PART was handled incorrectly in delay slots.
+ Origin: Hans-Peter Nilsson. */
+
+typedef struct { unsigned int e0 : 16; unsigned int e1 : 16; } s1;
+typedef struct { unsigned int e0 : 16; unsigned int e1 : 16; } s2;
+typedef struct { s1 i12; s2 i16; } io;
+static int test_length = 2;
+static io *i;
+static int m = 1;
+static int d = 1;
+static unsigned long test_t0;
+static unsigned long test_t1;
+void test(void) __attribute__ ((__noinline__));
+extern int f1 (void *port) __attribute__ ((__noinline__));
+extern void f0 (void) __attribute__ ((__noinline__));
+int
+f1 (void *port)
+{
+ int fail_count = 0;
+ unsigned long tlen;
+ s1 x0 = {0};
+ s2 x1 = {0};
+
+ i = port;
+ x0.e0 = x1.e0 = 32;
+ i->i12 = x0;
+ i->i16 = x1;
+ do f0(); while (test_t1);
+ x0.e0 = x1.e0 = 8;
+ i->i12 = x0;
+ i->i16 = x1;
+ test ();
+ if (m)
+ {
+ unsigned long e = 1000000000 / 460800 * test_length;
+ tlen = test_t1 - test_t0;
+ if (((tlen-e) & 0x7FFFFFFF) > 1000)
+ f0();
+ }
+ if (d)
+ {
+ unsigned long e = 1000000000 / 460800 * test_length;
+ tlen = test_t1 - test_t0;
+ if (((tlen - e) & 0x7FFFFFFF) > 1000)
+ f0();
+ }
+ return fail_count != 0 ? 1 : 0;
+}
+
+int
+main ()
+{
+ io io0;
+ f1 (&io0);
+ abort ();
+}
+
+void
+test (void)
+{
+ io *iop = i;
+ if (iop->i12.e0 != 8 || iop->i16.e0 != 8)
+ abort ();
+ exit (0);
+}
+
+void
+f0 (void)
+{
+ static int washere = 0;
+ io *iop = i;
+ if (washere++ || iop->i12.e0 != 32 || iop->i16.e0 != 32)
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031204-1.c b/gcc/testsuite/gcc.c-torture/execute/20031204-1.c
new file mode 100644
index 00000000000..a9c2f0195bd
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031204-1.c
@@ -0,0 +1,49 @@
+/* PR optimization/13260 */
+
+#include <string.h>
+
+typedef unsigned long u32;
+
+u32 in_aton(const char* x)
+{
+ return 0x0a0b0c0d;
+}
+
+u32 root_nfs_parse_addr(char *name)
+{
+ u32 addr;
+ int octets = 0;
+ char *cp, *cq;
+
+ cp = cq = name;
+ while (octets < 4) {
+ while (*cp >= '0' && *cp <= '9')
+ cp++;
+ if (cp == cq || cp - cq > 3)
+ break;
+ if (*cp == '.' || octets == 3)
+ octets++;
+ if (octets < 4)
+ cp++;
+ cq = cp;
+ }
+
+ if (octets == 4 && (*cp == ':' || *cp == '\0')) {
+ if (*cp == ':')
+ *cp++ = '\0';
+ addr = in_aton(name);
+ strcpy(name, cp);
+ } else
+ addr = (-1);
+
+ return addr;
+}
+
+int
+main()
+{
+ static char addr[] = "10.11.12.13:/hello";
+ u32 result = root_nfs_parse_addr(addr);
+ if (result != 0x0a0b0c0d) { abort(); }
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031214-1.c b/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
new file mode 100644
index 00000000000..e52200c01e6
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031214-1.c
@@ -0,0 +1,32 @@
+/* PR optimization/10312 */
+/* Originator: Peter van Hoof <p dot van-hoof at qub dot ac dot uk> */
+
+/* Verify that the strength reduction pass doesn't find
+ illegitimate givs. */
+
+struct
+{
+ double a;
+ int n[2];
+} g = { 0., { 1, 2}};
+
+int k = 0;
+
+void
+b (int *j)
+{
+}
+
+int
+main ()
+{
+ int j;
+
+ for (j = 0; j < 2; j++)
+ k = (k > g.n[j]) ? k : g.n[j];
+
+ k++;
+ b (&j);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031215-1.c b/gcc/testsuite/gcc.c-torture/execute/20031215-1.c
new file mode 100644
index 00000000000..d62177b2618
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031215-1.c
@@ -0,0 +1,38 @@
+/* PR middle-end/13400 */
+/* The following test used to fail at run-time with a write to read-only
+ memory, caused by if-conversion converting a conditional write into an
+ unconditional write. */
+
+typedef struct {int c, l; char ch[3];} pstr;
+const pstr ao = {2, 2, "OK"};
+const pstr * const a = &ao;
+
+void test1(void)
+{
+ if (a->ch[a->l]) {
+ ((char *)a->ch)[a->l] = 0;
+ }
+}
+
+void test2(void)
+{
+ if (a->ch[a->l]) {
+ ((char *)a->ch)[a->l] = -1;
+ }
+}
+
+void test3(void)
+{
+ if (a->ch[a->l]) {
+ ((char *)a->ch)[a->l] = 1;
+ }
+}
+
+int main(void)
+{
+ test1();
+ test2();
+ test3();
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.c-torture/execute/20031216-1.c b/gcc/testsuite/gcc.c-torture/execute/20031216-1.c
new file mode 100644
index 00000000000..709f0166a20
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/20031216-1.c
@@ -0,0 +1,23 @@
+/* PR optimization/13313 */
+/* Origin: Mike Lerwill <mike@ml-solutions.co.uk> */
+
+extern void abort(void);
+
+void DisplayNumber (unsigned long v)
+{
+ if (v != 0x9aL)
+ abort();
+}
+
+unsigned long ReadNumber (void)
+{
+ return 0x009a0000L;
+}
+
+int main (void)
+{
+ unsigned long tmp;
+ tmp = (ReadNumber() & 0x00ff0000L) >> 16;
+ DisplayNumber (tmp);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/920908-2.c b/gcc/testsuite/gcc.c-torture/execute/920908-2.c
index 66a6d86a7e7..31c1ae0769c 100644
--- a/gcc/testsuite/gcc.c-torture/execute/920908-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/920908-2.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
/*
CONF:m68k-sun-sunos4.1.1
OPTIONS:-O
@@ -21,3 +30,4 @@ t.c=0xffff11;
if(f(t)!=0x11)abort();
exit(0);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/921204-1.c b/gcc/testsuite/gcc.c-torture/execute/921204-1.c
index 9e4f4a6bae7..a7bba830a34 100644
--- a/gcc/testsuite/gcc.c-torture/execute/921204-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/921204-1.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
typedef struct {
unsigned b0:1, f1:17, b18:1, b19:1, b20:1, f2:11;
} bf;
@@ -34,3 +43,4 @@ main()
abort();
exit(0);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/930621-1.c b/gcc/testsuite/gcc.c-torture/execute/930621-1.c
index 6131301df2f..4bb7cdbe076 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930621-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930621-1.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
f ()
{
struct {
@@ -17,3 +26,4 @@ main ()
abort ();
exit (0);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/930630-1.c b/gcc/testsuite/gcc.c-torture/execute/930630-1.c
index 4befa835d0d..38ad1fdfd7b 100644
--- a/gcc/testsuite/gcc.c-torture/execute/930630-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/930630-1.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
main ()
{
struct
@@ -17,3 +26,4 @@ f (x)
if (x != 7)
abort ();
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/931031-1.c b/gcc/testsuite/gcc.c-torture/execute/931031-1.c
index 761989040f4..e9ce337955d 100644
--- a/gcc/testsuite/gcc.c-torture/execute/931031-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/931031-1.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
struct foo
{
unsigned y:1;
@@ -22,3 +31,4 @@ main ()
abort ();
exit (0);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/980602-2.c b/gcc/testsuite/gcc.c-torture/execute/980602-2.c
index 8ef23222d62..972553ed584 100644
--- a/gcc/testsuite/gcc.c-torture/execute/980602-2.c
+++ b/gcc/testsuite/gcc.c-torture/execute/980602-2.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
struct {
unsigned bit : 30;
} t;
@@ -9,3 +18,4 @@ int main()
else
abort ();
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
index bf648b3440c..3bf9a26f655 100644
--- a/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/comp-goto-1.c
@@ -1,13 +1,8 @@
#include <stdlib.h>
-#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000)
-#if __INT_MAX__ == 32767
-typedef unsigned long uint32;
-typedef signed long sint32;
-#else
+#if !defined(NO_LABEL_VALUES) && (!defined(STACK_SIZE) || STACK_SIZE >= 4000) && __INT_MAX__ >= 2147483647
typedef unsigned int uint32;
typedef signed int sint32;
-#endif
typedef uint32 reg_t;
diff --git a/gcc/testsuite/gcc.c-torture/execute/compndlit-1.c b/gcc/testsuite/gcc.c-torture/execute/compndlit-1.c
index 4a8488d0ab4..76328c21c2e 100644
--- a/gcc/testsuite/gcc.c-torture/execute/compndlit-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/compndlit-1.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
struct S
{
int a:3;
@@ -13,3 +22,4 @@ main ()
abort ();
exit (0);
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/extzvsi.c b/gcc/testsuite/gcc.c-torture/execute/extzvsi.c
index ba251271896..81f16185d21 100644
--- a/gcc/testsuite/gcc.c-torture/execute/extzvsi.c
+++ b/gcc/testsuite/gcc.c-torture/execute/extzvsi.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
/* Failed on powerpc due to bad extzvsi pattern. */
struct ieee
@@ -29,3 +38,4 @@ main (void)
abort ();
return 0;
}
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c b/gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c
new file mode 100644
index 00000000000..3804c08a80a
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/ieee/mzero5.c
@@ -0,0 +1,29 @@
+/* Test gcse handling of IEEE 0/-0 rules. */
+static double zero = 0.0;
+
+int
+negzero_check (double d)
+{
+ if (d == 0)
+ return !!memcmp ((void *)&zero, (void *)&d, sizeof (double));
+ return 0;
+}
+
+int
+sub (double d, double e)
+{
+ if (d == 0.0 && e == 0.0
+ && negzero_check (d) == 0 && negzero_check (e) == 0)
+ return 1;
+ else
+ return 0;
+}
+
+int
+main (void)
+{
+ double minus_zero = -0.0;
+ if (sub (minus_zero, 0))
+ abort ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2e.x b/gcc/testsuite/gcc.c-torture/execute/loop-2e.x
index d7b9f285097..9836850d8b2 100644
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2e.x
+++ b/gcc/testsuite/gcc.c-torture/execute/loop-2e.x
@@ -1,11 +1,4 @@
-# This doesn't work on m68k-motorola-sysv
-# It also doesn't work on m88k-motorola-sysv3
-
global target_triplet
-if { [istarget "m68k-motorola-sysv"] || [istarget "m88k-motorola-sysv3"] } {
- set torture_compile_xfail "$target_triplet"
-}
-
if { [istarget "i?86-*"] } {
set torture_eval_before_execute {
global compiler_conditional_xfail_data
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x b/gcc/testsuite/gcc.c-torture/execute/loop-2f.x
deleted file mode 100644
index e68b8fbb8d2..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2f.x
+++ /dev/null
@@ -1,9 +0,0 @@
-# This doesn't work on m68k-motorola-sysv
-# It also doesn't work on m88k-motorola-sysv3
-
-global target_triplet
-if { [istarget "m68k-motorola-sysv"] || [istarget "m88k-motorola-sysv3"] } {
- set torture_compile_xfail "$target_triplet"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x b/gcc/testsuite/gcc.c-torture/execute/loop-2g.x
deleted file mode 100644
index e68b8fbb8d2..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/loop-2g.x
+++ /dev/null
@@ -1,9 +0,0 @@
-# This doesn't work on m68k-motorola-sysv
-# It also doesn't work on m88k-motorola-sysv3
-
-global target_triplet
-if { [istarget "m68k-motorola-sysv"] || [istarget "m88k-motorola-sysv3"] } {
- set torture_compile_xfail "$target_triplet"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c
new file mode 100644
index 00000000000..88e74cc904c
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-5.c
@@ -0,0 +1,36 @@
+extern void abort (void);
+extern void exit (int);
+
+#ifndef NO_TRAMPOLINES
+static void recursive (int n, void (*proc) (void))
+{
+ __label__ l1;
+
+ void do_goto (void)
+ {
+ goto l1;
+ }
+
+ if (n == 3)
+ recursive (n - 1, do_goto);
+ else if (n > 0)
+ recursive (n - 1, proc);
+ else
+ (*proc) ();
+ return;
+
+l1:
+ if (n == 3)
+ exit (0);
+ else
+ abort ();
+}
+
+int main ()
+{
+ recursive (10, abort);
+ abort ();
+}
+#else
+int main () { return 0; }
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c
new file mode 100644
index 00000000000..c8e82435ab1
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/nestfunc-6.c
@@ -0,0 +1,29 @@
+/* Test that the GP gets properly restored, either by the nonlocal
+ receiver or the nested function. */
+
+#ifndef NO_TRAMPOLINES
+
+typedef __SIZE_TYPE__ size_t;
+extern void abort (void);
+extern void exit (int);
+extern void qsort(void *, size_t, size_t, int (*)(const void *, const void *));
+
+int main ()
+{
+ __label__ nonlocal;
+ int compare (const void *a, const void *b)
+ {
+ goto nonlocal;
+ }
+
+ char array[3];
+ qsort (array, 3, 1, compare);
+ abort ();
+
+ nonlocal:
+ exit (0);
+}
+
+#else
+int main() { return 0; }
+#endif
diff --git a/gcc/testsuite/gcc.c-torture/execute/simd-4.x b/gcc/testsuite/gcc.c-torture/execute/simd-4.x
new file mode 100644
index 00000000000..f5644cb24fc
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/simd-4.x
@@ -0,0 +1,13 @@
+# This doesn't work on sparc*-*-* at -O0.
+
+set torture_eval_before_compile {
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data {
+ "PR target/12916" \
+ { "sparc*-*-*" } \
+ { "-O0" } \
+ { "" }
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x b/gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x
deleted file mode 100644
index 850736e82dc..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/strct-varg-1.x
+++ /dev/null
@@ -1,7 +0,0 @@
-# This doesn't work on mn10200
-
-if { [istarget "mn10200*-*-*"] } {
- set torture_execute_xfail "mn10200*-*-*"
-}
-
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/va-arg-25.c b/gcc/testsuite/gcc.c-torture/execute/va-arg-25.c
index d90d288aba0..b9f3a1b1237 100644
--- a/gcc/testsuite/gcc.c-torture/execute/va-arg-25.c
+++ b/gcc/testsuite/gcc.c-torture/execute/va-arg-25.c
@@ -1,6 +1,7 @@
/* Varargs and vectors! */
#include <stdarg.h>
+#include <limits.h>
#define vector __attribute__((vector_size(16)))
@@ -27,8 +28,10 @@ void foo(int a, ...)
int main(void)
{
+#if INT_MAX == 2147483647
foo (1, (vector unsigned int){10,11,12,13}, 2,
(vector unsigned int){20,21,22,23});
+#endif
return 0;
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/va-arg-25.x b/gcc/testsuite/gcc.c-torture/execute/va-arg-25.x
new file mode 100644
index 00000000000..1658fbcc8ca
--- /dev/null
+++ b/gcc/testsuite/gcc.c-torture/execute/va-arg-25.x
@@ -0,0 +1,13 @@
+# This doesn't work on sparc*-*-*.
+
+set torture_eval_before_compile {
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data {
+ "PR target/12916" \
+ { "sparc*-*-*" } \
+ { "*" } \
+ { "" }
+ }
+}
+
+return 0
diff --git a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c b/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c
index 51f91d6ad46..3efdcf5a038 100644
--- a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c
+++ b/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.c
@@ -1,6 +1,6 @@
typedef __WCHAR_TYPE__ wchar_t;
-wchar_t x[] = L"Ä";
-wchar_t y = L'Ä';
+wchar_t x[] = L"Ä";
+wchar_t y = L'Ä';
extern void abort (void);
extern void exit (int);
@@ -8,9 +8,9 @@ int main (void)
{
if (sizeof (x) / sizeof (wchar_t) != 2)
abort ();
- if (x[0] != L'Ä' || x[1] != L'\0')
+ if (x[0] != L'Ä' || x[1] != L'\0')
abort ();
- if (y != L'Ä')
+ if (y != L'Ä')
abort ();
exit (0);
}
diff --git a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x b/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x
deleted file mode 100644
index 38c693d2f00..00000000000
--- a/gcc/testsuite/gcc.c-torture/execute/wchar_t-1.x
+++ /dev/null
@@ -1,3 +0,0 @@
-# Doesn't compile due to use of literal ISO8859.1 characters. PR 11439.
-set torture_compile_xfail "*-*-*"
-return 0
diff --git a/gcc/testsuite/gcc.c-torture/unsorted/ext.c b/gcc/testsuite/gcc.c-torture/unsorted/ext.c
index 8fa8cd73363..9e8604ef2b2 100644
--- a/gcc/testsuite/gcc.c-torture/unsorted/ext.c
+++ b/gcc/testsuite/gcc.c-torture/unsorted/ext.c
@@ -1,3 +1,12 @@
+/* The bit-field below would have a problem if __INT_MAX__ is too
+ small. */
+#if __INT_MAX__ < 2147483647
+int
+main (void)
+{
+ exit (0);
+}
+#else
struct foo
{
unsigned b31 : 1;
@@ -11,3 +20,4 @@ foo(a)
{
return a.b30;
}
+#endif
diff --git a/gcc/testsuite/gcc.dg/20020201-2.c b/gcc/testsuite/gcc.dg/20020201-2.c
deleted file mode 100644
index 2a13c8d83ca..00000000000
--- a/gcc/testsuite/gcc.dg/20020201-2.c
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This testcase caused ICE because gcc was not able to add instructions
- on edge from ENTRY block successor to itself. */
-/* { dg-do compile } */
-/* { dg-options "-O3 -fssa" } */
-
-struct A { int a1; int a2; };
-struct B { long int b[32]; };
-
-extern int bar (struct B *, struct A *);
-
-int
-foo (struct B x)
-{
- struct A a, b;
- struct B c;
- int d;
-
- while (1)
- {
- a.a1 = 0;
- a.a2 = 0;
- b = a;
- c = x;
- d = bar (&c, &b);
- if (d >= 0)
- return d;
- }
-
- return 0;
-}
diff --git a/gcc/testsuite/gcc.dg/20020201-4.c b/gcc/testsuite/gcc.dg/20020201-4.c
deleted file mode 100644
index 3c83fe76047..00000000000
--- a/gcc/testsuite/gcc.dg/20020201-4.c
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This testcase failed because recog_for_combine used to pass a different
- pattern than contained in insn to recog. */
-/* { dg-do compile } */
-/* { dg-options "-O2 -fssa -fssa-ccp" } */
-/* { dg-options "-O2 -march=i686 -fssa -fssa-ccp" { target i?86-*-* } } */
-
-extern int bar (char *);
-
-int
-foo (void)
-{
- char b[512];
-
- bar (b);
- return __builtin_strlen (b);
-}
diff --git a/gcc/testsuite/gcc.dg/20020304-1.c b/gcc/testsuite/gcc.dg/20020304-1.c
deleted file mode 100644
index f6d6b4e49a7..00000000000
--- a/gcc/testsuite/gcc.dg/20020304-1.c
+++ /dev/null
@@ -1,37 +0,0 @@
-/* { dg-do compile } */
-/* { dg-options "-O -fssa -fssa-ccp" } */
-
-double a[10][35], b[10][8];
-int c, c, d, e, f, g, h;
-
-int foo ()
-{
- int i, j, k, l;
-
- if (c > 10)
- c = 10;
-
- for (j = 0; j < c; j++)
- {
- k = 0;
- for (l = 0; l < h; l++)
- {
- if (d != 5)
- return -1;
- k = l * g;
- a[j][k] = (double) e; k++;
- a[j][k] = (double) f; k++;
- }
- for (i = 0;i < 35; i++)
- {
- if (a[j][i] >= 0.9)
- a[j][i] = 0.9;
- if (a[j][i] <= 0.1)
- a[j][i] = 0.1;
- }
- k = 0;
- b[j][k] = (double) e; k++;
- b[j][k] = (double) f; k++;
- }
- return 0;
-}
diff --git a/gcc/testsuite/gcc.dg/20020312-2.c b/gcc/testsuite/gcc.dg/20020312-2.c
index 082190b3c36..c6b9d8e26fa 100644
--- a/gcc/testsuite/gcc.dg/20020312-2.c
+++ b/gcc/testsuite/gcc.dg/20020312-2.c
@@ -40,8 +40,6 @@
/* No pic register. */
#elif defined(__m68k__)
# define PIC_REG "a5"
-#elif defined(__m88k__)
-# define PIC_REG "25"
#elif defined(__mc68hc1x__)
/* No pic register. */
#elif defined(__mcore__)
@@ -50,8 +48,6 @@
/* PIC register is $28, but is used even without -fpic. */
#elif defined(__MMIX__)
/* No pic register. */
-#elif defined(__mn10200__)
-/* No pic register. */
#elif defined(__mn10300__)
/* No pic register. */
#elif #cpu(ns32k)
@@ -66,8 +62,6 @@
# else
# define PIC_REG "30"
# endif
-#elif defined(__ibm032__) /* aka romp */
-/* No pic register. */
#elif defined(__s390__)
# define PIC_REG "12"
#elif defined(__sparc__)
diff --git a/gcc/testsuite/gcc.dg/20021014-1.c b/gcc/testsuite/gcc.dg/20021014-1.c
index e6dcf2ff823..1e2b76c7614 100644
--- a/gcc/testsuite/gcc.dg/20021014-1.c
+++ b/gcc/testsuite/gcc.dg/20021014-1.c
@@ -1,7 +1,8 @@
/* { dg-do run } */
+/* { dg-require-profiling "" } */
/* { dg-options "-O2 -p" } */
/* { dg-options "-O2 -p -static" { target hppa*-*-hpux* } } */
-/* { dg-error "profiler" "No profiler support" { target mmix-*-* xstormy16-*-* *-*-windiss } 0 } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
/* { dg-error "" "consider using `-pg' instead of `-p' with gprof(1)" { target *-*-freebsd* } 0 } */
/* Support for -p on solaris2 relies on mcrt1.o which comes with the
vendor compiler. We cannot reiably predict the directory where the
diff --git a/gcc/testsuite/gcc.dg/20030926-1.c b/gcc/testsuite/gcc.dg/20030926-1.c
index 085cb9b4da1..39833a65171 100644
--- a/gcc/testsuite/gcc.dg/20030926-1.c
+++ b/gcc/testsuite/gcc.dg/20030926-1.c
@@ -1,6 +1,7 @@
/* PR optimization/11741 */
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -minline-all-stringops -march=pentium4" } */
+/* { dg-options "-O2 -minline-all-stringops" } */
+/* { dg-options "-O2 -minline-all-stringops -march=pentium4" { target i?86-*-* } } */
void
foo (char *p)
diff --git a/gcc/testsuite/gcc.dg/20031102-1.c b/gcc/testsuite/gcc.dg/20031102-1.c
new file mode 100644
index 00000000000..4da4e6a8cc0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031102-1.c
@@ -0,0 +1,37 @@
+/* PR optimization/12799 */
+/* Origin: Pratap Subrahmanyam <pratap@vmware.com> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -march=i686" { target i686-*-* } } */
+
+/* Verify that reload_cse_move2add doesn't add unexpected CLOBBERs. */
+
+extern void abort(void);
+
+int loo = 1;
+
+__inline__ char InlineFunc(void)
+{
+ return __builtin_expect(!!(loo == 1), 1);
+}
+
+int FooBar(void)
+{
+ int i;
+ int var1 = InlineFunc() ? 2046 : 1023;
+ int var2 = InlineFunc() ? 512 : 1024;
+
+ for (i = 0; i < var1; i++)
+ ;
+
+ if (InlineFunc() && var2 != 512)
+ abort();
+
+ return 0;
+}
+
+int main(void)
+{
+ return FooBar();
+}
diff --git a/gcc/testsuite/gcc.dg/20031108-1.c b/gcc/testsuite/gcc.dg/20031108-1.c
new file mode 100644
index 00000000000..00bf11c3b28
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031108-1.c
@@ -0,0 +1,35 @@
+/* PR optimization/10467 */
+/* { dg-do compile { target arm*-*-* xscale*-*-* strongarm*-*-* } } */
+/* { dg-options "-O2 -mthumb" } */
+
+typedef enum {Ident_1} Enumeration;
+
+typedef struct record
+{
+ struct record *Ptr_Comp;
+ Enumeration Discr;
+ union {
+ struct {
+ Enumeration Enum_Comp;
+ int Int_Comp;
+ char Str_Comp [31];
+ } var_1;
+ } variant;
+} *Rec_Pointer;
+
+Rec_Pointer Ptr_Glob;
+
+Proc_1 (Ptr_Val_Par)
+ Rec_Pointer Ptr_Val_Par;
+{
+ Rec_Pointer Next_Record = Ptr_Val_Par->Ptr_Comp;
+
+ *Ptr_Val_Par->Ptr_Comp = *Ptr_Glob;
+
+ if (Next_Record->Discr == Ident_1)
+ {
+ Proc_7 (Next_Record->variant.var_1.Int_Comp, 10,
+ &Next_Record->variant.var_1.Int_Comp);
+ }
+}
+
diff --git a/gcc/testsuite/gcc.dg/20031111-1.c b/gcc/testsuite/gcc.dg/20031111-1.c
new file mode 100644
index 00000000000..f4de52257bc
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031111-1.c
@@ -0,0 +1,13 @@
+/* Make sure that dead code isn't eliminated too early, avoiding
+ detection of errors. */
+/* { dg-do compile } */
+
+void foo(void)
+{
+ if (0)
+ break; /* { dg-error "" } */
+ if (1)
+ ;
+ else
+ continue; /* { dg-error "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/20031201-1.c b/gcc/testsuite/gcc.dg/20031201-1.c
new file mode 100644
index 00000000000..e6ea70b01c4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031201-1.c
@@ -0,0 +1,20 @@
+/* PR optimization/12628 */
+/* The following test used to ICE in init_alias_analysis because the
+ given command line options meant that reg_scan wasn't (re)run before
+ the jump bypassing pass. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -fno-expensive-optimizations -fno-rerun-loop-opt" } */
+
+int outbuf[100];
+int outcnt;
+int bi_buf;
+void send_bits(void)
+{
+ bi_buf = 0;
+ outbuf[outcnt++] = 8;
+ outbuf[outcnt++] = 8;
+ if (outcnt)
+ bi_buf = 1;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20031201-2.c b/gcc/testsuite/gcc.dg/20031201-2.c
new file mode 100644
index 00000000000..c32b5ebd2e2
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031201-2.c
@@ -0,0 +1,41 @@
+/* PR optimization/11634 */
+
+/* The following code used to ICE in verify_local_live_at_start on
+ PA when compiled with -O2. The cause was that split_all_insns was
+ not updating liveness information when deleting no-op moves that
+ had REG_UNUSED notes. */
+
+/* { dg-do compile { target hppa*-*-* } } */
+/* { dg-options "-O2" } */
+
+void *f(void *s);
+void H5T_conv_vlen (unsigned long long nelmts, unsigned char *bg_ptr)
+{
+ long long seq_len;
+ unsigned long long bg_seq_len = 0;
+ unsigned src_base_size, dst_base_size;
+ void *tmp_buf = 0;
+ unsigned tmp_buf_size = 0;
+ unsigned long long elmtno;
+ for (elmtno = 0; elmtno < nelmts; elmtno++)
+ {
+ unsigned char *tmp = bg_ptr;
+ bg_seq_len = *tmp;
+ if (bg_seq_len > 0
+ && tmp_buf_size <
+ (unsigned) (bg_seq_len *
+ (src_base_size > dst_base_size
+ ? src_base_size
+ : dst_base_size)))
+ {
+ tmp_buf_size =
+ (unsigned) (bg_seq_len *
+ (src_base_size > dst_base_size
+ ? src_base_size
+ : dst_base_size));
+ }
+ if (bg_seq_len < seq_len)
+ f ((unsigned char *) tmp_buf + dst_base_size * bg_seq_len);
+ }
+}
+
diff --git a/gcc/testsuite/gcc.dg/20031202-1.c b/gcc/testsuite/gcc.dg/20031202-1.c
new file mode 100644
index 00000000000..424e01b5dd4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031202-1.c
@@ -0,0 +1,44 @@
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -mtune=i686" { target i?86-*-* } } */
+
+extern void abort (void);
+extern void exit (int);
+
+struct A { char p[6]; } __attribute__((packed));
+struct B {
+ struct A a;
+ void * const b;
+ struct A const * const c;
+ struct A const *d;
+};
+
+char v;
+
+int __attribute__((noinline))
+foo (struct B *b)
+{
+ int i;
+ for (i = 0; i < 6; ++i)
+ if (b->a.p[i])
+ abort ();
+ if (b->b != &v || b->c || b->d)
+ abort ();
+ return 12;
+}
+
+int __attribute__((noinline))
+bar (void *x)
+{
+ __asm __volatile ("" : "=r" (x) : "0" (x));
+ struct B y = { .b = x, .c = (void *) 0 };
+ return foo (&y) + 1;
+}
+
+int
+main (void)
+{
+ if (bar (&v) != 13)
+ abort ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/20031216-1.c b/gcc/testsuite/gcc.dg/20031216-1.c
new file mode 100644
index 00000000000..d8ee0703d7f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031216-1.c
@@ -0,0 +1,37 @@
+/* This used to abort due to a loop bug on s390*. */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+/* { dg-options "-O2 -fPIC" { target s390*-*-* } } */
+
+int count = 0;
+char *str;
+
+void test (int flag)
+{
+ char *p;
+
+ for (;;)
+ {
+ if (count > 5)
+ return;
+
+ p = "test";
+
+ if (flag)
+ count++;
+
+ str = p;
+ }
+}
+
+int main (void)
+{
+ test (1);
+
+ if (str[0] != 't')
+ abort ();
+
+ return 0;
+}
+
diff --git a/gcc/testsuite/gcc.dg/20031218-1.c b/gcc/testsuite/gcc.dg/20031218-1.c
new file mode 100644
index 00000000000..87cc1059fa8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031218-1.c
@@ -0,0 +1,19 @@
+/* Orgin: v.haisman@sh.cvut.cz
+ Reduced by: Wolfgang Bangerth <bangerth@dealii.org>
+ PR debug/12923 ICE in gen_subprogram_die with -O1 -g
+ The problem was that this just to ICE with -O1 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O -g" } */
+
+struct S {
+ unsigned n;
+};
+
+inline void foo (struct S * mx) {
+ mx->n = 1;
+}
+
+void bar () {
+ foo (0);
+}
diff --git a/gcc/testsuite/gcc.dg/20031218-2.c b/gcc/testsuite/gcc.dg/20031218-2.c
new file mode 100644
index 00000000000..497c963d27b
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031218-2.c
@@ -0,0 +1,12 @@
+/* Orgin: Richard Sandiford <rsandifo@gcc.gnu.org>
+ PR debug/12923 ICE in gen_subprogram_die with -O2 -g
+ The problem was that this just to ICE with -O2 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+int f1 (int y)
+{
+ int f2() { return y; }
+ return f2();
+}
diff --git a/gcc/testsuite/gcc.dg/20031218-3.c b/gcc/testsuite/gcc.dg/20031218-3.c
new file mode 100644
index 00000000000..58878b61f06
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031218-3.c
@@ -0,0 +1,12 @@
+/* Orgin: Chris Demetriou <cgd@broadcom.com>
+ PR debug/12923 ICE in gen_subprogram_die with -O2 -g
+ The problem was that this just to ICE with -O2 -g. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -g" } */
+
+int x (char *s)
+{
+ int y () { return (strlen (s)); }
+ return y (s);
+}
diff --git a/gcc/testsuite/gcc.dg/20031222-1.c b/gcc/testsuite/gcc.dg/20031222-1.c
new file mode 100644
index 00000000000..b0d1a2dc43c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031222-1.c
@@ -0,0 +1,18 @@
+/* PR c/9163 */
+/* The following test used to ICE after an error message in C99 mode
+ because GCC was trying to expand the tree to rtl. */
+
+/* { dg-do compile } */
+/* { dg-options "-std=c99" } */
+
+
+
+void f ()
+{
+ for (; int ; ); /* { dg-error "" } */
+}
+
+void foo ()
+{
+ while (int i); /* { dg-error "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/20031223-1.c b/gcc/testsuite/gcc.dg/20031223-1.c
new file mode 100644
index 00000000000..a022bf2ecf4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/20031223-1.c
@@ -0,0 +1,11 @@
+/* PR c/11995 */
+/* The following test used to ICE after an error message
+ because GCC was trying to expand the trees to rtl. */
+
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void f ()
+{
+ l: int; /* { dg-error "" } */
+}
diff --git a/gcc/testsuite/gcc.dg/altivec-10.c b/gcc/testsuite/gcc.dg/altivec-10.c
new file mode 100644
index 00000000000..8d9223f3be4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/altivec-10.c
@@ -0,0 +1,86 @@
+/* { dg-do compile { target powerpc*-*-* } } */
+/* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
+
+#include <altivec.h>
+#include <signal.h>
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+typedef union
+{
+ float f[4];
+ unsigned int i[4];
+ vector float v;
+} vec_float_t;
+
+void
+check_vec_all_num ()
+{
+ vec_float_t a, b, c;
+
+ a.i[0] = 0xfffa5a5a;
+ a.f[1] = 1.0;
+ a.f[2] = 1.0;
+ a.f[3] = 1.0;
+
+ b.f[0] = 1.0;
+ b.f[1] = 1.0;
+ b.f[2] = 1.0;
+ b.f[3] = 1.0;
+
+ c.i[0] = 0xfffa5a5a;
+ c.i[1] = 0xfffa5a5a;
+ c.i[2] = 0xfffa5a5a;
+ c.i[3] = 0xfffa5a5a;
+
+ if (vec_all_numeric (a.v))
+ abort ();
+
+ if (vec_all_nan (a.v))
+ abort ();
+
+ if (!vec_all_numeric (b.v))
+ abort ();
+
+ if (vec_all_nan (b.v))
+ abort ();
+
+ if (vec_all_numeric (c.v))
+ abort ();
+
+ if (!vec_all_nan (c.v))
+ abort ();
+
+}
+
+void
+check_cmple()
+{
+ vector float a = {1.0, 2.0, 3.0, 4.0};
+ vector float b = {1.0, 3.0, 2.0, 5.0};
+ vector signed int aux;
+ vector signed int le = {-1, -1, 0, -1};
+
+ aux = vec_cmple (a, b);
+
+ if (!vec_all_eq (aux, le))
+ abort ();
+}
+
+
+int
+main()
+{
+ /* Exit on systems without altivec. */
+ signal (SIGILL, sig_ill_handler);
+ asm volatile ("vor 0,0,0");
+ signal (SIGILL, SIG_DFL);
+
+ check_cmple ();
+ check_vec_all_num ();
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/altivec-varargs-1.c b/gcc/testsuite/gcc.dg/altivec-varargs-1.c
new file mode 100644
index 00000000000..caf6a266620
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/altivec-varargs-1.c
@@ -0,0 +1,90 @@
+/* { dg-do run { target powerpc*-*-darwin* powerpc*-*-*altivec* powerpc*-*-linux*} } */
+/* { dg-options "-maltivec -mabi=altivec -fno-inline" } */
+
+#include <stdarg.h>
+#include <signal.h>
+
+#define vector __attribute__((mode(V4SI)))
+
+const vector unsigned int v1 = {10,11,12,13};
+const vector unsigned int v2 = {20,21,22,23};
+const vector unsigned int v3 = {30,31,32,33};
+const vector unsigned int v4 = {40,41,42,43};
+
+void foo(vector unsigned int a, ...)
+{
+ va_list args;
+ vector unsigned int v;
+
+ va_start (args, a);
+ if (memcmp (&a, &v1, sizeof (v)) != 0)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v2, sizeof (v)) != 0)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v3, sizeof (v)) != 0)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v4, sizeof (v)) != 0)
+ abort ();
+ va_end (args);
+}
+
+void bar(vector unsigned int a, ...)
+{
+ va_list args;
+ vector unsigned int v;
+ int b;
+
+ va_start (args, a);
+ if (memcmp (&a, &v1, sizeof (v)) != 0)
+ abort ();
+ b = va_arg (args, int);
+ if (b != 2)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v2, sizeof (v)) != 0)
+ abort ();
+ v = va_arg (args, vector unsigned int);
+ if (memcmp (&v, &v3, sizeof (v)) != 0)
+ abort ();
+ va_end (args);
+}
+
+
+int main1(void)
+{
+ /* In this call, in the Darwin ABI, the first argument goes into v2
+ the second one into r9-r10 and memory,
+ and the next two in memory. */
+ foo ((vector unsigned int){10,11,12,13},
+ (vector unsigned int){20,21,22,23},
+ (vector unsigned int){30,31,32,33},
+ (vector unsigned int){40,41,42,43});
+ /* In this call, in the Darwin ABI, the first argument goes into v2
+ the second one into r9, then r10 is reserved and
+ there are two words of padding in memory, and the next two arguments
+ go after the padding. */
+ bar ((vector unsigned int){10,11,12,13}, 2,
+ (vector unsigned int){20,21,22,23},
+ (vector unsigned int){30,31,32,33});
+ return 0;
+}
+
+void
+sig_ill_handler (int sig)
+{
+ exit(0);
+}
+
+int main (void)
+{
+ /* Exit on systems without altivec. */
+ signal (SIGILL, sig_ill_handler);
+ /* Altivec instruction, 'vor %v0,%v0,%v0'. */
+ asm volatile (".long 0x10000484");
+ signal (SIGILL, SIG_DFL);
+
+ return main1 ();
+}
diff --git a/gcc/testsuite/gcc.dg/arm-g2.c b/gcc/testsuite/gcc.dg/arm-g2.c
new file mode 100644
index 00000000000..0120ffb8331
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/arm-g2.c
@@ -0,0 +1,19 @@
+/* Verify that hardware multiply is preferred on XScale. */
+/* { dg-do compile { target xscale*-*-* } } */
+/* { dg-options "-mcpu=xscale -O2" } */
+
+/* Brett Gaines' test case. */
+unsigned BCPL(unsigned) __attribute__ ((naked));
+unsigned BCPL(unsigned seed)
+{
+ /* Best code would be:
+ ldr r1, =2147001325
+ ldr r2, =715136305
+ mla r0, r1, r0, r2
+ mov pc, lr */
+
+ return seed * 2147001325U + 715136305U;
+}
+
+/* We want to suppress running for -mthumb but not for -mthumb-interwork. */
+/* { dg-final { global compiler_flags; if ![string match "*-mthumb *" $compiler_flags] { scan-assembler "mla\[ ].*" } } } */
diff --git a/gcc/testsuite/gcc.dg/arm-scd42-1.c b/gcc/testsuite/gcc.dg/arm-scd42-1.c
new file mode 100644
index 00000000000..70b34de2d12
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/arm-scd42-1.c
@@ -0,0 +1,15 @@
+/* Verify that mov is preferred on XScale for loading a 1 byte constant. */
+/* { dg-do compile { target xscale-*-* } } */
+/* { dg-options "-mcpu=xscale -O" } */
+
+unsigned load1(void) __attribute__ ((naked));
+unsigned load1(void)
+{
+ /* Best code would be:
+ mov r0, =17
+ mov pc, lr */
+
+ return 17;
+}
+
+/* { dg-final { scan-assembler "mov\[ ].*17" } } */
diff --git a/gcc/testsuite/gcc.dg/arm-scd42-2.c b/gcc/testsuite/gcc.dg/arm-scd42-2.c
new file mode 100644
index 00000000000..75e72747e29
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/arm-scd42-2.c
@@ -0,0 +1,17 @@
+/* Verify that mov is preferred on XScale for loading a 2 byte constant. */
+/* { dg-do compile { target xscale-*-* } } */
+/* { dg-options "-mcpu=xscale -O" } */
+
+unsigned load2(void) __attribute__ ((naked));
+unsigned load2(void)
+{
+ /* Best code would be:
+ mov r0, =272
+ add r0, r0, =1
+ mov pc, lr */
+
+ return 273;
+}
+
+/* We want to suppress running for -mthumb but not for -mthumb-interwork. */
+/* { dg-final { global compiler_flags; if ![string match "*-mthumb *" $compiler_flags] { scan-assembler "mov\[ ].*272" } } } */
diff --git a/gcc/testsuite/gcc.dg/arm-scd42-3.c b/gcc/testsuite/gcc.dg/arm-scd42-3.c
new file mode 100644
index 00000000000..80a4ba8dbf1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/arm-scd42-3.c
@@ -0,0 +1,15 @@
+/* Verify that ldr is preferred on XScale for loading a 3 or 4 byte constant. */
+/* { dg-do compile { target xscale-*-* } } */
+/* { dg-options "-mcpu=xscale -O" } */
+
+unsigned load4(void) __attribute__ ((naked));
+unsigned load4(void)
+{
+ /* Best code would be:
+ ldr r0, =65809
+ mov pc, lr */
+
+ return 65809;
+}
+
+/* { dg-final { scan-assembler "ldr\[ ].*" } } */
diff --git a/gcc/testsuite/gcc.dg/bitfld-1.c b/gcc/testsuite/gcc.dg/bitfld-1.c
index ae2283cfb1f..37acb6efac2 100644
--- a/gcc/testsuite/gcc.dg/bitfld-1.c
+++ b/gcc/testsuite/gcc.dg/bitfld-1.c
@@ -25,6 +25,7 @@ struct bf1
unsigned long g: 5; /* { dg-warning "GCC extension|ISO C" } */
ui h: 5;
enum foo i: 2; /* { dg-error "narrower" } */
- enum foo j: 3;
+ /* { dg-warning "GCC extension|ISO C" "extension" { target *-*-* } 27 } */
+ enum foo j: 3; /* { dg-warning "GCC extension|ISO C" } */
unsigned int k: 256; /* { dg-error "exceeds its type" } */
};
diff --git a/gcc/testsuite/gcc.dg/bitfld-7.c b/gcc/testsuite/gcc.dg/bitfld-7.c
new file mode 100644
index 00000000000..70004ffd8cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitfld-7.c
@@ -0,0 +1,8 @@
+/* Test for rejection of typeof on bit-fields. PR c/10333. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int a:1; } x;
+
+typeof (x.a) z; /* { dg-error "applied to a bit-field" "typeof" } */
diff --git a/gcc/testsuite/gcc.dg/bitfld-8.c b/gcc/testsuite/gcc.dg/bitfld-8.c
new file mode 100644
index 00000000000..937fb64f5f4
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/bitfld-8.c
@@ -0,0 +1,7 @@
+/* Test that too wide bit-fields are hard errors. PR c/3347. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk>, from PR c/3347 */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+struct { int i : 1999; } x; /* { dg-bogus "warning" "warning in place of error" } */
+/* { dg-error "width" "bit-field too wide" { target *-*-* } 6 } */
diff --git a/gcc/testsuite/gcc.dg/builtin-apply2.c b/gcc/testsuite/gcc.dg/builtin-apply2.c
new file mode 100644
index 00000000000..a1ba20fce53
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply2.c
@@ -0,0 +1,30 @@
+/* PR target/12503 */
+/* Origin: <pierre.nguyen-tuong@asim.lip6.fr> */
+
+/* Verify that __builtin_apply behaves correctly on targets
+ with pre-pushed arguments (e.g. SPARC). */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(char *name, double d, double e, double f, int g)
+{
+ if (g != INTEGER_ARG)
+ abort();
+}
+
+void bar(char *name, ...)
+{
+ __builtin_apply(foo, __builtin_apply_args(), 64);
+}
+
+int main(void)
+{
+ bar("eeee", 5.444567, 8.90765, 4.567789, INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-apply3.c b/gcc/testsuite/gcc.dg/builtin-apply3.c
new file mode 100644
index 00000000000..1335d09022a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-apply3.c
@@ -0,0 +1,31 @@
+/* PR middle-end/12210 */
+/* Origin: Ossadchy Yury A. <waspcoder@mail.ru> */
+
+/* This used to fail on i686 because the argument was not copied
+ to the right location by __builtin_apply after the direct call. */
+
+/* { dg-do run } */
+
+
+#define INTEGER_ARG 5
+
+extern void abort(void);
+
+void foo(int arg)
+{
+ if (arg != INTEGER_ARG)
+ abort();
+}
+
+void bar(int arg)
+{
+ foo(arg);
+ __builtin_apply(foo, __builtin_apply_args(), 16);
+}
+
+int main(void)
+{
+ bar(INTEGER_ARG);
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtin-return-1.c b/gcc/testsuite/gcc.dg/builtin-return-1.c
new file mode 100644
index 00000000000..d22891589dd
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtin-return-1.c
@@ -0,0 +1,26 @@
+/* PR middle-end/11151 */
+/* Originator: Andrew Church <gcczilla@achurch.org> */
+/* { dg-do run } */
+
+/* This used to fail on SPARC because the (undefined) return
+ value of 'bar' was overwriting that of 'foo'. */
+
+extern void abort(void);
+
+int foo(int n)
+{
+ return n+1;
+}
+
+int bar(int n)
+{
+ __builtin_return(__builtin_apply((void (*)(void))foo, __builtin_apply_args(), 64));
+}
+
+int main(void)
+{
+ if (bar(1) != 2)
+ abort();
+
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/builtins-18.c b/gcc/testsuite/gcc.dg/builtins-18.c
index 07b94185d61..a47de8b609e 100644
--- a/gcc/testsuite/gcc.dg/builtins-18.c
+++ b/gcc/testsuite/gcc.dg/builtins-18.c
@@ -8,11 +8,7 @@
/* { dg-do link } */
/* { dg-options "-O2 -ffast-math" } */
-
-/* Solaris doesn't have the entire C99 runtime. */
-#if !defined(sun)
-#define HAVE_C99_RUNTIME
-#endif
+#include "builtins-config.h"
extern void link_error(void);
@@ -29,6 +25,7 @@ main (void)
double _Complex dc = 3.0 + 4.0i;
long double _Complex ldc = 3.0L + 4.0iL;
+#ifdef HAVE_C99_RUNTIME
/* Test floats. */
if (cabsf (fc) != 5.0F)
link_error ();
@@ -38,6 +35,7 @@ main (void)
link_failure ();
if (__builtin_cabsf (3.0F + 4.0iF) != 5.0F)
link_failure ();
+#endif
/* Test doubles. */
if (cabs (dc) != 5.0)
diff --git a/gcc/testsuite/gcc.dg/builtins-20.c b/gcc/testsuite/gcc.dg/builtins-20.c
index b633c55f8a3..1bd95344ae9 100644
--- a/gcc/testsuite/gcc.dg/builtins-20.c
+++ b/gcc/testsuite/gcc.dg/builtins-20.c
@@ -8,11 +8,7 @@
/* { dg-do link } */
/* { dg-options "-O2 -ffast-math" } */
-
-/* Solaris doesn't have the entire C99 runtime. */
-#if !defined(sun)
-#define HAVE_C99_RUNTIME
-#endif
+#include "builtins-config.h"
extern void link_error(void);
diff --git a/gcc/testsuite/gcc.dg/builtins-config.h b/gcc/testsuite/gcc.dg/builtins-config.h
new file mode 100644
index 00000000000..7e7d92fbaf5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/builtins-config.h
@@ -0,0 +1,29 @@
+/* Copyright (C) 2003 Free Software Foundation.
+
+ Define macros useful in tests for bulitin functions. */
+
+/* Define HAVE_C99_RUNTIME if the entire C99 runtime is available on
+ the target system. The value of HAVE_C99_RUNTIME should be the
+ same as the value of TARGET_C99_FUNCTIONS in the GCC machine
+ description. (Perhaps GCC should predefine a special macro
+ indicating whether or not TARGET_C99_FUNCTIONS is set, but it does
+ not presently do that.) */
+
+#if defined(sun)
+/* Solaris doesn't have the entire C99 runtime. */
+#else
+/* Newlib has the "f" variants of the math functions, but not the "l"
+ variants. TARGET_C99_FUNCTIONS is only defined if all C99
+ functions are present. Therefore, on systems using newlib, tests
+ of builtins will fail for both the "f" and the "l" variants, and we
+ should therefore not define HAVE_C99_RUNTIME. Including <ctype.h>
+ gives us a way of seeing if _NEWLIB_VERSION is defined. Including
+ <math.h> would work too, but the GLIBC math inlines cause us to
+ generate inferior code, which causes the test to fail, so it is
+ not safe to include <math.h>. */
+#include <ctype.h>
+#ifdef _NEWLIB_VERSION
+#else
+#define HAVE_C99_RUNTIME
+#endif
+#endif
diff --git a/gcc/testsuite/gcc.dg/c90-const-expr-2.c b/gcc/testsuite/gcc.dg/c90-const-expr-2.c
index 746093bebcf..8c2c99f5cdb 100644
--- a/gcc/testsuite/gcc.dg/c90-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c90-const-expr-2.c
@@ -14,6 +14,12 @@ int *a;
int b;
long *c;
+#ifdef _LP64
+#define ZERO 0L
+#else
+#define ZERO 0
+#endif
+
/* Assertion that n is a null pointer constant: so the conditional expression
has type 'int *' instead of 'void *'.
*/
@@ -30,7 +36,7 @@ foo (void)
ASSERT_NPC ((void *)0);
ASSERT_NOT_NPC ((void *)(void *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
ASSERT_NOT_NPC ((void *)(char *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
- ASSERT_NOT_NPC ((void *)(0, 0)); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
+ ASSERT_NOT_NPC ((void *)(0, ZERO)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
ASSERT_NOT_NPC ((void *)(&"Foobar"[0] - &"Foobar"[0])); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
/* This last one is a null pointer constant in C99 only. */
ASSERT_NOT_NPC ((void *)(1 ? 0 : (0, 0))); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
diff --git a/gcc/testsuite/gcc.dg/c99-const-expr-2.c b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
index c9f8e0ffbc8..1a457e51a7d 100644
--- a/gcc/testsuite/gcc.dg/c99-const-expr-2.c
+++ b/gcc/testsuite/gcc.dg/c99-const-expr-2.c
@@ -14,6 +14,12 @@ int *a;
int b;
long *c;
+#ifdef _LP64
+#define ZERO 0L
+#else
+#define ZERO 0
+#endif
+
/* Assertion that n is a null pointer constant: so the conditional expression
has type 'int *' instead of 'void *'.
*/
@@ -30,7 +36,7 @@ foo (void)
ASSERT_NPC ((void *)0);
ASSERT_NOT_NPC ((void *)(void *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
ASSERT_NOT_NPC ((void *)(char *)0); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
- ASSERT_NOT_NPC ((void *)(0, 0)); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
+ ASSERT_NOT_NPC ((void *)(0, ZERO)); /* { dg-bogus "incompatible" "bogus null pointer constant" } */
ASSERT_NOT_NPC ((void *)(&"Foobar"[0] - &"Foobar"[0])); /* { dg-bogus "incompatible" "bogus null pointer constant" { xfail *-*-* } } */
/* This last one is a null pointer constant in C99 only. */
ASSERT_NPC ((void *)(1 ? 0 : (0, 0)));
diff --git a/gcc/testsuite/gcc.dg/cast-function-1.c b/gcc/testsuite/gcc.dg/cast-function-1.c
new file mode 100644
index 00000000000..44cb1839623
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cast-function-1.c
@@ -0,0 +1,49 @@
+/* PR c/12085 */
+/* Origin: David Hollenberg <dhollen@mosis.org> */
+
+/* Verify that the compiler doesn't inline a function at
+ a calling point where it is viewed with a different
+ prototype than the actual one. */
+
+/* { dg-do compile } */
+/* { dg-options "-O3" } */
+
+int foo1(int);
+int foo2();
+
+typedef struct {
+ double d;
+ int a;
+} str_t;
+
+void bar(void)
+{
+ double d;
+ int i;
+ str_t s;
+
+ d = ((double (*) (int)) foo1) (i); /* { dg-warning "non-compatible" } */
+ i = ((int (*) (double)) foo1) (d); /* { dg-warning "non-compatible" } */
+ s = ((str_t (*) (int)) foo1) (i); /* { dg-warning "non-compatible" } */
+ ((void (*) (int)) foo1) (d); /* { dg-warning "non-compatible" } */
+ i = ((int (*) (int)) foo1) (i); /* { dg-bogus "non-compatible" } */
+ (void) foo1 (i); /* { dg-bogus "non-compatible" } */
+
+ d = ((double (*) (int)) foo2) (i); /* { dg-warning "non-compatible" } */
+ i = ((int (*) (double)) foo2) (d); /* { dg-bogus "non-compatible" } */
+ s = ((str_t (*) (int)) foo2) (i); /* { dg-warning "non-compatible" } */
+ ((void (*) (int)) foo2) (d); /* { dg-warning "non-compatible" } */
+ i = ((int (*) (int)) foo2) (i); /* { dg-bogus "non-compatible" } */
+ (void) foo2 (i); /* { dg-bogus "non-compatible" } */
+}
+
+int foo1(int arg)
+{
+ return arg;
+}
+
+int foo2(arg)
+ int arg;
+{
+ return arg;
+}
diff --git a/gcc/testsuite/gcc.dg/cleanup-10.c b/gcc/testsuite/gcc.dg/cleanup-10.c
new file mode 100644
index 00000000000..39923fdde15
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-10.c
@@ -0,0 +1,114 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* mips*-*-linux* } } */
+/* { dg-options "-fasynchronous-unwind-tables -fexceptions -O2" } */
+/* Verify that cleanups work with exception handling through signal frames
+ on alternate stack. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ exc->exception_class = 0;
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig, siginfo_t *info, void *ctx)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ stack_t ss;
+ struct sigaction s;
+
+ ss.ss_size = 4 * sysconf (_SC_PAGESIZE);
+ if (ss.ss_size < SIGSTKSZ)
+ ss.ss_size = SIGSTKSZ;
+ ss.ss_sp = malloc (ss.ss_size);
+ if (ss.ss_sp == NULL)
+ exit (1);
+ ss.ss_flags = 0;
+ if (sigaltstack (&ss, NULL) < 0)
+ exit (1);
+
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_ONESHOT | SA_ONSTACK;
+ sigaction (SIGSEGV, &s, NULL);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/cleanup-11.c b/gcc/testsuite/gcc.dg/cleanup-11.c
new file mode 100644
index 00000000000..9c47f6cf658
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cleanup-11.c
@@ -0,0 +1,114 @@
+/* { dg-do run { target i?86-*-linux* x86_64-*-linux* ia64-*-linux* alpha*-*-linux* powerpc*-*-linux* s390*-*-linux* sparc*-*-linux* mips*-*-linux* } } */
+/* { dg-options "-fasynchronous-unwind-tables -fexceptions -O2" } */
+/* Verify that cleanups work with exception handling through realtime signal
+ frames on alternate stack. */
+
+#include <unwind.h>
+#include <stdlib.h>
+#include <signal.h>
+#include <unistd.h>
+
+static _Unwind_Reason_Code
+force_unwind_stop (int version, _Unwind_Action actions,
+ _Unwind_Exception_Class exc_class,
+ struct _Unwind_Exception *exc_obj,
+ struct _Unwind_Context *context,
+ void *stop_parameter)
+{
+ if (actions & _UA_END_OF_STACK)
+ abort ();
+ return _URC_NO_REASON;
+}
+
+static void force_unwind ()
+{
+ struct _Unwind_Exception *exc = malloc (sizeof (*exc));
+ exc->exception_class = 0;
+ exc->exception_cleanup = 0;
+
+#ifndef __USING_SJLJ_EXCEPTIONS__
+ _Unwind_ForcedUnwind (exc, force_unwind_stop, 0);
+#else
+ _Unwind_SjLj_ForcedUnwind (exc, force_unwind_stop, 0);
+#endif
+
+ abort ();
+}
+
+int count;
+char *null;
+
+static void counter (void *p __attribute__((unused)))
+{
+ ++count;
+}
+
+static void handler (void *p __attribute__((unused)))
+{
+ if (count != 2)
+ abort ();
+ exit (0);
+}
+
+static int __attribute__((noinline)) fn5 ()
+{
+ char dummy __attribute__((cleanup (counter)));
+ force_unwind ();
+ return 0;
+}
+
+static void fn4 (int sig, siginfo_t *info, void *ctx)
+{
+ char dummy __attribute__((cleanup (counter)));
+ fn5 ();
+ null = NULL;
+}
+
+static void fn3 ()
+{
+ abort ();
+}
+
+static int __attribute__((noinline)) fn2 ()
+{
+ *null = 0;
+ fn3 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn1 ()
+{
+ stack_t ss;
+ struct sigaction s;
+
+ ss.ss_size = 4 * sysconf (_SC_PAGESIZE);
+ if (ss.ss_size < SIGSTKSZ)
+ ss.ss_size = SIGSTKSZ;
+ ss.ss_sp = malloc (ss.ss_size);
+ if (ss.ss_sp == NULL)
+ exit (1);
+ ss.ss_flags = 0;
+ if (sigaltstack (&ss, NULL) < 0)
+ exit (1);
+
+ sigemptyset (&s.sa_mask);
+ s.sa_sigaction = fn4;
+ s.sa_flags = SA_ONESHOT | SA_ONSTACK | SA_SIGINFO;
+ sigaction (SIGSEGV, &s, NULL);
+ fn2 ();
+ return 0;
+}
+
+static int __attribute__((noinline)) fn0 ()
+{
+ char dummy __attribute__((cleanup (handler)));
+ fn1 ();
+ null = 0;
+ return 0;
+}
+
+int main()
+{
+ fn0 ();
+ abort ();
+}
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_x.c b/gcc/testsuite/gcc.dg/compat/vector-1_x.c
index c7e69731400..c7503e5d787 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1_x.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1_x.c
@@ -1,4 +1,5 @@
/* { dg-options "-w" } */
+/* { dg-xfail-if "PR target/12916" "sparc*-*-*" "*" "" } */
#include "compat-common.h"
#include "vector-defs.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-1_y.c b/gcc/testsuite/gcc.dg/compat/vector-1_y.c
index 1b8b6d7a49e..8aa21e13e6c 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-1_y.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-1_y.c
@@ -1,4 +1,5 @@
/* { dg-options "-w" } */
+/* { dg-xfail-if "PR target/12916" "sparc*-*-*" "*" "" } */
#include "compat-common.h"
#include "vector-defs.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_x.c b/gcc/testsuite/gcc.dg/compat/vector-2_x.c
index 492878aa750..9aa49c0622f 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2_x.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2_x.c
@@ -1,4 +1,5 @@
/* { dg-options "-w" } */
+/* { dg-xfail-if "PR target/12916" "sparc*-*-*" "*" "" } */
#include "compat-common.h"
#include "vector-defs.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-2_y.c b/gcc/testsuite/gcc.dg/compat/vector-2_y.c
index e100560a507..283b149a207 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-2_y.c
+++ b/gcc/testsuite/gcc.dg/compat/vector-2_y.c
@@ -1,4 +1,5 @@
/* { dg-options "-w" } */
+/* { dg-xfail-if "PR target/12916" "sparc*-*-*" "*" "" } */
#include "compat-common.h"
#include "vector-defs.h"
diff --git a/gcc/testsuite/gcc.dg/compat/vector-check.h b/gcc/testsuite/gcc.dg/compat/vector-check.h
index f500bd4f43a..2d586d287d9 100644
--- a/gcc/testsuite/gcc.dg/compat/vector-check.h
+++ b/gcc/testsuite/gcc.dg/compat/vector-check.h
@@ -1,6 +1,6 @@
#define TEST(NUM,TMODE,VAL) \
extern v##NUM##TMODE g_v##NUM##TMODE; \
-extern int g_##TMODE; \
+extern TMODE g_##TMODE; \
\
extern void pass_v##NUM##TMODE (v##NUM##TMODE); \
extern v##NUM##TMODE return_v##NUM##TMODE (void); \
diff --git a/gcc/testsuite/gcc.dg/complex-1.c b/gcc/testsuite/gcc.dg/complex-1.c
new file mode 100644
index 00000000000..7153433d0cb
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/complex-1.c
@@ -0,0 +1,31 @@
+/* { dg-do run } */
+/* { dg-options "-O" } */
+
+/* Verify that the 6th complex floating-point argument is
+ correctly passed as unnamed argument on SPARC64. */
+
+extern void abort(void);
+
+void foo(long arg1, long arg2, long arg3, long arg4, long arg5, ...)
+{
+ __builtin_va_list ap;
+ _Complex float cf;
+
+ __builtin_va_start(ap, arg5);
+ cf = __builtin_va_arg(ap, _Complex float);
+ __builtin_va_end(ap);
+
+ if (__imag__ cf != 2.0f)
+ abort();
+}
+
+int bar(long arg1, long arg2, long arg3, long arg4, long arg5, _Complex float arg6)
+{
+ foo(arg1, arg2, arg3, arg4, arg5, arg6);
+ return 0;
+}
+
+int main(void)
+{
+ return bar(0, 0, 0, 0, 0, 2.0fi);
+}
diff --git a/gcc/testsuite/gcc.dg/compound-lvalue-1.c b/gcc/testsuite/gcc.dg/compound-lvalue-1.c
new file mode 100644
index 00000000000..c77403d02e3
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/compound-lvalue-1.c
@@ -0,0 +1,12 @@
+/* Test for deprecation of compound expressions as lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x, y;
+
+void
+foo (void)
+{
+ (x, y) = 1; /* { dg-warning "lvalue" "compound expression as lvalue deprecated" } */
+}
diff --git a/gcc/testsuite/gcc.dg/cond-lvalue-1.c b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
new file mode 100644
index 00000000000..1765546e342
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cond-lvalue-1.c
@@ -0,0 +1,12 @@
+/* Test for deprecation of conditional expressions as lvalues. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+int x, y, z;
+
+void
+foo (void)
+{
+ (x ? y : z) = 1; /* { dg-warning "lvalue" "conditional expression as lvalue deprecated" } */
+}
diff --git a/gcc/testsuite/gcc.dg/const-elim-1.c b/gcc/testsuite/gcc.dg/const-elim-1.c
index c9c57a2784d..7281ebfd9b4 100644
--- a/gcc/testsuite/gcc.dg/const-elim-1.c
+++ b/gcc/testsuite/gcc.dg/const-elim-1.c
@@ -7,7 +7,10 @@
/* { dg-do compile } */
/* { dg-options "-O2 -std=c99" } */
-/* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" } } */
+/* This test fails on ARM cores because we use a block move to
+ initialize "S" in test2, and GCC is not clever enough to eliminate
+ the block move. */
+/* { dg-final { scan-assembler-not "L\\\$?C\[^A-Z\]" { xfail arm-*-* } } } */
#define I (__extension__ 1.0iF)
diff --git a/gcc/testsuite/gcc.dg/cpp/assert4.c b/gcc/testsuite/gcc.dg/cpp/assert4.c
new file mode 100644
index 00000000000..e71baf2bb35
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/assert4.c
@@ -0,0 +1,436 @@
+/* Copyright (C) 2003 Free Software Foundation, Inc.
+ Test builtin preprocessor assertions.
+ By Kaveh Ghazi <ghazi@caip.rutgers.edu>. */
+
+/* { dg-do preprocess } */
+
+/* Check for #system assertions. */
+
+#if defined __gnu_linux__
+# if !#system(linux) || !#system(unix) || !#system(posix)
+# error
+# endif
+#elif #system(linux)
+# error
+#endif
+
+#if defined __gnu_hurd__
+# if !#system(gnu) || !#system(unix) || !#system(posix) || !#system(mach)
+# error
+# endif
+#elif #system(gnu)
+# error
+#endif
+
+#if defined __FreeBSD__
+# if !#system(FreeBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(FreeBSD)
+# error
+#endif
+
+#if defined __NetBSD__
+# if !#system(NetBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(NetBSD)
+# error
+#endif
+
+#if defined __OpenBSD__
+# if !#system(OpenBSD) || !#system(unix) || !#system(bsd)
+# error
+# endif
+#elif #system(OpenBSD)
+# error
+#endif
+
+#if defined __svr4__ || defined __SYSTYPE_SVR4__
+# if !#system(svr4) || !#system(unix)
+# error
+# endif
+#elif #system(svr4)
+# error
+#endif
+
+#if defined __hpux__
+# if !#system(hpux) || !#system(unix)
+# error
+# endif
+#elif #system(hpux)
+# error
+#endif
+
+#if defined _AIX
+# if !#system(aix) || !#system(unix)
+# error
+# endif
+#elif #system(aix)
+# error
+#endif
+
+#if defined __lynx__
+# if !#system(lynx) || !#system(unix)
+# error
+# endif
+#elif #system(lynx)
+# error
+#endif
+
+#if defined __unix__
+# if !#system(unix)
+# error
+# endif
+#elif #system(unix)
+# error
+#endif
+
+#if defined __rtems__
+# if !#system(rtems)
+# error
+# endif
+#elif #system(rtems)
+# error
+#endif
+
+#if defined __vms__
+# if !#system(vms)
+# error
+# endif
+#elif #system(vms)
+# error
+#endif
+
+#if defined __mvs__
+# if !#system(mvs)
+# error
+# endif
+#elif #system(mvs)
+# error
+#endif
+
+#if defined __MSDOS__
+# if !#system(msdos)
+# error
+# endif
+#elif #system(msdos)
+# error
+#endif
+
+#if defined __WINNT__
+# if !#system(winnt)
+# error
+# endif
+#elif #system(winnt)
+# error
+#endif
+
+#if defined __BEOS__
+# if !#system(beos)
+# error
+# endif
+#elif #system(beos)
+# error
+#endif
+
+#if defined __netware__
+# if !#system(netware)
+# error
+# endif
+#elif #system(netware)
+# error
+#endif
+
+
+/* Check for #cpu and #machine assertions. */
+
+#if defined __arc__
+# if !#cpu(arc) || !#machine(arc)
+# error
+# endif
+#elif #cpu(arc) || #machine(arc)
+# error
+#endif
+
+#if defined __alpha__
+# if !#cpu(alpha) || !#machine(alpha) \
+ || (defined __alpha_cix__ && !#cpu(cix)) \
+ || (!defined __alpha_cix__ && #cpu(cix)) \
+ || (defined __alpha_fix__ && !#cpu(fix)) \
+ || (!defined __alpha_fix__ && #cpu(fix)) \
+ || (defined __alpha_bwx__ && !#cpu(bwx)) \
+ || (!defined __alpha_bwx__ && #cpu(bwx)) \
+ || (defined __alpha_max__ && !#cpu(max)) \
+ || (!defined __alpha_max__ && #cpu(max)) \
+ || (defined __alpha_ev6__ && !#cpu(ev6)) \
+ || (!defined __alpha_ev6__ && #cpu(ev6)) \
+ || (defined __alpha_ev5__ && !#cpu(ev5)) \
+ || (!defined __alpha_ev5__ && #cpu(ev5)) \
+ || (defined __alpha_ev4__ && !#cpu(ev4)) \
+ || (!defined __alpha_ev4__ && #cpu(ev4))
+# error
+# endif
+#elif #cpu(alpha) || #machine(alpha) || #cpu(cix) || #cpu(fix) || #cpu(bwx) \
+ || #cpu(max) || #cpu(ev6) || #cpu(ev5) || #cpu(ev4)
+# error
+#endif
+
+#if defined __arm__
+# if !#cpu(arm) || !#machine(arm)
+# error
+# endif
+#elif #cpu(arm) || #machine(arm)
+# error
+#endif
+
+#if defined __cris__
+# if !#cpu(cris) || !#machine(cris)
+# error
+# endif
+#elif #cpu(cris) || #machine(cris)
+# error
+#endif
+
+#if defined __d30v__
+# if !#cpu(d30v) || !#machine(d30v)
+# error
+# endif
+#elif #cpu(d30v) || #machine(d30v)
+# error
+#endif
+
+#if defined __fr30__
+# if !#cpu(fr30) || !#machine(fr30)
+# error
+# endif
+#elif #cpu(fr30) || #machine(fr30)
+# error
+#endif
+
+#if defined __frv__
+# if !#cpu(frv) || !#machine(frv)
+# error
+# endif
+#elif #cpu(frv) || #machine(frv)
+# error
+#endif
+
+#if defined __h8300__
+# if !#cpu(h8300) || !#machine(h8300) \
+ || (defined __H8300__ && (!#cpu(h8300) || !#machine(h8300))) \
+ || (defined __H8300H__ && (!#cpu(h8300h) || !#machine(h8300h))) \
+ || (!defined __H8300H__ && (#cpu(h8300h) || #machine(h8300h))) \
+ || (defined __H8300S__ && (!#cpu(h8300s) || !#machine(h8300s))) \
+ || (!defined __H8300S__ && (#cpu(h8300s) || #machine(h8300s)))
+# error
+# endif
+#elif #cpu(h8300) || #machine(h8300) || #cpu(h8300h) || #machine(h8300h) || \
+ #cpu(h8300s) || #machine(h8300s)
+# error
+#endif
+
+#if defined __hppa__
+# if !#cpu(hppa) || !#machine(hppa)
+# error
+# endif
+#elif #cpu(hppa) || #machine(hppa)
+# error
+#endif
+
+#if defined __i370__
+# if !#cpu(i370) || !#machine(i370)
+# error
+# endif
+#elif #cpu(i370) || #machine(i370)
+# error
+#endif
+
+#if defined __x86_64__
+# if !#cpu(x86_64) || !#machine(x86_64)
+# error
+# endif
+#elif #cpu(x86_64) || #machine(x86_64)
+# error
+#endif
+
+#if defined __i386__
+# if !#cpu(i386) || !#machine(i386)
+# error
+# endif
+#elif #cpu(i386) || #machine(i386)
+# error
+#endif
+
+#if defined __i860__
+# if !#cpu(i860) || !#machine(i860)
+# error
+# endif
+#elif #cpu(i860) || #machine(i860)
+# error
+#endif
+
+#if defined __i960__
+# if !#cpu(i960) || !#machine(i960)
+# error
+# endif
+#elif #cpu(i960) || #machine(i960)
+# error
+#endif
+
+#if defined __ia64__
+# if !#cpu(ia64) || !#machine(ia64)
+# error
+# endif
+#elif #cpu(ia64) || #machine(ia64)
+# error
+#endif
+
+#if defined __iq2000__
+# if !#cpu(iq2000) || !#machine(iq2000)
+# error
+# endif
+#elif #cpu(iq2000) || #machine(iq2000)
+# error
+#endif
+
+#if defined __M32R__
+# if !#cpu(m32r) || !#machine(m32r)
+# error
+# endif
+#elif #cpu(m32r) || #machine(m32r)
+# error
+#endif
+
+#if defined __m68k__
+# if !#cpu(m68k) || !#machine(m68k)
+# error
+# endif
+#elif #cpu(m68k) || #machine(m68k)
+# error
+#endif
+
+#if defined __mcore__
+# if !#cpu(mcore) || !#machine(mcore)
+# error
+# endif
+#elif #cpu(mcore) || #machine(mcore)
+# error
+#endif
+
+#if defined __mips__
+# if !#cpu(mips) || (defined __sgi__ && !#machine(sgi)) \
+ || (!defined __sgi__ && !#machine(mips))
+# error
+# endif
+#elif #cpu(mips) || #machine(sgi) || #machine(mips)
+# error
+#endif
+
+#if defined __mmix__
+# if !#cpu(mmix) || !#machine(mmix)
+# error
+# endif
+#elif #cpu(mmix) || #machine(mcore)
+# error
+#endif
+
+#if defined __mn10300__
+# if !#cpu(mn10300) || !#machine(mn10300)
+# error
+# endif
+#elif #cpu(mn10300) || #machine(mn10300)
+# error
+#endif
+
+#if defined __ns32k__
+# if !#cpu(ns32k) || !#machine(ns32k)
+# error
+# endif
+#elif #cpu(ns32k) || #machine(ns32k)
+# error
+#endif
+
+#if defined __pdp11__
+# if !#cpu(pdp11) || !#machine(pdp11)
+# error
+# endif
+#elif #cpu(pdp11) || #machine(pdp11)
+# error
+#endif
+
+#if defined __powerpc__
+# if !#cpu(powerpc) || !#machine(powerpc)
+# error
+# endif
+#elif #cpu(powerpc) || #machine(powerpc)
+# error
+#endif
+
+#if defined __rs6000__
+# if !#cpu(rs6000) || !#machine(rs6000)
+# error
+# endif
+#elif #cpu(rs6000) || #machine(rs6000)
+# error
+#endif
+
+#if defined __s390__
+# if !#cpu(s390) || !#machine(s390)
+# error
+# endif
+#elif #cpu(s390) || #machine(s390)
+# error
+#endif
+
+#if defined __sh__
+# if !#cpu(sh) || !#machine(sh)
+# error
+# endif
+#elif #cpu(sh) || #machine(sh)
+# error
+#endif
+
+#if defined __sparc__
+# if (defined __arch64__ \
+ && (!#cpu(sparc64) || !#machine(sparc64) || #cpu(sparc) || #machine(sparc)))
+ || (!defined __arch64__ \
+ && (#cpu(sparc64) || #machine(sparc64) || !#cpu(sparc) || !#machine(sparc)))
+# error
+# endif
+#elif #cpu(sparc64) || #machine(sparc64) || #cpu(sparc) || #machine(sparc)
+# error
+#endif
+
+#if defined __xstormy16__
+# if !#cpu(xstormy16) || !#machine(xstormy16)
+# error
+# endif
+#elif #cpu(xstormy16) || #machine(xstormy16)
+# error
+#endif
+
+#if defined __v850__
+# if !#cpu(v850) || !#machine(v850)
+# error
+# endif
+#elif #cpu(v850) || #machine(v850)
+# error
+#endif
+
+#if defined __vax__
+# if !#cpu(vax) || !#machine(vax)
+# error
+# endif
+#elif #cpu(vax) || #machine(vax)
+# error
+#endif
+
+#if defined __XTENSA__
+# if !#cpu(xtensa) || !#machine(xtensa)
+# error
+# endif
+#elif #cpu(xtensa) || #machine(xtensa)
+# error
+#endif
+
diff --git a/gcc/testsuite/gcc.dg/cpp/lexident.c b/gcc/testsuite/gcc.dg/cpp/lexident.c
index c914023b0fd..fdf54a2e2c5 100644
--- a/gcc/testsuite/gcc.dg/cpp/lexident.c
+++ b/gcc/testsuite/gcc.dg/cpp/lexident.c
@@ -1,7 +1,7 @@
/* Copyright (C) 2000 Free Software Foundation, Inc. */
/* { dg-do preprocess } */
-/* { dg-options "-trigraphs" } */
+/* { dg-options "-trigraphs -fdollars-in-identifiers" } */
/* Test lexing of identifiers. */
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/macro.c b/gcc/testsuite/gcc.dg/cpp/trad/macro.c
new file mode 100644
index 00000000000..164b4ecfee6
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/trad/macro.c
@@ -0,0 +1,11 @@
+/* Test that varargs are rejected, and that we don't complain about
+ macro args in skipped blocks. */
+
+/* { dg-do preprocess } */
+
+#define f(x)
+#define g(x, y...) /* { dg-error "macro parameter list" } */
+
+#if 0
+#define f(a,b) /* { dg-bogus "passed 2 arguments" } */
+#endif
diff --git a/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c b/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c
new file mode 100644
index 00000000000..21220d1db68
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/trad/xwin1.c
@@ -0,0 +1,13 @@
+/* XWindows (as of 4.3) does some pretty strange things with cpp.
+ This tests one of them; the leading comments are supposed to be
+ eaten by the preprocessor; but the 'directives' after them are
+ supposed to be retained as text, not processed, so that imake's cpp
+ can be run on the output!
+ { dg-do preprocess }
+*/
+
+/**/#if 0
+passed
+/**/#endif
+
+/* { dg-final { scan-file xwin1.i "(^|\n)#if 0" } } */
diff --git a/gcc/testsuite/gcc.dg/darwin-abi-1.c b/gcc/testsuite/gcc.dg/darwin-abi-1.c
index c7c0288e8bb..3b13c6236b1 100644
--- a/gcc/testsuite/gcc.dg/darwin-abi-1.c
+++ b/gcc/testsuite/gcc.dg/darwin-abi-1.c
@@ -1,6 +1,6 @@
/* { dg-do compile { target powerpc*-*-darwin* } } */
/* { dg-options "-O" } */
-/* { dg-final { scan-assembler "li r3,12345\n\tbl " } } */
+/* { dg-final { scan-assembler "li r3,12345\n\t(bl|jbsr) " } } */
/* Check that zero-size structures don't affect parameter passing. */
diff --git a/gcc/testsuite/gcc.dg/darwin-misaligned.c b/gcc/testsuite/gcc.dg/darwin-misaligned.c
new file mode 100644
index 00000000000..5b89f574b76
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/darwin-misaligned.c
@@ -0,0 +1,32 @@
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O2 -force_cpusubtype_ALL -mpowerpc64" } */
+
+typedef struct Nlm_rect {
+ short sh1;
+ short sh2;
+ short sh3;
+ short sh4;
+} S8;
+
+typedef struct udv_mouse_select {
+ short Action_type;
+ S8 rcClip;
+ int pgp;
+ } UDVselect;
+
+UDVselect ms;
+int UDV(S8 rcClip);
+
+int main()
+{
+ ms.rcClip.sh1 = 1;
+ ms.rcClip.sh4 = 4;
+ return UDV(ms.rcClip);
+}
+
+int UDV(S8 rcClip){
+
+ return !(rcClip.sh1 == 1 && rcClip.sh4 == 4);
+}
+
+
diff --git a/gcc/testsuite/gcc.dg/debug/debug-1.c b/gcc/testsuite/gcc.dg/debug/debug-1.c
index b413eb7223f..8cc520dcd79 100644
--- a/gcc/testsuite/gcc.dg/debug/debug-1.c
+++ b/gcc/testsuite/gcc.dg/debug/debug-1.c
@@ -3,7 +3,9 @@
/* { dg-options "-dA" } */
/* { dg-final { scan-assembler "xyzzy" } } */
-long foo(long p)
+long p;
+
+long foo(void)
{
{
long xyzzy = 0;
diff --git a/gcc/testsuite/gcc.dg/debug/debug-2.c b/gcc/testsuite/gcc.dg/debug/debug-2.c
index e11b7b0fc1f..b164ff97734 100644
--- a/gcc/testsuite/gcc.dg/debug/debug-2.c
+++ b/gcc/testsuite/gcc.dg/debug/debug-2.c
@@ -3,7 +3,9 @@
/* { dg-options "-dA" } */
/* { dg-final { scan-assembler "xyzzy" } } */
-long foo(long p)
+long p;
+
+long foo(void)
{
if (1)
{
diff --git a/gcc/testsuite/gcc.dg/debug/debug-7.c b/gcc/testsuite/gcc.dg/debug/debug-7.c
new file mode 100644
index 00000000000..d424e91f304
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/debug/debug-7.c
@@ -0,0 +1,16 @@
+/* { dg-do compile } */
+/* { dg-options "-dA" } */
+/* PR debug/12934. */
+
+static inline int foo ()
+{
+ return 42;
+}
+
+void bar (int *);
+
+void baz ()
+{
+ int a[foo ()];
+ bar (a);
+}
diff --git a/gcc/testsuite/gcc.dg/format/c90-strftime-1.c b/gcc/testsuite/gcc.dg/format/c90-strftime-1.c
index 0d75e9194db..1739f7b75ee 100644
--- a/gcc/testsuite/gcc.dg/format/c90-strftime-1.c
+++ b/gcc/testsuite/gcc.dg/format/c90-strftime-1.c
@@ -1,7 +1,7 @@
/* Test for strftime formats. Formats using C90 features. */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
-/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/format/c90-strftime-2.c b/gcc/testsuite/gcc.dg/format/c90-strftime-2.c
index 9742e44d055..8b8398ed930 100644
--- a/gcc/testsuite/gcc.dg/format/c90-strftime-2.c
+++ b/gcc/testsuite/gcc.dg/format/c90-strftime-2.c
@@ -2,7 +2,7 @@
pedantic C90 mode. */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
-/* { dg-options "-std=iso9899:1990 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1990 -pedantic -Wformat -Wformat-y2k" } */
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
index a643d2999a6..1730738df42 100644
--- a/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
+++ b/gcc/testsuite/gcc.dg/format/c99-strftime-1.c
@@ -1,7 +1,7 @@
/* Test for strftime formats. Formats using C99 features. */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
-/* { dg-options "-std=iso9899:1999 -pedantic -Wformat" } */
+/* { dg-options "-std=iso9899:1999 -pedantic -Wformat -Wformat-y2k" } */
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/format/ext-1.c b/gcc/testsuite/gcc.dg/format/ext-1.c
index e69e756085c..3b020892afd 100644
--- a/gcc/testsuite/gcc.dg/format/ext-1.c
+++ b/gcc/testsuite/gcc.dg/format/ext-1.c
@@ -92,7 +92,7 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
*/
printf ("%*2$.*1$m", i, i);
printf ("%1$*2$.*1$m", i, i); /* { dg-warning "no argument" "printf %1\$m" } */
- /* As an extension, glibc includes the "I" flag for decimal integer
+ /* As an extension, glibc includes the "I" flag for decimal
formats, to output using the locale's digits (e.g. in Arabic).
In GCC, we require this to be in the standard place for flags, though
glibc allows it also after width or precision.
@@ -102,12 +102,12 @@ foo (quad_t q, u_quad_t uq, quad_t *qn, size_t z, size_t *zn, long long int ll,
printf ("%Ix", u); /* { dg-warning "flag" "bad use of I flag" } */
printf ("%IX", u); /* { dg-warning "flag" "bad use of I flag" } */
printf ("%In", n); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%If", d); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%IF", d); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%Ie", d); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%IE", d); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%Ig", d); /* { dg-warning "flag" "bad use of I flag" } */
- printf ("%IG", d); /* { dg-warning "flag" "bad use of I flag" } */
+ printf ("%If", d);
+ printf ("%IF", d);
+ printf ("%Ie", d);
+ printf ("%IE", d);
+ printf ("%Ig", d);
+ printf ("%IG", d);
printf ("%Ia", d); /* { dg-warning "flag" "bad use of I flag" } */
printf ("%IA", d); /* { dg-warning "flag" "bad use of I flag" } */
printf ("%Ic", i); /* { dg-warning "flag" "bad use of I flag" } */
diff --git a/gcc/testsuite/gcc.dg/format/ext-3.c b/gcc/testsuite/gcc.dg/format/ext-3.c
index e71731ed987..937e11212f7 100644
--- a/gcc/testsuite/gcc.dg/format/ext-3.c
+++ b/gcc/testsuite/gcc.dg/format/ext-3.c
@@ -3,7 +3,7 @@
*/
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
-/* { dg-options "-std=gnu99 -Wformat" } */
+/* { dg-options "-std=gnu99 -Wformat -Wformat-y2k" } */
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/format/no-y2k-1.c b/gcc/testsuite/gcc.dg/format/no-y2k-1.c
index ee68cd6db9f..4dfd5a04ebd 100644
--- a/gcc/testsuite/gcc.dg/format/no-y2k-1.c
+++ b/gcc/testsuite/gcc.dg/format/no-y2k-1.c
@@ -1,7 +1,7 @@
-/* Test for warnings for Y2K problems being disabled by -Wno-format-y2k. */
+/* Test for warnings for Y2K problems not being on by default. */
/* Origin: Joseph Myers <jsm28@cam.ac.uk> */
/* { dg-do compile } */
-/* { dg-options "-std=gnu99 -Wformat -Wno-format-y2k" } */
+/* { dg-options "-std=gnu99 -Wformat" } */
#include "format.h"
diff --git a/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c b/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
index 0780b050bdd..8d4a083e5d8 100644
--- a/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
+++ b/gcc/testsuite/gcc.dg/i386-pentium4-not-mull.c
@@ -1,5 +1,6 @@
/* { dg-do compile { target i?86-*-* x86_64-*-* } } */
-/* { dg-options "-O2 -march=pentium4" } */
+/* { dg-options "-O2 -march=pentium4" { target i?86-*-* } } */
+/* { dg-options "-O2 -march=pentium4 -m32" { target x86_64-*-* } } */
/* { dg-final { scan-assembler-not "imull" } } */
/* Should be done not using imull. */
diff --git a/gcc/testsuite/gcc.dg/intermod-1.c b/gcc/testsuite/gcc.dg/intermod-1.c
index 296adf976cb..9f8d19deb6a 100644
--- a/gcc/testsuite/gcc.dg/intermod-1.c
+++ b/gcc/testsuite/gcc.dg/intermod-1.c
@@ -1,5 +1,5 @@
/* { dg-do compile } */
-/* { dg-final { scan-assembler-not {foo[1-9]\.} } } */
+/* { dg-final { scan-assembler-not {foo[1-9]\.[0-9]} } } */
/* Check that we don't get .0 suffixes on static variables when not using
intermodule analysis. */
diff --git a/gcc/testsuite/gcc.dg/macho-lo-sum.c b/gcc/testsuite/gcc.dg/macho-lo-sum.c
new file mode 100644
index 00000000000..094b9607685
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/macho-lo-sum.c
@@ -0,0 +1,29 @@
+/* { dg-do compile { target powerpc*-*-darwin* } } */
+/* { dg-options "-O2 -force_cpusubtype_ALL -mpowerpc64 -mdynamic-no-pic" } */
+
+long long knight_attacks[64];
+long long InitializeAttackBoards(void);
+
+int main()
+{
+ return InitializeAttackBoards();
+}
+
+long long InitializeAttackBoards(void)
+{
+
+ int i,j;
+
+ for(i=0;i<64;i++) { }
+
+ for(i=0;i<64;i++) {
+ knight_attacks[i]=0;
+ for(j=0;j<8;j++) {
+ knight_attacks[i]= 0;
+ }
+ }
+
+ return knight_attacks[0];
+
+}
+
diff --git a/gcc/testsuite/gcc.dg/nest.c b/gcc/testsuite/gcc.dg/nest.c
index 4cc058d217a..872feade581 100644
--- a/gcc/testsuite/gcc.dg/nest.c
+++ b/gcc/testsuite/gcc.dg/nest.c
@@ -1,8 +1,9 @@
/* PR 5967, PR 7114 */
/* { dg-do run } */
+/* { dg-require-profiling "" } */
/* { dg-options "-O2 -pg" } */
/* { dg-options "-O2 -pg -static" { target hppa*-*-hpux* } } */
-/* { dg-error "profiler" "No profiler support" { target mmix-*-* xstormy16-*-* *-*-windiss } 0 } */
+/* { dg-error "profiler" "No profiler support" { target xstormy16-*-* } 0 } */
/* Support for -pg on irix relies on gcrt1.o which doesn't exist yet.
See: http://gcc.gnu.org/ml/gcc/2002-10/msg00169.html */
/* { dg-error "gcrt1.o" "Profiler support missing" { target mips*-*-irix* } 0 } */
diff --git a/gcc/testsuite/gcc.dg/nested-func-1.c b/gcc/testsuite/gcc.dg/nested-func-1.c
new file mode 100644
index 00000000000..cb26e895e5c
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/nested-func-1.c
@@ -0,0 +1,35 @@
+/* Test for proper errors for break and continue in nested functions. */
+/* Origin: Joseph Myers <jsm@polyomino.org.uk> */
+/* { dg-do compile } */
+/* { dg-options "" } */
+
+void
+foo (int a)
+{
+ switch (a) {
+ void bar1 (void) { break; } /* { dg-error "break statement" "break switch 1" } */
+ }
+ switch (a) {
+ case 0:
+ (void) 0;
+ void bar2 (void) { break; } /* { dg-error "break statement" "break switch 2" } */
+ }
+ while (1) {
+ void bar3 (void) { break; } /* { dg-error "break statement" "break while" } */
+ }
+ do {
+ void bar4 (void) { break; } /* { dg-error "break statement" "break do" } */
+ } while (1);
+ for (;;) {
+ void bar5 (void) { break; } /* { dg-error "break statement" "break for" } */
+ }
+ while (1) {
+ void bar6 (void) { continue; } /* { dg-error "continue statement" "continue while" } */
+ }
+ do {
+ void bar7 (void) { continue; } /* { dg-error "continue statement" "continue do" } */
+ } while (1);
+ for (;;) {
+ void bar8 (void) { continue; } /* { dg-error "continue statement" "continue for" } */
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/noreturn-7.c b/gcc/testsuite/gcc.dg/noreturn-7.c
new file mode 100644
index 00000000000..1d94a7ccea5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/noreturn-7.c
@@ -0,0 +1,42 @@
+/* PR optimization/13394 */
+/* Origin: Carlo Wood <carlo@gcc.gnu.org> */
+
+/* Verify that a bogus "function does return" warning is not issued
+ in presence of tail recursion within a noreturn function. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2 -Wreturn-type -Wmissing-noreturn" } */
+
+
+void f(void) __attribute__ ((__noreturn__));
+void _exit(int status) __attribute__ ((__noreturn__));
+
+int z = 0;
+
+void g()
+{
+ if (++z > 10)
+ _exit(0);
+ g();
+} /* { dg-warning "possible candidate" } */
+
+void f()
+{
+ if (++z > 10)
+ _exit(0);
+ f();
+} /* { dg-bogus "does return" } */
+
+int h()
+{
+ if (++z > 10)
+ _exit(0);
+ return h();
+} /* { dg-bogus "end of non-void function" } */
+
+int k()
+{
+ if (++z > 10)
+ _exit(0);
+ k();
+} /* { dg-warning "end of non-void function" } */
diff --git a/gcc/testsuite/gcc.dg/null-pointer-1.c b/gcc/testsuite/gcc.dg/null-pointer-1.c
new file mode 100644
index 00000000000..8cc15c6d866
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/null-pointer-1.c
@@ -0,0 +1,20 @@
+/* PR c/13382 */
+/* Origin: Richard Hutchinson <richard.hutchinson@asa.co.uk> */
+
+/* Verify that the null initializer is converted to the right
+ pointer type. */
+
+/* { dg-do compile } */
+/* { dg-options "-O" } */
+
+struct t
+{
+ int aMember;
+};
+
+struct t *const aPointer = 0;
+
+void foo()
+{
+ int anInt = (aPointer == 0) ? 0 : aPointer->aMember;
+}
diff --git a/gcc/testsuite/gcc.dg/overflow-1.c b/gcc/testsuite/gcc.dg/overflow-1.c
new file mode 100644
index 00000000000..db51a5ef129
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/overflow-1.c
@@ -0,0 +1,25 @@
+/* PR optimization/13318 */
+/* Origin: <bremner@unb.ca> */
+/* Reduced testcase: Wolfgang Bangerth <bangerth@dealii.org> */
+
+/* Verify that the big multiplier doesn't cause an integer
+ overflow in the loop optimizer. */
+
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+struct S {
+ int key;
+ int rnext,rprev;
+};
+
+void foo(struct S* H)
+{
+ int i, k;
+ for (i=0; i<2; i++){
+ struct S* cell=H+k;
+ cell->key=i*(0xffffffffUL/2);
+ cell->rnext=k+(1-i);
+ cell->rprev=k+(1-i);
+ }
+}
diff --git a/gcc/testsuite/gcc.dg/pch/warn-1.c b/gcc/testsuite/gcc.dg/pch/warn-1.c
index 779577dd8ae..6e895818c63 100644
--- a/gcc/testsuite/gcc.dg/pch/warn-1.c
+++ b/gcc/testsuite/gcc.dg/pch/warn-1.c
@@ -2,7 +2,7 @@
#define DEFINED_VALUE 3
-#include "warn-1.h"/* { dg-error "not used because `DEFINED_VALUE' is defined|No such file" } */
+#include "warn-1.h"/* { dg-error "not used because `DEFINED_VALUE' is defined|No such file|they were invalid" } */
int main(void)
{
diff --git a/gcc/testsuite/gcc.dg/ppc-stackalign-1.c b/gcc/testsuite/gcc.dg/ppc-stackalign-1.c
new file mode 100644
index 00000000000..17f3c59d0f1
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ppc-stackalign-1.c
@@ -0,0 +1,34 @@
+/* { dg-do run { target powerpc-*-linux* powerpc-*-sysv* } } */
+
+/* Test stack pointer alignment against variable alloca. */
+/* Inspired by PR libgcj/10610. */
+/* Origin: Franz Sirl <Franz.Sirl-kernel@lauterbach.com>. */
+
+extern void abort (void);
+extern void exit (int);
+
+register unsigned long sp __asm__ ("r1");
+
+void g (int * val __attribute__ ((unused)))
+{
+ if (sp & 0xf)
+ abort ();
+}
+
+void f (int val)
+{
+ int *val1 = __builtin_alloca (val);
+
+ g (val1);
+ return;
+}
+
+int main (void)
+{
+ int i;
+
+ for (i = 1; i < 32; i++)
+ f (i);
+
+ exit (0);
+}
diff --git a/gcc/testsuite/gcc.dg/tls/asm-1.c b/gcc/testsuite/gcc.dg/tls/asm-1.c
new file mode 100644
index 00000000000..68c49f61180
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/tls/asm-1.c
@@ -0,0 +1,7 @@
+/* { dg-options "-Werror" } */
+__thread int i;
+
+int foo ()
+{
+ asm volatile ("" :: "m" (&i)); /* { dg-error "lvalue" } */
+}
diff --git a/gcc/testsuite/gcc.dg/trampoline-1.c b/gcc/testsuite/gcc.dg/trampoline-1.c
new file mode 100644
index 00000000000..dbbd8509bff
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/trampoline-1.c
@@ -0,0 +1,50 @@
+/* PR target/12865 */
+/* Origin: Waldek Hebisch <hebisch@math.uni.wroc.pl> */
+
+/* { dg-do run } */
+/* { dg-options "-O2" } */
+
+/* This used to fail on various versions of Solaris 2 because the
+ trampoline couldn't be made executable. */
+
+extern void abort(void);
+
+void foo (void)
+{
+ const int correct[1100] = {1, 0, -2, 0, 1, 0, 1, -1, -10, -30, -67};
+ int i;
+
+ double x1 (void) {return 1; }
+ double x2 (void) {return -1;}
+ double x3 (void) {return -1;}
+ double x4 (void) {return 1; }
+ double x5 (void) {return 0; }
+
+ typedef double pfun(void);
+
+ double a (int k, pfun x1, pfun x2, pfun x3, pfun x4, pfun x5)
+ {
+ double b (void)
+ {
+ k = k - 1;
+ return a (k, b, x1, x2, x3, x4 );
+ }
+
+ if (k <= 0)
+ return x4 () + x5 ();
+ else
+ return b ();
+ }
+
+ for (i=0; i<=10; i++)
+ {
+ if (fabs(a( i, x1, x2, x3, x4, x5 ) - correct [i]) > 0.1)
+ abort();
+ }
+}
+
+int main (void)
+{
+ foo ();
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/unaligned-1.c b/gcc/testsuite/gcc.dg/unaligned-1.c
new file mode 100644
index 00000000000..5df1b37e363
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/unaligned-1.c
@@ -0,0 +1,49 @@
+/* PR middle-end/7847 */
+/* Originator: <jk@tools.de> */
+/* { dg-do run } */
+
+/* This used to fail on SPARC at runtime because of
+ an unaligned memory access. */
+
+typedef char int8_t;
+typedef short int16_t;
+typedef int int32_t;
+typedef unsigned char uint8_t;
+typedef unsigned short uint16_t;
+typedef unsigned int uint32_t;
+
+typedef struct {
+ uint32_t address;
+ uint16_t size;
+} __attribute__ ((packed)) sml_agl_data_t;
+
+typedef struct {
+ sml_agl_data_t data[9];
+} __attribute__ ((packed)) sml_agli_t;
+
+typedef struct {
+ sml_agli_t sml_agli;
+} __attribute__ ((packed)) dsi_t;
+
+typedef struct {
+ int a;
+ dsi_t dsi_pack;
+} dvd_priv_t;
+
+int dvd_read_sector(dvd_priv_t *d, unsigned char* data)
+{
+ int i, skip=0;
+
+ for (i=0; i < 9; i++)
+ if ((skip=d->dsi_pack.sml_agli.data[i].address) != 0)
+ break;
+
+ return skip;
+}
+
+int main(void)
+{
+ static dvd_priv_t dvd_priv;
+ dvd_read_sector(&dvd_priv, 0);
+ return 0;
+}
diff --git a/gcc/testsuite/gcc.dg/uninit-C.c b/gcc/testsuite/gcc.dg/uninit-C.c
index ddef41cbf79..3ecbf8ae43a 100644
--- a/gcc/testsuite/gcc.dg/uninit-C.c
+++ b/gcc/testsuite/gcc.dg/uninit-C.c
@@ -4,7 +4,7 @@
/* Not all platforms support TImode integers. */
#if defined(__LP64__) || defined(__sparc__)
-typedef int TItype __attribute__ ((mode (TI)));
+typedef int TItype __attribute__ ((mode (TI))); /* { dg-error "no data type for mode" "TI" { target sparc-sun-solaris2.[0-6]* } } */
#else
typedef long TItype;
#endif
diff --git a/gcc/testsuite/gcc.dg/unused-4.c b/gcc/testsuite/gcc.dg/unused-4.c
index 53236008007..99e845f45a3 100644
--- a/gcc/testsuite/gcc.dg/unused-4.c
+++ b/gcc/testsuite/gcc.dg/unused-4.c
@@ -1,6 +1,6 @@
/* { dg-do compile } */
/* { dg-options "-Wunused -O3" } */
-static const int i = 0; /* { dg-warning "defined but not used" } */
+static const int i = 0;
static void f() { } /* { dg-warning "defined but not used" } */
static inline void g() { }
diff --git a/gcc/testsuite/gcc.dg/visibility-1.c b/gcc/testsuite/gcc.dg/visibility-1.c
new file mode 100644
index 00000000000..f76c3ca9154
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-1.c
@@ -0,0 +1,9 @@
+/* Test visibility attribute on function definition. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*foo" } } */
+
+void
+__attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc/testsuite/gcc.dg/visibility-2.c b/gcc/testsuite/gcc.dg/visibility-2.c
new file mode 100644
index 00000000000..e62dbbb4cd5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-2.c
@@ -0,0 +1,10 @@
+/* Test that visibility attribute on declaration extends to definition. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*foo" } } */
+
+void
+__attribute__((visibility ("hidden")))
+foo();
+
+void foo() { }
diff --git a/gcc/testsuite/gcc.dg/visibility-3.c b/gcc/testsuite/gcc.dg/visibility-3.c
new file mode 100644
index 00000000000..e0bf01fb130
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-3.c
@@ -0,0 +1,8 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc/testsuite/gcc.dg/visibility-4.c b/gcc/testsuite/gcc.dg/visibility-4.c
new file mode 100644
index 00000000000..1a0b3ca37da
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-4.c
@@ -0,0 +1,10 @@
+/* Test visibility attribute on forward declaration of global variable */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int
+__attribute__((visibility ("hidden")))
+xyzzy;
+
+int xyzzy = 5;
diff --git a/gcc/testsuite/gcc.dg/visibility-5.c b/gcc/testsuite/gcc.dg/visibility-5.c
new file mode 100644
index 00000000000..b1f46d2040a
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-5.c
@@ -0,0 +1,12 @@
+/* Test visibility attribute on definition of a function that has
+ already had a forward declaration. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*foo" } } */
+
+void foo();
+
+void
+ __attribute__((visibility ("hidden")))
+foo()
+{ }
diff --git a/gcc/testsuite/gcc.dg/visibility-6.c b/gcc/testsuite/gcc.dg/visibility-6.c
new file mode 100644
index 00000000000..632f2ac2059
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-6.c
@@ -0,0 +1,11 @@
+/* Test visibility attribute on definition of global variable that has
+ already had a forward declaration. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int xyzzy;
+
+int
+__attribute__((visibility ("hidden")))
+xyzzy = 5;
diff --git a/gcc/testsuite/gcc.dg/visibility-7.c b/gcc/testsuite/gcc.dg/visibility-7.c
new file mode 100644
index 00000000000..e98b432c827
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/visibility-7.c
@@ -0,0 +1,12 @@
+/* Test warning from conflicting visibility specifications. */
+/* { dg-do compile } */
+/* { dg-require-visibility "" } */
+/* { dg-final { scan-assembler "\\.hidden.*xyzzy" } } */
+
+extern int
+__attribute__((visibility ("hidden")))
+xyzzy; /* { dg-warning "previous declaration here" "" } */
+
+int
+__attribute__((visibility ("protected")))
+xyzzy = 5; /* { dg-warning "visibility attribute ignored" "" } */
diff --git a/gcc/testsuite/gcc.dg/warn-1.c b/gcc/testsuite/gcc.dg/warn-1.c
index 5039abcb8a5..9d0080171d2 100644
--- a/gcc/testsuite/gcc.dg/warn-1.c
+++ b/gcc/testsuite/gcc.dg/warn-1.c
@@ -5,14 +5,12 @@
static void foo (p)
int p;
-{ /* { dg-warning "passing arg of" } */
+{ /* { dg-warning "passing arg 1 of" } */
}
-static void bar (void)
+void bar (void)
{
void *vp;
foo (vp); /* { dg-warning "" } */
}
-
-void (*tourist_guide[]) (void) = { &bar };
diff --git a/gcc/testsuite/gcc.misc-tests/bprob.exp b/gcc/testsuite/gcc.misc-tests/bprob.exp
index c0035f0a47e..5afbdb1c847 100644
--- a/gcc/testsuite/gcc.misc-tests/bprob.exp
+++ b/gcc/testsuite/gcc.misc-tests/bprob.exp
@@ -17,11 +17,11 @@
# Test the functionality of programs compiled with profile-directed block
# ordering using -fprofile-arcs followed by -fbranch-probabilities.
+load_lib target-supports.exp
+
# Some targets don't have any implementation of __bb_init_func or are
# missing other needed machinery.
-if { [istarget mmix-*-*]
- || [istarget cris-*-*]
- || [istarget h8300-*-*] } {
+if { ![check_profiling_available] } {
return
}
diff --git a/gcc/testsuite/lib/compat.exp b/gcc/testsuite/lib/compat.exp
index 2926d0be680..bf40c6eee39 100644
--- a/gcc/testsuite/lib/compat.exp
+++ b/gcc/testsuite/lib/compat.exp
@@ -50,6 +50,7 @@ if ![info exists COMPAT_OPTIONS] {
set option_list $COMPAT_OPTIONS
load_lib dg.exp
+load_lib gcc-dg.exp
#
# compat-obj -- compile to an object file
@@ -59,15 +60,18 @@ load_lib dg.exp
# OPTALL is the list of compiler options to use with all tests
# OPTFILE is the list of compiler options to use with this file
# OPTSTR is the options to print with test messages
+# XFAILDATA is the xfail data to be passed to the compiler
#
-proc compat-obj { source dest optall optfile optstr } {
+proc compat-obj { source dest optall optfile optstr xfaildata } {
global testcase
global tool
+ global compiler_conditional_xfail_data
# Set up the options for compiling this file.
set options ""
lappend options "additional_flags=$optfile $optall"
+ set compiler_conditional_xfail_data $xfaildata
set comp_output [${tool}_target_compile "$source" "$dest" object $options]
${tool}_check_compile "$testcase $dest compile" $optstr $dest $comp_output
}
@@ -120,7 +124,7 @@ proc compat-run { testname objlist dest optall optfile optstr } {
}
#
-# compat-flags -- get special tool flags to use for a source file
+# compat-get-options -- get special tool flags to use for a source file
#
# SRC is the full patchname of the source file.
# The result is a list of options to use.
@@ -138,10 +142,15 @@ proc compat-get-options { src } {
# dg-options sets a variable called dg-extra-tool-flags.
set dg-extra-tool-flags ""
+
+ # dg-xfail-if sets compiler_conditional_xfail_data.
+ global compiler_conditional_xfail_data
+ set compiler_conditional_xfail_data ""
+
set tmp [dg-get-options $src]
foreach op $tmp {
set cmd [lindex $op 0]
- if ![string compare "dg-options" $cmd] {
+ if { ![string compare "dg-options" $cmd] || ![string compare "dg-xfail-if" $cmd] } {
set status [catch "$op" errmsg]
if { $status != 0 } {
perror "src: $errmsg for \"$op\"\n"
@@ -176,6 +185,7 @@ proc compat-execute { src1 sid use_alt } {
global verbose
global testcase
global gluefile
+ global compiler_conditional_xfail_data
# Set up the names of the other source files.
regsub "_main.*" $src1 "" base
@@ -188,7 +198,9 @@ proc compat-execute { src1 sid use_alt } {
# extra flags in *_main.* are also used for linking.
set extra_flags_1 [compat-get-options $src1]
set extra_flags_2 [compat-get-options $src2]
+ set compile_xfail_2 $compiler_conditional_xfail_data
set extra_flags_3 [compat-get-options $src3]
+ set compile_xfail_3 $compiler_conditional_xfail_data
# Define the names of the object files.
regsub "sid" "sid_main_tst.o" $sid obj1
@@ -243,15 +255,15 @@ proc compat-execute { src1 sid use_alt } {
# later. Skip this if we don't have an alternate compiler.
if { $use_alt != 0 } then {
compat-use-alt-compiler
- compat-obj "$src2" "$obj2_alt" $alt_option $extra_flags_2 $optstr
- compat-obj "$src3" "$obj3_alt" $alt_option $extra_flags_3 $optstr
+ compat-obj "$src2" "$obj2_alt" $alt_option $extra_flags_2 $optstr $compile_xfail_2
+ compat-obj "$src3" "$obj3_alt" $alt_option $extra_flags_3 $optstr $compile_xfail_3
}
# Compile pieces with the compiler under test.
compat-use-tst-compiler
- compat-obj "$src1" "$obj1" $tst_option $extra_flags_1 $optstr
- compat-obj "$src2" "$obj2_tst" $tst_option $extra_flags_2 $optstr
- compat-obj "$src3" "$obj3_tst" $tst_option $extra_flags_3 $optstr
+ compat-obj "$src1" "$obj1" $tst_option $extra_flags_1 $optstr ""
+ compat-obj "$src2" "$obj2_tst" $tst_option $extra_flags_2 $optstr $compile_xfail_2
+ compat-obj "$src3" "$obj3_tst" $tst_option $extra_flags_3 $optstr $compile_xfail_3
# Link (using the compiler under test), run, and clean up tests.
compat-run "${obj2_tst}-${obj3_tst}" \
diff --git a/gcc/testsuite/lib/g++.exp b/gcc/testsuite/lib/g++.exp
index 81ac484ae29..8b30b60af14 100644
--- a/gcc/testsuite/lib/g++.exp
+++ b/gcc/testsuite/lib/g++.exp
@@ -49,7 +49,7 @@ proc g++_version { } {
set tmp [remote_exec host "$compiler -v"]
set status [lindex $tmp 0];
set output [lindex $tmp 1];
- regexp "version.*$" $output version
+ regexp "version\[^\n\r\]*" $output version
if { $status == 0 && [info exists version] } then {
if [is_remote host] {
clone_output "$compiler $version\n"
@@ -172,10 +172,14 @@ proc g++_link_flags { paths } {
# unix.exp -- but that's not an option since it's part of DejaGNU
# proper, so we do it here. We really only need to do
# this on IRIX, but it shouldn't hurt to do it anywhere else.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
+ # Doing this does cause trouble when testing cross-compilers.
+ if {![is_remote target]} {
+ setenv LD_LIBRARY_PATH $ld_library_path
+ setenv SHLIB_PATH $ld_library_path
+ setenv LD_LIBRARYN32_PATH $ld_library_path
+ setenv LD_LIBRARY64_PATH $ld_library_path
+ setenv DYLD_LIBRARY_PATH $ld_library_path
+ }
return "$flags"
}
@@ -196,6 +200,7 @@ proc g++_init { args } {
global TOOL_EXECUTABLE TOOL_OPTIONS
global GXX_UNDER_TEST
global TESTING_IN_BUILD_TREE
+ global target_triplet
if ![info exists GXX_UNDER_TEST] then {
if [info exists TOOL_EXECUTABLE] {
@@ -259,6 +264,10 @@ proc g++_init { args } {
# error-message parsing machinery.
lappend ALWAYS_CXXFLAGS "additional_flags=-fmessage-length=0"
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ lappend ALWAYS_CXXFLAGS "ldflags=-multiply_defined suppress"
+ }
+
verbose -log "ALWAYS_CXXFLAGS set to $ALWAYS_CXXFLAGS"
verbose "g++ is initialized" 3
diff --git a/gcc/testsuite/lib/g77.exp b/gcc/testsuite/lib/g77.exp
index 8f20eb48cc8..f8c517163bf 100644
--- a/gcc/testsuite/lib/g77.exp
+++ b/gcc/testsuite/lib/g77.exp
@@ -50,7 +50,7 @@ proc g77_version { } {
set tmp [remote_exec host "$compiler -v"]
set status [lindex $tmp 0];
set output [lindex $tmp 1];
- regexp "version.*$" $output version
+ regexp "version\[^\n\r\]*" $output version
if { $status == 0 && [info exists version] } then {
if [is_remote host] {
clone_output "$compiler $version\n"
@@ -120,6 +120,7 @@ proc g77_link_flags { paths } {
setenv SHLIB_PATH $ld_library_path
setenv LD_LIBRARYN32_PATH $ld_library_path
setenv LD_LIBRARY64_PATH $ld_library_path
+ setenv DYLD_LIBRARY_PATH $ld_library_path
return "$flags"
}
diff --git a/gcc/testsuite/lib/gcc-dg.exp b/gcc/testsuite/lib/gcc-dg.exp
index ee1d4d84a64..c6776679389 100644
--- a/gcc/testsuite/lib/gcc-dg.exp
+++ b/gcc/testsuite/lib/gcc-dg.exp
@@ -130,8 +130,17 @@ proc gcc-dg-test { prog do_what extra_tool_flags } {
}
proc gcc-dg-prune { system text } {
+ global additional_prunes
+
set text [prune_gcc_output $text]
+ foreach p $additional_prunes {
+ if { [string length $p] > 0 } {
+ # Following regexp matches a complete line containing $p.
+ regsub -all "(^|\n)\[^\n\]*$p\[^\n\]*" $text "" 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.
@@ -237,7 +246,7 @@ proc gcc-dg-debug-runtest { target_compile trivial opt_opts testcases } {
# assembler output, but stabs debugging does not.
# http://gcc.gnu.org/ml/gcc-regression/2003-04/msg00095.html
if { [string match {*/debug-[12].c} "$nshort"] \
- && [string match "*O3*" "$flags"] \
+ && [string match "*O*" "$flags"] \
&& ( [string match "*coff*" "$flags"] \
|| [string match "*stabs*" "$flags"] ) } {
set doit 0
@@ -267,6 +276,23 @@ proc dg-require-weak { args } {
}
}
+# If this target does not support the "visibility" attribute, skip this
+# test.
+
+proc dg-require-visibility { args } {
+ upvar dg-do-what dg-do-what
+ upvar name name
+
+ set visibility_available [ check_visibility_available ]
+ if { $visibility_available == -1 } {
+ unresolved "$name"
+ }
+ if { $visibility_available != 1 } {
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ return
+ }
+}
+
# If this target does not support the "alias" attribute, skip this
# test.
@@ -295,6 +321,16 @@ proc dg-require-gc-sections { args } {
}
}
+# If this target does not support profiling, skip this test.
+
+proc dg-require-profiling { args } {
+ if { ![ check_profiling_available ] } {
+ upvar dg-do-what dg-do-what
+ set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
+ return
+ }
+}
+
# If this target does not support DLL attributes skip this test.
proc dg-require-dll { args } {
@@ -312,6 +348,18 @@ proc dg-require-dll { args } {
set dg-do-what [list [lindex ${dg-do-what} 0] "N" "P"]
}
+# Prune any messages matching ARGS[1] (a regexp) from test output.
+proc dg-prune-output { args } {
+ global additional_prunes
+
+ if { [llength $args] != 2 } {
+ error "[lindex $args 1]: need one argument"
+ return
+ }
+
+ lappend additional_prunes [lindex $args 1]
+}
+
# Like check_conditional_xfail, but callable from a dg test.
proc dg-xfail-if { args } {
@@ -324,11 +372,10 @@ proc dg-xfail-if { args } {
}
-# We need to make sure that additional_files and additional_sources
-# are both cleared out after every test. It is not enough to clear
-# them out *before* the next test run because gcc-target-compile gets
-# run directly from some .exp files (outside of any test). (Those
-# uses should eventually be eliminated.)
+# We need to make sure that additional_* are cleared out after every
+# test. It is not enough to clear them out *before* the next test run
+# because gcc-target-compile gets run directly from some .exp files
+# (outside of any test). (Those uses should eventually be eliminated.)
# Because the DG framework doesn't provide a hook that is run at the
# end of a test, we must replace dg-test with a wrapper.
@@ -339,15 +386,19 @@ if { [info procs saved-dg-test] == [list] } {
proc dg-test { args } {
global additional_files
global additional_sources
+ global additional_prunes
global errorInfo
if { [ catch { eval saved-dg-test $args } errmsg ] } {
set saved_info $errorInfo
set additional_files ""
set additional_sources ""
+ set additional_prunes ""
error $errmsg $saved_info
}
set additional_files ""
set additional_sources ""
+ set additional_prunes ""
}
}
+set additional_prunes ""
diff --git a/gcc/testsuite/lib/gcc.exp b/gcc/testsuite/lib/gcc.exp
index 29c687be2c9..ac4dc35e8e9 100644
--- a/gcc/testsuite/lib/gcc.exp
+++ b/gcc/testsuite/lib/gcc.exp
@@ -56,7 +56,7 @@ proc default_gcc_version { } {
set tmp [remote_exec host "$compiler -v"]
set status [lindex $tmp 0];
set output [lindex $tmp 1];
- regexp "version.*$" $output version
+ regexp "version\[^\n\r\]*" $output version
if { $status == 0 && [info exists version] } then {
clone_output "$compiler_name $version\n"
} else {
diff --git a/gcc/testsuite/lib/objc.exp b/gcc/testsuite/lib/objc.exp
index 1817c7022e8..14bdf133168 100644
--- a/gcc/testsuite/lib/objc.exp
+++ b/gcc/testsuite/lib/objc.exp
@@ -56,7 +56,7 @@ proc default_objc_version { } {
set tmp [remote_exec host "$compiler -v"]
set status [lindex $tmp 0];
set output [lindex $tmp 1];
- regexp "version.*$" $output version
+ regexp "version\[^\n\r\]*" $output version
if { $status == 0 && [info exists version] } then {
clone_output "$compiler_name $version\n"
} else {
@@ -194,6 +194,7 @@ proc objc_target_compile { source dest type options } {
setenv SHLIB_PATH $ld_library_path
setenv LD_LIBRARYN32_PATH $ld_library_path
setenv LD_LIBRARY64_PATH $ld_library_path
+ setenv DYLD_LIBRARY_PATH $ld_library_path
return [target_compile $source $dest $type $options]
}
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 38d416ccb77..bff0a4f4441 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -63,6 +63,30 @@ proc check_weak_available { } {
}
###############################
+# proc check_visibility_available { }
+###############################
+
+# The visibility attribute is only support in some object formats
+# This proc returns 1 if it is supported, 0 if not, -1 if unsure.
+
+proc check_visibility_available { } {
+ global target_triplet
+ global target_cpu
+
+ # ELF supports it if the system has recent GNU ld and gas.
+ # As a start we return 1 for all ELF systems; we'll let people
+ # add exceptions as necessary.
+
+ set objformat [gcc_target_object_format]
+
+ switch $objformat {
+ elf { return 1 }
+ unknown { return -1 }
+ default { return 0 }
+ }
+}
+
+###############################
# proc check_alias_available { }
###############################
@@ -137,3 +161,27 @@ proc check_gc_sections_available { } {
}
return $gc_sections_available_saved
}
+
+# Return true if profiling is supported on the target.
+
+proc check_profiling_available { } {
+ global profiling_available_saved
+
+ if {![info exists profiling_available_saved]} {
+ # Some targets don't have any implementation of __bb_init_func or are
+ # missing other needed machinery.
+ if { [istarget mmix-*-*]
+ || [istarget arm*-*-elf]
+ || [istarget strongarm*-*-elf]
+ || [istarget xscale*-*-elf]
+ || [istarget cris-*-*]
+ || [istarget h8300-*-*]
+ || [istarget *-*-windiss] } {
+ set profiling_available_saved 0
+ } else {
+ set profiling_available_saved 1
+ }
+ }
+
+ return $profiling_available_saved
+}
diff --git a/gcc/testsuite/objc.dg/proto-lossage-3.m b/gcc/testsuite/objc.dg/proto-lossage-3.m
new file mode 100644
index 00000000000..512a59ee6dc
--- /dev/null
+++ b/gcc/testsuite/objc.dg/proto-lossage-3.m
@@ -0,0 +1,25 @@
+/* Crash due to descriptionFor(Instance|Class)Method applied to
+ a protocol with no instance/class methods respectively.
+ Problem report and original fix by richard@brainstorm.co.uk. */
+/* { dg-do run } */
+#include <objc/objc.h>
+#include <objc/Object.h>
+#include <objc/Protocol.h>
+
+@protocol NoInstanceMethods
++ testMethod;
+@end
+
+@protocol NoClassMethods
+- testMethod;
+@end
+
+int
+main()
+{
+[@protocol(NoInstanceMethods) descriptionForInstanceMethod: @selector(name)];
+[@protocol(NoInstanceMethods) descriptionForClassMethod: @selector(name)];
+[@protocol(NoClassMethods) descriptionForInstanceMethod: @selector(name)];
+[@protocol(NoClassMethods) descriptionForClassMethod: @selector(name)];
+return 0;
+}
diff --git a/gcc/timevar.def b/gcc/timevar.def
index 74fda87e837..6fab782c052 100644
--- a/gcc/timevar.def
+++ b/gcc/timevar.def
@@ -92,10 +92,6 @@ DEFTIMEVAR (TV_DBR_SCHED , "delay branch sched")
DEFTIMEVAR (TV_REORDER_BLOCKS , "reorder blocks")
DEFTIMEVAR (TV_SHORTEN_BRANCH , "shorten branches")
DEFTIMEVAR (TV_REG_STACK , "reg stack")
-DEFTIMEVAR (TV_TO_SSA , "convert to SSA")
-DEFTIMEVAR (TV_SSA_CCP , "SSA CCP")
-DEFTIMEVAR (TV_SSA_DCE , "SSA aggressive DCE")
-DEFTIMEVAR (TV_FROM_SSA , "convert from SSA")
DEFTIMEVAR (TV_FINAL , "final")
DEFTIMEVAR (TV_SYMOUT , "symout")
diff --git a/gcc/tlink.c b/gcc/tlink.c
index 6406615b5e3..c890235ae71 100644
--- a/gcc/tlink.c
+++ b/gcc/tlink.c
@@ -463,11 +463,20 @@ recompile_files (void)
}
fclose (stream);
fclose (output);
- rename (outname, f->key);
+ /* On Windows "rename" returns -1 and sets ERRNO to EACCESS if
+ the new file name already exists. Therefore, we explicitly
+ remove the old file first. */
+ if (remove (f->key) == -1)
+ fatal_perror ("removing .rpo file");
+ if (rename (outname, f->key) == -1)
+ fatal_perror ("renaming .rpo file");
obstack_grow (&temporary_obstack, "cd ", 3);
obstack_grow (&temporary_obstack, f->dir, strlen (f->dir));
- obstack_grow (&temporary_obstack, "; ", 2);
+ /* Using ";" as a separator between commands does not work with
+ the Windows command shell. Therefore, we use "&&" which
+ should work everywhere. */
+ obstack_grow (&temporary_obstack, " && ", 4);
obstack_grow (&temporary_obstack, c_file_name, strlen (c_file_name));
obstack_1grow (&temporary_obstack, ' ');
obstack_grow (&temporary_obstack, f->args, strlen (f->args));
diff --git a/gcc/toplev.c b/gcc/toplev.c
index 6f7255059d9..6e34c6d6c06 100644
--- a/gcc/toplev.c
+++ b/gcc/toplev.c
@@ -63,7 +63,6 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#include "regs.h"
#include "timevar.h"
#include "diagnostic.h"
-#include "ssa.h"
#include "params.h"
#include "reload.h"
#include "dwarf2asm.h"
@@ -125,7 +124,6 @@ static void print_switch_values (FILE *, int, int, const char *,
/* Rest of compilation helper functions. */
static bool rest_of_handle_inlining (tree);
-static rtx rest_of_handle_ssa (tree, rtx);
static void rest_of_handle_cse (tree, rtx);
static void rest_of_handle_cse2 (tree, rtx);
static void rest_of_handle_gcse (tree, rtx);
@@ -148,8 +146,8 @@ static void rest_of_handle_regmove (tree, rtx);
static void rest_of_handle_sched (tree, rtx);
static void rest_of_handle_sched2 (tree, rtx);
#endif
-static bool rest_of_handle_new_regalloc (tree, rtx, int *);
-static bool rest_of_handle_old_regalloc (tree, rtx, int *);
+static bool rest_of_handle_new_regalloc (tree, rtx);
+static bool rest_of_handle_old_regalloc (tree, rtx);
static void rest_of_handle_regrename (tree, rtx);
static void rest_of_handle_reorder_blocks (tree, rtx);
#ifdef STACK_REGS
@@ -254,10 +252,6 @@ enum dump_file_index
DFI_sibling,
DFI_eh,
DFI_jump,
- DFI_ssa,
- DFI_ssa_ccp,
- DFI_ssa_dce,
- DFI_ussa,
DFI_null,
DFI_cse,
DFI_addressof,
@@ -269,8 +263,8 @@ enum dump_file_index
DFI_vpt,
DFI_ce1,
DFI_tracer,
- DFI_web,
DFI_loop2,
+ DFI_web,
DFI_cse2,
DFI_life,
DFI_combine,
@@ -298,8 +292,8 @@ enum dump_file_index
Remaining -d letters:
- " m q "
- " JK O Q Y "
+ " e m q "
+ " JK O Q WXY "
*/
static struct dump_file_info dump_file[DFI_MAX] =
@@ -309,10 +303,6 @@ static struct dump_file_info dump_file[DFI_MAX] =
{ "sibling", 'i', 0, 0, 0 },
{ "eh", 'h', 0, 0, 0 },
{ "jump", 'j', 0, 0, 0 },
- { "ssa", 'e', 1, 0, 0 },
- { "ssaccp", 'W', 1, 0, 0 },
- { "ssadce", 'X', 1, 0, 0 },
- { "ussa", 'e', 1, 0, 0 }, /* Yes, duplicate enable switch. */
{ "null", 'u', 0, 0, 0 },
{ "cse", 's', 0, 0, 0 },
{ "addressof", 'F', 0, 0, 0 },
@@ -324,8 +314,8 @@ static struct dump_file_info dump_file[DFI_MAX] =
{ "vpt", 'V', 1, 0, 0 },
{ "ce1", 'C', 1, 0, 0 },
{ "tracer", 'T', 1, 0, 0 },
- { "web", 'Z', 0, 0, 0 },
{ "loop2", 'L', 1, 0, 0 },
+ { "web", 'Z', 0, 0, 0 },
{ "cse2", 't', 1, 0, 0 },
{ "life", 'f', 1, 0, 0 }, /* Yes, duplicate enable switch. */
{ "combine", 'c', 1, 0, 0 },
@@ -481,11 +471,7 @@ int flag_short_enums;
be saved across function calls, if that produces overall better code.
Optional now, so people can test it. */
-#ifdef DEFAULT_CALLER_SAVES
-int flag_caller_saves = 1;
-#else
int flag_caller_saves = 0;
-#endif
/* Nonzero if structures and unions should be returned in memory.
@@ -892,27 +878,9 @@ int flag_debug_asm = 0;
int flag_dump_rtl_in_asm = 0;
-/* -fgnu-linker specifies use of the GNU linker for initializations.
- (Or, more generally, a linker that handles initializations.)
- -fno-gnu-linker says that collect2 will be used. */
-#ifdef USE_COLLECT2
-int flag_gnu_linker = 0;
-#else
-int flag_gnu_linker = 1;
-#endif
-
/* Nonzero means put zero initialized data in the bss section. */
int flag_zero_initialized_in_bss = 1;
-/* Enable SSA. */
-int flag_ssa = 0;
-
-/* Enable ssa conditional constant propagation. */
-int flag_ssa_ccp = 0;
-
-/* Enable ssa aggressive dead code elimination. */
-int flag_ssa_dce = 0;
-
/* Tag all structures with __attribute__(packed). */
int flag_pack_struct = 0;
@@ -1131,7 +1099,6 @@ static const lang_independent_options f_options[] =
{"function-sections", &flag_function_sections, 1 },
{"data-sections", &flag_data_sections, 1 },
{"verbose-asm", &flag_verbose_asm, 1 },
- {"gnu-linker", &flag_gnu_linker, 1 },
{"regmove", &flag_regmove, 1 },
{"optimize-register-move", &flag_regmove, 1 },
{"pack-struct", &flag_pack_struct, 1 },
@@ -1149,9 +1116,6 @@ static const lang_independent_options f_options[] =
{"dump-unnumbered", &flag_dump_unnumbered, 1 },
{"instrument-functions", &flag_instrument_function_entry_exit, 1 },
{"zero-initialized-in-bss", &flag_zero_initialized_in_bss, 1 },
- {"ssa", &flag_ssa, 1 },
- {"ssa-ccp", &flag_ssa_ccp, 1 },
- {"ssa-dce", &flag_ssa_dce, 1 },
{"leading-underscore", &flag_leading_underscore, 1 },
{"ident", &flag_no_ident, 0 },
{ "peephole2", &flag_peephole2, 1 },
@@ -1720,7 +1684,11 @@ check_global_declarations (tree *vec, int len)
/* Warn about static fns or vars defined but not used. */
if (((warn_unused_function && TREE_CODE (decl) == FUNCTION_DECL)
- || (warn_unused_variable && TREE_CODE (decl) == VAR_DECL))
+ /* We don't warn about "static const" variables because the
+ "rcs_id" idiom uses that construction. */
+ || (warn_unused_variable
+ && TREE_CODE (decl) == VAR_DECL && ! TREE_READONLY (decl)))
+ && ! DECL_IN_SYSTEM_HEADER (decl)
&& ! TREE_USED (decl)
/* The TREE_USED bit for file-scope decls is kept in the identifier,
to handle multiple external decls in different scopes. */
@@ -1948,8 +1916,15 @@ rest_of_decl_compilation (tree decl,
make_decl_rtl (decl, asmspec);
/* Don't output anything when a tentative file-scope definition
- is seen. But at end of compilation, do output code for them. */
- if ((at_end || !DECL_DEFER_OUTPUT (decl)) && !DECL_EXTERNAL (decl))
+ is seen. But at end of compilation, do output code for them.
+
+ We do output all variables when unit-at-a-time is active and rely on
+ callgraph code to defer them except for forward declarations
+ (see gcc.c-torture/compile/920624-1.c) */
+ if ((at_end
+ || !DECL_DEFER_OUTPUT (decl)
+ || (flag_unit_at_a_time && DECL_INITIAL (decl)))
+ && !DECL_EXTERNAL (decl))
{
if (flag_unit_at_a_time && !cgraph_global_info_ready
&& TREE_CODE (decl) != FUNCTION_DECL && top_level)
@@ -2184,7 +2159,7 @@ rest_of_handle_machine_reorg (tree decl, rtx insns)
/* Run new register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static bool
-rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
+rest_of_handle_new_regalloc (tree decl, rtx insns)
{
int failure;
@@ -2223,7 +2198,6 @@ rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
return true;
reload_completed = 1;
- *rebuild_notes = 0;
return false;
}
@@ -2231,9 +2205,10 @@ rest_of_handle_new_regalloc (tree decl, rtx insns, int *rebuild_notes)
/* Run old register allocator. Return TRUE if we must exit
rest_of_compilation upon return. */
static bool
-rest_of_handle_old_regalloc (tree decl, rtx insns, int *rebuild_notes)
+rest_of_handle_old_regalloc (tree decl, rtx insns)
{
int failure;
+ int rebuild_notes;
/* Allocate the reg_renumber array. */
allocate_reg_info (max_regno, FALSE, TRUE);
@@ -2244,10 +2219,23 @@ rest_of_handle_old_regalloc (tree decl, rtx insns, int *rebuild_notes)
allocate_initial_values (reg_equiv_memory_loc);
regclass (insns, max_reg_num (), rtl_dump_file);
- *rebuild_notes = local_alloc ();
+ rebuild_notes = local_alloc ();
timevar_pop (TV_LOCAL_ALLOC);
+ /* Local allocation may have turned an indirect jump into a direct
+ jump. If so, we must rebuild the JUMP_LABEL fields of jumping
+ instructions. */
+ if (rebuild_notes)
+ {
+ timevar_push (TV_JUMP);
+
+ rebuild_jump_labels (insns);
+ purge_all_dead_edges (0);
+
+ timevar_pop (TV_JUMP);
+ }
+
if (dump_file[DFI_lreg].enabled)
{
timevar_push (TV_DUMP);
@@ -2310,7 +2298,6 @@ rest_of_handle_regrename (tree decl, rtx insns)
static void
rest_of_handle_reorder_blocks (tree decl, rtx insns)
{
- timevar_push (TV_REORDER_BLOCKS);
open_dump_file (DFI_bbro, decl);
/* Last attempt to optimize CFG, as scheduling, peepholing and insn
@@ -2327,7 +2314,6 @@ rest_of_handle_reorder_blocks (tree decl, rtx insns)
cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_UPDATE_LIFE);
close_dump_file (DFI_bbro, print_rtl_with_bb, insns);
- timevar_pop (TV_REORDER_BLOCKS);
}
#ifdef INSN_SCHEDULING
@@ -2406,7 +2392,6 @@ rest_of_handle_regmove (tree decl, rtx insns)
static void
rest_of_handle_tracer (tree decl, rtx insns)
{
- timevar_push (TV_TRACER);
open_dump_file (DFI_tracer, decl);
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
@@ -2414,7 +2399,6 @@ rest_of_handle_tracer (tree decl, rtx insns)
cleanup_cfg (CLEANUP_EXPENSIVE);
reg_scan (insns, max_reg_num (), 0);
close_dump_file (DFI_tracer, print_rtl_with_bb, get_insns ());
- timevar_pop (TV_TRACER);
}
/* If-conversion and CFG cleanup. */
@@ -2493,6 +2477,7 @@ rest_of_handle_branch_prob (tree decl, rtx insns)
estimate_probability (&loops);
flow_loops_free (&loops);
+ free_dominance_info (CDI_DOMINATORS);
close_dump_file (DFI_bp, print_rtl_with_bb, insns);
timevar_pop (TV_BRANCH_PROB);
}
@@ -2586,6 +2571,7 @@ rest_of_handle_jump_bypass (tree decl, rtx insns)
open_dump_file (DFI_bypass, decl);
cleanup_cfg (CLEANUP_EXPENSIVE);
+ reg_scan (insns, max_reg_num (), 1);
if (bypass_jumps (rtl_dump_file))
{
@@ -2746,71 +2732,6 @@ rest_of_handle_inlining (tree decl)
return (bool) DECL_EXTERNAL (decl);
}
-/* Rest of compilation helper to convert the rtl to SSA form. */
-static rtx
-rest_of_handle_ssa (tree decl, rtx insns)
-{
- timevar_push (TV_TO_SSA);
- open_dump_file (DFI_ssa, decl);
-
- cleanup_cfg (CLEANUP_EXPENSIVE | CLEANUP_PRE_LOOP);
- convert_to_ssa ();
-
- close_dump_file (DFI_ssa, print_rtl_with_bb, insns);
- timevar_pop (TV_TO_SSA);
-
- /* Perform sparse conditional constant propagation, if requested. */
- if (flag_ssa_ccp)
- {
- timevar_push (TV_SSA_CCP);
- open_dump_file (DFI_ssa_ccp, decl);
-
- ssa_const_prop ();
-
- close_dump_file (DFI_ssa_ccp, print_rtl_with_bb, get_insns ());
- timevar_pop (TV_SSA_CCP);
- }
-
- /* It would be useful to cleanup the CFG at this point, but block
- merging and possibly other transformations might leave a PHI
- node in the middle of a basic block, which is a strict no-no. */
-
- /* The SSA implementation uses basic block numbers in its phi
- nodes. Thus, changing the control-flow graph or the basic
- blocks, e.g., calling find_basic_blocks () or cleanup_cfg (),
- may cause problems. */
-
- if (flag_ssa_dce)
- {
- /* Remove dead code. */
-
- timevar_push (TV_SSA_DCE);
- open_dump_file (DFI_ssa_dce, decl);
-
- insns = get_insns ();
- ssa_eliminate_dead_code ();
-
- close_dump_file (DFI_ssa_dce, print_rtl_with_bb, insns);
- timevar_pop (TV_SSA_DCE);
- }
-
- /* Convert from SSA form. */
-
- timevar_push (TV_FROM_SSA);
- open_dump_file (DFI_ussa, decl);
-
- convert_from_ssa ();
- /* New registers have been created. Rescan their usage. */
- reg_scan (insns, max_reg_num (), 1);
-
- close_dump_file (DFI_ussa, print_rtl_with_bb, insns);
- timevar_pop (TV_FROM_SSA);
-
- ggc_collect ();
-
- return insns;
-}
-
/* Try to identify useless null pointer tests and delete them. */
static void
rest_of_handle_null_pointer (tree decl, rtx insns)
@@ -3055,7 +2976,7 @@ rest_of_handle_loop_optimize (tree decl, rtx insns)
free_bb_for_insn ();
if (flag_unroll_loops)
- do_unroll = 0; /* Having two unrollers is useless. */
+ do_unroll = LOOP_AUTO_UNROLL; /* Having two unrollers is useless. */
else
do_unroll = flag_old_unroll_loops ? LOOP_UNROLL : LOOP_AUTO_UNROLL;
do_prefetch = flag_prefetch_loop_arrays ? LOOP_PREFETCH : 0;
@@ -3094,8 +3015,9 @@ rest_of_handle_loop_optimize (tree decl, rtx insns)
sooner, but we want the profile feedback to work more
efficiently. */
static void
-rest_of_handle_loop2 (tree decl, rtx insns)
+rest_of_handle_loop2 (tree decl ATTRIBUTE_UNUSED, rtx insns ATTRIBUTE_UNUSED)
{
+#if 0
struct loops *loops;
timevar_push (TV_LOOP);
open_dump_file (DFI_loop2, decl);
@@ -3127,6 +3049,7 @@ rest_of_handle_loop2 (tree decl, rtx insns)
close_dump_file (DFI_loop2, print_rtl_with_bb, get_insns ());
timevar_pop (TV_LOOP);
ggc_collect ();
+#endif
}
/* This is called from finish_function (within langhooks.parse_file)
@@ -3139,7 +3062,6 @@ void
rest_of_compilation (tree decl)
{
rtx insns;
- int rebuild_label_notes_after_reload;
timevar_push (TV_REST_OF_COMPILATION);
@@ -3225,10 +3147,6 @@ rest_of_compilation (tree decl)
delete_unreachable_blocks ();
- /* We have to issue these warnings now already, because CFG cleanups
- further down may destroy the required information. */
- check_function_return_warnings ();
-
/* Turn NOTE_INSN_PREDICTIONs into branch predictions. */
if (flag_guess_branch_prob)
{
@@ -3240,6 +3158,14 @@ rest_of_compilation (tree decl)
if (flag_optimize_sibling_calls)
rest_of_handle_sibling_calls (insns);
+ /* We have to issue these warnings now already, because CFG cleanups
+ further down may destroy the required information. However, this
+ must be done after the sibcall optimization pass because the barrier
+ emitted for noreturn calls that are candidate for the optimization
+ is folded into the CALL_PLACEHOLDER until after this pass, so the
+ CFG is inaccurate. */
+ check_function_return_warnings ();
+
timevar_pop (TV_JUMP);
insn_locators_initialize ();
@@ -3321,12 +3247,6 @@ rest_of_compilation (tree decl)
if (rtl_dump_and_exit || flag_syntax_only || DECL_DEFER_OUTPUT (decl))
goto exit_rest_of_compilation;
- /* Long term, this should probably move before the jump optimizer too,
- but I didn't want to disturb the rtl_dump_and_exit and related
- stuff at this time. */
- if (optimize > 0 && flag_ssa)
- insns = rest_of_handle_ssa (decl, insns);
-
timevar_push (TV_JUMP);
if (optimize)
@@ -3449,14 +3369,12 @@ rest_of_compilation (tree decl)
if (flag_new_regalloc)
{
- if (rest_of_handle_new_regalloc (decl, insns,
- &rebuild_label_notes_after_reload))
+ if (rest_of_handle_new_regalloc (decl, insns))
goto exit_rest_of_compilation;
}
else
{
- if (rest_of_handle_old_regalloc (decl, insns,
- &rebuild_label_notes_after_reload))
+ if (rest_of_handle_old_regalloc (decl, insns))
goto exit_rest_of_compilation;
}
@@ -3472,19 +3390,6 @@ rest_of_compilation (tree decl)
timevar_pop (TV_RELOAD_CSE_REGS);
}
- /* Register allocation and reloading may have turned an indirect jump into
- a direct jump. If so, we must rebuild the JUMP_LABEL fields of
- jumping instructions. */
- if (rebuild_label_notes_after_reload)
- {
- timevar_push (TV_JUMP);
-
- rebuild_jump_labels (insns);
- purge_all_dead_edges (0);
-
- timevar_pop (TV_JUMP);
- }
-
close_dump_file (DFI_postreload, print_rtl_with_bb, insns);
/* Re-create the death notes which were deleted during reload. */
@@ -4106,7 +4011,9 @@ init_asm_output (const char *name)
void *
default_get_pch_validity (size_t *len)
{
+#ifdef TARGET_OPTIONS
size_t i;
+#endif
char *result, *r;
*len = sizeof (target_flags) + 2;
@@ -4448,10 +4355,6 @@ process_options (void)
else if (write_symbols == SDB_DEBUG)
debug_hooks = &sdb_debug_hooks;
#endif
-#ifdef DWARF_DEBUGGING_INFO
- else if (write_symbols == DWARF_DEBUG)
- debug_hooks = &dwarf_debug_hooks;
-#endif
#ifdef DWARF2_DEBUGGING_INFO
else if (write_symbols == DWARF2_DEBUG)
debug_hooks = &dwarf2_debug_hooks;
@@ -4648,6 +4551,7 @@ finalize (void)
ggc_print_statistics ();
stringpool_statistics ();
dump_tree_statistics ();
+ dump_rtx_statistics ();
}
/* Free up memory for the benefit of leak detectors. */
diff --git a/gcc/toplev.h b/gcc/toplev.h
index 5a8b5813f09..31611c3a220 100644
--- a/gcc/toplev.h
+++ b/gcc/toplev.h
@@ -118,9 +118,6 @@ extern int flag_unroll_loops;
extern int flag_unroll_all_loops;
extern int flag_unswitch_loops;
extern int flag_cprop_registers;
-extern int flag_ssa;
-extern int flag_ssa_ccp;
-extern int flag_ssa_dce;
extern int time_report;
extern int flag_new_regalloc;
diff --git a/gcc/tracer.c b/gcc/tracer.c
index eb311b9c7ef..4769a47632f 100644
--- a/gcc/tracer.c
+++ b/gcc/tracer.c
@@ -45,6 +45,7 @@
#include "cfglayout.h"
#include "fibheap.h"
#include "flags.h"
+#include "timevar.h"
#include "params.h"
#include "coverage.h"
@@ -85,7 +86,9 @@ count_insns (basic_block bb)
rtx insn;
int n = 0;
- for (insn = bb->head; insn != NEXT_INSN (bb->end); insn = NEXT_INSN (insn))
+ for (insn = BB_HEAD (bb);
+ insn != NEXT_INSN (BB_END (bb));
+ insn = NEXT_INSN (insn))
if (active_insn_p (insn))
n++;
return n;
@@ -358,6 +361,9 @@ tracer (void)
{
if (n_basic_blocks <= 1)
return;
+
+ timevar_push (TV_TRACER);
+
cfg_layout_initialize ();
mark_dfs_back_edges ();
if (rtl_dump_file)
@@ -367,6 +373,9 @@ tracer (void)
if (rtl_dump_file)
dump_flow_info (rtl_dump_file);
cfg_layout_finalize ();
+
/* Merge basic blocks in duplicated traces. */
cleanup_cfg (CLEANUP_EXPENSIVE);
+
+ timevar_pop (TV_TRACER);
}
diff --git a/gcc/tree-dump.c b/gcc/tree-dump.c
index c3696336c44..6f958cf90fd 100644
--- a/gcc/tree-dump.c
+++ b/gcc/tree-dump.c
@@ -302,6 +302,8 @@ dequeue_and_dump (dump_info_p di)
break;
case 'e':
+ case 'r':
+ case 's':
/* These nodes are handled explicitly below. */
break;
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index b827dfc1c29..48b59a41ed5 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -729,9 +729,11 @@ initialize_inlined_parameters (inline_data *id, tree args, tree fn, tree block)
#ifdef INLINER_FOR_JAVA
tree vars = NULL_TREE;
#endif /* INLINER_FOR_JAVA */
+ int argnum = 0;
/* Figure out what the parameters are. */
- parms = DECL_ARGUMENTS (fn);
+ parms =
+DECL_ARGUMENTS (fn);
/* Start with no initializations whatsoever. */
init_stmts = NULL_TREE;
@@ -749,9 +751,11 @@ initialize_inlined_parameters (inline_data *id, tree args, tree fn, tree block)
tree value;
tree var_sub;
+ ++argnum;
+
/* Find the initializer. */
value = (*lang_hooks.tree_inlining.convert_parm_for_inlining)
- (p, a ? TREE_VALUE (a) : NULL_TREE, fn);
+ (p, a ? TREE_VALUE (a) : NULL_TREE, fn, argnum);
/* If the parameter is never assigned to, we may not need to
create a new variable here at all. Instead, we may be able
@@ -1000,10 +1004,11 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
switch (TREE_CODE (node))
{
case CALL_EXPR:
- /* Refuse to inline alloca call unless user explicitly forced so as this
- may change program's memory overhead drastically when the function
- using alloca is called in loop. In GCC present in SPEC2000 inlining
- into schedule_block cause it to require 2GB of ram instead of 256MB. */
+ /* Refuse to inline alloca call unless user explicitly forced so as
+ this may change program's memory overhead drastically when the
+ function using alloca is called in loop. In GCC present in
+ SPEC2000 inlining into schedule_block cause it to require 2GB of
+ RAM instead of 256MB. */
if (alloca_call_p (node)
&& !lookup_attribute ("always_inline", DECL_ATTRIBUTES (fn)))
{
@@ -1025,40 +1030,42 @@ inline_forbidden_p_1 (tree *nodep, int *walk_subtrees ATTRIBUTE_UNUSED,
return node;
}
- switch (DECL_FUNCTION_CODE (t))
- {
- /* We cannot inline functions that take a variable number of
- arguments. */
- case BUILT_IN_VA_START:
- case BUILT_IN_STDARG_START:
- case BUILT_IN_NEXT_ARG:
- case BUILT_IN_VA_END:
- {
- inline_forbidden_reason
- = N_("%Jfunction '%F' can never be inlined because it "
- "uses variable argument lists");
- return node;
- }
- case BUILT_IN_LONGJMP:
+ if (DECL_BUILT_IN (t))
+ switch (DECL_FUNCTION_CODE (t))
{
- /* We can't inline functions that call __builtin_longjmp at all.
- The non-local goto machinery really requires the destination
- be in a different function. If we allow the function calling
- __builtin_longjmp to be inlined into the function calling
- __builtin_setjmp, Things will Go Awry. */
- /* ??? Need front end help to identify "regular" non-local goto. */
- if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL)
- {
- inline_forbidden_reason
- = N_("%Jfunction '%F' can never be inlined "
- "because it uses setjmp-longjmp exception handling");
- return node;
- }
- }
+ /* We cannot inline functions that take a variable number of
+ arguments. */
+ case BUILT_IN_VA_START:
+ case BUILT_IN_STDARG_START:
+ case BUILT_IN_NEXT_ARG:
+ case BUILT_IN_VA_END:
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined because it "
+ "uses variable argument lists");
+ return node;
+ }
+ case BUILT_IN_LONGJMP:
+ {
+ /* We can't inline functions that call __builtin_longjmp at
+ all. The non-local goto machinery really requires the
+ destination be in a different function. If we allow the
+ function calling __builtin_longjmp to be inlined into the
+ function calling __builtin_setjmp, Things will Go Awry. */
+ /* ??? Need front end help to identify "regular" non-local
+ goto. */
+ if (DECL_BUILT_IN_CLASS (t) == BUILT_IN_NORMAL)
+ {
+ inline_forbidden_reason
+ = N_("%Jfunction '%F' can never be inlined because "
+ "it uses setjmp-longjmp exception handling");
+ return node;
+ }
+ }
- default:
- break;
- }
+ default:
+ break;
+ }
break;
#ifndef INLINER_FOR_JAVA
@@ -1849,6 +1856,7 @@ walk_tree (tree *tp, walk_tree_fn func, void *data, void *htab_)
case BLOCK:
case RECORD_TYPE:
case CHAR_TYPE:
+ case PLACEHOLDER_EXPR:
/* None of these have subtrees other than those already walked
above. */
break;
diff --git a/gcc/tree-optimize.c b/gcc/tree-optimize.c
index e6049cb2b29..f1957ab20e7 100644
--- a/gcc/tree-optimize.c
+++ b/gcc/tree-optimize.c
@@ -195,21 +195,6 @@ tree_rest_of_compilation (tree fndecl, bool nested_p)
}
}
- /* ??? Looks like some of this could be combined. */
-
- /* If possible, obliterate the body of the function so that it can
- be garbage collected. */
- if (dump_enabled_p (TDI_all))
- /* Keep the body; we're going to dump it. */
- ;
- else if (DECL_INLINE (fndecl) && flag_inline_trees)
- /* We might need the body of this function so that we can expand
- it inline somewhere else. */
- ;
- else
- /* We don't need the body; blow it away. */
- DECL_SAVED_TREE (fndecl) = NULL;
-
/* Since 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
diff --git a/gcc/tree.c b/gcc/tree.c
index 7d0258c1fa0..b252a67c354 100644
--- a/gcc/tree.c
+++ b/gcc/tree.c
@@ -2294,6 +2294,7 @@ build (enum tree_code code, tree tt, ...)
int fro;
int constant;
va_list p;
+ tree node;
va_start (p, tt);
@@ -2380,10 +2381,17 @@ build (enum tree_code code, tree tt, ...)
{
/* Calls have side-effects, except those to const or
pure functions. */
- tree fn = get_callee_fndecl (t);
-
- if (!fn || (!DECL_IS_PURE (fn) && !TREE_READONLY (fn)))
+ i = call_expr_flags (t);
+ if (!(i & (ECF_CONST | ECF_PURE)))
TREE_SIDE_EFFECTS (t) = 1;
+
+ /* And even those have side-effects if their arguments do. */
+ else for (node = TREE_OPERAND (t, 1); node; node = TREE_CHAIN (node))
+ if (TREE_SIDE_EFFECTS (TREE_VALUE (node)))
+ {
+ TREE_SIDE_EFFECTS (t) = 1;
+ break;
+ }
}
return t;
@@ -4115,7 +4123,7 @@ get_unwidened (tree op, tree for_type)
The resulting extension to its nominal type (a fullword type)
must fit the same conditions as for other extensions. */
- if (innerprec < TYPE_PRECISION (TREE_TYPE (op))
+ if (INT_CST_LT_UNSIGNED (TYPE_SIZE (type), TYPE_SIZE (TREE_TYPE (op)))
&& (for_type || ! DECL_BIT_FIELD (TREE_OPERAND (op, 1)))
&& (! uns || final_prec <= innerprec || unsignedp)
&& type != 0)
@@ -4916,8 +4924,7 @@ build_common_tree_nodes_2 (int short_double)
layout_type (complex_long_double_type_node);
{
- tree t;
- BUILD_VA_LIST_TYPE (t);
+ tree t = (*targetm.build_builtin_va_list) ();
/* Many back-ends define record types without setting TYPE_NAME.
If we copied the record type here, we'd keep the original
@@ -5004,6 +5011,11 @@ initializer_zerop (tree init)
&& ! REAL_VALUE_MINUS_ZERO (TREE_REAL_CST (TREE_IMAGPART (init))));
case CONSTRUCTOR:
{
+ /* Set is empty if it has no elements. */
+ if ((TREE_CODE (TREE_TYPE (init)) == SET_TYPE)
+ && CONSTRUCTOR_ELTS (init))
+ return false;
+
if (AGGREGATE_TYPE_P (TREE_TYPE (init)))
{
tree aggr_init = CONSTRUCTOR_ELTS (init);
diff --git a/gcc/tree.def b/gcc/tree.def
index 4b6d236dde6..79bb63e220a 100644
--- a/gcc/tree.def
+++ b/gcc/tree.def
@@ -509,7 +509,8 @@ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
some field in an object of the type contains a value that is used in
the computation of another field's offset or size and/or the size of
the type. The positions and/or sizes of fields can vary from object
- to object of the same type.
+ to object of the same type or even for one and the same object within
+ its scope.
Record types with discriminants in Ada or schema types in Pascal are
examples of such types. This mechanism is also used to create "fat
@@ -533,7 +534,16 @@ DEFTREECODE (CLEANUP_POINT_EXPR, "cleanup_point_expr", 'e', 1)
For example, if your type FOO is a RECORD_TYPE with a field BAR,
and you need the value of <variable>.BAR to calculate TYPE_SIZE
(FOO), just substitute <variable> above with a PLACEHOLDER_EXPR
- what contains both the expression we wish to
+ whose TREE_TYPE is FOO. Then construct your COMPONENT_REF with
+ the PLACEHOLDER_EXPR as the first operand (which has the correct
+ type). Later, when the size is needed in the program, the back-end
+ will find this PLACEHOLDER_EXPR and generate code to calculate the
+ actual size at run-time. In the following, we describe how this
+ calculation is done.
+
+ When we wish to evaluate a size or offset, we check whether it
+ contains a PLACEHOLDER_EXPR. If it does, we construct a
+ WITH_RECORD_EXPR that contains both the expression we wish to
evaluate and an expression within which the object may be found.
The latter expression is the object itself in the simple case of an
Ada record with discriminant, but it can be the array in the case of
diff --git a/gcc/tree.h b/gcc/tree.h
index e6217413e90..f36ebaf863f 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -210,6 +210,8 @@ struct tree_common GTY(())
TREE_PROTECTED in
BLOCK
..._DECL
+ CALL_FROM_THUNK_P in
+ CALL_EXPR
side_effects_flag:
@@ -262,6 +264,7 @@ struct tree_common GTY(())
TREE_DEPRECATED in
..._DECL
+
*/
/* Define accessors for the fields that all tree nodes have
@@ -270,8 +273,7 @@ struct tree_common GTY(())
/* 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 = (ENUM_BITFIELD (tree_code)) (VALUE))
+#define TREE_SET_CODE(NODE, VALUE) ((NODE)->common.code = (VALUE))
/* When checking is enabled, errors will be generated if a tree node
is accessed incorrectly. The macros abort with a fatal error. */
@@ -621,6 +623,10 @@ extern void tree_operand_check_failed (int, enum tree_code,
argument list. */
#define CALL_EXPR_HAS_RETURN_SLOT_ADDR(NODE) ((NODE)->common.private_flag)
+/* In a CALL_EXPR, means that the call is the jump from a thunk to the
+ thunked-to function. */
+#define CALL_FROM_THUNK_P(NODE) ((NODE)->common.protected_flag)
+
/* In a type, nonzero means that all objects of the type are guaranteed by the
language or front-end to be properly aligned, so we can indicate that a MEM
of this type is aligned at least to the alignment of the type, even if it
@@ -1491,6 +1497,9 @@ struct tree_type GTY(())
#define DECL_DECLARED_INLINE_P(NODE) \
(FUNCTION_DECL_CHECK (NODE)->decl.declared_inline_flag)
+/* Value of the decls's visibility attribute */
+#define DECL_VISIBILITY(NODE) (DECL_CHECK (NODE)->decl.visibility)
+
/* In a FUNCTION_DECL, nonzero if the function cannot be inlined. */
#define DECL_UNINLINABLE(NODE) (FUNCTION_DECL_CHECK (NODE)->decl.uninlinable)
@@ -1631,6 +1640,16 @@ struct tree_type GTY(())
(! DECL_CONTEXT (EXP) \
|| TREE_CODE (DECL_CONTEXT (EXP)) == TRANSLATION_UNIT_DECL)
+/* Enumerate visibility settings. */
+
+enum symbol_visibility
+{
+ VISIBILITY_DEFAULT,
+ VISIBILITY_INTERNAL,
+ VISIBILITY_HIDDEN,
+ VISIBILITY_PROTECTED
+};
+
struct function;
struct tree_decl GTY(())
@@ -1672,8 +1691,9 @@ struct tree_decl GTY(())
unsigned uninlinable : 1;
unsigned thread_local_flag : 1;
unsigned declared_inline_flag : 1;
- unsigned unused : 3;
- /* three unused bits. */
+ ENUM_BITFIELD(symbol_visibility) visibility : 2;
+ unsigned unused : 1;
+ /* one unused bit. */
unsigned lang_flag_0 : 1;
unsigned lang_flag_1 : 1;
@@ -2007,15 +2027,6 @@ enum tls_model {
extern enum tls_model flag_tls_default;
-/* Enumerate visibility settings. */
-
-enum symbol_visibility
-{
- VISIBILITY_DEFAULT,
- VISIBILITY_INTERNAL,
- VISIBILITY_HIDDEN,
- VISIBILITY_PROTECTED
-};
/* A pointer-to-function member type looks like:
@@ -2707,7 +2718,7 @@ extern tree get_file_function_name_long (const char *);
extern tree get_set_constructor_bits (tree, char *, int);
extern tree get_set_constructor_bytes (tree, unsigned char *, int);
extern tree get_callee_fndecl (tree);
-extern void set_decl_assembler_name (tree);
+extern void change_decl_assembler_name (tree, tree);
extern int type_num_arguments (tree);
extern tree lhd_unsave_expr_now (tree);
@@ -2936,6 +2947,7 @@ extern rtx emit_line_note (location_t);
#define ECF_LIBCALL_BLOCK 4096
extern int flags_from_decl_or_type (tree);
+extern int call_expr_flags (tree);
extern int setjmp_call_p (tree);
extern bool alloca_call_p (tree);
@@ -2969,7 +2981,6 @@ extern void make_decl_one_only (tree);
extern int supports_one_only (void);
extern void variable_section (tree, int);
enum tls_model decl_tls_model (tree);
-enum symbol_visibility decl_visibility (tree);
extern void resolve_unique_section (tree, int, int);
extern void mark_referenced (tree);
extern void notice_global_symbol (tree);
diff --git a/gcc/treelang/.cvsignore b/gcc/treelang/.cvsignore
deleted file mode 100644
index 6e2fad745bf..00000000000
--- a/gcc/treelang/.cvsignore
+++ /dev/null
@@ -1,5 +0,0 @@
-lex.c
-parse.c
-parse.h
-parse.output
-*.info*
diff --git a/gcc/treelang/ChangeLog b/gcc/treelang/ChangeLog
index 43f7c4dcac8..d017977a38b 100644
--- a/gcc/treelang/ChangeLog
+++ b/gcc/treelang/ChangeLog
@@ -1,3 +1,37 @@
+2003-12-04 James A. Morrison <ja2morri@uwaterloo.ca>
+
+ * lex.l: Add \t as a whitespace character.
+ * treelang.texi (Lexical Syntax): Document a tab as whitespace.
+
+ * treelang.texi (What is GNU Treelang?): Fix a typo.
+ (Lexical Syntax): Create an itemize list of keywords. Add commas to
+ paragraph defining names.
+
+2003-11-26 Jason Merrill <jason@redhat.com>
+
+ * Make-lang.in (treelang.tags): Create TAGS.sub files in each
+ directory and TAGS files that include them for each front end.
+
+2003-11-21 Kelley Cook <kcook@gcc.gnu.org>
+
+ * .cvsignore: Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in (treelang.extraclean): Delete.
+
+2003-11-20 Joseph S. Myers <jsm@polyomino.org.uk>
+
+ * Make-lang.in: Remove obsolete comment.
+
+2003-11-03 Kelley Cook <kcook@gcc.gnu.org>
+
+ * Make-lang.in (dvi): Move targets to $(docobjdir).
+ (treelang.dvi): Simplify rule and adjust target.
+ (treelang.info): Simplify rule.
+ (parse.o): Correct dependencies.
+ (TREE_EXE): Delete doubled suffix append.
+
2003-10-21 Kelley Cook <kcook@gcc.gnu.org>
* Make-lang.in (treelang.o): Depend on $(parsedir)/treelang/parse.h.
diff --git a/gcc/treelang/Make-lang.in b/gcc/treelang/Make-lang.in
index a18ad56644d..00816d0b93f 100644
--- a/gcc/treelang/Make-lang.in
+++ b/gcc/treelang/Make-lang.in
@@ -26,7 +26,7 @@
# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap,
# foo.install-normal, foo.install-common, foo.install-man,
# foo.uninstall, foo.distdir,
-# foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean,
+# foo.mostlyclean, foo.clean, foo.distclean,
# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4
#
# where `foo' is the name of the language.
@@ -59,9 +59,9 @@ GCC_EXTRAS = -B./ -B$(build_tooldir)/bin/ -isystem $(build_tooldir)/include
TREE_GENERATED = $(parsedir)/treelang/lex.c $(parsedir)/treelang/parse.c \
$(parsedir)/treelang/parse.h $(parsedir)/treelang/parse.output \
- $(parsedir)/treelang/TAGS
+ $(parsedir)/treelang/TAGS $(parsedir)/treelang/TAGS.sub
-TREE_EXES = tree1$(exeext)
+TREE_EXES = tree1
#no -Wtraditional warnings, allow long long
treelang-warn = $(LOOSE_WARN) -pedantic -Wno-long-long -Wmissing-prototypes -Wmissing-declarations $(WERROR)
@@ -109,9 +109,9 @@ treelang/treetree.o: treelang/treetree.c $(CONFIG_H) $(SYSTEM_H) coretypes.h \
treelang/tree-convert.o: treelang/tree-convert.c $(CONFIG_H) $(SYSTEM_H) \
coretypes.h diagnostic.h $(TREE_H) flags.h toplev.h langhooks.h $(TM_H)
-treelang/parse.o: $(parsedir)/treelang/parse.h $(parsedir)/treelang/parse.c \
- $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) diagnostic.h treelang/treelang.h \
- input.h
+treelang/parse.o: $(parsedir)/treelang/parse.c $(CONFIG_H) $(SYSTEM_H) \
+ coretypes.h $(TM_H) diagnostic.h treelang/treelang.h input.h \
+ treelang/treetree.h
$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \
$(parsedir)/treelang/parse.c $(OUTPUT_OPTION)
@@ -147,27 +147,27 @@ treelang.start.encap:
treelang.rest.encap:
treelang.tags: force
- cd $(srcdir)/treelang; etags *.y *.l *.c *.h
+ cd $(srcdir)/treelang; etags -o TAGS.sub *.y *.l *.c *.h; \
+ etags --include TAGS.sub --include ../TAGS.sub
-.phony:treelang.info
info:: $(docobjdir)/treelang.info
+dvi:: $(docobjdir)/treelang.dvi
-$(docobjdir)/treelang.info: $(srcdir)/treelang/treelang.texi \
+$(docobjdir)/treelang.info: treelang/treelang.texi \
$(docdir)/include/gcc-common.texi \
$(docdir)/include/gpl.texi \
$(docdir)/include/fdl.texi \
$(docdir)/include/funding.texi \
stmp-docobjdir
- cd $(srcdir) && $(MAKEINFO) $(MAKEINFOFLAGS) -Idoc/include \
- -o $@ treelang/treelang.texi
+ $(MAKEINFO) $(MAKEINFOFLAGS) -I$(docdir)/include -o $@ $<
-dvi:: $(srcdir)/treelang/treelang.texi \
+$(docobjdir)/treelang.dvi: treelang/treelang.texi \
$(docdir)/include/gcc-common.texi \
$(docdir)/include/gpl.texi \
$(docdir)/include/fdl.texi \
- $(docdir)/include/funding.texi
- s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
- cd treelang && $(TEXI2DVI) -I $$s/doc/include $$s/treelang/treelang.texi
+ $(docdir)/include/funding.texi \
+ stmp-docobjdir
+ $(TEXI2DVI) -I $(docdir)/include -o $@ $<
#
# Install hooks:
@@ -234,9 +234,7 @@ treelang.distclean: treelang.clean
-rm -f treelang/config.status
-rm -f treelang/*.output
-treelang.extraclean: treelang.distclean
-
-treelang.maintainer-clean: treelang.extraclean
+treelang.maintainer-clean: treelang.distclean
for name in $(TREE_GENERATED); \
do \
if [ -f $(srcdir)/treelang/$$name ] ; then \
@@ -272,7 +270,6 @@ treelang.distdir:
# not here yet sorry not sure if this is needed or not???
# test hook
-# the other languages are hard coded in the main makefile.in - that seems to be wrong
check-treelang: treelang.check
diff --git a/gcc/treelang/lex.l b/gcc/treelang/lex.l
index 364bf0208d4..12b211e5b2f 100644
--- a/gcc/treelang/lex.l
+++ b/gcc/treelang/lex.l
@@ -78,7 +78,7 @@ static void dump_lex_value (int lexret);
((struct prod_token_parm_item *)yylval)->tp.tok.charno = next_tree_charno;
}
-[ \n]+ {
+[ \n\t]+ {
update_lineno_charno ();
NOT_RETURN (WHITESPACE);
}
diff --git a/gcc/treelang/treelang.texi b/gcc/treelang/treelang.texi
index f58a6f8effd..501c4bfca95 100644
--- a/gcc/treelang/treelang.texi
+++ b/gcc/treelang/treelang.texi
@@ -370,7 +370,7 @@ double_plus_one
@{
// aaa is a variable, of type integer and allocated at the start of the function
automatic int aaa;
-// set aaa to the value returned from aaa, when passed arg7 and arg7 as the two parameters
+// set aaa to the value returned from add, when passed arg7 and arg7 as the two parameters
aaa=add(arg7, arg7);
aaa=add(aaa, aaa);
aaa=subtract(subtract(aaa, arg7), arg7) + 1;
@@ -399,8 +399,8 @@ Treelang programs consist of whitespace, comments, keywords and names.
@itemize @bullet
@item
-Whitespace consists of the space character and the end of line
-character. Tabs are not allowed. Line terminations are as defined by the
+Whitespace consists of the space character, a tab, and the end of line
+character. Line terminations are as defined by the
standard C library. Whitespace is ignored except within comments,
and where it separates parts of the program. In the example below, A and
B are two separate names separated by whitespace.
@@ -419,39 +419,59 @@ x=1; // Set X to 1
@end smallexample
@item
-Keywords consist of any reserved words or symbols as described
-later. The list of keywords follows:
+Keywords consist of any of the following reserved words or symbols:
-@smallexample
-@{ - used to start the statements in a function
-@} - used to end the statements in a function
-( - start list of function arguments, or to change the precedence of operators in an expression
-) - end list or prioritized operators in expression
-, - used to separate parameters in a function prototype or in a function call
-; - used to end a statement
-+ - addition
-- - subtraction
-= - assignment
-== - equality test
-if - begin IF statement
-else - begin 'else' portion of IF statement
-static - indicate variable is permanent, or function has file scope only
-automatic - indicate that variable is allocated for the life of the function
-external_reference - indicate that variable or function is defined in another file
-external_definition - indicate that variable or function is to be accessible from other files
-int - variable is an integer (same as C int)
-char - variable is a character (same as C char)
-unsigned - variable is unsigned. If this is not present, the variable is signed
-return - start function return statement
-void - used as function type to indicate function returns nothing
-@end smallexample
+@itemize @bullet
+@item @{
+used to start the statements in a function
+@item @}
+used to end the statements in a function
+@item (
+start list of function arguments, or to change the precedence of operators in an expression
+@item )
+end list or prioritized operators in expression
+@item ,
+used to separate parameters in a function prototype or in a function call
+@item ;
+used to end a statement
+@item +
+addition
+@item -
+subtraction
+@item =
+assignment
+@item ==
+equality test
+@item if
+begin IF statement
+@item else
+begin 'else' portion of IF statement
+@item static
+indicate variable is permanent, or function has file scope only
+@item automatic
+indicate that variable is allocated for the life of the function
+@item external_reference
+indicate that variable or function is defined in another file
+@item external_definition
+indicate that variable or function is to be accessible from other files
+@item int
+variable is an integer (same as C int)
+@item char
+variable is a character (same as C char)
+@item unsigned
+variable is unsigned. If this is not present, the variable is signed
+@item return
+start function return statement
+@item void
+used as function type to indicate function returns nothing
+@end itemize
@item
-Names consist of any letter or "_" followed by any number of letters or
-numbers or "_". "$" is not allowed in a name. All names must be globally
-unique - the same name may not be used twice in any context - and must
-not be a keyword. Names and keywords are case sensitive. For example:
+Names consist of any letter or "_" followed by any number of letters,
+numbers, or "_". "$" is not allowed in a name. All names must be globally
+unique, i.e. may not be used twice in any context, and must
+not be a keyword. Names and keywords are case sensitive. For example:
@smallexample
a A _a a_ IF_X
diff --git a/gcc/tsystem.h b/gcc/tsystem.h
index d76c1ba62cc..f24bab78cc5 100644
--- a/gcc/tsystem.h
+++ b/gcc/tsystem.h
@@ -62,6 +62,10 @@ extern int atexit (void (*)(void));
extern void abort (void) __attribute__ ((__noreturn__));
#endif
+#ifndef strlen
+extern size_t strlen (const char *);
+#endif
+
#else /* ! inhibit_libc */
/* We disable this when inhibit_libc, so that gcc can still be built without
needing header files first. */
diff --git a/gcc/unroll.c b/gcc/unroll.c
index 38659d461cb..518e4a1168e 100644
--- a/gcc/unroll.c
+++ b/gcc/unroll.c
@@ -2797,8 +2797,9 @@ find_splittable_givs (const struct loop *loop, struct iv_class *bl,
{
rtx tem = gen_reg_rtx (v->mode);
record_base_value (REGNO (tem), v->add_val, 0);
- loop_iv_add_mult_hoist (loop, bl->initial_value, v->mult_val,
- v->add_val, tem);
+ loop_iv_add_mult_hoist (loop,
+ extend_value_for_giv (v, bl->initial_value),
+ v->mult_val, v->add_val, tem);
value = tem;
}
@@ -3421,7 +3422,20 @@ loop_iterations (struct loop *loop)
"Loop iterations: Iteration var not an integer.\n");
return 0;
}
- else if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT)
+
+ /* Try swapping the comparison to identify a suitable iv. */
+ if (REG_IV_TYPE (ivs, REGNO (iteration_var)) != BASIC_INDUCT
+ && REG_IV_TYPE (ivs, REGNO (iteration_var)) != GENERAL_INDUCT
+ && GET_CODE (comparison_value) == REG
+ && REGNO (comparison_value) < ivs->n_regs)
+ {
+ rtx temp = comparison_value;
+ comparison_code = swap_condition (comparison_code);
+ comparison_value = iteration_var;
+ iteration_var = temp;
+ }
+
+ if (REG_IV_TYPE (ivs, REGNO (iteration_var)) == BASIC_INDUCT)
{
if (REGNO (iteration_var) >= ivs->n_regs)
abort ();
diff --git a/gcc/unwind-dw2-fde-darwin.c b/gcc/unwind-dw2-fde-darwin.c
index 26706d33705..24cf3bca7e9 100644
--- a/gcc/unwind-dw2-fde-darwin.c
+++ b/gcc/unwind-dw2-fde-darwin.c
@@ -41,8 +41,8 @@ typedef int __gthread_mutex_t;
#define __gthread_mutex_lock(x) (void)(x)
#define __gthread_mutex_unlock(x) (void)(x)
-static fde * _Unwind_Find_registered_FDE (void *pc,
- struct dwarf_eh_bases *bases);
+static const fde * _Unwind_Find_registered_FDE (void *pc,
+ struct dwarf_eh_bases *bases);
#define _Unwind_Find_FDE _Unwind_Find_registered_FDE
#include "unwind-dw2-fde.c"
@@ -99,7 +99,7 @@ enum {
because this object might be about to be unloaded. Called by
KeyMgr. */
-static void
+static void
live_image_destructor (struct live_images *image)
{
if (image->object_info)
@@ -136,11 +136,11 @@ live_image_destructor (struct live_images *image)
give each unseen image a new `struct object'. Even if we can't,
check whether the PC is inside the FDE of each unseen image.
*/
-
-static inline fde *
+
+static inline const fde *
examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
{
- fde *result = NULL;
+ const fde *result = NULL;
struct live_images *image;
image = _keymgr_get_and_lock_processwide_ptr (KEYMGR_GCC3_LIVE_IMAGE_LIST);
@@ -150,7 +150,7 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
{
char *fde;
unsigned long sz;
-
+
fde = getsectdatafromheader (image->mh, "__DATA", "__eh_frame", &sz);
if (fde == NULL)
{
@@ -159,20 +159,20 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
if (fde != NULL)
image->examined_p |= IMAGE_IS_TEXT_MASK;
}
-
+
/* If .eh_frame is empty, don't register at all. */
if (fde != NULL && sz > 0)
{
char *real_fde = (fde + image->vm_slide);
struct object *ob = NULL;
struct object panicob;
-
+
if (! dont_alloc)
ob = calloc (1, sizeof (struct object));
dont_alloc |= ob == NULL;
if (dont_alloc)
ob = &panicob;
-
+
ob->pc_begin = (void *)-1;
ob->tbase = 0;
ob->dbase = 0;
@@ -180,19 +180,19 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
ob->s.i = 0;
ob->s.b.encoding = DW_EH_PE_omit;
ob->fde_end = real_fde + sz;
-
+
image->fde = real_fde;
-
+
result = search_object (ob, pc);
-
+
if (! dont_alloc)
{
struct object **p;
image->destructor = live_image_destructor;
image->object_info = ob;
-
- image->examined_p |= (EXAMINED_IMAGE_MASK
+
+ image->examined_p |= (EXAMINED_IMAGE_MASK
| DESTRUCTOR_MAY_BE_CALLED_LIVE);
/* Insert the object into the classified list. */
@@ -206,16 +206,16 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
if (result)
{
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 (result);
- read_encoded_value_with_base (encoding,
+ read_encoded_value_with_base (encoding,
base_from_object (encoding, ob),
- result->pc_begin,
+ result->pc_begin,
(_Unwind_Ptr *)&bases->func);
break;
}
@@ -229,25 +229,25 @@ examine_objects (void *pc, struct dwarf_eh_bases *bases, int dont_alloc)
return result;
}
-fde *
+const fde *
_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
{
struct km_object_info *the_obj_info;
- fde *ret = NULL;
+ const fde *ret = NULL;
- the_obj_info =
+ the_obj_info =
_keymgr_get_and_lock_processwide_ptr (KEYMGR_GCC3_DW2_OBJ_LIST);
if (! the_obj_info)
the_obj_info = calloc (1, sizeof (*the_obj_info));
-
+
if (the_obj_info != NULL)
{
seen_objects = the_obj_info->seen_objects;
unseen_objects = the_obj_info->unseen_objects;
-
+
ret = _Unwind_Find_registered_FDE (pc, bases);
}
-
+
/* OK, didn't find it in the list of FDEs we've seen before,
so go through and look at the new ones. */
if (ret == NULL)
diff --git a/gcc/unwind-dw2-fde-glibc.c b/gcc/unwind-dw2-fde-glibc.c
index fbd4291f944..71fbf6144da 100644
--- a/gcc/unwind-dw2-fde-glibc.c
+++ b/gcc/unwind-dw2-fde-glibc.c
@@ -52,7 +52,7 @@
&& (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2) \
|| (__GLIBC__ == 2 && __GLIBC_MINOR__ == 2 && defined(DT_CONFIG)))
-static fde * _Unwind_Find_registered_FDE (void *pc, struct dwarf_eh_bases *bases);
+static const fde * _Unwind_Find_registered_FDE (void *pc, struct dwarf_eh_bases *bases);
#define _Unwind_Find_FDE _Unwind_Find_registered_FDE
#include "unwind-dw2-fde.c"
@@ -68,7 +68,7 @@ struct unw_eh_callback_data
void *tbase;
void *dbase;
void *func;
- fde *ret;
+ const fde *ret;
};
struct unw_eh_frame_hdr
@@ -261,11 +261,11 @@ _Unwind_IteratePhdrCallback (struct dl_phdr_info *info, size_t size, void *ptr)
return 1;
}
-fde *
+const fde *
_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
{
struct unw_eh_callback_data data;
- fde *ret;
+ const fde *ret;
ret = _Unwind_Find_registered_FDE (pc, bases);
if (ret != NULL)
diff --git a/gcc/unwind-dw2-fde.c b/gcc/unwind-dw2-fde.c
index 21d86b03bc1..74e64e5eb80 100644
--- a/gcc/unwind-dw2-fde.c
+++ b/gcc/unwind-dw2-fde.c
@@ -1,5 +1,5 @@
/* Subroutines needed for unwinding stack frames for exception handling. */
-/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+/* Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
Contributed by Jason Merrill <jason@cygnus.com>.
This file is part of GCC.
@@ -74,7 +74,7 @@ init_object_mutex_once (void)
/* Called from crtbegin.o to register the unwind info for an object. */
void
-__register_frame_info_bases (void *begin, struct object *ob,
+__register_frame_info_bases (const void *begin, struct object *ob,
void *tbase, void *dbase)
{
/* If .eh_frame is empty, don't register at all. */
@@ -101,7 +101,7 @@ __register_frame_info_bases (void *begin, struct object *ob,
}
void
-__register_frame_info (void *begin, struct object *ob)
+__register_frame_info (const void *begin, struct object *ob)
{
__register_frame_info_bases (begin, ob, 0, 0);
}
@@ -170,7 +170,7 @@ __register_frame_table (void *begin)
implements __register_frame_info_bases. */
void *
-__deregister_frame_info_bases (void *begin)
+__deregister_frame_info_bases (const void *begin)
{
struct object **p;
struct object *ob = 0;
@@ -220,7 +220,7 @@ __deregister_frame_info_bases (void *begin)
}
void *
-__deregister_frame_info (void *begin)
+__deregister_frame_info (const void *begin)
{
return __deregister_frame_info_bases (begin);
}
@@ -262,7 +262,7 @@ base_from_object (unsigned char encoding, struct object *ob)
/* ??? This is a subset of extract_cie_info from unwind-dw2.c. */
static int
-get_cie_encoding (struct dwarf_cie *cie)
+get_cie_encoding (const struct dwarf_cie *cie)
{
const unsigned char *aug, *p;
_Unwind_Ptr dummy;
@@ -304,7 +304,7 @@ get_cie_encoding (struct dwarf_cie *cie)
}
static inline int
-get_fde_encoding (struct dwarf_fde *f)
+get_fde_encoding (const struct dwarf_fde *f)
{
return get_cie_encoding (get_cie (f));
}
@@ -318,7 +318,7 @@ get_fde_encoding (struct dwarf_fde *f)
static int
fde_unencoded_compare (struct object *ob __attribute__((unused)),
- fde *x, fde *y)
+ const fde *x, const fde *y)
{
_Unwind_Ptr x_ptr = *(_Unwind_Ptr *) x->pc_begin;
_Unwind_Ptr y_ptr = *(_Unwind_Ptr *) y->pc_begin;
@@ -331,7 +331,7 @@ fde_unencoded_compare (struct object *ob __attribute__((unused)),
}
static int
-fde_single_encoding_compare (struct object *ob, fde *x, fde *y)
+fde_single_encoding_compare (struct object *ob, const fde *x, const fde *y)
{
_Unwind_Ptr base, x_ptr, y_ptr;
@@ -347,7 +347,7 @@ fde_single_encoding_compare (struct object *ob, fde *x, fde *y)
}
static int
-fde_mixed_encoding_compare (struct object *ob, fde *x, fde *y)
+fde_mixed_encoding_compare (struct object *ob, const fde *x, const fde *y)
{
int x_encoding, y_encoding;
_Unwind_Ptr x_ptr, y_ptr;
@@ -367,7 +367,7 @@ fde_mixed_encoding_compare (struct object *ob, fde *x, fde *y)
return 0;
}
-typedef int (*fde_compare_t) (struct object *, fde *, fde *);
+typedef int (*fde_compare_t) (struct object *, const fde *, const fde *);
/* This is a special mix of insertion sort and heap sort, optimized for
@@ -394,7 +394,7 @@ start_fde_sort (struct fde_accumulator *accu, size_t count)
if (! count)
return 0;
- size = sizeof (struct fde_vector) + sizeof (fde *) * count;
+ size = sizeof (struct fde_vector) + sizeof (const fde *) * count;
if ((accu->linear = malloc (size)))
{
accu->linear->count = 0;
@@ -407,7 +407,7 @@ start_fde_sort (struct fde_accumulator *accu, size_t count)
}
static inline void
-fde_insert (struct fde_accumulator *accu, fde *this_fde)
+fde_insert (struct fde_accumulator *accu, const fde *this_fde)
{
if (accu->linear)
accu->linear->array[accu->linear->count++] = this_fde;
@@ -429,29 +429,29 @@ static inline void
fde_split (struct object *ob, fde_compare_t fde_compare,
struct fde_vector *linear, struct fde_vector *erratic)
{
- static fde *marker;
+ static const fde *marker;
size_t count = linear->count;
- fde **chain_end = &marker;
+ const 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 **))
+ if (sizeof (const fde *) != sizeof (const fde **))
abort ();
for (i = 0; i < count; i++)
{
- fde **probe;
+ const 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];
+ chain_end = (const fde **) erratic->array[probe - linear->array];
erratic->array[probe - linear->array] = NULL;
}
- erratic->array[i] = (fde *) chain_end;
+ erratic->array[i] = (const fde *) chain_end;
chain_end = &linear->array[i];
}
@@ -467,13 +467,13 @@ fde_split (struct object *ob, fde_compare_t fde_compare,
erratic->count = k;
}
-#define SWAP(x,y) do { fde * tmp = x; x = y; y = tmp; } while (0)
+#define SWAP(x,y) do { const fde * tmp = x; x = y; y = tmp; } while (0)
/* Convert a semi-heap to a heap. A semi-heap is a heap except possibly
for the first (root) node; push it down to its rightful place. */
static void
-frame_downheap (struct object *ob, fde_compare_t fde_compare, fde **a,
+frame_downheap (struct object *ob, fde_compare_t fde_compare, const fde **a,
int lo, int hi)
{
int i, j;
@@ -505,7 +505,7 @@ frame_heapsort (struct object *ob, fde_compare_t fde_compare,
/* 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;
+ const 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]. */
@@ -535,7 +535,7 @@ fde_merge (struct object *ob, fde_compare_t fde_compare,
struct fde_vector *v1, struct fde_vector *v2)
{
size_t i1, i2;
- fde * fde2;
+ const fde * fde2;
i2 = v2->count;
if (i2 > 0)
@@ -595,16 +595,16 @@ end_fde_sort (struct object *ob, struct fde_accumulator *accu, size_t count)
encountered along the way. */
static size_t
-classify_object_over_fdes (struct object *ob, fde *this_fde)
+classify_object_over_fdes (struct object *ob, const fde *this_fde)
{
- struct dwarf_cie *last_cie = 0;
+ const struct dwarf_cie *last_cie = 0;
size_t count = 0;
int encoding = DW_EH_PE_absptr;
_Unwind_Ptr base = 0;
for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))
{
- struct dwarf_cie *this_cie;
+ const struct dwarf_cie *this_cie;
_Unwind_Ptr mask, pc_begin;
/* Skip CIEs. */
@@ -650,15 +650,15 @@ classify_object_over_fdes (struct object *ob, fde *this_fde)
}
static void
-add_fdes (struct object *ob, struct fde_accumulator *accu, fde *this_fde)
+add_fdes (struct object *ob, struct fde_accumulator *accu, const fde *this_fde)
{
- struct dwarf_cie *last_cie = 0;
+ const struct dwarf_cie *last_cie = 0;
int encoding = ob->s.b.encoding;
_Unwind_Ptr base = base_from_object (ob->s.b.encoding, ob);
for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))
{
- struct dwarf_cie *this_cie;
+ const struct dwarf_cie *this_cie;
/* Skip CIEs. */
if (this_fde->CIE_delta == 0)
@@ -766,16 +766,16 @@ init_object (struct object* ob)
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)
+static const fde *
+linear_search_fdes (struct object *ob, const fde *this_fde, void *pc)
{
- struct dwarf_cie *last_cie = 0;
+ const struct dwarf_cie *last_cie = 0;
int encoding = ob->s.b.encoding;
_Unwind_Ptr base = base_from_object (ob->s.b.encoding, ob);
for (; ! last_fde (ob, this_fde); this_fde = next_fde (this_fde))
{
- struct dwarf_cie *this_cie;
+ const struct dwarf_cie *this_cie;
_Unwind_Ptr pc_begin, pc_range;
/* Skip CIEs. */
@@ -835,7 +835,7 @@ linear_search_fdes (struct object *ob, fde *this_fde, void *pc)
/* Binary search for an FDE containing the given PC. Here are three
implementations of increasing complexity. */
-static inline fde *
+static inline const fde *
binary_search_unencoded_fdes (struct object *ob, void *pc)
{
struct fde_vector *vec = ob->u.sort;
@@ -844,7 +844,7 @@ binary_search_unencoded_fdes (struct object *ob, void *pc)
for (lo = 0, hi = vec->count; lo < hi; )
{
size_t i = (lo + hi) / 2;
- fde *f = vec->array[i];
+ const fde *f = vec->array[i];
void *pc_begin;
uaddr pc_range;
@@ -862,7 +862,7 @@ binary_search_unencoded_fdes (struct object *ob, void *pc)
return NULL;
}
-static inline fde *
+static inline const fde *
binary_search_single_encoding_fdes (struct object *ob, void *pc)
{
struct fde_vector *vec = ob->u.sort;
@@ -873,7 +873,7 @@ binary_search_single_encoding_fdes (struct object *ob, void *pc)
for (lo = 0, hi = vec->count; lo < hi; )
{
size_t i = (lo + hi) / 2;
- fde *f = vec->array[i];
+ const fde *f = vec->array[i];
_Unwind_Ptr pc_begin, pc_range;
const char *p;
@@ -892,7 +892,7 @@ binary_search_single_encoding_fdes (struct object *ob, void *pc)
return NULL;
}
-static inline fde *
+static inline const fde *
binary_search_mixed_encoding_fdes (struct object *ob, void *pc)
{
struct fde_vector *vec = ob->u.sort;
@@ -901,7 +901,7 @@ binary_search_mixed_encoding_fdes (struct object *ob, void *pc)
for (lo = 0, hi = vec->count; lo < hi; )
{
size_t i = (lo + hi) / 2;
- fde *f = vec->array[i];
+ const fde *f = vec->array[i];
_Unwind_Ptr pc_begin, pc_range;
const char *p;
int encoding;
@@ -923,7 +923,7 @@ binary_search_mixed_encoding_fdes (struct object *ob, void *pc)
return NULL;
}
-static fde *
+static const fde *
search_object (struct object* ob, void *pc)
{
/* If the data hasn't been sorted, try to do this now. We may have
@@ -956,7 +956,7 @@ search_object (struct object* ob, void *pc)
fde **p;
for (p = ob->u.array; *p ; p++)
{
- fde *f = linear_search_fdes (ob, *p, pc);
+ const fde *f = linear_search_fdes (ob, *p, pc);
if (f)
return f;
}
@@ -967,11 +967,11 @@ search_object (struct object* ob, void *pc)
}
}
-fde *
+const fde *
_Unwind_Find_FDE (void *pc, struct dwarf_eh_bases *bases)
{
struct object *ob;
- fde *f = NULL;
+ const fde *f = NULL;
init_object_mutex_once ();
__gthread_mutex_lock (&object_mutex);
diff --git a/gcc/unwind-dw2-fde.h b/gcc/unwind-dw2-fde.h
index 76d5cf0c89a..1eb6172a628 100644
--- a/gcc/unwind-dw2-fde.h
+++ b/gcc/unwind-dw2-fde.h
@@ -32,9 +32,9 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
struct fde_vector
{
- void *orig_data;
+ const void *orig_data;
size_t count;
- struct dwarf_fde *array[];
+ const struct dwarf_fde *array[];
};
struct object
@@ -43,7 +43,7 @@ struct object
void *tbase;
void *dbase;
union {
- struct dwarf_fde *single;
+ const struct dwarf_fde *single;
struct dwarf_fde **array;
struct fde_vector *sort;
} u;
@@ -90,16 +90,16 @@ struct dwarf_eh_bases
};
-extern void __register_frame_info_bases (void *, struct object *,
+extern void __register_frame_info_bases (const void *, struct object *,
void *, void *);
-extern void __register_frame_info (void *, struct object *);
+extern void __register_frame_info (const 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_info (const void *);
+extern void *__deregister_frame_info_bases (const void *);
extern void __deregister_frame (void *);
@@ -151,22 +151,22 @@ typedef struct dwarf_fde fde;
/* Locate the CIE for a given FDE. */
-static inline struct dwarf_cie *
-get_cie (struct dwarf_fde *f)
+static inline const struct dwarf_cie *
+get_cie (const struct dwarf_fde *f)
{
return (void *)&f->CIE_delta - f->CIE_delta;
}
-static inline fde *
-next_fde (fde *f)
+static inline const fde *
+next_fde (const fde *f)
{
- return (fde *) ((char *) f + f->length + sizeof (f->length));
+ return (const fde *) ((char *) f + f->length + sizeof (f->length));
}
-extern fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
+extern const fde * _Unwind_Find_FDE (void *, struct dwarf_eh_bases *);
static inline int
-last_fde (struct object *obj __attribute__ ((__unused__)), fde *f)
+last_fde (struct object *obj __attribute__ ((__unused__)), const fde *f)
{
#ifdef DWARF2_OBJECT_END_PTR_EXTENSION
return (char *)f == obj->fde_end || f->length == 0;
diff --git a/gcc/unwind-dw2.c b/gcc/unwind-dw2.c
index c6e242a919a..70d32215c7f 100644
--- a/gcc/unwind-dw2.c
+++ b/gcc/unwind-dw2.c
@@ -34,6 +34,9 @@
#include "tm.h"
#include "dwarf2.h"
#include "unwind.h"
+#ifdef __USING_SJLJ_EXCEPTIONS__
+# define NO_SIZE_OF_ENCODED_VALUE
+#endif
#include "unwind-pe.h"
#include "unwind-dw2-fde.h"
#include "gthr.h"
@@ -104,7 +107,7 @@ typedef struct
REG_UNSAVED,
REG_SAVED_OFFSET,
REG_SAVED_REG,
- REG_SAVED_EXP,
+ REG_SAVED_EXP
} how;
} reg[DWARF_FRAME_REGISTERS+1];
@@ -120,7 +123,7 @@ typedef struct
enum {
CFA_UNSET,
CFA_REG_OFFSET,
- CFA_EXP,
+ CFA_EXP
} cfa_how;
/* The PC described by the current frame state. */
@@ -287,7 +290,7 @@ void *
_Unwind_FindEnclosingFunction (void *pc)
{
struct dwarf_eh_bases bases;
- struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
+ const struct dwarf_fde *fde = _Unwind_Find_FDE (pc-1, &bases);
if (fde)
return bases.func;
else
@@ -313,7 +316,7 @@ _Unwind_GetTextRelBase (struct _Unwind_Context *context)
or NULL if we encountered an undecipherable augmentation. */
static const unsigned char *
-extract_cie_info (struct dwarf_cie *cie, struct _Unwind_Context *context,
+extract_cie_info (const struct dwarf_cie *cie, struct _Unwind_Context *context,
_Unwind_FrameState *fs)
{
const unsigned char *aug = cie->augmentation;
@@ -998,8 +1001,8 @@ execute_cfa_program (const unsigned char *insn_ptr,
static _Unwind_Reason_Code
uw_frame_state_for (struct _Unwind_Context *context, _Unwind_FrameState *fs)
{
- struct dwarf_fde *fde;
- struct dwarf_cie *cie;
+ const struct dwarf_fde *fde;
+ const struct dwarf_cie *cie;
const unsigned char *aug, *insn, *end;
memset (fs, 0, sizeof (*fs));
diff --git a/gcc/unwind-libunwind.c b/gcc/unwind-libunwind.c
index 2e53a59eac7..054f9838c1e 100644
--- a/gcc/unwind-libunwind.c
+++ b/gcc/unwind-libunwind.c
@@ -110,9 +110,11 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
_Unwind_Word
_Unwind_GetCFA (struct _Unwind_Context *context)
{
- /* ??? Is there any way to get this information? */
- return NULL;
-}
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_IA64_SP, &ret);
+ return ret;
+}
/* Overwrite the saved value for register REG in CONTEXT with VAL. */
@@ -122,6 +124,11 @@ _Unwind_SetGR (struct _Unwind_Context *context, int index, _Unwind_Word val)
/* Note: here we depend on the fact that general registers are
expected to start with register number 0! */
unw_set_reg (&context->cursor, index, val);
+#ifdef UNW_TARGET_IA64
+ if (index >= UNW_IA64_GR && index <= UNW_IA64_GR + 127)
+ /* Clear the NaT bit. */
+ unw_set_reg (&context->cursor, UNW_IA64_NAT + (index - UNW_IA64_GR), 0);
+#endif
}
/* Retrieve the return address for CONTEXT. */
@@ -167,6 +174,19 @@ _Unwind_FindEnclosingFunction (void *pc)
return NULL;
}
+#ifdef UNW_TARGET_IA64
+
+_Unwind_Word
+_Unwind_GetBSP (struct _Unwind_Context *context)
+{
+ unw_word_t ret;
+
+ unw_get_reg (&context->cursor, UNW_IA64_BSP, &ret);
+ return ret;
+}
+
+#endif
+
#include "unwind.inc"
#endif /* !__USING_SJLJ_EXCEPTIONS__ */
diff --git a/gcc/unwind-pe.h b/gcc/unwind-pe.h
index 224ade33209..4bf2cfd3f02 100644
--- a/gcc/unwind-pe.h
+++ b/gcc/unwind-pe.h
@@ -137,7 +137,7 @@ read_uleb128 (const unsigned char *p, _Unwind_Word *val)
do
{
byte = *p++;
- result |= (byte & 0x7f) << shift;
+ result |= ((_Unwind_Word)byte & 0x7f) << shift;
shift += 7;
}
while (byte & 0x80);
@@ -159,14 +159,14 @@ read_sleb128 (const unsigned char *p, _Unwind_Sword *val)
do
{
byte = *p++;
- result |= (byte & 0x7f) << shift;
+ result |= ((_Unwind_Word)byte & 0x7f) << shift;
shift += 7;
}
while (byte & 0x80);
/* Sign-extend a negative value. */
if (shift < 8 * sizeof(result) && (byte & 0x40) != 0)
- result |= -(1L << shift);
+ result |= -(((_Unwind_Word)1L) << shift);
*val = (_Unwind_Sword) result;
return p;
@@ -199,7 +199,7 @@ read_encoded_value_with_base (unsigned char encoding, _Unwind_Ptr base,
_Unwind_Internal_Ptr a = (_Unwind_Internal_Ptr) p;
a = (a + sizeof (void *) - 1) & - sizeof(void *);
result = *(_Unwind_Internal_Ptr *) a;
- p = (const unsigned char *) (a + sizeof (void *));
+ p = (const unsigned char *) (_Unwind_Internal_Ptr) (a + sizeof (void *));
}
else
{
diff --git a/gcc/unwind-sjlj.c b/gcc/unwind-sjlj.c
index 376135574e0..505bb86dc5a 100644
--- a/gcc/unwind-sjlj.c
+++ b/gcc/unwind-sjlj.c
@@ -182,10 +182,10 @@ _Unwind_GetGR (struct _Unwind_Context *context, int index)
/* Get the value of the CFA as saved in CONTEXT. */
_Unwind_Word
-_Unwind_GetCFA (struct _Unwind_Context *context)
+_Unwind_GetCFA (struct _Unwind_Context *context __attribute__((unused)))
{
/* ??? Ideally __builtin_setjmp places the CFA in the jmpbuf. */
- return NULL;
+ return (_Unwind_Word) 0;
}
void
@@ -223,7 +223,7 @@ _Unwind_GetRegionStart (struct _Unwind_Context *context __attribute__((unused))
}
void *
-_Unwind_FindEnclosingFunction (void *pc)
+_Unwind_FindEnclosingFunction (void *pc __attribute__((unused)))
{
return NULL;
}
diff --git a/gcc/value-prof.c b/gcc/value-prof.c
index 3924fa76c18..4f6f3da599a 100644
--- a/gcc/value-prof.c
+++ b/gcc/value-prof.c
@@ -132,7 +132,7 @@ insn_divmod_values_to_profile (rtx insn, unsigned *n_values,
(*n_values)++;
}
- /* For mod, check whether it is not often a noop (or replacable by
+ /* For mod, check whether it is not often a noop (or replaceable by
a few subtractions). */
if (GET_CODE (set_src) == UMOD && !side_effects_p (op1))
{
@@ -314,7 +314,7 @@ find_values_to_profile (unsigned *n_values, struct histogram_value **values)
we would have to be very careful here. */
bool
-value_profile_transformations ()
+value_profile_transformations (void)
{
rtx insn, next;
int changed = false;
@@ -446,9 +446,9 @@ divmod_fixed_value_transform (rtx insn)
histogram = XEXP (histogram, 1);
all = INTVAL (XEXP (histogram, 0));
- /* We requiere that count is at least half of all; this means
+ /* We require that count is at least half of all; this means
that for the transformation to fire the value must be constant
- at least 50% of time (and 75% gives the garantee of usage). */
+ at least 50% of time (and 75% gives the guarantee of usage). */
if (!rtx_equal_p (op2, value) || 2 * count < all)
return false;
diff --git a/gcc/varasm.c b/gcc/varasm.c
index 791b8ad0a9f..70c13bb6bd1 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -137,6 +137,9 @@ static HOST_WIDE_INT const_alias_set;
static const char *strip_reg_name (const char *);
static int contains_pointers_p (tree);
+#ifdef ASM_OUTPUT_EXTERNAL
+static bool incorporeal_function_p (tree);
+#endif
static void decode_addr_const (tree, struct addr_const *);
static hashval_t const_desc_hash (const void *);
static int const_desc_eq (const void *, const void *);
@@ -791,7 +794,7 @@ make_decl_rtl (tree decl, const char *asmspec)
char *starred = alloca (strlen (asmspec) + 2);
starred[0] = '*';
strcpy (starred + 1, asmspec);
- SET_DECL_ASSEMBLER_NAME (decl, get_identifier (starred));
+ change_decl_assembler_name (decl, get_identifier (starred));
}
name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
@@ -1132,7 +1135,7 @@ assemble_start_function (tree decl, const char *fnname)
maybe_assemble_visibility (decl);
}
- /* Do any machine/system dependent processing of the function name */
+ /* Do any machine/system dependent processing of the function name. */
#ifdef ASM_DECLARE_FUNCTION_NAME
ASM_DECLARE_FUNCTION_NAME (asm_out_file, fnname, current_function_decl);
#else
@@ -1599,6 +1602,29 @@ contains_pointers_p (tree type)
}
}
+#ifdef ASM_OUTPUT_EXTERNAL
+/* True if DECL is a function decl for which no out-of-line copy exists.
+ It is assumed that DECL's assembler name has been set. */
+
+static bool
+incorporeal_function_p (tree decl)
+{
+ if (TREE_CODE (decl) == FUNCTION_DECL && DECL_BUILT_IN (decl))
+ {
+ const char *name;
+
+ if (DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL
+ && DECL_FUNCTION_CODE (decl) == BUILT_IN_ALLOCA)
+ return true;
+
+ name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
+ if (strncmp (name, "__builtin_", strlen ("__builtin_")) == 0)
+ return true;
+ }
+ return false;
+}
+#endif
+
/* Output something to declare an external symbol to the assembler.
(Most assemblers don't need this, so we normally output nothing.)
Do nothing if DECL is not external. */
@@ -1619,7 +1645,8 @@ assemble_external (tree decl ATTRIBUTE_UNUSED)
rtx rtl = DECL_RTL (decl);
if (GET_CODE (rtl) == MEM && GET_CODE (XEXP (rtl, 0)) == SYMBOL_REF
- && ! SYMBOL_REF_USED (XEXP (rtl, 0)))
+ && !SYMBOL_REF_USED (XEXP (rtl, 0))
+ && !incorporeal_function_p (decl))
{
/* Some systems do require some output. */
SYMBOL_REF_USED (XEXP (rtl, 0)) = 1;
@@ -2915,7 +2942,7 @@ force_const_mem (enum machine_mode mode, rtx x)
hash = const_hash_rtx (mode, x);
for (desc = const_rtx_hash_table[hash]; desc; desc = desc->next)
if (compare_constant_rtx (mode, x, desc))
- return desc->rtl;
+ return copy_rtx (desc->rtl);
/* No constant equal to X is known to have been output.
Make a constant descriptor to enter X in the hash table
@@ -2983,7 +3010,7 @@ force_const_mem (enum machine_mode mode, rtx x)
SYMBOL_REF_FLAGS (symbol) = SYMBOL_FLAG_LOCAL;
current_function_uses_const_pool = 1;
- return def;
+ return copy_rtx (def);
}
/* Given a SYMBOL_REF with CONSTANT_POOL_ADDRESS_P true, return a pointer to
@@ -3565,7 +3592,8 @@ initializer_constant_valid_p (tree value, tree endtype)
/* Likewise conversions from int to pointers, but also allow
conversions from 0. */
- if (POINTER_TYPE_P (TREE_TYPE (value))
+ if ((POINTER_TYPE_P (TREE_TYPE (value))
+ || TREE_CODE (TREE_TYPE (value)) == OFFSET_TYPE)
&& INTEGRAL_TYPE_P (TREE_TYPE (TREE_OPERAND (value, 0))))
{
if (integer_zerop (TREE_OPERAND (value, 0)))
@@ -4430,7 +4458,7 @@ default_assemble_visibility (tree decl, int vis)
static void
maybe_assemble_visibility (tree decl)
{
- enum symbol_visibility vis = decl_visibility (decl);
+ enum symbol_visibility vis = DECL_VISIBILITY (decl);
if (vis != VISIBILITY_DEFAULT)
(* targetm.asm_out.visibility) (decl, vis);
@@ -4532,30 +4560,6 @@ decl_tls_model (tree decl)
return kind;
}
-enum symbol_visibility
-decl_visibility (tree decl)
-{
- tree attr = lookup_attribute ("visibility", DECL_ATTRIBUTES (decl));
-
- if (attr)
- {
- const char *which = TREE_STRING_POINTER (TREE_VALUE (TREE_VALUE (attr)));
-
- if (strcmp (which, "default") == 0)
- return VISIBILITY_DEFAULT;
- if (strcmp (which, "internal") == 0)
- return VISIBILITY_INTERNAL;
- if (strcmp (which, "hidden") == 0)
- return VISIBILITY_HIDDEN;
- if (strcmp (which, "protected") == 0)
- return VISIBILITY_PROTECTED;
-
- abort ();
- }
-
- return VISIBILITY_DEFAULT;
-}
-
/* Select a set of attributes for section NAME based on the properties
of DECL and whether or not RELOC indicates that DECL's initializer
might contain runtime relocations.
@@ -5131,7 +5135,7 @@ default_binds_local_p_1 (tree exp, int shlib)
else if (! TREE_PUBLIC (exp))
local_p = true;
/* A variable is local if the user tells us so. */
- else if (decl_visibility (exp) != VISIBILITY_DEFAULT)
+ else if (DECL_VISIBILITY (exp) != VISIBILITY_DEFAULT)
local_p = true;
/* Otherwise, variables defined outside this object may not be local. */
else if (DECL_EXTERNAL (exp))
diff --git a/gcc/version.c b/gcc/version.c
index a46417c48cc..26feb300bc3 100644
--- a/gcc/version.c
+++ b/gcc/version.c
@@ -5,7 +5,7 @@
please modify this string to indicate that, e.g. by putting your
organization's name in parentheses at the end of the string. */
-const char version_string[] = "3.4 20031027 (experimental)";
+const char version_string[] = "3.4.0 20031230 (CodeSourcery ARM Q4 2003)";
/* This is the location of the online document giving instructions for
reporting bugs. If you distribute a modified version of GCC,
@@ -14,4 +14,4 @@ const char version_string[] = "3.4 20031027 (experimental)";
forward us bugs reported to you, if you determine that they are
not bugs in your modifications.) */
-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>";
+const char bug_report_url[] = "arm-gcc@codesourcery.com";
diff --git a/gcc/web.c b/gcc/web.c
index a8f9f04dd4c..e846ee1d2fc 100644
--- a/gcc/web.c
+++ b/gcc/web.c
@@ -20,7 +20,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
02111-1307, USA. */
/* Simple optimization pass that splits independent uses of each pseudo,
- increasing effectivity of other optimizations. The optimization can
+ increasing effectiveness of other optimizations. The optimization can
serve as an example of use for the dataflow module.
We don't split registers with REG_USERVAR set unless -fmessy-debugging
@@ -66,22 +66,18 @@ struct web_entry
rtx reg;
};
-static struct web_entry *unionfind_root PARAMS ((struct web_entry *));
-static void unionfind_union PARAMS ((struct web_entry *,
- struct web_entry *));
-static void union_defs PARAMS ((struct df *, struct ref *,
- struct web_entry *,
- struct web_entry *));
-static rtx entry_register PARAMS ((struct web_entry *,
- struct ref *, char *, char *));
-static void replace_ref PARAMS ((struct ref *, rtx));
-static int mark_addressof PARAMS ((rtx *, void *));
+static struct web_entry *unionfind_root (struct web_entry *);
+static void unionfind_union (struct web_entry *, struct web_entry *);
+static void union_defs (struct df *, struct ref *, struct web_entry *,
+ struct web_entry *);
+static rtx entry_register (struct web_entry *, struct ref *, char *, char *);
+static void replace_ref (struct ref *, rtx);
+static int mark_addressof (rtx *, void *);
/* Find the root of unionfind tree (the representative of set). */
static struct web_entry *
-unionfind_root (element)
- struct web_entry *element;
+unionfind_root (struct web_entry *element)
{
struct web_entry *element1 = element, *element2;
@@ -99,8 +95,7 @@ unionfind_root (element)
/* Union sets. */
static void
-unionfind_union (first, second)
- struct web_entry *first, *second;
+unionfind_union (struct web_entry *first, struct web_entry *second)
{
first = unionfind_root (first);
second = unionfind_root (second);
@@ -113,11 +108,8 @@ unionfind_union (first, second)
register, union them. */
static void
-union_defs (df, use, def_entry, use_entry)
- struct df *df;
- struct ref *use;
- struct web_entry *def_entry;
- struct web_entry *use_entry;
+union_defs (struct df *df, struct ref *use, struct web_entry *def_entry,
+ struct web_entry *use_entry)
{
rtx insn = DF_REF_INSN (use);
struct df_link *link = DF_REF_CHAIN (use);
@@ -179,11 +171,8 @@ union_defs (df, use, def_entry, use_entry)
/* Find the corresponding register for the given entry. */
static rtx
-entry_register (entry, ref, used, use_addressof)
- struct web_entry *entry;
- struct ref *ref;
- char *used;
- char *use_addressof;
+entry_register (struct web_entry *entry, struct ref *ref, char *used,
+ char *use_addressof)
{
struct web_entry *root;
rtx reg, newreg;
@@ -235,9 +224,7 @@ entry_register (entry, ref, used, use_addressof)
/* Replace the reference by REG. */
static void
-replace_ref (ref, reg)
- struct ref *ref;
- rtx reg;
+replace_ref (struct ref *ref, rtx reg)
{
rtx oldreg = DF_REF_REAL_REG (ref);
rtx *loc = DF_REF_REAL_LOC (ref);
@@ -253,9 +240,7 @@ replace_ref (ref, reg)
/* Mark each pseudo whose address is taken. */
static int
-mark_addressof (rtl, data)
- rtx *rtl;
- void *data;
+mark_addressof (rtx *rtl, void *data)
{
if (!*rtl)
return 0;
@@ -268,7 +253,7 @@ mark_addressof (rtl, data)
/* Main entry point. */
void
-web_main ()
+web_main (void)
{
struct df *df;
struct web_entry *def_entry;
diff --git a/gcc/dbxstclass.h b/gcc/xcoff.h
index 2d003fed3bb..2d003fed3bb 100644
--- a/gcc/dbxstclass.h
+++ b/gcc/xcoff.h
diff --git a/gcc/xcoffout.c b/gcc/xcoffout.c
index 7c03ca5b096..324c5d5fa5b 100644
--- a/gcc/xcoffout.c
+++ b/gcc/xcoffout.c
@@ -39,7 +39,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#ifdef XCOFF_DEBUGGING_INFO
/* This defines the C_* storage classes. */
-#include "dbxstclass.h"
+#include "xcoff.h"
#include "xcoffout.h"
#include "dbxout.h"
#include "gstab.h"
diff --git a/include/ChangeLog b/include/ChangeLog
index 049942f4ee3..3b132883f36 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,27 @@
+2003-12-23 Zack Weinberg <zack@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * libiberty.h (pmkpipe): New function.
+ (pexec): Likewise.
+ (pexec_set_program_name): Likewise.
+ (WIFSIGNALED): Define.
+ (WTERMSIG): Likewise.
+ (WIFEXITED): Likewise.
+ (WEXITSTATUS): Likewise.
+ (WSTOPSIG): Likewise.
+ (WCOREDUMP): Likewise.
+
+2003-12-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * include/fibheap.h (fibnode): Use __extension__ for
+ bit-fields mark and degree if __GNUC__.
+
+2003-12-18 Kazu Hirata <kazu@cs.umass.edu>
+
+ * include/fibheap.h (fibnode): Use unsigned long int for
+ bit-fields if __GNUC__ is defined.
+
2003-10-22 Joseph S. Myers <jsm@polyomino.org.uk>
* obstack.h: Merge the following change from gnulib:
diff --git a/include/fibheap.h b/include/fibheap.h
index fc37f9ef635..4eebaf13ba6 100644
--- a/include/fibheap.h
+++ b/include/fibheap.h
@@ -59,8 +59,13 @@ typedef struct fibnode
struct fibnode *right;
fibheapkey_t key;
void *data;
+#ifdef __GNUC__
+ __extension__ unsigned long int degree : 31;
+ __extension__ unsigned long int mark : 1;
+#else
unsigned int degree : 31;
unsigned int mark : 1;
+#endif
} *fibnode_t;
extern fibheap_t fibheap_new PARAMS ((void));
diff --git a/include/libiberty.h b/include/libiberty.h
index 761b2cf060f..d6a38be4b6c 100644
--- a/include/libiberty.h
+++ b/include/libiberty.h
@@ -74,7 +74,7 @@ extern char **dupargv PARAMS ((char **)) ATTRIBUTE_MALLOC;
to find the declaration so provide a fully prototyped one. If it
is 1, we found it so don't provide any declaration at all. */
#if !HAVE_DECL_BASENAME
-#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (HAVE_DECL_BASENAME)
+#if defined (__GNU_LIBRARY__ ) || defined (__linux__) || defined (__FreeBSD__) || defined (__OpenBSD__) || defined(__NetBSD__) || defined (__CYGWIN__) || defined (__CYGWIN32__) || defined (__sun__) || defined (HAVE_DECL_BASENAME)
extern char *basename PARAMS ((const char *));
#else
extern char *basename ();
@@ -274,10 +274,65 @@ extern void hex_init PARAMS ((void));
extern int pexecute PARAMS ((const char *, char * const *, const char *,
const char *, char **, char **, int));
-/* Wait for pexecute to finish. */
+/* Slightly lower level routines which are more flexible than pexecute: */
+extern int pmkpipe PARAMS ((int[2]));
+
+extern int pexec PARAMS ((const char *, char * const *, int, int, int, int));
+
+/* Wait for a process created by pexecute or pexec to finish. */
extern int pwait PARAMS ((int, int *, int));
+/* Set the program name used for error messages by pexec. */
+extern void pexec_set_program_name PARAMS ((const char *));
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(S) (((S) & 0xff) != 0 && ((S) & 0xff) != 0x7f)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(S) ((S) & 0x7f)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(S) (((S) & 0xff) == 0)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(S) (((S) & 0xff00) >> 8)
+#endif
+#ifndef WSTOPSIG
+#define WSTOPSIG WEXITSTATUS
+#endif
+#ifndef WCOREDUMP
+#define WCOREDUMP(S) ((S) & WCOREFLG)
+#endif
+#ifndef WCOREFLG
+#define WCOREFLG 0200
+#endif
+
+#else /* defined(_WIN32) && ! defined(__CYGWIN__) */
+
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(S) ((void)(S), 0)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(S) ((void)(S), 0)
+#endif
+#ifndef WIFEXITED
+#define WIFEXITED(S) ((void)(S), 1)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(S) (S)
+#endif
+#ifndef WSTOPSIG
+#define WSTOPSIG WEXITSTATUS
+#endif
+#ifndef WCOREDUMP
+#define WCOREDUMP(S) ((void)(S), 0)
+#endif
+
+#endif
+
#if !HAVE_DECL_ASPRINTF
/* Like sprintf but provides a pointer to malloc'd storage, which must
be freed by the caller. */
diff --git a/libffi/ChangeLog b/libffi/ChangeLog
index 00ee87c6fdf..b69c7fb53d7 100644
--- a/libffi/ChangeLog
+++ b/libffi/ChangeLog
@@ -1,6 +1,206 @@
+2003-12-10 Richard Henderson <rth@redhat.com>
+
+ * testsuite/libffi.call/cls_align_pointer.c: Cast pointers to
+ size_t instead of int.
+
+2003-12-04 Hosaka Yuji <hos@tamanegi.org>
+
+ * testsuite/libffi.call/many_win32.c: Include <float.h>.
+ * testsuite/libffi.call/many_win32.c (main): Replace variable
+ int i with unsigned long ul.
+
+ * testsuite/libffi.call/cls_align_uint64.c: New test case.
+ * testsuite/libffi.call/cls_align_sint64.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint32.c: Likewise.
+ * testsuite/libffi.call/cls_align_uint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_sint16.c: Likewise.
+ * testsuite/libffi.call/cls_align_float.c: Likewise.
+ * testsuite/libffi.call/cls_align_double.c: Likewise.
+ * testsuite/libffi.call/cls_align_longdouble.c: Likewise.
+ * testsuite/libffi.call/cls_align_pointer.c: Likewise.
+
+2003-12-02 Hosaka Yuji <hos@tamanegi.org>
+
+ PR other/13221
+ * src/x86/ffi.c (ffi_prep_args, ffi_prep_incoming_args_SYSV):
+ Align arguments to 32 bits.
+
+2003-12-01 Andreas Tobler <a.tobler@schweiz.ch>
+
+ PR other/13221
+ * testsuite/libffi.call/cls_multi_sshort.c: New test case.
+ * testsuite/libffi.call/cls_multi_sshortchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_schar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushortchar.c: Likewise.
+ * testsuite/libffi.call/cls_multi_ushort.c: Likewise.
+
+ * testsuite/libffi.special/unwindtest.cc: Cosmetics.
+
+2003-11-26 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * testsuite/libffi.call/ffitest.h: Include <fcntl.h>.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+
+2003-11-22 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * Makefile.in: Rebuilt.
+ * configure: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Convert the mmap to
+ the right type.
+
+2003-11-21 Andreas Jaeger <aj@suse.de>
+ Andreas Tobler <a.tobler@schweiz.ch>
+
+ * acinclude.m4: Add AC_FUNC_MMAP_BLACKLIST.
+ * configure.in: Call AC_FUNC_MMAP_BLACKLIST.
+ * Makefile.in: Rebuilt.
+ * aclocal.m4: Likewise.
+ * configure: Likewise.
+ * fficonfig.h.in: Likewise.
+ * testsuite/lib/libffi-dg.exp: Add include dir.
+ * testsuite/libffi.call/ffitest.h: Add MMAP definitions.
+ * testsuite/libffi.special/ffitestcxx.h: Likewise.
+ * testsuite/libffi.call/closure_fn0.c: Use MMAP functionality
+ for ffi_closure if available.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/nested_struct.c: Likewise.
+ * testsuite/libffi.call/nested_struct1.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+ * testsuite/libffi.special/unwindtest.cc: Likewise.
+
+2003-11-20 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Make the -lgcc_s conditional.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libffi-dg.exp: Add DYLD_LIBRARY_PATH for darwin.
+ Add -lgcc_s to additional flags.
+
+2003-11-12 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * configure.in, include/Makefile.am: PR libgcj/11147, install
+ the ffitarget.h header file in a gcc versioned and target
+ dependent place.
+ * configure: Regenerated.
+ * Makefile.in, include/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+
+2003-11-09 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/closure_fn0.c: Print result and check
+ with dg-output to make debugging easier.
+ * testsuite/libffi.call/closure_fn1.c: Likewise.
+ * testsuite/libffi.call/closure_fn2.c: Likewise.
+ * testsuite/libffi.call/closure_fn3.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_12byte.c: Likewise.
+ * testsuite/libffi.call/cls_16byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_1_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_24byte.c: Likewise.
+ * testsuite/libffi.call/cls_2byte.c: Likewise.
+ * testsuite/libffi.call/cls_3_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_3byte1.c: Likewise.
+ * testsuite/libffi.call/cls_3byte2.c: Likewise.
+ * testsuite/libffi.call/cls_4_1byte.c: Likewise.
+ * testsuite/libffi.call/cls_4byte.c: Likewise.
+ * testsuite/libffi.call/cls_5byte.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_6byte.c: Likewise.
+ * testsuite/libffi.call/cls_7byte.c: Likewise.
+ * testsuite/libffi.call/cls_8byte.c: Likewise.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_9byte2.c: Likewise.
+ * testsuite/libffi.call/cls_double.c: Likewise.
+ * testsuite/libffi.call/cls_float.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/problem1.c: Likewise.
+
+ * testsuite/libffi.special/unwindtest.cc: Make ffi_closure
+ static.
+
+2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_9byte2.c: New test case.
+ * testsuite/libffi.call/cls_9byte1.c: Likewise.
+ * testsuite/libffi.call/cls_64byte.c: Likewise.
+ * testsuite/libffi.call/cls_20byte1.c: Likewise.
+ * testsuite/libffi.call/cls_19byte.c: Likewise.
+ * testsuite/libffi.call/cls_18byte.c: Likewise.
+ * testsuite/libffi.call/closure_fn4.c: Likewise.
+ * testsuite/libffi.call/closure_fn5.c: Likewise.
+ * testsuite/libffi.call/cls_schar.c: Likewise.
+ * testsuite/libffi.call/cls_sint.c: Likewise.
+ * testsuite/libffi.call/cls_sshort.c: Likewise.
+ * testsuite/libffi.call/nested_struct2.c: Likewise.
+ * testsuite/libffi.call/nested_struct3.c: Likewise.
+
+2003-11-08 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/libffi.call/cls_double.c: Do a check on the result.
+ * testsuite/libffi.call/cls_uchar.c: Likewise.
+ * testsuite/libffi.call/cls_uint.c: Likewise.
+ * testsuite/libffi.call/cls_ulonglong.c: Likewise.
+ * testsuite/libffi.call/cls_ushort.c: Likewise.
+ * testsuite/libffi.call/return_sc.c: Cleanup whitespaces.
+
+2003-11-06 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * src/prep_cif.c (ffi_prep_cif): Move the validity check after
+ the initialization.
+
2003-10-23 Andreas Tobler <a.tobler@schweiz.ch>
- * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
+ * src/java_raw_api.c (ffi_java_ptrarray_to_raw): Replace
FFI_ASSERT(FALSE) with FFI_ASSERT(0).
2003-10-22 David Daney <ddaney@avtrex.com>
diff --git a/libffi/Makefile.in b/libffi/Makefile.in
index bca6caf87b2..adb3772488d 100644
--- a/libffi/Makefile.in
+++ b/libffi/Makefile.in
@@ -85,7 +85,9 @@ STRIP = @STRIP@
TARGET = @TARGET@
TARGETDIR = @TARGETDIR@
VERSION = @VERSION@
+gcc_version = @gcc_version@
libffi_basedir = @libffi_basedir@
+tool_include_dir = @tool_include_dir@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
@@ -244,112 +246,112 @@ libffi_convenience_la_LIBADD =
@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \
@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo
-@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
-@SH_TRUE@src/sh/ffi.lo
-@POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
-@POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
-@POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
-@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo
-@ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
-@ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
-@ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo
-@IA64_TRUE@libffi_convenience_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
+@M68K_TRUE@libffi_convenience_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
@POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo
+@ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+@ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo
+@ARM_TRUE@libffi_convenience_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_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
+@POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
+@POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \
+@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo
+@POWERPC_TRUE@libffi_convenience_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 \
+@POWERPC_TRUE@src/powerpc/linux64.lo src/powerpc/linux64_closure.lo
@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo
-@X86_TRUE@libffi_convenience_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
+@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
+@SH_TRUE@src/sh/ffi.lo
@X86_WIN32_TRUE@libffi_convenience_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
-@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
-@SH64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
@SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \
@SPARC_TRUE@src/sparc/v9.lo
-@POWERPC_TRUE@libffi_convenience_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 \
-@POWERPC_TRUE@src/powerpc/linux64.lo src/powerpc/linux64_closure.lo
-@ARM_TRUE@libffi_convenience_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
+@SH64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
+@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@MIPS_IRIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \
@MIPS_IRIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \
@MIPS_IRIX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \
@MIPS_IRIX_TRUE@src/mips/n32.lo
-@M68K_TRUE@libffi_convenience_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
+@X86_TRUE@libffi_convenience_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
+@IA64_TRUE@libffi_convenience_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
libffi_la_LIBADD =
@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \
@X86_64_TRUE@src/x86/sysv.lo
-@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
-@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
-@SH_TRUE@src/sh/ffi.lo
-@POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
-@POWERPC_AIX_TRUE@src/powerpc/aix_closure.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
-@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
+@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
@POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \
@POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.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
+@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_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \
+@POWERPC_AIX_TRUE@src/powerpc/aix_closure.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 src/powerpc/linux64.lo \
+@POWERPC_TRUE@src/powerpc/linux64_closure.lo
@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.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
+@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \
+@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \
+@SH_TRUE@src/sh/ffi.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
-@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
-@SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
-@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
-@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
@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
-@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 src/powerpc/linux64.lo \
-@POWERPC_TRUE@src/powerpc/linux64_closure.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
+@SH64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@SH64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@SH64_TRUE@src/sh64/sysv.lo src/sh64/ffi.lo
+@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo
@MIPS_IRIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \
@MIPS_IRIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \
@MIPS_IRIX_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
+@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
+@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
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/libffi/acinclude.m4 b/libffi/acinclude.m4
index 9c2ef36254b..90896098c70 100644
--- a/libffi/acinclude.m4
+++ b/libffi/acinclude.m4
@@ -8,4 +8,93 @@ AC_DEFUN([AM_PROG_LIBTOOL],)
AC_SUBST(LIBTOOL)
])
+# mmap(2) blacklisting. Some platforms provide the mmap library routine
+# but don't support all of the features we need from it.
+AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
+[if test $ac_cv_header_sys_mman_h != yes \
+ || test $ac_cv_func_mmap != yes; then
+ ac_cv_func_mmap_file=no
+ ac_cv_func_mmap_dev_zero=no
+ ac_cv_func_mmap_anon=no
+else
+ AC_CACHE_CHECK([whether read-only mmap of a plain file works],
+ ac_cv_func_mmap_file,
+ [# Add a system to this blacklist if
+ # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
+ # memory area containing the same data that you'd get if you applied
+ # read() to the same fd. The only system known to have a problem here
+ # is VMS, where text files have record structure.
+ case "$host_os" in
+ vms* | ultrix*)
+ ac_cv_func_mmap_file=no ;;
+ *)
+ ac_cv_func_mmap_file=yes;;
+ esac])
+ AC_CACHE_CHECK([whether mmap from /dev/zero works],
+ ac_cv_func_mmap_dev_zero,
+ [# Add a system to this blacklist if it has mmap() but /dev/zero
+ # does not exist, or if mmapping /dev/zero does not give anonymous
+ # zeroed pages with both the following properties:
+ # 1. If you map N consecutive pages in with one call, and then
+ # unmap any subset of those pages, the pages that were not
+ # explicitly unmapped remain accessible.
+ # 2. If you map two adjacent blocks of memory and then unmap them
+ # both at once, they must both go away.
+ # Systems known to be in this category are Windows (all variants),
+ # VMS, and Darwin.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
+ ac_cv_func_mmap_dev_zero=no ;;
+ *)
+ ac_cv_func_mmap_dev_zero=yes;;
+ esac])
+
+ # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
+ AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon,
+ [AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+],
+[int n = MAP_ANONYMOUS;],
+ ac_cv_decl_map_anon=yes,
+ ac_cv_decl_map_anon=no)])
+
+ if test $ac_cv_decl_map_anon = no; then
+ ac_cv_func_mmap_anon=no
+ else
+ AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
+ ac_cv_func_mmap_anon,
+ [# Add a system to this blacklist if it has mmap() and MAP_ANON or
+ # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
+ # doesn't give anonymous zeroed pages with the same properties listed
+ # above for use of /dev/zero.
+ # Systems known to be in this category are Windows, VMS, and SCO Unix.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | sco* | udk* )
+ ac_cv_func_mmap_anon=no ;;
+ *)
+ ac_cv_func_mmap_anon=yes;;
+ esac])
+ fi
+fi
+
+if test $ac_cv_func_mmap_file = yes; then
+ AC_DEFINE(HAVE_MMAP_FILE, 1,
+ [Define if read-only mmap of a plain file works.])
+fi
+if test $ac_cv_func_mmap_dev_zero = yes; then
+ AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
+ [Define if mmap of /dev/zero works.])
+fi
+if test $ac_cv_func_mmap_anon = yes; then
+ AC_DEFINE(HAVE_MMAP_ANON, 1,
+ [Define if mmap with MAP_ANON(YMOUS) works.])
+fi
+])
+
sinclude(../config/accross.m4)
diff --git a/libffi/aclocal.m4 b/libffi/aclocal.m4
index 6ee973732a8..7dabcced86d 100644
--- a/libffi/aclocal.m4
+++ b/libffi/aclocal.m4
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+dnl aclocal.m4 generated automatically by aclocal 1.4
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999 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.
@@ -20,11 +20,100 @@ AC_DEFUN([AM_PROG_LIBTOOL],)
AC_SUBST(LIBTOOL)
])
+# mmap(2) blacklisting. Some platforms provide the mmap library routine
+# but don't support all of the features we need from it.
+AC_DEFUN([AC_FUNC_MMAP_BLACKLIST],
+[if test $ac_cv_header_sys_mman_h != yes \
+ || test $ac_cv_func_mmap != yes; then
+ ac_cv_func_mmap_file=no
+ ac_cv_func_mmap_dev_zero=no
+ ac_cv_func_mmap_anon=no
+else
+ AC_CACHE_CHECK([whether read-only mmap of a plain file works],
+ ac_cv_func_mmap_file,
+ [# Add a system to this blacklist if
+ # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
+ # memory area containing the same data that you'd get if you applied
+ # read() to the same fd. The only system known to have a problem here
+ # is VMS, where text files have record structure.
+ case "$host_os" in
+ vms* | ultrix*)
+ ac_cv_func_mmap_file=no ;;
+ *)
+ ac_cv_func_mmap_file=yes;;
+ esac])
+ AC_CACHE_CHECK([whether mmap from /dev/zero works],
+ ac_cv_func_mmap_dev_zero,
+ [# Add a system to this blacklist if it has mmap() but /dev/zero
+ # does not exist, or if mmapping /dev/zero does not give anonymous
+ # zeroed pages with both the following properties:
+ # 1. If you map N consecutive pages in with one call, and then
+ # unmap any subset of those pages, the pages that were not
+ # explicitly unmapped remain accessible.
+ # 2. If you map two adjacent blocks of memory and then unmap them
+ # both at once, they must both go away.
+ # Systems known to be in this category are Windows (all variants),
+ # VMS, and Darwin.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
+ ac_cv_func_mmap_dev_zero=no ;;
+ *)
+ ac_cv_func_mmap_dev_zero=yes;;
+ esac])
+
+ # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
+ AC_CACHE_CHECK([for MAP_ANON(YMOUS)], ac_cv_decl_map_anon,
+ [AC_TRY_COMPILE(
+[#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+],
+[int n = MAP_ANONYMOUS;],
+ ac_cv_decl_map_anon=yes,
+ ac_cv_decl_map_anon=no)])
+
+ if test $ac_cv_decl_map_anon = no; then
+ ac_cv_func_mmap_anon=no
+ else
+ AC_CACHE_CHECK([whether mmap with MAP_ANON(YMOUS) works],
+ ac_cv_func_mmap_anon,
+ [# Add a system to this blacklist if it has mmap() and MAP_ANON or
+ # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
+ # doesn't give anonymous zeroed pages with the same properties listed
+ # above for use of /dev/zero.
+ # Systems known to be in this category are Windows, VMS, and SCO Unix.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | sco* | udk* )
+ ac_cv_func_mmap_anon=no ;;
+ *)
+ ac_cv_func_mmap_anon=yes;;
+ esac])
+ fi
+fi
+
+if test $ac_cv_func_mmap_file = yes; then
+ AC_DEFINE(HAVE_MMAP_FILE, 1,
+ [Define if read-only mmap of a plain file works.])
+fi
+if test $ac_cv_func_mmap_dev_zero = yes; then
+ AC_DEFINE(HAVE_MMAP_DEV_ZERO, 1,
+ [Define if mmap of /dev/zero works.])
+fi
+if test $ac_cv_func_mmap_anon = yes; then
+ AC_DEFINE(HAVE_MMAP_ANON, 1,
+ [Define if mmap with MAP_ANON(YMOUS) works.])
+fi
+])
+
sinclude(../config/accross.m4)
# 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.
@@ -54,7 +143,7 @@ changequote([,]))])
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)
@@ -82,7 +171,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
@@ -123,7 +212,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.
@@ -142,7 +231,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,
@@ -159,7 +248,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
diff --git a/libffi/configure b/libffi/configure
index 0ffe09c68e4..bd94f7dd535 100755
--- a/libffi/configure
+++ b/libffi/configure
@@ -1250,6 +1250,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
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
@@ -1260,6 +1261,7 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ lt_cv_deplibs_check_method=pass_all
;;
freebsd* )
@@ -1384,13 +1386,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:1388: checking for object suffix" >&5
+echo "configure:1390: 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:1394: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:1396: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -1410,7 +1412,7 @@ ac_objext=$ac_cv_objext
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1414: checking for executable suffix" >&5
+echo "configure:1416: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1420,7 +1422,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1426: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1453,7 +1455,7 @@ 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:1457: checking for ${ac_tool_prefix}file" >&5
+echo "configure:1459: 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
@@ -1515,7 +1517,7 @@ 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:1519: checking for file" >&5
+echo "configure:1521: 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
@@ -1586,7 +1588,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:1590: checking for $ac_word" >&5
+echo "configure:1592: 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
@@ -1618,7 +1620,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:1622: checking for $ac_word" >&5
+echo "configure:1624: 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
@@ -1653,7 +1655,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:1657: checking for $ac_word" >&5
+echo "configure:1659: 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
@@ -1685,7 +1687,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:1689: checking for $ac_word" >&5
+echo "configure:1691: 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
@@ -1752,8 +1754,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 1756 "configure"' > conftest.$ac_ext
- if { (eval echo configure:1757: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 1758 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:1759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -1786,7 +1788,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:1790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:1792: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -1802,7 +1804,7 @@ ia64-*-hpux*)
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:1806: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:1808: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
@@ -1846,7 +1848,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:1850: checking whether the C compiler needs -belf" >&5
+echo "configure:1852: 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
@@ -1859,14 +1861,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 1863 "configure"
+#line 1865 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1872: \"$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
@@ -1994,7 +1996,7 @@ exec 5>>./config.log
# 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:1998: checking for a BSD compatible install" >&5
+echo "configure:2000: 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
@@ -2047,7 +2049,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:2051: checking whether build environment is sane" >&5
+echo "configure:2053: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -2104,7 +2106,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:2108: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:2110: 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
@@ -2143,7 +2145,7 @@ fi
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:2147: checking for working aclocal" >&5
+echo "configure:2149: 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.
@@ -2156,7 +2158,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:2160: checking for working autoconf" >&5
+echo "configure:2162: 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.
@@ -2169,7 +2171,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:2173: checking for working automake" >&5
+echo "configure:2175: 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.
@@ -2182,7 +2184,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:2186: checking for working autoheader" >&5
+echo "configure:2188: 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.
@@ -2195,7 +2197,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:2199: checking for working makeinfo" >&5
+echo "configure:2201: 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.
@@ -2212,7 +2214,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:2216: checking for executable suffix" >&5
+echo "configure:2218: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -2222,7 +2224,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:2226: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:2228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -2243,7 +2245,7 @@ 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:2247: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:2249: 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"
@@ -2269,7 +2271,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:2273: checking for $ac_word" >&5
+echo "configure:2275: 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
@@ -2299,7 +2301,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:2303: checking for $ac_word" >&5
+echo "configure:2305: 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
@@ -2350,7 +2352,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:2354: checking for $ac_word" >&5
+echo "configure:2356: 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
@@ -2382,7 +2384,7 @@ fi
fi
echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:2386: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+echo "configure:2388: 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.
@@ -2393,12 +2395,12 @@ cross_compiling=$ac_cv_prog_cc_cross
cat > conftest.$ac_ext << EOF
-#line 2397 "configure"
+#line 2399 "configure"
#include "confdefs.h"
main(){return(0);}
EOF
-if { (eval echo configure:2402: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2404: \"$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
@@ -2424,12 +2426,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:2428: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "configure:2430: 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:2433: checking whether we are using GNU C" >&5
+echo "configure:2435: 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
@@ -2438,7 +2440,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2442: \"$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:2444: \"$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
@@ -2457,7 +2459,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:2461: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:2463: 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
@@ -2495,6 +2497,136 @@ fi
+if test $ac_cv_header_sys_mman_h != yes \
+ || test $ac_cv_func_mmap != yes; then
+ ac_cv_func_mmap_file=no
+ ac_cv_func_mmap_dev_zero=no
+ ac_cv_func_mmap_anon=no
+else
+ echo $ac_n "checking whether read-only mmap of a plain file works""... $ac_c" 1>&6
+echo "configure:2508: checking whether read-only mmap of a plain file works" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_file'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # Add a system to this blacklist if
+ # mmap(0, stat_size, PROT_READ, MAP_PRIVATE, fd, 0) doesn't return a
+ # memory area containing the same data that you'd get if you applied
+ # read() to the same fd. The only system known to have a problem here
+ # is VMS, where text files have record structure.
+ case "$host_os" in
+ vms* | ultrix*)
+ ac_cv_func_mmap_file=no ;;
+ *)
+ ac_cv_func_mmap_file=yes;;
+ esac
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_file" 1>&6
+ echo $ac_n "checking whether mmap from /dev/zero works""... $ac_c" 1>&6
+echo "configure:2527: checking whether mmap from /dev/zero works" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_dev_zero'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # Add a system to this blacklist if it has mmap() but /dev/zero
+ # does not exist, or if mmapping /dev/zero does not give anonymous
+ # zeroed pages with both the following properties:
+ # 1. If you map N consecutive pages in with one call, and then
+ # unmap any subset of those pages, the pages that were not
+ # explicitly unmapped remain accessible.
+ # 2. If you map two adjacent blocks of memory and then unmap them
+ # both at once, they must both go away.
+ # Systems known to be in this category are Windows (all variants),
+ # VMS, and Darwin.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | darwin* | ultrix* | hpux10* | hpux11.00)
+ ac_cv_func_mmap_dev_zero=no ;;
+ *)
+ ac_cv_func_mmap_dev_zero=yes;;
+ esac
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_dev_zero" 1>&6
+
+ # Unlike /dev/zero, the MAP_ANON(YMOUS) defines can be probed for.
+ echo $ac_n "checking for MAP_ANON(YMOUS)""... $ac_c" 1>&6
+echo "configure:2553: checking for MAP_ANON(YMOUS)" >&5
+if eval "test \"`echo '$''{'ac_cv_decl_map_anon'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ cat > conftest.$ac_ext <<EOF
+#line 2558 "configure"
+#include "confdefs.h"
+#include <sys/types.h>
+#include <sys/mman.h>
+#include <unistd.h>
+
+#ifndef MAP_ANONYMOUS
+#define MAP_ANONYMOUS MAP_ANON
+#endif
+
+int main() {
+int n = MAP_ANONYMOUS;
+; return 0; }
+EOF
+if { (eval echo configure:2572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ rm -rf conftest*
+ ac_cv_decl_map_anon=yes
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ ac_cv_decl_map_anon=no
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_decl_map_anon" 1>&6
+
+ if test $ac_cv_decl_map_anon = no; then
+ ac_cv_func_mmap_anon=no
+ else
+ echo $ac_n "checking whether mmap with MAP_ANON(YMOUS) works""... $ac_c" 1>&6
+echo "configure:2590: checking whether mmap with MAP_ANON(YMOUS) works" >&5
+if eval "test \"`echo '$''{'ac_cv_func_mmap_anon'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ # Add a system to this blacklist if it has mmap() and MAP_ANON or
+ # MAP_ANONYMOUS, but using mmap(..., MAP_PRIVATE|MAP_ANONYMOUS, -1, 0)
+ # doesn't give anonymous zeroed pages with the same properties listed
+ # above for use of /dev/zero.
+ # Systems known to be in this category are Windows, VMS, and SCO Unix.
+ case "$host_os" in
+ vms* | cygwin* | pe | mingw* | sco* | udk* )
+ ac_cv_func_mmap_anon=no ;;
+ *)
+ ac_cv_func_mmap_anon=yes;;
+ esac
+fi
+
+echo "$ac_t""$ac_cv_func_mmap_anon" 1>&6
+ fi
+fi
+
+if test $ac_cv_func_mmap_file = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP_FILE 1
+EOF
+
+fi
+if test $ac_cv_func_mmap_dev_zero = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP_DEV_ZERO 1
+EOF
+
+fi
+if test $ac_cv_func_mmap_anon = yes; then
+ cat >> confdefs.h <<\EOF
+#define HAVE_MMAP_ANON 1
+EOF
+
+fi
+
+
if test -d $srcdir/testsuite; then
@@ -2697,7 +2829,7 @@ case x$TARGET in
esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2701: checking how to run the C preprocessor" >&5
+echo "configure:2833: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -2712,13 +2844,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 2716 "configure"
+#line 2848 "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:2722: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2854: \"$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
:
@@ -2729,13 +2861,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 2733 "configure"
+#line 2865 "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:2739: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2871: \"$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
:
@@ -2746,13 +2878,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 2750 "configure"
+#line 2882 "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:2756: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2888: \"$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
:
@@ -2777,12 +2909,12 @@ fi
echo "$ac_t""$CPP" 1>&6
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2781: checking for ANSI C header files" >&5
+echo "configure:2913: 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 2786 "configure"
+#line 2918 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -2790,7 +2922,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2794: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2926: \"$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*
@@ -2807,7 +2939,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 2811 "configure"
+#line 2943 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -2825,7 +2957,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 2829 "configure"
+#line 2961 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -2846,7 +2978,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 2850 "configure"
+#line 2982 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -2857,7 +2989,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:2861: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2993: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -2883,12 +3015,12 @@ fi
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:2887: checking for $ac_func" >&5
+echo "configure:3019: 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 2892 "configure"
+#line 3024 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -2911,7 +3043,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:2915: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3047: \"$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
@@ -2938,19 +3070,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:2942: checking for working alloca.h" >&5
+echo "configure:3074: 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 2947 "configure"
+#line 3079 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:2954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3086: \"$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
@@ -2971,12 +3103,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:2975: checking for alloca" >&5
+echo "configure:3107: 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 2980 "configure"
+#line 3112 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -3004,7 +3136,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3140: \"$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
@@ -3036,12 +3168,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:3040: checking whether alloca needs Cray hooks" >&5
+echo "configure:3172: 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 3045 "configure"
+#line 3177 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -3066,12 +3198,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:3070: checking for $ac_func" >&5
+echo "configure:3202: 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 3075 "configure"
+#line 3207 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -3094,7 +3226,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:3098: \"$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_func_$ac_func=yes"
else
@@ -3121,7 +3253,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:3125: checking stack direction for C alloca" >&5
+echo "configure:3257: 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
@@ -3129,7 +3261,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 3133 "configure"
+#line 3265 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -3148,7 +3280,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:3152: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3284: \"$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
@@ -3171,13 +3303,13 @@ fi
echo $ac_n "checking size of double""... $ac_c" 1>&6
-echo "configure:3175: checking size of double" >&5
+echo "configure:3307: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 3181 "configure"
+#line 3313 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3187,7 +3319,7 @@ int main() {
switch (0) case 0: case (sizeof (double) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3191: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3323: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_double=$ac_size
else
@@ -3210,13 +3342,13 @@ EOF
echo $ac_n "checking size of long double""... $ac_c" 1>&6
-echo "configure:3214: checking size of long double" >&5
+echo "configure:3346: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 3220 "configure"
+#line 3352 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -3226,7 +3358,7 @@ int main() {
switch (0) case 0: case (sizeof (long double) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:3230: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3362: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_long_double=$ac_size
else
@@ -3263,14 +3395,14 @@ fi
echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6
-echo "configure:3267: checking whether byte ordering is bigendian" >&5
+echo "configure:3399: 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 3274 "configure"
+#line 3406 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3281,11 +3413,11 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3285: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3417: \"$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 3289 "configure"
+#line 3421 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/param.h>
@@ -3296,7 +3428,7 @@ int main() {
#endif
; return 0; }
EOF
-if { (eval echo configure:3300: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3432: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_c_bigendian=yes
else
@@ -3316,7 +3448,7 @@ if test "$cross_compiling" = yes; then
echo $ac_n "cross-compiling... " 2>&6
else
cat > conftest.$ac_ext <<EOF
-#line 3320 "configure"
+#line 3452 "configure"
#include "confdefs.h"
main () {
/* Are we little or big endian? From Harbison&Steele. */
@@ -3329,7 +3461,7 @@ main () {
exit (u.c[sizeof (long) - 1] == 1);
}
EOF
-if { (eval echo configure:3333: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:3465: \"$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
@@ -3347,7 +3479,7 @@ fi
echo "$ac_t""$ac_cv_c_bigendian" 1>&6
if test $ac_cv_c_bigendian = unknown; then
echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6
-echo "configure:3351: checking to probe for byte ordering" >&5
+echo "configure:3483: checking to probe for byte ordering" >&5
cat >conftest.c <<EOF
short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 };
@@ -3401,7 +3533,7 @@ fi
if test x$TARGET = xSPARC; then
echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6
-echo "configure:3405: checking assembler and linker support unaligned pc related relocs" >&5
+echo "configure:3537: checking assembler and linker support unaligned pc related relocs" >&5
if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3411,14 +3543,14 @@ else
CFLAGS="$CFLAGS -fpic"
LDFLAGS="$LDFLAGS -shared"
cat > conftest.$ac_ext <<EOF
-#line 3415 "configure"
+#line 3547 "configure"
#include "confdefs.h"
asm (".text; foo: nop; .data; .align 4; .byte 0; .uaword %r_disp32(foo); .text");
int main() {
; return 0; }
EOF
-if { (eval echo configure:3422: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3554: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
libffi_cv_as_sparc_ua_pcrel=yes
else
@@ -3441,7 +3573,7 @@ EOF
fi
echo $ac_n "checking assembler .register pseudo-op support""... $ac_c" 1>&6
-echo "configure:3445: checking assembler .register pseudo-op support" >&5
+echo "configure:3577: checking assembler .register pseudo-op support" >&5
if eval "test \"`echo '$''{'libffi_cv_as_register_pseudo_op'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3449,14 +3581,14 @@ else
libffi_cv_as_register_pseudo_op=unknown
# Check if we have .register
cat > conftest.$ac_ext <<EOF
-#line 3453 "configure"
+#line 3585 "configure"
#include "confdefs.h"
asm (".register %g2, #scratch");
int main() {
; return 0; }
EOF
-if { (eval echo configure:3460: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:3592: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libffi_cv_as_register_pseudo_op=yes
else
@@ -3479,7 +3611,7 @@ EOF
fi
echo $ac_n "checking whether .eh_frame section should be read-only""... $ac_c" 1>&6
-echo "configure:3483: checking whether .eh_frame section should be read-only" >&5
+echo "configure:3615: checking whether .eh_frame section should be read-only" >&5
if eval "test \"`echo '$''{'libffi_cv_ro_eh_frame'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -3584,6 +3716,15 @@ esac
+#Figure out where generated headers like ffitarget.h get installed.
+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/'`
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
+
+
+
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
@@ -3802,6 +3943,8 @@ s%@TARGET@%$TARGET%g
s%@TARGETDIR@%$TARGETDIR%g
s%@toolexecdir@%$toolexecdir%g
s%@toolexeclibdir@%$toolexeclibdir%g
+s%@tool_include_dir@%$tool_include_dir%g
+s%@gcc_version@%$gcc_version%g
CEOF
EOF
diff --git a/libffi/configure.in b/libffi/configure.in
index b44daed0033..3691c6e1bff 100644
--- a/libffi/configure.in
+++ b/libffi/configure.in
@@ -46,6 +46,8 @@ AC_PROG_CC
AC_PROG_LIBTOOL
+AC_FUNC_MMAP_BLACKLIST
+
dnl The -no-testsuite modules omit the test subdir.
AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
@@ -231,6 +233,17 @@ esac
AC_SUBST(toolexecdir)
AC_SUBST(toolexeclibdir)
+#Figure out where generated headers like ffitarget.h get installed.
+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/'`
+tool_include_dir='$(libdir)/gcc/$(target_alias)/'${gcc_version}/include
+changequote([,])dnl
+AC_SUBST(tool_include_dir)
+AC_SUBST(gcc_version)
+
+
if test "${multilib}" = "yes"; then
multilib_arg="--enable-multilib"
else
diff --git a/libffi/fficonfig.h.in b/libffi/fficonfig.h.in
index 0664506e5b8..bd6d4866d84 100644
--- a/libffi/fficonfig.h.in
+++ b/libffi/fficonfig.h.in
@@ -28,6 +28,15 @@
/* Define if you have the memcpy function. */
#undef HAVE_MEMCPY
+/* Define if read-only mmap of a plain file works. */
+#undef HAVE_MMAP_FILE
+
+/* Define if mmap of /dev/zero works. */
+#undef HAVE_MMAP_DEV_ZERO
+
+/* Define if mmap with MAP_ANON(YMOUS) works. */
+#undef HAVE_MMAP_ANON
+
/* The number of bytes in type double */
#undef SIZEOF_DOUBLE
diff --git a/libffi/include/Makefile.am b/libffi/include/Makefile.am
index f9231a66c93..048824d3938 100644
--- a/libffi/include/Makefile.am
+++ b/libffi/include/Makefile.am
@@ -7,4 +7,7 @@ EXTRA_DIST=ffi.h.in ffi_common.h
hackdir=$(includedir)
-hack_DATA=ffitarget.h ffi.h
+hack_DATA= ffi.h
+
+toollibffidir = @tool_include_dir@/libffi
+toollibffi_HEADERS = ffitarget.h
diff --git a/libffi/include/Makefile.in b/libffi/include/Makefile.in
index 0eb19193674..b562bba8bc6 100644
--- a/libffi/include/Makefile.in
+++ b/libffi/include/Makefile.in
@@ -86,7 +86,9 @@ STRIP = @STRIP@
TARGET = @TARGET@
TARGETDIR = @TARGETDIR@
VERSION = @VERSION@
+gcc_version = @gcc_version@
libffi_basedir = @libffi_basedir@
+tool_include_dir = @tool_include_dir@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
@@ -97,12 +99,17 @@ EXTRA_DIST = ffi.h.in ffi_common.h
hackdir = $(includedir)
-hack_DATA = ffitarget.h ffi.h
+hack_DATA = ffi.h
+
+toollibffidir = @tool_include_dir@/libffi
+toollibffi_HEADERS = ffitarget.h
mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}../mkinstalldirs
CONFIG_HEADER = ../fficonfig.h
CONFIG_CLEAN_FILES = ffi.h
DATA = $(hack_DATA)
+HEADERS = $(toollibffi_HEADERS)
+
DIST_COMMON = Makefile.am Makefile.in ffi.h.in
@@ -140,9 +147,50 @@ uninstall-hackDATA:
list='$(hack_DATA)'; for p in $$list; do \
rm -f $(DESTDIR)$(hackdir)/$$p; \
done
+
+install-toollibffiHEADERS: $(toollibffi_HEADERS)
+ @$(NORMAL_INSTALL)
+ $(mkinstalldirs) $(DESTDIR)$(toollibffidir)
+ @list='$(toollibffi_HEADERS)'; for p in $$list; do \
+ if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
+ echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(toollibffidir)/$$p"; \
+ $(INSTALL_DATA) $$d$$p $(DESTDIR)$(toollibffidir)/$$p; \
+ done
+
+uninstall-toollibffiHEADERS:
+ @$(NORMAL_UNINSTALL)
+ list='$(toollibffi_HEADERS)'; for p in $$list; do \
+ rm -f $(DESTDIR)$(toollibffidir)/$$p; \
+ done
+
tags: TAGS
-TAGS:
+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; }'`; \
+ here=`pwd` && cd $(srcdir) \
+ && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ 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)$$unique$(LISP)$$tags" \
+ || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+ -rm -f TAGS ID
+
+maintainer-clean-tags:
distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
@@ -175,20 +223,20 @@ installcheck: installcheck-am
install-exec-am:
install-exec: install-exec-am
-install-data-am: install-hackDATA
+install-data-am: install-hackDATA install-toollibffiHEADERS
install-data: install-data-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
install: install-am
-uninstall-am: uninstall-hackDATA
+uninstall-am: uninstall-hackDATA uninstall-toollibffiHEADERS
uninstall: uninstall-am
-all-am: Makefile $(DATA)
+all-am: Makefile $(DATA) $(HEADERS)
all-redirect: all-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
installdirs:
- $(mkinstalldirs) $(DESTDIR)$(hackdir)
+ $(mkinstalldirs) $(DESTDIR)$(hackdir) $(DESTDIR)$(toollibffidir)
mostlyclean-generic:
@@ -201,31 +249,34 @@ distclean-generic:
-test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-generic
+mostlyclean-am: mostlyclean-tags mostlyclean-generic
mostlyclean: mostlyclean-am
-clean-am: clean-generic mostlyclean-am
+clean-am: clean-tags clean-generic mostlyclean-am
clean: clean-am
-distclean-am: distclean-generic clean-am
+distclean-am: distclean-tags distclean-generic clean-am
-rm -f libtool
distclean: distclean-am
-maintainer-clean-am: maintainer-clean-generic distclean-am
+maintainer-clean-am: maintainer-clean-tags 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: uninstall-hackDATA install-hackDATA tags distdir info-am info \
-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
+.PHONY: uninstall-hackDATA install-hackDATA uninstall-toollibffiHEADERS \
+install-toollibffiHEADERS tags mostlyclean-tags distclean-tags \
+clean-tags maintainer-clean-tags distdir info-am info 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
# Tell versions [3.59,3.63) of GNU make to not export all variables.
diff --git a/libffi/src/prep_cif.c b/libffi/src/prep_cif.c
index f43ccfc4558..3ee5eadcd7f 100644
--- a/libffi/src/prep_cif.c
+++ b/libffi/src/prep_cif.c
@@ -125,13 +125,15 @@ ffi_status ffi_prep_cif(/*@out@*/ /*@partial@*/ ffi_cif *cif,
for (ptr = cif->arg_types, i = cif->nargs; i > 0; i--, ptr++)
{
- /* Perform a sanity check on the argument type */
- FFI_ASSERT_VALID_TYPE(*ptr);
/* Initialize any uninitialized aggregate type definitions */
if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK))
return FFI_BAD_TYPEDEF;
+ /* Perform a sanity check on the argument type, do this
+ check after the initialization. */
+ FFI_ASSERT_VALID_TYPE(*ptr);
+
#if !defined __x86_64__ && !defined S390
#ifdef SPARC
if (((*ptr)->type == FFI_TYPE_STRUCT
diff --git a/libffi/src/x86/ffi.c b/libffi/src/x86/ffi.c
index bd0874f771a..14b0295e1e1 100644
--- a/libffi/src/x86/ffi.c
+++ b/libffi/src/x86/ffi.c
@@ -62,8 +62,8 @@ void ffi_prep_args(char *stack, extended_cif *ecif)
size_t z;
/* Align if necessary */
- if (((*p_arg)->alignment - 1) & (unsigned) argp)
- argp = (char *) ALIGN(argp, (*p_arg)->alignment);
+ if ((sizeof(int) - 1) & (unsigned) argp)
+ argp = (char *) ALIGN(argp, sizeof(int));
z = (*p_arg)->size;
if (z < sizeof(int))
@@ -301,8 +301,8 @@ ffi_prep_incoming_args_SYSV(char *stack, void **rvalue,
size_t z;
/* Align if necessary */
- if (((*p_arg)->alignment - 1) & (unsigned) argp) {
- argp = (char *) ALIGN(argp, (*p_arg)->alignment);
+ if ((sizeof(int) - 1) & (unsigned) argp) {
+ argp = (char *) ALIGN(argp, sizeof(int));
}
z = (*p_arg)->size;
diff --git a/libffi/testsuite/Makefile.in b/libffi/testsuite/Makefile.in
index 2314441899d..e30426cebcf 100644
--- a/libffi/testsuite/Makefile.in
+++ b/libffi/testsuite/Makefile.in
@@ -85,7 +85,9 @@ STRIP = @STRIP@
TARGET = @TARGET@
TARGETDIR = @TARGETDIR@
VERSION = @VERSION@
+gcc_version = @gcc_version@
libffi_basedir = @libffi_basedir@
+tool_include_dir = @tool_include_dir@
toolexecdir = @toolexecdir@
toolexeclibdir = @toolexeclibdir@
diff --git a/libffi/testsuite/lib/libffi-dg.exp b/libffi/testsuite/lib/libffi-dg.exp
index f8a36242a0c..95d09c17da6 100644
--- a/libffi/testsuite/lib/libffi-dg.exp
+++ b/libffi/testsuite/lib/libffi-dg.exp
@@ -17,6 +17,8 @@
load_lib dg.exp
load_lib libgloss.exp
+
+
# Define libffi callbacks for dg.exp.
proc libffi-dg-test-1 { target_compile prog do_what extra_tool_flags } {
@@ -134,6 +136,7 @@ proc libffi-init { args } {
setenv LD_LIBRARYN32_PATH $ld_library_path
setenv LD_LIBRARY64_PATH $ld_library_path
setenv LD_LIBRARY_PATH_64 $ld_library_path
+ setenv DYLD_LIBRARY_PATH $ld_library_path
}
proc libffi_target_compile { source dest type options } {
@@ -144,6 +147,7 @@ proc libffi_target_compile { source dest type options } {
global ld_library_path
global libffi_link_flags
global libffi_include
+ global target_triplet
if { [target_info needs_status_wrapper]!="" && [info exists gluefile] } {
@@ -158,9 +162,15 @@ proc libffi_target_compile { source dest type options } {
}
# search for ffi_mips.h in srcdir, too
- lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include"
+ lappend options "additional_flags=-I${libffi_include} -I${srcdir}/../include -I${libffi_include}/.."
lappend options "additional_flags=${libffi_link_flags}"
+
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ lappend options "libs= -lgcc_s"
+ }
+
lappend options "libs= -lffi"
+
verbose "options: $options"
return [target_compile $source $dest $type $options]
}
@@ -255,4 +265,4 @@ if { [info procs saved-dg-test] == [list] } {
# Local Variables:
# tcl-indent-level:4
-# End: \ No newline at end of file
+# End:
diff --git a/libffi/testsuite/libffi.call/closure_fn0.c b/libffi/testsuite/libffi.call/closure_fn0.c
index fd6593c6449..6d9b2cb50ed 100644
--- a/libffi/testsuite/libffi.call/closure_fn0.c
+++ b/libffi/testsuite/libffi.call/closure_fn0.c
@@ -45,9 +45,18 @@ typedef int (*closure_test_type0)(unsigned long long, int, unsigned long long,
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[17];
+ int res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_uint64;
cl_arg_types[1] = &ffi_type_uint;
@@ -74,9 +83,11 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0,
(void *) 3 /* userdata */) == FFI_OK);
- (*((closure_test_type0)pcl))
- (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
- 19, 21, 1);
+ res = (*((closure_test_type0)pcl))
+ (1LL, 2, 3LL, 4, 127, 429LL, 7, 8, 9.5, 10, 11, 12, 13,
+ 19, 21, 1);
/* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/closure_fn1.c b/libffi/testsuite/libffi.call/closure_fn1.c
index 83734783ee1..41818ad9584 100644
--- a/libffi/testsuite/libffi.call/closure_fn1.c
+++ b/libffi/testsuite/libffi.call/closure_fn1.c
@@ -9,6 +9,7 @@
/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
#include "ffitest.h"
+
static void closure_test_fn1(ffi_cif* cif,void* resp,void** args,
void* userdata)
{
@@ -40,9 +41,18 @@ typedef int (*closure_test_type1)(float, float, float, float, signed short,
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[17];
+ int res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_float;
cl_arg_types[1] = &ffi_type_float;
@@ -69,9 +79,11 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
(void *) 3 /* userdata */) == FFI_OK);
- (*((closure_test_type1)pcl))
- (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
- 19, 21, 1);
+ res = (*((closure_test_type1)pcl))
+ (1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
+ 19, 21, 1);
/* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/closure_fn2.c b/libffi/testsuite/libffi.call/closure_fn2.c
index 8ca5ad7bd63..2a98f962110 100644
--- a/libffi/testsuite/libffi.call/closure_fn2.c
+++ b/libffi/testsuite/libffi.call/closure_fn2.c
@@ -41,9 +41,18 @@ typedef int (*closure_test_type2)(double, double, double, double, signed short,
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[17];
+ int res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_double;
cl_arg_types[1] = &ffi_type_double;
@@ -70,9 +79,11 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn2,
(void *) 3 /* userdata */) == FFI_OK);
- (*((closure_test_type2)pcl))
- (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
- 19.0, 21, 1);
+ res = (*((closure_test_type2)pcl))
+ (1, 2, 3, 4, 127, 5, 6, 8, 9, 10, 11, 12.0, 13,
+ 19.0, 21, 1);
/* { dg-output "1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/closure_fn3.c b/libffi/testsuite/libffi.call/closure_fn3.c
index 27b964cd691..4f744c8109e 100644
--- a/libffi/testsuite/libffi.call/closure_fn3.c
+++ b/libffi/testsuite/libffi.call/closure_fn3.c
@@ -42,10 +42,18 @@ typedef int (*closure_test_type3)(float, float, float, float, float, float,
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[17];
+ int res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_float;
cl_arg_types[1] = &ffi_type_float;
@@ -72,9 +80,11 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn3,
(void *) 3 /* userdata */) == FFI_OK);
- (*((closure_test_type3)pcl))
- (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
- 19.19, 21.21, 1);
+ res = (*((closure_test_type3)pcl))
+ (1.1, 2.2, 3.3, 4.4, 5.5, 6.6, 7.7, 8.8, 9, 10, 11.11, 12.0, 13,
+ 19.19, 21.21, 1);
/* { dg-output "1 2 3 4 5 6 7 8 9 10 11 12 13 19 21 1 3: 135" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 135" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/closure_fn4.c b/libffi/testsuite/libffi.call/closure_fn4.c
new file mode 100644
index 00000000000..cbaaf303cb4
--- /dev/null
+++ b/libffi/testsuite/libffi.call/closure_fn4.c
@@ -0,0 +1,96 @@
+/* Area: closure_call
+ Purpose: Check multiple long long values passing.
+ Also, exceed the limit of gpr and fpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031026 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+
+#include "ffitest.h"
+
+static void
+closure_test_fn0(ffi_cif* cif,void* resp,void** args, void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
+ (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
+ (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
+ (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
+ (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
+ (int)*(unsigned long long *)args[10] +
+ (int)*(unsigned long long *)args[11] +
+ (int)*(unsigned long long *)args[12] +
+ (int)*(unsigned long long *)args[13] +
+ (int)*(unsigned long long *)args[14] +
+ *(int *)args[15] + (int)(long)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0],
+ (int)*(unsigned long long *)args[1],
+ (int)*(unsigned long long *)args[2],
+ (int)*(unsigned long long *)args[3],
+ (int)*(unsigned long long *)args[4],
+ (int)*(unsigned long long *)args[5],
+ (int)*(unsigned long long *)args[6],
+ (int)*(unsigned long long *)args[7],
+ (int)*(unsigned long long *)args[8],
+ (int)*(unsigned long long *)args[9],
+ (int)*(unsigned long long *)args[10],
+ (int)*(unsigned long long *)args[11],
+ (int)*(unsigned long long *)args[12],
+ (int)*(unsigned long long *)args[13],
+ (int)*(unsigned long long *)args[14],
+ *(int *)args[15],
+ (int)(long)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, int);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[17];
+ int i, res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ for (i = 0; i < 15; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn0,
+ (void *) 3 /* userdata */) == FFI_OK);
+
+ res = (*((closure_test_type0)pcl))
+ (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11LL, 12LL,
+ 13LL, 19LL, 21LL, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/closure_fn5.c b/libffi/testsuite/libffi.call/closure_fn5.c
new file mode 100644
index 00000000000..6a4fc67a6de
--- /dev/null
+++ b/libffi/testsuite/libffi.call/closure_fn5.c
@@ -0,0 +1,99 @@
+/* Area: closure_call
+ Purpose: Check multiple long long values passing.
+ Exceed the limit of gpr registers on PowerPC
+ Darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031026 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+
+#include "ffitest.h"
+
+static void
+closure_test_fn5(ffi_cif* cif,void* resp,void** args, void* userdata)
+{
+ *(ffi_arg*)resp =
+ (int)*(unsigned long long *)args[0] + (int)*(unsigned long long *)args[1] +
+ (int)*(unsigned long long *)args[2] + (int)*(unsigned long long *)args[3] +
+ (int)*(unsigned long long *)args[4] + (int)*(unsigned long long *)args[5] +
+ (int)*(unsigned long long *)args[6] + (int)*(unsigned long long *)args[7] +
+ (int)*(unsigned long long *)args[8] + (int)*(unsigned long long *)args[9] +
+ (int)*(int *)args[10] +
+ (int)*(unsigned long long *)args[11] +
+ (int)*(unsigned long long *)args[12] +
+ (int)*(unsigned long long *)args[13] +
+ (int)*(unsigned long long *)args[14] +
+ *(int *)args[15] + (int)(long)userdata;
+
+ printf("%d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d %d: %d\n",
+ (int)*(unsigned long long *)args[0],
+ (int)*(unsigned long long *)args[1],
+ (int)*(unsigned long long *)args[2],
+ (int)*(unsigned long long *)args[3],
+ (int)*(unsigned long long *)args[4],
+ (int)*(unsigned long long *)args[5],
+ (int)*(unsigned long long *)args[6],
+ (int)*(unsigned long long *)args[7],
+ (int)*(unsigned long long *)args[8],
+ (int)*(unsigned long long *)args[9],
+ (int)*(int *)args[10],
+ (int)*(unsigned long long *)args[11],
+ (int)*(unsigned long long *)args[12],
+ (int)*(unsigned long long *)args[13],
+ (int)*(unsigned long long *)args[14],
+ *(int *)args[15],
+ (int)(long)userdata, (int)*(ffi_arg *)resp);
+
+}
+
+typedef int (*closure_test_type0)(unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, unsigned long long,
+ int, unsigned long long,
+ unsigned long long, unsigned long long,
+ unsigned long long, int);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[17];
+ int i, res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ for (i = 0; i < 10; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[10] = &ffi_type_uint;
+ for (i = 11; i < 15; i++) {
+ cl_arg_types[i] = &ffi_type_uint64;
+ }
+ cl_arg_types[15] = &ffi_type_uint;
+ cl_arg_types[16] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
+ &ffi_type_sint, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn5,
+ (void *) 3 /* userdata */) == FFI_OK);
+
+ res = (*((closure_test_type0)pcl))
+ (1LL, 2LL, 3LL, 4LL, 127LL, 429LL, 7LL, 8LL, 9LL, 10LL, 11, 12LL,
+ 13LL, 19LL, 21LL, 1);
+ /* { dg-output "1 2 3 4 127 429 7 8 9 10 11 12 13 19 21 1 3: 680" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 680" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_12byte.c b/libffi/testsuite/libffi.call/cls_12byte.c
index d44a3344e08..f8a87ec8797 100644
--- a/libffi/testsuite/libffi.call/cls_12byte.c
+++ b/libffi/testsuite/libffi.call/cls_12byte.c
@@ -41,13 +41,21 @@ static void cls_struct_12byte_gn(ffi_cif* cif, void* resp, void** args, void* us
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -75,17 +83,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_12byte_fn), &res_dbl, args_dbl);
/* { dg-output "7 4 9 1 5 3: 8 9 12" } */
- CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
- CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
- CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 9 12" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_12byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_12byte(*)(cls_struct_12byte, cls_struct_12byte))(pcl))(h_dbl, j_dbl);
/* { dg-output "\n7 4 9 1 5 3: 8 9 12" } */
- CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
- CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
- CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 9 12" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_16byte.c b/libffi/testsuite/libffi.call/cls_16byte.c
index 2481196402a..f8a3b5786a8 100644
--- a/libffi/testsuite/libffi.call/cls_16byte.c
+++ b/libffi/testsuite/libffi.call/cls_16byte.c
@@ -42,13 +42,21 @@ static void cls_struct_16byte_gn(ffi_cif* cif, void* resp, void** args, void* us
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -76,17 +84,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_16byte_fn), &res_dbl, args_dbl);
/* { dg-output "7 8 9 1 9 3: 8 17 12" } */
- CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
- CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
- CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 17 12" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_16byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_16byte(*)(cls_struct_16byte, cls_struct_16byte))(pcl))(h_dbl, j_dbl);
/* { dg-output "\n7 8 9 1 9 3: 8 17 12" } */
- CHECK( res_dbl.a == (h_dbl.a + j_dbl.a));
- CHECK( res_dbl.b == (h_dbl.b + j_dbl.b));
- CHECK( res_dbl.c == (h_dbl.c + j_dbl.c));
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 8 17 12" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_18byte.c b/libffi/testsuite/libffi.call/cls_18byte.c
new file mode 100644
index 00000000000..50ce9ffdae5
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_18byte.c
@@ -0,0 +1,103 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Double alignment check on darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030915 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_18byte {
+ double a;
+ unsigned char b;
+ unsigned char c;
+ double d;
+} cls_struct_18byte;
+
+cls_struct_18byte cls_struct_18byte_fn(struct cls_struct_18byte a1,
+ struct cls_struct_18byte a2)
+{
+ struct cls_struct_18byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+
+
+ printf("%g %d %d %g %g %d %d %g: %g %d %d %g\n", a1.a, a1.b, a1.c, a1.d,
+ a2.a, a2.b, a2.c, a2.d,
+ result.a, result.b, result.c, result.d);
+ return result;
+}
+
+static void
+cls_struct_18byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct cls_struct_18byte a1, a2;
+
+ a1 = *(struct cls_struct_18byte*)(args[0]);
+ a2 = *(struct cls_struct_18byte*)(args[1]);
+
+ *(cls_struct_18byte*)resp = cls_struct_18byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[5];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_18byte g_dbl = { 1.0, 127, 126, 3.0 };
+ struct cls_struct_18byte f_dbl = { 4.0, 125, 124, 5.0 };
+ struct cls_struct_18byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_18byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 127 126 3 4 125 124 5: 5 252 250 8" } */
+ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 5 252 250 8" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_18byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_18byte(*)(cls_struct_18byte, cls_struct_18byte))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n1 127 126 3 4 125 124 5: 5 252 250 8" } */
+ printf("res: %g %d %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 5 252 250 8" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_19byte.c b/libffi/testsuite/libffi.call/cls_19byte.c
new file mode 100644
index 00000000000..3bef9387967
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_19byte.c
@@ -0,0 +1,109 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Double alignment check on darwin.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030915 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_19byte {
+ double a;
+ unsigned char b;
+ unsigned char c;
+ double d;
+ unsigned char e;
+} cls_struct_19byte;
+
+cls_struct_19byte cls_struct_19byte_fn(struct cls_struct_19byte a1,
+ struct cls_struct_19byte a2)
+{
+ struct cls_struct_19byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+ result.d = a1.d + a2.d;
+ result.e = a1.e + a2.e;
+
+
+ printf("%g %d %d %g %d %g %d %d %g %d: %g %d %d %g %d\n",
+ a1.a, a1.b, a1.c, a1.d, a1.e,
+ a2.a, a2.b, a2.c, a2.d, a2.e,
+ result.a, result.b, result.c, result.d, result.e);
+ return result;
+}
+
+static void
+cls_struct_19byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct cls_struct_19byte a1, a2;
+
+ a1 = *(struct cls_struct_19byte*)(args[0]);
+ a2 = *(struct cls_struct_19byte*)(args[1]);
+
+ *(cls_struct_19byte*)resp = cls_struct_19byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[6];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_19byte g_dbl = { 1.0, 127, 126, 3.0, 120 };
+ struct cls_struct_19byte f_dbl = { 4.0, 125, 124, 5.0, 119 };
+ struct cls_struct_19byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_uchar;
+ cls_struct_fields[5] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_19byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
+ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 5 252 250 8 239" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_19byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_19byte(*)(cls_struct_19byte, cls_struct_19byte))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n1 127 126 3 120 4 125 124 5 119: 5 252 250 8 239" } */
+ printf("res: %g %d %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e);
+ /* { dg-output "\nres: 5 252 250 8 239" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_1_1byte.c b/libffi/testsuite/libffi.call/cls_1_1byte.c
index 11defc80e97..cdf49631275 100644
--- a/libffi/testsuite/libffi.call/cls_1_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_1_1byte.c
@@ -40,13 +40,21 @@ cls_struct_1_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[2];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -72,13 +80,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_1_1byte_fn), &res_dbl, args_dbl);
/* { dg-output "12 178: 190" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
+ printf("res: %d\n", res_dbl.a);
+ /* { dg-output "\nres: 190" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_1_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_1_1byte(*)(cls_struct_1_1byte, cls_struct_1_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 178: 190" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
+ printf("res: %d\n", res_dbl.a);
+ /* { dg-output "\nres: 190" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_20byte.c b/libffi/testsuite/libffi.call/cls_20byte.c
index d81df4d5c38..b02b84dc61f 100644
--- a/libffi/testsuite/libffi.call/cls_20byte.c
+++ b/libffi/testsuite/libffi.call/cls_20byte.c
@@ -42,13 +42,21 @@ cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -76,17 +84,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
/* { dg-output "1 2 3 4 5 7: 5 7 10" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+ printf("res: %g %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_20byte1.c b/libffi/testsuite/libffi.call/cls_20byte1.c
new file mode 100644
index 00000000000..41866fe6b99
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_20byte1.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check overlapping.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_20byte {
+ int a;
+ double b;
+ double c;
+} cls_struct_20byte;
+
+cls_struct_20byte cls_struct_20byte_fn(struct cls_struct_20byte a1,
+ struct cls_struct_20byte a2)
+{
+ struct cls_struct_20byte result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %g %d %g %g: %d %g %g\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c,
+ result.a, result.b, result.c);
+ return result;
+}
+
+static void
+cls_struct_20byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct cls_struct_20byte a1, a2;
+
+ a1 = *(struct cls_struct_20byte*)(args[0]);
+ a2 = *(struct cls_struct_20byte*)(args[1]);
+
+ *(cls_struct_20byte*)resp = cls_struct_20byte_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_20byte g_dbl = { 1, 2.0, 3.0 };
+ struct cls_struct_20byte f_dbl = { 4, 5.0, 7.0 };
+ struct cls_struct_20byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_20byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_20byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_20byte(*)(cls_struct_20byte, cls_struct_20byte))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n1 2 3 4 5 7: 5 7 10" } */
+ printf("res: %d %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 5 7 10" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_24byte.c b/libffi/testsuite/libffi.call/cls_24byte.c
index 6c86115e41c..ff0f841b5c5 100644
--- a/libffi/testsuite/libffi.call/cls_24byte.c
+++ b/libffi/testsuite/libffi.call/cls_24byte.c
@@ -53,13 +53,21 @@ cls_struct_24byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -94,22 +102,19 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_24byte_fn), &res_dbl, args_dbl);
/* { dg-output "9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
- CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
- CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
- CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
- CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
+ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 22 15 17 25" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_24byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_24byte(*)(cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte,
- cls_struct_24byte))
+ cls_struct_24byte,
+ cls_struct_24byte,
+ cls_struct_24byte))
(pcl))(e_dbl, f_dbl, g_dbl, h_dbl);
/* { dg-output "\n9 2 6 5 1 2 3 7 4 5 7 9 8 6 1 9: 22 15 17 25" } */
- CHECK( res_dbl.a == (e_dbl.a + f_dbl.a + g_dbl.a + h_dbl.a));
- CHECK( res_dbl.b == (e_dbl.b + f_dbl.b + g_dbl.b + h_dbl.b));
- CHECK( res_dbl.c == (e_dbl.c + f_dbl.c + g_dbl.c + h_dbl.c));
- CHECK( res_dbl.d == (e_dbl.d + f_dbl.d + g_dbl.d + h_dbl.d));
+ printf("res: %g %g %d %g\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 22 15 17 25" } */
+
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_2byte.c b/libffi/testsuite/libffi.call/cls_2byte.c
index 2198ee821cb..2e381771ec8 100644
--- a/libffi/testsuite/libffi.call/cls_2byte.c
+++ b/libffi/testsuite/libffi.call/cls_2byte.c
@@ -42,13 +42,21 @@ cls_struct_2byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -75,15 +83,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_2byte_fn), &res_dbl, args_dbl);
/* { dg-output "12 127 1 13: 13 140" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 140" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_2byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_2byte(*)(cls_struct_2byte, cls_struct_2byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 127 1 13: 13 140" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 140" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_3_1byte.c b/libffi/testsuite/libffi.call/cls_3_1byte.c
index e4bda2fa026..8e3044f7655 100644
--- a/libffi/testsuite/libffi.call/cls_3_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_3_1byte.c
@@ -46,13 +46,21 @@ cls_struct_3_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -80,19 +88,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_3_1byte_fn), &res_dbl, args_dbl);
/* { dg-output "12 13 14 178 179 180: 190 192 194" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 190 192 194" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_3_1byte(*)(cls_struct_3_1byte, cls_struct_3_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 13 14 178 179 180: 190 192 194" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
-
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 190 192 194" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_3byte1.c b/libffi/testsuite/libffi.call/cls_3byte1.c
index b03fa86cd70..294067faf5e 100644
--- a/libffi/testsuite/libffi.call/cls_3byte1.c
+++ b/libffi/testsuite/libffi.call/cls_3byte1.c
@@ -42,13 +42,21 @@ cls_struct_3byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -75,15 +83,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_3byte_fn), &res_dbl, args_dbl);
/* { dg-output "12 119 1 15: 13 134" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 134" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_3byte(*)(cls_struct_3byte, cls_struct_3byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 119 1 15: 13 134" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 13 134" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_3byte2.c b/libffi/testsuite/libffi.call/cls_3byte2.c
index d750869bc4f..c429958f35e 100644
--- a/libffi/testsuite/libffi.call/cls_3byte2.c
+++ b/libffi/testsuite/libffi.call/cls_3byte2.c
@@ -42,13 +42,21 @@ cls_struct_3byte_gn1(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -75,15 +83,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_3byte_fn1), &res_dbl, args_dbl);
/* { dg-output "15 125 9 19: 24 144" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 24 144" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_3byte_gn1, NULL) == FFI_OK);
res_dbl = ((cls_struct_3byte_1(*)(cls_struct_3byte_1, cls_struct_3byte_1))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n15 125 9 19: 24 144" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 24 144" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_4_1byte.c b/libffi/testsuite/libffi.call/cls_4_1byte.c
index 195d8cc6cdd..008e24a7120 100644
--- a/libffi/testsuite/libffi.call/cls_4_1byte.c
+++ b/libffi/testsuite/libffi.call/cls_4_1byte.c
@@ -48,13 +48,21 @@ cls_struct_4_1byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -83,19 +91,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_4_1byte_fn), &res_dbl, args_dbl);
/* { dg-output "12 13 14 15 178 179 180 181: 190 192 194 196" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 190 192 194 196" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4_1byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_4_1byte(*)(cls_struct_4_1byte, cls_struct_4_1byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n12 13 14 15 178 179 180 181: 190 192 194 196" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 190 192 194 196" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_4byte.c b/libffi/testsuite/libffi.call/cls_4byte.c
index 8eb9ad95800..ecb2ce9dae8 100644
--- a/libffi/testsuite/libffi.call/cls_4byte.c
+++ b/libffi/testsuite/libffi.call/cls_4byte.c
@@ -42,13 +42,21 @@ cls_struct_4byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -75,15 +83,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_4byte_fn), &res_dbl, args_dbl);
/* { dg-output "127 120 12 128: 139 248" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 139 248" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_4byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_4byte(*)(cls_struct_4byte, cls_struct_4byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 12 128: 139 248" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 139 248" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_5byte.c b/libffi/testsuite/libffi.call/cls_5byte.c
index 821d653fd29..6274a197cad 100644
--- a/libffi/testsuite/libffi.call/cls_5byte.c
+++ b/libffi/testsuite/libffi.call/cls_5byte.c
@@ -45,13 +45,21 @@ cls_struct_5byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -79,17 +87,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_5byte_fn), &res_dbl, args_dbl);
/* { dg-output "127 120 1 12 128 9: 139 248 10" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 139 248 10" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_5byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_5byte(*)(cls_struct_5byte, cls_struct_5byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 12 128 9: 139 248 10" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 139 248 10" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_64byte.c b/libffi/testsuite/libffi.call/cls_64byte.c
new file mode 100644
index 00000000000..cc1b7714b54
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_64byte.c
@@ -0,0 +1,131 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Check bigger struct which overlaps
+ the gp and fp register count on Darwin/AIX/ppc64.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030828 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_64byte {
+ double a;
+ double b;
+ double c;
+ double d;
+ double e;
+ double f;
+ double g;
+ double h;
+} cls_struct_64byte;
+
+cls_struct_64byte cls_struct_64byte_fn(struct cls_struct_64byte b0,
+ struct cls_struct_64byte b1,
+ struct cls_struct_64byte b2,
+ struct cls_struct_64byte b3)
+{
+ struct cls_struct_64byte result;
+
+ result.a = b0.a + b1.a + b2.a + b3.a;
+ result.b = b0.b + b1.b + b2.b + b3.b;
+ result.c = b0.c + b1.c + b2.c + b3.c;
+ result.d = b0.d + b1.d + b2.d + b3.d;
+ result.e = b0.e + b1.e + b2.e + b3.e;
+ result.f = b0.f + b1.f + b2.f + b3.f;
+ result.g = b0.g + b1.g + b2.g + b3.g;
+ result.h = b0.h + b1.h + b2.h + b3.h;
+
+ printf("%g %g %g %g %g %g %g %g\n", result.a, result.b, result.c,
+ result.d, result.e, result.f, result.g, result.h);
+
+ return result;
+}
+
+static void
+cls_struct_64byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct cls_struct_64byte b0, b1, b2, b3;
+
+ b0 = *(struct cls_struct_64byte*)(args[0]);
+ b1 = *(struct cls_struct_64byte*)(args[1]);
+ b2 = *(struct cls_struct_64byte*)(args[2]);
+ b3 = *(struct cls_struct_64byte*)(args[3]);
+
+ *(cls_struct_64byte*)resp = cls_struct_64byte_fn(b0, b1, b2, b3);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[9];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_64byte e_dbl = { 9.0, 2.0, 6.0, 5.0, 3.0, 4.0, 8.0, 1.0 };
+ struct cls_struct_64byte f_dbl = { 1.0, 2.0, 3.0, 7.0, 2.0, 5.0, 6.0, 7.0 };
+ struct cls_struct_64byte g_dbl = { 4.0, 5.0, 7.0, 9.0, 1.0, 1.0, 2.0, 9.0 };
+ struct cls_struct_64byte h_dbl = { 8.0, 6.0, 1.0, 4.0, 0.0, 3.0, 3.0, 1.0 };
+ struct cls_struct_64byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_double;
+ cls_struct_fields[3] = &ffi_type_double;
+ cls_struct_fields[4] = &ffi_type_double;
+ cls_struct_fields[5] = &ffi_type_double;
+ cls_struct_fields[6] = &ffi_type_double;
+ cls_struct_fields[7] = &ffi_type_double;
+ cls_struct_fields[8] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = &cls_struct_type;
+ dbl_arg_types[3] = &cls_struct_type;
+ dbl_arg_types[4] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = &g_dbl;
+ args_dbl[3] = &h_dbl;
+ args_dbl[4] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_64byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "22 15 17 25 6 13 19 18" } */
+ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_64byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_64byte(*)(cls_struct_64byte,
+ cls_struct_64byte,
+ cls_struct_64byte,
+ cls_struct_64byte))
+ (pcl))(e_dbl, f_dbl, g_dbl, h_dbl);
+ /* { dg-output "\n22 15 17 25 6 13 19 18" } */
+ printf("res: %g %g %g %g %g %g %g %g\n", res_dbl.a, res_dbl.b, res_dbl.c,
+ res_dbl.d, res_dbl.e, res_dbl.f, res_dbl.g, res_dbl.h);
+ /* { dg-output "\nres: 22 15 17 25 6 13 19 18" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_6byte.c b/libffi/testsuite/libffi.call/cls_6byte.c
index c1cb278f749..0c1ab28f0c2 100644
--- a/libffi/testsuite/libffi.call/cls_6byte.c
+++ b/libffi/testsuite/libffi.call/cls_6byte.c
@@ -47,13 +47,21 @@ cls_struct_6byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -82,19 +90,16 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_6byte_fn), &res_dbl, args_dbl);
/* { dg-output "127 120 1 128 12 128 9 127: 139 248 10 255" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 255" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_6byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_6byte(*)(cls_struct_6byte, cls_struct_6byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 128 12 128 9 127: 139 248 10 255" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 255" } */
+
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_7byte.c b/libffi/testsuite/libffi.call/cls_7byte.c
index 253534dfbee..a7998ddabb7 100644
--- a/libffi/testsuite/libffi.call/cls_7byte.c
+++ b/libffi/testsuite/libffi.call/cls_7byte.c
@@ -47,13 +47,21 @@ cls_struct_7byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -82,19 +90,15 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_7byte_fn), &res_dbl, args_dbl);
/* { dg-output "127 120 1 254 12 128 9 255: 139 248 10 509" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 509" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_7byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_7byte(*)(cls_struct_7byte, cls_struct_7byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n127 120 1 254 12 128 9 255: 139 248 10 509" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
- CHECK( res_dbl.c == (g_dbl.c + f_dbl.c));
- CHECK( res_dbl.d == (g_dbl.d + f_dbl.d));
+ printf("res: %d %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c, res_dbl.d);
+ /* { dg-output "\nres: 139 248 10 509" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_8byte.c b/libffi/testsuite/libffi.call/cls_8byte.c
index 3746a696c12..efa1afc1677 100644
--- a/libffi/testsuite/libffi.call/cls_8byte.c
+++ b/libffi/testsuite/libffi.call/cls_8byte.c
@@ -41,13 +41,21 @@ cls_struct_8byte_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[4];
ffi_type cls_struct_type;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
@@ -74,15 +82,14 @@ int main (void)
ffi_call(&cif, FFI_FN(cls_struct_8byte_fn), &res_dbl, args_dbl);
/* { dg-output "1 2 4 5: 5 7" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
-
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 5 7" } */
CHECK(ffi_prep_closure(pcl, &cif, cls_struct_8byte_gn, NULL) == FFI_OK);
res_dbl = ((cls_struct_8byte(*)(cls_struct_8byte, cls_struct_8byte))(pcl))(g_dbl, f_dbl);
/* { dg-output "\n1 2 4 5: 5 7" } */
- CHECK( res_dbl.a == (g_dbl.a + f_dbl.a));
- CHECK( res_dbl.b == (g_dbl.b + f_dbl.b));
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 5 7" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_9byte1.c b/libffi/testsuite/libffi.call/cls_9byte1.c
new file mode 100644
index 00000000000..69945709f90
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_9byte1.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Darwin/AIX do double-word
+ alignment of the struct if the first element is a double.
+ Check that it does not here.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030914 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_9byte {
+ int a;
+ double b;
+} cls_struct_9byte;
+
+cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+ struct cls_struct_9byte b2)
+{
+ struct cls_struct_9byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+
+ printf("%d %g %d %g: %d %g\n", b1.a, b1.b, b2.a, b2.b,
+ result.a, result.b);
+
+ return result;
+}
+
+static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
+ void* userdata)
+{
+ struct cls_struct_9byte b1, b2;
+
+ b1 = *(struct cls_struct_9byte*)(args[0]);
+ b2 = *(struct cls_struct_9byte*)(args[1]);
+
+ *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_9byte h_dbl = { 7, 8.0};
+ struct cls_struct_9byte j_dbl = { 1, 9.0};
+ struct cls_struct_9byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint32;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 8 1 9: 8 17" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl);
+ /* { dg-output "\n7 8 1 9: 8 17" } */
+ printf("res: %d %g\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_9byte2.c b/libffi/testsuite/libffi.call/cls_9byte2.c
new file mode 100644
index 00000000000..976ed59a0f8
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_9byte2.c
@@ -0,0 +1,99 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Depending on the ABI. Darwin/AIX do double-word
+ alignment of the struct if the first element is a double.
+ Check that it does here.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030914 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_9byte {
+ double a;
+ int b;
+} cls_struct_9byte;
+
+cls_struct_9byte cls_struct_9byte_fn(struct cls_struct_9byte b1,
+ struct cls_struct_9byte b2)
+{
+ struct cls_struct_9byte result;
+
+ result.a = b1.a + b2.a;
+ result.b = b1.b + b2.b;
+
+ printf("%g %d %g %d: %g %d\n", b1.a, b1.b, b2.a, b2.b,
+ result.a, result.b);
+
+ return result;
+}
+
+static void cls_struct_9byte_gn(ffi_cif* cif, void* resp, void** args,
+ void* userdata)
+{
+ struct cls_struct_9byte b1, b2;
+
+ b1 = *(struct cls_struct_9byte*)(args[0]);
+ b2 = *(struct cls_struct_9byte*)(args[1]);
+
+ *(cls_struct_9byte*)resp = cls_struct_9byte_fn(b1, b2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_9byte h_dbl = { 7.0, 8};
+ struct cls_struct_9byte j_dbl = { 1.0, 9};
+ struct cls_struct_9byte res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_double;
+ cls_struct_fields[1] = &ffi_type_uint32;
+ cls_struct_fields[2] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &h_dbl;
+ args_dbl[1] = &j_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_9byte_fn), &res_dbl, args_dbl);
+ /* { dg-output "7 8 1 9: 8 17" } */
+ printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_9byte_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_9byte(*)(cls_struct_9byte, cls_struct_9byte))(pcl))(h_dbl, j_dbl);
+ /* { dg-output "\n7 8 1 9: 8 17" } */
+ printf("res: %g %d\n", res_dbl.a, res_dbl.b);
+ /* { dg-output "\nres: 8 17" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_double.c b/libffi/testsuite/libffi.call/cls_align_double.c
new file mode 100644
index 00000000000..826b6a81189
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_double.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of double.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ double b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_double;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_float.c b/libffi/testsuite/libffi.call/cls_align_float.c
new file mode 100644
index 00000000000..6deff30babc
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_float.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of float.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ float b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_float;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_longdouble.c b/libffi/testsuite/libffi.call/cls_align_longdouble.c
new file mode 100644
index 00000000000..a4c33481c8a
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_longdouble.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of long double.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ long double b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %g %d %d %g %d: %d %g %d\n", a1.a, (double)a1.b, a1.c, a2.a, (double)a2.b, a2.c, result.a, (double)result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_longdouble;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %g %d\n", res_dbl.a, (double)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_pointer.c b/libffi/testsuite/libffi.call/cls_align_pointer.c
new file mode 100644
index 00000000000..9fb42b48988
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_pointer.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of pointer.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ void *b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = (void *)((size_t)a1.b + (size_t)a2.b);
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, (size_t)a1.b, a1.c, a2.a, (size_t)a2.b, a2.c, result.a, (size_t)result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, (void *)4951, 127 };
+ struct cls_struct_align f_dbl = { 1, (void *)9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_pointer;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, (size_t)res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_sint16.c b/libffi/testsuite/libffi.call/cls_align_sint16.c
new file mode 100644
index 00000000000..611d5a3272a
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_sint16.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint16.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed short b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sint16;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_sint32.c b/libffi/testsuite/libffi.call/cls_align_sint32.c
new file mode 100644
index 00000000000..fcfae033d8f
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_sint32.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint32.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed int b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sint32;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_sint64.c b/libffi/testsuite/libffi.call/cls_align_sint64.c
new file mode 100644
index 00000000000..fd88e7c7b84
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_sint64.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of sint64.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ signed long long b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %lld %d %d %lld %d: %d %lld %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_sint64;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_uint16.c b/libffi/testsuite/libffi.call/cls_align_uint16.c
new file mode 100644
index 00000000000..bad9cd8832d
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_uint16.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint16.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned short b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint16;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_uint32.c b/libffi/testsuite/libffi.call/cls_align_uint32.c
new file mode 100644
index 00000000000..d6d0fe033d3
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_uint32.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint32.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned int b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %d %d %d %d %d: %d %d %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint32;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %d %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_align_uint64.c b/libffi/testsuite/libffi.call/cls_align_uint64.c
new file mode 100644
index 00000000000..69dc7b52211
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_align_uint64.c
@@ -0,0 +1,98 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure alignment of uint64.
+ Limitations: none.
+ PR: none.
+ Originator: <hos@tamanegi.org> 20031203 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct cls_struct_align {
+ unsigned char a;
+ unsigned long long b;
+ unsigned char c;
+} cls_struct_align;
+
+cls_struct_align cls_struct_align_fn(struct cls_struct_align a1,
+ struct cls_struct_align a2)
+{
+ struct cls_struct_align result;
+
+ result.a = a1.a + a2.a;
+ result.b = a1.b + a2.b;
+ result.c = a1.c + a2.c;
+
+ printf("%d %lld %d %d %lld %d: %d %lld %d\n", a1.a, a1.b, a1.c, a2.a, a2.b, a2.c, result.a, result.b, result.c);
+
+ return result;
+}
+
+static void
+cls_struct_align_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+
+ struct cls_struct_align a1, a2;
+
+ a1 = *(struct cls_struct_align*)(args[0]);
+ a2 = *(struct cls_struct_align*)(args[1]);
+
+ *(cls_struct_align*)resp = cls_struct_align_fn(a1, a2);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[5];
+ ffi_type* cls_struct_fields[4];
+ ffi_type cls_struct_type;
+ ffi_type* dbl_arg_types[5];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ struct cls_struct_align g_dbl = { 12, 4951, 127 };
+ struct cls_struct_align f_dbl = { 1, 9320, 13 };
+ struct cls_struct_align res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uchar;
+ cls_struct_fields[1] = &ffi_type_uint64;
+ cls_struct_fields[2] = &ffi_type_uchar;
+ cls_struct_fields[3] = NULL;
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &g_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(cls_struct_align_fn), &res_dbl, args_dbl);
+ /* { dg-output "12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_struct_align_gn, NULL) == FFI_OK);
+
+ res_dbl = ((cls_struct_align(*)(cls_struct_align, cls_struct_align))(pcl))(g_dbl, f_dbl);
+ /* { dg-output "\n12 4951 127 1 9320 13: 13 14271 140" } */
+ printf("res: %d %lld %d\n", res_dbl.a, res_dbl.b, res_dbl.c);
+ /* { dg-output "\nres: 13 14271 140" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_double.c b/libffi/testsuite/libffi.call/cls_double.c
index 76a1df7a340..3df6cf3fcf7 100644
--- a/libffi/testsuite/libffi.call/cls_double.c
+++ b/libffi/testsuite/libffi.call/cls_double.c
@@ -20,10 +20,18 @@ typedef double (*cls_ret_double)(double);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ double res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_double;
cl_arg_types[1] = NULL;
@@ -34,7 +42,10 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_double_fn, NULL) == FFI_OK);
- (*((cls_ret_double)pcl))(21474.789);
+ res = (*((cls_ret_double)pcl))(21474.789);
/* { dg-output "21474.789000: 21474.789000" } */
+ printf("res: %.6f\n", res);
+ /* { dg-output "\nres: 21474.789000" } */
+
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_float.c b/libffi/testsuite/libffi.call/cls_float.c
index dd0a48bd2cc..ac4ec482b0f 100644
--- a/libffi/testsuite/libffi.call/cls_float.c
+++ b/libffi/testsuite/libffi.call/cls_float.c
@@ -21,9 +21,18 @@ typedef float (*cls_ret_float)(float);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ float res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_float;
@@ -34,10 +43,9 @@ int main (void)
&ffi_type_float, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_float_fn, NULL) == FFI_OK);
- ((((cls_ret_float)pcl)(-2122.12)));
- /* { dg-output "\\-2122.12: \\-2122.12\n" } */
- printf("%f \n",(((cls_ret_float)pcl)(-2122.12)));
+ res = ((((cls_ret_float)pcl)(-2122.12)));
/* { dg-output "\\-2122.12: \\-2122.12" } */
- /* { dg-output "\n\-2122.120117" } */
+ printf("res: %.6f\n", res);
+ /* { dg-output "\nres: \-2122.120117" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_multi_schar.c b/libffi/testsuite/libffi.call/cls_multi_schar.c
new file mode 100644
index 00000000000..6457336661f
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_schar.c
@@ -0,0 +1,81 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <hos@tamanegi.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+signed char test_func_fn(signed char a1, signed char a2)
+{
+ signed char result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ signed char a1, a2;
+
+ a1 = *(signed char *)avals[0];
+ a2 = *(signed char *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef signed char (*test_type)(signed char, signed char);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ signed char a, b, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 2;
+ b = 125;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[3] = NULL;
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = &ffi_type_schar;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_schar, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 125: 127" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 127" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(2, 125);
+ /* { dg-output "\n2 125: 127" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 127" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_multi_sshort.c b/libffi/testsuite/libffi.call/cls_multi_sshort.c
new file mode 100644
index 00000000000..eaa15d8cdc1
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_sshort.c
@@ -0,0 +1,81 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed short values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+signed short test_func_fn(signed short a1, signed short a2)
+{
+ signed short result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ signed short a1, a2;
+
+ a1 = *(signed short *)avals[0];
+ a2 = *(signed short *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef signed short (*test_type)(signed short, signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ unsigned short a, b, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 2;
+ b = 32765;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[3] = NULL;
+
+ cl_arg_types[0] = &ffi_type_sshort;
+ cl_arg_types[1] = &ffi_type_sshort;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 32765: 32767" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 32767" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(2, 32765);
+ /* { dg-output "\n2 32765: 32767" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32767" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_multi_sshortchar.c b/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
new file mode 100644
index 00000000000..ae5ce7f72a4
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_sshortchar.c
@@ -0,0 +1,93 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple signed short/char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+signed short test_func_fn(signed char a1, signed short a2,
+ signed char a3, signed short a4)
+{
+ signed short result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ signed char a1, a3;
+ signed short a2, a4;
+
+ a1 = *(signed char *)avals[0];
+ a2 = *(signed short *)avals[1];
+ a3 = *(signed char *)avals[2];
+ a4 = *(signed short *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef signed short (*test_type)(signed char, signed short,
+ signed char, signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ signed char a, c;
+ signed short b, d, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 1;
+ b = 32765;
+ c = 127;
+ d = -128;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = &ffi_type_sshort;
+ cl_arg_types[2] = &ffi_type_schar;
+ cl_arg_types[3] = &ffi_type_sshort;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_sshort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 32765 127 -128: 32765" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 32765" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(1, 32765, 127, -128);
+ /* { dg-output "\n1 32765 127 -128: 32765" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32765" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_multi_uchar.c b/libffi/testsuite/libffi.call/cls_multi_uchar.c
new file mode 100644
index 00000000000..0b00bc3ff41
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_uchar.c
@@ -0,0 +1,96 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+unsigned char test_func_fn(unsigned char a1, unsigned char a2,
+ unsigned char a3, unsigned char a4)
+{
+ unsigned char result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ unsigned char a1, a2, a3, a4;
+
+ a1 = *(unsigned char *)avals[0];
+ a2 = *(unsigned char *)avals[1];
+ a3 = *(unsigned char *)avals[2];
+ a4 = *(unsigned char *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef unsigned char (*test_type)(unsigned char, unsigned char,
+ unsigned char, unsigned char);
+void test_func(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ printf("%d %d %d %d\n", *(unsigned char *)avals[0],
+ *(unsigned char *)avals[1], *(unsigned char *)avals[2],
+ *(unsigned char *)avals[3]);
+}
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ unsigned char a, b, c, d, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 1;
+ b = 2;
+ c = 127;
+ d = 125;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_uchar;
+ cl_arg_types[1] = &ffi_type_uchar;
+ cl_arg_types[2] = &ffi_type_uchar;
+ cl_arg_types[3] = &ffi_type_uchar;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_uchar, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 2 127 125: 255" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 255" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(1, 2, 127, 125);
+ /* { dg-output "\n1 2 127 125: 255" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 255" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_multi_ushort.c b/libffi/testsuite/libffi.call/cls_multi_ushort.c
new file mode 100644
index 00000000000..e6ae9aa0755
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_ushort.c
@@ -0,0 +1,81 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned short values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+unsigned short test_func_fn(unsigned short a1, unsigned short a2)
+{
+ unsigned short result;
+
+ result = a1 + a2;
+
+ printf("%d %d: %d\n", a1, a2, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ unsigned short a1, a2;
+
+ a1 = *(unsigned short *)avals[0];
+ a2 = *(unsigned short *)avals[1];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2);
+
+}
+
+typedef unsigned short (*test_type)(unsigned short, unsigned short);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[3];
+ ffi_type * cl_arg_types[3];
+ ffi_arg res_call;
+ unsigned short a, b, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 2;
+ b = 32765;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[3] = NULL;
+
+ cl_arg_types[0] = &ffi_type_ushort;
+ cl_arg_types[1] = &ffi_type_ushort;
+ cl_arg_types[2] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2,
+ &ffi_type_ushort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "2 32765: 32767" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 32767" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(2, 32765);
+ /* { dg-output "\n2 32765: 32767" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 32767" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_multi_ushortchar.c b/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
new file mode 100644
index 00000000000..2458fc53190
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_multi_ushortchar.c
@@ -0,0 +1,93 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check passing of multiple unsigned short/char values.
+ Limitations: none.
+ PR: PR13221.
+ Originator: <andreast@gcc.gnu.org> 20031129 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+unsigned short test_func_fn(unsigned char a1, unsigned short a2,
+ unsigned char a3, unsigned short a4)
+{
+ unsigned short result;
+
+ result = a1 + a2 + a3 + a4;
+
+ printf("%d %d %d %d: %d\n", a1, a2, a3, a4, result);
+
+ return result;
+
+}
+
+static void test_func_gn(ffi_cif *cif, void *rval, void **avals, void *data)
+{
+ unsigned char a1, a3;
+ unsigned short a2, a4;
+
+ a1 = *(unsigned char *)avals[0];
+ a2 = *(unsigned short *)avals[1];
+ a3 = *(unsigned char *)avals[2];
+ a4 = *(unsigned short *)avals[3];
+
+ *(ffi_arg *)rval = test_func_fn(a1, a2, a3, a4);
+
+}
+
+typedef unsigned short (*test_type)(unsigned char, unsigned short,
+ unsigned char, unsigned short);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void * args_dbl[5];
+ ffi_type * cl_arg_types[5];
+ ffi_arg res_call;
+ unsigned char a, c;
+ unsigned short b, d, res_closure;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ a = 1;
+ b = 2;
+ c = 127;
+ d = 128;
+
+ args_dbl[0] = &a;
+ args_dbl[1] = &b;
+ args_dbl[2] = &c;
+ args_dbl[3] = &d;
+ args_dbl[4] = NULL;
+
+ cl_arg_types[0] = &ffi_type_uchar;
+ cl_arg_types[1] = &ffi_type_ushort;
+ cl_arg_types[2] = &ffi_type_uchar;
+ cl_arg_types[3] = &ffi_type_ushort;
+ cl_arg_types[4] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 4,
+ &ffi_type_ushort, cl_arg_types) == FFI_OK);
+
+ ffi_call(&cif, FFI_FN(test_func_fn), &res_call, args_dbl);
+ /* { dg-output "1 2 127 128: 258" } */
+ printf("res: %d\n", res_call);
+ /* { dg-output "\nres: 258" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, test_func_gn, NULL) == FFI_OK);
+
+ res_closure = (*((test_type)pcl))(1, 2, 127, 128);
+ /* { dg-output "\n1 2 127 128: 258" } */
+ printf("res: %d\n", res_closure);
+ /* { dg-output "\nres: 258" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_schar.c b/libffi/testsuite/libffi.call/cls_schar.c
new file mode 100644
index 00000000000..1e607ab2848
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_schar.c
@@ -0,0 +1,50 @@
+/* Area: closure_call
+ Purpose: Check return value schar.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+static void cls_ret_schar_fn(ffi_cif* cif,void* resp,void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp = *(signed char *)args[0];
+ printf("%d: %d\n",*(signed char *)args[0],
+ *(ffi_arg*)resp);
+}
+typedef signed char (*cls_ret_schar)(signed char);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[2];
+ signed char res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cl_arg_types[0] = &ffi_type_schar;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_schar, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_ret_schar_fn, NULL) == FFI_OK);
+
+ res = (*((cls_ret_schar)pcl))(127);
+ /* { dg-output "127: 127" } */
+ printf("res: %d\n", res);
+ /* { dg-output "\nres: 127" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_sint.c b/libffi/testsuite/libffi.call/cls_sint.c
new file mode 100644
index 00000000000..c85067bf126
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_sint.c
@@ -0,0 +1,50 @@
+/* Area: closure_call
+ Purpose: Check return value sint32.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+static void cls_ret_sint_fn(ffi_cif* cif,void* resp,void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp = *(signed int *)args[0];
+ printf("%d: %d\n",*(signed int *)args[0],
+ *(ffi_arg*)resp);
+}
+typedef signed int (*cls_ret_sint)(signed int);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[2];
+ signed int res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cl_arg_types[0] = &ffi_type_sint32;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sint32, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sint_fn, NULL) == FFI_OK);
+
+ res = (*((cls_ret_sint)pcl))(65534);
+ /* { dg-output "65534: 65534" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 65534" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_sshort.c b/libffi/testsuite/libffi.call/cls_sshort.c
new file mode 100644
index 00000000000..65e687227d8
--- /dev/null
+++ b/libffi/testsuite/libffi.call/cls_sshort.c
@@ -0,0 +1,50 @@
+/* Area: closure_call
+ Purpose: Check return value sshort.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20031108 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+static void cls_ret_sshort_fn(ffi_cif* cif,void* resp,void** args,
+ void* userdata)
+{
+ *(ffi_arg*)resp = *(signed short *)args[0];
+ printf("%d: %d\n",*(signed short *)args[0],
+ *(ffi_arg*)resp);
+}
+typedef signed short (*cls_ret_sshort)(signed short);
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ ffi_type * cl_arg_types[2];
+ signed short res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cl_arg_types[0] = &ffi_type_sint16;
+ cl_arg_types[1] = NULL;
+
+ /* Initialize the cif */
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ &ffi_type_sint16, cl_arg_types) == FFI_OK);
+
+ CHECK(ffi_prep_closure(pcl, &cif, cls_ret_sshort_fn, NULL) == FFI_OK);
+
+ res = (*((cls_ret_sshort)pcl))(255);
+ /* { dg-output "255: 255" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 255" } */
+
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/cls_uchar.c b/libffi/testsuite/libffi.call/cls_uchar.c
index 28fb1e3c232..6a1e63709da 100644
--- a/libffi/testsuite/libffi.call/cls_uchar.c
+++ b/libffi/testsuite/libffi.call/cls_uchar.c
@@ -19,10 +19,18 @@ typedef unsigned char (*cls_ret_uchar)(unsigned char);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ unsigned char res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_uchar;
cl_arg_types[1] = NULL;
@@ -33,8 +41,10 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uchar_fn, NULL) == FFI_OK);
- (*((cls_ret_uchar)pcl))(127);
+ res = (*((cls_ret_uchar)pcl))(127);
/* { dg-output "127: 127" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 127" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_uint.c b/libffi/testsuite/libffi.call/cls_uint.c
index f0977ab2308..501e179fd7f 100644
--- a/libffi/testsuite/libffi.call/cls_uint.c
+++ b/libffi/testsuite/libffi.call/cls_uint.c
@@ -20,10 +20,18 @@ typedef unsigned int (*cls_ret_uint)(unsigned int);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ unsigned int res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_uint32;
cl_arg_types[1] = NULL;
@@ -34,8 +42,10 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_uint_fn, NULL) == FFI_OK);
- (*((cls_ret_uint)pcl))(2147483647);
+ res = (*((cls_ret_uint)pcl))(2147483647);
/* { dg-output "2147483647: 2147483647" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 2147483647" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_ulonglong.c b/libffi/testsuite/libffi.call/cls_ulonglong.c
index 7c98d757fd0..072da8c1e50 100644
--- a/libffi/testsuite/libffi.call/cls_ulonglong.c
+++ b/libffi/testsuite/libffi.call/cls_ulonglong.c
@@ -20,9 +20,18 @@ typedef unsigned long long (*cls_ret_ulonglong)(unsigned long long);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ unsigned long long res;
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_uint64;
cl_arg_types[1] = NULL;
@@ -31,10 +40,15 @@ int main (void)
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_uint64, cl_arg_types) == FFI_OK);
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ulonglong_fn, NULL) == FFI_OK);
- (*((cls_ret_ulonglong)pcl))(214LL);
+ res = (*((cls_ret_ulonglong)pcl))(214LL);
/* { dg-output "214: 214" } */
- (*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
+ printf("res: %lld\n", res);
+ /* { dg-output "\nres: 214" } */
+
+ res = (*((cls_ret_ulonglong)pcl))(9223372035854775808LL);
/* { dg-output "\n9223372035854775808: 9223372035854775808" } */
+ printf("res: %lld\n", res);
+ /* { dg-output "\nres: 9223372035854775808" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/cls_ushort.c b/libffi/testsuite/libffi.call/cls_ushort.c
index e3acc1529aa..f6626b9c30c 100644
--- a/libffi/testsuite/libffi.call/cls_ushort.c
+++ b/libffi/testsuite/libffi.call/cls_ushort.c
@@ -20,10 +20,18 @@ typedef unsigned short (*cls_ret_ushort)(unsigned short);
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[2];
+ unsigned short res;
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
cl_arg_types[0] = &ffi_type_ushort;
cl_arg_types[1] = NULL;
@@ -34,8 +42,10 @@ int main (void)
CHECK(ffi_prep_closure(pcl, &cif, cls_ret_ushort_fn, NULL) == FFI_OK);
- (*((cls_ret_ushort)pcl))(65535);
+ res = (*((cls_ret_ushort)pcl))(65535);
/* { dg-output "65535: 65535" } */
+ printf("res: %d\n",res);
+ /* { dg-output "\nres: 65535" } */
exit(0);
}
diff --git a/libffi/testsuite/libffi.call/ffitest.h b/libffi/testsuite/libffi.call/ffitest.h
index 7856405d2f5..8012e51288f 100644
--- a/libffi/testsuite/libffi.call/ffitest.h
+++ b/libffi/testsuite/libffi.call/ffitest.h
@@ -1,9 +1,79 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#include <fcntl.h>
#include <ffi.h>
+#include "fficonfig.h"
#define MAX_ARGS 256
-#define CHECK(x) !(x) ? abort() : 0
+#define CHECK(x) !(x) ? abort() : 0
+
+/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
+ file open. */
+#ifdef HAVE_MMAP_ANON
+# undef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef USING_MMAP
+static inline void *
+allocate_mmap (size_t size)
+{
+ void *page;
+#if defined (HAVE_MMAP_DEV_ZERO)
+ static int dev_zero_fd = -1;
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+ if (dev_zero_fd == -1)
+ {
+ dev_zero_fd = open ("/dev/zero", O_RDONLY);
+ if (dev_zero_fd == -1)
+ {
+ perror ("open /dev/zero: %m");
+ exit (1);
+ }
+ }
+#endif
+
+
+#ifdef HAVE_MMAP_ANON
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
+#ifdef HAVE_MMAP_DEV_ZERO
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE, dev_zero_fd, 0);
+#endif
+
+ if (page == MAP_FAILED)
+ {
+ perror ("virtual memory exhausted");
+ exit (1);
+ }
+
+ return page;
+}
+
+#endif
diff --git a/libffi/testsuite/libffi.call/many_win32.c b/libffi/testsuite/libffi.call/many_win32.c
index 79be6d632dd..7cb53367802 100644
--- a/libffi/testsuite/libffi.call/many_win32.c
+++ b/libffi/testsuite/libffi.call/many_win32.c
@@ -7,6 +7,7 @@
/* { dg-do run { target i?86-*-cygwin* i?86-*-mingw* } } */
#include "ffitest.h"
+#include <float.h>
static float __attribute__((stdcall)) stdcall_many(float f1,
float f2,
@@ -32,7 +33,7 @@ int main (void)
void *values[13];
float fa[13];
float f, ff;
- int i;
+ unsigned long ul;
for (ul = 0; ul < 13; ul++)
{
diff --git a/libffi/testsuite/libffi.call/nested_struct.c b/libffi/testsuite/libffi.call/nested_struct.c
index e9fb4f9dfa4..86d685a68a7 100644
--- a/libffi/testsuite/libffi.call/nested_struct.c
+++ b/libffi/testsuite/libffi.call/nested_struct.c
@@ -67,8 +67,10 @@ cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type* cls_struct_fields1[5];
@@ -76,6 +78,12 @@ int main (void)
ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
diff --git a/libffi/testsuite/libffi.call/nested_struct1.c b/libffi/testsuite/libffi.call/nested_struct1.c
index 57373fb7b74..1d87945defc 100644
--- a/libffi/testsuite/libffi.call/nested_struct1.c
+++ b/libffi/testsuite/libffi.call/nested_struct1.c
@@ -71,8 +71,10 @@ cls_struct_combined_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
int main (void)
{
ffi_cif cif;
+#ifndef USING_MMAP
static ffi_closure cl;
- ffi_closure *pcl = &cl;
+#endif
+ ffi_closure *pcl;
void* args_dbl[5];
ffi_type* cls_struct_fields[5];
ffi_type* cls_struct_fields1[5];
@@ -80,6 +82,12 @@ int main (void)
ffi_type cls_struct_type, cls_struct_type1, cls_struct_type2;
ffi_type* dbl_arg_types[5];
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
cls_struct_type.size = 0;
cls_struct_type.alignment = 0;
cls_struct_type.type = FFI_TYPE_STRUCT;
diff --git a/libffi/testsuite/libffi.call/nested_struct2.c b/libffi/testsuite/libffi.call/nested_struct2.c
new file mode 100644
index 00000000000..3572a4c49cc
--- /dev/null
+++ b/libffi/testsuite/libffi.call/nested_struct2.c
@@ -0,0 +1,127 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030911 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+#if LONG_MAX == 2147483647
+#define ffi_type_mylong ffi_type_uint32
+#else
+#if LONG_MAX == 9223372036854775807
+#define ffi_type_mylong ffi_type_uint64
+#else
+#error "Error, size LONG not defined as expected"
+#endif
+#endif
+
+typedef struct A {
+ unsigned long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+B B_fn(struct A b0, struct B b1)
+{
+ struct B result;
+
+ result.x.a = b0.a + b1.x.a;
+ result.x.b = b0.b + b1.x.b + b1.y;
+ result.y = b0.b + b1.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", b0.a, b0.b, b1.x.a, b1.x.b, b1.y,
+ result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1, 7};
+ struct B f_dbl = {{12 , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_mylong;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+
+ CHECK(ffi_prep_closure(pcl, &cif, B_gn, NULL) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(pcl))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/nested_struct3.c b/libffi/testsuite/libffi.call/nested_struct3.c
new file mode 100644
index 00000000000..95cf2f3b44f
--- /dev/null
+++ b/libffi/testsuite/libffi.call/nested_struct3.c
@@ -0,0 +1,118 @@
+/* Area: ffi_call, closure_call
+ Purpose: Check structure passing with different structure size.
+ Contains structs as parameter of the struct itself.
+ Sample taken from Alan Modras patch to src/prep_cif.c.
+ Limitations: none.
+ PR: none.
+ Originator: <andreast@gcc.gnu.org> 20030911 */
+
+/* { dg-do run { xfail mips*-*-* arm*-*-* strongarm*-*-* xscale*-*-* } } */
+#include "ffitest.h"
+
+typedef struct A {
+ unsigned long long a;
+ unsigned char b;
+} A;
+
+typedef struct B {
+ struct A x;
+ unsigned char y;
+} B;
+
+B B_fn(struct A b0, struct B b1)
+{
+ struct B result;
+
+ result.x.a = b0.a + b1.x.a;
+ result.x.b = b0.b + b1.x.b + b1.y;
+ result.y = b0.b + b1.x.b;
+
+ printf("%d %d %d %d %d: %d %d %d\n", (int)b0.a, b0.b,
+ (int)b1.x.a, b1.x.b, b1.y,
+ (int)result.x.a, result.x.b, result.y);
+
+ return result;
+}
+
+static void
+B_gn(ffi_cif* cif, void* resp, void** args, void* userdata)
+{
+ struct A b0;
+ struct B b1;
+
+ b0 = *(struct A*)(args[0]);
+ b1 = *(struct B*)(args[1]);
+
+ *(B*)resp = B_fn(b0, b1);
+}
+
+int main (void)
+{
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args_dbl[3];
+ ffi_type* cls_struct_fields[3];
+ ffi_type* cls_struct_fields1[3];
+ ffi_type cls_struct_type, cls_struct_type1;
+ ffi_type* dbl_arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ cls_struct_type.size = 0;
+ cls_struct_type.alignment = 0;
+ cls_struct_type.type = FFI_TYPE_STRUCT;
+ cls_struct_type.elements = cls_struct_fields;
+
+ cls_struct_type1.size = 0;
+ cls_struct_type1.alignment = 0;
+ cls_struct_type1.type = FFI_TYPE_STRUCT;
+ cls_struct_type1.elements = cls_struct_fields1;
+
+ struct A e_dbl = { 1LL, 7};
+ struct B f_dbl = {{12LL , 127}, 99};
+
+ struct B res_dbl;
+
+ cls_struct_fields[0] = &ffi_type_uint64;
+ cls_struct_fields[1] = &ffi_type_uchar;
+ cls_struct_fields[2] = NULL;
+
+ cls_struct_fields1[0] = &cls_struct_type;
+ cls_struct_fields1[1] = &ffi_type_uchar;
+ cls_struct_fields1[2] = NULL;
+
+
+ dbl_arg_types[0] = &cls_struct_type;
+ dbl_arg_types[1] = &cls_struct_type1;
+ dbl_arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &cls_struct_type1,
+ dbl_arg_types) == FFI_OK);
+
+ args_dbl[0] = &e_dbl;
+ args_dbl[1] = &f_dbl;
+ args_dbl[2] = NULL;
+
+ ffi_call(&cif, FFI_FN(B_fn), &res_dbl, args_dbl);
+ /* { dg-output "1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+
+
+ CHECK(ffi_prep_closure(pcl, &cif, B_gn, NULL) == FFI_OK);
+
+ res_dbl = ((B(*)(A, B))(pcl))(e_dbl, f_dbl);
+ /* { dg-output "\n1 7 12 127 99: 13 233 134" } */
+ CHECK( res_dbl.x.a == (e_dbl.a + f_dbl.x.a));
+ CHECK( res_dbl.x.b == (e_dbl.b + f_dbl.x.b + f_dbl.y));
+ CHECK( res_dbl.y == (e_dbl.b + f_dbl.x.b));
+ exit(0);
+}
diff --git a/libffi/testsuite/libffi.call/problem1.c b/libffi/testsuite/libffi.call/problem1.c
index 6cbdb2c4c9a..5b6397f4efa 100644
--- a/libffi/testsuite/libffi.call/problem1.c
+++ b/libffi/testsuite/libffi.call/problem1.c
@@ -29,65 +29,69 @@ my_ffi_struct callee(struct my_ffi_struct a1, struct my_ffi_struct a2)
void stub(ffi_cif* cif, void* resp, void** args, void* userdata)
{
- struct my_ffi_struct a1;
- struct my_ffi_struct a2;
+ struct my_ffi_struct a1;
+ struct my_ffi_struct a2;
- a1 = *(struct my_ffi_struct*)(args[0]);
- a2 = *(struct my_ffi_struct*)(args[1]);
+ a1 = *(struct my_ffi_struct*)(args[0]);
+ a2 = *(struct my_ffi_struct*)(args[1]);
- *(my_ffi_struct *)resp = callee(a1, a2);
+ *(my_ffi_struct *)resp = callee(a1, a2);
}
int main(void)
{
- ffi_type* my_ffi_struct_fields[4];
- ffi_type my_ffi_struct_type;
- ffi_cif cif;
- static ffi_closure cl;
- ffi_closure *pcl = &cl;
- void* args[4];
- ffi_type* arg_types[3];
-
- struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
- struct my_ffi_struct res;
-
- my_ffi_struct_type.size = 0;
- my_ffi_struct_type.alignment = 0;
- my_ffi_struct_type.type = FFI_TYPE_STRUCT;
- my_ffi_struct_type.elements = my_ffi_struct_fields;
-
- my_ffi_struct_fields[0] = &ffi_type_double;
- my_ffi_struct_fields[1] = &ffi_type_double;
- my_ffi_struct_fields[2] = &ffi_type_double;
- my_ffi_struct_fields[3] = NULL;
-
- arg_types[0] = &my_ffi_struct_type;
- arg_types[1] = &my_ffi_struct_type;
- arg_types[2] = NULL;
-
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
- arg_types) == FFI_OK);
-
- args[0] = &g;
- args[1] = &f;
- args[2] = NULL;
- ffi_call(&cif, FFI_FN(callee), &res, args);
- /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
-
- CHECK(res.a == 2.0);
- CHECK(res.b == 4.0);
- CHECK(res.c == 6.0);
-
- CHECK(ffi_prep_closure(pcl, &cif, stub, NULL) == FFI_OK);
-
- res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(pcl))(g, f);
- /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
-
- CHECK(res.a == 2.0);
- CHECK(res.b == 4.0);
- CHECK(res.c == 6.0);
-
- exit(0);;
+ ffi_type* my_ffi_struct_fields[4];
+ ffi_type my_ffi_struct_type;
+ ffi_cif cif;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
+ void* args[4];
+ ffi_type* arg_types[3];
+
+#ifdef USING_MMAP
+ pcl = allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
+ struct my_ffi_struct g = { 1.0, 2.0, 3.0 };
+ struct my_ffi_struct f = { 1.0, 2.0, 3.0 };
+ struct my_ffi_struct res;
+
+ my_ffi_struct_type.size = 0;
+ my_ffi_struct_type.alignment = 0;
+ my_ffi_struct_type.type = FFI_TYPE_STRUCT;
+ my_ffi_struct_type.elements = my_ffi_struct_fields;
+
+ my_ffi_struct_fields[0] = &ffi_type_double;
+ my_ffi_struct_fields[1] = &ffi_type_double;
+ my_ffi_struct_fields[2] = &ffi_type_double;
+ my_ffi_struct_fields[3] = NULL;
+
+ arg_types[0] = &my_ffi_struct_type;
+ arg_types[1] = &my_ffi_struct_type;
+ arg_types[2] = NULL;
+
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 2, &my_ffi_struct_type,
+ arg_types) == FFI_OK);
+
+ args[0] = &g;
+ args[1] = &f;
+ args[2] = NULL;
+ ffi_call(&cif, FFI_FN(callee), &res, args);
+ /* { dg-output "1 2 3 1 2 3: 2 4 6" } */
+ printf("res: %g %g %g\n", res.a, res.b, res.c);
+ /* { dg-output "\nres: 2 4 6" } */
+
+ CHECK(ffi_prep_closure(pcl, &cif, stub, NULL) == FFI_OK);
+
+ res = ((my_ffi_struct(*)(struct my_ffi_struct, struct my_ffi_struct))(pcl))(g, f);
+ /* { dg-output "\n1 2 3 1 2 3: 2 4 6" } */
+ printf("res: %g %g %g\n", res.a, res.b, res.c);
+ /* { dg-output "\nres: 2 4 6" } */
+
+ exit(0);;
}
diff --git a/libffi/testsuite/libffi.call/return_sc.c b/libffi/testsuite/libffi.call/return_sc.c
index 6f91ff6b4c5..e528a8467b0 100644
--- a/libffi/testsuite/libffi.call/return_sc.c
+++ b/libffi/testsuite/libffi.call/return_sc.c
@@ -22,12 +22,12 @@ int main (void)
args[0] = &ffi_type_schar;
values[0] = &sc;
-
+
/* Initialize the cif */
- CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
+ CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 1,
&ffi_type_schar, args) == FFI_OK);
-
- for (sc = (signed char) -127;
+
+ for (sc = (signed char) -127;
sc < (signed char) 127; sc++)
{
ul++;
diff --git a/libffi/testsuite/libffi.special/ffitestcxx.h b/libffi/testsuite/libffi.special/ffitestcxx.h
index fabe3057bea..01414cc1b0b 100644
--- a/libffi/testsuite/libffi.special/ffitestcxx.h
+++ b/libffi/testsuite/libffi.special/ffitestcxx.h
@@ -1,8 +1,77 @@
#include <stdlib.h>
#include <stdio.h>
+#include <fcntl.h>
#include <ffi.h>
+#include "fficonfig.h"
#define MAX_ARGS 256
#define CHECK(x) (!(x) ? abort() : (void)0)
+/* Prefer MAP_ANON(YMOUS) to /dev/zero, since we don't need to keep a
+ file open. */
+#ifdef HAVE_MMAP_ANON
+# undef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# if !defined (MAP_ANONYMOUS) && defined (MAP_ANON)
+# define MAP_ANONYMOUS MAP_ANON
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+
+# include <sys/mman.h>
+# ifndef MAP_FAILED
+# define MAP_FAILED -1
+# endif
+# define USING_MMAP
+
+#endif
+
+#ifdef USING_MMAP
+static inline void *
+allocate_mmap (size_t size)
+{
+ void *page;
+#if defined (HAVE_MMAP_DEV_ZERO)
+ static int dev_zero_fd = -1;
+#endif
+
+#ifdef HAVE_MMAP_DEV_ZERO
+ if (dev_zero_fd == -1)
+ {
+ dev_zero_fd = open ("/dev/zero", O_RDONLY);
+ if (dev_zero_fd == -1)
+ {
+ perror ("open /dev/zero: %m");
+ exit (1);
+ }
+ }
+#endif
+
+
+#ifdef HAVE_MMAP_ANON
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+#endif
+#ifdef HAVE_MMAP_DEV_ZERO
+ page = mmap (NULL, size, PROT_READ | PROT_WRITE | PROT_EXEC,
+ MAP_PRIVATE, dev_zero_fd, 0);
+#endif
+
+ if (page == MAP_FAILED)
+ {
+ perror ("virtual memory exhausted");
+ exit (1);
+ }
+
+ return page;
+}
+
+#endif
diff --git a/libffi/testsuite/libffi.special/unwindtest.cc b/libffi/testsuite/libffi.special/unwindtest.cc
index ee6806effe1..4fec44ceebc 100644
--- a/libffi/testsuite/libffi.special/unwindtest.cc
+++ b/libffi/testsuite/libffi.special/unwindtest.cc
@@ -49,18 +49,28 @@ typedef int (*closure_test_type1)(float, float, float, float, signed short,
int main (void)
{
ffi_cif cif;
- ffi_closure cl;
+#ifndef USING_MMAP
+ static ffi_closure cl;
+#endif
+ ffi_closure *pcl;
ffi_type * cl_arg_types[17];
+ int res;
+#ifdef USING_MMAP
+ pcl = (ffi_closure *) allocate_mmap (sizeof(ffi_closure));
+#else
+ pcl = &cl;
+#endif
+
{
cl_arg_types[1] = NULL;
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 0,
&ffi_type_void, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn, NULL) == FFI_OK);
+ CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn, NULL) == FFI_OK);
try
{
- (*((closure_test_type)(&cl)))();
+ (*((closure_test_type)(pcl)))();
} catch (int exception_code)
{
CHECK(exception_code == 9);
@@ -94,11 +104,11 @@ int main (void)
CHECK(ffi_prep_cif(&cif, FFI_DEFAULT_ABI, 16,
&ffi_type_sint, cl_arg_types) == FFI_OK);
- CHECK(ffi_prep_closure(&cl, &cif, closure_test_fn1,
+ CHECK(ffi_prep_closure(pcl, &cif, closure_test_fn1,
(void *) 3 /* userdata */) == FFI_OK);
try
{
- (*((closure_test_type1)(&cl)))
+ (*((closure_test_type1)pcl))
(1.1, 2.2, 3.3, 4.4, 127, 5.5, 6.6, 8, 9, 10, 11, 12.0, 13,
19, 21, 1);
/* { dg-output "\n1 2 3 4 127 5 6 8 9 10 11 12 13 19 21 1 3: 255" } */
diff --git a/libiberty/ChangeLog b/libiberty/ChangeLog
index 6264fbf5a0b..2db65a9528b 100644
--- a/libiberty/ChangeLog
+++ b/libiberty/ChangeLog
@@ -1,3 +1,303 @@
+2004-02-11 Mark Mitchell <mark@codesourcery.com>
+
+ * make-relative-prefix.c (make_relative_prefix): Do not throw out
+ the last component of PROG_DIRS if it is a directory name.
+
+2004-01-23 Mark Mitchell <mark@codesourcery.com>
+
+ * pex-win32.c (pexec): Close duplicated handles in parent
+ after spawning child. Return a process HANDLE, not a process
+ identifier.
+ (pwait): Expect a process HANDLE, not a process identifier.
+
+2003-12-25 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
+
+ * cp-demangle.c (is_ctor_or_dtor): Fix error in last change.
+
+2003-12-23 Zack Weinberg <zack@codesourcery.com>
+ Nathan Sidwell <nathan@codesourcery.com>
+ Mark Mitchell <mark@codesourcery.com>
+
+ * pex-common.c (STDERR_FILE_NO): Define.
+ * pex-win32.c: Rework extensively.
+ * pex-unix.c: Likewise.
+
+2003-12-22 Daniel Jacobowitz <drow@mvista.com>
+
+ PR debug/13272
+ * Makefile.in (lbasename.o): Depend on filenames.h.
+ * lbasename.c: Include "filenames.h" instead of defining
+ its macros locally.
+
+2003-12-22 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (CP_DYNAMIC_ARRAYS): Define if compiler supports
+ dynamic arrays.
+ (struct d_operator_info): Add len field.
+ (struct d_builtin_type_info): Add len and java_len fields.
+ (struct d_standard_sub_info): Add simple_len, full_len, and
+ set_last_name_len fields.
+ (struct d_comp): Add len field to s_string.
+ (struct d_info): Add send, did_subs, and expansion fields.
+ (d_append_string_constant): Define.
+ (d_append_string): Remove. Change all users to use
+ d_append_string_constant or d_append_buffer instead.
+ (d_make_sub): Add len parameter. Change all callers.
+ (d_name): Increase expansion when substituting std::.
+ (d_unqualified_name): Increase expansion for an operator.
+ (d_number): Don't use multiplication for negative numbers.
+ (d_identifier): Make sure there are enough characters in the
+ string for the specified length. Adjust expansion for an
+ anonymous namespace.
+ (d_operators): Initialize len field.
+ (d_special_name, d_ctor_dtor_name): Increase expansion.
+ (d_builtin_types): Initialize len and java_len fields.
+ (d_type): Increase expansion for a builtin type.
+ (d_cv_qualifiers): Increase expansion for each qualifier.
+ (d_bare_function_type): Decrease expansion when removing single
+ void parameter.
+ (d_template_param): Increment did_subs.
+ (d_expression): Increase expansion for an operator.
+ (d_expr_primary): Decrease expansion for a type we will print
+ specially.
+ (standard_subs): Initialize new fields.
+ (d_substitution): Increment did_subs when doing a normal
+ substitution. Increase expansion for a special substitution.
+ (d_print): Add estimate parameter. Change all callers.
+ (d_print_comp) [D_COMP_NAME]: Handle C++ case inline.
+ (d_print_comp) [D_COMP_BINARY]: Use length to avoid strcmp call.
+ (d_print_java_identifier): Rename from d_print_identifier. Handle
+ only Java case. Change caller.
+ (d_init_info): Change return type to void. Change all callers.
+ Initialize send, did_subs, and expansion fields. Do not
+ initialize comps and subs fields.
+ (d_demangle): Ifdef CP_DYNAMIC_ARRAYS, allocate comps and subs
+ arrays on stack. Make an estimate of the length of the demangled
+ name. Ifdef CP_DEMANGLE_DEBUG, print estimation failures.
+ (is_ctor_or_dtor): Ifdef CP_DYNAMIC_ARRAYS, allocate comps and
+ subs arrays on stack.
+
+2003-12-20 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_identifier): In Java mode, skip an optional '$'
+ after the identifier.
+ * testsuite/demangle-expected: Add test case.
+
+2003-12-19 Ian Lance Taylor <ian@wasabisystems.com>
+
+ Fix for PR c++/13447:
+ * cp-demangle.c (enum d_comp_type): Add D_COMP_LOCAL_NAME.
+ (d_dump, d_make_comp): Handle D_COMP_LOCAL_NAME.
+ (is_ctor_dtor_or_conversion): Handle D_COMP_LOCAL_NAME like
+ D_COMP_QUAL_NAME.
+ (is_ctor_or_dtor): Likewise.
+ (d_local_name): Use D_COMP_LOCAL_NAME rather than
+ D_COMP_QUAL_NAME.
+ (d_print_comp) [D_COMP_LOCAL_NAME]: New.
+ (d_prinT_comp) [D_COMP_TYPED_NAME]: If the left tree is
+ D_COMP_LOCAL_NAME, pull any qualifiers off its right subtree.
+ (d_print_mod_list): Handle D_COMP_LOCAL_NAME.
+ * testsuite/demangle-expected: Add two test cases.
+
+ * cp-demangle.c (d_print_function_type): Clear the global modifier
+ list when printing the modifiers, not just when printing the
+ function parameters.
+ * testsuite/demangle-expected: Add two test cases.
+
+2003-12-15 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_print_function_type): Print the function
+ parameters with no modifiers.
+ * testsuite/demangle-expected: Add test case.
+
+ * cp-demangle.c (d_demangle): If DMGL_PARAMS is not set, don't
+ expect that we've read the entire string.
+ (is_ctor_or_dtor): Don't expect that we've read the entire
+ string--reverse patch of 2003-11-29.
+
+2003-12-15 Brendan Kehoe <brendan@zen.org>
+
+ * libiberty/Makefile.in (floatformat.o): Add dependency on
+ config.h to accompany change of 2003-12-03.
+
+2003-12-15 Ian Lance Taylor <ian@wasabisystems.com>
+
+ Fix handling of constructor/destructor of standard substitution:
+ * cp-demangle.c (struct d_standard_sub_info): Define.
+ (d_substitution): Add prefix argument. Change all callers.
+ Rework handling of standard substitutions to print full name when
+ qualifying a constructor/destructor, or when DMGL_VERBOSE is set.
+ * testsuite/demangle-expected: Add test case.
+
+ Fix handling of negative literal constants:
+ * cp-demangle.c (enum d_comp_type): Add D_COMP_LITERAL_NEG.
+ (d_dump, d_make_comp): Handle D_COMP_LITERAL_NEG.
+ (d_expr_primary): Use D_COMP_LITERAL_NEG for a negative number.
+ (d_print_comp): Handle D_COMP_LITERAL_NEG.
+ * testsuite/demangle-expected: Add test case.
+
+2003-12-04 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (IS_UPPER, IS_LOWER): Define.
+ (d_last_char): Define new macro.
+ (d_make_name): Reject an empty name.
+ (d_prefix, d_unqualified_name, d_type): Use new IS_* macros.
+ (d_substitution, d_print_identifier): Likewise.
+ (d_print_comp) [D_COMP_OPERATOR]: Likewise.
+ (d_print_comp) [D_COMP_TEMPLATE]: Use new d_last_char macro.
+ (d_print_mod) Use new d_last_char macro.
+ (d_print_cast): Use new d_last_char macro.
+ (is_ctor_or_dtor): Don't leak memory.
+
+ Fix handling of member function modifiers:
+ * cp-demangle.c (enum d_comp_type): Add D_COMP_RESTRICT_THIS,
+ D_COMP_VOLATILE_THIS, and D_COMP_CONST_THIS.
+ (d_dump): Dump new d_comp_type values.
+ (d_make_comp): Accept new d_comp_type values.
+ (has_return_type): Only accept _THIS variants of qualifiers.
+ (d_encoding): Without DMGL_PARAMS, only remove _THIS variants of
+ qualifiers.
+ (d_cv_qualifiers): Add member_fn parameter. Change all callers.
+ (d_print_comp) [D_COMP_TYPED_NAME]: Rather than removing
+ qualifiers and printing them at the end, add _THIS qualifiers to
+ the modifier list.
+ (d_print_comp) [D_COMP_*_THIS]: New cases.
+ (d_print_comp) [D_COMP_PTRMEM_TYPE]: Remove special handling of
+ qualifiers.
+ (d_print_mod_list): Add suffix parameter. Change all callers.
+ Keep walking the list even if the current modifier has been
+ printed.
+ (d_print_mod): Handle new _THIS qualifiers.
+ (d_print_function_type): Handle new _THIS qualifiers when deciding
+ whether to print a parenthesis. Put a space before the
+ parenthesis in some cases. Call d_print_mod_list again at the
+ end, passing suffix as 1.
+ (is_ctor_or_dtor): Look for new _THIS qualifiers.
+ * testsuite/demangle-expected: Add test case.
+
+ Fix for PR gcc/13304:
+ * cp-demangle.c (d_print_comp) [D_COMP_TEMPLATE]: If the character
+ before the '<' is itself a '<', insert a space.
+ (d_print_cast): Likewise.
+ * testsuite/demangle-expected: Add test case.
+
+ Fix for PR gcc/13244:
+ * cp-demangle.c (d_print_comp) [D_COMP_BINARY]: Wrap an expression
+ which uses the '>' operator in an extra layer of parens.
+ * testsuite/demangle-expected: Add test case.
+
+2003-12-03 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * floatformat.c: Include "config.h" and <string.h> if available.
+ (INFINITY, NAN): Define if not defined by <math.h>.
+ (floatformat_to_double): Handle NaN, infinity, and denormalized
+ numbers.
+ (floatformat_from_double): Likewise.
+ (ieee_test): In debugging code, use little endian rather than big
+ endian. Correct tests to handle NaN and to check correct sign of
+ zero. Omit m68k extended test.
+ (main): Add more debugging cases.
+
+2003-11-29 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_demangle): Only return success if we consumed
+ the entire demangled string.
+ (is_ctor_or_dtor): Likewise.
+
+ * testsuite/demangle-expected: Revert one part of 2003-06-26 patch
+ to restore expected result of EDG test case to original expected
+ result.
+
+2003-11-26 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (struct d_print_mod): Add templates field.
+ (d_make_builtin_type): Check for NULL type.
+ (d_make_extended_operator): Check for NULL name.
+ (d_make_ctor, d_make_dtor): Likewise.
+ (d_mangled_name): Add top_level parameter. Change all callers.
+ (d_encoding): If DMGL_PARAMS is not set, strip off initial
+ CV-qualifiers.
+ (d_type): Check some return values we rely on.
+ (d_bare_function_type, d_array_type): Likewise.
+ (d_pointer_to_member_type, d_template_args): Likewise.
+ (d_add_substitution): Fail if argument is NULL.
+ (d_print_resize): Check whether buf is NULL.
+ (d_print_comp): Save current templates list with each modifier.
+ Don't pass the modifier list down when printing a template.
+ (d_print_cast): Don't pass the modifier list down when printing a
+ template.
+ (d_print_mod_list): Temporarily set templates list while printing
+ a modifier.
+ (d_print_mod): Check that buf is not NULL before using it.
+ (d_print_function_type): Print parens if there is no modifier.
+ (d_init_info): Permit as many substitutions as there are
+ characters in the mangled name.
+ * testsuite/demangle-expected: Add two new test cases.
+
+2003-11-25 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (java_demangle_v3): Pass DMGL_PARAMS to
+ d_demangle.
+
+2003-11-22 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (d_encoding): Add top_level parameter. Change all
+ callers.
+ (print_usage): Display new -p option.
+ (long_options): Add --no-params.
+ (main): Accept and handle -p.
+
+2003-11-21 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (has_return_type): Skip qualifiers when checking
+ whether we have a template.
+ * testsuite/demangle-expected: Add four new tests.
+
+2003-11-20 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * testsuite/demangle-expected: Minor changes to match output of
+ new demangler: adjust whitespace in four tests, and change order
+ of qualifiers in one test.
+
+ * cp-demangle.c: Complete rewrite.
+
+2003-11-19 Mark Mitchell <mark@codesourcery.com>
+
+ * cp-demangle.c (demangle_type): Correct thinko in substitution
+ processing.
+
+2003-11-18 Ian Lance Taylor <ian@wasabisystems.com>
+
+ * cp-demangle.c (demangle_operator_name): Remove space before
+ "sizeof".
+ (demangle_type_ptr): Put qualifiers in the right place. Handle
+ qualifiers in pointer to member specially.
+ (demangle_type): Handle qualifiers for pointer or reference
+ specially. Handle function type.
+ (demangle_local_name): Save and restore caret around demangling of
+ initial encoding.
+
+ * testsuite/test-demangle.c (main): Don't pass DMGL_VERBOSE to
+ cplus_demangle.
+
+ * testsuite/Makefile.in (test-demangle): Depend upon libiberty.a.
+
+2003-10-31 Andreas Jaeger <aj@suse.de>
+
+ * floatformat.c (floatformat_always_valid): Add unused attribute.
+
+2003-10-30 Josef Zlomek <zlomekj@suse.cz>
+
+ Jan Hubicka <jh@suse.cz>
+ * vasprintf.c (int_vasprintf): Pass va_list by value.
+ Use va_copy for copying va_list.
+ (vasprintf): Pass va_list by value.
+
+2003-10-30 Josef Zlomek <zlomekj@suse.cz>
+
+ * hashtab.c (htab_find_slot_with_hash): Decrease n_deleted
+ instead of increasing n_elements when inserting to deleted slot.
+
2003-10-20 J. Brobecker <brobecker@gnat.com>
* cplus-dem.c (demangle_template): Register a new Btype only
diff --git a/libiberty/Makefile.in b/libiberty/Makefile.in
index 5d2dc3cbf8d..f3ff338fa2d 100644
--- a/libiberty/Makefile.in
+++ b/libiberty/Makefile.in
@@ -437,7 +437,8 @@ dyn-string.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/dyn-string.h \
fdmatch.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
fibheap.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/fibheap.h \
$(INCDIR)/libiberty.h
-floatformat.o: $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h
+floatformat.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/floatformat.h \
+ $(INCDIR)/libiberty.h
fnmatch.o: config.h $(INCDIR)/fnmatch.h $(INCDIR)/safe-ctype.h
getcwd.o: config.h
getopt.o: config.h $(INCDIR)/getopt.h
@@ -450,7 +451,7 @@ hashtab.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/hashtab.h \
hex.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
$(INCDIR)/safe-ctype.h
lbasename.o: $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h \
- $(INCDIR)/safe-ctype.h
+ $(INCDIR)/safe-ctype.h $(INCDIR)/filenames.h
lrealpath.o: config.h $(INCDIR)/ansidecl.h $(INCDIR)/libiberty.h
make-relative-prefix.o: config.h $(INCDIR)/ansidecl.h \
$(INCDIR)/libiberty.h
diff --git a/libiberty/cp-demangle.c b/libiberty/cp-demangle.c
index bd4882239fb..16871abaad3 100644
--- a/libiberty/cp-demangle.c
+++ b/libiberty/cp-demangle.c
@@ -1,6 +1,6 @@
-/* Demangler for IA64 / g++ V3 ABI.
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
- Written by Alex Samuel <samuel@codesourcery.com>.
+/* Demangler for g++ V3 ABI.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+ Written by Ian Lance Taylor <ian@wasabisystems.com>.
This file is part of the libiberty library, which is part of GCC.
@@ -28,3643 +28,3893 @@
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-/* This file implements demangling of C++ names mangled according to
- the IA64 / g++ V3 ABI. Use the cp_demangle function to
- demangle a mangled name, or compile with the preprocessor macro
- STANDALONE_DEMANGLER defined to create a demangling filter
- executable (functionally similar to c++filt, but includes this
- demangler only). */
+/* This code implements a demangler for the g++ V3 ABI. The ABI is
+ described on this web page:
+ http://www.codesourcery.com/cxx-abi/abi.html#mangling
+
+ This code was written while looking at the demangler written by
+ Alex Samuel <samuel@codesourcery.com>.
+
+ This code first pulls the mangled name apart into a list of
+ components, and then walks the list generating the demangled
+ name.
+
+ This file will normally define the following functions, q.v.:
+ char *cplus_demangle_v3(const char *mangled, int options)
+ char *java_demangle_v3(const char *mangled)
+ enum gnu_v3_ctor_kinds is_gnu_v3_mangled_ctor (const char *name)
+ enum gnu_v3_dtor_kinds is_gnu_v3_mangled_dtor (const char *name)
+
+ Preprocessor macros you can define while compiling this file:
+
+ IN_LIBGCC2
+ If defined, this file defines the following function, q.v.:
+ char *__cxa_demangle (const char *mangled, char *buf, size_t *len,
+ int *status)
+ instead of cplus_demangle_v3() and java_demangle_v3().
+
+ IN_GLIBCPP_V3
+ If defined, this file defines only __cxa_demangle().
+
+ STANDALONE_DEMANGLER
+ If defined, this file defines a main() function which demangles
+ any arguments, or, if none, demangles stdin.
+
+ CP_DEMANGLE_DEBUG
+ If defined, turns on debugging mode, which prints information on
+ stdout about the mangled string. This is not generally useful.
+*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#include <sys/types.h>
+#include <stdio.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
-
-#include <stdio.h>
-
#ifdef HAVE_STRING_H
#include <string.h>
#endif
-#include <ctype.h>
-
#include "ansidecl.h"
#include "libiberty.h"
-#include "dyn-string.h"
#include "demangle.h"
-/* If CP_DEMANGLE_DEBUG is defined, a trace of the grammar evaluation,
- and other debugging output, will be generated. */
-#ifdef CP_DEMANGLE_DEBUG
-#define DEMANGLE_TRACE(PRODUCTION, DM) \
- fprintf (stderr, " -> %-24s at position %3d\n", \
- (PRODUCTION), current_position (DM));
-#else
-#define DEMANGLE_TRACE(PRODUCTION, DM)
-#endif
+/* See if the compiler supports dynamic arrays. */
-/* Don't include <ctype.h>, to prevent additional unresolved symbols
- from being dragged into the C++ runtime library. */
-#define IS_DIGIT(CHAR) ((CHAR) >= '0' && (CHAR) <= '9')
-#define IS_ALPHA(CHAR) \
- (((CHAR) >= 'a' && (CHAR) <= 'z') \
- || ((CHAR) >= 'A' && (CHAR) <= 'Z'))
+#ifdef __GNUC__
+#define CP_DYNAMIC_ARRAYS
+#else
+#ifdef __STDC__
+#ifdef __STDC_VERSION__
+#if __STDC_VERSION__ >= 199901L
+#define CP_DYNAMIC_ARRAYS
+#endif /* __STDC__VERSION >= 199901L */
+#endif /* defined (__STDC_VERSION__) */
+#endif /* defined (__STDC__) */
+#endif /* ! defined (__GNUC__) */
+
+/* We avoid pulling in the ctype tables, to prevent pulling in
+ additional unresolved symbols when this code is used in a library.
+ FIXME: Is this really a valid reason? This comes from the original
+ V3 demangler code.
+
+ As of this writing this file has the following undefined references
+ when compiled with -DIN_GLIBCPP_V3: malloc, realloc, free, memcpy,
+ strcpy, strcat, strlen. */
+
+#define IS_DIGIT(c) ((c) >= '0' && (c) <= '9')
+#define IS_UPPER(c) ((c) >= 'A' && (c) <= 'Z')
+#define IS_LOWER(c) ((c) >= 'a' && (c) <= 'z')
/* The prefix prepended by GCC to an identifier represnting the
anonymous namespace. */
#define ANONYMOUS_NAMESPACE_PREFIX "_GLOBAL_"
+#define ANONYMOUS_NAMESPACE_PREFIX_LEN \
+ (sizeof (ANONYMOUS_NAMESPACE_PREFIX) - 1)
-/* Character(s) to use for namespace separation in demangled output */
-#define NAMESPACE_SEPARATOR (dm->style == DMGL_JAVA ? "." : "::")
+/* Information we keep for operators. */
-/* If flag_verbose is zero, some simplifications will be made to the
- output to make it easier to read and supress details that are
- generally not of interest to the average C++ programmer.
- Otherwise, the demangled representation will attempt to convey as
- much information as the mangled form. */
-static int flag_verbose;
-
-/* If flag_strict is non-zero, demangle strictly according to the
- specification -- don't demangle special g++ manglings. */
-static int flag_strict;
+struct d_operator_info
+{
+ /* Mangled name. */
+ const char *code;
+ /* Real name. */
+ const char *name;
+ /* Length of real name. */
+ int len;
+ /* Number of arguments. */
+ int args;
+};
-/* String_list_t is an extended form of dyn_string_t which provides a
- link field and a caret position for additions to the string. A
- string_list_t may safely be cast to and used as a dyn_string_t. */
+/* How to print the value of a builtin type. */
-struct string_list_def
+enum d_builtin_type_print
{
- /* The dyn_string; must be first. */
- struct dyn_string string;
+ /* Print as (type)val. */
+ D_PRINT_DEFAULT,
+ /* Print as integer. */
+ D_PRINT_INT,
+ /* Print as long, with trailing `l'. */
+ D_PRINT_LONG,
+ /* Print as bool. */
+ D_PRINT_BOOL,
+ /* Print in usual way, but here to detect void. */
+ D_PRINT_VOID
+};
- /* The position at which additional text is added to this string
- (using the result_add* macros). This value is an offset from the
- end of the string, not the beginning (and should be
- non-positive). */
- int caret_position;
+/* Information we keep for a builtin type. */
- /* The next string in the list. */
- struct string_list_def *next;
+struct d_builtin_type_info
+{
+ /* Type name. */
+ const char *name;
+ /* Length of type name. */
+ int len;
+ /* Type name when using Java. */
+ const char *java_name;
+ /* Length of java name. */
+ int java_len;
+ /* How to print a value of this type. */
+ enum d_builtin_type_print print;
};
-typedef struct string_list_def *string_list_t;
-
-/* Data structure representing a potential substitution. */
+/* Information we keep for the standard substitutions. */
-struct substitution_def
+struct d_standard_sub_info
{
- /* The demangled text of the substitution. */
- dyn_string_t text;
-
- /* Whether this substitution represents a template item. */
- int template_p : 1;
+ /* The code for this substitution. */
+ char code;
+ /* The simple string it expands to. */
+ const char *simple_expansion;
+ /* The length of the simple expansion. */
+ int simple_len;
+ /* The results of a full, verbose, expansion. This is used when
+ qualifying a constructor/destructor, or when in verbose mode. */
+ const char *full_expansion;
+ /* The length of the full expansion. */
+ int full_len;
+ /* What to set the last_name field of d_info to; NULL if we should
+ not set it. This is only relevant when qualifying a
+ constructor/destructor. */
+ const char *set_last_name;
+ /* The length of set_last_name. */
+ int set_last_name_len;
};
-/* Data structure representing a template argument list. */
+/* Component types found in mangled names. */
-struct template_arg_list_def
+enum d_comp_type
{
- /* The next (lower) template argument list in the stack of currently
- active template arguments. */
- struct template_arg_list_def *next;
+ /* A name. */
+ D_COMP_NAME,
+ /* A qualified name. */
+ D_COMP_QUAL_NAME,
+ /* A local name. */
+ D_COMP_LOCAL_NAME,
+ /* A typed name. */
+ D_COMP_TYPED_NAME,
+ /* A template. */
+ D_COMP_TEMPLATE,
+ /* A template parameter. */
+ D_COMP_TEMPLATE_PARAM,
+ /* A constructor. */
+ D_COMP_CTOR,
+ /* A destructor. */
+ D_COMP_DTOR,
+ /* A vtable. */
+ D_COMP_VTABLE,
+ /* A VTT structure. */
+ D_COMP_VTT,
+ /* A construction vtable. */
+ D_COMP_CONSTRUCTION_VTABLE,
+ /* A typeinfo structure. */
+ D_COMP_TYPEINFO,
+ /* A typeinfo name. */
+ D_COMP_TYPEINFO_NAME,
+ /* A typeinfo function. */
+ D_COMP_TYPEINFO_FN,
+ /* A thunk. */
+ D_COMP_THUNK,
+ /* A virtual thunk. */
+ D_COMP_VIRTUAL_THUNK,
+ /* A covariant thunk. */
+ D_COMP_COVARIANT_THUNK,
+ /* A Java class. */
+ D_COMP_JAVA_CLASS,
+ /* A guard variable. */
+ D_COMP_GUARD,
+ /* A reference temporary. */
+ D_COMP_REFTEMP,
+ /* A standard substitution. */
+ D_COMP_SUB_STD,
+ /* The restrict qualifier. */
+ D_COMP_RESTRICT,
+ /* The volatile qualifier. */
+ D_COMP_VOLATILE,
+ /* The const qualifier. */
+ D_COMP_CONST,
+ /* The restrict qualifier modifying a member function. */
+ D_COMP_RESTRICT_THIS,
+ /* The volatile qualifier modifying a member function. */
+ D_COMP_VOLATILE_THIS,
+ /* The const qualifier modifying a member function. */
+ D_COMP_CONST_THIS,
+ /* A vendor qualifier. */
+ D_COMP_VENDOR_TYPE_QUAL,
+ /* A pointer. */
+ D_COMP_POINTER,
+ /* A reference. */
+ D_COMP_REFERENCE,
+ /* A complex type. */
+ D_COMP_COMPLEX,
+ /* An imaginary type. */
+ D_COMP_IMAGINARY,
+ /* A builtin type. */
+ D_COMP_BUILTIN_TYPE,
+ /* A vendor's builtin type. */
+ D_COMP_VENDOR_TYPE,
+ /* A function type. */
+ D_COMP_FUNCTION_TYPE,
+ /* An array type. */
+ D_COMP_ARRAY_TYPE,
+ /* A pointer to member type. */
+ D_COMP_PTRMEM_TYPE,
+ /* An argument list. */
+ D_COMP_ARGLIST,
+ /* A template argument list. */
+ D_COMP_TEMPLATE_ARGLIST,
+ /* An operator. */
+ D_COMP_OPERATOR,
+ /* An extended operator. */
+ D_COMP_EXTENDED_OPERATOR,
+ /* A typecast. */
+ D_COMP_CAST,
+ /* A unary expression. */
+ D_COMP_UNARY,
+ /* A binary expression. */
+ D_COMP_BINARY,
+ /* Arguments to a binary expression. */
+ D_COMP_BINARY_ARGS,
+ /* A trinary expression. */
+ D_COMP_TRINARY,
+ /* Arguments to a trinary expression. */
+ D_COMP_TRINARY_ARG1,
+ D_COMP_TRINARY_ARG2,
+ /* A literal. */
+ D_COMP_LITERAL,
+ /* A negative literal. */
+ D_COMP_LITERAL_NEG
+};
- /* The first element in the list of template arguments in
- left-to-right order. */
- string_list_t first_argument;
+/* A component of the mangled name. */
- /* The last element in the arguments lists. */
- string_list_t last_argument;
-};
+struct d_comp
+{
+ /* The type of this component. */
+ enum d_comp_type type;
+ union
+ {
+ /* For D_COMP_NAME. */
+ struct
+ {
+ /* A pointer to the name (not NULL terminated) and it's
+ length. */
+ const char *s;
+ int len;
+ } s_name;
+
+ /* For D_COMP_OPERATOR. */
+ struct
+ {
+ /* Operator. */
+ const struct d_operator_info *op;
+ } s_operator;
-typedef struct template_arg_list_def *template_arg_list_t;
+ /* For D_COMP_EXTENDED_OPERATOR. */
+ struct
+ {
+ /* Number of arguments. */
+ int args;
+ /* Name. */
+ struct d_comp *name;
+ } s_extended_operator;
+
+ /* For D_COMP_CTOR. */
+ struct
+ {
+ enum gnu_v3_ctor_kinds kind;
+ struct d_comp *name;
+ } s_ctor;
-/* Data structure to maintain the state of the current demangling. */
+ /* For D_COMP_DTOR. */
+ struct
+ {
+ enum gnu_v3_dtor_kinds kind;
+ struct d_comp *name;
+ } s_dtor;
-struct demangling_def
-{
- /* The full mangled name being mangled. */
- const char *name;
+ /* For D_COMP_BUILTIN_TYPE. */
+ struct
+ {
+ const struct d_builtin_type_info *type;
+ } s_builtin;
- /* Pointer into name at the current position. */
- const char *next;
+ /* For D_COMP_SUB_STD. */
+ struct
+ {
+ const char* string;
+ int len;
+ } s_string;
- /* Stack for strings containing demangled result generated so far.
- Text is emitted to the topmost (first) string. */
- string_list_t result;
+ /* For D_COMP_TEMPLATE_PARAM. */
+ struct
+ {
+ long number;
+ } s_number;
- /* The number of presently available substitutions. */
- int num_substitutions;
+ /* For other types. */
+ struct
+ {
+ struct d_comp *left;
+ struct d_comp *right;
+ } s_binary;
- /* The allocated size of the substitutions array. */
- int substitutions_allocated;
+ } u;
+};
- /* An array of available substitutions. The number of elements in
- the array is given by num_substitions, and the allocated array
- size in substitutions_size.
+#define d_left(dc) ((dc)->u.s_binary.left)
+#define d_right(dc) ((dc)->u.s_binary.right)
- The most recent substition is at the end, so
+/* The information structure we pass around. */
- - `S_' corresponds to substititutions[num_substitutions - 1]
- - `S0_' corresponds to substititutions[num_substitutions - 2]
+struct d_info
+{
+ /* The string we are demangling. */
+ const char *s;
+ /* The end of the string we are demangling. */
+ const char *send;
+ /* The options passed to the demangler. */
+ int options;
+ /* The next character in the string to consider. */
+ const char *n;
+ /* The array of components. */
+ struct d_comp *comps;
+ /* The index of the next available component. */
+ int next_comp;
+ /* The number of available component structures. */
+ int num_comps;
+ /* The array of substitutions. */
+ struct d_comp **subs;
+ /* The index of the next substitution. */
+ int next_sub;
+ /* The number of available entries in the subs array. */
+ int num_subs;
+ /* The number of substitutions which we actually made from the subs
+ array, plus the number of template parameter references we
+ saw. */
+ int did_subs;
+ /* The last name we saw, for constructors and destructors. */
+ struct d_comp *last_name;
+ /* A running total of the length of large expansions from the
+ mangled name to the demangled name, such as standard
+ substitutions and builtin types. */
+ int expansion;
+};
- etc. */
- struct substitution_def *substitutions;
+#define d_peek_char(di) (*((di)->n))
+#define d_peek_next_char(di) ((di)->n[1])
+#define d_advance(di, i) ((di)->n += (i))
+#define d_next_char(di) (*((di)->n++))
+#define d_str(di) ((di)->n)
- /* The stack of template argument lists. */
- template_arg_list_t template_arg_lists;
+/* A list of templates. This is used while printing. */
- /* The most recently demangled source-name. */
- dyn_string_t last_source_name;
-
- /* Language style to use for demangled output. */
- int style;
+struct d_print_template
+{
+ /* Next template on the list. */
+ struct d_print_template *next;
+ /* This template. */
+ const struct d_comp *template;
+};
- /* 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;
+/* A list of type modifiers. This is used while printing. */
- /* 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;
+struct d_print_mod
+{
+ /* Next modifier on the list. These are in the reverse of the order
+ in which they appeared in the mangled string. */
+ struct d_print_mod *next;
+ /* The modifier. */
+ const struct d_comp *mod;
+ /* Whether this modifier was printed. */
+ int printed;
+ /* The list of templates which applies to this modifier. */
+ struct d_print_template *templates;
+};
+/* We use this structure to hold information during printing. */
+
+struct d_print_info
+{
+ /* The options passed to the demangler. */
+ int options;
+ /* Buffer holding the result. */
+ char *buf;
+ /* Current length of data in buffer. */
+ size_t len;
+ /* Allocated size of buffer. */
+ size_t alc;
+ /* The current list of templates, if any. */
+ struct d_print_template *templates;
+ /* The current list of modifiers (e.g., pointer, reference, etc.),
+ if any. */
+ struct d_print_mod *modifiers;
+ /* Set to 1 if we had a memory allocation failure. */
+ int allocation_failure;
};
-typedef struct demangling_def *demangling_t;
-
-/* This type is the standard return code from most functions. Values
- other than STATUS_OK contain descriptive messages. */
-typedef const char *status_t;
-
-/* Special values that can be used as a status_t. */
-#define STATUS_OK NULL
-#define STATUS_ERROR "Error."
-#define STATUS_UNIMPLEMENTED "Unimplemented."
-#define STATUS_INTERNAL_ERROR "Internal error."
-
-/* This status code indicates a failure in malloc or realloc. */
-static const char *const status_allocation_failed = "Allocation failed.";
-#define STATUS_ALLOCATION_FAILED status_allocation_failed
-
-/* Non-zero if STATUS indicates that no error has occurred. */
-#define STATUS_NO_ERROR(STATUS) ((STATUS) == STATUS_OK)
-
-/* Evaluate EXPR, which must produce a status_t. If the status code
- indicates an error, return from the current function with that
- status code. */
-#define RETURN_IF_ERROR(EXPR) \
- do \
- { \
- status_t s = EXPR; \
- if (!STATUS_NO_ERROR (s)) \
- return s; \
- } \
+#define d_print_saw_error(dpi) ((dpi)->buf == NULL)
+
+#define d_append_char(dpi, c) \
+ do \
+ { \
+ if ((dpi)->buf != NULL && (dpi)->len < (dpi)->alc) \
+ (dpi)->buf[(dpi)->len++] = (c); \
+ else \
+ d_print_append_char ((dpi), (c)); \
+ } \
+ while (0)
+
+#define d_append_buffer(dpi, s, l) \
+ do \
+ { \
+ if ((dpi)->buf != NULL && (dpi)->len + (l) <= (dpi)->alc) \
+ { \
+ memcpy ((dpi)->buf + (dpi)->len, (s), (l)); \
+ (dpi)->len += l; \
+ } \
+ else \
+ d_print_append_buffer ((dpi), (s), (l)); \
+ } \
while (0)
-static status_t int_to_dyn_string
- PARAMS ((int, dyn_string_t));
-static string_list_t string_list_new
- PARAMS ((int));
-static void string_list_delete
- PARAMS ((string_list_t));
-static status_t result_add_separated_char
- PARAMS ((demangling_t, int));
-static status_t result_push
- PARAMS ((demangling_t));
-static string_list_t result_pop
- PARAMS ((demangling_t));
-static int substitution_start
- PARAMS ((demangling_t));
-static status_t substitution_add
- PARAMS ((demangling_t, int, int));
-static dyn_string_t substitution_get
- PARAMS ((demangling_t, int, int *));
+#define d_append_string_constant(dpi, s) \
+ d_append_buffer (dpi, (s), sizeof (s) - 1)
+
+#define d_last_char(dpi) \
+ ((dpi)->buf == NULL || (dpi)->len == 0 ? '\0' : (dpi)->buf[(dpi)->len - 1])
+
#ifdef CP_DEMANGLE_DEBUG
-static void substitutions_print
- PARAMS ((demangling_t, FILE *));
+static void d_dump PARAMS ((struct d_comp *, int));
#endif
-static template_arg_list_t template_arg_list_new
- PARAMS ((void));
-static void template_arg_list_delete
- PARAMS ((template_arg_list_t));
-static void template_arg_list_add_arg
- PARAMS ((template_arg_list_t, string_list_t));
-static string_list_t template_arg_list_get_arg
- PARAMS ((template_arg_list_t, int));
-static void push_template_arg_list
- PARAMS ((demangling_t, template_arg_list_t));
-static void pop_to_template_arg_list
- PARAMS ((demangling_t, template_arg_list_t));
+static struct d_comp *d_make_empty PARAMS ((struct d_info *,
+ enum d_comp_type));
+static struct d_comp *d_make_comp PARAMS ((struct d_info *, enum d_comp_type,
+ struct d_comp *, struct d_comp *));
+static struct d_comp *d_make_name PARAMS ((struct d_info *, const char *,
+ int));
+static struct d_comp *d_make_builtin_type PARAMS ((struct d_info *,
+ const struct d_builtin_type_info *));
+static struct d_comp *d_make_operator PARAMS ((struct d_info *,
+ const struct d_operator_info *));
+static struct d_comp *d_make_extended_operator PARAMS ((struct d_info *,
+ int,
+ struct d_comp *));
+static struct d_comp *d_make_ctor PARAMS ((struct d_info *,
+ enum gnu_v3_ctor_kinds,
+ struct d_comp *));
+static struct d_comp *d_make_dtor PARAMS ((struct d_info *,
+ enum gnu_v3_dtor_kinds,
+ struct d_comp *));
+static struct d_comp *d_make_template_param PARAMS ((struct d_info *, long));
+static struct d_comp *d_make_sub PARAMS ((struct d_info *, const char *, int));
+static struct d_comp *d_mangled_name PARAMS ((struct d_info *, int));
+static int has_return_type PARAMS ((struct d_comp *));
+static int is_ctor_dtor_or_conversion PARAMS ((struct d_comp *));
+static struct d_comp *d_encoding PARAMS ((struct d_info *, int));
+static struct d_comp *d_name PARAMS ((struct d_info *));
+static struct d_comp *d_nested_name PARAMS ((struct d_info *));
+static struct d_comp *d_prefix PARAMS ((struct d_info *));
+static struct d_comp *d_unqualified_name PARAMS ((struct d_info *));
+static struct d_comp *d_source_name PARAMS ((struct d_info *));
+static long d_number PARAMS ((struct d_info *));
+static struct d_comp *d_identifier PARAMS ((struct d_info *, int));
+static struct d_comp *d_operator_name PARAMS ((struct d_info *));
+static struct d_comp *d_special_name PARAMS ((struct d_info *));
+static int d_call_offset PARAMS ((struct d_info *, int));
+static struct d_comp *d_ctor_dtor_name PARAMS ((struct d_info *));
+static struct d_comp *d_type PARAMS ((struct d_info *));
+static struct d_comp **d_cv_qualifiers PARAMS ((struct d_info *,
+ struct d_comp **, int));
+static struct d_comp *d_function_type PARAMS ((struct d_info *));
+static struct d_comp *d_bare_function_type PARAMS ((struct d_info *, int));
+static struct d_comp *d_class_enum_type PARAMS ((struct d_info *));
+static struct d_comp *d_array_type PARAMS ((struct d_info *));
+static struct d_comp *d_pointer_to_member_type PARAMS ((struct d_info *));
+static struct d_comp *d_template_param PARAMS ((struct d_info *));
+static struct d_comp *d_template_args PARAMS ((struct d_info *));
+static struct d_comp *d_template_arg PARAMS ((struct d_info *));
+static struct d_comp *d_expression PARAMS ((struct d_info *));
+static struct d_comp *d_expr_primary PARAMS ((struct d_info *));
+static struct d_comp *d_local_name PARAMS ((struct d_info *));
+static int d_discriminator PARAMS ((struct d_info *));
+static int d_add_substitution PARAMS ((struct d_info *, struct d_comp *));
+static struct d_comp *d_substitution PARAMS ((struct d_info *, int));
+static void d_print_resize PARAMS ((struct d_print_info *, size_t));
+static void d_print_append_char PARAMS ((struct d_print_info *, int));
+static void d_print_append_buffer PARAMS ((struct d_print_info *, const char *,
+ size_t));
+static void d_print_error PARAMS ((struct d_print_info *));
+static char *d_print PARAMS ((int, const struct d_comp *, int, size_t *));
+static void d_print_comp PARAMS ((struct d_print_info *,
+ const struct d_comp *));
+static void d_print_java_identifier PARAMS ((struct d_print_info *,
+ const char *, int));
+static void d_print_mod_list PARAMS ((struct d_print_info *,
+ struct d_print_mod *, int));
+static void d_print_mod PARAMS ((struct d_print_info *,
+ const struct d_comp *));
+static void d_print_function_type PARAMS ((struct d_print_info *,
+ const struct d_comp *,
+ struct d_print_mod *));
+static void d_print_array_type PARAMS ((struct d_print_info *,
+ const struct d_comp *,
+ struct d_print_mod *));
+static void d_print_expr_op PARAMS ((struct d_print_info *,
+ const struct d_comp *));
+static void d_print_cast PARAMS ((struct d_print_info *,
+ const struct d_comp *));
+static void d_init_info PARAMS ((const char *, int, size_t, struct d_info *));
+static char *d_demangle PARAMS ((const char *, int, size_t *));
+
#ifdef CP_DEMANGLE_DEBUG
-static void template_arg_list_print
- PARAMS ((template_arg_list_t, FILE *));
-#endif
-static template_arg_list_t current_template_arg_list
- PARAMS ((demangling_t));
-static demangling_t demangling_new
- PARAMS ((const char *, int));
-static void demangling_delete
- PARAMS ((demangling_t));
-
-/* The last character of DS. Warning: DS is evaluated twice. */
-#define dyn_string_last_char(DS) \
- (dyn_string_buf (DS)[dyn_string_length (DS) - 1])
-
-/* Append a space character (` ') to DS if it does not already end
- with one. Evaluates to 1 on success, or 0 on allocation failure. */
-#define dyn_string_append_space(DS) \
- ((dyn_string_length (DS) > 0 \
- && dyn_string_last_char (DS) != ' ') \
- ? dyn_string_append_char ((DS), ' ') \
- : 1)
-
-/* Returns the index of the current position in the mangled name. */
-#define current_position(DM) ((DM)->next - (DM)->name)
-
-/* Returns the character at the current position of the mangled name. */
-#define peek_char(DM) (*((DM)->next))
-
-/* Returns the character one past the current position of the mangled
- name. */
-#define peek_char_next(DM) \
- (peek_char (DM) == '\0' ? '\0' : (*((DM)->next + 1)))
-
-/* Returns the character at the current position, and advances the
- current position to the next character. */
-#define next_char(DM) (*((DM)->next)++)
-
-/* Returns non-zero if the current position is the end of the mangled
- name, i.e. one past the last character. */
-#define end_of_name_p(DM) (peek_char (DM) == '\0')
-
-/* Advances the current position by one character. */
-#define advance_char(DM) (++(DM)->next)
-
-/* Returns the string containing the current demangled result. */
-#define result_string(DM) (&(DM)->result->string)
-
-/* Returns the position at which new text is inserted into the
- demangled result. */
-#define result_caret_pos(DM) \
- (result_length (DM) + \
- ((string_list_t) result_string (DM))->caret_position)
-
-/* Adds a dyn_string_t to the demangled result. */
-#define result_add_string(DM, STRING) \
- (dyn_string_insert (&(DM)->result->string, \
- result_caret_pos (DM), (STRING)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* Adds NUL-terminated string CSTR to the demangled result. */
-#define result_add(DM, CSTR) \
- (dyn_string_insert_cstr (&(DM)->result->string, \
- result_caret_pos (DM), (CSTR)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* Adds character CHAR to the demangled result. */
-#define result_add_char(DM, CHAR) \
- (dyn_string_insert_char (&(DM)->result->string, \
- result_caret_pos (DM), (CHAR)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* Inserts a dyn_string_t to the demangled result at position POS. */
-#define result_insert_string(DM, POS, STRING) \
- (dyn_string_insert (&(DM)->result->string, (POS), (STRING)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* Inserts NUL-terminated string CSTR to the demangled result at
- position POS. */
-#define result_insert(DM, POS, CSTR) \
- (dyn_string_insert_cstr (&(DM)->result->string, (POS), (CSTR)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* Inserts character CHAR to the demangled result at position POS. */
-#define result_insert_char(DM, POS, CHAR) \
- (dyn_string_insert_char (&(DM)->result->string, (POS), (CHAR)) \
- ? STATUS_OK : STATUS_ALLOCATION_FAILED)
-
-/* The length of the current demangled result. */
-#define result_length(DM) \
- dyn_string_length (&(DM)->result->string)
-
-/* Appends a (less-than, greater-than) character to the result in DM
- to (open, close) a template argument or parameter list. Appends a
- space first if necessary to prevent spurious elision of angle
- brackets with the previous character. */
-#define result_open_template_list(DM) result_add_separated_char(DM, '<')
-#define result_close_template_list(DM) result_add_separated_char(DM, '>')
-
-/* Appends a base 10 representation of VALUE to DS. STATUS_OK on
- success. On failure, deletes DS and returns an error code. */
-
-static status_t
-int_to_dyn_string (value, ds)
- int value;
- dyn_string_t ds;
+
+static void
+d_dump (dc, indent)
+ struct d_comp *dc;
+ int indent;
{
int i;
- int mask = 1;
- /* Handle zero up front. */
- if (value == 0)
+ if (dc == NULL)
+ return;
+
+ for (i = 0; i < indent; ++i)
+ putchar (' ');
+
+ switch (dc->type)
{
- if (!dyn_string_append_char (ds, '0'))
- return STATUS_ALLOCATION_FAILED;
- return STATUS_OK;
+ case D_COMP_NAME:
+ printf ("name '%.*s'\n", dc->u.s_name.len, dc->u.s_name.s);
+ return;
+ case D_COMP_TEMPLATE_PARAM:
+ printf ("template parameter %ld\n", dc->u.s_number.number);
+ return;
+ case D_COMP_CTOR:
+ printf ("constructor %d\n", (int) dc->u.s_ctor.kind);
+ d_dump (dc->u.s_ctor.name, indent + 2);
+ return;
+ case D_COMP_DTOR:
+ printf ("destructor %d\n", (int) dc->u.s_dtor.kind);
+ d_dump (dc->u.s_dtor.name, indent + 2);
+ return;
+ case D_COMP_SUB_STD:
+ printf ("standard substitution %s\n", dc->u.s_string.string);
+ return;
+ case D_COMP_BUILTIN_TYPE:
+ printf ("builtin type %s\n", dc->u.s_builtin.type->name);
+ return;
+ case D_COMP_OPERATOR:
+ printf ("operator %s\n", dc->u.s_operator.op->name);
+ return;
+ case D_COMP_EXTENDED_OPERATOR:
+ printf ("extended operator with %d args\n",
+ dc->u.s_extended_operator.args);
+ d_dump (dc->u.s_extended_operator.name, indent + 2);
+ return;
+
+ case D_COMP_QUAL_NAME:
+ printf ("qualified name\n");
+ break;
+ case D_COMP_LOCAL_NAME:
+ printf ("local name\n");
+ break;
+ case D_COMP_TYPED_NAME:
+ printf ("typed name\n");
+ break;
+ case D_COMP_TEMPLATE:
+ printf ("template\n");
+ break;
+ case D_COMP_VTABLE:
+ printf ("vtable\n");
+ break;
+ case D_COMP_VTT:
+ printf ("VTT\n");
+ break;
+ case D_COMP_CONSTRUCTION_VTABLE:
+ printf ("construction vtable\n");
+ break;
+ case D_COMP_TYPEINFO:
+ printf ("typeinfo\n");
+ break;
+ case D_COMP_TYPEINFO_NAME:
+ printf ("typeinfo name\n");
+ break;
+ case D_COMP_TYPEINFO_FN:
+ printf ("typeinfo function\n");
+ break;
+ case D_COMP_THUNK:
+ printf ("thunk\n");
+ break;
+ case D_COMP_VIRTUAL_THUNK:
+ printf ("virtual thunk\n");
+ break;
+ case D_COMP_COVARIANT_THUNK:
+ printf ("covariant thunk\n");
+ break;
+ case D_COMP_JAVA_CLASS:
+ printf ("java class\n");
+ break;
+ case D_COMP_GUARD:
+ printf ("guard\n");
+ break;
+ case D_COMP_REFTEMP:
+ printf ("reference temporary\n");
+ break;
+ case D_COMP_RESTRICT:
+ printf ("restrict\n");
+ break;
+ case D_COMP_VOLATILE:
+ printf ("volatile\n");
+ break;
+ case D_COMP_CONST:
+ printf ("const\n");
+ break;
+ case D_COMP_RESTRICT_THIS:
+ printf ("restrict this\n");
+ break;
+ case D_COMP_VOLATILE_THIS:
+ printf ("volatile this\n");
+ break;
+ case D_COMP_CONST_THIS:
+ printf ("const this\n");
+ break;
+ case D_COMP_VENDOR_TYPE_QUAL:
+ printf ("vendor type qualifier\n");
+ break;
+ case D_COMP_POINTER:
+ printf ("pointer\n");
+ break;
+ case D_COMP_REFERENCE:
+ printf ("reference\n");
+ break;
+ case D_COMP_COMPLEX:
+ printf ("complex\n");
+ break;
+ case D_COMP_IMAGINARY:
+ printf ("imaginary\n");
+ break;
+ case D_COMP_VENDOR_TYPE:
+ printf ("vendor type\n");
+ break;
+ case D_COMP_FUNCTION_TYPE:
+ printf ("function type\n");
+ break;
+ case D_COMP_ARRAY_TYPE:
+ printf ("array type\n");
+ break;
+ case D_COMP_PTRMEM_TYPE:
+ printf ("pointer to member type\n");
+ break;
+ case D_COMP_ARGLIST:
+ printf ("argument list\n");
+ break;
+ case D_COMP_TEMPLATE_ARGLIST:
+ printf ("template argument list\n");
+ break;
+ case D_COMP_CAST:
+ printf ("cast\n");
+ break;
+ case D_COMP_UNARY:
+ printf ("unary operator\n");
+ break;
+ case D_COMP_BINARY:
+ printf ("binary operator\n");
+ break;
+ case D_COMP_BINARY_ARGS:
+ printf ("binary operator arguments\n");
+ break;
+ case D_COMP_TRINARY:
+ printf ("trinary operator\n");
+ break;
+ case D_COMP_TRINARY_ARG1:
+ printf ("trinary operator arguments 1\n");
+ break;
+ case D_COMP_TRINARY_ARG2:
+ printf ("trinary operator arguments 1\n");
+ break;
+ case D_COMP_LITERAL:
+ printf ("literal\n");
+ break;
+ case D_COMP_LITERAL_NEG:
+ printf ("negative literal\n");
+ break;
}
- /* For negative numbers, emit a minus sign. */
- if (value < 0)
+ d_dump (d_left (dc), indent + 2);
+ d_dump (d_right (dc), indent + 2);
+}
+
+#endif /* CP_DEMANGLE_DEBUG */
+
+/* Add a new component. */
+
+static struct d_comp *
+d_make_empty (di, type)
+ struct d_info *di;
+ enum d_comp_type type;
+{
+ struct d_comp *p;
+
+ if (di->next_comp >= di->num_comps)
+ return NULL;
+ p = &di->comps[di->next_comp];
+ p->type = type;
+ ++di->next_comp;
+ return p;
+}
+
+/* Add a new generic component. */
+
+static struct d_comp *
+d_make_comp (di, type, left, right)
+ struct d_info *di;
+ enum d_comp_type type;
+ struct d_comp *left;
+ struct d_comp *right;
+{
+ struct d_comp *p;
+
+ /* We check for errors here. A typical error would be a NULL return
+ from a subroutine. We catch those here, and return NULL
+ upward. */
+ switch (type)
{
- if (!dyn_string_append_char (ds, '-'))
- return STATUS_ALLOCATION_FAILED;
- value = -value;
+ /* These types require two parameters. */
+ case D_COMP_QUAL_NAME:
+ case D_COMP_LOCAL_NAME:
+ case D_COMP_TYPED_NAME:
+ case D_COMP_TEMPLATE:
+ case D_COMP_VENDOR_TYPE_QUAL:
+ case D_COMP_PTRMEM_TYPE:
+ case D_COMP_UNARY:
+ case D_COMP_BINARY:
+ case D_COMP_BINARY_ARGS:
+ case D_COMP_TRINARY:
+ case D_COMP_TRINARY_ARG1:
+ case D_COMP_TRINARY_ARG2:
+ case D_COMP_LITERAL:
+ case D_COMP_LITERAL_NEG:
+ if (left == NULL || right == NULL)
+ return NULL;
+ break;
+
+ /* These types only require one parameter. */
+ case D_COMP_VTABLE:
+ case D_COMP_VTT:
+ case D_COMP_CONSTRUCTION_VTABLE:
+ case D_COMP_TYPEINFO:
+ case D_COMP_TYPEINFO_NAME:
+ case D_COMP_TYPEINFO_FN:
+ case D_COMP_THUNK:
+ case D_COMP_VIRTUAL_THUNK:
+ case D_COMP_COVARIANT_THUNK:
+ case D_COMP_JAVA_CLASS:
+ case D_COMP_GUARD:
+ case D_COMP_REFTEMP:
+ case D_COMP_POINTER:
+ case D_COMP_REFERENCE:
+ case D_COMP_COMPLEX:
+ case D_COMP_IMAGINARY:
+ case D_COMP_VENDOR_TYPE:
+ case D_COMP_ARGLIST:
+ case D_COMP_TEMPLATE_ARGLIST:
+ case D_COMP_CAST:
+ if (left == NULL)
+ return NULL;
+ break;
+
+ /* This needs a right parameter, but the left parameter can be
+ empty. */
+ case D_COMP_ARRAY_TYPE:
+ if (right == NULL)
+ return NULL;
+ break;
+
+ /* These are allowed to have no parameters--in some cases they
+ will be filled in later. */
+ case D_COMP_FUNCTION_TYPE:
+ case D_COMP_RESTRICT:
+ case D_COMP_VOLATILE:
+ case D_COMP_CONST:
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ break;
+
+ /* Other types should not be seen here. */
+ default:
+ return NULL;
}
-
- /* Find the power of 10 of the first digit. */
- i = value;
- while (i > 9)
+
+ p = d_make_empty (di, type);
+ if (p != NULL)
{
- mask *= 10;
- i /= 10;
+ p->u.s_binary.left = left;
+ p->u.s_binary.right = right;
}
+ return p;
+}
- /* Write the digits. */
- while (mask > 0)
- {
- int digit = value / mask;
+/* Add a new name component. */
- if (!dyn_string_append_char (ds, '0' + digit))
- return STATUS_ALLOCATION_FAILED;
+static struct d_comp *
+d_make_name (di, s, len)
+ struct d_info *di;
+ const char *s;
+ int len;
+{
+ struct d_comp *p;
- value -= digit * mask;
- mask /= 10;
+ if (s == NULL || len == 0)
+ return NULL;
+ p = d_make_empty (di, D_COMP_NAME);
+ if (p != NULL)
+ {
+ p->u.s_name.s = s;
+ p->u.s_name.len = len;
}
-
- return STATUS_OK;
+ return p;
}
-/* Creates a new string list node. The contents of the string are
- empty, but the initial buffer allocation is LENGTH. The string
- list node should be deleted with string_list_delete. Returns NULL
- if allocation fails. */
+/* Add a new builtin type component. */
-static string_list_t
-string_list_new (length)
- int length;
+static struct d_comp *
+d_make_builtin_type (di, type)
+ struct d_info *di;
+ const struct d_builtin_type_info *type;
{
- string_list_t s = (string_list_t) malloc (sizeof (struct string_list_def));
- s->caret_position = 0;
- if (s == NULL)
- return NULL;
- if (!dyn_string_init ((dyn_string_t) s, length))
+ struct d_comp *p;
+
+ if (type == NULL)
return NULL;
- return s;
-}
+ p = d_make_empty (di, D_COMP_BUILTIN_TYPE);
+ if (p != NULL)
+ p->u.s_builtin.type = type;
+ return p;
+}
-/* Deletes the entire string list starting at NODE. */
+/* Add a new operator component. */
-static void
-string_list_delete (node)
- string_list_t node;
+static struct d_comp *
+d_make_operator (di, op)
+ struct d_info *di;
+ const struct d_operator_info *op;
{
- while (node != NULL)
- {
- string_list_t next = node->next;
- dyn_string_delete ((dyn_string_t) node);
- node = next;
- }
+ struct d_comp *p;
+
+ p = d_make_empty (di, D_COMP_OPERATOR);
+ if (p != NULL)
+ p->u.s_operator.op = op;
+ return p;
}
-/* Appends CHARACTER to the demangled result. If the current trailing
- character of the result is CHARACTER, a space is inserted first. */
+/* Add a new extended operator component. */
-static status_t
-result_add_separated_char (dm, character)
- demangling_t dm;
- int character;
+static struct d_comp *
+d_make_extended_operator (di, args, name)
+ struct d_info *di;
+ int args;
+ struct d_comp *name;
{
- char *result = dyn_string_buf (result_string (dm));
- int caret_pos = result_caret_pos (dm);
+ struct d_comp *p;
- /* Add a space if the last character is already the character we
- want to add. */
- if (caret_pos > 0 && result[caret_pos - 1] == character)
- RETURN_IF_ERROR (result_add_char (dm, ' '));
- /* Add the character. */
- RETURN_IF_ERROR (result_add_char (dm, character));
-
- return STATUS_OK;
+ if (name == NULL)
+ return NULL;
+ p = d_make_empty (di, D_COMP_EXTENDED_OPERATOR);
+ if (p != NULL)
+ {
+ p->u.s_extended_operator.args = args;
+ p->u.s_extended_operator.name = name;
+ }
+ return p;
}
-/* Allocates and pushes a new string onto the demangled results stack
- for DM. Subsequent demangling with DM will emit to the new string.
- Returns STATUS_OK on success, STATUS_ALLOCATION_FAILED on
- allocation failure. */
+/* Add a new constructor component. */
-static status_t
-result_push (dm)
- demangling_t dm;
+static struct d_comp *
+d_make_ctor (di, kind, name)
+ struct d_info *di;
+ enum gnu_v3_ctor_kinds kind;
+ struct d_comp *name;
{
- string_list_t new_string = string_list_new (0);
- if (new_string == NULL)
- /* Allocation failed. */
- return STATUS_ALLOCATION_FAILED;
-
- /* Link the new string to the front of the list of result strings. */
- new_string->next = (string_list_t) dm->result;
- dm->result = new_string;
- return STATUS_OK;
+ struct d_comp *p;
+
+ if (name == NULL)
+ return NULL;
+ p = d_make_empty (di, D_COMP_CTOR);
+ if (p != NULL)
+ {
+ p->u.s_ctor.kind = kind;
+ p->u.s_ctor.name = name;
+ }
+ return p;
}
-/* Removes and returns the topmost element on the demangled results
- stack for DM. The caller assumes ownership for the returned
- string. */
+/* Add a new destructor component. */
-static string_list_t
-result_pop (dm)
- demangling_t dm;
+static struct d_comp *
+d_make_dtor (di, kind, name)
+ struct d_info *di;
+ enum gnu_v3_dtor_kinds kind;
+ struct d_comp *name;
{
- string_list_t top = dm->result;
- dm->result = top->next;
- return top;
+ struct d_comp *p;
+
+ if (name == NULL)
+ return NULL;
+ p = d_make_empty (di, D_COMP_DTOR);
+ if (p != NULL)
+ {
+ p->u.s_dtor.kind = kind;
+ p->u.s_dtor.name = name;
+ }
+ return p;
}
-/* Returns the current value of the caret for the result string. The
- value is an offet from the end of the result string. */
+/* Add a new template parameter. */
-static int
-result_get_caret (dm)
- demangling_t dm;
+static struct d_comp *
+d_make_template_param (di, i)
+ struct d_info *di;
+ long i;
{
- return ((string_list_t) result_string (dm))->caret_position;
+ struct d_comp *p;
+
+ p = d_make_empty (di, D_COMP_TEMPLATE_PARAM);
+ if (p != NULL)
+ p->u.s_number.number = i;
+ return p;
}
-/* Sets the value of the caret for the result string, counted as an
- offet from the end of the result string. */
+/* Add a new standard substitution component. */
-static void
-result_set_caret (dm, position)
- demangling_t dm;
- int position;
+static struct d_comp *
+d_make_sub (di, name, len)
+ struct d_info *di;
+ const char *name;
+ int len;
{
- ((string_list_t) result_string (dm))->caret_position = position;
+ struct d_comp *p;
+
+ p = d_make_empty (di, D_COMP_SUB_STD);
+ if (p != NULL)
+ {
+ p->u.s_string.string = name;
+ p->u.s_string.len = len;
+ }
+ return p;
}
-/* Shifts the position of the next addition to the result by
- POSITION_OFFSET. A negative value shifts the caret to the left. */
+/* <mangled-name> ::= _Z <encoding>
-static void
-result_shift_caret (dm, position_offset)
- demangling_t dm;
- int position_offset;
+ TOP_LEVEL is non-zero when called at the top level. */
+
+static struct d_comp *
+d_mangled_name (di, top_level)
+ struct d_info *di;
+ int top_level;
{
- ((string_list_t) result_string (dm))->caret_position += position_offset;
+ if (d_next_char (di) != '_')
+ return NULL;
+ if (d_next_char (di) != 'Z')
+ return NULL;
+ return d_encoding (di, top_level);
}
-/* Returns non-zero if the character that comes right before the place
- where text will be added to the result is a space. In this case,
- the caller should supress adding another space. */
+/* Return whether a function should have a return type. The argument
+ is the function name, which may be qualified in various ways. The
+ rules are that template functions have return types with some
+ exceptions, function types which are not part of a function name
+ mangling have return types with some exceptions, and non-template
+ function names do not have return types. The exceptions are that
+ constructors, destructors, and conversion operators do not have
+ return types. */
static int
-result_previous_char_is_space (dm)
- demangling_t dm;
+has_return_type (dc)
+ struct d_comp *dc;
{
- char *result = dyn_string_buf (result_string (dm));
- int pos = result_caret_pos (dm);
- return pos > 0 && result[pos - 1] == ' ';
+ if (dc == NULL)
+ return 0;
+ switch (dc->type)
+ {
+ default:
+ return 0;
+ case D_COMP_TEMPLATE:
+ return ! is_ctor_dtor_or_conversion (d_left (dc));
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ return has_return_type (d_left (dc));
+ }
}
-/* Returns the start position of a fragment of the demangled result
- that will be a substitution candidate. Should be called at the
- start of productions that can add substitutions. */
+/* Return whether a name is a constructor, a destructor, or a
+ conversion operator. */
static int
-substitution_start (dm)
- demangling_t dm;
+is_ctor_dtor_or_conversion (dc)
+ struct d_comp *dc;
{
- return result_caret_pos (dm);
+ if (dc == NULL)
+ return 0;
+ switch (dc->type)
+ {
+ default:
+ return 0;
+ case D_COMP_QUAL_NAME:
+ case D_COMP_LOCAL_NAME:
+ return is_ctor_dtor_or_conversion (d_right (dc));
+ case D_COMP_CTOR:
+ case D_COMP_DTOR:
+ case D_COMP_CAST:
+ return 1;
+ }
}
-/* Adds the suffix of the current demangled result of DM starting at
- START_POSITION as a potential substitution. If TEMPLATE_P is
- non-zero, this potential substitution is a template-id. */
+/* <encoding> ::= <(function) name> <bare-function-type>
+ ::= <(data) name>
+ ::= <special-name>
-static status_t
-substitution_add (dm, start_position, template_p)
- demangling_t dm;
- int start_position;
- int template_p;
-{
- dyn_string_t result = result_string (dm);
- dyn_string_t substitution = dyn_string_new (0);
- int i;
+ TOP_LEVEL is non-zero when called at the top level, in which case
+ if DMGL_PARAMS is not set we do not demangle the function
+ parameters. We only set this at the top level, because otherwise
+ we would not correctly demangle names in local scopes. */
- if (substitution == NULL)
- return STATUS_ALLOCATION_FAILED;
+static struct d_comp *
+d_encoding (di, top_level)
+ struct d_info *di;
+ int top_level;
+{
+ char peek = d_peek_char (di);
- /* Extract the substring of the current demangling result that
- represents the subsitution candidate. */
- if (!dyn_string_substring (substitution,
- result, start_position, result_caret_pos (dm)))
+ if (peek == 'G' || peek == 'T')
+ return d_special_name (di);
+ else
{
- dyn_string_delete (substitution);
- return STATUS_ALLOCATION_FAILED;
- }
+ struct d_comp *dc;
- /* If there's no room for the new entry, grow the array. */
- if (dm->substitutions_allocated == dm->num_substitutions)
- {
- size_t new_array_size;
- if (dm->substitutions_allocated > 0)
- dm->substitutions_allocated *= 2;
- else
- dm->substitutions_allocated = 2;
- new_array_size =
- sizeof (struct substitution_def) * dm->substitutions_allocated;
-
- dm->substitutions = (struct substitution_def *)
- realloc (dm->substitutions, new_array_size);
- if (dm->substitutions == NULL)
- /* Realloc failed. */
+ dc = d_name (di);
+
+ if (dc != NULL && top_level && (di->options & DMGL_PARAMS) == 0)
{
- dyn_string_delete (substitution);
- return STATUS_ALLOCATION_FAILED;
+ /* Strip off any initial CV-qualifiers, as they really apply
+ to the `this' parameter, and they were not output by the
+ v2 demangler without DMGL_PARAMS. */
+ while (dc->type == D_COMP_RESTRICT_THIS
+ || dc->type == D_COMP_VOLATILE_THIS
+ || dc->type == D_COMP_CONST_THIS)
+ dc = d_left (dc);
+ return dc;
}
+
+ peek = d_peek_char (di);
+ if (peek == '\0' || peek == 'E')
+ return dc;
+ return d_make_comp (di, D_COMP_TYPED_NAME, dc,
+ d_bare_function_type (di, has_return_type (dc)));
}
+}
- /* Add the substitution to the array. */
- i = dm->num_substitutions++;
- dm->substitutions[i].text = substitution;
- dm->substitutions[i].template_p = template_p;
+/* <name> ::= <nested-name>
+ ::= <unscoped-name>
+ ::= <unscoped-template-name> <template-args>
+ ::= <local-name>
-#ifdef CP_DEMANGLE_DEBUG
- substitutions_print (dm, stderr);
-#endif
+ <unscoped-name> ::= <unqualified-name>
+ ::= St <unqualified-name>
- return STATUS_OK;
-}
+ <unscoped-template-name> ::= <unscoped-name>
+ ::= <substitution>
+*/
-/* Returns the Nth-most-recent substitution. Sets *TEMPLATE_P to
- non-zero if the substitution is a template-id, zero otherwise.
- N is numbered from zero. DM retains ownership of the returned
- string. If N is negative, or equal to or greater than the current
- number of substitution candidates, returns NULL. */
-
-static dyn_string_t
-substitution_get (dm, n, template_p)
- demangling_t dm;
- int n;
- int *template_p;
+static struct d_comp *
+d_name (di)
+ struct d_info *di;
{
- struct substitution_def *sub;
+ char peek = d_peek_char (di);
+ struct d_comp *dc;
- /* Make sure N is in the valid range. */
- if (n < 0 || n >= dm->num_substitutions)
- return NULL;
+ switch (peek)
+ {
+ case 'N':
+ return d_nested_name (di);
- sub = &(dm->substitutions[n]);
- *template_p = sub->template_p;
- return sub->text;
-}
+ case 'Z':
+ return d_local_name (di);
-#ifdef CP_DEMANGLE_DEBUG
-/* Debugging routine to print the current substitutions to FP. */
+ case 'S':
+ {
+ int subst;
-static void
-substitutions_print (dm, fp)
- demangling_t dm;
- FILE *fp;
-{
- int seq_id;
- int num = dm->num_substitutions;
+ if (d_peek_next_char (di) != 't')
+ {
+ dc = d_substitution (di, 0);
+ subst = 1;
+ }
+ else
+ {
+ d_advance (di, 2);
+ dc = d_make_comp (di, D_COMP_QUAL_NAME, d_make_name (di, "std", 3),
+ d_unqualified_name (di));
+ di->expansion += 3;
+ subst = 0;
+ }
- fprintf (fp, "SUBSTITUTIONS:\n");
- for (seq_id = -1; seq_id < num - 1; ++seq_id)
- {
- int template_p;
- dyn_string_t text = substitution_get (dm, seq_id + 1, &template_p);
+ if (d_peek_char (di) != 'I')
+ {
+ /* The grammar does not permit this case to occur if we
+ called d_substitution() above (i.e., subst == 1). We
+ don't bother to check. */
+ }
+ else
+ {
+ /* This is <template-args>, which means that we just saw
+ <unscoped-template-name>, which is a substitution
+ candidate if we didn't just get it from a
+ substitution. */
+ if (! subst)
+ {
+ if (! d_add_substitution (di, dc))
+ return NULL;
+ }
+ dc = d_make_comp (di, D_COMP_TEMPLATE, dc, d_template_args (di));
+ }
- if (seq_id == -1)
- fprintf (fp, " S_ ");
- else
- fprintf (fp, " S%d_", seq_id);
- fprintf (fp, " %c: %s\n", template_p ? '*' : ' ', dyn_string_buf (text));
+ return dc;
+ }
+
+ default:
+ dc = d_unqualified_name (di);
+ if (d_peek_char (di) == 'I')
+ {
+ /* This is <template-args>, which means that we just saw
+ <unscoped-template-name>, which is a substitution
+ candidate. */
+ if (! d_add_substitution (di, dc))
+ return NULL;
+ dc = d_make_comp (di, D_COMP_TEMPLATE, dc, d_template_args (di));
+ }
+ return dc;
}
}
-#endif /* CP_DEMANGLE_DEBUG */
-
-/* Creates a new template argument list. Returns NULL if allocation
- fails. */
+/* <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqualified-name> E
+ ::= N [<CV-qualifiers>] <template-prefix> <template-args> E
+*/
-static template_arg_list_t
-template_arg_list_new ()
+static struct d_comp *
+d_nested_name (di)
+ struct d_info *di;
{
- template_arg_list_t new_list =
- (template_arg_list_t) malloc (sizeof (struct template_arg_list_def));
- if (new_list == NULL)
+ struct d_comp *ret;
+ struct d_comp **pret;
+
+ if (d_next_char (di) != 'N')
return NULL;
- /* Initialize the new list to have no arguments. */
- new_list->first_argument = NULL;
- new_list->last_argument = NULL;
- /* Return the new list. */
- return new_list;
-}
-/* Deletes a template argument list and the template arguments it
- contains. */
+ pret = d_cv_qualifiers (di, &ret, 1);
+ if (pret == NULL)
+ return NULL;
-static void
-template_arg_list_delete (list)
- template_arg_list_t list;
-{
- /* If there are any arguments on LIST, delete them. */
- if (list->first_argument != NULL)
- string_list_delete (list->first_argument);
- /* Delete LIST. */
- free (list);
-}
+ *pret = d_prefix (di);
+ if (*pret == NULL)
+ return NULL;
-/* Adds ARG to the template argument list ARG_LIST. */
+ if (d_next_char (di) != 'E')
+ return NULL;
-static void
-template_arg_list_add_arg (arg_list, arg)
- template_arg_list_t arg_list;
- string_list_t arg;
-{
- if (arg_list->first_argument == NULL)
- /* If there were no arguments before, ARG is the first one. */
- arg_list->first_argument = arg;
- else
- /* Make ARG the last argument on the list. */
- arg_list->last_argument->next = arg;
- /* Make ARG the last on the list. */
- arg_list->last_argument = arg;
- arg->next = NULL;
+ return ret;
}
-/* Returns the template arugment at position INDEX in template
- argument list ARG_LIST. */
+/* <prefix> ::= <prefix> <unqualified-name>
+ ::= <template-prefix> <template-args>
+ ::= <template-param>
+ ::=
+ ::= <substitution>
-static string_list_t
-template_arg_list_get_arg (arg_list, index)
- template_arg_list_t arg_list;
- int index;
+ <template-prefix> ::= <prefix> <(template) unqualified-name>
+ ::= <template-param>
+ ::= <substitution>
+*/
+
+static struct d_comp *
+d_prefix (di)
+ struct d_info *di;
{
- string_list_t arg = arg_list->first_argument;
- /* Scan down the list of arguments to find the one at position
- INDEX. */
- while (index--)
+ struct d_comp *ret = NULL;
+
+ while (1)
{
- arg = arg->next;
- if (arg == NULL)
- /* Ran out of arguments before INDEX hit zero. That's an
- error. */
+ char peek;
+ enum d_comp_type comb_type;
+ struct d_comp *dc;
+
+ peek = d_peek_char (di);
+ if (peek == '\0')
return NULL;
- }
- /* Return the argument at position INDEX. */
- return arg;
-}
-/* Pushes ARG_LIST onto the top of the template argument list stack. */
+ /* The older code accepts a <local-name> here, but I don't see
+ that in the grammar. The older code does not accept a
+ <template-param> here. */
+
+ comb_type = D_COMP_QUAL_NAME;
+ if (IS_DIGIT (peek)
+ || IS_LOWER (peek)
+ || peek == 'C'
+ || peek == 'D')
+ dc = d_unqualified_name (di);
+ else if (peek == 'S')
+ dc = d_substitution (di, 1);
+ else if (peek == 'I')
+ {
+ if (ret == NULL)
+ return NULL;
+ comb_type = D_COMP_TEMPLATE;
+ dc = d_template_args (di);
+ }
+ else if (peek == 'T')
+ dc = d_template_param (di);
+ else if (peek == 'E')
+ return ret;
+ else
+ return NULL;
-static void
-push_template_arg_list (dm, arg_list)
- demangling_t dm;
- template_arg_list_t arg_list;
-{
- arg_list->next = dm->template_arg_lists;
- dm->template_arg_lists = arg_list;
-#ifdef CP_DEMANGLE_DEBUG
- fprintf (stderr, " ** pushing template arg list\n");
- template_arg_list_print (arg_list, stderr);
-#endif
+ if (ret == NULL)
+ ret = dc;
+ else
+ ret = d_make_comp (di, comb_type, ret, dc);
+
+ if (peek != 'S' && d_peek_char (di) != 'E')
+ {
+ if (! d_add_substitution (di, ret))
+ return NULL;
+ }
+ }
}
-/* Pops and deletes elements on the template argument list stack until
- arg_list is the topmost element. If arg_list is NULL, all elements
- are popped and deleted. */
+/* <unqualified-name> ::= <operator-name>
+ ::= <ctor-dtor-name>
+ ::= <source-name>
+*/
-static void
-pop_to_template_arg_list (dm, arg_list)
- demangling_t dm;
- template_arg_list_t arg_list;
+static struct d_comp *
+d_unqualified_name (di)
+ struct d_info *di;
{
- while (dm->template_arg_lists != arg_list)
+ char peek;
+
+ peek = d_peek_char (di);
+ if (IS_DIGIT (peek))
+ return d_source_name (di);
+ else if (IS_LOWER (peek))
{
- template_arg_list_t top = dm->template_arg_lists;
- /* Disconnect the topmost element from the list. */
- dm->template_arg_lists = top->next;
- /* Delete the popped element. */
- template_arg_list_delete (top);
-#ifdef CP_DEMANGLE_DEBUG
- fprintf (stderr, " ** removing template arg list\n");
-#endif
+ struct d_comp *ret;
+
+ ret = d_operator_name (di);
+ if (ret != NULL && ret->type == D_COMP_OPERATOR)
+ di->expansion += sizeof "operator" + ret->u.s_operator.op->len - 2;
+ return ret;
}
+ else if (peek == 'C' || peek == 'D')
+ return d_ctor_dtor_name (di);
+ else
+ return NULL;
}
-#ifdef CP_DEMANGLE_DEBUG
+/* <source-name> ::= <(positive length) number> <identifier> */
-/* Prints the contents of ARG_LIST to FP. */
+static struct d_comp *
+d_source_name (di)
+ struct d_info *di;
+{
+ long len;
+ struct d_comp *ret;
-static void
-template_arg_list_print (arg_list, fp)
- template_arg_list_t arg_list;
- FILE *fp;
+ len = d_number (di);
+ if (len <= 0)
+ return NULL;
+ ret = d_identifier (di, len);
+ di->last_name = ret;
+ return ret;
+}
+
+/* number ::= [n] <(non-negative decimal integer)> */
+
+static long
+d_number (di)
+ struct d_info *di;
{
- string_list_t arg;
- int index = -1;
+ int negative;
+ char peek;
+ long ret;
- fprintf (fp, "TEMPLATE ARGUMENT LIST:\n");
- for (arg = arg_list->first_argument; arg != NULL; arg = arg->next)
+ negative = 0;
+ peek = d_peek_char (di);
+ if (peek == 'n')
{
- if (index == -1)
- fprintf (fp, " T_ : ");
- else
- fprintf (fp, " T%d_ : ", index);
- ++index;
- fprintf (fp, "%s\n", dyn_string_buf ((dyn_string_t) arg));
+ negative = 1;
+ d_advance (di, 1);
+ peek = d_peek_char (di);
}
-}
-#endif /* CP_DEMANGLE_DEBUG */
+ ret = 0;
+ while (1)
+ {
+ if (! IS_DIGIT (peek))
+ {
+ if (negative)
+ ret = - ret;
+ return ret;
+ }
+ ret = ret * 10 + peek - '0';
+ d_advance (di, 1);
+ peek = d_peek_char (di);
+ }
+}
-/* Returns the topmost element on the stack of template argument
- lists. If there is no list of template arguments, returns NULL. */
+/* identifier ::= <(unqualified source code identifier)> */
-static template_arg_list_t
-current_template_arg_list (dm)
- demangling_t dm;
+static struct d_comp *
+d_identifier (di, len)
+ struct d_info *di;
+ int len;
{
- return dm->template_arg_lists;
-}
+ const char *name;
-/* Allocates a demangling_t object for demangling mangled NAME. A new
- result must be pushed before the returned object can be used.
- Returns NULL if allocation fails. */
+ name = d_str (di);
-static demangling_t
-demangling_new (name, style)
- const char *name;
- int style;
-{
- demangling_t dm;
- dm = (demangling_t) malloc (sizeof (struct demangling_def));
- if (dm == NULL)
+ if (di->send - name < len)
return NULL;
- dm->name = name;
- dm->next = name;
- dm->result = NULL;
- dm->num_substitutions = 0;
- dm->substitutions_allocated = 10;
- dm->template_arg_lists = NULL;
- dm->last_source_name = dyn_string_new (0);
- if (dm->last_source_name == NULL)
- return NULL;
- dm->substitutions = (struct substitution_def *)
- malloc (dm->substitutions_allocated * sizeof (struct substitution_def));
- if (dm->substitutions == NULL)
+ d_advance (di, len);
+
+ /* A Java mangled name may have a trailing '$' if it is a C++
+ keyword. This '$' is not included in the length count. We just
+ ignore the '$'. */
+ if ((di->options & DMGL_JAVA) != 0
+ && d_peek_char (di) == '$')
+ d_advance (di, 1);
+
+ /* Look for something which looks like a gcc encoding of an
+ anonymous namespace, and replace it with a more user friendly
+ name. */
+ if (len >= (int) ANONYMOUS_NAMESPACE_PREFIX_LEN + 2
+ && memcmp (name, ANONYMOUS_NAMESPACE_PREFIX,
+ ANONYMOUS_NAMESPACE_PREFIX_LEN) == 0)
{
- dyn_string_delete (dm->last_source_name);
- return NULL;
+ const char *s;
+
+ s = name + ANONYMOUS_NAMESPACE_PREFIX_LEN;
+ if ((*s == '.' || *s == '_' || *s == '$')
+ && s[1] == 'N')
+ {
+ di->expansion -= len - sizeof "(anonymous namespace)";
+ return d_make_name (di, "(anonymous namespace)",
+ sizeof "(anonymous namespace)" - 1);
+ }
}
- dm->style = style;
- dm->is_constructor = (enum gnu_v3_ctor_kinds) 0;
- dm->is_destructor = (enum gnu_v3_dtor_kinds) 0;
- return dm;
+ return d_make_name (di, name, len);
}
-/* Deallocates a demangling_t object and all memory associated with
- it. */
+/* operator_name ::= many different two character encodings.
+ ::= cv <type>
+ ::= v <digit> <source-name>
+*/
-static void
-demangling_delete (dm)
- demangling_t dm;
+#define NL(s) s, (sizeof s) - 1
+
+static const struct d_operator_info d_operators[] =
{
- int i;
- template_arg_list_t arg_list = dm->template_arg_lists;
+ { "aN", NL ("&="), 2 },
+ { "aS", NL ("="), 2 },
+ { "aa", NL ("&&"), 2 },
+ { "ad", NL ("&"), 1 },
+ { "an", NL ("&"), 2 },
+ { "cl", NL ("()"), 0 },
+ { "cm", NL (","), 2 },
+ { "co", NL ("~"), 1 },
+ { "dV", NL ("/="), 2 },
+ { "da", NL ("delete[]"), 1 },
+ { "de", NL ("*"), 1 },
+ { "dl", NL ("delete"), 1 },
+ { "dv", NL ("/"), 2 },
+ { "eO", NL ("^="), 2 },
+ { "eo", NL ("^"), 2 },
+ { "eq", NL ("=="), 2 },
+ { "ge", NL (">="), 2 },
+ { "gt", NL (">"), 2 },
+ { "ix", NL ("[]"), 2 },
+ { "lS", NL ("<<="), 2 },
+ { "le", NL ("<="), 2 },
+ { "ls", NL ("<<"), 2 },
+ { "lt", NL ("<"), 2 },
+ { "mI", NL ("-="), 2 },
+ { "mL", NL ("*="), 2 },
+ { "mi", NL ("-"), 2 },
+ { "ml", NL ("*"), 2 },
+ { "mm", NL ("--"), 1 },
+ { "na", NL ("new[]"), 1 },
+ { "ne", NL ("!="), 2 },
+ { "ng", NL ("-"), 1 },
+ { "nt", NL ("!"), 1 },
+ { "nw", NL ("new"), 1 },
+ { "oR", NL ("|="), 2 },
+ { "oo", NL ("||"), 2 },
+ { "or", NL ("|"), 2 },
+ { "pL", NL ("+="), 2 },
+ { "pl", NL ("+"), 2 },
+ { "pm", NL ("->*"), 2 },
+ { "pp", NL ("++"), 1 },
+ { "ps", NL ("+"), 1 },
+ { "pt", NL ("->"), 2 },
+ { "qu", NL ("?"), 3 },
+ { "rM", NL ("%="), 2 },
+ { "rS", NL (">>="), 2 },
+ { "rm", NL ("%"), 2 },
+ { "rs", NL (">>"), 2 },
+ { "st", NL ("sizeof "), 1 },
+ { "sz", NL ("sizeof "), 1 }
+};
- /* Delete the stack of template argument lists. */
- while (arg_list != NULL)
+static struct d_comp *
+d_operator_name (di)
+ struct d_info *di;
+{
+ char c1;
+ char c2;
+
+ c1 = d_next_char (di);
+ c2 = d_next_char (di);
+ if (c1 == 'v' && IS_DIGIT (c2))
+ return d_make_extended_operator (di, c2 - '0', d_source_name (di));
+ else if (c1 == 'c' && c2 == 'v')
+ return d_make_comp (di, D_COMP_CAST, d_type (di), NULL);
+ else
{
- template_arg_list_t next = arg_list->next;
- template_arg_list_delete (arg_list);
- arg_list = next;
+ int low = 0;
+ int high = sizeof (d_operators) / sizeof (d_operators[0]);
+
+ while (1)
+ {
+ int i;
+ const struct d_operator_info *p;
+
+ i = low + (high - low) / 2;
+ p = d_operators + i;
+
+ if (c1 == p->code[0] && c2 == p->code[1])
+ return d_make_operator (di, p);
+
+ if (c1 < p->code[0] || (c1 == p->code[0] && c2 < p->code[1]))
+ high = i;
+ else
+ low = i + 1;
+ if (low == high)
+ return NULL;
+ }
}
- /* Delete the list of substitutions. */
- for (i = dm->num_substitutions; --i >= 0; )
- dyn_string_delete (dm->substitutions[i].text);
- free (dm->substitutions);
- /* Delete the demangled result. */
- string_list_delete (dm->result);
- /* Delete the stored identifier name. */
- dyn_string_delete (dm->last_source_name);
- /* Delete the context object itself. */
- free (dm);
}
-/* These functions demangle an alternative of the corresponding
- production in the mangling spec. The first argument of each is a
- demangling context structure for the current demangling
- operation. Most emit demangled text directly to the topmost result
- string on the result string stack in the demangling context
- structure. */
-
-static status_t demangle_char
- PARAMS ((demangling_t, int));
-static status_t demangle_mangled_name
- PARAMS ((demangling_t));
-static status_t demangle_encoding
- PARAMS ((demangling_t));
-static status_t demangle_name
- PARAMS ((demangling_t, int *));
-static status_t demangle_nested_name
- PARAMS ((demangling_t, int *));
-static status_t demangle_prefix
- PARAMS ((demangling_t, int *));
-static status_t demangle_unqualified_name
- PARAMS ((demangling_t, int *));
-static status_t demangle_source_name
- PARAMS ((demangling_t));
-static status_t demangle_number
- PARAMS ((demangling_t, int *, int, int));
-static status_t demangle_number_literally
- PARAMS ((demangling_t, dyn_string_t, int, int));
-static status_t demangle_identifier
- PARAMS ((demangling_t, int, dyn_string_t));
-static status_t demangle_operator_name
- PARAMS ((demangling_t, int, int *, int *));
-static status_t demangle_nv_offset
- PARAMS ((demangling_t));
-static status_t demangle_v_offset
- PARAMS ((demangling_t));
-static status_t demangle_call_offset
- PARAMS ((demangling_t));
-static status_t demangle_special_name
- PARAMS ((demangling_t));
-static status_t demangle_ctor_dtor_name
- PARAMS ((demangling_t));
-static status_t demangle_type_ptr
- PARAMS ((demangling_t, int *, int));
-static status_t demangle_type
- PARAMS ((demangling_t));
-static status_t demangle_CV_qualifiers
- PARAMS ((demangling_t, dyn_string_t));
-static status_t demangle_builtin_type
- PARAMS ((demangling_t));
-static status_t demangle_function_type
- PARAMS ((demangling_t, int *));
-static status_t demangle_bare_function_type
- PARAMS ((demangling_t, int *));
-static status_t demangle_class_enum_type
- PARAMS ((demangling_t, int *));
-static status_t demangle_array_type
- PARAMS ((demangling_t, int *));
-static status_t demangle_template_param
- PARAMS ((demangling_t));
-static status_t demangle_template_args
- PARAMS ((demangling_t));
-static status_t demangle_literal
- PARAMS ((demangling_t));
-static status_t demangle_template_arg
- PARAMS ((demangling_t));
-static status_t demangle_expression
- PARAMS ((demangling_t));
-static status_t demangle_scope_expression
- PARAMS ((demangling_t));
-static status_t demangle_expr_primary
- PARAMS ((demangling_t));
-static status_t demangle_substitution
- PARAMS ((demangling_t, int *));
-static status_t demangle_local_name
- PARAMS ((demangling_t));
-static status_t demangle_discriminator
- PARAMS ((demangling_t, int));
-static status_t cp_demangle
- PARAMS ((const char *, dyn_string_t, int));
-static status_t cp_demangle_type
- PARAMS ((const char*, dyn_string_t));
-
-/* When passed to demangle_bare_function_type, indicates that the
- function's return type is not encoded before its parameter types. */
-#define BFT_NO_RETURN_TYPE NULL
-
-/* Check that the next character is C. If so, consume it. If not,
- return an error. */
-
-static status_t
-demangle_char (dm, c)
- demangling_t dm;
- int c;
+/* <special-name> ::= TV <type>
+ ::= TT <type>
+ ::= TI <type>
+ ::= TS <type>
+ ::= GV <(object) name>
+ ::= T <call-offset> <(base) encoding>
+ ::= Tc <call-offset> <call-offset> <(base) encoding>
+ Also g++ extensions:
+ ::= TC <type> <(offset) number> _ <(base) type>
+ ::= TF <type>
+ ::= TJ <type>
+ ::= GR <name>
+*/
+
+static struct d_comp *
+d_special_name (di)
+ struct d_info *di;
{
- static char *error_message = NULL;
+ char c;
- if (peek_char (dm) == c)
+ di->expansion += 20;
+ c = d_next_char (di);
+ if (c == 'T')
{
- advance_char (dm);
- return STATUS_OK;
+ switch (d_next_char (di))
+ {
+ case 'V':
+ di->expansion -= 5;
+ return d_make_comp (di, D_COMP_VTABLE, d_type (di), NULL);
+ case 'T':
+ di->expansion -= 10;
+ return d_make_comp (di, D_COMP_VTT, d_type (di), NULL);
+ case 'I':
+ return d_make_comp (di, D_COMP_TYPEINFO, d_type (di), NULL);
+ case 'S':
+ return d_make_comp (di, D_COMP_TYPEINFO_NAME, d_type (di), NULL);
+
+ case 'h':
+ if (! d_call_offset (di, 'h'))
+ return NULL;
+ return d_make_comp (di, D_COMP_THUNK, d_encoding (di, 0), NULL);
+
+ case 'v':
+ if (! d_call_offset (di, 'v'))
+ return NULL;
+ return d_make_comp (di, D_COMP_VIRTUAL_THUNK, d_encoding (di, 0),
+ NULL);
+
+ case 'c':
+ if (! d_call_offset (di, '\0'))
+ return NULL;
+ if (! d_call_offset (di, '\0'))
+ return NULL;
+ return d_make_comp (di, D_COMP_COVARIANT_THUNK, d_encoding (di, 0),
+ NULL);
+
+ case 'C':
+ {
+ struct d_comp *derived_type;
+ long offset;
+ struct d_comp *base_type;
+
+ derived_type = d_type (di);
+ offset = d_number (di);
+ if (offset < 0)
+ return NULL;
+ if (d_next_char (di) != '_')
+ return NULL;
+ base_type = d_type (di);
+ /* We don't display the offset. FIXME: We should display
+ it in verbose mode. */
+ di->expansion += 5;
+ return d_make_comp (di, D_COMP_CONSTRUCTION_VTABLE, base_type,
+ derived_type);
+ }
+
+ case 'F':
+ return d_make_comp (di, D_COMP_TYPEINFO_FN, d_type (di), NULL);
+ case 'J':
+ return d_make_comp (di, D_COMP_JAVA_CLASS, d_type (di), NULL);
+
+ default:
+ return NULL;
+ }
}
- else
+ else if (c == 'G')
{
- if (error_message == NULL)
- error_message = (char *) strdup ("Expected ?");
- error_message[9] = c;
- return error_message;
+ switch (d_next_char (di))
+ {
+ case 'V':
+ return d_make_comp (di, D_COMP_GUARD, d_name (di), NULL);
+
+ case 'R':
+ return d_make_comp (di, D_COMP_REFTEMP, d_name (di), NULL);
+
+ default:
+ return NULL;
+ }
}
+ else
+ return NULL;
}
-/* Demangles and emits a <mangled-name>.
+/* <call-offset> ::= h <nv-offset> _
+ ::= v <v-offset> _
- <mangled-name> ::= _Z <encoding> */
+ <nv-offset> ::= <(offset) number>
-static status_t
-demangle_mangled_name (dm)
- demangling_t dm;
-{
- DEMANGLE_TRACE ("mangled-name", dm);
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- RETURN_IF_ERROR (demangle_char (dm, 'Z'));
- RETURN_IF_ERROR (demangle_encoding (dm));
- return STATUS_OK;
-}
+ <v-offset> ::= <(offset) number> _ <(virtual offset) number>
-/* Demangles and emits an <encoding>.
+ The C parameter, if not '\0', is a character we just read which is
+ the start of the <call-offset>.
- <encoding> ::= <function name> <bare-function-type>
- ::= <data name>
- ::= <special-name> */
+ We don't display the offset information anywhere. FIXME: We should
+ display it in verbose mode. */
-static status_t
-demangle_encoding (dm)
- demangling_t dm;
+static int
+d_call_offset (di, c)
+ struct d_info *di;
+ int c;
{
- int encode_return_type;
- int start_position;
- template_arg_list_t old_arg_list = current_template_arg_list (dm);
- char peek = peek_char (dm);
+ long offset;
+ long virtual_offset;
- DEMANGLE_TRACE ("encoding", dm);
-
- /* Remember where the name starts. If it turns out to be a template
- function, we'll have to insert the return type here. */
- start_position = result_caret_pos (dm);
+ if (c == '\0')
+ c = d_next_char (di);
- if (peek == 'G' || peek == 'T')
- RETURN_IF_ERROR (demangle_special_name (dm));
- else
+ if (c == 'h')
+ offset = d_number (di);
+ else if (c == 'v')
{
- /* Now demangle the name. */
- RETURN_IF_ERROR (demangle_name (dm, &encode_return_type));
-
- /* If there's anything left, the name was a function name, with
- maybe its return type, and its parameter types, following. */
- if (!end_of_name_p (dm)
- && peek_char (dm) != 'E')
- {
- if (encode_return_type)
- /* Template functions have their return type encoded. The
- return type should be inserted at start_position. */
- RETURN_IF_ERROR
- (demangle_bare_function_type (dm, &start_position));
- else
- /* Non-template functions don't have their return type
- encoded. */
- RETURN_IF_ERROR
- (demangle_bare_function_type (dm, BFT_NO_RETURN_TYPE));
- }
+ offset = d_number (di);
+ if (d_next_char (di) != '_')
+ return 0;
+ virtual_offset = d_number (di);
}
+ else
+ return 0;
- /* Pop off template argument lists that were built during the
- mangling of this name, to restore the old template context. */
- pop_to_template_arg_list (dm, old_arg_list);
+ if (d_next_char (di) != '_')
+ return 0;
- return STATUS_OK;
+ return 1;
}
-/* Demangles and emits a <name>.
+/* <ctor-dtor-name> ::= C1
+ ::= C2
+ ::= C3
+ ::= D0
+ ::= D1
+ ::= D2
+*/
+
+static struct d_comp *
+d_ctor_dtor_name (di)
+ struct d_info *di;
+{
+ if (di->last_name != NULL)
+ {
+ if (di->last_name->type == D_COMP_NAME)
+ di->expansion += di->last_name->u.s_name.len;
+ else if (di->last_name->type == D_COMP_SUB_STD)
+ di->expansion += di->last_name->u.s_string.len;
+ }
+ switch (d_next_char (di))
+ {
+ case 'C':
+ {
+ enum gnu_v3_ctor_kinds kind;
+
+ switch (d_next_char (di))
+ {
+ case '1':
+ kind = gnu_v3_complete_object_ctor;
+ break;
+ case '2':
+ kind = gnu_v3_base_object_ctor;
+ break;
+ case '3':
+ kind = gnu_v3_complete_object_allocating_ctor;
+ break;
+ default:
+ return NULL;
+ }
+ return d_make_ctor (di, kind, di->last_name);
+ }
+
+ case 'D':
+ {
+ enum gnu_v3_dtor_kinds kind;
+
+ switch (d_next_char (di))
+ {
+ case '0':
+ kind = gnu_v3_deleting_dtor;
+ break;
+ case '1':
+ kind = gnu_v3_complete_object_dtor;
+ break;
+ case '2':
+ kind = gnu_v3_base_object_dtor;
+ break;
+ default:
+ return NULL;
+ }
+ return d_make_dtor (di, kind, di->last_name);
+ }
- <name> ::= <unscoped-name>
- ::= <unscoped-template-name> <template-args>
- ::= <nested-name>
- ::= <local-name>
+ default:
+ return NULL;
+ }
+}
- <unscoped-name> ::= <unqualified-name>
- ::= St <unqualified-name> # ::std::
+/* <type> ::= <builtin-type>
+ ::= <function-type>
+ ::= <class-enum-type>
+ ::= <array-type>
+ ::= <pointer-to-member-type>
+ ::= <template-param>
+ ::= <template-template-param> <template-args>
+ ::= <substitution>
+ ::= <CV-qualifiers> <type>
+ ::= P <type>
+ ::= R <type>
+ ::= C <type>
+ ::= G <type>
+ ::= U <source-name> <type>
+
+ <builtin-type> ::= various one letter codes
+ ::= u <source-name>
+*/
- <unscoped-template-name>
- ::= <unscoped-name>
- ::= <substitution> */
+static const struct d_builtin_type_info d_builtin_types[26] =
+{
+ /* a */ { NL ("signed char"), NL ("signed char"), D_PRINT_INT },
+ /* b */ { NL ("bool"), NL ("boolean"), D_PRINT_BOOL },
+ /* c */ { NL ("char"), NL ("byte"), D_PRINT_INT },
+ /* d */ { NL ("double"), NL ("double"), D_PRINT_DEFAULT },
+ /* e */ { NL ("long double"), NL ("long double"), D_PRINT_DEFAULT },
+ /* f */ { NL ("float"), NL ("float"), D_PRINT_DEFAULT },
+ /* g */ { NL ("__float128"), NL ("__float128"), D_PRINT_DEFAULT },
+ /* h */ { NL ("unsigned char"), NL ("unsigned char"), D_PRINT_INT },
+ /* i */ { NL ("int"), NL ("int"), D_PRINT_INT },
+ /* j */ { NL ("unsigned int"), NL ("unsigned"), D_PRINT_INT },
+ /* k */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* l */ { NL ("long"), NL ("long"), D_PRINT_LONG },
+ /* m */ { NL ("unsigned long"), NL ("unsigned long"), D_PRINT_LONG },
+ /* n */ { NL ("__int128"), NL ("__int128"), D_PRINT_DEFAULT },
+ /* o */ { NL ("unsigned __int128"), NL ("unsigned __int128"), D_PRINT_DEFAULT },
+ /* p */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* q */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* r */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* s */ { NL ("short"), NL ("short"), D_PRINT_INT },
+ /* t */ { NL ("unsigned short"), NL ("unsigned short"), D_PRINT_INT },
+ /* u */ { NULL, 0, NULL, 0, D_PRINT_DEFAULT },
+ /* v */ { NL ("void"), NL ("void"), D_PRINT_VOID },
+ /* w */ { NL ("wchar_t"), NL ("char"), D_PRINT_INT },
+ /* x */ { NL ("long long"), NL ("long"), D_PRINT_DEFAULT },
+ /* y */ { NL ("unsigned long long"), NL ("unsigned long long"), D_PRINT_DEFAULT },
+ /* z */ { NL ("..."), NL ("..."), D_PRINT_DEFAULT },
+};
-static status_t
-demangle_name (dm, encode_return_type)
- demangling_t dm;
- int *encode_return_type;
+static struct d_comp *
+d_type (di)
+ struct d_info *di;
{
- int start = substitution_start (dm);
- char peek = peek_char (dm);
- int is_std_substitution = 0;
+ char peek;
+ struct d_comp *ret;
+ int can_subst;
+
+ /* The ABI specifies that when CV-qualifiers are used, the base type
+ is substitutable, and the fully qualified type is substitutable,
+ but the base type with a strict subset of the CV-qualifiers is
+ not substitutable. The natural recursive implementation of the
+ CV-qualifiers would cause subsets to be substitutable, so instead
+ we pull them all off now.
+
+ FIXME: The ABI says that order-insensitive vendor qualifiers
+ should be handled in the same way, but we have no way to tell
+ which vendor qualifiers are order-insensitive and which are
+ order-sensitive. So we just assume that they are all
+ order-sensitive. g++ 3.4 supports only one vendor qualifier,
+ __vector, and it treats it as order-sensitive when mangling
+ names. */
+
+ peek = d_peek_char (di);
+ if (peek == 'r' || peek == 'V' || peek == 'K')
+ {
+ struct d_comp **pret;
- /* Generally, the return type is encoded if the function is a
- template-id, and suppressed otherwise. There are a few cases,
- though, in which the return type is not encoded even for a
- templated function. In these cases, this flag is set. */
- int suppress_return_type = 0;
+ pret = d_cv_qualifiers (di, &ret, 0);
+ if (pret == NULL)
+ return NULL;
+ *pret = d_type (di);
+ if (! d_add_substitution (di, ret))
+ return NULL;
+ return ret;
+ }
- DEMANGLE_TRACE ("name", dm);
+ can_subst = 1;
switch (peek)
{
- case 'N':
- /* This is a <nested-name>. */
- RETURN_IF_ERROR (demangle_nested_name (dm, encode_return_type));
+ case 'a': case 'b': case 'c': case 'd': case 'e': case 'f': case 'g':
+ case 'h': case 'i': case 'j': case 'l': case 'm': case 'n':
+ case 'o': case 's': case 't':
+ case 'v': case 'w': case 'x': case 'y': case 'z':
+ ret = d_make_builtin_type (di, &d_builtin_types[peek - 'a']);
+ di->expansion += ret->u.s_builtin.type->len;
+ can_subst = 0;
+ d_advance (di, 1);
+ break;
+
+ case 'u':
+ d_advance (di, 1);
+ ret = d_make_comp (di, D_COMP_VENDOR_TYPE, d_source_name (di), NULL);
break;
+ case 'F':
+ ret = d_function_type (di);
+ break;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ case 'N':
case 'Z':
- RETURN_IF_ERROR (demangle_local_name (dm));
- *encode_return_type = 0;
+ ret = d_class_enum_type (di);
break;
- case 'S':
- /* The `St' substitution allows a name nested in std:: to appear
- without being enclosed in a nested name. */
- if (peek_char_next (dm) == 't')
- {
- (void) next_char (dm);
- (void) next_char (dm);
- RETURN_IF_ERROR (result_add (dm, "std::"));
- RETURN_IF_ERROR
- (demangle_unqualified_name (dm, &suppress_return_type));
- is_std_substitution = 1;
- }
- else
- RETURN_IF_ERROR (demangle_substitution (dm, encode_return_type));
- /* Check if a template argument list immediately follows.
- If so, then we just demangled an <unqualified-template-name>. */
- if (peek_char (dm) == 'I')
+ case 'A':
+ ret = d_array_type (di);
+ break;
+
+ case 'M':
+ ret = d_pointer_to_member_type (di);
+ break;
+
+ case 'T':
+ ret = d_template_param (di);
+ if (d_peek_char (di) == 'I')
{
- /* A template name of the form std::<unqualified-name> is a
- substitution candidate. */
- if (is_std_substitution)
- RETURN_IF_ERROR (substitution_add (dm, start, 0));
- /* Demangle the <template-args> here. */
- RETURN_IF_ERROR (demangle_template_args (dm));
- *encode_return_type = !suppress_return_type;
+ /* This is <template-template-param> <template-args>. The
+ <template-template-param> part is a substitution
+ candidate. */
+ if (! d_add_substitution (di, ret))
+ return NULL;
+ ret = d_make_comp (di, D_COMP_TEMPLATE, ret, d_template_args (di));
}
- else
- *encode_return_type = 0;
+ break;
+ case 'S':
+ /* If this is a special substitution, then it is the start of
+ <class-enum-type>. */
+ {
+ char peek_next;
+
+ peek_next = d_peek_next_char (di);
+ if (IS_DIGIT (peek_next)
+ || peek_next == '_'
+ || IS_UPPER (peek_next))
+ {
+ ret = d_substitution (di, 0);
+ /* The substituted name may have been a template name and
+ may be followed by tepmlate args. */
+ if (d_peek_char (di) == 'I')
+ ret = d_make_comp (di, D_COMP_TEMPLATE, ret,
+ d_template_args (di));
+ else
+ can_subst = 0;
+ }
+ else
+ {
+ ret = d_class_enum_type (di);
+ /* If the substitution was a complete type, then it is not
+ a new substitution candidate. However, if the
+ substitution was followed by template arguments, then
+ the whole thing is a substitution candidate. */
+ if (ret != NULL && ret->type == D_COMP_SUB_STD)
+ can_subst = 0;
+ }
+ }
break;
- default:
- /* This is an <unscoped-name> or <unscoped-template-name>. */
- RETURN_IF_ERROR (demangle_unqualified_name (dm, &suppress_return_type));
+ case 'P':
+ d_advance (di, 1);
+ ret = d_make_comp (di, D_COMP_POINTER, d_type (di), NULL);
+ break;
- /* If the <unqualified-name> is followed by template args, this
- is an <unscoped-template-name>. */
- if (peek_char (dm) == 'I')
- {
- /* Add a substitution for the unqualified template name. */
- RETURN_IF_ERROR (substitution_add (dm, start, 0));
+ case 'R':
+ d_advance (di, 1);
+ ret = d_make_comp (di, D_COMP_REFERENCE, d_type (di), NULL);
+ break;
- RETURN_IF_ERROR (demangle_template_args (dm));
- *encode_return_type = !suppress_return_type;
- }
- else
- *encode_return_type = 0;
+ case 'C':
+ d_advance (di, 1);
+ ret = d_make_comp (di, D_COMP_COMPLEX, d_type (di), NULL);
+ break;
+
+ case 'G':
+ d_advance (di, 1);
+ ret = d_make_comp (di, D_COMP_IMAGINARY, d_type (di), NULL);
+ break;
+ case 'U':
+ d_advance (di, 1);
+ ret = d_source_name (di);
+ ret = d_make_comp (di, D_COMP_VENDOR_TYPE_QUAL, d_type (di), ret);
break;
+
+ default:
+ return NULL;
}
- return STATUS_OK;
-}
+ if (can_subst)
+ {
+ if (! d_add_substitution (di, ret))
+ return NULL;
+ }
-/* Demangles and emits a <nested-name>.
+ return ret;
+}
- <nested-name> ::= N [<CV-qualifiers>] <prefix> <unqulified-name> E */
+/* <CV-qualifiers> ::= [r] [V] [K] */
-static status_t
-demangle_nested_name (dm, encode_return_type)
- demangling_t dm;
- int *encode_return_type;
+static struct d_comp **
+d_cv_qualifiers (di, pret, member_fn)
+ struct d_info *di;
+ struct d_comp **pret;
+ int member_fn;
{
char peek;
- DEMANGLE_TRACE ("nested-name", dm);
-
- RETURN_IF_ERROR (demangle_char (dm, 'N'));
-
- peek = peek_char (dm);
- if (peek == 'r' || peek == 'V' || peek == 'K')
+ peek = d_peek_char (di);
+ while (peek == 'r' || peek == 'V' || peek == 'K')
{
- dyn_string_t cv_qualifiers;
- status_t status;
-
- /* Snarf up CV qualifiers. */
- cv_qualifiers = dyn_string_new (24);
- if (cv_qualifiers == NULL)
- return STATUS_ALLOCATION_FAILED;
- demangle_CV_qualifiers (dm, cv_qualifiers);
-
- /* Emit them, preceded by a space. */
- status = result_add_char (dm, ' ');
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, cv_qualifiers);
- /* The CV qualifiers that occur in a <nested-name> will be
- qualifiers for member functions. These are placed at the end
- of the function. Therefore, shift the caret to the left by
- the length of the qualifiers, so other text is inserted
- before them and they stay at the end. */
- result_shift_caret (dm, -dyn_string_length (cv_qualifiers) - 1);
- /* Clean up. */
- dyn_string_delete (cv_qualifiers);
- RETURN_IF_ERROR (status);
- }
+ enum d_comp_type t;
- RETURN_IF_ERROR (demangle_prefix (dm, encode_return_type));
- /* No need to demangle the final <unqualified-name>; demangle_prefix
- will handle it. */
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
+ d_advance (di, 1);
+ if (peek == 'r')
+ {
+ t = member_fn ? D_COMP_RESTRICT_THIS : D_COMP_RESTRICT;
+ di->expansion += sizeof "restrict";
+ }
+ else if (peek == 'V')
+ {
+ t = member_fn ? D_COMP_VOLATILE_THIS : D_COMP_VOLATILE;
+ di->expansion += sizeof "volatile";
+ }
+ else
+ {
+ t = member_fn ? D_COMP_CONST_THIS : D_COMP_CONST;
+ di->expansion += sizeof "const";
+ }
- return STATUS_OK;
-}
+ *pret = d_make_comp (di, t, NULL, NULL);
+ if (*pret == NULL)
+ return NULL;
+ pret = &d_left (*pret);
-/* Demangles and emits a <prefix>.
+ peek = d_peek_char (di);
+ }
- <prefix> ::= <prefix> <unqualified-name>
- ::= <template-prefix> <template-args>
- ::= # empty
- ::= <substitution>
+ return pret;
+}
- <template-prefix> ::= <prefix>
- ::= <substitution> */
+/* <function-type> ::= F [Y] <bare-function-type> E */
-static status_t
-demangle_prefix (dm, encode_return_type)
- demangling_t dm;
- int *encode_return_type;
+static struct d_comp *
+d_function_type (di)
+ struct d_info *di;
{
- int start = substitution_start (dm);
- int nested = 0;
+ struct d_comp *ret;
- /* ENCODE_RETURN_TYPE is updated as we decend the nesting chain.
- After <template-args>, it is set to non-zero; after everything
- else it is set to zero. */
+ if (d_next_char (di) != 'F')
+ return NULL;
+ if (d_peek_char (di) == 'Y')
+ {
+ /* Function has C linkage. We don't print this information.
+ FIXME: We should print it in verbose mode. */
+ d_advance (di, 1);
+ }
+ ret = d_bare_function_type (di, 1);
+ if (d_next_char (di) != 'E')
+ return NULL;
+ return ret;
+}
- /* Generally, the return type is encoded if the function is a
- template-id, and suppressed otherwise. There are a few cases,
- though, in which the return type is not encoded even for a
- templated function. In these cases, this flag is set. */
- int suppress_return_type = 0;
+/* <bare-function-type> ::= <type>+ */
- DEMANGLE_TRACE ("prefix", dm);
+static struct d_comp *
+d_bare_function_type (di, has_return_type)
+ struct d_info *di;
+ int has_return_type;
+{
+ struct d_comp *return_type;
+ struct d_comp *tl;
+ struct d_comp **ptl;
+ return_type = NULL;
+ tl = NULL;
+ ptl = &tl;
while (1)
{
char peek;
+ struct d_comp *type;
- if (end_of_name_p (dm))
- return "Unexpected end of name in <compound-name>.";
-
- peek = peek_char (dm);
-
- /* We'll initialize suppress_return_type to false, and set it to true
- if we end up demangling a constructor name. However, make
- sure we're not actually about to demangle template arguments
- -- if so, this is the <template-args> following a
- <template-prefix>, so we'll want the previous flag value
- around. */
- if (peek != 'I')
- suppress_return_type = 0;
-
- if (IS_DIGIT ((unsigned char) peek)
- || (peek >= 'a' && peek <= 'z')
- || peek == 'C' || peek == 'D'
- || peek == 'S')
+ peek = d_peek_char (di);
+ if (peek == '\0' || peek == 'E')
+ break;
+ type = d_type (di);
+ if (type == NULL)
+ return NULL;
+ if (has_return_type)
{
- /* We have another level of scope qualification. */
- if (nested)
- RETURN_IF_ERROR (result_add (dm, NAMESPACE_SEPARATOR));
- else
- nested = 1;
-
- if (peek == 'S')
- /* The substitution determines whether this is a
- template-id. */
- RETURN_IF_ERROR (demangle_substitution (dm, encode_return_type));
- else
- {
- /* It's just a name. */
- RETURN_IF_ERROR
- (demangle_unqualified_name (dm, &suppress_return_type));
- *encode_return_type = 0;
- }
+ return_type = type;
+ has_return_type = 0;
}
- else if (peek == 'Z')
- RETURN_IF_ERROR (demangle_local_name (dm));
- else if (peek == 'I')
+ else
{
- RETURN_IF_ERROR (demangle_template_args (dm));
-
- /* Now we want to indicate to the caller that we've
- demangled template arguments, thus the prefix was a
- <template-prefix>. That's so that the caller knows to
- demangle the function's return type, if this turns out to
- be a function name. But, if it's a member template
- constructor or a templated conversion operator, report it
- as untemplated. Those never get encoded return types. */
- *encode_return_type = !suppress_return_type;
+ *ptl = d_make_comp (di, D_COMP_ARGLIST, type, NULL);
+ if (*ptl == NULL)
+ return NULL;
+ ptl = &d_right (*ptl);
}
- else if (peek == 'E')
- /* All done. */
- return STATUS_OK;
- else
- return "Unexpected character in <compound-name>.";
+ }
+
+ /* There should be at least one parameter type besides the optional
+ return type. A function which takes no arguments will have a
+ single parameter type void. */
+ if (tl == NULL)
+ return NULL;
- if (peek != 'S'
- && peek_char (dm) != 'E')
- /* Add a new substitution for the prefix thus far. */
- RETURN_IF_ERROR (substitution_add (dm, start, *encode_return_type));
+ /* If we have a single parameter type void, omit it. */
+ if (d_right (tl) == NULL
+ && d_left (tl)->type == D_COMP_BUILTIN_TYPE
+ && d_left (tl)->u.s_builtin.type->print == D_PRINT_VOID)
+ {
+ di->expansion -= d_left (tl)->u.s_builtin.type->len;
+ tl = NULL;
}
-}
-/* Demangles and emits an <unqualified-name>. If this
- <unqualified-name> is for a special function type that should never
- have its return type encoded (particularly, a constructor or
- conversion operator), *SUPPRESS_RETURN_TYPE is set to 1; otherwise,
- it is set to zero.
+ return d_make_comp (di, D_COMP_FUNCTION_TYPE, return_type, tl);
+}
- <unqualified-name> ::= <operator-name>
- ::= <special-name>
- ::= <source-name> */
+/* <class-enum-type> ::= <name> */
-static status_t
-demangle_unqualified_name (dm, suppress_return_type)
- demangling_t dm;
- int *suppress_return_type;
+static struct d_comp *
+d_class_enum_type (di)
+ struct d_info *di;
{
- char peek = peek_char (dm);
-
- DEMANGLE_TRACE ("unqualified-name", dm);
+ return d_name (di);
+}
- /* By default, don't force suppression of the return type (though
- non-template functions still don't get a return type encoded). */
- *suppress_return_type = 0;
+/* <array-type> ::= A <(positive dimension) number> _ <(element) type>
+ ::= A [<(dimension) expression>] _ <(element) type>
+*/
- if (IS_DIGIT ((unsigned char) peek))
- RETURN_IF_ERROR (demangle_source_name (dm));
- else if (peek >= 'a' && peek <= 'z')
- {
- int num_args;
+static struct d_comp *
+d_array_type (di)
+ struct d_info *di;
+{
+ char peek;
+ struct d_comp *dim;
- /* Conversion operators never have a return type encoded. */
- if (peek == 'c' && peek_char_next (dm) == 'v')
- *suppress_return_type = 1;
+ if (d_next_char (di) != 'A')
+ return NULL;
- RETURN_IF_ERROR (demangle_operator_name (dm, 0, &num_args, NULL));
- }
- else if (peek == 'C' || peek == 'D')
+ peek = d_peek_char (di);
+ if (peek == '_')
+ dim = NULL;
+ else if (IS_DIGIT (peek))
{
- /* Constructors never have a return type encoded. */
- if (peek == 'C')
- *suppress_return_type = 1;
+ const char *s;
- RETURN_IF_ERROR (demangle_ctor_dtor_name (dm));
+ s = d_str (di);
+ do
+ {
+ d_advance (di, 1);
+ peek = d_peek_char (di);
+ }
+ while (IS_DIGIT (peek));
+ dim = d_make_name (di, s, d_str (di) - s);
+ if (dim == NULL)
+ return NULL;
}
else
- return "Unexpected character in <unqualified-name>.";
+ {
+ dim = d_expression (di);
+ if (dim == NULL)
+ return NULL;
+ }
- return STATUS_OK;
-}
+ if (d_next_char (di) != '_')
+ return NULL;
-/* Demangles and emits <source-name>.
+ return d_make_comp (di, D_COMP_ARRAY_TYPE, dim, d_type (di));
+}
- <source-name> ::= <length number> <identifier> */
+/* <pointer-to-member-type> ::= M <(class) type> <(member) type> */
-static status_t
-demangle_source_name (dm)
- demangling_t dm;
+static struct d_comp *
+d_pointer_to_member_type (di)
+ struct d_info *di;
{
- int length;
-
- DEMANGLE_TRACE ("source-name", dm);
+ struct d_comp *cl;
+ struct d_comp *mem;
+ struct d_comp **pmem;
- /* Decode the length of the identifier. */
- RETURN_IF_ERROR (demangle_number (dm, &length, 10, 0));
- if (length == 0)
- return "Zero length in <source-name>.";
-
- /* Now the identifier itself. It's placed into last_source_name,
- where it can be used to build a constructor or destructor name. */
- RETURN_IF_ERROR (demangle_identifier (dm, length,
- dm->last_source_name));
+ if (d_next_char (di) != 'M')
+ return NULL;
- /* Emit it. */
- RETURN_IF_ERROR (result_add_string (dm, dm->last_source_name));
+ cl = d_type (di);
+
+ /* The ABI specifies that any type can be a substitution source, and
+ that M is followed by two types, and that when a CV-qualified
+ type is seen both the base type and the CV-qualified types are
+ substitution sources. The ABI also specifies that for a pointer
+ to a CV-qualified member function, the qualifiers are attached to
+ the second type. Given the grammar, a plain reading of the ABI
+ suggests that both the CV-qualified member function and the
+ non-qualified member function are substitution sources. However,
+ g++ does not work that way. g++ treats only the CV-qualified
+ member function as a substitution source. FIXME. So to work
+ with g++, we need to pull off the CV-qualifiers here, in order to
+ avoid calling add_substitution() in d_type(). */
+
+ pmem = d_cv_qualifiers (di, &mem, 1);
+ if (pmem == NULL)
+ return NULL;
+ *pmem = d_type (di);
- return STATUS_OK;
+ return d_make_comp (di, D_COMP_PTRMEM_TYPE, cl, mem);
}
-/* Demangles a number, either a <number> or a <positive-number> at the
- current position, consuming all consecutive digit characters. Sets
- *VALUE to the resulting numberand returns STATUS_OK. The number is
- interpreted as BASE, which must be either 10 or 36. If IS_SIGNED
- is non-zero, negative numbers -- prefixed with `n' -- are accepted.
-
- <number> ::= [n] <positive-number>
-
- <positive-number> ::= <decimal integer> */
+/* <template-param> ::= T_
+ ::= T <(parameter-2 non-negative) number> _
+*/
-static status_t
-demangle_number (dm, value, base, is_signed)
- demangling_t dm;
- int *value;
- int base;
- int is_signed;
+static struct d_comp *
+d_template_param (di)
+ struct d_info *di;
{
- dyn_string_t number = dyn_string_new (10);
+ long param;
- DEMANGLE_TRACE ("number", dm);
+ if (d_next_char (di) != 'T')
+ return NULL;
- if (number == NULL)
- return STATUS_ALLOCATION_FAILED;
+ if (d_peek_char (di) == '_')
+ param = 0;
+ else
+ {
+ param = d_number (di);
+ if (param < 0)
+ return NULL;
+ param += 1;
+ }
- demangle_number_literally (dm, number, base, is_signed);
- *value = strtol (dyn_string_buf (number), NULL, base);
- dyn_string_delete (number);
+ if (d_next_char (di) != '_')
+ return NULL;
- return STATUS_OK;
+ ++di->did_subs;
+
+ return d_make_template_param (di, param);
}
-/* Demangles a number at the current position. The digits (and minus
- sign, if present) that make up the number are appended to STR.
- Only base-BASE digits are accepted; BASE must be either 10 or 36.
- If IS_SIGNED, negative numbers -- prefixed with `n' -- are
- accepted. Does not consume a trailing underscore or other
- terminating character. */
-
-static status_t
-demangle_number_literally (dm, str, base, is_signed)
- demangling_t dm;
- dyn_string_t str;
- int base;
- int is_signed;
+/* <template-args> ::= I <template-arg>+ E */
+
+static struct d_comp *
+d_template_args (di)
+ struct d_info *di;
{
- DEMANGLE_TRACE ("number*", dm);
+ struct d_comp *hold_last_name;
+ struct d_comp *al;
+ struct d_comp **pal;
- if (base != 10 && base != 36)
- return STATUS_INTERNAL_ERROR;
+ /* Preserve the last name we saw--don't let the template arguments
+ clobber it, as that would give us the wrong name for a subsequent
+ constructor or destructor. */
+ hold_last_name = di->last_name;
- /* An `n' denotes a negative number. */
- if (is_signed && peek_char (dm) == 'n')
- {
- /* Skip past the n. */
- advance_char (dm);
- /* The normal way to write a negative number is with a minus
- sign. */
- if (!dyn_string_append_char (str, '-'))
- return STATUS_ALLOCATION_FAILED;
- }
+ if (d_next_char (di) != 'I')
+ return NULL;
- /* Loop until we hit a non-digit. */
+ al = NULL;
+ pal = &al;
while (1)
{
- char peek = peek_char (dm);
- if (IS_DIGIT ((unsigned char) peek)
- || (base == 36 && peek >= 'A' && peek <= 'Z'))
+ struct d_comp *a;
+
+ a = d_template_arg (di);
+ if (a == NULL)
+ return NULL;
+
+ *pal = d_make_comp (di, D_COMP_TEMPLATE_ARGLIST, a, NULL);
+ if (*pal == NULL)
+ return NULL;
+ pal = &d_right (*pal);
+
+ if (d_peek_char (di) == 'E')
{
- /* Accumulate digits. */
- if (!dyn_string_append_char (str, next_char (dm)))
- return STATUS_ALLOCATION_FAILED;
+ d_advance (di, 1);
+ break;
}
- else
- /* Not a digit? All done. */
- break;
}
- return STATUS_OK;
+ di->last_name = hold_last_name;
+
+ return al;
}
-/* Demangles an identifier at the current position of LENGTH
- characters and places it in IDENTIFIER. */
+/* <template-arg> ::= <type>
+ ::= X <expression> E
+ ::= <expr-primary>
+*/
-static status_t
-demangle_identifier (dm, length, identifier)
- demangling_t dm;
- int length;
- dyn_string_t identifier;
+static struct d_comp *
+d_template_arg (di)
+ struct d_info *di;
{
- DEMANGLE_TRACE ("identifier", dm);
+ struct d_comp *ret;
- dyn_string_clear (identifier);
- if (!dyn_string_resize (identifier, length))
- return STATUS_ALLOCATION_FAILED;
-
- while (length-- > 0)
+ switch (d_peek_char (di))
{
- int ch;
- if (end_of_name_p (dm))
- return "Unexpected end of name in <identifier>.";
- ch = next_char (dm);
-
- /* Handle extended Unicode characters. We encode them as __U{hex}_,
- where {hex} omits leading 0's. For instance, '$' is encoded as
- "__U24_". */
- if (ch == '_'
- && peek_char (dm) == '_'
- && peek_char_next (dm) == 'U')
- {
- char buf[10];
- int pos = 0;
- advance_char (dm); advance_char (dm); length -= 2;
- while (length-- > 0)
- {
- ch = next_char (dm);
- if (!isxdigit (ch))
- break;
- buf[pos++] = ch;
- }
- if (ch != '_' || length < 0)
- return STATUS_ERROR;
- if (pos == 0)
- {
- /* __U_ just means __U. */
- if (!dyn_string_append_cstr (identifier, "__U"))
- return STATUS_ALLOCATION_FAILED;
- continue;
- }
- else
- {
- buf[pos] = '\0';
- ch = strtol (buf, 0, 16);
- }
- }
+ case 'X':
+ d_advance (di, 1);
+ ret = d_expression (di);
+ if (d_next_char (di) != 'E')
+ return NULL;
+ return ret;
- if (!dyn_string_append_char (identifier, ch))
- return STATUS_ALLOCATION_FAILED;
- }
+ case 'L':
+ return d_expr_primary (di);
- /* GCC encodes anonymous namespaces using a `_GLOBAL_[_.$]N.'
- followed by the source file name and some random characters.
- Unless we're in strict mode, decipher these names appropriately. */
- if (!flag_strict)
- {
- char *name = dyn_string_buf (identifier);
- int prefix_length = strlen (ANONYMOUS_NAMESPACE_PREFIX);
-
- /* Compare the first, fixed part. */
- if (strncmp (name, ANONYMOUS_NAMESPACE_PREFIX, prefix_length) == 0)
- {
- name += prefix_length;
- /* The next character might be a period, an underscore, or
- dollar sign, depending on the target architecture's
- assembler's capabilities. After that comes an `N'. */
- if ((*name == '.' || *name == '_' || *name == '$')
- && *(name + 1) == 'N')
- /* This looks like the anonymous namespace identifier.
- Replace it with something comprehensible. */
- dyn_string_copy_cstr (identifier, "(anonymous namespace)");
- }
+ default:
+ return d_type (di);
}
-
- return STATUS_OK;
}
-/* Demangles and emits an <operator-name>. If SHORT_NAME is non-zero,
- the short form is emitted; otherwise the full source form
- (`operator +' etc.) is emitted. *NUM_ARGS is set to the number of
- operands that the operator takes. If TYPE_ARG is non-NULL,
- *TYPE_ARG is set to 1 if the first argument is a type and 0
- otherwise.
-
- <operator-name>
- ::= nw # new
- ::= na # new[]
- ::= dl # delete
- ::= da # delete[]
- ::= ps # + (unary)
- ::= ng # - (unary)
- ::= ad # & (unary)
- ::= de # * (unary)
- ::= co # ~
- ::= pl # +
- ::= mi # -
- ::= ml # *
- ::= dv # /
- ::= rm # %
- ::= an # &
- ::= or # |
- ::= eo # ^
- ::= aS # =
- ::= pL # +=
- ::= mI # -=
- ::= mL # *=
- ::= dV # /=
- ::= rM # %=
- ::= aN # &=
- ::= oR # |=
- ::= eO # ^=
- ::= ls # <<
- ::= rs # >>
- ::= lS # <<=
- ::= rS # >>=
- ::= eq # ==
- ::= ne # !=
- ::= lt # <
- ::= gt # >
- ::= le # <=
- ::= ge # >=
- ::= nt # !
- ::= aa # &&
- ::= oo # ||
- ::= pp # ++
- ::= mm # --
- ::= cm # ,
- ::= pm # ->*
- ::= pt # ->
- ::= cl # ()
- ::= ix # []
- ::= qu # ?
- ::= st # sizeof (a type)
- ::= sz # sizeof (an expression)
- ::= cv <type> # cast
- ::= v [0-9] <source-name> # vendor extended operator */
-
-static status_t
-demangle_operator_name (dm, short_name, num_args, type_arg)
- demangling_t dm;
- int short_name;
- int *num_args;
- int *type_arg;
+/* <expression> ::= <(unary) operator-name> <expression>
+ ::= <(binary) operator-name> <expression> <expression>
+ ::= <(trinary) operator-name> <expression> <expression> <expression>
+ ::= st <type>
+ ::= <template-param>
+ ::= sr <type> <unqualified-name>
+ ::= sr <type> <unqualified-name> <template-args>
+ ::= <expr-primary>
+*/
+
+static struct d_comp *
+d_expression (di)
+ struct d_info *di;
{
- struct operator_code
- {
- /* The mangled code for this operator. */
- const char *const code;
- /* The source name of this operator. */
- const char *const name;
- /* The number of arguments this operator takes. */
- const int num_args;
- };
-
- static const struct operator_code operators[] =
- {
- { "aN", "&=" , 2 },
- { "aS", "=" , 2 },
- { "aa", "&&" , 2 },
- { "ad", "&" , 1 },
- { "an", "&" , 2 },
- { "cl", "()" , 0 },
- { "cm", "," , 2 },
- { "co", "~" , 1 },
- { "dV", "/=" , 2 },
- { "da", " delete[]", 1 },
- { "de", "*" , 1 },
- { "dl", " delete" , 1 },
- { "dv", "/" , 2 },
- { "eO", "^=" , 2 },
- { "eo", "^" , 2 },
- { "eq", "==" , 2 },
- { "ge", ">=" , 2 },
- { "gt", ">" , 2 },
- { "ix", "[]" , 2 },
- { "lS", "<<=" , 2 },
- { "le", "<=" , 2 },
- { "ls", "<<" , 2 },
- { "lt", "<" , 2 },
- { "mI", "-=" , 2 },
- { "mL", "*=" , 2 },
- { "mi", "-" , 2 },
- { "ml", "*" , 2 },
- { "mm", "--" , 1 },
- { "na", " new[]" , 1 },
- { "ne", "!=" , 2 },
- { "ng", "-" , 1 },
- { "nt", "!" , 1 },
- { "nw", " new" , 1 },
- { "oR", "|=" , 2 },
- { "oo", "||" , 2 },
- { "or", "|" , 2 },
- { "pL", "+=" , 2 },
- { "pl", "+" , 2 },
- { "pm", "->*" , 2 },
- { "pp", "++" , 1 },
- { "ps", "+" , 1 },
- { "pt", "->" , 2 },
- { "qu", "?" , 3 },
- { "rM", "%=" , 2 },
- { "rS", ">>=" , 2 },
- { "rm", "%" , 2 },
- { "rs", ">>" , 2 },
- { "sz", " sizeof" , 1 }
- };
-
- const int num_operators =
- sizeof (operators) / sizeof (struct operator_code);
-
- int c0 = next_char (dm);
- int c1 = next_char (dm);
- const struct operator_code* p1 = operators;
- const struct operator_code* p2 = operators + num_operators;
-
- DEMANGLE_TRACE ("operator-name", dm);
-
- /* Assume the first argument is not a type. */
- if (type_arg)
- *type_arg = 0;
-
- /* Is this a vendor-extended operator? */
- if (c0 == 'v' && IS_DIGIT (c1))
- {
- RETURN_IF_ERROR (result_add (dm, "operator "));
- RETURN_IF_ERROR (demangle_source_name (dm));
- *num_args = 0;
- return STATUS_OK;
- }
+ char peek;
- /* Is this a conversion operator? */
- if (c0 == 'c' && c1 == 'v')
+ peek = d_peek_char (di);
+ if (peek == 'L')
+ return d_expr_primary (di);
+ else if (peek == 'T')
+ return d_template_param (di);
+ else if (peek == 's' && d_peek_next_char (di) == 'r')
{
- RETURN_IF_ERROR (result_add (dm, "operator "));
- /* Demangle the converted-to type. */
- RETURN_IF_ERROR (demangle_type (dm));
- *num_args = 0;
- return STATUS_OK;
+ struct d_comp *type;
+ struct d_comp *name;
+
+ d_advance (di, 2);
+ type = d_type (di);
+ name = d_unqualified_name (di);
+ if (d_peek_char (di) != 'I')
+ return d_make_comp (di, D_COMP_QUAL_NAME, type, name);
+ else
+ return d_make_comp (di, D_COMP_QUAL_NAME, type,
+ d_make_comp (di, D_COMP_TEMPLATE, name,
+ d_template_args (di)));
}
-
- /* Is it the sizeof variant that takes a type? */
- if (c0 == 's' && c1 == 't')
+ else
{
- RETURN_IF_ERROR (result_add (dm, " sizeof"));
- *num_args = 1;
- if (type_arg)
- *type_arg = 1;
- return STATUS_OK;
- }
+ struct d_comp *op;
+ int args;
- /* Perform a binary search for the operator code. */
- while (1)
- {
- const struct operator_code* p = p1 + (p2 - p1) / 2;
- char match0 = p->code[0];
- char match1 = p->code[1];
+ op = d_operator_name (di);
+ if (op == NULL)
+ return NULL;
- if (c0 == match0 && c1 == match1)
- /* Found it. */
- {
- if (!short_name)
- RETURN_IF_ERROR (result_add (dm, "operator"));
- RETURN_IF_ERROR (result_add (dm, p->name));
- *num_args = p->num_args;
+ if (op->type == D_COMP_OPERATOR)
+ di->expansion += op->u.s_operator.op->len - 2;
+
+ if (op->type == D_COMP_OPERATOR
+ && strcmp (op->u.s_operator.op->code, "st") == 0)
+ return d_make_comp (di, D_COMP_UNARY, op, d_type (di));
- return STATUS_OK;
+ switch (op->type)
+ {
+ default:
+ return NULL;
+ case D_COMP_OPERATOR:
+ args = op->u.s_operator.op->args;
+ break;
+ case D_COMP_EXTENDED_OPERATOR:
+ args = op->u.s_extended_operator.args;
+ break;
+ case D_COMP_CAST:
+ args = 1;
+ break;
}
- if (p == p1)
- /* Couldn't find it. */
- return "Unknown code in <operator-name>.";
+ switch (args)
+ {
+ case 1:
+ return d_make_comp (di, D_COMP_UNARY, op, d_expression (di));
+ case 2:
+ {
+ struct d_comp *left;
- /* Try again. */
- if (c0 < match0 || (c0 == match0 && c1 < match1))
- p2 = p;
- else
- p1 = p;
+ left = d_expression (di);
+ return d_make_comp (di, D_COMP_BINARY, op,
+ d_make_comp (di, D_COMP_BINARY_ARGS, left,
+ d_expression (di)));
+ }
+ case 3:
+ {
+ struct d_comp *first;
+ struct d_comp *second;
+
+ first = d_expression (di);
+ second = d_expression (di);
+ return d_make_comp (di, D_COMP_TRINARY, op,
+ d_make_comp (di, D_COMP_TRINARY_ARG1, first,
+ d_make_comp (di,
+ D_COMP_TRINARY_ARG2,
+ second,
+ d_expression (di))));
+ }
+ default:
+ return NULL;
+ }
}
}
-/* Demangles and omits an <nv-offset>.
-
- <nv-offset> ::= <offset number> # non-virtual base override */
+/* <expr-primary> ::= L <type> <(value) number> E
+ ::= L <type> <(value) float> E
+ ::= L <mangled-name> E
+*/
-static status_t
-demangle_nv_offset (dm)
- demangling_t dm;
+static struct d_comp *
+d_expr_primary (di)
+ struct d_info *di;
{
- dyn_string_t number;
- status_t status = STATUS_OK;
+ struct d_comp *ret;
- DEMANGLE_TRACE ("h-offset", dm);
-
- /* Demangle the offset. */
- number = dyn_string_new (4);
- if (number == NULL)
- return STATUS_ALLOCATION_FAILED;
- demangle_number_literally (dm, number, 10, 1);
-
- /* Don't display the offset unless in verbose mode. */
- if (flag_verbose)
+ if (d_next_char (di) != 'L')
+ return NULL;
+ if (d_peek_char (di) == '_')
+ ret = d_mangled_name (di, 0);
+ else
{
- status = result_add (dm, " [nv:");
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, number);
- if (STATUS_NO_ERROR (status))
- status = result_add_char (dm, ']');
+ struct d_comp *type;
+ enum d_comp_type t;
+ const char *s;
+
+ type = d_type (di);
+
+ /* If we have a type we know how to print, we aren't going to
+ print the type name itself. */
+ if (type->type == D_COMP_BUILTIN_TYPE
+ && type->u.s_builtin.type->print != D_PRINT_DEFAULT)
+ di->expansion -= type->u.s_builtin.type->len;
+
+ /* Rather than try to interpret the literal value, we just
+ collect it as a string. Note that it's possible to have a
+ floating point literal here. The ABI specifies that the
+ format of such literals is machine independent. That's fine,
+ but what's not fine is that versions of g++ up to 3.2 with
+ -fabi-version=1 used upper case letters in the hex constant,
+ and dumped out gcc's internal representation. That makes it
+ hard to tell where the constant ends, and hard to dump the
+ constant in any readable form anyhow. We don't attempt to
+ handle these cases. */
+
+ t = D_COMP_LITERAL;
+ if (d_peek_char (di) == 'n')
+ {
+ t = D_COMP_LITERAL_NEG;
+ d_advance (di, 1);
+ }
+ s = d_str (di);
+ while (d_peek_char (di) != 'E')
+ d_advance (di, 1);
+ ret = d_make_comp (di, t, type, d_make_name (di, s, d_str (di) - s));
}
-
- /* Clean up. */
- dyn_string_delete (number);
- RETURN_IF_ERROR (status);
- return STATUS_OK;
+ if (d_next_char (di) != 'E')
+ return NULL;
+ return ret;
}
-/* Demangles and emits a <v-offset>.
-
- <v-offset> ::= <offset number> _ <virtual offset number>
- # virtual base override, with vcall offset */
+/* <local-name> ::= Z <(function) encoding> E <(entity) name> [<discriminator>]
+ ::= Z <(function) encoding> E s [<discriminator>]
+*/
-static status_t
-demangle_v_offset (dm)
- demangling_t dm;
+static struct d_comp *
+d_local_name (di)
+ struct d_info *di;
{
- dyn_string_t number;
- status_t status = STATUS_OK;
-
- DEMANGLE_TRACE ("v-offset", dm);
+ struct d_comp *function;
- /* Demangle the offset. */
- number = dyn_string_new (4);
- if (number == NULL)
- return STATUS_ALLOCATION_FAILED;
- demangle_number_literally (dm, number, 10, 1);
-
- /* Don't display the offset unless in verbose mode. */
- if (flag_verbose)
- {
- status = result_add (dm, " [v:");
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, number);
- if (STATUS_NO_ERROR (status))
- result_add_char (dm, ',');
- }
- dyn_string_delete (number);
- RETURN_IF_ERROR (status);
+ if (d_next_char (di) != 'Z')
+ return NULL;
- /* Demangle the separator. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
+ function = d_encoding (di, 0);
- /* Demangle the vcall offset. */
- number = dyn_string_new (4);
- if (number == NULL)
- return STATUS_ALLOCATION_FAILED;
- demangle_number_literally (dm, number, 10, 1);
+ if (d_next_char (di) != 'E')
+ return NULL;
- /* Don't display the vcall offset unless in verbose mode. */
- if (flag_verbose)
+ if (d_peek_char (di) == 's')
{
- status = result_add_string (dm, number);
- if (STATUS_NO_ERROR (status))
- status = result_add_char (dm, ']');
+ d_advance (di, 1);
+ if (! d_discriminator (di))
+ return NULL;
+ return d_make_comp (di, D_COMP_LOCAL_NAME, function,
+ d_make_name (di, "string literal",
+ sizeof "string literal" - 1));
}
- dyn_string_delete (number);
- RETURN_IF_ERROR (status);
-
- return STATUS_OK;
-}
-
-/* Demangles and emits a <call-offset>.
-
- <call-offset> ::= h <nv-offset> _
- ::= v <v-offset> _ */
-
-static status_t
-demangle_call_offset (dm)
- demangling_t dm;
-{
- DEMANGLE_TRACE ("call-offset", dm);
-
- switch (peek_char (dm))
+ else
{
- case 'h':
- advance_char (dm);
- /* Demangle the offset. */
- RETURN_IF_ERROR (demangle_nv_offset (dm));
- /* Demangle the separator. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- break;
-
- case 'v':
- advance_char (dm);
- /* Demangle the offset. */
- RETURN_IF_ERROR (demangle_v_offset (dm));
- /* Demangle the separator. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- break;
+ struct d_comp *name;
- default:
- return "Unrecognized <call-offset>.";
+ name = d_name (di);
+ if (! d_discriminator (di))
+ return NULL;
+ return d_make_comp (di, D_COMP_LOCAL_NAME, function, name);
}
-
- return STATUS_OK;
}
-/* Demangles and emits a <special-name>.
-
- <special-name> ::= GV <object name> # Guard variable
- ::= TV <type> # virtual table
- ::= TT <type> # VTT
- ::= TI <type> # typeinfo structure
- ::= TS <type> # typeinfo name
+/* <discriminator> ::= _ <(non-negative) number>
- Other relevant productions include thunks:
+ We demangle the discriminator, but we don't print it out. FIXME:
+ We should print it out in verbose mode. */
- <special-name> ::= T <call-offset> <base encoding>
- # base is the nominal target function of thunk
-
- <special-name> ::= Tc <call-offset> <call-offset> <base encoding>
- # base is the nominal target function of thunk
- # first call-offset is 'this' adjustment
- # second call-offset is result adjustment
+static int
+d_discriminator (di)
+ struct d_info *di;
+{
+ long discrim;
- where
+ if (d_peek_char (di) != '_')
+ return 1;
+ d_advance (di, 1);
+ discrim = d_number (di);
+ if (discrim < 0)
+ return 0;
+ return 1;
+}
- <call-offset> ::= h <nv-offset> _
- ::= v <v-offset> _
+/* Add a new substitution. */
- Also demangles the special g++ manglings,
+static int
+d_add_substitution (di, dc)
+ struct d_info *di;
+ struct d_comp *dc;
+{
+ if (dc == NULL)
+ return 0;
+ if (di->next_sub >= di->num_subs)
+ return 0;
+ di->subs[di->next_sub] = dc;
+ ++di->next_sub;
+ return 1;
+}
- <special-name> ::= TC <type> <offset number> _ <base type>
- # construction vtable
- ::= TF <type> # typeinfo function (old ABI only)
- ::= TJ <type> # java Class structure */
+/* <substitution> ::= S <seq-id> _
+ ::= S_
+ ::= St
+ ::= Sa
+ ::= Sb
+ ::= Ss
+ ::= Si
+ ::= So
+ ::= Sd
+
+ If PREFIX is non-zero, then this type is being used as a prefix in
+ a qualified name. In this case, for the standard substitutions, we
+ need to check whether we are being used as a prefix for a
+ constructor or destructor, and return a full template name.
+ Otherwise we will get something like std::iostream::~iostream()
+ which does not correspond particularly well to any function which
+ actually appears in the source.
+*/
-static status_t
-demangle_special_name (dm)
- demangling_t dm;
+static const struct d_standard_sub_info standard_subs[] =
{
- dyn_string_t number;
- int unused;
- char peek = peek_char (dm);
+ { 't', NL ("std"),
+ NL ("std"),
+ NULL, 0 },
+ { 'a', NL ("std::allocator"),
+ NL ("std::allocator"),
+ NL ("allocator") },
+ { 'b', NL ("std::basic_string"),
+ NL ("std::basic_string"),
+ NL ("basic_string") },
+ { 's', NL ("std::string"),
+ NL ("std::basic_string<char, std::char_traits<char>, std::allocator<char> >"),
+ NL ("basic_string") },
+ { 'i', NL ("std::istream"),
+ NL ("std::basic_istream<char, std::char_traits<char> >"),
+ NL ("basic_istream") },
+ { 'o', NL ("std::ostream"),
+ NL ("std::basic_ostream<char, std::char_traits<char> >"),
+ NL ("basic_ostream") },
+ { 'd', NL ("std::iostream"),
+ NL ("std::basic_iostream<char, std::char_traits<char> >"),
+ NL ("basic_iostream") }
+};
- DEMANGLE_TRACE ("special-name", dm);
+static struct d_comp *
+d_substitution (di, prefix)
+ struct d_info *di;
+ int prefix;
+{
+ char c;
- if (peek == 'G')
- {
- /* Consume the G. */
- advance_char (dm);
- switch (peek_char (dm))
- {
- case 'V':
- /* A guard variable name. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "guard variable for "));
- RETURN_IF_ERROR (demangle_name (dm, &unused));
- break;
+ if (d_next_char (di) != 'S')
+ return NULL;
- case 'R':
- /* A reference temporary. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "reference temporary for "));
- RETURN_IF_ERROR (demangle_name (dm, &unused));
- break;
-
- default:
- return "Unrecognized <special-name>.";
- }
- }
- else if (peek == 'T')
+ c = d_next_char (di);
+ if (c == '_' || IS_DIGIT (c) || IS_UPPER (c))
{
- status_t status = STATUS_OK;
+ int id;
- /* Other C++ implementation miscellania. Consume the T. */
- advance_char (dm);
-
- switch (peek_char (dm))
+ id = 0;
+ if (c != '_')
{
- case 'V':
- /* Virtual table. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "vtable for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
-
- case 'T':
- /* VTT structure. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "VTT for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
-
- case 'I':
- /* Typeinfo structure. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "typeinfo for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ do
+ {
+ if (IS_DIGIT (c))
+ id = id * 36 + c - '0';
+ else if (IS_UPPER (c))
+ id = id * 36 + c - 'A' + 10;
+ else
+ return NULL;
+ c = d_next_char (di);
+ }
+ while (c != '_');
- case 'F':
- /* Typeinfo function. Used only in old ABI with new mangling. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "typeinfo fn for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ ++id;
+ }
- case 'S':
- /* Character string containing type name, used in typeinfo. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "typeinfo name for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ if (id >= di->next_sub)
+ return NULL;
- case 'J':
- /* The java Class variable corresponding to a C++ class. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "java Class for "));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ ++di->did_subs;
- case 'h':
- /* Non-virtual thunk. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "non-virtual thunk"));
- RETURN_IF_ERROR (demangle_nv_offset (dm));
- /* Demangle the separator. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- /* Demangle and emit the target name and function type. */
- RETURN_IF_ERROR (result_add (dm, " to "));
- RETURN_IF_ERROR (demangle_encoding (dm));
- break;
+ return di->subs[id];
+ }
+ else
+ {
+ int verbose;
+ const struct d_standard_sub_info *p;
+ const struct d_standard_sub_info *pend;
- case 'v':
- /* Virtual thunk. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "virtual thunk"));
- RETURN_IF_ERROR (demangle_v_offset (dm));
- /* Demangle the separator. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- /* Demangle and emit the target function. */
- RETURN_IF_ERROR (result_add (dm, " to "));
- RETURN_IF_ERROR (demangle_encoding (dm));
- break;
+ verbose = (di->options & DMGL_VERBOSE) != 0;
+ if (! verbose && prefix)
+ {
+ char peek;
- case 'c':
- /* Covariant return thunk. */
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "covariant return thunk"));
- RETURN_IF_ERROR (demangle_call_offset (dm));
- RETURN_IF_ERROR (demangle_call_offset (dm));
- /* Demangle and emit the target function. */
- RETURN_IF_ERROR (result_add (dm, " to "));
- RETURN_IF_ERROR (demangle_encoding (dm));
- break;
+ peek = d_peek_char (di);
+ if (peek == 'C' || peek == 'D')
+ verbose = 1;
+ }
- case 'C':
- /* TC is a special g++ mangling for a construction vtable. */
- if (!flag_strict)
+ pend = (&standard_subs[0]
+ + sizeof standard_subs / sizeof standard_subs[0]);
+ for (p = &standard_subs[0]; p < pend; ++p)
+ {
+ if (c == p->code)
{
- dyn_string_t derived_type;
-
- advance_char (dm);
- RETURN_IF_ERROR (result_add (dm, "construction vtable for "));
-
- /* Demangle the derived type off to the side. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_type (dm));
- derived_type = (dyn_string_t) result_pop (dm);
+ const char *s;
+ int len;
- /* Demangle the offset. */
- number = dyn_string_new (4);
- if (number == NULL)
+ if (p->set_last_name != NULL)
+ di->last_name = d_make_sub (di, p->set_last_name,
+ p->set_last_name_len);
+ if (verbose)
{
- dyn_string_delete (derived_type);
- return STATUS_ALLOCATION_FAILED;
+ s = p->full_expansion;
+ len = p->full_len;
}
- demangle_number_literally (dm, number, 10, 1);
- /* Demangle the underscore separator. */
- status = demangle_char (dm, '_');
-
- /* Demangle the base type. */
- if (STATUS_NO_ERROR (status))
- status = demangle_type (dm);
-
- /* Emit the derived type. */
- if (STATUS_NO_ERROR (status))
- status = result_add (dm, "-in-");
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, derived_type);
- dyn_string_delete (derived_type);
-
- /* Don't display the offset unless in verbose mode. */
- if (flag_verbose)
+ else
{
- status = result_add_char (dm, ' ');
- if (STATUS_NO_ERROR (status))
- result_add_string (dm, number);
+ s = p->simple_expansion;
+ len = p->simple_len;
}
- dyn_string_delete (number);
- RETURN_IF_ERROR (status);
- break;
+ di->expansion += len;
+ return d_make_sub (di, s, len);
}
- /* If flag_strict, fall through. */
-
- default:
- return "Unrecognized <special-name>.";
}
- }
- else
- return STATUS_ERROR;
- return STATUS_OK;
+ return NULL;
+ }
}
-/* Demangles and emits a <ctor-dtor-name>.
-
- <ctor-dtor-name>
- ::= C1 # complete object (in-charge) ctor
- ::= C2 # base object (not-in-charge) ctor
- ::= C3 # complete object (in-charge) allocating ctor
- ::= D0 # deleting (in-charge) dtor
- ::= D1 # complete object (in-charge) dtor
- ::= D2 # base object (not-in-charge) dtor */
-
-static status_t
-demangle_ctor_dtor_name (dm)
- demangling_t dm;
-{
- static const char *const ctor_flavors[] =
- {
- "in-charge",
- "not-in-charge",
- "allocating"
- };
- static const char *const dtor_flavors[] =
- {
- "in-charge deleting",
- "in-charge",
- "not-in-charge"
- };
+/* Resize the print buffer. */
- int flavor;
- char peek = peek_char (dm);
+static void
+d_print_resize (dpi, add)
+ struct d_print_info *dpi;
+ size_t add;
+{
+ size_t need;
- DEMANGLE_TRACE ("ctor-dtor-name", dm);
-
- if (peek == 'C')
+ if (dpi->buf == NULL)
+ return;
+ need = dpi->len + add;
+ while (need > dpi->alc)
{
- /* A constructor name. Consume the C. */
- advance_char (dm);
- 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. */
- if (flag_verbose)
+ size_t newalc;
+ char *newbuf;
+
+ newalc = dpi->alc * 2;
+ newbuf = realloc (dpi->buf, newalc);
+ if (newbuf == NULL)
{
- RETURN_IF_ERROR (result_add (dm, "["));
- RETURN_IF_ERROR (result_add (dm, ctor_flavors[flavor - '1']));
- RETURN_IF_ERROR (result_add_char (dm, ']'));
+ free (dpi->buf);
+ dpi->buf = NULL;
+ dpi->allocation_failure = 1;
+ return;
}
+ dpi->buf = newbuf;
+ dpi->alc = newalc;
}
- else if (peek == 'D')
+}
+
+/* Append a character to the print buffer. */
+
+static void
+d_print_append_char (dpi, c)
+ struct d_print_info *dpi;
+ int c;
+{
+ if (dpi->buf != NULL)
{
- /* A destructor name. Consume the D. */
- advance_char (dm);
- 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)
+ if (dpi->len >= dpi->alc)
{
- 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;
+ d_print_resize (dpi, 1);
+ if (dpi->buf == NULL)
+ return;
}
- /* Print the flavor of the destructor if in verbose mode. */
- if (flag_verbose)
+
+ dpi->buf[dpi->len] = c;
+ ++dpi->len;
+ }
+}
+
+/* Append a buffer to the print buffer. */
+
+static void
+d_print_append_buffer (dpi, s, l)
+ struct d_print_info *dpi;
+ const char *s;
+ size_t l;
+{
+ if (dpi->buf != NULL)
+ {
+ if (dpi->len + l > dpi->alc)
{
- RETURN_IF_ERROR (result_add (dm, " ["));
- RETURN_IF_ERROR (result_add (dm, dtor_flavors[flavor - '0']));
- RETURN_IF_ERROR (result_add_char (dm, ']'));
+ d_print_resize (dpi, l);
+ if (dpi->buf == NULL)
+ return;
}
+
+ memcpy (dpi->buf + dpi->len, s, l);
+ dpi->len += l;
}
- else
- return STATUS_ERROR;
+}
+
+/* Indicate that an error occurred during printing. */
- return STATUS_OK;
+static void
+d_print_error (dpi)
+ struct d_print_info *dpi;
+{
+ free (dpi->buf);
+ dpi->buf = NULL;
}
-/* Handle pointer, reference, and pointer-to-member cases for
- demangle_type. All consecutive `P's, `R's, and 'M's are joined to
- build a pointer/reference type. We snarf all these, plus the
- following <type>, all at once since we need to know whether we have
- a pointer to data or pointer to function to construct the right
- output syntax. C++'s pointer syntax is hairy.
-
- This function adds substitution candidates for every nested
- pointer/reference type it processes, including the outermost, final
- type, assuming the substitution starts at SUBSTITUTION_START in the
- demangling result. For example, if this function demangles
- `PP3Foo', it will add a substitution for `Foo', `Foo*', and
- `Foo**', in that order.
-
- *INSERT_POS is a quantity used internally, when this function calls
- itself recursively, to figure out where to insert pointer
- punctuation on the way up. On entry to this function, INSERT_POS
- should point to a temporary value, but that value need not be
- initialized.
-
- <type> ::= P <type>
- ::= R <type>
- ::= <pointer-to-member-type>
-
- <pointer-to-member-type> ::= M </class/ type> </member/ type> */
-
-static status_t
-demangle_type_ptr (dm, insert_pos, substitution_start)
- demangling_t dm;
- int *insert_pos;
- int substitution_start;
+/* Turn components into a human readable string. OPTIONS is the
+ options bits passed to the demangler. DC is the tree to print.
+ ESTIMATE is a guess at the length of the result. This returns a
+ string allocated by malloc, or NULL on error. On success, this
+ sets *PALC to the size of the allocated buffer. On failure, this
+ sets *PALC to 0 for a bad parse, or to 1 for a memory allocation
+ failure. */
+
+static char *
+d_print (options, dc, estimate, palc)
+ int options;
+ const struct d_comp *dc;
+ int estimate;
+ size_t *palc;
{
- status_t status;
- int is_substitution_candidate = 1;
+ struct d_print_info dpi;
- DEMANGLE_TRACE ("type*", dm);
+ dpi.options = options;
- /* Scan forward, collecting pointers and references into symbols,
- until we hit something else. Then emit the type. */
- switch (peek_char (dm))
+ dpi.alc = estimate + 1;
+ dpi.buf = malloc (dpi.alc);
+ if (dpi.buf == NULL)
{
- case 'P':
- /* A pointer. Snarf the `P'. */
- advance_char (dm);
- /* Demangle the underlying type. */
- RETURN_IF_ERROR (demangle_type_ptr (dm, insert_pos,
- substitution_start));
- /* Insert an asterisk where we're told to; it doesn't
- necessarily go at the end. If we're doing Java style output,
- there is no pointer symbol. */
- if (dm->style != DMGL_JAVA)
- RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '*'));
- /* The next (outermost) pointer or reference character should go
- after this one. */
- ++(*insert_pos);
- break;
+ *palc = 1;
+ return NULL;
+ }
- case 'R':
- /* A reference. Snarf the `R'. */
- advance_char (dm);
- /* Demangle the underlying type. */
- RETURN_IF_ERROR (demangle_type_ptr (dm, insert_pos,
- substitution_start));
- /* Insert an ampersand where we're told to; it doesn't
- necessarily go at the end. */
- RETURN_IF_ERROR (result_insert_char (dm, *insert_pos, '&'));
- /* The next (outermost) pointer or reference character should go
- after this one. */
- ++(*insert_pos);
- break;
+ dpi.len = 0;
+ dpi.templates = NULL;
+ dpi.modifiers = NULL;
- case 'M':
- {
- /* A pointer-to-member. */
- dyn_string_t class_type;
-
- /* Eat the 'M'. */
- advance_char (dm);
-
- /* Capture the type of which this is a pointer-to-member. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_type (dm));
- class_type = (dyn_string_t) result_pop (dm);
-
- if (peek_char (dm) == 'F')
- /* A pointer-to-member function. We want output along the
- lines of `void (C::*) (int, int)'. Demangle the function
- type, which would in this case give `void () (int, int)'
- and set *insert_pos to the spot between the first
- parentheses. */
- status = demangle_type_ptr (dm, insert_pos, substitution_start);
- else if (peek_char (dm) == 'A')
- /* A pointer-to-member array variable. We want output that
- looks like `int (Klass::*) [10]'. Demangle the array type
- as `int () [10]', and set *insert_pos to the spot between
- the parentheses. */
- status = demangle_array_type (dm, insert_pos);
- else
- {
- /* A pointer-to-member variable. Demangle the type of the
- pointed-to member. */
- status = demangle_type (dm);
- /* Make it pretty. */
- if (STATUS_NO_ERROR (status)
- && !result_previous_char_is_space (dm))
- status = result_add_char (dm, ' ');
- /* The pointer-to-member notation (e.g. `C::*') follows the
- member's type. */
- *insert_pos = result_caret_pos (dm);
- }
+ dpi.allocation_failure = 0;
- /* Build the pointer-to-member notation. */
- if (STATUS_NO_ERROR (status))
- status = result_insert (dm, *insert_pos, "::*");
- if (STATUS_NO_ERROR (status))
- status = result_insert_string (dm, *insert_pos, class_type);
- /* There may be additional levels of (pointer or reference)
- indirection in this type. If so, the `*' and `&' should be
- added after the pointer-to-member notation (e.g. `C::*&' for
- a reference to a pointer-to-member of class C). */
- *insert_pos += dyn_string_length (class_type) + 3;
-
- /* Clean up. */
- dyn_string_delete (class_type);
-
- RETURN_IF_ERROR (status);
- }
- break;
+ d_print_comp (&dpi, dc);
- case 'F':
- /* Ooh, tricky, a pointer-to-function. When we demangle the
- function type, the return type should go at the very
- beginning. */
- *insert_pos = result_caret_pos (dm);
- /* The parentheses indicate this is a function pointer or
- reference type. */
- RETURN_IF_ERROR (result_add (dm, "()"));
- /* Now demangle the function type. The return type will be
- inserted before the `()', and the argument list will go after
- it. */
- RETURN_IF_ERROR (demangle_function_type (dm, insert_pos));
- /* We should now have something along the lines of
- `void () (int, int)'. The pointer or reference characters
- have to inside the first set of parentheses. *insert_pos has
- already been updated to point past the end of the return
- type. Move it one character over so it points inside the
- `()'. */
- ++(*insert_pos);
- break;
+ d_append_char (&dpi, '\0');
- case 'A':
- /* An array pointer or reference. demangle_array_type will figure
- out where the asterisks and ampersands go. */
- RETURN_IF_ERROR (demangle_array_type (dm, insert_pos));
- break;
+ if (dpi.buf != NULL)
+ *palc = dpi.alc;
+ else
+ *palc = dpi.allocation_failure;
- default:
- /* No more pointer or reference tokens; this is therefore a
- pointer to data. Finish up by demangling the underlying
- type. */
- RETURN_IF_ERROR (demangle_type (dm));
- /* The pointer or reference characters follow the underlying
- type, as in `int*&'. */
- *insert_pos = result_caret_pos (dm);
- /* Because of the production <type> ::= <substitution>,
- demangle_type will already have added the underlying type as
- a substitution candidate. Don't do it again. */
- is_substitution_candidate = 0;
- break;
- }
-
- if (is_substitution_candidate)
- RETURN_IF_ERROR (substitution_add (dm, substitution_start, 0));
-
- return STATUS_OK;
+ return dpi.buf;
}
-/* Demangles and emits a <type>.
-
- <type> ::= <builtin-type>
- ::= <function-type>
- ::= <class-enum-type>
- ::= <array-type>
- ::= <pointer-to-member-type>
- ::= <template-param>
- ::= <template-template-param> <template-args>
- ::= <CV-qualifiers> <type>
- ::= P <type> # pointer-to
- ::= R <type> # reference-to
- ::= C <type> # complex pair (C 2000)
- ::= G <type> # imaginary (C 2000)
- ::= U <source-name> <type> # vendor extended type qualifier
- ::= <substitution> */
-
-static status_t
-demangle_type (dm)
- demangling_t dm;
+/* Subroutine to handle components. */
+
+static void
+d_print_comp (dpi, dc)
+ struct d_print_info *dpi;
+ const struct d_comp *dc;
{
- int start = substitution_start (dm);
- char peek = peek_char (dm);
- char peek_next;
- int encode_return_type = 0;
- template_arg_list_t old_arg_list = current_template_arg_list (dm);
- int insert_pos;
-
- /* A <type> can be a <substitution>; therefore, this <type> is a
- substitution candidate unless a special condition holds (see
- below). */
- int is_substitution_candidate = 1;
-
- DEMANGLE_TRACE ("type", dm);
-
- /* A <class-enum-type> can start with a digit (a <source-name>), an
- N (a <nested-name>), or a Z (a <local-name>). */
- if (IS_DIGIT ((unsigned char) peek) || peek == 'N' || peek == 'Z')
- RETURN_IF_ERROR (demangle_class_enum_type (dm, &encode_return_type));
- /* Lower-case letters begin <builtin-type>s, except for `r', which
- denotes restrict. */
- else if (peek >= 'a' && peek <= 'z' && peek != 'r')
+ if (dc == NULL)
{
- RETURN_IF_ERROR (demangle_builtin_type (dm));
- /* Built-in types are not substitution candidates. */
- is_substitution_candidate = 0;
+ d_print_error (dpi);
+ return;
}
- else
- switch (peek)
- {
- case 'r':
- case 'V':
- case 'K':
- /* CV-qualifiers (including restrict). We have to demangle
- them off to the side, since C++ syntax puts them in a funny
- place for qualified pointer and reference types. */
- {
- status_t status;
- dyn_string_t cv_qualifiers = dyn_string_new (24);
- int old_caret_position = result_get_caret (dm);
-
- if (cv_qualifiers == NULL)
- return STATUS_ALLOCATION_FAILED;
-
- /* Decode all adjacent CV qualifiers. */
- demangle_CV_qualifiers (dm, cv_qualifiers);
- /* Emit them, and shift the caret left so that the
- underlying type will be emitted before the qualifiers. */
- status = result_add_string (dm, cv_qualifiers);
- result_shift_caret (dm, -dyn_string_length (cv_qualifiers));
- /* Clean up. */
- dyn_string_delete (cv_qualifiers);
- RETURN_IF_ERROR (status);
- /* Also prepend a blank, if needed. */
- RETURN_IF_ERROR (result_add_char (dm, ' '));
- result_shift_caret (dm, -1);
-
- /* Demangle the underlying type. It will be emitted before
- the CV qualifiers, since we moved the caret. */
- RETURN_IF_ERROR (demangle_type (dm));
-
- /* Put the caret back where it was previously. */
- result_set_caret (dm, old_caret_position);
- }
- break;
+ if (d_print_saw_error (dpi))
+ return;
- case 'F':
- return "Non-pointer or -reference function type.";
+ switch (dc->type)
+ {
+ case D_COMP_NAME:
+ if ((dpi->options & DMGL_JAVA) == 0)
+ d_append_buffer (dpi, dc->u.s_name.s, dc->u.s_name.len);
+ else
+ d_print_java_identifier (dpi, dc->u.s_name.s, dc->u.s_name.len);
+ return;
+
+ case D_COMP_QUAL_NAME:
+ case D_COMP_LOCAL_NAME:
+ d_print_comp (dpi, d_left (dc));
+ if ((dpi->options & DMGL_JAVA) == 0)
+ d_append_string_constant (dpi, "::");
+ else
+ d_append_char (dpi, '.');
+ d_print_comp (dpi, d_right (dc));
+ return;
- case 'A':
- RETURN_IF_ERROR (demangle_array_type (dm, NULL));
- break;
+ case D_COMP_TYPED_NAME:
+ {
+ struct d_print_mod *hold_modifiers;
+ struct d_comp *typed_name;
+ struct d_print_mod adpm[4];
+ unsigned int i;
+ struct d_print_template dpt;
+
+ /* Pass the name down to the type so that it can be printed in
+ the right place for the type. We also have to pass down
+ any CV-qualifiers, which apply to the this parameter. */
+ hold_modifiers = dpi->modifiers;
+ i = 0;
+ typed_name = d_left (dc);
+ while (typed_name != NULL)
+ {
+ if (i >= sizeof adpm / sizeof adpm[0])
+ {
+ d_print_error (dpi);
+ return;
+ }
+
+ adpm[i].next = dpi->modifiers;
+ dpi->modifiers = &adpm[i];
+ adpm[i].mod = typed_name;
+ adpm[i].printed = 0;
+ adpm[i].templates = dpi->templates;
+ ++i;
+
+ if (typed_name->type != D_COMP_RESTRICT_THIS
+ && typed_name->type != D_COMP_VOLATILE_THIS
+ && typed_name->type != D_COMP_CONST_THIS)
+ break;
- case 'T':
- /* It's either a <template-param> or a
- <template-template-param>. In either case, demangle the
- `T' token first. */
- RETURN_IF_ERROR (demangle_template_param (dm));
+ typed_name = d_left (typed_name);
+ }
- /* Check for a template argument list; if one is found, it's a
- <template-template-param> ::= <template-param>
- ::= <substitution> */
- if (peek_char (dm) == 'I')
+ /* If typed_name is a template, then it applies to the
+ function type as well. */
+ if (typed_name->type == D_COMP_TEMPLATE)
{
- /* Add a substitution candidate. The template parameter
- `T' token is a substitution candidate by itself,
- without the template argument list. */
- RETURN_IF_ERROR (substitution_add (dm, start, encode_return_type));
-
- /* Now demangle the template argument list. */
- RETURN_IF_ERROR (demangle_template_args (dm));
- /* The entire type, including the template template
- parameter and its argument list, will be added as a
- substitution candidate below. */
+ dpt.next = dpi->templates;
+ dpi->templates = &dpt;
+ dpt.template = typed_name;
}
- break;
-
- case 'S':
- /* First check if this is a special substitution. If it is,
- this is a <class-enum-type>. Special substitutions have a
- letter following the `S'; other substitutions have a digit
- or underscore. */
- peek_next = peek_char_next (dm);
- if (IS_DIGIT (peek_next) || peek_next == '_')
+ /* If typed_name is a D_COMP_LOCAL_NAME, then there may be
+ CV-qualifiers on its right argument which really apply
+ here; this happens when parsing a class which is local to a
+ function. */
+ if (typed_name->type == D_COMP_LOCAL_NAME)
{
- RETURN_IF_ERROR (demangle_substitution (dm, &encode_return_type));
-
- /* The substituted name may have been a template name.
- Check if template arguments follow, and if so, demangle
- them. */
- if (peek_char (dm) == 'I')
- RETURN_IF_ERROR (demangle_template_args (dm));
- else
- /* A substitution token is not itself a substitution
- candidate. (However, if the substituted template is
- instantiated, the resulting type is.) */
- is_substitution_candidate = 0;
+ struct d_comp *local_name;
+
+ local_name = d_right (typed_name);
+ while (local_name->type == D_COMP_RESTRICT_THIS
+ || local_name->type == D_COMP_VOLATILE_THIS
+ || local_name->type == D_COMP_CONST_THIS)
+ {
+ if (i >= sizeof adpm / sizeof adpm[0])
+ {
+ d_print_error (dpi);
+ return;
+ }
+
+ adpm[i] = adpm[i - 1];
+ adpm[i].next = &adpm[i - 1];
+ dpi->modifiers = &adpm[i];
+
+ adpm[i - 1].mod = local_name;
+ adpm[i - 1].printed = 0;
+ adpm[i - 1].templates = dpi->templates;
+ ++i;
+
+ local_name = d_left (local_name);
+ }
}
- else
+
+ d_print_comp (dpi, d_right (dc));
+
+ if (typed_name->type == D_COMP_TEMPLATE)
+ dpi->templates = dpt.next;
+
+ /* If the modifiers didn't get printed by the type, print them
+ now. */
+ while (i > 0)
{
- /* Now some trickiness. We have a special substitution
- here. Often, the special substitution provides the
- name of a template that's subsequently instantiated,
- for instance `SaIcE' => std::allocator<char>. In these
- cases we need to add a substitution candidate for the
- entire <class-enum-type> and thus don't want to clear
- the is_substitution_candidate flag.
-
- However, it's possible that what we have here is a
- substitution token representing an entire type, such as
- `Ss' => std::string. In this case, we mustn't add a
- new substitution candidate for this substitution token.
- To detect this case, remember where the start of the
- substitution token is. */
- const char *next = dm->next;
- /* Now demangle the <class-enum-type>. */
- RETURN_IF_ERROR
- (demangle_class_enum_type (dm, &encode_return_type));
- /* If all that was just demangled is the two-character
- special substitution token, supress the addition of a
- new candidate for it. */
- if (dm->next == next + 2)
- is_substitution_candidate = 0;
+ --i;
+ if (! adpm[i].printed)
+ {
+ d_append_char (dpi, ' ');
+ d_print_mod (dpi, adpm[i].mod);
+ }
}
- break;
+ dpi->modifiers = hold_modifiers;
- case 'P':
- case 'R':
- case 'M':
- RETURN_IF_ERROR (demangle_type_ptr (dm, &insert_pos, start));
- /* demangle_type_ptr adds all applicable substitution
- candidates. */
- is_substitution_candidate = 0;
- break;
+ return;
+ }
- case 'C':
- /* A C99 complex type. */
- RETURN_IF_ERROR (result_add (dm, "complex "));
- advance_char (dm);
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ case D_COMP_TEMPLATE:
+ {
+ struct d_print_mod *hold_dpm;
- case 'G':
- /* A C99 imaginary type. */
- RETURN_IF_ERROR (result_add (dm, "imaginary "));
- advance_char (dm);
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ /* Don't push modifiers into a template definition. Doing so
+ could give the wrong definition for a template argument.
+ Instead, treat the template essentially as a name. */
- case 'U':
- /* Vendor-extended type qualifier. */
- advance_char (dm);
- RETURN_IF_ERROR (demangle_source_name (dm));
- RETURN_IF_ERROR (result_add_char (dm, ' '));
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ hold_dpm = dpi->modifiers;
+ dpi->modifiers = NULL;
- default:
- return "Unexpected character in <type>.";
- }
+ d_print_comp (dpi, d_left (dc));
+ if (d_last_char (dpi) == '<')
+ d_append_char (dpi, ' ');
+ d_append_char (dpi, '<');
+ d_print_comp (dpi, d_right (dc));
+ /* Avoid generating two consecutive '>' characters, to avoid
+ the C++ syntactic ambiguity. */
+ if (d_last_char (dpi) == '>')
+ d_append_char (dpi, ' ');
+ d_append_char (dpi, '>');
- if (is_substitution_candidate)
- /* Add a new substitution for the type. If this type was a
- <template-param>, pass its index since from the point of
- substitutions; a <template-param> token is a substitution
- candidate distinct from the type that is substituted for it. */
- RETURN_IF_ERROR (substitution_add (dm, start, encode_return_type));
+ dpi->modifiers = hold_dpm;
- /* Pop off template argument lists added during mangling of this
- type. */
- pop_to_template_arg_list (dm, old_arg_list);
+ return;
+ }
- return STATUS_OK;
-}
+ case D_COMP_TEMPLATE_PARAM:
+ {
+ long i;
+ struct d_comp *a;
+ struct d_print_template *hold_dpt;
-/* C++ source names of builtin types, indexed by the mangled code
- letter's position in the alphabet ('a' -> 0, 'b' -> 1, etc). */
-static const char *const builtin_type_names[26] =
-{
- "signed char", /* a */
- "bool", /* b */
- "char", /* c */
- "double", /* d */
- "long double", /* e */
- "float", /* f */
- "__float128", /* g */
- "unsigned char", /* h */
- "int", /* i */
- "unsigned", /* j */
- NULL, /* k */
- "long", /* l */
- "unsigned long", /* m */
- "__int128", /* n */
- "unsigned __int128", /* o */
- NULL, /* p */
- NULL, /* q */
- NULL, /* r */
- "short", /* s */
- "unsigned short", /* t */
- NULL, /* u */
- "void", /* v */
- "wchar_t", /* w */
- "long long", /* x */
- "unsigned long long", /* y */
- "..." /* z */
-};
+ if (dpi->templates == NULL)
+ {
+ d_print_error (dpi);
+ return;
+ }
+ i = dc->u.s_number.number;
+ for (a = d_right (dpi->templates->template);
+ a != NULL;
+ a = d_right (a))
+ {
+ if (a->type != D_COMP_TEMPLATE_ARGLIST)
+ {
+ d_print_error (dpi);
+ return;
+ }
+ if (i <= 0)
+ break;
+ --i;
+ }
+ if (i != 0 || a == NULL)
+ {
+ d_print_error (dpi);
+ return;
+ }
-/* Java source names of builtin types. Types that arn't valid in Java
- are also included here - we don't fail if someone attempts to demangle a
- C++ symbol in Java style. */
-static const char *const java_builtin_type_names[26] =
-{
- "signed char", /* a */
- "boolean", /* C++ "bool" */ /* b */
- "byte", /* C++ "char" */ /* c */
- "double", /* d */
- "long double", /* e */
- "float", /* f */
- "__float128", /* g */
- "unsigned char", /* h */
- "int", /* i */
- "unsigned", /* j */
- NULL, /* k */
- "long", /* l */
- "unsigned long", /* m */
- "__int128", /* n */
- "unsigned __int128", /* o */
- NULL, /* p */
- NULL, /* q */
- NULL, /* r */
- "short", /* s */
- "unsigned short", /* t */
- NULL, /* u */
- "void", /* v */
- "char", /* C++ "wchar_t" */ /* w */
- "long", /* C++ "long long" */ /* x */
- "unsigned long long", /* y */
- "..." /* z */
-};
+ /* While processing this parameter, we need to pop the list of
+ templates. This is because the template parameter may
+ itself be a reference to a parameter of an outer
+ template. */
-/* Demangles and emits a <builtin-type>.
-
- <builtin-type> ::= v # void
- ::= w # wchar_t
- ::= b # bool
- ::= c # char
- ::= a # signed char
- ::= h # unsigned char
- ::= s # short
- ::= t # unsigned short
- ::= i # int
- ::= j # unsigned int
- ::= l # long
- ::= m # unsigned long
- ::= x # long long, __int64
- ::= y # unsigned long long, __int64
- ::= n # __int128
- ::= o # unsigned __int128
- ::= f # float
- ::= d # double
- ::= e # long double, __float80
- ::= g # __float128
- ::= z # ellipsis
- ::= u <source-name> # vendor extended type */
-
-static status_t
-demangle_builtin_type (dm)
- demangling_t dm;
-{
+ hold_dpt = dpi->templates;
+ dpi->templates = hold_dpt->next;
- char code = peek_char (dm);
+ d_print_comp (dpi, d_left (a));
- DEMANGLE_TRACE ("builtin-type", dm);
+ dpi->templates = hold_dpt;
- if (code == 'u')
- {
- advance_char (dm);
- RETURN_IF_ERROR (demangle_source_name (dm));
- return STATUS_OK;
- }
- else if (code >= 'a' && code <= 'z')
- {
- const char *type_name;
- /* Java uses different names for some built-in types. */
- if (dm->style == DMGL_JAVA)
- type_name = java_builtin_type_names[code - 'a'];
- else
- type_name = builtin_type_names[code - 'a'];
- if (type_name == NULL)
- return "Unrecognized <builtin-type> code.";
+ return;
+ }
- RETURN_IF_ERROR (result_add (dm, type_name));
- advance_char (dm);
- return STATUS_OK;
- }
- else
- return "Non-alphabetic <builtin-type> code.";
-}
+ case D_COMP_CTOR:
+ d_print_comp (dpi, dc->u.s_ctor.name);
+ return;
+
+ case D_COMP_DTOR:
+ d_append_char (dpi, '~');
+ d_print_comp (dpi, dc->u.s_dtor.name);
+ return;
+
+ case D_COMP_VTABLE:
+ d_append_string_constant (dpi, "vtable for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_VTT:
+ d_append_string_constant (dpi, "VTT for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_CONSTRUCTION_VTABLE:
+ d_append_string_constant (dpi, "construction vtable for ");
+ d_print_comp (dpi, d_left (dc));
+ d_append_string_constant (dpi, "-in-");
+ d_print_comp (dpi, d_right (dc));
+ return;
+
+ case D_COMP_TYPEINFO:
+ d_append_string_constant (dpi, "typeinfo for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_TYPEINFO_NAME:
+ d_append_string_constant (dpi, "typeinfo name for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_TYPEINFO_FN:
+ d_append_string_constant (dpi, "typeinfo fn for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_THUNK:
+ d_append_string_constant (dpi, "non-virtual thunk to ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_VIRTUAL_THUNK:
+ d_append_string_constant (dpi, "virtual thunk to ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_COVARIANT_THUNK:
+ d_append_string_constant (dpi, "covariant return thunk to ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_JAVA_CLASS:
+ d_append_string_constant (dpi, "java Class for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_GUARD:
+ d_append_string_constant (dpi, "guard variable for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_REFTEMP:
+ d_append_string_constant (dpi, "reference temporary for ");
+ d_print_comp (dpi, d_left (dc));
+ return;
+
+ case D_COMP_SUB_STD:
+ d_append_buffer (dpi, dc->u.s_string.string, dc->u.s_string.len);
+ return;
+
+ case D_COMP_RESTRICT:
+ case D_COMP_VOLATILE:
+ case D_COMP_CONST:
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ case D_COMP_VENDOR_TYPE_QUAL:
+ case D_COMP_POINTER:
+ case D_COMP_REFERENCE:
+ case D_COMP_COMPLEX:
+ case D_COMP_IMAGINARY:
+ {
+ /* We keep a list of modifiers on the stack. */
+ struct d_print_mod dpm;
-/* Demangles all consecutive CV-qualifiers (const, volatile, and
- restrict) at the current position. The qualifiers are appended to
- QUALIFIERS. Returns STATUS_OK. */
+ dpm.next = dpi->modifiers;
+ dpi->modifiers = &dpm;
+ dpm.mod = dc;
+ dpm.printed = 0;
+ dpm.templates = dpi->templates;
-static status_t
-demangle_CV_qualifiers (dm, qualifiers)
- demangling_t dm;
- dyn_string_t qualifiers;
-{
- DEMANGLE_TRACE ("CV-qualifiers", dm);
+ d_print_comp (dpi, d_left (dc));
- while (1)
- {
- switch (peek_char (dm))
- {
- case 'r':
- if (!dyn_string_append_space (qualifiers))
- return STATUS_ALLOCATION_FAILED;
- if (!dyn_string_append_cstr (qualifiers, "restrict"))
- return STATUS_ALLOCATION_FAILED;
- break;
+ /* If the modifier didn't get printed by the type, print it
+ now. */
+ if (! dpm.printed)
+ d_print_mod (dpi, dc);
- case 'V':
- if (!dyn_string_append_space (qualifiers))
- return STATUS_ALLOCATION_FAILED;
- if (!dyn_string_append_cstr (qualifiers, "volatile"))
- return STATUS_ALLOCATION_FAILED;
- break;
+ dpi->modifiers = dpm.next;
- case 'K':
- if (!dyn_string_append_space (qualifiers))
- return STATUS_ALLOCATION_FAILED;
- if (!dyn_string_append_cstr (qualifiers, "const"))
- return STATUS_ALLOCATION_FAILED;
- break;
+ return;
+ }
- default:
- return STATUS_OK;
- }
+ case D_COMP_BUILTIN_TYPE:
+ if ((dpi->options & DMGL_JAVA) == 0)
+ d_append_buffer (dpi, dc->u.s_builtin.type->name,
+ dc->u.s_builtin.type->len);
+ else
+ d_append_buffer (dpi, dc->u.s_builtin.type->java_name,
+ dc->u.s_builtin.type->java_len);
+ return;
- advance_char (dm);
- }
-}
+ case D_COMP_VENDOR_TYPE:
+ d_print_comp (dpi, d_left (dc));
+ return;
-/* Demangles and emits a <function-type>. *FUNCTION_NAME_POS is the
- position in the result string of the start of the function
- identifier, at which the function's return type will be inserted;
- *FUNCTION_NAME_POS is updated to position past the end of the
- function's return type.
+ case D_COMP_FUNCTION_TYPE:
+ {
+ if (d_left (dc) != NULL)
+ {
+ struct d_print_mod dpm;
- <function-type> ::= F [Y] <bare-function-type> E */
+ /* We must pass this type down as a modifier in order to
+ print it in the right location. */
-static status_t
-demangle_function_type (dm, function_name_pos)
- demangling_t dm;
- int *function_name_pos;
-{
- DEMANGLE_TRACE ("function-type", dm);
- RETURN_IF_ERROR (demangle_char (dm, 'F'));
- if (peek_char (dm) == 'Y')
- {
- /* Indicate this function has C linkage if in verbose mode. */
- if (flag_verbose)
- RETURN_IF_ERROR (result_add (dm, " [extern \"C\"] "));
- advance_char (dm);
- }
- RETURN_IF_ERROR (demangle_bare_function_type (dm, function_name_pos));
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
- return STATUS_OK;
-}
+ dpm.next = dpi->modifiers;
+ dpi->modifiers = &dpm;
+ dpm.mod = dc;
+ dpm.printed = 0;
+ dpm.templates = dpi->templates;
-/* Demangles and emits a <bare-function-type>. RETURN_TYPE_POS is the
- position in the result string at which the function return type
- should be inserted. If RETURN_TYPE_POS is BFT_NO_RETURN_TYPE, the
- function's return type is assumed not to be encoded.
+ d_print_comp (dpi, d_left (dc));
- <bare-function-type> ::= <signature type>+ */
+ dpi->modifiers = dpm.next;
-static status_t
-demangle_bare_function_type (dm, return_type_pos)
- demangling_t dm;
- int *return_type_pos;
-{
- /* Sequence is the index of the current function parameter, counting
- from zero. The value -1 denotes the return type. */
- int sequence =
- (return_type_pos == BFT_NO_RETURN_TYPE ? 0 : -1);
+ if (dpm.printed)
+ return;
- DEMANGLE_TRACE ("bare-function-type", dm);
-
- RETURN_IF_ERROR (result_add_char (dm, '('));
- while (!end_of_name_p (dm) && peek_char (dm) != 'E')
- {
- if (sequence == -1)
- /* We're decoding the function's return type. */
- {
- dyn_string_t return_type;
- status_t status = STATUS_OK;
-
- /* Decode the return type off to the side. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_type (dm));
- return_type = (dyn_string_t) result_pop (dm);
-
- /* Add a space to the end of the type. Insert the return
- type where we've been asked to. */
- if (!dyn_string_append_space (return_type))
- status = STATUS_ALLOCATION_FAILED;
- if (STATUS_NO_ERROR (status))
- {
- if (!dyn_string_insert (result_string (dm), *return_type_pos,
- return_type))
- status = STATUS_ALLOCATION_FAILED;
- else
- *return_type_pos += dyn_string_length (return_type);
- }
+ d_append_char (dpi, ' ');
+ }
- dyn_string_delete (return_type);
- RETURN_IF_ERROR (status);
- }
- else
- {
- /* Skip `void' parameter types. One should only occur as
- the only type in a parameter list; in that case, we want
- to print `foo ()' instead of `foo (void)'. */
- if (peek_char (dm) == 'v')
- /* Consume the v. */
- advance_char (dm);
- else
- {
- /* Separate parameter types by commas. */
- if (sequence > 0)
- RETURN_IF_ERROR (result_add (dm, ", "));
- /* Demangle the type. */
- RETURN_IF_ERROR (demangle_type (dm));
- }
- }
+ d_print_function_type (dpi, dc, dpi->modifiers);
- ++sequence;
- }
- RETURN_IF_ERROR (result_add_char (dm, ')'));
+ return;
+ }
- /* We should have demangled at least one parameter type (which would
- be void, for a function that takes no parameters), plus the
- return type, if we were supposed to demangle that. */
- if (sequence == -1)
- return "Missing function return type.";
- else if (sequence == 0)
- return "Missing function parameter.";
+ case D_COMP_ARRAY_TYPE:
+ {
+ struct d_print_mod dpm;
- return STATUS_OK;
-}
+ /* We must pass this type down as a modifier in order to print
+ multi-dimensional arrays correctly. */
-/* Demangles and emits a <class-enum-type>. *ENCODE_RETURN_TYPE is set to
- non-zero if the type is a template-id, zero otherwise.
+ dpm.next = dpi->modifiers;
+ dpi->modifiers = &dpm;
+ dpm.mod = dc;
+ dpm.printed = 0;
+ dpm.templates = dpi->templates;
- <class-enum-type> ::= <name> */
+ d_print_comp (dpi, d_right (dc));
-static status_t
-demangle_class_enum_type (dm, encode_return_type)
- demangling_t dm;
- int *encode_return_type;
-{
- DEMANGLE_TRACE ("class-enum-type", dm);
+ dpi->modifiers = dpm.next;
- RETURN_IF_ERROR (demangle_name (dm, encode_return_type));
- return STATUS_OK;
-}
+ if (dpm.printed)
+ return;
-/* Demangles and emits an <array-type>.
+ d_print_array_type (dpi, dc, dpi->modifiers);
- If PTR_INSERT_POS is not NULL, the array type is formatted as a
- pointer or reference to an array, except that asterisk and
- ampersand punctuation is omitted (since it's not know at this
- point). *PTR_INSERT_POS is set to the position in the demangled
- name at which this punctuation should be inserted. For example,
- `A10_i' is demangled to `int () [10]' and *PTR_INSERT_POS points
- between the parentheses.
+ return;
+ }
- If PTR_INSERT_POS is NULL, the array type is assumed not to be
- pointer- or reference-qualified. Then, for example, `A10_i' is
- demangled simply as `int[10]'.
+ case D_COMP_PTRMEM_TYPE:
+ {
+ struct d_print_mod dpm;
- <array-type> ::= A [<dimension number>] _ <element type>
- ::= A <dimension expression> _ <element type> */
+ dpm.next = dpi->modifiers;
+ dpi->modifiers = &dpm;
+ dpm.mod = dc;
+ dpm.printed = 0;
+ dpm.templates = dpi->templates;
-static status_t
-demangle_array_type (dm, ptr_insert_pos)
- demangling_t dm;
- int *ptr_insert_pos;
-{
- status_t status = STATUS_OK;
- dyn_string_t array_size = NULL;
- char peek;
+ d_print_comp (dpi, d_right (dc));
- DEMANGLE_TRACE ("array-type", dm);
+ /* If the modifier didn't get printed by the type, print it
+ now. */
+ if (! dpm.printed)
+ {
+ d_append_char (dpi, ' ');
+ d_print_comp (dpi, d_left (dc));
+ d_append_string_constant (dpi, "::*");
+ }
- RETURN_IF_ERROR (demangle_char (dm, 'A'));
+ dpi->modifiers = dpm.next;
- /* Demangle the array size into array_size. */
- peek = peek_char (dm);
- if (peek == '_')
- /* Array bound is omitted. This is a C99-style VLA. */
- ;
- else if (IS_DIGIT (peek_char (dm)))
- {
- /* It looks like a constant array bound. */
- array_size = dyn_string_new (10);
- if (array_size == NULL)
- return STATUS_ALLOCATION_FAILED;
- status = demangle_number_literally (dm, array_size, 10, 0);
- }
- else
- {
- /* Anything is must be an expression for a nont-constant array
- bound. This happens if the array type occurs in a template
- and the array bound references a template parameter. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_expression (dm));
- array_size = (dyn_string_t) result_pop (dm);
- }
- /* array_size may have been allocated by now, so we can't use
- RETURN_IF_ERROR until it's been deallocated. */
+ return;
+ }
- /* Demangle the base type of the array. */
- if (STATUS_NO_ERROR (status))
- status = demangle_char (dm, '_');
- if (STATUS_NO_ERROR (status))
- status = demangle_type (dm);
+ case D_COMP_ARGLIST:
+ case D_COMP_TEMPLATE_ARGLIST:
+ d_print_comp (dpi, d_left (dc));
+ if (d_right (dc) != NULL)
+ {
+ d_append_string_constant (dpi, ", ");
+ d_print_comp (dpi, d_right (dc));
+ }
+ return;
- if (ptr_insert_pos != NULL)
- {
- /* This array is actually part of an pointer- or
- reference-to-array type. Format appropriately, except we
- don't know which and how much punctuation to use. */
- if (STATUS_NO_ERROR (status))
- status = result_add (dm, " () ");
- /* Let the caller know where to insert the punctuation. */
- *ptr_insert_pos = result_caret_pos (dm) - 2;
- }
+ case D_COMP_OPERATOR:
+ {
+ char c;
+
+ d_append_string_constant (dpi, "operator");
+ c = dc->u.s_operator.op->name[0];
+ if (IS_LOWER (c))
+ d_append_char (dpi, ' ');
+ d_append_buffer (dpi, dc->u.s_operator.op->name,
+ dc->u.s_operator.op->len);
+ return;
+ }
- /* Emit the array dimension syntax. */
- if (STATUS_NO_ERROR (status))
- status = result_add_char (dm, '[');
- if (STATUS_NO_ERROR (status) && array_size != NULL)
- status = result_add_string (dm, array_size);
- if (STATUS_NO_ERROR (status))
- status = result_add_char (dm, ']');
- if (array_size != NULL)
- dyn_string_delete (array_size);
-
- RETURN_IF_ERROR (status);
-
- return STATUS_OK;
-}
+ case D_COMP_EXTENDED_OPERATOR:
+ d_append_string_constant (dpi, "operator ");
+ d_print_comp (dpi, dc->u.s_extended_operator.name);
+ return;
-/* Demangles and emits a <template-param>.
+ case D_COMP_CAST:
+ d_append_string_constant (dpi, "operator ");
+ d_print_cast (dpi, dc);
+ return;
- <template-param> ::= T_ # first template parameter
- ::= T <parameter-2 number> _ */
+ case D_COMP_UNARY:
+ if (d_left (dc)->type != D_COMP_CAST)
+ d_print_expr_op (dpi, d_left (dc));
+ else
+ {
+ d_append_string_constant (dpi, "((");
+ d_print_cast (dpi, d_left (dc));
+ d_append_char (dpi, ')');
+ }
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, d_right (dc));
+ d_append_char (dpi, ')');
+ if (d_left (dc)->type == D_COMP_CAST)
+ d_append_char (dpi, ')');
+ return;
+
+ case D_COMP_BINARY:
+ if (d_right (dc)->type != D_COMP_BINARY_ARGS)
+ {
+ d_print_error (dpi);
+ return;
+ }
-static status_t
-demangle_template_param (dm)
- demangling_t dm;
-{
- int parm_number;
- template_arg_list_t current_arg_list = current_template_arg_list (dm);
- string_list_t arg;
+ /* We wrap an expression which uses the greater-than operator in
+ an extra layer of parens so that it does not get confused
+ with the '>' which ends the template parameters. */
+ if (d_left (dc)->type == D_COMP_OPERATOR
+ && d_left (dc)->u.s_operator.op->len == 1
+ && d_left (dc)->u.s_operator.op->name[0] == '>')
+ d_append_char (dpi, '(');
+
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, d_left (d_right (dc)));
+ d_append_string_constant (dpi, ") ");
+ d_print_expr_op (dpi, d_left (dc));
+ d_append_string_constant (dpi, " (");
+ d_print_comp (dpi, d_right (d_right (dc)));
+ d_append_char (dpi, ')');
+
+ if (d_left (dc)->type == D_COMP_OPERATOR
+ && d_left (dc)->u.s_operator.op->len == 1
+ && d_left (dc)->u.s_operator.op->name[0] == '>')
+ d_append_char (dpi, ')');
+
+ return;
+
+ case D_COMP_BINARY_ARGS:
+ /* We should only see this as part of D_COMP_BINARY. */
+ d_print_error (dpi);
+ return;
+
+ case D_COMP_TRINARY:
+ if (d_right (dc)->type != D_COMP_TRINARY_ARG1
+ || d_right (d_right (dc))->type != D_COMP_TRINARY_ARG2)
+ {
+ d_print_error (dpi);
+ return;
+ }
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, d_left (d_right (dc)));
+ d_append_string_constant (dpi, ") ");
+ d_print_expr_op (dpi, d_left (dc));
+ d_append_string_constant (dpi, " (");
+ d_print_comp (dpi, d_left (d_right (d_right (dc))));
+ d_append_string_constant (dpi, ") : (");
+ d_print_comp (dpi, d_right (d_right (d_right (dc))));
+ d_append_char (dpi, ')');
+ return;
+
+ case D_COMP_TRINARY_ARG1:
+ case D_COMP_TRINARY_ARG2:
+ /* We should only see these are part of D_COMP_TRINARY. */
+ d_print_error (dpi);
+ return;
+
+ case D_COMP_LITERAL:
+ case D_COMP_LITERAL_NEG:
+ /* For some builtin types, produce simpler output. */
+ if (d_left (dc)->type == D_COMP_BUILTIN_TYPE)
+ {
+ switch (d_left (dc)->u.s_builtin.type->print)
+ {
+ case D_PRINT_INT:
+ if (d_right (dc)->type == D_COMP_NAME)
+ {
+ if (dc->type == D_COMP_LITERAL_NEG)
+ d_append_char (dpi, '-');
+ d_print_comp (dpi, d_right (dc));
+ return;
+ }
+ break;
- DEMANGLE_TRACE ("template-param", dm);
+ case D_PRINT_LONG:
+ if (d_right (dc)->type == D_COMP_NAME)
+ {
+ if (dc->type == D_COMP_LITERAL_NEG)
+ d_append_char (dpi, '-');
+ d_print_comp (dpi, d_right (dc));
+ d_append_char (dpi, 'l');
+ return;
+ }
+ break;
- /* Make sure there is a template argmust list in which to look up
- this parameter reference. */
- if (current_arg_list == NULL)
- return "Template parameter outside of template.";
+ case D_PRINT_BOOL:
+ if (d_right (dc)->type == D_COMP_NAME
+ && d_right (dc)->u.s_name.len == 1
+ && dc->type == D_COMP_LITERAL)
+ {
+ switch (d_right (dc)->u.s_name.s[0])
+ {
+ case '0':
+ d_append_string_constant (dpi, "false");
+ return;
+ case '1':
+ d_append_string_constant (dpi, "true");
+ return;
+ default:
+ break;
+ }
+ }
+ break;
- RETURN_IF_ERROR (demangle_char (dm, 'T'));
- if (peek_char (dm) == '_')
- parm_number = 0;
- else
- {
- RETURN_IF_ERROR (demangle_number (dm, &parm_number, 10, 0));
- ++parm_number;
- }
- RETURN_IF_ERROR (demangle_char (dm, '_'));
+ default:
+ break;
+ }
+ }
- arg = template_arg_list_get_arg (current_arg_list, parm_number);
- if (arg == NULL)
- /* parm_number exceeded the number of arguments in the current
- template argument list. */
- return "Template parameter number out of bounds.";
- RETURN_IF_ERROR (result_add_string (dm, (dyn_string_t) arg));
+ d_append_char (dpi, '(');
+ d_print_comp (dpi, d_left (dc));
+ d_append_char (dpi, ')');
+ if (dc->type == D_COMP_LITERAL_NEG)
+ d_append_char (dpi, '-');
+ d_print_comp (dpi, d_right (dc));
+ return;
- return STATUS_OK;
+ default:
+ d_print_error (dpi);
+ return;
+ }
}
-/* Demangles and emits a <template-args>.
+/* Print a Java dentifier. For Java we try to handle encoded extended
+ Unicode characters. The C++ ABI doesn't mention Unicode encoding,
+ so we don't it for C++. Characters are encoded as
+ __U<hex-char>+_. */
- <template-args> ::= I <template-arg>+ E */
-
-static status_t
-demangle_template_args (dm)
- demangling_t dm;
+static void
+d_print_java_identifier (dpi, name, len)
+ struct d_print_info *dpi;
+ const char *name;
+ int len;
{
- int first = 1;
- dyn_string_t old_last_source_name;
- template_arg_list_t arg_list = template_arg_list_new ();
+ const char *p;
+ const char *end;
- if (arg_list == NULL)
- return STATUS_ALLOCATION_FAILED;
-
- /* Preserve the most recently demangled source name. */
- old_last_source_name = dm->last_source_name;
- dm->last_source_name = dyn_string_new (0);
+ end = name + len;
+ for (p = name; p < end; ++p)
+ {
+ if (end - p > 3
+ && p[0] == '_'
+ && p[1] == '_'
+ && p[2] == 'U')
+ {
+ unsigned long c;
+ const char *q;
- DEMANGLE_TRACE ("template-args", dm);
+ c = 0;
+ for (q = p + 3; q < end; ++q)
+ {
+ int dig;
+
+ if (IS_DIGIT (*q))
+ dig = *q - '0';
+ else if (*q >= 'A' && *q <= 'F')
+ dig = *q - 'A' + 10;
+ else if (*q >= 'a' && *q <= 'f')
+ dig = *q - 'a' + 10;
+ else
+ break;
- if (dm->last_source_name == NULL)
- return STATUS_ALLOCATION_FAILED;
+ c = c * 16 + dig;
+ }
+ /* If the Unicode character is larger than 256, we don't try
+ to deal with it here. FIXME. */
+ if (q < end && *q == '_' && c < 256)
+ {
+ d_append_char (dpi, c);
+ p = q;
+ continue;
+ }
+ }
- RETURN_IF_ERROR (demangle_char (dm, 'I'));
- RETURN_IF_ERROR (result_open_template_list (dm));
- do
- {
- string_list_t arg;
+ d_append_char (dpi, *p);
+ }
+}
- if (first)
- first = 0;
- else
- RETURN_IF_ERROR (result_add (dm, ", "));
+/* Print a list of modifiers. SUFFIX is 1 if we are printing
+ qualifiers on this after printing a function. */
- /* Capture the template arg. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_template_arg (dm));
- arg = result_pop (dm);
+static void
+d_print_mod_list (dpi, mods, suffix)
+ struct d_print_info *dpi;
+ struct d_print_mod *mods;
+ int suffix;
+{
+ struct d_print_template *hold_dpt;
- /* Emit it in the demangled name. */
- RETURN_IF_ERROR (result_add_string (dm, (dyn_string_t) arg));
+ if (mods == NULL || d_print_saw_error (dpi))
+ return;
- /* Save it for use in expanding <template-param>s. */
- template_arg_list_add_arg (arg_list, arg);
+ if (mods->printed
+ || (! suffix
+ && (mods->mod->type == D_COMP_RESTRICT_THIS
+ || mods->mod->type == D_COMP_VOLATILE_THIS
+ || mods->mod->type == D_COMP_CONST_THIS)))
+ {
+ d_print_mod_list (dpi, mods->next, suffix);
+ return;
}
- while (peek_char (dm) != 'E');
- /* Append the '>'. */
- RETURN_IF_ERROR (result_close_template_list (dm));
- /* Consume the 'E'. */
- advance_char (dm);
+ mods->printed = 1;
- /* Restore the most recent demangled source name. */
- dyn_string_delete (dm->last_source_name);
- dm->last_source_name = old_last_source_name;
+ hold_dpt = dpi->templates;
+ dpi->templates = mods->templates;
- /* Push the list onto the top of the stack of template argument
- lists, so that arguments from it are used from now on when
- expanding <template-param>s. */
- push_template_arg_list (dm, arg_list);
-
- return STATUS_OK;
-}
+ if (mods->mod->type == D_COMP_FUNCTION_TYPE)
+ {
+ d_print_function_type (dpi, mods->mod, mods->next);
+ dpi->templates = hold_dpt;
+ return;
+ }
+ else if (mods->mod->type == D_COMP_ARRAY_TYPE)
+ {
+ d_print_array_type (dpi, mods->mod, mods->next);
+ dpi->templates = hold_dpt;
+ return;
+ }
+ else if (mods->mod->type == D_COMP_LOCAL_NAME)
+ {
+ struct d_print_mod *hold_modifiers;
+ struct d_comp *dc;
-/* This function, which does not correspond to a production in the
- mangling spec, handles the `literal' production for both
- <template-arg> and <expr-primary>. It does not expect or consume
- the initial `L' or final `E'. The demangling is given by:
+ /* When this is on the modifier stack, we have pulled any
+ qualifiers off the right argument already. Otherwise, we
+ print it as usual, but don't let the left argument see any
+ modifiers. */
- <literal> ::= <type> </value/ number>
+ hold_modifiers = dpi->modifiers;
+ dpi->modifiers = NULL;
+ d_print_comp (dpi, d_left (mods->mod));
+ dpi->modifiers = hold_modifiers;
- and the emitted output is `(type)number'. */
+ if ((dpi->options & DMGL_JAVA) == 0)
+ d_append_string_constant (dpi, "::");
+ else
+ d_append_char (dpi, '.');
-static status_t
-demangle_literal (dm)
- demangling_t dm;
-{
- char peek = peek_char (dm);
- dyn_string_t value_string;
- status_t status;
+ dc = d_right (mods->mod);
+ while (dc->type == D_COMP_RESTRICT_THIS
+ || dc->type == D_COMP_VOLATILE_THIS
+ || dc->type == D_COMP_CONST_THIS)
+ dc = d_left (dc);
- DEMANGLE_TRACE ("literal", dm);
+ d_print_comp (dpi, dc);
- if (!flag_verbose && peek >= 'a' && peek <= 'z')
- {
- /* If not in verbose mode and this is a builtin type, see if we
- can produce simpler numerical output. In particular, for
- integer types shorter than `long', just write the number
- without type information; for bools, write `true' or `false'.
- Other refinements could be made here too. */
-
- /* This constant string is used to map from <builtin-type> codes
- (26 letters of the alphabet) to codes that determine how the
- value will be displayed. The codes are:
- b: display as bool
- i: display as int
- l: display as long
- A space means the value will be represented using cast
- notation. */
- static const char *const code_map = "ibi iii ll ii i ";
-
- char code = code_map[peek - 'a'];
- /* FIXME: Implement demangling of floats and doubles. */
- if (code == 'u')
- return STATUS_UNIMPLEMENTED;
- if (code == 'b')
- {
- /* It's a boolean. */
- char value;
-
- /* Consume the b. */
- advance_char (dm);
- /* Look at the next character. It should be 0 or 1,
- corresponding to false or true, respectively. */
- value = peek_char (dm);
- if (value == '0')
- RETURN_IF_ERROR (result_add (dm, "false"));
- else if (value == '1')
- RETURN_IF_ERROR (result_add (dm, "true"));
- else
- return "Unrecognized bool constant.";
- /* Consume the 0 or 1. */
- advance_char (dm);
- return STATUS_OK;
- }
- else if (code == 'i' || code == 'l')
- {
- /* It's an integer or long. */
-
- /* Consume the type character. */
- advance_char (dm);
-
- /* Demangle the number and write it out. */
- value_string = dyn_string_new (0);
- status = demangle_number_literally (dm, value_string, 10, 1);
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, value_string);
- /* For long integers, append an l. */
- if (code == 'l' && STATUS_NO_ERROR (status))
- status = result_add_char (dm, code);
- dyn_string_delete (value_string);
-
- RETURN_IF_ERROR (status);
- return STATUS_OK;
- }
- /* ...else code == ' ', so fall through to represent this
- literal's type explicitly using cast syntax. */
+ dpi->templates = hold_dpt;
+ return;
}
- RETURN_IF_ERROR (result_add_char (dm, '('));
- RETURN_IF_ERROR (demangle_type (dm));
- RETURN_IF_ERROR (result_add_char (dm, ')'));
-
- value_string = dyn_string_new (0);
- if (value_string == NULL)
- return STATUS_ALLOCATION_FAILED;
+ d_print_mod (dpi, mods->mod);
- status = demangle_number_literally (dm, value_string, 10, 1);
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, value_string);
- dyn_string_delete (value_string);
- RETURN_IF_ERROR (status);
+ dpi->templates = hold_dpt;
- return STATUS_OK;
+ d_print_mod_list (dpi, mods->next, suffix);
}
-/* Demangles and emits a <template-arg>.
+/* Print a modifier. */
- <template-arg> ::= <type> # type
- ::= L <type> <value number> E # literal
- ::= LZ <encoding> E # external name
- ::= X <expression> E # expression */
-
-static status_t
-demangle_template_arg (dm)
- demangling_t dm;
+static void
+d_print_mod (dpi, mod)
+ struct d_print_info *dpi;
+ const struct d_comp *mod;
{
- DEMANGLE_TRACE ("template-arg", dm);
-
- switch (peek_char (dm))
+ switch (mod->type)
{
- case 'L':
- advance_char (dm);
-
- if (peek_char (dm) == 'Z')
- {
- /* External name. */
- advance_char (dm);
- /* FIXME: Standard is contradictory here. */
- RETURN_IF_ERROR (demangle_encoding (dm));
- }
- else
- RETURN_IF_ERROR (demangle_literal (dm));
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
- break;
-
- case 'X':
- /* Expression. */
- advance_char (dm);
- RETURN_IF_ERROR (demangle_expression (dm));
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
- break;
-
+ case D_COMP_RESTRICT:
+ case D_COMP_RESTRICT_THIS:
+ d_append_string_constant (dpi, " restrict");
+ return;
+ case D_COMP_VOLATILE:
+ case D_COMP_VOLATILE_THIS:
+ d_append_string_constant (dpi, " volatile");
+ return;
+ case D_COMP_CONST:
+ case D_COMP_CONST_THIS:
+ d_append_string_constant (dpi, " const");
+ return;
+ case D_COMP_VENDOR_TYPE_QUAL:
+ d_append_char (dpi, ' ');
+ d_print_comp (dpi, d_right (mod));
+ return;
+ case D_COMP_POINTER:
+ /* There is no pointer symbol in Java. */
+ if ((dpi->options & DMGL_JAVA) == 0)
+ d_append_char (dpi, '*');
+ return;
+ case D_COMP_REFERENCE:
+ d_append_char (dpi, '&');
+ return;
+ case D_COMP_COMPLEX:
+ d_append_string_constant (dpi, "complex ");
+ return;
+ case D_COMP_IMAGINARY:
+ d_append_string_constant (dpi, "imaginary ");
+ return;
+ case D_COMP_PTRMEM_TYPE:
+ if (d_last_char (dpi) != '(')
+ d_append_char (dpi, ' ');
+ d_print_comp (dpi, d_left (mod));
+ d_append_string_constant (dpi, "::*");
+ return;
+ case D_COMP_TYPED_NAME:
+ d_print_comp (dpi, d_left (mod));
+ return;
default:
- RETURN_IF_ERROR (demangle_type (dm));
- break;
+ /* Otherwise, we have something that won't go back on the
+ modifier stack, so we can just print it. */
+ d_print_comp (dpi, mod);
+ return;
}
-
- return STATUS_OK;
}
-/* Demangles and emits an <expression>.
-
- <expression> ::= <unary operator-name> <expression>
- ::= <binary operator-name> <expression> <expression>
- ::= <expr-primary>
- ::= <scope-expression> */
+/* Print a function type, except for the return type. */
-static status_t
-demangle_expression (dm)
- demangling_t dm;
+static void
+d_print_function_type (dpi, dc, mods)
+ struct d_print_info *dpi;
+ const struct d_comp *dc;
+ struct d_print_mod *mods;
{
- char peek = peek_char (dm);
-
- DEMANGLE_TRACE ("expression", dm);
-
- if (peek == 'L' || peek == 'T')
- RETURN_IF_ERROR (demangle_expr_primary (dm));
- else if (peek == 's' && peek_char_next (dm) == 'r')
- RETURN_IF_ERROR (demangle_scope_expression (dm));
- else
- /* An operator expression. */
+ int need_paren;
+ int saw_mod;
+ struct d_print_mod *p;
+ struct d_print_mod *hold_modifiers;
+
+ need_paren = 0;
+ saw_mod = 0;
+ for (p = mods; p != NULL; p = p->next)
{
- int num_args;
- int type_arg;
- status_t status = STATUS_OK;
- dyn_string_t operator_name;
-
- /* We have an operator name. Since we want to output binary
- operations in infix notation, capture the operator name
- first. */
- RETURN_IF_ERROR (result_push (dm));
- RETURN_IF_ERROR (demangle_operator_name (dm, 1, &num_args,
- &type_arg));
- operator_name = (dyn_string_t) result_pop (dm);
-
- /* If it's binary, do an operand first. */
- if (num_args > 1)
- {
- status = result_add_char (dm, '(');
- if (STATUS_NO_ERROR (status))
- status = demangle_expression (dm);
- if (STATUS_NO_ERROR (status))
- status = result_add_char (dm, ')');
- }
-
- /* Emit the operator. */
- if (STATUS_NO_ERROR (status))
- status = result_add_string (dm, operator_name);
- dyn_string_delete (operator_name);
- RETURN_IF_ERROR (status);
-
- /* Emit its second (if binary) or only (if unary) operand. */
- RETURN_IF_ERROR (result_add_char (dm, '('));
- if (type_arg)
- RETURN_IF_ERROR (demangle_type (dm));
- else
- RETURN_IF_ERROR (demangle_expression (dm));
- RETURN_IF_ERROR (result_add_char (dm, ')'));
+ if (p->printed)
+ break;
- /* The ternary operator takes a third operand. */
- if (num_args == 3)
+ saw_mod = 1;
+ switch (p->mod->type)
{
- RETURN_IF_ERROR (result_add (dm, ":("));
- RETURN_IF_ERROR (demangle_expression (dm));
- RETURN_IF_ERROR (result_add_char (dm, ')'));
+ case D_COMP_RESTRICT:
+ case D_COMP_VOLATILE:
+ case D_COMP_CONST:
+ case D_COMP_VENDOR_TYPE_QUAL:
+ case D_COMP_POINTER:
+ case D_COMP_REFERENCE:
+ case D_COMP_COMPLEX:
+ case D_COMP_IMAGINARY:
+ case D_COMP_PTRMEM_TYPE:
+ need_paren = 1;
+ break;
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ break;
+ default:
+ break;
}
+ if (need_paren)
+ break;
}
- return STATUS_OK;
-}
+ if (d_left (dc) != NULL && ! saw_mod)
+ need_paren = 1;
-/* Demangles and emits a <scope-expression>.
+ if (need_paren)
+ {
+ switch (d_last_char (dpi))
+ {
+ case ' ':
+ case '(':
+ case '*':
+ break;
- <scope-expression> ::= sr <qualifying type> <source-name>
- ::= sr <qualifying type> <encoding> */
+ default:
+ d_append_char (dpi, ' ');
+ break;
+ }
-static status_t
-demangle_scope_expression (dm)
- demangling_t dm;
-{
- RETURN_IF_ERROR (demangle_char (dm, 's'));
- RETURN_IF_ERROR (demangle_char (dm, 'r'));
- RETURN_IF_ERROR (demangle_type (dm));
- RETURN_IF_ERROR (result_add (dm, "::"));
- RETURN_IF_ERROR (demangle_encoding (dm));
- return STATUS_OK;
-}
+ d_append_char (dpi, '(');
+ }
-/* Demangles and emits an <expr-primary>.
+ hold_modifiers = dpi->modifiers;
+ dpi->modifiers = NULL;
- <expr-primary> ::= <template-param>
- ::= L <type> <value number> E # literal
- ::= L <mangled-name> E # external name */
+ d_print_mod_list (dpi, mods, 0);
-static status_t
-demangle_expr_primary (dm)
- demangling_t dm;
-{
- char peek = peek_char (dm);
+ if (need_paren)
+ d_append_char (dpi, ')');
- DEMANGLE_TRACE ("expr-primary", dm);
+ d_append_char (dpi, '(');
- if (peek == 'T')
- RETURN_IF_ERROR (demangle_template_param (dm));
- else if (peek == 'L')
- {
- /* Consume the `L'. */
- advance_char (dm);
- peek = peek_char (dm);
+ if (d_right (dc) != NULL)
+ d_print_comp (dpi, d_right (dc));
- if (peek == '_')
- RETURN_IF_ERROR (demangle_mangled_name (dm));
- else
- RETURN_IF_ERROR (demangle_literal (dm));
+ d_append_char (dpi, ')');
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
- }
- else
- return STATUS_ERROR;
+ d_print_mod_list (dpi, mods, 1);
- return STATUS_OK;
+ dpi->modifiers = hold_modifiers;
}
-/* Demangles and emits a <substitution>. Sets *TEMPLATE_P to non-zero
- if the substitution is the name of a template, zero otherwise.
-
- <substitution> ::= S <seq-id> _
- ::= S_
-
- ::= St # ::std::
- ::= Sa # ::std::allocator
- ::= Sb # ::std::basic_string
- ::= Ss # ::std::basic_string<char,
- ::std::char_traits<char>,
- ::std::allocator<char> >
- ::= Si # ::std::basic_istream<char,
- std::char_traits<char> >
- ::= So # ::std::basic_ostream<char,
- std::char_traits<char> >
- ::= Sd # ::std::basic_iostream<char,
- std::char_traits<char> >
-*/
+/* Print an array type, except for the element type. */
-static status_t
-demangle_substitution (dm, template_p)
- demangling_t dm;
- int *template_p;
+static void
+d_print_array_type (dpi, dc, mods)
+ struct d_print_info *dpi;
+ const struct d_comp *dc;
+ struct d_print_mod *mods;
{
- int seq_id;
- int peek;
- dyn_string_t text;
+ int need_space;
- DEMANGLE_TRACE ("substitution", dm);
-
- RETURN_IF_ERROR (demangle_char (dm, 'S'));
-
- /* Scan the substitution sequence index. A missing number denotes
- the first index. */
- peek = peek_char (dm);
- if (peek == '_')
- seq_id = -1;
- /* If the following character is 0-9 or a capital letter, interpret
- the sequence up to the next underscore as a base-36 substitution
- index. */
- else if (IS_DIGIT ((unsigned char) peek)
- || (peek >= 'A' && peek <= 'Z'))
- RETURN_IF_ERROR (demangle_number (dm, &seq_id, 36, 0));
- else
+ need_space = 1;
+ if (mods != NULL)
{
- const char *new_last_source_name = NULL;
+ int need_paren;
+ struct d_print_mod *p;
- switch (peek)
+ need_paren = 0;
+ for (p = mods; p != NULL; p = p->next)
{
- case 't':
- RETURN_IF_ERROR (result_add (dm, "std"));
- break;
-
- case 'a':
- RETURN_IF_ERROR (result_add (dm, "std::allocator"));
- new_last_source_name = "allocator";
- *template_p = 1;
- break;
+ if (p->printed)
+ break;
- case 'b':
- RETURN_IF_ERROR (result_add (dm, "std::basic_string"));
- new_last_source_name = "basic_string";
- *template_p = 1;
- break;
-
- case 's':
- if (!flag_verbose)
+ if (p->mod->type == D_COMP_ARRAY_TYPE)
{
- RETURN_IF_ERROR (result_add (dm, "std::string"));
- new_last_source_name = "string";
+ need_space = 0;
+ break;
}
else
{
- RETURN_IF_ERROR (result_add (dm, "std::basic_string<char, std::char_traits<char>, std::allocator<char> >"));
- new_last_source_name = "basic_string";
+ need_paren = 1;
+ need_space = 1;
+ break;
}
- *template_p = 0;
- break;
+ }
- case 'i':
- if (!flag_verbose)
- {
- RETURN_IF_ERROR (result_add (dm, "std::istream"));
- new_last_source_name = "istream";
- }
- else
- {
- RETURN_IF_ERROR (result_add (dm, "std::basic_istream<char, std::char_traits<char> >"));
- new_last_source_name = "basic_istream";
- }
- *template_p = 0;
- break;
+ if (need_paren)
+ d_append_string_constant (dpi, " (");
- case 'o':
- if (!flag_verbose)
- {
- RETURN_IF_ERROR (result_add (dm, "std::ostream"));
- new_last_source_name = "ostream";
- }
- else
- {
- RETURN_IF_ERROR (result_add (dm, "std::basic_ostream<char, std::char_traits<char> >"));
- new_last_source_name = "basic_ostream";
- }
- *template_p = 0;
- break;
+ d_print_mod_list (dpi, mods, 0);
- case 'd':
- if (!flag_verbose)
- {
- RETURN_IF_ERROR (result_add (dm, "std::iostream"));
- new_last_source_name = "iostream";
- }
- else
- {
- RETURN_IF_ERROR (result_add (dm, "std::basic_iostream<char, std::char_traits<char> >"));
- new_last_source_name = "basic_iostream";
- }
- *template_p = 0;
- break;
+ if (need_paren)
+ d_append_char (dpi, ')');
+ }
- default:
- return "Unrecognized <substitution>.";
- }
-
- /* Consume the character we just processed. */
- advance_char (dm);
+ if (need_space)
+ d_append_char (dpi, ' ');
- if (new_last_source_name != NULL)
- {
- if (!dyn_string_copy_cstr (dm->last_source_name,
- new_last_source_name))
- return STATUS_ALLOCATION_FAILED;
- }
+ d_append_char (dpi, '[');
- return STATUS_OK;
- }
+ if (d_left (dc) != NULL)
+ d_print_comp (dpi, d_left (dc));
- /* Look up the substitution text. Since `S_' is the most recent
- substitution, `S0_' is the second-most-recent, etc., shift the
- numbering by one. */
- text = substitution_get (dm, seq_id + 1, template_p);
- if (text == NULL)
- return "Substitution number out of range.";
+ d_append_char (dpi, ']');
+}
- /* Emit the substitution text. */
- RETURN_IF_ERROR (result_add_string (dm, text));
+/* Print an operator in an expression. */
- RETURN_IF_ERROR (demangle_char (dm, '_'));
- return STATUS_OK;
+static void
+d_print_expr_op (dpi, dc)
+ struct d_print_info *dpi;
+ const struct d_comp *dc;
+{
+ if (dc->type == D_COMP_OPERATOR)
+ d_append_buffer (dpi, dc->u.s_operator.op->name,
+ dc->u.s_operator.op->len);
+ else
+ d_print_comp (dpi, dc);
}
-/* Demangles and emits a <local-name>.
+/* Print a cast. */
- <local-name> := Z <function encoding> E <entity name> [<discriminator>]
- := Z <function encoding> E s [<discriminator>] */
-
-static status_t
-demangle_local_name (dm)
- demangling_t dm;
+static void
+d_print_cast (dpi, dc)
+ struct d_print_info *dpi;
+ const struct d_comp *dc;
{
- DEMANGLE_TRACE ("local-name", dm);
+ if (d_left (dc)->type != D_COMP_TEMPLATE)
+ d_print_comp (dpi, d_left (dc));
+ else
+ {
+ struct d_print_mod *hold_dpm;
+ struct d_print_template dpt;
- RETURN_IF_ERROR (demangle_char (dm, 'Z'));
- RETURN_IF_ERROR (demangle_encoding (dm));
- RETURN_IF_ERROR (demangle_char (dm, 'E'));
- RETURN_IF_ERROR (result_add (dm, "::"));
+ /* It appears that for a templated cast operator, we need to put
+ the template parameters in scope for the operator name, but
+ not for the parameters. The effect is that we need to handle
+ the template printing here. */
- if (peek_char (dm) == 's')
- {
- /* Local character string literal. */
- RETURN_IF_ERROR (result_add (dm, "string literal"));
- /* Consume the s. */
- advance_char (dm);
- RETURN_IF_ERROR (demangle_discriminator (dm, 0));
+ hold_dpm = dpi->modifiers;
+ dpi->modifiers = NULL;
+
+ dpt.next = dpi->templates;
+ dpi->templates = &dpt;
+ dpt.template = d_left (dc);
+
+ d_print_comp (dpi, d_left (d_left (dc)));
+
+ dpi->templates = dpt.next;
+
+ if (d_last_char (dpi) == '<')
+ d_append_char (dpi, ' ');
+ d_append_char (dpi, '<');
+ d_print_comp (dpi, d_right (d_left (dc)));
+ /* Avoid generating two consecutive '>' characters, to avoid
+ the C++ syntactic ambiguity. */
+ if (d_last_char (dpi) == '>')
+ d_append_char (dpi, ' ');
+ d_append_char (dpi, '>');
+
+ dpi->modifiers = hold_dpm;
}
- else
- {
- int unused;
- /* Local name for some other entity. Demangle its name. */
- RETURN_IF_ERROR (demangle_name (dm, &unused));
- RETURN_IF_ERROR (demangle_discriminator (dm, 1));
- }
-
- return STATUS_OK;
- }
-
- /* Optimonally demangles and emits a <discriminator>. If there is no
- <discriminator> at the current position in the mangled string, the
- descriminator is assumed to be zero. Emit the discriminator number
- in parentheses, unless SUPPRESS_FIRST is non-zero and the
- discriminator is zero.
-
- <discriminator> ::= _ <number> */
-
-static status_t
-demangle_discriminator (dm, suppress_first)
- demangling_t dm;
- int suppress_first;
+}
+
+/* Initialize the information structure we use to pass around
+ information. */
+
+static void
+d_init_info (mangled, options, len, di)
+ const char *mangled;
+ int options;
+ size_t len;
+ struct d_info *di;
{
- /* Output for <discriminator>s to the demangled name is completely
- suppressed if not in verbose mode. */
+ di->s = mangled;
+ di->send = mangled + len;
+ di->options = options;
- if (peek_char (dm) == '_')
- {
- /* Consume the underscore. */
- advance_char (dm);
- if (flag_verbose)
- RETURN_IF_ERROR (result_add (dm, " [#"));
- /* Check if there's a number following the underscore. */
- if (IS_DIGIT ((unsigned char) peek_char (dm)))
- {
- int discriminator;
- /* Demangle the number. */
- RETURN_IF_ERROR (demangle_number (dm, &discriminator, 10, 0));
- if (flag_verbose)
- /* Write the discriminator. The mangled number is two
- less than the discriminator ordinal, counting from
- zero. */
- RETURN_IF_ERROR (int_to_dyn_string (discriminator + 1,
- (dyn_string_t) dm->result));
- }
- else
- return STATUS_ERROR;
- if (flag_verbose)
- RETURN_IF_ERROR (result_add_char (dm, ']'));
- }
- else if (!suppress_first)
- {
- if (flag_verbose)
- RETURN_IF_ERROR (result_add (dm, " [#0]"));
- }
+ di->n = mangled;
+
+ /* We can not need more components than twice the number of chars in
+ the mangled string. Most components correspond directly to
+ chars, but the ARGLIST types are exceptions. */
+ di->num_comps = 2 * len;
+ di->next_comp = 0;
+
+ /* Similarly, we can not need more substitutions than there are
+ chars in the mangled string. */
+ di->num_subs = len;
+ di->next_sub = 0;
+ di->did_subs = 0;
- return STATUS_OK;
+ di->last_name = NULL;
+
+ di->expansion = 0;
}
-/* Demangle NAME into RESULT, which must be an initialized
- dyn_string_t. On success, returns STATUS_OK. On failure, returns
- an error message, and the contents of RESULT are unchanged. */
+/* Entry point for the demangler. If MANGLED is a g++ v3 ABI mangled
+ name, return a buffer allocated with malloc holding the demangled
+ name. OPTIONS is the usual libiberty demangler options. On
+ success, this sets *PALC to the allocated size of the returned
+ buffer. On failure, this sets *PALC to 0 for a bad name, or 1 for
+ a memory allocation failure. On failure, this returns NULL. */
-static status_t
-cp_demangle (name, result, style)
- const char *name;
- dyn_string_t result;
- int style;
+static char *
+d_demangle (mangled, options, palc)
+ const char* mangled;
+ int options;
+ size_t *palc;
{
- status_t status;
- int length = strlen (name);
+ size_t len;
+ int type;
+ struct d_info di;
+ struct d_comp *dc;
+ int estimate;
+ char *ret;
- if (length > 2 && name[0] == '_' && name[1] == 'Z')
- {
- demangling_t dm = demangling_new (name, style);
- if (dm == NULL)
- return STATUS_ALLOCATION_FAILED;
+ *palc = 0;
- status = result_push (dm);
- if (status != STATUS_OK)
- {
- demangling_delete (dm);
- return status;
- }
+ len = strlen (mangled);
- status = demangle_mangled_name (dm);
- if (STATUS_NO_ERROR (status))
+ if (mangled[0] == '_' && mangled[1] == 'Z')
+ type = 0;
+ else if (strncmp (mangled, "_GLOBAL_", 8) == 0
+ && (mangled[8] == '.' || mangled[8] == '_' || mangled[8] == '$')
+ && (mangled[9] == 'D' || mangled[9] == 'I')
+ && mangled[10] == '_')
+ {
+ char *r;
+
+ r = malloc (40 + len - 11);
+ if (r == NULL)
+ *palc = 1;
+ else
{
- dyn_string_t demangled = (dyn_string_t) result_pop (dm);
- if (!dyn_string_copy (result, demangled))
- return STATUS_ALLOCATION_FAILED;
- dyn_string_delete (demangled);
+ if (mangled[9] == 'I')
+ strcpy (r, "global constructors keyed to ");
+ else
+ strcpy (r, "global destructors keyed to ");
+ strcat (r, mangled + 11);
}
-
- demangling_delete (dm);
+ return r;
}
else
{
- /* It's evidently not a mangled C++ name. It could be the name
- of something with C linkage, though, so just copy NAME into
- RESULT. */
- if (!dyn_string_copy_cstr (result, name))
- return STATUS_ALLOCATION_FAILED;
- status = STATUS_OK;
+ if ((options & DMGL_TYPES) == 0)
+ return NULL;
+ type = 1;
}
- return status;
-}
+ d_init_info (mangled, options, len, &di);
-/* Demangle TYPE_NAME into RESULT, which must be an initialized
- dyn_string_t. On success, returns STATUS_OK. On failiure, returns
- an error message, and the contents of RESULT are unchanged. */
+ {
+#ifdef CP_DYNAMIC_ARRAYS
+ __extension__ struct d_comp comps[di.num_comps];
+ __extension__ struct d_comp *subs[di.num_subs];
-static status_t
-cp_demangle_type (type_name, result)
- const char* type_name;
- dyn_string_t result;
-{
- status_t status;
- demangling_t dm = demangling_new (type_name, DMGL_GNU_V3);
-
- if (dm == NULL)
- return STATUS_ALLOCATION_FAILED;
-
- /* Demangle the type name. The demangled name is stored in dm. */
- status = result_push (dm);
- if (status != STATUS_OK)
- {
- demangling_delete (dm);
- return status;
- }
+ di.comps = &comps[0];
+ di.subs = &subs[0];
+#else
+ di.comps = (struct d_comp *) malloc (di.num_comps
+ * sizeof (struct d_comp));
+ di.subs = (struct d_comp **) malloc (di.num_subs
+ * sizeof (struct d_comp *));
+ if (di.comps == NULL || di.subs == NULL)
+ {
+ if (di.comps != NULL)
+ free (di.comps);
+ if (di.subs != NULL)
+ free (di.subs);
+ *palc = 1;
+ return NULL;
+ }
+#endif
- status = demangle_type (dm);
+ if (! type)
+ dc = d_mangled_name (&di, 1);
+ else
+ dc = d_type (&di);
- if (STATUS_NO_ERROR (status))
- {
- /* The demangling succeeded. Pop the result out of dm and copy
- it into RESULT. */
- dyn_string_t demangled = (dyn_string_t) result_pop (dm);
- if (!dyn_string_copy (result, demangled))
- return STATUS_ALLOCATION_FAILED;
- dyn_string_delete (demangled);
- }
+ /* If DMGL_PARAMS is set, then if we didn't consume the entire
+ mangled string, then we didn't successfully demangle it. If
+ DMGL_PARAMS is not set, we didn't look at the trailing
+ parameters. */
+ if (((options & DMGL_PARAMS) != 0) && d_peek_char (&di) != '\0')
+ dc = NULL;
- /* Clean up. */
- demangling_delete (dm);
+#ifdef CP_DEMANGLE_DEBUG
+ if (dc == NULL)
+ printf ("failed demangling\n");
+ else
+ d_dump (dc, 0);
+#endif
+
+ /* We try to guess the length of the demangled string, to minimize
+ calls to realloc during demangling. */
+ estimate = len + di.expansion + 10 * di.did_subs;
+ estimate += estimate / 8;
+
+ ret = NULL;
+ if (dc != NULL)
+ ret = d_print (options, dc, estimate, palc);
+
+#ifndef CP_DYNAMIC_ARRAYS
+ free (di.comps);
+ free (di.subs);
+#endif
- return status;
+#ifdef CP_DEMANGLE_DEBUG
+ if (ret != NULL)
+ {
+ int rlen;
+
+ rlen = strlen (ret);
+ if (rlen > 2 * estimate)
+ printf ("*** Length %d much greater than estimate %d\n",
+ rlen, estimate);
+ else if (rlen > estimate)
+ printf ("*** Length %d greater than estimate %d\n",
+ rlen, estimate);
+ else if (rlen < estimate / 2)
+ printf ("*** Length %d much less than estimate %d\n",
+ rlen, estimate);
+ }
+#endif
+ }
+
+ return ret;
}
#if defined(IN_LIBGCC2) || defined(IN_GLIBCPP_V3)
+
extern char *__cxa_demangle PARAMS ((const char *, char *, size_t *, int *));
-/* ia64 ABI-mandated entry point in the C++ runtime library for performing
- demangling. MANGLED_NAME is a NUL-terminated character string
- containing the name to be demangled.
+/* ia64 ABI-mandated entry point in the C++ runtime library for
+ performing demangling. MANGLED_NAME is a NUL-terminated character
+ string containing the name to be demangled.
OUTPUT_BUFFER is a region of memory, allocated with malloc, of
*LENGTH bytes, into which the demangled name is stored. If
OUTPUT_BUFFER is not long enough, it is expanded using realloc.
OUTPUT_BUFFER may instead be NULL; in that case, the demangled name
- is placed in a region of memory allocated with malloc.
+ is placed in a region of memory allocated with malloc.
If LENGTH is non-NULL, the length of the buffer conaining the
- demangled name, is placed in *LENGTH.
+ demangled name, is placed in *LENGTH.
The return value is a pointer to the start of the NUL-terminated
demangled name, or NULL if the demangling fails. The caller is
- responsible for deallocating this memory using free.
+ responsible for deallocating this memory using free.
*STATUS is set to one of the following values:
0: The demangling operation succeeded.
- -1: A memory allocation failiure occurred.
+ -1: A memory allocation failure occurred.
-2: MANGLED_NAME is not a valid name under the C++ ABI mangling rules.
-3: One of the arguments is invalid.
- The demagling is performed using the C++ ABI mangling rules, with
+ The demangling is performed using the C++ ABI mangling rules, with
GNU extensions. */
char *
@@ -3674,137 +3924,74 @@ __cxa_demangle (mangled_name, output_buffer, length, status)
size_t *length;
int *status;
{
- struct dyn_string demangled_name;
- status_t result;
+ char *demangled;
+ size_t alc;
if (status == NULL)
return NULL;
- if (mangled_name == NULL) {
- *status = -3;
- return NULL;
- }
+ if (mangled_name == NULL)
+ {
+ *status = -3;
+ return NULL;
+ }
- /* Did the caller provide a buffer for the demangled name? */
- if (output_buffer == NULL) {
- /* No; dyn_string will malloc a buffer for us. */
- if (!dyn_string_init (&demangled_name, 0))
- {
- *status = -1;
- return NULL;
- }
- }
- else {
- /* Yes. Check that the length was provided. */
- if (length == NULL) {
+ if (output_buffer != NULL && length == NULL)
+ {
*status = -3;
return NULL;
}
- /* Install the buffer into a dyn_string. */
- demangled_name.allocated = *length;
- demangled_name.length = 0;
- demangled_name.s = output_buffer;
- }
- if (mangled_name[0] == '_' && mangled_name[1] == 'Z')
- /* MANGLED_NAME apprears to be a function or variable name.
- Demangle it accordingly. */
- result = cp_demangle (mangled_name, &demangled_name, 0);
- else
- /* Try to demangled MANGLED_NAME as the name of a type. */
- result = cp_demangle_type (mangled_name, &demangled_name);
+ demangled = d_demangle (mangled_name, DMGL_TYPES, &alc);
- if (result == STATUS_OK)
- /* The demangling succeeded. */
+ if (demangled == NULL)
{
- /* If LENGTH isn't NULL, store the allocated buffer length
- there; the buffer may have been realloced by dyn_string
- functions. */
- if (length != NULL)
- *length = demangled_name.allocated;
- /* The operation was a success. */
- *status = 0;
- return dyn_string_buf (&demangled_name);
+ if (alc == 1)
+ *status = -1;
+ else
+ *status = -2;
+ return NULL;
}
- else if (result == STATUS_ALLOCATION_FAILED)
- /* A call to malloc or realloc failed during the demangling
- operation. */
+
+ if (output_buffer == NULL)
{
- *status = -1;
- return NULL;
+ if (length != NULL)
+ *length = alc;
}
else
- /* The demangling failed for another reason, most probably because
- MANGLED_NAME isn't a valid mangled name. */
{
- /* If the buffer containing the demangled name wasn't provided
- by the caller, free it. */
- if (output_buffer == NULL)
- free (dyn_string_buf (&demangled_name));
- *status = -2;
- return NULL;
+ if (strlen (demangled) < *length)
+ {
+ strcpy (output_buffer, demangled);
+ free (demangled);
+ demangled = output_buffer;
+ }
+ else
+ {
+ free (output_buffer);
+ *length = alc;
+ }
}
+
+ *status = 0;
+
+ return demangled;
}
#else /* ! (IN_LIBGCC2 || IN_GLIBCPP_V3) */
-/* Variant entry point for integration with the existing cplus-dem
- demangler. Attempts to demangle MANGLED. If the demangling
- succeeds, returns a buffer, allocated with malloc, containing the
- demangled name. The caller must deallocate the buffer using free.
- If the demangling failes, returns NULL. */
+/* Entry point for libiberty demangler. If MANGLED is a g++ v3 ABI
+ mangled name, return a buffer allocated with malloc holding the
+ demangled name. Otherwise, return NULL. */
char *
cplus_demangle_v3 (mangled, options)
const char* mangled;
int options;
{
- dyn_string_t demangled;
- status_t status;
- int type = !!(options & DMGL_TYPES);
-
- if (mangled[0] == '_' && mangled[1] == 'Z')
- /* It is not a type. */
- type = 0;
- else
- {
- /* It is a type. Stop if we don't want to demangle types. */
- if (!type)
- return NULL;
- }
+ size_t alc;
- flag_verbose = !!(options & DMGL_VERBOSE);
-
- /* Create a dyn_string to hold the demangled name. */
- demangled = dyn_string_new (0);
- /* Attempt the demangling. */
- if (!type)
- /* Appears to be a function or variable name. */
- status = cp_demangle (mangled, demangled, 0);
- else
- /* Try to demangle it as the name of a type. */
- status = cp_demangle_type (mangled, demangled);
-
- if (STATUS_NO_ERROR (status))
- /* Demangling succeeded. */
- {
- /* Grab the demangled result from the dyn_string. It was
- allocated with malloc, so we can return it directly. */
- char *return_value = dyn_string_release (demangled);
- /* Hand back the demangled name. */
- return return_value;
- }
- else if (status == STATUS_ALLOCATION_FAILED)
- {
- fprintf (stderr, "Memory allocation failed.\n");
- abort ();
- }
- else
- /* Demangling failed. */
- {
- dyn_string_delete (demangled);
- return NULL;
- }
+ return d_demangle (mangled, options, &alc);
}
/* Demangle a Java symbol. Java uses a subset of the V3 ABI C++ mangling
@@ -3818,195 +4005,179 @@ char *
java_demangle_v3 (mangled)
const char* mangled;
{
- dyn_string_t demangled;
- char *next;
- char *end;
- int len;
- status_t status;
- int nesting = 0;
- char *cplus_demangled;
- char *return_value;
-
- /* Create a dyn_string to hold the demangled name. */
- demangled = dyn_string_new (0);
-
- /* Attempt the demangling. */
- status = cp_demangle ((char *) mangled, demangled, DMGL_JAVA);
-
- if (STATUS_NO_ERROR (status))
- /* Demangling succeeded. */
- {
- /* Grab the demangled result from the dyn_string. */
- cplus_demangled = dyn_string_release (demangled);
- }
- else if (status == STATUS_ALLOCATION_FAILED)
- {
- fprintf (stderr, "Memory allocation failed.\n");
- abort ();
- }
- else
- /* Demangling failed. */
- {
- dyn_string_delete (demangled);
- return NULL;
- }
-
- len = strlen (cplus_demangled);
- next = cplus_demangled;
- end = next + len;
- demangled = NULL;
-
- /* Replace occurances of JArray<TYPE> with TYPE[]. */
- while (next < end)
+ size_t alc;
+ char *demangled;
+ int nesting;
+ char *from;
+ char *to;
+
+ demangled = d_demangle (mangled, DMGL_JAVA | DMGL_PARAMS, &alc);
+
+ if (demangled == NULL)
+ return NULL;
+
+ nesting = 0;
+ from = demangled;
+ to = from;
+ while (*from != '\0')
{
- char *open_str = strstr (next, "JArray<");
- char *close_str = NULL;
- if (nesting > 0)
- close_str = strchr (next, '>');
-
- if (open_str != NULL && (close_str == NULL || close_str > open_str))
- {
+ if (strncmp (from, "JArray<", 7) == 0)
+ {
+ from += 7;
++nesting;
-
- if (!demangled)
- demangled = dyn_string_new(len);
-
- /* Copy prepending symbols, if any. */
- if (open_str > next)
- {
- open_str[0] = 0;
- dyn_string_append_cstr (demangled, next);
- }
- next = open_str + 7;
}
- else if (close_str != NULL)
- {
+ else if (nesting > 0 && *from == '>')
+ {
+ while (to > demangled && to[-1] == ' ')
+ --to;
+ *to++ = '[';
+ *to++ = ']';
--nesting;
-
- /* Copy prepending type symbol, if any. Squash any spurious
- whitespace. */
- if (close_str > next && next[0] != ' ')
- {
- close_str[0] = 0;
- dyn_string_append_cstr (demangled, next);
- }
- dyn_string_append_cstr (demangled, "[]");
- next = close_str + 1;
+ ++from;
}
else
- {
- /* There are no more arrays. Copy the rest of the symbol, or
- simply return the original symbol if no changes were made. */
- if (next == cplus_demangled)
- return cplus_demangled;
-
- dyn_string_append_cstr (demangled, next);
- next = end;
- }
+ *to++ = *from++;
}
- free (cplus_demangled);
-
- if (demangled)
- return_value = dyn_string_release (demangled);
- else
- return_value = NULL;
+ *to = '\0';
- return return_value;
+ return demangled;
}
#endif /* IN_LIBGCC2 || IN_GLIBCPP_V3 */
-
#ifndef IN_GLIBCPP_V3
-/* 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;
+
+/* Demangle a string in order to find out whether it is a constructor
+ or destructor. Return non-zero on success. Set *CTOR_KIND and
+ *DTOR_KIND appropriately. */
+
+static int
+is_ctor_or_dtor (mangled, ctor_kind, dtor_kind)
+ const char *mangled;
+ enum gnu_v3_ctor_kinds *ctor_kind;
+ enum gnu_v3_dtor_kinds *dtor_kind;
{
- demangling_t dm;
- status_t status;
+ struct d_info di;
+ struct d_comp *dc;
+ int ret;
- if (strncmp (name, "_Z", 2))
- return 0;
+ *ctor_kind = (enum gnu_v3_ctor_kinds) 0;
+ *dtor_kind = (enum gnu_v3_dtor_kinds) 0;
- dm = demangling_new (name, DMGL_GNU_V3);
- if (dm == NULL)
- {
- fprintf (stderr, "Memory allocation failed.\n");
- abort ();
- }
+ d_init_info (mangled, DMGL_GNU_V3, strlen (mangled), &di);
- status = result_push (dm);
- if (! STATUS_NO_ERROR (status))
- {
- demangling_delete (dm);
- fprintf (stderr, "%s\n", status);
- abort ();
- }
+ {
+#ifdef CP_DYNAMIC_ARRAYS
+ __extension__ struct d_comp comps[di.num_comps];
+ __extension__ struct d_comp *subs[di.num_subs];
- status = demangle_mangled_name (dm);
- if (STATUS_NO_ERROR (status))
- return dm;
+ di.comps = &comps[0];
+ di.subs = &subs[0];
+#else
+ di.comps = (struct d_comp *) malloc (di.num_comps
+ * sizeof (struct d_comp));
+ di.subs = (struct d_comp **) malloc (di.num_subs
+ * sizeof (struct d_comp *));
+ if (di.comps == NULL || di.subs == NULL)
+ {
+ if (di.comps != NULL)
+ free (di.comps);
+ if (di.subs != NULL)
+ free (di.subs);
+ return 0;
+ }
+#endif
- demangling_delete (dm);
- return 0;
+ dc = d_mangled_name (&di, 1);
+
+ /* Note that because we did not pass DMGL_PARAMS, we don't expect
+ to demangle the entire string. */
+
+ ret = 0;
+ while (dc != NULL)
+ {
+ switch (dc->type)
+ {
+ default:
+ dc = NULL;
+ break;
+ case D_COMP_TYPED_NAME:
+ case D_COMP_TEMPLATE:
+ case D_COMP_RESTRICT_THIS:
+ case D_COMP_VOLATILE_THIS:
+ case D_COMP_CONST_THIS:
+ dc = d_left (dc);
+ break;
+ case D_COMP_QUAL_NAME:
+ case D_COMP_LOCAL_NAME:
+ dc = d_right (dc);
+ break;
+ case D_COMP_CTOR:
+ *ctor_kind = dc->u.s_ctor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
+ case D_COMP_DTOR:
+ *dtor_kind = dc->u.s_dtor.kind;
+ ret = 1;
+ dc = NULL;
+ break;
+ }
+ }
+
+#ifndef CP_DYNAMIC_ARRAYS
+ free (di.subs);
+ free (di.comps);
+#endif
+ }
+
+ return ret;
}
+/* Return whether NAME is the mangled form of a g++ V3 ABI constructor
+ name. A non-zero return indicates the type of constructor. */
-/* 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);
+ enum gnu_v3_ctor_kinds ctor_kind;
+ enum gnu_v3_dtor_kinds dtor_kind;
- if (dm)
- {
- enum gnu_v3_ctor_kinds result = dm->is_constructor;
- demangling_delete (dm);
- return result;
- }
- else
+ if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
return (enum gnu_v3_ctor_kinds) 0;
+ return ctor_kind;
}
-/* 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. */
+/* Return whether NAME is the mangled form of a g++ V3 ABI destructor
+ name. A non-zero return indicates the type of destructor. */
+
enum gnu_v3_dtor_kinds
is_gnu_v3_mangled_dtor (name)
const char *name;
{
- demangling_t dm = demangle_v3_with_details (name);
+ enum gnu_v3_ctor_kinds ctor_kind;
+ enum gnu_v3_dtor_kinds dtor_kind;
- if (dm)
- {
- enum gnu_v3_dtor_kinds result = dm->is_destructor;
- demangling_delete (dm);
- return result;
- }
- else
+ if (! is_ctor_or_dtor (name, &ctor_kind, &dtor_kind))
return (enum gnu_v3_dtor_kinds) 0;
+ return dtor_kind;
}
-#endif /* IN_GLIBCPP_V3 */
+#endif /* IN_GLIBCPP_V3 */
#ifdef STANDALONE_DEMANGLER
#include "getopt.h"
+#include "dyn-string.h"
-static void print_usage
- PARAMS ((FILE* fp, int exit_value));
+static void print_usage PARAMS ((FILE* fp, int exit_value));
+
+#define IS_ALPHA(CHAR) \
+ (((CHAR) >= 'a' && (CHAR) <= 'z') \
+ || ((CHAR) >= 'A' && (CHAR) <= 'Z'))
/* Non-zero if CHAR is a character than can occur in a mangled name. */
#define is_mangled_char(CHAR) \
@@ -4026,7 +4197,7 @@ print_usage (fp, exit_value)
fprintf (fp, "Usage: %s [options] [names ...]\n", program_name);
fprintf (fp, "Options:\n");
fprintf (fp, " -h,--help Display this message.\n");
- fprintf (fp, " -s,--strict Demangle standard names only.\n");
+ fprintf (fp, " -p,--no-params Don't display function parameters\n");
fprintf (fp, " -v,--verbose Produce verbose demanglings.\n");
fprintf (fp, "If names are provided, they are demangled. Otherwise filters standard input.\n");
@@ -4036,10 +4207,10 @@ print_usage (fp, exit_value)
/* Option specification for getopt_long. */
static const struct option long_options[] =
{
- { "help", no_argument, NULL, 'h' },
- { "strict", no_argument, NULL, 's' },
- { "verbose", no_argument, NULL, 'v' },
- { NULL, no_argument, NULL, 0 },
+ { "help", no_argument, NULL, 'h' },
+ { "no-params", no_argument, NULL, 'p' },
+ { "verbose", no_argument, NULL, 'v' },
+ { NULL, no_argument, NULL, 0 },
};
/* Main entry for a demangling filter executable. It will demangle
@@ -4052,9 +4223,9 @@ main (argc, argv)
int argc;
char *argv[];
{
- status_t status;
int i;
int opt_char;
+ int options = DMGL_PARAMS | DMGL_ANSI | DMGL_TYPES;
/* Use the program name of this program, as invoked. */
program_name = argv[0];
@@ -4062,7 +4233,7 @@ main (argc, argv)
/* Parse options. */
do
{
- opt_char = getopt_long (argc, argv, "hsv", long_options, NULL);
+ opt_char = getopt_long (argc, argv, "hpv", long_options, NULL);
switch (opt_char)
{
case '?': /* Unrecognized option. */
@@ -4073,12 +4244,12 @@ main (argc, argv)
print_usage (stdout, 0);
break;
- case 's':
- flag_strict = 1;
+ case 'p':
+ options &= ~ DMGL_PARAMS;
break;
case 'v':
- flag_verbose = 1;
+ options |= DMGL_VERBOSE;
break;
}
}
@@ -4088,41 +4259,12 @@ main (argc, argv)
/* No command line arguments were provided. Filter stdin. */
{
dyn_string_t mangled = dyn_string_new (3);
- dyn_string_t demangled = dyn_string_new (0);
- status_t status;
+ char *s;
/* Read all of input. */
while (!feof (stdin))
{
- char c = getchar ();
-
- /* The first character of a mangled name is an underscore. */
- if (feof (stdin))
- break;
- if (c != '_')
- {
- /* It's not a mangled name. Print the character and go
- on. */
- putchar (c);
- continue;
- }
- c = getchar ();
-
- /* The second character of a mangled name is a capital `Z'. */
- if (feof (stdin))
- break;
- if (c != 'Z')
- {
- /* It's not a mangled name. Print the previous
- underscore, the `Z', and go on. */
- putchar ('_');
- putchar (c);
- continue;
- }
-
- /* Start keeping track of the candidate mangled name. */
- dyn_string_append_char (mangled, '_');
- dyn_string_append_char (mangled, 'Z');
+ char c;
/* Pile characters into mangled until we hit one that can't
occur in a mangled name. */
@@ -4135,62 +4277,53 @@ main (argc, argv)
c = getchar ();
}
- /* Attempt to demangle the name. */
- status = cp_demangle (dyn_string_buf (mangled), demangled, 0);
-
- /* If the demangling succeeded, great! Print out the
- demangled version. */
- if (STATUS_NO_ERROR (status))
- fputs (dyn_string_buf (demangled), stdout);
- /* Abort on allocation failures. */
- else if (status == STATUS_ALLOCATION_FAILED)
+ if (dyn_string_length (mangled) > 0)
{
- fprintf (stderr, "Memory allocation failed.\n");
- abort ();
+ s = cplus_demangle_v3 (dyn_string_buf (mangled), options);
+
+ if (s != NULL)
+ {
+ fputs (s, stdout);
+ free (s);
+ }
+ else
+ {
+ /* It might not have been a mangled name. Print the
+ original text. */
+ fputs (dyn_string_buf (mangled), stdout);
+ }
+
+ dyn_string_clear (mangled);
}
- /* Otherwise, it might not have been a mangled name. Just
- print out the original text. */
- else
- fputs (dyn_string_buf (mangled), stdout);
/* If we haven't hit EOF yet, we've read one character that
can't occur in a mangled name, so print it out. */
if (!feof (stdin))
putchar (c);
-
- /* Clear the candidate mangled name, to start afresh next
- time we hit a `_Z'. */
- dyn_string_clear (mangled);
}
dyn_string_delete (mangled);
- dyn_string_delete (demangled);
}
else
/* Demangle command line arguments. */
{
- dyn_string_t result = dyn_string_new (0);
-
/* Loop over command line arguments. */
for (i = optind; i < argc; ++i)
{
+ char *s;
+
/* Attempt to demangle. */
- status = cp_demangle (argv[i], result, 0);
+ s = cplus_demangle_v3 (argv[i], options);
/* If it worked, print the demangled name. */
- if (STATUS_NO_ERROR (status))
- printf ("%s\n", dyn_string_buf (result));
- /* Abort on allocaiton failures. */
- else if (status == STATUS_ALLOCATION_FAILED)
+ if (s != NULL)
{
- fprintf (stderr, "Memory allocation failed.\n");
- abort ();
+ printf ("%s\n", s);
+ free (s);
}
- /* If not, print the error message to stderr instead. */
- else
- fprintf (stderr, "%s\n", status);
+ else
+ fprintf (stderr, "Failed: %s\n", argv[i]);
}
- dyn_string_delete (result);
}
return 0;
diff --git a/libiberty/floatformat.c b/libiberty/floatformat.c
index 3589caad2d8..a0f65354e48 100644
--- a/libiberty/floatformat.c
+++ b/libiberty/floatformat.c
@@ -17,16 +17,33 @@ 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. */
+/* This is needed to pick up the NAN macro on some systems. */
+#define _GNU_SOURCE
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <math.h>
+
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
#include "ansidecl.h"
+#include "libiberty.h"
#include "floatformat.h"
-#include <math.h> /* ldexp */
-#ifdef ANSI_PROTOTYPES
-#include <stddef.h>
-extern void *memcpy (void *s1, const void *s2, size_t n);
-extern void *memset (void *s, int c, size_t n);
+
+#ifndef INFINITY
+#ifdef HUGE_VAL
+#define INFINITY HUGE_VAL
#else
-extern char *memcpy ();
-extern char *memset ();
+#define INFINITY (1.0 / 0.0)
+#endif
+#endif
+
+#ifndef NAN
+#define NAN (0.0 / 0.0)
#endif
static unsigned long get_field PARAMS ((const unsigned char *,
@@ -39,8 +56,8 @@ static int floatformat_always_valid PARAMS ((const struct floatformat *fmt,
static int
floatformat_always_valid (fmt, from)
- const struct floatformat *fmt;
- const char *from;
+ const struct floatformat *fmt ATTRIBUTE_UNUSED;
+ const char *from ATTRIBUTE_UNUSED;
{
return 1;
}
@@ -271,9 +288,45 @@ floatformat_to_double (fmt, from, to)
exponent = get_field (ufrom, fmt->byteorder, fmt->totalsize,
fmt->exp_start, fmt->exp_len);
- /* Note that if exponent indicates a NaN, we can't really do anything useful
- (not knowing if the host has NaN's, or how to build one). So it will
- end up as an infinity or something close; that is OK. */
+
+ /* If the exponent indicates a NaN, we don't have information to
+ decide what to do. So we handle it like IEEE, except that we
+ don't try to preserve the type of NaN. FIXME. */
+ if ((unsigned long) exponent == fmt->exp_nan)
+ {
+ int nan;
+
+ mant_off = fmt->man_start;
+ mant_bits_left = fmt->man_len;
+ nan = 0;
+ while (mant_bits_left > 0)
+ {
+ mant_bits = min (mant_bits_left, 32);
+
+ if (get_field (ufrom, fmt->byteorder, fmt->totalsize,
+ mant_off, mant_bits) != 0)
+ {
+ /* This is a NaN. */
+ nan = 1;
+ break;
+ }
+
+ mant_off += mant_bits;
+ mant_bits_left -= mant_bits;
+ }
+
+ if (nan)
+ dto = NAN;
+ else
+ dto = INFINITY;
+
+ if (get_field (ufrom, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1))
+ dto = -dto;
+
+ *to = dto;
+
+ return;
+ }
mant_bits_left = fmt->man_len;
mant_off = fmt->man_start;
@@ -306,8 +359,18 @@ floatformat_to_double (fmt, from, to)
mant = get_field (ufrom, fmt->byteorder, fmt->totalsize,
mant_off, mant_bits);
- dto += ldexp ((double)mant, exponent - mant_bits);
- exponent -= mant_bits;
+ /* Handle denormalized numbers. FIXME: What should we do for
+ non-IEEE formats? */
+ if (exponent == 0 && mant != 0)
+ dto += ldexp ((double)mant,
+ (- fmt->exp_bias
+ - mant_bits
+ - (mant_off - fmt->man_start)
+ + 1));
+ else
+ dto += ldexp ((double)mant, exponent - mant_bits);
+ if (exponent != 0)
+ exponent -= mant_bits;
mant_off += mant_bits;
mant_bits_left -= mant_bits;
}
@@ -392,33 +455,54 @@ floatformat_from_double (fmt, from, to)
int mant_bits_left;
unsigned char *uto = (unsigned char *)to;
- memcpy (&dfrom, from, sizeof (dfrom));
+ dfrom = *from;
memset (uto, 0, fmt->totalsize / FLOATFORMAT_CHAR_BIT);
+
+ /* If negative, set the sign bit. */
+ if (dfrom < 0)
+ {
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
+ dfrom = -dfrom;
+ }
+
if (dfrom == 0)
- return; /* Result is zero */
+ {
+ /* 0.0. */
+ return;
+ }
+
if (dfrom != dfrom)
{
- /* From is NaN */
+ /* NaN. */
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
fmt->exp_len, fmt->exp_nan);
- /* Be sure it's not infinity, but NaN value is irrel */
+ /* Be sure it's not infinity, but NaN value is irrelevant. */
put_field (uto, fmt->byteorder, fmt->totalsize, fmt->man_start,
32, 1);
return;
}
- /* If negative, set the sign bit. */
- if (dfrom < 0)
+ if (dfrom + dfrom == dfrom)
{
- put_field (uto, fmt->byteorder, fmt->totalsize, fmt->sign_start, 1, 1);
- dfrom = -dfrom;
+ /* This can only happen for an infinite value (or zero, which we
+ already handled above). */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
+ fmt->exp_len, fmt->exp_nan);
+ return;
}
- /* How to tell an infinity from an ordinary number? FIXME-someday */
-
mant = frexp (dfrom, &exponent);
- put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start, fmt->exp_len,
- exponent + fmt->exp_bias - 1);
+ if (exponent + fmt->exp_bias - 1 > 0)
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
+ fmt->exp_len, exponent + fmt->exp_bias - 1);
+ else
+ {
+ /* Handle a denormalized number. FIXME: What should we do for
+ non-IEEE formats? */
+ put_field (uto, fmt->byteorder, fmt->totalsize, fmt->exp_start,
+ fmt->exp_len, 0);
+ mant = ldexp (mant, exponent + fmt->exp_bias - 1);
+ }
mant_bits_left = fmt->man_len;
mant_off = fmt->man_start;
@@ -431,12 +515,11 @@ floatformat_from_double (fmt, from, to)
mant_long = (unsigned long)mant;
mant -= mant_long;
- /* If the integer bit is implicit, then we need to discard it.
- If we are discarding a zero, we should be (but are not) creating
- a denormalized number which means adjusting the exponent
- (I think). */
+ /* If the integer bit is implicit, and we are not creating a
+ denormalized number, then we need to discard it. */
if ((unsigned int) mant_bits_left == fmt->man_len
- && fmt->intbit == floatformat_intbit_no)
+ && fmt->intbit == floatformat_intbit_no
+ && exponent + fmt->exp_bias - 1 > 0)
{
mant_long &= 0x7fffffff;
mant_bits -= 1;
@@ -468,6 +551,8 @@ floatformat_is_valid (fmt, from)
#ifdef IEEE_DEBUG
+#include <stdio.h>
+
/* This is to be run on a host which uses IEEE floating point. */
void
@@ -475,19 +560,31 @@ ieee_test (n)
double n;
{
double result;
- char exten[16];
- floatformat_to_double (&floatformat_ieee_double_big, &n, &result);
- if (n != result)
+ floatformat_to_double (&floatformat_ieee_double_little, (char *) &n,
+ &result);
+ if ((n != result && (! isnan (n) || ! isnan (result)))
+ || (n < 0 && result >= 0)
+ || (n >= 0 && result < 0))
printf ("Differ(to): %.20g -> %.20g\n", n, result);
- floatformat_from_double (&floatformat_ieee_double_big, &n, &result);
- if (n != result)
+
+ floatformat_from_double (&floatformat_ieee_double_little, &n,
+ (char *) &result);
+ if ((n != result && (! isnan (n) || ! isnan (result)))
+ || (n < 0 && result >= 0)
+ || (n >= 0 && result < 0))
printf ("Differ(from): %.20g -> %.20g\n", n, result);
- floatformat_from_double (&floatformat_m68881_ext, &n, exten);
- floatformat_to_double (&floatformat_m68881_ext, exten, &result);
- if (n != result)
- printf ("Differ(to+from): %.20g -> %.20g\n", n, result);
+#if 0
+ {
+ char exten[16];
+
+ floatformat_from_double (&floatformat_m68881_ext, &n, exten);
+ floatformat_to_double (&floatformat_m68881_ext, exten, &result);
+ if (n != result)
+ printf ("Differ(to+from): %.20g -> %.20g\n", n, result);
+ }
+#endif
#if IEEE_DEBUG > 1
/* This is to be run on a host which uses 68881 format. */
@@ -502,12 +599,22 @@ ieee_test (n)
int
main ()
{
+ ieee_test (0.0);
ieee_test (0.5);
ieee_test (256.0);
ieee_test (0.12345);
ieee_test (234235.78907234);
ieee_test (-512.0);
ieee_test (-0.004321);
+ ieee_test (1.2E-70);
+ ieee_test (1.2E-316);
+ ieee_test (4.9406564584124654E-324);
+ ieee_test (- 4.9406564584124654E-324);
+ ieee_test (- 0.0);
+ ieee_test (- INFINITY);
+ ieee_test (- NAN);
+ ieee_test (INFINITY);
+ ieee_test (NAN);
return 0;
}
#endif
diff --git a/libiberty/hashtab.c b/libiberty/hashtab.c
index cbf82592be1..231fbc0dd7a 100644
--- a/libiberty/hashtab.c
+++ b/libiberty/hashtab.c
@@ -535,14 +535,14 @@ htab_find_slot_with_hash (htab, element, hash, insert)
if (insert == NO_INSERT)
return NULL;
- htab->n_elements++;
-
if (first_deleted_slot)
{
+ htab->n_deleted--;
*first_deleted_slot = EMPTY_ENTRY;
return first_deleted_slot;
}
+ htab->n_elements++;
return &htab->entries[index];
}
diff --git a/libiberty/lbasename.c b/libiberty/lbasename.c
index 43cb73f0a1d..200a87f2387 100644
--- a/libiberty/lbasename.c
+++ b/libiberty/lbasename.c
@@ -40,25 +40,7 @@ and a path ending in @code{/} 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
-
-#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
+#include "filenames.h"
const char *
lbasename (name)
diff --git a/libiberty/make-relative-prefix.c b/libiberty/make-relative-prefix.c
index dc4f8d5259d..5c263eb0b0e 100644
--- a/libiberty/make-relative-prefix.c
+++ b/libiberty/make-relative-prefix.c
@@ -306,8 +306,19 @@ make_relative_prefix (progname, bin_prefix, prefix)
if (bin_dirs == NULL || prog_dirs == NULL)
return NULL;
- /* Remove the program name from comparison of directory names. */
- prog_num--;
+ /* If the last character in the last directory is not a directory
+ separator, then the last directory is the program basename. The
+ program name is removed; it should not be involved in the
+ comparison of directory names. */
+ if (prog_num > 0)
+ {
+ const char* last_dir;
+ int n;
+ last_dir = prog_dirs[prog_num - 1];
+ n = strlen(last_dir);
+ if (!IS_DIR_SEPARATOR (last_dir[n - 1]))
+ prog_num--;
+ }
/* If we are still installed in the standard location, we don't need to
specify relative directories. Also, if argv[0] still doesn't contain
diff --git a/libiberty/pex-common.h b/libiberty/pex-common.h
index da2f71e1247..ad971ea7029 100644
--- a/libiberty/pex-common.h
+++ b/libiberty/pex-common.h
@@ -33,6 +33,9 @@ Boston, MA 02111-1307, USA. */
/* stdout file number. */
#define STDOUT_FILE_NO 1
+/* stderr file number. */
+#define STDERR_FILE_NO 2
+
/* value of `pipe': port index for reading. */
#define READ_PORT 0
diff --git a/libiberty/pex-unix.c b/libiberty/pex-unix.c
index 14fe71ed09c..d29e4688591 100644
--- a/libiberty/pex-unix.c
+++ b/libiberty/pex-unix.c
@@ -24,6 +24,7 @@ Boston, MA 02111-1307, USA. */
#include <stdio.h>
#include <errno.h>
+#include <fcntl.h>
#ifdef NEED_DECLARATION_ERRNO
extern int errno;
#endif
@@ -44,53 +45,64 @@ extern int errno;
#define waitpid(pid, status, flags) wait(status)
#endif
-extern int execv ();
-extern int execvp ();
+/* These are needed to prevent the build from bombing out on
+ platforms (such as embedded targets) where no pex-*.c
+ will work at all (but we try to build this one anyway). */
+extern int execvp();
+extern int execv();
+
+#define xdup2(a, b) do { \
+ if (a != -1) \
+ if (dup2 (a, b) < 0) \
+ { \
+ fprintf (stderr, "%s: dup2(%d, %d): %s\n", \
+ this_program, a, b, xstrerror(errno)); \
+ exit(127); \
+ } \
+} while (0);
+
+#define xclose(fd) do { \
+ if (fd != -1) \
+ { \
+ close (fd); \
+ fd = -1; \
+ } \
+} while (0)
+
+static const char *this_program = "<unknown>";
+
+/* Execute PROGRAM with argument vector ARGV. If SEARCH is false,
+ PROGRAM is expected to be a usable pathname already; otherwise it
+ is looked for in the locations specified by the PATH environment
+ variable (as per execvp).
+
+ STDIN_FD, STDOUT_FD, and STDERR_FD are file descriptors which
+ should be established as the child process's stdin, stdout, or
+ stderr, respectively, or -1 if the child should inherit the
+ parent's value of that descriptor. If any of these is not -1, it
+ should be a valid file descriptor marked close-on-exec. */
int
-pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
+pexec (program, argv, search, stdin_fd, stdout_fd, stderr_fd)
const char *program;
- char * const *argv;
- const char *this_pname;
- const char *temp_base ATTRIBUTE_UNUSED;
- char **errmsg_fmt, **errmsg_arg;
- int flags;
+ char *const *argv;
+ int search;
+ int stdin_fd;
+ int stdout_fd;
+ int stderr_fd;
{
- int (*func)() = (flags & PEXECUTE_SEARCH ? execvp : execv);
int pid;
- int pdes[2];
- int input_desc, output_desc;
int retries, sleep_interval;
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
- /* If this is the first process, initialize. */
- if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
+ /* Canonicalize file descriptor arguments. */
+ stdin_fd = (stdin_fd == STDIN_FILE_NO) ? -1 : stdin_fd;
+ stdout_fd = (stdout_fd == STDOUT_FILE_NO) ? -1 : stdout_fd;
+ stderr_fd = (stderr_fd == STDERR_FILE_NO) ? -1 : stderr_fd;
- input_desc = last_pipe_input;
-
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
- {
- if (pipe (pdes) < 0)
- {
- *errmsg_fmt = "pipe";
- *errmsg_arg = NULL;
- return -1;
- }
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
+ /* If exec fails, the child will write a message to stderr, using
+ fprintf. It must therefore use exit(), not _exit(). So we have
+ to flush pending output here to avoid duplicate output. */
+ fflush (NULL);
/* Fork a subprocess; wait and retry if it fails. */
sleep_interval = 1;
@@ -98,59 +110,134 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
for (retries = 0; retries < 4; retries++)
{
pid = fork ();
- if (pid >= 0)
+ if (__builtin_expect (pid >= 0, 1))
break;
sleep (sleep_interval);
sleep_interval *= 2;
}
- switch (pid)
+ if (pid != 0)
{
- case -1:
- *errmsg_fmt = "fork";
- *errmsg_arg = NULL;
+ /* Parent; fork either succeeded or failed. In either case we
+ close the file descriptors passed to the child, to make life
+ easier for callers. Don't clobber errno while doing so. */
+ int serrno = errno;
+ xclose (stdin_fd);
+ xclose (stdout_fd);
+ xclose (stderr_fd);
+ errno = serrno;
+
+ return pid;
+ }
+
+ /* We are the child. Set up I/O redirections and call exec.
+ FIXME: Report errors without calling fprintf() in the child
+ (so we can use vfork). */
+ xdup2 (stdin_fd, STDIN_FILE_NO);
+ xdup2 (stdout_fd, STDOUT_FILE_NO);
+ xdup2 (stderr_fd, STDERR_FILE_NO);
+
+ (search ? execvp : execv) (program, argv);
+
+ /* If we got here exec failed. */
+/*fprintf (stderr, install_error_msg, XXX completely wrong format string */
+ fprintf (stderr, "%s tried to exec %s but failed (%s)\n",
+ this_program, program, xstrerror (errno));
+ exit (127);
+}
+
+/* Create a pipe suitable for use with pexec - in particular, both
+ ends of the pipe are set close-on-exec. Returns 0 if successful,
+ -1 otherwise. Returns the pipe in the array argument, just as
+ pipe(2) does. */
+
+int
+pmkpipe (thepipe)
+ int thepipe[2];
+{
+ if (pipe (thepipe))
+ return -1;
+
+ if (fcntl (thepipe[0], F_SETFD, FD_CLOEXEC)
+ || fcntl (thepipe[1], F_SETFD, FD_CLOEXEC))
+ {
+ int serrno = errno;
+ close (thepipe[0]);
+ close (thepipe[1]);
+ errno = serrno;
return -1;
+ }
+ return 0;
+}
- case 0: /* child */
- /* Move the input and output pipes into place, if necessary. */
- if (input_desc != STDIN_FILE_NO)
- {
- close (STDIN_FILE_NO);
- dup (input_desc);
- close (input_desc);
- }
- if (output_desc != STDOUT_FILE_NO)
+int
+pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
+ const char *program;
+ char * const *argv;
+ const char *this_pname ATTRIBUTE_UNUSED;
+ const char *temp_base ATTRIBUTE_UNUSED;
+ char **errmsg_fmt, **errmsg_arg;
+ int flags;
+{
+ /* Pipe waiting from last process, to be used as input for the next
+ one. Value is -1 if no pipe is waiting (i.e. the next command is
+ the first of a group). */
+ static int last_pipe_input = -1;
+
+ int pid;
+ int pdesc[2];
+ int serrno;
+ int child_stdin = -2, child_stdout = -2;
+#if 0
+FILE* P = fopen("/dev/pts/1", "w");
+printf(P, "pex-unix.c:pexecute called with program %s\n", program);
+#endif
+ /* If this is the first process, last_pipe_input ought to be -1. */
+ if (flags & PEXECUTE_FIRST)
+ if (last_pipe_input != -1)
+ abort ();
+
+ child_stdin = last_pipe_input;
+
+ /* If this is the last process, don't do anything with its output
+ pipe. */
+ if (flags & PEXECUTE_LAST)
+ child_stdout = -1;
+ else
+ {
+ /* Create a pipe to go between this process and the next one in
+ the pipeline. */
+ if (pmkpipe (pdesc))
{
- close (STDOUT_FILE_NO);
- dup (output_desc);
- close (output_desc);
+ *errmsg_fmt = "pipe";
+ *errmsg_arg = NULL;
+ return -1;
}
+ last_pipe_input = pdesc[READ_PORT];
+ child_stdout = pdesc[WRITE_PORT];
+ }
- /* Close the parent's descs that aren't wanted here. */
- if (last_pipe_input != STDIN_FILE_NO)
- close (last_pipe_input);
-
- /* Exec the program. */
- (*func) (program, argv);
-
- fprintf (stderr, "%s: ", this_pname);
- fprintf (stderr, install_error_msg, program);
- fprintf (stderr, ": %s\n", xstrerror (errno));
- exit (-1);
- /* NOTREACHED */
- return 0;
-
- default:
- /* In the parent, after forking.
- Close the descriptors that we made for this child. */
- if (input_desc != STDIN_FILE_NO)
- close (input_desc);
- if (output_desc != STDOUT_FILE_NO)
- close (output_desc);
-
- /* Return child's process number. */
- return pid;
+ pid = pexec (program, argv, (flags & PEXECUTE_SEARCH),
+ child_stdin, child_stdout, -1);
+
+ serrno = errno;
+ xclose (child_stdin);
+ xclose (child_stdout);
+
+ /* To prevent a file descriptor leak, close last_pipe_input if pexec
+ failed. */
+ if (pid == -1)
+ xclose (last_pipe_input);
+
+ errno = serrno;
+
+ if (pid == -1)
+ {
+ *errmsg_fmt = "fork";
+ *errmsg_arg = NULL;
}
+
+ return pid;
}
int
@@ -164,3 +251,10 @@ pwait (pid, status, flags)
pid = waitpid (pid, status, 0);
return pid;
}
+
+void
+pexec_set_program_name (name)
+ const char *name;
+{
+ this_program = name;
+}
diff --git a/libiberty/pex-win32.c b/libiberty/pex-win32.c
index 27a5bb4e309..a4ba0c22dac 100644
--- a/libiberty/pex-win32.c
+++ b/libiberty/pex-win32.c
@@ -21,117 +21,316 @@ Boston, MA 02111-1307, USA. */
#include "pex-common.h"
-#ifdef HAVE_STRING_H
-#include <string.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
-
-#include <process.h>
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
#include <io.h>
#include <fcntl.h>
-#include <signal.h>
-
-/* mingw32 headers may not define the following. */
+#include <string.h>
+#include <stdlib.h>
+
+static const char *this_program;
+
+#define xclose(fd) do { \
+ if (fd != -1) \
+ { \
+ _close (fd); \
+ fd = -1; \
+ } \
+} while (0)
+
+/* Returns a string containing a text error message, after a Windows
+ "system call" failed. Caller is responsible for deallocating it
+ (with LocalFree()). */
+static char *
+get_last_error_as_text ()
+{
+ DWORD last_error = GetLastError();
+ LPSTR result;
-#ifndef _P_WAIT
-# define _P_WAIT 0
-# define _P_NOWAIT 1
-# define _P_OVERLAY 2
-# define _P_NOWAITO 3
-# define _P_DETACH 4
+ /* We assume the error message belongs to 'the system' as opposed
+ to some module (which we would have to load, and we don't know
+ which one it is). */
+ DWORD flags = (FORMAT_MESSAGE_ALLOCATE_BUFFER
+ | FORMAT_MESSAGE_IGNORE_INSERTS
+ | FORMAT_MESSAGE_FROM_SYSTEM);
-# define WAIT_CHILD 0
-# define WAIT_GRANDCHILD 1
-#endif
+ /* Default language. */
+ DWORD langid = MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT);
-/* This is a kludge to get around the Microsoft C spawn functions' propensity
- to remove the outermost set of double quotes from all arguments. */
+ /* Yes, you are supposed to cast LPSTR* to LPSTR in the fifth
+ argument. This interface is intrinsically type-unsafe. */
+ FormatMessageA(flags, 0, last_error, langid, (LPSTR) &result, 0, 0);
-static const char * const *
-fix_argv (argvec)
- char **argvec;
+ return result;
+}
+
+static char *
+argv_to_cmdline(argv)
+ char *const *argv;
{
- int i;
- char * command0 = argvec[0];
+ char *cmdline;
+ char *p;
+ size_t cmdline_len;
+ int i, j;
- /* Ensure that the executable pathname uses Win32 backslashes. */
- for (; *command0 != '\0'; command0++)
- if (*command0 == '/')
- *command0 = '\\';
-
- for (i = 1; argvec[i] != 0; i++)
+ cmdline_len = 0;
+ for (i = 0; argv[i]; i++)
+ {
+ /* We quote every last argument. This simplifies the problem;
+ we need only escape embedded double-quote and backslash
+ characters. */
+ for (j = 0; argv[i][j]; j++)
+ if (argv[i][j] == '\\' || argv[i][j] == '"')
+ cmdline_len++;
+ cmdline_len += j;
+ cmdline_len += 3; /* for leading and trailing quotes and space */
+ }
+
+ cmdline = xmalloc (cmdline_len);
+ p = cmdline;
+ for (i = 0; argv[i]; i++)
+ {
+ *p++ = '"';
+ for (j = 0; argv[i][j]; j++)
+ {
+ if (argv[i][j] == '\\' || argv[i][j] == '"')
+ *p++ = '\\';
+ *p++ = argv[i][j];
+ }
+ *p++ = '"';
+ *p++ = ' ';
+ }
+ p[-1] = '\0';
+ return cmdline;
+}
+
+static const char *const
+std_suffixes[] = {
+ ".com",
+ ".exe",
+ ".bat",
+ ".cmd",
+ 0
+};
+static const char *const
+no_suffixes[] = {
+ "",
+ 0
+};
+
+static char *
+find_executable (program, search)
+ const char *program;
+ int search;
+{
+ char *full_executable;
+ char *e;
+ size_t fe_len;
+ const char *path = 0;
+ const char *const *ext;
+ const char *p, *q;
+ size_t proglen = strlen (program);
+ int has_extension = !!strchr (program, '.');
+ int has_slash = (strchr (program, '/') || strchr (program, '\\'));
+ HANDLE h;
+
+ if (has_slash)
+ search = 0;
+
+ if (search)
+ path = getenv ("PATH");
+ if (!path)
+ path = "";
+
+ fe_len = 0;
+ for (p = path; *p; p = q)
{
- int len, j;
- char *temp, *newtemp;
-
- temp = argvec[i];
- len = strlen (temp);
- for (j = 0; j < len; j++)
- {
- if (temp[j] == '"')
- {
- newtemp = xmalloc (len + 2);
- strncpy (newtemp, temp, j);
- newtemp [j] = '\\';
- strncpy (&newtemp [j+1], &temp [j], len-j);
- newtemp [len+1] = 0;
- temp = newtemp;
- len++;
- j++;
- }
- }
-
- argvec[i] = temp;
- }
-
- for (i = 0; argvec[i] != 0; i++)
+ q = p;
+ while (*q != ';' && *q != '\0')
+ q++;
+ if ((size_t)(q - p) > fe_len)
+ fe_len = q - p;
+ if (*q == ';')
+ q++;
+ }
+ fe_len = fe_len + 1 + proglen + (has_extension ? 1 : 5);
+ full_executable = xmalloc (fe_len);
+
+ p = path;
+ do
{
- if (strpbrk (argvec[i], " \t"))
- {
- int len, trailing_backslash;
- char *temp;
-
- len = strlen (argvec[i]);
- trailing_backslash = 0;
-
- /* There is an added complication when an arg with embedded white
- space ends in a backslash (such as in the case of -iprefix arg
- passed to cpp). The resulting quoted strings gets misinterpreted
- by the command interpreter -- it thinks that the ending quote
- is escaped by the trailing backslash and things get confused.
- We handle this case by escaping the trailing backslash, provided
- it was not escaped in the first place. */
- if (len > 1
- && argvec[i][len-1] == '\\'
- && argvec[i][len-2] != '\\')
- {
- trailing_backslash = 1;
- ++len; /* to escape the final backslash. */
- }
-
- len += 2; /* and for the enclosing quotes. */
-
- temp = xmalloc (len + 1);
- temp[0] = '"';
- strcpy (temp + 1, argvec[i]);
- if (trailing_backslash)
- temp[len-2] = '\\';
- temp[len-1] = '"';
- temp[len] = '\0';
-
- argvec[i] = temp;
+ q = p;
+ while (*q != ';' && *q != '\0')
+ q++;
+
+ e = full_executable;
+ memcpy (e, p, q - p);
+ e += (q - p);
+ if (q - p)
+ *e++ = '\\';
+ strcpy (e, program);
+
+ if (*q == ';')
+ q++;
+
+ for (e = full_executable; *e; e++)
+ if (*e == '/')
+ *e = '\\';
+
+ /* At this point, e points to the terminating NUL character for
+ full_executable. */
+ for (ext = has_extension ? no_suffixes : std_suffixes; *ext; ext++)
+ {
+ /* Remove any current extension. */
+ *e = '\0';
+ /* Add the new one. */
+ strcat (full_executable, *ext);
+
+ /* Attempt to open this file. */
+ h = CreateFile (full_executable, GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
+ if (h != INVALID_HANDLE_VALUE)
+ goto found;
}
+ p = q;
}
+ while (*p);
+ free (full_executable);
+ return 0;
+
+ found:
+ CloseHandle (h);
+ return full_executable;
+}
+
+int
+pexec (program, argv, search, stdin_fd, stdout_fd, stderr_fd)
+ const char *program;
+ char *const *argv;
+ int search;
+ int stdin_fd;
+ int stdout_fd;
+ int stderr_fd;
+{
+ char *cmdline = argv_to_cmdline (argv);
+ char *executable = find_executable (program, search);
+ STARTUPINFO si;
+ PROCESS_INFORMATION pinf;
+ HANDLE me;
+
+ /* Canonicalize file descriptor arguments. */
+ stdin_fd = (stdin_fd == STDIN_FILE_NO) ? -1 : stdin_fd;
+ stdout_fd = (stdout_fd == STDOUT_FILE_NO) ? -1 : stdout_fd;
+ stderr_fd = (stderr_fd == STDERR_FILE_NO) ? -1 : stderr_fd;
+
+ memset (&si, 0, sizeof si);
+ si.cb = sizeof si;
+ si.dwFlags = STARTF_USESTDHANDLES;
+ si.hStdInput = INVALID_HANDLE_VALUE;
+ si.hStdOutput = INVALID_HANDLE_VALUE;
+ si.hStdError = INVALID_HANDLE_VALUE;
+
+ me = GetCurrentProcess();
+
+ if (!DuplicateHandle (me,
+ (stdin_fd == -1)
+ ? GetStdHandle (STD_INPUT_HANDLE)
+ : (HANDLE)_get_osfhandle (stdin_fd),
+ me, &si.hStdInput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
+ goto cleanup;
+ if (!DuplicateHandle (me,
+ (stdout_fd == -1)
+ ? GetStdHandle (STD_OUTPUT_HANDLE)
+ : (HANDLE)_get_osfhandle (stdout_fd),
+ me, &si.hStdOutput,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
+ goto cleanup;
+ if (!DuplicateHandle (me,
+ (stderr_fd == -1)
+ ? GetStdHandle (STD_ERROR_HANDLE)
+ : (HANDLE)_get_osfhandle (stderr_fd),
+ me, &si.hStdError,
+ 0, TRUE, DUPLICATE_SAME_ACCESS))
+ goto cleanup;
+
+
+ if (!CreateProcess (executable, cmdline,
+ 0, 0, TRUE, 0, 0, 0,
+ &si, &pinf))
+ goto cleanup;
+
+ CloseHandle (pinf.hThread);
+
+ done:
+ /* Close file descriptors passed to the child (whether or not we
+ managed to create a child). */
+ xclose (stdin_fd);
+ xclose (stdout_fd);
+ if (stderr_fd != stdout_fd)
+ xclose (stderr_fd);
+ if (si.hStdInput != INVALID_HANDLE_VALUE)
+ CloseHandle (si.hStdInput);
+ if (si.hStdOutput != INVALID_HANDLE_VALUE)
+ CloseHandle (si.hStdOutput);
+ if (si.hStdError != INVALID_HANDLE_VALUE)
+ CloseHandle (si.hStdError);
+
+ free (executable);
+ free (cmdline);
+
+ /* Treat the process handle as an integer. It would be cleaner to
+ define a pid_t type that would be used by all libiberty callers;
+ that type would be HANDLE under Windows. However, that would
+ require changing a lot of existing code. */
+ if (sizeof (HANDLE) != sizeof (int))
+ abort ();
+ return (int) pinf.hProcess;
+
+ cleanup:
+ {
+ /* Error strings on win32 include newlines. */
+ char *errstr = get_last_error_as_text ();
+ fprintf (stderr, "%s tried to spawn %s but failed: %s",
+ this_program, program, errstr);
+ LocalFree (errstr);
+ }
+ /* Fortuitously, INVALID_HANDLE_VALUE is -1, which is the
+ conventional error return value for pwait. */
+ pinf.hProcess = INVALID_HANDLE_VALUE;
+ goto done;
+}
+
+/* MSVCRT's _pipe() creates pipes that can be inherited, which is not
+ what we want, so we go directly to CreatePipe(). */
+int
+pmkpipe (thepipe)
+ int thepipe[2];
+{
+ HANDLE read_port;
+ HANDLE write_port;
- return (const char * const *) argvec;
+ if (!CreatePipe (&read_port, &write_port, 0, 0))
+ return -1;
+
+ thepipe[0] = _open_osfhandle ((long)read_port, _O_RDONLY);
+ thepipe[1] = _open_osfhandle ((long)write_port, _O_WRONLY);
+ if (thepipe[0] == -1 || thepipe[1] == -1)
+ {
+ if (thepipe[0] == -1)
+ CloseHandle (read_port);
+ else
+ _close (thepipe[0]);
+ if (thepipe[1] == -1)
+ CloseHandle (write_port);
+ else
+ _close (thepipe[1]);
+ return -1;
+ }
+ return 0;
}
-/* Win32 supports pipes */
int
pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
const char *program;
@@ -141,110 +340,86 @@ pexecute (program, argv, this_pname, temp_base, errmsg_fmt, errmsg_arg, flags)
char **errmsg_fmt, **errmsg_arg;
int flags;
{
- int pid;
- int pdes[2];
- int org_stdin = -1;
- int org_stdout = -1;
- int input_desc, output_desc;
+ /* Pipe waiting from last process, to be used as input for the next
+ one. Value is -1 if no pipe is waiting (i.e. the next command is
+ the first of a group). */
+ static int last_pipe_input = -1;
- /* Pipe waiting from last process, to be used as input for the next one.
- Value is STDIN_FILE_NO if no pipe is waiting
- (i.e. the next command is the first of a group). */
- static int last_pipe_input;
+ int pid;
+ int pdesc[2];
+ int serrno;
+ int child_stdin = -2, child_stdout = -2;
- /* If this is the first process, initialize. */
+ /* If this is the first process, last_pipe_input ought to be -1. */
if (flags & PEXECUTE_FIRST)
- last_pipe_input = STDIN_FILE_NO;
+ if (last_pipe_input != -1)
+ abort ();
- input_desc = last_pipe_input;
+ child_stdin = last_pipe_input;
- /* If this isn't the last process, make a pipe for its output,
- and record it as waiting to be the input to the next process. */
- if (! (flags & PEXECUTE_LAST))
+ /* If this is the last process, don't do anything with its output
+ pipe. */
+ if (flags & PEXECUTE_LAST)
+ child_stdout = -1;
+ else
{
- if (_pipe (pdes, 256, O_BINARY) < 0)
+ /* Create a pipe to go between this process and the next one in
+ the pipeline. */
+ if (pmkpipe (pdesc))
{
*errmsg_fmt = "pipe";
*errmsg_arg = NULL;
return -1;
}
- output_desc = pdes[WRITE_PORT];
- last_pipe_input = pdes[READ_PORT];
- }
- else
- {
- /* Last process. */
- output_desc = STDOUT_FILE_NO;
- last_pipe_input = STDIN_FILE_NO;
- }
-
- if (input_desc != STDIN_FILE_NO)
- {
- org_stdin = dup (STDIN_FILE_NO);
- dup2 (input_desc, STDIN_FILE_NO);
- close (input_desc);
+ last_pipe_input = pdesc[READ_PORT];
+ child_stdout = pdesc[WRITE_PORT];
}
- if (output_desc != STDOUT_FILE_NO)
- {
- org_stdout = dup (STDOUT_FILE_NO);
- dup2 (output_desc, STDOUT_FILE_NO);
- close (output_desc);
- }
+ pid = pexec (program, argv, (flags & PEXECUTE_SEARCH),
+ child_stdin, child_stdout, -1);
- pid = (flags & PEXECUTE_SEARCH ? _spawnvp : _spawnv)
- (_P_NOWAIT, program, fix_argv(argv));
+ serrno = errno;
+ xclose (child_stdin);
+ xclose (child_stdout);
- if (input_desc != STDIN_FILE_NO)
- {
- dup2 (org_stdin, STDIN_FILE_NO);
- close (org_stdin);
- }
+ /* To prevent a file descriptor leak, close last_pipe_input if pexec
+ failed. */
+ if (pid == -1)
+ xclose (last_pipe_input);
- if (output_desc != STDOUT_FILE_NO)
- {
- dup2 (org_stdout, STDOUT_FILE_NO);
- close (org_stdout);
- }
+ errno = serrno;
if (pid == -1)
{
- *errmsg_fmt = install_error_msg;
- *errmsg_arg = (char*) program;
- return -1;
+ *errmsg_fmt = "spawn";
+ *errmsg_arg = NULL;
}
return pid;
}
-/* MS CRTDLL doesn't return enough information in status to decide if the
- child exited due to a signal or not, rather it simply returns an
- integer with the exit code of the child; eg., if the child exited with
- an abort() call and didn't have a handler for SIGABRT, it simply returns
- with status = 3. We fix the status code to conform to the usual WIF*
- macros. Note that WIFSIGNALED will never be true under CRTDLL. */
-
int
pwait (pid, status, flags)
int pid;
int *status;
int flags ATTRIBUTE_UNUSED;
{
- int termstat;
-
- pid = _cwait (&termstat, pid, WAIT_CHILD);
-
- /* ??? Here's an opportunity to canonicalize the values in STATUS.
- Needed? */
-
- /* cwait returns the child process exit code in termstat.
- A value of 3 indicates that the child caught a signal, but not
- which one. Since only SIGABRT, SIGFPE and SIGINT do anything, we
- report SIGABRT. */
- if (termstat == 3)
- *status = SIGABRT;
- else
- *status = (((termstat) & 0xff) << 8);
+ /* The return value from pexecute is actually a HANDLE. */
+ HANDLE proch = (HANDLE) pid;
+ if (WaitForSingleObject (proch, INFINITE) != WAIT_OBJECT_0)
+ {
+ CloseHandle (proch);
+ return -1;
+ }
+ GetExitCodeProcess (proch, (DWORD *)status);
+ CloseHandle (proch);
return pid;
}
+
+void
+pexec_set_program_name (name)
+ const char *name;
+{
+ this_program = name;
+}
diff --git a/libiberty/testsuite/Makefile.in b/libiberty/testsuite/Makefile.in
index 515dcd56b7e..6f2a4fe4b39 100644
--- a/libiberty/testsuite/Makefile.in
+++ b/libiberty/testsuite/Makefile.in
@@ -49,7 +49,7 @@ check-cplus-dem: test-demangle $(srcdir)/demangle-expected
./test-demangle < $(srcdir)/demangle-expected
TEST_COMPILE = $(CC) @DEFS@ $(LIBCFLAGS) -I.. -I$(INCDIR) $(HDEFINES)
-test-demangle: $(srcdir)/test-demangle.c
+test-demangle: $(srcdir)/test-demangle.c ../libiberty.a
$(TEST_COMPILE) -o test-demangle \
$(srcdir)/test-demangle.c ../libiberty.a
diff --git a/libiberty/testsuite/demangle-expected b/libiberty/testsuite/demangle-expected
index 8dfab8e9bd0..dd36b7a24fd 100644
--- a/libiberty/testsuite/demangle-expected
+++ b/libiberty/testsuite/demangle-expected
@@ -2591,6 +2591,10 @@ Prim.i(int, boolean, byte, double, float, char, java.lang.String, short, long)
_ZN4java4util14Map__U24_Entry11class__U24_E
java.util.Map$Entry.class$
#
+--format=java
+_ZN3org7eclipse3cdt5debug8internal4core5model9CVariable6sizeof$Ev
+org.eclipse.cdt.debug.internal.core.model.CVariable.sizeof()
+#
--format=hp
_Utf58_0_1__1_2147483647__2147483648
_Utf58_0_1__1_2147483647__2147483648
@@ -2629,7 +2633,7 @@ operator<<(X const&, X const&)
#
--format=gnu-v3
_ZN3FooIA4_iE3barE
-Foo<int[4]>::bar
+Foo<int [4]>::bar
#
--format=gnu-v3
_Z1fIiEvi
@@ -2697,7 +2701,7 @@ typeinfo for a_class
#
--format=gnu-v3
U4_farrVKPi
-int* restrict volatile const _far
+int* const volatile restrict _far
#
--format=gnu-v3
_Z3fooILi2EEvRAplT_Li1E_i
@@ -2749,11 +2753,11 @@ f(int (* const)(int))
#
--format=gnu-v3
_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i
-f(int[sizeof(N::A::f() const::foo)])
+f(int [sizeof (N::A::f() const::foo)])
#
--format=gnu-v3
_Z1fA37_iPS_
-f(int[37], int (*) [37])
+f(int [37], int (*) [37])
#
--format=gnu-v3
_Z1fM1AFivEPS0_
@@ -2777,7 +2781,7 @@ s(int (*) [37], int (**) [37])
#
--format=gnu-v3
_Z3fooA30_A_i
-foo(int[30][])
+foo(int [30][])
#
--format=gnu-v3
_Z3kooPA28_A30_i
@@ -2858,12 +2862,106 @@ global constructors keyed to _Z2fnv
--format=gnu-v3
_Z1rM1GFivEMS_KFivES_M1HFivES1_4whatIKS_E5what2IS8_ES3_
r(int (G::*)(), int (G::*)() const, G, int (H::*)(), int (G::*)(), what<G const>, what2<G const>, int (G::*)() const)
-#
+#
+# This is from the gdb testsuite gdb.cp/cplusfuncs.exp.
+--format=gnu-v3
+_Z10hairyfunc5PFPFilEPcE
+hairyfunc5(int (*(*)(char*))(long))
+#
+# This is from gcc PR 8861
+--format=gnu-v3
+_Z1fILi1ELc120EEv1AIXplT_cviLd810000000000000000703DAD7A370C5EEE
+void f<1, 120>(A<(1) + (((int)((double)810000000000000000703DAD7A370C5)))>)
+#
+# This is also from gcc PR 8861
+--format=gnu-v3
+_Z1fILi1EEv1AIXplT_cvingLf3f800000EEE
+void f<1>(A<(1) + (((int)(-((float)3f800000))))>)
+#
+# This is from a libstdc++ debug mode patch.
+--format=gnu-v3
+_ZNK11__gnu_debug16_Error_formatter14_M_format_wordImEEvPciPKcT_
+void __gnu_debug::_Error_formatter::_M_format_word<unsigned long>(char*, int, char const*, unsigned long) const
+#
+# The new demangler used to core dump on this.
+--format=gnu-v3
+_ZSt18uninitialized_copyIN9__gnu_cxx17__normal_iteratorIPSt4pairISsPFbP6sqlitePPcEESt6vectorIS9_SaIS9_EEEESE_ET0_T_SG_SF_
+__gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > > std::uninitialized_copy<__gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > >, __gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > > >(__gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > >, __gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > >, __gnu_cxx::__normal_iterator<std::pair<std::string, bool (*)(sqlite*, char**)>*, std::vector<std::pair<std::string, bool (*)(sqlite*, char**)>, std::allocator<std::pair<std::string, bool (*)(sqlite*, char**)> > > >)
+#
+# The new demangler used to fail on this.
+--format=gnu-v3
+_Z1fP1cIPFiiEE
+f(c<int (*)(int)>*)
+#
+# Wrap expressions using '>' in an extra layer of parens to avoid
+# confusion with the '>' which ends the template parameters.
+--format=gnu-v3
+_Z4dep9ILi3EEvP3fooIXgtT_Li2EEE
+void dep9<3>(foo<((3) > (2))>*)
+#
+# Watch out for templated version of `operator<'--it needs an extra
+# space.
+--format=gnu-v3
+_ZStltI9file_pathSsEbRKSt4pairIT_T0_ES6_
+bool std::operator< <file_path, std::string>(std::pair<file_path, std::string> const&, std::pair<file_path, std::string> const&)
+#
+# More hairy qualifier handling.
+--format=gnu-v3
+_Z9hairyfuncM1YKFPVPFrPA2_PM1XKFKPA3_ilEPcEiE
+hairyfunc(int (* const (X::** (* restrict (* volatile*(Y::*)(int) const)(char*)) [2])(long) const) [3])
+#
+# Check that negative numbers are handled correctly.
+--format=gnu-v3
+_Z1fILin1EEvv
+void f<-1>()
+#
+# Check a destructor of a standard substitution.
+--format=gnu-v3
+_ZNSdD0Ev
+std::basic_iostream<char, std::char_traits<char> >::~basic_iostream()
+#
+# Another case where we got member function qualifiers wrong.
+--format=gnu-v3
+_ZNK15nsBaseHashtableI15nsUint32HashKey8nsCOMPtrI4IFooEPS2_E13EnumerateReadEPF15PLDHashOperatorRKjS4_PvES9_
+nsBaseHashtable<nsUint32HashKey, nsCOMPtr<IFoo>, IFoo*>::EnumerateRead(PLDHashOperator (*)(unsigned int const&, IFoo*, void*), void*) const
+#
+# Another member function qualifier test case, when the member function
+# returns a pointer to function.
+--format=gnu-v3
+_ZNK1C1fIiEEPFivEv
+int (*C::f<int>() const)()
+#
+# Another case where we got member function qualifiers wrong.
+--format=gnu-v3
+_ZZ3BBdI3FooEvvENK3Fob3FabEv
+void BBd<Foo>()::Fob::Fab() const
+#
+# The same idea one level deeper.
+--format=gnu-v3
+_ZZZ3BBdI3FooEvvENK3Fob3FabEvENK3Gob3GabEv
+void BBd<Foo>()::Fob::Fab() const::Gob::Gab() const
+#
+# Yet another member function qualifier problem.
+--format=gnu-v3
+_ZNK5boost6spirit5matchI13rcs_deltatextEcvMNS0_4impl5dummyEFvvEEv
+boost::spirit::match<rcs_deltatext>::operator void (boost::spirit::impl::dummy::*)()() const
+#
# This caused an infinite loop.
-# We still don't demangle this correctly, but at least we don't hang.
+#
+# This is generated by an EDG compiler (kcc 4.0). To demangle it
+# correctly, I believe that we have to understand that the J37J deep
+# in the string somehow refers back to the type starting 37 characters
+# in from some starting point, so that it winds up being the type
+# starting with 41THandle.... However, lacking a spec for EDG
+# demangling, it's hard to implement this.
+#
+# In the meantime, this symbol can be successfully demangled in GNU
+# mode. Of course the result is more or less nonsense, but an older
+# version of g++ would indeed generate this mangled name given the
+# appropriate input, so the demangling is correct.
--format=auto
__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator
-__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm__7_Z1ZZ2Z8iterator
+_Z1ZZ2Z::__CPR212____ct__Q3_3std141list__tm__128_Q2_3edm41THandle__tm__26_Q2_4emid15EMparticleChunkQ2_3std68allocator__tm__51_Q2_3edmJ37J14const_iteratorFRCQ3_3std18list__tm(iterator)
#
# This used to cause a crash. It doesn't follow the C++ encoding so
# the demangled name should be identical to the original symbol name.
diff --git a/libiberty/testsuite/test-demangle.c b/libiberty/testsuite/test-demangle.c
index 6e5d0b4b973..ed28229ca34 100644
--- a/libiberty/testsuite/test-demangle.c
+++ b/libiberty/testsuite/test-demangle.c
@@ -146,7 +146,7 @@ main(argc, argv)
cplus_demangle_set_style (style);
result = cplus_demangle (input.data,
- DMGL_PARAMS|DMGL_ANSI|DMGL_VERBOSE|DMGL_TYPES);
+ DMGL_PARAMS|DMGL_ANSI|DMGL_TYPES);
if (result
? strcmp (result, expect.data)
diff --git a/libiberty/vasprintf.c b/libiberty/vasprintf.c
index 775260475cb..d3d4f3a1553 100644
--- a/libiberty/vasprintf.c
+++ b/libiberty/vasprintf.c
@@ -59,13 +59,13 @@ not be allocated, minus one is returned and @code{NULL} is stored in
*/
-static int int_vasprintf PARAMS ((char **, const char *, va_list *));
+static int int_vasprintf PARAMS ((char **, const char *, va_list));
static int
int_vasprintf (result, format, args)
char **result;
const char *format;
- va_list *args;
+ va_list args;
{
const char *p = format;
/* Add one to make sure that it is never zero, which might cause malloc
@@ -73,7 +73,11 @@ int_vasprintf (result, format, args)
int total_width = strlen (format) + 1;
va_list ap;
- memcpy ((PTR) &ap, (PTR) args, sizeof (va_list));
+#ifdef va_copy
+ va_copy (ap, args);
+#else
+ memcpy ((PTR) &ap, (PTR) &args, sizeof (va_list));
+#endif
while (*p != '\0')
{
@@ -135,12 +139,15 @@ int_vasprintf (result, format, args)
p++;
}
}
+#ifdef va_copy
+ va_end (ap);
+#endif
#ifdef TEST
global_total_width = total_width;
#endif
*result = (char *) malloc (total_width);
if (*result != NULL)
- return vsprintf (*result, format, *args);
+ return vsprintf (*result, format, args);
else
return -1;
}
@@ -155,7 +162,7 @@ vasprintf (result, format, args)
va_list args;
#endif
{
- return int_vasprintf (result, format, &args);
+ return int_vasprintf (result, format, args);
}
#ifdef TEST
diff --git a/libjava/ChangeLog b/libjava/ChangeLog
index d4c19813d11..9211c7c91f6 100644
--- a/libjava/ChangeLog
+++ b/libjava/ChangeLog
@@ -1,3 +1,2195 @@
+2003-12-30 Michael Koch <konqueror@gmx.de>
+
+ * java/io/ObjectInputStream.java,
+ java/io/ObjectOutputStream.java,
+ java/io/ObjectStreamClass.java:
+ Reformated, no functional code changes.
+
+2003-12-30 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (outputStream): New field.
+ (bufferedOutputStream): New field.
+ (connect): Initialize outputStream and bufferedOutputStream.
+ (sendRequest): Create PrintWriter object from outputStream,
+ support HTTP 1.1, send missing HTTP headers and buffered output data
+ for POST method.
+ (getOutputStream): Set request method to POST if output stream is
+ used, return bufferedOutputStream.
+ (setRequestMethod): Allow HEAD and POST methods.
+ This fixes libgcj PR/6302 and libgcj PR/7752.
+
+2003-12-30 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/LineNumberReader.java
+ (countLines): Removed.
+ (fill): New private method.
+ (mark): Changed logic to use and matchedNewLine.
+ (reset): Likewise.
+ (read): Likewise.
+ (skipRedundantLF): Likewise.
+
+2003-12-30 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (requestProperties): New field.
+ (addRequestProperty): New method.
+ (getRequestProperty): New method.
+ (setRequestProperty): New method.
+ (getRequestProperties): New method.
+
+2003-12-28 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (inputStream): Made it a DataInputStream.
+ (requestProperties): Removed.
+ (hdrHash): Removed.
+ (hdrVec): Removed.
+ (headers): New field to store headers.
+ (connect): Initialize inputStream.
+ (receiveReply): Merged from classpath. The new algorithm is line based
+ instead of character based.
+ (getHeaderField): Use headers.
+ (getHeaderFields): Use headers.
+ (getKey): Removed.
+ (getField): Removed.
+ * gnu/java/net/HeaderFieldHelper.java: New file.
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu/java/net/HeaderFieldHelper.java.
+ * Makefile.in: Regenerated.
+
+2003-12-28 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/LineNumberReader.java
+ (mark): Improved error checking.
+ (read): Likewise.
+ (skip): Likewise. Skip is now really eating the specified number of
+ characters.
+ * java/io/CharArrayReader.java (read): It should throw
+ IndexOutOfBoundsException and not ArrayIndexOutOfBoundsException (see
+ mauve).
+ * java/io/BufferedReader.java (readLine): Make readLine() really block
+ until either EOF is reached or a true error happens.
+
+2003-12-27 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (getRequestProperty): Removed.
+ (setRequestProperty): Removed.
+
+2003-12-27 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (connect): Call receiveReply().
+ (receiveReply): Renamed from getHttpHeaders().
+ (getOutputStream): Moved check on doOutput before check for connection
+ state.
+
+2003-12-27 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/ResolutionSyntax.java,
+ javax/print/attribute/SetOfIntegerSyntax.java,
+ javax/print/attribute/Size2DSyntax.java,
+ javax/print/attribute/standard/Copies.java,
+ javax/print/attribute/standard/JobImpressions.java,
+ javax/print/attribute/standard/JobMediaSheets.java,
+ javax/print/attribute/standard/NumberOfDocuments.java,
+ javax/print/attribute/standard/NumberOfInterveningJobs.java,
+ javax/print/attribute/standard/PagesPerMinute.java,
+ javax/print/attribute/standard/PagesPerMinuteColor.java,
+ javax/print/attribute/standard/QueuedJobCount.java:
+ Fixed typo (s/then/than/).
+
+2003-12-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/rmi/Naming.java (lookup): Check if the first character of the
+ filename returned by URL.getFile() is a '/', only if it is the case
+ we cut this first character and call the registry with the good name.
+ (bind): Likewise.
+ (rebind): Likewise.
+
+2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
+ Mark Wielaard <mark@klomp.org>
+
+ * java/io/BufferedReader.java (BufferedReader):
+ Throw IllegalArgumentException when size <= 0.
+ (mark): Document and better exception message for negative
+ readLimit IllegalArgumentException.
+ (read(char[],int,int)): Throw IndexOutOfBoundsException
+ if offset and count are not valid regarding buf.
+ (skip): Throw IllegalArgumentException when count is negative.
+
+2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/FileInputStream.java
+ (FileInputStream(String)): Call FileInputStream(File).
+ (FileInputStream(File)): Check whether the argument is a directory.
+
+2003-12-26 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (rmi_java_source_files):
+ Added gnu/java/rmi/server/RMIVoidValue.java.
+ * Makefile.in: Regenerated.
+
+2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
+ Mark Wielaard <mark@klomp.org>
+
+ * gnu/java/rmi/server/UnicastConnectionManager.java
+ (startScavenger): Set the client connection manager to daemon
+ state because it may block clients until TIMEOUT is reached
+ when they are exiting.
+
+ * gnu/java/rmi/RMIVoidValue.java: New file for a class representing
+ a void return.
+
+ * gnu/java/rmi/server/UnicastRemoteCall.java
+ (DummyOutputStream): Add a boolean before each written field to
+ know whether it is a primitive.
+ (releaseOutputStream): Flush parameters at write time.
+
+ * gnu/java/rmi/server/UnicastServerRef.java
+ (incomingMessageCall): Return a RMIVoidValue if no value is to be
+ returned.
+
+ * gnu/java/rmi/server/UnicastServer.java
+ (incomingMessageCall): Do not write a returned object if it is
+ a RMIVoidValue.
+
+2003-12-25 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * libltdl/ltdl.c (HAVE_DYLD): Remove ifdef conditional for
+ darwin. Fixed by fixinclude now.
+
+2003-12-25 Michael Koch <konqueror@gmx.de>
+
+ * java/net/ServerSocket.java bind():
+ If InetSocketAddress.getAddress() returns "null" use "0.0.0.0" as
+ address to bind to.
+
+2003-12-23 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/ObjectInputStream.java
+ (getField): Handle transient and non persistent fields.
+ (readClassDescriptor): Better error handling, use the right
+ class loader.
+ (readFields): Fields marked as not present in the stream
+ or not to be set are not read and set.
+ * java/io/ObjectInputStream.java
+ (readFields): Changed implementation of GetField.
+ (readClassDescriptor): Documented.
+ * java/io/ObjectOutputStream.java
+ (writeClassDescriptor): Added condition when to write class super
+ class information.
+
+2003-12-22 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkChoicePeer.java (postItemEvent): Rename to...
+ (choicePostItemEvent): Change signature to more specific String object.
+ * java/awt/Choice.java (add): Generate ItemEvent for the first item
+ added.
+ (insert): Generate ItemEvent if insertion caused
+ selection to change.
+ (remove): Generate ItemEvent if removal cause selection to change.
+ (removeAll): Change algorithm to prevent generation of ItemEvents.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (connect_choice_item_selectable_hook): Change argument type.
+ Fix argument value.
+ Make sure resources are feed by registering callback.
+ (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append): Adjust call to the
+ above function.
+ (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add): Ditto.
+ (item_activate): Ditto.
+ (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove): Destroy removed
+ menuitem.
+ (item_removed): New function. Free resources.
+ * jni/gtk-peer/gtkpeer.h (item_event_hook_info): Change member type and
+ name.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+ (Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): Obtain MethodID for
+ choicePostItemEvent.
+
+2003-12-23 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/standard/Copies.java,
+ javax/print/attribute/standard/JobImpressions.java,
+ javax/print/attribute/standard/JobMediaSheets.java,
+ javax/print/attribute/standard/JobPriority.java,
+ javax/print/attribute/standard/NumberOfDocuments.java,
+ javax/print/attribute/standard/NumberOfInterveningJobs.java,
+ javax/print/attribute/standard/NumberUp.java,
+ javax/print/attribute/standard/PagesPerMinuteColor.java,
+ javax/print/attribute/standard/PagesPerMinute.java,
+ javax/print/attribute/standard/QueuedJobCount.java: New files.
+ * Makefile.am (ordinary_java_source_files): Added new files.
+ * Makefile.in: Regenerated.
+
+2003-12-23 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/AttributeSetUtilities.java
+ (verifyCategoryForValue): Renamed from verifyCategoryForAttribute.
+ * javax/print/attribute/HashAttributeSet.java
+ (HashAttributeSet): Call internal add methods, added missing
+ exceptions.
+ (add): Call addInternal, added exceptions to documentation.
+ (addInternal): New method.
+ (addAll): Call addAllInternal, added exception to documentation.
+ (addAllInternal): New method.
+ (clear): Added exception to documentation.
+ (remove): Likewise.
+ * javax/print/attribute/URISyntax.java
+ (serialVersionUID): Fixed value.
+
+2003-12-22 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (pre_event_handler): Don't dereference NULL focus_obj_ptr.
+
+2003-12-21 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/AttributeSetUtilities.java,
+ javax/print/attribute/HashAttributeSet.java,
+ javax/print/attribute/HashDocAttributeSet.java,
+ javax/print/attribute/HashPrintJobAttributeSet.java,
+ javax/print/attribute/HashPrintRequestAttributeSet.java,
+ javax/print/attribute/HashPrintServiceAttributeSet.java: New files.
+ * Makefile.am (ordinary_java_source_files): Added new files.
+ * Makefile.in: Regenerated.
+
+2003-12-21 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/EnumSyntax.java,
+ javax/print/attribute/SetOfIntegerSyntax.java: New files.
+ * Makefile.am (ordinary_java_source_files):
+ Added javax/print/attribute/EnumSyntax.java
+ and javax/print/attribute/SetOfIntegerSyntax.java.
+ * Makefile.in: Regenerated.
+
+2003-12-21 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/PrintJobAttribute.java,
+ javax/print/attribute/PrintJobAttributeSet.java,
+ javax/print/attribute/PrintRequestAttribute.java,
+ javax/print/attribute/PrintServiceAttribute.java,
+ javax/print/attribute/PrintServiceAttributeSet.java,
+ javax/print/attribute/SupportedValuesAttribute.java: New files.
+ * Makefile.am (ordinary_java_source_files): Added new files.
+ * Makefile.in: Regenerated.
+
+2003-12-21 Michael Koch <konqueror@gmx.de>
+
+ * javax/print/attribute/DateTimeSyntax.java,
+ javax/print/attribute/DocAttribute.java,
+ javax/print/attribute/DocAttributeSet.java,
+ javax/print/attribute/IntegerSyntax.java,
+ javax/print/attribute/ResolutionSyntax.java,
+ javax/print/attribute/Size2DSyntax.java,
+ javax/print/attribute/TextSyntax.java,
+ javax/print/attribute/URISyntax.java,
+ javax/print/attribute/UnmodifiableSetException.java: New files.
+ * Makefile.am (ordinary_java_source_files): Added new files.
+ * Makefile.in: Regenerated.
+
+2003-12-21 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/PlainDatagramSocketImpl.java
+ (mcastGrp): Added documentation.
+
+2003-12-20 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/jar/Connection.java
+ (connectionCache): New field.
+ (connect): New method.
+ (getInputStream): New method.
+ (hdrHash): New field.
+ (hdrVec): New field.
+ (gotHeaders): New field.
+ (getHeaderField): New method.
+ (getHeaderFields): New method.
+ (getHeaderFieldKey): New method.
+ (getKey): New method.
+ (getField): New method.
+ (getHeaders): New method.
+ * java/net/JarURLConnection.java
+ (connectionCache): Removed.
+ (connect): Removed.
+ (getInputStream): Removed.
+ (hdrHash): Removed.
+ (hdrVec): Removed.
+ (gotHeaders): Removed.
+ (getHeaderField): Removed.
+ (getHeaderFields): Removed.
+ (getHeaderFieldKey): Removed.
+ (getKey): Removed.
+ (getField): Removed.
+ (getHeaders): Removed.
+
+2003-12-20 Michael Koch <konqueror@gmx.de>
+
+ * java/io/ObjectStreamField.java (isUnshared): Added documentation.
+
+2003-12-20 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/nio/SelectorImpl.java
+ (selectThreadMutex): New field.
+ (selectThread): New field.
+ (unhandledWakeup): New field.
+ (implCloseSelector): Added skeleton code which
+ synchronizes as per Sun JRE JavaDoc.
+ (keys): Throw ClosedSelectorException if selector
+ is closed.
+ (selectNow): Added comment that we're faking out
+ an immediate select with a one-microsecond-timeout one.
+ (select): Use 0 instead of -1 for infinite timeout.
+ (implSelect): Changed comment in declaration.
+ (select): Added synchronized to method declaration.
+ Added synchronization and wakeup support as per Sun
+ JRE JavaDoc.
+ (selectedKeys): Throw ClosedSelectorException if selector
+ is closed.
+ (wakeup): Implemented.
+ (deregisterCancelledKeys): Synchronize on cancelled key
+ set before deregistering.
+ (register): Synchronize on key set before registering.
+ * java/nio/channels/spi/AbstractSelector.java
+ Added import for java.nio.channels.ClosedSelectorException.
+ (close): Added synchronized to method declaration.
+ (cancelledKeys): Throw ClosedSelectorException if selector
+ is closed.
+ (cancelKey): Synchronize on cancelled key set before key.
+
+2003-12-20 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu.java.net.URLParseError.java.
+ * Makefile.in: Regenerated.
+
+2003-12-20 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * gnu/java/net/URLParseError.java: New file.
+ * gnu/java/net/protocol/jar/Handler.java
+ (parseURL): Throw URLParseError if needed, fix '/' handling.
+ * java/net/URL.java (URL): Catch URLParseError and
+ transform it into a MalformedURLException.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/ChannelOutputStream.java: New file.
+ * java/nio/channels/Channels.java
+ (newOutputStream): Implemented.
+ * Makefile.am (ordinary_java_source_files)
+ Added gnu/java/nio/ChannelOutputStream.java.
+ * Makefile.in: Regenerated.
+
+2003-12-19 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/FlowLayout.java (layoutContainer): Let components
+ assume their preferred height. Centre components vertically.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/ChannelInputStream.java: New file.
+ * java/nio/channels/Channels.java (newInputStream): Implemented.
+ * java/nio/channels/FileChannelImpl.java
+ (readImpl): Only put data into buffer if something was read.
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu/java/nio/ChannelInputStream.java.
+ * Makefile.in: Regenerated.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/OutputStreamChannel.java: New file.
+ * java/nio/channels/Channels.java (newChannel): Implemented.
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu/java/nio/OutputStreamChannel.java.
+ * Makefile.in: Regenerated.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (ordinary_java_source_files):
+ Added gnu.java.nio.InputStreamChannel.
+ * Makefile.in: Regenerated.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/InputStreamChannel.java: New file.
+ * java/nio/channels/Channels.java (newChannel): Implemented.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * java/util/SimpleTimeZone.java
+ (setStartRule): Reformated documentation.
+ (setEndRule): Reworked documentation.
+ (getDSTSavings): Fixed @since tag.
+ (setDSTSavings): New method.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * java/text/NumberFormat.java: Sorted imports.
+ (getCurrency): New method.
+ (setCurrency): New method.
+
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * java/text/MessageFormat.java
+ (MessageFormat): New constructor.
+
+2003-12-19 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/jar/Handler.java
+ (parseURL): New method.
+ (toExternalForm): New method.
+
+2003-12-18 Fernando Nasser <fnasser@redhat.com>
+
+ * java/awt/List.java (replaceItem): Prevent selection to move with
+ replace and minimize flickering.
+
+2003-12-18 Michael Koch <konqueror@gmx.de>
+
+ * libltdl/ltdl.c: Define __private_extern__ if needed.
+
+2003-12-18 Michael Koch <konqueror@gmx.de>
+
+ * libltdl/.cvsignore: Ignore autom4te.cache
+ * libltdl/Makefile.in: Regenerated.
+ * libltdl/aclocal.m4: Regenerated.
+ * libltdl/acconfig.h: Removed (obsolete).
+ * libltdl/config-h.in: Regenerated.
+ * libltdl/configure.ac: Added AM_MAINTAINER_MODE.
+ * libltdl/configure: Regenerated.
+
+2003-12-18 Michael Koch <konqueror@gmx.de>
+
+ * mauve-libgcj: Removed the disabling of java.text.ACIAttribute and
+ java.text.CollationElementIterator tests as they compile again.
+ * testsuite/libjava.mauve/xfails: Added failing
+ java.text.CollationElementIterator tests.
+
+2003-12-18 Michael Koch <konqueror@gmx.de>
+
+ * java/util/prefs/AbstractPreferences.java
+ (cachedChildren): New method.
+
+2003-12-18 Michael Koch <konqueror@gmx.de>
+
+ * java/util/TimeZone.java (getOffset): New method.
+
+2003-12-17 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation
+ of ActionEvents for mouse double-clicks.
+
+2003-12-17 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkContainerPeer.java (handleEvent): Check for
+ null Graphics pointer returned by FileDialogPeer.
+
+2003-12-17 Michael Koch <konqueror@gmx.de>
+
+ * libltdl/stamp-h.in: Removed, not used anymore.
+
+2003-12-16 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/net/natPlainDatagramSocketImplWin32.cc:
+ Removed unused InterruptedIOException.h include.
+ * gnu/java/net/natPlainSocketImplWin32.cc
+ (connect): Reset and ignore our thread's interrupted
+ flag instead of testing and throwing an InterruptedIOException
+ if set.
+ (accept): Likewise + changed case of SocketTimeoutException
+ text.
+ (write): Likewise (for both overloads).
+ (doRead): Likewise.
+
+2003-12-16 Mohan Embar <gnustuff@thisiscool.com>
+
+ * win32.cc (WSAEventWrapper): Implemented default
+ constructor and init() methods.
+ (_Jv_select): Removed.
+ * gnu/java/nio/natSelectorImplWin32.cc
+ (helper_put_filedescriptors): Removed.
+ (helper_get_filedescriptors): Removed.
+ (implSelect): Implemented in terms of WSAEventWrapper
+ and WSAWaitForMultipleEvents instead of _Jv_select().
+ Added support for thread interruption.
+ * include/win32.h (WSAEventWrapper): Minor formatting
+ changes; added default constructor declaration, init(),
+ getFD() and getEventHandle() methods.
+ (_Jv_select): Removed.
+
+2003-12-16 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/net/natPlainDatagramSocketImplPosix.cc
+ (peekData): Throw SocketTimeoutException instead of
+ InterruptedIOException on timeout.
+ (receive): Likewise.
+ * gnu/java/net/natPlainSocketImplPosix.cc
+ (read): Made a minor exception text case change.
+
+2003-12-16 Michael Koch <konqueror@gmx.de>
+
+ Fix for PR libgcj/13056.
+ * libltdl/configure.in,
+ libltdl/config.h.in: Removed.
+ * libltdl/configure.ac,
+ libltdl/config-h.in,
+ libltdl/install-sh,
+ libltdl/config.guess,
+ libltdl/config.sub,
+ libltdl/missing,
+ libltdl/mkinstalldirs,
+ libltdl/ltmain.sh: New files.
+ * libltdl/Makefile.am,
+ libltdl/acinclude.m4,
+ libltdl/aclocal.m4,
+ libltdl/ltdl.c,
+ libltdl/ltdl.h,
+ libltdl/README: Update to versions from libtool 1.5.
+ libltdl/configure,
+ * libltdl/Makefile.in: Regenerated.
+ * java/lang/natRuntime.cc (find_symbol):
+ Use type 'lt_ptr' instead of 'lt_ptr_t'.
+
+2003-12-16 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/MenuComponent.java
+ (serialVersionUID): Fixed value.
+
+2003-12-16 Fernando Nasser <fnasser@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (pre_event_handler): Handle GtkButton widgets differently as events
+ go to its event_window.
+ (connect_awt_hook): Remove compiler warning.
+
+i2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/ObjectInputStream.java
+ (lookupClass): New method.
+ (currentLoader): New method.
+ (inputGetObjectStreamClasses): New method.
+ (assignNewHandle): Documented.
+ (currentClassLoader): Documented.
+ * java/io/ObjectStreamClass.java
+ (setClass): Changed API. Better handling of the imported/exported
+ fields.
+ (getSerialPersistentFields): Make it throw previously caught exceptions
+ so they can handled in setClass.
+
+2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/ObjectStreamField.java: A few methods were added in prevision
+ of the upcoming upgrade of the serialization code. This also adds
+ some missing documentation.
+ (ObjectStreamField): We should throw a NullPointerException when 'name'
+ is null.
+
+ 2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/io/ObjectInputStream.java (setBooleanField):
+ Throw an InvalidClassException if the field hasn't the required type,
+ documentation added.
+ (setByteField) Likewise.
+ (setCharField) Likewise.
+ (setDoubleField) Likewise.
+ (setFloatField) Likewise.
+ (setIntField) Likewise.
+ (setShortField) Likewise.
+ (setLongField) Likewise.
+ (setObjectField) Likewise.
+
+2003-12-16 Guilhem Lavaux <guilhem@kaffe.org>
+ Helmer Kraemer <hkraemer@freenet.de>
+
+ * gnu/java/lang/reflect/TypeSignature.java (getClassForEncoding):
+ Splitted the method so we can specify an explicit boot loader.
+
+2003-12-15 Graydon Hoare <graydon@redhat.com>
+
+ * jni/gtk-peer/gdkfont.h: New file.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c: Remove
+ include of cairo-xlib.h, add extra gdk_flush().
+
+2003-12-12 Fernando Nasser <fnasser@redhat.com>
+
+ * jni/gtk-peer/gtkpeer.h: Extend NSA set of macros to handle a second
+ native state table -- native_global_ref_table.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c: Define
+ native_global_ref_table pointer.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose): Make sure JNI
+ global reference is deleted and memory allocated for pointer freed.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (pre_event_handler): Remove compilation warning.
+ (connect_awt_hook): Use saved JNI global reference instead of creating
+ a new one.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create): Save JNI global
+ reference to the Java object.
+ (Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals): Remove
+ unused variable declaration and add comment.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create): Save JNI global
+ reference to the Java object.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate): Ditto.
+ (Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference.
+ (item_toggled): Add debug statement.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create): Save JNI global
+ reference to the Java object.
+ (connect_choice_item_selectable_hook): Use saved JNI global references
+ instead of JNI local reference.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create): Save JNI
+ global reference to the Java object.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create): Save JNI global
+ reference to the Java object.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkListPeer_create): Ditto.
+ (Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference.
+ (item_selected): Add debug statement.
+ (item_unselected): Add debug statement.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create): Save JNI global
+ reference to the Java object.
+ Connect "activate" signal handler using global JNI reference.
+ (connect_activate_hook): Removed in favor of inline code.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create): Save JNI global
+ reference to the Java object.
+ (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference. Add FIXME comment.
+ (Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew): Save JNI global
+ reference to the Java object. Add FIXME comment.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create): Save JNI global
+ reference to the Java object.
+ (Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals): Use
+ saved JNI global reference instead of JNI local reference.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create): Save JNI global
+ reference to the Java object.
+ (Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals): Use saved
+ JNI global reference instead of JNI local reference.
+
+2003-12-11 Michael Koch <konqueror@gmx.de>
+
+ * java/text/Format.java (serialVersionUID): Fixed value.
+
+2003-12-11 Michael Koch <konqueror@gmx.de>
+
+ * javax/naming/event/EventDirContext.java: Jalopied.
+ (addNamingListener): Fixed typo in method name.
+
+
+2003-12-11 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/nio/SocketChannelImpl.java
+ (write): Removed diagnostic trace.
+ * gnu/java/nio/natSelectorImplPosix.cc: Added
+ includes for java.lang.Thread and java.io.InterruptedIOException.
+ (helper_put_filedescriptors): Don't put invalid file descriptors
+ in select set.
+ (helper_get_filedescriptors): Clear invalid file descriptors
+ from select set.
+ (helper_reset): New method for clearing our file descriptor
+ array.
+ (implSelect): Correctly calculate timeout if specified and
+ legal.
+ Intercept and deal with any java.io.InterruptedIOException
+ thrown by _Jv_select().
+
+2003-12-08 Fernando Nasser <fnasser@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler):
+ Most coded moved to pre_event_handler, with the modifications
+ mentioned below.
+ (pre_event_handler): New function. Called on the Gtk "event" signal.
+ Do not retrieve the jobject from the window property as it is already
+ available as user data in the signal.
+ Do not try and find the grab widget as it is already done by Gtk at
+ this point.
+ Do not search for Window ancestor as Gtk already sends the signal to it.
+ Do not meddle with the activation state of peer widgets on each
+ key press or release.
+ Add CList to the special handling when looking for the focused widget.
+ * jni/gtk-peer/gtkpeer.h: Add declaration for pre_event_handler.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c (connectJObject):
+ New function.
+ (connectSignals): New function.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c (connectHooks):
+ Rename to...
+ (connectSignals): New name. Get rid of NewGlobalRef call.
+ Use g_signal_connect instead of deprecated gtk_signal_connect.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+ (connect_choice_item_selectable_hook): Use g_signal_connect instead of
+ deprecated gtk_signal_connect.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New
+ function.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New
+ function.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_old_create): Remove dead
+ code.
+ (item_select): Remove indirection.
+ (item_unselect): Ditto.
+ (connect_selectable_hook): Folded into connectSignals.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject): New
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New
+ function.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c: Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks): Remove
+ function.
+ (Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals): New
+ function.
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java: Declare and call
+ connectJObject and connectSignals instead of connectHooks.
+ * gnu/java/awt/peer/gtk/GtkButtonPeer.java: Declare connectJObject and
+ connectSignals.
+ * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java: Declare connectSignals
+ and not connectHooks.
+ * gnu/java/awt/peer/gtk/GtkTextComponentPeer.java: Ditto.
+ * gnu/java/awt/peer/gtk/GtkFileDialogPeer.java: Declare connectJObject
+ and not connectHooks.
+ * gnu/java/awt/peer/gtk/GtkListPeer.java: Declare connectJObject and
+ connectSignals instead of connectHooks.
+ * gnu/java/awt/peer/gtk/GtkPanelPeer.java: Ditto.
+ * gnu/java/awt/peer/gtk/GtkScrollbarPeer.java: Ditto.
+ * gnu/java/awt/peer/gtk/GtkWindowPeer.java: Ditto.
+
+2003-12-09 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (nat_headers_install): New variable with header files to
+ install automatically.
+ (install-data-local): Install all headers listed in
+ nat_headers_install. Install innert nat headers explicitely.
+ * Makefile.in: Regenerated.
+
+2003-12-09 Michael Koch <konqueror@gmx.de>
+
+ * java/util/Calendar.java,
+ java/util/IdentityHashMap.java,
+ java/util/prefs/Preferences.java:
+ Import used classes explicitely.
+
+2003-12-09 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (close): Directly return if socket is closed.
+ * java/net/ServerSocket.java
+ (close): Directly return if socket is closed.
+ * java/net/Socket.java
+ (close): Directly return if socket is closed.
+
+2003-12-09 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/SelectorImpl.java
+ (implSelect): Throws IOException.
+ (select): Likewise.
+
+2003-12-08 Kim Ho <kho@redhat.com>
+
+ Fix for Checkbox states.
+ * gnu/java/awt/peer/gtk/GtkCheckboxPeer.java:
+ (currentState): New field.
+ (nativeCreate): Add initial state parameter.
+ (create): Changed to reflect new parameter.
+ (setState): Fire only on changed states.
+ (postItemEvent): Fire only on changed states. Also change the
+ Java Checkbox to reflect new state.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c:
+ (nativeCreate): Add parameter and set active state.
+
+2003-12-08 Fernando Nasser <fnasser@redhat.com>
+
+ * java/awt/datatransfer/StringSelection.java (getTransferData): Return
+ object of type expected by specified DataFlavor.
+
+2003-12-08 Fernando Nasser <fnasser@redhat.com>
+
+ * java/awt/datatransfer/DataFlavor.java (getParameter): Fix off-by-one
+ error which was clipping off the first character of a parameter value.
+
+2003-12-08 Olga Rodimina <rodimina@redhat.com>
+
+ * java/awt/Polygon.java
+ (translate): Fixed error that caused polygon
+ to move right/left when up/down translation was required.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c:
+ (getSelectionStart): Initialized start position to 0.
+ (getSelectionEnd): Initialized end position to 0.
+ (getCaretPosition): Initialized caret position to 0.
+ (getText): Initialized selected text to NULL
+
+2003-12-08 Michael Koch <konqueror@gmx.de>
+
+ Fix for PR libgcj/13176.
+ * java/io/PrintStream.java: Partly revert my previous patches to get
+ (line_separator): New field.
+ (converter): New field.
+ (work): New field.
+ (work_bytes): New field.
+ (pw): Removed.
+ (closed): Removed.
+ (PrintStrean): Initialize converter and not pw.
+ (checkError): Flush always, pw doesn't exist anymore.
+ (close): Close underlying out stream.
+ (print): New method.
+ (writeChars): New method.
+ (print): Use new internal print method.
+ (println): Likewise.
+
+2002-12-08 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/util/Hashtable.java (Hashtable(Map)): Use putAll, not
+ putAllInternal.
+ (putAllInternal): Correct comment.
+ * java/util/HashMap.java (HashMap(Map)): As above.
+ (putAllInternal): As above.
+
+2002-12-08 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/util/Hashtable.java (internalContainsValue): Removed.
+ (containsValue): Don't delegate to internalContainsValue.
+
+2003-12-06 Michael Koch <konqueror@gmx.de>
+
+ * javax/naming/directory/Attribute.java,
+ javax/naming/directory/Attributes.java,
+ javax/naming/directory/DirContext.java,
+ javax/naming/directory/InitialDirContext.java,
+ javax/naming/directory/SearchResult.java,
+ javax/naming/event/EventContext.java,
+ javax/naming/event/NamingEvent.java,
+ javax/naming/event/NamingExceptionEvent.java,
+ javax/naming/ldap/ControlFactory.java,
+ javax/naming/ldap/ExtendedRequest.java,
+ javax/naming/ldap/HasControls.java,
+ javax/naming/ldap/InitialLdapContext.java,
+ javax/naming/ldap/LdapContext.java,
+ javax/naming/ldap/LdapReferralException.java,
+ javax/naming/ldap/UnsolicitedNotification.java,
+ javax/naming/ldap/UnsolicitedNotificationListener.java,
+ javax/naming/spi/DirObjectFactory.java,
+ javax/naming/spi/DirStateFactory.java,
+ javax/naming/spi/DirectoryManager.java,
+ javax/naming/spi/NamingManager.java,
+ javax/naming/spi/ObjectFactoryBuilder.java,
+ javax/naming/spi/ResolveResult.java,
+ javax/naming/spi/Resolver.java,
+ javax/naming/spi/StateFactory.java:
+ Import used classes explicitely.
+
+2003-12-05 Scott Gilbertson <scottg@mantatest.com>
+
+ * gnu/gcj/xlib/GC.java (updateClip): Added rectangles argument.
+ (clip): Removed field
+ (clipRectangles): New field.
+ (clone): Use new updateClip.
+ (setClipRectangles): Use new updateClip.
+ * gnu/gcj/xlib/natGC.cc (updateClip): Prepare passed rectangles.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * java/io/FilePermission.java:
+ Import used classes explicitely.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * java/beans/BeanDescriptor.java,
+ java/beans/EventSetDescriptor.java,
+ java/beans/FeatureDescriptor.java,
+ java/beans/IndexedPropertyDescriptor.java,
+ java/beans/Introspector.java,
+ java/beans/MethodDescriptor.java,
+ java/beans/PropertyDescriptor.java,
+ java/beans/SimpleBeanInfo.java: Explicitely import used classes.
+ * java/beans/beancontext/BeanContextServicesSupport.java
+ (serialVersionUID): New field.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/MenuComponent.java: Import java.io.Serialization.
+ * java/awt/MenuItem.java: Likewise.
+ * java/awt/TextComponent.java: Likewise.
+ * java/awt/image/ImagingOpException.java
+ (serialVersionUID): Fixed.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (sendRequest): Merged writing http headers with classpath.
+ (getInputStream): Merged documentation from classpath.
+ (getHeaderField): Likewise.
+ (getHeaderFieldKey): Likewise.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * boehm.cc (_Jv_MarkObj): Access hack_signers field.
+
+2003-12-04 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramPacket.java
+ (length): Made packge-private to make it accessible via CNI.
+ (maxlen): New field.
+ (DatagramPacket): Cleaned up.
+ (setSocketAddress): Add message to exception.
+ (setData): Call other setData().
+ (setData): Call setLength().
+ (setLength): Initialize maxlen too.
+ * gnu/java/net/natPlainDatagramSocketImplPosix.cc (peekData):
+ Get maximal length from maxlen field, set length field directly.
+ (receive): Likewise.
+ * gnu/java/net/natPlainDatagramSocketImplWin32.cc (peekData):
+ Get maximal length from maxlen field, set length field directly.
+ (receive): Likewise.
+
+2003-12-03 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/nio/natSelectorImplPosix.cc
+ (implSelect): A timeout of 0 means an infinite
+ timeout.
+
+2003-12-02 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): Fix generation
+ of ActionEvents.
+
+2003-12-03 Michael Koch <konqueror@gmx.de>
+
+ * java/lang/Class.h (hack_signers): Renamed signers to hack_signers.
+ * java/lang/natClass.cc (getSigners): Likewise.
+ (setSigners): Likewise.
+
+2003-12-02 Mohan Embar <gnustuff@thisiscool.com>
+
+ * configure.in: Added new MinGW-specific configure flag
+ --with-win32-nlsapi.
+ Added new AC_DEFINE MINGW_LIBGCJ_UNICODE.
+ Add -lunicows to MinGW SYSTEMSPEC if --with-win32-nlsapi
+ is set to unicows.
+ * configure: Rebuilt.
+ * include/config.h.in: Rebuilt.
+ * win32.cc (_Jv_Win32NewString): Implemented.
+ (nativeToUnicode): New helper function defined only for
+ non-UNICODE builds.
+ (unicodeToNative): Likewise.
+ (_Jv_Win32TempString): Implemented.
+ (lots): Refactored using tchar.h macros.
+ (WSAEventWrapper): Use _Jv_Win32NewString.
+ (_Jv_platform_initialize): Use GetModuleFileNameA instead
+ of GetModuleFileName.
+ (_Jv_platform_initProperties): Use _Jv_Win32NewString.
+ Use temporary stack buffer instead of a heap buffer.
+ * include/win32.h
+ Added defines for UNICODE and _UNICODE if MINGW_LIBGCJ_UNICODE is
+ defined; added tchar.h include.
+ (_Jv_Win32TempString): Declared new helper class.
+ (JV_TEMP_STRING_WIN32): New helper macro.
+ (_Jv_Win32NewString): Declared new helper method.
+ * java/io/natFileDescriptorWin32.cc (open): Use
+ JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
+ (write): Reformatted slightly.
+ * java/io/natFileWin32.cc (lots): Use tchar.h macros;
+ use JV_TEMP_STRING_WIN32 instead of JV_TEMP_UTF_STRING.
+ (getCanonicalPath): Use _Jv_Win32NewString instead of
+ JvNewStringUTF.
+ (performList): Likewise.
+ * java/lang/natWin32Process.cc (ChildProcessPipe):
+ Use tchar.h macros.
+ (startProcess): Use tchar.h macros, JV_TEMP_STRING_WIN32,
+ and UNICODE environment flag for CreateProcess.
+ * java/net/natNetworkInterfaceWin32.cc
+ (winsock2GetRealNetworkInterfaces): Use tchar.h macros and
+ _Jv_Win32NewString.
+
+2003-12-02 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
+ (initState): Mark obj parameter as unused.
+ (stringWidth): Mark obj parameter as unused. Initialize
+ font_name properly.
+
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java: Make
+ BufferedImageBuilder class static.
+
+2003-12-02 Mark Wielaard <mark@klomp.org>
+
+ * java/security/Security.java: Don't use &nbsp; in the api doc.
+
+2003-12-02 Dalibor Topic <robilad@kaffe.org>
+
+ Reported by: Jim Pick <jim@kaffe.org>
+ * libraries/javalib/java/util/Hashtable.java
+ (internalcontainsValue): New method.
+ (contains): Delegate to internalContainsValue.
+
+ Reported by: Mark Wielaard <mark@klomp.org>
+ * libraries/javalib/java/util/Hashtable.java
+ (contains): Improved comment.
+
+ Reported by: Jeroen Frijters <jeroen@frijters.net>
+ * libraries/javalib/java/util/Hashtable.java
+ (containsValue): Delegate to contains(Object) to make sure older
+ code overwriting it continues to work.
+
+2003-12-02 Fernando Nasser <fnasser@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkListPeer.java (handleEvent): New
+ method. Handle mouse and key events that must generate
+ ActionEvents.
+ * java/awt/List.java (getSelectedIndex): Return -1
+ if no list element is selected.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c (awt_event_handler):
+ Correct handling of mouse and key events so that List receives them.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+ (Java_gnu_java_awt_peer_gtk_GtkListPeer_delItems): Fix removal of
+ multiple list elements.
+
+2003-12-02 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/text/SimpleDateFormat.java (compileFormat):
+ isLowerCase() and isUpperCase() allow too many characters.
+ Just use >= 'A' && <= 'Z' || >= 'a' && <= 'z'.
+
+2003-12-02 Dalibor Topic <robilad@kaffe.org>
+
+ * java/text/FieldPosition.java (equals): Fixed comment.
+
+2003-12-02 Mark Wielaard <mark@klomp.org>
+
+ Reported by Archie Cobbs:
+ * java/security/DigestInputStream.java (read(byte[], int, int): Call
+ digest.update() with temp, not len as lenght.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (close): Close associated DatagramChannel object.
+ * java/net/ServerSocket.java
+ * java/net/Socket.java
+ (close): Reset impl and bound before calling getChannel().close() to
+ prevent from loops.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/channels/spi/AbstractInterruptibleChannel.java
+ (opened): Removed.
+ (closed): New field.
+ (close): Check of channel is closed already.
+ (isOpen): Return !closed.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/DatagramChannelImpl.java
+ (blocking): Initialize with true by default.
+ * gnu/java/nio/ServerSocketChannelImpl.java
+ (serverSocket): Made private.
+ (blocking): Likewise.
+ (connected): Likewise.
+ * gnu/java/nio/SocketChannelImpl.java
+ (connectionPending): Made private.
+ * gnu/java/nio/FileLockImpl.java
+ (static): Load native library (needed for classpath).
+ * gnu/java/nio/SelectorImpl.java
+ (static): Load native library (needed for classpath).
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/file/Connection.java
+ (getLastModified): Implement for file connections.
+ (getContentLength): Likewise.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/file/Connection.java:
+ Some reformating.
+ (file): Renamed from fileIn.
+ (getPermission): Moved around.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/jar/Connection.java
+ (Connection): Made class final, merged documentation with classpath.
+ (file_cache): Made private.
+ (jar_file): Renamed from jarfile.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (Connection): Initialize doOutput to false;
+ (connect): Initialize inputStream, moved "send request" code to new
+ method.
+ (sendRequest): New method.
+ (getHttpHeaders): Don't reinitialize inputStream.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol//http/Connection.java
+ (defRequestProperties): Removed. This dont gets used since JDK 1.3.
+ (requestProperties): Initialize, documentation added.
+ (inputStream): Renamed from bufferedIn.
+ (Connection): Dont initialize requestProperties.
+ (setDefaultRequestProperty): Removed.
+ (getDefaultRequestProperty): Removed.
+ (usingProxy): Documentation added.
+ (getHttpHeaders): Likewise.
+
+2003-12-02 Michael Koch <konqueror@gmx.de>
+
+ * java/text/DateFormat.java:
+ Explicitely import used classes.
+
+2003-12-01 Jeff Sturm <jsturm@one-point.com>
+
+ * verify.cc (state::clean_subrs): Clear seen_subrs.
+ (state::copy): Walk seen_subrs from copy, not `this'.
+ Don't clear seen_subrs.
+
+2003-12-01 Kim Ho <kho@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (create):
+ Disable wrapping if TextArea has horizontal scroll bars.
+
+2003-12-01 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+ (awt_event_handler): Hard-code inset values.
+
+ * gnu/java/awt/peer/gtk/GdkFontMetrics.java (GdkFontMetrics):
+ Pass font name, not XLFD, to initState.
+ (stringWidth(String, int, String)): New method.
+ (stringWidth(String)): Call new stringWidth.
+ (getLeading): Always return 0.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
+ (initState): New Pango implementation.
+ (stringWidth): Likewise.
+
+2003-12-01 Olga Rodimina <rodimina@redhat.com>
+
+ * java/awt/TextComponent.java:
+ (getSelectionStart): Updated javadocs.
+ (getSelectionEnd): Ditto.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer:
+ (getSelectionStart): Changed to return caret position if no
+ text is selected
+ (getSelectionEnd): Ditto.
+
+2003-12-01 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/awt/gtk/GtkButtonPeer.java, gnu/awt/gtk/gtkcommon.cc,
+ gnu/awt/gtk/gtkcommon.h, gnu/awt/gtk/GtkComponentPeer.java,
+ gnu/awt/gtk/GtkContainerPeer.java,
+ gnu/awt/gtk/GtkFramePeer.java, gnu/awt/gtk/GtkLabelPeer.java,
+ gnu/awt/gtk/GtkMainThread.java, gnu/awt/gtk/GtkToolkit.java,
+ gnu/awt/gtk/GtkWindowPeer.java, gnu/awt/gtk/natGtkButtonPeer.cc,
+ gnu/awt/gtk/natGtkComponentPeer.cc,
+ gnu/awt/gtk/natGtkContainerPeer.cc,
+ gnu/awt/gtk/natGtkFramePeer.cc, gnu/awt/gtk/natGtkLabelPeer.cc,
+ gnu/awt/gtk/natGtkMainThread.cc, gnu/awt/gtk/natGtkToolkit.cc,
+ gnu/awt/gtk/natGtkWindowPeer.cc: Remove files.
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+ (closed): Mark loader parameter as unused.
+
+2003-12-01 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/http/Connection.java
+ (Connection): Merged class documentation.
+ (socket): Renamed from sock.
+ (Connection): Made protected, documentation added.
+ (connect): Give URL'S host instead of InetAddress to Socket
+ constructor.
+ (disconnect): Documentation added.
+ (getOutputStream): Rewrapped.
+
+2003-12-01 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/file/Connection.java
+ (fileIn): Documentation added.
+ (inputStream): Likewise.
+ (outputStream): Likewise.
+ (Connection): Likewise.
+ (connect): Simplified.
+
+2003-12-01 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkImage.java (setDimensions,
+ setProperties): Check that io is not null before calling
+ io.imageUpdate.
+ * java/awt/image/ImageConsumer.java (setPixels, imageComplete):
+ Update javadocs.
+ * java/awt/image/PixelGrabber.java: Fix implementation and
+ update javadocs.
+
+2003-12-01 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/natPlainSocketImplPosix.cc
+ bind(): Dont set SockedImpl.address field on succesful bind.
+ * gnu/java/net/natPlainSocketImplWin32.cc
+ bind(): Likewise.
+
+2003-11-30 Jeff Sturm <jsturm@one-point.com>
+
+ * java/net/InetAddress.java:
+ (static): Don'f force DNS request for ANY_IF address.
+
+2003-11-30 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java,
+ java/net/natInetAddressNoNet.cc,
+ java/net/natInetAddressPosix.cc,
+ java/net/natInetAddressWin32.cc:
+ Reverted my last patch.
+
+2003-11-28 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java
+ (lookup): New method that doesnt lookup "0.0.0.0".
+ (ImplLookup): Renamed from lookup.
+ * java/net/natInetAddressNoNet.cc
+ (ImplLookup): Renamed from lookup.
+ * java/net/natInetAddressPosix.cc
+ (ImplLookup): Renamed from lookup.
+ * java/net/natInetAddressWin32.cc
+ (ImplLookup): Renamed from lookup.
+
+2003-11-28 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * configure: Rebuilt.
+ * configure.in: Require gtk and glib 2.2.0.
+
+2003-11-27 Dalibor Topic <robilad@kaffe.org>
+
+ * java/text/FieldPosition.java (equals): Adapted to handle
+ field_attribute. Added fast-circuit check for comparison to self.
+ Replaced use of instanceof by getClass to fix symmetry for derived
+ types.
+ (toString): Adapted to handle field_attribute. Improved readability.
+ (hashCode): New method.
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/FieldPosition.java (field_attribute): New field.
+ (FieldPosition (Format.Field), FieldPosition(Format.Field, int),
+ getFieldAttribute): New methods.
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/DecimalFormatSymbols.java (locale): New field.
+ (DecimalFormatSymbols (Locale)): Set locale.
+ (serialVersionOnStream): Upgraded to number 2.
+ (readObject): Assign locale if it wasn't by the serializer.
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/FormatCharacterIterator.java: Documented the class and
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/FormatCharacterIterator.java: Fixed some typos.
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/NumberFormat.java:
+ (getIntegerInstance) Added the java version in the comments.
+
+2003-11-27 Mark Wielaard <mark@klomp.org>
+
+ * java/text/NumberFormat.java: Import java.io.InvalidObjectException.
+ (readResolve): Reformat.
+
+2003-11-27 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/NumberFormat.java
+ (NumberFormat.Field): New implemented class to match Java 1.4.
+ (getIntegerInstance): Two new Java 1.4 methods.o
+
+2003-11-27 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/util/GregorianCalendar.java (getLinearTime): Avoid counting
+ the leap day of the leap year twice.
+ (computeFields): First week of month is 1 not 0.
+
+2003-11-27 Mark Wielaard <mark@klomp.org>
+
+ * javax/swing/plaf/basic/BasicDefaults.java (BasicDefaults): Put
+ AbstractUndoableEdit.undoText and AbstractUndoableEdit.redoText.
+
+2003-11-27 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/UIDefaults.java:
+ Reformated to match classpath's version.
+
+2003-11-27 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/UIManager.java (getDefaults, getDimension,
+ getIcon, getInsets, getInstalledLookAndFeels, getInt,
+ getLookAndFeel, getString, getSystemLookAndFeelClassName):
+ Declare as public.
+
+2003-11-26 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/undo/StateEdit.java (getPresentationName): Docfix.
+ * javax/swing/undo/AbstractUndoableEdit.java (canUndo, canRedo,
+ isSignificant): Likewise.
+
+2003-11-26 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/undo/CompoundEdit.java: Re-format, document.
+ (inProgress): Set initial value to true.
+ (undo, redo, die, canUndo, canRedo): Also call inherited
+ implementation; simplify code structure.
+ (getPresentationName, getUndoPresentationName,
+ getRedoPresentationName): Make behavior dependent on lastEdit.
+ (addEdit, isSignificant): Completely re-written.
+
+2003-11-26 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/undo/StateEdit.java: Re-format, document.
+ (undo, redo): Also call inherited implementation.
+
+2003-11-26 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/undo/StateEditable.java: Re-format, document.
+
+2003-11-26 Sascha Brawer <brawer@dandelis.ch>
+
+ * javax/swing/undo/AbstractUndoableEdit.java: Re-format, document.
+ (AbstractUndoableEdit): Initialize hasBeenDone to true.
+ (canUndo, canRedo): Simplify.
+ (getUndoPresentationName, getRedoPresentationName): Support
+ localized message; call getPresentationName() only once.
+
+2003-11-26 David Belanger <dbelan2@cs.mcgill.ca>
+
+ * java/util/zip/ZipFile (Zipfile(File)): Set file path as name.
+ (ZipFile(File,int)): Likewise.
+
+2003-11-26 Stuart Ballard <stuart.ballard@corp.fast.net>
+
+ * java/util/HashMap.java (putAll): Use Iterator hasNext() method.
+ (putAllInternal): Likewise.
+ * java/util/Hashtable.java (putAll): Use Iterator hasNext() method.
+ (putAllInternal): Likewise.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URLStreamHandler.java
+ (parseURL): Added comment in catch statement.
+ (canonicalizeFilename): Add documentation.
+ (sameURL): Completed documentation.
+ (equals): Likewise.
+ (hostsEqual): Likewise.
+ (getDefaulPort): Likewise.
+ (hashCode): Likewise.
+ (toExternalForm): Likewise.
+ (getHostName): Fix empty hostname check, completed documentation.
+
+2003-11-26 Tom Tromey <tromey@redhat.com>
+
+ * java/lang/natDouble.cc (parseDouble): Reverted patch of
+ 2003-11-13.
+
+2003-11-26 Guilhem Lavaux <guilhem@kaffe.org>
+ Mark Wielaard <mark@klomp.org>
+
+ * java/net/URLStreamHandler (parseUrl): Fixed URL parsing
+ ('@' should be checked to distinguish port from userinfo).
+ (toExternalForm): Add @ userInfo if necessary.
+
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (DategramSocket, bind): Moved binding code from DatagramSocket
+ constructor to bind method.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (impl): Made private.
+ (bound): New private member variable.
+ (DatagramSocket): Fixed documentation, use getImpl().
+ (getImpl): New package-private method.
+ (isClosed): Use getImpl().
+ (getLocalAddress): Completed documentation, use getImpl().
+ (getLocalPort): Use getImpl().
+ (getSoTimeout): Likewise.
+ (setSoTimeout): Likewise.
+ (getSendBufferSize): Likewise.
+ (setSendBufferSize): Likewise.
+ (getReceiveBufferSize): Likewise.
+ (setReceiveBufferSize): Likewise.
+ (connect): Likewise.
+ (disconnect): Likewise.
+ (receive): Likewise.
+ (send): Likewise.
+ (setReuseAddress): Likewise.
+ (setTrafficClass): Likewise.
+ (bind): Added message to exception.
+ (isClosed): Completed documentation.
+ (getChannel): Likewise.
+ (connect): Added missing exception, refined exception message.
+ (isBound): Completed documentation, just return bound.
+ (isConnected): Completed documentation.
+ (getRemoteSocketAddress): Likewise.
+ (getReuseAddress): Completed documentation, use getImpl().
+ (setSoBroadcast): Likewise.
+ (getSoBroadcast): Likewise.
+ (getTrafficClass): Likewise.
+ (getLocalSocketAddress): Simplified.
+ * java/net/MulticastSocket.java
+ (MulticastSocket): Removed comment not applying anymore.
+ (getInterface): Use getImpl().
+ (getTTL): Likewise.
+ (getTimeToLive): Likewise.
+ (setInterface): Likewise.
+ (setNetworkInterface): Likewise.
+ (getNetworkInterface): Likewise.
+ (setLoopback): Likewise.
+ (getLoopback): Likewise.
+ (setTTL): Likewise.
+ (setTimeToLive): Likewise.
+ (joinGroup): Likewise.
+ (leaveGroup): Likewise.
+ (send): Likewise.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/Socket.java
+ (implCreated): Dont set default value explicitely, added
+ documentation.
+ (inputShutdown): Likewise.
+ (outputShutdown): Likewise.
+ (bound): New private member variable.
+ (bind): Set bound to true.
+ (close): Set bound to false.
+ (isBound): Return bound.
+ * java/net/ServerSocket.java
+ (bound): New private member variable.
+ (bind): Set bound to true.
+ (close): Set bound to false.
+ (isBound): Return bound.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/URL.java
+ (URL): Fixed documentation to be HTML compliant.
+ (getContent): Completed documentation.
+ (getFile): Likewise.
+ (getPath): Likewise.
+ (getAuthority): Likewise.
+ (getHost): Likewise.
+ (getDefaultPort): Likewise.
+ (getProtocol): Likewise.
+ (hashCode): Likewise.
+ (openConnection): Likewise.
+ (openStream): Likewise.
+ (set): Likewise.
+ (getURLStreamHandler): Wrapped lines to fit into our 79 chars rule.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetSocketAddress.java
+ (hostname): Made private, added documentation.
+ (addr): Likewise.
+ (port): Likewise.
+ (equals): Completed documentation.
+ (getAddress): Likewise.
+ (getHostName): Likewise.
+ (getPort): Likewise.
+ (hashCode): Likewise.
+ (isUnresolved): Likewise.
+ (toString): Likewise.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/protocol/file/Handler.java
+ (Handler): New explicit constructor.
+ (openConnection): Added documentation.
+ * gnu/java/net/protocol/jar/Handler.java
+ (Handler): New explicit constructor.
+ (openConnection): Added documentation.
+
+2003-11-26 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramPacket.java
+ (DatagramPacket): Fixed documentation to become legal HTML.
+
+2003-11-25 Michael Koch <konqueror@gmx.de>
+
+ * gcj/javaprims.h: Added missing java.util.Currency.
+
+2003-11-25 Michael Koch <konqueror@gmx.de>
+
+ * testsuite/libjava.mauve/xfails:
+ Removed these two tests, they mystically pass now:
+ -FAIL: gnu.testlet.java.net.ServerSocket.ServerSocketTest: Error :
+ test_params failed - 5getInetAddress did not return proper values
+ (number 1)
+ -FAIL: gnu.testlet.java.net.Socket.SocketTest: Error :
+ test_BasicServer failed - 11 exception was thrown :Illegal seek
+ (number 1)
+
+2003-11-25 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (factory): Made private.
+ (closed): Removed.
+ (DatagramSocket): Check impl argument, use constructor with
+ SocketAddress argument.
+ (close): Set impl to null, use isClosed().
+ (isClosed): Check for impl == null.
+ (getLocalAddress): Use isClosed().
+ (getLocalPort): Check if socket is closed.
+ (getSoTimeout): Likewise.
+ (setSoTimeout): Likewise.
+ (getSendBufferSize): Likewise.
+ (setSendBufferSize): Likewise.
+ (getReceiveBufferSize): Likewise.
+ (setReceiveBufferSize): Likewise.
+ (receive): Likewise.
+ (send): Likewise.
+ (bind): Likewise.
+ (connect): Likewise.
+ (setReuseAddress): Likewise.
+ (getReuseAddress): Likewise.
+ (setBroadcast): Likewise.
+ (getBroadcast): Likewise.
+ (setTrafficClass): Likewise.
+ (getTrafficClass): Likewise.
+ * java/net/MulticastSocket.java
+ (getInterface): Check if socket is closed.
+ (getTTL): Likewise.
+ (getTimeToLive): Likewise.
+ (setInterface): Likewise.
+ (setNetworkInterface): Likewise.
+ (getNetworkInterface): Likewise.
+ (setLoopbackMode): Likewise.
+ (setTTL): Likewise.
+ (setTimeToLive): Likewise.
+ (joinGroup): Likewise.
+ (leaveGroup): Likewise.
+ (send): Likewise.
+ * java/net/ServerSocket.java
+ (closed): Removed.
+ (close): Check if socket is closed, set impl to null.
+ (isClosed): Check impl == null;
+ (ServerSocket): Check impl argument.
+ (getInetAddress): Check if socket is bound.
+ (getLocalPort): Likewise.
+ (getLocalSocketAddress): Likewise.
+ (bind): Check if socket is closed.
+ (implAccept): Likewise.
+ (setSoTimeout): Likewise.
+ (getSoTimeout): Likewise.
+ (setReuseAddress): Likewise.
+ (getReuseAddress): Likewise.
+ (setReceiveBufferSize): Likewise.
+ (getReceiveBufferSize): Likewise.
+ (toString): Make output compliant to JDK 1.4.2.
+ * java/net/Socket.java
+ (closed): Removed.
+ (Socket): Fixed documentation.
+ (connect): Check if socket is closed, changed exception text,
+ fixed documentation.
+ (getInputStream): Check of socket is closed and connected.
+ (getOutputStream): Likewise.
+ (bind): Check if socket is closed.
+ (setTcpNoDelay): Likewise.
+ (getTcpNoDelay): Likewise.
+ (setSoLinger): Likewise.
+ (getSoLinger): Likewise.
+ (sendUrgentData): Likewise.
+ (setOOBInline): Likewise.
+ (getOOBInline): Likewise.
+ (setSoTimeout): Likewise.
+ (getSoTimeout): Likewise.
+ (setSendBufferSize): Likewise.
+ (getSendBufferSize): Likewise.
+ (setReceiveBufferSize): Likewise.
+ (getReceiveBufferSize): Likewise.
+ (setKeepAlive): Likewise.
+ (getKeepAlive): Likewise.
+ (close): Likewise.
+ (shutdownInput): Likewise.
+ (shutdownOutput): Likewise.
+ (getReuseAddress): Likewise.
+ (getTrafficClass): Likewise.
+ (setTrafficClass): Likewise.
+ (isClosed): Check impl == null.
+ (toString): Added missing ']'.
+
+2003-11-24 Tom Tromey <tromey@redhat.com>
+
+ * Makefile.in: Rebuilt.
+ * Makefile.am (propdir): New macro.
+ (install-data-local): Install logging.properties.
+ (core_java_source_files): Added java.util.logging.*.
+ * java/util/logging/logging.properties: New file.
+
+2003-11-25 Michael Koch <konqueror@gmx.de>
+
+ * java/net/DatagramSocket.java
+ (DatagramSocket): Move binding code to bind(), simplify constructors.
+ * java/net/MulticastSocket.java
+ (MulticastSocket): Call parent constructor with null argument,
+ bind socket after setReuseAddress is called, simplify constructors.
+
+2003-11-24 Michael Koch <konqueror@gmx.de>
+
+ * javax/swing/BoxLayout.java
+ (serialVersionUIR): New member variable.
+ (X_AXIS, Y_AXIS): Documentation added.
+ (LINE_AXIS, PAGE_AXIS): New constants.
+ (grid): Renamed from gridbag.
+ (BoxLayout): Use new constants, throw exception if invalid value for
+ way, added documentation.
+ (BoxLayout): Removed.
+ (addLayoutComponent): Use new constants, added documentation.
+ (removeLayoutComponent): Likewise.
+ (addLayoutContainer): Added documentation.
+ (preferredLayoutSize): Added documentation, check given argument.
+ (minimumLayoutSize): Likewise.
+ (layoutContainer): Likewise.
+ (getLayoutAlignmentX): Likewise.
+ (getLayoutAlignmentY): Likewise.
+ (invalidateLayout): Likewise.
+ (maximumLayoutSize): Likewise.
+
+2003-11-22 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/natPlainDatagramSocketImplWin32.cc
+ (peekData): Use offset and maximal free space in datagram packet.
+ (receive): Likewise.
+ (send): Use offset in datagram packet.
+
+2003-11-22 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/natPlainDatagramSocketImplPosix.cc
+ (peekData): Use offset and maximal free space in datagram packet.
+ (receive): Likewise.
+ (send): Use offset in datagram packet.
+
+2003-11-22 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/DatagramChannelImpl.java
+ (getNativeFD): Use getPlainDatagramSocketImpl().
+ * gnu/java/nio/NIODatagramSocket.java
+ (getPlainDatagramSocketImpl): Renamed from getImpl().
+ * gnu/java/nio/NIOSocket.java
+ (getPlainSocketImpl): Renamed from getImpl().
+ (setChannel): Use getPlainSocketImpl().
+ * gnu/java/nio/SocketChannelImpl.java
+ (SocketChannelImpl): Use getPlainSocketImpl().
+ (getPlainSocketImpl): Renamed from getImpl().
+ (getNativeFD): Use getPlainSocketImpl().
+
+2003-11-18 Graydon Hoare <graydon@redhat.com>
+
+ * javax/swing/JLayeredPane.java: Implement.
+ * javax/swing/JFrame.java (getContentPane): Make public
+ * javax/swing/javax/swing/JRootPane.java (setContentPane):
+ Use JLayeredPane.FRAME_CONTENT_LAYER.
+
+2003-11-21 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/Float.java (static): Removed.
+
+2003-11-18 Graydon Hoare <graydon@redhat.com>
+
+ * java/awt/font/TextLayout.java: Implement simple layouts
+ using attributed strings and glyph vectors.
+
+2003-11-17 Graydon Hoare <graydon@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java: New file.
+ * gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java
+ (GdkFontLineMetrics): New inner class.
+ (getLineMetrics): Return new GdkFontLineMetrics.
+ (getFontMetrics): Return new GdkClasspathFontPeerMetrics.
+ (layoutGlyphVector): Create GdkGlyphVector.
+ * gnu/java/awt/peer/gtk/GdkGraphics2D.java (stateStack): New member.
+ (GdkGraphics2D): Initialize state via mathod calls.
+ (cairoSetMatrix, cairoShowGlyphs): Simplify native calls.
+ (cairoTranslate, cairoScale, cairoRotate): Remove.
+ (various methods): use setTransform for special transform cases.
+ (DrawState): New inner class.
+ (stateSave): New method.
+ (stateRestore): New method.
+ (various methods): use stateSave, stateRestore.
+ (getClipInDevSpace): New method.
+ (clip, clipRect, setClip, getClip, getClipBounds):
+ Follow spec more closely.
+ (getTransform): Return clone of transform.
+ (setStroke): Set linewidth to passed width / 2.0.
+ (setPaintMode): Set SrcOver rather than Xor.
+ (setColor): Set paint to passed color.
+ (drawRaster, drawImage, PainterThread, drawPixels): Take affine
+ transform from image to user space.
+ (drawRenderedImage, drawRenderableImage): Implement.
+ (getFontRenderContext, getFontMetrics, drawString, getFont):
+ Implement
+ (drawArc, drawOval, drawRoundRect, fillArc, fillOval, fillRoundRect):
+ Implement.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c:
+ Match changes to java side.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c:
+ Release resources.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c:
+ Don't use pango for metrics.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c:
+ New file.
+
+2003-11-19 Guilhem Lavaux <guilhem@kaffe.org>
+ Jim Pick <jim@kaffe.org>
+
+ * java/text/DecimalFormat.java (getCurrency, setCurrency): New
+ methods.
+
+2003-11-19 Guilhem Lavaux <guilhem@kaffe.org>
+
+ * java/text/DecimalFormatSymbols.java (getCurrency,
+ setCurrency): New methods.
+
+2003-11-19 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/geom/FlatteningPathIterator.java: Entirely re-written.
+ * java/awt/geom/doc-files/FlatteningPathIterator-1.html:
+ Describe how the implementation works.
+
+2003-11-19 Michael Koch <konqueror@gmx.de>
+
+ * java/net/Socket.java
+ (implCreated): New variable that indicates created impl.
+ (getImpl): New method.
+ (toString): Return more SUN compliant string representation.
+ (various): Use getImpl() instead of impl.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * lib/libjava.exp: Add DYLD_LIBRARY_PATH for darwin. Look for
+ the right libgcc. Add -multiply_defined suppress and -bind_at_load
+ flags.
+
+2003-11-18 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/13026:
+ * verify.cc (state::copy): Only set local_changed if we're in a
+ subroutine. Correctly copy local variables which were modified
+ by the subroutine.
+ (push_jump_merge): Added more debugging output.
+
+ * jni.cc (_Jv_JNI_GetStringUTFChars): Fail gracefully if string
+ is null.
+
+2003-11-17 Graydon Hoare <graydon@redhat.com>
+
+ * javax/swing/plaf/basic/BasicDefaults.java: Rewrite to spec.
+ * javax/swing/UIDefaults.java: Modify to reflect rewrite.
+
+2003-11-16 Tom Tromey <tromey@redhat.com>
+
+ PR libgcj/13062:
+ * java/io/StreamTokenizer.java (commentChar): Clear other
+ attributes for character.
+ (quoteChar): Likewise.
+
+2003-11-14 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * java/awt/GridBagLayout.java (getLayoutDimensions): Return array of two
+ zero-length int arrays when layoutInfo is null.
+ (getLayoutWeights): Return array of two zero-length double arrays when
+ layoutInfo is null.
+
+2003-11-13 Tom Tromey <tromey@redhat.com>
+
+ * jni.cc (_Jv_JNI_GetStringUTFChars): Pass length of string to
+ JvGetStringUTFRegion.
+ * java/lang/natPosixProcess.cc (new_string): Pass length of string
+ to JvGetStringUTFRegion.
+ * java/lang/natDouble.cc (parseDouble): Pass length of string to
+ JvGetStringUTFRegion.
+ * java/lang/natWin32Process.cc (startProcess): Pass length of
+ string to JvGetStringUTFRegion.
+ * java/lang/natClass.cc (forName): Pass length of string to
+ JvGetStringUTFRegion.
+ * gnu/gcj/runtime/natNameFinder.cc (getExternalLabel): Pass length
+ of string to JvGetStringUTFRegion.
+ * gnu/gcj/convert/natIconv.cc (init): Pass length of string to
+ JvGetStringUTFRegion.
+ * gnu/awt/gtk/natGtkLabelPeer.cc (setText): Pass length of string
+ to JvGetStringUTFRegion.
+ * gnu/awt/gtk/natGtkButtonPeer.cc (setLabel): Pass length of
+ string to JvGetStringUTFRegion.
+
+2003-11-13 Mohan Embar <gnustuff@thisiscool.com>
+
+ * gnu/java/nio/natSelectorImplPosix.cc
+ (helper_put_filedescriptors): Change to static linkage.
+ (helper_get_filedescriptors): Likewise.
+
+2003-11-12 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (prepareImage): Remove
+ null check.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java (prepareImage): Likewise.
+ * java/awt/Component.java (prepareImage): Likewise.
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (setAlignment):
+ Rename to nativeSetAlignment.
+
+2003-11-11 Danny Smith <dannysmith@users.sourceforge.net>
+
+ * jni.cc (JNI_CreateJavaVM): Remove JNIEXPORT.
+ (JNI_GetCreatedJavaVMs): Likewise.
+ (JNI_GetDefaultJavaVMInitArgs): Likewise.
+ * include/jni.h (JNIIMPEXP): Remove definition
+ and replace with...
+ (__GCJ_JNIIMPEXP__): New macro, applicable only to libgcj
+ symbols,
+ (__GCJ_DLL__): New macro, controlling __GCJ_JNIIMPEXP__.
+
+2003-11-11 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * Makefile.am: Add GdkPixbufDecoder.java and
+ gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+ * Makefile.in: Regenerate.
+ * gnu/java/awt/image/ImageDecoder.java (ImageDecoder(byte[],int,int)):
+ New constructor.
+ (startProduction): Create ByteArrayInputStream when url and filename are
+ null.
+ (produce): Declare stream parameter as InputStream.
+ * gnu/java/awt/image/XBMDecoder.java (produce): Declare stream parameter
+ as InputStream.
+ * gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+ (GdkPixbufDecoder(byte[],int,int)): New constructor.
+ (produce): Declare stream parameter as InputStream.
+ * gnu/java/awt/peer/gtk/GtkComponentPeer.java (prepareImage): Throw NPE
+ if image is null. Set image's observer before running PrepareImage
+ thread. Pass image to startProduction.
+ * gnu/java/awt/peer/gtk/GtkImage.java: Add null checks before calls to
+ source's member functions.
+ (observer): New field.
+ (setObserver): New method.
+ (setDimensions, setPixels, imageComplete): Call observer's imageUpdate.
+ * gnu/java/awt/peer/gtk/GtkToolkit.java (checkImage, getImage): Return
+ new GtkImage.
+ (prepareImage): Implement.
+ * java/awt/Component.java: Add static fields incrementalDraw and
+ redrawRate.
+ (imageUpdate): Implement.
+ (createImage): Call Toolkit's createImage if peer is null.
+ (prepareImage): Throw NPE if image is null.
+ * java/awt/MediaTracker.java: Fix return value.
+
+2003-11-11 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * gnu/java/awt/peer/gtk/GtkLabelPeer.java (create()): Call new create.
+ (create(String, float)): New method.
+ (setText): Make native.
+ (nativeSetAlignment): New method.
+ (setAlignment): Call nativeSetAlignment.
+ (getArgs): Remove method.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+ (find_fg_color_widget, find_bg_color_widget): New functions.
+ (gtkWidgetSetForeground): Call find_fg_color_widget.
+ (gtkWidgetSetBackground): Call find_bg_color_widget. Modify active and
+ prelight colors.
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c (create): Wrap label
+ widget in event box.
+ (setText, setAlignment): Implement new native methods.
+
+2003-11-11 Michael Koch <konqueror@gmx.de>
+
+ * java/awt/Font.java,
+ java/awt/datatransfer/DataFlavor.java,
+ java/math/BigInteger.java,
+ java/net/Inet4Address.java,
+ java/net/Inet6Address.java,
+ java/rmi/MarshalledObject.java,
+ java/rmi/server/RMIClassLoader.java,
+ java/security/cert/CertStore.java,
+ java/sql/Timestamp.java,
+ java/text/SimpleDateFormat.java,
+ javax/naming/CompoundName.java:
+ Removed some redundant obj == null checks.
+
+2003-11-11 Michael Koch <konqueror@gmx.de>
+
+ * java/nio/ByteBuffer.java
+ (equals): Remove redundant obj == null check.
+
+2003-11-11 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/nio/natPipeImpl.cc,
+ gnu/java/nio/natSelectorImpl.cc: Removed
+ * gnu/java/nio/natPipeImplEcos.cc,
+ gnu/java/nio/natPipeImplPosix.cc,
+ gnu/java/nio/natPipeImplWin32.cc,
+ gnu/java/nio/natSelectorImplEcos.cc,
+ gnu/java/nio/natSelectorImplPosix.cc,
+ gnu/java/nio/natSelectorImplWin32.cc: New files
+ * configure.in: Create links for gnu/java/nio/natPipeImpl.cc and
+ gnu/java/nio/natSelectorImpl.cc
+ * configure: Regenerated.
+
+2003-11-11 Micheal Koch <konqueror@gmx.de>
+
+ * java/net/URLStreamHandler.java (toExternalForm): Print port only
+ if host is printed too and port was really given to URL.
+
+2003-11-10 Gary Benson <gbenson@redhat.com>
+
+ * java/sql/Timestamp.java (valueOf): Correctly handle
+ nanoseconds.
+
+2003-11-09 Tom Tromey <tromey@redhat.com>
+
+ * java/net/Inet4Address.java (serialVersionUID): Updated.
+
+2003-11-08 Jeff Sturm <jsturm@one-point.com>
+
+ * gnu/gcj/runtime/FirstThread.java (Klocale, Kcalendar):
+ New fields.
+
+2003-11-08 Jeff Sturm <jsturm@one-point.com>
+
+ * java/io/ByteArrayOutputStream.java (resize):
+ Fix off-by-one error.
+
+2003-11-08 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * gnu/gcj/xlib/XAnyEvent.java (XAnyEvent): Make constructor
+ public.
+
+2003-11-06 Mohan Embar <gnustuff@thisiscool.com>
+
+ PR libgcj/12231
+ * java/lang/Win32Process.java (hasExited) Changed from
+ public to private.
+ (startProcess): Likewise.
+ (cleanup): Likewise.
+ * java/lang/natWin32Process.cc (cleanup) Don't close
+ input, output and error streams.
+ (ChildProcessPipe): New helper class.
+ (startProcess): Refactored to use ChildProcessPipe.
+ Use CREATE_NO_WINDOW when launching child process.
+
+2003-11-06 Mohan Embar <gnustuff@thisiscool.com>
+
+ * include/win32.h (_Jv_platform_close_on_exec): Changed
+ signature and declared extern.
+ * win32.cc (_Jv_platform_close_on_exec): Implemented.
+ * gnu/java/net/natPlainDatagramSocketImplWin32.cc
+ (create): Use new signature of _Jv_platform_close_on_exec.
+ * gnu/java/net/natPlainSocketImplWin32.cc
+ (create): Eliminated a few typecasts
+ Use new signature of _Jv_platform_close_on_exec.
+ (accept): Eliminated a few typecasts
+ Use new signature of _Jv_platform_close_on_exec.
+ * java/io/natFileDescriptorWin32.cc (open): Use
+ _Jv_platform_close_on_exec.
+
+2003-11-04 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/lang/natClass.cc (newInstance): Throw InstantiationException
+ if class has no null-argument constructor.
+
+2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
+
+ PR libgcj/12647:
+ * win32-threads.cc (_Jv_CondWait): Respect mutex's
+ refcount when releasing and reacquiring it.
+
+2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
+
+ * win32.cc: (dirExists) Internal helper function to
+ test for directory existence.
+ (getUserHome) New helper function refactored out
+ of _Jv_platform_initProperties. Uses USERPROFILE
+ instead of HOMEDIR and attempts to support Win9X and NT.
+ (_Jv_platform_initProperties) Use getUserHome.
+
+2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
+
+ PR libgcj/11521:
+ * gnu/java/net/natPlainSocketImplWin32.cc
+ (bind): Don't use SO_REUSEADDR
+
+2003-10-30 Mohan Embar <gnustuff@thisiscool.com>
+
+ PR libgcj/6652:
+ * java/io/natFileWin32.cc (getCanonicalPath): Treat "" like ".".
+
+2003-10-30 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/lang/reflect/natMethod.cc (_Jv_CallAnyMethodA): Don't use vtable
+ dispatch for final methods.
+
+2003-10-30 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c (create): Turn on
+ word wrapping.
+
+2003-10-29 Thomas Fitzsimmons <fitzsim@redhat.com>
+
+ * jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c (getSize): Return
+ scrolled window's size request.
+
+2003-10-29 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/geom/CubicCurve2D.java (contains): Docfix for URL of embedded drawing.
+ * java/awt/geom/QuadCurve2D.java: Likewise.
+
+2003-10-29 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/geom/CubicCurve2D.java: Added documentation.
+ * java/awt/geom/QuadCurve2D.java: Likewise.
+
+ * java/awt/geom/doc-files/QuadCurve2D-4.png,
+ java/awt/geom/doc-files/QuadCurve2D-5.png,
+ java/awt/geom/doc-files/CubicCurve2D-4.png,
+ java/awt/geom/doc-files/Cubicurve2D-5.png: New illustrations.
+
+2003-10-29 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/geom/CubicCurve2D.java (getFlatnessSq): Implement.
+ (subdivide(CubicCurve2D, CubicCurve2D)): Avoid useless object allocation.
+ (subdivide(double[],int,double[],int,double[],int)): Implement.
+
+2003-10-29 Sascha Brawer <brawer@dandelis.ch>
+
+ * java/awt/geom/doc-files/CubicCurve2D-1.png,
+ java/awt/geom/doc-files/CubicCurve2D-2.png,
+ java/awt/geom/doc-files/CubicCurve2D-3.png: New illustrations.
+
+2003-10-29 Ito Kazumitsu <kaz@maczuka.gcd.org>
+
+ * java/text/DecimalFormat.java
+ (scanFormat) corrected so that '%' may appear in a pattern.
+
+2003-10-29 Mark Wielaard <mark@klomp.org>
+
+ From Guilhem Lavaux <guilhem.lavaux@free.fr>
+ * java/text/DateFormat.java (Field): New public static inner class.
+ * java/text/Format.java (Field): Likewise.
+ (formatToCharacterIterator): New method.
+ * java/text/FormatCharacterIterator.java: New file.
+
+2003-10-29 Mark Wielaard <mark@klomp.org>
+
+ From Guilhem Lavaux <guilhem.lavaux@free.fr>
+ * java/util/Currency.java: New file.
+
+2003-10-29 Michael Koch <konqueror@gmx.de>
+
+ * Makefile.am (ordinary_java_source_files): Added
+ java/text/FormatCharacterIterator.java and java/util/Currency.java.
+ * Makefile.in: Regenerated.
+
+2003-10-29 Dalibor Topic <robilad@kaffe.org>
+
+ * gnu/java/beans/IntrospectionIncubator.java (addMethod): Add public
+ static methods.
+
+2003-10-29 Julian Dolby <dolby@us.ibm.com>
+
+ * javax/naming/spi/NamingManager.java (getContinuationContext): Call
+ getObjectInstance() with Object, Name, Context and environment
+ Hashtable from exception. Call fillInStackTrace() on exception when
+ rethrown.
+ * javax/naming/InitialContext.java (lookup(Name)): When a
+ CannotProceedException is thrown use the ContinuationContext.
+ (lookup(String)): Likewise.
+ (close): Clear myProps and defaultInitCtx.
+
+2003-10-29 Michael Koch <konqueror@gmx.de>
+
+ * java/net/InetAddress.java
+ (equals): Remove redundant obj == null check.
+ * java/net/SocketPermission.java
+ (equals): Likewise.
+ * java/net/URL.java
+ (equals): Likewise.
+ (getURLStreamHandler): Likewise.
+
+2003-10-29 Michael Koch <konqueror@gmx.de>
+
+ * gnu/java/net/natPlainDatagramSocketImplPosix.cc
+ (setOption): Directly return if no error occured.
+ * gnu/java/net/natPlainSocketImplPosix.cc
+ (setOption): Likewise.
+
+2003-10-28 Bryce McKinlay <bryce@mckinlay.net.nz>
+
+ * java/lang/natClass.cc (_Jv_LayoutVTableMethods): Always assign a
+ vtable slot for final methods. Add FIXME comment.
+
+2003-10-28 David S. Miller <davem@redhat.com>
+
+ * sysdep/sparc/locks.h (__cas_start_atomic): %g0 --> %%g0.
+
+2003-10-26 Mark Wielaard <mark@klomp.org>
+
+ Reported by Helmer Kraemer <hkraemer@freenet.de>
+ * java/util/jar/JarInputStream.java (readManifest): Don't call
+ closeEntry().
+
+ * java/util/zip/DeflaterOutputStream.java (inbufWrite): New method.
+ (finish): Use inbufWrite().
+ (write(int)): Likewise.
+ (write(byte[],int,int)): Likewise.
+
2003-10-26 Bryce McKinlay <bryce@mckinlay.net.nz>
* java/lang/reflect/AccessibleObject.java (secureSetAccessible):
@@ -2892,7 +5084,7 @@
(_Jv_BytecodeVerifier): Initialize it.
(~_Jv_BytecodeVerifier): Destroy ref_intersection objects.
-2003-07-24 H. Väisänen <hvaisane@joyx.joensuu.fi>
+2003-07-24 H. Väisänen <hvaisane@joyx.joensuu.fi>
* java/text/SimpleDateFormat.java (format) [YEAR_FIELD]: Zero pad
unless field size is 2.
@@ -5979,7 +8171,7 @@
* java/io/ObjectOutputStream.java
(PutField.put): Doesnt throws anything.
-2003­03-28 Michael Koch <konqueror@gmx.de>
+2003­03-28 Michael Koch <konqueror@gmx.de>
* java/io/FileOutputStream.java:
Merged class documentation and authors with classpath.
diff --git a/libjava/Makefile.am b/libjava/Makefile.am
index 91d1647ff9e..70c9cb52a2e 100644
--- a/libjava/Makefile.am
+++ b/libjava/Makefile.am
@@ -52,6 +52,8 @@ jar_DATA = libgcj-@gcc_version@.jar
## FIXME: Using libdir violates GNU coding standards.
secdir = $(libdir)/security
+## Where to install default logging property file.
+propdir = $(libdir)
## For now, only on native systems. FIXME.
if NATIVE
@@ -170,6 +172,7 @@ libgcj_la_LINK = $(LIBLINK)
gtk_c_source_files = \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \
@@ -206,6 +209,7 @@ jni/classpath/primlib.c
gtk_awt_peer_sources = \
gnu/java/awt/peer/gtk/GdkFontMetrics.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
+gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
gnu/java/awt/peer/gtk/GtkArg.java \
gnu/java/awt/peer/gtk/GtkArgList.java \
gnu/java/awt/peer/gtk/GtkButtonPeer.java \
@@ -473,6 +477,7 @@ inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
gnu/java/net/PlainSocketImpl$$SocketOutputStream.h
nat_headers = $(ordinary_nat_headers) $(inner_nat_headers)
+nat_headers_install = $(ordinary_nat_headers)
x_nat_headers = $(x_java_source_files:.java=.h)
@@ -576,7 +581,7 @@ install-data-local:
## We use a GNU make trick here so that we don't go over the command
## length limit of some shells.
@echo Creating list of headers to install...
- @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist)
+ @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
@@ -592,6 +597,15 @@ install-data-local:
echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
$(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
done
+## Install inner class headers.
+ $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(includedir)/java/io/
+ $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(includedir)/java/io/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(includedir)/java/lang/reflect/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(includedir)/java/lang/reflect/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
+
+ $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
## ################################################################
@@ -1607,6 +1621,7 @@ gnu/java/rmi/server/RMIDefaultSocketFactory.java \
gnu/java/rmi/server/RMIHashes.java \
gnu/java/rmi/server/RMIObjectInputStream.java \
gnu/java/rmi/server/RMIObjectOutputStream.java \
+gnu/java/rmi/server/RMIVoidValue.java \
gnu/java/rmi/server/UnicastConnection.java \
gnu/java/rmi/server/UnicastConnectionManager.java \
gnu/java/rmi/server/UnicastRef.java \
@@ -1729,7 +1744,40 @@ javax/naming/ldap/UnsolicitedNotificationListener.java \
javax/naming/OperationNotSupportedException.java \
javax/print/attribute/Attribute.java \
javax/print/attribute/AttributeSet.java \
+javax/print/attribute/AttributeSetUtilities.java \
+javax/print/attribute/DateTimeSyntax.java \
+javax/print/attribute/DocAttribute.java \
+javax/print/attribute/DocAttributeSet.java \
+javax/print/attribute/EnumSyntax.java \
+javax/print/attribute/HashAttributeSet.java \
+javax/print/attribute/HashDocAttributeSet.java \
+javax/print/attribute/HashPrintJobAttributeSet.java \
+javax/print/attribute/HashPrintRequestAttributeSet.java \
+javax/print/attribute/HashPrintServiceAttributeSet.java \
+javax/print/attribute/IntegerSyntax.java \
+javax/print/attribute/PrintJobAttribute.java \
+javax/print/attribute/PrintJobAttributeSet.java \
+javax/print/attribute/PrintRequestAttribute.java \
javax/print/attribute/PrintRequestAttributeSet.java \
+javax/print/attribute/PrintServiceAttribute.java \
+javax/print/attribute/PrintServiceAttributeSet.java \
+javax/print/attribute/ResolutionSyntax.java \
+javax/print/attribute/SetOfIntegerSyntax.java \
+javax/print/attribute/Size2DSyntax.java \
+javax/print/attribute/SupportedValuesAttribute.java \
+javax/print/attribute/TextSyntax.java \
+javax/print/attribute/UnmodifiableSetException.java \
+javax/print/attribute/URISyntax.java \
+javax/print/attribute/standard/Copies.java \
+javax/print/attribute/standard/JobImpressions.java \
+javax/print/attribute/standard/JobMediaSheets.java \
+javax/print/attribute/standard/JobPriority.java \
+javax/print/attribute/standard/NumberOfDocuments.java \
+javax/print/attribute/standard/NumberOfInterveningJobs.java \
+javax/print/attribute/standard/NumberUp.java \
+javax/print/attribute/standard/PagesPerMinute.java \
+javax/print/attribute/standard/PagesPerMinuteColor.java \
+javax/print/attribute/standard/QueuedJobCount.java \
javax/security/auth/x500/X500Principal.java \
javax/sql/ConnectionEvent.java \
javax/sql/ConnectionEventListener.java \
@@ -1942,6 +1990,7 @@ java/util/Collection.java \
java/util/Collections.java \
java/util/Comparator.java \
java/util/ConcurrentModificationException.java \
+java/util/Currency.java \
java/util/Date.java \
java/util/Dictionary.java \
java/util/EmptyStackException.java \
@@ -1988,6 +2037,22 @@ java/util/TreeSet.java \
java/util/TooManyListenersException.java \
java/util/Vector.java \
java/util/WeakHashMap.java \
+java/util/logging/ConsoleHandler.java \
+java/util/logging/ErrorManager.java \
+java/util/logging/FileHandler.java \
+java/util/logging/Filter.java \
+java/util/logging/Formatter.java \
+java/util/logging/Handler.java \
+java/util/logging/Level.java \
+java/util/logging/Logger.java \
+java/util/logging/LoggingPermission.java \
+java/util/logging/LogManager.java \
+java/util/logging/LogRecord.java \
+java/util/logging/MemoryHandler.java \
+java/util/logging/SimpleFormatter.java \
+java/util/logging/SocketHandler.java \
+java/util/logging/StreamHandler.java \
+java/util/logging/XMLFormatter.java \
java/util/prefs/NodeChangeListener.java \
java/util/prefs/Preferences.java \
java/util/prefs/PreferenceChangeListener.java \
@@ -2173,8 +2238,10 @@ gnu/java/locale/LocaleInformation_zh_HK.java \
gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
+gnu/java/net/HeaderFieldHelper.java \
gnu/java/net/PlainDatagramSocketImpl.java \
gnu/java/net/PlainSocketImpl.java \
+gnu/java/net/URLParseError.java \
gnu/java/net/protocol/core/Connection.java \
gnu/java/net/protocol/core/Handler.java \
gnu/java/net/protocol/core/CoreInputStream.java \
@@ -2193,6 +2260,10 @@ gnu/java/nio/NIOConstants.java \
gnu/java/nio/NIODatagramSocket.java \
gnu/java/nio/NIOServerSocket.java \
gnu/java/nio/NIOSocket.java \
+gnu/java/nio/ChannelInputStream.java \
+gnu/java/nio/ChannelOutputStream.java \
+gnu/java/nio/InputStreamChannel.java \
+gnu/java/nio/OutputStreamChannel.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -2580,6 +2651,7 @@ java/text/DecimalFormat.java \
java/text/DecimalFormatSymbols.java \
java/text/FieldPosition.java \
java/text/Format.java \
+java/text/FormatCharacterIterator.java \
java/text/MessageFormat.java \
java/text/NumberFormat.java \
java/text/ParseException.java \
diff --git a/libjava/Makefile.in b/libjava/Makefile.in
index d730fd9c0c6..9702b28a3ec 100644
--- a/libjava/Makefile.in
+++ b/libjava/Makefile.in
@@ -180,6 +180,7 @@ jardir = $(datadir)/java
jar_DATA = libgcj-@gcc_version@.jar
secdir = $(libdir)/security
+propdir = $(libdir)
@NATIVE_TRUE@bin_PROGRAMS = @NATIVE_TRUE@jv-convert gij rmic rmiregistry
@@ -261,6 +262,7 @@ libgcj_la_LINK = $(LIBLINK)
gtk_c_source_files = \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.c \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c \
@@ -297,6 +299,7 @@ jni/classpath/primlib.c
gtk_awt_peer_sources = \
gnu/java/awt/peer/gtk/GdkFontMetrics.java \
gnu/java/awt/peer/gtk/GdkGraphics.java \
+gnu/java/awt/peer/gtk/GdkPixbufDecoder.java \
gnu/java/awt/peer/gtk/GtkArg.java \
gnu/java/awt/peer/gtk/GtkArgList.java \
gnu/java/awt/peer/gtk/GtkButtonPeer.java \
@@ -452,6 +455,7 @@ inner_nat_headers = java/io/ObjectOutputStream$$PutField.h \
nat_headers = $(ordinary_nat_headers) $(inner_nat_headers)
+nat_headers_install = $(ordinary_nat_headers)
x_nat_headers = $(x_java_source_files:.java=.h)
@@ -1332,6 +1336,7 @@ gnu/java/rmi/server/RMIDefaultSocketFactory.java \
gnu/java/rmi/server/RMIHashes.java \
gnu/java/rmi/server/RMIObjectInputStream.java \
gnu/java/rmi/server/RMIObjectOutputStream.java \
+gnu/java/rmi/server/RMIVoidValue.java \
gnu/java/rmi/server/UnicastConnection.java \
gnu/java/rmi/server/UnicastConnectionManager.java \
gnu/java/rmi/server/UnicastRef.java \
@@ -1455,7 +1460,40 @@ javax/naming/ldap/UnsolicitedNotificationListener.java \
javax/naming/OperationNotSupportedException.java \
javax/print/attribute/Attribute.java \
javax/print/attribute/AttributeSet.java \
+javax/print/attribute/AttributeSetUtilities.java \
+javax/print/attribute/DateTimeSyntax.java \
+javax/print/attribute/DocAttribute.java \
+javax/print/attribute/DocAttributeSet.java \
+javax/print/attribute/EnumSyntax.java \
+javax/print/attribute/HashAttributeSet.java \
+javax/print/attribute/HashDocAttributeSet.java \
+javax/print/attribute/HashPrintJobAttributeSet.java \
+javax/print/attribute/HashPrintRequestAttributeSet.java \
+javax/print/attribute/HashPrintServiceAttributeSet.java \
+javax/print/attribute/IntegerSyntax.java \
+javax/print/attribute/PrintJobAttribute.java \
+javax/print/attribute/PrintJobAttributeSet.java \
+javax/print/attribute/PrintRequestAttribute.java \
javax/print/attribute/PrintRequestAttributeSet.java \
+javax/print/attribute/PrintServiceAttribute.java \
+javax/print/attribute/PrintServiceAttributeSet.java \
+javax/print/attribute/ResolutionSyntax.java \
+javax/print/attribute/SetOfIntegerSyntax.java \
+javax/print/attribute/Size2DSyntax.java \
+javax/print/attribute/SupportedValuesAttribute.java \
+javax/print/attribute/TextSyntax.java \
+javax/print/attribute/UnmodifiableSetException.java \
+javax/print/attribute/URISyntax.java \
+javax/print/attribute/standard/Copies.java \
+javax/print/attribute/standard/JobImpressions.java \
+javax/print/attribute/standard/JobMediaSheets.java \
+javax/print/attribute/standard/JobPriority.java \
+javax/print/attribute/standard/NumberOfDocuments.java \
+javax/print/attribute/standard/NumberOfInterveningJobs.java \
+javax/print/attribute/standard/NumberUp.java \
+javax/print/attribute/standard/PagesPerMinute.java \
+javax/print/attribute/standard/PagesPerMinuteColor.java \
+javax/print/attribute/standard/QueuedJobCount.java \
javax/security/auth/x500/X500Principal.java \
javax/sql/ConnectionEvent.java \
javax/sql/ConnectionEventListener.java \
@@ -1664,6 +1702,7 @@ java/util/Collection.java \
java/util/Collections.java \
java/util/Comparator.java \
java/util/ConcurrentModificationException.java \
+java/util/Currency.java \
java/util/Date.java \
java/util/Dictionary.java \
java/util/EmptyStackException.java \
@@ -1710,6 +1749,22 @@ java/util/TreeSet.java \
java/util/TooManyListenersException.java \
java/util/Vector.java \
java/util/WeakHashMap.java \
+java/util/logging/ConsoleHandler.java \
+java/util/logging/ErrorManager.java \
+java/util/logging/FileHandler.java \
+java/util/logging/Filter.java \
+java/util/logging/Formatter.java \
+java/util/logging/Handler.java \
+java/util/logging/Level.java \
+java/util/logging/Logger.java \
+java/util/logging/LoggingPermission.java \
+java/util/logging/LogManager.java \
+java/util/logging/LogRecord.java \
+java/util/logging/MemoryHandler.java \
+java/util/logging/SimpleFormatter.java \
+java/util/logging/SocketHandler.java \
+java/util/logging/StreamHandler.java \
+java/util/logging/XMLFormatter.java \
java/util/prefs/NodeChangeListener.java \
java/util/prefs/Preferences.java \
java/util/prefs/PreferenceChangeListener.java \
@@ -1890,8 +1945,10 @@ gnu/java/locale/LocaleInformation_zh_HK.java \
gnu/java/locale/LocaleInformation_zh_SG.java \
gnu/java/locale/LocaleInformation_zh_TW.java \
gnu/java/math/MPN.java \
+gnu/java/net/HeaderFieldHelper.java \
gnu/java/net/PlainDatagramSocketImpl.java \
gnu/java/net/PlainSocketImpl.java \
+gnu/java/net/URLParseError.java \
gnu/java/net/protocol/core/Connection.java \
gnu/java/net/protocol/core/Handler.java \
gnu/java/net/protocol/core/CoreInputStream.java \
@@ -1910,6 +1967,10 @@ gnu/java/nio/NIOConstants.java \
gnu/java/nio/NIODatagramSocket.java \
gnu/java/nio/NIOServerSocket.java \
gnu/java/nio/NIOSocket.java \
+gnu/java/nio/ChannelInputStream.java \
+gnu/java/nio/ChannelOutputStream.java \
+gnu/java/nio/InputStreamChannel.java \
+gnu/java/nio/OutputStreamChannel.java \
gnu/java/nio/PipeImpl.java \
gnu/java/nio/SelectionKeyImpl.java \
gnu/java/nio/SelectorImpl.java \
@@ -2297,6 +2358,7 @@ java/text/DecimalFormat.java \
java/text/DecimalFormatSymbols.java \
java/text/FieldPosition.java \
java/text/Format.java \
+java/text/FormatCharacterIterator.java \
java/text/MessageFormat.java \
java/text/NumberFormat.java \
java/text/ParseException.java \
@@ -2622,8 +2684,9 @@ lib_gnu_java_awt_peer_gtk_la_LDFLAGS =
lib_gnu_java_awt_peer_gtk_la_DEPENDENCIES =
lib_gnu_java_awt_peer_gtk_la_OBJECTS = \
gnu/java/awt/peer/gtk/GdkFontMetrics.lo \
-gnu/java/awt/peer/gtk/GdkGraphics.lo gnu/java/awt/peer/gtk/GtkArg.lo \
-gnu/java/awt/peer/gtk/GtkArgList.lo \
+gnu/java/awt/peer/gtk/GdkGraphics.lo \
+gnu/java/awt/peer/gtk/GdkPixbufDecoder.lo \
+gnu/java/awt/peer/gtk/GtkArg.lo gnu/java/awt/peer/gtk/GtkArgList.lo \
gnu/java/awt/peer/gtk/GtkButtonPeer.lo \
gnu/java/awt/peer/gtk/GtkCanvasPeer.lo \
gnu/java/awt/peer/gtk/GtkCheckboxGroupPeer.lo \
@@ -2660,6 +2723,7 @@ gnu/java/awt/peer/gtk/GtkToolkit.lo \
gnu/java/awt/peer/gtk/GtkWindowPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.lo \
+jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.lo \
jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.lo \
@@ -2732,7 +2796,7 @@ libgcj-test.spec.in libgcj.pc.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-TAR = gtar
+TAR = tar
GZIP_ENV = --best
DIST_SUBDIRS = @DIRLTDL@ testsuite gcj include @DIRLTDL@ gcj include
DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
@@ -2825,6 +2889,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/awt/peer/GLightweightPeer.P \
.deps/gnu/java/awt/peer/gtk/GdkFontMetrics.P \
.deps/gnu/java/awt/peer/gtk/GdkGraphics.P \
+.deps/gnu/java/awt/peer/gtk/GdkPixbufDecoder.P \
.deps/gnu/java/awt/peer/gtk/GtkArg.P \
.deps/gnu/java/awt/peer/gtk/GtkArgList.P \
.deps/gnu/java/awt/peer/gtk/GtkButtonPeer.P \
@@ -3021,8 +3086,9 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/locale/LocaleInformation_zh_HK.P \
.deps/gnu/java/locale/LocaleInformation_zh_SG.P \
.deps/gnu/java/locale/LocaleInformation_zh_TW.P \
-.deps/gnu/java/math/MPN.P .deps/gnu/java/net/PlainDatagramSocketImpl.P \
-.deps/gnu/java/net/PlainSocketImpl.P \
+.deps/gnu/java/math/MPN.P .deps/gnu/java/net/HeaderFieldHelper.P \
+.deps/gnu/java/net/PlainDatagramSocketImpl.P \
+.deps/gnu/java/net/PlainSocketImpl.P .deps/gnu/java/net/URLParseError.P \
.deps/gnu/java/net/natPlainDatagramSocketImpl.P \
.deps/gnu/java/net/natPlainSocketImpl.P \
.deps/gnu/java/net/protocol/core/Connection.P \
@@ -3037,13 +3103,17 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/net/protocol/http/Handler.P \
.deps/gnu/java/net/protocol/jar/Connection.P \
.deps/gnu/java/net/protocol/jar/Handler.P \
+.deps/gnu/java/nio/ChannelInputStream.P \
+.deps/gnu/java/nio/ChannelOutputStream.P \
.deps/gnu/java/nio/DatagramChannelImpl.P \
.deps/gnu/java/nio/DatagramChannelSelectionKey.P \
-.deps/gnu/java/nio/FileLockImpl.P .deps/gnu/java/nio/NIOConstants.P \
+.deps/gnu/java/nio/FileLockImpl.P \
+.deps/gnu/java/nio/InputStreamChannel.P \
+.deps/gnu/java/nio/NIOConstants.P \
.deps/gnu/java/nio/NIODatagramSocket.P \
.deps/gnu/java/nio/NIOServerSocket.P .deps/gnu/java/nio/NIOSocket.P \
-.deps/gnu/java/nio/PipeImpl.P .deps/gnu/java/nio/SelectionKeyImpl.P \
-.deps/gnu/java/nio/SelectorImpl.P \
+.deps/gnu/java/nio/OutputStreamChannel.P .deps/gnu/java/nio/PipeImpl.P \
+.deps/gnu/java/nio/SelectionKeyImpl.P .deps/gnu/java/nio/SelectorImpl.P \
.deps/gnu/java/nio/SelectorProviderImpl.P \
.deps/gnu/java/nio/ServerSocketChannelImpl.P \
.deps/gnu/java/nio/ServerSocketChannelSelectionKey.P \
@@ -3080,6 +3150,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/gnu/java/rmi/server/RMIHashes.P \
.deps/gnu/java/rmi/server/RMIObjectInputStream.P \
.deps/gnu/java/rmi/server/RMIObjectOutputStream.P \
+.deps/gnu/java/rmi/server/RMIVoidValue.P \
.deps/gnu/java/rmi/server/UnicastConnection.P \
.deps/gnu/java/rmi/server/UnicastConnectionManager.P \
.deps/gnu/java/rmi/server/UnicastRef.P \
@@ -3831,6 +3902,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/text/DateFormat.P .deps/java/text/DateFormatSymbols.P \
.deps/java/text/DecimalFormat.P .deps/java/text/DecimalFormatSymbols.P \
.deps/java/text/FieldPosition.P .deps/java/text/Format.P \
+.deps/java/text/FormatCharacterIterator.P \
.deps/java/text/MessageFormat.P .deps/java/text/NumberFormat.P \
.deps/java/text/ParseException.P .deps/java/text/ParsePosition.P \
.deps/java/text/RuleBasedCollator.P .deps/java/text/SimpleDateFormat.P \
@@ -3842,17 +3914,18 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/java/util/Calendar.P .deps/java/util/Collection.P \
.deps/java/util/Collections.P .deps/java/util/Comparator.P \
.deps/java/util/ConcurrentModificationException.P \
-.deps/java/util/Date.P .deps/java/util/Dictionary.P \
-.deps/java/util/EmptyStackException.P .deps/java/util/Enumeration.P \
-.deps/java/util/EventListener.P .deps/java/util/EventListenerProxy.P \
-.deps/java/util/EventObject.P .deps/java/util/GregorianCalendar.P \
-.deps/java/util/HashMap.P .deps/java/util/HashSet.P \
-.deps/java/util/Hashtable.P .deps/java/util/IdentityHashMap.P \
-.deps/java/util/Iterator.P .deps/java/util/LinkedHashMap.P \
-.deps/java/util/LinkedHashSet.P .deps/java/util/LinkedList.P \
-.deps/java/util/List.P .deps/java/util/ListIterator.P \
-.deps/java/util/ListResourceBundle.P .deps/java/util/Locale.P \
-.deps/java/util/Map.P .deps/java/util/MissingResourceException.P \
+.deps/java/util/Currency.P .deps/java/util/Date.P \
+.deps/java/util/Dictionary.P .deps/java/util/EmptyStackException.P \
+.deps/java/util/Enumeration.P .deps/java/util/EventListener.P \
+.deps/java/util/EventListenerProxy.P .deps/java/util/EventObject.P \
+.deps/java/util/GregorianCalendar.P .deps/java/util/HashMap.P \
+.deps/java/util/HashSet.P .deps/java/util/Hashtable.P \
+.deps/java/util/IdentityHashMap.P .deps/java/util/Iterator.P \
+.deps/java/util/LinkedHashMap.P .deps/java/util/LinkedHashSet.P \
+.deps/java/util/LinkedList.P .deps/java/util/List.P \
+.deps/java/util/ListIterator.P .deps/java/util/ListResourceBundle.P \
+.deps/java/util/Locale.P .deps/java/util/Map.P \
+.deps/java/util/MissingResourceException.P \
.deps/java/util/NoSuchElementException.P .deps/java/util/Observable.P \
.deps/java/util/Observer.P .deps/java/util/Properties.P \
.deps/java/util/PropertyPermission.P \
@@ -3870,6 +3943,18 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.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/logging/ConsoleHandler.P \
+.deps/java/util/logging/ErrorManager.P \
+.deps/java/util/logging/FileHandler.P .deps/java/util/logging/Filter.P \
+.deps/java/util/logging/Formatter.P .deps/java/util/logging/Handler.P \
+.deps/java/util/logging/Level.P .deps/java/util/logging/LogManager.P \
+.deps/java/util/logging/LogRecord.P .deps/java/util/logging/Logger.P \
+.deps/java/util/logging/LoggingPermission.P \
+.deps/java/util/logging/MemoryHandler.P \
+.deps/java/util/logging/SimpleFormatter.P \
+.deps/java/util/logging/SocketHandler.P \
+.deps/java/util/logging/StreamHandler.P \
+.deps/java/util/logging/XMLFormatter.P \
.deps/java/util/natResourceBundle.P .deps/java/util/natTimeZone.P \
.deps/java/util/prefs/AbstractPreferences.P \
.deps/java/util/prefs/BackingStoreException.P \
@@ -4003,7 +4088,40 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/javax/naming/spi/Resolver.P .deps/javax/naming/spi/StateFactory.P \
.deps/javax/print/attribute/Attribute.P \
.deps/javax/print/attribute/AttributeSet.P \
+.deps/javax/print/attribute/AttributeSetUtilities.P \
+.deps/javax/print/attribute/DateTimeSyntax.P \
+.deps/javax/print/attribute/DocAttribute.P \
+.deps/javax/print/attribute/DocAttributeSet.P \
+.deps/javax/print/attribute/EnumSyntax.P \
+.deps/javax/print/attribute/HashAttributeSet.P \
+.deps/javax/print/attribute/HashDocAttributeSet.P \
+.deps/javax/print/attribute/HashPrintJobAttributeSet.P \
+.deps/javax/print/attribute/HashPrintRequestAttributeSet.P \
+.deps/javax/print/attribute/HashPrintServiceAttributeSet.P \
+.deps/javax/print/attribute/IntegerSyntax.P \
+.deps/javax/print/attribute/PrintJobAttribute.P \
+.deps/javax/print/attribute/PrintJobAttributeSet.P \
+.deps/javax/print/attribute/PrintRequestAttribute.P \
.deps/javax/print/attribute/PrintRequestAttributeSet.P \
+.deps/javax/print/attribute/PrintServiceAttribute.P \
+.deps/javax/print/attribute/PrintServiceAttributeSet.P \
+.deps/javax/print/attribute/ResolutionSyntax.P \
+.deps/javax/print/attribute/SetOfIntegerSyntax.P \
+.deps/javax/print/attribute/Size2DSyntax.P \
+.deps/javax/print/attribute/SupportedValuesAttribute.P \
+.deps/javax/print/attribute/TextSyntax.P \
+.deps/javax/print/attribute/URISyntax.P \
+.deps/javax/print/attribute/UnmodifiableSetException.P \
+.deps/javax/print/attribute/standard/Copies.P \
+.deps/javax/print/attribute/standard/JobImpressions.P \
+.deps/javax/print/attribute/standard/JobMediaSheets.P \
+.deps/javax/print/attribute/standard/JobPriority.P \
+.deps/javax/print/attribute/standard/NumberOfDocuments.P \
+.deps/javax/print/attribute/standard/NumberOfInterveningJobs.P \
+.deps/javax/print/attribute/standard/NumberUp.P \
+.deps/javax/print/attribute/standard/PagesPerMinute.P \
+.deps/javax/print/attribute/standard/PagesPerMinuteColor.P \
+.deps/javax/print/attribute/standard/QueuedJobCount.P \
.deps/javax/rmi/BAD_OPERATION.P .deps/javax/rmi/CORBA/ClassDesc.P \
.deps/javax/rmi/CORBA/ObjectImpl.P \
.deps/javax/rmi/CORBA/PortableRemoteObjectDelegate.P \
@@ -4280,6 +4398,7 @@ DEP_FILES = .deps/$(srcdir)/$(CONVERT_DIR)/gen-from-JIS.P \
.deps/jni/classpath/primlib.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics.P \
+.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.P \
.deps/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.P \
@@ -5084,7 +5203,7 @@ $(extra_headers) $(srcdir)/java/lang/Object.h $(srcdir)/java/lang/Class.h:
install-data-local:
$(PRE_INSTALL)
@echo Creating list of headers to install...
- @: $(call write_entries_to_file,$(nat_headers) $(extra_headers),tmp-ilist)
+ @: $(call write_entries_to_file,$(nat_headers_install) $(extra_headers),tmp-ilist)
@cat tmp-ilist | while read f; do \
d="`echo $$f | sed -e 's,/[^/]*$$,,'`"; \
$(mkinstalldirs) $(DESTDIR)$(includedir)/$$d; \
@@ -5098,6 +5217,14 @@ install-data-local:
echo " $(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f"; \
$(INSTALL_DATA) $(srcdir)/java/security/$$f $(DESTDIR)$(secdir)/$$f; \
done
+ $(INSTALL_DATA) 'java/io/ObjectOutputStream$$PutField.h' $(DESTDIR)$(includedir)/java/io/
+ $(INSTALL_DATA) 'java/io/ObjectInputStream$$GetField.h' $(DESTDIR)$(includedir)/java/io/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyData.h' $(DESTDIR)$(includedir)/java/lang/reflect/
+ $(INSTALL_DATA) 'java/lang/reflect/Proxy$$ProxyType.h' $(DESTDIR)$(includedir)/java/lang/reflect/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketInputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
+ $(INSTALL_DATA) 'gnu/java/net/PlainSocketImpl$$SocketOutputStream.h' $(DESTDIR)$(includedir)/gnu/java/net/
+
+ $(INSTALL_DATA) $(srcdir)/java/util/logging/logging.properties $(DESTDIR)$(propdir)/logging.properties
maintainer-check: libgcj.la
$(NM) .libs/libgcj.a | grep ' T ' \
diff --git a/libjava/aclocal.m4 b/libjava/aclocal.m4
index 5cfaa6f2f70..fe41f614c47 100644
--- a/libjava/aclocal.m4
+++ b/libjava/aclocal.m4
@@ -1,6 +1,6 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4-p5
+dnl aclocal.m4 generated automatically by aclocal 1.4
-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995-8, 1999 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.
@@ -290,7 +290,7 @@ fi[]dnl
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)
@@ -318,7 +318,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
@@ -359,7 +359,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.
@@ -378,7 +378,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,
@@ -395,7 +395,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
@@ -408,7 +408,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/libjava/boehm.cc b/libjava/boehm.cc
index 73240885510..642f451f92e 100644
--- a/libjava/boehm.cc
+++ b/libjava/boehm.cc
@@ -206,7 +206,7 @@ _Jv_MarkObj (void *addr, void *msp, void *msl, void * /* env */)
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cDlabel);
p = (ptr_t) c->protectionDomain;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cPlabel);
- p = (ptr_t) c->signers;
+ p = (ptr_t) c->hack_signers;
MAYBE_MARK (p, mark_stack_ptr, mark_stack_limit, c, cSlabel);
#ifdef INTERPRETER
diff --git a/libjava/configure b/libjava/configure
index a749310edbe..5ca63be3e8a 100755
--- a/libjava/configure
+++ b/libjava/configure
@@ -45,6 +45,9 @@ ac_help="$ac_help
--enable-libgcj-multifile
allow compilation of several files at once"
ac_help="$ac_help
+ --with-win32-nlsapi=ansi, unicows or unicode
+ native MinGW libgcj Win32 OS API [ansi]"
+ac_help="$ac_help
--enable-libgcj-debug enable runtime debugging code"
ac_help="$ac_help
--enable-interpreter enable interpreter"
@@ -596,7 +599,7 @@ fi
ORIGINAL_LD_FOR_MULTILIBS=$LD
echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
-echo "configure:600: checking whether ln -s works" >&5
+echo "configure:603: 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
@@ -649,7 +652,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:653: checking for a BSD compatible install" >&5
+echo "configure:656: 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
@@ -702,7 +705,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:706: checking whether build environment is sane" >&5
+echo "configure:709: checking whether build environment is sane" >&5
# Just in case
sleep 1
echo timestamp > conftestfile
@@ -759,7 +762,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:763: checking whether ${MAKE-make} sets \${MAKE}" >&5
+echo "configure:766: 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
@@ -792,12 +795,12 @@ else
fi
echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:796: checking for Cygwin environment" >&5
+echo "configure:799: 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 801 "configure"
+#line 804 "configure"
#include "confdefs.h"
int main() {
@@ -808,7 +811,7 @@ int main() {
return __CYGWIN__;
; return 0; }
EOF
-if { (eval echo configure:812: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:815: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_cygwin=yes
else
@@ -825,19 +828,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:829: checking for mingw32 environment" >&5
+echo "configure:832: 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 834 "configure"
+#line 837 "configure"
#include "confdefs.h"
int main() {
return __MINGW32__;
; return 0; }
EOF
-if { (eval echo configure:841: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:844: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_mingw32=yes
else
@@ -964,7 +967,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:968: checking host system type" >&5
+echo "configure:971: checking host system type" >&5
host_alias=$host
case "$host_alias" in
@@ -985,7 +988,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:989: checking target system type" >&5
+echo "configure:992: checking target system type" >&5
target_alias=$target
case "$target_alias" in
@@ -1003,7 +1006,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:1007: checking build system type" >&5
+echo "configure:1010: checking build system type" >&5
build_alias=$build
case "$build_alias" in
@@ -1032,7 +1035,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:1036: checking for $ac_word" >&5
+echo "configure:1039: 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
@@ -1062,7 +1065,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:1066: checking for $ac_word" >&5
+echo "configure:1069: 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
@@ -1113,7 +1116,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:1117: checking for $ac_word" >&5
+echo "configure:1120: 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
@@ -1146,7 +1149,7 @@ fi
echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1150: checking whether we are using GNU C" >&5
+echo "configure:1153: 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
@@ -1155,7 +1158,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1159: \"$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:1162: \"$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
@@ -1174,7 +1177,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:1178: checking whether ${CC-cc} accepts -g" >&5
+echo "configure:1181: 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
@@ -1223,7 +1226,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:1227: checking for $ac_word" >&5
+echo "configure:1230: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_glibjava_CXX'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1258,7 +1261,7 @@ CXX=$glibjava_CXX
test -z "$glibjava_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:1262: checking whether we are using GNU C++" >&5
+echo "configure:1265: 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
@@ -1267,7 +1270,7 @@ else
yes;
#endif
EOF
-if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1271: \"$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:1274: \"$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
@@ -1282,7 +1285,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:1286: checking whether ${CXX-g++} accepts -g" >&5
+echo "configure:1289: 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
@@ -1331,7 +1334,7 @@ EOF
missing_dir=`cd $ac_aux_dir && pwd`
echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:1335: checking for working aclocal" >&5
+echo "configure:1338: 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.
@@ -1344,7 +1347,7 @@ else
fi
echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:1348: checking for working autoconf" >&5
+echo "configure:1351: 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.
@@ -1357,7 +1360,7 @@ else
fi
echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:1361: checking for working automake" >&5
+echo "configure:1364: 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.
@@ -1370,7 +1373,7 @@ else
fi
echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:1374: checking for working autoheader" >&5
+echo "configure:1377: 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.
@@ -1383,7 +1386,7 @@ else
fi
echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:1387: checking for working makeinfo" >&5
+echo "configure:1390: 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.
@@ -1400,7 +1403,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:1404: checking for $ac_word" >&5
+echo "configure:1407: 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
@@ -1432,7 +1435,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:1436: checking for $ac_word" >&5
+echo "configure:1439: 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
@@ -1464,7 +1467,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:1468: checking for $ac_word" >&5
+echo "configure:1471: 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
@@ -1496,7 +1499,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:1500: checking for $ac_word" >&5
+echo "configure:1503: 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
@@ -1541,7 +1544,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:1545: checking for a BSD compatible install" >&5
+echo "configure:1548: 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
@@ -1595,7 +1598,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:1599: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo "configure:1602: 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"
@@ -1621,7 +1624,7 @@ fi
echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1625: checking for executable suffix" >&5
+echo "configure:1628: checking for executable suffix" >&5
if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1631,7 +1634,7 @@ else
rm -f conftest*
echo 'int main () { return 0; }' > conftest.$ac_ext
ac_cv_exeext=
- if { (eval echo configure:1635: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+ if { (eval echo configure:1638: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
for file in conftest.*; do
case $file in
*.c | *.o | *.obj) ;;
@@ -1781,7 +1784,7 @@ ac_prog=ld
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:1785: checking for ld used by GCC" >&5
+echo "configure:1788: checking for ld used by GCC" >&5
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1811,10 +1814,10 @@ echo "configure:1785: 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:1815: checking for GNU ld" >&5
+echo "configure:1818: checking for GNU ld" >&5
else
echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1818: checking for non-GNU ld" >&5
+echo "configure:1821: checking for non-GNU ld" >&5
fi
if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
@@ -1849,7 +1852,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:1853: checking if the linker ($LD) is GNU ld" >&5
+echo "configure:1856: 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
@@ -1866,7 +1869,7 @@ 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:1870: checking for $LD option to reload object files" >&5
+echo "configure:1873: 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
@@ -1878,7 +1881,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:1882: checking for BSD-compatible nm" >&5
+echo "configure:1885: 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
@@ -1916,7 +1919,7 @@ 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:1920: checking how to recognise dependant libraries" >&5
+echo "configure:1923: 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
@@ -1955,6 +1958,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
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
@@ -1965,6 +1969,7 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ lt_cv_deplibs_check_method=pass_all
;;
freebsd* )
@@ -2089,13 +2094,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:2093: checking for object suffix" >&5
+echo "configure:2098: 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:2099: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2104: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
for ac_file in conftest.*; do
case $ac_file in
*.c) ;;
@@ -2119,7 +2124,7 @@ 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:2123: checking for ${ac_tool_prefix}file" >&5
+echo "configure:2128: 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
@@ -2181,7 +2186,7 @@ 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:2185: checking for file" >&5
+echo "configure:2190: 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
@@ -2252,7 +2257,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:2256: checking for $ac_word" >&5
+echo "configure:2261: 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
@@ -2284,7 +2289,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:2288: checking for $ac_word" >&5
+echo "configure:2293: 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
@@ -2319,7 +2324,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:2323: checking for $ac_word" >&5
+echo "configure:2328: 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
@@ -2351,7 +2356,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:2355: checking for $ac_word" >&5
+echo "configure:2360: 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
@@ -2418,8 +2423,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 2422 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2423: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ echo '#line 2427 "configure"' > conftest.$ac_ext
+ if { (eval echo configure:2428: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
if test "$lt_cv_prog_gnu_ld" = yes; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
@@ -2452,7 +2457,7 @@ case $host in
ia64-*-hpux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2456: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2461: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*ELF-32*)
HPUX_IA64_MODE="32"
@@ -2468,7 +2473,7 @@ ia64-*-hpux*)
x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
- if { (eval echo configure:2472: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+ if { (eval echo configure:2477: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
case "`/usr/bin/file conftest.o`" in
*32-bit*)
case $host in
@@ -2512,7 +2517,7 @@ x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
-echo "configure:2516: checking whether the C compiler needs -belf" >&5
+echo "configure:2521: 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
@@ -2525,14 +2530,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 2529 "configure"
+#line 2534 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:2536: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2541: \"$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
@@ -2562,7 +2567,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:2566: checking how to run the C++ preprocessor" >&5
+echo "configure:2571: 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
@@ -2575,12 +2580,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 2579 "configure"
+#line 2584 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:2584: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:2589: \"$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
:
@@ -2794,6 +2799,31 @@ else
ONESTEP_FALSE=
fi
+# What is the native OS API for MinGW?
+# Check whether --with-win32-nlsapi or --without-win32-nlsapi was given.
+if test "${with_win32_nlsapi+set}" = set; then
+ withval="$with_win32_nlsapi"
+
+case "${withval}" in
+ ansi) with_win32_nlsapi=ansi ;;
+ unicows) with_win32_nlsapi=unicows ;;
+ unicode) with_win32_nlsapi=unicode ;;
+ *) { echo "configure: error: Bad value ${withval} for --with-win32-nlsapi." 1>&2; exit 1; } ;;
+esac
+else
+ with_win32_nlsapi=ansi
+fi
+
+
+case "${with_win32_nlsapi}" in
+ unicows | unicode)
+ cat >> confdefs.h <<\EOF
+#define MINGW_LIBGCJ_UNICODE 1
+EOF
+
+ ;;
+esac
+
if test "${slow_pthread_self}" = "yes"; then
cat >> confdefs.h <<\EOF
#define SLOW_PTHREAD_SELF 1
@@ -2839,7 +2869,7 @@ INTERPRETER="$libgcj_interpreter"
echo $ac_n "checking for exception model to use""... $ac_c" 1>&6
-echo "configure:2843: checking for exception model to use" >&5
+echo "configure:2873: 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.
@@ -2854,7 +2884,7 @@ if test "${enable_sjlj_exceptions+set}" = set; then
:
else
cat > conftest.$ac_ext << EOF
-#line 2858 "configure"
+#line 2888 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -2865,7 +2895,7 @@ void foo()
EOF
old_CXXFLAGS="$CXXFLAGS"
CXXFLAGS=-S
-if { (eval echo configure:2869: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:2899: \"$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
@@ -2979,7 +3009,7 @@ case "$TARGET_ECOS" in
PLATFORMH=win32.h
echo $ac_n "checking whether 'ld' is at least 2.13""... $ac_c" 1>&6
-echo "configure:2983: checking whether 'ld' is at least 2.13" >&5
+echo "configure:3013: checking whether 'ld' is at least 2.13" >&5
LD_PROG=`$CC --print-prog-name=ld`
LD_VERSION=`$LD_PROG --version`
LD_VERSION_MAJOR=`echo "$LD_VERSION" | head -1 | cut -d '.' -f 1 | cut -d ' ' -f 4`
@@ -3025,7 +3055,7 @@ esac
echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:3029: checking how to run the C preprocessor" >&5
+echo "configure:3059: checking how to run the C preprocessor" >&5
# On Suns, sometimes $CPP names a directory.
if test -n "$CPP" && test -d "$CPP"; then
CPP=
@@ -3040,13 +3070,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 3044 "configure"
+#line 3074 "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:3050: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3080: \"$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
:
@@ -3057,13 +3087,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -E -traditional-cpp"
cat > conftest.$ac_ext <<EOF
-#line 3061 "configure"
+#line 3091 "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:3067: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3097: \"$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
:
@@ -3074,13 +3104,13 @@ else
rm -rf conftest*
CPP="${CC-cc} -nologo -E"
cat > conftest.$ac_ext <<EOF
-#line 3078 "configure"
+#line 3108 "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:3084: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3114: \"$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
:
@@ -3105,7 +3135,7 @@ fi
echo "$ac_t""$CPP" 1>&6
cat > conftest.$ac_ext <<EOF
-#line 3109 "configure"
+#line 3139 "configure"
#include "confdefs.h"
#include <stdint.h>
EOF
@@ -3120,7 +3150,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3124 "configure"
+#line 3154 "configure"
#include "confdefs.h"
#include <inttypes.h>
EOF
@@ -3135,7 +3165,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3139 "configure"
+#line 3169 "configure"
#include "confdefs.h"
#include <sys/types.h>
EOF
@@ -3150,7 +3180,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3154 "configure"
+#line 3184 "configure"
#include "confdefs.h"
#include <sys/config.h>
EOF
@@ -3167,7 +3197,7 @@ rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3171 "configure"
+#line 3201 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3182,7 +3212,7 @@ fi
rm -f conftest*
cat > conftest.$ac_ext <<EOF
-#line 3186 "configure"
+#line 3216 "configure"
#include "confdefs.h"
#include <time.h>
EOF
@@ -3216,9 +3246,16 @@ test -d gnu/java/net || mkdir gnu/java/net
+test -d gnu/java/nio || mkdir gnu/java/nio
+
+
+
case "${host}" in
*mingw*)
SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
+ if test "${with_win32_nlsapi}" = "unicows"; then
+ SYSTEMSPEC="-lunicows $SYSTEMSPEC"
+ fi
;;
*)
SYSTEMSPEC=
@@ -3245,7 +3282,7 @@ ZLIBTESTSPEC=
# 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:3249: checking for X" >&5
+echo "configure:3286: checking for X" >&5
# Check whether --with-x or --without-x was given.
if test "${with_x+set}" = set; then
@@ -3307,12 +3344,12 @@ if test "$ac_x_includes" = NO; then
# First, try using that file with no special directory specified.
cat > conftest.$ac_ext <<EOF
-#line 3311 "configure"
+#line 3348 "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:3316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3353: \"$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*
@@ -3381,14 +3418,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 3385 "configure"
+#line 3422 "configure"
#include "confdefs.h"
int main() {
${x_direct_test_function}()
; return 0; }
EOF
-if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3429: \"$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.
@@ -3494,17 +3531,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:3498: checking whether -R must be followed by a space" >&5
+echo "configure:3535: 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 3501 "configure"
+#line 3538 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3508: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3545: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_nospace=yes
else
@@ -3520,14 +3557,14 @@ rm -f conftest*
else
LIBS="$ac_xsave_LIBS -R $x_libraries"
cat > conftest.$ac_ext <<EOF
-#line 3524 "configure"
+#line 3561 "configure"
#include "confdefs.h"
int main() {
; return 0; }
EOF
-if { (eval echo configure:3531: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3568: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_R_space=yes
else
@@ -3559,7 +3596,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:3563: checking for dnet_ntoa in -ldnet" >&5
+echo "configure:3600: 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
@@ -3567,7 +3604,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3571 "configure"
+#line 3608 "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
@@ -3578,7 +3615,7 @@ int main() {
dnet_ntoa()
; 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:3619: \"$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
@@ -3600,7 +3637,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:3604: checking for dnet_ntoa in -ldnet_stub" >&5
+echo "configure:3641: 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
@@ -3608,7 +3645,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldnet_stub $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3612 "configure"
+#line 3649 "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
@@ -3619,7 +3656,7 @@ int main() {
dnet_ntoa()
; return 0; }
EOF
-if { (eval echo configure:3623: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3660: \"$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
@@ -3648,12 +3685,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:3652: checking for gethostbyname" >&5
+echo "configure:3689: 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 3657 "configure"
+#line 3694 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -3676,7 +3713,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:3680: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3717: \"$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
@@ -3697,7 +3734,7 @@ fi
if test $ac_cv_func_gethostbyname = no; then
echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
-echo "configure:3701: checking for gethostbyname in -lnsl" >&5
+echo "configure:3738: 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
@@ -3705,7 +3742,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3709 "configure"
+#line 3746 "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
@@ -3716,7 +3753,7 @@ int main() {
gethostbyname()
; return 0; }
EOF
-if { (eval echo configure:3720: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3757: \"$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
@@ -3746,12 +3783,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:3750: checking for connect" >&5
+echo "configure:3787: 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 3755 "configure"
+#line 3792 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -3774,7 +3811,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:3778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3815: \"$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
@@ -3795,7 +3832,7 @@ fi
if test $ac_cv_func_connect = no; then
echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
-echo "configure:3799: checking for connect in -lsocket" >&5
+echo "configure:3836: 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
@@ -3803,7 +3840,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3807 "configure"
+#line 3844 "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
@@ -3814,7 +3851,7 @@ int main() {
connect()
; return 0; }
EOF
-if { (eval echo configure:3818: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3855: \"$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
@@ -3838,12 +3875,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:3842: checking for remove" >&5
+echo "configure:3879: 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 3847 "configure"
+#line 3884 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char remove(); below. */
@@ -3866,7 +3903,7 @@ remove();
; return 0; }
EOF
-if { (eval echo configure:3870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3907: \"$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
@@ -3887,7 +3924,7 @@ fi
if test $ac_cv_func_remove = no; then
echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
-echo "configure:3891: checking for remove in -lposix" >&5
+echo "configure:3928: 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
@@ -3895,7 +3932,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3899 "configure"
+#line 3936 "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
@@ -3906,7 +3943,7 @@ int main() {
remove()
; return 0; }
EOF
-if { (eval echo configure:3910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3947: \"$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
@@ -3930,12 +3967,12 @@ fi
# BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
echo $ac_n "checking for shmat""... $ac_c" 1>&6
-echo "configure:3934: checking for shmat" >&5
+echo "configure:3971: 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 3939 "configure"
+#line 3976 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char shmat(); below. */
@@ -3958,7 +3995,7 @@ shmat();
; return 0; }
EOF
-if { (eval echo configure:3962: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3999: \"$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
@@ -3979,7 +4016,7 @@ fi
if test $ac_cv_func_shmat = no; then
echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
-echo "configure:3983: checking for shmat in -lipc" >&5
+echo "configure:4020: 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
@@ -3987,7 +4024,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lipc $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 3991 "configure"
+#line 4028 "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
@@ -3998,7 +4035,7 @@ int main() {
shmat()
; return 0; }
EOF
-if { (eval echo configure:4002: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4039: \"$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
@@ -4031,7 +4068,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:4035: checking for IceConnectionNumber in -lICE" >&5
+echo "configure:4072: 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
@@ -4039,7 +4076,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lICE $X_EXTRA_LIBS $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4043 "configure"
+#line 4080 "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
@@ -4050,7 +4087,7 @@ int main() {
IceConnectionNumber()
; return 0; }
EOF
-if { (eval echo configure:4054: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4091: \"$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
@@ -4148,7 +4185,7 @@ fi
libsubdir=.libs
echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:4152: checking for garbage collector to use" >&5
+echo "configure:4189: 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"
@@ -4200,7 +4237,7 @@ esac
echo $ac_n "checking for thread model used by GCC""... $ac_c" 1>&6
-echo "configure:4204: checking for thread model used by GCC" >&5
+echo "configure:4241: 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
@@ -4411,12 +4448,12 @@ else
for ac_func in strerror ioctl select fstat open fsync sleep opendir
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4415: checking for $ac_func" >&5
+echo "configure:4452: 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 4420 "configure"
+#line 4457 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4439,7 +4476,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4443: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4480: \"$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 +4503,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:4470: checking for $ac_func" >&5
+echo "configure:4507: 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 4512 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4494,7 +4531,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:4535: \"$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
@@ -4521,12 +4558,12 @@ done
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:4525: checking for $ac_func" >&5
+echo "configure:4562: 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 4530 "configure"
+#line 4567 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4549,7 +4586,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4590: \"$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
@@ -4576,12 +4613,12 @@ done
for ac_func in nl_langinfo setlocale
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4580: checking for $ac_func" >&5
+echo "configure:4617: 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 4585 "configure"
+#line 4622 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4604,7 +4641,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4608: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4645: \"$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
@@ -4631,12 +4668,12 @@ done
for ac_func in inet_aton inet_addr
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4635: checking for $ac_func" >&5
+echo "configure:4672: 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 4640 "configure"
+#line 4677 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4659,7 +4696,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4663: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4700: \"$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
@@ -4686,12 +4723,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:4690: checking for $ac_func" >&5
+echo "configure:4727: 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 4695 "configure"
+#line 4732 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4714,7 +4751,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4718: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4755: \"$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
@@ -4741,12 +4778,12 @@ done
for ac_func in fork execvp pipe sigaction ftruncate
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:4745: checking for $ac_func" >&5
+echo "configure:4782: 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 4750 "configure"
+#line 4787 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -4769,7 +4806,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:4773: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4810: \"$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
@@ -4797,17 +4834,17 @@ done
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:4801: checking for $ac_hdr" >&5
+echo "configure:4838: 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 4806 "configure"
+#line 4843 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:4811: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:4848: \"$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*
@@ -4834,12 +4871,12 @@ fi
done
echo $ac_n "checking for backtrace""... $ac_c" 1>&6
-echo "configure:4838: checking for backtrace" >&5
+echo "configure:4875: checking for backtrace" >&5
if eval "test \"`echo '$''{'ac_cv_func_backtrace'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 4843 "configure"
+#line 4880 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char backtrace(); below. */
@@ -4862,7 +4899,7 @@ backtrace();
; return 0; }
EOF
-if { (eval echo configure:4866: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4903: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_backtrace=yes"
else
@@ -4915,7 +4952,7 @@ fi
echo $ac_n "checking for dladdr in -ldl""... $ac_c" 1>&6
-echo "configure:4919: checking for dladdr in -ldl" >&5
+echo "configure:4956: 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
@@ -4923,7 +4960,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 4927 "configure"
+#line 4964 "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
@@ -4934,7 +4971,7 @@ int main() {
dladdr()
; return 0; }
EOF
-if { (eval echo configure:4938: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:4975: \"$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
@@ -4970,7 +5007,7 @@ do
ac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_file""... $ac_c" 1>&6
-echo "configure:4974: checking for $ac_file" >&5
+echo "configure:5011: 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
@@ -5028,7 +5065,7 @@ fi
echo $ac_n "checking for iconv""... $ac_c" 1>&6
-echo "configure:5032: checking for iconv" >&5
+echo "configure:5069: checking for iconv" >&5
if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -5036,7 +5073,7 @@ else
am_cv_func_iconv="no, consider installing GNU libiconv"
am_cv_lib_iconv=no
cat > conftest.$ac_ext <<EOF
-#line 5040 "configure"
+#line 5077 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5046,7 +5083,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5087: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
am_cv_func_iconv=yes
else
@@ -5058,7 +5095,7 @@ rm -f conftest*
am_save_LIBS="$LIBS"
LIBS="$LIBS $am_cv_libiconv_ldpath -liconv"
cat > conftest.$ac_ext <<EOF
-#line 5062 "configure"
+#line 5099 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <iconv.h>
@@ -5068,7 +5105,7 @@ iconv_t cd = iconv_open("","");
iconv_close(cd);
; return 0; }
EOF
-if { (eval echo configure:5072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5109: \"$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
@@ -5089,13 +5126,13 @@ echo "$ac_t""$am_cv_func_iconv" 1>&6
EOF
echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6
-echo "configure:5093: checking for iconv declaration" >&5
+echo "configure:5130: 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 5099 "configure"
+#line 5136 "configure"
#include "confdefs.h"
#include <stdlib.h>
@@ -5114,7 +5151,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5118: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5155: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
am_cv_proto_iconv_arg1=""
else
@@ -5145,17 +5182,17 @@ EOF
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:5149: checking for $ac_hdr" >&5
+echo "configure:5186: 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 5154 "configure"
+#line 5191 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:5159: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:5196: \"$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*
@@ -5183,19 +5220,19 @@ done
if test $ac_cv_header_locale_h = yes; then
echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6
-echo "configure:5187: checking for LC_MESSAGES" >&5
+echo "configure:5224: 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 5192 "configure"
+#line 5229 "configure"
#include "confdefs.h"
#include <locale.h>
int main() {
return LC_MESSAGES
; return 0; }
EOF
-if { (eval echo configure:5199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5236: \"$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
@@ -5216,12 +5253,12 @@ EOF
fi
fi
echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6
-echo "configure:5220: checking whether struct tm is in sys/time.h or time.h" >&5
+echo "configure:5257: checking whether struct tm is in sys/time.h or time.h" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5225 "configure"
+#line 5262 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <time.h>
@@ -5229,7 +5266,7 @@ int main() {
struct tm *tp; tp->tm_sec;
; return 0; }
EOF
-if { (eval echo configure:5233: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5270: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm=time.h
else
@@ -5250,12 +5287,12 @@ EOF
fi
echo $ac_n "checking for tm_zone in struct tm""... $ac_c" 1>&6
-echo "configure:5254: checking for tm_zone in struct tm" >&5
+echo "configure:5291: checking for tm_zone in struct tm" >&5
if eval "test \"`echo '$''{'ac_cv_struct_tm_zone'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5259 "configure"
+#line 5296 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <$ac_cv_struct_tm>
@@ -5263,7 +5300,7 @@ int main() {
struct tm tm; tm.tm_zone;
; return 0; }
EOF
-if { (eval echo configure:5267: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5304: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_struct_tm_zone=yes
else
@@ -5283,12 +5320,12 @@ EOF
else
echo $ac_n "checking for tzname""... $ac_c" 1>&6
-echo "configure:5287: checking for tzname" >&5
+echo "configure:5324: checking for tzname" >&5
if eval "test \"`echo '$''{'ac_cv_var_tzname'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 5292 "configure"
+#line 5329 "configure"
#include "confdefs.h"
#include <time.h>
#ifndef tzname /* For SGI. */
@@ -5298,7 +5335,7 @@ int main() {
atoi(*tzname);
; 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:5339: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
ac_cv_var_tzname=yes
else
@@ -5323,12 +5360,12 @@ fi
for ac_func in gethostbyname_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5327: checking for $ac_func" >&5
+echo "configure:5364: 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 5332 "configure"
+#line 5369 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5351,7 +5388,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5355: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5392: \"$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
@@ -5378,7 +5415,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5382 "configure"
+#line 5419 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5398,7 +5435,7 @@ rm -f conftest*
*" -D_REENTRANT "*) ;;
*)
echo $ac_n "checking whether gethostbyname_r declaration requires -D_REENTRANT""... $ac_c" 1>&6
-echo "configure:5402: checking whether gethostbyname_r declaration requires -D_REENTRANT" >&5
+echo "configure:5439: 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
@@ -5411,14 +5448,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 5415 "configure"
+#line 5452 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5422: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5459: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=no
else
@@ -5428,14 +5465,14 @@ else
CPPFLAGS_SAVE="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
cat > conftest.$ac_ext <<EOF
-#line 5432 "configure"
+#line 5469 "configure"
#include "confdefs.h"
#include <netdb.h>
int main() {
gethostbyname_r("", 0, 0);
; return 0; }
EOF
-if { (eval echo configure:5439: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5476: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_gethostbyname_r_needs_reentrant=yes
else
@@ -5470,12 +5507,12 @@ EOF
esac
echo $ac_n "checking for struct hostent_data""... $ac_c" 1>&6
-echo "configure:5474: checking for struct hostent_data" >&5
+echo "configure:5511: 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 5479 "configure"
+#line 5516 "configure"
#include "confdefs.h"
#if GETHOSTBYNAME_R_NEEDS_REENTRANT && !defined(_REENTRANT)
@@ -5486,7 +5523,7 @@ int main() {
struct hostent_data data;
; return 0; }
EOF
-if { (eval echo configure:5490: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:5527: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
libjava_cv_struct_hostent_data=yes
else
@@ -5518,7 +5555,7 @@ done
# to exist where expected. (The root issue: AC_CHECK_FUNCS assumes C
# linkage check is enough, yet C++ code requires proper prototypes.)
cat > conftest.$ac_ext <<EOF
-#line 5522 "configure"
+#line 5559 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5529,12 +5566,12 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
for ac_func in gethostbyaddr_r
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5533: checking for $ac_func" >&5
+echo "configure:5570: 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 5538 "configure"
+#line 5575 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5557,7 +5594,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5561: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5598: \"$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
@@ -5584,7 +5621,7 @@ EOF
# We look for the one that returns `int'.
# Hopefully this check is robust enough.
cat > conftest.$ac_ext <<EOF
-#line 5588 "configure"
+#line 5625 "configure"
#include "confdefs.h"
#include <netdb.h>
EOF
@@ -5611,12 +5648,12 @@ rm -f conftest*
for ac_func in gethostname
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5615: checking for $ac_func" >&5
+echo "configure:5652: 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 5620 "configure"
+#line 5657 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5639,7 +5676,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5643: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5680: \"$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
@@ -5663,7 +5700,7 @@ EOF
EOF
cat > conftest.$ac_ext <<EOF
-#line 5667 "configure"
+#line 5704 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5687,12 +5724,12 @@ done
for ac_func in usleep
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5691: checking for $ac_func" >&5
+echo "configure:5728: 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 5696 "configure"
+#line 5733 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5715,7 +5752,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5756: \"$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
@@ -5735,7 +5772,7 @@ if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then
EOF
cat > conftest.$ac_ext <<EOF
-#line 5739 "configure"
+#line 5776 "configure"
#include "confdefs.h"
#include <unistd.h>
EOF
@@ -5766,12 +5803,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:5770: checking for $ac_func" >&5
+echo "configure:5807: 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 5775 "configure"
+#line 5812 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5794,7 +5831,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5798: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5835: \"$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
@@ -5824,12 +5861,12 @@ done
for ac_func in sched_yield
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:5828: checking for $ac_func" >&5
+echo "configure:5865: 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 5833 "configure"
+#line 5870 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -5852,7 +5889,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:5856: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5893: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
eval "ac_cv_func_$ac_func=yes"
else
@@ -5874,7 +5911,7 @@ EOF
else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lrt""... $ac_c" 1>&6
-echo "configure:5878: checking for sched_yield in -lrt" >&5
+echo "configure:5915: 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
@@ -5882,7 +5919,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lrt $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5886 "configure"
+#line 5923 "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
@@ -5893,7 +5930,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5897: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5934: \"$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
@@ -5919,7 +5956,7 @@ else
echo "$ac_t""no" 1>&6
echo $ac_n "checking for sched_yield in -lposix4""... $ac_c" 1>&6
-echo "configure:5923: checking for sched_yield in -lposix4" >&5
+echo "configure:5960: 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
@@ -5927,7 +5964,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lposix4 $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 5931 "configure"
+#line 5968 "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
@@ -5938,7 +5975,7 @@ int main() {
sched_yield()
; return 0; }
EOF
-if { (eval echo configure:5942: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:5979: \"$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 +6011,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 5978 "configure"
+#line 6015 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -5983,7 +6020,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:5987: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6024: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE_M_COUNT 1
@@ -5995,7 +6032,7 @@ else
rm -rf conftest*
cat > conftest.$ac_ext <<EOF
-#line 5999 "configure"
+#line 6036 "configure"
#include "confdefs.h"
#include <pthread.h>
int main() {
@@ -6004,7 +6041,7 @@ int main() {
; return 0; }
EOF
-if { (eval echo configure:6008: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:6045: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define PTHREAD_MUTEX_HAVE___M_COUNT 1
@@ -6024,12 +6061,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:6028: checking for $ac_func" >&5
+echo "configure:6065: 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 6033 "configure"
+#line 6070 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6052,7 +6089,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6093: \"$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
@@ -6083,12 +6120,12 @@ done
for ac_func in memmove
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6087: checking for $ac_func" >&5
+echo "configure:6124: 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 6092 "configure"
+#line 6129 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6111,7 +6148,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6152: \"$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
@@ -6141,12 +6178,12 @@ done
for ac_func in memcpy
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:6145: checking for $ac_func" >&5
+echo "configure:6182: 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 6150 "configure"
+#line 6187 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -6169,7 +6206,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:6173: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6210: \"$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
@@ -6198,7 +6235,7 @@ done
fi
echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:6202: checking for dlopen in -ldl" >&5
+echo "configure:6239: 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
@@ -6206,7 +6243,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6210 "configure"
+#line 6247 "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
@@ -6217,7 +6254,7 @@ int main() {
dlopen()
; return 0; }
EOF
-if { (eval echo configure:6221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6258: \"$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
@@ -6262,7 +6299,7 @@ fi
#--------------------------------------------------------------------
echo $ac_n "checking for socket libraries""... $ac_c" 1>&6
-echo "configure:6266: checking for socket libraries" >&5
+echo "configure:6303: 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
@@ -6270,12 +6307,12 @@ else
gcj_checkBoth=0
unset ac_cv_func_connect
echo $ac_n "checking for connect""... $ac_c" 1>&6
-echo "configure:6274: checking for connect" >&5
+echo "configure:6311: 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 6279 "configure"
+#line 6316 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char connect(); below. */
@@ -6298,7 +6335,7 @@ connect();
; return 0; }
EOF
-if { (eval echo configure:6302: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6339: \"$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
@@ -6321,7 +6358,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:6325: checking for main in -lsocket" >&5
+echo "configure:6362: 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
@@ -6329,14 +6366,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6333 "configure"
+#line 6370 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6340: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6377: \"$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
@@ -6363,12 +6400,12 @@ fi
LIBS="$LIBS -lsocket -lnsl"
unset ac_cv_func_accept
echo $ac_n "checking for accept""... $ac_c" 1>&6
-echo "configure:6367: checking for accept" >&5
+echo "configure:6404: 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 6372 "configure"
+#line 6409 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char accept(); below. */
@@ -6391,7 +6428,7 @@ accept();
; return 0; }
EOF
-if { (eval echo configure:6395: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6432: \"$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
@@ -6418,12 +6455,12 @@ fi
gcj_oldLibs=$LIBS
LIBS="$LIBS $gcj_cv_lib_sockets"
echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6
-echo "configure:6422: checking for gethostbyname" >&5
+echo "configure:6459: 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 6427 "configure"
+#line 6464 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname(); below. */
@@ -6446,7 +6483,7 @@ gethostbyname();
; return 0; }
EOF
-if { (eval echo configure:6450: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6487: \"$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
@@ -6464,7 +6501,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:6468: checking for main in -lnsl" >&5
+echo "configure:6505: 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
@@ -6472,14 +6509,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6476 "configure"
+#line 6513 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:6483: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6520: \"$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
@@ -6511,7 +6548,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:6515: checking for deflate in -lz" >&5
+echo "configure:6552: 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
@@ -6519,7 +6556,7 @@ else
ac_save_LIBS="$LIBS"
LIBS="-lz $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6523 "configure"
+#line 6560 "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
@@ -6530,7 +6567,7 @@ int main() {
deflate()
; return 0; }
EOF
-if { (eval echo configure:6534: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6571: \"$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
@@ -6579,7 +6616,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6583: checking for $ac_word" >&5
+echo "configure:6620: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6625,9 +6662,9 @@ fi
no_gtk=yes
fi
- min_gtk_version=2.0.0
+ min_gtk_version=2.2.0
echo $ac_n "checking for GTK+ - version >= $min_gtk_version""... $ac_c" 1>&6
-echo "configure:6631: checking for GTK+ - version >= $min_gtk_version" >&5
+echo "configure:6668: checking for GTK+ - version >= $min_gtk_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6662,7 +6699,7 @@ echo "configure:6631: checking for GTK+ - version >= $min_gtk_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6666 "configure"
+#line 6703 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6737,7 +6774,7 @@ main ()
}
EOF
-if { (eval echo configure:6741: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:6778: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -6771,7 +6808,7 @@ fi
CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$LIBS $GTK_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 6775 "configure"
+#line 6812 "configure"
#include "confdefs.h"
#include <gtk/gtk.h>
@@ -6781,7 +6818,7 @@ int main() {
return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version));
; return 0; }
EOF
-if { (eval echo configure:6785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:6822: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
@@ -6840,7 +6877,7 @@ fi
# Extract the first word of "pkg-config", so it can be a program name with args.
set dummy pkg-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:6844: checking for $ac_word" >&5
+echo "configure:6881: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_PKG_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -6888,9 +6925,9 @@ fi
no_glib=yes
fi
- min_glib_version=2.0.0
+ min_glib_version=2.2.0
echo $ac_n "checking for GLIB - version >= $min_glib_version""... $ac_c" 1>&6
-echo "configure:6894: checking for GLIB - version >= $min_glib_version" >&5
+echo "configure:6931: checking for GLIB - version >= $min_glib_version" >&5
if test x$PKG_CONFIG != xno ; then
## don't try to run the test against uninstalled libtool libs
@@ -6929,7 +6966,7 @@ echo "configure:6894: checking for GLIB - version >= $min_glib_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 6933 "configure"
+#line 6970 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -7004,7 +7041,7 @@ main ()
}
EOF
-if { (eval echo configure:7008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7038,7 +7075,7 @@ fi
CFLAGS="$CFLAGS $GLIB_CFLAGS"
LIBS="$LIBS $GLIB_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7042 "configure"
+#line 7079 "configure"
#include "confdefs.h"
#include <glib.h>
@@ -7048,7 +7085,7 @@ int main() {
return ((glib_major_version) || (glib_minor_version) || (glib_micro_version));
; return 0; }
EOF
-if { (eval echo configure:7052: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding GLIB or finding the wrong"
@@ -7127,7 +7164,7 @@ fi
# Extract the first word of "libart2-config", so it can be a program name with args.
set dummy libart2-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7131: checking for $ac_word" >&5
+echo "configure:7168: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7164,7 +7201,7 @@ fi
# Extract the first word of "libart-config", so it can be a program name with args.
set dummy libart-config; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:7168: checking for $ac_word" >&5
+echo "configure:7205: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_path_LIBART_CONFIG'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -7200,7 +7237,7 @@ fi
fi
min_libart_version=2.1.0
echo $ac_n "checking for LIBART - version >= $min_libart_version""... $ac_c" 1>&6
-echo "configure:7204: checking for LIBART - version >= $min_libart_version" >&5
+echo "configure:7241: checking for LIBART - version >= $min_libart_version" >&5
no_libart=""
if test "$LIBART_CONFIG" = "no" ; then
no_libart=yes
@@ -7224,7 +7261,7 @@ echo "configure:7204: checking for LIBART - version >= $min_libart_version" >&5
echo $ac_n "cross compiling; assumed OK... $ac_c"
else
cat > conftest.$ac_ext <<EOF
-#line 7228 "configure"
+#line 7265 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7282,7 +7319,7 @@ int main ()
EOF
-if { (eval echo configure:7286: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:7323: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7316,7 +7353,7 @@ fi
CFLAGS="$CFLAGS $LIBART_CFLAGS"
LIBS="$LIBS $LIBART_LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7320 "configure"
+#line 7357 "configure"
#include "confdefs.h"
#include <stdio.h>
@@ -7326,7 +7363,7 @@ int main() {
return 0;
; return 0; }
EOF
-if { (eval echo configure:7330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7367: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
rm -rf conftest*
echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding LIBART or finding the wrong"
@@ -7365,7 +7402,7 @@ rm -f conftest*
# requires -ldl.
if test "$GC" = boehm; then
echo $ac_n "checking for main in -ldl""... $ac_c" 1>&6
-echo "configure:7369: checking for main in -ldl" >&5
+echo "configure:7406: 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
@@ -7373,14 +7410,14 @@ else
ac_save_LIBS="$LIBS"
LIBS="-ldl $LIBS"
cat > conftest.$ac_ext <<EOF
-#line 7377 "configure"
+#line 7414 "configure"
#include "confdefs.h"
int main() {
main()
; return 0; }
EOF
-if { (eval echo configure:7384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:7421: \"$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
@@ -7501,7 +7538,7 @@ fi
# 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:7505: checking for $ac_word" >&5
+echo "configure:7542: 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
@@ -7533,7 +7570,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:7537: checking for $ac_word" >&5
+echo "configure:7574: 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
@@ -7595,13 +7632,13 @@ exec 5>>./config.log
CPPFLAGS=$GCJ_SAVE_CPPFLAGS
echo $ac_n "checking size of void *""... $ac_c" 1>&6
-echo "configure:7599: checking size of void *" >&5
+echo "configure:7636: 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
for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence.
cat > conftest.$ac_ext <<EOF
-#line 7605 "configure"
+#line 7642 "configure"
#include "confdefs.h"
#include "confdefs.h"
#include <sys/types.h>
@@ -7611,7 +7648,7 @@ int main() {
switch (0) case 0: case (sizeof (void *) == $ac_size):;
; return 0; }
EOF
-if { (eval echo configure:7615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7652: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_sizeof_void_p=$ac_size
else
@@ -7724,17 +7761,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:7728: checking for $ac_hdr" >&5
+echo "configure:7765: 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 7733 "configure"
+#line 7770 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7738: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7775: \"$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*
@@ -7764,17 +7801,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:7768: checking for $ac_hdr" >&5
+echo "configure:7805: 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 7773 "configure"
+#line 7810 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7778: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7815: \"$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*
@@ -7804,17 +7841,17 @@ for ac_hdr in inttypes.h
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:7808: checking for $ac_hdr" >&5
+echo "configure:7845: 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 7813 "configure"
+#line 7850 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7855: \"$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*
@@ -7850,12 +7887,12 @@ fi
done
echo $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6
-echo "configure:7854: checking for sys/wait.h that is POSIX.1 compatible" >&5
+echo "configure:7891: 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 7859 "configure"
+#line 7896 "configure"
#include "confdefs.h"
#include <sys/types.h>
#include <sys/wait.h>
@@ -7871,7 +7908,7 @@ wait (&s);
s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
; return 0; }
EOF
-if { (eval echo configure:7875: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:7912: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
ac_cv_header_sys_wait_h=yes
else
@@ -7893,12 +7930,12 @@ fi
echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:7897: checking for ANSI C header files" >&5
+echo "configure:7934: 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 7902 "configure"
+#line 7939 "configure"
#include "confdefs.h"
#include <stdlib.h>
#include <stdarg.h>
@@ -7906,7 +7943,7 @@ else
#include <float.h>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:7910: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:7947: \"$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*
@@ -7923,7 +7960,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 7927 "configure"
+#line 7964 "configure"
#include "confdefs.h"
#include <string.h>
EOF
@@ -7941,7 +7978,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 7945 "configure"
+#line 7982 "configure"
#include "confdefs.h"
#include <stdlib.h>
EOF
@@ -7962,7 +7999,7 @@ if test "$cross_compiling" = yes; then
:
else
cat > conftest.$ac_ext <<EOF
-#line 7966 "configure"
+#line 8003 "configure"
#include "confdefs.h"
#include <ctype.h>
#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
@@ -7973,7 +8010,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
exit (0); }
EOF
-if { (eval echo configure:7977: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8014: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
:
else
@@ -7997,12 +8034,12 @@ EOF
fi
echo $ac_n "checking for ssize_t""... $ac_c" 1>&6
-echo "configure:8001: checking for ssize_t" >&5
+echo "configure:8038: 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 8006 "configure"
+#line 8043 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -8031,9 +8068,9 @@ fi
echo $ac_n "checking for in_addr_t""... $ac_c" 1>&6
-echo "configure:8035: checking for in_addr_t" >&5
+echo "configure:8072: checking for in_addr_t" >&5
cat > conftest.$ac_ext <<EOF
-#line 8037 "configure"
+#line 8074 "configure"
#include "confdefs.h"
#include <sys/types.h>
#if STDC_HEADERS
@@ -8047,7 +8084,7 @@ int main() {
in_addr_t foo;
; return 0; }
EOF
-if { (eval echo configure:8051: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8088: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_IN_ADDR_T 1
@@ -8063,16 +8100,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ip_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:8067: checking whether struct ip_mreq is in netinet/in.h" >&5
+echo "configure:8104: checking whether struct ip_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8069 "configure"
+#line 8106 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ip_mreq mreq;
; return 0; }
EOF
-if { (eval echo configure:8076: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8113: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IP_MREQ 1
@@ -8088,16 +8125,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct ipv6_mreq is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:8092: checking whether struct ipv6_mreq is in netinet/in.h" >&5
+echo "configure:8129: checking whether struct ipv6_mreq is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8094 "configure"
+#line 8131 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct ipv6_mreq mreq6;
; return 0; }
EOF
-if { (eval echo configure:8101: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8138: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_STRUCT_IPV6_MREQ 1
@@ -8113,16 +8150,16 @@ fi
rm -f conftest*
echo $ac_n "checking whether struct sockaddr_in6 is in netinet/in.h""... $ac_c" 1>&6
-echo "configure:8117: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
+echo "configure:8154: checking whether struct sockaddr_in6 is in netinet/in.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8119 "configure"
+#line 8156 "configure"
#include "confdefs.h"
#include <netinet/in.h>
int main() {
struct sockaddr_in6 addr6;
; return 0; }
EOF
-if { (eval echo configure:8126: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8163: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_INET6 1
@@ -8138,9 +8175,9 @@ fi
rm -f conftest*
echo $ac_n "checking for socklen_t in sys/socket.h""... $ac_c" 1>&6
-echo "configure:8142: checking for socklen_t in sys/socket.h" >&5
+echo "configure:8179: checking for socklen_t in sys/socket.h" >&5
cat > conftest.$ac_ext <<EOF
-#line 8144 "configure"
+#line 8181 "configure"
#include "confdefs.h"
#define _POSIX_PII_SOCKET
#include <sys/types.h>
@@ -8149,7 +8186,7 @@ int main() {
socklen_t x = 5;
; return 0; }
EOF
-if { (eval echo configure:8153: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8190: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_SOCKLEN_T 1
@@ -8165,16 +8202,16 @@ fi
rm -f conftest*
echo $ac_n "checking for tm_gmtoff in struct tm""... $ac_c" 1>&6
-echo "configure:8169: checking for tm_gmtoff in struct tm" >&5
+echo "configure:8206: checking for tm_gmtoff in struct tm" >&5
cat > conftest.$ac_ext <<EOF
-#line 8171 "configure"
+#line 8208 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
struct tm tim; tim.tm_gmtoff = 0;
; return 0; }
EOF
-if { (eval echo configure:8178: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8215: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define STRUCT_TM_HAS_GMTOFF 1
@@ -8187,16 +8224,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:8191: checking for global timezone variable" >&5
+echo "configure:8228: checking for global timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8193 "configure"
+#line 8230 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
void i(){long z2 = 2*timezone;}
; return 0; }
EOF
-if { (eval echo configure:8200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8237: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_TIMEZONE 1
@@ -8209,16 +8246,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:8213: checking for global _timezone variable" >&5
+echo "configure:8250: checking for global _timezone variable" >&5
cat > conftest.$ac_ext <<EOF
-#line 8215 "configure"
+#line 8252 "configure"
#include "confdefs.h"
#include <time.h>
int main() {
long z2 = _timezone;
; return 0; }
EOF
-if { (eval echo configure:8222: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:8259: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
cat >> confdefs.h <<\EOF
#define HAVE_UNDERSCORE_TIMEZONE 1
@@ -8240,19 +8277,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:8244: checking for working alloca.h" >&5
+echo "configure:8281: 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 8249 "configure"
+#line 8286 "configure"
#include "confdefs.h"
#include <alloca.h>
int main() {
char *p = alloca(2 * sizeof(int));
; return 0; }
EOF
-if { (eval echo configure:8256: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8293: \"$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
@@ -8273,12 +8310,12 @@ EOF
fi
echo $ac_n "checking for alloca""... $ac_c" 1>&6
-echo "configure:8277: checking for alloca" >&5
+echo "configure:8314: 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 8282 "configure"
+#line 8319 "configure"
#include "confdefs.h"
#ifdef __GNUC__
@@ -8306,7 +8343,7 @@ int main() {
char *p = (char *) alloca(1);
; return 0; }
EOF
-if { (eval echo configure:8310: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8347: \"$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
@@ -8338,12 +8375,12 @@ EOF
echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6
-echo "configure:8342: checking whether alloca needs Cray hooks" >&5
+echo "configure:8379: 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 8347 "configure"
+#line 8384 "configure"
#include "confdefs.h"
#if defined(CRAY) && ! defined(CRAY2)
webecray
@@ -8368,12 +8405,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:8372: checking for $ac_func" >&5
+echo "configure:8409: 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 8377 "configure"
+#line 8414 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8396,7 +8433,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8400: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8437: \"$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
@@ -8423,7 +8460,7 @@ done
fi
echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6
-echo "configure:8427: checking stack direction for C alloca" >&5
+echo "configure:8464: 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
@@ -8431,7 +8468,7 @@ else
ac_cv_c_stack_direction=0
else
cat > conftest.$ac_ext <<EOF
-#line 8435 "configure"
+#line 8472 "configure"
#include "confdefs.h"
find_stack_direction ()
{
@@ -8450,7 +8487,7 @@ main ()
exit (find_stack_direction() < 0);
}
EOF
-if { (eval echo configure:8454: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8491: \"$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
@@ -8475,17 +8512,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:8479: checking for $ac_hdr" >&5
+echo "configure:8516: 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 8484 "configure"
+#line 8521 "configure"
#include "confdefs.h"
#include <$ac_hdr>
EOF
ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:8489: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:8526: \"$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*
@@ -8514,12 +8551,12 @@ done
for ac_func in getpagesize
do
echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:8518: checking for $ac_func" >&5
+echo "configure:8555: 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 8523 "configure"
+#line 8560 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func(); below. */
@@ -8542,7 +8579,7 @@ $ac_func();
; return 0; }
EOF
-if { (eval echo configure:8546: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:8583: \"$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
@@ -8567,7 +8604,7 @@ fi
done
echo $ac_n "checking for working mmap""... $ac_c" 1>&6
-echo "configure:8571: checking for working mmap" >&5
+echo "configure:8608: 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
@@ -8575,7 +8612,7 @@ else
ac_cv_func_mmap_fixed_mapped=no
else
cat > conftest.$ac_ext <<EOF
-#line 8579 "configure"
+#line 8616 "configure"
#include "confdefs.h"
/* Thanks to Mike Haertel and Jim Avera for this test.
@@ -8715,7 +8752,7 @@ main()
}
EOF
-if { (eval echo configure:8719: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:8756: \"$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
@@ -8743,7 +8780,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:8747: checking for $ac_word" >&5
+echo "configure:8784: 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
@@ -9327,8 +9364,8 @@ fi; done
EOF
cat >> $CONFIG_STATUS <<EOF
-ac_sources="include/$PLATFORMH java/io/natFile${FILE-${PLATFORM}}.cc java/io/natFileDescriptor${FILE-${PLATFORM}}.cc java/lang/${PLATFORM}Process.java java/lang/nat${PLATFORM}Process.cc java/net/natInetAddress${PLATFORMNET}.cc java/net/natNetworkInterface${PLATFORMNET}.cc gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc include/$GCHDR include/$THREADH sysdep/$sysdeps_dir/locks.h $SIGNAL_HANDLER"
-ac_dests="include/platform.h java/io/natFile.cc java/io/natFileDescriptor.cc java/lang/ConcreteProcess.java java/lang/natConcreteProcess.cc java/net/natInetAddress.cc java/net/natNetworkInterface.cc gnu/java/net/natPlainSocketImpl.cc gnu/java/net/natPlainDatagramSocketImpl.cc include/java-gc.h include/java-threads.h sysdep/locks.h include/java-signal.h"
+ac_sources="include/$PLATFORMH java/io/natFile${FILE-${PLATFORM}}.cc java/io/natFileDescriptor${FILE-${PLATFORM}}.cc java/lang/${PLATFORM}Process.java java/lang/nat${PLATFORM}Process.cc java/net/natInetAddress${PLATFORMNET}.cc java/net/natNetworkInterface${PLATFORMNET}.cc gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc gnu/java/nio/natPipeImpl${PLATFORM}.cc gnu/java/nio/natSelectorImpl${PLATFORM}.cc include/$GCHDR include/$THREADH sysdep/$sysdeps_dir/locks.h $SIGNAL_HANDLER"
+ac_dests="include/platform.h java/io/natFile.cc java/io/natFileDescriptor.cc java/lang/ConcreteProcess.java java/lang/natConcreteProcess.cc java/net/natInetAddress.cc java/net/natNetworkInterface.cc gnu/java/net/natPlainSocketImpl.cc gnu/java/net/natPlainDatagramSocketImpl.cc gnu/java/nio/natPipeImpl.cc gnu/java/nio/natSelectorImpl.cc include/java-gc.h include/java-threads.h sysdep/locks.h include/java-signal.h"
EOF
cat >> $CONFIG_STATUS <<\EOF
diff --git a/libjava/configure.in b/libjava/configure.in
index ad14a9190b5..9dad92c8e10 100644
--- a/libjava/configure.in
+++ b/libjava/configure.in
@@ -97,6 +97,26 @@ AC_ARG_ENABLE(libgcj-multifile,
esac],[enable_libgcj_multifile=no])
AM_CONDITIONAL(ONESTEP, test "$enable_libgcj_multifile" = yes)
+# What is the native OS API for MinGW?
+AC_ARG_WITH(win32-nlsapi,
+changequote(<<,>>)dnl
+<< --with-win32-nlsapi=ansi, unicows or unicode
+ native MinGW libgcj Win32 OS API [ansi]>>,
+changequote([,])
+[case "${withval}" in
+ ansi) with_win32_nlsapi=ansi ;;
+ unicows) with_win32_nlsapi=unicows ;;
+ unicode) with_win32_nlsapi=unicode ;;
+ *) AC_MSG_ERROR(Bad value ${withval} for --with-win32-nlsapi.) ;;
+esac],[with_win32_nlsapi=ansi])
+
+case "${with_win32_nlsapi}" in
+ unicows | unicode)
+ AC_DEFINE(MINGW_LIBGCJ_UNICODE, 1,
+ [Define if MinGW libgcj uses the Windows UNICODE OS API.])
+ ;;
+esac
+
dnl configure.host sets slow_pthread_self if the synchronization code should
dnl try to avoid pthread_self calls by caching thread IDs in a hashtable.
if test "${slow_pthread_self}" = "yes"; then
@@ -299,15 +319,23 @@ test -d java/net || mkdir java/net
AC_LINK_FILES(java/net/natInetAddress${PLATFORMNET}.cc, java/net/natInetAddress.cc)
AC_LINK_FILES(java/net/natNetworkInterface${PLATFORMNET}.cc, java/net/natNetworkInterface.cc)
-dnl Likewise for natPlainSocketImpl.cc and natPlainDatagramSocketImpl.ca.c
+dnl Likewise for natPlainSocketImpl.cc and natPlainDatagramSocketImpl.cc.
test -d gnu/java || mkdir gnu/java
test -d gnu/java/net || mkdir gnu/java/net
AC_LINK_FILES(gnu/java/net/natPlainSocketImpl${PLATFORMNET}.cc, gnu/java/net/natPlainSocketImpl.cc)
AC_LINK_FILES(gnu/java/net/natPlainDatagramSocketImpl${PLATFORMNET}.cc, gnu/java/net/natPlainDatagramSocketImpl.cc)
+dnl Likewise for natPipeImpl.cc and natSelectorImpl.cc.
+test -d gnu/java/nio || mkdir gnu/java/nio
+AC_LINK_FILES(gnu/java/nio/natPipeImpl${PLATFORM}.cc, gnu/java/nio/natPipeImpl.cc)
+AC_LINK_FILES(gnu/java/nio/natSelectorImpl${PLATFORM}.cc, gnu/java/nio/natSelectorImpl.cc)
+
case "${host}" in
*mingw*)
SYSTEMSPEC="-lgdi32 -lwsock32 -lws2_32"
+ if test "${with_win32_nlsapi}" = "unicows"; then
+ SYSTEMSPEC="-lunicows $SYSTEMSPEC"
+ fi
;;
*)
SYSTEMSPEC=
@@ -835,8 +863,8 @@ else
# Test for Gtk stuff, if asked for.
if test "$use_gtk_awt" = yes; then
- AM_PATH_GTK_2_0(2.0.0,,exit 1)
- AM_PATH_GLIB_2_0(2.0.0,,exit 1,gthread)
+ AM_PATH_GTK_2_0(2.2.0,,exit 1)
+ AM_PATH_GLIB_2_0(2.2.0,,exit 1,gthread)
dnl XXX Fix me when libart.m4 has the compile test fixed!
enable_libarttest=no
AM_PATH_LIBART(2.1.0,,exit 1)
diff --git a/libjava/gcj/javaprims.h b/libjava/gcj/javaprims.h
index 4420f64ff72..60f99cfdeda 100644
--- a/libjava/gcj/javaprims.h
+++ b/libjava/gcj/javaprims.h
@@ -291,6 +291,7 @@ extern "Java"
class Collections$UnmodifiableSortedSet;
class Comparator;
class ConcurrentModificationException;
+ class Currency;
class Date;
class Dictionary;
class EmptyStackException;
diff --git a/libjava/gnu/awt/gtk/GtkButtonPeer.java b/libjava/gnu/awt/gtk/GtkButtonPeer.java
deleted file mode 100644
index 62ad4199da9..00000000000
--- a/libjava/gnu/awt/gtk/GtkButtonPeer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/* GtkButtonPeer.java -- Implements ButtonPeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.event.MouseEvent;
-import java.awt.event.KeyEvent;
-import java.awt.peer.*;
-
-public class GtkButtonPeer extends GtkComponentPeer
- implements ButtonPeer
-{
- protected native void create ();
- public native void setLabel (String label);
-
- public GtkButtonPeer (Button b)
- {
- super (b);
- }
-
- public void handleEvent (AWTEvent e)
- {
-// if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled ()
-// && !modalHasGrab ())
-// {
-// MouseEvent me = (MouseEvent) e;
-// if (!me.isConsumed ()
-// && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0)
-// postActionEvent (((Button)awtComponent).getActionCommand (),
-// me.getModifiers ());
-// }
-
-// if (e.getID () == KeyEvent.KEY_PRESSED)
-// {
-// KeyEvent ke = (KeyEvent) e;
-// if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_SPACE)
-// postActionEvent (((Button)awtComponent).getActionCommand (),
-// ke.getModifiers ());
-// }
-
- super.handleEvent (e);
- }
-}
diff --git a/libjava/gnu/awt/gtk/GtkComponentPeer.java b/libjava/gnu/awt/gtk/GtkComponentPeer.java
deleted file mode 100644
index 82d2714c81e..00000000000
--- a/libjava/gnu/awt/gtk/GtkComponentPeer.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/* GtkComponentPeer.java -- Implements ComponentPeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.image.*;
-import java.awt.peer.ComponentPeer;
-
-public abstract class GtkComponentPeer implements ComponentPeer
-{
- // We need to put a reference to the Event Queue somewhere. This seems like
- // a convenient place.
- static EventQueue eventQueue = new EventQueue();
-
- Component awtComponent;
- gnu.gcj.RawData ptr; // Actual gtk object.
-
- static
- {
- // This will start the main toolkit thread.
- GtkToolkit.instance.init();
- }
-
- public int checkImage (Image image, int width, int height,
- ImageObserver observer)
- {
- return -1;
- /*
- GtkImage i = (GtkImage) image;
- return i.checkImage ();
- */
- }
-
- public Image createImage (ImageProducer producer)
- {
- return null;
- //return new GtkImage (producer, null);
- }
-
- public Image createImage (int width, int height)
- {
- return null;
- /*
- GdkGraphics g = new GdkGraphics (width, height);
- return new GtkOffScreenImage (null, g, width, height);
- */
- }
-
- public void disable ()
- {
- setEnabled (false);
- }
-
- native public void dispose ();
-
- public void enable ()
- {
- setEnabled (true);
- }
-
- /**
- * Get the graphics configuration of the component. The color model
- * of the component can be derived from the configuration.
- */
- public GraphicsConfiguration getGraphicsConfiguration ()
- {
- return null;
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
- return null;
- //return new GdkFontMetrics (font);
- }
-
- public Graphics getGraphics ()
- {
- throw new InternalError ();
- }
-
- public native Point getLocationOnScreen ();
- public native Dimension getMinimumSize();
- public native Dimension getPreferredSize();
-
- public Toolkit getToolkit ()
- {
- return GtkToolkit.instance;
- }
-
- public void handleEvent(AWTEvent e)
- {
- }
-
- public void hide ()
- {
- setVisible (false);
- }
-
- public void show ()
- {
- setVisible (true);
- }
-
- public boolean isFocusTraversable ()
- {
- return true;
- }
-
- public Dimension minimumSize ()
- {
- return getMinimumSize();
- }
-
- public Dimension preferredSize()
- {
- return getPreferredSize();
- }
-
- public void paint (Graphics g)
- {
- awtComponent.paint (g); // ???
- }
-
- public boolean prepareImage (Image image, int width, int height,
- ImageObserver observer)
- {
- /*
- GtkImage i = (GtkImage) image;
-
- if (i.isLoaded ()) return true;
-
- class PrepareImage extends Thread
- {
- GtkImage image;
- ImageObserver observer;
-
- PrepareImage (GtkImage image, ImageObserver observer)
- {
- this.image = image;
- this.observer = observer;
- }
-
- public void run ()
- {
- // XXX: need to return data to image observer
- image.source.startProduction (null);
- }
- }
-
- new PrepareImage (i, observer).start ();
- */
- return false;
- }
-
- public void print (Graphics g)
- {
- throw new RuntimeException ();
- }
-
- native public void requestFocus ();
-
- public void repaint (long tm, int x, int y, int width, int height)
- {
- // ???
- eventQueue.postEvent (new PaintEvent (
- awtComponent, PaintEvent.UPDATE, new Rectangle (x, y, width, height)));
- }
-
-
- public void reshape (int x, int y, int width, int height)
- {
- setBounds (x, y, width, height);
- }
-
- public native void setBounds (int x, int y, int width, int height);
- public native void setCursor (Cursor cursor);
-
- public native void setEnabled (boolean b);
-
- public native void setEventMask(long eventMask);
- public native void setFont(Font font);
- public native void setForeground(Color color);
- public native void setBackground (Color c);
- public native void setVisible(boolean visible);
-
- native void realize();
-
- protected GtkComponentPeer (Component awtComponent)
- {
- this.awtComponent = awtComponent;
- create();
-
- // TODO: Each of these calls will currently perform a separate native lock.
- // It may be desirable to use our own, recusive mutex implementation by
- // passing our threads implementation to g_threads_init().
- // This would greatly reduce locking calls in the peer code, and allow us
- // to aquire the lock from java code.
- Rectangle r = awtComponent.getBounds();
- setBounds (r.x, r.y, r.width, r.height);
-
- Color c = awtComponent.getForeground();
- if (c != null)
- setForeground (c);
- c = awtComponent.getBackground();
- if (c != null)
- setBackground (c);
- setEnabled (awtComponent.isEnabled());
- Font f = awtComponent.getFont();
- if (f != null)
- setFont (awtComponent.getFont());
-
- realize();
- }
-
- protected native void create ();
-
- // FIXME: It may make sense to do the following directly from the native
- // code.
- protected void postMouseEvent(int id, long when, int mods, int x, int y,
- int clickCount, boolean popupTrigger)
- {
- eventQueue.postEvent(new MouseEvent(awtComponent, id, when, mods, x, y,
- clickCount, popupTrigger));
- }
-
- protected void postExposeEvent (int x, int y, int width, int height)
- {
- eventQueue.postEvent (new PaintEvent (awtComponent, PaintEvent.PAINT,
- new Rectangle (x, y, width, height)));
- }
-
- protected void postKeyEvent (int id, long when, int mods,
- int keyCode, char keyChar)
- {
- eventQueue.postEvent (new KeyEvent (awtComponent, id, when, mods,
- keyCode, keyChar));
- }
-
- protected void postFocusEvent (int id, boolean temporary)
- {
- eventQueue.postEvent (new FocusEvent (awtComponent, id, temporary));
- }
-
- protected void postItemEvent (Object item, int stateChange)
- {
- eventQueue.postEvent (new ItemEvent ((ItemSelectable)awtComponent,
- ItemEvent.ITEM_STATE_CHANGED,
- item, stateChange));
- }
-}
diff --git a/libjava/gnu/awt/gtk/GtkContainerPeer.java b/libjava/gnu/awt/gtk/GtkContainerPeer.java
deleted file mode 100644
index 18f4f6b75ea..00000000000
--- a/libjava/gnu/awt/gtk/GtkContainerPeer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* GtkContainerPeer.java -- Implements ContainerPeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.ContainerPeer;
-
-public abstract class GtkContainerPeer extends GtkComponentPeer
- implements ContainerPeer
-{
- // FIXME?
- static Insets insets = new Insets(0,0,0,0);
-
- protected GtkContainerPeer (Container awtContainer)
- {
- super (awtContainer);
- }
-
- public Insets getInsets()
- {
- // FIXME?
- return insets;
- }
-
- public void beginValidate()
- {
- // FIXME
- }
-
- public void endValidate()
- {
- // FIXME
- }
-
- protected native void create();
-}
diff --git a/libjava/gnu/awt/gtk/GtkFramePeer.java b/libjava/gnu/awt/gtk/GtkFramePeer.java
deleted file mode 100644
index e73a55bea7f..00000000000
--- a/libjava/gnu/awt/gtk/GtkFramePeer.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/* GtkFramePeer.java -- Implements FramePeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.FramePeer;
-
-public class GtkFramePeer extends GtkWindowPeer
- implements FramePeer
-{
- protected GtkFramePeer (Frame awtFrame)
- {
- super (awtFrame);
- //init ();
- }
-
- public native void setIconImage(Image image);
- public native void setMenuBar(MenuBar mb);
- public native void setResizable(boolean resizable);
- public native void setTitle(String title);
-
- protected native void create();
-}
diff --git a/libjava/gnu/awt/gtk/GtkLabelPeer.java b/libjava/gnu/awt/gtk/GtkLabelPeer.java
deleted file mode 100644
index 46743c61923..00000000000
--- a/libjava/gnu/awt/gtk/GtkLabelPeer.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* GtkLabelPeer.java -- Implements LabelPeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.peer.*;
-
-public class GtkLabelPeer extends GtkComponentPeer
- implements LabelPeer
-{
- public GtkLabelPeer (Label l)
- {
- super (l);
- }
-
- public native void setText (String text);
- public native void setAlignment (int alignment);
- protected native void create ();
-}
diff --git a/libjava/gnu/awt/gtk/GtkMainThread.java b/libjava/gnu/awt/gtk/GtkMainThread.java
deleted file mode 100644
index efe22153ed1..00000000000
--- a/libjava/gnu/awt/gtk/GtkMainThread.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/* GtkMainThread.java -- Runs gtk_main()
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-public class GtkMainThread extends Thread
-{
- native void gtkMain();
-
- public GtkMainThread()
- {
- super ("GtkMain");
- }
-
- public void run()
- {
- gtkMain();
- }
-}
diff --git a/libjava/gnu/awt/gtk/GtkToolkit.java b/libjava/gnu/awt/gtk/GtkToolkit.java
deleted file mode 100644
index 4173e5e9b40..00000000000
--- a/libjava/gnu/awt/gtk/GtkToolkit.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/* GtkToolkit.java -- Implements an AWT Toolkit using GTK for peers
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.net.*;
-import java.util.Hashtable;
-import java.util.Properties;
-import java.util.MissingResourceException;
-import java.awt.datatransfer.*;
-import java.awt.image.*;
-import java.awt.peer.*;
-
-public class GtkToolkit extends java.awt.Toolkit
-{
- static GtkMainThread gtkthread;
- static EventQueue evtqueue;
- static Hashtable containers = new Hashtable();
- static Clipboard systemClipboard;
- static GtkToolkit instance = null;
-
- public GtkToolkit ()
- {
- gtkInit();
- instance = this;
- //systemClipboard = new GtkClipboard ();
- }
-
- // Start the thread to run the GTK event loop. This is called from
- // a GtkComponentPeer static initializer.
- void init ()
- {
- gtkthread = new GtkMainThread ();
- gtkthread.start();
- }
-
- static native void gtkInit();
-
- native public void beep ();
-
- public int checkImage (Image image, int width, int height,
- ImageObserver observer)
- {
- return ImageObserver.ALLBITS;
-
-// GtkImage i = (GtkImage) image;
-// return i.checkImage ();
- }
-
- public Image createImage(String filename)
- {
- return null;
- }
-
- public Image createImage(URL url)
- {
- return null;
- }
-
- public Image createImage (ImageProducer producer)
- {
-// return new GtkImage (producer, null);
- return null;
- }
-
- public Image createImage (byte[] imagedata, int imageoffset,
- int imagelength)
- {
- System.out.println ("createImage byte[] NOT SUPPORTED");
- return null;
- }
-
- public ColorModel getColorModel ()
- {
- return ColorModel.getRGBdefault ();
- }
-
- public String[] getFontList ()
- {
- return (new String[] { "Dialog",
- "DialogInput",
- "Monospaced",
- "Serif",
- "SansSerif" });
- }
-
- public FontMetrics getFontMetrics (Font font)
- {
-// return new GdkFontMetrics (font);
- return null;
- }
-
- public Image getImage (String filename)
- {
-// return new GtkImage (new GdkPixbufDecoder (filename), null);
- return null;
- }
-
- public Image getImage (URL url)
- {
-// return new GtkImage (new GdkPixbufDecoder (url), null);
- return null;
- }
-
- /*
- public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props)
- {
- return null;
- }
- */
- native public int getScreenResolution();
-
- native public Dimension getScreenSize ();
-
- public Clipboard getSystemClipboard()
- {
- return systemClipboard;
- }
-
- public boolean prepareImage (Image image, int width, int height,
- ImageObserver observer)
- {
- return false;
- }
-
- native public void sync ();
-
- protected void setComponentState (Component c, GtkComponentPeer cp)
- {
- /* Make the Peer reflect the state of the Component */
- if (! (c instanceof Window))
- {
- cp.setCursor (c.getCursor ());
-
- Rectangle bounds = c.getBounds ();
- cp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height);
- if (c instanceof Canvas)
- System.out.println ("width " + bounds.width + " height " + bounds.height);
-
- cp.setVisible (c.isVisible ());
- }
- }
-
- protected ButtonPeer createButton (Button b)
- {
- return null;
- /*
- GtkButtonPeer bp = new GtkButtonPeer (b);
- Rectangle bounds = b.getBounds ();
- bp.setBounds (bounds.x, bounds.y, bounds.width, bounds.height);
- return bp;
- */
- }
-
- protected CanvasPeer createCanvas (Canvas c)
- {
-// return new GtkCanvasPeer (c);
- return null;
- }
-
- protected CheckboxPeer createCheckbox (Checkbox cb)
- {
- return null;
- /*
- if (cb.getCheckboxGroup () != null)
- return new GtkRadioButtonPeer (cb);
- else
- return new GtkCheckButtonPeer (cb);
- */
- }
-
- protected CheckboxMenuItemPeer createCheckboxMenuItem (CheckboxMenuItem cmi)
- {
- return null;
- //return new GtkCheckboxMenuItemPeer (cmi);
- }
-
- protected ChoicePeer createChoice (Choice c)
- {
- return null;
- //return new GtkChoicePeer (c);
- }
-
- protected DialogPeer createDialog (Dialog d)
- {
- return null;
- //return new GtkDialogPeer (d);
- }
-
- protected FileDialogPeer createFileDialog (FileDialog fd)
- {
- return null;
- //return new GtkFileDialogPeer (fd);
- }
-
- protected FramePeer createFrame (Frame f)
- {
- return new GtkFramePeer (f);
- }
-
- protected LabelPeer createLabel (Label label)
- {
- return null;
- //return new GtkLabelPeer (label);
- }
-
- protected ListPeer createList (List list)
- {
- return null;
- //return new GtkListPeer (list);
- }
-
- protected MenuPeer createMenu (Menu m)
- {
- return null;
- //return new GtkMenuPeer (m);
- }
-
- protected MenuBarPeer createMenuBar (MenuBar mb)
- {
- return null;
- //return new GtkMenuBarPeer (mb);
- }
-
- protected MenuItemPeer createMenuItem (MenuItem mi)
- {
- return null;
- //return new GtkMenuItemPeer (mi);
- }
-
- protected PanelPeer createPanel (Panel p)
- {
- return null;
- //return new GtkPanelPeer (p);
- }
-
- protected PopupMenuPeer createPopupMenu (PopupMenu target)
- {
- return null;
- //return new GtkPopupMenuPeer (target);
- }
-
- protected ScrollPanePeer createScrollPane (ScrollPane sp)
- {
- return null;
- //return new GtkScrollPanePeer (sp);
- }
-
- protected ScrollbarPeer createScrollbar (Scrollbar sb)
- {
- return null;
- //return new GtkScrollbarPeer (sb);
- }
-
- protected TextAreaPeer createTextArea (TextArea ta)
- {
- return null;
- //return new GtkTextAreaPeer (ta);
- }
-
- protected TextFieldPeer createTextField (TextField tf)
- {
- return null;
- //return new GtkTextFieldPeer (tf);
- }
-
- protected WindowPeer createWindow (Window w)
- {
- return new GtkWindowPeer (w);
- }
-
- protected FontPeer getFontPeer (String name, int style)
- {
- return null;
- /*
- try
- {
- GtkFontPeer fp = new GtkFontPeer (name, style);
- return fp;
- }
- catch (MissingResourceException ex)
- {
- return null;
- }
- */
- }
-
- protected EventQueue getSystemEventQueueImpl()
- {
- return GtkComponentPeer.eventQueue;
- }
-
- protected void loadSystemColors (int[] systemColors)
- {
- }
-}
diff --git a/libjava/gnu/awt/gtk/GtkWindowPeer.java b/libjava/gnu/awt/gtk/GtkWindowPeer.java
deleted file mode 100644
index a2428362d1d..00000000000
--- a/libjava/gnu/awt/gtk/GtkWindowPeer.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* GtkWindowPeer.java -- Implements WindowPeer with GTK
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
-
-This file is part of the peer AWT libraries of GNU Classpath.
-
-This 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.
-
-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 Library General Public License for more details.
-
-You should have received a copy of the GNU Library General Public License
-along with this library; if not, write to the Free Software Foundation
-Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307 USA. */
-
-
-package gnu.awt.gtk;
-
-import java.awt.*;
-import java.awt.event.*;
-import java.awt.peer.WindowPeer;
-
-public class GtkWindowPeer extends GtkContainerPeer
- implements WindowPeer
-{
- protected GtkWindowPeer (Window awtWindow)
- {
- super (awtWindow);
- }
-
- public native void toBack();
- public native void toFront();
-
- protected native void create();
-}
diff --git a/libjava/gnu/awt/gtk/gtkcommon.cc b/libjava/gnu/awt/gtk/gtkcommon.cc
deleted file mode 100644
index 6a12130da89..00000000000
--- a/libjava/gnu/awt/gtk/gtkcommon.cc
+++ /dev/null
@@ -1,14 +0,0 @@
-// -*- c++ -*-
-// gtkutils.cc - Common functions for the gtk AWT peers.
-
-/* 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. */
-
-#include <gtk/gtk.h>
-
-#include "gtkcommon.h"
diff --git a/libjava/gnu/awt/gtk/gtkcommon.h b/libjava/gnu/awt/gtk/gtkcommon.h
deleted file mode 100644
index 207d2cf1f0e..00000000000
--- a/libjava/gnu/awt/gtk/gtkcommon.h
+++ /dev/null
@@ -1,85 +0,0 @@
-// -*- c++ -*-
-// gtkutils.h - Common defines and inline functions for the gtk AWT peers.
-
-/* 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 __GTKCOMMON_H__
-#define __GTKCOMMON_H__
-
-#include <gtk/gtk.h>
-#include <gdk/gdkx.h>
-
-#include <java/awt/Color.h>
-
-class _Jv_GdkThreadLock
-{
-public:
- _Jv_GdkThreadLock ()
- {
- GDK_THREADS_ENTER ();
- }
-
- ~_Jv_GdkThreadLock ()
- {
- GDK_THREADS_LEAVE ();
- }
-};
-
-// Convert AWT Color to gdk color value.
-static inline void
-_Jv_ConvertAwtColor(java::awt::Color* awtcolor, GdkColor* gdkcolor)
-{
- jint rgb = awtcolor->getRGB();
- gushort r = (rgb >> 16) & 0xFF;
- gushort g = (rgb >> 8) & 0xFF;
- gushort b = rgb & 0xFF;
-
- gdkcolor->red = (r << 8) + r;
- gdkcolor->green = (g << 8) + g;
- gdkcolor->blue = (b << 8) + b;
-
- // FIXME: Deal with colormap? gdk_color_alloc()?
-}
-
-// Convert gdk color value to AWT Color.
-static inline java::awt::Color*
-_Jv_ConvertGtkColor (GdkColor* gdkcolor)
-{
- jint r = gdkcolor->red >> 8;
- jint g = gdkcolor->green >> 8;
- jint b = gdkcolor->blue >> 8;
-
- java::awt::Color *c = new java::awt::Color(r,g,b);
-
- return c;
-}
-
-static inline void
-_Jv_GdkScaleColor (GdkColor* oldc, GdkColor* newc, gfloat scale)
-{
- // FIXME: Need to deal with overflows or find a better way
- *newc = *oldc;
- newc->red += (gushort) (newc->red * scale);
- newc->green += (gushort) (newc->green * scale);
- newc->blue += (gushort) (newc->blue * scale);
-}
-
-// Normally the X queue gets flushed automatically when gtk's event loop goes
-// idle. However, some calls do not cause any activitity on the event loop,
-// so we need to occasionally flush pending requests manually because we arn't
-// running from the gtk_main thread. Note that gdk_flush calls XSync(), which
-// is more than what is needed here.
-static inline void
-_Jv_FlushRequests ()
-{
- // FIXME: What about platforms that arn't X?
- XFlush (GDK_DISPLAY ());
-}
-
-#endif /* __GTKUTILS_H__ */
diff --git a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc b/libjava/gnu/awt/gtk/natGtkButtonPeer.cc
deleted file mode 100644
index 1608616f25e..00000000000
--- a/libjava/gnu/awt/gtk/natGtkButtonPeer.cc
+++ /dev/null
@@ -1,52 +0,0 @@
-// Native Gtk AWT button code
-
-#include <config.h>
-
-#include <gcj/cni.h>
-
-#include "gtkcommon.h"
-#include <gnu/awt/gtk/GtkButtonPeer.h>
-#include <java/awt/Button.h>
-
-void
-gnu::awt::gtk::GtkButtonPeer::setLabel (java::lang::String *label)
-{
- _Jv_GdkThreadLock sync;
- jsize len = 0;
- if (label)
- len = JvGetStringUTFLength (label);
- char buf[len + 1];
- // FIXME: this can allocate an unbounded amount. Should use heap
- // even though it is slower.
- if (label)
- JvGetStringUTFRegion (label, 0, len, buf);
- buf[len] = '\0';
- // The button child is a label.
- GtkBin *bin = GTK_BIN (ptr);
- gtk_label_set_text (GTK_LABEL (bin->child), buf);
-}
-
-void
-gnu::awt::gtk::GtkButtonPeer::create ()
-{
- if (! ptr)
- {
- _Jv_GdkThreadLock sync;
- // This is a little inefficient.
- ptr = (gnu::gcj::RawData *) gtk_button_new_with_label ("");
-
- using namespace ::java::awt;
- Button *button = reinterpret_cast<Button *> (awtComponent);
- setLabel (button->getLabel ());
- }
-
- gnu::awt::gtk::GtkComponentPeer::create ();
-}
-
-// void
-// gnu::awt::gtk::GtkButtonPeer::clicked (::gnu::gcj::RawData *button_wrap,
-// ::gnu::gcj::RawData *peer_wrap)
-// {
-// GtkButtonPeer *button = reinterpret_cast<GtkButtonPeer *> (peer_wrap);
-
-// }
diff --git a/libjava/gnu/awt/gtk/natGtkComponentPeer.cc b/libjava/gnu/awt/gtk/natGtkComponentPeer.cc
deleted file mode 100644
index d7b6c66e6f6..00000000000
--- a/libjava/gnu/awt/gtk/natGtkComponentPeer.cc
+++ /dev/null
@@ -1,265 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <config.h>
-
-#include <gcj/cni.h>
-
-#include <java/awt/Point.h>
-#include <java/awt/Dimension.h>
-#include <java/awt/Cursor.h>
-
-#include "gtkcommon.h"
-
-#include <gnu/awt/gtk/GtkComponentPeer.h>
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::dispose ()
-{
- GDK_THREADS_ENTER ();
- gtk_widget_destroy (GTK_WIDGET (ptr));
- GDK_THREADS_LEAVE ();
-}
-
-
-::java::awt::Point *
-gnu::awt::gtk::GtkComponentPeer::getLocationOnScreen ()
-{
- gint x, y;
- _Jv_GdkThreadLock sync;
- gdk_window_get_root_origin (GTK_WIDGET (ptr)->window, &x, &y);
- return new ::java::awt::Point (x, y);
-}
-
-
-::java::awt::Dimension *
-gnu::awt::gtk::GtkComponentPeer::getMinimumSize ()
-{
- GtkRequisition req;
- ::java::awt::Dimension *dim = new ::java::awt::Dimension ();
-
- GDK_THREADS_ENTER ();
-
- gtk_widget_size_request (GTK_WIDGET (ptr), &req);
-
- GDK_THREADS_LEAVE ();
-
- dim->width = (jint) req.width;
- dim->height = (jint) req.height;
- return dim;
-}
-
-
-::java::awt::Dimension *
-gnu::awt::gtk::GtkComponentPeer::getPreferredSize ()
-{
- return getMinimumSize ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::requestFocus ()
-{
- GDK_THREADS_ENTER ();
-
- gtk_widget_grab_focus (GTK_WIDGET (ptr));
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setBounds (jint x, jint y,
- jint width, jint height)
-{
- GDK_THREADS_ENTER ();
-
- GtkWidget *widget = GTK_WIDGET (ptr);
- gtk_widget_set_usize (widget, width, height);
- //gtk_layout_move (GTK_LAYOUT (widget->parent), widget, x, y);
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setCursor (::java::awt::Cursor *cursor)
-{
- GdkCursorType type;
-
- switch (cursor->type)
- {
- case ::java::awt::Cursor::CROSSHAIR_CURSOR:
- type = GDK_CROSSHAIR;
- break;
- case ::java::awt::Cursor::TEXT_CURSOR:
- type = GDK_XTERM;
- break;
- case ::java::awt::Cursor::WAIT_CURSOR:
- type = GDK_WATCH;
- break;
- case ::java::awt::Cursor::SW_RESIZE_CURSOR:
- type = GDK_BOTTOM_LEFT_CORNER;
- break;
- case ::java::awt::Cursor::SE_RESIZE_CURSOR:
- type = GDK_BOTTOM_RIGHT_CORNER;
- break;
- case ::java::awt::Cursor::NW_RESIZE_CURSOR:
- type = GDK_TOP_LEFT_CORNER;
- break;
- case ::java::awt::Cursor::NE_RESIZE_CURSOR:
- type = GDK_TOP_RIGHT_CORNER;
- break;
- case ::java::awt::Cursor::N_RESIZE_CURSOR:
- type = GDK_TOP_SIDE;
- break;
- case ::java::awt::Cursor::S_RESIZE_CURSOR:
- type = GDK_RIGHT_SIDE;
- break;
- case ::java::awt::Cursor::W_RESIZE_CURSOR:
- type = GDK_LEFT_SIDE;
- break;
- case ::java::awt::Cursor::E_RESIZE_CURSOR:
- type = GDK_BOTTOM_SIDE;
- break;
- case ::java::awt::Cursor::HAND_CURSOR:
- type = GDK_HAND1;
- break;
- case ::java::awt::Cursor::MOVE_CURSOR:
- type = GDK_FLEUR;
- break;
- case ::java::awt::Cursor::CUSTOM_CURSOR:
- // FIXME: not implemented yet. We want a gtk-specific subclass
- // of Cursor which holds a new gdk cursor. For now, fall
- // through.
-
- case ::java::awt::Cursor::DEFAULT_CURSOR:
- default:
- type = GDK_LEFT_PTR;
- break;
- }
-
- _Jv_GdkThreadLock sync;
- GtkWidget *widget = GTK_WIDGET (ptr);
- GdkCursor *cursor = gdk_cursor_new (type);
- gdk_window_set_cursor (widget->window, cursor);
- gdk_cursor_destroy (cursor);
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setEnabled (jboolean enabled)
-{
- GDK_THREADS_ENTER ();
-
- gtk_widget_set_sensitive (GTK_WIDGET (ptr), enabled);
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setEventMask (jlong)
-{
- // TODO
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setFont (::java::awt::Font *)
-{
- // TODO
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setForeground (::java::awt::Color *color)
-{
- // FIXME: This doesn't work if component is already realized/visible
-
- GdkColor gcolor;
- _Jv_ConvertAwtColor(color, &gcolor);
-
- GDK_THREADS_ENTER ();
-
- GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (ptr));
-
- style->bg[GTK_STATE_NORMAL] = gcolor;
- style->bg[GTK_STATE_ACTIVE] = gcolor;
- style->bg[GTK_STATE_PRELIGHT] = gcolor;
- style->bg[GTK_STATE_SELECTED] = gcolor;
- style->bg[GTK_STATE_INSENSITIVE] = gcolor;
-
- gtk_widget_set_style (GTK_WIDGET (ptr), style);
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setBackground (::java::awt::Color *color)
-{
- // FIXME: This doesn't work if component is already realized/visible
-
- GdkColor gcolor;
- _Jv_ConvertAwtColor(color, &gcolor);
-
- GDK_THREADS_ENTER ();
-
- GtkStyle *style = gtk_widget_get_style (GTK_WIDGET (ptr));
-
- style->bg[GTK_STATE_NORMAL] = gcolor;
- style->bg[GTK_STATE_ACTIVE] = gcolor;
- style->bg[GTK_STATE_PRELIGHT] = gcolor;
- style->bg[GTK_STATE_SELECTED] = gcolor;
- style->bg[GTK_STATE_INSENSITIVE] = gcolor;
- // gtk allows us to set color values for different states of the
- // widget. AWT only provides a single background color, so scale it
- // to get some reasonable values.
-// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_ACTIVE], -0.1);
-// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_PRELIGHT], 0.2);
-// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_SELECTED], -0.2);
-// _Jv_GdkScaleColor (&gcolor, &style->bg[GTK_STATE_INSENSITIVE], -0.2);
-
- gtk_widget_set_style (GTK_WIDGET (ptr), style);
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::setVisible (jboolean visible)
-{
- GDK_THREADS_ENTER ();
-
- GtkWidget *widget = GTK_WIDGET (ptr);
-
- if (visible)
- gtk_widget_show (widget);
- else
- gtk_widget_hide (widget);
-
- _Jv_FlushRequests ();
-
- GDK_THREADS_LEAVE ();
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::create ()
-{
-}
-
-
-void
-gnu::awt::gtk::GtkComponentPeer::realize ()
-{
- GDK_THREADS_ENTER ();
- gtk_widget_realize (GTK_WIDGET (ptr));
- GDK_THREADS_LEAVE ();
-}
diff --git a/libjava/gnu/awt/gtk/natGtkContainerPeer.cc b/libjava/gnu/awt/gtk/natGtkContainerPeer.cc
deleted file mode 100644
index 0d5656d4f72..00000000000
--- a/libjava/gnu/awt/gtk/natGtkContainerPeer.cc
+++ /dev/null
@@ -1,15 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <gnu/awt/gtk/GtkContainerPeer.h>
-#include <gcj/cni.h>
-
-void
-gnu::awt::gtk::GtkContainerPeer::create ()
-{
- gnu::awt::gtk::GtkComponentPeer::create();
-}
diff --git a/libjava/gnu/awt/gtk/natGtkFramePeer.cc b/libjava/gnu/awt/gtk/natGtkFramePeer.cc
deleted file mode 100644
index b9b4d95a34e..00000000000
--- a/libjava/gnu/awt/gtk/natGtkFramePeer.cc
+++ /dev/null
@@ -1,51 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <gnu/awt/gtk/GtkFramePeer.h>
-#include <gcj/cni.h>
-
-#include <gtk/gtk.h>
-
-void
-gnu::awt::gtk::GtkFramePeer::setIconImage (::java::awt::Image *)
-{
- // TODO
-}
-
-
-void
-gnu::awt::gtk::GtkFramePeer::setMenuBar (::java::awt::MenuBar *)
-{
- // TODO
-}
-
-
-void
-gnu::awt::gtk::GtkFramePeer::setResizable (jboolean)
-{
- // TODO
-}
-
-
-void
-gnu::awt::gtk::GtkFramePeer::setTitle (::java::lang::String *)
-{
- // TODO
-}
-
-void
-gnu::awt::gtk::GtkFramePeer::create ()
-{
- if (ptr == NULL)
- {
- GDK_THREADS_ENTER ();
- ptr = (gnu::gcj::RawData *) gtk_window_new(GTK_WINDOW_TOPLEVEL);
- GDK_THREADS_LEAVE ();
- }
-
- gnu::awt::gtk::GtkContainerPeer::create();
-}
diff --git a/libjava/gnu/awt/gtk/natGtkLabelPeer.cc b/libjava/gnu/awt/gtk/natGtkLabelPeer.cc
deleted file mode 100644
index 95fc7f63d17..00000000000
--- a/libjava/gnu/awt/gtk/natGtkLabelPeer.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// Native Gtk AWT label code.
-
-#include <config.h>
-
-#include <gcj/cni.h>
-
-#include "gtkcommon.h"
-
-#include <gnu/awt/gtk/GtkLabelPeer.h>
-#include <java/awt/Label.h>
-
-void
-gnu::awt::gtk::GtkLabelPeer::setText (java::lang::String *text)
-{
- _Jv_GdkThreadLock sync;
- jsize len = 0;
- if (text)
- len = JvGetStringUTFLength (text);
- // FIXME: this can allocate an unbounded amount. Should use heap
- // even though it is slower.
- char buf[len + 1];
- if (text)
- JvGetStringUTFRegion (text, 0, len, buf);
- buf[len] = '\0';
- gtk_label_set_text (GTK_LABEL (ptr), buf);
-}
-
-void
-gnu::awt::gtk::GtkLabelPeer::setAlignment (jint alignment)
-{
- using namespace java::awt;
-
- gfloat value = 0.5;
- if (alignment == Label::LEFT)
- value = 0.0;
- else if (alignment == Label::RIGHT)
- value = 1.0;
-
- _Jv_GdkThreadLock sync;
- gtk_misc_set_alignment (GTK_MISC (ptr), 0.5f, value);
-}
-
-void
-gnu::awt::gtk::GtkLabelPeer::create ()
-{
- if (! ptr)
- {
- _Jv_GdkThreadLock sync;
- // This is a little inefficient.
- ptr = (gnu::gcj::RawData *) gtk_label_new ("");
-
- using namespace ::java::awt;
- Label *label = reinterpret_cast<Label *> (awtComponent);
- setText (label->getText ());
- setAlignment (label->getAlignment ());
- }
-
- gnu::awt::gtk::GtkComponentPeer::create ();
-}
diff --git a/libjava/gnu/awt/gtk/natGtkMainThread.cc b/libjava/gnu/awt/gtk/natGtkMainThread.cc
deleted file mode 100644
index 9cc492c31ed..00000000000
--- a/libjava/gnu/awt/gtk/natGtkMainThread.cc
+++ /dev/null
@@ -1,22 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <gnu/awt/gtk/GtkMainThread.h>
-#include <gcj/cni.h>
-
-#include <gtk/gtk.h>
-
-
-void
-gnu::awt::gtk::GtkMainThread::gtkMain ()
-{
- GDK_THREADS_ENTER ();
- gtk_main ();
- GDK_THREADS_LEAVE ();
-}
-
-
diff --git a/libjava/gnu/awt/gtk/natGtkToolkit.cc b/libjava/gnu/awt/gtk/natGtkToolkit.cc
deleted file mode 100644
index e7949395235..00000000000
--- a/libjava/gnu/awt/gtk/natGtkToolkit.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <java/awt/Dimension.h>
-
-#include <gnu/awt/gtk/GtkToolkit.h>
-#include <gcj/cni.h>
-
-#include <gtk/gtk.h>
-
-
-// GTK requires the program's argc and argv variables.
-extern char **_Jv_argv;
-extern int _Jv_argc;
-
-// Call gtk_init. It is very important that this happen before any other
-// gtk calls.
-void
-gnu::awt::gtk::GtkToolkit::gtkInit ()
-{
- // Initialize GLib in thread-safe mode. We assume that GLib is using the
- // same native threads library as libgcj. Refer to comments in
- // GtkComponentPeer constructor.
- g_thread_init (NULL);
- gtk_init (&_Jv_argc, &_Jv_argv);
-}
-
-void
-gnu::awt::gtk::GtkToolkit::beep ()
-{
- GDK_THREADS_ENTER ();
- gdk_beep ();
- GDK_THREADS_LEAVE ();
-}
-
-jint
-gnu::awt::gtk::GtkToolkit::getScreenResolution ()
-{
- jint res;
-
- GDK_THREADS_ENTER ();
-
- res = (int) (gdk_screen_width () / (gdk_screen_width_mm () / 25.4));
-
- GDK_THREADS_LEAVE ();
- return res;
-}
-
-::java::awt::Dimension *
-gnu::awt::gtk::GtkToolkit::getScreenSize ()
-{
- ::java::awt::Dimension *dim = new ::java::awt::Dimension ();
-
- GDK_THREADS_ENTER ();
-
- dim->width = gdk_screen_width ();
- dim->height = gdk_screen_height ();
-
- GDK_THREADS_LEAVE ();
- return dim;
-}
-
-void
-gnu::awt::gtk::GtkToolkit::sync ()
-{
- GDK_THREADS_ENTER ();
- gdk_flush ();
- GDK_THREADS_LEAVE ();
-}
-
-
diff --git a/libjava/gnu/awt/gtk/natGtkWindowPeer.cc b/libjava/gnu/awt/gtk/natGtkWindowPeer.cc
deleted file mode 100644
index d3f05c951c0..00000000000
--- a/libjava/gnu/awt/gtk/natGtkWindowPeer.cc
+++ /dev/null
@@ -1,40 +0,0 @@
-// This file was created by `gcjh -stubs'. -*- c++ -*-
-//
-// This file is intended to give you a head start on implementing native
-// methods using CNI.
-// Be aware: running `gcjh -stubs ' once more for this class may
-// overwrite any edits you have made to this file.
-
-#include <gnu/awt/gtk/GtkWindowPeer.h>
-#include <gcj/cni.h>
-
-#include <gtk/gtk.h>
-
-void
-gnu::awt::gtk::GtkWindowPeer::toBack ()
-{
- GDK_THREADS_ENTER ();
- gdk_window_lower (GTK_WIDGET (ptr)->window);
- GDK_THREADS_LEAVE ();
-}
-
-void
-gnu::awt::gtk::GtkWindowPeer::toFront ()
-{
- GDK_THREADS_ENTER ();
- gdk_window_raise (GTK_WIDGET (ptr)->window);
- GDK_THREADS_LEAVE ();
-}
-
-void
-gnu::awt::gtk::GtkWindowPeer::create ()
-{
- if (ptr == NULL)
- {
- GDK_THREADS_ENTER ();
- ptr = (gnu::gcj::RawData *) gtk_window_new(GTK_WINDOW_POPUP);
- GDK_THREADS_LEAVE ();
- }
-
- gnu::awt::gtk::GtkContainerPeer::create();
-}
diff --git a/libjava/gnu/gcj/convert/natIconv.cc b/libjava/gnu/gcj/convert/natIconv.cc
index d98e449677a..6c64e2b4bf9 100644
--- a/libjava/gnu/gcj/convert/natIconv.cc
+++ b/libjava/gnu/gcj/convert/natIconv.cc
@@ -42,7 +42,7 @@ gnu::gcj::convert::Input_iconv::init (jstring encoding)
#ifdef HAVE_ICONV
jsize len = _Jv_GetStringUTFLength (encoding);
char buffer[len + 1];
- _Jv_GetStringUTFRegion (encoding, 0, len, buffer);
+ _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
buffer[len] = '\0';
iconv_t h = iconv_open ("UCS-2", buffer);
@@ -142,7 +142,7 @@ gnu::gcj::convert::Output_iconv::init (jstring encoding)
#ifdef HAVE_ICONV
jsize len = _Jv_GetStringUTFLength (encoding);
char buffer[len + 1];
- _Jv_GetStringUTFRegion (encoding, 0, len, buffer);
+ _Jv_GetStringUTFRegion (encoding, 0, encoding->length(), buffer);
buffer[len] = '\0';
iconv_t h = iconv_open (buffer, "UCS-2");
diff --git a/libjava/gnu/gcj/runtime/FirstThread.java b/libjava/gnu/gcj/runtime/FirstThread.java
index 90515830cfc..9d4b435bba2 100644
--- a/libjava/gnu/gcj/runtime/FirstThread.java
+++ b/libjava/gnu/gcj/runtime/FirstThread.java
@@ -89,8 +89,10 @@ final class FirstThread extends Thread
// classes are linked in. Otherwise bootstrapping fails. These
// classes are only referred to via Class.forName(), so we add an
// explicit mention of them here.
- static final Class Kcert = java.security.cert.Certificate.class;
- static final Class Kfile = gnu.java.net.protocol.file.Handler.class;
- static final Class Khttp = gnu.java.net.protocol.http.Handler.class;
- static final Class Kjar = gnu.java.net.protocol.jar.Handler.class;
+ static final Class Kcert = java.security.cert.Certificate.class;
+ static final Class Kfile = gnu.java.net.protocol.file.Handler.class;
+ static final Class Khttp = gnu.java.net.protocol.http.Handler.class;
+ static final Class Kjar = gnu.java.net.protocol.jar.Handler.class;
+ static final Class Klocale = gnu.java.locale.LocaleInformation.class;
+ static final Class Kcalendar = gnu.java.locale.Calendar.class;
}
diff --git a/libjava/gnu/gcj/runtime/natNameFinder.cc b/libjava/gnu/gcj/runtime/natNameFinder.cc
index 6605e380591..41b8f4badf2 100644
--- a/libjava/gnu/gcj/runtime/natNameFinder.cc
+++ b/libjava/gnu/gcj/runtime/natNameFinder.cc
@@ -1,6 +1,6 @@
// natNameFinder.cc - native helper methods for NameFinder.java
-/* Copyright (C) 2002 Free Software Foundation, Inc
+/* Copyright (C) 2002, 2003 Free Software Foundation, Inc
This file is part of libgcj.
@@ -56,7 +56,7 @@ gnu::gcj::runtime::NameFinder::getExternalLabel (java::lang::String* name)
char *newName = (char *) JvMalloc (pfxLen + nameLen + 1);
*(newName + 0) = '\0';
strcpy (newName, LABEL_PREFIX);
- JvGetStringUTFRegion (name, 0, nameLen, newName + pfxLen);
+ JvGetStringUTFRegion (name, 0, name->length(), newName + pfxLen);
*(newName + pfxLen + nameLen) = '\0';
return JvNewStringLatin1 (newName);
}
diff --git a/libjava/gnu/gcj/xlib/GC.java b/libjava/gnu/gcj/xlib/GC.java
index 24cd3bd1f53..da427c9ab9d 100644
--- a/libjava/gnu/gcj/xlib/GC.java
+++ b/libjava/gnu/gcj/xlib/GC.java
@@ -45,7 +45,7 @@ public class GC implements Cloneable
gcClone.structure = null;
}
gcClone.initStructure(this);
- gcClone.updateClip();
+ gcClone.updateClip(clipRectangles);
return gcClone;
}
catch (CloneNotSupportedException ex)
@@ -107,8 +107,8 @@ public class GC implements Cloneable
*/
public void setClipRectangles(Rectangle[] rectangles)
{
- clip = new Clip(rectangles);
- updateClip();
+ clipRectangles = rectangles;
+ updateClip(clipRectangles);
}
public native void drawString(String text, int x, int y);
@@ -148,10 +148,10 @@ public class GC implements Cloneable
return target;
}
- private native void updateClip();
+ private native void updateClip(Rectangle[] rectangles);
private Drawable target;
private RawData structure;
- private Clip clip;
+ private Rectangle[] clipRectangles;
}
diff --git a/libjava/gnu/gcj/xlib/XAnyEvent.java b/libjava/gnu/gcj/xlib/XAnyEvent.java
index df1ad782d79..061d6137b17 100644
--- a/libjava/gnu/gcj/xlib/XAnyEvent.java
+++ b/libjava/gnu/gcj/xlib/XAnyEvent.java
@@ -58,7 +58,7 @@ public final class XAnyEvent
public final static long MASK_SUBSTRUCTURE_NOTIFY = 1L<<19,
MASK_SUBSTRUCTURE_REDIRECT = 1L<<20;
- XAnyEvent(Display display)
+ public XAnyEvent(Display display)
{
this.display = display;
init();
diff --git a/libjava/gnu/gcj/xlib/natGC.cc b/libjava/gnu/gcj/xlib/natGC.cc
index 17bcbe67b5a..3819da45005 100644
--- a/libjava/gnu/gcj/xlib/natGC.cc
+++ b/libjava/gnu/gcj/xlib/natGC.cc
@@ -217,25 +217,33 @@ void gnu::gcj::xlib::GC::putImage(XImage* image,
// no fast fail
}
-void gnu::gcj::xlib::GC::updateClip()
+void gnu::gcj::xlib::GC::updateClip(AWTRectArray* rectangles)
{
- if (clip == 0)
- return;
+ int numRect = JvGetArrayLength(rectangles);
+ XRectVector* xrectvector = new XRectVector(numRect);
+ for (int i=0; i<numRect; i++)
+ {
+ AWTRect* awtrect = elements(rectangles)[i];
+ XRectangle& xrect = (*xrectvector)[i];
+
+ xrect.x = awtrect->x;
+ xrect.y = awtrect->y;
+ xrect.width = awtrect->width;
+ xrect.height = awtrect->height;
+ }
+
Display* display = target->getDisplay();
::Display* dpy = (::Display*) (display->display);
::GC gc = (::GC) structure;
-
- XRectVector* xrectvector = (XRectVector*) (clip->xrects);
- int numRect = xrectvector->size();
-
+
int originX = 0;
int originY = 0;
int ordering = Unsorted;
XSetClipRectangles(dpy, gc, originX, originY,
&(xrectvector->front()), numRect,
ordering);
- // no fast fail
+ delete xrectvector;
}
void gnu::gcj::xlib::GC::copyArea (gnu::gcj::xlib::Drawable * source,
diff --git a/libjava/gnu/java/awt/image/ImageDecoder.java b/libjava/gnu/java/awt/image/ImageDecoder.java
index 4d3fbecacd7..d44efce5d77 100644
--- a/libjava/gnu/java/awt/image/ImageDecoder.java
+++ b/libjava/gnu/java/awt/image/ImageDecoder.java
@@ -48,6 +48,10 @@ public abstract class ImageDecoder implements ImageProducer
Vector consumers = new Vector ();
String filename;
URL url;
+ byte[] data;
+ int offset;
+ int length;
+ InputStream input;
public static ColorModel cm;
@@ -69,6 +73,13 @@ public abstract class ImageDecoder implements ImageProducer
this.url = url;
}
+ public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)
+ {
+ data = imagedata;
+ offset = imageoffset;
+ length = imagelength;
+ }
+
public void addConsumer (ImageConsumer ic)
{
consumers.addElement (ic);
@@ -90,11 +101,22 @@ public abstract class ImageDecoder implements ImageProducer
Vector list = (Vector) consumers.clone ();
try
{
- FileInputStream is = (url == null) ? new FileInputStream (filename) :
- (FileInputStream) url.openStream();
-
- produce (list, is);
- }
+ // Create the input stream here rather than in the
+ // ImageDecoder constructors so that exceptions cause
+ // imageComplete to be called with an appropriate error
+ // status.
+ if (url != null)
+ input = url.openStream();
+ else
+ {
+ if (filename != null)
+ input = new FileInputStream (filename);
+ else
+ input = new ByteArrayInputStream (data, offset, length);
+ }
+
+ produce (list, input);
+ }
catch (Exception e)
{
for (int i = 0; i < list.size (); i++)
@@ -109,5 +131,5 @@ public abstract class ImageDecoder implements ImageProducer
{
}
- abstract void produce (Vector v, FileInputStream is) throws IOException;
+ abstract void produce (Vector v, InputStream is) throws IOException;
}
diff --git a/libjava/gnu/java/awt/image/XBMDecoder.java b/libjava/gnu/java/awt/image/XBMDecoder.java
index 2505b3d1ba9..b80fd55de54 100644
--- a/libjava/gnu/java/awt/image/XBMDecoder.java
+++ b/libjava/gnu/java/awt/image/XBMDecoder.java
@@ -62,7 +62,7 @@ public class XBMDecoder extends ImageDecoder
super (url);
}
- public void produce (Vector v, FileInputStream is) throws IOException
+ public void produce (Vector v, InputStream is) throws IOException
{
reader = new BufferedReader (new InputStreamReader (is));
int width = -1, height = -1;
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java b/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java
index 7e317003d27..ca262890bb5 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeer.java
@@ -49,6 +49,7 @@ import java.util.Map;
import java.util.StringTokenizer;
import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
+import java.text.StringCharacterIterator;
import java.awt.font.TextAttribute;
import gnu.classpath.Configuration;
import gnu.java.awt.peer.ClasspathFontPeer;
@@ -180,10 +181,56 @@ public class GdkClasspathFontPeer extends ClasspathFontPeer
throw new UnsupportedOperationException ();
}
+ protected class GdkFontLineMetrics extends LineMetrics
+ {
+ FontMetrics fm;
+ int nchars;
+
+ public GdkFontLineMetrics (FontMetrics m, int n)
+ {
+ fm = m;
+ nchars = n;
+ }
+
+ public float getAscent()
+ {
+ return (float) fm.getAscent ();
+ }
+
+ public int getBaselineIndex()
+ {
+ return Font.ROMAN_BASELINE;
+ }
+
+ public float[] getBaselineOffsets()
+ {
+ return new float[3];
+ }
+
+ public float getDescent()
+ {
+ return (float) fm.getDescent ();
+ }
+
+ public float getHeight()
+ {
+ return (float) fm.getHeight ();
+ }
+
+ public float getLeading() { return 0.f; }
+ public int getNumChars() { return nchars; }
+ public float getStrikethroughOffset() { return 0.f; }
+ public float getStrikethroughThickness() { return 0.f; }
+ public float getUnderlineOffset() { return 0.f; }
+ public float getUnderlineThickness() { return 0.f; }
+
+ }
+
+
public LineMetrics getLineMetrics (Font font, CharacterIterator ci,
int begin, int limit, FontRenderContext rc)
{
- throw new UnsupportedOperationException ();
+ return new GdkFontLineMetrics (getFontMetrics (font), limit - begin);
}
public Rectangle2D getMaxCharBounds (Font font, FontRenderContext rc)
@@ -214,25 +261,32 @@ public class GdkClasspathFontPeer extends ClasspathFontPeer
public boolean hasUniformLineMetrics (Font font)
{
- throw new UnsupportedOperationException ();
+ return true;
}
public GlyphVector layoutGlyphVector (Font font, FontRenderContext frc,
char[] chars, int start, int limit,
int flags)
{
- throw new UnsupportedOperationException ();
+ int nchars = (limit - start) + 1;
+ char[] nc = new char[nchars];
+
+ for (int i = 0; i < nchars; ++i)
+ nc[i] = chars[start + i];
+
+ return createGlyphVector (font, frc,
+ new StringCharacterIterator (new String (nc)));
}
public LineMetrics getLineMetrics (Font font, String str,
FontRenderContext frc)
{
- throw new UnsupportedOperationException();
+ return new GdkFontLineMetrics (getFontMetrics (font), str.length ());
}
public FontMetrics getFontMetrics (Font font)
{
- throw new UnsupportedOperationException();
+ return new GdkClasspathFontPeerMetrics (font);
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java
new file mode 100644
index 00000000000..2f019e4dbc4
--- /dev/null
+++ b/libjava/gnu/java/awt/peer/gtk/GdkClasspathFontPeerMetrics.java
@@ -0,0 +1,116 @@
+/* GdkClasspathFontPeerMetrics.java
+ Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+
+package gnu.java.awt.peer.gtk;
+
+import java.awt.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+
+public class GdkClasspathFontPeerMetrics extends FontMetrics
+{
+ private final int native_state = GtkGenericPeer.getUniqueInteger();
+
+ private static final int ASCENT = 0, MAX_ASCENT = 1,
+ DESCENT = 2, MAX_DESCENT = 3,
+ MAX_ADVANCE = 4;
+
+ private int[] metrics;
+ private native int[] initState (Object font);
+
+ public GdkClasspathFontPeerMetrics (Font font)
+ {
+ super (font);
+ metrics = initState (font.getPeer());
+ }
+
+ public int stringWidth (String str)
+ {
+ GlyphVector gv = font.createGlyphVector
+ (new FontRenderContext
+ (new AffineTransform (), false, false), str);
+ Rectangle2D r = gv.getVisualBounds ();
+ return (int) r.getWidth ();
+ }
+
+ public int charWidth (char ch)
+ {
+ return stringWidth (new String (new char[] { ch }));
+ }
+
+ public int charsWidth (char data[], int off, int len)
+ {
+ return stringWidth (new String (data, off, len));
+ }
+
+ /*
+ Sun's Motif implementation always returns 0 or 1 here (???), but
+ going by the X11 man pages, it seems as though we should return
+ font.ascent + font.descent.
+ */
+ public int getLeading ()
+ {
+ return 1;
+// return metrics[ASCENT] + metrics[DESCENT];
+ }
+
+ public int getAscent ()
+ {
+ return metrics[ASCENT];
+ }
+
+ public int getMaxAscent ()
+ {
+ return metrics[MAX_ASCENT];
+ }
+
+ public int getDescent ()
+ {
+ return metrics[DESCENT];
+ }
+
+ public int getMaxDescent ()
+ {
+ return metrics[MAX_DESCENT];
+ }
+
+ public int getMaxAdvance ()
+ {
+ return metrics[MAX_ADVANCE];
+ }
+}
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
index 12982832df5..ebca7ed0cea 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkFontMetrics.java
@@ -50,16 +50,20 @@ public class GdkFontMetrics extends FontMetrics
MAX_ADVANCE = 4;
private int[] metrics;
- private native int[] initState (String xlfd, int pts);
+ private native int[] initState (String fname, int size);
public GdkFontMetrics (Font font)
{
super (font);
- metrics = initState (((GtkFontPeer)font.getPeer ()).getXLFD (),
- font.getSize ());
+ metrics = initState (font.getName (), font.getSize ());
}
- native public int stringWidth (String str);
+ native public int stringWidth (String fname, int size, String str);
+
+ public int stringWidth (String str)
+ {
+ return stringWidth (font.getName (), font.getSize (), str);
+ }
public int charWidth (char ch)
{
@@ -71,15 +75,10 @@ public class GdkFontMetrics extends FontMetrics
return stringWidth (new String (data, off, len));
}
- /*
- Sun's Motif implementation always returns 0 or 1 here (???), but
- going by the X11 man pages, it seems as though we should return
- font.ascent + font.descent.
- */
+ // Sun's Motif implementation always returns 0 or 1 here (???).
public int getLeading ()
{
- return 1;
-// return metrics[ASCENT] + metrics[DESCENT];
+ return 0;
}
public int getAscent ()
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
index 7adb307b75a..036e40f972d 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkGraphics2D.java
@@ -47,6 +47,7 @@ import java.awt.image.renderable.*;
import java.text.AttributedCharacterIterator;
import java.util.Map;
+import java.util.Stack;
import java.lang.Integer;
import gnu.java.awt.ClasspathToolkit;
import gnu.java.awt.peer.ClasspathFontPeer;
@@ -78,6 +79,8 @@ public class GdkGraphics2D extends Graphics2D
private AffineTransform transform;
private GtkComponentPeer component;
private Font font;
+
+ private Stack stateStack;
native private int[] initState (GtkComponentPeer component);
native private void initState (int width, int height);
@@ -122,33 +125,50 @@ public class GdkGraphics2D extends Graphics2D
clip = new Rectangle (g.getClipBounds ());
if (g.transform == null)
- transform = null;
+ transform = AffineTransform.getTranslateInstance (0.5, 0.5);
else
transform = new AffineTransform (g.transform);
+ font = g.font;
component = g.component;
copyState (g);
setColor (fg);
+ setBackground (bg);
+ setPaint (paint);
+ setStroke (stroke);
setClip (clip);
setTransform (transform);
+ stateStack = new Stack();
}
GdkGraphics2D (int width, int height)
{
initState (width, height);
- bg = Color.black;
- fg = Color.black;
- transform = new AffineTransform ();
+
+ setColor(Color.black);
+ setBackground (Color.black);
+ setPaint (getColor());
+ setFont (new Font("SansSerif", Font.PLAIN, 12));
+ setTransform (AffineTransform.getTranslateInstance (0.5, 0.5));
+ setStroke (new BasicStroke ());
+
+ stateStack = new Stack();
}
GdkGraphics2D (GtkComponentPeer component)
{
this.component = component;
int rgb[] = initState (component);
- fg = new Color (rgb[0], rgb[1], rgb[2]);
- bg = new Color (rgb[3], rgb[4], rgb[5]);
- transform = new AffineTransform ();
+
+ setColor (new Color (rgb[0], rgb[1], rgb[2]));
+ setBackground (new Color (rgb[3], rgb[4], rgb[5]));
+ setPaint (getColor());
+ setFont (new Font("SansSerif", Font.PLAIN, 12));
+ setTransform (AffineTransform.getTranslateInstance (0.5, 0.5));
+ setStroke (new BasicStroke ());
+
+ stateStack = new Stack ();
}
@@ -160,7 +180,7 @@ public class GdkGraphics2D extends Graphics2D
private native void gdkDrawDrawable (GdkGraphics2D other, int x, int y);
// drawing utility methods
- private native void drawPixels (int pixels[], int w, int h, int stride);
+ private native void drawPixels (int pixels[], int w, int h, int stride, double i2u[]);
private native void setTexturePixels (int pixels[], int w, int h, int stride);
private native void setGradient (double x1, double y1,
double x2, double y2,
@@ -171,13 +191,10 @@ public class GdkGraphics2D extends Graphics2D
// simple passthroughs to cairo
private native void cairoSave ();
private native void cairoRestore ();
- private native void cairoSetMatrix (double m00, double m10,
- double m01, double m11,
- double m02, double m12);
+ private native void cairoSetMatrix (double m[]);
private native void cairoSetFont (GdkClasspathFontPeer peer);
private native void cairoShowGlyphs (int codes[],
- float positions[],
- int nglyphs);
+ float positions[]);
private native void cairoSetOperator (int cairoOperator);
private native void cairoSetRGBColor (double red, double green, double blue);
private native void cairoSetAlpha (double alpha);
@@ -187,20 +204,17 @@ public class GdkGraphics2D extends Graphics2D
private native void cairoSetLineJoin (int cairoLineJoin);
private native void cairoSetDash (double dashes[], int ndash, double offset);
private native void cairoSetMiterLimit (double limit);
- private native void cairoTranslate (double tx, double ty);
- private native void cairoScale (double sx, double sy);
- private native void cairoRotate (double angle);
private native void cairoNewPath ();
private native void cairoMoveTo (double x, double y);
private native void cairoLineTo (double x, double y);
private native void cairoCurveTo (double x1, double y1,
- double x2, double y2,
- double x3, double y3);
+ double x2, double y2,
+ double x3, double y3);
private native void cairoRelMoveTo (double dx, double dy);
private native void cairoRelLineTo (double dx, double dy);
private native void cairoRelCurveTo (double dx1, double dy1,
- double dx2, double dy2,
- double dx3, double dy3);
+ double dx2, double dy2,
+ double dx3, double dy3);
private native void cairoRectangle (double x, double y,
double width, double height);
private native void cairoClosePath ();
@@ -213,6 +227,51 @@ public class GdkGraphics2D extends Graphics2D
////// General Drawing Support Methods //////
/////////////////////////////////////////////
+ private class DrawState
+ {
+ private Paint paint;
+ private Stroke stroke;
+ private Color fg;
+ private Color bg;
+ private Shape clip;
+ private AffineTransform transform;
+ private Font font;
+ DrawState (GdkGraphics2D g)
+ {
+ this.paint = g.paint;
+ this.stroke = g.stroke;
+ this.fg = g.fg;
+ this.bg = g.bg;
+ this.clip = g.clip;
+ if (g.transform != null)
+ this.transform = (AffineTransform) g.transform.clone();
+ this.font = g.font;
+ }
+ public void restore(GdkGraphics2D g)
+ {
+ g.paint = this.paint;
+ g.stroke = this.stroke;
+ g.fg = this.fg;
+ g.bg = this.bg;
+ g.clip = this.clip;
+ g.transform = this.transform;
+ g.font = this.font;
+ }
+ }
+
+ private void stateSave ()
+ {
+ stateStack.push (new DrawState (this));
+ cairoSave ();
+ }
+
+ private void stateRestore ()
+ {
+ ((DrawState)(stateStack.pop ())).restore (this);
+ cairoRestore ();
+ }
+
+
double x;
double y;
private void setPos (double nx, double ny)
@@ -288,7 +347,7 @@ public class GdkGraphics2D extends Graphics2D
return;
}
- cairoSave ();
+ stateSave ();
cairoNewPath ();
if (s instanceof Rectangle2D)
{
@@ -298,12 +357,12 @@ public class GdkGraphics2D extends Graphics2D
else
walkPath (s.getPathIterator (null));
cairoStroke ();
- cairoRestore ();
+ stateRestore ();
}
- public void fill(Shape s)
+ public void fill (Shape s)
{
- cairoSave();
+ stateSave();
cairoNewPath ();
if (s instanceof Rectangle2D)
{
@@ -313,23 +372,40 @@ public class GdkGraphics2D extends Graphics2D
else
walkPath (s.getPathIterator (null));
cairoFill ();
- cairoRestore ();
+ stateRestore ();
}
public void clip (Shape s)
{
- clip = s;
- cairoNewPath ();
- if (s instanceof Rectangle2D)
- {
- Rectangle2D r = (Rectangle2D)s;
- cairoRectangle (r.getX (), r.getY (),
- r.getWidth (), r.getHeight ());
- }
- else
- walkPath (s.getPathIterator (null));
- cairoClosePath ();
- cairoClip ();
+ // update it
+
+ if (clip == null || s == null)
+ clip = s;
+ else if (s instanceof Rectangle2D
+ && clip instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D)s;
+ Rectangle2D curr = (Rectangle2D)clip;
+ clip = curr.createIntersection (r);
+ }
+ else
+ throw new UnsupportedOperationException ();
+
+ // draw it
+ if (clip != null)
+ {
+ cairoNewPath ();
+ if (clip instanceof Rectangle2D)
+ {
+ Rectangle2D r = (Rectangle2D)clip;
+ cairoRectangle (r.getX (), r.getY (),
+ r.getWidth (), r.getHeight ());
+ }
+ else
+ walkPath (clip.getPathIterator (null));
+ cairoClosePath ();
+ cairoClip ();
+ }
}
public Paint getPaint ()
@@ -339,11 +415,14 @@ public class GdkGraphics2D extends Graphics2D
public AffineTransform getTransform ()
{
- return transform;
+ return (AffineTransform) transform.clone ();
}
public void setPaint (Paint p)
{
+ if (paint == null)
+ return;
+
paint = p;
if (paint instanceof Color)
{
@@ -385,7 +464,7 @@ public class GdkGraphics2D extends Graphics2D
{
double m[] = new double[6];
transform.getMatrix (m);
- cairoSetMatrix (m[0], m[1], m[2], m[3], m[4], m[5]);
+ cairoSetMatrix (m);
}
}
@@ -400,32 +479,22 @@ public class GdkGraphics2D extends Graphics2D
public void rotate(double theta)
{
- if (transform != null)
- transform.rotate (theta);
- cairoRotate (theta);
+ transform (AffineTransform.getRotateInstance (theta));
}
public void rotate(double theta, double x, double y)
{
- if (transform != null)
- transform.rotate (theta, x, y);
- cairoTranslate (x, y);
- cairoRotate (theta);
- cairoTranslate (-x, -y);
+ transform (AffineTransform.getRotateInstance (theta, x, y));
}
public void scale(double sx, double sy)
{
- if (transform != null)
- transform.scale (sx, sy);
- cairoScale (sx, sy);
+ transform (AffineTransform.getScaleInstance (sx, sy));
}
public void translate (double tx, double ty)
{
- if (transform != null)
- transform.translate (tx, ty);
- cairoTranslate (tx, ty);
+ transform (AffineTransform.getTranslateInstance (tx, ty));
}
public void translate (int x, int y)
@@ -433,6 +502,11 @@ public class GdkGraphics2D extends Graphics2D
translate ((double) x, (double) y);
}
+ public void shear(double shearX, double shearY)
+ {
+ transform (AffineTransform.getShearInstance (shearX, shearY));
+ }
+
public Stroke getStroke()
{
return stroke;
@@ -445,7 +519,7 @@ public class GdkGraphics2D extends Graphics2D
{
BasicStroke bs = (BasicStroke) stroke;
cairoSetLineCap (bs.getEndCap());
- cairoSetLineWidth (bs.getLineWidth());
+ cairoSetLineWidth (bs.getLineWidth() / 2.0);
cairoSetLineJoin (bs.getLineJoin());
cairoSetMiterLimit (bs.getMiterLimit());
float dashes[] = bs.getDashArray();
@@ -467,7 +541,7 @@ public class GdkGraphics2D extends Graphics2D
public void setPaintMode ()
{
- setComposite (java.awt.AlphaComposite.Xor);
+ setComposite (java.awt.AlphaComposite.SrcOver);
}
public void setXORMode (Color c)
@@ -478,6 +552,7 @@ public class GdkGraphics2D extends Graphics2D
public void setColor (Color c)
{
fg = c;
+ paint = c;
cairoSetRGBColor (fg.getRed() / 255.0,
fg.getGreen() / 255.0,
fg.getBlue() / 255.0);
@@ -491,29 +566,12 @@ public class GdkGraphics2D extends Graphics2D
public void clipRect (int x, int y, int width, int height)
{
- // this is *slightly* different than all the other clip functions: it
- // intersects the clip area with the new clip rectangle. obviously. of
- // course, since Shape doesn't *have* any way of intersecting with a
- // rectangle, we will promote the current clipping region to its
- // bounding rectangle and then intersect with that.
- if (clip == null)
- {
- cairoNewPath ();
- cairoRectangle (x, y, width, height);
- cairoClosePath ();
- cairoClip ();
- clip = new Rectangle (x, y, width, height);
- }
- else
- {
- clip (clip.getBounds ().intersection
- (new Rectangle (x, y, width, height)));
- }
+ clip (new Rectangle (x, y, width, height));
}
public Shape getClip ()
{
- return clip;
+ return getClipInDevSpace ();
}
public Rectangle getClipBounds ()
@@ -524,13 +582,32 @@ public class GdkGraphics2D extends Graphics2D
return clip.getBounds ();
}
+ protected Rectangle2D getClipInDevSpace ()
+ {
+ Rectangle2D uclip = clip.getBounds2D ();
+ if (transform == null)
+ return uclip;
+ else
+ {
+ Point2D pos = transform.transform (new Point2D.Double(uclip.getX (),
+ uclip.getY ()),
+ (Point2D)null);
+ Point2D extent = transform.deltaTransform (new Point2D.Double(uclip.getWidth (),
+ uclip.getHeight ()),
+ (Point2D)null);
+ return new Rectangle2D.Double (pos.getX (), pos.getY (),
+ extent.getX (), extent.getY ());
+ }
+ }
+
public void setClip (int x, int y, int width, int height)
{
- cairoNewPath ();
- cairoRectangle (x, y, width, height);
- cairoClosePath ();
- cairoClip ();
- clip = new Rectangle (x, y, width, height);
+ cairoNewPath ();
+ cairoRectangle (x, y, width, height);
+ cairoClosePath ();
+ cairoClip ();
+ clip = new Rectangle2D.Double ((double)x, (double)y,
+ (double)width, (double)height);
}
public void setClip (Shape s)
@@ -558,7 +635,7 @@ public class GdkGraphics2D extends Graphics2D
double y1 = (double) y;
double y2 = (double) y + height;
- cairoSave ();
+ stateSave ();
cairoNewPath ();
setColor (light);
@@ -574,9 +651,7 @@ public class GdkGraphics2D extends Graphics2D
cairoLineTo (x2, y2);
cairoStroke ();
- cairoRestore ();
- setColor (std);
-
+ stateRestore ();
}
public void fill3DRect(int x, int y, int width,
@@ -594,15 +669,15 @@ public class GdkGraphics2D extends Graphics2D
draw3DRect (x, y, width, height, raised);
- cairoSave ();
- cairoTranslate (step/2.0, step/2.0);
+ stateSave ();
+ translate (step/2.0, step/2.0);
cairoNewPath ();
cairoRectangle ((double) x, (double) y,
((double) width) - step,
((double) height) - step );
cairoClosePath ();
cairoFill ();
- cairoRestore ();
+ stateRestore ();
}
@@ -618,7 +693,7 @@ public class GdkGraphics2D extends Graphics2D
public void clearRect (int x, int y, int width, int height)
{
- cairoSave ();
+ stateSave ();
cairoSetRGBColor (bg.getRed() / 255.0,
bg.getGreen() / 255.0,
bg.getBlue() / 255.0);
@@ -627,7 +702,7 @@ public class GdkGraphics2D extends Graphics2D
cairoRectangle (x, y, width, height);
cairoClosePath ();
cairoFill ();
- cairoRestore ();
+ stateRestore ();
}
public void setBackground(Color c)
@@ -635,13 +710,11 @@ public class GdkGraphics2D extends Graphics2D
bg = c;
}
-
public Color getBackground()
{
return bg;
}
-
private void doPolygon(int[] xPoints, int[] yPoints, int nPoints,
boolean close, boolean fill)
{
@@ -698,7 +771,8 @@ public class GdkGraphics2D extends Graphics2D
doPolygon (xPoints, yPoints, nPoints, false, false);
}
- private boolean drawRaster (ColorModel cm, Raster r)
+ private boolean drawRaster (ColorModel cm, Raster r,
+ AffineTransform imageToUser)
{
if (r == null)
return false;
@@ -712,6 +786,16 @@ public class GdkGraphics2D extends Graphics2D
if (cm == null)
cm = ColorModel.getRGBdefault ();
+ double[] i2u = new double[6];
+ if (imageToUser != null)
+ imageToUser.getMatrix(i2u);
+ else
+ {
+ i2u[0] = 1; i2u[1] = 0;
+ i2u[2] = 0; i2u[3] = 1;
+ i2u[2] = 0; i2u[3] = 0;
+ }
+
int pixels[] = null;
if (sm.getDataType () == DataBuffer.TYPE_INT &&
@@ -735,23 +819,39 @@ public class GdkGraphics2D extends Graphics2D
pixels = pixels2;
}
- cairoSave ();
- cairoTranslate (x, y);
- drawPixels (pixels, r.getWidth (), r.getHeight (), r.getWidth ());
- cairoRestore ();
+ stateSave ();
+ translate (x, y);
+ drawPixels (pixels, r.getWidth (), r.getHeight (), r.getWidth (), i2u);
+ stateRestore ();
return true;
}
- public boolean drawImage (Image img, int x, int y,
- ImageObserver observer)
+ public void drawRenderedImage(RenderedImage image,
+ AffineTransform xform)
+ {
+ drawRaster (image.getColorModel(), image.getData(), xform);
+ }
+
+ public void drawRenderableImage(RenderableImage image,
+ AffineTransform xform)
+ {
+ drawRenderedImage (image.createRendering (new RenderContext (xform)), xform);
+ }
+
+ public boolean drawImage(Image img,
+ AffineTransform xform,
+ ImageObserver obs)
{
if (img instanceof GtkOffScreenImage &&
img.getGraphics () instanceof GdkGraphics2D &&
- (transform == null || transform.isIdentity ()))
+ (xform == null
+ || xform.getType () == AffineTransform.TYPE_IDENTITY
+ || xform.getType () == AffineTransform.TYPE_TRANSLATION)
+ )
{
// we are being asked to flush a double buffer from Gdk
GdkGraphics2D g2 = (GdkGraphics2D) img.getGraphics ();
- gdkDrawDrawable (g2, x, y);
+ gdkDrawDrawable (g2, (int)xform.getTranslateX(), (int)xform.getTranslateY());
return true;
}
else
@@ -760,17 +860,32 @@ public class GdkGraphics2D extends Graphics2D
{
// draw an image which has actually been loaded into memory fully
BufferedImage b = (BufferedImage) img;
- return drawRaster (b.getColorModel (), b.getData ());
+ return drawRaster (b.getColorModel (), b.getData (), xform);
}
else
{
// begin progressive loading in a separate thread
- new PainterThread (this, img);
+ new PainterThread (this, img, xform);
return false;
}
}
}
+ public void drawImage(BufferedImage image,
+ BufferedImageOp op,
+ int x,
+ int y)
+ {
+ Image filtered = op.filter(image, null);
+ drawImage(filtered, new AffineTransform(1f,0f,0f,1f,x,y), null);
+ }
+
+ public boolean drawImage (Image img, int x, int y,
+ ImageObserver observer)
+ {
+ return drawImage(img, new AffineTransform(1f,0f,0f,1f,x,y), observer);
+ }
+
////////////////////////////////////////
////// Supporting Private Classes //////
@@ -790,10 +905,12 @@ public class GdkGraphics2D extends Graphics2D
GdkGraphics2D gr;
Image image;
ColorModel defaultModel;
+ AffineTransform xform;
- public PainterThread (GdkGraphics2D g, Image im)
+ public PainterThread (GdkGraphics2D g, Image im, AffineTransform xf)
{
image = im;
+ xform = xf;
this.gr = (GdkGraphics2D) g.create ();
new Thread (this).start ();
}
@@ -823,8 +940,8 @@ public class GdkGraphics2D extends Graphics2D
public void setPixels (int x, int y, int w, int h, ColorModel model,
int[] pixels, int off, int scansize)
{
- gr.cairoSave ();
- gr.cairoTranslate (x, y);
+ gr.stateSave ();
+ gr.translate (x, y);
if (model == null)
model = defaultModel;
@@ -843,8 +960,10 @@ public class GdkGraphics2D extends Graphics2D
else
pixels2 = pixels;
- gr.drawPixels (pixels2, w, h, scansize);
- gr.cairoRestore ();
+ double[] xf = new double[6];
+ xform.getMatrix(xf);
+ gr.drawPixels (pixels2, w, h, scansize, xf);
+ gr.stateRestore ();
}
public void setProperties (java.util.Hashtable props)
@@ -934,43 +1053,7 @@ public class GdkGraphics2D extends Graphics2D
////// Unimplemented Stubs and Overloads //////
///////////////////////////////////////////////
- public boolean drawImage(Image image,
- AffineTransform xform,
- ImageObserver obs)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
- public void drawImage(BufferedImage image,
- BufferedImageOp op,
- int x,
- int y)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
- public void drawRenderedImage(RenderedImage image,
- AffineTransform xform)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
- public void drawRenderableImage(RenderableImage image,
- AffineTransform xform)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
- public void drawString(String text, float x, float y)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
- public void drawString(AttributedCharacterIterator iterator,
- float x, float y)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
public boolean hit(Rectangle rect, Shape text,
boolean onStroke)
@@ -1014,11 +1097,6 @@ public class GdkGraphics2D extends Graphics2D
throw new java.lang.UnsupportedOperationException ();
}
- public void shear(double shearX, double shearY)
- {
- throw new java.lang.UnsupportedOperationException ();
- }
-
public Composite getComposite()
{
throw new java.lang.UnsupportedOperationException ();
@@ -1026,18 +1104,20 @@ public class GdkGraphics2D extends Graphics2D
public FontRenderContext getFontRenderContext ()
{
- throw new java.lang.UnsupportedOperationException ();
+ return new FontRenderContext (transform, true, true);
}
public void drawGlyphVector (GlyphVector g, float x, float y)
{
- cairoSave ();
- cairoTranslate ((double)x, (double)y);
+ stateSave ();
+ setFont (g.getFont ());
+ translate ((double)x, (double)y);
+ cairoMoveTo (0, 0);
int nglyphs = g.getNumGlyphs ();
int codes[] = g.getGlyphCodes (0, nglyphs, (int []) null);
float posns[] = g.getGlyphPositions (0, nglyphs, (float []) null);
- cairoShowGlyphs (codes, posns, nglyphs);
- cairoRestore ();
+ cairoShowGlyphs (codes, posns);
+ stateRestore ();
}
public void copyArea (int x, int y, int width, int height, int dx, int dy)
@@ -1048,7 +1128,10 @@ public class GdkGraphics2D extends Graphics2D
public void drawArc (int x, int y, int width, int height,
int startAngle, int arcAngle)
{
- throw new java.lang.UnsupportedOperationException ();
+ draw (new Arc2D.Double((double)x, (double)y,
+ (double)width, (double)height,
+ (double)startAngle, (double)arcAngle,
+ Arc2D.OPEN));
}
public boolean drawImage (Image img, int x, int y, Color bgcolor,
@@ -1085,61 +1168,84 @@ public class GdkGraphics2D extends Graphics2D
public void drawOval(int x, int y, int width, int height)
{
- throw new java.lang.UnsupportedOperationException ();
+ drawArc (x, y, width, height, 0, 360);
}
public void drawRoundRect(int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
- throw new java.lang.UnsupportedOperationException ();
+ int x1 = x + arcWidth, x2 = x + width - arcWidth;
+ int y1 = y + arcHeight, y2 = y + height - arcHeight;
+ fillRect (x1, y, x2 - x1, height);
+ fillRect (x, y1, width, y2 - y1);
+ fillArc (x, y, arcWidth, arcHeight, 90, 90);
+ fillArc (x1, y, arcWidth, arcHeight, 0, 90);
+ fillArc (x2, y2, arcWidth, arcHeight, 270, 90);
+ fillArc (x, y2, arcWidth, arcHeight, 180, 90);
}
public void drawString (String str, int x, int y)
{
- throw new java.lang.UnsupportedOperationException ();
+ drawString (str, (float)x, (float)y);
+ }
+
+ public void drawString (String str, float x, float y)
+ {
+ GlyphVector gv = font.createGlyphVector (getFontRenderContext(), str);
+ drawGlyphVector (gv, x, y);
}
public void drawString (AttributedCharacterIterator ci, int x, int y)
{
- throw new java.lang.UnsupportedOperationException ();
+ drawString (ci, (float)x, (float)y);
+ }
+
+ public void drawString (AttributedCharacterIterator ci, float x, float y)
+ {
+ GlyphVector gv = font.createGlyphVector (getFontRenderContext(), ci);
+ drawGlyphVector (gv, x, y);
}
public void fillArc (int x, int y, int width, int height,
int startAngle, int arcAngle)
{
- cairoNewPath ();
- walkPath (new Arc2D.Double((double)x, (double)y,
- (double)width, (double)height,
- (double)startAngle, (double)arcAngle,
- Arc2D.PIE).getPathIterator (null));
- cairoClosePath ();
- cairoFill ();
+ fill (new Arc2D.Double((double)x, (double)y,
+ (double)width, (double)height,
+ (double)startAngle, (double)arcAngle,
+ Arc2D.OPEN));
}
public void fillOval(int x, int y, int width, int height)
{
- throw new java.lang.UnsupportedOperationException ();
+ fillArc (x, y, width, height, 0, 360);
}
public void fillRoundRect (int x, int y, int width, int height,
int arcWidth, int arcHeight)
{
- throw new java.lang.UnsupportedOperationException ();
+ int x1 = x + arcWidth, x2 = x + width - arcWidth;
+ int y1 = y + arcHeight, y2 = y + height - arcHeight;
+ fillRect (x1, y, x2 - x1, height);
+ fillRect (x, y1, width, y2 - y1);
+ fillArc (x, y, arcWidth, arcHeight, 90, 90);
+ fillArc (x1, y, arcWidth, arcHeight, 0, 90);
+ fillArc (x2, y2, arcWidth, arcHeight, 270, 90);
+ fillArc (x, y2, arcWidth, arcHeight, 180, 90);
}
public Font getFont ()
{
- throw new java.lang.UnsupportedOperationException ();
+ return font;
}
public FontMetrics getFontMetrics ()
{
- throw new java.lang.UnsupportedOperationException ();
+ return Toolkit.getDefaultToolkit ().getFontMetrics (font);
}
public FontMetrics getFontMetrics (Font f)
{
- throw new java.lang.UnsupportedOperationException ();
+ return Toolkit.getDefaultToolkit ().getFontMetrics (f);
}
public void setFont (Font f)
diff --git a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
index 55f3338006e..766ceb8fc3c 100644
--- a/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
+++ b/libjava/gnu/java/awt/peer/gtk/GdkPixbufDecoder.java
@@ -41,6 +41,7 @@ package gnu.java.awt.peer.gtk;
import java.awt.image.*;
import java.io.FileDescriptor;
import java.io.FileInputStream;
+import java.io.InputStream;
import java.io.IOException;
import java.net.URL;
import java.util.Vector;
@@ -85,6 +86,12 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
initState ();
}
+ public GdkPixbufDecoder (byte[] imagedata, int imageoffset, int imagelength)
+ {
+ super (imagedata, imageoffset, imagelength);
+ initState ();
+ }
+
// called back by native side
void areaPrepared (int width, int height)
{
@@ -122,7 +129,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
// this object, feeding back decoded pixel blocks, which we pass to each
// of the ImageConsumers in the provided Vector.
- void produce (Vector v, FileInputStream is) throws IOException
+ public void produce (Vector v, InputStream is) throws IOException
{
curr = v;
@@ -145,7 +152,7 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
// this ought to be fairly straightforward, but it does not appear
// anywhere else I can find.
- private class BufferedImageBuilder implements ImageConsumer
+ private static class BufferedImageBuilder implements ImageConsumer
{
BufferedImage bufferedImage;
ColorModel defaultModel;
@@ -213,5 +220,4 @@ public class GdkPixbufDecoder extends gnu.java.awt.image.ImageDecoder
dec.startProduction (bb);
return bb.getBufferedImage ();
}
-
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
index 0801f9c6ec0..9a832265b34 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkButtonPeer.java
@@ -50,6 +50,8 @@ public class GtkButtonPeer extends GtkComponentPeer
implements ButtonPeer
{
native void create ();
+ public native void connectJObject ();
+ public native void connectSignals ();
native void gtkSetFont(String name, int style, int size);
native void gtkWidgetSetForeground (int red, int green, int blue);
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
index 67469c93176..fba8c8ff8f9 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkCheckboxPeer.java
@@ -1,5 +1,5 @@
/* GtkCheckboxPeer.java -- Implements CheckboxPeer with GTK
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -48,10 +48,13 @@ public class GtkCheckboxPeer extends GtkComponentPeer
{
// Group from last time it was set.
public GtkCheckboxGroupPeer old_group;
+ // The current state of the GTK checkbox.
+ private boolean currentState;
- public native void nativeCreate (GtkCheckboxGroupPeer group);
+ public native void nativeCreate (GtkCheckboxGroupPeer group,
+ boolean state);
public native void nativeSetCheckboxGroup (GtkCheckboxGroupPeer group);
- public native void connectHooks ();
+ public native void connectSignals ();
public GtkCheckboxPeer (Checkbox c)
{
@@ -66,12 +69,14 @@ public class GtkCheckboxPeer extends GtkComponentPeer
{
CheckboxGroup g = ((Checkbox) awtComponent).getCheckboxGroup ();
old_group = GtkCheckboxGroupPeer.getCheckboxGroupPeer (g);
- nativeCreate (old_group);
+ currentState = ((Checkbox)awtComponent).getState();
+ nativeCreate (old_group, currentState);
}
public void setState (boolean state)
{
- set ("active", state);
+ if (currentState != state)
+ set ("active", state);
}
public void setLabel (String label)
@@ -103,7 +108,19 @@ public class GtkCheckboxPeer extends GtkComponentPeer
// need information that we have.
public void postItemEvent (Object item, int stateChange)
{
- super.postItemEvent (awtComponent, stateChange);
+ Checkbox currentCheckBox = ((Checkbox)awtComponent);
+ // A firing of the event is only desired if the state has changed due to a
+ // button press. The currentCheckBox's state must be different from the
+ // one that the stateChange is changing to.
+ // stateChange = 1 if it goes from false -> true
+ // stateChange = 2 if it goes from true -> false
+ if (( !currentCheckBox.getState() && stateChange == 1)
+ || (currentCheckBox.getState() && stateChange == 2))
+ {
+ super.postItemEvent (awtComponent, stateChange);
+ currentState = !currentCheckBox.getState();
+ currentCheckBox.setState(currentState);
+ }
}
public void dispose ()
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
index c4398e5041c..7e5579b3bc7 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkChoicePeer.java
@@ -84,10 +84,10 @@ public class GtkChoicePeer extends GtkComponentPeer
}
*/
- protected void postItemEvent (Object item, int stateChange)
+ protected void choicePostItemEvent (String label, int stateChange)
{
if (stateChange == ItemEvent.SELECTED)
- ((Choice) awtComponent).select ((String) item);
- super.postItemEvent (item, stateChange);
+ ((Choice) awtComponent).select (label);
+ super.postItemEvent (label, stateChange);
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
index f3676f3a7aa..4e216f8770e 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkComponentPeer.java
@@ -99,7 +99,8 @@ public class GtkComponentPeer extends GtkGenericPeer
insets = new Insets (0, 0, 0, 0);
}
- native void connectHooks ();
+ native void connectJObject ();
+ native void connectSignals ();
protected GtkComponentPeer (Component awtComponent)
{
@@ -114,7 +115,8 @@ public class GtkComponentPeer extends GtkGenericPeer
getArgs (awtComponent, args);
args.setArgs (this);
- connectHooks ();
+ connectJObject ();
+ connectSignals ();
if (awtComponent.getForeground () != null)
setForeground (awtComponent.getForeground ());
@@ -242,13 +244,12 @@ public class GtkComponentPeer extends GtkGenericPeer
PrepareImage (GtkImage image, ImageObserver observer)
{
this.image = image;
- this.observer = observer;
+ image.setObserver (observer);
}
public void run ()
{
- // XXX: need to return data to image observer
- image.source.startProduction (null);
+ image.source.startProduction (image);
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
index 5225ccc5f14..8ab37341917 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkContainerPeer.java
@@ -107,6 +107,11 @@ public class GtkContainerPeer extends GtkComponentPeer
try
{
Graphics g = getGraphics ();
+
+ // Some peers like GtkFileDialogPeer are repainted by Gtk itself
+ if (g == null)
+ break;
+
g.setClip (((PaintEvent)event).getUpdateRect());
if (id == PaintEvent.PAINT)
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
index 64e73c68a86..07422ace79b 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkFileDialogPeer.java
@@ -58,7 +58,7 @@ public class GtkFileDialogPeer extends GtkDialogPeer implements FileDialogPeer
}
public native void setFile (String file);
- public native void connectHooks ();
+ public native void connectJObject ();
public void setFilenameFilter (FilenameFilter filter)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkImage.java b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
index 6252a506f0d..fa81b912589 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkImage.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkImage.java
@@ -1,5 +1,5 @@
/* GtkImage.java
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -60,6 +60,7 @@ public class GtkImage extends Image implements ImageConsumer
Vector propertyObservers = new Vector ();
ImageProducer source;
+ ImageObserver observer;
Graphics g;
/* Variables in which we stored cached data, if possible.
@@ -79,9 +80,15 @@ public class GtkImage extends Image implements ImageConsumer
source = producer;
this.g = g;
- source.addConsumer (this);
+ if (source != null)
+ source.addConsumer (this);
}
-
+
+ public void setObserver (ImageObserver observer)
+ {
+ this.observer = observer;
+ }
+
public synchronized int
getWidth (ImageObserver observer)
{
@@ -135,8 +142,11 @@ public class GtkImage extends Image implements ImageConsumer
pixelCache = null;
model = null;
- source.removeConsumer (this);
- source.addConsumer (this);
+ if (source != null)
+ {
+ source.removeConsumer (this);
+ source.addConsumer (this);
+ }
}
public boolean
@@ -158,14 +168,22 @@ public class GtkImage extends Image implements ImageConsumer
for (int i = 0; i < widthObservers.size (); i++)
{
ImageObserver io = (ImageObserver) widthObservers.elementAt (i);
- io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height);
+ if (io != null)
+ io.imageUpdate (this, ImageObserver.WIDTH, -1, -1, width, height);
}
for (int i = 0; i < heightObservers.size (); i++)
{
ImageObserver io = (ImageObserver) heightObservers.elementAt (i);
- io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
+ if (io != null)
+ io.imageUpdate (this, ImageObserver.HEIGHT, -1, -1, width, height);
}
+
+ if (observer != null)
+ observer.imageUpdate (this,
+ (ImageObserver.WIDTH
+ | ImageObserver.HEIGHT),
+ -1, -1, width, height);
}
public synchronized void
@@ -176,7 +194,8 @@ public class GtkImage extends Image implements ImageConsumer
for (int i = 0; i < propertyObservers.size (); i++)
{
ImageObserver io = (ImageObserver) propertyObservers.elementAt (i);
- io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height);
+ if (io != null)
+ io.imageUpdate (this, ImageObserver.PROPERTIES, -1, -1, width, height);
}
}
@@ -200,6 +219,11 @@ public class GtkImage extends Image implements ImageConsumer
{
setPixels (x, y, width, height, cm, convertPixels (pixels), offset,
scansize);
+
+ if (observer != null)
+ observer.imageUpdate (this,
+ ImageObserver.SOMEBITS,
+ x, y, width, height);
}
public synchronized void
@@ -241,7 +265,20 @@ public class GtkImage extends Image implements ImageConsumer
if (status == ImageConsumer.SINGLEFRAMEDONE)
isCacheable = false;
- source.removeConsumer (this);
+ if (observer != null)
+ {
+ if (status == ImageConsumer.IMAGEERROR)
+ observer.imageUpdate (null,
+ ImageObserver.ERROR,
+ -1, -1, -1, -1);
+ else
+ observer.imageUpdate (null,
+ ImageObserver.ALLBITS,
+ -1, -1, -1, -1);
+ }
+
+ if (source != null)
+ source.removeConsumer (this);
}
public synchronized void
@@ -254,8 +291,11 @@ public class GtkImage extends Image implements ImageConsumer
}
else
{
- source.startProduction (painter);
- source.removeConsumer (painter);
+ if (source != null)
+ {
+ source.startProduction (painter);
+ source.removeConsumer (painter);
+ }
}
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
index e70be2b4ef4..b0a9ff79952 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkLabelPeer.java
@@ -45,21 +45,25 @@ import java.awt.peer.LabelPeer;
public class GtkLabelPeer extends GtkComponentPeer
implements LabelPeer
{
- native void create ();
+ void create ()
+ {
+ Label label = (Label) awtComponent;
+ create (label.getText (), getGtkAlignment (label.getAlignment ()));
+ }
+
+ native void create (String text, float alignment);
public GtkLabelPeer (Label l)
{
super (l);
}
-
- public void setText (String text)
- {
- set ("label", text);
- }
+ native public void setText (String text);
+
+ native void nativeSetAlignment (float alignment);
public void setAlignment (int alignment)
{
- set ("xalign", getGtkAlignment (alignment));
+ nativeSetAlignment (getGtkAlignment (alignment));
}
float getGtkAlignment (int alignment)
@@ -76,15 +80,4 @@ public class GtkLabelPeer extends GtkComponentPeer
return 0.0f;
}
-
- public void getArgs (Component component, GtkArgList args)
- {
- super.getArgs (component, args);
-
- Label label = (Label) component;
-
- args.add ("label", label.getText ());
- args.add ("xalign", getGtkAlignment (label.getAlignment ()));
- args.add ("yalign", 0.5f);
- }
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
index 2ba183b09ea..ac2c361495a 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkListPeer.java
@@ -38,8 +38,11 @@ exception statement from your version. */
package gnu.java.awt.peer.gtk;
+import java.awt.AWTEvent;
import java.awt.Dimension;
import java.awt.List;
+import java.awt.event.MouseEvent;
+import java.awt.event.KeyEvent;
import java.awt.peer.ListPeer;
public class GtkListPeer extends GtkComponentPeer
@@ -48,7 +51,8 @@ public class GtkListPeer extends GtkComponentPeer
// native void create (ComponentPeer parent, String [] items, boolean mode);
native void create ();
- native void connectHooks ();
+ native void connectJObject ();
+ native void connectSignals ();
native void getSize (int rows, int dims[]);
@@ -121,6 +125,43 @@ public class GtkListPeer extends GtkComponentPeer
setMultipleMode (b);
}
+ public void handleEvent (AWTEvent e)
+ {
+ if (e.getID () == MouseEvent.MOUSE_CLICKED && isEnabled ())
+ {
+ /* Only generate the ActionEvent on the second click of
+ a multiple click */
+ MouseEvent me = (MouseEvent) e;
+ if (!me.isConsumed ()
+ && (me.getModifiers () & MouseEvent.BUTTON1_MASK) != 0
+ && me.getClickCount() == 2)
+ {
+ String selectedItem = ((List)awtComponent).getSelectedItem ();
+
+ /* Double-click only generates an Action event
+ if something is selected */
+ if (selectedItem != null)
+ postActionEvent (((List)awtComponent).getSelectedItem (),
+ me.getModifiers ());
+ }
+ }
+
+ if (e.getID () == KeyEvent.KEY_PRESSED)
+ {
+ KeyEvent ke = (KeyEvent) e;
+ if (!ke.isConsumed () && ke.getKeyCode () == KeyEvent.VK_ENTER)
+ {
+ String selectedItem = ((List)awtComponent).getSelectedItem ();
+
+ /* Enter only generates an Action event if something is selected */
+ if (selectedItem != null)
+ postActionEvent (selectedItem, ke.getModifiers ());
+ }
+ }
+
+ super.handleEvent (e);
+ }
+
protected void postItemEvent (int item, int stateChange)
{
postItemEvent (new Integer (item), stateChange);
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
index cf7a9e1bade..4f77994931d 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkPanelPeer.java
@@ -45,7 +45,8 @@ public class GtkPanelPeer extends GtkContainerPeer
implements PanelPeer
{
native void create ();
- native void connectHooks ();
+ native void connectJObject ();
+ native void connectSignals ();
public GtkPanelPeer (Panel p)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
index d13e34edfe8..0e1b65137d7 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkScrollbarPeer.java
@@ -60,7 +60,8 @@ public class GtkScrollbarPeer extends GtkComponentPeer
int min, int max, int stepIncr, int pageIncr,
int visibleAmount);
- native void connectHooks ();
+ native void connectJObject ();
+ native void connectSignals ();
public GtkScrollbarPeer (Scrollbar s)
{
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
index b3199d87c9a..8bc4bdf3eee 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkTextComponentPeer.java
@@ -56,7 +56,7 @@ public class GtkTextComponentPeer extends GtkComponentPeer
setText (tc.getText ());
}
- public native void connectHooks ();
+ public native void connectSignals ();
public native int getCaretPosition ();
public native void setCaretPosition (int pos);
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
index 9f669ac5281..0a09f1f1970 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkToolkit.java
@@ -56,6 +56,7 @@ import gnu.java.awt.EmbeddedWindow;
import gnu.java.awt.EmbeddedWindowSupport;
import gnu.java.awt.peer.EmbeddedWindowPeer;
import gnu.classpath.Configuration;
+import gnu.java.awt.peer.gtk.GdkPixbufDecoder;
/* This class uses a deprecated method java.awt.peer.ComponentPeer.getPeer().
This merits comment. We are basically calling Sun's bluff on this one.
@@ -91,24 +92,17 @@ public class GtkToolkit extends Toolkit
public int checkImage (Image image, int width, int height,
ImageObserver observer)
{
- return ImageObserver.ALLBITS;
-
-// GtkImage i = (GtkImage) image;
-// return i.checkImage ();
+ return ((GtkImage) image).checkImage ();
}
public Image createImage (String filename)
{
- // FIXME - gcj local: GdkPixbufDecoder doesn't work.
- // return new GtkImage (new GdkPixbufDecoder (filename), null);
- return null;
+ return new GtkImage (new GdkPixbufDecoder (filename), null);
}
public Image createImage (URL url)
{
- // FIXME - gcj local: GdkPixbufDecoder doesn't work.
- // return new GtkImage (new GdkPixbufDecoder (url), null);
- return null;
+ return new GtkImage (new GdkPixbufDecoder (url), null);
}
public Image createImage (ImageProducer producer)
@@ -117,10 +111,12 @@ public class GtkToolkit extends Toolkit
}
public Image createImage (byte[] imagedata, int imageoffset,
- int imagelength)
+ int imagelength)
{
- // System.out.println ("createImage byte[] NOT SUPPORTED");
- return null;
+ return new GtkImage (new GdkPixbufDecoder (imagedata,
+ imageoffset,
+ imagelength),
+ null);
}
public ColorModel getColorModel ()
@@ -144,16 +140,12 @@ public class GtkToolkit extends Toolkit
public Image getImage (String filename)
{
- // FIXME - gcj local: GdkPixbufDecoder doesn't work.
- // return new GtkImage (new GdkPixbufDecoder (filename), null);
- return null;
+ return new GtkImage (new GdkPixbufDecoder (filename), null);
}
public Image getImage (URL url)
{
- // FIXME - gcj local: GdkPixbufDecoder doesn't work.
- // return new GtkImage (new GdkPixbufDecoder (url), null);
- return null;
+ return new GtkImage (new GdkPixbufDecoder (url), null);
}
public PrintJob getPrintJob (Frame frame, String jobtitle, Properties props)
@@ -177,6 +169,28 @@ public class GtkToolkit extends Toolkit
public boolean prepareImage (Image image, int width, int height,
ImageObserver observer)
{
+ GtkImage i = (GtkImage) image;
+
+ if (i.isLoaded ()) return true;
+
+ class PrepareImage extends Thread
+ {
+ GtkImage image;
+ ImageObserver observer;
+
+ PrepareImage (GtkImage image, ImageObserver observer)
+ {
+ this.image = image;
+ image.setObserver (observer);
+ }
+
+ public void run ()
+ {
+ image.source.startProduction (image);
+ }
+ }
+
+ new PrepareImage (i, observer).start ();
return false;
}
diff --git a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
index 821afa929f1..4a2d50805a1 100644
--- a/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
+++ b/libjava/gnu/java/awt/peer/gtk/GtkWindowPeer.java
@@ -93,7 +93,8 @@ public class GtkWindowPeer extends GtkContainerPeer
create (GDK_WINDOW_TYPE_HINT_NORMAL, false);
}
- native void connectHooks ();
+ native void connectJObject ();
+ native void connectSignals ();
public GtkWindowPeer (Window window)
{
diff --git a/libjava/gnu/java/beans/IntrospectionIncubator.java b/libjava/gnu/java/beans/IntrospectionIncubator.java
index c853fd7d7af..1b853971aa4 100644
--- a/libjava/gnu/java/beans/IntrospectionIncubator.java
+++ b/libjava/gnu/java/beans/IntrospectionIncubator.java
@@ -67,7 +67,7 @@ public class IntrospectionIncubator {
/* Paving the way for automatic Introspection */
public void addMethod(Method method) {
- if(Modifier.isPublic(method.getModifiers()) && !Modifier.isStatic(method.getModifiers())) {
+ if(Modifier.isPublic(method.getModifiers())) {
String name = ClassHelper.getTruncatedName(method.getName());
Class retType = method.getReturnType();
Class[] params = method.getParameterTypes();
diff --git a/libjava/gnu/java/lang/reflect/TypeSignature.java b/libjava/gnu/java/lang/reflect/TypeSignature.java
index e9c8861c611..1cf55a698e9 100644
--- a/libjava/gnu/java/lang/reflect/TypeSignature.java
+++ b/libjava/gnu/java/lang/reflect/TypeSignature.java
@@ -1,5 +1,5 @@
/* TypeSignature.java -- Class used to compute type signatures
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -150,6 +150,29 @@ public class TypeSignature
public static Class getClassForEncoding(String type_code, boolean descriptor)
throws ClassNotFoundException
{
+ return getClassForEncoding(type_code, descriptor, null);
+ }
+
+ /**
+ * This function is the inverse of <code>getEncodingOfClass</code>. This
+ * accepts both object and descriptor formats, but must know which style
+ * of string is being passed in (usually, descriptor should be true).In
+ * descriptor format, "I" is treated as int.class, in object format, it
+ * is treated as a class named I in the unnamed package. It also
+ * accepts a <code>ClassLoader</code>, which is used to load the class.
+ *
+ * @param type_code the class name to decode
+ * @param descriptor if the string is in descriptor format
+ * @param loader the class loader used to load the class
+ * @return the corresponding Class object
+ * @throws ClassNotFoundException if the class cannot be located
+ * @see #getEncodingOfClass(Class, boolean)
+ * @see #getClassForEncoding(String, boolean)
+ */
+ public static Class getClassForEncoding(String type_code, boolean descriptor,
+ ClassLoader loader)
+ throws ClassNotFoundException
+ {
if (descriptor)
{
switch (type_code.charAt(0))
diff --git a/libjava/gnu/java/net/HeaderFieldHelper.java b/libjava/gnu/java/net/HeaderFieldHelper.java
new file mode 100644
index 00000000000..2bcfd17fd7d
--- /dev/null
+++ b/libjava/gnu/java/net/HeaderFieldHelper.java
@@ -0,0 +1,138 @@
+/* HeaderFieldHelper.java -- Helps manage headers fields
+ Copyright (C) 1998, 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.net;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Vector;
+
+/**
+ * This class manages header field keys and values.
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
+ */
+public class HeaderFieldHelper
+{
+ private Vector headerFieldKeys;
+ private Vector headerFieldValues;
+
+ public HeaderFieldHelper()
+ {
+ this (10);
+ }
+
+ public HeaderFieldHelper (int size)
+ {
+ headerFieldKeys = new Vector (size);
+ headerFieldValues = new Vector (size);
+ }
+
+ public void addHeaderField (String key, String value)
+ {
+ headerFieldKeys.addElement (key);
+ headerFieldValues.addElement (value);
+ }
+
+ public String getHeaderFieldKeyByIndex (int index)
+ {
+ String key = null;
+
+ try
+ {
+ key = (String) headerFieldKeys.elementAt (index);
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ }
+
+ return key;
+ }
+
+ public String getHeaderFieldValueByIndex(int index)
+ {
+ String value = null;
+
+ try
+ {
+ value = (String) headerFieldValues.elementAt (index);
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ }
+
+ return value;
+ }
+
+ public String getHeaderFieldValueByKey(String key)
+ {
+ String value = null;
+
+ try
+ {
+ value = (String) headerFieldValues.elementAt
+ (headerFieldKeys.indexOf(key));
+ }
+ catch (ArrayIndexOutOfBoundsException e)
+ {
+ }
+
+ return value;
+ }
+
+ public Map getHeaderFields()
+ {
+ HashMap headers = new HashMap();
+ int max = headerFieldKeys.size();
+
+ for (int index = 0; index < max; index++)
+ {
+ headers.put(headerFieldKeys.elementAt(index),
+ headerFieldValues.elementAt(index));
+ }
+
+ return headers;
+ }
+
+ public int getNumberOfEntries()
+ {
+ return headerFieldKeys.size();
+ }
+
+} // class HeaderFieldHelper
+
diff --git a/libjava/gnu/java/net/PlainDatagramSocketImpl.java b/libjava/gnu/java/net/PlainDatagramSocketImpl.java
index 9f710d37b4c..a3146518783 100644
--- a/libjava/gnu/java/net/PlainDatagramSocketImpl.java
+++ b/libjava/gnu/java/net/PlainDatagramSocketImpl.java
@@ -211,8 +211,21 @@ public final class PlainDatagramSocketImpl extends DatagramSocketImpl
*/
public native Object getOption(int optID) throws SocketException;
- private native void mcastGrp(InetAddress inetaddr, NetworkInterface netIf,
- boolean join) throws IOException;
+ /**
+ * Joins or leaves a broadcasting group on a given network interface.
+ * If the network interface is <code>null</code> the group is join/left on
+ * all locale network interfaces.
+ *
+ * @param inetAddr The broadcast address.
+ * @param netIf The network interface to join the group on.
+ * @param join True to join a broadcasting group, fals to leave it.
+ *
+ * @exception IOException If an error occurs.
+ */
+ private native void mcastGrp(InetAddress inetAddr,
+ NetworkInterface netIf,
+ boolean join)
+ throws IOException;
/**
* Closes the socket
diff --git a/libjava/gnu/java/net/URLParseError.java b/libjava/gnu/java/net/URLParseError.java
new file mode 100644
index 00000000000..95eed65ddcd
--- /dev/null
+++ b/libjava/gnu/java/net/URLParseError.java
@@ -0,0 +1,57 @@
+/* URLParseError.java -- Helps bypassing the exception limitation for
+ URLStreamHandler.parseURL().
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.net;
+
+/**
+ * This class helps the people writing protocols to report URL parse
+ * errors in parseUrl as this method cannot report other exceptions
+ * than Errors.
+ *
+ * The main drawback is that it uses the Error mechanism which should not
+ * be used for that type of error reporting.
+ *
+ * @author Guilhem Lavaux <guilhem@kaffe.org>
+ */
+public class URLParseError extends Error
+{
+ public URLParseError(String msg)
+ {
+ super(msg);
+ }
+}
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
index 65d083c0970..e51c7646ae9 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplPosix.cc
@@ -29,6 +29,7 @@ details. */
#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/SocketException.h>
+#include <java/net/SocketTimeoutException.h>
#include <java/net/InetAddress.h>
#include <java/net/NetworkInterface.h>
#include <java/net/DatagramPacket.h>
@@ -208,7 +209,8 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
// FIXME: Deal with Multicast and if the socket is connected.
union SockAddr u;
socklen_t addrlen = sizeof(u);
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
// Do timeouts via select since SO_RCVTIMEO is not always available.
@@ -224,11 +226,12 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
if ((retval = _Jv_select (native_fd + 1, &rset, NULL, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
- throw new ::java::io::InterruptedIOException ();
+ throw new ::java::net::SocketTimeoutException
+ (JvNewStringUTF ("PeekData timed out") );
}
retlen =
- ::recvfrom (native_fd, (char *) dbytes, p->getLength(), MSG_PEEK, (sockaddr*) &u,
+ ::recvfrom (native_fd, (char *) dbytes, maxlen, MSG_PEEK, (sockaddr*) &u,
&addrlen);
if (retlen < 0)
goto error;
@@ -254,7 +257,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData (::java::net::DatagramPacket *
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (int) retlen;
return rport;
error:
@@ -290,7 +293,7 @@ gnu::java::net::PlainDatagramSocketImpl::send (::java::net::DatagramPacket *p)
jbyte *bytes = elements (haddress);
int len = haddress->length;
struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
if (len == 4)
{
u.address.sin_family = AF_INET;
@@ -327,7 +330,8 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
// FIXME: Deal with Multicast and if the socket is connected.
union SockAddr u;
socklen_t addrlen = sizeof(u);
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
// Do timeouts via select since SO_RCVTIMEO is not always available.
@@ -343,11 +347,12 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
if ((retval = _Jv_select (native_fd + 1, &rset, NULL, NULL, &tv)) < 0)
goto error;
else if (retval == 0)
- throw new ::java::io::InterruptedIOException ();
+ throw new ::java::net::SocketTimeoutException
+ (JvNewStringUTF ("Receive timed out") );
}
retlen =
- ::recvfrom (native_fd, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
+ ::recvfrom (native_fd, (char *) dbytes, maxlen, 0, (sockaddr*) &u,
&addrlen);
if (retlen < 0)
goto error;
@@ -373,7 +378,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return;
error:
@@ -516,12 +521,12 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
if (::setsockopt (native_fd, SOL_SOCKET, SO_BROADCAST, (char *) &val,
val_len) != 0)
goto error;
- break;
+ return;
case _Jv_SO_OOBINLINE_ :
throw new ::java::net::SocketException (
JvNewStringUTF ("SO_OOBINLINE: not valid for UDP"));
- break;
+ return;
case _Jv_SO_SNDBUF_ :
case _Jv_SO_RCVBUF_ :
@@ -590,12 +595,12 @@ gnu::java::net::PlainDatagramSocketImpl::setOption (jint optID,
case _Jv_IP_MULTICAST_IF2_ :
throw new ::java::net::SocketException (
JvNewStringUTF ("IP_MULTICAST_IF2: not yet implemented"));
- break;
+ return;
case _Jv_IP_MULTICAST_LOOP_ :
throw new ::java::net::SocketException (
JvNewStringUTF ("IP_MULTICAST_LOOP: not yet implemented"));
- break;
+ return;
case _Jv_IP_TOS_ :
if (::setsockopt (native_fd, SOL_SOCKET, IP_TOS, (char *) &val,
diff --git a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
index 1098e6158a8..d3534791801 100644
--- a/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
+++ b/libjava/gnu/java/net/natPlainDatagramSocketImplWin32.cc
@@ -17,7 +17,6 @@ details. */
#include <gnu/java/net/PlainDatagramSocketImpl.h>
#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/SocketException.h>
#include <java/net/InetAddress.h>
@@ -69,11 +68,14 @@ gnu::java::net::PlainDatagramSocketImpl::create ()
_Jv_ThrowSocketException ();
}
- _Jv_platform_close_on_exec (sock);
+ // Cast this to a HANDLE so we can make
+ // it non-inheritable via _Jv_platform_close_on_exec.
+ HANDLE hSocket = (HANDLE) sock;
+ _Jv_platform_close_on_exec (hSocket);
// We use native_fd in place of fd here. From leaving fd null we avoid
// the double close problem in FileDescriptor.finalize.
- native_fd = (int) sock;
+ native_fd = (jint) hSocket;
}
void
@@ -199,7 +201,8 @@ gnu::java::net::PlainDatagramSocketImpl::peekData(::java::net::DatagramPacket *p
// FIXME: Deal with Multicast and if the socket is connected.
union SockAddr u;
socklen_t addrlen = sizeof(u);
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
if (timeout > 0)
@@ -211,7 +214,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData(::java::net::DatagramPacket *p
}
retlen =
- ::recvfrom (native_fd, (char *) dbytes, p->getLength(), MSG_PEEK, (sockaddr*) &u,
+ ::recvfrom (native_fd, (char *) dbytes, maxlen, MSG_PEEK, (sockaddr*) &u,
&addrlen);
if (retlen == SOCKET_ERROR)
goto error;
@@ -237,7 +240,7 @@ gnu::java::net::PlainDatagramSocketImpl::peekData(::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return rport;
error:
@@ -277,7 +280,7 @@ gnu::java::net::PlainDatagramSocketImpl::send (::java::net::DatagramPacket *p)
jbyte *bytes = elements (haddress);
int len = haddress->length;
struct sockaddr *ptr = (struct sockaddr *) &u.address;
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
if (len == 4)
{
u.address.sin_family = AF_INET;
@@ -313,7 +316,8 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
// FIXME: Deal with Multicast and if the socket is connected.
union SockAddr u;
socklen_t addrlen = sizeof(u);
- jbyte *dbytes = elements (p->getData());
+ jbyte *dbytes = elements (p->getData()) + p->getOffset();
+ jint maxlen = p->maxlen - p->getOffset();
ssize_t retlen = 0;
if (timeout > 0)
@@ -328,7 +332,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
}
retlen =
- ::recvfrom (native_fd, (char *) dbytes, p->getLength(), 0, (sockaddr*) &u,
+ ::recvfrom (native_fd, (char *) dbytes, maxlen, 0, (sockaddr*) &u,
&addrlen);
if (retlen < 0)
goto error;
@@ -354,7 +358,7 @@ gnu::java::net::PlainDatagramSocketImpl::receive (::java::net::DatagramPacket *p
p->setAddress (new ::java::net::InetAddress (raddr, NULL));
p->setPort (rport);
- p->setLength ((jint) retlen);
+ p->length = (jint) retlen;
return;
error:
diff --git a/libjava/gnu/java/net/natPlainSocketImplPosix.cc b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
index 8a09f9af595..c02d5a0f047 100644
--- a/libjava/gnu/java/net/natPlainSocketImplPosix.cc
+++ b/libjava/gnu/java/net/natPlainSocketImplPosix.cc
@@ -117,7 +117,6 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
if (_Jv_bind (native_fd, ptr, len) == 0)
{
- address = host;
socklen_t addrlen = sizeof(u);
if (lport != 0)
@@ -409,7 +408,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(void)
// that means we've timed out.
if (sel_retval == 0)
throw new ::java::net::SocketTimeoutException
- (JvNewStringUTF ("read timed out") );
+ (JvNewStringUTF ("Read timed out") );
// If select returns ok we know we either got signalled or read some data...
// either way we need to try to read.
}
@@ -423,7 +422,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(void)
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
- (JvNewStringUTF("read interrupted"));
+ (JvNewStringUTF("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
@@ -479,7 +478,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(jbyteArray buffer, jint
{
::java::net::SocketTimeoutException *timeoutException =
new ::java::net::SocketTimeoutException
- (JvNewStringUTF ("read timed out"));
+ (JvNewStringUTF ("Read timed out"));
throw timeoutException;
}
}
@@ -494,7 +493,7 @@ gnu::java::net::PlainSocketImpl$SocketInputStream::read(jbyteArray buffer, jint
{
::java::io::InterruptedIOException *iioe =
new ::java::io::InterruptedIOException
- (JvNewStringUTF ("read interrupted"));
+ (JvNewStringUTF ("Read interrupted"));
iioe->bytesTransferred = r == -1 ? 0 : r;
throw iioe;
}
@@ -622,18 +621,18 @@ gnu::java::net::PlainSocketImpl::setOption (jint optID, ::java::lang::Object *va
if (::setsockopt (native_fd, SOL_SOCKET, SO_KEEPALIVE, (char *) &val,
val_len) != 0)
goto error;
- break;
+ return;
case _Jv_SO_BROADCAST_ :
throw new ::java::net::SocketException
(JvNewStringUTF ("SO_BROADCAST not valid for TCP"));
- break;
+ return;
case _Jv_SO_OOBINLINE_ :
if (::setsockopt (native_fd, SOL_SOCKET, SO_OOBINLINE, (char *) &val,
val_len) != 0)
goto error;
- break;
+ return;
case _Jv_SO_LINGER_ :
#ifdef SO_LINGER
@@ -676,18 +675,18 @@ gnu::java::net::PlainSocketImpl::setOption (jint optID, ::java::lang::Object *va
case _Jv_IP_MULTICAST_IF2_ :
throw new ::java::net::SocketException (
JvNewStringUTF ("IP_MULTICAST_IF2: not valid for TCP"));
- break;
+ return;
case _Jv_IP_MULTICAST_LOOP_ :
throw new ::java::net::SocketException (
JvNewStringUTF ("IP_MULTICAST_LOOP: not valid for TCP"));
- break;
+ return;
case _Jv_IP_TOS_ :
if (::setsockopt (native_fd, SOL_SOCKET, IP_TOS, (char *) &val,
val_len) != 0)
goto error;
- break;
+ return;
case _Jv_SO_REUSEADDR_ :
throw new ::java::net::SocketException (
diff --git a/libjava/gnu/java/net/natPlainSocketImplWin32.cc b/libjava/gnu/java/net/natPlainSocketImplWin32.cc
index 411acfa023a..c4a54a90c3a 100644
--- a/libjava/gnu/java/net/natPlainSocketImplWin32.cc
+++ b/libjava/gnu/java/net/natPlainSocketImplWin32.cc
@@ -17,7 +17,6 @@ details. */
#include <gnu/java/net/PlainSocketImpl$SocketInputStream.h>
#include <gnu/java/net/PlainSocketImpl$SocketOutputStream.h>
#include <java/io/IOException.h>
-#include <java/io/InterruptedIOException.h>
#include <java/net/BindException.h>
#include <java/net/ConnectException.h>
#include <java/net/InetAddress.h>
@@ -45,18 +44,21 @@ union SockAddr
void
gnu::java::net::PlainSocketImpl::create (jboolean stream)
{
- int sock = ::socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
+ SOCKET sock = ::socket (AF_INET, stream ? SOCK_STREAM : SOCK_DGRAM, 0);
- if (sock == int(INVALID_SOCKET))
+ if (sock == INVALID_SOCKET)
{
_Jv_ThrowIOException ();
}
- _Jv_platform_close_on_exec (sock);
+ // Cast this to a HANDLE so we can make
+ // it non-inheritable via _Jv_platform_close_on_exec.
+ HANDLE hSocket = (HANDLE) sock;
+ _Jv_platform_close_on_exec (hSocket);
// We use native_fd in place of fd here. From leaving fd null we avoid
// the double close problem in FileDescriptor.finalize.
- native_fd = sock;
+ native_fd = (jint) hSocket;
}
void
@@ -67,7 +69,6 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
jbyteArray haddress = host->addr;
jbyte *bytes = elements (haddress);
int len = haddress->length;
- int i = 1;
if (len == 4)
{
@@ -93,12 +94,8 @@ gnu::java::net::PlainSocketImpl::bind (::java::net::InetAddress *host, jint lpor
else
throw new ::java::net::SocketException (JvNewStringUTF ("invalid length"));
- // Enable SO_REUSEADDR, so that servers can reuse ports left in TIME_WAIT.
- ::setsockopt(native_fd, SOL_SOCKET, SO_REUSEADDR, (char *) &i, sizeof(i));
-
if (::bind (native_fd, ptr, len) != SOCKET_ERROR)
{
- address = host;
socklen_t addrlen = sizeof(u);
if (lport != 0)
@@ -178,9 +175,13 @@ gnu::java::net::PlainSocketImpl::connect (::java::net::SocketAddress *addr,
// use true, false instead of TRUE, FALSE because the
// MS constants got undefined
+ // Reset and ignore our thread's interrupted flag.
+ // It's not possible to interrupt these sort of
+ // operations on Win32 anyway.
+ ::java::lang::Thread::interrupted();
+
if (dwRet == WSA_WAIT_FAILED)
throwConnectException ();
-
else if (dwRet == WSA_WAIT_TIMEOUT)
throw new ::java::net::SocketTimeoutException
(JvNewStringUTF ("connect timed out"));
@@ -234,7 +235,8 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
{
union SockAddr u;
socklen_t addrlen = sizeof(u);
- int new_socket = 0;
+ HANDLE hSocket = 0;
+ SOCKET new_socket = 0;
if (timeout > 0)
{
@@ -249,7 +251,7 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
{
new_socket = ::accept (native_fd, (sockaddr*) &u, &addrlen);
- if (new_socket != int(INVALID_SOCKET))
+ if (new_socket != INVALID_SOCKET)
{
// This new child socket is nonblocking because the parent
// socket became nonblocking via the WSAEventSelect() call,
@@ -276,11 +278,14 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
// use true, false instead of TRUE, FALSE because the
// MS constants got undefined
+ // Reset and ignore our thread's interrupted flag.
+ ::java::lang::Thread::interrupted();
+
if (dwRet == WSA_WAIT_FAILED)
goto error;
else if (dwRet == WSA_WAIT_TIMEOUT)
throw new ::java::net::SocketTimeoutException
- (JvNewStringUTF ("accept timed out"));
+ (JvNewStringUTF ("Accept timed out"));
}
}
else
@@ -288,10 +293,13 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
new_socket = ::accept (native_fd, (sockaddr*) &u, &addrlen);
}
- if (new_socket == int(INVALID_SOCKET))
+ if (new_socket == INVALID_SOCKET)
goto error;
- _Jv_platform_close_on_exec (new_socket);
+ // Cast this to a HANDLE so we can make
+ // it non-inheritable via _Jv_platform_close_on_exec.
+ hSocket = (HANDLE) new_socket;
+ _Jv_platform_close_on_exec (hSocket);
jbyteArray raddr;
jint rport;
@@ -312,7 +320,7 @@ gnu::java::net::PlainSocketImpl::accept (gnu::java::net::PlainSocketImpl *s)
else
throw new ::java::net::SocketException (JvNewStringUTF ("invalid family"));
- s->native_fd = new_socket;
+ s->native_fd = (jint) hSocket;
s->localport = localport;
s->address = new ::java::net::InetAddress (raddr, NULL);
s->port = rport;
@@ -359,14 +367,12 @@ gnu::java::net::PlainSocketImpl$SocketOutputStream::write(jint b)
if (r == -1)
{
DWORD dwErr = WSAGetLastError();
- if (::java::lang::Thread::interrupted())
- {
- ::java::io::InterruptedIOException *iioe
- = new ::java::io::InterruptedIOException
- (_Jv_WinStrError (dwErr));
- iioe->bytesTransferred = 0;
- throw iioe;
- }
+
+ // Reset and ignore our thread's interrupted flag.
+ // It's not possible to interrupt these sort of
+ // operations on Win32 anyway.
+ ::java::lang::Thread::interrupted();
+
// Some errors should not cause exceptions.
if (dwErr != WSAENOTCONN && dwErr != WSAECONNRESET
&& dwErr != WSAENOTSOCK)
@@ -395,14 +401,10 @@ gnu::java::net::PlainSocketImpl$SocketOutputStream::write(jbyteArray b,
if (r == -1)
{
DWORD dwErr = WSAGetLastError();
- if (::java::lang::Thread::interrupted())
- {
- ::java::io::InterruptedIOException *iioe
- = new ::java::io::InterruptedIOException
- (_Jv_WinStrError (dwErr));
- iioe->bytesTransferred = written;
- throw iioe;
- }
+
+ // Reset and ignore our thread's interrupted flag.
+ ::java::lang::Thread::interrupted();
+
// Some errors should not cause exceptions.
if (dwErr != WSAENOTCONN && dwErr != WSAECONNRESET
&& dwErr != WSAENOTSOCK)
@@ -454,15 +456,10 @@ doRead(int native_fd, void* buf, int count, int timeout)
dwErrorCode = WSAGetLastError ();
// save WSAGetLastError() before calling Thread.interrupted()
- if (::java::lang::Thread::interrupted())
- {
- ::java::io::InterruptedIOException *iioe =
- new ::java::io::InterruptedIOException
- (JvNewStringUTF("read interrupted"));
- iioe->bytesTransferred = r == -1 ? 0 : r;
- throw iioe;
- }
- else if (r == -1)
+ // Reset and ignore our thread's interrupted flag.
+ ::java::lang::Thread::interrupted();
+
+ if (r == -1)
{
error:
// Some errors cause us to return end of stream...
@@ -472,7 +469,7 @@ error:
// Other errors need to be signalled.
if (dwErrorCode == WSAETIMEDOUT)
throw new ::java::net::SocketTimeoutException
- (JvNewStringUTF ("read timed out") );
+ (JvNewStringUTF ("Read timed out") );
else
_Jv_ThrowIOException (dwErrorCode);
}
diff --git a/libjava/gnu/java/net/protocol/file/Connection.java b/libjava/gnu/java/net/protocol/file/Connection.java
index 1df5c487c88..bd3c915a3d0 100644
--- a/libjava/gnu/java/net/protocol/file/Connection.java
+++ b/libjava/gnu/java/net/protocol/file/Connection.java
@@ -38,38 +38,71 @@
*/
package gnu.java.net.protocol.file;
-import java.net.URL;
-import java.net.URLConnection;
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
+import java.io.FilePermission;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.net.ProtocolException;
+import java.net.URL;
+import java.net.URLConnection;
+import java.security.Permission;
import java.util.Map;
import java.util.Vector;
import java.util.Hashtable;
import java.util.Enumeration;
/**
+ * This subclass of java.net.URLConnection models a URLConnection via
+ * the "file" protocol.
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
+ * @author Nic Ferrier <nferrier@tapsellferrier.co.uk>
* @author Warren Levy <warrenl@cygnus.com>
- * @date April 13, 1999.
*/
public class Connection extends URLConnection
{
+ /**
+ * Default permission for a file
+ */
+ private static final String DEFAULT_PERMISSION = "read";
+
+ /**
+ * This is a File object for this connection
+ */
+ private File file;
+
+ /**
+ * InputStream if we are reading from the file
+ */
+ private InputStream inputStream;
+
+ /**
+ * OutputStream if we are writing to the file
+ */
+ private OutputStream outputStream;
+
private Hashtable hdrHash = new Hashtable();
private Vector hdrVec = new Vector();
private boolean gotHeaders = false;
- private File fileIn;
- private InputStream inputStream;
- private OutputStream outputStream;
+ /**
+ * FilePermission to read the file
+ */
+ private FilePermission permission;
+
+ /**
+ * Calls superclass constructor to initialize.
+ */
public Connection(URL url)
{
super (url);
+
+ permission = new FilePermission(getURL().getFile(), DEFAULT_PERMISSION);
}
/**
@@ -82,12 +115,12 @@ public class Connection extends URLConnection
return;
// If not connected, then file needs to be openned.
- String fname = url.getFile();
- fileIn = new File(fname);
+ file = new File (getURL().getFile());
if (doInput)
- inputStream = new BufferedInputStream(new FileInputStream(fileIn));
+ inputStream = new BufferedInputStream(new FileInputStream(file));
+
if (doOutput)
- outputStream = new BufferedOutputStream(new FileOutputStream(fileIn));
+ outputStream = new BufferedOutputStream(new FileOutputStream(file));
connected = true;
}
@@ -102,8 +135,9 @@ public class Connection extends URLConnection
public InputStream getInputStream()
throws IOException
{
- if (! doInput)
+ if (!doInput)
throw new ProtocolException("Can't open InputStream if doInput is false");
+
if (!connected)
connect();
@@ -120,7 +154,7 @@ public class Connection extends URLConnection
public OutputStream getOutputStream()
throws IOException
{
- if (! doOutput)
+ if (!doOutput)
throw new
ProtocolException("Can't open OutputStream if doOutput is false");
@@ -130,7 +164,59 @@ public class Connection extends URLConnection
return outputStream;
}
- // Override default method in URLConnection.
+ /**
+ * Get the last modified time of the resource.
+ *
+ * @return the time since epoch that the resource was modified.
+ */
+ public long getLastModified()
+ {
+ try
+ {
+ if (!connected)
+ connect();
+
+ return file.lastModified();
+ }
+ catch (IOException e)
+ {
+ return -1;
+ }
+ }
+
+ /**
+ * Get the length of content.
+ *
+ * @return the length of the content.
+ */
+ public int getContentLength()
+ {
+ try
+ {
+ if (!connected)
+ connect();
+
+ return (int) file.length();
+ }
+ catch (IOException e)
+ {
+ return -1;
+ }
+ }
+
+ /**
+ * This method returns a <code>Permission</code> object representing the
+ * permissions required to access this URL. This method returns a
+ * <code>java.io.FilePermission</code> for the file's path with a read
+ * permission.
+ *
+ * @return A Permission object
+ */
+ public Permission getPermission() throws IOException
+ {
+ return permission;
+ }
+
public String getHeaderField(String name)
{
try
@@ -144,7 +230,6 @@ public class Connection extends URLConnection
return (String) hdrHash.get(name.toLowerCase());
}
- // Override default method in URLConnection.
public Map getHeaderFields()
{
try
@@ -158,7 +243,6 @@ public class Connection extends URLConnection
return hdrHash;
}
- // Override default method in URLConnection.
public String getHeaderField(int n)
{
try
@@ -175,7 +259,6 @@ public class Connection extends URLConnection
return null;
}
- // Override default method in URLConnection.
public String getHeaderFieldKey(int n)
{
try
@@ -227,7 +310,7 @@ public class Connection extends URLConnection
// to add others later and for consistency, we'll implement it this way.
// Add the only header we know about right now: Content-length.
- long len = fileIn.length();
+ long len = file.length();
String line = "Content-length: " + len;
hdrVec.addElement(line);
@@ -237,5 +320,5 @@ public class Connection extends URLConnection
String key = getKey(line);
hdrHash.put(key.toLowerCase(), Long.toString(len));
}
-
+
} // class FileURLConnection
diff --git a/libjava/gnu/java/net/protocol/file/Handler.java b/libjava/gnu/java/net/protocol/file/Handler.java
index 7470d17f20a..4f5fba3a5b4 100644
--- a/libjava/gnu/java/net/protocol/file/Handler.java
+++ b/libjava/gnu/java/net/protocol/file/Handler.java
@@ -53,6 +53,22 @@ import java.net.URLStreamHandler;
*/
public class Handler extends URLStreamHandler
{
+ /**
+ * A do nothing constructor
+ */
+ public Handler()
+ {
+ }
+
+ /**
+ * This method returs a new FileURLConnection for the specified URL
+ *
+ * @param url The URL to return a connection for
+ *
+ * @return The URLConnection
+ *
+ * @exception IOException If an error occurs
+ */
protected URLConnection openConnection(URL url) throws IOException
{
// If a hostname is set, then we need to switch protocols to ftp
diff --git a/libjava/gnu/java/net/protocol/http/Connection.java b/libjava/gnu/java/net/protocol/http/Connection.java
index 7794bc7f2f7..0bc50d147c0 100644
--- a/libjava/gnu/java/net/protocol/http/Connection.java
+++ b/libjava/gnu/java/net/protocol/http/Connection.java
@@ -39,44 +39,42 @@ exception statement from your version. */
package gnu.java.net.protocol.http;
import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.DataInputStream;
import java.io.InputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.HttpURLConnection;
-import java.net.InetAddress;
import java.net.ProtocolException;
import java.net.Socket;
import java.net.URL;
import java.net.URLConnection;
+import java.util.HashMap;
+import java.util.Iterator;
import java.util.Map;
-import java.util.Vector;
-import java.util.Hashtable;
-import java.util.Enumeration;
+import gnu.java.net.HeaderFieldHelper;
/**
- * Written using on-line Java Platform 1.2 API Specification, as well
- * as "The Java Class Libraries", 2nd edition (Addison-Wesley, 1998).
+ * This subclass of java.net.URLConnection models a URLConnection via
+ * the HTTP protocol.
+ *
* Status: Minimal subset of functionality. Proxies only partially
* handled; Redirects not yet handled. FileNameMap handling needs to
* be considered. useCaches, ifModifiedSince, and
* allowUserInteraction need consideration as well as doInput and
* doOutput.
- */
-
-/**
+ *
+ * @author Aaron M. Renn <arenn@urbanophile.com>
* @author Warren Levy <warrenl@cygnus.com>
- * @date March 29, 1999.
*/
-class Connection extends HttpURLConnection
+public final class Connection extends HttpURLConnection
{
- protected Socket sock = null;
- private static Hashtable defRequestProperties = new Hashtable();
- private Hashtable requestProperties;
- private Hashtable hdrHash = new Hashtable();
- private Vector hdrVec = new Vector();
- private BufferedInputStream bufferedIn;
-
+ /**
+ * The socket we are connected to
+ */
+ private Socket socket;
private static int proxyPort = 80;
private static boolean proxyInUse = false;
private static String proxyHost = null;
@@ -104,43 +102,47 @@ class Connection extends HttpURLConnection
}
}
- public Connection(URL url)
+ /**
+ * The InputStream for this connection.
+ */
+ private DataInputStream inputStream;
+
+ /**
+ * The OutputStream for this connection
+ */
+ private OutputStream outputStream;
+
+ /**
+ * bufferedOutputStream is a buffer to contain content of the HTTP request,
+ * and will be written to outputStream all at once
+ */
+ private ByteArrayOutputStream bufferedOutputStream;
+
+ /**
+ * This object holds the request properties.
+ */
+ private HashMap requestProperties = new HashMap();
+
+ /**
+ * This is the object that holds the header field information
+ */
+ private HeaderFieldHelper headers = new HeaderFieldHelper();
+
+ /**
+ * Calls superclass constructor to initialize
+ */
+ protected Connection(URL url)
{
super(url);
- requestProperties = (Hashtable) defRequestProperties.clone();
- }
-
- // Override method in URLConnection.
- public static void setDefaultRequestProperty(String key, String value)
- {
- defRequestProperties.put(key, value);
- }
-
- // Override method in URLConnection.
- public static String getDefaultRequestProperty(String key)
- {
- return (String) defRequestProperties.get(key);
- }
-
- // Override method in URLConnection.
- public void setRequestProperty(String key, String value)
- {
- if (connected)
- throw new IllegalAccessError("Connection already established.");
-
- requestProperties.put(key, value);
- }
- // Override method in URLConnection.
- public String getRequestProperty(String key)
- {
- if (connected)
- throw new IllegalAccessError("Connection already established.");
-
- return (String) requestProperties.get(key);
+ /* Set up some variables */
+ doOutput = false;
}
- // Implementation of abstract method.
+ /**
+ * Connects to the remote host, sends the request, and parses the reply
+ * code and header information returned
+ */
public void connect() throws IOException
{
// Call is ignored if already connected.
@@ -152,55 +154,212 @@ class Connection extends HttpURLConnection
if (proxyInUse)
{
port = proxyPort;
- sock = new Socket(proxyHost, port);
+ socket = new Socket(proxyHost, port);
}
else
{
- InetAddress destAddr = InetAddress.getByName(url.getHost());
if ((port = url.getPort()) == -1)
port = 80;
// Open socket and output stream.
- sock = new Socket(destAddr, port);
+ socket = new Socket(url.getHost(), port);
}
- PrintWriter out = new PrintWriter(sock.getOutputStream());
+ inputStream =
+ new DataInputStream(new BufferedInputStream(socket.getInputStream()));
+ outputStream = new BufferedOutputStream (socket.getOutputStream());
+ bufferedOutputStream = new ByteArrayOutputStream (256); //default is too small
+
+ sendRequest();
+ receiveReply();
- // Send request including any request properties that were set.
- out.print(getRequestMethod() + " " + url.getFile() + " HTTP/1.0\r\n");
- out.print("Host: " + url.getHost() + ":" + port + "\r\n");
- Enumeration reqKeys = requestProperties.keys();
- Enumeration reqVals = requestProperties.elements();
- while (reqKeys.hasMoreElements())
- out.print(reqKeys.nextElement() + ": " + reqVals.nextElement() + "\r\n");
- out.print("\r\n");
- out.flush();
- getHttpHeaders();
connected = true;
}
- // Implementation of abstract method.
+ /**
+ * Disconnects from the remote server.
+ */
public void disconnect()
{
- if (sock != null)
+ if (socket != null)
{
try
{
- sock.close();
+ socket.close();
}
- catch (IOException ex)
+ catch (IOException e)
{
- ; // Ignore errors in closing socket.
+ // Ignore errors in closing socket.
}
- sock = null;
+ socket = null;
+ }
+ }
+
+ /**
+ * Write HTTP request header and content to outputWriter.
+ */
+ void sendRequest() throws IOException
+ {
+ // Create PrintWriter for easier sending of headers.
+ PrintWriter outputWriter = new PrintWriter(outputStream);
+
+ // Send request including any request properties that were set.
+ outputWriter.print (getRequestMethod() + " " + url.getFile()
+ + " HTTP/1.1\r\n");
+
+ // Set additional HTTP headers.
+ if (getRequestProperty ("Host") == null)
+ setRequestProperty ("Host", url.getHost());
+
+ if (getRequestProperty ("Connection") == null)
+ setRequestProperty ("Connection", "Close");
+
+ if (getRequestProperty ("user-agent") == null)
+ setRequestProperty ("user-agent", "gnu-libgcj/"
+ + System.getProperty ("classpath.version"));
+
+ if (getRequestProperty ("accept") == null)
+ setRequestProperty ("accept", "*/*");
+
+ if (getRequestProperty ("Content-type") == null)
+ setRequestProperty ("Content-type", "application/x-www-form-urlencoded");
+
+ // Set correct content length.
+ setRequestProperty ("Content-length", String.valueOf (bufferedOutputStream.size()));
+
+ // Write all req_props name-value pairs to the output writer.
+ Iterator itr = getRequestProperties().entrySet().iterator();
+
+ while (itr.hasNext())
+ {
+ Map.Entry e = (Map.Entry) itr.next();
+ outputWriter.print (e.getKey() + ": " + e.getValue() + "\r\n");
+ }
+
+ // One more CR-LF indicates end of header.
+ outputWriter.print ("\r\n");
+ outputWriter.flush();
+
+ // Write content
+ bufferedOutputStream.writeTo (outputStream);
+ outputStream.flush();
+ }
+
+ /**
+ * Read HTTP reply from inputStream.
+ */
+ private void receiveReply() throws IOException
+ {
+ // Parse the reply
+ String line = inputStream.readLine();
+ String saveline = line;
+ int idx = line.indexOf (" ");
+
+ if ((idx == -1)
+ || (line.length() < (idx + 6)))
+ throw new IOException ("Server reply was unparseable: " + saveline);
+
+ headers.addHeaderField (null, line);
+
+ line = line.substring (idx + 1);
+ String code = line.substring (0, 3);
+
+ try
+ {
+ responseCode = Integer.parseInt (code);
+ }
+ catch (NumberFormatException e)
+ {
+ throw new IOException ("Server reply was unparseable: " + saveline);
+ }
+
+ responseMessage = line.substring (4);
+
+ // Now read the header lines
+ String key = null, value = null;
+
+ while (true)
+ {
+ line = inputStream.readLine();
+
+ if (line.equals(""))
+ break;
+
+ // Check for folded lines
+ if (line.startsWith (" ")
+ || line.startsWith("\t"))
+ {
+ // Trim off leading space
+ do
+ {
+ if (line.length() == 1)
+ throw new IOException("Server header lines were unparseable: "
+ + line);
+
+ line = line.substring (1);
+ }
+ while (line.startsWith(" ")
+ || line.startsWith("\t"));
+
+ value = value + " " + line;
+ }
+ else
+ {
+ if (key != null)
+ {
+ headers.addHeaderField (key.toLowerCase(), value);
+ key = null;
+ value = null;
+ }
+
+ // Parse out key and value
+ idx = line.indexOf (":");
+ if ((idx == -1)
+ || (line.length() < (idx + 2)))
+ throw new IOException ("Server header lines were unparseable: "
+ + line);
+
+ key = line.substring (0, idx);
+ value = line.substring (idx + 1);
+
+ // Trim off leading space
+ while (value.startsWith (" ")
+ || value.startsWith ("\t"))
+ {
+ if (value.length() == 1)
+ throw new IOException ("Server header lines were unparseable: "
+ + line);
+
+ value = value.substring (1);
+ }
+ }
+ }
+
+ if (key != null)
+ {
+ headers.addHeaderField (key.toLowerCase(), value.toLowerCase());
}
}
+ /**
+ * Return a boolean indicating whether or not this connection is
+ * going through a proxy
+ *
+ * @return true if using a proxy, false otherwise
+ */
public boolean usingProxy()
{
return proxyInUse;
}
- // Override default method in URLConnection.
+ /**
+ * Returns an InputStream for reading from this connection. This stream
+ * will be "queued up" for reading just the contents of the requested file.
+ * Overrides URLConnection.getInputStream()
+ *
+ * @return An InputStream for this connection.
+ *
+ * @exception IOException If an error occurs
+ */
public InputStream getInputStream() throws IOException
{
if (!connected)
@@ -208,22 +367,85 @@ class Connection extends HttpURLConnection
if (!doInput)
throw new ProtocolException("Can't open InputStream if doInput is false");
- return bufferedIn;
+
+ return inputStream;
}
- // Override default method in URLConnection.
+ /**
+ * Returns on OutputStream for writing to this connection.
+ *
+ * @return An OutputStream for this connection.
+ *
+ * @exception IOException If an error occurs
+ */
public OutputStream getOutputStream() throws IOException
{
+ if (!doOutput)
+ throw new ProtocolException
+ ("Want output stream while haven't setDoOutput(true)");
+
if (!connected)
connect();
+
+ return bufferedOutputStream;
+ }
+
+ /**
+ * Overrides java.net.HttpURLConnection.setRequestMethod() in order to
+ * restrict the available methods to only those we support.
+ *
+ * @param method The RequestMethod to use
+ *
+ * @exception ProtocolException If the specified method is not valid
+ */
+ public void setRequestMethod (String method) throws ProtocolException
+ {
+ method = method.toUpperCase();
+
+ if (method.equals("GET")
+ || method.equals("HEAD")
+ || method.equals("POST"))
+ super.setRequestMethod (method);
+ else
+ throw new ProtocolException ("Unsupported or unknown request method " +
+ method);
+ }
+
+ public void addRequestProperty(String key, String value)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ String old = (String) requestProperties.put(key, value);
+
+ if (old != null)
+ requestProperties.put(key, old + "," + value);
+ }
+
+ public String getRequestProperty(String key)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ return (String) requestProperties.get(key);
+ }
+
+ public void setRequestProperty(String key, String value)
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ requestProperties.put(key, value);
+ }
- if (! doOutput)
- throw new
- ProtocolException("Can't open OutputStream if doOutput is false");
- return sock.getOutputStream();
+ public Map getRequestProperties()
+ {
+ if (connected)
+ throw new IllegalStateException("Already connected");
+
+ return requestProperties;
}
- // Override default method in URLConnection.
public String getHeaderField(String name)
{
if (!connected)
@@ -236,10 +458,9 @@ class Connection extends HttpURLConnection
return null;
}
- return (String) hdrHash.get(name.toLowerCase());
+ return (String) headers.getHeaderFieldValueByKey(name.toLowerCase());
}
- // Override default method in URLConnection.
public Map getHeaderFields()
{
if (!connected)
@@ -252,10 +473,18 @@ class Connection extends HttpURLConnection
return null;
}
- return hdrHash;
+ return headers.getHeaderFields();
}
- // Override default method in URLConnection.
+ /**
+ * This method returns the header field value at the specified numeric
+ * index.
+ *
+ * @param n The index into the header field array
+ *
+ * @return The value of the specified header field, or <code>null</code>
+ * if the specified index is not valid.
+ */
public String getHeaderField(int n)
{
if (!connected)
@@ -268,12 +497,18 @@ class Connection extends HttpURLConnection
return null;
}
- if (n < hdrVec.size())
- return getField ((String) hdrVec.elementAt(n));
- return null;
+ return headers.getHeaderFieldValueByIndex (n);
}
- // Override default method in URLConnection.
+ /**
+ * This method returns the header field key at the specified numeric
+ * index.
+ *
+ * @param n The index into the header field array
+ *
+ * @return The name of the header field key, or <code>null</code> if the
+ * specified index is not valid.
+ */
public String getHeaderFieldKey(int n)
{
if (!connected)
@@ -286,91 +521,6 @@ class Connection extends HttpURLConnection
return null;
}
- if (n < hdrVec.size())
- return getKey ((String) hdrVec.elementAt(n));
- return null;
- }
-
- private String getKey(String str)
- {
- if (str == null)
- return null;
- int index = str.indexOf(':');
- if (index >= 0)
- return str.substring(0, index);
- else
- return null;
- }
-
- private String getField(String str)
- {
- if (str == null)
- return null;
- int index = str.indexOf(':');
- if (index >= 0)
- return str.substring(index + 1).trim();
- else
- return str;
- }
-
- private void getHttpHeaders() throws IOException
- {
- // Originally tried using a BufferedReader here to take advantage of
- // the readLine method and avoid the following, but the buffer read
- // past the end of the headers so the first part of the content was lost.
- // It is probably more robust than it needs to be, e.g. the byte[]
- // is unlikely to overflow and a '\r' should always be followed by a '\n',
- // but it is better to be safe just in case.
- bufferedIn = new BufferedInputStream(sock.getInputStream());
-
- int buflen = 100;
- byte[] buf = new byte[buflen];
- String line = "";
- boolean gotnl = false;
- byte[] ch = new byte[1];
- ch[0] = (byte) '\n';
-
- while (true)
- {
- // Check for leftover byte from non-'\n' after a '\r'.
- if (ch[0] != '\n')
- line = line + '\r' + new String(ch, 0, 1);
-
- int i;
- // FIXME: This is rather inefficient.
- for (i = 0; i < buflen; i++)
- {
- buf[i] = (byte) bufferedIn.read();
- if (buf[i] == -1)
- throw new IOException("Malformed HTTP header");
- if (buf[i] == '\r')
- {
- bufferedIn.read(ch, 0, 1);
- if (ch[0] == '\n')
- gotnl = true;
- break;
- }
- }
- line = line + new String(buf, 0, i);
-
- // A '\r' '\n' combo indicates the end of the header entry.
- // If it wasn't found, cycle back through the loop and append
- // to 'line' until one is found.
- if (gotnl)
- {
- // A zero length entry signals the end of the headers.
- if (line.length() == 0)
- break;
-
- // Store the header and reinitialize for next cycle.
- hdrVec.addElement(line);
- String key = getKey(line);
- if (key != null)
- hdrHash.put(key.toLowerCase(), getField(line));
- line = "";
- ch[0] = (byte) '\n';
- gotnl = false;
- }
- }
+ return headers.getHeaderFieldKeyByIndex (n);
}
}
diff --git a/libjava/gnu/java/net/protocol/jar/Connection.java b/libjava/gnu/java/net/protocol/jar/Connection.java
index 7d9d7cb48b2..af4903d78ab 100644
--- a/libjava/gnu/java/net/protocol/jar/Connection.java
+++ b/libjava/gnu/java/net/protocol/jar/Connection.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package gnu.java.net.protocol.jar;
+import java.io.BufferedInputStream;
+import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.InputStream;
@@ -47,38 +49,140 @@ import java.net.MalformedURLException;
import java.net.ProtocolException;
import java.net.URL;
import java.net.URLConnection;
-import java.net.URLStreamHandler;
+import java.util.Map;
+import java.util.Vector;
+import java.util.HashMap;
import java.util.Hashtable;
import java.util.jar.JarFile;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
import java.util.zip.ZipFile;
+import java.util.zip.ZipEntry;
/**
- * Written using on-line Java Platform 1.2 API Specification.
+ * This subclass of java.net.JarURLConnection models a URLConnection via
+ * the "jar" protocol.
*
* @author Kresten Krab Thorup <krab@gnu.org>
- * @date Aug 10, 1999.
*/
-public class Connection extends JarURLConnection
+public final class Connection extends JarURLConnection
{
- static Hashtable file_cache = new Hashtable();
- private JarFile jarfile;
+ private static Hashtable file_cache = new Hashtable();
+ private JarFile jar_file;
- public Connection(URL url)
+ /**
+ * Cached JarURLConnection objects .
+ */
+ static HashMap connectionCache = new HashMap();
+
+ protected Connection(URL url)
throws MalformedURLException
{
super(url);
}
- public synchronized JarFile getJarFile() throws java.io.IOException
+ public synchronized void connect() throws IOException
+ {
+ // Call is ignored if already connected.
+ if (connected)
+ return;
+
+ if (getUseCaches())
+ {
+ jarFileURLConnection =
+ (URLConnection) connectionCache.get(getJarFileURL());
+
+ if (jarFileURLConnection == null)
+ {
+ jarFileURLConnection = getJarFileURL().openConnection();
+ jarFileURLConnection.setUseCaches(true);
+ jarFileURLConnection.connect();
+ connectionCache.put(getJarFileURL(), jarFileURLConnection);
+ }
+ }
+ else
+ {
+ jarFileURLConnection = getJarFileURL().openConnection();
+ jarFileURLConnection.connect();
+ }
+
+ connected = true;
+ }
+
+ public InputStream getInputStream() throws IOException
{
if (!connected)
connect();
if (! doInput)
- throw new ProtocolException("Can't open JarFile if doInput is false");
+ throw new ProtocolException("Can't open InputStream if doInput is false");
+
+ if (getEntryName() == null)
+ {
+ // This is a JarURLConnection for the entire jar file.
+
+ InputStream in = new BufferedInputStream
+ (jarFileURLConnection.getInputStream());
+ return new JarInputStream(in);
+ }
+ // Reaching this point, we're looking for an entry of a jar file.
+
+ JarFile jarfile = null;
+
+ try
+ {
+ jarfile = getJarFile ();
+ }
+ catch (IOException x)
+ {
+ /* ignore */
+ }
+
if (jarfile != null)
- return jarfile;
+ {
+ // this is the easy way...
+ ZipEntry entry = jarfile.getEntry(getEntryName());
+
+ if (entry != null)
+ return jarfile.getInputStream (entry);
+ else
+ return null;
+ }
+ else
+ {
+ // If the jar file is not local, ...
+ JarInputStream zis = new JarInputStream(
+ jarFileURLConnection.getInputStream ());
+
+ // This is hideous, we're doing a linear search...
+ for (ZipEntry entry = zis.getNextEntry();
+ entry != null;
+ entry = zis.getNextEntry())
+ {
+ if (getEntryName().equals(entry.getName()))
+ {
+ int size = (int) entry.getSize();
+ byte[] data = new byte[size];
+ zis.read (data, 0, size);
+ return new ByteArrayInputStream (data);
+ }
+ }
+ }
+
+ return null;
+ }
+
+ public synchronized JarFile getJarFile() throws IOException
+ {
+ if (!connected)
+ connect();
+
+ if (! doInput)
+ throw new ProtocolException("Can't open JarFile if doInput is false");
+
+ if (jar_file != null)
+ return jar_file;
URL jarFileURL = getJarFileURL();
@@ -87,15 +191,15 @@ public class Connection extends JarURLConnection
{
if (getUseCaches())
{
- jarfile = (JarFile) file_cache.get(jarFileURL);
- if (jarfile == null)
+ jar_file = (JarFile) file_cache.get (jarFileURL);
+ if (jar_file == null)
{
- jarfile = new JarFile (jarFileURL.getFile());
- file_cache.put (jarFileURL, jarfile);
+ jar_file = new JarFile (jarFileURL.getFile());
+ file_cache.put (jarFileURL, jar_file);
}
}
else
- jarfile = new JarFile (jarFileURL.getFile());
+ jar_file = new JarFile (jarFileURL.getFile());
}
else
{
@@ -111,10 +215,134 @@ public class Connection extends JarURLConnection
// Always verify the Manifest, open read only and delete when done.
// XXX ZipFile.OPEN_DELETE not yet implemented.
// jf = new JarFile(f, true, ZipFile.OPEN_READ | ZipFile.OPEN_DELETE);
- jarfile = new JarFile(f, true, ZipFile.OPEN_READ);
+ jar_file = new JarFile (f, true, ZipFile.OPEN_READ);
}
- return jarfile;
+ return jar_file;
}
+ // Steal and borrow from protocol/file/Connection.java
+
+ private Hashtable hdrHash = new Hashtable();
+ private Vector hdrVec = new Vector();
+ private boolean gotHeaders = false;
+
+ // Override default method in URLConnection.
+ public String getHeaderField(String name)
+ {
+ try
+ {
+ getHeaders();
+ }
+ catch (IOException x)
+ {
+ return null;
+ }
+ return (String) hdrHash.get(name.toLowerCase());
+ }
+
+ // Override default method in URLConnection.
+ public Map getHeaderFields()
+ {
+ try
+ {
+ getHeaders();
+ }
+ catch (IOException x)
+ {
+ return null;
+ }
+ return hdrHash;
+ }
+
+ // Override default method in URLConnection.
+ public String getHeaderField(int n)
+ {
+ try
+ {
+ getHeaders();
+ }
+ catch (IOException x)
+ {
+ return null;
+ }
+ if (n < hdrVec.size())
+ return getField((String) hdrVec.elementAt(n));
+
+ return null;
+ }
+
+ // Override default method in URLConnection.
+ public String getHeaderFieldKey(int n)
+ {
+ try
+ {
+ getHeaders();
+ }
+ catch (IOException x)
+ {
+ return null;
+ }
+ if (n < hdrVec.size())
+ return getKey((String) hdrVec.elementAt(n));
+
+ return null;
+ }
+
+ private String getKey(String str)
+ {
+ if (str == null)
+ return null;
+ int index = str.indexOf(':');
+ if (index >= 0)
+ return str.substring(0, index);
+ else
+ return null;
+ }
+
+ private String getField(String str)
+ {
+ if (str == null)
+ return null;
+ int index = str.indexOf(':');
+ if (index >= 0)
+ return str.substring(index + 1).trim();
+ else
+ return str;
+ }
+
+ private void getHeaders() throws IOException
+ {
+ if (gotHeaders)
+ return;
+ gotHeaders = true;
+
+ connect();
+
+ // Yes, it is overkill to use the hash table and vector here since
+ // we're only putting one header in the file, but in case we need
+ // to add others later and for consistency, we'll implement it this way.
+
+ // Add the only header we know about right now: Content-length.
+ long len = -1;
+
+ if (getEntryName() == null)
+ if (jarFileURLConnection != null)
+ len = jarFileURLConnection.getContentLength ();
+ else
+ {
+ JarEntry entry = getJarEntry();
+ if (entry != null)
+ len = entry.getSize ();
+ }
+
+ String line = "Content-length: " + len;
+ hdrVec.addElement(line);
+
+ // The key will never be null in this scenario since we build up the
+ // headers ourselves. If we ever rely on getting a header from somewhere
+ // else, then we may have to check if the result of getKey() is null.
+ String key = getKey(line);
+ hdrHash.put(key.toLowerCase(), Long.toString(len));
+ }
}
diff --git a/libjava/gnu/java/net/protocol/jar/Handler.java b/libjava/gnu/java/net/protocol/jar/Handler.java
index 7bde053e20e..d1235032c38 100644
--- a/libjava/gnu/java/net/protocol/jar/Handler.java
+++ b/libjava/gnu/java/net/protocol/jar/Handler.java
@@ -38,19 +38,132 @@ exception statement from your version. */
package gnu.java.net.protocol.jar;
+import gnu.java.net.URLParseError;
import java.io.IOException;
+import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLStreamHandler;
/**
* @author Kresten Krab Thorup <krab@gnu.org>
- * @date August 13, 1999.
*/
public class Handler extends URLStreamHandler
{
+ /**
+ * A do nothing constructor
+ */
+ public Handler()
+ {
+ }
+
+ /**
+ * This method returs a new JarURLConnection for the specified URL
+ *
+ * @param url The URL to return a connection for
+ *
+ * @return The URLConnection
+ *
+ * @exception IOException If an error occurs
+ */
protected URLConnection openConnection(URL url) throws IOException
{
return new Connection(url);
}
+
+ /**
+ * This method overrides URLStreamHandler's for parsing url of protocol "jar"
+ *
+ * @param url The URL object in which to store the results
+ * @param url_string The String-ized URL to parse
+ * @param start The position in the string to start scanning from
+ * @param end The position in the string to stop scanning
+ */
+ protected void parseURL (URL url, String url_string, int start, int end)
+ {
+ // This method does not throw an exception or return a value. Thus our
+ // strategy when we encounter an error in parsing is to return without
+ // doing anything.
+ String file = url.getFile();
+
+ if (file != null
+ && file != "")
+ { //has context url
+ url_string = url_string.substring (start, end);
+ if (url_string.startsWith("/"))
+ { //url string is an absolute path
+ int idx = file.lastIndexOf ("!/");
+
+ if (idx < 0)
+ throw new URLParseError("no !/ in spec");
+
+ file = file.substring (0, idx + 1) + url_string;
+ }
+ else
+ {
+ int idx = file.lastIndexOf ("/");
+ if (idx == -1) //context path is weird
+ file = "/" + url_string;
+ else if (idx == (file.length() - 1))
+ //just concatenate two parts
+ file = file + url_string;
+ else
+ // according to Java API Documentation, here is a little different
+ // with URLStreamHandler.parseURL
+ // but JDK seems doesn't handle it well
+ file = file.substring(0, idx + 1) + url_string;
+ }
+
+ setURL (url, "jar", url.getHost(), url.getPort(), file, null);
+ return;
+ }
+
+ // Bunches of things should be true. Make sure.
+ if (end < start)
+ return;
+ if (end - start < 2)
+ return;
+ if (start > url_string.length())
+ return;
+
+ // Skip remains of protocol
+ url_string = url_string.substring (start, end);
+
+ int jar_stop;
+ if ((jar_stop = url_string.indexOf("!/")) < 0)
+ throw new URLParseError("no !/ in spec");
+
+ try
+ {
+ new URL(url_string.substring (0, jar_stop));
+ }
+ catch (MalformedURLException e)
+ {
+ throw new URLParseError("invalid inner URL: " + e.getMessage());
+ }
+
+ if (!url.getProtocol().equals ("jar") )
+ throw new URLParseError("unexpected protocol " + url.getProtocol());
+
+ setURL (url, "jar", url.getHost(), url.getPort(), url_string, null);
+ }
+
+ /**
+ * This method converts a Jar URL object into a String.
+ *
+ * @param url The URL object to convert
+ */
+ protected String toExternalForm (URL url)
+ {
+ String file = url.getFile();
+
+ // return "jar:" + file;
+ // Performance!!:
+ // Do the concatenation manually to avoid resize StringBuffer's
+ // internal buffer.
+ StringBuffer sb = new StringBuffer (file.length() + 5);
+ sb.append ("jar:");
+ sb.append (file);
+ return sb.toString();
+ }
}
diff --git a/libjava/gnu/java/nio/ChannelInputStream.java b/libjava/gnu/java/nio/ChannelInputStream.java
new file mode 100644
index 00000000000..4cf4875c334
--- /dev/null
+++ b/libjava/gnu/java/nio/ChannelInputStream.java
@@ -0,0 +1,79 @@
+/* ChannelInputStream.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.IllegalBlockingModeException;
+import java.nio.channels.ReadableByteChannel;
+import java.nio.channels.SelectableChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class ChannelInputStream extends InputStream
+{
+ private ReadableByteChannel ch;
+
+ public ChannelInputStream (ReadableByteChannel ch)
+ {
+ super();
+
+ this.ch = ch;
+ }
+
+ public int read() throws IOException
+ {
+ if (ch instanceof SelectableChannel
+ && (! ((SelectableChannel) ch).isBlocking()))
+ throw new IllegalBlockingModeException();
+
+ ByteBuffer buffer = ByteBuffer.allocate(1);
+ int result = ch.read(buffer);
+
+ if (result == -1)
+ return -1;
+
+ if (result == 0)
+ throw new IOException("Could not read from channel");
+
+ return buffer.get(0);
+ }
+}
diff --git a/libjava/gnu/java/nio/ChannelOutputStream.java b/libjava/gnu/java/nio/ChannelOutputStream.java
new file mode 100644
index 00000000000..96dc7610654
--- /dev/null
+++ b/libjava/gnu/java/nio/ChannelOutputStream.java
@@ -0,0 +1,67 @@
+/* ChannelOutputStream.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import java.io.OutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.WritableByteChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class ChannelOutputStream extends OutputStream
+{
+ private WritableByteChannel ch;
+
+ public ChannelOutputStream (WritableByteChannel ch)
+ {
+ super();
+
+ this.ch = ch;
+ }
+
+ public void write (int value) throws IOException
+ {
+ ByteBuffer buffer = ByteBuffer.allocate (1);
+ buffer.put ((byte) (value & 0xff));
+ buffer.flip();
+ ch.write (buffer);
+ }
+}
diff --git a/libjava/gnu/java/nio/DatagramChannelImpl.java b/libjava/gnu/java/nio/DatagramChannelImpl.java
index b2dcd3242dd..af43256cc28 100644
--- a/libjava/gnu/java/nio/DatagramChannelImpl.java
+++ b/libjava/gnu/java/nio/DatagramChannelImpl.java
@@ -56,7 +56,7 @@ import java.nio.channels.spi.SelectorProvider;
public final class DatagramChannelImpl extends DatagramChannel
{
private NIODatagramSocket socket;
- private boolean blocking = false;
+ private boolean blocking = true;
protected DatagramChannelImpl (SelectorProvider provider)
throws IOException
@@ -67,7 +67,7 @@ public final class DatagramChannelImpl extends DatagramChannel
public int getNativeFD()
{
- return socket.getImpl().getNativeFD();
+ return socket.getPlainDatagramSocketImpl().getNativeFD();
}
public DatagramSocket socket ()
diff --git a/libjava/gnu/java/nio/FileLockImpl.java b/libjava/gnu/java/nio/FileLockImpl.java
index 189e03ac81e..f85d60ad67f 100644
--- a/libjava/gnu/java/nio/FileLockImpl.java
+++ b/libjava/gnu/java/nio/FileLockImpl.java
@@ -42,6 +42,7 @@ import java.io.FileDescriptor;
import java.io.IOException;
import java.nio.channels.FileChannel;
import java.nio.channels.FileLock;
+import gnu.classpath.Configuration;
/**
* @author Michael Koch
@@ -49,6 +50,15 @@ import java.nio.channels.FileLock;
*/
public class FileLockImpl extends FileLock
{
+ static
+ {
+ // load the shared library needed for native methods.
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary ("javanio");
+ }
+ }
+
private FileDescriptor fd;
private boolean released;
diff --git a/libjava/gnu/java/nio/InputStreamChannel.java b/libjava/gnu/java/nio/InputStreamChannel.java
new file mode 100644
index 00000000000..49e8b3c7e73
--- /dev/null
+++ b/libjava/gnu/java/nio/InputStreamChannel.java
@@ -0,0 +1,88 @@
+/* InputStreamChannel.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import java.io.InputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.ReadableByteChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class InputStreamChannel implements ReadableByteChannel
+{
+ private boolean closed = false;
+ private InputStream in;
+
+ public InputStreamChannel (InputStream in)
+ {
+ super();
+ this.in = in;
+ }
+
+ public void close() throws IOException
+ {
+ if (!closed)
+ {
+ in.close();
+ closed = true;
+ }
+ }
+
+ public boolean isOpen()
+ {
+ return !closed;
+ }
+
+ public int read (ByteBuffer dst) throws IOException
+ {
+ if (!isOpen())
+ throw new ClosedChannelException();
+
+ byte[] buffer = new byte [dst.remaining()];
+ int readBytes = in.read (buffer);
+
+ if (readBytes > 0)
+ dst.put (buffer, 0, readBytes);
+
+ return readBytes;
+ }
+}
diff --git a/libjava/gnu/java/nio/NIODatagramSocket.java b/libjava/gnu/java/nio/NIODatagramSocket.java
index 6c44c9dcb82..ff71c80b71b 100644
--- a/libjava/gnu/java/nio/NIODatagramSocket.java
+++ b/libjava/gnu/java/nio/NIODatagramSocket.java
@@ -59,7 +59,7 @@ public final class NIODatagramSocket extends DatagramSocket
this.channel = channel;
}
- public final PlainDatagramSocketImpl getImpl()
+ public final PlainDatagramSocketImpl getPlainDatagramSocketImpl()
{
return impl;
}
diff --git a/libjava/gnu/java/nio/NIOSocket.java b/libjava/gnu/java/nio/NIOSocket.java
index ba9807396be..7f955c3acee 100644
--- a/libjava/gnu/java/nio/NIOSocket.java
+++ b/libjava/gnu/java/nio/NIOSocket.java
@@ -59,14 +59,14 @@ public final class NIOSocket extends Socket
this.channel = channel;
}
- public final PlainSocketImpl getImpl()
+ public final PlainSocketImpl getPlainSocketImpl()
{
return impl;
}
final void setChannel (SocketChannelImpl channel)
{
- this.impl = channel.getImpl();
+ this.impl = channel.getPlainSocketImpl();
this.channel = channel;
}
diff --git a/libjava/gnu/java/nio/OutputStreamChannel.java b/libjava/gnu/java/nio/OutputStreamChannel.java
new file mode 100644
index 00000000000..37ded3b1169
--- /dev/null
+++ b/libjava/gnu/java/nio/OutputStreamChannel.java
@@ -0,0 +1,87 @@
+/* OutputStreamChannel.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+
+package gnu.java.nio;
+
+import java.io.OutputStream;
+import java.io.IOException;
+import java.nio.ByteBuffer;
+import java.nio.channels.ClosedChannelException;
+import java.nio.channels.WritableByteChannel;
+
+/**
+ * @author Michael Koch
+ */
+public final class OutputStreamChannel implements WritableByteChannel
+{
+ private boolean closed = false;
+ private OutputStream out;
+
+ public OutputStreamChannel (OutputStream out)
+ {
+ super();
+
+ this.out = out;
+ }
+
+ public void close() throws IOException
+ {
+ if (!closed)
+ {
+ out.close();
+ closed = true;
+ }
+ }
+
+ public boolean isOpen()
+ {
+ return !closed;
+ }
+
+ public int write (ByteBuffer src) throws IOException
+ {
+ if (!isOpen())
+ throw new ClosedChannelException();
+
+ int len = src.remaining();
+ byte[] buffer = new byte [len];
+ src.get (buffer);
+ out.write (buffer);
+ return len;
+ }
+}
diff --git a/libjava/gnu/java/nio/SelectorImpl.java b/libjava/gnu/java/nio/SelectorImpl.java
index 60a81f98458..f26e0808074 100644
--- a/libjava/gnu/java/nio/SelectorImpl.java
+++ b/libjava/gnu/java/nio/SelectorImpl.java
@@ -49,12 +49,44 @@ import java.util.Collections;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;
+import gnu.classpath.Configuration;
public class SelectorImpl extends AbstractSelector
{
+ static
+ {
+ // load the shared library needed for native methods.
+ if (Configuration.INIT_LOAD_LIBRARY)
+ {
+ System.loadLibrary ("javanio");
+ }
+ }
+
private Set keys;
private Set selected;
+ /**
+ * A dummy object whose monitor regulates access to both our
+ * selectThread and unhandledWakeup fields.
+ */
+ private Object selectThreadMutex = new Object ();
+
+ /**
+ * Any thread that's currently blocked in a select operation.
+ */
+ private Thread selectThread;
+
+ /**
+ * Indicates whether we have an unhandled wakeup call. This can
+ * be due to either wakeup() triggering a thread interruption while
+ * a thread was blocked in a select operation (in which case we need
+ * to reset this thread's interrupt status after interrupting the
+ * select), or else that no thread was on a select operation at the
+ * time that wakeup() was called, in which case the following select()
+ * operation should return immediately with nothing selected.
+ */
+ private boolean unhandledWakeup;
+
public SelectorImpl (SelectorProvider provider)
{
super (provider);
@@ -71,30 +103,47 @@ public class SelectorImpl extends AbstractSelector
protected final void implCloseSelector()
throws IOException
{
- // FIXME: We surely need to do more here.
+ // Cancel any pending select operation.
wakeup();
+
+ synchronized (keys)
+ {
+ synchronized (selected)
+ {
+ synchronized (cancelledKeys ())
+ {
+ // FIXME: Release resources here.
+ }
+ }
+ }
}
public final Set keys()
{
+ if (!isOpen())
+ throw new ClosedSelectorException();
+
return Collections.unmodifiableSet (keys);
}
public final int selectNow()
throws IOException
{
+ // FIXME: We're simulating an immediate select
+ // via a select with a timeout of one millisecond.
return select (1);
}
public final int select()
throws IOException
{
- return select (-1);
+ return select (0);
}
- // A timeout value of -1 means block forever.
+ // A timeout value of 0 means block forever.
private static native int implSelect (int[] read, int[] write,
- int[] except, long timeout);
+ int[] except, long timeout)
+ throws IOException;
private final int[] getFDsAsArray (int ops)
{
@@ -133,111 +182,199 @@ public class SelectorImpl extends AbstractSelector
return result;
}
- public int select (long timeout)
+ public synchronized int select (long timeout)
+ throws IOException
{
if (!isOpen())
- throw new ClosedSelectorException ();
-
- if (keys == null)
- {
- return 0;
- }
-
- deregisterCancelledKeys();
-
- // Set only keys with the needed interest ops into the arrays.
- int[] read = getFDsAsArray (SelectionKey.OP_READ | SelectionKey.OP_ACCEPT);
- int[] write = getFDsAsArray (SelectionKey.OP_WRITE | SelectionKey.OP_CONNECT);
- int[] except = new int [0]; // FIXME: We dont need to check this yet
- int anzahl = read.length + write.length + except.length;
-
- // Call the native select() on all file descriptors.
- begin();
- int result = implSelect (read, write, except, timeout);
- end();
-
- Iterator it = keys.iterator ();
-
- while (it.hasNext ())
+ throw new ClosedSelectorException();
+
+ synchronized (keys)
{
- int ops = 0;
- SelectionKeyImpl key = (SelectionKeyImpl) it.next ();
-
- // If key is already selected retrieve old ready ops.
- if (selected.contains (key))
+ synchronized (selected)
{
- ops = key.readyOps ();
- }
-
- // Set new ready read/accept ops
- for (int i = 0; i < read.length; i++)
- {
- if (key.getNativeFD() == read[i])
+ deregisterCancelledKeys();
+
+ // Set only keys with the needed interest ops into the arrays.
+ int[] read = getFDsAsArray (SelectionKey.OP_READ
+ | SelectionKey.OP_ACCEPT);
+ int[] write = getFDsAsArray (SelectionKey.OP_WRITE
+ | SelectionKey.OP_CONNECT);
+
+ // FIXME: We dont need to check this yet
+ int[] except = new int [0];
+
+ // Test to see if we've got an unhandled wakeup call,
+ // in which case we return immediately. Otherwise,
+ // remember our current thread and jump into the select.
+ // The monitor for dummy object selectThreadMutex regulates
+ // access to these fields.
+
+ // FIXME: Not sure from the spec at what point we should
+ // return "immediately". Is it here or immediately upon
+ // entry to this function?
+
+ // NOTE: There's a possibility of another thread calling
+ // wakeup() immediately after our thread releases
+ // selectThreadMutex's monitor here, in which case we'll
+ // do the select anyway. Since calls to wakeup() and select()
+ // among different threads happen in non-deterministic order,
+ // I don't think this is an issue.
+ synchronized (selectThreadMutex)
{
- if (key.channel () instanceof ServerSocketChannelImpl)
+ if (unhandledWakeup)
{
- ops = ops | SelectionKey.OP_ACCEPT;
+ unhandledWakeup = false;
+ return 0;
}
else
{
- ops = ops | SelectionKey.OP_READ;
+ selectThread = Thread.currentThread ();
}
}
- }
- // Set new ready write ops
- for (int i = 0; i < write.length; i++)
- {
- if (key.getNativeFD() == write[i])
+ // Call the native select() on all file descriptors.
+ int result = 0;
+ try
{
- ops = ops | SelectionKey.OP_WRITE;
-
-// if (key.channel ().isConnected ())
-// {
-// ops = ops | SelectionKey.OP_WRITE;
-// }
-// else
-// {
-// ops = ops | SelectionKey.OP_CONNECT;
-// }
- }
- }
+ begin();
+ result = implSelect (read, write, except, timeout);
+ }
+ finally
+ {
+ end();
+ }
+
+ // If our unhandled wakeup flag is set at this point,
+ // reset our thread's interrupt flag because we were
+ // awakened by wakeup() instead of an external thread
+ // interruption.
+ //
+ // NOTE: If we were blocked in a select() and one thread
+ // called Thread.interrupt() on the blocked thread followed
+ // by another thread calling Selector.wakeup(), then race
+ // conditions could make it so that the thread's interrupt
+ // flag is reset even though the Thread.interrupt() call
+ // "was there first". I don't think we need to care about
+ // this scenario.
+ synchronized (selectThreadMutex)
+ {
+ if (unhandledWakeup)
+ {
+ unhandledWakeup = false;
+ selectThread.interrupted ();
+ }
+ selectThread = null;
+ }
- // FIXME: We dont handle exceptional file descriptors yet.
+ Iterator it = keys.iterator ();
- // If key is not yet selected add it.
- if (!selected.contains (key))
- {
- selected.add (key);
- }
+ while (it.hasNext ())
+ {
+ int ops = 0;
+ SelectionKeyImpl key = (SelectionKeyImpl) it.next ();
- // Set new ready ops
- key.readyOps (key.interestOps () & ops);
- }
+ // If key is already selected retrieve old ready ops.
+ if (selected.contains (key))
+ {
+ ops = key.readyOps ();
+ }
- deregisterCancelledKeys();
- return result;
+ // Set new ready read/accept ops
+ for (int i = 0; i < read.length; i++)
+ {
+ if (key.getNativeFD() == read[i])
+ {
+ if (key.channel () instanceof ServerSocketChannelImpl)
+ {
+ ops = ops | SelectionKey.OP_ACCEPT;
+ }
+ else
+ {
+ ops = ops | SelectionKey.OP_READ;
+ }
+ }
+ }
+
+ // Set new ready write ops
+ for (int i = 0; i < write.length; i++)
+ {
+ if (key.getNativeFD() == write[i])
+ {
+ ops = ops | SelectionKey.OP_WRITE;
+
+ // if (key.channel ().isConnected ())
+ // {
+ // ops = ops | SelectionKey.OP_WRITE;
+ // }
+ // else
+ // {
+ // ops = ops | SelectionKey.OP_CONNECT;
+ // }
+ }
+ }
+
+ // FIXME: We dont handle exceptional file descriptors yet.
+
+ // If key is not yet selected add it.
+ if (!selected.contains (key))
+ {
+ selected.add (key);
+ }
+
+ // Set new ready ops
+ key.readyOps (key.interestOps () & ops);
+ }
+ deregisterCancelledKeys();
+
+ return result;
+ }
+ }
}
public final Set selectedKeys()
{
+ if (!isOpen())
+ throw new ClosedSelectorException();
+
return selected;
}
public final Selector wakeup()
{
- return null;
+ // IMPLEMENTATION NOTE: Whereas the specification says that
+ // thread interruption should trigger a call to wakeup, we
+ // do the reverse under the covers: wakeup triggers a thread
+ // interrupt followed by a subsequent reset of the thread's
+ // interrupt status within select().
+
+ // First, acquire the monitor of the object regulating
+ // access to our selectThread and unhandledWakeup fields.
+ synchronized (selectThreadMutex)
+ {
+ unhandledWakeup = true;
+
+ // Interrupt any thread which is currently blocked in
+ // a select operation.
+ if (selectThread != null)
+ selectThread.interrupt ();
+ }
+
+ return this;
}
private final void deregisterCancelledKeys()
{
- Iterator it = cancelledKeys().iterator();
-
- while (it.hasNext ())
- {
- keys.remove ((SelectionKeyImpl) it.next ());
- it.remove ();
- }
+ Set ckeys = cancelledKeys ();
+ synchronized (ckeys)
+ {
+ Iterator it = ckeys.iterator();
+
+ while (it.hasNext ())
+ {
+ keys.remove ((SelectionKeyImpl) it.next ());
+ it.remove ();
+ }
+ }
}
protected SelectionKey register (SelectableChannel ch, int ops, Object att)
@@ -270,7 +407,11 @@ public class SelectorImpl extends AbstractSelector
throw new InternalError ("No known channel type");
}
- keys.add (result);
+ synchronized (keys)
+ {
+ keys.add (result);
+ }
+
result.interestOps (ops);
result.attach (att);
return result;
diff --git a/libjava/gnu/java/nio/ServerSocketChannelImpl.java b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
index 89bbdec8746..97943c0ff8e 100644
--- a/libjava/gnu/java/nio/ServerSocketChannelImpl.java
+++ b/libjava/gnu/java/nio/ServerSocketChannelImpl.java
@@ -54,9 +54,9 @@ import java.nio.channels.spi.SelectorProvider;
public final class ServerSocketChannelImpl extends ServerSocketChannel
{
- NIOServerSocket serverSocket;
- boolean blocking = true;
- boolean connected = false;
+ private NIOServerSocket serverSocket;
+ private boolean blocking = true;
+ private boolean connected;
protected ServerSocketChannelImpl (SelectorProvider provider)
throws IOException
diff --git a/libjava/gnu/java/nio/SocketChannelImpl.java b/libjava/gnu/java/nio/SocketChannelImpl.java
index 0478e32ea99..ced8ef2476a 100644
--- a/libjava/gnu/java/nio/SocketChannelImpl.java
+++ b/libjava/gnu/java/nio/SocketChannelImpl.java
@@ -66,7 +66,7 @@ public final class SocketChannelImpl extends SocketChannel
private PlainSocketImpl impl;
private NIOSocket socket;
private boolean blocking = true;
- private boolean connectionPending = false;
+ private boolean connectionPending;
SocketChannelImpl (SelectorProvider provider)
throws IOException
@@ -81,7 +81,7 @@ public final class SocketChannelImpl extends SocketChannel
throws IOException
{
super (provider);
- this.impl = socket.getImpl();
+ this.impl = socket.getPlainSocketImpl();
this.socket = socket;
}
@@ -99,14 +99,14 @@ public final class SocketChannelImpl extends SocketChannel
}
}
- PlainSocketImpl getImpl()
+ PlainSocketImpl getPlainSocketImpl()
{
return impl;
}
int getNativeFD()
{
- return socket.getImpl().getNativeFD();
+ return socket.getPlainSocketImpl().getNativeFD();
}
protected void implCloseSelectableChannel () throws IOException
@@ -301,8 +301,6 @@ public final class SocketChannelImpl extends SocketChannel
data = src.array();
}
- System.out.println ("INTERNAL: writing to socket outputstream");
-
OutputStream output = socket.getOutputStream();
output.write (data, offset, len);
diff --git a/libjava/gnu/java/nio/natPipeImplEcos.cc b/libjava/gnu/java/nio/natPipeImplEcos.cc
new file mode 100644
index 00000000000..7c6b4b5dafa
--- /dev/null
+++ b/libjava/gnu/java/nio/natPipeImplEcos.cc
@@ -0,0 +1,25 @@
+// natPipeImplEcos.cc
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+#include <platform.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <gnu/java/nio/PipeImpl.h>
+#include <java/io/IOException.h>
+
+void
+gnu::java::nio::PipeImpl::nativeInit (::java::nio::channels::spi::SelectorProvider*)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("nativeInit() not implemented"));
+}
diff --git a/libjava/gnu/java/nio/natPipeImpl.cc b/libjava/gnu/java/nio/natPipeImplPosix.cc
index caae89cdd1a..b847faac6dd 100644
--- a/libjava/gnu/java/nio/natPipeImpl.cc
+++ b/libjava/gnu/java/nio/natPipeImplPosix.cc
@@ -1,4 +1,4 @@
-// natPipeImpl.cc
+// natPipeImplPosix.cc
/* Copyright (C) 2003 Free Software Foundation
diff --git a/libjava/gnu/java/nio/natPipeImplWin32.cc b/libjava/gnu/java/nio/natPipeImplWin32.cc
new file mode 100644
index 00000000000..4f48972e5bc
--- /dev/null
+++ b/libjava/gnu/java/nio/natPipeImplWin32.cc
@@ -0,0 +1,38 @@
+// natPipeImplWin32.cc
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+#include <platform.h>
+
+#include <errno.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <gnu/java/nio/PipeImpl.h>
+//#include <gnu/java/nio/PipeImpl$SinkChannelImpl.h>
+//#include <gnu/java/nio/PipeImpl$SourceChannelImpl.h>
+#include <java/io/IOException.h>
+#include <java/nio/channels/spi/SelectorProvider.h>
+
+void
+gnu::java::nio::PipeImpl::nativeInit (::java::nio::channels::spi::SelectorProvider* /*provider*/)
+{
+ int filedes [2];
+
+ if (_Jv_pipe (filedes) < 0)
+ throw new ::java::io::IOException (JvNewStringUTF (strerror (errno)));
+
+ /* FIXME
+ source = new gnu::java::nio::PipeImpl$SourceChannelImpl
+ (this, provider, filedes [0]);
+ sink = new gnu::java::nio::PipeImpl$SinkChannelImpl
+ (this, provider, filedes [1]);
+ */
+}
diff --git a/libjava/gnu/java/nio/natSelectorImplEcos.cc b/libjava/gnu/java/nio/natSelectorImplEcos.cc
new file mode 100644
index 00000000000..a733686c31c
--- /dev/null
+++ b/libjava/gnu/java/nio/natSelectorImplEcos.cc
@@ -0,0 +1,25 @@
+// natSelectorImplEcos.cc
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+#include <platform.h>
+
+#include <errno.h>
+#include <string.h>
+
+#include <gnu/java/nio/SelectorImpl.h>
+#include <java/io/IOException.h>
+
+jint
+gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
+ jintArray except, jlong timeout)
+{
+ throw new ::java::io::IOException (JvNewStringUTF ("implSelect() not implemented"));
+}
diff --git a/libjava/gnu/java/nio/natSelectorImpl.cc b/libjava/gnu/java/nio/natSelectorImplPosix.cc
index 764167aaee2..ac16dac7b9a 100644
--- a/libjava/gnu/java/nio/natSelectorImpl.cc
+++ b/libjava/gnu/java/nio/natSelectorImplPosix.cc
@@ -1,4 +1,4 @@
-// natSelectorImpl.cc
+// natSelectorImplPosix.cc
/* Copyright (C) 2002, 2003 Free Software Foundation
@@ -15,30 +15,48 @@ details. */
#include <string.h>
#include <gnu/java/nio/SelectorImpl.h>
+#include <java/io/InterruptedIOException.h>
#include <java/io/IOException.h>
+#include <java/lang/Thread.h>
-void
+static void
helper_put_filedescriptors (jintArray fdArray, fd_set& fds, int& max_fd)
{
jint* tmpFDArray = elements (fdArray);
for (int index = 0; index < JvGetArrayLength (fdArray); index++)
{
- FD_SET (tmpFDArray [index], &fds);
-
- if (tmpFDArray [index] > max_fd)
- max_fd = tmpFDArray [index];
+ int fd = tmpFDArray [index];
+ if (fd > 0)
+ {
+ FD_SET (tmpFDArray [index], &fds);
+
+ if (tmpFDArray [index] > max_fd)
+ max_fd = tmpFDArray [index];
+ }
}
}
-void
+static void
helper_get_filedescriptors (jintArray& fdArray, fd_set fds)
{
jint* tmpFDArray = elements (fdArray);
for (int index = 0; index < JvGetArrayLength (fdArray); index++)
- if (!FD_ISSET (tmpFDArray [index], &fds))
- tmpFDArray [index] = 0;
+ {
+ int fd = tmpFDArray [index];
+ if (fd < 0 || !FD_ISSET (fd, &fds))
+ tmpFDArray [index] = 0;
+ }
+}
+
+static void
+helper_reset (jintArray& fdArray)
+{
+ jint* tmpFDArray = elements (fdArray);
+
+ for (int index = 0; index < JvGetArrayLength (fdArray); index++)
+ tmpFDArray [index] = 0;
}
jint
@@ -53,13 +71,15 @@ gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
struct timeval real_time_data;
struct timeval *time_data = NULL;
- real_time_data.tv_sec = 0;
- real_time_data.tv_usec = timeout;
-
- // If not legal timeout value is given, use NULL.
- // This means an infinite timeout.
- if (timeout >= 0)
+ // If a legal timeout value isn't given, use NULL.
+ // This means an infinite timeout. The specification
+ // also says that a zero timeout should be treated
+ // as infinite. Otherwise (if the timeout value is legal),
+ // fill our timeval struct and use it for the select.
+ if (timeout > 0)
{
+ real_time_data.tv_sec = timeout / 1000;
+ real_time_data.tv_usec = (timeout % 1000) * 1000;
time_data = &real_time_data;
}
@@ -74,7 +94,23 @@ gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
helper_put_filedescriptors (except, except_fds, max_fd);
// Actually do the select
- result = _Jv_select (max_fd + 1, &read_fds, &write_fds, &except_fds, time_data);
+ try
+ {
+ result = _Jv_select (max_fd + 1, &read_fds, &write_fds,
+ &except_fds, time_data);
+ }
+ catch (::java::io::InterruptedIOException *e)
+ {
+ // The behavior of JRE 1.4.1 is that no exception is thrown
+ // when the thread is interrupted, but the thread's interrupt
+ // status is set. Clear all of our select sets and return 0,
+ // indicating that nothing was selected.
+ ::java::lang::Thread::currentThread ()->interrupt ();
+ helper_reset (read);
+ helper_reset (write);
+ helper_reset (except);
+ return 0;
+ }
if (result < 0)
{
diff --git a/libjava/gnu/java/nio/natSelectorImplWin32.cc b/libjava/gnu/java/nio/natSelectorImplWin32.cc
new file mode 100644
index 00000000000..34c4deb0e96
--- /dev/null
+++ b/libjava/gnu/java/nio/natSelectorImplWin32.cc
@@ -0,0 +1,93 @@
+// natSelectorImplWin32.cc
+
+/* Copyright (C) 2003 Free Software Foundation
+
+ This file is part of libgcj.
+
+This software is copyrighted work licensed under the terms of the
+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
+details. */
+
+#include <config.h>
+#include <platform.h>
+
+#include <gnu/java/nio/SelectorImpl.h>
+#include <java/lang/Thread.h>
+
+jint
+gnu::java::nio::SelectorImpl::implSelect (jintArray read, jintArray write,
+ jintArray except, jlong timeout)
+{
+ // FIXME: The API for implSelect is biased towards POSIX implementations.
+ jint* pReadFD = elements (read);
+ int nNbReadFDs = JvGetArrayLength (read);
+
+ jint* pWriteFD = elements (write);
+ int nNbWriteFDs = JvGetArrayLength (write);
+
+ int nNbEvents = nNbReadFDs + nNbWriteFDs;
+
+ // Create and initialize our event wrapper array
+
+ // FIXME: We're creating fresh WSAEVENTs for each call.
+ // This is inefficient. It would probably be better to cache these
+ // in the Win32 socket implementation class.
+ WSAEventWrapper aArray[nNbEvents];
+
+ int nCurIndex = 0;
+ for (int i=0; i < nNbReadFDs; ++i)
+ aArray[nCurIndex++].init(pReadFD[i], FD_ACCEPT | FD_READ);
+
+ for (int i=0; i < nNbWriteFDs; ++i)
+ aArray[nCurIndex++].init(pWriteFD[i], FD_WRITE);
+
+ // Build our array of WSAEVENTs to wait on. Also throw in our thread's
+ // interrupt event in order to detect thread interruption.
+ HANDLE arh[nNbEvents + 1];
+ for (int i=0; i < nNbEvents; ++i)
+ arh[i] = aArray[i].getEventHandle();
+ arh[nNbEvents] = _Jv_Win32GetInterruptEvent ();
+
+ // A timeout value of 0 needs to be treated as infinite.
+ if (timeout <= 0)
+ timeout = WSA_INFINITE;
+
+ // Do the select.
+ DWORD dwRet = WSAWaitForMultipleEvents (nNbEvents+1, arh, 0, timeout, false);
+
+ if (dwRet == WSA_WAIT_FAILED)
+ _Jv_ThrowIOException ();
+
+ // Before we do anything else, clear output file descriptor arrays.
+ memset(pReadFD, 0, sizeof(jint) * nNbReadFDs);
+ memset(pWriteFD, 0, sizeof(jint) * nNbWriteFDs);
+ memset(elements (except), 0, sizeof(jint) * JvGetArrayLength (except));
+
+ if (dwRet == DWORD(WSA_WAIT_EVENT_0 + nNbEvents))
+ {
+ // We were interrupted. Set the current thread's interrupt
+ // status and get out of here, with nothing selected..
+ ::java::lang::Thread::currentThread ()->interrupt ();
+ return 0;
+ }
+ else if (dwRet < DWORD(WSA_WAIT_EVENT_0 + nNbEvents))
+ {
+ int nSelectedEventIndex = dwRet - WSA_WAIT_EVENT_0;
+
+ // Record the selected file descriptor.
+ // FIXME: This implementation only allows one file descriptor
+ // to be selected at a time. Remedy this by looping on
+ // WSAWaitForMultipleEvents 'til nothing more is selected.
+ jint fd = aArray[nSelectedEventIndex].getFD();
+ if (nSelectedEventIndex < nNbReadFDs)
+ pReadFD[0] = fd;
+ else
+ pWriteFD[0] = fd;
+
+ return 1;
+ }
+ else
+ // None of the event objects was signalled, so nothing was
+ // selected.
+ return 0;
+}
diff --git a/libjava/gnu/java/rmi/server/RMIVoidValue.java b/libjava/gnu/java/rmi/server/RMIVoidValue.java
new file mode 100644
index 00000000000..7829fc60138
--- /dev/null
+++ b/libjava/gnu/java/rmi/server/RMIVoidValue.java
@@ -0,0 +1,51 @@
+/* RMIVoidValue.java
+ Copyright (c) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package gnu.java.rmi.server;
+
+/**
+ * Package private class used to indicate a void return type.
+ * INSTANCE is the only object of this class ever made.
+ */
+final class RMIVoidValue
+{
+ static RMIVoidValue INSTANCE = new RMIVoidValue();
+
+ private RMIVoidValue()
+ {
+ }
+}
diff --git a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java b/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
index d54dcf1d4cd..3b9aa40e0b8 100644
--- a/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
+++ b/libjava/gnu/java/rmi/server/UnicastConnectionManager.java
@@ -152,6 +152,9 @@ private static void startScavenger(){
if (debug) System.out.println("************* exit scavenger.");
}
});
+ // As it is used for client connection, we may put this thread
+ // in daemon state to prevent the VM from blocking when exiting.
+ scavenger.setDaemon(true);
scavenger.start();
}
diff --git a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java b/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
index 68d1bfe01d8..2d7d6d4a9ff 100644
--- a/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
+++ b/libjava/gnu/java/rmi/server/UnicastRemoteCall.java
@@ -65,6 +65,7 @@ public class UnicastRemoteCall
private long hash;
private Vector vec;
private int ptr;
+ private ObjID objid;
private ObjectOutput oout;
private ObjectInput oin;
@@ -86,22 +87,7 @@ public class UnicastRemoteCall
this.conn = conn;
this.opnum = opnum;
this.hash = hash;
-
- // signal the call when constructing
- try
- {
- DataOutputStream dout = conn.getDataOutputStream();
- dout.write(MESSAGE_CALL);
-
- oout = conn.getObjectOutputStream();
- objid.write(oout);
- oout.writeInt(opnum);
- oout.writeLong(hash);
- }
- catch(IOException ex)
- {
- throw new MarshalException("Try to write header but failed.", ex);
- }
+ this.objid = objid;
}
UnicastConnection getConnection()
@@ -111,22 +97,43 @@ public class UnicastRemoteCall
public ObjectOutput getOutputStream() throws IOException
{
- if (conn != null)
- {
- if(oout == null)
- return (oout = conn.getObjectOutputStream());
- else
- return oout;
- }
- else
- {
- vec = new Vector();
- return (new DummyObjectOutputStream());
- }
+ if (vec == null)
+ vec = new Vector();
+ return (new DummyObjectOutputStream());
}
public void releaseOutputStream() throws IOException
{
+ if (vec != null)
+ {
+ oout = conn.getObjectOutputStream();
+
+ for (int i = 0; i < vec.size(); i += 2)
+ {
+ boolean primitive = ((Boolean)vec.elementAt(i)).booleanValue();
+ Object data = vec.elementAt(i+1);
+
+ // No type, this is
+ if (!primitive)
+ oout.writeObject(data);
+ else
+ {
+ if (data instanceof Boolean)
+ oout.writeBoolean(((Boolean)data).booleanValue());
+ else if (data instanceof Character)
+ oout.writeChar(((Character)data).charValue());
+ else if (data instanceof Byte)
+ oout.writeByte(((Byte)data).byteValue());
+ else if (data instanceof Short)
+ oout.writeShort(((Short)data).shortValue());
+ else if (data instanceof Integer)
+ oout.writeInt(((Integer)data).intValue());
+ else if (data instanceof Long)
+ oout.writeLong(((Long)data).longValue());
+ }
+ }
+ vec = null;
+ }
if(oout != null)
oout.flush();
}
@@ -163,6 +170,23 @@ public class UnicastRemoteCall
{
byte returncode;
ObjectInput oin;
+
+ // signal the call when constructing
+ try
+ {
+ DataOutputStream dout = conn.getDataOutputStream();
+ dout.write(MESSAGE_CALL);
+
+ oout = conn.getObjectOutputStream();
+ objid.write(oout);
+ oout.writeInt(opnum);
+ oout.writeLong(hash);
+ }
+ catch(IOException ex)
+ {
+ throw new MarshalException("Try to write header but failed.", ex);
+ }
+
try
{
releaseOutputStream();
@@ -211,9 +235,15 @@ public class UnicastRemoteCall
// conn.disconnect();
}
+ boolean isReturnValue()
+ {
+ return vec.size() > 0;
+ }
+
Object returnValue()
{
- return (vec.size() > 0 ? vec.elementAt(0) : null);
+ // This is not the first one (Boolean) but the second.
+ return vec.elementAt(1);
}
Object[] getArguments()
@@ -256,46 +286,55 @@ public class UnicastRemoteCall
public void writeBoolean(boolean v) throws IOException
{
- vec.addElement(new Boolean(v));
+ vec.addElement(Boolean.TRUE);
+ vec.addElement(Boolean.valueOf(v));
}
public void writeByte(int v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Byte((byte) v));
}
public void writeChar(int v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Character((char) v));
}
public void writeDouble(double v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Double(v));
}
public void writeFloat(float v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Float(v));
}
public void writeInt(int v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Integer(v));
}
public void writeLong(long v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Long(v));
}
public void writeShort(int v) throws IOException
{
+ vec.addElement(Boolean.TRUE);
vec.addElement(new Short((short) v));
}
public void writeObject(Object obj) throws IOException
{
+ vec.addElement(Boolean.FALSE);
vec.addElement(obj);
}
diff --git a/libjava/gnu/java/rmi/server/UnicastServer.java b/libjava/gnu/java/rmi/server/UnicastServer.java
index baa1ef1aa4a..fb6ec1f35a5 100644
--- a/libjava/gnu/java/rmi/server/UnicastServer.java
+++ b/libjava/gnu/java/rmi/server/UnicastServer.java
@@ -144,7 +144,7 @@ private static void incomingMessageCall(UnicastConnection conn) throws IOExcepti
(new UID()).write(out);
if(returnval != null && returncls != null)
((RMIObjectOutputStream)out).writeValue(returnval, returncls);
- else
+ else if (!(returnval instanceof RMIVoidValue))
out.writeObject(returnval);
out.flush();
diff --git a/libjava/gnu/java/rmi/server/UnicastServerRef.java b/libjava/gnu/java/rmi/server/UnicastServerRef.java
index e2f38ff5f8c..b004927502f 100644
--- a/libjava/gnu/java/rmi/server/UnicastServerRef.java
+++ b/libjava/gnu/java/rmi/server/UnicastServerRef.java
@@ -254,8 +254,11 @@ public Object incomingMessageCall(UnicastConnection conn, int method, long hash)
throw new NoSuchMethodException();
}
UnicastRemoteCall call = new UnicastRemoteCall(conn);
- skel.dispatch(myself, call, method, hash);
- return (call.returnValue());
+ skel.dispatch(myself, call, method, hash);
+ if (!call.isReturnValue())
+ return RMIVoidValue.INSTANCE;
+ else
+ return (call.returnValue());
}
}
diff --git a/libjava/include/config.h.in b/libjava/include/config.h.in
index d05af6b6cdc..8a715f1a770 100644
--- a/libjava/include/config.h.in
+++ b/libjava/include/config.h.in
@@ -272,6 +272,9 @@
/* Define if we should ignore arguments to main(). */
#undef DISABLE_MAIN_ARGS
+/* Define if MinGW libgcj uses the Windows UNICODE OS API. */
+#undef MINGW_LIBGCJ_UNICODE
+
/* Define if if the synchronization code should try to avoid pthread_self calls by caching thread IDs in a hashtable. */
#undef SLOW_PTHREAD_SELF
diff --git a/libjava/include/jni.h b/libjava/include/jni.h
index cab4571b094..4e39e646f51 100644
--- a/libjava/include/jni.h
+++ b/libjava/include/jni.h
@@ -178,22 +178,30 @@ typedef void *jmethodID;
#define JNIIMPORT __declspec(dllimport)
#define JNIEXPORT __declspec(dllexport)
+
#define JNICALL __stdcall
-#else
+/* These defines apply to symbols in libgcj */
+#ifdef __GCJ_DLL__
+# ifdef __GCJ_JNI_IMPL__
+# define __GCJ_JNIIMPEXP__ JNIEXPORT
+# else
+# define __GCJ_JNIIMPEXP__ JNIIMPORT
+# endif /* ! __GCJ_JNI_IMPL__ */
+#else /* ! __GCJ_DLL__ */
+# define __GCJ_JNIIMPEXP__
+#endif /* __GCJ_DLL__ */
+
+#else /* !( _WIN32 || __WIN32__ || WIN32) */
#define JNIIMPORT
#define JNIEXPORT
#define JNICALL
+#define __GCJ_JNIIMPEXP__
#endif /* !( _WIN32 || __WIN32__ || WIN32) */
-#ifdef __GCJ_JNI_IMPL__
-#define JNIIMPEXP JNIEXPORT
-#else
-#define JNIIMPEXP JNIIMPORT
-#endif /* ! __GCJ_JNI_IMPL__ */
-
+
#ifdef __cplusplus
extern "C"
{
@@ -206,9 +214,14 @@ extern JNIEXPORT void JNICALL JNI_OnUnload (JavaVM *, void *);
/* These functions are called by user code to start using the
invocation API. */
-extern JNIIMPEXP jint JNICALL JNI_GetDefaultJavaVMInitArgs (void *);
-extern JNIIMPEXP jint JNICALL JNI_CreateJavaVM (JavaVM **, void **, void *);
-extern JNIIMPEXP jint JNICALL JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
+extern __GCJ_JNIIMPEXP__ jint JNICALL
+JNI_GetDefaultJavaVMInitArgs (void *);
+
+extern __GCJ_JNIIMPEXP__ jint JNICALL
+JNI_CreateJavaVM (JavaVM **, void **, void *);
+
+extern __GCJ_JNIIMPEXP__ jint JNICALL
+JNI_GetCreatedJavaVMs(JavaVM **, jsize, jsize *);
#ifdef __cplusplus
}
diff --git a/libjava/include/win32.h b/libjava/include/win32.h
index e169adf9b28..8dd2964e637 100644
--- a/libjava/include/win32.h
+++ b/libjava/include/win32.h
@@ -11,6 +11,16 @@ details. */
#ifndef __JV_WIN32_H__
#define __JV_WIN32_H__
+// Enable UNICODE Support.?
+
+#ifdef MINGW_LIBGCJ_UNICODE
+#define UNICODE
+#define _UNICODE
+#endif // MINGW_LIBGCJ_UNICODE
+
+#include <tchar.h>
+
+// Includes
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#undef WIN32_LEAN_AND_MEAN
@@ -23,6 +33,43 @@ details. */
#include <io.h>
+/* Begin UNICODE Support Classes and Functions */
+
+/* Helper class which creates a temporary, null-terminated,
+ wide-character C string. */
+class _Jv_Win32TempString
+{
+public:
+ _Jv_Win32TempString(jstring jstr);
+ ~_Jv_Win32TempString();
+
+// Accessors
+ operator LPCTSTR() const
+ {
+ return buf_;
+ }
+ LPCTSTR buf() const
+ {
+ return buf_;
+ }
+ LPTSTR buf()
+ {
+ return buf_;
+ }
+
+private:
+ TCHAR stackbuf_[500];
+ LPTSTR buf_;
+};
+
+// Mimics the JV_TEMP_STRING_UTF macro in jvm.h
+#define JV_TEMP_STRING_WIN32(x,y) _Jv_Win32TempString x(y);
+
+// Creates a jstring from a LPCTSTR
+extern jstring _Jv_Win32NewString (LPCTSTR pcsz);
+
+/* End UNICODE Helpers */
+
// Prefix and suffix for shared libraries.
#define _Jv_platform_solib_prefix ""
#define _Jv_platform_solib_suffix ".dll"
@@ -46,25 +93,36 @@ details. */
/* Useful helper classes and methods. */
/* A C++ wrapper around a WSAEVENT which closes the event
- in its destructor. If dwSelFlags is non-zero, we also
- issue an WSAEventSelect on the socket descriptor with
- the given flags; this is undone by a corresponding call
- to WSAEventSelect(fd, 0, 0) in our destructor. */
+ in its destructor. If dwSelFlags is non-zero, we also
+ issue an WSAEventSelect on the socket descriptor with
+ the given flags; this is undone by a corresponding call
+ to WSAEventSelect(fd, 0, 0) in our destructor. */
class WSAEventWrapper
{
public:
- WSAEventWrapper(int fd, DWORD dwSelFlags);
- ~WSAEventWrapper();
+ // Default constructor. Call init() after this.
+ WSAEventWrapper();
+ WSAEventWrapper(int fd, DWORD dwSelFlags);
+ ~WSAEventWrapper();
+
+ // Used for two-step initialization after calling
+ // default constructor.
+ void init(int fd, DWORD dwSelFlags);
+
+ int getFD()
+ {
+ return m_fd;
+ }
- WSAEVENT getEventHandle()
- {
- return m_hEvent;
- }
+ WSAEVENT getEventHandle()
+ {
+ return m_hEvent;
+ }
private:
- WSAEVENT m_hEvent;
- int m_fd;
- DWORD m_dwSelFlags;
+ WSAEVENT m_hEvent;
+ int m_fd;
+ DWORD m_dwSelFlags;
};
// Error string text. The int argument is compatible
@@ -94,14 +152,10 @@ _Jv_ThrowSocketException ();
extern void _Jv_platform_initialize (void);
extern void _Jv_platform_initProperties (java::util::Properties*);
extern jlong _Jv_platform_gettimeofday ();
-extern int _Jv_select (int n, fd_set *, fd_set *, fd_set *, struct timeval *);
extern int _Jv_pipe (int filedes[2]);
-inline void
-_Jv_platform_close_on_exec (jint)
-{
- // Ignore.
-}
+extern void
+_Jv_platform_close_on_exec (HANDLE h);
#ifdef JV_HASH_SYNCHRONIZATION
/* Suspends the execution of the current thread for the specified
diff --git a/libjava/java/awt/Choice.java b/libjava/java/awt/Choice.java
index 0b5e3d61dad..863888c5b37 100644
--- a/libjava/java/awt/Choice.java
+++ b/libjava/java/awt/Choice.java
@@ -171,7 +171,15 @@ add(String item)
}
if (i == 0)
- select (0);
+ {
+ selectedIndex = 0;
+ // We must generate an ItemEvent here
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent (
+ new ItemEvent ((ItemSelectable)this,
+ ItemEvent.ITEM_STATE_CHANGED,
+ getItem(0),
+ ItemEvent.SELECTED));
+ }
}
/*************************************************************************/
@@ -223,7 +231,15 @@ insert(String item, int index)
}
if (getItemCount () == 1 || selectedIndex >= index)
+ {
select (0);
+ // We must generate an ItemEvent here
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent (
+ new ItemEvent ((ItemSelectable)this,
+ ItemEvent.ITEM_STATE_CHANGED,
+ getItem(0),
+ ItemEvent.SELECTED));
+ }
}
/*************************************************************************/
@@ -265,8 +281,16 @@ remove(int index)
cp.remove (index);
}
- if (index == selectedIndex)
+ if ((index == selectedIndex) && (getItemCount() > 0))
+ {
select (0);
+ // We must generate an ItemEvent here
+ Toolkit.getDefaultToolkit().getSystemEventQueue().postEvent (
+ new ItemEvent ((ItemSelectable)this,
+ ItemEvent.ITEM_STATE_CHANGED,
+ getItem(0),
+ ItemEvent.SELECTED));
+ }
else if (selectedIndex > index)
--selectedIndex;
}
@@ -281,11 +305,27 @@ removeAll()
{
int count = getItemCount();
- for (int i = 0; i < count; i++)
+ if (count <= 0)
+ return;
+
+ ChoicePeer cp = (ChoicePeer) peer;
+
+ // Select the first item to prevent an spurious ItemEvent to be generated
+ if (cp != null)
+ {
+ cp.select (0);
+ selectedIndex = 0; // Just to keep consistent
+ }
+
+ for (int i = (count - 1); i >= 0; i--)
{
- // Always remove 0.
- remove(0);
+ // Always remove the last to avoid generation of ItemEvents.
+ pItems.removeElementAt(i);
+ if (cp != null)
+ cp.remove (i);
}
+
+ selectedIndex = -1;
}
/*************************************************************************/
diff --git a/libjava/java/awt/Component.java b/libjava/java/awt/Component.java
index d70ed50be1c..9c93bd0a527 100644
--- a/libjava/java/awt/Component.java
+++ b/libjava/java/awt/Component.java
@@ -555,6 +555,17 @@ public abstract class Component
*/
transient BufferStrategy bufferStrategy;
+ /**
+ * The system properties that affect image updating.
+ */
+ private static transient boolean incrementalDraw;
+ private static transient Long redrawRate;
+
+ static
+ {
+ incrementalDraw = Boolean.getBoolean ("awt.image.incrementalDraw");
+ redrawRate = Long.getLong ("awt.image.redrawrate");
+ }
// Public and protected API.
@@ -1832,7 +1843,9 @@ public abstract class Component
* @param y the Y coordinate
* @param w the width
* @param h the height
- * @return true if the image has been fully loaded
+ * @return false if the image is completely loaded, loading has been
+ * aborted, or an error has occurred. true if more updates are
+ * required.
* @see ImageObserver
* @see Graphics#drawImage(Image, int, int, Color, ImageObserver)
* @see Graphics#drawImage(Image, int, int, ImageObserver)
@@ -1842,8 +1855,24 @@ public abstract class Component
*/
public boolean imageUpdate(Image img, int flags, int x, int y, int w, int h)
{
- // XXX Implement.
- throw new Error("not implemented");
+ if ((flags & (FRAMEBITS | ALLBITS)) != 0)
+ repaint ();
+ else if ((flags & SOMEBITS) != 0)
+ {
+ if (incrementalDraw)
+ {
+ if (redrawRate != null)
+ {
+ long tm = redrawRate.longValue();
+ if (tm < 0)
+ tm = 0;
+ repaint (tm);
+ }
+ else
+ repaint (100);
+ }
+ }
+ return (flags & (ALLBITS | ABORT | ERROR)) == 0;
}
/**
@@ -1854,8 +1883,11 @@ public abstract class Component
*/
public Image createImage(ImageProducer producer)
{
- // XXX What if peer or producer is null?
- return peer.createImage(producer);
+ // Sun allows producer to be null.
+ if (peer != null)
+ return peer.createImage(producer);
+ else
+ return getToolkit().createImage(producer);
}
/**
diff --git a/libjava/java/awt/FlowLayout.java b/libjava/java/awt/FlowLayout.java
index d26b8d13c2b..98d74941ea8 100644
--- a/libjava/java/awt/FlowLayout.java
+++ b/libjava/java/awt/FlowLayout.java
@@ -214,7 +214,8 @@ public class FlowLayout implements LayoutManager, Serializable
if (comps[k].visible)
{
Dimension c = comps[k].getPreferredSize ();
- comps[k].setBounds (x, y, c.width, new_h);
+ comps[k].setBounds (x, y + (new_h - c.height) / 2,
+ c.width, c.height);
x += c.width + hgap;
}
}
diff --git a/libjava/java/awt/Font.java b/libjava/java/awt/Font.java
index d1ff566e559..809684311f0 100644
--- a/libjava/java/awt/Font.java
+++ b/libjava/java/awt/Font.java
@@ -1226,9 +1226,6 @@ hashCode()
public boolean
equals(Object obj)
{
- if (obj == null)
- return(false);
-
if (!(obj instanceof Font))
return(false);
diff --git a/libjava/java/awt/GridBagLayout.java b/libjava/java/awt/GridBagLayout.java
index dd49a1cf905..7572c1d1d56 100644
--- a/libjava/java/awt/GridBagLayout.java
+++ b/libjava/java/awt/GridBagLayout.java
@@ -229,10 +229,15 @@ public class GridBagLayout
*/
public int[][] getLayoutDimensions ()
{
+ int[][] result = new int [2][];
if (layoutInfo == null)
- return new int [2][];
+ {
+ result[0] = new int[0];
+ result[1] = new int[0];
+
+ return result;
+ }
- int[][] result = new int [2][];
result [0] = new int [layoutInfo.cols];
System.arraycopy (layoutInfo.colWidths, 0, result [0], 0, layoutInfo.cols);
result [1] = new int [layoutInfo.rows];
@@ -242,10 +247,15 @@ public class GridBagLayout
public double[][] getLayoutWeights ()
{
- if (layoutInfo == null)
- return new double [2][];
-
double[][] result = new double [2][];
+ if (layoutInfo == null)
+ {
+ result[0] = new double[0];
+ result[1] = new double[0];
+
+ return result;
+ }
+
result [0] = new double [layoutInfo.cols];
System.arraycopy (layoutInfo.colWeights, 0, result [0], 0, layoutInfo.cols);
result [1] = new double [layoutInfo.rows];
diff --git a/libjava/java/awt/List.java b/libjava/java/awt/List.java
index 2f4932ef29f..79b2faa6299 100644
--- a/libjava/java/awt/List.java
+++ b/libjava/java/awt/List.java
@@ -647,8 +647,21 @@ clear()
public synchronized void
replaceItem(String item, int index) throws IllegalArgumentException
{
- remove(index);
- addItem(item, index);
+ if ((index < 0) || (index >= items.size()))
+ throw new IllegalArgumentException("Bad list index: " + index);
+
+ items.insertElementAt(item, index + 1);
+ items.removeElementAt (index);
+
+ if (peer != null)
+ {
+ ListPeer l = (ListPeer) peer;
+
+ /* We add first and then remove so that the selected
+ item remains the same */
+ l.add (item, index + 1);
+ l.delItems (index, index);
+ }
}
/*************************************************************************/
@@ -668,7 +681,7 @@ getSelectedIndex()
selected = l.getSelectedIndexes ();
}
- if (selected == null || selected.length > 1)
+ if (selected == null || selected.length != 1)
return -1;
return selected[0];
}
diff --git a/libjava/java/awt/MediaTracker.java b/libjava/java/awt/MediaTracker.java
index 0f4e1c3aeda..b1157349b5b 100644
--- a/libjava/java/awt/MediaTracker.java
+++ b/libjava/java/awt/MediaTracker.java
@@ -88,8 +88,8 @@ public class MediaTracker implements java.io.Serializable
{
MediaTracker.this.notifyAll();
}
-
- return ((status & COMPLETE) != 0);
+ // If status is not COMPLETE then we need more updates.
+ return (status & COMPLETE) == 0;
}
}
diff --git a/libjava/java/awt/MenuComponent.java b/libjava/java/awt/MenuComponent.java
index 7cd85325747..ccf2b497443 100644
--- a/libjava/java/awt/MenuComponent.java
+++ b/libjava/java/awt/MenuComponent.java
@@ -1,5 +1,5 @@
/* MenuComponent.java -- Superclass of all AWT menu components
- Copyright (C) 1999, 2000, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.awt;
import java.awt.peer.MenuComponentPeer;
+import java.io.Serializable;
// FIXME: Java 1.0 event model unimplemented
@@ -47,7 +48,7 @@ import java.awt.peer.MenuComponentPeer;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public abstract class MenuComponent implements java.io.Serializable
+public abstract class MenuComponent implements Serializable
{
/*
diff --git a/libjava/java/awt/MenuItem.java b/libjava/java/awt/MenuItem.java
index 55e2666af91..02c4d0d0999 100644
--- a/libjava/java/awt/MenuItem.java
+++ b/libjava/java/awt/MenuItem.java
@@ -1,5 +1,5 @@
/* MenuItem.java -- An item in a menu
- Copyright (C) 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,6 +41,7 @@ package java.awt;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.peer.MenuItemPeer;
+import java.io.Serializable;
import java.lang.reflect.Array;
import java.util.EventListener;
@@ -49,7 +50,8 @@ import java.util.EventListener;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class MenuItem extends MenuComponent implements java.io.Serializable
+public class MenuItem extends MenuComponent
+ implements Serializable
{
// FIXME: The enabled event mask is not used at this time.
diff --git a/libjava/java/awt/Polygon.java b/libjava/java/awt/Polygon.java
index 1f51ac811d6..113dad992d2 100644
--- a/libjava/java/awt/Polygon.java
+++ b/libjava/java/awt/Polygon.java
@@ -185,7 +185,7 @@ public class Polygon implements Shape, Serializable
while (--i >= 0)
{
xpoints[i] += dx;
- xpoints[i] += dy;
+ ypoints[i] += dy;
}
if (bounds != null)
{
diff --git a/libjava/java/awt/TextComponent.java b/libjava/java/awt/TextComponent.java
index cbe7dc9169d..f0c5d6f54b2 100644
--- a/libjava/java/awt/TextComponent.java
+++ b/libjava/java/awt/TextComponent.java
@@ -1,5 +1,5 @@
/* TextComponent.java -- Widgets for entering text
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,6 +42,7 @@ import java.awt.event.TextEvent;
import java.awt.event.TextListener;
import java.awt.peer.TextComponentPeer;
import java.awt.peer.ComponentPeer;
+import java.io.Serializable;
import java.util.EventListener;
/**
@@ -50,7 +51,8 @@ import java.util.EventListener;
*
* @author Aaron M. Renn (arenn@urbanophile.com)
*/
-public class TextComponent extends Component implements java.io.Serializable
+public class TextComponent extends Component
+ implements Serializable
{
/*
@@ -163,7 +165,7 @@ getSelectedText()
/**
* Returns the starting position of the selected text region.
- * // FIXME: What is returned if there is no selected text?
+ * If the text is not selected then caret position is returned.
*
* @return The starting position of the selected text region.
*/
@@ -196,7 +198,7 @@ setSelectionStart(int selectionStart)
/**
* Returns the ending position of the selected text region.
- * // FIXME: What is returned if there is no selected text.
+ * If the text is not selected, then caret position is returned
*
* @return The ending position of the selected text region.
*/
diff --git a/libjava/java/awt/datatransfer/DataFlavor.java b/libjava/java/awt/datatransfer/DataFlavor.java
index e56f9759a50..004604ac5cf 100644
--- a/libjava/java/awt/datatransfer/DataFlavor.java
+++ b/libjava/java/awt/datatransfer/DataFlavor.java
@@ -459,7 +459,7 @@ getParameter(String paramName, String mimeString)
if (idx == -1)
return(null);
- String value = mimeString.substring(idx + paramName.length() + 2);
+ String value = mimeString.substring(idx + paramName.length() + 1);
idx = value.indexOf(" ");
if (idx == -1)
@@ -723,9 +723,6 @@ equals(DataFlavor flavor)
public boolean
equals(Object obj)
{
- if (obj == null)
- return(false);
-
if (!(obj instanceof DataFlavor))
return(false);
diff --git a/libjava/java/awt/datatransfer/StringSelection.java b/libjava/java/awt/datatransfer/StringSelection.java
index 6db74503bb3..51addb7296c 100644
--- a/libjava/java/awt/datatransfer/StringSelection.java
+++ b/libjava/java/awt/datatransfer/StringSelection.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.awt.datatransfer;
-import java.io.StringBufferInputStream;
+import java.io.StringReader;
import java.io.IOException;
/**
@@ -140,7 +140,15 @@ getTransferData(DataFlavor flavor) throws UnsupportedFlavorException,
if (!isDataFlavorSupported(flavor))
throw new UnsupportedFlavorException(flavor);
- return(new StringBufferInputStream(data));
+ if (DataFlavor.plainTextFlavor == flavor)
+ /* The behavior of this method for DataFlavor.plainTextFlavor and
+ equivalent DataFlavors is inconsistent with the definition of
+ DataFlavor.plainTextFlavor. We choose to do like Sun's implementation
+ and return a Reader instead of an InputString. */
+ /* return(new StringBufferInputStream(data)); */
+ return(new StringReader(data));
+ else // DataFlavor.stringFlavor
+ return data;
}
/*************************************************************************/
diff --git a/libjava/java/awt/font/TextLayout.java b/libjava/java/awt/font/TextLayout.java
index 60c4966737a..b58b5a58349 100644
--- a/libjava/java/awt/font/TextLayout.java
+++ b/libjava/java/awt/font/TextLayout.java
@@ -43,8 +43,12 @@ import java.awt.Graphics2D;
import java.awt.Shape;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
+import java.text.CharacterIterator;
import java.text.AttributedCharacterIterator;
+import java.text.AttributedString;
import java.util.Map;
+import java.awt.font.TextAttribute;
+
/**
* @author Michael Koch
@@ -67,24 +71,26 @@ public final class TextLayout implements Cloneable
}
}
+ private AttributedString attributedString;
private FontRenderContext fontRenderContext;
public TextLayout (AttributedCharacterIterator text, FontRenderContext frc)
- {
- // FIXME
- this.fontRenderContext = frc;
+ {
+ attributedString = new AttributedString (text);
+ fontRenderContext = frc;
}
public TextLayout (String string, Font font, FontRenderContext frc)
{
- // FIXME
- this.fontRenderContext = frc;
+ attributedString = new AttributedString (string);
+ attributedString.addAttribute (TextAttribute.FONT, font);
+ fontRenderContext = frc;
}
public TextLayout (String string, Map attributes, FontRenderContext frc)
{
- // FIXME
- this.fontRenderContext = frc;
+ attributedString = new AttributedString (string, attributes);
+ fontRenderContext = frc;
}
protected Object clone ()
@@ -100,9 +106,147 @@ public final class TextLayout implements Cloneable
}
}
+
+ protected class CharacterIteratorProxy
+ implements CharacterIterator
+ {
+ public CharacterIterator target;
+ public int begin;
+ public int limit;
+ public int index;
+
+ public CharacterIteratorProxy (CharacterIterator ci)
+ {
+ target = ci;
+ }
+
+ public int getBeginIndex ()
+ {
+ return begin;
+ }
+
+ public int getEndIndex ()
+ {
+ return limit;
+ }
+
+ public int getIndex ()
+ {
+ return index;
+ }
+
+ public char setIndex (int idx)
+ throws IllegalArgumentException
+ {
+ if (idx < begin || idx >= limit)
+ throw new IllegalArgumentException ();
+ char ch = target.setIndex (idx);
+ index = idx;
+ return ch;
+ }
+
+ public char first ()
+ {
+ int save = target.getIndex ();
+ char ch = target.setIndex (begin);
+ target.setIndex (save);
+ return ch;
+ }
+
+ public char last ()
+ {
+ if (begin == limit)
+ return this.first ();
+
+ int save = target.getIndex ();
+ char ch = target.setIndex (limit - 1);
+ target.setIndex (save);
+ return ch;
+ }
+
+ public char current ()
+ {
+ return target.current();
+ }
+
+ public char next ()
+ {
+ if (index >= limit - 1)
+ return CharacterIterator.DONE;
+ else
+ {
+ index++;
+ return target.next();
+ }
+ }
+
+ public char previous ()
+ {
+ if (index <= begin)
+ return CharacterIterator.DONE;
+ else
+ {
+ index--;
+ return target.previous ();
+ }
+ }
+
+ public Object clone ()
+ {
+ CharacterIteratorProxy cip = new CharacterIteratorProxy (this.target);
+ cip.begin = this.begin;
+ cip.limit = this.limit;
+ cip.index = this.index;
+ return cip;
+ }
+
+ }
+
+
public void draw (Graphics2D g2, float x, float y)
{
- throw new Error ("not implemented");
+ AttributedCharacterIterator ci = attributedString.getIterator ();
+ CharacterIteratorProxy proxy = new CharacterIteratorProxy (ci);
+ Font defFont = g2.getFont ();
+
+ /* Note: this implementation currently only interprets FONT text
+ * attributes. There is a reasonable argument to be made for some
+ * attributes being interpreted out here, where we have control of the
+ * Graphics2D and can construct or derive new fonts, and some
+ * attributes being interpreted by the GlyphVector itself. So far, for
+ * all attributes except FONT we do neither.
+ */
+
+ for (char c = ci.first ();
+ c != CharacterIterator.DONE;
+ c = ci.next ())
+ {
+ proxy.begin = ci.getIndex ();
+ proxy.limit = ci.getRunLimit(TextAttribute.FONT);
+ if (proxy.limit <= proxy.begin)
+ continue;
+
+ proxy.index = proxy.begin;
+
+ Object fnt = ci.getAttribute(TextAttribute.FONT);
+ GlyphVector gv;
+ if (fnt instanceof Font)
+ gv = ((Font)fnt).createGlyphVector (fontRenderContext, proxy);
+ else
+ gv = defFont.createGlyphVector (fontRenderContext, proxy);
+
+ g2.drawGlyphVector (gv, x, y);
+
+ int n = gv.getNumGlyphs ();
+ for (int i = 0; i < n; ++i)
+ {
+ GlyphMetrics gm = gv.getGlyphMetrics (i);
+ if (gm.getAdvanceX() == gm.getAdvance ())
+ x += gm.getAdvanceX ();
+ else
+ y += gm.getAdvanceY ();
+ }
+ }
}
public boolean equals (Object obj)
diff --git a/libjava/java/awt/geom/CubicCurve2D.java b/libjava/java/awt/geom/CubicCurve2D.java
index 2bc0b358b19..1e38d3ada9a 100644
--- a/libjava/java/awt/geom/CubicCurve2D.java
+++ b/libjava/java/awt/geom/CubicCurve2D.java
@@ -1,5 +1,5 @@
/* CubicCurve2D.java -- represents a parameterized cubic curve in 2-D space
- Copyright (C) 2002 Free Software Foundation
+ Copyright (C) 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -42,31 +42,168 @@ import java.awt.Rectangle;
import java.awt.Shape;
import java.util.NoSuchElementException;
+
/**
- * STUBS ONLY
- * XXX Implement and document.
+ * A two-dimensional curve that is parameterized with a cubic
+ * function.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Graydon Hoare (graydon@redhat.com)
+ * @author Sascha Brawer (brawer@dandelis.ch)
+ *
+ * @since 1.2
*/
-public abstract class CubicCurve2D implements Shape, Cloneable
+public abstract class CubicCurve2D
+ implements Shape, Cloneable
{
+ /**
+ * Constructs a new CubicCurve2D. Typical users will want to
+ * construct instances of a subclass, such as {@link
+ * CubicCurve2D.Float} or {@link CubicCurve2D.Double}.
+ */
protected CubicCurve2D()
{
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public abstract double getX1();
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public abstract double getY1();
+
+
+ /**
+ * Returns the curve&#x2019;s start point.
+ */
public abstract Point2D getP1();
+
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public abstract double getCtrlX1();
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public abstract double getCtrlY1();
+
+
+ /**
+ * Returns the curve&#x2019;s first control point.
+ */
public abstract Point2D getCtrlP1();
+
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public abstract double getCtrlX2();
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public abstract double getCtrlY2();
+
+
+ /**
+ * Returns the curve&#x2019;s second control point.
+ */
public abstract Point2D getCtrlP2();
+
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public abstract double getX2();
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public abstract double getY2();
+
+
+ /**
+ * Returns the curve&#x2019;s end point.
+ */
public abstract Point2D getP2();
+
+ /**
+ * Changes the curve geometry, separately specifying each coordinate
+ * value.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
+ * point.
+ */
public abstract void setCurve(double x1, double y1, double cx1, double cy1,
double cx2, double cy2, double x2, double y2);
+
+
+ /**
+ * Changes the curve geometry, specifying coordinate values in an
+ * array.
+ *
+ * @param coords an array containing the new coordinate values. The
+ * <i>x</i> coordinate of the new start point is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * new first control point is located at <code>coords[offset +
+ * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 3]</code>. The <i>x</i> coordinate of the new second control
+ * point is located at <code>coords[offset + 4]</code>, its <i>y</i>
+ * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
+ * coordinate of the new end point is located at <code>coords[offset
+ * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 7]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public void setCurve(double[] coords, int offset)
{
setCurve(coords[offset++], coords[offset++],
@@ -74,11 +211,51 @@ public abstract class CubicCurve2D implements Shape, Cloneable
coords[offset++], coords[offset++],
coords[offset++], coords[offset++]);
}
+
+
+ /**
+ * Changes the curve geometry, specifying coordinate values in
+ * separate Point objects.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * <p>The curve does not keep any reference to the passed point
+ * objects. Therefore, a later change to <code>p1</code>,
+ * <code>c1</code>, <code>c2</code> or <code>p2</code> will not
+ * affect the curve geometry.
+ *
+ * @param p1 the new start point.
+ * @param c1 the new first control point.
+ * @param c2 the new second control point.
+ * @param p2 the new end point.
+ */
public void setCurve(Point2D p1, Point2D c1, Point2D c2, Point2D p2)
{
setCurve(p1.getX(), p1.getY(), c1.getX(), c1.getY(),
c2.getX(), c2.getY(), p2.getX(), p2.getY());
}
+
+
+ /**
+ * Changes the curve geometry, specifying coordinate values in an
+ * array of Point objects.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * <p>The curve does not keep references to the passed point
+ * objects. Therefore, a later change to the <code>pts</code> array
+ * or any of its elements will not affect the curve geometry.
+ *
+ * @param pts an array containing the points. The new start point
+ * is located at <code>pts[offset]</code>, the new first control
+ * point at <code>pts[offset + 1]</code>, the new second control
+ * point at <code>pts[offset + 2]</code>, and the new end point
+ * at <code>pts[offset + 3]</code>.
+ *
+ * @param offset the offset of the start point in <code>pts</code>.
+ */
public void setCurve(Point2D[] pts, int offset)
{
setCurve(pts[offset].getX(), pts[offset++].getY(),
@@ -86,24 +263,115 @@ public abstract class CubicCurve2D implements Shape, Cloneable
pts[offset].getX(), pts[offset++].getY(),
pts[offset].getX(), pts[offset++].getY());
}
+
+
+ /**
+ * Changes the curve geometry to that of another curve.
+ *
+ * @param c the curve whose coordinates will be copied.
+ */
public void setCurve(CubicCurve2D c)
{
setCurve(c.getX1(), c.getY1(), c.getCtrlX1(), c.getCtrlY1(),
c.getCtrlX2(), c.getCtrlY2(), c.getX2(), c.getY2());
}
+
+
+ /**
+ * Calculates the squared flatness of a cubic curve, directly
+ * specifying each coordinate value. The flatness is the maximal
+ * distance of a control point to the line between start and end
+ * point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the square of the distance between C2 and the
+ * gray line, i.e. the squared length of the red line.
+ *
+ * @param x1 the <i>x</i> coordinate of the start point P1.
+ * @param y1 the <i>y</i> coordinate of the start point P1.
+ * @param cx1 the <i>x</i> coordinate of the first control point C1.
+ * @param cy1 the <i>y</i> coordinate of the first control point C1.
+ * @param cx2 the <i>x</i> coordinate of the second control point C2.
+ * @param cy2 the <i>y</i> coordinate of the second control point C2.
+ * @param x2 the <i>x</i> coordinate of the end point P2.
+ * @param y2 the <i>y</i> coordinate of the end point P2.
+ */
public static double getFlatnessSq(double x1, double y1, double cx1,
double cy1, double cx2, double cy2,
double x2, double y2)
{
- // XXX Implement.
- throw new Error("not implemented");
+ return Math.max(Line2D.ptSegDistSq(x1, y1, x2, y2, cx1, cy1),
+ Line2D.ptSegDistSq(x1, y1, x2, y2, cx2, cy2));
}
+
+
+ /**
+ * Calculates the flatness of a cubic curve, directly specifying
+ * each coordinate value. The flatness is the maximal distance of a
+ * control point to the line between start and end point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the distance between C2 and the gray line,
+ * i.e. the length of the red line.
+ *
+ * @param x1 the <i>x</i> coordinate of the start point P1.
+ * @param y1 the <i>y</i> coordinate of the start point P1.
+ * @param cx1 the <i>x</i> coordinate of the first control point C1.
+ * @param cy1 the <i>y</i> coordinate of the first control point C1.
+ * @param cx2 the <i>x</i> coordinate of the second control point C2.
+ * @param cy2 the <i>y</i> coordinate of the second control point C2.
+ * @param x2 the <i>x</i> coordinate of the end point P2.
+ * @param y2 the <i>y</i> coordinate of the end point P2.
+ */
public static double getFlatness(double x1, double y1, double cx1,
double cy1, double cx2, double cy2,
double x2, double y2)
{
return Math.sqrt(getFlatnessSq(x1, y1, cx1, cy1, cx2, cy2, x2, y2));
}
+
+
+ /**
+ * Calculates the squared flatness of a cubic curve, specifying the
+ * coordinate values in an array. The flatness is the maximal
+ * distance of a control point to the line between start and end
+ * point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the square of the distance between C2 and the
+ * gray line, i.e. the squared length of the red line.
+ *
+ * @param coords an array containing the coordinate values. The
+ * <i>x</i> coordinate of the start point P1 is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * first control point C1 is located at <code>coords[offset +
+ * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 3]</code>. The <i>x</i> coordinate of the second control point C2
+ * is located at <code>coords[offset + 4]</code>, its <i>y</i>
+ * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
+ * coordinate of the end point P2 is located at <code>coords[offset
+ * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 7]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public static double getFlatnessSq(double[] coords, int offset)
{
return getFlatnessSq(coords[offset++], coords[offset++],
@@ -111,6 +379,39 @@ public abstract class CubicCurve2D implements Shape, Cloneable
coords[offset++], coords[offset++],
coords[offset++], coords[offset++]);
}
+
+
+ /**
+ * Calculates the flatness of a cubic curve, specifying the
+ * coordinate values in an array. The flatness is the maximal
+ * distance of a control point to the line between start and end
+ * point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the distance between C2 and the gray line,
+ * i.e. the length of the red line.
+ *
+ * @param coords an array containing the coordinate values. The
+ * <i>x</i> coordinate of the start point P1 is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * first control point C1 is located at <code>coords[offset +
+ * 2]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 3]</code>. The <i>x</i> coordinate of the second control point C2
+ * is located at <code>coords[offset + 4]</code>, its <i>y</i>
+ * coordinate at <code>coords[offset + 5]</code>. The <i>x</i>
+ * coordinate of the end point P2 is located at <code>coords[offset
+ * + 6]</code>, its <i>y</i> coordinate at <code>coords[offset +
+ * 7]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public static double getFlatness(double[] coords, int offset)
{
return Math.sqrt(getFlatnessSq(coords[offset++], coords[offset++],
@@ -118,11 +419,43 @@ public abstract class CubicCurve2D implements Shape, Cloneable
coords[offset++], coords[offset++],
coords[offset++], coords[offset++]));
}
+
+
+ /**
+ * Calculates the squared flatness of this curve. The flatness is
+ * the maximal distance of a control point to the line between start
+ * and end point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the square of the distance between C2 and the
+ * gray line, i.e. the squared length of the red line.
+ */
public double getFlatnessSq()
{
return getFlatnessSq(getX1(), getY1(), getCtrlX1(), getCtrlY1(),
getCtrlX2(), getCtrlY2(), getX2(), getY2());
}
+
+
+ /**
+ * Calculates the flatness of this curve. The flatness is the
+ * maximal distance of a control point to the line between start and
+ * end point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. In comparison to C1,
+ * control point C2 is father away from the gray line. Therefore,
+ * the result will be the distance between C2 and the gray line,
+ * i.e. the length of the red line.
+ */
public double getFlatness()
{
return Math.sqrt(getFlatnessSq(getX1(), getY1(), getCtrlX1(),
@@ -130,75 +463,266 @@ public abstract class CubicCurve2D implements Shape, Cloneable
getX2(), getY2()));
}
- public void subdivide(CubicCurve2D l, CubicCurve2D r)
+
+ /**
+ * Subdivides this curve into two halves.
+ *
+ * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
+ * height="180" alt="A drawing that illustrates the effects of
+ * subdividing a CubicCurve2D" />
+ *
+ * @param left a curve whose geometry will be set to the left half
+ * of this curve, or <code>null</code> if the caller is not
+ * interested in the left half.
+ *
+ * @param right a curve whose geometry will be set to the right half
+ * of this curve, or <code>null</code> if the caller is not
+ * interested in the right half.
+ */
+ public void subdivide(CubicCurve2D left, CubicCurve2D right)
{
- if (l == null)
- l = new CubicCurve2D.Double();
- if (r == null)
- r = new CubicCurve2D.Double();
// Use empty slots at end to share single array.
double[] d = new double[] { getX1(), getY1(), getCtrlX1(), getCtrlY1(),
getCtrlX2(), getCtrlY2(), getX2(), getY2(),
0, 0, 0, 0, 0, 0 };
subdivide(d, 0, d, 0, d, 6);
- l.setCurve(d, 0);
- r.setCurve(d, 6);
+ if (left != null)
+ left.setCurve(d, 0);
+ if (right != null)
+ right.setCurve(d, 6);
}
+
+
+ /**
+ * Subdivides a cubic curve into two halves.
+ *
+ * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
+ * height="180" alt="A drawing that illustrates the effects of
+ * subdividing a CubicCurve2D" />
+ *
+ * @param src the curve to be subdivided.
+ *
+ * @param left a curve whose geometry will be set to the left half
+ * of <code>src</code>, or <code>null</code> if the caller is not
+ * interested in the left half.
+ *
+ * @param right a curve whose geometry will be set to the right half
+ * of <code>src</code>, or <code>null</code> if the caller is not
+ * interested in the right half.
+ */
public static void subdivide(CubicCurve2D src,
- CubicCurve2D l, CubicCurve2D r)
+ CubicCurve2D left, CubicCurve2D right)
{
- src.subdivide(l, r);
+ src.subdivide(left, right);
}
+
+
+ /**
+ * Subdivides a cubic curve into two halves, passing all coordinates
+ * in an array.
+ *
+ * <p><img src="doc-files/CubicCurve2D-3.png" width="700"
+ * height="180" alt="A drawing that illustrates the effects of
+ * subdividing a CubicCurve2D" />
+ *
+ * <p>The left end point and the right start point will always be
+ * identical. Memory-concious programmers thus may want to pass the
+ * same array for both <code>left</code> and <code>right</code>, and
+ * set <code>rightOff</code> to <code>leftOff + 6</code>.
+ *
+ * @param src an array containing the coordinates of the curve to be
+ * subdivided. The <i>x</i> coordinate of the start point P1 is
+ * located at <code>src[srcOff]</code>, its <i>y</i> at
+ * <code>src[srcOff + 1]</code>. The <i>x</i> coordinate of the
+ * first control point C1 is located at <code>src[srcOff +
+ * 2]</code>, its <i>y</i> at <code>src[srcOff + 3]</code>. The
+ * <i>x</i> coordinate of the second control point C2 is located at
+ * <code>src[srcOff + 4]</code>, its <i>y</i> at <code>src[srcOff +
+ * 5]</code>. The <i>x</i> coordinate of the end point is located at
+ * <code>src[srcOff + 6]</code>, its <i>y</i> at <code>src[srcOff +
+ * 7]</code>.
+ *
+ * @param srcOff an offset into <code>src</code>, specifying
+ * the index of the start point&#x2019;s <i>x</i> coordinate.
+ *
+ * @param left an array that will receive the coordinates of the
+ * left half of <code>src</code>. It is acceptable to pass
+ * <code>src</code>. A caller who is not interested in the left half
+ * can pass <code>null</code>.
+ *
+ * @param leftOff an offset into <code>left</code>, specifying the
+ * index where the start point&#x2019;s <i>x</i> coordinate will be
+ * stored.
+ *
+ * @param right an array that will receive the coordinates of the
+ * right half of <code>src</code>. It is acceptable to pass
+ * <code>src</code> or <code>left</code>. A caller who is not
+ * interested in the right half can pass <code>null</code>.
+ *
+ * @param rightOff an offset into <code>right</code>, specifying the
+ * index where the start point&#x2019;s <i>x</i> coordinate will be
+ * stored.
+ */
public static void subdivide(double[] src, int srcOff,
double[] left, int leftOff,
double[] right, int rightOff)
{
- // XXX Implement.
- throw new Error("not implemented");
+ // To understand this code, please have a look at the image
+ // "CubicCurve2D-3.png" in the sub-directory "doc-files".
+ double src_C1_x, src_C1_y, src_C2_x, src_C2_y;
+ double left_P1_x, left_P1_y;
+ double left_C1_x, left_C1_y, left_C2_x, left_C2_y;
+ double right_C1_x, right_C1_y, right_C2_x, right_C2_y;
+ double right_P2_x, right_P2_y;
+ double Mid_x, Mid_y; // Mid = left.P2 = right.P1
+
+ left_P1_x = src[srcOff];
+ left_P1_y = src[srcOff + 1];
+ src_C1_x = src[srcOff + 2];
+ src_C1_y = src[srcOff + 3];
+ src_C2_x = src[srcOff + 4];
+ src_C2_y = src[srcOff + 5];
+ right_P2_x = src[srcOff + 6];
+ right_P2_y = src[srcOff + 7];
+
+ left_C1_x = (left_P1_x + src_C1_x) / 2;
+ left_C1_y = (left_P1_y + src_C1_y) / 2;
+ right_C2_x = (right_P2_x + src_C2_x) / 2;
+ right_C2_y = (right_P2_y + src_C2_y) / 2;
+ Mid_x = (src_C1_x + src_C2_x) / 2;
+ Mid_y = (src_C1_y + src_C2_y) / 2;
+ left_C2_x = (left_C1_x + Mid_x) / 2;
+ left_C2_y = (left_C1_y + Mid_y) / 2;
+ right_C1_x = (Mid_x + right_C2_x) / 2;
+ right_C1_y = (Mid_y + right_C2_y) / 2;
+ Mid_x = (left_C2_x + right_C1_x) / 2;
+ Mid_y = (left_C2_y + right_C1_y) / 2;
+
+ if (left != null)
+ {
+ left[leftOff] = left_P1_x;
+ left[leftOff + 1] = left_P1_y;
+ left[leftOff + 2] = left_C1_x;
+ left[leftOff + 3] = left_C1_y;
+ left[leftOff + 4] = left_C2_x;
+ left[leftOff + 5] = left_C2_y;
+ left[leftOff + 6] = Mid_x;
+ left[leftOff + 7] = Mid_y;
+ }
+
+ if (right != null)
+ {
+ right[rightOff] = Mid_x;
+ right[rightOff + 1] = Mid_y;
+ right[rightOff + 2] = right_C1_x;
+ right[rightOff + 3] = right_C1_y;
+ right[rightOff + 4] = right_C2_x;
+ right[rightOff + 5] = right_C2_y;
+ right[rightOff + 6] = right_P2_x;
+ right[rightOff + 7] = right_P2_y;
+ }
}
+
+
public static int solveCubic(double[] eqn)
{
return solveCubic(eqn, eqn);
}
+
+
public static int solveCubic(double[] eqn, double[] res)
{
- if (eqn[3] == 0)
+ double a, b, c, q, r, Q, R;
+
+ double c3 = eqn[3];
+ if (c3 == 0)
return QuadCurve2D.solveQuadratic(eqn, res);
- // XXX Implement.
- throw new Error("not implemented");
+
+ // Divide the equation by the cubic coefficient.
+ c = eqn[0] / c3;
+ b = eqn[1] / c3;
+ a = eqn[2] / c3;
+
+ // We now need to solve x^3 + ax^2 + bx + c = 0.
+ throw new Error("not implemented"); // FIXME
}
+
+ /**
+ * Determines whether a position lies inside the area that is bounded
+ * by the curve and the straight line connecting its end points.
+ *
+ * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
+ * alt="A drawing of the area spanned by the curve" />
+ *
+ * <p>The above drawing illustrates in which area points are
+ * considered &#x201c;contained&#x201d; in a CubicCurve2D.
+ */
public boolean contains(double x, double y)
{
// XXX Implement.
throw new Error("not implemented");
}
+
+
+ /**
+ * Determines whether a point lies inside the area that is bounded
+ * by the curve and the straight line connecting its end points.
+ *
+ * <p><img src="doc-files/CubicCurve2D-5.png" width="350" height="180"
+ * alt="A drawing of the area spanned by the curve" />
+ *
+ * <p>The above drawing illustrates in which area points are
+ * considered &#x201c;contained&#x201d; in a CubicCurve2D.
+ */
public boolean contains(Point2D p)
{
return contains(p.getX(), p.getY());
}
+
+
public boolean intersects(double x, double y, double w, double h)
{
// XXX Implement.
throw new Error("not implemented");
}
+
+
public boolean intersects(Rectangle2D r)
{
return intersects(r.getX(), r.getY(), r.getWidth(), r.getHeight());
}
+
+
public boolean contains(double x, double y, double w, double h)
{
// XXX Implement.
throw new Error("not implemented");
}
+
+
public boolean contains(Rectangle2D r)
{
return contains(r.getX(), r.getY(), r.getWidth(), r.getHeight());
}
+
+
+ /**
+ * Determines the smallest rectangle that encloses the
+ * curve&#x2019;s start, end and control points. As the illustration
+ * below shows, the invisible control points may cause the bounds to
+ * be much larger than the area that is actually covered by the
+ * curve.
+ *
+ * <p><img src="doc-files/CubicCurve2D-2.png" width="350" height="180"
+ * alt="An illustration of the bounds of a CubicCurve2D" />
+ */
public Rectangle getBounds()
{
return getBounds2D().getBounds();
}
+
+
public PathIterator getPathIterator(final AffineTransform at)
{
return new PathIterator()
@@ -276,47 +800,135 @@ public abstract class CubicCurve2D implements Shape, Cloneable
}
};
}
+
+
public PathIterator getPathIterator(AffineTransform at, double flatness)
{
return new FlatteningPathIterator(getPathIterator(at), flatness);
}
+
/**
- * Create a new curve of the same run-time type with the same contents as
- * this one.
+ * Create a new curve with the same contents as this one.
*
- * @return the clone
+ * @return the clone.
*/
public Object clone()
{
try
- {
- return super.clone();
- }
+ {
+ return super.clone();
+ }
catch (CloneNotSupportedException e)
- {
- throw (Error) new InternalError().initCause(e); // Impossible
- }
+ {
+ throw (Error) new InternalError().initCause(e); // Impossible
+ }
}
+
/**
- * STUBS ONLY
+ * A two-dimensional curve that is parameterized with a cubic
+ * function and stores coordinate values in double-precision
+ * floating-point format.
+ *
+ * @see CubicCurve2D.Float
+ *
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
- public static class Double extends CubicCurve2D
+ public static class Double
+ extends CubicCurve2D
{
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s start point.
+ */
public double x1;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s start point.
+ */
public double y1;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s first control point.
+ */
public double ctrlx1;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s first control point.
+ */
public double ctrly1;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s second control point.
+ */
public double ctrlx2;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s second control point.
+ */
public double ctrly2;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s end point.
+ */
public double x2;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s end point.
+ */
public double y2;
+
+ /**
+ * Constructs a new CubicCurve2D that stores its coordinate values
+ * in double-precision floating-point format. All points are
+ * initially at position (0, 0).
+ */
public Double()
{
}
+
+ /**
+ * Constructs a new CubicCurve2D that stores its coordinate values
+ * in double-precision floating-point format, specifying the
+ * initial position of each point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s first
+ * control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s first
+ * control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s second
+ * control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s second
+ * control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public Double(double x1, double y1, double cx1, double cy1,
double cx2, double cy2, double x2, double y2)
{
@@ -330,58 +942,154 @@ public abstract class CubicCurve2D implements Shape, Cloneable
this.y2 = y2;
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public double getX1()
{
return x1;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public double getY1()
{
return y1;
}
+
+
+ /**
+ * Returns the curve&#x2019;s start point.
+ */
public Point2D getP1()
{
return new Point2D.Double(x1, y1);
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public double getCtrlX1()
{
return ctrlx1;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public double getCtrlY1()
{
return ctrly1;
}
+
+
+ /**
+ * Returns the curve&#x2019;s first control point.
+ */
public Point2D getCtrlP1()
{
return new Point2D.Double(ctrlx1, ctrly1);
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public double getCtrlX2()
{
return ctrlx2;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public double getCtrlY2()
{
return ctrly2;
}
+
+
+ /**
+ * Returns the curve&#x2019;s second control point.
+ */
public Point2D getCtrlP2()
{
return new Point2D.Double(ctrlx2, ctrly2);
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public double getX2()
{
return x2;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public double getY2()
{
return y2;
}
+
+
+ /**
+ * Returns the curve&#x2019;s end point.
+ */
public Point2D getP2()
{
return new Point2D.Double(x2, y2);
}
+
+ /**
+ * Changes the curve geometry, separately specifying each coordinate
+ * value.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
+ * point.
+ */
public void setCurve(double x1, double y1, double cx1, double cy1,
double cx2, double cy2, double x2, double y2)
{
@@ -394,6 +1102,18 @@ public abstract class CubicCurve2D implements Shape, Cloneable
this.x2 = x2;
this.y2 = y2;
}
+
+
+ /**
+ * Determines the smallest rectangle that encloses the
+ * curve&#x2019;s start, end and control points. As the
+ * illustration below shows, the invisible control points may cause
+ * the bounds to be much larger than the area that is actually
+ * covered by the curve.
+ *
+ * <p><img src="doc-files/CubicCurve2D-2.png" width="350" height="180"
+ * alt="An illustration of the bounds of a CubicCurve2D" />
+ */
public Rectangle2D getBounds2D()
{
double nx1 = Math.min(Math.min(x1, ctrlx1), Math.min(ctrlx2, x2));
@@ -402,26 +1122,112 @@ public abstract class CubicCurve2D implements Shape, Cloneable
double ny2 = Math.max(Math.max(y1, ctrly1), Math.max(ctrly2, y2));
return new Rectangle2D.Double(nx1, ny1, nx2 - nx1, ny2 - ny1);
}
- } // class Double
+ }
+
/**
- * STUBS ONLY
+ * A two-dimensional curve that is parameterized with a cubic
+ * function and stores coordinate values in single-precision
+ * floating-point format.
+ *
+ * @see CubicCurve2D.Float
+ *
+ * @author Eric Blake (ebb9@email.byu.edu)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
- public static class Float extends CubicCurve2D
+ public static class Float
+ extends CubicCurve2D
{
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s start point.
+ */
public float x1;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s start point.
+ */
public float y1;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s first control point.
+ */
public float ctrlx1;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s first control point.
+ */
public float ctrly1;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s second control point.
+ */
public float ctrlx2;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s second control point.
+ */
public float ctrly2;
+
+
+ /**
+ * The <i>x</i> coordinate of the curve&#x2019;s end point.
+ */
public float x2;
+
+
+ /**
+ * The <i>y</i> coordinate of the curve&#x2019;s end point.
+ */
public float y2;
+
+ /**
+ * Constructs a new CubicCurve2D that stores its coordinate values
+ * in single-precision floating-point format. All points are
+ * initially at position (0, 0).
+ */
public Float()
{
}
+
+ /**
+ * Constructs a new CubicCurve2D that stores its coordinate values
+ * in single-precision floating-point format, specifying the
+ * initial position of each point.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s first
+ * control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s first
+ * control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s second
+ * control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s second
+ * control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public Float(float x1, float y1, float cx1, float cy1,
float cx2, float cy2, float x2, float y2)
{
@@ -435,58 +1241,154 @@ public abstract class CubicCurve2D implements Shape, Cloneable
this.y2 = y2;
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public double getX1()
{
return x1;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s start
+ * point.
+ */
public double getY1()
{
return y1;
}
+
+
+ /**
+ * Returns the curve&#x2019;s start point.
+ */
public Point2D getP1()
{
return new Point2D.Float(x1, y1);
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public double getCtrlX1()
{
return ctrlx1;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s first
+ * control point.
+ */
public double getCtrlY1()
{
return ctrly1;
}
+
+
+ /**
+ * Returns the curve&#x2019;s first control point.
+ */
public Point2D getCtrlP1()
{
return new Point2D.Float(ctrlx1, ctrly1);
}
+
+ /**
+ * Returns the <i>s</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public double getCtrlX2()
{
return ctrlx2;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s second
+ * control point.
+ */
public double getCtrlY2()
{
return ctrly2;
}
+
+
+ /**
+ * Returns the curve&#x2019;s second control point.
+ */
public Point2D getCtrlP2()
{
return new Point2D.Float(ctrlx2, ctrly2);
}
+
+ /**
+ * Returns the <i>x</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public double getX2()
{
return x2;
}
+
+
+ /**
+ * Returns the <i>y</i> coordinate of the curve&#x2019;s end
+ * point.
+ */
public double getY2()
{
return y2;
}
+
+
+ /**
+ * Returns the curve&#x2019;s end point.
+ */
public Point2D getP2()
{
return new Point2D.Float(x2, y2);
}
+
+ /**
+ * Changes the curve geometry, separately specifying each coordinate
+ * value as a double-precision floating-point number.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
+ * point.
+ */
public void setCurve(double x1, double y1, double cx1, double cy1,
double cx2, double cy2, double x2, double y2)
{
@@ -499,6 +1401,39 @@ public abstract class CubicCurve2D implements Shape, Cloneable
this.x2 = (float) x2;
this.y2 = (float) y2;
}
+
+
+ /**
+ * Changes the curve geometry, separately specifying each coordinate
+ * value as a single-precision floating-point number.
+ *
+ * <p><img src="doc-files/CubicCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a CubicCurve2D" />
+ *
+ * @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param y1 the <i>y</i> coordinate of the curve&#x2019;s new start
+ * point.
+ *
+ * @param cx1 the <i>x</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cy1 the <i>y</i> coordinate of the curve&#x2019;s new
+ * first control point.
+ *
+ * @param cx2 the <i>x</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param cy2 the <i>y</i> coordinate of the curve&#x2019;s new
+ * second control point.
+ *
+ * @param x2 the <i>x</i> coordinate of the curve&#x2019;s new end
+ * point.
+ *
+ * @param y2 the <i>y</i> coordinate of the curve&#x2019;s new end
+ * point.
+ */
public void setCurve(float x1, float y1, float cx1, float cy1,
float cx2, float cy2, float x2, float y2)
{
@@ -511,6 +1446,18 @@ public abstract class CubicCurve2D implements Shape, Cloneable
this.x2 = x2;
this.y2 = y2;
}
+
+
+ /**
+ * Determines the smallest rectangle that encloses the
+ * curve&#x2019;s start, end and control points. As the
+ * illustration below shows, the invisible control points may cause
+ * the bounds to be much larger than the area that is actually
+ * covered by the curve.
+ *
+ * <p><img src="doc-files/CubicCurve2D-2.png" width="350" height="180"
+ * alt="An illustration of the bounds of a CubicCurve2D" />
+ */
public Rectangle2D getBounds2D()
{
float nx1 = (float) Math.min(Math.min(x1, ctrlx1), Math.min(ctrlx2, x2));
@@ -519,5 +1466,5 @@ public abstract class CubicCurve2D implements Shape, Cloneable
float ny2 = (float) Math.max(Math.max(y1, ctrly1), Math.max(ctrly2, y2));
return new Rectangle2D.Float(nx1, ny1, nx2 - nx1, ny2 - ny1);
}
- } // class Float
-} // class CubicCurve2D
+ }
+}
diff --git a/libjava/java/awt/geom/FlatteningPathIterator.java b/libjava/java/awt/geom/FlatteningPathIterator.java
index a7a57ef6fed..94ff145621b 100644
--- a/libjava/java/awt/geom/FlatteningPathIterator.java
+++ b/libjava/java/awt/geom/FlatteningPathIterator.java
@@ -1,5 +1,5 @@
-/* FlatteningPathIterator.java -- performs interpolation of curved paths
- Copyright (C) 2002 Free Software Foundation
+/* FlatteningPathIterator.java -- Approximates curves by straight lines
+ Copyright (C) 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -38,68 +38,542 @@ exception statement from your version. */
package java.awt.geom;
+import java.util.NoSuchElementException;
+
+
/**
- * This class can be used to perform the flattening required by the Shape
- * interface. It interpolates a curved path segment into a sequence of flat
- * ones within a certain flatness, up to a recursion limit.
+ * A PathIterator for approximating curved path segments by sequences
+ * of straight lines. Instances of this class will only return
+ * segments of type {@link PathIterator#SEG_MOVETO}, {@link
+ * PathIterator#SEG_LINETO}, and {@link PathIterator#SEG_CLOSE}.
+ *
+ * <p>The accuracy of the approximation is determined by two
+ * parameters:
+ *
+ * <ul><li>The <i>flatness</i> is a threshold value for deciding when
+ * a curved segment is consided flat enough for being approximated by
+ * a single straight line. Flatness is defined as the maximal distance
+ * of a curve control point to the straight line that connects the
+ * curve start and end. A lower flatness threshold means a closer
+ * approximation. See {@link QuadCurve2D#getFlatness()} and {@link
+ * CubicCurve2D#getFlatness()} for drawings which illustrate the
+ * meaning of flatness.</li>
+ *
+ * <li>The <i>recursion limit</i> imposes an upper bound for how often
+ * a curved segment gets subdivided. A limit of <i>n</i> means that
+ * for each individual quadratic and cubic B&#xe9;zier spline
+ * segment, at most 2<sup><small><i>n</i></small></sup> {@link
+ * PathIterator#SEG_LINETO} segments will be created.</li></ul>
+ *
+ * <p><b>Memory Efficiency:</b> The memory consumption grows linearly
+ * with the recursion limit. Neither the <i>flatness</i> parameter nor
+ * the number of segments in the flattened path will affect the memory
+ * consumption.
+ *
+ * <p><b>Thread Safety:</b> Multiple threads can safely work on
+ * separate instances of this class. However, multiple threads should
+ * not concurrently access the same instance, as no synchronization is
+ * performed.
+ *
+ * @see <a href="doc-files/FlatteningPathIterator-1.html"
+ * >Implementation Note</a>
+ *
+ * @author Sascha Brawer (brawer@dandelis.ch)
*
- * @author Eric Blake <ebb9@email.byu.edu>
- * @see Shape
- * @see RectangularShape#getPathIterator(AffineTransform, double)
* @since 1.2
- * @status STUBS ONLY
*/
-public class FlatteningPathIterator implements PathIterator
+public class FlatteningPathIterator
+ implements PathIterator
{
- // The iterator we are applied to.
- private PathIterator subIterator;
- private double flatness;
- private int limit;
+ /**
+ * The PathIterator whose curved segments are being approximated.
+ */
+ private final PathIterator srcIter;
+
+
+ /**
+ * The square of the flatness threshold value, which determines when
+ * a curve segment is considered flat enough that no further
+ * subdivision is needed.
+ *
+ * <p>Calculating flatness actually produces the squared flatness
+ * value. To avoid the relatively expensive calculation of a square
+ * root for each curve segment, we perform all flatness comparisons
+ * on squared values.
+ *
+ * @see QuadCurve2D#getFlatnessSq()
+ * @see CubicCurve2D#getFlatnessSq()
+ */
+ private final double flatnessSq;
+
+
+ /**
+ * The maximal number of subdivions that are performed to
+ * approximate a quadratic or cubic curve segment.
+ */
+ private final int recursionLimit;
+
+
+ /**
+ * A stack for holding the coordinates of subdivided segments.
+ *
+ * @see <a href="doc-files/FlatteningPathIterator-1.html"
+ * >Implementation Note</a>
+ */
+ private double[] stack;
+
+
+ /**
+ * The current stack size.
+ *
+ * @see <a href="doc-files/FlatteningPathIterator-1.html"
+ * >Implementation Note</a>
+ */
+ private int stackSize;
+
+
+ /**
+ * The number of recursions that were performed to arrive at
+ * a segment on the stack.
+ *
+ * @see <a href="doc-files/FlatteningPathIterator-1.html"
+ * >Implementation Note</a>
+ */
+ private int[] recLevel;
+
+
+
+ private final double[] scratch = new double[6];
+
+
+ /**
+ * The segment type of the last segment that was returned by
+ * the source iterator.
+ */
+ private int srcSegType;
+
+ /**
+ * The current <i>x</i> position of the source iterator.
+ */
+ private double srcPosX;
+
+
+ /**
+ * The current <i>y</i> position of the source iterator.
+ */
+ private double srcPosY;
+
+
+ /**
+ * A flag that indicates when this path iterator has finished its
+ * iteration over path segments.
+ */
+ private boolean done;
+
+
+ /**
+ * Constructs a new PathIterator for approximating an input
+ * PathIterator with straight lines. The approximation works by
+ * recursive subdivisons, until the specified flatness threshold is
+ * not exceeded.
+ *
+ * <p>There will not be more than 10 nested recursion steps, which
+ * means that a single <code>SEG_QUADTO</code> or
+ * <code>SEG_CUBICTO</code> segment is approximated by at most
+ * 2<sup><small>10</small></sup> = 1024 straight lines.
+ */
public FlatteningPathIterator(PathIterator src, double flatness)
{
this(src, flatness, 10);
}
- public FlatteningPathIterator(PathIterator src, double flatness, int limit)
+
+
+ /**
+ * Constructs a new PathIterator for approximating an input
+ * PathIterator with straight lines. The approximation works by
+ * recursive subdivisons, until the specified flatness threshold is
+ * not exceeded. Additionally, the number of recursions is also
+ * bound by the specified recursion limit.
+ */
+ public FlatteningPathIterator(PathIterator src, double flatness,
+ int limit)
{
- subIterator = src;
- this.flatness = flatness;
- this.limit = limit;
if (flatness < 0 || limit < 0)
throw new IllegalArgumentException();
+
+ srcIter = src;
+ flatnessSq = flatness * flatness;
+ recursionLimit = limit;
+ fetchSegment();
}
+
+ /**
+ * Returns the maximally acceptable flatness.
+ *
+ * @see QuadCurve2D#getFlatness()
+ * @see CubicCurve2D#getFlatness()
+ */
public double getFlatness()
{
- return flatness;
+ return Math.sqrt(flatnessSq);
}
+
+ /**
+ * Returns the maximum number of recursive curve subdivisions.
+ */
public int getRecursionLimit()
{
- return limit;
+ return recursionLimit;
}
+
+ // Documentation will be copied from PathIterator.
public int getWindingRule()
{
- return subIterator.getWindingRule();
+ return srcIter.getWindingRule();
}
+
+ // Documentation will be copied from PathIterator.
public boolean isDone()
{
- return subIterator.isDone();
+ return done;
}
+
+ // Documentation will be copied from PathIterator.
public void next()
{
- throw new Error("not implemented");
+ if (stackSize > 0)
+ {
+ --stackSize;
+ if (stackSize > 0)
+ {
+ switch (srcSegType)
+ {
+ case PathIterator.SEG_QUADTO:
+ subdivideQuadratic();
+ return;
+
+ case PathIterator.SEG_CUBICTO:
+ subdivideCubic();
+ return;
+
+ default:
+ throw new IllegalStateException();
+ }
+ }
+ }
+
+ srcIter.next();
+ fetchSegment();
}
+
+ // Documentation will be copied from PathIterator.
public int currentSegment(double[] coords)
{
- throw new Error("not implemented");
+ if (done)
+ throw new NoSuchElementException();
+
+ switch (srcSegType)
+ {
+ case PathIterator.SEG_CLOSE:
+ return srcSegType;
+
+ case PathIterator.SEG_MOVETO:
+ case PathIterator.SEG_LINETO:
+ coords[0] = srcPosX;
+ coords[1] = srcPosY;
+ return srcSegType;
+
+ case PathIterator.SEG_QUADTO:
+ if (stackSize == 0)
+ {
+ coords[0] = srcPosX;
+ coords[1] = srcPosY;
+ }
+ else
+ {
+ int sp = stack.length - 4 * stackSize;
+ coords[0] = stack[sp + 2];
+ coords[1] = stack[sp + 3];
+ }
+ return PathIterator.SEG_LINETO;
+
+ case PathIterator.SEG_CUBICTO:
+ if (stackSize == 0)
+ {
+ coords[0] = srcPosX;
+ coords[1] = srcPosY;
+ }
+ else
+ {
+ int sp = stack.length - 6 * stackSize;
+ coords[0] = stack[sp + 4];
+ coords[1] = stack[sp + 5];
+ }
+ return PathIterator.SEG_LINETO;
+ }
+
+ throw new IllegalStateException();
}
+
+
+ // Documentation will be copied from PathIterator.
public int currentSegment(float[] coords)
{
- throw new Error("not implemented");
+ if (done)
+ throw new NoSuchElementException();
+
+ switch (srcSegType)
+ {
+ case PathIterator.SEG_CLOSE:
+ return srcSegType;
+
+ case PathIterator.SEG_MOVETO:
+ case PathIterator.SEG_LINETO:
+ coords[0] = (float) srcPosX;
+ coords[1] = (float) srcPosY;
+ return srcSegType;
+
+ case PathIterator.SEG_QUADTO:
+ if (stackSize == 0)
+ {
+ coords[0] = (float) srcPosX;
+ coords[1] = (float) srcPosY;
+ }
+ else
+ {
+ int sp = stack.length - 4 * stackSize;
+ coords[0] = (float) stack[sp + 2];
+ coords[1] = (float) stack[sp + 3];
+ }
+ return PathIterator.SEG_LINETO;
+
+ case PathIterator.SEG_CUBICTO:
+ if (stackSize == 0)
+ {
+ coords[0] = (float) srcPosX;
+ coords[1] = (float) srcPosY;
+ }
+ else
+ {
+ int sp = stack.length - 6 * stackSize;
+ coords[0] = (float) stack[sp + 4];
+ coords[1] = (float) stack[sp + 5];
+ }
+ return PathIterator.SEG_LINETO;
+ }
+
+ throw new IllegalStateException();
+ }
+
+
+ /**
+ * Fetches the next segment from the source iterator.
+ */
+ private void fetchSegment()
+ {
+ int sp;
+
+ if (srcIter.isDone())
+ {
+ done = true;
+ return;
+ }
+
+ srcSegType = srcIter.currentSegment(scratch);
+
+ switch (srcSegType)
+ {
+ case PathIterator.SEG_CLOSE:
+ return;
+
+ case PathIterator.SEG_MOVETO:
+ case PathIterator.SEG_LINETO:
+ srcPosX = scratch[0];
+ srcPosY = scratch[1];
+ return;
+
+ case PathIterator.SEG_QUADTO:
+ if (recursionLimit == 0)
+ {
+ srcPosX = scratch[2];
+ srcPosY = scratch[3];
+ stackSize = 0;
+ return;
+ }
+ sp = 4 * recursionLimit;
+ stackSize = 1;
+ if (stack == null)
+ {
+ stack = new double[sp + /* 4 + 2 */ 6];
+ recLevel = new int[recursionLimit + 1];
+ }
+ recLevel[0] = 0;
+ stack[sp] = srcPosX; // P1.x
+ stack[sp + 1] = srcPosY; // P1.y
+ stack[sp + 2] = scratch[0]; // C.x
+ stack[sp + 3] = scratch[1]; // C.y
+ srcPosX = stack[sp + 4] = scratch[2]; // P2.x
+ srcPosY = stack[sp + 5] = scratch[3]; // P2.y
+ subdivideQuadratic();
+ break;
+
+ case PathIterator.SEG_CUBICTO:
+ if (recursionLimit == 0)
+ {
+ srcPosX = scratch[4];
+ srcPosY = scratch[5];
+ stackSize = 0;
+ return;
+ }
+ sp = 6 * recursionLimit;
+ stackSize = 1;
+ if ((stack == null) || (stack.length < sp + 8))
+ {
+ stack = new double[sp + /* 6 + 2 */ 8];
+ recLevel = new int[recursionLimit + 1];
+ }
+ recLevel[0] = 0;
+ stack[sp] = srcPosX; // P1.x
+ stack[sp + 1] = srcPosY; // P1.y
+ stack[sp + 2] = scratch[0]; // C1.x
+ stack[sp + 3] = scratch[1]; // C1.y
+ stack[sp + 4] = scratch[2]; // C2.x
+ stack[sp + 5] = scratch[3]; // C2.y
+ srcPosX = stack[sp + 6] = scratch[4]; // P2.x
+ srcPosY = stack[sp + 7] = scratch[5]; // P2.y
+ subdivideCubic();
+ return;
+ }
+ }
+
+
+ /**
+ * Repeatedly subdivides the quadratic curve segment that is on top
+ * of the stack. The iteration terminates when the recursion limit
+ * has been reached, or when the resulting segment is flat enough.
+ */
+ private void subdivideQuadratic()
+ {
+ int sp;
+ int level;
+
+ sp = stack.length - 4 * stackSize - 2;
+ level = recLevel[stackSize - 1];
+ while ((level < recursionLimit)
+ && (QuadCurve2D.getFlatnessSq(stack, sp) >= flatnessSq))
+ {
+ recLevel[stackSize] = recLevel[stackSize - 1] = ++level;
+ QuadCurve2D.subdivide(stack, sp, stack, sp - 4, stack, sp);
+ ++stackSize;
+ sp -= 4;
+ }
+ }
+
+
+ /**
+ * Repeatedly subdivides the cubic curve segment that is on top
+ * of the stack. The iteration terminates when the recursion limit
+ * has been reached, or when the resulting segment is flat enough.
+ */
+ private void subdivideCubic()
+ {
+ int sp;
+ int level;
+
+ sp = stack.length - 6 * stackSize - 2;
+ level = recLevel[stackSize - 1];
+ while ((level < recursionLimit)
+ && (CubicCurve2D.getFlatnessSq(stack, sp) >= flatnessSq))
+ {
+ recLevel[stackSize] = recLevel[stackSize - 1] = ++level;
+
+ CubicCurve2D.subdivide(stack, sp, stack, sp - 6, stack, sp);
+ ++stackSize;
+ sp -= 6;
+ }
}
-} // class FlatteningPathIterator
+
+
+ /* These routines were useful for debugging. Since they would
+ * just bloat the implementation, they are commented out.
+ *
+ *
+
+ private static String segToString(int segType, double[] d, int offset)
+ {
+ String s;
+
+ switch (segType)
+ {
+ case PathIterator.SEG_CLOSE:
+ return "SEG_CLOSE";
+
+ case PathIterator.SEG_MOVETO:
+ return "SEG_MOVETO (" + d[offset] + ", " + d[offset + 1] + ")";
+
+ case PathIterator.SEG_LINETO:
+ return "SEG_LINETO (" + d[offset] + ", " + d[offset + 1] + ")";
+
+ case PathIterator.SEG_QUADTO:
+ return "SEG_QUADTO (" + d[offset] + ", " + d[offset + 1]
+ + ") (" + d[offset + 2] + ", " + d[offset + 3] + ")";
+
+ case PathIterator.SEG_CUBICTO:
+ return "SEG_CUBICTO (" + d[offset] + ", " + d[offset + 1]
+ + ") (" + d[offset + 2] + ", " + d[offset + 3]
+ + ") (" + d[offset + 4] + ", " + d[offset + 5] + ")";
+ }
+
+ throw new IllegalStateException();
+ }
+
+
+ private void dumpQuadraticStack(String msg)
+ {
+ int sp = stack.length - 4 * stackSize - 2;
+ int i = 0;
+ System.err.print(" " + msg + ":");
+ while (sp < stack.length)
+ {
+ System.err.print(" (" + stack[sp] + ", " + stack[sp+1] + ")");
+ if (i < recLevel.length)
+ System.out.print("/" + recLevel[i++]);
+ if (sp + 3 < stack.length)
+ System.err.print(" [" + stack[sp+2] + ", " + stack[sp+3] + "]");
+ sp += 4;
+ }
+ System.err.println();
+ }
+
+
+ private void dumpCubicStack(String msg)
+ {
+ int sp = stack.length - 6 * stackSize - 2;
+ int i = 0;
+ System.err.print(" " + msg + ":");
+ while (sp < stack.length)
+ {
+ System.err.print(" (" + stack[sp] + ", " + stack[sp+1] + ")");
+ if (i < recLevel.length)
+ System.out.print("/" + recLevel[i++]);
+ if (sp + 3 < stack.length)
+ {
+ System.err.print(" [" + stack[sp+2] + ", " + stack[sp+3] + "]");
+ System.err.print(" [" + stack[sp+4] + ", " + stack[sp+5] + "]");
+ }
+ sp += 6;
+ }
+ System.err.println();
+ }
+
+ *
+ *
+ */
+}
diff --git a/libjava/java/awt/geom/QuadCurve2D.java b/libjava/java/awt/geom/QuadCurve2D.java
index e737ec1a470..5bc63e6c6cf 100644
--- a/libjava/java/awt/geom/QuadCurve2D.java
+++ b/libjava/java/awt/geom/QuadCurve2D.java
@@ -51,6 +51,7 @@ import java.util.NoSuchElementException;
* alt="A drawing of a QuadCurve2D" />
*
* @author Eric Blake (ebb9@email.byu.edu)
+ * @author Graydon Hoare (graydon@redhat.com)
* @author Sascha Brawer (brawer@dandelis.ch)
*
* @since 1.2
@@ -129,7 +130,8 @@ public abstract class QuadCurve2D
/**
- * Changes the geometry of the curve.
+ * Changes the curve geometry, separately specifying each coordinate
+ * value.
*
* @param x1 the <i>x</i> coordinate of the curve&#x2019;s new start
* point.
@@ -153,6 +155,23 @@ public abstract class QuadCurve2D
double x2, double y2);
+ /**
+ * Changes the curve geometry, passing coordinate values in an
+ * array.
+ *
+ * @param coords an array containing the new coordinate values. The
+ * <i>x</i> coordinate of the new start point is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * new control point is located at <code>coords[offset + 2]</code>,
+ * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
+ * <i>x</i> coordinate of the new end point is located at
+ * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 5]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public void setCurve(double[] coords, int offset)
{
setCurve(coords[offset++], coords[offset++],
@@ -161,6 +180,22 @@ public abstract class QuadCurve2D
}
+ /**
+ * Changes the curve geometry, specifying coordinate values in
+ * separate Point objects.
+ *
+ * <p><img src="doc-files/QuadCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a QuadCurve2D" />
+ *
+ * <p>The curve does not keep any reference to the passed point
+ * objects. Therefore, a later change to <code>p1</code>,
+ * <code>c</code> <code>p2</code> will not affect the curve
+ * geometry.
+ *
+ * @param p1 the new start point.
+ * @param c the new control point.
+ * @param p2 the new end point.
+ */
public void setCurve(Point2D p1, Point2D c, Point2D p2)
{
setCurve(p1.getX(), p1.getY(), c.getX(), c.getY(),
@@ -168,11 +203,29 @@ public abstract class QuadCurve2D
}
+ /**
+ * Changes the curve geometry, specifying coordinate values in an
+ * array of Point objects.
+ *
+ * <p><img src="doc-files/QuadCurve2D-1.png" width="350" height="180"
+ * alt="A drawing of a QuadCurve2D" />
+ *
+ * <p>The curve does not keep references to the passed point
+ * objects. Therefore, a later change to the <code>pts</code> array
+ * or any of its elements will not affect the curve geometry.
+ *
+ * @param pts an array containing the points. The new start point
+ * is located at <code>pts[offset]</code>, the new control
+ * point at <code>pts[offset + 1]</code>, and the new end point
+ * at <code>pts[offset + 2]</code>.
+ *
+ * @param offset the offset of the start point in <code>pts</code>.
+ */
public void setCurve(Point2D[] pts, int offset)
{
- setCurve(pts[offset].getX(), pts[offset++].getY(),
- pts[offset].getX(), pts[offset++].getY(),
- pts[offset].getX(), pts[offset++].getY());
+ setCurve(pts[offset].getX(), pts[offset].getY(),
+ pts[offset + 1].getX(), pts[offset + 1].getY(),
+ pts[offset + 2].getX(), pts[offset + 2].getY());
}
@@ -188,6 +241,26 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the squared flatness of a quadratic curve, directly
+ * specifying each coordinate value. The flatness is the distance of
+ * the control point to the line between start and end point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the square of the distance between C and the gray line, i.e.
+ * the squared length of the red line.
+ *
+ * @param x1 the <i>x</i> coordinate of the start point P1.
+ * @param y1 the <i>y</i> coordinate of the start point P1.
+ * @param cx the <i>x</i> coordinate of the control point C.
+ * @param cy the <i>y</i> coordinate of the control point C.
+ * @param x2 the <i>x</i> coordinate of the end point P2.
+ * @param y2 the <i>y</i> coordinate of the end point P2.
+ */
public static double getFlatnessSq(double x1, double y1, double cx,
double cy, double x2, double y2)
{
@@ -195,6 +268,26 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the flatness of a quadratic curve, directly specifying
+ * each coordinate value. The flatness is the distance of the
+ * control point to the line between start and end point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the distance between C and the gray line, i.e. the length of
+ * the red line.
+ *
+ * @param x1 the <i>x</i> coordinate of the start point P1.
+ * @param y1 the <i>y</i> coordinate of the start point P1.
+ * @param cx the <i>x</i> coordinate of the control point C.
+ * @param cy the <i>y</i> coordinate of the control point C.
+ * @param x2 the <i>x</i> coordinate of the end point P2.
+ * @param y2 the <i>y</i> coordinate of the end point P2.
+ */
public static double getFlatness(double x1, double y1, double cx, double cy,
double x2, double y2)
{
@@ -202,6 +295,32 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the squared flatness of a quadratic curve, specifying
+ * the coordinate values in an array. The flatness is the distance
+ * of the control point to the line between start and end point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the square of the distance between C and the gray line, i.e.
+ * the squared length of the red line.
+ *
+ * @param coords an array containing the coordinate values. The
+ * <i>x</i> coordinate of the start point P1 is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * control point C is located at <code>coords[offset + 2]</code>,
+ * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
+ * <i>x</i> coordinate of the end point P2 is located at
+ * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 5]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public static double getFlatnessSq(double[] coords, int offset)
{
return Line2D.ptSegDistSq(coords[offset], coords[offset + 1],
@@ -210,6 +329,32 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the flatness of a quadratic curve, specifying the
+ * coordinate values in an array. The flatness is the distance of
+ * the control point to the line between start and end point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the the distance between C and the gray line, i.e. the length of
+ * the red line.
+ *
+ * @param coords an array containing the coordinate values. The
+ * <i>x</i> coordinate of the start point P1 is located at
+ * <code>coords[offset]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 1]</code>. The <i>x</i> coordinate of the
+ * control point C is located at <code>coords[offset + 2]</code>,
+ * its <i>y</i> coordinate at <code>coords[offset + 3]</code>. The
+ * <i>x</i> coordinate of the end point P2 is located at
+ * <code>coords[offset + 4]</code>, its <i>y</i> coordinate at
+ * <code>coords[offset + 5]</code>.
+ *
+ * @param offset the offset of the first coordinate value in
+ * <code>coords</code>.
+ */
public static double getFlatness(double[] coords, int offset)
{
return Line2D.ptSegDist(coords[offset], coords[offset + 1],
@@ -218,6 +363,19 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the squared flatness of this curve. The flatness is
+ * the distance of the control point to the line between start and
+ * end point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the square of the distance between C and the gray line, i.e. the
+ * squared length of the red line.
+ */
public double getFlatnessSq()
{
return Line2D.ptSegDistSq(getX1(), getY1(),
@@ -226,6 +384,19 @@ public abstract class QuadCurve2D
}
+ /**
+ * Calculates the flatness of this curve. The flatness is the
+ * distance of the control point to the line between start and end
+ * point.
+ *
+ * <p><img src="doc-files/QuadCurve2D-4.png" width="350" height="180"
+ * alt="A drawing that illustrates the flatness" />
+ *
+ * <p>In the above drawing, the straight line connecting start point
+ * P1 and end point P2 is depicted in gray. The result will be the
+ * the distance between C and the gray line, i.e. the length of the
+ * red line.
+ */
public double getFlatness()
{
return Line2D.ptSegDist(getX1(), getY1(),
@@ -417,6 +588,16 @@ public abstract class QuadCurve2D
}
+ /**
+ * Determines whether a point lies inside the area that is bounded
+ * by the curve and the straight line connecting its end points.
+ *
+ * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
+ * alt="A drawing of the area spanned by the curve" />
+ *
+ * <p>The above drawing illustrates in which area points are
+ * considered &#x201c;contained&#x201d; in a QuadCurve2D.
+ */
public boolean contains(double x, double y)
{
// XXX Implement.
@@ -424,6 +605,16 @@ public abstract class QuadCurve2D
}
+ /**
+ * Determines whether a point lies inside the area that is bounded
+ * by the curve and the straight line connecting its end points.
+ *
+ * <p><img src="doc-files/QuadCurve2D-5.png" width="350" height="180"
+ * alt="A drawing of the area spanned by the curve" />
+ *
+ * <p>The above drawing illustrates in which area points are
+ * considered &#x201c;contained&#x201d; in a QuadCurve2D.
+ */
public boolean contains(Point2D p)
{
return contains(p.getX(), p.getY());
@@ -563,8 +754,7 @@ public abstract class QuadCurve2D
/**
- * Creates a new curve with the same contents as
- * this one.
+ * Creates a new curve with the same contents as this one.
*
* @return the clone.
*/
diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png
new file mode 100644
index 00000000000..1784509be61
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/CubicCurve2D-1.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png
new file mode 100644
index 00000000000..1ddae9fc84f
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/CubicCurve2D-2.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png
new file mode 100644
index 00000000000..b200dad37a8
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/CubicCurve2D-3.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png
new file mode 100644
index 00000000000..e57ffdc5cf0
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/CubicCurve2D-4.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png b/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png
new file mode 100644
index 00000000000..701ab138f0b
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/CubicCurve2D-5.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html b/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html
new file mode 100644
index 00000000000..5a52d693edd
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/FlatteningPathIterator-1.html
@@ -0,0 +1,481 @@
+<?xml version="1.0" encoding="US-ASCII"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>The GNU Implementation of java.awt.geom.FlatteningPathIterator</title>
+ <meta name="author" content="Sascha Brawer" />
+ <style type="text/css"><!--
+ td { white-space: nowrap; }
+ li { margin: 2mm 0; }
+ --></style>
+</head>
+<body>
+
+<h1>The GNU Implementation of FlatteningPathIterator</h1>
+
+<p><i><a href="http://www.dandelis.ch/people/brawer/">Sascha
+Brawer</a>, November 2003</i></p>
+
+<p>This document describes the GNU implementation of the class
+<code>java.awt.geom.FlatteningPathIterator</code>. It does
+<em>not</em> describe how a programmer should use this class; please
+refer to the generated API documentation for this purpose. Instead, it
+is intended for maintenance programmers who want to understand the
+implementation, for example because they want to extend the class or
+fix a bug.</p>
+
+
+<h2>Data Structures</h2>
+
+<p>The algorithm uses a stack. Its allocation is delayed to the time
+when the source path iterator actually returns the first curved
+segment (either <code>SEG_QUADTO</code> or <code>SEG_CUBICTO</code>).
+If the input path does not contain any curved segments, the value of
+the <code>stack</code> variable stays <code>null</code>. In this quite
+common case, the memory consumption is minimal.</p>
+
+<dl><dt><code>stack</code></dt><dd>The variable <code>stack</code> is
+a <code>double</code> array that holds the start, control and end
+points of individual sub-segments.</dd>
+
+<dt><code>recLevel</code></dt><dd>The variable <code>recLevel</code>
+holds how many recursive sub-divisions were needed to calculate a
+segment. The original curve has recursion level 0. For each
+sub-division, the corresponding recursion level is increased by
+one.</dd>
+
+<dt><code>stackSize</code></dt><dd>Finally, the variable
+<code>stackSize</code> indicates how many sub-segments are stored on
+the stack.</dd></dl>
+
+<h2>Algorithm</h2>
+
+<p>The implementation separately processes each segment that the
+base iterator returns.</p>
+
+<p>In the case of <code>SEG_CLOSE</code>,
+<code>SEG_MOVETO</code> and <code>SEG_LINETO</code> segments, the
+implementation simply hands the segment to the consumer, without actually
+doing anything.</p>
+
+<p>Any <code>SEG_QUADTO</code> and <code>SEG_CUBICTO</code> segments
+need to be flattened. Flattening is performed with a fixed-sized
+stack, holding the coordinates of subdivided segments. When the base
+iterator returns a <code>SEG_QUADTO</code> and
+<code>SEG_CUBICTO</code> segments, it is recursively flattened as
+follows:</p>
+
+<ol><li>Intialization: Allocate memory for the stack (unless a
+sufficiently large stack has been allocated previously). Push the
+original quadratic or cubic curve onto the stack. Mark that segment as
+having a <code>recLevel</code> of zero.</li>
+
+<li>If the stack is empty, flattening the segment is complete,
+and the next segment is fetched from the base iterator.</li>
+
+<li>If the stack is not empty, pop a curve segment from the
+stack.
+
+ <ul><li>If its <code>recLevel</code> exceeds the recursion limit,
+ hand the current segment to the consumer.</li>
+
+ <li>Calculate the squared flatness of the segment. If it smaller
+ than <code>flatnessSq</code>, hand the current segment to the
+ consumer.</li>
+
+ <li>Otherwise, split the segment in two halves. Push the right
+ half onto the stack. Then, push the left half onto the stack.
+ Continue with step two.</li></ul></li>
+</ol>
+
+<p>The implementation is slightly complicated by the fact that
+consumers <em>pull</em> the flattened segments from the
+<code>FlatteningPathIterator</code>. This means that we actually
+cannot &#x201c;hand the curent segment over to the consumer.&#x201d;
+But the algorithm is easier to understand if one assumes a
+<em>push</em> paradigm.</p>
+
+
+<h2>Example</h2>
+
+<p>The following example shows how a
+<code>FlatteningPathIterator</code> processes a
+<code>SEG_QUADTO</code> segment. It is (arbitrarily) assumed that the
+recursion limit was set to 2.</p>
+
+<blockquote>
+<table border="1" cellspacing="0" cellpadding="8">
+ <tr align="center" valign="baseline">
+ <th></th><th>A</th><th>B</th><th>C</th>
+ <th>D</th><th>E</th><th>F</th><th>G</th><th>H</th>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[0]</code></th>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td><i>S<sub>ll</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[1]</code></th>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td><i>S<sub>ll</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[2]</code></th>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td><i>C<sub>ll</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[3]</code></th>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td><i>C<sub>ll</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[4]</code></th>
+ <td>&#x2014;</td>
+ <td><i>S<sub>l</sub>.x</i></td>
+ <td><i>E<sub>ll</sub>.x</i>
+ = <i>S<sub>lr</sub>.x</i></td>
+ <td><i>S<sub>lr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td><i>S<sub>rl</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[5]</code></th>
+ <td>&#x2014;</td>
+ <td><i>S<sub>l</sub>.y</i></td>
+ <td><i>E<sub>ll</sub>.x</i>
+ = <i>S<sub>lr</sub>.y</i></td>
+ <td><i>S<sub>lr</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td><i>S<sub>rl</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[6]</code></th>
+ <td>&#x2014;</td>
+ <td><i>C<sub>l</sub>.x</i></td>
+ <td><i>C<sub>lr</sub>.x</i></td>
+ <td><i>C<sub>lr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td><i>C<sub>rl</sub>.x</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[7]</code></th>
+ <td>&#x2014;</td>
+ <td><i>C<sub>l</sub>.y</i></td>
+ <td><i>C<sub>lr</sub>.y</i></td>
+ <td><i>C<sub>lr</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td><i>C<sub>rl</sub>.y</i></td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[8]</code></th>
+ <td><i>S.x</i></td>
+ <td><i>E<sub>l</sub>.x</i>
+ = <i>S<sub>r</sub>.x</i></td>
+ <td><i>E<sub>lr</sub>.x</i>
+ = <i>S<sub>r</sub>.x</i></td>
+ <td><i>E<sub>lr</sub>.x</i>
+ = <i>S<sub>r</sub>.x</i></td>
+ <td><i>S<sub>r</sub>.x</i></td>
+ <td><i>E<sub>rl</sub>.x</i>
+ = <i>S<sub>rr</sub>.x</i></td>
+ <td><i>S<sub>rr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[9]</code></th>
+ <td><i>S.y</i></td>
+ <td><i>E<sub>l</sub>.y</i>
+ = <i>S<sub>r</sub>.y</i></td>
+ <td><i>E<sub>lr</sub>.y</i>
+ = <i>S<sub>r</sub>.y</i></td>
+ <td><i>E<sub>lr</sub>.y</i>
+ = <i>S<sub>r</sub>.y</i></td>
+ <td><i>S<sub>r</sub>.y</i></td>
+ <td><i>E<sub>rl</sub>.y</i>
+ = <i>S<sub>rr</sub>.y</i></td>
+ <td><i>S<sub>rr</sub>.y</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[10]</code></th>
+ <td><i>C.x</i></td>
+ <td><i>C<sub>r</sub>.x</i></td>
+ <td><i>C<sub>r</sub>.x</i></td>
+ <td><i>C<sub>r</sub>.x</i></td>
+ <td><i>C<sub>r</sub>.x</i></td>
+ <td><i>C<sub>rr</sub>.x</i></td>
+ <td><i>C<sub>rr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[11]</code></th>
+ <td><i>C.y</i></td>
+ <td><i>C<sub>r</sub>.y</i></td>
+ <td><i>C<sub>r</sub>.y</i></td>
+ <td><i>C<sub>r</sub>.y</i></td>
+ <td><i>C<sub>r</sub>.y</i></td>
+ <td><i>C<sub>rr</sub>.y</i></td>
+ <td><i>C<sub>rr</sub>.y</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[12]</code></th>
+ <td><i>E.x</i></td>
+ <td><i>E<sub>r</sub>.x</i></td>
+ <td><i>E<sub>r</sub>.x</i></td>
+ <td><i>E<sub>r</sub>.x</i></td>
+ <td><i>E<sub>r</sub>.x</i></td>
+ <td><i>E<sub>rr</sub>.x</i></td>
+ <td><i>E<sub>rr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stack[13]</code></th>
+ <td><i>E.y</i></td>
+ <td><i>E<sub>r</sub>.y</i></td>
+ <td><i>E<sub>r</sub>.y</i></td>
+ <td><i>E<sub>r</sub>.y</i></td>
+ <td><i>E<sub>r</sub>.y</i></td>
+ <td><i>E<sub>rr</sub>.y</i></td>
+ <td><i>E<sub>rr</sub>.x</i></td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>stackSize</code></th>
+ <td>1</td>
+ <td>2</td>
+ <td>3</td>
+ <td>2</td>
+ <td>1</td>
+ <td>2</td>
+ <td>1</td>
+ <td>0</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>recLevel[2]</code></th>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>2</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>recLevel[1]</code></th>
+ <td>&#x2014;</td>
+ <td>1</td>
+ <td>2</td>
+ <td>2</td>
+ <td>&#x2014;</td>
+ <td>2</td>
+ <td>&#x2014;</td>
+ <td>&#x2014;</td>
+ </tr>
+ <tr align="center" valign="baseline">
+ <th><code>recLevel[0]</code></th>
+ <td>0</td>
+ <td>1</td>
+ <td>1</td>
+ <td>1</td>
+ <td>1</td>
+ <td>2</td>
+ <td>2</td>
+ <td>&#x2014;</td>
+ </tr>
+ </table>
+</blockquote>
+
+<ol>
+
+<li>The data structures are initialized as follows.
+
+<ul><li>The segment&#x2019;s end point <i>E</i>, control point
+<i>C</i>, and start point <i>S</i> are pushed onto the stack.</li>
+
+ <li>Currently, the curve in the stack would be approximated by one
+ single straight line segment (<i>S</i> &#x2013; <i>E</i>).
+ Therefore, <code>stackSize</code> is set to 1.</li>
+
+ <li>This single straight line segment is approximating the original
+ curve, which can be seen as the result of zero recursive
+ splits. Therefore, <code>recLevel[0]</code> is set to
+ zero.</li></ul>
+
+Column A shows the state after the initialization step.</li>
+
+<li>The algorithm proceeds by taking the topmost curve segment
+(<i>S</i> &#x2013; <i>C</i> &#x2013; <i>E</i>) from the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[0]</code>) is zero, which is smaller than
+ the limit 2.</li>
+
+ <li>The method <code>java.awt.geom.QuadCurve2D.getFlatnessSq</code>
+ is called to calculate the squared flatness.</li>
+
+ <li>For the sake of argument, we assume that the squared flatness is
+ exceeding the threshold stored in <code>flatnessSq</code>. Thus, the
+ curve segment <i>S</i> &#x2013; <i>C</i> &#x2013; <i>E</i> gets
+ subdivided into a left and a right half, namely
+ <i>S<sub>l</sub></i> &#x2013; <i>C<sub>l</sub></i> &#x2013;
+ <i>E<sub>l</sub></i> and <i>S<sub>r</sub></i> &#x2013;
+ <i>C<sub>r</sub></i> &#x2013; <i>E<sub>r</sub></i>. Both halves are
+ pushed onto the stack, so the left half is now on top.
+
+ <br />&nbsp;<br />The left half starts at the same point
+ as the original curve, so <i>S<sub>l</sub></i> has the same
+ coordinates as <i>S</i>. Similarly, the end point of the right
+ half and of the original curve are identical
+ (<i>E<sub>r</sub></i> = <i>E</i>). More interestingly, the left
+ half ends where the right half starts. Because
+ <i>E<sub>l</sub></i> = <i>S<sub>r</sub></i>, their coordinates need
+ to be stored only once, which amounts to saving 16 bytes (two
+ <code>double</code> values) for each iteration.</li></ul>
+
+Column B shows the state after the first iteration.</li>
+
+<li>Again, the topmost curve segment (<i>S<sub>l</sub></i>
+&#x2013; <i>C<sub>l</sub></i> &#x2013; <i>E<sub>l</sub></i>) is
+taken from the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[1]</code>) is 1, which is smaller than
+ the limit 2.</li>
+
+ <li>The method <code>java.awt.geom.QuadCurve2D.getFlatnessSq</code>
+ is called to calculate the squared flatness.</li>
+
+ <li>Assuming that the segment is still not considered
+ flat enough, it gets subdivided into a left
+ (<i>S<sub>ll</sub></i> &#x2013; <i>C<sub>ll</sub></i> &#x2013;
+ <i>E<sub>ll</sub></i>) and a right (<i>S<sub>lr</sub></i>
+ &#x2013; <i>C<sub>lr</sub></i> &#x2013; <i>E<sub>lr</sub></i>)
+ half.</li></ul>
+
+Column C shows the state after the second iteration.</li>
+
+<li>The topmost curve segment (<i>S<sub>ll</sub></i> &#x2013;
+<i>C<sub>ll</sub></i> &#x2013; <i>E<sub>ll</sub></i>) is popped from
+the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[2]</code>) is 2, which is <em>not</em> smaller than
+ the limit 2. Therefore, a <code>SEG_LINETO</code> (from
+ <i>S<sub>ll</sub></i> to <i>E<sub>ll</sub></i>) is passed to the
+ consumer.</li></ul>
+
+ The new state is shown in column D.</li>
+
+
+<li>The topmost curve segment (<i>S<sub>lr</sub></i> &#x2013;
+<i>C<sub>lr</sub></i> &#x2013; <i>E<sub>lr</sub></i>) is popped from
+the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[1]</code>) is 2, which is <em>not</em> smaller than
+ the limit 2. Therefore, a <code>SEG_LINETO</code> (from
+ <i>S<sub>lr</sub></i> to <i>E<sub>lr</sub></i>) is passed to the
+ consumer.</li></ul>
+
+ The new state is shown in column E.</li>
+
+<li>The algorithm proceeds by taking the topmost curve segment
+(<i>S<sub>r</sub></i> &#x2013; <i>C<sub>r</sub></i> &#x2013;
+<i>E<sub>r</sub></i>) from the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[0]</code>) is 1, which is smaller than
+ the limit 2.</li>
+
+ <li>The method <code>java.awt.geom.QuadCurve2D.getFlatnessSq</code>
+ is called to calculate the squared flatness.</li>
+
+ <li>For the sake of argument, we again assume that the squared
+ flatness is exceeding the threshold stored in
+ <code>flatnessSq</code>. Thus, the curve segment
+ (<i>S<sub>r</sub></i> &#x2013; <i>C<sub>r</sub></i> &#x2013;
+ <i>E<sub>r</sub></i>) is subdivided into a left and a right half,
+ namely
+ <i>S<sub>rl</sub></i> &#x2013; <i>C<sub>rl</sub></i> &#x2013;
+ <i>E<sub>rl</sub></i> and <i>S<sub>rr</sub></i> &#x2013;
+ <i>C<sub>rr</sub></i> &#x2013; <i>E<sub>rr</sub></i>. Both halves
+ are pushed onto the stack.</li></ul>
+
+ The new state is shown in column F.</li>
+
+<li>The topmost curve segment (<i>S<sub>rl</sub></i> &#x2013;
+<i>C<sub>rl</sub></i> &#x2013; <i>E<sub>rl</sub></i>) is popped from
+the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[2]</code>) is 2, which is <em>not</em> smaller than
+ the limit 2. Therefore, a <code>SEG_LINETO</code> (from
+ <i>S<sub>rl</sub></i> to <i>E<sub>rl</sub></i>) is passed to the
+ consumer.</li></ul>
+
+ The new state is shown in column G.</li>
+
+<li>The topmost curve segment (<i>S<sub>rr</sub></i> &#x2013;
+<i>C<sub>rr</sub></i> &#x2013; <i>E<sub>rr</sub></i>) is popped from
+the stack.
+
+ <ul><li>The recursion level of this segment (stored in
+ <code>recLevel[2]</code>) is 2, which is <em>not</em> smaller than
+ the limit 2. Therefore, a <code>SEG_LINETO</code> (from
+ <i>S<sub>rr</sub></i> to <i>E<sub>rr</sub></i>) is passed to the
+ consumer.</li></ul>
+
+ The new state is shown in column H.</li>
+
+<li>The stack is now empty. The FlatteningPathIterator will fetch the
+next segment from the base iterator, and process it.</li>
+
+</ol>
+
+<p>In order to split the most recently pushed segment, the
+<code>subdivideQuadratic()</code> method passes <code>stack</code>
+directly to
+<code>QuadCurve2D.subdivide(double[],int,double[],int,double[],int)</code>.
+Because the stack grows towards the beginning of the array, no data
+needs to be copied around: <code>subdivide</code> will directly store
+the result into the stack, which will have the contents shown to the
+right.</p>
+
+</body>
+</html>
diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png
new file mode 100644
index 00000000000..835c0643b29
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/QuadCurve2D-4.png
Binary files differ
diff --git a/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png b/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png
new file mode 100644
index 00000000000..72110cd5a62
--- /dev/null
+++ b/libjava/java/awt/geom/doc-files/QuadCurve2D-5.png
Binary files differ
diff --git a/libjava/java/awt/image/ImageConsumer.java b/libjava/java/awt/image/ImageConsumer.java
index 330f21f6bd2..9ac67d5cf36 100644
--- a/libjava/java/awt/image/ImageConsumer.java
+++ b/libjava/java/awt/image/ImageConsumer.java
@@ -1,5 +1,5 @@
/* ImageConsumer.java -- Java interface for image consumption
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -160,17 +160,45 @@ public interface ImageConsumer
void setHints(int flags);
/**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
+ * Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
+ *
+ * Each element of the pixels array represents one pixel. The
+ * pixel data is formatted according to the color model model.
+ * The x and y parameters are the coordinates of the block of
+ * pixels being delivered to this ImageConsumer. They are
+ * specified relative to the top left corner of the image being
+ * produced. Likewise, w and h are the pixel block's dimensions.
+ *
+ * @param x x coordinate of pixel block
+ * @param y y coordinate of pixel block
+ * @param w width of pixel block
+ * @param h height of pixel block
+ * @param model color model used to interpret pixel data
+ * @param pixels pixel block data
+ * @param offset offset into pixels array
+ * @param scansize width of one row in the pixel block
*/
void setPixels(int x, int y, int w, int h,
ColorModel model, byte[] pixels, int offset, int scansize);
/**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
+ * Deliver a subset of an ImageProducer's pixels to this ImageConsumer.
+ *
+ * Each element of the pixels array represents one pixel. The
+ * pixel data is formatted according to the color model model.
+ * The x and y parameters are the coordinates of the rectangular
+ * region of pixels being delivered to this ImageConsumer,
+ * specified relative to the top left corner of the image being
+ * produced. Likewise, w and h are the pixel region's dimensions.
+ *
+ * @param x x coordinate of pixel block
+ * @param y y coordinate of pixel block
+ * @param w width of pixel block
+ * @param h height of pixel block
+ * @param model color model used to interpret pixel data
+ * @param pixels pixel block data
+ * @param offset offset into pixels array
+ * @param scansize width of one row in the pixel block
*/
void setPixels(int x, int y, int w, int h,
ColorModel model, int[] pixels, int offset, int scansize);
@@ -180,7 +208,9 @@ public interface ImageConsumer
* single frame or the entire image is complete. The method is
* also used to indicate an error in loading or producing the
* image.
+ *
+ * @param status the status of image production, represented by a
+ * bitwise OR of ImageConsumer flags
*/
void imageComplete(int status);
}
-
diff --git a/libjava/java/awt/image/ImagingOpException.java b/libjava/java/awt/image/ImagingOpException.java
index 28c3df132cc..51bf02b281c 100644
--- a/libjava/java/awt/image/ImagingOpException.java
+++ b/libjava/java/awt/image/ImagingOpException.java
@@ -1,5 +1,5 @@
/* ImagingOpException.java -- indicates an imaging filter failure
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -52,7 +52,7 @@ public class ImagingOpException extends RuntimeException
/**
* Compatible with JDK 1.0+.
*/
- private static final long serialVersionUID = 96598996116164315L;
+ private static final long serialVersionUID = 8026288481846276658L;
/**
* Create a new instance with a descriptive error message.
diff --git a/libjava/java/awt/image/PixelGrabber.java b/libjava/java/awt/image/PixelGrabber.java
index b94ed8fbe86..d6d2403399e 100644
--- a/libjava/java/awt/image/PixelGrabber.java
+++ b/libjava/java/awt/image/PixelGrabber.java
@@ -1,39 +1,39 @@
-/* PixelGrabber.java -- Java class for providing image data
- Copyright (C) 1999 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
+/* PixelGrabber.java -- retrieve a subset of an image's data
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
package java.awt.image;
@@ -42,309 +42,583 @@ import java.awt.Image;
import java.util.Hashtable;
/**
- PixelGrabber is an ImageConsumer designed to extract a rectangular region of pixels
- from an Image
+ * PixelGrabber is an ImageConsumer that extracts a rectangular region
+ * of pixels from an Image.
*/
-public class PixelGrabber implements ImageConsumer
+public class PixelGrabber implements ImageConsumer
{
- int x, y, width, height, status, scansize, offset;
- ColorModel model = ColorModel.getRGBdefault();
- //int hints;
- //Hashtable props;
- int pixel_bufferi[];
- byte pixel_bufferb[];
- boolean grabbing;
- ImageProducer ip;
-
- /**
- * Create a PixelGrabber used to grab pixels from the specified Image
- * in the specified rectangle
- *
- * @param img the Image to grab pixels from
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public PixelGrabber(Image img, int x, int y, int w, int h,
- int pix[], int off, int scansize)
- {
- this( img.getSource(), x, y, w, h, pix, off, scansize );
- }
-
- /**
- * Create a PixelGrabber used to grab pixels from the specified ImageProducer
- * in the specified rectangle
- *
- * @param ip the ImageProducer to grab pixels from
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param pixels the array of pixel values
- * @param offset the index of the first pixels in the <code>pixels</code> array
- * @param scansize the width to use in extracting pixels from the <code>pixels</code> array
- */
- public PixelGrabber(ImageProducer ip, int x, int y, int w, int h,
- int pix[], int off, int scansize)
- {
- this.ip = ip;
- this.x = x;
- this.y = y;
- this.width = w;
- this.height = h;
- this.pixel_bufferi = pix;
- this.offset = off;
- this.scansize = scansize;
- pixel_bufferb = new byte[pix.length * 4];
- }
-
-
- /**
- * Create a PixelGrabber used to grab pixels from the specified Image
- * in the specified rectangle
- *
- * @param img the Image to grab pixels from
- * @param x the x coordinate of the rectangle
- * @param y the y coordinate of the rectangle
- * @param w the width of the rectangle
- * @param h the height of the rectangle
- * @param forceRGB true to force conversion to RGB
- */
- public PixelGrabber(Image img,
- int x, int y,
- int w, int h,
- boolean forceRGB)
- {
- //FIXME
- }
-
- /**
- Start Grabbing Pixels
- */
- public synchronized void startGrabbing()
- {
- if ( grabbing == false )
+ int x, y, offset;
+ int width = -1;
+ int height = -1;
+ int scansize = -1;
+ boolean forceRGB = true;
+
+ ColorModel model = ColorModel.getRGBdefault();
+ int hints;
+ Hashtable props;
+
+ int int_pixel_buffer[];
+ boolean ints_delivered = false;
+ byte byte_pixel_buffer[];
+ boolean bytes_delivered = false;
+
+ ImageProducer ip;
+ int observerStatus;
+ int consumerStatus;
+
+ private Thread grabberThread;
+ boolean grabbing = false;
+
+ /**
+ * Construct a PixelGrabber that will retrieve RGB data from a given
+ * Image.
+ *
+ * The RGB data will be retrieved from a rectangular region
+ * <code>(x, y, w, h)</code> within the image. The data will be
+ * stored in the provided <code>pix</code> array, which must have
+ * been initialized to a size of at least <code>w * h</code>. The
+ * data for a pixel (m, n) in the grab rectangle will be stored at
+ * <code>pix[(n - y) * scansize + (m - x) + off]</code>.
+ *
+ * @param img the Image from which to grab pixels
+ * @param x the x coordinate, relative to <code>img</code>'s
+ * top-left corner, of the grab rectangle's top-left pixel
+ * @param y the y coordinate, relative to <code>img</code>'s
+ * top-left corner, of the grab rectangle's top-left pixel
+ * @param w the width of the grab rectangle, in pixels
+ * @param h the height of the grab rectangle, in pixels
+ * @param pix the array in which to store grabbed RGB pixel data
+ * @param off the offset into the <code>pix</code> array at which to
+ * start storing RGB data
+ * @param scansize a set of <code>scansize</code> consecutive
+ * elements in the <code>pix</code> array represents one row of
+ * pixels in the grab rectangle
+ */
+ public PixelGrabber(Image img, int x, int y, int w, int h,
+ int pix[], int off, int scansize)
+ {
+ this (img.getSource(), x, y, w, h, pix, off, scansize);
+ }
+
+ /**
+ * Construct a PixelGrabber that will retrieve RGB data from a given
+ * ImageProducer.
+ *
+ * The RGB data will be retrieved from a rectangular region
+ * <code>(x, y, w, h)</code> within the image produced by
+ * <code>ip</code>. The data will be stored in the provided
+ * <code>pix</code> array, which must have been initialized to a
+ * size of at least <code>w * h</code>. The data for a pixel (m, n)
+ * in the grab rectangle will be stored at
+ * <code>pix[(n - y) * scansize + (m - x) + off]</code>.
+ *
+ * @param ip the ImageProducer from which to grab pixels
+ * @param x the x coordinate of the grab rectangle's top-left pixel,
+ * specified relative to the top-left corner of the image produced
+ * by <code>ip</code>
+ * @param y the y coordinate of the grab rectangle's top-left pixel,
+ * specified relative to the top-left corner of the image produced
+ * by <code>ip</code>
+ * @param w the width of the grab rectangle, in pixels
+ * @param h the height of the grab rectangle, in pixels
+ * @param pix the array in which to store grabbed RGB pixel data
+ * @param off the offset into the <code>pix</code> array at which to
+ * start storing RGB data
+ * @param scansize a set of <code>scansize</code> consecutive
+ * elements in the <code>pix</code> array represents one row of
+ * pixels in the grab rectangle
+ */
+ public PixelGrabber(ImageProducer ip, int x, int y, int w, int h,
+ int pix[], int off, int scansize)
+ {
+ this.ip = ip;
+ this.x = x;
+ this.y = y;
+ this.width = w;
+ this.height = h;
+ this.offset = off;
+ this.scansize = scansize;
+
+ int_pixel_buffer = pix;
+ // Initialize the byte array in case ip sends us byte-formatted
+ // pixel data.
+ byte_pixel_buffer = new byte[pix.length * 4];
+ }
+
+ /**
+ * Construct a PixelGrabber that will retrieve data from a given
+ * Image.
+ *
+ * The RGB data will be retrieved from a rectangular region
+ * <code>(x, y, w, h)</code> within the image. The data will be
+ * stored in an internal array which can be accessed by calling
+ * <code>getPixels</code>. The data for a pixel (m, n) in the grab
+ * rectangle will be stored in the returned array at index
+ * <code>(n - y) * scansize + (m - x) + off</code>.
+ * If forceRGB is false, then the returned data will be not be
+ * converted to RGB from its format in <code>img</code>.
+ *
+ * If <code>w</code> is negative, the width of the grab region will
+ * be from x to the right edge of the image. Likewise, if
+ * <code>h</code> is negative, the height of the grab region will be
+ * from y to the bottom edge of the image.
+ *
+ * @param img the Image from which to grab pixels
+ * @param x the x coordinate, relative to <code>img</code>'s
+ * top-left corner, of the grab rectangle's top-left pixel
+ * @param y the y coordinate, relative to <code>img</code>'s
+ * top-left corner, of the grab rectangle's top-left pixel
+ * @param w the width of the grab rectangle, in pixels
+ * @param h the height of the grab rectangle, in pixels
+ * @param forceRGB true to force conversion of the rectangular
+ * region's pixel data to RGB
+ */
+ public PixelGrabber(Image img,
+ int x, int y,
+ int w, int h,
+ boolean forceRGB)
+ {
+ this.ip = img.getSource();
+ this.x = x;
+ this.y = y;
+ width = w;
+ height = h;
+ // If width or height is negative, postpone pixel buffer
+ // initialization until setDimensions is called back by ip.
+ if (width >= 0 && height >= 0)
+ {
+ int_pixel_buffer = new int[width * height];
+ byte_pixel_buffer = new byte[width * height];
+ }
+ this.forceRGB = forceRGB;
+ }
+
+ /**
+ * Start grabbing pixels.
+ *
+ * Spawns an image production thread that calls back to this
+ * PixelGrabber's ImageConsumer methods.
+ */
+ public synchronized void startGrabbing()
+ {
+ // Make sure we're not already grabbing.
+ if (grabbing == false)
+ {
+ grabbing = true;
+ grabberThread = new Thread ()
+ {
+ public void run ()
{
- grabbing = true;
- ip.startProduction( this );
+ ip.startProduction (PixelGrabber.this);
}
- }
-
- /**
- Abort the grabbing of pixels
- */
- public synchronized void abortGrabbing()
- {
- if ( grabbing == true )
- {
- grabbing = false;
- ip.removeConsumer( this );
- }
- }
-
- /**
- Grab the Pixels.
-
- @return true if successful
-
- @throws InterruptedException if interrupted by another thread.
- */
- public boolean grabPixels() throws InterruptedException
- {
- return grabPixels(0);
- }
-
- /**
- Grab the Pixels and abort if it takes too long
-
- @return true if successful
-
- @throws InterruptedException if interrupted by another thread.
- or time runs out
- */
- public synchronized boolean grabPixels(long ms) throws InterruptedException
- {
- startGrabbing();
-
- if (ms < 0)
- return (status == ImageObserver.ALLBITS);
-
- wait(ms);
-
- if (status == ImageObserver.ALLBITS)
- return true;
- else
- return false;
- }
-
- /**
- Get the status of the pixel grabbing representing by ImageObserver flags
-
- @return the status
- */
- public synchronized int getStatus()
- {
- return status;
- }
-
- /**
- Return width of pixel region
-
- @return width of region
- */
- public synchronized int getWidth()
- {
- return width;
- }
-
- /**
- Return height of pixel region
-
- @return height of region
- */
- public synchronized int getHeight()
- {
- return height;
- }
-
- /**
- Returns the grabbed pixel buffer
-
- @return a byte or int array
- */
- public synchronized Object getPixels()
- {
- if( pixel_bufferi != null )
- return pixel_bufferi;
- return pixel_bufferb;
- }
-
- /**
- Get the ColorModel of the image
-
- @return the ColorModel
- */
- public synchronized ColorModel getColorModel()
- {
- return model;
- }
-
- /**
- * An <code>ImageProducer</code> indicates the size of the image
- * being produced using this method.
- *
- * @param width the width of the image
- * @param height the height of the image
- */
- public void setDimensions(int width, int height)
- {
- }
-
- /**
- * An <code>ImageProducer</code> can set a list of properties
- * associated with this image by using this method.
- *
- * @param props the list of properties associated with this image
- */
- public void setProperties(Hashtable props)
- {
- //this.props = props; //FIXME - DO WE NEED THIS
- }
-
- /**
- * This <code>ColorModel</code> should indicate the model used by
- * the majority of calls to <code>setPixels</code>. Each call to
- * <code>setPixels</code> could however indicate a different
- * <code>ColorModel</code>.
- *
- * @param model the color model to be used most often by setPixels
- * @see ColorModel
- */
- public void setColorModel(ColorModel model)
- {
- this.model = model;
- }
-
- /**
- * The <code>ImageProducer</code> should call this method with a
- * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
- * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
- * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code>.
- *
- * @param flags a bit mask of hints
- */
- public void setHints(int flags)
- {
- //hints = flags; // FIXME - DO NOT KNOW WHAT TO DO WITH THE HINTS
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as a <code>byte</code> at
- * index (n * scansize + m + offset).
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, byte[] pixels, int offset, int scansize)
- {
- //FIXME - I hate bytes
- int xp, yp;
- for( xp = x; xp < ( x + w); xp++ )
- for( yp = y; yp < (y + h); yp++ )
- if( xp >= this.x &&
- yp >= this.y &&
- xp <= ( this.x + this.width ) &&
- yp <= ( this.y + this.height ) ) {
- pixel_bufferb[(yp - this.y) * this.scansize + (xp - this.x) + this.offset] =
- pixels[ offset + yp * scansize + xp ];
- }
-
- }
-
- /**
- * This function delivers a rectangle of pixels where any
- * pixel(m,n) is stored in the array as an <code>int</code> at
- * index (n * scansize + m + offset).
- */
- public void setPixels(int x, int y, int w, int h,
- ColorModel model, int[] pixels, int offset, int scansize)
- {
- int xp, yp;
- for( xp = x; xp < ( x + w); xp++ )
- for( yp = y; yp < (y + h); yp++ )
- if( xp >= this.x &&
- yp >= this.y &&
- xp <= ( this.x + this.width ) &&
- yp <= ( this.y + this.height ) ) {
- pixel_bufferi[(yp - this.y) * this.scansize + (xp - this.x) + this.offset] =
- pixels[ offset + yp * scansize + xp ];
- }
- }
-
- /**
- * The <code>ImageProducer</code> calls this method to indicate a
- * single frame or the entire image is complete. The method is
- * also used to indicate an error in loading or producing the
- * image.
- */
- public synchronized void imageComplete(int status)
- {
- this.status = status;
- }
-
- /**
- Get the status of the pixel grabbing representing by ImageObserver flags
-
- @return the status
-
- @specnote This method is not deprecated but getStatus is preferred to use
- */
- public synchronized int status()
- {
- return getStatus();
- }
-
+ };
+ grabberThread.start ();
+ }
+ }
+
+ /**
+ * Abort pixel grabbing.
+ */
+ public synchronized void abortGrabbing()
+ {
+ if (grabbing)
+ {
+ // Interrupt the grabbing thread.
+ Thread moribund = grabberThread;
+ grabberThread = null;
+ moribund.interrupt();
+
+ imageComplete (ImageConsumer.IMAGEABORTED);
+ }
+ }
+
+ /**
+ * Have our Image or ImageProducer start sending us pixels via our
+ * ImageConsumer methods and wait for all pixels in the grab
+ * rectangle to be delivered.
+ *
+ * @return true if successful, false on abort or error
+ *
+ * @throws InterruptedException if interrupted by another thread.
+ */
+ public synchronized boolean grabPixels() throws InterruptedException
+ {
+ return grabPixels(0);
+ }
+
+ /**
+ * grabPixels's behavior depends on the value of <code>ms</code>.
+ *
+ * If ms < 0, return true if all pixels from the source image have
+ * been delivered, false otherwise. Do not wait.
+ *
+ * If ms >= 0 then we request that our Image or ImageProducer start
+ * delivering pixels to us via our ImageConsumer methods.
+ *
+ * If ms > 0, wait at most <code>ms</code> milliseconds for
+ * delivery of all pixels within the grab rectangle.
+ *
+ * If ms == 0, wait until all pixels have been delivered.
+ *
+ * @return true if all pixels from the source image have been
+ * delivered, false otherwise
+ *
+ * @throws InterruptedException if this thread is interrupted while
+ * we are waiting for pixels to be delivered
+ */
+ public synchronized boolean grabPixels(long ms) throws InterruptedException
+ {
+ if (ms < 0)
+ return ((observerStatus & (ImageObserver.FRAMEBITS
+ | ImageObserver.ALLBITS)) != 0);
+
+ // Spawn a new ImageProducer thread to send us the image data via
+ // our ImageConsumer methods.
+ startGrabbing();
+
+ if (ms > 0)
+ {
+ long stop_time = System.currentTimeMillis() + ms;
+ long time_remaining;
+ while (grabbing)
+ {
+ time_remaining = stop_time - System.currentTimeMillis();
+ if (time_remaining <= 0)
+ break;
+ wait (time_remaining);
+ }
+ abortGrabbing ();
+ }
+ else
+ wait ();
+
+ // If consumerStatus is non-zero then the image is done loading or
+ // an error has occurred.
+ if (consumerStatus != 0)
+ return setObserverStatus ();
+
+ return ((observerStatus & (ImageObserver.FRAMEBITS
+ | ImageObserver.ALLBITS)) != 0);
+ }
+
+ // Set observer status flags based on the current consumer status
+ // flags. Return true if the consumer flags indicate that the
+ // image was loaded successfully, or false otherwise.
+ private synchronized boolean setObserverStatus ()
+ {
+ boolean retval = false;
+
+ if ((consumerStatus & IMAGEERROR) != 0)
+ observerStatus |= ImageObserver.ERROR;
+
+ if ((consumerStatus & IMAGEABORTED) != 0)
+ observerStatus |= ImageObserver.ABORT;
+
+ if ((consumerStatus & STATICIMAGEDONE) != 0)
+ {
+ observerStatus |= ImageObserver.ALLBITS;
+ retval = true;
+ }
+
+ if ((consumerStatus & SINGLEFRAMEDONE) != 0)
+ {
+ observerStatus |= ImageObserver.FRAMEBITS;
+ retval = true;
+ }
+
+ return retval;
+ }
+
+ /**
+ * @return the status of the pixel grabbing thread, represented by a
+ * bitwise OR of ImageObserver flags
+ */
+ public synchronized int getStatus()
+ {
+ return observerStatus;
+ }
+
+ /**
+ * @return the width of the grab rectangle in pixels, or a negative
+ * number if the ImageProducer has not yet called our setDimensions
+ * method
+ */
+ public synchronized int getWidth()
+ {
+ return width;
+ }
+
+ /**
+ * @return the height of the grab rectangle in pixels, or a negative
+ * number if the ImageProducer has not yet called our setDimensions
+ * method
+ */
+ public synchronized int getHeight()
+ {
+ return height;
+ }
+
+ /**
+ * @return a byte array of pixel data if ImageProducer delivered
+ * pixel data using the byte[] variant of setPixels, or an int array
+ * otherwise
+ */
+ public synchronized Object getPixels()
+ {
+ if (ints_delivered)
+ return int_pixel_buffer;
+ else if (bytes_delivered)
+ return byte_pixel_buffer;
+ else
+ return null;
+ }
+
+ /**
+ * @return the ColorModel currently being used for the majority of
+ * pixel data conversions
+ */
+ public synchronized ColorModel getColorModel()
+ {
+ return model;
+ }
+
+ /**
+ * Our <code>ImageProducer</code> calls this method to indicate the
+ * size of the image being produced.
+ *
+ * setDimensions is an ImageConsumer method. None of PixelGrabber's
+ * ImageConsumer methods should be called by code that instantiates
+ * a PixelGrabber. They are only made public so they can be called
+ * by the PixelGrabber's ImageProducer.
+ *
+ * @param width the width of the image
+ * @param height the height of the image
+ */
+ public synchronized void setDimensions(int width, int height)
+ {
+ // Our width wasn't set when we were constructed. Set our width
+ // so that the grab region includes all pixels from x to the right
+ // edge of the source image.
+ if (this.width < 0)
+ this.width = width - x;
+
+ // Our height wasn't set when we were constructed. Set our height
+ // so that the grab region includes all pixels from y to the
+ // bottom edge of the source image.
+ if (this.height < 0)
+ this.height = height - y;
+
+ if (scansize < 0)
+ scansize = this.width;
+
+ if (int_pixel_buffer == null)
+ int_pixel_buffer = new int[this.width * this.height];
+
+ if (byte_pixel_buffer == null)
+ byte_pixel_buffer = new byte[this.width * this.height];
+ }
+
+ /**
+ * Our <code>ImageProducer</code> may call this method to send us a
+ * list of its image's properties.
+ *
+ * setProperties is an ImageConsumer method. None of PixelGrabber's
+ * ImageConsumer methods should be called by code that instantiates
+ * a PixelGrabber. They are only made public so they can be called
+ * by the PixelGrabber's ImageProducer.
+ *
+ * @param props a list of properties associated with the image being
+ * produced
+ */
+ public synchronized void setProperties(Hashtable props)
+ {
+ this.props = props;
+ }
+
+ /**
+ * Our ImageProducer will call <code>setColorModel</code> to
+ * indicate the model used by the majority of calls to
+ * <code>setPixels</code>. Each call to <code>setPixels</code>
+ * could however indicate a different <code>ColorModel</code>.
+ *
+ * setColorModel is an ImageConsumer method. None of PixelGrabber's
+ * ImageConsumer methods should be called by code that instantiates
+ * a PixelGrabber. They are only made public so they can be called
+ * by the PixelGrabber's ImageProducer.
+ *
+ * @param model the color model to be used most often by setPixels
+ *
+ * @see ColorModel
+ */
+ public synchronized void setColorModel(ColorModel model)
+ {
+ this.model = model;
+ }
+
+ /**
+ * Our <code>ImageProducer</code> may call this method with a
+ * bit mask of hints from any of <code>RANDOMPIXELORDER</code>,
+ * <code>TOPDOWNLEFTRIGHT</code>, <code>COMPLETESCANLINES</code>,
+ * <code>SINGLEPASS</code>, <code>SINGLEFRAME</code>.
+ *
+ * setHints is an ImageConsumer method. None of PixelGrabber's
+ * ImageConsumer methods should be called by code that instantiates
+ * a PixelGrabber. They are only made public so they can be called
+ * by the PixelGrabber's ImageProducer.
+ *
+ * @param flags a bit mask of hints
+ */
+ public synchronized void setHints(int flags)
+ {
+ hints = flags;
+ }
+
+ /**
+ * Our ImageProducer calls setPixels to deliver a subset of its
+ * pixels.
+ *
+ * Each element of the pixels array represents one pixel. The
+ * pixel data is formatted according to the color model model.
+ * The x and y parameters are the coordinates of the rectangular
+ * region of pixels being delivered to this ImageConsumer,
+ * specified relative to the top left corner of the image being
+ * produced. Likewise, w and h are the pixel region's dimensions.
+ *
+ * @param x x coordinate of pixel block
+ * @param y y coordinate of pixel block
+ * @param w width of pixel block
+ * @param h height of pixel block
+ * @param model color model used to interpret pixel data
+ * @param pixels pixel block data
+ * @param offset offset into pixels array
+ * @param scansize width of one row in the pixel block
+ */
+ public synchronized void setPixels(int x, int y, int w, int h,
+ ColorModel model, byte[] pixels,
+ int offset, int scansize)
+ {
+ ColorModel currentModel;
+ if (model != null)
+ currentModel = model;
+ else
+ currentModel = this.model;
+
+ for(int yp = y; yp < (y + h); yp++)
+ {
+ for(int xp = x; xp < (x + w); xp++)
+ {
+ // Check if the coordinates (xp, yp) are within the
+ // pixel block that we are grabbing.
+ if(xp >= this.x
+ && yp >= this.y
+ && xp < (this.x + this.width)
+ && yp < (this.y + this.height))
+ {
+ int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset;
+ int p = (yp - y) * scansize + (xp - x) + offset;
+ if (forceRGB)
+ {
+ ints_delivered = true;
+
+ assert (i >= 0 && i < int_pixel_buffer.length);
+ assert (p >= 0 && p < pixels.length);
+ int_pixel_buffer[i] = currentModel.getRGB (pixels[p]);
+ }
+ else
+ {
+ bytes_delivered = true;
+
+ assert (i >= 0 && i < byte_pixel_buffer.length);
+ assert (p >= 0 && p < pixels.length);
+ byte_pixel_buffer[i] = pixels[p];
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Our ImageProducer calls setPixels to deliver a subset of its
+ * pixels.
+ *
+ * Each element of the pixels array represents one pixel. The
+ * pixel data is formatted according to the color model model.
+ * The x and y parameters are the coordinates of the rectangular
+ * region of pixels being delivered to this ImageConsumer,
+ * specified relative to the top left corner of the image being
+ * produced. Likewise, w and h are the pixel region's dimensions.
+ *
+ * @param x x coordinate of pixel block
+ * @param y y coordinate of pixel block
+ * @param w width of pixel block
+ * @param h height of pixel block
+ * @param model color model used to interpret pixel data
+ * @param pixels pixel block data
+ * @param offset offset into pixels array
+ * @param scansize width of one row in the pixel block
+ */
+ public synchronized void setPixels(int x, int y, int w, int h,
+ ColorModel model, int[] pixels,
+ int offset, int scansize)
+ {
+ ColorModel currentModel;
+ if (model != null)
+ currentModel = model;
+ else
+ currentModel = this.model;
+
+ ints_delivered = true;
+
+ for(int yp = y; yp < (y + h); yp++)
+ {
+ for(int xp = x; xp < (x + w); xp++)
+ {
+ // Check if the coordinates (xp, yp) are within the
+ // pixel block that we are grabbing.
+ if(xp >= this.x
+ && yp >= this.y
+ && xp < (this.x + this.width)
+ && yp < (this.y + this.height))
+ {
+ int i = (yp - this.y) * this.scansize + (xp - this.x) + this.offset;
+ int p = (yp - y) * scansize + (xp - x) + offset;
+ assert (i >= 0 && i < int_pixel_buffer.length);
+ assert (p >= 0 && p < pixels.length);
+ if (forceRGB)
+ int_pixel_buffer[i] = currentModel.getRGB (pixels[p]);
+ else
+ int_pixel_buffer[i] = pixels[p];
+ }
+ }
+ }
+ }
+
+ /**
+ * Our <code>ImageProducer</code> calls this method to inform us
+ * that a single frame or the entire image is complete. The method
+ * is also used to inform us of an error in loading or producing the
+ * image.
+ *
+ * @param status the status of image production, represented by a
+ * bitwise OR of ImageConsumer flags
+ */
+ public synchronized void imageComplete(int status)
+ {
+ consumerStatus = status;
+ setObserverStatus ();
+ grabbing = false;
+ ip.removeConsumer (this);
+
+ notifyAll ();
+ }
+
+ /**
+ * @return the return value of getStatus
+ *
+ * @specnote The newer getStatus should be used in place of status.
+ */
+ public synchronized int status()
+ {
+ return getStatus();
+ }
}
diff --git a/libjava/java/beans/BeanDescriptor.java b/libjava/java/beans/BeanDescriptor.java
index b781530e583..84a7921f615 100644
--- a/libjava/java/beans/BeanDescriptor.java
+++ b/libjava/java/beans/BeanDescriptor.java
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.beans;
-import java.util.*;
-
/**
** BeanDescriptor describes general information about a Bean, plus
** stores the Bean's Class and it's customizer's Class.<P>
diff --git a/libjava/java/beans/EventSetDescriptor.java b/libjava/java/beans/EventSetDescriptor.java
index d0f412ab7c5..66bf8e559e3 100644
--- a/libjava/java/beans/EventSetDescriptor.java
+++ b/libjava/java/beans/EventSetDescriptor.java
@@ -38,9 +38,10 @@ exception statement from your version. */
package java.beans;
-import java.util.*;
-import java.lang.reflect.*;
-import gnu.java.lang.*;
+import java.lang.reflect.Method;
+import java.lang.reflect.Modifier;
+import java.util.Vector;
+import gnu.java.lang.ClassHelper;
/**
** EventSetDescriptor describes the hookup between an event source
diff --git a/libjava/java/beans/FeatureDescriptor.java b/libjava/java/beans/FeatureDescriptor.java
index 32f54a410cb..68141cf2f44 100644
--- a/libjava/java/beans/FeatureDescriptor.java
+++ b/libjava/java/beans/FeatureDescriptor.java
@@ -38,7 +38,8 @@ exception statement from your version. */
package java.beans;
-import java.util.*;
+import java.util.Enumeration;
+import java.util.Hashtable;
/**
* FeatureDescriptor is the common superclass for all JavaBeans Descriptor
diff --git a/libjava/java/beans/IndexedPropertyDescriptor.java b/libjava/java/beans/IndexedPropertyDescriptor.java
index 42c9a248d55..8d80be9844d 100644
--- a/libjava/java/beans/IndexedPropertyDescriptor.java
+++ b/libjava/java/beans/IndexedPropertyDescriptor.java
@@ -38,8 +38,8 @@ exception statement from your version. */
package java.beans;
-import java.util.*;
-import java.lang.reflect.*;
+import java.lang.reflect.Array;
+import java.lang.reflect.Method;
/**
** IndexedPropertyDescriptor describes information about a JavaBean
diff --git a/libjava/java/beans/Introspector.java b/libjava/java/beans/Introspector.java
index b930b7469f5..078f98eb37c 100644
--- a/libjava/java/beans/Introspector.java
+++ b/libjava/java/beans/Introspector.java
@@ -38,10 +38,12 @@ exception statement from your version. */
package java.beans;
-import gnu.java.beans.*;
-import java.util.*;
-import java.lang.reflect.*;
-import gnu.java.lang.*;
+import gnu.java.beans.BeanInfoEmbryo;
+import gnu.java.beans.ExplicitBeanInfo;
+import gnu.java.beans.IntrospectionIncubator;
+import java.util.Hashtable;
+import java.util.Vector;
+import gnu.java.lang.ClassHelper;
/**
* Introspector is the class that does the bulk of the
diff --git a/libjava/java/beans/MethodDescriptor.java b/libjava/java/beans/MethodDescriptor.java
index fe1a7db8bb9..27503b8357d 100644
--- a/libjava/java/beans/MethodDescriptor.java
+++ b/libjava/java/beans/MethodDescriptor.java
@@ -38,7 +38,7 @@ exception statement from your version. */
package java.beans;
-import java.lang.reflect.*;
+import java.lang.reflect.Method;
/** MethodDescriptor describes information about a JavaBeans method.
** It's a fairly straightforward class (at least something in this
diff --git a/libjava/java/beans/PropertyDescriptor.java b/libjava/java/beans/PropertyDescriptor.java
index 00db4166ced..21ab360e982 100644
--- a/libjava/java/beans/PropertyDescriptor.java
+++ b/libjava/java/beans/PropertyDescriptor.java
@@ -38,9 +38,7 @@ exception statement from your version. */
package java.beans;
-import java.util.*;
-import java.lang.reflect.*;
-
+import java.lang.reflect.Method;
/**
** PropertyDescriptor describes information about a JavaBean property,
diff --git a/libjava/java/beans/SimpleBeanInfo.java b/libjava/java/beans/SimpleBeanInfo.java
index b98c5ef3d15..deadfbf4683 100644
--- a/libjava/java/beans/SimpleBeanInfo.java
+++ b/libjava/java/beans/SimpleBeanInfo.java
@@ -38,7 +38,8 @@ exception statement from your version. */
package java.beans;
-import java.awt.*;
+import java.awt.Image;
+import java.awt.Toolkit;
/**
** SimpleBeanInfo is a class you may extend to more easily
diff --git a/libjava/java/beans/beancontext/BeanContextServicesSupport.java b/libjava/java/beans/beancontext/BeanContextServicesSupport.java
index 02ee53aa909..60aab693db0 100644
--- a/libjava/java/beans/beancontext/BeanContextServicesSupport.java
+++ b/libjava/java/beans/beancontext/BeanContextServicesSupport.java
@@ -100,6 +100,8 @@ public class BeanContextServicesSupport
protected static class BCSSServiceProvider
implements Serializable
{
+ private static final long serialVersionUID = 861278251667444782L;
+
protected BeanContextServiceProvider serviceProvider;
protected BeanContextServiceProvider getServiceProvider()
diff --git a/libjava/java/io/BufferedReader.java b/libjava/java/io/BufferedReader.java
index 46c9e417b1b..e29c8dd8844 100644
--- a/libjava/java/io/BufferedReader.java
+++ b/libjava/java/io/BufferedReader.java
@@ -106,10 +106,14 @@ public class BufferedReader extends Reader
*
* @param in The subordinate stream to read from
* @param size The buffer size to use
+ *
+ * @exception IllegalArgumentException if size &lt;&eq; 0
*/
public BufferedReader(Reader in, int size)
{
super(in.lock);
+ if (size <= 0)
+ throw new IllegalArgumentException("Illegal buffer size: " + size);
this.in = in;
buffer = new char[size];
}
@@ -161,11 +165,12 @@ public class BufferedReader extends Reader
* becomes invalid
*
* @exception IOException If an error occurs
+ * @exception IllegalArgumentException if readLimit is negative.
*/
public void mark(int readLimit) throws IOException
{
if (readLimit < 0)
- throw new IllegalArgumentException();
+ throw new IllegalArgumentException("Read-ahead limit is negative");
synchronized (lock)
{
@@ -280,9 +285,14 @@ public class BufferedReader extends Reader
* @return The actual number of chars read, or -1 if end of stream.
*
* @exception IOException If an error occurs.
+ * @exception IndexOutOfBoundsException If offset and count are not
+ * valid regarding buf.
*/
public int read(char[] buf, int offset, int count) throws IOException
{
+ if (offset < 0 || offset + count > buf.length || count < 0)
+ throw new IndexOutOfBoundsException();
+
synchronized (lock)
{
checkStatus();
@@ -450,12 +460,19 @@ public class BufferedReader extends Reader
boolean eof = false;
for (;;)
{
- int ch = read();
- if (ch < 0)
+ // readLine should block. So we must not return until a -1 is reached.
+ if (pos >= limit)
{
- eof = true;
- break;
+ // here count == 0 isn't sufficient to give a failure.
+ int count = fill();
+ if (count < 0)
+ {
+ eof = true;
+ break;
+ }
+ continue;
}
+ int ch = buffer[pos++];
if (ch == '\n' || ch == '\r')
{
// Check here if a '\r' was the last char in the buffer; if so,
@@ -487,14 +504,17 @@ public class BufferedReader extends Reader
*
* @return The actual number of chars skipped.
*
- * @exception IOException If an error occurs
+ * @exception IOException If an error occurs.
+ * @exception IllegalArgumentException If count is negative.
*/
public long skip(long count) throws IOException
{
synchronized (lock)
{
checkStatus();
- if (count <= 0)
+ if (count < 0)
+ throw new IllegalArgumentException("skip value is negative");
+ 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
diff --git a/libjava/java/io/ByteArrayOutputStream.java b/libjava/java/io/ByteArrayOutputStream.java
index 3e3e0c20018..2e89cf5ee0a 100644
--- a/libjava/java/io/ByteArrayOutputStream.java
+++ b/libjava/java/io/ByteArrayOutputStream.java
@@ -198,7 +198,7 @@ public class ByteArrayOutputStream extends OutputStream
// Resize buffer to accommodate new bytes.
private void resize (int add)
{
- if (count + add >= buf.length)
+ if (count + add > buf.length)
{
int newlen = buf.length * 2;
if (count + add > newlen)
diff --git a/libjava/java/io/CharArrayReader.java b/libjava/java/io/CharArrayReader.java
index f379519b834..9d5382bef1e 100644
--- a/libjava/java/io/CharArrayReader.java
+++ b/libjava/java/io/CharArrayReader.java
@@ -228,7 +228,7 @@ public class CharArrayReader extends Reader
/* Don't need to check pos value, arraycopy will check it. */
if (off < 0 || len < 0 || off + len > b.length)
- throw new ArrayIndexOutOfBoundsException();
+ throw new IndexOutOfBoundsException();
if (pos >= count)
return -1;
diff --git a/libjava/java/io/FileInputStream.java b/libjava/java/io/FileInputStream.java
index 4c599d11d1b..c88f83db445 100644
--- a/libjava/java/io/FileInputStream.java
+++ b/libjava/java/io/FileInputStream.java
@@ -79,11 +79,7 @@ public class FileInputStream extends InputStream
*/
public FileInputStream(String name) throws FileNotFoundException
{
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkRead(name);
-
- fd = new FileDescriptor(name, FileDescriptor.READ);
+ this(new File(name));
}
/**
@@ -104,7 +100,14 @@ public class FileInputStream extends InputStream
*/
public FileInputStream(File file) throws FileNotFoundException
{
- this(file.getPath());
+ SecurityManager s = System.getSecurityManager();
+ if (s != null)
+ s.checkRead(file.getPath());
+
+ if (file.isDirectory())
+ throw new FileNotFoundException(file.getPath() + " is a directory");
+
+ fd = new FileDescriptor(file.getPath(), FileDescriptor.READ);
}
/**
diff --git a/libjava/java/io/FilePermission.java b/libjava/java/io/FilePermission.java
index 07b42e149a0..2c3f1773b8e 100644
--- a/libjava/java/io/FilePermission.java
+++ b/libjava/java/io/FilePermission.java
@@ -38,8 +38,7 @@ exception statement from your version. */
package java.io;
-import java.security.*;
-
+import java.security.Permission;
public final class FilePermission extends Permission implements Serializable
{
diff --git a/libjava/java/io/LineNumberReader.java b/libjava/java/io/LineNumberReader.java
index 9c4796d402f..b3cb5826930 100644
--- a/libjava/java/io/LineNumberReader.java
+++ b/libjava/java/io/LineNumberReader.java
@@ -54,7 +54,8 @@ package java.io;
*
* @author Per Bothner <bothner@cygnus.com>
* @author Aaron M. Renn (arenn@urbanophile.com)
- * @date April 22, 1998.
+ * @author Guilhem Lavaux <guilhem@kaffe.org>
+ * @date December 28, 2003.
*/
/* Written using "Java Class Libraries", 2nd edition, plus online
* API docs for JDK 1.2 beta from http://www.javasoft.com.
@@ -71,6 +72,10 @@ public class LineNumberReader extends BufferedReader
{
/** The current line number. */
private int lineNumber;
+ /** Whether we already found a new line in the former call. */
+ private boolean matchedNewLine;
+ /** The saved line number when calling mark() */
+ private int savedLineNumber;
/**
* Create a new <code>LineNumberReader</code> that reads from the
@@ -117,20 +122,6 @@ public class LineNumberReader extends BufferedReader
this.lineNumber = lineNumber;
}
- private static int countLines (char[] buffer, int off, int len)
- {
- int count = 0;
- char prev = '\0';
- for (int i = 0; i < len; i++)
- {
- char ch = buffer[i+off];
- if ((ch == '\n' && prev != '\r') || ch == '\r')
- count++;
- prev = ch;
- }
- return count;
- }
-
/**
* This method marks a position in the input to which the stream can be
* "reset" char calling the <code>reset()</code> method. The parameter
@@ -155,6 +146,9 @@ public class LineNumberReader extends BufferedReader
*/
public void mark(int readLimit) throws IOException
{
+ if (readLimit < 0)
+ throw new IllegalArgumentException("Read-ahead limit is negative");
+
synchronized (lock)
{
// This is basically the same as BufferedReader.mark.
@@ -162,11 +156,12 @@ public class LineNumberReader extends BufferedReader
// save that 'r', in case the next character is a '\n'.
if (pos + readLimit > limit)
{
- int saveCR = (pos > 0 && buffer[pos-1] == '\r') ? 1 : 0;
+ int saveCR = matchedNewLine ? 1 : 0;
char[] old_buffer = buffer;
if (readLimit > limit)
buffer = new char[saveCR + readLimit];
int copy_start = pos - saveCR;
+ savedLineNumber = lineNumber;
limit -= copy_start;
System.arraycopy(old_buffer, copy_start, buffer, 0, limit);
pos = saveCR;
@@ -192,15 +187,35 @@ public class LineNumberReader extends BufferedReader
{
if (markPos < 0)
throw new IOException("mark never set or invalidated");
- if (markPos > 0 && pos > markPos && buffer[markPos-1] == '\r'
- && buffer[markPos] == '\n')
- lineNumber--;
- lineNumber -= countLines(buffer, markPos, pos - markPos);
+ lineNumber = savedLineNumber;
pos = markPos;
+ matchedNewLine = (markPos > 0 && buffer[markPos-1] == '\r');
}
}
/**
+ * This private method fills the input buffer whatever pos is.
+ * Consequently pos should be checked before calling this method.
+ *
+ * @return the number of bytes actually read from the input stream or
+ * -1 if end of stream.
+ * @exception IOException If an error occurs.
+ */
+ private int fill() throws IOException
+ {
+ if (markPos >= 0 && limit == buffer.length)
+ markPos = -1;
+ if (markPos < 0)
+ pos = limit = 0;
+ int count = in.read(buffer, limit, buffer.length - limit);
+ if (count <= 0)
+ return -1;
+ limit += count;
+
+ return count;
+ }
+
+ /**
* This method reads an unsigned char from the input stream and returns it
* as an int in the range of 0-65535. This method will return -1 if the
* end of the stream has been reached.
@@ -223,30 +238,24 @@ public class LineNumberReader extends BufferedReader
synchronized (lock)
{
skipRedundantLF();
- if (pos >= limit)
- {
- if (markPos >= 0 && limit == buffer.length)
- markPos = -1;
- if (markPos < 0)
- pos = limit = 0;
- int count = in.read(buffer, limit, buffer.length - limit);
- if (count <= 0)
- return -1;
- limit += count;
- }
+ if (pos >= limit && fill() < 0)
+ return -1;
char ch = buffer[pos++];
- if (ch == '\r' || ch == '\n')
+
+ if ((matchedNewLine = (ch == '\r')) || ch == '\n')
{
lineNumber++;
return '\n';
}
+ matchedNewLine = false;
return (int) ch;
}
}
/**
* This method reads chars from a stream and stores them into a caller
- * supplied buffer. It starts storing data at index <code>offset</code> into * the buffer and attemps to read <code>len</code> chars. This method can
+ * supplied buffer. It starts storing data at index <code>offset</code> into
+ * the buffer and attemps to read <code>len</code> 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 indicated the
* end of the stream.
@@ -265,46 +274,57 @@ public class LineNumberReader extends BufferedReader
* @return The actual number of chars read, or -1 if end of stream
*
* @exception IOException If an error occurs.
+ * @exception NullPointerException If buf is null (in any case).
+ * @exception IndexOutOfBoundsException If buffer parameters (offset and
+ * count) lies outside of the buffer capacity.
*/
public int read(char[] buf, int offset, int count) throws IOException
{
+ if (buf == null)
+ throw new NullPointerException();
+
+ if (offset + count > buf.length || offset < 0)
+ throw new IndexOutOfBoundsException();
+
if (count <= 0)
{
if (count < 0)
throw new IndexOutOfBoundsException();
return 0;
}
+
synchronized (lock)
{
- int first = read();
- if (first < 0)
+ if (pos >= limit && fill() < 0)
return -1;
+
int start_offset = offset;
- buf[offset++] = (char) first;
- if (buffer[pos-1] == '\r' && pos < limit && buffer[pos] == '\n')
- pos++;
- count--;
+ boolean matched = matchedNewLine;
+
while (count-- > 0 && pos < limit)
{
char ch = buffer[pos++];
if (ch == '\r')
{
lineNumber++;
- ch = '\n';
- if (pos < limit && buffer[pos] == '\n')
- pos++;
+ matched = true;
}
- else if (ch == '\n')
+ else if (ch == '\n' && !matched)
lineNumber++;
+ else
+ matched = false;
+
buf[offset++] = ch;
}
+
+ matchedNewLine = matched;
return offset - start_offset;
}
}
private void skipRedundantLF() throws IOException
{
- if (pos > 0 && buffer[pos-1] == '\r')
+ if (pos > 0 && matchedNewLine)
{
if (pos < limit)
{ // fast case
@@ -312,16 +332,14 @@ public class LineNumberReader extends BufferedReader
pos++;
}
else
- { // use read() to deal with the general case.
- // Set pos and limit to zero to avoid infinite recursion in read.
- // May need to invalidate markPos if we've exceeded the buffer.
- if (pos >= buffer.length)
- markPos = -1;
- pos = limit = 0;
- int ch = read();
- if (ch >= 0 && ch != '\n')
- pos--;
+ { // check whether the next buffer begins with '\n'.
+ // in that case kill the '\n'.
+ if (fill() <= 0)
+ return;
+ if (buffer[pos] == '\n')
+ pos++;
}
+ matchedNewLine = true;
}
}
@@ -355,8 +373,9 @@ public class LineNumberReader extends BufferedReader
if (pos > limit)
--pos;
- int ch;
- if (pos > 0 && ((ch = buffer[pos - 1]) == '\n' || ch == '\r'))
+ // The only case where you mustn't increment the line number is you are
+ // at the EOS.
+ if (str != null)
lineNumber = tmpLineNumber + 1;
return str;
@@ -376,14 +395,17 @@ public class LineNumberReader extends BufferedReader
*/
public long skip (long count) throws IOException
{
- if (count <= 0)
+ if (count < 0)
+ throw new IllegalArgumentException("skip() value is negative");
+ if (count == 0)
return 0;
int skipped;
-
+ char[] buf = new char[1];
+
for (skipped = 0; skipped < count; skipped++)
{
- int ch = read();
+ int ch = read(buf, 0, 1);
if (ch < 0)
break;
diff --git a/libjava/java/io/ObjectInputStream.java b/libjava/java/io/ObjectInputStream.java
index 918626905a4..c2ddbe077c6 100644
--- a/libjava/java/io/ObjectInputStream.java
+++ b/libjava/java/io/ObjectInputStream.java
@@ -73,7 +73,7 @@ public class ObjectInputStream extends InputStream
*
* @see #readStreamHeader()
*/
- public ObjectInputStream (InputStream in)
+ public ObjectInputStream(InputStream in)
throws IOException, StreamCorruptedException
{
if (Configuration.DEBUG)
@@ -96,13 +96,14 @@ public class ObjectInputStream extends InputStream
this.blockDataPosition = 0;
this.blockDataBytes = 0;
this.blockData = new byte[BUFFER_SIZE];
- this.blockDataInput = new DataInputStream (this);
- this.realInputStream = new DataInputStream (in);
+ this.blockDataInput = new DataInputStream(this);
+ this.realInputStream = new DataInputStream(in);
this.nextOID = baseWireHandle;
- this.objectLookupTable = new Hashtable ();
- this.validators = new Vector ();
- setBlockDataMode (true);
- readStreamHeader ();
+ this.objectLookupTable = new Hashtable();
+ this.validators = new Vector();
+ this.classLookupTable = new Hashtable();
+ setBlockDataMode(true);
+ readStreamHeader();
}
@@ -121,10 +122,10 @@ public class ObjectInputStream extends InputStream
* @exception IOException Exception from underlying
* <code>InputStream</code>.
*/
- public final Object readObject () throws ClassNotFoundException, IOException
+ public final Object readObject() throws ClassNotFoundException, IOException
{
if (this.useSubclassMethod)
- return readObjectOverride ();
+ return readObjectOverride();
boolean was_deserializing;
@@ -132,12 +133,12 @@ public class ObjectInputStream extends InputStream
was_deserializing = this.isDeserializing;
boolean is_consumed = false;
- boolean old_mode = setBlockDataMode (false);
+ boolean old_mode = setBlockDataMode(false);
this.isDeserializing = true;
- byte marker = this.realInputStream.readByte ();
- dumpElement ("MARKER: 0x" + Integer.toHexString(marker) + " ");
+ byte marker = this.realInputStream.readByte();
+ dumpElement("MARKER: 0x" + Integer.toHexString(marker) + " ");
try
{
@@ -154,43 +155,43 @@ public class ObjectInputStream extends InputStream
case TC_BLOCKDATALONG:
{
if (marker == TC_BLOCKDATALONG)
- dumpElementln ("BLOCKDATALONG");
+ dumpElementln("BLOCKDATALONG");
else
- dumpElementln ("BLOCKDATA");
- readNextBlock (marker);
- throw new StreamCorruptedException ("Unexpected blockData");
+ dumpElementln("BLOCKDATA");
+ readNextBlock(marker);
+ throw new StreamCorruptedException("Unexpected blockData");
}
case TC_NULL:
{
- dumpElementln ("NULL");
+ dumpElementln("NULL");
ret_val = null;
break;
}
case TC_REFERENCE:
{
- dumpElement ("REFERENCE ");
- Integer oid = new Integer (this.realInputStream.readInt ());
- dumpElementln (Integer.toHexString(oid.intValue()));
+ dumpElement("REFERENCE ");
+ Integer oid = new Integer(this.realInputStream.readInt());
+ dumpElementln(Integer.toHexString(oid.intValue()));
ret_val = ((ObjectIdentityWrapper)
- this.objectLookupTable.get (oid)).object;
+ this.objectLookupTable.get(oid)).object;
break;
}
case TC_CLASS:
{
- dumpElementln ("CLASS");
- ObjectStreamClass osc = (ObjectStreamClass)readObject ();
- Class clazz = osc.forClass ();
- assignNewHandle (clazz);
+ dumpElementln("CLASS");
+ ObjectStreamClass osc = (ObjectStreamClass)readObject();
+ Class clazz = osc.forClass();
+ assignNewHandle(clazz);
ret_val = clazz;
break;
}
case TC_PROXYCLASSDESC:
{
- dumpElementln ("PROXYCLASS");
+ dumpElementln("PROXYCLASS");
int n_intf = this.realInputStream.readInt();
String[] intfs = new String[n_intf];
for (int i = 0; i < n_intf; i++)
@@ -199,41 +200,41 @@ public class ObjectInputStream extends InputStream
System.out.println(intfs[i]);
}
- boolean oldmode = setBlockDataMode (true);
+ boolean oldmode = setBlockDataMode(true);
Class cl = resolveProxyClass(intfs);
setBlockDataMode(oldmode);
- ObjectStreamClass osc = ObjectStreamClass.lookup(cl);
- assignNewHandle (osc);
+ ObjectStreamClass osc = lookupClass(cl);
+ assignNewHandle(osc);
if (!is_consumed)
{
- byte b = this.realInputStream.readByte ();
+ byte b = this.realInputStream.readByte();
if (b != TC_ENDBLOCKDATA)
- throw new IOException ("Data annotated to class was not consumed." + b);
+ throw new IOException("Data annotated to class was not consumed." + b);
}
else
is_consumed = false;
- ObjectStreamClass superosc = (ObjectStreamClass)readObject ();
- osc.setSuperclass (superosc);
+ ObjectStreamClass superosc = (ObjectStreamClass)readObject();
+ osc.setSuperclass(superosc);
ret_val = osc;
break;
}
case TC_CLASSDESC:
{
- ObjectStreamClass osc = readClassDescriptor ();
+ ObjectStreamClass osc = readClassDescriptor();
if (!is_consumed)
{
- byte b = this.realInputStream.readByte ();
+ byte b = this.realInputStream.readByte();
if (b != TC_ENDBLOCKDATA)
- throw new IOException ("Data annotated to class was not consumed." + b);
+ throw new IOException("Data annotated to class was not consumed." + b);
}
else
is_consumed = false;
- osc.setSuperclass ((ObjectStreamClass)readObject ());
+ osc.setSuperclass ((ObjectStreamClass)readObject());
ret_val = osc;
break;
}
@@ -241,105 +242,107 @@ public class ObjectInputStream extends InputStream
case TC_STRING:
case TC_LONGSTRING:
{
- dumpElement ("STRING=");
- String s = this.realInputStream.readUTF ();
- dumpElementln (s);
- ret_val = processResolution (s, assignNewHandle (s));
+ dumpElement("STRING=");
+ String s = this.realInputStream.readUTF();
+ dumpElementln(s);
+ ret_val = processResolution(s, assignNewHandle(s));
break;
}
case TC_ARRAY:
{
- dumpElementln ("ARRAY");
- ObjectStreamClass osc = (ObjectStreamClass)readObject ();
- Class componentType = osc.forClass ().getComponentType ();
- dumpElement ("ARRAY LENGTH=");
- int length = this.realInputStream.readInt ();
+ dumpElementln("ARRAY");
+ ObjectStreamClass osc = (ObjectStreamClass)readObject();
+ Class componentType = osc.forClass().getComponentType();
+ dumpElement("ARRAY LENGTH=");
+ int length = this.realInputStream.readInt();
dumpElementln (length + "; COMPONENT TYPE=" + componentType);
- Object array = Array.newInstance (componentType, length);
- int handle = assignNewHandle (array);
- readArrayElements (array, componentType);
- for (int i=0, len=Array.getLength(array); i < len; i++)
- dumpElementln (" ELEMENT[" + i + "]=" + Array.get(array, i));
- ret_val = processResolution (array, handle);
+ Object array = Array.newInstance(componentType, length);
+ int handle = assignNewHandle(array);
+ readArrayElements(array, componentType);
+ for (int i = 0, len = Array.getLength(array); i < len; i++)
+ dumpElementln(" ELEMENT[" + i + "]=" + Array.get(array, i));
+ ret_val = processResolution(array, handle);
break;
}
case TC_OBJECT:
{
- dumpElementln ("OBJECT");
- ObjectStreamClass osc = (ObjectStreamClass)readObject ();
- Class clazz = osc.forClass ();
+ dumpElementln("OBJECT");
+ ObjectStreamClass osc = (ObjectStreamClass)readObject();
+ Class clazz = osc.forClass();
- if (!Serializable.class.isAssignableFrom (clazz))
- throw new NotSerializableException (clazz + " is not Serializable, and thus cannot be deserialized.");
+ if (!Serializable.class.isAssignableFrom(clazz))
+ throw new NotSerializableException
+ (clazz + " is not Serializable, and thus cannot be deserialized.");
- if (Externalizable.class.isAssignableFrom (clazz))
+ if (Externalizable.class.isAssignableFrom(clazz))
{
Externalizable obj = null;
try
{
- obj = (Externalizable)clazz.newInstance ();
+ obj = (Externalizable)clazz.newInstance();
}
catch (InstantiationException e)
{
- throw new ClassNotFoundException ("Instance of " + clazz
- + " could not be created");
+ throw new ClassNotFoundException
+ ("Instance of " + clazz + " could not be created");
}
catch (IllegalAccessException e)
{
- throw new ClassNotFoundException ("Instance of " + clazz
- + " could not be created because class or zero-argument constructor is not accessible");
+ throw new ClassNotFoundException
+ ("Instance of " + clazz + " could not be created because class or "
+ + "zero-argument constructor is not accessible");
}
catch (NoSuchMethodError e)
{
- throw new ClassNotFoundException ("Instance of " + clazz
- + " could not be created because zero-argument constructor is not defined");
+ throw new ClassNotFoundException
+ ("Instance of " + clazz
+ + " could not be created because zero-argument constructor is not defined");
}
- int handle = assignNewHandle (obj);
+ int handle = assignNewHandle(obj);
- boolean read_from_blocks = ((osc.getFlags () & SC_BLOCK_DATA) != 0);
+ boolean read_from_blocks = ((osc.getFlags() & SC_BLOCK_DATA) != 0);
boolean oldmode = this.readDataFromBlock;
if (read_from_blocks)
- setBlockDataMode (true);
+ setBlockDataMode(true);
- obj.readExternal (this);
+ obj.readExternal(this);
if (read_from_blocks)
- setBlockDataMode (oldmode);
+ setBlockDataMode(oldmode);
- ret_val = processResolution (obj, handle);
+ ret_val = processResolution(obj, handle);
break;
} // end if (Externalizable.class.isAssignableFrom (clazz))
// find the first non-serializable, non-abstract
// class in clazz's inheritance hierarchy
- Class first_nonserial = clazz.getSuperclass ();
- while (Serializable.class.isAssignableFrom (first_nonserial)
- || Modifier.isAbstract (first_nonserial.getModifiers ()))
- first_nonserial = first_nonserial.getSuperclass ();
+ Class first_nonserial = clazz.getSuperclass();
+ while (Serializable.class.isAssignableFrom(first_nonserial)
+ || Modifier.isAbstract(first_nonserial.getModifiers()))
+ first_nonserial = first_nonserial.getSuperclass();
Object obj = null;
- obj = newObject (clazz, first_nonserial);
+ obj = newObject(clazz, first_nonserial);
if (obj == null)
- throw new ClassNotFoundException ("Instance of " + clazz +
- " could not be created");
+ throw new ClassNotFoundException
+ ("Instance of " + clazz + " could not be created");
- int handle = assignNewHandle (obj);
+ int handle = assignNewHandle(obj);
this.currentObject = obj;
ObjectStreamClass[] hierarchy =
- ObjectStreamClass.getObjectStreamClasses (clazz);
+ inputGetObjectStreamClasses(clazz);
- for (int i=0; i < hierarchy.length; i++)
+ for (int i = 0; i < hierarchy.length; i++)
{
this.currentObjectStreamClass = hierarchy[i];
- dumpElementln ("Reading fields of "
- + this.currentObjectStreamClass.getName ());
+ dumpElementln("Reading fields of " + this.currentObjectStreamClass.getName ());
// XXX: should initialize fields in classes in the hierarchy
// that aren't in the stream
@@ -349,116 +352,157 @@ public class ObjectInputStream extends InputStream
if (this.currentObjectStreamClass.hasReadMethod())
{
fieldsAlreadyRead = false;
- boolean oldmode = setBlockDataMode (true);
- callReadMethod (obj, this.currentObjectStreamClass);
- setBlockDataMode (oldmode);
- dumpElement ("ENDBLOCKDATA? ");
+ boolean oldmode = setBlockDataMode(true);
+ callReadMethod(obj, this.currentObjectStreamClass);
+ setBlockDataMode(oldmode);
+ dumpElement("ENDBLOCKDATA? ");
try
{
// FIXME: XXX: This try block is to catch EOF which is
// thrown for some objects. That indicates a bug in the logic.
- if (this.realInputStream.readByte () != TC_ENDBLOCKDATA)
- throw new IOException ("No end of block data seen for class with readObject (ObjectInputStream) method.");
- dumpElementln ("yes");
+ if (this.realInputStream.readByte() != TC_ENDBLOCKDATA)
+ throw new IOException
+ ("No end of block data seen for class with readObject (ObjectInputStream) method.");
+ dumpElementln("yes");
}
catch (EOFException e)
{
- dumpElementln ("no, got EOFException");
+ dumpElementln("no, got EOFException");
}
catch (IOException e)
{
- dumpElementln ("no, got IOException");
+ dumpElementln("no, got IOException");
}
}
else
{
- readFields (obj, currentObjectStreamClass);
+ readFields(obj, currentObjectStreamClass);
}
}
this.currentObject = null;
this.currentObjectStreamClass = null;
- ret_val = processResolution (obj, handle);
+ ret_val = processResolution(obj, handle);
break;
}
case TC_RESET:
- dumpElementln ("RESET");
- clearHandles ();
- ret_val = readObject ();
+ dumpElementln("RESET");
+ clearHandles();
+ ret_val = readObject();
break;
case TC_EXCEPTION:
{
- dumpElement ("EXCEPTION=");
- Exception e = (Exception)readObject ();
- dumpElementln (e.toString());
- clearHandles ();
- throw new WriteAbortedException ("Exception thrown during writing of stream", e);
+ dumpElement("EXCEPTION=");
+ Exception e = (Exception)readObject();
+ dumpElementln(e.toString());
+ clearHandles();
+ throw new WriteAbortedException("Exception thrown during writing of stream", e);
}
default:
- throw new IOException ("Unknown marker on stream: " + marker);
+ throw new IOException("Unknown marker on stream: " + marker);
}
}
finally
{
- setBlockDataMode (old_mode);
+ setBlockDataMode(old_mode);
this.isDeserializing = was_deserializing;
if (! was_deserializing)
{
- if (validators.size () > 0)
- invokeValidators ();
+ if (validators.size() > 0)
+ invokeValidators();
}
}
return ret_val;
}
- protected ObjectStreamClass readClassDescriptor ()
+ /**
+ * This method reads a class descriptor from the real input stream
+ * and use these data to create a new instance of ObjectStreamClass.
+ * Fields are sorted and ordered for the real read which occurs for
+ * each instance of the described class. Be aware that if you call that
+ * method you must ensure that the stream is synchronized, in the other
+ * case it may be completely desynchronized.
+ *
+ * @return A new instance of ObjectStreamClass containing the freshly
+ * created descriptor.
+ * @throws ClassNotFoundException if the required class to build the
+ * descriptor has not been found in the system.
+ * @throws IOException An input/output error occured.
+ * @throws InvalidClassException If there was a compatibility problem
+ * between the class present in the system and the serialized class.
+ */
+ protected ObjectStreamClass readClassDescriptor()
throws ClassNotFoundException, IOException
{
- dumpElement ("CLASSDESC NAME=");
- String name = this.realInputStream.readUTF ();
- dumpElement (name + "; UID=");
+ dumpElement("CLASSDESC NAME=");
+ String name = this.realInputStream.readUTF();
+ dumpElement(name + "; UID=");
long uid = this.realInputStream.readLong ();
- dumpElement (Long.toHexString(uid) + "; FLAGS=");
+ dumpElement(Long.toHexString(uid) + "; FLAGS=");
byte flags = this.realInputStream.readByte ();
- dumpElement (Integer.toHexString(flags) + "; FIELD COUNT=");
- short field_count = this.realInputStream.readShort ();
- dumpElementln (Short.toString(field_count));
+ dumpElement(Integer.toHexString(flags) + "; FIELD COUNT=");
+ short field_count = this.realInputStream.readShort();
+ dumpElementln(Short.toString(field_count));
ObjectStreamField[] fields = new ObjectStreamField[field_count];
- ObjectStreamClass osc = new ObjectStreamClass (name, uid,
- flags, fields);
- assignNewHandle (osc);
+ ObjectStreamClass osc = new ObjectStreamClass(name, uid,
+ flags, fields);
+ assignNewHandle(osc);
- for (int i=0; i < field_count; i++)
+ for (int i = 0; i < field_count; i++)
{
- dumpElement (" TYPE CODE=");
- char type_code = (char)this.realInputStream.readByte ();
- dumpElement (type_code + "; FIELD NAME=");
- String field_name = this.realInputStream.readUTF ();
- dumpElementln (field_name);
+ dumpElement(" TYPE CODE=");
+ char type_code = (char)this.realInputStream.readByte();
+ dumpElement(type_code + "; FIELD NAME=");
+ String field_name = this.realInputStream.readUTF();
+ dumpElementln(field_name);
String class_name;
+ // If the type code is an array or an object we must
+ // decode a String here. In the other case we convert
+ // the type code and pass it to ObjectStreamField.
+ // Type codes are decoded by gnu.java.lang.reflect.TypeSignature.
if (type_code == 'L' || type_code == '[')
- class_name = (String)readObject ();
+ class_name = (String)readObject();
else
- class_name = String.valueOf (type_code);
+ class_name = String.valueOf(type_code);
- // There're many cases you can't get java.lang.Class from
- // typename if your context class loader can't load it,
- // then use typename to construct the field
fields[i] =
- new ObjectStreamField (field_name, class_name);
+ new ObjectStreamField(field_name, class_name, currentLoader());
}
- boolean oldmode = setBlockDataMode (true);
- osc.setClass (resolveClass (osc));
- setBlockDataMode (oldmode);
-
+ /* Now that fields have been read we may resolve the class
+ * (and read annotation if needed). */
+ Class clazz = resolveClass(osc);
+
+ for (int i = 0; i < field_count; i++)
+ {
+ Field f;
+
+ try
+ {
+ f = clazz.getDeclaredField(fields[i].getName());
+ if (f != null && !f.getType().equals(fields[i].getType()))
+ throw new InvalidClassException
+ ("invalid field type for " + fields[i].getName() + " in class "
+ + name + " (requested was \"" + fields[i].getType()
+ + " and found \"" + f.getType() + "\")");
+ }
+ catch (NoSuchFieldException _)
+ {
+ }
+ }
+
+ boolean oldmode = setBlockDataMode(true);
+ osc.setClass(clazz, lookupClass(clazz.getSuperclass()));
+ classLookupTable.put(clazz, osc);
+ setBlockDataMode(oldmode);
+
return osc;
}
@@ -481,17 +525,20 @@ public class ObjectInputStream extends InputStream
* @exception IOException Exception from underlying
* <code>OutputStream</code>.
*/
- public void defaultReadObject ()
+ public void defaultReadObject()
throws ClassNotFoundException, IOException, NotActiveException
{
if (this.currentObject == null || this.currentObjectStreamClass == null)
- throw new NotActiveException ("defaultReadObject called by non-active class and/or object");
+ throw new NotActiveException("defaultReadObject called by non-active"
+ + " class and/or object");
if (fieldsAlreadyRead)
- throw new NotActiveException ("defaultReadObject called but fields already read from stream (by defaultReadObject or readFields)");
+ throw new NotActiveException("defaultReadObject called but fields "
+ + "already read from stream (by "
+ + "defaultReadObject or readFields)");
boolean oldmode = setBlockDataMode(false);
- readFields (this.currentObject, this.currentObjectStreamClass);
+ readFields(this.currentObject, this.currentObjectStreamClass);
setBlockDataMode(oldmode);
fieldsAlreadyRead = true;
@@ -516,18 +563,20 @@ public class ObjectInputStream extends InputStream
* validator outside of the <code>readObject</code> method of the
* object currently being deserialized
*/
- public void registerValidation (ObjectInputValidation validator,
- int priority)
+ public void registerValidation(ObjectInputValidation validator,
+ int priority)
throws InvalidObjectException, NotActiveException
{
if (this.currentObject == null || this.currentObjectStreamClass == null)
- throw new NotActiveException ("registerValidation called by non-active class and/or object");
+ throw new NotActiveException("registerValidation called by non-active "
+ + "class and/or object");
if (validator == null)
- throw new InvalidObjectException ("attempt to add a null ObjectInputValidation object");
+ throw new InvalidObjectException("attempt to add a null "
+ + "ObjectInputValidation object");
- this.validators.addElement (new ValidatorAndPriority (validator,
- priority));
+ this.validators.addElement(new ValidatorAndPriority (validator,
+ priority));
}
@@ -547,22 +596,89 @@ public class ObjectInputStream extends InputStream
*
* @see java.io.ObjectOutputStream#annotateClass (java.lang.Class)
*/
- protected Class resolveClass (ObjectStreamClass osc)
+ protected Class resolveClass(ObjectStreamClass osc)
throws ClassNotFoundException, IOException
{
- SecurityManager sm = System.getSecurityManager ();
+ return Class.forName(osc.getName(), true, currentLoader());
+ }
+
+ /**
+ * This method invokes the method currentClassLoader for the
+ * current security manager (or build an empty one if it is not
+ * present).
+ *
+ * @return The most recent non-system ClassLoader on the execution stack.
+ * @see java.lang.SecurityManager#currentClassLoader()
+ */
+ private ClassLoader currentLoader()
+ {
+ SecurityManager sm = System.getSecurityManager();
if (sm == null)
sm = new SecurityManager () {};
+
+ return currentClassLoader(sm);
+ }
- // 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);
+ /**
+ * Lookup a class stored in the local hashtable. If it is not
+ * use the global lookup function in ObjectStreamClass to build
+ * the ObjectStreamClass. This method is requested according to
+ * the behaviour detected in the JDK by Kaffe's team.
+ *
+ * @param clazz Class to lookup in the hash table or for which
+ * we must build a descriptor.
+ * @return A valid instance of ObjectStreamClass corresponding
+ * to the specified class.
+ */
+ private ObjectStreamClass lookupClass(Class clazz)
+ {
+ ObjectStreamClass oclazz;
- if (cl == null)
- return Class.forName (osc.getName ());
+ oclazz = (ObjectStreamClass)classLookupTable.get(clazz);
+ if (oclazz == null)
+ return ObjectStreamClass.lookup(clazz);
else
- return cl.loadClass (osc.getName ());
+ return oclazz;
+ }
+
+ /**
+ * Reconstruct class hierarchy the same way
+ * {@link java.io.ObjectStreamClass.getObjectStreamClasses(java.lang.Class)} does
+ * but using lookupClass instead of ObjectStreamClass.lookup. This
+ * dup is necessary localize the lookup table. Hopefully some future
+ * rewritings will be able to prevent this.
+ *
+ * @param clazz This is the class for which we want the hierarchy.
+ *
+ * @return An array of valid {@link java.io.ObjectStreamClass} instances which
+ * represent the class hierarchy for clazz.
+ */
+ private ObjectStreamClass[] inputGetObjectStreamClasses(Class clazz)
+ {
+ ObjectStreamClass osc = lookupClass(clazz);
+
+ ObjectStreamClass[] ret_val;
+
+ if (osc == null)
+ return new ObjectStreamClass[0];
+ else
+ {
+ Vector oscs = new Vector();
+
+ while (osc != null)
+ {
+ oscs.addElement(osc);
+ osc = osc.getSuper();
+ }
+
+ int count = oscs.size();
+ ObjectStreamClass[] sorted_oscs = new ObjectStreamClass[count];
+
+ for (int i = count - 1; i >= 0; i--)
+ sorted_oscs[count - i - 1] = (ObjectStreamClass) oscs.elementAt(i);
+
+ return sorted_oscs;
+ }
}
/**
@@ -578,36 +694,40 @@ public class ObjectInputStream extends InputStream
*
* @see #enableResolveObject(boolean)
*/
- protected Object resolveObject (Object obj) throws IOException
+ protected Object resolveObject(Object obj) throws IOException
{
return obj;
}
- protected Class resolveProxyClass (String[] intfs)
+ protected Class resolveProxyClass(String[] intfs)
throws IOException, ClassNotFoundException
{
- SecurityManager sm = System.getSecurityManager ();
+ SecurityManager sm = System.getSecurityManager();
if (sm == null)
- sm = new SecurityManager () {};
+ sm = new SecurityManager() {};
- ClassLoader cl = currentClassLoader (sm);
+ ClassLoader cl = currentClassLoader(sm);
Class[] clss = new Class[intfs.length];
- if(cl == null){
- for (int i = 0; i < intfs.length; i++)
- clss[i] = Class.forName(intfs[i]);
- cl = ClassLoader.getSystemClassLoader();
- }
+ if(cl == null)
+ {
+ for (int i = 0; i < intfs.length; i++)
+ clss[i] = Class.forName(intfs[i]);
+ cl = ClassLoader.getSystemClassLoader();
+ }
else
for (int i = 0; i < intfs.length; i++)
clss[i] = cl.loadClass(intfs[i]);
- try {
- return Proxy.getProxyClass(cl, clss);
- } catch (IllegalArgumentException e) {
- throw new ClassNotFoundException(null, e);
- }
+ try
+ {
+ return Proxy.getProxyClass(cl, clss);
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw new ClassNotFoundException(null, e);
+ }
}
/**
@@ -623,9 +743,9 @@ public class ObjectInputStream extends InputStream
{
if (enable)
{
- SecurityManager sm = System.getSecurityManager ();
+ SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkPermission (new SerializablePermission ("enableSubstitution"));
+ sm.checkPermission(new SerializablePermission("enableSubstitution"));
}
boolean old_val = this.resolveEnabled;
@@ -642,31 +762,31 @@ public class ObjectInputStream extends InputStream
* @exception StreamCorruptedException An invalid stream magic
* number or stream version was read from the stream.
*/
- protected void readStreamHeader ()
+ protected void readStreamHeader()
throws IOException, StreamCorruptedException
{
- dumpElement ("STREAM MAGIC ");
- if (this.realInputStream.readShort () != STREAM_MAGIC)
- throw new StreamCorruptedException ("Invalid stream magic number");
+ dumpElement("STREAM MAGIC ");
+ if (this.realInputStream.readShort() != STREAM_MAGIC)
+ throw new StreamCorruptedException("Invalid stream magic number");
- dumpElementln ("STREAM VERSION ");
- if (this.realInputStream.readShort () != STREAM_VERSION)
- throw new StreamCorruptedException ("Invalid stream version number");
+ dumpElementln("STREAM VERSION ");
+ if (this.realInputStream.readShort() != STREAM_VERSION)
+ throw new StreamCorruptedException("Invalid stream version number");
}
- public int read () throws IOException
+ public int read() throws IOException
{
if (this.readDataFromBlock)
{
if (this.blockDataPosition >= this.blockDataBytes)
- readNextBlock ();
+ readNextBlock();
return (this.blockData[this.blockDataPosition++] & 0xff);
}
else
- return this.realInputStream.read ();
+ return this.realInputStream.read();
}
- public int read (byte[] data, int offset, int length) throws IOException
+ public int read(byte[] data, int offset, int length) throws IOException
{
if (this.readDataFromBlock)
{
@@ -675,25 +795,25 @@ public class ObjectInputStream extends InputStream
int remain = this.blockDataBytes - this.blockDataPosition;
if (remain != 0)
{
- System.arraycopy (this.blockData, this.blockDataPosition,
- data, offset, remain);
+ System.arraycopy(this.blockData, this.blockDataPosition,
+ data, offset, remain);
offset += remain;
length -= remain;
}
readNextBlock ();
}
- System.arraycopy (this.blockData, this.blockDataPosition,
- data, offset, length);
+ System.arraycopy(this.blockData, this.blockDataPosition,
+ data, offset, length);
this.blockDataPosition += length;
return length;
}
else
- return this.realInputStream.read (data, offset, length);
+ return this.realInputStream.read(data, offset, length);
}
- public int available () throws IOException
+ public int available() throws IOException
{
if (this.readDataFromBlock)
{
@@ -703,92 +823,182 @@ public class ObjectInputStream extends InputStream
return this.blockDataBytes - this.blockDataPosition;
}
else
- return this.realInputStream.available ();
+ return this.realInputStream.available();
}
- public void close () throws IOException
+ public void close() throws IOException
{
- this.realInputStream.close ();
+ this.realInputStream.close();
}
- public boolean readBoolean () throws IOException
+ public boolean readBoolean() throws IOException
{
- return this.dataInputStream.readBoolean ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 1)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode (true);
+ boolean value = this.dataInputStream.readBoolean ();
+ if (switchmode)
+ setBlockDataMode (oldmode);
+ return value;
}
- public byte readByte () throws IOException
+ public byte readByte() throws IOException
{
- return this.dataInputStream.readByte ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 1)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ byte value = this.dataInputStream.readByte();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public int readUnsignedByte () throws IOException
+ public int readUnsignedByte() throws IOException
{
- return this.dataInputStream.readUnsignedByte ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 1)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ int value = this.dataInputStream.readUnsignedByte();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public short readShort () throws IOException
+ public short readShort() throws IOException
{
- return this.dataInputStream.readShort ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 2)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ short value = this.dataInputStream.readShort();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public int readUnsignedShort () throws IOException
+ public int readUnsignedShort() throws IOException
{
- return this.dataInputStream.readUnsignedShort ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 2)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ int value = this.dataInputStream.readUnsignedShort();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public char readChar () throws IOException
+ public char readChar() throws IOException
{
- return this.dataInputStream.readChar ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 2)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ char value = this.dataInputStream.readChar();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public int readInt () throws IOException
+ public int readInt() throws IOException
{
- return this.dataInputStream.readInt ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 4)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ int value = this.dataInputStream.readInt();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public long readLong () throws IOException
+ public long readLong() throws IOException
{
- return this.dataInputStream.readLong ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 8)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ long value = this.dataInputStream.readLong();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public float readFloat () throws IOException
+ public float readFloat() throws IOException
{
- return this.dataInputStream.readFloat ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 4)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ float value = this.dataInputStream.readFloat();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public double readDouble () throws IOException
+ public double readDouble() throws IOException
{
- return this.dataInputStream.readDouble ();
+ boolean switchmode = true;
+ boolean oldmode = this.readDataFromBlock;
+ if (!oldmode || this.blockDataBytes - this.blockDataPosition >= 8)
+ switchmode = false;
+ if (switchmode)
+ oldmode = setBlockDataMode(true);
+ double value = this.dataInputStream.readDouble();
+ if (switchmode)
+ setBlockDataMode(oldmode);
+ return value;
}
- public void readFully (byte data[]) throws IOException
+ public void readFully(byte data[]) throws IOException
{
- this.dataInputStream.readFully (data);
+ this.dataInputStream.readFully(data);
}
- public void readFully (byte data[], int offset, int size)
+ public void readFully(byte data[], int offset, int size)
throws IOException
{
- this.dataInputStream.readFully (data, offset, size);
+ this.dataInputStream.readFully(data, offset, size);
}
- public int skipBytes (int len) throws IOException
+ public int skipBytes(int len) throws IOException
{
- return this.dataInputStream.skipBytes (len);
+ return this.dataInputStream.skipBytes(len);
}
/**
* @deprecated
* @see java.io.DataInputStream#readLine ()
*/
- public String readLine () throws IOException
+ public String readLine() throws IOException
{
- return this.dataInputStream.readLine ();
+ return this.dataInputStream.readLine();
}
- public String readUTF () throws IOException
+ public String readUTF() throws IOException
{
- return this.dataInputStream.readUTF ();
+ return this.dataInputStream.readUTF();
}
/**
@@ -799,47 +1009,64 @@ public class ObjectInputStream extends InputStream
*/
public static abstract class GetField
{
- public abstract ObjectStreamClass getObjectStreamClass ();
+ public abstract ObjectStreamClass getObjectStreamClass();
- public abstract boolean defaulted (String name)
+ public abstract boolean defaulted(String name)
throws IOException, IllegalArgumentException;
- public abstract boolean get (String name, boolean defvalue)
+ public abstract boolean get(String name, boolean defvalue)
throws IOException, IllegalArgumentException;
- public abstract char get (String name, char defvalue)
+ public abstract char get(String name, char defvalue)
throws IOException, IllegalArgumentException;
- public abstract byte get (String name, byte defvalue)
+ public abstract byte get(String name, byte defvalue)
throws IOException, IllegalArgumentException;
- public abstract short get (String name, short defvalue)
+ public abstract short get(String name, short defvalue)
throws IOException, IllegalArgumentException;
- public abstract int get (String name, int defvalue)
+ public abstract int get(String name, int defvalue)
throws IOException, IllegalArgumentException;
- public abstract long get (String name, long defvalue)
+ public abstract long get(String name, long defvalue)
throws IOException, IllegalArgumentException;
- public abstract float get (String name, float defvalue)
+ public abstract float get(String name, float defvalue)
throws IOException, IllegalArgumentException;
- public abstract double get (String name, double defvalue)
+ public abstract double get(String name, double defvalue)
throws IOException, IllegalArgumentException;
- public abstract Object get (String name, Object defvalue)
+ public abstract Object get(String name, Object defvalue)
throws IOException, IllegalArgumentException;
}
- public GetField readFields ()
+ /**
+ * This method should be called by a method called 'readObject' in the
+ * deserializing class (if present). It cannot (and should not)be called
+ * outside of it. Its goal is to read all fields in the real input stream
+ * and keep them accessible through the {@link #GetField} class. Calling
+ * this method will not alterate the deserializing object.
+ *
+ * @return A valid freshly created 'GetField' instance to get access to
+ * the deserialized stream.
+ * @throws IOException An input/output exception occured.
+ * @throws ClassNotFoundException
+ * @throws NotActiveException
+ */
+ public GetField readFields()
throws IOException, ClassNotFoundException, NotActiveException
{
if (this.currentObject == null || this.currentObjectStreamClass == null)
- throw new NotActiveException ("readFields called by non-active class and/or object");
+ throw new NotActiveException("readFields called by non-active class and/or object");
+
+ if (prereadFields != null)
+ return prereadFields;
if (fieldsAlreadyRead)
- throw new NotActiveException ("readFields called but fields already read from stream (by defaultReadObject or readFields)");
+ throw new NotActiveException("readFields called but fields already read from"
+ + " stream (by defaultReadObject or readFields)");
final ObjectStreamClass clazz = this.currentObjectStreamClass;
final byte[] prim_field_data = new byte[clazz.primFieldSize];
@@ -848,84 +1075,108 @@ public class ObjectInputStream extends InputStream
// Apparently Block data is not used with GetField as per
// empirical evidence against JDK 1.2. Also see Mauve test
// java.io.ObjectInputOutput.Test.GetPutField.
- boolean oldmode = setBlockDataMode (false);
- readFully (prim_field_data);
+ boolean oldmode = setBlockDataMode(false);
+ readFully(prim_field_data);
for (int i = 0; i < objs.length; ++ i)
- objs[i] = readObject ();
- setBlockDataMode (oldmode);
+ objs[i] = readObject();
+ setBlockDataMode(oldmode);
- return new GetField ()
+ prereadFields = new GetField()
{
- public ObjectStreamClass getObjectStreamClass ()
+ public ObjectStreamClass getObjectStreamClass()
{
return clazz;
}
- public boolean defaulted (String name)
+ public boolean defaulted(String name)
throws IOException, IllegalArgumentException
{
- return clazz.getField (name) == null;
+ ObjectStreamField f = clazz.getField(name);
+
+ /* First if we have a serialized field use the descriptor */
+ if (f != null)
+ {
+ /* It is in serialPersistentFields but setClass tells us
+ * it should not be set. This value is defaulted.
+ */
+ if (f.isPersistent() && !f.isToSet())
+ return true;
+
+ return false;
+ }
+
+ /* This is not a serialized field. There should be
+ * a default value only if the field really exists.
+ */
+ try
+ {
+ return (clazz.forClass().getDeclaredField (name) != null);
+ }
+ catch (NoSuchFieldException e)
+ {
+ throw new IllegalArgumentException(e.getMessage());
+ }
}
- public boolean get (String name, boolean defvalue)
+ public boolean get(String name, boolean defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Boolean.TYPE);
+ ObjectStreamField field = getField(name, Boolean.TYPE);
if (field == null)
return defvalue;
- return prim_field_data[field.getOffset ()] == 0 ? false : true;
+ return prim_field_data[field.getOffset()] == 0 ? false : true;
}
- public char get (String name, char defvalue)
+ public char get(String name, char defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Character.TYPE);
+ ObjectStreamField field = getField(name, Character.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
return (char)(((prim_field_data[off++] & 0xFF) << 8)
| (prim_field_data[off] & 0xFF));
}
- public byte get (String name, byte defvalue)
+ public byte get(String name, byte defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Byte.TYPE);
+ ObjectStreamField field = getField(name, Byte.TYPE);
if (field == null)
return defvalue;
- return prim_field_data[field.getOffset ()];
+ return prim_field_data[field.getOffset()];
}
- public short get (String name, short defvalue)
+ public short get(String name, short defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Short.TYPE);
+ ObjectStreamField field = getField(name, Short.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
return (short)(((prim_field_data[off++] & 0xFF) << 8)
| (prim_field_data[off] & 0xFF));
}
- public int get (String name, int defvalue)
+ public int get(String name, int defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Integer.TYPE);
+ ObjectStreamField field = getField(name, Integer.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
return ((prim_field_data[off++] & 0xFF) << 24)
| ((prim_field_data[off++] & 0xFF) << 16)
@@ -933,15 +1184,15 @@ public class ObjectInputStream extends InputStream
| (prim_field_data[off] & 0xFF);
}
- public long get (String name, long defvalue)
+ public long get(String name, long defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Long.TYPE);
+ ObjectStreamField field = getField(name, Long.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
return (long)(((prim_field_data[off++] & 0xFF) << 56)
| ((prim_field_data[off++] & 0xFF) << 48)
@@ -953,31 +1204,31 @@ public class ObjectInputStream extends InputStream
| (prim_field_data[off] & 0xFF));
}
- public float get (String name, float defvalue)
+ public float get(String name, float defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Float.TYPE);
+ ObjectStreamField field = getField(name, Float.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
- return Float.intBitsToFloat (((prim_field_data[off++] & 0xFF) << 24)
- | ((prim_field_data[off++] & 0xFF) << 16)
- | ((prim_field_data[off++] & 0xFF) << 8)
- | (prim_field_data[off] & 0xFF));
+ return Float.intBitsToFloat(((prim_field_data[off++] & 0xFF) << 24)
+ | ((prim_field_data[off++] & 0xFF) << 16)
+ | ((prim_field_data[off++] & 0xFF) << 8)
+ | (prim_field_data[off] & 0xFF));
}
- public double get (String name, double defvalue)
+ public double get(String name, double defvalue)
throws IOException, IllegalArgumentException
{
- ObjectStreamField field = getField (name, Double.TYPE);
+ ObjectStreamField field = getField(name, Double.TYPE);
if (field == null)
return defvalue;
- int off = field.getOffset ();
+ int off = field.getOffset();
return Double.longBitsToDouble
( (long) (((prim_field_data[off++] & 0xFF) << 56)
@@ -990,40 +1241,92 @@ public class ObjectInputStream extends InputStream
| (prim_field_data[off] & 0xFF)));
}
- public Object get (String name, Object defvalue)
+ public Object get(String name, Object defvalue)
throws IOException, IllegalArgumentException
{
ObjectStreamField field =
- getField (name, defvalue == null ? null : defvalue.getClass ());
+ getField(name, defvalue == null ? null : defvalue.getClass ());
if (field == null)
return defvalue;
- return objs[field.getOffset ()];
+ return objs[field.getOffset()];
}
- private ObjectStreamField getField (String name, Class type)
+ private ObjectStreamField getField(String name, Class type)
throws IllegalArgumentException
{
- ObjectStreamField field = clazz.getField (name);
-
- if (field == null)
- return null;
+ ObjectStreamField field = clazz.getField(name);
+ boolean illegal = false;
- Class field_type = field.getType ();
-
- if (type == field_type ||
- (type == null && ! field_type.isPrimitive ()))
- return field;
-
- throw new IllegalArgumentException ("Field requested is of type "
- + field_type.getName ()
- + ", but requested type was "
- + (type == null ?
- "Object" : type.getName ()));
+ try
+ {
+ try
+ {
+ Class field_type = field.getType();
+
+ if (type == field_type ||
+ (type == null && !field_type.isPrimitive()))
+ {
+ /* See defaulted */
+ return field;
+ }
+
+ illegal = true;
+ throw new IllegalArgumentException
+ ("Field requested is of type "
+ + field_type.getName()
+ + ", but requested type was "
+ + (type == null ? "Object" : type.getName()));
+ }
+ catch (NullPointerException _)
+ {
+ /* Here we catch NullPointerException, because it may
+ only come from the call 'field.getType()'. If field
+ is null, we have to return null and classpath ethic
+ say we must try to avoid 'if (xxx == null)'.
+ */
+ }
+ catch (IllegalArgumentException e)
+ {
+ throw e;
+ }
+
+ return null;
+ }
+ finally
+ {
+ /* If this is an unassigned field we should return
+ * the default value.
+ */
+ if (!illegal && field != null && !field.isToSet() && field.isPersistent())
+ return null;
+
+ /* We do not want to modify transient fields. They should
+ * be left to 0.
+ */
+ try
+ {
+ Field f = clazz.forClass().getDeclaredField(name);
+ if (Modifier.isTransient(f.getModifiers()))
+ throw new IllegalArgumentException
+ ("no such field (non transient) " + name);
+ if (field == null && f.getType() != type)
+ throw new IllegalArgumentException
+ ("Invalid requested type for field " + name);
+ }
+ catch (NoSuchFieldException e)
+ {
+ if (field == null)
+ throw new IllegalArgumentException(e.getMessage());
+ }
+
+ }
}
};
+ fieldsAlreadyRead = true;
+ return prereadFields;
}
/**
@@ -1037,12 +1340,12 @@ public class ObjectInputStream extends InputStream
*
* @see #readObjectOverride()
*/
- protected ObjectInputStream ()
+ protected ObjectInputStream()
throws IOException, SecurityException
{
- SecurityManager sec_man = System.getSecurityManager ();
+ SecurityManager sec_man = System.getSecurityManager();
if (sec_man != null)
- sec_man.checkPermission (SUBCLASS_IMPLEMENTATION_PERMISSION);
+ sec_man.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
this.useSubclassMethod = true;
}
@@ -1055,21 +1358,26 @@ public class ObjectInputStream extends InputStream
*
* @see #ObjectInputStream()
*/
- protected Object readObjectOverride ()
+ protected Object readObjectOverride()
throws ClassNotFoundException, IOException, OptionalDataException
{
- throw new IOException ("Subclass of ObjectInputStream must implement readObjectOverride");
+ throw new IOException("Subclass of ObjectInputStream must implement readObjectOverride");
}
- // assigns the next availible handle to OBJ
- private int assignNewHandle (Object obj)
+ /**
+ * Assigns the next available handle to <code>obj</code>.
+ *
+ * @param obj The object for which we want a new handle.
+ * @return A valid handle for the specified object.
+ */
+ private int assignNewHandle(Object obj)
{
- this.objectLookupTable.put (new Integer (this.nextOID),
- new ObjectIdentityWrapper (obj));
+ this.objectLookupTable.put(new Integer(this.nextOID),
+ new ObjectIdentityWrapper(obj));
return this.nextOID++;
}
- private Object processResolution (Object obj, int handle)
+ private Object processResolution(Object obj, int handle)
throws IOException
{
if (obj instanceof Serializable)
@@ -1079,7 +1387,7 @@ public class ObjectInputStream extends InputStream
{
Class classArgs[] = {};
m = getMethod(obj.getClass(), "readResolve", classArgs);
- obj = m.invoke (obj, new Object[] {});
+ obj = m.invoke(obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
{
@@ -1093,42 +1401,42 @@ public class ObjectInputStream extends InputStream
}
if (this.resolveEnabled)
- obj = resolveObject (obj);
+ obj = resolveObject(obj);
- this.objectLookupTable.put (new Integer (handle),
- new ObjectIdentityWrapper (obj));
+ this.objectLookupTable.put(new Integer(handle),
+ new ObjectIdentityWrapper(obj));
return obj;
}
- private void clearHandles ()
+ private void clearHandles()
{
- this.objectLookupTable.clear ();
+ this.objectLookupTable.clear();
this.nextOID = baseWireHandle;
}
- private void readNextBlock () throws IOException
+ private void readNextBlock() throws IOException
{
- readNextBlock (this.realInputStream.readByte ());
+ readNextBlock(this.realInputStream.readByte());
}
- private void readNextBlock (byte marker) throws IOException
+ private void readNextBlock(byte marker) throws IOException
{
if (marker == TC_BLOCKDATA)
{
- dumpElement ("BLOCK DATA SIZE=");
- this.blockDataBytes = this.realInputStream.readUnsignedByte ();
+ dumpElement("BLOCK DATA SIZE=");
+ this.blockDataBytes = this.realInputStream.readUnsignedByte();
dumpElementln (Integer.toString(this.blockDataBytes));
}
else if (marker == TC_BLOCKDATALONG)
{
- dumpElement ("BLOCK DATA LONG SIZE=");
- this.blockDataBytes = this.realInputStream.readInt ();
+ dumpElement("BLOCK DATA LONG SIZE=");
+ this.blockDataBytes = this.realInputStream.readInt();
dumpElementln (Integer.toString(this.blockDataBytes));
}
else
{
- throw new EOFException ("Attempt to read primitive data, but no data block is active.");
+ throw new EOFException("Attempt to read primitive data, but no data block is active.");
}
if (this.blockData.length < this.blockDataBytes)
@@ -1141,62 +1449,62 @@ public class ObjectInputStream extends InputStream
private void readArrayElements (Object array, Class clazz)
throws ClassNotFoundException, IOException
{
- if (clazz.isPrimitive ())
+ if (clazz.isPrimitive())
{
if (clazz == Boolean.TYPE)
{
boolean[] cast_array = (boolean[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readBoolean ();
+ cast_array[i] = this.realInputStream.readBoolean();
return;
}
if (clazz == Byte.TYPE)
{
byte[] cast_array = (byte[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readByte ();
+ cast_array[i] = this.realInputStream.readByte();
return;
}
if (clazz == Character.TYPE)
{
char[] cast_array = (char[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readChar ();
+ cast_array[i] = this.realInputStream.readChar();
return;
}
if (clazz == Double.TYPE)
{
double[] cast_array = (double[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readDouble ();
+ cast_array[i] = this.realInputStream.readDouble();
return;
}
if (clazz == Float.TYPE)
{
float[] cast_array = (float[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readFloat ();
+ cast_array[i] = this.realInputStream.readFloat();
return;
}
if (clazz == Integer.TYPE)
{
int[] cast_array = (int[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readInt ();
+ cast_array[i] = this.realInputStream.readInt();
return;
}
if (clazz == Long.TYPE)
{
long[] cast_array = (long[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readLong ();
+ cast_array[i] = this.realInputStream.readLong();
return;
}
if (clazz == Short.TYPE)
{
short[] cast_array = (short[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = this.realInputStream.readShort ();
+ cast_array[i] = this.realInputStream.readShort();
return;
}
}
@@ -1204,7 +1512,7 @@ public class ObjectInputStream extends InputStream
{
Object[] cast_array = (Object[])array;
for (int i=0; i < cast_array.length; i++)
- cast_array[i] = readObject ();
+ cast_array[i] = readObject();
}
}
@@ -1213,7 +1521,7 @@ public class ObjectInputStream extends InputStream
{
ObjectStreamField[] stream_fields = stream_osc.fields;
ObjectStreamField[] real_fields =
- ObjectStreamClass.lookup (stream_osc.forClass ()).fields;
+ lookupClass(stream_osc.forClass()).fields;
boolean default_initialize, set_value;
String field_name = null;
@@ -1234,7 +1542,7 @@ public class ObjectInputStream extends InputStream
else
{
stream_field = stream_fields[stream_idx];
- type = stream_field.getType ();
+ type = stream_field.getType();
}
if (real_idx == real_fields.length)
@@ -1242,8 +1550,8 @@ public class ObjectInputStream extends InputStream
else
{
real_field = real_fields[real_idx];
- type = real_field.getType ();
- field_name = real_field.getName ();
+ type = real_field.getType();
+ field_name = real_field.getName();
}
if (set_value && !default_initialize)
@@ -1268,87 +1576,96 @@ public class ObjectInputStream extends InputStream
}
}
+ if (stream_field.getOffset() < 0)
+ {
+ default_initialize = true;
+ set_value = false;
+ }
+
+ if (!stream_field.isToSet())
+ set_value = false;
+
try
{
if (type == Boolean.TYPE)
{
boolean value =
- default_initialize ? false : this.realInputStream.readBoolean ();
+ default_initialize ? false : this.realInputStream.readBoolean();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setBooleanField (obj, stream_osc.forClass (), field_name, value);
+ setBooleanField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Byte.TYPE)
{
byte value =
- default_initialize ? 0 : this.realInputStream.readByte ();
+ default_initialize ? 0 : this.realInputStream.readByte();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setByteField (obj, stream_osc.forClass (), field_name, value);
+ setByteField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Character.TYPE)
{
char value =
- default_initialize ? (char)0 : this.realInputStream.readChar ();
+ default_initialize ? (char)0 : this.realInputStream.readChar();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setCharField (obj, stream_osc.forClass (), field_name, value);
+ setCharField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Double.TYPE)
{
double value =
- default_initialize ? 0 : this.realInputStream.readDouble ();
+ default_initialize ? 0 : this.realInputStream.readDouble();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setDoubleField (obj, stream_osc.forClass (), field_name, value);
+ setDoubleField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Float.TYPE)
{
float value =
- default_initialize ? 0 : this.realInputStream.readFloat ();
+ default_initialize ? 0 : this.realInputStream.readFloat();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setFloatField (obj, stream_osc.forClass (), field_name, value);
+ setFloatField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Integer.TYPE)
{
int value =
- default_initialize ? 0 : this.realInputStream.readInt ();
+ default_initialize ? 0 : this.realInputStream.readInt();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setIntField (obj, stream_osc.forClass (), field_name, value);
+ setIntField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Long.TYPE)
{
long value =
- default_initialize ? 0 : this.realInputStream.readLong ();
+ default_initialize ? 0 : this.realInputStream.readLong();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setLongField (obj, stream_osc.forClass (), field_name, value);
+ setLongField(obj, stream_osc.forClass(), field_name, value);
}
else if (type == Short.TYPE)
{
short value =
- default_initialize ? (short)0 : this.realInputStream.readShort ();
+ default_initialize ? (short)0 : this.realInputStream.readShort();
if (!default_initialize && set_value)
- dumpElementln (" " + field_name + ": " + value);
+ dumpElementln(" " + field_name + ": " + value);
if (set_value)
- setShortField (obj, stream_osc.forClass (), field_name, value);
+ setShortField(obj, stream_osc.forClass(), field_name, value);
}
else
{
Object value =
- default_initialize ? null : readObject ();
+ default_initialize ? null : readObject();
if (set_value)
- setObjectField (obj, stream_osc.forClass (), field_name,
- real_field.getTypeString (), value);
+ setObjectField(obj, stream_osc.forClass(), field_name,
+ real_field.getTypeString(), value);
}
}
catch (NoSuchFieldError e)
@@ -1389,35 +1706,54 @@ public class ObjectInputStream extends InputStream
// runs all registered ObjectInputValidations in prioritized order
// on OBJ
- private void invokeValidators () throws InvalidObjectException
+ private void invokeValidators() throws InvalidObjectException
{
- Object[] validators = new Object[this.validators.size ()];
+ Object[] validators = new Object[this.validators.size()];
this.validators.copyInto (validators);
Arrays.sort (validators);
try
{
for (int i=0; i < validators.length; i++)
- ((ObjectInputValidation)validators[i]).validateObject ();
+ ((ObjectInputValidation)validators[i]).validateObject();
}
finally
{
- this.validators.removeAllElements ();
+ this.validators.removeAllElements();
}
}
- // this native method is used to get access to the protected method
- // of the same name in SecurityManger
+ /**
+ * This native method is used to get access to the protected method
+ * of the same name in SecurityManger.
+ *
+ * @param sm SecurityManager instance which should be called.
+ * @return The current class loader in the calling stack.
+ */
private static ClassLoader currentClassLoader (SecurityManager sm)
{
// FIXME: This is too simple.
return ClassLoader.getSystemClassLoader ();
}
- private static Field getField (Class klass, String name)
+ /**
+ * This method tries to access a precise field called in the
+ * specified class. Before accessing the field, it tries to
+ * gain control on this field. If the field is either declared as
+ * not persistent or transient then it returns null
+ * immediately.
+ *
+ * @param klass Class to get the field from.
+ * @param name Name of the field to access.
+ * @return Field instance representing the requested field.
+ * @throws NoSuchFieldException if the field does not exist.
+ */
+ private Field getField(Class klass, String name)
throws java.lang.NoSuchFieldException
{
final Field f = klass.getDeclaredField(name);
+ ObjectStreamField sf = lookupClass(klass).getField(name);
+
AccessController.doPrivileged(new PrivilegedAction()
{
public Object run()
@@ -1426,6 +1762,14 @@ public class ObjectInputStream extends InputStream
return null;
}
});
+
+ /* We do not want to modify transient fields. They should
+ * be left to 0.
+ * N.B.: Not valid if the field is in serialPersistentFields.
+ */
+ if (Modifier.isTransient(f.getModifiers()) && !sf.isPersistent())
+ return null;
+
return f;
}
@@ -1452,7 +1796,7 @@ public class ObjectInputStream extends InputStream
Class classArgs[] = {ObjectInputStream.class};
Method m = getMethod (klass, "readObject", classArgs);
Object args[] = {this};
- m.invoke (obj, args);
+ m.invoke(obj, args);
}
catch (NoSuchMethodException nsme)
{
@@ -1467,14 +1811,17 @@ public class ObjectInputStream extends InputStream
if (exception instanceof IOException)
throw (IOException) exception;
- throw new IOException ("Exception thrown from readObject() on " +
+ throw new IOException("Exception thrown from readObject() on " +
klass + ": " + exception.getClass().getName());
}
catch (Exception x)
{
- throw new IOException ("Failure invoking readObject() on " +
+ throw new IOException("Failure invoking readObject() on " +
klass + ": " + x.getClass().getName());
}
+
+ // Invalidate fields which has been read through readFields.
+ prereadFields = null;
}
private native Object allocateObject (Class clazz)
@@ -1482,125 +1829,261 @@ public class ObjectInputStream extends InputStream
private native void callConstructor (Class clazz, Object obj);
- private void setBooleanField (Object obj, Class klass, String field_name,
- boolean val)
+ /**
+ * This method writes a "boolean" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The boolean value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setBooleanField(Object obj, Class klass, String field_name,
+ boolean val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setBoolean (obj, val);
+ Field f = getField(klass, field_name);
+ f.setBoolean(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
- private void setByteField (Object obj, Class klass, String field_name,
- byte val)
+ /**
+ * This method writes a "byte" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The byte value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setByteField(Object obj, Class klass, String field_name,
+ byte val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setByte (obj, val);
+ Field f = getField(klass, field_name);
+ f.setByte(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
- private void setCharField (Object obj, Class klass, String field_name,
- char val)
+ /**
+ * This method writes a "character" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The character value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setCharField(Object obj, Class klass, String field_name,
+ char val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setChar (obj, val);
+ Field f = getField(klass, field_name);
+ f.setChar(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
- private void setDoubleField (Object obj, Class klass, String field_name,
- double val)
+ /**
+ * This method writes a "double" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The double value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setDoubleField(Object obj, Class klass, String field_name,
+ double val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setDouble (obj, val);
+ Field f = getField(klass, field_name);
+ f.setDouble(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
- private void setFloatField (Object obj, Class klass, String field_name,
- float val)
+ /**
+ * This method writes a "float" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The float value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setFloatField(Object obj, Class klass, String field_name,
+ float val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setFloat (obj, val);
+ Field f = getField(klass, field_name);
+ f.setFloat(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
- private void setIntField (Object obj, Class klass, String field_name,
- int val)
+ /**
+ * This method writes an "integer" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The integer value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setIntField(Object obj, Class klass, String field_name,
+ int val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setInt (obj, val);
+ Field f = getField(klass, field_name);
+ f.setInt(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
-
- private void setLongField (Object obj, Class klass, String field_name,
- long val)
+ /**
+ * This method writes the long value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The long value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setLongField(Object obj, Class klass, String field_name,
+ long val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setLong (obj, val);
+ Field f = getField(klass, field_name);
+ f.setLong(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
-
- private void setShortField (Object obj, Class klass, String field_name,
- short val)
+ /**
+ * This method writes a "short" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The short value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setShortField(Object obj, Class klass, String field_name,
+ short val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- f.setShort (obj, val);
+ Field f = getField(klass, field_name);
+ f.setShort(obj, val);
+ }
+ catch (IllegalArgumentException _)
+ {
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
}
catch (Exception _)
{
}
}
-
- private void setObjectField (Object obj, Class klass, String field_name,
- String type_code, Object val)
+ /**
+ * This method writes an "object" value <code>val</code> in the specified field
+ * of the instance <code>obj</code> of the type <code>klass</code>.
+ *
+ * @param obj Instance to setup.
+ * @param klass Class type of the specified instance.
+ * @param field_name Name of the field in the specified class type.
+ * @param val The "object" value to write into the field.
+ * @throws InvalidClassException if the specified field has not the required type.
+ * @throws IOException if there is no field of that name in the specified class.
+ */
+ private void setObjectField(Object obj, Class klass, String field_name,
+ String type_code, Object val) throws IOException, InvalidClassException
{
try
{
- Field f = getField (klass, field_name);
- // FIXME: We should check the type_code here
- f.set (obj, val);
+ Field f = getField(klass, field_name);
+ ObjectStreamField of = new ObjectStreamField(field_name, f.getType());
+
+ if (of.getTypeString() == null ||
+ !of.getTypeString().equals(type_code))
+ throw new InvalidClassException("incompatible field type for " + klass.getName() + "." + field_name);
+ f.set(obj, val);
+ }
+ catch (InvalidClassException e)
+ {
+ throw e;
}
catch (Exception _)
{
- }
+ }
}
private static final int BUFFER_SIZE = 1024;
@@ -1622,6 +2105,8 @@ public class ObjectInputStream extends InputStream
private boolean isDeserializing;
private boolean fieldsAlreadyRead;
private Vector validators;
+ private Hashtable classLookupTable;
+ private GetField prereadFields;
private static boolean dump;
diff --git a/libjava/java/io/ObjectOutputStream.java b/libjava/java/io/ObjectOutputStream.java
index f79ac3e4d8a..8f991f0baa1 100644
--- a/libjava/java/io/ObjectOutputStream.java
+++ b/libjava/java/io/ObjectOutputStream.java
@@ -132,18 +132,18 @@ public class ObjectOutputStream extends OutputStream
*/
public ObjectOutputStream (OutputStream out) throws IOException
{
- realOutput = new DataOutputStream (out);
+ realOutput = new DataOutputStream(out);
blockData = new byte[ BUFFER_SIZE ];
blockDataCount = 0;
- blockDataOutput = new DataOutputStream (this);
- setBlockDataMode (true);
+ blockDataOutput = new DataOutputStream(this);
+ setBlockDataMode(true);
replacementEnabled = false;
isSerializing = false;
nextOID = baseWireHandle;
- OIDLookupTable = new Hashtable ();
+ OIDLookupTable = new Hashtable();
protocolVersion = defaultProtocolVersion;
useSubclassMethod = false;
- writeStreamHeader ();
+ writeStreamHeader();
}
/**
@@ -165,16 +165,16 @@ public class ObjectOutputStream extends OutputStream
* @exception IOException Exception from underlying
* <code>OutputStream</code>.
*/
- public final void writeObject (Object obj) throws IOException
+ public final void writeObject(Object obj) throws IOException
{
if (useSubclassMethod)
{
- writeObjectOverride (obj);
+ writeObjectOverride(obj);
return;
}
boolean was_serializing = isSerializing;
- boolean old_mode = setBlockDataMode (false);
+ boolean old_mode = setBlockDataMode(false);
try
{
isSerializing = true;
@@ -185,49 +185,49 @@ public class ObjectOutputStream extends OutputStream
{
if (obj == null)
{
- realOutput.writeByte (TC_NULL);
+ realOutput.writeByte(TC_NULL);
break;
}
- Integer handle = findHandle (obj);
+ Integer handle = findHandle(obj);
if (handle != null)
{
- realOutput.writeByte (TC_REFERENCE);
- realOutput.writeInt (handle.intValue ());
+ realOutput.writeByte(TC_REFERENCE);
+ realOutput.writeInt(handle.intValue());
break;
}
if (obj instanceof Class)
{
Class cl = (Class)obj;
- ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject (cl);
- assignNewHandle (obj);
- realOutput.writeByte (TC_CLASS);
+ ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(cl);
+ assignNewHandle(obj);
+ realOutput.writeByte(TC_CLASS);
if (!osc.isProxyClass)
{
writeObject (osc);
}
else
{
- realOutput.writeByte (TC_PROXYCLASSDESC);
+ realOutput.writeByte(TC_PROXYCLASSDESC);
Class[] intfs = cl.getInterfaces();
realOutput.writeInt(intfs.length);
for (int i = 0; i < intfs.length; i++)
realOutput.writeUTF(intfs[i].getName());
- boolean oldmode = setBlockDataMode (true);
+ boolean oldmode = setBlockDataMode(true);
annotateProxyClass(cl);
- setBlockDataMode (oldmode);
+ setBlockDataMode(oldmode);
realOutput.writeByte(TC_ENDBLOCKDATA);
- writeObject (osc.getSuper());
+ writeObject(osc.getSuper());
}
break;
}
if (obj instanceof ObjectStreamClass)
{
- writeClassDescriptor ((ObjectStreamClass) obj);
+ writeClassDescriptor((ObjectStreamClass) obj);
break;
}
@@ -235,7 +235,7 @@ public class ObjectOutputStream extends OutputStream
&& ! replaceDone)
{
replacedObject = obj;
-
+
if (obj instanceof Serializable)
{
Method m = null;
@@ -247,7 +247,7 @@ public class ObjectOutputStream extends OutputStream
// m can't be null by definition since an
// exception would have been thrown so a check
// for null is not needed.
- obj = m.invoke (obj, new Object[] {});
+ obj = m.invoke(obj, new Object[] {});
}
catch (NoSuchMethodException ignore)
{
@@ -259,55 +259,55 @@ public class ObjectOutputStream extends OutputStream
{
}
}
-
+
if (replacementEnabled)
- obj = replaceObject (obj);
-
+ obj = replaceObject(obj);
+
replaceDone = true;
continue;
}
if (obj instanceof String)
{
- realOutput.writeByte (TC_STRING);
- assignNewHandle (obj);
- realOutput.writeUTF ((String)obj);
+ realOutput.writeByte(TC_STRING);
+ assignNewHandle(obj);
+ realOutput.writeUTF((String)obj);
break;
}
- Class clazz = obj.getClass ();
- ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject (clazz);
+ Class clazz = obj.getClass();
+ ObjectStreamClass osc = ObjectStreamClass.lookupForClassObject(clazz);
if (osc == null)
- throw new NotSerializableException (clazz.getName ());
-
+ throw new NotSerializableException(clazz.getName());
+
if (clazz.isArray ())
{
- realOutput.writeByte (TC_ARRAY);
- writeObject (osc);
- assignNewHandle (obj);
- writeArraySizeAndElements (obj, clazz.getComponentType ());
+ realOutput.writeByte(TC_ARRAY);
+ writeObject(osc);
+ assignNewHandle(obj);
+ writeArraySizeAndElements(obj, clazz.getComponentType());
break;
}
-
- realOutput.writeByte (TC_OBJECT);
- writeObject (osc);
+
+ realOutput.writeByte(TC_OBJECT);
+ writeObject(osc);
if (replaceDone)
- assignNewHandle (replacedObject);
+ assignNewHandle(replacedObject);
else
- assignNewHandle (obj);
+ assignNewHandle(obj);
if (obj instanceof Externalizable)
{
if (protocolVersion == PROTOCOL_VERSION_2)
- setBlockDataMode (true);
-
- ((Externalizable)obj).writeExternal (this);
-
+ setBlockDataMode(true);
+
+ ((Externalizable)obj).writeExternal(this);
+
if (protocolVersion == PROTOCOL_VERSION_2)
{
- setBlockDataMode (false);
- realOutput.writeByte (TC_ENDBLOCKDATA);
+ setBlockDataMode(false);
+ realOutput.writeByte(TC_ENDBLOCKDATA);
}
break;
@@ -317,22 +317,22 @@ public class ObjectOutputStream extends OutputStream
{
currentObject = obj;
ObjectStreamClass[] hierarchy =
- ObjectStreamClass.getObjectStreamClasses (clazz);
-
- for (int i=0; i < hierarchy.length; i++)
+ ObjectStreamClass.getObjectStreamClasses(clazz);
+
+ for (int i = 0; i < hierarchy.length; i++)
{
currentObjectStreamClass = hierarchy[i];
-
+
fieldsAlreadyWritten = false;
- if (currentObjectStreamClass.hasWriteMethod ())
+ if (currentObjectStreamClass.hasWriteMethod())
{
- setBlockDataMode (true);
- callWriteMethod (obj, currentObjectStreamClass);
- setBlockDataMode (false);
- realOutput.writeByte (TC_ENDBLOCKDATA);
+ setBlockDataMode(true);
+ callWriteMethod(obj, currentObjectStreamClass);
+ setBlockDataMode(false);
+ realOutput.writeByte(TC_ENDBLOCKDATA);
}
else
- writeFields (obj, currentObjectStreamClass);
+ writeFields(obj, currentObjectStreamClass);
}
currentObject = null;
@@ -341,7 +341,7 @@ public class ObjectOutputStream extends OutputStream
break;
}
- throw new NotSerializableException (clazz.getName ());
+ throw new NotSerializableException(clazz.getName ());
} // end pseudo-loop
}
catch (ObjectStreamException ose)
@@ -351,242 +351,247 @@ public class ObjectOutputStream extends OutputStream
}
catch (IOException e)
{
- realOutput.writeByte (TC_EXCEPTION);
- reset (true);
+ realOutput.writeByte(TC_EXCEPTION);
+ reset(true);
- setBlockDataMode (false);
+ setBlockDataMode(false);
try
{
- writeObject (e);
+ writeObject(e);
}
catch (IOException ioe)
{
- throw new StreamCorruptedException ("Exception " + ioe + " thrown while exception ("+e+") was being written to stream.");
+ throw new StreamCorruptedException
+ ("Exception " + ioe + " thrown while exception was being written to stream.");
}
reset (true);
+
}
finally
{
isSerializing = was_serializing;
- setBlockDataMode (old_mode);
+ setBlockDataMode(old_mode);
}
}
- protected void writeClassDescriptor (ObjectStreamClass osc) throws IOException
+ protected void writeClassDescriptor(ObjectStreamClass osc) throws IOException
{
- realOutput.writeByte (TC_CLASSDESC);
- realOutput.writeUTF (osc.getName ());
- realOutput.writeLong (osc.getSerialVersionUID ());
- assignNewHandle (osc);
+ realOutput.writeByte(TC_CLASSDESC);
+ realOutput.writeUTF(osc.getName());
+ realOutput.writeLong(osc.getSerialVersionUID());
+ assignNewHandle(osc);
- int flags = osc.getFlags ();
+ int flags = osc.getFlags();
if (protocolVersion == PROTOCOL_VERSION_2
- && osc.isExternalizable ())
+ && osc.isExternalizable())
flags |= SC_BLOCK_DATA;
- realOutput.writeByte (flags);
+ realOutput.writeByte(flags);
ObjectStreamField[] fields = osc.fields;
- realOutput.writeShort (fields.length);
+ realOutput.writeShort(fields.length);
ObjectStreamField field;
- for (int i=0; i < fields.length; i++)
+ for (int i = 0; i < fields.length; i++)
{
field = fields[i];
- realOutput.writeByte (field.getTypeCode ());
- realOutput.writeUTF (field.getName ());
+ realOutput.writeByte(field.getTypeCode ());
+ realOutput.writeUTF(field.getName ());
- if (! field.isPrimitive ())
- writeObject (field.getTypeString ());
+ if (! field.isPrimitive())
+ writeObject(field.getTypeString());
}
- boolean oldmode = setBlockDataMode (true);
- annotateClass (osc.forClass ());
- setBlockDataMode (oldmode);
- realOutput.writeByte (TC_ENDBLOCKDATA);
+ boolean oldmode = setBlockDataMode(true);
+ annotateClass(osc.forClass());
+ setBlockDataMode(oldmode);
+ realOutput.writeByte(TC_ENDBLOCKDATA);
- if (osc.isSerializable ())
- writeObject (osc.getSuper ());
+ if (osc.isSerializable() || osc.isExternalizable())
+ writeObject(osc.getSuper());
else
- writeObject (null);
+ writeObject(null);
}
/**
- 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)</code>
- method.
-
- @exception NotActiveException This method was called from a
- context other than from the current object's and current class's
- <code>private void writeObject (ObjectOutputStream)</code>
- method.
-
- @exception IOException Exception from underlying
- <code>OutputStream</code>.
- */
- public void defaultWriteObject ()
+ * 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)</code>
+ * method.
+ *
+ * @exception NotActiveException This method was called from a
+ * context other than from the current object's and current class's
+ * <code>private void writeObject (ObjectOutputStream)</code>
+ * method.
+ *
+ * @exception IOException Exception from underlying
+ * <code>OutputStream</code>.
+ */
+ public void defaultWriteObject()
throws IOException, NotActiveException
{
- markFieldsWritten ();
- writeFields (currentObject, currentObjectStreamClass);
+ markFieldsWritten();
+ writeFields(currentObject, currentObjectStreamClass);
}
- private void markFieldsWritten () throws IOException
+ private void markFieldsWritten() throws IOException
{
if (currentObject == null || currentObjectStreamClass == null)
- throw new NotActiveException ("defaultWriteObject called by non-active class and/or object");
+ throw new NotActiveException
+ ("defaultWriteObject called by non-active class and/or object");
if (fieldsAlreadyWritten)
- throw new IOException ("Only one of writeFields and defaultWriteObject may be called, and it may only be called once");
+ throw new IOException
+ ("Only one of putFields and defaultWriteObject may be called, and it may only be called once");
fieldsAlreadyWritten = true;
}
-
/**
- 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.
-
- @exception IOException Exception from underlying
- <code>OutputStream</code> or reset called while serialization is
- in progress.
- */
- 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.
+ *
+ * @exception IOException Exception from underlying
+ * <code>OutputStream</code> or reset called while serialization is
+ * in progress.
+ */
+ public void reset() throws IOException
{
- reset (false);
+ reset(false);
}
- private void reset (boolean internal) throws IOException
+ private void reset(boolean internal) throws IOException
{
if (!internal)
{
if (isSerializing)
- throw new IOException ("Reset called while serialization in progress");
+ throw new IOException("Reset called while serialization in progress");
- realOutput.writeByte (TC_RESET);
+ realOutput.writeByte(TC_RESET);
}
-
- clearHandles ();
+
+ clearHandles();
}
/**
- Informs this <code>ObjectOutputStream</code> to write data
- according to the specified protocol. There are currently two
- different protocols, specified by <code>PROTOCOL_VERSION_1</code>
- and <code>PROTOCOL_VERSION_2</code>. This implementation writes
- data using <code>PROTOCOL_VERSION_2</code> by default, as is done
- by the JDK 1.2.
-
- A non-portable method, <code>setDefaultProtocolVersion (int
- version)</code> is provided to change the default protocol
- version.
-
- For an explination of the differences beween the two protocols
- see XXX: the Java ObjectSerialization Specification.
-
- @exception IOException if <code>version</code> is not a valid
- protocol
-
- @see #setDefaultProtocolVersion(int)
- */
- public void useProtocolVersion (int version) throws IOException
+ * Informs this <code>ObjectOutputStream</code> to write data
+ * according to the specified protocol. There are currently two
+ * different protocols, specified by <code>PROTOCOL_VERSION_1</code>
+ * and <code>PROTOCOL_VERSION_2</code>. This implementation writes
+ * data using <code>PROTOCOL_VERSION_2</code> by default, as is done
+ * by the JDK 1.2.
+ *
+ * A non-portable method, <code>setDefaultProtocolVersion (int
+ * version)</code> is provided to change the default protocol
+ * version.
+ *
+ * For an explination of the differences beween the two protocols
+ * see XXX: the Java ObjectSerialization Specification.
+ *
+ * @exception IOException if <code>version</code> is not a valid
+ * protocol
+ *
+ * @see #setDefaultProtocolVersion(int)
+ */
+ public void useProtocolVersion(int version) throws IOException
{
if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2)
- throw new IOException ("Invalid protocol version requested.");
-
+ throw new IOException("Invalid protocol version requested.");
+
protocolVersion = version;
}
/**
- <em>GNU $classpath specific</em>
-
- Changes the default stream protocol used by all
- <code>ObjectOutputStream</code>s. There are currently two
- different protocols, specified by <code>PROTOCOL_VERSION_1</code>
- and <code>PROTOCOL_VERSION_2</code>. The default default is
- <code>PROTOCOL_VERSION_1</code>.
-
- @exception IOException if <code>version</code> is not a valid
- protocol
-
- @see #useProtocolVersion(int)
- */
- public static void setDefaultProtocolVersion (int version)
+ * <em>GNU $classpath specific</em>
+ *
+ * Changes the default stream protocol used by all
+ * <code>ObjectOutputStream</code>s. There are currently two
+ * different protocols, specified by <code>PROTOCOL_VERSION_1</code>
+ * and <code>PROTOCOL_VERSION_2</code>. The default default is
+ * <code>PROTOCOL_VERSION_1</code>.
+ *
+ * @exception IOException if <code>version</code> is not a valid
+ * protocol
+ *
+ * @see #useProtocolVersion(int)
+ */
+ public static void setDefaultProtocolVersion(int version)
throws IOException
{
if (version != PROTOCOL_VERSION_1 && version != PROTOCOL_VERSION_2)
- throw new IOException ("Invalid protocol version requested.");
+ throw new IOException("Invalid protocol version requested.");
defaultProtocolVersion = version;
}
/**
- 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.
-
- @exception IOException Exception from underlying
- <code>OutputStream</code>.
-
- @see ObjectInputStream#resolveClass(java.io.ObjectStreamClass)
- */
- protected void annotateClass (Class 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.
+ *
+ * @exception IOException Exception from underlying
+ * <code>OutputStream</code>.
+ *
+ * @see ObjectInputStream#resolveClass(java.io.ObjectStreamClass)
+ */
+ protected void annotateClass(Class cl) throws IOException
+ {
+ }
protected void annotateProxyClass(Class cl) 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.
-
- @exception IOException Exception from underlying
- <code>OutputStream</code>.
-
- @see #enableReplaceObject(boolean)
- */
- protected Object replaceObject (Object 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.
+ *
+ * @exception IOException Exception from underlying
+ * <code>OutputStream</code>.
+ *
+ * @see #enableReplaceObject(boolean)
+ */
+ protected Object replaceObject(Object obj) throws IOException
{
return obj;
}
/**
- If <code>enable</code> is <code>true</code> and this object is
- trusted, then <code>replaceObject (Object)</code> will be called
- in subsequent calls to <code>writeObject (Object)</code>.
- Otherwise, <code>replaceObject (Object)</code> will not be called.
-
- @exception SecurityException This class is not trusted.
- */
- protected boolean enableReplaceObject (boolean enable)
+ * If <code>enable</code> is <code>true</code> and this object is
+ * trusted, then <code>replaceObject (Object)</code> will be called
+ * in subsequent calls to <code>writeObject (Object)</code>.
+ * Otherwise, <code>replaceObject (Object)</code> will not be called.
+ *
+ * @exception SecurityException This class is not trusted.
+ */
+ protected boolean enableReplaceObject(boolean enable)
throws SecurityException
{
if (enable)
{
- SecurityManager sm = System.getSecurityManager ();
+ SecurityManager sm = System.getSecurityManager();
if (sm != null)
- sm.checkPermission (new SerializablePermission ("enableSubstitution"));
+ sm.checkPermission(new SerializablePermission("enableSubstitution"));
}
boolean old_val = replacementEnabled;
@@ -596,20 +601,18 @@ public class ObjectOutputStream extends OutputStream
/**
- Writes stream magic and stream version information to the
- underlying stream.
-
- @exception IOException Exception from underlying
- <code>OutputStream</code>.
- */
- protected void writeStreamHeader () throws IOException
+ * Writes stream magic and stream version information to the
+ * underlying stream.
+ *
+ * @exception IOException Exception from underlying
+ * <code>OutputStream</code>.
+ */
+ protected void writeStreamHeader() throws IOException
{
- realOutput.writeShort (STREAM_MAGIC);
- realOutput.writeShort (STREAM_VERSION);
+ realOutput.writeShort(STREAM_MAGIC);
+ realOutput.writeShort(STREAM_VERSION);
}
-
-
/**
* Protected constructor that allows subclasses to override
* serialization. This constructor should be called by subclasses
@@ -621,11 +624,11 @@ public class ObjectOutputStream extends OutputStream
*
* @see #writeObjectOverride(Object)
*/
- protected ObjectOutputStream () throws IOException, SecurityException
+ protected ObjectOutputStream() throws IOException, SecurityException
{
SecurityManager sec_man = System.getSecurityManager ();
if (sec_man != null)
- sec_man.checkPermission (SUBCLASS_IMPLEMENTATION_PERMISSION);
+ sec_man.checkPermission(SUBCLASS_IMPLEMENTATION_PERMISSION);
useSubclassMethod = true;
}
@@ -642,10 +645,11 @@ public class ObjectOutputStream extends OutputStream
* @exception NotActiveException Subclass has arranged for this
* method to be called, but did not implement this method.
*/
- protected void writeObjectOverride (Object obj) throws NotActiveException,
+ protected void writeObjectOverride(Object obj) throws NotActiveException,
IOException
{
- throw new NotActiveException ("Subclass of ObjectOutputStream must implement writeObjectOverride");
+ throw new NotActiveException
+ ("Subclass of ObjectOutputStream must implement writeObjectOverride");
}
@@ -657,48 +661,48 @@ public class ObjectOutputStream extends OutputStream
if (writeDataAsBlocks)
{
if (blockDataCount == BUFFER_SIZE)
- drain ();
+ drain();
blockData[ blockDataCount++ ] = (byte)data;
}
else
- realOutput.write (data);
+ realOutput.write(data);
}
/**
* @see DataOutputStream#write(byte[])
*/
- public void write (byte[] b) throws IOException
+ public void write(byte[] b) throws IOException
{
- write (b, 0, b.length);
+ write(b, 0, b.length);
}
/**
* @see DataOutputStream#write(byte[],int,int)
*/
- public void write (byte[] b, int off, int len) throws IOException
+ public void write(byte[] b, int off, int len) throws IOException
{
if (writeDataAsBlocks)
{
if (len < 0)
- throw new IndexOutOfBoundsException ();
+ throw new IndexOutOfBoundsException();
if (blockDataCount + len < BUFFER_SIZE)
{
- System.arraycopy (b, off, blockData, blockDataCount, len);
+ System.arraycopy(b, off, blockData, blockDataCount, len);
blockDataCount += len;
}
else
{
- drain ();
- writeBlockDataHeader (len);
- realOutput.write (b, off, len);
+ drain();
+ writeBlockDataHeader(len);
+ realOutput.write(b, off, len);
}
}
else
- realOutput.write (b, off, len);
+ realOutput.write(b, off, len);
}
@@ -707,8 +711,8 @@ public class ObjectOutputStream extends OutputStream
*/
public void flush () throws IOException
{
- drain ();
- realOutput.flush ();
+ drain();
+ realOutput.flush();
}
@@ -719,14 +723,14 @@ public class ObjectOutputStream extends OutputStream
* @exception IOException Exception from underlying
* <code>OutputStream</code>.
*/
- protected void drain () throws IOException
+ protected void drain() throws IOException
{
if (blockDataCount == 0)
return;
if (writeDataAsBlocks)
- writeBlockDataHeader (blockDataCount);
- realOutput.write (blockData, 0, blockDataCount);
+ writeBlockDataHeader(blockDataCount);
+ realOutput.write(blockData, 0, blockDataCount);
blockDataCount = 0;
}
@@ -734,28 +738,28 @@ public class ObjectOutputStream extends OutputStream
/**
* @see java.io.DataOutputStream#close ()
*/
- public void close () throws IOException
+ public void close() throws IOException
{
- flush ();
- realOutput.close ();
+ flush();
+ realOutput.close();
}
/**
* @see java.io.DataOutputStream#writeBoolean (boolean)
*/
- public void writeBoolean (boolean data) throws IOException
+ public void writeBoolean(boolean data) throws IOException
{
- blockDataOutput.writeBoolean (data);
+ blockDataOutput.writeBoolean(data);
}
/**
* @see java.io.DataOutputStream#writeByte (int)
*/
- public void writeByte (int data) throws IOException
+ public void writeByte(int data) throws IOException
{
- blockDataOutput.writeByte (data);
+ blockDataOutput.writeByte(data);
}
@@ -764,79 +768,79 @@ public class ObjectOutputStream extends OutputStream
*/
public void writeShort (int data) throws IOException
{
- blockDataOutput.writeShort (data);
+ blockDataOutput.writeShort(data);
}
/**
* @see java.io.DataOutputStream#writeChar (int)
*/
- public void writeChar (int data) throws IOException
+ public void writeChar(int data) throws IOException
{
- blockDataOutput.writeChar (data);
+ blockDataOutput.writeChar(data);
}
/**
* @see java.io.DataOutputStream#writeInt (int)
*/
- public void writeInt (int data) throws IOException
+ public void writeInt(int data) throws IOException
{
- blockDataOutput.writeInt (data);
+ blockDataOutput.writeInt(data);
}
/**
* @see java.io.DataOutputStream#writeLong (long)
*/
- public void writeLong (long data) throws IOException
+ public void writeLong(long data) throws IOException
{
- blockDataOutput.writeLong (data);
+ blockDataOutput.writeLong(data);
}
/**
* @see java.io.DataOutputStream#writeFloat (float)
*/
- public void writeFloat (float data) throws IOException
+ public void writeFloat(float data) throws IOException
{
- blockDataOutput.writeFloat (data);
+ blockDataOutput.writeFloat(data);
}
/**
* @see java.io.DataOutputStream#writeDouble (double)
*/
- public void writeDouble (double data) throws IOException
+ public void writeDouble(double data) throws IOException
{
- blockDataOutput.writeDouble (data);
+ blockDataOutput.writeDouble(data);
}
/**
* @see java.io.DataOutputStream#writeBytes (java.lang.String)
*/
- public void writeBytes (String data) throws IOException
+ public void writeBytes(String data) throws IOException
{
- blockDataOutput.writeBytes (data);
+ blockDataOutput.writeBytes(data);
}
/**
* @see java.io.DataOutputStream#writeChars (java.lang.String)
*/
- public void writeChars (String data) throws IOException
+ public void writeChars(String data) throws IOException
{
- dataOutput.writeChars (data);
+ dataOutput.writeChars(data);
}
/**
* @see java.io.DataOutputStream#writeUTF (java.lang.String)
*/
- public void writeUTF (String data) throws IOException
+ public void writeUTF(String data) throws IOException
{
- dataOutput.writeUTF (data);
+ dataOutput.writeUTF(data);
}
@@ -864,7 +868,7 @@ public class ObjectOutputStream extends OutputStream
public abstract void write (ObjectOutput out) throws IOException;
}
- public PutField putFields () throws IOException
+ public PutField putFields() throws IOException
{
if (currentPutField == null)
{
@@ -1007,183 +1011,184 @@ public class ObjectOutputStream extends OutputStream
}
- public void writeFields () throws IOException
+ public void writeFields() throws IOException
{
if (currentPutField == null)
- throw new NotActiveException ("writeFields can only be called after putFields has been called");
+ throw new NotActiveException("writeFields can only be called after putFields has been called");
// putFields may be called more than once, but not writeFields.
markFieldsWritten();
- currentPutField.write (this);
+ currentPutField.write(this);
currentPutField = null;
}
// write out the block-data buffer, picking the correct header
// depending on the size of the buffer
- private void writeBlockDataHeader (int size) throws IOException
+ private void writeBlockDataHeader(int size) throws IOException
{
if (size < 256)
{
- realOutput.writeByte (TC_BLOCKDATA);
- realOutput.write (size);
+ realOutput.writeByte(TC_BLOCKDATA);
+ realOutput.write(size);
}
else
{
- realOutput.writeByte (TC_BLOCKDATALONG);
- realOutput.writeInt (size);
+ realOutput.writeByte(TC_BLOCKDATALONG);
+ realOutput.writeInt(size);
}
}
// lookup the handle for OBJ, return null if OBJ doesn't have a
// handle yet
- private Integer findHandle (Object obj)
+ private Integer findHandle(Object obj)
{
- return (Integer)OIDLookupTable.get (new ObjectIdentityWrapper (obj));
+ return (Integer)OIDLookupTable.get(new ObjectIdentityWrapper(obj));
}
// assigns the next availible handle to OBJ
- private int assignNewHandle (Object obj)
+ private int assignNewHandle(Object obj)
{
- OIDLookupTable.put (new ObjectIdentityWrapper (obj),
- new Integer (nextOID));
+ OIDLookupTable.put(new ObjectIdentityWrapper(obj),
+ new Integer(nextOID));
return nextOID++;
}
// resets mapping from objects to handles
- private void clearHandles ()
+ private void clearHandles()
{
nextOID = baseWireHandle;
- OIDLookupTable.clear ();
+ OIDLookupTable.clear();
}
// write out array size followed by each element of the array
- private void writeArraySizeAndElements (Object array, Class clazz)
+ private void writeArraySizeAndElements(Object array, Class clazz)
throws IOException
{
- int length = Array.getLength (array);
+ int length = Array.getLength(array);
- if (clazz.isPrimitive ())
+ if (clazz.isPrimitive())
{
if (clazz == Boolean.TYPE)
{
boolean[] cast_array = (boolean[])array;
realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeBoolean (cast_array[i]);
+ for (int i = 0; i < length; i++)
+ realOutput.writeBoolean(cast_array[i]);
return;
}
if (clazz == Byte.TYPE)
{
byte[] cast_array = (byte[])array;
- realOutput.writeInt (length);
+ realOutput.writeInt(length);
realOutput.write(cast_array, 0, length);
return;
}
if (clazz == Character.TYPE)
{
char[] cast_array = (char[])array;
- realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeChar (cast_array[i]);
+ realOutput.writeInt(length);
+ for (int i = 0; i < length; i++)
+ realOutput.writeChar(cast_array[i]);
return;
}
if (clazz == Double.TYPE)
{
double[] cast_array = (double[])array;
- realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeDouble (cast_array[i]);
+ realOutput.writeInt(length);
+ for (int i = 0; i < length; i++)
+ realOutput.writeDouble(cast_array[i]);
return;
}
if (clazz == Float.TYPE)
{
float[] cast_array = (float[])array;
- realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeFloat (cast_array[i]);
+ realOutput.writeInt(length);
+ for (int i = 0; i < length; i++)
+ realOutput.writeFloat(cast_array[i]);
return;
}
if (clazz == Integer.TYPE)
{
int[] cast_array = (int[])array;
- realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeInt (cast_array[i]);
+ realOutput.writeInt(length);
+ for (int i = 0; i < length; i++)
+ realOutput.writeInt(cast_array[i]);
return;
}
if (clazz == Long.TYPE)
{
long[] cast_array = (long[])array;
realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeLong (cast_array[i]);
+ for (int i = 0; i < length; i++)
+ realOutput.writeLong(cast_array[i]);
return;
}
if (clazz == Short.TYPE)
{
short[] cast_array = (short[])array;
realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- realOutput.writeShort (cast_array[i]);
+ for (int i = 0; i < length; i++)
+ realOutput.writeShort(cast_array[i]);
return;
}
}
else
{
Object[] cast_array = (Object[])array;
- realOutput.writeInt (length);
- for (int i=0; i < length; i++)
- writeObject (cast_array[i]);
+ realOutput.writeInt(length);
+ for (int i = 0; i < length; i++)
+ writeObject(cast_array[i]);
}
}
// writes out FIELDS of OBJECT for the specified ObjectStreamClass.
// FIELDS are already in canonical order.
- private void writeFields (Object obj, ObjectStreamClass osc)
+ private void writeFields(Object obj, ObjectStreamClass osc)
throws IOException
{
ObjectStreamField[] fields = osc.fields;
- boolean oldmode = setBlockDataMode (false);
+ boolean oldmode = setBlockDataMode(false);
String field_name;
Class type;
- for (int i=0; i < fields.length; i++)
+
+ for (int i = 0; i < fields.length; i++)
{
- field_name = fields[i].getName ();
- type = fields[i].getType ();
+ field_name = fields[i].getName();
+ type = fields[i].getType();
if (type == Boolean.TYPE)
- realOutput.writeBoolean (getBooleanField (obj, osc.forClass(), field_name));
+ realOutput.writeBoolean(getBooleanField(obj, osc.forClass(), field_name));
else if (type == Byte.TYPE)
- realOutput.writeByte (getByteField (obj, osc.forClass(), field_name));
+ realOutput.writeByte(getByteField(obj, osc.forClass(), field_name));
else if (type == Character.TYPE)
- realOutput.writeChar (getCharField (obj, osc.forClass(), field_name));
+ realOutput.writeChar(getCharField(obj, osc.forClass(), field_name));
else if (type == Double.TYPE)
- realOutput.writeDouble (getDoubleField (obj, osc.forClass(), field_name));
+ realOutput.writeDouble(getDoubleField(obj, osc.forClass(), field_name));
else if (type == Float.TYPE)
- realOutput.writeFloat (getFloatField (obj, osc.forClass(), field_name));
+ realOutput.writeFloat(getFloatField(obj, osc.forClass(), field_name));
else if (type == Integer.TYPE)
- realOutput.writeInt (getIntField (obj, osc.forClass(), field_name));
+ realOutput.writeInt(getIntField(obj, osc.forClass(), field_name));
else if (type == Long.TYPE)
- realOutput.writeLong (getLongField (obj, osc.forClass(), field_name));
+ realOutput.writeLong(getLongField(obj, osc.forClass(), field_name));
else if (type == Short.TYPE)
- realOutput.writeShort (getShortField (obj, osc.forClass(), field_name));
+ realOutput.writeShort(getShortField(obj, osc.forClass(), field_name));
else
- writeObject (getObjectField (obj, osc.forClass(), field_name,
- fields[i].getTypeString ()));
+ writeObject(getObjectField(obj, osc.forClass(), field_name,
+ fields[i].getTypeString ()));
}
- setBlockDataMode (oldmode);
+ setBlockDataMode(oldmode);
}
// Toggles writing primitive data to block-data buffer.
- private boolean setBlockDataMode (boolean on) throws IOException
+ private boolean setBlockDataMode(boolean on) throws IOException
{
if (on == writeDataAsBlocks)
return on;
@@ -1201,16 +1206,16 @@ public class ObjectOutputStream extends OutputStream
}
- private void callWriteMethod (Object obj, ObjectStreamClass osc)
+ private void callWriteMethod(Object obj, ObjectStreamClass osc)
throws IOException
{
Class klass = osc.forClass();
try
{
Class classArgs[] = {ObjectOutputStream.class};
- Method m = getMethod (klass, "writeObject", classArgs);
+ Method m = getMethod(klass, "writeObject", classArgs);
Object args[] = {this};
- m.invoke (obj, args);
+ m.invoke(obj, args);
}
catch (NoSuchMethodException nsme)
{
@@ -1226,34 +1231,34 @@ public class ObjectOutputStream extends OutputStream
throw (IOException) exception;
IOException ioe
- = new IOException ("Exception thrown from writeObject() on " +
- klass + ": " + exception.getClass().getName());
+ = new IOException("Exception thrown from writeObject() on " +
+ klass + ": " + exception.getClass().getName());
ioe.initCause(exception);
throw ioe;
}
catch (Exception x)
{
IOException ioe
- = new IOException ("Failure invoking writeObject() on " +
- klass + ": " + x.getClass().getName());
+ = new IOException("Failure invoking writeObject() on " +
+ klass + ": " + x.getClass().getName());
ioe.initCause(x);
throw ioe;
}
}
- private boolean getBooleanField (Object obj, Class klass, String field_name)
+ private boolean getBooleanField(Object obj, Class klass, String field_name)
throws IOException
{
try
{
- Field f = getField (klass, field_name);
- boolean b = f.getBoolean (obj);
+ Field f = getField(klass, field_name);
+ boolean b = f.getBoolean(obj);
return b;
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
- }
+ throw new IOException("Unexpected exception " + _);
+ }
}
private byte getByteField (Object obj, Class klass, String field_name)
@@ -1267,7 +1272,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
+ throw new IOException("Unexpected exception " + _);
}
}
@@ -1282,7 +1287,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
+ throw new IOException("Unexpected exception " + _);
}
}
@@ -1297,7 +1302,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
+ throw new IOException("Unexpected exception " + _);
}
}
@@ -1312,8 +1317,8 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
- }
+ throw new IOException("Unexpected exception " + _);
+ }
}
private int getIntField (Object obj, Class klass, String field_name)
@@ -1327,8 +1332,8 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
- }
+ throw new IOException("Unexpected exception " + _);
+ }
}
private long getLongField (Object obj, Class klass, String field_name)
@@ -1342,7 +1347,7 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
+ throw new IOException("Unexpected exception " + _);
}
}
@@ -1357,8 +1362,8 @@ public class ObjectOutputStream extends OutputStream
}
catch (Exception _)
{
- throw new IOException ("Unexpected Exception "+_);
- }
+ throw new IOException("Unexpected exception " + _);
+ }
}
private Object getObjectField (Object obj, Class klass, String field_name,
@@ -1371,9 +1376,9 @@ public class ObjectOutputStream extends OutputStream
// FIXME: We should check the type_code here
return o;
}
- catch (Exception _)
+ catch (Exception e)
{
- throw new IOException ("Unexpected Exception "+_);
+ throw new IOException ();
}
}
@@ -1433,7 +1438,7 @@ public class ObjectOutputStream extends OutputStream
{
if (Configuration.INIT_LOAD_LIBRARY)
{
- System.loadLibrary ("javaio");
+ System.loadLibrary("javaio");
}
}
}
diff --git a/libjava/java/io/ObjectStreamClass.java b/libjava/java/io/ObjectStreamClass.java
index 3a2ccfb8e99..5bd0e686625 100644
--- a/libjava/java/io/ObjectStreamClass.java
+++ b/libjava/java/io/ObjectStreamClass.java
@@ -2,39 +2,39 @@
about serialized objects.
Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
-This file is part of GNU Classpath.
+ 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 free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-02111-1307 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
package java.io;
@@ -61,23 +61,23 @@ import gnu.java.security.provider.Gnu;
public class ObjectStreamClass implements Serializable
{
/**
- Returns the <code>ObjectStreamClass</code> for <code>cl</code>.
- If <code>cl</code> is null, or is not <code>Serializable</code>,
- null is returned. <code>ObjectStreamClass</code>'s are memorized;
- later calls to this method with the same class will return the
- same <code>ObjectStreamClass</code> object and no recalculation
- will be done.
-
- @see java.io.Serializable
- */
- public static ObjectStreamClass lookup (Class cl)
+ * Returns the <code>ObjectStreamClass</code> for <code>cl</code>.
+ * If <code>cl</code> is null, or is not <code>Serializable</code>,
+ * null is returned. <code>ObjectStreamClass</code>'s are memorized;
+ * later calls to this method with the same class will return the
+ * same <code>ObjectStreamClass</code> object and no recalculation
+ * will be done.
+ *
+ * @see java.io.Serializable
+ */
+ public static ObjectStreamClass lookup(Class cl)
{
if (cl == null)
return null;
- if (! (Serializable.class).isAssignableFrom (cl))
+ if (! (Serializable.class).isAssignableFrom(cl))
return null;
- return lookupForClassObject (cl);
+ return lookupForClassObject(cl);
}
/**
@@ -85,57 +85,57 @@ public class ObjectStreamClass implements Serializable
* we have a java.lang.Class object C for class A, though A is not
* serializable, but it's okay to serialize C.
*/
- static ObjectStreamClass lookupForClassObject (Class cl)
+ static ObjectStreamClass lookupForClassObject(Class cl)
{
if (cl == null)
return null;
- ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (cl);
+ ObjectStreamClass osc = (ObjectStreamClass) classLookupTable.get(cl);
if (osc != null)
return osc;
else
- {
- osc = new ObjectStreamClass (cl);
- classLookupTable.put (cl, osc);
- return osc;
- }
+ {
+ osc = new ObjectStreamClass(cl);
+ classLookupTable.put(cl, osc);
+ return osc;
+ }
}
/**
- Returns the name of the class that this
- <code>ObjectStreamClass</code> represents.
- */
- public String getName ()
+ * Returns the name of the class that this
+ * <code>ObjectStreamClass</code> represents.
+ */
+ public String getName()
{
return name;
}
/**
- Returns the class that this <code>ObjectStreamClass</code>
- represents. Null could be returned if this
- <code>ObjectStreamClass</code> was read from an
- <code>ObjectInputStream</code> and the class it represents cannot
- be found or loaded.
-
- @see java.io.ObjectInputStream
- */
- public Class forClass ()
+ * Returns the class that this <code>ObjectStreamClass</code>
+ * represents. Null could be returned if this
+ * <code>ObjectStreamClass</code> was read from an
+ * <code>ObjectInputStream</code> and the class it represents cannot
+ * be found or loaded.
+ *
+ * @see java.io.ObjectInputStream
+ */
+ public Class forClass()
{
return clazz;
}
/**
- Returns the serial version stream-unique identifier for the class
- represented by this <code>ObjectStreamClass</code>. This SUID is
- either defined by the class as <code>static final long
- serialVersionUID</code> or is calculated as specified in
- Javasoft's "Object Serialization Specification" XXX: add reference
- */
- public long getSerialVersionUID ()
+ * Returns the serial version stream-unique identifier for the class
+ * represented by this <code>ObjectStreamClass</code>. This SUID is
+ * either defined by the class as <code>static final long
+ * serialVersionUID</code> or is calculated as specified in
+ * Javasoft's "Object Serialization Specification" XXX: add reference
+ */
+ public long getSerialVersionUID()
{
return uid;
}
@@ -145,10 +145,10 @@ public class ObjectStreamClass implements Serializable
// of the class represented by this ObjectStreamClass. The Fields
// are sorted by name.
// XXX doc
- public ObjectStreamField[] getFields ()
+ public ObjectStreamField[] getFields()
{
ObjectStreamField[] copy = new ObjectStreamField[ fields.length ];
- System.arraycopy (fields, 0, copy, 0, fields.length);
+ System.arraycopy(fields, 0, copy, 0, fields.length);
return copy;
}
@@ -158,8 +158,8 @@ public class ObjectStreamClass implements Serializable
// primitiveness.
public ObjectStreamField getField (String name)
{
- for (int i=0; i < fields.length; i++)
- if (fields[i].getName ().equals (name))
+ for (int i = 0; i < fields.length; i++)
+ if (fields[i].getName().equals(name))
return fields[i];
return null;
}
@@ -174,7 +174,7 @@ public class ObjectStreamClass implements Serializable
* @see #getSerialVersionUID()
* @see #getName()
*/
- public String toString ()
+ public String toString()
{
return "java.io.ObjectStreamClass< " + name + ", " + uid + " >";
}
@@ -187,7 +187,7 @@ public class ObjectStreamClass implements Serializable
//
// This method is used by the class to override default
// serialization behavior.
- boolean hasWriteMethod ()
+ boolean hasWriteMethod()
{
return (flags & ObjectStreamConstants.SC_WRITE_METHOD) != 0;
}
@@ -200,24 +200,24 @@ public class ObjectStreamClass implements Serializable
//
// This method is used by the class to override default
// serialization behavior.
- boolean hasReadMethod ()
+ boolean hasReadMethod()
{
- try
+ try
{
- Class[] readObjectParams = { ObjectInputStream.class };
- forClass ().getDeclaredMethod ("readObject", readObjectParams);
- return true;
+ Class[] readObjectParams = { ObjectInputStream.class };
+ forClass().getDeclaredMethod("readObject", readObjectParams);
+ return true;
}
- catch (NoSuchMethodException e)
+ catch (NoSuchMethodException e)
{
- return false;
+ return false;
}
}
// Returns true iff the class that this ObjectStreamClass represents
// implements Serializable but does *not* implement Externalizable.
- boolean isSerializable ()
+ boolean isSerializable()
{
return (flags & ObjectStreamConstants.SC_SERIALIZABLE) != 0;
}
@@ -225,7 +225,7 @@ public class ObjectStreamClass implements Serializable
// Returns true iff the class that this ObjectStreamClass represents
// implements Externalizable.
- boolean isExternalizable ()
+ boolean isExternalizable()
{
return (flags & ObjectStreamConstants.SC_EXTERNALIZABLE) != 0;
}
@@ -235,7 +235,7 @@ public class ObjectStreamClass implements Serializable
// class that is the superclass of the class this
// <code>ObjectStreamClass</code> represents. If the superclass is
// not Serializable, null is returned.
- ObjectStreamClass getSuper ()
+ ObjectStreamClass getSuper()
{
return superClass;
}
@@ -245,30 +245,30 @@ public class ObjectStreamClass implements Serializable
// classes of CLAZZ and CLAZZ itself in order from most super to
// CLAZZ. ObjectStreamClass[0] is the highest superclass of CLAZZ
// that is serializable.
- static ObjectStreamClass[] getObjectStreamClasses (Class clazz)
+ static ObjectStreamClass[] getObjectStreamClasses(Class clazz)
{
- ObjectStreamClass osc = ObjectStreamClass.lookup (clazz);
+ ObjectStreamClass osc = ObjectStreamClass.lookup(clazz);
if (osc == null)
return new ObjectStreamClass[0];
else
- {
- Vector oscs = new Vector ();
-
- while (osc != null)
{
- oscs.addElement (osc);
- osc = osc.getSuper ();
- }
+ Vector oscs = new Vector();
- int count = oscs.size ();
- ObjectStreamClass[] sorted_oscs = new ObjectStreamClass[ count ];
+ while (osc != null)
+ {
+ oscs.addElement (osc);
+ osc = osc.getSuper();
+ }
- for (int i = count - 1; i >= 0; i--)
- sorted_oscs[ count - i - 1 ] = (ObjectStreamClass)oscs.elementAt (i);
+ int count = oscs.size();
+ ObjectStreamClass[] sorted_oscs = new ObjectStreamClass[ count ];
- return sorted_oscs;
- }
+ for (int i = count - 1; i >= 0; i--)
+ sorted_oscs[ count - i - 1 ] = (ObjectStreamClass) oscs.elementAt(i);
+
+ return sorted_oscs;
+ }
}
@@ -276,14 +276,14 @@ public class ObjectStreamClass implements Serializable
// properties of the class represented by this ObjectStreamClass.
// The bit-flags that could be present are those defined in
// ObjectStreamConstants that begin with `SC_'
- int getFlags ()
+ int getFlags()
{
return flags;
}
- ObjectStreamClass (String name, long uid, byte flags,
- ObjectStreamField[] fields)
+ ObjectStreamClass(String name, long uid, byte flags,
+ ObjectStreamField[] fields)
{
this.name = name;
this.uid = uid;
@@ -291,11 +291,22 @@ public class ObjectStreamClass implements Serializable
this.fields = fields;
}
- void setClass (Class cl) throws InvalidClassException
+ /**
+ * This method builds the internal description corresponding to a Java Class.
+ * As the constructor only assign a name to the current ObjectStreamClass instance,
+ * that method sets the serial UID, chose the fields which will be serialized,
+ * and compute the position of the fields in the serialized stream.
+ *
+ * @param cl The Java class which is used as a reference for building the descriptor.
+ * @param superClass The descriptor of the super class for this class descriptor.
+ * @throws InvalidClassException if an incompatibility between computed UID and
+ * already set UID is found.
+ */
+ void setClass(Class cl, ObjectStreamClass superClass) throws InvalidClassException
{
this.clazz = cl;
- long class_uid = getClassUID (cl);
+ long class_uid = getClassUID(cl);
if (uid == 0)
uid = class_uid;
else
@@ -311,12 +322,90 @@ public class ObjectStreamClass implements Serializable
}
}
- isProxyClass = clazz != null && Proxy.isProxyClass (clazz);
- ObjectStreamClass osc = (ObjectStreamClass)classLookupTable.get (clazz);
- if (osc == null)
- classLookupTable.put (clazz, this);
- superClass = lookupForClassObject (clazz.getSuperclass ());
- calculateOffsets ();
+ isProxyClass = clazz != null && Proxy.isProxyClass(clazz);
+ this.superClass = superClass;
+ calculateOffsets();
+
+ try
+ {
+ ObjectStreamField[] exportedFields = getSerialPersistentFields (clazz);
+
+ if (exportedFields == null)
+ return;
+
+ ObjectStreamField[] newFieldList = new ObjectStreamField[exportedFields.length + fields.length];
+ int i, j, k;
+
+ /* We now check the import fields against the exported fields.
+ * There should not be contradiction (e.g. int x and String x)
+ * but extra virtual fields can be added to the class.
+ */
+
+ Arrays.sort(exportedFields);
+
+ i = 0; j = 0; k = 0;
+ while (i < fields.length && j < exportedFields.length)
+ {
+ int comp = fields[i].getName().compareTo(exportedFields[j].getName());
+
+ if (comp < 0)
+ {
+ newFieldList[k] = fields[i];
+ fields[i].setPersistent(false);
+ fields[i].setToSet(false);
+ i++;
+ }
+ else if (comp > 0)
+ {
+ /* field not found in imported fields. We add it
+ * in the list of supported fields.
+ */
+ newFieldList[k] = exportedFields[j];
+ newFieldList[k].setPersistent(true);
+ newFieldList[k].setToSet(false);
+ j++;
+ }
+ else
+ {
+ if (!fields[i].getType().equals(exportedFields[j].getType()))
+ throw new InvalidClassException
+ ("serialPersistentFields must be compatible with" +
+ " imported fields (about " + fields[i].getName() + ")");
+ newFieldList[k] = fields[i];
+ fields[i].setPersistent(true);
+ i++;
+ j++;
+ }
+ k++;
+ }
+
+ if (i < fields.length)
+ for (;i<fields.length;i++,k++)
+ {
+ fields[i].setPersistent(false);
+ fields[i].setToSet(false);
+ newFieldList[k] = fields[i];
+ }
+ else
+ if (j < exportedFields.length)
+ for (;j<exportedFields.length;j++,k++)
+ {
+ exportedFields[j].setPersistent(true);
+ exportedFields[j].setToSet(false);
+ newFieldList[k] = exportedFields[j];
+ }
+
+ fields = new ObjectStreamField[k];
+ System.arraycopy(newFieldList, 0, fields, 0, k);
+ }
+ catch (NoSuchFieldException ignore)
+ {
+ return;
+ }
+ catch (IllegalAccessException ignore)
+ {
+ return;
+ }
}
void setSuperclass (ObjectStreamClass osc)
@@ -324,321 +413,345 @@ public class ObjectStreamClass implements Serializable
superClass = osc;
}
-
- void calculateOffsets ()
+ void calculateOffsets()
{
int i;
ObjectStreamField field;
primFieldSize = 0;
int fcount = fields.length;
for (i = 0; i < fcount; ++ i)
- {
- field = fields[i];
-
- if (! field.isPrimitive ())
- break;
-
- field.setOffset (primFieldSize);
- switch (field.getTypeCode ())
{
- case 'B':
- case 'Z':
- ++ primFieldSize;
- break;
- case 'C':
- case 'S':
- primFieldSize += 2;
- break;
- case 'I':
- case 'F':
- primFieldSize += 4;
- break;
- case 'D':
- case 'J':
- primFieldSize += 8;
+ field = fields[i];
+
+ if (! field.isPrimitive())
break;
+
+ field.setOffset(primFieldSize);
+ switch (field.getTypeCode())
+ {
+ case 'B':
+ case 'Z':
+ ++ primFieldSize;
+ break;
+ case 'C':
+ case 'S':
+ primFieldSize += 2;
+ break;
+ case 'I':
+ case 'F':
+ primFieldSize += 4;
+ break;
+ case 'D':
+ case 'J':
+ primFieldSize += 8;
+ break;
+ }
}
- }
for (objectFieldCount = 0; i < fcount; ++ i)
- fields[i].setOffset (objectFieldCount++);
+ fields[i].setOffset(objectFieldCount++);
}
- private ObjectStreamClass (Class cl)
+ private ObjectStreamClass(Class cl)
{
uid = 0;
flags = 0;
- isProxyClass = Proxy.isProxyClass (cl);
+ isProxyClass = Proxy.isProxyClass(cl);
clazz = cl;
- name = cl.getName ();
- setFlags (cl);
- setFields (cl);
+ name = cl.getName();
+ setFlags(cl);
+ setFields(cl);
// to those class nonserializable, its uid field is 0
- if ( (Serializable.class).isAssignableFrom (cl) && !isProxyClass)
- uid = getClassUID (cl);
- superClass = lookup (cl.getSuperclass ());
+ if ( (Serializable.class).isAssignableFrom(cl) && !isProxyClass)
+ uid = getClassUID(cl);
+ superClass = lookup(cl.getSuperclass());
}
// Sets bits in flags according to features of CL.
- private void setFlags (Class cl)
+ private void setFlags(Class cl)
{
- if ((java.io.Externalizable.class).isAssignableFrom (cl))
+ if ((java.io.Externalizable.class).isAssignableFrom(cl))
flags |= ObjectStreamConstants.SC_EXTERNALIZABLE;
- else if ((java.io.Serializable.class).isAssignableFrom (cl))
+ else if ((java.io.Serializable.class).isAssignableFrom(cl))
// only set this bit if CL is NOT Externalizable
flags |= ObjectStreamConstants.SC_SERIALIZABLE;
try
- {
- Method writeMethod = cl.getDeclaredMethod ("writeObject",
- writeMethodArgTypes);
- int modifiers = writeMethod.getModifiers ();
-
- if (writeMethod.getReturnType () == Void.TYPE
- && Modifier.isPrivate (modifiers)
- && !Modifier.isStatic (modifiers))
- flags |= ObjectStreamConstants.SC_WRITE_METHOD;
- }
- catch (NoSuchMethodException oh_well)
- {}
+ {
+ Method writeMethod = cl.getDeclaredMethod("writeObject",
+ writeMethodArgTypes);
+ int modifiers = writeMethod.getModifiers();
+
+ if (writeMethod.getReturnType() == Void.TYPE
+ && Modifier.isPrivate(modifiers)
+ && !Modifier.isStatic(modifiers))
+ flags |= ObjectStreamConstants.SC_WRITE_METHOD;
+ }
+ catch(NoSuchMethodException oh_well)
+ {
+ }
}
// Sets fields to be a sorted array of the serializable fields of
// clazz.
- private void setFields (Class cl)
+ private void setFields(Class cl)
{
- if (! isSerializable () || isExternalizable ())
- {
- fields = NO_FIELDS;
- return;
- }
+ if (!isSerializable() || isExternalizable())
+ {
+ fields = NO_FIELDS;
+ return;
+ }
try
- {
- Field serialPersistentFields
- = cl.getDeclaredField ("serialPersistentFields");
- serialPersistentFields.setAccessible(true);
- int modifiers = serialPersistentFields.getModifiers ();
-
- if (Modifier.isStatic (modifiers)
- && Modifier.isFinal (modifiers)
- && Modifier.isPrivate (modifiers))
{
- fields = getSerialPersistentFields (cl);
- Arrays.sort (fields);
- calculateOffsets ();
- return;
+ Field serialPersistentFields =
+ cl.getDeclaredField("serialPersistentFields");
+ serialPersistentFields.setAccessible(true);
+ int modifiers = serialPersistentFields.getModifiers();
+
+ if (Modifier.isStatic(modifiers)
+ && Modifier.isFinal(modifiers)
+ && Modifier.isPrivate(modifiers))
+ {
+ fields = getSerialPersistentFields(cl);
+ if (fields != null)
+ {
+ Arrays.sort (fields);
+ calculateOffsets();
+ return;
+ }
+ }
}
- }
catch (NoSuchFieldException ignore)
- {}
+ {
+ }
+ catch (IllegalAccessException ignore)
+ {
+ }
int num_good_fields = 0;
- Field[] all_fields = cl.getDeclaredFields ();
+ Field[] all_fields = cl.getDeclaredFields();
int modifiers;
// set non-serializable fields to null in all_fields
- for (int i=0; i < all_fields.length; i++)
- {
- modifiers = all_fields[i].getModifiers ();
- if (Modifier.isTransient (modifiers)
- || Modifier.isStatic (modifiers))
- all_fields[i] = null;
- else
- num_good_fields++;
- }
+ for (int i = 0; i < all_fields.length; i++)
+ {
+ modifiers = all_fields[i].getModifiers();
+ if (Modifier.isTransient(modifiers)
+ || Modifier.isStatic(modifiers))
+ all_fields[i] = null;
+ else
+ num_good_fields++;
+ }
// make a copy of serializable (non-null) fields
fields = new ObjectStreamField[ num_good_fields ];
- for (int from=0, to=0; from < all_fields.length; from++)
+ for (int from = 0, to = 0; from < all_fields.length; from++)
if (all_fields[from] != null)
- {
- Field f = all_fields[from];
- fields[to] = new ObjectStreamField (f.getName (), f.getType ());
- to++;
- }
+ {
+ Field f = all_fields[from];
+ fields[to] = new ObjectStreamField(f.getName(), f.getType());
+ to++;
+ }
- Arrays.sort (fields);
- calculateOffsets ();
+ Arrays.sort(fields);
+ calculateOffsets();
}
// Returns the serial version UID defined by class, or if that
// isn't present, calculates value of serial version UID.
- private long getClassUID (Class cl)
+ private long getClassUID(Class cl)
{
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 suid = cl.getDeclaredField ("serialVersionUID");
- suid.setAccessible(true);
- int modifiers = suid.getModifiers ();
-
- if (Modifier.isStatic (modifiers)
- && Modifier.isFinal (modifiers)
- && suid.getType() == Long.TYPE)
- return suid.getLong (null);
- }
+ {
+ // 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 suid = cl.getDeclaredField("serialVersionUID");
+ suid.setAccessible(true);
+ int modifiers = suid.getModifiers();
+
+ if (Modifier.isStatic(modifiers)
+ && Modifier.isFinal(modifiers)
+ && suid.getType() == Long.TYPE)
+ return suid.getLong(null);
+ }
catch (NoSuchFieldException ignore)
- {}
+ {
+ }
catch (IllegalAccessException ignore)
- {}
+ {
+ }
// cl didn't define serialVersionUID, so we have to compute it
try
- {
- MessageDigest md;
- try
- {
- md = MessageDigest.getInstance ("SHA");
- }
- catch (NoSuchAlgorithmException e)
- {
- // If a provider already provides SHA, use it; otherwise, use this.
- Gnu gnuProvider = new Gnu();
- Security.addProvider(gnuProvider);
- md = MessageDigest.getInstance ("SHA");
- }
-
- DigestOutputStream digest_out =
- new DigestOutputStream (nullOutputStream, md);
- DataOutputStream data_out = new DataOutputStream (digest_out);
+ {
+ MessageDigest md;
+ try
+ {
+ md = MessageDigest.getInstance("SHA");
+ }
+ catch (NoSuchAlgorithmException e)
+ {
+ // If a provider already provides SHA, use it; otherwise, use this.
+ Gnu gnuProvider = new Gnu();
+ Security.addProvider(gnuProvider);
+ md = MessageDigest.getInstance("SHA");
+ }
- data_out.writeUTF (cl.getName ());
+ DigestOutputStream digest_out =
+ new DigestOutputStream(nullOutputStream, md);
+ DataOutputStream data_out = new DataOutputStream(digest_out);
- int modifiers = cl.getModifiers ();
- // just look at interesting bits
- modifiers = modifiers & (Modifier.ABSTRACT | Modifier.FINAL
- | Modifier.INTERFACE | Modifier.PUBLIC);
- data_out.writeInt (modifiers);
+ data_out.writeUTF(cl.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 ());
- }
+ int modifiers = cl.getModifiers();
+ // just look at interesting bits
+ modifiers = modifiers & (Modifier.ABSTRACT | Modifier.FINAL
+ | Modifier.INTERFACE | Modifier.PUBLIC);
+ data_out.writeInt(modifiers);
- Field field;
- Field[] fields = cl.getDeclaredFields ();
- Arrays.sort (fields, memberComparator);
- for (int i=0; i < fields.length; i++)
- {
- field = fields[i];
- modifiers = field.getModifiers ();
- if (Modifier.isPrivate (modifiers)
- && (Modifier.isStatic (modifiers)
- || Modifier.isTransient (modifiers)))
- continue;
-
- data_out.writeUTF (field.getName ());
- data_out.writeInt (modifiers);
- data_out.writeUTF (TypeSignature.getEncodingOfClass (field.getType ()));
- }
+ // 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());
+ }
- // write class initializer method if present
- if (VMObjectStreamClass.hasClassInitializer (cl))
- {
- data_out.writeUTF ("<clinit>");
- data_out.writeInt (Modifier.STATIC);
- data_out.writeUTF ("()V");
- }
+ Field field;
+ Field[] fields = cl.getDeclaredFields();
+ Arrays.sort(fields, memberComparator);
+ for (int i = 0; i < fields.length; i++)
+ {
+ field = fields[i];
+ modifiers = field.getModifiers();
+ if (Modifier.isPrivate(modifiers)
+ && (Modifier.isStatic(modifiers)
+ || Modifier.isTransient(modifiers)))
+ continue;
+
+ data_out.writeUTF(field.getName());
+ data_out.writeInt(modifiers);
+ data_out.writeUTF(TypeSignature.getEncodingOfClass (field.getType()));
+ }
- Constructor constructor;
- Constructor[] constructors = cl.getDeclaredConstructors ();
- Arrays.sort (constructors, memberComparator);
- for (int i=0; i < constructors.length; i++)
- {
- constructor = constructors[i];
- modifiers = constructor.getModifiers ();
- if (Modifier.isPrivate (modifiers))
- continue;
-
- data_out.writeUTF ("<init>");
- data_out.writeInt (modifiers);
-
- // the replacement of '/' with '.' was needed to make computed
- // SUID's agree with those computed by JDK
- data_out.writeUTF (
- TypeSignature.getEncodingOfConstructor (constructor).replace ('/','.'));
- }
+ // write class initializer method if present
+ if (VMObjectStreamClass.hasClassInitializer(cl))
+ {
+ data_out.writeUTF("<clinit>");
+ data_out.writeInt(Modifier.STATIC);
+ data_out.writeUTF("()V");
+ }
- Method method;
- Method[] methods = cl.getDeclaredMethods ();
- Arrays.sort (methods, memberComparator);
- for (int i=0; i < methods.length; i++)
- {
- method = methods[i];
- modifiers = method.getModifiers ();
- if (Modifier.isPrivate (modifiers))
- continue;
-
- data_out.writeUTF (method.getName ());
- data_out.writeInt (modifiers);
-
- // the replacement of '/' with '.' was needed to make computed
- // SUID's agree with those computed by JDK
- data_out.writeUTF (
- TypeSignature.getEncodingOfMethod (method).replace ('/', '.'));
- }
+ Constructor constructor;
+ Constructor[] constructors = cl.getDeclaredConstructors();
+ Arrays.sort (constructors, memberComparator);
+ for (int i = 0; i < constructors.length; i++)
+ {
+ constructor = constructors[i];
+ modifiers = constructor.getModifiers();
+ if (Modifier.isPrivate(modifiers))
+ continue;
+
+ data_out.writeUTF("<init>");
+ data_out.writeInt(modifiers);
+
+ // the replacement of '/' with '.' was needed to make computed
+ // SUID's agree with those computed by JDK
+ data_out.writeUTF
+ (TypeSignature.getEncodingOfConstructor(constructor).replace('/','.'));
+ }
- data_out.close ();
- byte[] sha = md.digest ();
- long result = 0;
- int len = sha.length < 8 ? sha.length : 8;
- for (int i=0; i < len; i++)
- result += (long)(sha[i] & 0xFF) << (8 * i);
+ Method method;
+ Method[] methods = cl.getDeclaredMethods();
+ Arrays.sort(methods, memberComparator);
+ for (int i = 0; i < methods.length; i++)
+ {
+ method = methods[i];
+ modifiers = method.getModifiers();
+ if (Modifier.isPrivate(modifiers))
+ continue;
+
+ data_out.writeUTF(method.getName());
+ data_out.writeInt(modifiers);
+
+ // the replacement of '/' with '.' was needed to make computed
+ // SUID's agree with those computed by JDK
+ data_out.writeUTF
+ (TypeSignature.getEncodingOfMethod(method).replace('/', '.'));
+ }
- return result;
- }
- catch (NoSuchAlgorithmException e)
- {
- throw new RuntimeException ("The SHA algorithm was not found to use in computing the Serial Version UID for class "
- + cl.getName (), e);
- }
- catch (IOException ioe)
- {
- throw new RuntimeException (ioe);
- }
- }
+ data_out.close();
+ byte[] sha = md.digest();
+ long result = 0;
+ int len = sha.length < 8 ? sha.length : 8;
+ for (int i = 0; i < len; i++)
+ result += (long) (sha[i] & 0xFF) << (8 * i);
- // Returns the value of CLAZZ's private static final field named
- // `serialPersistentFields'.
- private ObjectStreamField[] getSerialPersistentFields (Class clazz)
- {
- ObjectStreamField[] o = null;
- try
- {
- // Use getDeclaredField rather than getField for the same reason
- // as above in getDefinedSUID.
- Field f = clazz.getDeclaredField ("serialPersistentFields");
- f.setAccessible(true);
- o = (ObjectStreamField[])f.get (null);
+ return result;
}
- catch (java.lang.NoSuchFieldException e)
+ catch (NoSuchAlgorithmException e)
{
+ throw new RuntimeException
+ ("The SHA algorithm was not found to use in computing the Serial Version UID for class "
+ + cl.getName(), e);
}
- catch (java.lang.IllegalAccessException e)
+ catch (IOException ioe)
{
+ throw new RuntimeException(ioe);
}
+ }
+
+ /**
+ * Returns the value of CLAZZ's private static final field named
+ * `serialPersistentFields'. It performs some sanity checks before
+ * returning the real array. Besides, the returned array is a clean
+ * copy of the original. So it can be modified.
+ *
+ * @param clazz Class to retrieve 'serialPersistentFields' from.
+ * @return The content of 'serialPersistentFields'.
+ */
+ private ObjectStreamField[] getSerialPersistentFields(Class clazz)
+ throws NoSuchFieldException, IllegalAccessException
+ {
+ ObjectStreamField[] fieldsArray = null;
+ ObjectStreamField[] o;
+
+ // Use getDeclaredField rather than getField for the same reason
+ // as above in getDefinedSUID.
+ Field f = clazz.getDeclaredField("serialPersistentFields");
+ f.setAccessible(true);
+
+ int modifiers = f.getModifiers();
+ if (!(Modifier.isStatic(modifiers) &&
+ Modifier.isFinal(modifiers) &&
+ Modifier.isPrivate(modifiers)))
+ return null;
+
+ o = (ObjectStreamField[]) f.get(null);
+
+ if (o == null)
+ return null;
- return o;
+ fieldsArray = new ObjectStreamField[ o.length ];
+ System.arraycopy(o, 0, fieldsArray, 0, o.length);
+
+ return fieldsArray;
}
public static final ObjectStreamField[] NO_FIELDS = {};
- private static Hashtable classLookupTable = new Hashtable ();
- private static final NullOutputStream nullOutputStream = new NullOutputStream ();
- private static final Comparator interfaceComparator = new InterfaceComparator ();
- private static final Comparator memberComparator = new MemberComparator ();
+ private static Hashtable classLookupTable = new Hashtable();
+ private static final NullOutputStream nullOutputStream = new NullOutputStream();
+ private static final Comparator interfaceComparator = new InterfaceComparator();
+ private static final Comparator memberComparator = new MemberComparator();
private static final
Class[] writeMethodArgTypes = { java.io.ObjectOutputStream.class };
@@ -668,9 +781,9 @@ public class ObjectStreamClass implements Serializable
// interfaces are compared only by name
class InterfaceComparator implements Comparator
{
- public int compare (Object o1, Object o2)
+ public int compare(Object o1, Object o2)
{
- return ((Class)o1).getName ().compareTo (((Class)o2).getName ());
+ return ((Class) o1).getName().compareTo(((Class) o2).getName());
}
}
@@ -679,16 +792,16 @@ class InterfaceComparator implements Comparator
// conflicts are resolved by comparing type signatures
class MemberComparator implements Comparator
{
- public int compare (Object o1, Object o2)
+ public int compare(Object o1, Object o2)
{
- Member m1 = (Member)o1;
- Member m2 = (Member)o2;
+ Member m1 = (Member) o1;
+ Member m2 = (Member) o2;
- int comp = m1.getName ().compareTo (m2.getName ());
+ int comp = m1.getName().compareTo(m2.getName());
if (comp == 0)
- return TypeSignature.getEncodingOfMember (m1).
- compareTo (TypeSignature.getEncodingOfMember (m2));
+ return TypeSignature.getEncodingOfMember(m1).
+ compareTo(TypeSignature.getEncodingOfMember(m2));
else
return comp;
}
diff --git a/libjava/java/io/ObjectStreamField.java b/libjava/java/io/ObjectStreamField.java
index 9edb1dc4cc4..cb2fdbc0d25 100644
--- a/libjava/java/io/ObjectStreamField.java
+++ b/libjava/java/io/ObjectStreamField.java
@@ -40,7 +40,11 @@ package java.io;
import gnu.java.lang.reflect.TypeSignature;
-// XXX doc
+/**
+ * This class intends to describe the field of a class for the serialization
+ * subsystem. Serializable fields in a serializable class can be explicitly
+ * exported using an array of ObjectStreamFields.
+ */
public class ObjectStreamField implements Comparable
{
private String name;
@@ -48,14 +52,35 @@ public class ObjectStreamField implements Comparable
private String typename;
private int offset = -1; // XXX make sure this is correct
private boolean unshared;
-
+ private boolean persistent = false;
+ private boolean toset = true;
+
+ /**
+ * This constructor creates an ObjectStreamField instance
+ * which represents a field named <code>name</code> and is
+ * of the type <code>type</code>.
+ *
+ * @param name Name of the field to export.
+ * @param type Type of the field in the concerned class.
+ */
public ObjectStreamField (String name, Class type)
{
this (name, type, false);
}
+ /**
+ * This constructor creates an ObjectStreamField instance
+ * which represents a field named <code>name</code> and is
+ * of the type <code>type</code>.
+ *
+ * @param name Name of the field to export.
+ * @param type Type of the field in the concerned class.
+ */
public ObjectStreamField (String name, Class type, boolean unshared)
{
+ if (name == null)
+ throw new NullPointerException();
+
this.name = name;
this.type = type;
this.typename = TypeSignature.getEncodingOfClass(type);
@@ -63,11 +88,15 @@ public class ObjectStreamField implements Comparable
}
/**
- * There're many cases you can't get java.lang.Class from typename
- * if your context
- * class loader can't load it, then use typename to construct the field
+ * There are many cases you can not get java.lang.Class from typename
+ * if your context class loader cann not load it, then use typename to
+ * construct the field.
+ *
+ * @param name Name of the field to export.
+ * @param typename The coded name of the type for this field.
*/
- ObjectStreamField (String name, String typename){
+ ObjectStreamField (String name, String typename)
+ {
this.name = name;
this.typename = typename;
try
@@ -80,42 +109,120 @@ public class ObjectStreamField implements Comparable
}
}
+ /**
+ * There are many cases you can not get java.lang.Class from typename
+ * if your context class loader cann not load it, then use typename to
+ * construct the field.
+ *
+ * @param name Name of the field to export.
+ * @param typename The coded name of the type for this field.
+ * @param loader The class loader to use to resolve class names.
+ */
+ ObjectStreamField (String name, String typename, ClassLoader loader)
+ {
+ this.name = name;
+ this.typename = typename;
+ try
+ {
+ type = TypeSignature.getClassForEncoding(typename, true, loader);
+ }
+ catch(ClassNotFoundException e)
+ {
+ type = Object.class; // ALSO FIXME
+ }
+ }
+
+ /**
+ * This method returns the name of the field represented by the
+ * ObjectStreamField instance.
+ *
+ * @return A string containing the name of the field.
+ */
public String getName ()
{
return name;
}
+ /**
+ * This method returns the class representing the type of the
+ * field which is represented by this instance of ObjectStreamField.
+ *
+ * @return A class representing the type of the field.
+ */
public Class getType ()
{
return type;
}
+ /**
+ * This method returns the char encoded type of the field which
+ * is represented by this instance of ObjectStreamField.
+ *
+ * @return A char representing the type of the field.
+ */
public char getTypeCode ()
{
return typename.charAt (0);
}
+ /**
+ * This method returns a more explicit type name than
+ * {@link #getTypeCode()} in the case the type is a real
+ * class (and not a primitive).
+ *
+ * @return The name of the type (class name) if it is not a
+ * primitive, in the other case null is returned.
+ */
public String getTypeString ()
{
// use intern()
+ if (this.type.isPrimitive())
+ return null;
return typename.intern();
}
+ /**
+ * This method returns the current offset of the field in
+ * the serialization stream relatively to the other fields.
+ * The offset is expressed in bytes.
+ *
+ * @return The offset of the field in bytes.
+ * @see #setOffset(int)
+ */
public int getOffset ()
{
return offset;
}
+ /**
+ * This method sets the current offset of the field.
+ *
+ * @param off The offset of the field in bytes.
+ * @see getOffset()
+ */
protected void setOffset (int off)
{
offset = off;
}
+ /**
+ * This method returns whether the field represented by this object is
+ * unshared or not.
+ *
+ * @return Tells if this field is unshared or not.
+ */
public boolean isUnshared ()
{
return unshared;
}
+ /**
+ * This method returns true if the type of the field
+ * represented by this instance is a primitive.
+ *
+ * @return true if the type is a primitive, false
+ * in the other case.
+ */
public boolean isPrimitive ()
{
return type.isPrimitive ();
@@ -136,6 +243,58 @@ public class ObjectStreamField implements Comparable
return getName ().compareTo (f.getName ());
}
+ /**
+ * This method is specific to classpath's implementation and so has the default
+ * access. It changes the state of this field to "persistent". It means that
+ * the field should not be changed when the stream is read (if it is not
+ * explicitly specified using serialPersistentFields).
+ *
+ * @param persistent True if the field is persistent, false in the
+ * other cases.
+ * @see #isPersistent()
+ */
+ void setPersistent(boolean persistent)
+ {
+ this.persistent = persistent;
+ }
+
+ /**
+ * This method returns true if the field is marked as persistent.
+ *
+ * @return True if persistent, false in the other cases.
+ * @see #setPersistent(boolean)
+ */
+ boolean isPersistent()
+ {
+ return persistent;
+ }
+
+ /**
+ * This method is specific to classpath's implementation and so
+ * has the default access. It changes the state of this field as
+ * to be set by ObjectInputStream.
+ *
+ * @param toset True if this field should be set, false in the other
+ * cases.
+ * @see #isToSet()
+ */
+ void setToSet(boolean toset)
+ {
+ this.toset = toset;
+ }
+
+ /**
+ * This methods returns true if the field is marked as to be
+ * set.
+ *
+ * @return True if it is to be set, false in the other cases.
+ * @see #setToSet(boolean)
+ */
+ boolean isToSet()
+ {
+ return toset;
+ }
+
public String toString ()
{
return "ObjectStreamField< " + type + " " + name + " >";
diff --git a/libjava/java/io/PrintStream.java b/libjava/java/io/PrintStream.java
index d2a211744e2..2e9bfc4c22f 100644
--- a/libjava/java/io/PrintStream.java
+++ b/libjava/java/io/PrintStream.java
@@ -38,6 +38,8 @@ exception statement from your version. */
package java.io;
+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: Believed complete and correct to 1.3
@@ -58,6 +60,21 @@ package java.io;
*/
public class PrintStream extends FilterOutputStream
{
+ /* Notice the implementation is quite similar to OutputStreamWriter.
+ * This leads to some minor duplication, because neither inherits
+ * from the other, and we want to maximize performance. */
+
+ // Line separator string.
+ private static final char[] line_separator
+ = System.getProperty("line.separator").toCharArray();
+
+ 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];
+
/**
* This boolean indicates whether or not an error has ever occurred
* on this stream.
@@ -71,16 +88,6 @@ public class PrintStream extends FilterOutputStream
private boolean auto_flush;
/**
- * The PrintWriter instance this object writes to
- */
- private PrintWriter pw;
-
- /**
- * Lets us know if the stream is closed
- */
- private boolean closed;
-
- /**
* This method intializes a new <code>PrintStream</code> object to write
* to the specified output sink.
*
@@ -108,7 +115,7 @@ public class PrintStream extends FilterOutputStream
{
super (out);
- pw = new PrintWriter (out, auto_flush);
+ converter = UnicodeToBytes.getDefaultEncoder();
this.auto_flush = auto_flush;
}
@@ -132,7 +139,7 @@ public class PrintStream extends FilterOutputStream
{
super (out);
- pw = new PrintWriter (new OutputStreamWriter (out, encoding), auto_flush);
+ converter = UnicodeToBytes.getEncoder (encoding);
this.auto_flush = auto_flush;
}
@@ -147,10 +154,8 @@ public class PrintStream extends FilterOutputStream
*/
public boolean checkError ()
{
- if (!closed)
- flush ();
-
- return error_occurred | pw.checkError ();
+ flush ();
+ return error_occurred;
}
/**
@@ -167,8 +172,19 @@ public class PrintStream extends FilterOutputStream
*/
public void close ()
{
- pw.close ();
- closed = true;
+ try
+ {
+ flush();
+ out.close();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
}
/**
@@ -177,7 +193,85 @@ public class PrintStream extends FilterOutputStream
*/
public void flush ()
{
- pw.flush();
+ try
+ {
+ out.flush();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
+ }
+
+ private synchronized void print (String str, boolean println)
+ {
+ try
+ {
+ writeChars(str, 0, str.length());
+ if (println)
+ writeChars(line_separator, 0, line_separator.length);
+ if (auto_flush)
+ flush();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
+ }
+
+ private synchronized void print (char[] chars, int pos, int len,
+ boolean println)
+ {
+ try
+ {
+ writeChars(chars, pos, len);
+ if (println)
+ writeChars(line_separator, 0, line_separator.length);
+ if (auto_flush)
+ flush();
+ }
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread().interrupt();
+ }
+ catch (IOException e)
+ {
+ setError ();
+ }
+ }
+
+ private void writeChars(char[] buf, int offset, int count)
+ throws IOException
+ {
+ while (count > 0 || converter.havePendingBytes())
+ {
+ converter.setOutput(work_bytes, 0);
+ int converted = converter.write(buf, offset, count);
+ offset += converted;
+ count -= converted;
+ out.write(work_bytes, 0, converter.count);
+ }
+ }
+
+ private void writeChars(String str, int offset, int count)
+ throws IOException
+ {
+ while (count > 0 || converter.havePendingBytes())
+ {
+ converter.setOutput(work_bytes, 0);
+ int converted = converter.write(str, offset, count, work);
+ offset += converted;
+ count -= converted;
+ out.write(work_bytes, 0, converter.count);
+ }
}
/**
@@ -189,7 +283,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (boolean bool)
{
- print (String.valueOf (bool));
+ print(String.valueOf(bool), false);
}
/**
@@ -200,7 +294,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (int inum)
{
- print (String.valueOf (inum));
+ print(String.valueOf(inum), false);
}
/**
@@ -211,7 +305,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (long lnum)
{
- print (String.valueOf (lnum));
+ print(String.valueOf(lnum), false);
}
/**
@@ -222,7 +316,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (float fnum)
{
- print (String.valueOf (fnum));
+ print(String.valueOf(fnum), false);
}
/**
@@ -233,7 +327,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (double dnum)
{
- print (String.valueOf (dnum));
+ print(String.valueOf(dnum), false);
}
/**
@@ -245,9 +339,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (Object obj)
{
- // Don't call pw directly. Convert to String so we scan for newline
- // characters on auto-flush;
- print (String.valueOf (obj));
+ print(obj == null ? "null" : obj.toString(), false);
}
/**
@@ -258,10 +350,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (String str)
{
- pw.print (str);
-
- if (auto_flush)
- flush ();
+ print(str == null ? "null" : str, false);
}
/**
@@ -270,9 +359,10 @@ public class PrintStream extends FilterOutputStream
*
* @param ch The <code>char</code> value to be printed
*/
- public void print (char ch)
+ public synchronized void print (char ch)
{
- print (String.valueOf (ch));
+ work[0] = ch;
+ print(work, 0, 1, false);
}
/**
@@ -283,7 +373,7 @@ public class PrintStream extends FilterOutputStream
*/
public void print (char[] charArray)
{
- pw.print (charArray);
+ print(charArray, 0, charArray.length, false);
}
/**
@@ -293,7 +383,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println ()
{
- pw.println();
+ print(line_separator, 0, line_separator.length, false);
}
/**
@@ -307,7 +397,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (boolean bool)
{
- println (String.valueOf (bool));
+ print(String.valueOf(bool), true);
}
/**
@@ -320,7 +410,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (int inum)
{
- println (String.valueOf (inum));
+ print(String.valueOf(inum), true);
}
/**
@@ -333,7 +423,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (long lnum)
{
- println (String.valueOf (lnum));
+ print(String.valueOf(lnum), true);
}
/**
@@ -346,7 +436,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (float fnum)
{
- println (String.valueOf (fnum));
+ print(String.valueOf(fnum), true);
}
/**
@@ -359,7 +449,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (double dnum)
{
- println (String.valueOf (dnum));
+ print(String.valueOf(dnum), true);
}
/**
@@ -373,7 +463,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (Object obj)
{
- println (String.valueOf (obj));
+ print(obj == null ? "null" : obj.toString(), true);
}
/**
@@ -386,7 +476,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (String str)
{
- pw.println (str);
+ print (str == null ? "null" : str, true);
}
/**
@@ -397,9 +487,10 @@ public class PrintStream extends FilterOutputStream
*
* @param ch The <code>char</code> value to be printed
*/
- public void println (char ch)
+ public synchronized void println (char ch)
{
- println (String.valueOf (ch));
+ work[0] = ch;
+ print(work, 0, 1, true);
}
/**
@@ -412,7 +503,7 @@ public class PrintStream extends FilterOutputStream
*/
public void println (char[] charArray)
{
- pw.println (charArray);
+ print(charArray, 0, charArray.length, true);
}
/**
@@ -424,10 +515,6 @@ public class PrintStream extends FilterOutputStream
*/
public void write (int oneByte)
{
- // We actually have to implement this method. Flush first so that
- // things get written in the right order.
- flush();
-
try
{
out.write (oneByte & 0xff);
@@ -435,6 +522,10 @@ public class PrintStream extends FilterOutputStream
if (auto_flush && (oneByte == '\n'))
flush ();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread ().interrupt ();
+ }
catch (IOException e)
{
setError ();
@@ -451,10 +542,6 @@ public class PrintStream extends FilterOutputStream
*/
public void write (byte[] buffer, int offset, int len)
{
- // We actually have to implement this method too. Flush first so that
- // things get written in the right order.
- flush();
-
try
{
out.write (buffer, offset, len);
@@ -462,6 +549,10 @@ public class PrintStream extends FilterOutputStream
if (auto_flush)
flush ();
}
+ catch (InterruptedIOException iioe)
+ {
+ Thread.currentThread ().interrupt ();
+ }
catch (IOException e)
{
setError ();
diff --git a/libjava/java/io/StreamTokenizer.java b/libjava/java/io/StreamTokenizer.java
index 94341fa7620..a77b699ff17 100644
--- a/libjava/java/io/StreamTokenizer.java
+++ b/libjava/java/io/StreamTokenizer.java
@@ -1,5 +1,5 @@
/* StreamTokenizer.java -- parses streams of characters into tokens
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation
This file is part of GNU Classpath.
@@ -167,14 +167,21 @@ public class StreamTokenizer
}
/**
- * This method sets the comment attribute on the specified character.
+ * This method sets the comment attribute on the specified
+ * character. Other attributes for the character are cleared.
*
* @param c The character to set the comment attribute for, passed as an int
*/
public void commentChar(int ch)
{
if (ch >= 0 && ch <= 255)
- comment[ch] = true;
+ {
+ comment[ch] = true;
+ whitespace[ch] = false;
+ alphabetic[ch] = false;
+ numeric[ch] = false;
+ quote[ch] = false;
+ }
}
/**
@@ -566,13 +573,20 @@ public class StreamTokenizer
/**
* This method sets the quote attribute on the specified character.
+ * Other attributes for the character are cleared.
*
* @param c The character to set the quote attribute for, passed as an int.
*/
public void quoteChar(int ch)
{
if (ch >= 0 && ch <= 255)
- quote[ch] = true;
+ {
+ quote[ch] = true;
+ comment[ch] = false;
+ whitespace[ch] = false;
+ alphabetic[ch] = false;
+ numeric[ch] = false;
+ }
}
/**
diff --git a/libjava/java/io/natFileDescriptorWin32.cc b/libjava/java/io/natFileDescriptorWin32.cc
index 1891bf78e42..7811a73f493 100644
--- a/libjava/java/io/natFileDescriptorWin32.cc
+++ b/libjava/java/io/natFileDescriptorWin32.cc
@@ -87,7 +87,7 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
DWORD access = 0;
DWORD create = OPEN_EXISTING;
- JV_TEMP_UTF_STRING(cpath, path)
+ JV_TEMP_STRING_WIN32(cpath, path)
JvAssert((jflags & READ) || (jflags & WRITE));
@@ -115,7 +115,8 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
create = CREATE_ALWAYS;
}
- handle = CreateFile(cpath, access, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, create, 0, NULL);
+ handle = CreateFile(cpath, access, FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL, create, 0, NULL);
if (handle == INVALID_HANDLE_VALUE)
{
@@ -133,7 +134,13 @@ java::io::FileDescriptor::open (jstring path, jint jflags) {
throw new FileNotFoundException (_Jv_WinStrError (cpath, dwErrorCode));
}
}
- return (jint)handle;
+
+ // Make this handle non-inheritable so that child
+ // processes don't inadvertently prevent us from
+ // closing this file.
+ _Jv_platform_close_on_exec (handle);
+
+ return (jint) handle;
}
void
@@ -168,13 +175,14 @@ java::io::FileDescriptor::write(jbyteArray b, jint offset, jint len)
jbyte *buf = elements (b) + offset;
DWORD bytesWritten;
+
if (WriteFile ((HANDLE)fd, buf, len, &bytesWritten, NULL))
{
if (java::lang::Thread::interrupted())
{
InterruptedIOException *iioe = new InterruptedIOException (JvNewStringLatin1 ("write interrupted"));
iioe->bytesTransferred = bytesWritten;
- throw iioe;
+ throw iioe;
}
}
else
diff --git a/libjava/java/io/natFileWin32.cc b/libjava/java/io/natFileWin32.cc
index cee6b00ae1f..cff86dda7e9 100644
--- a/libjava/java/io/natFileWin32.cc
+++ b/libjava/java/io/natFileWin32.cc
@@ -40,7 +40,7 @@ details. */
jboolean
java::io::File::_access (jint query)
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -54,13 +54,14 @@ java::io::File::_access (jint query)
if ((query == EXISTS) || (query == READ))
return (attributes == 0xffffffff) ? false : true;
else
- return ((attributes != 0xffffffff) && ((attributes & FILE_ATTRIBUTE_READONLY) == 0)) ? true : false;
+ return ((attributes != 0xffffffff) &&
+ ((attributes & FILE_ATTRIBUTE_READONLY) == 0)) ? true : false;
}
jboolean
java::io::File::_stat (jint query)
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -79,7 +80,7 @@ java::io::File::_stat (jint query)
jlong
java::io::File::attr (jint query)
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -108,16 +109,19 @@ java::io::File::attr (jint query)
jstring
java::io::File::getCanonicalPath (void)
{
- JV_TEMP_UTF_STRING (cpath, path);
+ JV_TEMP_STRING_WIN32 (cpath, path);
+
+ // If the filename is blank, use the current directory.
+ LPCTSTR thepath = cpath.buf();
+ if (*thepath == 0)
+ thepath = _T(".");
LPTSTR unused;
- char buf2[MAX_PATH];
- if(!GetFullPathName(cpath, MAX_PATH, buf2, &unused))
+ TCHAR buf2[MAX_PATH];
+ if(!GetFullPathName(thepath, MAX_PATH, buf2, &unused))
throw new IOException (JvNewStringLatin1 ("GetFullPathName failed"));
- // FIXME: what encoding to assume for file names? This affects many
- // calls.
- return JvNewStringUTF(buf2);
+ return _Jv_Win32NewString (buf2);
}
jboolean
@@ -156,12 +160,17 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jstring canon = getCanonicalPath();
if (! canon)
return NULL;
- char *buf = (char *) __builtin_alloca (JvGetStringUTFLength (canon) + 5);
- jsize total = JvGetStringUTFRegion (canon, 0, canon->length(), buf);
- if (buf[total-1] == '\\')
- strcpy (&buf[total], "*.*");
+
+ int len = canon->length();
+ TCHAR buf[len + 5];
+
+ JV_TEMP_STRING_WIN32(canonstr, canon);
+
+ _tcscpy(buf, canonstr);
+ if (buf[len - 1] == _T('\\'))
+ _tcscpy (&buf[len], _T("*.*"));
else
- strcpy (&buf[total], "\\*.*");
+ _tcscpy (&buf[len], _T("\\*.*"));
WIN32_FIND_DATA data;
HANDLE handle = FindFirstFile (buf, &data);
@@ -172,21 +181,22 @@ java::io::File::performList (java::io::FilenameFilter *filter,
do
{
- if (strcmp (data.cFileName, ".") && strcmp (data.cFileName, ".."))
+ if (_tcscmp (data.cFileName, _T(".")) &&
+ _tcscmp (data.cFileName, _T("..")))
{
- jstring name = JvNewStringUTF (data.cFileName);
+ jstring name = _Jv_Win32NewString (data.cFileName);
if (filter && !filter->accept(this, name))
- continue;
+ continue;
if (clazz == &java::io::File::class$)
- {
+ {
java::io::File *file = new java::io::File (this, name);
if (fileFilter && !fileFilter->accept(file))
- continue;
- vec->addElement (file);
- }
- else
- vec->addElement (name);
+ continue;
+ vec->addElement (file);
+ }
+ else
+ vec->addElement (name);
}
}
while (FindNextFile (handle, &data));
@@ -204,22 +214,22 @@ java::io::File::performList (java::io::FilenameFilter *filter,
jboolean
java::io::File::performMkdir (void)
{
- JV_TEMP_UTF_STRING (cpath, path);
+ JV_TEMP_STRING_WIN32 (cpath, path);
return (CreateDirectory(cpath, NULL)) ? true : false;
}
jboolean
java::io::File::performRenameTo (File *dest)
{
- JV_TEMP_UTF_STRING (pathFrom, path);
- JV_TEMP_UTF_STRING (pathTo, dest->path);
+ JV_TEMP_STRING_WIN32 (pathFrom, path);
+ JV_TEMP_STRING_WIN32 (pathTo, dest->path);
return (MoveFile(pathFrom, pathTo)) ? true : false;
}
jboolean
java::io::File::performDelete ()
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -235,7 +245,7 @@ java::io::File::performDelete ()
jboolean java::io::File::performCreate (void)
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -257,7 +267,7 @@ jboolean java::io::File::performCreate (void)
jboolean java::io::File::performSetReadOnly ()
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
@@ -275,7 +285,7 @@ jboolean java::io::File::performSetReadOnly ()
jboolean java::io::File::performSetLastModified (jlong time)
{
- JV_TEMP_UTF_STRING (canon, getCanonicalPath());
+ JV_TEMP_STRING_WIN32 (canon, getCanonicalPath());
if (!canon)
return false;
diff --git a/libjava/java/lang/Class.h b/libjava/java/lang/Class.h
index 01761af5cec..1577628cb98 100644
--- a/libjava/java/lang/Class.h
+++ b/libjava/java/lang/Class.h
@@ -446,7 +446,7 @@ private:
// Security Domain to which this class belongs (or null).
java::security::ProtectionDomain *protectionDomain;
// Signers of this class (or null).
- JArray<jobject> *signers;
+ JArray<jobject> *hack_signers;
// Used by Jv_PopClass and _Jv_PushClass to communicate with StackTrace.
jclass chain;
};
diff --git a/libjava/java/lang/Float.java b/libjava/java/lang/Float.java
index d3065f6b01c..78dab61572a 100644
--- a/libjava/java/lang/Float.java
+++ b/libjava/java/lang/Float.java
@@ -1,5 +1,5 @@
/* Float.java -- object wrapper for float
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,8 +38,6 @@ exception statement from your version. */
package java.lang;
-import gnu.classpath.Configuration;
-
/**
* Instances of class <code>Float</code> represent primitive
* <code>float</code> values.
@@ -102,17 +100,6 @@ public final class Float extends Number implements Comparable
private final float value;
/**
- * Load native routines necessary for this class.
- */
- static
- {
- if (Configuration.INIT_LOAD_LIBRARY)
- {
- System.loadLibrary("javalang");
- }
- }
-
- /**
* Create a <code>Float</code> from the primitive <code>float</code>
* specified.
*
diff --git a/libjava/java/lang/Win32Process.java b/libjava/java/lang/Win32Process.java
index 7a5872705b8..b0ef487c204 100644
--- a/libjava/java/lang/Win32Process.java
+++ b/libjava/java/lang/Win32Process.java
@@ -28,8 +28,6 @@ final class ConcreteProcess extends Process
{
public native void destroy ();
- public native boolean hasExited ();
-
public int exitValue ()
{
if (! hasExited ())
@@ -55,13 +53,6 @@ final class ConcreteProcess extends Process
public native int waitFor () throws InterruptedException;
- public native void startProcess (String[] progarray,
- String[] envp,
- File dir)
- throws IOException;
-
- public native void cleanup ();
-
public ConcreteProcess (String[] progarray,
String[] envp,
File dir)
@@ -89,4 +80,11 @@ final class ConcreteProcess extends Process
// Exit code of the child if it has exited.
private int exitCode;
+
+ private native boolean hasExited ();
+ private native void startProcess (String[] progarray,
+ String[] envp,
+ File dir)
+ throws IOException;
+ private native void cleanup ();
}
diff --git a/libjava/java/lang/natClass.cc b/libjava/java/lang/natClass.cc
index ffac2c1ff53..ba676ab65cd 100644
--- a/libjava/java/lang/natClass.cc
+++ b/libjava/java/lang/natClass.cc
@@ -71,7 +71,7 @@ java::lang::Class::forName (jstring className, jboolean initialize,
jsize length = _Jv_GetStringUTFLength (className);
char buffer[length];
- _Jv_GetStringUTFRegion (className, 0, length, buffer);
+ _Jv_GetStringUTFRegion (className, 0, className->length(), buffer);
_Jv_Utf8Const *name = _Jv_makeUtf8Const (buffer, length);
@@ -688,7 +688,7 @@ java::lang::Class::newInstance (void)
_Jv_Method *meth = _Jv_GetMethodLocal (this, init_name, void_signature);
if (! meth)
- throw new java::lang::NoSuchMethodException (_Jv_NewStringUtf8Const (init_name));
+ throw new java::lang::InstantiationException (getName());
jobject r = JvAllocObject (this);
((void (*) (jobject)) meth->ncode) (r);
@@ -1502,13 +1502,13 @@ java::lang::Class::getProtectionDomain0 ()
JArray<jobject> *
java::lang::Class::getSigners()
{
- return signers;
+ return hack_signers;
}
void
java::lang::Class::setSigners(JArray<jobject> *s)
{
- signers = s;
+ hack_signers = s;
}
// Functions for indirect dispatch (symbolic virtual binding) support.
@@ -1835,6 +1835,12 @@ _Jv_LayoutVTableMethods (jclass klass)
if (! _Jv_isVirtualMethod (meth))
continue;
+ // FIXME: Must check that we don't override:
+ // - Package-private method where superclass is in different package.
+ // - Final or less-accessible declaration in superclass (check binary
+ // spec, do we allocate new vtable entry or put throw node in vtable?)
+ // - Static or private method in superclass.
+
if (superclass != NULL)
{
super_meth = _Jv_LookupDeclaredMethod (superclass, meth->name,
@@ -1843,8 +1849,7 @@ _Jv_LayoutVTableMethods (jclass klass)
if (super_meth)
meth->index = super_meth->index;
- else if (! (meth->accflags & java::lang::reflect::Modifier::FINAL)
- && ! (klass->accflags & java::lang::reflect::Modifier::FINAL))
+ else
meth->index = index++;
}
diff --git a/libjava/java/lang/natDouble.cc b/libjava/java/lang/natDouble.cc
index 329795d3e21..dfec5967a9b 100644
--- a/libjava/java/lang/natDouble.cc
+++ b/libjava/java/lang/natDouble.cc
@@ -1,6 +1,6 @@
// natDouble.cc - Implementation of java.lang.Double native methods.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation
This file is part of libgcj.
diff --git a/libjava/java/lang/natPosixProcess.cc b/libjava/java/lang/natPosixProcess.cc
index ec3eccb221e..ef469242fd6 100644
--- a/libjava/java/lang/natPosixProcess.cc
+++ b/libjava/java/lang/natPosixProcess.cc
@@ -1,6 +1,6 @@
// natPosixProcess.cc - Native side of POSIX process code.
-/* Copyright (C) 1998, 1999, 2000, 2002 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2002, 2003 Free Software Foundation
This file is part of libgcj.
@@ -82,7 +82,7 @@ new_string (jstring string)
{
jsize s = _Jv_GetStringUTFLength (string);
char *buf = (char *) _Jv_Malloc (s + 1);
- _Jv_GetStringUTFRegion (string, 0, s, buf);
+ _Jv_GetStringUTFRegion (string, 0, string->length(), buf);
buf[s] = '\0';
return buf;
}
diff --git a/libjava/java/lang/natRuntime.cc b/libjava/java/lang/natRuntime.cc
index b86da32f8f3..9b54874c1c4 100644
--- a/libjava/java/lang/natRuntime.cc
+++ b/libjava/java/lang/natRuntime.cc
@@ -67,7 +67,7 @@ struct lookup_data
};
static int
-find_symbol (lt_dlhandle handle, lt_ptr_t data)
+find_symbol (lt_dlhandle handle, lt_ptr data)
{
lookup_data *ld = (lookup_data *) data;
ld->result = lt_dlsym (handle, ld->symname);
@@ -80,7 +80,7 @@ _Jv_FindSymbolInExecutable (const char *symname)
lookup_data data;
data.symname = symname;
data.result = NULL;
- lt_dlforeach (find_symbol, (lt_ptr_t) &data);
+ lt_dlforeach (find_symbol, (lt_ptr) &data);
return data.result;
}
diff --git a/libjava/java/lang/natWin32Process.cc b/libjava/java/lang/natWin32Process.cc
index 49fa853a398..7337ab34969 100644
--- a/libjava/java/lang/natWin32Process.cc
+++ b/libjava/java/lang/natWin32Process.cc
@@ -29,23 +29,29 @@ details. */
void
java::lang::ConcreteProcess::cleanup (void)
{
- if (inputStream != NULL)
- {
- inputStream->close ();
- inputStream = NULL;
- }
-
- if (outputStream != NULL)
- {
- outputStream->close ();
- outputStream = NULL;
- }
-
- if (errorStream != NULL)
- {
- errorStream->close ();
- errorStream = NULL;
- }
+ // FIXME:
+ // We used to close the input, output and
+ // error streams here, but we can't do that
+ // because the caller also has the right
+ // to close these and FileInputStream and FileOutputStream
+ // scream if you attempt to close() them twice. Presently,
+ // we use _Jv_platform_close_on_exec, which is similar
+ // to the POSIX approach.
+ //
+ // What I wanted to do is have private nested
+ // classes in ConcreteProcess which extend FileInputStream
+ // and FileOutputStream, respectively, but override
+ // close() to permit multiple calls to close(). This
+ // led to class header and platform configury issues
+ // that I didn't feel like dealing with. However,
+ // this approach could conceivably be a good multiplatform
+ // one since delaying the pipe close until process
+ // termination could be wasteful if many child processes
+ // are spawned within the parent process' lifetime.
+ inputStream = NULL;
+ outputStream = NULL;
+ errorStream = NULL;
+
if (procHandle)
{
CloseHandle((HANDLE) procHandle);
@@ -129,6 +135,76 @@ java::lang::ConcreteProcess::waitFor (void)
return exitCode;
}
+
+// Helper class for creating and managing the pipes
+// used for I/O redirection for child processes.
+class ChildProcessPipe
+{
+public:
+ // Indicates from the child process' point of view
+ // whether the pipe is for reading or writing.
+ enum EType {INPUT, OUTPUT};
+
+ ChildProcessPipe(EType eType);
+ ~ChildProcessPipe();
+
+ // Returns a pipe handle suitable for use by the parent process
+ HANDLE getParentHandle();
+
+ // Returns a pipe handle suitable for use by the child process.
+ HANDLE getChildHandle();
+
+private:
+ EType m_eType;
+ HANDLE m_hRead, m_hWrite;
+};
+
+ChildProcessPipe::ChildProcessPipe(EType eType):
+ m_eType(eType)
+{
+ SECURITY_ATTRIBUTES sAttrs;
+
+ // Explicitly allow the handles to the pipes to be inherited.
+ sAttrs.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sAttrs.bInheritHandle = 1;
+ sAttrs.lpSecurityDescriptor = NULL;
+
+ if (CreatePipe (&m_hRead, &m_hWrite, &sAttrs, 0) == 0)
+ {
+ DWORD dwErrorCode = GetLastError ();
+ throw new java::io::IOException (
+ _Jv_WinStrError (_T("Error creating pipe"), dwErrorCode));
+ }
+
+ // If this is the read end of the child, we need
+ // to make the parent write end non-inheritable. Similarly,
+ // if this is the write end of the child, we need to make
+ // the parent read end non-inheritable. If we didn't
+ // do this, the child would inherit these ends and we wouldn't
+ // be able to close them from our end. For full details,
+ // do a Google search on "Q190351".
+ HANDLE& rhStd = m_eType==INPUT ? m_hWrite : m_hRead;
+ _Jv_platform_close_on_exec (rhStd);
+}
+
+ChildProcessPipe::~ChildProcessPipe()
+{
+ // Close the parent end of the pipe. This
+ // destructor is called after the child process
+ // has been spawned.
+ CloseHandle(getChildHandle());
+}
+
+HANDLE ChildProcessPipe::getParentHandle()
+{
+ return m_eType==INPUT ? m_hWrite : m_hRead;
+}
+
+HANDLE ChildProcessPipe::getChildHandle()
+{
+ return m_eType==INPUT ? m_hRead : m_hWrite;
+}
+
void
java::lang::ConcreteProcess::startProcess (jstringArray progarray,
jstringArray envp,
@@ -144,48 +220,53 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
int cmdLineLen = 0;
for (int i = 0; i < progarray->length; ++i)
- cmdLineLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
+ cmdLineLen += (elts[i]->length() + 1);
- char *cmdLine = (char *) _Jv_Malloc (cmdLineLen + 1);
- char *cmdLineCurPos = cmdLine;
+ LPTSTR cmdLine = (LPTSTR) _Jv_Malloc ((cmdLineLen + 1) * sizeof(TCHAR));
+ LPTSTR cmdLineCurPos = cmdLine;
for (int i = 0; i < progarray->length; ++i)
{
if (i > 0)
- *cmdLineCurPos++ = ' ';
- jsize s = _Jv_GetStringUTFLength (elts[i]);
- _Jv_GetStringUTFRegion (elts[i], 0, s, cmdLineCurPos);
- cmdLineCurPos += s;
+ *cmdLineCurPos++ = _T(' ');
+
+ jint len = elts[i]->length();
+ JV_TEMP_STRING_WIN32(thiselt, elts[i]);
+ _tcscpy(cmdLineCurPos, thiselt);
+ cmdLineCurPos += len;
}
- *cmdLineCurPos = '\0';
+ *cmdLineCurPos = _T('\0');
// Get the environment, if any.
- char *env = NULL;
+ LPTSTR env = NULL;
if (envp)
{
elts = elements (envp);
int envLen = 0;
for (int i = 0; i < envp->length; ++i)
- envLen += (_Jv_GetStringUTFLength (elts[i]) + 1);
+ envLen += (elts[i]->length() + 1);
- env = (char *) _Jv_Malloc (envLen + 1);
+ env = (LPTSTR) _Jv_Malloc ((envLen + 1) * sizeof(TCHAR));
int j = 0;
for (int i = 0; i < envp->length; ++i)
{
- jsize s = _Jv_GetStringUTFLength (elts[i]);
- _Jv_GetStringUTFRegion (elts[i], 0, s, (env + j));
-
- j += s;
- *(env + j) = '\0';
+ jint len = elts[i]->length();
+
+ JV_TEMP_STRING_WIN32(thiselt, elts[i]);
+ _tcscpy(env + j, thiselt);
+
+ j += len;
+
+ // Skip past the null terminator that _tcscpy just inserted.
j++;
}
- *(env + j) = '\0';
+ *(env + j) = _T('\0');
}
// Get the working directory path, if specified.
- JV_TEMP_UTF_STRING (wdir, dir ? dir->getPath () : 0);
+ JV_TEMP_STRING_WIN32 (wdir, dir ? dir->getPath () : 0);
errorStream = NULL;
inputStream = NULL;
@@ -197,46 +278,16 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
{
// We create anonymous pipes to communicate with the child
// on each of standard streams.
+ ChildProcessPipe aChildStdIn(ChildProcessPipe::INPUT);
+ ChildProcessPipe aChildStdOut(ChildProcessPipe::OUTPUT);
+ ChildProcessPipe aChildStdErr(ChildProcessPipe::OUTPUT);
- HANDLE cldStdInRd, cldStdInWr;
- HANDLE cldStdOutRd, cldStdOutWr;
- HANDLE cldStdErrRd, cldStdErrWr;
-
- SECURITY_ATTRIBUTES sAttrs;
-
- // Explicitly allow the handles to the pipes to be inherited.
- sAttrs.nLength = sizeof (SECURITY_ATTRIBUTES);
- sAttrs.bInheritHandle = 1;
- sAttrs.lpSecurityDescriptor = NULL;
-
-
- if (CreatePipe (&cldStdInRd, &cldStdInWr, &sAttrs, 0) == 0)
- {
- DWORD dwErrorCode = GetLastError ();
- throw new IOException (_Jv_WinStrError ("Error creating stdin pipe",
- dwErrorCode));
- }
-
- if (CreatePipe (&cldStdOutRd, &cldStdOutWr, &sAttrs, 0) == 0)
- {
- DWORD dwErrorCode = GetLastError ();
- throw new IOException (_Jv_WinStrError ("Error creating stdout pipe",
- dwErrorCode));
- }
-
- if (CreatePipe (&cldStdErrRd, &cldStdErrWr, &sAttrs, 0) == 0)
- {
- DWORD dwErrorCode = GetLastError ();
- throw new IOException (_Jv_WinStrError ("Error creating stderr pipe",
- dwErrorCode));
- }
-
- outputStream = new FileOutputStream
- (new FileDescriptor ((jint) cldStdInWr));
- inputStream = new FileInputStream
- (new FileDescriptor ((jint) cldStdOutRd));
- errorStream = new FileInputStream
- (new FileDescriptor ((jint) cldStdErrRd));
+ outputStream = new FileOutputStream (new FileDescriptor (
+ (jint) aChildStdIn.getParentHandle ()));
+ inputStream = new FileInputStream (new FileDescriptor (
+ (jint) aChildStdOut.getParentHandle ()));
+ errorStream = new FileInputStream (new FileDescriptor (
+ (jint) aChildStdErr.getParentHandle ()));
// Now create the child process.
PROCESS_INFORMATION pi;
@@ -250,16 +301,21 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
// Explicitly specify the handles to the standard streams.
si.dwFlags |= STARTF_USESTDHANDLES;
- si.hStdInput = cldStdInRd;
- si.hStdOutput = cldStdOutWr;
- si.hStdError = cldStdErrWr;
+ si.hStdInput = aChildStdIn.getChildHandle();
+ si.hStdOutput = aChildStdOut.getChildHandle();
+ si.hStdError = aChildStdErr.getChildHandle();
+ // Spawn the process. CREATE_NO_WINDOW only applies when
+ // starting a console application; it suppresses the
+ // creation of a console window. This flag is ignored on
+ // Win9X.
+
if (CreateProcess (NULL,
cmdLine,
NULL,
NULL,
1,
- 0,
+ CREATE_NO_WINDOW | CREATE_UNICODE_ENVIRONMENT,
env,
wdir,
&si,
@@ -267,16 +323,11 @@ java::lang::ConcreteProcess::startProcess (jstringArray progarray,
{
DWORD dwErrorCode = GetLastError ();
throw new IOException (
- _Jv_WinStrError ("Error creating child process", dwErrorCode));
+ _Jv_WinStrError (_T("Error creating child process"), dwErrorCode));
}
procHandle = (jint ) pi.hProcess;
- // Close the wrong ends (for the parent) of the pipes.
- CloseHandle (cldStdInRd);
- CloseHandle (cldStdOutWr);
- CloseHandle (cldStdErrWr);
-
_Jv_Free (cmdLine);
if (env != NULL)
_Jv_Free (env);
diff --git a/libjava/java/lang/reflect/natMethod.cc b/libjava/java/lang/reflect/natMethod.cc
index 525a4a0e9c9..ed122ea2441 100644
--- a/libjava/java/lang/reflect/natMethod.cc
+++ b/libjava/java/lang/reflect/natMethod.cc
@@ -343,6 +343,8 @@ _Jv_CallAnyMethodA (jobject obj,
jvalue *result,
jboolean is_jni_call)
{
+ using namespace java::lang::reflect;
+
#ifdef USE_LIBFFI
JvAssert (! is_constructor || ! obj);
JvAssert (! is_constructor || return_type);
@@ -351,7 +353,7 @@ _Jv_CallAnyMethodA (jobject obj,
// constructor does need a `this' argument, but it is one we create.
jboolean needs_this = false;
if (is_constructor
- || ! java::lang::reflect::Modifier::isStatic(meth->accflags))
+ || ! Modifier::isStatic(meth->accflags))
needs_this = true;
int param_count = parameter_types->length;
@@ -464,7 +466,7 @@ _Jv_CallAnyMethodA (jobject obj,
void *ncode;
- if (is_virtual_call)
+ if (is_virtual_call && ! Modifier::isFinal (meth->accflags))
{
_Jv_VTable *vtable = *(_Jv_VTable **) obj;
ncode = vtable->get_method (meth->index);
diff --git a/libjava/java/math/BigInteger.java b/libjava/java/math/BigInteger.java
index fb1cf7c59bd..312a9e91a8e 100644
--- a/libjava/java/math/BigInteger.java
+++ b/libjava/java/math/BigInteger.java
@@ -1565,7 +1565,7 @@ public class BigInteger extends Number implements Comparable
/* Assumes this and obj are both canonicalized. */
public boolean equals(Object obj)
{
- if (obj == null || ! (obj instanceof BigInteger))
+ if (! (obj instanceof BigInteger))
return false;
return equals(this, (BigInteger) obj);
}
diff --git a/libjava/java/net/DatagramPacket.java b/libjava/java/net/DatagramPacket.java
index 7ca6c51a22b..f23364cd0af 100644
--- a/libjava/java/net/DatagramPacket.java
+++ b/libjava/java/net/DatagramPacket.java
@@ -78,13 +78,18 @@ public final class DatagramPacket
private int offset;
/**
- * The length of the data buffer to send
+ * The length of the data buffer to send.
*/
- private int length;
+ int length;
/**
+ * The maximal length of the buffer.
+ */
+ int maxlen;
+
+ /**
* The address to which the packet should be sent or from which it
- * was received
+ * was received.
*/
private InetAddress address;
@@ -106,21 +111,9 @@ public final class DatagramPacket
*/
public DatagramPacket(byte[] buf, int offset, int length)
{
- if (buf == null)
- throw new NullPointerException("Null buffer");
- if (offset < 0)
- throw new IllegalArgumentException("Invalid offset: " + offset);
- if (length < 0)
- throw new IllegalArgumentException("Invalid length: " + length);
- if (offset + length > buf.length)
- throw new IllegalArgumentException("Potential buffer overflow - offset: "
- + offset + " length: " + length);
-
- buffer = buf;
- this.offset = offset;
- this.length = length;
- this.address = null;
- this.port = -1;
+ setData(buf, offset, length);
+ address = null;
+ port = -1;
}
/**
@@ -128,7 +121,7 @@ public final class DatagramPacket
* receiving packets from the network.
*
* @param buf A buffer for storing the returned packet data
- * @param length The length of the buffer (must be <= buf.length)
+ * @param length The length of the buffer (must be &lt;= buf.length)
*/
public DatagramPacket(byte[] buf, int length)
{
@@ -141,7 +134,7 @@ public final class DatagramPacket
*
* @param buf A buffer containing the data to send
* @param offset The offset into the buffer to start writing from.
- * @param len The length of the buffer (must be <= buf.length)
+ * @param len The length of the buffer (must be &lt;= buf.length)
* @param addr The address to send to
* @param port The port to send to
*
@@ -150,25 +143,9 @@ public final class DatagramPacket
public DatagramPacket(byte[] buf, int offset, int length,
InetAddress address, int port)
{
- if (buf == null)
- throw new NullPointerException("Null buffer");
- if (offset < 0)
- throw new IllegalArgumentException("Invalid offset: " + offset);
- if (length < 0)
- throw new IllegalArgumentException("Invalid length: " + length);
- if (offset + length > buf.length)
- throw new IllegalArgumentException("Potential buffer overflow - offset: "
- + offset + " length: " + length);
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
- if (address == null)
- throw new NullPointerException("Null address");
-
- buffer = buf;
- this.offset = offset;
- this.length = length;
- this.address = address;
- this.port = port;
+ setData(buf, offset, length);
+ setAddress(address);
+ setPort(port);
}
/**
@@ -176,7 +153,7 @@ public final class DatagramPacket
* transmitting packets across the network.
*
* @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be <= buf.length)
+ * @param length The length of the buffer (must be &lt;= buf.length)
* @param address The address to send to
* @param port The port to send to
*/
@@ -191,7 +168,7 @@ public final class DatagramPacket
*
* @param buf A buffer containing the data to send
* @param offset The offset into the buffer to start writing from.
- * @param length The length of the buffer (must be <= buf.length)
+ * @param length The length of the buffer (must be &lt;= buf.length)
* @param address The socket address to send to
*
* @exception SocketException If an error occurs
@@ -203,8 +180,13 @@ public final class DatagramPacket
SocketAddress address)
throws SocketException
{
- this(buf, offset, length, ((InetSocketAddress)address).getAddress(),
- ((InetSocketAddress)address).getPort());
+ if (! (address instanceof InetSocketAddress))
+ throw new IllegalArgumentException("unsupported address type");
+
+ InetSocketAddress tmp = (InetSocketAddress) address;
+ setData(buf, offset, length);
+ setAddress(tmp.getAddress());
+ setPort(tmp.getPort());
}
/**
@@ -212,7 +194,7 @@ public final class DatagramPacket
* transmitting packets across the network.
*
* @param buf A buffer containing the data to send
- * @param length The length of the buffer (must be <= buf.length)
+ * @param length The length of the buffer (must be &lt;= buf.length)
* @param address The socket address to send to
*
* @exception SocketException If an error occurs
@@ -223,8 +205,7 @@ public final class DatagramPacket
public DatagramPacket(byte[] buf, int length, SocketAddress address)
throws SocketException
{
- this(buf, 0, length, ((InetSocketAddress)address).getAddress(),
- ((InetSocketAddress)address).getPort());
+ this(buf, 0, length, address);
}
/**
@@ -330,9 +311,10 @@ public final class DatagramPacket
public void setSocketAddress(SocketAddress address)
throws IllegalArgumentException
{
- if (address == null) throw new IllegalArgumentException();
+ if (address == null)
+ throw new IllegalArgumentException("address may not be null");
- InetSocketAddress tmp = (InetSocketAddress)address;
+ InetSocketAddress tmp = (InetSocketAddress) address;
this.address = tmp.getAddress();
this.port = tmp.getPort();
}
@@ -359,14 +341,9 @@ public final class DatagramPacket
*
* @since 1.1
*/
- public synchronized void setData(byte[] buf)
+ public void setData(byte[] buf)
{
- // This form of setData requires setLength to be called separately
- // and subsequently.
- if (buf == null)
- throw new NullPointerException("Null buffer");
-
- buffer = buf;
+ setData(buf, 0, buf.length);
}
/**
@@ -388,15 +365,10 @@ public final class DatagramPacket
throw new NullPointerException("Null buffer");
if (offset < 0)
throw new IllegalArgumentException("Invalid offset: " + offset);
- if (length < 0)
- throw new IllegalArgumentException("Invalid length: " + length);
- if (offset + length > buf.length)
- throw new IllegalArgumentException("Potential buffer overflow - offset: "
- + offset + " length: " + length);
buffer = buf;
this.offset = offset;
- this.length = length;
+ setLength(length);
}
/**
@@ -418,6 +390,6 @@ public final class DatagramPacket
+ offset + " length: " + length);
this.length = length;
+ this.maxlen = length;
}
-} // class DatagramPacket
-
+}
diff --git a/libjava/java/net/DatagramSocket.java b/libjava/java/net/DatagramSocket.java
index 1d89d688401..c9c0f5d0f03 100644
--- a/libjava/java/net/DatagramSocket.java
+++ b/libjava/java/net/DatagramSocket.java
@@ -67,12 +67,17 @@ public class DatagramSocket
* This is the user DatagramSocketImplFactory for this class. If this
* variable is null, a default factory is used.
*/
- static DatagramSocketImplFactory factory;
+ private static DatagramSocketImplFactory factory;
/**
* This is the implementation object used by this socket.
*/
- DatagramSocketImpl impl;
+ private DatagramSocketImpl impl;
+
+ /**
+ * True if socket implementation was created.
+ */
+ private boolean implCreated;
/**
* This is the address we are "connected" to
@@ -85,9 +90,9 @@ public class DatagramSocket
private int remotePort = -1;
/**
- * Indicates when the socket is closed.
+ * True if socket is bound.
*/
- private boolean closed = false;
+ private boolean bound;
/**
* Creates a <code>DatagramSocket</code> from a specified
@@ -100,6 +105,9 @@ public class DatagramSocket
*/
protected DatagramSocket (DatagramSocketImpl impl)
{
+ if (impl == null)
+ throw new NullPointerException("impl may not be null");
+
this.impl = impl;
this.remoteAddress = null;
this.remotePort = -1;
@@ -115,7 +123,7 @@ public class DatagramSocket
*/
public DatagramSocket() throws SocketException
{
- this(0, null);
+ this(new InetSocketAddress(0));
}
/**
@@ -130,7 +138,7 @@ public class DatagramSocket
*/
public DatagramSocket(int port) throws SocketException
{
- this(port, null);
+ this(new InetSocketAddress(port));
}
/**
@@ -138,21 +146,31 @@ public class DatagramSocket
* the specified local port and address.
*
* @param port The local port number to bind to.
- * @param laddr The local address to bind to.
+ * @param addr The local address to bind to.
*
* @exception SecurityException If a security manager exists and its
* checkListen method doesn't allow the operation.
* @exception SocketException If an error occurs.
*/
- public DatagramSocket(int port, InetAddress laddr) throws SocketException
+ public DatagramSocket(int port, InetAddress addr) throws SocketException
{
- if (port < 0 || port > 65535)
- throw new IllegalArgumentException("Invalid port: " + port);
-
- SecurityManager s = System.getSecurityManager();
- if (s != null)
- s.checkListen(port);
+ this(new InetSocketAddress(addr, port));
+ }
+ /**
+ * Initializes a new instance of <code>DatagramSocket</code> that binds to
+ * the specified local port and address.
+ *
+ * @param address The local address and port number to bind to.
+ *
+ * @exception SecurityException If a security manager exists and its
+ * <code>checkListen</code> method doesn't allow the operation.
+ * @exception SocketException If an error occurs.
+ *
+ * @since 1.4
+ */
+ public DatagramSocket (SocketAddress address) throws SocketException
+ {
String propVal = System.getProperty("impl.prefix");
if (propVal == null || propVal.equals(""))
impl = new PlainDatagramSocketImpl();
@@ -168,62 +186,62 @@ public class DatagramSocket
propVal + "DatagramSocketImpl");
impl = new PlainDatagramSocketImpl();
}
- impl.create();
- if (laddr == null)
- laddr = InetAddress.ANY_IF;
-
+ if (address != null)
+ bind(address);
+ }
+
+ // This needs to be accessible from java.net.MulticastSocket
+ DatagramSocketImpl getImpl()
+ throws SocketException
+ {
try
{
- impl.bind (port, laddr);
- }
- catch (SocketException exception)
- {
- impl.close ();
- throw exception;
- }
- catch (RuntimeException exception)
- {
- impl.close ();
- throw exception;
+ if (!implCreated)
+ {
+ impl.create();
+ implCreated = true;
+ }
+
+ return impl;
}
- catch (Error error)
+ catch (IOException e)
{
- impl.close ();
- throw error;
+ throw new SocketException(e.getMessage());
}
}
-
- /**
- * Initializes a new instance of <code>DatagramSocket</code> that binds to
- * the specified local port and address.
- *
- * @param port The local port number to bind to.
- * @param laddr The local address to bind to.
- *
- * @exception SecurityException If a security manager exists and its
- * <code>checkListen</code> method doesn't allow the operation.
- * @exception SocketException If an error occurs.
- *
- * @since 1.4
- */
- public DatagramSocket (SocketAddress address) throws SocketException
- {
- this (((InetSocketAddress) address).getPort (),
- ((InetSocketAddress) address).getAddress ());
- }
/**
* Closes this datagram socket.
*/
public void close()
{
- if (!closed)
+ if (isClosed())
+ return;
+
+ try
+ {
+ getImpl().close();
+ }
+ catch (SocketException e)
+ {
+ // Ignore this case, just close the socket in finally clause.
+ }
+ finally
+ {
+ remoteAddress = null;
+ remotePort = -1;
+ impl = null;
+ }
+
+ try
+ {
+ if (getChannel() != null)
+ getChannel().close();
+ }
+ catch (IOException e)
{
- impl.close();
- remoteAddress = null;
- remotePort = -1;
- closed = true;
+ // Do nothing.
}
}
@@ -258,19 +276,20 @@ public class DatagramSocket
/**
* Returns the local address this datagram socket is bound to.
*
+ * @return The local address is the socket is bound or null
+ *
* @since 1.1
*/
public InetAddress getLocalAddress()
{
- if (impl == null
- || closed)
+ if (isClosed())
return null;
InetAddress localAddr;
try
{
- localAddr = (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR);
+ localAddr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
SecurityManager s = System.getSecurityManager();
if (s != null)
@@ -282,6 +301,7 @@ public class DatagramSocket
}
catch (SocketException e)
{
+ // This cannot happen as we are bound.
return null;
}
@@ -295,7 +315,18 @@ public class DatagramSocket
*/
public int getLocalPort()
{
- return impl.getLocalPort();
+ if (isClosed())
+ return -1;
+
+ try
+ {
+ return getImpl().getLocalPort();
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are bound.
+ return 0;
+ }
}
/**
@@ -310,15 +341,15 @@ public class DatagramSocket
*/
public synchronized int getSoTimeout() throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT);
+ Object buf = getImpl().getOption(SocketOptions.SO_TIMEOUT);
- if (timeout instanceof Integer)
- return ((Integer)timeout).intValue();
- else
- return 0;
+ if (buf instanceof Integer)
+ return ((Integer) buf).intValue();
+
+ throw new SocketException("unexpected type");
}
/**
@@ -334,10 +365,13 @@ public class DatagramSocket
*/
public synchronized void setSoTimeout(int timeout) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (timeout < 0)
throw new IllegalArgumentException("Invalid timeout: " + timeout);
- impl.setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
+ getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
}
/**
@@ -353,15 +387,15 @@ public class DatagramSocket
*/
public int getSendBufferSize() throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
- Object obj = impl.getOption(SocketOptions.SO_SNDBUF);
+ if (buf instanceof Integer)
+ return ((Integer) buf).intValue();
- if (obj instanceof Integer)
- return(((Integer)obj).intValue());
- else
- throw new SocketException("Unexpected type");
+ throw new SocketException("unexpected type");
}
/**
@@ -378,10 +412,13 @@ public class DatagramSocket
*/
public void setSendBufferSize(int size) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (size < 0)
throw new IllegalArgumentException("Buffer size is less than 0");
- impl.setOption(SocketOptions.SO_SNDBUF, new Integer(size));
+ getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
}
/**
@@ -397,15 +434,15 @@ public class DatagramSocket
*/
public int getReceiveBufferSize() throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- Object obj = impl.getOption(SocketOptions.SO_RCVBUF);
+ Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
- if (obj instanceof Integer)
- return(((Integer)obj).intValue());
- else
- throw new SocketException("Unexpected type");
+ if (buf instanceof Integer)
+ return ((Integer) buf).intValue();
+
+ throw new SocketException("unexpected type");
}
/**
@@ -422,13 +459,13 @@ public class DatagramSocket
*/
public void setReceiveBufferSize(int size) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
if (size < 0)
throw new IllegalArgumentException("Buffer size is less than 0");
- impl.setOption(SocketOptions.SO_RCVBUF, new Integer(size));
+ getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
}
/**
@@ -461,7 +498,7 @@ public class DatagramSocket
try
{
- impl.connect (address, port);
+ getImpl().connect (address, port);
remoteAddress = address;
remotePort = port;
}
@@ -480,9 +517,22 @@ public class DatagramSocket
*/
public void disconnect()
{
- impl.disconnect();
- remoteAddress = null;
- remotePort = -1;
+ if (!isConnected())
+ return;
+
+ try
+ {
+ getImpl().disconnect();
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are connected.
+ }
+ finally
+ {
+ remoteAddress = null;
+ remotePort = -1;
+ }
}
/**
@@ -506,18 +556,19 @@ public class DatagramSocket
*/
public synchronized void receive(DatagramPacket p) throws IOException
{
- if (impl == null)
- throw new IOException ("Cannot initialize Socket implementation");
-
- if (remoteAddress != null && remoteAddress.isMulticastAddress ())
- throw new IOException (
- "Socket connected to a multicast address my not receive");
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ if (remoteAddress != null
+ && remoteAddress.isMulticastAddress())
+ throw new IOException
+ ("Socket connected to a multicast address my not receive");
if (getChannel() != null
&& !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
- impl.receive(p);
+ getImpl().receive(p);
SecurityManager s = System.getSecurityManager();
if (s != null && isConnected ())
@@ -541,6 +592,9 @@ public class DatagramSocket
*/
public void send(DatagramPacket p) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
// JDK1.2: Don't do security checks if socket is connected; see jdk1.2 api.
SecurityManager s = System.getSecurityManager();
if (s != null && !isConnected ())
@@ -567,7 +621,7 @@ public class DatagramSocket
&& !getChannel().isBlocking ())
throw new IllegalBlockingModeException ();
- impl.send(p);
+ getImpl().send(p);
}
/**
@@ -585,31 +639,64 @@ public class DatagramSocket
public void bind (SocketAddress address)
throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (! (address instanceof InetSocketAddress))
- throw new IllegalArgumentException ();
+ throw new IllegalArgumentException("unsupported address type");
- InetSocketAddress tmp = (InetSocketAddress) address;
+ InetAddress addr = ((InetSocketAddress) address).getAddress();
+ int port = ((InetSocketAddress) address).getPort();
+
+ if (port < 0 || port > 65535)
+ throw new IllegalArgumentException("Invalid port: " + port);
SecurityManager s = System.getSecurityManager ();
if (s != null)
- s.checkListen(tmp.getPort ());
+ s.checkListen(port);
- impl.bind (tmp.getPort (), tmp.getAddress ());
+ if (addr == null)
+ addr = InetAddress.ANY_IF;
+
+ try
+ {
+ getImpl().bind(port, addr);
+ bound = true;
+ }
+ catch (SocketException exception)
+ {
+ getImpl().close();
+ throw exception;
+ }
+ catch (RuntimeException exception)
+ {
+ getImpl().close();
+ throw exception;
+ }
+ catch (Error error)
+ {
+ getImpl().close();
+ throw error;
+ }
}
/**
* Checks if the datagram socket is closed.
*
+ * @return True if socket is closed, false otherwise.
+ *
* @since 1.4
*/
public boolean isClosed()
{
- return closed;
+ return impl == null;
}
/**
* Returns the datagram channel assoziated with this datagram socket.
*
+ * @return The associated <code>DatagramChannel</code> object or null
+ *
* @since 1.4
*/
public DatagramChannel getChannel()
@@ -629,36 +716,33 @@ public class DatagramSocket
*/
public void connect (SocketAddress address) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if ( !(address instanceof InetSocketAddress) )
- throw new IllegalArgumentException (
- "SocketAddress is not InetSocketAddress");
+ throw new IllegalArgumentException("unsupported address type");
InetSocketAddress tmp = (InetSocketAddress) address;
- connect( tmp.getAddress(), tmp.getPort());
+ connect(tmp.getAddress(), tmp.getPort());
}
/**
* Returns the binding state of the socket.
*
+ * @return True if socket bound, false otherwise.
+ *
* @since 1.4
*/
public boolean isBound()
{
- try
- {
- Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- return false;
- }
-
- return true;
+ return bound;
}
/**
* Returns the connection state of the socket.
*
+ * @return True if socket is connected, false otherwise.
+ *
* @since 1.4
*/
public boolean isConnected()
@@ -670,6 +754,8 @@ public class DatagramSocket
* Returns the SocketAddress of the host this socket is conneted to
* or null if this socket is not connected.
*
+ * @return The socket address of the remote host if connected or null
+ *
* @since 1.4
*/
public SocketAddress getRemoteSocketAddress()
@@ -681,25 +767,18 @@ public class DatagramSocket
}
/**
- * Returns the local SocketAddress this socket is bound to
- * or null if it is not bound.
+ * Returns the local SocketAddress this socket is bound to.
+ *
+ * @return The local SocketAddress or null if the socket is not bound.
*
* @since 1.4
*/
public SocketAddress getLocalSocketAddress()
{
- InetAddress addr;
+ if (!isBound())
+ return null;
- try
- {
- addr = (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- return null;
- }
-
- return new InetSocketAddress (addr, impl.localPort);
+ return new InetSocketAddress (getLocalAddress(), getLocalPort());
}
/**
@@ -713,67 +792,71 @@ public class DatagramSocket
*/
public void setReuseAddress(boolean on) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
+ getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
/**
* Checks if SO_REUSEADDR is enabled.
*
+ * @return True if SO_REUSEADDR is set on the socket, false otherwise.
+ *
* @exception SocketException If an error occurs.
*
* @since 1.4
*/
public boolean getReuseAddress() throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- Object obj = impl.getOption (SocketOptions.SO_REUSEADDR);
+ Object buf = getImpl().getOption (SocketOptions.SO_REUSEADDR);
- if (obj instanceof Boolean)
- return(((Boolean) obj).booleanValue ());
- else
- throw new SocketException ("Unexpected type");
+ if (buf instanceof Boolean)
+ return ((Boolean) buf).booleanValue();
+
+ throw new SocketException("unexpected type");
}
/**
* Enables/Disables SO_BROADCAST
*
- * @param on Whether or not to have SO_BROADCAST turned on
+ * @param enable True if SO_BROADCAST should be enabled, false otherwise.
*
* @exception SocketException If an error occurs
*
* @since 1.4
*/
- public void setBroadcast(boolean on) throws SocketException
+ public void setBroadcast(boolean enable) throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- impl.setOption (SocketOptions.SO_BROADCAST, new Boolean (on));
+ getImpl().setOption(SocketOptions.SO_BROADCAST, new Boolean(enable));
}
/**
* Checks if SO_BROADCAST is enabled
*
+ * @return Whether SO_BROADCAST is set
+ *
* @exception SocketException If an error occurs
*
* @since 1.4
*/
public boolean getBroadcast() throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- Object obj = impl.getOption (SocketOptions.SO_BROADCAST);
+ Object buf = getImpl().getOption(SocketOptions.SO_BROADCAST);
- if (obj instanceof Boolean)
- return ((Boolean) obj).booleanValue ();
- else
- throw new SocketException ("Unexpected type");
+ if (buf instanceof Boolean)
+ return ((Boolean) buf).booleanValue();
+
+ throw new SocketException("unexpected type");
}
/**
@@ -791,18 +874,20 @@ public class DatagramSocket
public void setTrafficClass(int tc)
throws SocketException
{
- if (impl == null)
- throw new SocketException ("Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
if (tc < 0 || tc > 255)
throw new IllegalArgumentException();
- impl.setOption (SocketOptions.IP_TOS, new Integer (tc));
+ getImpl().setOption (SocketOptions.IP_TOS, new Integer (tc));
}
/**
* Returns the current traffic class
*
+ * @return The current traffic class.
+ *
* @see DatagramSocket#setTrafficClass(int tc)
*
* @exception SocketException If an error occurs
@@ -811,15 +896,15 @@ public class DatagramSocket
*/
public int getTrafficClass() throws SocketException
{
- if (impl == null)
- throw new SocketException( "Cannot initialize Socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.IP_TOS);
- Object obj = impl.getOption(SocketOptions.IP_TOS);
+ if (buf instanceof Integer)
+ return ((Integer) buf).intValue();
- if (obj instanceof Integer)
- return ((Integer) obj).intValue ();
- else
- throw new SocketException ("Unexpected type");
+ throw new SocketException("unexpected type");
}
/**
diff --git a/libjava/java/net/Inet4Address.java b/libjava/java/net/Inet4Address.java
index 25d296f995a..76abfc3fce4 100644
--- a/libjava/java/net/Inet4Address.java
+++ b/libjava/java/net/Inet4Address.java
@@ -56,7 +56,7 @@ import java.util.Arrays;
public final class Inet4Address extends InetAddress
{
- static final long serialVersionUID = 7615067291688066509L;
+ static final long serialVersionUID = 3286316764910316507L;
/**
* needed for serialization
@@ -258,7 +258,7 @@ public final class Inet4Address extends InetAddress
*/
public boolean equals (Object obj)
{
- if (obj == null || ! (obj instanceof InetAddress))
+ if (! (obj instanceof InetAddress))
return false;
byte[] addr1 = addr;
diff --git a/libjava/java/net/Inet6Address.java b/libjava/java/net/Inet6Address.java
index 4f4563ddcc5..c3418c654a9 100644
--- a/libjava/java/net/Inet6Address.java
+++ b/libjava/java/net/Inet6Address.java
@@ -243,7 +243,7 @@ public final class Inet6Address extends InetAddress
*/
public boolean equals (Object obj)
{
- if (obj == null || ! (obj instanceof Inet6Address))
+ if (! (obj instanceof Inet6Address))
return false;
Inet6Address tmp = (Inet6Address) obj;
diff --git a/libjava/java/net/InetAddress.java b/libjava/java/net/InetAddress.java
index 6d72d627c64..0a69c1aab07 100644
--- a/libjava/java/net/InetAddress.java
+++ b/libjava/java/net/InetAddress.java
@@ -82,7 +82,7 @@ public class InetAddress implements Serializable
}
byte[] zeros = { 0, 0, 0, 0 };
- ANY_IF = new InetAddress (zeros, null);
+ ANY_IF = new InetAddress (zeros, "0.0.0.0");
}
/**
@@ -476,8 +476,7 @@ public class InetAddress implements Serializable
*/
public boolean equals (Object obj)
{
- if (obj == null
- || ! (obj instanceof InetAddress))
+ if (! (obj instanceof InetAddress))
return false;
// "The Java Class Libraries" 2nd edition says "If a machine has
diff --git a/libjava/java/net/InetSocketAddress.java b/libjava/java/net/InetSocketAddress.java
index 3f6eb09456b..f0a27e3c3be 100644
--- a/libjava/java/net/InetSocketAddress.java
+++ b/libjava/java/net/InetSocketAddress.java
@@ -52,9 +52,20 @@ public class InetSocketAddress extends SocketAddress
*/
private static final long serialVersionUID = 5076001401234631237L;
- String hostname;
- InetAddress addr;
- int port;
+ /**
+ * Name of host.
+ */
+ private String hostname;
+
+ /**
+ * Address of host.
+ */
+ private InetAddress addr;
+
+ /**
+ * Port of host.
+ */
+ private int port;
/**
* Constructs an InetSocketAddress instance.
@@ -124,6 +135,10 @@ public class InetSocketAddress extends SocketAddress
/**
* Test if obj is a <code>InetSocketAddress</code> and
* has the same address and port
+ *
+ * @param obj The obj to compare this address with.
+ *
+ * @return True if obj is equal.
*/
public final boolean equals (Object obj)
{
@@ -148,6 +163,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Returns the <code>InetAddress</code> or
* <code>null</code> if its unresolved
+ *
+ * @return The IP address of this address.
*/
public final InetAddress getAddress()
{
@@ -156,6 +173,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Returns <code>hostname</code>
+ *
+ * @return The hostname of this address.
*/
public final String getHostName()
{
@@ -164,6 +183,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Returns the <code>port</code>
+ *
+ * @return The port of this address.
*/
public final int getPort()
{
@@ -172,6 +193,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Returns the hashcode of the <code>InetSocketAddress</code>
+ *
+ * @return The hashcode for this address.
*/
public final int hashCode()
{
@@ -180,6 +203,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Checks wether the address has been resolved or not
+ *
+ * @return True if address is unresolved.
*/
public final boolean isUnresolved()
{
@@ -188,6 +213,8 @@ public class InetSocketAddress extends SocketAddress
/**
* Returns the <code>InetSocketAddress</code> as string
+ *
+ * @return A string represenation of this address.
*/
public String toString()
{
diff --git a/libjava/java/net/JarURLConnection.java b/libjava/java/net/JarURLConnection.java
index e8838f4b828..87d9db36f1c 100644
--- a/libjava/java/net/JarURLConnection.java
+++ b/libjava/java/net/JarURLConnection.java
@@ -38,9 +38,6 @@ exception statement from your version. */
package java.net;
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
import java.io.IOException;
import java.util.jar.Attributes;
import java.util.jar.JarEntry;
@@ -48,10 +45,6 @@ import java.util.jar.JarFile;
import java.util.jar.JarInputStream;
import java.util.jar.Manifest;
import java.util.zip.ZipEntry;
-import java.util.Map;
-import java.util.Vector;
-import java.util.HashMap;
-import java.util.Hashtable;
import java.security.cert.Certificate;
/**
@@ -101,11 +94,6 @@ public abstract class JarURLConnection extends URLConnection
private final String entryName;
/**
- * Cached JarURLConnection objects .
- */
- static HashMap connectionCache = new HashMap();
-
- /**
* Creates a JarURLConnection from an URL object
*
* @param URL url The URL object for this connection.
@@ -157,97 +145,6 @@ public abstract class JarURLConnection extends URLConnection
return entryName;
}
- public synchronized void connect() throws IOException
- {
- // Call is ignored if already connected.
- if (connected)
- return;
-
- if (getUseCaches())
- {
- jarFileURLConnection = (URLConnection) connectionCache.get (jarFileURL);
-
- if (jarFileURLConnection == null)
- {
- jarFileURLConnection = jarFileURL.openConnection ();
- jarFileURLConnection.setUseCaches (true);
- jarFileURLConnection.connect ();
- connectionCache.put (jarFileURL, jarFileURLConnection);
- }
- }
- else
- {
- jarFileURLConnection = jarFileURL.openConnection ();
- jarFileURLConnection.connect ();
- }
-
- connected = true;
- }
-
- public InputStream getInputStream() throws IOException
- {
- if (!connected)
- connect();
-
- if (! doInput)
- throw new ProtocolException("Can't open InputStream if doInput is false");
-
- if (entryName == null)
- {
- // This is a JarURLConnection for the entire jar file.
-
- InputStream jar_is = new BufferedInputStream(
- jarFileURLConnection.getInputStream ());
- return new JarInputStream(jar_is);
- }
-
- // Reaching this point, we're looking for an entry of a jar file.
-
- JarFile jarfile = null;
-
- try
- {
- jarfile = getJarFile ();
- }
- catch (IOException x)
- {
- /* ignore */
- }
-
- if (jarfile != null)
- {
- // this is the easy way...
- ZipEntry entry = jarfile.getEntry (entryName);
-
- if (entry != null)
- return jarfile.getInputStream (entry);
- else
- return null;
- }
- else
- {
- // If the jar file is not local, ...
- JarInputStream zis = new JarInputStream(
- jarFileURLConnection.getInputStream ());
-
- // This is hideous, we're doing a linear search...
- for (ZipEntry ent = zis.getNextEntry ();
- ent != null;
- ent = zis.getNextEntry ())
- {
- if (entryName.equals (ent.getName()))
- {
- int size = (int)ent.getSize();
- byte[] data = new byte[size];
- zis.read (data, 0, size);
- return new ByteArrayInputStream (data);
- }
- }
- }
-
- return null;
- }
-
/**
* Returns the entry in this jar file specified by the URL.
*
@@ -308,131 +205,6 @@ public abstract class JarURLConnection extends URLConnection
*/
public abstract JarFile getJarFile () throws IOException;
- // Steal and borrow from protocol/file/Connection.java
-
- private Hashtable hdrHash = new Hashtable();
- private Vector hdrVec = new Vector();
- private boolean gotHeaders = false;
-
- // Override default method in URLConnection.
- public String getHeaderField(String name)
- {
- try
- {
- getHeaders();
- }
- catch (IOException x)
- {
- return null;
- }
- return (String) hdrHash.get(name.toLowerCase());
- }
-
- // Override default method in URLConnection.
- public Map getHeaderFields()
- {
- try
- {
- getHeaders();
- }
- catch (IOException x)
- {
- return null;
- }
- return hdrHash;
- }
-
- // Override default method in URLConnection.
- public String getHeaderField(int n)
- {
- try
- {
- getHeaders();
- }
- catch (IOException x)
- {
- return null;
- }
- if (n < hdrVec.size())
- return getField((String) hdrVec.elementAt(n));
-
- return null;
- }
-
- // Override default method in URLConnection.
- public String getHeaderFieldKey(int n)
- {
- try
- {
- getHeaders();
- }
- catch (IOException x)
- {
- return null;
- }
- if (n < hdrVec.size())
- return getKey((String) hdrVec.elementAt(n));
-
- return null;
- }
-
- private String getKey(String str)
- {
- if (str == null)
- return null;
- int index = str.indexOf(':');
- if (index >= 0)
- return str.substring(0, index);
- else
- return null;
- }
-
- private String getField(String str)
- {
- if (str == null)
- return null;
- int index = str.indexOf(':');
- if (index >= 0)
- return str.substring(index + 1).trim();
- else
- return str;
- }
-
- private void getHeaders() throws IOException
- {
- if (gotHeaders)
- return;
- gotHeaders = true;
-
- connect();
-
- // Yes, it is overkill to use the hash table and vector here since
- // we're only putting one header in the file, but in case we need
- // to add others later and for consistency, we'll implement it this way.
-
- // Add the only header we know about right now: Content-length.
- long len = -1;
-
- if (entryName == null)
- if (jarFileURLConnection != null)
- len = jarFileURLConnection.getContentLength ();
- else
- {
- JarEntry entry = getJarEntry();
- if (entry != null)
- len = entry.getSize ();
- }
-
- String line = "Content-length: " + len;
- hdrVec.addElement(line);
-
- // The key will never be null in this scenario since we build up the
- // headers ourselves. If we ever rely on getting a header from somewhere
- // else, then we may have to check if the result of getKey() is null.
- String key = getKey(line);
- hdrHash.put(key.toLowerCase(), Long.toString(len));
- }
-
/**
* Returns an array of Certificate objects for the jar file entry specified
* by this URL or null if there are none
diff --git a/libjava/java/net/MulticastSocket.java b/libjava/java/net/MulticastSocket.java
index 1b7b422e071..12afc2f50c3 100644
--- a/libjava/java/net/MulticastSocket.java
+++ b/libjava/java/net/MulticastSocket.java
@@ -67,10 +67,6 @@ import java.util.Enumeration;
*/
public class MulticastSocket extends DatagramSocket
{
- // FIXME: the local addr bound to the multicast socket can be reused;
- // unlike unicast sockets. It binds to any available network interface.
- // See p.1159 JCL book.
-
/**
* Create a MulticastSocket that this not bound to any address
*
@@ -80,8 +76,7 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket() throws IOException
{
- super(0, null);
- setReuseAddress (true);
+ this(new InetSocketAddress(0));
}
/**
@@ -95,8 +90,7 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket(int port) throws IOException
{
- super(port, null);
- setReuseAddress (true);
+ this(new InetSocketAddress(port));
}
/**
@@ -112,8 +106,10 @@ public class MulticastSocket extends DatagramSocket
*/
public MulticastSocket(SocketAddress address) throws IOException
{
- super(address);
- setReuseAddress (true);
+ super((SocketAddress) null);
+ setReuseAddress(true);
+ if (address != null)
+ bind(address);
}
/**
@@ -125,7 +121,10 @@ public class MulticastSocket extends DatagramSocket
*/
public InetAddress getInterface() throws SocketException
{
- return (InetAddress) impl.getOption(SocketOptions.IP_MULTICAST_IF);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ return (InetAddress) getImpl().getOption(SocketOptions.IP_MULTICAST_IF);
}
/**
@@ -143,10 +142,13 @@ public class MulticastSocket extends DatagramSocket
*/
public byte getTTL() throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
// Use getTTL here rather than getTimeToLive in case we're using an impl
// other than the default PlainDatagramSocketImpl and it doesn't have
// getTimeToLive yet.
- return impl.getTTL();
+ return getImpl().getTTL();
}
/**
@@ -161,7 +163,10 @@ public class MulticastSocket extends DatagramSocket
*/
public int getTimeToLive() throws IOException
{
- return impl.getTimeToLive();
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ return getImpl().getTimeToLive();
}
/**
@@ -175,7 +180,10 @@ public class MulticastSocket extends DatagramSocket
*/
public void setInterface(InetAddress addr) throws SocketException
{
- impl.setOption(SocketOptions.IP_MULTICAST_IF, addr);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().setOption(SocketOptions.IP_MULTICAST_IF, addr);
}
/**
@@ -192,17 +200,16 @@ public class MulticastSocket extends DatagramSocket
public void setNetworkInterface(NetworkInterface netIf)
throws SocketException
{
- if (impl == null)
- throw new SocketException (
- "MulticastSocket: Cant access socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
Enumeration e = netIf.getInetAddresses ();
if (!e.hasMoreElements ())
- throw new SocketException ("MulticastSocket: Error");
+ throw new SocketException("no network devices found");
InetAddress address = (InetAddress) e.nextElement ();
- impl.setOption (SocketOptions.IP_MULTICAST_IF, address);
+ getImpl().setOption (SocketOptions.IP_MULTICAST_IF, address);
}
/**
@@ -219,12 +226,11 @@ public class MulticastSocket extends DatagramSocket
public NetworkInterface getNetworkInterface()
throws SocketException
{
- if (impl == null)
- throw new SocketException (
- "MulticastSocket: Cant access socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
InetAddress address =
- (InetAddress) impl.getOption (SocketOptions.IP_MULTICAST_IF);
+ (InetAddress) getImpl().getOption (SocketOptions.IP_MULTICAST_IF);
NetworkInterface netIf = NetworkInterface.getByInetAddress (address);
return netIf;
@@ -246,11 +252,10 @@ public class MulticastSocket extends DatagramSocket
*/
public void setLoopbackMode(boolean disable) throws SocketException
{
- if (impl == null)
- throw new SocketException (
- "MulticastSocket: Cant access socket implementation");
+ if (isClosed())
+ throw new SocketException("socket is closed");
- impl.setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable));
+ getImpl().setOption (SocketOptions.IP_MULTICAST_LOOP, new Boolean (disable));
}
/**
@@ -262,12 +267,15 @@ public class MulticastSocket extends DatagramSocket
*/
public boolean getLoopbackMode() throws SocketException
{
- Object obj = impl.getOption (SocketOptions.IP_MULTICAST_LOOP);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption (SocketOptions.IP_MULTICAST_LOOP);
- if (obj instanceof Boolean)
- return ((Boolean) obj).booleanValue ();
- else
- throw new SocketException ("Unexpected type");
+ if (buf instanceof Boolean)
+ return ((Boolean) buf).booleanValue();
+
+ throw new SocketException("unexpected type");
}
/**
@@ -284,10 +292,13 @@ public class MulticastSocket extends DatagramSocket
*/
public void setTTL(byte ttl) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
// Use setTTL here rather than setTimeToLive in case we're using an impl
// other than the default PlainDatagramSocketImpl and it doesn't have
// setTimeToLive yet.
- impl.setTTL(ttl);
+ getImpl().setTTL(ttl);
}
/**
@@ -302,10 +313,13 @@ public class MulticastSocket extends DatagramSocket
*/
public void setTimeToLive(int ttl) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (ttl <= 0 || ttl > 255)
throw new IllegalArgumentException("Invalid ttl: " + ttl);
- impl.setTimeToLive(ttl);
+ getImpl().setTimeToLive(ttl);
}
/**
@@ -319,6 +333,9 @@ public class MulticastSocket extends DatagramSocket
*/
public void joinGroup(InetAddress mcastaddr) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (! mcastaddr.isMulticastAddress())
throw new IOException("Not a Multicast address");
@@ -326,7 +343,7 @@ public class MulticastSocket extends DatagramSocket
if (s != null)
s.checkMulticast(mcastaddr);
- impl.join(mcastaddr);
+ getImpl().join(mcastaddr);
}
/**
@@ -340,6 +357,9 @@ public class MulticastSocket extends DatagramSocket
*/
public void leaveGroup(InetAddress mcastaddr) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (! mcastaddr.isMulticastAddress())
throw new IOException("Not a Multicast address");
@@ -347,7 +367,7 @@ public class MulticastSocket extends DatagramSocket
if (s != null)
s.checkMulticast(mcastaddr);
- impl.leave(mcastaddr);
+ getImpl().leave(mcastaddr);
}
/**
@@ -371,6 +391,9 @@ public class MulticastSocket extends DatagramSocket
public void joinGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (! (mcastaddr instanceof InetSocketAddress))
throw new IllegalArgumentException ("SocketAddress type not supported");
@@ -383,7 +406,7 @@ public class MulticastSocket extends DatagramSocket
if (s != null)
s.checkMulticast (tmp.getAddress ());
- impl.joinGroup (mcastaddr, netIf);
+ getImpl().joinGroup (mcastaddr, netIf);
}
/**
@@ -406,6 +429,9 @@ public class MulticastSocket extends DatagramSocket
public void leaveGroup(SocketAddress mcastaddr, NetworkInterface netIf)
throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
InetSocketAddress tmp = (InetSocketAddress) mcastaddr;
if (! tmp.getAddress ().isMulticastAddress ())
@@ -415,7 +441,7 @@ public class MulticastSocket extends DatagramSocket
if (s != null)
s.checkMulticast (tmp.getAddress ());
- impl.leaveGroup (mcastaddr, netIf);
+ getImpl().leaveGroup (mcastaddr, netIf);
}
/**
@@ -434,6 +460,9 @@ public class MulticastSocket extends DatagramSocket
*/
public synchronized void send(DatagramPacket p, byte ttl) throws IOException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
SecurityManager s = System.getSecurityManager();
if (s != null)
{
@@ -446,9 +475,9 @@ public class MulticastSocket extends DatagramSocket
s.checkConnect(addr.getHostAddress(), p.getPort());
}
- int oldttl = impl.getTimeToLive();
- impl.setTimeToLive(((int) ttl) & 0xFF);
- impl.send(p);
- impl.setTimeToLive(oldttl);
+ int oldttl = getImpl().getTimeToLive();
+ getImpl().setTimeToLive(((int) ttl) & 0xFF);
+ getImpl().send(p);
+ getImpl().setTimeToLive(oldttl);
}
} // class MulticastSocket
diff --git a/libjava/java/net/ServerSocket.java b/libjava/java/net/ServerSocket.java
index f4d1ecc45de..597e641a346 100644
--- a/libjava/java/net/ServerSocket.java
+++ b/libjava/java/net/ServerSocket.java
@@ -73,8 +73,11 @@ public class ServerSocket
*/
private SocketImpl impl;
- private boolean closed = false;
-
+ /**
+ * True if socket is bound.
+ */
+ private boolean bound;
+
/*
* This constructor is only used by java.nio.
*/
@@ -82,6 +85,9 @@ public class ServerSocket
//ServerSocket (PlainSocketImpl impl) throws IOException
ServerSocket (SocketImpl impl) throws IOException
{
+ if (impl == null)
+ throw new NullPointerException("impl may not be null");
+
this.impl = impl;
this.impl.create (true);
}
@@ -208,22 +214,29 @@ public class ServerSocket
*/
public void bind (SocketAddress endpoint, int backlog) throws IOException
{
- if (closed)
- throw new SocketException ("ServerSocket is closed");
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
if (! (endpoint instanceof InetSocketAddress))
throw new IllegalArgumentException ("Address type not supported");
InetSocketAddress tmp = (InetSocketAddress) endpoint;
-
+
SecurityManager s = System.getSecurityManager ();
if (s != null)
s.checkListen (tmp.getPort ());
+ InetAddress addr = tmp.getAddress();
+
+ // Initialize addr with 0.0.0.0.
+ if (addr == null)
+ addr = InetAddress.ANY_IF;
+
try
{
- impl.bind (tmp.getAddress (), tmp.getPort ());
+ impl.bind(addr, tmp.getPort());
impl.listen(backlog);
+ bound = true;
}
catch (IOException exception)
{
@@ -249,12 +262,16 @@ public class ServerSocket
*/
public InetAddress getInetAddress()
{
+ if (!isBound())
+ return null;
+
try
{
return (InetAddress) impl.getOption (SocketOptions.SO_BINDADDR);
}
catch (SocketException e)
{
+ // This never happens as we are bound.
return null;
}
}
@@ -266,6 +283,9 @@ public class ServerSocket
*/
public int getLocalPort()
{
+ if (!isBound())
+ return -1;
+
return impl.getLocalPort();
}
@@ -276,12 +296,10 @@ public class ServerSocket
*/
public SocketAddress getLocalSocketAddress()
{
- InetAddress addr = getInetAddress();
-
- if (addr != null)
- return new InetSocketAddress (getInetAddress(), getLocalPort());
-
- return null;
+ if (!isBound())
+ return null;
+
+ return new InetSocketAddress(getInetAddress(), getLocalPort());
}
/**
@@ -303,10 +321,9 @@ public class ServerSocket
if (sm != null)
sm.checkListen (impl.getLocalPort ());
- Socket s = new Socket();
- implAccept (s);
-
- return s;
+ Socket socket = new Socket();
+ implAccept (socket);
+ return socket;
}
/**
@@ -322,14 +339,17 @@ public class ServerSocket
*
* @since 1.1
*/
- protected final void implAccept (Socket s)
+ protected final void implAccept (Socket socket)
throws IOException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
if (getChannel() != null
&& !getChannel().isBlocking())
throw new IllegalBlockingModeException();
- impl.accept(s.impl);
+ impl.accept(socket.getImpl());
}
/**
@@ -339,12 +359,15 @@ public class ServerSocket
*/
public void close () throws IOException
{
- impl.close ();
+ if (isClosed())
+ return;
+
+ impl.close();
+ impl = null;
+ bound = false;
if (getChannel() != null)
- getChannel().close ();
-
- closed = true;
+ getChannel().close();
}
/**
@@ -368,16 +391,7 @@ public class ServerSocket
*/
public boolean isBound()
{
- try
- {
- Object bindaddr = impl.getOption (SocketOptions.SO_BINDADDR);
- }
- catch (SocketException e)
- {
- return false;
- }
-
- return true;
+ return bound;
}
/**
@@ -387,7 +401,7 @@ public class ServerSocket
*/
public boolean isClosed()
{
- return closed;
+ return impl == null;
}
/**
@@ -404,6 +418,9 @@ public class ServerSocket
*/
public void setSoTimeout (int timeout) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
if (timeout < 0)
throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
@@ -424,6 +441,9 @@ public class ServerSocket
*/
public int getSoTimeout () throws IOException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT);
if (!(timeout instanceof Integer))
@@ -442,6 +462,9 @@ public class ServerSocket
public void setReuseAddress (boolean on)
throws SocketException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
@@ -455,6 +478,9 @@ public class ServerSocket
public boolean getReuseAddress()
throws SocketException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
@@ -478,6 +504,9 @@ public class ServerSocket
public void setReceiveBufferSize (int size)
throws SocketException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
if (size <= 0)
throw new IllegalArgumentException ("SO_RCVBUF value must be > 0");
@@ -498,6 +527,9 @@ public class ServerSocket
public int getReceiveBufferSize ()
throws SocketException
{
+ if (isClosed())
+ throw new SocketException("ServerSocket is closed");
+
Object buf = impl.getOption (SocketOptions.SO_RCVBUF);
if (!(buf instanceof Integer))
@@ -513,11 +545,15 @@ public class ServerSocket
*/
public String toString ()
{
- return "ServerSocket" + impl.toString();
+ if (!isBound())
+ return "ServerSocket[unbound]";
+
+ return ("ServerSocket[addr=" + getInetAddress()
+ + ",port=" + impl.getPort()
+ + ",localport=" + impl.getLocalPort()
+ + "]");
}
- // Class methods
-
/**
* Sets the <code>SocketImplFactory</code> for all
* <code>ServerSocket</code>'s. This may only be done
diff --git a/libjava/java/net/Socket.java b/libjava/java/net/Socket.java
index a5397bf7a49..9322e929ec3 100644
--- a/libjava/java/net/Socket.java
+++ b/libjava/java/net/Socket.java
@@ -68,26 +68,36 @@ import java.nio.channels.IllegalBlockingModeException;
*/
public class Socket
{
-
- // Class Variables
-
/**
* This is the user SocketImplFactory for this class. If this variable is
* null, a default factory is used.
*/
static SocketImplFactory factory;
- // Instance Variables
-
/**
* The implementation object to which calls are redirected
*/
- SocketImpl impl;
+ private SocketImpl impl;
+
+ /**
+ * True if socket implementation was created by calling their create() method.
+ */
+ private boolean implCreated;
+
+ /**
+ * True if the socket is bound.
+ */
+ private boolean bound;
- private boolean inputShutdown = false;
- private boolean outputShutdown = false;
+ /**
+ * True if input is shutdown.
+ */
+ private boolean inputShutdown;
- private boolean closed = false;
+ /**
+ * True if output is shutdown.
+ */
+ private boolean outputShutdown;
/**
* Initializes a new instance of <code>Socket</code> object without
@@ -173,7 +183,7 @@ public class Socket
*
* @param host The name of the remote host to connect to.
* @param port The remote port to connect to.
- * @param loadAddr The local address to bind to.
+ * @param localAddr The local address to bind to.
* @param localPort The local port to bind to.
*
* @exception SecurityException If the <code>SecurityManager</code>
@@ -296,6 +306,26 @@ public class Socket
// that default. JDK 1.2 doc infers not to do a bind.
}
+ // This has to be accessible from java.net.ServerSocket.
+ SocketImpl getImpl()
+ throws SocketException
+ {
+ try
+ {
+ if (!implCreated)
+ {
+ impl.create(true);
+ implCreated = true;
+ }
+ }
+ catch (IOException e)
+ {
+ throw new SocketException(e.getMessage());
+ }
+
+ return impl;
+ }
+
/**
* Binds the socket to the givent local address/port
*
@@ -310,8 +340,8 @@ public class Socket
*/
public void bind (SocketAddress bindpoint) throws IOException
{
- if (closed)
- throw new SocketException ("Socket is closed");
+ if (isClosed())
+ throw new SocketException("socket is closed");
// XXX: JDK 1.4.1 API documentation says that if bindpoint is null the
// socket will be bound to an ephemeral port and a valid local address.
@@ -323,13 +353,11 @@ public class Socket
InetSocketAddress tmp = (InetSocketAddress) bindpoint;
- // create socket
- impl.create (true);
-
// bind to address/port
try
{
- impl.bind (tmp.getAddress(), tmp.getPort());
+ getImpl().bind (tmp.getAddress(), tmp.getPort());
+ bound = true;
}
catch (IOException exception)
{
@@ -372,6 +400,8 @@ public class Socket
* until established or an error occurs.
*
* @param endpoint The address to connect to
+ * @param timeout The length of the timeout in milliseconds, or
+ * 0 to indicate no timeout.
*
* @exception IOException If an error occurs
* @exception IllegalArgumentException If the address type is not supported
@@ -384,11 +414,11 @@ public class Socket
public void connect (SocketAddress endpoint, int timeout)
throws IOException
{
- if (closed)
- throw new SocketException ("Socket is closed");
+ if (isClosed())
+ throw new SocketException("socket is closed");
if (! (endpoint instanceof InetSocketAddress))
- throw new IllegalArgumentException ("Address type not supported");
+ throw new IllegalArgumentException("unsupported address type");
if (getChannel() != null
&& !getChannel().isBlocking ())
@@ -399,7 +429,7 @@ public class Socket
try
{
- impl.connect (endpoint, timeout);
+ getImpl().connect (endpoint, timeout);
}
catch (IOException exception)
{
@@ -426,7 +456,19 @@ public class Socket
*/
public InetAddress getInetAddress ()
{
- return impl.getInetAddress();
+ if (!isConnected())
+ return null;
+
+ try
+ {
+ return getImpl().getInetAddress();
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are connected.
+ }
+
+ return null;
}
/**
@@ -440,9 +482,10 @@ public class Socket
public InetAddress getLocalAddress ()
{
InetAddress addr = null;
+
try
{
- addr = (InetAddress)impl.getOption(SocketOptions.SO_BINDADDR);
+ addr = (InetAddress) getImpl().getOption(SocketOptions.SO_BINDADDR);
}
catch(SocketException e)
{
@@ -472,8 +515,18 @@ public class Socket
*/
public int getPort ()
{
- if (impl != null)
- return impl.getPort();
+ if (!isConnected())
+ return 0;
+
+ try
+ {
+ if (getImpl() != null)
+ return getImpl().getPort();
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are connected.
+ }
return -1;
}
@@ -486,8 +539,18 @@ public class Socket
*/
public int getLocalPort ()
{
- if (impl != null)
- return impl.getLocalPort();
+ if (!isBound())
+ return -1;
+
+ try
+ {
+ if (getImpl() != null)
+ return getImpl().getLocalPort();
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are bound.
+ }
return -1;
}
@@ -500,12 +563,20 @@ public class Socket
*/
public SocketAddress getLocalSocketAddress()
{
- InetAddress addr = getLocalAddress ();
-
- if (addr == null)
+ if (!isBound())
return null;
- return new InetSocketAddress (addr, impl.getLocalPort());
+ InetAddress addr = getLocalAddress ();
+
+ try
+ {
+ return new InetSocketAddress (addr, getImpl().getLocalPort());
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are bound.
+ return null;
+ }
}
/**
@@ -519,7 +590,15 @@ public class Socket
if (!isConnected ())
return null;
- return new InetSocketAddress (impl.getInetAddress (), impl.getPort ());
+ try
+ {
+ return new InetSocketAddress (getImpl().getInetAddress (), getImpl().getPort ());
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are connected.
+ return null;
+ }
}
/**
@@ -531,10 +610,13 @@ public class Socket
*/
public InputStream getInputStream () throws IOException
{
- if (impl != null)
- return(impl.getInputStream());
-
- throw new IOException("Not connected");
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ if (!isConnected())
+ throw new IOException("not connected");
+
+ return getImpl().getInputStream();
}
/**
@@ -546,10 +628,13 @@ public class Socket
*/
public OutputStream getOutputStream () throws IOException
{
- if (impl != null)
- return impl.getOutputStream();
-
- throw new IOException("Not connected");
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ if (!isConnected())
+ throw new IOException("not connected");
+
+ return getImpl().getOutputStream();
}
/**
@@ -563,7 +648,10 @@ public class Socket
*/
public void setTcpNoDelay (boolean on) throws SocketException
{
- impl.setOption(SocketOptions.TCP_NODELAY, new Boolean(on));
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().setOption(SocketOptions.TCP_NODELAY, new Boolean(on));
}
/**
@@ -580,7 +668,10 @@ public class Socket
*/
public boolean getTcpNoDelay() throws SocketException
{
- Object on = impl.getOption(SocketOptions.TCP_NODELAY);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object on = getImpl().getOption(SocketOptions.TCP_NODELAY);
if (on instanceof Boolean)
return(((Boolean)on).booleanValue());
@@ -607,6 +698,9 @@ public class Socket
*/
public void setSoLinger(boolean on, int linger) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (on == true)
{
if (linger < 0)
@@ -615,11 +709,11 @@ public class Socket
if (linger > 65535)
linger = 65535;
- impl.setOption(SocketOptions.SO_LINGER, new Integer(linger));
+ getImpl().setOption(SocketOptions.SO_LINGER, new Integer(linger));
}
else
{
- impl.setOption(SocketOptions.SO_LINGER, new Boolean(false));
+ getImpl().setOption(SocketOptions.SO_LINGER, new Boolean(false));
}
}
@@ -641,7 +735,11 @@ public class Socket
*/
public int getSoLinger() throws SocketException
{
- Object linger = impl.getOption(SocketOptions.SO_LINGER);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object linger = getImpl().getOption(SocketOptions.SO_LINGER);
+
if (linger instanceof Integer)
return(((Integer)linger).intValue());
else
@@ -660,7 +758,10 @@ public class Socket
*/
public void sendUrgentData (int data) throws IOException
{
- impl.sendUrgentData (data);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().sendUrgentData (data);
}
/**
@@ -674,19 +775,27 @@ public class Socket
*/
public void setOOBInline (boolean on) throws SocketException
{
- impl.setOption(SocketOptions.SO_OOBINLINE, new Boolean(on));
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().setOption(SocketOptions.SO_OOBINLINE, new Boolean(on));
}
/**
* Returns the current setting of the SO_OOBINLINE option for this socket
*
+ * @return True if SO_OOBINLINE is set, false otherwise.
+ *
* @exception SocketException If an error occurs
*
* @since 1.4
*/
public boolean getOOBInline () throws SocketException
{
- Object buf = impl.getOption(SocketOptions.SO_OOBINLINE);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.SO_OOBINLINE);
if (buf instanceof Boolean)
return(((Boolean)buf).booleanValue());
@@ -713,10 +822,13 @@ public class Socket
*/
public synchronized void setSoTimeout (int timeout) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (timeout < 0)
throw new IllegalArgumentException("SO_TIMEOUT value must be >= 0");
- impl.setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
+ getImpl().setOption(SocketOptions.SO_TIMEOUT, new Integer(timeout));
}
/**
@@ -738,7 +850,10 @@ public class Socket
*/
public synchronized int getSoTimeout () throws SocketException
{
- Object timeout = impl.getOption(SocketOptions.SO_TIMEOUT);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object timeout = getImpl().getOption(SocketOptions.SO_TIMEOUT);
if (timeout instanceof Integer)
return(((Integer)timeout).intValue());
else
@@ -759,10 +874,13 @@ public class Socket
*/
public void setSendBufferSize (int size) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (size <= 0)
throw new IllegalArgumentException("SO_SNDBUF value must be > 0");
- impl.setOption(SocketOptions.SO_SNDBUF, new Integer(size));
+ getImpl().setOption(SocketOptions.SO_SNDBUF, new Integer(size));
}
/**
@@ -778,7 +896,10 @@ public class Socket
*/
public int getSendBufferSize () throws SocketException
{
- Object buf = impl.getOption(SocketOptions.SO_SNDBUF);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.SO_SNDBUF);
if (buf instanceof Integer)
return(((Integer)buf).intValue());
@@ -800,10 +921,13 @@ public class Socket
*/
public void setReceiveBufferSize (int size) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (size <= 0)
throw new IllegalArgumentException("SO_RCVBUF value must be > 0");
- impl.setOption(SocketOptions.SO_RCVBUF, new Integer(size));
+ getImpl().setOption(SocketOptions.SO_RCVBUF, new Integer(size));
}
/**
@@ -819,7 +943,10 @@ public class Socket
*/
public int getReceiveBufferSize () throws SocketException
{
- Object buf = impl.getOption(SocketOptions.SO_RCVBUF);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.SO_RCVBUF);
if (buf instanceof Integer)
return(((Integer)buf).intValue());
@@ -839,7 +966,10 @@ public class Socket
*/
public void setKeepAlive (boolean on) throws SocketException
{
- impl.setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on));
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().setOption(SocketOptions.SO_KEEPALIVE, new Boolean(on));
}
/**
@@ -854,7 +984,10 @@ public class Socket
*/
public boolean getKeepAlive () throws SocketException
{
- Object buf = impl.getOption(SocketOptions.SO_KEEPALIVE);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object buf = getImpl().getOption(SocketOptions.SO_KEEPALIVE);
if (buf instanceof Boolean)
return(((Boolean)buf).booleanValue());
@@ -869,13 +1002,15 @@ public class Socket
*/
public synchronized void close () throws IOException
{
- if (impl != null)
- impl.close();
+ if (isClosed())
+ return;
+
+ getImpl().close();
+ impl = null;
+ bound = false;
if (getChannel() != null)
getChannel().close();
-
- closed = true;
}
/**
@@ -885,10 +1020,21 @@ public class Socket
*/
public String toString ()
{
- return("Socket " + impl);
- }
+ try
+ {
+ if (isConnected())
+ return ("Socket[addr=" + getImpl().getInetAddress()
+ + ",port=" + getImpl().getPort()
+ + ",localport=" + getImpl().getLocalPort()
+ + "]");
+ }
+ catch (SocketException e)
+ {
+ // This cannot happen as we are connected.
+ }
- // Class Methods
+ return "Socket[unconnected]";
+ }
/**
* Sets the <code>SocketImplFactory</code>. This may be done only once per
@@ -930,9 +1076,10 @@ public class Socket
*/
public void shutdownInput() throws IOException
{
- if (impl != null)
- impl.shutdownInput();
-
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ getImpl().shutdownInput();
inputShutdown = true;
}
@@ -945,9 +1092,10 @@ public class Socket
*/
public void shutdownOutput() throws IOException
{
- if (impl != null)
- impl.shutdownOutput();
+ if (isClosed())
+ throw new SocketException("socket is closed");
+ getImpl().shutdownOutput();
outputShutdown = true;
}
@@ -966,13 +1114,18 @@ public class Socket
/**
* Checks if the SO_REUSEADDR option is enabled
*
+ * @return True if SO_REUSEADDR is set, false otherwise.
+ *
* @exception SocketException If an error occurs
*
* @since 1.4
*/
public boolean getReuseAddress () throws SocketException
{
- Object reuseaddr = impl.getOption (SocketOptions.SO_REUSEADDR);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object reuseaddr = getImpl().getOption (SocketOptions.SO_REUSEADDR);
if (!(reuseaddr instanceof Boolean))
throw new SocketException ("Internal Error");
@@ -983,18 +1136,22 @@ public class Socket
/**
* Enables/Disables the SO_REUSEADDR option
*
+ * @param reuseAddress True if SO_REUSEADDR should be set.
+ *
* @exception SocketException If an error occurs
*
* @since 1.4
*/
public void setReuseAddress (boolean on) throws SocketException
{
- impl.setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
+ getImpl().setOption (SocketOptions.SO_REUSEADDR, new Boolean (on));
}
/**
* Returns the current traffic class
*
+ * @return The current traffic class.
+ *
* @exception SocketException If an error occurs
*
* @see Socket#setTrafficClass(int tc)
@@ -1003,7 +1160,10 @@ public class Socket
*/
public int getTrafficClass () throws SocketException
{
- Object obj = impl.getOption(SocketOptions.IP_TOS);
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
+ Object obj = getImpl().getOption(SocketOptions.IP_TOS);
if (obj instanceof Integer)
return ((Integer) obj).intValue ();
@@ -1025,45 +1185,63 @@ public class Socket
*/
public void setTrafficClass (int tc) throws SocketException
{
+ if (isClosed())
+ throw new SocketException("socket is closed");
+
if (tc < 0 || tc > 255)
throw new IllegalArgumentException();
- impl.setOption (SocketOptions.IP_TOS, new Integer (tc));
+ getImpl().setOption (SocketOptions.IP_TOS, new Integer (tc));
}
/**
* Checks if the socket is connected
*
+ * @return True if socket is connected, false otherwise.
+ *
* @since 1.4
*/
public boolean isConnected ()
{
- return impl.getInetAddress () != null;
+ try
+ {
+ return getImpl().getInetAddress () != null;
+ }
+ catch (SocketException e)
+ {
+ return false;
+ }
}
/**
* Checks if the socket is already bound.
*
+ * @return True if socket is bound, false otherwise.
+ *
* @since 1.4
*/
public boolean isBound ()
{
- return getLocalAddress () != null;
+ return bound;
}
/**
* Checks if the socket is closed.
*
+ * @return True if socket is closed, false otherwise.
+ *
* @since 1.4
*/
public boolean isClosed ()
{
- return closed;
+ return impl == null;
}
/**
* Checks if the socket's input stream is shutdown
*
+ * @return True if input is shut down.
+ *
* @since 1.4
*/
public boolean isInputShutdown ()
@@ -1074,6 +1252,8 @@ public class Socket
/**
* Checks if the socket's output stream is shutdown
*
+ * @return True if output is shut down.
+ *
* @since 1.4
*/
public boolean isOutputShutdown ()
diff --git a/libjava/java/net/SocketPermission.java b/libjava/java/net/SocketPermission.java
index dea04e2432a..35006173828 100644
--- a/libjava/java/net/SocketPermission.java
+++ b/libjava/java/net/SocketPermission.java
@@ -147,9 +147,6 @@ public final class SocketPermission extends Permission
*/
public boolean equals(Object obj)
{
- if (obj == null)
- return (false);
-
if (!(obj instanceof SocketPermission))
return (false);
diff --git a/libjava/java/net/URL.java b/libjava/java/net/URL.java
index dd1ea4f0855..79771d916de 100644
--- a/libjava/java/net/URL.java
+++ b/libjava/java/net/URL.java
@@ -38,6 +38,7 @@ exception statement from your version. */
package java.net;
+import gnu.java.net.URLParseError;
import java.io.InputStream;
import java.io.IOException;
import java.io.Serializable;
@@ -56,7 +57,8 @@ import java.util.StringTokenizer;
* This final class represents an Internet Uniform Resource Locator (URL).
* For details on the syntax of URL's and what they can be used for,
* refer to RFC 1738, available from <a
- * href="http://ds.internic.net/rfcs/rfc1738.txt">http://ds.internic.net/rfcs/rfc1738.txt</a>
+ * href="http://ds.internic.net/rfcs/rfc1738.txt">
+ * http://ds.internic.net/rfcs/rfc1738.txt</a>
* <p>
* There are a great many protocols supported by URL's such as "http",
* "ftp", and "file". This object can handle any arbitrary URL for which
@@ -73,10 +75,10 @@ import java.util.StringTokenizer;
* If this property is set, it is assumed to be a "|" separated list of
* package names in which to attempt locating protocol handlers. The
* protocol handler is searched for by appending the string
- * ".<protocol>.Handler" to each packed in the list until a hander is found.
- * If a protocol handler is not found in this list of packages, or if the
- * property does not exist, then the default protocol handler of
- * "gnu.java.net.<protocol>.Handler" is tried. If this is
+ * ".&lt;protocol&gt;.Handler" to each packed in the list until a hander is
+ * found. If a protocol handler is not found in this list of packages, or if
+ * the property does not exist, then the default protocol handler of
+ * "gnu.java.net.&lt;protocol&gt;.Handler" is tried. If this is
* unsuccessful, a MalformedURLException is thrown.
* <p>
* All of the constructor methods of URL attempt to load a protocol
@@ -310,7 +312,7 @@ public final class URL implements Serializable
this((URL) null, spec, (URLStreamHandler) null);
}
- /*
+ /**
* This method parses a String representation of a URL within the
* context of an existing URL. Principally this means that any
* fields not present the URL are inheritied from the context URL.
@@ -431,8 +433,17 @@ public final class URL implements Serializable
// is to be excluded by passing the 'limit' as the indexOf the '#'
// if one exists, otherwise pass the end of the string.
int hashAt = spec.indexOf('#', colon + 1);
- this.ph.parseURL(this, spec, colon + 1,
- hashAt < 0 ? spec.length() : hashAt);
+
+ try
+ {
+ this.ph.parseURL(this, spec, colon + 1,
+ hashAt < 0 ? spec.length() : hashAt);
+ }
+ catch (URLParseError e)
+ {
+ throw new MalformedURLException(e.getMessage());
+ }
+
if (hashAt >= 0)
ref = spec.substring(hashAt + 1);
@@ -451,7 +462,7 @@ public final class URL implements Serializable
*/
public boolean equals (Object obj)
{
- if (obj == null || ! (obj instanceof URL))
+ if (! (obj instanceof URL))
return false;
return ph.equals (this, (URL) obj);
@@ -475,6 +486,10 @@ public final class URL implements Serializable
/**
* Gets the contents of this URL
*
+ * @param classes The allow classes for the content object.
+ *
+ * @return a context object for this URL.
+ *
* @exception IOException If an error occurs
*/
public final Object getContent (Class[] classes) throws IOException
@@ -487,6 +502,8 @@ public final class URL implements Serializable
* Returns the file portion of the URL.
* Defined as <code>path[?query]</code>.
* Returns the empty string if there is no file portion.
+ *
+ * @return The filename specified in this URL.
*/
public String getFile()
{
@@ -497,6 +514,8 @@ public final class URL implements Serializable
* Returns the path of the URL. This is the part of the file before any '?'
* character.
*
+ * @return The path specified in this URL.
+ *
* @since 1.3
*/
public String getPath()
@@ -507,6 +526,8 @@ public final class URL implements Serializable
/**
* Returns the authority of the URL
+ *
+ * @return The authority specified in this URL.
*
* @since 1.3
*/
@@ -517,6 +538,8 @@ public final class URL implements Serializable
/**
* Returns the host of the URL
+ *
+ * @return The host specified in this URL.
*/
public String getHost()
{
@@ -540,6 +563,8 @@ public final class URL implements Serializable
/**
* Returns the default port of the URL. If the StreamHandler for the URL
* protocol does not define a default port it returns -1.
+ *
+ * @return The default port of the current protocol.
*/
public int getDefaultPort()
{
@@ -548,6 +573,8 @@ public final class URL implements Serializable
/**
* Returns the protocol of the URL
+ *
+ * @return The specified protocol.
*/
public String getProtocol()
{
@@ -591,6 +618,8 @@ public final class URL implements Serializable
/**
* Returns a hashcode computed by the URLStreamHandler of this URL
+ *
+ * @return The hashcode for this URL.
*/
public int hashCode()
{
@@ -606,6 +635,7 @@ public final class URL implements Serializable
* openConnection() method of the protocol handler
*
* @return A URLConnection for this URL
+ *
* @exception IOException If an error occurs
*/
public URLConnection openConnection() throws IOException
@@ -617,6 +647,8 @@ public final class URL implements Serializable
* Opens a connection to this URL and returns an InputStream for reading
* from that connection
*
+ * @return An <code>InputStream</code> for this URL.
+ *
* @exception IOException If an error occurs
*/
public final InputStream openStream() throws IOException
@@ -673,6 +705,15 @@ public final class URL implements Serializable
* that only URLStreamHandlers can modify URL fields. URLs are otherwise
* constant.
*
+ * @param protocol The protocol name for this URL.
+ * @param host The hostname or IP address for this URL.
+ * @param port The port number of this URL.
+ * @param authority The authority of this URL.
+ * @param userInfo The user and password (if needed) of this URL.
+ * @param path The "path" portion of this URL.
+ * @param query The query of this URL.
+ * @param ref The anchor portion of this URL.
+ *
* @since 1.3
*/
protected void set(String protocol, String host, int port,
@@ -800,7 +841,8 @@ public final class URL implements Serializable
// to it, along with the JDK specified default as a last resort.
// Except in very unusual environments the JDK specified one shouldn't
// ever be needed (or available).
- String ph_search_path = System.getProperty ("java.protocol.handler.pkgs");
+ String ph_search_path =
+ System.getProperty("java.protocol.handler.pkgs");
// Tack our default package on at the ends.
if (ph_search_path != null)
@@ -813,7 +855,8 @@ public final class URL implements Serializable
do
{
- String clsName = pkgPrefix.nextToken() + "." + protocol + ".Handler";
+ String clsName = (pkgPrefix.nextToken() + "."
+ + protocol + ".Handler");
try
{
@@ -826,11 +869,11 @@ public final class URL implements Serializable
}
catch (Exception e)
{
- // Can't instantiate; handler still null, go on to next element.
+ // Can't instantiate; handler still null,
+ // go on to next element.
}
}
- while ((ph == null ||
- !(ph instanceof URLStreamHandler))
+ while ((! (ph instanceof URLStreamHandler))
&& pkgPrefix.hasMoreTokens());
}
diff --git a/libjava/java/net/URLStreamHandler.java b/libjava/java/net/URLStreamHandler.java
index 61b466cce6d..ec251297453 100644
--- a/libjava/java/net/URLStreamHandler.java
+++ b/libjava/java/net/URLStreamHandler.java
@@ -129,11 +129,12 @@ public abstract class URLStreamHandler
if (spec.regionMatches (start, "//", 0, 2))
{
+ String genuineHost;
int hostEnd;
- int colon;
+ int colon, at_host;
start += 2;
- int slash = spec.indexOf('/', start);
+ int slash = spec.indexOf ('/', start);
if (slash >= 0)
hostEnd = slash;
else
@@ -141,24 +142,37 @@ public abstract class URLStreamHandler
host = spec.substring (start, hostEnd);
+ // We first need a genuine host name (with userinfo).
+ // So we check for '@': if it's present check the port in the
+ // section after '@' in the other case check it in the full string.
+ // P.S.: We don't care having '@' at the beginning of the string.
+ if ((at_host = host.indexOf ('@')) >= 0)
+ genuineHost = host.substring (at_host);
+ else
+ genuineHost = host;
+
// Look for optional port number. It is valid for the non-port
// part of the host name to be null (e.g. a URL "http://:80").
// TBD: JDK 1.2 in this case sets host to null rather than "";
// this is undocumented and likely an unintended side effect in 1.2
// so we'll be simple here and stick with "". Note that
// "http://" or "http:///" produce a "" host in JDK 1.2.
- if ((colon = host.indexOf(':')) >= 0)
+ if ((colon = genuineHost.indexOf (':')) >= 0)
{
try
{
- port = Integer.parseInt(host.substring(colon + 1));
+ port = Integer.parseInt (genuineHost.substring (colon + 1));
}
catch (NumberFormatException e)
{
; // Ignore invalid port values; port is already set to u's
// port.
}
- host = host.substring(0, colon);
+ // Now we must cut the port number in the original string.
+ if (at_host >= 0)
+ host = host.substring (0, at_host + colon);
+ else
+ host = host.substring (0, colon);
}
file = null;
start = hostEnd;
@@ -204,6 +218,7 @@ public abstract class URLStreamHandler
}
catch (IOException e)
{
+ // Do nothing.
}
}
@@ -229,6 +244,9 @@ public abstract class URLStreamHandler
setURL(url, url.getProtocol(), host, port, file, ref);
}
+ /*
+ * Canonicalize a filename.
+ */
private static String canonicalizeFilename(String file)
{
// XXX - GNU Classpath has an implementation that might be more appropriate
@@ -261,6 +279,8 @@ public abstract class URLStreamHandler
* @param url1 The first url
* @param url2 The second url to compare with the first
*
+ * @return True if both URLs point to the same file, false otherwise.
+ *
* @specnote Now protected
*/
protected boolean sameFile(URL url1, URL url2)
@@ -349,6 +369,8 @@ public abstract class URLStreamHandler
*
* @param url1 An URL object
* @param url2 An URL object
+ *
+ * @return True if both given URLs are equal, false otherwise.
*/
protected boolean equals (URL url1, URL url2)
{
@@ -381,6 +403,11 @@ public abstract class URLStreamHandler
/**
* Compares the host components of two URLs.
*
+ * @param url1 The first URL.
+ * @param url2 The second URL.
+ *
+ * @return True if both URLs contain the same host.
+ *
* @exception UnknownHostException If an unknown host is found
*/
protected boolean hostsEqual (URL url1, URL url2)
@@ -403,12 +430,16 @@ public abstract class URLStreamHandler
/**
* Get the IP address of our host. An empty host field or a DNS failure will
* result in a null return.
+ *
+ * @param url The URL to return the host address for.
+ *
+ * @return The address of the hostname in url.
*/
protected InetAddress getHostAddress (URL url)
{
String hostname = url.getHost ();
- if (hostname == "")
+ if (hostname.equals(""))
return null;
try
@@ -424,6 +455,8 @@ public abstract class URLStreamHandler
/**
* Returns the default port for a URL parsed by this handler. This method is
* meant to be overidden by handlers with default port numbers.
+ *
+ * @return The default port number.
*/
protected int getDefaultPort ()
{
@@ -433,6 +466,10 @@ public abstract class URLStreamHandler
/**
* Provides the default hash calculation. May be overidden by handlers for
* other protocols that have different requirements for hashCode calculation.
+ *
+ * @param url The URL to calc the hashcode for.
+ *
+ * @return The hashcode for the given URL.
*/
protected int hashCode (URL url)
{
@@ -448,10 +485,12 @@ public abstract class URLStreamHandler
* that have a different syntax should override this method
*
* @param url The URL object to convert
+ *
+ * @return A string representation of the url
*/
protected String toExternalForm(URL u)
{
- String protocol, host, file, ref;
+ String protocol, host, file, ref, user;
int port;
protocol = u.getProtocol();
@@ -465,6 +504,7 @@ public abstract class URLStreamHandler
port = u.getPort();
file = u.getFile();
ref = u.getRef();
+ user = u.getUserInfo();
// Guess a reasonable size for the string buffer so we have to resize
// at most once.
@@ -478,15 +518,16 @@ public abstract class URLStreamHandler
}
if (host.length() != 0)
- sb.append("//").append(host);
-
- // Note that this produces different results from JDK 1.2 as JDK 1.2
- // ignores a non-default port if host is null or "". That is inconsistent
- // with the spec since the result of this method is spec'ed so it can be
- // used to construct a new URL that is equivalent to the original.
- boolean port_needed = port > 0 && port != getDefaultPort();
- if (port_needed)
- sb.append(':').append(port);
+ {
+ sb.append("//");
+ if (user != null && !"".equals(user))
+ sb.append(user).append('@');
+ sb.append(host);
+
+ // Append port if port was in URL spec.
+ if (port >= 0)
+ sb.append(':').append(port);
+ }
sb.append(file);
diff --git a/libjava/java/net/natNetworkInterfaceWin32.cc b/libjava/java/net/natNetworkInterfaceWin32.cc
index 20c9a9b5967..d4c2b173f89 100644
--- a/libjava/java/net/natNetworkInterfaceWin32.cc
+++ b/libjava/java/net/natNetworkInterfaceWin32.cc
@@ -70,18 +70,18 @@ winsock2GetRealNetworkInterfaces (jstring* pjstrName,
// have access to the real name under Winsock 2, we use
// "lo" for the loopback interface and ethX for the
// real ones.
- char szName[30];
+ TCHAR szName[30];
u_long lFlags = arInterfaceInfo[i].iiFlags;
if (lFlags & IFF_LOOPBACK)
- strcpy (szName, "lo");
+ _tcscpy (szName, _T("lo"));
else
{
- strcpy (szName, "eth");
- wsprintf(szName+3, "%d", nCurETHInterface++);
+ _tcscpy (szName, _T("eth"));
+ wsprintf(szName+3, _T("%d"), nCurETHInterface++);
}
- jstring if_name = JvNewStringLatin1 (szName);
+ jstring if_name = _Jv_Win32NewString (szName);
java::net::Inet4Address* address =
new java::net::Inet4Address (baddr, JvNewStringLatin1 (""));
pjstrName[i] = if_name;
diff --git a/libjava/java/nio/ByteBuffer.java b/libjava/java/nio/ByteBuffer.java
index 1727b410079..3be797750d0 100644
--- a/libjava/java/nio/ByteBuffer.java
+++ b/libjava/java/nio/ByteBuffer.java
@@ -278,8 +278,7 @@ public abstract class ByteBuffer extends Buffer
*/
public boolean equals (Object obj)
{
- if (obj != null &&
- obj instanceof ByteBuffer)
+ if (obj instanceof ByteBuffer)
{
return compareTo (obj) == 0;
}
diff --git a/libjava/java/nio/channels/Channels.java b/libjava/java/nio/channels/Channels.java
index 98fc2b6f8a5..cb6154e968d 100644
--- a/libjava/java/nio/channels/Channels.java
+++ b/libjava/java/nio/channels/Channels.java
@@ -1,5 +1,5 @@
/* Channels.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,6 +37,10 @@ exception statement from your version. */
package java.nio.channels;
+import gnu.java.nio.ChannelInputStream;
+import gnu.java.nio.ChannelOutputStream;
+import gnu.java.nio.InputStreamChannel;
+import gnu.java.nio.OutputStreamChannel;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.Reader;
@@ -53,33 +57,33 @@ public final class Channels
/**
* Constructs a stream that reads bytes from the given channel.
*/
- public static InputStream newInputStream (ReadableByteChannel ch)
+ public static InputStream newInputStream(ReadableByteChannel ch)
{
- throw new Error ("not implemented");
+ return new ChannelInputStream(ch);
}
/**
* Constructs a stream that writes bytes to the given channel.
*/
- public static OutputStream newOutputStream (WritableByteChannel ch)
+ public static OutputStream newOutputStream(WritableByteChannel ch)
{
- throw new Error ("not implemented");
+ return new ChannelOutputStream(ch);
}
/**
* Constructs a channel that reads bytes from the given stream.
*/
- public static ReadableByteChannel newChannel (InputStream in)
+ public static ReadableByteChannel newChannel(InputStream in)
{
- throw new Error ("not implemented");
+ return new InputStreamChannel(in);
}
/**
* Constructs a channel that writes bytes to the given stream.
*/
- public static WritableByteChannel newChannel (OutputStream out)
+ public static WritableByteChannel newChannel(OutputStream out)
{
- throw new Error ("not implemented");
+ return new OutputStreamChannel (out);
}
/**
diff --git a/libjava/java/nio/channels/FileChannelImpl.java b/libjava/java/nio/channels/FileChannelImpl.java
index a14a7e1dd43..89ac11ad514 100644
--- a/libjava/java/nio/channels/FileChannelImpl.java
+++ b/libjava/java/nio/channels/FileChannelImpl.java
@@ -169,7 +169,9 @@ public class FileChannelImpl extends FileChannel
byte[] buffer = new byte [dst.remaining ()];
result = implRead (buffer, 0, buffer.length);
- dst.put (buffer, 0, result);
+
+ if (result > 0)
+ dst.put (buffer, 0, result);
return result;
}
diff --git a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java b/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
index dd4177a8a01..0cf798eaf57 100644
--- a/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
+++ b/libjava/java/nio/channels/spi/AbstractInterruptibleChannel.java
@@ -49,7 +49,7 @@ import java.nio.channels.InterruptibleChannel;
public abstract class AbstractInterruptibleChannel
implements Channel, InterruptibleChannel
{
- boolean opened = true;
+ private boolean closed;
/**
* Initializes the channel.
@@ -72,8 +72,11 @@ public abstract class AbstractInterruptibleChannel
*/
public final void close () throws IOException
{
- opened = false;
- implCloseChannel ();
+ if (!closed)
+ {
+ implCloseChannel();
+ closed = true;
+ }
}
/**
@@ -101,6 +104,6 @@ public abstract class AbstractInterruptibleChannel
*/
public final boolean isOpen ()
{
- return opened;
+ return !closed;
}
}
diff --git a/libjava/java/nio/channels/spi/AbstractSelector.java b/libjava/java/nio/channels/spi/AbstractSelector.java
index 58ce0c84f60..ca7718733d7 100644
--- a/libjava/java/nio/channels/spi/AbstractSelector.java
+++ b/libjava/java/nio/channels/spi/AbstractSelector.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.nio.channels.spi;
import java.io.IOException;
+import java.nio.channels.ClosedSelectorException;
import java.nio.channels.SelectionKey;
import java.nio.channels.Selector;
import java.util.Set;
@@ -64,7 +65,7 @@ public abstract class AbstractSelector extends Selector
*
* @exception IOException If an error occurs
*/
- public final void close () throws IOException
+ public final synchronized void close () throws IOException
{
if (closed)
return;
@@ -102,12 +103,18 @@ public abstract class AbstractSelector extends Selector
protected final Set cancelledKeys()
{
+ if (!isOpen())
+ throw new ClosedSelectorException();
+
return cancelledKeys;
}
final void cancelKey (AbstractSelectionKey key)
{
- cancelledKeys.remove (key);
+ synchronized (cancelledKeys)
+ {
+ cancelledKeys.remove(key);
+ }
}
/**
diff --git a/libjava/java/rmi/MarshalledObject.java b/libjava/java/rmi/MarshalledObject.java
index 9f966b9d9dc..0ba91580d1a 100644
--- a/libjava/java/rmi/MarshalledObject.java
+++ b/libjava/java/rmi/MarshalledObject.java
@@ -76,7 +76,7 @@ public final class MarshalledObject
public boolean equals(Object obj)
{
- if(obj == null || !(obj instanceof MarshalledObject) )
+ if (! (obj instanceof MarshalledObject))
return false;
// hashCode even differs, don't do the time-consuming comparisons
diff --git a/libjava/java/rmi/Naming.java b/libjava/java/rmi/Naming.java
index 2dd50d32804..1d2e68b982f 100644
--- a/libjava/java/rmi/Naming.java
+++ b/libjava/java/rmi/Naming.java
@@ -62,7 +62,14 @@ public static Remote lookup(String name) throws NotBoundException, MalformedURLE
// hack to accept "rmi://host:port/service" strings
if(name.startsWith("rmi:")){ name = name.substring(4); }
URL u = new URL("http:" + name);
- return (getRegistry(u).lookup(u.getFile().substring(1)));
+ String filename = u.getFile();
+
+ // If the filename begins with a slash we must cut it for
+ // name resolution.
+ if (filename.charAt(0) == '/')
+ return (getRegistry(u).lookup(filename.substring(1)));
+ else
+ return (getRegistry(u).lookup(filename));
}
/**
@@ -75,7 +82,13 @@ public static Remote lookup(String name) throws NotBoundException, MalformedURLE
*/
public static void bind(String name, Remote obj) throws AlreadyBoundException, MalformedURLException, RemoteException {
URL u = new URL("http:" + name);
- getRegistry(u).bind(u.getFile().substring(1), obj);
+ String filename = u.getFile();
+ // If the filename begins with a slash we must cut it for
+ // name resolution.
+ if (filename.charAt(0) == '/')
+ getRegistry(u).bind(filename.substring(1), obj);
+ else
+ getRegistry(u).bind(filename, obj);
}
/**
@@ -87,7 +100,13 @@ public static void bind(String name, Remote obj) throws AlreadyBoundException, M
*/
public static void unbind(String name) throws RemoteException, NotBoundException, MalformedURLException {
URL u = new URL("http:" + name);
- getRegistry(u).unbind(u.getFile().substring(1));
+ String filename = u.getFile();
+ // If the filename begins with a slash we must cut it for
+ // name resolution.
+ if (filename.charAt(0) == '/')
+ getRegistry(u).unbind(filename.substring(1));
+ else
+ getRegistry(u).unbind(filename);
}
/**
@@ -100,7 +119,13 @@ public static void unbind(String name) throws RemoteException, NotBoundException
*/
public static void rebind(String name, Remote obj) throws RemoteException, MalformedURLException {
URL u = new URL("http:" + name);
- getRegistry(u).rebind(u.getFile().substring(1), obj);
+ String filename = u.getFile();
+ // If the filename begins with a slash we must cut it for
+ // name resolution.
+ if (filename.charAt(0) == '/')
+ getRegistry(u).rebind(filename.substring(1), obj);
+ else
+ getRegistry(u).rebind(filename, obj);
}
/**
diff --git a/libjava/java/rmi/server/RMIClassLoader.java b/libjava/java/rmi/server/RMIClassLoader.java
index 57e52a363ba..e6af682a452 100644
--- a/libjava/java/rmi/server/RMIClassLoader.java
+++ b/libjava/java/rmi/server/RMIClassLoader.java
@@ -113,8 +113,7 @@ public class RMIClassLoader
*/
public boolean equals (Object theOther)
{
- if (theOther != null
- && theOther instanceof CacheKey)
+ if (theOther instanceof CacheKey)
{
CacheKey key = (CacheKey) theOther;
diff --git a/libjava/java/security/DigestInputStream.java b/libjava/java/security/DigestInputStream.java
index 3b01dea5526..9fa987aa4fa 100644
--- a/libjava/java/security/DigestInputStream.java
+++ b/libjava/java/security/DigestInputStream.java
@@ -1,5 +1,5 @@
/* DigestInputStream.java --- An Input stream tied to a message digest
- Copyright (C) 1999 Free Software Foundation, Inc.
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -138,7 +138,7 @@ public class DigestInputStream extends FilterInputStream
int temp = in.read(b, off, len);
if (state == true && temp != -1)
- digest.update(b, off, len);
+ digest.update(b, off, temp);
return temp;
}
diff --git a/libjava/java/security/Security.java b/libjava/java/security/Security.java
index 350c04f101f..ef716150ab4 100644
--- a/libjava/java/security/Security.java
+++ b/libjava/java/security/Security.java
@@ -475,7 +475,7 @@ public final class Security extends Object
* provider that supplied a CertificateFactory implementation for X.509
* certificates.</p></li>
*
- * <li><p>&lt;crypto_service>.&lt;algorithm_or_type>&nbsp;&lt;attribute_name>:&lt;attribute_value></p>
+ * <li><p>&lt;crypto_service>.&lt;algorithm_or_type> &lt;attribute_name>:&lt;attribute_value></p>
* <p>The cryptographic service name must not contain any dots. There must
* be one or more space charaters between the the &lt;algorithm_or_type>
* and the &lt;attribute_name>.</p>
diff --git a/libjava/java/security/cert/CertStore.java b/libjava/java/security/cert/CertStore.java
index 44143c5ad6c..55326a4b2c9 100644
--- a/libjava/java/security/cert/CertStore.java
+++ b/libjava/java/security/cert/CertStore.java
@@ -215,8 +215,7 @@ public class CertStore
catch (java.lang.reflect.InvocationTargetException ite)
{
Throwable cause = ite.getCause();
- if (cause != null &&
- (cause instanceof InvalidAlgorithmParameterException))
+ if (cause instanceof InvalidAlgorithmParameterException)
throw (InvalidAlgorithmParameterException) cause;
else
throw new NoSuchAlgorithmException(type);
diff --git a/libjava/java/sql/Timestamp.java b/libjava/java/sql/Timestamp.java
index be0aa4dcd02..22108f58f93 100644
--- a/libjava/java/sql/Timestamp.java
+++ b/libjava/java/sql/Timestamp.java
@@ -58,11 +58,7 @@ public class Timestamp extends java.util.Date
/**
* Used for parsing and formatting this date.
*/
- // Millisecond will have to be close enough for now.
- private static SimpleDateFormat parse_sdf =
- new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSSS");
-
- private static SimpleDateFormat format_sdf =
+ private static SimpleDateFormat sdf =
new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
/**
@@ -79,14 +75,35 @@ public class Timestamp extends java.util.Date
*/
public static Timestamp valueOf(String str)
{
+ int nanos = 0;
+ int dot = str.indexOf('.');
+ if (dot != -1)
+ {
+ if (str.lastIndexOf('.') != dot)
+ throw new IllegalArgumentException(str);
+
+ int len = str.length() - dot - 1;
+ if (len < 1 || len > 9)
+ throw new IllegalArgumentException(str);
+
+ nanos = Integer.parseInt(str.substring(dot + 1));
+ for (int i = len; i < 9; i++)
+ nanos *= 10;
+
+ str = str.substring(0, dot);
+
+ }
+
try
{
- java.util.Date d = (java.util.Date)parse_sdf.parseObject(str);
+ java.util.Date d = (java.util.Date)sdf.parseObject(str);
if (d == null)
throw new IllegalArgumentException(str);
- else
- return new Timestamp(d.getTime());
+
+ Timestamp ts = new Timestamp(d.getTime() + nanos / 1000000);
+ ts.nanos = nanos;
+ return ts;
}
catch (ParseException e)
{
@@ -133,7 +150,7 @@ public class Timestamp extends java.util.Date
*/
public String toString()
{
- return format_sdf.format(this) + "." + getNanos();
+ return sdf.format(this) + "." + getNanos();
}
/**
@@ -207,9 +224,6 @@ public class Timestamp extends java.util.Date
*/
public boolean equals(Object obj)
{
- if (obj == null)
- return false;
-
if (!(obj instanceof Timestamp))
return false;
diff --git a/libjava/java/text/DateFormat.java b/libjava/java/text/DateFormat.java
index 76bf535577a..745a16b3ec2 100644
--- a/libjava/java/text/DateFormat.java
+++ b/libjava/java/text/DateFormat.java
@@ -1,5 +1,5 @@
/* DateFormat.java -- Class for formatting/parsing date/times
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,7 +38,13 @@ exception statement from your version. */
package java.text;
-import java.util.*;
+import java.io.InvalidObjectException;
+import java.util.Calendar;
+import java.util.Date;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.TimeZone;
/**
* @author Per Bothner <bothner@cygnus.com>
@@ -86,6 +92,97 @@ public abstract class DateFormat extends Format implements Cloneable
public static final int HOUR0_FIELD = 16;
public static final int TIMEZONE_FIELD = 17;
+
+ public static class Field extends Format.Field
+ {
+ static final long serialVersionUID = 7441350119349544720L;
+
+ private int calendarField;
+
+ public static final DateFormat.Field ERA
+ = new Field("era", Calendar.ERA);
+ public static final DateFormat.Field YEAR
+ = new Field("year", Calendar.YEAR);
+ public static final DateFormat.Field MONTH
+ = new Field("month", Calendar.MONTH);
+ public static final DateFormat.Field DAY_OF_MONTH
+ = new Field("day of month", Calendar.DAY_OF_MONTH);
+ public static final DateFormat.Field HOUR_OF_DAY1
+ = new Field("hour of day 1", Calendar.HOUR_OF_DAY);
+ public static final DateFormat.Field HOUR_OF_DAY0
+ = new Field("hour of day 0", Calendar.HOUR_OF_DAY);
+ public static final DateFormat.Field MINUTE
+ = new Field("minute", Calendar.MINUTE);
+ public static final DateFormat.Field SECOND
+ = new Field("second", Calendar.SECOND);
+ public static final DateFormat.Field MILLISECOND
+ = new Field("millisecond", Calendar.MILLISECOND);
+ public static final DateFormat.Field DAY_OF_WEEK
+ = new Field("day of week", Calendar.DAY_OF_WEEK);
+ public static final DateFormat.Field DAY_OF_YEAR
+ = new Field("day of year", Calendar.DAY_OF_YEAR);
+ public static final DateFormat.Field DAY_OF_WEEK_IN_MONTH
+ = new Field("day of week in month", Calendar.DAY_OF_WEEK_IN_MONTH);
+ public static final DateFormat.Field WEEK_OF_YEAR
+ = new Field("week of year", Calendar.WEEK_OF_YEAR);
+ public static final DateFormat.Field WEEK_OF_MONTH
+ = new Field("week of month", Calendar.WEEK_OF_MONTH);
+ public static final DateFormat.Field AM_PM
+ = new Field("am/pm", Calendar.AM_PM);
+ public static final DateFormat.Field HOUR1
+ = new Field("hour1", Calendar.HOUR);
+ public static final DateFormat.Field HOUR0
+ = new Field("hour0", Calendar.HOUR);
+ public static final DateFormat.Field TIME_ZONE
+ = new Field("timezone", Calendar.ZONE_OFFSET);
+
+ public static final DateFormat.Field[] allFields =
+ {
+ ERA, YEAR, MONTH, DAY_OF_MONTH, HOUR_OF_DAY1,
+ HOUR_OF_DAY0, MINUTE, SECOND, MILLISECOND,
+ DAY_OF_WEEK, DAY_OF_YEAR, DAY_OF_WEEK_IN_MONTH,
+ WEEK_OF_YEAR, WEEK_OF_MONTH, AM_PM, HOUR1, HOUR0,
+ TIME_ZONE
+ };
+
+ // For deserialization
+ private Field()
+ {
+ super("");
+ }
+
+ protected Field(String name, int calendarField)
+ {
+ super(name);
+ this.calendarField = calendarField;
+ }
+
+ public int getCalendarField()
+ {
+ return calendarField;
+ }
+
+ public static Field ofCalendarField(int calendarField)
+ {
+ if (calendarField >= allFields.length || calendarField < 0)
+ throw new IllegalArgumentException("no such calendar field ("
+ + calendarField + ")");
+
+ return allFields[calendarField];
+ }
+
+ protected Object readResolve() throws InvalidObjectException
+ {
+ String s = getName();
+
+ for (int i=0;i<allFields.length;i++)
+ if (s.equals(allFields[i].getName()))
+ return allFields[i];
+
+ throw new InvalidObjectException("no such DateFormat field called " + s);
+ }
+ }
+
/**
* This method initializes a new instance of <code>DateFormat</code>.
*/
@@ -152,7 +249,9 @@ public abstract class DateFormat extends Format implements Cloneable
if (obj instanceof Number)
obj = new Date(((Number) obj).longValue());
else if (! (obj instanceof Date))
- throw new IllegalArgumentException ("Cannot format given Object as a Date");
+ throw new IllegalArgumentException
+ ("Cannot format given Object as a Date");
+
return format ((Date) obj, buf, pos);
}
diff --git a/libjava/java/text/DecimalFormat.java b/libjava/java/text/DecimalFormat.java
index 7c5d5b0ba7b..359ad5591b0 100644
--- a/libjava/java/text/DecimalFormat.java
+++ b/libjava/java/text/DecimalFormat.java
@@ -37,6 +37,7 @@ exception statement from your version. */
package java.text;
+import java.util.Currency;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -202,6 +203,8 @@ public class DecimalFormat extends NumberFormat
}
else if (c != syms.getExponential()
&& c != syms.getPatternSeparator()
+ && c != syms.getPercent()
+ && c != syms.getPerMill()
&& patChars.indexOf(c) != -1)
throw new IllegalArgumentException ("unexpected special " +
"character - index: " + index);
@@ -635,6 +638,19 @@ public class DecimalFormat extends NumberFormat
return dest;
}
+ /**
+ * Returns the currency corresponding to the currency symbol stored
+ * in the instance of <code>DecimalFormatSymbols</code> used by this
+ * <code>DecimalFormat</code>.
+ *
+ * @return A new instance of <code>Currency</code> if
+ * the currency code matches a known one, null otherwise.
+ */
+ public Currency getCurrency()
+ {
+ return symbols.getCurrency();
+ }
+
public DecimalFormatSymbols getDecimalFormatSymbols ()
{
return symbols;
@@ -854,6 +870,16 @@ public class DecimalFormat extends NumberFormat
return result;
}
+ /**
+ * Sets the <code>Currency</code> on the
+ * <code>DecimalFormatSymbols</code> used, which also sets the
+ * currency symbols on those symbols.
+ */
+ public void setCurrency(Currency currency)
+ {
+ symbols.setCurrency(currency);
+ }
+
public void setDecimalFormatSymbols (DecimalFormatSymbols newSymbols)
{
symbols = newSymbols;
diff --git a/libjava/java/text/DecimalFormatSymbols.java b/libjava/java/text/DecimalFormatSymbols.java
index 2c1d971a649..268fe2cf987 100644
--- a/libjava/java/text/DecimalFormatSymbols.java
+++ b/libjava/java/text/DecimalFormatSymbols.java
@@ -39,6 +39,7 @@ exception statement from your version. */
package java.text;
import java.io.Serializable;
+import java.util.Currency;
import java.util.Locale;
import java.util.MissingResourceException;
import java.util.ResourceBundle;
@@ -157,6 +158,7 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
percent = safeGetChar (res, "percent", '%');
perMill = safeGetChar (res, "perMill", '\u2030');
zeroDigit = safeGetChar (res, "zeroDigit", '0');
+ locale = loc;
}
/**
@@ -195,6 +197,18 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
}
/**
+ * Returns the currency corresponding to the currency symbol stored
+ * in the instance of <code>DecimalFormatSymbols</code>.
+ *
+ * @return A new instance of <code>Currency</code> if
+ * the currency code matches a known one.
+ */
+ public Currency getCurrency ()
+ {
+ return Currency.getInstance (currencySymbol);
+ }
+
+ /**
* This method returns the currency symbol in local format. For example,
* "$" for Canadian dollars.
*
@@ -354,6 +368,16 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
}
/**
+ * This method sets the currency to the specified value.
+ *
+ * @param currency The new currency
+ */
+ public void setCurrency (Currency currency)
+ {
+ setCurrencySymbol (currency.getSymbol());
+ }
+
+ /**
* This method sets the currency symbol to the specified value.
*
* @param currencySymbol The new currency symbol
@@ -557,13 +581,20 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
/**
* @serial This value represents the type of object being de-serialized.
* 0 indicates a pre-Java 1.1.6 version, 1 indicates 1.1.6 or later.
- */
- private int serialVersionOnStream = 1;
+ * 0 indicates a pre-Java 1.1.6 version, 1 indicates 1.1.6 or later,
+ * 2 indicates 1.4 or later
+ */
+ private int serialVersionOnStream = 2;
/**
* @serial This is the character used to represent 0.
*/
private char zeroDigit;
+ /**
+ * @serial The locale of these currency symbols.
+ */
+ private Locale locale;
+
private static final long serialVersionUID = 5772796243397350300L;
private void readObject(ObjectInputStream stream)
@@ -574,7 +605,10 @@ public final class DecimalFormatSymbols implements Cloneable, Serializable
{
monetarySeparator = decimalSeparator;
exponential = 'E';
- serialVersionOnStream = 1;
}
+ if (serialVersionOnStream < 2)
+ locale = Locale.getDefault();
+
+ serialVersionOnStream = 2;
}
}
diff --git a/libjava/java/text/FieldPosition.java b/libjava/java/text/FieldPosition.java
index b31ce707a9f..74f806a2fbb 100644
--- a/libjava/java/text/FieldPosition.java
+++ b/libjava/java/text/FieldPosition.java
@@ -65,6 +65,38 @@ public class FieldPosition
private int end;
/**
+ * This is the field attribute value.
+ */
+ private Format.Field field_attribute;
+
+ /**
+ * This method initializes a new instance of <code>FieldPosition</code>
+ * to have the specified field attribute. The attribute will be used as
+ * an id.
+ *
+ * @param field The field format attribute.
+ */
+ public FieldPosition (Format.Field field)
+ {
+ this.field_attribute = field;
+ }
+
+ /**
+ * This method initializes a new instance of <code>FieldPosition</code>
+ * to have the specified field attribute. The attribute will be used as
+ * an id is non null. The integer field id is only used if the Format.Field
+ * attribute is not used by the formatter.
+ *
+ * @param field The field format attribute.
+ * @param field_id The field identifier value.
+ */
+ public FieldPosition (Format.Field field, int field_id)
+ {
+ this.field_attribute = field;
+ this.field_id = field_id;
+ }
+
+ /**
* This method initializes a new instance of <code>FieldPosition</code> to
* have the specified field id.
*
@@ -85,6 +117,11 @@ public class FieldPosition
return field_id;
}
+ public Format.Field getFieldAttribute ()
+ {
+ return field_attribute;
+ }
+
/**
* This method returns the beginning index for this field.
*
@@ -131,9 +168,9 @@ public class FieldPosition
* <p>
* <ul>
* <li>The specified object is not <code>null</code>.
- * <li>The specified object is an instance of <code>FieldPosition</code>.
- * <li>The specified object has the same field identifier and beginning
- * and ending index as this object.
+ * <li>The specified object has the same class as this object.
+ * <li>The specified object has the same field identifier, field attribute
+ * and beginning and ending index as this object.
* </ul>
*
* @param obj The object to test for equality to this object.
@@ -143,15 +180,40 @@ public class FieldPosition
*/
public boolean equals (Object obj)
{
- if (! (obj instanceof FieldPosition))
+ if (this == obj)
+ return true;
+
+ if (obj == null || obj.getClass() != this.getClass())
return false;
FieldPosition fp = (FieldPosition) obj;
return (field_id == fp.field_id
+ && (field_attribute == fp.field_attribute
+ || (field_attribute != null
+ && field_attribute.equals(fp.field_attribute)))
&& begin == fp.begin
&& end == fp.end);
}
+
+ /**
+ * This method returns a hash value for this object
+ *
+ * @return A hash value for this object.
+ */
+ public int hashCode ()
+ {
+ int hash = 5;
+
+ hash = 31 * hash + field_id;
+ hash = 31 * hash + begin;
+ hash = 31 * hash + end;
+ hash = 31 * hash +
+ (null == field_attribute ? 0 : field_attribute.hashCode());
+
+ return hash;
+ }
+
/**
* This method returns a <code>String</code> representation of this
* object.
@@ -160,7 +222,11 @@ public class FieldPosition
*/
public String toString ()
{
- return (getClass ().getName () + "[field=" + getField () + ",beginIndex="
- + getBeginIndex () + ",endIndex=" + getEndIndex () + "]");
+ return (getClass ().getName ()
+ + "[field=" + getField ()
+ + ",attribute=" + getFieldAttribute ()
+ + ",beginIndex=" + getBeginIndex ()
+ + ",endIndex=" + getEndIndex ()
+ + "]");
}
}
diff --git a/libjava/java/text/Format.java b/libjava/java/text/Format.java
index ab61f28ae30..f64951bb94c 100644
--- a/libjava/java/text/Format.java
+++ b/libjava/java/text/Format.java
@@ -1,5 +1,5 @@
/* Format.java -- Abstract superclass for formatting/parsing strings.
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,6 +38,10 @@ exception statement from your version. */
package java.text;
+import java.util.Set;
+import java.util.Map;
+import java.util.HashSet;
+import java.util.HashMap;
import java.io.Serializable;
/**
@@ -59,8 +63,18 @@ import java.io.Serializable;
*/
public abstract class Format implements Serializable, Cloneable
{
- static final long serialVersionUID = 4479235611355683992L;
+ static final long serialVersionUID = -299282585814624189L;
+ public static class Field extends AttributedCharacterIterator.Attribute
+ {
+ static final long serialVersionUID = 276966692217360283L;
+
+ public Field(String name)
+ {
+ super(name);
+ }
+ }
+
/**
* This method initializes a new instance of <code>Format</code>.
* It performs no actions, but acts as a default constructor for
@@ -142,6 +156,11 @@ public abstract class Format implements Serializable, Cloneable
*/
public abstract Object parseObject (String str, ParsePosition pos);
+ public AttributedCharacterIterator formatToCharacterIterator(Object obj)
+ {
+ return new FormatCharacterIterator(format(obj), null, null);
+ }
+
/**
* Creates a copy of this object.
*
diff --git a/libjava/java/text/FormatCharacterIterator.java b/libjava/java/text/FormatCharacterIterator.java
new file mode 100644
index 00000000000..a31154c531a
--- /dev/null
+++ b/libjava/java/text/FormatCharacterIterator.java
@@ -0,0 +1,469 @@
+/* FormatCharacter.java -- Implementation of AttributedCharacterIterator for
+ formatters.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+package java.text;
+
+import java.util.Set;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.HashMap;
+import java.util.Vector;
+
+
+/**
+ * This class should not be put public and it is only intended to the
+ * classes of the java.text package. Its aim is to build a segmented
+ * character iterator by appending strings and adding attributes to
+ * portions of strings. The code intends to do some optimization
+ * concerning memory consumption and attribute access but at the
+ * end it is only an AttributedCharacterIterator.
+ *
+ * @author Guilhem Lavaux <guilhem@kaffe.org>
+ * @date November 22, 2003
+ */
+class FormatCharacterIterator implements AttributedCharacterIterator
+{
+ private String formattedString;
+ private int charIndex;
+ private int attributeIndex;
+ private int[] ranges;
+ private HashMap[] attributes;
+
+ /**
+ * This constructor builds an empty iterated strings. The attributes
+ * are empty and so is the string. However you may append strings
+ * and attributes to this iterator.
+ */
+ FormatCharacterIterator()
+ {
+ formattedString = "";
+ ranges = new int[0];
+ attributes = new HashMap[0];
+ }
+
+ /**
+ * This constructor take a string <code>s</code>, a set of ranges
+ * and the corresponding attributes. This is used to build an iterator.
+ * The array <code>ranges</code> should be formatted as follow:
+ * each element of <code>ranges</code> specifies the index in the string
+ * until which the corresponding map of attributes at the same position
+ * is applied. For example, if you have:
+ * <pre>
+ * s = "hello";
+ * ranges = new int[] { 2, 6 };
+ * attributes = new HashMap[2];
+ * </pre>
+ * <code>"he"</code> will have the attributes <code>attributes[0]</code>,
+ * <code>"llo"</code> the <code>attributes[1]</code>.
+ */
+ FormatCharacterIterator (String s, int[] ranges, HashMap[] attributes)
+ {
+ formattedString = s;
+ this.ranges = ranges;
+ this.attributes = attributes;
+ }
+
+ /*
+ * The following methods are inherited from AttributedCharacterIterator,
+ * and thus are already documented.
+ */
+
+ public Set getAllAttributeKeys()
+ {
+ if (attributes != null && attributes[attributeIndex] != null)
+ return attributes[attributeIndex].keySet();
+ else
+ return new HashSet();
+ }
+
+ public Map getAttributes()
+ {
+ if (attributes != null && attributes[attributeIndex] != null)
+ return attributes[attributeIndex];
+ else
+ return new HashMap();
+ }
+
+ public Object getAttribute (AttributedCharacterIterator.Attribute attrib)
+ {
+ if (attributes != null && attributes[attributeIndex] != null)
+ return attributes[attributeIndex].get (attrib);
+ else
+ return null;
+ }
+
+ public int getRunLimit(Set reqAttrs)
+ {
+ if (attributes == null)
+ return formattedString.length();
+
+ int currentAttrIndex = attributeIndex;
+ Set newKeys;
+
+ do
+ {
+ currentAttrIndex++;
+ if (currentAttrIndex == attributes.length)
+ return formattedString.length();
+ if (attributes[currentAttrIndex] == null)
+ break;
+ newKeys = attributes[currentAttrIndex].keySet();
+ }
+ while (newKeys.containsAll (reqAttrs));
+
+ return ranges[currentAttrIndex-1];
+ }
+
+ public int getRunLimit (AttributedCharacterIterator.Attribute attribute)
+ {
+ Set s = new HashSet();
+
+ s.add (attribute);
+ return getRunLimit (s);
+ }
+
+ public int getRunLimit()
+ {
+ if (attributes == null)
+ return formattedString.length();
+ if (attributes[attributeIndex] == null)
+ {
+ for (int i=attributeIndex+1;i<attributes.length;i++)
+ if (attributes[i] != null)
+ return ranges[i-1];
+ return formattedString.length();
+ }
+
+ return getRunLimit (attributes[attributeIndex].keySet());
+ }
+
+ public int getRunStart (Set reqAttrs)
+ {
+ if (attributes == null)
+ return formattedString.length();
+
+ int currentAttrIndex = attributeIndex;
+ Set newKeys = null;
+
+ do
+ {
+ if (currentAttrIndex == 0)
+ return 0;
+
+ currentAttrIndex--;
+ if (attributes[currentAttrIndex] == null)
+ break;
+ newKeys = attributes[currentAttrIndex].keySet();
+ }
+ while (newKeys.containsAll (reqAttrs));
+
+ return (currentAttrIndex > 0) ? ranges[currentAttrIndex-1] : 0;
+ }
+
+ public int getRunStart()
+ {
+ if (attributes == null)
+ return 0;
+
+ if (attributes[attributeIndex] == null)
+ {
+ for (int i=attributeIndex;i>0;i--)
+ if (attributes[i] != null)
+ return ranges[attributeIndex-1];
+ return 0;
+ }
+
+ return getRunStart (attributes[attributeIndex].keySet());
+ }
+
+ public int getRunStart (AttributedCharacterIterator.Attribute attribute)
+ {
+ Set s = new HashSet();
+
+ s.add (attribute);
+ return getRunStart (s);
+ }
+
+ public Object clone()
+ {
+ return new FormatCharacterIterator (formattedString, ranges, attributes);
+ }
+
+ /*
+ * The following methods are inherited from CharacterIterator and thus
+ * are already documented.
+ */
+
+ public char current()
+ {
+ return formattedString.charAt (charIndex);
+ }
+
+ public char first()
+ {
+ charIndex = 0;
+ attributeIndex = 0;
+ return formattedString.charAt (0);
+ }
+
+ public int getBeginIndex()
+ {
+ return 0;
+ }
+
+ public int getEndIndex()
+ {
+ return formattedString.length();
+ }
+
+ public int getIndex()
+ {
+ return charIndex;
+ }
+
+ public char last()
+ {
+ charIndex = formattedString.length()-1;
+ if (attributes != null)
+ attributeIndex = attributes.length-1;
+ return formattedString.charAt (charIndex);
+ }
+
+ public char next()
+ {
+ charIndex++;
+ if (charIndex >= formattedString.length())
+ {
+ charIndex = getEndIndex();
+ return DONE;
+ }
+ if (attributes != null)
+ {
+ if (charIndex >= ranges[attributeIndex])
+ attributeIndex++;
+ }
+ return formattedString.charAt (charIndex);
+ }
+
+ public char previous()
+ {
+ charIndex--;
+ if (charIndex < 0)
+ {
+ charIndex = 0;
+ return DONE;
+ }
+
+ if (attributes != null)
+ {
+ if (charIndex < ranges[attributeIndex])
+ attributeIndex--;
+ }
+ return formattedString.charAt (charIndex);
+ }
+
+ public char setIndex (int position)
+ {
+ if (position < 0 || position > formattedString.length())
+ throw new IllegalArgumentException ("position is out of range");
+
+ charIndex = position;
+ if (attributes != null)
+ {
+ for (attributeIndex=0;attributeIndex<attributes.length;
+ attributeIndex++)
+ if (ranges[attributeIndex] > charIndex)
+ break;
+ attributeIndex--;
+ }
+ if (charIndex == formattedString.length())
+ return DONE;
+ else
+ return formattedString.charAt (charIndex);
+ }
+
+ /**
+ * This method merge the specified attributes and ranges with the
+ * internal tables. This method is in charge of the optimization
+ * of tables. Two following sets of attributes are never the same.
+ *
+ * @see #FormatCharacterIterator()
+ *
+ * @param attributes the new array attributes to apply to the string.
+ */
+ protected void mergeAttributes (HashMap[] attributes, int[] ranges)
+ {
+ Vector new_ranges = new Vector();
+ Vector new_attributes = new Vector();
+ int i = 0, j = 0;
+
+ while (i < this.ranges.length && j < ranges.length)
+ {
+ if (this.attributes[i] != null)
+ {
+ new_attributes.add (this.attributes[i]);
+ if (attributes[j] != null)
+ this.attributes[i].putAll (attributes[j]);
+ }
+ else
+ {
+ new_attributes.add (attributes[j]);
+ }
+ if (this.ranges[i] == ranges[j])
+ {
+ new_ranges.add (new Integer (ranges[j]));
+ i++;
+ j++;
+ }
+ else if (this.ranges[i] < ranges[j])
+ {
+ new_ranges.add (new Integer (this.ranges[i]));
+ i++;
+ }
+ else
+ {
+ new_ranges.add (new Integer (ranges[j]));
+ j++;
+ }
+ }
+
+ if (i != this.ranges.length)
+ {
+ for (;i<this.ranges.length;i++)
+ {
+ new_attributes.add (this.attributes[i]);
+ new_ranges.add (new Integer (this.ranges[i]));
+ }
+ }
+ if (j != ranges.length)
+ {
+ for (;j<ranges.length;j++)
+ {
+ new_attributes.add (attributes[j]);
+ new_ranges.add (new Integer (ranges[j]));
+ }
+ }
+
+ this.attributes = new HashMap[new_attributes.size()];
+ this.ranges = new int[new_ranges.size()];
+ System.arraycopy (new_attributes.toArray(), 0, this.attributes,
+ 0, this.attributes.length);
+
+ for (i=0;i<new_ranges.size();i++)
+ {
+ this.ranges[i] = ((Integer)new_ranges.elementAt (i)).intValue();
+ }
+
+ }
+
+ /**
+ * This method appends to the internal attributed string the attributed
+ * string contained in the specified iterator.
+ *
+ * @param iterator the iterator which contains the attributed string to
+ * append to this iterator.
+ */
+ protected void append (AttributedCharacterIterator iterator)
+ {
+ char c = iterator.first();
+ Vector more_ranges = new Vector();
+ Vector more_attributes = new Vector();
+
+ do
+ {
+ formattedString = formattedString + String.valueOf(c);
+ // TODO: Reduce the size of the output array.
+ more_attributes.add (iterator.getAttributes());
+ more_ranges.add (new Integer (formattedString.length()));
+ // END TOOD
+ c = iterator.next();
+ }
+ while (c != DONE);
+
+ HashMap[] new_attributes = new HashMap[attributes.length
+ + more_attributes.size()];
+ int[] new_ranges = new int[ranges.length + more_ranges.size()];
+
+ System.arraycopy (attributes, 0, new_attributes, 0, attributes.length);
+ System.arraycopy (more_attributes.toArray(), 0, new_attributes,
+ attributes.length, more_attributes.size());
+
+ System.arraycopy (ranges, 0, new_ranges, 0, ranges.length);
+ Object[] new_ranges_array = more_ranges.toArray();
+ for (int i=0;i<more_ranges.size();i++)
+ new_ranges[i+ranges.length] = ((Integer)new_ranges_array[i]).intValue();
+
+ attributes = new_attributes;
+ ranges = new_ranges;
+ }
+
+ /**
+ * This method appends an attributed string which attributes are specified
+ * directly in the calling parameters.
+ *
+ * @param text The string to append.
+ * @param local_attributes The attributes to put on this string in the
+ * iterator. If it is <code>null</code> the string will simply have no
+ * attributes.
+ */
+ protected void append (String text, HashMap local_attributes)
+ {
+ int[] new_ranges = new int[ranges.length+1];
+ HashMap[] new_attributes = new HashMap[attributes.length+1];
+
+ formattedString += text;
+ System.arraycopy (attributes, 0, new_attributes, 0, attributes.length);
+ System.arraycopy (ranges, 0, new_ranges, 0, ranges.length);
+ new_ranges[ranges.length] = formattedString.length();
+ new_attributes[attributes.length] = local_attributes;
+
+ ranges = new_ranges;
+ attributes = new_attributes;
+ }
+
+ /**
+ * This method appends a string without attributes. It is completely
+ * equivalent to call {@link #append(String,HashMap)} with local_attributes
+ * equal to <code>null</code>.
+ *
+ * @param text The string to append to the iterator.
+ */
+ protected void append (String text)
+ {
+ append (text, null);
+ }
+}
diff --git a/libjava/java/text/MessageFormat.java b/libjava/java/text/MessageFormat.java
index caeb7265f46..e34fe2c89d1 100644
--- a/libjava/java/text/MessageFormat.java
+++ b/libjava/java/text/MessageFormat.java
@@ -454,11 +454,25 @@ public class MessageFormat extends Format
* Creates a new MessageFormat object with
* the specified pattern
*
- * @param aPattern The Pattern
+ * @param pattern The Pattern
+ */
+ public MessageFormat(String pattern)
+ {
+ this(pattern, Locale.getDefault());
+ }
+
+ /**
+ * Creates a new MessageFormat object with
+ * the specified pattern
+ *
+ * @param pattern The Pattern
+ * @param locale The Locale to use
+ *
+ * @since 1.4
*/
- public MessageFormat (String pattern)
+ public MessageFormat(String pattern, Locale locale)
{
- locale = Locale.getDefault();
+ this.locale = locale;
applyPattern (pattern);
}
diff --git a/libjava/java/text/NumberFormat.java b/libjava/java/text/NumberFormat.java
index 272cdbddac8..568018ffdf4 100644
--- a/libjava/java/text/NumberFormat.java
+++ b/libjava/java/text/NumberFormat.java
@@ -1,5 +1,5 @@
/* NumberFormat.java -- Formats and parses numbers
- Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,12 +38,14 @@ exception statement from your version. */
package java.text;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import java.util.MissingResourceException;
+import java.io.InvalidObjectException;
+import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
-import java.io.IOException;
+import java.util.Currency;
+import java.util.Locale;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
/**
* This is the abstract superclass of all classes which format and
@@ -79,6 +81,132 @@ public abstract class NumberFormat extends Format implements Cloneable
*/
public static final int FRACTION_FIELD = 1;
+ public static class Field extends Format.Field
+ {
+ static final long serialVersionUID = 7494728892700160890L;
+
+ /**
+ * Attribute set to all characters containing digits of the integer
+ * part.
+ */
+ public static final NumberFormat.Field INTEGER
+ = new Field("integer");
+
+ /**
+ * Attribute set to all characters containing digits of the fractional
+ * part.
+ */
+ public static final NumberFormat.Field FRACTION
+ = new Field("fraction");
+
+ /**
+ * Attribute set to all characters containing digits of the exponential
+ * part.
+ */
+ public static final NumberFormat.Field EXPONENT
+ = new Field("exponent");
+
+ /**
+ * Attribute set to all characters containing a decimal separator.
+ */
+ public static final NumberFormat.Field DECIMAL_SEPARATOR
+ = new Field("decimal separator");
+
+ /**
+ * Attribute set to all characters containing a sign (plus or minus).
+ */
+ public static final NumberFormat.Field SIGN
+ = new Field("sign");
+
+ /**
+ * Attribute set to all characters containing a grouping separator (e.g.
+ * a comma, a white space,...).
+ */
+ public static final NumberFormat.Field GROUPING_SEPARATOR
+ = new Field("grouping separator");
+
+ /**
+ * Attribute set to all characters containing an exponential symbol (e.g.
+ * 'E')
+ */
+ public static final NumberFormat.Field EXPONENT_SYMBOL
+ = new Field("exponent symbol");
+
+ /**
+ * Attribute set to all characters containing a percent symbol (e.g. '%')
+ */
+ public static final NumberFormat.Field PERCENT
+ = new Field("percent");
+
+ /**
+ * Attribute set to all characters containing a permille symbol.
+ */
+ public static final NumberFormat.Field PERMILLE
+ = new Field("permille");
+
+ /**
+ * Attribute set to all characters containing the currency unit.
+ */
+ public static final NumberFormat.Field CURRENCY
+ = new Field("currency");
+
+ /**
+ * Attribute set to all characters containing the exponent sign.
+ */
+ public static final NumberFormat.Field EXPONENT_SIGN
+ = new Field("exponent sign");
+
+ /**
+ * Private fields to register all fields contained in this descriptor.
+ */
+ private static final NumberFormat.Field[] allFields =
+ {
+ INTEGER, FRACTION, EXPONENT, DECIMAL_SEPARATOR, SIGN,
+ GROUPING_SEPARATOR, EXPONENT_SYMBOL, PERCENT,
+ PERMILLE, CURRENCY, EXPONENT_SIGN
+ };
+
+ /**
+ * This constructor is only used by the deserializer. Without it,
+ * it would fail to construct a valid object.
+ */
+ private Field()
+ {
+ super("");
+ }
+
+ /**
+ * Create a Field instance with the specified field name.
+ *
+ * @param field_name Field name for the new Field instance.
+ */
+ protected Field(String field_name)
+ {
+ super (field_name);
+ }
+
+ /**
+ * This function is used by the deserializer to know which object
+ * to use when it encounters an encoded NumberFormat.Field in a
+ * serialization stream. If the stream is valid it should return
+ * one of the above field. In the other case we throw an exception.
+ *
+ * @return a valid official NumberFormat.Field instance.
+ *
+ * @throws InvalidObjectException if the field name is invalid.
+ */
+ protected Object readResolve() throws InvalidObjectException
+ {
+ String s = getName();
+ for (int i = 0; i < allFields.length; i++)
+ if (s.equals(allFields[i].getName()))
+ return allFields[i];
+
+ throw new InvalidObjectException("no such NumberFormat field called "
+ + s);
+ }
+ }
+
/**
* This method is a specialization of the format method that performs
* a simple formatting of the specified <code>long</code> number.
@@ -326,6 +454,36 @@ public abstract class NumberFormat extends Format implements Cloneable
}
/**
+ * This method returns an integer formatting and parsing class for the
+ * default locale. This will be a concrete subclass of <code>NumberFormat</code>,
+ * but the actual class returned is dependent on the locale.
+ *
+ * @return An instance of an integer number formatter for the default locale.
+ * @since 1.4
+ */
+ public static final NumberFormat getIntegerInstance()
+ {
+ return getIntegerInstance (Locale.getDefault());
+ }
+
+ /**
+ * This method returns an integer formatting and parsing class for the
+ * default locale. This will be a concrete subclass of <code>NumberFormat</code>,
+ * but the actual class returned is dependent on the locale.
+ *
+ * @param locale the desired locale.
+ *
+ * @return An instance of an integer number formatter for the desired locale.
+ * @since 1.4
+ */
+ public static NumberFormat getIntegerInstance(Locale locale)
+ {
+ NumberFormat format = computeInstance (locale, "numberFormat", "#,##0");
+ format.setParseIntegerOnly (true);
+ return format;
+ }
+
+ /**
* This method returns an instance of <code>NumberFormat</code> suitable
* for formatting and parsing percentage values in the default locale.
*
@@ -603,4 +761,44 @@ public abstract class NumberFormat extends Format implements Cloneable
serialVersionOnStream = 1;
stream.defaultWriteObject();
}
+
+ /**
+ * Returns the currency used by this number format when formatting currency
+ * values.
+ *
+ * The default implementation throws UnsupportedOperationException.
+ *
+ * @return The used currency object, or null.
+ *
+ * @throws UnsupportedOperationException If the number format class doesn't
+ * implement currency formatting.
+ *
+ * @since 1.4
+ */
+ public Currency getCurrency()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Sets the currency used by this number format when formatting currency
+ * values.
+ *
+ * The default implementation throws UnsupportedOperationException.
+ *
+ * @param currency The new currency to be used by this number format.
+ *
+ * @throws NullPointerException If currenc is null.
+ * @throws UnsupportedOperationException If the number format class doesn't
+ * implement currency formatting.
+ *
+ * @since 1.4
+ */
+ public void setCurreny(Currency currency)
+ {
+ if (currency == null)
+ throw new NullPointerException("currency may not be null");
+
+ throw new UnsupportedOperationException();
+ }
}
diff --git a/libjava/java/text/SimpleDateFormat.java b/libjava/java/text/SimpleDateFormat.java
index 3ad71ee89ed..89f84dde5c6 100644
--- a/libjava/java/text/SimpleDateFormat.java
+++ b/libjava/java/text/SimpleDateFormat.java
@@ -117,8 +117,8 @@ public class SimpleDateFormat extends DateFormat
field = formatData.getLocalPatternChars().indexOf(thisChar);
if (field == -1) {
current = null;
- if (Character.isLowerCase (thisChar)
- || Character.isUpperCase (thisChar)) {
+ if ((thisChar >= 'A' && thisChar <= 'Z')
+ || (thisChar >= 'a' && thisChar <= 'z')) {
// Not a valid letter
tokens.add(new FieldSizePair(-1,0));
} else if (thisChar == '\'') {
@@ -374,9 +374,6 @@ public class SimpleDateFormat extends DateFormat
*/
public boolean equals(Object o)
{
- if (o == null)
- return false;
-
if (!super.equals(o))
return false;
diff --git a/libjava/java/util/Calendar.java b/libjava/java/util/Calendar.java
index 271d1d163c6..48624beb614 100644
--- a/libjava/java/util/Calendar.java
+++ b/libjava/java/util/Calendar.java
@@ -37,8 +37,12 @@ exception statement from your version. */
package java.util;
+
import java.lang.reflect.InvocationTargetException;
-import java.io.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
/**
* This class is an abstract base class for Calendars, which can be
diff --git a/libjava/java/util/Currency.java b/libjava/java/util/Currency.java
new file mode 100644
index 00000000000..a742831e4c3
--- /dev/null
+++ b/libjava/java/util/Currency.java
@@ -0,0 +1,189 @@
+/* Currency.java -- Representation of a currency
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+package java.util;
+
+import java.io.Serializable;
+import java.util.ResourceBundle;
+import java.util.Locale;
+import java.text.NumberFormat;
+
+public final class Currency implements Serializable
+{
+ static final long serialVersionUID = -158308464356906721L;
+
+ private Locale locale;
+ private ResourceBundle res;
+
+ // For deserialization
+ private Currency ()
+ {
+ }
+
+ private Currency (Locale loc)
+ {
+ this.locale = loc;
+ this.res = ResourceBundle.getBundle ("gnu.java.locale.LocaleInformation", locale);
+ }
+
+ /**
+ * Returns the ISO4217 currency code of this currency.
+ *
+ * @return a <code>String</code> containing currency code.
+ */
+ public String getCurrencyCode ()
+ {
+ try
+ {
+ return res.getString ("intlCurrencySymbol");
+ }
+ catch (Exception _)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * @return number of digits after decimal separator for this currency.
+ */
+ public int getDefaultFractionDigits ()
+ {
+ NumberFormat currency = NumberFormat.getCurrencyInstance (locale);
+
+ return currency.getMaximumFractionDigits();
+ }
+
+ /**
+ * Builds a new currency instance for this locale.
+ *
+ * @param locale a <code>Locale</code> instance.
+ *
+ * @return a new <code>Currency</code> instance.
+ */
+ public static Currency getInstance (Locale locale)
+ {
+ return new Currency (locale);
+ }
+
+ /**
+ * Builds the currency corresponding to the specified currency code.
+ *
+ * @param currencyCode a string representing a currency code.
+ *
+ * @return a new <code>Currency</code> instance.
+ */
+ public static Currency getInstance (String currencyCode)
+ {
+ Locale[] all_locales = Locale.getAvailableLocales ();
+
+ for (int i=0;i<all_locales.length;i++)
+ {
+ Currency test_currency = getInstance (all_locales[i]);
+
+ if (test_currency.getCurrencyCode() != null &&
+ test_currency.getCurrencyCode().equals(currencyCode))
+ return test_currency;
+ }
+
+ return null;
+ }
+
+ /**
+ * This method returns the currency symbol.
+ *
+ * @return the currency symbol.
+ */
+ public String getSymbol()
+ {
+ try
+ {
+ return res.getString ("currencySymbol");
+ }
+ catch (Exception _)
+ {
+ return null;
+ }
+ }
+
+ /**
+ * This methods returns the currency symbol expressed in the specified locale.
+ *
+ * @param locale the locale to express the symbol in.
+ * @return the currency symbol.
+ */
+ public String getSymbol(Locale locale)
+ {
+ // TODO. The behaviour is unclear if locale != this.locale.
+ // First we need to implement fully LocaleInformation*.java
+ try
+ {
+ ResourceBundle res = ResourceBundle.getBundle ("gnu.java.locale.LocaleInformation", locale);
+
+ if (res.equals(this.res))
+ return res.getString ("currencySymbol");
+ else
+ return res.getString ("intlCurrencySymbol");
+ }
+ catch (Exception e1)
+ {
+ try
+ {
+ return res.getString ("intlCurrencySymbol");
+ }
+ catch (Exception e2)
+ {
+ return null;
+ }
+ }
+ }
+
+ /**
+ * Returns the international ISO4217 currency code of this currency.
+ *
+ * @return a <code>String</code> containing the ISO4217 currency code.
+ */
+ public String toString()
+ {
+ try
+ {
+ return res.getString ("intlCurrencySymbol");
+ }
+ catch (Exception _)
+ {
+ return "(unknown currency)";
+ }
+ }
+}
diff --git a/libjava/java/util/GregorianCalendar.java b/libjava/java/util/GregorianCalendar.java
index 91f5890ef06..624924cd208 100644
--- a/libjava/java/util/GregorianCalendar.java
+++ b/libjava/java/util/GregorianCalendar.java
@@ -1,5 +1,5 @@
/* java.util.GregorianCalendar
- Copyright (C) 1998, 1999, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2001, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -264,8 +264,10 @@ public class GregorianCalendar extends Calendar
//
// The additional leap year factor accounts for the fact that
// a leap day is not seen on Jan 1 of the leap year.
+ // And on and after the leap day, the leap day has already been
+ // included in dayOfYear.
int gregOffset = (year / 400) - (year / 100) + 2;
- if (isLeapYear (year, true) && dayOfYear < 31 + 29)
+ if (isLeapYear (year, true))
--gregOffset;
time += gregOffset * (24 * 60 * 60 * 1000L);
}
@@ -604,12 +606,12 @@ public class GregorianCalendar extends Calendar
calculateDay(++day, gregorian);
}
- fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 6) / 7;
+ fields[DAY_OF_WEEK_IN_MONTH] = (fields[DAY_OF_MONTH] + 12) / 7;
// which day of the week are we (0..6), relative to getFirstDayOfWeek
int relativeWeekday = (7 + fields[DAY_OF_WEEK] - getFirstDayOfWeek()) % 7;
- fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 6) / 7;
+ fields[WEEK_OF_MONTH] = (fields[DAY_OF_MONTH] - relativeWeekday + 12) / 7;
int weekOfYear = (fields[DAY_OF_YEAR] - relativeWeekday + 6) / 7;
diff --git a/libjava/java/util/HashMap.java b/libjava/java/util/HashMap.java
index 6b3466ca15d..fd6b658bcb7 100644
--- a/libjava/java/util/HashMap.java
+++ b/libjava/java/util/HashMap.java
@@ -223,7 +223,7 @@ public class HashMap extends AbstractMap
public HashMap(Map m)
{
this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
- putAllInternal(m);
+ putAll(m);
}
/**
@@ -381,8 +381,7 @@ public class HashMap extends AbstractMap
public void putAll(Map m)
{
Iterator itr = m.entrySet().iterator();
- int msize = m.size();
- while (msize-- > 0)
+ while (itr.hasNext())
{
Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
@@ -700,19 +699,19 @@ public class HashMap extends AbstractMap
}
/**
- * A simplified, more efficient internal implementation of putAll(). The
- * Map constructor and clone() should not call putAll or put, in order to
- * be compatible with the JDK implementation with respect to subclasses.
+ * A simplified, more efficient internal implementation of putAll(). clone()
+ * should not call putAll or put, in order to be compatible with the JDK
+ * implementation with respect to subclasses.
*
* @param m the map to initialize this from
*/
void putAllInternal(Map m)
{
Iterator itr = m.entrySet().iterator();
- int msize = m.size();
- size = msize;
- while (msize-- > 0)
+ size = 0;
+ while (itr.hasNext())
{
+ size++;
Map.Entry e = (Map.Entry) itr.next();
Object key = e.getKey();
int idx = hash(key);
diff --git a/libjava/java/util/Hashtable.java b/libjava/java/util/Hashtable.java
index a94143b8f09..698871b5124 100644
--- a/libjava/java/util/Hashtable.java
+++ b/libjava/java/util/Hashtable.java
@@ -234,7 +234,7 @@ public class Hashtable extends Dictionary
public Hashtable(Map m)
{
this(Math.max(m.size() * 2, DEFAULT_CAPACITY), DEFAULT_LOAD_FACTOR);
- putAllInternal(m);
+ putAll(m);
}
/**
@@ -333,7 +333,22 @@ public class Hashtable extends Dictionary
*/
public synchronized boolean contains(Object value)
{
- return containsValue(value);
+ for (int i = buckets.length - 1; i >= 0; i--)
+ {
+ HashEntry e = buckets[i];
+ while (e != null)
+ {
+ if (value.equals(e.value))
+ return true;
+ e = e.next;
+ }
+ }
+
+ // Must throw on null argument even if the table is empty
+ if (value == null)
+ throw new NullPointerException();
+
+ return false;
}
/**
@@ -350,22 +365,9 @@ public class Hashtable extends Dictionary
*/
public boolean containsValue(Object value)
{
- for (int i = buckets.length - 1; i >= 0; i--)
- {
- HashEntry e = buckets[i];
- while (e != null)
- {
- if (value.equals(e.value))
- return true;
- e = e.next;
- }
- }
-
- // Must throw on null argument even if the table is empty
- if (value == null)
- throw new NullPointerException();
-
- return false;
+ // Delegate to older method to make sure code overriding it continues
+ // to work.
+ return contains(value);
}
/**
@@ -510,7 +512,7 @@ public class Hashtable extends Dictionary
{
Iterator itr = m.entrySet().iterator();
- for (int msize = m.size(); msize > 0; msize--)
+ while (itr.hasNext())
{
Map.Entry e = (Map.Entry) itr.next();
// Optimize in case the Entry is one of our own.
@@ -850,20 +852,20 @@ public class Hashtable extends Dictionary
}
/**
- * A simplified, more efficient internal implementation of putAll(). The
- * Map constructor and clone() should not call putAll or put, in order to
- * be compatible with the JDK implementation with respect to subclasses.
+ * A simplified, more efficient internal implementation of putAll(). clone()
+ * should not call putAll or put, in order to be compatible with the JDK
+ * implementation with respect to subclasses.
*
* @param m the map to initialize this from
*/
void putAllInternal(Map m)
{
Iterator itr = m.entrySet().iterator();
- int msize = m.size();
- this.size = msize;
+ size = 0;
- for (; msize > 0; msize--)
+ while (itr.hasNext())
{
+ size++;
Map.Entry e = (Map.Entry) itr.next();
Object key = e.getKey();
int idx = hash(key);
diff --git a/libjava/java/util/IdentityHashMap.java b/libjava/java/util/IdentityHashMap.java
index f48c430cf9a..f29edb617aa 100644
--- a/libjava/java/util/IdentityHashMap.java
+++ b/libjava/java/util/IdentityHashMap.java
@@ -38,7 +38,10 @@ exception statement from your version. */
package java.util;
-import java.io.*;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
/**
* This class provides a hashtable-backed implementation of the
diff --git a/libjava/java/util/SimpleTimeZone.java b/libjava/java/util/SimpleTimeZone.java
index e777fbd456a..31b85e18972 100644
--- a/libjava/java/util/SimpleTimeZone.java
+++ b/libjava/java/util/SimpleTimeZone.java
@@ -1,5 +1,5 @@
/* java.util.SimpleTimeZone
- Copyright (C) 1998, 1999, 2000 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -390,7 +390,8 @@ public class SimpleTimeZone extends TimeZone
* @param dayOfWeek The day of week where daylight savings start.
* @param time The time in milliseconds standard time where daylight
* savings start.
- * @see SimpleTimeZone */
+ * @see SimpleTimeZone
+ */
public void setStartRule(int month, int day, int dayOfWeek, int time)
{
this.startMode = checkRule(month, day, dayOfWeek);
@@ -411,11 +412,12 @@ public class SimpleTimeZone extends TimeZone
*
* @param rawOffset The time offset from GMT.
* @param id The identifier of this time zone.
- * @param Month The end month of daylight savings.
+ * @param month The end month of daylight savings.
* @param day A day in month, or a day of week in month.
- * @param DayOfWeek A day of week, when daylight savings ends.
- * @param Time A time in millis in standard time.
- * @see #setStartRule */
+ * @param dayOfWeek A day of week, when daylight savings ends.
+ * @param time A time in millis in standard time.
+ * @see #setStartRule
+ */
public void setEndRule(int month, int day, int dayOfWeek, int time)
{
this.endMode = checkRule(month, day, dayOfWeek);
@@ -509,7 +511,7 @@ public class SimpleTimeZone extends TimeZone
* is one hour, but for some time zones this may be half an our.
* @return the daylight savings offset in milliseconds.
*
- * @since JDK1.2
+ * @since 1.2
*/
public int getDSTSavings()
{
@@ -517,6 +519,22 @@ public class SimpleTimeZone extends TimeZone
}
/**
+ * Sets the daylight savings offset. This is a positive offset in
+ * milliseconds with respect to standard time.
+ *
+ * @param dstSavings the daylight savings offset in milliseconds.
+ *
+ * @since 1.2
+ */
+ public void setDSTSavings(int dstSavings)
+ {
+ if (dstSavings <= 0)
+ throw new IllegalArgumentException("illegal value for dstSavings");
+
+ this.dstSavings = dstSavings;
+ }
+
+ /**
* Returns if this time zone uses daylight savings time.
* @return true, if we use daylight savings time, false otherwise.
*/
diff --git a/libjava/java/util/TimeZone.java b/libjava/java/util/TimeZone.java
index db9ff6b1051..2636956527d 100644
--- a/libjava/java/util/TimeZone.java
+++ b/libjava/java/util/TimeZone.java
@@ -1,5 +1,6 @@
/* java.util.TimeZone
- Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003
+ Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -810,6 +811,21 @@ public abstract class TimeZone implements java.io.Serializable, Cloneable
int day, int dayOfWeek, int milliseconds);
/**
+ * Get the time zone offset for the specified date, modified in case of
+ * daylight savings. This is the offset to add to UTC to get the local
+ * time.
+ * @param date the date represented in millisecends
+ * since January 1, 1970 00:00:00 GMT.
+ * @since 1.4
+ */
+ public int getOffset(long date)
+ {
+ return (inDaylightTime(new Date(date))
+ ? getRawOffset() + getDSTSavings()
+ : getRawOffset());
+ }
+
+ /**
* Gets the time zone offset, ignoring daylight savings. This is
* the offset to add to UTC to get the local time.
* @return the time zone offset in milliseconds.
diff --git a/libjava/java/util/jar/JarInputStream.java b/libjava/java/util/jar/JarInputStream.java
index 9c295f372e6..daf935fa70a 100644
--- a/libjava/java/util/jar/JarInputStream.java
+++ b/libjava/java/util/jar/JarInputStream.java
@@ -116,7 +116,6 @@ public class JarInputStream extends ZipInputStream
}
firstEntry = (JarEntry) super.getNextEntry();
}
- closeEntry();
if (verify)
{
diff --git a/libjava/java/util/logging/logging.properties b/libjava/java/util/logging/logging.properties
new file mode 100644
index 00000000000..3104af3acab
--- /dev/null
+++ b/libjava/java/util/logging/logging.properties
@@ -0,0 +1,8 @@
+# Default logging properties.
+# See javadoc in java.util.logging.LogManager to information on
+# overriding these settings. Most of the defaults are compiled in, so
+# this file is fairly minimal.
+
+# Send log records to System.err, default to INFO per documentation.
+handlers = java.util.logging.ConsoleHandler
+.level = INFO
diff --git a/libjava/java/util/prefs/AbstractPreferences.java b/libjava/java/util/prefs/AbstractPreferences.java
index a6a3e9a82f2..4463c5e0370 100644
--- a/libjava/java/util/prefs/AbstractPreferences.java
+++ b/libjava/java/util/prefs/AbstractPreferences.java
@@ -183,6 +183,16 @@ public abstract class AbstractPreferences extends Preferences {
}
/**
+ * Returns all known unremoved children of this node.
+ *
+ * @return All known unremoved children of this node
+ */
+ protected final AbstractPreferences[] cachedChildren()
+ {
+ return (AbstractPreferences[]) childCache.values().toArray();
+ }
+
+ /**
* Returns all the direct sub nodes of this preferences node.
* Needs access to the backing store to give a meaningfull answer.
* <p>
diff --git a/libjava/java/util/prefs/Preferences.java b/libjava/java/util/prefs/Preferences.java
index ab4874b86a6..ea65550af7e 100644
--- a/libjava/java/util/prefs/Preferences.java
+++ b/libjava/java/util/prefs/Preferences.java
@@ -45,7 +45,7 @@ import java.security.AccessController;
import java.security.Permission;
import java.security.PrivilegedAction;
-import gnu.java.util.prefs.*;
+import gnu.java.util.prefs.NodeReader;
/**
* Preference node containing key value entries and subnodes.
diff --git a/libjava/java/util/zip/DeflaterOutputStream.java b/libjava/java/util/zip/DeflaterOutputStream.java
index ff66b080f9e..6a4fa95886b 100644
--- a/libjava/java/util/zip/DeflaterOutputStream.java
+++ b/libjava/java/util/zip/DeflaterOutputStream.java
@@ -127,12 +127,7 @@ public class DeflaterOutputStream extends FilterOutputStream
*/
public void finish () throws IOException
{
- if (inbufLength > 0)
- {
- def.setInput (inbuf, 0, inbufLength);
- deflate ();
- inbufLength = 0;
- }
+ inbufWrite();
def.finish();
while (! def.finished ())
{
@@ -145,28 +140,27 @@ public class DeflaterOutputStream extends FilterOutputStream
public void write (int bval) throws IOException
{
if (inbuf == null)
- {
- inbuf = new byte[128];
- }
+ inbuf = new byte[128];
else if (inbufLength == inbuf.length)
- {
- def.setInput (inbuf, 0, inbufLength);
- deflate ();
- inbufLength = 0;
- }
+ inbufWrite ();
inbuf[inbufLength++] = (byte) bval;
}
public void write (byte[] buf, int off, int len) throws IOException
{
+ inbufWrite ();
+ def.setInput (buf, off, len);
+ deflate ();
+ }
+
+ private void inbufWrite () throws IOException
+ {
if (inbufLength > 0)
{
- def.setInput (inbuf, 0, inbufLength);
- deflate ();
+ int size = inbufLength;
inbufLength = 0;
+ write (inbuf, 0, size);
}
- def.setInput (buf, off, len);
- deflate ();
}
// Used, if needed, for write(int).
diff --git a/libjava/java/util/zip/ZipFile.java b/libjava/java/util/zip/ZipFile.java
index b6bc5414d08..50f489fdb5b 100644
--- a/libjava/java/util/zip/ZipFile.java
+++ b/libjava/java/util/zip/ZipFile.java
@@ -105,7 +105,7 @@ public class ZipFile implements ZipConstants
public ZipFile(File file) throws ZipException, IOException
{
this.raf = new RandomAccessFile(file, "r");
- this.name = file.getName();
+ this.name = file.getPath();
}
/**
@@ -134,7 +134,7 @@ public class ZipFile implements ZipConstants
("OPEN_DELETE mode not supported yet in java.util.zip.ZipFile");
}
this.raf = new RandomAccessFile(file, "r");
- this.name = file.getName();
+ this.name = file.getPath();
}
/**
@@ -438,7 +438,7 @@ public class ZipFile implements ZipConstants
}
/**
- * Returns the name of this zip file.
+ * Returns the (path) name of this zip file.
*/
public String getName()
{
diff --git a/libjava/javax/naming/CompoundName.java b/libjava/javax/naming/CompoundName.java
index 20396398d10..4df89e9af95 100644
--- a/libjava/javax/naming/CompoundName.java
+++ b/libjava/javax/naming/CompoundName.java
@@ -240,7 +240,7 @@ public class CompoundName implements Name, Cloneable, Serializable
public int compareTo (Object obj)
{
- if (obj == null || ! (obj instanceof CompoundName))
+ if (! (obj instanceof CompoundName))
throw new ClassCastException ("CompoundName.compareTo() expected CompoundName");
CompoundName cn = (CompoundName) obj;
int last = Math.min (cn.elts.size (), elts.size ());
diff --git a/libjava/javax/naming/InitialContext.java b/libjava/javax/naming/InitialContext.java
index 715f30ad5cd..e2a1ac6b63f 100644
--- a/libjava/javax/naming/InitialContext.java
+++ b/libjava/javax/naming/InitialContext.java
@@ -240,12 +240,28 @@ public class InitialContext implements Context
public Object lookup (Name name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).lookup (name);
+ try
+ {
+ return getURLOrDefaultInitCtx (name).lookup (name);
+ }
+ catch (CannotProceedException cpe)
+ {
+ Context ctx = NamingManager.getContinuationContext (cpe);
+ return ctx.lookup (cpe.getRemainingName());
+ }
}
public Object lookup (String name) throws NamingException
{
- return getURLOrDefaultInitCtx (name).lookup (name);
+ try
+ {
+ return getURLOrDefaultInitCtx (name).lookup (name);
+ }
+ catch (CannotProceedException cpe)
+ {
+ Context ctx = NamingManager.getContinuationContext (cpe);
+ return ctx.lookup (cpe.getRemainingName());
+ }
}
public void rebind (Name name, Object obj) throws NamingException
@@ -367,7 +383,8 @@ public class InitialContext implements Context
public void close () throws NamingException
{
- throw new OperationNotSupportedException ();
+ myProps = null;
+ defaultInitCtx = null;
}
public String getNameInNamespace () throws NamingException
diff --git a/libjava/javax/naming/directory/Attribute.java b/libjava/javax/naming/directory/Attribute.java
index 9338395236b..48118b01294 100644
--- a/libjava/javax/naming/directory/Attribute.java
+++ b/libjava/javax/naming/directory/Attribute.java
@@ -38,8 +38,11 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
import java.io.Serializable;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/directory/Attributes.java b/libjava/javax/naming/directory/Attributes.java
index 332da27f3ec..f1c673a76ec 100644
--- a/libjava/javax/naming/directory/Attributes.java
+++ b/libjava/javax/naming/directory/Attributes.java
@@ -38,8 +38,10 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
import java.io.Serializable;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/directory/DirContext.java b/libjava/javax/naming/directory/DirContext.java
index 93f89cc5e12..c7c821683e5 100644
--- a/libjava/javax/naming/directory/DirContext.java
+++ b/libjava/javax/naming/directory/DirContext.java
@@ -38,7 +38,10 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/directory/InitialDirContext.java b/libjava/javax/naming/directory/InitialDirContext.java
index 05c48af89ad..a0a598b3316 100644
--- a/libjava/javax/naming/directory/InitialDirContext.java
+++ b/libjava/javax/naming/directory/InitialDirContext.java
@@ -38,8 +38,14 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.Name;
+import javax.naming.NamingEnumeration;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import javax.naming.NotContextException;
/**
* @author Tom Tromey <tromey@redhat.com>
diff --git a/libjava/javax/naming/directory/SearchResult.java b/libjava/javax/naming/directory/SearchResult.java
index 5d339635566..74c38876f70 100644
--- a/libjava/javax/naming/directory/SearchResult.java
+++ b/libjava/javax/naming/directory/SearchResult.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package javax.naming.directory;
-import javax.naming.*;
+
import java.io.Serializable;
+import javax.naming.Binding;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/event/EventContext.java b/libjava/javax/naming/event/EventContext.java
index d816b1341d7..81626e1c853 100644
--- a/libjava/javax/naming/event/EventContext.java
+++ b/libjava/javax/naming/event/EventContext.java
@@ -37,7 +37,10 @@ exception statement from your version. */
package javax.naming.event;
-import javax.naming.*;
+
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/event/EventDirContext.java b/libjava/javax/naming/event/EventDirContext.java
index 259610eb20f..5d89e6b8bb2 100644
--- a/libjava/javax/naming/event/EventDirContext.java
+++ b/libjava/javax/naming/event/EventDirContext.java
@@ -35,29 +35,31 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package javax.naming.event;
-import javax.naming.*;
-import javax.naming.directory.*;
-
+
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
+import javax.naming.directory.SearchControls;
+
+
/**
* @author Warren Levy <warrenl@redhat.com>
* @date June 1, 2001
*/
-
public interface EventDirContext extends EventContext, DirContext
{
- void addNamingListener (Name target, String filter, SearchControls ctls,
- NamingListener l) throws NamingException;
-
- void addNamingListeneri (String target, String filter, SearchControls ctls,
- NamingListener l) throws NamingException;
-
- void addNamingListener (Name target, String filter, Object[] filterArgs,
- SearchControls ctls, NamingListener l)
- throws NamingException;
-
- void addNamingListener(String target, String filter,
- Object[] filterArgs, SearchControls ctls,
- NamingListener l) throws NamingException;
+ void addNamingListener(Name target, String filter, SearchControls ctls,
+ NamingListener l) throws NamingException;
+
+ void addNamingListener(String target, String filter, SearchControls ctls,
+ NamingListener l) throws NamingException;
+
+ void addNamingListener(Name target, String filter, Object[] filterArgs,
+ SearchControls ctls, NamingListener l)
+ throws NamingException;
+
+ void addNamingListener(String target, String filter, Object[] filterArgs,
+ SearchControls ctls, NamingListener l)
+ throws NamingException;
}
diff --git a/libjava/javax/naming/event/NamingEvent.java b/libjava/javax/naming/event/NamingEvent.java
index 2415704e122..d5171882297 100644
--- a/libjava/javax/naming/event/NamingEvent.java
+++ b/libjava/javax/naming/event/NamingEvent.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package javax.naming.event;
-import javax.naming.*;
+
import java.util.EventObject;
+import javax.naming.Binding;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/event/NamingExceptionEvent.java b/libjava/javax/naming/event/NamingExceptionEvent.java
index 79f23dd3844..3cbb19fa2ef 100644
--- a/libjava/javax/naming/event/NamingExceptionEvent.java
+++ b/libjava/javax/naming/event/NamingExceptionEvent.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package javax.naming.event;
-import javax.naming.*;
+
import java.util.EventObject;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/ControlFactory.java b/libjava/javax/naming/ldap/ControlFactory.java
index a9acd3d7e48..d62a3107564 100644
--- a/libjava/javax/naming/ldap/ControlFactory.java
+++ b/libjava/javax/naming/ldap/ControlFactory.java
@@ -38,9 +38,10 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
-import java.util.StringTokenizer;
import java.util.Hashtable;
+import java.util.StringTokenizer;
+import javax.naming.Context;
+import javax.naming.NamingException;
/**
* @author Tom Tromey <tromey@redhat.com>
diff --git a/libjava/javax/naming/ldap/ExtendedRequest.java b/libjava/javax/naming/ldap/ExtendedRequest.java
index 21cb689516d..2f53268da60 100644
--- a/libjava/javax/naming/ldap/ExtendedRequest.java
+++ b/libjava/javax/naming/ldap/ExtendedRequest.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package javax.naming.ldap;
+
import java.io.Serializable;
-import javax.naming.*;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/HasControls.java b/libjava/javax/naming/ldap/HasControls.java
index b2fee3a4503..079afa3a95f 100644
--- a/libjava/javax/naming/ldap/HasControls.java
+++ b/libjava/javax/naming/ldap/HasControls.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
+
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/InitialLdapContext.java b/libjava/javax/naming/ldap/InitialLdapContext.java
index 7a7d7ad720f..b56ee3a41ca 100644
--- a/libjava/javax/naming/ldap/InitialLdapContext.java
+++ b/libjava/javax/naming/ldap/InitialLdapContext.java
@@ -38,9 +38,12 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
-import javax.naming.directory.InitialDirContext;
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import javax.naming.NotContextException;
+import javax.naming.directory.InitialDirContext;
/**
* @author Tom Tromey <tromey@redhat.com>
diff --git a/libjava/javax/naming/ldap/LdapContext.java b/libjava/javax/naming/ldap/LdapContext.java
index 5eb34e27205..db7bf254a71 100644
--- a/libjava/javax/naming/ldap/LdapContext.java
+++ b/libjava/javax/naming/ldap/LdapContext.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
-import javax.naming.directory.*;
+
+import javax.naming.NamingException;
+import javax.naming.directory.DirContext;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/LdapReferralException.java b/libjava/javax/naming/ldap/LdapReferralException.java
index a4b4f0a622c..2127321739e 100644
--- a/libjava/javax/naming/ldap/LdapReferralException.java
+++ b/libjava/javax/naming/ldap/LdapReferralException.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
+
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.NamingException;
+import javax.naming.ReferralException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotification.java b/libjava/javax/naming/ldap/UnsolicitedNotification.java
index 15f89edcfd6..6c37eb807b5 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotification.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotification.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.*;
+
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java b/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
index f5cd2eb1fb1..d540d9675db 100644
--- a/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
+++ b/libjava/javax/naming/ldap/UnsolicitedNotificationListener.java
@@ -37,7 +37,8 @@ exception statement from your version. */
package javax.naming.ldap;
-import javax.naming.event.*;
+
+import javax.naming.event.NamingListener;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/DirObjectFactory.java b/libjava/javax/naming/spi/DirObjectFactory.java
index 3b7c76d701c..deb56056709 100644
--- a/libjava/javax/naming/spi/DirObjectFactory.java
+++ b/libjava/javax/naming/spi/DirObjectFactory.java
@@ -37,9 +37,11 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
-import javax.naming.directory.*;
+
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.directory.Attributes;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/DirStateFactory.java b/libjava/javax/naming/spi/DirStateFactory.java
index 4ff39da5ac5..756a060b02c 100644
--- a/libjava/javax/naming/spi/DirStateFactory.java
+++ b/libjava/javax/naming/spi/DirStateFactory.java
@@ -37,9 +37,12 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
-import javax.naming.directory.*;
+
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.directory.Attributes;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/DirectoryManager.java b/libjava/javax/naming/spi/DirectoryManager.java
index 78b960c745f..67de21c22e4 100644
--- a/libjava/javax/naming/spi/DirectoryManager.java
+++ b/libjava/javax/naming/spi/DirectoryManager.java
@@ -38,11 +38,19 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
-import javax.naming.directory.*;
+import java.util.Enumeration;
import java.util.Hashtable;
import java.util.StringTokenizer;
-import java.util.Enumeration;
+import javax.naming.CannotProceedException;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
+import javax.naming.directory.Attributes;
+import javax.naming.directory.DirContext;
/**
* @author Tom Tromey <tromey@redhat.com>
diff --git a/libjava/javax/naming/spi/NamingManager.java b/libjava/javax/naming/spi/NamingManager.java
index 65ce2d23c23..4051f2288a9 100644
--- a/libjava/javax/naming/spi/NamingManager.java
+++ b/libjava/javax/naming/spi/NamingManager.java
@@ -38,8 +38,18 @@ exception statement from your version. */
package javax.naming.spi;
-import java.util.*;
-import javax.naming.*;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.StringTokenizer;
+import javax.naming.CannotProceedException;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
+import javax.naming.NoInitialContextException;
+import javax.naming.RefAddr;
+import javax.naming.Reference;
+import javax.naming.Referenceable;
+import javax.naming.StringRefAddr;
public class NamingManager
{
@@ -324,8 +334,10 @@ public class NamingManager
// It is really unclear to me if this is right.
try
{
- Object obj = getObjectInstance (null, cpe.getAltName (),
- cpe.getAltNameCtx (), env);
+ Object obj = getObjectInstance (cpe.getResolvedObj(),
+ cpe.getAltName (),
+ cpe.getAltNameCtx (),
+ env);
if (obj != null)
return (Context) obj;
}
@@ -333,6 +345,9 @@ public class NamingManager
{
}
+ // fix stack trace for re-thrown exception (message confusing otherwise)
+ cpe.fillInStackTrace();
+
throw cpe;
}
diff --git a/libjava/javax/naming/spi/ObjectFactoryBuilder.java b/libjava/javax/naming/spi/ObjectFactoryBuilder.java
index d6a5fc4e48a..1d0808c6742 100644
--- a/libjava/javax/naming/spi/ObjectFactoryBuilder.java
+++ b/libjava/javax/naming/spi/ObjectFactoryBuilder.java
@@ -37,8 +37,9 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
+
import java.util.Hashtable;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/ResolveResult.java b/libjava/javax/naming/spi/ResolveResult.java
index 7e34e3c7dd5..c1e3ad9930b 100644
--- a/libjava/javax/naming/spi/ResolveResult.java
+++ b/libjava/javax/naming/spi/ResolveResult.java
@@ -37,9 +37,12 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
-import java.util.EventObject;
+
import java.io.Serializable;
+import java.util.EventObject;
+import javax.naming.Name;
+import javax.naming.CompositeName;
+import javax.naming.InvalidNameException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/Resolver.java b/libjava/javax/naming/spi/Resolver.java
index 3c66b18cd18..68ec5d69233 100644
--- a/libjava/javax/naming/spi/Resolver.java
+++ b/libjava/javax/naming/spi/Resolver.java
@@ -37,7 +37,9 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
+
+import javax.naming.Name;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/naming/spi/StateFactory.java b/libjava/javax/naming/spi/StateFactory.java
index 50ec77c0829..6316f28db4c 100644
--- a/libjava/javax/naming/spi/StateFactory.java
+++ b/libjava/javax/naming/spi/StateFactory.java
@@ -37,8 +37,11 @@ exception statement from your version. */
package javax.naming.spi;
-import javax.naming.*;
+
import java.util.Hashtable;
+import javax.naming.Context;
+import javax.naming.Name;
+import javax.naming.NamingException;
/**
* @author Warren Levy <warrenl@redhat.com>
diff --git a/libjava/javax/print/attribute/AttributeSetUtilities.java b/libjava/javax/print/attribute/AttributeSetUtilities.java
new file mode 100644
index 00000000000..65cf3782687
--- /dev/null
+++ b/libjava/javax/print/attribute/AttributeSetUtilities.java
@@ -0,0 +1,445 @@
+/* AttributeSetUtilities.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+public final class AttributeSetUtilities
+{
+ private static class UnmodifiableAttributeSet
+ implements AttributeSet, Serializable
+ {
+ private AttributeSet set;
+
+ public UnmodifiableAttributeSet(AttributeSet attributeSet)
+ {
+ if (attributeSet == null)
+ throw new NullPointerException("attributeSet may not be null");
+
+ this.set = attributeSet;
+ }
+
+ public boolean add(Attribute attribute)
+ {
+ throw new UnmodifiableSetException();
+ }
+
+ public boolean addAll(AttributeSet attributes)
+ {
+ throw new UnmodifiableSetException();
+ }
+
+ public void clear()
+ {
+ throw new UnmodifiableSetException();
+ }
+
+ public boolean containsKey(Class category)
+ {
+ return set.containsKey(category);
+ }
+
+ public boolean containsValue(Attribute attribute)
+ {
+ return set.containsValue(attribute);
+ }
+
+ public boolean equals(Object obj)
+ {
+ return set.equals(obj);
+ }
+
+ public Attribute get(Class interfaceName)
+ {
+ return set.get(interfaceName);
+ }
+
+ public int hashCode()
+ {
+ return set.hashCode();
+ }
+
+ public boolean isEmpty()
+ {
+ return set.isEmpty();
+ }
+
+ public boolean remove(Class category)
+ {
+ throw new UnmodifiableSetException();
+ }
+
+ public boolean remove(Attribute attribute)
+ {
+ throw new UnmodifiableSetException();
+ }
+
+ public int size()
+ {
+ return set.size();
+ }
+
+ public Attribute[] toArray()
+ {
+ return set.toArray();
+ }
+ }
+
+ public static class UnmodifiableDocAttributeSet
+ extends UnmodifiableAttributeSet
+ implements DocAttributeSet, Serializable
+ {
+ public UnmodifiableDocAttributeSet(DocAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class UnmodifiablePrintJobAttributeSet
+ extends UnmodifiableAttributeSet
+ implements PrintJobAttributeSet, Serializable
+ {
+ public UnmodifiablePrintJobAttributeSet(PrintJobAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class UnmodifiablePrintRequestAttributeSet
+ extends UnmodifiableAttributeSet
+ implements PrintRequestAttributeSet, Serializable
+ {
+ public UnmodifiablePrintRequestAttributeSet(PrintRequestAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class UnmodifiablePrintServiceAttributeSet
+ extends UnmodifiableAttributeSet
+ implements PrintServiceAttributeSet, Serializable
+ {
+ public UnmodifiablePrintServiceAttributeSet(PrintServiceAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class SynchronizedAttributeSet
+ implements AttributeSet, Serializable
+ {
+ private AttributeSet set;
+
+ public SynchronizedAttributeSet(AttributeSet attributeSet)
+ {
+ if (attributeSet == null)
+ throw new NullPointerException("attributeSet may not be null");
+
+ this.set = attributeSet;
+ }
+
+ public synchronized boolean add(Attribute attribute)
+ {
+ return set.add(attribute);
+ }
+
+ public synchronized boolean addAll(AttributeSet attributes)
+ {
+ return set.addAll(attributes);
+ }
+
+ public synchronized void clear()
+ {
+ set.clear();
+ }
+
+ public synchronized boolean containsKey(Class category)
+ {
+ return set.containsKey(category);
+ }
+
+ public synchronized boolean containsValue(Attribute attribute)
+ {
+ return set.containsValue(attribute);
+ }
+
+ public synchronized boolean equals(Object obj)
+ {
+ return set.equals(obj);
+ }
+
+ public synchronized Attribute get(Class interfaceName)
+ {
+ return set.get(interfaceName);
+ }
+
+ public synchronized int hashCode()
+ {
+ return set.hashCode();
+ }
+
+ public synchronized boolean isEmpty()
+ {
+ return set.isEmpty();
+ }
+
+ public synchronized boolean remove(Class category)
+ {
+ return set.remove(category);
+ }
+
+ public synchronized boolean remove(Attribute attribute)
+ {
+ return set.remove(attribute);
+ }
+
+ public synchronized int size()
+ {
+ return set.size();
+ }
+
+ public synchronized Attribute[] toArray()
+ {
+ return set.toArray();
+ }
+ }
+
+ public static class SynchronizedDocAttributeSet
+ extends SynchronizedAttributeSet
+ implements DocAttributeSet, Serializable
+ {
+ public SynchronizedDocAttributeSet(DocAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class SynchronizedPrintJobAttributeSet
+ extends SynchronizedAttributeSet
+ implements PrintJobAttributeSet, Serializable
+ {
+ public SynchronizedPrintJobAttributeSet(PrintJobAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class SynchronizedPrintRequestAttributeSet
+ extends SynchronizedAttributeSet
+ implements PrintRequestAttributeSet, Serializable
+ {
+ public SynchronizedPrintRequestAttributeSet(PrintRequestAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ public static class SynchronizedPrintServiceAttributeSet
+ extends SynchronizedAttributeSet
+ implements PrintServiceAttributeSet, Serializable
+ {
+ public SynchronizedPrintServiceAttributeSet(PrintServiceAttributeSet attributeSet)
+ {
+ super(attributeSet);
+ }
+ }
+
+ /**
+ * Returns a synchronized view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static AttributeSet synchronizedView(AttributeSet attributeSet)
+ {
+ return new SynchronizedAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns a synchronized view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static DocAttributeSet synchronizedView(DocAttributeSet attributeSet)
+ {
+ return new SynchronizedDocAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns a synchronized view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintJobAttributeSet synchronizedView(PrintJobAttributeSet attributeSet)
+ {
+ return new SynchronizedPrintJobAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns a synchronized view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintRequestAttributeSet synchronizedView(PrintRequestAttributeSet attributeSet)
+ {
+ return new SynchronizedPrintRequestAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns a synchronized view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintServiceAttributeSet synchronizedView(PrintServiceAttributeSet attributeSet)
+ {
+ return new SynchronizedPrintServiceAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns an unmodifiable view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static AttributeSet unmodifiableView(AttributeSet attributeSet)
+ {
+ return new UnmodifiableAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns an unmodifiable view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static DocAttributeSet unmodifiableView(DocAttributeSet attributeSet)
+ {
+ return new UnmodifiableDocAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns an unmodifiable view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintJobAttributeSet unmodifiableView(PrintJobAttributeSet attributeSet)
+ {
+ return new UnmodifiablePrintJobAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns an unmodifiable view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintRequestAttributeSet unmodifiableView(PrintRequestAttributeSet attributeSet)
+ {
+ return new UnmodifiablePrintRequestAttributeSet(attributeSet);
+ }
+
+ /**
+ * Returns an unmodifiable view of the given attribute set.
+ *
+ * @return the sychronized attribute set
+ */
+ public static PrintServiceAttributeSet unmodifiableView(PrintServiceAttributeSet attributeSet)
+ {
+ return new UnmodifiablePrintServiceAttributeSet(attributeSet);
+ }
+
+ /**
+ * Verifies that the given object is a <code>Class</code> that
+ * implements the given interface name.
+ *
+ * @return object casted to <code>Class</code>
+ *
+ * @exception ClassCastException if object is not a <code>Class</code>
+ * that implements interfaceName
+ * @exception NullPointerException if object is null
+ */
+ public static Class verifyAttributeCategory(Object object,
+ Class interfaceName)
+ {
+ if (object == null)
+ throw new NullPointerException("object may not be null");
+
+ Class clazz = (Class) object;
+
+ if (interfaceName.isAssignableFrom(clazz))
+ return clazz;
+
+ throw new ClassCastException();
+ }
+
+ /**
+ * Verifies that the given object is an attribute of the given interface.
+ *
+ * @return the object casted to <code>Attribute</code>
+ *
+ * @exception ClassCastException if object is no instance of interfaceName.
+ * @exception NullPointerException if object is null
+ */
+ public static Attribute verifyAttributeValue(Object object,
+ Class interfaceName)
+ {
+ if (object == null)
+ throw new NullPointerException("object may not be null");
+
+ if (interfaceName.isInstance(object))
+ return (Attribute) object;
+
+ throw new ClassCastException();
+ }
+
+ /**
+ * Verifies that the category of attribute is equals to category.
+ *
+ * @param category the category the atteribute should be
+ * @param attribtue the attribute to verify
+ *
+ * @exception IllegalArgumentException if the categories are not equal
+ * @exception NullPointerException if category is null
+ */
+ public static void verifyCategoryForValue(Class category,
+ Attribute attribute)
+ {
+ if (category == null)
+ throw new NullPointerException("object may not be null");
+
+ if (category.equals(attribute.getCategory()))
+ throw new IllegalArgumentException
+ ("category of attribute not equal to category");
+ }
+}
diff --git a/libjava/javax/print/attribute/DateTimeSyntax.java b/libjava/javax/print/attribute/DateTimeSyntax.java
new file mode 100644
index 00000000000..6880f2bca36
--- /dev/null
+++ b/libjava/javax/print/attribute/DateTimeSyntax.java
@@ -0,0 +1,101 @@
+/* DateTimeSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class DateTimeSyntax implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -1400819079791208582L;
+
+ private Date value;
+
+ /**
+ * Creates a <code>DateTimeSyntax</code> with a given value.
+ *
+ * @param value the value for this syntax
+ *
+ * @exception NullPointerException if value is null
+ */
+ protected DateTimeSyntax(Date value)
+ {
+ if (value == null)
+ throw new NullPointerException("value may not be null");
+
+ this.value = value;
+ }
+
+ /**
+ * Returns the date value of this object.
+ *
+ * @return the date value
+ */
+ public Date getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Tests if the given object is equal to this one.
+ *
+ * @param obj the object to test
+ *
+ * @return True if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof DateTimeSyntax))
+ return false;
+
+ return value.equals(((DateTimeSyntax) obj).getValue());
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return value.hashCode();
+ }
+}
diff --git a/libjava/javax/print/attribute/DocAttribute.java b/libjava/javax/print/attribute/DocAttribute.java
new file mode 100644
index 00000000000..077fdaa1479
--- /dev/null
+++ b/libjava/javax/print/attribute/DocAttribute.java
@@ -0,0 +1,45 @@
+/* DocAttribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface DocAttribute extends Attribute
+{
+}
diff --git a/libjava/javax/print/attribute/DocAttributeSet.java b/libjava/javax/print/attribute/DocAttributeSet.java
new file mode 100644
index 00000000000..200420b6515
--- /dev/null
+++ b/libjava/javax/print/attribute/DocAttributeSet.java
@@ -0,0 +1,55 @@
+/* DocAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface DocAttributeSet extends AttributeSet
+{
+ /**
+ * Adds the specified attribute value to this attribute set
+ * if it is not already present.
+ */
+ boolean add (Attribute attribute);
+
+ /**
+ * Adds all of the elements in the specified set to this attribute.
+ */
+ boolean addAll (AttributeSet attributes);
+}
diff --git a/libjava/javax/print/attribute/EnumSyntax.java b/libjava/javax/print/attribute/EnumSyntax.java
new file mode 100644
index 00000000000..c5a096c2fe6
--- /dev/null
+++ b/libjava/javax/print/attribute/EnumSyntax.java
@@ -0,0 +1,146 @@
+/* EnumSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class EnumSyntax implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -2739521845085831642L;
+
+ private int value;
+
+ /**
+ * Creates a <code>EnumSyntax</code> object.
+ *
+ * @param value the value to set
+ */
+ protected EnumSyntax(int value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * Returns the value of this object.
+ *
+ * @return the value
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Clones this object.
+ *
+ * @return a clone of this object
+ */
+ public Object clone()
+ {
+ try
+ {
+ return super.clone();
+ }
+ catch (CloneNotSupportedException e)
+ {
+ // Cannot happen as we implement java.lang.Cloneable.
+ return null;
+ }
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ int index = value - getOffset();
+ String[] table = getStringTable();
+
+ if (table != null
+ && index >= 0
+ && index < table.length)
+ return table[index];
+
+ return "" + value;
+ }
+
+ /**
+ * Returns a table with the enumeration values represented as strings
+ * for this object.
+ *
+ * The default implementation just returns null.
+ *
+ * @return the enumeration values as strings
+ */
+ public String[] getStringTable()
+ {
+ return null;
+ }
+
+ /**
+ * Returns a table with the enumeration values for this object.
+ *
+ * The default implementation just returns null.
+ *
+ * @return the enumeration values
+ */
+ public EnumSyntax[] getEnumValueTable()
+ {
+ return null;
+ }
+
+ public int getOffset()
+ {
+ return 0;
+ }
+}
diff --git a/libjava/javax/print/attribute/HashAttributeSet.java b/libjava/javax/print/attribute/HashAttributeSet.java
new file mode 100644
index 00000000000..63b4105cb42
--- /dev/null
+++ b/libjava/javax/print/attribute/HashAttributeSet.java
@@ -0,0 +1,366 @@
+/* HashAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Iterator;
+
+public class HashAttributeSet implements AttributeSet, Serializable
+{
+ private static final long serialVersionUID = 5311560590283707917L;
+
+ private Class interfaceName;
+ private HashMap attributeMap = new HashMap();
+
+ /**
+ * Creates an empty <code>HashAttributeSet</code> object.
+ */
+ public HashAttributeSet()
+ {
+ this(Attribute.class);
+ }
+
+ /**
+ * Creates a <code>HashAttributeSet</code> object with the given
+ * attribute in it.
+ *
+ * @param attribute the attribute to put into the set
+ *
+ * @exception NullPointerException if attribute is null
+ */
+ public HashAttributeSet(Attribute attribute)
+ {
+ this(attribute, Attribute.class);
+ }
+
+ /**
+ * Creates a <code>HashAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the set
+ *
+ * @exception NullPointerException If attributes is null
+ */
+ public HashAttributeSet(Attribute[] attributes)
+ {
+ this(attributes, Attribute.class);
+ }
+
+ /**
+ * Creates a <code>HashAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the set
+ *
+ * @exception NullPointerException If attributes is null
+ */
+ public HashAttributeSet(AttributeSet attributes)
+ {
+ this(attributes, Attribute.class);
+ }
+
+ /**
+ * Creates an empty <code>HashAttributeSet</code> object.
+ *
+ * @param interfaceName the interface that all members must implement
+ *
+ * @exception NullPointerException if interfaceName is null
+ */
+ protected HashAttributeSet(Class interfaceName)
+ {
+ if (interfaceName == null)
+ throw new NullPointerException("interfaceName may not be null");
+
+ this.interfaceName = interfaceName;
+ }
+
+ /**
+ * Creates an empty <code>HashAttributeSet</code> object.
+ *
+ * @exception ClassCastException if attribute is not an interface of
+ * interfaceName
+ * @exception NullPointerException if attribute or interfaceName is null
+ */
+ protected HashAttributeSet(Attribute attribute, Class interfaceName)
+ {
+ this(interfaceName);
+
+ if (attribute == null)
+ throw new NullPointerException();
+
+ addInternal(attribute, interfaceName);
+ }
+
+ /**
+ * Creates an empty <code>HashAttributeSet</code> object.
+ *
+ * @exception ClassCastException if any element of attributes is not an
+ * interface of interfaceName
+ * @exception NullPointerException if attributes or interfaceName is null
+ */
+ protected HashAttributeSet(Attribute[] attributes, Class interfaceName)
+ {
+ this(interfaceName);
+
+ if (attributes == null)
+ throw new NullPointerException();
+
+ for (int index = 0; index < attributes.length; index++)
+ addInternal(attributes[index], interfaceName);
+ }
+
+ /**
+ * Creates an empty <code>HashAttributeSet</code> object.
+ *
+ * @exception ClassCastException if any element of attributes is not an
+ * interface of interfaceName
+ */
+ public HashAttributeSet(AttributeSet attributes, Class interfaceName)
+ {
+ this(interfaceName);
+
+ if (attributes != null)
+ addAllInternal(attributes, interfaceName);
+ }
+
+ /**
+ * Adds the given attribute to the set.
+ *
+ * @param attribute the attribute to add
+ *
+ * @return true if the attribute set has changed, false otherwise
+ *
+ * @exception NullPointerException if attribute is null
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
+ */
+ public boolean add(Attribute attribute)
+ {
+ return addInternal(attribute, interfaceName);
+ }
+
+ private boolean addInternal(Attribute attribute, Class interfaceName)
+ {
+ if (attribute == null)
+ throw new NullPointerException("attribute may not be null");
+
+ AttributeSetUtilities.verifyAttributeCategory(interfaceName,
+ this.interfaceName);
+
+ Object old = attributeMap.put
+ (attribute.getCategory(), AttributeSetUtilities.verifyAttributeValue
+ (attribute, interfaceName));
+ return !attribute.equals(old);
+ }
+
+ /**
+ * Adds the given attributes to the set.
+ *
+ * @param attributes the attributes to add
+ *
+ * @return true if the attribute set has changed, false otherwise
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
+ */
+ public boolean addAll(AttributeSet attributes)
+ {
+ return addAllInternal(attributes, interfaceName);
+ }
+
+ private boolean addAllInternal(AttributeSet attributes, Class interfaceName)
+ {
+ boolean modified = false;
+ Attribute[] array = attributes.toArray();
+
+ for (int index = 0; index < array.length; index++)
+ if (addInternal(array[index], interfaceName))
+ modified = true;
+
+ return modified;
+ }
+
+ /**
+ * Removes all attributes from this attribute set.
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
+ */
+ public void clear()
+ {
+ attributeMap.clear();
+ }
+
+ /**
+ * Checks if this attribute set contains an entry with the given category.
+ *
+ * @param category the category to test for
+ *
+ * @result true if the category exists in this attribute set, false otherwise.
+ */
+ public boolean containsKey(Class category)
+ {
+ return attributeMap.containsKey(category);
+ }
+
+ /**
+ * Checks if this attribute set contains an entry with the given attribute.
+ *
+ * @param attribute the attribute to test for
+ *
+ * @result true if the attribute exists in this attribute set,
+ * false otherwise.
+ */
+ public boolean containsValue(Attribute attribute)
+ {
+ return attributeMap.containsValue(attribute);
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof HashAttributeSet))
+ return false;
+
+ return attributeMap.equals(((HashAttributeSet) obj).attributeMap);
+ }
+
+ /**
+ * Returns the attribute value that is connected to the given attribute
+ * category. If the attribute set does not contains the given category null
+ * will be returned.
+ *
+ * @param category the attribute category to return the attribute value for
+ *
+ * @return the attribute associated to category, or null
+ */
+ public Attribute get(Class category)
+ {
+ return (Attribute) attributeMap.get(category);
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return attributeMap.hashCode() + interfaceName.hashCode();
+ }
+
+ /**
+ * Checks if the attribute set is empty.
+ *
+ * @return true if the attribute set is empty, false otherwise
+ */
+ public boolean isEmpty()
+ {
+ return attributeMap.isEmpty();
+ }
+
+ /**
+ * Removes the entry with the given attribute in it.
+ *
+ * @param attribute the attribute value of the entry to be removed
+ *
+ * @return true if the attribute set has changed, false otherwise.
+ *
+ * @exception UnmodifiableSetException if this attribute set does not
+ * support this action.
+ */
+ public boolean remove(Attribute attribute)
+ {
+ if (attribute == null)
+ return false;
+
+ return attributeMap.remove(attribute.getCategory()) != null;
+ }
+
+ /**
+ * Removes the entry with the given category in it.
+ *
+ * @param category the category value of the entry to be removed
+ *
+ * @return true if the attribute set has changed, false otherwise.
+ */
+ public boolean remove(Class category)
+ {
+ if (category == null)
+ return false;
+
+ return attributeMap.remove(category) != null;
+ }
+
+ /**
+ * Returns the number of elements in this attribute set.
+ *
+ * @return the number of elements.
+ */
+ public int size()
+ {
+ return attributeMap.size();
+ }
+
+ /**
+ * Returns the content of the attribute set as an array
+ *
+ * @return an array of attributes
+ */
+ public Attribute[] toArray()
+ {
+ int index = 0;
+ Iterator it = attributeMap.entrySet().iterator();
+ Attribute[] array = new Attribute[size()];
+
+ while (it.hasNext())
+ {
+ array[index] = (Attribute) it.next();
+ index++;
+ }
+
+ return array;
+ }
+}
diff --git a/libjava/javax/print/attribute/HashDocAttributeSet.java b/libjava/javax/print/attribute/HashDocAttributeSet.java
new file mode 100644
index 00000000000..a7eedbf54b6
--- /dev/null
+++ b/libjava/javax/print/attribute/HashDocAttributeSet.java
@@ -0,0 +1,94 @@
+/* HashDocAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+public class HashDocAttributeSet extends HashAttributeSet
+ implements DocAttributeSet, Serializable
+{
+ private static final long serialVersionUID = -1128534486061432528L;
+
+ /**
+ * Creates an empty <code>HashDocAttributeSet</code> object.
+ */
+ public HashDocAttributeSet()
+ {
+ super(DocAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashDocAttributeSet</code> object with the given
+ * attribute in it.
+ *
+ * @param attribute the attriute tu put into the attribute set
+ *
+ * @exception NullPointerException if attribute is null
+ */
+ public HashDocAttributeSet(DocAttribute attribute)
+ {
+ super(attribute, DocAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashDocAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception NullPointerException if attributes is null
+ */
+ public HashDocAttributeSet(DocAttribute[] attributes)
+ {
+ super(attributes, DocAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashDocAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception ClassCastException if any element of attributes is not
+ * an instance of <code>DocAttribute</code>
+ */
+ public HashDocAttributeSet(DocAttributeSet attributes)
+ {
+ super(attributes, DocAttribute.class);
+ }
+}
diff --git a/libjava/javax/print/attribute/HashPrintJobAttributeSet.java b/libjava/javax/print/attribute/HashPrintJobAttributeSet.java
new file mode 100644
index 00000000000..16b1beb3481
--- /dev/null
+++ b/libjava/javax/print/attribute/HashPrintJobAttributeSet.java
@@ -0,0 +1,94 @@
+/* HashPrintJobAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+public class HashPrintJobAttributeSet extends HashAttributeSet
+ implements Serializable, PrintJobAttributeSet
+{
+ private static final long serialVersionUID = -4204473656070350348L;
+
+ /**
+ * Creates an empty <code>HashPrintJobAttributeSet</code> object.
+ */
+ public HashPrintJobAttributeSet()
+ {
+ super(PrintJobAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintJobAttributeSet</code> object with the given
+ * attribute in it.
+ *
+ * @param attribute the attriute tu put into the attribute set
+ *
+ * @exception NullPointerException if attribute is null
+ */
+ public HashPrintJobAttributeSet(PrintJobAttribute attribute)
+ {
+ super(attribute, PrintJobAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintJobAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception NullPointerException if attributes is null
+ */
+ public HashPrintJobAttributeSet(PrintJobAttribute[] attributes)
+ {
+ super(attributes, PrintJobAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintJobAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception ClassCastException if any element of attributes is not
+ * an instance of <code>PrintJobAttribute</code>
+ */
+ public HashPrintJobAttributeSet(PrintJobAttributeSet attributes)
+ {
+ super(attributes, PrintJobAttribute.class);
+ }
+}
diff --git a/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java b/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java
new file mode 100644
index 00000000000..2d0cbbd3adc
--- /dev/null
+++ b/libjava/javax/print/attribute/HashPrintRequestAttributeSet.java
@@ -0,0 +1,94 @@
+/* HashPrintRequestAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+public class HashPrintRequestAttributeSet extends HashAttributeSet
+ implements Serializable, PrintRequestAttributeSet
+{
+ private static final long serialVersionUID = 2364756266107751933L;
+
+ /**
+ * Creates an empty <code>HashPrintRequestAttributeSet</code> object.
+ */
+ public HashPrintRequestAttributeSet()
+ {
+ super(PrintRequestAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
+ * attribute in it.
+ *
+ * @param attribute the attriute tu put into the attribute set
+ *
+ * @exception NullPointerException if attribute is null
+ */
+ public HashPrintRequestAttributeSet(PrintRequestAttribute attribute)
+ {
+ super(attribute, PrintRequestAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception NullPointerException if attributes is null
+ */
+ public HashPrintRequestAttributeSet(PrintRequestAttribute[] attributes)
+ {
+ super(attributes, PrintRequestAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintRequestAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception ClassCastException if any element of attributes is not
+ * an instance of <code>PrintRequestAttribute</code>
+ */
+ public HashPrintRequestAttributeSet(PrintRequestAttributeSet attributes)
+ {
+ super(attributes, PrintRequestAttribute.class);
+ }
+}
diff --git a/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java b/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java
new file mode 100644
index 00000000000..aa6793b382f
--- /dev/null
+++ b/libjava/javax/print/attribute/HashPrintServiceAttributeSet.java
@@ -0,0 +1,94 @@
+/* HashPrintServiceAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+public class HashPrintServiceAttributeSet extends HashAttributeSet
+ implements Serializable, PrintServiceAttributeSet
+{
+ private static final long serialVersionUID = 6642904616179203070L;
+
+ /**
+ * Creates an empty <code>HashPrintServiceAttributeSet</code> object.
+ */
+ public HashPrintServiceAttributeSet()
+ {
+ super(PrintServiceAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
+ * attribute in it.
+ *
+ * @param attribute the attriute tu put into the attribute set
+ *
+ * @exception NullPointerException if attribute is null
+ */
+ public HashPrintServiceAttributeSet(PrintServiceAttribute attribute)
+ {
+ super(attribute, PrintServiceAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception NullPointerException if attributes is null
+ */
+ public HashPrintServiceAttributeSet(PrintServiceAttribute[] attributes)
+ {
+ super(attributes, PrintServiceAttribute.class);
+ }
+
+ /**
+ * Creates a <code>HashPrintServiceAttributeSet</code> object with the given
+ * attributes in it.
+ *
+ * @param attributes the attributes to put into the attribute set
+ *
+ * @exception ClassCastException if any element of attributes is not
+ * an instance of <code>PrintServiceAttribute</code>
+ */
+ public HashPrintServiceAttributeSet(PrintServiceAttributeSet attributes)
+ {
+ super(attributes, PrintServiceAttribute.class);
+ }
+}
diff --git a/libjava/javax/print/attribute/IntegerSyntax.java b/libjava/javax/print/attribute/IntegerSyntax.java
new file mode 100644
index 00000000000..2b713bf13a2
--- /dev/null
+++ b/libjava/javax/print/attribute/IntegerSyntax.java
@@ -0,0 +1,122 @@
+/* IntegerSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class IntegerSyntax implements Cloneable, Serializable
+{
+ private int value;
+
+ /**
+ * Creates a <code>IntegerSyntax</code> with the given value.
+ *
+ * @param value the value to set
+ */
+ protected IntegerSyntax(int value)
+ {
+ this.value = value;
+ }
+
+ /**
+ * Creates a <code>IntegerSyntax</code> with the given arguments.
+ *
+ * @param value the value to set
+ * @param lowerBound the lower bound for the value
+ * @param upperBound the upper bound for the value
+ *
+ * @exception IllegalArgumentException if value < lowerBound
+ * or value > upperBound
+ */
+ protected IntegerSyntax(int value, int lowerBound, int upperBound)
+ {
+ if (value < lowerBound
+ || value > upperBound)
+ throw new IllegalArgumentException("value not in range");
+
+ this.value = value;
+ }
+
+ /**
+ * Returns the value of this object.
+ *
+ * @return the value
+ */
+ public int getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof IntegerSyntax))
+ return false;
+
+ return value == ((IntegerSyntax) obj).getValue();
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ return "" + value;
+ }
+}
diff --git a/libjava/javax/print/attribute/PrintJobAttribute.java b/libjava/javax/print/attribute/PrintJobAttribute.java
new file mode 100644
index 00000000000..2c8e9c410bf
--- /dev/null
+++ b/libjava/javax/print/attribute/PrintJobAttribute.java
@@ -0,0 +1,45 @@
+/* PrintJobAttribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface PrintJobAttribute extends Attribute
+{
+}
diff --git a/libjava/javax/print/attribute/PrintJobAttributeSet.java b/libjava/javax/print/attribute/PrintJobAttributeSet.java
new file mode 100644
index 00000000000..14c231b0c97
--- /dev/null
+++ b/libjava/javax/print/attribute/PrintJobAttributeSet.java
@@ -0,0 +1,55 @@
+/* PrintJobAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface PrintJobAttributeSet extends AttributeSet
+{
+ /**
+ * Adds the specified attribute value to this attribute set
+ * if it is not already present.
+ */
+ boolean add (Attribute attribute);
+
+ /**
+ * Adds all of the elements in the specified set to this attribute.
+ */
+ boolean addAll (AttributeSet attributes);
+}
diff --git a/libjava/javax/print/attribute/PrintRequestAttribute.java b/libjava/javax/print/attribute/PrintRequestAttribute.java
new file mode 100644
index 00000000000..a630a4948e8
--- /dev/null
+++ b/libjava/javax/print/attribute/PrintRequestAttribute.java
@@ -0,0 +1,45 @@
+/* PrintRequestAttribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface PrintRequestAttribute extends Attribute
+{
+}
diff --git a/libjava/javax/print/attribute/PrintServiceAttribute.java b/libjava/javax/print/attribute/PrintServiceAttribute.java
new file mode 100644
index 00000000000..371670277d0
--- /dev/null
+++ b/libjava/javax/print/attribute/PrintServiceAttribute.java
@@ -0,0 +1,45 @@
+/* PrintServiceAttribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface PrintServiceAttribute extends Attribute
+{
+}
diff --git a/libjava/javax/print/attribute/PrintServiceAttributeSet.java b/libjava/javax/print/attribute/PrintServiceAttributeSet.java
new file mode 100644
index 00000000000..245ba1095ad
--- /dev/null
+++ b/libjava/javax/print/attribute/PrintServiceAttributeSet.java
@@ -0,0 +1,55 @@
+/* PrintServiceAttributeSet.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface PrintServiceAttributeSet extends AttributeSet
+{
+ /**
+ * Adds the specified attribute value to this attribute set
+ * if it is not already present.
+ */
+ boolean add (Attribute attribute);
+
+ /**
+ * Adds all of the elements in the specified set to this attribute.
+ */
+ boolean addAll (AttributeSet attributes);
+}
diff --git a/libjava/javax/print/attribute/ResolutionSyntax.java b/libjava/javax/print/attribute/ResolutionSyntax.java
new file mode 100644
index 00000000000..592d995df7d
--- /dev/null
+++ b/libjava/javax/print/attribute/ResolutionSyntax.java
@@ -0,0 +1,220 @@
+/* ResolutionSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class ResolutionSyntax
+ implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 2706743076526672017L;
+
+ /**
+ * Constant for units of dots per centimeter.
+ */
+ public static final int DPCM = 254;
+
+ /**
+ * Constant for units of dots per inch
+ */
+ public static final int DPI = 100;
+
+ private int crossFeedResolution;
+ private int feedResolution;
+
+ /**
+ * Creates a <code>ResolutionSyntax</code> object with the given arguments.
+ *
+ * @param crossFeedResolution the cross feed resolution
+ * @param feedResolution the feed resolution
+ * @param units the unit to use
+ *
+ * @exception IllegalArgumentException if preconditions fail
+ */
+ public ResolutionSyntax(int crossFeedResolution, int feedResolution,
+ int units)
+ {
+ if (crossFeedResolution < 1
+ || feedResolution < 1
+ || units < 1)
+ throw new IllegalArgumentException("no argument may be less than 1");
+
+ this.crossFeedResolution = crossFeedResolution * units;
+ this.feedResolution = feedResolution * units;
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if(! (obj instanceof ResolutionSyntax))
+ return false;
+
+ ResolutionSyntax tmp = (ResolutionSyntax) obj;
+
+ return (crossFeedResolution == tmp.getCrossFeedResolutionDphi()
+ && feedResolution == tmp.getFeedResolutionDphi());
+ }
+
+ /**
+ * Returns the cross feed resolution in units.
+ *
+ * @return the resolution
+ *
+ * @exception IllegalArgumenException if units < 1
+ */
+ public int getCrossFeedResolution(int units)
+ {
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ int rount = units / 2;
+ return (crossFeedResolution + units) / units;
+ }
+
+ /**
+ * Returns the raw cross feed resolution in units.
+ *
+ * @return the raw resolution
+ */
+ protected int getCrossFeedResolutionDphi()
+ {
+ return crossFeedResolution;
+ }
+
+ /**
+ * Returns the feed resolution in units.
+ *
+ * @return the resolution
+ *
+ * @exception IllegalArgumenException if units < 1
+ */
+ public int getFeedResolution(int units)
+ {
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ int rount = units / 2;
+ return (crossFeedResolution + units) / units;
+ }
+
+ /**
+ * Returns the raw feed resolution in units.
+ *
+ * @return the raw resolution
+ */
+ protected int getFeedResolutionDphi()
+ {
+ return feedResolution;
+ }
+
+ /**
+ * Returns the resolution as two field array. Index 0 is the cross feed
+ * resolution, index 1 the feed resolution.
+ *
+ * @param units the units to use
+ *
+ * @return the array with the resolutions
+ */
+ public int[] getResolution(int units)
+ {
+ int[] resolution = new int[2];
+ resolution[0] = getCrossFeedResolution(units);
+ resolution[1] = getFeedResolution(units);
+ return resolution;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return crossFeedResolution + feedResolution;
+ }
+
+ /**
+ * Checks of other is a lower or equal resolution.
+ *
+ * @param other the resolution to check against
+ *
+ * @return true if other describes a lower or equal resolution
+ */
+ public boolean lessThanOrEquals(ResolutionSyntax other)
+ {
+ if (other == null)
+ throw new NullPointerException("other may not be null");
+
+ return (crossFeedResolution <= other.getCrossFeedResolutionDphi()
+ && feedResolution <= other.getFeedResolutionDphi());
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ return toString(1, "dphi");
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @param units the units to use
+ * @param unitsName the name of the units
+ *
+ * @return the string representation
+ */
+ public String toString(int units, String unitsName)
+ {
+ return ("" + getCrossFeedResolution(units)
+ + "x" + getFeedResolution(units)
+ + " " + unitsName);
+ }
+}
diff --git a/libjava/javax/print/attribute/SetOfIntegerSyntax.java b/libjava/javax/print/attribute/SetOfIntegerSyntax.java
new file mode 100644
index 00000000000..d4e7fde00c2
--- /dev/null
+++ b/libjava/javax/print/attribute/SetOfIntegerSyntax.java
@@ -0,0 +1,253 @@
+/* SetOfIntegerSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+import java.util.Vector;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class SetOfIntegerSyntax
+ implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = 3666874174847632203L;
+
+ private int[][] members;
+
+ private static int[][] normalize(Vector vecMembers)
+ {
+ // XXX: Perhaps we should merge ranges that overlap.
+
+ int current = 0;
+ int[][] members = new int[vecMembers.size()][];
+
+ while (vecMembers.size() > 0)
+ {
+ // Search the lowest range.
+ int[] range = (int[]) vecMembers.elementAt(0);
+
+ for (int index = 1; index < vecMembers.size(); index++)
+ {
+ int[] tmp = (int[]) vecMembers.elementAt(index);
+
+ if (range[0] > tmp[0]
+ || (range[0] == tmp[0]
+ && range[0] > tmp[0]))
+ range = tmp;
+ }
+
+ members[current] = range;
+ current++;
+ }
+
+ return members;
+ }
+
+ /**
+ * Creates a <code>SetOfIntegerSyntax</code> object.
+ *
+ * @param member the member value
+ *
+ * @exception IllegalArgumentException if member is < 0
+ */
+ protected SetOfIntegerSyntax(int member)
+ {
+ if (member < 0)
+ throw new IllegalArgumentException("member may not be less than 0");
+
+ this.members = new int[][]{{member, member}};
+ }
+
+ /**
+ * Creates a <code>SetOfIntegerSyntax</code> object.
+ *
+ * @param members the members to use in this set
+ *
+ * @exception IllegalArgumentException if any element is invalid
+ * @exception NullPointerException if any element of members is null
+ */
+ protected SetOfIntegerSyntax(int[][] members)
+ {
+ Vector vecMembers = new Vector();
+
+ if (members != null)
+ {
+ for (int index = 0; index < members.length; index++)
+ {
+ int lower;
+ int upper;
+
+ if (members[index].length == 1)
+ {
+ lower = members[index][0];
+ upper = members[index][0];
+ }
+ else if (members[index].length == 2)
+ {
+ lower = members[index][0];
+ upper = members[index][1];
+ }
+ else
+ throw new IllegalArgumentException("invalid member element");
+
+ if (lower <= upper && lower < 0)
+ throw new IllegalArgumentException("invalid member element");
+
+ if (lower <= upper)
+ {
+ int[] range = new int[2];
+ range[0] = lower;
+ range[1] = upper;
+ vecMembers.add(range);
+ }
+ }
+ }
+
+ this.members = normalize(vecMembers);
+ }
+
+ /**
+ * Creates a <code>SetOfIntegerSyntax</code> object.
+ *
+ * @param lowerBound the lower bound value
+ * @param upperBound the upper bound value
+ *
+ * @exception IllegalArgumentException if lowerBound <= uppbound
+ * and lowerBound < 0
+ */
+ protected SetOfIntegerSyntax(int lowerBound, int upperBound)
+ {
+ if (lowerBound <= upperBound
+ && lowerBound < 0)
+ throw new IllegalArgumentException();
+
+ members = (lowerBound <= upperBound ? new int[][]{{lowerBound, upperBound}}
+ : new int[0][]);
+ }
+
+ /**
+ * Checks if this set contains value.
+ *
+ * @param value the value to test for
+ *
+ * @return true if this set contains value, false otherwise
+ */
+ public boolean contains(int value)
+ {
+ // This only works on a normalized member array.
+ for (int index = 0; index < members.length; index++)
+ {
+ if (value < members[index][0])
+ return false;
+ else if (value < members[index][1])
+ return true;
+ }
+
+ return false;
+ }
+
+ /**
+ * Checks if this set contains value.
+ *
+ * @param value the value to test for
+ *
+ * @return true if this set contains value, false otherwise
+ */
+ public boolean contains(IntegerSyntax value)
+ {
+ return contains(value.getValue());
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof SetOfIntegerSyntax))
+ return false;
+
+ throw new Error("not implemented");
+ }
+
+ /**
+ * Returns an array describing the members included in this set.
+ *
+ * @return the array with the members
+ */
+ public int[][] getMembers()
+ {
+ throw new Error("not implemented");
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ throw new Error("not implemented");
+ }
+
+ /**
+ * Returns the smallest value that is greater then x.
+ *
+ * @param x an integer value
+ *
+ * @return the next value
+ */
+ public int next(int x)
+ {
+ throw new Error("not implemented");
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ throw new Error("not implemented");
+ }
+}
diff --git a/libjava/javax/print/attribute/Size2DSyntax.java b/libjava/javax/print/attribute/Size2DSyntax.java
new file mode 100644
index 00000000000..4b71fd6aae9
--- /dev/null
+++ b/libjava/javax/print/attribute/Size2DSyntax.java
@@ -0,0 +1,225 @@
+/* Size2DSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class Size2DSyntax implements Cloneable, Serializable
+{
+ /**
+ * Constant for units of dots per mircometer to describe an inch.
+ */
+ public static final int INCH = 25400;
+
+ /**
+ * Constant for units of dots per mircometer to describe a centimeter.
+ */
+ public static final int MM = 1000;
+
+ private int x;
+ private int y;
+
+ /**
+ * Creates a <code>Size2DSyntax</code> object with the given arguments.
+ *
+ * @param x the size in x direction
+ * @param y the size in y direction
+ * @param units the units to use for the sizes
+ *
+ * @exception IllegalArgumentException if preconditions fail
+ */
+ protected Size2DSyntax(float x, float y, int units)
+ {
+ if (x < 0.0f || y < 0.0f)
+ throw new IllegalArgumentException("x and/or y may not be less than 0");
+
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ this.x = (int) (x * units + 0.5f);
+ this.y = (int) (y * units + 0.5f);
+ }
+
+ /**
+ * Creates a <code>Size2DSyntax</code> object with the given arguments.
+ *
+ * @param x the size in x direction
+ * @param y the size in y direction
+ * @param units the units to use for the sizes
+ *
+ * @exception IllegalArgumentException if preconditions fail
+ */
+ protected Size2DSyntax(int x, int y, int units)
+ {
+ if (x < 0 || y < 0)
+ throw new IllegalArgumentException("x and/or y may not be less then 0");
+
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ this.x = x * units;
+ this.y = y * units;
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof Size2DSyntax))
+ return false;
+
+ Size2DSyntax tmp = (Size2DSyntax) obj;
+
+ return (x == tmp.getXMicrometers()
+ && y == tmp.getYMicrometers());
+ }
+
+ /**
+ * Return the size described in this object as a two field array.
+ * Index 0 contains the size in x direction, index 1 the size in
+ * y direction.
+ *
+ * @param units the units to use
+ *
+ * @return the array that describes the size
+ *
+ * @exception IllegalArgumentException if units < 1
+ */
+ public float[] getSize(int units)
+ {
+ float[] size = new float[2];
+ size[0] = getX(units);
+ size[1] = getY(units);
+ return size;
+ }
+
+ /**
+ * Return the size in x direction.
+ *
+ * @param units the units to use
+ *
+ * @return the size value
+ *
+ * @exception IllegalArgumentException if units < 1
+ */
+ public float getX(int units)
+ {
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ return ((float) x) / ((float) units);
+ }
+
+ /**
+ * Returns the size in x direction in mircometers.
+ *
+ * @return the size value
+ */
+ protected int getXMicrometers()
+ {
+ return x;
+ }
+
+ /**
+ * Return the size in y direction.
+ *
+ * @param units the units to use
+ *
+ * @return the size value
+ *
+ * @exception IllegalArgumentException if units < 1
+ */
+ public float getY(int units)
+ {
+ if (units < 1)
+ throw new IllegalArgumentException("units may not be less then 1");
+
+ return ((float) y) / ((float) units);
+ }
+
+ /**
+ * Returns the size in y direction in mircometers.
+ *
+ * @return the size value
+ */
+ protected int getYMicrometers()
+ {
+ return y;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return x + y;
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ return toString(1, "um");
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @param units the units to use
+ * @param unitsName the name of the units
+ *
+ * @return the string representation
+ */
+ public String toString(int units, String unitsName)
+ {
+ return "" + getX(units) + "x" + getY(units) + " " + unitsName;
+ }
+}
diff --git a/libjava/javax/print/attribute/SupportedValuesAttribute.java b/libjava/javax/print/attribute/SupportedValuesAttribute.java
new file mode 100644
index 00000000000..96d60821917
--- /dev/null
+++ b/libjava/javax/print/attribute/SupportedValuesAttribute.java
@@ -0,0 +1,45 @@
+/* Attribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ */
+public interface SupportedValuesAttribute extends Attribute
+{
+}
diff --git a/libjava/javax/print/attribute/TextSyntax.java b/libjava/javax/print/attribute/TextSyntax.java
new file mode 100644
index 00000000000..51909be9803
--- /dev/null
+++ b/libjava/javax/print/attribute/TextSyntax.java
@@ -0,0 +1,118 @@
+/* TextSyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+import java.util.Locale;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class TextSyntax implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -8130648736378144102L;
+
+ private String value;
+ private Locale locale;
+
+ /**
+ * Creates a <code>TextSyntax</code> object with the given value
+ * and locale.
+ *
+ * @param value the value for this syntax
+ * @param locale the locale to use
+ *
+ * @exception NullPointerException if value is null
+ */
+ protected TextSyntax(String value, Locale locale)
+ {
+ if (value == null)
+ throw new NullPointerException("value may not be null");
+
+ this.value = value;
+ this.locale = locale;
+ }
+
+ /**
+ * Returns the value of this syntax object.
+ *
+ * @return the value
+ */
+ public String getValue()
+ {
+ return value;
+ }
+
+ /**
+ * Returns the locale of this syntax object.
+ *
+ * @return the locale
+ */
+ public Locale getLocale()
+ {
+ return locale;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return value.hashCode() + locale.hashCode();
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof TextSyntax))
+ return false;
+
+ TextSyntax tmp = (TextSyntax) obj;
+
+ return (value.equals(tmp.getValue())
+ && locale.equals(tmp.getLocale()));
+ }
+}
diff --git a/libjava/javax/print/attribute/URISyntax.java b/libjava/javax/print/attribute/URISyntax.java
new file mode 100644
index 00000000000..56a25368fd5
--- /dev/null
+++ b/libjava/javax/print/attribute/URISyntax.java
@@ -0,0 +1,112 @@
+/* URISyntax.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+import java.io.Serializable;
+import java.net.URI;
+
+/**
+ * @author Michael Koch
+ */
+public abstract class URISyntax
+ implements Cloneable, Serializable
+{
+ private static final long serialVersionUID = -7842661210486401678L;
+
+ private URI uri;
+
+ /**
+ * Creates a <code>URISyntax</code> object.
+ *
+ * @param uri the URI value for the syntax
+ *
+ * @exception NullPointerException if uri is null
+ */
+ protected URISyntax(URI uri)
+ {
+ if (uri == null)
+ throw new NullPointerException("uri may not be null");
+
+ this.uri = uri;
+ }
+
+ /**
+ * Tests of obj is equal to this object.
+ *
+ * @param obj the object to test
+ *
+ * @returns true if both objects are equal, false otherwise.
+ */
+ public boolean equals(Object obj)
+ {
+ if (! (obj instanceof URISyntax))
+ return false;
+
+ return uri.equals(((URISyntax) obj).getURI());
+ }
+
+ /**
+ * Returns the URI value of this syntax object.
+ *
+ * @return the URI
+ */
+ public URI getURI()
+ {
+ return uri;
+ }
+
+ /**
+ * Returns the hashcode for this object.
+ *
+ * @return the hashcode
+ */
+ public int hashCode()
+ {
+ return uri.hashCode();
+ }
+
+ /**
+ * Returns the string representation for this object.
+ *
+ * @return the string representation
+ */
+ public String toString()
+ {
+ return uri.toString();
+ }
+}
diff --git a/libjava/javax/print/attribute/UnmodifiableSetException.java b/libjava/javax/print/attribute/UnmodifiableSetException.java
new file mode 100644
index 00000000000..83d389d2b2c
--- /dev/null
+++ b/libjava/javax/print/attribute/UnmodifiableSetException.java
@@ -0,0 +1,65 @@
+/* Attribute.java --
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU Classpath.
+
+GNU Classpath is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+GNU Classpath is distributed in the hope that it will be useful, but
+WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU Classpath; see the file COPYING. If not, write to the
+Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+02111-1307 USA.
+
+Linking this library statically or dynamically with other modules is
+making a combined work based on this library. Thus, the terms and
+conditions of the GNU General Public License cover the whole
+combination.
+
+As a special exception, the copyright holders of this library give you
+permission to link this library with independent modules to produce an
+executable, regardless of the license terms of these independent
+modules, and to copy and distribute the resulting executable under
+terms of your choice, provided that you also meet, for each linked
+independent module, the terms and conditions of the license of that
+module. An independent module is a module which is not derived from
+or based on this library. If you modify this library, you may extend
+this exception to your version of the library, but you are not
+obligated to do so. If you do not wish to do so, delete this
+exception statement from your version. */
+
+package javax.print.attribute;
+
+/**
+ * @author Michael Koch
+ *
+ * @since 1.4
+ */
+public class UnmodifiableSetException extends RuntimeException
+{
+ /**
+ * Creates a <code>UnmodifiableSetException</code>.
+ */
+ public UnmodifiableSetException()
+ {
+ super();
+ }
+
+ /**
+ * Creates a <code>UnmodifiableSetException</code>
+ * with the given message.
+ *
+ * @param message the message for the exception
+ */
+ public UnmodifiableSetException(String message)
+ {
+ super(message);
+ }
+}
diff --git a/libjava/javax/swing/BoxLayout.java b/libjava/javax/swing/BoxLayout.java
index 23009fe68b0..0dd97ac60ba 100644
--- a/libjava/javax/swing/BoxLayout.java
+++ b/libjava/javax/swing/BoxLayout.java
@@ -1,5 +1,5 @@
/* BoxLayout.java -- A layout for swing components.
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -35,16 +35,18 @@ this exception to your version of the library, but you are not
obligated to do so. If you do not wish to do so, delete this
exception statement from your version. */
-
package javax.swing;
-import java.awt.Container;
+import java.awt.AWTError;
import java.awt.Component;
+import java.awt.ComponentOrientation;
+import java.awt.Container;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.LayoutManager2;
import java.io.Serializable;
+
/**
* A layout for swing components.
* This implementation delegates its methods to
@@ -54,101 +56,235 @@ import java.io.Serializable;
*/
public class BoxLayout implements LayoutManager2, Serializable
{
- GridLayout gridbag;
-
- final static int X_AXIS = 0;
- final static int Y_AXIS = 1;
+ /**
+ * Specifies that components are laid out left to right.
+ */
+ public static final int X_AXIS = 0;
+
+ /**
+ * Specifies that components are laid out top to bottom.
+ */
+ public static final int Y_AXIS = 1;
+
+ /**
+ * Specifies that components are laid out in the direction of a line of text.
+ */
+ public static final int LINE_AXIS = 2;
- int way = X_AXIS;
+ /**
+ * Sepcifies that components are laid out in the direction of the line flow.
+ */
+ public static final int PAGE_AXIS = 3;
- BoxLayout(JComponent p,
- int way)
- {
- int width = 0;
- int height = 0;
+ /*
+ * Needed for serialization.
+ */
+ private static final long serialVersionUID = -2474455742719112368L;
- this.way = way;
+ /*
+ * The container given to the constructor.
+ */
+ private Container container;
+
+ /*
+ * Internal layout.
+ */
+ private GridLayout grid;
- if (way == X_AXIS)
- {
- width = 1;
- }
+ /*
+ * Current type of component layouting. Defaults to X_AXIS.
+ */
+ private int way = X_AXIS;
+
+ /**
+ * Constructs a <code>BoxLayout</code> object.
+ *
+ * @param container The container that needs to be laid out.
+ * @param way The orientation of the components.
+ *
+ * @exception AWTError If way has an invalid value.
+ */
+ public BoxLayout(Container container, int way)
+ {
+ int width = 0;
+ int height = 0;
+ ComponentOrientation orientation = container.getComponentOrientation();
+
+ this.container = container;
+ this.way = way;
+
+ switch (way)
+ {
+ case X_AXIS:
+ width = 1;
+ break;
+ case Y_AXIS:
+ height = 1;
+ break;
+ case LINE_AXIS:
+ if (orientation.isHorizontal())
+ height = 1;
+ else
+ width = 1;
+ break;
+ case PAGE_AXIS:
+ if (!orientation.isHorizontal())
+ height = 1;
else
- {
- height = 1;
- }
-
+ width = 1;
+ break;
+ default:
+ throw new AWTError("Invalid value for way");
+ }
+
+ grid = new GridLayout(width, height);
+ }
+
+ /**
+ * Adds a component to the layout.
+ *
+ * @param name The name of the component to add.
+ * @param component the component to add to the layout.
+ */
+ public void addLayoutComponent(String name, Component component)
+ {
+ if (way == X_AXIS
+ || (way == LINE_AXIS
+ && component.getComponentOrientation().isHorizontal())
+ || (way == PAGE_AXIS
+ && !component.getComponentOrientation().isHorizontal()))
+ grid.setColumns(grid.getColumns() + 1);
+ else
+ grid.setRows(grid.getRows() + 1);
+ }
+
+ /**
+ * Removes a component from the layout.
+ *
+ * @param component The component to remove from the layout.
+ */
+ public void removeLayoutComponent(Component component)
+ {
+ grid.removeLayoutComponent(component);
- gridbag = new GridLayout(width, height);
- }
+ if (way == X_AXIS
+ || (way == LINE_AXIS
+ && component.getComponentOrientation().isHorizontal())
+ || (way == PAGE_AXIS
+ && !component.getComponentOrientation().isHorizontal()))
+ grid.setColumns(grid.getColumns() - 1);
+ else
+ grid.setRows(grid.getRows() - 1);
+ }
+
+ /**
+ * Returns the preferred size of the layout.
+ *
+ * @param parent The container that needs to be laid out.
+ *
+ * @return The dimension of the layout.
+ */
+ public Dimension preferredLayoutSize(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
- BoxLayout(int way)
- {
- this(null,way);
- }
+ return grid.preferredLayoutSize(parent);
+ }
+
+ /**
+ * Returns the minimum size of the layout.
+ *
+ * @param parent The container that needs to be laid out.
+ *
+ * @return The dimension of the layout.
+ */
+ public Dimension minimumLayoutSize(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+ return grid.minimumLayoutSize(parent);
+ }
- public void addLayoutComponent(String name, Component comp)
- {
- if (way == X_AXIS)
- {
- gridbag.setColumns( gridbag.getColumns() + 1);
- }
- else
- {
- gridbag.setRows( gridbag.getRows() + 1);
- }
- }
-
- public void removeLayoutComponent(Component comp)
- {
- gridbag.removeLayoutComponent(comp);
- if (way == X_AXIS)
- {
- gridbag.setColumns( gridbag.getColumns() - 1);
- }
- else
- {
- gridbag.setRows( gridbag.getRows() - 1);
- }
- }
-
- public Dimension preferredLayoutSize(Container parent)
- {
- return gridbag.preferredLayoutSize(parent);
- }
-
- public Dimension minimumLayoutSize(Container parent)
- {
- return gridbag.minimumLayoutSize(parent);
- }
-
- public void layoutContainer(Container parent)
- {
- gridbag.layoutContainer(parent);
- }
-
- public void addLayoutComponent ( Component child, Object constraints )
- {
- addLayoutComponent("", child);
- }
-
- public float getLayoutAlignmentX ( Container parent )
- {
- return 0;
- }
-
- public float getLayoutAlignmentY ( Container parent )
- {
- return 0;
- }
-
- public void invalidateLayout ( Container parent )
- {
- }
-
- public Dimension maximumLayoutSize ( Container parent )
- {
- return preferredLayoutSize(parent);
- }
+ /**
+ * Lays out the specified container using this layout.
+ *
+ * @param parent The container that needs to be laid out.
+ */
+ public void layoutContainer(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+
+ grid.layoutContainer(parent);
+ }
+
+ /**
+ * Adds a component to the layout.
+ *
+ * @param child The component to add to the layout.
+ * @param constraints The constraints for the component in the layout.
+ */
+ public void addLayoutComponent(Component child, Object constraints)
+ {
+ addLayoutComponent("", child);
+ }
+
+ /**
+ * Returns the alignment along the X axis for the container.
+ *
+ * @param parent The container that needs to be laid out.
+ *
+ * @return The alignment.
+ */
+ public float getLayoutAlignmentX(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+
+ return 0;
+ }
+
+ /**
+ * Returns the alignment along the Y axis for the container.
+ *
+ * @param parent The container that needs to be laid out.
+ *
+ * @return The alignment.
+ */
+ public float getLayoutAlignmentY(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+
+ return 0;
+ }
+
+ /**
+ * Invalidates the layout.
+ *
+ * @param parent The container that needs to be laid out.
+ */
+ public void invalidateLayout(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+ }
+
+ /**
+ * Returns the maximum size of the layout gived the components
+ * in the given container.
+ *
+ * @param parent The container that needs to be laid out.
+ *
+ * @return The dimension of the layout.
+ */
+ public Dimension maximumLayoutSize(Container parent)
+ {
+ if (parent != container)
+ throw new AWTError("invalid parent");
+
+ return preferredLayoutSize(parent);
+ }
}
diff --git a/libjava/javax/swing/JFrame.java b/libjava/javax/swing/JFrame.java
index 9f4436ffb07..cc93a87b6de 100644
--- a/libjava/javax/swing/JFrame.java
+++ b/libjava/javax/swing/JFrame.java
@@ -149,7 +149,7 @@ public class JFrame extends Frame
JRootPane createRootPane()
{ return new JRootPane(); }
- Container getContentPane()
+ public Container getContentPane()
{ return getRootPane().getContentPane(); }
void setContentPane(Container contentPane)
diff --git a/libjava/javax/swing/JLayeredPane.java b/libjava/javax/swing/JLayeredPane.java
index 69217804ac1..68512a6a8db 100644
--- a/libjava/javax/swing/JLayeredPane.java
+++ b/libjava/javax/swing/JLayeredPane.java
@@ -39,22 +39,353 @@ exception statement from your version. */
package javax.swing;
import java.awt.Component;
+import java.util.*;
+import java.awt.Component;
import javax.accessibility.Accessible;
+
+/**
+ * The "Layered Pane" is a container which divides its children into 6 (or
+ * more) disjoint sets. the pre-defined sets are:
+ *
+ * "Frame Content", "Default", "Palette", "Modal", "Popup", and "Drag".
+ *
+ * A child is in exactly one of these layers at any time, though there may
+ * be other layers if someone creates them.
+ *
+ * The purpose of this class is to translate this view of "layers" into a
+ * contiguous array of components: the one held in our ancestor,
+ * java.awt.Container.
+ *
+ * There is a precise set of words we will use to refer to numbers within
+ * this class:
+ *
+ * Internal Component Index: an offset into the "component" array held in
+ * our ancestor, java.awt.Container, from [0 .. component.length). The
+ * drawing rule with internal indices is that 0 is drawn first.
+ *
+ * External Component Index: an offset into the "logical drawing order" of
+ * this container. If I is the internal index of a component, the external
+ * index E = component.length - I. The rule with external indices is that 0
+ * is drawn last.
+ *
+ * Layer Number: a general int specifying a layer within this component.
+ * Negative numbers are drawn first, then layer 0, then positive numbered
+ * layers, in ascending order.
+ *
+ * Position: an offset into a layer's "logical drawing order". Layer
+ * position 0 is drawn last. Layer position -1 is a synonym for the first
+ * layer position (the logical "bottom").
+ */
+
public class JLayeredPane extends JComponent implements Accessible
{
+
+ public static String LAYER_PROPERTY = "LAYER_PROPERTY";
+
+ public static Integer FRAME_CONTENT_LAYER = new Integer (-30000);
+
+ public static Integer DEFAULT_LAYER = new Integer (0);
+ public static Integer PALETTE_LAYER = new Integer (100);
+ public static Integer MODAL_LAYER = new Integer (200);
+ public static Integer POPUP_LAYER = new Integer (300);
+ public static Integer DRAG_LAYER = new Integer (400);
+
+ TreeMap layers; // Layer Number (Integer) -> Layer Size (Integer)
+ Hashtable componentToLayer; // Component -> Layer Number (Integer)
+
+ protected Integer getLayer (Component c)
+ {
+ if (! componentToLayer.containsKey (c))
+ throw new IllegalArgumentException ();
+ return (Integer) componentToLayer.get (c);
+ }
+
+ // this returns a half-open range [bottom, top), which is the range of
+ // internal component indices this layer number corresponds to. note
+ // that top is *not* included in the range of component indices in this
+ // layer: a layer with 0 elements in it has ret[0] == ret[1].
+
+ protected int[] layerToRange (Integer layer)
+ {
+ int[] ret = new int[2];
+ Iterator i = layers.entrySet ().iterator ();
+ while (i.hasNext())
+ {
+ Map.Entry pair = (Map.Entry) i.next();
+ Integer layerNum = (Integer) pair.getKey ();
+ Integer layerSz = (Integer) pair.getValue ();
+ if (layerNum == layer)
+ {
+ ret[1] = ret[0] + layerSz.intValue ();
+ return ret;
+ }
+ else
+ {
+ ret[0] += layerSz.intValue ();
+ }
+ }
+ // should have found the layer during iteration
+ throw new IllegalArgumentException ();
+ }
+
+ protected void incrLayer(Integer layer)
+ {
+ int sz = 1;
+ if (layers.containsKey (layer))
+ sz += ((Integer)(layers.get (layer))).intValue ();
+ layers.put (layer, new Integer(sz));
+ }
+
+ protected void decrLayer(Integer layer)
+ {
+ int sz = 0;
+ if (layers.containsKey (layer))
+ sz = ((Integer)(layers.get (layer))).intValue () - 1;
+ layers.put (layer, new Integer(sz));
+ }
+
JLayeredPane()
{
+ layers = new TreeMap ();
+ layers.put (FRAME_CONTENT_LAYER, new Integer (0));
+ layers.put (DEFAULT_LAYER, new Integer (0));
+ layers.put (PALETTE_LAYER, new Integer (0));
+ layers.put (MODAL_LAYER, new Integer (0));
+ layers.put (POPUP_LAYER, new Integer (0));
+ layers.put (DRAG_LAYER, new Integer (0));
+
+ componentToLayer = new Hashtable ();
+ }
+
+ public int highestLayer()
+ {
+ if (layers.size() == 0)
+ return 0;
+ return ((Integer)(layers.lastKey ())).intValue ();
+ }
+
+ public int lowestLayer()
+ {
+ if (layers.size() == 0)
+ return 0;
+ return ((Integer)(layers.firstKey ())).intValue ();
+ }
+
+ public void moveToFront(Component c)
+ {
+ setPosition (c, 0);
}
+ public void moveToBack(Component c)
+ {
+ setPosition (c, -1);
+ }
- protected void addImpl(Component comp, Object constraints, int index)
- {
- super.addImpl(comp, constraints, index);
+ public int getPosition(Component c)
+ {
+ Integer layer = getLayer (c);
+ int[] range = layerToRange (layer);
+ int top = (range[1] - 1);
+ Component[] comps = getComponents ();
+ for (int i = range[0]; i < range[1]; ++i)
+ {
+ if (comps[i] == c)
+ return top - i;
+ }
+ // should have found it
+ throw new IllegalArgumentException ();
+ }
+
+ public void setPosition(Component c, int position)
+ {
+ Integer layer = getLayer (c);
+ int[] range = layerToRange (layer);
+ if (range[0] == range[1])
+ throw new IllegalArgumentException ();
+
+ int top = (range[1] - 1);
+ if (position == -1)
+ position = top - range[0];
+ int targ = top - position;
+ int curr = -1;
+
+ Component[] comps = getComponents();
+ for (int i = range[0]; i < range[1]; ++i)
+ {
+ if (comps[i] == c)
+ {
+ curr = i;
+ break;
+ }
+ }
+ if (curr == -1)
+ // should have found it
+ throw new IllegalArgumentException ();
+
+ // System.err.println("set component position to " + position + " in layer " + layer);
+
+ Component tmp = comps[curr];
+ super.remove (curr);
+ super.add (tmp, targ);
+ super.validate ();
+ }
+
+
+
+ public Component[] getComponentsInLayer(int layer)
+ {
+ int[] range = layerToRange (getObjectForLayer (layer));
+ if (range[0] == range[1])
+ return new Component[0];
+ else
+ {
+ Component[] comps = getComponents ();
+ int sz = (range[1] - 1) - range[0];
+ Component[] nc = new Component[sz];
+ for (int i = 0; i < sz; ++i)
+ nc[i] = comps[range[0] + i];
+ return nc;
+ }
+ }
+
+ public int getComponentCountInLayer(int layer)
+ {
+ int[] range = layerToRange (getObjectForLayer (layer));
+ if (range[0] == range[1])
+ return 0;
+ else
+ return ((range[1] - 1) - range[0]);
+ }
+
+ protected Hashtable getComponentToLayer()
+ {
+ return componentToLayer;
+ }
+
+ protected int getInternalIndexOf(Component c)
+ {
+ Integer layer = getLayer (c);
+ int[] range = layerToRange (layer);
+ Component[] comps = getComponents();
+ for (int i = range[0]; i < range[1]; ++i)
+ {
+ if (comps[i] == c)
+ return i;
+ }
+ // should have found the component during iteration
+ throw new IllegalArgumentException ();
+ }
+
+
+ public int getIndexOf(Component c)
+ {
+ // returns the *external* index of the component.
+ int top = getComponentCount() - 1;
+ return top - getIndexOf (c);
+ }
+
+
+ protected Integer getObjectForLayer(int layer)
+ {
+ switch (layer)
+ {
+ case -30000:
+ return FRAME_CONTENT_LAYER;
+
+ case 0:
+ return DEFAULT_LAYER;
+
+ case 100:
+ return PALETTE_LAYER;
+
+ case 200:
+ return MODAL_LAYER;
+
+ case 300:
+ return POPUP_LAYER;
+
+ case 400:
+ return DRAG_LAYER;
+
+ default:
+ break;
+ }
+
+ return new Integer(layer);
+ }
+
+ protected int insertIndexForLayer(int layer, int position)
+ {
+ int[] range = layerToRange (getObjectForLayer (layer));
+ if (range[0] == range[1])
+ return range[0];
- comp.validate();
- comp.repaint();
+ int bottom = range[0];
+ int top = range[1] - 1;
+
+ if (position == -1 || position > (top - bottom))
+ return bottom;
+ else
+ return top - position;
}
-
+ public void remove (int index)
+ {
+ Component c = getComponent (index);
+ Integer layer = getLayer (c);
+ decrLayer (layer);
+ componentToLayer.remove (c);
+ super.remove (index);
+ }
+
+ public void remove (Component comp)
+ {
+ Integer layer = getLayer (comp);
+ decrLayer (layer);
+ componentToLayer.remove (comp);
+ super.remove (comp);
+ }
+
+ public void removeAll ()
+ {
+ componentToLayer.clear ();
+ layers.clear ();
+ super.removeAll ();
+ }
+
+ public void setLayer(Component c, int layer)
+ {
+ componentToLayer.put (c, getObjectForLayer (layer));
+ }
+
+ public void setLayer(Component c,
+ int layer,
+ int position)
+ {
+ componentToLayer.put (c, getObjectForLayer (layer));
+ setPosition(c, position);
+ repaint();
+ }
+
+ protected void addImpl(Component comp, Object layerConstraint, int index)
+ {
+ Integer layer;
+ if (layerConstraint != null && layerConstraint instanceof Integer)
+ layer = (Integer) layerConstraint;
+ else if (componentToLayer.containsKey (comp))
+ layer = (Integer) componentToLayer.remove (comp);
+ else
+ layer = DEFAULT_LAYER;
+
+ int newIdx = insertIndexForLayer(layer.intValue (), -1);
+ componentToLayer.put (comp, layer);
+ incrLayer (layer);
+
+ // System.err.println("adding component to layer " + layer);
+
+ super.addImpl(comp, null, newIdx);
+ validate();
+ repaint();
+ }
}
diff --git a/libjava/javax/swing/JRootPane.java b/libjava/javax/swing/JRootPane.java
index f0121b8ce92..ccab07c13b1 100644
--- a/libjava/javax/swing/JRootPane.java
+++ b/libjava/javax/swing/JRootPane.java
@@ -119,7 +119,7 @@ public class JRootPane extends JComponent
public void setContentPane(Container p)
{
contentPane = p;
- getLayeredPane().add(contentPane, 0);
+ getLayeredPane().add(contentPane, JLayeredPane.FRAME_CONTENT_LAYER);
}
protected void addImpl(Component comp,
diff --git a/libjava/javax/swing/UIDefaults.java b/libjava/javax/swing/UIDefaults.java
index 33c184b83d9..9b91d10f55b 100644
--- a/libjava/javax/swing/UIDefaults.java
+++ b/libjava/javax/swing/UIDefaults.java
@@ -41,9 +41,20 @@ import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.Insets;
+import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
+import java.lang.reflect.Method;
+import java.lang.reflect.Constructor;
import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.LinkedList;
import java.util.Locale;
+import java.util.Set;
+import java.util.HashSet;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI;
@@ -56,6 +67,11 @@ import javax.swing.plaf.ComponentUI;
*/
public class UIDefaults extends Hashtable
{
+
+ LinkedList bundles;
+ Set listeners;
+ Locale defaultLocale;
+
interface ActiveValue
{
Object createValue(UIDefaults table);
@@ -63,12 +79,20 @@ public class UIDefaults extends Hashtable
public static class LazyInputMap implements LazyValue
{
+ Object[] bind;
public LazyInputMap(Object[] bindings)
{
+ bind = bindings;
}
public Object createValue(UIDefaults table)
{
- throw new Error("not implemented");
+ InputMap im = new InputMap ();
+ for (int i = 0; 2*i+1 < bind.length; ++i)
+ {
+ im.put (KeyStroke.getKeyStroke ((String) bind[2*i]),
+ bind[2*i+1]);
+ }
+ return im;
}
} // class LazyInputMap
@@ -79,25 +103,112 @@ public class UIDefaults extends Hashtable
public static class ProxyLazyValue implements LazyValue
{
+ LazyValue inner;
public ProxyLazyValue(String s)
{
- throw new Error("not implemented");
+ final String className = s;
+ inner = new LazyValue ()
+ {
+ public Object createValue (UIDefaults table)
+ {
+ try
+ {
+ return Class
+ .forName (className)
+ .getConstructor (new Class[] {})
+ .newInstance (new Object[] {});
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+ };
}
+
public ProxyLazyValue(String c, String m)
{
- throw new Error("not implemented");
+ final String className = c;
+ final String methodName = m;
+ inner = new LazyValue ()
+ {
+ public Object createValue (UIDefaults table)
+ {
+ try
+ {
+ return Class
+ .forName (className)
+ .getMethod (methodName, new Class[] {})
+ .invoke (null, new Object[] {});
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+ };
}
- public ProxyLazyValue(String c, Object[] o)
+
+ public ProxyLazyValue (String c, Object[] os)
{
- throw new Error("not implemented");
+ final String className = c;
+ final Object[] objs = os;
+ final Class[] clss = new Class[objs.length];
+ for (int i = 0; i < objs.length; ++i)
+ {
+ clss[i] = objs[i].getClass ();
+ }
+ inner = new LazyValue ()
+ {
+ public Object createValue (UIDefaults table)
+ {
+ try
+ {
+ return Class
+ .forName (className)
+ .getConstructor (clss)
+ .newInstance (objs);
}
- public ProxyLazyValue(String c, String m, Object[] o)
+ catch (Exception e)
{
- throw new Error("not implemented");
+ return null;
+ }
+ }
+ };
}
+
+ public ProxyLazyValue (String c, String m, Object[] os)
+ {
+ final String className = c;
+ final String methodName = m;
+ final Object[] objs = os;
+ final Class[] clss = new Class[objs.length];
+ for (int i = 0; i < objs.length; ++i)
+ {
+ clss[i] = objs[i].getClass ();
+ }
+ inner = new LazyValue ()
+ {
public Object createValue(UIDefaults table)
{
- throw new Error("not implemented");
+ try
+ {
+ return Class
+ .forName (className)
+ .getMethod (methodName, clss)
+ .invoke (null, objs);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
+ }
+ };
+ }
+
+ public Object createValue (UIDefaults table)
+ {
+ return inner.createValue (table);
}
} // class ProxyLazyValue
@@ -105,32 +216,97 @@ public class UIDefaults extends Hashtable
public UIDefaults()
{
+ bundles = new LinkedList ();
+ listeners = new HashSet ();
+ defaultLocale = Locale.getDefault ();
}
public UIDefaults(Object[] entries)
{
- // XXX
- }
+ bundles = new LinkedList ();
+ listeners = new HashSet ();
+ defaultLocale = Locale.getDefault ();
- public Object get(Object key)
- {
- // XXX Obey 1.4 specs
- return super.get(key);
+ for (int i = 0; (2*i+1) < entries.length; ++i)
+ {
+ put (entries[2*i], entries[2*i+1]);
+ }
}
- public Object get(Object key, Locale l)
+ public Object get(Object key)
{
- throw new Error("not implemented");
+ return this.get (key, getDefaultLocale ());
+ }
+
+ public Object get (Object key, Locale loc)
+ {
+ Object obj = null;
+
+ if (super.containsKey (key))
+ {
+ obj = super.get (key);
+ }
+ else if (key instanceof String)
+ {
+ String keyString = (String) key;
+ ListIterator i = bundles.listIterator (0);
+ while (i.hasNext ())
+ {
+ String bundle_name = (String) i.next ();
+ ResourceBundle res =
+ ResourceBundle.getBundle (bundle_name, loc);
+ if (res != null)
+ {
+ try
+ {
+ obj = res.getObject (keyString);
+ break;
+ }
+ catch (MissingResourceException me)
+ {
+ // continue, this bundle has no such key
+ }
+ }
+ }
+ }
+
+ // now we've found the object, resolve it.
+ // nb: LazyValues aren't supported in resource bundles, so it's correct
+ // to insert their results in the locale-less hashtable.
+
+ if (obj == null)
+ return null;
+
+ if (obj instanceof LazyValue)
+ {
+ Object resolved = ((LazyValue)obj).createValue (this);
+ super.remove (key);
+ super.put (key, resolved);
+ return resolved;
+ }
+ else if (obj instanceof ActiveValue)
+ {
+ return ((ActiveValue)obj).createValue (this);
+ }
+
+ return obj;
}
public Object put(Object key, Object value)
{
- throw new Error("not implemented");
+ Object old = super.put (key, value);
+ if (key instanceof String && old != value)
+ firePropertyChange ((String) key, old, value);
+ return old;
}
- public void putDefaults(Object[] list)
+ public void putDefaults(Object[] entries)
+ {
+ for (int i = 0; (2*i+1) < entries.length; ++i)
{
- throw new Error("not implemented");
+ super.put (entries[2*i], entries[2*i+1]);
+ }
+ firePropertyChange ("UIDefaults", null, null);
}
public Font getFont(Object key)
@@ -241,65 +417,114 @@ public class UIDefaults extends Hashtable
public Class getUIClass(String id, ClassLoader loader)
{
- throw new Error("not implemented");
+ String className = (String) get (id);
+ if (className == null)
+ return null;
+ try
+ {
+ if (loader != null)
+ return loader.loadClass (className);
+ return Class.forName (className);
+ }
+ catch (Exception e)
+ {
+ return null;
+ }
}
public Class getUIClass(String id)
{
- throw new Error("not implemented");
+ return getUIClass (id, null);
}
protected void getUIError(String msg)
{
- // Does nothing unless overridden.
+ System.err.println ("UIDefaults.getUIError: " + msg);
+ }
+
+ public ComponentUI getUI(JComponent target)
+ {
+ String classId = target.getUIClassID ();
+ Class cls = getUIClass (classId);
+ if (cls == null)
+ {
+ getUIError ("failed to locate UI class:" + classId);
+ return null;
+ }
+
+ Method factory;
+
+ try
+ {
+ factory = cls.getMethod ("createUI", new Class[] { JComponent.class } );
+ }
+ catch (NoSuchMethodException nme)
+ {
+ getUIError ("failed to locate createUI method on " + cls.toString ());
+ return null;
+ }
+
+ try
+ {
+ return (ComponentUI) factory.invoke (null, new Object[] { target });
}
+ catch (java.lang.reflect.InvocationTargetException ite)
+ {
+ getUIError ("InvocationTargetException ("+ ite.getTargetException()
+ +") calling createUI(...) on " + cls.toString ());
+ return null;
- public ComponentUI getUI(JComponent a)
+ }
+ catch (Exception e)
{
- String pp = a.getUIClassID();
- ComponentUI p = (ComponentUI) get(pp);
- if (p == null)
- getUIError("failed to locate UI:" + pp);
- return p;
+ getUIError ("exception calling createUI(...) on " + cls.toString ());
+ return null;
+ }
}
- void addPropertyChangeListener(PropertyChangeListener l)
+ void addPropertyChangeListener(PropertyChangeListener listener)
{
- throw new Error("not implemented");
+ listeners.add (listener);
}
- void removePropertyChangeListener(PropertyChangeListener l)
+ void removePropertyChangeListener(PropertyChangeListener listener)
{
- throw new Error("not implemented");
+ listeners.remove (listener);
}
public PropertyChangeListener[] getPropertyChangeListeners()
{
- throw new Error("not implemented");
+ return (PropertyChangeListener[]) listeners.toArray ();
}
protected void firePropertyChange(String property, Object o, Object n)
{
- throw new Error("not implemented");
+ Iterator i = listeners.iterator ();
+ PropertyChangeEvent pce = new PropertyChangeEvent (this, property, o, n);
+ while (i.hasNext ())
+ {
+ PropertyChangeListener pcl = (PropertyChangeListener) i.next ();
+ pcl.propertyChange (pce);
+ }
}
void addResourceBundle(String name)
{
- throw new Error("not implemented");
+ bundles.addFirst (name);
}
void removeResourceBundle(String name)
{
- throw new Error("not implemented");
+ bundles.remove (name);
}
- void setDefaultLocale(Locale l)
+ void setDefaultLocale(Locale loc)
{
- throw new Error("not implemented");
+ defaultLocale = loc;
}
public Locale getDefaultLocale()
{
- throw new Error("not implemented");
+ return defaultLocale;
}
} // class UIDefaults
diff --git a/libjava/javax/swing/UIManager.java b/libjava/javax/swing/UIManager.java
index 7defebd2b09..81e8ea54e59 100644
--- a/libjava/javax/swing/UIManager.java
+++ b/libjava/javax/swing/UIManager.java
@@ -1,5 +1,5 @@
/* UIManager.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -168,7 +168,7 @@ public class UIManager implements Serializable
/**
* Returns the default values for this look and feel.
*/
- static UIDefaults getDefaults()
+ public static UIDefaults getDefaults()
{
return getLookAndFeel().getDefaults();
}
@@ -176,7 +176,7 @@ public class UIManager implements Serializable
/**
* Returns a dimension from the defaults table.
*/
- static Dimension getDimension(Object key)
+ public static Dimension getDimension(Object key)
{
System.out.println("UIManager.getDim");
return new Dimension(200,100);
@@ -195,24 +195,24 @@ public class UIManager implements Serializable
return (Font) getLookAndFeel().getDefaults().get(key);
}
- static Icon getIcon(Object key)
+ public static Icon getIcon(Object key)
// Returns an Icon from the defaults table.
{
return (Icon) getLookAndFeel().getDefaults().get(key);
}
- static Insets getInsets(Object key)
+ public static Insets getInsets(Object key)
// Returns an Insets object from the defaults table.
{
return (Insets) getLookAndFeel().getDefaults().getInsets(key);
}
- static LookAndFeelInfo[] getInstalledLookAndFeels()
+ public static LookAndFeelInfo[] getInstalledLookAndFeels()
{
return installed;
}
- static int getInt(Object key)
+ public static int getInt(Object key)
{
Integer x = (Integer) getLookAndFeel().getDefaults().get(key);
if (x == null)
@@ -220,7 +220,7 @@ public class UIManager implements Serializable
return x.intValue();
}
- static LookAndFeel getLookAndFeel()
+ public static LookAndFeel getLookAndFeel()
{
return look_and_feel;
}
@@ -234,13 +234,13 @@ public class UIManager implements Serializable
return getLookAndFeel().getDefaults();
}
- static String getString(Object key)
+ public static String getString(Object key)
// Returns a string from the defaults table.
{
return (String) getLookAndFeel().getDefaults().get(key);
}
- static String getSystemLookAndFeelClassName()
+ public static String getSystemLookAndFeelClassName()
// Returns the name of the LookAndFeel class that implements the native systems look and feel if there is one, otherwise the name of the default cross platform LookAndFeel class.
{
return getCrossPlatformLookAndFeelClassName();
diff --git a/libjava/javax/swing/plaf/basic/BasicDefaults.java b/libjava/javax/swing/plaf/basic/BasicDefaults.java
index 046a7316c93..6b06187b451 100644
--- a/libjava/javax/swing/plaf/basic/BasicDefaults.java
+++ b/libjava/javax/swing/plaf/basic/BasicDefaults.java
@@ -95,27 +95,30 @@ public class BasicDefaults extends UIDefaults
public BasicDefaults()
{
// System.out.println("BasicDefaults !!!!!!!!!!!!!!!!!!!!!!!!!");
- put("JButton", new BasicButtonUI());
- put("JLabel", new BasicLabelUI());
+ put("JButton", "javax.swing.plaf.basic.BasicButtonUI");
+ put("JLabel", "javax.swing.plaf.basic.BasicLabelUI");
- put("JPanel", new BasicPanelUI());
- put("JCheckBox", new BasicCheckBoxUI());
- put("JRadioButton", new BasicRadioButtonUI());
- put("JToggleButton", new BasicToggleButtonUI());
- put("JOptionPane", new BasicOptionPaneUI());
- put("JList", new BasicListUI());
- put("JTree", new BasicTreeUI());
- put("JTextComponent", new BasicTextUI());
- put("JTabbedPane", new BasicTabbedPaneUI());
- put("JScrollPane", new BasicScrollPaneUI());
- put("JViewport", new BasicViewportUI());
-
- put("JButton.border", new BasicBorder());
- put("JPanel.border", new PanelBorder());
-
- put("JToggleButton.border", new PanelBorder());
- put("JCheckBox.border", new PanelBorder());
- put("JRadioButton.border", new PanelBorder());
+ put("JPanel", "javax.swing.plaf.basic.BasicPanelUI");
+ put("JCheckBox", "javax.swing.plaf.basic.BasicCheckBoxUI");
+ put("JRadioButton", "javax.swing.plaf.basic.BasicRadioButtonUI");
+ put("JToggleButton", "javax.swing.plaf.basic.BasicToggleButtonUI");
+ put("JOptionPane", "javax.swing.plaf.basic.BasicOptionPaneUI");
+ put("JList", "javax.swing.plaf.basic.BasicListUI");
+ put("JTree", "javax.swing.plaf.basic.BasicTreeUI");
+ put("JTextComponent", "javax.swing.plaf.basic.BasicTextUI");
+ put("JTabbedPane", "javax.swing.plaf.basic.BasicTabbedPaneUI");
+ put("JScrollPane", "javax.swing.plaf.basic.BasicScrollPaneUI");
+ put("JViewport", "javax.swing.plaf.basic.BasicViewportUI");
+
+ put("JButton.border", "javax.swing.plaf.basic.BasicBorder");
+ put("JPanel.border", "javax.swing.plaf.basic.PanelBorder");
+
+ put("JToggleButton.border", "javax.swing.plaf.basic.PanelBorder");
+ put("JCheckBox.border", "javax.swing.plaf.basic.PanelBorder");
+ put("JRadioButton.border", "javax.swing.plaf.basic.PanelBorder");
+
+ put("AbstractUndoableEdit.undoText", "Undo");
+ put("AbstractUndoableEdit.redoText", "Redo");
}
}
diff --git a/libjava/javax/swing/undo/AbstractUndoableEdit.java b/libjava/javax/swing/undo/AbstractUndoableEdit.java
index d845e4341bb..e694c0a447f 100644
--- a/libjava/javax/swing/undo/AbstractUndoableEdit.java
+++ b/libjava/javax/swing/undo/AbstractUndoableEdit.java
@@ -1,4 +1,4 @@
-/* AbstractTableModel.java --
+/* AbstractUndoableEdit.java
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -39,180 +39,285 @@ exception statement from your version. */
package javax.swing.undo;
import java.io.Serializable;
+import javax.swing.UIManager;
+
/**
- * AbstractUndoableEdit
- * @author Andrew Selkirk
+ * A default implementation of <code>UndoableEdit</code> that can be
+ * used as a base for implementing editing operations.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class AbstractUndoableEdit implements UndoableEdit, Serializable
+public class AbstractUndoableEdit
+ implements UndoableEdit, Serializable
{
+ /**
+ * The serialization ID. Verified using the <code>serialver</code>
+ * tool of Apple/Sun JDK 1.3.1 on MacOS X 10.1.5, and Sun JDK
+ * 1.4.1_01 on GNU/Linux.
+ */
static final long serialVersionUID = 580150227676302096L;
- //-------------------------------------------------------------
- // Constants --------------------------------------------------
- //-------------------------------------------------------------
/**
- * String returned by getRedoPresentationName()
+ * The constant string &#x201c;Undo&#x201d;, which was returned by
+ * {@link #getUndoPresentationName()} on early versions of the
+ * platform. However, this field has become obsolete with version
+ * 1.3.1. That method now retrieves a localized string from the
+ * {@link javax.swing.UIManager}, using the key
+ * <code>&#x201c;AbstractUndoableEdit.undoText&#x201d;</code>.
*/
- protected static final String RedoName = "Redo";
+ protected static final String UndoName = "Undo";
+
/**
- * String returned by getUndoPresentationName()
+ * The constant string &#x201c;Redo&#x201d;, which was returned by
+ * {@link #getRedoPresentationName()} on early versions of the
+ * platform. However, this field has become obsolete with version
+ * 1.3.1. That method now retrieves a localized string from the
+ * {@link javax.swing.UIManager}, using the key
+ * <code>&#x201c;AbstractUndoableEdit.redoText&#x201d;</code>.
*/
- protected static final String UndoName = "Undo";
-
+ protected static final String RedoName = "Redo";
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
/**
- * TODO
+ * Indicates whether this editing action has been executed. A value
+ * of <code>true</code> means that the action was performed, or that
+ * a redo operation was successful. A value of <code>false</code>
+ * means that the action has not yet performed, or that an undo
+ * operation was successful.
*/
- private boolean hasBeenDone = false;
+ private boolean hasBeenDone;
+
/**
- * The edit is alive
+ * Indicates whether this editing action is still alive. The value
+ * is set to <code>true</code> by the constructor, and to
+ * <code>false</code> by the {@link #die()} method.
*/
- private boolean alive = true;
+ private boolean alive;
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
- * Create new AbstractUndoableEdit
+ * Constructs a new <code>AbstractUndoableEdit</code>. The initial
+ * state is that the editing action is alive, and
+ * <code>hasBeenDone</code> is <code>true</code>.
*/
public AbstractUndoableEdit()
{
- } // AbstractUndoableEdit()
-
+ // The API specification is not clear, but Mauve test code has
+ // determined that hasBeenDone is initially set to true.
+ alive = hasBeenDone = true;
+ }
- //-------------------------------------------------------------
- // Interface: UndoableEdit ------------------------------------
- //-------------------------------------------------------------
/**
- * addEdit
- * @param anEdit TODO
- * @returns TODO
+ * Undoes this editing action.
+ *
+ * @throws CannotUndoException if {@link #canUndo()} returns
+ * <code>false</code>, for example because this action has already
+ * been undone.
+ *
+ * @see #canUndo()
+ * @see #redo()
*/
- public boolean addEdit(UndoableEdit anEdit)
+ public void undo()
+ throws CannotUndoException
{
- return false;
- } // addEdit()
-
+ if (!canUndo())
+ throw new CannotUndoException();
+ hasBeenDone = false;
+ }
+
+
/**
- * canRedo()
- * @returns true if redoable, false otherwise
+ * Determines whether it would be possible to undo this editing
+ * action.
+ *
+ * @return <code>true</code> to indicate that this action can be
+ * undone, <code>false</code> otherwise.
+ *
+ * @see #undo()
+ * @see #canRedo()
*/
- public boolean canRedo()
+ public boolean canUndo()
{
- if (alive == true && hasBeenDone == false)
- return true;
- return false;
- } // canRedo()
-
+ return alive && hasBeenDone;
+ }
+
+
/**
- * canUndo()
- * @returns true if undoable, false otherwise
+ * Redoes this editing action.
+ *
+ * @throws CannotRedoException if {@link #canRedo()} returns
+ * <code>false</code>, for example because this action has not
+ * yet been undone.
+ *
+ * @see #canRedo()
+ * @see #undo()
*/
- public boolean canUndo()
+ public void redo()
+ throws CannotRedoException
{
- if (alive == true && hasBeenDone == true)
- return true;
- return false;
- } // canUndo()
-
+ if (!canRedo())
+ throw new CannotRedoException();
+ hasBeenDone = true;
+ }
+
+
/**
- * die
+ * Determines whether it would be possible to redo this editing
+ * action.
+ *
+ * @return <code>true</code> to indicate that this action can be
+ * redone, <code>false</code> otherwise.
+ *
+ * @see #redo()
+ * @see #canUndo()
*/
- public void die()
+ public boolean canRedo()
{
- alive = false;
- } // die()
+ return alive && !hasBeenDone;
+ }
+
/**
- * getPresentation
- * @returns TODO
+ * Informs this edit action that it will no longer be used. Some
+ * actions might use this information to release resources, for
+ * example open files. Called by {@link UndoManager} before this
+ * action is removed from the edit queue.
*/
- public String getPresentationName()
+ public void die()
{
- return "";
- } // getPresentationName()
+ alive = false;
+ }
+
/**
- * getRedoPresentationName
- * @returns TODO
+ * Incorporates another editing action into this one, thus forming a
+ * combined action.
+ *
+ * <p>The default implementation always returns <code>false</code>,
+ * indicating that the editing action could not be incorporated.
+ *
+ * @param edit the editing action to be incorporated.
*/
- public String getRedoPresentationName()
+ public boolean addEdit(UndoableEdit edit)
{
- if (getPresentationName().equals(""))
- return RedoName;
- return RedoName + " " + getPresentationName();
- } // getRedoPresentationName()
-
+ return false;
+ }
+
+
/**
- * getUndoPresentationName
- * @returns TODO
+ * Incorporates another editing action into this one, thus forming a
+ * combined action that replaces the argument action.
+ *
+ * <p>The default implementation always returns <code>false</code>,
+ * indicating that the argument action should not be replaced.
+ *
+ * @param edit the editing action to be replaced.
*/
- public String getUndoPresentationName()
+ public boolean replaceEdit(UndoableEdit edit)
{
- if (getPresentationName().equals(""))
- return UndoName;
- return UndoName + " " + getPresentationName();
- } // getUndoPresentationName()
-
+ return false;
+ }
+
+
/**
- * isSignificant
- * @returns true
+ * Determines whether this editing action is significant enough for
+ * being seperately undoable by the user. A typical significant
+ * action would be the resizing of an object. However, changing the
+ * selection in a text document would usually not be considered
+ * significant.
+ *
+ * <p>The default implementation returns <code>true</code>.
+ *
+ * @return <code>true</code> to indicate that the action is
+ * significant enough for being separately undoable, or
+ * <code>false</code> otherwise.
*/
public boolean isSignificant()
{
return true;
- } // isSignificant()
-
+ }
+
+
/**
- * redo
- * @throws CannotRedoException TODO
+ * Returns a human-readable, localized name that describes this
+ * editing action and can be displayed to the user.
+ *
+ * <p>The default implementation returns an empty string.
*/
- public void redo() throws CannotRedoException
+ public String getPresentationName()
{
- if (! canRedo())
- throw new CannotRedoException();
- hasBeenDone = true;
- } // redo()
+ return "";
+ }
+
/**
- * replaceEdit
- * @param anEdit TODO
- * @returns TODO
+ * Calculates a localized name for presenting the undo action to the
+ * user.
+ *
+ * <p>The default implementation returns the concatenation of the
+ * string &#x201c;Undo&#x201d; and the action name, which is
+ * determined by calling {@link #getPresentationName()}.
+ *
+ * <p>The string &#x201c;Undo&#x201d; is retrieved from the {@link
+ * javax.swing.UIManager}, using the key
+ * <code>&#x201c;AbstractUndoableEdit.undoText&#x201d;</code>. This
+ * allows the text to be localized.
*/
- public boolean replaceEdit(UndoableEdit anEdit)
+ public String getUndoPresentationName()
{
- return false;
- } // replaceEdit()
+ String msg, pres;
+
+ msg = UIManager.getString("AbstractUndoableEdit.undoText");
+ if (msg == null)
+ msg = UndoName;
+
+ pres = getPresentationName();
+ if ((pres == null) || (pres.length() == 0))
+ return msg;
+ else
+ return msg + ' ' + pres;
+ }
+
/**
- * String representation
- * @returns String representation
+ * Calculates a localized name for presenting the redo action to the
+ * user.
+ *
+ * <p>The default implementation returns the concatenation of the
+ * string &#x201c;Redo&#x201d; and the action name, which is
+ * determined by calling {@link #getPresentationName()}.
+ *
+ * <p>The string &#x201c;Redo&#x201d; is retrieved from the {@link
+ * javax.swing.UIManager}, using the key
+ * <code>&#x201c;AbstractUndoableEdit.redoText&#x201d;</code>. This
+ * allows the text to be localized.
*/
- public String toString()
+ public String getRedoPresentationName()
{
- return (super.toString() + " hasBeenDone: " + hasBeenDone
- + " alive: " + alive);
+ String msg, pres;
+
+ msg = UIManager.getString("AbstractUndoableEdit.redoText");
+ if (msg == null)
+ msg = RedoName;
+
+ pres = getPresentationName();
+ if ((pres == null) || (pres.length() == 0))
+ return msg;
+ else
+ return msg + ' ' + pres;
}
- /**
- * undo
- * @throws CannotUndoException TODO
- */
- public void undo() throws CannotUndoException
+
+ public String toString()
{
- if (! canUndo())
- throw new CannotUndoException();
- hasBeenDone = false;
- } // undo()
-} // AbstractUndoableEdit
+ return super.toString()
+ + " hasBeenDone: " + hasBeenDone
+ + " alive: " + alive;
+ }
+}
diff --git a/libjava/javax/swing/undo/CannotRedoException.java b/libjava/javax/swing/undo/CannotRedoException.java
index 030975d4f1d..f482b75bb97 100644
--- a/libjava/javax/swing/undo/CannotRedoException.java
+++ b/libjava/javax/swing/undo/CannotRedoException.java
@@ -1,5 +1,5 @@
-/* AbstractTableModel.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* CannotRedoException.java
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -38,17 +38,19 @@ exception statement from your version. */
package javax.swing.undo;
/**
- * CannotRedoException
- * @author Andrew Selkirk
+ * An exception which indicates that an editing action cannot be
+ * redone.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class CannotRedoException extends RuntimeException {
-
- /**
- * Create exception
- */
- public CannotRedoException() {
- super();
- } // CannotRedoException()
-
-
-} // CannotRedoException
+public class CannotRedoException
+ extends RuntimeException
+{
+ /**
+ * Constructs a new instance of a <code>CannotRedoException</code>.
+ */
+ public CannotRedoException()
+ {
+ }
+}
diff --git a/libjava/javax/swing/undo/CannotUndoException.java b/libjava/javax/swing/undo/CannotUndoException.java
index c039d1bbebd..0193921ed19 100644
--- a/libjava/javax/swing/undo/CannotUndoException.java
+++ b/libjava/javax/swing/undo/CannotUndoException.java
@@ -1,5 +1,5 @@
-/* AbstractTableModel.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* CannotUndoException.java
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,18 +37,21 @@ exception statement from your version. */
package javax.swing.undo;
+
/**
- * CannotUndoException
- * @author Andrew Selkirk
+ * An exception which indicates that an editing action cannot be
+ * undone.
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class CannotUndoException extends RuntimeException {
-
- /**
- * Create exception
- */
- public CannotUndoException() {
- super();
- } // CannotUndoException()
-
-
-} // CannotUndoException
+public class CannotUndoException
+ extends RuntimeException
+{
+ /**
+ * Constructs a new instance of a <code>CannotUndoException</code>.
+ */
+ public CannotUndoException()
+ {
+ }
+}
diff --git a/libjava/javax/swing/undo/CompoundEdit.java b/libjava/javax/swing/undo/CompoundEdit.java
index be612dad77b..12ff2bd36ec 100644
--- a/libjava/javax/swing/undo/CompoundEdit.java
+++ b/libjava/javax/swing/undo/CompoundEdit.java
@@ -1,5 +1,5 @@
-/* AbstractTableModel.java --
- Copyright (C) 2002 Free Software Foundation, Inc.
+/* CompoundEdit.java -- Combines multiple UndoableEdits.
+ Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -41,242 +41,352 @@ package javax.swing.undo;
import java.util.Vector;
/**
- * CompoundEdit
- * @author Andrew Selkirk
+ * An editing action that consists of multiple
+ * <code>UndoableEdits</code>.
+ *
+ * <p>The use of a <code>CompoundEdit</code> is divided in two separate
+ * phases.
+ *
+ * <ol><li>In the first phase, the <code>CompoundEdit</code> is
+ * initialized. After a new instance of <code>CompoundEdit</code> has
+ * been created, {@link #addEdit(UndoableEdit)} is called for each
+ * element of the compound. To terminate the initialization phase,
+ * call {@link #end()}.</li>
+ *
+ * <li>In the second phase, the the <code>CompoundEdit</code> can be
+ * used, typically by invoking {@link #undo()} and {@link
+ * #redo()}.</li></ol>
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class CompoundEdit extends AbstractUndoableEdit {
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * The collection of UndoableEdits undone/redone en
- * masse by this CompoundEdit
- */
- protected Vector edits = new Vector();
-
- /**
- * TODO
- */
- private boolean inProgress = false;
-
-
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
- /**
- * Create new Compound Edit
- */
- public CompoundEdit() {
- } // CompoundEdit()
-
-
- //-------------------------------------------------------------
- // Interface: UndoableEdit ------------------------------------
- //-------------------------------------------------------------
-
- /**
- * addEdit
- * @param anEdit TODO
- * @returns TODO
- */
- public boolean addEdit(UndoableEdit anEdit) {
-
- // Variables
- UndoableEdit lastEdit;
-
- if (inProgress == true) {
-
- // Get Last Edit
- lastEdit = lastEdit();
-
- // Check for null
- if (lastEdit != null) {
-
- if (lastEdit.addEdit(anEdit) == false) {
- if (lastEdit.replaceEdit(anEdit) == false) {
- edits.add(anEdit);
- }
- }
-
- } // if: lastEdit
-
- return true;
-
- } else {
- return false;
- }
- } // addEdit()
-
- /**
- * canRedo
- * @returns TODO
- */
- public boolean canRedo() {
- if (isInProgress() == true || super.canRedo() == false) {
- return false;
- }
- return true;
- } // canRedo()
-
- /**
- * canUndo
- * @returns TODO
- */
- public boolean canUndo() {
- if (isInProgress() == true || super.canUndo() == false) {
- return false;
- }
- return true;
- } // canUndo()
-
- /**
- * die
- */
- public void die() {
-
- // Variables
- int index;
- UndoableEdit current;
-
- // Loop through all contained UndoableEdits
- for (index = edits.size() - 1; index >= 0; index--) {
- current = (UndoableEdit) edits.elementAt(index);
- current.die();
- } // for: index
-
- } // die()
-
- /**
- * end
- */
- public void end() {
- inProgress = false;
- } // end()
-
- /**
- * getPresentationName
- * @returns TODO
- */
- public String getPresentationName() {
- if (edits.size() == 0) {
- return super.getPresentationName();
- } else {
- return lastEdit().getPresentationName();
- }
- } // getPresentationName()
-
- /**
- * getRedoPresentationName
- * @returns TODO
- */
- public String getRedoPresentationName() {
- if (edits.size() == 0) {
- return super.getRedoPresentationName();
- } else {
- return lastEdit().getRedoPresentationName();
- }
- } // getRedoPresentationName()
-
- /**
- * getUndoPresentationName
- * @returns TODO
- */
- public String getUndoPresentationName() {
- if (edits.size() == 0) {
- return super.getUndoPresentationName();
- } else {
- return lastEdit().getUndoPresentationName();
- }
- } // getUndoPresentationName()
-
- /**
- * isInProgress
- * @returns TODO
- */
- public boolean isInProgress() {
- return inProgress;
- } // isInProgress()
-
-
- /**
- * isSignigicant
- * @returns TODO
- */
- public boolean isSignificant() {
-
- // Variables
- int index;
- UndoableEdit current;
-
- // Check each edit
- for (index = 0; index < edits.size(); index++) {
- current = (UndoableEdit) edits.elementAt(index);
- if (current.isSignificant() == true) {
- return true;
- }
- } // for: index
-
- return false;
-
- } // isSignificant()
-
- /**
- * lastEdit
- * @returns TODO
- */
- protected UndoableEdit lastEdit() {
- if (edits.size() == 0) {
- return null;
- }
- return (UndoableEdit) edits.elementAt(edits.size() - 1);
- } // lastEdit()
-
- /**
- * redo
- * @throws CannotRedoException TODO
- */
- public void redo() throws CannotRedoException {
-
- // Variables
- int index;
- UndoableEdit current;
-
- // Loop through all contained UndoableEdits
- for (index = 0; index < edits.size(); index++) {
- current = (UndoableEdit) edits.elementAt(index);
- current.redo();
- } // for: index
-
- } // redo()
-
- /**
- * String representation
- * @returns String representation
- */
- public String toString() {
- return null; // TODO
- } // toString()
-
- /**
- * undo
- * @throws CannotUndoException TODO
- */
- public void undo() throws CannotUndoException {
-
- // Variables
- int index;
- UndoableEdit current;
-
- // Loop through all contained UndoableEdits
- for (index = edits.size() - 1; index >= 0; index--) {
- current = (UndoableEdit) edits.elementAt(index);
- current.undo();
- } // for: index
-
- } // undo()
-
-
-} // CompoundEdit
+public class CompoundEdit
+ extends AbstractUndoableEdit
+{
+ /**
+ * The <code>UndoableEdit</code>s being combined into a compound
+ * editing action.
+ */
+ protected Vector edits;
+
+
+ /**
+ * Indicates whether the creation of this CompoundEdit is still in
+ * progress. Initially, the value of this flag is
+ * <code>true</code>. The {@link #end()} method changes the flag to
+ * <code>false</code>.
+ */
+ private boolean inProgress;
+
+
+ /**
+ * Constructs a new CompoundEdit.
+ */
+ public CompoundEdit()
+ {
+ edits = new Vector();
+ inProgress = true;
+ }
+
+
+ /**
+ * Undoes all edits that are part of of this
+ * <code>CompoundEdit</code>. The compound elements will receive the
+ * <code>undo</code> message in the reverse order of addition.
+ *
+ * @throws CannotUndoException if {@link #canUndo()} returns
+ * <code>false</code>. This can happen if {@link #end()} has not
+ * been called on this <code>CompoundEdit</code>, or if this edit
+ * has already been undone.
+ *
+ * @see #canUndo()
+ * @see #redo()
+ */
+ public void undo()
+ throws CannotUndoException
+ {
+ // AbstractUndoableEdit.undo() will throw a CannotUndoException if
+ // canUndo returns false.
+ super.undo();
+
+ for (int i = edits.size() - 1; i >= 0; i--)
+ ((UndoableEdit) edits.elementAt(i)).undo();
+ }
+
+
+ /**
+ * Redoes all edits that are part of of this
+ * <code>CompoundEdit</code>. The compound elements will receive the
+ * <code>undo</code> message in the same order as they were added.
+ *
+ * @throws CannotRedoException if {@link #canRedo()} returns
+ * <code>false</code>. This can happen if {@link #end()} has not
+ * been called on this <code>CompoundEdit</code>, or if this edit
+ * has already been redone.
+ *
+ * @see #canRedo()
+ * @see #undo()
+ */
+ public void redo()
+ throws CannotRedoException
+ {
+ // AbstractUndoableEdit.redo() will throw a CannotRedoException if
+ // canRedo returns false.
+ super.redo();
+
+ for (int i = 0; i < edits.size(); i++)
+ ((UndoableEdit) edits.elementAt(i)).redo();
+ }
+
+
+ /**
+ * Returns the the <code>UndoableEdit</code> that was last added to
+ * this compound.
+ */
+ protected UndoableEdit lastEdit()
+ {
+ if (edits.size() == 0)
+ return null;
+ else
+ return (UndoableEdit) edits.elementAt(edits.size() - 1);
+ }
+
+
+ /**
+ * Informs this edit action, and all compound edits, that they will
+ * no longer be used. Some actions might use this information to
+ * release resources such as open files. Called by {@link
+ * UndoManager} before this action is removed from the edit queue.
+ *
+ * <p>The compound elements will receive the
+ * <code>die</code> message in the reverse order of addition.
+ */
+ public void die()
+ {
+ for (int i = edits.size() - 1; i >= 0; i--)
+ ((UndoableEdit) edits.elementAt(i)).die();
+
+ super.die();
+ }
+
+
+ /**
+ * Incorporates another editing action into this one, thus forming a
+ * combined edit.
+ *
+ * <p>If this edit&#x2019;s {@link #end()} method has been called
+ * before, <code>false</code> is returned immediately. Otherwise,
+ * the {@linkplain #lastEdit() last added edit} is given the
+ * opportunity to {@linkplain UndoableEdit#addEdit(UndoableEdit)
+ * incorporate} <code>edit</code>. If this fails, <code>edit</code>
+ * is given the opportunity to {@linkplain
+ * UndoableEdit#replaceEdit(UndoableEdit) replace} the last added
+ * edit. If this fails as well, <code>edit</code> gets added as a
+ * new compound to {@link #edits}.
+ *
+ * @param edit the editing action being added.
+ *
+ * @return <code>true</code> if <code>edit</code> could somehow be
+ * incorporated; <code>false</code> if <code>edit</code> has not
+ * been incorporated because {@link #end()} was called before.
+ */
+ public boolean addEdit(UndoableEdit edit)
+ {
+ UndoableEdit last;
+
+ // If end has been called before, do nothing.
+ if (!inProgress)
+ return false;
+
+ last = lastEdit();
+
+ // If edit is the very first edit, just add it to the list.
+ if (last == null)
+ {
+ edits.add(edit);
+ return true;
+ }
+
+ // Try to incorporate edit into last.
+ if (last.addEdit(edit))
+ return true;
+
+ // Try to replace last by edit.
+ if (edit.replaceEdit(last))
+ {
+ edits.set(edits.size() - 1, edit);
+ return true;
+ }
+
+ // If everything else has failed, add edit to the list of compound
+ // edits.
+ edits.add(edit);
+ return true;
+ }
+
+
+ /**
+ * Informs this <code>CompoundEdit</code> that its construction
+ * phase has been completed. After this method has been called,
+ * {@link #undo()} and {@link #redo()} may be called, {@link
+ * #isInProgress()} will return <code>false</code>, and all attempts
+ * to {@linkplain #addEdit(UndoableEdit) add further edits} will
+ * fail.
+ */
+ public void end()
+ {
+ inProgress = false;
+ }
+
+
+ /**
+ * Determines whether it would be possible to undo this editing
+ * action. The result will be <code>true</code> if {@link #end()}
+ * has been called on this <code>CompoundEdit</code>, {@link #die()}
+ * has not yet been called, and the edit has not been undone
+ * already.
+ *
+ * @return <code>true</code> to indicate that this action can be
+ * undone; <code>false</code> otherwise.
+ *
+ * @see #undo()
+ * @see #canRedo()
+ */
+ public boolean canUndo()
+ {
+ return !inProgress && super.canUndo();
+ }
+
+
+ /**
+ * Determines whether it would be possible to redo this editing
+ * action. The result will be <code>true</code> if {@link #end()}
+ * has been called on this <code>CompoundEdit</code>, {@link #die()}
+ * has not yet been called, and the edit has not been redone
+ * already.
+ *
+ * @return <code>true</code> to indicate that this action can be
+ * redone; <code>false</code> otherwise.
+ *
+ * @see #redo()
+ * @see #canUndo()
+ */
+ public boolean canRedo()
+ {
+ return !inProgress && super.canRedo();
+ }
+
+
+ /**
+ * Determines whether the initial construction phase of this
+ * <code>CompoundEdit</code> is still in progress. During this
+ * phase, edits {@linkplain #addEdit(UndoableEdit) may be
+ * added}. After initialization has been terminated by calling
+ * {@link #end()}, {@link #undo()} and {@link #redo()} can be used.
+ *
+ * @return <code>true</code> if the initialization phase is still in
+ * progress; <code>false</code> if {@link #end()} has been called.
+ *
+ * @see #end()
+ */
+ public boolean isInProgress()
+ {
+ return inProgress;
+ }
+
+
+ /**
+ * Determines whether this editing action is significant enough for
+ * being seperately undoable by the user. A typical significant
+ * action would be the resizing of an object. However, changing the
+ * selection in a text document would usually not be considered
+ * significant.
+ *
+ * <p>A <code>CompoundEdit</code> is significant if any of its
+ * elements are significant.
+ */
+ public boolean isSignificant()
+ {
+ for (int i = edits.size() - 1; i >= 0; i--)
+ if (((UndoableEdit) edits.elementAt(i)).isSignificant())
+ return true;
+
+ return false;
+ }
+
+
+ /**
+ * Returns a human-readable, localized name that describes this
+ * editing action and can be displayed to the user.
+ *
+ * <p>The implementation delegates the call to the {@linkplain
+ * #lastEdit() last added edit action}. If no edit has been added
+ * yet, the inherited implementation will be invoked, which always
+ * returns an empty string.
+ */
+ public String getPresentationName()
+ {
+ UndoableEdit last;
+
+ last = lastEdit();
+ if (last == null)
+ return super.getPresentationName();
+ else
+ return last.getPresentationName();
+ }
+
+
+ /**
+ * Calculates a localized message text for presenting the undo
+ * action to the user.
+ *
+ * <p>The implementation delegates the call to the {@linkplain
+ * #lastEdit() last added edit action}. If no edit has been added
+ * yet, the {@linkplain
+ * AbstractUndoableEdit#getUndoPresentationName() inherited
+ * implementation} will be invoked.
+ */
+ public String getUndoPresentationName()
+ {
+ UndoableEdit last;
+
+ last = lastEdit();
+ if (last == null)
+ return super.getUndoPresentationName();
+ else
+ return last.getUndoPresentationName();
+ }
+
+
+ /**
+ * Calculates a localized message text for presenting the redo
+ * action to the user.
+ *
+ * <p>The implementation delegates the call to the {@linkplain
+ * #lastEdit() last added edit action}. If no edit has been added
+ * yet, the {@linkplain
+ * AbstractUndoableEdit#getRedoPresentationName() inherited
+ * implementation} will be invoked.
+ */
+ public String getRedoPresentationName()
+ {
+ UndoableEdit last;
+
+ last = lastEdit();
+ if (last == null)
+ return super.getRedoPresentationName();
+ else
+ return last.getRedoPresentationName();
+ }
+
+
+ /**
+ * Calculates a string that may be useful for debugging.
+ */
+ public String toString()
+ {
+ return super.toString()
+ + " inProgress: " + inProgress
+ + " edits: " + edits;
+ }
+}
diff --git a/libjava/javax/swing/undo/StateEdit.java b/libjava/javax/swing/undo/StateEdit.java
index 6a32fbdb48d..00f1e2d830c 100644
--- a/libjava/javax/swing/undo/StateEdit.java
+++ b/libjava/javax/swing/undo/StateEdit.java
@@ -1,4 +1,4 @@
-/* StateEdit.java --
+/* StateEdit.java -- UndoableEdit for StateEditable implementations.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -42,59 +42,118 @@ import java.util.Hashtable;
import java.util.Iterator;
/**
- * StateEdit
- * @author Andrew Selkirk
+ * A helper class, making it easy to support undo and redo.
+ *
+ * <p>The following example shows how to use this class.
+ *
+ * <pre> Foo foo; // class Foo implements {@link StateEditable}
+ * StateEdit edit;
+ *
+ * edit = new StateEdit(foo, "Name Change");
+ * foo.setName("Jane Doe");
+ * edit.end();
+ * undoManager.addEdit(edit);</pre>
+ *
+ * <p>If <code>Foo</code>&#x2019;s implementation of {@link
+ * StateEditable} considers the name as part of the editable state,
+ * the user can now choose &#x201c;Undo Name Change&#x201d; or
+ * &#x201c;Redo Name Change&#x201d; from the respective menu. No
+ * further undo support is needed from the application.
+ *
+ * <p>The following explains what happens in the example.
+ *
+ * <p><ol><li>When a <code>StateEdit</code> is created, the associated
+ * {@link StateEditable} gets asked to store its state into a hash
+ * table, {@link #preState}.</li>
+ *
+ * <li>The application will now perform some changes to the edited
+ * object. This typically happens by invoking methods on the edited
+ * object.</li>
+ *
+ * <li>The editing phase is terminated by invoking the {@link #end()}
+ * method of the <code>StateEdit</code>. The <code>end()</code> method
+ * does two things.
+ *
+ * <ul><li>The edited object receives a second request for storing
+ * its state. This time, it will use a different hash table, {@link
+ * #postState}.</li>
+ *
+ * <li>To increase efficiency, the <code>StateEdit</code> now removes
+ * any entries from {@link #preState} and {@link #postState} that have
+ * the same key, and whose values are equal. Equality is determined
+ * by invoking the <code>equals</code> method inherited from
+ * {@link java.lang.Object}.</li></ul></li>
+ *
+ * <li>When the user later chooses to undo the <code>StateEdit</code>,
+ * the edited object is asked to {@linkplain StateEditable#restoreState
+ * restore its state} from the {@link #preState} table. Similarly,
+ * when the user chooses to <i>redo</i> the <code>StateEdit</code>,
+ * the edited object gets asked to restore its state from the {@link
+ * #postState}.</li></ol>
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
-public class StateEdit extends AbstractUndoableEdit
+public class StateEdit
+ extends AbstractUndoableEdit
{
-
- //-------------------------------------------------------------
- // Variables --------------------------------------------------
- //-------------------------------------------------------------
-
/**
- * RCSID
+ * The ID of the Java source file in Sun&#x2019;s Revision Control
+ * System (RCS). This certainly should not be part of the API
+ * specification. But in order to be API-compatible with
+ * Sun&#x2019;s reference implementation, GNU Classpath also has to
+ * provide this field. However, we do not try to match its value.
*/
- protected static final String RCSID = ""; // TODO
+ protected static final String RCSID = "";
+
/**
- * object
+ * The object which is being edited by this <code>StateEdit</code>.
*/
protected StateEditable object;
+
/**
- * preState
+ * The state of <code>object</code> at the time of constructing
+ * this <code>StateEdit</code>.
*/
protected Hashtable preState;
+
/**
- * postState
+ * The state of <code>object</code> at the time when {@link #end()}
+ * was called.
*/
protected Hashtable postState;
+
/**
- * undoRedoName
+ * A human-readable name for this edit action.
*/
protected String undoRedoName;
- //-------------------------------------------------------------
- // Initialization ---------------------------------------------
- //-------------------------------------------------------------
-
/**
- * Constructor StateEdit
- * @param obj Object to edit
+ * Constructs a <code>StateEdit</code>, specifying the object whose
+ * state is being edited.
+ *
+ * @param obj the object whose state is being edited by this
+ * <code>StateEdit</code>.
*/
public StateEdit(StateEditable obj)
{
init(obj, null);
}
+
/**
- * Constructor StateEdit
- * @param obj Object to edit
- * @param name Presentation name
+ * Constructs a <code>StateEdit</code>, specifying the object whose
+ * state is being edited.
+ *
+ * @param obj the object whose state is being edited by this
+ * <code>StateEdit</code>.
+ *
+ * @param name the human-readable name of the editing action.
*/
public StateEdit(StateEditable obj, String name)
{
@@ -102,14 +161,13 @@ public class StateEdit extends AbstractUndoableEdit
}
- //-------------------------------------------------------------
- // Methods ----------------------------------------------------
- //-------------------------------------------------------------
-
/**
- * Initialize this object.
- * @param obj Object to edit
- * @param name Presentation name
+ * Initializes this <code>StateEdit</code>. The edited object will
+ * be asked to store its current state into {@link #preState}.
+ *
+ * @param obj the object being edited.
+ *
+ * @param name the human-readable name of the editing action.
*/
protected void init(StateEditable obj, String name)
{
@@ -120,9 +178,12 @@ public class StateEdit extends AbstractUndoableEdit
obj.storeState(preState);
}
+
/**
- * Indicate that all edits are finished, and update this object
- * with final state.
+ * Informs this <code>StateEdit</code> that all edits are finished.
+ * The edited object will be asked to store its state into {@link
+ * #postState}, and any redundant entries will get removed from
+ * {@link #preState} and {@link #postState}.
*/
public void end()
{
@@ -130,33 +191,56 @@ public class StateEdit extends AbstractUndoableEdit
removeRedundantState();
}
+
/**
- * Undo this edit by applying the initial state to the edited object.
+ * Undoes this edit operation. The edited object will be asked to
+ * {@linkplain StateEditable#restoreState restore its state} from
+ * {@link #preState}.
+ *
+ * @throws CannotUndoException if {@link #canUndo()} returns
+ * <code>false</code>, for example because this action has already
+ * been undone.
*/
public void undo()
{
+ super.undo();
object.restoreState(preState);
}
+
/**
- * Undo this edit by applying the final state to the edited object.
+ * Redoes this edit operation. The edited object will be asked to
+ * {@linkplain StateEditable#restoreState restore its state} from
+ * {@link #postState}.
+ *
+ * @throws CannotRedoException if {@link #canRedo()} returns
+ * <code>false</code>, for example because this action has not yet
+ * been undone.
*/
public void redo()
{
+ super.redo();
object.restoreState(postState);
}
+
/**
- * Return the presentation name of this object.
- * @returns The name, or null if not set
+ * Returns a human-readable, localized name that describes this
+ * editing action and can be displayed to the user.
+ *
+ * @return the name, or <code>null</code> if no presentation
+ * name is available.
*/
public String getPresentationName()
{
return undoRedoName;
}
+
/**
- * removeRedundantState
+ * Removes all redundant entries from the pre- and post-edit state
+ * hash tables. An entry is considered redundant if it is present
+ * both before and after the edit, and if the two values are equal.
*/
protected void removeRedundantState()
{
diff --git a/libjava/javax/swing/undo/StateEditable.java b/libjava/javax/swing/undo/StateEditable.java
index 016a54371d7..d3f9d4c3738 100644
--- a/libjava/javax/swing/undo/StateEditable.java
+++ b/libjava/javax/swing/undo/StateEditable.java
@@ -1,4 +1,4 @@
-/* StateEditable.java --
+/* StateEditable.java -- Interface for collaborating with StateEdit.
Copyright (C) 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -37,29 +37,76 @@ exception statement from your version. */
package javax.swing.undo;
-// Imports
import java.util.Hashtable;
+
/**
- * StateEditable public interface
- * @author Andrew Selkirk
+ * The interface for objects whose state can be undone or redone by a
+ * {@link StateEdit} action.
+ *
+ * <p>The following example shows how to write a class that implements
+ * this interface.
+ *
+ * <pre> class Foo
+ * implements StateEditable
+ * {
+ * private String name;
+ *
+ * public void setName(String n) { name = n; }
+ *
+ * public void restoreState(Hashtable h)
+ * {
+ * if (h.containsKey("name"))
+ * setName((String) h.get("name"));
+ * }
+ *
+ * public void storeState(Hashtable s)
+ * {
+ * s.put("name", name);
+ * }
+ * }</pre>
+ *
+ * @see StateEdit
+ *
+ * @author Andrew Selkirk (aselkirk@sympatico.ca)
+ * @author Sascha Brawer (brawer@dandelis.ch)
*/
public interface StateEditable
{
/**
- * Restore State
- * @param state State
+ * The ID of the Java source file in Sun&#x2019;s Revision Control
+ * System (RCS). This certainly should not be part of the API
+ * specification. But in order to be API-compatible with
+ * Sun&#x2019;s reference implementation, GNU Classpath also has to
+ * provide this field. However, we do not try to match its value.
*/
- void restoreState(Hashtable state);
+ static final String RCSID = "";
+
/**
- * Store State
- * @param state State
+ * Performs an edit action, taking any editable state information
+ * from the specified hash table.
+ *
+ * <p><b>Note to implementors of this interface:</b> To increase
+ * efficiency, the <code>StateEdit</code> class {@linkplan
+ * StateEdit#removeRedundantState() removes redundant state
+ * information}. Therefore, implementations of this interface must be
+ * prepared for the case where certain keys were stored into the
+ * table by {@link #storeState}, but are not present anymore
+ * when the <code>restoreState</code> method gets called.
+ *
+ * @param state a hash table containing the relevant state
+ * information.
*/
- void storeState(Hashtable state);
+ void restoreState(Hashtable state);
+
/**
- * For some reason, Sun made the RCS IDs visible.
+ * Stores any editable state information into the specified hash
+ * table.
+ *
+ * @param state a hash table for storing relevant state
+ * information.
*/
- String RCSID = "We aren't compatible";
-} // StateEditable
+ void storeState(Hashtable state);
+}
diff --git a/libjava/jni.cc b/libjava/jni.cc
index e2e10defd0a..007aabc4008 100644
--- a/libjava/jni.cc
+++ b/libjava/jni.cc
@@ -1298,12 +1298,14 @@ static const char *
(JNICALL _Jv_JNI_GetStringUTFChars) (JNIEnv *env, jstring string,
jboolean *isCopy)
{
- string = unwrap (string);
- jsize len = JvGetStringUTFLength (string);
try
{
+ string = unwrap (string);
+ if (string == NULL)
+ return NULL;
+ jsize len = JvGetStringUTFLength (string);
char *r = (char *) _Jv_Malloc (len + 1);
- JvGetStringUTFRegion (string, 0, len, r);
+ JvGetStringUTFRegion (string, 0, string->length(), r);
r[len] = '\0';
if (isCopy)
@@ -2377,7 +2379,7 @@ static jint
return 0;
}
-JNIEXPORT jint JNICALL
+jint JNICALL
JNI_GetDefaultJavaVMInitArgs (void *args)
{
jint version = * (jint *) args;
@@ -2394,7 +2396,7 @@ JNI_GetDefaultJavaVMInitArgs (void *args)
return 0;
}
-JNIEXPORT jint JNICALL
+jint JNICALL
JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args)
{
JvAssert (! the_vm);
@@ -2459,7 +2461,7 @@ JNI_CreateJavaVM (JavaVM **vm, void **penv, void *args)
return 0;
}
-JNIEXPORT jint JNICALL
+jint JNICALL
JNI_GetCreatedJavaVMs (JavaVM **vm_buffer, jsize buf_len, jsize *n_vms)
{
if (buf_len <= 0)
diff --git a/libjava/jni/gtk-peer/gdkfont.h b/libjava/jni/gtk-peer/gdkfont.h
new file mode 100644
index 00000000000..efc5d2d8eef
--- /dev/null
+++ b/libjava/jni/gtk-peer/gdkfont.h
@@ -0,0 +1,93 @@
+#ifndef __GDKFONT_H__
+#define __GDKFONT_H__
+
+/* gdkfont.h -- Some global stuff related to fonts and glyphs
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+#include "gtkpeer.h"
+
+#include <pango/pango.h>
+#include <pango/pango-context.h>
+#include <pango/pango-fontmap.h>
+#include <pango/pangoft2.h>
+
+extern struct state_table *native_font_state_table;
+extern struct state_table *native_glyphvector_state_table;
+
+#define NSA_FONT_INIT(env, clazz) \
+ native_font_state_table = init_state_table (env, clazz)
+
+#define NSA_GET_FONT_PTR(env, obj) \
+ get_state (env, obj, native_font_state_table)
+
+#define NSA_SET_FONT_PTR(env, obj, ptr) \
+ set_state (env, obj, native_font_state_table, (void *)ptr)
+
+#define NSA_DEL_FONT_PTR(env, obj) \
+ remove_state_slot (env, obj, native_font_state_table)
+
+
+#define NSA_GV_INIT(env, clazz) \
+ native_glyphvector_state_table = init_state_table (env, clazz)
+
+#define NSA_GET_GV_PTR(env, obj) \
+ get_state (env, obj, native_glyphvector_state_table)
+
+#define NSA_SET_GV_PTR(env, obj, ptr) \
+ set_state (env, obj, native_glyphvector_state_table, (void *)ptr)
+
+#define NSA_DEL_GV_PTR(env, obj) \
+ remove_state_slot (env, obj, native_glyphvector_state_table)
+
+struct peerfont
+{
+ PangoFont *font;
+ PangoFontDescription *desc;
+ PangoContext *ctx;
+};
+
+struct glyphvec
+{
+ /* the GList is list of PangoGlyphItems, each of which is a pair of 1
+ PangoItem and 1 PangoGlyphString. */
+ GList *glyphitems;
+ PangoFontDescription *desc;
+ PangoFont *font;
+ PangoContext *ctx;
+};
+
+#endif /* __GDKFONT_H__ */
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c
index 092979b2fc2..afb705bf6e1 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeer.c
@@ -120,6 +120,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkClasspathFontPeer_setFont
pfont = (struct peerfont *)NSA_GET_FONT_PTR (env, self);
g_assert (pfont != NULL);
+ if (pfont->ctx != NULL)
+ g_object_unref (pfont->ctx);
+ if (pfont->font != NULL)
+ g_object_unref (pfont->font);
+ if (pfont->desc != NULL)
+ pango_font_description_free (pfont->desc);
+
pfont->desc = pango_font_description_new ();
g_assert (pfont->desc != NULL);
@@ -153,7 +160,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkClasspathFontPeer_setFont
pfont->font = pango_font_map_load_font (map, pfont->ctx, pfont->desc);
g_assert (pfont->font != NULL);
-
+
gdk_threads_leave ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c
new file mode 100644
index 00000000000..0f0b424467c
--- /dev/null
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c
@@ -0,0 +1,93 @@
+/* gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.c
+ Copyright (C) 1999, 2003 Free Software Foundation, Inc.
+
+ This file is part of GNU Classpath.
+
+ GNU Classpath is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ GNU Classpath is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with GNU Classpath; see the file COPYING. If not, write to the
+ Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA.
+
+ Linking this library statically or dynamically with other modules is
+ making a combined work based on this library. Thus, the terms and
+ conditions of the GNU General Public License cover the whole
+ combination.
+
+ As a special exception, the copyright holders of this library give you
+ permission to link this library with independent modules to produce an
+ executable, regardless of the license terms of these independent
+ modules, and to copy and distribute the resulting executable under
+ terms of your choice, provided that you also meet, for each linked
+ independent module, the terms and conditions of the license of that
+ module. An independent module is a module which is not derived from
+ or based on this library. If you modify this library, you may extend
+ this exception to your version of the library, but you are not
+ obligated to do so. If you do not wish to do so, delete this
+ exception statement from your version. */
+
+#include <math.h>
+
+#include "gtkpeer.h"
+#include "gdkfont.h"
+#include "gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics.h"
+
+#define ASCENT 0
+#define MAX_ASCENT 1
+#define DESCENT 2
+#define MAX_DESCENT 3
+#define MAX_ADVANCE 4
+#define NUM_METRICS 5
+
+JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GdkClasspathFontPeerMetrics_initState
+ (JNIEnv *env, jobject self, jobject font)
+{
+ jintArray array;
+ jint *metrics;
+ struct peerfont *pf = NULL;
+
+ pf = NSA_GET_FONT_PTR(env, font);
+ g_assert (pf != NULL);
+
+ array = (*env)->NewIntArray (env, NUM_METRICS);
+ metrics = (*env)->GetIntArrayElements (env, array, NULL);
+
+ gdk_threads_enter ();
+
+#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 63.0))
+#define DOUBLE_FROM_26_6(t) (((double)((t) >> 6)) \
+ + ((double)((t) & 0x3F) / 63.0))
+
+ double pointsize = pango_font_description_get_size (pf->desc);
+ pointsize /= (double) PANGO_SCALE;
+
+ FT_Face face = pango_ft2_font_get_face (pf->font);
+ FT_Set_Char_Size( face,
+ DOUBLE_TO_26_6 (pointsize),
+ DOUBLE_TO_26_6 (pointsize),
+ 0, 0);
+
+ metrics[ASCENT] = ceil (DOUBLE_FROM_26_6(face->size->metrics.ascender));
+ metrics[MAX_ASCENT] = metrics[ASCENT];
+ metrics[DESCENT] = floor (DOUBLE_FROM_26_6(face->size->metrics.descender));
+ if (metrics[DESCENT] < 0)
+ metrics[DESCENT] = - metrics[DESCENT];
+ metrics[MAX_DESCENT] = metrics[DESCENT];
+ metrics[MAX_ADVANCE] = ceil (DOUBLE_FROM_26_6(face->size->metrics.max_advance));
+
+ gdk_threads_leave ();
+
+ (*env)->ReleaseIntArrayElements (env, array, metrics, 0);
+
+ return array;
+}
+
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
index 03c1e4925d7..6036db7c776 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkFontMetrics.c
@@ -47,55 +47,83 @@ exception statement from your version. */
#define NUM_METRICS 5
JNIEXPORT jintArray JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_initState
- (JNIEnv *env, jobject obj, jstring fname, jint size)
+ (JNIEnv *env, jobject obj __attribute__((unused)), jstring fname, jint size)
{
jintArray array;
jint *metrics;
- const char *cfname;
- char *xlfd;
- GdkFont *font;
- XFontStruct *xfont;
-
- cfname = (*env)->GetStringUTFChars (env, fname, NULL);
- xlfd = g_strdup_printf (cfname, (size * 10));
- (*env)->ReleaseStringUTFChars (env, fname, cfname);
+ const char *font_name;
+ PangoFontDescription *font_desc;
+ PangoContext *context;
+ PangoFontMetrics *pango_metrics;
array = (*env)->NewIntArray (env, NUM_METRICS);
+
metrics = (*env)->GetIntArrayElements (env, array, NULL);
+ font_name = (*env)->GetStringUTFChars (env, fname, NULL);
gdk_threads_enter ();
- font = gdk_font_load (xlfd);
- xfont = GDK_FONT_XFONT (font);
-
- metrics[ASCENT] = font->ascent;
- metrics[MAX_ASCENT] = xfont->max_bounds.ascent;
- metrics[DESCENT] = font->descent;
- metrics[MAX_DESCENT] = xfont->max_bounds.descent;
- metrics[MAX_ADVANCE] = xfont->max_bounds.width;
+
+ font_desc = pango_font_description_from_string (font_name);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
+ context = gdk_pango_context_get();
+ pango_context_set_font_description (context, font_desc);
+
+ pango_metrics = pango_context_get_metrics (context, font_desc, NULL);
+
+ metrics[ASCENT] =
+ pango_font_metrics_get_ascent (pango_metrics) / PANGO_SCALE;
+ metrics[MAX_ASCENT] = metrics[ASCENT];
+ metrics[DESCENT] =
+ pango_font_metrics_get_descent (pango_metrics) / PANGO_SCALE;
+ metrics[MAX_DESCENT] = metrics[DESCENT];
+ metrics[MAX_ADVANCE] =
+ pango_font_metrics_get_approximate_char_width (pango_metrics) / PANGO_SCALE;
+
+ pango_font_metrics_unref (pango_metrics);
+
+ pango_font_description_free (font_desc);
+
gdk_threads_leave ();
- g_free (xlfd);
+ (*env)->ReleaseStringUTFChars (env, fname, font_name);
(*env)->ReleaseIntArrayElements (env, array, metrics, 0);
- NSA_SET_PTR (env, obj, font);
-
return array;
}
JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkFontMetrics_stringWidth
- (JNIEnv *env, jobject obj, jstring str)
+ (JNIEnv *env, jobject obj __attribute__((unused)),
+ jstring fname, jint size, jstring str)
{
- GdkFont *font;
+ PangoFontDescription *font_desc;
+ PangoContext *context;
+ PangoLayout *layout;
+ int width = 0;
const char *cstr;
- jint width;
+ const char *font_name;
- font = (GdkFont *) NSA_GET_PTR (env, obj);
cstr = (*env)->GetStringUTFChars (env, str, NULL);
+ font_name = (*env)->GetStringUTFChars (env, fname, NULL);
gdk_threads_enter ();
- width = gdk_string_width (font, cstr);
+
+ font_desc = pango_font_description_from_string (font_name);
+ pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+
+ context = gdk_pango_context_get();
+ pango_context_set_font_description (context, font_desc);
+
+ layout = pango_layout_new (context);
+
+ pango_layout_set_text (layout, cstr, -1);
+ pango_layout_get_pixel_size (layout, &width, NULL);
+
+ pango_font_description_free (font_desc);
+
gdk_threads_leave ();
+ (*env)->ReleaseStringUTFChars (env, fname, font_name);
(*env)->ReleaseStringUTFChars (env, str, cstr);
return width;
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
index 052f7e9ff6d..29616c738ed 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGlyphVector.c
@@ -40,6 +40,16 @@
struct state_table *native_glyphvector_state_table;
+typedef struct {
+ double x;
+ double y;
+ double width;
+ double height;
+} rect_t;
+
+#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 63.0))
+#define DOUBLE_FROM_26_6(t) (((double)((t) >> 6)) \
+ + ((double)((t) & 0x3F) / 63.0))
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initStaticState
(JNIEnv *env, jclass clazz)
@@ -64,8 +74,11 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_initState
vec = (struct glyphvec *) g_malloc0 (sizeof (struct glyphvec));
g_assert (vec != NULL);
- vec->desc = pango_font_description_copy (pfont->desc);
+ vec->desc = pango_font_describe (pfont->font);
g_assert (vec->desc != NULL);
+
+ vec->font = pfont->font;
+ g_object_ref (vec->font);
vec->ctx = pfont->ctx;
g_object_ref (vec->ctx);
@@ -150,10 +163,10 @@ static void seek_glyph_idx (GList *list, int idx,
*g = gs->glyphs + nidx;
}
-static void union_rects (PangoRectangle *r1,
- const PangoRectangle *r2)
+static void union_rects (rect_t *r1,
+ const rect_t *r2)
{
- PangoRectangle r;
+ rect_t r;
g_assert (r1 != NULL);
g_assert (r2 != NULL);
@@ -184,7 +197,7 @@ static void union_rects (PangoRectangle *r1,
*r1 = r;
}
-static jdoubleArray rect_to_array (JNIEnv *env, const PangoRectangle *r)
+static jdoubleArray rect_to_array (JNIEnv *env, const rect_t *r)
{
/* We often return rectangles as arrays : { x, y, w, h } */
jdoubleArray ret;
@@ -193,11 +206,11 @@ static jdoubleArray rect_to_array (JNIEnv *env, const PangoRectangle *r)
ret = (*env)->NewDoubleArray (env, 4);
rp = (*env)->GetDoubleArrayElements (env, ret, NULL);
g_assert (rp != NULL);
- rp[0] = r->x / (double)PANGO_SCALE;
+ rp[0] = r->x;
/* freetype and pango's view of space is upside down from java2d's */
- rp[1] = (r->y / (double)PANGO_SCALE) * -1;
- rp[2] = r->width / (double)PANGO_SCALE;
- rp[3] = r->height / (double)PANGO_SCALE;
+ rp[1] = r->y * -1;
+ rp[2] = r->width;
+ rp[3] = r->height;
(*env)->ReleaseDoubleArrayElements (env, ret, rp, 0);
return ret;
}
@@ -251,18 +264,14 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_setChars
str = (gchar *)(*env)->GetStringUTFChars (env, chars, NULL);
g_assert (str != NULL);
- /* step 1: mark the text as having our FontFescription as an
- attribute, then "itemize" the text */
+ /* step 1: set our FontFescription in the context, then "itemize" the
+ text */
attrs = pango_attr_list_new ();
g_assert (attrs != NULL);
- PangoAttribute *da = pango_attr_font_desc_new(vec->desc);
- g_assert (da != NULL);
- da->start_index = 0;
- da->end_index = len;
-
- pango_attr_list_insert (attrs, da);
+ pango_context_set_font_description (vec->ctx, vec->desc);
+
items = pango_itemize (vec->ctx, str, 0, len, attrs, NULL);
g_assert (items != NULL);
@@ -393,15 +402,19 @@ JNIEXPORT jint JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphCharIndex
}
-JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allLogicalExtents
+JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allInkExtents
(JNIEnv *env, jobject self)
{
struct glyphvec *vec = NULL;
+ int j;
GList *i;
PangoGlyphItem *gi = NULL;
- PangoRectangle rect = {0,0,0,0};
- PangoRectangle tmp, dummy;
+ rect_t rect = {0,0,0,0};
+ rect_t tmp;
jdoubleArray ret;
+ double x = 0, y = 0;
+ double pointsize;
+ FT_Face face;
gdk_threads_enter ();
g_assert (self != NULL);
@@ -409,17 +422,33 @@ JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allLogi
g_assert (vec != NULL);
g_assert (vec->glyphitems != NULL);
+ pointsize = pango_font_description_get_size (vec->desc);
+ pointsize /= (double) PANGO_SCALE;
+
for (i = g_list_first (vec->glyphitems); i != NULL; i = g_list_next (i))
{
g_assert (i->data != NULL);
gi = (PangoGlyphItem *)i->data;
g_assert (gi->glyphs != NULL);
+
+ face = pango_ft2_font_get_face (gi->item->analysis.font);
+ FT_Set_Char_Size( face,
+ DOUBLE_TO_26_6 (pointsize),
+ DOUBLE_TO_26_6 (pointsize),
+ 0, 0);
- pango_glyph_string_extents (gi->glyphs,
- gi->item->analysis.font,
- &dummy,
- &tmp);
- union_rects (&rect, &tmp);
+ for (j = 0; j < gi->glyphs->num_glyphs; ++j)
+ {
+ FT_Load_Glyph (face, gi->glyphs->glyphs[j].glyph, FT_LOAD_DEFAULT);
+ /* FIXME: this needs to change for vertical layouts */
+ tmp.x = x + DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingX);
+ tmp.y = y + DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingY);
+ tmp.width = DOUBLE_FROM_26_6 (face->glyph->metrics.width);
+ tmp.height = DOUBLE_FROM_26_6 (face->glyph->metrics.height);
+ union_rects (&rect, &tmp);
+ x += DOUBLE_FROM_26_6 (face->glyph->advance.x);
+ y += DOUBLE_FROM_26_6 (face->glyph->advance.y);
+ }
}
ret = rect_to_array (env, &rect);
@@ -428,15 +457,19 @@ JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allLogi
}
-JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allInkExtents
+JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allLogicalExtents
(JNIEnv *env, jobject self)
{
struct glyphvec *vec = NULL;
+ int j;
GList *i;
PangoGlyphItem *gi = NULL;
- PangoRectangle rect = {0,0,0,0};
- PangoRectangle tmp, dummy;
+ rect_t rect = {0,0,0,0};
+ rect_t tmp;
jdoubleArray ret;
+ double x = 0, y = 0;
+ double pointsize;
+ FT_Face face;
gdk_threads_enter ();
g_assert (self != NULL);
@@ -444,17 +477,38 @@ JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allInkE
g_assert (vec != NULL);
g_assert (vec->glyphitems != NULL);
+ pointsize = pango_font_description_get_size (vec->desc);
+ pointsize /= (double) PANGO_SCALE;
+
for (i = g_list_first (vec->glyphitems); i != NULL; i = g_list_next (i))
{
g_assert (i->data != NULL);
gi = (PangoGlyphItem *)i->data;
g_assert (gi->glyphs != NULL);
+
+ face = pango_ft2_font_get_face (gi->item->analysis.font);
+ FT_Set_Char_Size( face,
+ DOUBLE_TO_26_6 (pointsize),
+ DOUBLE_TO_26_6 (pointsize),
+ 0, 0);
- pango_glyph_string_extents (gi->glyphs,
- gi->item->analysis.font,
- &tmp,
- &dummy);
- union_rects (&rect, &tmp);
+ for (j = 0; j < gi->glyphs->num_glyphs; ++j)
+ {
+ FT_Load_Glyph (face, gi->glyphs->glyphs[j].glyph, FT_LOAD_DEFAULT);
+
+ /* FIXME: also, this is probably not the correct set of metrics;
+ the "logical bounds" are some fancy combination of hori
+ advance and height such that it's good for inverting as a
+ highlight. revisit. */
+
+ tmp.x = x;
+ tmp.y = y;
+ tmp.width = DOUBLE_FROM_26_6 (face->glyph->advance.x);
+ tmp.height = DOUBLE_FROM_26_6 (face->glyph->advance.y);
+ union_rects (&rect, &tmp);
+ x += DOUBLE_FROM_26_6 (face->glyph->advance.x);
+ y += DOUBLE_FROM_26_6 (face->glyph->advance.y);
+ }
}
ret = rect_to_array (env, &rect);
@@ -462,27 +516,47 @@ JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_allInkE
return ret;
}
+
JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphLogicalExtents
(JNIEnv *env, jobject self, jint idx)
{
struct glyphvec *vec = NULL;
- PangoRectangle rect = {0,0,0,0};
- PangoRectangle dummy;
+ rect_t rect = {0,0,0,0};
PangoGlyphInfo *gi = NULL;
PangoFont *font = NULL;
jdoubleArray ret;
+ double pointsize;
+ FT_Face face;
gdk_threads_enter ();
g_assert (self != NULL);
vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
g_assert (vec != NULL);
g_assert (vec->glyphitems != NULL);
-
+
seek_glyph_idx (vec->glyphitems, idx, &gi, &font);
g_assert (gi != NULL);
g_assert (font != NULL);
- pango_font_get_glyph_extents (font, gi->glyph, &dummy, &rect);
+ pointsize = pango_font_description_get_size (vec->desc);
+ pointsize /= (double) PANGO_SCALE;
+ face = pango_ft2_font_get_face (font);
+ FT_Set_Char_Size( face,
+ DOUBLE_TO_26_6 (pointsize),
+ DOUBLE_TO_26_6 (pointsize),
+ 0, 0);
+
+ FT_Load_Glyph (face, gi->glyph, FT_LOAD_DEFAULT);
+
+ /* FIXME: this is probably not the correct set of metrics;
+ the "logical bounds" are some fancy combination of hori
+ advance and height such that it's good for inverting as a
+ highlight. revisit. */
+
+ rect.x = 0;
+ rect.y = 0;
+ rect.width = DOUBLE_FROM_26_6 (face->glyph->advance.x);
+ rect.height = DOUBLE_FROM_26_6 (face->glyph->advance.y);
ret = rect_to_array (env, &rect);
gdk_threads_leave ();
@@ -494,29 +568,44 @@ JNIEXPORT jdoubleArray JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIn
(JNIEnv *env, jobject self, jint idx)
{
struct glyphvec *vec = NULL;
- PangoRectangle rect = {0,0,0,0};
- PangoRectangle dummy;
+ rect_t rect = {0,0,0,0};
PangoGlyphInfo *gi = NULL;
PangoFont *font = NULL;
jdoubleArray ret;
-
+ double pointsize;
+ FT_Face face;
+
gdk_threads_enter ();
g_assert (self != NULL);
vec = (struct glyphvec *)NSA_GET_GV_PTR (env, self);
g_assert (vec != NULL);
g_assert (vec->glyphitems != NULL);
-
+
seek_glyph_idx (vec->glyphitems, idx, &gi, &font);
g_assert (gi != NULL);
g_assert (font != NULL);
- pango_font_get_glyph_extents (font, gi->glyph, &rect, &dummy);
+ pointsize = pango_font_description_get_size (vec->desc);
+ pointsize /= (double) PANGO_SCALE;
+ face = pango_ft2_font_get_face (font);
+ FT_Set_Char_Size( face,
+ DOUBLE_TO_26_6 (pointsize),
+ DOUBLE_TO_26_6 (pointsize),
+ 0, 0);
+
+ FT_Load_Glyph (face, gi->glyph, FT_LOAD_DEFAULT);
+ /* FIXME: this needs to change for vertical layouts */
+ rect.x = DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingX);
+ rect.y = DOUBLE_FROM_26_6 (face->glyph->metrics.horiBearingY);
+ rect.width = DOUBLE_FROM_26_6 (face->glyph->metrics.width);
+ rect.height = DOUBLE_FROM_26_6 (face->glyph->metrics.height);
ret = rect_to_array (env, &rect);
gdk_threads_leave ();
return ret;
}
+
JNIEXPORT jboolean JNICALL Java_gnu_java_awt_peer_gtk_GdkGlyphVector_glyphIsHorizontal
(JNIEnv *env, jobject self, jint idx)
{
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
index 08a9742b69e..3bc93af8143 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkGraphics2D.c
@@ -46,7 +46,6 @@
#include <gdk-pixbuf/gdk-pixdata.h>
#include <cairo.h>
-#include <cairo-xlib.h>
#include <stdio.h>
#include <stdlib.h>
@@ -302,6 +301,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
g_old = (struct graphics2d *) NSA_GET_G2D_PTR (env, old);
g_assert (g_old != NULL);
+ if (g_old->debug) printf ("copying state from existing graphics2d\n");
+
g->drawable = g_old->drawable;
g->debug = g_old->debug;
@@ -316,7 +317,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_copyState
else
init_graphics2d_as_pixbuf (g);
- cairo_surface_set_filter (g->surface, CAIRO_FILTER_BILINEAR);
+ cairo_surface_set_filter (g->surface, CAIRO_FILTER_FAST);
gdk_threads_leave ();
@@ -383,6 +384,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_gdkDrawDrawable
gdk_draw_drawable(dst->drawable, gc, src->drawable,
0, 0, x, y, width, height);
+ gdk_flush ();
g_object_unref (gc);
@@ -649,36 +651,61 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_setTexturePixels
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_drawPixels
- (JNIEnv *env, jobject obj, jintArray jarr, jint w, jint h, jint stride)
+ (JNIEnv *env, jobject obj, jintArray java_pixels,
+ jint w, jint h, jint stride, jdoubleArray java_matrix)
{
struct graphics2d *gr = NULL;
- jint *jpixels = NULL;
+ jint *native_pixels = NULL;
+ jdouble *native_matrix = NULL;
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
if (gr->debug) printf ("drawPixels (%d pixels, %dx%d, stride: %d)\n",
- (*env)->GetArrayLength (env, jarr), w, h, stride);
+ (*env)->GetArrayLength (env, java_pixels), w, h, stride);
- jpixels = (*env)->GetIntArrayElements (env, jarr, NULL);
- g_assert (jpixels != NULL);
+ native_pixels = (*env)->GetIntArrayElements (env, java_pixels, NULL);
+ native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL);
+ g_assert (native_pixels != NULL);
+ g_assert (native_matrix != NULL);
+ g_assert ((*env)->GetArrayLength (env, java_matrix) == 6);
begin_drawing_operation (gr);
-
{
- cairo_surface_t *surf = cairo_surface_create_for_image ((char *)jpixels,
+ cairo_matrix_t *mat = NULL;
+ cairo_surface_t *surf = cairo_surface_create_for_image ((char *)native_pixels,
CAIRO_FORMAT_ARGB32,
w, h, stride * 4);
- cairo_surface_set_filter (surf, CAIRO_FILTER_BILINEAR);
+ mat = cairo_matrix_create ();
+ cairo_matrix_set_affine (mat,
+ native_matrix[0], native_matrix[1],
+ native_matrix[2], native_matrix[3],
+ native_matrix[4], native_matrix[5]);
+ cairo_surface_set_matrix (surf, mat);
+ if (native_matrix[0] != 1.
+ || native_matrix[1] != 0.
+ || native_matrix[2] != 0.
+ || native_matrix[3] != 1.)
+ {
+ cairo_surface_set_filter (surf, CAIRO_FILTER_BILINEAR);
+ cairo_surface_set_filter (gr->surface, CAIRO_FILTER_BILINEAR);
+ }
+ else
+ {
+ cairo_surface_set_filter (surf, CAIRO_FILTER_FAST);
+ cairo_surface_set_filter (gr->surface, CAIRO_FILTER_FAST);
+ }
cairo_show_surface (gr->cr, surf, w, h);
+ cairo_surface_set_filter (gr->surface, CAIRO_FILTER_FAST);
+ cairo_matrix_destroy (mat);
cairo_surface_destroy (surf);
}
-
end_drawing_operation (gr);
- (*env)->ReleaseIntArrayElements (env, jarr, jpixels, 0);
+ (*env)->ReleaseIntArrayElements (env, java_pixels, native_pixels, 0);
+ (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0);
}
@@ -706,25 +733,34 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRestore
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetMatrix
- (JNIEnv *env, jobject obj,
- jdouble m00, jdouble m10,
- jdouble m01, jdouble m11,
- jdouble m02, jdouble m12)
+ (JNIEnv *env, jobject obj, jdoubleArray java_matrix)
{
struct graphics2d *gr = NULL;
+ jdouble *native_matrix = NULL;
+
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_set_matrix\n");
+
+ native_matrix = (*env)->GetDoubleArrayElements (env, java_matrix, NULL);
+ g_assert (native_matrix != NULL);
+ g_assert ((*env)->GetArrayLength (env, java_matrix) == 6);
+
+ if (gr->debug) printf ("cairo_set_matrix [ %f, %f, %f, %f, %f, %f ]\n",
+ native_matrix[0], native_matrix[1],
+ native_matrix[2], native_matrix[3],
+ native_matrix[4], native_matrix[5]);
{
cairo_matrix_t * mat = cairo_matrix_create ();
- cairo_matrix_set_affine (mat,
- m00, m10,
- m01, m11,
- m02, m12);
+ cairo_matrix_set_affine (mat,
+ native_matrix[0], native_matrix[1],
+ native_matrix[2], native_matrix[3],
+ native_matrix[4], native_matrix[5]);
cairo_set_matrix (gr->cr, mat);
cairo_matrix_destroy (mat);
}
+
+ (*env)->ReleaseDoubleArrayElements (env, java_matrix, native_matrix, 0);
update_pattern_transform (gr);
}
@@ -750,8 +786,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFont
ft = cairo_ft_font_create_for_ft_face (face);
g_assert (ft != NULL);
- if (gr->debug) printf ("cairo_set_font '%s'\n",
- face->family_name);
+ if (gr->debug) printf ("cairo_set_font '%s'\n", face->family_name);
cairo_set_font (gr->cr, ft);
@@ -765,40 +800,46 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetFont
}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoShowGlyphs
- (JNIEnv *env, jobject obj, jintArray jcodes, jfloatArray jposns, jint nglyphs)
+ (JNIEnv *env, jobject obj, jintArray java_codes, jfloatArray java_posns)
{
struct graphics2d *gr = NULL;
cairo_glyph_t *glyphs = NULL;
- jfloat *posns = NULL;
- jint *codes = NULL;
+ jfloat *native_posns = NULL;
+ jint *native_codes = NULL;
jint i;
+ jint ncodes, nposns;
gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_show_glyphs (%d glyphs)\n", nglyphs);
+ native_codes = (*env)->GetIntArrayElements (env, java_codes, NULL);
+ native_posns = (*env)->GetFloatArrayElements (env, java_posns, NULL);
+ g_assert (native_codes != NULL);
+ g_assert (native_posns != NULL);
- glyphs = malloc (sizeof(cairo_glyph_t) * nglyphs);
- g_assert (glyphs);
+ ncodes = (*env)->GetArrayLength (env, java_codes);
+ nposns = (*env)->GetArrayLength (env, java_posns);
+ g_assert (2 * ncodes == nposns);
- codes = (*env)->GetIntArrayElements (env, jcodes, NULL);
- g_assert (codes != NULL);
+ if (gr->debug) printf ("cairo_show_glyphs (%d glyphs)\n", ncodes);
- posns = (*env)->GetFloatArrayElements (env, jposns, NULL);
- g_assert (posns != NULL);
+ glyphs = malloc (sizeof(cairo_glyph_t) * ncodes);
+ g_assert (glyphs);
- for (i = 0; i < nglyphs; ++i)
+ for (i = 0; i < ncodes; ++i)
{
- glyphs[i].index = codes[i];
- glyphs[i].x = (double) posns[2*i];
- glyphs[i].y = (double) posns[2*i + 1];
+ glyphs[i].index = native_codes[i];
+ glyphs[i].x = (double) native_posns[2*i];
+ glyphs[i].y = (double) native_posns[2*i + 1];
+ if (gr->debug) printf ("cairo_show_glyphs (glyph %d (code %d) : %f,%f)\n",
+ i, glyphs[i].index, glyphs[i].x, glyphs[i].y);
}
- (*env)->ReleaseIntArrayElements (env, jcodes, codes, 0);
- (*env)->ReleaseFloatArrayElements (env, jposns, posns, 0);
+ (*env)->ReleaseIntArrayElements (env, java_codes, native_codes, 0);
+ (*env)->ReleaseFloatArrayElements (env, java_posns, native_posns, 0);
begin_drawing_operation (gr);
- cairo_show_glyphs (gr->cr, glyphs, nglyphs);
+ cairo_show_glyphs (gr->cr, glyphs, ncodes);
end_drawing_operation (gr);
free(glyphs);
@@ -991,38 +1032,6 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoSetMiterLim
cairo_set_miter_limit (gr->cr, miter);
}
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoTranslate
- (JNIEnv *env, jobject obj, jdouble dx, jdouble dy)
-{
- struct graphics2d *gr = NULL;
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_translate (%f, %f)\n", dx, dy);
- cairo_translate (gr->cr, dx, dy);
- update_pattern_transform (gr);
-}
-
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoScale
- (JNIEnv *env, jobject obj, jdouble sx, jdouble sy)
-{
- struct graphics2d *gr = NULL;
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_scale (%f, %f)\n", sx, sy);
- cairo_scale (gr->cr, sx, sy);
- update_pattern_transform (gr);
-}
-
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoRotate
- (JNIEnv *env, jobject obj, jdouble angle)
-{
- struct graphics2d *gr = NULL;
- gr = (struct graphics2d *) NSA_GET_G2D_PTR (env, obj);
- g_assert (gr != NULL);
- if (gr->debug) printf ("cairo_rotate %f\n", angle);
- cairo_rotate (gr->cr, angle);
- update_pattern_transform (gr);
-}
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GdkGraphics2D_cairoNewPath
(JNIEnv *env, jobject obj)
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
index 0d755721649..222c7cedef3 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GdkPixbufDecoder.c
@@ -153,7 +153,7 @@ area_updated (GdkPixbufLoader *loader,
}
static void
-closed (GdkPixbufLoader *loader, jobject *decoder)
+closed (GdkPixbufLoader *loader __attribute__((unused)), jobject *decoder)
{
gdk_threads_leave ();
(*gdk_env)->DeleteGlobalRef (gdk_env, *decoder);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
index a52f54ce35f..e16b2d457d6 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkButtonPeer.c
@@ -37,20 +37,56 @@ exception statement from your version. */
#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include "gnu_java_awt_peer_gtk_GtkButtonPeer.h"
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_create
(JNIEnv *env, jobject obj)
{
GtkWidget *button;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
button = gtk_button_new();
gtk_widget_show (button);
+
gdk_threads_leave ();
+
NSA_SET_PTR (env, obj, button);
}
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectJObject
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ gtk_widget_realize (GTK_WIDGET (ptr));
+
+ connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
+
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkButtonPeer_connectSignals
+ (JNIEnv *env, jobject obj)
+{
+ /* FIXME: Do we need to connect any signals here? Otherwise just do not
+ override parent method. */
+
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
+}
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkButtonPeer_gtkSetFont
(JNIEnv *env, jobject obj, jstring name, jint style, jint size)
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
index 6559c5baf70..6a1a90ce170 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCanvasPeer.c
@@ -44,8 +44,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCanvasPeer_create
{
gpointer widget;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
widget = gtk_type_new (gtk_drawing_area_get_type ());
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, widget);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
index 94b13666776..71600c082ca 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer.c
@@ -46,12 +46,17 @@ Java_gnu_java_awt_peer_gtk_GtkCheckboxMenuItemPeer_create
GtkWidget *widget;
const char *str;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
str = (*env)->GetStringUTFChars (env, label, NULL);
gdk_threads_enter ();
+
widget = gtk_check_menu_item_new_with_label (str);
gtk_check_menu_item_set_show_toggle (GTK_CHECK_MENU_ITEM (widget), 1);
gtk_widget_show (widget);
+
gdk_threads_leave ();
(*env)->ReleaseStringUTFChars (env, label, str);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
index 09fa7ef21b5..b6b329d41d9 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkCheckboxPeer.c
@@ -1,5 +1,5 @@
/* gtkcheckboxpeer.c -- Native implementation of GtkCheckboxPeer
- Copyright (C) 1998, 1999, 2002 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2002, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -78,10 +78,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkCheckboxGroupPeer_remove
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate
- (JNIEnv *env, jobject obj, jobject group)
+ (JNIEnv *env, jobject obj, jobject group, jboolean state)
{
GtkWidget *button;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
if (group == NULL)
@@ -97,6 +100,7 @@ Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate
NSA_SET_PTR (env, group, button);
}
}
+ gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), state);
gdk_threads_leave ();
@@ -104,25 +108,22 @@ Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeCreate
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_connectSignals
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
- jobject peer;
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
gdk_threads_enter ();
- peer = (*env)->NewGlobalRef (env, obj);
-
- /* FIXME: when the widget goes away, we should get rid of the global
- reference. */
- gtk_signal_connect (GTK_OBJECT (ptr), "toggled",
- GTK_SIGNAL_FUNC (item_toggled), peer);
+ g_signal_connect (G_OBJECT (ptr), "toggled",
+ GTK_SIGNAL_FUNC (item_toggled), *gref);
gdk_threads_leave ();
- /* Connect the superclass hooks. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks (env, obj);
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
}
JNIEXPORT void JNICALL
@@ -166,6 +167,7 @@ Java_gnu_java_awt_peer_gtk_GtkCheckboxPeer_nativeSetCheckboxGroup
static void
item_toggled (GtkToggleButton *item, jobject peer)
{
+ //g_print ("toggled\n");
(*gdk_env)->CallVoidMethod (gdk_env, peer,
postItemEventID,
peer,
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
index b0130408c6b..068cf1e4254 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkChoicePeer.c
@@ -41,8 +41,9 @@ exception statement from your version. */
static void connect_choice_item_selectable_hook (JNIEnv *env,
jobject peer_obj,
- GtkItem *item,
- jobject item_obj);
+ GtkItem *menuitem,
+ const char *label);
+
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create
(JNIEnv *env, jobject obj)
@@ -51,7 +52,11 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_create
GtkOptionMenu *option_menu;
GtkRequisition child_requisition;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
option_menu = GTK_OPTION_MENU (gtk_option_menu_new ());
menu = gtk_menu_new ();
gtk_widget_show (menu);
@@ -97,14 +102,13 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_append
label = (*env)->GetStringUTFChars (env, item, NULL);
menuitem = gtk_menu_item_new_with_label (label);
-
- (*env)->ReleaseStringUTFChars (env, item, label);
-
gtk_menu_append (menu, menuitem);
gtk_widget_show (menuitem);
connect_choice_item_selectable_hook (env, obj,
- GTK_ITEM (menuitem), item);
+ GTK_ITEM (menuitem), label);
+
+ (*env)->ReleaseStringUTFChars (env, item, label);
}
if (need_set_history)
@@ -135,7 +139,8 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_add
menuitem = gtk_menu_item_new_with_label (label);
gtk_menu_insert (GTK_MENU (menu), menuitem, index);
gtk_widget_show (menuitem);
- connect_choice_item_selectable_hook (env, obj, GTK_ITEM (menuitem), item);
+
+ connect_choice_item_selectable_hook (env, obj, GTK_ITEM (menuitem), label);
if (need_set_history)
gtk_option_menu_set_history (GTK_OPTION_MENU (ptr), 0);
@@ -151,14 +156,19 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_remove
{
void *ptr;
GtkContainer *menu;
+ GtkWidget *menuitem;
GList *children;
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
+
menu = GTK_CONTAINER (gtk_option_menu_get_menu (GTK_OPTION_MENU (ptr)));
children = gtk_container_children (menu);
- gtk_container_remove (menu, GTK_WIDGET (g_list_nth (children, index)->data));
+ menuitem = GTK_WIDGET (g_list_nth (children, index)->data);
+ gtk_container_remove (menu, menuitem);
+ gtk_widget_destroy (menuitem);
+
gdk_threads_leave ();
}
@@ -175,31 +185,49 @@ Java_gnu_java_awt_peer_gtk_GtkChoicePeer_select
gdk_threads_leave ();
}
-
static void
item_activate (GtkItem *item __attribute__((unused)),
struct item_event_hook_info *ie)
{
gdk_threads_leave ();
+
+ jstring label = (*gdk_env)->NewStringUTF (gdk_env, ie->label);
(*gdk_env)->CallVoidMethod (gdk_env, ie->peer_obj,
- postItemEventID,
- ie->item_obj,
+ choicePostItemEventID,
+ label,
(jint) AWT_ITEM_SELECTED);
gdk_threads_enter ();
}
static void
-connect_choice_item_selectable_hook (JNIEnv *env, jobject peer_obj,
- GtkItem *item, jobject item_obj)
+item_removed (gpointer data,
+ GClosure gc __attribute__((unused)))
+{
+ struct item_event_hook_info *ie = data;
+
+ free (ie->label);
+ free (ie);
+}
+
+static void
+connect_choice_item_selectable_hook (JNIEnv *env,
+ jobject peer_obj,
+ GtkItem *menuitem,
+ const char *label)
{
struct item_event_hook_info *ie;
+ jobject *peer_objGlobPtr;
ie = (struct item_event_hook_info *)
malloc (sizeof (struct item_event_hook_info));
- ie->peer_obj = (*env)->NewGlobalRef (env, peer_obj);
- ie->item_obj = (*env)->NewGlobalRef (env, item_obj);
+ peer_objGlobPtr = NSA_GET_GLOBAL_REF (env, peer_obj);
+ g_assert (peer_objGlobPtr);
+
+ ie->peer_obj = *peer_objGlobPtr;
+ ie->label = strdup (label);
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (item_activate), ie);
+ g_signal_connect_data (G_OBJECT (menuitem), "activate",
+ GTK_SIGNAL_FUNC (item_activate), ie,
+ (GClosureNotify) item_removed, 0);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
index cf197115aa5..a1327400335 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkClipboard.c
@@ -75,16 +75,16 @@ Java_gnu_java_awt_peer_gtk_GtkClipboard_initNativeState (JNIEnv *env,
gdk_threads_enter ();
clipboard = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_signal_connect (GTK_OBJECT(clipboard), "selection_received",
+ g_signal_connect (G_OBJECT(clipboard), "selection_received",
GTK_SIGNAL_FUNC (selection_received), NULL);
- gtk_signal_connect (GTK_OBJECT(clipboard), "selection_clear_event",
+ g_signal_connect (G_OBJECT(clipboard), "selection_clear_event",
GTK_SIGNAL_FUNC (selection_clear), NULL);
gtk_selection_add_target (clipboard, GDK_SELECTION_PRIMARY,
GDK_TARGET_STRING, 0);
- gtk_signal_connect (GTK_OBJECT(clipboard), "selection_get",
+ g_signal_connect (G_OBJECT(clipboard), "selection_get",
GTK_SIGNAL_FUNC (selection_get), NULL);
gdk_threads_leave ();
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
index 98e8e8cbe9f..6336636ec11 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkComponentPeer.c
@@ -40,17 +40,24 @@ exception statement from your version. */
#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include <gtk/gtkprivate.h>
+static GtkWidget *find_fg_color_widget (GtkWidget *widget);
+static GtkWidget *find_bg_color_widget (GtkWidget *widget);
+
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkGenericPeer_dispose
(JNIEnv *env, jobject obj)
{
void *ptr;
+ /* Remove entries from state tables */
+ NSA_DEL_GLOBAL_REF (env, obj);
ptr = NSA_DEL_PTR (env, obj);
+ gdk_threads_enter ();
+
/* For now the native state for any object must be a widget.
However, a subclass could override dispose() if required. */
- gdk_threads_enter ();
gtk_widget_destroy (GTK_WIDGET (ptr));
+
gdk_threads_leave ();
}
@@ -299,7 +306,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetBackground
gdk_threads_enter ();
- widget = GTK_WIDGET (ptr);
+ widget = find_bg_color_widget (GTK_WIDGET (ptr));
gtk_widget_modify_bg (widget, GTK_STATE_NORMAL, &normal_color);
gtk_widget_modify_bg (widget, GTK_STATE_ACTIVE, &active_color);
@@ -324,9 +331,11 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_gtkWidgetSetForeground
gdk_threads_enter ();
- widget = GTK_WIDGET (ptr);
+ widget = find_fg_color_widget (GTK_WIDGET (ptr));
gtk_widget_modify_fg (widget, GTK_STATE_NORMAL, &color);
+ gtk_widget_modify_fg (widget, GTK_STATE_ACTIVE, &color);
+ gtk_widget_modify_fg (widget, GTK_STATE_PRELIGHT, &color);
gdk_threads_leave ();
}
@@ -526,7 +535,7 @@ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_set__Ljava_lang_String_2Ljava_lang_O
(*env)->ReleaseStringUTFChars (env, jname, name);
}
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr;
@@ -534,11 +543,71 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
+
gtk_widget_realize (GTK_WIDGET (ptr));
- if(GTK_IS_BUTTON(ptr))
- connect_awt_hook (env, obj, 1, GTK_BUTTON(ptr)->event_window);
- else
- connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
+ connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
+
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
+
+ gdk_threads_enter ();
+
+ gtk_widget_realize (GTK_WIDGET (ptr));
+
+ /* FIXME: We could check here if this is a scrolled window with a
+ single child that does not have an associated jobject. This
+ means that it is one of our wrapped widgets like List or TextArea
+ and thus we could connect the signal to the child without having
+ to specialize this method. */
+
+ /* Connect EVENT signal, which happens _before_ any specific signal. */
+
+ g_signal_connect (GTK_OBJECT (ptr), "event",
+ G_CALLBACK (pre_event_handler), *gref);
+
gdk_threads_leave ();
}
+
+static GtkWidget *
+find_fg_color_widget (GtkWidget *widget)
+{
+ GtkWidget *fg_color_widget;
+
+ if (GTK_IS_EVENT_BOX (widget))
+ fg_color_widget = gtk_bin_get_child (GTK_BIN(widget));
+ else
+ fg_color_widget = widget;
+
+ return fg_color_widget;
+}
+
+static GtkWidget *
+find_bg_color_widget (GtkWidget *widget)
+{
+ GtkWidget *bg_color_widget;
+
+ if (GTK_IS_WINDOW (widget))
+ {
+ GtkWidget *vbox;
+ GList* children;
+
+ children = gtk_container_get_children(GTK_CONTAINER(widget));
+ vbox = children->data;
+
+ children = gtk_container_get_children(GTK_CONTAINER(vbox));
+ bg_color_widget = children->data;
+ }
+ else
+ bg_color_widget = widget;
+
+ return bg_color_widget;
+}
+
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
index 604193aa24e..bf4035dcb7f 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer.c
@@ -47,8 +47,11 @@ Java_gnu_java_awt_peer_gtk_GtkEmbeddedWindowPeer_create
GtkWidget *window;
GtkWidget *vbox, *layout;
- gdk_threads_enter ();
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+ gdk_threads_enter ();
+
window = gtk_plug_new (window_id);
vbox = gtk_vbox_new (0, 0);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
index 563492a3627..aa9fd17b12f 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkEvents.c
@@ -813,19 +813,57 @@ generates_key_typed_event (GdkEvent *event, GtkWidget *source)
void
awt_event_handler (GdkEvent *event)
{
- jobject *event_obj_ptr;
+ /* keep synthetic AWT events from being processed recursively */
+ if (event->type & SYNTHETIC_EVENT_MASK && event->type != GDK_NOTHING)
+ {
+ event->type ^= SYNTHETIC_EVENT_MASK;
+ }
+
+ gtk_main_do_event (event);
+}
+
+gboolean
+pre_event_handler (GtkWidget *widget, GdkEvent *event, jobject peer)
+{
+ GtkWidget *event_widget;
static guint32 button_click_time = 0;
static GdkWindow *button_window = NULL;
static guint button_number = -1;
static jint click_count = 1;
- /* keep synthetic AWT events from being processed recursively */
- if (event->type & SYNTHETIC_EVENT_MASK && event->type != GDK_NOTHING)
+ /* If it is not a focus change event, the widget must be realized already.
+ If not, ignore the event (Gtk+ will do the same). */
+ if (!(event->type == GDK_FOCUS_CHANGE || GTK_WIDGET_REALIZED(widget)))
+ return FALSE;
+
+ /* Do not handle propagated events. AWT has its own propagation rules */
+ gdk_window_get_user_data (event->any.window, (void **) &event_widget);
+ if (event_widget != widget)
+ return FALSE;
+
+ /* We only care about input events */
+ if (!(event->type == GDK_BUTTON_PRESS
+ || event->type == GDK_BUTTON_RELEASE
+ || event->type == GDK_ENTER_NOTIFY
+ || event->type == GDK_LEAVE_NOTIFY
+ || event->type == GDK_CONFIGURE
+ || event->type == GDK_EXPOSE
+ || event->type == GDK_KEY_PRESS
+ || event->type == GDK_KEY_RELEASE
+ || event->type == GDK_FOCUS_CHANGE
+ || event->type == GDK_MOTION_NOTIFY))
{
- event->type ^= SYNTHETIC_EVENT_MASK;
- gtk_main_do_event (event);
- return;
+ return FALSE;
}
+ /* g_print("event %u widget %s peer %p\n",
+ event->type, gtk_widget_get_name (widget), peer); */
+
+ /* If it has no jobject associated we can send no AWT event */
+ if (!peer)
+ return FALSE;
+
+ /* for all input events, which have a window with a jobject attached,
+ send the AWT input event corresponding to the Gtk event off to Java */
/* keep track of clickCount ourselves, since the AWT allows more
than a triple click to occur */
@@ -843,352 +881,256 @@ awt_event_handler (GdkEvent *event)
button_number = event->button.button;
}
- /* for all input events, which have a window with a jobject attached,
- send the input event off to Java before GTK has a chance to process
- the event */
- if ((event->type == GDK_BUTTON_PRESS
- || event->type == GDK_BUTTON_RELEASE
- || event->type == GDK_ENTER_NOTIFY
- || event->type == GDK_LEAVE_NOTIFY
- || event->type == GDK_CONFIGURE
- || event->type == GDK_EXPOSE
- || event->type == GDK_KEY_PRESS
- || event->type == GDK_KEY_RELEASE
- || event->type == GDK_FOCUS_CHANGE
- || event->type == GDK_MOTION_NOTIFY)
- && gdk_property_get (event->any.window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&event_obj_ptr))
+ switch (event->type)
{
- GtkWidget *event_widget;
- GtkWidget *grab_widget;
- jobject *grab_obj_ptr = NULL;
- void *ptr;
-
- /* Implement modality using GTK grabs. */
- g_assert (global_gtk_window_group);
- if (global_gtk_window_group->grabs)
- {
- grab_widget = global_gtk_window_group->grabs->data;
- g_assert (grab_widget);
-
- gdk_property_get (grab_widget->window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&grab_obj_ptr);
-
- ptr = NSA_GET_PTR (gdk_env, *event_obj_ptr);
- event_widget = GTK_WIDGET(ptr);
-
- if (GTK_WIDGET_IS_SENSITIVE (event_widget) &&
- gtk_widget_is_ancestor (event_widget, grab_widget))
- {
- g_free (grab_obj_ptr);
-
- grab_obj_ptr = event_obj_ptr;
- }
- }
- else
- grab_obj_ptr = event_obj_ptr;
-
- switch (event->type)
- {
- case GDK_BUTTON_PRESS:
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr, postMouseEventID,
- AWT_MOUSE_PRESSED,
- (jlong)event->button.time,
- state_to_awt_mods (event->button.state) |
- button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count,
- (event->button.button == 3) ? JNI_TRUE :
- JNI_FALSE);
-
- /* grab_counter++;
- gdk_pointer_grab (event->any.window,
- FALSE,
- GDK_POINTER_MOTION_MASK |
- GDK_BUTTON_MOTION_MASK |
- GDK_BUTTON_PRESS_MASK |
- GDK_BUTTON_RELEASE_MASK |
- GDK_ENTER_NOTIFY_MASK |
- GDK_LEAVE_NOTIFY_MASK,
- NULL,
- NULL,
- event->button.time);*/
- break;
- case GDK_BUTTON_RELEASE:
- {
- int width, height;
-
- /* only ungrab if no other buttons are pressed down */
- /* if (--grab_counter == 0)
- gdk_pointer_ungrab (event->button.time);
- */
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postMouseEventID,
- AWT_MOUSE_RELEASED,
- (jlong)event->button.time,
+ case GDK_BUTTON_PRESS:
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postMouseEventID,
+ AWT_MOUSE_PRESSED,
+ (jlong)event->button.time,
+ state_to_awt_mods (event->button.state) |
+ button_to_awt_mods (event->button.button),
+ (jint)event->button.x,
+ (jint)event->button.y,
+ click_count,
+ (event->button.button == 3) ? JNI_TRUE :
+ JNI_FALSE);
+ break;
+ case GDK_BUTTON_RELEASE:
+ {
+ int width, height;
+
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postMouseEventID,
+ AWT_MOUSE_RELEASED,
+ (jlong)event->button.time,
state_to_awt_mods (event->button.state) |
button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count, JNI_FALSE);
-
- /* check to see if the release occured in the window it was pressed
- in, and if so, generate an AWT click event */
- gdk_window_get_size (event->any.window, &width, &height);
- if (event->button.x >= 0
- && event->button.y >= 0
- && event->button.x <= width
- && event->button.y <= height)
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postMouseEventID,
- AWT_MOUSE_CLICKED,
- (jlong)event->button.time,
- state_to_awt_mods (event->button.state) |
- button_to_awt_mods (event->button.button),
- (jint)event->button.x,
- (jint)event->button.y,
- click_count, JNI_FALSE);
-
- }
- break;
- case GDK_MOTION_NOTIFY:
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr, postMouseEventID,
- AWT_MOUSE_MOVED,
+ (jint)event->button.x,
+ (jint)event->button.y,
+ click_count,
+ JNI_FALSE);
+
+ /* check to see if the release occured in the window it was pressed
+ in, and if so, generate an AWT click event */
+ gdk_window_get_size (event->any.window, &width, &height);
+ if (event->button.x >= 0
+ && event->button.y >= 0
+ && event->button.x <= width
+ && event->button.y <= height)
+ {
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postMouseEventID,
+ AWT_MOUSE_CLICKED,
+ (jlong)event->button.time,
+ state_to_awt_mods (event->button.state) |
+ button_to_awt_mods (event->button.button),
+ (jint)event->button.x,
+ (jint)event->button.y,
+ click_count,
+ JNI_FALSE);
+ }
+ }
+ break;
+ case GDK_MOTION_NOTIFY:
+ (*gdk_env)->CallVoidMethod (gdk_env, peer, postMouseEventID,
+ AWT_MOUSE_MOVED,
+ (jlong)event->motion.time,
+ state_to_awt_mods (event->motion.state),
+ (jint)event->motion.x,
+ (jint)event->motion.y,
+ 0,
+ JNI_FALSE);
+
+ if (event->motion.state & (GDK_BUTTON1_MASK
+ | GDK_BUTTON2_MASK
+ | GDK_BUTTON3_MASK
+ | GDK_BUTTON4_MASK
+ | GDK_BUTTON5_MASK))
+ {
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postMouseEventID,
+ AWT_MOUSE_DRAGGED,
(jlong)event->motion.time,
state_to_awt_mods (event->motion.state),
(jint)event->motion.x,
(jint)event->motion.y,
- 0, JNI_FALSE);
-
- if (event->motion.state & (GDK_BUTTON1_MASK
- | GDK_BUTTON2_MASK
- | GDK_BUTTON3_MASK
- | GDK_BUTTON4_MASK
- | GDK_BUTTON5_MASK))
- {
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postMouseEventID,
- AWT_MOUSE_DRAGGED,
- (jlong)event->motion.time,
- state_to_awt_mods (event->motion.state),
- (jint)event->motion.x,
- (jint)event->motion.y,
- 0, JNI_FALSE);
- }
- break;
- case GDK_ENTER_NOTIFY:
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr, postMouseEventID,
- AWT_MOUSE_ENTERED,
- (jlong)event->crossing.time,
- state_to_awt_mods (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0, JNI_FALSE);
- break;
- case GDK_LEAVE_NOTIFY:
- if (event->crossing.mode == GDK_CROSSING_NORMAL)
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postMouseEventID,
- AWT_MOUSE_EXITED,
- (jlong)event->crossing.time,
+ 0,
+ JNI_FALSE);
+ }
+ break;
+ case GDK_ENTER_NOTIFY:
+ (*gdk_env)->CallVoidMethod (gdk_env, peer, postMouseEventID,
+ AWT_MOUSE_ENTERED,
+ (jlong)event->crossing.time,
+ state_to_awt_mods (event->crossing.state),
+ (jint)event->crossing.x,
+ (jint)event->crossing.y,
+ 0,
+ JNI_FALSE);
+ break;
+ case GDK_LEAVE_NOTIFY:
+ if (event->crossing.mode == GDK_CROSSING_NORMAL)
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postMouseEventID,
+ AWT_MOUSE_EXITED,
+ (jlong)event->crossing.time,
state_to_awt_mods (event->crossing.state),
- (jint)event->crossing.x,
- (jint)event->crossing.y,
- 0, JNI_FALSE);
- break;
- case GDK_CONFIGURE:
- {
- GtkWidget *widget;
-
- gdk_window_get_user_data (event->any.window, (void **) &widget);
+ (jint)event->crossing.x,
+ (jint)event->crossing.y,
+ 0,
+ JNI_FALSE);
+ break;
+ case GDK_CONFIGURE:
+ {
+ /* GtkWidget *widget;
+
+ gdk_window_get_user_data (event->any.window, (void **) &widget); */
- if (widget && GTK_WIDGET_TOPLEVEL (widget))
- {
- gint top, left, right, bottom;
- gint x, y, w, h, d;
- GdkRectangle r;
-
- /* Configure events are not posted to the AWT event
- queue, and as such, the gdk/gtk peer functions will
- be called back before postConfigureEvent
- returns. */
- gdk_threads_leave ();
-
- /* Calculate our insets. */
-
- /* When called from within the gdk_threads critical
- section these functions seem to return strange
- results, so we call them after
- gdk_threads_leave. */
- gdk_window_get_geometry (event->any.window,
- &x, &y, &w, &h, &d);
- gdk_window_get_frame_extents (event->any.window, &r);
-
- top = y;
- left = x;
- bottom = r.height - h - y;
- right = r.width - w - x;
-
- (*gdk_env)->CallVoidMethod (gdk_env, *event_obj_ptr,
- postConfigureEventID,
- (jint) event->configure.x,
- (jint) event->configure.y,
- (jint) event->configure.width,
- (jint) event->configure.height,
- (jint) top,
- (jint) left,
- (jint) bottom,
- (jint) right);
- gdk_threads_enter ();
- }
- }
- break;
- case GDK_EXPOSE:
+ if (widget && GTK_WIDGET_TOPLEVEL (widget))
{
- (*gdk_env)->CallVoidMethod (gdk_env, *event_obj_ptr,
- postExposeEventID,
- (jint)event->expose.area.x,
- (jint)event->expose.area.y,
- (jint)event->expose.area.width,
- (jint)event->expose.area.height);
+ gint top, left, right, bottom;
+
+ /* Configure events are not posted to the AWT event
+ queue, and as such, the gdk/gtk peer functions will
+ be called back before postConfigureEvent
+ returns. */
+ gdk_threads_leave ();
+
+ /* FIXME: hard-code these values for now. */
+ top = 20;
+ left = 6;
+ bottom = 6;
+ right = 6;
+
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postConfigureEventID,
+ (jint) event->configure.x,
+ (jint) event->configure.y,
+ (jint) event->configure.width,
+ (jint) event->configure.height,
+ (jint) top,
+ (jint) left,
+ (jint) bottom,
+ (jint) right);
+ gdk_threads_enter ();
}
- break;
-
- case GDK_KEY_PRESS:
+ }
+ break;
+ case GDK_EXPOSE:
+ {
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postExposeEventID,
+ (jint)event->expose.area.x,
+ (jint)event->expose.area.y,
+ (jint)event->expose.area.width,
+ (jint)event->expose.area.height);
+ }
+ break;
+ case GDK_FOCUS_CHANGE:
+ (*gdk_env)->CallVoidMethod (gdk_env, peer,
+ postFocusEventID,
+ (jint) (event->focus_change.in) ?
+ AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
+ JNI_FALSE);
+ break;
+ case GDK_KEY_PRESS:
+ case GDK_KEY_RELEASE:
+ {
+ GdkWindow *obj_window;
+ jobject *focus_obj_ptr = NULL;
+ int generates_key_typed = 0;
+
+ /* A widget with a grab will get key events */
+ if (!GTK_IS_WINDOW (widget))
+ focus_obj_ptr = &peer;
+ else
{
- GtkWidget *widget;
- GtkWindow *window;
- /* The window to which the Java peer is attached. */
- GdkWindow *obj_window;
-
- gdk_window_get_user_data (event->any.window, (void **) &widget);
-
- window = GTK_WINDOW (gtk_widget_get_ancestor (widget,
- GTK_TYPE_WINDOW));
- if (window
- && GTK_WIDGET_IS_SENSITIVE (window)
- && window->focus_widget
- && GTK_WIDGET_IS_SENSITIVE (window->focus_widget)
- && window->focus_widget->window)
- {
- gtk_widget_activate (window->focus_widget);
-
- /* TextArea peers are attached to the scrolled window
- that contains the GtkTextView, not to the text view
- itself. */
- if (GTK_IS_TEXT_VIEW (window->focus_widget))
- obj_window = gtk_widget_get_parent (window->focus_widget)->window;
- else
- obj_window = window->focus_widget->window;
-
- gdk_property_get (obj_window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&grab_obj_ptr);
-
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postKeyEventID,
- (jint) AWT_KEY_PRESSED,
- (jlong) event->key.time,
- keyevent_state_to_awt_mods (event),
- keysym_to_awt_keycode (event),
- keyevent_to_awt_keychar (event),
- keysym_to_awt_keylocation (event));
-
- if (generates_key_typed_event (event, window->focus_widget))
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postKeyEventID,
- (jint) AWT_KEY_TYPED,
- (jlong) event->key.time,
- state_to_awt_mods (event->key.state),
- VK_UNDEFINED,
- keyevent_to_awt_keychar (event),
- AWT_KEY_LOCATION_UNKNOWN);
- }
- }
- break;
- case GDK_KEY_RELEASE:
+ GtkWindow *window;
+
+ /* Check if we have an enabled focused widget in this window.
+ If not don't handle the event. */
+ window = GTK_WINDOW (widget);
+ if (!window->focus_widget
+ || !GTK_WIDGET_IS_SENSITIVE (window->focus_widget)
+ || !window->focus_widget->window)
+ return FALSE;
+
+ /* TextArea peers are attached to the scrolled window
+ that contains the GtkTextView, not to the text view
+ itself. Same for List. */
+ if (GTK_IS_TEXT_VIEW (window->focus_widget)
+ || GTK_IS_CLIST (window->focus_widget))
+ {
+ obj_window = gtk_widget_get_parent (window->focus_widget)->window;
+ }
+ else if (GTK_IS_BUTTON (window->focus_widget))
+ /* GtkButton events go to the "event_window" and this is what
+ we registered when the button was created. */
+ obj_window = GTK_BUTTON (window->focus_widget)->event_window;
+ else
+ obj_window = window->focus_widget->window;
+
+ gdk_property_get (obj_window,
+ gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
+ gdk_atom_intern ("CARDINAL", FALSE),
+ 0,
+ sizeof (jobject),
+ FALSE,
+ NULL,
+ NULL,
+ NULL,
+ (guchar **)&focus_obj_ptr);
+
+ /* If the window has no jobject attached we can't send anything */
+ if (!focus_obj_ptr)
+ return FALSE;
+
+ /* Should we generate an AWT_KEY_TYPED event? */
+ generates_key_typed = generates_key_typed_event (event, window->focus_widget);
+ }
+
+ if (event->type == GDK_KEY_PRESS)
{
- GtkWidget *widget;
- GtkWindow *window;
- GdkWindow *obj_window;
-
- gdk_window_get_user_data (event->any.window, (void **) &widget);
-
- window = GTK_WINDOW (gtk_widget_get_ancestor (widget,
- GTK_TYPE_WINDOW));
- if (window
- && GTK_WIDGET_IS_SENSITIVE (window)
- && window->focus_widget
- && GTK_WIDGET_IS_SENSITIVE (window->focus_widget)
- && window->focus_widget->window)
- {
- gtk_widget_activate (window->focus_widget);
-
- if (GTK_IS_TEXT_VIEW (window->focus_widget))
- obj_window = gtk_widget_get_parent (window->focus_widget)->window;
- else
- obj_window = window->focus_widget->window;
-
- gdk_property_get (obj_window,
- gdk_atom_intern ("_GNU_GTKAWT_ADDR", FALSE),
- gdk_atom_intern ("CARDINAL", FALSE),
- 0,
- sizeof (jobject),
- FALSE,
- NULL,
- NULL,
- NULL,
- (guchar **)&grab_obj_ptr);
-
- (*gdk_env)->CallVoidMethod (gdk_env, *grab_obj_ptr,
- postKeyEventID,
- (jint) AWT_KEY_RELEASED,
- (jlong) event->key.time,
- keyevent_state_to_awt_mods (event),
- keysym_to_awt_keycode (event),
- keyevent_to_awt_keychar (event),
- keysym_to_awt_keylocation (event));
+ (*gdk_env)->CallVoidMethod (gdk_env, *focus_obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_PRESSED,
+ (jlong) event->key.time,
+ keyevent_state_to_awt_mods (event),
+ keysym_to_awt_keycode (event),
+ keyevent_to_awt_keychar (event),
+ keysym_to_awt_keylocation (event));
+
+ if (generates_key_typed)
+ {
+ (*gdk_env)->CallVoidMethod (gdk_env, *focus_obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_TYPED,
+ (jlong) event->key.time,
+ state_to_awt_mods (event->key.state),
+ VK_UNDEFINED,
+ keyevent_to_awt_keychar (event),
+ AWT_KEY_LOCATION_UNKNOWN);
}
}
- break;
- case GDK_FOCUS_CHANGE:
- (*gdk_env)->CallVoidMethod (gdk_env, *event_obj_ptr,
- postFocusEventID,
- (jint) (event->focus_change.in) ?
- AWT_FOCUS_GAINED : AWT_FOCUS_LOST,
- JNI_FALSE);
- break;
- default:
- break;
- }
- g_free (event_obj_ptr);
+ else /* GDK_KEY_RELEASE */
+ {
+ (*gdk_env)->CallVoidMethod (gdk_env, *focus_obj_ptr,
+ postKeyEventID,
+ (jint) AWT_KEY_RELEASED,
+ (jlong) event->key.time,
+ keyevent_state_to_awt_mods (event),
+ keysym_to_awt_keycode (event),
+ keyevent_to_awt_keychar (event),
+ keysym_to_awt_keylocation (event));
+ }
+ }
+ break;
+ default:
+ break;
}
-
- gtk_main_do_event (event);
+
+ return FALSE;
}
static void
@@ -1226,10 +1168,11 @@ connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...)
{
va_list ap;
jobject *obj;
+ //void *ptr = NSA_GET_PTR (env, peer_obj);
- obj = (jobject *) malloc (sizeof (jobject));
- *obj = (*env)->NewGlobalRef (env, peer_obj);
- //g_print("Connection obj %p\n", peer_obj);
+ obj = NSA_GET_GLOBAL_REF (env, peer_obj);
+ //g_print("Connection obj %s\n", gtk_widget_get_name (GTK_WIDGET (ptr)));
+ g_assert (obj);
va_start (ap, nwindows);
{
@@ -1237,9 +1180,9 @@ connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...)
for (i = 0; i < nwindows; i++)
{
GdkWindow* attach = (va_arg (ap, GdkWindow *));
- //g_print("attach peer obj %p and %p\n", peer_obj, attach);
attach_jobject(attach, obj);
}
}
va_end (ap);
}
+
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
index 2308d1100ed..47a08ae8eed 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkFileDialogPeer.c
@@ -49,23 +49,28 @@ Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_create
{
gpointer widget;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
widget = gtk_type_new (gtk_file_selection_get_type ());
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, widget);
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkFileDialogPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
- /* NOTE: we don't call the superclass connect method here. */
gtk_widget_realize (GTK_WIDGET (ptr));
+
connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
gdk_threads_leave ();
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
index 7bddc330ddb..0865f63160b 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkLabelPeer.c
@@ -41,15 +41,71 @@ exception statement from your version. */
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkLabelPeer_create
- (JNIEnv *env, jobject obj)
+ (JNIEnv *env, jobject obj, jstring text, jfloat xalign)
{
GtkWidget *label;
+ GtkWidget *ebox;
+ GtkContainer *ebox_container;
+ const char *str;
+
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
+ str = (*env)->GetStringUTFChars (env, text, 0);
+
+ gdk_threads_enter ();
+
+ ebox = gtk_event_box_new ();
+ ebox_container = GTK_CONTAINER (ebox);
+ label = gtk_label_new (str);
+ gtk_misc_set_alignment (GTK_MISC (label), xalign, 0.5);
+ gtk_container_add (ebox_container, label);
+ gtk_widget_show (label);
+
+ gdk_threads_leave ();
+
+ (*env)->ReleaseStringUTFChars (env, text, str);
+
+ NSA_SET_PTR (env, obj, ebox);
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkLabelPeer_setText
+ (JNIEnv *env, jobject obj, jstring text)
+{
+ const char *str;
+ void *ptr;
+ GtkWidget *label;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ str = (*env)->GetStringUTFChars (env, text, 0);
gdk_threads_enter ();
- label = gtk_label_new (NULL);
+ label = gtk_bin_get_child (GTK_BIN(ptr));
+
+ gtk_label_set_label (GTK_LABEL (label), str);
gdk_threads_leave ();
- NSA_SET_PTR (env, obj, label);
+ (*env)->ReleaseStringUTFChars (env, text, str);
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkLabelPeer_nativeSetAlignment
+ (JNIEnv *env, jobject obj, jfloat xalign)
+{
+ void *ptr;
+ GtkWidget *label;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ label = gtk_bin_get_child (GTK_BIN(ptr));
+
+ gtk_misc_set_alignment (GTK_MISC (label), xalign, 0.5);
+
+ gdk_threads_leave ();
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
index 944bc213945..ac6f389f8d8 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkListPeer.c
@@ -37,10 +37,18 @@ exception statement from your version. */
#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include "gnu_java_awt_peer_gtk_GtkListPeer.h"
-static void
-connect_selectable_hook (JNIEnv *env, jobject peer_obj, GtkCList *list);
+static void item_select (GtkCList *list __attribute__((unused)),
+ int row, int col __attribute__((unused)),
+ GdkEventButton *event __attribute__((unused)),
+ jobject peer_obj);
+static void item_unselect (GtkCList *list __attribute__((unused)),
+ int row,
+ int col __attribute__((unused)),
+ GdkEventButton *event __attribute__((unused)),
+ jobject peer_obj);
#define CLIST_FROM_SW(obj) (GTK_CLIST(GTK_SCROLLED_WINDOW (obj)->container.child))
@@ -50,7 +58,11 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_create
{
GtkWidget *list, *sw;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
list = gtk_clist_new (1);
gtk_widget_show (list);
sw = gtk_scrolled_window_new (NULL, NULL);
@@ -58,13 +70,14 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_create
GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (sw), list);
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, sw);
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkListPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr;
@@ -72,76 +85,61 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_connectHooks
ptr = NSA_GET_PTR (env, obj);
gdk_threads_enter ();
+
gtk_widget_realize (GTK_WIDGET (ptr));
- connect_selectable_hook (env, obj, CLIST_FROM_SW (ptr));
+
connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
+
gdk_threads_leave ();
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_append
- (JNIEnv *env, jobject obj, jobjectArray items)
+Java_gnu_java_awt_peer_gtk_GtkListPeer_connectSignals
+ (JNIEnv *env, jobject obj)
{
- void *ptr;
GtkCList *list;
- jint count, i;
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
- ptr = NSA_GET_PTR (env, obj);
+ gdk_threads_enter ();
- count = (*env)->GetArrayLength (env, items);
+ gtk_widget_realize (GTK_WIDGET (ptr));
- gdk_threads_enter ();
+ /* connect selectable hook */
+
list = CLIST_FROM_SW (ptr);
- for (i = 0; i < count; i++)
- {
- const char *text;
- jobject item;
- item = (*env)->GetObjectArrayElement (env, items, i);
+ g_signal_connect (G_OBJECT (list), "select_row",
+ GTK_SIGNAL_FUNC (item_select), *gref);
- text = (*env)->GetStringUTFChars (env, item, NULL);
- gtk_clist_append (list, (char **)&text);
- (*env)->ReleaseStringUTFChars (env, item, text);
- }
+ g_signal_connect (G_OBJECT (list), "unselect_row",
+ GTK_SIGNAL_FUNC (item_unselect), *gref);
+
+ /* Connect the superclass signals. */
+ /* FIXME: Cannot do that here or it will get the sw and not the list.
+ We must a generic way of doing this. */
+ /* Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, peer_obj); */
+ g_signal_connect (GTK_OBJECT (list), "event",
+ G_CALLBACK (pre_event_handler), *gref);
- gtk_clist_columns_autosize (list);
gdk_threads_leave ();
}
-
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkListPeer_old_create
- (JNIEnv *env, jobject obj, jobject parent_obj,
- jobjectArray items, jboolean mode)
+Java_gnu_java_awt_peer_gtk_GtkListPeer_append
+ (JNIEnv *env, jobject obj, jobjectArray items)
{
- GtkWidget *list, *sw, *parent;
- jsize count, i;
+ void *ptr;
+ GtkCList *list;
+ jint count, i;
- parent = NSA_GET_PTR (env, parent_obj);
+ ptr = NSA_GET_PTR (env, obj);
count = (*env)->GetArrayLength (env, items);
gdk_threads_enter ();
-
- list = gtk_clist_new (1);
- gtk_widget_show (list);
-
- sw = gtk_scrolled_window_new (NULL, NULL);
- set_parent (sw, GTK_CONTAINER (parent));
- gtk_widget_realize (sw);
-
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_AUTOMATIC);
- gtk_container_add (GTK_CONTAINER (sw), list);
-
- connect_selectable_hook (env, obj, GTK_CLIST (list));
- connect_awt_hook (env, obj, 1, list->window);
-
- gtk_clist_set_selection_mode (GTK_CLIST (list),
- mode ? GTK_SELECTION_MULTIPLE :
- GTK_SELECTION_SINGLE);
-
+ list = CLIST_FROM_SW (ptr);
for (i = 0; i < count; i++)
{
const char *text;
@@ -150,14 +148,12 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_old_create
item = (*env)->GetObjectArrayElement (env, items, i);
text = (*env)->GetStringUTFChars (env, item, NULL);
- gtk_clist_append (GTK_CLIST (list), (char **)&text);
+ gtk_clist_append (list, (char **)&text);
(*env)->ReleaseStringUTFChars (env, item, text);
}
- gtk_clist_columns_autosize (GTK_CLIST (list));
+ gtk_clist_columns_autosize (list);
gdk_threads_leave ();
-
- NSA_SET_PTR (env, obj, sw);
}
JNIEXPORT void JNICALL
@@ -192,12 +188,14 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_delItems
list = CLIST_FROM_SW (ptr);
if (end == -1) /* special case for removing all rows */
- end = list->rows;
-
- gtk_clist_freeze (list);
- for (i = start; i < end; i++)
- gtk_clist_remove (list, i);
- gtk_clist_thaw (list);
+ gtk_clist_clear (list);
+ else
+ {
+ gtk_clist_freeze (list);
+ for (i = end; i >= start; i--)
+ gtk_clist_remove (list, i);
+ gtk_clist_thaw (list);
+ }
gdk_threads_leave ();
}
@@ -228,7 +226,6 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_deselect
gdk_threads_leave ();
}
-/* FIXME: magic mojo (that doesn't seem to do anything) */
JNIEXPORT void JNICALL
Java_gnu_java_awt_peer_gtk_GtkListPeer_getSize
(JNIEnv *env, jobject obj, jint rows, jintArray jdims)
@@ -251,7 +248,7 @@ Java_gnu_java_awt_peer_gtk_GtkListPeer_getSize
list = GTK_WIDGET (CLIST_FROM_SW (ptr));
sw = GTK_SCROLLED_WINDOW (ptr);
- gtk_widget_size_request(list, &myreq);
+ gtk_widget_size_request(GTK_WIDGET(sw), &myreq);
dims[1]=myreq.height;
dims[0]=myreq.width;
@@ -325,9 +322,10 @@ static void
item_select (GtkCList *list __attribute__((unused)),
int row, int col __attribute__((unused)),
GdkEventButton *event __attribute__((unused)),
- jobject *peer_obj)
+ jobject peer_obj)
{
- (*gdk_env)->CallVoidMethod (gdk_env, *peer_obj,
+ //g_print ("select_row\n");
+ (*gdk_env)->CallVoidMethod (gdk_env, peer_obj,
postListItemEventID,
row,
(jint) AWT_ITEM_SELECTED);
@@ -338,25 +336,12 @@ item_unselect (GtkCList *list __attribute__((unused)),
int row,
int col __attribute__((unused)),
GdkEventButton *event __attribute__((unused)),
- jobject *peer_obj)
+ jobject peer_obj)
{
- (*gdk_env)->CallVoidMethod (gdk_env, *peer_obj,
+ //g_print ("unselect_row\n");
+ (*gdk_env)->CallVoidMethod (gdk_env, peer_obj,
postListItemEventID,
row,
(jint) AWT_ITEM_DESELECTED);
}
-static void
-connect_selectable_hook (JNIEnv *env, jobject peer_obj, GtkCList *list)
-{
- jobject *obj;
-
- obj = (jobject *) malloc (sizeof (jobject));
- *obj = (*env)->NewGlobalRef (env, peer_obj);
-
- gtk_signal_connect (GTK_OBJECT (list), "select_row",
- GTK_SIGNAL_FUNC (item_select), obj);
-
- gtk_signal_connect (GTK_OBJECT (list), "unselect_row",
- GTK_SIGNAL_FUNC (item_unselect), obj);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
index 5d144f8ec65..bad4a516884 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
@@ -42,6 +42,7 @@ exception statement from your version. */
#ifdef JVM_SUN
struct state_table *native_state_table;
+ struct state_table *native_global_ref_table;
#endif
jmethodID setBoundsCallbackID;
@@ -55,6 +56,7 @@ jmethodID postKeyEventID;
jmethodID postFocusEventID;
jmethodID postAdjustmentEventID;
jmethodID postItemEventID;
+jmethodID choicePostItemEventID;
jmethodID postListItemEventID;
jmethodID postTextEventID;
jmethodID postWindowEventID;
@@ -79,7 +81,7 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
char **argv;
char *homedir, *rcpath = NULL;
/* jclass gtkgenericpeer; */
- jclass gtkcomponentpeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
+ jclass gtkcomponentpeer, gtkchoicepeer, gtkwindowpeer, gtkscrollbarpeer, gtklistpeer,
gtkmenuitempeer, gtktextcomponentpeer, window;
NSA_INIT (env, clazz);
@@ -138,6 +140,8 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
gtkcomponentpeer = (*env)->FindClass (env,
"gnu/java/awt/peer/gtk/GtkComponentPeer");
+ gtkchoicepeer = (*env)->FindClass (env,
+ "gnu/java/awt/peer/gtk/GtkChoicePeer");
gtkwindowpeer = (*env)->FindClass (env,
"gnu/java/awt/peer/gtk/GtkWindowPeer");
gtkscrollbarpeer = (*env)->FindClass (env,
@@ -180,6 +184,9 @@ Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit (JNIEnv *env, jclass clazz)
postItemEventID = (*env)->GetMethodID (env, gtkcomponentpeer,
"postItemEvent",
"(Ljava/lang/Object;I)V");
+ choicePostItemEventID = (*env)->GetMethodID (env, gtkchoicepeer,
+ "choicePostItemEvent",
+ "(Ljava/lang/String;I)V");
postListItemEventID = (*env)->GetMethodID (env, gtklistpeer,
"postItemEvent",
"(II)V");
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
index 89818e05fb1..48509a5d341 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuBarPeer.c
@@ -44,9 +44,14 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuBarPeer_create
{
GtkWidget *widget;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
widget = gtk_menu_bar_new ();
gtk_widget_show (widget);
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, widget);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
index 10c9e4cab74..4984760f917 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuItemPeer.c
@@ -40,26 +40,35 @@ exception statement from your version. */
#include "gnu_java_awt_peer_gtk_GtkMenuItemPeer.h"
#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
-static void
-connect_activate_hook (JNIEnv *, jobject, GtkMenuItem *);
+static void item_activate (GtkMenuItem *item __attribute__((unused)),
+ jobject *peer_obj);
JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuItemPeer_create
(JNIEnv *env, jobject obj, jstring label)
{
GtkWidget *widget;
const char *str;
+ jobject *gref;
+
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+ gref = NSA_GET_GLOBAL_REF (env, obj);
str = (*env)->GetStringUTFChars (env, label, NULL);
gdk_threads_enter ();
-
+
if (strcmp (str, "-") == 0) /* "-" signals that we need a separator */
widget = gtk_menu_item_new ();
else
widget = gtk_menu_item_new_with_label (str);
- connect_activate_hook (env, obj, GTK_MENU_ITEM (widget));
+ /* Connect activate hook */
+ g_signal_connect (G_OBJECT (widget), "activate",
+ GTK_SIGNAL_FUNC (item_activate), *gref);
+
gtk_widget_show (widget);
+
gdk_threads_leave ();
(*env)->ReleaseStringUTFChars (env, label, str);
@@ -101,14 +110,3 @@ item_activate (GtkMenuItem *item __attribute__((unused)), jobject *peer_obj)
postMenuActionEventID);
}
-static void
-connect_activate_hook (JNIEnv *env, jobject peer_obj, GtkMenuItem *item)
-{
- jobject *obj;
-
- obj = (jobject *) malloc (sizeof (jobject));
- *obj = (*env)->NewGlobalRef (env, peer_obj);
-
- gtk_signal_connect (GTK_OBJECT (item), "activate",
- GTK_SIGNAL_FUNC (item_activate), obj);
-}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
index e8cd78cb11d..63e6a740158 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMenuPeer.c
@@ -66,7 +66,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_setupAccelGroup
if (GTK_WIDGET_REALIZED (GTK_WIDGET (ptr1)))
accel_attach (GTK_MENU_ITEM (ptr1), NULL);
else
- gtk_signal_connect (GTK_OBJECT (ptr1),
+ g_signal_connect (G_OBJECT (ptr1),
"realize",
GTK_SIGNAL_FUNC (accel_attach),
NULL);
@@ -92,9 +92,13 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create
GtkWidget *menu_title, *menu;
const char *str;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
str = (*env)->GetStringUTFChars (env, label, NULL);
gdk_threads_enter ();
+
menu = gtk_menu_new ();
menu_title = gtk_menu_item_new_with_label (str);
@@ -104,6 +108,7 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkMenuPeer_create
gtk_widget_show (menu_title);
NSA_SET_PTR (env, obj, menu_title);
+
gdk_threads_leave ();
(*env)->ReleaseStringUTFChars (env, label, str);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
index 5d389895456..62fff4d8afe 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkPanelPeer.c
@@ -37,6 +37,7 @@ exception statement from your version. */
#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include "gnu_java_awt_peer_gtk_GtkPanelPeer.h"
JNIEXPORT void JNICALL
@@ -45,8 +46,13 @@ Java_gnu_java_awt_peer_gtk_GtkPanelPeer_create
{
gpointer widget;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
widget = gtk_layout_new (NULL, NULL);
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, widget);
@@ -61,7 +67,7 @@ struct _GtkLayoutChild {
};
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr;
@@ -72,11 +78,31 @@ Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectHooks
gtk_widget_realize (GTK_WIDGET (ptr));
connect_awt_hook (env, obj, 1, GTK_LAYOUT (ptr)->bin_window);
-/* gtk_signal_connect (GTK_OBJECT (ptr), "size_request", GTK_SIGNAL_FUNC (sr), */
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkPanelPeer_connectSignals
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
+
+ gdk_threads_enter ();
+ gtk_widget_realize (GTK_WIDGET (ptr));
+
+ /* FIXME: If we don't need this then remove this method. */
+/* g_signal_connect (G_OBJECT (ptr), "size_request", GTK_SIGNAL_FUNC (sr), */
/* NULL); */
gdk_threads_leave ();
+
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
}
+/* FIXME: The following doesn't seem to be used.
+ Is not declared as a native function in GtkPanelPeer.java */
/*
* Make a new panel.
*/
@@ -87,19 +113,26 @@ Java_gnu_java_awt_peer_gtk_GtkPanelPeer_gtkPanelNew
GtkWidget *layout;
void *parent;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
parent = NSA_GET_PTR (env, parent_obj);
gdk_threads_enter ();
+
layout = gtk_layout_new (NULL, NULL);
set_parent (layout, GTK_CONTAINER (parent));
gtk_widget_realize (layout);
+
connect_awt_hook (env, obj, 1, GTK_LAYOUT (layout)->bin_window);
+
set_visible (layout, 1);
- NSA_SET_PTR (env, obj, layout);
gdk_threads_leave ();
+
+ NSA_SET_PTR (env, obj, layout);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
index 2bd3df8cf35..be7e2d0a4e2 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollBarPeer.c
@@ -37,6 +37,7 @@ exception statement from your version. */
#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include "gnu_java_awt_peer_gtk_GtkScrollbarPeer.h"
struct range_scrollbar
@@ -107,46 +108,70 @@ Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_create
GtkWidget *sb;
GtkObject *adj;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
adj = gtk_adjustment_new (value, min, max,
step_incr, page_incr,
visible_amount);
sb = (orientation) ? gtk_vscrollbar_new (GTK_ADJUSTMENT (adj)) :
gtk_hscrollbar_new (GTK_ADJUSTMENT (adj));
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, sb);
}
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr;
+
+ ptr = NSA_GET_PTR (env, obj);
+
+ gdk_threads_enter ();
+
+ gtk_widget_realize (GTK_WIDGET (ptr));
+
+ connect_awt_hook (env, obj, 1, GTK_SCROLLBAR (ptr)->range);
+
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkScrollbarPeer_connectSignals
+ (JNIEnv *env, jobject obj)
+{
struct range_scrollbar *rs;
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
rs = (struct range_scrollbar *) malloc (sizeof (struct range_scrollbar));
- ptr = NSA_GET_PTR (env, obj);
-
gdk_threads_enter ();
+
gtk_widget_realize (GTK_WIDGET (ptr));
rs->range = GTK_RANGE (ptr);
- rs->scrollbar = (jobject *) malloc (sizeof (jobject));
- *(rs->scrollbar) = (*env)->NewGlobalRef (env, obj);
- gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)),
+ rs->scrollbar = gref;
+
+ g_signal_connect (G_OBJECT (GTK_RANGE (ptr)),
"move-slider",
GTK_SIGNAL_FUNC (post_adjustment_event), rs);
- gtk_signal_connect (GTK_OBJECT (GTK_RANGE (ptr)),
+ g_signal_connect (G_OBJECT (GTK_RANGE (ptr)),
"value-changed",
GTK_SIGNAL_FUNC (post_change_event), rs);
-
- connect_awt_hook (env, obj, 1, GTK_SCROLLBAR (ptr)->range);
gdk_threads_leave ();
+
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
}
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
index 08ae7e5cf63..516797e7eb4 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkScrollPanePeer.c
@@ -45,8 +45,13 @@ Java_gnu_java_awt_peer_gtk_GtkScrollPanePeer_create
{
gpointer window;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
window = gtk_scrolled_window_new (NULL, NULL);
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, window);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
index 2964dc37701..71a789ed37f 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextAreaPeer.c
@@ -1,5 +1,5 @@
/* gtktextareapeer.c -- Native implementation of GtkTextAreaPeer
- Copyright (C) 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2003 Free Software Foundation, Inc.
This file is part of GNU Classpath.
@@ -46,8 +46,11 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create
{
GtkWidget *text, *sw;
- gdk_threads_enter ();
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+ gdk_threads_enter ();
+
text = gtk_text_view_new ();
gtk_widget_show (text);
@@ -64,6 +67,11 @@ Java_gnu_java_awt_peer_gtk_GtkTextAreaPeer_create
|| scroll == AWT_TEXTAREA_SCROLLBARS_VERTICAL_ONLY) ?
GTK_POLICY_ALWAYS : GTK_POLICY_NEVER);
+ gtk_text_view_set_wrap_mode (GTK_TEXT_VIEW (text),
+ (scroll == AWT_TEXTAREA_SCROLLBARS_BOTH
+ || scroll == AWT_TEXTAREA_SCROLLBARS_HORIZONTAL_ONLY)
+ ? GTK_WRAP_NONE : GTK_WRAP_WORD);
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, sw);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
index 95e114ebd10..2ec87f012ea 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextComponentPeer.c
@@ -48,24 +48,29 @@ static void textcomponent_changed_cb (GtkEditable *editable,
jobject peer);
JNIEXPORT void JNICALL
-Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectHooks
+Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectSignals
(JNIEnv *env, jobject obj)
{
- void *ptr;
GtkTextView *text = NULL;
GtkTextBuffer *buf;
-
- ptr = NSA_GET_PTR (env, obj);
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
gdk_threads_enter ();
if (GTK_IS_ENTRY(ptr))
{
g_signal_connect (GTK_ENTRY (ptr)->im_context, "commit",
- G_CALLBACK (textcomponent_commit_cb), obj);
+ G_CALLBACK (textcomponent_commit_cb), *gref);
g_signal_connect (GTK_EDITABLE (ptr), "changed",
- G_CALLBACK (textcomponent_changed_cb), obj);
+ G_CALLBACK (textcomponent_changed_cb), *gref);
+
+ gdk_threads_leave ();
+
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, *gref);
}
else
{
@@ -81,19 +86,24 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_connectHooks
if (text)
{
g_signal_connect (text->im_context, "commit",
- G_CALLBACK (textcomponent_commit_cb), obj);
+ G_CALLBACK (textcomponent_commit_cb), *gref);
buf = gtk_text_view_get_buffer (text);
if (buf)
g_signal_connect (buf, "changed",
- G_CALLBACK (textcomponent_changed_cb), obj);
- }
- }
+ G_CALLBACK (textcomponent_changed_cb), *gref);
- gdk_threads_leave ();
+ /* Connect the superclass signals. */
+ /* FIXME: Cannot do that here or it will get the sw and not the list.
+ We must a generic way of doing this. */
+ /* Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env,
+ obj); */
+ g_signal_connect (GTK_OBJECT (text), "event",
+ G_CALLBACK (pre_event_handler), *gref);
- /* Connect the superclass hooks. */
- Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectHooks (env, obj);
+ gdk_threads_leave ();
+ }
+ }
}
JNIEXPORT jint JNICALL
@@ -101,7 +111,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getCaretPosition
(JNIEnv *env, jobject obj)
{
void *ptr;
- int pos;
+ int pos = 0;
GtkEditable *editable; // type of GtkEntry (TextField)
GtkWidget *text = NULL; // type of GtkTextView (TextArea)
GtkTextBuffer *buf;
@@ -187,13 +197,15 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart
(JNIEnv *env, jobject obj)
{
void *ptr;
- int pos;
+ int pos = 0;
GtkEditable *editable; // type of GtkEntry (TextField)
GtkWidget *text = NULL; // type of GtkTextView (TextArea)
GtkTextBuffer *buf;
GtkTextIter start;
GtkTextIter end;
int starti, endi;
+ GtkTextMark *mark;
+ GtkTextIter iter;
ptr = NSA_GET_PTR (env, obj);
@@ -204,6 +216,8 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart
editable = GTK_EDITABLE (ptr);
if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
pos = starti;
+ else
+ pos = gtk_editable_get_position (editable);
}
else
{
@@ -221,6 +235,12 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionStart
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
pos = gtk_text_iter_get_offset (&start);
+ else
+ {
+ mark = gtk_text_buffer_get_insert (buf);
+ gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
+ pos = gtk_text_iter_get_offset (&iter);
+ }
}
}
@@ -234,13 +254,15 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd
(JNIEnv *env, jobject obj)
{
void *ptr;
- int pos;
+ int pos = 0;
GtkEditable *editable; // type of GtkEntry (TextField)
GtkWidget *text = NULL; // type of GtkTextView (TextArea)
GtkTextBuffer *buf;
GtkTextIter start;
GtkTextIter end;
int starti, endi;
+ GtkTextMark *mark;
+ GtkTextIter iter;
ptr = NSA_GET_PTR (env, obj);
@@ -251,6 +273,8 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd
editable = GTK_EDITABLE (ptr);
if (gtk_editable_get_selection_bounds (editable, &starti, &endi))
pos = endi;
+ else
+ pos = gtk_editable_get_position (editable);
}
else
{
@@ -268,6 +292,12 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getSelectionEnd
buf = gtk_text_view_get_buffer (GTK_TEXT_VIEW (text));
if (gtk_text_buffer_get_selection_bounds(buf, &start, &end))
pos = gtk_text_iter_get_offset (&end);
+ else
+ {
+ mark = gtk_text_buffer_get_insert (buf);
+ gtk_text_buffer_get_iter_at_mark (buf, &iter, mark);
+ pos = gtk_text_iter_get_offset (&iter);
+ }
}
}
@@ -364,7 +394,7 @@ Java_gnu_java_awt_peer_gtk_GtkTextComponentPeer_getText
(JNIEnv *env, jobject obj)
{
void *ptr;
- char *contents;
+ char *contents = NULL;
jstring jcontents;
GtkEditable *editable; // type of GtkEntry (TextField)
GtkWidget *text = NULL; // type of GtkTextView (TextArea)
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
index a7bbb02f8a9..5379635b88b 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkTextFieldPeer.c
@@ -45,8 +45,13 @@ Java_gnu_java_awt_peer_gtk_GtkTextFieldPeer_create
{
GtkWidget *widget;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
widget = gtk_entry_new ();
+
gdk_threads_leave ();
NSA_SET_PTR (env, obj, widget);
diff --git a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
index d71f36a4298..022677b06a9 100644
--- a/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
+++ b/libjava/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkWindowPeer.c
@@ -37,6 +37,7 @@ exception statement from your version. */
#include "gtkpeer.h"
+#include "gnu_java_awt_peer_gtk_GtkComponentPeer.h"
#include "gnu_java_awt_peer_gtk_GtkWindowPeer.h"
#include "gnu_java_awt_peer_gtk_GtkFramePeer.h"
#include <gdk/gdkprivate.h>
@@ -73,7 +74,11 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
void *window_parent;
GtkWidget *vbox, *layout;
+ /* Create global reference and save it for future use */
+ NSA_SET_GLOBAL_REF (env, obj);
+
gdk_threads_enter ();
+
window_widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
window = GTK_WINDOW (window_widget);
@@ -116,7 +121,8 @@ Java_gnu_java_awt_peer_gtk_GtkWindowPeer_create
NSA_SET_PTR (env, obj, window_widget);
}
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetVisible
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetVisible
(JNIEnv *env, jobject obj, jboolean visible)
{
void *ptr;
@@ -135,7 +141,8 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_nativeSetVisible
gdk_threads_leave ();
}
-JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectHooks
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectJObject
(JNIEnv *env, jobject obj)
{
void *ptr;
@@ -169,26 +176,44 @@ JNIEXPORT void JNICALL Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectHooks
connect_awt_hook (env, obj, 1, GTK_WIDGET (ptr)->window);
+ gdk_threads_leave ();
+}
+
+JNIEXPORT void JNICALL
+Java_gnu_java_awt_peer_gtk_GtkWindowPeer_connectSignals
+ (JNIEnv *env, jobject obj)
+{
+ void *ptr = NSA_GET_PTR (env, obj);
+ jobject *gref = NSA_GET_GLOBAL_REF (env, obj);
+ g_assert (gref);
+
+ gdk_threads_enter ();
+
+ gtk_widget_realize (ptr);
+
/* Connect signals for window event support. */
g_signal_connect (G_OBJECT (ptr), "delete-event",
- G_CALLBACK (window_delete_cb), obj);
+ G_CALLBACK (window_delete_cb), *gref);
g_signal_connect (G_OBJECT (ptr), "destroy-event",
- G_CALLBACK (window_destroy_cb), obj);
+ G_CALLBACK (window_destroy_cb), *gref);
g_signal_connect (G_OBJECT (ptr), "show",
- G_CALLBACK (window_show_cb), obj);
+ G_CALLBACK (window_show_cb), *gref);
g_signal_connect (G_OBJECT (ptr), "focus-in-event",
- G_CALLBACK (window_focus_in_cb), obj);
+ G_CALLBACK (window_focus_in_cb), *gref);
g_signal_connect (G_OBJECT (ptr), "focus-out-event",
- G_CALLBACK (window_focus_out_cb), obj);
+ G_CALLBACK (window_focus_out_cb), *gref);
g_signal_connect (G_OBJECT (ptr), "window-state-event",
- G_CALLBACK (window_window_state_cb), obj);
+ G_CALLBACK (window_window_state_cb), *gref);
gdk_threads_leave ();
+
+ /* Connect the superclass signals. */
+ Java_gnu_java_awt_peer_gtk_GtkComponentPeer_connectSignals (env, obj);
}
/*
diff --git a/libjava/jni/gtk-peer/gtkpeer.h b/libjava/jni/gtk-peer/gtkpeer.h
index 8f8ec40c08c..d552e687c9b 100644
--- a/libjava/jni/gtk-peer/gtkpeer.h
+++ b/libjava/jni/gtk-peer/gtkpeer.h
@@ -61,9 +61,11 @@ exception statement from your version. */
#ifdef JVM_SUN
extern struct state_table *native_state_table;
+extern struct state_table *native_global_ref_table;
#define NSA_INIT(env, clazz) \
- native_state_table = init_state_table (env, clazz)
+ do {native_state_table = init_state_table (env, clazz); \
+ native_global_ref_table = init_state_table (env, clazz);} while (0)
#define NSA_GET_PTR(env, obj) \
get_state (env, obj, native_state_table)
@@ -74,6 +76,21 @@ extern struct state_table *native_state_table;
#define NSA_DEL_PTR(env, obj) \
remove_state_slot (env, obj, native_state_table)
+#define NSA_GET_GLOBAL_REF(env, obj) \
+ get_state (env, obj, native_global_ref_table)
+
+#define NSA_SET_GLOBAL_REF(env, obj) \
+ do {jobject *globRefPtr; \
+ globRefPtr = (jobject *) malloc (sizeof (jobject)); \
+ *globRefPtr = (*env)->NewGlobalRef (env, obj); \
+ set_state (env, obj, native_global_ref_table, (void *)globRefPtr);} while (0)
+
+#define NSA_DEL_GLOBAL_REF(env, obj) \
+ do {jobject *globRefPtr = get_state (env, obj, native_global_ref_table); \
+ remove_state_slot (env, obj, native_global_ref_table); \
+ (*env)->DeleteGlobalRef (env, *globRefPtr); \
+ free (globRefPtr);} while (0)
+
#endif /* JVM_SUN */
struct graphics
@@ -378,6 +395,7 @@ extern jmethodID postExposeEventID;
extern jmethodID postKeyEventID;
extern jmethodID postFocusEventID;
extern jmethodID postAdjustmentEventID;
+extern jmethodID choicePostItemEventID;
extern jmethodID postItemEventID;
extern jmethodID postListItemEventID;
extern jmethodID postTextEventID;
@@ -392,6 +410,10 @@ extern GtkWindowGroup *global_gtk_window_group;
void awt_event_handler (GdkEvent *event);
+gboolean pre_event_handler (GtkWidget *widget,
+ GdkEvent *event,
+ jobject peer);
+
void connect_awt_hook (JNIEnv *env, jobject peer_obj, int nwindows, ...);
void set_visible (GtkWidget *widget, jboolean visible);
@@ -403,7 +425,7 @@ jint keyevent_state_to_awt_mods (GdkEvent *event);
struct item_event_hook_info
{
jobject peer_obj;
- jobject item_obj;
+ const char *label;
};
#endif /* __GTKPEER_H */
diff --git a/libjava/libltdl/.cvsignore b/libjava/libltdl/.cvsignore
index 5202674d0f4..1793f837f1d 100644
--- a/libjava/libltdl/.cvsignore
+++ b/libjava/libltdl/.cvsignore
@@ -8,3 +8,4 @@ libtool
*.lo
*.la
stamp-h
+autom4te.cache
diff --git a/libjava/libltdl/Makefile.am b/libjava/libltdl/Makefile.am
index 78500297830..7b7f0006bcd 100644
--- a/libjava/libltdl/Makefile.am
+++ b/libjava/libltdl/Makefile.am
@@ -15,8 +15,12 @@ if CONVENIENCE_LTDL
noinst_LTLIBRARIES = libltdlc.la
endif
+## Make sure these will be cleaned even when they're not built by
+## default.
+CLEANFILES = libltdl.la libltdlc.la
+
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
+libltdl_la_LDFLAGS = -no-undefined -version-info 4:0:1
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
@@ -25,7 +29,7 @@ libltdlc_la_LIBADD = $(LIBADD_DL)
## Because we do not have automatic dependency tracking:
ltdl.lo: ltdl.h config.h
-$(OBJECTS): libtool
+$(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
diff --git a/libjava/libltdl/Makefile.in b/libjava/libltdl/Makefile.in
index 9fd9ebf882b..5f5cc4d03c3 100644
--- a/libjava/libltdl/Makefile.in
+++ b/libjava/libltdl/Makefile.in
@@ -1,6 +1,8 @@
-# Makefile.in generated automatically by automake 1.4 from Makefile.am
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
+# @configure_input@
-# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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,245 +12,286 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
-
-SHELL = @SHELL@
+@SET_MAKE@
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@
-
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
-
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
-host_alias = @host_alias@
host_triplet = @host@
+ACLOCAL = @ACLOCAL@
+AMDEP_FALSE = @AMDEP_FALSE@
+AMDEP_TRUE = @AMDEP_TRUE@
+AMTAR = @AMTAR@
+AR = @AR@
AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CONVENIENCE_LTDL_FALSE = @CONVENIENCE_LTDL_FALSE@
+CONVENIENCE_LTDL_TRUE = @CONVENIENCE_LTDL_TRUE@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
DLLTOOL = @DLLTOOL@
+ECHO = @ECHO@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
EXEEXT = @EXEEXT@
-GCINCS = @GCINCS@
-GCJ = @GCJ@
-GCJFLAGS = @GCJFLAGS@
+F77 = @F77@
+FFLAGS = @FFLAGS@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_LTDL_FALSE = @INSTALL_LTDL_FALSE@
+INSTALL_LTDL_TRUE = @INSTALL_LTDL_TRUE@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+LDFLAGS = @LDFLAGS@
LIBADD_DL = @LIBADD_DL@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBTOOL_DEPS = @LIBTOOL_DEPS@
LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
+MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
+MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
RANLIB = @RANLIB@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
-mkinstalldirs = @mkinstalldirs@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_AS = @ac_ct_AS@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DLLTOOL = @ac_ct_DLLTOOL@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_OBJDUMP = @ac_ct_OBJDUMP@
+ac_ct_RANLIB = @ac_ct_RANLIB@
+ac_ct_STRIP = @ac_ct_STRIP@
+am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
+am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
+am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
+am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+datadir = @datadir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+oldincludedir = @oldincludedir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
AUTOMAKE_OPTIONS = no-dependencies foreign
INCLUDES = $(GCINCS)
-@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
+@INSTALL_LTDL_TRUE@include_HEADERS = ltdl.h
+@INSTALL_LTDL_TRUE@lib_LTLIBRARIES = libltdl.la
+@INSTALL_LTDL_FALSE@noinst_HEADERS = ltdl.h
+
+@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = libltdlc.la
-@CONVENIENCE_LTDL_TRUE@noinst_LTLIBRARIES = \
-@CONVENIENCE_LTDL_TRUE@libltdlc.la
+CLEANFILES = libltdl.la libltdlc.la
libltdl_la_SOURCES = ltdl.c
-libltdl_la_LDFLAGS = -no-undefined -version-info 2:0:2
+libltdl_la_LDFLAGS = -no-undefined -version-info 4:0:1
libltdl_la_LIBADD = $(LIBADD_DL)
libltdlc_la_SOURCES = ltdl.c
libltdlc_la_LIBADD = $(LIBADD_DL)
+subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES =
-LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
-
-
-DEFS = @DEFS@ -I. -I$(srcdir) -I.
-CPPFLAGS = @CPPFLAGS@
-LDFLAGS = @LDFLAGS@
-LIBS = @LIBS@
-libltdl_la_DEPENDENCIES =
-libltdl_la_OBJECTS = ltdl.lo
-libltdlc_la_LDFLAGS =
-libltdlc_la_DEPENDENCIES =
-libltdlc_la_OBJECTS = ltdl.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)
+CONFIG_CLEAN_FILES =
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+
+libltdl_la_DEPENDENCIES =
+am_libltdl_la_OBJECTS = ltdl.lo
+libltdl_la_OBJECTS = $(am_libltdl_la_OBJECTS)
+libltdlc_la_LDFLAGS =
+libltdlc_la_DEPENDENCIES =
+am_libltdlc_la_OBJECTS = ltdl.lo
+libltdlc_la_OBJECTS = $(am_libltdlc_la_OBJECTS)
+
+DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
+depcomp =
+am__depfiles_maybe =
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) \
+ $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
CCLD = $(CC)
-LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
-HEADERS = $(include_HEADERS) $(noinst_HEADERS)
-
-DIST_COMMON = README ./stamp-h.in COPYING.LIB ChangeLog Makefile.am \
-Makefile.in acconfig.h acinclude.m4 aclocal.m4 config.h.in configure \
-configure.in
-
-
-DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
-
-TAR = tar
-GZIP_ENV = --best
+LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+DIST_SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES)
+HEADERS = $(include_HEADERS) $(noinst_HEADERS)
+
+DIST_COMMON = README $(include_HEADERS) $(noinst_HEADERS) \
+ $(srcdir)/Makefile.in $(srcdir)/configure COPYING.LIB ChangeLog \
+ Makefile.am acinclude.m4 aclocal.m4 config-h.in config.guess \
+ config.sub configure configure.ac install-sh ltmain.sh missing \
+ mkinstalldirs
SOURCES = $(libltdl_la_SOURCES) $(libltdlc_la_SOURCES)
-OBJECTS = $(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS)
-all: all-redirect
-.SUFFIXES:
-.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) --foreign Makefile
+all: config.h
+ $(MAKE) $(AM_MAKEFLAGS) all-am
-Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
-$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in acinclude.m4
- cd $(srcdir) && $(ACLOCAL)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && \
+ $(AUTOMAKE) --foreign Makefile
+Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status
+ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
-config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+$(srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(srcdir)/configure.ac $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
-config.h: stamp-h
- @if test ! -f $@; then \
- rm -f stamp-h; \
- $(MAKE) stamp-h; \
- else :; fi
-stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
- cd $(top_builddir) \
- && CONFIG_FILES= CONFIG_HEADERS=config.h \
- $(SHELL) ./config.status
- @echo timestamp > stamp-h 2> /dev/null
-$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.ac acinclude.m4
+ cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+
+config.h: stamp-h1
@if test ! -f $@; then \
- rm -f $(srcdir)/stamp-h.in; \
- $(MAKE) $(srcdir)/stamp-h.in; \
+ rm -f stamp-h1; \
+ $(MAKE) stamp-h1; \
else :; fi
-$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
- cd $(top_srcdir) && $(AUTOHEADER)
- @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
-mostlyclean-hdr:
+stamp-h1: $(srcdir)/config-h.in $(top_builddir)/config.status
+ @rm -f stamp-h1
+ cd $(top_builddir) && $(SHELL) ./config.status config.h
-clean-hdr:
+$(srcdir)/config-h.in: @MAINTAINER_MODE_TRUE@ $(top_srcdir)/configure.ac $(ACLOCAL_M4)
+ cd $(top_srcdir) && $(AUTOHEADER)
+ touch $(srcdir)/config-h.in
distclean-hdr:
- -rm -f config.h
-
-maintainer-clean-hdr:
-
-mostlyclean-libLTLIBRARIES:
-
-clean-libLTLIBRARIES:
- -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
-
-distclean-libLTLIBRARIES:
-
-maintainer-clean-libLTLIBRARIES:
-
+ -rm -f config.h stamp-h1
+libLTLIBRARIES_INSTALL = $(INSTALL)
install-libLTLIBRARIES: $(lib_LTLIBRARIES)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(libdir)
@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
if test -f $$p; then \
- echo "$(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p"; \
- $(LIBTOOL) --mode=install $(INSTALL) $$p $(DESTDIR)$(libdir)/$$p; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f"; \
+ $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) $$p $(DESTDIR)$(libdir)/$$f; \
else :; fi; \
done
uninstall-libLTLIBRARIES:
@$(NORMAL_UNINSTALL)
- list='$(lib_LTLIBRARIES)'; for p in $$list; do \
- $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ p="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p"; \
+ $(LIBTOOL) --mode=uninstall rm -f $(DESTDIR)$(libdir)/$$p; \
done
-mostlyclean-noinstLTLIBRARIES:
+clean-libLTLIBRARIES:
+ -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+ @list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" = "$$p" && dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
clean-noinstLTLIBRARIES:
-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
-
-distclean-noinstLTLIBRARIES:
-
-maintainer-clean-noinstLTLIBRARIES:
-
-.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 $<
-
-.S.o:
- $(COMPILE) -c $<
+ @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+ test "$$dir" = "$$p" && dir=.; \
+ echo "rm -f \"$${dir}/so_locations\""; \
+ rm -f "$${dir}/so_locations"; \
+ done
+libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES)
+ $(LINK) -rpath $(libdir) $(libltdl_la_LDFLAGS) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS)
+libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES)
+ $(LINK) $(libltdlc_la_LDFLAGS) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS)
mostlyclean-compile:
- -rm -f *.o core *.core
- -rm -f *.$(OBJEXT)
-
-clean-compile:
+ -rm -f *.$(OBJEXT) core *.core
distclean-compile:
-rm -f *.tab.c
-maintainer-clean-compile:
-
-.c.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.o:
+ $(COMPILE) -c `test -f '$<' || echo '$(srcdir)/'`$<
-.s.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.obj:
+ $(COMPILE) -c `if test -f '$<'; then $(CYGPATH_W) '$<'; else $(CYGPATH_W) '$(srcdir)/$<'; fi`
-.S.lo:
- $(LIBTOOL) --mode=compile $(COMPILE) -c $<
+.c.lo:
+ $(LTCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$<
mostlyclean-libtool:
-rm -f *.lo
@@ -257,201 +300,293 @@ clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-
-maintainer-clean-libtool:
-
-libltdl.la: $(libltdl_la_OBJECTS) $(libltdl_la_DEPENDENCIES)
- $(LINK) -rpath $(libdir) $(libltdl_la_LDFLAGS) $(libltdl_la_OBJECTS) $(libltdl_la_LIBADD) $(LIBS)
-
-libltdlc.la: $(libltdlc_la_OBJECTS) $(libltdlc_la_DEPENDENCIES)
- $(LINK) $(libltdlc_la_LDFLAGS) $(libltdlc_la_OBJECTS) $(libltdlc_la_LIBADD) $(LIBS)
-
+ -rm -f libtool
+uninstall-info-am:
+includeHEADERS_INSTALL = $(INSTALL_HEADER)
install-includeHEADERS: $(include_HEADERS)
@$(NORMAL_INSTALL)
$(mkinstalldirs) $(DESTDIR)$(includedir)
@list='$(include_HEADERS)'; for p in $$list; do \
- if test -f "$$p"; then d= ; else d="$(srcdir)/"; fi; \
- echo " $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p"; \
- $(INSTALL_DATA) $$d$$p $(DESTDIR)$(includedir)/$$p; \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f"; \
+ $(includeHEADERS_INSTALL) $$d$$p $(DESTDIR)$(includedir)/$$f; \
done
uninstall-includeHEADERS:
@$(NORMAL_UNINSTALL)
- list='$(include_HEADERS)'; for p in $$list; do \
- rm -f $(DESTDIR)$(includedir)/$$p; \
+ @list='$(include_HEADERS)'; for p in $$list; do \
+ f="`echo $$p | sed -e 's|^.*/||'`"; \
+ echo " rm -f $(DESTDIR)$(includedir)/$$f"; \
+ rm -f $(DESTDIR)$(includedir)/$$f; \
done
+ETAGS = etags
+ETAGSFLAGS =
+
+CTAGS = ctags
+CTAGSFLAGS =
+
tags: TAGS
-ID: $(HEADERS) $(SOURCES) $(LISP)
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+ list='$(SOURCES) $(HEADERS) $(LISP) $(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; } \
END { for (i in files) print i; }'`; \
- here=`pwd` && cd $(srcdir) \
- && mkid -f$$here/ID $$unique $(LISP)
+ mkid -fID $$unique
-TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+TAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS)'; \
- unique=`for i in $$list; do echo $$i; done | \
- awk ' { files[$$0] = 1; } \
+ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(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; } \
END { for (i in files) print i; }'`; \
- test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
- || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+ test -z "$(ETAGS_ARGS)$$tags$$unique" \
+ || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+ $$tags $$unique
-mostlyclean-tags:
+ctags: CTAGS
+CTAGS: $(HEADERS) $(SOURCES) config-h.in $(TAGS_DEPENDENCIES) \
+ $(TAGS_FILES) $(LISP)
+ tags=; \
+ here=`pwd`; \
+ list='$(SOURCES) $(HEADERS) config-h.in $(LISP) $(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; } \
+ END { for (i in files) print i; }'`; \
+ test -z "$(CTAGS_ARGS)$$tags$$unique" \
+ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+ $$tags $$unique
-clean-tags:
+GTAGS:
+ here=`$(am__cd) $(top_builddir) && pwd` \
+ && cd $(top_srcdir) \
+ && gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
- -rm -f TAGS ID
-
-maintainer-clean-tags:
+ -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
-top_distdir = $(distdir)
+
+am__remove_distdir = \
+ { test ! -d $(distdir) \
+ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -fr $(distdir); }; }
+
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+distcleancheck_listfiles = find . -type f -print
+
+distdir: $(DISTFILES)
+ $(am__remove_distdir)
+ mkdir $(distdir)
+ @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
+ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
+ list='$(DISTFILES)'; for file in $$list; do \
+ case $$file in \
+ $(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
+ $(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
+ esac; \
+ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+ dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+ if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
+ fi; \
+ if test -d $$d/$$file; then \
+ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
+ fi; \
+ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
+ else \
+ test -f $(distdir)/$$file \
+ || cp -p $$d/$$file $(distdir)/$$file \
+ || exit 1; \
+ fi; \
+ done
+ -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)
+dist-gzip: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_distdir)
+
+dist dist-all: distdir
+ $(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+ $(am__remove_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
- -rm -rf $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
- mkdir $(distdir)/=build
- mkdir $(distdir)/=inst
- dc_install_base=`cd $(distdir)/=inst && pwd`; \
- cd $(distdir)/=build \
- && ../configure --srcdir=.. --prefix=$$dc_install_base \
+ $(am__remove_distdir)
+ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+ chmod -R a-w $(distdir); chmod a+w $(distdir)
+ mkdir $(distdir)/_build
+ mkdir $(distdir)/_inst
+ chmod a-w $(distdir)
+ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+ && cd $(distdir)/_build \
+ && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
- && $(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
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-dist-all: distdir
- -chmod -R a+r $(distdir)
- GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
- -rm -rf $(distdir)
-distdir: $(DISTFILES)
- -rm -rf $(distdir)
- mkdir $(distdir)
- -chmod 777 $(distdir)
- @for file in $(DISTFILES); do \
- d=$(srcdir); \
- if test -d $$d/$$file; then \
- cp -pr $$/$$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
+ && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+ distuninstallcheck \
+ && chmod -R a-w "$$dc_install_base" \
+ && ({ \
+ (cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+ } || { rm -rf "$$dc_destdir"; exit 1; }) \
+ && rm -rf "$$dc_destdir" \
+ && $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
+ && rm -f $(distdir).tar.gz \
+ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck
+ $(am__remove_distdir)
+ @echo "$(distdir).tar.gz is ready for distribution" | \
+ sed 'h;s/./=/g;p;x;p;x'
+distuninstallcheck:
+ @cd $(distuninstallcheck_dir) \
+ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ || { echo "ERROR: files left after uninstall:" ; \
+ if test -n "$(DESTDIR)"; then \
+ echo " (check DESTDIR support)"; \
+ fi ; \
+ $(distuninstallcheck_listfiles) ; \
+ exit 1; } >&2
+distcleancheck: distclean
+ @if test '$(srcdir)' = . ; then \
+ echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+ exit 1 ; \
+ fi
+ @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+ || { echo "ERROR: files left in build directory after distclean:" ; \
+ $(distcleancheck_listfiles) ; \
+ exit 1; } >&2
check-am: all-am
check: check-am
-installcheck-am:
-installcheck: installcheck-am
-all-recursive-am: config.h
- $(MAKE) $(AM_MAKEFLAGS) all-recursive
+all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
-install-exec-am: install-libLTLIBRARIES
+installdirs:
+ $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
+install: install-am
install-exec: install-exec-am
-
-install-data-am: install-includeHEADERS
install-data: install-data-am
+uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
-install: install-am
-uninstall-am: uninstall-libLTLIBRARIES uninstall-includeHEADERS
-uninstall: uninstall-am
-all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h
-all-redirect: all-am
-install-strip:
- $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
-installdirs:
- $(mkinstalldirs) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
-
+installcheck: installcheck-am
+install-strip:
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ `test -z '$(STRIP)' || \
+ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
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]*
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
-mostlyclean-am: mostlyclean-hdr mostlyclean-libLTLIBRARIES \
- mostlyclean-noinstLTLIBRARIES mostlyclean-compile \
- mostlyclean-libtool mostlyclean-tags \
- mostlyclean-generic
+ @echo "This command is intended for maintainers to use"
+ @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
-mostlyclean: mostlyclean-am
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+ clean-noinstLTLIBRARIES mostlyclean-am
-clean-am: clean-hdr clean-libLTLIBRARIES clean-noinstLTLIBRARIES \
- clean-compile clean-libtool clean-tags clean-generic \
- mostlyclean-am
+distclean: distclean-am
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags
-clean: clean-am
+dvi: dvi-am
-distclean-am: distclean-hdr distclean-libLTLIBRARIES \
- distclean-noinstLTLIBRARIES distclean-compile \
- distclean-libtool distclean-tags distclean-generic \
- clean-am
- -rm -f libtool
+dvi-am:
-distclean: distclean-am
- -rm -f config.status
-
-maintainer-clean-am: maintainer-clean-hdr \
- maintainer-clean-libLTLIBRARIES \
- maintainer-clean-noinstLTLIBRARIES \
- maintainer-clean-compile maintainer-clean-libtool \
- maintainer-clean-tags 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."
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS
+
+install-exec-am: install-libLTLIBRARIES
+
+install-info: install-info-am
+
+install-man:
+
+installcheck-am:
maintainer-clean: maintainer-clean-am
- -rm -f config.status
-
-.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
-mostlyclean-libLTLIBRARIES distclean-libLTLIBRARIES \
-clean-libLTLIBRARIES maintainer-clean-libLTLIBRARIES \
-uninstall-libLTLIBRARIES install-libLTLIBRARIES \
-mostlyclean-noinstLTLIBRARIES distclean-noinstLTLIBRARIES \
-clean-noinstLTLIBRARIES maintainer-clean-noinstLTLIBRARIES \
-mostlyclean-compile distclean-compile clean-compile \
-maintainer-clean-compile mostlyclean-libtool distclean-libtool \
-clean-libtool maintainer-clean-libtool 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 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
+ -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+ mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS uninstall-info-am \
+ uninstall-libLTLIBRARIES
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+ clean-libLTLIBRARIES clean-libtool clean-noinstLTLIBRARIES \
+ ctags dist dist-all dist-gzip distcheck distclean \
+ distclean-compile distclean-generic distclean-hdr \
+ distclean-libtool distclean-tags distcleancheck distdir \
+ distuninstallcheck dvi dvi-am info info-am install install-am \
+ install-data install-data-am install-exec install-exec-am \
+ install-includeHEADERS install-info install-info-am \
+ install-libLTLIBRARIES install-man install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags uninstall uninstall-am uninstall-includeHEADERS \
+ uninstall-info-am uninstall-libLTLIBRARIES
ltdl.lo: ltdl.h config.h
-$(OBJECTS): libtool
+$(libltdl_la_OBJECTS) $(libltdlc_la_OBJECTS): libtool
libtool: $(LIBTOOL_DEPS)
$(SHELL) ./config.status --recheck
@@ -467,7 +602,6 @@ local-install-files: $(DISTFILES)
|| cp $$d/$$file $(DESTDIR)$(datadir)/libtool/libltdl/$$file || :; \
fi; \
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/libjava/libltdl/README b/libjava/libltdl/README
index e57b99f21a5..da0a449ca4d 100644
--- a/libjava/libltdl/README
+++ b/libjava/libltdl/README
@@ -6,4 +6,5 @@ It supports the following dlopen interfaces:
* LoadLibrary (Win16 and Win32)
* load_add_on (BeOS)
* GNU DLD (emulates dynamic linking for static libraries)
+* dyld (darwin/Mac OS X)
* libtool's dlpreopen
diff --git a/libjava/libltdl/acconfig.h b/libjava/libltdl/acconfig.h
deleted file mode 100644
index efa668c4dc7..00000000000
--- a/libjava/libltdl/acconfig.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Some of these are defined here, not in configure.in, because
- they're AC_DEFINEd in two different places, which causes two
- defines to appear. Some C compilers might now appreciate it... */
-
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define if you have the GNU dld library. */
-#undef HAVE_DLD
-
-/* Define if you have the shl_load function. */
-#undef HAVE_SHL_LOAD
-
-/* Define if you are using the Boehm GC. */
-#undef HAVE_BOEHM_GC
diff --git a/libjava/libltdl/acinclude.m4 b/libjava/libltdl/acinclude.m4
index b838418322e..ccb24e63a2f 100644
--- a/libjava/libltdl/acinclude.m4
+++ b/libjava/libltdl/acinclude.m4
@@ -1,5 +1,6 @@
-## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
-## Copyright (C) 1996-1999,2000 Free Software Foundation, Inc.
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+## Copyright 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
@@ -21,13 +22,33 @@
## 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 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# 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],
[AC_LIBTOOL_CXX],
[define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
])])
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
@@ -36,50 +57,43 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[AC_LIBTOOL_GCJ],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
-])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
-])])])])])
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
-AC_DEFUN(_AC_PROG_LIBTOOL,
+
+# _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_F77])dnl
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-# Save cache, so that ltconfig can load it
-AC_CACHE_SAVE
-
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC="$MAGIC" 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 --build="$build" $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 $ac_aux_dir/ltcf-c.sh"
+LIBTOOL_DEPS="$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
-])
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
+
-AC_DEFUN(AC_LIBTOOL_SETUP,
-[AC_PREREQ(2.13)dnl
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
@@ -89,6 +103,7 @@ AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
+
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
@@ -96,48 +111,370 @@ AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+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
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
# 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}'; then
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
AC_PATH_MAGIC
fi
;;
esac
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
-# 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 "$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"
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
-[libtool_flags="$libtool_flags --enable-dlopen"])
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[libtool_flags="$libtool_flags --enable-win32-dll"])
-AC_ARG_ENABLE(libtool-lock,
- [ --disable-libtool-lock avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
-
-AC_ARG_WITH(pic,
- [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
- pic_mode="$withval", pic_mode=default)
-test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
-test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
*-*-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
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -148,6 +485,49 @@ case "$host" in
LD="${LD-ld} -64"
;;
esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
fi
rm -rf conftest*
;;
@@ -157,192 +537,1349 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_SAVE
- AC_LANG_C
+ [AC_LANG_PUSH(C)
AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_RESTORE])
+ AC_LANG_POP])
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
;;
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw*)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
- # recent cygwin and mingw systems supply a stub DllMain which the user
- # can override, but on older systems we have to supply one
- AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
- [AC_TRY_LINK([],
- [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
- DllMain (0, 0, 0);],
- [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
- 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"
- AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
- [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
- CFLAGS="$SAVE_CFLAGS" ;;
- *-*-cygwin*)
- # cygwin systems need to pass --dll to the linker, and not link
- # crt.o which will require a WinMain@16 definition.
- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
- esac
;;
])
esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
])
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-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_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_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
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
])
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-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_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
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # 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") >/dev/null 2>&1 &&
+ 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.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ 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
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
])
+])# AC_LIBTOOL_PROG_CC_C_O
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-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, [dnl
-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 ;;
-*)
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
+
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
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
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
fi
- done
- IFS="$ac_save_ifs"
+ shlibpath_var=LIBPATH
+ fi
;;
-esac],
-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_ENABLE_FAST_INSTALL(no)])
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
-# 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
-pic_mode=ifelse($#,1,$1,default)])
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+freebsd1*)
+ dynamic_linker=no
+ ;;
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN(AC_PATH_TOOL_PREFIX,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC,
-[case "$MAGIC" in
- /*)
- lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
;;
- ?:/*)
- ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
*)
- ac_save_MAGIC="$MAGIC"
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# 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_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# 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],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# 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],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# 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],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# 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_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC="$ac_dir/$1"
+ 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="$lt_cv_path_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
+ $EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<EOF 1>&2
@@ -363,45 +1900,51 @@ EOF
break
fi
done
- IFS="$ac_save_ifs"
- MAGIC="$ac_save_MAGIC"
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac])
-MAGIC="$lt_cv_path_MAGIC"
-if test -n "$MAGIC"; then
- AC_MSG_RESULT($MAGIC)
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
else
AC_MSG_RESULT(no)
fi
-])
+])# AC_PATH_TOOL_PREFIX
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-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"; then
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
else
- MAGIC=:
+ MAGIC_CMD=:
fi
fi
-])
+])# AC_PATH_MAGIC
-# 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_PROG_LD
+# ----------
+# find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--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([LT_AC_PROG_SED])dnl
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])
+ AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -409,16 +1952,14 @@ 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
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ 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%/%"`
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -436,28 +1977,32 @@ 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-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
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
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
- else
+ ;;
+ *)
test "$with_gnu_ld" != yes && break
- fi
+ ;;
+ esac
fi
done
- IFS="$ac_save_ifs"
+ IFS="$lt_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
@@ -465,34 +2010,52 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
-])
+])# AC_PROG_LD
+
-AC_DEFUN(AC_PROG_LD_GNU,
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+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
-else
- ac_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$ac_cv_prog_gnu_ld
-])
+case `"$LD" -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+
+# 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_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
+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
-test -n "$reload_flag" && reload_flag=" $reload_flag"
-])
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
+
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+# 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_CACHE_CHECK([how to recognise dependant libraries],
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='${MAGIC}'
+[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
@@ -501,13 +2064,13 @@ lt_cv_deplibs_check_method='unknown'
# `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.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended 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
-aix4*)
+case $host_os in
+aix4* | aix5*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -516,27 +2079,39 @@ 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
;;
-cygwin* | mingw*)
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='${OBJDUMP} -f'
+cygwin* | mingw* | pw32*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ 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
+ lt_cv_deplibs_check_method=pass_all
;;
-freebsd* )
+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.*`
;;
@@ -550,30 +2125,39 @@ 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_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ 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_test_file=/usr/lib/libc.sl
+ ;;
+ esac
;;
-irix5* | irix6*)
- case "$host_os" in
- irix5*)
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
# 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*`
@@ -581,27 +2165,42 @@ irix5* | irix6*)
;;
# This must be Linux ELF.
-linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+linux*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
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]]+|_pic\.a)$'
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|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ 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
+ ;;
+
+nto-qnx)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
fi
;;
@@ -622,112 +2221,146 @@ solaris*)
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
+ 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*`
+ ;;
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_file_magic_test_file=`echo /usr/lib/libc.so*`
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
;;
esac
;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
])
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
-])
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
-# 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,
+# AC_PROG_NM
+# ----------
+# find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], 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-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/${ac_tool_prefix}nm
- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; 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
# 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"
- 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"
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
break
- else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ 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
+ ;;
+ esac
+ esac
fi
done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
-NM="$ac_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN(AC_CHECK_LIBM,
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$host" in
-*-*-beos* | *-*-cygwin*)
- # These system don't have libm
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
- AC_CHECK_LIB(m, main, LIBM="-lm")
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
;;
esac
-])
+])# AC_CHECK_LIBM
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments. Note that LIBLTDL and INCLTDL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
-# with '${top_builddir}/' and INCLTDL will be prefixed with
+
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
# '${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" ;;
esac
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-])
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
-# with '${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_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${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.
# 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_CHECK_LIB(ltdl, main,
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
@@ -738,343 +2371,2006 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
- INCLTDL=
+ LTDLINCL=
fi
-])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
-# If this macro is not defined by Autoconf, define it here.
-ifdef([AC_PROVIDE_IFELSE],
- [],
- [define([AC_PROVIDE_IFELSE],
- [ifdef([AC_PROVIDE_$1],
- [$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_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_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"
-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="$MAGIC" 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 -o libtool $libtool_flags \
---build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
-|| AC_MSG_ERROR([libtool tag configuration failed])
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`])
+])# _LT_AC_LANG_CXX
+
+
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
+
+
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`])
+])# _LT_AC_LANG_F77
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-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_REQUIRE([AC_PROG_LIBTOOL])
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
+
+
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])
-LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
-lt_save_CC="$CC"
-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="" \
-MAGIC="$MAGIC" 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 -o libtool $libtool_flags \
---build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
-|| AC_MSG_ERROR([libtool tag configuration failed])
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
+])# _LT_AC_LANG_GCJ
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-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_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`])
+])# AC_LIBTOOL_RC
-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)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
-## ltdl.m4 - Configure ltdl for the target system. -*-Shell-script-*-
-## Copyright (C) 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.
-##
-## As a special exception to the GNU General Public License, if you
-## distribute this file as part of a program that contains a
-## configuration script generated by Autoconf, you may include it under
-## the same distribution terms that you use for the rest of that program.
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
-# serial 1 AC_LIB_LTDL
+# Source file extension for C test sources.
+ac_ext=c
-AC_DEFUN(AC_LIB_LTDL,
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_C_CONST])dnl
-AC_REQUIRE([AC_C_INLINE])dnl
-
-dnl AC_LIB_LTDL must perform all the checks necessary for compilation
-dnl of the ltdl objects -- including compiler checks (above) and header
-dnl checks (below).
-AC_REQUIRE([AC_HEADER_STDC])dnl
-
-AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
-AC_CHECK_HEADERS(string.h strings.h, break)
-AC_CHECK_FUNCS(strchr index, break)
-AC_CHECK_FUNCS(strrchr rindex, break)
-AC_CHECK_FUNCS(strcmp)
-
-AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
-AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
-AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
-AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
-AC_REQUIRE([AC_LTDL_OBJDIR])dnl
-AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
-AC_REQUIRE([AC_LTDL_DLLIB])dnl
-AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
-])
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
-AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
-[AC_ARG_ENABLE(ltdl-install,
-[ --enable-ltdl-install install libltdl])
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
-AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
-AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
-])])
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+_LT_AC_SYS_COMPILER
-AC_DEFUN(AC_LTDL_SNARF_CONFIG,
-[# Read the libtool configuration
-rm -f conftest
-./libtool --config > conftest
-. ./conftest
-rm -f conftest
-])
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
+fi
-AC_DEFUN(AC_LTDL_SHLIBEXT,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([which extension is used for shared libraries],
- libltdl_cv_shlibext, [dnl
-(
- last=
- for spec in $library_names_spec; do
- last="$spec"
- done
-changequote(, )
- echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-changequote([, ])
-)
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
-])
-if test -n "$libltdl_cv_shlibext"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
- [Define to the extension used for shared libraries, say, ".so". ])
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
fi
-])
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
-AC_DEFUN(AC_LTDL_SHLIBPATH,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([which variable specifies run-time library path],
- libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
-if test -n "$libltdl_cv_shlibpath_var"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
- [Define to the name of the environment variable that determines the dynamic library search path. ])
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
-])
-AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([for the default library search path],
- libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
-if test -n "$libltdl_cv_sys_search_path"; then
- case "$host" in
- *-*-mingw*) pathsep=";" ;;
- *) pathsep=":" ;;
- esac
- sys_search_path=
- for dir in $libltdl_cv_sys_search_path; do
- if test -z "$sys_search_path"; then
- sys_search_path="$dir"
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
- sys_search_path="$sys_search_path$pathsep$dir"
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
fi
- done
- AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
- [Define to the system default library search path. ])
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # 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 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = 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
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=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
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=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
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; 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
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
-AC_DEFUN(AC_LTDL_OBJDIR,
-[AC_CACHE_CHECK([for objdir],
- libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
-if test -n "$objdir"; then
- :
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
else
- rm -f .libs 2>/dev/null
- mkdir .libs 2>/dev/null
- if test -d .libs; then
- libltdl_cv_objdir=.libs
- else
- # MS-DOS does not allow filenames that begin with a dot.
- libltdl_cv_objdir=_libs
- fi
-rmdir .libs 2>/dev/null
-fi])
-AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries. ])
-])
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
-AC_DEFUN(AC_LTDL_DLPREOPEN,
-[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
-AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
- libltdl_cv_preloaded_symbols, [dnl
- if test -n "$global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
fi
-])
-if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
- AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
- [Define if libtool can extract symbol lists from object files. ])
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
fi
-])
+EOF
+ ;;
+ esac
-AC_DEFUN(AC_LTDL_DLLIB,
-[LIBADD_DL=
-AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
-[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent.])],
-[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
-)])])
-AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
- [Define if you have the shl_load function.])],
-[AC_CHECK_LIB(dld, shl_load,
- [AC_DEFINE(HAVE_SHL_LOAD, 1,
- [Define if you have the shl_load function.])
- LIBADD_DL="$LIBADD_DL -ldld"])
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
])
-AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
- [Define if you have the GNU dld library.])dnl
-test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
-AC_SUBST(LIBADD_DL)
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
- LIBS_SAVE="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS(dlerror)
- LIBS="$LIBS_SAVE"
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
-])
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
-[dnl Check for command to grab the raw symbol name followed
-dnl by C symbol name from nm.
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
# 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?!! ;)}
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_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]'
+symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+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'
+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'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
# Define system-specific variables.
-case "$host_os" in
+case $host_os in
aix*)
- ac_symcode='[BCDT]'
+ symcode='[[BCDT]]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
;;
-irix*)
- ac_symcode='[BCDEGRST]'
+osf*)
+ symcode='[[BCDEGQRST]]'
;;
-solaris*)
- ac_symcode='[BDT]'
+solaris* | sysv5*)
+ symcode='[[BDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
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
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGISTW]]' ;;
+esac
# 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'"
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
+ pipe_works=no
+
+ rm -f conftest*
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
@@ -1084,35 +4380,33 @@ void nm_test_func(){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
+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
-
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
else
- rm -f "$ac_nlist"T
+ rm -f "$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
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
- cat <<EOF >> conftest.c
+ cat <<EOF >> conftest.$ac_ext
#if defined (__STDC__) && __STDC__
# define lt_ptr_t void *
#else
@@ -1125,13 +4419,11 @@ const struct {
const char *name;
lt_ptr_t address;
}
-changequote(,)dnl
-lt_preloaded_symbols[] =
-changequote([,])dnl
+lt_preloaded_symbols[[]] =
{
EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
{0, (lt_ptr_t) 0}
};
@@ -1141,149 +4433,1877 @@ EOF
EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$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
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
else
- echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
- echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
fi
else
- echo "$progname: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
fi
- rm -rf conftest* conftst*
+ rm -f conftest* conftst*
# 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
+ if test "$pipe_works" = yes; then
break
else
- ac_cv_sys_global_symbol_pipe=
+ lt_cv_sys_global_symbol_pipe=
fi
done
])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ 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'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--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
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ 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'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc|ecc)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
fi
-AC_MSG_RESULT($ac_result)
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
])
-AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
-[dnl does the compiler prefix global symbols with an underscore?
-AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])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
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # 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 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
else
- if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=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.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
fi
fi
else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # 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 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$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
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=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
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi4*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -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
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
fi
-else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-rm -rf conftest*
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+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])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
])
-AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
-AC_LTDL_DLSYM_USCORE
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
])
-AC_DEFUN(AC_LTDL_DLSYM_USCORE,
-[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
-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
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- libltdl_cv_need_uscore, [dnl
- AC_TRY_RUN([
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+SED=$lt_cv_path_SED
+])
+AC_MSG_RESULT([$SED])
+])
+## ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
+## Copyright (C) 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.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
-#include <stdio.h>
+# serial 6 AC_LIB_LTDL
-#ifdef RTLD_GLOBAL
-# define LTDL_GLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LTDL_GLOBAL DL_GLOBAL
-# else
-# define LTDL_GLOBAL 0
-# endif
-#endif
+# AC_WITH_LTDL
+# ------------
+# Clients of libltdl can use this macro to allow the installer to
+# choose between a shipped copy of the ltdl sources or a preinstalled
+# version of the library.
+AC_DEFUN([AC_WITH_LTDL],
+[AC_REQUIRE([AC_LIB_LTDL])
+AC_SUBST([LIBLTDL])
+AC_SUBST([INCLTDL])
-/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LTDL_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LTDL_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LTDL_LAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LTDL_LAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LTDL_LAZY_OR_NOW DL_NOW
-# else
-# define LTDL_LAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
+# Unless the user asks us to check, assume no installed ltdl exists.
+use_installed_libltdl=no
+
+AC_ARG_WITH([included_ltdl],
+ [ --with-included-ltdl use the GNU ltdl sources included here])
+
+if test "x$with_included_ltdl" != xyes; then
+ # We are not being forced to use the included libltdl sources, so
+ # decide whether there is a useful installed version we can use.
+ AC_CHECK_HEADER([ltdl.h],
+ [AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
+ [with_included_ltdl=no],
+ [with_included_ltdl=yes])
+ ])
+fi
+
+if test "x$enable_ltdl_install" != xyes; then
+ # If the user did not specify an installable libltdl, then default
+ # to a convenience lib.
+ AC_LIBLTDL_CONVENIENCE
+fi
+
+if test "x$with_included_ltdl" = xno; then
+ # If the included ltdl is not to be used. then Use the
+ # preinstalled libltdl we found.
+ AC_DEFINE([HAVE_LTDL], 1,
+ [Define this if a modern libltdl is already installed])
+ LIBLTDL=-lltdl
+fi
+
+# Report our decision...
+AC_MSG_CHECKING([whether to use included libltdl])
+AC_MSG_RESULT([$with_included_ltdl])
+
+AC_CONFIG_SUBDIRS([libltdl])
+])# AC_WITH_LTDL
+
+
+# AC_LIB_LTDL
+# -----------
+# Perform all the checks necessary for compilation of the ltdl objects
+# -- including compiler checks and header checks.
+AC_DEFUN([AC_LIB_LTDL],
+[AC_PREREQ(2.50)
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_C_CONST])
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([AC_HEADER_DIRENT])
+AC_REQUIRE([_LT_AC_CHECK_DLFCN])
+AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
+AC_REQUIRE([AC_LTDL_SHLIBEXT])
+AC_REQUIRE([AC_LTDL_SHLIBPATH])
+AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
+AC_REQUIRE([AC_LTDL_OBJDIR])
+AC_REQUIRE([AC_LTDL_DLPREOPEN])
+AC_REQUIRE([AC_LTDL_DLLIB])
+AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
+AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
+AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
+AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
+
+AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
+ stdio.h unistd.h])
+AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h])
+AC_CHECK_HEADERS([string.h strings.h], [break])
+
+AC_CHECK_FUNCS([strchr index], [break])
+AC_CHECK_FUNCS([strrchr rindex], [break])
+AC_CHECK_FUNCS([memcpy bcopy], [break])
+AC_CHECK_FUNCS([memmove strcmp])
+AC_CHECK_FUNCS([closedir opendir readdir])
+])# AC_LIB_LTDL
+
+
+# AC_LTDL_ENABLE_INSTALL
+# ----------------------
+AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
+[AC_ARG_ENABLE([ltdl-install],
+ [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
+])])# AC_LTDL_ENABLE_INSTALL
+
+
+# AC_LTDL_SYS_DLOPEN_DEPLIBS
+# --------------------------
+AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
+ [libltdl_cv_sys_dlopen_deplibs],
+ [# PORTME does your system automatically load deplibs for dlopen?
+ # or its logical equivalent (e.g. shl_load for HP-UX < 11)
+ # For now, we just catch OSes we know something about -- in the
+ # future, we'll try test this programmatically.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ case "$host_os" in
+ aix3*|aix4.1.*|aix4.2.*)
+ # Unknown whether this is true for these versions of AIX, but
+ # we want this `case' here to explicitly catch those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ aix[[45]]*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ darwin*)
+ # Assuming the user has installed a libdl from somewhere, this is true
+ # If you are looking for one http://www.opendarwin.org/projects/dlcompat
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ gnu*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ hpux10*|hpux11*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ irix[[12345]]*|irix6.[[01]]*)
+ # Catch all versions of IRIX before 6.2, and indicate that we don't
+ # know how it worked for any of those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ irix*)
+ # The case above catches anything before 6.2, and it's known that
+ # at 6.2 and later dlopen does load deplibs.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ linux*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ netbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ openbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ osf[[1234]]*)
+ # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
+ # it did *not* use an RPATH in a shared library to find objects the
+ # library depends on, so we explictly say `no'.
+ libltdl_cv_sys_dlopen_deplibs=no
+ ;;
+ osf5.0|osf5.0a|osf5.1)
+ # dlopen *does* load deplibs and with the right loader patch applied
+ # it even uses RPATH in a shared library to search for shared objects
+ # that the library depends on, but there's no easy way to know if that
+ # patch is installed. Since this is the case, all we can really
+ # say is unknown -- it depends on the patch being installed. If
+ # it is, this changes to `yes'. Without it, it would be `no'.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ osf*)
+ # the two cases above should catch all versions of osf <= 5.1. Read
+ # the comments above for what we know about them.
+ # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
+ # is used to find them so we can finally say `yes'.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ solaris*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ esac
+ ])
+if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
+ AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
+ [Define if the OS needs help to load dependent libraries for dlopen().])
+fi
+])# AC_LTDL_SYS_DLOPEN_DEPLIBS
+
+
+# AC_LTDL_SHLIBEXT
+# ----------------
+AC_DEFUN([AC_LTDL_SHLIBEXT],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([which extension is used for loadable modules],
+ [libltdl_cv_shlibext],
+[
+# Here in libltdl for libgcj we don't build modules for darwin.
+# So we say no. Then the extension gets .dylib which is the right
+# thing for shared libraries on darwin.
+case "$host_os" in
+darwin*)
+ module=no
+ ;;
+*)
+ module=yes
+ ;;
+esac
+eval libltdl_cv_shlibext=$shrext
+ ])
+if test -n "$libltdl_cv_shlibext"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
+ [Define to the extension used for shared libraries, say, ".so".])
+fi
+])# AC_LTDL_SHLIBEXT
+
+
+# AC_LTDL_SHLIBPATH
+# -----------------
+AC_DEFUN([AC_LTDL_SHLIBPATH],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([which variable specifies run-time library path],
+ [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
+if test -n "$libltdl_cv_shlibpath_var"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
+ [Define to the name of the environment variable that determines the dynamic library search path.])
+fi
+])# AC_LTDL_SHLIBPATH
+
+
+# AC_LTDL_SYSSEARCHPATH
+# ---------------------
+AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([for the default library search path],
+ [libltdl_cv_sys_search_path],
+ [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
+if test -n "$libltdl_cv_sys_search_path"; then
+ sys_search_path=
+ for dir in $libltdl_cv_sys_search_path; do
+ if test -z "$sys_search_path"; then
+ sys_search_path="$dir"
+ else
+ sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
+ fi
+ done
+ AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
+ [Define to the system default library search path.])
+fi
+])# AC_LTDL_SYSSEARCHPATH
+
+
+# AC_LTDL_OBJDIR
+# --------------
+AC_DEFUN([AC_LTDL_OBJDIR],
+[AC_CACHE_CHECK([for objdir],
+ [libltdl_cv_objdir],
+ [libltdl_cv_objdir="$objdir"
+ if test -n "$objdir"; then
+ :
+ else
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+ rmdir .libs 2>/dev/null
+ fi
+ ])
+AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# AC_LTDL_OBJDIR
+
+
+# AC_LTDL_DLPREOPEN
+# -----------------
+AC_DEFUN([AC_LTDL_DLPREOPEN],
+[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
+AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
+ [libltdl_cv_preloaded_symbols],
+ [if test -n "$lt_cv_sys_global_symbol_pipe"; then
+ libltdl_cv_preloaded_symbols=yes
+ else
+ libltdl_cv_preloaded_symbols=no
+ fi
+ ])
+if test x"$libltdl_cv_preloaded_symbols" = xyes; then
+ AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
+ [Define if libtool can extract symbol lists from object files.])
+fi
+])# AC_LTDL_DLPREOPEN
+
+
+# AC_LTDL_DLLIB
+# -------------
+AC_DEFUN([AC_LTDL_DLLIB],
+[LIBADD_DL=
+AC_SUBST(LIBADD_DL)
+AC_LANG_PUSH([C])
+
+AC_CHECK_FUNC([shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])
+ LIBADD_DL="$LIBADD_DL -ldld"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
+ [AC_TRY_LINK([#if HAVE_DLFCN_H
+# include <dlfcn.h>
#endif
+ ],
+ [dlopen(0, 0);],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [AC_DEFINE([HAVE_DLD], [1],
+ [Define if you have the GNU dld library.])
+ LIBADD_DL="$LIBADD_DL -ldld"],
+ [AC_CHECK_FUNC([_dyld_func_lookup],
+ [AC_DEFINE([HAVE_DYLD], [1],
+ [Define if you have the _dyld_func_lookup function.])])
+ ])
+ ])
+ ])
+ ])
+ ])
+])
-fnord() { int i=42;}
-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); }
-], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
- libltdl_cv_need_uscore=cross
-)])
+if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
+then
+ lt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ AC_CHECK_FUNCS([dlerror])
+ LIBS="$lt_save_LIBS"
+fi
+AC_LANG_POP
+])# AC_LTDL_DLLIB
+
+
+# AC_LTDL_SYMBOL_USCORE
+# ---------------------
+# does the compiler prefix global symbols with an underscore?
+AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
+[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
+AC_CACHE_CHECK([for _ prefix in compiled symbols],
+ [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 \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if grep '^. 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 $lt_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_LTDL_SYMBOL_USCORE
+
+
+# AC_LTDL_DLSYM_USCORE
+# --------------------
+AC_DEFUN([AC_LTDL_DLSYM_USCORE],
+[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
+if test x"$ac_cv_sys_symbol_underscore" = xyes; then
+ if test x"$libltdl_cv_func_dlopen" = xyes ||
+ test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
+ AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+ [libltdl_cv_need_uscore],
+ [libltdl_cv_need_uscore=unknown
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ _LT_AC_TRY_DLOPEN_SELF(
+ [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
+ [], [libltdl_cv_need_uscore=cross])
+ LIBS="$save_LIBS"
+ ])
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
AC_DEFINE(NEED_USCORE, 1,
- [Define if dlsym() requires a leading underscode in symbol names. ])
+ [Define if dlsym() requires a leading underscore in symbol names.])
fi
-])
+])# AC_LTDL_DLSYM_USCORE
+
+# AC_LTDL_FUNC_ARGZ
+# -----------------
+AC_DEFUN([AC_LTDL_FUNC_ARGZ],
+[AC_CHECK_HEADERS([argz.h])
+
+AC_CHECK_TYPES([error_t],
+ [],
+ [AC_DEFINE([error_t], [int],
+ [Define to a type to use for `error_t' if it is not otherwise available.])],
+ [#if HAVE_ARGZ_H
+# include <argz.h>
+#endif])
+
+AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
+])# AC_LTDL_FUNC_ARGZ
diff --git a/libjava/libltdl/aclocal.m4 b/libjava/libltdl/aclocal.m4
index 43a94dbcc16..31d8fbb6d42 100644
--- a/libjava/libltdl/aclocal.m4
+++ b/libjava/libltdl/aclocal.m4
@@ -1,23 +1,45 @@
-dnl aclocal.m4 generated automatically by aclocal 1.4
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
-dnl Copyright (C) 1994, 1995-8, 1999 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.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
+# This file 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.
-dnl This program is distributed in the hope that it will be useful,
-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
-dnl PARTICULAR PURPOSE.
+# 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.
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
-# serial 45 AC_PROG_LIBTOOL
-AC_DEFUN(AC_PROG_LIBTOOL,[AC_REQUIRE([_AC_PROG_LIBTOOL])
+# serial 47 AC_PROG_LIBTOOL
+
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If this macro is not defined by Autoconf, define it here.
+m4_ifdef([AC_PROVIDE_IFELSE],
+ [],
+ [m4_define([AC_PROVIDE_IFELSE],
+ [m4_ifdef([AC_PROVIDE_$1],
+ [$2], [$3])])])
+
+
+# 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],
[AC_LIBTOOL_CXX],
[define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+ ])])
+dnl And a similar setup for Fortran 77 support
+ AC_PROVIDE_IFELSE([AC_PROG_F77],
+ [AC_LIBTOOL_F77],
+ [define([AC_PROG_F77], defn([AC_PROG_F77])[AC_LIBTOOL_F77
])])
dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
@@ -26,50 +48,43 @@ dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
AC_PROVIDE_IFELSE([AC_PROG_GCJ],
[AC_LIBTOOL_GCJ],
[AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
- [AC_LIBTOOL_GCJ],
- [ifdef([AC_PROG_GCJ],
- [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
-])])
- ifdef([A][M_PROG_GCJ],
- [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
-])])])])])
-
-AC_DEFUN(_AC_PROG_LIBTOOL,
+ [AC_LIBTOOL_GCJ],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+ [AC_LIBTOOL_GCJ],
+ [ifdef([AC_PROG_GCJ],
+ [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([A][M_PROG_GCJ],
+ [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ])])
+ ifdef([LT_AC_PROG_GCJ],
+ [define([LT_AC_PROG_GCJ],
+ defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ])])])])
+])])# AC_PROG_LIBTOOL
+
+
+# _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_F77])dnl
AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
-# Save cache, so that ltconfig can load it
-AC_CACHE_SAVE
-
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC="$MAGIC" 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 --build="$build" $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 $ac_aux_dir/ltcf-c.sh"
+LIBTOOL_DEPS="$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
-])
+# Prevent multiple expansion
+define([AC_PROG_LIBTOOL], [])
+])# _AC_PROG_LIBTOOL
-AC_DEFUN(AC_LIBTOOL_SETUP,
-[AC_PREREQ(2.13)dnl
+
+# AC_LIBTOOL_SETUP
+# ----------------
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.50)dnl
AC_REQUIRE([AC_ENABLE_SHARED])dnl
AC_REQUIRE([AC_ENABLE_STATIC])dnl
AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
@@ -79,6 +94,7 @@ AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_LD])dnl
AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
AC_REQUIRE([AC_PROG_NM])dnl
+
AC_REQUIRE([AC_PROG_LN_S])dnl
AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
@@ -86,48 +102,370 @@ AC_REQUIRE([AC_OBJEXT])dnl
AC_REQUIRE([AC_EXEEXT])dnl
dnl
+AC_LIBTOOL_SYS_MAX_CMD_LEN
+AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+AC_LIBTOOL_OBJDIR
+
+AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+_LT_AC_PROG_ECHO_BACKSLASH
+
+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
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
+ ;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+[sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g']
+
+# Same as above, but do not quote variable references.
+[double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g']
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+AC_CHECK_TOOL(AR, ar, false)
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
+ *)
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
# 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}'; then
+ if test "$file_magic_cmd" = '$MAGIC_CMD'; then
AC_PATH_MAGIC
fi
;;
esac
-AC_CHECK_TOOL(RANLIB, ranlib, :)
-AC_CHECK_TOOL(STRIP, strip, :)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_DLOPEN], enable_dlopen=yes, enable_dlopen=no)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+enable_win32_dll=yes, enable_win32_dll=no)
+
+AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+AC_ARG_WITH([pic],
+ [AC_HELP_STRING([--with-pic],
+ [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+ [pic_mode="$withval"],
+ [pic_mode=default])
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+AC_LIBTOOL_LANG_C_CONFIG
+_LT_AC_TAGCONFIG
+])# AC_LIBTOOL_SETUP
+
+
+# _LT_AC_SYS_COMPILER
+# -------------------
+AC_DEFUN([_LT_AC_SYS_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_AC_SYS_COMPILER
+
+
+# _LT_AC_SYS_LIBPATH_AIX
+# ----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX],
+[AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_AC_SYS_LIBPATH_AIX
+
+
+# _LT_AC_SHELL_INIT(ARG)
+# ----------------------
+AC_DEFUN([_LT_AC_SHELL_INIT],
+[ifdef([AC_DIVERSION_NOTICE],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)],
+ [AC_DIVERT_PUSH(NOTICE)])
+$1
+AC_DIVERT_POP
+])# _LT_AC_SHELL_INIT
+
+
+# _LT_AC_PROG_ECHO_BACKSLASH
+# --------------------------
+# Add some code to the start of the generated configure script which
+# will find an echo command which doesn't interpret backslashes.
+AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH],
+[_LT_AC_SHELL_INIT([
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X[$]1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X[$]1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "[$]0" --no-reexec ${1+"[$]@"}
+fi
+
+if test "X[$]1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+[$]*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL [$]0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
-# 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 "$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"
-ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
-[libtool_flags="$libtool_flags --enable-dlopen"])
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[libtool_flags="$libtool_flags --enable-win32-dll"])
-AC_ARG_ENABLE(libtool-lock,
- [ --disable-libtool-lock avoid locking (might break parallel builds)])
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
-
-AC_ARG_WITH(pic,
- [ --with-pic try to use only PIC/non-PIC objects [default=use both]],
- pic_mode="$withval", pic_mode=default)
-test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
-test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+ for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
+
+ if test "$prev" != 'sed 50q "[$]0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo"
+fi
+
+AC_SUBST(ECHO)
+])])# _LT_AC_PROG_ECHO_BACKSLASH
+
+
+# _LT_AC_LOCK
+# -----------
+AC_DEFUN([_LT_AC_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+ [AC_HELP_STRING([--disable-libtool-lock],
+ [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
-case "$host" in
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
*-*-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
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -32"
;;
@@ -138,6 +476,49 @@ case "$host" in
LD="${LD-ld} -64"
;;
esac
+ fi
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
+ esac
fi
rm -rf conftest*
;;
@@ -147,192 +528,1349 @@ case "$host" in
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
- [AC_LANG_SAVE
- AC_LANG_C
+ [AC_LANG_PUSH(C)
AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
- AC_LANG_RESTORE])
+ AC_LANG_POP])
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
;;
-
-ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
-[*-*-cygwin* | *-*-mingw*)
+AC_PROVIDE_IFELSE([AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
AC_CHECK_TOOL(AS, as, false)
AC_CHECK_TOOL(OBJDUMP, objdump, false)
-
- # recent cygwin and mingw systems supply a stub DllMain which the user
- # can override, but on older systems we have to supply one
- AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
- [AC_TRY_LINK([],
- [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
- DllMain (0, 0, 0);],
- [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
-
- 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"
- AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
- [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
- CFLAGS="$SAVE_CFLAGS" ;;
- *-*-cygwin*)
- # cygwin systems need to pass --dll to the linker, and not link
- # crt.o which will require a WinMain@16 definition.
- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
- esac
;;
])
esac
+
+need_locks="$enable_libtool_lock"
+
+])# _LT_AC_LOCK
+
+
+# AC_LIBTOOL_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ ifelse([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$3"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ $2=yes
+ fi
+ fi
+ $rm conftest*
])
-# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
-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_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_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
+if test x"[$]$2" = xyes; then
+ ifelse([$5], , :, [$5])
+else
+ ifelse([$6], , :, [$6])
+fi
+])# AC_LIBTOOL_COMPILER_OPTION
+
+
+# AC_LIBTOOL_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+# [ACTION-SUCCESS], [ACTION-FAILURE])
+# ------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([AC_LIBTOOL_LINKER_OPTION],
+[AC_CACHE_CHECK([$1], [$2],
+ [$2=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $3"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&AS_MESSAGE_LOG_FD
+ else
+ $2=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
])
-# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
-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_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
+if test x"[$]$2" = xyes; then
+ ifelse([$4], , :, [$4])
+else
+ ifelse([$5], , :, [$5])
+fi
+])# AC_LIBTOOL_LINKER_OPTION
+
+
+# AC_LIBTOOL_SYS_MAX_CMD_LEN
+# --------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN],
+[# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # 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") >/dev/null 2>&1 &&
+ 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.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+ AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+ AC_MSG_RESULT(none)
+fi
+])# AC_LIBTOOL_SYS_MAX_CMD_LEN
+
+
+# _LT_AC_CHECK_DLFCN
+# --------------------
+AC_DEFUN([_LT_AC_CHECK_DLFCN],
+[AC_CHECK_HEADERS(dlfcn.h)dnl
+])# _LT_AC_CHECK_DLFCN
+
+
+# _LT_AC_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+# ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ------------------------------------------------------------------
+AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+ [$4]
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+[#line __oline__ "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}]
+EOF
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) $1 ;;
+ x$lt_dlneed_uscore) $2 ;;
+ x$lt_unknown|x*) $3 ;;
+ esac
+ else :
+ # compilation failed
+ $3
+ fi
+fi
+rm -fr conftest*
+])# _LT_AC_TRY_DLOPEN_SELF
+
+
+# AC_LIBTOOL_DLOPEN_SELF
+# -------------------
+AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF],
+[AC_REQUIRE([_LT_AC_CHECK_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ])
+ ;;
+
+ *)
+ AC_CHECK_FUNC([shl_load],
+ [lt_cv_dlopen="shl_load"],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"],
+ [AC_CHECK_FUNC([dlopen],
+ [lt_cv_dlopen="dlopen"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"])
+ ])
+ ])
+ ])
+ ])
+ ])
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ AC_CACHE_CHECK([whether a program can dlopen itself],
+ lt_cv_dlopen_self, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+ lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+ ])
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+ lt_cv_dlopen_self_static, [dnl
+ _LT_AC_TRY_DLOPEN_SELF(
+ lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+ lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross)
+ ])
fi
- done
- IFS="$ac_save_ifs"
- ;;
-esac],
-enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ 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
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+])# AC_LIBTOOL_DLOPEN_SELF
+
+
+# AC_LIBTOOL_PROG_CC_C_O([TAGNAME])
+# ---------------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler
+AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+ [_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&AS_MESSAGE_LOG_FD
+ echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
])
+])# AC_LIBTOOL_PROG_CC_C_O
+
+
+# AC_LIBTOOL_SYS_HARD_LINK_LOCKS([TAGNAME])
+# -----------------------------------------
+# Check to see if we can do hard links to lock some files if needed
+AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS],
+[AC_REQUIRE([_LT_AC_LOCK])dnl
+
+hard_links="nottested"
+if test "$_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ AC_MSG_CHECKING([if we can lock with hard links])
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ AC_MSG_RESULT([$hard_links])
+ if test "$hard_links" = no; then
+ AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+])# AC_LIBTOOL_SYS_HARD_LINK_LOCKS
-# AC_DISABLE_STATIC - set the default static flag to --disable-static
-AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
-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, [dnl
-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 ;;
-*)
+
+# AC_LIBTOOL_OBJDIR
+# -----------------
+AC_DEFUN([AC_LIBTOOL_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+])# AC_LIBTOOL_OBJDIR
+
+
+# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH([TAGNAME])
+# ----------------------------------------------
+# Check hardcoding attributes.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_AC_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)" || \
+ test -n "$_LT_AC_TAGVAR(runpath_var $1)" || \
+ test "X$_LT_AC_TAGVAR(hardcode_automatic, $1)"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$_LT_AC_TAGVAR(hardcode_direct, $1)" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+ test "$_LT_AC_TAGVAR(hardcode_minus_L, $1)" != no; then
+ # Linking always hardcodes the temporary library directory.
+ _LT_AC_TAGVAR(hardcode_action, $1)=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ _LT_AC_TAGVAR(hardcode_action, $1)=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ _LT_AC_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_AC_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_AC_TAGVAR(hardcode_action, $1)" = relink; then
+ # Fast installation is not supported
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
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+])# AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH
+
+
+# AC_LIBTOOL_SYS_LIB_STRIP
+# ------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP],
+[striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+fi
+ ;;
+ *)
+ AC_MSG_RESULT([no])
+ ;;
+ esac
+fi
+])# AC_LIBTOOL_SYS_LIB_STRIP
+
+
+# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER],
+[AC_MSG_CHECKING([dynamic linker characteristics])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
fi
- done
- IFS="$ac_save_ifs"
+ shlibpath_var=LIBPATH
+ fi
;;
-esac],
-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_ENABLE_FAST_INSTALL(no)])
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
-# 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
-pic_mode=ifelse($#,1,$1,default)])
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | [grep ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
-# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
-AC_DEFUN(AC_PATH_TOOL_PREFIX,
-[AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(lt_cv_path_MAGIC,
-[case "$MAGIC" in
- /*)
- lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
;;
- ?:/*)
- ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.[01]* | freebsdelf3.[01]*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
*)
- ac_save_MAGIC="$MAGIC"
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[[89]] | openbsd2.[[89]].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+])# AC_LIBTOOL_SYS_DYNAMIC_LINKER
+
+
+# _LT_AC_TAGCONFIG
+# ----------------
+AC_DEFUN([_LT_AC_TAGCONFIG],
+[AC_ARG_WITH([tags],
+ [AC_HELP_STRING([--with-tags@<:@=TAGS@:>@],
+ [include additional configurations @<:@automatic@:>@])],
+ [tagnames="$withval"])
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ AC_MSG_WARN([output file `$ofile' does not exist])
+ fi
+
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
+ else
+ AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
+ fi
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]]::g'` in
+ "") ;;
+ *) AC_MSG_ERROR([invalid tag name: $tagname])
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ AC_MSG_ERROR([tag name \"$tagname\" already exists])
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ AC_LIBTOOL_LANG_CXX_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+ AC_LIBTOOL_LANG_F77_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+ AC_LIBTOOL_LANG_GCJ_CONFIG
+ else
+ tagname=""
+ fi
+ ;;
+
+ RC)
+ AC_LIBTOOL_LANG_RC_CONFIG
+ ;;
+
+ *)
+ AC_MSG_ERROR([Unsupported tag name: $tagname])
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
+ fi
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
+ else
+ rm -f "${ofile}T"
+ AC_MSG_ERROR([unable to update list of available tagged configurations.])
+ fi
+fi
+])# _LT_AC_TAGCONFIG
+
+
+# AC_LIBTOOL_DLOPEN
+# -----------------
+# enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN],
+ [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])
+])# AC_LIBTOOL_DLOPEN
+
+
+# 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_LIBTOOL_WIN32_DLL
+
+
+# AC_ENABLE_SHARED([DEFAULT])
+# ---------------------------
+# implement the --enable-shared flag
+# 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],
+ [AC_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+ [build shared libraries @<:@default=]AC_ENABLE_SHARED_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_shared=]AC_ENABLE_SHARED_DEFAULT)
+])# AC_ENABLE_SHARED
+
+
+# AC_DISABLE_SHARED
+# -----------------
+#- set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)
+])# AC_DISABLE_SHARED
+
+
+# AC_ENABLE_STATIC([DEFAULT])
+# ---------------------------
+# implement the --enable-static flag
+# 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],
+ [AC_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+ [build static libraries @<:@default=]AC_ENABLE_STATIC_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_static=]AC_ENABLE_STATIC_DEFAULT)
+])# AC_ENABLE_STATIC
+
+
+# AC_DISABLE_STATIC
+# -----------------
+# set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)
+])# AC_DISABLE_STATIC
+
+
+# AC_ENABLE_FAST_INSTALL([DEFAULT])
+# ---------------------------------
+# implement the --enable-fast-install flag
+# 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],
+ [AC_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+ [optimize for fast installation @<:@default=]AC_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+ [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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
+ [enable_fast_install=]AC_ENABLE_FAST_INSTALL_DEFAULT)
+])# AC_ENABLE_FAST_INSTALL
+
+
+# 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_ENABLE_FAST_INSTALL(no)
+])# AC_DISABLE_FAST_INSTALL
+
+
+# AC_LIBTOOL_PICMODE([MODE])
+# --------------------------
+# implement the --with-pic flag
+# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)
+])# AC_LIBTOOL_PICMODE
+
+
+# AC_PROG_EGREP
+# -------------
+# This is predefined starting with Autoconf 2.54, so this conditional
+# definition can be removed once we require Autoconf 2.54 or later.
+m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP],
+[AC_CACHE_CHECK([for egrep], [ac_cv_prog_egrep],
+ [if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi])
+ EGREP=$ac_cv_prog_egrep
+ AC_SUBST([EGREP])
+])])
+
+
+# AC_PATH_TOOL_PREFIX
+# -------------------
+# find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] | ?:[\\/]*])
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="ifelse([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC="$ac_dir/$1"
+ 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="$lt_cv_path_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
+ $EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<EOF 1>&2
@@ -353,45 +1891,51 @@ EOF
break
fi
done
- IFS="$ac_save_ifs"
- MAGIC="$ac_save_MAGIC"
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac])
-MAGIC="$lt_cv_path_MAGIC"
-if test -n "$MAGIC"; then
- AC_MSG_RESULT($MAGIC)
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ AC_MSG_RESULT($MAGIC_CMD)
else
AC_MSG_RESULT(no)
fi
-])
+])# AC_PATH_TOOL_PREFIX
-# AC_PATH_MAGIC - find a file program which can recognise a shared library
-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"; then
+# AC_PATH_MAGIC
+# -------------
+# find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
if test -n "$ac_tool_prefix"; then
- AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+ AC_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
else
- MAGIC=:
+ MAGIC_CMD=:
fi
fi
-])
-
-
-# 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_PATH_MAGIC
+
+
+# AC_PROG_LD
+# ----------
+# find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH([gnu-ld],
+ [AC_HELP_STRING([--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([LT_AC_PROG_SED])dnl
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])
+ AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -399,16 +1943,14 @@ 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
+ [[\\/]]* | ?:[[\\/]]*)
+ re_direlt='/[[^/]][[^/]]*/\.\./'
# Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ 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%/%"`
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -426,28 +1968,32 @@ 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-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
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
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
- else
+ ;;
+ *)
test "$with_gnu_ld" != yes && break
- fi
+ ;;
+ esac
fi
done
- IFS="$ac_save_ifs"
+ IFS="$lt_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
@@ -455,34 +2001,52 @@ else
fi
test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
AC_PROG_LD_GNU
-])
+])# AC_PROG_LD
-AC_DEFUN(AC_PROG_LD_GNU,
-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
+
+# AC_PROG_LD_GNU
+# --------------
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+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
-else
- ac_cv_prog_gnu_ld=no
-fi])
-with_gnu_ld=$ac_cv_prog_gnu_ld
-])
+case `"$LD" -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# AC_PROG_LD_GNU
-# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+
+# 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_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
-[lt_cv_ld_reload_flag='-r'])
+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
-test -n "$reload_flag" && reload_flag=" $reload_flag"
-])
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+])# AC_PROG_LD_RELOAD_FLAG
-# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+
+# 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_CACHE_CHECK([how to recognise dependant libraries],
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependent libraries],
lt_cv_deplibs_check_method,
-[lt_cv_file_magic_cmd='${MAGIC}'
+[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
@@ -491,13 +2055,13 @@ lt_cv_deplibs_check_method='unknown'
# `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.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended 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
-aix4*)
+case $host_os in
+aix4* | aix5*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -506,27 +2070,39 @@ 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
;;
-cygwin* | mingw*)
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='${OBJDUMP} -f'
+cygwin* | mingw* | pw32*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ 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
+ lt_cv_deplibs_check_method=pass_all
;;
-freebsd* )
+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.*`
;;
@@ -540,30 +2116,39 @@ 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_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]']
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ 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_test_file=/usr/lib/libc.sl
+ ;;
+ esac
;;
-irix5* | irix6*)
- case "$host_os" in
- irix5*)
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
# 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*`
@@ -571,27 +2156,42 @@ irix5* | irix6*)
;;
# This must be Linux ELF.
-linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+linux*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
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]]+|_pic\.a)$'
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|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ 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
+ ;;
+
+nto-qnx)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
fi
;;
@@ -612,112 +2212,146 @@ solaris*)
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
+ 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*`
+ ;;
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_file_magic_test_file=`echo /usr/lib/libc.so*`
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
;;
esac
;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
])
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
-])
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+])# AC_DEPLIBS_CHECK_METHOD
-# 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,
+# AC_PROG_NM
+# ----------
+# find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_CACHE_CHECK([for BSD-compatible nm], 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-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/${ac_tool_prefix}nm
- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; 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
# 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"
- 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"
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ lt_cv_path_NM="$tmp_nm -B"
break
- else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ 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
+ ;;
+ esac
+ esac
fi
done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi])
-NM="$ac_cv_path_NM"
-AC_MSG_RESULT([$NM])
-])
+NM="$lt_cv_path_NM"
+])# AC_PROG_NM
+
-# AC_CHECK_LIBM - check for math library
-AC_DEFUN(AC_CHECK_LIBM,
+# AC_CHECK_LIBM
+# -------------
+# check for math library
+AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
-case "$host" in
-*-*-beos* | *-*-cygwin*)
- # These system don't have libm
+case $host in
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
+ # These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
- AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+ AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
- AC_CHECK_LIB(m, main, LIBM="-lm")
+ AC_CHECK_LIB(m, cos, LIBM="-lm")
;;
esac
-])
+])# AC_CHECK_LIBM
+
-# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl convenience library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-convenience to the
-# configure arguments. Note that LIBLTDL and INCLTDL are not
-# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not
-# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed
-# with '${top_builddir}/' and INCLTDL will be prefixed with
+# AC_LIBLTDL_CONVENIENCE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl convenience library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-convenience to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided, it is assumed to be `libltdl'. LIBLTDL will
+# be prefixed with '${top_builddir}/' and LTDLINCL will be prefixed with
# '${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" ;;
esac
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
-])
-
-# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
-# the libltdl installable library and INCLTDL to the include flags for
-# the libltdl header and adds --enable-ltdl-install to the configure
-# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
-# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed
-# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will
-# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
-# with '${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.
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_CONVENIENCE
+
+
+# AC_LIBLTDL_INSTALLABLE([DIRECTORY])
+# -----------------------------------
+# sets LIBLTDL to the link flags for the libltdl installable library and
+# LTDLINCL to the include flags for the libltdl header and adds
+# --enable-ltdl-install to the configure arguments. Note that LIBLTDL
+# and LTDLINCL are not AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If
+# DIRECTORY is not provided and an installed libltdl is not found, it is
+# assumed to be `libltdl'. LIBLTDL will be prefixed with '${top_builddir}/'
+# and LTDLINCL will be prefixed with '${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.
# 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_CHECK_LIB(ltdl, main,
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+ AC_CHECK_LIB(ltdl, lt_dlinit,
[test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
[if test x"$enable_ltdl_install" = xno; then
AC_MSG_WARN([libltdl not installed, but installation disabled])
@@ -728,322 +2362,1994 @@ AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
if test x"$enable_ltdl_install" = x"yes"; then
ac_configure_args="$ac_configure_args --enable-ltdl-install"
LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
- INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+ LTDLINCL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
else
ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
LIBLTDL="-lltdl"
- INCLTDL=
+ LTDLINCL=
fi
-])
+ # For backwards non-gettext consistent compatibility...
+ INCLTDL="$LTDLINCL"
+])# AC_LIBLTDL_INSTALLABLE
-# If this macro is not defined by Autoconf, define it here.
-ifdef([AC_PROVIDE_IFELSE],
- [],
- [define([AC_PROVIDE_IFELSE],
- [ifdef([AC_PROVIDE_$1],
- [$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_LIBTOOL_CXX
+# --------------
+# enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX],
+[AC_REQUIRE([_LT_AC_LANG_CXX])
+])# AC_LIBTOOL_CXX
+
+
+# _LT_AC_LANG_CXX
+# ---------------
+AC_DEFUN([_LT_AC_LANG_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"
-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="$MAGIC" 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 -o libtool $libtool_flags \
---build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
-|| AC_MSG_ERROR([libtool tag configuration failed])
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`])
+])# _LT_AC_LANG_CXX
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-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_REQUIRE([AC_PROG_LIBTOOL])
-AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
- [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
- [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
- [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
- [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])
-LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
-lt_save_CC="$CC"
-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="" \
-MAGIC="$MAGIC" 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 -o libtool $libtool_flags \
---build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
-|| AC_MSG_ERROR([libtool tag configuration failed])
-CC="$lt_save_CC"
-CFLAGS="$lt_save_CFLAGS"
+# AC_LIBTOOL_F77
+# --------------
+# enable support for Fortran 77 libraries
+AC_DEFUN([AC_LIBTOOL_F77],
+[AC_REQUIRE([_LT_AC_LANG_F77])
+])# AC_LIBTOOL_F77
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-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
+# _LT_AC_LANG_F77
+# ---------------
+AC_DEFUN([_LT_AC_LANG_F77],
+[AC_REQUIRE([AC_PROG_F77])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,F77" | sed 's/^,//'`])
+])# _LT_AC_LANG_F77
-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)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
- AC_SUBST(GCJFLAGS)
-])
+# AC_LIBTOOL_GCJ
+# --------------
+# enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],
+[AC_REQUIRE([_LT_AC_LANG_GCJ])
+])# AC_LIBTOOL_GCJ
-# serial 1 AC_LIB_LTDL
-AC_DEFUN(AC_LIB_LTDL,
-[AC_PREREQ(2.13)dnl
-AC_REQUIRE([AC_PROG_CC])dnl
-AC_REQUIRE([AC_C_CONST])dnl
-AC_REQUIRE([AC_C_INLINE])dnl
-
-dnl AC_LIB_LTDL must perform all the checks necessary for compilation
-dnl of the ltdl objects -- including compiler checks (above) and header
-dnl checks (below).
-AC_REQUIRE([AC_HEADER_STDC])dnl
-
-AC_CHECK_HEADERS(malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h)
-AC_CHECK_HEADERS(string.h strings.h, break)
-AC_CHECK_FUNCS(strchr index, break)
-AC_CHECK_FUNCS(strrchr rindex, break)
-AC_CHECK_FUNCS(strcmp)
-
-AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])dnl
-AC_REQUIRE([AC_LTDL_SHLIBEXT])dnl
-AC_REQUIRE([AC_LTDL_SHLIBPATH])dnl
-AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])dnl
-AC_REQUIRE([AC_LTDL_OBJDIR])dnl
-AC_REQUIRE([AC_LTDL_DLPREOPEN])dnl
-AC_REQUIRE([AC_LTDL_DLLIB])dnl
-AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
-])
+# _LT_AC_LANG_GCJ
+# ---------------
+AC_DEFUN([_LT_AC_LANG_GCJ],
+[AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+ [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+ [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+ [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+ [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,GCJ" | sed 's/^,//'`])
+])# _LT_AC_LANG_GCJ
-AC_DEFUN(AC_LTDL_ENABLE_INSTALL,
-[AC_ARG_ENABLE(ltdl-install,
-[ --enable-ltdl-install install libltdl])
-AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
-AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
-])])
+# AC_LIBTOOL_RC
+# --------------
+# enable support for Windows resource files
+AC_DEFUN([AC_LIBTOOL_RC],
+[AC_REQUIRE([LT_AC_PROG_RC])
+_LT_AC_SHELL_INIT([tagnames=`echo "$tagnames,RC" | sed 's/^,//'`])
+])# AC_LIBTOOL_RC
-AC_DEFUN(AC_LTDL_SNARF_CONFIG,
-[# Read the libtool configuration
-rm -f conftest
-./libtool --config > conftest
-. ./conftest
-rm -f conftest
-])
+# AC_LIBTOOL_LANG_C_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG], [_LT_AC_LANG_C_CONFIG])
+AC_DEFUN([_LT_AC_LANG_C_CONFIG],
+[lt_save_CC="$CC"
+AC_LANG_PUSH(C)
-AC_DEFUN(AC_LTDL_SHLIBEXT,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([which extension is used for shared libraries],
- libltdl_cv_shlibext, [dnl
-(
- last=
- for spec in $library_names_spec; do
- last="$spec"
- done
-changequote(, )
- echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-changequote([, ])
-)
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
-])
-if test -n "$libltdl_cv_shlibext"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
- [Define to the extension used for shared libraries, say, ".so". ])
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+_LT_AC_SYS_COMPILER
+
+#
+# Check for any special shared library compilation flags.
+#
+_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_cc_shlib, $1)='-belf'
+ ;;
+ esac
+fi
+if test -n "$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)"; then
+ AC_MSG_WARN([`$CC' requires `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to build shared libraries])
+ if echo "$old_CC $old_CFLAGS " | grep "[[ ]]$]_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)[[[ ]]" >/dev/null; then :
+ else
+ AC_MSG_WARN([add `$_LT_AC_TAGVAR(lt_prog_cc_shlib, $1)' to the CC or CFLAGS env variable and reconfigure])
+ _LT_AC_TAGVAR(lt_cv_prog_cc_can_build_shared, $1)=no
+ fi
fi
-])
-AC_DEFUN(AC_LTDL_SHLIBPATH,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([which variable specifies run-time library path],
- libltdl_cv_shlibpath_var, [libltdl_cv_shlibpath_var="$shlibpath_var"])
-if test -n "$libltdl_cv_shlibpath_var"; then
- AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
- [Define to the name of the environment variable that determines the dynamic library search path. ])
+
+#
+# Check to make sure the static flag actually works.
+#
+AC_LIBTOOL_LINKER_OPTION([if $compiler static flag $_LT_AC_TAGVAR(lt_prog_compiler_static, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_static_works, $1),
+ $_LT_AC_TAGVAR(lt_prog_compiler_static, $1),
+ [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=])
+
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+# Report which librarie types wil actually be built
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ output_verbose_link_cmd='echo'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_C_CONFIG
+
+
+# AC_LIBTOOL_LANG_CXX_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG], [_LT_AC_LANG_CXX_CONFIG(CXX)])
+AC_DEFUN([_LT_AC_LANG_CXX_CONFIG],
+[AC_LANG_PUSH(C++)
+AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Dependencies to place before and after the object being linked:
+_LT_AC_TAGVAR(predep_objects, $1)=
+_LT_AC_TAGVAR(postdep_objects, $1)=
+_LT_AC_TAGVAR(predeps, $1)=
+_LT_AC_TAGVAR(postdeps, $1)=
+_LT_AC_TAGVAR(compiler_lib_search_path, $1)=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *[]) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
+fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
+fi
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+else
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
-])
-AC_DEFUN(AC_LTDL_SYSSEARCHPATH,
-[AC_REQUIRE([AC_LTDL_SNARF_CONFIG])dnl
-AC_CACHE_CHECK([for the default library search path],
- libltdl_cv_sys_search_path, [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
-if test -n "$libltdl_cv_sys_search_path"; then
- case "$host" in
- *-*-mingw*) pathsep=";" ;;
- *) pathsep=":" ;;
- esac
- sys_search_path=
- for dir in $libltdl_cv_sys_search_path; do
- if test -z "$sys_search_path"; then
- sys_search_path="$dir"
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
+
+ AC_PROG_LD
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
else
- sys_search_path="$sys_search_path$pathsep$dir"
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
fi
- done
- AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
- [Define to the system default library search path. ])
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # 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 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
fi
+
+# PORTME: fill in a description of your system's C++ link characteristics
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+_LT_AC_TAGVAR(ld_shlibs, $1)=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$GXX" = 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
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=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
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ freebsd[12]*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ freebsd-elf*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ freebsd*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=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
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+ esac
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ _LT_AC_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ cxx)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ sco*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[[LR]]"`; 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
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+esac
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$GXX"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_POSTDEP_PREDEP($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+])# AC_LIBTOOL_LANG_CXX_CONFIG
+
+# AC_LIBTOOL_POSTDEP_PREDEP([TAGNAME])
+# ------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP],[
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library. It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+ifelse([$1],[],[cat > conftest.$ac_ext <<EOF
+int a;
+void foo (void) { a = 0; }
+EOF
+],[$1],[CXX],[cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+],[$1],[F77],[cat > conftest.$ac_ext <<EOF
+ subroutine foo
+ implicit none
+ integer*4 a
+ a=0
+ return
+ end
+EOF
+],[$1],[GCJ],[cat > conftest.$ac_ext <<EOF
+public class foo {
+ private int a;
+ public void bar (void) {
+ a = 0;
+ }
+};
+EOF
])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$_LT_AC_TAGVAR(compiler_lib_search_path, $1)"; then
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1)="${_LT_AC_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$_LT_AC_TAGVAR(postdeps, $1)"; then
+ _LT_AC_TAGVAR(postdeps, $1)="${prev}${p}"
+ else
+ _LT_AC_TAGVAR(postdeps, $1)="${_LT_AC_TAGVAR(postdeps, $1)} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$_LT_AC_TAGVAR(predep_objects, $1)"; then
+ _LT_AC_TAGVAR(predep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(predep_objects, $1)="$_LT_AC_TAGVAR(predep_objects, $1) $p"
+ fi
+ else
+ if test -z "$_LT_AC_TAGVAR(postdep_objects, $1)"; then
+ _LT_AC_TAGVAR(postdep_objects, $1)="$p"
+ else
+ _LT_AC_TAGVAR(postdep_objects, $1)="$_LT_AC_TAGVAR(postdep_objects, $1) $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
-AC_DEFUN(AC_LTDL_OBJDIR,
-[AC_CACHE_CHECK([for objdir],
- libltdl_cv_objdir, [libltdl_cv_objdir="$objdir"
-if test -n "$objdir"; then
- :
+ esac
+ done
+
+ # Clean up.
+ rm -f a.out a.exe
else
- rm -f .libs 2>/dev/null
- mkdir .libs 2>/dev/null
- if test -d .libs; then
- libltdl_cv_objdir=.libs
- else
- # MS-DOS does not allow filenames that begin with a dot.
- libltdl_cv_objdir=_libs
- fi
-rmdir .libs 2>/dev/null
-fi])
-AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries. ])
-])
+ echo "libtool.m4: error: problem compiling $1 test program"
+fi
-AC_DEFUN(AC_LTDL_DLPREOPEN,
-[AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])dnl
-AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
- libltdl_cv_preloaded_symbols, [dnl
- if test -n "$global_symbol_pipe"; then
- libltdl_cv_preloaded_symbols=yes
- else
- libltdl_cv_preloaded_symbols=no
+$rm -f confest.$objext
+
+case " $_LT_AC_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+])# AC_LIBTOOL_POSTDEP_PREDEP
+
+# AC_LIBTOOL_LANG_F77_CONFIG
+# ------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG], [_LT_AC_LANG_F77_CONFIG(F77)])
+AC_DEFUN([_LT_AC_LANG_F77_CONFIG],
+[AC_REQUIRE([AC_PROG_F77])
+AC_LANG_PUSH(Fortran 77)
+
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_AC_TAGVAR(allow_undefined_flag, $1)=
+_LT_AC_TAGVAR(always_export_symbols, $1)=no
+_LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_direct, $1)=no
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+_LT_AC_TAGVAR(hardcode_automatic, $1)=no
+_LT_AC_TAGVAR(module_cmds, $1)=
+_LT_AC_TAGVAR(module_expsym_cmds, $1)=
+_LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_AC_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_AC_TAGVAR(no_undefined_flag, $1)=
+_LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+AC_MSG_CHECKING([if libtool supports shared libraries])
+AC_MSG_RESULT([$can_build_shared])
+
+AC_MSG_CHECKING([whether to build shared libraries])
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
fi
-])
-if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
- AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
- [Define if libtool can extract symbol lists from object files. ])
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
+ ;;
+esac
+AC_MSG_RESULT([$enable_shared])
+
+AC_MSG_CHECKING([whether to build static libraries])
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+AC_MSG_RESULT([$enable_static])
+
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_AC_TAGVAR(GCC, $1)="$G77"
+_LT_AC_TAGVAR(LD, $1)="$LD"
+
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_POP
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_F77_CONFIG
+
+
+# AC_LIBTOOL_LANG_GCJ_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the C compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG], [_LT_AC_LANG_GCJ_CONFIG(GCJ)])
+AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[] argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+
+AC_LIBTOOL_PROG_COMPILER_NO_RTTI($1)
+AC_LIBTOOL_PROG_COMPILER_PIC($1)
+AC_LIBTOOL_PROG_CC_C_O($1)
+AC_LIBTOOL_SYS_HARD_LINK_LOCKS($1)
+AC_LIBTOOL_PROG_LD_SHLIBS($1)
+AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH($1)
+AC_LIBTOOL_SYS_LIB_STRIP
+AC_LIBTOOL_SYS_DYNAMIC_LINKER($1)
+AC_LIBTOOL_DLOPEN_SELF($1)
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_GCJ_CONFIG
+
+
+# AC_LIBTOOL_LANG_RC_CONFIG
+# --------------------------
+# Ensure that the configuration vars for the Windows resource compiler are
+# suitably defined. Those variables are subsequently used by
+# AC_LIBTOOL_CONFIG to write the compiler configuration to `libtool'.
+AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG], [_LT_AC_LANG_RC_CONFIG(RC)])
+AC_DEFUN([_LT_AC_LANG_RC_CONFIG],
+[AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_AC_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_AC_SYS_COMPILER
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+_LT_AC_TAGVAR(compiler, $1)=$CC
+_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+AC_LIBTOOL_CONFIG($1)
+
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# AC_LIBTOOL_LANG_RC_CONFIG
+
+
+# AC_LIBTOOL_CONFIG([TAGNAME])
+# ----------------------------
+# If TAGNAME is not passed, then create an initial libtool script
+# with a default configuration from the untagged config vars. Otherwise
+# add code to config.status for appending the configuration named by
+# TAGNAME from the matching tagged config vars.
+AC_DEFUN([AC_LIBTOOL_CONFIG],
+[# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ _LT_AC_TAGVAR(compiler, $1) \
+ _LT_AC_TAGVAR(CC, $1) \
+ _LT_AC_TAGVAR(LD, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1) \
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) \
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1) \
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1) \
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1) \
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1) \
+ _LT_AC_TAGVAR(old_archive_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) \
+ _LT_AC_TAGVAR(predep_objects, $1) \
+ _LT_AC_TAGVAR(postdep_objects, $1) \
+ _LT_AC_TAGVAR(predeps, $1) \
+ _LT_AC_TAGVAR(postdeps, $1) \
+ _LT_AC_TAGVAR(compiler_lib_search_path, $1) \
+ _LT_AC_TAGVAR(archive_cmds, $1) \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(postinstall_cmds, $1) \
+ _LT_AC_TAGVAR(postuninstall_cmds, $1) \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) \
+ _LT_AC_TAGVAR(allow_undefined_flag, $1) \
+ _LT_AC_TAGVAR(no_undefined_flag, $1) \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1) \
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1) \
+ _LT_AC_TAGVAR(hardcode_automatic, $1) \
+ _LT_AC_TAGVAR(module_cmds, $1) \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) \
+ _LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1) \
+ _LT_AC_TAGVAR(exclude_expsyms, $1) \
+ _LT_AC_TAGVAR(include_expsyms, $1); do
+
+ case $var in
+ _LT_AC_TAGVAR(old_archive_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_new_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_cmds, $1) | \
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(module_cmds, $1) | \
+ _LT_AC_TAGVAR(module_expsym_cmds, $1) | \
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1) | \
+ _LT_AC_TAGVAR(export_symbols_cmds, $1) | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\[$]0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\[$]0 --fallback-echo"[$]/[$]0 --fallback-echo"/'`
+ ;;
+ esac
+
+ifelse([$1], [],
+ [cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ AC_MSG_NOTICE([creating $ofile])],
+ [cfgfile="$ofile"])
+
+ cat <<__EOF__ >> "$cfgfile"
+ifelse([$1], [],
+[#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG],
+[# ### BEGIN LIBTOOL TAG CONFIG: $tagname])
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$_LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
+
+# Is the compiler the GNU C compiler?
+with_gcc=$_LT_AC_TAGVAR(GCC, $1)
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_[]_LT_AC_TAGVAR(LD, $1)
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_[]_LT_AC_TAGVAR(lt_cv_prog_compiler_c_o, $1)
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_static, $1)
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_[]_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_[]_LT_AC_TAGVAR(export_dynamic_flag_spec, $1)
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_[]_LT_AC_TAGVAR(whole_archive_flag_spec, $1)
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_[]_LT_AC_TAGVAR(thread_safe_flag_spec, $1)
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_cmds, $1)
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_new_cmds, $1)
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_[]_LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_[]_LT_AC_TAGVAR(archive_cmds, $1)
+archive_expsym_cmds=$lt_[]_LT_AC_TAGVAR(archive_expsym_cmds, $1)
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_[]_LT_AC_TAGVAR(module_cmds, $1)
+module_expsym_cmds=$lt_[]_LT_AC_TAGVAR(module_expsym_cmds, $1)
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_[]_LT_AC_TAGVAR(predeps, $1)
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_[]_LT_AC_TAGVAR(allow_undefined_flag, $1)
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_[]_LT_AC_TAGVAR(no_undefined_flag, $1)
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$_LT_AC_TAGVAR(hardcode_action, $1)
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_[]_LT_AC_TAGVAR(hardcode_libdir_separator, $1)
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$_LT_AC_TAGVAR(hardcode_direct, $1)
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$_LT_AC_TAGVAR(hardcode_minus_L, $1)
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$_LT_AC_TAGVAR(hardcode_automatic, $1)
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$_LT_AC_TAGVAR(fix_srcfile_path, $1)"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$_LT_AC_TAGVAR(always_export_symbols, $1)
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_[]_LT_AC_TAGVAR(export_symbols_cmds, $1)
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_[]_LT_AC_TAGVAR(exclude_expsyms, $1)
+
+# Symbols that must always be exported.
+include_expsyms=$lt_[]_LT_AC_TAGVAR(include_expsyms, $1)
+
+ifelse([$1],[],
+[# ### END LIBTOOL CONFIG],
+[# ### END LIBTOOL TAG CONFIG: $tagname])
+
+__EOF__
+
+ifelse([$1],[], [
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
fi
-])
+EOF
+ ;;
+ esac
-AC_DEFUN(AC_LTDL_DLLIB,
-[LIBADD_DL=
-AC_CHECK_LIB(dl, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent. ]) LIBADD_DL="-ldl"],
-[AC_CHECK_FUNC(dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent.])],
-[AC_CHECK_LIB(svld, dlopen, [AC_DEFINE(HAVE_LIBDL, 1,
- [Define if you have the libdl library or equivalent.]) LIBADD_DL="-lsvld"]
-)])])
-AC_CHECK_FUNC(shl_load, [AC_DEFINE(HAVE_SHL_LOAD, 1,
- [Define if you have the shl_load function.])],
-[AC_CHECK_LIB(dld, shl_load,
- [AC_DEFINE(HAVE_SHL_LOAD, 1,
- [Define if you have the shl_load function.])
- LIBADD_DL="$LIBADD_DL -ldld"])
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
])
-AC_CHECK_LIB(dld, dld_link, [AC_DEFINE(HAVE_DLD, 1,
- [Define if you have the GNU dld library.])dnl
-test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"])
-AC_SUBST(LIBADD_DL)
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+])# AC_LIBTOOL_CONFIG
+
+
+# AC_LIBTOOL_PROG_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI],
+[AC_REQUIRE([_LT_AC_SYS_COMPILER])dnl
-if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
- LIBS_SAVE="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- AC_CHECK_FUNCS(dlerror)
- LIBS="$LIBS_SAVE"
+_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+ lt_cv_prog_compiler_rtti_exceptions,
+ [-fno-rtti -fno-exceptions], [],
+ [_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
fi
-])
+])# AC_LIBTOOL_PROG_COMPILER_NO_RTTI
-AC_DEFUN(AC_LTDL_GLOBAL_SYMBOL_PIPE,
-[dnl Check for command to grab the raw symbol name followed
-dnl by C symbol name from nm.
-AC_REQUIRE([AC_CANONICAL_HOST])dnl
-AC_REQUIRE([AC_PROG_NM])dnl
+
+# AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+# ---------------------------------
+AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_REQUIRE([AC_PROG_NM])
+AC_REQUIRE([AC_OBJEXT])
# 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?!! ;)}
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_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]'
+symcode='[[BCDEGRST]]'
# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+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'
+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'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
# Define system-specific variables.
-case "$host_os" in
+case $host_os in
aix*)
- ac_symcode='[BCDT]'
+ symcode='[[BCDT]]'
;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
+cygwin* | mingw* | pw32*)
+ symcode='[[ABCDGISTW]]'
;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[[ABCDEGRST]]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
-irix*)
- ac_symcode='[BCDEGRST]'
+irix* | nonstopux*)
+ symcode='[[BCDEGRST]]'
;;
-solaris*)
- ac_symcode='[BDT]'
+osf*)
+ symcode='[[BCDEGQRST]]'
+ ;;
+solaris* | sysv5*)
+ symcode='[[BDT]]'
+ ;;
+sysv4)
+ symcode='[[DFNSTU]]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
;;
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
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[[ABCDGISTW]]' ;;
+esac
# 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'"
+ # Write the raw and C identifiers.
+ lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*\($ac_symprfx\)$sympat$opt_cr$/$symxfrm/p'"
# Check to see that the pipe works correctly.
- ac_pipe_works=no
- rm -f conftest.$ac_ext
+ pipe_works=no
+
+ rm -f conftest*
cat > conftest.$ac_ext <<EOF
#ifdef __cplusplus
extern "C" {
@@ -1053,35 +4359,33 @@ void nm_test_func(){}
#ifdef __cplusplus
}
#endif
-int main(){nm_test_var='a';nm_test_func;return 0;}
+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
-
+ nlist=conftest.nm
+ if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then
# Try sorting and uniquifying the output.
- if sort "$ac_nlist" | uniq > "$ac_nlist"T; then
- mv -f "$ac_nlist"T "$ac_nlist"
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
else
- rm -f "$ac_nlist"T
+ rm -f "$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
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
#ifdef __cplusplus
extern "C" {
#endif
EOF
# Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
- cat <<EOF >> conftest.c
+ cat <<EOF >> conftest.$ac_ext
#if defined (__STDC__) && __STDC__
# define lt_ptr_t void *
#else
@@ -1094,13 +4398,11 @@ const struct {
const char *name;
lt_ptr_t address;
}
-changequote(,)dnl
-lt_preloaded_symbols[] =
-changequote([,])dnl
+lt_preloaded_symbols[[]] =
{
EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
{0, (lt_ptr_t) 0}
};
@@ -1110,221 +4412,2144 @@ EOF
EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
LIBS="conftstm.$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
+ CFLAGS="$CFLAGS$_LT_AC_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+ if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ pipe_works=yes
fi
- LIBS="$ac_save_LIBS"
- CFLAGS="$ac_save_CFLAGS"
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
else
- echo "cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
- echo "cannot find nm_test_var in $ac_nlist" >&AC_FD_CC
+ echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
fi
else
- echo "cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
fi
else
- echo "$progname: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
+ echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+ cat conftest.$ac_ext >&5
fi
- rm -rf conftest* conftst*
+ rm -f conftest* conftst*
# 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
+ if test "$pipe_works" = yes; then
break
else
- ac_cv_sys_global_symbol_pipe=
+ lt_cv_sys_global_symbol_pipe=
fi
done
])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ AC_MSG_RESULT(failed)
+else
+ AC_MSG_RESULT(ok)
+fi
+]) # AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE
+
+
+# AC_LIBTOOL_PROG_COMPILER_PIC([TAGNAME])
+# ---------------------------------------
+AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC],
+[_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_AC_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+ ifelse([$1],[CXX],[
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+ 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'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="--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
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ fi
+ ;;
+ aCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+],
+[
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ 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'.
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ else
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
+ mingw* | pw32* | 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).
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # PIC (with -KPIC) is the default.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc|ecc)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ ccc)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All Alpha code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ # All OSF/1 code is PIC.
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kpic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-dn'
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ _LT_AC_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+ _LT_AC_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+ ;;
+ esac
+ fi
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ AC_LIBTOOL_COMPILER_OPTION([if $compiler PIC flag $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) works],
+ _LT_AC_TAGVAR(lt_prog_compiler_pic_works, $1),
+ [$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])], [],
+ [case $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1) in
+ "" | " "*) ;;
+ *) _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+ esac],
+ [_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ _LT_AC_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
fi
-AC_MSG_RESULT($ac_result)
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)=
+ ;;
+ *)
+ _LT_AC_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_AC_TAGVAR(lt_prog_compiler_pic, $1)ifelse([$1],[],[ -DPIC],[ifelse([$1],[CXX],[ -DPIC],[])])"
+ ;;
+esac
])
-AC_DEFUN(AC_LTDL_SYMBOL_USCORE,
-[dnl does the compiler prefix global symbols with an underscore?
-AC_REQUIRE([AC_LTDL_GLOBAL_SYMBOL_PIPE])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
+
+# AC_LIBTOOL_PROG_LD_SHLIBS([TAGNAME])
+# ------------------------------------
+# See if the linker supports building shared libraries.
+AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS],
+[AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+ifelse([$1],[CXX],[
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # 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 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
else
- if egrep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
- :
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ ;;
+ pw32*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+],[
+ runpath_var=
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+ _LT_AC_TAGVAR(archive_cmds, $1)=
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)=
+ _LT_AC_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
+ _LT_AC_TAGVAR(thread_safe_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=unknown
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=no
+ _LT_AC_TAGVAR(module_cmds, $1)=
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)=
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ _LT_AC_TAGVAR(include_expsyms, $1)=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ _LT_AC_TAGVAR(exclude_expsyms, $1)="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=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.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&AC_FD_CC
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=no
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGS]] /s/.* \([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+
+ sunos4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+
+ if test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = yes; then
+ runpath_var=LD_RUN_PATH
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=
fi
fi
else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&AC_FD_CC
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ _LT_AC_TAGVAR(hardcode_direct, $1)=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # 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 | grep 'GNU' > /dev/null; then
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ else
+ _LT_AC_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\[$]2 == "T") || (\[$]2 == "D") || (\[$]2 == "B")) && ([substr](\[$]3,1,1) != ".")) { print \[$]3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[[23]]|aix4.[[23]].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ _LT_AC_TAGVAR(archive_cmds, $1)=''
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=':'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+
+ if test "$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
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ else
+ # We have old collect2
+ _LT_AC_TAGVAR(hardcode_direct, $1)=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
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ fi
+
+ # It seems that -bexpall does not export symbols beginning with
+ # underscore (_), so it is better to generate a list of symbols to export.
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ _LT_AC_SYS_LIBPATH_AIX
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ _LT_AC_TAGVAR(always_export_symbols, $1)=yes
+ # Exported symbols can be pulled into shared objects from archives
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)="\$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*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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)'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ # see comment about different semantics on the GNU ld section
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ bsdi4*)
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_AC_TAGVAR(old_archive_cmds, $1)='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ _LT_AC_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && _LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ _LT_AC_TAGVAR(module_cmds, $1)='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ _LT_AC_TAGVAR(module_expsym_cmds, $1)='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_automatic, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-all_load $convenience'
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ fi
+ ;;
+
+ dgux*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ freebsd1*)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+ ia64*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ *)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ newsos6)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ openbsd*)
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ else
+ case $host_os in
+ openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ ;;
+ *)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_AC_TAGVAR(archive_cmds, $1)='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ _LT_AC_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$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}${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ else
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ # Both c and cxx compiler support -rpath directly
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_separator, $1)=:
+ ;;
+
+ sco3.2v5*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -z text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ case $host_os in
+ solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ _LT_AC_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;;
+ esac
+ _LT_AC_TAGVAR(link_all_deplibs, $1)=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no
+ ;;
+ motorola)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv4.3*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ _LT_AC_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ _LT_AC_TAGVAR(ld_shlibs, $1)=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_direct, $1)=yes
+ _LT_AC_TAGVAR(hardcode_minus_L, $1)=no
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[[78]]* | unixware7*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ _LT_AC_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ sysv5*)
+ _LT_AC_TAGVAR(no_undefined_flag, $1)=' -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
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(archive_expsym_cmds, $1)='$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'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)=
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ _LT_AC_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_AC_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
+ ;;
+
+ *)
+ _LT_AC_TAGVAR(ld_shlibs, $1)=no
+ ;;
+ esac
fi
-else
- echo "configure: failed program was:" >&AC_FD_CC
- cat conftest.c >&AC_FD_CC
+])
+AC_MSG_RESULT([$_LT_AC_TAGVAR(ld_shlibs, $1)])
+test "$_LT_AC_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-rm -rf conftest*
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+ # Assume -lc should be added
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $_LT_AC_TAGVAR(archive_cmds, $1) in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ AC_MSG_CHECKING([whether -lc should be explicitly linked in])
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$_LT_AC_TAGVAR(lt_prog_compiler_wl, $1)
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$_LT_AC_TAGVAR(allow_undefined_flag, $1)
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=
+ if AC_TRY_EVAL(_LT_AC_TAGVAR(archive_cmds, $1) 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1)
+ then
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=no
+ else
+ _LT_AC_TAGVAR(archive_cmds_need_lc, $1)=yes
+ fi
+ _LT_AC_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ AC_MSG_RESULT([$_LT_AC_TAGVAR(archive_cmds_need_lc, $1)])
+ ;;
+ esac
+ fi
+ ;;
+esac
+])# AC_LIBTOOL_PROG_LD_SHLIBS
+
+
+# _LT_AC_FILE_LTDLL_C
+# -------------------
+# Be careful that the start marker always follows a newline.
+AC_DEFUN([_LT_AC_FILE_LTDLL_C], [
+# /* ltdll.c starts here */
+# #define WIN32_LEAN_AND_MEAN
+# #include <windows.h>
+# #undef WIN32_LEAN_AND_MEAN
+# #include <stdio.h>
+#
+# #ifndef __CYGWIN__
+# # ifdef __CYGWIN32__
+# # define __CYGWIN__ __CYGWIN32__
+# # endif
+# #endif
+#
+# #ifdef __cplusplus
+# extern "C" {
+# #endif
+# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved);
+# #ifdef __cplusplus
+# }
+# #endif
+#
+# #ifdef __CYGWIN__
+# #include <cygwin/cygwin_dll.h>
+# DECLARE_CYGWIN_DLL( DllMain );
+# #endif
+# HINSTANCE __hDllInstance_base;
+#
+# BOOL APIENTRY
+# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved)
+# {
+# __hDllInstance_base = hInst;
+# return TRUE;
+# }
+# /* ltdll.c ends here */
+])# _LT_AC_FILE_LTDLL_C
+
+
+# _LT_AC_TAGVAR(VARNAME, [TAGNAME])
+# ---------------------------------
+AC_DEFUN([_LT_AC_TAGVAR], [ifelse([$2], [], [$1], [$1_$2])])
+
+
+# old names
+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])
+
+# This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+ test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ AC_SUBST(GCJFLAGS)
])
-AC_MSG_RESULT($ac_cv_sys_symbol_underscore)
-AC_LTDL_DLSYM_USCORE
+
+AC_DEFUN([LT_AC_PROG_RC],
+[AC_CHECK_TOOL(RC, windres, no)
])
-AC_DEFUN(AC_LTDL_DLSYM_USCORE,
-[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])dnl
-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
- AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
- libltdl_cv_need_uscore, [dnl
- AC_TRY_RUN([
-#if HAVE_DLFCN_H
-#include <dlfcn.h>
-#endif
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_SED. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+# LT_AC_PROG_SED
+# --------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible. Prefer GNU sed if found.
+AC_DEFUN([LT_AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+SED=$lt_cv_path_SED
+])
+AC_MSG_RESULT([$SED])
+])
-#include <stdio.h>
+# serial 6 AC_LIB_LTDL
+
+# AC_WITH_LTDL
+# ------------
+# Clients of libltdl can use this macro to allow the installer to
+# choose between a shipped copy of the ltdl sources or a preinstalled
+# version of the library.
+AC_DEFUN([AC_WITH_LTDL],
+[AC_REQUIRE([AC_LIB_LTDL])
+AC_SUBST([LIBLTDL])
+AC_SUBST([INCLTDL])
+
+# Unless the user asks us to check, assume no installed ltdl exists.
+use_installed_libltdl=no
+
+AC_ARG_WITH([included_ltdl],
+ [ --with-included-ltdl use the GNU ltdl sources included here])
+
+if test "x$with_included_ltdl" != xyes; then
+ # We are not being forced to use the included libltdl sources, so
+ # decide whether there is a useful installed version we can use.
+ AC_CHECK_HEADER([ltdl.h],
+ [AC_CHECK_LIB([ltdl], [lt_dlcaller_register],
+ [with_included_ltdl=no],
+ [with_included_ltdl=yes])
+ ])
+fi
-#ifdef RTLD_GLOBAL
-# define LTDL_GLOBAL RTLD_GLOBAL
-#else
-# ifdef DL_GLOBAL
-# define LTDL_GLOBAL DL_GLOBAL
-# else
-# define LTDL_GLOBAL 0
-# endif
-#endif
+if test "x$enable_ltdl_install" != xyes; then
+ # If the user did not specify an installable libltdl, then default
+ # to a convenience lib.
+ AC_LIBLTDL_CONVENIENCE
+fi
-/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
- find out it does not work in some platform. */
-#ifndef LTDL_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LTDL_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LTDL_LAZY_OR_NOW DL_LAZY
-# else
-# ifdef RTLD_NOW
-# define LTDL_LAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LTDL_LAZY_OR_NOW DL_NOW
-# else
-# define LTDL_LAZY_OR_NOW 0
-# endif
-# endif
-# endif
-# endif
+if test "x$with_included_ltdl" = xno; then
+ # If the included ltdl is not to be used. then Use the
+ # preinstalled libltdl we found.
+ AC_DEFINE([HAVE_LTDL], 1,
+ [Define this if a modern libltdl is already installed])
+ LIBLTDL=-lltdl
+fi
+
+# Report our decision...
+AC_MSG_CHECKING([whether to use included libltdl])
+AC_MSG_RESULT([$with_included_ltdl])
+
+AC_CONFIG_SUBDIRS([libltdl])
+])# AC_WITH_LTDL
+
+
+# AC_LIB_LTDL
+# -----------
+# Perform all the checks necessary for compilation of the ltdl objects
+# -- including compiler checks and header checks.
+AC_DEFUN([AC_LIB_LTDL],
+[AC_PREREQ(2.50)
+AC_REQUIRE([AC_PROG_CC])
+AC_REQUIRE([AC_C_CONST])
+AC_REQUIRE([AC_HEADER_STDC])
+AC_REQUIRE([AC_HEADER_DIRENT])
+AC_REQUIRE([_LT_AC_CHECK_DLFCN])
+AC_REQUIRE([AC_LTDL_ENABLE_INSTALL])
+AC_REQUIRE([AC_LTDL_SHLIBEXT])
+AC_REQUIRE([AC_LTDL_SHLIBPATH])
+AC_REQUIRE([AC_LTDL_SYSSEARCHPATH])
+AC_REQUIRE([AC_LTDL_OBJDIR])
+AC_REQUIRE([AC_LTDL_DLPREOPEN])
+AC_REQUIRE([AC_LTDL_DLLIB])
+AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
+AC_REQUIRE([AC_LTDL_DLSYM_USCORE])
+AC_REQUIRE([AC_LTDL_SYS_DLOPEN_DEPLIBS])
+AC_REQUIRE([AC_LTDL_FUNC_ARGZ])
+
+AC_CHECK_HEADERS([assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
+ stdio.h unistd.h])
+AC_CHECK_HEADERS([dl.h sys/dl.h dld.h mach-o/dyld.h])
+AC_CHECK_HEADERS([string.h strings.h], [break])
+
+AC_CHECK_FUNCS([strchr index], [break])
+AC_CHECK_FUNCS([strrchr rindex], [break])
+AC_CHECK_FUNCS([memcpy bcopy], [break])
+AC_CHECK_FUNCS([memmove strcmp])
+AC_CHECK_FUNCS([closedir opendir readdir])
+])# AC_LIB_LTDL
+
+
+# AC_LTDL_ENABLE_INSTALL
+# ----------------------
+AC_DEFUN([AC_LTDL_ENABLE_INSTALL],
+[AC_ARG_ENABLE([ltdl-install],
+ [AC_HELP_STRING([--enable-ltdl-install], [install libltdl])])
+
+AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
+AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)
+])])# AC_LTDL_ENABLE_INSTALL
+
+
+# AC_LTDL_SYS_DLOPEN_DEPLIBS
+# --------------------------
+AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS],
+[AC_REQUIRE([AC_CANONICAL_HOST])
+AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
+ [libltdl_cv_sys_dlopen_deplibs],
+ [# PORTME does your system automatically load deplibs for dlopen?
+ # or its logical equivalent (e.g. shl_load for HP-UX < 11)
+ # For now, we just catch OSes we know something about -- in the
+ # future, we'll try test this programmatically.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ case "$host_os" in
+ aix3*|aix4.1.*|aix4.2.*)
+ # Unknown whether this is true for these versions of AIX, but
+ # we want this `case' here to explicitly catch those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ aix[[45]]*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ darwin*)
+ # Assuming the user has installed a libdl from somewhere, this is true
+ # If you are looking for one http://www.opendarwin.org/projects/dlcompat
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ gnu*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ hpux10*|hpux11*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ irix[[12345]]*|irix6.[[01]]*)
+ # Catch all versions of IRIX before 6.2, and indicate that we don't
+ # know how it worked for any of those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ irix*)
+ # The case above catches anything before 6.2, and it's known that
+ # at 6.2 and later dlopen does load deplibs.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ linux*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ netbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ openbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ osf[[1234]]*)
+ # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
+ # it did *not* use an RPATH in a shared library to find objects the
+ # library depends on, so we explictly say `no'.
+ libltdl_cv_sys_dlopen_deplibs=no
+ ;;
+ osf5.0|osf5.0a|osf5.1)
+ # dlopen *does* load deplibs and with the right loader patch applied
+ # it even uses RPATH in a shared library to search for shared objects
+ # that the library depends on, but there's no easy way to know if that
+ # patch is installed. Since this is the case, all we can really
+ # say is unknown -- it depends on the patch being installed. If
+ # it is, this changes to `yes'. Without it, it would be `no'.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ osf*)
+ # the two cases above should catch all versions of osf <= 5.1. Read
+ # the comments above for what we know about them.
+ # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
+ # is used to find them so we can finally say `yes'.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ solaris*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ esac
+ ])
+if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
+ AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
+ [Define if the OS needs help to load dependent libraries for dlopen().])
+fi
+])# AC_LTDL_SYS_DLOPEN_DEPLIBS
+
+
+# AC_LTDL_SHLIBEXT
+# ----------------
+AC_DEFUN([AC_LTDL_SHLIBEXT],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([which extension is used for loadable modules],
+ [libltdl_cv_shlibext],
+[
+# Here in libltdl for libgcj we don't build modules for darwin.
+# So we say no. Then the extension gets .dylib which is the right
+# thing for shared libraries on darwin.
+case "$host_os" in
+darwin*)
+ module=no
+ ;;
+*)
+ module=yes
+ ;;
+esac
+eval libltdl_cv_shlibext=$shrext
+ ])
+if test -n "$libltdl_cv_shlibext"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIB_EXT, "$libltdl_cv_shlibext",
+ [Define to the extension used for shared libraries, say, ".so".])
+fi
+])# AC_LTDL_SHLIBEXT
+
+
+# AC_LTDL_SHLIBPATH
+# -----------------
+AC_DEFUN([AC_LTDL_SHLIBPATH],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([which variable specifies run-time library path],
+ [libltdl_cv_shlibpath_var], [libltdl_cv_shlibpath_var="$shlibpath_var"])
+if test -n "$libltdl_cv_shlibpath_var"; then
+ AC_DEFINE_UNQUOTED(LTDL_SHLIBPATH_VAR, "$libltdl_cv_shlibpath_var",
+ [Define to the name of the environment variable that determines the dynamic library search path.])
+fi
+])# AC_LTDL_SHLIBPATH
+
+
+# AC_LTDL_SYSSEARCHPATH
+# ---------------------
+AC_DEFUN([AC_LTDL_SYSSEARCHPATH],
+[AC_REQUIRE([AC_LIBTOOL_SYS_DYNAMIC_LINKER])
+AC_CACHE_CHECK([for the default library search path],
+ [libltdl_cv_sys_search_path],
+ [libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"])
+if test -n "$libltdl_cv_sys_search_path"; then
+ sys_search_path=
+ for dir in $libltdl_cv_sys_search_path; do
+ if test -z "$sys_search_path"; then
+ sys_search_path="$dir"
+ else
+ sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
+ fi
+ done
+ AC_DEFINE_UNQUOTED(LTDL_SYSSEARCHPATH, "$sys_search_path",
+ [Define to the system default library search path.])
+fi
+])# AC_LTDL_SYSSEARCHPATH
+
+
+# AC_LTDL_OBJDIR
+# --------------
+AC_DEFUN([AC_LTDL_OBJDIR],
+[AC_CACHE_CHECK([for objdir],
+ [libltdl_cv_objdir],
+ [libltdl_cv_objdir="$objdir"
+ if test -n "$objdir"; then
+ :
+ else
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+ rmdir .libs 2>/dev/null
+ fi
+ ])
+AC_DEFINE_UNQUOTED(LTDL_OBJDIR, "$libltdl_cv_objdir/",
+ [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# AC_LTDL_OBJDIR
+
+
+# AC_LTDL_DLPREOPEN
+# -----------------
+AC_DEFUN([AC_LTDL_DLPREOPEN],
+[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
+AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
+ [libltdl_cv_preloaded_symbols],
+ [if test -n "$lt_cv_sys_global_symbol_pipe"; then
+ libltdl_cv_preloaded_symbols=yes
+ else
+ libltdl_cv_preloaded_symbols=no
+ fi
+ ])
+if test x"$libltdl_cv_preloaded_symbols" = xyes; then
+ AC_DEFINE(HAVE_PRELOADED_SYMBOLS, 1,
+ [Define if libtool can extract symbol lists from object files.])
+fi
+])# AC_LTDL_DLPREOPEN
+
+
+# AC_LTDL_DLLIB
+# -------------
+AC_DEFUN([AC_LTDL_DLLIB],
+[LIBADD_DL=
+AC_SUBST(LIBADD_DL)
+AC_LANG_PUSH([C])
+
+AC_CHECK_FUNC([shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])],
+ [AC_CHECK_LIB([dld], [shl_load],
+ [AC_DEFINE([HAVE_SHL_LOAD], [1],
+ [Define if you have the shl_load function.])
+ LIBADD_DL="$LIBADD_DL -ldld"],
+ [AC_CHECK_LIB([dl], [dlopen],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"],
+ [AC_TRY_LINK([#if HAVE_DLFCN_H
+# include <dlfcn.h>
#endif
+ ],
+ [dlopen(0, 0);],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.]) libltdl_cv_func_dlopen="yes"],
+ [AC_CHECK_LIB([svld], [dlopen],
+ [AC_DEFINE([HAVE_LIBDL], [1],
+ [Define if you have the libdl library or equivalent.])
+ LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"],
+ [AC_CHECK_LIB([dld], [dld_link],
+ [AC_DEFINE([HAVE_DLD], [1],
+ [Define if you have the GNU dld library.])
+ LIBADD_DL="$LIBADD_DL -ldld"],
+ [AC_CHECK_FUNC([_dyld_func_lookup],
+ [AC_DEFINE([HAVE_DYLD], [1],
+ [Define if you have the _dyld_func_lookup function.])])
+ ])
+ ])
+ ])
+ ])
+ ])
+])
-fnord() { int i=42;}
-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); }
-], libltdl_cv_need_uscore=no, libltdl_cv_need_uscore=yes,
- libltdl_cv_need_uscore=cross
-)])
+if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
+then
+ lt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ AC_CHECK_FUNCS([dlerror])
+ LIBS="$lt_save_LIBS"
+fi
+AC_LANG_POP
+])# AC_LTDL_DLLIB
+
+
+# AC_LTDL_SYMBOL_USCORE
+# ---------------------
+# does the compiler prefix global symbols with an underscore?
+AC_DEFUN([AC_LTDL_SYMBOL_USCORE],
+[AC_REQUIRE([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])
+AC_CACHE_CHECK([for _ prefix in compiled symbols],
+ [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 \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
+ else
+ if grep '^. 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 $lt_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_LTDL_SYMBOL_USCORE
+
+
+# AC_LTDL_DLSYM_USCORE
+# --------------------
+AC_DEFUN([AC_LTDL_DLSYM_USCORE],
+[AC_REQUIRE([AC_LTDL_SYMBOL_USCORE])
+if test x"$ac_cv_sys_symbol_underscore" = xyes; then
+ if test x"$libltdl_cv_func_dlopen" = xyes ||
+ test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
+ AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
+ [libltdl_cv_need_uscore],
+ [libltdl_cv_need_uscore=unknown
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ _LT_AC_TRY_DLOPEN_SELF(
+ [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
+ [], [libltdl_cv_need_uscore=cross])
+ LIBS="$save_LIBS"
+ ])
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
AC_DEFINE(NEED_USCORE, 1,
- [Define if dlsym() requires a leading underscode in symbol names. ])
+ [Define if dlsym() requires a leading underscore in symbol names.])
fi
-])
+])# AC_LTDL_DLSYM_USCORE
-# Define a conditional.
+# AC_LTDL_FUNC_ARGZ
+# -----------------
+AC_DEFUN([AC_LTDL_FUNC_ARGZ],
+[AC_CHECK_HEADERS([argz.h])
+
+AC_CHECK_TYPES([error_t],
+ [],
+ [AC_DEFINE([error_t], [int],
+ [Define to a type to use for `error_t' if it is not otherwise available.])],
+ [#if HAVE_ARGZ_H
+# include <argz.h>
+#endif])
+
+AC_CHECK_FUNCS([argz_append argz_create_sep argz_insert argz_next argz_stringify])
+])# AC_LTDL_FUNC_ARGZ
+
+# AM_CONDITIONAL -*- Autoconf -*-
+
+# Copyright 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
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
-AC_DEFUN(AM_CONDITIONAL,
-[AC_SUBST($1_TRUE)
-AC_SUBST($1_FALSE)
+# 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.
+
+# serial 5
+
+AC_PREREQ(2.52)
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
-fi])
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+ AC_MSG_ERROR([conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.])
+fi])])
+
+# Do all the work for Automake. -*- Autoconf -*-
+
+# 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.
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
+# 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, 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.
+
+# serial 10
+
+AC_PREREQ([2.54])
+
+# Autoconf 2.50 wants to disallow AM_ names. We explicitly allow
+# the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out. PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition. After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+ AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+fi
-# 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.
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+ [_AM_DEPENDENCIES(CC)],
+ [define([AC_PROG_CC],
+ defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+ [_AM_DEPENDENCIES(CXX)],
+ [define([AC_PROG_CXX],
+ defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+])
-# serial 1
-dnl Usage:
-dnl AM_INIT_AUTOMAKE(package,version, [no-define])
-
-AC_DEFUN(AM_INIT_AUTOMAKE,
-[AC_REQUIRE([AC_PROG_INSTALL])
-PACKAGE=[$1]
-AC_SUBST(PACKAGE)
-VERSION=[$2]
-AC_SUBST(VERSION)
-dnl test to see if srcdir already configured
-if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
- AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
-fi
-ifelse([$3],,
-AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
-AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package]))
-AC_REQUIRE([AM_SANITY_CHECK])
-AC_REQUIRE([AC_ARG_PROGRAM])
-dnl FIXME This is truly gross.
-missing_dir=`cd $ac_aux_dir && pwd`
-AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir)
-AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir)
-AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir)
-AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir)
-AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir)
-AC_REQUIRE([AC_PROG_MAKE_SET])])
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated. The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $1 | $1:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
+
+# Copyright 2002 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, 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
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION so it can be traced.
+# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+ [AM_AUTOMAKE_VERSION([1.7.9])])
+
+# Helper functions for option handling. -*- Autoconf -*-
+
+# Copyright 2001, 2002 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, 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.
+
+# serial 2
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# ------------------------------
+# Set option NAME. Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ----------------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
#
# Check to make sure that the build environment is sane.
#
-AC_DEFUN(AM_SANITY_CHECK,
+# Copyright 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# 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
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "[$]*" != "X $srcdir/configure conftestfile" \
- && test "[$]*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $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
@@ -1334,7 +6559,7 @@ if (
alias in your environment])
fi
- test "[$]2" = conftestfile
+ test "$[2]" = conftest.file
)
then
# Ok.
@@ -1343,54 +6568,573 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-rm -f conftest*
AC_MSG_RESULT(yes)])
-dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY)
-dnl The program must properly implement --version.
-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.
-# Redirect stdin to placate older versions of autoconf. Sigh.
-if ($2 --version) < /dev/null > /dev/null 2>&1; then
- $1=$2
- AC_MSG_RESULT(found)
+# -*- Autoconf -*-
+
+
+# Copyright 1997, 1999, 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 3
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
else
- $1="$3/missing $2"
- AC_MSG_RESULT(missing)
+ am_missing_run=
+ AC_MSG_WARN([`missing' script is too old or missing])
fi
-AC_SUBST($1)])
+])
-# Like AC_CONFIG_HEADER, but automatically create stamp file.
-
-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.
-dnl This file resides in the same directory as the config header
-dnl that is generated. We must strip everything past the first ":",
-dnl and everything past the last "/".
-AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl
-ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>,
-<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>,
-<<am_indx=1
-for am_file in <<$1>>; do
- case " <<$>>CONFIG_HEADERS " in
- *" <<$>>am_file "*<<)>>
- echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx
- ;;
- esac
- am_indx=`expr "<<$>>am_indx" + 1`
-done<<>>dnl>>)
-changequote([,]))])
+# AM_AUX_DIR_EXPAND
+
+# Copyright 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, 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.
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory. The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run. This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+# fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+# fails if $ac_aux_dir is absolute,
+# fails when called from a subdirectory in a VPATH build with
+# a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir. In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
+# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+# MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH. The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+# Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+
+# Copyright 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, 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.
+
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# AM_PROG_INSTALL_STRIP
+
+# Copyright 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, 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.
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries. This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+ AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# -*- Autoconf -*-
+# Copyright (C) 2003 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, 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.
+
+# serial 1
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot. For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# serial 5 -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003 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, 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.
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery. Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
+ [$1], CXX, [depcc="$CXX" am_compiler_list=],
+ [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+ [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_$1_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_$1_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])
+])
+
+# Generate code to set up dependency tracking. -*- Autoconf -*-
+
+# Copyright 1999, 2000, 2001, 2002 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, 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.
+
+#serial 2
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`AS_DIRNAME("$mf")`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[[^ @%:@]]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`AS_DIRNAME(["$file"])`
+ AS_MKDIR_P([$dirpart/$fdir])
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled. FIXME. This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+ [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+ [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Check to see how 'make' treats includes. -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003 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, 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.
+
+# serial 2
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file. -*- Autoconf -*-
+
+# Copyright 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
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+AC_PREREQ([2.52])
+
+# serial 6
+
+# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Add --enable-maintainer-mode option to configure.
# From Jim Meyering
-# serial 1
+# Copyright 1996, 1998, 2000, 2001, 2002 Free Software Foundation, Inc.
-AC_DEFUN(AM_MAINTAINER_MODE,
+# 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, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+
+# serial 2
+
+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,
@@ -1398,10 +7142,12 @@ AC_DEFUN(AM_MAINTAINER_MODE,
(and sometimes confusing) to the casual installer],
USE_MAINTAINER_MODE=$enableval,
USE_MAINTAINER_MODE=no)
- AC_MSG_RESULT($USE_MAINTAINER_MODE)
- AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes)
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes])
MAINT=$MAINTAINER_MODE_TRUE
AC_SUBST(MAINT)dnl
]
)
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
diff --git a/libjava/libltdl/config-h.in b/libjava/libltdl/config-h.in
new file mode 100644
index 00000000000..0b845597e62
--- /dev/null
+++ b/libjava/libltdl/config-h.in
@@ -0,0 +1,193 @@
+/* config-h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `argz_append' function. */
+#undef HAVE_ARGZ_APPEND
+
+/* Define to 1 if you have the `argz_create_sep' function. */
+#undef HAVE_ARGZ_CREATE_SEP
+
+/* Define to 1 if you have the <argz.h> header file. */
+#undef HAVE_ARGZ_H
+
+/* Define to 1 if you have the `argz_insert' function. */
+#undef HAVE_ARGZ_INSERT
+
+/* Define to 1 if you have the `argz_next' function. */
+#undef HAVE_ARGZ_NEXT
+
+/* Define to 1 if you have the `argz_stringify' function. */
+#undef HAVE_ARGZ_STRINGIFY
+
+/* Define to 1 if you have the <assert.h> header file. */
+#undef HAVE_ASSERT_H
+
+/* Define to 1 if you have the `bcopy' function. */
+#undef HAVE_BCOPY
+
+/* Define to 1 if you have the `closedir' function. */
+#undef HAVE_CLOSEDIR
+
+/* Define to 1 if you have the <ctype.h> header file. */
+#undef HAVE_CTYPE_H
+
+/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the GNU dld library. */
+#undef HAVE_DLD
+
+/* Define to 1 if you have the <dld.h> header file. */
+#undef HAVE_DLD_H
+
+/* Define to 1 if you have the `dlerror' function. */
+#undef HAVE_DLERROR
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <dl.h> header file. */
+#undef HAVE_DL_H
+
+/* Define if you have the _dyld_func_lookup function. */
+#undef HAVE_DYLD
+
+/* Define to 1 if you have the <errno.h> header file. */
+#undef HAVE_ERRNO_H
+
+/* Define to 1 if the system has the type `error_t'. */
+#undef HAVE_ERROR_T
+
+/* Define to 1 if you have the `index' function. */
+#undef HAVE_INDEX
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define if you have the libdl library or equivalent. */
+#undef HAVE_LIBDL
+
+/* Define to 1 if you have the <mach-o/dyld.h> header file. */
+#undef HAVE_MACH_O_DYLD_H
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the `memcpy' function. */
+#undef HAVE_MEMCPY
+
+/* Define to 1 if you have the `memmove' function. */
+#undef HAVE_MEMMOVE
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
+#undef HAVE_NDIR_H
+
+/* Define to 1 if you have the `opendir' function. */
+#undef HAVE_OPENDIR
+
+/* Define if libtool can extract symbol lists from object files. */
+#undef HAVE_PRELOADED_SYMBOLS
+
+/* Define to 1 if you have the `readdir' function. */
+#undef HAVE_READDIR
+
+/* Define to 1 if you have the `rindex' function. */
+#undef HAVE_RINDEX
+
+/* Define if you have the shl_load function. */
+#undef HAVE_SHL_LOAD
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdio.h> header file. */
+#undef HAVE_STDIO_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the `strchr' function. */
+#undef HAVE_STRCHR
+
+/* Define to 1 if you have the `strcmp' function. */
+#undef HAVE_STRCMP
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if you have the `strrchr' function. */
+#undef HAVE_STRRCHR
+
+/* Define to 1 if you have the <sys/dir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_DIR_H
+
+/* Define to 1 if you have the <sys/dl.h> header file. */
+#undef HAVE_SYS_DL_H
+
+/* Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR'.
+ */
+#undef HAVE_SYS_NDIR_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if the OS needs help to load dependent libraries for dlopen(). */
+#undef LTDL_DLOPEN_DEPLIBS
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#undef LTDL_OBJDIR
+
+/* Define to the name of the environment variable that determines the dynamic
+ library search path. */
+#undef LTDL_SHLIBPATH_VAR
+
+/* Define to the extension used for shared libraries, say, ".so". */
+#undef LTDL_SHLIB_EXT
+
+/* Define to the system default library search path. */
+#undef LTDL_SYSSEARCHPATH
+
+/* Define if dlsym() requires a leading underscore in symbol names. */
+#undef NEED_USCORE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to empty if `const' does not conform to ANSI C. */
+#undef const
+
+/* Define to a type to use for `error_t' if it is not otherwise available. */
+#undef error_t
+
+/* Define as `__inline' if that's what the C compiler calls it, or to nothing
+ if it is not supported. */
+#undef inline
diff --git a/libjava/libltdl/config.guess b/libjava/libltdl/config.guess
new file mode 100755
index 00000000000..11271623bbd
--- /dev/null
+++ b/libjava/libltdl/config.guess
@@ -0,0 +1,1415 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-10-07'
+
+# 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 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# 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 build system type.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+ -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
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help" >&2
+ exit 1 ;;
+ * )
+ break ;;
+ esac
+done
+
+if test $# != 0; then
+ echo "$me: too many arguments$help" >&2
+ exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d -q "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,) echo "int x;" > $dummy.c ;
+ for c in cc gcc c89 c99 ; do
+ if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+ CC_FOR_BUILD="$c"; break ;
+ fi ;
+ done ;
+ 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 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+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_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ *:NetBSD:*:*)
+ # NetBSD (nbsd) targets should (where applicable) match one or
+ # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+ # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
+ # switched to ELF, *-*-netbsd* would select the old
+ # object file format. This provides both forward
+ # compatibility and a consistent mechanism for selecting the
+ # object file format.
+ #
+ # Note: NetBSD doesn't particularly care about the vendor
+ # portion of the name. We always set it to "unknown".
+ sysctl="sysctl -n hw.machine_arch"
+ UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+ /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+ case "${UNAME_MACHINE_ARCH}" in
+ armeb) machine=armeb-unknown ;;
+ arm*) machine=arm-unknown ;;
+ sh3el) machine=shl-unknown ;;
+ sh3eb) machine=sh-unknown ;;
+ *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ esac
+ # The Operating System including object format, if it has switched
+ # to ELF recently, or will in the future.
+ case "${UNAME_MACHINE_ARCH}" in
+ arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+ eval $set_cc_for_build
+ 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
+ # Debian GNU/NetBSD machines have a different userland, and
+ # thus, need a distinct triplet. However, they do not need
+ # kernel version information, so it can be replaced with a
+ # suitable tag, in the style of linux-gnu.
+ case "${UNAME_VERSION}" in
+ Debian*)
+ release='-gnu'
+ ;;
+ *)
+ release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ ;;
+ esac
+ # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+ # contains redundant information, the shorter form:
+ # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+ echo "${machine}-${os}${release}"
+ exit 0 ;;
+ amiga:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ hp300:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ macppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme68k:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvme88k:OpenBSD:*:*)
+ echo m88k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mvmeppc:OpenBSD:*:*)
+ echo powerpc-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ pmax:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sgi:OpenBSD:*:*)
+ echo mipseb-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3:OpenBSD:*:*)
+ echo m68k-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ wgrisc:OpenBSD:*:*)
+ echo mipsel-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ *:OpenBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-openbsd${UNAME_RELEASE}
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ if test $UNAME_RELEASE = "V4.0"; then
+ UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+ fi
+ # According to Compaq, /usr/sbin/psrinfo has been available on
+ # OSF/1 and Tru64 systems produced since 1995. I hope that
+ # covers most systems running today. This code pipes the CPU
+ # types through head -n 1, so we only detect the type of CPU 0.
+ ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+ case "$ALPHA_CPU_TYPE" in
+ "EV4 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "EV4.5 (21064)")
+ UNAME_MACHINE="alpha" ;;
+ "LCA4 (21066/21068)")
+ UNAME_MACHINE="alpha" ;;
+ "EV5 (21164)")
+ UNAME_MACHINE="alphaev5" ;;
+ "EV5.6 (21164A)")
+ UNAME_MACHINE="alphaev56" ;;
+ "EV5.6 (21164PC)")
+ UNAME_MACHINE="alphapca56" ;;
+ "EV5.7 (21164PC)")
+ UNAME_MACHINE="alphapca57" ;;
+ "EV6 (21264)")
+ UNAME_MACHINE="alphaev6" ;;
+ "EV6.7 (21264A)")
+ UNAME_MACHINE="alphaev67" ;;
+ "EV6.8CB (21264C)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8AL (21264B)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.8CX (21264D)")
+ UNAME_MACHINE="alphaev68" ;;
+ "EV6.9A (21264/EV69A)")
+ UNAME_MACHINE="alphaev69" ;;
+ "EV7 (21364)")
+ UNAME_MACHINE="alphaev7" ;;
+ "EV7.9 (21364A)")
+ UNAME_MACHINE="alphaev79" ;;
+ esac
+ # A Vn.n version is a released version.
+ # A Tn.n version is a released field test version.
+ # A Xn.n version is an unreleased experimental baselevel.
+ # 1.2 uses "1.2" for uname -r.
+ echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+ exit 0 ;;
+ Alpha*:OpenVMS:*:*)
+ echo alpha-hp-vms
+ exit 0 ;;
+ Alpha\ *:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # Should we change UNAME_MACHINE based on the output of uname instead
+ # of the specific Alpha model?
+ echo alpha-pc-interix
+ exit 0 ;;
+ 21064:Windows_NT:50:3)
+ echo alpha-dec-winnt3.5
+ exit 0 ;;
+ Amiga*:UNIX_System_V:4.0:*)
+ echo m68k-unknown-sysv4
+ exit 0;;
+ *:[Aa]miga[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-amigaos
+ exit 0 ;;
+ *:[Mm]orph[Oo][Ss]:*:*)
+ echo ${UNAME_MACHINE}-unknown-morphos
+ exit 0 ;;
+ *:OS/390:*:*)
+ echo i370-ibm-openedition
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+ echo hppa1.1-hitachi-hiuxmpp
+ exit 0;;
+ Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+ # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ NILE*:*:*:dcosx)
+ echo pyramid-pyramid-svr4
+ exit 0 ;;
+ DRS?6000:unix:4.0:6*)
+ echo sparc-icl-nx6
+ exit 0 ;;
+ DRS?6000:UNIX_SV:4.2*:7*)
+ case `/usr/bin/uname -p` in
+ sparc) echo sparc-icl-nx7 && exit 0 ;;
+ esac ;;
+ sun4H:SunOS:5.*:*)
+ echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ sun*:*:4.2BSD:*)
+ UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+ test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+ case "`/bin/arch`" in
+ sun3)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ ;;
+ sun4)
+ echo sparc-sun-sunos${UNAME_RELEASE}
+ ;;
+ esac
+ exit 0 ;;
+ aushp:SunOS:*:*)
+ echo sparc-auspex-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ # The situation for MiNT is a little confusing. The machine name
+ # can be virtually everything (everything which is not
+ # "atarist" or "atariste" at least should have a processor
+ # > m68000). The system name ranges from "MiNT" over "FreeMiNT"
+ # to the lowercase version "mint" (or "freemint"). Finally
+ # the system name "TOS" denotes a system which is actually not
+ # MiNT. But MiNT is downward compatible to TOS, so this should
+ # be no problem.
+ atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+ echo m68k-atari-mint${UNAME_RELEASE}
+ exit 0 ;;
+ milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+ echo m68k-milan-mint${UNAME_RELEASE}
+ exit 0 ;;
+ hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+ echo m68k-hades-mint${UNAME_RELEASE}
+ exit 0 ;;
+ *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+ echo m68k-unknown-mint${UNAME_RELEASE}
+ exit 0 ;;
+ powerpc:machten:*:*)
+ echo powerpc-apple-machten${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:Mach:*:*)
+ echo mips-dec-mach_bsd4.3
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ 2020:CLIX:*:* | 2430:CLIX:*:*)
+ echo clipper-intergraph-clix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:*:UMIPS | mips:*:*:RISCos)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h> /* for printf() prototype */
+ int main (int argc, char *argv[]) {
+#else
+ int main (argc, argv) int argc; char *argv[]; {
+#endif
+ #if defined (host_mips) && defined (MIPSEB)
+ #if defined (SYSTYPE_SYSV)
+ printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_SVR4)
+ printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ #endif
+ #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+ printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ #endif
+ #endif
+ exit (-1);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c \
+ && $dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \
+ && exit 0
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ Motorola:PowerMAX_OS:*:*)
+ echo powerpc-motorola-powermax
+ exit 0 ;;
+ Motorola:*:4.3:PL8-*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+ echo powerpc-harris-powermax
+ exit 0 ;;
+ Night_Hawk:Power_UNIX:*:*)
+ echo powerpc-harris-powerunix
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ # DG/UX returns AViiON for all architectures
+ UNAME_PROCESSOR=`/usr/bin/uname -p`
+ if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ then
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+ [ ${TARGET_BINARY_INTERFACE}x = x ]
+ then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ else
+ echo i586-dg-dgux${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????: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:*:*)
+ 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
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:[45])
+ IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+ if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if [ -x /usr/bin/oslevel ] ; then
+ IBM_REV=`/usr/bin/oslevel`
+ else
+ IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ 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])
+ 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" ;;
+ '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ esac ;;
+ esac
+ fi
+ if [ "${HP_ARCH}" = "" ]; then
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+
+ #define _HPUX_SOURCE
+ #include <stdlib.h>
+ #include <unistd.h>
+
+ int main ()
+ {
+ #if defined(_SC_KERNEL_BITS)
+ long bits = sysconf(_SC_KERNEL_BITS);
+ #endif
+ long cpu = sysconf (_SC_CPU_VERSION);
+
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+ case CPU_PA_RISC2_0:
+ #if defined(_SC_KERNEL_BITS)
+ switch (bits)
+ {
+ case 64: puts ("hppa2.0w"); break;
+ case 32: puts ("hppa2.0n"); break;
+ default: puts ("hppa2.0"); break;
+ } break;
+ #else /* !defined(_SC_KERNEL_BITS) */
+ puts ("hppa2.0"); break;
+ #endif
+ default: puts ("hppa1.0"); break;
+ }
+ exit (0);
+ }
+EOF
+ (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ test -z "$HP_ARCH" && HP_ARCH=hppa
+ fi ;;
+ esac
+ if [ ${HP_ARCH} = "hppa2.0w" ]
+ then
+ # avoid double evaluation of $set_cc_for_build
+ test -n "$CC_FOR_BUILD" || eval $set_cc_for_build
+ if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E -) | grep __LP64__ >/dev/null
+ then
+ HP_ARCH="hppa2.0w"
+ else
+ HP_ARCH="hppa64"
+ fi
+ fi
+ 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:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ $CC_FOR_BUILD -o $dummy $dummy.c && $dummy && exit 0
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+ echo hppa1.0-hp-mpeix
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ i*86:OSF1:*:*)
+ if [ -x /usr/sbin/sysversion ] ; then
+ echo ${UNAME_MACHINE}-unknown-osf1mk
+ else
+ echo ${UNAME_MACHINE}-unknown-osf1
+ fi
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*[A-Z]90:*:*:*)
+ echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+ -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ CRAY*TS:*:*:*)
+ echo t90-cray-unicos${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 ;;
+ *:UNICOS/mp:*:*)
+ echo nv1-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+ exit 0 ;;
+ 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 "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+ exit 0 ;;
+ i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+ echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ sparc*:BSD/OS:*:*)
+ echo sparc-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ # Determine whether the default compiler uses glibc.
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #if __GLIBC__ >= 2
+ LIBC=gnu
+ #else
+ LIBC=
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ # GNU/KFreeBSD systems have a "k" prefix to indicate we are using
+ # FreeBSD's kernel, but not the complete OS.
+ case ${LIBC} in gnu) kernel_only='k' ;; esac
+ echo ${UNAME_MACHINE}-unknown-${kernel_only}freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`${LIBC:+-$LIBC}
+ exit 0 ;;
+ i*:CYGWIN*:*)
+ echo ${UNAME_MACHINE}-pc-cygwin
+ exit 0 ;;
+ i*:MINGW*:*)
+ echo ${UNAME_MACHINE}-pc-mingw32
+ exit 0 ;;
+ i*:PW*:*)
+ echo ${UNAME_MACHINE}-pc-pw32
+ exit 0 ;;
+ x86:Interix*:[34]*)
+ echo i586-pc-interix${UNAME_RELEASE}|sed -e 's/\..*//'
+ exit 0 ;;
+ [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+ echo i${UNAME_MACHINE}-pc-mks
+ exit 0 ;;
+ i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+ # How do we know it's Interix rather than the generic POSIX subsystem?
+ # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+ # UNAME_MACHINE based on the output of uname instead of i386?
+ echo i586-pc-interix
+ exit 0 ;;
+ i*:UWIN*:*)
+ echo ${UNAME_MACHINE}-pc-uwin
+ exit 0 ;;
+ p*:CYGWIN*:*)
+ echo powerpcle-unknown-cygwin
+ exit 0 ;;
+ prep*:SunOS:5.*:*)
+ echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ *:GNU:*:*)
+ # the GNU system
+ echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:GNU/*:*:*)
+ # other systems with GNU libc and userland
+ echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+ exit 0 ;;
+ i*86:Minix:*:*)
+ echo ${UNAME_MACHINE}-pc-minix
+ exit 0 ;;
+ arm*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ cris:Linux:*:*)
+ echo cris-axis-linux-gnu
+ exit 0 ;;
+ ia64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ m68*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ exit 0 ;;
+ mips:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips
+ #undef mipsel
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mipsel
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ mips64:Linux:*:*)
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #undef CPU
+ #undef mips64
+ #undef mips64el
+ #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+ CPU=mips64el
+ #else
+ #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+ CPU=mips64
+ #else
+ CPU=
+ #endif
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^CPU=`
+ test x"${CPU}" != x && echo "${CPU}-unknown-linux-gnu" && exit 0
+ ;;
+ ppc:Linux:*:*)
+ echo powerpc-unknown-linux-gnu
+ exit 0 ;;
+ ppc64:Linux:*:*)
+ echo powerpc64-unknown-linux-gnu
+ exit 0 ;;
+ alpha:Linux:*:*)
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ EV5) UNAME_MACHINE=alphaev5 ;;
+ EV56) UNAME_MACHINE=alphaev56 ;;
+ PCA56) UNAME_MACHINE=alphapca56 ;;
+ PCA57) UNAME_MACHINE=alphapca56 ;;
+ EV6) UNAME_MACHINE=alphaev6 ;;
+ EV67) UNAME_MACHINE=alphaev67 ;;
+ EV68*) UNAME_MACHINE=alphaev68 ;;
+ esac
+ objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null
+ if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+ 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 ;;
+ sh64*:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-gnu
+ 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.
+ # Set LC_ALL=C to ensure ld outputs messages in English.
+ ld_supported_targets=`cd /; LC_ALL=C 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
+ # Determine whether the default compiler is a.out or elf
+ eval $set_cc_for_build
+ sed 's/^ //' << EOF >$dummy.c
+ #include <features.h>
+ #ifdef __ELF__
+ # ifdef __GLIBC__
+ # if __GLIBC__ >= 2
+ LIBC=gnu
+ # else
+ LIBC=gnulibc1
+ # endif
+ # else
+ LIBC=gnulibc1
+ # endif
+ #else
+ #ifdef __INTEL_COMPILER
+ LIBC=gnu
+ #else
+ LIBC=gnuaout
+ #endif
+ #endif
+ #ifdef __dietlibc__
+ LIBC=dietlibc
+ #endif
+EOF
+ eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep ^LIBC=`
+ test x"${LIBC}" != x && echo "${UNAME_MACHINE}-pc-linux-${LIBC}" && exit 0
+ test x"${TENTATIVE}" != x && echo "${TENTATIVE}" && exit 0
+ ;;
+ i*86:DYNIX/ptx:4*:*)
+ # 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.
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ 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,
+ # I just have to hope. -- rms.
+ # Use sysv4.2uw... so that sysv4* matches it.
+ echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+ 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 ;;
+ i*86:XTS-300:*:STOP)
+ echo ${UNAME_MACHINE}-unknown-stop
+ exit 0 ;;
+ i*86:atheos:*:*)
+ echo ${UNAME_MACHINE}-unknown-atheos
+ exit 0 ;;
+ i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+ echo i386-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ i*86:*DOS:*:*)
+ echo ${UNAME_MACHINE}-pc-msdosdjgpp
+ exit 0 ;;
+ 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}
+ else
+ echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ fi
+ exit 0 ;;
+ i*86:*:5:[78]*)
+ case `/bin/uname -X | grep "^Machine"` in
+ *486*) UNAME_MACHINE=i486 ;;
+ *Pentium) UNAME_MACHINE=i586 ;;
+ *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+ esac
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ exit 0 ;;
+ 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
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+ (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+ && UNAME_MACHINE=i586
+ (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+ && UNAME_MACHINE=i686
+ (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+ && UNAME_MACHINE=i686
+ echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-pc-sysv32
+ fi
+ exit 0 ;;
+ pc:*:*:*)
+ # Left here for compatibility:
+ # uname -m prints for DJGPP always 'pc', but it prints nothing about
+ # the processor, so we play safe by assuming i386.
+ echo i386-pc-msdosdjgpp
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-pc-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ mc68k:UNIX:SYSTEM5:3.51m)
+ echo m68k-convergent-sysv
+ exit 0 ;;
+ M680?0:D-NIX:5.3:*)
+ echo m68k-diab-dnix
+ exit 0 ;;
+ M68*:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0)
+ OS_REL=''
+ test -r /etc/.relid \
+ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+ /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3${OS_REL} && exit 0
+ /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+ && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;;
+ 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:3.0*:*)
+ echo m68k-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.*:*)
+ echo sparc-unknown-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ 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 ;;
+ RM*:ReliantUNIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+ PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ # says <Richard.M.Bartel@ccMail.Census.GOV>
+ echo i586-unisys-sysv4
+ exit 0 ;;
+ *:UNIX_System_V:4*:FTX*)
+ # From Gerald Hewes <hewes@openmarket.com>.
+ # How about differentiating between stratus architectures? -djm
+ echo hppa1.1-stratus-sysv4
+ exit 0 ;;
+ *:*:*:FTX*)
+ # From seanf@swdc.stratus.com.
+ echo i860-stratus-sysv4
+ exit 0 ;;
+ *:VOS:*:*)
+ # From Paul.Green@stratus.com.
+ echo hppa1.1-stratus-vos
+ exit 0 ;;
+ mc68*:A/UX:*:*)
+ echo m68k-apple-aux${UNAME_RELEASE}
+ exit 0 ;;
+ news*:NEWS-OS:6*:*)
+ echo mips-sony-newsos6
+ exit 0 ;;
+ R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+ if [ -d /usr/nec ]; then
+ echo mips-nec-sysv${UNAME_RELEASE}
+ else
+ echo mips-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
+ echo powerpc-be-beos
+ exit 0 ;;
+ BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
+ echo powerpc-apple-beos
+ exit 0 ;;
+ BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
+ echo i586-pc-beos
+ exit 0 ;;
+ SX-4:SUPER-UX:*:*)
+ echo sx4-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-5:SUPER-UX:*:*)
+ echo sx5-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ SX-6:SUPER-UX:*:*)
+ echo sx6-nec-superux${UNAME_RELEASE}
+ exit 0 ;;
+ Power*:Rhapsody:*:*)
+ echo powerpc-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Rhapsody:*:*)
+ echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+ exit 0 ;;
+ *:Darwin:*:*)
+ case `uname -p` in
+ *86) UNAME_PROCESSOR=i686 ;;
+ powerpc) UNAME_PROCESSOR=powerpc ;;
+ esac
+ echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+ exit 0 ;;
+ *:procnto*:*:* | *:QNX:[0123456789]*:*)
+ UNAME_PROCESSOR=`uname -p`
+ if test "$UNAME_PROCESSOR" = "x86"; then
+ UNAME_PROCESSOR=i386
+ UNAME_MACHINE=pc
+ fi
+ echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+ exit 0 ;;
+ *:QNX:*:4*)
+ echo i386-pc-qnx
+ exit 0 ;;
+ NSR-[DGKLNPTVWY]: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 ;;
+ DS/*:UNIX_System_V:*:*)
+ echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+ exit 0 ;;
+ *:Plan9:*:*)
+ # "uname -m" is not consistent, so use $cputype instead. 386
+ # is converted to i386 for consistency with other x86
+ # operating systems.
+ if test "$cputype" = "386"; then
+ UNAME_MACHINE=i386
+ else
+ UNAME_MACHINE="$cputype"
+ fi
+ echo ${UNAME_MACHINE}-unknown-plan9
+ 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 ;;
+ SEI:*:*:SEIUX)
+ echo mips-sei-seiux${UNAME_RELEASE}
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ if (version < 4)
+ printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+ else
+ printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ struct utsname un;
+
+ uname(&un);
+
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# 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)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && $dummy && exit 0
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+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/
+
+If the version you run ($0) is already up to date, please
+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 timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo = `(hostinfo) 2>/dev/null`
+/bin/universe = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libjava/libltdl/config.h.in b/libjava/libltdl/config.h.in
deleted file mode 100644
index 95e384928b3..00000000000
--- a/libjava/libltdl/config.h.in
+++ /dev/null
@@ -1,98 +0,0 @@
-/* config.h.in. Generated automatically from configure.in by autoheader. */
-
-/* Define to empty if the keyword does not work. */
-#undef const
-
-/* Define as __inline if that's what the C compiler calls it. */
-#undef inline
-
-/* Define if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Define if you are using the Boehm GC. */
-#undef HAVE_BOEHM_GC
-
-/* Define if you have the dlerror function. */
-#undef HAVE_DLERROR
-
-/* Define if you have the index function. */
-#undef HAVE_INDEX
-
-/* Define if you have the rindex function. */
-#undef HAVE_RINDEX
-
-/* Define if you have the strchr function. */
-#undef HAVE_STRCHR
-
-/* Define if you have the strcmp function. */
-#undef HAVE_STRCMP
-
-/* Define if you have the strrchr function. */
-#undef HAVE_STRRCHR
-
-/* Define if you have the <ctype.h> header file. */
-#undef HAVE_CTYPE_H
-
-/* Define if you have the <dl.h> header file. */
-#undef HAVE_DL_H
-
-/* Define if you have the <dld.h> header file. */
-#undef HAVE_DLD_H
-
-/* Define if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define if you have the <malloc.h> header file. */
-#undef HAVE_MALLOC_H
-
-/* Define if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to the extension used for shared libraries, say, .so. */
-#undef LTDL_SHLIB_EXT
-
-/* Define to the name of the environment variable that determines the dynamic library search path. */
-#undef LTDL_SHLIBPATH_VAR
-
-/* Define to the system default library search path. */
-#undef LTDL_SYSSEARCHPATH
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries. */
-#undef LTDL_OBJDIR
-
-/* Define if libtool can extract symbol lists from object files. */
-#undef HAVE_PRELOADED_SYMBOLS
-
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define if you have the libdl library or equivalent. */
-#undef HAVE_LIBDL
-
-/* Define if you have the shl_load function. */
-#undef HAVE_SHL_LOAD
-
-/* Define if you have the shl_load function. */
-#undef HAVE_SHL_LOAD
-
-/* Define if you have the GNU dld library. */
-#undef HAVE_DLD
-
-/* Define if dlsym() requires a leading underscode in symbol names. */
-#undef NEED_USCORE
-
diff --git a/libjava/libltdl/config.sub b/libjava/libltdl/config.sub
new file mode 100755
index 00000000000..79657cd1822
--- /dev/null
+++ b/libjava/libltdl/config.sub
@@ -0,0 +1,1510 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
+
+timestamp='2003-10-07'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# 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 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.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Please send patches to <config-patches@gnu.org>. Submit a context
+# diff and a properly formatted ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+ $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+ -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
+ --time-stamp | --time* | -t )
+ echo "$timestamp" ; exit 0 ;;
+ --version | -v )
+ echo "$version" ; exit 0 ;;
+ --help | --h* | -h )
+ echo "$usage"; exit 0 ;;
+ -- ) # Stop option processing
+ shift; break ;;
+ - ) # Use stdin as input.
+ break ;;
+ -* )
+ echo "$me: invalid option $1$help"
+ exit 1 ;;
+
+ *local*)
+ # First pass through any local machine types.
+ echo $1
+ exit 0;;
+
+ * )
+ break ;;
+ esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+ exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+ exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# 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* | linux-dietlibc | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*)
+ os=-$maybe_os
+ basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+ ;;
+ *)
+ basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+ if [ $basic_machine != $1 ]
+ then os=`echo $1 | sed 's/.*-/-/'`
+ else os=; fi
+ ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+ -apple | -axis)
+ os=
+ basic_machine=$1
+ ;;
+ -sim | -cisco | -oki | -wec | -winbond)
+ os=
+ basic_machine=$1
+ ;;
+ -scout)
+ ;;
+ -wrs)
+ os=-vxworks
+ basic_machine=$1
+ ;;
+ -chorusos*)
+ os=-chorusos
+ basic_machine=$1
+ ;;
+ -chorusrdb)
+ os=-chorusrdb
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco5)
+ os=-sco3.2v5
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -udk*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+ -psos*)
+ os=-psos
+ ;;
+ -mint | -mint[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ 1750a | 580 \
+ | a29k \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+ | am33_2.0 \
+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
+ | c4x | clipper \
+ | d10v | d30v | dlx | dsp16xx \
+ | fr30 | frv \
+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | i370 | i860 | i960 | ia64 \
+ | ip2k | iq2000 \
+ | m32r | m68000 | m68k | m88k | mcore \
+ | mips | mipsbe | mipseb | mipsel | mipsle \
+ | mips16 \
+ | mips64 | mips64el \
+ | mips64vr | mips64vrel \
+ | mips64orion | mips64orionel \
+ | mips64vr4100 | mips64vr4100el \
+ | mips64vr4300 | mips64vr4300el \
+ | mips64vr5000 | mips64vr5000el \
+ | mipsisa32 | mipsisa32el \
+ | mipsisa32r2 | mipsisa32r2el \
+ | mipsisa64 | mipsisa64el \
+ | mipsisa64r2 | mipsisa64r2el \
+ | mipsisa64sb1 | mipsisa64sb1el \
+ | mipsisa64sr71k | mipsisa64sr71kel \
+ | mipstx39 | mipstx39el \
+ | mn10200 | mn10300 \
+ | msp430 \
+ | ns16k | ns32k \
+ | openrisc | or32 \
+ | pdp10 | pdp11 | pj | pjl \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+ | pyramid \
+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \
+ | sh64 | sh64le \
+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
+ | strongarm \
+ | tahoe | thumb | tic4x | tic80 | tron \
+ | v850 | v850e \
+ | we32k \
+ | x86 | xscale | xstormy16 | xtensa \
+ | z8k)
+ basic_machine=$basic_machine-unknown
+ ;;
+ m6811 | m68hc11 | m6812 | m68hc12)
+ # Motorola 68HC11/12.
+ basic_machine=$basic_machine-unknown
+ os=-none
+ ;;
+ 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*86 | x86_64)
+ basic_machine=$basic_machine-pc
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ 580-* \
+ | a29k-* \
+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
+ | avr-* \
+ | bs2000-* \
+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+ | clipper-* | cydra-* \
+ | d10v-* | d30v-* | dlx-* \
+ | elxsi-* \
+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+ | h8300-* | h8500-* \
+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+ | i*86-* | i860-* | i960-* | ia64-* \
+ | ip2k-* | iq2000-* \
+ | m32r-* \
+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+ | m88110-* | m88k-* | mcore-* \
+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+ | mips16-* \
+ | mips64-* | mips64el-* \
+ | mips64vr-* | mips64vrel-* \
+ | mips64orion-* | mips64orionel-* \
+ | mips64vr4100-* | mips64vr4100el-* \
+ | mips64vr4300-* | mips64vr4300el-* \
+ | mips64vr5000-* | mips64vr5000el-* \
+ | mipsisa32-* | mipsisa32el-* \
+ | mipsisa32r2-* | mipsisa32r2el-* \
+ | mipsisa64-* | mipsisa64el-* \
+ | mipsisa64r2-* | mipsisa64r2el-* \
+ | mipsisa64sb1-* | mipsisa64sb1el-* \
+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+ | mipstx39-* | mipstx39el-* \
+ | msp430-* \
+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \
+ | orion-* \
+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+ | pyramid-* \
+ | romp-* | rs6000-* \
+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \
+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
+ | tahoe-* | thumb-* \
+ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+ | tron-* \
+ | v850-* | v850e-* | vax-* \
+ | we32k-* \
+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
+ | xtensa-* \
+ | ymp-* \
+ | z8k-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 386bsd)
+ basic_machine=i386-unknown
+ os=-bsd
+ ;;
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ os=-scout
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amd64)
+ basic_machine=x86_64-pc
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-unknown
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ os=-amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ os=-bsd
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ os=-aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ c90)
+ basic_machine=c90-cray
+ os=-unicos
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | j90)
+ basic_machine=j90-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ cris | cris-* | etrax*)
+ basic_machine=cris-axis
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ decsystem10* | dec10*)
+ basic_machine=pdp10-dec
+ os=-tops10
+ ;;
+ decsystem20* | dec20*)
+ basic_machine=pdp10-dec
+ os=-tops20
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ os=-ose
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ os=-go32
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ os=-xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp3k9[0-9][0-9] | hp9[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k6[0-9][0-9] | hp6[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hp9k7[0-79][0-9] | hp7[0-79][0-9])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k78[0-9] | hp78[0-9])
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+ # FIXME: really hppa2.0-hp
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][13679] | hp8[0-9][13679])
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ hppa-next)
+ os=-nextstep3
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ os=-osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ os=-proelf
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i*86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv32
+ ;;
+ i*86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv4
+ ;;
+ i*86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-sysv
+ ;;
+ i*86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+ os=-solaris2
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ os=-mach
+ ;;
+ i386-vsta | vsta)
+ basic_machine=i386-unknown
+ os=-vsta
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ mingw32)
+ basic_machine=i386-pc
+ os=-mingw32
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ basic_machine=m68k-atari
+ os=-mint
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ mmix*)
+ basic_machine=mmix-knuth
+ os=-mmixware
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ os=-morphos
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ os=-msdos
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-unknown
+ os=-netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ os=-linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ os=-sysv
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ os=-mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ os=-nonstopux
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ nv1)
+ basic_machine=nv1-cray
+ os=-unicosmp
+ ;;
+ nsr-tandem)
+ basic_machine=nsr-tandem
+ ;;
+ op50n-* | op60c-*)
+ basic_machine=hppa1.1-oki
+ os=-proelf
+ ;;
+ or32 | or32-*)
+ basic_machine=or32-unknown
+ os=-coff
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ os=-ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ os=-os68k
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | k5 | k6 | nexgen | viac3)
+ basic_machine=i586-pc
+ ;;
+ pentiumpro | p6 | 6x86 | athlon | athlon_*)
+ basic_machine=i686-pc
+ ;;
+ pentiumii | pentium2 | pentiumiii | pentium3)
+ basic_machine=i686-pc
+ ;;
+ pentium4)
+ basic_machine=i786-pc
+ ;;
+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumpro-* | p6-* | 6x86-* | athlon-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pentium4-*)
+ basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=power-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64) basic_machine=powerpc64-unknown
+ ;;
+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ basic_machine=powerpc64le-unknown
+ ;;
+ ppc64le-* | powerpc64little-*)
+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ os=-pw32
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ os=-coff
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ s390 | s390-*)
+ basic_machine=s390-ibm
+ ;;
+ s390x | s390x-*)
+ basic_machine=s390x-ibm
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ sb1)
+ basic_machine=mipsisa64sb1-unknown
+ ;;
+ sb1el)
+ basic_machine=mipsisa64sb1el-unknown
+ ;;
+ sei)
+ basic_machine=mips-sei
+ os=-seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparclite-wrs | simso-wrs)
+ basic_machine=sparclite-wrs
+ os=-vxworks
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ os=-sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ os=-unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ os=-unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ os=-unicos
+ ;;
+ tic54x | c54x*)
+ basic_machine=tic54x-unknown
+ os=-coff
+ ;;
+ tic55x | c55x*)
+ basic_machine=tic55x-unknown
+ os=-coff
+ ;;
+ tic6x | c6x*)
+ basic_machine=tic6x-unknown
+ os=-coff
+ ;;
+ tx39)
+ basic_machine=mipstx39-unknown
+ ;;
+ tx39el)
+ basic_machine=mipstx39el-unknown
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ os=-tops20
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ os=-none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vpp*|vx|vx-*)
+ basic_machine=f301-fujitsu
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ w65*)
+ basic_machine=w65-wdc
+ os=-none
+ ;;
+ w89k-*)
+ basic_machine=hppa1.1-winbond
+ os=-proelf
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ z8k-*-coff)
+ basic_machine=z8k-unknown
+ os=-sim
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ basic_machine=hppa1.1-winbond
+ ;;
+ op50n)
+ basic_machine=hppa1.1-oki
+ ;;
+ op60c)
+ basic_machine=hppa1.1-oki
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ 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
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele)
+ basic_machine=sh-unknown
+ ;;
+ sh64)
+ basic_machine=sh64-unknown
+ ;;
+ sparc | sparcv9 | sparcv9b)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ mac | mpw | mac-mpw)
+ basic_machine=m68k-apple
+ ;;
+ pmac | pmac-mpw)
+ basic_machine=powerpc-apple
+ ;;
+ *-unknown)
+ # Make sure to match an already-canonicalized machine name.
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # First match some system type aliases
+ # that might get confused with valid system types.
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -svr4*)
+ os=-sysv4
+ ;;
+ -unixware*)
+ os=-sysv4.2uw
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+ | -aos* \
+ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -knetbsd* | -netbsd* | -openbsd* | -kfreebsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+ | -chorusos* | -chorusrdb* \
+ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+ | -powermax* | -dnix* | -nx6 | -nx7 | -sei*)
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -qnx*)
+ case $basic_machine in
+ x86-* | i*86-*)
+ ;;
+ *)
+ os=-nto$os
+ ;;
+ esac
+ ;;
+ -nto-qnx*)
+ ;;
+ -nto*)
+ os=`echo $os | sed -e 's|nto|nto-qnx|'`
+ ;;
+ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+ ;;
+ -mac*)
+ os=`echo $os | sed -e 's|mac|macos|'`
+ ;;
+ -linux-dietlibc)
+ os=-linux-dietlibc
+ ;;
+ -linux*)
+ os=`echo $os | sed -e 's|linux|linux-gnu|'`
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -opened*)
+ os=-openedition
+ ;;
+ -wince*)
+ os=-wince
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -atheos*)
+ os=-atheos
+ ;;
+ -386bsd)
+ os=-bsd
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ -nova*)
+ os=-rtmk-nova
+ ;;
+ -ns2 )
+ os=-nextstep2
+ ;;
+ -nsk*)
+ os=-nsk
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -ose*)
+ os=-ose
+ ;;
+ -es1800*)
+ os=-ose
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ os=-mint
+ ;;
+ -aros*)
+ os=-aros
+ ;;
+ -kaos*)
+ os=-kaos
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-rebel)
+ os=-linux
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ c4x-* | tic4x-*)
+ os=-coff
+ ;;
+ # This must come before the *-dec entry.
+ pdp10-*)
+ os=-tops20
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ m68*-cisco)
+ os=-aout
+ ;;
+ mips*-cisco)
+ os=-elf
+ ;;
+ mips*-*)
+ os=-elf
+ ;;
+ or32-*)
+ os=-coff
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-be)
+ os=-beos
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-wec)
+ os=-proelf
+ ;;
+ *-winbond)
+ os=-proelf
+ ;;
+ *-oki)
+ os=-proelf
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigaos
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-next )
+ os=-nextstep
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ f30[01]-fujitsu | f700-fujitsu)
+ os=-uxpv
+ ;;
+ *-rom68k)
+ os=-coff
+ ;;
+ *-*bug)
+ os=-coff
+ ;;
+ *-apple)
+ os=-macos
+ ;;
+ *-atari*)
+ os=-mint
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -beos*)
+ vendor=be
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -mpeix*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs* | -opened*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxsim* | -vxworks* | -windiss*)
+ vendor=wrs
+ ;;
+ -aux*)
+ vendor=apple
+ ;;
+ -hms*)
+ vendor=hitachi
+ ;;
+ -mpw* | -macos*)
+ vendor=apple
+ ;;
+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ vendor=atari
+ ;;
+ -vos*)
+ vendor=stratus
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libjava/libltdl/configure b/libjava/libltdl/configure
index 76d37e8b4ba..5f5e9e4615a 100755
--- a/libjava/libltdl/configure
+++ b/libjava/libltdl/configure
@@ -1,47 +1,480 @@
#! /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.
+# Generated by GNU Autoconf 2.57 for libltdl 1.2.
+#
+# Report bugs to <bug-libtool@gnu.org>.
#
+# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+# Free Software Foundation, Inc.
# This configure script is free software; the Free Software Foundation
# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
+
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
+do
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
+ else
+ PATH_SEPARATOR=:
+ fi
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
+ else
+ as_ln_s='ln -s'
+ fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+# Check that we are running under the correct shell.
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+case X$ECHO in
+X*--fallback-echo)
+ # Remove one level of quotation (which was required for Make).
+ ECHO=`echo "$ECHO" | sed 's,\\\\\$\\$0,'$0','`
+ ;;
+esac
+
+echo=${ECHO-echo}
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t' ; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+if test -z "$ECHO"; then
+if test "X${echo_test_string+set}" != Xset; then
+# find a string as large as possible, as long as the shell can cope with it
+ for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do
+ # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ...
+ if (echo_test_string="`eval $cmd`") 2>/dev/null &&
+ echo_test_string="`eval $cmd`" &&
+ (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null
+ then
+ break
+ fi
+ done
+fi
+
+if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ :
+else
+ # The Solaris, AIX, and Digital Unix default echo programs unquote
+ # backslashes. This makes it impossible to quote backslashes using
+ # echo "$something" | sed 's/\\/\\\\/g'
+ #
+ # So, first we look for a working echo in the user's PATH.
+
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for dir in $PATH /usr/ucb; do
+ IFS="$lt_save_ifs"
+ if (test -f $dir/echo || test -f $dir/echo$ac_exeext) &&
+ test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$dir/echo"
+ break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ if test "X$echo" = Xecho; then
+ # We didn't find a better echo, so look for alternatives.
+ if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`(print -r "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # This shell has a builtin print -r that does the trick.
+ echo='print -r'
+ elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) &&
+ test "X$CONFIG_SHELL" != X/bin/ksh; then
+ # If we have ksh, try running configure again with it.
+ ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
+ export ORIGINAL_CONFIG_SHELL
+ CONFIG_SHELL=/bin/ksh
+ export CONFIG_SHELL
+ exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"}
+ else
+ # Try using printf.
+ echo='printf %s\n'
+ if test "X`($echo '\t') 2>/dev/null`" = 'X\t' &&
+ echo_testing_string=`($echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ # Cool, printf works
+ :
+ elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL
+ export CONFIG_SHELL
+ SHELL="$CONFIG_SHELL"
+ export SHELL
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` &&
+ test "X$echo_testing_string" = 'X\t' &&
+ echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` &&
+ test "X$echo_testing_string" = "X$echo_test_string"; then
+ echo="$CONFIG_SHELL $0 --fallback-echo"
+ else
+ # maybe with a smaller string...
+ prev=:
+
+ for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do
+ if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null
+ then
+ break
+ fi
+ prev="$cmd"
+ done
-# Defaults:
-ac_help=
+ if test "$prev" != 'sed 50q "$0"'; then
+ echo_test_string=`eval $prev`
+ export echo_test_string
+ exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"}
+ else
+ # Oops. We lost completely, so just stick with echo.
+ echo=echo
+ fi
+ fi
+ fi
+ fi
+fi
+fi
+
+# Copy echo and quote the copy suitably for passing to libtool from
+# the Makefile, instead of quoting the original, which is used later.
+ECHO=$echo
+if test "X$ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then
+ ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo"
+fi
+
+
+
+
+tagnames=`echo "$tagnames,CXX" | sed 's/^,//'`
+
+tagnames=`echo "$tagnames,F77" | sed 's/^,//'`
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+exec 6>&1
+
+#
+# Initializations.
+#
ac_default_prefix=/usr/local
-# Any additions from configure.in:
-ac_help="$ac_help
- --with-auxdir=DIR path to autoconf auxiliary files"
-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]"
-ac_help="$ac_help
- --enable-fast-install[=PKGS] optimize for fast installation [default=yes]"
-ac_help="$ac_help
- --with-gnu-ld assume the C compiler uses GNU ld [default=no]"
-ac_help="$ac_help
- --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]"
-ac_help="$ac_help
- --enable-java-gc=TYPE choose garbage collector [boehm]"
-ac_help="$ac_help
- --enable-ltdl-install install libltdl"
+ac_config_libobj_dir=.
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Maximum number of lines to put in a shell here document.
+# This variable seems obsolete. It should probably be removed, and
+# only ac_max_sed_lines should be used.
+: ${ac_max_here_lines=38}
+
+# Identity of this package.
+PACKAGE_NAME='libltdl'
+PACKAGE_TARNAME='libltdl'
+PACKAGE_VERSION='1.2'
+PACKAGE_STRING='libltdl 1.2'
+PACKAGE_BUGREPORT='bug-libtool@gnu.org'
+
+ac_unique_file="ltdl.c"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#if HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#if HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#if STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# if HAVE_STDLIB_H
+# include <stdlib.h>
+# endif
+#endif
+#if HAVE_STRING_H
+# if !STDC_HEADERS && HAVE_MEMORY_H
+# include <memory.h>
+# endif
+# include <string.h>
+#endif
+#if HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#if HAVE_INTTYPES_H
+# include <inttypes.h>
+#else
+# if HAVE_STDINT_H
+# include <stdint.h>
+# endif
+#endif
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DLLTOOL ac_ct_DLLTOOL AS ac_ct_AS OBJDUMP ac_ct_OBJDUMP CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBTOOL_DEPS INSTALL_LTDL_TRUE INSTALL_LTDL_FALSE CONVENIENCE_LTDL_TRUE CONVENIENCE_LTDL_FALSE LIBADD_DL LIBOBJS LTLIBOBJS'
+ac_subst_files=''
# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
# The variables have the same names as the options, with
# dashes changed to underlines.
-build=NONE
-cache_file=./config.cache
+cache_file=/dev/null
exec_prefix=NONE
-host=NONE
no_create=
-nonopt=NONE
no_recursion=
prefix=NONE
program_prefix=NONE
@@ -50,10 +483,15 @@ program_transform_name=s,x,x,
silent=
site=
srcdir=
-target=NONE
verbose=
x_includes=NONE
x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
bindir='${exec_prefix}/bin'
sbindir='${exec_prefix}/sbin'
libexecdir='${exec_prefix}/libexec'
@@ -67,17 +505,9 @@ 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"
@@ -85,59 +515,59 @@ do
continue
fi
- case "$ac_option" in
- -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
- *) ac_optarg= ;;
- esac
+ ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'`
# Accept the important Cygnus configure options, so we can diagnose typos.
- case "$ac_option" in
+ case $ac_option in
-bindir | --bindir | --bindi | --bind | --bin | --bi)
ac_prev=bindir ;;
-bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
- bindir="$ac_optarg" ;;
+ bindir=$ac_optarg ;;
-build | --build | --buil | --bui | --bu)
- ac_prev=build ;;
+ ac_prev=build_alias ;;
-build=* | --build=* | --buil=* | --bui=* | --bu=*)
- build="$ac_optarg" ;;
+ build_alias=$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" ;;
+ cache_file=$ac_optarg ;;
+
+ --config-cache | -C)
+ cache_file=config.cache ;;
-datadir | --datadir | --datadi | --datad | --data | --dat | --da)
ac_prev=datadir ;;
-datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
| --da=*)
- datadir="$ac_optarg" ;;
+ datadir=$ac_optarg ;;
-disable-* | --disable-*)
- ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+ ac_feature=`expr "x$ac_option" : 'x-*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" ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ 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/=.*//'`
+ ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
# 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
- *=*) ;;
+ expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+ { (exit 1); exit 1; }; }
+ ac_feature=`echo $ac_feature | sed 's/-/_/g'`
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "enable_${ac_feature}='$ac_optarg'" ;;
+ eval "enable_$ac_feature='$ac_optarg'" ;;
-exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
| --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
@@ -146,95 +576,47 @@ do
-exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
| --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
| --exec=* | --exe=* | --ex=*)
- exec_prefix="$ac_optarg" ;;
+ 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 ;;
+ -help | --help | --hel | --he | -h)
+ ac_init_help=long ;;
+ -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+ ac_init_help=recursive ;;
+ -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+ ac_init_help=short ;;
-host | --host | --hos | --ho)
- ac_prev=host ;;
+ ac_prev=host_alias ;;
-host=* | --host=* | --hos=* | --ho=*)
- host="$ac_optarg" ;;
+ host_alias=$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" ;;
+ includedir=$ac_optarg ;;
-infodir | --infodir | --infodi | --infod | --info | --inf)
ac_prev=infodir ;;
-infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
- infodir="$ac_optarg" ;;
+ infodir=$ac_optarg ;;
-libdir | --libdir | --libdi | --libd)
ac_prev=libdir ;;
-libdir=* | --libdir=* | --libdi=* | --libd=*)
- libdir="$ac_optarg" ;;
+ 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" ;;
+ libexecdir=$ac_optarg ;;
-localstatedir | --localstatedir | --localstatedi | --localstated \
| --localstate | --localstat | --localsta | --localst \
@@ -243,19 +625,19 @@ EOF
-localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
| --localstate=* | --localstat=* | --localsta=* | --localst=* \
| --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
- localstatedir="$ac_optarg" ;;
+ localstatedir=$ac_optarg ;;
-mandir | --mandir | --mandi | --mand | --man | --ma | --m)
ac_prev=mandir ;;
-mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
- mandir="$ac_optarg" ;;
+ 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-cr | --no-c | -n)
no_create=yes ;;
-no-recursion | --no-recursion | --no-recursio | --no-recursi \
@@ -269,26 +651,26 @@ EOF
-oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
| --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
| --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
- oldincludedir="$ac_optarg" ;;
+ oldincludedir=$ac_optarg ;;
-prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
ac_prev=prefix ;;
-prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
- prefix="$ac_optarg" ;;
+ 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_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_suffix=$ac_optarg ;;
-program-transform-name | --program-transform-name \
| --program-transform-nam | --program-transform-na \
@@ -305,7 +687,7 @@ EOF
| --program-transfo=* | --program-transf=* \
| --program-trans=* | --program-tran=* \
| --progr-tra=* | --program-tr=* | --program-t=*)
- program_transform_name="$ac_optarg" ;;
+ program_transform_name=$ac_optarg ;;
-q | -quiet | --quiet | --quie | --qui | --qu | --q \
| -silent | --silent | --silen | --sile | --sil)
@@ -315,7 +697,7 @@ EOF
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
| --sbi=* | --sb=*)
- sbindir="$ac_optarg" ;;
+ sbindir=$ac_optarg ;;
-sharedstatedir | --sharedstatedir | --sharedstatedi \
| --sharedstated | --sharedstate | --sharedstat | --sharedsta \
@@ -326,58 +708,57 @@ EOF
| --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
| --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
| --sha=* | --sh=*)
- sharedstatedir="$ac_optarg" ;;
+ sharedstatedir=$ac_optarg ;;
-site | --site | --sit)
ac_prev=site ;;
-site=* | --site=* | --sit=*)
- site="$ac_optarg" ;;
+ site=$ac_optarg ;;
-srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
ac_prev=srcdir ;;
-srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
- srcdir="$ac_optarg" ;;
+ 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" ;;
+ sysconfdir=$ac_optarg ;;
-target | --target | --targe | --targ | --tar | --ta | --t)
- ac_prev=target ;;
+ ac_prev=target_alias ;;
-target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
- target="$ac_optarg" ;;
+ target_alias=$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 ;;
+ -version | --version | --versio | --versi | --vers | -V)
+ ac_init_version=: ;;
-with-* | --with-*)
- ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+ ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
# 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
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
ac_package=`echo $ac_package| sed 's/-/_/g'`
- case "$ac_option" in
- *=*) ;;
+ case $ac_option in
+ *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;;
*) ac_optarg=yes ;;
esac
- eval "with_${ac_package}='$ac_optarg'" ;;
+ eval "with_$ac_package='$ac_optarg'" ;;
-without-* | --without-*)
- ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+ ac_package=`expr "x$ac_option" : 'x-*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" ;;
+ expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid package name: $ac_package" >&2
+ { (exit 1); exit 1; }; }
+ ac_package=`echo $ac_package | sed 's/-/_/g'`
+ eval "with_$ac_package=no" ;;
--x)
# Obsolete; use --with-x.
@@ -388,99 +769,110 @@ EOF
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_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" ;;
+ x_libraries=$ac_optarg ;;
- -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+ -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+ { (exit 1); exit 1; }; }
;;
+ *=*)
+ ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+ # Reject names that are not valid shell variable names.
+ expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+ { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+ { (exit 1); exit 1; }; }
+ ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`
+ eval "$ac_envvar='$ac_optarg'"
+ export $ac_envvar ;;
+
*)
- 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"
+ # FIXME: should be removed in autoconf 3.0.
+ echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+ expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+ echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+ : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$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; }
+ ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+ { echo "$as_me: error: missing argument to $ac_option" >&2
+ { (exit 1); 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
+# Be sure to have absolute paths.
+for ac_var in exec_prefix prefix
+do
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* | NONE | '' ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
+ esac
+done
-# 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
+# Be sure to have absolute paths.
+for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \
+ localstatedir libdir includedir oldincludedir infodir mandir
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" ;;
+ eval ac_val=$`echo $ac_var`
+ case $ac_val in
+ [\\/$]* | ?:[\\/]* ) ;;
+ *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+ { (exit 1); exit 1; }; };;
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
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+ if test "x$build_alias" = x; then
+ cross_compiling=maybe
+ echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+ If a cross compiler is detected then cross compile mode will be used." >&2
+ elif test "x$build_alias" != "x$host_alias"; then
+ cross_compiling=yes
+ fi
+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
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
-# 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=ltdl.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=.
+ ac_confdir=`(dirname "$0") 2>/dev/null ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$0" : 'X\(//\)[^/]' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$0" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
srcdir=$ac_confdir
if test ! -r $srcdir/$ac_unique_file; then
srcdir=..
@@ -490,13 +882,486 @@ else
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; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2
+ { (exit 1); exit 1; }; }
else
- { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+ { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+ { (exit 1); exit 1; }; }
fi
fi
-srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null ||
+ { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2
+ { (exit 1); exit 1; }; }
+srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'`
+ac_env_build_alias_set=${build_alias+set}
+ac_env_build_alias_value=$build_alias
+ac_cv_env_build_alias_set=${build_alias+set}
+ac_cv_env_build_alias_value=$build_alias
+ac_env_host_alias_set=${host_alias+set}
+ac_env_host_alias_value=$host_alias
+ac_cv_env_host_alias_set=${host_alias+set}
+ac_cv_env_host_alias_value=$host_alias
+ac_env_target_alias_set=${target_alias+set}
+ac_env_target_alias_value=$target_alias
+ac_cv_env_target_alias_set=${target_alias+set}
+ac_cv_env_target_alias_value=$target_alias
+ac_env_CC_set=${CC+set}
+ac_env_CC_value=$CC
+ac_cv_env_CC_set=${CC+set}
+ac_cv_env_CC_value=$CC
+ac_env_CFLAGS_set=${CFLAGS+set}
+ac_env_CFLAGS_value=$CFLAGS
+ac_cv_env_CFLAGS_set=${CFLAGS+set}
+ac_cv_env_CFLAGS_value=$CFLAGS
+ac_env_LDFLAGS_set=${LDFLAGS+set}
+ac_env_LDFLAGS_value=$LDFLAGS
+ac_cv_env_LDFLAGS_set=${LDFLAGS+set}
+ac_cv_env_LDFLAGS_value=$LDFLAGS
+ac_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_env_CPPFLAGS_value=$CPPFLAGS
+ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set}
+ac_cv_env_CPPFLAGS_value=$CPPFLAGS
+ac_env_CPP_set=${CPP+set}
+ac_env_CPP_value=$CPP
+ac_cv_env_CPP_set=${CPP+set}
+ac_cv_env_CPP_value=$CPP
+ac_env_CXX_set=${CXX+set}
+ac_env_CXX_value=$CXX
+ac_cv_env_CXX_set=${CXX+set}
+ac_cv_env_CXX_value=$CXX
+ac_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_env_CXXFLAGS_value=$CXXFLAGS
+ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set}
+ac_cv_env_CXXFLAGS_value=$CXXFLAGS
+ac_env_CXXCPP_set=${CXXCPP+set}
+ac_env_CXXCPP_value=$CXXCPP
+ac_cv_env_CXXCPP_set=${CXXCPP+set}
+ac_cv_env_CXXCPP_value=$CXXCPP
+ac_env_F77_set=${F77+set}
+ac_env_F77_value=$F77
+ac_cv_env_F77_set=${F77+set}
+ac_cv_env_F77_value=$F77
+ac_env_FFLAGS_set=${FFLAGS+set}
+ac_env_FFLAGS_value=$FFLAGS
+ac_cv_env_FFLAGS_set=${FFLAGS+set}
+ac_cv_env_FFLAGS_value=$FFLAGS
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+ # 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 <<_ACEOF
+\`configure' configures libltdl 1.2 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE. See below for descriptions of some of the useful variables.
+Defaults for the options are specified in brackets.
+
+Configuration:
+ -h, --help display this help and exit
+ --help=short display options specific to this package
+ --help=recursive display the short help of all the included packages
+ -V, --version display version information and exit
+ -q, --quiet, --silent do not print \`checking...' messages
+ --cache-file=FILE cache test results in FILE [disabled]
+ -C, --config-cache alias for \`--cache-file=config.cache'
+ -n, --no-create do not create output files
+ --srcdir=DIR find the sources in DIR [configure dir or \`..']
+
+_ACEOF
+
+ cat <<_ACEOF
+Installation directories:
+ --prefix=PREFIX install architecture-independent files in PREFIX
+ [$ac_default_prefix]
+ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX
+ [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+ --bindir=DIR user executables [EPREFIX/bin]
+ --sbindir=DIR system admin executables [EPREFIX/sbin]
+ --libexecdir=DIR program executables [EPREFIX/libexec]
+ --datadir=DIR read-only architecture-independent data [PREFIX/share]
+ --sysconfdir=DIR read-only single-machine data [PREFIX/etc]
+ --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
+ --localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --libdir=DIR object code libraries [EPREFIX/lib]
+ --includedir=DIR C header files [PREFIX/include]
+ --oldincludedir=DIR C header files for non-gcc [/usr/include]
+ --infodir=DIR info documentation [PREFIX/info]
+ --mandir=DIR man documentation [PREFIX/man]
+_ACEOF
+
+ cat <<\_ACEOF
+
+Program names:
+ --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
+
+System types:
+ --build=BUILD configure for building on BUILD [guessed]
+ --host=HOST cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+ case $ac_init_help in
+ short | recursive ) echo "Configuration of libltdl 1.2:";;
+ esac
+ cat <<\_ACEOF
+
+Optional Features:
+ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
+ --enable-FEATURE[=ARG] include FEATURE [ARG=yes]
+ --enable-maintainer-mode enable make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer
+ --disable-dependency-tracking Speeds up one-time builds
+ --enable-dependency-tracking Do not reject slow dependency extractors
+ --enable-shared[=PKGS]
+ build shared libraries [default=yes]
+ --enable-static[=PKGS]
+ build static libraries [default=yes]
+ --enable-fast-install[=PKGS]
+ optimize for fast installation [default=yes]
+ --disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-ltdl-install install libltdl
+
+Optional Packages:
+ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
+ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
+ --with-gnu-ld assume the C compiler uses GNU ld [default=no]
+ --with-pic try to use only PIC/non-PIC objects [default=use
+ both]
+ --with-tags[=TAGS]
+ include additional configurations [automatic]
+
+Some influential environment variables:
+ CC C compiler command
+ CFLAGS C compiler flags
+ LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
+ nonstandard directory <lib dir>
+ CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
+ headers in a nonstandard directory <include dir>
+ CPP C preprocessor
+ CXX C++ compiler command
+ CXXFLAGS C++ compiler flags
+ CXXCPP C++ preprocessor
+ F77 Fortran 77 compiler command
+ FFLAGS Fortran 77 compiler flags
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <bug-libtool@gnu.org>.
+_ACEOF
+fi
+
+if test "$ac_init_help" = "recursive"; then
+ # If there are subdirs, report their specific --help.
+ ac_popdir=`pwd`
+ for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+ test -d $ac_dir || continue
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+ cd $ac_dir
+ # Check for guested configure; otherwise get Cygnus style configure.
+ if test -f $ac_srcdir/configure.gnu; then
+ echo
+ $SHELL $ac_srcdir/configure.gnu --help=recursive
+ elif test -f $ac_srcdir/configure; then
+ echo
+ $SHELL $ac_srcdir/configure --help=recursive
+ elif test -f $ac_srcdir/configure.ac ||
+ test -f $ac_srcdir/configure.in; then
+ echo
+ $ac_configure --help
+ else
+ echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+ fi
+ cd "$ac_popdir"
+ done
+fi
+
+test -n "$ac_init_help" && exit 0
+if $ac_init_version; then
+ cat <<\_ACEOF
+libltdl configure 1.2
+generated by GNU Autoconf 2.57
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002
+Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+ exit 0
+fi
+exec 5>config.log
+cat >&5 <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by libltdl $as_me 1.2, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ $ $0 $@
+
+_ACEOF
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
+
+/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
+/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+hostinfo = `(hostinfo) 2>/dev/null || echo unknown`
+/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
+/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
+/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ echo "PATH: $as_dir"
+done
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_sep=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+ for ac_arg
+ do
+ case $ac_arg in
+ -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil)
+ continue ;;
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+ esac
+ case $ac_pass in
+ 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+ 2)
+ ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+ if test $ac_must_keep_next = true; then
+ ac_must_keep_next=false # Got value, back to normal.
+ else
+ case $ac_arg in
+ *=* | --config-cache | -C | -disable-* | --disable-* \
+ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+ | -with-* | --with-* | -without-* | --without-* | --x)
+ case "$ac_configure_args0 " in
+ "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+ esac
+ ;;
+ -* ) ac_must_keep_next=true ;;
+ esac
+ fi
+ ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'"
+ # Get rid of the leading space.
+ ac_sep=" "
+ ;;
+ esac
+ done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log. We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Be sure not to use single quotes in there, as some shells,
+# such as our DU 5.0 friend, will then `close' the trap.
+trap 'exit_status=$?
+ # Save into config.log some information that might help in debugging.
+ {
+ echo
+
+ cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+ echo
+ # The following way of writing the cache mishandles newlines in values,
+{
+ (set) 2>&1 |
+ case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in
+ *ac_space=\ *)
+ sed -n \
+ "s/'"'"'/'"'"'\\\\'"'"''"'"'/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p"
+ ;;
+ *)
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+}
+ echo
+
+ cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_vars
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+
+ if test -n "$ac_subst_files"; then
+ cat <<\_ASBOX
+## ------------- ##
+## Output files. ##
+## ------------- ##
+_ASBOX
+ echo
+ for ac_var in $ac_subst_files
+ do
+ eval ac_val=$`echo $ac_var`
+ echo "$ac_var='"'"'$ac_val'"'"'"
+ done | sort
+ echo
+ fi
+
+ if test -s confdefs.h; then
+ cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+ echo
+ sed "/^$/d" confdefs.h | sort
+ echo
+ fi
+ test "$ac_signal" != 0 &&
+ echo "$as_me: caught signal $ac_signal"
+ echo "$as_me: exit $exit_status"
+ } >&5
+ rm -f core *.core &&
+ rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
+ exit $exit_status
+ ' 0
+for ac_signal in 1 2 13 15; do
+ trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# 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
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
# Prefer explicitly selected file to automatically selected ones.
if test -z "$CONFIG_SITE"; then
if test "x$prefix" != xNONE; then
@@ -507,130 +1372,122 @@ if test -z "$CONFIG_SITE"; then
fi
for ac_site_file in $CONFIG_SITE; do
if test -r "$ac_site_file"; then
- echo "loading site script $ac_site_file"
+ { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+ sed 's/^/| /' "$ac_site_file" >&5
. "$ac_site_file"
fi
done
if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+ # Some versions of bash will fail to source /dev/null (special
+ # files actually), so we avoid doing that.
+ if test -f "$cache_file"; then
+ { echo "$as_me:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+ case $cache_file in
+ [\\/]* | ?:[\\/]* ) . $cache_file;;
+ *) . ./$cache_file;;
+ esac
+ fi
else
- echo "creating cache $cache_file"
- > $cache_file
+ { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+ >$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=
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in `(set) 2>&1 |
+ sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do
+ eval ac_old_set=\$ac_cv_env_${ac_var}_set
+ eval ac_new_set=\$ac_env_${ac_var}_set
+ eval ac_old_val="\$ac_cv_env_${ac_var}_value"
+ eval ac_new_val="\$ac_env_${ac_var}_value"
+ case $ac_old_set,$ac_new_set in
+ set,)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,set)
+ { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5
+echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+ ac_cache_corrupted=: ;;
+ ,);;
+ *)
+ if test "x$ac_old_val" != "x$ac_new_val"; then
+ { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5
+echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+ { echo "$as_me:$LINENO: former value: $ac_old_val" >&5
+echo "$as_me: former value: $ac_old_val" >&2;}
+ { echo "$as_me:$LINENO: current value: $ac_new_val" >&5
+echo "$as_me: current value: $ac_new_val" >&2;}
+ ac_cache_corrupted=:
+ fi;;
+ esac
+ # Pass precious variables to config.status.
+ if test "$ac_new_set" = set; then
+ case $ac_new_val in
+ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*)
+ ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+ *) ac_arg=$ac_var=$ac_new_val ;;
+ esac
+ case " $ac_configure_args " in
+ *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy.
+ *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+ esac
fi
-else
- ac_n= ac_c='\c' ac_t=
+done
+if $ac_cache_corrupted; then
+ { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5
+echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+ { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5
+echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
-echo "configure:546: 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"
-#include "confdefs.h"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-int main() {
-#ifndef __CYGWIN__
-#define __CYGWIN__ __CYGWIN32__
-#endif
-return __CYGWIN__;
-; return 0; }
-EOF
-if { (eval echo configure:562: \"$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:579: 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"
-#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
- 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
-# Check whether --with-auxdir or --without-auxdir was given.
-if test "${with_auxdir+set}" = set; then
- withval="$with_auxdir"
- ac_aux_dir=
-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"
- 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 $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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+## ------------------------------- ##
+## Libltdl specific configuration. ##
+## ------------------------------- ##
+
+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"
@@ -639,34 +1496,43 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do
ac_aux_dir=$ac_dir
ac_install_sh="$ac_aux_dir/install.sh -c"
break
+ elif test -f $ac_dir/shtool; then
+ ac_aux_dir=$ac_dir
+ ac_install_sh="$ac_aux_dir/shtool install -c"
+ break
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 "$as_me:$LINENO: error: cannot find install-sh or install.sh in . $srcdir/." >&5
+echo "$as_me: error: cannot find install-sh or install.sh in . $srcdir/." >&2;}
+ { (exit 1); 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 is another blatant hack to work around automake bugs.
-mkinstalldirs="$ac_aux_dir/mkinstalldirs"
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"
+ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure.
if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
- if test -f ${srcdir}/ltconfig && test -f ${srcdir}/ltmain.sh; then
+ if test -f ${srcdir}/ltmain.sh; then
# if libltdl is libtoolized, it is assumed to be stand-alone and
# installed unless the command line overrides it (tested above)
enable_ltdl_install=yes
else
- echo "configure: warning: *** The top-level configure must select either" 1>&2
- echo "configure: warning: *** A""C_LIBLTDL_INSTALLABLE or A""C_LIBLTDL_CONVENIENCE." 1>&2
- { echo "configure: error: *** Maybe you want to --enable-ltdl-install?" 1>&2; exit 1; }
+ { echo "$as_me:$LINENO: WARNING: *** The top-level configure must select either" >&5
+echo "$as_me: WARNING: *** The top-level configure must select either" >&2;}
+ { echo "$as_me:$LINENO: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&5
+echo "$as_me: WARNING: *** A\"\"C_LIBLTDL_INSTALLABLE or A\"\"C_LIBLTDL_CONVENIENCE." >&2;}
+ { { echo "$as_me:$LINENO: error: *** Maybe you want to --enable-ltdl-install?" >&5
+echo "$as_me: error: *** Maybe you want to --enable-ltdl-install?" >&2;}
+ { (exit 1); exit 1; }; }
fi
fi
+
+## ------------------------ ##
+## Automake Initialisation. ##
+## ------------------------ ##
+am__api_version="1.7"
# 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,240 +1540,377 @@ fi
# SunOS /usr/etc/install
# IRIX /sbin/install
# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
# 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:683: checking for a BSD compatible install" >&5
+echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5
+echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6
if test -z "$INSTALL"; then
-if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${ac_cv_path_install+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+ ./ | .// | /cC/* | \
+ /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
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+ if test $ac_prog = install &&
+ grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # AIX install. It has an incompatible calling convention.
+ :
+ elif test $ac_prog = install &&
+ grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+ # program-specific install script used by HP pwplus--don't use.
+ :
+ else
+ ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+ break 3
+ fi
+ fi
done
- ;;
- esac
- done
- IFS="$ac_save_IFS"
+ done
+ ;;
+esac
+done
+
fi
if test "${ac_cv_path_install+set}" = set; then
- INSTALL="$ac_cv_path_install"
+ 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"
+ INSTALL=$ac_install_sh
fi
fi
-echo "$ac_t""$INSTALL" 1>&6
+echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
-echo "configure:736: checking whether build environment is sane" >&5
+echo "$as_me:$LINENO: checking whether build environment is sane" >&5
+echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6
# Just in case
sleep 1
-echo timestamp > conftestfile
+echo timestamp > conftest.file
# 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`
+ set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$*" = "X"; then
# -L didn't work.
- set X `ls -t $srcdir/configure conftestfile`
+ set X `ls -t $srcdir/configure conftest.file`
fi
- if test "$*" != "X $srcdir/configure conftestfile" \
- && test "$*" != "X conftestfile $srcdir/configure"; then
+ rm -f conftest.file
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $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; }
+ { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&5
+echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken
+alias in your environment" >&2;}
+ { (exit 1); exit 1; }; }
fi
- test "$2" = conftestfile
+ test "$2" = conftest.file
)
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
+ { { echo "$as_me:$LINENO: error: newly created file is older than distributed files!
+Check your system clock" >&5
+echo "$as_me: error: newly created file is older than distributed files!
+Check your system clock" >&2;}
+ { (exit 1); exit 1; }; }
fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
test "$program_prefix" != NONE &&
- program_transform_name="s,^,${program_prefix},; $program_transform_name"
+ 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"
+ program_transform_name="s,\$,$program_suffix,;$program_transform_name"
+# Double any \ or $. echo might interpret backslashes.
+# By default was `s,x,x', remove it if useless.
+cat <<\_ACEOF >conftest.sed
+s/[\\$]/&&/g;s/;s,x,x,$//
+_ACEOF
+program_transform_name=`echo $program_transform_name | sed -f conftest.sed`
+rm conftest.sed
+
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+ am_missing_run="$MISSING --run "
+else
+ am_missing_run=
+ { echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5
+echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
-# sed with no file args requires a program.
-test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+for ac_prog in gawk mawk 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AWK+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AWK"; then
+ ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AWK="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+ echo "$as_me:$LINENO: result: $AWK" >&5
+echo "${ECHO_T}$AWK" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$AWK" && break
+done
-echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
-echo "configure:793: 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
+echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'`
+if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftestmake <<\EOF
+ cat >conftest.make <<\_ACEOF
all:
- @echo 'ac_maketemp="${MAKE}"'
-EOF
+ @echo 'ac_maketemp="$(MAKE)"'
+_ACEOF
# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
-eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+eval `${MAKE-make} -f conftest.make 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
+rm -f conftest.make
fi
if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
- echo "$ac_t""yes" 1>&6
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
SET_MAKE=
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
SET_MAKE="MAKE=${MAKE-make}"
fi
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+ am__leading_dot=.
+else
+ am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+ # test to see if srcdir already configured
+if test "`cd $srcdir && pwd`" != "`pwd`" &&
+ test -f $srcdir/config.status; then
+ { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5
+echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;}
+ { (exit 1); exit 1; }; }
+fi
-PACKAGE=libltdl
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+ if (cygpath --version) >/dev/null 2>/dev/null; then
+ CYGPATH_W='cygpath -w'
+ else
+ CYGPATH_W=echo
+ fi
+fi
-VERSION=1.1
-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
+# Define the identity of the package.
+ PACKAGE=libltdl
+ VERSION=1.2
+
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
-missing_dir=`cd $ac_aux_dir && pwd`
-echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
-echo "configure:832: 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
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+
+AMTAR=${AMTAR-"${am_missing_run}tar"}
+
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'. However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ACLOCAL="$missing_dir/missing aclocal"
- echo "$ac_t""missing" 1>&6
-fi
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
-echo "configure:845: 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
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
else
- AUTOCONF="$missing_dir/missing autoconf"
- echo "$ac_t""missing" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working automake""... $ac_c" 1>&6
-echo "configure:858: 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
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
-echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
-echo "configure:871: 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
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
else
- AUTOHEADER="$missing_dir/missing autoheader"
- echo "$ac_t""missing" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
-echo "configure:884: 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
+ STRIP=$ac_ct_STRIP
else
- MAKEINFO="$missing_dir/missing makeinfo"
- echo "$ac_t""missing" 1>&6
+ STRIP="$ac_cv_prog_STRIP"
fi
+fi
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+
+# We need awk for the "check" target. The system "awk" is bad on
+# some platforms.
+ ac_config_headers="$ac_config_headers config.h:config-h.in"
-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 "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
+echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6
# 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
+fi;
+ echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5
+echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6
- echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6
-
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
@@ -916,218 +1919,651 @@ 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.
+
+## ------------------ ##
+## C compiler checks. ##
+## ------------------ ##
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CC"; then
+ ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # 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:927: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="gcc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="${ac_tool_prefix}cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+fi
+if test -z "$ac_cv_prog_CC"; then
+ ac_ct_CC=$CC
+ # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ CC=$ac_ct_CC
+else
+ CC="$ac_cv_prog_CC"
+fi
+
+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:957: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+ ac_prog_rejected=yes
+ continue
+ fi
+ ac_cv_prog_CC="cc"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
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
+ if test $# != 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="$@"
+ ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
fi
fi
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&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:1008: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+if test -z "$CC"; then
+ if test -n "$ac_tool_prefix"; then
+ for ac_prog in cl
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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"
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
fi
fi
-CC="$ac_cv_prog_CC"
+CC=$ac_cv_prog_CC
if test -n "$CC"; then
- echo "$ac_t""$CC" 1>&6
+ echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
- ;;
- esac
+
+ test -n "$CC" && break
+ done
+fi
+if test -z "$CC"; then
+ ac_ct_CC=$CC
+ for ac_prog in cl
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CC+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CC"; then
+ ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CC="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
fi
- test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+done
+done
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
-echo "configure:1040: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+ test -n "$ac_ct_CC" && break
+done
-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
+ CC=$ac_ct_CC
+fi
-cat > conftest.$ac_ext << EOF
+fi
-#line 1051 "configure"
-#include "confdefs.h"
-main(){return(0);}
-EOF
-if { (eval echo configure:1056: \"$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
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+echo "$as_me:$LINENO: checking for C compiler default output" >&5
+echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5
+ (eval $ac_link_default) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Find the output, starting from the most likely. This scheme is
+# not robust to junk in `.', hence go to wildcards (a.*) only as a last
+# resort.
+
+# Be careful to initialize this variable, since it used to be cached.
+# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile.
+ac_cv_exeext=
+# b.out is created by i960 compilers.
+for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out
+do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj )
+ ;;
+ conftest.$ac_ext )
+ # This is the source file.
+ ;;
+ [ab].out )
+ # We found the default executable, but exeext='' is most
+ # certainly right.
+ break;;
+ *.* )
+ ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ # FIXME: I believe we export ac_cv_exeext for Libtool,
+ # but it would be cool to find out if it's true. Does anybody
+ # maintain Libtool? --akim.
+ export ac_cv_exeext
+ break;;
+ * )
+ break;;
+ esac
+done
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+ { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6
+
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether the C compiler works" >&5
+echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6
+# FIXME: These cross compiler hacks should be removed for Autoconf 3.0
+# If not cross compiling, check that we can run a simple program.
+if test "$cross_compiling" != yes; then
+ if { ac_try='./$ac_file'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ cross_compiling=no
else
- ac_cv_prog_cc_cross=yes
+ if test "$cross_compiling" = maybe; then
+ cross_compiling=yes
+ else
+ { { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
fi
+fi
+echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check the compiler produces executables we can run. If not, either
+# the compiler is broken, or we cross compile.
+echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6
+
+echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+ test -f "$ac_file" || continue
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;;
+ *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+ export ac_cv_exeext
+ break;;
+ * ) break;;
+ esac
+done
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- ac_cv_prog_cc_works=no
+ { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
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:1082: 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
+rm -f conftest$ac_cv_exeext
+echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5
+echo "${ECHO_T}$ac_cv_exeext" >&6
-echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
-echo "configure:1087: 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
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+echo "$as_me:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6
+if test "${ac_cv_objext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.c <<EOF
-#ifdef __GNUC__
- yes;
-#endif
-EOF
-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1096: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
- ac_cv_prog_gcc=yes
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do
+ case $ac_file in
+ *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;;
+ *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+ break;;
+ esac
+done
else
- ac_cv_prog_gcc=no
-fi
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
fi
-echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6
+if test "${ac_cv_c_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
-if test $ac_cv_prog_gcc = yes; then
- GCC=yes
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
else
- GCC=
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
-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:1115: 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
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6
+GCC=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+CFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
+echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo 'void f(){}' > conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_prog_cc_g=yes
else
- ac_cv_prog_cc_g=no
-fi
-rm -f conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_prog_cc_g=no
fi
-
-echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_g" >&6
if test "$ac_test_CFLAGS" = set; then
- CFLAGS="$ac_save_CFLAGS"
+ CFLAGS=$ac_save_CFLAGS
elif test $ac_cv_prog_cc_g = yes; then
if test "$GCC" = yes; then
CFLAGS="-g -O2"
@@ -1141,237 +2577,752 @@ else
CFLAGS=
fi
fi
-
-echo $ac_n "checking for working const""... $ac_c" 1>&6
-echo "configure:1147: checking for working const" >&5
-if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5
+echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6
+if test "${ac_cv_prog_cc_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 1152 "configure"
-#include "confdefs.h"
-
-int main() {
-
-/* Ultrix mips cc rejects this. */
-typedef int charset[2]; const charset x;
-/* SunOS 4.1.1 cc rejects this. */
-char const *const *ccp;
-char **p;
-/* NEC SVR4.0.2 mips cc rejects this. */
-struct point {int x, y;};
-static struct point const zero = {0,0};
-/* AIX XL C 1.02.0.0 rejects this.
- It does not let you subtract one const X* pointer from another in an arm
- of an if-expression whose if-part is not a constant expression */
-const char *g = "string";
-ccp = &g + (g ? g-g : 0);
-/* HPUX 7.0 cc rejects these. */
-++ccp;
-p = (char**) ccp;
-ccp = (char const *const *) p;
-{ /* SCO 3.2v4 cc rejects this. */
- char *t;
- char const *s = 0 ? (char *) 0 : (char const *) 0;
-
- *t++ = 0;
-}
-{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
- int x[] = {25, 17};
- const int *foo = &x[0];
- ++foo;
+ ac_cv_prog_cc_stdc=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+ char **p;
+ int i;
+{
+ return p[i];
}
-{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
- typedef const int *iptr;
- iptr p = 0;
- ++p;
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+ char *s;
+ va_list v;
+ va_start (v,p);
+ s = g (p, va_arg (v,int));
+ va_end (v);
+ return s;
}
-{ /* AIX XL C 1.02.0.0 rejects this saying
- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
- struct s { int j; const int *ap[3]; };
- struct s *b; b->j = 5;
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1];
+ ;
+ return 0;
}
-{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
- const int foo = 10;
+_ACEOF
+# Don't try gcc -ansi; that turns off useful extensions and
+# breaks some systems' header files.
+# AIX -qlanglvl=ansi
+# Ultrix and OSF/1 -std1
+# HP-UX 10.20 and later -Ae
+# HP-UX older versions -Aa -D_HPUX_SOURCE
+# SVR4 -Xc -D__EXTENSIONS__
+for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+ CC="$ac_save_CC $ac_arg"
+ rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cc_stdc=$ac_arg
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext
+done
+rm -f conftest.$ac_ext conftest.$ac_objext
+CC=$ac_save_CC
+
+fi
+
+case "x$ac_cv_prog_cc_stdc" in
+ x|xno)
+ echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6 ;;
+ *)
+ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6
+ CC="$CC $ac_cv_prog_cc_stdc" ;;
+esac
+
+# Some people use a C++ compiler to compile C. Since we use `exit',
+# in C++ we need to declare it. In case someone uses the same compiler
+# for both compiling C and C++ we need to have the C++ compiler decide
+# the declaration of exit, since it's the most demanding environment.
+cat >conftest.$ac_ext <<_ACEOF
+#ifndef __cplusplus
+ choke me
+#endif
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-; return 0; }
-EOF
-if { (eval echo configure:1201: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
- ac_cv_c_const=yes
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- ac_cv_c_const=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
+fi
+
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+DEPDIR="${am__leading_dot}deps"
+
+ ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+ @echo done
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5
+echo $ECHO_N "checking for style of include used by $am_make... $ECHO_C" >&6
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
+ am__include=include
+ am__quote=
+ _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+ echo '.include "confinc"' > confmf
+ if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+ am__include=.include
+ am__quote="\""
+ _am_result=BSD
+ fi
+fi
+
+
+echo "$as_me:$LINENO: result: $_am_result" >&5
+echo "${ECHO_T}$_am_result" >&6
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking or --disable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then
+ enableval="$enable_dependency_tracking"
+
+fi;
+if test "x$enable_dependency_tracking" != xno; then
+ am_depcomp="$ac_aux_dir/depcomp"
+ AMDEPBACKSLASH='\'
+fi
+
+
+if test "x$enable_dependency_tracking" != xno; then
+ AMDEP_TRUE=
+ AMDEP_FALSE='#'
+else
+ AMDEP_TRUE='#'
+ AMDEP_FALSE=
fi
-echo "$ac_t""$ac_cv_c_const" 1>&6
+
+
+
+depcc="$CC" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CC_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CC_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CC_dependencies_compiler_type" >&6
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+
+
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+ am__fastdepCC_TRUE=
+ am__fastdepCC_FALSE='#'
+else
+ am__fastdepCC_TRUE='#'
+ am__fastdepCC_FALSE=
+fi
+
+
+
+echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
+echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6
+if test "${ac_cv_c_const+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+/* FIXME: Include the comments suggested by Paul. */
+#ifndef __cplusplus
+ /* Ultrix mips cc rejects this. */
+ typedef int charset[2];
+ const charset x;
+ /* SunOS 4.1.1 cc rejects this. */
+ char const *const *ccp;
+ char **p;
+ /* NEC SVR4.0.2 mips cc rejects this. */
+ struct point {int x, y;};
+ static struct point const zero = {0,0};
+ /* AIX XL C 1.02.0.0 rejects this.
+ It does not let you subtract one const X* pointer from another in
+ an arm of an if-expression whose if-part is not a constant
+ expression */
+ const char *g = "string";
+ ccp = &g + (g ? g-g : 0);
+ /* HPUX 7.0 cc rejects these. */
+ ++ccp;
+ p = (char**) ccp;
+ ccp = (char const *const *) p;
+ { /* SCO 3.2v4 cc rejects this. */
+ char *t;
+ char const *s = 0 ? (char *) 0 : (char const *) 0;
+
+ *t++ = 0;
+ }
+ { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */
+ int x[] = {25, 17};
+ const int *foo = &x[0];
+ ++foo;
+ }
+ { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
+ typedef const int *iptr;
+ iptr p = 0;
+ ++p;
+ }
+ { /* AIX XL C 1.02.0.0 rejects this saying
+ "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
+ struct s { int j; const int *ap[3]; };
+ struct s *b; b->j = 5;
+ }
+ { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
+ const int foo = 10;
+ }
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_c_const=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_c_const=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
+echo "${ECHO_T}$ac_cv_c_const" >&6
if test $ac_cv_c_const = no; then
- cat >> confdefs.h <<\EOF
-#define const
-EOF
+
+cat >>confdefs.h <<\_ACEOF
+#define const
+_ACEOF
fi
-echo $ac_n "checking for inline""... $ac_c" 1>&6
-echo "configure:1222: checking for inline" >&5
-if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for inline" >&5
+echo $ECHO_N "checking for inline... $ECHO_C" >&6
+if test "${ac_cv_c_inline+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_c_inline=no
for ac_kw in inline __inline__ __inline; do
- cat > conftest.$ac_ext <<EOF
-#line 1229 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifndef __cplusplus
+typedef int foo_t;
+static $ac_kw foo_t static_foo () {return 0; }
+$ac_kw foo_t foo () {return 0; }
+#endif
-int main() {
-} $ac_kw foo() {
-; return 0; }
-EOF
-if { (eval echo configure:1236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- rm -rf conftest*
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
ac_cv_c_inline=$ac_kw; break
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
done
fi
-
-echo "$ac_t""$ac_cv_c_inline" 1>&6
-case "$ac_cv_c_inline" in
+echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5
+echo "${ECHO_T}$ac_cv_c_inline" >&6
+case $ac_cv_c_inline in
inline | yes) ;;
- no) cat >> confdefs.h <<\EOF
-#define inline
-EOF
+ no)
+cat >>confdefs.h <<\_ACEOF
+#define inline
+_ACEOF
;;
- *) cat >> confdefs.h <<EOF
+ *) cat >>confdefs.h <<_ACEOF
#define inline $ac_cv_c_inline
-EOF
+_ACEOF
;;
esac
+## ----------------------- ##
+## Libtool initialisation. ##
+## ----------------------- ##
+
+
# 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
+ 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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_shared=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
enable_shared=yes
-fi
+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
+ 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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_static=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
enable_static=yes
-fi
+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
+ 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.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for pkg in $enableval; do
+ IFS="$lt_save_ifs"
+ if test "X$pkg" = "X$p"; then
+ enable_fast_install=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
enable_fast_install=yes
+fi;
+
+# Make sure we can run config.sub.
+$ac_config_sub sun4 >/dev/null 2>&1 ||
+ { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5
+echo "$as_me: error: cannot run $ac_config_sub" >&2;}
+ { (exit 1); exit 1; }; }
+
+echo "$as_me:$LINENO: checking build system type" >&5
+echo $ECHO_N "checking build system type... $ECHO_C" >&6
+if test "${ac_cv_build+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_build_alias=$build_alias
+test -z "$ac_cv_build_alias" &&
+ ac_cv_build_alias=`$ac_config_guess`
+test -z "$ac_cv_build_alias" &&
+ { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5
+echo "$as_me: error: cannot guess build type; you must specify one" >&2;}
+ { (exit 1); exit 1; }; }
+ac_cv_build=`$ac_config_sub $ac_cv_build_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+
fi
+echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6
+build=$ac_cv_build
+build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking host system type" >&5
+echo $ECHO_N "checking host system type... $ECHO_C" >&6
+if test "${ac_cv_host+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_cv_host_alias=$host_alias
+test -z "$ac_cv_host_alias" &&
+ ac_cv_host_alias=$ac_cv_build_alias
+ac_cv_host=`$ac_config_sub $ac_cv_host_alias` ||
+ { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5
+echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;}
+ { (exit 1); exit 1; }; }
+fi
+echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6
+host=$ac_cv_host
+host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+
+
+echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5
+echo $ECHO_N "checking for a sed that does not truncate output... $ECHO_C" >&6
+if test "${lt_cv_path_SED+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for lt_ac_prog in sed gsed; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+ lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+ fi
+ done
+ done
+done
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+ test ! -f $lt_ac_sed && break
+ cat /dev/null > conftest.in
+ lt_ac_count=0
+ echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+ # Check for GNU sed and select it if it is found.
+ if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+ lt_cv_path_SED=$lt_ac_sed
+ break
+ fi
+ while true; do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo >>conftest.nl
+ $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+ cmp -s conftest.out conftest.nl || break
+ # 10000 chars as input seems more than enough
+ test $lt_ac_count -gt 10 && break
+ lt_ac_count=`expr $lt_ac_count + 1`
+ if test $lt_ac_count -gt $lt_ac_max; then
+ lt_ac_max=$lt_ac_count
+ lt_cv_path_SED=$lt_ac_sed
+ fi
+ done
+done
+SED=$lt_cv_path_SED
-# 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:1339: checking host system type" >&5
+echo "$as_me:$LINENO: result: $SED" >&5
+echo "${ECHO_T}$SED" >&6
-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
+echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6
+if test "${ac_cv_prog_egrep+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if echo a | (grep -E '(a|b)') >/dev/null 2>&1
+ then ac_cv_prog_egrep='grep -E'
+ else ac_cv_prog_egrep='egrep'
+ fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5
+echo "${ECHO_T}$ac_cv_prog_egrep" >&6
+ EGREP=$ac_cv_prog_egrep
-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 build system type""... $ac_c" 1>&6
-echo "configure:1360: 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
@@ -1379,13 +3330,12 @@ if test "${with_gnu_ld+set}" = set; then
test "$withval" = no || with_gnu_ld=yes
else
with_gnu_ld=no
-fi
-
+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:1389: checking for ld used by GCC" >&5
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
case $host in
*-*-mingw*)
# gcc leaves a trailing carriage return which upsets mingw
@@ -1393,14 +3343,14 @@ echo "configure:1389: 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='/[^/][^/]*/\.\./'
# Canonicalize the path of ld
- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+ 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%/%"`
+ ac_prog=`echo $ac_prog| $SED "s%$re_direlt%/%"`
done
test -z "$LD" && LD="$ac_prog"
;;
@@ -1414,138 +3364,151 @@ echo "configure:1389: 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:1419: checking for GNU ld" >&5
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
else
- echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
-echo "configure:1422: checking for non-GNU ld" >&5
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
fi
-if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
if test -z "$LD"; then
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
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
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
test "$with_gnu_ld" != no && break
- else
+ ;;
+ *)
test "$with_gnu_ld" != yes && break
- fi
+ ;;
+ esac
fi
done
- IFS="$ac_save_ifs"
+ IFS="$lt_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
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&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:1457: 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
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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
-else
- ac_cv_prog_gnu_ld=no
-fi
+case `"$LD" -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
-echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6
-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:1474: 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
+echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5
+echo $ECHO_N "checking for $LD option to reload object files... $ECHO_C" >&6
+if test "${lt_cv_ld_reload_flag+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
lt_cv_ld_reload_flag='-r'
fi
-
-echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5
+echo "${ECHO_T}$lt_cv_ld_reload_flag" >&6
reload_flag=$lt_cv_ld_reload_flag
-test -n "$reload_flag" && reload_flag=" $reload_flag"
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
-echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
-echo "configure:1486: 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
+echo "$as_me:$LINENO: checking for BSD-compatible nm" >&5
+echo $ECHO_N "checking for BSD-compatible nm... $ECHO_C" >&6
+if test "${lt_cv_path_NM+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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-:}"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
- tmp_nm=$ac_dir/${ac_tool_prefix}nm
- if test -f $tmp_nm || test -f $tmp_nm$ac_exeext ; 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
# 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"
+ case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+ */dev/null* | *'Invalid file or object type'*)
+ 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"
- break
- else
- ac_cv_path_NM=${ac_cv_path_NM="$tmp_nm"} # keep the first match, but
- continue # so that we can try to find one that supports BSD flags
- fi
+ ;;
+ *)
+ case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+ */dev/null*)
+ lt_cv_path_NM="$tmp_nm -p"
+ break
+ ;;
+ *)
+ 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
+ ;;
+ esac
+ esac
fi
done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
+ IFS="$lt_save_ifs"
+ test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
fi
fi
-
-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:1524: 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
+echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5
+echo "${ECHO_T}$lt_cv_path_NM" >&6
+NM="$lt_cv_path_NM"
+
+echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&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
+ echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6
fi
-echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
-echo "configure:1545: 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
+echo "$as_me:$LINENO: checking how to recognise dependent libraries" >&5
+echo $ECHO_N "checking how to recognise dependent libraries... $ECHO_C" >&6
+if test "${lt_cv_deplibs_check_method+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- lt_cv_file_magic_cmd='${MAGIC}'
+ 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
@@ -1554,13 +3517,13 @@ lt_cv_deplibs_check_method='unknown'
# `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.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended 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
-aix4*)
+case $host_os in
+aix4* | aix5*)
lt_cv_deplibs_check_method=pass_all
;;
@@ -1569,24 +3532,40 @@ 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
;;
-cygwin* | mingw*)
- lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
- lt_cv_file_magic_cmd='${OBJDUMP} -f'
+cygwin* | mingw* | pw32*)
+ # win32_libid is a shell function defined in ltmain.sh
+ lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+ lt_cv_file_magic_cmd='win32_libid'
+ ;;
+
+darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
+ 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
+ lt_cv_deplibs_check_method=pass_all
;;
-freebsd* )
+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
@@ -1599,52 +3578,82 @@ 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_file_magic_cmd=/usr/bin/file
- lt_cv_file_magic_test_file=/usr/lib/libc.sl
+ case "$host_cpu" in
+ ia64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+ ;;
+ hppa*64*)
+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'
+ lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+ ;;
+ *)
+ 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_test_file=/usr/lib/libc.sl
+ ;;
+ esac
;;
-irix5* | irix6*)
- case "$host_os" in
- irix5*)
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ irix5* | nonstopux*)
# 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
;;
# This must be Linux ELF.
-linux-gnu*)
- case "$host_cpu" in
- alpha* | i*86 | powerpc* | sparc* | ia64* )
+linux*)
+ case $host_cpu in
+ alpha* | hppa* | i*86 | ia64* | m68* | mips | mipsel | powerpc* | sparc* | s390* | sh*)
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]+|_pic\.a)$'
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|_pic\.a)$'
+ fi
+ ;;
+
+newos6*)
+ 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
+ ;;
+
+nto-qnx)
+ lt_cv_deplibs_check_method=unknown
+ ;;
+
+openbsd*)
+ lt_cv_file_magic_cmd=/usr/bin/file
+ lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+ else
+ lt_cv_deplibs_check_method='file_magic OpenBSD.* shared library'
fi
;;
@@ -1665,120 +3674,2583 @@ solaris*)
;;
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- case "$host_vendor" in
+ case $host_vendor in
+ 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*`
+ ;;
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*`
+ sequent)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+ ;;
+ sni)
+ lt_cv_file_magic_cmd='/bin/file'
+ lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+ lt_cv_file_magic_test_file=/lib/libc.so
+ ;;
+ siemens)
+ lt_cv_deplibs_check_method=pass_all
;;
esac
;;
+
+sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7* | sysv4*uw2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
fi
-
-echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5
+echo "${ECHO_T}$lt_cv_deplibs_check_method" >&6
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
-echo $ac_n "checking for object suffix""... $ac_c" 1>&6
-echo "configure:1688: 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:1694: \"$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.//` ;;
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *ELF-32*)
+ HPUX_IA64_MODE="32"
+ ;;
+ *ELF-64*)
+ HPUX_IA64_MODE="64"
+ ;;
+ esac
+ fi
+ rm -rf conftest*
+ ;;
+*-*-irix6*)
+ # Find out which ABI we are using.
+ echo '#line 3752 "configure"' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ LD="${LD-ld} -melf32bsmip"
+ ;;
+ *N32*)
+ LD="${LD-ld} -melf32bmipn32"
+ ;;
+ *64-bit*)
+ LD="${LD-ld} -melf64bmip"
+ ;;
+ esac
+ else
+ 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
+ fi
+ rm -rf conftest*
+ ;;
+
+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*)
+ # Find out which ABI we are using.
+ echo 'int i;' > conftest.$ac_ext
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ case "`/usr/bin/file conftest.o`" in
+ *32-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_i386"
+ ;;
+ ppc64-*linux*)
+ LD="${LD-ld} -m elf32ppclinux"
+ ;;
+ s390x-*linux*)
+ LD="${LD-ld} -m elf_s390"
+ ;;
+ sparc64-*linux*)
+ LD="${LD-ld} -m elf32_sparc"
+ ;;
+ esac
+ ;;
+ *64-bit*)
+ case $host in
+ x86_64-*linux*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ ppc*-*linux*|powerpc*-*linux*)
+ LD="${LD-ld} -m elf64ppc"
+ ;;
+ s390*-*linux*)
+ LD="${LD-ld} -m elf64_s390"
+ ;;
+ sparc*-*linux*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ ;;
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 "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5
+echo $ECHO_N "checking whether the C compiler needs -belf... $ECHO_C" >&6
+if test "${lt_cv_cc_needs_belf+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ lt_cv_cc_needs_belf=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+lt_cv_cc_needs_belf=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5
+echo "${ECHO_T}$lt_cv_cc_needs_belf" >&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
+ ;;
+*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_DLLTOOL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ echo "$as_me:$LINENO: result: $DLLTOOL" >&5
+echo "${ECHO_T}$DLLTOOL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_DLLTOOL" && ac_cv_prog_ac_ct_DLLTOOL="false"
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5
+echo "${ECHO_T}$ac_ct_DLLTOOL" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ DLLTOOL=$ac_ct_DLLTOOL
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AS"; then
+ ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AS="${ac_tool_prefix}as"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+ echo "$as_me:$LINENO: result: $AS" >&5
+echo "${ECHO_T}$AS" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+ ac_ct_AS=$AS
+ # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AS+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AS"; then
+ ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AS="as"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_AS" && ac_cv_prog_ac_ct_AS="false"
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AS" >&5
+echo "${ECHO_T}$ac_ct_AS" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AS=$ac_ct_AS
+else
+ AS="$ac_cv_prog_AS"
+fi
+
+ if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_OBJDUMP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$OBJDUMP"; then
+ ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+ echo "$as_me:$LINENO: result: $OBJDUMP" >&5
+echo "${ECHO_T}$OBJDUMP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+ ac_ct_OBJDUMP=$OBJDUMP
+ # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_OBJDUMP"; then
+ ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_OBJDUMP="objdump"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_OBJDUMP" && ac_cv_prog_ac_ct_OBJDUMP="false"
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5
+echo "${ECHO_T}$ac_ct_OBJDUMP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ OBJDUMP=$ac_ct_OBJDUMP
+else
+ OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+ ;;
+
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5
+echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+ CPP=
+fi
+if test -z "$CPP"; then
+ if test "${ac_cv_prog_CPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # Double quotes because CPP needs to be expanded
+ for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
+ done
+ ac_cv_prog_CPP=$CPP
+
+fi
+ CPP=$ac_cv_prog_CPP
+else
+ ac_cv_prog_CPP=$CPP
+fi
+echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for ANSI C header files" >&5
+echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6
+if test "${ac_cv_header_stdc+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_header_stdc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_header_stdc=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "memchr" >/dev/null 2>&1; then
+ :
+else
+ 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 <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+ $EGREP "free" >/dev/null 2>&1; then
+ :
+else
+ 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 <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ctype.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+ (('a' <= (c) && (c) <= 'i') \
+ || ('j' <= (c) && (c) <= 'r') \
+ || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#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);
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+fi
+fi
+echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+ inttypes.h stdint.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in dlfcn.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$CXX"; then
+ ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+ echo "$as_me:$LINENO: result: $CXX" >&5
+echo "${ECHO_T}$CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$CXX" && break
done
+fi
+if test -z "$CXX"; then
+ ac_ct_CXX=$CXX
+ for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_CXX"; then
+ ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_CXX="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+ echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5
+echo "${ECHO_T}$ac_ct_CXX" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$ac_ct_CXX" && break
+done
+test -n "$ac_ct_CXX" || ac_ct_CXX="g++"
+
+ CXX=$ac_ct_CXX
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO:" \
+ "checking for C++ compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6
+if test "${ac_cv_cxx_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+#ifndef __GNUC__
+ choke me
+#endif
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
else
- { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
fi
+echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6
+GXX=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="-g"
+echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
+echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_cxx_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_cxx_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_cxx_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5
+echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6
+if test "$ac_test_CXXFLAGS" = set; then
+ CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+ if test "$GXX" = yes; then
+ CXXFLAGS="-g -O2"
+ else
+ CXXFLAGS="-g"
+ fi
+else
+ if test "$GXX" = yes; then
+ CXXFLAGS="-O2"
+ else
+ CXXFLAGS=
+ fi
+fi
+for ac_declaration in \
+ '' \
+ 'extern "C" void std::exit (int) throw (); using std::exit;' \
+ 'extern "C" void std::exit (int); using std::exit;' \
+ 'extern "C" void exit (int) throw ();' \
+ 'extern "C" void exit (int);' \
+ 'void exit (int);'
+do
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+#include <stdlib.h>
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+continue
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_declaration
+int
+main ()
+{
+exit (42);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+done
rm -f conftest*
+if test -n "$ac_declaration"; then
+ echo '#ifdef __cplusplus' >>confdefs.h
+ echo $ac_declaration >>confdefs.h
+ echo '#endif' >>confdefs.h
fi
-echo "$ac_t""$ac_cv_objext" 1>&6
-OBJEXT=$ac_cv_objext
-ac_objext=$ac_cv_objext
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+depcc="$CXX" am_compiler_list=
+
+echo "$as_me:$LINENO: checking dependency style of $depcc" >&5
+echo $ECHO_N "checking dependency style of $depcc... $ECHO_C" >&6
+if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+ # We make a subdir and do the tests there. Otherwise we can end up
+ # making bogus files that we don't know about and never remove. For
+ # instance it was reported that on HP-UX the gcc test will end up
+ # making a dummy file named `D' -- because `-MD' means `put the output
+ # in D'.
+ mkdir conftest.dir
+ # Copy depcomp to subdir because otherwise we won't find it if we're
+ # using a relative directory.
+ cp "$am_depcomp" conftest.dir
+ cd conftest.dir
+ # We will build objects and dependencies in a subdirectory because
+ # it helps to detect inapplicable dependency modes. For instance
+ # both Tru64's cc and ICC support -MD to output dependencies as a
+ # side effect of compilation, but ICC will put the dependencies in
+ # the current directory while Tru64 will put them in the object
+ # directory.
+ mkdir sub
+
+ am_cv_CXX_dependencies_compiler_type=none
+ if test "$am_compiler_list" = ""; then
+ am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+ fi
+ for depmode in $am_compiler_list; do
+ # Setup a source with many dependencies, because some compilers
+ # like to wrap large dependency lists on column 80 (with \), and
+ # we should not choose a depcomp mode which is confused by this.
+ #
+ # We need to recreate these files for each test, as the compiler may
+ # overwrite some of them when testing with obscure command lines.
+ # This happens at least with the AIX C compiler.
+ : > sub/conftest.c
+ for i in 1 2 3 4 5 6; do
+ echo '#include "conftst'$i'.h"' >> sub/conftest.c
+ : > sub/conftst$i.h
+ done
+ echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+ case $depmode in
+ nosideeffect)
+ # after this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested
+ if test "x$enable_dependency_tracking" = xyes; then
+ continue
+ else
+ break
+ fi
+ ;;
+ none) break ;;
+ esac
+ # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # mode. It turns out that the SunPro C++ compiler does not properly
+ # handle `-M -o', and we need to detect this.
+ if depmode=$depmode \
+ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
+ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
+ >/dev/null 2>conftest.err &&
+ grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+ grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
+ ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+ # icc doesn't choke on unknown options, it will just issue warnings
+ # (even with -Werror). So we grep stderr for any message
+ # that says an option was ignored.
+ if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else
+ am_cv_CXX_dependencies_compiler_type=$depmode
+ break
+ fi
+ fi
+ done
+
+ cd ..
+ rm -rf conftest.dir
+else
+ am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5
+echo "${ECHO_T}$am_cv_CXX_dependencies_compiler_type" >&6
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
-echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
-echo "configure:1714: checking for executable suffix" >&5
-if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+if
+ test "x$enable_dependency_tracking" != xno \
+ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+ am__fastdepCXX_TRUE=
+ am__fastdepCXX_FALSE='#'
else
- if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
- ac_cv_exeext=.exe
+ am__fastdepCXX_TRUE='#'
+ am__fastdepCXX_FALSE=
+fi
+
+
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5
+echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6
+if test -z "$CXXCPP"; then
+ if test "${ac_cv_prog_CXXCPP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -f conftest*
- echo 'int main () { return 0; }' > conftest.$ac_ext
- ac_cv_exeext=
- if { (eval echo configure:1724: \"$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
+ # Double quotes because CXXCPP needs to be expanded
+ for CXXCPP in "$CXX -E" "/lib/cpp"
+ do
+ ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ break
+fi
+
done
+ ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+ CXXCPP=$ac_cv_prog_CXXCPP
+else
+ ac_cv_prog_CXXCPP=$CXXCPP
+fi
+echo "$as_me:$LINENO: result: $CXXCPP" >&5
+echo "${ECHO_T}$CXXCPP" >&6
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+ # Use a header file that comes with gcc, so configuring glibc
+ # with a fresh cross-compiler works.
+ # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ # <limits.h> exists even on freestanding compilers.
+ # On the NeXT, cc -E runs the code through the compiler's parser,
+ # not just through cpp. "Syntax error" is here to catch this case.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+ Syntax error
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
else
- { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+ ac_cpp_err=
fi
- rm -f conftest*
- test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ :
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ # Broken: fails on valid input.
+continue
fi
+rm -f conftest.err conftest.$ac_ext
+
+ # OK, works on sane cases. Now check whether non-existent headers
+ # can be detected and how.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_cxx_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
fi
+if test -z "$ac_cpp_err"; then
+ # Broken: success on invalid input.
+continue
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-EXEEXT=""
-test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
-echo "$ac_t""${ac_cv_exeext}" 1>&6
-ac_exeext=$EXEEXT
+ # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+ :
+else
+ { { echo "$as_me:$LINENO: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+fi
-if test $host != $build; then
- ac_tool_prefix=${host_alias}-
+ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+ for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$F77"; then
+ ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+ echo "$as_me:$LINENO: result: $F77" >&5
+echo "${ECHO_T}$F77" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ test -n "$F77" && break
+ done
+fi
+if test -z "$F77"; then
+ ac_ct_F77=$F77
+ for ac_prog in g77 f77 xlf frt pgf77 fl32 af77 fort77 f90 xlf90 pgf90 epcf90 f95 fort xlf95 lf95 g95
+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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_F77"; then
+ ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_F77="$ac_prog"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+ echo "$as_me:$LINENO: result: $ac_ct_F77" >&5
+echo "${ECHO_T}$ac_ct_F77" >&6
else
- ac_tool_prefix=
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
+ test -n "$ac_ct_F77" && break
+done
+
+ F77=$ac_ct_F77
+fi
+
+
+# Provide some information about the compiler.
+echo "$as_me:5490:" \
+ "checking for Fortran 77 compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
+ (eval $ac_compiler --version </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5
+ (eval $ac_compiler -v </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5
+ (eval $ac_compiler -V </dev/null >&5) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.
+ac_save_ext=$ac_ext
+ac_ext=F
+echo "$as_me:$LINENO: checking whether we are using the GNU Fortran 77 compiler" >&5
+echo $ECHO_N "checking whether we are using the GNU Fortran 77 compiler... $ECHO_C" >&6
+if test "${ac_cv_f77_compiler_gnu+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+#ifndef __GNUC__
+ choke me
+#endif
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_compiler_gnu=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_compiler_gnu=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_f77_compiler_gnu" >&5
+echo "${ECHO_T}$ac_cv_f77_compiler_gnu" >&6
+ac_ext=$ac_save_ext
+G77=`test $ac_compiler_gnu = yes && echo yes`
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+echo "$as_me:$LINENO: checking whether $F77 accepts -g" >&5
+echo $ECHO_N "checking whether $F77 accepts -g... $ECHO_C" >&6
+if test "${ac_cv_prog_f77_g+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ FFLAGS=-g
+cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_prog_f77_g=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_prog_f77_g=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+
+fi
+echo "$as_me:$LINENO: result: $ac_cv_prog_f77_g" >&5
+echo "${ECHO_T}$ac_cv_prog_f77_g" >&6
+if test "$ac_test_FFLAGS" = set; then
+ FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+ if test "$G77" = yes; then
+ FFLAGS="-g -O2"
+ else
+ FFLAGS="-g"
+ fi
+else
+ if test "$G77" = yes; then
+ FFLAGS="-O2"
+ else
+ FFLAGS=
+ fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
# 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
-file_magic*)
- if test "$file_magic_cmd" = '${MAGIC}'; then
- echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
-echo "configure:1757: 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
+# find the maximum length of command line arguments
+echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5
+echo $ECHO_N "checking the maximum length of command line arguments... $ECHO_C" >&6
+if test "${lt_cv_sys_max_cmd_len+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ i=0
+ testring="ABCD"
+
+ case $build_os in
+ msdosdjgpp*)
+ # On DJGPP, this test can blow up pretty badly due to problems in libc
+ # (any single argument exceeding 2000 bytes causes a buffer overrun
+ # during glob expansion). Even if it were fixed, the result of this
+ # check would be larger than it should be.
+ lt_cv_sys_max_cmd_len=12288; # 12K is about right
+ ;;
+
+ gnu*)
+ # Under GNU Hurd, this test is not required because there is
+ # no limit to the length of command line arguments.
+ # Libtool will interpret -1 as no limit whatsoever
+ lt_cv_sys_max_cmd_len=-1;
+ ;;
+
+ cygwin* | mingw*)
+ # On Win9x/ME, this test blows up -- it succeeds, but takes
+ # about 5 minutes as the teststring grows exponentially.
+ # Worse, since 9x/ME are not pre-emptively multitasking,
+ # you end up with a "frozen" computer, even though with patience
+ # the test eventually succeeds (with a max line length of 256k).
+ # Instead, let's just punt: use the minimum linelength reported by
+ # all of the supported platforms: 8192 (on NT/2K/XP).
+ lt_cv_sys_max_cmd_len=8192;
+ ;;
+
+ *)
+ # 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") >/dev/null 2>&1 &&
+ 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.
+ # It appears as though 1/2 is a usable value.
+ lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+ ;;
+ esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+ echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5
+echo "${ECHO_T}$lt_cv_sys_max_cmd_len" >&6
else
- case "$MAGIC" in
- /*)
- lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
+ echo "$as_me:$LINENO: result: none" >&5
+echo "${ECHO_T}none" >&6
+fi
+
+
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5
+echo $ECHO_N "checking command to parse $NM output from $compiler object... $ECHO_C" >&6
+if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Transform the above into a raw symbol and a C symbol.
+symxfrm='\1 \2\3 \3'
+
+# Transform an extracted symbol line into a proper C declaration
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern int \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+ symcode='[BCDT]'
+ ;;
+cygwin* | mingw* | pw32*)
+ symcode='[ABCDGISTW]'
+ ;;
+hpux*) # Its linker distinguishes data from code symbols
+ if test "$host_cpu" = ia64; then
+ symcode='[ABCDEGRST]'
+ fi
+ lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+ lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (lt_ptr) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (lt_ptr) \&\2},/p'"
;;
- ?:/*)
- ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+irix* | nonstopux*)
+ symcode='[BCDEGRST]'
+ ;;
+osf*)
+ symcode='[BCDEGQRST]'
+ ;;
+solaris* | sysv5*)
+ symcode='[BDT]'
+ ;;
+sysv4)
+ symcode='[DFNSTU]'
+ ;;
+esac
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+ opt_cr=`echo 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+ ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+ symcode='[ABCDGISTW]' ;;
+esac
+
+# Try without a prefix undercore, then with it.
+for ac_symprfx in "" "_"; do
+
+ # Write the raw and C identifiers.
+ lt_cv_sys_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
+
+ rm -f conftest*
+ 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 { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$nlist"; then
+ # Try sorting and uniquifying the output.
+ if sort "$nlist" | uniq > "$nlist"T; then
+ mv -f "$nlist"T "$nlist"
+ else
+ rm -f "$nlist"T
+ fi
+
+ # Make sure that we snagged all the symbols we need.
+ if grep ' nm_test_var$' "$nlist" >/dev/null; then
+ if grep ' nm_test_func$' "$nlist" >/dev/null; then
+ cat <<EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+EOF
+ # Now generate the symbol file.
+ eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | grep -v main >> conftest.$ac_ext'
+
+ cat <<EOF >> conftest.$ac_ext
+#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;
+}
+lt_preloaded_symbols[] =
+{
+EOF
+ $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (lt_ptr_t) \&\2},/" < "$nlist" | grep -v main >> conftest.$ac_ext
+ cat <<\EOF >> conftest.$ac_ext
+ {0, (lt_ptr_t) 0}
+};
+
+#ifdef __cplusplus
+}
+#endif
+EOF
+ # Now try linking the two files.
+ mv conftest.$ac_objext conftstm.$ac_objext
+ lt_save_LIBS="$LIBS"
+ lt_save_CFLAGS="$CFLAGS"
+ LIBS="conftstm.$ac_objext"
+ CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext}; then
+ pipe_works=yes
+ fi
+ LIBS="$lt_save_LIBS"
+ CFLAGS="$lt_save_CFLAGS"
+ else
+ echo "cannot find nm_test_func in $nlist" >&5
+ fi
+ else
+ echo "cannot find nm_test_var in $nlist" >&5
+ fi
+ else
+ echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+ fi
+ else
+ echo "$progname: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ fi
+ rm -f conftest* conftst*
+
+ # Do not use the global_symbol_pipe unless it works.
+ if test "$pipe_works" = yes; then
+ break
+ else
+ lt_cv_sys_global_symbol_pipe=
+ fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+ lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+ echo "$as_me:$LINENO: result: failed" >&5
+echo "${ECHO_T}failed" >&6
+else
+ echo "$as_me:$LINENO: result: ok" >&5
+echo "${ECHO_T}ok" >&6
+fi
+
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${lt_cv_objdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+ lt_cv_objdir=.libs
+else
+ # MS-DOS does not allow filenames that begin with a dot.
+ lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5
+echo "${ECHO_T}$lt_cv_objdir" >&6
+objdir=$lt_cv_objdir
+
+
+
+
+
+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
+ # vanish in a puff of smoke.
+ if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+ fi
;;
+esac
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e s/^X//'
+sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+# Constants:
+rm="rm -f"
+
+# Global variables:
+default_ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except M$VC,
+# which needs '.lib').
+libext=a
+ltmain="$ac_aux_dir/ltmain.sh"
+ofile="$default_ofile"
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$AR"; then
+ ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_AR="${ac_tool_prefix}ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+ echo "$as_me:$LINENO: result: $AR" >&5
+echo "${ECHO_T}$AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+ ac_ct_AR=$AR
+ # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_AR+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_AR"; then
+ ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_AR="ar"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="false"
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+ echo "$as_me:$LINENO: result: $ac_ct_AR" >&5
+echo "${ECHO_T}$ac_ct_AR" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ AR=$ac_ct_AR
+else
+ AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$RANLIB"; then
+ ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+ echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+ ac_ct_RANLIB=$RANLIB
+ # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_RANLIB"; then
+ ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_RANLIB="ranlib"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB=":"
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+ echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ RANLIB=$ac_ct_RANLIB
+else
+ RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+if test -n "$ac_tool_prefix"; then
+ # 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 "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$STRIP"; then
+ ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+ echo "$as_me:$LINENO: result: $STRIP" >&5
+echo "${ECHO_T}$STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+ ac_ct_STRIP=$STRIP
+ # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo "$as_me:$LINENO: checking for $ac_word" >&5
+echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6
+if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -n "$ac_ct_STRIP"; then
+ ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_STRIP="strip"
+ echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+done
+
+ test -z "$ac_cv_prog_ac_ct_STRIP" && ac_cv_prog_ac_ct_STRIP=":"
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+ echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5
+echo "${ECHO_T}$ac_ct_STRIP" >&6
+else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+
+ STRIP=$ac_ct_STRIP
+else
+ STRIP="$ac_cv_prog_STRIP"
+fi
+
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+test -z "$AS" && AS=as
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+test -z "$LD" && LD=ld
+test -z "$LN_S" && LN_S="ln -s"
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+test -z "$NM" && NM=nm
+test -z "$SED" && SED=sed
+test -z "$OBJDUMP" && OBJDUMP=objdump
+test -z "$RANLIB" && RANLIB=:
+test -z "$STRIP" && STRIP=:
+test -z "$ac_objext" && ac_objext=o
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+ case $host_os in
+ openbsd*)
+ old_postinstall_cmds="\$RANLIB -t \$oldlib~$old_postinstall_cmds"
+ ;;
*)
- ac_save_MAGIC="$MAGIC"
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="/usr/bin:$PATH"
+ old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds"
+ ;;
+ esac
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+# 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 "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5
+echo $ECHO_N "checking for ${ac_tool_prefix}file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ ;;
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC="$ac_dir/${ac_tool_prefix}file"
+ 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="$lt_cv_path_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
+ $EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<EOF 1>&2
@@ -1799,48 +6271,48 @@ EOF
break
fi
done
- IFS="$ac_save_ifs"
- MAGIC="$ac_save_MAGIC"
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
-MAGIC="$lt_cv_path_MAGIC"
-if test -n "$MAGIC"; then
- echo "$ac_t""$MAGIC" 1>&6
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-if test -z "$lt_cv_path_MAGIC"; then
+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:1819: checking for file" >&5
-if eval "test \"`echo '$''{'lt_cv_path_MAGIC'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for file" >&5
+echo $ECHO_N "checking for file... $ECHO_C" >&6
+if test "${lt_cv_path_MAGIC_CMD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- case "$MAGIC" in
- /*)
- lt_cv_path_MAGIC="$MAGIC" # Let the user override the test with a path.
- ;;
- ?:/*)
- ac_cv_path_MAGIC="$MAGIC" # Let the user override the test with a dos path.
+ case $MAGIC_CMD in
+[\\/*] | ?:[\\/]*)
+ lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
;;
- *)
- ac_save_MAGIC="$MAGIC"
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="/usr/bin:$PATH"
+*)
+ lt_save_MAGIC_CMD="$MAGIC_CMD"
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
if test -f $ac_dir/file; then
- lt_cv_path_MAGIC="$ac_dir/file"
+ 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="$lt_cv_path_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
+ $EGREP "$file_magic_regex" > /dev/null; then
:
else
cat <<EOF 1>&2
@@ -1861,21 +6333,23 @@ EOF
break
fi
done
- IFS="$ac_save_ifs"
- MAGIC="$ac_save_MAGIC"
+ IFS="$lt_save_ifs"
+ MAGIC_CMD="$lt_save_MAGIC_CMD"
;;
esac
fi
-MAGIC="$lt_cv_path_MAGIC"
-if test -n "$MAGIC"; then
- echo "$ac_t""$MAGIC" 1>&6
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+ echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5
+echo "${ECHO_T}$MAGIC_CMD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
else
- MAGIC=:
+ MAGIC_CMD=:
fi
fi
@@ -1883,990 +6357,12622 @@ fi
;;
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:1890: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+enable_dlopen=no
+enable_win32_dll=yes
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+ enableval="$enable_libtool_lock"
+
+fi;
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+ withval="$with_pic"
+ pic_mode="$withval"
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ pic_mode=default
+fi;
+test -z "$pic_mode" && pic_mode=default
+
+# Use C for the default configuration in the libtool script
+tagname=
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}\n'
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+#
+# Check for any special shared library compilation flags.
+#
+lt_prog_cc_shlib=
+if test "$GCC" = no; then
+ case $host_os in
+ sco3.2v5*)
+ lt_prog_cc_shlib='-belf'
+ ;;
+ esac
+fi
+if test -n "$lt_prog_cc_shlib"; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&5
+echo "$as_me: WARNING: \`$CC' requires \`$lt_prog_cc_shlib' to build shared libraries" >&2;}
+ if echo "$old_CC $old_CFLAGS " | grep "[ ]$lt_prog_cc_shlib[ ]" >/dev/null; then :
+ else
+ { echo "$as_me:$LINENO: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&5
+echo "$as_me: WARNING: add \`$lt_prog_cc_shlib' to the CC or CFLAGS env variable and reconfigure" >&2;}
+ lt_cv_prog_cc_can_build_shared=no
+ fi
+fi
+
+
+#
+# Check to make sure the static flag actually works.
+#
+echo "$as_me:$LINENO: checking if $compiler static flag $lt_prog_compiler_static works" >&5
+echo $ECHO_N "checking if $compiler static flag $lt_prog_compiler_static works... $ECHO_C" >&6
+if test "${lt_prog_compiler_static_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
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="${ac_tool_prefix}ranlib"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ lt_prog_compiler_static_works=no
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS $lt_prog_compiler_static"
+ printf "$lt_simple_link_test_code" > conftest.$ac_ext
+ if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s conftest.err; then
+ # Append any errors to the config.log.
+ cat conftest.err 1>&5
+ else
+ lt_prog_compiler_static_works=yes
+ fi
+ fi
+ $rm conftest*
+ LDFLAGS="$save_LDFLAGS"
+
fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_static_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_static_works" >&6
+
+if test x"$lt_prog_compiler_static_works" = xyes; then
+ :
+else
+ lt_prog_compiler_static=
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+
+
+
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag=' -fno-builtin'
+
+ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6495: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:6499: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
+
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+ :
+fi
-if test -z "$ac_cv_prog_RANLIB"; then
-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:1922: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+fi
+
+lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_static='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ 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'.
+ lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static='-Bstatic'
+ else
+ lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc|ecc)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ ccc)
+ lt_prog_compiler_wl='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic='-Kpic'
+ lt_prog_compiler_static='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl='-Qoption ld '
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic='-Kconform_pic'
+ lt_prog_compiler_static='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic='-pic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$RANLIB"; then
- ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+ lt_prog_compiler_pic_works=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6727: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:6731: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works" >&6
+
+if test x"$lt_prog_compiler_pic_works" = xyes; then
+ case $lt_prog_compiler_pic in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+ esac
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=":"
+ lt_prog_compiler_pic=
+ lt_prog_compiler_can_build_shared=no
fi
+
fi
-RANLIB="$ac_cv_prog_RANLIB"
-if test -n "$RANLIB"; then
- echo "$ac_t""$RANLIB" 1>&6
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic=
+ ;;
+ *)
+ lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- echo "$ac_t""no" 1>&6
+ lt_cv_prog_compiler_c_o=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:6794: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:6798: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_prog_compiler_c_o=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag=
+ enable_shared_with_static_runtimes=no
+ archive_cmds=
+ archive_expsym_cmds=
+ old_archive_From_new_cmds=
+ old_archive_from_expsyms_cmds=
+ export_dynamic_flag_spec=
+ whole_archive_flag_spec=
+ thread_safe_flag_spec=
+ hardcode_libdir_flag_spec=
+ hardcode_libdir_flag_spec_ld=
+ hardcode_libdir_separator=
+ hardcode_direct=no
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=unsupported
+ link_all_deplibs=unknown
+ hardcode_automatic=no
+ module_cmds=
+ module_expsym_cmds=
+ always_export_symbols=no
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ 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.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ 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)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec='-L$libdir'
+ allow_undefined_flag=unsupported
+ always_export_symbols=no
+ enable_shared_with_static_runtimes=yes
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ 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'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ 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
+ ;;
+
+ sunos4*)
+ archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ 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
+ ;;
+ esac
+
+ if test "$ld_shlibs" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # 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 | grep '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
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ archive_cmds=''
+ hardcode_direct=yes
+ hardcode_libdir_separator=':'
+ link_all_deplibs=yes
+
+ if test "$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
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ 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
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
else
- RANLIB=":"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; 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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag=' ${wl}-bernotok'
+ 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=' '
+ archive_cmds_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
+ ;;
-# 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:1957: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ 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)'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ 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"`'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ archive_cmds_need_lc=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ 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'
+ else
+ 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'
+ fi
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ export_dynamic_flag_spec='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld='+b $libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=no
+ hardcode_shlibpath_var=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_direct=yes
+ export_dynamic_flag_spec='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ link_all_deplibs=yes
+ ;;
+
+ netbsd*)
+ 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
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ newsos6)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ hardcode_shlibpath_var=no
+ ;;
+
+ openbsd*)
+ hardcode_direct=yes
+ hardcode_shlibpath_var=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-R$libdir'
+ ;;
+ *)
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag=' -expect_unresolved \*'
+ archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$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}${output_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 ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec='-rpath $libdir'
+ fi
+ hardcode_libdir_separator=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag=' -z text'
+ if test "$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~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ 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'
+ fi
+ hardcode_libdir_flag_spec='-R$libdir'
+ hardcode_shlibpath_var=no
+ 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' ;;
+ esac
+ link_all_deplibs=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_direct=yes
+ hardcode_minus_L=yes
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds='$CC -r -o $output$reload_objs'
+ hardcode_direct=no
+ ;;
+ motorola)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ export_dynamic_flag_spec='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct=yes
+ hardcode_minus_L=no
+ hardcode_shlibpath_var=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | 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
+ ;;
+
+ sysv5*)
+ 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'
+ 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=
+ hardcode_shlibpath_var=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_shlibpath_var=no
+ ;;
+
+ *)
+ ld_shlibs=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs" >&5
+echo "${ECHO_T}$ld_shlibs" >&6
+test "$ld_shlibs" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag
+ allow_undefined_flag=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc=no
+ else
+ archive_cmds_need_lc=yes
+ fi
+ allow_undefined_flag=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5
+echo "${ECHO_T}$archive_cmds_need_lc" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" || \
+ test -n "$runpath_var " || \
+ test "X$hardcode_automatic"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, )" != no &&
+ test "$hardcode_minus_L" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action=immediate
+ fi
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action" >&5
+echo "${ECHO_T}$hardcode_action" >&6
+
+if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
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_STRIP="${ac_tool_prefix}strip"
- break
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
fi
- done
- IFS="$ac_save_ifs"
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
- echo "$ac_t""no" 1>&6
+
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
fi
+ ;;
-if test -z "$ac_cv_prog_STRIP"; then
-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:1989: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$STRIP"; then
- ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* 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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
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_STRIP="strip"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-STRIP="$ac_cv_prog_STRIP"
-if test -n "$STRIP"; then
- echo "$ac_t""$STRIP" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* 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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
else
- STRIP=":"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-# 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 "$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"
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-libtool_flags="$libtool_flags --enable-win32-dll"
-# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
-if test "${enable_libtool_lock+set}" = set; then
- enableval="$enable_libtool_lock"
- :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
-test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-# Check whether --with-pic or --without-pic was given.
-if test "${with_pic+set}" = set; then
- withval="$with_pic"
- pic_mode="$withval"
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- pic_mode=default
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 8806 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
fi
+rm -fr conftest*
-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 2056 "configure"' > conftest.$ac_ext
- if { (eval echo configure:2057: \"$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"
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 8904 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ 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
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# Report which librarie types wil actually be built
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+
+aix4*)
+ if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+ test "$enable_shared" = yes && enable_static=no
+ fi
+ ;;
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ archive_cmds_need_lc=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag='-undefined suppress'
;;
- *64-bit*)
- LD="${LD-ld} -64"
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag='-flat_namespace -undefined suppress'
;;
esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ fi
+ ;;
+esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
fi
- rm -rf conftest*
- ;;
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler \
+ CC \
+ LD \
+ lt_prog_compiler_wl \
+ lt_prog_compiler_pic \
+ lt_prog_compiler_static \
+ lt_prog_compiler_no_builtin_flag \
+ export_dynamic_flag_spec \
+ thread_safe_flag_spec \
+ whole_archive_flag_spec \
+ enable_shared_with_static_runtimes \
+ old_archive_cmds \
+ old_archive_from_new_cmds \
+ predep_objects \
+ postdep_objects \
+ predeps \
+ postdeps \
+ compiler_lib_search_path \
+ archive_cmds \
+ archive_expsym_cmds \
+ postinstall_cmds \
+ postuninstall_cmds \
+ old_archive_from_expsyms_cmds \
+ allow_undefined_flag \
+ no_undefined_flag \
+ export_symbols_cmds \
+ hardcode_libdir_flag_spec \
+ hardcode_libdir_flag_spec_ld \
+ hardcode_libdir_separator \
+ hardcode_automatic \
+ module_cmds \
+ module_expsym_cmds \
+ lt_cv_prog_compiler_c_o \
+ exclude_expsyms \
+ include_expsyms; do
+
+ case $var in
+ old_archive_cmds | \
+ old_archive_from_new_cmds | \
+ archive_cmds | \
+ archive_expsym_cmds | \
+ module_cmds | \
+ module_expsym_cmds | \
+ old_archive_from_expsyms_cmds | \
+ export_symbols_cmds | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
-*-*-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:2078: 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
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
- cat > conftest.$ac_ext <<EOF
-#line 2091 "configure"
-#include "confdefs.h"
+cfgfile="${ofile}T"
+ trap "$rm \"$cfgfile\"; exit 1" 1 2 15
+ $rm -f "$cfgfile"
+ { echo "$as_me:$LINENO: creating $ofile" >&5
+echo "$as_me: creating $ofile" >&6;}
+
+ cat <<__EOF__ >> "$cfgfile"
+#! $SHELL
+
+# `$echo "$cfgfile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP)
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+#
+# This file is part of GNU Libtool:
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="$SED -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
-int main() {
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
-; return 0; }
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# ### END LIBTOOL CONFIG
+
+__EOF__
+
+
+ case $host_os in
+ aix3*)
+ cat <<\EOF >> "$cfgfile"
+
+# AIX sometimes has problems with the GCC collect2 program. For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+ COLLECT_NAMES=
+ export COLLECT_NAMES
+fi
EOF
-if { (eval echo configure:2098: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- lt_cv_cc_needs_belf=yes
+ ;;
+ esac
+
+ # We use sed instead of cat because bash on DJGPP gets confused if
+ # if finds mixed CR/LF and LF-only lines. Since sed operates in
+ # text mode, it properly converts lines to CR/LF. This bash problem
+ # is reportedly fixed, but why not run on old versions too?
+ sed '$q' "$ltmain" >> "$cfgfile" || (rm -f "$cfgfile"; exit 1)
+
+ mv -f "$cfgfile" "$ofile" || \
+ (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+ chmod +x "$ofile"
+
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_cc_needs_belf=no
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
fi
-rm -f conftest*
- ac_ext=c
-# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+
+
+ac_ext=c
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_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
-fi
+CC="$lt_save_CC"
-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"
+
+# Check whether --with-tags or --without-tags was given.
+if test "${with_tags+set}" = set; then
+ withval="$with_tags"
+ tagnames="$withval"
+fi;
+
+if test -f "$ltmain" && test -n "$tagnames"; then
+ if test ! -f "${ofile}"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not exist" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not exist" >&2;}
fi
- ;;
-*-*-cygwin* | *-*-mingw*)
- # 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:2128: 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
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # 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"
- break
+ if test -z "$LTCC"; then
+ eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
+ if test -z "$LTCC"; then
+ { echo "$as_me:$LINENO: WARNING: output file \`$ofile' does not look like a libtool script" >&5
+echo "$as_me: WARNING: output file \`$ofile' does not look like a libtool script" >&2;}
+ else
+ { echo "$as_me:$LINENO: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&5
+echo "$as_me: WARNING: using \`LTCC=$LTCC', extracted from \`$ofile'" >&2;}
fi
- done
- IFS="$ac_save_ifs"
+ fi
+
+ # Extract list of available tagged configurations in $ofile.
+ # Note that this assumes the entire list is on one line.
+ available_tags=`grep "^available_tags=" "${ofile}" | $SED -e 's/available_tags=\(.*$\)/\1/' -e 's/\"//g'`
+
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for tagname in $tagnames; do
+ IFS="$lt_save_ifs"
+ # Check whether tagname contains only valid characters
+ case `$echo "X$tagname" | $Xsed -e 's:[-_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890,/]::g'` in
+ "") ;;
+ *) { { echo "$as_me:$LINENO: error: invalid tag name: $tagname" >&5
+echo "$as_me: error: invalid tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "${ofile}" > /dev/null
+ then
+ { { echo "$as_me:$LINENO: error: tag name \"$tagname\" already exists" >&5
+echo "$as_me: error: tag name \"$tagname\" already exists" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+
+ # Update the list of available tags.
+ if test -n "$tagname"; then
+ echo appending configuration tag \"$tagname\" to $ofile
+
+ case $tagname in
+ CXX)
+ if test -n "$CXX" && test "X$CXX" != "Xno"; then
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+
+
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_automatic_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+# Source file extension for C++ test sources.
+ac_ext=cc
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(int, char *) { return(0); }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_LD=$LD
+lt_save_GCC=$GCC
+GCC=$GXX
+lt_save_with_gnu_ld=$with_gnu_ld
+lt_save_path_LD=$lt_cv_path_LD
+if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+ lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+else
+ unset lt_cv_prog_gnu_ld
fi
+if test -n "${lt_cv_path_LDCXX+set}"; then
+ lt_cv_path_LD=$lt_cv_path_LDCXX
+else
+ unset lt_cv_path_LD
fi
-DLLTOOL="$ac_cv_prog_DLLTOOL"
-if test -n "$DLLTOOL"; then
- echo "$ac_t""$DLLTOOL" 1>&6
+test -z "${LDCXX+set}" || LD=$LDCXX
+CC=${CXX-"c++"}
+compiler=$CC
+compiler_CXX=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+# We don't want -fno-exception wen compiling C++ code, so set the
+# no_builtin_flag separately
+if test "$GXX" = yes; then
+ lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
else
- echo "$ac_t""no" 1>&6
+ lt_prog_compiler_no_builtin_flag_CXX=
fi
+if test "$GXX" = yes; then
+ # Set up default GNU C++ configuration
-if test -z "$ac_cv_prog_DLLTOOL"; 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
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2160: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_DLLTOOL'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 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"
+ test "$withval" = no || with_gnu_ld=yes
else
- if test -n "$DLLTOOL"; then
- ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+ with_gnu_ld=no
+fi;
+ac_prog=ld
+if test "$GCC" = yes; then
+ # Check if gcc -print-prog-name=ld gives a path.
+ echo "$as_me:$LINENO: checking for ld used by $CC" >&5
+echo $ECHO_N "checking for ld used by $CC... $ECHO_C" >&6
+ 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.
+ [\\/]* | ?:[\\/]*)
+ 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
+ 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
+ echo "$as_me:$LINENO: checking for GNU ld" >&5
+echo $ECHO_N "checking for GNU ld... $ECHO_C" >&6
else
- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
- ac_dummy="$PATH"
- for ac_dir in $ac_dummy; do
+ echo "$as_me:$LINENO: checking for non-GNU ld" >&5
+echo $ECHO_N "checking for non-GNU ld... $ECHO_C" >&6
+fi
+if test "${lt_cv_path_LD+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test -z "$LD"; then
+ lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ for ac_dir in $PATH; do
+ IFS="$lt_save_ifs"
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$ac_word; then
- ac_cv_prog_DLLTOOL="dlltool"
- break
+ 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.
+ case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+ *GNU* | *'with BFD'*)
+ test "$with_gnu_ld" != no && break
+ ;;
+ *)
+ test "$with_gnu_ld" != yes && break
+ ;;
+ esac
fi
done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_DLLTOOL" && ac_cv_prog_DLLTOOL="false"
+ IFS="$lt_save_ifs"
+else
+ lt_cv_path_LD="$LD" # Let the user override the test with a path.
fi
fi
-DLLTOOL="$ac_cv_prog_DLLTOOL"
-if test -n "$DLLTOOL"; then
- echo "$ac_t""$DLLTOOL" 1>&6
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+ echo "$as_me:$LINENO: result: $LD" >&5
+echo "${ECHO_T}$LD" >&6
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
fi
-
+test -z "$LD" && { { echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5
+echo "$as_me: error: no acceptable ld found in \$PATH" >&2;}
+ { (exit 1); exit 1; }; }
+echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5
+echo $ECHO_N "checking if the linker ($LD) is GNU ld... $ECHO_C" >&6
+if test "${lt_cv_prog_gnu_ld+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- DLLTOOL="false"
+ # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+case `"$LD" -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+ lt_cv_prog_gnu_ld=yes
+ ;;
+*)
+ lt_cv_prog_gnu_ld=no
+ ;;
+esac
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_gnu_ld" >&5
+echo "${ECHO_T}$lt_cv_prog_gnu_ld" >&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+ # Check if GNU C++ uses GNU ld as the underlying linker, since the
+ # archiving commands below assume that GNU ld is being used.
+ if test "$with_gnu_ld" = yes; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$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_CXX='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+ # investigate it a little bit more. (MM)
+ wlarc='${wl}'
+
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if eval "`$CC -print-prog-name=ld` --help 2>&1" | \
+ grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_CXX=
+ fi
+ else
+ with_gnu_ld=no
+ wlarc=
+
+ # A generic and very simple default shared library creation
+ # command for GNU C++ for the case where it uses the native
+ # linker, instead of GNU ld. If possible, this setting should
+ # overridden to take advantage of the native linker features on
+ # the platform it is being used on.
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+ fi
+
+ # 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 | grep "\-L"'
+
+else
+ GXX=no
+ with_gnu_ld=no
+ wlarc=
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:2195: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+# PORTME: fill in a description of your system's C++ link characteristics
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+ld_shlibs_CXX=yes
+case $host_os in
+ aix3*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ case $ld_flag in
+ *-brtl*)
+ aix_use_runtimelinking=yes
+ break
+ ;;
+ esac
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ archive_cmds_CXX=''
+ hardcode_direct_CXX=yes
+ hardcode_libdir_separator_CXX=':'
+ link_all_deplibs_CXX=yes
+
+ if test "$GXX" = 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_CXX=yes
+ else
+ # We have old collect2
+ hardcode_direct_CXX=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_CXX=yes
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ hardcode_libdir_separator_CXX=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ 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_CXX=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_CXX='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+ archive_expsym_cmds_CXX="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_CXX="-z nodefs"
+ archive_expsym_cmds_CXX="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
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"
- break
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_CXX=' ${wl}-bernotok'
+ allow_undefined_flag_CXX=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_CXX=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_CXX=' '
+ archive_cmds_need_lc_CXX=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_CXX="\$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
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ allow_undefined_flag_CXX=unsupported
+ always_export_symbols_CXX=no
+ enable_shared_with_static_runtimes_CXX=yes
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs_CXX=no
+ fi
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ archive_cmds_need_lc_CXX=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_CXX='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_CXX='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_CXX='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_CXX='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_CXX='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_CXX='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_CXX=no
+ hardcode_automatic_CXX=yes
+ hardcode_shlibpath_var_CXX=unsupported
+ whole_archive_flag_spec_CXX='-all_load $convenience'
+ link_all_deplibs_CXX=yes
+ fi
+ ;;
+
+ dgux*)
+ case $cc_basename in
+ ec++)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ freebsd12*)
+ # C++ shared libraries reported to be fairly broken before switch to ELF
+ ld_shlibs_CXX=no
+ ;;
+ freebsd-elf*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ freebsd*)
+ # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+ # conventions
+ ld_shlibs_CXX=yes
+ ;;
+ gnu*)
+ ;;
+ hpux9*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=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_CXX=no
+ ;;
+ aCC)
+ archive_cmds_CXX='$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'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ archive_cmds_CXX='$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'
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ hpux10*|hpux11*)
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_CXX='+b $libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_CXX='-L$libdir'
+ ;;
+ *)
+ hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ export_dynamic_flag_spec_CXX='${wl}-E'
+ ;;
+ esac
+ fi
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ ;;
+ ia64*)
+ hardcode_direct_CXX=no
+ hardcode_shlibpath_var_CXX=no
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ *)
+ hardcode_direct_CXX=yes
+ hardcode_minus_L_CXX=yes # Not in the search PATH,
+ # but as the default
+ # location of the library.
+ ;;
+ esac
+
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ aCC)
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ ;;
+ esac
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | grep "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; echo $list'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test $with_gnu_ld = no; then
+ case "$host_cpu" in
+ ia64*|hppa*64*)
+ archive_cmds_CXX='$LD -b +h $soname -o $lib $linker_flags $libobjs $deplibs'
+ ;;
+ *)
+ archive_cmds_CXX='$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_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ irix5* | irix6*)
+ case $cc_basename in
+ CC)
+ # SGI C++
+ archive_cmds_CXX='$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'
+
+ # Archives containing C++ object files must be created using
+ # "CC -ar", where "CC" is the IRIX C++ compiler. This is
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+ ;;
+ *)
+ if test "$GXX" = yes; then
+ if test "$with_gnu_ld" = no; then
+ archive_cmds_CXX='$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_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` -o $lib'
+ fi
+ fi
+ link_all_deplibs_CXX=yes
+ ;;
+ esac
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | grep "ld"`; rm -f libconftest$shared_ext; 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_CXX='${wl}--rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+ ;;
+ icpc)
+ # Intel C++
+ with_gnu_ld=yes
+ archive_cmds_need_lc_CXX=no
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $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_CXX='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+ whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ ;;
+ cxx)
+ # Compaq C++
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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
+ ;;
+ lynxos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ m88k*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+ wlarc=
+ hardcode_libdir_flag_spec_CXX='-R$libdir'
+ hardcode_direct_CXX=yes
+ hardcode_shlibpath_var_CXX=no
fi
+ # Workaround some broken pre-1.5 toolchains
+ output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+ ;;
+ osf3*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx)
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && echo ${wl}-set_version $verstring` -update_registry ${objdir}/so_locations -o $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$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_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+ # KCC will only create a shared library if the output file
+ # ends with ".so" (or ".sl" for HP-UX), so rename the library
+ # to its proper name (with version) after linking.
+ archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+ hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Archives containing C++ object files must be created using
+ # the KAI C++ compiler.
+ old_archive_cmds_CXX='$CC -o $oldlib $oldobjs'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ cxx)
+ allow_undefined_flag_CXX=' -expect_unresolved \*'
+ archive_cmds_CXX='$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_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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_CXX='-rpath $libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_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'
+ ;;
+ *)
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_CXX='$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_CXX='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_CXX=:
+
+ # 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 | grep "\-L"'
+
+ else
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ fi
+ ;;
+ esac
+ ;;
+ psos*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ sco*)
+ archive_cmds_need_lc_CXX=no
+ case $cc_basename in
+ CC)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ lcc)
+ # Lucid
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ no_undefined_flag_CXX=' -zdefs'
+ archive_cmds_CXX='$CC -G${allow_undefined_flag} -nolib -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ archive_expsym_cmds_CXX='$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_CXX='-R$libdir'
+ hardcode_shlibpath_var_CXX=no
+ case $host_os in
+ solaris2.0-5 | solaris2.0-5.*) ;;
+ *)
+ # The C++ compiler is used as linker so we must use $wl
+ # flag to pass the commands to the underlying system
+ # linker.
+ # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ ;;
+ esac
+ link_all_deplibs_CXX=yes
+
+ # Commands to make compiler produce verbose output that lists
+ # what "hidden" libraries, object files and flags are used when
+ # linking a shared library.
+ #
+ # There doesn't appear to be a way to prevent this compiler from
+ # 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_cmd='templist=`$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep "\-[LR]"`; 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
+ # necessary to make sure instantiated templates are included
+ # in the archive.
+ old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+ # The C++ compiler must be used to create the archive.
+ old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+ ;;
+ *)
+ # GNU C++ compiler with Solaris linker
+ if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+ no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+ if $CC --version | grep -v '^2\.7' > /dev/null; then
+ archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -shared $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ else
+ # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # platform.
+ archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ archive_expsym_cmds_CXX='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_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_cmd="$CC -G $CFLAGS -v conftest.$objext 2>&1 | grep \"\-L\""
+ fi
+
+ hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+ fi
+ ;;
+ esac
+ ;;
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ archive_cmds_need_lc_CXX=no
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ esac
+ ;;
+ vxworks*)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+ *)
+ # FIXME: insert proper C++ library support
+ ld_shlibs_CXX=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+GCC_CXX="$GXX"
+LD_CXX="$LD"
+
+
+cat > conftest.$ac_ext <<EOF
+class Foo
+{
+public:
+ Foo (void) { a = 0; }
+private:
+ int a;
+};
+EOF
+
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Parse the compiler output and extract the necessary
+ # objects, libraries and library flags.
+
+ # Sentinel used to keep track of whether or not we are before
+ # the conftest object file.
+ pre_test_object_deps_done=no
+
+ # The `*' in the case matches for architectures that use `case' in
+ # $output_verbose_cmd can trigger glob expansion during the loop
+ # eval without this substitution.
+ output_verbose_link_cmd="`$echo \"X$output_verbose_link_cmd\" | $Xsed -e \"$no_glob_subst\"`"
+
+ for p in `eval $output_verbose_link_cmd`; do
+ case $p in
+
+ -L* | -R* | -l*)
+ # Some compilers place space between "-{L,R}" and the path.
+ # Remove the space.
+ if test $p = "-L" \
+ || test $p = "-R"; then
+ prev=$p
+ continue
+ else
+ prev=
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ case $p in
+ -L* | -R*)
+ # Internal compiler library paths should come after those
+ # provided the user. The postdeps already come after the
+ # user supplied libs so there is no need to process them.
+ if test -z "$compiler_lib_search_path_CXX"; then
+ compiler_lib_search_path_CXX="${prev}${p}"
+ else
+ compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+ fi
+ ;;
+ # The "-l" case would never come before the object being
+ # linked, so don't bother handling this case.
+ esac
+ else
+ if test -z "$postdeps_CXX"; then
+ postdeps_CXX="${prev}${p}"
+ else
+ postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+ fi
+ fi
+ ;;
+
+ *.$objext)
+ # This assumes that the test object file only shows up
+ # once in the compiler output.
+ if test "$p" = "conftest.$objext"; then
+ pre_test_object_deps_done=yes
+ continue
+ fi
+
+ if test "$pre_test_object_deps_done" = no; then
+ if test -z "$predep_objects_CXX"; then
+ predep_objects_CXX="$p"
+ else
+ predep_objects_CXX="$predep_objects_CXX $p"
+ fi
+ else
+ if test -z "$postdep_objects_CXX"; then
+ postdep_objects_CXX="$p"
+ else
+ postdep_objects_CXX="$postdep_objects_CXX $p"
+ fi
+ fi
+ ;;
+
+ *) ;; # Ignore the rest.
+
+ esac
done
- IFS="$ac_save_ifs"
+
+ # Clean up.
+ rm -f a.out a.exe
+else
+ echo "libtool.m4: error: problem compiling CXX test program"
fi
+
+$rm -f confest.$objext
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+
+lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ # C++ specific cases for pic, static, wl, etc.
+ if test "$GXX" = yes; then
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ fi
+ ;;
+ 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'.
+ lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+ ;;
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+ mingw* | os2* | pw32*)
+ # 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).
+ lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+ ;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_CXX='-fno-common'
+ ;;
+ *djgpp*)
+ # DJGPP does not support shared libraries at all
+ lt_prog_compiler_pic_CXX=
+ ;;
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_CXX=-Kconform_pic
+ fi
+ ;;
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ esac
+ else
+ case $host_os in
+ aix4* | aix5*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_CXX='-Bstatic'
+ else
+ lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+ chorus*)
+ case $cc_basename in
+ cxch68)
+ # Green Hills C++ Compiler
+ # _LT_AC_TAGVAR(lt_prog_compiler_static, CXX)="--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
+ ;;
+ dgux*)
+ case $cc_basename in
+ ec++)
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ ghcx)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ freebsd*)
+ # FreeBSD uses GNU C++
+ ;;
+ hpux9* | hpux10* | hpux11*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ if test "$host_cpu" != ia64; then
+ lt_prog_compiler_pic_CXX='+Z'
+ fi
+ ;;
+ aCC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX="${ac_cv_prog_cc_wl}-a ${ac_cv_prog_cc_wl}archive"
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX='+Z'
+ ;;
+ esac
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ irix5* | irix6* | nonstopux*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_static_CXX='-non_shared'
+ # CC pic flag -KPIC is the default.
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ linux*)
+ case $cc_basename in
+ KCC)
+ # KAI C++ Compiler
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ icpc)
+ # Intel C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-static'
+ ;;
+ cxx)
+ # Compaq C++
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ lynxos*)
+ ;;
+ m88k*)
+ ;;
+ mvs*)
+ case $cc_basename in
+ cxx)
+ lt_prog_compiler_pic_CXX='-W c,exportall'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ netbsd*)
+ ;;
+ osf3* | osf4* | osf5*)
+ case $cc_basename in
+ KCC)
+ lt_prog_compiler_wl_CXX='--backend -Wl,'
+ ;;
+ RCC)
+ # Rational C++ 2.4.1
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ cxx)
+ # Digital/Compaq C++
+ lt_prog_compiler_wl_CXX='-Wl,'
+ # Make sure the PIC flag is empty. It appears that all Alpha
+ # Linux and Compaq Tru64 Unix objects are PIC.
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_static_CXX='-non_shared'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ psos*)
+ ;;
+ sco*)
+ case $cc_basename in
+ CC)
+ lt_prog_compiler_pic_CXX='-fPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ solaris*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.2, 5.x and Centerline C++
+ lt_prog_compiler_pic_CXX='-KPIC'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ lt_prog_compiler_wl_CXX='-Qoption ld '
+ ;;
+ gcx)
+ # Green Hills C++ Compiler
+ lt_prog_compiler_pic_CXX='-PIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ sunos4*)
+ case $cc_basename in
+ CC)
+ # Sun C++ 4.x
+ lt_prog_compiler_pic_CXX='-pic'
+ lt_prog_compiler_static_CXX='-Bstatic'
+ ;;
+ lcc)
+ # Lucid
+ lt_prog_compiler_pic_CXX='-pic'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ tandem*)
+ case $cc_basename in
+ NCC)
+ # NonStop-UX NCC 3.20
+ lt_prog_compiler_pic_CXX='-KPIC'
+ ;;
+ *)
+ ;;
+ esac
+ ;;
+ unixware*)
+ ;;
+ vxworks*)
+ ;;
+ *)
+ lt_prog_compiler_can_build_shared_CXX=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_CXX" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_CXX=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:11036: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:11040: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_CXX=yes
+ fi
+ fi
+ $rm conftest*
+
fi
-AS="$ac_cv_prog_AS"
-if test -n "$AS"; then
- echo "$ac_t""$AS" 1>&6
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_CXX" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_CXX" >&6
+
+if test x"$lt_prog_compiler_pic_works_CXX" = xyes; then
+ case $lt_prog_compiler_pic_CXX in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+ esac
else
- echo "$ac_t""no" 1>&6
+ lt_prog_compiler_pic_CXX=
+ lt_prog_compiler_can_build_shared_CXX=no
fi
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_CXX=
+ ;;
+ *)
+ lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+ ;;
+esac
-if test -z "$ac_cv_prog_AS"; 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
-echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:2227: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_AS'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$AS"; then
- ac_cv_prog_AS="$AS" # Let the user override the test.
+ lt_cv_prog_compiler_c_o_CXX=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:11103: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:11107: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_prog_compiler_c_o_CXX=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_CXX" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
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"
- break
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ case $host_os in
+ aix4* | aix5*)
+ # 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 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_CXX='$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_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_AS" && ac_cv_prog_AS="false"
+ ;;
+ pw32*)
+ export_symbols_cmds_CXX="$ltdll_cmds"
+ ;;
+ cygwin* | mingw*)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ *)
+ export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ ;;
+ esac
+
+echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5
+echo "${ECHO_T}$ld_shlibs_CXX" >&6
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_CXX=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_CXX in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_CXX
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+ allow_undefined_flag_CXX=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_CXX 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_CXX=no
+ else
+ archive_cmds_need_lc_CXX=yes
+ fi
+ allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_CXX" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" || \
+ test -n "$runpath_var CXX" || \
+ test "X$hardcode_automatic_CXX"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_CXX" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+ test "$hardcode_minus_L_CXX" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_CXX=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_CXX=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_CXX=unsupported
fi
-AS="$ac_cv_prog_AS"
-if test -n "$AS"; then
- echo "$ac_t""$AS" 1>&6
+echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5
+echo "${ECHO_T}$hardcode_action_CXX" >&6
+
+if test "$hardcode_action_CXX" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
+
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
else
- echo "$ac_t""no" 1>&6
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- AS="false"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
- # 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:2262: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
+
+ ;;
+
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* 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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
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_OBJDUMP="${ac_tool_prefix}objdump"
- break
- fi
- done
- IFS="$ac_save_ifs"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func_shl_load=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-OBJDUMP="$ac_cv_prog_OBJDUMP"
-if test -n "$OBJDUMP"; then
- echo "$ac_t""$OBJDUMP" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* 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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
+#endif
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-if test -z "$ac_cv_prog_OBJDUMP"; then
-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:2294: checking for $ac_word" >&5
-if eval "test \"`echo '$''{'ac_cv_prog_OBJDUMP'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
else
- if test -n "$OBJDUMP"; then
- ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
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_OBJDUMP="objdump"
- break
- fi
- done
- IFS="$ac_save_ifs"
- test -z "$ac_cv_prog_OBJDUMP" && ac_cv_prog_OBJDUMP="false"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-OBJDUMP="$ac_cv_prog_OBJDUMP"
-if test -n "$OBJDUMP"; then
- echo "$ac_t""$OBJDUMP" 1>&6
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
else
- OBJDUMP="false"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
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:2330: 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
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 2335 "configure"
+#line 12346 "configure"
#include "confdefs.h"
-int main() {
-extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
- DllMain (0, 0, 0);
-; return 0; }
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
EOF
-if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- lt_cv_need_dllmain=no
-else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_need_dllmain=yes
-fi
-rm -f conftest*
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
fi
+rm -fr conftest*
-echo "$ac_t""$lt_cv_need_dllmain" 1>&6
- 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:2364: 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
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 2369 "configure"
+#line 12444 "configure"
#include "confdefs.h"
-int main() {
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
-; return 0; }
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
EOF
-if { (eval echo configure:2376: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- lt_cv_cc_dll_switch=-dll
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
fi
-rm -f conftest*
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ 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
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
fi
-echo "$ac_t""$lt_cv_cc_dll_switch" 1>&6
- CFLAGS="$SAVE_CFLAGS" ;;
- *-*-cygwin*)
- # cygwin systems need to pass --dll to the linker, and not link
- # crt.o which will require a WinMain@16 definition.
- lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_CXX \
+ CC_CXX \
+ LD_CXX \
+ lt_prog_compiler_wl_CXX \
+ lt_prog_compiler_pic_CXX \
+ lt_prog_compiler_static_CXX \
+ lt_prog_compiler_no_builtin_flag_CXX \
+ export_dynamic_flag_spec_CXX \
+ thread_safe_flag_spec_CXX \
+ whole_archive_flag_spec_CXX \
+ enable_shared_with_static_runtimes_CXX \
+ old_archive_cmds_CXX \
+ old_archive_from_new_cmds_CXX \
+ predep_objects_CXX \
+ postdep_objects_CXX \
+ predeps_CXX \
+ postdeps_CXX \
+ compiler_lib_search_path_CXX \
+ archive_cmds_CXX \
+ archive_expsym_cmds_CXX \
+ postinstall_cmds_CXX \
+ postuninstall_cmds_CXX \
+ old_archive_from_expsyms_cmds_CXX \
+ allow_undefined_flag_CXX \
+ no_undefined_flag_CXX \
+ export_symbols_cmds_CXX \
+ hardcode_libdir_flag_spec_CXX \
+ hardcode_libdir_flag_spec_ld_CXX \
+ hardcode_libdir_separator_CXX \
+ hardcode_automatic_CXX \
+ module_cmds_CXX \
+ module_expsym_cmds_CXX \
+ lt_cv_prog_compiler_c_o_CXX \
+ exclude_expsyms_CXX \
+ include_expsyms_CXX; do
+
+ case $var in
+ old_archive_cmds_CXX | \
+ old_archive_from_new_cmds_CXX | \
+ archive_cmds_CXX | \
+ archive_expsym_cmds_CXX | \
+ module_cmds_CXX | \
+ module_expsym_cmds_CXX | \
+ old_archive_from_expsyms_cmds_CXX | \
+ export_symbols_cmds_CXX | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_CXX
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_CXX
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_CXX
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_CXX
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_CXX
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_CXX"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC=$lt_save_CC
+LDCXX=$LD
+LD=$lt_save_LD
+GCC=$lt_save_GCC
+with_gnu_ldcxx=$with_gnu_ld
+with_gnu_ld=$lt_save_with_gnu_ld
+lt_cv_path_LDCXX=$lt_cv_path_LD
+lt_cv_path_LD=$lt_save_path_LD
+lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ F77)
+ if test -n "$F77" && test "X$F77" != "Xno"; then
+
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code=" subroutine t\n return\n end\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code=" program t\n end\n"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${F77-"f77"}
+compiler=$CC
+compiler_F77=$CC
+cc_basename=`$echo X"$compiler" | $Xsed -e 's%^.*/%%'`
+
+echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5
+echo $ECHO_N "checking if libtool supports shared libraries... $ECHO_C" >&6
+echo "$as_me:$LINENO: result: $can_build_shared" >&5
+echo "${ECHO_T}$can_build_shared" >&6
+
+echo "$as_me:$LINENO: checking whether to build shared libraries" >&5
+echo $ECHO_N "checking whether to build shared libraries... $ECHO_C" >&6
+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
+aix3*)
+ test "$enable_shared" = yes && enable_static=no
+ if test -n "$RANLIB"; then
+ archive_cmds="$archive_cmds~\$RANLIB \$lib"
+ postinstall_cmds='$RANLIB $lib'
+ fi
+ ;;
+aix4*)
+ test "$enable_shared" = yes && enable_static=no
;;
-
esac
+echo "$as_me:$LINENO: result: $enable_shared" >&5
+echo "${ECHO_T}$enable_shared" >&6
+echo "$as_me:$LINENO: checking whether to build static libraries" >&5
+echo $ECHO_N "checking whether to build static libraries... $ECHO_C" >&6
+# Make sure either enable_shared or enable_static is yes.
+test "$enable_shared" = yes || enable_static=yes
+echo "$as_me:$LINENO: result: $enable_static" >&5
+echo "${ECHO_T}$enable_static" >&6
+
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+GCC_F77="$G77"
+LD_F77="$LD"
+
+lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_static_F77='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ 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'.
+ lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_F77='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_F77=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_F77=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_F77='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_F77='-Bstatic'
+ else
+ lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_F77='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc|ecc)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-static'
+ ;;
+ ccc)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_F77='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic_F77='-Kpic'
+ lt_prog_compiler_static_F77='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_F77='-Qoption ld '
+ lt_prog_compiler_pic_F77='-PIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_F77='-Wl,'
+ lt_prog_compiler_pic_F77='-KPIC'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_F77='-Kconform_pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_F77='-pic'
+ lt_prog_compiler_static_F77='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_F77=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_F77" >&6
-# Save cache, so that ltconfig can load it
-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.
+# Check to make sure the PIC flag actually works.
#
-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"
+if test -n "$lt_prog_compiler_pic_F77"; then
+ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_prog_compiler_pic_works_F77=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_F77"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13266: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:13270: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_F77=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_F77" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_F77" >&6
+
+if test x"$lt_prog_compiler_pic_works_F77" = xyes; then
+ case $lt_prog_compiler_pic_F77 in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+ esac
+else
+ lt_prog_compiler_pic_F77=
+ lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_F77=
;;
*)
- # `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'
+ lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
;;
- esac >> confcache
-if cmp -s $cache_file confcache; then
- :
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_F77+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ lt_cv_prog_compiler_c_o_F77=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:13333: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:13337: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_prog_compiler_c_o_F77=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_F77" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_F77" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
+else
+ need_locks=no
+fi
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_F77=
+ enable_shared_with_static_runtimes_F77=no
+ archive_cmds_F77=
+ archive_expsym_cmds_F77=
+ old_archive_From_new_cmds_F77=
+ old_archive_from_expsyms_cmds_F77=
+ export_dynamic_flag_spec_F77=
+ whole_archive_flag_spec_F77=
+ thread_safe_flag_spec_F77=
+ hardcode_libdir_flag_spec_F77=
+ hardcode_libdir_flag_spec_ld_F77=
+ hardcode_libdir_separator_F77=
+ hardcode_direct_F77=no
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=unsupported
+ link_all_deplibs_F77=unknown
+ hardcode_automatic_F77=no
+ module_cmds_F77=
+ module_expsym_cmds_F77=
+ always_export_symbols_F77=no
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_F77=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_F77="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_F77=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_F77=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.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_F77='$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)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_F77=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_F77=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=no
+ enable_shared_with_static_runtimes_F77=yes
+ export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_F77=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_F77=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_F77" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_F77='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_F77=
+ fi
+ fi
else
- echo "not updating unwritable cache $cache_file"
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_F77=unsupported
+ always_export_symbols_F77=yes
+ archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_F77=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_F77=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # 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 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_F77='$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_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ archive_cmds_F77=''
+ hardcode_direct_F77=yes
+ hardcode_libdir_separator_F77=':'
+ link_all_deplibs_F77=yes
+
+ if test "$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_F77=yes
+ else
+ # We have old collect2
+ hardcode_direct_F77=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_F77=yes
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_libdir_separator_F77=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ 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_F77=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_F77='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_F77="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_F77="-z nodefs"
+ archive_expsym_cmds_F77="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+ program main
+
+ end
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_F77=' ${wl}-bernotok'
+ allow_undefined_flag_F77=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_F77=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_F77=' '
+ archive_cmds_need_lc_F77=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_F77="\$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_F77='$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)'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_F77=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec_F77=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_F77=' '
+ allow_undefined_flag_F77=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_F77='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_F77='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_F77=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ archive_cmds_need_lc_F77=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_F77='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_F77='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_F77='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_F77='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_F77='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_F77='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_F77=no
+ hardcode_automatic_F77=yes
+ hardcode_shlibpath_var_F77=unsupported
+ whole_archive_flag_spec_F77='-all_load $convenience'
+ link_all_deplibs_F77=yes
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_F77=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ archive_cmds_F77='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$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'
+ else
+ archive_cmds_F77='$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'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_F77='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=no
+ hardcode_shlibpath_var_F77=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_direct_F77=yes
+ export_dynamic_flag_spec_F77='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_F77=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ link_all_deplibs_F77=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ newsos6)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_F77=yes
+ hardcode_shlibpath_var_F77=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_F77='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ ;;
+ *)
+ archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_minus_L_F77=yes
+ allow_undefined_flag_F77=unsupported
+ archive_cmds_F77='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_F77='$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}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_F77=' -expect_unresolved \*'
+ archive_cmds_F77='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_F77='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_F77=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_F77=' -z text'
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_F77='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$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'
+ fi
+ hardcode_libdir_flag_spec_F77='-R$libdir'
+ hardcode_shlibpath_var_F77=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs_F77=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=yes
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_F77='$CC -r -o $output$reload_objs'
+ hardcode_direct_F77=no
+ ;;
+ motorola)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ export_dynamic_flag_spec_F77='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_F77=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_F77=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_F77=yes
+ hardcode_minus_L_F77=no
+ hardcode_shlibpath_var_F77=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_F77='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_F77='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_F77='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_F77=' -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_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_F77='$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_F77=
+ hardcode_shlibpath_var_F77=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_F77='-L$libdir'
+ hardcode_shlibpath_var_F77=no
+ ;;
+
+ *)
+ ld_shlibs_F77=no
+ ;;
+ esac
fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_F77" >&5
+echo "${ECHO_T}$ld_shlibs_F77" >&6
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-rm -f confcache
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_F77=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_F77 in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_F77
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+ allow_undefined_flag_F77=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_F77 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_F77=no
+ else
+ archive_cmds_need_lc_F77=yes
+ fi
+ allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_F77" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_F77" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
-# Actually configure libtool. ac_aux_dir is where install-sh is found.
-AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
-MAGIC="$MAGIC" 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 --build="$build" $ac_aux_dir/ltmain.sh $host \
-|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" || \
+ test -n "$runpath_var F77" || \
+ test "X$hardcode_automatic_F77"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_F77" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+ test "$hardcode_minus_L_F77" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_F77=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_F77=immediate
+ fi
+else
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_F77=unsupported
+fi
+echo "$as_me:$LINENO: result: $hardcode_action_F77" >&5
+echo "${ECHO_T}$hardcode_action_F77" >&6
-# Reload cache, that may have been modified by ltconfig
-if test -r "$cache_file"; then
- echo "loading cache $cache_file"
- . $cache_file
+if test "$hardcode_action_F77" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
+
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
else
- echo "creating cache $cache_file"
- > $cache_file
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
fi
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
-# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
-# Always use our own libtool.
-LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
+
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
+ ;;
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
+ ;;
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
+ ;;
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
+ ;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+solaris*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
+ ;;
+esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_F77 \
+ CC_F77 \
+ LD_F77 \
+ lt_prog_compiler_wl_F77 \
+ lt_prog_compiler_pic_F77 \
+ lt_prog_compiler_static_F77 \
+ lt_prog_compiler_no_builtin_flag_F77 \
+ export_dynamic_flag_spec_F77 \
+ thread_safe_flag_spec_F77 \
+ whole_archive_flag_spec_F77 \
+ enable_shared_with_static_runtimes_F77 \
+ old_archive_cmds_F77 \
+ old_archive_from_new_cmds_F77 \
+ predep_objects_F77 \
+ postdep_objects_F77 \
+ predeps_F77 \
+ postdeps_F77 \
+ compiler_lib_search_path_F77 \
+ archive_cmds_F77 \
+ archive_expsym_cmds_F77 \
+ postinstall_cmds_F77 \
+ postuninstall_cmds_F77 \
+ old_archive_from_expsyms_cmds_F77 \
+ allow_undefined_flag_F77 \
+ no_undefined_flag_F77 \
+ export_symbols_cmds_F77 \
+ hardcode_libdir_flag_spec_F77 \
+ hardcode_libdir_flag_spec_ld_F77 \
+ hardcode_libdir_separator_F77 \
+ hardcode_automatic_F77 \
+ module_cmds_F77 \
+ module_expsym_cmds_F77 \
+ lt_cv_prog_compiler_c_o_F77 \
+ exclude_expsyms_F77 \
+ include_expsyms_F77; do
+
+ case $var in
+ old_archive_cmds_F77 | \
+ old_archive_from_new_cmds_F77 | \
+ archive_cmds_F77 | \
+ archive_expsym_cmds_F77 | \
+ module_cmds_F77 | \
+ module_expsym_cmds_F77 | \
+ old_archive_from_expsyms_cmds_F77 | \
+ export_symbols_cmds_F77 | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_F77
+
+# An ERE matcher.
+EGREP=$lt_EGREP
-# Redirect the config.log output again, so that the ltconfig log is not
-# clobbered by the next message.
-exec 5>>./config.log
+# The linker used to build libraries.
+LD=$lt_LD_F77
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
-
+# A BSD-compatible nm program.
+NM=$lt_NM
-
-
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_F77
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_F77
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_F77
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_F77
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_F77"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
-echo $ac_n "checking for garbage collector to use""... $ac_c" 1>&6
-echo "configure:2488: 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"
-
- GC=$enableval
else
- GC=boehm
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
fi
-GCINCS=
-if test "$GC" = "boehm"; then
- GCINCS="`cat ../../boehm-gc/boehm-cflags`"
- cat >> confdefs.h <<\EOF
-#define HAVE_BOEHM_GC 1
-EOF
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ else
+ tagname=""
+ fi
+ ;;
+
+ GCJ)
+ if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
+
+
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+objext_GCJ=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}\n"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String argv) {}; }\n'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${GCJ-"gcj"}
+compiler=$CC
+compiler_GCJ=$CC
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+archive_cmds_need_lc_GCJ=no
+
+
+lt_prog_compiler_no_builtin_flag_GCJ=
+
+if test "$GCC" = yes; then
+ lt_prog_compiler_no_builtin_flag_GCJ=' -fno-builtin'
+
+ echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+echo $ECHO_N "checking if $compiler supports -fno-rtti -fno-exceptions... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ lt_cv_prog_compiler_rtti_exceptions=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="-fno-rtti -fno-exceptions"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15273: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:15277: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_cv_prog_compiler_rtti_exceptions=yes
+ fi
+ fi
+ $rm conftest*
fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_rtti_exceptions" >&6
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+ lt_prog_compiler_no_builtin_flag_GCJ="$lt_prog_compiler_no_builtin_flag_GCJ -fno-rtti -fno-exceptions"
+else
+ :
+fi
-echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
-echo "configure:2510: 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
+
+lt_prog_compiler_wl_GCJ=
+lt_prog_compiler_pic_GCJ=
+lt_prog_compiler_static_GCJ=
+
+echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5
+echo $ECHO_N "checking for $compiler option to produce PIC... $ECHO_C" >&6
+
+ if test "$GCC" = yes; then
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_static_GCJ='-static'
+
+ case $host_os in
+ aix*)
+ # All AIX code is PIC.
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ 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'.
+ lt_prog_compiler_pic_GCJ='-m68020 -resident32 -malways-restore-a4'
+ ;;
+
+ beos* | cygwin* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+ # PIC is the default for these OSes.
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic_GCJ='-fno-common'
+ ;;
+
+ msdosdjgpp*)
+ # Just because we use GCC doesn't mean we suddenly get shared libraries
+ # on systems that don't support them.
+ lt_prog_compiler_can_build_shared_GCJ=no
+ enable_shared=no
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ lt_prog_compiler_pic_GCJ=-Kconform_pic
+ fi
+ ;;
+
+ hpux*)
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ ;;
+
+ *)
+ lt_prog_compiler_pic_GCJ='-fPIC'
+ ;;
+ esac
+ else
+ # PORTME Check for flag to pass linker flags through the system compiler.
+ case $host_os in
+ aix*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ if test "$host_cpu" = ia64; then
+ # AIX 5 now supports IA64 processor
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ else
+ lt_prog_compiler_static_GCJ='-bnso -bI:/lib/syscalls.exp'
+ fi
+ ;;
+
+ mingw* | pw32* | 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).
+ lt_prog_compiler_pic_GCJ='-DDLL_EXPORT'
+ ;;
+
+ hpux9* | hpux10* | hpux11*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+ # not for PA HP-UX.
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ # +Z the default
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ='+Z'
+ ;;
+ esac
+ # Is there a better lt_prog_compiler_static that works with the bundled CC?
+ lt_prog_compiler_static_GCJ='${wl}-a ${wl}archive'
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # PIC (with -KPIC) is the default.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ newsos6)
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ linux*)
+ case $CC in
+ icc|ecc)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-static'
+ ;;
+ ccc)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All Alpha code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+ esac
+ ;;
+
+ osf3* | osf4* | osf5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ # All OSF/1 code is PIC.
+ lt_prog_compiler_static_GCJ='-non_shared'
+ ;;
+
+ sco3.2v5*)
+ lt_prog_compiler_pic_GCJ='-Kpic'
+ lt_prog_compiler_static_GCJ='-dn'
+ ;;
+
+ solaris*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sunos4*)
+ lt_prog_compiler_wl_GCJ='-Qoption ld '
+ lt_prog_compiler_pic_GCJ='-PIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ lt_prog_compiler_wl_GCJ='-Wl,'
+ lt_prog_compiler_pic_GCJ='-KPIC'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec ;then
+ lt_prog_compiler_pic_GCJ='-Kconform_pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ fi
+ ;;
+
+ uts4*)
+ lt_prog_compiler_pic_GCJ='-pic'
+ lt_prog_compiler_static_GCJ='-Bstatic'
+ ;;
+
+ *)
+ lt_prog_compiler_can_build_shared_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_GCJ" >&6
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_GCJ"; then
+ echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works" >&5
+echo $ECHO_N "checking if $compiler PIC flag $lt_prog_compiler_pic_GCJ works... $ECHO_C" >&6
+if test "${lt_prog_compiler_pic_works_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&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 2525 "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:2531: \"$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
- :
+ lt_prog_compiler_pic_works_GCJ=no
+ ac_outfile=conftest.$ac_objext
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+ lt_compiler_flag="$lt_prog_compiler_pic_GCJ"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ # The option is referenced via a variable to avoid confusing sed.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15505: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>conftest.err)
+ ac_status=$?
+ cat conftest.err >&5
+ echo "$as_me:15509: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s "$ac_outfile"; then
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test ! -s conftest.err; then
+ lt_prog_compiler_pic_works_GCJ=yes
+ fi
+ fi
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_works_GCJ" >&5
+echo "${ECHO_T}$lt_prog_compiler_pic_works_GCJ" >&6
+
+if test x"$lt_prog_compiler_pic_works_GCJ" = xyes; then
+ case $lt_prog_compiler_pic_GCJ in
+ "" | " "*) ;;
+ *) lt_prog_compiler_pic_GCJ=" $lt_prog_compiler_pic_GCJ" ;;
+ esac
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 2542 "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:2548: \"$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
- :
+ lt_prog_compiler_pic_GCJ=
+ lt_prog_compiler_can_build_shared_GCJ=no
+fi
+
+fi
+case "$host_os" in
+ # For platforms which do not support PIC, -DPIC is meaningless:
+ *djgpp*)
+ lt_prog_compiler_pic_GCJ=
+ ;;
+ *)
+ lt_prog_compiler_pic_GCJ="$lt_prog_compiler_pic_GCJ"
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5
+echo $ECHO_N "checking if $compiler supports -c -o file.$ac_objext... $ECHO_C" >&6
+if test "${lt_cv_prog_compiler_c_o_GCJ+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
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 2559 "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:2565: \"$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
- :
+ lt_cv_prog_compiler_c_o_GCJ=no
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ mkdir out
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ # 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 .
+
+ lt_compiler_flag="-o out/conftest2.$ac_objext"
+ # Insert the option either (1) after the last *FLAGS variable, or
+ # (2) before a word containing "conftest.", or (3) at the end.
+ # Note that $ac_compile itself does not contain backslashes and begins
+ # with a dollar sign (not a hyphen), so the echo should work correctly.
+ lt_compile=`echo "$ac_compile" | $SED \
+ -e 's:.*FLAGS}? :&$lt_compiler_flag :; t' \
+ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+ -e 's:$: $lt_compiler_flag:'`
+ (eval echo "\"\$as_me:15572: $lt_compile\"" >&5)
+ (eval "$lt_compile" 2>out/conftest.err)
+ ac_status=$?
+ cat out/conftest.err >&5
+ echo "$as_me:15576: \$? = $ac_status" >&5
+ if (exit $ac_status) && test -s out/conftest2.$ac_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_prog_compiler_c_o_GCJ=yes
+ fi
+ fi
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm conftest*
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_GCJ" >&5
+echo "${ECHO_T}$lt_cv_prog_compiler_c_o_GCJ" >&6
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_GCJ" = no && test "$need_locks" != no; then
+ # do not overwrite the value of need_locks provided by the user
+ echo "$as_me:$LINENO: checking if we can lock with hard links" >&5
+echo $ECHO_N "checking if we can lock with hard links... $ECHO_C" >&6
+ hard_links=yes
+ $rm conftest*
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ touch conftest.a
+ ln conftest.a conftest.b 2>&5 || hard_links=no
+ ln conftest.a conftest.b 2>/dev/null && hard_links=no
+ echo "$as_me:$LINENO: result: $hard_links" >&5
+echo "${ECHO_T}$hard_links" >&6
+ if test "$hard_links" = no; then
+ { echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ need_locks=warn
+ fi
else
- echo "$ac_err" >&5
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- CPP=/lib/cpp
+ need_locks=no
fi
-rm -f conftest*
+
+echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+echo $ECHO_N "checking whether the $compiler linker ($LD) supports shared libraries... $ECHO_C" >&6
+
+ runpath_var=
+ allow_undefined_flag_GCJ=
+ enable_shared_with_static_runtimes_GCJ=no
+ archive_cmds_GCJ=
+ archive_expsym_cmds_GCJ=
+ old_archive_From_new_cmds_GCJ=
+ old_archive_from_expsyms_cmds_GCJ=
+ export_dynamic_flag_spec_GCJ=
+ whole_archive_flag_spec_GCJ=
+ thread_safe_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_GCJ=
+ hardcode_libdir_flag_spec_ld_GCJ=
+ hardcode_libdir_separator_GCJ=
+ hardcode_direct_GCJ=no
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=unsupported
+ link_all_deplibs_GCJ=unknown
+ hardcode_automatic_GCJ=no
+ module_cmds_GCJ=
+ module_expsym_cmds_GCJ=
+ always_export_symbols_GCJ=no
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ # include_expsyms should be a list of space-separated symbols to be *always*
+ # included in the symbol list
+ include_expsyms_GCJ=
+ # exclude_expsyms can be an extended regexp of symbols to exclude
+ # it will be wrapped by ` (' and `)$', so one must not match beginning or
+ # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+ # as well as any symbol that contains `d'.
+ exclude_expsyms_GCJ="_GLOBAL_OFFSET_TABLE_"
+ # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+ # platforms (ab)use it in PIC code, but their linkers get confused if
+ # the symbol is explicitly referenced. Since portable code cannot
+ # rely on this symbol name, it's probably fine to never include it in
+ # preloaded symbol tables.
+ extract_expsyms_cmds=
+
+ case $host_os in
+ cygwin* | mingw* | pw32*)
+ # FIXME: the MSVC++ port hasn't been tested in a loooong time
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ if test "$GCC" != yes; then
+ with_gnu_ld=no
+ fi
+ ;;
+ openbsd*)
+ with_gnu_ld=no
+ ;;
+ esac
+
+ ld_shlibs_GCJ=yes
+ if test "$with_gnu_ld" = yes; then
+ # If archive_cmds runs LD, not CC, wlarc should be empty
+ wlarc='${wl}'
+
+ # See if GNU ld supports shared libraries.
+ case $host_os in
+ aix3* | aix4* | aix5*)
+ # On AIX/PPC, the GNU linker is very broken
+ if test "$host_cpu" != ia64; then
+ ld_shlibs_GCJ=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.
+*** Therefore, libtool is disabling shared libraries support. If you
+*** really care for shared libraries, you may want to modify your PATH
+*** so that a non-GNU linker is found, and then restart.
+
+EOF
+ fi
+ ;;
+
+ amigaos*)
+ archive_cmds_GCJ='$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)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+
+ # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports
+ # that the semantics of dynamic libraries on AmigaOS, at least up
+ # to version 4, is to share data among multiple programs linked
+ # with the same dynamic library. Since this doesn't match the
+ # behavior of shared libraries on other platforms, we can't use
+ # them.
+ ld_shlibs_GCJ=no
+ ;;
+
+ beos*)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ allow_undefined_flag_GCJ=unsupported
+ # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+ # support --undefined. This deserves some investigation. FIXME
+ archive_cmds_GCJ='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # _LT_AC_TAGVAR(hardcode_libdir_flag_spec, GCJ) is actually meaningless,
+ # as there is no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=no
+ enable_shared_with_static_runtimes_GCJ=yes
+ export_symbols_cmds_GCJ='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGS] /s/.* \([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW] /s/.* //'\'' | sort | uniq > $export_symbols'
+
+ if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ archive_expsym_cmds_GCJ='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--image-base=0x10000000 ${wl}--out-implib,$lib'
+ else
+ ld_shlibs=no
+ fi
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ wlarc=
+ else
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ fi
+ ;;
+
+ solaris* | sysv5*)
+ if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then
+ ld_shlibs_GCJ=no
+ cat <<EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems. Therefore, libtool
+*** is disabling shared libraries support. We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer. Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+EOF
+ elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+
+ sunos4*)
+ archive_cmds_GCJ='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ wlarc=
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ else
+ ld_shlibs_GCJ=no
+ fi
+ ;;
+ esac
+
+ if test "$ld_shlibs_GCJ" = yes; then
+ runpath_var=LD_RUN_PATH
+ hardcode_libdir_flag_spec_GCJ='${wl}--rpath ${wl}$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}--export-dynamic'
+ # ancient GNU ld didn't support --whole-archive et. al.
+ if $LD --help 2>&1 | grep 'no-whole-archive' > /dev/null; then
+ whole_archive_flag_spec_GCJ="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ else
+ whole_archive_flag_spec_GCJ=
+ fi
+ fi
+ else
+ # PORTME fill in a description of your system's linker (not GNU ld)
+ case $host_os in
+ aix3*)
+ allow_undefined_flag_GCJ=unsupported
+ always_export_symbols_GCJ=yes
+ archive_expsym_cmds_GCJ='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+ # Note: this linker hardcodes the directories in LIBPATH if there
+ # are no directories specified by -L.
+ hardcode_minus_L_GCJ=yes
+ if test "$GCC" = yes && test -z "$link_static_flag"; then
+ # Neither direct hardcoding nor static linking is supported with a
+ # broken collect2.
+ hardcode_direct_GCJ=unsupported
+ fi
+ ;;
+
+ aix4* | aix5*)
+ 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
+ exp_sym_flag='-Bexport'
+ no_entry_flag=""
+ else
+ # 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 | grep 'GNU' > /dev/null; then
+ export_symbols_cmds_GCJ='$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_GCJ='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { print \$3 } }'\'' | sort -u > $export_symbols'
+ fi
+ aix_use_runtimelinking=no
+
+ # 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 runtime linking.
+ case $host_os in aix4.[23]|aix4.[23].*|aix5*)
+ for ld_flag in $LDFLAGS; do
+ if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ aix_use_runtimelinking=yes
+ break
+ fi
+ done
+ esac
+
+ exp_sym_flag='-bexport'
+ no_entry_flag='-bnoentry'
+ fi
+
+ # 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.
+
+ archive_cmds_GCJ=''
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_separator_GCJ=':'
+ link_all_deplibs_GCJ=yes
+
+ if test "$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_GCJ=yes
+ else
+ # We have old collect2
+ hardcode_direct_GCJ=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_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_libdir_separator_GCJ=
+ fi
+ esac
+ shared_flag='-shared'
+ else
+ # not using gcc
+ if test "$host_cpu" = ia64; then
+ # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+ # chokes on -Wl,-G. The following line is correct:
+ shared_flag='-G'
+ else
+ if test "$aix_use_runtimelinking" = yes; then
+ shared_flag='${wl}-G'
+ else
+ shared_flag='${wl}-bM:SRE'
+ fi
+ fi
+ 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_GCJ=yes
+ if test "$aix_use_runtimelinking" = yes; then
+ # Warning - without using the other runtime loading flags (-brtl),
+ # -berok will link without error, but may produce a broken library.
+ allow_undefined_flag_GCJ='-berok'
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds_GCJ="\$CC"' -o $output_objdir/$soname $libobjs $deplibs $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then echo "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$no_entry_flag \${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ else
+ if test "$host_cpu" = ia64; then
+ hardcode_libdir_flag_spec_GCJ='${wl}-R $libdir:/usr/lib:/lib'
+ allow_undefined_flag_GCJ="-z nodefs"
+ archive_expsym_cmds_GCJ="\$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"
+ else
+ # Determine the default libpath from the value encoded in an empty executable.
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; }
+}'`; fi
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
- ac_cv_prog_CPP="$CPP"
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+ hardcode_libdir_flag_spec_GCJ='${wl}-blibpath:$libdir:'"$aix_libpath"
+ # Warning - without using the other run time loading flags,
+ # -berok will link without error, but may produce a broken library.
+ no_undefined_flag_GCJ=' ${wl}-bernotok'
+ allow_undefined_flag_GCJ=' ${wl}-berok'
+ # -bexpall does not export symbols beginning with underscore (_)
+ always_export_symbols_GCJ=yes
+ # Exported symbols can be pulled into shared objects from archives
+ whole_archive_flag_spec_GCJ=' '
+ archive_cmds_need_lc_GCJ=yes
+ # This is similar to how AIX traditionally builds it's shared libraries.
+ archive_expsym_cmds_GCJ="\$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_GCJ='$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)'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ # see comment about different semantics on the GNU ld section
+ ld_shlibs_GCJ=no
+ ;;
+
+ bsdi4*)
+ export_dynamic_flag_spec_GCJ=-rdynamic
+ ;;
+
+ cygwin* | mingw* | pw32*)
+ # When not using gcc, we currently assume that we are using
+ # Microsoft Visual C++.
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ hardcode_libdir_flag_spec_GCJ=' '
+ allow_undefined_flag_GCJ=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds_GCJ='$CC -o $lib $libobjs $compiler_flags `echo "$deplibs" | $SED -e '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_From_new_cmds_GCJ='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds_GCJ='lib /OUT:$oldlib$oldobjs$old_deplibs'
+ fix_srcfile_path='`cygpath -w "$srcfile"`'
+ enable_shared_with_static_runtimes_GCJ=yes
+ ;;
+
+ darwin* | rhapsody*)
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ archive_cmds_need_lc_GCJ=no
+ case "$host_os" in
+ rhapsody* | darwin1.[012])
+ allow_undefined_flag_GCJ='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ test -z ${LD_TWOLEVEL_NAMESPACE} && allow_undefined_flag_GCJ='-flat_namespace -undefined suppress'
+ ;;
+ esac
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes. Also zsh mangles
+ # `"' quotes if we put them in here... so don't!
+ lt_int_apple_cc_single_mod=no
+ output_verbose_link_cmd='echo'
+ if $CC -dumpspecs 2>&1 | grep 'single_module' >/dev/null ; then
+ lt_int_apple_cc_single_mod=yes
+ fi
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_cmds_GCJ='$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ else
+ archive_cmds_GCJ='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ fi
+ module_cmds_GCJ='$CC -bundle ${wl}-bind_at_load $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ if test "X$lt_int_apple_cc_single_mod" = Xyes ; then
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib -single_module $allow_undefined_flag -o $lib $libobjs $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ else
+ archive_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ fi
+ module_expsym_cmds_GCJ='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -bundle $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct_GCJ=no
+ hardcode_automatic_GCJ=yes
+ hardcode_shlibpath_var_GCJ=unsupported
+ whole_archive_flag_spec_GCJ='-all_load $convenience'
+ link_all_deplibs_GCJ=yes
+ fi
+ ;;
+
+ dgux*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ freebsd1*)
+ ld_shlibs_GCJ=no
+ ;;
+
+ # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+ # support. Future versions do this automatically, but an explicit c++rt0.o
+ # does not break anything, and helps significantly (at the cost of a little
+ # extra space).
+ freebsd2.2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+ freebsd2*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+ freebsd*)
+ archive_cmds_GCJ='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ hpux9*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$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'
+ else
+ archive_cmds_GCJ='$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'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ ;;
+
+ hpux10* | hpux11*)
+ if test "$GCC" = yes -a "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ else
+ case "$host_cpu" in
+ hppa*64*|ia64*)
+ archive_cmds_GCJ='$LD -b +h $soname -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ *)
+ archive_cmds_GCJ='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+ ;;
+ esac
+ fi
+ if test "$with_gnu_ld" = no; then
+ case "$host_cpu" in
+ hppa*64*)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec_ld_GCJ='+b $libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+ ia64*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ *)
+ hardcode_libdir_flag_spec_GCJ='${wl}+b ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_direct_GCJ=yes
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+
+ # hardcode_minus_L: Not really in the search PATH,
+ # but as the default location of the library.
+ hardcode_minus_L_GCJ=yes
+ ;;
+ esac
+ fi
+ ;;
+
+ irix5* | irix6* | nonstopux*)
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ archive_cmds_GCJ='$LD -shared $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_ld_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ netbsd*)
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
+ else
+ archive_cmds_GCJ='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ newsos6)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ openbsd*)
+ hardcode_direct_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ export_dynamic_flag_spec_GCJ='${wl}-E'
+ else
+ case $host_os in
+ openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+ archive_cmds_GCJ='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ ;;
+ *)
+ archive_cmds_GCJ='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath,$libdir'
+ ;;
+ esac
+ fi
+ ;;
+
+ os2*)
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_minus_L_GCJ=yes
+ allow_undefined_flag_GCJ=unsupported
+ archive_cmds_GCJ='$echo "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$echo DATA >> $output_objdir/$libname.def~$echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~$echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+ old_archive_From_new_cmds_GCJ='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ ;;
+
+ osf3*)
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ fi
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ osf4* | osf5*) # as osf3* with the addition of -msym flag
+ if test "$GCC" = yes; then
+ allow_undefined_flag_GCJ=' ${wl}-expect_unresolved ${wl}\*'
+ archive_cmds_GCJ='$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}${output_objdir}/so_locations -o $lib'
+ hardcode_libdir_flag_spec_GCJ='${wl}-rpath ${wl}$libdir'
+ else
+ allow_undefined_flag_GCJ=' -expect_unresolved \*'
+ archive_cmds_GCJ='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linker_flags -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_expsym_cmds_GCJ='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$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'
+
+ # Both c and cxx compiler support -rpath directly
+ hardcode_libdir_flag_spec_GCJ='-rpath $libdir'
+ fi
+ hardcode_libdir_separator_GCJ=:
+ ;;
+
+ sco3.2v5*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='${wl}-Bexport'
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ;;
+
+ solaris*)
+ no_undefined_flag_GCJ=' -z text'
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds_GCJ='$echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~
+ $CC -shared ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$rm $lib.exp'
+ else
+ archive_cmds_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$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'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-R$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ case $host_os in
+ solaris2.[0-5] | solaris2.[0-5].*) ;;
+ *) # Supported since Solaris 2.6 (maybe 2.5.1?)
+ whole_archive_flag_spec_GCJ='-z allextract$convenience -z defaultextract' ;;
+ esac
+ link_all_deplibs_GCJ=yes
+ ;;
+
+ sunos4*)
+ if test "x$host_vendor" = xsequent; then
+ # Use $CC to link under sequent, because it throws in some extra .o
+ # files that make .init and .fini sections work.
+ archive_cmds_GCJ='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+ fi
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=yes
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4)
+ case $host_vendor in
+ sni)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes # is this really true???
+ ;;
+ siemens)
+ ## LD is ld it makes a PLAMLIB
+ ## CC just makes a GrossModule.
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ reload_cmds_GCJ='$CC -r -o $output$reload_objs'
+ hardcode_direct_GCJ=no
+ ;;
+ motorola)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=no #Motorola manual says yes, but my tests say they lie
+ ;;
+ esac
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv4.3*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ export_dynamic_flag_spec_GCJ='-Bexport'
+ ;;
+
+ sysv4*MP*)
+ if test -d /usr/nec; then
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var=LD_RUN_PATH
+ hardcode_runpath_var=yes
+ ld_shlibs_GCJ=yes
+ fi
+ ;;
+
+ sysv4.2uw2*)
+ archive_cmds_GCJ='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_direct_GCJ=yes
+ hardcode_minus_L_GCJ=no
+ hardcode_shlibpath_var_GCJ=no
+ hardcode_runpath_var=yes
+ runpath_var=LD_RUN_PATH
+ ;;
+
+ sysv5OpenUNIX8* | sysv5UnixWare7* | sysv5uw[78]* | unixware7*)
+ no_undefined_flag_GCJ='${wl}-z ${wl}text'
+ if test "$GCC" = yes; then
+ archive_cmds_GCJ='$CC -shared ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ else
+ archive_cmds_GCJ='$CC -G ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ fi
+ runpath_var='LD_RUN_PATH'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ sysv5*)
+ no_undefined_flag_GCJ=' -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_GCJ='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_expsym_cmds_GCJ='$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_GCJ=
+ hardcode_shlibpath_var_GCJ=no
+ runpath_var='LD_RUN_PATH'
+ ;;
+
+ uts4*)
+ archive_cmds_GCJ='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ hardcode_libdir_flag_spec_GCJ='-L$libdir'
+ hardcode_shlibpath_var_GCJ=no
+ ;;
+
+ *)
+ ld_shlibs_GCJ=no
+ ;;
+ esac
+ fi
+
+echo "$as_me:$LINENO: result: $ld_shlibs_GCJ" >&5
+echo "${ECHO_T}$ld_shlibs_GCJ" >&6
+test "$ld_shlibs_GCJ" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+ variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
- CPP="$ac_cv_prog_CPP"
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_GCJ" in
+x|xyes)
+ # Assume -lc should be added
+ archive_cmds_need_lc_GCJ=yes
+
+ if test "$enable_shared" = yes && test "$GCC" = yes; then
+ case $archive_cmds_GCJ in
+ *'~'*)
+ # FIXME: we may have to deal with multi-command sequences.
+ ;;
+ '$CC '*)
+ # Test whether the compiler implicitly links with -lc since on some
+ # systems, -lgcc has to come before -lc. If gcc already passes -lc
+ # to ld, don't add -lc before -lgcc.
+ echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5
+echo $ECHO_N "checking whether -lc should be explicitly linked in... $ECHO_C" >&6
+ $rm conftest*
+ printf "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } 2>conftest.err; then
+ soname=conftest
+ lib=conftest
+ libobjs=conftest.$ac_objext
+ deplibs=
+ wl=$lt_prog_compiler_wl_GCJ
+ compiler_flags=-v
+ linker_flags=-v
+ verstring=
+ output_objdir=.
+ libname=conftest
+ lt_save_allow_undefined_flag=$allow_undefined_flag_GCJ
+ allow_undefined_flag_GCJ=
+ if { (eval echo "$as_me:$LINENO: \"$archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1\"") >&5
+ (eval $archive_cmds_GCJ 2\>\&1 \| grep \" -lc \" \>/dev/null 2\>\&1) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }
+ then
+ archive_cmds_need_lc_GCJ=no
+ else
+ archive_cmds_need_lc_GCJ=yes
+ fi
+ allow_undefined_flag_GCJ=$lt_save_allow_undefined_flag
+ else
+ cat conftest.err 1>&5
+ fi
+ $rm conftest*
+ echo "$as_me:$LINENO: result: $archive_cmds_need_lc_GCJ" >&5
+echo "${ECHO_T}$archive_cmds_need_lc_GCJ" >&6
+ ;;
+ esac
+ fi
+ ;;
+esac
+
+echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5
+echo $ECHO_N "checking how to hardcode library paths into programs... $ECHO_C" >&6
+hardcode_action_GCJ=
+if test -n "$hardcode_libdir_flag_spec_GCJ" || \
+ test -n "$runpath_var GCJ" || \
+ test "X$hardcode_automatic_GCJ"="Xyes" ; then
+
+ # We can hardcode non-existant directories.
+ if test "$hardcode_direct_GCJ" != no &&
+ # If the only mechanism to avoid hardcoding is shlibpath_var, we
+ # have to relink, otherwise we might link with an installed library
+ # when we should be linking with a yet-to-be-installed one
+ ## test "$_LT_AC_TAGVAR(hardcode_shlibpath_var, GCJ)" != no &&
+ test "$hardcode_minus_L_GCJ" != no; then
+ # Linking always hardcodes the temporary library directory.
+ hardcode_action_GCJ=relink
+ else
+ # We can link without hardcoding, and we can hardcode nonexisting dirs.
+ hardcode_action_GCJ=immediate
+ fi
else
- ac_cv_prog_CPP="$CPP"
+ # We cannot hardcode anything, or else we can only hardcode existing
+ # directories.
+ hardcode_action_GCJ=unsupported
fi
-echo "$ac_t""$CPP" 1>&6
+echo "$as_me:$LINENO: result: $hardcode_action_GCJ" >&5
+echo "${ECHO_T}$hardcode_action_GCJ" >&6
-# Read the libtool configuration
-rm -f conftest
-./libtool --config > conftest
-. ./conftest
-rm -f conftest
+if test "$hardcode_action_GCJ" = relink; then
+ # Fast installation is not supported
+ enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+ test "$enable_shared" = no; then
+ # Fast installation is not necessary
+ enable_fast_install=needless
+fi
-# 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:2597: 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
+striplib=
+old_striplib=
+echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5
+echo $ECHO_N "checking whether stripping libraries is possible... $ECHO_C" >&6
+if test -n "$STRIP" && $STRIP -V 2>&1 | grep "GNU strip" >/dev/null; then
+ test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+ test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&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?!! ;)}
+# FIXME - insert some real tests, host_os isn't really good enough
+ case $host_os in
+ darwin*)
+ if test -n "$STRIP" ; then
+ striplib="$STRIP -x"
+ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6
+ else
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+fi
+ ;;
+ *)
+ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6
+ ;;
+ esac
+fi
-# Character class describing NM global symbol codes.
-ac_symcode='[BCDEGRST]'
+echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5
+echo $ECHO_N "checking dynamic linker characteristics... $ECHO_C" >&6
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+if test "$GCC" = yes; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';' >/dev/null ; then
+ # if the path contains ";" then we assume it to be the separator
+ # otherwise default to the standard path separator (i.e. ":") - it is
+ # assumed that no part of a normal pathname contains ";" but that should
+ # okay in the real world where ";" in dirpaths is itself problematic.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+else
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+need_lib_prefix=unknown
+hardcode_into_libs=no
-# Regexp to match symbols that can be accessed directly from C.
-ac_sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
-# Transform the above into a raw symbol and a C symbol.
-ac_symxfrm='\1 \2\3 \3'
+case $host_os in
+aix3*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ shlibpath_var=LIBPATH
-# Transform an extracted symbol line into a proper C declaration
-ac_global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'"
+ # AIX 3 has no versioning support, so we append a major version to the name.
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
-# Define system-specific variables.
-case "$host_os" in
-aix*)
- ac_symcode='[BCDT]'
+aix4* | aix5*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ hardcode_into_libs=yes
+ if test "$host_cpu" = ia64; then
+ # AIX 5 supports IA64
+ library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ 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.
+ 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
+ can_build_shared=no
+ fi
+ ;;
+ esac
+ # 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.
+ 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}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ else
+ # We preserve .a as extension for shared libraries through AIX4.2
+ # and later when we are not doing run time linking.
+ library_names_spec='${libname}${release}.a $libname.a'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ fi
+ shlibpath_var=LIBPATH
+ fi
;;
-cygwin* | mingw*)
- ac_symcode='[ABCDGISTW]'
+
+amigaos*)
+ library_names_spec='$libname.ixlibrary $libname.a'
+ # Create ${libname}_ixlibrary.a entries in /sys/libs.
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done'
;;
-hpux*)
- ac_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'"
+
+beos*)
+ library_names_spec='${libname}${shared_ext}'
+ dynamic_linker="$host_os ld.so"
+ shlibpath_var=LIBRARY_PATH
;;
-irix*)
- ac_symcode='[BCDEGRST]'
+
+bsdi4*)
+ version_type=linux
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+ # the default ld.so.conf also contains /usr/contrib/lib and
+ # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+ # libtool to hard-code these into programs
;;
+
+cygwin* | mingw* | pw32*)
+ version_type=windows
+ shrext=".dll"
+ need_version=no
+ need_lib_prefix=no
+
+ case $GCC,$host_os in
+ yes,cygwin* | yes,mingw* | yes,pw32*)
+ library_names_spec='$libname.dll.a'
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i;echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $rm \$dlpath'
+ shlibpath_overrides_runpath=yes
+
+ case $host_os in
+ cygwin*)
+ # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+ soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec="/lib /lib/w32api /usr/lib /usr/local/lib"
+ ;;
+ mingw*)
+ # MinGW DLLs use traditional 'lib' prefix
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | grep "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"`
+ if echo "$sys_lib_search_path_spec" | grep ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH printed by
+ # mingw gcc, but we are running on Cygwin. Gcc prints its search
+ # path with ; separators, and with drive letters. We can handle the
+ # drive letters (cygwin fileutils understands them), so leave them,
+ # especially as we might pass files found there to a mingw objdump,
+ # which wouldn't understand a cygwinified path. Ahh.
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`echo "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ ;;
+ pw32*)
+ # pw32 DLLs use 'pw' prefix rather than 'lib'
+ library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/./-/g'`${versuffix}${shared_ext}'
+ ;;
+ esac
+ ;;
+
+ *)
+ library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ ;;
+ esac
+ dynamic_linker='Win32 ld.exe'
+ # FIXME: first we should search . and the directory the executable is in
+ shlibpath_var=PATH
+ ;;
+
+darwin* | rhapsody*)
+ dynamic_linker="$host_os dyld"
+ version_type=darwin
+ need_lib_prefix=no
+ need_version=no
+ # FIXME: Relying on posixy $() will cause problems for
+ # cross-compilation, but unfortunately the echo tests do not
+ # yet detect zsh echo's removal of \ escapes.
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
+ shlibpath_overrides_runpath=yes
+ shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ # Apple's gcc prints 'gcc -print-search-dirs' doesn't operate the same.
+ if $CC -v 2>&1 | grep 'Apple' >/dev/null ; then
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ fi
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+ ;;
+
+dgux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+freebsd1*)
+ dynamic_linker=no
+ ;;
+
+freebsd*)
+ objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout`
+ version_type=freebsd-$objformat
+ case $version_type in
+ freebsd-elf*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ need_version=no
+ need_lib_prefix=no
+ ;;
+ freebsd-*)
+ library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ need_version=yes
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_os in
+ freebsd2*)
+ shlibpath_overrides_runpath=yes
+ ;;
+ freebsd3.01* | freebsdelf3.01*)
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+ *) # from 3.2 on
+ shlibpath_overrides_runpath=no
+ hardcode_into_libs=yes
+ ;;
+ esac
+ ;;
+
+gnu*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ hardcode_into_libs=yes
+ ;;
+
+hpux9* | hpux10* | hpux11*)
+ # Give a soname corresponding to the major version so that dld.sl refuses to
+ # link against other versions.
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ case "$host_cpu" in
+ ia64*)
+ shrext='.so'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.so"
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ if test "X$HPUX_IA64_MODE" = X32; then
+ sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ else
+ sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ fi
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ hppa*64*)
+ shrext='.sl'
+ hardcode_into_libs=yes
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+ shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ ;;
+ *)
+ shrext='.sl'
+ dynamic_linker="$host_os dld.sl"
+ shlibpath_var=SHLIB_PATH
+ shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ ;;
+ esac
+ # HP-UX runs *really* slowly unless shared libraries are mode 555.
+ postinstall_cmds='chmod 555 $lib'
+ ;;
+
+irix5* | irix6* | nonstopux*)
+ case $host_os in
+ nonstopux*) version_type=nonstopux ;;
+ *)
+ if test "$lt_cv_prog_gnu_ld" = yes; then
+ version_type=linux
+ else
+ version_type=irix
+ fi ;;
+ esac
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ case $host_os in
+ irix5* | nonstopux*)
+ libsuff= shlibsuff=
+ ;;
+ *)
+ case $LD in # libtool.m4 will add one of these switches to LD
+ *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+ libsuff= shlibsuff= libmagic=32-bit;;
+ *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+ libsuff=32 shlibsuff=N32 libmagic=N32;;
+ *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+ libsuff=64 shlibsuff=64 libmagic=64-bit;;
+ *) libsuff= shlibsuff= libmagic=never-match;;
+ esac
+ ;;
+ esac
+ shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+ sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ hardcode_into_libs=yes
+ ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+ dynamic_linker=no
+ ;;
+
+# This must be Linux ELF.
+linux*)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ # We used to test for /lib/ld.so.1 and disable shared libraries on
+ # powerpc, because MkLinux only supported shared libraries with the
+ # GNU dynamic linker. Since this was broken with cross compilers,
+ # most powerpc-linux boxes support dynamic linking these days and
+ # people can always --disable-shared, the test was removed, and we
+ # assume the GNU/Linux dynamic linker is in use.
+ dynamic_linker='GNU/Linux ld.so'
+ ;;
+
+netbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ dynamic_linker='NetBSD (a.out) ld.so'
+ else
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} ${libname}${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ dynamic_linker='NetBSD ld.elf_so'
+ fi
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ ;;
+
+newsos6)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+nto-qnx)
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ ;;
+
+openbsd*)
+ version_type=sunos
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ case $host_os in
+ openbsd2.[89] | openbsd2.[89].*)
+ shlibpath_overrides_runpath=no
+ ;;
+ *)
+ shlibpath_overrides_runpath=yes
+ ;;
+ esac
+ else
+ shlibpath_overrides_runpath=yes
+ fi
+ ;;
+
+os2*)
+ libname_spec='$name'
+ shrext=".dll"
+ need_lib_prefix=no
+ library_names_spec='$libname${shared_ext} $libname.a'
+ dynamic_linker='OS/2 ld.exe'
+ shlibpath_var=LIBPATH
+ ;;
+
+osf3* | osf4* | osf5*)
+ version_type=osf
+ need_lib_prefix=no
+ need_version=no
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+ sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ ;;
+
+sco3.2v5*)
+ version_type=osf
+ soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
solaris*)
- ac_symcode='[BDT]'
+ version_type=linux
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ hardcode_into_libs=yes
+ # ldd complains unless libraries are executable
+ postinstall_cmds='chmod +x $lib'
+ ;;
+
+sunos4*)
+ version_type=sunos
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+ if test "$with_gnu_ld" = yes; then
+ need_lib_prefix=no
+ fi
+ need_version=yes
+ ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ case $host_vendor in
+ sni)
+ shlibpath_overrides_runpath=no
+ need_lib_prefix=no
+ export_dynamic_flag_spec='${wl}-Blargedynsym'
+ runpath_var=LD_RUN_PATH
+ ;;
+ siemens)
+ need_lib_prefix=no
+ ;;
+ motorola)
+ need_lib_prefix=no
+ need_version=no
+ shlibpath_overrides_runpath=no
+ sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+ ;;
+ esac
+ ;;
+
+sysv4*MP*)
+ if test -d /usr/nec ;then
+ version_type=linux
+ library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+ soname_spec='$libname${shared_ext}.$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ fi
+ ;;
+
+uts4*)
+ version_type=linux
+ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='${libname}${release}${shared_ext}$major'
+ shlibpath_var=LD_LIBRARY_PATH
+ ;;
+
+*)
+ dynamic_linker=no
;;
esac
+echo "$as_me:$LINENO: result: $dynamic_linker" >&5
+echo "${ECHO_T}$dynamic_linker" >&6
+test "$dynamic_linker" = no && can_build_shared=no
+
+if test "x$enable_dlopen" != xyes; then
+ enable_dlopen=unknown
+ enable_dlopen_self=unknown
+ enable_dlopen_self_static=unknown
+else
+ lt_cv_dlopen=no
+ lt_cv_dlopen_libs=
+
+ case $host_os in
+ beos*)
+ lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+ ;;
-# 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]'
+ mingw* | pw32*)
+ lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen_libs=
+ ;;
+
+ cygwin*)
+ lt_cv_dlopen="dlopen"
+ lt_cv_dlopen_libs=
+ ;;
+
+ darwin*)
+ # if libdl is installed we need to link against it
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
-# Try without a prefix undercore, then with it.
-for ac_symprfx in "" "_"; do
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
+
+fi
- 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
+ *)
+ echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* 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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
#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 { (eval echo configure:2660: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- if { (eval echo configure:2664: \"$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
+ac_cv_func_shl_load=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+ lt_cv_dlopen="shl_load"
+else
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
- # 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
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- # 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
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
+ lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-dld"
+else
+ echo "$as_me:$LINENO: checking for dlopen" >&5
+echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
+if test "${ac_cv_func_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char dlopen (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
-extern "C" {
+extern "C"
+{
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+/* 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_dlopen) || defined (__stub___dlopen)
+choke me
+#else
+char (*f) () = dlopen;
+#endif
+#ifdef __cplusplus
+}
#endif
-EOF
- # Now generate the symbol file.
- eval "$ac_global_symbol_to_cdecl"' < "$ac_nlist" >> conftest.c'
+int
+main ()
+{
+return f != dlopen;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
- cat <<EOF >> conftest.c
-#if defined (__STDC__) && __STDC__
-# define lt_ptr_t void *
-#else
-# define lt_ptr_t char *
-# define const
+ac_cv_func_dlopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
+echo "${ECHO_T}$ac_cv_func_dlopen" >&6
+if test $ac_cv_func_dlopen = yes; then
+ lt_cv_dlopen="dlopen"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-/* The mapping between symbol names and symbols. */
-const struct {
- const char *name;
- lt_ptr_t address;
+ac_cv_lib_dl_dlopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+ echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
}
-lt_preloaded_symbols[] =
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_svld_dlopen=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+ lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
{
-EOF
- sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$ac_nlist" >> conftest.c
- cat <<\EOF >> conftest.c
- {0, (lt_ptr_t) 0}
-};
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dld_dld_link=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+ lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-dld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+ ;;
+ esac
+
+ if test "x$lt_cv_dlopen" != xno; then
+ enable_dlopen=yes
+ else
+ enable_dlopen=no
+ fi
+
+ case $lt_cv_dlopen in
+ dlopen)
+ save_CPPFLAGS="$CPPFLAGS"
+ test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+ save_LDFLAGS="$LDFLAGS"
+ eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+ save_LIBS="$LIBS"
+ LIBS="$lt_cv_dlopen_libs $LIBS"
+
+ echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5
+echo $ECHO_N "checking whether a program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 17584 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
}
+EOF
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self" >&6
+
+ if test "x$lt_cv_dlopen_self" = xyes; then
+ LDFLAGS="$LDFLAGS $link_static_flag"
+ echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5
+echo $ECHO_N "checking whether a statically linked program can dlopen itself... $ECHO_C" >&6
+if test "${lt_cv_dlopen_self_static+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ if test "$cross_compiling" = yes; then :
+ lt_cv_dlopen_self_static=cross
+else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
+ cat > conftest.$ac_ext <<EOF
+#line 17682 "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
+#else
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+ find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
+# else
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
+# endif
+# endif
+#endif
+
+#ifdef __cplusplus
+extern "C" void exit (int);
#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+
+ exit (status);
+}
EOF
- # Now try linking the two files.
- mv conftest.$ac_objext conftstm.$ac_objext
- ac_save_LIBS="$LIBS"
- ac_save_CFLAGS="$CFLAGS"
- LIBS="conftstm.$ac_objext"
- CFLAGS="$CFLAGS$no_builtin_flag"
- if { (eval echo configure:2716: \"$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"
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+ x$lt_unknown|x*) lt_cv_dlopen_self_static=no ;;
+ esac
+ else :
+ # compilation failed
+ lt_cv_dlopen_self_static=no
+ fi
+fi
+rm -fr conftest*
+
+
+fi
+echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5
+echo "${ECHO_T}$lt_cv_dlopen_self_static" >&6
+ fi
+
+ CPPFLAGS="$save_CPPFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+ LIBS="$save_LIBS"
+ ;;
+ esac
+
+ 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
+ yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+ *) enable_dlopen_self_static=unknown ;;
+ esac
+fi
+
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
+ fi
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_GCJ \
+ CC_GCJ \
+ LD_GCJ \
+ lt_prog_compiler_wl_GCJ \
+ lt_prog_compiler_pic_GCJ \
+ lt_prog_compiler_static_GCJ \
+ lt_prog_compiler_no_builtin_flag_GCJ \
+ export_dynamic_flag_spec_GCJ \
+ thread_safe_flag_spec_GCJ \
+ whole_archive_flag_spec_GCJ \
+ enable_shared_with_static_runtimes_GCJ \
+ old_archive_cmds_GCJ \
+ old_archive_from_new_cmds_GCJ \
+ predep_objects_GCJ \
+ postdep_objects_GCJ \
+ predeps_GCJ \
+ postdeps_GCJ \
+ compiler_lib_search_path_GCJ \
+ archive_cmds_GCJ \
+ archive_expsym_cmds_GCJ \
+ postinstall_cmds_GCJ \
+ postuninstall_cmds_GCJ \
+ old_archive_from_expsyms_cmds_GCJ \
+ allow_undefined_flag_GCJ \
+ no_undefined_flag_GCJ \
+ export_symbols_cmds_GCJ \
+ hardcode_libdir_flag_spec_GCJ \
+ hardcode_libdir_flag_spec_ld_GCJ \
+ hardcode_libdir_separator_GCJ \
+ hardcode_automatic_GCJ \
+ module_cmds_GCJ \
+ module_expsym_cmds_GCJ \
+ lt_cv_prog_compiler_c_o_GCJ \
+ exclude_expsyms_GCJ \
+ include_expsyms_GCJ; do
+
+ case $var in
+ old_archive_cmds_GCJ | \
+ old_archive_from_new_cmds_GCJ | \
+ archive_cmds_GCJ | \
+ archive_expsym_cmds_GCJ | \
+ module_cmds_GCJ | \
+ module_expsym_cmds_GCJ | \
+ old_archive_from_expsyms_cmds_GCJ | \
+ export_symbols_cmds_GCJ | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
+
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_GCJ
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_GCJ
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_GCJ
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_GCJ
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_GCJ
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_GCJ
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_GCJ
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_GCJ
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_GCJ
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_GCJ
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_GCJ
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_GCJ
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_GCJ
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_GCJ
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_GCJ
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_GCJ
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_GCJ
+archive_expsym_cmds=$lt_archive_expsym_cmds_GCJ
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_GCJ
+module_expsym_cmds=$lt_module_expsym_cmds_GCJ
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_GCJ
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_GCJ
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_GCJ
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_GCJ
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_GCJ
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_GCJ
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_GCJ
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_GCJ
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_GCJ
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_GCJ
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_GCJ
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_GCJ
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_GCJ
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_GCJ
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_GCJ"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_GCJ
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_GCJ
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_GCJ
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_GCJ
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
else
- echo "cannot find nm_test_func in $ac_nlist" >&5
+ tagname=""
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
- else
- echo "$progname: failed program was:" >&5
- cat conftest.c >&5
+ ;;
+
+ RC)
+
+
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+objext_RC=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }\n'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+CC=${RC-"windres"}
+compiler=$CC
+compiler_RC=$CC
+lt_cv_prog_compiler_c_o_RC=yes
+
+# The else clause should only fire when bootstrapping the
+# libtool distribution, otherwise you forgot to ship ltmain.sh
+# with your package, and you will get complaints that there are
+# no rules to generate ltmain.sh.
+if test -f "$ltmain"; then
+ # See if we are running on zsh, and set the options which allow our commands through
+ # without removal of \ escapes.
+ if test -n "${ZSH_VERSION+set}" ; then
+ setopt NO_GLOB_SUBST
fi
- rm -rf conftest* conftst*
+ # Now quote all the things that may contain metacharacters while being
+ # careful not to overquote the AC_SUBSTed values. We take copies of the
+ # variables and quote the copies for generation of the libtool script.
+ for var in echo old_CC old_CFLAGS AR AR_FLAGS EGREP RANLIB LN_S LTCC NM SED SHELL \
+ libname_spec library_names_spec soname_spec extract_expsyms_cmds \
+ old_striplib striplib file_magic_cmd finish_cmds finish_eval \
+ deplibs_check_method reload_flag reload_cmds need_locks \
+ lt_cv_sys_global_symbol_pipe lt_cv_sys_global_symbol_to_cdecl \
+ lt_cv_sys_global_symbol_to_c_name_address \
+ sys_lib_search_path_spec sys_lib_dlsearch_path_spec \
+ old_postinstall_cmds old_postuninstall_cmds \
+ compiler_RC \
+ CC_RC \
+ LD_RC \
+ lt_prog_compiler_wl_RC \
+ lt_prog_compiler_pic_RC \
+ lt_prog_compiler_static_RC \
+ lt_prog_compiler_no_builtin_flag_RC \
+ export_dynamic_flag_spec_RC \
+ thread_safe_flag_spec_RC \
+ whole_archive_flag_spec_RC \
+ enable_shared_with_static_runtimes_RC \
+ old_archive_cmds_RC \
+ old_archive_from_new_cmds_RC \
+ predep_objects_RC \
+ postdep_objects_RC \
+ predeps_RC \
+ postdeps_RC \
+ compiler_lib_search_path_RC \
+ archive_cmds_RC \
+ archive_expsym_cmds_RC \
+ postinstall_cmds_RC \
+ postuninstall_cmds_RC \
+ old_archive_from_expsyms_cmds_RC \
+ allow_undefined_flag_RC \
+ no_undefined_flag_RC \
+ export_symbols_cmds_RC \
+ hardcode_libdir_flag_spec_RC \
+ hardcode_libdir_flag_spec_ld_RC \
+ hardcode_libdir_separator_RC \
+ hardcode_automatic_RC \
+ module_cmds_RC \
+ module_expsym_cmds_RC \
+ lt_cv_prog_compiler_c_o_RC \
+ exclude_expsyms_RC \
+ include_expsyms_RC; do
+
+ case $var in
+ old_archive_cmds_RC | \
+ old_archive_from_new_cmds_RC | \
+ archive_cmds_RC | \
+ archive_expsym_cmds_RC | \
+ module_cmds_RC | \
+ module_expsym_cmds_RC | \
+ old_archive_from_expsyms_cmds_RC | \
+ export_symbols_cmds_RC | \
+ extract_expsyms_cmds | reload_cmds | finish_cmds | \
+ postinstall_cmds | postuninstall_cmds | \
+ old_postinstall_cmds | old_postuninstall_cmds | \
+ sys_lib_search_path_spec | sys_lib_dlsearch_path_spec)
+ # Double-quote double-evaled strings.
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\""
+ ;;
+ *)
+ eval "lt_$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\""
+ ;;
+ esac
+ done
- # 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
+ case $lt_echo in
+ *'\$0 --fallback-echo"')
+ lt_echo=`$echo "X$lt_echo" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'`
+ ;;
+ esac
+
+cfgfile="$ofile"
+
+ cat <<__EOF__ >> "$cfgfile"
+# ### BEGIN LIBTOOL TAG CONFIG: $tagname
+
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_RC
+
+# Whether or not to disallow shared libs when runtime libs are static
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# The host system.
+host_alias=$host_alias
+host=$host
+
+# An echo program that does not interpret backslashes.
+echo=$lt_echo
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A C compiler.
+LTCC=$lt_LTCC
+
+# A language-specific compiler.
+CC=$lt_compiler_RC
+
+# Is the compiler the GNU C compiler?
+with_gcc=$GCC_RC
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# The linker used to build libraries.
+LD=$lt_LD_RC
+
+# Whether we need hard or soft links.
+LN_S=$lt_LN_S
+
+# A BSD-compatible nm program.
+NM=$lt_NM
+
+# A symbol stripping program
+STRIP=$STRIP
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=$MAGIC_CMD
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="$DLLTOOL"
+
+# Used on cygwin: object dumper.
+OBJDUMP="$OBJDUMP"
+
+# Used on cygwin: assembler.
+AS="$AS"
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_RC
+
+# Object file suffix (normally "o").
+objext="$ac_objext"
+
+# Old archive suffix (normally "a").
+libext="$libext"
+
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
+# Executable file suffix (normally "").
+exeext="$exeext"
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_RC
+pic_mode=$pic_mode
+
+# What is the maximum length of a command?
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC
+
+# Must we lock files when doing compilation ?
+need_locks=$lt_need_locks
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_RC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=$lt_thread_safe_flag_spec_RC
+
+# Library versioning type.
+version_type=$version_type
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names. First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Commands used to build and install an old-style archive.
+RANLIB=$lt_RANLIB
+old_archive_cmds=$lt_old_archive_cmds_RC
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC
+
+# Commands used to build and install a shared archive.
+archive_cmds=$lt_archive_cmds_RC
+archive_expsym_cmds=$lt_archive_expsym_cmds_RC
+postinstall_cmds=$lt_postinstall_cmds
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to build a loadable module (assumed same as above if empty)
+module_cmds=$lt_module_cmds_RC
+module_expsym_cmds=$lt_module_expsym_cmds_RC
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=$lt_predep_objects_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=$lt_postdep_objects_RC
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=$lt_predeps_RC
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=$lt_postdeps_RC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd=$lt_file_magic_cmd
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_RC
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_RC
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=$lt_finish_eval
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# This is the shared library runtime path variable.
+runpath_var=$runpath_var
+
+# This is the shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_RC
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC
+
+# If ld is used when linking, flag to hardcode \$libdir into
+# a binary during linking. This must work even if \$libdir does
+# not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC
+
+# Set to yes if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=$hardcode_direct_RC
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=$hardcode_minus_L_RC
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_RC
+
+# Set to yes if building a shared library automatically hardcodes DIR into the library
+# and all subsequent libraries and executables linked against it.
+hardcode_automatic=$hardcode_automatic_RC
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="$variables_saved_for_relink"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_RC
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path="$fix_srcfile_path_RC"
+
+# Set to yes if exported symbols are required.
+always_export_symbols=$always_export_symbols_RC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_RC
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_RC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_RC
+
+# ### END LIBTOOL TAG CONFIG: $tagname
+
+__EOF__
+
+
+else
+ # If there is no Makefile yet, we rely on a make rule to execute
+ # `config.status --recheck' to rerun these tests and create the
+ # libtool script then.
+ test -f Makefile && make "$ltmain"
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+ ;;
+
+ *)
+ { { echo "$as_me:$LINENO: error: Unsupported tag name: $tagname" >&5
+echo "$as_me: error: Unsupported tag name: $tagname" >&2;}
+ { (exit 1); exit 1; }; }
+ ;;
+ esac
+
+ # Append the new tag name to the list of available tags.
+ if test -n "$tagname" ; then
+ available_tags="$available_tags $tagname"
fi
- break
+ fi
+ done
+ IFS="$lt_save_ifs"
+
+ # Now substitute the updated list of available tags.
+ if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
+ mv "${ofile}T" "$ofile"
+ chmod +x "$ofile"
else
- ac_cv_sys_global_symbol_pipe=
+ rm -f "${ofile}T"
+ { { echo "$as_me:$LINENO: error: unable to update list of available tagged configurations." >&5
+echo "$as_me: error: unable to update list of available tagged configurations." >&2;}
+ { (exit 1); exit 1; }; }
fi
-done
-
fi
-ac_result=yes
-if test -z "$ac_cv_sys_global_symbol_pipe"; then
- ac_result=no
-fi
-echo "$ac_t""$ac_result" 1>&6
-echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6
-echo "configure:2762: 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
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltmain.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Prevent multiple expansion
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_header_dirent=no
+for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
+ as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
+echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 2767 "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:2775: \"$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
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <sys/types.h>
+#include <$ac_hdr>
+
+int
+main ()
+{
+if ((DIR *) 0)
+return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_Header=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
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_Header=no"
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
+_ACEOF
+
+ac_header_dirent=$ac_hdr; break
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 2792 "configure"
-#include "confdefs.h"
-#include <string.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "memchr" >/dev/null 2>&1; then
- :
+done
+# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
+if test $ac_header_dirent = dirent.h; then
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- rm -rf conftest*
- ac_cv_header_stdc=no
-fi
-rm -f conftest*
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in dir; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-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 2810 "configure"
-#include "confdefs.h"
-#include <stdlib.h>
-EOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
- egrep "free" >/dev/null 2>&1; then
- :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
else
- rm -rf conftest*
- ac_cv_header_stdc=no
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
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 2831 "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); }
+ echo "$as_me:$LINENO: checking for library containing opendir" >&5
+echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6
+if test "${ac_cv_search_opendir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_func_search_save_LIBS=$LIBS
+ac_cv_search_opendir=no
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-EOF
-if { (eval echo configure:2842: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
-then
- :
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="none required"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- ac_cv_header_stdc=no
-fi
-rm -fr conftest*
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+if test "$ac_cv_search_opendir" = no; then
+ for ac_lib in x; do
+ LIBS="-l$ac_lib $ac_func_search_save_LIBS"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char opendir ();
+int
+main ()
+{
+opendir ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_search_opendir="-l$ac_lib"
+break
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+ done
+fi
+LIBS=$ac_func_search_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
+echo "${ECHO_T}$ac_cv_search_opendir" >&6
+if test "$ac_cv_search_opendir" != no; then
+ test "$ac_cv_search_opendir" = "none required" || LIBS="$ac_cv_search_opendir $LIBS"
-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
fi
# Check whether --enable-ltdl-install or --disable-ltdl-install was given.
if test "${enable_ltdl_install+set}" = set; then
enableval="$enable_ltdl_install"
- :
-fi
+fi;
@@ -2879,6 +18985,7 @@ else
fi
+
if test x"${enable_ltdl_convenience-no}" != xno; then
CONVENIENCE_LTDL_TRUE=
CONVENIENCE_LTDL_FALSE='#'
@@ -2887,516 +18994,771 @@ else
CONVENIENCE_LTDL_FALSE=
fi
-echo $ac_n "checking which extension is used for shared libraries""... $ac_c" 1>&6
-echo "configure:2892: 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
- (
- last=
- for spec in $library_names_spec; do
- last="$spec"
- done
- echo "$last" | sed 's/\[.*\]//;s/^[^.]*//;s/\$.*$//;s/\.$//' > conftest
-)
-libltdl_cv_shlibext=`cat conftest`
-rm -f conftest
+echo "$as_me:$LINENO: checking which extension is used for loadable modules" >&5
+echo $ECHO_N "checking which extension is used for loadable modules... $ECHO_C" >&6
+if test "${libltdl_cv_shlibext+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
-fi
+# Here in libltdl for libgcj we don't build modules for darwin.
+# So we say no. Then the extension gets .dylib which is the right
+# thing for shared libraries on darwin.
+case "$host_os" in
+darwin*)
+ module=no
+ ;;
+*)
+ module=yes
+ ;;
+esac
+eval libltdl_cv_shlibext=$shrext
-echo "$ac_t""$libltdl_cv_shlibext" 1>&6
+fi
+echo "$as_me:$LINENO: result: $libltdl_cv_shlibext" >&5
+echo "${ECHO_T}$libltdl_cv_shlibext" >&6
if test -n "$libltdl_cv_shlibext"; then
- cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define LTDL_SHLIB_EXT "$libltdl_cv_shlibext"
-EOF
+_ACEOF
fi
-echo $ac_n "checking which variable specifies run-time library path""... $ac_c" 1>&6
-echo "configure:2919: 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
+
+echo "$as_me:$LINENO: checking which variable specifies run-time library path" >&5
+echo $ECHO_N "checking which variable specifies run-time library path... $ECHO_C" >&6
+if test "${libltdl_cv_shlibpath_var+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
libltdl_cv_shlibpath_var="$shlibpath_var"
fi
-
-echo "$ac_t""$libltdl_cv_shlibpath_var" 1>&6
+echo "$as_me:$LINENO: result: $libltdl_cv_shlibpath_var" >&5
+echo "${ECHO_T}$libltdl_cv_shlibpath_var" >&6
if test -n "$libltdl_cv_shlibpath_var"; then
- cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define LTDL_SHLIBPATH_VAR "$libltdl_cv_shlibpath_var"
-EOF
+_ACEOF
fi
-echo $ac_n "checking for the default library search path""... $ac_c" 1>&6
-echo "configure:2935: 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
+
+echo "$as_me:$LINENO: checking for the default library search path" >&5
+echo $ECHO_N "checking for the default library search path... $ECHO_C" >&6
+if test "${libltdl_cv_sys_search_path+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
libltdl_cv_sys_search_path="$sys_lib_dlsearch_path_spec"
fi
-
-echo "$ac_t""$libltdl_cv_sys_search_path" 1>&6
+echo "$as_me:$LINENO: result: $libltdl_cv_sys_search_path" >&5
+echo "${ECHO_T}$libltdl_cv_sys_search_path" >&6
if test -n "$libltdl_cv_sys_search_path"; then
- case "$host" in
- *-*-mingw*) pathsep=";" ;;
- *) pathsep=":" ;;
- esac
sys_search_path=
for dir in $libltdl_cv_sys_search_path; do
if test -z "$sys_search_path"; then
sys_search_path="$dir"
else
- sys_search_path="$sys_search_path$pathsep$dir"
+ sys_search_path="$sys_search_path$PATH_SEPARATOR$dir"
fi
done
- cat >> confdefs.h <<EOF
+
+cat >>confdefs.h <<_ACEOF
#define LTDL_SYSSEARCHPATH "$sys_search_path"
-EOF
+_ACEOF
fi
-echo $ac_n "checking for objdir""... $ac_c" 1>&6
-echo "configure:2963: checking for objdir" >&5
-if eval "test \"`echo '$''{'libltdl_cv_objdir'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+echo "$as_me:$LINENO: checking for objdir" >&5
+echo $ECHO_N "checking for objdir... $ECHO_C" >&6
+if test "${libltdl_cv_objdir+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
libltdl_cv_objdir="$objdir"
-if test -n "$objdir"; then
- :
-else
- rm -f .libs 2>/dev/null
- mkdir .libs 2>/dev/null
- if test -d .libs; then
- libltdl_cv_objdir=.libs
+ if test -n "$objdir"; then
+ :
else
- # MS-DOS does not allow filenames that begin with a dot.
- libltdl_cv_objdir=_libs
+ rm -f .libs 2>/dev/null
+ mkdir .libs 2>/dev/null
+ if test -d .libs; then
+ libltdl_cv_objdir=.libs
+ else
+ # MS-DOS does not allow filenames that begin with a dot.
+ libltdl_cv_objdir=_libs
+ fi
+ rmdir .libs 2>/dev/null
fi
-rmdir .libs 2>/dev/null
-fi
+
fi
+echo "$as_me:$LINENO: result: $libltdl_cv_objdir" >&5
+echo "${ECHO_T}$libltdl_cv_objdir" >&6
-echo "$ac_t""$libltdl_cv_objdir" 1>&6
-cat >> confdefs.h <<EOF
+cat >>confdefs.h <<_ACEOF
#define LTDL_OBJDIR "$libltdl_cv_objdir/"
-EOF
+_ACEOF
-echo $ac_n "checking whether libtool supports -dlopen/-dlpreopen""... $ac_c" 1>&6
-echo "configure:2990: 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
+
+echo "$as_me:$LINENO: checking whether libtool supports -dlopen/-dlpreopen" >&5
+echo $ECHO_N "checking whether libtool supports -dlopen/-dlpreopen... $ECHO_C" >&6
+if test "${libltdl_cv_preloaded_symbols+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- if test -n "$global_symbol_pipe"; then
+ if test -n "$lt_cv_sys_global_symbol_pipe"; then
libltdl_cv_preloaded_symbols=yes
else
libltdl_cv_preloaded_symbols=no
fi
fi
+echo "$as_me:$LINENO: result: $libltdl_cv_preloaded_symbols" >&5
+echo "${ECHO_T}$libltdl_cv_preloaded_symbols" >&6
+if test x"$libltdl_cv_preloaded_symbols" = xyes; then
-echo "$ac_t""$libltdl_cv_preloaded_symbols" 1>&6
-if test x"$libltdl_cv_preloaded_symbols" = x"yes"; then
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_PRELOADED_SYMBOLS 1
-EOF
+_ACEOF
fi
LIBADD_DL=
-echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
-echo "configure:3012: 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
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+echo "$as_me:$LINENO: checking for shl_load" >&5
+echo $ECHO_N "checking for shl_load... $ECHO_C" >&6
+if test "${ac_cv_func_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- ac_save_LIBS="$LIBS"
-LIBS="-ldl $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3020 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char shl_load (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen();
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+/* 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_shl_load) || defined (__stub___shl_load)
+choke me
+#else
+char (*f) () = shl_load;
+#endif
+#ifdef __cplusplus
+}
+#endif
-int main() {
-dlopen()
-; return 0; }
-EOF
-if { (eval echo configure:3031: \"$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"
+int
+main ()
+{
+return f != shl_load;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func_shl_load=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_func_shl_load=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_LIBDL 1
-EOF
- LIBADD_DL="-ldl"
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5
+echo "${ECHO_T}$ac_cv_func_shl_load" >&6
+if test $ac_cv_func_shl_load = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SHL_LOAD 1
+_ACEOF
+
else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dlopen""... $ac_c" 1>&6
-echo "configure:3053: checking for dlopen" >&5
-if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then
- echo $ac_n "(cached) $ac_c" 1>&6
+ echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5
+echo $ECHO_N "checking for shl_load in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_shl_load+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3058 "configure"
-#include "confdefs.h"
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char dlopen(); below. */
-#include <assert.h>
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen();
+ builtin and then its argument prototype would still apply. */
+char shl_load ();
+int
+main ()
+{
+shl_load ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_shl_load=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
-int main() {
+ac_cv_lib_dld_shl_load=no
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_shl_load" >&6
+if test $ac_cv_lib_dld_shl_load = yes; then
-/* 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_dlopen) || defined (__stub___dlopen)
-choke me
-#else
-dlopen();
-#endif
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SHL_LOAD 1
+_ACEOF
-; return 0; }
-EOF
-if { (eval echo configure:3081: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
- rm -rf conftest*
- eval "ac_cv_func_dlopen=yes"
+ LIBADD_DL="$LIBADD_DL -ldld"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_dlopen=no"
+ echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
+echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
+if test "${ac_cv_lib_dl_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dl_dlopen=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_dl_dlopen=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
+if test $ac_cv_lib_dl_dlopen = yes; then
-if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBDL 1
-EOF
+_ACEOF
+ LIBADD_DL="-ldl" libltdl_cv_lib_dl_dlopen="yes"
else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for dlopen in -lsvld""... $ac_c" 1>&6
-echo "configure:3102: 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
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if HAVE_DLFCN_H
+# include <dlfcn.h>
+#endif
+
+int
+main ()
+{
+dlopen(0, 0);
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_LIBDL 1
+_ACEOF
+ libltdl_cv_func_dlopen="yes"
else
- ac_save_LIBS="$LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5
+echo $ECHO_N "checking for dlopen in -lsvld... $ECHO_C" >&6
+if test "${ac_cv_lib_svld_dlopen+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3110 "configure"
-#include "confdefs.h"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char dlopen();
-
-int main() {
-dlopen()
-; return 0; }
-EOF
-if { (eval echo configure:3121: \"$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"
+ builtin and then its argument prototype would still apply. */
+char dlopen ();
+int
+main ()
+{
+dlopen ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_svld_dlopen=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_svld_dlopen=no
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5
+echo "${ECHO_T}$ac_cv_lib_svld_dlopen" >&6
+if test $ac_cv_lib_svld_dlopen = yes; then
+
+cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBDL 1
-EOF
- LIBADD_DL="-lsvld"
+_ACEOF
+ LIBADD_DL="-lsvld" libltdl_cv_func_dlopen="yes"
else
- echo "$ac_t""no" 1>&6
-fi
+ echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5
+echo $ECHO_N "checking for dld_link in -ldld... $ECHO_C" >&6
+if test "${ac_cv_lib_dld_dld_link+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
-fi
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char dld_link ();
+int
+main ()
+{
+dld_link ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_dld_dld_link=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ac_cv_lib_dld_dld_link=no
fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5
+echo "${ECHO_T}$ac_cv_lib_dld_dld_link" >&6
+if test $ac_cv_lib_dld_dld_link = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DLD 1
+_ACEOF
-echo $ac_n "checking for shl_load""... $ac_c" 1>&6
-echo "configure:3150: 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
+ LIBADD_DL="$LIBADD_DL -ldld"
else
- cat > conftest.$ac_ext <<EOF
-#line 3155 "configure"
-#include "confdefs.h"
+ echo "$as_me:$LINENO: checking for _dyld_func_lookup" >&5
+echo $ECHO_N "checking for _dyld_func_lookup... $ECHO_C" >&6
+if test "${ac_cv_func__dyld_func_lookup+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char shl_load(); below. */
-#include <assert.h>
+ which can conflict with char _dyld_func_lookup (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* We use char because int might match the return type of a gcc2
- builtin and then its argument prototype would still apply. */
-char shl_load();
-
-int main() {
-
+ builtin and then its argument prototype would still apply. */
+char _dyld_func_lookup ();
/* 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_shl_load) || defined (__stub___shl_load)
+#if defined (__stub__dyld_func_lookup) || defined (__stub____dyld_func_lookup)
choke me
#else
-shl_load();
+char (*f) () = _dyld_func_lookup;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:3178: \"$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"
+int
+main ()
+{
+return f != _dyld_func_lookup;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_func__dyld_func_lookup=yes
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_shl_load=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_func__dyld_func_lookup=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: $ac_cv_func__dyld_func_lookup" >&5
+echo "${ECHO_T}$ac_cv_func__dyld_func_lookup" >&6
+if test $ac_cv_func__dyld_func_lookup = yes; then
-if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_SHL_LOAD 1
-EOF
-
-else
- echo "$ac_t""no" 1>&6
-echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6
-echo "configure:3199: 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
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldld $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3207 "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
- builtin and then its argument prototype would still apply. */
-char shl_load();
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DYLD 1
+_ACEOF
-int main() {
-shl_load()
-; return 0; }
-EOF
-if { (eval echo configure:3218: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_SHL_LOAD 1
-EOF
- LIBADD_DL="$LIBADD_DL -ldld"
-else
- echo "$ac_t""no" 1>&6
fi
fi
-echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6
-echo "configure:3246: 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
-else
- ac_save_LIBS="$LIBS"
-LIBS="-ldld $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 3254 "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
- builtin and then its argument prototype would still apply. */
-char dld_link();
-int main() {
-dld_link()
-; return 0; }
-EOF
-if { (eval echo configure:3265: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_lib_$ac_lib_var=no"
fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
- echo "$ac_t""yes" 1>&6
- cat >> confdefs.h <<\EOF
-#define HAVE_DLD 1
-EOF
-test "x$ac_cv_lib_dld_shl_load" = yes || LIBADD_DL="$LIBADD_DL -ldld"
-else
- echo "$ac_t""no" 1>&6
+
+
+fi
+
+
fi
+if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
+then
+ lt_save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
-if test "x$ac_cv_func_dlopen" = xyes || test "x$ac_cv_lib_dl_dlopen" = xyes; then
- LIBS_SAVE="$LIBS"
- LIBS="$LIBS $LIBADD_DL"
- for ac_func in dlerror
+for ac_func in dlerror
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3296: 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
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3301 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* 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() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:3324: \"$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"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-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
- LIBS="$LIBS_SAVE"
+ LIBS="$lt_save_LIBS"
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
-echo $ac_n "checking for _ prefix in compiled symbols""... $ac_c" 1>&6
-echo "configure:3352: 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
+echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5
+echo $ECHO_N "checking for _ prefix in compiled symbols... $ECHO_C" >&6
+if test "${ac_cv_sys_symbol_underscore+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_sys_symbol_underscore=no
-cat > conftest.$ac_ext <<EOF
+ cat > conftest.$ac_ext <<EOF
void nm_test_func(){}
int main(){nm_test_func;return 0;}
EOF
-if { (eval echo configure:3361: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
- # Now try to grab the symbols.
- ac_nlist=conftest.nm
- if { (eval echo configure:3364: \"$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
- :
+ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; then
+ # Now try to grab the symbols.
+ ac_nlist=conftest.nm
+ if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5
+ (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s "$ac_nlist"; then
+ # See whether the symbols have a leading underscore.
+ if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
+ ac_cv_sys_symbol_underscore=yes
else
- echo "configure: cannot find nm_test_func in $ac_nlist" >&5
+ if grep '^. 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 $lt_cv_sys_global_symbol_pipe" >&5
fi
else
- echo "configure: cannot run $ac_cv_sys_global_symbol_pipe" >&5
+ echo "configure: failed program was:" >&5
+ cat conftest.c >&5
fi
-else
- echo "configure: failed program was:" >&5
- cat conftest.c >&5
-fi
-rm -rf conftest*
+ rm -rf conftest*
fi
+echo "$as_me:$LINENO: result: $ac_cv_sys_symbol_underscore" >&5
+echo "${ECHO_T}$ac_cv_sys_symbol_underscore" >&6
+
-echo "$ac_t""$ac_cv_sys_symbol_underscore" 1>&6
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:3391: 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
- if test "$cross_compiling" = yes; then
+ if test x"$libltdl_cv_func_dlopen" = xyes ||
+ test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
+ echo "$as_me:$LINENO: checking whether we have to add an underscore for dlsym" >&5
+echo $ECHO_N "checking whether we have to add an underscore for dlsym... $ECHO_C" >&6
+if test "${libltdl_cv_need_uscore+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ libltdl_cv_need_uscore=unknown
+ save_LIBS="$LIBS"
+ LIBS="$LIBS $LIBADD_DL"
+ if test "$cross_compiling" = yes; then :
libltdl_cv_need_uscore=cross
-
else
+ lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+ lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 3400 "configure"
+#line 19761 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -3406,718 +19768,2738 @@ else
#include <stdio.h>
#ifdef RTLD_GLOBAL
-# define LTDL_GLOBAL RTLD_GLOBAL
+# define LT_DLGLOBAL RTLD_GLOBAL
#else
-# ifdef DL_GLOBAL
-# define LTDL_GLOBAL DL_GLOBAL
-# else
-# define LTDL_GLOBAL 0
-# endif
+# ifdef DL_GLOBAL
+# define LT_DLGLOBAL DL_GLOBAL
+# else
+# define LT_DLGLOBAL 0
+# endif
#endif
-/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
-#ifndef LTDL_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LTDL_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LTDL_LAZY_OR_NOW DL_LAZY
+#ifndef LT_DLLAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_DLLAZY_OR_NOW RTLD_LAZY
# else
-# ifdef RTLD_NOW
-# define LTDL_LAZY_OR_NOW RTLD_NOW
-# else
-# ifdef DL_NOW
-# define LTDL_LAZY_OR_NOW DL_NOW
+# ifdef DL_LAZY
+# define LT_DLLAZY_OR_NOW DL_LAZY
# else
-# define LTDL_LAZY_OR_NOW 0
+# ifdef RTLD_NOW
+# define LT_DLLAZY_OR_NOW RTLD_NOW
+# else
+# ifdef DL_NOW
+# define LT_DLLAZY_OR_NOW DL_NOW
+# else
+# define LT_DLLAZY_OR_NOW 0
+# endif
+# endif
# endif
-# endif
# endif
-# endif
#endif
-fnord() { int i=42;}
-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); }
+#ifdef __cplusplus
+extern "C" void exit (int);
+#endif
+
+void fnord() { int i=42;}
+int main ()
+{
+ void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+ int status = $lt_dlunknown;
+
+ if (self)
+ {
+ if (dlsym (self,"fnord")) status = $lt_dlno_uscore;
+ else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore;
+ /* dlclose (self); */
+ }
+ exit (status);
+}
EOF
-if { (eval echo configure:3447: \"$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
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -fr conftest*
- libltdl_cv_need_uscore=yes
+ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then
+ (./conftest; exit; ) 2>/dev/null
+ lt_status=$?
+ case x$lt_status in
+ x$lt_dlno_uscore) libltdl_cv_need_uscore=no ;;
+ x$lt_dlneed_uscore) libltdl_cv_need_uscore=yes ;;
+ x$lt_unknown|x*) ;;
+ esac
+ else :
+ # compilation failed
+
+ fi
fi
rm -fr conftest*
-fi
-fi
+ LIBS="$save_LIBS"
-echo "$ac_t""$libltdl_cv_need_uscore" 1>&6
+fi
+echo "$as_me:$LINENO: result: $libltdl_cv_need_uscore" >&5
+echo "${ECHO_T}$libltdl_cv_need_uscore" >&6
fi
fi
if test x"$libltdl_cv_need_uscore" = xyes; then
- cat >> confdefs.h <<\EOF
+
+cat >>confdefs.h <<\_ACEOF
#define NEED_USCORE 1
-EOF
+_ACEOF
fi
+echo "$as_me:$LINENO: checking whether deplibs are loaded by dlopen" >&5
+echo $ECHO_N "checking whether deplibs are loaded by dlopen... $ECHO_C" >&6
+if test "${libltdl_cv_sys_dlopen_deplibs+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ # PORTME does your system automatically load deplibs for dlopen?
+ # or its logical equivalent (e.g. shl_load for HP-UX < 11)
+ # For now, we just catch OSes we know something about -- in the
+ # future, we'll try test this programmatically.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ case "$host_os" in
+ aix3*|aix4.1.*|aix4.2.*)
+ # Unknown whether this is true for these versions of AIX, but
+ # we want this `case' here to explicitly catch those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ aix[45]*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ darwin*)
+ # Assuming the user has installed a libdl from somewhere, this is true
+ # If you are looking for one http://www.opendarwin.org/projects/dlcompat
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ gnu*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ hpux10*|hpux11*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ irix[12345]*|irix6.[01]*)
+ # Catch all versions of IRIX before 6.2, and indicate that we don't
+ # know how it worked for any of those versions.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ irix*)
+ # The case above catches anything before 6.2, and it's known that
+ # at 6.2 and later dlopen does load deplibs.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ linux*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ netbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ openbsd*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ osf[1234]*)
+ # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
+ # it did *not* use an RPATH in a shared library to find objects the
+ # library depends on, so we explictly say `no'.
+ libltdl_cv_sys_dlopen_deplibs=no
+ ;;
+ osf5.0|osf5.0a|osf5.1)
+ # dlopen *does* load deplibs and with the right loader patch applied
+ # it even uses RPATH in a shared library to search for shared objects
+ # that the library depends on, but there's no easy way to know if that
+ # patch is installed. Since this is the case, all we can really
+ # say is unknown -- it depends on the patch being installed. If
+ # it is, this changes to `yes'. Without it, it would be `no'.
+ libltdl_cv_sys_dlopen_deplibs=unknown
+ ;;
+ osf*)
+ # the two cases above should catch all versions of osf <= 5.1. Read
+ # the comments above for what we know about them.
+ # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
+ # is used to find them so we can finally say `yes'.
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ solaris*)
+ libltdl_cv_sys_dlopen_deplibs=yes
+ ;;
+ esac
+
+fi
+echo "$as_me:$LINENO: result: $libltdl_cv_sys_dlopen_deplibs" >&5
+echo "${ECHO_T}$libltdl_cv_sys_dlopen_deplibs" >&6
+if test "$libltdl_cv_sys_dlopen_deplibs" != yes; then
+cat >>confdefs.h <<\_ACEOF
+#define LTDL_DLOPEN_DEPLIBS 1
+_ACEOF
-for ac_hdr in malloc.h memory.h stdlib.h stdio.h ctype.h dlfcn.h dl.h dld.h
+fi
+
+
+for ac_header in argz.h
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3479: 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
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3484 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3489: \"$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"
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=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"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
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
-
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
else
- echo "$ac_t""no" 1>&6
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
done
-for ac_hdr in string.h strings.h
+
+echo "$as_me:$LINENO: checking for error_t" >&5
+echo $ECHO_N "checking for error_t... $ECHO_C" >&6
+if test "${ac_cv_type_error_t+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#if HAVE_ARGZ_H
+# include <argz.h>
+#endif
+
+int
+main ()
+{
+if ((error_t *) 0)
+ return 0;
+if (sizeof (error_t))
+ return 0;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_type_error_t=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_type_error_t=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: $ac_cv_type_error_t" >&5
+echo "${ECHO_T}$ac_cv_type_error_t" >&6
+if test $ac_cv_type_error_t = yes; then
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ERROR_T 1
+_ACEOF
+
+
+else
+
+cat >>confdefs.h <<\_ACEOF
+#define error_t int
+_ACEOF
+
+fi
+
+
+
+
+
+
+
+for ac_func in argz_append argz_create_sep argz_insert argz_next argz_stringify
do
-ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
-echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6
-echo "configure:3519: 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
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3524 "configure"
-#include "confdefs.h"
-#include <$ac_hdr>
-EOF
-ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3529: \"$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"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* 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 ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=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"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
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
- break
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+for ac_header in assert.h ctype.h errno.h malloc.h memory.h stdlib.h \
+ stdio.h unistd.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+for ac_header in dl.h sys/dl.h dld.h mach-o/dyld.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
else
- echo "$ac_t""no" 1>&6
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+for ac_header in string.h strings.h
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+else
+ # Is the header compilable?
+echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest.$ac_objext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_header_compiler=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_header_compiler=no
+fi
+rm -f conftest.$ac_objext conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6
+
+# Is the header present?
+echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6
+cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+#include <$ac_header>
+_ACEOF
+if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
+ (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } >/dev/null; then
+ if test -s conftest.err; then
+ ac_cpp_err=$ac_c_preproc_warn_flag
+ else
+ ac_cpp_err=
+ fi
+else
+ ac_cpp_err=yes
+fi
+if test -z "$ac_cpp_err"; then
+ ac_header_preproc=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ ac_header_preproc=no
+fi
+rm -f conftest.err conftest.$ac_ext
+echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6
+
+# So? What about this header?
+case $ac_header_compiler:$ac_header_preproc in
+ yes:no )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+ no:yes )
+ { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;}
+ { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+ (
+ cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to bug-autoconf@gnu.org. ##
+## ------------------------------------ ##
+_ASBOX
+ ) |
+ sed "s/^/$as_me: WARNING: /" >&2
+ ;;
+esac
+echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6
+if eval "test \"\${$as_ac_Header+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ eval "$as_ac_Header=$ac_header_preproc"
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ break
fi
+
done
+
+
+
for ac_func in strchr index
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3558: 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
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3563 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* 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() {
-
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:3586: \"$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"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
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
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
break
-else
- echo "$ac_t""no" 1>&6
fi
done
+
+
for ac_func in strrchr rindex
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3613: 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
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3618 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* 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();
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
+
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ break
+fi
+done
-int main() {
+
+for ac_func in memcpy bcopy
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* 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 ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:3641: \"$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"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
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
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
break
-else
- echo "$ac_t""no" 1>&6
fi
done
-for ac_func in strcmp
+
+
+for ac_func in memmove strcmp
do
-echo $ac_n "checking for $ac_func""... $ac_c" 1>&6
-echo "configure:3668: 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
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
else
- cat > conftest.$ac_ext <<EOF
-#line 3673 "configure"
-#include "confdefs.h"
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func(); below. */
-#include <assert.h>
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
/* 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();
+ builtin and then its argument prototype would still apply. */
+char $ac_func ();
+/* 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
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
+#endif
-int main() {
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
+fi
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
+fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+fi
+done
+
+
+
+
+for ac_func in closedir opendir readdir
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
+if eval "test \"\${$as_ac_var+set}\" = set"; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ cat >conftest.$ac_ext <<_ACEOF
+#line $LINENO "configure"
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+/* System header to define __stub macros and hopefully few prototypes,
+ which can conflict with char $ac_func (); below.
+ Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+ <limits.h> exists even on freestanding compilers. */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+/* 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 ();
/* 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();
+char (*f) () = $ac_func;
+#endif
+#ifdef __cplusplus
+}
#endif
-; return 0; }
-EOF
-if { (eval echo configure:3696: \"$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"
+int
+main ()
+{
+return f != $ac_func;
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ eval "$as_ac_var=yes"
else
- echo "configure: failed program was:" >&5
- cat conftest.$ac_ext >&5
- rm -rf conftest*
- eval "ac_cv_func_$ac_func=no"
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+eval "$as_ac_var=no"
fi
-rm -f conftest*
+rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
+echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
+echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
-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
-trap '' 1 2 15
-cat > confcache <<\EOF
+## -------- ##
+## Outputs. ##
+## -------- ##
+ ac_config_files="$ac_config_files Makefile"
+
+cat >confcache <<\_ACEOF
# 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.
+# scripts and configure runs, see configure's option --config-cache.
+# 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.
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
#
-EOF
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
# 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
+{
+ (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 \
+ "s/'/'\\\\''/g;
+ s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+ ;;
+ *)
+ # `set' quotes correctly as required by POSIX, so do not add quotes.
+ sed -n \
+ "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p"
+ ;;
+ esac;
+} |
+ sed '
+ t clear
+ : clear
+ s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+ t end
+ /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+ : end' >>confcache
+if diff $cache_file confcache >/dev/null 2>&1; then :; else
if test -w $cache_file; then
- echo "updating cache $cache_file"
- cat confcache > $cache_file
+ test "x$cache_file" != "x/dev/null" && 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.
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
if test "x$srcdir" = x.; then
- ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d'
+ ac_vpsub='/^[ ]*VPATH[ ]*=/{
+s/:*\$(srcdir):*/:/;
+s/:*\${srcdir}:*/:/;
+s/:*@srcdir@:*/:/;
+s/^\([^=]*=[ ]*\):*/\1/;
+s/:*$//;
+s/^[^=]*=[ ]*$//;
+}'
fi
-trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
-
DEFS=-DHAVE_CONFIG_H
-# Without the "./", some shells look in PATH for config.status.
-: ${CONFIG_STATUS=./config.status}
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+ # 1. Remove the extension, and $U if already installed.
+ ac_i=`echo "$ac_i" |
+ sed 's/\$U\././;s/\.o$//;s/\.obj$//'`
+ # 2. Add them.
+ ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext"
+ ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
-echo creating $CONFIG_STATUS
-rm -f $CONFIG_STATUS
-cat > $CONFIG_STATUS <<EOF
-#! /bin/sh
-# Generated automatically by configure.
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${INSTALL_LTDL_TRUE}" && test -z "${INSTALL_LTDL_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"INSTALL_LTDL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"INSTALL_LTDL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+if test -z "${CONVENIENCE_LTDL_TRUE}" && test -z "${CONVENIENCE_LTDL_FALSE}"; then
+ { { echo "$as_me:$LINENO: error: conditional \"CONVENIENCE_LTDL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"CONVENIENCE_LTDL\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+ { (exit 1); exit 1; }; }
+fi
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
# 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.
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization. ##
+## --------------------- ##
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+ emulate sh
+ NULLCMD=:
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # is contrary to our usage. Disable this feature.
+ alias -g '${1+"$@"}'='"$@"'
+elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then
+ set -o posix
+fi
-ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
-for ac_option
+# Support unset when possible.
+if (FOO=FOO; unset FOO) >/dev/null 2>&1; then
+ as_unset=unset
+else
+ as_unset=false
+fi
+
+
+# Work around bugs in pre-3.0 UWIN ksh.
+$as_unset ENV MAIL MAILPATH
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+ LC_TELEPHONE LC_TIME
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
+ if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then
+ eval $as_var=C; export $as_var
+ else
+ $as_unset $as_var
+ fi
done
-ac_given_srcdir=$srcdir
-ac_given_INSTALL="$INSTALL"
-
-trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
-EOF
-cat >> $CONFIG_STATUS <<EOF
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
-# 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%@mkinstalldirs@%$mkinstalldirs%g
-s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
-s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
-s%@INSTALL_DATA@%$INSTALL_DATA%g
-s%@PACKAGE@%$PACKAGE%g
-s%@VERSION@%$VERSION%g
-s%@ACLOCAL@%$ACLOCAL%g
-s%@AUTOCONF@%$AUTOCONF%g
-s%@AUTOMAKE@%$AUTOMAKE%g
-s%@AUTOHEADER@%$AUTOHEADER%g
-s%@MAKEINFO@%$MAKEINFO%g
-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%@CC@%$CC%g
-s%@host@%$host%g
-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%@LN_S@%$LN_S%g
-s%@OBJEXT@%$OBJEXT%g
-s%@EXEEXT@%$EXEEXT%g
-s%@RANLIB@%$RANLIB%g
-s%@STRIP@%$STRIP%g
-s%@DLLTOOL@%$DLLTOOL%g
-s%@AS@%$AS%g
-s%@OBJDUMP@%$OBJDUMP%g
-s%@LIBTOOL@%$LIBTOOL%g
-s%@LIBTOOL_DEPS@%$LIBTOOL_DEPS%g
-s%@GCINCS@%$GCINCS%g
-s%@CPP@%$CPP%g
-s%@INSTALL_LTDL_TRUE@%$INSTALL_LTDL_TRUE%g
-s%@INSTALL_LTDL_FALSE@%$INSTALL_LTDL_FALSE%g
-s%@CONVENIENCE_LTDL_TRUE@%$CONVENIENCE_LTDL_TRUE%g
-s%@CONVENIENCE_LTDL_FALSE@%$CONVENIENCE_LTDL_FALSE%g
-s%@LIBADD_DL@%$LIBADD_DL%g
+if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then
+ as_basename=basename
+else
+ as_basename=false
+fi
-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
+# Name of the executable.
+as_me=`$as_basename "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+ X"$0" : 'X\(//\)$' \| \
+ X"$0" : 'X\(/\)$' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X/"$0" |
+ sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; }
+ /^X\/\(\/\/\)$/{ s//\1/; q; }
+ /^X\/\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+
+
+# PATH needs CR, and LINENO needs CR and PATH.
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+ echo "#! /bin/sh" >conf$$.sh
+ echo "exit 0" >>conf$$.sh
+ chmod +x conf$$.sh
+ if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+ PATH_SEPARATOR=';'
else
- sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+ PATH_SEPARATOR=:
fi
- if test ! -s conftest.s$ac_file; then
- ac_more_lines=false
- rm -f conftest.s$ac_file
+ rm -f conf$$.sh
+fi
+
+
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" || {
+ # Find who we are. Look in the path if we contain no path at all
+ # relative or not.
+ case $0 in
+ *[\\/]* ) as_myself=$0 ;;
+ *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+
+ ;;
+ esac
+ # We did not find ourselves, most probably we were run as `sh COMMAND'
+ # in which case we are not to be found in the path.
+ if test "x$as_myself" = x; then
+ as_myself=$0
+ fi
+ if test ! -f "$as_myself"; then
+ { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5
+echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;}
+ { (exit 1); exit 1; }; }
+ fi
+ case $CONFIG_SHELL in
+ '')
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for as_base in sh bash ksh sh5; do
+ case $as_dir in
+ /*)
+ if ("$as_dir/$as_base" -c '
+ as_lineno_1=$LINENO
+ as_lineno_2=$LINENO
+ as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null`
+ test "x$as_lineno_1" != "x$as_lineno_2" &&
+ test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then
+ $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; }
+ $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; }
+ CONFIG_SHELL=$as_dir/$as_base
+ export CONFIG_SHELL
+ exec "$CONFIG_SHELL" "$0" ${1+"$@"}
+ fi;;
+ esac
+ done
+done
+;;
+ esac
+
+ # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+ # uniformly replaced by the line number. The first 'sed' inserts a
+ # line-number line before each line; the second 'sed' does the real
+ # work. The second script uses 'N' to pair each line-number line
+ # with the numbered line, and appends trailing '-' during
+ # substitution so that $LINENO is not a special case at line end.
+ # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+ # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-)
+ sed '=' <$as_myself |
+ sed '
+ N
+ s,$,-,
+ : loop
+ s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3,
+ t loop
+ s,-$,,
+ s,^['$as_cr_digits']*\n,,
+ ' >$as_me.lineno &&
+ chmod +x $as_me.lineno ||
+ { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5
+echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;}
+ { (exit 1); exit 1; }; }
+
+ # Don't try to exec as it changes $[0], causing all sort of problems
+ # (the dirname of $[0] is not the place where we might find the
+ # original and so on. Autoconf is especially sensible to this).
+ . ./$as_me.lineno
+ # Exit status is that of the last command.
+ exit
+}
+
+
+case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
+ *c*,-n*) ECHO_N= ECHO_C='
+' ECHO_T=' ' ;;
+ *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;;
+ *) ECHO_N= ECHO_C='\c' ECHO_T= ;;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1; then
+ as_expr=expr
+else
+ as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+ # We could just check for DJGPP; but this test a) works b) is more generic
+ # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04).
+ if test -f conf$$.exe; then
+ # Don't use ln at all; we don't have any links
+ as_ln_s='cp -p'
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`
+ as_ln_s='ln -s'
fi
+elif ln conf$$.file conf$$ 2>/dev/null; then
+ as_ln_s=ln
+else
+ as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.file
+
+if mkdir -p . 2>/dev/null; then
+ as_mkdir_p=:
+else
+ as_mkdir_p=false
+fi
+
+as_executable_p="test -f"
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g"
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.
+as_nl='
+'
+IFS=" $as_nl"
+
+# CDPATH.
+$as_unset CDPATH
+
+exec 6>&1
+
+# Open the log real soon, to keep \$[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling. Logging --version etc. is OK.
+exec 5>>config.log
+{
+ echo
+ sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+} >&5
+cat >&5 <<_CSEOF
+
+This file was extended by libltdl $as_me 1.2, which was
+generated by GNU Autoconf 2.57. Invocation command line was
+
+ CONFIG_FILES = $CONFIG_FILES
+ CONFIG_HEADERS = $CONFIG_HEADERS
+ CONFIG_LINKS = $CONFIG_LINKS
+ CONFIG_COMMANDS = $CONFIG_COMMANDS
+ $ $0 $@
+
+_CSEOF
+echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5
+echo >&5
+_ACEOF
+
+# Files that config.status was made for.
+if test -n "$ac_config_files"; then
+ echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_headers"; then
+ echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_links"; then
+ echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS
+fi
+
+if test -n "$ac_config_commands"; then
+ echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+ -h, --help print this help, then exit
+ -V, --version print version number, then exit
+ -q, --quiet do not print progress messages
+ -d, --debug don't remove temporary files
+ --recheck update $as_me by reconfiguring in the same conditions
+ --file=FILE[:TEMPLATE]
+ instantiate the configuration file FILE
+ --header=FILE[:TEMPLATE]
+ instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <bug-autoconf@gnu.org>."
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+libltdl config.status 1.2
+configured by $0, generated by GNU Autoconf 2.57,
+ with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001
+Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+srcdir=$srcdir
+INSTALL="$INSTALL"
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value. By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+ case $1 in
+ --*=*)
+ ac_option=`expr "x$1" : 'x\([^=]*\)='`
+ ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'`
+ ac_shift=:
+ ;;
+ -*)
+ ac_option=$1
+ ac_optarg=$2
+ ac_shift=shift
+ ;;
+ *) # This is not an option, so the user has probably given explicit
+ # arguments.
+ ac_option=$1
+ ac_need_defaults=false;;
+ esac
+
+ case $ac_option in
+ # Handling of the options.
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ ac_cs_recheck=: ;;
+ --version | --vers* | -V )
+ echo "$ac_cs_version"; exit 0 ;;
+ --he | --h)
+ # Conflict between --help and --header
+ { { echo "$as_me:$LINENO: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; };;
+ --help | --hel | -h )
+ echo "$ac_cs_usage"; exit 0 ;;
+ --debug | --d* | -d )
+ debug=: ;;
+ --file | --fil | --fi | --f )
+ $ac_shift
+ CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+ ac_need_defaults=false;;
+ --header | --heade | --head | --hea )
+ $ac_shift
+ CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+ ac_need_defaults=false;;
+ -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+ | -silent | --silent | --silen | --sile | --sil | --si | --s)
+ ac_cs_silent=: ;;
+
+ # This is an error.
+ -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&5
+echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2;}
+ { (exit 1); exit 1; }; } ;;
+
+ *) ac_config_targets="$ac_config_targets $1" ;;
+
+ esac
+ shift
done
-if test -z "$ac_sed_cmds"; then
- ac_sed_cmds=cat
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+ exec 6>/dev/null
+ ac_configure_extra_args="$ac_configure_extra_args --silent"
fi
-EOF
-cat >> $CONFIG_STATUS <<EOF
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+ echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+ exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
-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" ;;
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+#
+# INIT-COMMANDS section.
+#
+
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+_ACEOF
+
+
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_config_target in $ac_config_targets
+do
+ case "$ac_config_target" in
+ # Handling of arguments.
+ "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+ "depfiles" ) CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+ "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config-h.in" ;;
+ *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+ { (exit 1); exit 1; }; };;
esac
+done
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used. Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+ test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+ test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+ test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience. Make it in the build tree
+# simply because there is no reason to put it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Create a temporary directory, and hook for its removal unless debugging.
+$debug ||
+{
+ trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0
+ trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
- # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+# Create a (secure) tmp directory for tmp files.
- # 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=
+{
+ tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` &&
+ test -n "$tmp" && test -d "$tmp"
+} ||
+{
+ tmp=./confstat$$-$RANDOM
+ (umask 077 && mkdir $tmp)
+} ||
+{
+ echo "$me: cannot create a temporary directory in ." >&2
+ { (exit 1); exit 1; }
+}
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+
+#
+# CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "\$CONFIG_FILES"; then
+ # Protect against being on the right side of a sed subst in config.status.
+ sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g;
+ s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF
+s,@SHELL@,$SHELL,;t t
+s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t
+s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t
+s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t
+s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t
+s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t
+s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t
+s,@exec_prefix@,$exec_prefix,;t t
+s,@prefix@,$prefix,;t t
+s,@program_transform_name@,$program_transform_name,;t t
+s,@bindir@,$bindir,;t t
+s,@sbindir@,$sbindir,;t t
+s,@libexecdir@,$libexecdir,;t t
+s,@datadir@,$datadir,;t t
+s,@sysconfdir@,$sysconfdir,;t t
+s,@sharedstatedir@,$sharedstatedir,;t t
+s,@localstatedir@,$localstatedir,;t t
+s,@libdir@,$libdir,;t t
+s,@includedir@,$includedir,;t t
+s,@oldincludedir@,$oldincludedir,;t t
+s,@infodir@,$infodir,;t t
+s,@mandir@,$mandir,;t t
+s,@build_alias@,$build_alias,;t t
+s,@host_alias@,$host_alias,;t t
+s,@target_alias@,$target_alias,;t t
+s,@DEFS@,$DEFS,;t t
+s,@ECHO_C@,$ECHO_C,;t t
+s,@ECHO_N@,$ECHO_N,;t t
+s,@ECHO_T@,$ECHO_T,;t t
+s,@LIBS@,$LIBS,;t t
+s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t
+s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t
+s,@INSTALL_DATA@,$INSTALL_DATA,;t t
+s,@CYGPATH_W@,$CYGPATH_W,;t t
+s,@PACKAGE@,$PACKAGE,;t t
+s,@VERSION@,$VERSION,;t t
+s,@ACLOCAL@,$ACLOCAL,;t t
+s,@AUTOCONF@,$AUTOCONF,;t t
+s,@AUTOMAKE@,$AUTOMAKE,;t t
+s,@AUTOHEADER@,$AUTOHEADER,;t t
+s,@MAKEINFO@,$MAKEINFO,;t t
+s,@AMTAR@,$AMTAR,;t t
+s,@install_sh@,$install_sh,;t t
+s,@STRIP@,$STRIP,;t t
+s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t
+s,@INSTALL_STRIP_PROGRAM@,$INSTALL_STRIP_PROGRAM,;t t
+s,@AWK@,$AWK,;t t
+s,@SET_MAKE@,$SET_MAKE,;t t
+s,@am__leading_dot@,$am__leading_dot,;t t
+s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t
+s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t
+s,@MAINT@,$MAINT,;t t
+s,@CC@,$CC,;t t
+s,@CFLAGS@,$CFLAGS,;t t
+s,@LDFLAGS@,$LDFLAGS,;t t
+s,@CPPFLAGS@,$CPPFLAGS,;t t
+s,@ac_ct_CC@,$ac_ct_CC,;t t
+s,@EXEEXT@,$EXEEXT,;t t
+s,@OBJEXT@,$OBJEXT,;t t
+s,@DEPDIR@,$DEPDIR,;t t
+s,@am__include@,$am__include,;t t
+s,@am__quote@,$am__quote,;t t
+s,@AMDEP_TRUE@,$AMDEP_TRUE,;t t
+s,@AMDEP_FALSE@,$AMDEP_FALSE,;t t
+s,@AMDEPBACKSLASH@,$AMDEPBACKSLASH,;t t
+s,@CCDEPMODE@,$CCDEPMODE,;t t
+s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
+s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
+s,@build@,$build,;t t
+s,@build_cpu@,$build_cpu,;t t
+s,@build_vendor@,$build_vendor,;t t
+s,@build_os@,$build_os,;t t
+s,@host@,$host,;t t
+s,@host_cpu@,$host_cpu,;t t
+s,@host_vendor@,$host_vendor,;t t
+s,@host_os@,$host_os,;t t
+s,@EGREP@,$EGREP,;t t
+s,@LN_S@,$LN_S,;t t
+s,@ECHO@,$ECHO,;t t
+s,@AR@,$AR,;t t
+s,@ac_ct_AR@,$ac_ct_AR,;t t
+s,@RANLIB@,$RANLIB,;t t
+s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t
+s,@DLLTOOL@,$DLLTOOL,;t t
+s,@ac_ct_DLLTOOL@,$ac_ct_DLLTOOL,;t t
+s,@AS@,$AS,;t t
+s,@ac_ct_AS@,$ac_ct_AS,;t t
+s,@OBJDUMP@,$OBJDUMP,;t t
+s,@ac_ct_OBJDUMP@,$ac_ct_OBJDUMP,;t t
+s,@CPP@,$CPP,;t t
+s,@CXX@,$CXX,;t t
+s,@CXXFLAGS@,$CXXFLAGS,;t t
+s,@ac_ct_CXX@,$ac_ct_CXX,;t t
+s,@CXXDEPMODE@,$CXXDEPMODE,;t t
+s,@am__fastdepCXX_TRUE@,$am__fastdepCXX_TRUE,;t t
+s,@am__fastdepCXX_FALSE@,$am__fastdepCXX_FALSE,;t t
+s,@CXXCPP@,$CXXCPP,;t t
+s,@F77@,$F77,;t t
+s,@FFLAGS@,$FFLAGS,;t t
+s,@ac_ct_F77@,$ac_ct_F77,;t t
+s,@LIBTOOL@,$LIBTOOL,;t t
+s,@LIBTOOL_DEPS@,$LIBTOOL_DEPS,;t t
+s,@INSTALL_LTDL_TRUE@,$INSTALL_LTDL_TRUE,;t t
+s,@INSTALL_LTDL_FALSE@,$INSTALL_LTDL_FALSE,;t t
+s,@CONVENIENCE_LTDL_TRUE@,$CONVENIENCE_LTDL_TRUE,;t t
+s,@CONVENIENCE_LTDL_FALSE@,$CONVENIENCE_LTDL_FALSE,;t t
+s,@LIBADD_DL@,$LIBADD_DL,;t t
+s,@LIBOBJS@,$LIBOBJS,;t t
+s,@LTLIBOBJS@,$LTLIBOBJS,;t t
+CEOF
+
+_ACEOF
+
+ cat >>$CONFIG_STATUS <<\_ACEOF
+ # 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_lines=48
+ ac_sed_frag=1 # Number of current file.
+ ac_beg=1 # First line for current file.
+ ac_end=$ac_max_sed_lines # 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" $tmp/subs.sed >$tmp/subs.frag
+ else
+ sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag
+ fi
+ if test ! -s $tmp/subs.frag; then
+ ac_more_lines=false
+ else
+ # The purpose of the label and of the branching condition is to
+ # speed up the sed processing (if there are no `@' at all, there
+ # is no need to browse any of the substitutions).
+ # These are the two extra sed commands mentioned above.
+ (echo ':t
+ /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed"
+ else
+ ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed"
+ fi
+ ac_sed_frag=`expr $ac_sed_frag + 1`
+ ac_beg=$ac_end
+ ac_end=`expr $ac_end + $ac_max_sed_lines`
+ fi
+ done
+ if test -z "$ac_sed_cmds"; then
+ ac_sed_cmds=cat
fi
+fi # test -n "$CONFIG_FILES"
- 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" ;;
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue
+ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ * ) ac_file_in=$ac_file.in ;;
esac
- case "$ac_given_INSTALL" in
- [/$]*) INSTALL="$ac_given_INSTALL" ;;
- *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
- esac
+ # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories.
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
- 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= ;;
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ case $INSTALL in
+ [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+ *) ac_INSTALL=$ac_top_builddir$INSTALL ;;
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
-s%@INSTALL@%$INSTALL%g
-" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
-fi; done
-rm -f conftest.s*
+ if test x"$ac_file" != x-; then
+ { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+ rm -f "$ac_file"
+ fi
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ configure_input=
+ else
+ configure_input="$ac_file. "
+ fi
+ configure_input=$configure_input"Generated from `echo $ac_file_in |
+ sed 's,.*/,,'` by configure."
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s,@configure_input@,$configure_input,;t t
+s,@srcdir@,$ac_srcdir,;t t
+s,@abs_srcdir@,$ac_abs_srcdir,;t t
+s,@top_srcdir@,$ac_top_srcdir,;t t
+s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t
+s,@builddir@,$ac_builddir,;t t
+s,@abs_builddir@,$ac_abs_builddir,;t t
+s,@top_builddir@,$ac_top_builddir,;t t
+s,@abs_top_builddir@,$ac_abs_top_builddir,;t t
+s,@INSTALL@,$ac_INSTALL,;t t
+" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out
+ rm -f $tmp/stdin
+ if test x"$ac_file" != x-; then
+ mv $tmp/out $ac_file
+ else
+ cat $tmp/out
+ rm -f $tmp/out
+ fi
+
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+#
+# CONFIG_HEADER section.
+#
# 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_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)'
+ac_dB='[ ].*$,\1#\2'
+ac_dC=' '
+ac_dD=',;t'
+# ac_u turns "#undef NAME" without 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
+ac_uD=',;t'
+
+for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue
# 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" ;;
+ case $ac_file in
+ - | *:- | *:-:* ) # input from stdin
+ cat >$tmp/stdin
+ ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;;
+ *:* ) 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
+ test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+
+ # First look for the input files in the build tree, otherwise in the
+ # src tree.
+ ac_file_inputs=`IFS=:
+ for f in $ac_file_in; do
+ case $f in
+ -) echo $tmp/stdin ;;
+ [\\/$]*)
+ # Absolute (can't be DOS-style, as IFS=:)
+ test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ echo $f;;
+ *) # Relative
+ if test -f "$f"; then
+ # Build tree
+ echo $f
+ elif test -f "$srcdir/$f"; then
+ # Source tree
+ echo $srcdir/$f
+ else
+ # /dev/null tree
+ { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5
+echo "$as_me: error: cannot find input file: $f" >&2;}
+ { (exit 1); exit 1; }; }
+ fi;;
+ esac
+ done` || { (exit 1); exit 1; }
+ # Remove the trailing spaces.
+ sed 's/[ ]*$//' $ac_file_inputs >$tmp/in
+
+_ACEOF
+
+# Transform confdefs.h into two sed scripts, `conftest.defines' and
+# `conftest.undefs', that substitutes the proper values into
+# config.h.in to produce config.h. The first handles `#define'
+# templates, and the second `#undef' templates.
+# 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.defines conftest.undefs
+# Using a here document instead of a string reduces the quoting nightmare.
+# Putting comments in sed scripts is not portable.
+#
+# `end' is used to avoid that the second main sed command (meant for
+# 0-ary CPP macros) applies to n-ary macro definitions.
+# See the Autoconf documentation for `clear'.
+cat >confdef2sed.sed <<\_ACEOF
+s/[\\&,]/\\&/g
+s,[\\$`],\\&,g
+t clear
+: clear
+s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp
+t end
+s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp
+: end
+_ACEOF
+# If some macros were called several times there might be several times
+# the same #defines, which is useless. Nevertheless, we may not want to
+# sort them, since we want the *last* AC-DEFINE to be honored.
+uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines
+sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs
+rm -f confdef2sed.sed
# 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.
+cat >>conftest.undefs <<\_ACEOF
+s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */,
+_ACEOF
+
+# Break up conftest.defines because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS
+echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS
+echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS
+echo ' :' >>$CONFIG_STATUS
+rm -f conftest.tail
+while grep . conftest.defines >/dev/null
+do
+ # Write a limited-size here document to $tmp/defines.sed.
+ echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#define' lines.
+ echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS
+ echo 'CEOF
+ sed -f $tmp/defines.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail
+ rm -f conftest.defines
+ mv conftest.tail conftest.defines
+done
+rm -f conftest.defines
+echo ' fi # grep' >>$CONFIG_STATUS
+echo >>$CONFIG_STATUS
+# Break up conftest.undefs because some shells have a limit on the size
+# of here documents, and old seds have small limits too (100 cmds).
+echo ' # Handle all the #undef templates' >>$CONFIG_STATUS
rm -f conftest.tail
-while :
+while grep . conftest.undefs >/dev/null
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
+ # Write a limited-size here document to $tmp/undefs.sed.
+ echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS
+ # Speed up: don't consider the non `#undef'
+ echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS
+ # Work around the forget-to-reset-the-flag bug.
+ echo 't clr' >>$CONFIG_STATUS
+ echo ': clr' >>$CONFIG_STATUS
+ sed ${ac_max_here_lines}q conftest.undefs >>$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
+ sed -f $tmp/undefs.sed $tmp/in >$tmp/out
+ rm -f $tmp/in
+ mv $tmp/out $tmp/in
+' >>$CONFIG_STATUS
+ sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail
+ rm -f conftest.undefs
+ mv conftest.tail conftest.undefs
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
+rm -f conftest.undefs
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ # Let's still pretend it is `configure' which instantiates (i.e., don't
+ # use $as_me), people would be surprised to read:
+ # /* config.h. Generated by config.status. */
+ if test x"$ac_file" = x-; then
+ echo "/* Generated by configure. */" >$tmp/config.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"
+ echo "/* $ac_file. Generated by configure. */" >$tmp/config.h
+ fi
+ cat $tmp/in >>$tmp/config.h
+ rm -f $tmp/in
+ if test x"$ac_file" != x-; then
+ if diff $ac_file $tmp/config.h >/dev/null 2>&1; then
+ { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+ else
+ ac_dir=`(dirname "$ac_file") 2>/dev/null ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_file" : 'X\(//\)[^/]' \| \
+ X"$ac_file" : 'X\(//\)$' \| \
+ X"$ac_file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p "$ac_dir"
+ else
+ as_dir="$ac_dir"
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5
+echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;}
+ { (exit 1); exit 1; }; }; }
+
+ rm -f $ac_file
+ mv $tmp/config.h $ac_file
fi
- rm -f $ac_file
- mv conftest.h $ac_file
+ else
+ cat $tmp/config.h
+ rm -f $tmp/config.h
fi
-fi; done
+# Compute $ac_file's index in $config_headers.
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+ case $_am_header in
+ $ac_file | $ac_file:* )
+ break ;;
+ * )
+ _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+ esac
+done
+echo "timestamp for $ac_file" >`(dirname $ac_file) 2>/dev/null ||
+$as_expr X$ac_file : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X$ac_file : 'X\(//\)[^/]' \| \
+ X$ac_file : 'X\(//\)$' \| \
+ X$ac_file : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X$ac_file |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`/stamp-h$_am_stamp_count
+done
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<EOF
+#
+# CONFIG_COMMANDS section.
+#
+for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue
+ ac_dest=`echo "$ac_file" | sed 's,:.*,,'`
+ ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'`
+ ac_dir=`(dirname "$ac_dest") 2>/dev/null ||
+$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$ac_dest" : 'X\(//\)[^/]' \| \
+ X"$ac_dest" : 'X\(//\)$' \| \
+ X"$ac_dest" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$ac_dest" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ ac_builddir=.
+
+if test "$ac_dir" != .; then
+ ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+ # A "../" for each directory in $ac_dir_suffix.
+ ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'`
+else
+ ac_dir_suffix= ac_top_builddir=
+fi
+
+case $srcdir in
+ .) # No --srcdir option. We are building in place.
+ ac_srcdir=.
+ if test -z "$ac_top_builddir"; then
+ ac_top_srcdir=.
+ else
+ ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'`
+ fi ;;
+ [\\/]* | ?:[\\/]* ) # Absolute path.
+ ac_srcdir=$srcdir$ac_dir_suffix;
+ ac_top_srcdir=$srcdir ;;
+ *) # Relative path.
+ ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix
+ ac_top_srcdir=$ac_top_builddir$srcdir ;;
+esac
+# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be
+# absolute.
+ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd`
+ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd`
+ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd`
+ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
+
+
+ { echo "$as_me:$LINENO: executing $ac_dest commands" >&5
+echo "$as_me: executing $ac_dest commands" >&6;}
+ case $ac_dest in
+ depfiles ) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do
+ # Strip MF so we end up with the name of the file.
+ mf=`echo "$mf" | sed -e 's/:.*$//'`
+ # Check whether this is an Automake generated Makefile or not.
+ # We used to match only the files named `Makefile.in', but
+ # some people rename them; so instead we look at the file content.
+ # Grep'ing the first line is not enough: some people post-process
+ # each Makefile.in and add a new line on top of each file to say so.
+ # So let's grep whole file.
+ if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
+ dirpart=`(dirname "$mf") 2>/dev/null ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$mf" : 'X\(//\)[^/]' \| \
+ X"$mf" : 'X\(//\)$' \| \
+ X"$mf" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$mf" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ else
+ continue
+ fi
+ grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+ # Extract the definition of DEP_FILES from the Makefile without
+ # running `make'.
+ DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+ test -z "$DEPDIR" && continue
+ # When using ansi2knr, U may be empty or an underscore; expand it
+ U=`sed -n -e '/^U = / s///p' < "$mf"`
+ test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+ # We invoke sed twice because it is the simplest approach to
+ # changing $(DEPDIR) to its actual value in the expansion.
+ for file in `sed -n -e '
+ /^DEP_FILES = .*\\\\$/ {
+ s/^DEP_FILES = //
+ :loop
+ s/\\\\$//
+ p
+ n
+ /\\\\$/ b loop
+ p
+ }
+ /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ # Make sure the directory exists.
+ test -f "$dirpart/$file" && continue
+ fdir=`(dirname "$file") 2>/dev/null ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$file" : 'X\(//\)[^/]' \| \
+ X"$file" : 'X\(//\)$' \| \
+ X"$file" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$file" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ { if $as_mkdir_p; then
+ mkdir -p $dirpart/$fdir
+ else
+ as_dir=$dirpart/$fdir
+ as_dirs=
+ while test ! -d "$as_dir"; do
+ as_dirs="$as_dir $as_dirs"
+ as_dir=`(dirname "$as_dir") 2>/dev/null ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+ X"$as_dir" : 'X\(//\)[^/]' \| \
+ X"$as_dir" : 'X\(//\)$' \| \
+ X"$as_dir" : 'X\(/\)' \| \
+ . : '\(.\)' 2>/dev/null ||
+echo X"$as_dir" |
+ sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; }
+ /^X\(\/\/\)[^/].*/{ s//\1/; q; }
+ /^X\(\/\/\)$/{ s//\1/; q; }
+ /^X\(\/\).*/{ s//\1/; q; }
+ s/.*/./; q'`
+ done
+ test ! -n "$as_dirs" || mkdir $as_dirs
+ fi || { { echo "$as_me:$LINENO: error: cannot create directory $dirpart/$fdir" >&5
+echo "$as_me: error: cannot create directory $dirpart/$fdir" >&2;}
+ { (exit 1); exit 1; }; }; }
+ # echo "creating $dirpart/$file"
+ echo '# dummy' > "$dirpart/$file"
+ done
+done
+ ;;
+ esac
+done
+_ACEOF
-EOF
-cat >> $CONFIG_STATUS <<\EOF
-test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+cat >>$CONFIG_STATUS <<\_ACEOF
-exit 0
-EOF
+{ (exit 0); exit 0; }
+_ACEOF
chmod +x $CONFIG_STATUS
-rm -fr confdefs* $ac_clean_files
-test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
-
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded. So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status. When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+ ac_cs_success=:
+ ac_config_status_args=
+ test "$silent" = yes &&
+ ac_config_status_args="$ac_config_status_args --quiet"
+ exec 5>/dev/null
+ $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+ exec 5>>config.log
+ # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+ # would make configure fail if this is the last instruction.
+ $ac_cs_success || { (exit 1); exit 1; }
+fi
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/libjava/libltdl/configure.ac b/libjava/libltdl/configure.ac
new file mode 100644
index 00000000000..56c9f237721
--- /dev/null
+++ b/libjava/libltdl/configure.ac
@@ -0,0 +1,80 @@
+## Process this file with autoconf to create configure. -*- autoconf -*-
+# Copyright 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
+
+
+## FIXME: Is this really new enough? ##
+AC_PREREQ(2.50)
+
+
+## ------------------------ ##
+## Autoconf initialisation. ##
+## ------------------------ ##
+AC_INIT([libltdl], [1.2], [bug-libtool@gnu.org])
+AC_CONFIG_SRCDIR([ltdl.c])
+
+
+## ------------------------------- ##
+## Libltdl specific configuration. ##
+## ------------------------------- ##
+
+AC_CONFIG_AUX_DIR([.])
+
+if test -z "$enable_ltdl_install$enable_ltdl_convenience"; then
+ if test -f ${srcdir}/ltmain.sh; then
+ # if libltdl is libtoolized, it is assumed to be stand-alone and
+ # installed unless the command line overrides it (tested above)
+ enable_ltdl_install=yes
+ else
+ AC_MSG_WARN([*** The top-level configure must select either])
+ AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].])
+ AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?])
+ fi
+fi
+
+
+## ------------------------ ##
+## Automake Initialisation. ##
+## ------------------------ ##
+AM_INIT_AUTOMAKE(AC_PACKAGE_TARNAME, AC_PACKAGE_VERSION, -)
+AM_CONFIG_HEADER([config.h:config-h.in])
+AM_MAINTAINER_MODE
+
+
+## ------------------ ##
+## C compiler checks. ##
+## ------------------ ##
+AC_PROG_CC
+AC_C_CONST
+AC_C_INLINE
+
+
+## ----------------------- ##
+## Libtool initialisation. ##
+## ----------------------- ##
+AC_LIBTOOL_WIN32_DLL
+AC_PROG_LIBTOOL
+AC_SUBST([LIBTOOL_DEPS])
+
+AC_LIB_LTDL
+
+
+## -------- ##
+## Outputs. ##
+## -------- ##
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
diff --git a/libjava/libltdl/configure.in b/libjava/libltdl/configure.in
deleted file mode 100644
index 3c1fa37356f..00000000000
--- a/libjava/libltdl/configure.in
+++ /dev/null
@@ -1,63 +0,0 @@
-dnl Process this file with autoconf to create configure.
-
-AC_INIT(ltdl.c)
-
-AC_ARG_WITH(auxdir,
-[ --with-auxdir=DIR path to autoconf auxiliary files],
-[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
- # installed unless the command line overrides it (tested above)
- enable_ltdl_install=yes
- else
- AC_MSG_WARN([*** The top-level configure must select either])
- AC_MSG_WARN([*** [A""C_LIBLTDL_INSTALLABLE] or [A""C_LIBLTDL_CONVENIENCE].])
- AC_MSG_ERROR([*** Maybe you want to --enable-ltdl-install?])
- fi
-fi
-
-AM_INIT_AUTOMAKE(libltdl,1.1,-)
-AM_CONFIG_HEADER(config.h)
-AM_MAINTAINER_MODE
-
-AC_PROG_CC
-AC_C_CONST
-AC_C_INLINE
-
-AC_LIBTOOL_WIN32_DLL
-AM_PROG_LIBTOOL
-AC_SUBST(LIBTOOL_DEPS)
-
-AC_MSG_CHECKING([for garbage collector to use])
-AC_ARG_ENABLE(java-gc,
-changequote(<<,>>)dnl
-<< --enable-java-gc=TYPE choose garbage collector [boehm]>>,
-changequote([,])
- GC=$enableval,
- GC=boehm)
-
-GCINCS=
-if test "$GC" = "boehm"; then
- GCINCS="`cat ../../boehm-gc/boehm-cflags`"
- AC_DEFINE(HAVE_BOEHM_GC)
-fi
-AC_SUBST(GCINCS)
-
-AC_LIB_LTDL
-
-dnl Output the makefile
-AC_OUTPUT(Makefile)
-
-# Local Variables:
-# mode:shell-script
-# sh-indentation:2
-# End:
diff --git a/libjava/libltdl/install-sh b/libjava/libltdl/install-sh
new file mode 100755
index 00000000000..6ce63b9f76b
--- /dev/null
+++ b/libjava/libltdl/install-sh
@@ -0,0 +1,294 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+#
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# 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
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch. It can only install one file at a time, a restriction
+# shared with many OS's install programs.
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+transformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd=$cpprog
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd=$stripprog
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "$0: no input file specified" >&2
+ exit 1
+else
+ :
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d "$dst" ]; then
+ instcmd=:
+ chmodcmd=""
+ else
+ instcmd=$mkdirprog
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f "$src" ] || [ -d "$src" ]
+ then
+ :
+ else
+ echo "$0: $src does not exist" >&2
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "$0: no destination specified" >&2
+ exit 1
+ else
+ :
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d "$dst" ]
+ then
+ dst=$dst/`basename "$src"`
+ else
+ :
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+ '
+IFS="${IFS-$defaultIFS}"
+
+oIFS=$IFS
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS=$oIFS
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp=$pathcomp$1
+ shift
+
+ if [ ! -d "$pathcomp" ] ;
+ then
+ $mkdirprog "$pathcomp"
+ else
+ :
+ fi
+
+ pathcomp=$pathcomp/
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd "$dst" &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ dstfile=`basename "$dst" $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename "$dst"`
+ else
+ :
+ fi
+
+# Make a couple of temp file names in the proper directory.
+
+ dsttmp=$dstdir/_inst.$$_
+ rmtmp=$dstdir/_rm.$$_
+
+# Trap to clean up temp files at exit.
+
+ trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
+ trap '(exit $?); exit' 1 2 13 15
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd "$src" "$dsttmp" &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
+
+# Now remove or move aside any old file at destination location. We try this
+# two ways since rm can't unlink itself on some systems and the destination
+# file might be busy for other reasons. In this case, the final cleanup
+# might fail but the new file should still install successfully.
+
+{
+ if [ -f "$dstdir/$dstfile" ]
+ then
+ $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
+ $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
+ {
+ echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
+ (exit 1); exit
+ }
+ else
+ :
+ fi
+} &&
+
+# Now rename the file to the real destination.
+
+ $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
+
+fi &&
+
+# The final little trick to "correctly" pass the exit status to the exit trap.
+
+{
+ (exit 0); exit
+}
diff --git a/libjava/libltdl/ltdl.c b/libjava/libltdl/ltdl.c
index 5ecbee5d2cb..40ed84d417a 100644
--- a/libjava/libltdl/ltdl.c
+++ b/libjava/libltdl/ltdl.c
@@ -25,333 +25,1145 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
*/
-#define _LTDL_COMPILE_
-
#if HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
#endif
-#if HAVE_STRING_H
-#include <string.h>
+#if HAVE_UNISTD_H
+# include <unistd.h>
+#endif
+
+#if HAVE_STDIO_H
+# include <stdio.h>
+#endif
+
+#if HAVE_STDLIB_H
+# include <stdlib.h>
#endif
-#if HAVE_STRINGS_H
-#include <strings.h>
+#if HAVE_STRING_H
+# include <string.h>
+#else
+# if HAVE_STRINGS_H
+# include <strings.h>
+# endif
#endif
#if HAVE_CTYPE_H
-#include <ctype.h>
+# include <ctype.h>
#endif
#if HAVE_MALLOC_H
-#include <malloc.h>
+# include <malloc.h>
#endif
#if HAVE_MEMORY_H
-#include <memory.h>
-#endif
-
-#if HAVE_STDLIB_H
-#include <stdlib.h>
+# include <memory.h>
#endif
-#if HAVE_STDIO_H
-#include <stdio.h>
+#if HAVE_ERRNO_H
+# include <errno.h>
#endif
#if HAVE_BOEHM_GC
#include <gc.h>
#endif
-#include "ltdl.h"
-#ifdef DLL_EXPORT
-# define LTDL_GLOBAL_DATA __declspec(dllexport)
+#ifndef __WINDOWS__
+# ifdef __WIN32__
+# define __WINDOWS__
+# endif
+#endif
+
+
+#undef LT_USE_POSIX_DIRENT
+#ifdef HAVE_CLOSEDIR
+# ifdef HAVE_OPENDIR
+# ifdef HAVE_READDIR
+# ifdef HAVE_DIRENT_H
+# define LT_USE_POSIX_DIRENT
+# endif /* HAVE_DIRENT_H */
+# endif /* HAVE_READDIR */
+# endif /* HAVE_OPENDIR */
+#endif /* HAVE_CLOSEDIR */
+
+
+#undef LT_USE_WINDOWS_DIRENT_EMULATION
+#ifndef LT_USE_POSIX_DIRENT
+# ifdef __WINDOWS__
+# define LT_USE_WINDOWS_DIRENT_EMULATION
+# endif /* __WINDOWS__ */
+#endif /* LT_USE_POSIX_DIRENT */
+
+
+#ifdef LT_USE_POSIX_DIRENT
+# include <dirent.h>
+# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
#else
-# define LTDL_GLOBAL_DATA
+# ifdef LT_USE_WINDOWS_DIRENT_EMULATION
+# define LT_D_NAMLEN(dirent) (strlen((dirent)->d_name))
+# else
+# define dirent direct
+# define LT_D_NAMLEN(dirent) ((dirent)->d_namlen)
+# if HAVE_SYS_NDIR_H
+# include <sys/ndir.h>
+# endif
+# if HAVE_SYS_DIR_H
+# include <sys/dir.h>
+# endif
+# if HAVE_NDIR_H
+# include <ndir.h>
+# endif
+# endif
#endif
-/* max. filename length */
-#ifndef LTDL_FILENAME_MAX
-#define LTDL_FILENAME_MAX 1024
+#if HAVE_ARGZ_H
+# include <argz.h>
#endif
-#undef LTDL_READTEXT_MODE
-/* fopen() mode flags for reading a text file */
-#ifdef _WIN32
-#define LTDL_READTEXT_MODE "rt"
+#if HAVE_ASSERT_H
+# include <assert.h>
#else
-#define LTDL_READTEXT_MODE "r"
+# define assert(arg) ((void) 0)
#endif
-#undef LTDL_SYMBOL_LENGTH
-/* This is the maximum symbol size that won't require malloc/free */
-#define LTDL_SYMBOL_LENGTH 128
+#include "ltdl.h"
-#undef LTDL_SYMBOL_OVERHEAD
-/* This accounts for the _LTX_ separator */
-#define LTDL_SYMBOL_OVERHEAD 5
-
-/* NOTE: typedefed in ltdl.h
- This structure is used for the list of registered loaders. */
-struct lt_dlloader_t {
- struct lt_dlloader_t *next;
- const char *loader_name; /* identifying name for each loader */
- const char *sym_prefix; /* prefix for symbols */
- lt_module_open_t *module_open;
- lt_module_close_t *module_close;
- lt_find_sym_t *find_sym;
- lt_dlloader_exit_t *dlloader_exit;
- lt_dlloader_data_t dlloader_data;
-};
+#if WITH_DMALLOC
+# include <dmalloc.h>
+#endif
-typedef struct lt_dlhandle_t {
- struct lt_dlhandle_t *next;
- lt_dlloader_t *loader; /* dlopening interface */
- lt_dlinfo info;
- int depcount; /* number of dependencies */
- lt_dlhandle *deplibs; /* dependencies */
- lt_module_t module; /* system module handle */
- lt_ptr_t system; /* system specific data */
- lt_ptr_t app_private; /* application private data */
-} lt_dlhandle_t;
-
-static const char objdir[] = LTDL_OBJDIR;
-#ifdef LTDL_SHLIB_EXT
-static const char shlib_ext[] = LTDL_SHLIB_EXT;
+
+
+
+/* --- WINDOWS SUPPORT --- */
+
+
+#ifdef DLL_EXPORT
+# define LT_GLOBAL_DATA __declspec(dllexport)
+#else
+# define LT_GLOBAL_DATA
#endif
-#ifdef LTDL_SYSSEARCHPATH
-static const char sys_search_path[] = LTDL_SYSSEARCHPATH;
+
+/* fopen() mode flags for reading a text file */
+#undef LT_READTEXT_MODE
+#ifdef __WINDOWS__
+# define LT_READTEXT_MODE "rt"
+#else
+# define LT_READTEXT_MODE "r"
#endif
-/* Extract the diagnostic strings from the error table macro in the same
- order as the enumberated indices in ltdl.h. */
-#define LTDL_ERROR(name, diagnostic) (diagnostic),
-static const char *ltdl_error_strings[] = {
- ltdl_error_table
- 0
+#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
+
+#include <windows.h>
+
+#define dirent lt_dirent
+#define DIR lt_DIR
+
+struct dirent
+{
+ char d_name[2048];
+ int d_namlen;
};
-#undef LTDL_ERROR
-#ifdef __STDC__
-# define LT_DLSTRERROR(name) ltdl_error_strings[LTDL_ERROR_##name]
+typedef struct _DIR
+{
+ HANDLE hSearch;
+ WIN32_FIND_DATA Win32FindData;
+ BOOL firsttime;
+ struct dirent file_info;
+} DIR;
+
+#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
+
+
+/* --- MANIFEST CONSTANTS --- */
+
+
+/* Standard libltdl search path environment variable name */
+#undef LTDL_SEARCHPATH_VAR
+#define LTDL_SEARCHPATH_VAR "LTDL_LIBRARY_PATH"
+
+/* Standard libtool archive file extension. */
+#undef LTDL_ARCHIVE_EXT
+#define LTDL_ARCHIVE_EXT ".la"
+
+/* max. filename length */
+#ifndef LT_FILENAME_MAX
+# define LT_FILENAME_MAX 1024
+#endif
+
+/* This is the maximum symbol size that won't require malloc/free */
+#undef LT_SYMBOL_LENGTH
+#define LT_SYMBOL_LENGTH 128
+
+/* This accounts for the _LTX_ separator */
+#undef LT_SYMBOL_OVERHEAD
+#define LT_SYMBOL_OVERHEAD 5
+
+
+
+
+/* --- MEMORY HANDLING --- */
+
+
+/* These are the functions used internally. In addition to making
+ use of the associated function pointers above, they also perform
+ error handling. */
+static char *lt_estrdup LT_PARAMS((const char *str));
+static lt_ptr lt_emalloc LT_PARAMS((size_t size));
+static lt_ptr lt_erealloc LT_PARAMS((lt_ptr addr, size_t size));
+
+/* static lt_ptr rpl_realloc LT_PARAMS((lt_ptr ptr, size_t size)); */
+#define rpl_realloc realloc
+
+/* These are the pointers that can be changed by the caller: */
+LT_GLOBAL_DATA lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size))
+ = (lt_ptr (*) LT_PARAMS((size_t))) malloc;
+LT_GLOBAL_DATA lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size))
+ = (lt_ptr (*) LT_PARAMS((lt_ptr, size_t))) rpl_realloc;
+LT_GLOBAL_DATA void (*lt_dlfree) LT_PARAMS((lt_ptr ptr))
+ = (void (*) LT_PARAMS((lt_ptr))) free;
+
+/* The following macros reduce the amount of typing needed to cast
+ assigned memory. */
+#if WITH_DMALLOC
+
+#define LT_DLMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp)))
+#define LT_DLREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp)))
+#define LT_DLFREE(p) \
+ LT_STMT_START { if (p) (p) = (xfree (p), (lt_ptr) 0); } LT_STMT_END
+
+#define LT_EMALLOC(tp, n) ((tp *) xmalloc ((n) * sizeof(tp)))
+#define LT_EREALLOC(tp, p, n) ((tp *) xrealloc ((p), (n) * sizeof(tp)))
+
#else
-# define LT_DLSTRERROR(name) ltdl_error_strings[LTDL_ERROR_/**/name]
+
+#define LT_DLMALLOC(tp, n) ((tp *) lt_dlmalloc ((n) * sizeof(tp)))
+#define LT_DLREALLOC(tp, p, n) ((tp *) rpl_realloc ((p), (n) * sizeof(tp)))
+#define LT_DLFREE(p) \
+ LT_STMT_START { if (p) (p) = (lt_dlfree (p), (lt_ptr) 0); } LT_STMT_END
+
+#define LT_EMALLOC(tp, n) ((tp *) lt_emalloc ((n) * sizeof(tp)))
+#define LT_EREALLOC(tp, p, n) ((tp *) lt_erealloc ((p), (n) * sizeof(tp)))
+
#endif
-static const char *last_error = 0;
+#define LT_DLMEM_REASSIGN(p, q) LT_STMT_START { \
+ if ((p) != (q)) { if (p) lt_dlfree (p); (p) = (q); (q) = 0; } \
+ } LT_STMT_END
+
+
+/* --- REPLACEMENT FUNCTIONS --- */
-LTDL_GLOBAL_DATA lt_ptr_t (*lt_dlmalloc) LTDL_PARAMS((size_t size)) = (lt_ptr_t(*)LTDL_PARAMS((size_t)))malloc;
-LTDL_GLOBAL_DATA void (*lt_dlfree) LTDL_PARAMS((lt_ptr_t ptr)) = (void(*)LTDL_PARAMS((lt_ptr_t)))free;
#undef strdup
-#define strdup xstrdup
+#define strdup rpl_strdup
+
+static char *strdup LT_PARAMS((const char *str));
-static inline char *
+static char *
strdup(str)
- const char *str;
+ const char *str;
{
- char *tmp;
+ char *tmp = 0;
+
+ if (str)
+ {
+ tmp = LT_DLMALLOC (char, 1+ strlen (str));
+ if (tmp)
+ {
+ strcpy(tmp, str);
+ }
+ }
- if (!str)
- return 0;
- tmp = (char*) lt_dlmalloc(strlen(str)+1);
- if (tmp)
- strcpy(tmp, str);
- return tmp;
+ return tmp;
}
+
#if ! HAVE_STRCMP
#undef strcmp
-#define strcmp xstrcmp
+#define strcmp rpl_strcmp
-static inline int
+static int strcmp LT_PARAMS((const char *str1, const char *str2));
+
+static int
strcmp (str1, str2)
- const char *str1;
- const char *str2;
-{
- if (str1 == str2)
- return 0;
- if (str1 == 0)
- return -1;
- if (str2 == 0)
- return 1;
-
- for (;*str1 && *str2; str1++, str2++)
- if (*str1 != *str2)
- break;
-
- return (int)(*str1 - *str2);
+ const char *str1;
+ const char *str2;
+{
+ if (str1 == str2)
+ return 0;
+ if (str1 == 0)
+ return -1;
+ if (str2 == 0)
+ return 1;
+
+ for (;*str1 && *str2; ++str1, ++str2)
+ {
+ if (*str1 != *str2)
+ break;
+ }
+
+ return (int)(*str1 - *str2);
}
#endif
-
+
#if ! HAVE_STRCHR
-# if HAVE_INDEX
+# if HAVE_INDEX
+# define strchr index
+# else
+# define strchr rpl_strchr
-# define strchr index
+static const char *strchr LT_PARAMS((const char *str, int ch));
-# else
+static const char*
+strchr(str, ch)
+ const char *str;
+ int ch;
+{
+ const char *p;
-# define strchr xstrchr
+ for (p = str; *p != (char)ch && *p != LT_EOS_CHAR; ++p)
+ /*NOWORK*/;
-static inline const char*
-strchr(str, ch)
- const char *str;
- int ch;
+ return (*p == (char)ch) ? p : 0;
+}
+
+# endif
+#endif /* !HAVE_STRCHR */
+
+
+#if ! HAVE_STRRCHR
+
+# if HAVE_RINDEX
+# define strrchr rindex
+# else
+# define strrchr rpl_strrchr
+
+static const char *strrchr LT_PARAMS((const char *str, int ch));
+
+static const char*
+strrchr(str, ch)
+ const char *str;
+ int ch;
{
- const char *p;
+ const char *p, *q = 0;
- for (p = str; *p != (char)ch && *p != '\0'; p++)
- /*NOWORK*/;
+ for (p = str; *p != LT_EOS_CHAR; ++p)
+ {
+ if (*p == (char) ch)
+ {
+ q = p;
+ }
+ }
- return (*p == (char)ch) ? p : 0;
+ return q;
}
# endif
+#endif
+
+/* NOTE: Neither bcopy nor the memcpy implementation below can
+ reliably handle copying in overlapping areas of memory. Use
+ memmove (for which there is a fallback implmentation below)
+ if you need that behaviour. */
+#if ! HAVE_MEMCPY
+
+# if HAVE_BCOPY
+# define memcpy(dest, src, size) bcopy (src, dest, size)
+# else
+# define memcpy rpl_memcpy
+
+static lt_ptr memcpy LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));
+
+static lt_ptr
+memcpy (dest, src, size)
+ lt_ptr dest;
+ const lt_ptr src;
+ size_t size;
+{
+ size_t i = 0;
+
+ for (i = 0; i < size; ++i)
+ {
+ dest[i] = src[i];
+ }
+
+ return dest;
+}
+
+# endif /* !HAVE_BCOPY */
+#endif /* !HAVE_MEMCPY */
+
+#if ! HAVE_MEMMOVE
+# define memmove rpl_memmove
+
+static lt_ptr memmove LT_PARAMS((lt_ptr dest, const lt_ptr src, size_t size));
+
+static lt_ptr
+memmove (dest, src, size)
+ lt_ptr dest;
+ const lt_ptr src;
+ size_t size;
+{
+ size_t i;
+
+ if (dest < src)
+ for (i = 0; i < size; ++i)
+ {
+ dest[i] = src[i];
+ }
+ else if (dest > src)
+ for (i = size -1; i >= 0; --i)
+ {
+ dest[i] = src[i];
+ }
+
+ return dest;
+}
+
+#endif /* !HAVE_MEMMOVE */
+#ifdef LT_USE_WINDOWS_DIRENT_EMULATION
+
+static void closedir LT_PARAMS((DIR *entry));
+
+static void
+closedir(entry)
+ DIR *entry;
+{
+ assert(entry != (DIR *) NULL);
+ FindClose(entry->hSearch);
+ lt_dlfree((lt_ptr)entry);
+}
+
+
+static DIR * opendir LT_PARAMS((const char *path));
+
+static DIR*
+opendir (path)
+ const char *path;
+{
+ char file_specification[LT_FILENAME_MAX];
+ DIR *entry;
+
+ assert(path != (char *) NULL);
+ (void) strncpy(file_specification,path,LT_FILENAME_MAX-1);
+ (void) strcat(file_specification,"\\");
+ entry = LT_DLMALLOC (DIR,sizeof(DIR));
+ if (entry != (DIR *) 0)
+ {
+ entry->firsttime = TRUE;
+ entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
+ }
+ if (entry->hSearch == INVALID_HANDLE_VALUE)
+ {
+ (void) strcat(file_specification,"\\*.*");
+ entry->hSearch = FindFirstFile(file_specification,&entry->Win32FindData);
+ if (entry->hSearch == INVALID_HANDLE_VALUE)
+ {
+ LT_DLFREE (entry);
+ return (DIR *) 0;
+ }
+ }
+ return(entry);
+}
+
+
+static struct dirent *readdir LT_PARAMS((DIR *entry));
+
+static struct dirent *readdir(entry)
+ DIR *entry;
+{
+ int
+ status;
+
+ if (entry == (DIR *) 0)
+ return((struct dirent *) 0);
+ if (!entry->firsttime)
+ {
+ status = FindNextFile(entry->hSearch,&entry->Win32FindData);
+ if (status == 0)
+ return((struct dirent *) 0);
+ }
+ entry->firsttime = FALSE;
+ (void) strncpy(entry->file_info.d_name,entry->Win32FindData.cFileName,
+ LT_FILENAME_MAX-1);
+ entry->file_info.d_namlen = strlen(entry->file_info.d_name);
+ return(&entry->file_info);
+}
+
+#endif /* LT_USE_WINDOWS_DIRENT_EMULATION */
+
+/* According to Alexandre Oliva <oliva@lsd.ic.unicamp.br>,
+ ``realloc is not entirely portable''
+ In any case we want to use the allocator supplied by the user without
+ burdening them with an lt_dlrealloc function pointer to maintain.
+ Instead implement our own version (with known boundary conditions)
+ using lt_dlmalloc and lt_dlfree. */
+
+/* #undef realloc
+ #define realloc rpl_realloc
+*/
+#if 0
+ /* You can't (re)define realloc unless you also (re)define malloc.
+ Right now, this code uses the size of the *destination* to decide
+ how much to copy. That's not right, but you can't know the size
+ of the source unless you know enough about, or wrote malloc. So
+ this code is disabled... */
+
+static lt_ptr
+realloc (ptr, size)
+ lt_ptr ptr;
+ size_t size;
+{
+ if (size == 0)
+ {
+ /* For zero or less bytes, free the original memory */
+ if (ptr != 0)
+ {
+ lt_dlfree (ptr);
+ }
+
+ return (lt_ptr) 0;
+ }
+ else if (ptr == 0)
+ {
+ /* Allow reallocation of a NULL pointer. */
+ return lt_dlmalloc (size);
+ }
+ else
+ {
+ /* Allocate a new block, copy and free the old block. */
+ lt_ptr mem = lt_dlmalloc (size);
+
+ if (mem)
+ {
+ memcpy (mem, ptr, size);
+ lt_dlfree (ptr);
+ }
+
+ /* Note that the contents of PTR are not damaged if there is
+ insufficient memory to realloc. */
+ return mem;
+ }
+}
#endif
-#if ! HAVE_STRRCHR
-# if HAVE_RINDEX
+#if ! HAVE_ARGZ_APPEND
+# define argz_append rpl_argz_append
-# define strrchr rindex
+static error_t argz_append LT_PARAMS((char **pargz, size_t *pargz_len,
+ const char *buf, size_t buf_len));
-# else
+static error_t
+argz_append (pargz, pargz_len, buf, buf_len)
+ char **pargz;
+ size_t *pargz_len;
+ const char *buf;
+ size_t buf_len;
+{
+ size_t argz_len;
+ char *argz;
-# define strrchr xstrrchr
+ assert (pargz);
+ assert (pargz_len);
+ assert ((*pargz && *pargz_len) || (!*pargz && !*pargz_len));
-static inline const char*
-strrchr(str, ch)
- const char *str;
- int ch;
+ /* If nothing needs to be appended, no more work is required. */
+ if (buf_len == 0)
+ return 0;
+
+ /* Ensure there is enough room to append BUF_LEN. */
+ argz_len = *pargz_len + buf_len;
+ argz = LT_DLREALLOC (char, *pargz, argz_len);
+ if (!argz)
+ return ENOMEM;
+
+ /* Copy characters from BUF after terminating '\0' in ARGZ. */
+ memcpy (argz + *pargz_len, buf, buf_len);
+
+ /* Assign new values. */
+ *pargz = argz;
+ *pargz_len = argz_len;
+
+ return 0;
+}
+#endif /* !HAVE_ARGZ_APPEND */
+
+
+#if ! HAVE_ARGZ_CREATE_SEP
+# define argz_create_sep rpl_argz_create_sep
+
+static error_t argz_create_sep LT_PARAMS((const char *str, int delim,
+ char **pargz, size_t *pargz_len));
+
+static error_t
+argz_create_sep (str, delim, pargz, pargz_len)
+ const char *str;
+ int delim;
+ char **pargz;
+ size_t *pargz_len;
{
- const char *p;
+ size_t argz_len;
+ char *argz = 0;
+
+ assert (str);
+ assert (pargz);
+ assert (pargz_len);
+
+ /* Make a copy of STR, but replacing each occurence of
+ DELIM with '\0'. */
+ argz_len = 1+ LT_STRLEN (str);
+ if (argz_len)
+ {
+ const char *p;
+ char *q;
+
+ argz = LT_DLMALLOC (char, argz_len);
+ if (!argz)
+ return ENOMEM;
+
+ for (p = str, q = argz; *p != LT_EOS_CHAR; ++p)
+ {
+ if (*p == delim)
+ {
+ /* Ignore leading delimiters, and fold consecutive
+ delimiters in STR into a single '\0' in ARGZ. */
+ if ((q > argz) && (q[-1] != LT_EOS_CHAR))
+ *q++ = LT_EOS_CHAR;
+ else
+ --argz_len;
+ }
+ else
+ *q++ = *p;
+ }
+ /* Copy terminating LT_EOS_CHAR. */
+ *q = *p;
+ }
- for (p = str; *p != '\0'; p++)
- /*NOWORK*/;
+ /* If ARGZ_LEN has shrunk to nothing, release ARGZ's memory. */
+ if (!argz_len)
+ LT_DLFREE (argz);
- while (*p != (char)ch && p >= str)
- p--;
+ /* Assign new values. */
+ *pargz = argz;
+ *pargz_len = argz_len;
- return (*p == (char)ch) ? p : 0;
+ return 0;
}
+#endif /* !HAVE_ARGZ_CREATE_SEP */
+
+
+#if ! HAVE_ARGZ_INSERT
+# define argz_insert rpl_argz_insert
+
+static error_t argz_insert LT_PARAMS((char **pargz, size_t *pargz_len,
+ char *before, const char *entry));
+
+static error_t
+argz_insert (pargz, pargz_len, before, entry)
+ char **pargz;
+ size_t *pargz_len;
+ char *before;
+ const char *entry;
+{
+ assert (pargz);
+ assert (pargz_len);
+ assert (entry && *entry);
+
+ /* No BEFORE address indicates ENTRY should be inserted after the
+ current last element. */
+ if (!before)
+ return argz_append (pargz, pargz_len, entry, 1+ LT_STRLEN (entry));
+
+ /* This probably indicates a programmer error, but to preserve
+ semantics, scan back to the start of an entry if BEFORE points
+ into the middle of it. */
+ while ((before >= *pargz) && (before[-1] != LT_EOS_CHAR))
+ --before;
+
+ {
+ size_t entry_len = 1+ LT_STRLEN (entry);
+ size_t argz_len = *pargz_len + entry_len;
+ size_t offset = before - *pargz;
+ char *argz = LT_DLREALLOC (char, *pargz, argz_len);
+
+ if (!argz)
+ return ENOMEM;
+
+ /* Make BEFORE point to the equivalent offset in ARGZ that it
+ used to have in *PARGZ incase realloc() moved the block. */
+ before = argz + offset;
+
+ /* Move the ARGZ entries starting at BEFORE up into the new
+ space at the end -- making room to copy ENTRY into the
+ resulting gap. */
+ memmove (before + entry_len, before, *pargz_len - offset);
+ memcpy (before, entry, entry_len);
+
+ /* Assign new values. */
+ *pargz = argz;
+ *pargz_len = argz_len;
+ }
+
+ return 0;
+}
+#endif /* !HAVE_ARGZ_INSERT */
+
+
+#if ! HAVE_ARGZ_NEXT
+# define argz_next rpl_argz_next
+
+static char *argz_next LT_PARAMS((char *argz, size_t argz_len,
+ const char *entry));
+
+static char *
+argz_next (argz, argz_len, entry)
+ char *argz;
+ size_t argz_len;
+ const char *entry;
+{
+ assert ((argz && argz_len) || (!argz && !argz_len));
+
+ if (entry)
+ {
+ /* Either ARGZ/ARGZ_LEN is empty, or ENTRY points into an address
+ within the ARGZ vector. */
+ assert ((!argz && !argz_len)
+ || ((argz <= entry) && (entry < (argz + argz_len))));
+
+ /* Move to the char immediately after the terminating
+ '\0' of ENTRY. */
+ entry = 1+ strchr (entry, LT_EOS_CHAR);
+
+ /* Return either the new ENTRY, or else NULL if ARGZ is
+ exhausted. */
+ return (entry >= argz + argz_len) ? 0 : (char *) entry;
+ }
+ else
+ {
+ /* This should probably be flagged as a programmer error,
+ since starting an argz_next loop with the iterator set
+ to ARGZ is safer. To preserve semantics, handle the NULL
+ case by returning the start of ARGZ (if any). */
+ if (argz_len > 0)
+ return argz;
+ else
+ return 0;
+ }
+}
+#endif /* !HAVE_ARGZ_NEXT */
+
+
+
+#if ! HAVE_ARGZ_STRINGIFY
+# define argz_stringify rpl_argz_stringify
+
+static void argz_stringify LT_PARAMS((char *argz, size_t argz_len,
+ int sep));
+
+static void
+argz_stringify (argz, argz_len, sep)
+ char *argz;
+ size_t argz_len;
+ int sep;
+{
+ assert ((argz && argz_len) || (!argz && !argz_len));
+
+ if (sep)
+ {
+ --argz_len; /* don't stringify the terminating EOS */
+ while (--argz_len > 0)
+ {
+ if (argz[argz_len] == LT_EOS_CHAR)
+ argz[argz_len] = sep;
+ }
+ }
+}
+#endif /* !HAVE_ARGZ_STRINGIFY */
+
+
+
+
+/* --- TYPE DEFINITIONS -- */
-# endif
+/* This type is used for the array of caller data sets in each handler. */
+typedef struct {
+ lt_dlcaller_id key;
+ lt_ptr data;
+} lt_caller_data;
+
+
+
+
+/* --- OPAQUE STRUCTURES DECLARED IN LTDL.H --- */
+
+
+/* Extract the diagnostic strings from the error table macro in the same
+ order as the enumerated indices in ltdl.h. */
+
+static const char *lt_dlerror_strings[] =
+ {
+#define LT_ERROR(name, diagnostic) (diagnostic),
+ lt_dlerror_table
+#undef LT_ERROR
+
+ 0
+ };
+
+/* This structure is used for the list of registered loaders. */
+struct lt_dlloader {
+ struct lt_dlloader *next;
+ const char *loader_name; /* identifying name for each loader */
+ const char *sym_prefix; /* prefix for symbols */
+ lt_module_open *module_open;
+ lt_module_close *module_close;
+ lt_find_sym *find_sym;
+ lt_dlloader_exit *dlloader_exit;
+ lt_user_data dlloader_data;
+};
+
+struct lt_dlhandle_struct {
+ struct lt_dlhandle_struct *next;
+ lt_dlloader *loader; /* dlopening interface */
+ lt_dlinfo info;
+ int depcount; /* number of dependencies */
+ lt_dlhandle *deplibs; /* dependencies */
+ lt_module module; /* system module handle */
+ lt_ptr system; /* system specific data */
+ lt_caller_data *caller_data; /* per caller associated data */
+ int flags; /* various boolean stats */
+};
+
+/* Various boolean flags can be stored in the flags field of an
+ lt_dlhandle_struct... */
+#define LT_DLGET_FLAG(handle, flag) (((handle)->flags & (flag)) == (flag))
+#define LT_DLSET_FLAG(handle, flag) ((handle)->flags |= (flag))
+
+#define LT_DLRESIDENT_FLAG (0x01 << 0)
+/* ...add more flags here... */
+
+#define LT_DLIS_RESIDENT(handle) LT_DLGET_FLAG(handle, LT_DLRESIDENT_FLAG)
+
+
+#define LT_DLSTRERROR(name) lt_dlerror_strings[LT_CONC(LT_ERROR_,name)]
+
+static const char objdir[] = LTDL_OBJDIR;
+static const char archive_ext[] = LTDL_ARCHIVE_EXT;
+#ifdef LTDL_SHLIB_EXT
+static const char shlib_ext[] = LTDL_SHLIB_EXT;
+#endif
+#ifdef LTDL_SYSSEARCHPATH
+static const char sys_search_path[] = LTDL_SYSSEARCHPATH;
#endif
-/* The Cygwin dlopen implementation prints a spurious error message to
- stderr if its call to LoadLibrary() fails for any reason. We can
- mitigate this by not using the Cygwin implementation, and falling
- back to our own LoadLibrary() wrapper. */
-#if HAVE_LIBDL && !defined(__CYGWIN__)
+
+
+
+/* --- MUTEX LOCKING --- */
+
+
+/* Macros to make it easier to run the lock functions only if they have
+ been registered. The reason for the complicated lock macro is to
+ ensure that the stored error message from the last error is not
+ accidentally erased if the current function doesn't generate an
+ error of its own. */
+#define LT_DLMUTEX_LOCK() LT_STMT_START { \
+ if (lt_dlmutex_lock_func) (*lt_dlmutex_lock_func)(); \
+ } LT_STMT_END
+#define LT_DLMUTEX_UNLOCK() LT_STMT_START { \
+ if (lt_dlmutex_unlock_func) (*lt_dlmutex_unlock_func)();\
+ } LT_STMT_END
+#define LT_DLMUTEX_SETERROR(errormsg) LT_STMT_START { \
+ if (lt_dlmutex_seterror_func) \
+ (*lt_dlmutex_seterror_func) (errormsg); \
+ else lt_dllast_error = (errormsg); } LT_STMT_END
+#define LT_DLMUTEX_GETERROR(errormsg) LT_STMT_START { \
+ if (lt_dlmutex_seterror_func) \
+ (errormsg) = (*lt_dlmutex_geterror_func) (); \
+ else (errormsg) = lt_dllast_error; } LT_STMT_END
+
+/* The mutex functions stored here are global, and are necessarily the
+ same for all threads that wish to share access to libltdl. */
+static lt_dlmutex_lock *lt_dlmutex_lock_func = 0;
+static lt_dlmutex_unlock *lt_dlmutex_unlock_func = 0;
+static lt_dlmutex_seterror *lt_dlmutex_seterror_func = 0;
+static lt_dlmutex_geterror *lt_dlmutex_geterror_func = 0;
+static const char *lt_dllast_error = 0;
+
+
+/* Either set or reset the mutex functions. Either all the arguments must
+ be valid functions, or else all can be NULL to turn off locking entirely.
+ The registered functions should be manipulating a static global lock
+ from the lock() and unlock() callbacks, which needs to be reentrant. */
+int
+lt_dlmutex_register (lock, unlock, seterror, geterror)
+ lt_dlmutex_lock *lock;
+ lt_dlmutex_unlock *unlock;
+ lt_dlmutex_seterror *seterror;
+ lt_dlmutex_geterror *geterror;
+{
+ lt_dlmutex_unlock *old_unlock = unlock;
+ int errors = 0;
+
+ /* Lock using the old lock() callback, if any. */
+ LT_DLMUTEX_LOCK ();
+
+ if ((lock && unlock && seterror && geterror)
+ || !(lock || unlock || seterror || geterror))
+ {
+ lt_dlmutex_lock_func = lock;
+ lt_dlmutex_unlock_func = unlock;
+ lt_dlmutex_geterror_func = geterror;
+ }
+ else
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_MUTEX_ARGS));
+ ++errors;
+ }
+
+ /* Use the old unlock() callback we saved earlier, if any. Otherwise
+ record any errors using internal storage. */
+ if (old_unlock)
+ (*old_unlock) ();
+
+ /* Return the number of errors encountered during the execution of
+ this function. */
+ return errors;
+}
+
+
+
+
+/* --- ERROR HANDLING --- */
+
+
+static const char **user_error_strings = 0;
+static int errorcount = LT_ERROR_MAX;
+
+int
+lt_dladderror (diagnostic)
+ const char *diagnostic;
+{
+ int errindex = 0;
+ int result = -1;
+ const char **temp = (const char **) 0;
+
+ assert (diagnostic);
+
+ LT_DLMUTEX_LOCK ();
+
+ errindex = errorcount - LT_ERROR_MAX;
+ temp = LT_EREALLOC (const char *, user_error_strings, 1 + errindex);
+ if (temp)
+ {
+ user_error_strings = temp;
+ user_error_strings[errindex] = diagnostic;
+ result = errorcount++;
+ }
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return result;
+}
+
+int
+lt_dlseterror (errindex)
+ int errindex;
+{
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+
+ if (errindex >= errorcount || errindex < 0)
+ {
+ /* Ack! Error setting the error message! */
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_ERRORCODE));
+ ++errors;
+ }
+ else if (errindex < LT_ERROR_MAX)
+ {
+ /* No error setting the error message! */
+ LT_DLMUTEX_SETERROR (lt_dlerror_strings[errindex]);
+ }
+ else
+ {
+ /* No error setting the error message! */
+ LT_DLMUTEX_SETERROR (user_error_strings[errindex - LT_ERROR_MAX]);
+ }
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
+}
+
+static lt_ptr
+lt_emalloc (size)
+ size_t size;
+{
+ lt_ptr mem = lt_dlmalloc (size);
+ if (size && !mem)
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
+ return mem;
+}
+
+static lt_ptr
+lt_erealloc (addr, size)
+ lt_ptr addr;
+ size_t size;
+{
+ lt_ptr mem = realloc (addr, size);
+ if (size && !mem)
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
+ return mem;
+}
+
+static char *
+lt_estrdup (str)
+ const char *str;
+{
+ char *copy = strdup (str);
+ if (LT_STRLEN (str) && !copy)
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
+ return copy;
+}
+
+
+
+
+/* --- DLOPEN() INTERFACE LOADER --- */
+
+
+#if HAVE_LIBDL
/* dynamic linking with dlopen/dlsym */
#if HAVE_DLFCN_H
-# include <dlfcn.h>
+# include <dlfcn.h>
+#endif
+
+#if HAVE_SYS_DL_H
+# include <sys/dl.h>
#endif
#ifdef RTLD_GLOBAL
-# define LTDL_GLOBAL RTLD_GLOBAL
+# define LT_GLOBAL RTLD_GLOBAL
#else
-# ifdef DL_GLOBAL
-# define LTDL_GLOBAL DL_GLOBAL
-# else
-# define LTDL_GLOBAL 0
-# endif
-#endif
+# ifdef DL_GLOBAL
+# define LT_GLOBAL DL_GLOBAL
+# endif
+#endif /* !RTLD_GLOBAL */
+#ifndef LT_GLOBAL
+# define LT_GLOBAL 0
+#endif /* !LT_GLOBAL */
-/* We may have to define LTDL_LAZY_OR_NOW in the command line if we
+/* We may have to define LT_LAZY_OR_NOW in the command line if we
find out it does not work in some platform. */
-#ifndef LTDL_LAZY_OR_NOW
-# ifdef RTLD_LAZY
-# define LTDL_LAZY_OR_NOW RTLD_LAZY
-# else
-# ifdef DL_LAZY
-# define LTDL_LAZY_OR_NOW DL_LAZY
+#ifndef LT_LAZY_OR_NOW
+# ifdef RTLD_LAZY
+# define LT_LAZY_OR_NOW RTLD_LAZY
+# else
+# ifdef DL_LAZY
+# define LT_LAZY_OR_NOW DL_LAZY
+# endif
+# endif /* !RTLD_LAZY */
+#endif
+#ifndef LT_LAZY_OR_NOW
+# ifdef RTLD_NOW
+# define LT_LAZY_OR_NOW RTLD_NOW
# else
-# ifdef RTLD_NOW
-# define LTDL_LAZY_OR_NOW RTLD_NOW
-# else
# ifdef DL_NOW
-# define LTDL_LAZY_OR_NOW DL_NOW
-# else
-# define LTDL_LAZY_OR_NOW 0
+# define LT_LAZY_OR_NOW DL_NOW
# endif
-# endif
-# endif
-# endif
+# endif /* !RTLD_NOW */
#endif
+#ifndef LT_LAZY_OR_NOW
+# define LT_LAZY_OR_NOW 0
+#endif /* !LT_LAZY_OR_NOW */
-static lt_module_t
-sys_dl_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
-{
- lt_module_t module = dlopen(filename, LTDL_GLOBAL | LTDL_LAZY_OR_NOW);
- if (!module) {
#if HAVE_DLERROR
- last_error = dlerror();
+# define DLERROR(arg) dlerror ()
#else
- last_error = LT_DLSTRERROR(CANNOT_OPEN);
+# define DLERROR(arg) LT_DLSTRERROR (arg)
#endif
- }
- return module;
+
+static lt_module
+sys_dl_open (loader_data, filename)
+ lt_user_data loader_data;
+ const char *filename;
+{
+ lt_module module = dlopen (filename, LT_GLOBAL | LT_LAZY_OR_NOW);
+
+ if (!module)
+ {
+ LT_DLMUTEX_SETERROR (DLERROR (CANNOT_OPEN));
+ }
+
+ return module;
}
static int
sys_dl_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- if (dlclose(module) != 0) {
-#if HAVE_DLERROR
- last_error = dlerror();
-#else
- last_error = LT_DLSTRERROR(CANNOT_CLOSE);
-#endif
- return 1;
- }
- return 0;
+ int errors = 0;
+
+ if (dlclose (module) != 0)
+ {
+ LT_DLMUTEX_SETERROR (DLERROR (CANNOT_CLOSE));
+ ++errors;
+ }
+
+ return errors;
}
-static lt_ptr_t
+static lt_ptr
sys_dl_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
- const char *symbol;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
{
- lt_ptr_t address = dlsym(module, symbol);
-
- if (!address)
-#if HAVE_DLERROR
- last_error = dlerror();
-#else
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
-#endif
- return address;
+ lt_ptr address = dlsym (module, symbol);
+
+ if (!address)
+ {
+ LT_DLMUTEX_SETERROR (DLERROR (SYMBOL_NOT_FOUND));
+ }
+
+ return address;
}
-static struct lt_user_dlloader sys_dl = {
+static struct lt_user_dlloader sys_dl =
+ {
# ifdef NEED_USCORE
- "_",
+ "_",
# else
- 0,
+ 0,
# endif
- sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
-#endif
+ sys_dl_open, sys_dl_close, sys_dl_sym, 0, 0 };
+
+
+#endif /* HAVE_LIBDL */
+
+
+
+/* --- SHL_LOAD() INTERFACE LOADER --- */
#if HAVE_SHL_LOAD
/* dynamic linking with shl_load (HP-UX) (comments from gmodule) */
#ifdef HAVE_DL_H
-#include <dl.h>
+# include <dl.h>
#endif
/* some flags are missing on some systems, so we provide
@@ -362,82 +1174,125 @@ static struct lt_user_dlloader sys_dl = {
* BIND_DEFERRED - Delay code symbol resolution until actual reference.
*
* Optionally:
- * BIND_FIRST - Place the library at the head of the symbol search order.
- * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all unsatisfied
- * symbols as fatal. This flag allows binding of unsatisfied code
- * symbols to be deferred until use.
- * [Perl: For certain libraries, like DCE, deferred binding often
- * causes run time problems. Adding BIND_NONFATAL to BIND_IMMEDIATE
- * still allows unresolved references in situations like this.]
- * BIND_NOSTART - Do not call the initializer for the shared library when the
- * library is loaded, nor on a future call to shl_unload().
- * BIND_VERBOSE - Print verbose messages concerning possible unsatisfied symbols.
+ * BIND_FIRST - Place the library at the head of the symbol search
+ * order.
+ * BIND_NONFATAL - The default BIND_IMMEDIATE behavior is to treat all
+ * unsatisfied symbols as fatal. This flag allows
+ * binding of unsatisfied code symbols to be deferred
+ * until use.
+ * [Perl: For certain libraries, like DCE, deferred
+ * binding often causes run time problems. Adding
+ * BIND_NONFATAL to BIND_IMMEDIATE still allows
+ * unresolved references in situations like this.]
+ * BIND_NOSTART - Do not call the initializer for the shared library
+ * when the library is loaded, nor on a future call to
+ * shl_unload().
+ * BIND_VERBOSE - Print verbose messages concerning possible
+ * unsatisfied symbols.
*
* hp9000s700/hp9000s800:
- * BIND_RESTRICTED - Restrict symbols visible by the library to those present at
- * library load time.
- * DYNAMIC_PATH - Allow the loader to dynamically search for the library specified
- * by the path argument.
+ * BIND_RESTRICTED - Restrict symbols visible by the library to those
+ * present at library load time.
+ * DYNAMIC_PATH - Allow the loader to dynamically search for the
+ * library specified by the path argument.
*/
#ifndef DYNAMIC_PATH
-#define DYNAMIC_PATH 0
-#endif /* DYNAMIC_PATH */
+# define DYNAMIC_PATH 0
+#endif
#ifndef BIND_RESTRICTED
-#define BIND_RESTRICTED 0
-#endif /* BIND_RESTRICTED */
+# define BIND_RESTRICTED 0
+#endif
-#define LTDL_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
+#define LT_BIND_FLAGS (BIND_IMMEDIATE | BIND_NONFATAL | DYNAMIC_PATH)
-static lt_module_t
+static lt_module
sys_shl_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
+ lt_user_data loader_data;
+ const char *filename;
{
- lt_module_t module = shl_load(filename, LTDL_BIND_FLAGS, 0L);
- if (!module) {
- last_error = LT_DLSTRERROR(CANNOT_OPEN);
+ static shl_t self = (shl_t) 0;
+ lt_module module = shl_load (filename, LT_BIND_FLAGS, 0L);
+
+ /* Since searching for a symbol against a NULL module handle will also
+ look in everything else that was already loaded and exported with
+ the -E compiler flag, we always cache a handle saved before any
+ modules are loaded. */
+ if (!self)
+ {
+ lt_ptr address;
+ shl_findsym (&self, "main", TYPE_UNDEFINED, &address);
+ }
+
+ if (!filename)
+ {
+ module = self;
+ }
+ else
+ {
+ module = shl_load (filename, LT_BIND_FLAGS, 0L);
+
+ if (!module)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
}
- return module;
+ }
+
+ return module;
}
static int
sys_shl_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- if (shl_unload((shl_t) (module)) != 0) {
- last_error = LT_DLSTRERROR(CANNOT_CLOSE);
- return 1;
- }
- return 0;
+ int errors = 0;
+
+ if (module && (shl_unload ((shl_t) (module)) != 0))
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
+ ++errors;
+ }
+
+ return errors;
}
-static lt_ptr_t
+static lt_ptr
sys_shl_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
- const char *symbol;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
{
- lt_ptr_t address;
+ lt_ptr address = 0;
+
+ /* sys_shl_open should never return a NULL module handle */
+ if (module == (lt_module) 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ }
+ else if (!shl_findsym((shl_t*) &module, symbol, TYPE_UNDEFINED, &address))
+ {
+ if (!address)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+ }
+ }
- if (module && shl_findsym((shl_t*) &module,
- symbol, TYPE_UNDEFINED, &address) == 0)
- if (address)
- return address;
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return 0;
+ return address;
}
-static struct lt_user_dlloader
-sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 };
+static struct lt_user_dlloader sys_shl = {
+ 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0
+};
-#undef LTDL_TYPE_TOP
-#define LTDL_TYPE_TOP &sys_shl
+#endif /* HAVE_SHL_LOAD */
-#endif
-#ifdef _WIN32
+
+
+/* --- LOADLIBRARY() INTERFACE LOADER --- */
+
+#ifdef __WINDOWS__
/* dynamic linking for Win32 */
@@ -446,99 +1301,136 @@ sys_shl = { 0, sys_shl_open, sys_shl_close, sys_shl_sym, 0, 0 };
/* Forward declaration; required to implement handle search below. */
static lt_dlhandle handles;
-static lt_module_t
+static lt_module
sys_wll_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
-{
- lt_dlhandle cur;
- lt_module_t module;
- char *searchname = 0;
- char *ext;
- char self_name_buf[MAX_PATH];
-
- if (!filename) {
- /* Get the name of main module */
- *self_name_buf = 0;
- GetModuleFileName(NULL, self_name_buf, sizeof(self_name_buf));
- filename = ext = self_name_buf;
- }
- else ext = strrchr(filename, '.');
-
- if (ext) {
- /* FILENAME already has an extension. */
- searchname = strdup(filename);
- } else {
- /* Append a `.' to stop Windows from adding an
- implicit `.dll' extension. */
- searchname = (char*)lt_dlmalloc(2+ strlen(filename));
- if (!searchname) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 0;
- }
- strcpy(searchname, filename);
- strcat(searchname, ".");
+ lt_user_data loader_data;
+ const char *filename;
+{
+ lt_dlhandle cur;
+ lt_module module = 0;
+ const char *errormsg = 0;
+ char *searchname = 0;
+ char *ext;
+ char self_name_buf[MAX_PATH];
+
+ if (!filename)
+ {
+ /* Get the name of main module */
+ *self_name_buf = 0;
+ GetModuleFileName (NULL, self_name_buf, sizeof (self_name_buf));
+ filename = ext = self_name_buf;
+ }
+ else
+ {
+ ext = strrchr (filename, '.');
+ }
+
+ if (ext)
+ {
+ /* FILENAME already has an extension. */
+ searchname = lt_estrdup (filename);
+ }
+ else
+ {
+ /* Append a `.' to stop Windows from adding an
+ implicit `.dll' extension. */
+ searchname = LT_EMALLOC (char, 2+ LT_STRLEN (filename));
+ if (searchname)
+ sprintf (searchname, "%s.", filename);
+ }
+ if (!searchname)
+ return 0;
+
+#if __CYGWIN__
+ {
+ char wpath[MAX_PATH];
+ cygwin_conv_to_full_win32_path(searchname, wpath);
+ module = LoadLibrary(wpath);
+ }
+#else
+ module = LoadLibrary (searchname);
+#endif
+ LT_DLFREE (searchname);
+
+ /* libltdl expects this function to fail if it is unable
+ to physically load the library. Sadly, LoadLibrary
+ will search the loaded libraries for a match and return
+ one of them if the path search load fails.
+
+ We check whether LoadLibrary is returning a handle to
+ an already loaded module, and simulate failure if we
+ find one. */
+ LT_DLMUTEX_LOCK ();
+ cur = handles;
+ while (cur)
+ {
+ if (!cur->module)
+ {
+ cur = 0;
+ break;
}
- module = LoadLibrary(searchname);
- lt_dlfree(searchname);
-
- /* libltdl expects this function to fail if it is unable
- to physically load the library. Sadly, LoadLibrary
- will search the loaded libraries for a match and return
- one of them if the path search load fails.
-
- We check whether LoadLibrary is returning a handle to
- an already loaded module, and simulate failure if we
- find one. */
- cur = handles;
- while (cur) {
- if (!cur->module) {
- cur = 0;
- break;
- }
- if (cur->module == module)
- break;
- cur = cur->next;
+ if (cur->module == module)
+ {
+ break;
}
- if (cur || !module) {
- last_error = LT_DLSTRERROR(CANNOT_OPEN);
- return 0;
- }
+ cur = cur->next;
+ }
+ LT_DLMUTEX_UNLOCK ();
- return module;
+ if (cur || !module)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
+ module = 0;
+ }
+
+ return module;
}
static int
sys_wll_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- if (FreeLibrary(module) == 0) {
- last_error = LT_DLSTRERROR(CANNOT_CLOSE);
- return 1;
- }
- return 0;
+ int errors = 0;
+
+ if (FreeLibrary(module) == 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
+ ++errors;
+ }
+
+ return errors;
}
-static lt_ptr_t
+static lt_ptr
sys_wll_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
- const char *symbol;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
{
- lt_ptr_t address = GetProcAddress(module, symbol);
-
- if (!address)
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return address;
+ lt_ptr address = GetProcAddress (module, symbol);
+
+ if (!address)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+ }
+
+ return address;
}
-static struct lt_user_dlloader
-sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 };
+static struct lt_user_dlloader sys_wll = {
+ 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0
+};
+
+#endif /* __WINDOWS__ */
+
+
+
+
+/* --- LOAD_ADD_ON() INTERFACE LOADER --- */
-#endif
#ifdef __BEOS__
@@ -546,62 +1438,79 @@ sys_wll = { 0, sys_wll_open, sys_wll_close, sys_wll_sym, 0, 0 };
#include <kernel/image.h>
-static lt_module_t
+static lt_module
sys_bedl_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
+ lt_user_data loader_data;
+ const char *filename;
{
- image_id image = 0;
-
- if (filename) {
- image = load_add_on(filename);
- } else {
- image_info info;
- int32 cookie = 0;
- if (get_next_image_info(0, &cookie, &info) == B_OK)
- image = load_add_on(info.name);
- }
- if (image <= 0) {
- last_error = LT_DLSTRERROR(CANNOT_OPEN);
- return 0;
- }
-
- return (lt_module_t) image;
+ image_id image = 0;
+
+ if (filename)
+ {
+ image = load_add_on (filename);
+ }
+ else
+ {
+ image_info info;
+ int32 cookie = 0;
+ if (get_next_image_info (0, &cookie, &info) == B_OK)
+ image = load_add_on (info.name);
+ }
+
+ if (image <= 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
+ image = 0;
+ }
+
+ return (lt_module) image;
}
static int
sys_bedl_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- if (unload_add_on((image_id)module) != B_OK) {
- last_error = LT_DLSTRERROR(CANNOT_CLOSE);
- return 1;
- }
- return 0;
+ int errors = 0;
+
+ if (unload_add_on ((image_id) module) != B_OK)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
+ ++errors;
+ }
+
+ return errors;
}
-static lt_ptr_t
+static lt_ptr
sys_bedl_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
- const char *symbol;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
{
- lt_ptr_t address = 0;
- image_id image = (image_id)module;
-
- if (get_image_symbol(image, symbol, B_SYMBOL_TYPE_ANY,
- &address) != B_OK) {
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return 0;
- }
- return address;
+ lt_ptr address = 0;
+ image_id image = (image_id) module;
+
+ if (get_image_symbol (image, symbol, B_SYMBOL_TYPE_ANY, address) != B_OK)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+ address = 0;
+ }
+
+ return address;
}
-static struct lt_user_dlloader
-sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 };
+static struct lt_user_dlloader sys_bedl = {
+ 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0
+};
+
+#endif /* __BEOS__ */
+
+
+
+
+/* --- DLD_LINK() INTERFACE LOADER --- */
-#endif
#if HAVE_DLD
@@ -611,1374 +1520,2967 @@ sys_bedl = { 0, sys_bedl_open, sys_bedl_close, sys_bedl_sym, 0, 0 };
#include <dld.h>
#endif
-static lt_module_t
+static lt_module
sys_dld_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
+ lt_user_data loader_data;
+ const char *filename;
{
- lt_module_t module = strdup(filename);
- if (!module) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 0;
- }
- if (dld_link(filename) != 0) {
- last_error = LT_DLSTRERROR(CANNOT_OPEN);
- lt_dlfree(module);
- return 0;
- }
- return module;
+ lt_module module = strdup (filename);
+
+ if (dld_link (filename) != 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_OPEN));
+ LT_DLFREE (module);
+ module = 0;
+ }
+
+ return module;
}
static int
sys_dld_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- if (dld_unlink_by_file((char*)(module), 1) != 0) {
- last_error = LT_DLSTRERROR(CANNOT_CLOSE);
- return 1;
- }
- lt_dlfree(module);
- return 0;
+ int errors = 0;
+
+ if (dld_unlink_by_file ((char*)(module), 1) != 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CANNOT_CLOSE));
+ ++errors;
+ }
+ else
+ {
+ LT_DLFREE (module);
+ }
+
+ return errors;
}
-static lt_ptr_t
+static lt_ptr
sys_dld_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
+{
+ lt_ptr address = dld_get_func (symbol);
+
+ if (!address)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+ }
+
+ return address;
+}
+
+static struct lt_user_dlloader sys_dld = {
+ 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0
+};
+
+#endif /* HAVE_DLD */
+
+/* --- DYLD() MACOSX/DARWIN INTERFACE LOADER --- */
+#if HAVE_DYLD
+
+
+#if HAVE_MACH_O_DYLD_H
+# include <mach-o/dyld.h>
+#endif
+#include <mach-o/getsect.h>
+
+/* We have to put some stuff here that isn't in older dyld.h files */
+#ifndef ENUM_DYLD_BOOL
+# define ENUM_DYLD_BOOL
+# undef FALSE
+# undef TRUE
+ enum DYLD_BOOL {
+ FALSE,
+ TRUE
+ };
+#endif
+#ifndef LC_REQ_DYLD
+# define LC_REQ_DYLD 0x80000000
+#endif
+#ifndef LC_LOAD_WEAK_DYLIB
+# define LC_LOAD_WEAK_DYLIB (0x18 | LC_REQ_DYLD)
+#endif
+static const struct mach_header * (*ltdl_NSAddImage)(const char *image_name, unsigned long options) = 0;
+static NSSymbol (*ltdl_NSLookupSymbolInImage)(const struct mach_header *image,const char *symbolName, unsigned long options) = 0;
+static enum DYLD_BOOL (*ltdl_NSIsSymbolNameDefinedInImage)(const struct mach_header *image, const char *symbolName) = 0;
+static enum DYLD_BOOL (*ltdl_NSMakePrivateModulePublic)(NSModule module) = 0;
+
+#ifndef NSADDIMAGE_OPTION_NONE
+#define NSADDIMAGE_OPTION_NONE 0x0
+#endif
+#ifndef NSADDIMAGE_OPTION_RETURN_ON_ERROR
+#define NSADDIMAGE_OPTION_RETURN_ON_ERROR 0x1
+#endif
+#ifndef NSADDIMAGE_OPTION_WITH_SEARCHING
+#define NSADDIMAGE_OPTION_WITH_SEARCHING 0x2
+#endif
+#ifndef NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED
+#define NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED 0x4
+#endif
+#ifndef NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME
+#define NSADDIMAGE_OPTION_MATCH_FILENAME_BY_INSTALLNAME 0x8
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND 0x0
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW 0x1
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_FULLY 0x2
+#endif
+#ifndef NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+#define NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR 0x4
+#endif
+
+
+static const char *
+lt_int_dyld_error(othererror)
+ char* othererror;
+{
+/* return the dyld error string, or the passed in error string if none */
+ NSLinkEditErrors ler;
+ int lerno;
+ const char *errstr;
+ const char *file;
+ NSLinkEditError(&ler,&lerno,&file,&errstr);
+ if (!errstr || !strlen(errstr)) errstr = othererror;
+ return errstr;
+}
+
+static const struct mach_header *
+lt_int_dyld_get_mach_header_from_nsmodule(module)
+ NSModule module;
+{
+/* There should probably be an apple dyld api for this */
+ int i=_dyld_image_count();
+ int j;
+ const char *modname=NSNameOfModule(module);
+ const struct mach_header *mh=NULL;
+ if (!modname) return NULL;
+ for (j = 0; j < i; j++)
+ {
+ if (!strcmp(_dyld_get_image_name(j),modname))
+ {
+ mh=_dyld_get_image_header(j);
+ break;
+ }
+ }
+ return mh;
+}
+
+static const char* lt_int_dyld_lib_install_name(mh)
+ const struct mach_header *mh;
+{
+/* NSAddImage is also used to get the loaded image, but it only works if the lib
+ is installed, for uninstalled libs we need to check the install_names against
+ each other. Note that this is still broken if DYLD_IMAGE_SUFFIX is set and a
+ different lib was loaded as a result
+*/
+ int j;
+ struct load_command *lc;
+ unsigned long offset = sizeof(struct mach_header);
+ const struct mach_header *mh1;
+ const char* retStr=NULL;
+ for (j = 0; j < mh->ncmds; j++)
+ {
+ lc = (struct load_command*)(((unsigned long)mh) + offset);
+ if (LC_ID_DYLIB == lc->cmd)
+ {
+ retStr=(char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ (unsigned long)lc);
+ }
+ offset += lc->cmdsize;
+ }
+ return retStr;
+}
+
+static const struct mach_header *
+lt_int_dyld_match_loaded_lib_by_install_name(const char *name)
+{
+ int i=_dyld_image_count();
+ int j;
+ const struct mach_header *mh=NULL;
+ const char *id=NULL;
+ for (j = 0; j < i; j++)
+ {
+ id=lt_int_dyld_lib_install_name(_dyld_get_image_header(j));
+ if ((id) && (!strcmp(id,name)))
+ {
+ mh=_dyld_get_image_header(j);
+ break;
+ }
+ }
+ return mh;
+}
+
+static NSSymbol
+lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh)
const char *symbol;
+ const struct mach_header *mh;
{
- lt_ptr_t address = dld_get_func(symbol);
+ /* Safe to assume our mh is good */
+ int j;
+ struct load_command *lc;
+ unsigned long offset = sizeof(struct mach_header);
+ NSSymbol retSym = 0;
+ const struct mach_header *mh1;
+ if ((ltdl_NSLookupSymbolInImage) && NSIsSymbolNameDefined(symbol) )
+ {
+ for (j = 0; j < mh->ncmds; j++)
+ {
+ lc = (struct load_command*)(((unsigned long)mh) + offset);
+ if ((LC_LOAD_DYLIB == lc->cmd) || (LC_LOAD_WEAK_DYLIB == lc->cmd))
+ {
+ mh1=lt_int_dyld_match_loaded_lib_by_install_name((char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ (unsigned long)lc));
+ if (!mh1)
+ {
+ /* Maybe NSAddImage can find it */
+ mh1=ltdl_NSAddImage((char*)(((struct dylib_command*)lc)->dylib.name.offset +
+ (unsigned long)lc),
+ NSADDIMAGE_OPTION_RETURN_ONLY_IF_LOADED +
+ NSADDIMAGE_OPTION_WITH_SEARCHING +
+ NSADDIMAGE_OPTION_RETURN_ON_ERROR );
+ }
+ if (mh1)
+ {
+ retSym = ltdl_NSLookupSymbolInImage(mh1,
+ symbol,
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+ );
+ if (retSym) break;
+ }
+ }
+ offset += lc->cmdsize;
+ }
+ }
+ return retSym;
+}
- if (!address)
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return address;
+static int
+sys_dyld_init()
+{
+ int retCode = 0;
+ int err = 0;
+ if (!_dyld_present()) {
+ retCode=1;
+ }
+ else {
+ err = _dyld_func_lookup("__dyld_NSAddImage",(unsigned long*)&ltdl_NSAddImage);
+ err = _dyld_func_lookup("__dyld_NSLookupSymbolInImage",(unsigned long*)&ltdl_NSLookupSymbolInImage);
+ err = _dyld_func_lookup("__dyld_NSIsSymbolNameDefinedInImage",(unsigned long*)&ltdl_NSIsSymbolNameDefinedInImage);
+ err = _dyld_func_lookup("__dyld_NSMakePrivateModulePublic",(unsigned long*)&ltdl_NSMakePrivateModulePublic);
+ }
+ return retCode;
}
-static struct lt_user_dlloader
-sys_dld = { 0, sys_dld_open, sys_dld_close, sys_dld_sym, 0, 0 };
+static lt_module
+sys_dyld_open (loader_data, filename)
+ lt_user_data loader_data;
+ const char *filename;
+{
+ lt_module module = 0;
+ NSObjectFileImage ofi = 0;
+ NSObjectFileImageReturnCode ofirc;
+
+ if (!filename)
+ return (lt_module)-1;
+ ofirc = NSCreateObjectFileImageFromFile(filename, &ofi);
+ switch (ofirc)
+ {
+ case NSObjectFileImageSuccess:
+ module = NSLinkModule(ofi, filename,
+ NSLINKMODULE_OPTION_RETURN_ON_ERROR
+ | NSLINKMODULE_OPTION_PRIVATE
+ | NSLINKMODULE_OPTION_BINDNOW);
+ NSDestroyObjectFileImage(ofi);
+ if (module)
+ ltdl_NSMakePrivateModulePublic(module);
+ break;
+ case NSObjectFileImageInappropriateFile:
+ if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
+ {
+ module = (lt_module)ltdl_NSAddImage(filename, NSADDIMAGE_OPTION_RETURN_ON_ERROR);
+ break;
+ }
+ default:
+ LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN)));
+ return 0;
+ }
+ if (!module) LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_OPEN)));
+ return module;
+}
+static int
+sys_dyld_close (loader_data, module)
+ lt_user_data loader_data;
+ lt_module module;
+{
+ int retCode = 0;
+ int flags = 0;
+ unsigned long size=0;
+ if (module == (lt_module)-1) return 0;
+#ifdef __BIG_ENDIAN__
+ if (((struct mach_header *)module)->magic == MH_MAGIC)
+#else
+ if (((struct mach_header *)module)->magic == MH_CIGAM)
+#endif
+ {
+ LT_DLMUTEX_SETERROR("Can not close a dylib");
+ retCode = 1;
+ }
+ else
+ {
+#if 1
+/* Currently, if a module contains c++ static destructors and it is unloaded, we
+ get a segfault in atexit(), due to compiler and dynamic loader differences of
+ opinion, this works around that.
+*/
+ if ((const struct section *)NULL !=
+ getsectbynamefromheader(lt_int_dyld_get_mach_header_from_nsmodule(module),
+ "__DATA","__mod_term_func"))
+ {
+ flags += NSUNLINKMODULE_OPTION_KEEP_MEMORY_MAPPED;
+ }
+#endif
+#ifdef __ppc__
+ flags += NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES;
#endif
+ if (!NSUnLinkModule(module,flags))
+ {
+ retCode=1;
+ LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(CANNOT_CLOSE)));
+ }
+ }
+
+ return retCode;
+}
+
+static lt_ptr
+sys_dyld_sym (loader_data, module, symbol)
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
+{
+ lt_ptr address = 0;
+ NSSymbol *nssym = 0;
+ void *unused;
+ const struct mach_header *mh=NULL;
+ if (module == (lt_module)-1)
+ {
+ _dyld_lookup_and_bind(symbol,(unsigned long*)&address,&unused);
+ return address;
+ }
+#ifdef __BIG_ENDIAN__
+ if (((struct mach_header *)module)->magic == MH_MAGIC)
+#else
+ if (((struct mach_header *)module)->magic == MH_CIGAM)
+#endif
+ {
+ if (ltdl_NSIsSymbolNameDefinedInImage && ltdl_NSLookupSymbolInImage)
+ {
+ mh=module;
+ if (ltdl_NSIsSymbolNameDefinedInImage((struct mach_header*)module,symbol))
+ {
+ nssym = ltdl_NSLookupSymbolInImage((struct mach_header*)module,
+ symbol,
+ NSLOOKUPSYMBOLINIMAGE_OPTION_BIND_NOW
+ | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR
+ );
+ }
+ }
+
+ }
+ else {
+ nssym = NSLookupSymbolInModule(module, symbol);
+ }
+ if (!nssym)
+ {
+ if (!mh) mh=lt_int_dyld_get_mach_header_from_nsmodule(module);
+ nssym = lt_int_dyld_NSlookupSymbolInLinkedLibs(symbol,mh);
+ }
+ if (!nssym)
+ {
+ LT_DLMUTEX_SETERROR (lt_int_dyld_error(LT_DLSTRERROR(SYMBOL_NOT_FOUND)));
+ return NULL;
+ }
+ return NSAddressOfSymbol(nssym);
+}
+
+static struct lt_user_dlloader sys_dyld =
+ { "_", sys_dyld_open, sys_dyld_close, sys_dyld_sym, 0, 0 };
+
+
+#endif /* HAVE_DYLD */
+
+
+/* --- DLPREOPEN() INTERFACE LOADER --- */
+
/* emulate dynamic linking using preloaded_symbols */
-typedef struct lt_dlsymlists_t {
- struct lt_dlsymlists_t *next;
- const lt_dlsymlist *syms;
+typedef struct lt_dlsymlists_t
+{
+ struct lt_dlsymlists_t *next;
+ const lt_dlsymlist *syms;
} lt_dlsymlists_t;
-static const lt_dlsymlist *default_preloaded_symbols = 0;
-static lt_dlsymlists_t *preloaded_symbols = 0;
+static const lt_dlsymlist *default_preloaded_symbols = 0;
+static lt_dlsymlists_t *preloaded_symbols = 0;
static int
presym_init (loader_data)
- lt_dlloader_data_t loader_data;
+ lt_user_data loader_data;
{
- preloaded_symbols = 0;
- if (default_preloaded_symbols)
- return lt_dlpreload(default_preloaded_symbols);
- return 0;
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+
+ preloaded_symbols = 0;
+ if (default_preloaded_symbols)
+ {
+ errors = lt_dlpreload (default_preloaded_symbols);
+ }
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
}
static int
-presym_free_symlists LTDL_PARAMS((void))
+presym_free_symlists ()
{
- lt_dlsymlists_t *lists = preloaded_symbols;
-
- while (lists) {
- lt_dlsymlists_t *tmp = lists;
-
- lists = lists->next;
- lt_dlfree(tmp);
- }
- preloaded_symbols = 0;
- return 0;
+ lt_dlsymlists_t *lists;
+
+ LT_DLMUTEX_LOCK ();
+
+ lists = preloaded_symbols;
+ while (lists)
+ {
+ lt_dlsymlists_t *tmp = lists;
+
+ lists = lists->next;
+ LT_DLFREE (tmp);
+ }
+ preloaded_symbols = 0;
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return 0;
}
static int
presym_exit (loader_data)
- lt_dlloader_data_t loader_data;
+ lt_user_data loader_data;
{
- presym_free_symlists();
- return 0;
+ presym_free_symlists ();
+ return 0;
}
static int
presym_add_symlist (preloaded)
- const lt_dlsymlist *preloaded;
+ const lt_dlsymlist *preloaded;
{
- lt_dlsymlists_t *tmp;
- lt_dlsymlists_t *lists = preloaded_symbols;
-
- while (lists) {
- if (lists->syms == preloaded)
- return 0;
- lists = lists->next;
+ lt_dlsymlists_t *tmp;
+ lt_dlsymlists_t *lists;
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+
+ lists = preloaded_symbols;
+ while (lists)
+ {
+ if (lists->syms == preloaded)
+ {
+ goto done;
}
-
- tmp = (lt_dlsymlists_t*) lt_dlmalloc(sizeof(lt_dlsymlists_t));
- if (!tmp) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- tmp->syms = preloaded;
- tmp->next = preloaded_symbols;
- preloaded_symbols = tmp;
- return 0;
+ lists = lists->next;
+ }
+
+ tmp = LT_EMALLOC (lt_dlsymlists_t, 1);
+ if (tmp)
+ {
+ memset (tmp, 0, sizeof(lt_dlsymlists_t));
+ tmp->syms = preloaded;
+ tmp->next = preloaded_symbols;
+ preloaded_symbols = tmp;
+ }
+ else
+ {
+ ++errors;
+ }
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+ return errors;
}
-static lt_module_t
+static lt_module
presym_open (loader_data, filename)
- lt_dlloader_data_t loader_data;
- const char *filename;
+ lt_user_data loader_data;
+ const char *filename;
{
- lt_dlsymlists_t *lists = preloaded_symbols;
-
- if (!lists) {
- last_error = LT_DLSTRERROR(NO_SYMBOLS);
- return 0;
- }
- if (!filename)
- filename = "@PROGRAM@";
- while (lists) {
- const lt_dlsymlist *syms = lists->syms;
-
- while (syms->name) {
- if (!syms->address &&
- strcmp(syms->name, filename) == 0) {
- return (lt_module_t) syms;
- }
- syms++;
- }
- lists = lists->next;
+ lt_dlsymlists_t *lists;
+ lt_module module = (lt_module) 0;
+
+ LT_DLMUTEX_LOCK ();
+ lists = preloaded_symbols;
+
+ if (!lists)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_SYMBOLS));
+ goto done;
+ }
+
+ /* Can't use NULL as the reflective symbol header, as NULL is
+ used to mark the end of the entire symbol list. Self-dlpreopened
+ symbols follow this magic number, chosen to be an unlikely
+ clash with a real module name. */
+ if (!filename)
+ {
+ filename = "@PROGRAM@";
+ }
+
+ while (lists)
+ {
+ const lt_dlsymlist *syms = lists->syms;
+
+ while (syms->name)
+ {
+ if (!syms->address && strcmp(syms->name, filename) == 0)
+ {
+ module = (lt_module) syms;
+ goto done;
+ }
+ ++syms;
}
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
- return 0;
+
+ lists = lists->next;
+ }
+
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+ return module;
}
static int
presym_close (loader_data, module)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
+ lt_user_data loader_data;
+ lt_module module;
{
- /* Just to silence gcc -Wall */
- module = 0;
- return 0;
+ /* Just to silence gcc -Wall */
+ module = 0;
+ return 0;
}
-static lt_ptr_t
+static lt_ptr
presym_sym (loader_data, module, symbol)
- lt_dlloader_data_t loader_data;
- lt_module_t module;
- const char *symbol;
+ lt_user_data loader_data;
+ lt_module module;
+ const char *symbol;
{
- lt_dlsymlist *syms = (lt_dlsymlist*)(module);
-
- syms++;
- while (syms->address) {
- if (strcmp(syms->name, symbol) == 0)
- return syms->address;
- syms++;
+ lt_dlsymlist *syms = (lt_dlsymlist*) module;
+
+ ++syms;
+ while (syms->address)
+ {
+ if (strcmp(syms->name, symbol) == 0)
+ {
+ return syms->address;
}
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return 0;
+
+ ++syms;
+ }
+
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+
+ return 0;
}
-static struct lt_user_dlloader
-presym = { 0, presym_open, presym_close, presym_sym, presym_exit, 0 };
+static struct lt_user_dlloader presym = {
+ 0, presym_open, presym_close, presym_sym, presym_exit, 0
+};
+
-static char *user_search_path = 0;
-static lt_dlloader_t *loaders = 0;
-static lt_dlhandle handles = 0;
-static int initialized = 0;
+
+/* --- DYNAMIC MODULE LOADING --- */
+
+
+/* The type of a function used at each iteration of foreach_dirinpath(). */
+typedef int foreach_callback_func LT_PARAMS((char *filename, lt_ptr data1,
+ lt_ptr data2));
+
+static int foreach_dirinpath LT_PARAMS((const char *search_path,
+ const char *base_name,
+ foreach_callback_func *func,
+ lt_ptr data1, lt_ptr data2));
+
+static int find_file_callback LT_PARAMS((char *filename, lt_ptr data,
+ lt_ptr ignored));
+static int find_handle_callback LT_PARAMS((char *filename, lt_ptr data,
+ lt_ptr ignored));
+static int foreachfile_callback LT_PARAMS((char *filename, lt_ptr data1,
+ lt_ptr data2));
+
+
+static int canonicalize_path LT_PARAMS((const char *path,
+ char **pcanonical));
+static int argzize_path LT_PARAMS((const char *path,
+ char **pargz,
+ size_t *pargz_len));
+static FILE *find_file LT_PARAMS((const char *search_path,
+ const char *base_name,
+ char **pdir));
+static lt_dlhandle *find_handle LT_PARAMS((const char *search_path,
+ const char *base_name,
+ lt_dlhandle *handle));
+static int find_module LT_PARAMS((lt_dlhandle *handle,
+ const char *dir,
+ const char *libdir,
+ const char *dlname,
+ const char *old_name,
+ int installed));
+static int free_vars LT_PARAMS((char *dlname, char *oldname,
+ char *libdir, char *deplibs));
+static int load_deplibs LT_PARAMS((lt_dlhandle handle,
+ char *deplibs));
+static int trim LT_PARAMS((char **dest,
+ const char *str));
+static int try_dlopen LT_PARAMS((lt_dlhandle *handle,
+ const char *filename));
+static int tryall_dlopen LT_PARAMS((lt_dlhandle *handle,
+ const char *filename));
+static int unload_deplibs LT_PARAMS((lt_dlhandle handle));
+static int lt_argz_insert LT_PARAMS((char **pargz,
+ size_t *pargz_len,
+ char *before,
+ const char *entry));
+static int lt_argz_insertinorder LT_PARAMS((char **pargz,
+ size_t *pargz_len,
+ const char *entry));
+static int lt_argz_insertdir LT_PARAMS((char **pargz,
+ size_t *pargz_len,
+ const char *dirnam,
+ struct dirent *dp));
+static int lt_dlpath_insertdir LT_PARAMS((char **ppath,
+ char *before,
+ const char *dir));
+static int list_files_by_dir LT_PARAMS((const char *dirnam,
+ char **pargz,
+ size_t *pargz_len));
+static int file_not_found LT_PARAMS((void));
+
+static char *user_search_path= 0;
+static lt_dlloader *loaders = 0;
+static lt_dlhandle handles = 0;
+static int initialized = 0;
+
+/* Initialize libltdl. */
int
-lt_dlinit LTDL_PARAMS((void))
+lt_dlinit ()
{
- /* initialize libltdl */
- int errors = 0;
+ int errors = 0;
- if (initialized) { /* Initialize only at first call. */
- initialized++;
- return 0;
- }
- handles = 0;
- user_search_path = 0; /* empty search path */
-
-#if HAVE_LIBDL && !defined(__CYGWIN__)
- errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dl, "dlopen");
-#endif
+ LT_DLMUTEX_LOCK ();
+
+ /* Initialize only at first call. */
+ if (++initialized == 1)
+ {
+ handles = 0;
+ user_search_path = 0; /* empty search path */
+
+#if HAVE_LIBDL
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dl, "dlopen");
+#endif
#if HAVE_SHL_LOAD
- errors += lt_dlloader_add (lt_dlloader_next(0), &sys_shl, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_shl, "dlopen");
#endif
-#ifdef _WIN32
- errors += lt_dlloader_add (lt_dlloader_next(0), &sys_wll, "dlopen");
+#ifdef __WINDOWS__
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_wll, "dlopen");
#endif
#ifdef __BEOS__
- errors += lt_dlloader_add (lt_dlloader_next(0), &sys_bedl, "dlopen");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_bedl, "dlopen");
#endif
#if HAVE_DLD
- errors += lt_dlloader_add (lt_dlloader_next(0), &sys_dld, "dld");
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dld, "dld");
#endif
- errors += lt_dlloader_add (lt_dlloader_next(0), &presym, "dlpreload");
- if (presym_init(presym.dlloader_data)) {
- last_error = LT_DLSTRERROR(INIT_LOADER);
- return 1;
- }
+#if HAVE_DYLD
+ errors += lt_dlloader_add (lt_dlloader_next (0), &sys_dyld, "dyld");
+ errors += sys_dyld_init();
+#endif
+ errors += lt_dlloader_add (lt_dlloader_next (0), &presym, "dlpreload");
- if (errors != 0) {
- last_error = LT_DLSTRERROR(DLOPEN_NOT_SUPPORTED);
- return 1;
+ if (presym_init (presym.dlloader_data))
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INIT_LOADER));
+ ++errors;
}
- last_error = 0;
- initialized = 1;
- return 0;
+ else if (errors != 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (DLOPEN_NOT_SUPPORTED));
+ ++errors;
+ }
+ }
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
}
int
lt_dlpreload (preloaded)
- const lt_dlsymlist *preloaded;
+ const lt_dlsymlist *preloaded;
{
- if (preloaded)
- return presym_add_symlist(preloaded);
- presym_free_symlists();
- if (default_preloaded_symbols)
- return lt_dlpreload(default_preloaded_symbols);
- return 0;
+ int errors = 0;
+
+ if (preloaded)
+ {
+ errors = presym_add_symlist (preloaded);
+ }
+ else
+ {
+ presym_free_symlists();
+
+ LT_DLMUTEX_LOCK ();
+ if (default_preloaded_symbols)
+ {
+ errors = lt_dlpreload (default_preloaded_symbols);
+ }
+ LT_DLMUTEX_UNLOCK ();
+ }
+
+ return errors;
}
int
lt_dlpreload_default (preloaded)
- const lt_dlsymlist *preloaded;
+ const lt_dlsymlist *preloaded;
{
- default_preloaded_symbols = preloaded;
- return 0;
+ LT_DLMUTEX_LOCK ();
+ default_preloaded_symbols = preloaded;
+ LT_DLMUTEX_UNLOCK ();
+ return 0;
}
int
-lt_dlexit LTDL_PARAMS((void))
+lt_dlexit ()
{
- /* shut down libltdl */
- lt_dlloader_t *loader = loaders;
- int errors, level;
-
- if (!initialized) {
- last_error = LT_DLSTRERROR(SHUTDOWN);
- return 1;
- }
- if (initialized != 1) { /* shut down only at last call. */
- initialized--;
- return 0;
- }
- /* close all modules */
- errors = 0;
- for (level = 1; handles; level++) {
- lt_dlhandle cur = handles;
- while (cur) {
- lt_dlhandle tmp = cur;
- cur = cur->next;
- if (tmp->info.ref_count <= level)
- if (lt_dlclose(tmp))
- errors++;
+ /* shut down libltdl */
+ lt_dlloader *loader;
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+ loader = loaders;
+
+ if (!initialized)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SHUTDOWN));
+ ++errors;
+ goto done;
+ }
+
+ /* shut down only at last call. */
+ if (--initialized == 0)
+ {
+ int level;
+
+ while (handles && LT_DLIS_RESIDENT (handles))
+ {
+ handles = handles->next;
+ }
+
+ /* close all modules */
+ for (level = 1; handles; ++level)
+ {
+ lt_dlhandle cur = handles;
+ int saw_nonresident = 0;
+
+ while (cur)
+ {
+ lt_dlhandle tmp = cur;
+ cur = cur->next;
+ if (!LT_DLIS_RESIDENT (tmp))
+ saw_nonresident = 1;
+ if (!LT_DLIS_RESIDENT (tmp) && tmp->info.ref_count <= level)
+ {
+ if (lt_dlclose (tmp))
+ {
+ ++errors;
+ }
}
+ }
+ /* done if only resident modules are left */
+ if (!saw_nonresident)
+ break;
}
- /* close all loaders */
- while (loader) {
- lt_dlloader_t *next = loader->next;
- lt_dlloader_data_t data = loader->dlloader_data;
- if (loader->dlloader_exit && loader->dlloader_exit(data))
- errors++;
- lt_dlfree (loader);
- loader = next;
+
+ /* close all loaders */
+ while (loader)
+ {
+ lt_dlloader *next = loader->next;
+ lt_user_data data = loader->dlloader_data;
+ if (loader->dlloader_exit && loader->dlloader_exit (data))
+ {
+ ++errors;
+ }
+
+ LT_DLMEM_REASSIGN (loader, next);
}
+ loaders = 0;
+ }
- initialized = 0;
- return errors;
+ done:
+ LT_DLMUTEX_UNLOCK ();
+ return errors;
}
static int
tryall_dlopen (handle, filename)
- lt_dlhandle *handle;
- const char *filename;
+ lt_dlhandle *handle;
+ const char *filename;
{
- lt_dlhandle cur = handles;
- lt_dlloader_t *loader = loaders;
- const char *saved_error = last_error;
-
- /* check whether the module was already opened */
- while (cur) {
- /* try to dlopen the program itself? */
- if (!cur->info.filename && !filename)
- break;
- if (cur->info.filename && filename &&
- strcmp(cur->info.filename, filename) == 0)
- break;
- cur = cur->next;
+ lt_dlhandle cur;
+ lt_dlloader *loader;
+ const char *saved_error;
+ int errors = 0;
+
+ LT_DLMUTEX_GETERROR (saved_error);
+ LT_DLMUTEX_LOCK ();
+
+ cur = handles;
+ loader = loaders;
+
+ /* check whether the module was already opened */
+ while (cur)
+ {
+ /* try to dlopen the program itself? */
+ if (!cur->info.filename && !filename)
+ {
+ break;
}
- if (cur) {
- cur->info.ref_count++;
- *handle = cur;
- return 0;
+ if (cur->info.filename && filename
+ && strcmp (cur->info.filename, filename) == 0)
+ {
+ break;
}
-
- cur = *handle;
- if (filename) {
- cur->info.filename = strdup(filename);
- if (!cur->info.filename) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- } else
- cur->info.filename = 0;
- while (loader) {
- lt_dlloader_data_t data = loader->dlloader_data;
- cur->module = loader->module_open(data, filename);
- if (cur->module != 0)
- break;
- loader = loader->next;
+
+ cur = cur->next;
+ }
+
+ if (cur)
+ {
+ ++cur->info.ref_count;
+ *handle = cur;
+ goto done;
+ }
+
+ cur = *handle;
+ if (filename)
+ {
+ /* Comment out the check of file permissions using access.
+ This call seems to always return -1 with error EACCES.
+ */
+ /* We need to catch missing file errors early so that
+ file_not_found() can detect what happened.
+ if (access (filename, R_OK) != 0)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
+ ++errors;
+ goto done;
+ } */
+
+ cur->info.filename = lt_estrdup (filename);
+ if (!cur->info.filename)
+ {
+ ++errors;
+ goto done;
}
- if (!loader) {
- if (cur->info.filename)
- lt_dlfree(cur->info.filename);
- return 1;
+ }
+ else
+ {
+ cur->info.filename = 0;
+ }
+
+ while (loader)
+ {
+ lt_user_data data = loader->dlloader_data;
+
+ cur->module = loader->module_open (data, filename);
+
+ if (cur->module != 0)
+ {
+ break;
}
- cur->loader = loader;
- last_error = saved_error;
- return 0;
+ loader = loader->next;
+ }
+
+ if (!loader)
+ {
+ LT_DLFREE (cur->info.filename);
+ ++errors;
+ goto done;
+ }
+
+ cur->loader = loader;
+ LT_DLMUTEX_SETERROR (saved_error);
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
+}
+
+static int
+tryall_dlopen_module (handle, prefix, dirname, dlname)
+ lt_dlhandle *handle;
+ const char *prefix;
+ const char *dirname;
+ const char *dlname;
+{
+ int error = 0;
+ char *filename = 0;
+ size_t filename_len = 0;
+ size_t dirname_len = LT_STRLEN (dirname);
+
+ assert (handle);
+ assert (dirname);
+ assert (dlname);
+#ifdef LT_DIRSEP_CHAR
+ /* Only canonicalized names (i.e. with DIRSEP chars already converted)
+ should make it into this function: */
+ assert (strchr (dirname, LT_DIRSEP_CHAR) == 0);
+#endif
+
+ if (dirname_len > 0)
+ if (dirname[dirname_len -1] == '/')
+ --dirname_len;
+ filename_len = dirname_len + 1 + LT_STRLEN (dlname);
+
+ /* Allocate memory, and combine DIRNAME and MODULENAME into it.
+ The PREFIX (if any) is handled below. */
+ filename = LT_EMALLOC (char, dirname_len + 1 + filename_len + 1);
+ if (!filename)
+ return 1;
+
+ sprintf (filename, "%.*s/%s", (int) dirname_len, dirname, dlname);
+
+ /* Now that we have combined DIRNAME and MODULENAME, if there is
+ also a PREFIX to contend with, simply recurse with the arguments
+ shuffled. Otherwise, attempt to open FILENAME as a module. */
+ if (prefix)
+ {
+ error += tryall_dlopen_module (handle,
+ (const char *) 0, prefix, filename);
+ }
+ else if (tryall_dlopen (handle, filename) != 0)
+ {
+ ++error;
+ }
+
+ LT_DLFREE (filename);
+ return error;
}
static int
find_module (handle, dir, libdir, dlname, old_name, installed)
- lt_dlhandle *handle;
- const char *dir;
- const char *libdir;
- const char *dlname;
- const char *old_name;
- int installed;
-{
- int error;
- char *filename;
- /* try to open the old library first; if it was dlpreopened,
- we want the preopened version of it, even if a dlopenable
- module is available */
- if (old_name && tryall_dlopen(handle, old_name) == 0)
- return 0;
- /* try to open the dynamic library */
- if (dlname) {
- /* try to open the installed module */
- if (installed && libdir) {
- filename = (char*)
- lt_dlmalloc(strlen(libdir)+1+strlen(dlname)+1);
- if (!filename) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- sprintf (filename, "%s/%s", libdir, dlname);
- error = tryall_dlopen(handle, filename) != 0;
- lt_dlfree(filename);
- if (!error)
- return 0;
- }
- /* try to open the not-installed module */
- if (!installed) {
- filename = (char*)
- lt_dlmalloc((dir ? strlen(dir) : 0)
- + strlen(objdir) + strlen(dlname) + 1);
- if (!filename) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- if (dir)
- strcpy(filename, dir);
- else
- *filename = 0;
- strcat(filename, objdir);
- strcat(filename, dlname);
-
- error = tryall_dlopen(handle, filename) != 0;
- lt_dlfree(filename);
- if (!error)
- return 0;
- }
- /* maybe it was moved to another directory */
- {
- filename = (char*)
- lt_dlmalloc((dir ? strlen(dir) : 0)
- + strlen(dlname) + 1);
- if (dir)
- strcpy(filename, dir);
- else
- *filename = 0;
- strcat(filename, dlname);
- error = tryall_dlopen(handle, filename) != 0;
- lt_dlfree(filename);
- if (!error)
- return 0;
- }
+ lt_dlhandle *handle;
+ const char *dir;
+ const char *libdir;
+ const char *dlname;
+ const char *old_name;
+ int installed;
+{
+ /* Try to open the old library first; if it was dlpreopened,
+ we want the preopened version of it, even if a dlopenable
+ module is available. */
+ if (old_name && tryall_dlopen (handle, old_name) == 0)
+ {
+ return 0;
+ }
+
+ /* Try to open the dynamic library. */
+ if (dlname)
+ {
+ /* try to open the installed module */
+ if (installed && libdir)
+ {
+ if (tryall_dlopen_module (handle,
+ (const char *) 0, libdir, dlname) == 0)
+ return 0;
}
- return 1;
+
+ /* try to open the not-installed module */
+ if (!installed)
+ {
+ if (tryall_dlopen_module (handle, dir, objdir, dlname) == 0)
+ return 0;
+ }
+
+ /* maybe it was moved to another directory */
+ {
+ if (tryall_dlopen_module (handle,
+ (const char *) 0, dir, dlname) == 0)
+ return 0;
+ }
+ }
+
+ return 1;
}
-static char*
-canonicalize_path (path)
- const char *path;
+
+static int
+canonicalize_path (path, pcanonical)
+ const char *path;
+ char **pcanonical;
{
- char *canonical = 0;
-
- if (path && *path) {
- char *ptr = strdup (path);
- canonical = ptr;
-#ifdef LTDL_DIRSEP_CHAR
- /* Avoid this overhead where '/' is the only separator. */
- while (ptr = strchr (ptr, LTDL_DIRSEP_CHAR))
- *ptr++ = '/';
+ char *canonical = 0;
+
+ assert (path && *path);
+ assert (pcanonical);
+
+ canonical = LT_EMALLOC (char, 1+ LT_STRLEN (path));
+ if (!canonical)
+ return 1;
+
+ {
+ size_t dest = 0;
+ size_t src;
+ for (src = 0; path[src] != LT_EOS_CHAR; ++src)
+ {
+ /* Path separators are not copied to the beginning or end of
+ the destination, or if another separator would follow
+ immediately. */
+ if (path[src] == LT_PATHSEP_CHAR)
+ {
+ if ((dest == 0)
+ || (path[1+ src] == LT_PATHSEP_CHAR)
+ || (path[1+ src] == LT_EOS_CHAR))
+ continue;
+ }
+
+ /* Anything other than a directory separator is copied verbatim. */
+ if ((path[src] != '/')
+#ifdef LT_DIRSEP_CHAR
+ && (path[src] != LT_DIRSEP_CHAR)
#endif
- }
+ )
+ {
+ canonical[dest++] = path[src];
+ }
+ /* Directory separators are converted and copied only if they are
+ not at the end of a path -- i.e. before a path separator or
+ NULL terminator. */
+ else if ((path[1+ src] != LT_PATHSEP_CHAR)
+ && (path[1+ src] != LT_EOS_CHAR)
+#ifdef LT_DIRSEP_CHAR
+ && (path[1+ src] != LT_DIRSEP_CHAR)
+#endif
+ && (path[1+ src] != '/'))
+ {
+ canonical[dest++] = '/';
+ }
+ }
+
+ /* Add an end-of-string marker at the end. */
+ canonical[dest] = LT_EOS_CHAR;
+ }
- return canonical;
+ /* Assign new value. */
+ *pcanonical = canonical;
+
+ return 0;
}
-static lt_ptr_t
-find_file (basename, search_path, pdir, handle)
- const char *basename;
- const char *search_path;
- char **pdir;
- lt_dlhandle *handle;
+static int
+argzize_path (path, pargz, pargz_len)
+ const char *path;
+ char **pargz;
+ size_t *pargz_len;
{
- /* when handle != NULL search a library, otherwise a file */
- /* return NULL on failure, otherwise the file/handle */
+ error_t error;
+
+ assert (path);
+ assert (pargz);
+ assert (pargz_len);
+
+ if ((error = argz_create_sep (path, LT_PATHSEP_CHAR, pargz, pargz_len)))
+ {
+ switch (error)
+ {
+ case ENOMEM:
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
+ break;
+ default:
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN));
+ break;
+ }
- lt_ptr_t result = 0;
- char *filename = 0;
- int filenamesize = 0;
- int lenbase = strlen(basename);
- char *canonical = 0, *next = 0;
-
- if (!search_path || !*search_path) {
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
- return 0;
- }
- canonical = canonicalize_path (search_path);
- if (!canonical) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- goto cleanup;
- }
- next = canonical;
- while (next) {
- int lendir;
- char *cur = next;
-
- next = strchr(cur, LTDL_PATHSEP_CHAR);
- if (!next)
- next = cur + strlen(cur);
- lendir = next - cur;
- if (*next == LTDL_PATHSEP_CHAR)
- ++next;
- else
- next = 0;
- if (lendir == 0)
- continue;
- if (lendir + 1 + lenbase >= filenamesize) {
- if (filename)
- lt_dlfree(filename);
- filenamesize = lendir + 1 + lenbase + 1;
- filename = (char*) lt_dlmalloc(filenamesize);
- if (!filename) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- goto cleanup;
- }
- }
- strncpy(filename, cur, lendir);
- if (filename[lendir-1] != '/')
- filename[lendir++] = '/';
- strcpy(filename+lendir, basename);
- if (handle) {
- if (tryall_dlopen(handle, filename) == 0) {
- result = (lt_ptr_t) handle;
- goto cleanup;
- }
- } else {
- FILE *file = fopen(filename, LTDL_READTEXT_MODE);
- if (file) {
- if (*pdir)
- lt_dlfree(*pdir);
- filename[lendir] = '\0';
- *pdir = strdup(filename);
- if (!*pdir) {
- /* We could have even avoided the
- strdup, but there would be some
- memory overhead. */
- *pdir = filename;
- filename = 0;
- }
- result = (lt_ptr_t) file;
- goto cleanup;
- }
- }
+ return 1;
+ }
+
+ return 0;
+}
+
+/* Repeatedly call FUNC with each LT_PATHSEP_CHAR delimited element
+ of SEARCH_PATH and references to DATA1 and DATA2, until FUNC returns
+ non-zero or all elements are exhausted. If BASE_NAME is non-NULL,
+ it is appended to each SEARCH_PATH element before FUNC is called. */
+static int
+foreach_dirinpath (search_path, base_name, func, data1, data2)
+ const char *search_path;
+ const char *base_name;
+ foreach_callback_func *func;
+ lt_ptr data1;
+ lt_ptr data2;
+{
+ int result = 0;
+ int filenamesize = 0;
+ size_t lenbase = LT_STRLEN (base_name);
+ size_t argz_len = 0;
+ char *argz = 0;
+ char *filename = 0;
+ char *canonical = 0;
+
+ LT_DLMUTEX_LOCK ();
+
+ if (!search_path || !*search_path)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
+ goto cleanup;
+ }
+
+ if (canonicalize_path (search_path, &canonical) != 0)
+ goto cleanup;
+
+ if (argzize_path (canonical, &argz, &argz_len) != 0)
+ goto cleanup;
+
+ {
+ char *dir_name = 0;
+ while ((dir_name = argz_next (argz, argz_len, dir_name)))
+ {
+ size_t lendir = LT_STRLEN (dir_name);
+
+ if (lendir +1 +lenbase >= filenamesize)
+ {
+ LT_DLFREE (filename);
+ filenamesize = lendir +1 +lenbase +1; /* "/d" + '/' + "f" + '\0' */
+ filename = LT_EMALLOC (char, filenamesize);
+ if (!filename)
+ goto cleanup;
}
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
-cleanup:
- if (filename)
- lt_dlfree(filename);
- if (canonical)
- lt_dlfree(canonical);
- return result;
+
+ assert (filenamesize > lendir);
+ strcpy (filename, dir_name);
+
+ if (base_name && *base_name)
+ {
+ if (filename[lendir -1] != '/')
+ filename[lendir++] = '/';
+ strcpy (filename +lendir, base_name);
+ }
+
+ if ((result = (*func) (filename, data1, data2)))
+ {
+ break;
+ }
+ }
+ }
+
+ cleanup:
+ LT_DLFREE (argz);
+ LT_DLFREE (canonical);
+ LT_DLFREE (filename);
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return result;
}
+/* If FILEPATH can be opened, store the name of the directory component
+ in DATA1, and the opened FILE* structure address in DATA2. Otherwise
+ DATA1 is unchanged, but DATA2 is set to a pointer to NULL. */
static int
-load_deplibs(handle, deplibs)
- lt_dlhandle handle;
- char *deplibs;
-{
- char *p, *save_search_path;
- int i;
- int ret = 1, depcount = 0;
- char **names = 0;
- lt_dlhandle *handles = 0;
-
- handle->depcount = 0;
- if (!deplibs)
- return 0;
- save_search_path = strdup(user_search_path);
- if (user_search_path && !save_search_path) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- p = deplibs;
- /* extract search paths and count deplibs */
- while (*p) {
- if (!isspace(*p)) {
- char *end = p+1;
- while (*end && !isspace(*end)) end++;
- if (strncmp(p, "-L", 2) == 0 ||
- strncmp(p, "-R", 2) == 0) {
- char save = *end;
- *end = 0; /* set a temporary string terminator */
- if (lt_dladdsearchdir(p+2))
- goto cleanup;
- *end = save;
- } else
- depcount++;
- p = end;
- } else
- p++;
- }
- if (!depcount) {
- ret = 0;
- goto cleanup;
- }
- names = (char**)lt_dlmalloc(depcount * sizeof(char*));
- if (!names)
- goto cleanup;
- handles = (lt_dlhandle*)lt_dlmalloc(depcount * sizeof(lt_dlhandle*));
- if (!handles)
- goto cleanup;
- depcount = 0;
- /* now only extract the actual deplibs */
- p = deplibs;
- while (*p) {
- if (!isspace(*p)) {
- char *end = p+1;
- while (*end && !isspace(*end)) end++;
- if (strncmp(p, "-L", 2) != 0 &&
- strncmp(p, "-R", 2) != 0) {
- char *name;
- char save = *end;
- *end = 0; /* set a temporary string terminator */
- if (strncmp(p, "-l", 2) == 0) {
- name = lt_dlmalloc(3+ /* "lib" */
- strlen(p+2)+1);
- if (name)
- sprintf (name, "lib%s", p+2);
- } else
- name = strdup(p);
- if (name)
- names[depcount++] = name;
- else
- goto cleanup_names;
- *end = save;
- }
- p = end;
- } else
- p++;
- }
- /* load the deplibs (in reverse order) */
- for (i = 0; i < depcount; i++) {
- lt_dlhandle handle = lt_dlopenext(names[depcount-1-i]);
- if (!handle) {
- int j;
- for (j = 0; j < i; j++)
- lt_dlclose(handles[j]);
- last_error = LT_DLSTRERROR(DEPLIB_NOT_FOUND);
- goto cleanup_names;
+find_file_callback (filename, data1, data2)
+ char *filename;
+ lt_ptr data1;
+ lt_ptr data2;
+{
+ char **pdir = (char **) data1;
+ FILE **pfile = (FILE **) data2;
+ int is_done = 0;
+
+ assert (filename && *filename);
+ assert (pdir);
+ assert (pfile);
+
+ if ((*pfile = fopen (filename, LT_READTEXT_MODE)))
+ {
+ char *dirend = strrchr (filename, '/');
+
+ if (dirend > filename)
+ *dirend = LT_EOS_CHAR;
+
+ LT_DLFREE (*pdir);
+ *pdir = lt_estrdup (filename);
+ is_done = (*pdir == 0) ? -1 : 1;
+ }
+
+ return is_done;
+}
+
+static FILE *
+find_file (search_path, base_name, pdir)
+ const char *search_path;
+ const char *base_name;
+ char **pdir;
+{
+ FILE *file = 0;
+
+ foreach_dirinpath (search_path, base_name, find_file_callback, pdir, &file);
+
+ return file;
+}
+
+static int
+find_handle_callback (filename, data, ignored)
+ char *filename;
+ lt_ptr data;
+ lt_ptr ignored;
+{
+ lt_dlhandle *handle = (lt_dlhandle *) data;
+ int notfound = access (filename, R_OK);
+
+ /* Bail out if file cannot be read... */
+ if (notfound)
+ return 0;
+
+ /* Try to dlopen the file, but do not continue searching in any
+ case. */
+ if (tryall_dlopen (handle, filename) != 0)
+ *handle = 0;
+
+ return 1;
+}
+
+/* If HANDLE was found return it, otherwise return 0. If HANDLE was
+ found but could not be opened, *HANDLE will be set to 0. */
+static lt_dlhandle *
+find_handle (search_path, base_name, handle)
+ const char *search_path;
+ const char *base_name;
+ lt_dlhandle *handle;
+{
+ if (!search_path)
+ return 0;
+
+ if (!foreach_dirinpath (search_path, base_name, find_handle_callback,
+ handle, 0))
+ return 0;
+
+ return handle;
+}
+
+static int
+load_deplibs (handle, deplibs)
+ lt_dlhandle handle;
+ char *deplibs;
+{
+#if LTDL_DLOPEN_DEPLIBS
+ char *p, *save_search_path = 0;
+ int depcount = 0;
+ int i;
+ char **names = 0;
+#endif
+ int errors = 0;
+
+ handle->depcount = 0;
+
+#if LTDL_DLOPEN_DEPLIBS
+ if (!deplibs)
+ {
+ return errors;
+ }
+ ++errors;
+
+ LT_DLMUTEX_LOCK ();
+ if (user_search_path)
+ {
+ save_search_path = lt_estrdup (user_search_path);
+ if (!save_search_path)
+ goto cleanup;
+ }
+
+ /* extract search paths and count deplibs */
+ p = deplibs;
+ while (*p)
+ {
+ if (!isspace ((int) *p))
+ {
+ char *end = p+1;
+ while (*end && !isspace((int) *end))
+ {
+ ++end;
+ }
+
+ if (strncmp(p, "-L", 2) == 0 || strncmp(p, "-R", 2) == 0)
+ {
+ char save = *end;
+ *end = 0; /* set a temporary string terminator */
+ if (lt_dladdsearchdir(p+2))
+ {
+ goto cleanup;
+ }
+ *end = save;
+ }
+ else
+ {
+ ++depcount;
+ }
+
+ p = end;
+ }
+ else
+ {
+ ++p;
+ }
+ }
+
+ /* restore the old search path */
+ LT_DLFREE (user_search_path);
+ user_search_path = save_search_path;
+
+ LT_DLMUTEX_UNLOCK ();
+
+ if (!depcount)
+ {
+ errors = 0;
+ goto cleanup;
+ }
+
+ names = LT_EMALLOC (char *, depcount * sizeof (char*));
+ if (!names)
+ goto cleanup;
+
+ /* now only extract the actual deplibs */
+ depcount = 0;
+ p = deplibs;
+ while (*p)
+ {
+ if (isspace ((int) *p))
+ {
+ ++p;
+ }
+ else
+ {
+ char *end = p+1;
+ while (*end && !isspace ((int) *end))
+ {
+ ++end;
+ }
+
+ if (strncmp(p, "-L", 2) != 0 && strncmp(p, "-R", 2) != 0)
+ {
+ char *name;
+ char save = *end;
+ *end = 0; /* set a temporary string terminator */
+ if (strncmp(p, "-l", 2) == 0)
+ {
+ size_t name_len = 3+ /* "lib" */ LT_STRLEN (p + 2);
+ name = LT_EMALLOC (char, 1+ name_len);
+ if (name)
+ sprintf (name, "lib%s", p+2);
}
- handles[i] = handle;
- }
- handle->depcount = depcount;
- handle->deplibs = handles;
- handles = 0;
- ret = 0;
-cleanup_names:
- for (i = 0; i < depcount; i++)
- lt_dlfree(names[i]);
-cleanup:
- if (names)
- lt_dlfree(names);
- if (handles)
- lt_dlfree(handles);
- /* restore the old search path */
- if (user_search_path)
- lt_dlfree(user_search_path);
- user_search_path = save_search_path;
- return ret;
+ else
+ name = lt_estrdup(p);
+
+ if (!name)
+ goto cleanup_names;
+
+ names[depcount++] = name;
+ *end = save;
+ }
+ p = end;
+ }
+ }
+
+ /* load the deplibs (in reverse order)
+ At this stage, don't worry if the deplibs do not load correctly,
+ they may already be statically linked into the loading application
+ for instance. There will be a more enlightening error message
+ later on if the loaded module cannot resolve all of its symbols. */
+ if (depcount)
+ {
+ int j = 0;
+
+ handle->deplibs = (lt_dlhandle*) LT_EMALLOC (lt_dlhandle *, depcount);
+ if (!handle->deplibs)
+ goto cleanup;
+
+ for (i = 0; i < depcount; ++i)
+ {
+ handle->deplibs[j] = lt_dlopenext(names[depcount-1-i]);
+ if (handle->deplibs[j])
+ {
+ ++j;
+ }
+ }
+
+ handle->depcount = j; /* Number of successfully loaded deplibs */
+ errors = 0;
+ }
+
+ cleanup_names:
+ for (i = 0; i < depcount; ++i)
+ {
+ LT_DLFREE (names[i]);
+ }
+
+ cleanup:
+ LT_DLFREE (names);
+#endif
+
+ return errors;
}
static int
-unload_deplibs(handle)
- lt_dlhandle handle;
+unload_deplibs (handle)
+ lt_dlhandle handle;
{
- int i;
- int errors = 0;
-
- if (!handle->depcount)
- return 0;
- for (i = 0; i < handle->depcount; i++)
- errors += lt_dlclose(handle->deplibs[i]);
- return errors;
+ int i;
+ int errors = 0;
+
+ if (handle->depcount)
+ {
+ for (i = 0; i < handle->depcount; ++i)
+ {
+ if (!LT_DLIS_RESIDENT (handle->deplibs[i]))
+ {
+ errors += lt_dlclose (handle->deplibs[i]);
+ }
+ }
+ }
+
+ return errors;
}
-static inline int
+static int
trim (dest, str)
- char **dest;
- const char *str;
-{
- /* remove the leading and trailing "'" from str
- and store the result in dest */
- char *tmp;
- const char *end = strrchr(str, '\'');
- int len = strlen(str);
-
- if (*dest)
- lt_dlfree(*dest);
- if (len > 3 && str[0] == '\'') {
- tmp = (char*) lt_dlmalloc(end - str);
- if (!tmp) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- strncpy(tmp, &str[1], (end - str) - 1);
- tmp[len-3] = '\0';
- *dest = tmp;
- } else
- *dest = 0;
- return 0;
+ char **dest;
+ const char *str;
+{
+ /* remove the leading and trailing "'" from str
+ and store the result in dest */
+ const char *end = strrchr (str, '\'');
+ size_t len = LT_STRLEN (str);
+ char *tmp;
+
+ LT_DLFREE (*dest);
+
+ if (len > 3 && str[0] == '\'')
+ {
+ tmp = LT_EMALLOC (char, end - str);
+ if (!tmp)
+ return 1;
+
+ strncpy(tmp, &str[1], (end - str) - 1);
+ tmp[len-3] = LT_EOS_CHAR;
+ *dest = tmp;
+ }
+ else
+ {
+ *dest = 0;
+ }
+
+ return 0;
}
-static inline int
-free_vars( dlname, oldname, libdir, deplibs)
- char *dlname;
- char *oldname;
- char *libdir;
- char *deplibs;
-{
- if (dlname)
- lt_dlfree(dlname);
- if (oldname)
- lt_dlfree(oldname);
- if (libdir)
- lt_dlfree(libdir);
- if (deplibs)
- lt_dlfree(deplibs);
- return 0;
+static int
+free_vars (dlname, oldname, libdir, deplibs)
+ char *dlname;
+ char *oldname;
+ char *libdir;
+ char *deplibs;
+{
+ LT_DLFREE (dlname);
+ LT_DLFREE (oldname);
+ LT_DLFREE (libdir);
+ LT_DLFREE (deplibs);
+
+ return 0;
}
-lt_dlhandle
-lt_dlopen (filename)
- const char *filename;
+static int
+try_dlopen (phandle, filename)
+ lt_dlhandle *phandle;
+ const char *filename;
{
- lt_dlhandle handle = 0, newhandle;
- const char *ext;
- const char *saved_error = last_error;
- char *canonical = 0, *basename = 0, *dir = 0, *name = 0;
-
- if (!filename) {
- handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
- if (!handle) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 0;
- }
- handle->info.ref_count = 0;
- handle->depcount = 0;
- handle->deplibs = 0;
- newhandle = handle;
- if (tryall_dlopen(&newhandle, 0) != 0) {
- lt_dlfree(handle);
- return 0;
- }
- goto register_handle;
- }
- canonical = canonicalize_path (filename);
- if (!canonical) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- if (handle)
- lt_dlfree(handle);
- return 0;
- }
- basename = strrchr(canonical, '/');
- if (basename) {
- basename++;
- dir = (char*) lt_dlmalloc(basename - canonical + 1);
- if (!dir) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- handle = 0;
- goto cleanup;
- }
- strncpy(dir, canonical, basename - canonical);
- dir[basename - canonical] = '\0';
- } else
- basename = canonical;
- /* check whether we open a libtool module (.la extension) */
- ext = strrchr(basename, '.');
- if (ext && strcmp(ext, ".la") == 0) {
- /* this seems to be a libtool module */
- FILE *file;
- int i;
- char *dlname = 0, *old_name = 0;
- char *libdir = 0, *deplibs = 0;
- char *line;
- int error = 0;
- /* if we can't find the installed flag, it is probably an
- installed libtool archive, produced with an old version
- of libtool */
- int installed = 1;
-
- /* extract the module name from the file name */
- name = (char*) lt_dlmalloc(ext - basename + 1);
- if (!name) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- handle = 0;
- goto cleanup;
- }
- /* canonicalize the module name */
- for (i = 0; i < ext - basename; i++)
- if (isalnum((int)(basename[i])))
- name[i] = basename[i];
- else
- name[i] = '_';
- name[ext - basename] = '\0';
- /* now try to open the .la file */
- file = fopen(filename, LTDL_READTEXT_MODE);
- if (!file)
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
- if (!file && !dir) {
- /* try other directories */
- file = (FILE*) find_file(basename,
- user_search_path,
- &dir, 0);
- if (!file)
- file = (FILE*) find_file(basename,
- getenv("LTDL_LIBRARY_PATH"),
- &dir, 0);
+ const char * ext = 0;
+ const char * saved_error = 0;
+ char * canonical = 0;
+ char * base_name = 0;
+ char * dir = 0;
+ char * name = 0;
+ int errors = 0;
+ lt_dlhandle newhandle;
+
+ assert (phandle);
+ assert (*phandle == 0);
+
+ LT_DLMUTEX_GETERROR (saved_error);
+
+ /* dlopen self? */
+ if (!filename)
+ {
+ *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
+ if (*phandle == 0)
+ return 1;
+
+ memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
+ newhandle = *phandle;
+
+ /* lt_dlclose()ing yourself is very bad! Disallow it. */
+ LT_DLSET_FLAG (*phandle, LT_DLRESIDENT_FLAG);
+
+ if (tryall_dlopen (&newhandle, 0) != 0)
+ {
+ LT_DLFREE (*phandle);
+ return 1;
+ }
+
+ goto register_handle;
+ }
+
+ assert (filename && *filename);
+
+ /* Doing this immediately allows internal functions to safely
+ assume only canonicalized paths are passed. */
+ if (canonicalize_path (filename, &canonical) != 0)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ /* If the canonical module name is a path (relative or absolute)
+ then split it into a directory part and a name part. */
+ base_name = strrchr (canonical, '/');
+ if (base_name)
+ {
+ size_t dirlen = (1+ base_name) - canonical;
+
+ dir = LT_EMALLOC (char, 1+ dirlen);
+ if (!dir)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ strncpy (dir, canonical, dirlen);
+ dir[dirlen] = LT_EOS_CHAR;
+
+ ++base_name;
+ }
+ else
+ LT_DLMEM_REASSIGN (base_name, canonical);
+
+ assert (base_name && *base_name);
+
+ /* Check whether we are opening a libtool module (.la extension). */
+ ext = strrchr (base_name, '.');
+ if (ext && strcmp (ext, archive_ext) == 0)
+ {
+ /* this seems to be a libtool module */
+ FILE * file = 0;
+ char * dlname = 0;
+ char * old_name = 0;
+ char * libdir = 0;
+ char * deplibs = 0;
+ char * line = 0;
+ size_t line_len;
+
+ /* if we can't find the installed flag, it is probably an
+ installed libtool archive, produced with an old version
+ of libtool */
+ int installed = 1;
+
+ /* extract the module name from the file name */
+ name = LT_EMALLOC (char, ext - base_name + 1);
+ if (!name)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ /* canonicalize the module name */
+ {
+ size_t i;
+ for (i = 0; i < ext - base_name; ++i)
+ {
+ if (isalnum ((int)(base_name[i])))
+ {
+ name[i] = base_name[i];
+ }
+ else
+ {
+ name[i] = '_';
+ }
+ }
+ name[ext - base_name] = LT_EOS_CHAR;
+ }
+
+ /* Now try to open the .la file. If there is no directory name
+ component, try to find it first in user_search_path and then other
+ prescribed paths. Otherwise (or in any case if the module was not
+ yet found) try opening just the module name as passed. */
+ if (!dir)
+ {
+ const char *search_path;
+
+ LT_DLMUTEX_LOCK ();
+ search_path = user_search_path;
+ if (search_path)
+ file = find_file (user_search_path, base_name, &dir);
+ LT_DLMUTEX_UNLOCK ();
+
+ if (!file)
+ {
+ search_path = getenv (LTDL_SEARCHPATH_VAR);
+ if (search_path)
+ file = find_file (search_path, base_name, &dir);
+ }
+
#ifdef LTDL_SHLIBPATH_VAR
- if (!file)
- file = (FILE*) find_file(basename,
- getenv(LTDL_SHLIBPATH_VAR),
- &dir, 0);
+ if (!file)
+ {
+ search_path = getenv (LTDL_SHLIBPATH_VAR);
+ if (search_path)
+ file = find_file (search_path, base_name, &dir);
+ }
#endif
#ifdef LTDL_SYSSEARCHPATH
- if (!file)
- file = (FILE*) find_file(basename,
- sys_search_path,
- &dir, 0);
+ if (!file && sys_search_path)
+ {
+ file = find_file (sys_search_path, base_name, &dir);
+ }
#endif
+ }
+ if (!file)
+ {
+ file = fopen (filename, LT_READTEXT_MODE);
+ }
+
+ /* If we didn't find the file by now, it really isn't there. Set
+ the status flag, and bail out. */
+ if (!file)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
+ ++errors;
+ goto cleanup;
+ }
+
+ line_len = LT_FILENAME_MAX;
+ line = LT_EMALLOC (char, line_len);
+ if (!line)
+ {
+ fclose (file);
+ ++errors;
+ goto cleanup;
+ }
+
+ /* read the .la file */
+ while (!feof (file))
+ {
+ if (!fgets (line, (int) line_len, file))
+ {
+ break;
+ }
+
+ /* Handle the case where we occasionally need to read a line
+ that is longer than the initial buffer size. */
+ while ((line[LT_STRLEN(line) -1] != '\n') && (!feof (file)))
+ {
+ line = LT_DLREALLOC (char, line, line_len *2);
+ if (!fgets (&line[line_len -1], (int) line_len +1, file))
+ {
+ break;
}
- if (!file) {
- handle = 0;
- goto cleanup;
- }
- line = (char*) lt_dlmalloc(LTDL_FILENAME_MAX);
- if (!line) {
- fclose(file);
- last_error = LT_DLSTRERROR(NO_MEMORY);
- handle = 0;
- goto cleanup;
- }
- /* read the .la file */
- while (!feof(file)) {
- if (!fgets(line, LTDL_FILENAME_MAX, file))
- break;
- if (line[0] == '\n' || line[0] == '#')
- continue;
-# undef STR_DLNAME
-# define STR_DLNAME "dlname="
- if (strncmp(line, STR_DLNAME,
- sizeof(STR_DLNAME) - 1) == 0)
- error = trim(&dlname,
- &line[sizeof(STR_DLNAME) - 1]);
- else
-# undef STR_OLD_LIBRARY
-# define STR_OLD_LIBRARY "old_library="
- if (strncmp(line, STR_OLD_LIBRARY,
- sizeof(STR_OLD_LIBRARY) - 1) == 0)
- error = trim(&old_name,
- &line[sizeof(STR_OLD_LIBRARY) - 1]);
- else
-# undef STR_LIBDIR
-# define STR_LIBDIR "libdir="
- if (strncmp(line, STR_LIBDIR,
- sizeof(STR_LIBDIR) - 1) == 0)
- error = trim(&libdir,
- &line[sizeof(STR_LIBDIR) - 1]);
- else
-# undef STR_DL_DEPLIBS
-# define STR_DL_DEPLIBS "dl_dependency_libs="
- if (strncmp(line, STR_DL_DEPLIBS,
- sizeof(STR_DL_DEPLIBS) - 1) == 0)
- error = trim(&deplibs,
- &line[sizeof(STR_DL_DEPLIBS) - 1]);
- else
- if (strcmp(line, "installed=yes\n") == 0)
- installed = 1;
- else
- if (strcmp(line, "installed=no\n") == 0)
- installed = 0;
- else
-# undef STR_LIBRARY_NAMES
-# define STR_LIBRARY_NAMES "library_names="
- if (! dlname &&
- strncmp(line, STR_LIBRARY_NAMES,
- sizeof(STR_LIBRARY_NAMES) - 1) == 0) {
- char *last_libname;
- error = trim(&dlname,
- &line[sizeof(STR_LIBRARY_NAMES) - 1]);
- if (! error && dlname &&
- (last_libname = strrchr(dlname, ' ')) != NULL) {
- last_libname = strdup(last_libname + 1);
- free(dlname);
- dlname = last_libname;
- }
- }
- if (error)
- break;
- }
- fclose(file);
- lt_dlfree(line);
- /* allocate the handle */
- handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
- if (!handle || error) {
- if (handle)
- lt_dlfree(handle);
- if (!error)
- last_error = LT_DLSTRERROR(NO_MEMORY);
- free_vars(dlname, old_name, libdir, deplibs);
- /* handle is already set to 0 */
- goto cleanup;
- }
- handle->info.ref_count = 0;
- if (load_deplibs(handle, deplibs) == 0) {
- newhandle = handle;
- /* find_module may replace newhandle */
- if (find_module(&newhandle, dir, libdir,
- dlname, old_name, installed)) {
- unload_deplibs(handle);
- error = 1;
- }
- } else
- error = 1;
- free_vars(dlname, old_name, libdir, deplibs);
- if (error) {
- lt_dlfree(handle);
- handle = 0;
- goto cleanup;
- }
- if (handle != newhandle)
- unload_deplibs(handle);
- } else {
- /* not a libtool module */
- handle = (lt_dlhandle) lt_dlmalloc(sizeof(lt_dlhandle_t));
- if (!handle) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- /* handle is already set to 0 */
- goto cleanup;
+ line_len *= 2;
+ }
+
+ if (line[0] == '\n' || line[0] == '#')
+ {
+ continue;
+ }
+
+#undef STR_DLNAME
+#define STR_DLNAME "dlname="
+ if (strncmp (line, STR_DLNAME, sizeof (STR_DLNAME) - 1) == 0)
+ {
+ errors += trim (&dlname, &line[sizeof (STR_DLNAME) - 1]);
+ }
+
+#undef STR_OLD_LIBRARY
+#define STR_OLD_LIBRARY "old_library="
+ else if (strncmp (line, STR_OLD_LIBRARY,
+ sizeof (STR_OLD_LIBRARY) - 1) == 0)
+ {
+ errors += trim (&old_name, &line[sizeof (STR_OLD_LIBRARY) - 1]);
+ }
+#undef STR_LIBDIR
+#define STR_LIBDIR "libdir="
+ else if (strncmp (line, STR_LIBDIR, sizeof (STR_LIBDIR) - 1) == 0)
+ {
+ errors += trim (&libdir, &line[sizeof(STR_LIBDIR) - 1]);
+ }
+
+#undef STR_DL_DEPLIBS
+#define STR_DL_DEPLIBS "dependency_libs="
+ else if (strncmp (line, STR_DL_DEPLIBS,
+ sizeof (STR_DL_DEPLIBS) - 1) == 0)
+ {
+ errors += trim (&deplibs, &line[sizeof (STR_DL_DEPLIBS) - 1]);
+ }
+ else if (strcmp (line, "installed=yes\n") == 0)
+ {
+ installed = 1;
+ }
+ else if (strcmp (line, "installed=no\n") == 0)
+ {
+ installed = 0;
+ }
+
+#undef STR_LIBRARY_NAMES
+#define STR_LIBRARY_NAMES "library_names="
+ else if (! dlname && strncmp (line, STR_LIBRARY_NAMES,
+ sizeof (STR_LIBRARY_NAMES) - 1) == 0)
+ {
+ char *last_libname;
+ errors += trim (&dlname, &line[sizeof (STR_LIBRARY_NAMES) - 1]);
+ if (!errors
+ && dlname
+ && (last_libname = strrchr (dlname, ' ')) != 0)
+ {
+ last_libname = lt_estrdup (last_libname + 1);
+ if (!last_libname)
+ {
+ ++errors;
+ goto cleanup;
+ }
+ LT_DLMEM_REASSIGN (dlname, last_libname);
}
- handle->info.ref_count = 0;
- /* non-libtool modules don't have dependencies */
- handle->depcount = 0;
- handle->deplibs = 0;
- newhandle = handle;
- if (tryall_dlopen(&newhandle, filename)
- && (dir
- || (!find_file(basename, user_search_path,
- 0, &newhandle)
- && !find_file(basename,
- getenv("LTDL_LIBRARY_PATH"),
- 0, &newhandle)
+ }
+
+ if (errors)
+ break;
+ }
+
+ fclose (file);
+ LT_DLFREE (line);
+
+ /* allocate the handle */
+ *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
+ if (*phandle == 0)
+ ++errors;
+
+ if (errors)
+ {
+ free_vars (dlname, old_name, libdir, deplibs);
+ LT_DLFREE (*phandle);
+ goto cleanup;
+ }
+
+ assert (*phandle);
+
+ memset (*phandle, 0, sizeof(struct lt_dlhandle_struct));
+ if (load_deplibs (*phandle, deplibs) == 0)
+ {
+ newhandle = *phandle;
+ /* find_module may replace newhandle */
+ if (find_module (&newhandle, dir, libdir, dlname, old_name, installed))
+ {
+ unload_deplibs (*phandle);
+ ++errors;
+ }
+ }
+ else
+ {
+ ++errors;
+ }
+
+ free_vars (dlname, old_name, libdir, deplibs);
+ if (errors)
+ {
+ LT_DLFREE (*phandle);
+ goto cleanup;
+ }
+
+ if (*phandle != newhandle)
+ {
+ unload_deplibs (*phandle);
+ }
+ }
+ else
+ {
+ /* not a libtool module */
+ *phandle = (lt_dlhandle) LT_EMALLOC (struct lt_dlhandle_struct, 1);
+ if (*phandle == 0)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ memset (*phandle, 0, sizeof (struct lt_dlhandle_struct));
+ newhandle = *phandle;
+
+ /* If the module has no directory name component, try to find it
+ first in user_search_path and then other prescribed paths.
+ Otherwise (or in any case if the module was not yet found) try
+ opening just the module name as passed. */
+ if ((dir || (!find_handle (user_search_path, base_name, &newhandle)
+ && !find_handle (getenv (LTDL_SEARCHPATH_VAR), base_name,
+ &newhandle)
#ifdef LTDL_SHLIBPATH_VAR
- && !find_file(basename,
- getenv(LTDL_SHLIBPATH_VAR),
- 0, &newhandle)
+ && !find_handle (getenv (LTDL_SHLIBPATH_VAR), base_name,
+ &newhandle)
#endif
#ifdef LTDL_SYSSEARCHPATH
- && !find_file(basename, sys_search_path,
- 0, &newhandle)
+ && !find_handle (sys_search_path, base_name, &newhandle)
#endif
- ))) {
- lt_dlfree(handle);
- handle = 0;
- goto cleanup;
- }
+ )))
+ {
+ if (tryall_dlopen (&newhandle, filename) != 0)
+ {
+ newhandle = NULL;
+ }
+ }
+
+ if (!newhandle)
+ {
+ LT_DLFREE (*phandle);
+ ++errors;
+ goto cleanup;
}
-register_handle:
- if (newhandle != handle) {
- lt_dlfree(handle);
- handle = newhandle;
- }
- if (!handle->info.ref_count) {
- handle->info.ref_count = 1;
- handle->info.name = name;
- handle->next = handles;
- handles = handle;
- name = 0; /* don't free this during `cleanup' */
- }
- last_error = saved_error;
-cleanup:
- if (dir)
- lt_dlfree(dir);
- if (name)
- lt_dlfree(name);
- if (canonical)
- lt_dlfree(canonical);
- return handle;
+ }
+
+ register_handle:
+ LT_DLMEM_REASSIGN (*phandle, newhandle);
+
+ if ((*phandle)->info.ref_count == 0)
+ {
+ (*phandle)->info.ref_count = 1;
+ LT_DLMEM_REASSIGN ((*phandle)->info.name, name);
+
+ LT_DLMUTEX_LOCK ();
+ (*phandle)->next = handles;
+ handles = *phandle;
+ LT_DLMUTEX_UNLOCK ();
+ }
+
+ LT_DLMUTEX_SETERROR (saved_error);
+
+ cleanup:
+ LT_DLFREE (dir);
+ LT_DLFREE (name);
+ LT_DLFREE (canonical);
+
+ return errors;
+}
+
+lt_dlhandle
+lt_dlopen (filename)
+ const char *filename;
+{
+ lt_dlhandle handle = 0;
+
+ /* Just incase we missed a code path in try_dlopen() that reports
+ an error, but forgets to reset handle... */
+ if (try_dlopen (&handle, filename) != 0)
+ return 0;
+
+ return handle;
+}
+
+/* If the last error messge store was `FILE_NOT_FOUND', then return
+ non-zero. */
+static int
+file_not_found ()
+{
+ const char *error = 0;
+
+ LT_DLMUTEX_GETERROR (error);
+ if (error == LT_DLSTRERROR (FILE_NOT_FOUND))
+ return 1;
+
+ return 0;
}
+/* If FILENAME has an ARCHIVE_EXT or SHLIB_EXT extension, try to
+ open the FILENAME as passed. Otherwise try appending ARCHIVE_EXT,
+ and if a file is still not found try again with SHLIB_EXT appended
+ instead. */
lt_dlhandle
lt_dlopenext (filename)
- const char *filename;
+ const char *filename;
{
- lt_dlhandle handle;
- char *tmp;
- int len;
- const char *saved_error = last_error;
-
- if (!filename)
- return lt_dlopen(filename);
- len = strlen(filename);
- if (!len) {
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
- return 0;
- }
- /* try the normal file name */
- handle = lt_dlopen(filename);
- if (handle)
- return handle;
- /* try "filename.la" */
- tmp = (char*) lt_dlmalloc(len+4);
- if (!tmp) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 0;
- }
- strcpy(tmp, filename);
- strcat(tmp, ".la");
- handle = lt_dlopen(tmp);
- if (handle) {
- last_error = saved_error;
- lt_dlfree(tmp);
- return handle;
- }
+ lt_dlhandle handle = 0;
+ char * tmp = 0;
+ char * ext = 0;
+ size_t len;
+ int errors = 0;
+
+ if (!filename)
+ {
+ return lt_dlopen (filename);
+ }
+
+ assert (filename);
+
+ len = LT_STRLEN (filename);
+ ext = strrchr (filename, '.');
+
+ /* If FILENAME already bears a suitable extension, there is no need
+ to try appending additional extensions. */
+ if (ext && ((strcmp (ext, archive_ext) == 0)
#ifdef LTDL_SHLIB_EXT
- /* try "filename.EXT" */
- if (strlen(shlib_ext) > 3) {
- lt_dlfree(tmp);
- tmp = (char*) lt_dlmalloc(len + strlen(shlib_ext) + 1);
- if (!tmp) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 0;
- }
- strcpy(tmp, filename);
- } else
- tmp[len] = '\0';
- strcat(tmp, shlib_ext);
- handle = lt_dlopen(tmp);
- if (handle) {
- last_error = saved_error;
- lt_dlfree(tmp);
- return handle;
- }
-#endif
- last_error = LT_DLSTRERROR(FILE_NOT_FOUND);
- lt_dlfree(tmp);
+ || (strcmp (ext, shlib_ext) == 0)
+#endif
+ ))
+ {
+ return lt_dlopen (filename);
+ }
+
+ /* First try appending ARCHIVE_EXT. */
+ tmp = LT_EMALLOC (char, len + LT_STRLEN (archive_ext) + 1);
+ if (!tmp)
+ return 0;
+
+ strcpy (tmp, filename);
+ strcat (tmp, archive_ext);
+ errors = try_dlopen (&handle, tmp);
+
+ /* If we found FILENAME, stop searching -- whether we were able to
+ load the file as a module or not. If the file exists but loading
+ failed, it is better to return an error message here than to
+ report FILE_NOT_FOUND when the alternatives (foo.so etc) are not
+ in the module search path. */
+ if (handle || ((errors > 0) && !file_not_found ()))
+ {
+ LT_DLFREE (tmp);
+ return handle;
+ }
+
+#ifdef LTDL_SHLIB_EXT
+ /* Try appending SHLIB_EXT. */
+ if (LT_STRLEN (shlib_ext) > LT_STRLEN (archive_ext))
+ {
+ LT_DLFREE (tmp);
+ tmp = LT_EMALLOC (char, len + LT_STRLEN (shlib_ext) + 1);
+ if (!tmp)
return 0;
+
+ strcpy (tmp, filename);
+ }
+ else
+ {
+ tmp[len] = LT_EOS_CHAR;
+ }
+
+ strcat(tmp, shlib_ext);
+ errors = try_dlopen (&handle, tmp);
+
+ /* As before, if the file was found but loading failed, return now
+ with the current error message. */
+ if (handle || ((errors > 0) && !file_not_found ()))
+ {
+ LT_DLFREE (tmp);
+ return handle;
+ }
+#endif
+
+ /* Still here? Then we really did fail to locate any of the file
+ names we tried. */
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (FILE_NOT_FOUND));
+ LT_DLFREE (tmp);
+ return 0;
+}
+
+
+static int
+lt_argz_insert (pargz, pargz_len, before, entry)
+ char **pargz;
+ size_t *pargz_len;
+ char *before;
+ const char *entry;
+{
+ error_t error;
+
+ if ((error = argz_insert (pargz, pargz_len, before, entry)))
+ {
+ switch (error)
+ {
+ case ENOMEM:
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (NO_MEMORY));
+ break;
+ default:
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (UNKNOWN));
+ break;
+ }
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+lt_argz_insertinorder (pargz, pargz_len, entry)
+ char **pargz;
+ size_t *pargz_len;
+ const char *entry;
+{
+ char *before = 0;
+
+ assert (pargz);
+ assert (pargz_len);
+ assert (entry && *entry);
+
+ if (*pargz)
+ while ((before = argz_next (*pargz, *pargz_len, before)))
+ {
+ int cmp = strcmp (entry, before);
+
+ if (cmp < 0) break;
+ if (cmp == 0) return 0; /* No duplicates! */
+ }
+
+ return lt_argz_insert (pargz, pargz_len, before, entry);
+}
+
+static int
+lt_argz_insertdir (pargz, pargz_len, dirnam, dp)
+ char **pargz;
+ size_t *pargz_len;
+ const char *dirnam;
+ struct dirent *dp;
+{
+ char *buf = 0;
+ size_t buf_len = 0;
+ char *end = 0;
+ size_t end_offset = 0;
+ size_t dir_len = 0;
+ int errors = 0;
+
+ assert (pargz);
+ assert (pargz_len);
+ assert (dp);
+
+ dir_len = LT_STRLEN (dirnam);
+ end = dp->d_name + LT_D_NAMLEN(dp);
+
+ /* Ignore version numbers. */
+ {
+ char *p;
+ for (p = end; p -1 > dp->d_name; --p)
+ if (strchr (".0123456789", p[-1]) == 0)
+ break;
+
+ if (*p == '.')
+ end = p;
+ }
+
+ /* Ignore filename extension. */
+ {
+ char *p;
+ for (p = end -1; p > dp->d_name; --p)
+ if (*p == '.')
+ {
+ end = p;
+ break;
+ }
+ }
+
+ /* Prepend the directory name. */
+ end_offset = end - dp->d_name;
+ buf_len = dir_len + 1+ end_offset;
+ buf = LT_EMALLOC (char, 1+ buf_len);
+ if (!buf)
+ return ++errors;
+
+ assert (buf);
+
+ strcpy (buf, dirnam);
+ strcat (buf, "/");
+ strncat (buf, dp->d_name, end_offset);
+ buf[buf_len] = LT_EOS_CHAR;
+
+ /* Try to insert (in order) into ARGZ/ARGZ_LEN. */
+ if (lt_argz_insertinorder (pargz, pargz_len, buf) != 0)
+ ++errors;
+
+ LT_DLFREE (buf);
+
+ return errors;
+}
+
+static int
+list_files_by_dir (dirnam, pargz, pargz_len)
+ const char *dirnam;
+ char **pargz;
+ size_t *pargz_len;
+{
+ DIR *dirp = 0;
+ int errors = 0;
+
+ assert (dirnam && *dirnam);
+ assert (pargz);
+ assert (pargz_len);
+ assert (dirnam[LT_STRLEN(dirnam) -1] != '/');
+
+ dirp = opendir (dirnam);
+ if (dirp)
+ {
+ struct dirent *dp = 0;
+
+ while ((dp = readdir (dirp)))
+ if (dp->d_name[0] != '.')
+ if (lt_argz_insertdir (pargz, pargz_len, dirnam, dp))
+ {
+ ++errors;
+ break;
+ }
+
+ closedir (dirp);
+ }
+ else
+ ++errors;
+
+ return errors;
+}
+
+
+/* If there are any files in DIRNAME, call the function passed in
+ DATA1 (with the name of each file and DATA2 as arguments). */
+static int
+foreachfile_callback (dirname, data1, data2)
+ char *dirname;
+ lt_ptr data1;
+ lt_ptr data2;
+{
+ int (*func) LT_PARAMS((const char *filename, lt_ptr data))
+ = (int (*) LT_PARAMS((const char *filename, lt_ptr data))) data1;
+
+ int is_done = 0;
+ char *argz = 0;
+ size_t argz_len = 0;
+
+ if (list_files_by_dir (dirname, &argz, &argz_len) != 0)
+ goto cleanup;
+ if (!argz)
+ goto cleanup;
+
+ {
+ char *filename = 0;
+ while ((filename = argz_next (argz, argz_len, filename)))
+ if ((is_done = (*func) (filename, data2)))
+ break;
+ }
+
+ cleanup:
+ LT_DLFREE (argz);
+
+ return is_done;
+}
+
+
+/* Call FUNC for each unique extensionless file in SEARCH_PATH, along
+ with DATA. The filenames passed to FUNC would be suitable for
+ passing to lt_dlopenext. The extensions are stripped so that
+ individual modules do not generate several entries (e.g. libfoo.la,
+ libfoo.so, libfoo.so.1, libfoo.so.1.0.0). If SEARCH_PATH is NULL,
+ then the same directories that lt_dlopen would search are examined. */
+int
+lt_dlforeachfile (search_path, func, data)
+ const char *search_path;
+ int (*func) LT_PARAMS ((const char *filename, lt_ptr data));
+ lt_ptr data;
+{
+ int is_done = 0;
+
+ if (search_path)
+ {
+ /* If a specific path was passed, search only the directories
+ listed in it. */
+ is_done = foreach_dirinpath (search_path, 0,
+ foreachfile_callback, func, data);
+ }
+ else
+ {
+ /* Otherwise search the default paths. */
+ is_done = foreach_dirinpath (user_search_path, 0,
+ foreachfile_callback, func, data);
+ if (!is_done)
+ {
+ is_done = foreach_dirinpath (getenv("LTDL_LIBRARY_PATH"), 0,
+ foreachfile_callback, func, data);
+ }
+
+#ifdef LTDL_SHLIBPATH_VAR
+ if (!is_done)
+ {
+ is_done = foreach_dirinpath (getenv(LTDL_SHLIBPATH_VAR), 0,
+ foreachfile_callback, func, data);
+ }
+#endif
+#ifdef LTDL_SYSSEARCHPATH
+ if (!is_done)
+ {
+ is_done = foreach_dirinpath (getenv(LTDL_SYSSEARCHPATH), 0,
+ foreachfile_callback, func, data);
+ }
+#endif
+ }
+
+ return is_done;
}
int
lt_dlclose (handle)
- lt_dlhandle handle;
+ lt_dlhandle handle;
{
- lt_dlhandle cur, last;
-
- /* check whether the handle is valid */
- last = cur = handles;
- while (cur && handle != cur) {
- last = cur;
- cur = cur->next;
- }
- if (!cur) {
- last_error = LT_DLSTRERROR(INVALID_HANDLE);
- return 1;
- }
- handle->info.ref_count--;
- if (!handle->info.ref_count) {
- int error;
- lt_dlloader_data_t data = handle->loader->dlloader_data;
-
- if (handle != handles)
- last->next = handle->next;
- else
- handles = handle->next;
- error = handle->loader->module_close(data, handle->module);
- error += unload_deplibs(handle);
- if (handle->info.filename)
- lt_dlfree(handle->info.filename);
- if (handle->info.name)
- lt_dlfree(handle->info.name);
- lt_dlfree(handle);
- return error;
+ lt_dlhandle cur, last;
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+
+ /* check whether the handle is valid */
+ last = cur = handles;
+ while (cur && handle != cur)
+ {
+ last = cur;
+ cur = cur->next;
+ }
+
+ if (!cur)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ ++errors;
+ goto done;
+ }
+
+ handle->info.ref_count--;
+
+ /* Note that even with resident modules, we must track the ref_count
+ correctly incase the user decides to reset the residency flag
+ later (even though the API makes no provision for that at the
+ moment). */
+ if (handle->info.ref_count <= 0 && !LT_DLIS_RESIDENT (handle))
+ {
+ lt_user_data data = handle->loader->dlloader_data;
+
+ if (handle != handles)
+ {
+ last->next = handle->next;
}
- return 0;
+ else
+ {
+ handles = handle->next;
+ }
+
+ errors += handle->loader->module_close (data, handle->module);
+ errors += unload_deplibs(handle);
+
+ /* It is up to the callers to free the data itself. */
+ LT_DLFREE (handle->caller_data);
+
+ LT_DLFREE (handle->info.filename);
+ LT_DLFREE (handle->info.name);
+ LT_DLFREE (handle);
+
+ goto done;
+ }
+
+ if (LT_DLIS_RESIDENT (handle))
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (CLOSE_RESIDENT_MODULE));
+ ++errors;
+ }
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
}
-lt_ptr_t
+lt_ptr
lt_dlsym (handle, symbol)
- lt_dlhandle handle;
- const char *symbol;
+ lt_dlhandle handle;
+ const char *symbol;
{
- int lensym;
- char lsym[LTDL_SYMBOL_LENGTH];
- char *sym;
- lt_ptr_t address;
- lt_dlloader_data_t data;
-
- if (!handle) {
- last_error = LT_DLSTRERROR(INVALID_HANDLE);
- return 0;
- }
- if (!symbol) {
- last_error = LT_DLSTRERROR(SYMBOL_NOT_FOUND);
- return 0;
- }
- lensym = strlen(symbol);
- if (handle->loader->sym_prefix)
- lensym += strlen(handle->loader->sym_prefix);
- if (handle->info.name)
- lensym += strlen(handle->info.name);
- if (lensym + LTDL_SYMBOL_OVERHEAD < LTDL_SYMBOL_LENGTH)
- sym = lsym;
- else
- sym = (char*) lt_dlmalloc(lensym + LTDL_SYMBOL_OVERHEAD + 1);
- if (!sym) {
- last_error = LT_DLSTRERROR(BUFFER_OVERFLOW);
- return 0;
- }
- data = handle->loader->dlloader_data;
- if (handle->info.name) {
- const char *saved_error = last_error;
-
- /* this is a libtool module */
- if (handle->loader->sym_prefix) {
- strcpy(sym, handle->loader->sym_prefix);
- strcat(sym, handle->info.name);
- } else
- strcpy(sym, handle->info.name);
- strcat(sym, "_LTX_");
- strcat(sym, symbol);
- /* try "modulename_LTX_symbol" */
- address = handle->loader->find_sym(data, handle->module, sym);
- if (address) {
- if (sym != lsym)
- lt_dlfree(sym);
- return address;
- }
- last_error = saved_error;
+ size_t lensym;
+ char lsym[LT_SYMBOL_LENGTH];
+ char *sym;
+ lt_ptr address;
+ lt_user_data data;
+
+ if (!handle)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ return 0;
+ }
+
+ if (!symbol)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (SYMBOL_NOT_FOUND));
+ return 0;
+ }
+
+ lensym = LT_STRLEN (symbol) + LT_STRLEN (handle->loader->sym_prefix)
+ + LT_STRLEN (handle->info.name);
+
+ if (lensym + LT_SYMBOL_OVERHEAD < LT_SYMBOL_LENGTH)
+ {
+ sym = lsym;
+ }
+ else
+ {
+ sym = LT_EMALLOC (char, lensym + LT_SYMBOL_OVERHEAD + 1);
+ if (!sym)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (BUFFER_OVERFLOW));
+ return 0;
}
- /* otherwise try "symbol" */
- if (handle->loader->sym_prefix) {
- strcpy(sym, handle->loader->sym_prefix);
- strcat(sym, symbol);
- } else
- strcpy(sym, symbol);
- address = handle->loader->find_sym(data, handle->module, sym);
- if (sym != lsym)
- lt_dlfree(sym);
- return address;
+ }
+
+ data = handle->loader->dlloader_data;
+ if (handle->info.name)
+ {
+ const char *saved_error;
+
+ LT_DLMUTEX_GETERROR (saved_error);
+
+ /* this is a libtool module */
+ if (handle->loader->sym_prefix)
+ {
+ strcpy(sym, handle->loader->sym_prefix);
+ strcat(sym, handle->info.name);
+ }
+ else
+ {
+ strcpy(sym, handle->info.name);
+ }
+
+ strcat(sym, "_LTX_");
+ strcat(sym, symbol);
+
+ /* try "modulename_LTX_symbol" */
+ address = handle->loader->find_sym (data, handle->module, sym);
+ if (address)
+ {
+ if (sym != lsym)
+ {
+ LT_DLFREE (sym);
+ }
+ return address;
+ }
+ LT_DLMUTEX_SETERROR (saved_error);
+ }
+
+ /* otherwise try "symbol" */
+ if (handle->loader->sym_prefix)
+ {
+ strcpy(sym, handle->loader->sym_prefix);
+ strcat(sym, symbol);
+ }
+ else
+ {
+ strcpy(sym, symbol);
+ }
+
+ address = handle->loader->find_sym (data, handle->module, sym);
+ if (sym != lsym)
+ {
+ LT_DLFREE (sym);
+ }
+
+ return address;
}
const char *
-lt_dlerror LTDL_PARAMS((void))
+lt_dlerror ()
{
- const char *error = last_error;
-
- last_error = 0;
- return error;
+ const char *error;
+
+ LT_DLMUTEX_GETERROR (error);
+ LT_DLMUTEX_SETERROR (0);
+
+ return error ? error : LT_DLSTRERROR (UNKNOWN);
+}
+
+static int
+lt_dlpath_insertdir (ppath, before, dir)
+ char **ppath;
+ char *before;
+ const char *dir;
+{
+ int errors = 0;
+ char *canonical = 0;
+ char *argz = 0;
+ size_t argz_len = 0;
+
+ assert (ppath);
+ assert (dir && *dir);
+
+ if (canonicalize_path (dir, &canonical) != 0)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ assert (canonical && *canonical);
+
+ /* If *PPATH is empty, set it to DIR. */
+ if (*ppath == 0)
+ {
+ assert (!before); /* BEFORE cannot be set without PPATH. */
+ assert (dir); /* Without DIR, don't call this function! */
+
+ *ppath = lt_estrdup (dir);
+ if (*ppath == 0)
+ ++errors;
+
+ return errors;
+ }
+
+ assert (ppath && *ppath);
+
+ if (argzize_path (*ppath, &argz, &argz_len) != 0)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ /* Convert BEFORE into an equivalent offset into ARGZ. This only works
+ if *PPATH is already canonicalized, and hence does not change length
+ with respect to ARGZ. We canonicalize each entry as it is added to
+ the search path, and don't call this function with (uncanonicalized)
+ user paths, so this is a fair assumption. */
+ if (before)
+ {
+ assert (*ppath <= before);
+ assert (before - *ppath <= strlen (*ppath));
+
+ before = before - *ppath + argz;
+ }
+
+ if (lt_argz_insert (&argz, &argz_len, before, dir) != 0)
+ {
+ ++errors;
+ goto cleanup;
+ }
+
+ argz_stringify (argz, argz_len, LT_PATHSEP_CHAR);
+ LT_DLMEM_REASSIGN (*ppath, argz);
+
+ cleanup:
+ LT_DLFREE (canonical);
+ LT_DLFREE (argz);
+
+ return errors;
}
int
lt_dladdsearchdir (search_dir)
- const char *search_dir;
-{
- if (!search_dir || !strlen(search_dir))
- return 0;
- if (!user_search_path) {
- user_search_path = strdup(search_dir);
- if (!user_search_path) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- } else {
- char *new_search_path = (char*)
- lt_dlmalloc(strlen(user_search_path) +
- strlen(search_dir) + 2); /* ':' + '\0' == 2 */
- if (!new_search_path) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- sprintf (new_search_path, "%s%c%s", user_search_path,
- LTDL_PATHSEP_CHAR, search_dir);
- lt_dlfree(user_search_path);
- user_search_path = new_search_path;
+ const char *search_dir;
+{
+ int errors = 0;
+
+ if (search_dir && *search_dir)
+ {
+ LT_DLMUTEX_LOCK ();
+ if (lt_dlpath_insertdir (&user_search_path, 0, search_dir) != 0)
+ ++errors;
+ LT_DLMUTEX_UNLOCK ();
+ }
+
+ return errors;
+}
+
+int
+lt_dlinsertsearchdir (before, search_dir)
+ const char *before;
+ const char *search_dir;
+{
+ int errors = 0;
+
+ if (before)
+ {
+ LT_DLMUTEX_LOCK ();
+ if ((before < user_search_path)
+ || (before >= user_search_path + LT_STRLEN (user_search_path)))
+ {
+ LT_DLMUTEX_UNLOCK ();
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_POSITION));
+ return 1;
}
- return 0;
+ LT_DLMUTEX_UNLOCK ();
+ }
+
+ if (search_dir && *search_dir)
+ {
+ LT_DLMUTEX_LOCK ();
+ if (lt_dlpath_insertdir (&user_search_path,
+ (char *) before, search_dir) != 0)
+ {
+ ++errors;
+ }
+ LT_DLMUTEX_UNLOCK ();
+ }
+
+ return errors;
}
int
lt_dlsetsearchpath (search_path)
- const char *search_path;
-{
- if (user_search_path)
- lt_dlfree(user_search_path);
- user_search_path = 0; /* reset the search path */
- if (!search_path || !strlen(search_path))
- return 0;
- user_search_path = strdup(search_path);
- if (!user_search_path)
- return 1;
- return 0;
+ const char *search_path;
+{
+ int errors = 0;
+
+ LT_DLMUTEX_LOCK ();
+ LT_DLFREE (user_search_path);
+ LT_DLMUTEX_UNLOCK ();
+
+ if (!search_path || !LT_STRLEN (search_path))
+ {
+ return errors;
+ }
+
+ LT_DLMUTEX_LOCK ();
+ if (canonicalize_path (search_path, &user_search_path) != 0)
+ ++errors;
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
}
const char *
-lt_dlgetsearchpath LTDL_PARAMS((void))
+lt_dlgetsearchpath ()
{
- return user_search_path;
+ const char *saved_path;
+
+ LT_DLMUTEX_LOCK ();
+ saved_path = user_search_path;
+ LT_DLMUTEX_UNLOCK ();
+
+ return saved_path;
}
-const lt_dlinfo *
-lt_dlgetinfo (handle)
- lt_dlhandle handle;
+int
+lt_dlmakeresident (handle)
+ lt_dlhandle handle;
{
- if (!handle) {
- last_error = LT_DLSTRERROR(INVALID_HANDLE);
- return 0;
- }
- return &(handle->info);
+ int errors = 0;
+
+ if (!handle)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ ++errors;
+ }
+ else
+ {
+ LT_DLSET_FLAG (handle, LT_DLRESIDENT_FLAG);
+ }
+
+ return errors;
}
int
-lt_dlforeach (func, data)
- int (*func) LTDL_PARAMS((lt_dlhandle handle, lt_ptr_t data));
- lt_ptr_t data;
+lt_dlisresident (handle)
+ lt_dlhandle handle;
{
- lt_dlhandle cur = handles;
- while (cur) {
- lt_dlhandle tmp = cur;
- cur = cur->next;
- if (func(tmp, data))
- return 1;
- }
- return 0;
+ if (!handle)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ return -1;
+ }
+
+ return LT_DLIS_RESIDENT (handle);
}
-int
-lt_dlloader_add (place, dlloader, loader_name)
- lt_dlloader_t *place;
- const struct lt_user_dlloader *dlloader;
- const char *loader_name;
+
+
+
+/* --- MODULE INFORMATION --- */
+
+const lt_dlinfo *
+lt_dlgetinfo (handle)
+ lt_dlhandle handle;
{
- lt_dlloader_t *node = 0, *ptr = 0;
-
- if ((dlloader == 0) /* diagnose null parameters */
- || (dlloader->module_open == 0)
- || (dlloader->module_close == 0)
- || (dlloader->find_sym == 0)) {
- last_error = LT_DLSTRERROR(INVALID_LOADER);
- return 1;
- }
-
- /* Create a new dlloader node with copies of the user callbacks. */
- node = (lt_dlloader_t *) lt_dlmalloc (sizeof (lt_dlloader_t));
- if (node == 0) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return 1;
- }
- node->next = 0;
- node->loader_name = loader_name;
- node->sym_prefix = dlloader->sym_prefix;
- node->dlloader_exit = dlloader->dlloader_exit;
- node->module_open = dlloader->module_open;
- node->module_close = dlloader->module_close;
- node->find_sym = dlloader->find_sym;
- node->dlloader_data = dlloader->dlloader_data;
-
- if (!loaders)
- /* If there are no loaders, NODE becomes the list! */
- loaders = node;
- else if (!place) {
- /* If PLACE is not set, add NODE to the end of the
- LOADERS list. */
- for (ptr = loaders; ptr->next; ptr = ptr->next)
- /*NOWORK*/;
- ptr->next = node;
- } else if (loaders == place) {
- /* If PLACE is the first loader, NODE goes first. */
- node->next = place;
- loaders = node;
- } else {
- /* Find the node immediately preceding PLACE. */
- for (ptr = loaders; ptr->next != place; ptr = ptr->next)
- /*NOWORK*/;
-
- if (ptr->next != place) {
- last_error = LT_DLSTRERROR(INVALID_LOADER);
- return 1;
- }
+ if (!handle)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_HANDLE));
+ return 0;
+ }
- /* Insert NODE between PTR and PLACE. */
- node->next = place;
- ptr->next = node;
- }
+ return &(handle->info);
+}
- return 0;
+lt_dlhandle
+lt_dlhandle_next (place)
+ lt_dlhandle place;
+{
+ return place ? place->next : handles;
}
int
-lt_dlloader_remove (loader_name)
- const char *loader_name;
+lt_dlforeach (func, data)
+ int (*func) LT_PARAMS((lt_dlhandle handle, lt_ptr data));
+ lt_ptr data;
{
- lt_dlloader_t *place = lt_dlloader_find (loader_name);
- lt_dlhandle handle;
- int result = 0;
+ int errors = 0;
+ lt_dlhandle cur;
- if (!place) {
- last_error = LT_DLSTRERROR(INVALID_LOADER);
- return 1;
- }
+ LT_DLMUTEX_LOCK ();
- /* Fail if there are any open modules which use this loader. */
- for (handle = handles; handle; handle = handle->next)
- if (handle->loader == place) {
- last_error = LT_DLSTRERROR(REMOVE_LOADER);
- return 1;
- }
-
- if (place == loaders)
- /* PLACE is the first loader in the list. */
- loaders = loaders->next;
- else {
- /* Find the loader before the one being removed. */
- lt_dlloader_t *prev;
- for (prev = loaders; prev->next; prev = prev->next)
- if (!strcmp (prev->next->loader_name, loader_name))
- break;
+ cur = handles;
+ while (cur)
+ {
+ lt_dlhandle tmp = cur;
- place = prev->next;
- prev->next = prev->next->next;
+ cur = cur->next;
+ if ((*func) (tmp, data))
+ {
+ ++errors;
+ break;
}
- if (place->dlloader_exit)
- result = place->dlloader_exit (place->dlloader_data);
- lt_dlfree (place);
+ }
- return result;
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
}
-lt_dlloader_t *
-lt_dlloader_next (place)
- lt_dlloader_t *place;
+lt_dlcaller_id
+lt_dlcaller_register ()
{
- return place ? place->next : loaders;
+ static lt_dlcaller_id last_caller_id = 0;
+ int result;
+
+ LT_DLMUTEX_LOCK ();
+ result = ++last_caller_id;
+ LT_DLMUTEX_UNLOCK ();
+
+ return result;
}
-
-const char *
-lt_dlloader_name (place)
- lt_dlloader_t *place;
-{
- if (!place)
- last_error = LT_DLSTRERROR(INVALID_LOADER);
- return place ? place->loader_name : 0;
-}
-lt_dlloader_data_t *
-lt_dlloader_data (place)
- lt_dlloader_t *place;
+lt_ptr
+lt_dlcaller_set_data (key, handle, data)
+ lt_dlcaller_id key;
+ lt_dlhandle handle;
+ lt_ptr data;
{
- if (!place)
- last_error = LT_DLSTRERROR(INVALID_LOADER);
- return place ? &(place->dlloader_data) : 0;
-}
+ int n_elements = 0;
+ lt_ptr stale = (lt_ptr) 0;
+ int i;
+
+ /* This needs to be locked so that the caller data can be updated
+ simultaneously by different threads. */
+ LT_DLMUTEX_LOCK ();
+
+ if (handle->caller_data)
+ while (handle->caller_data[n_elements].key)
+ ++n_elements;
+
+ for (i = 0; i < n_elements; ++i)
+ {
+ if (handle->caller_data[i].key == key)
+ {
+ stale = handle->caller_data[i].data;
+ break;
+ }
+ }
+
+ /* Ensure that there is enough room in this handle's caller_data
+ array to accept a new element (and an empty end marker). */
+ if (i == n_elements)
+ {
+ lt_caller_data *temp
+ = LT_DLREALLOC (lt_caller_data, handle->caller_data, 2+ n_elements);
+
+ if (!temp)
+ {
+ stale = 0;
+ goto done;
+ }
-lt_dlloader_t *
-lt_dlloader_find (loader_name)
- const char *loader_name;
-{
- lt_dlloader_t *place = 0;
+ handle->caller_data = temp;
- for (place = loaders; place; place = place->next)
- if (strcmp (place->loader_name, loader_name) == 0)
- break;
+ /* We only need this if we needed to allocate a new caller_data. */
+ handle->caller_data[i].key = key;
+ handle->caller_data[1+ i].key = 0;
+ }
- return place;
+ handle->caller_data[i].data = data;
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+
+ return stale;
}
-static const char **user_error_strings = 0;
-static int errorcode = LTDL_ERROR_MAX;
+lt_ptr
+lt_dlcaller_get_data (key, handle)
+ lt_dlcaller_id key;
+ lt_dlhandle handle;
+{
+ lt_ptr result = (lt_ptr) 0;
+
+ /* This needs to be locked so that the caller data isn't updated by
+ another thread part way through this function. */
+ LT_DLMUTEX_LOCK ();
+
+ /* Locate the index of the element with a matching KEY. */
+ {
+ int i;
+ for (i = 0; handle->caller_data[i].key; ++i)
+ {
+ if (handle->caller_data[i].key == key)
+ {
+ result = handle->caller_data[i].data;
+ break;
+ }
+ }
+ }
+
+ LT_DLMUTEX_UNLOCK ();
+
+ return result;
+}
+
+
+
+/* --- USER MODULE LOADER API --- */
+
int
-lt_dladderror (diagnostic)
- const char *diagnostic;
+lt_dlloader_add (place, dlloader, loader_name)
+ lt_dlloader *place;
+ const struct lt_user_dlloader *dlloader;
+ const char *loader_name;
{
- int index = errorcode - LTDL_ERROR_MAX;
- const char **temp = 0;
+ int errors = 0;
+ lt_dlloader *node = 0, *ptr = 0;
+
+ if ((dlloader == 0) /* diagnose null parameters */
+ || (dlloader->module_open == 0)
+ || (dlloader->module_close == 0)
+ || (dlloader->find_sym == 0))
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
+ return 1;
+ }
+
+ /* Create a new dlloader node with copies of the user callbacks. */
+ node = LT_EMALLOC (lt_dlloader, 1);
+ if (!node)
+ return 1;
+
+ node->next = 0;
+ node->loader_name = loader_name;
+ node->sym_prefix = dlloader->sym_prefix;
+ node->dlloader_exit = dlloader->dlloader_exit;
+ node->module_open = dlloader->module_open;
+ node->module_close = dlloader->module_close;
+ node->find_sym = dlloader->find_sym;
+ node->dlloader_data = dlloader->dlloader_data;
+
+ LT_DLMUTEX_LOCK ();
+ if (!loaders)
+ {
+ /* If there are no loaders, NODE becomes the list! */
+ loaders = node;
+ }
+ else if (!place)
+ {
+ /* If PLACE is not set, add NODE to the end of the
+ LOADERS list. */
+ for (ptr = loaders; ptr->next; ptr = ptr->next)
+ {
+ /*NOWORK*/;
+ }
- /* realloc is not entirely portable, so simulate it using
- lt_dlmalloc and lt_dlfree. */
- temp = (const char **) lt_dlmalloc ((1+index) * sizeof(const char*));
- if (temp == 0) {
- last_error = LT_DLSTRERROR(NO_MEMORY);
- return -1;
+ ptr->next = node;
+ }
+ else if (loaders == place)
+ {
+ /* If PLACE is the first loader, NODE goes first. */
+ node->next = place;
+ loaders = node;
+ }
+ else
+ {
+ /* Find the node immediately preceding PLACE. */
+ for (ptr = loaders; ptr->next != place; ptr = ptr->next)
+ {
+ /*NOWORK*/;
}
- /* Build the new vector in the memory addressed by temp. */
- temp[index] = diagnostic;
- while (--index >= 0)
- temp[index] = user_error_strings[index];
+ if (ptr->next != place)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
+ ++errors;
+ }
+ else
+ {
+ /* Insert NODE between PTR and PLACE. */
+ node->next = place;
+ ptr->next = node;
+ }
+ }
+
+ LT_DLMUTEX_UNLOCK ();
- lt_dlfree (user_error_strings);
- user_error_strings = temp;
- return errorcode++;
+ return errors;
}
int
-lt_dlseterror (index)
- int index;
+lt_dlloader_remove (loader_name)
+ const char *loader_name;
{
- if (index >= errorcode || index < 0) {
- last_error = LT_DLSTRERROR(INVALID_ERRORCODE);
- return 1;
+ lt_dlloader *place = lt_dlloader_find (loader_name);
+ lt_dlhandle handle;
+ int errors = 0;
+
+ if (!place)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
+ return 1;
+ }
+
+ LT_DLMUTEX_LOCK ();
+
+ /* Fail if there are any open modules which use this loader. */
+ for (handle = handles; handle; handle = handle->next)
+ {
+ if (handle->loader == place)
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (REMOVE_LOADER));
+ ++errors;
+ goto done;
+ }
+ }
+
+ if (place == loaders)
+ {
+ /* PLACE is the first loader in the list. */
+ loaders = loaders->next;
+ }
+ else
+ {
+ /* Find the loader before the one being removed. */
+ lt_dlloader *prev;
+ for (prev = loaders; prev->next; prev = prev->next)
+ {
+ if (!strcmp (prev->next->loader_name, loader_name))
+ {
+ break;
+ }
}
-
- if (index < LTDL_ERROR_MAX)
- last_error = ltdl_error_strings[errorcode];
- else
- last_error = user_error_strings[errorcode - LTDL_ERROR_MAX];
- return 0;
+ place = prev->next;
+ prev->next = prev->next->next;
+ }
+
+ if (place->dlloader_exit)
+ {
+ errors = place->dlloader_exit (place->dlloader_data);
+ }
+
+ LT_DLFREE (place);
+
+ done:
+ LT_DLMUTEX_UNLOCK ();
+
+ return errors;
+}
+
+lt_dlloader *
+lt_dlloader_next (place)
+ lt_dlloader *place;
+{
+ lt_dlloader *next;
+
+ LT_DLMUTEX_LOCK ();
+ next = place ? place->next : loaders;
+ LT_DLMUTEX_UNLOCK ();
+
+ return next;
+}
+
+const char *
+lt_dlloader_name (place)
+ lt_dlloader *place;
+{
+ const char *name = 0;
+
+ if (place)
+ {
+ LT_DLMUTEX_LOCK ();
+ name = place ? place->loader_name : 0;
+ LT_DLMUTEX_UNLOCK ();
+ }
+ else
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
+ }
+
+ return name;
+}
+
+lt_user_data *
+lt_dlloader_data (place)
+ lt_dlloader *place;
+{
+ lt_user_data *data = 0;
+
+ if (place)
+ {
+ LT_DLMUTEX_LOCK ();
+ data = place ? &(place->dlloader_data) : 0;
+ LT_DLMUTEX_UNLOCK ();
+ }
+ else
+ {
+ LT_DLMUTEX_SETERROR (LT_DLSTRERROR (INVALID_LOADER));
+ }
+
+ return data;
+}
+
+lt_dlloader *
+lt_dlloader_find (loader_name)
+ const char *loader_name;
+{
+ lt_dlloader *place = 0;
+
+ LT_DLMUTEX_LOCK ();
+ for (place = loaders; place; place = place->next)
+ {
+ if (strcmp (place->loader_name, loader_name) == 0)
+ {
+ break;
+ }
+ }
+ LT_DLMUTEX_UNLOCK ();
+
+ return place;
}
diff --git a/libjava/libltdl/ltdl.h b/libjava/libltdl/ltdl.h
index 666c785c8c1..2bbfa302cc4 100644
--- a/libjava/libltdl/ltdl.h
+++ b/libjava/libltdl/ltdl.h
@@ -25,226 +25,337 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
*/
/* Only include this header file once. */
-#ifndef _LTDL_H_
-#define _LTDL_H_ 1
+#ifndef LTDL_H
+#define LTDL_H 1
-/* Canonicalise Windows and Cygwin recognition macros. */
-#ifdef __CYGWIN32__
-# ifndef __CYGWIN__
-# define __CYGWIN__ __CYGWIN32__
-# endif
-#endif
-#ifdef _WIN32
-# ifndef WIN32
-# define WIN32 _WIN32
-# endif
-#endif
+#include <sys/types.h> /* for size_t declaration */
+
+
+/* --- MACROS FOR PORTABILITY --- */
-/* __BEGIN_DECLS should be used at the beginning of your declarations,
- so that C++ compilers don't mangle their names. Use __END_DECLS at
+
+/* Saves on those hard to debug '\0' typos.... */
+#define LT_EOS_CHAR '\0'
+
+/* LTDL_BEGIN_C_DECLS should be used at the beginning of your declarations,
+ so that C++ compilers don't mangle their names. Use LTDL_END_C_DECLS at
the end of C declarations. */
-#undef __BEGIN_DECLS
-#undef __END_DECLS
#ifdef __cplusplus
-# define __BEGIN_DECLS extern "C" {
-# define __END_DECLS }
+# define LT_BEGIN_C_DECLS extern "C" {
+# define LT_END_C_DECLS }
#else
-# define __BEGIN_DECLS /* empty */
-# define __END_DECLS /* empty */
+# define LT_BEGIN_C_DECLS /* empty */
+# define LT_END_C_DECLS /* empty */
#endif
-/* LTDL_PARAMS is a macro used to wrap function prototypes, so that compilers
+LT_BEGIN_C_DECLS
+
+
+/* LT_PARAMS is a macro used to wrap function prototypes, so that compilers
that don't understand ANSI C prototypes still work, and ANSI C
- compilers can issue warnings about type mismatches. */
-#undef LTDL_PARAMS
-#undef lt_ptr_t
+ compilers can issue warnings about type mismatches. */
#if defined (__STDC__) || defined (_AIX) || (defined (__mips) && defined (_SYSTYPE_SVR4)) || defined(WIN32) || defined(__cplusplus)
-# define LTDL_PARAMS(protos) protos
-# define lt_ptr_t void*
+# define LT_PARAMS(protos) protos
+# define lt_ptr void*
#else
-# define LTDL_PARAMS(protos) ()
-# define lt_ptr_t char*
+# define LT_PARAMS(protos) ()
+# define lt_ptr char*
#endif
-/* LTDL_STMT_START/END are used to create macros which expand to a
- a single compound statement in a portable way. */
-#undef LTDL_STMT_START
-#undef LTDL_STMT_END
+/* LT_STMT_START/END are used to create macros which expand to a
+ a single compound statement in a portable way. */
#if defined (__GNUC__) && !defined (__STRICT_ANSI__) && !defined (__cplusplus)
-# define LTDL_STMT_START (void)(
-# define LTDL_STMT_END )
+# define LT_STMT_START (void)(
+# define LT_STMT_END )
#else
# if (defined (sun) || defined (__sun__))
-# define LTDL_STMT_START if (1)
-# define LTDL_STMT_END else (void)0
+# define LT_STMT_START if (1)
+# define LT_STMT_END else (void)0
# else
-# define LTDL_STMT_START do
-# define LTDL_STMT_END while (0)
+# define LT_STMT_START do
+# define LT_STMT_END while (0)
+# endif
+#endif
+
+/* LT_CONC creates a new concatenated symbol for the compiler
+ in a portable way. */
+#if defined(__STDC__) || defined(__cplusplus)
+# define LT_CONC(s,t) s##t
+#else
+# define LT_CONC(s,t) s/**/t
+#endif
+
+/* LT_STRLEN can be used safely on NULL pointers. */
+#define LT_STRLEN(s) (((s) && (s)[0]) ? strlen (s) : 0)
+
+
+
+/* --- WINDOWS SUPPORT --- */
+
+
+/* Canonicalise Windows and Cygwin recognition macros. */
+#ifdef __CYGWIN32__
+# ifndef __CYGWIN__
+# define __CYGWIN__ __CYGWIN32__
+# endif
+#endif
+#if defined(_WIN32) || defined(WIN32)
+# ifndef __WINDOWS__
+# ifdef _WIN32
+# define __WINDOWS__ _WIN32
+# else
+# ifdef WIN32
+# define __WINDOWS__ WIN32
+# endif
+# endif
# endif
#endif
-#ifdef WIN32
+#ifdef __WINDOWS__
# ifndef __CYGWIN__
-/* LTDL_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
+/* LT_DIRSEP_CHAR is accepted *in addition* to '/' as a directory
separator when it is set. */
-# define LTDL_DIRSEP_CHAR '\\'
-# define LTDL_PATHSEP_CHAR ';'
+# define LT_DIRSEP_CHAR '\\'
+# define LT_PATHSEP_CHAR ';'
# endif
#endif
-#ifndef LTDL_PATHSEP_CHAR
-# define LTDL_PATHSEP_CHAR ':'
+#ifndef LT_PATHSEP_CHAR
+# define LT_PATHSEP_CHAR ':'
#endif
/* DLL building support on win32 hosts; mostly to workaround their
ridiculous implementation of data symbol exporting. */
-#ifndef LTDL_SCOPE
-# ifdef _WIN32
+#ifndef LT_SCOPE
+# ifdef __WINDOWS__
# ifdef DLL_EXPORT /* defined by libtool (if required) */
-# define LTDL_SCOPE __declspec(dllexport)
+# define LT_SCOPE __declspec(dllexport)
# endif
# ifdef LIBLTDL_DLL_IMPORT /* define if linking with this dll */
-# define LTDL_SCOPE extern __declspec(dllimport)
+# define LT_SCOPE extern __declspec(dllimport)
# endif
# endif
-# ifndef LTDL_SCOPE /* static linking or !_WIN32 */
-# define LTDL_SCOPE extern
+# ifndef LT_SCOPE /* static linking or !__WINDOWS__ */
+# define LT_SCOPE extern
# endif
#endif
-#include <stdlib.h>
-/* Defining error strings alongside their symbolic names in a macro in
- this way allows us to expand the macro in different contexts with
- confidence that the enumeration of symbolic names will map correctly
- onto the table of error strings. */
-#define ltdl_error_table \
- LTDL_ERROR(UNKNOWN, "unknown error") \
- LTDL_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available")\
- LTDL_ERROR(INVALID_LOADER, "invalid loader") \
- LTDL_ERROR(INIT_LOADER, "loader initialization failed") \
- LTDL_ERROR(REMOVE_LOADER, "loader removal failed") \
- LTDL_ERROR(FILE_NOT_FOUND, "file not found") \
- LTDL_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \
- LTDL_ERROR(NO_SYMBOLS, "no symbols defined") \
- LTDL_ERROR(CANNOT_OPEN, "can't open the module") \
- LTDL_ERROR(CANNOT_CLOSE, "can't close the module") \
- LTDL_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \
- LTDL_ERROR(NO_MEMORY, "not enough memory") \
- LTDL_ERROR(INVALID_HANDLE, "invalid module handle") \
- LTDL_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \
- LTDL_ERROR(INVALID_ERRORCODE, "invalid errorcode") \
- LTDL_ERROR(SHUTDOWN, "library already shutdown")
-/* Enumerate the symbolic error names. */
-#if defined(__STDC__) || defined(__cplusplus)
-# define LTDL_ERROR(name, diagnostic) LTDL_ERROR_##name,
-#else
-# define LTDL_ERROR(name, diagnostic) LTDL_ERROR_/**/name,
-#endif
-enum {
- ltdl_error_table
- LTDL_ERROR_MAX
-};
-#undef LTDL_ERROR
+
+/* --- DYNAMIC MODULE LOADING API --- */
+
+
+typedef struct lt_dlhandle_struct *lt_dlhandle; /* A loaded module. */
+
+/* Initialisation and finalisation functions for libltdl. */
+extern int lt_dlinit LT_PARAMS((void));
+extern int lt_dlexit LT_PARAMS((void));
+
+/* Module search path manipulation. */
+extern int lt_dladdsearchdir LT_PARAMS((const char *search_dir));
+extern int lt_dlinsertsearchdir LT_PARAMS((const char *before,
+ const char *search_dir));
+extern int lt_dlsetsearchpath LT_PARAMS((const char *search_path));
+extern const char *lt_dlgetsearchpath LT_PARAMS((void));
+extern int lt_dlforeachfile LT_PARAMS((
+ const char *search_path,
+ int (*func) (const char *filename, lt_ptr data),
+ lt_ptr data));
+
+/* Portable libltdl versions of the system dlopen() API. */
+extern lt_dlhandle lt_dlopen LT_PARAMS((const char *filename));
+extern lt_dlhandle lt_dlopenext LT_PARAMS((const char *filename));
+extern lt_ptr lt_dlsym LT_PARAMS((lt_dlhandle handle,
+ const char *name));
+extern const char *lt_dlerror LT_PARAMS((void));
+extern int lt_dlclose LT_PARAMS((lt_dlhandle handle));
+
+/* Module residency management. */
+extern int lt_dlmakeresident LT_PARAMS((lt_dlhandle handle));
+extern int lt_dlisresident LT_PARAMS((lt_dlhandle handle));
+
+
+
+
+/* --- MUTEX LOCKING --- */
+
+
+typedef void lt_dlmutex_lock LT_PARAMS((void));
+typedef void lt_dlmutex_unlock LT_PARAMS((void));
+typedef void lt_dlmutex_seterror LT_PARAMS((const char *errmsg));
+typedef const char *lt_dlmutex_geterror LT_PARAMS((void));
+
+extern int lt_dlmutex_register LT_PARAMS((lt_dlmutex_lock *lock,
+ lt_dlmutex_unlock *unlock,
+ lt_dlmutex_seterror *seterror,
+ lt_dlmutex_geterror *geterror));
+
+
+
+
+/* --- MEMORY HANDLING --- */
+
+
+/* By default, the realloc function pointer is set to our internal
+ realloc implementation which iself uses lt_dlmalloc and lt_dlfree.
+ libltdl relies on a featureful realloc, but if you are sure yours
+ has the right semantics then you can assign it directly. Generally,
+ it is safe to assign just a malloc() and a free() function. */
+LT_SCOPE lt_ptr (*lt_dlmalloc) LT_PARAMS((size_t size));
+LT_SCOPE lt_ptr (*lt_dlrealloc) LT_PARAMS((lt_ptr ptr, size_t size));
+LT_SCOPE void (*lt_dlfree) LT_PARAMS((lt_ptr ptr));
+
+
+
+
+/* --- PRELOADED MODULE SUPPORT --- */
-/* An opaque handle for a successfully lt_dlopened module instance. */
-#ifdef _LTDL_COMPILE_
-typedef struct lt_dlhandle_t *lt_dlhandle;
-#else
-typedef lt_ptr_t lt_dlhandle;
-#endif
/* A preopened symbol. Arrays of this type comprise the exported
symbols for a dlpreopened module. */
typedef struct {
- const char *name;
- lt_ptr_t address;
+ const char *name;
+ lt_ptr address;
} lt_dlsymlist;
+extern int lt_dlpreload LT_PARAMS((const lt_dlsymlist *preloaded));
+extern int lt_dlpreload_default
+ LT_PARAMS((const lt_dlsymlist *preloaded));
+
+#define LTDL_SET_PRELOADED_SYMBOLS() LT_STMT_START{ \
+ extern const lt_dlsymlist lt_preloaded_symbols[]; \
+ lt_dlpreload_default(lt_preloaded_symbols); \
+ }LT_STMT_END
+
+
+
+
+/* --- MODULE INFORMATION --- */
+
+
/* Read only information pertaining to a loaded module. */
typedef struct {
- char *filename; /* file name */
- char *name; /* module name */
- int ref_count; /* number of times lt_dlopened minus
+ char *filename; /* file name */
+ char *name; /* module name */
+ int ref_count; /* number of times lt_dlopened minus
number of times lt_dlclosed. */
} lt_dlinfo;
-/* An opaque handle for a module loaded by a system call. This is only
- used internally by ltdl loaders, and by user module loaders. */
-typedef lt_ptr_t lt_module_t;
+extern const lt_dlinfo *lt_dlgetinfo LT_PARAMS((lt_dlhandle handle));
+extern lt_dlhandle lt_dlhandle_next LT_PARAMS((lt_dlhandle place));
+extern int lt_dlforeach LT_PARAMS((
+ int (*func) (lt_dlhandle handle, lt_ptr data),
+ lt_ptr data));
+
+/* Associating user data with loaded modules. */
+typedef unsigned lt_dlcaller_id;
+
+extern lt_dlcaller_id lt_dlcaller_register LT_PARAMS((void));
+extern lt_ptr lt_dlcaller_set_data LT_PARAMS((lt_dlcaller_id key,
+ lt_dlhandle handle,
+ lt_ptr data));
+extern lt_ptr lt_dlcaller_get_data LT_PARAMS((lt_dlcaller_id key,
+ lt_dlhandle handle));
+
+
+
+/* --- USER MODULE LOADER API --- */
-/* An opaque handle for a module loader. */
-#ifdef _LTDL_COMPILE_
-typedef struct lt_dlloader_t lt_dlloader_t;
-#else
-typedef lt_ptr_t lt_dlloader_t;
-#endif
-typedef lt_ptr_t lt_dlloader_data_t;
+typedef struct lt_dlloader lt_dlloader;
+typedef lt_ptr lt_user_data;
+typedef lt_ptr lt_module;
/* Function pointer types for creating user defined module loaders. */
-typedef lt_module_t lt_module_open_t LTDL_PARAMS((lt_dlloader_data_t loader_data, const char *filename));
-typedef int lt_module_close_t LTDL_PARAMS((lt_dlloader_data_t loader_data, lt_module_t handle));
-typedef lt_ptr_t lt_find_sym_t LTDL_PARAMS((lt_dlloader_data_t loader_data, lt_module_t handle, const char *symbol));
-typedef int lt_dlloader_exit_t LTDL_PARAMS((lt_dlloader_data_t loader_data));
+typedef lt_module lt_module_open LT_PARAMS((lt_user_data loader_data,
+ const char *filename));
+typedef int lt_module_close LT_PARAMS((lt_user_data loader_data,
+ lt_module handle));
+typedef lt_ptr lt_find_sym LT_PARAMS((lt_user_data loader_data,
+ lt_module handle,
+ const char *symbol));
+typedef int lt_dlloader_exit LT_PARAMS((lt_user_data loader_data));
-__BEGIN_DECLS
-/* Initialisation and finalisation functions for libltdl. */
-extern int lt_dlinit LTDL_PARAMS((void));
-extern int lt_dlexit LTDL_PARAMS((void));
+struct lt_user_dlloader {
+ const char *sym_prefix;
+ lt_module_open *module_open;
+ lt_module_close *module_close;
+ lt_find_sym *find_sym;
+ lt_dlloader_exit *dlloader_exit;
+ lt_user_data dlloader_data;
+};
-/* Module search path manipultation. */
-extern int lt_dladdsearchdir LTDL_PARAMS((const char *search_dir));
-extern int lt_dlsetsearchpath LTDL_PARAMS((const char *search_path));
-extern const char *lt_dlgetsearchpath LTDL_PARAMS((void));
+extern lt_dlloader *lt_dlloader_next LT_PARAMS((lt_dlloader *place));
+extern lt_dlloader *lt_dlloader_find LT_PARAMS((
+ const char *loader_name));
+extern const char *lt_dlloader_name LT_PARAMS((lt_dlloader *place));
+extern lt_user_data *lt_dlloader_data LT_PARAMS((lt_dlloader *place));
+extern int lt_dlloader_add LT_PARAMS((lt_dlloader *place,
+ const struct lt_user_dlloader *dlloader,
+ const char *loader_name));
+extern int lt_dlloader_remove LT_PARAMS((
+ const char *loader_name));
-/* Portable libltdl versions of the system dlopen() API. */
-extern lt_dlhandle lt_dlopen LTDL_PARAMS((const char *filename));
-extern lt_dlhandle lt_dlopenext LTDL_PARAMS((const char *filename));
-extern lt_ptr_t lt_dlsym LTDL_PARAMS((lt_dlhandle handle, const char *name));
-extern const char *lt_dlerror LTDL_PARAMS((void));
-extern int lt_dlclose LTDL_PARAMS((lt_dlhandle handle));
-/* Support for preloaded modules through lt_dlopen() API. */
-extern int lt_dlpreload LTDL_PARAMS((const lt_dlsymlist *preloaded));
-extern int lt_dlpreload_default LTDL_PARAMS((const lt_dlsymlist *preloaded));
+
+/* --- ERROR MESSAGE HANDLING --- */
-#define LTDL_SET_PRELOADED_SYMBOLS() LTDL_STMT_START{ \
- extern const lt_dlsymlist lt_preloaded_symbols[]; \
- lt_dlpreload_default(lt_preloaded_symbols); \
- }LTDL_STMT_END
-/* Managing user data associated with a loaded modules. */
-extern const lt_dlinfo *lt_dlgetinfo LTDL_PARAMS((lt_dlhandle handle));
-extern int lt_dlforeach LTDL_PARAMS((
- int (*func)(lt_dlhandle handle, lt_ptr_t data), lt_ptr_t data));
+/* Defining error strings alongside their symbolic names in a macro in
+ this way allows us to expand the macro in different contexts with
+ confidence that the enumeration of symbolic names will map correctly
+ onto the table of error strings. */
+#define lt_dlerror_table \
+ LT_ERROR(UNKNOWN, "unknown error") \
+ LT_ERROR(DLOPEN_NOT_SUPPORTED, "dlopen support not available") \
+ LT_ERROR(INVALID_LOADER, "invalid loader") \
+ LT_ERROR(INIT_LOADER, "loader initialization failed") \
+ LT_ERROR(REMOVE_LOADER, "loader removal failed") \
+ LT_ERROR(FILE_NOT_FOUND, "file not found") \
+ LT_ERROR(DEPLIB_NOT_FOUND, "dependency library not found") \
+ LT_ERROR(NO_SYMBOLS, "no symbols defined") \
+ LT_ERROR(CANNOT_OPEN, "can't open the module") \
+ LT_ERROR(CANNOT_CLOSE, "can't close the module") \
+ LT_ERROR(SYMBOL_NOT_FOUND, "symbol not found") \
+ LT_ERROR(NO_MEMORY, "not enough memory") \
+ LT_ERROR(INVALID_HANDLE, "invalid module handle") \
+ LT_ERROR(BUFFER_OVERFLOW, "internal buffer overflow") \
+ LT_ERROR(INVALID_ERRORCODE, "invalid errorcode") \
+ LT_ERROR(SHUTDOWN, "library already shutdown") \
+ LT_ERROR(CLOSE_RESIDENT_MODULE, "can't close resident module") \
+ LT_ERROR(INVALID_MUTEX_ARGS, "invalid mutex handler registration") \
+ LT_ERROR(INVALID_POSITION, "invalid search path insert position")
-/* User module loader API. */
-struct lt_user_dlloader {
- const char *sym_prefix;
- lt_module_open_t *module_open;
- lt_module_close_t *module_close;
- lt_find_sym_t *find_sym;
- lt_dlloader_exit_t *dlloader_exit;
- lt_dlloader_data_t dlloader_data;
+/* Enumerate the symbolic error names. */
+enum {
+#define LT_ERROR(name, diagnostic) LT_CONC(LT_ERROR_, name),
+ lt_dlerror_table
+#undef LT_ERROR
+
+ LT_ERROR_MAX
};
-extern lt_dlloader_t *lt_dlloader_next LTDL_PARAMS((lt_dlloader_t *place));
-extern lt_dlloader_t *lt_dlloader_find LTDL_PARAMS((const char *loader_name));
-extern const char *lt_dlloader_name LTDL_PARAMS((lt_dlloader_t *place));
-extern lt_dlloader_data_t *lt_dlloader_data LTDL_PARAMS((lt_dlloader_t *place));
-extern lt_dlloader_t *lt_find_dlloader LTDL_PARAMS((const char *loader_name));
-extern int lt_dlloader_add LTDL_PARAMS((lt_dlloader_t *place, const struct lt_user_dlloader *dlloader, const char *loader_name));
-extern int lt_dlloader_remove LTDL_PARAMS((const char *loader_name));
+/* These functions are only useful from inside custom module loaders. */
+extern int lt_dladderror LT_PARAMS((const char *diagnostic));
+extern int lt_dlseterror LT_PARAMS((int errorcode));
+
-/* Integrated lt_dlerror() messages for user loaders. */
-extern int lt_dladderror LTDL_PARAMS((const char *diagnostic));
-extern int lt_dlseterror LTDL_PARAMS((int errorcode));
-/* Pointers to memory management functions to be used by libltdl. */
-LTDL_SCOPE lt_ptr_t (*lt_dlmalloc)LTDL_PARAMS((size_t size));
-LTDL_SCOPE void (*lt_dlfree)LTDL_PARAMS((lt_ptr_t ptr));
+
+/* --- SOURCE COMPATIBILITY WITH OLD LIBLTDL --- */
+
+
+#ifdef LT_NON_POSIX_NAMESPACE
+# define lt_ptr_t lt_ptr
+# define lt_module_t lt_module
+# define lt_module_open_t lt_module_open
+# define lt_module_close_t lt_module_close
+# define lt_find_sym_t lt_find_sym
+# define lt_dlloader_exit_t lt_dlloader_exit
+# define lt_dlloader_t lt_dlloader
+# define lt_dlloader_data_t lt_user_data
+#endif
-__END_DECLS
+LT_END_C_DECLS
-#endif /* !_LTDL_H_ */
+#endif /* !LTDL_H */
diff --git a/libjava/libltdl/ltmain.sh b/libjava/libltdl/ltmain.sh
new file mode 100644
index 00000000000..036c65e519b
--- /dev/null
+++ b/libjava/libltdl/ltmain.sh
@@ -0,0 +1,6322 @@
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun configure.
+#
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003
+# 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
+# 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.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+elif test "X$1" = X--fallback-echo; then
+ # Avoid inline document here, it may be left over
+ :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+ # Yippee, $echo works!
+ :
+else
+ # Restart under the correct shell, and then maybe $echo will work.
+ exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+ # used as fallback echo
+ shift
+ cat <<EOF
+$*
+EOF
+ exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | ${SED} 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.5.0a
+TIMESTAMP=" (1.1220.2.25 2003/08/01 19:08:35) Debian$Rev: 49 $"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+# test EBCDIC or ASCII
+case `echo A|tr A '\301'` in
+ A) # EBCDIC based system
+ SP2NL="tr '\100' '\n'"
+ NL2SP="tr '\r\n' '\100\100'"
+ ;;
+ *) # Assume ASCII based system
+ SP2NL="tr '\040' '\012'"
+ NL2SP="tr '\015\012' '\040\040'"
+ ;;
+esac
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+# Make sure IFS has a sensible default
+: ${IFS="
+"}
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ $echo "$modename: not configured to build any kind of library" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+#####################################
+# Shell function definitions:
+# This seems to be the best place for them
+
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+win32_libid () {
+ win32_libid_type="unknown"
+ win32_fileres=`file -L $1 2>/dev/null`
+ case $win32_fileres in
+ *ar\ archive\ import\ library*) # definitely import
+ win32_libid_type="x86 archive import"
+ ;;
+ *ar\ archive*) # could be an import, or static
+ if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | \
+ grep -E 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then
+ win32_nmres=`eval $NM -f posix -A $1 | \
+ sed -n -e '1,100{/ I /{x;/import/!{s/^/import/;h;p;};x;};}'`
+ if test "X$win32_nmres" = "Ximport" ; then
+ win32_libid_type="x86 archive import"
+ else
+ win32_libid_type="x86 archive static"
+ fi
+ fi
+ ;;
+ *DLL*)
+ win32_libid_type="x86 DLL"
+ ;;
+ *executable*) # but shell scripts are "executable" too...
+ case $win32_fileres in
+ *MS\ Windows\ PE\ Intel*)
+ win32_libid_type="x86 DLL"
+ ;;
+ esac
+ ;;
+ esac
+ $echo $win32_libid_type
+}
+
+# End of Shell function definitions
+#####################################
+
+# Parse our command line options once, thoroughly.
+while test "$#" -gt 0
+do
+ arg="$1"
+ shift
+
+ 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
+ execute_dlfiles)
+ execute_dlfiles="$execute_dlfiles $arg"
+ ;;
+ tag)
+ tagname="$arg"
+
+ # Check whether tagname contains only valid characters
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ $echo "$progname: invalid tag name: $tagname" 1>&2
+ exit 1
+ ;;
+ esac
+
+ 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"
+ ;;
+ esac
+
+ prev=
+ prevopt=
+ continue
+ fi
+
+ # Have we seen a non-optional argument yet?
+ case $arg in
+ --help)
+ show_help=yes
+ ;;
+
+ --version)
+ $echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+ $echo
+ $echo "Copyright (C) 2003 Free Software Foundation, Inc."
+ $echo "This is free software; see the source for copying conditions. There is NO"
+ $echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+ exit 0
+ ;;
+
+ --config)
+ ${SED} -e '1,/^# ### BEGIN LIBTOOL CONFIG/d' -e '/^# ### END LIBTOOL CONFIG/,$d' $0
+ # Now print the configurations for the tags.
+ for tagname in $taglist; do
+ ${SED} -n -e "/^# ### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^# ### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+ done
+ exit 0
+ ;;
+
+ --debug)
+ $echo "$progname: enabling shell trace mode"
+ set -x
+ ;;
+
+ --dry-run | -n)
+ run=:
+ ;;
+
+ --features)
+ $echo "host: $host"
+ if test "$build_libtool_libs" = yes; then
+ $echo "enable shared libraries"
+ else
+ $echo "disable shared libraries"
+ fi
+ if test "$build_old_libs" = yes; then
+ $echo "enable static libraries"
+ else
+ $echo "disable static libraries"
+ fi
+ exit 0
+ ;;
+
+ --finish) mode="finish" ;;
+
+ --mode) prevopt="--mode" prev=mode ;;
+ --mode=*) mode="$optarg" ;;
+
+ --preserve-dup-deps) duplicate_deps="yes" ;;
+
+ --quiet | --silent)
+ show=:
+ ;;
+
+ --tag) prevopt="--tag" prev=tag ;;
+ --tag=*)
+ set tag "$optarg" ${1+"$@"}
+ shift
+ prev=tag
+ ;;
+
+ -dlopen)
+ prevopt="-dlopen"
+ prev=execute_dlfiles
+ ;;
+
+ -*)
+ $echo "$modename: unrecognized option \`$arg'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+
+ *)
+ nonopt="$arg"
+ break
+ ;;
+ esac
+done
+
+if test -n "$prevopt"; then
+ $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+ $echo "$help" 1>&2
+ 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
+ $echo "*** Warning: inferring the mode of operation is deprecated." 1>&2
+ $echo "*** Future versions of Libtool will require -mode=MODE be specified." 1>&2
+ case $nonopt in
+ *cc | cc* | *++ | gcc* | *-gcc* | g++* | xlc*)
+ mode=link
+ for arg
+ do
+ case $arg in
+ -c)
+ mode=compile
+ break
+ ;;
+ esac
+ done
+ ;;
+ *db | *dbx | *strace | *truss)
+ mode=execute
+ ;;
+ *install*|cp|mv)
+ mode=install
+ ;;
+ *rm)
+ mode=uninstall
+ ;;
+ *)
+ # If we have no mode, but dlfiles were specified, then do execute mode.
+ test -n "$execute_dlfiles" && mode=execute
+
+ # Just use the default operation mode.
+ if test -z "$mode"; then
+ if test -n "$nonopt"; then
+ $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+ else
+ $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+ fi
+ fi
+ ;;
+ esac
+ fi
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$execute_dlfiles" && test "$mode" != execute; then
+ $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ 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
+ # libtool compile mode
+ compile)
+ modename="$modename: compile"
+ # Get the compilation command and the source file.
+ base_compile=
+ srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ suppress_output=
+ arg_mode=normal
+ libobj=
+
+ for arg
+ do
+ case "$arg_mode" in
+ arg )
+ # do not "continue". Instead, add this to base_compile
+ lastarg="$arg"
+ arg_mode=normal
+ ;;
+
+ target )
+ libobj="$arg"
+ arg_mode=normal
+ continue
+ ;;
+
+ normal )
+ # Accept any command-line options.
+ case $arg in
+ -o)
+ if test -n "$libobj" ; then
+ $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+ exit 1
+ fi
+ arg_mode=target
+ continue
+ ;;
+
+ -static)
+ build_old_libs=yes
+ continue
+ ;;
+
+ -prefer-pic)
+ pic_mode=yes
+ continue
+ ;;
+
+ -prefer-non-pic)
+ pic_mode=no
+ continue
+ ;;
+
+ -Xcompiler)
+ arg_mode=arg # the next one goes into the "base_compile" arg list
+ continue # The current "srcfile" will either be retained or
+ ;; # replaced later. I would guess that would be a bug.
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+ lastarg=
+ save_ifs="$IFS"; IFS=','
+ for arg in $args; do
+ IFS="$save_ifs"
+
+ # 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ lastarg="$lastarg $arg"
+ done
+ IFS="$save_ifs"
+ lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+ # Add the arguments to base_compile.
+ base_compile="$base_compile $lastarg"
+ continue
+ ;;
+
+ * )
+ # Accept the current argument as the source file.
+ # The previous "srcfile" becomes the current argument.
+ #
+ lastarg="$srcfile"
+ srcfile="$arg"
+ ;;
+ esac # case $arg
+ ;;
+ esac # case $arg_mode
+
+ # Aesthetically quote the previous argument.
+ lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+ case $lastarg in
+ # Double-quote args containing other shell metacharacters.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ lastarg="\"$lastarg\""
+ ;;
+ esac
+
+ base_compile="$base_compile $lastarg"
+ done # for arg
+
+ case $arg_mode in
+ arg)
+ $echo "$modename: you must specify an argument for -Xcompile"
+ exit 1
+ ;;
+ target)
+ $echo "$modename: you must specify a target with \`-o'" 1>&2
+ exit 1
+ ;;
+ *)
+ # Get the name of the library object.
+ [ -z "$libobj" ] && libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+ ;;
+ esac
+
+ # Recognize several different file suffixes.
+ # If the user specifies -o file.o, it is replaced with file.lo
+ xform='[cCFSifmso]'
+ case $libobj in
+ *.ada) xform=ada ;;
+ *.adb) xform=adb ;;
+ *.ads) xform=ads ;;
+ *.asm) xform=asm ;;
+ *.c++) xform=c++ ;;
+ *.cc) xform=cc ;;
+ *.ii) xform=ii ;;
+ *.class) xform=class ;;
+ *.cpp) xform=cpp ;;
+ *.cxx) xform=cxx ;;
+ *.f90) xform=f90 ;;
+ *.for) xform=for ;;
+ *.java) xform=java ;;
+ esac
+
+ libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+ case $libobj in
+ *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+ *)
+ $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base compile
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ " $CC "* | "$CC "* | " `$echo $CC` "* | "`$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case "$base_compile " in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in the base compile command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+ xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$xdir" = "X$obj"; then
+ xdir=
+ else
+ xdir=$xdir/
+ fi
+ lobj=${xdir}$objdir/$objname
+
+ if test -z "$base_compile"; then
+ $echo "$modename: you must specify a compilation command" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Delete any leftover library objects.
+ if test "$build_old_libs" = yes; then
+ removelist="$obj $lobj $libobj ${libobj}T"
+ else
+ removelist="$lobj $libobj ${libobj}T"
+ fi
+
+ $run $rm $removelist
+ 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
+ cygwin* | mingw* | pw32* | os2*)
+ pic_mode=default
+ ;;
+ esac
+ if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ # non-PIC code in shared libraries is not supported
+ pic_mode=default
+ fi
+
+ # Calculate the filename of the output object if compiler does
+ # not support -o with -c
+ if test "$compiler_c_o" = no; then
+ output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+ lockfile="$output_obj.lock"
+ removelist="$removelist $output_obj $lockfile"
+ trap "$run $rm $removelist; exit 1" 1 2 15
+ else
+ output_obj=
+ need_locks=no
+ lockfile=
+ fi
+
+ # Lock this critical section if it is needed
+ # We use this script file to make the link, it avoids creating a new file
+ if test "$need_locks" = yes; then
+ until $run ln "$0" "$lockfile" 2>/dev/null; do
+ $show "Waiting for $lockfile to be removed"
+ sleep 2
+ done
+ elif test "$need_locks" = warn; then
+ if test -f "$lockfile"; then
+ $echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+ $echo $srcfile > "$lockfile"
+ fi
+
+ if test -n "$fix_srcfile_path"; then
+ eval srcfile=\"$fix_srcfile_path\"
+ fi
+
+ $run $rm "$libobj" "${libobj}T"
+
+ # Create a libtool object file (analogous to a ".la" file),
+ # but don't create it if we're doing a dry run.
+ test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+ # Only build a PIC object if we are building libtool libraries.
+ if test "$build_libtool_libs" = yes; then
+ # Without this assignment, base_compile gets emptied.
+ fbsd_hideous_sh_bug=$base_compile
+
+ if test "$pic_mode" != no; then
+ command="$base_compile $srcfile $pic_flag"
+ else
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ fi
+
+ if test ! -d "${xdir}$objdir"; then
+ $show "$mkdir ${xdir}$objdir"
+ $run $mkdir ${xdir}$objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "${xdir}$objdir"; then
+ exit $status
+ fi
+ fi
+
+ if test -z "$output_obj"; then
+ # Place PIC objects in $objdir
+ command="$command -o $lobj"
+ fi
+
+ $run $rm "$lobj" "$output_obj"
+
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ test -n "$output_obj" && $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed, then go on to compile the next one
+ if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+ $show "$mv $output_obj $lobj"
+ if $run $mv $output_obj $lobj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the PIC object to the libtool object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+ # Allow error messages only from the first compilation.
+ suppress_output=' >/dev/null 2>&1'
+ else
+ # No PIC object so indicate it doesn't exist in the libtool
+ # object file.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+ fi
+
+ # Only build a position-dependent object if we build old libraries.
+ if test "$build_old_libs" = yes; then
+ if test "$pic_mode" != yes; then
+ # Don't build PIC code
+ command="$base_compile $srcfile"
+ else
+ command="$base_compile $srcfile $pic_flag"
+ fi
+ if test "$compiler_c_o" = yes; then
+ command="$command -o $obj"
+ fi
+
+ # Suppress compiler output if we already did a PIC compilation.
+ command="$command$suppress_output"
+ $run $rm "$obj" "$output_obj"
+ $show "$command"
+ if $run eval "$command"; then :
+ else
+ $run $rm $removelist
+ exit 1
+ fi
+
+ if test "$need_locks" = warn &&
+ test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+ $echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together. If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+ $run $rm $removelist
+ exit 1
+ fi
+
+ # Just move the object if needed
+ if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+ $show "$mv $output_obj $obj"
+ if $run $mv $output_obj $obj; then :
+ else
+ error=$?
+ $run $rm $removelist
+ exit $error
+ fi
+ fi
+
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+ else
+ # Append the name of the non-PIC object the libtool object file.
+ # Only append if the libtool object file exists.
+ test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+ fi
+
+ $run $mv "${libobj}T" "${libobj}"
+
+ # Unlock the critical section if it was locked
+ if test "$need_locks" != no; then
+ $run $rm "$lockfile"
+ fi
+
+ exit 0
+ ;;
+
+ # libtool link mode
+ link | relink)
+ modename="$modename: link"
+ 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
+ # which system we are compiling for in order to pass an extra
+ # flag for every libtool invocation.
+ # allow_undefined=no
+
+ # FIXME: Unfortunately, there are problems with the above when trying
+ # to make a dll which has undefined symbols, in which case not
+ # even a static library is built. For now, we need to specify
+ # -no-undefined on the libtool link line when we can be certain
+ # that all symbols are satisfied, otherwise we get a static library.
+ allow_undefined=yes
+ ;;
+ *)
+ allow_undefined=yes
+ ;;
+ esac
+ libtool_args="$nonopt"
+ base_compile="$nonopt"
+ compile_command="$nonopt"
+ finalize_command="$nonopt"
+
+ compile_rpath=
+ finalize_rpath=
+ compile_shlibpath=
+ finalize_shlibpath=
+ convenience=
+ old_convenience=
+ deplibs=
+ old_deplibs=
+ compiler_flags=
+ linker_flags=
+ dllsearchpath=
+ lib_search_path=`pwd`
+ inst_prefix_dir=
+
+ avoid_version=no
+ dlfiles=
+ dlprefiles=
+ dlself=no
+ export_dynamic=no
+ export_symbols=
+ export_symbols_regex=
+ generated=
+ libobjs=
+ ltlibs=
+ module=no
+ no_install=no
+ objs=
+ non_pic_objects=
+ prefer_static_libs=no
+ preload=no
+ prev=
+ prevarg=
+ release=
+ rpath=
+ xrpath=
+ perm_rpath=
+ temp_rpath=
+ thread_safe=no
+ vinfo=
+ vinfo_number=no
+
+ # We need to know -static, to get the right output filenames.
+ for arg
+ do
+ 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
+ $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+ fi
+ if test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ else
+ if test -z "$pic_flag" && test -n "$link_static_flag"; then
+ dlopen_self=$dlopen_self_static
+ fi
+ fi
+ build_libtool_libs=no
+ build_old_libs=yes
+ prefer_static_libs=yes
+ break
+ ;;
+ esac
+ done
+
+ # See if our shared archives depend on static archives.
+ test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+ # Go through the arguments, transforming them on the way.
+ while test "$#" -gt 0; do
+ arg="$1"
+ base_compile="$base_compile $arg"
+ shift
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+ ;;
+ *) qarg=$arg ;;
+ esac
+ libtool_args="$libtool_args $qarg"
+
+ # If the previous option needs an argument, assign it.
+ if test -n "$prev"; then
+ case $prev in
+ output)
+ compile_command="$compile_command @OUTPUT@"
+ finalize_command="$finalize_command @OUTPUT@"
+ ;;
+ esac
+
+ case $prev in
+ dlfiles|dlprefiles)
+ if test "$preload" = no; then
+ # Add the symbol object into the linking commands.
+ compile_command="$compile_command @SYMFILE@"
+ finalize_command="$finalize_command @SYMFILE@"
+ preload=yes
+ fi
+ case $arg in
+ *.la | *.lo) ;; # We handle these cases below.
+ force)
+ if test "$dlself" = no; then
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ self)
+ if test "$prev" = dlprefiles; then
+ dlself=yes
+ elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ dlself=yes
+ else
+ dlself=needless
+ export_dynamic=yes
+ fi
+ prev=
+ continue
+ ;;
+ *)
+ if test "$prev" = dlfiles; then
+ dlfiles="$dlfiles $arg"
+ else
+ dlprefiles="$dlprefiles $arg"
+ fi
+ prev=
+ continue
+ ;;
+ esac
+ ;;
+ expsyms)
+ export_symbols="$arg"
+ if test ! -f "$arg"; then
+ $echo "$modename: symbol file \`$arg' does not exist"
+ exit 1
+ fi
+ prev=
+ continue
+ ;;
+ expsyms_regex)
+ export_symbols_regex="$arg"
+ prev=
+ continue
+ ;;
+ inst_prefix)
+ inst_prefix_dir="$arg"
+ prev=
+ continue
+ ;;
+ release)
+ release="-$arg"
+ 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 | grep "^# 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
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ if test "$prev" = rpath; then
+ case "$rpath " in
+ *" $arg "*) ;;
+ *) rpath="$rpath $arg" ;;
+ esac
+ else
+ case "$xrpath " in
+ *" $arg "*) ;;
+ *) xrpath="$xrpath $arg" ;;
+ esac
+ fi
+ prev=
+ continue
+ ;;
+ xcompiler)
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ xlinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $wl$qarg"
+ prev=
+ compile_command="$compile_command $wl$qarg"
+ finalize_command="$finalize_command $wl$qarg"
+ continue
+ ;;
+ xcclinker)
+ linker_flags="$linker_flags $qarg"
+ compiler_flags="$compiler_flags $qarg"
+ prev=
+ compile_command="$compile_command $qarg"
+ finalize_command="$finalize_command $qarg"
+ continue
+ ;;
+ *)
+ eval "$prev=\"\$arg\""
+ prev=
+ continue
+ ;;
+ esac
+ fi # test -n "$prev"
+
+ prevarg="$arg"
+
+ case $arg in
+ -all-static)
+ if test -n "$link_static_flag"; then
+ compile_command="$compile_command $link_static_flag"
+ finalize_command="$finalize_command $link_static_flag"
+ fi
+ continue
+ ;;
+
+ -allow-undefined)
+ # FIXME: remove this flag sometime in the future.
+ $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+ continue
+ ;;
+
+ -avoid-version)
+ avoid_version=yes
+ continue
+ ;;
+
+ -dlopen)
+ prev=dlfiles
+ continue
+ ;;
+
+ -dlpreopen)
+ prev=dlprefiles
+ continue
+ ;;
+
+ -export-dynamic)
+ export_dynamic=yes
+ continue
+ ;;
+
+ -export-symbols | -export-symbols-regex)
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: more than one -exported-symbols argument is not allowed"
+ exit 1
+ fi
+ if test "X$arg" = "X-export-symbols"; then
+ prev=expsyms
+ else
+ prev=expsyms_regex
+ fi
+ continue
+ ;;
+
+ -inst-prefix-dir)
+ prev=inst_prefix
+ continue
+ ;;
+
+ # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+ # so, if we see these flags be careful not to treat them like -L
+ -L[A-Z][A-Z]*:*)
+ case $with_gcc/$host in
+ no/*-*-irix* | /*-*-irix*)
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ ;;
+ esac
+ continue
+ ;;
+
+ -L*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+ exit 1
+ fi
+ dir="$absdir"
+ ;;
+ esac
+ case "$deplibs " in
+ *" -L$dir "*) ;;
+ *)
+ deplibs="$deplibs -L$dir"
+ lib_search_path="$lib_search_path $dir"
+ ;;
+ esac
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$dir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$dir";;
+ esac
+ ;;
+ esac
+ continue
+ ;;
+
+ -l*)
+ if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ case $host in
+ *-*-cygwin* | *-*-pw32* | *-*-beos*)
+ # 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
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *-*-rhapsody* | *-*-darwin1.[012])
+ # Rhapsody C and math libraries are in the System framework
+ deplibs="$deplibs -framework System"
+ continue
+ esac
+ elif test "X$arg" = "X-lc_r"; then
+ case $host in
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc_r directly, use -pthread flag.
+ continue
+ ;;
+ esac
+ fi
+ deplibs="$deplibs $arg"
+ continue
+ ;;
+
+ -module)
+ module=yes
+ continue
+ ;;
+
+ # gcc -m* arguments should be passed to the linker via $compiler_flags
+ # in order to pass architecture information to the linker
+ # (e.g. 32 vs 64-bit). This may also be accomplished via -Wl,-mfoo
+ # but this is not reliable with gcc because gcc may use -mfoo to
+ # select a different linker, different libraries, etc, while
+ # -Wl,-mfoo simply passes -mfoo to the linker.
+ -m*)
+ # 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ compile_command="$compile_command $arg"
+ finalize_command="$finalize_command $arg"
+ if test "$with_gcc" = "yes" ; then
+ compiler_flags="$compiler_flags $arg"
+ fi
+ continue
+ ;;
+
+ -shrext)
+ prev=shrext
+ continue
+ ;;
+
+ -no-fast-install)
+ fast_install=no
+ continue
+ ;;
+
+ -no-install)
+ 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.
+ $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+ $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+ fast_install=no
+ ;;
+ *) no_install=yes ;;
+ esac
+ continue
+ ;;
+
+ -no-undefined)
+ allow_undefined=no
+ continue
+ ;;
+
+ -objectlist)
+ prev=objectlist
+ continue
+ ;;
+
+ -o) prev=output ;;
+
+ -release)
+ prev=release
+ continue
+ ;;
+
+ -rpath)
+ prev=rpath
+ continue
+ ;;
+
+ -R)
+ prev=xrpath
+ continue
+ ;;
+
+ -R*)
+ dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+ # We need an absolute path.
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ $echo "$modename: only absolute run-paths are allowed" 1>&2
+ exit 1
+ ;;
+ esac
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ continue
+ ;;
+
+ -static)
+ # 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
+ # Digital Unix and AIX.
+ continue
+ ;;
+
+ -thread-safe)
+ thread_safe=yes
+ continue
+ ;;
+
+ -version-info)
+ prev=vinfo
+ continue
+ ;;
+ -version-number)
+ prev=vinfo
+ vinfo_number=yes
+ continue
+ ;;
+
+ -Wc,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Wl,*)
+ args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+ arg=
+ save_ifs="$IFS"; IFS=','
+ for flag in $args; do
+ IFS="$save_ifs"
+ case $flag in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ flag="\"$flag\""
+ ;;
+ esac
+ arg="$arg $wl$flag"
+ compiler_flags="$compiler_flags $wl$flag"
+ linker_flags="$linker_flags $flag"
+ done
+ IFS="$save_ifs"
+ arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+ ;;
+
+ -Xcompiler)
+ prev=xcompiler
+ continue
+ ;;
+
+ -Xlinker)
+ prev=xlinker
+ continue
+ ;;
+
+ -XCClinker)
+ prev=xcclinker
+ continue
+ ;;
+
+ # Some other compiler flag.
+ -* | +*)
+ # 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ esac
+ ;;
+
+ *.$objext)
+ # A standard object.
+ objs="$objs $arg"
+ ;;
+
+ *.lo)
+ # A libtool-controlled object.
+
+ # Check to see that this really is a libtool object.
+ if (${SED} -e '2q' $arg | grep "^# 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
+ ;;
+
+ *.$libext)
+ # An archive.
+ deplibs="$deplibs $arg"
+ old_deplibs="$old_deplibs $arg"
+ continue
+ ;;
+
+ *.la)
+ # A libtool-controlled library.
+
+ if test "$prev" = dlfiles; then
+ # This library was specified with -dlopen.
+ dlfiles="$dlfiles $arg"
+ prev=
+ elif test "$prev" = dlprefiles; then
+ # The library was specified with -dlpreopen.
+ dlprefiles="$dlprefiles $arg"
+ prev=
+ else
+ deplibs="$deplibs $arg"
+ fi
+ continue
+ ;;
+
+ # Some other compiler argument.
+ *)
+ # 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ arg="\"$arg\""
+ ;;
+ 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 # argument parsing loop
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Infer tagged configuration to use if any are available and
+ # if one wasn't chosen via the "--tag" command line option.
+ # Only attempt this if the compiler in the base link
+ # command doesn't match the default compiler.
+ if test -n "$available_tags" && test -z "$tagname"; then
+ case $base_compile in
+ # Blanks in the command may have been stripped by the calling shell,
+ # but not from the CC environment variable when configure was run.
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*) ;;
+ # Blanks at the start of $base_compile will cause this to fail
+ # if we don't check for them as well.
+ *)
+ for z in $available_tags; do
+ if grep "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+ # Evaluate the configuration.
+ eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+ case $base_compile in
+ "$CC "* | " $CC "* | "`$echo $CC` "* | " `$echo $CC` "*)
+ # The compiler in $compile_command matches
+ # the one in the tagged configuration.
+ # Assume this is the tagged configuration we want.
+ tagname=$z
+ break
+ ;;
+ esac
+ fi
+ done
+ # If $tagname still isn't set, then no tagged configuration
+ # was found and let the user know that the "--tag" command
+ # line option must be used.
+ if test -z "$tagname"; then
+ $echo "$modename: unable to infer tagged configuration"
+ $echo "$modename: specify a tag with \`--tag'" 1>&2
+ exit 1
+# else
+# $echo "$modename: using $tagname tagged configuration"
+ fi
+ ;;
+ esac
+ fi
+
+ if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ eval arg=\"$export_dynamic_flag_spec\"
+ compile_command="$compile_command $arg"
+ 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"
+
+ if test -n "$shlibpath_var"; then
+ # get the directories listed in $shlibpath_var
+ eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+ else
+ shlib_search_path=
+ fi
+ eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+ eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+ output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$output_objdir" = "X$output"; then
+ output_objdir="$objdir"
+ else
+ output_objdir="$output_objdir/$objdir"
+ fi
+ # Create the object directory.
+ if test ! -d "$output_objdir"; then
+ $show "$mkdir $output_objdir"
+ $run $mkdir $output_objdir
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$output_objdir"; then
+ exit $status
+ fi
+ fi
+
+ # Determine the type of output
+ case $output in
+ "")
+ $echo "$modename: you must specify an output file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ *.$libext) linkmode=oldlib ;;
+ *.lo | *.$objext) linkmode=obj ;;
+ *.la) linkmode=lib ;;
+ *) linkmode=prog ;; # Anything else should be a program.
+ esac
+
+ case $host in
+ *cygwin* | *mingw* | *pw32*)
+ # don't eliminate duplcations in $postdeps and $predeps
+ duplicate_compiler_generated_deps=yes
+ ;;
+ *)
+ duplicate_compiler_generated_deps=$duplicate_deps
+ ;;
+ esac
+ specialdeplibs=
+
+ libs=
+ # Find all interdependent deplibs by searching for libraries
+ # that are linked more than once (e.g. -la -lb -la)
+ for deplib in $deplibs; do
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ libs="$libs $deplib"
+ done
+
+ 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=
+ if test "X$duplicate_compiler_generated_deps" = "Xyes" ; then
+ 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
+ fi
+ pre_post_deps=
+ fi
+
+ deplibs=
+ newdependency_libs=
+ newlib_search_path=
+ need_relink=no # whether we're linking any 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
+ *.la) ;;
+ *)
+ $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ prog)
+ compile_deplibs=
+ finalize_deplibs=
+ alldeplibs=no
+ newdlfiles=
+ newdlprefiles=
+ passes="conv scan dlopen dlpreopen link"
+ ;;
+ *) 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
+ case $pass in
+ dlopen) libs="$dlfiles" ;;
+ 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
+ -l*)
+ if test "$linkmode" != lib && test "$linkmode" != prog; then
+ $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+ continue
+ fi
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+ for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+ for search_ext in .la $shrext .so .a; do
+ # Search the libtool library
+ lib="$searchdir/lib${name}${search_ext}"
+ if test -f "$lib"; then
+ if test "$search_ext" = ".la"; then
+ found=yes
+ else
+ found=no
+ fi
+ break 2
+ fi
+ done
+ 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"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ else # deplib is a libtool library
+ # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+ # We need to do some special things here, and not later.
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $deplib "*)
+ if (${SED} -e '2q' $lib |
+ grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ library_names=
+ old_library=
+ case $lib in
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ for l in $old_library $library_names; do
+ ll="$l"
+ done
+ if test "X$ll" = "X$old_library" ; then # only static version available
+ found=no
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+ lib=$ladir/$old_library
+ if test "$linkmode,$pass" = "prog,link"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
+ fi
+ fi
+ ;;
+ *) ;;
+ esac
+ fi
+ fi
+ ;; # -l
+ -L*)
+ case $linkmode in
+ lib)
+ deplibs="$deplib $deplibs"
+ test "$pass" = conv && continue
+ newdependency_libs="$deplib $newdependency_libs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ ;;
+ prog)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ if test "$pass" = scan; then
+ deplibs="$deplib $deplibs"
+ newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ ;;
+ *)
+ $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+ ;;
+ esac # linkmode
+ continue
+ ;; # -L
+ -R*)
+ if test "$pass" = link; then
+ dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+ # Make sure the xrpath contains only unique directories.
+ case "$xrpath " in
+ *" $dir "*) ;;
+ *) xrpath="$xrpath $dir" ;;
+ esac
+ fi
+ deplibs="$deplib $deplibs"
+ continue
+ ;;
+ *.la) lib="$deplib" ;;
+ *.$libext)
+ if test "$pass" = conv; then
+ deplibs="$deplib $deplibs"
+ continue
+ fi
+ case $linkmode in
+ lib)
+ if test "$deplibs_check_method" != pass_all; then
+ $echo
+ $echo "*** Warning: Trying to link with static lib archive $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"
+ $echo "*** because the file extensions .$libext of this argument makes me believe"
+ $echo "*** that it is just a static archive that I should not used here."
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the"
+ $echo "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ fi
+ continue
+ ;;
+ prog)
+ if test "$pass" != link; then
+ deplibs="$deplib $deplibs"
+ else
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ fi
+ continue
+ ;;
+ 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
+ fi
+ continue
+ ;;
+ %DEPLIBS%)
+ alldeplibs=yes
+ continue
+ ;;
+ esac # case $deplib
+ if test "$found" = yes || test -f "$lib"; then :
+ else
+ $echo "$modename: cannot find the library \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $lib | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+
+ ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$ladir" = "X$lib" && ladir="."
+
+ dlname=
+ dlopen=
+ dlpreopen=
+ libdir=
+ library_names=
+ old_library=
+ # If the library was installed with an old release of libtool,
+ # it will not redefine variables installed, or shouldnotlink
+ installed=yes
+ shouldnotlink=no
+
+ # Read the .la file
+ 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 -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+ test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ fi
+
+ if test "$pass" = conv; then
+ # Only check for convenience libraries
+ deplibs="$lib $deplibs"
+ if test -z "$libdir"; then
+ if test -z "$old_library"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+ # It is a libtool convenience library, so add in its objects.
+ convenience="$convenience $ladir/$objdir/$old_library"
+ old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ deplibs="$deplib $deplibs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+ elif test "$linkmode" != prog && test "$linkmode" != lib; then
+ $echo "$modename: \`$lib' is not a convenience library" 1>&2
+ exit 1
+ fi
+ continue
+ fi # $pass = conv
+
+
+ # Get the name of the library we link against.
+ linklib=
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ if test -z "$linklib"; then
+ $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+ exit 1
+ fi
+
+ # This library was specified with -dlopen.
+ if test "$pass" = dlopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+ 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. We also need to preload any
+ # dependent libraries so libltdl's deplib preloader doesn't
+ # bomb out in the load deplibs phase.
+ dlprefiles="$dlprefiles $lib $dependency_libs"
+ else
+ newdlfiles="$newdlfiles $lib"
+ fi
+ continue
+ fi # $pass = dlopen
+
+ # We need an absolute path.
+ case $ladir in
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ *)
+ abs_ladir=`cd "$ladir" && pwd`
+ if test -z "$abs_ladir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+ $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+ abs_ladir="$ladir"
+ fi
+ ;;
+ esac
+ laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+ # Find the relevant object directory and library name.
+ if test "X$installed" = Xyes; then
+ if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ $echo "$modename: warning: library \`$lib' was moved." 1>&2
+ dir="$ladir"
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+ dir="$libdir"
+ absdir="$libdir"
+ fi
+ else
+ dir="$ladir/$objdir"
+ absdir="$abs_ladir/$objdir"
+ # Remove this search path later
+ 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.
+ if test "$pass" = dlpreopen; then
+ if test -z "$libdir"; then
+ $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+ exit 1
+ fi
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ newdlprefiles="$newdlprefiles $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ newdlprefiles="$newdlprefiles $dir/$dlname"
+ else
+ newdlprefiles="$newdlprefiles $dir/$linklib"
+ fi
+ fi # $pass = dlpreopen
+
+ if test -z "$libdir"; then
+ # 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
+ fi
+ continue
+ fi
+
+
+ if test "$linkmode" = prog && test "$pass" != link; then
+ newlib_search_path="$newlib_search_path $ladir"
+ deplibs="$lib $deplibs"
+
+ linkalldeplibs=no
+ if test "$link_all_deplibs" != no || test -z "$library_names" ||
+ test "$build_libtool_libs" = no; then
+ linkalldeplibs=yes
+ fi
+
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ 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?
+ if test "$linkalldeplibs" = yes; then
+ deplibs="$deplib $deplibs"
+ else
+ # Need to hardcode shared library paths
+ # or/and link against static libraries
+ newdependency_libs="$deplib $newdependency_libs"
+ fi
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done # for deplib
+ continue
+ 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
+
+ # 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 # $linkmode,$pass = prog,link...
+
+ 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
+ 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
+ notinst_deplibs="$notinst_deplibs $lib"
+ need_relink=yes
+ fi
+ # This is a shared library
+
+ # Warn about portability, can't link against -module's on some systems (darwin)
+ if test "$shouldnotlink" = yes && test "$pass" = link ; then
+ $echo
+ if test "$linkmode" = prog; then
+ $echo "*** Warning: Linking the executable $output against the loadable module"
+ else
+ $echo "*** Warning: Linking the shared library $output against the loadable module"
+ fi
+ $echo "*** $linklib is not portable!"
+ fi
+ 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
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+ libname=`eval \\$echo \"$libname_spec\"`
+ # 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* | mingw*)
+ 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
+ if test -f "$output_objdir/$soname-def"; then :
+ else
+ $show "extracting exported symbol list from \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$extract_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Create $newlib
+ if test -f "$output_objdir/$newlib"; then :; else
+ $show "generating import library for \`$soname'"
+ save_ifs="$IFS"; IFS='~'
+ eval cmds=\"$old_archive_from_expsyms_cmds\"
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+ # make sure the library variables are pointing to the new library
+ dir=$output_objdir
+ linklib=$newlib
+ 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
+ immediate | unsupported)
+ if test "$hardcode_direct" = no; then
+ add="$dir/$linklib"
+ case $host in
+ *-*-sco3.2v5* ) add_dir="-L$dir" ;;
+ *-*-darwin* )
+ # if the lib is a module then we can not link against it, someone
+ # is ignoring the new warnings I added
+ if /usr/bin/file -L $add 2> /dev/null | grep "bundle" >/dev/null ; then
+ $echo "** Warning, lib $linklib is a module, not a shared library"
+ if test -z "$old_library" ; then
+ $echo
+ $echo "** And there doesn't seem to be a static archive available"
+ $echo "** The link will probably fail, sorry"
+ else
+ add="$dir/$old_library"
+ fi
+ fi
+ esac
+ elif test "$hardcode_minus_L" = no; then
+ case $host in
+ *-*-sunos*) add_shlibpath="$dir" ;;
+ esac
+ add_dir="-L$dir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = no; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ relink)
+ if test "$hardcode_direct" = yes; then
+ add="$dir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$dir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ add_shlibpath="$dir"
+ add="-l$name"
+ else
+ lib_linked=no
+ fi
+ ;;
+ *) lib_linked=no ;;
+ esac
+
+ if test "$lib_linked" != yes; then
+ $echo "$modename: configuration error: unsupported hardcode properties"
+ exit 1
+ fi
+
+ if test -n "$add_shlibpath"; then
+ case :$compile_shlibpath: in
+ *":$add_shlibpath:"*) ;;
+ *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ esac
+ fi
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+ test -n "$add" && compile_deplibs="$add $compile_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ if test "$hardcode_direct" != yes && \
+ test "$hardcode_minus_L" != yes && \
+ test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ fi
+ fi
+ fi
+
+ if test "$linkmode" = prog || test "$mode" = relink; then
+ add_shlibpath=
+ add_dir=
+ add=
+ # Finalize command for both is simple: just hardcode it.
+ if test "$hardcode_direct" = yes; then
+ add="$libdir/$linklib"
+ elif test "$hardcode_minus_L" = yes; then
+ add_dir="-L$libdir"
+ add="-l$name"
+ elif test "$hardcode_shlibpath_var" = yes; then
+ case :$finalize_shlibpath: in
+ *":$libdir:"*) ;;
+ *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ esac
+ add="-l$name"
+ elif test "$hardcode_automatic" = yes; then
+ if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then
+ add="$inst_prefix_dir$libdir/$linklib"
+ else
+ add="$libdir/$linklib"
+ fi
+ else
+ # We cannot seem to hardcode it, guess we'll fake it.
+ add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case "$libdir" in
+ [\\/]*)
+ add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ ;;
+ esac
+ fi
+ add="-l$name"
+ fi
+
+ if test "$linkmode" = prog; then
+ test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+ test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+ else
+ test -n "$add_dir" && deplibs="$add_dir $deplibs"
+ test -n "$add" && deplibs="$add $deplibs"
+ fi
+ fi
+ elif test "$linkmode" = prog; then
+ # 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.
+ if test "$hardcode_direct" != unsupported; then
+ test -n "$old_library" && linklib="$old_library"
+ compile_deplibs="$dir/$linklib $compile_deplibs"
+ finalize_deplibs="$dir/$linklib $finalize_deplibs"
+ else
+ compile_deplibs="-l$name -L$dir $compile_deplibs"
+ finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+ fi
+ elif test "$build_libtool_libs" = yes; then
+ # Not a shared library
+ 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
+ $echo "*** Warning: This system can not link to static lib archive $lib."
+ $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 "*** But as you try to build a module library, libtool will still create "
+ $echo "*** a static module, that should work as long as the dlopening application"
+ $echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+ 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 # link shared/static library?
+
+ if test "$linkmode" = lib; then
+ if test -n "$dependency_libs" &&
+ { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes ||
+ test "$link_static" = yes; }; then
+ # Extract -R from dependency_libs
+ temp_deplibs=
+ for libdir in $dependency_libs; do
+ case $libdir in
+ -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+ case " $xrpath " in
+ *" $temp_xrpath "*) ;;
+ *) xrpath="$xrpath $temp_xrpath";;
+ esac;;
+ *) temp_deplibs="$temp_deplibs $libdir";;
+ esac
+ done
+ dependency_libs="$temp_deplibs"
+ fi
+
+ newlib_search_path="$newlib_search_path $absdir"
+ # Link against this library
+ test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ # ... and its dependency_libs
+ tmp_libs=
+ for deplib in $dependency_libs; do
+ newdependency_libs="$deplib $newdependency_libs"
+ if test "X$duplicate_deps" = "Xyes" ; then
+ case "$tmp_libs " in
+ *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ esac
+ fi
+ tmp_libs="$tmp_libs $deplib"
+ done
+
+ if test "$link_all_deplibs" != no; then
+ # Add the search paths of all dependency libraries
+ for deplib in $dependency_libs; do
+ 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
+ [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ *)
+ absdir=`cd "$dir" && pwd`
+ if test -z "$absdir"; then
+ $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+ absdir="$dir"
+ fi
+ ;;
+ esac
+ if grep "^installed=no" $deplib > /dev/null; then
+ path="$absdir/$objdir"
+ else
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ if test "$absdir" != "$libdir"; then
+ $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+ fi
+ path="$absdir"
+ fi
+ depdepl=
+ case $host in
+ *-*-darwin*)
+ # we do not want to link against static libs, but need to link against shared
+ eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names" ; then
+ for tmp in $deplibrary_names ; do
+ depdepl=$tmp
+ done
+ if test -f "$path/$depdepl" ; then
+ depdepl="$path/$depdepl"
+ fi
+ # do not add paths which are already there
+ case " $newlib_search_path " in
+ *" $path "*) ;;
+ *) newlib_search_path="$newlib_search_path $path";;
+ esac
+ path=""
+ fi
+ ;;
+ *)
+ path="-L$path"
+ ;;
+ esac
+
+ ;;
+ -l*)
+ case $host in
+ *-*-darwin*)
+ # Again, we only want to link against shared libraries
+ eval tmp_libs=`$echo "X$deplib" | $Xsed -e "s,^\-l,,"`
+ for tmp in $newlib_search_path ; do
+ if test -f "$tmp/lib$tmp_libs.dylib" ; then
+ eval depdepl="$tmp/lib$tmp_libs.dylib"
+ break
+ fi
+ done
+ path=""
+ ;;
+ *) continue ;;
+ esac
+ ;;
+ *) continue ;;
+ esac
+ case " $deplibs " in
+ *" $depdepl "*) ;;
+ *) deplibs="$deplibs $depdepl" ;;
+ esac
+ case " $deplibs " in
+ *" $path "*) ;;
+ *) deplibs="$deplibs $path" ;;
+ esac
+ done
+ fi # link_all_deplibs != no
+ fi # linkmode = lib
+ done # for deplib in $libs
+ dependency_libs="$newdependency_libs"
+ if test "$pass" = dlpreopen; then
+ # Link the dlpreopened libraries before other libraries
+ for deplib in $save_deplibs; do
+ deplibs="$deplib $deplibs"
+ done
+ fi
+ if test "$pass" != dlopen; then
+ if test "$pass" != conv; then
+ # Make sure lib_search_path contains only unique directories.
+ lib_search_path=
+ for dir in $newlib_search_path; do
+ case "$lib_search_path " in
+ *" $dir "*) ;;
+ *) lib_search_path="$lib_search_path $dir" ;;
+ esac
+ done
+ newlib_search_path=
+ fi
+
+ if test "$linkmode,$pass" != "prog,link"; then
+ vars="deplibs"
+ else
+ vars="compile_deplibs finalize_deplibs"
+ fi
+ for var in $vars dependency_libs; do
+ # Add libraries to $var in reverse order
+ eval tmp_libs=\"\$$var\"
+ new_libs=
+ for deplib in $tmp_libs; do
+ # FIXME: Pedantically, this is the right thing to do, so
+ # that some nasty dependency loop isn't accidentally
+ # broken:
+ #new_libs="$deplib $new_libs"
+ # Pragmatically, this seems to cause very few problems in
+ # practice:
+ case $deplib in
+ -L*) new_libs="$deplib $new_libs" ;;
+ -R*) ;;
+ *)
+ # And here is the reason: when a library appears more
+ # than once as an explicit dependence of a library, or
+ # is implicitly linked in more than once by the
+ # compiler, it is considered special, and multiple
+ # occurrences thereof are not removed. Compare this
+ # with having the same library being listed as a
+ # dependency of multiple other libraries: in this case,
+ # we know (pedantically, we assume) the library does not
+ # need to be listed more than once, so we keep only the
+ # last copy. This is not always right, but it is rare
+ # enough that we require users that really mean to play
+ # such unportable linking tricks to link the library
+ # using -Wl,-lname, so that libtool does not consider it
+ # for duplicate removal.
+ case " $specialdeplibs " in
+ *" $deplib "*) new_libs="$deplib $new_libs" ;;
+ *)
+ case " $new_libs " in
+ *" $deplib "*) ;;
+ *) new_libs="$deplib $new_libs" ;;
+ esac
+ ;;
+ esac
+ ;;
+ esac
+ done
+ tmp_libs=
+ for deplib in $new_libs; do
+ case $deplib in
+ -L*)
+ case " $tmp_libs " in
+ *" $deplib "*) ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ ;;
+ *) tmp_libs="$tmp_libs $deplib" ;;
+ esac
+ done
+ eval $var=\"$tmp_libs\"
+ done # for var
+ fi
+ # Last step: remove runtime libs from dependency_libs (they stay in deplibs)
+ tmp_libs=
+ for i in $dependency_libs ; do
+ case " $predeps $postdeps $compiler_lib_search_path " in
+ *" $i "*)
+ i=""
+ ;;
+ esac
+ if test -n "$i" ; then
+ tmp_libs="$tmp_libs $i"
+ fi
+ done
+ dependency_libs=$tmp_libs
+ done # for pass
+ if test "$linkmode" = prog; then
+ dlfiles="$newdlfiles"
+ dlprefiles="$newdlprefiles"
+ fi
+
+ 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
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+ fi
+
+ if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+ $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+ fi
+
+ # Now set the variables for building old libraries.
+ build_libtool_libs=no
+ oldlibs="$output"
+ objs="$objs$old_deplibs"
+ ;;
+
+ lib)
+ # Make sure we only generate libraries of the form `libNAME.la'.
+ case $outputname in
+ lib*)
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ ;;
+ *)
+ if test "$module" = no; then
+ $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ if test "$need_lib_prefix" != no; then
+ # Add the "lib" prefix for modules if required
+ name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
+ eval libname=\"$libname_spec\"
+ else
+ libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ fi
+ ;;
+ esac
+
+ if test -n "$objs"; then
+ if test "$deplibs_check_method" != pass_all; then
+ $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+ exit 1
+ else
+ $echo
+ $echo "*** Warning: Linking the shared library $output against the non-libtool"
+ $echo "*** objects $objs is not portable!"
+ libobjs="$libobjs $objs"
+ fi
+ fi
+
+ if test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+ fi
+
+ set dummy $rpath
+ if test "$#" -gt 2; then
+ $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+ fi
+ install_libdir="$2"
+
+ oldlibs=
+ if test -z "$rpath"; then
+ if test "$build_libtool_libs" = yes; then
+ # Building a libtool convenience library.
+ # Some compilers have problems with a `.al' extension so
+ # convenience libraries should have the same extension an
+ # archive normally would.
+ oldlibs="$output_objdir/$libname.$libext $oldlibs"
+ build_libtool_libs=convenience
+ build_old_libs=yes
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info/-version-number' is ignored for convenience libraries" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+ fi
+ else
+
+ # Parse the version information argument.
+ save_ifs="$IFS"; IFS=':'
+ set dummy $vinfo 0 0 0
+ IFS="$save_ifs"
+
+ if test -n "$8"; then
+ $echo "$modename: too many parameters to \`-version-info'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # convert absolute version numbers to libtool ages
+ # this retains compatibility with .la files and attempts
+ # to make the code below a bit more comprehensible
+
+ case $vinfo_number in
+ yes)
+ number_major="$2"
+ number_minor="$3"
+ number_revision="$4"
+ #
+ # There are really only two kinds -- those that
+ # use the current revision as the major version
+ # and those that subtract age and use age as
+ # a minor version. But, then there is irix
+ # which has an extra 1 added just for fun
+ #
+ case $version_type in
+ darwin|linux|osf|windows)
+ current=`expr $number_major + $number_minor`
+ age="$number_minor"
+ revision="$number_revision"
+ ;;
+ freebsd-aout|freebsd-elf|sunos)
+ current="$number_major"
+ revision="$number_minor"
+ age="0"
+ ;;
+ irix|nonstopux)
+ current=`expr $number_major + $number_minor - 1`
+ age="$number_minor"
+ revision="$number_minor"
+ ;;
+ esac
+ ;;
+ no)
+ current="$2"
+ revision="$3"
+ age="$4"
+ ;;
+ esac
+
+ # Check that each of the things are valid numbers.
+ 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
+ exit 1
+ ;;
+ esac
+
+ 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
+ exit 1
+ ;;
+ esac
+
+ 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
+ exit 1
+ ;;
+ esac
+
+ if test "$age" -gt "$current"; then
+ $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+ $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+ exit 1
+ fi
+
+ # Calculate the version variables.
+ major=
+ versuffix=
+ verstring=
+ 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 | nonstopux)
+ major=`expr $current - $age + 1`
+
+ case $version_type in
+ nonstopux) verstring_prefix=nonstopux ;;
+ *) verstring_prefix=sgi ;;
+ esac
+ verstring="$verstring_prefix$major.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$revision
+ while test "$loop" -ne 0; do
+ iface=`expr $revision - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring_prefix$major.$iface:$verstring"
+ done
+
+ # Before this point, $major must not contain `.'.
+ major=.$major
+ versuffix="$major.$revision"
+ ;;
+
+ linux)
+ major=.`expr $current - $age`
+ versuffix="$major.$age.$revision"
+ ;;
+
+ osf)
+ major=.`expr $current - $age`
+ versuffix=".$current.$age.$revision"
+ verstring="$current.$age.$revision"
+
+ # Add in all the interfaces that we are compatible with.
+ loop=$age
+ while test "$loop" -ne 0; do
+ iface=`expr $current - $loop`
+ loop=`expr $loop - 1`
+ verstring="$verstring:${iface}.0"
+ done
+
+ # Make executables depend on our current version.
+ verstring="$verstring:${current}.0"
+ ;;
+
+ sunos)
+ major=".$current"
+ versuffix=".$current.$revision"
+ ;;
+
+ windows)
+ # Use '-' rather than '.', since we only want one
+ # extension on DOS 8.3 filesystems.
+ major=`expr $current - $age`
+ versuffix="-$major"
+ ;;
+
+ *)
+ $echo "$modename: unknown library version type \`$version_type'" 1>&2
+ $echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Clear the version info if we defaulted, and they specified a release.
+ if test -z "$vinfo" && test -n "$release"; then
+ major=
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
+ if test "$need_version" = no; then
+ versuffix=
+ else
+ versuffix=".0.0"
+ fi
+ fi
+
+ # Remove version info from name if versioning should be avoided
+ if test "$avoid_version" = yes && test "$need_version" = no; then
+ major=
+ versuffix=
+ verstring=""
+ fi
+
+ # Check to see if the archive will have undefined symbols.
+ if test "$allow_undefined" = yes; then
+ if test "$allow_undefined_flag" = unsupported; then
+ $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+ build_libtool_libs=no
+ build_old_libs=yes
+ fi
+ else
+ # Don't allow undefined symbols.
+ allow_undefined_flag="$no_undefined_flag"
+ fi
+ fi
+
+ if test "$mode" != relink; then
+ # Remove our outputs, but don't remove object files since they
+ # may have been created when compiling PIC objects.
+ removelist=
+ tempremovelist=`$echo "$output_objdir/*"`
+ for p in $tempremovelist; do
+ case $p in
+ *.$objext)
+ ;;
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+ removelist="$removelist $p"
+ ;;
+ *) ;;
+ esac
+ done
+ if test -n "$removelist"; then
+ $show "${rm}r $removelist"
+ $run ${rm}r $removelist
+ fi
+ fi
+
+ # Now set the variables for building old libraries.
+ if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+ # Transform .lo files to .o files.
+ oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+ fi
+
+ # Eliminate all temporary directories.
+ 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'`
+ done
+
+ if test -n "$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ temp_xrpath=
+ for libdir in $xrpath; do
+ temp_xrpath="$temp_xrpath -R$libdir"
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ dependency_libs="$temp_xrpath $dependency_libs"
+ fi
+ fi
+
+ # Make sure dlfiles contains only unique files that won't be dlpreopened
+ old_dlfiles="$dlfiles"
+ dlfiles=
+ for lib in $old_dlfiles; do
+ case " $dlprefiles $dlfiles " in
+ *" $lib "*) ;;
+ *) dlfiles="$dlfiles $lib" ;;
+ esac
+ done
+
+ # Make sure dlprefiles contains only unique files
+ old_dlprefiles="$dlprefiles"
+ dlprefiles=
+ for lib in $old_dlprefiles; do
+ case "$dlprefiles " in
+ *" $lib "*) ;;
+ *) dlprefiles="$dlprefiles $lib" ;;
+ esac
+ done
+
+ if test "$build_libtool_libs" = yes; then
+ if test -n "$rpath"; then
+ 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.
+ ;;
+ *-*-openbsd* | *-*-freebsd*)
+ # Do not include libc due to us having libc/libc_r.
+ test "X$arg" = "X-lc" && continue
+ ;;
+ *)
+ # Add libc to deplibs on all other systems if necessary.
+ if test "$build_libtool_need_lc" = "yes"; then
+ deplibs="$deplibs -lc"
+ fi
+ ;;
+ esac
+ fi
+
+ # Transform deplibs into only deplibs that can be linked in shared.
+ name_save=$name
+ libname_save=$libname
+ release_save=$release
+ versuffix_save=$versuffix
+ major_save=$major
+ # I'm not sure if I'm treating the release correctly. I think
+ # release should show up in the -l (ie -lgmp5) so we don't want to
+ # add it in twice. Is that correct?
+ release=""
+ versuffix=""
+ major=""
+ newdeplibs=
+ droppeddeps=no
+ 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
+ # whether the library exists or not. But this is on
+ # osf3 & osf4 and I'm not really sure... Just
+ # implementing what was already the behavior.
+ newdeplibs=$deplibs
+ ;;
+ test_compile)
+ # This code stresses the "libraries are programs" paradigm to its
+ # limits. Maybe even breaks it. We compile a program, linking it
+ # against the deplibs as a proxy for the library. Then we can check
+ # whether they linked in statically or dynamically with ldd.
+ $rm conftest.c
+ cat > conftest.c <<EOF
+ int main() { return 0; }
+EOF
+ $rm conftest
+ $LTCC -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" -ne "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $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 I believe you do not have"
+ $echo "*** because a test_compile did reveal that the linker did not use it for"
+ $echo "*** its dynamic dependency list that programs get resolved with at runtime."
+ fi
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ else
+ # Error occurred in the first compile. Let's try to salvage
+ # the situation: Compile a separate program for each library.
+ for i in $deplibs; do
+ name="`expr $i : '-l\(.*\)'`"
+ # If $name is empty we are operating on a -L argument.
+ if test "$name" != "" && test "$name" != "0"; then
+ $rm conftest
+ $LTCC -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
+ ldd_output=`ldd conftest`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $i "*)
+ newdeplibs="$newdeplibs $i"
+ i=""
+ ;;
+ esac
+ fi
+ if test -n "$i" ; then
+ libname=`eval \\$echo \"$libname_spec\"`
+ deplib_matches=`eval \\$echo \"$library_names_spec\"`
+ set dummy $deplib_matches
+ deplib_match=$2
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ newdeplibs="$newdeplibs $i"
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: dynamic linker does not accept needed library $i."
+ $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"
+ $echo "*** because a test_compile did reveal that the linker did not use this one"
+ $echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+ fi
+ fi
+ else
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning! Library $i is needed by this library but I was not able to"
+ $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** library that it depends on before this library will be fully"
+ $echo "*** functional. Installing it before continuing would be even better."
+ fi
+ else
+ newdeplibs="$newdeplibs $i"
+ fi
+ done
+ fi
+ ;;
+ file_magic*)
+ set dummy $deplibs_check_method
+ file_magic_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 "$name" != "" && test "$name" != "0"; then
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; 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
+ # Follow soft links.
+ if ls -lLd "$potent_lib" 2>/dev/null \
+ | grep " -> " >/dev/null; then
+ continue
+ fi
+ # The statement above tries to avoid entering an
+ # endless loop below, in case of cyclic links.
+ # We might still enter an endless loop, since a link
+ # loop can be closed while we follow links,
+ # but so what?
+ potlib="$potent_lib"
+ while test -h "$potlib" 2>/dev/null; do
+ potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ case $potliblink in
+ [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+ *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+ esac
+ done
+ if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+ | ${SED} 10q \
+ | $EGREP "$file_magic_regex" > /dev/null; then
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ break 2
+ fi
+ done
+ done
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $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"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for file magic test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a file magic. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ 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
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ case " $predeps $postdeps " in
+ *" $a_deplib "*)
+ newdeplibs="$newdeplibs $a_deplib"
+ a_deplib=""
+ ;;
+ esac
+ fi
+ if test -n "$a_deplib" ; 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
+ potlib="$potent_lib" # see symlink-check above in file_magic test
+ 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
+ fi
+ if test -n "$a_deplib" ; then
+ droppeddeps=yes
+ $echo
+ $echo "*** Warning: linker path does not have real file for library $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"
+ $echo "*** because I did check the linker path looking for a file starting"
+ if test -z "$potlib" ; then
+ $echo "*** with $libname but no candidates were found. (...for regex pattern test)"
+ else
+ $echo "*** with $libname and none of the candidates passed a file format test"
+ $echo "*** using a regex pattern. Last file checked: $potlib"
+ fi
+ fi
+ else
+ # Add a -L argument.
+ newdeplibs="$newdeplibs $a_deplib"
+ fi
+ done # Gone through all deplibs.
+ ;;
+ none | unknown | *)
+ newdeplibs=""
+ tmp_deplibs=`$echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+ -e 's/ -[LR][^ ]*//g'`
+ if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ for i in $predeps $postdeps ; do
+ # can't use Xsed below, because $i might contain '/'
+ tmp_deplibs=`$echo "X $tmp_deplibs" | ${SED} -e "1s,^X,," -e "s,$i,,"`
+ done
+ fi
+ if $echo "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' \
+ | grep . >/dev/null; then
+ $echo
+ if test "X$deplibs_check_method" = "Xnone"; then
+ $echo "*** Warning: inter-library dependencies are not supported in this platform."
+ else
+ $echo "*** Warning: inter-library dependencies are not known to be supported."
+ fi
+ $echo "*** All declared inter-library dependencies are being dropped."
+ droppeddeps=yes
+ fi
+ ;;
+ esac
+ versuffix=$versuffix_save
+ major=$major_save
+ release=$release_save
+ 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
+ $echo "*** Warning: libtool could not satisfy all declared inter-library"
+ $echo "*** dependencies of module $libname. Therefore, libtool will create"
+ $echo "*** a static module, that should work as long as the dlopening"
+ $echo "*** 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
+ oldlibs="$output_objdir/$libname.$libext"
+ build_libtool_libs=module
+ build_old_libs=yes
+ else
+ build_libtool_libs=no
+ fi
+ else
+ $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!
+ deplibs=$newdeplibs
+ fi
+
+ # All the library-specific variables (install_libdir is set above).
+ library_names=
+ old_library=
+ dlname=
+
+ # Test again, we may have decided not to build it any more
+ if test "$build_libtool_libs" = yes; then
+ if test "$hardcode_into_libs" = yes; then
+ # Hardcode the library paths
+ hardcode_libdirs=
+ dep_rpath=
+ rpath="$finalize_rpath"
+ test "$mode" != relink && rpath="$compile_rpath$rpath"
+ for libdir in $rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ dep_rpath="$dep_rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ if test -n "$hardcode_libdir_flag_spec_ld"; then
+ eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+ else
+ eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+ fi
+ fi
+ if test -n "$runpath_var" && test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+ fi
+ test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+ fi
+
+ shlibpath="$finalize_shlibpath"
+ test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ if test -n "$shlibpath"; then
+ eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+ fi
+
+ # Get the real and link names of the library.
+ eval shared_ext=\"$shrext\"
+ eval library_names=\"$library_names_spec\"
+ set dummy $library_names
+ realname="$2"
+ shift; shift
+
+ if test -n "$soname_spec"; then
+ eval soname=\"$soname_spec\"
+ else
+ soname="$realname"
+ fi
+ if test -z "$dlname"; then
+ dlname=$soname
+ fi
+
+ lib="$output_objdir/$realname"
+ for link
+ do
+ linknames="$linknames $link"
+ done
+
+ # Use standard objects if they are pic
+ test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ eval cmds=\"$export_symbols_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ if len=`expr "X$cmd" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ skipped_export=false
+ else
+ # The command line is too long to execute in one step.
+ $show "using reloadable object file for export list..."
+ skipped_export=:
+ fi
+ done
+ IFS="$save_ifs"
+ if test -n "$export_symbols_regex"; then
+ $show "$EGREP -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+ $run eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+ $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+ $run eval '$mv "${export_symbols}T" "$export_symbols"'
+ fi
+ fi
+ fi
+
+ if test -n "$export_symbols" && test -n "$include_expsyms"; then
+ $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+ fi
+
+ tmp_deplibs=
+ for test_deplib in $deplibs; do
+ case " $convenience " in
+ *" $test_deplib "*) ;;
+ *)
+ tmp_deplibs="$tmp_deplibs $test_deplib"
+ ;;
+ esac
+ done
+ deplibs="$tmp_deplibs"
+
+ 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"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ eval flag=\"$thread_safe_flag_spec\"
+ linker_flags="$linker_flags $flag"
+ fi
+
+ # Make a backup of the uninstalled library when relinking
+ if test "$mode" = relink; then
+ $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+ fi
+
+ # Do each of the archive commands.
+ if test "$module" = yes && test -n "$module_cmds" ; then
+ if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+ eval cmds=\"$module_expsym_cmds\"
+ else
+ eval cmds=\"$module_cmds\"
+ fi
+ else
+ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+ eval cmds=\"$archive_expsym_cmds\"
+ else
+ eval cmds=\"$archive_cmds\"
+ fi
+ fi
+
+ if test "X$skipped_export" != "X:" && len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; 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\"
+
+ if ${skipped_export-false}; then
+ $show "generating symbol list for \`$libname.la'"
+ export_symbols="$output_objdir/$libname.exp"
+ $run $rm $export_symbols
+ libobjs=$output
+ # Append the command to create the export file.
+ eval concat_cmds=\"\$concat_cmds~$export_symbols_cmds\"
+ fi
+
+ # 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.
+ 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
+ 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
+ $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+ exit 0
+ fi
+
+ # Create links to the real library.
+ for linkname in $linknames; do
+ if test "$realname" != "$linkname"; then
+ $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+ fi
+ done
+
+ # If -module or -export-dynamic was specified, set the dlname.
+ if test "$module" = yes || test "$export_dynamic" = yes; then
+ # On all known operating systems, these are identical.
+ dlname="$soname"
+ fi
+ fi
+ ;;
+
+ obj)
+ if test -n "$deplibs"; then
+ $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+ fi
+
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$rpath"; then
+ $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$xrpath"; then
+ $echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$vinfo"; then
+ $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+ fi
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+ fi
+
+ case $output in
+ *.lo)
+ if test -n "$objs$old_deplibs"; then
+ $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+ exit 1
+ fi
+ libobj="$output"
+ obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+ ;;
+ *)
+ libobj=
+ obj="$output"
+ ;;
+ esac
+
+ # Delete the old objects.
+ $run $rm $obj $libobj
+
+ # Objects from convenience libraries. This assumes
+ # single-version convenience libraries. Whenever we create
+ # different ones for PIC/non-PIC, this we'll have to duplicate
+ # the extraction.
+ reload_conv_objs=
+ gentop=
+ # reload_cmds runs $LD directly, so let us get rid of
+ # -Wl from whole_archive_flag_spec
+ wl=
+
+ if test -n "$convenience"; then
+ if test -n "$whole_archive_flag_spec"; then
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+ else
+ gentop="$output_objdir/${obj}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ for xlib in $convenience; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+ fi
+
+ # Create the old-style object.
+ reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+ output="$obj"
+ eval cmds=\"$reload_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+
+ # Exit if we aren't doing a library object file.
+ if test -z "$libobj"; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ fi
+
+ if test "$build_libtool_libs" != yes; then
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ # Create an invalid libtool object if no PIC, so that we don't
+ # accidentally link it into a program.
+ # $show "echo timestamp > $libobj"
+ # $run eval "echo timestamp > $libobj" || exit $?
+ exit 0
+ fi
+
+ if test -n "$pic_flag" || test "$pic_mode" != default; then
+ # Only do commands if we really have different PIC objects.
+ reload_objs="$libobjs $reload_conv_objs"
+ output="$libobj"
+ eval cmds=\"$reload_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$gentop"; then
+ $show "${rm}r $gentop"
+ $run ${rm}r $gentop
+ fi
+
+ exit 0
+ ;;
+
+ 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
+
+ if test -n "$release"; then
+ $echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+ fi
+
+ if test "$preload" = yes; then
+ if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+ test "$dlopen_self_static" = unknown; then
+ $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+ 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
+
+ case $host in
+ *darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ ;;
+ esac
+
+ compile_command="$compile_command $compile_deplibs"
+ finalize_command="$finalize_command $finalize_deplibs"
+
+ if test -n "$rpath$xrpath"; then
+ # If the user specified any rpath flags, then add them.
+ for libdir in $rpath $xrpath; do
+ # This is the magic to use -rpath.
+ case "$finalize_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_rpath="$finalize_rpath $libdir" ;;
+ esac
+ done
+ fi
+
+ # Now hardcode the library paths
+ rpath=
+ hardcode_libdirs=
+ for libdir in $compile_rpath $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$perm_rpath " in
+ *" $libdir "*) ;;
+ *) perm_rpath="$perm_rpath $libdir" ;;
+ esac
+ fi
+ case $host in
+ *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+ case :$dllsearchpath: in
+ *":$libdir:"*) ;;
+ *) dllsearchpath="$dllsearchpath:$libdir";;
+ esac
+ ;;
+ esac
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ compile_rpath="$rpath"
+
+ rpath=
+ hardcode_libdirs=
+ for libdir in $finalize_rpath; do
+ if test -n "$hardcode_libdir_flag_spec"; then
+ if test -n "$hardcode_libdir_separator"; then
+ if test -z "$hardcode_libdirs"; then
+ hardcode_libdirs="$libdir"
+ else
+ # Just accumulate the unique libdirs.
+ case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+ *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+ ;;
+ *)
+ hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ ;;
+ esac
+ fi
+ else
+ eval flag=\"$hardcode_libdir_flag_spec\"
+ rpath="$rpath $flag"
+ fi
+ elif test -n "$runpath_var"; then
+ case "$finalize_perm_rpath " in
+ *" $libdir "*) ;;
+ *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ esac
+ fi
+ done
+ # Substitute the hardcoded libdirs into the rpath.
+ if test -n "$hardcode_libdir_separator" &&
+ test -n "$hardcode_libdirs"; then
+ libdir="$hardcode_libdirs"
+ eval rpath=\" $hardcode_libdir_flag_spec\"
+ fi
+ finalize_rpath="$rpath"
+
+ if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ # Transform all the library objects into standard objects.
+ compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ fi
+
+ dlsyms=
+ if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$NM" && test -n "$global_symbol_pipe"; then
+ dlsyms="${outputname}S.c"
+ else
+ $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+ fi
+ fi
+
+ if test -n "$dlsyms"; then
+ case $dlsyms in
+ "") ;;
+ *.c)
+ # Discover the nlist of each of the dlfiles.
+ nlist="$output_objdir/${outputname}.nm"
+
+ $show "$rm $nlist ${nlist}S ${nlist}T"
+ $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+ # Parse the name list into a source file.
+ $show "creating $output_objdir/$dlsyms"
+
+ test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+ if test "$dlself" = yes; then
+ $show "generating symbol list for \`$output'"
+
+ test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+ # Add our own program objects to the symbol list.
+ progfiles=`$echo "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+ for arg in $progfiles; do
+ $show "extracting global C symbols from \`$arg'"
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -n "$exclude_expsyms"; then
+ $run eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ if test -n "$export_symbols_regex"; then
+ $run eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+ $run eval '$mv "$nlist"T "$nlist"'
+ fi
+
+ # Prepare the list of exported symbols
+ if test -z "$export_symbols"; then
+ export_symbols="$output_objdir/$output.exp"
+ $run $rm $export_symbols
+ $run eval "${SED} -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ else
+ $run eval "${SED} -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+ $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+ $run eval 'mv "$nlist"T "$nlist"'
+ fi
+ fi
+
+ for arg in $dlprefiles; do
+ $show "extracting global C symbols from \`$arg'"
+ name=`$echo "$arg" | ${SED} -e 's%^.*/%%'`
+ $run eval '$echo ": $name " >> "$nlist"'
+ $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+ done
+
+ if test -z "$run"; then
+ # Make sure we have at least an empty file.
+ test -f "$nlist" || : > "$nlist"
+
+ if test -n "$exclude_expsyms"; then
+ $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+ $mv "$nlist"T "$nlist"
+ fi
+
+ # Try sorting and uniquifying the output.
+ if grep -v "^: " < "$nlist" |
+ if sort -k 3 </dev/null >/dev/null 2>&1; then
+ sort -k 3
+ else
+ sort +2
+ fi |
+ uniq > "$nlist"S; then
+ :
+ else
+ grep -v "^: " < "$nlist" > "$nlist"S
+ fi
+
+ if test -f "$nlist"S; then
+ eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+ else
+ $echo '/* NONE */' >> "$output_objdir/$dlsyms"
+ fi
+
+ $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr void *
+#else
+# define lt_ptr char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+ const char *name;
+ lt_ptr address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+ eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$dlsyms"
+
+ $echo >> "$output_objdir/$dlsyms" "\
+ {0, (lt_ptr) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+ return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+ fi
+
+ pic_flag_for_symtable=
+ 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
+ # pic_flag when linking with -static. The problem exists in
+ # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+ *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+ esac;;
+ *-*-hpux*)
+ case "$compile_command " in
+ *" -static "*) ;;
+ *) pic_flag_for_symtable=" $pic_flag";;
+ esac
+ esac
+
+ # Now compile the dynamic symbol file.
+ $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+ $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+ # Clean up the generated files.
+ $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+ $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+ # Transform the symbol file into the correct name.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ ;;
+ *)
+ $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+ exit 1
+ ;;
+ esac
+ else
+ # We keep going just in case the user didn't refer to
+ # lt_preloaded_symbols. The linker will fail if global_symbol_pipe
+ # really was required.
+
+ # Nullify the symbol file.
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+ fi
+
+ if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+ # Replace the output file specification.
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ link_command="$compile_command$compile_rpath"
+
+ # We have no uninstalled library dependencies, so finalize right now.
+ $show "$link_command"
+ $run eval "$link_command"
+ status=$?
+
+ # Delete the generated files.
+ if test -n "$dlsyms"; then
+ $show "$rm $output_objdir/${outputname}S.${objext}"
+ $run $rm "$output_objdir/${outputname}S.${objext}"
+ fi
+
+ exit $status
+ fi
+
+ if test -n "$shlibpath_var"; then
+ # We should set the shlibpath_var
+ rpath=
+ for dir in $temp_rpath; do
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]*)
+ # Absolute path.
+ rpath="$rpath$dir:"
+ ;;
+ *)
+ # Relative path: add a thisdir entry.
+ rpath="$rpath\$thisdir/$dir:"
+ ;;
+ esac
+ done
+ temp_rpath="$rpath"
+ fi
+
+ if test -n "$compile_shlibpath$finalize_shlibpath"; then
+ compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+ fi
+ if test -n "$finalize_shlibpath"; then
+ finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+ fi
+
+ compile_var=
+ finalize_var=
+ if test -n "$runpath_var"; then
+ if test -n "$perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ if test -n "$finalize_perm_rpath"; then
+ # We should set the runpath_var.
+ rpath=
+ for dir in $finalize_perm_rpath; do
+ rpath="$rpath$dir:"
+ done
+ finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+ fi
+ fi
+
+ if test "$no_install" = yes; then
+ # We don't need to create a wrapper script.
+ link_command="$compile_var$compile_command$compile_rpath"
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+ # Delete the old output file.
+ $run $rm $output
+ # Link the executable and exit
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+ exit 0
+ fi
+
+ if test "$hardcode_action" = relink; then
+ # Fast installation is not supported
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+ $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+ $echo "$modename: \`$output' will be relinked during installation" 1>&2
+ else
+ if test "$fast_install" != no; then
+ link_command="$finalize_var$compile_command$finalize_rpath"
+ if test "$fast_install" = yes; then
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+ else
+ # fast_install is set to needless
+ relink_command=
+ fi
+ else
+ link_command="$compile_var$compile_command$compile_rpath"
+ relink_command="$finalize_var$finalize_command$finalize_rpath"
+ fi
+ fi
+
+ # Replace the output file specification.
+ link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+ # Delete the old output files.
+ $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+ $show "$link_command"
+ $run eval "$link_command" || exit $?
+
+ # Now create the wrapper script.
+ $show "creating $output"
+
+ # Quote the relink command for shipping.
+ if test -n "$relink_command"; then
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ relink_command="(cd `pwd`; $relink_command)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Quote $echo for shipping.
+ if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+ case $0 in
+ [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+ *) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+ esac
+ qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+ else
+ qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+ fi
+
+ # Only actually do things if our run command is non-null.
+ if test -z "$run"; then
+ # win32 will think the script is a binary if it has
+ # a .exe suffix, so we strip it off here.
+ 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
+ outputname=`$echo $outputname|${SED} 's,.exe$,,'` ;;
+ *) exeext= ;;
+ esac
+ case $host in
+ *cygwin* | *mingw* )
+ cwrappersource=`$echo ${objdir}/lt-${output}.c`
+ cwrapper=`$echo ${output}.exe`
+ $rm $cwrappersource $cwrapper
+ trap "$rm $cwrappersource $cwrapper; exit 1" 1 2 15
+
+ cat > $cwrappersource <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+ Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+
+ The $output program cannot be directly executed until all the libtool
+ libraries that it depends on are installed.
+
+ This wrapper executable should never be moved out of the build directory.
+ If it is, it will not operate correctly.
+
+ Currently, it simply execs the wrapper *script* "/bin/sh $output",
+ but could eventually absorb all of the scripts functionality and
+ exec $objdir/$outputname directly.
+*/
+EOF
+ cat >> $cwrappersource<<"EOF"
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#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
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+ if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+const char *program_name = NULL;
+
+void * xmalloc (size_t num);
+char * xstrdup (const char *string);
+char * basename (const char *name);
+char * fnqualify(const char *path);
+char * strendzap(char *str, const char *pat);
+void lt_fatal (const char *message, ...);
+
+int
+main (int argc, char *argv[])
+{
+ char **newargz;
+ int i;
+
+ program_name = (char *) xstrdup ((char *) basename (argv[0]));
+ newargz = XMALLOC(char *, argc+2);
+EOF
+
+ cat >> $cwrappersource <<EOF
+ newargz[0] = "$SHELL";
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+ newargz[1] = fnqualify(argv[0]);
+ /* we know the script has the same name, without the .exe */
+ /* so make sure newargz[1] doesn't end in .exe */
+ strendzap(newargz[1],".exe");
+ for (i = 1; i < argc; i++)
+ newargz[i+1] = xstrdup(argv[i]);
+ newargz[argc+1] = NULL;
+EOF
+
+ cat >> $cwrappersource <<EOF
+ execv("$SHELL",newargz);
+EOF
+
+ cat >> $cwrappersource <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+ void * p = (void *) malloc (num);
+ if (!p)
+ lt_fatal ("Memory exhausted");
+
+ return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+ return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL
+;
+}
+
+char *
+basename (const char *name)
+{
+ const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ /* Skip over the disk name in MSDOS pathnames. */
+ 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;
+}
+
+char *
+fnqualify(const char *path)
+{
+ size_t size;
+ char *p;
+ char tmp[LT_PATHMAX + 1];
+
+ assert(path != NULL);
+
+ /* Is it qualified already? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+ if (isalpha (path[0]) && path[1] == ':')
+ return xstrdup (path);
+#endif
+ if (IS_DIR_SEPARATOR (path[0]))
+ return xstrdup (path);
+
+ /* prepend the current directory */
+ /* doesn't handle '~' */
+ if (getcwd (tmp, LT_PATHMAX) == NULL)
+ lt_fatal ("getcwd failed");
+ size = strlen(tmp) + 1 + strlen(path) + 1; /* +2 for '/' and '\0' */
+ p = XMALLOC(char, size);
+ sprintf(p, "%s%c%s", tmp, DIR_SEPARATOR, path);
+ return p;
+}
+
+char *
+strendzap(char *str, const char *pat)
+{
+ size_t len, patlen;
+
+ assert(str != NULL);
+ assert(pat != NULL);
+
+ len = strlen(str);
+ patlen = strlen(pat);
+
+ if (patlen <= len)
+ {
+ str += len - patlen;
+ if (strcmp(str, pat) == 0)
+ *str = '\0';
+ }
+ return str;
+}
+
+static void
+lt_error_core (int exit_status, const char * mode,
+ const char * message, va_list ap)
+{
+ fprintf (stderr, "%s: %s: ", program_name, mode);
+ vfprintf (stderr, message, ap);
+ fprintf (stderr, ".\n");
+
+ if (exit_status >= 0)
+ exit (exit_status);
+}
+
+void
+lt_fatal (const char *message, ...)
+{
+ va_list ap;
+ va_start (ap, message);
+ lt_error_core (EXIT_FAILURE, "FATAL", message, ap);
+ va_end (ap);
+}
+EOF
+ # we should really use a build-platform specific compiler
+ # here, but OTOH, the wrappers (shell script and this C one)
+ # are only useful if you want to execute the "real" binary.
+ # Since the "real" binary is built for $host, then this
+ # wrapper might as well be built for $host, too.
+ $run $LTCC -s -o $cwrapper $cwrappersource
+ ;;
+ esac
+ $rm $output
+ trap "$rm $output; exit 1" 1 2 15
+
+ $echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='${SED} -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+ # install mode needs the following variable:
+ 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
+ echo=\"$qecho\"
+ file=\"\$0\"
+ # Make sure echo works.
+ if test \"X\$1\" = X--no-reexec; then
+ # Discard the --no-reexec flag, and continue.
+ shift
+ elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+ # Yippee, \$echo works!
+ :
+ else
+ # Restart under the correct shell, and then maybe \$echo will work.
+ exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+ fi
+ fi\
+"
+ $echo >> $output "\
+
+ # Find the directory that this script lives in.
+ thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+ test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+ # Follow symbolic links until we get to the real thisdir.
+ file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\`
+ while test -n \"\$file\"; do
+ destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+ # If there was a directory component, then change thisdir.
+ if test \"x\$destdir\" != \"x\$file\"; then
+ case \"\$destdir\" in
+ [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+ *) thisdir=\"\$thisdir/\$destdir\" ;;
+ esac
+ fi
+
+ file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+ file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\`
+ done
+
+ # Try to get the absolute directory name.
+ absdir=\`cd \"\$thisdir\" && pwd\`
+ test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+ if test "$fast_install" = yes; then
+ $echo >> $output "\
+ program=lt-'$outputname'$exeext
+ progdir=\"\$thisdir/$objdir\"
+
+ if test ! -f \"\$progdir/\$program\" || \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+ file=\"\$\$-\$program\"
+
+ if test ! -d \"\$progdir\"; then
+ $mkdir \"\$progdir\"
+ else
+ $rm \"\$progdir/\$file\"
+ fi"
+
+ $echo >> $output "\
+
+ # relink executable if necessary
+ if test -n \"\$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
+ fi
+
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+ { $rm \"\$progdir/\$program\";
+ $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+ $rm \"\$progdir/\$file\"
+ fi"
+ else
+ $echo >> $output "\
+ program='$outputname'
+ progdir=\"\$thisdir/$objdir\"
+"
+ fi
+
+ $echo >> $output "\
+
+ if test -f \"\$progdir/\$program\"; then"
+
+ # Export our shlibpath_var if we have one.
+ if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ $echo >> $output "\
+ # Add our own library path to $shlibpath_var
+ $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+ # Some systems cannot cope with colon-terminated $shlibpath_var
+ # The second colon is a workaround for a bug in BeOS R4 sed
+ $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+ export $shlibpath_var
+"
+ fi
+
+ # fixup the dll searchpath if we need to.
+ if test -n "$dllsearchpath"; then
+ $echo >> $output "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
+ $echo >> $output "\
+ if test \"\$libtool_execute_magic\" != \"$magic\"; then
+ # Run the actual program with our arguments.
+"
+ case $host in
+ # Backslashes separate directories on plain windows
+ *-*-mingw | *-*-os2*)
+ $echo >> $output "\
+ exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+ ;;
+
+ *)
+ $echo >> $output "\
+ exec \$progdir/\$program \${1+\"\$@\"}
+"
+ ;;
+ esac
+ $echo >> $output "\
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+ exit 1
+ fi
+ else
+ # The program doesn't exist.
+ \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+ \$echo \"This script is just a wrapper for \$program.\" 1>&2
+ $echo \"See the $PACKAGE documentation for more information.\" 1>&2
+ exit 1
+ fi
+fi\
+"
+ chmod +x $output
+ fi
+ exit 0
+ ;;
+ esac
+
+ # See if we need to build an old-fashioned archive.
+ for oldlib in $oldlibs; do
+
+ if test "$build_libtool_libs" = convenience; then
+ oldobjs="$libobjs_save"
+ addlibs="$convenience"
+ build_libtool_libs=no
+ else
+ if test "$build_libtool_libs" = module; then
+ oldobjs="$libobjs_save"
+ build_libtool_libs=no
+ else
+ oldobjs="$old_deplibs $non_pic_objects"
+ fi
+ addlibs="$old_convenience"
+ fi
+
+ if test -n "$addlibs"; then
+ gentop="$output_objdir/${outputname}x"
+ $show "${rm}r $gentop"
+ $run ${rm}r "$gentop"
+ $show "$mkdir $gentop"
+ $run $mkdir "$gentop"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$gentop"; then
+ exit $status
+ fi
+ generated="$generated $gentop"
+
+ # Add in members from convenience archives.
+ for xlib in $addlibs; do
+ # Extract the objects.
+ case $xlib in
+ [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+ *) xabs=`pwd`"/$xlib" ;;
+ esac
+ xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+ xdir="$gentop/$xlib"
+
+ $show "${rm}r $xdir"
+ $run ${rm}r "$xdir"
+ $show "$mkdir $xdir"
+ $run $mkdir "$xdir"
+ status=$?
+ if test "$status" -ne 0 && test ! -d "$xdir"; then
+ exit $status
+ fi
+ # We will extract separately just the conflicting names and we will no
+ # longer touch any unique names. It is faster to leave these extract
+ # automatically by $AR in one run.
+ $show "(cd $xdir && $AR x $xabs)"
+ $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+ if ($AR t "$xabs" | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; renaming object files" 1>&2
+ $echo "$modename: warning: to ensure that they will not overwrite" 1>&2
+ $AR t "$xabs" | sort | uniq -cd | while read -r count name
+ do
+ i=1
+ while test "$i" -le "$count"
+ do
+ # Put our $i before any first dot (extension)
+ # Never overwrite any file
+ name_to="$name"
+ while test "X$name_to" = "X$name" || test -f "$xdir/$name_to"
+ do
+ name_to=`$echo "X$name_to" | $Xsed -e "s/\([^.]*\)/\1-$i/"`
+ done
+ $show "(cd $xdir && $AR xN $i $xabs '$name' && $mv '$name' '$name_to')"
+ $run eval "(cd \$xdir && $AR xN $i \$xabs '$name' && $mv '$name' '$name_to')" || exit $?
+ i=`expr $i + 1`
+ done
+ done
+ fi
+
+ oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP`
+ done
+ fi
+
+ # Do each command in the archive commands.
+ if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ eval cmds=\"$old_archive_from_new_cmds\"
+ else
+ eval cmds=\"$old_archive_cmds\"
+
+ if len=`expr "X$cmds" : ".*"` &&
+ test "$len" -le "$max_cmd_len" || test "$max_cmd_len" -le -1; 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
+ # GNU ar 2.10+ was changed to match POSIX; thus no paths are
+ # encoded into archives. This makes 'ar r' malfunction in
+ # this piecewise linking case whenever conflicting object
+ # names appear in distinct ar calls; check, warn and compensate.
+ if (for obj in $save_oldobjs
+ do
+ $echo "X$obj" | $Xsed -e 's%^.*/%%'
+ done | sort | sort -uc >/dev/null 2>&1); then
+ :
+ else
+ $echo "$modename: warning: object name conflicts; overriding AR_FLAGS to 'cq'" 1>&2
+ $echo "$modename: warning: to ensure that POSIX-compatible ar will work" 1>&2
+ AR_FLAGS=cq
+ fi
+ # Is there a better way of finding the last object in the list?
+ for obj in $save_oldobjs
+ do
+ last_oldobj=$obj
+ done
+ 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
+ if test "$obj" = "$last_oldobj" ; then
+ RANLIB=$save_RANLIB
+ fi
+ test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ objlist=
+ fi
+ done
+ RANLIB=$save_RANLIB
+ oldobjs=$objlist
+ if test "X$oldobjs" = "X" ; then
+ eval cmds=\"\$concat_cmds\"
+ else
+ eval cmds=\"\$concat_cmds~$old_archive_cmds\"
+ fi
+ fi
+ fi
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$generated"; then
+ $show "${rm}r$generated"
+ $run ${rm}r$generated
+ fi
+
+ # Now create the libtool archive.
+ case $output in
+ *.la)
+ old_library=
+ test "$build_old_libs" = yes && old_library="$libname.$libext"
+ $show "creating $output"
+
+ # Preserve any variables that may affect compiler behavior
+ for var in $variables_saved_for_relink; do
+ if eval test -z \"\${$var+set}\"; then
+ relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+ elif eval var_value=\$$var; test -z "$var_value"; then
+ relink_command="$var=; export $var; $relink_command"
+ else
+ var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+ relink_command="$var=\"$var_value\"; export $var; $relink_command"
+ fi
+ done
+ # Quote the link command for shipping.
+ relink_command="(cd `pwd`; $SHELL $0 --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+ if test "$hardcode_automatic" = yes ; then
+ relink_command=
+ fi
+ # Only create the output if not a dry run.
+ if test -z "$run"; then
+ for installed in no yes; do
+ if test "$installed" = yes; then
+ if test -z "$install_libdir"; then
+ break
+ fi
+ output="$output_objdir/$outputname"i
+ # Replace all uninstalled libtool libraries with the installed ones
+ newdependency_libs=
+ for deplib in $dependency_libs; do
+ case $deplib in
+ *.la)
+ name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdependency_libs="$newdependency_libs $libdir/$name"
+ ;;
+ *) newdependency_libs="$newdependency_libs $deplib" ;;
+ esac
+ done
+ dependency_libs="$newdependency_libs"
+ newdlfiles=
+ for lib in $dlfiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlfiles="$newdlfiles $libdir/$name"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ if test -z "$libdir"; then
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ exit 1
+ fi
+ newdlprefiles="$newdlprefiles $libdir/$name"
+ done
+ dlprefiles="$newdlprefiles"
+ else
+ newdlfiles=
+ for lib in $dlfiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlfiles="$newdlfiles $abs"
+ done
+ dlfiles="$newdlfiles"
+ newdlprefiles=
+ for lib in $dlprefiles; do
+ case $lib in
+ [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ *) abs=`pwd`"/$lib" ;;
+ esac
+ newdlprefiles="$newdlprefiles $abs"
+ done
+ 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 | *mingw*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;;
+ esac
+ $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+ if test "$installed" = no && test "$need_relink" = yes; then
+ $echo >> $output "\
+relink_command=\"$relink_command\""
+ fi
+ done
+ fi
+
+ # Do a symbolic link so that the libtool archive can be found in
+ # LD_LIBRARY_PATH before the program is installed.
+ $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+ $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+ ;;
+ esac
+ exit 0
+ ;;
+
+ # libtool install mode
+ install)
+ modename="$modename: install"
+
+ # There may be an optional sh(1) argument at the beginning of
+ # install_prog (especially on Windows NT).
+ if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ # Allow the use of GNU shtool's install 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$arg "
+ arg="$1"
+ shift
+ else
+ install_prog=
+ arg="$nonopt"
+ fi
+
+ # 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
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog$arg"
+
+ # We need to accept at least all the BSD install flags.
+ dest=
+ files=
+ opts=
+ prev=
+ install_type=
+ isdir=no
+ stripme=
+ for arg
+ do
+ if test -n "$dest"; then
+ files="$files $dest"
+ dest="$arg"
+ continue
+ fi
+
+ case $arg in
+ -d) isdir=yes ;;
+ -f) prev="-f" ;;
+ -g) prev="-g" ;;
+ -m) prev="-m" ;;
+ -o) prev="-o" ;;
+ -s)
+ stripme=" -s"
+ continue
+ ;;
+ -*) ;;
+
+ *)
+ # If the previous option needed an argument, then skip it.
+ if test -n "$prev"; then
+ prev=
+ else
+ dest="$arg"
+ continue
+ fi
+ ;;
+ esac
+
+ # Aesthetically quote the argument.
+ arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+ case $arg in
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*)
+ arg="\"$arg\""
+ ;;
+ esac
+ install_prog="$install_prog $arg"
+ done
+
+ if test -z "$install_prog"; then
+ $echo "$modename: you must specify an install program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -n "$prev"; then
+ $echo "$modename: the \`$prev' option requires an argument" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ if test -z "$files"; then
+ if test -z "$dest"; then
+ $echo "$modename: no file or destination specified" 1>&2
+ else
+ $echo "$modename: you must specify a destination" 1>&2
+ fi
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Strip any trailing slash from the destination.
+ dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+ # Check to see that the destination is a directory.
+ test -d "$dest" && isdir=yes
+ if test "$isdir" = yes; then
+ destdir="$dest"
+ destname=
+ else
+ destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$destdir" = "X$dest" && destdir=.
+ destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+ # Not a directory, so check to see that there is only one file specified.
+ set dummy $files
+ if test "$#" -gt 2; then
+ $echo "$modename: \`$dest' is not a directory" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+ fi
+ case $destdir in
+ [\\/]* | [A-Za-z]:[\\/]*) ;;
+ *)
+ for file in $files; do
+ case $file in
+ *.lo) ;;
+ *)
+ $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+ done
+ ;;
+ esac
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ staticlibs=
+ future_libdirs=
+ current_libdirs=
+ for file in $files; do
+
+ # Do each installation.
+ case $file in
+ *.$libext)
+ # Do the static libraries later.
+ staticlibs="$staticlibs $file"
+ ;;
+
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ library_names=
+ old_library=
+ relink_command=
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Add the libdir to current_libdirs if it is the destination.
+ if test "X$destdir" = "X$libdir"; then
+ case "$current_libdirs " in
+ *" $libdir "*) ;;
+ *) current_libdirs="$current_libdirs $libdir" ;;
+ esac
+ else
+ # Note the libdir as a future libdir.
+ case "$future_libdirs " in
+ *" $libdir "*) ;;
+ *) future_libdirs="$future_libdirs $libdir" ;;
+ esac
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+ test "X$dir" = "X$file/" && dir=
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
+ # Determine the prefix the user has applied to our future dir.
+ inst_prefix_dir=`$echo "$destdir" | $SED "s%$libdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+ # are installed to the same prefix.
+ # At present, this check doesn't affect windows .dll's that
+ # are installed into $libdir/../bin (currently, that works fine)
+ # but it's something to keep an eye on.
+ if test "$inst_prefix_dir" = "$destdir"; then
+ $echo "$modename: error: cannot install \`$file' to a directory not ending in $libdir" 1>&2
+ exit 1
+ fi
+
+ if test -n "$inst_prefix_dir"; then
+ # Stick the inst_prefix_dir data into the link command.
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+ else
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+ fi
+
+ $echo "$modename: warning: relinking \`$file'" 1>&2
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ exit 1
+ fi
+ fi
+
+ # See the names of the shared library.
+ set dummy $library_names
+ if test -n "$2"; then
+ realname="$2"
+ shift
+ shift
+
+ srcname="$realname"
+ test -n "$relink_command" && srcname="$realname"T
+
+ # Install the shared library and build the symlinks.
+ $show "$install_prog $dir/$srcname $destdir/$realname"
+ $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$striplib $destdir/$realname"
+ $run eval "$striplib $destdir/$realname" || exit $?
+ fi
+
+ if test "$#" -gt 0; then
+ # Delete the old symlinks, and create new ones.
+ for linkname
+ do
+ if test "$linkname" != "$realname"; then
+ $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+ fi
+ done
+ fi
+
+ # Do each command in the postinstall commands.
+ lib="$destdir/$realname"
+ eval cmds=\"$postinstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ fi
+
+ # Install the pseudo-library for information purposes.
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ instname="$dir/$name"i
+ $show "$install_prog $instname $destdir/$name"
+ $run eval "$install_prog $instname $destdir/$name" || exit $?
+
+ # Maybe install the static library, too.
+ test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ ;;
+
+ *.lo)
+ # Install (i.e. copy) a libtool object.
+
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # Deduce the name of the destination old-style object file.
+ case $destfile in
+ *.lo)
+ staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+ ;;
+ *.$objext)
+ staticdest="$destfile"
+ destfile=
+ ;;
+ *)
+ $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ # Install the libtool object if requested.
+ if test -n "$destfile"; then
+ $show "$install_prog $file $destfile"
+ $run eval "$install_prog $file $destfile" || exit $?
+ fi
+
+ # Install the old object if enabled.
+ if test "$build_old_libs" = yes; then
+ # Deduce the name of the old-style object file.
+ staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+ $show "$install_prog $staticobj $staticdest"
+ $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+ fi
+ exit 0
+ ;;
+
+ *)
+ # Figure out destination file name, if it wasn't already specified.
+ if test -n "$destname"; then
+ destfile="$destdir/$destname"
+ else
+ destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+ destfile="$destdir/$destfile"
+ fi
+
+ # If the file is missing, and there is a .exe on the end, strip it
+ # because it is most likely a libtool script we actually want to
+ # install
+ stripped_ext=""
+ case $file in
+ *.exe)
+ if test ! -f "$file"; then
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ stripped_ext=".exe"
+ fi
+ ;;
+ esac
+
+ # Do a test to see if this is really a libtool program.
+ case $host in
+ *cygwin*|*mingw*)
+ wrapper=`$echo $file | ${SED} -e 's,.exe$,,'`
+ ;;
+ *)
+ wrapper=$file
+ ;;
+ esac
+ if (${SED} -e '4q' $wrapper | grep "^# Generated by .*$PACKAGE")>/dev/null 2>&1; then
+ notinst_deplibs=
+ relink_command=
+
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ # Check the variables that should have been set.
+ if test -z "$notinst_deplibs"; then
+ $echo "$modename: invalid libtool wrapper script \`$wrapper'" 1>&2
+ exit 1
+ fi
+
+ finalize=yes
+ 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
+ */* | *\\*) . $lib ;;
+ *) . ./$lib ;;
+ esac
+ fi
+ libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ if test -n "$libdir" && test ! -f "$libfile"; then
+ $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+ finalize=no
+ fi
+ done
+
+ relink_command=
+ # To insure that "foo" is sourced, and not "foo.exe",
+ # finese the cygwin/MSYS system by explicitly sourcing "foo."
+ # which disallows the automatic-append-.exe behavior.
+ case $build in
+ *cygwin* | *mingw*) wrapperdot=${wrapper}. ;;
+ *) wrapperdot=${wrapper} ;;
+ esac
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . ${wrapperdot} ;;
+ *) . ./${wrapperdot} ;;
+ esac
+
+ outputname=
+ if test "$fast_install" = no && test -n "$relink_command"; then
+ if test "$finalize" = yes && test -z "$run"; then
+ tmpdir="/tmp"
+ test -n "$TMPDIR" && tmpdir="$TMPDIR"
+ tmpdir="$tmpdir/libtool-$$"
+ if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+ else
+ $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+ continue
+ fi
+ file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
+ outputname="$tmpdir/$file"
+ # Replace the output file specification.
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+ $show "$relink_command"
+ if $run eval "$relink_command"; then :
+ else
+ $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+ ${rm}r "$tmpdir"
+ continue
+ fi
+ file="$outputname"
+ else
+ $echo "$modename: warning: cannot relink \`$file'" 1>&2
+ fi
+ else
+ # Install the binary that we compiled earlier.
+ file=`$echo "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+ 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"
+ ;;
+ esac
+ done
+
+ for file in $staticlibs; do
+ name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+ # Set up the ranlib parameters.
+ oldlib="$destdir/$name"
+
+ $show "$install_prog $file $oldlib"
+ $run eval "$install_prog \$file \$oldlib" || exit $?
+
+ if test -n "$stripme" && test -n "$striplib"; then
+ $show "$old_striplib $oldlib"
+ $run eval "$old_striplib $oldlib" || exit $?
+ fi
+
+ # Do each command in the postinstall commands.
+ eval cmds=\"$old_postinstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || exit $?
+ done
+ IFS="$save_ifs"
+ done
+
+ if test -n "$future_libdirs"; then
+ $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+ fi
+
+ if test -n "$current_libdirs"; then
+ # Maybe just do a dry run.
+ test -n "$run" && current_libdirs=" -n$current_libdirs"
+ exec_cmd='$SHELL $0 --finish$current_libdirs'
+ else
+ exit 0
+ fi
+ ;;
+
+ # libtool finish mode
+ finish)
+ modename="$modename: finish"
+ libdirs="$nonopt"
+ admincmds=
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ for dir
+ do
+ libdirs="$libdirs $dir"
+ done
+
+ for libdir in $libdirs; do
+ if test -n "$finish_cmds"; then
+ # Do each command in the finish commands.
+ eval cmds=\"$finish_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd" || admincmds="$admincmds
+ $cmd"
+ done
+ IFS="$save_ifs"
+ fi
+ if test -n "$finish_eval"; then
+ # Do the single finish_eval.
+ eval cmds=\"$finish_eval\"
+ $run eval "$cmds" || admincmds="$admincmds
+ $cmds"
+ fi
+ done
+ fi
+
+ # Exit here if they wanted silent mode.
+ test "$show" = : && exit 0
+
+ $echo "----------------------------------------------------------------------"
+ $echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $echo " $libdir"
+ done
+ $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 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"
+ $echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ $echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ $echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
+
+ $echo " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $echo " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ $echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ $echo
+ $echo "See any operating system documentation about shared libraries for"
+ $echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ $echo "----------------------------------------------------------------------"
+ exit 0
+ ;;
+
+ # libtool execute mode
+ execute)
+ modename="$modename: execute"
+
+ # The first argument is the command name.
+ cmd="$nonopt"
+ if test -z "$cmd"; then
+ $echo "$modename: you must specify a COMMAND" 1>&2
+ $echo "$help"
+ exit 1
+ fi
+
+ # Handle -dlopen flags immediately.
+ for file in $execute_dlfiles; do
+ if test ! -f "$file"; then
+ $echo "$modename: \`$file' is not a file" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ dir=
+ case $file in
+ *.la)
+ # Check to see that this really is a libtool archive.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+ else
+ $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ # Read the libtool library.
+ dlname=
+ library_names=
+
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Skip this library if it cannot be dlopened.
+ if test -z "$dlname"; then
+ # Warn if it was a shared library.
+ test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+ continue
+ fi
+
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+
+ if test -f "$dir/$objdir/$dlname"; then
+ dir="$dir/$objdir"
+ else
+ $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+ exit 1
+ fi
+ ;;
+
+ *.lo)
+ # Just add the directory containing the .lo file.
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ test "X$dir" = "X$file" && dir=.
+ ;;
+
+ *)
+ $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+ continue
+ ;;
+ esac
+
+ # Get the absolute pathname.
+ absdir=`cd "$dir" && pwd`
+ test -n "$absdir" && dir="$absdir"
+
+ # Now add the directory to shlibpath_var.
+ if eval "test -z \"\$$shlibpath_var\""; then
+ eval "$shlibpath_var=\"\$dir\""
+ else
+ eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+ fi
+ done
+
+ # This variable tells wrapper scripts just to set shlibpath_var
+ # rather than running their programs.
+ libtool_execute_magic="$magic"
+
+ # Check if any of the arguments is a wrapper script.
+ args=
+ for file
+ do
+ case $file in
+ -*) ;;
+ *)
+ # Do a test to see if this is really a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ # If there is no directory component, then add one.
+ case $file in
+ */* | *\\*) . $file ;;
+ *) . ./$file ;;
+ esac
+
+ # Transform arg to wrapped name.
+ file="$progdir/$program"
+ fi
+ ;;
+ esac
+ # Quote arguments (to preserve shell metacharacters).
+ file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+ args="$args \"$file\""
+ done
+
+ if test -z "$run"; then
+ if test -n "$shlibpath_var"; then
+ # Export the shlibpath_var.
+ eval "export $shlibpath_var"
+ fi
+
+ # Restore saved environment variables
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
+
+ # Now prepare to actually exec the command.
+ exec_cmd="\$cmd$args"
+ else
+ # Display what would be done.
+ if test -n "$shlibpath_var"; then
+ eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+ $echo "export $shlibpath_var"
+ fi
+ $echo "$cmd$args"
+ exit 0
+ fi
+ ;;
+
+ # libtool clean and uninstall mode
+ clean | uninstall)
+ modename="$modename: $mode"
+ rm="$nonopt"
+ files=
+ rmforce=
+ exit_status=0
+
+ # This variable tells wrapper scripts just to set variables rather
+ # than running their programs.
+ libtool_install_magic="$magic"
+
+ for arg
+ do
+ case $arg in
+ -f) rm="$rm $arg"; rmforce=yes ;;
+ -*) rm="$rm $arg" ;;
+ *) files="$files $arg" ;;
+ esac
+ done
+
+ if test -z "$rm"; then
+ $echo "$modename: you must specify an RM program" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ fi
+
+ rmdirs=
+
+ origobjdir="$objdir"
+ for file in $files; do
+ dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+ if test "X$dir" = "X$file"; then
+ dir=.
+ objdir="$origobjdir"
+ else
+ objdir="$dir/$origobjdir"
+ fi
+ 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
+ *.la)
+ # Possibly a libtool archive, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ . $dir/$name
+
+ # Delete the libtool libraries and symlinks.
+ for n in $library_names; do
+ rmfiles="$rmfiles $objdir/$n"
+ done
+ test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test "$mode" = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+ if test "$mode" = uninstall; then
+ if test -n "$library_names"; then
+ # Do each command in the postuninstall commands.
+ eval cmds=\"$postuninstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+
+ if test -n "$old_library"; then
+ # Do each command in the old_postuninstall commands.
+ eval cmds=\"$old_postuninstall_cmds\"
+ save_ifs="$IFS"; IFS='~'
+ for cmd in $cmds; do
+ IFS="$save_ifs"
+ $show "$cmd"
+ $run eval "$cmd"
+ if test "$?" -ne 0 && test "$rmforce" != yes; then
+ exit_status=1
+ fi
+ done
+ IFS="$save_ifs"
+ fi
+ # FIXME: should reinstall the best remaining shared library.
+ fi
+ fi
+ ;;
+
+ *.lo)
+ # Possibly a libtool object, so verify it.
+ if (${SED} -e '2q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+ # Read the .lo file
+ . $dir/$name
+
+ # Add PIC object to the list of files to remove.
+ if test -n "$pic_object" \
+ && test "$pic_object" != none; then
+ rmfiles="$rmfiles $dir/$pic_object"
+ fi
+
+ # Add non-PIC object to the list of files to remove.
+ if test -n "$non_pic_object" \
+ && test "$non_pic_object" != none; then
+ rmfiles="$rmfiles $dir/$non_pic_object"
+ fi
+ fi
+ ;;
+
+ *)
+ if test "$mode" = clean ; then
+ noexename=$name
+ case $file in
+ *.exe)
+ file=`$echo $file|${SED} 's,.exe$,,'`
+ noexename=`$echo $name|${SED} 's,.exe$,,'`
+ # $file with .exe has already been added to rmfiles,
+ # add $file without .exe
+ rmfiles="$rmfiles $file"
+ ;;
+ esac
+ # Do a test to see if this is a libtool program.
+ if (${SED} -e '4q' $file | grep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+ relink_command=
+ . $dir/$noexename
+
+ # note $name still contains .exe if it was in $file originally
+ # as does the version of $file that was added into $rmfiles
+ rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ if test "$fast_install" = yes && test -n "$relink_command"; then
+ rmfiles="$rmfiles $objdir/lt-$name"
+ fi
+ if test "X$noexename" != "X$name" ; then
+ rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ fi
+ fi
+ fi
+ ;;
+ esac
+ $show "$rm $rmfiles"
+ $run $rm $rmfiles || exit_status=1
+ done
+ objdir="$origobjdir"
+
+ # 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
+ ;;
+
+ "")
+ $echo "$modename: you must specify a MODE" 1>&2
+ $echo "$generic_help" 1>&2
+ exit 1
+ ;;
+ esac
+
+ 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
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+-n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --finish same as \`--mode=finish'
+ --help display this help message and exit
+ --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS]
+ --quiet same as \`--silent'
+ --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ --version print version information
+
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE.
+
+Report bugs to <bug-libtool@gnu.org>."
+ exit 0
+ ;;
+
+clean)
+ $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+compile)
+ $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+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
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+ ;;
+
+execute)
+ $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+ -dlopen FILE add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+ ;;
+
+finish)
+ $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges. Use
+the \`--dry-run' option if you just want to see what would be executed."
+ ;;
+
+install)
+ $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command. The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+ ;;
+
+link)
+ $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+ -all-static do not do any dynamic linking at all
+ -avoid-version do not add a version suffix if possible
+ -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
+ -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+ -export-symbols SYMFILE
+ try to export only the symbols listed in SYMFILE
+ -export-symbols-regex REGEX
+ try to export only the symbols matching REGEX
+ -LLIBDIR search LIBDIR for required installed libraries
+ -lNAME OUTPUT-FILE requires the installed library libNAME
+ -module build a library that can dlopened
+ -no-fast-install disable the fast-install mode
+ -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
+ -static do not do any dynamic linking of libtool libraries
+ -version-info CURRENT[:REVISION[:AGE]]
+ specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename. Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+ ;;
+
+uninstall)
+ $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+ ;;
+
+*)
+ $echo "$modename: invalid operation mode \`$mode'" 1>&2
+ $echo "$help" 1>&2
+ exit 1
+ ;;
+esac
+
+$echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries. Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them. This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration. But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
diff --git a/fastjar/missing b/libjava/libltdl/missing
index 7789652e877..fc54c64ec96 100755
--- a/fastjar/missing
+++ b/libjava/libltdl/missing
@@ -1,7 +1,7 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
-# Copyright (C) 1996, 1997 Free Software Foundation, Inc.
-# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996.
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# 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
@@ -18,11 +18,37 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
+run=:
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+ configure_ac=configure.ac
+else
+ configure_ac=configure.in
+fi
+
+case "$1" in
+--run)
+ # Try to run requested program, and just exit if it succeeds.
+ run=
+ shift
+ "$@" && exit 0
+ ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
@@ -35,6 +61,7 @@ error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
+ --run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
@@ -43,13 +70,15 @@ Supported PROGRAM values:
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
+ help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
+ tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
- echo "missing - GNU libit 0.0"
+ echo "missing 0.4 - GNU automake"
;;
-*)
@@ -58,31 +87,46 @@ Supported PROGRAM values:
exit 1
;;
- aclocal)
+ aclocal*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acinclude.m4' or \`configure.in'. You might want
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`configure.in'. You might want to install the
+ you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`acconfig.h' or \`configure.in'. You might want
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
- files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' configure.in`
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
@@ -95,10 +139,15 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $touch_files
;;
- automake)
+ automake*)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
- you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'.
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
@@ -106,6 +155,34 @@ WARNING: \`$1' is missing on your system. You should only need it if
while read f; do touch "$f"; done
;;
+ autom4te)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is needed, and you do not seem to have it handy on your
+ system. You might have modified some files without having the
+ proper tools for further handling them.
+ You can get \`$1' as part of \`Autoconf' from any GNU
+ archive site."
+
+ file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
+ test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
+ if test -f "$file"; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo "#! /bin/sh"
+ echo "# Created by GNU Automake missing as a replacement of"
+ echo "# $ $@"
+ echo "exit 0"
+ chmod +x $file
+ exit 1
+ fi
+ ;;
+
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
@@ -159,7 +236,37 @@ WARNING: \`$1' is missing on your system. You should only need it if
fi
;;
+ help2man)
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+ # We have it, but it failed.
+ exit 1
+ fi
+
+ echo 1>&2 "\
+WARNING: \`$1' is missing on your system. You should only need it if
+ you modified a dependency of a manual page. You may need the
+ \`Help2man' package in order for those modifications to take
+ effect. You can get \`Help2man' from any GNU archive site."
+
+ file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
+ if test -z "$file"; then
+ file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
+ fi
+ if [ -f "$file" ]; then
+ touch $file
+ else
+ test -z "$file" || exec >$file
+ echo ".ab help2man is required to generate this page"
+ exit 1
+ fi
+ ;;
+
makeinfo)
+ if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
+ # We have makeinfo, but it failed.
+ exit 1
+ fi
+
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
@@ -175,12 +282,51 @@ WARNING: \`$1' is missing on your system. You should only need it if
touch $file
;;
+ tar)
+ shift
+ if test -n "$run"; then
+ echo 1>&2 "ERROR: \`tar' requires --run"
+ exit 1
+ fi
+
+ # We have already tried tar in the generic part.
+ # Look for gnutar/gtar before invocation to avoid ugly error
+ # messages.
+ if (gnutar --version > /dev/null 2>&1); then
+ gnutar "$@" && exit 0
+ fi
+ if (gtar --version > /dev/null 2>&1); then
+ gtar "$@" && exit 0
+ fi
+ firstarg="$1"
+ if shift; then
+ case "$firstarg" in
+ *o*)
+ firstarg=`echo "$firstarg" | sed s/o//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ case "$firstarg" in
+ *h*)
+ firstarg=`echo "$firstarg" | sed s/h//`
+ tar "$firstarg" "$@" && exit 0
+ ;;
+ esac
+ fi
+
+ echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+ You may want to install GNU tar or Free paxutils, or check the
+ command line arguments."
+ exit 1
+ ;;
+
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
- it often tells you about the needed prerequirements for installing
+ it often tells you about the needed prerequisites for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
diff --git a/fastjar/mkinstalldirs b/libjava/libltdl/mkinstalldirs
index d2d5f21b611..d2d5f21b611 100755
--- a/fastjar/mkinstalldirs
+++ b/libjava/libltdl/mkinstalldirs
diff --git a/libjava/libltdl/stamp-h.in b/libjava/libltdl/stamp-h.in
deleted file mode 100644
index 9788f70238c..00000000000
--- a/libjava/libltdl/stamp-h.in
+++ /dev/null
@@ -1 +0,0 @@
-timestamp
diff --git a/libjava/mauve-libgcj b/libjava/mauve-libgcj
index 53187b8d03d..807eed70fc6 100644
--- a/libjava/mauve-libgcj
+++ b/libjava/mauve-libgcj
@@ -10,9 +10,6 @@ JLS1.2
JDBC1.0
JDBC2.0
-# Cannot be compiled
-!java.text.ACIAttribute
-
# The following tests seem to hang or crash the testsuite.
# This a problem when running Mauve "standalone".
!java.lang.reflect.Array.newInstance
@@ -25,6 +22,3 @@ JDBC2.0
# The behaviour of the garbarge collector cannot be predicted.
# Note the . at the end so we do test java.lang.reflect
!java.lang.ref.
-
-# We don't have CollationElementIterator.setText.
-!java.text.CollationElementIterator.
diff --git a/libjava/sysdep/sparc/locks.h b/libjava/sysdep/sparc/locks.h
index 503417c98a6..7339567d7d4 100644
--- a/libjava/sysdep/sparc/locks.h
+++ b/libjava/sysdep/sparc/locks.h
@@ -54,11 +54,11 @@ __cas_start_atomic(void)
unsigned int tmp;
__asm__ __volatile__(
"1: ldstub [%1], %0\n"
-" orcc %0, 0x0, %g0\n"
+" orcc %0, 0x0, %%g0\n"
" be 3f\n"
" nop\n"
"2: ldub [%1], %0\n"
-" orcc %0, 0x0, %g0\n"
+" orcc %0, 0x0, %%g0\n"
" bne 2b\n"
" nop\n"
"3:" : "=&r" (tmp)
diff --git a/libjava/testsuite/ChangeLog b/libjava/testsuite/ChangeLog
index 74e4a64e351..e64b114b95b 100644
--- a/libjava/testsuite/ChangeLog
+++ b/libjava/testsuite/ChangeLog
@@ -1,3 +1,62 @@
+2003-12-03 Ralph Loader <rcl@ihug.co.nz>
+
+ PR java/12374:
+ * libjava.compile/PR12374.java: New file.
+
+2003-12-01 Jeff Sturm <jsturm@one-point.com>
+
+ PR optimization/13024
+ * libjava.compile/PR13024.java: New file.
+
+ PR java/13237
+ * libjava.compile/PR13237.java: New file.
+
+2003-11-18 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * libjava.jar/jar.exp: Cleanup files and reset CLASSPATH.
+
+2003-11-17 Jeff Sturm <jsturm@one-point.com>
+
+ * libjava.compile/PR12857.java: New test case.
+
+2003-11-14 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jar/simple.jar: Replaced.
+
+2003-11-13 Tom Fitzsimmons <fitzsim@redhat.com>
+
+ * libjava.jni/jniutf.c: New file.
+ * libjava.jni/jniutf.java: New file.
+ * libjava.jni/jniutf.out: New file.
+
+2003-11-11 Tom Tromey <tromey@redhat.com>
+
+ For PR java/12915:
+ * libjava.lang/PR12915.java: New file.
+ * libjava.lang/PR12915.out: New file.
+
+ * libjava.jacks/jacks.exp (gcj_jacks_write): Enable "assert"
+ constraint.
+ * libjava.jacks/jacks.xfail: Added new xfails.
+
+2003-11-10 Tom Tromey <tromey@redhat.com>
+
+ For PR java/12996:
+ * libjava.jar/simple.jar: New file.
+ * libjava.jar/simple.xfail: New file.
+ * libjava.jar/simple.out: New file.
+ * libjava.jar/simple.java: New file.
+ * libjava.jar/jar.exp: New file.
+
+2003-11-08 Tom Tromey <tromey@redhat.com>
+
+ * libjava.jacks/jacks.xfail: Updated.
+
+2003-11-03 Jeff Sturm <jsturm@one-point.com>
+
+ PR java/12866:
+ * libjava.compile/InnerExcept.java: New File.
+
2003-10-22 Tom Tromey <tromey@redhat.com>
PR libgcj/12416:
diff --git a/libjava/testsuite/lib/libjava.exp b/libjava/testsuite/lib/libjava.exp
index 42732f59e6c..9ae18821b1c 100644
--- a/libjava/testsuite/lib/libjava.exp
+++ b/libjava/testsuite/lib/libjava.exp
@@ -137,6 +137,7 @@ proc libjava_init { args } {
global env libgcj_jar
global tool_root_dir
global libjava_libgcc_s_path
+ global target_triplet
if { $libjava_initialized == 1 } { return; }
@@ -177,7 +178,11 @@ proc libjava_init { args } {
if [info exists env(SHLIB_PATH)] {
set original_ld_library_path $env(SHLIB_PATH)
} else {
- set original_ld_library_path ""
+ if [info exists env(DYLD_LIBRARY_PATH)] {
+ set original_ld_library_path $env(DYLD_LIBRARY_PATH)
+ } else {
+ set original_ld_library_path ""
+ }
}
}
@@ -196,7 +201,13 @@ proc libjava_init { args } {
# Finally, add the gcc build directory so that we can find the
# shared libgcc. This, like much of dejagnu, is hideous.
set libjava_libgcc_s_path {}
- set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.so]
+
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ set so_extension "dylib"
+ } else {
+ set so_extension "so"
+ }
+ set gccdir [lookfor_file $tool_root_dir gcc/libgcc_s.${so_extension}]
if {$gccdir != ""} {
set gccdir [file dirname $gccdir]
lappend libjava_libgcc_s_path $gccdir
@@ -210,7 +221,7 @@ proc libjava_init { args } {
if { "$mldir" == "." } {
continue
}
- if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.so.*]] == 1 } {
+ if { [llength [glob -nocomplain ${gccdir}/${mldir}/libgcc_s*.${so_extension}.*]] == 1 } {
lappend libjava_libgcc_s_path "${gccdir}/${mldir}"
}
}
@@ -228,7 +239,7 @@ proc libjava_init { args } {
# paths. However we can't simply use those libraries; we still need
# libtool for linking.
# Don't return the the lib${name}.la files here, since this causes the
-# libraries to be linked twice: once as lib${name}.so and another time
+# libraries to be linked twice: once as lib${name}.so/dylib and another time
# via gcj's implicit -l${name}. This is both unnecessary and causes the
# Solaris ld to warn: attempted multiple inclusion of file. This warning
# is not ignored by the dejagnu framework and cannot be disabled.
@@ -352,6 +363,7 @@ proc libjava_arguments {{mode compile}} {
global original_ld_library_path
setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
+ setenv DYLD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
verbose "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
@@ -401,9 +413,13 @@ proc libjava_arguments {{mode compile}} {
# Avoid libtool wrapper scripts when possible.
# but not if libtool warnings results in FAILs
if {$mode == "link"} {
- if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
- lappend args "additional_flags=-no-install"
- }
+ if {! [istarget "*-*-cygwin*"] && ! [istarget "*-*-mingw*"] } {
+ lappend args "additional_flags=-no-install"
+ }
+ if { [istarget "*-*-darwin*"] } {
+ lappend args "additional_flags=-bind_at_load"
+ lappend args "additional_flags=-multiply_defined suppress"
+ }
}
return $args
@@ -444,6 +460,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
setenv LD_LIBRARY_PATH $newval
setenv SHLIB_PATH $newval
+ setenv DYLD_LIBRARY_PATH $newval
verbose "LD_LIBRARY_PATH=$env(LD_LIBRARY_PATH)"
@@ -454,6 +471,7 @@ proc gcj_invoke {program expectFile ld_library_additions} {
# Restore setting
setenv LD_LIBRARY_PATH $lib_path
setenv SHLIB_PATH $lib_path
+ setenv DYLD_LIBRAY_PATH $lib_path
if {$status != "pass"} {
verbose "got $output"
diff --git a/libjava/testsuite/libjava.compile/InnerExcept.java b/libjava/testsuite/libjava.compile/InnerExcept.java
new file mode 100644
index 00000000000..df4b62893e2
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/InnerExcept.java
@@ -0,0 +1,19 @@
+import java.io.*;
+
+// Test case for http://gcc.gnu.org/PR12866
+// From Mark Wielaard
+public class InnerExcept
+{
+ static private void createFile() throws IOException
+ {
+ new File("/dev/null");
+ }
+
+ class Inner
+ {
+ private void m() throws IOException
+ {
+ createFile();
+ }
+ }
+}
diff --git a/libjava/testsuite/libjava.compile/PR12374.java b/libjava/testsuite/libjava.compile/PR12374.java
new file mode 100644
index 00000000000..19e81935d59
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR12374.java
@@ -0,0 +1,27 @@
+public class PR12374 {
+
+ /* We weren't coping with field refs on a string constant... */
+
+ Object Foo()
+ {
+ return "".CASE_INSENSITIVE_ORDER;
+ }
+
+ /* Special casing access to array.length while analysing syntax is
+ evil. Especially when it means we can't cope with a type
+ called length. */
+
+ class length
+ {
+ static final int i = 2;
+ }
+
+ int bar()
+ {
+ return length.i;
+ }
+
+ public static void main (String[] argv)
+ {
+ }
+}
diff --git a/libjava/testsuite/libjava.compile/PR12857.java b/libjava/testsuite/libjava.compile/PR12857.java
new file mode 100644
index 00000000000..9ed234ff277
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR12857.java
@@ -0,0 +1,4 @@
+// Based on original test case from Yves Martin.
+interface PR12857 {
+ static final String CONST = PR12857.class.getName();
+}
diff --git a/libjava/testsuite/libjava.compile/PR13024.java b/libjava/testsuite/libjava.compile/PR13024.java
new file mode 100644
index 00000000000..61ab17c5e88
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR13024.java
@@ -0,0 +1,18 @@
+import java.io.*;
+import java.util.zip.*;
+
+class PR13024 {
+ void isZipOrJarArchive(File file) throws IOException {
+ ZipFile zipFile = null;
+
+ try {
+ zipFile = new ZipFile(file);
+ } finally {
+ if (zipFile != null) {
+ try {
+ zipFile.close();
+ } catch (IOException ignored) {}
+ }
+ }
+ }
+}
diff --git a/libjava/testsuite/libjava.compile/PR13237.java b/libjava/testsuite/libjava.compile/PR13237.java
new file mode 100644
index 00000000000..6333a460afb
--- /dev/null
+++ b/libjava/testsuite/libjava.compile/PR13237.java
@@ -0,0 +1,3 @@
+class PR13237 {
+ double kappa = Math.sqrt(2.0);
+}
diff --git a/libjava/testsuite/libjava.jacks/jacks.exp b/libjava/testsuite/libjava.jacks/jacks.exp
index 8b2bd9b5b5a..353859ce803 100644
--- a/libjava/testsuite/libjava.jacks/jacks.exp
+++ b/libjava/testsuite/libjava.jacks/jacks.exp
@@ -32,6 +32,7 @@ proc gcj_jacks_write {filename} {
puts $fd "set JAVAC_ENCODING_FLAG --encoding="
puts $fd "set tcltest::testConstraints(encoding) 1"
puts $fd "set tcltest::testConstraints(gcj) 1"
+ puts $fd "set tcltest::testConstraints(assert) 1"
# "Time-consuming JVM limitation tests".
# puts $fd "set tcltest::testConstraints(jvm) 1"
close $fd
diff --git a/libjava/testsuite/libjava.jacks/jacks.xfail b/libjava/testsuite/libjava.jacks/jacks.xfail
index 9087d5f0fe0..ed55f1bae5b 100644
--- a/libjava/testsuite/libjava.jacks/jacks.xfail
+++ b/libjava/testsuite/libjava.jacks/jacks.xfail
@@ -128,7 +128,6 @@
8.1.3-object-3
8.1.3-superclass-5
8.1.3-superclass-6
-8.2-accessibility-inherited-member-5
8.8.5.1-example-1
8.8.5.1-example-3
8.8.5.1-qualified-1
@@ -225,10 +224,6 @@
8.7-abrupt-1
8.7-complete-1
8.7-complete-3
-5.1.3-dti-1
-5.1.3-dti-2
-5.1.3-fti-1
-5.1.3-fti-2
5.1.2-bts-1
5.1.2-bts-2
5.1.2-bts-3
@@ -745,3 +740,28 @@ non-jls-zip-2
15.20-2-runtime-1
15.15-runtime-3
15.15-runtime-4
+non-jls-jsr41.4-definite-unassignment-fail-22
+non-jls-jsr41.4-definite-unassignment-pass-2
+non-jls-jsr41.4-definite-unassignment-pass-9
+non-jls-jsr41.4-definite-unassignment-pass-10
+non-jls-jsr41.4-definite-unassignment-try-1
+non-jls-jsr41.4-definite-unassignment-try-2
+non-jls-jsr41.4-definite-unassignment-try-3
+non-jls-jsr41.4-definite-unassignment-try-4
+non-jls-jsr41.4-definite-unassignment-try-5
+non-jls-jsr41.4-definite-unassignment-try-6
+non-jls-jsr41.4-definite-unassignment-try-7
+non-jls-jsr41.4-definite-unassignment-try-8
+non-jls-jsr41.4-loop-1
+non-jls-jsr41.4-loop-2
+non-jls-jsr41.4-loop-3
+non-jls-jsr41.4-loop-7
+non-jls-jsr41.4-loop-8
+non-jls-jsr41.4-loop-9
+non-jls-jsr41.4-loop-10
+non-jls-jsr41.4-loop-11
+non-jls-jsr41.4-loop-12
+non-jls-jsr41.4-loop-13
+non-jls-jsr41.4-loop-14
+non-jls-jsr41.4-loop-15
+non-jls-jsr41.2-clash-1
diff --git a/libjava/testsuite/libjava.jni/jniutf.c b/libjava/testsuite/libjava.jni/jniutf.c
new file mode 100644
index 00000000000..1ccc7ea938d
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/jniutf.c
@@ -0,0 +1,10 @@
+#include <jniutf.h>
+
+JNIEXPORT void JNICALL
+Java_jniutf_printString (JNIEnv *env, jobject obj, jstring str)
+{
+ const char *cstr;
+
+ cstr = (*env)->GetStringUTFChars (env, str, NULL);
+ (*env)->ReleaseStringUTFChars (env, str, cstr);
+}
diff --git a/libjava/testsuite/libjava.jni/jniutf.java b/libjava/testsuite/libjava.jni/jniutf.java
new file mode 100644
index 00000000000..e03e16e29ca
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/jniutf.java
@@ -0,0 +1,16 @@
+public class jniutf
+{
+ native void printString (String str);
+
+ static
+ {
+ System.loadLibrary ("jniutf");
+ }
+
+ public static void main (String[] args)
+ {
+
+ String s1 = new String("\u3040\u3041\u3042\u3043\u3044\u3045\u3046\u3047\u3048\u3049\u304A\u304B\u304C\u304D\u304E\u304F\u3050\u3051\u3052\u3053\u3054\u3055\u3056\u3057\u3058\u3059\u305A\u305B");
+ new jniutf().printString (s1);
+ }
+}
diff --git a/libjava/testsuite/libjava.jni/jniutf.out b/libjava/testsuite/libjava.jni/jniutf.out
new file mode 100644
index 00000000000..e69de29bb2d
--- /dev/null
+++ b/libjava/testsuite/libjava.jni/jniutf.out
diff --git a/libjava/testsuite/libjava.lang/PR12915.java b/libjava/testsuite/libjava.lang/PR12915.java
new file mode 100644
index 00000000000..3a155f6e17e
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR12915.java
@@ -0,0 +1,6 @@
+public class PR12915 {
+ public static void main(String[] args)
+ {
+ System.out.println(((String) null) + "");
+ }
+}
diff --git a/libjava/testsuite/libjava.lang/PR12915.out b/libjava/testsuite/libjava.lang/PR12915.out
new file mode 100644
index 00000000000..19765bd501b
--- /dev/null
+++ b/libjava/testsuite/libjava.lang/PR12915.out
@@ -0,0 +1 @@
+null
diff --git a/libjava/testsuite/libjava.mauve/xfails b/libjava/testsuite/libjava.mauve/xfails
index 96b9ce3c155..178a492fb76 100644
--- a/libjava/testsuite/libjava.mauve/xfails
+++ b/libjava/testsuite/libjava.mauve/xfails
@@ -71,8 +71,72 @@ FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 5 (
FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 7 (number 1)
FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: secondaryOrder() 9 (number 1)
FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: tertiaryOrder() 10 (number 1)
-FAIL: gnu.testlet.java.net.ServerSocket.ServerSocketTest: Error : test_params failed - 5getInetAddress did not return proper values (number 1)
-FAIL: gnu.testlet.java.net.Socket.SocketTest: Error : test_BasicServer failed - 11 exception was thrown :Illegal seek (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 2 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 2 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 4 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 4 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 6 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 6 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 8 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 8 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 10 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 10 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 12 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 12 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 14 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 14 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 16 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 16 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 18 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 18 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 20 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 20 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 22 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 22 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 24 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 24 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 26 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 26 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 28 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 28 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 30 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 30 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 32 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 32 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 34 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 34 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 36 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 36 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 38 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 38 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 40 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 40 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 42 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 42 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 44 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 44 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 46 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 46 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 48 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 48 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 50 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 50 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 52 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 52 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 54 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 54 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 56 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 56 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 58 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 58 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 60 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 60 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 62 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no primary difference 62 test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: wrong number of keys test string #4 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: next() 2 test string #5 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: no tertiary difference2 test string #5 (number 1)
+FAIL: gnu.testlet.java.text.CollationElementIterator.jdk11: not tertiary ordered0, 2 test set #0 (number 1)
FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_Basics - 2 should not have raised Throwable here (number 1)
FAIL: gnu.testlet.java.net.URLConnection.URLConnectionTest: Error in test_getHeaderField - 2 4 header field wrong (number 1)
FAIL: gnu.testlet.java.net.URL.URLTest: openStream (number 1)
diff --git a/libjava/verify.cc b/libjava/verify.cc
index ba408aa98be..e085938ce78 100644
--- a/libjava/verify.cc
+++ b/libjava/verify.cc
@@ -1010,6 +1010,7 @@ private:
_Jv_Free (info);
info = next;
}
+ seen_subrs = NULL;
}
void copy (const state *copy, int max_stack, int max_locals,
@@ -1025,21 +1026,20 @@ private:
// See push_jump_merge to understand this case.
if (ret_semantics)
locals[i] = type (copy->local_changed[i]
- ? unsuitable_type
+ ? copy->locals[i]
: unused_by_subroutine_type);
else
locals[i] = copy->locals[i];
- local_changed[i] = copy->local_changed[i];
+ local_changed[i] = subroutine ? copy->local_changed[i] : false;
}
clean_subrs ();
if (copy->seen_subrs)
{
- for (subr_info *info = seen_subrs; info != NULL; info = info->next)
+ for (subr_info *info = copy->seen_subrs;
+ info != NULL; info = info->next)
add_subr (info->pc);
}
- else
- seen_subrs = NULL;
this_type = copy->this_type;
// Don't modify `next'.
@@ -1465,7 +1465,8 @@ private:
// which was not modified by the subroutine.
states[npc] = new state (nstate, current_method->max_stack,
current_method->max_locals, ret_semantics);
- debug_print ("== New state in push_jump_merge\n");
+ debug_print ("== New state in push_jump_merge (ret_semantics = %s)\n",
+ ret_semantics ? "true" : "false");
states[npc]->print ("New", npc, current_method->max_stack,
current_method->max_locals);
}
diff --git a/libjava/win32-threads.cc b/libjava/win32-threads.cc
index 1f3d0c57b22..9e3981db3dd 100644
--- a/libjava/win32-threads.cc
+++ b/libjava/win32-threads.cc
@@ -126,7 +126,18 @@ _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint na
else if (millis == 0) time = INFINITE;
else time = millis;
- _Jv_MutexUnlock (mu);
+ // Record the current lock depth, so it can be restored
+ // when we reacquire it.
+ int count = mu->refcount;
+ int curcount = count;
+
+ // Call _Jv_MutexUnlock repeatedly until this thread
+ // has completely released the monitor.
+ while (curcount > 0)
+ {
+ _Jv_MutexUnlock (mu);
+ --curcount;
+ }
// Set up our array of three events:
// - the auto-reset event (for notify())
@@ -164,7 +175,13 @@ _Jv_CondWait(_Jv_ConditionVariable_t *cv, _Jv_Mutex_t *mu, jlong millis, jint na
if (last_waiter)
ResetEvent (cv->ev[1]);
- _Jv_MutexLock (mu);
+ // Call _Jv_MutexLock repeatedly until the mutex's refcount is the
+ // same as before we originally released it.
+ while (curcount < count)
+ {
+ _Jv_MutexLock (mu);
+ ++curcount;
+ }
return interrupted ? _JV_INTERRUPTED : 0;
}
diff --git a/libjava/win32.cc b/libjava/win32.cc
index e44b7b28729..027333be738 100644
--- a/libjava/win32.cc
+++ b/libjava/win32.cc
@@ -42,12 +42,125 @@ const char *_Jv_ThisExecutable (void)
// Helper classes and methods implementation
+#ifdef MINGW_LIBGCJ_UNICODE
+
+// We're using the OS W (UNICODE) API, which means that we're speaking
+// the same language....
+jstring
+_Jv_Win32NewString (LPCTSTR pcsz)
+{
+ return JvNewString ((jchar*) pcsz, _tcslen (pcsz));
+}
+
+#else
+
+// We're using the OS A functions, which means we need to translate between
+// UNICODE and the native character set.
+
+// First, let's set up some helper translation functions....
+
+// Converts the native string to any specified jstring, returning the
+// length of the jstring. If the specified jstring is null, we simply
+// compute and return the length.
+static int nativeToUnicode(LPCSTR pcsz, jstring jstr = 0)
+{
+ jchar* buf = 0;
+ int len = 0;
+ if (jstr)
+ {
+ len = jstr->length();
+ buf = JvGetStringChars(jstr);
+ }
+ return ::MultiByteToWideChar(GetACP(), 0, pcsz,
+ strlen(pcsz), (LPWSTR) buf, len);
+}
+
+// Does the inverse of nativeToUnicode, with the same calling semantics.
+static int unicodeToNative(jstring jstr, LPSTR buf, int buflen)
+{
+ return ::WideCharToMultiByte(GetACP(), 0, (LPWSTR) JvGetStringChars(jstr),
+ jstr->length(), buf, buflen, NULL, NULL);
+}
+
+// Convenience function when the caller only wants to compute the length
+// of the native string.
+static int unicodeToNative(jstring jstr)
+{
+ return unicodeToNative(jstr, 0, 0);
+}
+
+jstring
+_Jv_Win32NewString (LPCTSTR pcsz)
+{
+ // Compute the length, allocate the jstring, then perform the conversion.
+ int len = nativeToUnicode(pcsz);
+ jstring jstr = JvAllocString(len);
+ nativeToUnicode(pcsz, jstr);
+ return jstr;
+}
+
+#endif // MINGW_LIBGCJ_UNICODE
+
+// class _Jv_Win32TempString
+_Jv_Win32TempString::_Jv_Win32TempString(jstring jstr):
+ buf_(0)
+{
+ if (jstr == 0)
+ return;
+
+ // We need space for the string length plus a null terminator.
+ // Determine whether to use our stack-allocated buffer or a heap-
+ // allocated one.
+#ifdef MINGW_LIBGCJ_UNICODE
+ // A UNICODE character is a UNICODE character is a UNICODE character....
+ int len = jstr->length();
+#else
+ // Compute the length of the native character string.
+ int len = unicodeToNative(jstr);
+#endif // MINGW_LIBGCJ_UNICODE
+
+ int bytesNeeded = (len + 1) * sizeof(TCHAR);
+ if (bytesNeeded <= (int) sizeof(stackbuf_))
+ buf_ = stackbuf_;
+ else
+ buf_ = (LPTSTR) _Jv_Malloc(bytesNeeded);
+
+#ifdef MINGW_LIBGCJ_UNICODE
+ // Copy the UNICODE characters to our buffer.
+ _tcsncpy(buf_, (LPCTSTR) JvGetStringChars (jstr), len);
+#else
+ // Convert the UNICODE string to a native one.
+ unicodeToNative(jstr, buf_, len);
+#endif // MINGW_LIBGCJ_UNICODE
+
+ buf_[len] = 0;
+}
+
+_Jv_Win32TempString::~_Jv_Win32TempString()
+{
+ if (buf_ && buf_ != stackbuf_)
+ _Jv_Free (buf_);
+}
+
// class WSAEventWrapper
+WSAEventWrapper::WSAEventWrapper ():
+ m_hEvent(0),
+ m_fd(0),
+ m_dwSelFlags(0)
+{}
+
WSAEventWrapper::WSAEventWrapper (int fd, DWORD dwSelFlags):
m_hEvent(0),
- m_fd(fd),
- m_dwSelFlags(dwSelFlags)
+ m_fd(0),
+ m_dwSelFlags(0)
+{
+ init(fd, dwSelFlags);
+}
+
+void WSAEventWrapper::init(int fd, DWORD dwSelFlags)
{
+ m_fd = fd;
+ m_dwSelFlags = dwSelFlags;
m_hEvent = WSACreateEvent ();
if (dwSelFlags)
WSAEventSelect(fd, m_hEvent, dwSelFlags);
@@ -92,16 +205,17 @@ _Jv_WinStrError (LPCTSTR lpszPrologue, int nErrorCode)
if (lpszPrologue)
{
LPTSTR lpszTemp =
- (LPTSTR) _Jv_Malloc (strlen (lpszPrologue) +
- strlen (lpMsgBuf) + 3);
- strcpy (lpszTemp, lpszPrologue);
- strcat (lpszTemp, ": ");
- strcat (lpszTemp, lpMsgBuf);
- ret = JvNewStringLatin1 (lpszTemp);
+ (LPTSTR) _Jv_Malloc ((_tcslen (lpszPrologue) +
+ _tcslen (lpMsgBuf) + 3) * sizeof(TCHAR) );
+ _tcscpy (lpszTemp, lpszPrologue);
+ _tcscat (lpszTemp, _T(": "));
+ _tcscat (lpszTemp, lpMsgBuf);
+ ret = _Jv_Win32NewString (lpszTemp);
+ _Jv_Free (lpszTemp);
}
else
{
- ret = JvNewStringLatin1 (lpMsgBuf);
+ ret = _Jv_Win32NewString (lpMsgBuf);
}
LocalFree(lpMsgBuf);
@@ -143,14 +257,17 @@ _Jv_platform_initialize (void)
// Initialise winsock for networking
WSADATA data;
if (WSAStartup (MAKEWORD (1, 1), &data))
- MessageBox (NULL, "Error initialising winsock library.", "Error",
+ MessageBox (NULL, _T("Error initialising winsock library."), _T("Error"),
MB_OK | MB_ICONEXCLAMATION);
// Install exception handler
SetUnhandledExceptionFilter (win32_exception_handler);
- // Initialize our executable name
- GetModuleFileName(NULL, exec_name, sizeof(exec_name));
+ // Initialize our executable name.
+ // FIXME: We unconditionally use the ANSI function because
+ // _Jv_ThisExecutable returns a const char*. We should really
+ // change _Jv_ThisExecutable to return a jstring.
+ GetModuleFileNameA(NULL, exec_name, sizeof(exec_name));
}
// gettimeofday implementation.
@@ -177,21 +294,58 @@ __mingwthr_key_dtor (DWORD, void (*) (void *))
return 0;
}
+static bool dirExists (LPCTSTR dir)
+{
+ DWORD dwAttrs = ::GetFileAttributes (dir);
+ return dwAttrs != 0xFFFFFFFF &&
+ (dwAttrs & FILE_ATTRIBUTE_DIRECTORY) != 0;
+}
+
+static void getUserHome(LPTSTR userHome, LPCTSTR userId)
+{
+ LPTSTR uh = _tgetenv (_T("USERPROFILE"));
+ if (uh)
+ {
+ _tcscpy(userHome, uh);
+ }
+ else
+ {
+ // Make a half-hearted attempt to support this
+ // legacy version of Windows. Try %WINDIR%\Profiles\%USERNAME%
+ // and failing this, use %WINDIR%.
+ //
+ // See:http://java.sun.com/docs/books/tutorial/security1.2/summary/files.html#UserPolicy
+ //
+ // To do this correctly, we'd have to factor in the
+ // Windows version, but if we did that, then this attempt
+ // wouldn't be half-hearted.
+ TCHAR userHomePath[MAX_PATH], winHome[MAX_PATH];
+ ::GetWindowsDirectory(winHome, MAX_PATH);
+ // assume this call always succeeds
+
+ _stprintf(userHomePath, _T("%s\\Profiles\\%s"), winHome, userId);
+ if (dirExists (userHomePath))
+ _tcscpy(userHome, userHomePath);
+ else
+ _tcscpy(userHome, winHome);
+ }
+}
+
// Set platform-specific System properties.
void
_Jv_platform_initProperties (java::util::Properties* newprops)
{
// A convenience define.
#define SET(Prop,Val) \
- newprops->put(JvNewStringLatin1 (Prop), JvNewStringLatin1 (Val))
+ newprops->put(JvNewStringLatin1 (Prop), _Jv_Win32NewString (Val))
- SET ("file.separator", "\\");
- SET ("path.separator", ";");
- SET ("line.separator", "\r\n");
+ SET ("file.separator", _T("\\"));
+ SET ("path.separator", _T(";"));
+ SET ("line.separator", _T("\r\n"));
// Use GetCurrentDirectory to set 'user.dir'.
DWORD buflen = MAX_PATH;
- char *buffer = (char *) _Jv_MallocUnchecked (buflen);
+ TCHAR buffer[buflen];
if (buffer != NULL)
{
if (GetCurrentDirectory (buflen, buffer))
@@ -199,43 +353,18 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
if (GetTempPath (buflen, buffer))
SET ("java.io.tmpdir", buffer);
-
- _Jv_Free (buffer);
}
// Use GetUserName to set 'user.name'.
buflen = 257; // UNLEN + 1
- buffer = (char *) _Jv_MallocUnchecked (buflen);
- if (buffer != NULL)
- {
- if (GetUserName (buffer, &buflen))
- SET ("user.name", buffer);
- _Jv_Free (buffer);
- }
+ TCHAR userName[buflen];
+ if (GetUserName (userName, &buflen))
+ SET ("user.name", userName);
- // According to the api documentation for 'GetWindowsDirectory()', the
- // environmental variable HOMEPATH always specifies the user's home
- // directory or a default directory. On the 3 windows machines I checked
- // only 1 had it set. If it's not set, JDK1.3.1 seems to set it to
- // the windows directory, so we'll do the same.
- char *userHome = NULL;
- if ((userHome = ::getenv ("HOMEPATH")) == NULL )
- {
- // Check HOME since it's what I use.
- if ((userHome = ::getenv ("HOME")) == NULL )
- {
- // Not found - use the windows directory like JDK1.3.1 does.
- char *winHome = (char *) _Jv_MallocUnchecked (MAX_PATH);
- if (winHome != NULL)
- {
- if (GetWindowsDirectory (winHome, MAX_PATH))
- SET ("user.home", winHome);
- _Jv_Free (winHome);
- }
- }
- }
- if (userHome != NULL)
- SET ("user.home", userHome);
+ // Set user.home
+ TCHAR userHome[MAX_PATH];
+ getUserHome(userHome, userName);
+ SET ("user.home", userHome);
// Get and set some OS info.
OSVERSIONINFO osvi;
@@ -243,41 +372,39 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx (&osvi))
{
- char *buffer = (char *) _Jv_MallocUnchecked (30);
if (buffer != NULL)
{
- sprintf (buffer, "%d.%d", (int) osvi.dwMajorVersion,
+ _stprintf (buffer, _T("%d.%d"), (int) osvi.dwMajorVersion,
(int) osvi.dwMinorVersion);
SET ("os.version", buffer);
- _Jv_Free (buffer);
}
switch (osvi.dwPlatformId)
{
case VER_PLATFORM_WIN32_WINDOWS:
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
- SET ("os.name", "Windows 95");
+ SET ("os.name", _T("Windows 95"));
else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
- SET ("os.name", "Windows 98");
+ SET ("os.name", _T("Windows 98"));
else if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
- SET ("os.name", "Windows Me");
+ SET ("os.name", _T("Windows Me"));
else
- SET ("os.name", "Windows ??");
+ SET ("os.name", _T("Windows ??"));
break;
case VER_PLATFORM_WIN32_NT:
if (osvi.dwMajorVersion <= 4 )
- SET ("os.name", "Windows NT");
+ SET ("os.name", _T("Windows NT"));
else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0)
- SET ("os.name", "Windows 2000");
+ SET ("os.name", _T("Windows 2000"));
else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
- SET ("os.name", "Windows XP");
+ SET ("os.name", _T("Windows XP"));
else
- SET ("os.name", "Windows NT ??");
+ SET ("os.name", _T("Windows NT ??"));
break;
default:
- SET ("os.name", "Windows UNKNOWN");
+ SET ("os.name", _T("Windows UNKNOWN"));
break;
}
}
@@ -288,23 +415,23 @@ _Jv_platform_initProperties (java::util::Properties* newprops)
switch (si.wProcessorArchitecture)
{
case PROCESSOR_ARCHITECTURE_INTEL:
- SET ("os.arch", "x86");
+ SET ("os.arch", _T("x86"));
break;
case PROCESSOR_ARCHITECTURE_MIPS:
- SET ("os.arch", "mips");
+ SET ("os.arch", _T("mips"));
break;
case PROCESSOR_ARCHITECTURE_ALPHA:
- SET ("os.arch", "alpha");
+ SET ("os.arch", _T("alpha"));
break;
- case PROCESSOR_ARCHITECTURE_PPC:
- SET ("os.arch", "ppc");
+ case PROCESSOR_ARCHITECTURE_PPC:
+ SET ("os.arch", _T("ppc"));
break;
case PROCESSOR_ARCHITECTURE_IA64:
- SET ("os.arch", "ia64");
+ SET ("os.arch", _T("ia64"));
break;
case PROCESSOR_ARCHITECTURE_UNKNOWN:
default:
- SET ("os.arch", "unknown");
+ SET ("os.arch", _T("unknown"));
break;
}
}
@@ -332,20 +459,15 @@ backtrace (void **__array, int __size)
}
int
-_Jv_select (int n, fd_set *readfds, fd_set *writefds,
- fd_set *exceptfds, struct timeval *timeout)
+_Jv_pipe (int filedes[2])
{
- int r = ::select (n, readfds, writefds, exceptfds, timeout);
- if (r == SOCKET_ERROR)
- {
- DWORD dwErrorCode = WSAGetLastError ();
- throw new java::io::IOException (_Jv_WinStrError (dwErrorCode));
- }
- return r;
+ return _pipe (filedes, 4096, _O_BINARY);
}
-int
-_Jv_pipe (int filedes[2])
+void
+_Jv_platform_close_on_exec (HANDLE h)
{
- return _pipe (filedes, 4096, _O_BINARY);
+ // Mark the handle as non-inheritable. This has
+ // no effect under Win9X.
+ SetHandleInformation (h, HANDLE_FLAG_INHERIT, 0);
}
diff --git a/libobjc/ChangeLog b/libobjc/ChangeLog
index 3032e7a40dd..f900eafd570 100644
--- a/libobjc/ChangeLog
+++ b/libobjc/ChangeLog
@@ -1,3 +1,10 @@
+2003-12-01 Zack Weinberg <zack@codesourcery.com>
+
+ PR 11433
+ * Protocol.m (descriptionForInstanceMethod): Don't dereference
+ instance_methods if it's NULL.
+ (descriptionForClassMethod): Likewise for class_methods.
+
2003-10-24 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Makefile.in (runtime-info.h): Remove -Wp.
@@ -36,14 +43,14 @@ Thu Jul 10 10:27:43 2003 Nicola Pero <n.pero@mi.flashnet.it>
(objc_msg_lookup): Similar fixes.
(__objc_init_install_dtable): Lock the runtime before checking if the
table is installed.
-
+
2003-05-23 Nathanael Nerode <neroden@gcc.gnu.org>
* hash.c, init.c, libobjc.def, libobjc_entry.c, linking.m,
makefile.dos, misc.c, nil_method.c, objects.c, sarray.c,
selector.c, sendmsg.c, thr-dce.c, thr-decosf1.c, thr-irix.c,
thr-mach.c, thr-objc.c, thr-os2.c, thr-posix.c, thr-pthreads.c,
- thr-rtems.c, thr-single.c, thr-solaris.c, thr-vxworks.c,
+ thr-rtems.c, thr-single.c, thr-solaris.c, thr-vxworks.c,
thr-win32.c, thr.c: Replace "GNU CC" with "GCC".
* Makefile.in, NXConstStr.m, Object.m, Protocol.m, archive.c,
class.c, encoding.c, gc.c, objc/NXConstStr.h, objc/Object.h,
@@ -52,14 +59,14 @@ Thu Jul 10 10:27:43 2003 Nicola Pero <n.pero@mi.flashnet.it>
objc/thr.h, objc/typedstream.h: Replace "GNU CC" with "GCC".
Tue May 13 14:56:03 2003 Richard Frith-Macdonald <rfm@gnu.org>
- Nicola Pero <n.pero@mi.flashnet.it>
+ Nicola Pero <n.pero@mi.flashnet.it>
libobjc/10742
* init.c (class_superclass_of_class): New function.
(create_tree_of_subclasses_inherited_from): Use it.
(__objc_tree_insert_class): Likewise.
(class_is_subclass_of_class): Likewise.
-
+
2003-04-11 David Chad <davidc@freebsd.org>
Loren J. Rittle <ljrittle@acm.org>
diff --git a/libobjc/Protocol.m b/libobjc/Protocol.m
index 8191dc21535..06a25acabbe 100644
--- a/libobjc/Protocol.m
+++ b/libobjc/Protocol.m
@@ -80,11 +80,12 @@ struct objc_method_description_list {
const char* name = sel_get_name (aSel);
struct objc_method_description *result;
- for (i = 0; i < instance_methods->count; i++)
- {
- if (!strcmp ((char*)instance_methods->list[i].name, name))
- return &(instance_methods->list[i]);
- }
+ if (instance_methods)
+ for (i = 0; i < instance_methods->count; i++)
+ {
+ if (!strcmp ((char*)instance_methods->list[i].name, name))
+ return &(instance_methods->list[i]);
+ }
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
{
@@ -107,11 +108,12 @@ struct objc_method_description_list {
const char* name = sel_get_name (aSel);
struct objc_method_description *result;
- for (i = 0; i < class_methods->count; i++)
- {
- if (!strcmp ((char*)class_methods->list[i].name, name))
- return &(class_methods->list[i]);
- }
+ if (class_methods)
+ for (i = 0; i < class_methods->count; i++)
+ {
+ if (!strcmp ((char*)class_methods->list[i].name, name))
+ return &(class_methods->list[i]);
+ }
for (proto_list = protocol_list; proto_list; proto_list = proto_list->next)
{
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index a1ef2daa3d5..a5becacb17b 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,1633 @@
+2003-12-30 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/13369
+ * include/bits/locale_facets.tcc (__verify_grouping):
+ Fix to deal properly with __grouping_tmp.size() >
+ __grouping.size().
+ * testsuite/22_locale/num_get/get/char/13.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/13.cc: Ditto.
+
+2003-12-29 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/locale_facets.h (ctype.narrow,widen): Add cast.
+
+2003-12-29 Paolo Carlini <pcarlini@suse.de>
+
+ * acinclude.m4 (GLIBCXX_CHECK_LFS): Add -fno-exceptions
+ to CXXFLAGS.
+ * aclocal.m4: Regenerate.
+ * configure: Likewise.
+
+2003-12-29 Mark Mitchell <mark@codesourcery.com>
+
+ * acconfig.h: Add _GLIBCXX_USE_C99_MATH.
+ * acinclude.m4 (GLIBCXX_ENABLE_C99): Define GLIBCXX_USE_C99_MATH.
+ * configure.ac: Define HAVE_S_ISREG and HAVE_S_IFREG when
+ targeting newlib.
+ * aclocal.m4: Regenerated.
+ * config.h.in: Likewise.
+ * configure: Likewise.
+ * Makefile.in: Likewise.
+ * include/Makefile.in: Likewise.
+ * libmath/Makefile.in: Likewise.
+ * libsupc++/Makefile.in: Likewise.
+ * testsuite/Makefile.in: Likewise.
+ * src/Makefile.in: Likewise.
+ * po/Makefile.in: Likewise.
+ * include/c_std/std_cmath.h (_GLIBCXX_USE_C99): Replace with ...
+ (_GLIBCXX_USE_C99_MATH): ... this.
+
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc: XFAIL for
+ arm-none-elf.
+ * testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc: Likewise.
+ * testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc: Likewise.
+ * testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc: Likewise.
+ * testsuite/27_io/basic_istream/readsome/char/6476-2.cc: Likewise.
+ * testsuite/27_io/objects/char/9.cc: Likewise.
+ * testsuite/ext/stdio_filebuf/char/10063-2.cc: Likewise.
+
+2003-12-28 Paolo Carlini <pcarlini@suse.de>
+
+ * include/ext/pool_allocator.h (class __pool_alloc): Use
+ operator new and operator delete.
+
+2003-12-24 Mark Mitchell <mark@codesourcery.com>
+
+ * 27_io/basic_filebuf/close/char/4879.cc: Skip on newlib targets.
+ * 27_io/basic_filebuf/close/char/9964.cc: Likewise.
+ * 27_io/basic_filebuf/imbue/char/13171-2.cc: Likewise.
+ * 27_io/basic_filebuf/open/char/9507.cc: Likewise.
+ * 27_io/basic_filebuf/showmanyc/char/9533-1.cc: Likewise.
+ * 27_io/basic_filebuf/underflow/char/10097.cc: Likewise.
+ * 27_io/objects/char/7.cc: Likewise.
+ * 27_io/objects/char/9661-1.cc: Likewise.
+
+2003-12-24 Andrew Pinski <pinskia@physics.uc.edu>
+
+ * config/cpu/i386/atomicity.h (__exchange_and_add): Fix output
+ constraint.
+
+ PR libstdc++/13480
+ * config/cpu/i386/atomicity.h: Split up read-write memory operand.
+
+2003-12-23 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/ext/new_allocator.h (new_allocator): Proper allocator class.
+ (__new_alloc): Delete.
+ * include/ext/malloc_allocator.h (malloc_allocator): Same.
+ (__malloc_alloc): Delete.
+ * include/ext/mt_allocator.h: Same, but weakly.
+ * include/ext/debug_allocator.h: Convert to the new style.
+ * include/ext/pool_allocator.h: Use global new and delete directly.
+ * include/backward/alloc.h: Don't inject malloc_allocator, or
+ debug_allocator.
+ * testsuite/ext/allocators.cc: Minimal fixups for usage of new
+ classes. Comment out tests with __pool_alloc for now.
+ * testsuite/performance/allocator.cc: Same.
+
+2003-12-22 Matt Austern <austern@apple.com>
+
+ * include/bits/stl_bvector.h (_Bvector_alloc_base): Eliminate.
+ (_Bvector_base): Inherit directly from word allocator.
+ * include/bits/stl_tree.h (_Rb_tree_alloc_base): Eliminate.
+ (_Rb_tree_base): Eliminate.
+ (_Rb_tree): Inherit directly from node allocator.
+ * include/ext/slist (_Alist_alloc_base): Eliminate.
+ (_Slist_base): Inherit direcly from node allocator.
+
+2003-12-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/18_support/numeric_limits.cc: Add _GLIBCXX_ASSERT to
+ dg-options in testcases that use VERIFY.
+ * testsuite/23_containers/vector/invalidation/1.cc: Same.
+ * testsuite/23_containers/vector/invalidation/2.cc: Same.
+ * testsuite/23_containers/vector/invalidation/3.cc: Same.
+ * testsuite/23_containers/vector/invalidation/4.cc: Same.
+ * testsuite/23_containers/vector/resize/1.cc: Same.
+ * testsuite/26_numerics/complex_value.cc: Same.
+ * testsuite/27_io/ios_base/storage/1.cc: Same.
+ * testsuite/27_io/ios_base/storage/2.cc: Same.
+ * testsuite/27_io/ios_base/storage/3.cc: Same.
+ * testsuite/27_io/manipulators/standard/char/2.cc: Same.
+ * testsuite/backward/11460.cc: Same.
+ * testsuite/backward/strstream_members.cc: Same.
+
+ * include/ext/hash_set (class hash_multiset): Fix typo.
+
+2003-12-22 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/27_io/objects/char/5.cc: Don't use stdc++.h.gch.
+ * testsuite/27_io/objects/wchar_t/5.cc: Same.
+ * docs/html/test.html: Add docs for constructing test files that
+ don't use stdc++.h.gch.
+ * scripts/testsuite_flags.in (PCHFLAGS): Move to --cxxpchflags.
+ * testsuite/libstdc++-dg/normal.exp: Compute DEFAULT_CXXFLAGS
+ differently.
+
+ * include/bits/ios_base.h (ios_base::Init::_S_initialized): Remove.
+ * src/ios_init.cc: Same.
+ * config/linker-map.gnu: Same.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Adjust line numbers.
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Same.
+
+2003-12-22 Andrew Pinski <pinskia@physics.uc.edu>
+
+ PR libstdc++/13462
+ * include/bits/stl_multiset.h (__gnu_norm::multiset): Define pointer
+ as allocator's pointer, likewise for reference, const_pointer, and
+ const_reference.
+ * include/bits/stl_set.h (__gnu_norm::set): Likewise.
+ * include/ext/hash_set (__gnu_ext::hash_set): Likewise.
+ (__gnu_ext::hash_multiset): Likewise.
+
+2003-12-22 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_int,
+ num_get::_M_extract_float): According to 22.2.2.1.2, p8-9,
+ first look for decimal_point and thousands_sep, when parsing
+ sign, leading zeros (and 0, Ox, 0X for integer types) too.
+ * testsuite/22_locale/num_get/get/char/12.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/12.cc: Likewise.
+
+ * testsuite/22_locale/num_get/get/char/11.cc: Add a comment.
+ * testsuite/22_locale/num_get/get/wchar_t/11.cc: Likewise.
+
+2003-12-20 Jason Merrill <jason@redhat.com>
+
+ * config/cpu/powerpc/atomicity.h: Fix oversight in previous
+ change.
+
+2003-12-20 Jerry Quinn <jlquinn@optonline.net>
+
+ * docs/doxygen/TODO: Update.
+ * include/bits/locale_classes.h (locale, facet, id): Document.
+ * include/bits/locale_facets.tcc (has_facet, use_facet): Document.
+
+2003-12-19 Jason Merrill <jason@redhat.com>
+
+ * config/cpu/cris/atomicity.h: Remove memory clobbers.
+ * config/cpu/mips/atomicity.h: Likewise.
+ * config/cpu/i486/atomicity.h: Remove memory clobbers.
+ Split up read-write memory operand.
+ * config/cpu/m68k/atomicity.h: Likewise.
+ * config/cpu/powerpc/atomicity.h: Make memory I/O explicit.
+ * config/cpu/s390/atomicity.h: Likewise.
+ * config/cpu/sparc/atomicity.h: Likewise.
+
+2003-12-20 Carlo Wood <carlo@alinoe.com>
+
+ * bits/demangle.h
+ namespace __gnu_cxx::demangler
+ (session<Allocator>::decode_encoding): Put the postfix
+ of the return type of (member) functions after the function
+ instead of after the return type.
+
+2003-12-19 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/locale_facet.h
+ (__ctype_abstract_base,ctype<charT>,ctype<char>,ctype<wchar_t>):
+ Document.
+
+2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_int,
+ num_get::_M_extract_float): According to 22.2.2.1.2, p8-9,
+ first look for decimal_point and thousands_sep.
+ * testsuite/22_locale/num_get/get/char/11.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/11.cc: Likewise.
+
+2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ When __found_sci becomes true stop eating thousands separators
+ and the decimal radix separator.
+ * testsuite/22_locale/num_get/get/char/9.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/9.cc: Likewise.
+
+ * config/locale/generic/c_locale.cc (__convert_to_v): Don't
+ check that *__sanity == '\0': parsing may stop earlier, still
+ be successful.
+ * config/locale/gnu/c_locale.cc: Likewise.
+ * testsuite/22_locale/num_get/get/char/10.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/10.cc: Likewise.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc:
+ Tweak in one place accordingly.
+
+ * testsuite/22_locale/money_get/get/char/1.cc: Fix typo.
+ * testsuite/22_locale/money_get/get/wchar_t/1.cc: Likewise.
+
+2003-12-18 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/stl_list.h: Formatting tweaks.
+ * include/bits/list.tcc: Same.
+
+2003-12-18 Matt Austern <austern@apple.com>
+
+ * include/bits/demangle.h: Fix allocator type correctness,
+ i.e. make sure that when we instantiate a container with a value
+ type and an allocator, the allocator's value type matches the
+ container's.
+ * include/bits/stl_deque.h (_Deque_alloc_base): Eliminate.
+ (_Deque_base): inherit directly from the deque's allocator. Use
+ rebinding instead of _Alloc_traits. Pick up data members from
+ _Deque_alloc_base.
+ * include/bits/stl_list.h (_List_alloc_base): Eliminate.
+ (_List_base): Inherit directly from the list's allocator. Use
+ rebinding instead of _Alloc_traits. Pick up data members from
+ _List_alloc_base.
+ * include/bits/stl_vector.h (_Vector_alloc_base): Eliminate
+ (_Vector_base): Inherit directly from the vector's allocator. Use
+ rebinding instead of _Alloc_traits. Pick up data members from
+ _Vector_alloc_base.
+ * include/ext/hashtable.h: Fix allocator type correctness (the
+ vector of buckets must be passed an allocator for objects of
+ type _Node*). Use rebinding instead of _Alloc_traits.
+
+2003-12-17 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_get::_M_extract_via_format):
+ Use narrow to get from __format[__i] a char __c representing a
+ formatting code, don't use it to compare *__beg to __format[__i].
+ * testsuite/22_locale/time_get/get_date/wchar_t/4.cc: New.
+
+2003-12-17 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/performance/container_benchmark.cc: Tweak outputs.
+
+ * testsuite/performance/list_create_fill_sort.cc: Shrink a
+ bit some outputs.
+
+ * testsuite/testsuite_performance.h: Widen a few output fields.
+
+ * testsuite/performance/ifstream_extract_int.cc: New.
+
+2003-12-16 Phil Edwards <phil@codesourcery.com>
+
+ * configure.ac (AM_INIT_AUTOMAKE): Don't warn about GNU Make.
+ * configure: Regenerated.
+ * Makefile.am (check-%): New catch-all forwarding target.
+ * Makefile.in: Regenerated.
+
+2003-12-16 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/performance/container_benchmark.cc: New, a
+ benchmark developed by Bjarne Stroustrup and Alexander
+ Stepanov and made available with no restrictions.
+
+ * testsuite/testsuite_performance.h (report_header): New,
+ useful to produce header lines in the reports.
+
+2003-12-16 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/21_strings/howto.html: Document shrink-to-fit reserve().
+ * docs/html/faq/index.html: Reducing vector's capacity() to size().
+ * docs/html/documentation.html, docs/html/faq/index.txt: Regenerate.
+
+2003-12-16 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/performance/narrow_widen_char.cc: Tweak the
+ number of iterations for each test.
+ * testsuite/performance/narrow_widen_wchar_t.cc: Add a
+ missing clear_counters.
+
+2003-12-16 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/11723
+ * include/bits/locale_facets.h: Add _M_bit and _M_wmask,
+ used to speed up the computation of ctype::do_is.
+ * config/locale/generic/ctype_members.cc
+ (_M_initialize_ctype): Fill _M_bit and _M_wmask.
+ (ctype::do_is): Use _M_bit and _M_wmask.
+ * config/locale/gnu/ctype_members.cc: Likewise.
+ * testsuite/performance/is_wchar_t.cc: New.
+
+ * testsuite/performance/narrow_widen_wchar_t.cc: Tweak
+ string literal (incorrect citation ;)
+
+ * include/bits/locale_facets.h: Minor tweaks, const
+ correctness, unsigned -> size_t.
+
+2003-12-16 Jerry Quinn <jlquinn@optonline.net>
+
+ * include/bits/locale_facets.h (widen, narrow): Uncomment the
+ intended code.
+
+2003-12-15 Jerry Quinn <jlquinn@optonline.net>
+
+ * config/os/aix/ctype_noninline.h,
+ config/os/bsd/freebsd/ctype_noninline.h,
+ config/os/bsd/netbsd/ctype_noninline.h,
+ config/os/djgpp/ctype_noninline.h,
+ config/os/generic/ctype_noninline.h,
+ config/os/gnu-linux/ctype_noninline.h,
+ config/os/hpux/ctype_noninline.h,
+ config/os/irix/irix5.2/ctype_noninline.h,
+ config/os/irix/irix6.5/ctype_noninline.h,
+ config/os/mingw32/ctype_noninline.h,
+ config/os/newlib/ctype_noninline.h,
+ config/os/qnx/qnx6.1/ctype_noninline.h,
+ config/os/solaris/solaris2.5/ctype_noninline.h,
+ config/os/solaris/solaris2.6/ctype_noninline.h,
+ config/os/solaris/solaris2.7/ctype_noninline.h,
+ config/os/vxworks/ctype_noninline.h,
+ config/os/windiss/ctype_noninline.h (ctype): Initialize
+ _M_narrow, _M_widen.
+ * include/bits/locale_facets.h (_M_widen, _M_widen_ok,
+ _M_narrow, _M_narrow_ok): New.
+ (widen, narrow): Use tables to bypass virtual functions.
+ (_M_widen_init, _M_narrow_init): New.
+
+2003-12-15 Carlo Wood <carlo@alinoe.com>
+
+ * include/bits/ios_base.h (Init::_S_initialized): Change into
+ declaration.
+ * src/ios_init.cc (Init::_S_initialized): Add definition.
+
+2003-12-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/12658
+ * include/Makefile.am (bits_headers): Add concurrence.h.
+ * include/Makefile.in: Regenerated.
+ * include/bits/concurrence.h: New.
+ * src/locale_init.cc: Use it.
+ (locale::locale): Lock critical regions.
+ (locale::global): Same.
+
+2003-12-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/basic_string.h: Change _*_references to _*_refcount.
+ * include/bits/locale_classes.h: Same.
+ * src/locale.cc: Same.
+ * src/locale_name.cc: Same.
+ * src/locale_init.cc: Same.
+
+2003-12-15 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/12855
+ * include/bits/ios_base.h (Init::_S_ios_base_init): Change to
+ _S_refcount, make atomic.
+ * src/ios.cc: Adjust definition.
+ * src/ios_init.cc (ios_base::Init::Init): Use __exchange_and_add,
+ and __atomic_add.
+ (ios_base::Init::~Init): Same.
+ * testsuite/27_io/ios_base/cons/assign_neg.cc: Adjust line numbers.
+ * testsuite/27_io/ios_base/cons/copy_neg.cc: Same.
+
+2003-12-15 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::do_get(bool&)):
+ Fail as soon as the begins of both truename and falsename
+ stop to match; always leave __beg one position beyond the
+ last char successfully matched.
+ * testsuite/22_locale/num_get/get/char/8.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/8.cc: Likewise.
+
+2003-12-15 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.h (_M_widen): Reserve space
+ for all the possible widened chars.
+ * config/locale/generic/ctype_members.cc (_M_initialize_ctype):
+ Compute at construction time all the possible widened chars.
+ (do_widen): Tweak, simplify.
+ * config/locale/gnu/ctype_members.cc: Likewise.
+ * testsuite/performance/narrow_widen_wchar_t.cc: Add tests
+ for the array versions.
+
+2003-12-12 Paolo Carlini <pcarlini@suse.de>
+ Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/13341
+ * include/bits/locale_facets.h (ctype<wchar_t>): Declare
+ _M_initialize_ctype() and _M_narrow_ok, _M_narrow and _M_widen.
+ * src/ctype.cc (ctype<wchar_t>::ctype(size_t),
+ ctype<wchar_t>::ctype(__c_locale, size_t)): Use
+ _M_initialize_ctype to fill _M_narrow and _M_widen.
+ (ctype_byname<wchar_t>::ctype_byname(const char*, size_t)):
+ Likewise.
+ * config/locale/generic/ctype_members.cc (do_narrow, do_widen)
+ Use _M_narrow and _M_widen when possible, instead of calling
+ wctob and btowc, respectively.
+ (_M_initialize_ctype): Define, it fills at construction time
+ _M_narrow and _M_widen.
+ * config/locale/gnu/ctype_members.cc: Likewise.
+ * testsuite/performance/narrow_widen_wchar_t.cc: New.
+
+2003-12-12 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/faq/index.txt: Regenerate after adding <link> tags.
+
+2003-12-11 Neil Ferguson <nferguso@eso.org>
+ Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/basic_string.tcc (reserve): Allow shrink-to-fit.
+ * testsuite/21_strings/basic_string/capacity/1.cc: Tweak.
+ * testsuite/21_strings/basic_string/capacity/char/1.cc: Ditto.
+ * testsuite/21_strings/basic_string/capacity/wchar_t/1.cc: Ditto.
+
+2003-12-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/6243
+ * testsuite/lib/libstdc++.exp (v3-init): Add
+ original_ld_library_path, calculate ld_library path, set
+ LD_LIBRARY_PATH to both. Based on libjava.exp.
+
+2003-12-10 Benjamin Kosnik <bkoz@redhat.com>
+ Alexandre Oliva <aoliva@redhat.com>
+
+ PR libstdc++/11612
+ * testsuite/Makefile.am (GLIBCXX_DIR): New.
+ (GLIBGCC_DIR): New.
+ (CXXLINK): Use both with -R so libtool links the correct libs.
+
+2003-12-10 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/13217
+ * include/bits/fstream.tcc (underflow): Deal gracefully with
+ read errors: throw ios_base::failure.
+
+2003-12-10 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/10063
+ * config/io/basic_file_stdio.cc (__basic_file::sys_open): Sync.
+ * testsuite/ext/stdio_filebuf/char/10063-1.cc: New.
+ * testsuite/ext/stdio_filebuf/char/10063-2.cc: New.
+
+2003-12-10 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_put::do_put(void*)):
+ Remove the try/catch, not necessary.
+
+2003-12-10 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/22_locale/locale/cons/12438.cc: Tweak memory
+ limit and iterations to avoid spurious failures on some
+ 64 bit machines.
+
+2003-12-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ * config/linker-map.gnu: Remove private ios_base members from
+ export list.
+
+ * config/cpu/alpha/atomicity.h: Consistently format.
+ * config/cpu/cris/atomicity.h: Same.
+ * config/cpu/generic/atomicity.h: Same.
+ * config/cpu/hppa/atomicity.h: Same.
+ * config/cpu/i386/atomicity.h: Same.
+ * config/cpu/i486/atomicity.h: Same.
+ * config/cpu/ia64/atomicity.h: Same.
+ * config/cpu/m68k/atomicity.h: Same.
+ * config/cpu/mips/atomicity.h: Same.
+ * config/cpu/powerpc/atomicity.h: Same.
+ * config/cpu/s390/atomicity.h: Same.
+ * config/cpu/sparc/atomicity.h: Same.
+
+2003-12-09 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/13296
+ * acinclude.m4 (GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS): Remove.
+ * aclocal.m4: Regenerate.
+ * configure.ac: Remove call to GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS.
+ * conigure: Regenerate.
+ * src/Makefile.am (libstdc___la_LDFLAGS): Remove LIBUNWIND_FLAGS.
+ * src/Makefile.in: Regenerate.
+ * docs/html/17_intro/configury.html: Modify.
+
+2003-12-09 Paolo Carlini <pcaelini@suse.de>
+
+ * include/bits/demangle.h (struct implementation_details):
+ Keep in comments the names of the unused parameters.
+
+2003-12-09 Paolo Carlini <pcaelini@suse.de>
+
+ * include/bits/demangle.h (struct implementation_details):
+ Fix unused parameters warning.
+
+2003-12-09 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_int):
+ Slightly streamline the code dealing with overflows and the
+ parsing of the sign.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/ext/algorithm, include/ext/debug_allocator.h,
+ include/ext/enc_filebuf.h, include/ext/functional,
+ include/ext/hash_fun.h, include/ext/hash_map, include/ext/hash_set,
+ include/ext/hashtable.h, include/ext/iterator,
+ include/ext/malloc_allocator.h, include/ext/memory,
+ include/ext/mt_allocator.h, include/ext/numeric,
+ include/ext/pod_char_traits.h, include/ext/pool_allocator.h,
+ include/ext/rb_tree, include/ext/rope, include/ext/ropeimpl.h,
+ include/ext/slist, include/ext/stdio_filebuf.h,
+ include/ext/stdio_sync_filebuf.h: Remove trailing whitespace.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/debug/bitset, include/debug/debug.h, include/debug/deque,
+ include/debug/formatter.h, include/debug/hash_map.h,
+ include/debug/hash_multimap.h, include/debug/hash_multiset.h,
+ include/debug/hash_set, include/debug/hash_set.h, include/debug/list,
+ include/debug/map.h, include/debug/multimap.h,
+ include/debug/multiset.h, include/debug/safe_base.h,
+ include/debug/safe_iterator.h, include/debug/safe_iterator.tcc,
+ include/debug/safe_sequence.h, include/debug/set.h,
+ include/debug/string, include/debug/vector: Remove trailing whitespace.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/c_compatibility/iso646.h, include/c_compatibility/limits.h,
+ include/c_compatibility/locale.h, include/c_compatibility/stdio.h,
+ include/c_compatibility/string.h, include/c_compatibility/time.h,
+ include/c_compatibility/wchar.h, include/c_compatibility/wctype.h:
+ Remove trailing whitespace.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/c_std/cmath.tcc, include/c_std/std_cassert.h,
+ include/c_std/std_cctype.h, include/c_std/std_cmath.h,
+ include/c_std/std_cstddef.h, include/c_std/std_cstdio.h,
+ include/c_std/std_cstdlib.h, include/c_std/std_cstring.h,
+ include/c_std/std_cwchar.h, include/c_std/std_cwctype.h:
+ Remove trailing whitespace.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/c/std_cctype.h, include/c/std_cmath.h,
+ include/c/std_cstdlib.h include/c/std_cwchar.h,
+ include/c/std_cwctype.h: Remove trailing whitespace.
+
+2003-12-09 Bernardo Innocenti <bernie@develer.com>
+
+ * include/backward/algo.h, include/backward/algobase.h,
+ include/backward/alloc.h, include/backward/complex.h,
+ include/backward/defalloc.h, include/backward/function.h,
+ include/backward/iterator.h, include/backward/new.h,
+ include/backward/ostream.h, include/backward/queue.h,
+ include/backward/rope.h, include/backward/stream.h,
+ include/backward/streambuf.h, include/backward/strstream,
+ include/backward/tempbuf.h, include/backward/tree.h,
+ include/backward/vector.h: Remove trailing whitespace.
+
+2003-12-08 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/generic/c_locale.cc (__convert_to_v(long&),
+ __convert_to_v(unsigned long&), __convert_to_v(long long&),
+ __convert_to_v(unsigned long long&): Remove.
+ (__convert_to_v(float&), __convert_to_v(double&),
+ __convert_to_v(long double&)): Remove last unused parameter.
+ * config/locale/gnu/c_locale.cc: Likewise.
+ * include/bits/locale_facets.h: Likewise.
+ (num_get::_M_extract_int): Update declaration.
+ (class __num_base): Tweak _S_ie and _S_iE according to the
+ _S_atoms_in changes.
+ * include/bits/locale_facets.tcc (num_get::_M_extract_int):
+ Provide directly the final _ValueT, not a string: accumulate
+ the result checking for overflow at each digit.
+ (num_get::do_get(bool&), num_get::do_get(long&),
+ num_get::do_get(unsigned short&), num_get::do_get(unsigned int&),
+ num_get::do_get(unsigned long&), num_get::do_get(long long&),
+ num_get::do_get(unsigned long long&), num_get::do_get(void*&)):
+ Use the new _M_extract_int, simplify.
+ * src/locale-inst.cc (num_get::_M_extract_int(long&),
+ num_get::_M_extract_int(unsigned short&),
+ num_get::_M_extract_int(unsigned int&),
+ num_get::_M_extract_int(unsigned long&),
+ num_get::_M_extract_int(long long&),
+ num_get::_M_extract_int(unsigned long long&): Instantiate.
+ * src/locale_facets.cc (__num_base::_S_atoms_in): Reorder
+ the chars in the natural order: abcdefABCDEF.
+
+2003-12-08 David S. Miller <davem@redhat.com>
+
+ PR libstdc++/12496
+ * config/cpu/sparc/atomicity.h (__exchange_and_add, __atomic_add):
+ Extend increment to _Atomic_word before giving to assembler.
+
+2003-12-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ * testsuite/ext/enc_filebuf/char/13189.cc: Guard for __enc_traits.
+ * testsuite/ext/enc_filebuf/wchar_t/13189.cc: Same.
+
+2003-12-06 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/11691
+ * include/ext/stdio_filebuf.h (stdio_filebuf::stdio_filebuf):
+ Remove __del argument to file descriptor constructor.
+ * config/io/basic_file_stdio.h (__basic_file::sys_open): Remove
+ bool argument.
+ * config/io/basic_file_stdio.cc: Same.
+
+2003-12-05 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/13189
+ * include/ext/enc_filebuf.h: Fix.
+ * include/bits/fstream.tcc: Tweak formatting.
+ * include/bits/postypes.h: Same.
+ * include/bits/sstream.tcc: Same.
+ * include/bits/streambuf.tcc: Same.
+ * testsuite/ext/stdio_filebuf.cc: Split.
+ * testsuite/ext/stdio_filebuf_2.cc: Split.
+ * testsuite/ext/stdio_sync_filebuf_char.cc: Split.
+ * testsuite/ext/stdio_sync_filebuf_wchar_t.cc: Split.
+ * testsuite/ext/enc_filebuf/char/13189.cc: New.
+ * testsuite/ext/enc_filebuf/wchar_t/13189.cc: New.
+ * testsuite/ext/stdio_filebuf/char/1.cc: New.
+ * testsuite/ext/stdio_filebuf/char/2.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/char/1.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/char/12048-1.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/char/12048-2.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/char/12048-3.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/char/12048-4.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/1.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-1.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-2.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-3.cc: New.
+ * testsuite/ext/stdio_sync_filebuf/wchar_t/12948-4.cc: New.
+
+2003-12-05 Carlo Wood <carlo@alinoe.com>
+
+ PR libstdc++/13045
+ * bits/demangle.h
+ namespace __gnu_cxx::demangler
+ (enum substitution_nt): Removed trailing comma.
+ (implementation_details): Added.
+ (session<Allocator>::M_implementation_details): Added.
+ (session<Allocator>::session): Pass implementation_details.
+ (session<Allocator>::decode_encoding): Same.
+ (session<Allocator>::decode_real): Added.
+ (_GLIBCXX_DEMANGLER_STYLE_VOID _GLIBCXX_DEMANGLER_STYLE_LITERAL
+ _GLIBCXX_DEMANGLER_STYLE_LITERAL_INT
+ _GLIBCXX_DEMANGLER_STYLE_COMPACT_EXPR_OPS
+ _GLIBCXX_DEMANGLER_STYLE_SIZEOF_TYPENAME): Replaced with
+ implementation_details equivalent.
+ (session<Allocator>::decode_expression):
+ Use M_implementation_details instead of macros. Add extra parentheses
+ around 'larger than' operator in expressions in template arguments.
+ (session<Allocator>::decode_bare_function_type): Idem.
+ (session<Allocator>::decode_literal):
+ Idem, and call decode_real for floating literals.
+ (session<Allocator>::decode_type_with_postfix): Put the postfix
+ of the return type of (member) functions after the function
+ instead of after the return type. Also, put a space after the
+ prefix of qualified function pointers: "int (* const<space>".
+ * src/demangle.cc: include most dependent header file first.
+ * testsuite/demangle/regression/cw-16.cc: Updated two
+ and added three tests.
+
+2003-12-04 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/13284
+ * include/bits/stl_algo.h (__random_number): Remove.
+ (random_shuffle): Use rand, as permitted by DR 395.
+ * include/ext/algorithm: Same.
+ * linkage.m4 (GLIBCXX_CHECK_STDLIB_SUPPORT): Remove lrand48.
+ * acconfig.h: Same.
+ * crossconfig.m4: Remove HAVE_DRAND48, HAVE_LRAND48.
+ * config.h.in: Regenerated.
+ * configure: Same.
+ * aclocal.m4: Same.
+
+2003-12-04 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12653
+ * include/std/std_bitset.h (operator>>): Implement resolution
+ of DR 303 [WP]: use widen('0') and widen('1').
+ * docs/html/ext/howto.html: Add an entry for DR 303.
+
+ * include/std/std_bitset.h (operator>>): Implement the common
+ requirements of formatted input functions (27.6.1.2.1).
+
+ * include/std/std_bitset.h (operator>>): Set the failbit when
+ nothing was extracted and _Nb != 0.
+ * testsuite/23_containers/bitset/input/1.cc: New.
+
+2003-12-03 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12791
+ * include/bits/locale_facets.tcc (time_get::_M_extract_num):
+ Rewrite, stop the parsing as soon as a digit cannot possibly
+ lead to a final number within the bounds; otherwise, simplify,
+ avoiding __ctype.is() and atoi().
+ * testsuite/22_locale/time_get/get_date/char/12791.cc: New.
+ * testsuite/22_locale/time_get/get_date/wchar_t/12791.cc: New.
+
+ * include/bits/locale_facets.tcc (time_get::_M_extract_via_format):
+ Minor tweak: a 4-digit integer cannot be bigger than 9999.
+
+ * testsuite/22_locale/time_get/get_date/wchar_t/1.cc: Use
+ type-correct wchar_t string literals.
+ * testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc: Ditto.
+ * testsuite/22_locale/time_get/get_time/wchar_t/1.cc: Ditto.
+ * testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc: Ditto.
+ * testsuite/22_locale/time_get/get_year/wchar_t/1.cc: Ditto.
+
+2003-12-02 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_get::do_get_year):
+ Avoid using a basic_string and calling a full blown strtol
+ (via __convert_to_v) for simple 2 or 4 digits, base 10,
+ positive integers; simplify.
+
+2003-12-02 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/monetary_members.cc
+ (money_base::_S_construct_pattern): For case 3: and 4:
+ exchanging 'if (__precedes)' and 'if (__space)' allows
+ to factor out a few more assignments.
+
+2003-12-01 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/basic_ios.h (basic_ios::setstate): Revert.
+ * include/bits/istream.tcc: Only call setstate if __err != goodbit.
+ * include/bits/ostream.tcc: Same.
+ * testsuite/27_io/basic_ios/exceptions/char/2.cc: New.
+
+ * testsuite/testsuite_io.h (__gnu_test::fail_streambuf): Make
+ internal buffer non-static.
+
+2003-12-01 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/17_intro/C++STYLE: Add exception bits.
+ * include/bits/fstream.tcc: Add location info to exception strings.
+
+ * include/bits/stl_construct.h: Formatting tweaks.
+
+2003-12-01 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/10378
+ * include/bits/allocator.h (allocator::construct): Implement
+ resolution of DR 402 [Ready] (in Revision 28).
+ * include/bits/allocator_traits.h (__allocator::construct):
+ Likewise.
+ * include/bits/stl_construct.h (_Construct): Likewise.
+ * testsuite/20_util/allocator_members.cc: Move to...
+ * testsuite/20_util/allocator/1.cc: ... here.
+ * testsuite/20_util/allocator/10378.cc: New.
+ * docs/html/ext/howto.html: Add an entry for DR 402.
+
+2003-11-30 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/codecvt_members.cc (codecvt::do_in,
+ codecvt::do_length): More minor tweaks.
+
+2003-11-30 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/codecvt_members.cc (codecvt::do_in):
+ Minor stylistic tweak.
+
+2003-11-30 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_put::do_put(..., bool)):
+ Minor tweaks, consistent with the style used in other facets.
+
+2003-11-29 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/fstream.tcc (underflow): Minor tweaks in
+ preparation for libstdc++/13217.
+
+2003-11-29 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc:
+ Tweak for a few small problems (fix timings, use VERIFY..)
+
+2003-11-28 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc: Remove.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc: New,
+ the original third testcase for libstdc++/13171 belong here.
+
+2003-11-28 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc:
+ Remove extraneous wchar_t lines.
+
+2003-11-27 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/11544
+ PR libstdc++/11603
+ * include/bits/fstream.tcc (underflow): Throw ios_base::failure
+ upon incomplete or invalid byte sequences in the file.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc: New.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc: New.
+ * testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc: New.
+
+2003-11-27 Paolo Carlini <pcarlini@suse.de>
+
+ * include/std/std_streambuf.h (__copy_streambufs): Remove
+ the first, unused, basic_ios<> parameter.
+ * src/streambuf-inst.cc: Likewise.
+ * include/bits/streambuf.tcc: Likewise.
+ * include/bits/istream.tcc (operator>>(__streambuf_type*)):
+ Tweak accordingly the call.
+ * include/bits/ostream.tcc (operator<<(__streambuf_type*)):
+ Likewise.
+
+ * include/bits/streambuf.tcc (__copy_streambufs): Remove
+ redundant try/catch.
+
+2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/9371
+ PR libstdc++/9546
+ PR libstdc++/10093
+ PR libstdc++/10095
+ * include/bits/basic_ios.h (basic_ios::setstate): Elide if goodbit.
+ (basic_ios::_M_setstate): Consolidate common error handling code.
+ * include/bits/basic_ios.tcc: Tweak.
+ * include/bits/fstream.tcc: Tweak.
+ * include/bits/istream.tcc: Use _M_setstate for common exception
+ handling. Move setstate calls after catch.
+ (basic_istream::tellg): Check for exceptions thrown by streambuf
+ virtual functions.
+ (basic_istream::seekg): Same.
+ * include/bits/ostream.tcc: Same, but for ostream.
+ (basic_ostream::flush): Check for exceptions thrown by streambuf
+ virtual functions.
+ (basic_istream::tellp): Same.
+ (basic_istream::seekp): Same.
+ * include/bits/locale_facets.tcc: Tweak.
+ * include/bits/streambuf.tcc: Tweak.
+ (__copy_streambufs): Propagate exceptions.
+ * testsuite/testsuite_io.h (fail_streambuf): New.
+ (fail_num_get): New.
+ (fail_num_put): New.
+ (facet_error): New.
+ (underflow_error): New.
+ (overflow_error): New.
+ (positioning_error): New.
+ * testsuite/27_io/basic_istream/exceptions/char/9561.cc: Tweak.
+ * testsuite/27_io/basic_istream/extractors_arithmetic/char/
+ exceptions_badbit_throw.cc, exceptions_failbit.cc,
+ exceptions_failbit_throw.cc: New.
+ * testsuite/27_io/basic_istream/extractors_other/char/
+ error_failbit.cc, exceptions_badbit_throw.cc,
+ exceptions_failbit_throw.cc, exceptions_null.cc: New.
+ * testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
+ New.
+ * testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc:
+ New.
+ * testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc:
+ New.
+ * testsuite/27_io/basic_ostream/inserters_arithmetic/char/
+ exceptions_badbit_throw.cc, exceptions_failbit_throw.cc: New.
+ * testsuite/27_io/basic_ostream/inserters_other/char/
+ error_failbit.cc, exceptions_badbit_throw.cc,
+ exceptions_failbit_throw.cc, exceptions_null.cc: New.
+ * testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
+ New.
+ * testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc:
+ New.
+
+2003-11-26 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/12297
+ * include/bits/istream.tcc
+ (basic_istream::sentry::sentry): Set failbit and eofbit when eof.
+ * testsuite/27_io/basic_istream/sentry/char/12297.cc: New.
+
+2003-11-26 Paolo Carlini <pcarlini@suse.de>
+ Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/13171
+ * include/bits/fstream.tcc (imbue): Relax the conditions under
+ which the function succeeds: allow for two consecutive calls with
+ the same name; state dependent encodings are ok even after open
+ if at the beginning of the file; don't check seekoff return value
+ (pipes, cin, cout, etc...)
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-3.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/char/2.cc: Tweak comment.
+ * testsuite/27_io/basic_filebuf/imbue/char/3.cc: Likewise.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: Tweak comment.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc: Likewise.
+
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc: More
+ correctly use the UTF-8 locale appearing in the PR.
+
+2003-11-26 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.h
+ (__numpunct_cache<>::_M_cache): Avoid zeroing _M_grouping,
+ _M_truename and _M_falsename: the constructor always does
+ it immediately before the _M_cache call.
+
+2003-11-25 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/codecvt_members.cc (codecvt::do_length):
+ Rewrite, using both mbsnrtowcs and mbrtowc in a loop: the
+ former is very fast, but stops if encounters a NUL.
+ (codecvt::do_out): Tweaks.
+ (codecvt::do_in): Tweaks, improve the code dealing with errors.
+ * testsuite/performance/wchar_t_length.cc: New.
+
+2003-11-24 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/codecvt_members.cc (codecvt::do_in):
+ Rewrite, using both mbsnrtowcs and mbrtowc in a loop: the
+ former is very fast, but stops if encounters a NUL.
+ (codecvt::do_out): Tweak.
+ * testsuite/performance/wchar_t_in.cc: New.
+
+2003-11-24 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.h
+ (__numpunct_cache<>::_M_cache): Set _M_allocated at the beginning
+ in order to avoid memory leaks; simplify a bit.
+
+2003-11-24 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/streambuf_iterator.h (ostreambuf_iterator): Remove
+ non-standard throw specs.
+ * testsuite/24_iterators/istreambuf_iterator.cc: Split into...
+ * testsuite/24_iterators/istreambuf_iterator/1.cc
+ * testsuite/24_iterators/istreambuf_iterator/2.cc
+ * testsuite/24_iterators/istreambuf_iterator/2627.cc
+ * testsuite/24_iterators/ostreambuf_iterator.cc: Split into...
+ * testsuite/24_iterators/ostreambuf_iterator/1.cc
+ * testsuite/24_iterators/ostreambuf_iterator/2.cc
+
+ * testsuite/24_iterators/reverse_iterator/1.cc: Just compile,
+ don't link.
+
+ * include/bits/allocator.h: Formatting tweak.
+
+2003-11-24 Paolo Carlini <pcarlini@suse.de>
+
+ * src/locale_init.cc: Cosmetic reformatting.
+
+2003-11-23 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (__add_grouping):
+ Cosmetic reformatting.
+
+2003-11-23 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (_M_extract_float,
+ _M_extract_int): Remove a wrong comment and simplify
+ the corresponding code using char_traits::find().
+
+2003-11-22 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/monetary_members.cc
+ (money_base::_S_construct_pattern): Factor out two assignments.
+
+2003-11-22 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/istream.tcc (getline(basic_string<>&)):
+ Fix error in comment of the previous commit.
+
+2003-11-22 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12593
+ * include/bits/istream.tcc (operator>>(basic_string<>&),
+ getline(basic_string<>&)): Implement resolution of DR 91 [WP];
+ fix some minor issues with the exit conditions.
+ * docs/html/ext/howto.html: Add an entry for DR 91.
+
+2003-11-21 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/monetary_members.cc
+ (money_base::_S_construct_pattern): Factor out an assignment.
+
+2003-11-21 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12882 (partial)
+ * acinclude.m4 (GLIBCXX_CHECK_LFS): Check fseeko64
+ and ftello64 too.
+ * include/ext/stdio_sync_filebuf.h (seekoff): Use fseeko64
+ and ftello64 if available.
+ * aclocal.m4: Regenerate.
+ * configure: Ditto.
+
+2003-11-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/debug/formatter.h: Use _Tp as template argument.
+ * src/debug.cc: Same, instantiate std::size_t.
+
+2003-11-20 Benjamin Kosnik <bkoz@redhat.com>
+
+ PR libstdc++/13109
+ * include/debug/formatter.h (_Error_formatter::_M_format_word): New.
+ * src/debug.cc (__gnu_debug): Format.
+ (_Error_formatter::_M_format_word): Define, use, instantiate.
+
+2003-11-20 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/11602
+ * config/locale/gnu/codecvt_members.cc (codecvt::do_out):
+ Rewrite, using both wcsnrtombs and wcrtomb in a loop: the
+ former is very fast, but stops if encounters a NUL.
+ * testsuite/performance/wchar_t_out.cc: New, from the PR.
+
+2003-11-19 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/gnu/codecvt_members.cc (do_out): If
+ we can upper bound the total number of external chars
+ to something smaller than __to_end - __to, avoid the
+ temporary buffer, the memcopy and simplify the loop.
+ * config/locale/generic/codecvt_members.cc (do_out):
+ Likewise.
+
+2003-11-19 Andreas Tobler <a.tobler@schweiz.ch>
+
+ * testsuite/lib/libstdc++.exp: Add DYLD_LIBRARY_PATH for darwin.
+ * testsuite/libstdc++-dg/normal.exp: Add -multiply_defined suppress
+ flag.
+
+2003-11-18 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/configopts.html, docs/html/debug.html,
+ docs/html/documentation.html, docs/html/explanations.html,
+ docs/html/install.html, docs/html/17_intro/contribute.html,
+ docs/html/17_intro/howto.html, docs/html/17_intro/license.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/22_locale/messages.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/ext/sgiexts.html: Add <link> tags.
+
+2003-11-18 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12868
+ * include/bits/fstream.tcc (imbue): For encodings != -1 it's
+ always ok to imbue a new locale, provided seekoff(0, cur, ...)
+ doesn't fail, of course.
+ (underflow): In order for the above to work, deal gracefully
+ with _M_codecvt->in returning codecvt_base::error while
+ (__ilen = __iend - this->eback()) > 0: it just means __ilen
+ correctly converted internal characters before an error.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc: New.
+
+2003-11-17 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc: Fix typo in comment.
+
+2003-11-17 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/22_locale/num_put/put/char/8.cc: New test,
+ summarizing the discussion ensuing libstdc++/12988.
+ * testsuite/22_locale/num_put/put/wchar_t/8.cc: Ditto.
+
+2003-11-15 Paolo Carlini <pcarlini@suse.de>
+
+ * include/std/std_fstream.h: Tweak a comment.
+
+2003-11-15 Roger Sayle <roger@eyesopen.com>
+
+ * include/c_std/std_cmath.h: Don't import C99's float transcendentals
+ into the __gnu_cxx::__c99_binding namespace.
+ (acos, asin, atan, atan2, ceil, cosh, exp, floor, fmod, frexp,
+ ldexp, log, log10, modf, pow, sinh, tan, tanh): Implement using
+ GCC's math builtins, i.e. __builtin_foo.
+ * libmath/stubs.c (acosf, acosl, asinf, asinl, atanf, atanl,
+ ceilf, ceill, floorf, floorl, fmodf, fmodl, frexpf, frexpl,
+ ldexpf, ldexpl, modff, modfl): Provide stub implementations.
+
+2003-11-14 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/22_locale/locale/cons/12352.cc: Use
+ __gnu_test::try_named_locale.
+
+2003-11-14 Paolo Carlini <pcarlini@suse.de>
+
+ * docs/html/ext/howto.html: Add entries for DR 63, 75
+ and 305; tweak entries for DR 60 and 328.
+
+2003-11-13 Douglas Gregor <gregod@cs.rpi.edu>
+
+ * docs/html/debug.html: Users are allowed to specialize in
+ namespace __gnu_debug, unlike in the Apple version of the debug
+ mode. Clear up a confusing double-negative. Note that
+ std::basic_string does provide extra debugging capabilities, but
+ not safe iterators.
+ * include/bits/basic_string.tcc: Make sure there's never an
+ ambiguity when calling __is_null_pointer.
+ * include/debug/deque: (deque::erase) Properly handle invalidation
+ when erasing at the end of the deque.
+ * include/debug/vector: (vector::swap): Swap _M_guaranteed_capacity.
+ (vector::clear): Set the guaranteed capacity to 0.
+ * testsuite/23_containers/deque/invalidation/4.cc: (test04): Test
+ iterator invalidation when erasing at the end of the deque.
+
+2003-11-13 Paolo Carlini <pcarlini@suse.de>
+ Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/13007
+ * include/bits/fstream.tcc (imbue): Don't touch the stored
+ locale.
+ * include/std/std_streambuf.h (imbue): According to the
+ standard, base class version does nothing.
+ (pubimbue): Store the locale.
+ * testsuite/27_io/basic_filebuf/imbue/char/13007.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc: New.
+ * testsuite/27_io/basic_filebuf/imbue/char/2.cc: Tweak.
+ * testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc: Likewise.
+ * testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc: New.
+ * testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc: New.
+ * testsuite/27_io/basic_streambuf/imbue/wchar_t/13007-1.cc: New.
+ * testsuite/27_io/basic_streambuf/imbue/wchar_t/13007-2.cc: New.
+
+2003-11-13 Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/12594
+ * include/bits/ostream.tcc
+ (basic_ostream::operator<<(basic_ostream& (*)(basic_ostream&)),
+ basic_ostream::operator<<(basic_ios& (*)(basic_ios&)),
+ basic_ostream::operator<<(ios_base& (*)(ios_base&))):
+ Implement the resolution of DR 60 (TC): These are not formatted
+ output functions so don't construct sentry objects and don't
+ catch exceptions.
+ (basic_ostream::put, basic_ostream::write): Implement the
+ resolution of DR 63 (TC) by catching exceptions and setting
+ badbit.
+ (basic_ostream::flush): Implement the resolution of DR 60 (TC):
+ This is not an unformatted output function so don't construct
+ a sentry object.
+ * testsuite/testsuite_io.h (sync_streambuf): Define.
+ * testsuite/27_io/basic_ostream/flush/char/2.cc: New test.
+ * testsuite/27_io/basic_ostream/inserters_other/char/5.cc: New test.
+ * testsuite/27_io/basic_ostream/put/char/1.cc: New test.
+ * testsuite/27_io/basic_ostream/write/char/1.cc: New test.
+
+2003-11-13 Paolo Carlini <pcarlini@suse.de>
+
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1:
+ Fix, closely following the testcase included in the PR.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2: Ditto.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3: Ditto.
+ * testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4: Ditto.
+
+2003-11-13 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/17_intro/configury.html: XHTML tweak.
+
+2003-11-13 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * docs/html/debug_mode.html: XHTML fixes.
+
+2003-11-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/debug_mode.html: Update.
+ * docs/html/17_intro/TODO: Update.
+
+2003-11-12 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/c++config: Move using directive...
+ * include/debug/formatter.h: ...here.
+
+2003-11-12 Carlo Wood <carlo@alinoe.com>
+
+ PR libstdc++/12947
+ * bits/demangle.h
+ (_GLIBCXX_DEMANGLER_STYLE_COMPACT_EXPR_OPS): Added.
+ (_GLIBCXX_DEMANGLER_STYLE_SIZEOF_TYPENAME): Added.
+ (session<Allocator>::next_peek() const): Added.
+ (decode_non_negative_decimal_integer(string_type&)):
+ Renamed from decode_decimal_integer(string_type&).
+ (session<Allocator>::decode_nested_name):
+ Decode <template_param> as well.
+ (session<Allocator>::add_substitution):
+ Handle <template-param> for <nested-name>'s.
+ (enum xary_nt): Added.
+ (struct entry_st): Added member `xary_nt type' instead of `bool unary'.
+ (symbol_name_table_c): Updated for `entry_st::type' and additional
+ operators (unary `operator+' and `sizeof(type)').
+ (offset_table_c): Updated for new operators (causing a new hash map).
+ (decode_operator_name): Match the updated hash map.
+ (session<Allocator>::decode_expression):
+ Support for `sizeof ([typename] type)' (st),
+ dependent names (sr) and casting operator (cv). Handle
+ `entry_st::type'. Handle _GLIBCXX_DEMANGLER_STYLE_COMPACT_EXPR_OPS
+ and _GLIBCXX_DEMANGLER_STYLE_SIZEOF_TYPENAME.
+ (session<Allocator>::decode_type_with_postfix):
+ Support `extern "C"' function types (FY).
+ * testsuite/demangle/regression/cw-16.cc: Added tests for the
+ added functionality.
+ * testsuite/demangle/regression/3111-2.cc: sizeof now has a space
+ appended.
+
+2003-11-11 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12875
+ * include/bits/fstream.tcc (setbuf): Don't do anything
+ after open(), in particular don't discard data.
+ (_M_allocate_internal_buffer): Tweak to not allocate memory
+ in case the buffer is provided by the user via setbuf.
+ * include/ext/stdio_filebuf.h: Tweak comment.
+ * testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc: New.
+ * testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc: Likewise.
+ * testsuite/27_io/basic_filebuf/setbuf/char/2.cc: Tweak, now
+ setbuf does nothing after open().
+ * testsuite/27_io/basic_filebuf/setbuf/char/3.cc: Likewise.
+
+2003-11-11 Doug Gregor <gregod@cs.rpi.edu>
+
+ * docs/html/debug.html: Document libstdc++ debug mode.
+ * docs/html/debug_mode.html: Document libstdc++ debug mode design.
+ * docs/html/test.html: Document how to test under debug mode.
+ * docs/html/17_intro/howto.html: Document debug-mode macros.
+ * include/Makefile.am: Install debug-mode headers.
+ * src/Makefile.am: Include debug.cc.
+ * include/bits/basic_string.tcc:
+ (basic_string::_S_construct): Fix NULL pointer check.
+ (__is_null_pointer): New.
+ Add precondition annotations.
+ * include/bits/stream_iterator.h (istream_iterator,
+ ostream_iterator): Added precondition annotations.
+ * include/bits/streambuf_iterator.h (istreambuf_iterator): Ditto.
+ * include/bits/stl_queue.h (queue, priority_queue): Ditto.
+ * include/bits/stl_stack.h (stack): Ditto.
+ * include/bits/basic_string.h (basic_string): Ditto.
+ * include/bits/basic_string.tcc (basic_string): Ditto.
+ * include/std/std_memory.h (auto_ptr): Ditto.
+ * include/std/std_valarray.h (valarray): Ditto.
+ * include/bits/stl_algo.h: Added algorithm precondition
+ annotations.
+ * include/bits/stl_algobase.h: Added algorithm precondition
+ annotations.
+ * include/bits/stl_numeric.h: Ditto.
+ * include/ext/algorithm: Added algorithm precondition
+ annotations.
+ (__is_heap): Moved away from here.
+ * include/bits/stl_heap.h: Added algorithm precondition
+ annotations.
+ (__is_heap): Moved to the top of this file.
+ (__is_heap): Added iterator range overloads.
+ * testsuite/20_util/auto_ptr_neg.cc: Fix line numbers to match up
+ with changes in std_memory.h.
+ * testsuite/23_containers/list/operators/4.cc: Don't verify
+ performance guarantees when in debug mode.
+ * testsuite/23_containers/bitset/invalidation/1.cc: New.
+ * testsuite/23_containers/deque/invalidation/1.cc: New.
+ * testsuite/23_containers/deque/invalidation/2.cc: New.
+ * testsuite/23_containers/deque/invalidation/3.cc: New.
+ * testsuite/23_containers/deque/invalidation/4.cc: New.
+ * testsuite/23_containers/list/invalidation/1.cc: New.
+ * testsuite/23_containers/list/invalidation/2.cc: New.
+ * testsuite/23_containers/list/invalidation/3.cc: New.
+ * testsuite/23_containers/list/invalidation/4.cc: New.
+ * testsuite/23_containers/map/invalidation/1.cc: New.
+ * testsuite/23_containers/map/invalidation/2.cc: New.
+ * testsuite/23_containers/multimap/invalidation/1.cc: New.
+ * testsuite/23_containers/multimap/invalidation/2.cc: New.
+ * testsuite/23_containers/multiset/invalidation/1.cc: New.
+ * testsuite/23_containers/multiset/invalidation/2.cc: New.
+ * testsuite/23_containers/set/invalidation/1.cc: New.
+ * testsuite/23_containers/set/invalidation/2.cc: New.
+ * testsuite/23_containers/vector/invalidation/1.cc: New.
+ * testsuite/23_containers/vector/invalidation/2.cc: New.
+ * testsuite/23_containers/vector/invalidation/3.cc: New.
+ * testsuite/23_containers/vector/invalidation/4.cc: New.
+ * testsuite/25_algorithms/heap.cc: Don't verify
+ performance guarantees when in debug mode.
+ * include/debug/bitset: New.
+ * include/debug/debug.h: New.
+ * include/debug/deque: New.
+ * include/debug/formatter.h: New.
+ * include/debug/hash_map: New.
+ * include/debug/hash_map.h: New.
+ * include/debug/hash_multimap.h: New.
+ * include/debug/hash_set: New.
+ * include/debug/hash_set.h: New.
+ * include/debug/hash_multiset.h: New.
+ * include/debug/list: New.
+ * include/debug/map: New.
+ * include/debug/map.h: New.
+ * include/debug/multimap.h: New.
+ * include/debug/multiset.h: New.
+ * include/debug/safe_base.h: New.
+ * include/debug/safe_iterator.h: New.
+ * include/debug/safe_iterator.tcc: New.
+ * include/debug/safe_sequence.h: New.
+ * include/debug/set: New.
+ * include/debug/set.h: New.
+ * include/debug/string: New.
+ * include/debug/vector: New.
+ * src/debug.cc: New.
+ * config/linker-map.gnu: Add debug mode symbols.
+
+2003-11-11 Benjamin Kosnik <bkoz@redhat.com>
+
+ * src/string-inst.cc: Tweak namespaces.
+ * src/misc-inst.cc: Same.
+ * docs/html/debug.html: Edits.
+ * config/link-map.gnu: Remove cruft.
+
+ * include/bits/c++config: Add in namespace associations.
+ * include/std/std_bitset.h: Adjust namespace to __gnu_norm,
+ comment tweaks.
+ * include/bits/deque.tcc: Same.
+ * include/bits/list.tcc: Same.
+ * include/bits/stl_bvector.h: Same.
+ * include/bits/stl_deque.h: Same.
+ * include/bits/stl_list.h: Same.
+ * include/bits/stl_map.h: Same.
+ * include/bits/stl_multimap.h: Same.
+ * include/bits/stl_multiset.h: Same.
+ * include/bits/stl_set.h: Same.
+ * include/bits/stl_vector.h: Same.
+ * include/bits/vector.tcc: Same.
+
+ * include/std/std_algorithm.h: Remove markup comments.
+ * include/std/std_functional.h: Same.
+ * include/std/std_iterator.h: Same.
+ * include/std/std_numeric.h: Same.
+ * include/std/std_utility.h: Same.
+ * include/bits/stl_queue.h: Formatting tweaks.
+ * include/bits/stl_stack.h: Same.
+ * include/std/std_deque.h: Include debugging version in debug mode.
+ * include/std/std_list.h: Same.
+ * include/std/std_map.h: Same.
+ * include/std/std_set.h: Same.
+ * include/std/std_vector.h: Same.
+ * include/std/std_queue.h: Use deque, vector.
+ * include/std/std_stack.h: Same.
+
+2003-11-09 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (_M_insert_int,
+ _M_insert_float): Move a couple of vars inside an if block.
+
+2003-11-09 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12971
+ * include/bits/locale_facets.tcc
+ (money_put::do_put(..., long double)): Fix conversion
+ specification as per DR 328 [WP].
+ * testsuite/22_locale/money_put/put/char/12971.cc: Add.
+ * testsuite/22_locale/money_put/put/wchar_t/12971.cc: Ditto.
+ * docs/html/ext/howto.html: Add entry for DR 328.
+
+2003-11-08 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12967
+ * include/bits/list.tcc (merge): Implement resolution of
+ DR 300 [WP].
+ * docs/html/ext/howto.html: Add entry for DR 300; tweak entry
+ for DR 231.
+
+ * docs/html/ext/lwg-active.html, docs/html/ext/lwg-defects.html:
+ Import R27.
+
+2003-11-07 Jonathan Wakely <redi@gcc.gnu.org>
+
+ * libsupc++/vec.cc: Conform to C++STYLE.
+
+2003-11-07 Carlo Wood <carlo@alinoe.com>
+
+ PR libstdc++/12736
+ * bits/demangle.h (qualifier_list<Allocator>::decode_KVrA): Added.
+ (qualifier_list<Allocator>::decode_qualifiers): Collect concatenated
+ K, V, r and A qualifiers before processing them as a group.
+ * testsuite/demangle/abi_text/01.cc: Reordered CV-qualifiers.
+ * testsuite/demangle/regression/cw-16.cc: New.
+
+2003-11-07 Robert Millan <robertmh@gnu.org>
+
+ * configure.host: Add kfreebsd*-gnu and knetbsd*-gnu.
+ * crossconfig.m4: Likewise.
+ * configure: Regenerate.
+
+2003-11-07 Carlo Wood <carlo@alinoe.com>
+
+ * include/bits/demangle.h
+ (qualifier_list<Allocator>::decode_qualifiers(string_type&,
+ string_type&, bool member_function_pointer_qualifiers):
+ Always separate the '[' of an array type with a space from
+ what is left of it, except when that is the closing bracket
+ of another array dimension.
+
+2003-11-07 Carlo Wood <carlo@alinoe.com>
+
+ * include/bits/demangle.h
+ (qualifier_list<Allocator>::decode_qualifiers(string_type&,
+ string_type&, bool) const): Made const.
+ (qualifier_list<Allocator>::M_printing_suppressed): Added mutable.
+ (_GLIBCXX_DEMANGLER_DOUT_ENTERING3, _GLIBCXX_DEMANGLER_RETURN3,
+ std::ostream& operator<<(std::ostream&, qualifier const&),
+ std::ostream& operator<<(std::ostream&, qualifier_list const&),
+ qualifier_list<Allocator>::decode_qualifiers(string_type&,
+ string_type&, bool) const,
+ session<Allocator>::decode_type_with_postfix(string_type&,
+ string_type&, qualifier_list<Allocator>*))
+ Added and/or changed debug-only hooks and code.
+
+2003-11-04 Jeffrey D. Oldham <oldham@codesourcery.com>
+
+ * libsupc++/vec.cc (__cxa_vec_delete2): If given a NULL pointer,
+ immediately return. This reflects a C++ ABI change 2003 Nov 03.
+ (__cxa_vec_delete3): Likewise.
+
+2003-11-03 Petur Runolfsson <peturr02@ru.is>
+
+ PR libstdc++/12790
+ * include/bits/fstream.tcc: Delete _M_last_overflowed.
+ (basic_filebuf::basic_filebuf): Initialize _M_state_last.
+ (basic_filebuf::open, basic_filebuf::close): Assign
+ _M_state_beg to _M_state_cur and _M_state_last.
+ (basic_filebuf::close): Call _M_terminate_output to handle
+ unshift and flushing.
+ (basic_filebuf::underflow): Assign _M_state_last, throw
+ exception instead of calling abort when codecvt::max_length()
+ is bad.
+ (basic_filebuf::seekoff): Use _M_state_last when calling
+ codecvt::length(), pass correct state to _M_seek.
+ (basic_filebuf::seekpos): Pass __pos.state() to _M_seek.
+ (basic_filebuf::_M_seek): Add __state_type parameter,
+ set _M_state_cur correctly, store the resulting state in
+ the return value and use _M_terminate_output to handle
+ flushing and unshift.
+ (basic_filebuf::_M_terminate_output): Flush contents of
+ output buffer, if any, then call codecvt::unshift as
+ needed and output the result.
+ (basic_filebuf::sync): Move here, don't modify _M_writing
+ or _M_reading.
+
+ * include/std/std_fstream.h
+ (basic_filebuf::_M_state_last): Declare it.
+ (basic_filebuf::_M_last_overflowed): Delete.
+ (basic_filebuf::_M_seek): Add __state_type parameter.
+ (basic_filebuf::sync): Declare only.
+ (basic_filebuf::_M_output_unshift): Delete.
+ (basic_filebuf::_M_terminate_output): Declare it.
+
+ * testsuite/testsuite_character.h:
+ Define character class and state class plus char_traits and
+ codecvt specializations for same for testing support for
+ stateful encodings.
+
+ * testsuite/27_io/basic_filebuf/close/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/close/char/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/close/char/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/close/char/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/close/char/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/close/wchar_t/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/close/wchar_t/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/close/wchar_t/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/close/wchar_t/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/open/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc,
+ * testsuite/27_io/basic_filebuf/sync/char/1.cc,
+ * testsuite/27_io/basic_filebuf/sync/wchar_t/1.cc:
+ New tests.
+
+ * testsuite/27_io/basic_filebuf/3.cc,
+ * testsuite/27_io/basic_filebuf/seekoff/10132-2.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/10132-3.cc,
+ * testsuite/27_io/basic_fstream/3.cc,
+ * testsuite/27_io/basic_ifstream/3.cc,
+ * testsuite/27_io/basic_ofstream/3.cc:
+ Use streamoff as off_type and fpos<state_type> as pos_type.
+
+ * testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc,
+ * testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc:
+ Check that sync does *not* set _M_writing to false.
+
+2003-11-03 Anthony Green <green@redhat.com>
+
+ * libmath/stubs.c (sqrtf, sqrtl): Reorder so they appear before
+ they're used.
+
+2003-11-03 Benjamin Kosnik <bkoz@redhat.com>
+
+ * include/bits/locale_facets.h (time_get::_M_extract_name): Add
+ ctype argument.
+ * include/bits/locale_facets.tcc: Same, use it to allow
+ capitalized names.
+
+ * include/bits/fstream.tcc: Spacing tweak.
+ * include/bits/istream.tcc: Same.
+ * include/bits/ostream.tcc: Same.
+
+2003-10-30 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_get::_M_extract_via_format):
+ __mod is only assigned, never used its value, remove it.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_get::do_get_year):
+ Absolutely avoid dereferencing end iterators.
+ (time_put::put): Minor clean up.
+
+ * include/bits/locale_facets.tcc: Cosmetic reformattings.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ Revert the last commit, is not correct, sorry.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
+ * config/locale/generic/c_locale.cc: Add back <cmath> and
+ <cstdlib>.
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ Clean up.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_put::put): Absolutely
+ avoid dereferencing end iterators; clean up.
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float,
+ num_get::_M_extract_int): Minor tweak.
+
+2003-10-29 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc: Remove some unnecessary
+ includes.
+ * config/locale/generic/c_locale.cc: Include <cerrno> here.
+ * config/locale/gnu/c_locale.cc: Likewise.
+
+2003-10-28 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc
+ (money_get<>::do_get(..., string_type&)): Absolutely avoid
+ dereferencing end iterators; general clean up.
+
+2003-10-28 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (time_get::_M_extract_num):
+ Absolutely avoid dereferencing end iterators.
+ (time_get::_M_extract_name): Likewise.
+
+ * include/bits/locale_facets.tcc
+ (time_get::_M_extract_via_format, case 'e'): Don't try to
+ be smart wrt returning the right __beg in case of parse
+ error, time_get::_M_extract_num must be fixed instead.
+
+2003-10-27 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12778
+ * acinclude.m4 (GLIBCXX_CHECK_LFS): Use the C++ compiler.
+ * aclocal.m4: Regenerate.
+ * configure: Regenerate.
+
+2003-10-27 Benjamin Kosnik <bkoz@redhat.com>
+
+ * docs/html/17_intro/TODO: Add links.
+ * testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc:
+ Uncomment.
+
+2003-10-27 Paolo Carlini <pcarlini@suse.de>
+
+ PR libstdc++/12750
+ * include/bits/locale_facets.tcc
+ (time_get::_M_extract_via_format): Deal with code 'e'.
+ * testsuite/22_locale/time_get/get_date/char/12750.cc: New.
+ * testsuite/22_locale/time_get/get_date/wchar_t/12750.cc: Ditto.
+
+ * include/bits/locale_facets.tcc
+ (time_get::_M_extract_via_format): Tweak to absolutely avoid
+ dereferencing end iterators.
+
+ * include/bits/locale_facets.h (__verify_grouping):
+ Const-ify second parameter.
+ * include/bits/locale_facets.tcc (__verify_grouping): Ditto.
+ * src/locale-inst.cc (__verify_grouping): Ditto.
+
+2003-10-27 Paolo Carlini <pcarlini@suse.de>
+
+ * include/bits/locale_facets.tcc (num_get::_M_extract_float):
+ Various things: 1- Avoid absolutely end iterator dereferences;
+ 2- Improve performance-wise the code skipping leading zeros;
+ 3- Fix two bugs wrt early bail out in case of parsing errors
+ (see testcases); 4- General clean up.
+ (num_get::_M_extract_int): Likewise, except 3-. Additionally,
+ use __builtin_expect to favor base 10 inputs.
+ * testsuite/22_locale/num_get/get/char/7.cc: New.
+ * testsuite/22_locale/num_get/get/wchar_t/7.cc: Ditto.
+
2003-10-26 Paolo Carlini <pcarlini@suse.de>
* testsuite/22_locale/money_put/put/char/1.cc: Clean up.
@@ -4621,7 +6251,8 @@
2003-04-09 Benjamin Kosnik <bkoz@redhat.com>
- Reshuffle 27_io testsuite. * testsuite/27_io/filebuf.cc,
+ Reshuffle 27_io testsuite.
+ * testsuite/27_io/filebuf.cc,
filebuf_members-1.tst, filebuf_members-1.txt, filebuf_members.cc,
filebuf_virtuals-1.tst, filebuf_virtuals-1.txt,
filebuf_virtuals-2.tst, filebuf_virtuals-3.tst,
diff --git a/libstdc++-v3/Makefile.am b/libstdc++-v3/Makefile.am
index 040b8da7c9f..75c799d0a72 100644
--- a/libstdc++-v3/Makefile.am
+++ b/libstdc++-v3/Makefile.am
@@ -52,6 +52,10 @@ doxygen-man:
.PHONY: doxygen doxygen-maint doxygen-man
+# Handy forwarding targets.
+check-%:
+ cd testsuite && $(MAKE) $@
+
# Multilib support.
MAKEOVERRIDES=
diff --git a/libstdc++-v3/Makefile.in b/libstdc++-v3/Makefile.in
index cdf063be8b3..6e1353193b5 100644
--- a/libstdc++-v3/Makefile.in
+++ b/libstdc++-v3/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -80,8 +80,6 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
-FPOS_H = @FPOS_H@
-FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
@@ -110,7 +108,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -291,13 +288,14 @@ RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
-DIST_COMMON = README $(top_srcdir)/fragment.am ../ABOUT-NLS ../COPYING \
+DIST_COMMON = README $(srcdir)/Makefile.in $(srcdir)/configure \
+ $(top_srcdir)/fragment.am ../ABOUT-NLS ../COPYING \
../COPYING.LIB ../ChangeLog ../README ../config.guess \
../config.rpath ../config.sub ../configure ../configure.in \
../install-sh ../ltcf-c.sh ../ltcf-cxx.sh ../ltcf-gcj.sh \
../ltconfig ../ltmain.sh ../missing ../mkinstalldirs ../ylwrap \
- ChangeLog Makefile.am Makefile.in acconfig.h acinclude.m4 \
- aclocal.m4 config.h.in configure configure.ac
+ ChangeLog Makefile.am acconfig.h acinclude.m4 aclocal.m4 \
+ config.h.in configure configure.ac
DIST_SUBDIRS = include libmath libsupc++ src po testsuite
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive
@@ -577,7 +575,7 @@ distcleancheck: distclean
exit 1; } >&2
check-am: all-am
check: check-recursive
-all-am: Makefile config.h
+all-am: Makefile all-multi config.h
installdirs: installdirs-recursive
installdirs-am:
@@ -592,7 +590,7 @@ install-am: all-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -600,17 +598,18 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
-clean: clean-recursive
+clean: clean-multi clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
-distclean: distclean-recursive
+distclean: distclean-multi distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+ -rm -f Makefile
distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
distclean-tags
@@ -624,7 +623,7 @@ info-am:
install-data-am:
-install-exec-am:
+install-exec-am: install-multi
install-info: install-info-recursive
@@ -632,12 +631,13 @@ install-man:
installcheck-am:
-maintainer-clean: maintainer-clean-recursive
+maintainer-clean: maintainer-clean-multi maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
-mostlyclean: mostlyclean-recursive
+mostlyclean: mostlyclean-multi mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
@@ -653,23 +653,24 @@ uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
- clean-generic clean-libtool clean-recursive ctags \
- ctags-recursive dist dist-all dist-gzip distcheck distclean \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-recursive distclean-tags distcleancheck distdir \
- distuninstallcheck dvi dvi-am dvi-recursive info info-am \
- info-recursive install install-am install-data install-data-am \
- install-data-recursive install-exec install-exec-am \
- install-exec-recursive install-info install-info-am \
- install-info-recursive install-man install-recursive \
- install-strip installcheck installcheck-am installdirs \
- installdirs-am installdirs-recursive maintainer-clean \
- maintainer-clean-generic maintainer-clean-recursive mostlyclean \
- mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \
- pdf pdf-am pdf-recursive ps ps-am ps-recursive tags \
- tags-recursive uninstall uninstall-am uninstall-info-am \
- uninstall-info-recursive uninstall-recursive
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-multi check \
+ check-am clean clean-generic clean-libtool clean-multi \
+ clean-recursive ctags ctags-recursive dist dist-all dist-gzip \
+ distcheck distclean distclean-generic distclean-hdr \
+ distclean-libtool distclean-multi distclean-recursive \
+ distclean-tags distcleancheck distdir distuninstallcheck dvi \
+ dvi-am dvi-recursive info info-am info-recursive install \
+ install-am install-data install-data-am install-data-recursive \
+ install-exec install-exec-am install-exec-recursive \
+ install-info install-info-am install-info-recursive install-man \
+ install-multi install-recursive install-strip installcheck \
+ installcheck-am installdirs installdirs-am \
+ installdirs-recursive maintainer-clean maintainer-clean-generic \
+ maintainer-clean-multi maintainer-clean-recursive mostlyclean \
+ mostlyclean-generic mostlyclean-libtool mostlyclean-multi \
+ mostlyclean-recursive pdf pdf-am pdf-recursive ps ps-am \
+ ps-recursive tags tags-recursive uninstall uninstall-am \
+ uninstall-info-am uninstall-info-recursive uninstall-recursive
@GLIBCXX_HOSTED_TRUE@ # Possibly libmath as well...
@@ -695,6 +696,10 @@ doxygen-man:
.PHONY: doxygen doxygen-maint doxygen-man
+# Handy forwarding targets.
+check-%:
+ cd testsuite && $(MAKE) $@
+
# Multilib support.
.PHONY: all-multi mostlyclean-multi clean-multi distclean-multi \
maintainer-clean-multi
diff --git a/libstdc++-v3/acconfig.h b/libstdc++-v3/acconfig.h
index df110cd073f..0137c83d6c8 100644
--- a/libstdc++-v3/acconfig.h
+++ b/libstdc++-v3/acconfig.h
@@ -16,6 +16,9 @@
// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCXX_USE_LONG_LONG
+// Define if C99 math functions (like fpclassify) should be exposed.
+#undef _GLIBCXX_USE_C99_MATH
+
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
@@ -63,9 +66,6 @@
// Define if gthr-default.h exists (meaning that threading support is enabled).
#undef HAVE_GTHR_DEFAULT
-// Define if lrand48 exists.
-#undef HAVE_DRAND48
-
// Define if getpagesize exists.
#undef HAVE_GETPAGESIZE
diff --git a/libstdc++-v3/acinclude.m4 b/libstdc++-v3/acinclude.m4
index a1b532ad7a6..93bb23874a3 100644
--- a/libstdc++-v3/acinclude.m4
+++ b/libstdc++-v3/acinclude.m4
@@ -593,10 +593,19 @@ dnl
dnl Check whether LFS support is available.
dnl
AC_DEFUN(GLIBCXX_CHECK_LFS, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
AC_CACHE_VAL(glibcxx_cv_LFS, [
AC_TRY_LINK(
- [#include <unistd.h>],
- [fopen64("t", "w");
+ [#include <unistd.h>
+ #include <stdio.h>
+ ],
+ [FILE* fp;
+ fopen64("t", "w");
+ fseeko64(fp, 0, SEEK_CUR);
+ ftello64(fp);
lseek64(1, 0, SEEK_CUR);],
[glibcxx_cv_LFS=yes],
[glibcxx_cv_LFS=no])
@@ -604,6 +613,8 @@ AC_DEFUN(GLIBCXX_CHECK_LFS, [
if test $glibcxx_cv_LFS = yes; then
AC_DEFINE(_GLIBCXX_USE_LFS)
fi
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
])
@@ -858,6 +869,10 @@ AC_DEFUN(GLIBCXX_ENABLE_C99, [
[isunordered(0.0,0.0);],, [ac_c99_math=no])
AC_MSG_RESULT($ac_c99_math)
+ if test x"$ac_c99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
+
# 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>])
@@ -934,6 +949,10 @@ AC_DEFUN(GLIBCXX_ENABLE_C99, [
fi;
AC_MSG_RESULT($enable_c99)
+ if test x"$ac_99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
+
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_C99)
@@ -1340,33 +1359,6 @@ AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
dnl
-dnl Check for libunwind exception handling support. If enabled, then
-dnl we assume that the _Unwind_* functions that make up the Unwind ABI
-dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
-dnl libunwind instead of libgcc, and that libstdc++ has a dependency
-dnl on libunwind as well as libgcc.
-dnl
-dnl --enable-libunwind-exceptions forces the use of libunwind.
-dnl --disable-libunwind-exceptions assumes there is no libunwind.
-dnl
-dnl Substs:
-dnl LIBUNWIND_FLAG
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
- AC_MSG_CHECKING([for use of libunwind])
- GLIBCXX_ENABLE(libunwind-exceptions,no,,
- [force use of libunwind for exceptions])
- AC_MSG_RESULT($use_libunwind_exceptions)
- if test $enable_libunwind_exceptions = yes; then
- LIBUNWIND_FLAG="-lunwind"
- else
- LIBUNWIND_FLAG=""
- fi
- AC_SUBST(LIBUNWIND_FLAG)
-])
-
-
-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.
diff --git a/libstdc++-v3/aclocal.m4 b/libstdc++-v3/aclocal.m4
index f55cbf46802..6e00fe0070d 100644
--- a/libstdc++-v3/aclocal.m4
+++ b/libstdc++-v3/aclocal.m4
@@ -1,4 +1,4 @@
-# generated automatically by aclocal 1.7.7 -*- Autoconf -*-
+# generated automatically by aclocal 1.7.9 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
@@ -606,10 +606,19 @@ dnl
dnl Check whether LFS support is available.
dnl
AC_DEFUN(GLIBCXX_CHECK_LFS, [
+ AC_LANG_SAVE
+ AC_LANG_CPLUSPLUS
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
AC_CACHE_VAL(glibcxx_cv_LFS, [
AC_TRY_LINK(
- [#include <unistd.h>],
- [fopen64("t", "w");
+ [#include <unistd.h>
+ #include <stdio.h>
+ ],
+ [FILE* fp;
+ fopen64("t", "w");
+ fseeko64(fp, 0, SEEK_CUR);
+ ftello64(fp);
lseek64(1, 0, SEEK_CUR);],
[glibcxx_cv_LFS=yes],
[glibcxx_cv_LFS=no])
@@ -617,6 +626,8 @@ AC_DEFUN(GLIBCXX_CHECK_LFS, [
if test $glibcxx_cv_LFS = yes; then
AC_DEFINE(_GLIBCXX_USE_LFS)
fi
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ AC_LANG_RESTORE
])
@@ -871,6 +882,10 @@ AC_DEFUN(GLIBCXX_ENABLE_C99, [
[isunordered(0.0,0.0);],, [ac_c99_math=no])
AC_MSG_RESULT($ac_c99_math)
+ if test x"$ac_c99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
+
# 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>])
@@ -947,6 +962,10 @@ AC_DEFUN(GLIBCXX_ENABLE_C99, [
fi;
AC_MSG_RESULT($enable_c99)
+ if test x"$ac_99_math" = x"yes"; then
+ AC_DEFINE(_GLIBCXX_USE_C99_MATH)
+ fi
+
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
AC_DEFINE(_GLIBCXX_USE_C99)
@@ -1353,33 +1372,6 @@ AC_DEFUN(GLIBCXX_ENABLE_HOSTED, [
dnl
-dnl Check for libunwind exception handling support. If enabled, then
-dnl we assume that the _Unwind_* functions that make up the Unwind ABI
-dnl (_Unwind_RaiseException, _Unwind_Resume, etc.) are defined by
-dnl libunwind instead of libgcc, and that libstdc++ has a dependency
-dnl on libunwind as well as libgcc.
-dnl
-dnl --enable-libunwind-exceptions forces the use of libunwind.
-dnl --disable-libunwind-exceptions assumes there is no libunwind.
-dnl
-dnl Substs:
-dnl LIBUNWIND_FLAG
-dnl
-AC_DEFUN(GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS, [
- AC_MSG_CHECKING([for use of libunwind])
- GLIBCXX_ENABLE(libunwind-exceptions,no,,
- [force use of libunwind for exceptions])
- AC_MSG_RESULT($use_libunwind_exceptions)
- if test $enable_libunwind_exceptions = yes; then
- LIBUNWIND_FLAG="-lunwind"
- else
- LIBUNWIND_FLAG=""
- fi
- AC_SUBST(LIBUNWIND_FLAG)
-])
-
-
-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.
@@ -2004,7 +1996,7 @@ AC_DEFUN([AM_AUTOMAKE_VERSION],[am__api_version="1.7"])
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
- [AM_AUTOMAKE_VERSION([1.7.7])])
+ [AM_AUTOMAKE_VERSION([1.7.9])])
# Helper functions for option handling. -*- Autoconf -*-
diff --git a/libstdc++-v3/config.h.in b/libstdc++-v3/config.h.in
index 8c59a317030..361cec58059 100644
--- a/libstdc++-v3/config.h.in
+++ b/libstdc++-v3/config.h.in
@@ -17,6 +17,9 @@
// Include I/O support for 'long long' and 'unsigned long long'.
#undef _GLIBCXX_USE_LONG_LONG
+// Define if C99 math functions (like fpclassify) should be exposed.
+#undef _GLIBCXX_USE_C99_MATH
+
// Define if C99 features such as lldiv_t, llabs, lldiv should be exposed.
#undef _GLIBCXX_USE_C99
@@ -64,9 +67,6 @@
// Define if gthr-default.h exists (meaning that threading support is enabled).
#undef HAVE_GTHR_DEFAULT
-// Define if lrand48 exists.
-#undef HAVE_DRAND48
-
// Define if getpagesize exists.
#undef HAVE_GETPAGESIZE
@@ -383,9 +383,6 @@
/* Define to 1 if you have the `logl' function. */
#undef HAVE_LOGL
-/* Define to 1 if you have the `lrand48' function. */
-#undef HAVE_LRAND48
-
/* Define to 1 if you have the <machine/endian.h> header file. */
#undef HAVE_MACHINE_ENDIAN_H
diff --git a/libstdc++-v3/config/cpu/alpha/atomicity.h b/libstdc++-v3/config/cpu/alpha/atomicity.h
index 8969a328e9a..cb071cdae97 100644
--- a/libstdc++-v3/config/cpu/alpha/atomicity.h
+++ b/libstdc++-v3/config/cpu/alpha/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: Alpha version -*- C++ -*-
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -39,7 +39,7 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
register int __result, __tmp;
@@ -58,7 +58,7 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result;
diff --git a/libstdc++-v3/config/cpu/cris/atomicity.h b/libstdc++-v3/config/cpu/cris/atomicity.h
index ed93b5d64d4..fecb9dc186f 100644
--- a/libstdc++-v3/config/cpu/cris/atomicity.h
+++ b/libstdc++-v3/config/cpu/cris/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: CRIS version -*- C++ -*-
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -35,7 +35,7 @@ typedef int _Atomic_word __attribute__ ((__aligned__ (4)));
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (_Atomic_word* __mem, int __val)
+__exchange_and_add(_Atomic_word* __mem, int __val)
{
int __tmp;
_Atomic_word __result;
@@ -51,8 +51,7 @@ __exchange_and_add (_Atomic_word* __mem, int __val)
" bwf 0b \n"
" clearf \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
- : "r" (__mem), "g" (__val), "m" (*__mem)
- : "memory");
+ : "r" (__mem), "g" (__val), "m" (*__mem));
#else
__asm__ __volatile__ (" move $ccr,$r9 \n"
" di \n"
@@ -63,7 +62,7 @@ __exchange_and_add (_Atomic_word* __mem, int __val)
" move $r9,$ccr \n"
: "=&r" (__result), "=m" (*__mem), "=&r" (__tmp)
: "r" (__mem), "g" (__val), "m" (*__mem)
- : "memory", "r9");
+ : "r9");
#endif
return __result;
@@ -71,9 +70,9 @@ __exchange_and_add (_Atomic_word* __mem, int __val)
static inline void
__attribute__ ((__unused__))
-__atomic_add (_Atomic_word* __mem, int __val)
+__atomic_add(_Atomic_word* __mem, int __val)
{
- __exchange_and_add (__mem, __val);
+ __exchange_and_add(__mem, __val);
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/generic/atomicity.h b/libstdc++-v3/config/cpu/generic/atomicity.h
index f2340d62512..1bee9ea6b0c 100644
--- a/libstdc++-v3/config/cpu/generic/atomicity.h
+++ b/libstdc++-v3/config/cpu/generic/atomicity.h
@@ -48,30 +48,30 @@ namespace __gnu_cxx
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
#ifndef __GTHREAD_MUTEX_INIT
- __gthread_once (&__gnu_cxx::_Atomic_add_mutex_once,
- __gnu_cxx::__gthread_atomic_add_mutex_once);
+ __gthread_once(&__gnu_cxx::_Atomic_add_mutex_once,
+ __gnu_cxx::__gthread_atomic_add_mutex_once);
#endif
_Atomic_word __result;
- __gthread_mutex_lock (&__gnu_cxx::_Atomic_add_mutex);
+ __gthread_mutex_lock(&__gnu_cxx::_Atomic_add_mutex);
__result = *__mem;
*__mem += __val;
- __gthread_mutex_unlock (&__gnu_cxx::_Atomic_add_mutex);
+ __gthread_mutex_unlock(&__gnu_cxx::_Atomic_add_mutex);
return __result;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
- (void) __exchange_and_add (__mem, __val);
+ (void) __exchange_and_add(__mem, __val);
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/hppa/atomicity.h b/libstdc++-v3/config/cpu/hppa/atomicity.h
index a717ab555a4..b07414246af 100644
--- a/libstdc++-v3/config/cpu/hppa/atomicity.h
+++ b/libstdc++-v3/config/cpu/hppa/atomicity.h
@@ -42,7 +42,7 @@ template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
static inline int
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word result;
int tmp;
@@ -67,7 +67,7 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
static inline void
__attribute__ ((__unused__))
-__atomic_add (_Atomic_word* __mem, int __val)
+__atomic_add(_Atomic_word* __mem, int __val)
{
int tmp;
volatile int& lock = __Atomicity_lock<0>::_S_atomicity_lock;
diff --git a/libstdc++-v3/config/cpu/i386/atomicity.h b/libstdc++-v3/config/cpu/i386/atomicity.h
index a370e752caf..7a949c30fa5 100644
--- a/libstdc++-v3/config/cpu/i386/atomicity.h
+++ b/libstdc++-v3/config/cpu/i386/atomicity.h
@@ -32,28 +32,29 @@
typedef int _Atomic_word;
-template <int __inst>
-struct __Atomicity_lock
-{
- static volatile _Atomic_word _S_atomicity_lock;
-};
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static volatile _Atomic_word _S_atomicity_lock;
+ };
-template <int __inst>
+template<int __inst>
volatile _Atomic_word __Atomicity_lock<__inst>::_S_atomicity_lock = 0;
template volatile _Atomic_word __Atomicity_lock<0>::_S_atomicity_lock;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result, __tmp = 1;
/* obtain the atomic exchange/add spin lock */
do {
__asm__ __volatile__ ("xchg{l} {%0,%1|%1,%0}"
- : "+m" (__Atomicity_lock<0>::_S_atomicity_lock),
- "+r" (__tmp));
+ : "=m" (__Atomicity_lock<0>::_S_atomicity_lock),
+ "+r" (__tmp)
+ : "m" (__Atomicity_lock<0>::_S_atomicity_lock));
} while (__tmp);
__result = *__mem;
@@ -67,9 +68,9 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
- __exchange_and_add (__mem, __val);
+ __exchange_and_add(__mem, __val);
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/i486/atomicity.h b/libstdc++-v3/config/cpu/i486/atomicity.h
index 51ba5410c85..06ab866bbe3 100644
--- a/libstdc++-v3/config/cpu/i486/atomicity.h
+++ b/libstdc++-v3/config/cpu/i486/atomicity.h
@@ -34,24 +34,21 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result;
__asm__ __volatile__ ("lock; xadd{l} {%0,%1|%1,%0}"
- : "=r" (__result), "+m" (*__mem)
- : "0" (__val)
- : "memory");
+ : "=r" (__result), "=m" (*__mem)
+ : "0" (__val), "m" (*__mem));
return __result;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
__asm__ __volatile__ ("lock; add{l} {%1,%0|%0,%1}"
- : "+m" (*__mem) : "ir" (__val) : "memory");
+ : "=m" (*__mem) : "ir" (__val), "m" (*__mem));
}
#endif /* atomicity.h */
-
-
diff --git a/libstdc++-v3/config/cpu/ia64/atomicity.h b/libstdc++-v3/config/cpu/ia64/atomicity.h
index 40fbc55d066..4408d06718d 100644
--- a/libstdc++-v3/config/cpu/ia64/atomicity.h
+++ b/libstdc++-v3/config/cpu/ia64/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: IA64 version -*- C++ -*-
-// Copyright (C) 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -36,16 +36,16 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
- return __sync_fetch_and_add (__mem, __val);
+ return __sync_fetch_and_add(__mem, __val);
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
- __sync_fetch_and_add (__mem, __val);
+ __sync_fetch_and_add(__mem, __val);
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/m68k/atomicity.h b/libstdc++-v3/config/cpu/m68k/atomicity.h
index c4ce17dac67..eb801dec50c 100644
--- a/libstdc++-v3/config/cpu/m68k/atomicity.h
+++ b/libstdc++-v3/config/cpu/m68k/atomicity.h
@@ -39,7 +39,7 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __result = *__mem;
register _Atomic_word __temp;
@@ -47,9 +47,8 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
"add%.l %3,%1\n\t"
"cas%.l %0,%1,%2\n\t"
"jne 1b"
- : "=d" (__result), "=&d" (__temp), "+m" (*__mem)
- : "d" (__val), "0" (__result)
- : "memory");
+ : "=d" (__result), "=&d" (__temp), "=m" (*__mem)
+ : "d" (__val), "0" (__result), "m" (*__mem));
return __result;
}
@@ -60,7 +59,7 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
*/
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __result;
short __level, __tmpsr;
@@ -77,20 +76,20 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
#else
-template <int __inst>
-struct __Atomicity_lock
-{
- static volatile unsigned char _S_atomicity_lock;
-};
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static volatile unsigned char _S_atomicity_lock;
+ };
-template <int __inst>
+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)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __result;
@@ -130,11 +129,11 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__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);
+ (void) __exchange_and_add(__mem, __val);
}
#endif /* !_GLIBCXX_ATOMICITY_H */
diff --git a/libstdc++-v3/config/cpu/mips/atomicity.h b/libstdc++-v3/config/cpu/mips/atomicity.h
index f24b059b8e9..3d0c7a10e09 100644
--- a/libstdc++-v3/config/cpu/mips/atomicity.h
+++ b/libstdc++-v3/config/cpu/mips/atomicity.h
@@ -34,7 +34,7 @@ typedef int _Atomic_word;
static inline int
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
int __result, __tmp;
@@ -52,15 +52,14 @@ __exchange_and_add (volatile _Atomic_word *__mem, int __val)
"beqz %1,1b\n\t"
"/* End exchange & add */"
: "=&r"(__result), "=&r"(__tmp), "=m"(*__mem)
- : "m" (*__mem), "r"(__val)
- : "memory");
+ : "m" (*__mem), "r"(__val));
return __result;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word *__mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
int __result;
@@ -78,8 +77,7 @@ __atomic_add (volatile _Atomic_word *__mem, int __val)
"beqz %0,1b\n\t"
"/* End atomic add */"
: "=&r"(__result), "=m"(*__mem)
- : "m" (*__mem), "r"(__val)
- : "memory");
+ : "m" (*__mem), "r"(__val));
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/powerpc/atomicity.h b/libstdc++-v3/config/cpu/powerpc/atomicity.h
index d32add0d95a..3b44b7daf92 100644
--- a/libstdc++-v3/config/cpu/powerpc/atomicity.h
+++ b/libstdc++-v3/config/cpu/powerpc/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: PowerPC version -*- C++ -*-
-// Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
+// Copyright (C) 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -40,39 +40,39 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word* __mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp, __res;
__asm__ __volatile__ (
"/* Inline exchange & add */\n"
"0:\t"
- "lwarx %0,0,%2 \n\t"
- "add%I3 %1,%0,%3 \n\t"
- _STWCX " %1,0,%2 \n\t"
+ "lwarx %0,0,%3 \n\t"
+ "add%I4 %1,%0,%4 \n\t"
+ _STWCX " %1,0,%3 \n\t"
"bne- 0b \n\t"
"/* End exchange & add */"
- : "=&b"(__res), "=&r"(__tmp)
- : "r" (__mem), "Ir"(__val)
- : "cr0", "memory");
+ : "=&b"(__res), "=&r"(__tmp), "=m" (*__mem)
+ : "r" (__mem), "Ir"(__val), "m" (*__mem)
+ : "cr0");
return __res;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word *__mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp;
__asm__ __volatile__ (
"/* Inline atomic add */\n"
"0:\t"
- "lwarx %0,0,%1 \n\t"
- "add%I2 %0,%0,%2 \n\t"
- _STWCX " %0,0,%1 \n\t"
+ "lwarx %0,0,%2 \n\t"
+ "add%I3 %0,%0,%3 \n\t"
+ _STWCX " %0,0,%2 \n\t"
"bne- 0b \n\t"
"/* End atomic add */"
- : "=&b"(__tmp)
- : "r" (__mem), "Ir"(__val)
- : "cr0", "memory");
+ : "=&b"(__tmp), "=m" (*__mem)
+ : "r" (__mem), "Ir"(__val), "m" (*__mem)
+ : "cr0");
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/s390/atomicity.h b/libstdc++-v3/config/cpu/s390/atomicity.h
index 2bb6f523cf1..8647c7635ea 100644
--- a/libstdc++-v3/config/cpu/s390/atomicity.h
+++ b/libstdc++-v3/config/cpu/s390/atomicity.h
@@ -1,6 +1,6 @@
// Low-level functions for atomic operations: S/390 version -*- C++ -*-
-// Copyright (C) 2001 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -34,25 +34,25 @@ typedef int _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
register _Atomic_word __old_val, __new_val;
- __asm__ __volatile__ (" l %0,0(%2)\n"
+ __asm__ __volatile__ (" l %0,0(%3)\n"
"0: lr %1,%0\n"
- " ar %1,%3\n"
- " cs %0,%1,0(%2)\n"
+ " ar %1,%4\n"
+ " cs %0,%1,0(%3)\n"
" jl 0b"
- : "=&d" (__old_val), "=&d" (__new_val)
- : "a" (__mem), "d" (__val) : "cc", "memory" );
+ : "=&d" (__old_val), "=&d" (__new_val), "=m" (*__mem)
+ : "a" (__mem), "d" (__val), "m" (*__mem) : "cc");
return __old_val;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word *__mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
- __exchange_and_add (__mem, __val);
+ __exchange_and_add(__mem, __val);
}
#endif /* atomicity.h */
diff --git a/libstdc++-v3/config/cpu/sparc/atomicity.h b/libstdc++-v3/config/cpu/sparc/atomicity.h
index 4c9dbf6345d..2db079c95ec 100644
--- a/libstdc++-v3/config/cpu/sparc/atomicity.h
+++ b/libstdc++-v3/config/cpu/sparc/atomicity.h
@@ -36,57 +36,57 @@ typedef long _Atomic_word;
static inline _Atomic_word
__attribute__ ((__unused__))
-__exchange_and_add (volatile _Atomic_word *__mem, int __val)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
- __asm__ __volatile__("1: ldx [%2], %0\n\t"
- " add %0, %3, %1\n\t"
- " casx [%2], %0, %1\n\t"
+ __asm__ __volatile__("1: ldx [%3], %0\n\t"
+ " add %0, %4, %1\n\t"
+ " casx [%3], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
- : "=&r" (__tmp1), "=&r" (__tmp2)
- : "r" (__mem), "r" (__val)
- : "memory");
+ : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
+ : "r" (__mem), "r" (__val_extended), "m" (*__mem));
return __tmp2;
}
static inline void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp1, __tmp2;
+ _Atomic_word __val_extended = __val;
- __asm__ __volatile__("1: ldx [%2], %0\n\t"
- " add %0, %3, %1\n\t"
- " casx [%2], %0, %1\n\t"
+ __asm__ __volatile__("1: ldx [%3], %0\n\t"
+ " add %0, %4, %1\n\t"
+ " casx [%3], %0, %1\n\t"
" sub %0, %1, %0\n\t"
" brnz,pn %0, 1b\n\t"
" nop"
- : "=&r" (__tmp1), "=&r" (__tmp2)
- : "r" (__mem), "r" (__val)
- : "memory");
+ : "=&r" (__tmp1), "=&r" (__tmp2), "=m" (*__mem)
+ : "r" (__mem), "r" (__val_extended), "m" (*__mem));
}
#else /* __arch32__ */
typedef int _Atomic_word;
-template <int __inst>
-struct __Atomicity_lock
-{
- static unsigned char _S_atomicity_lock;
-};
+template<int __inst>
+ struct __Atomicity_lock
+ {
+ static unsigned char _S_atomicity_lock;
+ };
-template <int __inst>
+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)
+__exchange_and_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __result, __tmp;
@@ -108,7 +108,7 @@ __exchange_and_add (volatile _Atomic_word* __mem, int __val)
static void
__attribute__ ((__unused__))
-__atomic_add (volatile _Atomic_word* __mem, int __val)
+__atomic_add(volatile _Atomic_word* __mem, int __val)
{
_Atomic_word __tmp;
diff --git a/libstdc++-v3/config/io/basic_file_stdio.cc b/libstdc++-v3/config/io/basic_file_stdio.cc
index 3025de52061..7d014e448b4 100644
--- a/libstdc++-v3/config/io/basic_file_stdio.cc
+++ b/libstdc++-v3/config/io/basic_file_stdio.cc
@@ -134,14 +134,14 @@ namespace std
{
_M_cfile = __file;
_M_cfile_created = false;
+ this->sync();
__ret = this;
}
return __ret;
}
__basic_file<char>*
- __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode,
- bool __del)
+ __basic_file<char>::sys_open(int __fd, ios_base::openmode __mode)
{
__basic_file* __ret = NULL;
int __p_mode = 0;
@@ -151,12 +151,9 @@ namespace std
_M_open_mode(__mode, __p_mode, __rw_mode, __c_mode);
if (!this->is_open() && (_M_cfile = fdopen(__fd, __c_mode)))
{
- // Iff __del is true, then close will fclose the fd.
- _M_cfile_created = __del;
-
+ _M_cfile_created = true;
if (__fd == 0)
setvbuf(_M_cfile, reinterpret_cast<char*>(NULL), _IONBF, 0);
-
__ret = this;
}
return __ret;
@@ -199,17 +196,17 @@ namespace std
__basic_file<char>*
__basic_file<char>::close()
{
- __basic_file* __retval = static_cast<__basic_file*>(NULL);
+ __basic_file* __ret = static_cast<__basic_file*>(NULL);
if (this->is_open())
{
if (_M_cfile_created)
fclose(_M_cfile);
else
- fflush(_M_cfile);
+ this->sync();
_M_cfile = 0;
- __retval = this;
+ __ret = this;
}
- return __retval;
+ return __ret;
}
streamsize
diff --git a/libstdc++-v3/config/io/basic_file_stdio.h b/libstdc++-v3/config/io/basic_file_stdio.h
index 212ebbe8dc7..d6a06ead739 100644
--- a/libstdc++-v3/config/io/basic_file_stdio.h
+++ b/libstdc++-v3/config/io/basic_file_stdio.h
@@ -1,6 +1,6 @@
// Wrapper of C-language FILE struct -*- C++ -*-
-// Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2000, 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -74,7 +74,7 @@ namespace std
sys_open(__c_file* __file, ios_base::openmode);
__basic_file*
- sys_open(int __fd, ios_base::openmode __mode, bool __del);
+ sys_open(int __fd, ios_base::openmode __mode);
__basic_file*
close();
diff --git a/libstdc++-v3/config/linker-map.gnu b/libstdc++-v3/config/linker-map.gnu
index adbd390e59f..79319537058 100644
--- a/libstdc++-v3/config/linker-map.gnu
+++ b/libstdc++-v3/config/linker-map.gnu
@@ -27,7 +27,15 @@ GLIBCXX_3.4 {
# Names inside the 'extern' block are demangled names.
extern "C++"
{
- std::[A-Za-k]*;
+ std::[A-Za-h]*;
+ std::i[a-n]*;
+ std::ios_base::[A-Ha-z]*;
+ std::ios_base::_M_grow_words*;
+ std::ios_base::_M_init*;
+ std::ios_base::Init::[A-Za-z]*;
+ std::ios_base::[J-Za-z]*;
+ std::i[p-z]*;
+ std::[A-Zj-k]*;
std::length_error*;
std::logic_error*;
std::locale::[A-Za-e]*;
@@ -57,7 +65,11 @@ GLIBCXX_3.4 {
std::__num_base::_S_atoms_out;
std::__moneypunct_cache*;
std::__numpunct_cache*;
- std::__timepunct_cache*
+ std::__timepunct_cache*;
+ __gnu_norm::*;
+ __gnu_debug::_Safe_iterator_base*;
+ __gnu_debug::_Safe_sequence_base*;
+ __gnu_debug::_Error_formatter*
};
# Names not in an 'extern' block are mangled names.
@@ -88,10 +100,14 @@ GLIBCXX_3.4 {
# std::locale::facet destructors
_ZNSt6locale5facetD*;
- # std::locale::_Impl constructors, destrutors
+ # std::locale::_Impl constructors, destructors
_ZNSt6locale5_ImplC*;
_ZNSt6locale5_ImplD*;
+ # std::ios_base, std::ios_base::Init destructors
+ _ZNSt8ios_baseD*;
+ _ZNSt8ios_base4InitD*;
+
# bool has_facet
_ZSt9has_facet*;
@@ -104,9 +120,6 @@ GLIBCXX_3.4 {
_ZSt21_Rb_tree_rotate_rightPSt18_Rb_tree_node_baseRS0_;
_ZSt28_Rb_tree_rebalance_for_erasePSt18_Rb_tree_node_baseRS_;
- # std::__ctype_abstract_base*
- _ZNSt21__ctype_abstract_base*;
-
# std::__codecvt_abstract_base*
_ZNStSt23__codecvt_abstract_base*;
diff --git a/libstdc++-v3/config/locale/generic/c_locale.cc b/libstdc++-v3/config/locale/generic/c_locale.cc
index a9d9537ffdb..a214e00b516 100644
--- a/libstdc++-v3/config/locale/generic/c_locale.cc
+++ b/libstdc++-v3/config/locale/generic/c_locale.cc
@@ -33,6 +33,9 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <cerrno> // For errno
+#include <cmath> // For isinf, finite, finitef, fabs
+#include <cstdlib> // For strof, strtold
#include <locale>
#ifdef _GLIBCXX_HAVE_IEEEFP_H
@@ -44,78 +47,8 @@ namespace std
// Specializations for all types used in num_get.
template<>
void
- __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
- const __c_locale&, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- long __l = strtol(__s, &__sanity, __base);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __l;
- else
- __err |= ios_base::failbit;
- }
- }
-
- template<>
- void
- __convert_to_v(const char* __s, unsigned long& __v,
- ios_base::iostate& __err, const __c_locale&, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- unsigned long __ul = strtoul(__s, &__sanity, __base);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ul;
- else
- __err |= ios_base::failbit;
- }
- }
-
-#ifdef _GLIBCXX_USE_LONG_LONG
- template<>
- void
- __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
- const __c_locale&, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- long long __ll = strtoll(__s, &__sanity, __base);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ll;
- else
- __err |= ios_base::failbit;
- }
- }
-
- template<>
- void
- __convert_to_v(const char* __s, unsigned long long& __v,
- ios_base::iostate& __err, const __c_locale&, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- unsigned long long __ull = strtoull(__s, &__sanity, __base);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ull;
- else
- __err |= ios_base::failbit;
- }
- }
-#endif
-
- template<>
- void
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
- const __c_locale&, int)
+ const __c_locale&)
{
if (!(__err & ios_base::failbit))
{
@@ -143,7 +76,7 @@ namespace std
errno = ERANGE;
#endif
#endif
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __f;
else
__err |= ios_base::failbit;
@@ -155,7 +88,7 @@ namespace std
template<>
void
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
- const __c_locale&, int)
+ const __c_locale&)
{
if (!(__err & ios_base::failbit))
{
@@ -165,7 +98,7 @@ namespace std
char* __sanity;
errno = 0;
double __d = strtod(__s, &__sanity);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __d;
else
__err |= ios_base::failbit;
@@ -177,7 +110,7 @@ namespace std
template<>
void
__convert_to_v(const char* __s, long double& __v,
- ios_base::iostate& __err, const __c_locale&, int)
+ ios_base::iostate& __err, const __c_locale&)
{
if (!(__err & ios_base::failbit))
{
@@ -188,7 +121,7 @@ namespace std
char* __sanity;
errno = 0;
long double __ld = strtold(__s, &__sanity);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __ld;
#else
typedef char_traits<char>::int_type int_type;
diff --git a/libstdc++-v3/config/locale/generic/codecvt_members.cc b/libstdc++-v3/config/locale/generic/codecvt_members.cc
index 183439de4f3..8bdc22779ad 100644
--- a/libstdc++-v3/config/locale/generic/codecvt_members.cc
+++ b/libstdc++-v3/config/locale/generic/codecvt_members.cc
@@ -49,32 +49,51 @@ namespace std
result __ret = ok;
// The conversion must be done using a temporary destination buffer
// since it is not possible to pass the size of the buffer to wcrtomb
- extern_type __buf[MB_LEN_MAX];
- // A temporary state must be used since the result of the last
- // conversion may be thrown away.
state_type __tmp_state(__state);
-
+
// The conversion must be done by calling wcrtomb in a loop rather
// than using wcsrtombs because wcsrtombs assumes that the input is
// zero-terminated.
- while (__from < __from_end && __to < __to_end)
+
+ // Either we can upper bound the total number of external characters to
+ // something smaller than __to_end - __to or the conversion must be done
+ // using a temporary destination buffer since it is not possible to
+ // pass the size of the buffer to wcrtomb
+ if (MB_CUR_MAX * (__from_end - __from) - (__to_end - __to) <= 0)
+ while (__from < __from_end)
+ {
+ const size_t __conv = wcrtomb(__to, *__from, &__tmp_state);
+ if (__conv == static_cast<size_t>(-1))
+ {
+ __ret = error;
+ break;
+ }
+ __state = __tmp_state;
+ __to += __conv;
+ __from++;
+ }
+ else
{
- size_t __conv = wcrtomb(__buf, *__from, &__tmp_state);
- if (__conv == static_cast<size_t>(-1))
- {
- __ret = error;
- break;
- }
- else if (__conv > static_cast<size_t>(__to_end - __to))
+ extern_type __buf[MB_LEN_MAX];
+ while (__from < __from_end && __to < __to_end)
{
- __ret = partial;
- break;
+ const size_t __conv = wcrtomb(__buf, *__from, &__tmp_state);
+ if (__conv == static_cast<size_t>(-1))
+ {
+ __ret = error;
+ break;
+ }
+ else if (__conv > static_cast<size_t>(__to_end - __to))
+ {
+ __ret = partial;
+ break;
+ }
+
+ memcpy(__to, __buf, __conv);
+ __state = __tmp_state;
+ __to += __conv;
+ __from++;
}
-
- memcpy(__to, __buf, __conv);
- __state = __tmp_state;
- __to += __conv;
- __from++;
}
if (__ret == ok && __from < __from_end)
diff --git a/libstdc++-v3/config/locale/generic/ctype_members.cc b/libstdc++-v3/config/locale/generic/ctype_members.cc
index 71175f14559..31666756121 100644
--- a/libstdc++-v3/config/locale/generic/ctype_members.cc
+++ b/libstdc++-v3/config/locale/generic/ctype_members.cc
@@ -135,11 +135,12 @@ namespace std
// encoding of the various categories in /usr/include/ctype.h.
const size_t __bitmasksize = 15;
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
- {
- const mask __bit = static_cast<mask>(1 << __bitcur);
- if (__m & __bit)
- __ret |= iswctype(__c, _M_convert_to_wmask(__bit));
- }
+ if (__m & _M_bit[__bitcur]
+ && iswctype(__c, _M_wmask[__bitcur]))
+ {
+ __ret = true;
+ break;
+ }
return __ret;
}
@@ -154,11 +155,8 @@ namespace std
const size_t __bitmasksize = 15;
mask __m = 0;
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
- {
- const mask __bit = static_cast<mask>(1 << __bitcur);
- if (iswctype(*__lo, _M_convert_to_wmask(__bit)))
- __m |= __bit;
- }
+ if (iswctype(*__lo, _M_wmask[__bitcur]))
+ __m |= _M_bit[__bitcur];
*__vec = __m;
}
return __hi;
@@ -185,7 +183,7 @@ namespace std
wchar_t
ctype<wchar_t>::
do_widen(char __c) const
- { return btowc(static_cast<unsigned char>(__c)); }
+ { return _M_widen[static_cast<unsigned char>(__c)]; }
const char*
ctype<wchar_t>::
@@ -193,7 +191,7 @@ namespace std
{
while (__lo < __hi)
{
- *__dest = btowc(static_cast<unsigned char>(*__lo));
+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++__lo;
++__dest;
}
@@ -204,7 +202,9 @@ namespace std
ctype<wchar_t>::
do_narrow(wchar_t __wc, char __dfault) const
{
- int __c = wctob(__wc);
+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
+ return _M_narrow[__wc];
+ const int __c = wctob(__wc);
return (__c == EOF ? __dfault : static_cast<char>(__c));
}
@@ -213,14 +213,55 @@ namespace std
do_narrow(const wchar_t* __lo, const wchar_t* __hi, char __dfault,
char* __dest) const
{
- while (__lo < __hi)
+ if (_M_narrow_ok)
+ while (__lo < __hi)
+ {
+ if (*__lo >= 0 && *__lo < 128)
+ *__dest = _M_narrow[*__lo];
+ else
+ {
+ const int __c = wctob(*__lo);
+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+ }
+ ++__lo;
+ ++__dest;
+ }
+ else
+ while (__lo < __hi)
+ {
+ const int __c = wctob(*__lo);
+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+ ++__lo;
+ ++__dest;
+ }
+ return __hi;
+ }
+
+ void
+ ctype<wchar_t>::_M_initialize_ctype()
+ {
+ wint_t __i;
+ for (__i = 0; __i < 128; ++__i)
{
- int __c = wctob(*__lo);
- *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
- ++__lo;
- ++__dest;
+ const int __c = wctob(__i);
+ if (__c == EOF)
+ break;
+ else
+ _M_narrow[__i] = static_cast<char>(__c);
}
- return __hi;
+ if (__i == 128)
+ _M_narrow_ok = true;
+ else
+ _M_narrow_ok = false;
+ for (size_t __i = 0;
+ __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
+ _M_widen[__i] = btowc(__i);
+
+ for (size_t __i = 0; __i <= 15; ++__i)
+ {
+ _M_bit[__i] = static_cast<mask>(1 << __i);
+ _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
+ }
}
#endif // _GLIBCXX_USE_WCHAR_T
}
diff --git a/libstdc++-v3/config/locale/gnu/c_locale.cc b/libstdc++-v3/config/locale/gnu/c_locale.cc
index 3c7d258e875..b808f70e5f9 100644
--- a/libstdc++-v3/config/locale/gnu/c_locale.cc
+++ b/libstdc++-v3/config/locale/gnu/c_locale.cc
@@ -33,6 +33,7 @@
// Written by Benjamin Kosnik <bkoz@redhat.com>
+#include <cerrno> // For errno
#include <locale>
#include <stdexcept>
#include <langinfo.h>
@@ -42,88 +43,15 @@ namespace std
{
template<>
void
- __convert_to_v(const char* __s, long& __v, ios_base::iostate& __err,
- const __c_locale& __cloc, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- long __l = __strtol_l(__s, &__sanity, __base, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __l;
- else
- __err |= ios_base::failbit;
- }
- }
-
- template<>
- void
- __convert_to_v(const char* __s, unsigned long& __v,
- ios_base::iostate& __err, const __c_locale& __cloc,
- int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- unsigned long __ul = __strtoul_l(__s, &__sanity, __base, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ul;
- else
- __err |= ios_base::failbit;
- }
- }
-
-#ifdef _GLIBCXX_USE_LONG_LONG
- template<>
- void
- __convert_to_v(const char* __s, long long& __v, ios_base::iostate& __err,
- const __c_locale& __cloc, int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- long long __ll = __strtoll_l(__s, &__sanity, __base, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ll;
- else
- __err |= ios_base::failbit;
- }
- }
-
- template<>
- void
- __convert_to_v(const char* __s, unsigned long long& __v,
- ios_base::iostate& __err, const __c_locale& __cloc,
- int __base)
- {
- if (!(__err & ios_base::failbit))
- {
- char* __sanity;
- errno = 0;
- unsigned long long __ull = __strtoull_l(__s, &__sanity, __base,
- __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
- __v = __ull;
- else
- __err |= ios_base::failbit;
- }
- }
-#endif
-
- template<>
- void
__convert_to_v(const char* __s, float& __v, ios_base::iostate& __err,
- const __c_locale& __cloc, int)
+ const __c_locale& __cloc)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
float __f = __strtof_l(__s, &__sanity, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __f;
else
__err |= ios_base::failbit;
@@ -133,14 +61,14 @@ namespace std
template<>
void
__convert_to_v(const char* __s, double& __v, ios_base::iostate& __err,
- const __c_locale& __cloc, int)
+ const __c_locale& __cloc)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
double __d = __strtod_l(__s, &__sanity, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __d;
else
__err |= ios_base::failbit;
@@ -150,14 +78,14 @@ namespace std
template<>
void
__convert_to_v(const char* __s, long double& __v, ios_base::iostate& __err,
- const __c_locale& __cloc, int)
+ const __c_locale& __cloc)
{
if (!(__err & ios_base::failbit))
{
char* __sanity;
errno = 0;
long double __ld = __strtold_l(__s, &__sanity, __cloc);
- if (__sanity != __s && *__sanity == '\0' && errno != ERANGE)
+ if (__sanity != __s && errno != ERANGE)
__v = __ld;
else
__err |= ios_base::failbit;
diff --git a/libstdc++-v3/config/locale/gnu/codecvt_members.cc b/libstdc++-v3/config/locale/gnu/codecvt_members.cc
index 7d800765359..3a3e324fee9 100644
--- a/libstdc++-v3/config/locale/gnu/codecvt_members.cc
+++ b/libstdc++-v3/config/locale/gnu/codecvt_members.cc
@@ -1,6 +1,6 @@
// std::codecvt implementation details, GNU version -*- C++ -*-
-// Copyright (C) 2002 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -48,49 +48,70 @@ namespace std
extern_type*& __to_next) const
{
result __ret = ok;
- // The conversion must be done using a temporary destination buffer
- // since it is not possible to pass the size of the buffer to wcrtomb
- extern_type __buf[MB_LEN_MAX];
- // A temporary state must be used since the result of the last
- // conversion may be thrown away.
state_type __tmp_state(__state);
-
+
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_codecvt);
#endif
- // The conversion must be done by calling wcrtomb in a loop rather
- // than using wcsrtombs because wcsrtombs assumes that the input is
- // zero-terminated.
- while (__from < __from_end && __to < __to_end)
+ // wcsnrtombs is *very* fast but stops if encounters NUL characters:
+ // in case we fall back to wcrtomb and then continue, in a loop.
+ // NB: wcsnrtombs is a GNU extension
+ for (__from_next = __from, __to_next = __to;
+ __from_next < __from_end && __to_next < __to_end
+ && __ret == ok;)
{
- size_t __conv = wcrtomb(__buf, *__from, &__tmp_state);
+ const intern_type* __from_chunk_end = wmemchr(__from_next, L'\0',
+ __from_end - __from_next);
+ if (!__from_chunk_end)
+ __from_chunk_end = __from_end;
+
+ __from = __from_next;
+ const size_t __conv = wcsnrtombs(__to_next, &__from_next,
+ __from_chunk_end - __from_next,
+ __to_end - __to_next, &__state);
if (__conv == static_cast<size_t>(-1))
{
+ // In case of error, in order to stop at the exact place we
+ // have to start again from the beginning with a series of
+ // wcrtomb.
+ for (; __from < __from_next; ++__from)
+ __to_next += wcrtomb(__to_next, *__from, &__tmp_state);
+ __state = __tmp_state;
__ret = error;
- break;
}
- else if (__conv > static_cast<size_t>(__to_end - __to))
+ else if (__from_next && __from_next < __from_chunk_end)
{
+ __to_next += __conv;
__ret = partial;
- break;
+ }
+ else
+ {
+ __from_next = __from_chunk_end;
+ __to_next += __conv;
}
- memcpy(__to, __buf, __conv);
- __state = __tmp_state;
- __to += __conv;
- __from++;
+ if (__from_next < __from_end && __ret == ok)
+ {
+ extern_type __buf[MB_LEN_MAX];
+ __tmp_state = __state;
+ const size_t __conv = wcrtomb(__buf, *__from_next, &__tmp_state);
+ if (__conv > static_cast<size_t>(__to_end - __to_next))
+ __ret = partial;
+ else
+ {
+ memcpy(__to_next, __buf, __conv);
+ __state = __tmp_state;
+ __to_next += __conv;
+ ++__from_next;
+ }
+ }
}
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
- if (__ret == ok && __from < __from_end)
- __ret = partial;
-
- __from_next = __from;
- __to_next = __to;
return __ret;
}
@@ -102,54 +123,77 @@ namespace std
intern_type*& __to_next) const
{
result __ret = ok;
- // This temporary state object is neccessary so __state won't be modified
- // if [__from, __from_end) is a partial multibyte character.
state_type __tmp_state(__state);
+
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_codecvt);
#endif
- // Conversion must be done by calling mbrtowc in a loop rather than
- // by calling mbsrtowcs because mbsrtowcs assumes that the input
- // sequence is zero-terminated.
- while (__from < __from_end && __to < __to_end)
+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
+ // in case we store a L'\0' and then continue, in a loop.
+ // NB: mbsnrtowcs is a GNU extension
+ for (__from_next = __from, __to_next = __to;
+ __from_next < __from_end && __to_next < __to_end
+ && __ret == ok;)
{
- size_t __conv = mbrtowc(__to, __from, __from_end - __from,
- &__tmp_state);
+ const extern_type* __from_chunk_end;
+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from_next, '\0',
+ __from_end
+ - __from_next));
+ if (!__from_chunk_end)
+ __from_chunk_end = __from_end;
+
+ __from = __from_next;
+ size_t __conv = mbsnrtowcs(__to_next, &__from_next,
+ __from_chunk_end - __from_next,
+ __to_end - __to_next, &__state);
if (__conv == static_cast<size_t>(-1))
{
+ // In case of error, in order to stop at the exact place we
+ // have to start again from the beginning with a series of
+ // mbrtowc.
+ for (;; ++__to_next, __from += __conv)
+ {
+ __conv = mbrtowc(__to_next, __from, __from_end - __from,
+ &__tmp_state);
+ if (__conv == static_cast<size_t>(-1)
+ || __conv == static_cast<size_t>(-2))
+ break;
+ }
+ __from_next = __from;
+ __state = __tmp_state;
__ret = error;
- break;
}
- else if (__conv == static_cast<size_t>(-2))
+ else if (__from_next && __from_next < __from_chunk_end)
{
- // It is unclear what to return in this case (see DR 382).
+ // It is unclear what to return in this case (see DR 382).
+ __to_next += __conv;
__ret = partial;
- break;
}
- else if (__conv == 0)
+ else
{
- // XXX Probably wrong for stateful encodings
- __conv = 1;
- *__to = L'\0';
+ __from_next = __from_chunk_end;
+ __to_next += __conv;
}
- __state = __tmp_state;
- __to++;
- __from += __conv;
+ if (__from_next < __from_end && __ret == ok)
+ {
+ if (__to_next < __to_end)
+ {
+ // XXX Probably wrong for stateful encodings
+ __tmp_state = __state;
+ ++__from_next;
+ *__to_next++ = L'\0';
+ }
+ else
+ __ret = partial;
+ }
}
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
- // It is not clear that __from < __from_end implies __ret != ok
- // (see DR 382).
- if (__ret == ok && __from < __from_end)
- __ret = partial;
-
- __from_next = __from;
- __to_next = __to;
return __ret;
}
@@ -193,39 +237,69 @@ namespace std
{
int __ret = 0;
state_type __tmp_state(__state);
+
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_codecvt);
#endif
+ // mbsnrtowcs is *very* fast but stops if encounters NUL characters:
+ // in case we advance past it and then continue, in a loop.
+ // NB: mbsnrtowcs is a GNU extension
+
+ // A dummy internal buffer is needed in order for mbsnrtocws to consider
+ // its fourth parameter (it wouldn't with NULL as first parameter).
+ wchar_t* __to = static_cast<wchar_t*>(__builtin_alloca(sizeof(wchar_t)
+ * __max));
while (__from < __end && __max)
{
- size_t __conv = mbrtowc(NULL, __from, __end - __from, &__tmp_state);
+ const extern_type* __from_chunk_end;
+ __from_chunk_end = static_cast<const extern_type*>(memchr(__from, '\0',
+ __end
+ - __from));
+ if (!__from_chunk_end)
+ __from_chunk_end = __end;
+
+ const extern_type* __tmp_from = __from;
+ size_t __conv = mbsnrtowcs(__to, &__from,
+ __from_chunk_end - __from,
+ __max, &__state);
if (__conv == static_cast<size_t>(-1))
{
- // Invalid source character
+ // In case of error, in order to stop at the exact place we
+ // have to start again from the beginning with a series of
+ // mbrtowc.
+ for (__from = __tmp_from;; __from += __conv)
+ {
+ __conv = mbrtowc(NULL, __from, __end - __from,
+ &__tmp_state);
+ if (__conv == static_cast<size_t>(-1)
+ || __conv == static_cast<size_t>(-2))
+ break;
+ }
+ __state = __tmp_state;
+ __ret += __from - __tmp_from;
break;
}
- else if (__conv == static_cast<size_t>(-2))
- {
- // Remainder of input does not form a complete destination
- // character.
- break;
- }
- else if (__conv == 0)
+ if (!__from)
+ __from = __from_chunk_end;
+
+ __ret += __from - __tmp_from;
+ __max -= __conv;
+
+ if (__from < __end && __max)
{
// XXX Probably wrong for stateful encodings
- __conv = 1;
+ __tmp_state = __state;
+ ++__from;
+ ++__ret;
+ --__max;
}
-
- __state = __tmp_state;
- __from += __conv;
- __ret += __conv;
- __max--;
}
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
+
return __ret;
}
#endif
diff --git a/libstdc++-v3/config/locale/gnu/ctype_members.cc b/libstdc++-v3/config/locale/gnu/ctype_members.cc
index a5394b53828..db01d2d3916 100644
--- a/libstdc++-v3/config/locale/gnu/ctype_members.cc
+++ b/libstdc++-v3/config/locale/gnu/ctype_members.cc
@@ -139,12 +139,12 @@ namespace std
bool __ret = false;
const size_t __bitmasksize = 11;
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
- {
- const mask __bit = static_cast<mask>(_ISbit(__bitcur));
- if (__m & __bit)
- __ret |= __iswctype_l(__c, _M_convert_to_wmask(__bit),
- _M_c_locale_ctype);
- }
+ if (__m & _M_bit[__bitcur]
+ && __iswctype_l(__c, _M_wmask[__bitcur], _M_c_locale_ctype))
+ {
+ __ret = true;
+ break;
+ }
return __ret;
}
@@ -152,19 +152,15 @@ namespace std
ctype<wchar_t>::
do_is(const wchar_t* __lo, const wchar_t* __hi, mask* __vec) const
{
- for (;__lo < __hi; ++__vec, ++__lo)
+ for (; __lo < __hi; ++__vec, ++__lo)
{
// Highest bitmask in ctype_base == 10, but extra in "C"
// library for blank.
const size_t __bitmasksize = 11;
mask __m = 0;
for (size_t __bitcur = 0; __bitcur <= __bitmasksize; ++__bitcur)
- {
- const mask __bit = static_cast<mask>(_ISbit(__bitcur));
- if (__iswctype_l(*__lo, _M_convert_to_wmask(__bit),
- _M_c_locale_ctype))
- __m |= __bit;
- }
+ if (__iswctype_l(*__lo, _M_wmask[__bitcur], _M_c_locale_ctype))
+ __m |= _M_bit[__bitcur];
*__vec = __m;
}
return __hi;
@@ -191,44 +187,31 @@ namespace std
wchar_t
ctype<wchar_t>::
do_widen(char __c) const
- {
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __c_locale __old = __uselocale(_M_c_locale_ctype);
-#endif
- wchar_t __ret = btowc(static_cast<unsigned char>(__c));
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __uselocale(__old);
-#endif
- return __ret;
- }
+ { return _M_widen[static_cast<unsigned char>(__c)]; }
const char*
ctype<wchar_t>::
do_widen(const char* __lo, const char* __hi, wchar_t* __dest) const
{
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __c_locale __old = __uselocale(_M_c_locale_ctype);
-#endif
while (__lo < __hi)
{
- *__dest = btowc(static_cast<unsigned char>(*__lo));
+ *__dest = _M_widen[static_cast<unsigned char>(*__lo)];
++__lo;
++__dest;
}
-#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
- __uselocale(__old);
-#endif
return __hi;
}
char
ctype<wchar_t>::
do_narrow(wchar_t __wc, char __dfault) const
- {
+ {
+ if (__wc >= 0 && __wc < 128 && _M_narrow_ok)
+ return _M_narrow[__wc];
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_ctype);
#endif
- int __c = wctob(__wc);
+ const int __c = wctob(__wc);
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
@@ -243,17 +226,64 @@ namespace std
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__c_locale __old = __uselocale(_M_c_locale_ctype);
#endif
- while (__lo < __hi)
+ if (_M_narrow_ok)
+ while (__lo < __hi)
+ {
+ if (*__lo >= 0 && *__lo < 128)
+ *__dest = _M_narrow[*__lo];
+ else
+ {
+ const int __c = wctob(*__lo);
+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+ }
+ ++__lo;
+ ++__dest;
+ }
+ else
+ while (__lo < __hi)
+ {
+ const int __c = wctob(*__lo);
+ *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
+ ++__lo;
+ ++__dest;
+ }
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __uselocale(__old);
+#endif
+ return __hi;
+ }
+
+ void
+ ctype<wchar_t>::_M_initialize_ctype()
+ {
+#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
+ __c_locale __old = __uselocale(_M_c_locale_ctype);
+#endif
+ wint_t __i;
+ for (__i = 0; __i < 128; ++__i)
{
- int __c = wctob(*__lo);
- *__dest = (__c == EOF ? __dfault : static_cast<char>(__c));
- ++__lo;
- ++__dest;
+ const int __c = wctob(__i);
+ if (__c == EOF)
+ break;
+ else
+ _M_narrow[__i] = static_cast<char>(__c);
+ }
+ if (__i == 128)
+ _M_narrow_ok = true;
+ else
+ _M_narrow_ok = false;
+ for (size_t __i = 0;
+ __i < sizeof(_M_widen) / sizeof(wint_t); ++__i)
+ _M_widen[__i] = btowc(__i);
+
+ for (size_t __i = 0; __i <= 11; ++__i)
+ {
+ _M_bit[__i] = static_cast<mask>(_ISbit(__i));
+ _M_wmask[__i] = _M_convert_to_wmask(_M_bit[__i]);
}
#if __GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 2)
__uselocale(__old);
#endif
- return __hi;
}
#endif // _GLIBCXX_USE_WCHAR_T
}
diff --git a/libstdc++-v3/config/locale/gnu/monetary_members.cc b/libstdc++-v3/config/locale/gnu/monetary_members.cc
index 0c03feb66fa..580297b6325 100644
--- a/libstdc++-v3/config/locale/gnu/monetary_members.cc
+++ b/libstdc++-v3/config/locale/gnu/monetary_members.cc
@@ -63,22 +63,21 @@ namespace std
case 0:
case 1:
// 1 The sign precedes the value and symbol.
+ __ret.field[0] = sign;
if (__space)
{
// Pattern starts with sign.
if (__precedes)
{
__ret.field[1] = symbol;
- __ret.field[2] = space;
__ret.field[3] = value;
}
else
{
__ret.field[1] = value;
- __ret.field[2] = space;
__ret.field[3] = symbol;
}
- __ret.field[0] = sign;
+ __ret.field[2] = space;
}
else
{
@@ -93,7 +92,6 @@ namespace std
__ret.field[1] = value;
__ret.field[2] = symbol;
}
- __ret.field[0] = sign;
__ret.field[3] = none;
}
break;
@@ -105,15 +103,14 @@ namespace std
if (__precedes)
{
__ret.field[0] = symbol;
- __ret.field[1] = space;
__ret.field[2] = value;
}
else
{
__ret.field[0] = value;
- __ret.field[1] = space;
__ret.field[2] = symbol;
}
+ __ret.field[1] = space;
__ret.field[3] = sign;
}
else
@@ -135,78 +132,70 @@ namespace std
break;
case 3:
// 3 The sign immediately precedes the symbol.
- if (__space)
+ if (__precedes)
{
- // Have space.
- if (__precedes)
+ __ret.field[0] = sign;
+ __ret.field[1] = symbol;
+ if (__space)
{
- __ret.field[0] = sign;
- __ret.field[1] = symbol;
__ret.field[2] = space;
__ret.field[3] = value;
}
else
{
- __ret.field[0] = value;
- __ret.field[1] = space;
- __ret.field[2] = sign;
- __ret.field[3] = symbol;
+ __ret.field[2] = value;
+ __ret.field[3] = none;
}
}
else
{
- // Have none.
- if (__precedes)
+ __ret.field[0] = value;
+ if (__space)
{
- __ret.field[0] = sign;
- __ret.field[1] = symbol;
- __ret.field[2] = value;
+ __ret.field[1] = space;
+ __ret.field[2] = sign;
+ __ret.field[3] = symbol;
}
else
{
- __ret.field[0] = value;
__ret.field[1] = sign;
__ret.field[2] = symbol;
+ __ret.field[3] = none;
}
- __ret.field[3] = none;
}
break;
case 4:
- // 4 The sign immediately follows the symbol.
- if (__space)
+ // 4 The sign immediately follows the symbol.
+ if (__precedes)
{
- // Have space.
- if (__precedes)
+ __ret.field[0] = symbol;
+ __ret.field[1] = sign;
+ if (__space)
{
- __ret.field[0] = symbol;
- __ret.field[1] = sign;
__ret.field[2] = space;
__ret.field[3] = value;
}
else
{
- __ret.field[0] = value;
- __ret.field[1] = space;
- __ret.field[2] = symbol;
- __ret.field[3] = sign;
+ __ret.field[2] = value;
+ __ret.field[3] = none;
}
}
else
{
- // Have none.
- if (__precedes)
+ __ret.field[0] = value;
+ if (__space)
{
- __ret.field[0] = symbol;
- __ret.field[1] = sign;
- __ret.field[2] = value;
+ __ret.field[1] = space;
+ __ret.field[2] = symbol;
+ __ret.field[3] = sign;
}
else
{
- __ret.field[0] = value;
__ret.field[1] = symbol;
__ret.field[2] = sign;
+ __ret.field[3] = none;
}
- __ret.field[3] = none;
}
break;
default:
diff --git a/libstdc++-v3/config/os/aix/ctype_noninline.h b/libstdc++-v3/config/os/aix/ctype_noninline.h
index 78fce2ef176..edd8d82f3f6 100644
--- a/libstdc++-v3/config/os/aix/ctype_noninline.h
+++ b/libstdc++-v3/config/os/aix/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
index 27cd28c082e..ec5b5753547 100644
--- a/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
+++ b/libstdc++-v3/config/os/bsd/freebsd/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
index 0cc08aef248..70bf41c22e1 100644
--- a/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
+++ b/libstdc++-v3/config/os/bsd/netbsd/ctype_noninline.h
@@ -44,13 +44,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/djgpp/ctype_noninline.h b/libstdc++-v3/config/os/djgpp/ctype_noninline.h
index 848f5e2bde7..eda2679ed3c 100644
--- a/libstdc++-v3/config/os/djgpp/ctype_noninline.h
+++ b/libstdc++-v3/config/os/djgpp/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__dj_ctype_toupper), _M_tolower(__dj_ctype_tolower),
_M_table(__table ? __table : __dj_ctype_flags)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/generic/ctype_noninline.h b/libstdc++-v3/config/os/generic/ctype_noninline.h
index 92e1173ed67..e30348e6058 100644
--- a/libstdc++-v3/config/os/generic/ctype_noninline.h
+++ b/libstdc++-v3/config/os/generic/ctype_noninline.h
@@ -43,13 +43,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
index 8d38627f7bd..ae4c14d5d58 100644
--- a/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
+++ b/libstdc++-v3/config/os/gnu-linux/ctype_noninline.h
@@ -65,6 +65,10 @@
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
}
#else
ctype<char>::ctype(__c_locale, const mask* __table, bool __del,
@@ -85,6 +89,10 @@
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_get_c_locale();
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
}
#endif
@@ -96,6 +104,10 @@
_M_toupper = _M_c_locale_ctype->__ctype_toupper;
_M_tolower = _M_c_locale_ctype->__ctype_tolower;
_M_table = __table ? __table : _M_c_locale_ctype->__ctype_b;
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
}
#else
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
@@ -115,6 +127,10 @@
setlocale(LC_CTYPE, __old);
free(__old);
_M_c_locale_ctype = _S_get_c_locale();
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
}
#endif
diff --git a/libstdc++-v3/config/os/hpux/ctype_noninline.h b/libstdc++-v3/config/os/hpux/ctype_noninline.h
index c42fd8a49ee..00e338b6e06 100644
--- a/libstdc++-v3/config/os/hpux/ctype_noninline.h
+++ b/libstdc++-v3/config/os/hpux/ctype_noninline.h
@@ -43,13 +43,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : (const mask *) __SB_masks)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h
index 2268a9b9e2c..2aeb50c658b 100644
--- a/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h
+++ b/libstdc++-v3/config/os/irix/irix5.2/ctype_noninline.h
@@ -43,13 +43,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? classic_table() : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ? classic_table() : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h b/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
index c0e6e56d515..8fdf95ef7a9 100644
--- a/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
+++ b/libstdc++-v3/config/os/irix/irix6.5/ctype_noninline.h
@@ -43,14 +43,24 @@
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(!__table ?
(const mask*) (__libc_attr._ctype_tbl->_class + 1) : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/mingw32/ctype_noninline.h b/libstdc++-v3/config/os/mingw32/ctype_noninline.h
index 4ea7b892cca..e493d403030 100644
--- a/libstdc++-v3/config/os/mingw32/ctype_noninline.h
+++ b/libstdc++-v3/config/os/mingw32/ctype_noninline.h
@@ -46,13 +46,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/newlib/ctype_noninline.h b/libstdc++-v3/config/os/newlib/ctype_noninline.h
index 7c5f053528a..d0cce941b4c 100644
--- a/libstdc++-v3/config/os/newlib/ctype_noninline.h
+++ b/libstdc++-v3/config/os/newlib/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
index f4e2ca5f6c6..2eef13a7e65 100644
--- a/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
+++ b/libstdc++-v3/config/os/qnx/qnx6.1/ctype_noninline.h
@@ -41,12 +41,22 @@
size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL), _M_table(__table ? __table : _Ctype)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h
index 25eec3418b0..a80863653ff 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.5/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h
index 659c81a3ffe..694901a5dc7 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.6/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
index 81536b5fc87..d4917f069cb 100644
--- a/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
+++ b/libstdc++-v3/config/os/solaris/solaris2.7/ctype_noninline.h
@@ -43,13 +43,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(__trans_upper), _M_tolower(__trans_lower),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/vxworks/ctype_noninline.h b/libstdc++-v3/config/os/vxworks/ctype_noninline.h
index 4f4e92b1693..acf91a4aa55 100644
--- a/libstdc++-v3/config/os/vxworks/ctype_noninline.h
+++ b/libstdc++-v3/config/os/vxworks/ctype_noninline.h
@@ -42,13 +42,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table ? __table : classic_table())
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/config/os/windiss/ctype_noninline.h b/libstdc++-v3/config/os/windiss/ctype_noninline.h
index a22b65d46d0..cf75ddfd96c 100644
--- a/libstdc++-v3/config/os/windiss/ctype_noninline.h
+++ b/libstdc++-v3/config/os/windiss/ctype_noninline.h
@@ -43,13 +43,23 @@
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
ctype<char>::ctype(const mask* __table, bool __del, size_t __refs)
: facet(__refs), _M_del(__table != 0 && __del),
_M_toupper(NULL), _M_tolower(NULL),
_M_table(__table == 0 ? classic_table() : __table)
- { }
+ {
+ memset(_M_widen, 0, sizeof(_M_widen));
+ _M_widen_ok = 0;
+ memset(_M_narrow, 0, sizeof(_M_narrow));
+ _M_narrow_ok = 0;
+ }
char
ctype<char>::do_toupper(char __c) const
diff --git a/libstdc++-v3/configure b/libstdc++-v3/configure
index b472b6596c8..2aaca2812dd 100755
--- a/libstdc++-v3/configure
+++ b/libstdc++-v3/configure
@@ -308,7 +308,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE LIBUNWIND_FLAG GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CCODECVT_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE glibcxx_thread_h DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS SYMVER_MAP port_specific_symbol_files GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE baseline_dir GLIBCXX_TEST_WCHAR_T_TRUE GLIBCXX_TEST_WCHAR_T_FALSE GLIBCXX_TEST_ABI_TRUE GLIBCXX_TEST_ABI_FALSE ATOMICITY_INC_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS libtool_VERSION multi_basedir build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO AMTAR install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM AWK SET_MAKE am__leading_dot glibcxx_builddir glibcxx_srcdir toplevel_srcdir CC ac_ct_CC EXEEXT OBJEXT CXX ac_ct_CXX CFLAGS CXXFLAGS LN_S AS ac_ct_AS AR ac_ct_AR RANLIB ac_ct_RANLIB MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT LIBTOOL CXXCPP CPPFLAGS enable_shared enable_static GLIBCXX_HOSTED_TRUE GLIBCXX_HOSTED_FALSE GLIBCXX_BUILD_PCH_TRUE GLIBCXX_BUILD_PCH_FALSE glibcxx_PCHFLAGS CSTDIO_H BASIC_FILE_H BASIC_FILE_CC CPP EGREP check_msgfmt glibcxx_MOFILES glibcxx_POFILES glibcxx_localedir USE_NLS CLOCALE_H CCODECVT_H CMESSAGES_H CCODECVT_CC CCOLLATE_CC CCTYPE_CC CMESSAGES_CC CMONEY_CC CNUMERIC_CC CTIME_H CTIME_CC CLOCALE_CC CLOCALE_INTERNAL_H C_INCLUDE_DIR GLIBCXX_C_HEADERS_C_TRUE GLIBCXX_C_HEADERS_C_FALSE GLIBCXX_C_HEADERS_C_STD_TRUE GLIBCXX_C_HEADERS_C_STD_FALSE GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE glibcxx_thread_h DEBUG_FLAGS GLIBCXX_BUILD_DEBUG_TRUE GLIBCXX_BUILD_DEBUG_FALSE EXTRA_CXX_FLAGS WERROR SECTION_FLAGS SECTION_LDFLAGS OPT_LDFLAGS LIBMATHOBJS SYMVER_MAP port_specific_symbol_files GLIBCXX_BUILD_VERSIONED_SHLIB_TRUE GLIBCXX_BUILD_VERSIONED_SHLIB_FALSE baseline_dir GLIBCXX_TEST_WCHAR_T_TRUE GLIBCXX_TEST_WCHAR_T_FALSE GLIBCXX_TEST_ABI_TRUE GLIBCXX_TEST_ABI_FALSE ATOMICITY_INC_SRCDIR OS_INC_SRCDIR glibcxx_prefixdir gxx_include_dir glibcxx_toolexecdir glibcxx_toolexeclibdir GLIBCXX_INCLUDES TOPLEVEL_INCLUDES OPTIMIZE_CXXFLAGS WARN_FLAGS LIBSUPCXX_PICFLAGS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -855,9 +855,6 @@ Optional Features:
--enable-sjlj-exceptions
force use of builtin_setjmp for exceptions
[default=auto]
- --enable-libunwind-exceptions
- force use of libunwind for exceptions
- [default=no]
--enable-libstdcxx-pch build pre-compiled libstdc++ headers
[default=$is_hosted]
--enable-cstdio=PACKAGE use target-specific I/O package
@@ -971,7 +968,7 @@ ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd`
else
echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
fi
- cd "$ac_popdir"
+ cd $ac_popdir
done
fi
@@ -1170,7 +1167,7 @@ _ASBOX
echo "$as_me: caught signal $ac_signal"
echo "$as_me: exit $exit_status"
} >&5
- rm -f core *.core &&
+ rm -f core core.* *.core &&
rm -rf conftest* confdefs* conf$$* $ac_clean_files &&
exit $exit_status
' 0
@@ -1563,7 +1560,8 @@ fi
# foreign: we don't follow the normal rules for GNU packages (no COPYING
# file in the top srcdir, etc, etc), so stop complaining.
# no-dependencies: turns off auto dependency generation (just for now)
-# -Wall: turns on all automake warnings
+# -Wall: turns on all automake warnings...
+# -Wno-portability: ...except this one, since GNU make is now required.
am__api_version="1.7"
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -2800,7 +2798,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
for ac_declaration in \
- '' \
+ ''\
+ '#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
@@ -2814,8 +2813,8 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_declaration
#include <stdlib.h>
+$ac_declaration
int
main ()
{
@@ -3125,7 +3124,8 @@ else
fi
fi
for ac_declaration in \
- '' \
+ ''\
+ '#include <stdlib.h>' \
'extern "C" void std::exit (int) throw (); using std::exit;' \
'extern "C" void std::exit (int); using std::exit;' \
'extern "C" void exit (int) throw ();' \
@@ -3139,8 +3139,8 @@ _ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
-$ac_declaration
#include <stdlib.h>
+$ac_declaration
int
main ()
{
@@ -3793,6 +3793,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
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
@@ -3803,6 +3804,7 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ lt_cv_deplibs_check_method=pass_all
;;
freebsd* )
@@ -4265,7 +4267,7 @@ 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 4268 "configure"' > conftest.$ac_ext
+ echo '#line 4270 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -4869,7 +4871,7 @@ fi;
#
# Fake what AC_TRY_COMPILE does. XXX Look at redoing this new-style.
cat > conftest.$ac_ext << EOF
-#line 4872 "configure"
+#line 4874 "configure"
struct S { ~S(); };
void bar();
void foo()
@@ -4925,33 +4927,6 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo "${ECHO_T}$ac_exception_model_name" >&6
- echo "$as_me:$LINENO: checking for use of libunwind" >&5
-echo $ECHO_N "checking for use of libunwind... $ECHO_C" >&6
- # Check whether --enable-libunwind-exceptions or --disable-libunwind-exceptions was given.
-if test "${enable_libunwind_exceptions+set}" = set; then
- enableval="$enable_libunwind_exceptions"
-
- case "$enableval" in
- yes|no) ;;
- *) { { echo "$as_me:$LINENO: error: Argument to enable/disable libunwind-exceptions must be yes or no" >&5
-echo "$as_me: error: Argument to enable/disable libunwind-exceptions must be yes or no" >&2;}
- { (exit 1); exit 1; }; } ;;
- esac
-
-else
- enable_libunwind_exceptions=no
-fi;
-
- echo "$as_me:$LINENO: result: $use_libunwind_exceptions" >&5
-echo "${ECHO_T}$use_libunwind_exceptions" >&6
- if test $enable_libunwind_exceptions = yes; then
- LIBUNWIND_FLAG="-lunwind"
- else
- LIBUNWIND_FLAG=""
- fi
-
-
-
echo "$as_me:$LINENO: checking for enabled PCH" >&5
echo $ECHO_N "checking for enabled PCH... $ECHO_C" >&6
# Check whether --enable-libstdcxx-pch or --disable-libstdcxx-pch was given.
@@ -5457,7 +5432,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_header_stdc=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
fi
@@ -5648,7 +5623,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
enable_clocale_flag=generic
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
@@ -6584,6 +6559,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_c99_math" >&5
echo "${ECHO_T}$ac_c99_math" >&6
+ if test x"$ac_c99_math" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_MATH 1
+_ACEOF
+
+ fi
+
# Check for the existence in <stdio.h> of vscanf, et. al.
ac_c99_stdio=yes;
echo "$as_me:$LINENO: checking for ISO C99 support in <stdio.h>" >&5
@@ -7188,6 +7170,13 @@ echo $ECHO_N "checking for enabled ISO C99 support... $ECHO_C" >&6
echo "$as_me:$LINENO: result: $enable_c99" >&5
echo "${ECHO_T}$enable_c99" >&6
+ if test x"$ac_99_math" = x"yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define _GLIBCXX_USE_C99_MATH 1
+_ACEOF
+
+ fi
+
# Option parsed, now set things appropriately
if test x"$enable_c99" = x"yes"; then
cat >>confdefs.h <<\_ACEOF
@@ -7804,7 +7793,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -26135,162 +26124,6 @@ done
fi
- echo "$as_me:$LINENO: checking for lrand48 declaration" >&5
-echo $ECHO_N "checking for lrand48 declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func_lrand48_use+set} != xset; then
- if test "${glibcxx_cv_func_lrand48_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-int
-main ()
-{
- lrand48();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_func_lrand48_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func_lrand48_use=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func_lrand48_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func_lrand48_use" >&6
- if test x$glibcxx_cv_func_lrand48_use = x"yes"; then
-
-for ac_func in lrand48
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* 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 ();
-/* 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
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
- fi
-
-
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -26866,6 +26699,16 @@ _ACEOF
# For LFS support.
+
+
+ ac_ext=cc
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+ ac_save_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS -fno-exceptions"
if test "${glibcxx_cv_LFS+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
@@ -26883,10 +26726,15 @@ cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <unistd.h>
+ #include <stdio.h>
+
int
main ()
{
-fopen64("t", "w");
+FILE* fp;
+ fopen64("t", "w");
+ fseeko64(fp, 0, SEEK_CUR);
+ ftello64(fp);
lseek64(1, 0, SEEK_CUR);
;
return 0;
@@ -26921,6 +26769,13 @@ fi
_ACEOF
fi
+ CXXFLAGS="$ac_save_CXXFLAGS"
+ ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
@@ -27559,7 +27414,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_cv_func_mmap_fixed_mapped=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
fi
echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5
@@ -27727,6 +27582,15 @@ _ACEOF
#define HAVE_TANHF 1
_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_ISREG 1
+_ACEOF
+
+ cat >>confdefs.h <<\_ACEOF
+#define HAVE_S_IFREG 1
+_ACEOF
+
else
# Base decisions on target environment.
@@ -46284,162 +46148,6 @@ done
fi
- echo "$as_me:$LINENO: checking for lrand48 declaration" >&5
-echo $ECHO_N "checking for lrand48 declaration... $ECHO_C" >&6
- if test x${glibcxx_cv_func_lrand48_use+set} != xset; then
- if test "${glibcxx_cv_func_lrand48_use+set}" = set; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-
-
- ac_ext=cc
-ac_cpp='$CXXCPP $CPPFLAGS'
-ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
-
- cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-#include <stdlib.h>
-int
-main ()
-{
- lrand48();
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest.$ac_objext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- glibcxx_cv_func_lrand48_use=yes
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-glibcxx_cv_func_lrand48_use=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
- ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-
-
-fi
-
- fi
- echo "$as_me:$LINENO: result: $glibcxx_cv_func_lrand48_use" >&5
-echo "${ECHO_T}$glibcxx_cv_func_lrand48_use" >&6
- if test x$glibcxx_cv_func_lrand48_use = x"yes"; then
-
-for ac_func in lrand48
-do
-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
-echo "$as_me:$LINENO: checking for $ac_func" >&5
-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
-if eval "test \"\${$as_ac_var+set}\" = set"; then
- echo $ECHO_N "(cached) $ECHO_C" >&6
-else
- if test x$gcc_no_link = xyes; then
- { { echo "$as_me:$LINENO: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&5
-echo "$as_me: error: Link tests are not allowed after GCC_NO_EXECUTABLES." >&2;}
- { (exit 1); exit 1; }; }
-fi
-cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h. */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h. */
-/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char $ac_func (); below.
- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
- <limits.h> exists even on freestanding compilers. */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-/* Override any gcc2 internal prototype to avoid an error. */
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-/* 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 ();
-/* 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
-char (*f) () = $ac_func;
-#endif
-#ifdef __cplusplus
-}
-#endif
-
-int
-main ()
-{
-return f != $ac_func;
- ;
- return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext conftest$ac_exeext
-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
- (eval $ac_link) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); } &&
- { ac_try='test -s conftest$ac_exeext'
- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
- (eval $ac_try) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; }; then
- eval "$as_ac_var=yes"
-else
- echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
-eval "$as_ac_var=no"
-fi
-rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
-fi
-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
-if test `eval echo '${'$as_ac_var'}'` = yes; then
- cat >>confdefs.h <<_ACEOF
-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-done
-
- fi
-
-
CXXFLAGS="$ac_save_CXXFLAGS"
@@ -47268,7 +46976,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -48990,10 +48698,6 @@ echo "${ECHO_T}$enable_wchar_t" >&6
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_LRAND48 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_GETPAGESIZE 1
_ACEOF
@@ -49410,7 +49114,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -51172,7 +50876,7 @@ _ACEOF
;;
esac
;;
- *-linux* | *-uclinux* | *-gnu*)
+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
@@ -51421,7 +51125,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -53441,7 +53145,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -55408,7 +55112,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -57274,7 +56978,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
( exit $ac_status )
ac_sectionLDflags=no
fi
-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_test_CFLAGS" = set; then
CFLAGS="$ac_save_CFLAGS"
@@ -59078,10 +58782,6 @@ _ACEOF
_ACEOF
cat >>confdefs.h <<\_ACEOF
-#define HAVE_DRAND48 1
-_ACEOF
-
- cat >>confdefs.h <<\_ACEOF
#define HAVE_FGETWC 1
_ACEOF
@@ -62927,7 +62627,6 @@ s,@enable_shared@,$enable_shared,;t t
s,@enable_static@,$enable_static,;t t
s,@GLIBCXX_HOSTED_TRUE@,$GLIBCXX_HOSTED_TRUE,;t t
s,@GLIBCXX_HOSTED_FALSE@,$GLIBCXX_HOSTED_FALSE,;t t
-s,@LIBUNWIND_FLAG@,$LIBUNWIND_FLAG,;t t
s,@GLIBCXX_BUILD_PCH_TRUE@,$GLIBCXX_BUILD_PCH_TRUE,;t t
s,@GLIBCXX_BUILD_PCH_FALSE@,$GLIBCXX_BUILD_PCH_FALSE,;t t
s,@glibcxx_PCHFLAGS@,$glibcxx_PCHFLAGS,;t t
diff --git a/libstdc++-v3/configure.ac b/libstdc++-v3/configure.ac
index b71117b9923..baf8d7f4b59 100644
--- a/libstdc++-v3/configure.ac
+++ b/libstdc++-v3/configure.ac
@@ -56,8 +56,9 @@ fi
# foreign: we don't follow the normal rules for GNU packages (no COPYING
# file in the top srcdir, etc, etc), so stop complaining.
# no-dependencies: turns off auto dependency generation (just for now)
-# -Wall: turns on all automake warnings
-AM_INIT_AUTOMAKE([1.7.6 no-define foreign no-dependencies -Wall])
+# -Wall: turns on all automake warnings...
+# -Wno-portability: ...except this one, since GNU make is now required.
+AM_INIT_AUTOMAKE([1.7.6 no-define foreign no-dependencies -Wall -Wno-portability])
# Runs configure.host, finds CC, CXX, and assorted other critical bits. Sets
# up critical shell variables.
@@ -77,7 +78,6 @@ GLIBCXX_ENABLE_HOSTED
# Check for support bits and g++ features that don't require linking.
GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
-GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
GLIBCXX_ENABLE_PCH($is_hosted)
# Enable all the variable C++ runtime options.
@@ -220,6 +220,9 @@ else
AC_DEFINE(HAVE_SQRTF)
AC_DEFINE(HAVE_TANF)
AC_DEFINE(HAVE_TANHF)
+
+ AC_DEFINE(HAVE_S_ISREG)
+ AC_DEFINE(HAVE_S_IFREG)
else
m4_include([crossconfig.m4])
fi
diff --git a/libstdc++-v3/configure.host b/libstdc++-v3/configure.host
index de19fcabc62..f5a8f899c2e 100644
--- a/libstdc++-v3/configure.host
+++ b/libstdc++-v3/configure.host
@@ -146,7 +146,7 @@ case "${host_os}" in
freebsd*)
os_include_dir="os/bsd/freebsd"
;;
- gnu* | linux*)
+ gnu* | linux* | kfreebsd*-gnu | knetbsd*-gnu)
os_include_dir="os/gnu-linux"
;;
hpux*)
diff --git a/libstdc++-v3/crossconfig.m4 b/libstdc++-v3/crossconfig.m4
index 7bd3bacabd3..70a2c785fa0 100644
--- a/libstdc++-v3/crossconfig.m4
+++ b/libstdc++-v3/crossconfig.m4
@@ -53,7 +53,6 @@ case "${host}" in
GLIBCXX_CHECK_COMPLEX_MATH_SUPPORT
GLIBCXX_CHECK_WCHAR_T_SUPPORT
AC_DEFINE(HAVE_LC_MESSAGES)
- AC_DEFINE(HAVE_LRAND48)
AC_DEFINE(HAVE_GETPAGESIZE)
AC_DEFINE(HAVE_SETENV)
AC_DEFINE(HAVE_SIGSETJMP)
@@ -123,7 +122,7 @@ case "${host}" in
;;
esac
;;
- *-linux* | *-uclinux* | *-gnu*)
+ *-linux* | *-uclinux* | *-gnu* | *-kfreebsd*-gnu | *-knetbsd*-gnu)
AC_CHECK_HEADERS([nan.h ieeefp.h endian.h sys/isa_defs.h \
machine/endian.h machine/param.h sys/machine.h sys/types.h \
fp.h locale.h float.h inttypes.h])
@@ -217,7 +216,6 @@ case "${host}" in
AC_DEFINE(HAVE_S_ISREG)
AC_DEFINE(HAVE_LC_MESSAGES)
AC_DEFINE(HAVE_BTOWC)
- AC_DEFINE(HAVE_DRAND48)
AC_DEFINE(HAVE_FGETWC)
AC_DEFINE(HAVE_FGETWS)
AC_DEFINE(HAVE_FINITE)
diff --git a/libstdc++-v3/docs/doxygen/TODO b/libstdc++-v3/docs/doxygen/TODO
index b32b2b1a0fe..d50c65d8bab 100644
--- a/libstdc++-v3/docs/doxygen/TODO
+++ b/libstdc++-v3/docs/doxygen/TODO
@@ -23,7 +23,7 @@ c18 FINISHED, Note A
c19 Note A
c20 Note A
c21 Public functions basic_string done, Note B
-c22 Untouched; see docs/html/22_locale/*
+c22 Most still to do; see docs/html/22_locale/*
c23 See doxygroups.cc and Note B. Notes on what invalidates
iterators need to be added.
c24 stl_iterator.h (__normal_iterator, other small TODO bits)
diff --git a/libstdc++-v3/docs/html/17_intro/C++STYLE b/libstdc++-v3/docs/html/17_intro/C++STYLE
index f838b830124..90dc879b1d1 100644
--- a/libstdc++-v3/docs/html/17_intro/C++STYLE
+++ b/libstdc++-v3/docs/html/17_intro/C++STYLE
@@ -200,7 +200,25 @@ Notable areas of divergence from what may be previous local practice
For more explanation and examples, see src/globals.cc. All such
variables should be contained in that file, for simplicity.
-
+15. Exception abstractions
+ Use the exception abstractions found in functexcept.h, which allow
+ C++ programmers to use this library with -fno-exceptions. (Even if
+ that is rarely advisable, it's a necessary evil for backwards
+ compatibility.)
+
+16. Exception error messages
+ All start with the name of the function where the exception is
+ thrown, and then (optional) descriptive text is added. Example:
+
+ __throw_logic_error("basic_string::_S_construct NULL not valid");
+
+ Reason: The verbose terminate handler prints out exception::what(),
+ as well as the typeinfo for the thrown exception. As this is the
+ default terminate handler, by putting location info into the
+ exception string, a very useful error message is printed out for
+ uncaught exceptions. So useful, in fact, that non-programmers can
+ give useful error messages, and programmers can intelligently
+ speculate what went wrong without even using a debugger.
The library currently has a mixture of GNU-C and modern C++ coding
styles. The GNU C usages will be combed out gradually.
diff --git a/libstdc++-v3/docs/html/17_intro/TODO b/libstdc++-v3/docs/html/17_intro/TODO
index 47ea3cd6fb2..1670f042e28 100644
--- a/libstdc++-v3/docs/html/17_intro/TODO
+++ b/libstdc++-v3/docs/html/17_intro/TODO
@@ -36,12 +36,18 @@ std::locale
functions and and LANG environment variable dependencies.
- use localedata to implement generic named (non-MT-safe) locales?
- Figure out a way to use ICU data, like libjava? Need a generic locale
- model that does something besides the "C" locale.
+ Figure out a way to use ICU data, like libjava? Re-package and use
+ the glibc localedata, even if we aren't on linux? Need a generic
+ locale model that does something besides the "C" locale.
- make locale::classic() separate from named locale code. This will
improve the static linkage situation, but will require new
- initialization code.
+ initialization code. In particular, we need lazy-initialization of
+ locale::classic(), and maybe the has_facet/use_facet functions for all
+ the required facets. The end goal is a self-contained
+ locale_init.cc, or one with transitive closure without the locale
+ instantiations (locale-inst.cc) or the named locale bits
+ (localename.cc).
- Jerry(?)/Paolo(?) work on __float_to_char.
@@ -52,9 +58,9 @@ std::locale
std::basic_filebuf, 27_io
- wfilebuf, get variable-encoding working and tested, including
- positioning and seeking.
+ positioning and seeking. (I think this may be done now)
- - wfilebuf testsuite
+ - wfilebuf testsuite (getting there...)
- look ahead for unbuffered io, so know when multiple putc's can be
coalesced.
@@ -90,16 +96,22 @@ testsuite
g++/binutils
- - compression for wide versions of basic types
+ - compression for wide versions of basic types, not just narrow
-- get Apple's debug mode, or something with equivalent functionality, in.
+threads
+
+ - create MT abstraction layer for atomicity to pthreads.
+
+ - solution for threads + C++.
- audit for places where __builtin_expect can be used.
- relocations, work on getting these down
- issues with __builtin_memcpy and std::copy from Jerry Quinn
- http://gcc.gnu.org/ml/libstdc++/2003-02/msg00076.html
+ http://gcc.gnu.org/ml/libstdc++/2003-02/msg00056.html
+ http://gcc.gnu.org/ml/libstdc++/2003-02/msg00302.html
+ http://gcc.gnu.org/ml/gcc/2003-10/msg01305.html
- fix dependency tracking for includes (.h, .tcc) during build process.
@@ -155,8 +167,6 @@ sources, with macro-guards. Also, same with the TR.
- add feature-test macros for non-standard extensions
-- create MT abstraction layer for atomicity to pthreads.
-
- add MT support for locale, string, istream, ostream
- need to think about doing a .texi or DocBook manual, instead of all
diff --git a/libstdc++-v3/docs/html/17_intro/configury.html b/libstdc++-v3/docs/html/17_intro/configury.html
index 8b44ff381dc..d099e596575 100644
--- a/libstdc++-v3/docs/html/17_intro/configury.html
+++ b/libstdc++-v3/docs/html/17_intro/configury.html
@@ -10,7 +10,9 @@
<meta name="DESCRIPTION" content="configury for libstdc++" />
<meta name="GENERATOR" content="vi and eight fingers" />
<title>libstdc++-v3 configury</title>
-<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="StyleSheet" href="../lib3styles.css" type='text/css' />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
</head>
<body>
@@ -43,7 +45,7 @@ Last Question</a>, by Isaac Asimov
<hr />
<h3><a name="deps">what comes from where</a></h3>
<p class="centered"><img src="confdeps.png"
- alt="Dependency graph in PNG graphics format. (Get a better browser!)"></p>
+ alt="Dependency graph in PNG graphics format. (Get a better browser!)" /></p>
<p>Regenerate using a command sequence like
<code>"aclocal-1.7 &amp;&amp; autoconf2.50 &amp;&amp; autoheader2.50
@@ -163,7 +165,6 @@ Last Question</a>, by Isaac Asimov
GLIBCXX_ENABLE_C_MBCHAR
GLIBCXX_ENABLE_DEBUG
GLIBCXX_ENABLE_DEBUG_FLAGS
- GLIBCXX_ENABLE_LIBUNWIND_EXCEPTIONS
GLIBCXX_ENABLE_LONG_LONG
GLIBCXX_ENABLE_PCH
GLIBCXX_ENABLE_SJLJ_EXCEPTIONS
diff --git a/libstdc++-v3/docs/html/17_intro/contribute.html b/libstdc++-v3/docs/html/17_intro/contribute.html
index 3219f16da0e..cc95689f091 100644
--- a/libstdc++-v3/docs/html/17_intro/contribute.html
+++ b/libstdc++-v3/docs/html/17_intro/contribute.html
@@ -5,7 +5,11 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
-<title>How to contribute</title>
+ <title>How to contribute</title>
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<!--990301 slightly modified version of the GCC contribute.html file-->
<!-- #include virtual="/include/header-subpages.html"-->
diff --git a/libstdc++-v3/docs/html/17_intro/howto.html b/libstdc++-v3/docs/html/17_intro/howto.html
index d1fc584679d..ab654245f44 100644
--- a/libstdc++-v3/docs/html/17_intro/howto.html
+++ b/libstdc++-v3/docs/html/17_intro/howto.html
@@ -10,8 +10,14 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 17: Library Introduction</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Next" href="../18_support/howto.html" type="text/html"
+ title="Library Support" />
+<link rel="Copyright" href="license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
@@ -339,6 +345,18 @@
violations of the requirements of the standard. This is described
in more detail <a href="../19_diagnostics/howto.html#3">here</a>.
</dd>
+ <dt><code>_GLIBCXX_DEBUG</code></dt>
+ <dd>Undefined by default. Configurable. When defined, compiles
+ user code using the <a href="../debug.html#safe">libstdc++ debug
+ mode</a>.
+ </dd>
+ <dt><code>_GLIBCXX_DEBUG_PEDANTIC</code></dt>
+ <dd>Undefined by default. Configurable. When defined while
+ compiling with the <a href="../debug.html#safe">libstdc++ debug
+ mode</a>, makes the debug mode extremely picky by making the use
+ of libstdc++ extensions and libstdc++-specific behavior into
+ errors.
+ </dd>
<!--
<dt><code></code></dt>
<dd>
diff --git a/libstdc++-v3/docs/html/17_intro/license.html b/libstdc++-v3/docs/html/17_intro/license.html
index a0a2c9135ea..5d815f8fe3c 100644
--- a/libstdc++-v3/docs/html/17_intro/license.html
+++ b/libstdc++-v3/docs/html/17_intro/license.html
@@ -11,7 +11,9 @@
<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" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" rev="Copyright" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/18_support/howto.html b/libstdc++-v3/docs/html/18_support/howto.html
index df7305cc033..7344c95ebd2 100644
--- a/libstdc++-v3/docs/html/18_support/howto.html
+++ b/libstdc++-v3/docs/html/18_support/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 18: Library Support</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../17_intro/howto.html" type="text/html"
+ title="Library Introduction" />
+<link rel="Next" href="../19_diagnostics/howto.html" type="text/html"
+ title="Diagnostics" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/19_diagnostics/howto.html b/libstdc++-v3/docs/html/19_diagnostics/howto.html
index b658be83c7a..2b5cd22850a 100644
--- a/libstdc++-v3/docs/html/19_diagnostics/howto.html
+++ b/libstdc++-v3/docs/html/19_diagnostics/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 19: Diagnostics</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../18_support/howto.html" type="text/html"
+ title="Library Support" />
+<link rel="Next" href="../20_util/howto.html" type="text/html"
+ title="General Utilities" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/20_util/howto.html b/libstdc++-v3/docs/html/20_util/howto.html
index af40bceae0e..13d0c8e0855 100644
--- a/libstdc++-v3/docs/html/20_util/howto.html
+++ b/libstdc++-v3/docs/html/20_util/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 20: General Utilities</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../19_diagnostics/howto.html" type="text/html"
+ title="Diagnostics" />
+<link rel="Next" href="../21_strings/howto.html" type="text/html"
+ title="Strings" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/21_strings/howto.html b/libstdc++-v3/docs/html/21_strings/howto.html
index 49f17e7c8aa..59d9c8de3fe 100644
--- a/libstdc++-v3/docs/html/21_strings/howto.html
+++ b/libstdc++-v3/docs/html/21_strings/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 21: Strings</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../20_util/howto.html" type="text/html"
+ title="General Utilities" />
+<link rel="Next" href="../22_locale/howto.html" type="text/html"
+ title="Localization" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
@@ -30,6 +38,7 @@
<li><a href="#3">Breaking a C++ string into tokens</a></li>
<li><a href="#4">Simple transformations</a></li>
<li><a href="#5">Making strings of arbitrary character types</a></li>
+ <li><a href="#6">Shrink-to-fit strings</a></li>
</ul>
<hr />
@@ -435,6 +444,25 @@
<a href="../faq/index.html">to the FAQ</a>.
</p>
+<hr />
+<h2><a name="6">Shrink-to-fit strings</a></h2>
+ <!-- referenced by faq/index.html#5_9, update link if numbering changes -->
+ <p>From GCC 3.4 calling <code>s.reserve(res)</code> on a
+ <code>string s</code> with <code>res &lt; s.capacity()</code> will
+ reduce the string's capacity to <code>std::max(s.size(), res)</code>.
+ </p>
+ <p>This behaviour is suggested, but not required by the standard. Prior
+ to GCC 3.4 the following alternative can be used instead
+ </p>
+ <pre>
+ std::string(str.data(), str.size()).swap(str);
+ </pre>
+ <p>This is similar to the idiom for reducing a <code>vector</code>'s
+ memory usage (see <a href='../faq/index.html#5_9'>FAQ 5.9</a>) but
+ the regular copy constructor cannot be used because libstdc++'s
+ <code>string</code> is Copy-On-Write.
+ </p>
+
<!-- ####################################################### -->
diff --git a/libstdc++-v3/docs/html/22_locale/codecvt.html b/libstdc++-v3/docs/html/22_locale/codecvt.html
index 6acd416fc07..fe5457584b3 100644
--- a/libstdc++-v3/docs/html/22_locale/codecvt.html
+++ b/libstdc++-v3/docs/html/22_locale/codecvt.html
@@ -10,7 +10,12 @@
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="Notes on the codecvt implementation." />
<title>Notes on the codecvt implementation.</title>
-<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Bookmark" href="howto.html" type="text/html" title="Localization" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
<h1>
diff --git a/libstdc++-v3/docs/html/22_locale/ctype.html b/libstdc++-v3/docs/html/22_locale/ctype.html
index 3043123f041..ee5e69f7cf7 100644
--- a/libstdc++-v3/docs/html/22_locale/ctype.html
+++ b/libstdc++-v3/docs/html/22_locale/ctype.html
@@ -10,7 +10,12 @@
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="Notes on the ctype implementation." />
<title>Notes on the ctype implementation.</title>
-<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Bookmark" href="howto.html" type="text/html" title="Localization" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
<h1>
diff --git a/libstdc++-v3/docs/html/22_locale/howto.html b/libstdc++-v3/docs/html/22_locale/howto.html
index 0000c277d09..30e1e1f50b0 100644
--- a/libstdc++-v3/docs/html/22_locale/howto.html
+++ b/libstdc++-v3/docs/html/22_locale/howto.html
@@ -10,8 +10,22 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 22: Localization</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../21_strings/howto.html" type="text/html"
+ title="Strings" />
+<link rel="Next" href="../23_containers/howto.html" type="text/html"
+ title="Containers" />
+<link rel="Bookmark" href="locale.html" type="text/html" title="class locale" />
+<link rel="Bookmark" href="codecvt.html" type="text/html" title="class codecvt" />
+<link rel="Bookmark" href="ctype.html" type="text/html" title="class ctype" />
+<link rel="Bookmark" href="messages.html" type="text/html" title="class messages" />
+<link rel="Bookmark" href="http://www.research.att.com/~bs/3rd_loc0.html" type="text/html" title="Bjarne Stroustrup on Locales" />
+<link rel="Bookmark" href="http://www.cantrip.org/locale.html" type="text/html" title="Nathan Myers on Locales" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
@@ -83,7 +97,7 @@
</p>
<hr />
-<h2><a name="5">Stroustrup on Locales</a></h2>
+<h2><a name="5">Bjarne 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,
diff --git a/libstdc++-v3/docs/html/22_locale/locale.html b/libstdc++-v3/docs/html/22_locale/locale.html
index 8470a502cf2..57ef5b4e981 100644
--- a/libstdc++-v3/docs/html/22_locale/locale.html
+++ b/libstdc++-v3/docs/html/22_locale/locale.html
@@ -10,7 +10,12 @@
<meta name="KEYWORDS" content="HOWTO, libstdc++, locale name LC_ALL" />
<meta name="DESCRIPTION" content="Notes on the locale implementation." />
<title>Notes on the locale implementation.</title>
-<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Bookmark" href="howto.html" type="text/html" title="Localization" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
<h1>
diff --git a/libstdc++-v3/docs/html/22_locale/messages.html b/libstdc++-v3/docs/html/22_locale/messages.html
index b57f4541183..41e94a42f83 100644
--- a/libstdc++-v3/docs/html/22_locale/messages.html
+++ b/libstdc++-v3/docs/html/22_locale/messages.html
@@ -10,7 +10,12 @@
<meta name="KEYWORDS" content="HOWTO, libstdc++, GCC, g++, libg++, STL" />
<meta name="DESCRIPTION" content="Notes on the messages implementation." />
<title>Notes on the messages implementation.</title>
-<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Bookmark" href="howto.html" type="text/html" title="Localization" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
<h1>
diff --git a/libstdc++-v3/docs/html/23_containers/howto.html b/libstdc++-v3/docs/html/23_containers/howto.html
index 27314fbafc3..55415affd95 100644
--- a/libstdc++-v3/docs/html/23_containers/howto.html
+++ b/libstdc++-v3/docs/html/23_containers/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 23: Containers</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../22_locale/howto.html" type="text/html"
+ title="Localization" />
+<link rel="Next" href="../24_iterators/howto.html" type="text/html"
+ title="Iterators" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/24_iterators/howto.html b/libstdc++-v3/docs/html/24_iterators/howto.html
index c22df9acf42..e4d557d3747 100644
--- a/libstdc++-v3/docs/html/24_iterators/howto.html
+++ b/libstdc++-v3/docs/html/24_iterators/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 24: Iterators</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../23_containers/howto.html" type="text/html"
+ title="Containers" />
+<link rel="Next" href="../25_algorithms/howto.html" type="text/html"
+ title="Algorithms" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/25_algorithms/howto.html b/libstdc++-v3/docs/html/25_algorithms/howto.html
index 9b2f24812b8..fe45f3237e1 100644
--- a/libstdc++-v3/docs/html/25_algorithms/howto.html
+++ b/libstdc++-v3/docs/html/25_algorithms/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 25: Algorithms</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../24_iterators/howto.html" type="text/html"
+ title="Iterators" />
+<link rel="Next" href="../26_numerics/howto.html" type="text/html"
+ title="Numerics" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/26_numerics/howto.html b/libstdc++-v3/docs/html/26_numerics/howto.html
index ef0b36a8eac..48dc84c355b 100644
--- a/libstdc++-v3/docs/html/26_numerics/howto.html
+++ b/libstdc++-v3/docs/html/26_numerics/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 26: Numerics</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../25_algorithms/howto.html" type="text/html"
+ title="Algorithms" />
+<link rel="Next" href="../27_io/howto.html" type="text/html"
+ title="Input/Output" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/27_io/howto.html b/libstdc++-v3/docs/html/27_io/howto.html
index 35568c453ff..e1afe5453d8 100644
--- a/libstdc++-v3/docs/html/27_io/howto.html
+++ b/libstdc++-v3/docs/html/27_io/howto.html
@@ -10,8 +10,16 @@
<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" />
+ <title>libstdc++-v3 HOWTO: Chapter 27: Input/Output</title>
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../26_numerics/howto.html" type="text/html"
+ title="Numerics" />
+<link rel="Next" href="../ext/howto.html" type="text/html"
+ title="Extensions" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
+<link rel="Help" href="../faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
@@ -145,7 +153,7 @@
&lt;&lt; &quot;another line of text\n&quot;; </pre>
<p>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.
+ the start of the quoted text on the last line, for example.
</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
diff --git a/libstdc++-v3/docs/html/configopts.html b/libstdc++-v3/docs/html/configopts.html
index 2cfec4475c4..17ccaf9ae91 100644
--- a/libstdc++-v3/docs/html/configopts.html
+++ b/libstdc++-v3/docs/html/configopts.html
@@ -10,7 +10,8 @@
<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" />
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Copyright" href="17_intro/license.html" type="text/html" />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/debug.html b/libstdc++-v3/docs/html/debug.html
index dcd035ca04f..bfdf38b943f 100644
--- a/libstdc++-v3/docs/html/debug.html
+++ b/libstdc++-v3/docs/html/debug.html
@@ -10,7 +10,8 @@
<meta name="DESCRIPTION" content="Debugging C++ binaries" />
<meta name="GENERATOR" content="vi and ten fingers" />
<title>Debugging schemes and strategies</title>
-<link rel="StyleSheet" href="lib3styles.css" />
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Copyright" href="17_intro/license.html" type="text/html" />
</head>
<body>
@@ -29,9 +30,8 @@
<!-- ####################################################### -->
<hr />
<p>There are numerous things that can be done to improve the ease with
- which C++ binaries are debugged when using the GNU C++
- tool chain. Here are some things to keep in mind when debugging C++
- code with GNU tools.
+ which C++ binaries are debugged when using the GNU
+ tool chain. Here are some of them.
</p>
<h3 class="left"><a name="gplusplus">Compiler flags determine debug info</a></h3>
@@ -40,15 +40,18 @@
be varied to change debugging characteristics. For instance,
turning off all optimization via the <code>-g -O0</code> flag will
disable inlining, so that stepping through all functions, including
- inlined constructors and destructors, is possible. Or, the debug
- format that the compiler and debugger use to communicate
+ inlined constructors and destructors, is possible. In addition,
+ <code>-fno-eliminate-unused-debug-types<code> can be used when
+ additional debug information, such as nested class info, is desired.
+</p>
+
+<p>Or, the debug format that the compiler and debugger use to communicate
information about source constructs can be changed via <code>
-gdwarf-2 </code> or <code> -gstabs </code> flags: some debugging
formats permit more expressive type and scope information to be
- shown in gdb.
- The default debug information for a particular platform can be
- identified via the value set by the PREFERRED_DEBUGGING_TYPE macro
- in the gcc sources.
+ shown in gdb. The default debug information for a particular
+ platform can be identified via the value set by the
+ PREFERRED_DEBUGGING_TYPE macro in the gcc sources.
</p>
<p>Many other options are available: please see
@@ -56,28 +59,16 @@
in Using the GNU Compiler Collection (GCC) for a complete list.
</p>
-
<h3 class="left"><a name="lib">Using special flags to make a debug binary</a></h3>
-<p>There are two ways to build libstdc++ with debug flags. The first
- is to run make from the toplevel in a freshly-configured tree with
- specialized debug <code>CXXFLAGS</code>, as in
-</p>
-<pre>
- make CXXFLAGS='-g3 -O0' all
-</pre>
-
-<p>This quick and dirty approach is often sufficient for quick
- debugging tasks, but the lack of state can be confusing in the long
- term.
-</p>
-<p>A second approach is to use the configuration flags
-</p>
+<p>If you would like debug symbols in libstdc++, there are two ways to
+ build libstdc++ with debug flags. The first is to run make from the
+ toplevel in a freshly-configured tree with
<pre>
- --enable-debug
+ --enable-libstdcxx-debug
</pre>
<p>and perhaps</p>
<pre>
- --enable-debug-flags='...'
+ --enable-libstdcxx-debug-flags='...'
</pre>
<p>to create a separate debug build. Both the normal build and the
debug build will persist, without having to specify
@@ -87,6 +78,231 @@
options</a> document.
</p>
+<p>A second approach is to use the configuration flags
+</p>
+<pre>
+ make CXXFLAGS='-g3 -O0' all
+</pre>
+
+<p>This quick and dirty approach is often sufficient for quick
+ debugging tasks, when you cannot or don't want to recompile your
+ application to use the <a href="#safe">debug mode</a>.</p>
+
+<h3 class="left"><a name="safe">The libstdc++ debug mode</a></h3>
+<p>By default, libstdc++ is built with efficiency in mind, and
+ therefore performs little or no error checking that is not required
+ by the C++ standard. This means that programs that incorrectly use
+ the C++ standard library will exhibit behavior that is not portable
+ and may not even be predictable, because they tread into
+ implementation-specific or undefined behavior. To detect some of
+ these errors before they can become problematic, libstdc++ offers a
+ debug mode that provides additional checking of library facilities,
+ and will report errors in the use of libstdc++ as soon as they can
+ be detected by emitting a description of the problem to standard
+ error and aborting the program. </p>
+
+<p>The libstdc++ debug mode performs checking for many areas of the C++
+ standard, but the focus is on checking interactions among standard
+ iterators, containers, and algorithms, including:</p>
+
+ <ul>
+ <li><em>Safe iterators</em>: Iterators keep track of the
+ container whose elements they reference, so errors such as
+ incrementing a past-the-end iterator or dereferencing an iterator
+ that points to a container that has been destructed are diagnosed
+ immediately.</li>
+
+ <li><em>Algorithm preconditions</em>: Algorithms attempt to
+ validate their input parameters to detect errors as early as
+ possible. For instance, the <code>set_intersection</code>
+ algorithm requires that its iterator
+ parameters <code>first1</code> and <code>last1</code> form a valid
+ iterator range, and that the sequence
+ [<code>first1</code>, <code>last1</code>) is sorted according to
+ the same predicate that was passed
+ to <code>set_intersection</code>; the libstdc++ debug mode will
+ detect an error if the sequence is not sorted or was sorted by a
+ different predicate.</li>
+ </ul>
+
+<h4 class="left">Using the libstdc++ debug mode</h4>
+<p>To use the libstdc++ debug mode, compile your application with the
+ compiler flag <code>-D_GLIBCXX_DEBUG</code>. Note that this flag
+ changes the sizes and behavior of standard class templates such
+ as <code>std::vector</code>, and therefore you can only link code
+ compiled with debug mode and code compiled without debug mode if no
+ instantiation of a container is passed between the two translation
+ units.</p>
+
+<p>For information about the design of the libstdc++ debug mode,
+ please see the <a href="debug_mode.html">libstdc++ debug mode design
+ document</a>.</p>
+
+<h4 class="left">Using the debugging containers without debug
+ mode</h4>
+<p>When it is not feasible to recompile your entire application, or
+ only specific containers need checking, debugging containers are
+ available as GNU extensions. These debugging containers are
+ functionally equivalent to the standard drop-in containers used in
+ debug mode, but they are available in a separate namespace as GNU
+ extensions and may be used in programs compiled with either release
+ mode or with debug mode. The
+ following table provides the names and headers of the debugging
+ containers:
+
+<table title="Debugging containers" border="1">
+ <tr>
+ <th>Container</th>
+ <th>Header</th>
+ <th>Debug container</th>
+ <th>Debug header</th>
+ </tr>
+ <tr>
+ <td>std::bitset</td>
+ <td>&lt;bitset&gt;</td>
+ <td>__gnu_debug::bitset</td>
+ <td>&lt;debug/bitset&gt;</td>
+ </tr>
+ <tr>
+ <td>std::deque</td>
+ <td>&lt;deque&gt;</td>
+ <td>__gnu_debug::deque</td>
+ <td>&lt;debug/deque&gt;</td>
+ </tr>
+ <tr>
+ <td>std::list</td>
+ <td>&lt;list&gt;</td>
+ <td>__gnu_debug::list</td>
+ <td>&lt;debug/list&gt;</td>
+ </tr>
+ <tr>
+ <td>std::map</td>
+ <td>&lt;map&gt;</td>
+ <td>__gnu_debug::map</td>
+ <td>&lt;debug/map&gt;</td>
+ </tr>
+ <tr>
+ <td>std::multimap</td>
+ <td>&lt;map&gt;</td>
+ <td>__gnu_debug::multimap</td>
+ <td>&lt;debug/map&gt;</td>
+ </tr>
+ <tr>
+ <td>std::multiset</td>
+ <td>&lt;set&gt;</td>
+ <td>__gnu_debug::multiset</td>
+ <td>&lt;debug/set&gt;</td>
+ </tr>
+ <tr>
+ <td>std::set</td>
+ <td>&lt;set&gt;</td>
+ <td>__gnu_debug::set</td>
+ <td>&lt;debug/set&gt;</td>
+ </tr>
+ <tr>
+ <td>std::string</td>
+ <td>&lt;string&gt;</td>
+ <td>__gnu_debug::string</td>
+ <td>&lt;debug/string&gt;</td>
+ </tr>
+ <tr>
+ <td>std::wstring</td>
+ <td>&lt;string&gt;</td>
+ <td>__gnu_debug::wstring</td>
+ <td>&lt;debug/string&gt;</td>
+ </tr>
+ <tr>
+ <td>std::basic_string</td>
+ <td>&lt;string&gt;</td>
+ <td>__gnu_debug::basic_string</td>
+ <td>&lt;debug/string&gt;</td>
+ </tr>
+ <tr>
+ <td>std::vector</td>
+ <td>&lt;vector&gt;</td>
+ <td>__gnu_debug::vector</td>
+ <td>&lt;debug/vector&gt;</td>
+ </tr>
+ <tr>
+ <td>__gnu_cxx::hash_map</td>
+ <td>&lt;ext/hash_map&gt;</td>
+ <td>__gnu_debug::hash_map</td>
+ <td>&lt;debug/hash_map&gt;</td>
+ </tr>
+ <tr>
+ <td>__gnu_cxx::hash_multimap</td>
+ <td>&lt;ext/hash_map&gt;</td>
+ <td>__gnu_debug::hash_multimap</td>
+ <td>&lt;debug/hash_map&gt;</td>
+ </tr>
+ <tr>
+ <td>__gnu_cxx::hash_set</td>
+ <td>&lt;ext/hash_set&gt;</td>
+ <td>__gnu_debug::hash_set</td>
+ <td>&lt;debug/hash_set&gt;</td>
+ </tr>
+ <tr>
+ <td>__gnu_cxx::hash_multiset</td>
+ <td>&lt;ext/hash_set&gt;</td>
+ <td>__gnu_debug::hash_multiset</td>
+ <td>&lt;debug/hash_set&gt;</td>
+ </tr>
+</table>
+
+<h4 class="left">Debug mode semantics</h4>
+<p>A program that uses the C++ standard library correctly
+ will maintain the same semantics under debug mode as it had with
+ the normal (release) library. All functional and exception-handling
+ guarantees made by the normal library also hold for the debug mode
+ library, with one exception: performance guarantees made by the
+ normal library may not hold in the debug mode library. For
+ instance, erasing an element in a <code>std::list</code> is a
+ constant-time operation in normal library, but in debug mode it is
+ linear in the number of iterators that reference that particular
+ list. So while your (correct) program won't change its results, it
+ is likely to execute more slowly.</p>
+
+<p>libstdc++ includes many extensions to the C++ standard library. In
+ some cases the extensions are obvious, such as the hashed
+ associative containers, whereas other extensions give predictable
+ results to behavior that would otherwise be undefined, such as
+ throwing an exception when a <code>std::basic_string</code> is
+ constructed from a NULL character pointer. This latter category also
+ includes implementation-defined and unspecified semantics, such as
+ the growth rate of a vector. Use of these extensions is not
+ considered incorrect, so code that relies on them will not be
+ rejected by debug mode. However, use of these extensions may affect
+ the portability of code to other implementations of the C++ standard
+ library, and is therefore somewhat hazardous. For this reason, the
+ libstdc++ debug mode offers a "pedantic" mode (similar to
+ GCC's <code>-pedantic</code> compiler flag) that attempts to emulate
+ the semantics guaranteed by the C++ standard. For
+ instance, constructing a <code>std::basic_string</code> with a NULL
+ character pointer would result in an exception under normal mode or
+ non-pedantic debug mode (this is a libstdc++ extension), whereas
+ under pedantic debug mode libstdc++ would signal an error. To enable
+ the pedantic debug mode, compile your program with
+ both <code>-D_GLIBCXX_DEBUG</code>
+ and <code>-D_GLIBCXX_DEBUG_PEDANTIC</code> .</p>
+
+<p>The following library components provide extra debugging
+ capabilities in debug mode:</p>
+<ul>
+ <li><code>std::basic_string</code> (no safe iterators)</li>
+ <li><code>std::bitset</code></li>
+ <li><code>std::deque</code></li>
+ <li><code>__gnu_cxx::hash_map</code></li>
+ <li><code>__gnu_cxx::hash_multimap</code></li>
+ <li><code>__gnu_cxx::hash_multiset</code></li>
+ <li><code>__gnu_cxx::hash_set</code></li>
+ <li><code>std::list</code></li>
+ <li><code>std::map</code></li>
+ <li><code>std::multimap</code></li>
+ <li><code>std::multiset</code></li>
+ <li><code>std::set</code></li>
+ <li><code>std::vector</code></li>
+</ul>
+
<h3 class="left"><a name="mem">Tips for memory leak hunting</a></h3>
@@ -94,9 +310,11 @@
that can be used to provide detailed memory allocation information
about C++ code. An exhaustive list of tools is not going to be
attempted, but includes <code>mtrace</code>, <code>valgrind</code>,
- <code>mudflap</code>, and <code>purify</code>. Also highly
- recommended are <code>libcwd</code> and some other one that I
- forget right now.
+ <code>mudflap</code>, and the non-free commercial product
+ <code>purify</code>. In addition, <code>libcwd</code> has a
+ replacement for the global new and delete operators that can track
+ memory allocation and deallocation and provide useful memory
+ statistics.
</p>
<p>Regardless of the memory debugging tool being used, there is one
@@ -110,9 +328,10 @@
<p>In a nutshell, the default allocator used by <code>
std::allocator</code> is a high-performance pool allocator, and can
- give the mistaken impression that memory is being leaked, when in
- reality the memory is still being used by the library and is reclaimed
- after program termination.
+ give the mistaken impression that in a suspect executable, memory
+ is being leaked, when in reality the memory "leak" is a pool being
+ used by the library's allocator and is reclaimed after program
+ termination.
</p>
<p>For valgrind, there are some specific items to keep in mind. First
@@ -121,7 +340,7 @@
versions should work at least as well. Second of all, use a
completely unoptimized build to avoid confusing valgrind. Third,
use GLIBCXX_FORCE_NEW to keep extraneous pool allocation noise from
- cluttering debug information.
+ cluttering debug information.
</p>
<p>Fourth, it may be necessary to force deallocation in other
diff --git a/libstdc++-v3/docs/html/debug_mode.html b/libstdc++-v3/docs/html/debug_mode.html
new file mode 100644
index 00000000000..b62ad8f5572
--- /dev/null
+++ b/libstdc++-v3/docs/html/debug_mode.html
@@ -0,0 +1,590 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!DOCTYPE html
+ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <meta name="AUTHOR" content="gregod@cs.rpi.edu (Doug Gregor)" />
+ <meta name="KEYWORDS" content="C++, GCC, libstdc++, g++, debug" />
+ <meta name="DESCRIPTION" content="Design of the libstdc++ debug mode." />
+ <meta name="GENERATOR" content="vi and eight fingers" />
+ <title>Design of the libstdc++ debug mode</title>
+<link rel="StyleSheet" href="lib3styles.css" />
+</head>
+<body>
+
+<h1 class="centered"><a name="top">Design of the libstdc++ debug mode</a></h1>
+
+<p class="fineprint"><em>
+ The latest version of this document is always available at
+ <a href="http://gcc.gnu.org/onlinedocs/libstdc++/debug_mode.html">
+ http://gcc.gnu.org/onlinedocs/libstdc++/debug_mode.html</a>.
+</em></p>
+
+<p><em>
+ To the <a href="http://gcc.gnu.org/libstdc++/">libstdc++-v3 homepage</a>.
+</em></p>
+
+
+<!-- ####################################################### -->
+
+<hr />
+<h1>Debug mode design</h1>
+<p> The libstdc++ debug mode replaces unsafe (but efficient) standard
+ containers and iterators with semantically equivalent safe standard
+ containers and iterators to aid in debugging user programs. The
+ following goals directed the design of the libstdc++ debug mode:</p>
+
+ <ul>
+
+ <li><b>Correctness</b>: the libstdc++ debug mode must not change
+ the semantics of the standard library for all cases specified in
+ the ANSI/ISO C++ standard. The essence of this constraint is that
+ any valid C++ program should behave in the same manner regardless
+ of whether it is compiled with debug mode or release mode. In
+ particular, entities that are defined in namespace std in release
+ mode should remain defined in namespace std in debug mode, so that
+ legal specializations of namespace std entities will remain
+ valid. A program that is not valid C++ (e.g., invokes undefined
+ behavior) is not required to behave similarly, although the debug
+ mode will abort with a diagnostic when it detects undefined
+ behavior.</li>
+
+ <li><b>Performance</b>: the additional of the libstdc++ debug mode
+ must not affect the performance of the library when it is compiled
+ in release mode. Performance of the libstdc++ debug mode is
+ secondary (and, in fact, will be worse than the release
+ mode).</li>
+
+ <li><b>Usability</b>: the libstdc++ debug mode should be easy to
+ use. It should be easily incorporated into the user's development
+ environment (e.g., by requiring only a single new compiler switch)
+ and should produce reasonable diagnostics when it detects a
+ problem with the user program. Usability also involves detection
+ of errors when using the debug mode incorrectly, e.g., by linking
+ a release-compiled object against a debug-compiled object if in
+ fact the resulting program will not run correctly.</li>
+
+ <li><b>Minimize recompilation</b>: While it is expected that
+ users recompile at least part of their program to use debug
+ mode, the amount of recompilation affects the
+ detect-compile-debug turnaround time. This indirectly affects the
+ usefulness of the debug mode, because debugging some applications
+ may require rebuilding a large amount of code, which may not be
+ feasible when the suspect code may be very localized. There are
+ several levels of conformance to this requirement, each with its
+ own usability and implementation characteristics. In general, the
+ higher-numbered conformance levels are more usable (i.e., require
+ less recompilation) but are more complicated to implement than
+ the lower-numbered conformance levels.
+ <ol>
+ <li><b>Full recompilation</b>: The user must recompile his or
+ her entire application and all C++ libraries it depends on,
+ including the C++ standard library that ships with the
+ compiler. This must be done even if only a small part of the
+ program can use debugging features.</li>
+
+ <li><b>Full user recompilation</b>: The user must recompile
+ his or her entire application and all C++ libraries it depends
+ on, but not the C++ standard library itself. This must be done
+ even if only a small part of the program can use debugging
+ features. This can be achieved given a full recompilation
+ system by compiling two versions of the standard library when
+ the compiler is installed and linking against the appropriate
+ one, e.g., a multilibs approach.</li>
+
+ <li><b>Partial recompilation</b>: The user must recompile the
+ parts of his or her application and the C++ libraries it
+ depends on that will use the debugging facilities
+ directly. This means that any code that uses the debuggable
+ standard containers would need to be recompiled, but code
+ that does not use them (but may, for instance, use IOStreams)
+ would not have to be recompiled.</li>
+
+ <li><b>Per-use recompilation</b>: The user must recompile the
+ parts of his or her application and the C++ libraries it
+ depends on where debugging should occur, and any other code
+ that interacts with those containers. This means that a set of
+ translation units that accesses a particular standard
+ container instance may either be compiled in release mode (no
+ checking) or debug mode (full checking), but must all be
+ compiled in the same way; a translation unit that does not see
+ that standard container instance need not be recompiled. This
+ also means that a translation unit <em>A</em> that contains a
+ particular instantiation
+ (say, <code>std::vector&lt;int&gt;</code>) compiled in release
+ mode can be linked against a translation unit <em>B</em> that
+ contains the same instantiation compiled in debug mode (a
+ feature not present with partial recompilation). While this
+ behavior is technically a violation of the One Definition
+ Rule, this ability tends to be very important in
+ practice. The libstdc++ debug mode supports this level of
+ recompilation. </li>
+
+ <li><b>Per-unit recompilation</b>: The user must only
+ recompile the translation units where checking should occur,
+ regardless of where debuggable standard containers are
+ used. This has also been dubbed "<code>-g</code> mode",
+ because the <code>-g</code> compiler switch works in this way,
+ emitting debugging information at a per--translation-unit
+ granularity. We believe that this level of recompilation is in
+ fact not possible if we intend to supply safe iterators, leave
+ the program semantics unchanged, and not regress in
+ performance under release mode because we cannot associate
+ extra information with an iterator (to form a safe iterator)
+ without either reserving that space in release mode
+ (performance regression) or allocating extra memory associated
+ with each iterator with <code>new</code> (changes the program
+ semantics).</li>
+ </ol>
+ </li>
+ </ul>
+
+<h2><a name="other">Other implementations</a></h2>
+<p> There are several existing implementations of debug modes for C++
+ standard library implementations, although none of them directly
+ supports debugging for programs using libstdc++. The existing
+ implementations include:</p>
+<ul>
+ <li><a
+ href="http://www.mathcs.sjsu.edu/faculty/horstman/safestl.html">SafeSTL</a>:
+ SafeSTL was the original debugging version of the Standard Template
+ Library (STL), implemented by Cay S. Horstmann on top of the
+ Hewlett-Packard STL. Though it inspired much work in this area, it
+ has not been kept up-to-date for use with modern compilers or C++
+ standard library implementations.</li>
+
+ <li><a href="http://www.stlport.org/">STLport</a>: STLport is a free
+ implementation of the C++ standard library derived from the <a
+ href="http://www.sgi.com/tech/stl/">SGI implementation</a>, and
+ ported to many other platforms. It includes a debug mode that uses a
+ wrapper model (that in some way inspired the libstdc++ debug mode
+ design), although at the time of this writing the debug mode is
+ somewhat incomplete and meets only the "Full user recompilation" (2)
+ recompilation guarantee by requiring the user to link against a
+ different library in debug mode vs. release mode.</li>
+
+ <li><a href="http://www.metrowerks.com/mw/default.htm">Metrowerks
+ CodeWarrior</a>: The C++ standard library that ships with Metrowerks
+ CodeWarrior includes a debug mode. It is a full debug-mode
+ implementation (including debugging for CodeWarrior extensions) and
+ is easy to use, although it meets only the "Full recompilation" (1)
+ recompilation guarantee.</li>
+</ul>
+
+<h2><a name="design">Debug mode design methodology</a></h2>
+<p>This section provides an overall view of the design of the
+ libstdc++ debug mode and details the relationship between design
+ decisions and the stated design goals.</p>
+
+<h3><a name="wrappers">The wrapper model</a></h3>
+<p>The libstdc++ debug mode uses a wrapper model where the debugging
+ versions of library components (e.g., iterators and containers) form
+ a layer on top of the release versions of the library
+ components. The debugging components first verify that the operation
+ is correct (aborting with a diagnostic if an error is found) and
+ will then forward to the underlying release-mode container that will
+ perform the actual work. This design decision ensures that we cannot
+ regress release-mode performance (because the release-mode
+ containers are left untouched) and partially enables <a
+ href="#mixing">mixing debug and release code</a> at link time,
+ although that will not be discussed at this time.</p>
+
+<p>Two types of wrappers are used in the implementation of the debug
+ mode: container wrappers and iterator wrappers. The two types of
+ wrappers interact to maintain relationships between iterators and
+ their associated containers, which are necessary to detect certain
+ types of standard library usage errors such as dereferencing
+ past-the-end iterators or inserting into a container using an
+ iterator from a different container.</p>
+
+<h4><a name="safe_iterator">Safe iterators</a></h4>
+<p>Iterator wrappers provide a debugging layer over any iterator that
+ is attached to a particular container, and will manage the
+ information detailing the iterator's state (singular,
+ dereferenceable, etc.) and tracking the container to which the
+ iterator is attached. Because iterators have a well-defined, common
+ interface the iterator wrapper is implemented with the iterator
+ adaptor class template <code>__gnu_debug::_Safe_iterator</code>,
+ which takes two template parameters:</p>
+
+<ul>
+ <li><code>Iterator</code>: The underlying iterator type, which must
+ be either the <code>iterator</code> or <code>const_iterator</code>
+ typedef from the sequence type this iterator can reference.</li>
+
+ <li><code>Sequence</code>: The type of sequence that this iterator
+ references. This sequence must be a safe sequence (discussed below)
+ whose <code>iterator</code> or <code>const_iterator</code> typedef
+ is the type of the safe iterator.</li>
+</ul>
+
+<h4><a name="safe_sequence">Safe sequences (containers)</a></h4>
+<p>Container wrappers provide a debugging layer over a particular
+ container type. Because containers vary greatly in the member
+ functions they support and the semantics of those member functions
+ (especially in the area of iterator invalidation), container
+ wrappers are tailored to the container they reference, e.g., the
+ debugging version of <code>std::list</code> duplicates the entire
+ interface of <code>std::list</code>, adding additional semantic
+ checks and then forwarding operations to the
+ real <code>std::list</code> (a public base class of the debugging
+ version) as appropriate. However, all safe containers inherit from
+ the class template <code>__gnu_debug::_Safe_sequence</code>,
+ instantiated with the type of the safe container itself (an instance
+ of the curiously recurring template pattern).</p>
+
+<p>The iterators of a container wrapper will be
+ <a href="#safe_iterator">safe iterators</a> that reference sequences
+ of this type and wrap the iterators provided by the release-mode
+ base class. The debugging container will use only the safe
+ iterators within its own interface (therefore requiring the user to
+ use safe iterators, although this does not change correct user
+ code) and will communicate with the release-mode base class with
+ only the underlying, unsafe, release-mode iterators that the base
+ class exports.</p>
+
+<p> The debugging version of <code>std::list</code> will have the
+ following basic structure:</p>
+
+<pre>
+template&lt;typename _Tp, typename _Allocator = allocator&lt;_Tp&gt;
+ class debug-list :
+ public release-list&lt;_Tp, _Allocator&gt;,
+ public __gnu_debug::_Safe_sequence&lt;debug-list&lt;_Tp, _Allocator&gt; &gt;
+ {
+ typedef release-list&lt;_Tp, _Allocator&gt; _Base;
+ typedef debug-list&lt;_Tp, _Allocator&gt; _Self;
+
+ public:
+ typedef __gnu_debug::_Safe_iterator&lt;typename _Base::iterator, _Self&gt; iterator;
+ typedef __gnu_debug::_Safe_iterator&lt;typename _Base::const_iterator, _Self&gt; const_iterator;
+
+ // duplicate std::list interface with debugging semantics
+ };
+</pre>
+
+<h3><a name="precondition">Precondition checking</a></h3>
+<p>The debug mode operates primarily by checking the preconditions of
+ all standard library operations that it supports. Preconditions that
+ are always checked (regardless of whether or not we are in debug
+ mode) are checked via the <code>__check_xxx</code> macros defined
+ and documented in the source
+ file <code>include/debug/debug.h</code>. Preconditions that may or
+ may not be checked, depending on the debug-mode
+ macro <code>_GLIBCXX_DEBUG</code>, are checked via
+ the <code>__requires_xxx</code> macros defined and documented in the
+ same source file. Preconditions are validated using any additional
+ information available at run-time, e.g., the containers that are
+ associated with a particular iterator, the position of the iterator
+ within those containers, the distance between two iterators that may
+ form a valid range, etc. In the absence of suitable information,
+ e.g., an input iterator that is not a safe iterator, these
+ precondition checks will silently succeed.</p>
+
+<p>The majority of precondition checks use the aforementioned macros,
+ which have the secondary benefit of having prewritten debug
+ messages that use information about the current status of the
+ objects involved (e.g., whether an iterator is singular or what
+ sequence it is attached to) along with some static information
+ (e.g., the names of the function parameters corresponding to the
+ objects involved). When not using these macros, the debug mode uses
+ either the debug-mode assertion
+ macro <code>_GLIBCXX_DEBUG_ASSERT</code> , its pedantic
+ cousin <code>_GLIBCXX_DEBUG_PEDASSERT</code>, or the assertion
+ check macro that supports more advance formulation of error
+ messages, <code>_GLIBCXX_DEBUG_VERIFY</code>. These macros are
+ documented more thoroughly in the debug mode source code.</p>
+
+<h3><a name="coexistence">Release- and debug-mode coexistence</a></h3>
+<p>The libstdc++ debug mode is the first debug mode we know of that
+ is able to provide the "Per-use recompilation" (4) guarantee, that
+ allows release-compiled and debug-compiled code to be linked and
+ executed together without causing unpredictable behavior. This
+ guarantee minimizes the recompilation that users are required to
+ perform, shortening the detect-compile-debug bughunting cycle
+ and making the debug mode easier to incorporate into development
+ environments by minimizing dependencies.</p>
+
+<p>Achieving link- and run-time coexistence is not a trivial
+ implementation task. To achieve this goal we required a small
+ extension to the GNU C++ compiler (described in the GCC Manual for
+ C++ Extensions, see <a
+ href="http://gcc.gnu.org/onlinedocs/gcc/Strong-Using.html">strong
+ using</a>), and a complex organization of debug- and
+ release-modes. The end result is that we have achieved per-use
+ recompilation but have had to give up some checking of the
+ <code>std::basic_string</code> class template (namely, safe
+ iterators).
+</p>
+
+<h4><a name="compile_coexistence">Compile-time coexistence of release- and
+ debug-mode components</a></h4>
+<p>Both the release-mode components and the debug-mode
+ components need to exist within a single translation unit so that
+ the debug versions can wrap the release versions. However, only one
+ of these components should be user-visible at any particular
+ time with the standard name, e.g., <code>std::list</code>. </p>
+
+<p>In release mode, we define only the release-mode version of the
+ component with its standard name and do not include the debugging
+ component at all. The release mode version is defined within the
+ namespace <code>__gnu_norm</code>, and then associated with namespace
+ <code>std</code> via a "strong using" directive. Minus the
+ namespace associations, this method leaves the behavior of release
+ mode completely unchanged from its behavior prior to the
+ introduction of the libstdc++ debug mode. Here's an example of what
+ this ends up looking like, in C++.</p>
+
+<pre>
+namespace __gnu_norm
+{
+ using namespace std;
+
+ template&lt;typename _Tp, typename _Alloc = allocator&lt;_Tp&gt; &gt;
+ class list
+ {
+ // ...
+ };
+} // namespace __gnu_norm
+
+namespace std
+{
+ using namespace __gnu_norm __attribute__ ((strong));
+}
+</pre>
+
+<p>In debug mode we include the release-mode container and also the
+debug-mode container. The release mode version is defined exactly as
+before, and the debug-mode container is defined within the namespace
+<code>__gnu_debug</code>, which is associated with namespace
+<code>std</code> via a "strong using" directive. This method allows
+the debug- and release-mode versions of the same component to coexist
+at compile-time without causing an unreasonable maintenance burden,
+while minimizing confusion. Again, this boils down to C++ code as
+follows:</p>
+
+<pre>
+namespace __gnu_norm
+{
+ using namespace std;
+
+ template&lt;typename _Tp, typename _Alloc = allocator&lt;_Tp&gt; &gt;
+ class list
+ {
+ // ...
+ };
+} // namespace __gnu_norm
+
+namespace __gnu_debug
+{
+ using namespace std;
+
+ template&lt;typename _Tp, typename _Alloc = allocator&lt;_Tp&gt; &gt;
+ class list
+ : public __gnu_norm::list&lt;_Tp, _Alloc&gt;,
+ public __gnu_debug::_Safe_sequence&lt;list&lt;_Tp, _Alloc&gt; &gt;
+ {
+ // ...
+ };
+} // namespace __gnu_norm
+
+namespace std
+{
+ using namespace __gnu_debug __attribute__ ((strong));
+}
+</pre>
+
+<h4><a name="mixing">Link- and run-time coexistence of release- and
+ debug-mode components</a></h4>
+
+<p>Because each component has a distinct and separate release and
+debug implementation, there are are no issues with link-time
+coexistence: the separate namespaces result in different mangled
+names, and thus unique linkage.</p>
+
+<p>However, components that are defined and used within the C++
+standard library itself face additional constraints. For instance,
+some of the member functions of <code> std::moneypunct</code> return
+<code>std::basic_string</code>. Normally, this is not a problem, but
+with a mixed mode standard library that could be using either
+debug-mode or release-mode <code> basic_string</code> objects, things
+get more complicated. As the return value of a function is not
+encoded into the mangled name, there is no way to specify a
+release-mode or a debug-mode string. In practice, this results in
+runtime errors. A simplified example of this problem is as follows.
+</p>
+
+<p> Take this translation unit, compiled in debug-mode: </p>
+<pre>
+// -D_GLIBCXX_DEBUG
+#include &lt;string&gt;
+
+std::string test02();
+
+std::string test01()
+{
+ return test02();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
+</pre>
+
+<p> ... and linked to this translation unit, compiled in release mode:</p>
+
+<pre>
+#include &lt;string&gt;
+
+std::string
+test02()
+{
+ return std::string("toast");
+}
+</pre>
+
+<p> For this reason we cannot easily provide safe iterators for
+ the <code>std::basic_string</code> class template, as it is present
+ throughout the C++ standard library. For instance, locale facets
+ define typedefs that include <code>basic_string</code>: in a mixed
+ debug/release program, should that typedef be based on the
+ debug-mode <code>basic_string</code> or the
+ release-mode <code>basic_string</code>? While the answer could be
+ "both", and the difference hidden via renaming a la the
+ debug/release containers, we must note two things about locale
+ facets:</p>
+
+<ol>
+ <li>They exist as shared state: one can create a facet in one
+ translation unit and access the facet via the same type name in a
+ different translation unit. This means that we cannot have two
+ different versions of locale facets, because the types would not be
+ the same across debug/release-mode translation unit barriers.</li>
+
+ <li>They have virtual functions returning strings: these functions
+ mangle in the same way regardless of the mangling of their return
+ types (see above), and their precise signatures can be relied upon
+ by users because they may be overridden in derived classes.</li>
+</ol>
+
+<p>With the design of libstdc++ debug mode, we cannot effectively hide
+ the differences between debug and release-mode strings from the
+ user. Failure to hide the differences may result in unpredictable
+ behavior, and for this reason we have opted to only
+ perform <code>basic_string</code> changes that do not require ABI
+ changes. The effect on users is expected to be minimal, as there are
+ simple alternatives (e.g., <code>__gnu_debug::basic_string</code>),
+ and the usability benefit we gain from the ability to mix debug- and
+ release-compiled translation units is enormous.</p>
+
+<h4><a name="coexistence_alt">Alternatives for Coexistence</a></h4>
+<p>The coexistence scheme above was chosen over many alternatives,
+ including language-only solutions and solutions that also required
+ extensions to the C++ front end. The following is a partial list of
+ solutions, with justifications for our rejection of each.</p>
+
+<ul>
+ <li><em>Completely separate debug/release libraries</em>: This is by
+ far the simplest implementation option, where we do not allow any
+ coexistence of debug- and release-compiled translation units in a
+ program. This solution has an extreme negative affect on usability,
+ because it is quite likely that some libraries an application
+ depends on cannot be recompiled easily. This would not meet
+ our <b>usability</b> or <b>minimize recompilation</b> criteria
+ well.</li>
+
+ <li><em>Add a <code>Debug</code> boolean template parameter</em>:
+ Partial specialization could be used to select the debug
+ implementation when <code>Debug == true</code>, and the state
+ of <code>_GLIBCXX_DEBUG</code> could decide whether the
+ default <code>Debug</code> argument is <code>true</code>
+ or <code>false</code>. This option would break conformance with the
+ C++ standard in both debug <em>and</em> release modes. This would
+ not meet our <b>correctness</b> criteria. </li>
+
+ <li><em>Packaging a debug flag in the allocators</em>: We could
+ reuse the <code>Allocator</code> template parameter of containers
+ by adding a sentinel wrapper <code>debug&lt;&gt;</code> that
+ signals the user's intention to use debugging, and pick up
+ the <code>debug&lt;&gt;</code> allocator wrapper in a partial
+ specialization. However, this has two drawbacks: first, there is a
+ conformance issue because the default allocator would not be the
+ standard-specified <code>std::allocator&lt;T&gt;</code>. Secondly
+ (and more importantly), users that specify allocators instead of
+ implicitly using the default allocator would not get debugging
+ containers. Thus this solution fails the <b>correctness</b>
+ criteria.</li>
+
+ <li><em>Define debug containers in another namespace, and employ
+ a <code>using</code> declaration (or directive)</em>: This is an
+ enticing option, because it would eliminate the need for
+ the <code>link_name</code> extension by aliasing the
+ templates. However, there is no true template aliasing mechanism
+ is C++, because both <code>using</code> directives and using
+ declarations disallow specialization. This method fails
+ the <b>correctness</b> criteria.</li>
+
+ <li><em> Use implementation-specific properties of anonymous
+ namespaces. </em>
+ See <a
+ href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00004.html"> this post
+ </a>
+ This method fails the <b>correctness</b> criteria.</li>
+
+ <li><em>Extension: allow reopening on namespaces</em>: This would
+ allow the debug mode to effectively alias the
+ namespace <code>std</code> to an internal namespace, such
+ as <code>__gnu_std_debug</code>, so that it is completely
+ separate from the release-mode <code>std</code> namespace. While
+ this will solve some renaming problems and ensure that
+ debug- and release-compiled code cannot be mixed unsafely, it ensures that
+ debug- and release-compiled code cannot be mixed at all. For
+ instance, the program would have two <code>std::cout</code>
+ objects! This solution would fails the <b>minimize
+ recompilation</b> requirement, because we would only be able to
+ support option (1) or (2).</li>
+
+ <li><em>Extension: use link name</em>: This option involves
+ complicated re-naming between debug-mode and release-mode
+ components at compile time, and then a g++ extension called <em>
+ link name </em> to recover the original names at link time. There
+ are two drawbacks to this approach. One, it's very verbose,
+ relying on macro renaming at compile time and several levels of
+ include ordering. Two, ODR issues remained with container member
+ functions taking no arguments in mixed-mode settings resulting in
+ equivalent link names, <code> vector::push_back() </code> being
+ one example.
+ See <a
+ href="http://gcc.gnu.org/ml/libstdc++/2003-08/msg00177.html">link
+ name</a> </li>
+</ul>
+
+<p>Other options may exist for implementing the debug mode, many of
+ which have probably been considered and others that may still be
+ lurking. This list may be expanded over time to include other
+ options that we could have implemented, but in all cases the full
+ ramifications of the approach (as measured against the design goals
+ for a libstdc++ debug mode) should be considered first. The DejaGNU
+ testsuite includes some testcases that check for known problems with
+ some solutions (e.g., the <code>using</code> declaration solution
+ that breaks user specialization), and additional testcases will be
+ added as we are able to identify other typical problem cases. These
+ test cases will serve as a benchmark by which we can compare debug
+ mode implementations.</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/documentation.html b/libstdc++-v3/docs/html/documentation.html
index 4ed22d59576..a4be76ed453 100644
--- a/libstdc++-v3/docs/html/documentation.html
+++ b/libstdc++-v3/docs/html/documentation.html
@@ -8,7 +8,9 @@
<meta name="KEYWORDS"
content="libstdc++, homepage, home, C++, library, c++, std, g++, ABI, STL" />
<title>GNU C++ Standard Library</title>
-<link rel="StyleSheet" href="lib3styles.css" />
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Copyright" href="17_intro/license.html" type="text/html" />
+<link rel="Help" href="faq/index.html" type="text/html" title="F.A.Q." />
</head>
<body>
@@ -154,6 +156,7 @@
<li><a href="21_strings/howto.html#3">Breaking a C++ string into tokens</a></li>
<li><a href="21_strings/howto.html#4">Simple transformations</a></li>
<li><a href="21_strings/howto.html#5">Making strings of arbitrary character types</a></li>
+ <li><a href="21_strings/howto.html#6">Shrink-to-fit strings</a></li>
</ul>
</li>
diff --git a/libstdc++-v3/docs/html/explanations.html b/libstdc++-v3/docs/html/explanations.html
index 86aa4036984..938b449d47a 100644
--- a/libstdc++-v3/docs/html/explanations.html
+++ b/libstdc++-v3/docs/html/explanations.html
@@ -10,7 +10,8 @@
<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" />
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Copyright" href="17_intro/license.html" type="text/html" />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/ext/howto.html b/libstdc++-v3/docs/html/ext/howto.html
index f9e7cb6e4d4..2ce76ee9db3 100644
--- a/libstdc++-v3/docs/html/ext/howto.html
+++ b/libstdc++-v3/docs/html/ext/howto.html
@@ -11,7 +11,14 @@
<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" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Prev" href="../27_io/howto.html" type="text/html"
+ title="Input/Output" />
+<link rel="Bookmark" href="sgiexts.html" type="text/html"
+ title="SGI extensions" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
</head>
<body>
@@ -474,8 +481,15 @@
<dt><a href="lwg-defects.html#60">60</a>:
<em>What is a formatted input function?</em>
</dt>
- <dd>This DR made many widespread changes to <code>basic_istream</code>,
- not all of which have been implemented.
+ <dd>This DR made many widespread changes to <code>basic_istream</code>
+ and <code>basic_ostream</code> all of which have been implemented.
+ </dd>
+
+ <dt><a href="lwg-defects.html#63">63</a>:
+ <em>Exception-handling policy for unformatted output</em>
+ </dt>
+ <dd>Make the policy consistent with that of formatted input, unformatted
+ input, and formatted output.
</dd>
<dt><a href="lwg-defects.html#68">68</a>:
@@ -491,6 +505,13 @@
<dd>The text of the standard was gibberish. Typos gone rampant.
</dd>
+ <dt><a href="lwg-defects.html#75">75</a>:
+ <em>Contradiction in codecvt::length's argument types</em>
+ </dt>
+ <dd>Change the first parameter to <code>stateT&amp;</code> and implement
+ the new effects paragraph.
+ </dd>
+
<dt><a href="lwg-defects.html#83">83</a>:
<em>string::npos vs. string::max_size()</em>
</dt>
@@ -505,6 +526,15 @@
replaced by <code>isspace(c,is.getloc())</code>.
</dd>
+ <dt><a href="lwg-defects.html#91">91</a>:
+ <em>Description of operator&gt;&gt; and getline() for string&lt;&gt;
+ might cause endless loop</em>
+ </dt>
+ <dd>They behave as a formatted input function and as an unformatted
+ input function, respectively (except that <code>getline</code> is
+ not required to set <code>gcount</code>).
+ </dd>
+
<dt><a href="lwg-defects.html#109">109</a>:
<em>Missing binders for non-const sequence elements</em>
</dt>
@@ -593,7 +623,7 @@
for const instances.
</dd>
- <dt><a href="lwg-active.html#231">231</a>:
+ <dt><a href="lwg-defects.html#231">231</a>:
<em>Precision in iostream?</em>
</dt>
<dd>For conversion from a floating-point type, <code>str.precision()</code>
@@ -646,6 +676,37 @@
<dd>If <code>(this == &amp;rhs)</code> do nothing.
</dd>
+ <dt><a href="lwg-defects.html#300">300</a>:
+ <em>List::merge() specification incomplete</em>
+ </dt>
+ <dd>If <code>(this == &amp;x)</code> do nothing.
+ </dd>
+
+ <dt><a href="lwg-defects.html#303">303</a>:
+ <em>Bitset input operator underspecified</em>
+ </dt>
+ <dd>Basically, compare the input character to <code>is.widen(0)</code>
+ and <code>is.widen(1)</code>.
+ </dd>
+
+ <dt><a href="lwg-defects.html#305">305</a>:
+ <em>Default behavior of codecvt&lt;wchar_t, char, mbstate_t&gt;::length()</em>
+ </dt>
+ <dd>Do not specify what <code>codecvt&lt;wchar_t, char, mbstate_t&gt;::do_length</code>
+ must return.
+ </dd>
+
+ <dt><a href="lwg-defects.html#328">328</a>:
+ <em>Bad sprintf format modifier in money_put&lt;&gt;::do_put()</em>
+ </dt>
+ <dd>Change the format string to &quot;%.0Lf&quot;.
+ </dd>
+
+ <dt><a href="lwg-active.html#402">402</a>:
+ <em>Wrong new expression in [some_]allocator::construct</em>
+ </dt>
+ <dd>Replace &quot;new&quot; with &quot;::new&quot;.
+ </dd>
<!--
<dt><a href="lwg-defects.html#"></a>:
<em></em>
diff --git a/libstdc++-v3/docs/html/ext/lwg-active.html b/libstdc++-v3/docs/html/ext/lwg-active.html
index a69d6c67c40..235e51dce36 100644
--- a/libstdc++-v3/docs/html/ext/lwg-active.html
+++ b/libstdc++-v3/docs/html/ext/lwg-active.html
@@ -1,15 +1,14 @@
-<!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">
+<!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 text="#000000" bgcolor="#ffffff">
<table>
-<tr>
+<tbody><tr>
<td align="left">Doc. no.</td>
-<td align="left">J16/02-0048 = WG21 N1390</td>
+<td align="left">N1515 = 03-0098</td>
</tr>
<tr>
<td align="left">Date:</td>
-<td align="left">10 Sep 2002</td>
+<td align="left">20 Sep 2003</td>
</tr>
<tr>
<td align="left">Project:</td>
@@ -19,19 +18,19 @@
<td align="left">Reply to:</td>
<td align="left">Matt Austern &lt;austern@apple.com&gt;</td>
</tr>
-</table>
-<h1>C++ Standard Library Active Issues List (Revision 23)</h1>
+</tbody></table>
+<h1>C++ Standard Library Active Issues List (Revision 27)</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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-status.html">Index by Status</a> for all library issues.</li>
+ <li><a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html">Library Defect Reports List</a></li>
+ <li><a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -41,10 +40,10 @@
<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>
+ status of <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>,
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Ready">Ready</a>, and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>. See
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html">Library Defect Reports List</a> for issues considered defects and
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -77,8 +76,8 @@
<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%2B%2B">news:comp.std.c++</a>.
+ can be found in the comp.std.c++ FAQ.
+ Public discussion of C++ Standard related issues occurs on <a href="news://comp.std.c%2b%2b/">news:comp.std.c++</a>.
</p>
<p>For committee members, files available on the committee's private
@@ -88,167 +87,185 @@
directory as the issues list files. </p>
<h2>Revision History</h2>
<ul>
+<li>R27:
+Pre-Kona mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#404">404</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#431">431</a>.
+</li>
+<li>R26:
+Post-Oxford mailing: reflects decisions made at the Oxford meeting.
+All issues in Ready status were voted into DR status. All issues in
+DR status were voted into WP status.
+</li>
+<li>R25:
+Pre-Oxford mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#390">390</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#402">402</a>.
+</li>
+<li>R24:
+Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz
+meeting. All Ready issues from R23 with the exception of <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#253">253</a>, which has been given a new proposed resolution, were
+moved to DR status. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#383">383</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#389">389</a>. (Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#387">387</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#389">389</a> were discussed
+at the meeting.) Made progress on issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#229">229</a>: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a> and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#229">229</a> have been moved to Ready status, and the only remaining
+concerns with <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a> involve wording.
+</li>
<li>R23:
-Pre-Santa Cruz mailing. Added new issues <a href="lwg-active.html#367">367</a>-<a href="lwg-active.html#382">382</a>.
+Pre-Santa Cruz mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#367">367</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#382">382</a>.
Moved issues in the TC to TC status.
</li>
<li>R22:
-Post-Cura&ccedil;ao mailing. Added new issues <a href="lwg-active.html#362">362</a>-<a href="lwg-active.html#366">366</a>.
+Post-Curaçao mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#362">362</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#366">366</a>.
</li>
<li>R21:
-Pre-Cura&ccedil;ao mailing. Added new issues <a href="lwg-closed.html#351">351</a>-<a href="lwg-active.html#361">361</a>.
+Pre-Curaçao mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#351">351</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#361">361</a>.
</li>
<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
+new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#336">336</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#350">350</a>, of which issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#347">347</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.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-defects.html#284">284</a>, <a href="lwg-active.html#241">241</a>, and <a href="lwg-closed.html#267">267</a>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#284">284</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#241">241</a>, and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#120">120</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#202">202</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#233">233</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#270">270</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#253">253</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#254">254</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#323">323</a>.
</li>
<li>R19:
Pre-Redmond mailing. Added new issues
-<a href="lwg-active.html#323">323</a>-<a href="lwg-defects.html#335">335</a>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#323">323</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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-defects.html#317">317</a>, and discussed
-new issues <a href="lwg-defects.html#271">271</a>-<a href="lwg-closed.html#314">314</a>.
+Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#312">312</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#317">317</a>, and discussed
+new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#271">271</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#103">103</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#118">118</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#136">136</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#153">153</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#165">165</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#171">171</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#183">183</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#184">184</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#185">185</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#186">186</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#214">214</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#221">221</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#234">234</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#237">237</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#243">243</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#248">248</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#251">251</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#252">252</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#256">256</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#260">260</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#261">261</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#262">262</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#263">263</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#265">265</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#49">49</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#109">109</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#117">117</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#182">182</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#228">228</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#230">230</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#232">232</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#238">238</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#241">241</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#242">242</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#250">250</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#259">259</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#264">264</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#266">266</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#267">267</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#271">271</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#272">272</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#273">273</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#275">275</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#281">281</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#284">284</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#285">285</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#286">286</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#288">288</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#292">292</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#295">295</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#297">297</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#298">298</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#301">301</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#303">303</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#306">306</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#307">307</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#308">308</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#111">111</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#277">277</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#279">279</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#287">287</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#289">289</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#293">293</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#302">302</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#313">313</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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-defects.html#311">311</a>.
+resolutions for issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#49">49</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#76">76</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#91">91</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#250">250</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#267">267</a>.
+Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#278">278</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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
+issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#265">265</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#277">277</a>. Changed status of issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#3">3</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#8">8</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#9">9</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#19">19</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#26">26</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#31">31</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#61">61</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#63">63</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#86">86</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#108">108</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#114">114</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#115">115</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#122">122</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#127">127</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#129">129</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#134">134</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#137">137</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#142">142</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#144">144</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#146">146</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#147">147</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#159">159</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#164">164</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#170">170</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#181">181</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#199">199</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#208">208</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#209">209</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#210">210</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#211">211</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#212">212</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#217">217</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#220">220</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#222">222</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#223">223</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#224">224</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#227">227</a> to "DR". Reopened issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#23">23</a>. Reopened
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#187">187</a>. Changed issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#2">2</a> and
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> to NAD. Fixed a typo in issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#17">17</a>. Fixed
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#70">70</a>: signature should be changed both places it
+appears. Fixed issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#233">233</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+Tokyo. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#228">228</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+pre-Tokyo II updated: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#212">212</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+pre-Tokyo II mailing: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#199">199</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#211">211</a>. Added "and paragraph 5" to the proposed resolution
+of issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#29">29</a>. Add further rationale to issue
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#38">38</a>. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#196">196</a>
+to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#198">198</a>. Closed issues list split into "defects" and
+"closed" documents. Changed the proposed resolution of issue
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> to NAD, and changed the wording of proposed resolution
+of issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Kona updated. Added proposed resolutions <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#83">83</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#86">86</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#91">91</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#92">92</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#109">109</a>. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#190">190</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Kona mailing. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#140">140</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#189">189</a>. Issues list split into separate "active" and
+"closed" 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)
+pre-Dublin updated: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#130">130</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#131">131</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#132">132</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#133">133</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#134">134</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#135">135</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#136">136</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#137">137</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#138">138</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Dublin mailing. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#127">127</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#128">128</a>,
+and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+update issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#103">103</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>; added issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#114">114</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+post-Santa Cruz II updated: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#110">110</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#111">111</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+post-Santa Cruz II: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#94">94</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Santa Cruz II: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#73">73</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#93">93</a> added,
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+Correction to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#55">55</a> resolution, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#60">60</a> code
+format, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#64">64</a> title. (17 Sep 98)
</li>
</ul>
<h2>
@@ -318,6 +335,12 @@ format, <a href="lwg-defects.html#64">64</a> title. (17 Sep 98)
complete and no further action is possible under ISO rules.</p>
<p>
+<b><a name="WP">WP</a></b> - (Working Paper) - The proposed
+ resolution has not been accepted as a Technical Corrigendum, but
+ the full WG21 committee has voted to apply the Defect Report's Proposed
+ Resolution to the working paper.</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
@@ -328,17 +351,17 @@ format, <a href="lwg-defects.html#64">64</a> title. (17 Sep 98)
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
+ <p>Issues are always given the status of <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a> or <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Dup">Dup</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#NAD">NAD</a>, or <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>),
+ status of Defect Report ( <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#DR">DR</a>). These in turn may
+ become the basis for Technical Corrigenda (<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ (<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -346,15 +369,16 @@ format, <a href="lwg-defects.html#64">64</a> title. (17 Sep 98)
<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
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>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>
@@ -370,7 +394,7 @@ and hard to trace, so I will describe it briefly:
<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>
+ According to 22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
@@ -412,7 +436,7 @@ and hard to trace, so I will describe it briefly:
<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>
+"input error". 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>
@@ -428,12 +452,69 @@ upon overflow. We considered three options based on this:</p>
<p>Straw poll: (1) 5; (2) 0; (3) 8.</p>
-<p>PJP will provide wording.</p>
+<p><b>Further discussion from Santa Cruz:</b></p>
+
+<p>There was some discussion of what the intent of our error
+ reporting mechanism was. There was general agreement on the
+ following principles:</p>
+<ul>
+<li>We want to convert strings to numbers in the same way as the
+ C <tt>strto*</tt> functions do. The same things that those
+ functions would consider errors, we consider errors.</li>
+<li>Overflow is an error. Floating-point underflow is not an error.
+ 1.e-9999999, for example, should be treated as 0. (A negative
+ number whose magnitude is too large is still overflow, and is just
+ the same error as a positive number whose magnitude is too large.
+ Finally, <tt>strtoul</tt> already specifies what happens if you
+ try to convert a sequence beginning with a minus sign into an
+ unsigned value.)</li>
+<li>Our mechanism for reporting errors is to set failbit. Our
+ mechanism is not errno. Nothing in the standard should
+ require or imply that streams or facets ever set errno.
+ (Even if some implementations might have that effect.) </li>
+</ul>
+
+<p>The crux of the disagreement was that some people, but not all,
+ believed that the design was also based on a fourth principle:
+ whenever converstion fails and failbit is set, nothing is to be
+ extracted and the value of the variable being extracted into is
+ guaranteed to be unchanged.</p>
+
+<p>Some people believe that upon overflow, an implementation should
+ "extract" a special value that allows the user to tell that it was
+ overflow instead of some other kind of error. Straw poll: 1 person
+ believed the standard should require that, 2 thought it should
+ forbid it, and 6 thought the standard should allow but not require
+ it.</p>
<p><b>Proposed resolution:</b></p>
+<p>typo: 22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, para 2, bullet 3. Strike "in." from
+the end.</p>
+
+<p>Change 22.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.nm.put"> [lib.locale.nm.put]</a>, para 11, bullet 2 from:</p>
+<blockquote>
+The sequence of chars accumulated in stage 2 would have
+caused scanf to report an input failure. ios_base::failbit is
+assigned to err.
+</blockquote>
+
+<p>to:</p>
+<blockquote>
+The sequence of chars accumulated in stage 2 would have
+caused scanf to report an input failure or to store a value
+outside the range representable by val. ios_base::failbit is
+assigned to err.
+</blockquote>
+
+<p><i>[PJP provided wording. this treats overflow or underflow the same
+as an ill-formed field. It's not exactly the consensus from Santa
+Cruz, but he thinks it's the simplest and most robust rule and that it
+corresponds to widespread common practice.]</i></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>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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
@@ -441,78 +522,266 @@ 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>[Pre-Kona: Dietmar supplied 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>
+<p>List of changes to clause 27:</p>
+<ol>
+<li>
+ In lib.basic.ios.members paragraph 13 (postcondition clause for
+ 'fill(cT)') change
+
+<blockquote>
+ fillch == fill()
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(fillch, fill())
+</blockquote>
+
+
+</li>
+<li>
+ In lib.istream.unformatted paragraph 7 (effects clause for
+ 'get(cT,streamsize,cT)'), third bullet, change
-<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#Ready">Ready</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:
+ c == delim for the next available input character c
</blockquote>
-<p>with:</p>
+
+ to
+
+<blockquote>
+ traits::eq(c, delim) for the next available input character c
+ </blockquote>
+
+</li>
+<li>
+ In lib.istream.unformatted paragraph 12 (effects clause for
+ 'get(basic_streambuf&lt;cT,Tr&gt;&amp;,cT)'), third bullet, change
+
<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:
+ c == delim for the next available input character c
</blockquote>
-<p>In 21.3.7.9 <a href="lib-strings.html#lib.string.io"> [lib.string.io]</a>, paragraph 6, replace</p>
+ to
+
<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:
+ traits::eq(c, delim) for the next available input character c
</blockquote>
-<p>with:</p>
+
+</li>
+<li>
+ In lib.istream.unformatted paragraph 17 (effects clause for
+ 'getline(cT,streamsize,cT)'), second bullet, change
+
<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:
+ c == delim for the next available input character c
</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>
+ to
-<p><i>[Cura&ccedil;ao: Nico agrees with proposed resolution.]</i></p>
+<blockquote>
+ traits::eq(c, delim) for the next available input character c
+ </blockquote>
+
+</li>
+<li>
+ In lib.istream.unformatted paragraph 24 (effects clause for
+ 'ignore(int,int_type)'), second bullet, change
+
+<blockquote>
+ c == delim for the next available input character c
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq_int_type(c, delim) for the next available input
+ character c
+</blockquote>
+
+</li>
+<li>
+ In lib.istream.unformatted paragraph 25 (notes clause for
+ 'ignore(int,int_type)'), second bullet, change
+
+<blockquote>
+ The last condition will never occur if delim == traits::eof()
+</blockquote>
+
+ to
+
+<blockquote>
+ The last condition will never occur if
+ traits::eq_int_type(delim, traits::eof()).
+</blockquote>
+
+</li>
+<li>
+ In lib.istream.sentry paragraph 6 (example implementation for the
+ sentry constructor) change
+
+<blockquote>
+ while ((c = is.rdbuf()-&gt;snextc()) != traits::eof()) {
+</blockquote>
+
+ to
+
+<blockquote>
+ while (!traits::eq_int_type(c = is.rdbuf()-&gt;snextc(), traits::eof())) {
+</blockquote>
+
+</li>
+</ol>
+
+<p>List of changes to Chapter 21:</p>
+
+<ol>
+<li>
+ In lib.string::find paragraph 1 (effects clause for find()),
+ second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+
+</li>
+<li>
+ In lib.string::rfind paragraph 1 (effects clause for rfind()),
+ second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+
+</li>
+<li>
+ In lib.string::find.first.of paragraph 1 (effects clause for
+ find_first_of()), second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+
+</li>
+<li>
+ In lib.string::find.last.of paragraph 1 (effects clause for
+ find_last_of()), second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+
+</li>
+<li>
+ In lib.string::find.first.not.of paragraph 1 (effects clause for
+ find_first_not_of()), second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+</li>
+
+<li>
+ In lib.string::find.last.not.of paragraph 1 (effects clause for
+ find_last_not_of()), second bullet, change
+
+<blockquote>
+ at(xpos+I) == str.at(I) for all elements ...
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(at(xpos+I), str.at(I)) for all elements ...
+</blockquote>
+</li>
+
+<li>
+ In lib.string.ios paragraph 5 (effects clause for getline()),
+ second bullet, change
+
+<blockquote>
+ c == delim for the next available input character c
+</blockquote>
+
+ to
+
+<blockquote>
+ traits::eq(c, delim) for the next available input character c
+</blockquote>
+</li>
+
+</ol>
+
+<p>Notes:</p>
+<ul>
+<li>
+ Fixing this issue highlights another sloppyness in
+ lib.istream.unformatted paragraph 24: this clause mentions a "character"
+ which is then compared to an 'int_type' (see item 5. in the list
+ below). It is not clear whether this requires explicit words and
+ if so what these words are supposed to be. A similar issue exists,
+ BTW, for operator*() of istreambuf_iterator which returns the result
+ of sgetc() as a character type (see lib.istreambuf.iterator::op*
+ paragraph 1), and for operator++() of istreambuf_iterator which
+ passes the result of sbumpc() to a constructor taking a char_type
+ (see lib.istreambuf.iterator::operator++ paragraph 3). Similarily, the
+ assignment operator ostreambuf_iterator passes a char_type to a function
+ taking an int_type (see lib.ostreambuf.iter.ops paragraph 1).
+</li>
+<li>
+ It is inconsistent to use comparisons using the traits functions in
+ Chapter 27 while not using them in Chapter 21, especially as some
+ of the inconsistent uses actually involve streams (eg. getline() on
+ streams). To avoid leaving this issue open still longer due to this
+ inconsistency (it is open since 1998), a list of changes to Chapter
+ 21 is below.
+</li>
+<li>
+ In Chapter 24 there are several places with statements like "the end
+ of stream is reached (streambuf_type::sgetc() returns traits::eof())"
+ (lib.istreambuf.iterator paragraph 1, lib.ostreambuf.iter.ops
+ paragraph 5). It is unclear whether these should be clarified to use
+ traits::eq_int_type() for detecting traits::eof().
+</li>
+</ul>
-<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>
+<b>Section:</b>&nbsp;25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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>
@@ -560,37 +829,16 @@ 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>
+<p>Add a new paragraph following 25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a> paragraph 8:</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.
+[Note: Unless otherwise specified, algorithms that take function
+objects as arguments are permitted to copy those function objects
+freely. Programmers for whom object identity is important should
+consider using a wrapper class that points to a noncopied
+implementation object, or some equivalent solution.]
</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
@@ -598,38 +846,35 @@ 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
+have a clear statement of "predicate" in the
+standard. People including me seemed to think "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
+predicate". 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
+<p><i>[Kona: Nico will provide wording to the effect that "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>
+objects by algorithms is unspecified".&nbsp; Consider placing in
+25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a> after paragraph 9.]</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>[Santa Cruz: The standard doesn't currently guarantee that
+ functions object won't be copied, and what isn't forbidden is
+ allowed. It is believed (especially since implementations that were
+ written in concert with the standard do make copies of function
+ objects) that this was intentional. Thus, no normative change is
+ needed. What we should put in is a non-normative note suggesting to
+ programmers that if they want to guarantee the lack of copying they
+ should use something like the <tt>ref</tt> wrapper.]</i></p>
-<p><i>[Post-Tokyo: Nico provided the above proposed
-resolutions.]</i></p>
+<p><i>[Oxford: Matt provided wording.]</i></p>
-<p><i>[Cura&ccedil;ao: Nico will provide wording to make options clearer: are
-the exclusive, or is one a superset of the other?]</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>
+<b>Section:</b>&nbsp;23.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.bool"> [lib.vector.bool]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -659,7 +904,7 @@ 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>
+had at least one "over my dead body" 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)
@@ -691,34 +936,44 @@ 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
+<b>Section:</b>&nbsp;24.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.input.iterators"> [lib.input.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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;.
+specified to be "T", as opposed to something like "convertible to T".
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><i>[Issue still isn't clear. Matt will try to explain it more
-clearly at the next meeting.]</i></p>
+of this code, including side effects. (Does this mean that *r++
+should invoke the copy constructor exactly as many times as the sample
+code above would?) See issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#334">334</a> for a similar
+problem.</p>
<p><b>Proposed resolution:</b></p>
+In Table 72 in 24.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.input.iterators"> [lib.input.iterators]</a>, change the return type
+for <tt>*r++</tt> from <tt>T</tt> to "convertible to T".
+<p><b>Rationale:</b></p>
+<p>This issue has two parts: the return type, and the number of times
+ the copy constructor is invoked.</p>
+
+<p>The LWG believes the the first part is a real issue. It's
+ inappropriate for the return type to be specified so much more
+ precisely for *r++ than it is for *r. In particular, if r is of
+ (say) type <tt>int*</tt>, then *r++ isn't <tt>int</tt>,
+ but <tt>int&amp;</tt>.</p>
+
+<p>The LWG does not believe that the number of times the copy
+ constructor is invoked is a real issue. This can vary in any case,
+ because of language rules on copy constructor elision. That's too
+ much to read into these semantics clauses.</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>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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
@@ -741,7 +996,7 @@ 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
+<p>The issue, then, is: are users allowed to explicitly 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>
@@ -759,26 +1014,24 @@ 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
+special: the "undefined behavior" 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>
+ <p>Append to 17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p><b>Rationale:</b></p>
+<p>The LWG considered another possible resolution:</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>
+ note to the end of 17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -786,177 +1039,40 @@ different explicit instantiations might be harmless.</p>
</blockquote>
</blockquote>
-<p><i>[Copenhagen: LWG discussed three options. (1) Users may not
-explicitly instantiate standard library templates, except on
-user-defined types. Consequence: library implementors may freely
-specialize or instantiate templates. (2) Users may explicitly
-instantiate any standard library template. Consequence: if
-implementors specialize or instantiate library templates, they may
-need to take special steps to make sure users can do it too. (3) 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.
-]</i></p>
-
-<p><i>[Straw poll (first number is favor, second is strongly oppose): 1
-- 4, 0; 2 - 9, 1; 3 - 0, 9. (Proposed resolution 1 was the original
-proposed resolution.) Because there was no support for option 3, no
-wording is provided.]</i></p>
-
-<p><i>[Redmond: discussed again; straw poll had results similar to
-those of Copenhagen (1 - 1, 3; 2 - 8, 4; 3 - 6, 2). Most people said
-they could live with any option. The only objection to option 2 is
-potential implementation difficulty. Steve Clamage volunteered do a
-survey to see if there are any popular platforms where option 2 would
-present a real problem for implementors. See his reflector message,
-c++std-lib-9002.
-]</i></p>
-
-<p><i>[Steve and Pete Becker will talk to Jonathan Caves. The
-Microsoft linker might present a problem if there are multiple copies,
-some of which have static data and some of which are in DLLs. There
-may be similar problems with the Apple linker; Matt will clarify
-that.]</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#Ready">Ready</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>
+<p>The LWG rejected this because it was believed that it would make
+ it unnecessarily difficult for library implementors to write
+ high-quality implementations. A program may not include an
+ explicit instantiation of the same template, for the same template
+ arguments, in two different translation units. If users are
+ allowed to provide explicit instantiations of Standard Library
+ templates for built-in types, then library implementors aren't,
+ at least not without nonportable tricks.</p>
+
+<p>The most serious problem is a class template that has writeable
+ static member variables. Unfortunately, such class templates are
+ important and, in existing Standard Library implementations, are
+ often explicitly specialized by library implementors: locale facets,
+ which have a writeable static member variable <tt>id</tt>. If a
+ user's explicit instantiation collided with the implementations
+ explicit instantiation, iostream initialization could cause locales
+ to be constructed in an inconsistent state.</p>
+
+<p>One proposed implementation technique was for Standard Library
+ implementors to provide explicit instantiations in separate object
+ files, so that they would not be picked up by the linker when the
+ user also provides an explicit instantiation. However, this
+ technique only applies for Standard Library implementations that
+ are packaged as static archives. Most Standard Library
+ implementations nowadays are packaged as dynamic libraries, so this
+ technique would not apply.</p>
+
+<p>The Committee is now considering standardization of dynamic
+ linking. If there are such changes in the future, it may be
+ appropriate to revisit this issue later.</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>
+<b>Section:</b>&nbsp;27.6.2.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.inserters.character"> [lib.ostream.inserters.character]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
@@ -965,7 +1081,7 @@ 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>
+<p>Change 27.6.2.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -980,226 +1096,61 @@ const*</tt>.</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>
+ constructed it inserts <i>n</i> characters starting at <i>s</i>,
+ where <i>n</i> is:</p>
+ <ul>
+ <li>traits::length(s) for the overload where the first argument is of
+ type basic_ostream&lt;charT, traits&gt;&amp; and the second is
+ of type const charT*, and also for the overload where the first
+ argument is of type basic_ostream&lt;char, traits&gt;&amp; and
+ the second is of type const char*.</li>
+ <li>std::char_traits&lt;char&gt;::length(s)
+ for the overload where the first argument is of type
+ basic_ostream&lt;charT, traits&gt;&amp; and the second is of type
+ const char*.</li>
+ <li>traits::length(reinterpret_cast&lt;const char*&gt;(s))
+ for the other two overloads.</li>
+ </ul>
<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#Ready">Ready</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>
+ lib.facet.num.put.virtuals. The <i>n</i> characters starting at
+ <i>s</i> 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>[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>[Santa Cruz: Matt supplied new wording]</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>
-
+<p>We have five separate cases. In two of them we can use the
+user-supplied traits class without any fuss. In the other three we
+try to use something as close to that user-supplied class as possible.
+In two cases we've got a traits class that's appropriate for
+char and what we've got is a const signed char* or a const
+unsigned char*; that's close enough so we can just use a reinterpret
+cast, and continue to use the user-supplied traits class. Finally,
+there's one case where we just have to give up: where we've got a
+traits class for some arbitrary charT type, and we somehow have to
+deal with a const char*. There's nothing better to do but fall back
+to char_traits&lt;char&gt;</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>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>1) The largest container the implementation can support given "best
+case" conditions - i.e. assume the run-time platform is "configured to
+the max", 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;
+2) The largest container the program could create, given "best case"
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
+"storage=storage-sizeof(program)"). This does NOT include any resource
allocated by the program. This may (or may not) be determinable at
compile time.<br>
<br>
@@ -1215,21 +1166,21 @@ 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>
+<p>Change 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+(5.19 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+Change 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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().
+(5.19 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -1238,8 +1189,8 @@ 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
+request of the LWG. 21.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.capacity"> [lib.string.capacity]</a> was not changed because it
+references max_size() in 23.1. The term "compile-time" was
avoided because it is not defined anywhere in the standard (even
though it is used several places in the library clauses).]</i></p>
@@ -1249,44 +1200,11 @@ 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="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#Ready">Ready</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>
+<b>Section:</b>&nbsp;18.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.limits"> [lib.limits]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
+In some places in this section, the terms "fundamental types" and
+"scalar types" are used when the term "arithmetic types" 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.
@@ -1295,26 +1213,34 @@ specializations of numeric_limits.
<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>
+<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>
+<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
+<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
+<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>
@@ -1345,259 +1271,33 @@ types.</p>
<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
+<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,
+<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
+flawed. The term "arithmetic types" 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
+It is also not clear that the term "implementation
+dependent" 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#Ready">Ready</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+1, 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><i>[Cura&ccedil;ao: The LWG changed &quot;... the range (first,
-last)...&quot; to &quot;... the range [first+1, last)...&quot; for
-clarity. They considered this change close enough to editorial to not
-require another round of review.]</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#Review">Review</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>
-
-<p><i>[Cura&ccedil;ao: An LWG-subgroup spent an afternoon working on issues
-225, 226, and 229. Their conclusion was that the issues should be
-separated into an LWG portion (Howard's paper, N1387=02-0045), and a
-EWG portion (Dave will write a proposal). The LWG and EWG had
-(separate) discussions of this plan the next day. The proposed
-resolution for this issue is in accordance with Howard's paper.]</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#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;01 Apr 2000</p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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>
@@ -1635,12 +1335,12 @@ namespace lib2
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
+"reserves" 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>
+library could cause serious problems (see issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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>
@@ -1661,8 +1361,8 @@ language rules. On the other hand, the following full specialization is legal:</
}</pre>
</blockquote>
-<p>This issue reflects concerns raised by the &quot;Namespace issue
-with specialized swap&quot; thread on comp.lang.c++.moderated. A
+<p>This issue reflects concerns raised by the "Namespace issue
+with specialized swap" 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>
@@ -1682,11 +1382,11 @@ not provide an operator&lt;&lt; for std::pair&lt;&gt;.
<p><b>Proposed resolution:</b></p>
-<p>Adopt the wording in the <b>Customization Points</b> section of
-Howard Hinnant's paper, N1387=02-0045.</p>
+<p>Adopt the wording proposed in Howard Hinnant's paper N1439=03-0021,
+"Proposed Resolution To LWG issues 225, 226, 229".</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
+<p><i>[Tokyo: Summary, "There is no conforming way to extend
+std::swap for user defined templates."&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
@@ -1695,8 +1395,8 @@ 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
+J16/00-0029==WG21/N1252, "Shades of namespace std functions
+" 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
@@ -1740,137 +1440,32 @@ 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>
-<p><i>[Cura&ccedil;ao: An LWG-subgroup spent an afternoon working on issues
+<p><i>[Curaçao: An LWG-subgroup spent an afternoon working on issues
225, 226, and 229. Their conclusion was that the issues should be
separated into an LWG portion (Howard's paper, N1387=02-0045), and a
EWG portion (Dave will write a proposal). The LWG and EWG had
(separate) discussions of this plan the next day. The proposed
resolution is the one proposed by Howard.]</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#Review">Review</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>
-
-<p><i>[Cura&ccedil;ao: An LWG-subgroup spent an afternoon working on issues
-225, 226, and 229. Their conclusion was that the issues should be
-separated into an LWG portion (Howard's paper, N1387=02-0045), and a
-EWG portion (Dave will write a proposal). The LWG and EWG had
-(separate) discussions of this plan the next day. This paper resolves
-issues 225 and 226. In light of that resolution, the proposed
-resolution for the current issue makes sense.]</i></p>
+<p><i>[Santa Cruz: the LWG agreed with the general direction of
+ Howard's paper, N1387. (Roughly: Koenig lookup is disabled unless
+ we say otherwise; this issue is about when we do say otherwise.)
+ However, there were concerns about wording. Howard will provide new
+ wording. Bill and Jeremy will review it.]</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#Review">Review</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;
+<p><i>[Oxford: Howard proposed the new wording.]</i></p>
- 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>
-Replace 22.2.2.2.2 <a href="lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, paragraph 11, with the following
-sentence:
-</p>
-<blockquote>
-For conversion from a floating-point type,
-<tt><i>str</i>.precision()</tt> is specified in the conversion
-specification.
-</blockquote>
<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 %g.</p>
-<p>Turning to the C standard, a precision of 0 is meaningful
-for %f and %e. For %g, precision 0 is taken to be the same as
-precision 1.</p>
-<p>The proposed resolution has the effect that if neither
-<tt>fixed</tt> nor <tt>scientific</tt> is set we'll be
-specifying a precision of 0, which will be internally
-turned into 1. There's no need to call it out as a special
-case.</p>
-<p>The output of the above program will be &quot;1e+00&quot;.</p>
-
-<p><i>[Post-Cura&ccedil;ao: Howard provided improved wording covering the case
-where precision is 0 and mode is %g.]</i></p>
-
+<p>Informally: introduce a Swappable concept, and specify that the
+ value types of the iterators passed to certain standard algorithms
+ (such as iter_swap, swap_ranges, reverse, rotate, and sort) conform
+ to that concept. The Swappable concept will make it clear that
+ these algorithms use unqualified lookup for the calls
+ to <tt>swap</tt>. Also, in 26.3.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.valarray.transcend"> [lib.valarray.transcend]</a> paragraph 1,
+ state that the valarray transcendentals use unqualified lookup.</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#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;30 Apr 2000</p>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</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
@@ -1898,15 +1493,15 @@ disregard it entirely.
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;.
+vote for a deterministic treatment: "before, if possible, otherwise
+after, otherwise anywhere appropriate", as an alternative to the
+proposed "before or after, if possible, otherwise [...]".
</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>,
+<p>In table 69 "Associative Container Requirements" in 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, in the row for <tt>a.insert(p, t)</tt>,
change</p>
<blockquote>
@@ -1958,72 +1553,17 @@ reference implementation.]</i></p>
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
+shouldn't adopt the more detailed semantics, and notes: "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>
+enough to make the detailed semantics hard to satisfy."]</i></p>
-<p><i>[Cura&ccedil;ao: Nathan should give us the alternative wording he
+<p><i>[Curaçao: Nathan should give us the alternative wording he
suggests so the LWG can decide between the two options.]</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#Ready">Ready</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>
- <p>-4- Requires: The ranges [first, last) and [result,
- result+(last-first)) shall not overlap. The expression *result =
- *first must be valid. If neither InputIterator nor OutputIterator
- meets the requirements of forward iterator then the value type of
- InputIterator must be copy constructible. Otherwise copy
- constructible is not required. </p>
-</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>
-
-<p><i>[
-Cura&ccedil;ao: The LWG changed the PR editorially to specify
-&quot;neither...nor...meet...&quot; as clearer than
-&quot;both...and...do not meet...&quot;. Change believed to be so
-minor as not to require re-review.
-]</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>
+<b>Section:</b>&nbsp;23.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2056,7 +1596,7 @@ inserting at the end of the <tt>vector</tt>, and then using
<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>,
+complexity of inserting multiple elements (23.2.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.deque.modifiers"> [lib.deque.modifiers]</a>,
paragraph 3):</p>
<blockquote>
@@ -2093,15 +1633,14 @@ 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#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Robert Klarer&nbsp; <b>Date:</b>&nbsp;31 Jul 2000</p>
+<b>Section:</b>&nbsp;26.3.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.valarray.cons"> [lib.valarray.cons]</a>, 26.3.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.valarray.assign"> [lib.valarray.assign]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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;
+<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;);
@@ -2114,8 +1653,7 @@ that the problem described below is NAD.</p>
<p>Similarly, these valarray assignment operators cannot be
called:</p>
-<pre>
- template &lt;class T&gt;
+<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;);
@@ -2127,8 +1665,7 @@ called:</p>
<p>Please consider the following example:</p>
-<pre>
- #include &lt;valarray&gt;
+<pre> #include &lt;valarray&gt;
using namespace std;
int main()
@@ -2145,8 +1682,7 @@ 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;
+<pre> template &lt;class T&gt;
valarray&lt;T&gt;::valarray(const slice_array&lt;T&gt; &amp;);
</pre>
@@ -2171,75 +1707,71 @@ 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> Make the copy constructor and copy-assignment operator declarations
+ public in the slice_array class template definition in 26.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a> </li>
+<li> remove paragraph 3 of 26.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> remove the copy constructor declaration from 26.3.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> change paragraph 1 of 26.3.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.cons.slice.arr"> [lib.cons.slice.arr]</a> to read "This constructor is declared
+ to be private. This constructor need not be defined."</li>
+<li> remove the first sentence of paragraph 1 of 26.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<li> Change the first three words of the second sentence of paragraph 1 of
+ 26.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.slice.arr.assign"> [lib.slice.arr.assign]</a> to "These assignment operators have"</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> Make the copy constructor and copy-assignment operator declarations
+ public in the gslice_array class template definition in 26.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.gslice.array"> [lib.template.gslice.array]</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> remove the copy constructor declaration from 26.3.7.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.gslice.array.cons"> [lib.gslice.array.cons]</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> change paragraph 1 of 26.3.7.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.gslice.array.cons"> [lib.gslice.array.cons]</a> to read "This constructor is declared
+ to be private. This constructor need not be defined."</li>
+<li> remove the first sentence of paragraph 1 of 26.3.7.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<li> Change the first three words of the second sentence of paragraph 1 of
+ 26.3.7.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.gslice.array.assign"> [lib.gslice.array.assign]</a> to "These assignment operators have"</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> Make the copy constructor and copy-assignment operator declarations
+ public in the mask_array class template definition in 26.3.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> remove the copy constructor declaration from 26.3.8.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> change paragraph 1 of 26.3.8.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.mask.array.cons"> [lib.mask.array.cons]</a> to read "This constructor is declared
+ to be private. This constructor need not be defined."</li>
+<li> remove the first sentence of paragraph 1 of 26.3.8.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<li> Change the first three words of the second sentence of paragraph 1 of
+ 26.3.8.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.mask.array.assign"> [lib.mask.array.assign]</a> to "These assignment operators have"</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>Make the copy constructor and copy-assignment operator declarations
+ public in the indirect_array class definition in 26.3.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> remove the note in paragraph 2 of 26.3.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> remove the copy constructor declaration from 26.3.9.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> change the descriptive text in 26.3.9.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.indirect.array.cons"> [lib.indirect.array.cons]</a> to read "This constructor is
+ declared to be private. This constructor need not be defined."</li>
+<li> remove the first sentence of paragraph 1 of 26.3.9.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<li> Change the first three words of the second sentence of paragraph 1 of
+ 26.3.9.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.indirect.array.assign"> [lib.indirect.array.assign]</a> to "These assignment operators have"</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><i>[Proposed resolution was modified in Santa Cruz: explicitly make
+copy constructor and copy assignment operators public, instead of
+removing them.]</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,
@@ -2252,162 +1784,8 @@ 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. <i>Cura&ccedil;ao: Howard thinks this
-requirement is already present.</i>
-</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>NAD/Future</p>
-<p><b>Rationale:</b></p>
-
-<p>Throwing a bad_alloc while trying to construct a message for another
-exception-derived class is not necessarily a bad thing. And the
-bad_alloc constructor already has a no throw spec on it (18.4.2.1).</p>
-
-<p>
-The copy constructors of all exception-derived classes already have a
-no throw spec. Reference 18.6.1, 19.1 and 15.4/13.
-</p>
-
-<p><b>Future:</b></p>
-
-<p>All involved would like to see const char* constructors added, but
-this should probably be done for C++0X as opposed to a DR.</p>
-
-<p>I believe the no throw specs currently decorating these functions
-could be improved by some kind of static no throw spec checking
-mechanism (in a future C++ language). As they stand, the copy
-constructors might fail via a call to unexpected. I think what is
-intended here is that the copy constructors can't fail.</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. The above
-proposed resolution/rationale is from Howard, Herb, Kevlin, Martin,
-and Dave.]</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>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2431,7 +1809,7 @@ Further discussion: Howard Hinnant writes, in lib-7757:
<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
+it needs to be true except for the "and only if". 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
@@ -2476,85 +1854,34 @@ 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="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#Open">Open</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>
-
-<p><i>[Cura&ccedil;ao: The definition of &quot;singular&quot; is
-contentious.&nbsp; The 278 resolution must be made consistent with
-issue <a href="lwg-defects.html#208">208</a> and 24.1/5. Furthermore, a Rationale paragraph
-is required.]</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>
+<b>Section:</b>&nbsp;24.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iterators"> [lib.reverse.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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
+Steve said: "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
+requirements." He also said in email that it can be done without
+breaking user's code: "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;
+that, I don't see how <i>any</i> user code could break."
</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>
+<b>Section:</b> 24.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<pre> A) Add a templated assignment operator, after the same manner
as the templated copy constructor, i.e.:
template &lt; class U &gt;
@@ -2578,7 +1905,7 @@ add/change the following declarations:</p>
</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>.
+24.4.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iter.ops"> [lib.reverse.iter.ops]</a>.
</p>
<p><i>[
@@ -2590,314 +1917,163 @@ 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#Review">Review</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>
-
-<p><i>[Post-Cura&ccedil;ao: the above proposed resolution is the consensus of
-Howard, Bill, Pete, Benjamin, Nathan, Dietmar, Boris, and Martin.]</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#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;15 Dec 2000</p>
+<b>Section:</b>&nbsp;25.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
+(revision of the further discussion)
+There are a number of problems with the requires clauses for the
+algorithms in 25.1 and 25.2. 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>
-<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>
+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 iterator's value type
+or between the value types of two different iterators.
</li>
-<li>25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a>
+<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).
</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>
+</ol>
-<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>
+Here is the list of algorithms that contain mistakes:
+</p>
+<ul>
+<li>25.1.2 std::find</li>
+<li>25.1.6 std::count</li>
+<li>25.1.8 std::equal</li>
+<li>25.1.9 std::search, std::search_n</li>
+<li>25.2.4 std::replace, std::replace_copy</li>
+<li>25.2.5 std::fill</li>
+<li>25.2.7 std::remove, std::remove_copy</li>
+</ul>
-<p>25.1.5 <a href="lib-algorithms.html#lib.alg.adjacent.find"> [lib.alg.adjacent.find]</a> Add the following requires clause</p>
+<p>
+Also, in the requirements for EqualityComparable, the requirement that
+the operator be defined for const objects is lacking.
+</p>
-<blockquote>
-Requires: T must be EqualityComparable (20.1.1).
-</blockquote>
+<p><b>Proposed resolution:</b></p>
-<p>25.1.6 <a href="lib-algorithms.html#lib.alg.count"> [lib.alg.count]</a> Change p1 from</p>
+<p>20.1.1 Change p1 from</p>
-<blockquote>
-Requires: Type T is EqualityComparable (20.1.1).
-</blockquote>
+<p>In Table 28, <tt>T</tt> is a type to be supplied by a C++ program
+instantiating a template, <tt>a</tt>, <tt>b</tt>, and <tt>c</tt> are
+values of type <tt>T</tt>.
+</p>
<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>
+In Table 28, <tt>T</tt> is a type to be supplied by a C++ program
+instantiating a template, <tt>a</tt>, <tt>b</tt>, and <tt>c</tt> are
+values of type <tt>const T</tt>.
+</p>
-<p>25.1.7 <a href="lib-algorithms.html#lib.mismatch"> [lib.mismatch]</a> Add the following requires clause</p>
+<p>25 Between p8 and p9</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>Add the following sentence:</p>
+<p>When the description of an algorithm gives an expression such as
+<tt>*first == value</tt> for a condition, it is required that the expression
+evaluate to either true or false in boolean contexts.</p>
-<p>25.1.8 <a href="lib-algorithms.html#lib.alg.equal"> [lib.alg.equal]</a> Add the following requires clause</p>
+<p>25.1.2 Change p1 by deleting the 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>
+<p>25.1.6 Change p1 by deleting the 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.9</p>
-<p>Change change p4 from</p>
+<p>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>-4- Requires: Type <tt>T</tt> is <tt>EqualityComparable</tt>
+(20.1.1), type Size is convertible to integral type (4.7.12.3).
+</p>
<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>-4- Requires: The type <tt>Size</tt> is convertible to integral
+type (4.7.12.3).</p>
-<p>25.2.4 <a href="lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a> Change p1 from</p>
+<p>25.2.4 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>-1- Requires: Type <tt>T</tt> is <tt>Assignable</tt> (23.1 ) (and, for <tt>replace()</tt>, <tt>EqualityComparable</tt> (20.1.1 )).</p>
<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>-1- Requires: The expression <tt>*first = new_value</tt> must be valid.</p>
<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>-4- Requires: Type <tt>T</tt> is <tt>Assignable</tt> (23.1) (and,
+for <tt>replace_copy()</tt>, <tt>EqualityComparable</tt>
+(20.1.1)). The ranges <tt>[first, last)</tt> and <tt>[result, result +
+(last - first))</tt> shall not overlap.</p>
<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>-4- Requires: The results of the expressions <tt>*first</tt> and
+<tt>new_value</tt> must be writable to the result output iterator. The
+ranges <tt>[first, last)</tt> and <tt>[result, result + (last -
+first))</tt> shall not overlap.</p>
-<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>25.2.5 Change p1 from</p>
+
+<p>-1- Requires: Type <tt>T</tt> is <tt>Assignable</tt> (23.1). The
+type <tt>Size</tt> is convertible to an integral type (4.7.12.3).</p>
<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>-1- Requires: The expression <tt>value</tt> must be is writable to
+the output iterator. The type <tt>Size</tt> is convertible to an
+integral type (4.7.12.3).</p>
+<p>25.2.7 Change p1 from</p>
-<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>-1- Requires: Type <tt>T</tt> is <tt>EqualityComparable</tt> (20.1.1).</p>
<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>
-
-<p><i>[Cura&ccedil;ao: Jeremy reports he has run the changes through his
-automated test tools. At the request of the LWG, Jeremy will reword
-the PR in terms of valid expressions rather than &quot;equality
-operator&quot;.]</i></p>
+<p>
+-1- Requires: The value type of the iterator must be
+<tt>Assignable</tt> (23.1).
+</p>
+<p><b>Rationale:</b></p>
+<p>
+The general idea of the proposed solution is to remove the faulty
+requires clauses and let the returns and effects clauses speak for
+themselves. That is, the returns clauses contain expressions that must
+be valid, and therefore already imply the correct requirements. In
+addition, a sentence is added at the beginning of chapter 25 saying
+that expressions given as conditions must evaluate to true or false in
+a boolean context. An alternative would be to say that the type of
+these condition expressions must be literally bool, but that would be
+imposing a greater restriction that what the standard currently says
+(which is convertible to bool).
+</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>
+<b>Section:</b>&nbsp;25.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.foreach"> [lib.alg.foreach]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+"Requires" 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.
+times, which is promised in the "Complexity" section.
</p>
<p>I don't see how any implementation can give such a guarantee
@@ -2916,9 +2092,9 @@ 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
+<p>Add a "Requires" 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>):
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#242">242</a>):
</p>
<blockquote>
@@ -2935,7 +2111,7 @@ blanket statement in Clause 25, not just a special requirement for
<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#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;03 Jan 2001</p>
+<b>Section:</b>&nbsp;25.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.set.operations"> [lib.alg.set.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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>,
@@ -2948,7 +2124,7 @@ in the output range are sorted.
<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
+elements are considered to be "the same" 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>
@@ -2959,7 +2135,7 @@ will contain five copies, the output range of
</p>
<p>
-Because two elements can be &quot;the same&quot; for the purposes
+Because two elements can be "the same" 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:
@@ -2986,7 +2162,7 @@ same way.
<p><b>Proposed resolution:</b></p>
-<p>Add the following to the end of 25.3.5.2 <a href="lib-algorithms.html#lib.set.union"> [lib.set.union]</a> paragraph 5:</p>
+<p>Add the following to the end of 25.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.set.union"> [lib.set.union]</a> paragraph 5:</p>
<blockquote>
If [first1, last1) contains <i>m</i> elements that are equivalent to
each other and [first2, last2) contains <i>n</i> elements that are
@@ -2996,7 +2172,7 @@ from [first1, last1), and the last max(<i>n-m</i>, 0) of them from
[first2, last2), in that order.
</blockquote>
-<p>Add the following to the end of 25.3.5.3 <a href="lib-algorithms.html#lib.set.intersection"> [lib.set.intersection]</a> paragraph 5:</p>
+<p>Add the following to the end of 25.3.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.set.intersection"> [lib.set.intersection]</a> paragraph 5:</p>
<blockquote>
If [first1, last1) contains <i>m</i> elements that are equivalent to each
other and [first2, last2) contains <i>n</i> elements that are
@@ -3004,7 +2180,7 @@ equivalent to them, the first min(<i>m</i>, <i>n</i>) of those
elements from [first1, last1) are copied to the output range.
</blockquote>
-<p>Add a new paragraph, <b>Notes</b>, after 25.3.5.4 <a href="lib-algorithms.html#lib.set.difference"> [lib.set.difference]</a>
+<p>Add a new paragraph, <b>Notes</b>, after 25.3.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.set.difference"> [lib.set.difference]</a>
paragraph 4:</p>
<blockquote>
If [first1, last1) contains <i>m</i> elements that are equivalent to each
@@ -3013,7 +2189,7 @@ equivalent to them, the last max(<i>m-n</i>, 0) elements from
[first1, last1) are copied to the output range.
</blockquote>
-<p>Add a new paragraph, <b>Notes</b>, after 25.3.5.5 <a href="lib-algorithms.html#lib.set.symmetric.difference"> [lib.set.symmetric.difference]</a>
+<p>Add a new paragraph, <b>Notes</b>, after 25.3.5.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.set.symmetric.difference"> [lib.set.symmetric.difference]</a>
paragraph 4:</p>
<blockquote>
If [first1, last1) contains <i>m</i> elements that are equivalent to
@@ -3024,21 +2200,26 @@ from [first1, last1) if <i>m</i> &gt; <i>n</i>, and the last <i>n -
m</i> of these elements from [first2, last2) if <i>m</i> &lt; <i>n</i>.
</blockquote>
-<p><i>[Cura&ccedil;ao: Missing Rationale and missing status comments from
-Redmond made discussion difficult. For union, doesn't the standard
-already say this? Howard, others think maybe so. Several thought the
-PR may be &quot;too complicated&quot;.]</i></p>
+<p><i>[Santa Cruz: it's believed that this language is clearer than
+ what's in the Standard. However, it's also believed that the
+ Standard may already make these guarantees (although not quite in
+ these words). Bill and Howard will check and see whether they think
+ that some or all of these changes may be redundant. If so, we may
+ close this issue as NAD.]</i></p>
+<p><b>Rationale:</b></p>
+<p>For simple cases, these descriptions are equivalent to what's
+ already in the Standard. For more complicated cases, they describe
+ the behavior of existing implementations.</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
+<b>Section:</b>&nbsp;17.4.3.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.macro.names"> [lib.macro.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.macro.names"> [lib.macro.names]</a> reads: "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
+that define names declared in that header." As I read this, it
would mean that the following program is legal:</p>
-<pre>
- #define npos 3.14
+<pre> #define npos 3.14
#include &lt;sstream&gt;
</pre>
@@ -3049,31 +2230,31 @@ 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,
+example. In light of 17.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In paragraph 2 of 17.4.3.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.macro.names"> [lib.macro.names]</a>, change "A
translation unit that includes a header shall not contain any macros
-that define names declared in that header.&quot; to &quot;A
+that define names declared in that header." to "A
translation unit that includes a header shall not contain any macros
-that define names declared in any standard header.&quot;</p>
+that define names declared in any standard header."</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
+concern about making sure that the two paragraphs in 17.4.3.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;24.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.bidirectional.iterators"> [lib.bidirectional.iterators]</a>, 24.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.random.access.iterators"> [lib.random.access.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>,
+In section 24.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>,
+In section 24.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
@@ -3084,8 +2265,8 @@ 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
+useful iterators, e.g. a random access "iota iterator" (a.k.a
+"counting iterator" or "int iterator"). 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
@@ -3101,7 +2282,7 @@ 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
+operator[]'s return value is "convertible to T". 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
@@ -3112,226 +2293,64 @@ original intent for operator[] is unclear.
<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
+can be decoupled. (See "Improved Iterator Categories and
+Requirements", 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>
-
-<p><i>[Cura&ccedil;ao: Jeremy volunteered to work on this issue.]</i></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>In 23.2.2.4 <a href="lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, replace paragraps 23-25 with:</p>
-<blockquote>
-<p>
-23 Effects: if (&amp;x == this) does nothing; otherwise, merges the two
-sorted ranges [begin(), end()) and [x.begin(), x.end()). The result
-is a range in which the elements will be sorted in non-decreasing
-order according to the ordering defined by comp; that is, for every
-iterator i in the range other than the first, the condition comp(*i,
-*(i - 1)) will be false.
-</p>
-
-<p>
-24 Notes: Stable: if (&amp;x != this), then for equivalent elements in the
-two original ranges, the elements from the original range [begin(),
-end()) always precede the elements from the original range [x.begin(),
-x.end()). If (&amp;x != this) the range [x.begin(), x.end()) is empty
-after the merge.
-</p>
-
-<p>
-25 Complexity: At most size() + x.size() - 1 applications of comp if
-(&amp;x ! = this); otherwise, no applications of comp are performed. If
-an exception is thrown other than by a comparison there are no
-effects.
-</p>
-
-</blockquote>
-
-<p><i>[Copenhagen: The original proposed resolution did 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>
-
-<p><i>[Post-Cura&ccedil;ao: Robert Klarer provided new wording.]</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>Further discussion: I propose a compromise between John Potter's
+resolution, which requires <tt>T&amp;</tt> as the return type of
+<tt>a[n]</tt>, and the current wording, which requires convertible to
+<tt>T</tt>. The compromise is to keep the convertible to <tt>T</tt>
+for the return type of the expression <tt>a[n]</tt>, but to also add
+<tt>a[n] = t</tt> as a valid expression. This compromise "saves" the
+common case uses of random access iterators, while at the same time
+allowing iterators such as counting iterator and caching file
+iterators to remain random access iterators (iterators where the
+lifetime of the object returned by <tt>operator*()</tt> is tied to the
+lifetime of the iterator).
</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).
+Note that the compromise resolution necessitates a change to
+<tt>reverse_iterator</tt>. It would need to use a proxy to support
+<tt>a[n] = t</tt>.
</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.
+Note also there is one kind of mutable random access iterator that
+will no longer meet the new requirements. Currently, iterators that
+return an r-value from <tt>operator[]</tt> meet the requirements for a
+mutable random access iterartor, even though the expression <tt>a[n] =
+t</tt> will only modify a temporary that goes away. With this proposed
+resolution, <tt>a[n] = t</tt> will be required to have the same
+operational semantics as <tt>*(a + n) = t</tt>.
</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#Ready">Ready</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.
+In section 24.1.4 [lib.bidirectdional.iterators], change the return
+type in table 75 from "convertible to <tt>T</tt>" to
+<tt>T&amp;</tt>.
</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.
+In section 24.1.5 [lib.random.access.iterators], change the
+operational semantics for <tt>a[n]</tt> to " the r-value of
+<tt>a[n]</tt> is equivalent to the r-value of <tt>*(a +
+n)</tt>". Add a new row in the table for the expression <tt>a[n] = t</tt>
+with a return type of convertible to <tt>T</tt> and operational semantics of
+<tt>*(a + n) = t</tt>.
</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 JIS, for
-example, and it would rule out a fixed-width encoding of UCS-4.</p>
-
-<p><i>[Cura&ccedil;ao: fixed rationale typo at the request of Ichiro Koshida;
-&quot;shift-JIS&quot; changed to &quot;JIS&quot;.]</i></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>
+<b>Section:</b>&nbsp;27.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostream.format"> [lib.iostream.format]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+(27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>) and basic_ostream&lt;&gt;::sentry
+(27.6.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3342,16 +2361,16 @@ others propagate.
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
+basic_istream&lt;&gt;::sentry prior to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#195">195</a> amends 27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+The same sentence that appears in 27.6.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3359,894 +2378,220 @@ 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="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#Ready">Ready</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>
+<b>Additional comments from Martin, who isn't comfortable with the
+ current proposed resolution</b> (see c++std-lib-11530)</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.
+The istream::sentry ctor says nothing about how the function
+deals with exemptions (27.6.1.1.2, p1 says that the class is
+responsible for doing "exception safe"(*) prefix and suffix
+operations but it doesn't explain what level of exception
+safety the class promises to provide). The mockup example
+of a "typical implementation of the sentry ctor" given in
+27.6.1.1.2, p6, removed in ISO/IEC 14882:2003, doesn't show
+exception handling, either. Since the ctor is not classified
+as a formatted or unformatted input function, the text in
+27.6.1.1, p1 through p4 does not apply. All this would seem
+to suggest that the sentry ctor should not catch or in any
+way handle exceptions thrown from any functions it may call.
+Thus, the typical implementation of an istream extractor may
+look something like [1].
</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.
+The problem with [1] is that while it correctly sets ios::badbit
+if an exception is thrown from one of the functions called from
+the sentry ctor, if the sentry ctor reaches EOF while extracting
+whitespace from a stream that has eofbit or failbit set in
+exceptions(), it will cause an ios::failure to be thrown, which
+will in turn cause the extractor to set ios::badbit.
</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 two new rows:</p>
-<pre>
- a.assign(i,j) void pre: i,j are not iterators into a.
- Replaces elements in a with a copy
- of [i, j).
-
- a.assign(n,t) void pre: t is not a reference into a.
- Replaces elements in a with n copies
- of t.
-</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. Howard provided wording.
-]</i></p>
-
-<p><i>[Cura&ccedil;ao: Made editorial improvement in wording; changed
-&quot;Replaces elements in a with copies of elements in [i, j).&quot;
-with &quot;Replaces the elements of a with a copy of [i, j).&quot;
-Changes not deemed serious enough to requre rereview.]</i></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.
+The only straightforward way to prevent this behavior is to
+move the definition of the sentry object in the extractor
+above the try block (as suggested by the example in 22.2.8,
+p9 and also indirectly supported by 27.6.1.3, p1). See [2].
+But such an implementation will allow exceptions thrown from
+functions called from the ctor to freely propagate to the
+caller regardless of the setting of ios::badbit in the stream
+object's exceptions().
</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#Ready">Ready</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 iterator.</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>.
+So since neither [1] nor [2] behaves as expected, the only
+possible solution is to have the sentry ctor catch exceptions
+thrown from called functions, set badbit, and propagate those
+exceptions if badbit is also set in exceptions(). (Another
+solution exists that deals with both kinds of sentries, but
+the code is non-obvious and cumbersome -- see [3].)
</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.
+Please note that, as the issue points out, current libraries
+do not behave consistently, suggesting that implementors are
+not quite clear on the exception handling in istream::sentry,
+despite the fact that some LWG members might feel otherwise.
+(As documented by the parenthetical comment here:
+http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2003/n1480.html#309)
</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#Ready">Ready</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.
+Also please note that those LWG members who in Copenhagen
+felt 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," as noted here
+http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/papers/2001/n1310.html#309
+would in effect be either arguing for the behavior described
+in [1] or for extractors implemented along the lines of [3].
</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="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#Ready">Ready</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>.
+The original proposed resolution (Revision 25 of the issues
+list) clarifies the role of the sentry ctor WRT exception
+handling by making it clear that extractors (both library
+or user-defined) should be implemented along the lines of
+[2] (as opposed to [1]) and that no exception thrown from
+the callees should propagate out of either function unless
+badbit is also set in exceptions().
</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>[1] Extractor that catches exceptions thrown from sentry:</p>
-<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>
+<pre>struct S { long i; };
-<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="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#Ready">Ready</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#Ready">Ready</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.
+istream&amp; operator&gt;&gt; (istream &amp;strm, S &amp;s)
+{
+ ios::iostate err = ios::goodbit;
+ try {
+ const istream::sentry guard (strm, false);
+ if (guard) {
+ use_facet&lt;num_get&lt;char&gt; &gt;(strm.getloc ())
+ .get (istreambuf_iterator&lt;char&gt;(strm),
+ istreambuf_iterator&lt;char&gt;(),
+ strm, err, s.i);
+ }
+ }
+ catch (...) {
+ bool rethrow;
+ try {
+ strm.setstate (ios::badbit);
+ rethrow = false;
+ }
+ catch (...) {
+ rethrow = true;
+ }
+ if (rethrow)
+ throw;
+ }
+ if (err)
+ strm.setstate (err);
+ return strm;
+}
</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>
-
-<p><b>Rationale:</b></p>
-<p>
-This is the second solution described above; as noted, it is
-consistent with existing practice.
-</p>
-
-<p>Note that we now need to specify the complexity explicitly, because
-we are no longer defining <tt>operator[]</tt> in terms of
-<tt>insert</tt>.</p>
-<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>
-
-<p><i>[Cura&ccedil;ao: Beman emailed wording to Matt, but not in time for the
-pre-meeting mailing.]</i></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#Ready">Ready</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#Ready">Ready</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>
+<p>[2] Extractor that propagates exceptions thrown from sentry:</p>
<blockquote>
-<p>22.2.1 The ctype category [lib.category.ctype]</p>
-<pre>
-namespace std {
- class ctype_base {
- public:
- typedef <b><i>T</i></b> 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>istream&amp; operator&gt;&gt; (istream &amp;strm, S &amp;s)
+{
+ istream::sentry guard (strm, false);
+ if (guard) {
+ ios::iostate err = ios::goodbit;
+ try {
+ use_facet&lt;num_get&lt;char&gt; &gt;(strm.getloc ())
+ .get (istreambuf_iterator&lt;char&gt;(strm),
+ istreambuf_iterator&lt;char&gt;(),
+ strm, err, s.i);
+ }
+ catch (...) {
+ bool rethrow;
+ try {
+ strm.setstate (ios::badbit);
+ rethrow = false;
+ }
+ catch (...) {
+ rethrow = true;
+ }
+ if (rethrow)
+ throw;
+ }
+ if (err)
+ strm.setstate (err);
+ }
+ return strm;
}
</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>
-<p><i>[Cura&ccedil;ao: The LWG notes that T above should be bold-italics to be
-consistent with the rest of the standard.]</i></p>
-
-<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#Ready">Ready</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:
+[3] Extractor that catches exceptions thrown from sentry
+but doesn't set badbit if the exception was thrown as a
+result of a call to strm.clear().
</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
+<pre>istream&amp; operator&gt;&gt; (istream &amp;strm, S &amp;s)
{
-{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#Ready">Ready</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>
+ const ios::iostate state = strm.rdstate ();
+ const ios::iostate except = strm.exceptions ();
+ ios::iostate err = std::ios::goodbit;
+ bool thrown = true;
+ try {
+ const istream::sentry guard (strm, false);
+ thrown = false;
+ if (guard) {
+ use_facet&lt;num_get&lt;char&gt; &gt;(strm.getloc ())
+ .get (istreambuf_iterator&lt;char&gt;(strm),
+ istreambuf_iterator&lt;char&gt;(),
+ strm, err, s.i);
+ }
+ }
+ catch (...) {
+ if (thrown &amp;&amp; state &amp; except)
+ throw;
+ try {
+ strm.setstate (ios::badbit);
+ thrown = false;
+ }
+ catch (...) {
+ thrown = true;
+ }
+ if (thrown)
+ throw;
+ }
+ if (err)
+ strm.setstate (err);
-<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);
+ return strm;
+}
</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>Proposed resolution:</b></p>
+<p>Remove the last sentence of 27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a> p5 (but not
+ the footnote, which should be moved to the preceding sentence).</p>
+<p>Remove the last sentence of 27.6.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a> p3 (but not
+ the footnote, which should be moved to the preceding sentence).</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.
-</p>
+<p>The LWG feels that no clarification of EH policy is necessary: the
+ standard is precise about which operations sentry's constructor
+ performs, and about which of those operations can throw. However, the
+ sentence at the end should be removed because it's redundant.</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>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>According to lwg issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#60">60</a> which is now a dr, the
+description of seekg in 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> paragraph 38 now looks
like:</p>
<blockquote>
@@ -4254,10 +2599,10 @@ 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).
+executes rdbuf()­&gt;pubseekpos( pos).
</blockquote>
-<p>And according to lwg issue <a href="lwg-defects.html#243">243</a> which is also now a dr,
+<p>And according to lwg issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#243">243</a> which is also now a dr,
27.6.1.3, paragraph 1 looks like:</p>
<blockquote>
@@ -4298,11 +2643,11 @@ should be respected.
<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
+"unformatted". 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
+the other hand, "principle of least surprise" is that seeking from EOF
ought to be OK.</p>
<p>Dietmar: nothing should depend on eofbit. Eofbit should only be
@@ -4311,16 +2656,23 @@ 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>
+
+<p><i>[Santa Cruz: On the one hand, it would clearly be silly to seek
+ to a non-EOF position without resetting eofbit. On the other hand,
+ having seek clear eofbit explicitly would set a major precedent:
+ there is currently <i>no</i> place where any of the flags are reset
+ without the user explicitly asking for them to be. This is the tip
+ of a general problem, that the various flags are stickier than many
+ users might expect. Bill, Gaby, and Howard will discuss this issue
+ and propose a resolution.]</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#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;P.J. Plauger, Nathan Myers&nbsp; <b>Date:</b>&nbsp;23 Oct 2001</p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</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
+In 22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+in 17.3.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4334,17 +2686,14 @@ 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
+<p>Nathan writes: "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>
+<p>Replace the first two paragraphs of 22.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.types"> [lib.locale.types]</a> with:</p>
<blockquote>
-<pre>
- typedef int category;
+<pre> typedef int category;
</pre>
<p>Valid category values include the <tt>locale</tt> member bitmask
@@ -4354,8 +2703,7 @@ 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> (collate | ctype | monetary | numeric | time | messages | all) == all
</pre>
<p>
is <tt>true</tt>, and represents the union of all categories. Further
@@ -4373,10 +2721,22 @@ in turn, identifies a set of locale facets, including at least those
shown in Table 51:
</p>
</blockquote>
+<p><i>[Curaçao: need input from locale experts.]</i></p>
+
+<p><b>Rationale:</b></p>
+
+<p>The LWG considered, and rejected, an alternate proposal (described
+ as "Option 2" in the discussion). The main reason for rejecting it
+ was that library implementors were concerened about implementation
+ difficult, given that getting a C++ library to work smoothly with a
+ separately written C library is already a delicate business. Some
+ library implementers were also concerned about the issue of adding
+ extra locale categories.</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>
+Replace the first paragraph of 22.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.types"> [lib.locale.types]</a> with:</p>
<blockquote>
<p>
Valid category values include the enumerated values. In addition, the
@@ -4395,145 +2755,10 @@ those categories found in <tt>cat1</tt> but not found in <tt>cat2</tt>.
of the other enumerated values; implementations may add extra categories.]
</p>
</blockquote>
-
-<p><i>[Cura&ccedil;ao: need input from locale experts.]</i></p>
-
-<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#Open">Open</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>
-
-<p><i>[Cura&ccedil;ao: LWG leaning toward NAD.&nbsp; In favor of the PR is
-that it removes a trap for users.&nbsp; Concerns: 1) will break some
-small amount of existing code (which define less and operator &lt;
-with different behavior), 2) don't have any indication of rationale
-for current design (and unwilling to change without knowing
-rationale), 3) consistency; pairs of ptrs would behave differenly from
-individual pointers.]</i></p>
-
-<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#Ready">Ready</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#Open">Open</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><i>[Cura&ccedil;ao: The LWG believes both examples are ill-formed.&nbsp;
-The contained type is required to be CopyConstructible (20.1.3), and
-that includes the requirement that &amp;t return the usual types and
-values. Since the CopyConstructible requirements appear to have been
-written to deal with the concerns of this issue, the LWG feels it is
-NAD unless someone can come up with a well-formed example exhibiting a
-problem.]</i></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><i>[Cura&ccedil;ao: If the issues isn't NAD, suggest changing &quot;if not
-overloaded&quot; to &quot;ignoring all overloads&quot;.]</i></p>
-
-<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>
<hr>
<a name="352"><h3>352.&nbsp;missing fpos requirements</h3></a><p>
-<b>Section:</b>&nbsp;21.1.2 <a href="lib-strings.html#lib.char.traits.typedefs"> [lib.char.traits.typedefs]</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;2 Dec 2001</p>
+<b>Section:</b>&nbsp;21.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.char.traits.typedefs"> [lib.char.traits.typedefs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;2 Dec 2001</p>
<p>
<i>(1)</i>
There are no requirements on the <tt>stateT</tt> template parameter of
@@ -4566,101 +2791,34 @@ Modify 21.1.2, p4 from
(23.1, p4), CopyConstructible (20.1.3), and
DefaultConstructible (20.1.4) types.
</p>
-<p>
-Add to the definition of the fpos class template the following member:
-</p>
-<pre>
- typedef stateT state_type;
-</pre>
-<p>
-and add to 27.4.3.1 a paragraph with the following text:
-</p>
-<pre>
- typedef stateT state_type;
-</pre>
-<p>
- Requires: <tt>state_type</tt> shall meet the requirements of
- Assignable (23.1, p4), CopyConstructible (20.1.3), and
- DefaultConstructible (20.1.4) types.
-</p>
-
-<p><i>[Cura&ccedil;ao: The LWG feels this is two issues, as indicated
-above. The first is a defect; more I/O experts need to review
-the PR. The second is questionable; who would use it? Unless
-motivation is provided, the second should be considered NAD.]</i></p>
-
-<hr>
-<a name="354"><h3>354.&nbsp;Associative container lower/upper bound requirements</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;Hans Aberg&nbsp; <b>Date:</b>&nbsp;17 Dec 2001</p>
-<p>
-Discussions in the thread &quot;Associative container lower/upper bound
-requirements&quot; on comp.std.c++ suggests that there is a defect in the
-C++ standard, Table 69 of section 23.1.2, &quot;Associative containers&quot;,
-[lib.associative.reqmts]. It currently says:</p>
-
-<blockquote>
-<p>
-a.find(k): returns an iterator pointing to an element with the key equivalent to
-k, or a.end() if such an element is not found.
-</p>
-
-<p>
-a.lower_bound(k): returns an iterator pointing to the first element with
-key not less than k.
-</p>
-
-<p>
-a.upper_bound(k): returns an iterator pointing to the first element with
-key greater than k.
-</p>
-</blockquote>
-
-<p>
-We have &quot;or a.end() if such an element is not found&quot; for
-<tt>find</tt>, but not for <tt>upper_bound</tt> or
-<tt>lower_bound</tt>. As the text stands, one would be forced to
-insert a new element into the container and return an iterator to that
-in case the sought iterator does not exist, which does not seem to be
-the intention (and not possible with the &quot;const&quot; versions).
-</p>
-<p><b>Proposed resolution:</b></p>
-
-<p>Change Table 69 of section 23.1.2 <a href="lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a> indicated entries
-to:</p>
-
-<blockquote>
-<p>
-a.lower_bound(k): returns an iterator pointing to the first element with
-key not less than k, or a.end() if such an element is not found.
-</p>
-
-<p>
-a.upper_bound(k): returns an iterator pointing to the first element with
-key greater than k, or a.end() if such an element is not found.
-</p>
-</blockquote>
-
-<p><i>[Cura&ccedil;ao: LWG reviewed PR.]</i></p>
+<p><b>Rationale:</b></p>
+<p>The LWG feels this is two issues, as indicated above. The first is
+a defect---std::basic_fstream is unimplementable without these
+additional requirements---and the proposed resolution fixes it. The
+second is questionable; who would use that typedef? The class
+template fpos is used only in a very few places, all of which know the
+state type already. Unless motivation is provided, the second should
+be considered NAD.</p>
<hr>
<a name="355"><h3>355.&nbsp;Operational semantics for a.back()</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#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Yaroslav Mironov&nbsp; <b>Date:</b>&nbsp;23 Jan 2002</p>
+<b>Section:</b>&nbsp;23.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Yaroslav Mironov&nbsp; <b>Date:</b>&nbsp;23 Jan 2002</p>
-<p>Table 68 &quot;Optional Sequence Operations&quot; in 23.1.1/12
-specifies operational semantics for &quot;a.back()&quot; as
-&quot;*--a.end()&quot;, which may be ill-formed <i>[because calling
+<p>Table 68 "Optional Sequence Operations" in 23.1.1/12
+specifies operational semantics for "a.back()" as
+"*--a.end()", which may be ill-formed <i>[because calling
operator-- on a temporary (the return) of a built-in type is
ill-formed]</i>, provided a.end() returns a simple pointer rvalue
(this is almost always the case for std::vector::end(), for
example). Thus, the specification is not only incorrect, it
-demonstrates a dangerous construct: &quot;--a.end()&quot; may
+demonstrates a dangerous construct: "--a.end()" may
successfully compile and run as intended, but after changing the type
of the container or the mode of compilation it may produce
compile-time error. </p>
<p><b>Proposed resolution:</b></p>
-<p>Change the specification in table 68 &quot;Optional Sequence
-Operations&quot; in 23.1.1/12 for &quot;a.back()&quot; from</p>
+<p>Change the specification in table 68 "Optional Sequence
+Operations" in 23.1.1/12 for "a.back()" from</p>
<blockquote>
@@ -4670,10 +2828,10 @@ Operations&quot; in 23.1.1/12 for &quot;a.back()&quot; from</p>
<p>to</p>
<blockquote>
- <p>*a.rbegin()</p>
+ { iterator tmp = a.end(); --tmp; *tmp; }
</blockquote>
-<p>and the specification for &quot;a.pop_back()&quot; from</p>
+<p>and the specification for "a.pop_back()" from</p>
<blockquote>
a.erase(--a.end())
@@ -4682,29 +2840,40 @@ a.erase(--a.end())
<p>to</p>
<blockquote>
- <p>a.erase(rbegin())</p>
+ { iterator tmp = a.end(); --tmp; a.erase(tmp); }
</blockquote>
-<p><i>[Cura&ccedil;ao: LWG changed PR from &quot;{ X::iterator tmp =
-a.end(); return *--tmp; }&quot; to &quot;*a.rbegin()&quot;, and from
-&quot;{ X::iterator tmp = a.end(); a.erase(--tmp); }&quot; to
-&quot;a.erase(rbegin())&quot;.]</i></p>
+<p><i>[Curaçao: LWG changed PR from "{ X::iterator tmp =
+a.end(); return *--tmp; }" to "*a.rbegin()", and from
+"{ X::iterator tmp = a.end(); a.erase(--tmp); }" to
+"a.erase(rbegin())".]</i></p>
-<p><i>[There is a second possible defect; table 68 &quot;Optional
-Sequence Operations&quot; in the &quot;Operational Semantics&quot;
-column uses operations present only in the &quot;Reversible
-Container&quot; requirements, yet there is no stated dependency
+<p><i>[There is a second possible defect; table 68 "Optional
+Sequence Operations" in the "Operational Semantics"
+column uses operations present only in the "Reversible
+Container" requirements, yet there is no stated dependency
between these separate requirements tables. Ask in Santa Cruz if the
LWG would like a new issue opened.]</i></p>
+<p><i>[Santa Cruz: the proposed resolution is even worse than what's in
+ the current standard: erase is undefined for reverse iterator. If
+ we're going to make the change, we need to define a temporary and
+ use operator--. Additionally, we don't know how prevalent this is:
+ do we need to make this change in more than one place? Martin has
+ volunteered to review the standard and see if this problem occurs
+ elsewhere.]</i></p>
+
+<p><i>[Oxford: Matt provided new wording to address the concerns raised
+ in Santa Cruz. It does not appear that this problem appears
+ anywhere else in clauses 23 or 24.]</i></p>
+
<hr>
<a name="356"><h3>356.&nbsp;Meaning of ctype_base::mask enumerators</h3></a><p>
-<b>Section:</b>&nbsp;22.2.1 <a href="lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Jan 2002</p>
+<b>Section:</b>&nbsp;22.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Jan 2002</p>
<p>What should the following program print?</p>
-<pre>
- #include &lt;locale&gt;
+<pre> #include &lt;locale&gt;
#include &lt;iostream&gt;
class my_ctype : public std::ctype&lt;char&gt;
@@ -4724,15 +2893,15 @@ LWG would like a new issue opened.]</i></p>
int main()
{
my_ctype ct;
- std::cout &lt;&lt; &quot;isspace: &quot; &lt;&lt; ct.is(std::ctype_base::space, '_') &lt;&lt; &quot; &quot;
- &lt;&lt; &quot;isalpha: &quot; &lt;&lt; ct.is(std::ctype_base::alpha, '_') &lt;&lt; std::endl;
+ std::cout &lt;&lt; "isspace: " &lt;&lt; ct.is(std::ctype_base::space, '_') &lt;&lt; " "
+ &lt;&lt; "isalpha: " &lt;&lt; ct.is(std::ctype_base::alpha, '_') &lt;&lt; std::endl;
}
</pre>
<p>The goal is to create a facet where '_' is treated as whitespace.</p>
-<p>On gcc 3.0, this program prints &quot;isspace: 1 isalpha: 0&quot;. On
-Microsoft C++ it prints &quot;isspace: 1 isalpha: 1&quot;.</p>
+<p>On gcc 3.0, this program prints "isspace: 1 isalpha: 0". On
+Microsoft C++ it prints "isspace: 1 isalpha: 1".</p>
<p>
I believe that both implementations are legal, and the standard does not
@@ -4743,8 +2912,8 @@ protected interface portably.</p>
The above program assumes that ctype_base::mask enumerators like
<tt>space</tt> and <tt>print</tt> are disjoint, and that the way to
say that a character is both a space and a printing character is to or
-those two enumerators together. This is suggested by the &quot;exposition
-only&quot; values in 22.2.1 <a href="lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>, but it is nowhere specified in
+those two enumerators together. This is suggested by the "exposition
+only" values in 22.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>, but it is nowhere specified in
normative text. An alternative interpretation is that the more
specific categories subsume the less specific. The above program
gives the results it does on the Microsoft compiler because, on that
@@ -4769,12 +2938,56 @@ lib-9224, lib-9226, lib-9229, lib-9270, lib-9272, lib-9273, lib-9274,
lib-9277, lib-9279.
</p>
-<p>Issue <a href="lwg-active.html#339">339</a> is related, but not identical. The
-proposed resolution if issue <a href="lwg-active.html#339">339</a> says that
+<p>Issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#339">339</a> is related, but not identical. The
+proposed resolution if issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#339">339</a> says that
ctype_base::mask must be a bitmask type. It does not say that the
ctype_base::mask elements are bitmask elements, so it doesn't
directly affect this issue.</p>
+<p>More comments from Benjamin Kosnik, who believes that
+that C99 compatibility essentially requires what we're
+calling option 1 below.</p>
+
+<blockquote>
+<pre>I think the C99 standard is clear, that isspace -&gt; !isalpha.
+--------
+
+#include &lt;locale&gt;
+#include &lt;iostream&gt;
+
+class my_ctype : public std::ctype&lt;char&gt;
+{
+private:
+ typedef std::ctype&lt;char&gt; base;
+ mask my_table[base::table_size];
+
+public:
+ my_ctype(std::size_t refs = 0) : base(my_table, false, refs)
+ {
+ std::copy(base::classic_table(), base::classic_table() + base::table_size,
+ my_table);
+ mask both = base::print | base::space;
+ my_table[static_cast&lt;mask&gt;('_')] = both;
+ }
+};
+
+int main()
+{
+ using namespace std;
+ my_ctype ct;
+ cout &lt;&lt; "isspace: " &lt;&lt; ct.is(ctype_base::space, '_') &lt;&lt; endl;
+ cout &lt;&lt; "isprint: " &lt;&lt; ct.is(ctype_base::print, '_') &lt;&lt; endl;
+
+ // ISO C99, isalpha iff upper | lower set, and !space.
+ // 7.5, p 193
+ // -&gt; looks like g++ behavior is correct.
+ // 356 -&gt; bitmask elements are required for ctype_base
+ // 339 -&gt; bitmask type required for mask
+ cout &lt;&lt; "isalpha: " &lt;&lt; ct.is(ctype_base::alpha, '_') &lt;&lt; endl;
+}
+</pre>
+</blockquote>
+
<p><b>Proposed resolution:</b></p>
<p>Informally, we have three choices:</p>
<ol>
@@ -4791,99 +3004,18 @@ program is not portable.</li>
of portability. Either one will require some implementations to
change.</p>
-<hr>
-<a name="357"><h3>357.&nbsp;&lt;cmath&gt; float functions cannot return HUGE_VAL</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;Ray Lischner&nbsp; <b>Date:</b>&nbsp;26 Feb 2002</p>
-<p>
-The float versions of the math functions have no meaningful value to return
-for a range error. The long double versions have a value they can return,
-but it isn't necessarily the most reasonable value.
-</p>
-
-<p>
-Section 26.5 [lib.c.math], paragraph 5, says that C++ &quot;adds float and long
-double overloaded versions of these functions, with the same semantics,&quot;
-referring to the math functions from the C90 standard.
-</p>
-
-<p>
-The C90 standard, in section 7.5.1, paragraph 3, says that functions return
-&quot;the value of the macro HUGE_VAL&quot; when they encounter a range error.
-Section 7.5, paragraph 2, defines HUGE_VAL as a macro that &quot;expands to a
-positive double expression, not necessarily representable as a float.&quot;
-</p>
-
-<p>
-Therefore, the float versions of the math functions have no way to
-signal a range error. <i>[Cura&ccedil;ao: The LWG notes that this isn't
-strictly correct, since errno is set.]</i> The semantics require that they
-return HUGE_VAL, but they cannot because HUGE_VAL might not be
-representable as a float.
-</p>
-
-<p>
-The problem with long double functions is less severe because HUGE_VAL is
-representable as a long double. On the other hand, it might not be a &quot;huge&quot;
-long double value, and might fall well within the range of normal return
-values for a long double function. Therefore, it does not make sense for a
-long double function to return a double (HUGE_VAL) for a range error.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>Cura&ccedil;ao: C99 was faced with a similar problem, which they fixed by
-adding HUGE_VALF and HUGE_VALL in addition to HUGE_VAL.</p>
-
-<p>C++ must also fix, but it should be done in the context of the
-general C99 based changes to C++, not via DR. Thus the LWG in Cura&ccedil;ao
-felt the resolution should be NAD, FUTURE, but the issue is being held
-open for one more meeting to ensure LWG members not present during the
-discussion concur.</p>
-<hr>
-<a name="358"><h3>358.&nbsp;interpreting <tt>thousands_sep</tt> after a <tt>decimal_point</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
-<p>
-I don't think <tt>thousands_sep</tt> is being treated correctly after
-decimal_point has been seen. Since grouping applies only to the
-integral part of the number, the first such occurrence should, IMO,
-terminate Stage 2. (If it does not terminate it, then 22.2.2.1.2, p12
-and 22.2.3.1.2, p3 need to explain how <tt>thousands_sep</tt> is to be
-interpreted in the fractional part of a number.)
-</p>
-
-<p>
-The easiest change I can think of that resolves this issue would be
-something like below.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>
-Change the first sentence of 22.2.2.1.2, p9 from
-</p>
-
-<blockquote>
- If discard is true then the position of the character is
- remembered, but the character is otherwise ignored. If it is not
- discarded, then a check is made to determine if c is allowed as
- the next character of an input field of the conversion specifier
- returned by stage 1. If so it is accumulated.
-</blockquote>
-
-<p>to</p>
-
-<blockquote>
- If <tt>discard</tt> is true, then if <tt>'.'</tt> has not yet been
- accumulated, then the position of the character is remembered, but
- the character is otherwise ignored. Otherwise, if <tt>'.'</tt> has
- already been accumulated, the character is discarded and Stage 2
- terminates. ...
-</blockquote>
+<p><i>[
+More discussion is needed. Nobody likes option 3. Options 1 and 2
+are both controversial, 2 perhaps less so. Benjamin thinks that
+option 1 is required for C99 compatibility.
+]</i></p>
<hr>
<a name="359"><h3>359.&nbsp;num_put&lt;&gt;::do_put (..., bool) undocumented</h3></a><p>
-<b>Section:</b>&nbsp;22.2.2.2.1 <a href="lib-locales.html#lib.facet.num.put.members"> [lib.facet.num.put.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
+<b>Section:</b>&nbsp;22.2.2.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.members"> [lib.facet.num.put.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
<p>22.2.2.2.1, p1:</p>
- <pre>
- iter_type put (iter_type out, ios_base&amp; str, char_type fill,
+ <pre> iter_type put (iter_type out, ios_base&amp; str, char_type fill,
bool val) const;
...
@@ -4894,8 +3026,7 @@ Change the first sentence of 22.2.2.1.2, p9 from
however, 22.2.2.2.2, p23:</p>
<blockquote>
-<pre>
-iter_type put (iter_type out, ios_base&amp; str, char_type fill,
+<pre>iter_type put (iter_type out, ios_base&amp; str, char_type fill,
bool val) const;
</pre>
@@ -4903,8 +3034,7 @@ iter_type put (iter_type out, ios_base&amp; str, char_type fill,
Effects: If (str.flags() &amp; ios_base::boolalpha) == 0 then do
out = do_put(out, str, fill, (int)val)
Otherwise do
-<pre>
- string_type s =
+<pre> string_type s =
val ? use_facet&lt;ctype&lt;charT&gt; &gt;(loc).truename()
: use_facet&lt;ctype&lt;charT&gt; &gt;(loc).falsename();
</pre>
@@ -4920,7 +3050,7 @@ should read <tt>do_put()</tt>, and not <tt>put()</tt>?
<p>
Note also that there is no <b>Returns</b> clause for this function, which
should probably be corrected, just as should the second occurrence
-of <i>&quot;out.&quot;</i> in the text.
+of <i>"out."</i> in the text.
</p>
<p>
@@ -4928,8 +3058,11 @@ I think the least invasive change to fix it would be something like
the following:
</p>
<p><b>Proposed resolution:</b></p>
+<p>In 22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, just above paragraph 1, remove
+ the <tt>bool</tt> overload.</p>
+
<p>
-In 22.2.2.2.2, p23, make the following changes
+In 22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, p23, make the following changes
</p>
<blockquote>
@@ -4947,10 +3080,9 @@ In 22.2.2.2.2, p23, make the following changes
<blockquote>
23 <b>Returns</b>: If <tt>(str.flags() &amp;
ios_base::boolalpha) == 0</tt> then
- <tt>do_put (out, str, fill, (int)val)</tt>
+ <tt>do_put (out, str, fill, (long)val)</tt>
Otherwise the function obtains a string <tt>s</tt> as if by
-<pre>
- string_type s =
+<pre> string_type s =
val ? use_facet&lt;ctype&lt;charT&gt; &gt;(loc).truename()
: use_facet&lt;ctype&lt;charT&gt; &gt;(loc).falsename();
</pre>
@@ -4959,88 +3091,22 @@ In 22.2.2.2.2, p23, make the following changes
and returns <tt>out</tt>.
</blockquote>
-<hr>
-<a name="360"><h3>360.&nbsp;locale mandates inefficient implementation</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
-<p>
-22.1.1, p7 (copied below) allows iostream formatters and extractors
-to make assumptions about the values returned from facet members.
-However, such assumptions are apparently not guaranteed to hold
-in other cases (e.g., when the facet members are being called directly
-rather than as a result of iostream calls, or between successive
-calls to the same iostream functions with no interevening calls to
-<tt>imbue()</tt>, or even when the facet member functions are called
-from other member functions of other facets). This restriction
-prevents locale from being implemented efficiently.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>Change the first sentence in 22.1.1, p7 from</p>
-<blockquote>
- In successive calls to a locale facet member function during
- a call to an iostream inserter or extractor or a streambuf member
- function, the returned result shall be identical. [Note: This
- implies that such results may safely be reused without calling
- the locale facet member function again, and that member functions
- of iostream classes cannot safely call <tt>imbue()</tt>
- themselves, except as specified elsewhere. --end note]
-</blockquote>
-
-<p>to</p>
-
-<blockquote>
- In successive calls to a locale facet member function on a facet
- object installed in the same locale, the returned result shall be
- identical. ...
-</blockquote>
-
-<hr>
-<a name="361"><h3>361.&nbsp;num_get&lt;&gt;::do_get (..., void*&amp;) checks grouping</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
-<p>
-22.2.2.2.2, p12 specifies that <tt>thousands_sep</tt> is to be inserted only
-for integral types (issue 282 suggests that this should be done for
-all arithmetic types).
-</p>
-
-<p>
-22.2.2.1.2, p12 requires that grouping be checked for all extractors
-including that for <tt>void*</tt>.
-</p>
-
-<p>
-I don't think that's right. <tt>void*</tt> values should not be checked for
-grouping, should they? (Although if they should, then <tt>num_put</tt> needs
-to write them out, otherwise their extraction will fail.)
-</p>
-<p><b>Proposed resolution:</b></p>
+<p><b>Rationale:</b></p>
<p>
-Change the first sentence of 22.2.2.2.2, p12 from
+This fixes a couple of obvious typos, and also fixes what appears to
+be a requirement of gratuitous inefficiency.
</p>
-<blockquote>
- Digit grouping is checked. That is, the positions of discarded
- separators is examined for consistency with
- use_facet&lt;numpunct&lt;charT&gt; &gt;(loc).grouping().
- If they are not consistent then ios_base::failbit is assigned
- to err.
-</blockquote>
-
-<p>to</p>
-<blockquote>
- Except for conversions to void*, digit grouping is checked...
-</blockquote>
-
<hr>
<a name="362"><h3>362.&nbsp;bind1st/bind2nd type safety</h3></a><p>
-<b>Section:</b>&nbsp;20.3.6.2 <a href="lib-utilities.html#lib.bind.1st"> [lib.bind.1st]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Demkin&nbsp; <b>Date:</b>&nbsp;26 Apr 2002</p>
+<b>Section:</b>&nbsp;20.3.6.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.bind.1st"> [lib.bind.1st]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Demkin&nbsp; <b>Date:</b>&nbsp;26 Apr 2002</p>
<p>
-The definition of bind1st() (20.3.6.2 <a href="lib-utilities.html#lib.bind.1st"> [lib.bind.1st]</a>) can result in
+The definition of bind1st() (20.3.6.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.bind.1st"> [lib.bind.1st]</a>) can result in
the construction of an unsafe binding between incompatible pointer
types. For example, given a function whose first parameter type is
'pointer to T', it's possible without error to bind an argument of
type 'pointer to U' when U does not derive from T:
</p>
-<pre>
- foo(T*, int);
+<pre> foo(T*, int);
struct T {};
struct U {};
@@ -5058,25 +3124,23 @@ The definition of bind1st() includes a functional-style conversion to
map its argument to the expected argument type of the bound function
(see below):
</p>
-<pre>
- typename Operation::first_argument_type(x)
+<pre> typename Operation::first_argument_type(x)
</pre>
<p>
-A functional-style conversion (5.2.3 <a href="expr.html#expr.type.conv"> [expr.type.conv]</a>) is defined to be
-semantically equivalent to an explicit cast expression (5.4 <a href="expr.html#expr.cast"> [expr.cast]</a>), which may (according to 5.4, paragraph 5) be interpreted
+A functional-style conversion (5.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/expr.html#expr.type.conv"> [expr.type.conv]</a>) is defined to be
+semantically equivalent to an explicit cast expression (5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/expr.html#expr.cast"> [expr.cast]</a>), which may (according to 5.4, paragraph 5) be interpreted
as a reinterpret_cast, thus masking the error.
</p>
-<p>The problem and proposed change also apply to 20.3.6.4 <a href="lib-utilities.html#lib.bind.2nd"> [lib.bind.2nd]</a>.</p>
+<p>The problem and proposed change also apply to 20.3.6.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.bind.2nd"> [lib.bind.2nd]</a>.</p>
<p><b>Proposed resolution:</b></p>
<p>
The simplest and most localized change to prevent such errors is to
require bind1st() use a static_cast expression rather than the
functional-style conversion; that is, have bind1st() return:
</p>
-<pre>
- binder1st&lt;Operation&gt;( op,
+<pre> binder1st&lt;Operation&gt;( op,
static_cast&lt;typename Operation::first_argument_type&gt;(x)).
</pre>
@@ -5094,292 +3158,177 @@ unifying the conversion rules for user defined types and built-in
types, which can be especially important for generic template
programming.
</p>
-<hr>
-<a name="363"><h3>363.&nbsp;Missing exception specification in 27.4.2.1.1</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown&nbsp; <b>Date:</b>&nbsp;20 May 2002</p>
-<p>
-The destructor of ios_base::failure should have an empty throw
-specification, because the destructor of its base class, exception, is
-declared in this way.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>Change the destructor to</p>
-<pre>
- virtual ~failure() throw();
-</pre>
-<hr>
-<a name="364"><h3>364.&nbsp;Inconsistent wording in 27.5.2.4.2</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
-<p>
-27.5.2.4.2 <a href="lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a> paragraph 1 is inconsistent with the Effects
-clause for seekoff.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>
-Make this paragraph, the Effects clause for setbuf, consistent in wording
-with the Effects clause for seekoff in paragraph 3 by amending paragraph 1
-to indicate the purpose of setbuf:
-</p>
-
-<p>Original text:</p>
-
-<blockquote>
-1 Effects: Performs an operation that is defined separately for each
-class derived from basic_streambuf in this clause (27.7.1.3, 27.8.1.4).
-</blockquote>
-
-<p>Proposed text:</p>
-
-<blockquote>
-1 Effects: Influences stream buffering in a way that is defined separately
-for each class derived from basic_streambuf in this clause
-(27.7.1.3, 27.8.1.4).
-</blockquote>
+<p><i>[Santa Cruz: it's clear that a function-style cast is
+ wrong. Maybe a static cast would be better, or maybe no cast at
+ all. Jeremy will check with the original author of this part
+ of the Standard and will see what the original intent was.]</i></p>
<hr>
<a name="365"><h3>365.&nbsp;Lack of const-qualification in clause 27</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown, Marc Paterno&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
<p>
-None of the following member functions are declared const, but we
-believe each should be. See document N1360 for details and rationale.
+Some stream and streambuf member functions are declared non-const,
+even thought they appear only to report information rather than to
+change an object's logical state. They should be declared const. See
+document N1360 for details and rationale.
</p>
-<p><b>Proposed resolution:</b></p>
-<p>In 27.5.2 and 27.5.2.2.3</p>
-<p>Replace</p>
-<pre>
- streamsize in_avail();
-</pre>
-<p>with</p>
-<pre>
- streamsize in_avail() const;
-</pre>
-
-<p>In 27.5.2 and 27.5.2.4.3, and 27.8.1.1 and 27.8.1.4</p>
-<p>Replace</p>
-<pre>
- virtual streamsize showmanyc();
-</pre>
-<p>with</p>
-<pre>
- virtual streamsize showmanyc() const;
-</pre>
-
-<p>In 27.6.1.1 and 27.6.1.3</p>
-<p>Replace</p>
-<pre>
- pos_type tellg();
-</pre>
-<p>with</p>
-<pre>
- pos_type tellg() const;
-</pre>
-
-<p>This requires additional change, because paragraph 37 describes the
-return value in terms of calls to non-const member functions. Either of
-the two following solutions would allow tellg to be declared const.</p>
-
-<p>Option 1: Implementers may cast away const-ness, to allow calling the
-non-const rdbuf.</p>
-<p>In paragraph 37, replace:</p>
-<pre>
- .... rdbuf()
- -&gt;pubseekoff(0, cur, in).
-</pre>
-<p>by</p>
-<pre>
- .... const_cast&lt;basic_istream&lt;charT, traits&gt;*&gt;(this)-&gt;rdbuf()
- -&gt;pubseekoff(0, cur, in).
-</pre>
-
-<p>Option 2: Provide const member functions to do the job. The proposals in
-a later section (specifically, the modifications concerning rdbuf
-throughout the iostream library) meet most of this need; we would also
-need the following addition to basic_streambuf:</p>
-<blockquote>
-<pre>
-basic_streambuf&lt;charT,traits&gt;::pos_type
-basic_streambuf&lt;charT,traits&gt;::position(ios_base::openmode mode =
- ios_base::in|ios_base::out)
- const;
-</pre>
-<p>Effects: same as calling basic_streambuf::pubseekoff(0, ios base::cur, mode)</p>
-</blockquote>
-
-<p>In 27.6.2.1 and 27.6.2.4</p>
-<p>Replace</p>
-<pre>
- pos_type tellp();
-</pre>
-<p>with</p>
-<pre>
- pos_type tell() const;
-</pre>
+<p>The list of member functions under discussion: <tt>in_avail</tt>,
+<tt>showmanyc</tt>, <tt>tellg</tt>, <tt>tellp</tt>, <tt>is_open</tt>.</p>
-<p>This requires additional change; see the discussion for tellg() above.</p>
+<p>Related issue: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#73">73</a>
+</p>
+<p><b>Proposed resolution:</b></p>
<p>In 27.8.1.5, 27.8.1.7, 27.8.1.8, 27.8.1.10, 27.8.1.11, and 27.8.1.13</p>
<p>Replace</p>
-<pre>
- bool is_open();
+<pre> bool is_open();
</pre>
<p>with</p>
-<pre>
- bool is_open() const;
+<pre> bool is_open() const;
</pre>
+<p><b>Rationale:</b></p>
+<p>Of the changes proposed in N1360, the only one that is safe is
+changing the filestreams' is_open to const. The LWG believed that
+this was NAD the first time it considered this issue (issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#73">73</a>), but now thinks otherwise. The corresponding streambuf
+member function, after all,is already const.</p>
+
+<p>The other proposed changes are less safe, because some streambuf
+functions that appear merely to report a value do actually perform
+mutating operations. It's not even clear that they should be
+considered "logically const", because streambuf has two interfaces, a
+public one and a protected one. These functions may, and often do,
+change the state as exposed by the protected interface, even if the
+state exposed by the public interface is unchanged.</p>
+
+<p>Note that implementers can make this change in a binary compatible
+way by providing both overloads; this would be a conforming extension.</p>
+
<hr>
<a name="366"><h3>366.&nbsp;Excessive const-qualification</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown, Marc Paterno&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
<p>
The following member functions are declared const, yet return non-const
pointers. We believe they are should be changed, because they allow code
that may surprise the user. See document N1360 for details and
rationale.
</p>
+
+<p><i>[Santa Cruz: the real issue is that we've got const member
+functions that return pointers to non-const, and N1360 proposes
+replacing them by overloaded pairs. There isn't a consensus about
+whether this is a real issue, since we've never said what our
+constness policy is for iostreams. N1360 relies on a distinction
+between physical constness and logical constness; that distinction, or
+those terms, does not appear in the standard.]</i></p>
+
<p><b>Proposed resolution:</b></p>
<p>In 27.4.4 and 27.4.4.2</p>
<p>Replace</p>
-<pre>
- basic_ostream&lt;charT,traits&gt;* tie() const;
+<pre> basic_ostream&lt;charT,traits&gt;* tie() const;
</pre>
<p>with</p>
-<pre>
- basic_ostream&lt;charT,traits&gt;* tie();
+<pre> basic_ostream&lt;charT,traits&gt;* tie();
const basic_ostream&lt;charT,traits&gt;* tie() const;
</pre>
<p>and replace</p>
-<pre>
- basic_streambuf&lt;charT,traits&gt;* rdbuf() const;
+<pre> basic_streambuf&lt;charT,traits&gt;* rdbuf() const;
</pre>
<p>with</p>
-<pre>
- basic_streambuf&lt;charT,traits&gt;* rdbuf();
+<pre> basic_streambuf&lt;charT,traits&gt;* rdbuf();
const basic_streambuf&lt;charT,traits&gt;* rdbuf() const;
</pre>
<p>In 27.5.2 and 27.5.2.3.1</p>
<p>Replace</p>
-<pre>
- char_type* eback() const;
+<pre> char_type* eback() const;
</pre>
<p>with</p>
-<pre>
- char_type* eback();
+<pre> char_type* eback();
const char_type* eback() const;
</pre>
<p>Replace</p>
-<pre>
- char_type gptr() const;
+<pre> char_type gptr() const;
</pre>
<p>with</p>
-<pre>
- char_type* gptr();
+<pre> char_type* gptr();
const char_type* gptr() const;
</pre>
<p>Replace</p>
-<pre>
- char_type* egptr() const;
+<pre> char_type* egptr() const;
</pre>
<p>with</p>
-<pre>
- char_type* egptr();
+<pre> char_type* egptr();
const char_type* egptr() const;
</pre>
<p>In 27.5.2 and 27.5.2.3.2</p>
<p>Replace</p>
-<pre>
- char_type* pbase() const;
+<pre> char_type* pbase() const;
</pre>
<p>with</p>
-<pre>
- char_type* pbase();
+<pre> char_type* pbase();
const char_type* pbase() const;
</pre>
<p>Replace</p>
-<pre>
- char_type* pptr() const;
+<pre> char_type* pptr() const;
</pre>
<p>with</p>
-<pre>
- char_type* pptr();
+<pre> char_type* pptr();
const char_type* pptr() const;
</pre>
<p>Replace</p>
-<pre>
- char_type* epptr() const;
+<pre> char_type* epptr() const;
</pre>
<p>with</p>
-<pre>
- char_type* epptr();
+<pre> char_type* epptr();
const char_type* epptr() const;
</pre>
<p>In 27.7.2, 27.7.2.2, 27.7.3 27.7.3.2, 27.7.4, and 27.7.6</p>
<p>Replace</p>
-<pre>
- basic_stringbuf&lt;charT,traits,Allocator&gt;* rdbuf() const;
+<pre> basic_stringbuf&lt;charT,traits,Allocator&gt;* rdbuf() const;
</pre>
<p>with</p>
-<pre>
- basic_stringbuf&lt;charT,traits,Allocator&gt;* rdbuf();
+<pre> basic_stringbuf&lt;charT,traits,Allocator&gt;* rdbuf();
const basic_stringbuf&lt;charT,traits,Allocator&gt;* rdbuf() const;
</pre>
<p>In 27.8.1.5, 27.8.1.7, 27.8.1.8, 27.8.1.10, 27.8.1.11, and 27.8.1.13</p>
<p>Replace</p>
-<pre>
- basic_filebuf&lt;charT,traits&gt;* rdbuf() const;
+<pre> basic_filebuf&lt;charT,traits&gt;* rdbuf() const;
</pre>
<p>with</p>
-<pre>
- basic_filebuf&lt;charT,traits&gt;* rdbuf();
+<pre> basic_filebuf&lt;charT,traits&gt;* rdbuf();
const basic_filebuf&lt;charT,traits&gt;* rdbuf() const;
</pre>
<hr>
-<a name="367"><h3>367.&nbsp;remove_copy/remove_copy_if and Input Iterators</h3></a><p>
-<b>Section:</b>&nbsp;25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Anthony Williams&nbsp; <b>Date:</b>&nbsp;13 May 2002</p>
-<p>
-remove_copy and remove_copy_if (25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a>) permit their
-input range to be marked with Input Iterators. However, since two
-operations are required against the elements to copy (comparison and
-assigment), when the input range uses Input Iterators, a temporary
-copy must be taken to avoid dereferencing the iterator twice. This
-therefore requires the value type of the InputIterator to be
-CopyConstructible. If the iterators are at least Forward Iterators,
-then the iterator can be dereferenced twice, or a reference to the
-result maintained, so the temporary is not required.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>
-Add &quot;If InputIterator does not meet the requirements of forward
-iterator, then the value type of InputIterator must be copy
-constructible. Otherwise copy constructible is not required.&quot; to
-25.2.7 <a href="lib-algorithms.html#lib.alg.remove"> [lib.alg.remove]</a> paragraph 6.
-</p>
-<hr>
-<a name="368"><h3>368.&nbsp;basic_string::replace has two &quot;Throws&quot; paragraphs</h3></a><p>
-<b>Section:</b>&nbsp;21.3.5.6 <a href="lib-strings.html#lib.string::replace"> [lib.string::replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;3 Jun 2002</p>
+<a name="368"><h3>368.&nbsp;basic_string::replace has two "Throws" paragraphs</h3></a><p>
+<b>Section:</b>&nbsp;21.3.5.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::replace"> [lib.string::replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;3 Jun 2002</p>
<p>
-21.3.5.6 <a href="lib-strings.html#lib.string::replace"> [lib.string::replace]</a> basic_string::replace, second
-signature, given in paragraph 1, has two &quot;Throws&quot; paragraphs (3 and
+21.3.5.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::replace"> [lib.string::replace]</a> basic_string::replace, second
+signature, given in paragraph 1, has two "Throws" paragraphs (3 and
5).
</p>
<p>
-In addition, the second &quot;Throws&quot; paragraph (5) includes specification
-(beginning with &quot;Otherwise, the function replaces ...&quot;) that should be
-part of the &quot;Effects&quot; paragraph.
+In addition, the second "Throws" paragraph (5) includes specification
+(beginning with "Otherwise, the function replaces ...") that should be
+part of the "Effects" paragraph.
</p>
<p><b>Proposed resolution:</b></p>
+<p><i>[This is a typo that escalated. It's clear that what's in the
+ Standard is wrong. It's less clear what the fix ought to be.
+ Someone who understands string replace well needs to work on
+ this.]</i></p>
<hr>
<a name="369"><h3>369.&nbsp;io stream objects and static ctors</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ruslan Abdikeev&nbsp; <b>Date:</b>&nbsp;8 Jul 2002</p>
+<b>Section:</b>&nbsp;27.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Ruslan Abdikeev&nbsp; <b>Date:</b>&nbsp;8 Jul 2002</p>
<p>
Is it safe to use standard iostream objects from constructors of
static objects? Are standard iostream objects constructed and are
@@ -5408,11 +3357,11 @@ iostream objects from constructors of static objects.
be discussed below:</p>
<blockquote>
- &quot;The [standard iostream] objects are constructed, and their
+ "The [standard iostream] objects are constructed, and their
associations are established at some time prior to or during
first time an object of class basic_ios&lt;charT,traits&gt;::Init
is constructed, and in any case before the body of main
- begins execution.&quot; (27.3/2 [lib.iostream.objects])
+ begins execution." (27.3/2 [lib.iostream.objects])
</blockquote>
<p>
@@ -5424,9 +3373,9 @@ to initialize standard iostream objects earlier than required.
and unsupported claim:</p>
<blockquote>
- &quot;Constructors and destructors for static objects can access these
+ "Constructors and destructors for static objects can access these
[standard iostream] objects to read input from stdin or write output
- to stdout or stderr.&quot; (27.3/2 footnote 265 [lib.iostream.objects])
+ to stdout or stderr." (27.3/2 footnote 265 [lib.iostream.objects])
</blockquote>
<p>
@@ -5445,54 +3394,36 @@ mention of an _instance_ of ios_base::Init in Standard.
</p>
<p><b>Proposed resolution:</b></p>
<p>
-At the end of header &lt;iostream&gt; synopsis in 27.3 <a href="lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a>
+At the end of header &lt;iostream&gt; synopsis in 27.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a>
</p>
-<pre>
- namespace std
+<pre> namespace std
{
... extern istream cin; ...
</pre>
<p>add the following lines</p>
-<pre>
- namespace
+<pre> namespace
{
ios_base::Init &lt;some_implementation_defined_name&gt;;
}
}
</pre>
-<hr>
-<a name="370"><h3>370.&nbsp;Minor error in basic_istream::get</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;15 Jul 2002</p>
-<p>Defect report for description of basic_istream::get (section 27.6.1.3 <a href="lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>), paragraph 15. The description for the get function
-with the following signature:</p>
-
-<pre>
- basic_istream&lt;charT,traits&gt;&amp; get(basic_streambuf&lt;char_type,traits&gt;&amp;
- sb);
-</pre>
-<p>is incorrect. It reads</p>
-
-<blockquote>
- Effects: Calls get(s,n,widen('\n'))
-</blockquote>
+<p><i>[Santa Cruz: The LWG is leaning toward NAD. There isn't any
+normative wording saying that the Init scheme will be used, but that
+is probably intentional. Implementers use dirty tricks for iostream
+initialization, and doing it portably is somewhere between difficult
+and impossible. Too much constraint in this area is dangerous, and if
+we are to make any changes it would probably be more appropriate
+forthem to be nonnormative. Martin will try to come up with clearer
+wording that expreses this intent.]</i></p>
-<p>which I believe should be:</p>
-<blockquote>
- Effects: Calls get(sb,widen('\n'))
-</blockquote>
-<p><b>Proposed resolution:</b></p>
-<p>Change the <b>Effects</b> paragraph to:</p>
-<blockquote>
- Effects: Calls get(sb,widen('\n'))
-</blockquote>
<hr>
<a name="371"><h3>371.&nbsp;Stability of multiset and multimap member functions</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Frank Compagner&nbsp; <b>Date:</b>&nbsp;20 Jul 2002</p>
+<b>Section:</b>&nbsp;23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Frank Compagner&nbsp; <b>Date:</b>&nbsp;20 Jul 2002</p>
<p>
The requirements for multiset and multimap containers (23.1
[lib.containers.requirements], 23.1.2 [lib.associative.reqmnts],
@@ -5509,8 +3440,7 @@ following 'idiom' that removes elements based on a certain predicate
function.
</p>
-<pre>
- multimap&lt;int, int&gt; m;
+<pre> multimap&lt;int, int&gt; m;
multimap&lt;int, int&gt;::iterator i = m.begin();
while (i != m.end()) {
if (pred(i))
@@ -5545,77 +3475,18 @@ be hard to track down by users. This would also make the need for an
erase_if() member function that much greater.
</p>
-<p>This issue is somewhat related to LWG issue <a href="lwg-closed.html#130">130</a>.</p>
-<p><b>Proposed resolution:</b></p>
-<hr>
-<a name="372"><h3>372.&nbsp;Inconsistent description of stdlib exceptions</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>, 18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a>, &nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Randy Maddox&nbsp; <b>Date:</b>&nbsp;22 Jul 2002</p>
-
-<p>Paragraph 3 under clause 17.4.4.8 <a href="lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a>, Restrictions on
-Exception Handling, states that &quot;Any other functions defined in the
-C++ Standard Library that do not have an exception-specification may
-throw implementation-defined exceptions unless otherwise specified.&quot;
-This statement is followed by a reference to footnote 178 at the
-bottom of that page which states, apparently in reference to the C++
-Standard Library, that &quot;Library implementations are encouraged (but
-not required) to report errors by throwing exceptions from (or derived
-from) the standard exceptions.&quot;</p>
-
-<p>These statements appear to be in direct contradiction to clause
-18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a>, which states &quot;The class exception defines the
-base class for the types of objects thrown as exceptions by the C++
-Standard library components ...&quot;.</p>
-
-<p>Is this inconsistent?</p>
+<p>This issue is somewhat related to LWG issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#130">130</a>.</p>
-<p><b>Proposed resolution:</b></p>
-<hr>
-<a name="373"><h3>373.&nbsp;Are basic_istream and basic_ostream to use (exceptions()&amp;badbit) != 0 ?</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>, 27.6.2.5.1 <a href="lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Keith Baker&nbsp; <b>Date:</b>&nbsp;23 Jul 2002</p>
+<p><i>[Santa Cruz: More people need to look at this. Much user code
+ may assume stability. On the other hand, it seems drastic to add a
+ new requirement now.]</i></p>
-<p>
-In 27.6.1.2.1 <a href="lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a> and 27.6.2.5.1 <a href="lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>
-(exception()&amp;badbit) != 0 is used in testing for rethrow, yet
-exception() is the constructor to class std::exception in 18.6.1 <a href="lib-support.html#lib.exception"> [lib.exception]</a> that has no return type. Should member function
-exceptions() found in 27.4.4 <a href="lib-iostreams.html#lib.ios"> [lib.ios]</a> be used instead?
-</p>
-
-<p><b>Proposed resolution:</b></p>
-<p>
-</p>
-<hr>
-<a name="374"><h3>374.&nbsp;moneypunct::frac_digits returns int not unsigned</h3></a><p>
-<b>Section:</b>&nbsp;22.2.6.3.1 <a href="lib-locales.html#lib.locale.moneypunct.members"> [lib.locale.moneypunct.members]</a>, 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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;8 Aug 2002</p>
-<p>
-In section 22.2.6.3.1 <a href="lib-locales.html#lib.locale.moneypunct.members"> [lib.locale.moneypunct.members]</a>, frac_digits() returns type
-&quot;int&quot;. This implies that frac_digits() might return a negative value,
-but a negative value is nonsensical. It should return &quot;unsigned&quot;.
-</p>
-
-<p>
-Similarly, in section 22.2.6.3.2 <a href="lib-locales.html#lib.locale.moneypunct.virtuals"> [lib.locale.moneypunct.virtuals]</a>, do_frac_digits()
-should return &quot;unsigned&quot;.
-</p>
-
-<p><b>Proposed resolution:</b></p>
-<hr>
-<a name="375"><h3>375.&nbsp;basic_ios should be ios_base in 27.7.1.3</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;14 Aug 2002</p>
-<p>
-In Section 27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>: Table 90, Table 91, and paragraph
-14 all contain references to &quot;basic_ios::&quot; which should be
-&quot;ios_base::&quot;.
-</p>
<p><b>Proposed resolution:</b></p>
-<p>
-Change all references to &quot;basic_ios&quot; in Table 90, Table 91, and
-paragraph 14 to &quot;ios_base&quot;.
-</p>
<hr>
<a name="376"><h3>376.&nbsp;basic_streambuf semantics</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;14 Aug 2002</p>
+<b>Section:</b>&nbsp;27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;14 Aug 2002</p>
<p>
-In Section 27.7.1.3 <a href="lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, Table 90, the implication is that
+In Section 27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, Table 90, the implication is that
the four conditions should be mutually exclusive, but they are not.
The first two cases, as written, are subcases of the third. I think it
would be clearer if the conditions were rewritten as follows:
@@ -5648,35 +3519,24 @@ are true, but case 3 is false, e.g.,
seekoff(0, ios_base::cur, ios_base::in | ios_base::out)
</blockquote>
-<p><b>Proposed resolution:</b></p>
-<hr>
-<a name="377"><h3>377.&nbsp;basic_string::insert and length_error</h3></a><p>
-<b>Section:</b>&nbsp;21.3.5.4 <a href="lib-strings.html#lib.string::insert"> [lib.string::insert]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;16 Aug 2002</p>
-<p>
-Section 21.3.5.4 <a href="lib-strings.html#lib.string::insert"> [lib.string::insert]</a>, paragraph 4, contains the following,
-&quot;Then throws length_error if size() &gt;= npos - rlen.&quot;
-</p>
+<p><i>[Santa Cruz: The ambiguity seems real. We need to do a survey of
+implementations before we decide on a solution.]</i></p>
-<p>
-Related to DR 83, this sentence should probably be removed.
-</p>
<p><b>Proposed resolution:</b></p>
<hr>
<a name="378"><h3>378.&nbsp;locale immutability and locale::operator=()</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
<p>
I think there is a problem with 22.1.1, p6 which says that
</p>
-<pre>
- -6- An instance of locale is immutable; once a facet reference
+<pre> -6- An instance of locale is immutable; once a facet reference
is obtained from it, that reference remains usable as long
as the locale value itself exists.
</pre>
<p>
and 22.1.1.2, p4:
</p>
-<pre>
- const locale&amp; operator=(const locale&amp; other) throw();
+<pre> const locale&amp; operator=(const locale&amp; other) throw();
-4- Effects: Creates a copy of other, replacing the current value.
</pre>
@@ -5685,10 +3545,9 @@ How can a reference to a facet obtained from a locale object remain
valid after an assignment that clearly must replace all the facets
in the locale object? Imagine a program such as this
</p>
-<pre>
- std::locale loc (&quot;de_DE&quot;);
+<pre> std::locale loc ("de_DE");
const std::ctype&lt;char&gt; &amp;r0 = std::use_facet&lt;std::ctype&lt;char&gt; &gt;(loc);
- loc = std::locale (&quot;en_US&quot;);
+ loc = std::locale ("en_US");
const std::ctype&lt;char&gt; &amp;r1 = std::use_facet&lt;std::ctype&lt;char&gt; &gt;(loc);
</pre>
<p>
@@ -5697,23 +3556,26 @@ out of scope?
</p>
<p><b>Proposed resolution:</b></p>
<p>
-Suggest to replace 22.1.1 <a href="lib-locales.html#lib.locale"> [lib.locale]</a>, p6 with
+Suggest to replace 22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>, p6 with
</p>
-<pre>
- -6- Unless assigned a new value, locale objects are immutable;
+<pre> -6- Unless assigned a new value, locale objects are immutable;
once a facet reference is obtained from it, that reference
remains usable as long as the locale object itself exists
or until the locale object is assigned the value of another,
distinct locale object.
</pre>
+
+<p><i>[Santa Cruz: Dietmar agrees with this general direction, but is
+uncomfortable about the proposed wording. He and Martin will try to
+come up with better wording.]</i></p>
+
<hr>
<a name="379"><h3>379.&nbsp;nonsensical ctype::do_widen() requirement</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
<p>
The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense.
</p>
-<pre>
- charT do_widen (char c) const;
+<pre> charT do_widen (char c) const;
-11- Effects: Applies the simplest reasonable transformation from
a char value or sequence of char values to the corresponding
@@ -5726,8 +3588,7 @@ The last sentence in 22.2.1.1.2, p11 below doesn't seem to make sense.
<p>
Shouldn't the last sentence instead read
</p>
-<pre>
- For any named ctype category with a ctype&lt;char&gt; facet ctc
+<pre> For any named ctype category with a ctype&lt;char&gt; facet ctc
and valid ctype_base::mask value M
(ctc.is(M, c) || !is(M, do_widen(c))) is true.
</pre>
@@ -5738,98 +3599,18 @@ footnote 224.)
</p>
<p><b>Proposed resolution:</b></p>
<p>
-Replace the last sentence of 22.2.1.1.2 <a href="lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>, p11 with the
+Replace the last sentence of 22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>, p11 with the
following text:
</p>
-<pre>
- For any named ctype category with a ctype&lt;char&gt; facet ctc
+<pre> For any named ctype category with a ctype&lt;char&gt; facet ctc
and valid ctype_base::mask value M
(ctc.is(M, c) || !is(M, do_widen(c))) is true.
</pre>
-<hr>
-<a name="380"><h3>380.&nbsp;typos in codecvt tables 53 and 54</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
-<p>
-Tables 53 and 54 in 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> are both titled &quot;convert
-result values,&quot; when surely &quot;do_in/do_out result values&quot; must have
-been intended for Table 53 and &quot;do_unshift result values&quot; for Table
-54.
-</p>
-<p>
-Table 54, row 3 says that the meaning of partial is &quot;more characters
-needed to be supplied to complete termination.&quot; The function is not
-supplied any characters, it is given a buffer which it fills with
-characters or, more precisely, destination elements (i.e., an escape
-sequence). So partial means that space for more than (to_limit - to)
-destination elements was needed to terminate a sequence given the
-value of state.
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>
-Change the title of Table 53 to &quot;do_in/do_out result values&quot; and
-the title of Table 54 to &quot;do_unshift result values.&quot;
-</p>
-<p>
-Change the text in Table 54, row 3, under the heading Meaning to
-&quot;space for more than (to_limit - to) destination elements was
-needed to terminate a sequence given the value of state.&quot;
-</p>
-<hr>
-<a name="381"><h3>381.&nbsp;detection of invalid mbstate_t in codecvt</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
-<p>
-All but one codecvt member functions that take a state_type argument
-list as one of their preconditions that the state_type argument have
-a valid value. However, according to 22.2.1.5.2, p6,
-codecvt::do_unshift() is the only codecvt member that is supposed to
-return error if the state_type object is invalid.
-</p>
-
-<p>
-It seems to me that the treatment of state_type by all codecvt member
-functions should be the same and the current requirements should be
-changed. Since the detection of invalid state_type values may be
-difficult in general or computationally expensive in some specific
-cases, I propose the following:
-</p>
-<p><b>Proposed resolution:</b></p>
-<p>
-Add a new paragraph before 22.2.1.5.2, p5, and after the function
-declaration below
-</p>
-<pre>
- result do_unshift(stateT&amp; state,
- externT* to, externT* to_limit, externT*&amp; to_next) const;
-</pre>
-<p>
-as follows:
-</p>
-<pre>
- Requires: (to &lt;= to_end) well defined and true; state initialized,
- if at the beginning of a sequence, or else equal to the result of
- converting the preceding characters in the sequence.
-</pre>
-<p>
-and change the text in Table 54, row 4, under the heading Meaning
-from
-</p>
-<pre>
- state has invalid value
-</pre>
-<p>
-to
-</p>
-<pre>
- an unspecified error has occurred
-</pre>
-<p>
-The return value of error should allow implementers to detect and
-report invalid state values but shouldn't require it, hence the
-word &quot;unspecified&quot; in the new wording.
-</p>
+<p><b>Rationale:</b></p>
+<p>The LWG believes this is just a typo, and that this is the correct fix.</p>
<hr>
<a name="382"><h3>382.&nbsp;codecvt do_in/out result</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#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;30 Aug 2002</p>
+<b>Section:</b>&nbsp;22.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;30 Aug 2002</p>
<p>
It seems that the descriptions of codecvt do_in() and do_out() leave
sufficient room for interpretation so that two implementations of
@@ -5854,32 +3635,32 @@ the following seems less than adequately specified:
<ol>
<li>
- 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p2 says this about the effects of the
+ 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p2 says this about the effects of the
function: ...Stops if it encounters a character it cannot
convert... This assumes that there *is* a character to
convert. What happens when there is a sequence that doesn't form a
valid source character, such as an unassigned or invalid UNICODE
character, or a sequence that cannot possibly form a character
- (e.g., the sequence &quot;\xc0\xff&quot; in UTF-8)?
+ (e.g., the sequence "\xc0\xff" in UTF-8)?
</li>
<li>
Table 53 says that the function returns codecvt_base::ok
- to indicate that the function(s) &quot;completed the conversion.&quot;
- Suppose that the source sequence is &quot;\xc0\x80&quot; in UTF-8,
+ to indicate that the function(s) "completed the conversion."
+ Suppose that the source sequence is "\xc0\x80" in UTF-8,
with from pointing to '\xc0' and (from_end==from + 1).
It is not clear whether the return value should be ok
or partial (see below).
</li>
<li>
Table 53 says that the function returns codecvt_base::partial
- if &quot;not all source characters converted.&quot; With the from pointers
+ if "not all source characters converted." With the from pointers
set up the same way as above, it is not clear whether the return
value should be partial or ok (see above).
</li>
<li>
Table 53, in the row describing the meaning of error mistakenly
- refers to a &quot;from_type&quot; character, without the symbol from_type
- having been defined. Most likely, the word &quot;source&quot; character
+ refers to a "from_type" character, without the symbol from_type
+ having been defined. Most likely, the word "source" character
is intended, although that is not sufficient. The functions
may also fail when they encounter an invalid source sequence
that cannot possibly form a valid source character (e.g., as
@@ -5887,21 +3668,21 @@ the following seems less than adequately specified:
</li>
</ol>
<p>
-Finally, the conditions described at the end of 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p4 don't seem to be possible:
+Finally, the conditions described at the end of 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p4 don't seem to be possible:
</p>
<blockquote>
- &quot;A return value of partial, if (from_next == from_end),
+ "A return value of partial, if (from_next == from_end),
indicates that either the destination sequence has not
absorbed all the available destination elements, or that
additional source elements are needed before another
- destination element can be produced.&quot;
+ destination element can be produced."
</blockquote>
<p>
If the value is partial, it's not clear to me that (from_next
==from_end) could ever hold if there isn't enough room
in the destination buffer. In order for (from_next==from_end) to
hold, all characters in that range must have been successfully
-converted (according to 22.2.1.5.2 <a href="lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p2) and since there are no
+converted (according to 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, p2) and since there are no
further source characters to convert, no more room in the
destination buffer can be needed.
</p>
@@ -5909,8 +3690,8 @@ destination buffer can be needed.
It's also not clear to me that (from_next==from_end) could ever
hold if additional source elements are needed to produce another
destination character (not element as incorrectly stated in the
-text). partial is returned if &quot;not all source characters have
-been converted&quot; according to Table 53, which also implies that
+text). partial is returned if "not all source characters have
+been converted" according to Table 53, which also implies that
(from_next==from) does NOT hold.
</p>
<p>
@@ -5919,7 +3700,7 @@ Could it be that the intended qualifying condition was actually
to read
</p>
<blockquote>
- &quot;A return value of partial, if (from_next != from_end),...&quot;
+ "A return value of partial, if (from_next != from_end),..."
</blockquote>
<p>
which would make perfect sense, since, as far as I understand it,
@@ -5931,11 +3712,10 @@ To address these issues, I propose that paragraphs 2, 3, and 4
be rewritten as follows. The proposal incorporates the accepted
resolution of lwg issue 19.
</p>
-<pre>
--2- Effects: Converts characters in the range of source elements
+<pre>-2- Effects: Converts characters in the range of source elements
[from, from_end), placing the results in sequential positions
- starting at destination to. Converts no more than (from_end&shy;from)
- source elements, and stores no more than (to_limit&shy;to)
+ starting at destination to. Converts no more than (from_end ­ from)
+ source elements, and stores no more than (to_limit ­ to)
destination elements.
Stops if it encounters a sequence of source elements it cannot
@@ -5983,6 +3763,2134 @@ resolution of lwg issue 19.
source elements are needed before another destination character
can be produced.
</pre>
+
+<p><i>[Santa Cruz: The LWG agrees that this is an important issue and
+that this general direction is probably correct. Dietmar, Howard,
+PJP, and Matt will review this wording.]</i></p>
+
+<hr>
+<a name="384"><h3>384.&nbsp;equal_range has unimplementable runtime complexity</h3></a><p>
+<b>Section:</b>&nbsp;25.3.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.equal.range"> [lib.equal.range]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Hans Bos&nbsp; <b>Date:</b>&nbsp;18 Oct 2002</p>
+<p>
+Section 25.3.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.equal.range"> [lib.equal.range]</a>
+states that at most 2 * log(last - first) + 1
+comparisons are allowed for equal_range.
+</p>
+
+<p>It is not possible to implement equal_range with these constraints.</p>
+
+<p>In a range of one element as in:</p>
+<pre> int x = 1;
+ equal_range(&amp;x, &amp;x + 1, 1)
+</pre>
+
+<p>it is easy to see that at least 2 comparison operations are needed.</p>
+
+<p>For this case at most 2 * log(1) + 1 = 1 comparison is allowed.</p>
+
+<p>I have checked a few libraries and they all use the same (nonconforming)
+algorithm for equal_range that has a complexity of</p>
+<pre> 2* log(distance(first, last)) + 2.
+</pre>
+<p>I guess this is the algorithm that the standard assumes for equal_range.</p>
+
+<p>
+It is easy to see that 2 * log(distance) + 2 comparisons are enough
+since equal range can be implemented with lower_bound and upper_bound
+(both log(distance) + 1).
+</p>
+
+<p>
+I think it is better to require something like 2log(distance) + O(1) (or
+even logarithmic as multiset::equal_range).
+Then an implementation has more room to optimize for certain cases (e.g.
+have log(distance) characteristics when at most match is found in the range
+but 2log(distance) + 4 for the worst case).
+</p>
+
+<p><i>[Santa Cruz: The issue is real, but of greater scope than just
+equal_range: it affects all of the binary search algorithms. What is
+the complexity supposed to be for ranges of 0 or 1 elements? What
+base are we using for the logarithm? Are these bounds supposed to be
+exact, or asymptotic? (If the latter, of course, then none of the
+other questions matter.)]</i></p>
+
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="385"><h3>385.&nbsp;Does call by value imply the CopyConstructible requirement?</h3></a><p>
+<b>Section:</b>&nbsp;17 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Oct 2002</p>
+<p>
+Many function templates have parameters that are passed by value;
+a typical example is <tt>find_if</tt>'s <i>pred</i> parameter in
+25.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.find"> [lib.alg.find]</a>. Are the corresponding template parameters
+(<tt>Predicate</tt> in this case) implicitly required to be
+CopyConstructible, or does that need to be spelled out explicitly?
+</p>
+
+<p>
+This isn't quite as silly a question as it might seem to be at first
+sight. If you call <tt>find_if</tt> in such a way that template
+argument deduction applies, then of course you'll get call by value
+and you need to provide a copy constructor. If you explicitly provide
+the template arguments, however, you can force call by reference by
+writing something like <tt>find_if&lt;my_iterator,
+my_predicate&amp;&gt;</tt>. The question is whether implementation
+are required to accept this, or whether this is ill-formed because
+my_predicate&amp; is not CopyConstructible.
+</p>
+
+<p>
+The scope of this problem, if it is a problem, is unknown. Function
+object arguments to generic algorithms in clauses 25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>
+and 26 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.numerics"> [lib.numerics]</a> are obvious examples. A review of the whole
+library is necessary.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p><i>[
+This is really two issues. First, predicates are typically passed by
+value but we don't say they must be Copy Constructible. They should
+be. Second: is specialization allowed to transform value arguments
+into references? References aren't copy constructible, so this should
+not be allowed.
+]</i></p>
+<hr>
+<a name="386"><h3>386.&nbsp;Reverse iterator's operator[] has impossible return type</h3></a><p>
+<b>Section:</b>&nbsp;24.4.1.3.11 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iter.opindex"> [lib.reverse.iter.opindex]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Oct 2002</p>
+<p>In 24.4.1.3.11 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iter.opindex"> [lib.reverse.iter.opindex]</a>, <tt>reverse_iterator&lt;&gt;::operator[]</tt>
+is specified as having a return type of <tt>reverse_iterator::reference</tt>,
+which is the same as <tt>iterator_traits&lt;Iterator&gt;::reference</tt>.
+(Where <tt>Iterator</tt> is the underlying iterator type.)</p>
+
+<p>The trouble is that <tt>Iterator</tt>'s own operator[] doesn't
+ necessarily have a return type
+ of <tt>iterator_traits&lt;Iterator&gt;::reference</tt>. Its
+ return type is merely required to be convertible
+ to <tt>Iterator</tt>'s value type. The return type specified for
+ reverse_iterator's operator[] would thus appear to be impossible.</p>
+
+<p>Related issue: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299">299</a>. Jeremy will work on this.</p>
+<p><b>Proposed resolution:</b></p>
+<p><i>[
+Comments from Dave Abrahams: IMO we should resolve 386 by just saying
+ that the return type of reverse_iterator's operator[] is
+ unspecified, allowing the random access iterator requirements to
+ impose an appropriate return type. If we accept 299's proposed
+ resolution (and I think we should), the return type will be
+ readable and writable, which is about as good as we can do.
+]</i></p>
+<hr>
+<a name="387"><h3>387.&nbsp;std::complex over-encapsulated</h3></a><p>
+<b>Section:</b>&nbsp;26.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.numbers"> [lib.complex.numbers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Gabriel Dos Reis&nbsp; <b>Date:</b>&nbsp;8 Nov 2002</p>
+<p>
+The absence of explicit description of std::complex&lt;T&gt; layout
+makes it imposible to reuse existing software developed in traditional
+languages like Fortran or C with unambigous and commonly accepted
+layout assumptions. There ought to be a way for practitioners to
+predict with confidence the layout of std::complex&lt;T&gt; whenever T
+is a numerical datatype. The absence of ways to access individual
+parts of a std::complex&lt;T&gt; object as lvalues unduly promotes
+severe pessimizations. For example, the only way to change,
+independently, the real and imaginary parts is to write something like
+</p>
+
+<pre>complex&lt;T&gt; z;
+// ...
+// set the real part to r
+z = complex&lt;T&gt;(r, z.imag());
+// ...
+// set the imaginary part to i
+z = complex&lt;T&gt;(z.real(), i);
+</pre>
+
+<p>
+At this point, it seems appropriate to recall that a complex number
+is, in effect, just a pair of numbers with no particular invariant to
+maintain. Existing practice in numerical computations has it that a
+complex number datatype is usually represented by Cartesian
+coordinates. Therefore the over-encapsulation put in the specification
+of std::complex&lt;&gt; is not justified.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>Add the following requirements to 26.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.numbers"> [lib.complex.numbers]</a> as 26.2/4:</p>
+<blockquote>
+<p>If z is an lvalue expression of type cv std::complex&lt;T&gt; then</p>
+
+<ul>
+<li>the expression reinterpret_cast&lt;cv T(&amp;)[2]&gt;(z)
+is well-formed; and</li>
+<li>reinterpret_cast&lt;cvT(&amp;)[2]&gt;(z)[0]designates the
+real part of z; and</li>
+<li>reinterpret_cast&lt;cvT(&amp;)[2]&gt;(z)[1]designates the
+imaginary part of z.</li>
+</ul>
+
+<p>
+Moreover, if a is an expression of pointer type cv complex&lt;T&gt;*
+and the expression a[i] is well-defined for an integer expression
+i then:
+</p>
+
+<ul>
+<li>reinterpret_cast&lt;cvT*&gt;(a)[2+i] designates the real
+part of a[i]; and</li>
+<li>reinterpret_cast&lt;cv T*&gt;(a)[2+i+1] designates the
+imaginary part of a[i].</li>
+</ul>
+</blockquote>
+
+<p>In the header synopsis in 26.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a>, replace</p>
+<pre> template&lt;class T&gt; T real(const complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; T imag(const complex&lt;T&gt;&amp;);
+</pre>
+
+<p>with</p>
+
+<pre> template&lt;class T&gt; const T&amp; real(const complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; T&amp; real( complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; const T&amp; imag(const complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; T&amp; imag( complex&lt;T&gt;&amp;);
+</pre>
+
+<p>In 26.2.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.value.ops"> [lib.complex.value.ops]</a> paragraph 1, change</p>
+<pre> template&lt;class T&gt; T real(const complex&lt;T&gt;&amp;);
+</pre>
+<p>to</p>
+<pre> template&lt;class T&gt; const T&amp; real(const complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; T&amp; real( complex&lt;T&gt;&amp;);
+</pre>
+<p>and change the <b>Returns</b> clause to "<b>Returns:</b> The real
+part of <i>x</i>
+</p>.
+
+<p>In 26.2.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.value.ops"> [lib.complex.value.ops]</a> paragraph 2, change</p>
+<pre> template&lt;class T&gt; T imag(const complex&lt;T&gt;&amp;);
+</pre>
+<p>to</p>
+<pre> template&lt;class T&gt; const T&amp; imag(const complex&lt;T&gt;&amp;);
+ template&lt;class T&gt; T&amp; imag( complex&lt;T&gt;&amp;);
+</pre>
+<p>and change the <b>Returns</b> clause to "<b>Returns:</b> The imaginary
+part of <i>x</i>
+</p>.
+
+
+<p><b>Rationale:</b></p>
+<p>The LWG believes that C99 compatibility would be enough
+justification for this change even without other considerations. All
+existing implementations already have the layout proposed here.</p>
+<hr>
+<a name="389"><h3>389.&nbsp;Const overload of valarray::operator[] returns by value</h3></a><p>
+<b>Section:</b>&nbsp;26.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Gabriel Dos Reis&nbsp; <b>Date:</b>&nbsp;8 Nov 2002</p>
+<p>Consider the following program:</p>
+<pre> #include &lt;iostream&gt;
+ #include &lt;ostream&gt;
+ #include &lt;vector&gt;
+ #include &lt;valarray&gt;
+ #include &lt;algorithm&gt;
+ #include &lt;iterator&gt;
+ template&lt;typename Array&gt;
+ void print(const Array&amp; a)
+ {
+ using namespace std;
+ typedef typename Array::value_type T;
+ copy(&amp;a[0], &amp;a[0] + a.size(),
+ ostream_iterator&lt;T&gt;(std::cout, " "));
+ }
+ template&lt;typename T, unsigned N&gt;
+ unsigned size(T(&amp;)[N]) { return N; }
+ int main()
+ {
+ double array[] = { 0.89, 9.3, 7, 6.23 };
+ std::vector&lt;double&gt; v(array, array + size(array));
+ std::valarray&lt;double&gt; w(array, size(array));
+ print(v); // #1
+ std::cout &lt;&lt; std::endl;
+ print(w); // #2
+ std::cout &lt;&lt; std::endl;
+ }
+</pre>
+
+<p>While the call numbered #1 succeeds, the call numbered #2 fails
+because the const version of the member function
+valarray&lt;T&gt;::operator[](size_t) returns a value instead of a
+const-reference. That seems to be so for no apparent reason, no
+benefit. Not only does that defeats users' expectation but it also
+does hinder existing software (written either in C or Fortran)
+integration within programs written in C++. There is no reason why
+subscripting an expression of type valarray&lt;T&gt; that is const-qualified
+should not return a const T&amp;.</p>
+<p><b>Proposed resolution:</b></p>
+<p>In the class synopsis in 26.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a>, and in
+26.3.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.valarray.access"> [lib.valarray.access]</a> just above paragraph 1, change</p>
+<pre> T operator[](size_t const;)
+</pre>
+<p>to</p>
+<pre> const T&amp; operator[](size_t const;)
+</pre>
+
+<p><b>Rationale:</b></p>
+<p>Return by value seems to serve no purpose. Valaray was explicitly
+designed to have a specified layout so that it could easily be
+integrated with libraries in other languages, and return by value
+defeats that purpose. It is believed that this change will have no
+impact on allowable optimizations.</p>
+<hr>
+<a name="391"><h3>391.&nbsp;non-member functions specified as const</h3></a><p>
+<b>Section:</b>&nbsp;22.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.conversions"> [lib.conversions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;James Kanze&nbsp; <b>Date:</b>&nbsp;10 Dec 2002</p>
+<p>
+The specifications of toupper and tolower both specify the functions as
+const, althought they are not member functions, and are not specified as
+const in the header file synopsis in section 22.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locales"> [lib.locales]</a>.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>In 22.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.conversions"> [lib.conversions]</a>, remove <tt>const</tt> from the function
+ declarations of std::toupper and std::tolower</p>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo</p>
+<hr>
+<a name="394"><h3>394.&nbsp;behavior of formatted output on failure</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted"> [lib.ostream.formatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;27 Dec 2002</p>
+<p>
+There is a contradiction in Formatted output about what bit is
+supposed to be set if the formatting fails. On sentence says it's
+badbit and another that it's failbit.
+</p>
+<p>
+27.6.2.5.1, p1 says in the Common Requirements on Formatted output
+functions:
+</p><pre> ... If the generation fails, then the formatted output function
+ does setstate(ios::failbit), which might throw an exception.
+</pre>
+<p></p>
+<p>
+27.6.2.5.2, p1 goes on to say this about Arithmetic Inserters:
+</p>
+<p>
+ ... The formatting conversion occurs as if it performed the
+ following code fragment:
+</p>
+<p>
+</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();
+
+ ... If failed is true then does setstate(badbit) ...
+</pre>
+<p></p>
+<p>
+The original intent of the text, according to Jerry Schwarz (see
+c++std-lib-10500), is captured in the following paragraph:
+</p>
+<p>
+In general "badbit" should mean that the stream is unusable because
+of some underlying failure, such as disk full or socket closure;
+"failbit" should mean that the requested formatting wasn't possible
+because of some inconsistency such as negative widths. So typically
+if you clear badbit and try to output something else you'll fail
+again, but if you clear failbit and try to output something else
+you'll succeed.
+</p>
+<p>
+In the case of the arithmetic inserters, since num_put cannot
+report failure by any means other than exceptions (in response
+to which the stream must set badbit, which prevents the kind of
+recoverable error reporting mentioned above), the only other
+detectable failure is if the iterator returned from num_put
+returns true from failed().
+</p>
+<p>
+Since that can only happen (at least with the required iostream
+specializations) under such conditions as the underlying failure
+referred to above (e.g., disk full), setting badbit would seem
+to be the appropriate response (indeed, it is required in
+27.6.2.5.2, p1). It follows that failbit can never be directly
+set by the arithmetic (it can only be set by the sentry object
+under some unspecified conditions).
+</p>
+<p>
+The situation is different for other formatted output functions
+which can fail as a result of the streambuf functions failing
+(they may do so by means other than exceptions), and which are
+then required to set failbit.
+</p>
+<p>
+The contradiction, then, is that ostream::operator&lt;&lt;(int) will
+set badbit if the disk is full, while operator&lt;&lt;(ostream&amp;,
+char) will set failbit under the same conditions. To make the behavior
+consistent, the Common requirements sections for the Formatted output
+functions should be changed as proposed below.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In paragraph one of section 27.6.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted"> [lib.ostream.formatted]</a>, delete the
+sentence beginning with "If the generation fails".
+</p>
+<p><b>Rationale:</b></p>
+<p>
+There isn't any contradiction here. <tt>put</tt> returns a streambuf iterator.
+<tt>failed()</tt> is a member function of the streambuf iterator. If
+it's set then that's a streambuf error, not a conversion error.
+</p>
+
+<p>
+The real problem isn't that there's a contradiction, but that the "If
+the generation fails" part makes little sense. "Generation" isn't
+clearly defined. It's not clear what it means for generation to
+fail, or even whether it can fail. The intention is probably that
+generaion meant formatting, as opposed to character insertion, and
+that this sentence was intended as analogous to character parsing.
+</p>
+
+<p>A more precise definition would be that we set failbit if the facet
+ reports failure. However, the mechanism for the facet reporting
+ failure is that it sets failbit! Saying that we set failbit if the
+ facet sets failbit would be silly, so the best thing to say is
+ nothing.</p>
+
+<hr>
+<a name="395"><h3>395.&nbsp;inconsistencies in the definitions of rand() and random_shuffle()</h3></a><p>
+<b>Section:</b>&nbsp;26.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.c.math"> [lib.c.math]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Review">Review</a>&nbsp; <b>Submitter:</b>&nbsp;James Kanze&nbsp; <b>Date:</b>&nbsp;3 Jan 2003</p>
+<p>
+In 26.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.c.math"> [lib.c.math]</a>, the C++ standard refers to the C standard for the
+definition of rand(); in the C standard, it is written that "The
+implementation shall behave as if no library function calls the rand
+function."
+</p>
+
+<p>
+In 25.2.11 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.random.shuffle"> [lib.alg.random.shuffle]</a>, there is no specification as to
+how the two parameter version of the function generates its random
+value. I believe that all current implementations in fact call rand()
+(in contradiction with the requirement avove); if an implementation does
+not call rand(), there is the question of how whatever random generator
+it does use is seeded. Something is missing.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+In [lib.c.math], add a paragraph specifying that the C definition of
+rand shal be modified to say that "Unless otherwise specified, the
+implementation shall behave as if no library function calls the rand
+function."
+</p>
+
+<p>
+In [lib.alg.random.shuffle], add a sentence to the effect that "In
+the two argument form of the function, the underlying source of
+random numbers is implementation defined. [Note: in particular, an
+implementation is permitted to use <tt>rand</tt>.]
+</p>
+<p><b>Rationale:</b></p>
+<p>The original proposed resolution proposed requiring the
+ two-argument from of <tt>random_shuffle</tt> to
+ use <tt>rand</tt>. We don't want to do that, because some existing
+ implementations already use something else: gcc
+ uses <tt>lrand48</tt>, for example. Using <tt>rand</tt> presents a
+ problem if the number of elements in the sequence is greater than
+ RAND_MAX.</p>
+<hr>
+<a name="396"><h3>396.&nbsp;what are characters zero and one</h3></a><p>
+<b>Section:</b>&nbsp;23.3.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.cons"> [lib.bitset.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;5 Jan 2003</p>
+ <p>
+23.3.5.1, p6 [lib.bitset.cons] talks about a generic character
+having the value of 0 or 1 but there is no definition of what
+that means for charT other than char and wchar_t. And even for
+those two types, the values 0 and 1 are not actually what is
+intended -- the values '0' and '1' are. This, along with the
+converse problem in the description of to_string() in 23.3.5.2,
+p33, looks like a defect remotely related to DR 303.
+ </p>
+ <p>
+http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#303
+ </p>
+ <pre>23.3.5.1:
+ -6- An element of the constructed string has value zero if the
+ corresponding character in str, beginning at position pos,
+ is 0. Otherwise, the element has the value one.
+ </pre>
+ <pre>23.3.5.2:
+ -33- Effects: Constructs a string object of the appropriate
+ type and initializes it to a string of length N characters.
+ Each character is determined by the value of its
+ corresponding bit position in *this. Character position N
+ ?- 1 corresponds to bit position zero. Subsequent decreasing
+ character positions correspond to increasing bit positions.
+ Bit value zero becomes the character 0, bit value one becomes
+ the character 1.
+ </pre>
+ <p>
+Also note the typo in 23.3.5.1, p6: the object under construction
+is a bitset, not a string.
+ </p>
+ <p><b>Proposed resolution:</b></p>
+<p>Change the constructor's function declaration immediately before
+23.3.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.cons"> [lib.bitset.cons]</a> p3 to:</p>
+<pre> template &lt;class charT, class traits, class Allocator&gt;
+ explicit
+ bitset(const basic_string&lt;charT, traits, Allocator&gt;&amp; str,
+ typename basic_string&lt;charT, traits, Allocator&gt;::size_type pos = 0,
+ typename basic_string&lt;charT, traits, Allocator&gt;::size_type n =
+ basic_string&lt;charT, traits, Allocator&gt;::npos,
+ charT zero = charT('0'));
+</pre>
+<p>Change the first two sentences of 23.3.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.cons"> [lib.bitset.cons]</a> p6 to: "An
+element of the constructed string has value 0 if the corresponding
+character in <i>str</i>, beginning at position <i>pos</i>,
+is <i>zero</i>. Otherwise, the element has the value 1.</p>
+
+<p>Change the declaration of the <tt>to_string</tt> member function
+ immediately before 23.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a> p33 to:</p>
+<pre> template &lt;class charT, class traits, class Allocator&gt;
+ basic_string&lt;charT, traits, Allocator&gt;
+ to_string(charT zero = charT('0'), charT one = charT('1')) const;
+</pre>
+<p>Change the last sentence of 23.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a> p33 to: "Bit
+ value 0 becomes the character <tt><i>zero</i></tt>, bit value 1 becomes the
+ character <tt><i>one</i></tt>.</p>
+<p>Change 23.3.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.operators"> [lib.bitset.operators]</a> p8 to:</p>
+<p>
+<b>Returns</b>:</p>
+<pre> os &lt;&lt; x.template to_string&lt;charT,traits,allocator&lt;charT&gt; &gt;(
+ use_facet&lt;ctype&lt;charT&gt; &gt;(<i>os</i>.getloc()).widen('0'),
+ use_facet&lt;ctype&lt;charT&gt; &gt;(<i>os</i>.getloc()).widen('1'));
+</pre>
+<p><b>Rationale:</b></p>
+<p>There is a real problem here: we need the character values of '0'
+ and '1', and we have no way to get them since strings don't have
+ imbued locales. In principle the "right" solution would be to
+ provide an extra object, either a ctype facet or a full locale,
+ which would be used to widen '0' and '1'. However, there was some
+ discomfort about using such a heavyweight mechanism. The proposed
+ resolution allows those users who care about this issue to get it
+ right.</p>
+<p>We fix the inserter to use the new arguments. Note that we already
+ fixed the analogous problem with the extractor in issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#303">303</a>.</p>
+
+<hr>
+<a name="397"><h3>397.&nbsp;ostream::sentry dtor throws exceptions</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;5 Jan 2003</p>
+ <p>
+17.4.4.8, p3 prohibits library dtors from throwing exceptions.
+ </p>
+ <p>
+27.6.2.3, p4 says this about the ostream::sentry dtor:
+ </p>
+ <pre> -4- If ((os.flags() &amp; ios_base::unitbuf) &amp;&amp; !uncaught_exception())
+ is true, calls os.flush().
+ </pre>
+ <p>
+27.6.2.6, p7 that describes ostream::flush() says:
+ </p>
+ <pre> -7- If rdbuf() is not a null pointer, calls rdbuf()-&gt;pubsync().
+ If that function returns ?-1 calls setstate(badbit) (which
+ may throw ios_base::failure (27.4.4.3)).
+ </pre>
+ <p>
+That seems like a defect, since both pubsync() and setstate() can
+throw an exception.
+ </p>
+ <p><b>Proposed resolution:</b></p>
+<p><i>[
+The contradiction is real. Clause 17 says destructors may never
+throw exceptions, and clause 27 specifies a destructor that does
+throw. In principle we might change either one. We're leaning
+toward changing clause 17: putting in an "unless otherwise specified"
+clause, and then putting in a footnote saying the sentry destructor
+is the only one that can throw. PJP suggests specifying that
+sentry::~sentry() should internally catch any exceptions it might cause.
+]</i></p>
+<hr>
+<a name="398"><h3>398.&nbsp;effects of end-of-file on unformatted input functions</h3></a><p>
+<b>Section:</b>&nbsp;27.6.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream::sentry"> [lib.ostream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Open">Open</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;5 Jan 2003</p>
+ <p>
+While reviewing unformatted input member functions of istream
+for their behavior when they encounter end-of-file during input
+I found that the requirements vary, sometimes unexpectedly, and
+in more than one case even contradict established practice (GNU
+libstdc++ 3.2, IBM VAC++ 6.0, STLPort 4.5, SunPro 5.3, HP aCC
+5.38, Rogue Wave libstd 3.1, and Classic Iostreams).
+ </p>
+ <p>
+The following unformatted input member functions set eofbit if they
+encounter an end-of-file (this is the expected behavior, and also
+the behavior of all major implementations):
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ get (char_type*, streamsize, char_type);
+ </pre>
+ <p></p>
+ <p>
+ Also sets failbit if it fails to extract any characters.
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ get (char_type*, streamsize);
+ </pre>
+ <p></p>
+ <p>
+ Also sets failbit if it fails to extract any characters.
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ getline (char_type*, streamsize, char_type);
+ </pre>
+ <p></p>
+ <p>
+ Also sets failbit if it fails to extract any characters.
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ getline (char_type*, streamsize);
+ </pre>
+ <p></p>
+ <p>
+ Also sets failbit if it fails to extract any characters.
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ ignore (int, int_type);
+ </pre>
+ <p></p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ read (char_type*, streamsize);
+ </pre>
+ <p></p>
+ <p>
+ Also sets failbit if it encounters end-of-file.
+ </p>
+ <p>
+ </p><pre> streamsize readsome (char_type*, streamsize);
+ </pre>
+ <p></p>
+
+ <p>
+The following unformated input member functions set failbit but
+not eofbit if they encounter an end-of-file (I find this odd
+since the functions make it impossible to distinguish a general
+failure from a failure due to end-of-file; the requirement is
+also in conflict with all major implementation which set both
+eofbit and failbit):
+ </p>
+ <p>
+ </p><pre> int_type get();
+ </pre>
+ <p></p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ get (char_type&amp;);
+ </pre>
+ <p></p>
+ <p>
+These functions only set failbit of they extract no characters,
+otherwise they don't set any bits, even on failure (I find this
+inconsistency quite unexpected; the requirement is also in
+conflict with all major implementations which set eofbit
+whenever they encounter end-of-file):
+ </p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ get (basic_streambuf&lt;charT, traits&gt;&amp;, char_type);
+ </pre>
+ <p></p>
+ <p>
+ </p><pre> basic_istream&lt;charT, traits&gt;&amp;
+ get (basic_streambuf&lt;charT, traits&gt;&amp;);
+ </pre>
+ <p></p>
+ <p>
+This function sets no bits (all implementations except for
+STLport and Classic Iostreams set eofbit when they encounter
+end-of-file):
+ </p>
+ <p>
+ </p><pre> int_type peek ();
+ </pre>
+ <p></p>
+ <p><b>Proposed resolution:</b></p>
+<p>Informally, what we want is a global statement of intent saying
+ that eofbit gets set if we trip across EOF, and then we can take
+ away the specific wording for individual functions. A full review
+ is necessary. The wording currently in the standard is a mishmash,
+ and changing it on an individual basis wouldn't make things better.
+ Dietmar will do this work.</p>
+<hr>
+<a name="400"><h3>400.&nbsp;redundant type cast in lib.allocator.members</h3></a><p>
+<b>Section:</b>&nbsp;20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#Ready">Ready</a>&nbsp; <b>Submitter:</b>&nbsp;Markus Mauhart&nbsp; <b>Date:</b>&nbsp;27 Feb 2003</p>
+<p>
+20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a> allocator members, contains
+the following 3 lines:
+</p>
+
+<pre> 12 Returns: new((void *) p) T( val)
+ void destroy(pointer p);
+ 13 Returns: ((T*) p)-&gt;~T()
+</pre>
+
+<p>
+The type cast "(T*) p" in the last line is redundant cause
+we know that std::allocator&lt;T&gt;::pointer is a typedef for T*.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Replace "((T*) p)" with "p".
+</p>
+<p><b>Rationale:</b></p>
+<p>Just a typo, this is really editorial.</p>
+<hr>
+<a name="401"><h3>401.&nbsp; incorrect type casts in table 32 in lib.allocator.requirements</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Markus Mauhart&nbsp; <b>Date:</b>&nbsp;27 Feb 2003</p>
+<p>
+I think that in par2 of 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a> the last two
+lines of table 32 contain two incorrect type casts. The lines are ...
+</p>
+
+<pre> a.construct(p,t) Effect: new((void*)p) T(t)
+ a.destroy(p) Effect: ((T*)p)?-&gt;~T()
+</pre>
+
+<p>
+.... with the prerequisits coming from the preceding two paragraphs, especially
+from table 31:
+</p>
+
+<pre> alloc&lt;T&gt; a ;// an allocator for T
+ alloc&lt;T&gt;::pointer p ;// random access iterator
+ // (may be different from T*)
+ alloc&lt;T&gt;::reference r = *p;// T&amp;
+ T const&amp; t ;
+</pre>
+
+<p>
+For that two type casts ("(void*)p" and "(T*)p") to be well-formed
+this would require then conversions to T* and void* for all
+alloc&lt;T&gt;::pointer, so it would implicitely introduce extra
+requirements for alloc&lt;T&gt;::pointer, additionally to the only
+current requirement (being a random access iterator).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+"(void*)p" should be replaced with "(void*)&amp;*p" and that
+"((T*)p)?-&gt;" should be replaced with "(*p)." or with
+"(&amp;*p)-&gt;".
+</p>
+
+<p>
+Note: Actually I would prefer to replace "((T*)p)?-&gt;dtor_name" with
+"p?-&gt;dtor_name", but AFAICS this is not possible cause of an omission
+in 13.5.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/over.html#over.ref"> [over.ref]</a> (for which I have filed another DR on 29.11.2002).
+</p>
+<hr>
+<a name="402"><h3>402.&nbsp;wrong new expression in [some_]allocator::construct</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, 20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a>, &nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Markus Mauhart&nbsp; <b>Date:</b>&nbsp;27 Feb 2003</p>
+<p>
+This applies to the new expression that is contained in both par12 of
+20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a> and in par2 (table 32) of 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>.
+I think this new expression is wrong, involving unintended side
+effects.
+</p>
+
+
+<p>20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a> contains the following 3 lines:</p>
+
+<pre> 11 Returns: the largest value N for which the call allocate(N,0) might succeed.
+ void construct(pointer p, const_reference val);
+ 12 Returns: new((void *) p) T( val)
+</pre>
+
+
+<p>20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a> in table 32 has the following line:</p>
+<pre> a.construct(p,t) Effect: new((void*)p) T(t)
+</pre>
+
+<p>
+.... with the prerequisits coming from the preceding two paragraphs,
+especially from table 31:
+</p>
+
+<pre> alloc&lt;T&gt; a ;// an allocator for T
+ alloc&lt;T&gt;::pointer p ;// random access iterator
+ // (may be different from T*)
+ alloc&lt;T&gt;::reference r = *p;// T&amp;
+ T const&amp; t ;
+</pre>
+
+<p>
+Cause of using "new" but not "::new", any existing "T::operator new"
+function will hide the global placement new function. When there is no
+"T::operator new" with adequate signature,
+every_alloc&lt;T&gt;::construct(..) is ill-formed, and most
+std::container&lt;T,every_alloc&lt;T&gt;&gt; use it; a workaround
+would be adding placement new and delete functions with adequate
+signature and semantic to class T, but class T might come from another
+party. Maybe even worse is the case when T has placement new and
+delete functions with adequate signature but with "unknown" semantic:
+I dont like to speculate about it, but whoever implements
+any_container&lt;T,any_alloc&gt; and wants to use construct(..)
+probably must think about it.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Therefore I think that "new" should be replaced with "::new" in both
+cases.
+</p>
+<hr>
+<a name="403"><h3>403.&nbsp;basic_string::swap should not throw exceptions</h3></a><p>
+<b>Section:</b>&nbsp;21.3.5.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::swap"> [lib.string::swap]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;25 Mar 2003</p>
+
+<p>
+std::basic_string, 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a> paragraph 2 says that
+basic_string "conforms to the requirements of a Sequence, as specified
+in (23.1.1)." The sequence requirements specified in (23.1.1) to not
+include any prohibition on swap members throwing exceptions.
+</p>
+
+<p>
+Section 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 10 does limit conditions under
+which exceptions may be thrown, but applies only to "all container
+types defined in this clause" and so excludes basic_string::swap
+because it is defined elsewhere.
+</p>
+
+<p>
+Eric Niebler points out that 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a> paragraph 5 explicitly
+permits basic_string::swap to invalidates iterators, which is
+disallowed by 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 10. Thus the standard would
+be contradictory if it were read or extended to read as having
+basic_string meet 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 10 requirements.
+</p>
+
+<p>
+Yet several LWG members have expressed the belief that the original
+intent was that basic_string::swap should not throw exceptions as
+specified by 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 10, and that the standard is
+unclear on this issue. The complexity of basic_string::swap is
+specified as "constant time", indicating the intent was to avoid
+copying (which could cause a bad_alloc or other exception). An
+important use of swap is to ensure that exceptions are not thrown in
+exception-safe code.
+</p>
+
+<p>
+Note: There remains long standing concern over whether or not it is
+possible to reasonably meet the 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> paragraph 10 swap
+requirements when allocators are unequal. The specification of
+basic_string::swap exception requirements is in no way intended to
+address, prejudice, or otherwise impact that concern.
+</p>
+
+
+
+
+
+<p><b>Proposed resolution:</b></p>
+<p>
+In 21.3.5.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::swap"> [lib.string::swap]</a>, add a throws clause:
+</p>
+
+<p>
+Throws: Shall not throw exceptions.
+</p>
+<hr>
+<a name="404"><h3>404.&nbsp;May a replacement allocation function be declared inline?</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a>, 18.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete"> [lib.new.delete]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;24 Apr 2003</p>
+<p>
+The eight basic dynamic memory allocation functions (single-object
+and array versions of ::operator new and ::operator delete, in the
+ordinary and nothrow forms) are replaceable. A C++ program may
+provide an alternative definition for any of them, which will be used
+in preference to the implementation's definition.
+</p>
+
+<p>
+Three different parts of the standard mention requirements on
+replacement functions: 17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a>, 18.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.single"> [lib.new.delete.single]</a>
+and 18.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a>, and 3.7.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/basic.html#basic.stc.dynamic"> [basic.stc.dynamic]</a>.
+</p>
+
+<p>None of these three places say whether a replacement function may
+ be declared inline. 18.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.single"> [lib.new.delete.single]</a> paragraph 2 specifies a
+ signature for the replacement function, but that's not enough:
+ the <tt>inline</tt> specifier is not part of a function's signature.
+ One might also reason from 7.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/dcl.html#dcl.fct.spec"> [dcl.fct.spec]</a> paragraph 2, which
+ requires that "an inline function shall be defined in every
+ translation unit in which it is used," but this may not be quite
+ specific enough either. We should either explicitly allow or
+ explicitly forbid inline replacement memory allocation
+ functions.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add a new sentence to the end of 17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a> paragraph 3:
+"The program's definitions shall not be specified as <tt>inline</tt>."
+</p>
+<p><b>Rationale:</b></p>
+<p>
+The fact that <tt>inline</tt> isn't mentioned appears to have been
+nothing more than an oversight. Existing implementations do not
+permit inline functions as replacement memory allocation functions.
+Providing this functionality would be difficult in some cases, and is
+believed to be of limited value.
+</p>
+<hr>
+<a name="405"><h3>405.&nbsp;qsort and POD</h3></a><p>
+<b>Section:</b>&nbsp;25.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.c.library"> [lib.alg.c.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;08 Apr 2003</p>
+<p>
+Section 25.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.c.library"> [lib.alg.c.library]</a> describes bsearch and qsort, from the C
+standard library. Paragraph 4 does not list any restrictions on qsort,
+but it should limit the base parameter to point to POD. Presumably,
+qsort sorts the array by copying bytes, which requires POD.
+</p>
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="406"><h3>406.&nbsp;vector::insert(s) exception safety</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;27 Apr 2003</p>
+<p>
+There is a possible defect in the standard: the standard text was
+never intended to prevent arbitrary ForwardIterators, whose operations
+may throw exceptions, from being passed, and it also wasn't intended
+to require a temporary buffer in the case where ForwardIterators were
+passed (and I think most implementations don't use one). As is, the
+standard appears to impose requirements that aren't met by any
+existing implementation.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Replace 23.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a> paragraph 1 with:</p>
+<blockquote>
+ 1 Notes: Causes reallocation if the new size is greater than the
+ old capacity. If no reallocation happens, all the iterators and
+ references before the insertion point remain valid. If an exception
+ is thrown other than by the copy constructor or assignment operator
+ of T (or, if first and last satisfy the forward iterator
+ requirements, an operation on first or last) there are no effects.
+</blockquote>
+<hr>
+<a name="407"><h3>407.&nbsp;Can singular iterators be destroyed?</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;3 June 2003</p>
+<p>
+Clause 24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>, paragraph 5, says that the only expression
+that is defined for a singular iterator is "an assignment of a
+non-singular value to an iterator that holds a singular value". This
+means that destroying a singular iterator (e.g. letting an automatic
+variable go out of scope) is technically undefined behavior. This
+seems overly strict, and probably unintentional.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the sentence in question to "... the only exceptions are
+destroying an iterator that holds a singular value, or the assignment
+of a non-singular value to an iterator that holds a singular value."
+</p>
+<hr>
+<a name="408"><h3>408.&nbsp;Is vector&lt;reverse_iterator&lt;char*&gt; &gt; forbidden?</h3></a><p>
+<b>Section:</b>&nbsp;24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;3 June 2003</p>
+<p>
+I've been discussing iterator semantics with Dave Abrahams, and a
+surprise has popped up. I don't think this has been discussed before.
+</p>
+
+<p>
+24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a> says that the only operation that can be performed on "singular"
+iterator values is to assign a non-singular value to them. (It
+doesn't say they can be destroyed, and that's probably a defect.)
+Some implementations have taken this to imply that there is no need
+to initialize the data member of a reverse_iterator&lt;&gt; in the default
+constructor. As a result, code like
+</p>
+<blockquote>
+ std::vector&lt;std::reverse_iterator&lt;char*&gt; &gt; v(7);
+ v.reserve(1000);
+</blockquote>
+<p>
+invokes undefined behavior, because it must default-initialize the
+vector elements, and then copy them to other storage. Of course many
+other vector operations on these adapters are also left undefined,
+and which those are is not reliably deducible from the standard.
+</p>
+
+<p>
+I don't think that 24.1 was meant to make standard-library iterator
+types unsafe. Rather, it was meant to restrict what operations may
+be performed by functions which take general user- and standard
+iterators as arguments, so that raw pointers would qualify as
+iterators. However, this is not clear in the text, others have come
+to the opposite conclusion.
+</p>
+
+<p>
+One question is whether the standard iterator adaptors have defined
+copy semantics. Another is whether they have defined destructor
+semantics: is
+</p>
+<blockquote>
+ { std::vector&lt;std::reverse_iterator&lt;char*&gt; &gt; v(7); }
+</blockquote>
+<p>
+undefined too?
+</p>
+
+<p>
+Note this is not a question of whether algorithms are allowed to
+rely on copy semantics for arbitrary iterators, just whether the
+types we actually supply support those operations. I believe the
+resolution must be expressed in terms of the semantics of the
+adapter's argument type. It should make clear that, e.g., the
+reverse_iterator&lt;T&gt; constructor is actually required to execute
+T(), and so copying is defined if the result of T() is copyable.
+</p>
+
+<p>
+Issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>, which defines reverse_iterator's default
+constructor more precisely, has some relevance to this issue.
+However, it is not the whole story.
+</p>
+
+<p>
+The issue was whether
+</p>
+<blockquote>
+ reverse_iterator() { }
+</blockquote>
+<p>
+is allowed, vs.
+</p>
+<blockquote>
+ reverse_iterator() : current() { }
+</blockquote>
+
+<p>
+The difference is when T is char*, where the first leaves the member
+uninitialized, and possibly equal to an existing pointer value, or
+(on some targets) may result in a hardware trap when copied.
+</p>
+
+<p>
+8.5 paragraph 5 seems to make clear that the second is required to
+satisfy DR <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>, at least for non-class Iterator argument
+types.
+</p>
+
+<p>
+But that only takes care of reverse_iterator, and doesn't establish
+a policy for all iterators. (The reverse iterator adapter was just
+an example.) In particular, does my function
+</p>
+<blockquote>
+ template &lt;typename Iterator&gt;
+ void f() { std::vector&lt;Iterator&gt; v(7); }
+</blockquote>
+<p>
+evoke undefined behavior for some conforming iterator definitions?
+I think it does, now, because vector&lt;&gt; will destroy those singular
+iterator values, and that's explicitly disallowed.
+</p>
+
+<p>
+24.1 shouldn't give blanket permission to copy all singular iterators,
+because then pointers wouldn't qualify as iterators. However, it
+should allow copying of that subset of singular iterator values that
+are default-initialized, and it should explicitly allow destroying any
+iterator value, singular or not, default-initialized or not.
+</p>
+
+<p>Related issue: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#407">407</a>
+</p>
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="409"><h3>409.&nbsp;Closing an fstream should clear error state</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ifstream.members"> [lib.ifstream.members]</a>, 27.8.1.10 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ofstream.members"> [lib.ofstream.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;3 June 2003</p>
+<p>
+A strict reading of 27.8.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fstreams"> [lib.fstreams]</a> shows that opening or
+closing a basic_[io]fstream does not affect the error bits. This
+means, for example, that if you read through a file up to EOF, and
+then close the stream and reopen it at the beginning of the file,
+the EOF bit in the stream's error state is still set. This is
+counterintuitive.
+</p>
+<p>
+The LWG considered this issue once before, as issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#22">22</a>,
+and put in a footnote to clarify that the strict reading was indeed
+correct. We did that because we believed the standard was
+unambiguous and consistent, and that we should not make architectural
+changes in a TC. Now that we're working on a new revision of the
+language, those considerations no longer apply.
+</p>
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="410"><h3>410.&nbsp;Missing semantics for stack and queue comparison operators</h3></a><p>
+<b>Section:</b>&nbsp;23.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.queue"> [lib.queue]</a>, 23.2.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.stack"> [lib.stack]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Hans Bos&nbsp; <b>Date:</b>&nbsp;7 Jun 2003</p>
+<p>
+Sections 23.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.queue"> [lib.queue]</a> and 23.2.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.stack"> [lib.stack]</a> list
+comparison operators (==, !=, &lt;, &lt;=, &gt;, =&gt;) for queue and
+stack. Only the semantics for queue::operator== (23.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.queue"> [lib.queue]</a> par2) and queue::operator&lt; (23.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.queue"> [lib.queue]</a>
+par3) are defined.
+</p>
+<p><b>Proposed resolution:</b></p>
+<hr>
+<a name="411"><h3>411.&nbsp;Wrong names of set member functions</h3></a><p>
+<b>Section:</b>&nbsp;25.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.set.operations"> [lib.alg.set.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Daniel Frey&nbsp; <b>Date:</b>&nbsp;9 Jul 2003</p>
+<p>
+25.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.set.operations"> [lib.alg.set.operations]</a> paragraph 1 reads:
+"The semantics of the set operations are generalized to multisets in a
+standard way by defining union() to contain the maximum number of
+occurrences of every element, intersection() to contain the minimum, and
+so on."
+</p>
+
+<p>
+This is wrong. The name of the functions are set_union() and
+set_intersection(), not union() and intersection().
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change that sentence to use the correct names.</p>
+<hr>
+<a name="412"><h3>412.&nbsp;Typo in 27.4.4.3</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;10 Jul 2003</p>
+<p>
+The Effects clause in 27.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a> paragraph 5 says that the
+function only throws if the respective bits are already set prior to
+the function call. That's obviously not the intent. The typo ought to
+be corrected and the text reworded as: "If (<i>state</i> &amp;
+exceptions()) == 0, returns. ..."
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 27.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a> paragraph 5, replace "If (rdstate() &amp;
+exceptions()) == 0" with "If (<i>state</i> &amp; exceptions()) == 0".
+</p>
+<hr>
+<a name="414"><h3>414.&nbsp;Which iterators are invalidated by v.erase()?</h3></a><p>
+<b>Section:</b>&nbsp;23.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;19 Aug 2003</p>
+<p>
+Consider the following code fragment:
+</p>
+<blockquote>
+<pre>int A[8] = { 1,3,5,7,9,8,4,2 };
+std::vector&lt;int&gt; v(A, A+8);
+
+std::vector&lt;int&gt;::iterator i1 = v.begin() + 3;
+std::vector&lt;int&gt;::iterator i2 = v.begin() + 4;
+v.erase(i1);
+</pre>
+</blockquote>
+
+<p>
+Which iterators are invalidated by <tt>v.erase(i1)</tt>: i1, i2,
+both, or neither?
+</p>
+
+<p>
+On all existing implementations that I know of, the status of i1 and
+i2 is the same: both of them will be iterators that point to some
+elements of the vector (albeit not the same elements they did
+before). You won't get a crash if you use them. Depending on
+exactly what you mean by "invalidate", you might say that neither one
+has been invalidated because they still point to <i>something</i>,
+or you might say that both have been invalidated because in both
+cases the elements they point to have been changed out from under the
+iterator.
+</p>
+
+<p>
+The standard doesn't say either of those things. It says that erase
+invalidates all iterators and references "after the point of the
+erase". This doesn't include i1, since it's at the point of the
+erase instead of after it. I can't think of any sensible definition
+of invalidation by which one can say that i2 is invalidated by i1
+isn't.
+</p>
+
+<p>
+(This issue is important if you try to reason about iterator validity
+based only on the guarantees in the standard, rather than reasoning
+from typical implementation techniques. Strict debugging modes,
+which some programmers find useful, do not use typical implementation
+techniques.)
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 23.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a> paragraph 3, change "Invalidates all the
+iterators and references after the point of the erase" to
+"Invalidates iterators and references at or after the point of the
+erase".
+</p>
+<p><b>Rationale:</b></p>
+<p>I believe this was essentially a typographical error, and that it
+ was taken for granted that erasing an element invalidates iterators
+ that point to it. The effects clause in question treats iterators
+ and references in parallel, and it would seem counterintuitive to
+ say that a reference to an erased value remains valid.</p>
+<hr>
+<a name="415"><h3>415.&nbsp;behavior of std::ws</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.manip"> [lib.istream.manip]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+
+According to 27.6.1.4, the ws() manipulator is not required to construct
+the sentry object. The manipulator is also not a member function so the
+text in 27.6.1, p1 through 4 that describes the exception policy for
+istream member functions does not apply. That seems inconsistent with
+the rest of extractors and all the other input functions (i.e., ws will
+not cause a tied stream to be flushed before extraction, it doesn't check
+the stream's exceptions or catch exceptions thrown during input, and it
+doesn't affect the stream's gcount).
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+
+I propose that the manipulator be required to behave like an unformatted
+member function. It should not behave as a formatted member function since
+those set failbit in the sentry ctor according to DR195(*) and ws is explicitly
+forbidden from doing that (sure, it could clear the bit, but why bother?)
+
+(*) http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#195
+ </p>
+ <hr>
+<a name="416"><h3>416.&nbsp;definitions of XXX_MIN and XXX_MAX macros in climits</h3></a><p>
+<b>Section:</b>&nbsp;18.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.c.limits"> [lib.c.limits]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+Given two overloads of the function foo(), one taking an argument of type
+int and the other taking a long, which one will the call foo(LONG_MAX)
+resolve to? The expected answer should be foo(long), but whether that
+is true depends on the #defintion of the LONG_MAX macro, specifically
+its type. This issue is about the fact that the type of these macros
+is not actually required to be the same as the the type each respective
+limit.
+<br>
+
+Section 18.2.2 of the C++ Standard does not specify the exact types of
+the XXX_MIN and XXX_MAX macros #defined in the &lt;climits&gt; and &lt;limits.h&gt;
+headers such as INT_MAX and LONG_MAX and instead defers to the C standard.
+<br>
+
+Section 5.2.4.2.1, p1 of the C standard specifies that "The values [of
+these constants] shall be replaced by constant expressions suitable for use
+in #if preprocessing directives. Moreover, except for CHAR_BIT and MB_LEN_MAX,
+the following shall be replaced by expressions that have the same type as
+would an expression that is an object of the corresponding type converted
+according to the integer promotions."
+<br>
+
+The "corresponding type converted according to the integer promotions" for
+LONG_MAX is, according to 6.4.4.1, p5 of the C standard, the type of long
+converted to the first of the following set of types that can represent it:
+int, long int, long long int. So on an implementation where (sizeof(long)
+== sizeof(int)) this type is actually int, while on an implementation where
+(sizeof(long) &gt; sizeof(int)) holds this type will be long.
+<br>
+
+This is not an issue in C since the type of the macro cannot be detected
+by any conforming C program, but it presents a portability problem in C++
+where the actual type is easily detectable by overload resolution.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+Specify the exact type of each XXX_MIN and XXX_MAX constant #defined in
+the header &lt;climits&gt;. Note that it is not possible to #define these macros
+so that they are usable in preprocessor arithmetic expressions, having
+any type other than char, int, unsigned int, long, and unsigned long.
+This means that the type of SHRT_MIN, for instance, has to be either
+int ot long in C++.
+ </p>
+ <hr>
+<a name="417"><h3>417.&nbsp;what does ctype::do_widen() return on failure</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The Effects and Returns clauses of the do_widen() member function of
+the ctype facet fail to specify the behavior of the function on failure.
+That the function may not be able to simply cast the narrow character
+argument to the type of the result since doing so may yield the wrong value
+for some wchar_t encodings. Popular implementations of ctype&lt;wchar_t&gt; that
+use mbtowc() and UTF-8 as the native encoding (e.g., GNU glibc) will fail
+when the argument's MSB is set. There is no way for the the rest of locale
+and iostream to reliably detect this failure.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+A partial solution might be to specify that ctype&lt;wchar_t&gt;::do_widen(char)
+must return WEOF to indicate a failure.
+ </p>
+ <hr>
+<a name="418"><h3>418.&nbsp;exceptions thrown during iostream cleanup</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.1.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios::Init"> [lib.ios::Init]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The dtor of the ios_base::Init object is supposed to call flush() on the
+6 standard iostream objects cout, cerr, clog, wcout, wcerr, and wclog.
+This call may cause an exception to be thrown.
+<br>
+
+17.4.4.8, p3 prohibits all library destructors from throwing exceptions.
+<br>
+
+The question is: What should this dtor do if one or more of these calls
+to flush() ends up throwing an exception? This can happen quite easily
+if one of the facets installed in the locale imbued in the iostream
+object throws.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+I'm not sure what the best approach is in this case -- ignore the exception
+and proceed with the cleanup (required by the clause that prohibits library
+dtors from throwing), abort right there and then, or allow the exception to
+propagate (and allow an unfriendly termination of the program).
+ </p>
+ <hr>
+<a name="419"><h3>419.&nbsp;istream extractors not setting failbit if eofbit is already set</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+27.6.1.1.2, p2 says that istream::sentry ctor prepares for input if is.good()
+is true. p4 then goes on to say that the ctor sets the sentry::ok_ member to
+true if the stream state is good after any preparation. 27.6.1.2.1, p1 then
+says that a formatted input function endeavors to obtain the requested input
+if the sentry's operator bool() returns true.
+
+Given these requirements, no formatted extractor should ever set failbit if
+the initial stream rdstate() == eofbit. That is contrary to the behavior of
+all implementations I tested. The program below prints out
+
+eof = 1, fail = 0
+eof = 1, fail = 1
+
+on all of them.
+ </p>
+<pre>
+#include &lt;sstream&gt;
+#include &lt;cstdio&gt;
+
+int main()
+{
+ std::istringstream strm ("1");
+
+ int i = 0;
+
+ strm &gt;&gt; i;
+
+ std::printf ("eof = %d, fail = %d\n",
+ !!strm.eof (), !!strm.fail ());
+
+ strm &gt;&gt; i;
+
+ std::printf ("eof = %d, fail = %d\n",
+ !!strm.eof (), !!strm.fail ());
+}
+
+</pre>
+ <p>
+<br>
+
+Comments from Jerry Schwarz (c++std-lib-11373):
+<br>
+
+Jerry Schwarz wrote:
+<br>
+
+I don't know where (if anywhere) it says it in the standard, but the
+formatted extractors are supposed to set failbit if they don't extract
+any characters. If they didn't then simple loops like
+<br>
+
+while (cin &gt;&gt; x);
+<br>
+
+would loop forever.
+<br>
+
+Further comments from Martin Sebor:
+<br>
+
+The question is which part of the extraction should prevent this from happening
+by setting failbit when eofbit is already set. It could either be the sentry
+object or the extractor. It seems that most implementations have chosen to
+set failbit in the sentry [...] so that's the text that will need to be
+corrected.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+A possible change might go in the Effects clause of the sentry ctor in
+27.6.1.1.2, p1. At the end of the paragraph, i.e., after the text beginning
+with
+<br>
+
+Effects: If is.good() is true, ...
+<br>
+
+add
+<br>
+
+Otherwise, if (is.rdstate() == ios_base::eofbit) is true,
+the function calls is.setstate(failbit) (which may throw
+ios_base::failure).
+<br>
+
+Another possible wording is
+<br>
+
+Otherwise, if is.eof() is true, the function calls
+is.setstate(ios_base::failbit) (which may throw
+ios_base::failure).
+<br>
+
+The difference between the two is that when failbit is set in is.exceptions(),
+the first option will cause ios_base::failure to be thrown only during the
+first call to the sentry ctor, while the second option will cause
+ios_base::failure to be thrown each time the sentry ctor is invoked. I think
+I like the first alternative better (i.e., there's no reason to call
+setstate(failbit) if the bit is already known to be set).
+<br>
+
+The change does not address the possibility of just badbit being set.
+Should it? I.e., should the sentry ctor set failbit if (only) badbit is set?
+<br>
+
+I haven't done a full survey of all the input functions to make sure the
+change doesn't break something else. A second pair eyes would be helpful.
+<br>
+
+Survey posted in c++std-lib-11409:
+<br>
+
+Below is a survey of a number of popular implementations, including
+classic iostreams. Three different sets of behavior exist (case 2
+is the same as case 1 except that istream::sentry does not set
+eofbit or failbit in an initially good stream object when its
+attempt to extract whitespace fails).
+<br>
+
+The major difference seems to be in how badbit is treated in the
+initial stream state. Most implementations still set failbit in
+this case, but there are three implementations of classic
+iostreams that do not. Since all surveyed implementations of
+standard iostreams do set failbit in this case, I think we
+should probably either require such behavior, or leave it
+unspecified (in which case I would prefer to be explicit
+about it to avoid any confusion).
+<br>
+
+0. Compaq C++ classic + standard, g++ 2.95.2 classic,
+g++ 3.2 standard, HP aCC 3.45 standard, Rogue Wave 3.1.1,
+Sunpro 5.5 classic + standard, IBM VAC++ 6.0 standard,
+STLport 4.5 classic + standard
+<br>
+
+1. HP aCC 4.45 classic, SGI MIPSpro 7.3 classic, IBM VAC++ 6.0 classic
+<br>
+
+2. SGI MIPSpro 7.3 standard
+<br>
+ </p>
+<pre> 0 1 2
+ =========+=====+=====+=====
+ B-- 00 | B-F B-- B-F
+ B-- 01 | B-F B-- B-F
+ B-- 10 | B-F B-- B-F
+ B-- 11 | B-F B-- B-F
+ -E- 00 | -EF -EF -EF
+ -E- 01 | -EF -EF -EF
+ -E- 10 | -EF -EF -EF
+ -E- 11 | -EF -EF -EF
+ --F 00 | --F --F --F
+ --F 01 | --F --F --F
+ --F 10 | --F --F --F
+ --F 11 | --F --F --F
+ --- 00 | --- --- ---
+ --- 01 | --- --- ---
+ --- 10 | -EF -EF ---
+ --- 11 | --- --- ---
+ BE- 00 | BEF BEF BEF
+ BE- 01 | BEF BEF BEF
+ BE- 10 | BEF BEF BEF
+ BE- 11 | BEF BEF BEF
+ B-F 00 | B-F B-F B-F
+ B-F 01 | B-F B-F B-F
+ B-F 10 | B-F B-F B-F
+ B-F 11 | B-F B-F B-F
+ BEF 00 | BEF BEF BEF
+ BEF 01 | BEF BEF BEF
+ BEF 10 | BEF BEF BEF
+ BEF 11 | BEF BEF BEF
+ -EF 00 | -EF -EF -EF
+ -EF 01 | -EF -EF -EF
+ -EF 10 | -EF -EF -EF
+ -EF 11 | -EF -EF -EF
+ =========+=====+=====+=====
+ ^^^ ^^ ^^^ ^^^ ^^^
+ | || | | |
+ | || +-----+-----+-- final stream state (Bad, Eof, Good,
+ | || or '-')
+ | |+-------------------- noskiws argument to sentry or ipfx(int)
+ | +--------------------- value of (ios::skipws &amp; rdflags()) != 0
+ +------------------------- initial stream state (Bad, Eof, Good,
+ '-')
+
+
+#include &lt;istream&gt;
+#include &lt;streambuf&gt;
+#include &lt;stdio.h&gt;
+
+struct mybuf: std::streambuf { };
+
+int main ()
+{
+ static const std::ios::iostate states[] = {
+ std::ios::badbit,
+ std::ios::eofbit,
+ std::ios::failbit,
+ std::ios::goodbit,
+ std::ios::badbit | std::ios::eofbit,
+ std::ios::badbit | std::ios::failbit,
+ std::ios::badbit | std::ios::eofbit | std::ios::failbit,
+ std::ios::eofbit | std::ios::failbit
+ };
+
+ for (int i = 0; i != sizeof states / sizeof *states; ++i) {
+ for (int skipws = 0; skipws != 2; ++skipws) {
+ for (int noskipws = 0; noskipws != 2; ++noskipws) {
+ mybuf sb;
+
+ std::istream strm (&amp;sb);
+
+ strm.setstate (states [i]);
+
+ if (skipws)
+ strm.setf (std::ios::skipws);
+ else
+ strm.unsetf (std::ios::skipws);
+
+ // strm.ipfx (noskipws);
+ std::istream::sentry guard (strm, !!noskipws);
+
+ const std::ios::iostate state = strm.rdstate ();
+
+ printf ("%c%c%c %d%d -&gt; %c%c%c\n",
+ states [i] &amp; std::ios::badbit ? 'B' : '-',
+ states [i] &amp; std::ios::eofbit ? 'E' : '-',
+ states [i] &amp; std::ios::failbit ? 'F' : '-',
+ skipws, noskipws,
+ state &amp; std::ios::badbit ? 'B' : '-',
+ state &amp; std::ios::eofbit ? 'E' : '-',
+ state &amp; std::ios::failbit ? 'F' : '-');
+ }
+ }
+ }
+}
+
+</pre>
+ <hr>
+<a name="420"><h3>420.&nbsp;is std::FILE a complete type?</h3></a><p>
+<b>Section:</b>&nbsp;27.8.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fstreams"> [lib.fstreams]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+7.19.1, p2, of C99 requires that the FILE type only be declared in &lt;stdio.h&gt;.
+None of the (implementation-defined) members of the struct is mentioned
+anywhere for obvious reasons.
+
+C++ says in 27.8.1, p2 that FILE is a type that's defined in &lt;cstdio&gt;. Is
+it really the intent that FILE be a complete type or is an implementation
+allowed to just declare it without providing a full definition?
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+Change 27.8.1, p2 to say that FILE is declared in &lt;cstdio&gt; and a note saying
+that it's implementation-defined whether the type is complete or not.
+ </p>
+ <hr>
+<a name="421"><h3>421.&nbsp;is basic_streambuf copy-constructible?</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.cons"> [lib.streambuf.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The reflector thread starting with c++std-lib-11346 notes that the class
+template basic_streambuf, along with basic_stringbuf and basic_filebuf,
+is copy-constructible but that the semantics of the copy constructors
+are not defined anywhere. Further, different implementations behave
+differently in this respect: some prevent copy construction of objects
+of these types by declaring their copy ctors and assignment operators
+private, others exhibit undefined behavior, while others still give
+these operations well-defined semantics.
+</p>
+
+<p>
+Note that this problem doesn't seem to be isolated to just the three
+types mentioned above. A number of other types in the library section
+of the standard provide a compiler-generated copy ctor and assignment
+operator yet fail to specify their semantics. A (possibly still
+incomplete) list of such types along with the headers they are defined
+in is provided below, courtesy of Howard Hinnant:
+<br>
+ </p>
+<pre>&lt;limits&gt;
+ numeric_limits
+&lt;stdexcept&gt;
+ logic_error
+ domain_error
+ invalid_argument
+ length_error
+ out_of_range
+ runtime_error
+ range_error
+ overflow_error
+ underflow_error
+&lt;utility&gt;
+ pair
+&lt;functional&gt;
+ unary_function
+ binary_function
+ plus
+ minus
+ multiplies
+ divides
+ modulus
+ negate
+ equal_to
+ not_equal_to
+ greater
+ less
+ greater_equal
+ less_equal
+ logical_and
+ logical_or
+ logical_not
+ unary_negate
+ binary_negate
+ binder1st
+ binder2nd
+ pointer_to_unary_function
+ pointer_to_binary_function
+ mem_fun_t
+ mem_fun1_t
+ mem_fun_ref_t
+ mem_fun1_ref_t
+ const_mem_fun_t
+ const_mem_fun1_t
+ const_mem_fun_ref_t
+ const_mem_fun1_ref_t
+&lt;memory&gt;
+ allocator&lt;void&gt;
+ allocator // operator= only, which also isn't required by Allocator Requirements
+ raw_storage_iterator
+&lt;string&gt;
+ char_traits&lt;char&gt;
+ char_traits&lt;wchar_t&gt;
+&lt;locale&gt;
+ ctype_base
+ ctype
+ ctype_byname
+ ctype&lt;char&gt;
+ ctype_byname&lt;char&gt;
+ codecvt_base
+ codecvt
+ codecvt_byname
+ num_get
+ num_put
+ numpunct
+ numpunct_byname
+ collate
+ collate_byname
+ time_base
+ time_get
+ time_get_byname
+ time_put
+ time_put_byname
+ money_get
+ money_put
+ money_base
+ moneypunct
+ moneypunct_byname
+ messages_base
+ messages
+ messages_byname
+&lt;queue&gt;
+ queue
+ priority_queue
+&lt;stack&gt;
+ stack
+&lt;vector&gt;
+ vector&lt;bool&gt;::reference // copy ctor only
+&lt;map&gt;
+ map::value_compare
+ multimap::value_compare
+&lt;bitset&gt;
+ bitset::reference // copy ctor only
+ bitset
+&lt;iterator&gt;
+ iterator_traits
+ iterator_traits&lt;T*&gt;
+ iterator_traits&lt;const T*&gt;
+ iterator
+ input_iterator_tag
+ output_iterator_tag
+ forward_iterator_tag
+ bidirectional_iterator_tag
+ random_access_iterator_tag
+ reverse_iterator
+ back_insert_iterator
+ front_insert_iterator
+ insert_iterator
+ istream_iterator // operator= only
+ ostream_iterator // operator= only
+ istreambuf_iterator
+ istreambuf_iterator::proxy
+ ostreambuf_iterator
+&lt;complex&gt;
+ complex&lt;float&gt; // copy ctor only
+ complex&lt;double&gt; // copy ctor only
+ complex&lt;long double&gt; // copy ctor only
+&lt;valarray&gt;
+ slice
+ gslice
+&lt;ios&gt;
+ ios_base // addressed by TC issue 50
+ ios_base::failure
+ ios_base::Init
+ fpos
+&lt;streambuf&gt;
+ basic_streambuf
+&lt;istream&gt;
+ basic_istream
+ basic_iostream
+&lt;ostream&gt;
+ basic_ostream
+&lt;sstream&gt;
+ basic_stringbuf
+ basic_istringstream
+ basic_ostringstream
+ basic_stringstream
+&lt;fstream&gt;
+ basic_filebuf
+ basic_ifstream
+ basic_ofstream
+ basic_fstream
+&lt;strstream&gt;
+ strstreambuf
+ istrstream
+ ostrstream
+ strstream
+</pre>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+The standard ought to be clarified to either explicitly disallow copy
+ctors and assignment operators for these types, or to specify what
+the exact semantics of these functions are.
+ </p>
+ <hr>
+<a name="422"><h3>422.&nbsp;explicit specializations of member functions of class templates</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+<p>
+It has been suggested that 17.4.3.1, p1 may or may not allow programs to
+explicitly specialize members of standard templates on user-defined types.
+The answer to the question might have an impact where library requirements
+are given using the "as if" rule. I.e., if programs are allowed to specialize
+member functions they will be able to detect an implementation's strict
+conformance to Effects clauses that describe the behavior of the function
+in terms of the other member function (the one explicitly specialized by
+the program) by relying on the "as if" rule.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+While I think programs should be allowed to explicitly specialize member
+functions of standard templates, I don't find it reasonable to expect
+implementations to follow the "as if" rule to the letter. I propose to add
+a clause to chapter 17 saying that where a function is described in terms
+of another (non-virtual) function using the "as if" rule, an implementation
+may substitute another (non-virtual) function call as long as the effects
+on the object remain the same as in the absence of any specializations
+of the called function in the program.
+</p>
+<hr>
+<a name="423"><h3>423.&nbsp;effects of negative streamsize in iostreams</h3></a><p>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+
+<p>
+A third party test suite tries to exercise istream::ignore(N) with
+a negative value of N and expects that the implementation will treat
+N as if it were 0. Our implementation asserts that (N &gt;= 0) holds and
+aborts the test.
+</p>
+
+<p>
+I can't find anything in section 27 that prohibits such values but I don't
+see what the effects of such calls should be, either (this applies to
+a number of unformatted input functions as well as some member functions
+of the basic_streambuf template).
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+I propose that we add to each function in clause 27 that takes an argument,
+say N, of type streamsize a Requires clause saying that "N &gt;= 0." The intent
+is to allow negative streamsize values in calls to precision() and width()
+but disallow it in calls to streambuf::sgetn(), istream::ignore(), or
+ostream::write().
+</p>
+<hr>
+<a name="424"><h3>424.&nbsp;normative notes</h3></a><p>
+<b>Section:</b>&nbsp;17.3.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.structure.summary"> [lib.structure.summary]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+
+<p>
+The text in 17.3.1.1, p1 says:
+<br>
+
+"Paragraphs labelled "Note(s):" or "Example(s):" are informative, other
+paragraphs are normative."
+<br>
+
+The library section makes heavy use of paragraphs labeled "Notes(s),"
+some of which are clearly intended to be normative (see list 1), while
+some others are not (see list 2). There are also those where the intent
+is not so clear (see list 3).
+<br>
+
+List 1 -- Examples of (presumably) normative Notes:
+<br>
+
+20.4.1.1, p3, 20.4.1.1, p10, 21.3.1, p11, 22.1.1.2, p11, 23.2.1.3, p2,
+25.3.7, p3, 26.2.6, p14a, 27.5.2.4.3, p7.
+<br>
+
+List 2 -- Examples of (presumably) informative Notes:
+<br>
+
+18.4.1.3, p3, 21.3.5.6, p14, 22.2.1.5.2, p3, 25.1.1, p4, 26.2.5, p1,
+27.4.2.5, p6.
+<br>
+
+List 3 -- Examples of Notes that are not clearly either normative
+or informative:
+<br>
+
+22.1.1.2, p8, 22.1.1.5, p6, 27.5.2.4.5, p4.
+<br>
+
+None of these lists is meant to be exhaustive.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+
+<p>
+One possible solution is to identify all the paragraphs marked "Note(s):"
+that are intended to be normative and either remove the labeling or replace
+it with some other word, such as "Effects:" to make the normative intent
+clear.
+<br>
+
+Another possible solution is to change 17.3.1.1, p1 and remove the mention
+of Notes being informative, and then go through all the paragraphs marked
+"Note(s):" that are intended to be informative and make change preserving
+their informative nature.
+ </p>
+ <hr>
+<a name="425"><h3>425.&nbsp;return value of std::get_temporary_buffer</h3></a><p>
+<b>Section:</b>&nbsp;20.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.temporary.buffer"> [lib.temporary.buffer]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The standard is not clear about the requirements on the value returned from
+a call to get_temporary_buffer(0). In particular, it fails to specify whether
+the call should return a distinct pointer each time it is called (like
+operator new), or whether the value is unspecified (as if returned by
+malloc). The standard also fails to mention what the required behavior
+is when the argument is less than 0.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+In the first case, I propose that the function behave like malloc, i.e.,
+<br>
+
+If the size of the space requested is zero, the behavior is
+implementation-defined: either pair(0, 0) is returned, or the behavior is
+as if the size were some nonzero value, except that the returned pointer
+is not dereferenceable.
+<br>
+
+In the second case, I propose that the function fail by returning pair(0, 0).
+ </p>
+ <hr>
+<a name="426"><h3>426.&nbsp;search_n(), fill_n(), and generate_n() with negative n</h3></a><p>
+<b>Section:</b>&nbsp;25.1.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.search"> [lib.alg.search]</a>, 25.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.fill"> [lib.alg.fill]</a>, 25.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.generate"> [lib.alg.generate]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The complexity requirements for these function templates are incorrect
+(or don't even make sense) for negative n:
+<br>
+
+25.1.9, p7 (search_n):
+<br>
+
+Complexity: At most (last1 - first1) * count applications
+of the corresponding predicate.
+<br>
+
+25.2.5, p3 (fill_n):
+<br>
+
+Complexity: Exactly last - first (or n) assignments.
+<br>
+
+25.2.6, p3 (generate_n):
+<br>
+
+Complexity: Exactly last - first (or n) assignments.
+<br>
+
+In addition, the Requirements or the Effects clauses for the latter two
+templates don't say anything about the behavior when n is negative.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+My proposed fix is to:
+<br>
+
+Change 25.1.9, p7 to
+<br>
+
+Complexity: At most (last1 - first1) * count applications
+of the corresponding predicate if count is non-negative,
+or 0 otherwise.
+<br>
+
+Change 25.2.5, p2 from
+<br>
+
+Effects: Assigns value through all the iterators in the
+range [first, last) or [first, first + n).
+<br>
+
+to
+<br>
+
+Effects: Assigns value through all the iterators in the
+range [first, last), or [first, first + n) if n is non
+negative, none otherwise.
+<br>
+
+Change 25.2.5, p3 to:
+<br>
+
+Complexity: Exactly last - first (or n if n is non-negative,
+or 0 otherwise) assignments.
+<br>
+
+Change 25.2.6, p1 from
+<br>
+
+Effects: Invokes the function object gen and assigns the return
+value of gen though all the iterators in the range [first, last)
+or [first, first + n).
+<br>
+
+to (notice the correction for the misspelled "through"):
+<br>
+
+Effects: Invokes the function object genand assigns the return
+value of gen through all the iterators in the range [first, last),
+or [first, first + n) if n is non-negative, or [first, first)
+otherwise.
+<br>
+
+Change 25.2.6, p3 to:
+<br>
+
+Complexity: Exactly last - first (or n if n is non-negative,
+or 0 otherwise) assignments.
+<br>
+
+The alternative is to require that n be non-negative. I chose
+the other option in order to keep the requirements in line with
+those of search_n which allows negative counts.
+ </p>
+ <hr>
+<a name="427"><h3>427.&nbsp;stage 2 and rationale of DR 221</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The requirements specified in Stage 2 and reiterated in the rationale
+of DR 221 (and echoed again in DR 303) specify that num_get&lt;charT&gt;::
+do_get() compares characters on the stream against the widened elements
+of "012...abc...ABCX+-"
+<br>
+
+An implementation is required to allow programs to instantiate the num_get
+template on any charT that satisfies the requirements on a user-defined
+character type. These requirements do not include the ability of the
+character type to be equality comparable (the char_traits template must
+be used to perform tests for equality). Hence, the num_get template cannot
+be implemented to support any arbitrary character type. The num_get template
+must either make the assumption that the character type is equality-comparable
+(as some popular implementations do), or it may use char_traits&lt;charT&gt; to do
+the comparisons (some other popular implementations do that). This diversity
+of approaches makes it difficult to write portable programs that attempt to
+instantiate the num_get template on user-defined types.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+Specify a mechanism whereby the num_get template may compare objects of
+user-defined character types. Several possible solutions, each having
+some drawbacks, were discussed in a thread on c++std-lib@research.att.com
+starting with c++std-lib-10623.
+<br>
+
+One possibility is to require that user-defined character types be equality
+comparable, thus obviating tye need for the char_traits::eq() function. This
+solution would make the requirements imposed on user-defined character types
+by the locale templates inconsistent with those of basic_string.
+<br>
+
+Another option is to require that programs that instantiate num_get on
+user-defined types provide an explicit specialization of the std::char_traits
+template on that type and require num_get to use it. This solution would
+render the basic_string Traits template parameter useless.
+<br>
+
+Yet another option is to specify that when the num_get facet is instantiated
+on a user-defined character type, say charT, that defines the nested type
+charT::traits_type, num_get should use it to do comparisons. Otherwise,
+num_get should use std::char_traits&lt;charT&gt;. This solution, while more
+robust than the first two, might set the unwarranted expectation that
+a program that provides two traits classes for the same character type
+will have meaningful semantics.
+<br>
+
+Finally, arguably the most flexible solution is to remove the requirement
+from Stage 2 that num_get compare the widened set of character literals and
+instead have the template compare the narrowed characters read from the
+input sequence. This issue proposes to adopt this last option as the
+resolution.
+ </p>
+ <hr>
+<a name="428"><h3>428.&nbsp;string::erase(iterator) validity</h3></a><p>
+<b>Section:</b>&nbsp;21.3.5.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::erase"> [lib.string::erase]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+23.1.1, p3 along with Table 67 specify as a prerequisite for a.erase(q)
+that q must be a valid dereferenceable iterator into the sequence a.
+<br>
+
+However, 21.3.5.5, p5 describing string::erase(p) only requires that
+p be a valid iterator.
+<br>
+
+This may be interepreted as a relaxation of the general requirement,
+which is most likely not the intent.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+Either clarify 21.3.5.5, p5 to say that the iterator is required to be
+valid and dereferenceable or drop the requirement altogether and rely
+on the general container requirements outlined in Table 67.
+ </p>
+ <hr>
+<a name="429"><h3>429.&nbsp;typo in basic_ios::clear(iostate)</h3></a><p>
+<b>Section:</b>&nbsp;27.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The Effects clause in 27.4.4.3, p5 describing the effects of a call to
+the ios_base member function clear(iostate state) says that the function
+only throws if the respective bits are already set prior to the function
+call. That's obviously not the intent. If it was, a call to clear(badbit)
+on an object for which (rdstate() == goodbit &amp;&amp; exceptions() == badbit)
+holds would not result in an exception being thrown.
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+The text ought to be changed from
+<br>
+
+"If (rdstate() &amp; exceptions()) == 0, returns. ..."
+<br>
+
+to
+<br>
+
+"If (state &amp; exceptions()) == 0, returns. ..."
+ </p>
+ <hr>
+<a name="430"><h3>430.&nbsp;valarray subset operations</h3></a><p>
+<b>Section:</b>&nbsp;26.3.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.valarray.sub"> [lib.valarray.sub]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;18 Sep 2003</p>
+ <p>
+
+The standard fails to specify the behavior of valarray::operator[](slice)
+and other valarray subset operations when they are passed an "invalid"
+slice object, i.e., either a slice that doesn't make sense at all (e.g.,
+slice (0, 1, 0) or one that doesn't specify a valid subset of the valarray
+object (e.g., slice (2, 1, 1) for a valarray of size 1).
+
+ </p>
+ <p><b>Proposed resolution:</b></p>
+ <p>
+
+Clarify the text of the standard to define what constitutes a valid and
+invalid slice object, and either specify the exact behavior of these
+member functions when passed an invalid slice object, or explicitly
+specify that the behavior is undefined under these conditions for the
+sake of efficiency.
+ </p>
+ <hr>
+<a name="431"><h3>431.&nbsp;Swapping containers with unequal allocators</h3></a><p>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>, 25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#New">New</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;20 Sep 2003</p>
+<p>Clause 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a> paragraph 4 says that implementations
+ are permitted to supply containers that are unable to cope with
+ allocator instances and that container implementations may assume
+ that all instances of an allocator type compare equal. We gave
+ implementers this latitude as a temporary hack, and eventually we
+ want to get rid of it. What happens when we're dealing with
+ allocators that <i>don't</i> compare equal?
+</p>
+
+<p>In particular: suppose that <tt>v1</tt> and <tt>v2</tt> are both
+ objects of type <tt>vector&lt;int, my_alloc&gt;</tt> and that
+ <tt>v1.get_allocator() != v2.get_allocator()</tt>. What happens if
+ we write <tt>v1.swap(v2)</tt>? Informally, three possibilities:</p>
+
+<p>1. This operation is illegal. Perhaps we could say that an
+ implementation is required to check and to throw an exception, or
+ perhaps we could say it's undefined behavior.</p>
+<p>2. The operation performs a slow swap (i.e. using three
+ invocations of <tt>operator=</tt>, leaving each allocator with its
+ original container. This would be an O(N) operation.</p>
+<p>3. The operation swaps both the vectors' contents and their
+ allocators. This would be an O(1) operation. That is:</p>
+ <blockquote>
+ <pre> my_alloc a1(...);
+ my_alloc a2(...);
+ assert(a1 != a2);
+
+ vector&lt;int, my_alloc&gt; v1(a1);
+ vector&lt;int, my_alloc&gt; v2(a2);
+ assert(a1 == v1.get_allocator());
+ assert(a2 == v2.get_allocator());
+
+ v1.swap(v2);
+ assert(a1 == v2.get_allocator());
+ assert(a2 == v1.get_allocator());
+ </pre>
+ </blockquote>
+
+<p><b>Proposed resolution:</b></p>
<p>----- End of document -----</p>
-</body>
-</html>
+</body></html> \ No newline at end of file
diff --git a/libstdc++-v3/docs/html/ext/lwg-defects.html b/libstdc++-v3/docs/html/ext/lwg-defects.html
index 41ae2f822c6..3c26633595f 100644
--- a/libstdc++-v3/docs/html/ext/lwg-defects.html
+++ b/libstdc++-v3/docs/html/ext/lwg-defects.html
@@ -1,15 +1,14 @@
-<!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">
+<!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 text="#000000" bgcolor="#ffffff">
<table>
-<tr>
+<tbody><tr>
<td align="left">Doc. no.</td>
-<td align="left">J16/02-0049 = WG21 N1391</td>
+<td align="left">N1516 = 03-0099</td>
</tr>
<tr>
<td align="left">Date:</td>
-<td align="left">10 Sep 2002</td>
+<td align="left">20 Sep 2003</td>
</tr>
<tr>
<td align="left">Project:</td>
@@ -19,221 +18,239 @@
<td align="left">Reply to:</td>
<td align="left">Matt Austern &lt;austern@apple.com&gt;</td>
</tr>
-</table>
-<h1>C++ Standard Library Defect Report List (Revision 23)</h1>
+</tbody></table>
+<h1>C++ Standard Library Defect Report List (Revision 27)</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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-status.html">Index by Status</a> for all library issues.</li>
+ <li><a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html">Library Active Issues List</a></li>
+ <li><a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ in the standard. That is, issues which have a status of <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#DR">DR</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>, or <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#RR">RR</a>. See the
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html">Library Closed Issues List</a> for issues closed as non-defects. See the
+ <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>R27:
+Pre-Kona mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#404">404</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#431">431</a>.
+</li>
+<li>R26:
+Post-Oxford mailing: reflects decisions made at the Oxford meeting.
+All issues in Ready status were voted into DR status. All issues in
+DR status were voted into WP status.
+</li>
+<li>R25:
+Pre-Oxford mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#390">390</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#402">402</a>.
+</li>
+<li>R24:
+Post-Santa Cruz mailing: reflects decisions made at the Santa Cruz
+meeting. All Ready issues from R23 with the exception of <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#253">253</a>, which has been given a new proposed resolution, were
+moved to DR status. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#383">383</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#389">389</a>. (Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#387">387</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#389">389</a> were discussed
+at the meeting.) Made progress on issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#229">229</a>: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a> and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#229">229</a> have been moved to Ready status, and the only remaining
+concerns with <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a> involve wording.
+</li>
<li>R23:
-Pre-Santa Cruz mailing. Added new issues <a href="lwg-active.html#367">367</a>-<a href="lwg-active.html#382">382</a>.
+Pre-Santa Cruz mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#367">367</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#382">382</a>.
Moved issues in the TC to TC status.
</li>
<li>R22:
-Post-Cura&ccedil;ao mailing. Added new issues <a href="lwg-active.html#362">362</a>-<a href="lwg-active.html#366">366</a>.
+Post-Curaçao mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#362">362</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#366">366</a>.
</li>
<li>R21:
-Pre-Cura&ccedil;ao mailing. Added new issues <a href="lwg-closed.html#351">351</a>-<a href="lwg-active.html#361">361</a>.
+Pre-Curaçao mailing. Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#351">351</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#361">361</a>.
</li>
<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
+new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#336">336</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#350">350</a>, of which issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#347">347</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.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-defects.html#284">284</a>, <a href="lwg-active.html#241">241</a>, and <a href="lwg-closed.html#267">267</a>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#284">284</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#241">241</a>, and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#120">120</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#202">202</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#233">233</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#270">270</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#253">253</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#254">254</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#323">323</a>.
</li>
<li>R19:
Pre-Redmond mailing. Added new issues
-<a href="lwg-active.html#323">323</a>-<a href="lwg-defects.html#335">335</a>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#323">323</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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-defects.html#317">317</a>, and discussed
-new issues <a href="lwg-defects.html#271">271</a>-<a href="lwg-closed.html#314">314</a>.
+Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#312">312</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#317">317</a>, and discussed
+new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#271">271</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#103">103</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#118">118</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#136">136</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#153">153</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#165">165</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#171">171</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#183">183</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#184">184</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#185">185</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#186">186</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#214">214</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#221">221</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#234">234</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#237">237</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#243">243</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#248">248</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#251">251</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#252">252</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#256">256</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#260">260</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#261">261</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#262">262</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#263">263</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#265">265</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#49">49</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#109">109</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#117">117</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#182">182</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#228">228</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#230">230</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#232">232</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#238">238</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#241">241</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#242">242</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#250">250</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#259">259</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#264">264</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#266">266</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#267">267</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#271">271</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#272">272</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#273">273</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#275">275</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#281">281</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#284">284</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#285">285</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#286">286</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#288">288</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#292">292</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#295">295</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#297">297</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#298">298</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#301">301</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#303">303</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#306">306</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#307">307</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#308">308</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#111">111</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#277">277</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#279">279</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#287">287</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#289">289</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#293">293</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#302">302</a> <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#313">313</a>
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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-defects.html#311">311</a>.
+resolutions for issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#49">49</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#76">76</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#91">91</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#235">235</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#250">250</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#267">267</a>.
+Added new issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#278">278</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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
+issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#265">265</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#277">277</a>. Changed status of issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#3">3</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#8">8</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#9">9</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#19">19</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#26">26</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#31">31</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#61">61</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#63">63</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#86">86</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#108">108</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#114">114</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#115">115</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#122">122</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#127">127</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#129">129</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#134">134</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#137">137</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#142">142</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#144">144</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#146">146</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#147">147</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#159">159</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#164">164</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#170">170</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#181">181</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#199">199</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#208">208</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#209">209</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#210">210</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#211">211</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#212">212</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#217">217</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#220">220</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#222">222</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#223">223</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#224">224</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#227">227</a> to "DR". Reopened issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#23">23</a>. Reopened
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#187">187</a>. Changed issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#2">2</a> and
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> to NAD. Fixed a typo in issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#17">17</a>. Fixed
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#70">70</a>: signature should be changed both places it
+appears. Fixed issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#233">233</a>-<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+Tokyo. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#228">228</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+pre-Tokyo II updated: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#212">212</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+pre-Tokyo II mailing: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#199">199</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#211">211</a>. Added "and paragraph 5" to the proposed resolution
+of issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#29">29</a>. Add further rationale to issue
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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-defects.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>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#38">38</a>. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#196">196</a>
+to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#198">198</a>. Closed issues list split into "defects" and
+"closed" documents. Changed the proposed resolution of issue
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#4">4</a> to NAD, and changed the wording of proposed resolution
+of issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Kona updated. Added proposed resolutions <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#83">83</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#86">86</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#91">91</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#92">92</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#109">109</a>. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#190">190</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Kona mailing. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#140">140</a> to
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#189">189</a>. Issues list split into separate "active" and
+"closed" 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)
+pre-Dublin updated: Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#130">130</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#131">131</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#132">132</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#133">133</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#134">134</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#135">135</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#136">136</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#137">137</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#138">138</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Dublin mailing. Added issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#127">127</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#128">128</a>,
+and <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+update issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#103">103</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>; added issues
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#114">114</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+post-Santa Cruz II updated: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#110">110</a>,
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#111">111</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#112">112</a>, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+post-Santa Cruz II: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#94">94</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+pre-Santa Cruz II: Issues <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#73">73</a> to <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.html#93">93</a> added,
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+Correction to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#55">55</a> resolution, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#60">60</a> code
+format, <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;16 Nov 1997</p>
+<b>Section:</b>&nbsp;17.4.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.using.linkage"> [lib.using.linkage]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>Change 17.4.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+ declared with external linkage has either extern "C" or
+ extern "C++" 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
+ linkage has extern "C" or extern "C++" linkage
is implementation defined. It is recommended that an implementation
- use extern &quot;C++&quot; linkage for this purpose.</p>
+ use extern "C++" 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;12 Dec 1997</p>
+<b>Section:</b>&nbsp;18.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.support.start.term"> [lib.support.start.term]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -286,7 +303,7 @@ 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
+Section 18.3 "Start and termination" 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>
@@ -353,7 +370,7 @@ committee decides. </p>
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Jack Reeves&nbsp; <b>Date:</b>&nbsp;11 Dec 1997</p>
+<b>Section:</b>&nbsp;21.3.6.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::compare"> [lib.string::compare]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -373,7 +390,7 @@ something like: str.compare(1, str.size()-1, s, strlen(s)-1); </p>
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>
+<p>Replace the compare signature in 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>
(at the very end of the basic_string synopsis) which reads:</p>
<blockquote>
@@ -392,7 +409,7 @@ charT* s, size_type n2) const; each defined in terms of the corresponding constr
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>
+<p>Replace the portion of 21.3.6.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::compare"> [lib.string::compare]</a>
paragraphs 5 and 6 which read:</p>
<blockquote>
@@ -435,9 +452,9 @@ becomes const, matching the existing synopsis.</p>
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#TC">TC</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
+<a name="7"></a><h3><a name="7">7.&nbsp;String clause minor problems</a></h3><p>
+<b>Section:</b>&nbsp;21 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.strings"> [lib.strings]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -458,12 +475,12 @@ possible const charT&amp;. </p>
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>
+21.3.6.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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,
+<p>(6) In table 37, in section 21.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.char.traits.require"> [lib.char.traits.require]</a>,
+there's a note for X::move(s, p, n). It says "Copies correctly
+even where p is in [s, s+n)". 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
@@ -499,15 +516,15 @@ 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>
+&nbsp;&nbsp;&nbsp; "Copies correctly even where p is in [s, s+n)."<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>
+&nbsp;&nbsp;&nbsp;&nbsp; "Copies correctly even where the ranges [p, p+n) and [s,
+s+n) overlap."</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;24 Dec 1997</p>
+<b>Section:</b>&nbsp;22.1.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.statics"> [lib.locale.statics]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -516,7 +533,7 @@ 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>,
+<p>Add a sentence at the end of 22.1.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.statics"> [lib.locale.statics]</a>,
paragraph 2:&nbsp; </p>
<blockquote>
@@ -526,7 +543,7 @@ paragraph 2:&nbsp; </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;4 Jan 1998</p>
+<b>Section:</b>&nbsp;18.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete"> [lib.new.delete]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -581,7 +598,7 @@ list maintainer's note: the IS is the same.]</p>
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;22 Jan 1998</p>
+<b>Section:</b>&nbsp;23.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.template.bitset"> [lib.template.bitset]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -595,7 +612,7 @@ 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>),
+In the bitset synopsis (23.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -605,7 +622,7 @@ with the two member functions<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>,
+Add the following text at the end of 23.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a>,
immediately after paragraph 45:</p>
<blockquote>
@@ -624,71 +641,71 @@ immediately after paragraph 45:</p>
</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>The LWG believes Item 3 is not a defect. "Formatted
+input" implies the desired semantics. See 27.6.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</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
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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 "eos", 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>
+<p>In 27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, replace "eos" with
+"charT()"</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.1.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.members"> [lib.locale.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+paragraph 6: "An instance of a locale is immutable." </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
+function. As constructors are never const, there was no "const" in the interface
+which was transformed into member "combine". 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>
+<p>In 22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a> and also in 22.1.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.members"> [lib.locale.members]</a>, add
+"const" 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.1.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.members"> [lib.locale.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>In 22.1.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.members"> [lib.locale.members]</a>, paragraph 5, replace
+"<tt>locale(name())</tt>" with
+"<tt>locale(name().c_str())</tt>".
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.byname.special"> [lib.locale.ctype.byname.special]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+from 22.2.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+stream. It does not say it recognizes either of the sequences "true" or
+"false" 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>
+facet rather than the numpunct&lt;&gt; facet, and it examines the "boolalpha"
+flag wrongly; it doesn't define the value "loc"; and finally, it computes
+wrongly whether to use numeric or "alpha" parsing.<br>
<br>
-I believe the correct algorithm is &quot;as if&quot;: </p>
+I believe the correct algorithm is "as if": </p>
<pre> // in, err, val, and str are arguments.
err = 0;
@@ -719,14 +736,14 @@ I believe the correct algorithm is &quot;as if&quot;: </p>
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>In 22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>, in the first line of paragraph 14,
+change "&amp;&amp;" to "&amp;".</p>
<p>Then, replace paragraphs 15 and 16 as follows:</p>
<blockquote>
- <p>Otherwise target sequences are determined &quot;as if&quot; by
+ <p>Otherwise target sequences are determined "as if" 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>.
@@ -747,38 +764,38 @@ change &quot;&amp;&amp;&quot; to &quot;&amp;&quot;.</p>
<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>true</tt>:"a" and <tt>false</tt>:"abb", the input sequence "a" yields
+ <tt>val==true</tt> and <tt>err==str.eofbit</tt>; the input sequence "abc" 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>true</tt>:"1"
+ and <tt>false</tt>:"0", the input sequence "1" yields <tt>val==true</tt>
+ and <tt>err=str.goodbit</tt>. For empty targets (""), 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Add at the beginning of 22.2.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+22.2.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<a name="19"><h3>19.&nbsp;"Noconv" definition too vague</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+specified to return noconv if "no conversion is
+needed". 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:
+22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> to read:
</p>
<blockquote>
<p>
@@ -794,24 +811,24 @@ Change the entry for noconv in the table under paragraph 4 in section
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.3.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+described as returning a "string_type". </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>
+<p>In 22.2.3.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.numpunct.virtuals"> [lib.facet.numpunct.virtuals]</a>, above paragraph 2, change
+"string_type" to "char_type". </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#TC">TC</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;
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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 "Required
+instantiations", 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;
+<p>Add in 22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a> to the table captioned
+"Required instantiations", in the category "ctype"
the lines </p>
<blockquote>
@@ -820,7 +837,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;27.8.1.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ifstream.members"> [lib.ifstream.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -828,7 +845,7 @@ not expect eofbit and failbit to remain set after a successful open. There are t
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>In 27.8.1.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ifstream.members"> [lib.ifstream.members]</a> paragraph 3, <i>and</i> in 27.8.1.10 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ofstream.members"> [lib.ofstream.members]</a> paragraph 3, under open() effects, add a footnote:
</p>
<blockquote>
@@ -846,35 +863,35 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<a name="24"><h3>24.&nbsp;"do_convert" doesn't exist</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+symbol "do_convert" which is not defined in the
+standard. This is a leftover from an edit, and should be "do_in
+and do_out". </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>
+<p>In 22.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>, paragraph 3, change
+"do_convert" to "do_in or do_out". Also, in 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>, change "do_convert()" to "do_in
+or do_out". </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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;
+the smaller of os.width() and str.size(), to pad "as described in stage 3"
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>
+<p>Change 21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+&nbsp;&nbsp;&nbsp; "... where <tt>n</tt> is the smaller of <tt>os.width()</tt> and <tt>str.size()</tt>;
+..."<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>
+&nbsp;&nbsp;&nbsp; "... where <tt>n</tt> is the larger of <tt>os.width()</tt> and <tt>str.size()</tt>;
+..."</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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;
@@ -898,7 +915,7 @@ 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>
+<p>Remove the example above from 27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -909,13 +926,13 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;21.3.5.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::erase"> [lib.string::erase]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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',
+"abcde", 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>
+<p>In 21.3.5.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -929,8 +946,8 @@ while 'd' has not been erased. </p>
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<a name="28"></a><h3><a name="28">28.&nbsp;Ctype&lt;char&gt;is ambiguous</a></h3><p>
+<b>Section:</b>&nbsp;22.2.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -942,7 +959,7 @@ something very different from what was intended. Paragraph 4 says </p>
<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>
+<p>Change 22.2.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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]
@@ -950,15 +967,15 @@ vec[]. </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#TC">TC</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
+<b>Section:</b>&nbsp;27.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Sections 27.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a> and 27.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>,
+basic_ios&lt;&gt;::init, defined in 27.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 27.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.narrow.stream.objects"> [lib.narrow.stream.objects]</a> paragraph 2 and 5, change </p>
<blockquote>
<p>ios_base::init </p>
@@ -970,7 +987,7 @@ paragraph 3. </p>
<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
+<p>Also, make a similar change in 27.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.wide.stream.objects"> [lib.wide.stream.objects]</a> except it
should read </p>
<blockquote>
@@ -978,21 +995,21 @@ should read </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>In 22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>, paragraph 2, change
+"&lt;cctype&gt;" to read "&lt;clocale&gt;". </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#TC">TC</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
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<p>Paragraph 6, says "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
+...". 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>
+<p>In 22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -1010,7 +1027,7 @@ are manifestly assignable. </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;27.5.2.4.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.pback"> [lib.streambuf.virt.pback]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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.
@@ -1024,16 +1041,16 @@ Specifically, the latter says it calls pbackfail if: </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>
+<p>In 27.5.2.4.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+ <p>"<tt>traits::eq(*gptr(),traits::to_char_type( c))</tt>"</p>
</blockquote>
<p>to </p>
<blockquote>
- <p>&quot;<tt>traits::eq(traits::to_char_type(c),gptr()[-1])</tt>&quot;
+ <p>"<tt>traits::eq(traits::to_char_type(c),gptr()[-1])</tt>"
</p>
</blockquote>
<p><b>Rationale:</b></p>
@@ -1041,7 +1058,7 @@ Specifically, the latter says it calls pbackfail if: </p>
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -1052,7 +1069,7 @@ result <i>error</i> says </p>
<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
+<p>In 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1060,12 +1077,12 @@ in the table for the case of _error_ with </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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:
+<p>In 22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1075,13 +1092,13 @@ 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#TC">TC</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>
+<b>Section:</b>&nbsp;27.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostreams.base"> [lib.iostreams.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fmtflags.manip"> [lib.fmtflags.manip]</a>, we have a definition for a manipulator
+named "unitbuf". Unlike other manipulators, it's not listed
+in synopsis. Similarly for "nounitbuf". </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>
+<p>Add to the synopsis for &lt;ios&gt; in 27.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostreams.base"> [lib.iostreams.base]</a>, after
+the entry for "nouppercase", the prototypes: </p>
<blockquote>
<pre>ios_base&amp; unitbuf(ios_base&amp; str);
@@ -1089,7 +1106,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;27.4.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base.storage"> [lib.ios.base.storage]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -1099,7 +1116,7 @@ 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
+<p>Add in 27.4.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1116,10 +1133,10 @@ paragraph 4, replace the sentence: </p>
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>
+<p>substituting "iword" or "pword" 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<a name="37"><h3>37.&nbsp;Leftover "global" reference</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -1130,7 +1147,7 @@ paragraph 4, replace the sentence: </p>
<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
+<p>In 22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>, paragraph 4, delete the parenthesized
expression </p>
<blockquote>
@@ -1138,9 +1155,9 @@ expression </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.global.templates"> [lib.locale.global.templates]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+"facet" 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
@@ -1157,19 +1174,19 @@ reads: </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>
+ contains the public static member <tt>id</tt> as defined in 22.1.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+Kona: strike as overspecification the text "(not inherits)"
+from the original resolution, which read "... whose definition
contains (not inherits) the public static member
-<tt>id</tt>...&quot;
+<tt>id</tt>..."
]</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%2B%2B"> [lib.istreambuf.iterator::op++]</a>&nbsp; <b>Status:</b>&nbsp;<a href="lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;24.5.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator::op%2B%2B"> [lib.istreambuf.iterator::op++]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -1179,28 +1196,28 @@ 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%2B%2B"> [lib.istreambuf.iterator::op++]</a>, delete the three lines of code at the
+<p>In 24.5.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator::op%2B%2B"> [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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>Delete 22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a> paragraph 3 which begins "This
+initialization/identification system depends...", 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#TC">TC</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
+<b>Section:</b>&nbsp;27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>, say that if they fail, they "set badbit,
+which may throw an exception". 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
+<p>Change the description in 27.4.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1221,7 +1238,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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,
@@ -1237,7 +1254,7 @@ 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
+<p> In 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, replace the declaration of the copy
constructor as follows: </p>
<blockquote>
@@ -1246,7 +1263,7 @@ 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
+<p>In 21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace the copy constructor declaration
as above. Add to paragraph 5, Effects:</p>
<blockquote>
@@ -1259,7 +1276,7 @@ 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
+<p>A. In 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, replace the declaration of the copy
constructor as follows:</p>
<blockquote>
@@ -1269,7 +1286,7 @@ 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
+<p>In 21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace the copy constructor declaration
as above. Add to paragraph 5, Effects: </p>
<blockquote>
@@ -1277,7 +1294,7 @@ as above. Add to paragraph 5, Effects: </p>
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
+<p>B. In 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>, and also in 21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, replace
the declaration of the copy constructor as follows: </p>
<blockquote>
@@ -1286,19 +1303,19 @@ the declaration of the copy constructor as follows: </p>
</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>
+was also noted by Pete Becker that this fix "will cause
+a small amount of existing code to now work correctly."</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Brendan Kehoe&nbsp; <b>Date:</b>&nbsp; 1 Jun 1998</p>
+<a name="46"></a><h3><a name="46">46.&nbsp;Minor Annex D errors</a></h3><p>
+<b>Section:</b>&nbsp;D.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.str.strstreams"> [depr.str.strstreams]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>Change D.7.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1307,7 +1324,7 @@ basic_streambuf&lt;char&gt;) from:</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
+<p>In D.7.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstream"> [depr.strstream]</a> insert the semicolon now missing after
int_type:</p>
<pre> namespace std {
@@ -1320,29 +1337,29 @@ int_type:</p>
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<b>Section:</b>&nbsp;27.4.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>In 27.4.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<b>Section:</b>&nbsp;27.4.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Replace 27.4.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;27.4.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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)
@@ -1355,7 +1372,7 @@ 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>
+<p>Change the following sentence in 27.4.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.members.static"> [lib.ios.members.static]</a>
returns clause from:</p>
<blockquote>
@@ -1373,41 +1390,35 @@ returns clause from:</p>
<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>,
+<p>Add the following immediately after 27.4.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> fputc(f, c);
</pre>
<p>is the same as the effect of</p>
-<pre>
- str.rdbuf()-&gt;sputc(c);
+<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> c = fgetc(f);
</pre>
<p>is the same as the effect of:</p>
-<pre>
- c = str.rdbuf()-&gt;sbumpc(c);
+<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> ungetc(c, f);
</pre>
<p>is the same as the effect of</p>
-<pre>
- str.rdbuf()-&gt;sputbackc(c);
+<pre> str.rdbuf()-&gt;sputbackc(c);
</pre>
<p>for any sequence of characters. [<i>Footnote</i>: This implies
@@ -1418,14 +1429,14 @@ 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>
+of "synchronization"]</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;21 Jun 1998</p>
+<b>Section:</b>&nbsp;27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -1445,14 +1456,14 @@ 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
+<p>In 27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;David Vandevoorde&nbsp; <b>Date:</b>&nbsp;23 Jun 1998</p>
+<b>Section:</b>&nbsp;23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -1495,23 +1506,23 @@ function otherwise.</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>
+particularly the addition of the phrase "or change the values
+of"</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#TC">TC</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>
+<b>Section:</b>&nbsp;27.4.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fpos.operations"> [lib.fpos.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>, table 89. This is pretty obvious:
+it should be titled "basic_ios&lt;&gt;() effects", not
+"ios_base() effects". </p>
-<p>[The second item is a duplicate; see issue <a href="lwg-closed.html#6">6</a> for
+<p>[The second item is a duplicate; see issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>Second, 27.4.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
+of thing "i" is.
</p>
<p>(The other problem is that it requires support for streampos
@@ -1522,17 +1533,17 @@ 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>
+<p>Change 27.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a> table 89 title from
+"ios_base() effects" to "basic_ios&lt;&gt;()
+effects". </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;23 Jun 1998</p>
+<b>Section:</b>&nbsp;27.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Add after 27.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.cons"> [lib.basic.ios.cons]</a> paragraph 2:</p>
<blockquote>
<p><tt>virtual ~basic_ios();</tt></p>
@@ -1542,19 +1553,19 @@ rdbuf().</p>
<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
+clearly yes; it may be set via <tt>clear()</tt>. See 27.4.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+footnote which incorrectly said "<tt>rdbuf(0)</tt> does not set
+<tt>badbit</tt>".</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;25 Jun 1998</p>
+<b>Section:</b>&nbsp;27.5.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.cons"> [lib.streambuf.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Add after 27.5.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.cons"> [lib.streambuf.cons]</a> paragraph 2:</p>
<blockquote>
<p><tt>virtual&nbsp; ~basic_streambuf();</tt></p>
@@ -1563,9 +1574,9 @@ explicitly. </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;26 Jun 1998</p>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+circumstances to return an "invalid stream position", 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
@@ -1574,68 +1585,68 @@ 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
+the term "invalid stream position", define that term
somewhere, and then put in a cross-reference. </p>
-<p>The phrase &quot;invalid stream position&quot; appears ten times in
+<p>The phrase "invalid stream position" 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>
+should not be changed. Here are the three places where "invalid
+stream position" 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>27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, paragraph 14<br>
+ 27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 14<br>
+ D.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In 27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 4, change "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;.
+(_lib.iostreams.definitions_)" to "Returns
+<tt>pos_type(off_type(-1))</tt>".
</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
+<p>In 27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 6, change "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>
+position" to "Returns <tt>pos_type(off_type(-1))</tt>".</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.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>, paragraph 13, change "the object
+stores an invalid stream position" to "the return value is
+<tt>pos_type(off_type(-1))</tt>". </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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 13, change "returns an
+invalid stream position (27.4.3)" to "returns
+<tt>pos_type(off_type(-1))</tt>" </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>In 27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>, paragraph 15, change "Otherwise
+returns an invalid stream position (_lib.iostreams.definitions_)"
+to "Otherwise returns <tt>pos_type(off_type(-1))</tt>"
</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 15, change "the object
+stores an invalid stream position" to "the return value is
+<tt>pos_type(off_type(-1))</tt>" </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>
+<p>In D.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 18, change "the object
+stores an invalid stream position" to "the return value is
+<tt>pos_type(off_type(-1))</tt>"</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;29 Jun 1998</p>
+<b>Section:</b>&nbsp;27.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+27.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</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
+<b>Section:</b>&nbsp;21.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.char.traits.specializations.wchar.t"> [lib.char.traits.specializations.wchar.t]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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 "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>
+encodings in wide-oriented streams". </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
@@ -1645,14 +1656,14 @@ 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>
+<p>Remove the sentence in 21.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.char.traits.specializations.wchar.t"> [lib.char.traits.specializations.wchar.t]</a> paragraph 3 which
+begins "The types streampos and wstreampos may be
+different..." . </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#TC">TC</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>
+<b>Section:</b>&nbsp;27.5.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.get.area"> [lib.streambuf.get.area]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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() "Advances the
+next pointer for the input sequence by n." </p>
<p>The straightforward interpretation is that it is just gptr() +=
n. An alternative interpretation, though, is that it behaves as if it
@@ -1660,10 +1671,10 @@ 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
+<p>(The "classic" 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>
+<p>Change 27.5.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -1675,20 +1686,20 @@ former interpretation.)</p>
<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
+<p>Make the same change to 27.5.2.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;3 Aug 1998</p>
+<b>Section:</b>&nbsp;27.6.1.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+27.6.1.2 explicitly say that those requirements apply ("Behaves
+like a formatted input member (as described in 27.6.1.2.1)"), 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
+explicitly say "behaves like a formatted input member"? 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
+in a section called "Formatted input functions" 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>
@@ -1706,102 +1717,102 @@ output. </p>
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
+that the "Common requirements" 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
+<p>Additional comments from Dietmar Kühl: It appears to be somewhat
+nonsensical to consider the functions defined in 27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a> paragraphs 1 to 5 to be "Formatted input
+function" but since these functions are defined in a section
+labeled "Formatted input functions" 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
+have to conform to the "common requirements" from 27.6.1.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+that all functions in 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+some of them even "unextract" 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
+function <tt>putback()</tt> did "extract" 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
+Change the beginning of the second sentence from "The conversion
+occurs" to "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;
+the conversion occurs"
</p>
<p>
In 27.6.1.2.3, [lib.istream::extractors], before paragraph 1.
-Add an effects clause. &quot;Effects: None. This extractor does
+Add an effects clause. "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
+effects clause to "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
+effects clause to "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),
+first two sentences from "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
+from *this..." to "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;.
+constructed, extracts characters from *this...".
</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;
+effects clause. "Effects: none. This member function does not behave
+as an unformatted input function (as described in 27.6.1.3, paragraph 1)."
</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
+beginning of the first sentence of the effects clause from "Extracts a
+character" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts a
-character&quot;
+character"
</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
+beginning of the first sentence of the effects clause from "Extracts a
+character" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts a
-character&quot;
+character"
</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
+beginning of the first sentence of the effects clause from "Extracts
+characters" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
-characters&quot;
+characters"
</p>
<p>
@@ -1810,10 +1821,10 @@ characters&quot;
<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
+beginning of the first sentence of the effects clause from "Extracts
+characters" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
-characters&quot;
+characters"
</p>
<p>
@@ -1822,10 +1833,10 @@ characters&quot;
<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
+beginning of the first sentence of the effects clause from "Extracts
+characters" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
-characters&quot;
+characters"
</p>
<p>
@@ -1834,75 +1845,75 @@ characters&quot;
<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
+beginning of the first sentence of the effects clause from "Extracts
+characters" to "Behaves as an unformatted input function (as described
in 27.6.1.3, paragraph 1). After constructing a sentry object, extracts
-characters&quot;
+characters"
</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
+Effects clause: "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;
+object, reads but does not extract the current input character."
</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
+first sentence of the Effects clause from "If !good() calls" 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;
+paragraph 1). After constructing a sentry object, if !good() calls"
</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;
+first sentence of the Effects clause from "If !good() calls" to
+"Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good() calls"
</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,
+first sentence of the Effects clause from "If !good() calls..." 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; 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;
+calls..." Add a new sentence to the end of the Effects clause:
+"[Note: this function extracts no characters, so the value returned
+by the next call to gcount() is 0.]"
</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
+first sentence of the Effects clause from "If !good() calls" to
+"Behaves as an unformatted input function (as described in 27.6.1.3,
+paragraph 1). After constructing a sentry object, if !good() calls".
+Add a new sentence to the end of the Effects clause: "[Note: this
function extracts no characters, so the value returned by the next
-call to gcount() is 0.]&quot;
+call to gcount() is 0.]"
</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
+first sentence of the Effects clause from "If !rdbuf() is" to "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;
+gcount(). After constructing a sentry object, if rdbuf() is"
</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
+Effects clause: "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;.
+by subsequent calls to gcount()." Change the first sentence of
+paragraph 37 from "if fail()" to "after constructing a sentry object,
+if fail()".
</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
+first sentence of the Effects clause from "If fail()" to "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
@@ -1911,7 +1922,7 @@ gcount(). After constructing a sentry object, if fail()
<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
+first sentence of the Effects clause from "If fail()" to "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
@@ -1920,55 +1931,55 @@ gcount(). After constructing a sentry object, if fail()
<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
+the beginning of the third sentence from "The formatting conversion"
+to "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;.
+conversion occurs".
</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;.
+effects clause: "Effects: None. Does not behave as a formatted output
+function (as described in 27.6.2.5.1).".
</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;.
+effects clause to "Effects: calls pf(*this). This extractor does not
+behave as a formatted output function (as described in 27.6.2.5.1).".
</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;.
+effects clause to "Effects: calls pf(*this). This extractor does not
+behave as a formatted output function (as described in 27.6.2.5.1).".
</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
+sentence from "If sb" to "Behaves as a formatted output function (as
described in 27.6.2.5.1). After the sentry object is constructed, if
-sb&quot;.
+sb".
</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
+sentence from "Inserts the character" to "Behaves as an unformatted
output function (as described in 27.6.2.6, paragraph 1). After
-constructing a sentry object, inserts the character&quot;.
+constructing a sentry object, inserts the character".
</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
+sentence from "Obtains characters" to "Behaves as an unformatted
output function (as described in 27.6.2.6, paragraph 1). After
-constructing a sentry object, obtains characters&quot;.
+constructing a sentry object, obtains characters".
</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;
+sentence at the end of the paragraph: "Does not behave as an
+unformatted output function (as described in 27.6.2.6, paragraph 1)."
</p>
<p><b>Rationale:</b></p>
<p>See J16/99-0043==WG21/N1219, Proposed Resolution to Library Issue 60,
@@ -1976,7 +1987,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -1986,7 +1997,7 @@ 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
+"thrown during input" 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>
@@ -2003,29 +2014,29 @@ 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;
+"If an exception is thrown...", add the following
+parenthetical comment: "(Exceptions thrown from
+<tt>basic_ios&lt;&gt;::clear()</tt> are not caught or rethrown.)"
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;6 Aug 1998</p>
+<a name="62"></a><h3><a name="62">62.&nbsp;<tt>Sync</tt>'s return value</a></h3><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+"calls rdbuf()-&gt;pubsync() and, if that function returns -1
+... returns traits::eof()." </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>In 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, paragraph 36, change "returns
+<tt>traits::eof()</tt>" to "returns <tt>-1</tt>".
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;11 Aug 1998</p>
+<b>Section:</b>&nbsp;27.6.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -2034,10 +2045,10 @@ 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
+In 27.6.2.6, paragraph 1, replace the last sentence ("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:
+function.") with the following text:
</p>
<blockquote>
If an exception is thrown during output, then <tt>ios::badbit</tt> is
@@ -2056,13 +2067,13 @@ input, unformatted input, and formatted output.
<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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;11 Aug 1998 </p>
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Replace 27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, paragraph 13, which begins
+"If the function inserts no characters ..." with:</p>
<blockquote>
<p>If the function inserts no characters, it calls
@@ -2074,16 +2085,16 @@ elaboration of the first. </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;18 Aug 1998</p>
+<b>Section:</b>&nbsp;D.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+"Performs an operation that is defined separately for each class
+derived from strstreambuf". 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;
+<p>D.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstreambuf.virtuals"> [depr.strstreambuf.virtuals]</a>, paragraph 19, replace the setbuf effects
+clause which currently says "Performs an operation that is
+defined separately for each class derived from strstreambuf"
with:</p>
<blockquote>
@@ -2093,7 +2104,7 @@ with:</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;14 Jul 1998</p>
+<b>Section:</b>&nbsp;27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -2103,7 +2114,7 @@ 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
+<p>27.6.1.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::extractors"> [lib.istream::extractors]</a>, paragraph 7, change the last list
item from:</p>
<blockquote>
@@ -2120,15 +2131,15 @@ item from:</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;29 Jul 1998</p>
+<b>Section:</b>&nbsp;23.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector"> [lib.vector]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+that question is clearly "no," 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>,
+<p>Add the following text to the end of 23.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector"> [lib.vector]</a>,
paragraph 1. </p>
<blockquote>
@@ -2139,22 +2150,22 @@ paragraph 1. </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
+"yes". There was considerable discussion as to the best way
+to express the concept of "contiguous", 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>
+ already used for valarray (26.3.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ because elements must be copyconstructible (23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> para 3)
+ and copyconstructible (20.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;Unknown</p>
+<b>Section:</b>&nbsp;18.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.support.exception"> [lib.support.exception]</a>, 18.6.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.uncaught"> [lib.uncaught]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -2165,18 +2176,18 @@ 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>
+<p>In 15.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/except.html#except.uncaught"> [except.uncaught]</a>, paragraph 1, 18.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.support.exception"> [lib.support.exception]</a>, and 18.6.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.uncaught"> [lib.uncaught]</a>, add "throw()" 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;13 Aug 1998</p>
+<b>Section:</b>&nbsp;22.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.time.get"> [lib.locale.time.get]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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,
+is described in 22.2.5.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+four arguments. The missing argument is the "end" 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
+<p>In 22.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.time.get"> [lib.locale.time.get]</a>, add an "end" 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;,
@@ -2184,12 +2195,12 @@ the declaration of member do_monthname as follows:</p>
<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#TC">TC</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;
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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 "Returns"
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
+<p>Replace 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> paragraph 11 with the
following:</p>
<blockquote>
@@ -2201,7 +2212,7 @@ following:</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp; Matt
+<b>Section:</b>&nbsp;22.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -2215,7 +2226,7 @@ synopsis or the summary must be changed. </p>
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>,
+<p>In 22.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>, and also in 22.2.1.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2229,7 +2240,7 @@ change the <tt>stateT</tt> argument type on both member
<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
+<p>In 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2240,7 +2251,7 @@ change the <tt>stateT</tt> argument type on both member
</blockquote>
<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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;25 Sep 1998</p>
+<b>Section:</b>&nbsp;22.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt"> [lib.locale.codecvt]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -2268,15 +2279,15 @@ 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
+<p>(What a "no" 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
+<tt>codecvt::do_max_length</tt> (22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2289,25 +2300,21 @@ 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>
+<p>Add the following text as a new paragraph, following 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
+(27.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> 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> 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> 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
@@ -2317,9 +2324,9 @@ 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
+proposed resolution talked about "success", 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
+removes all talk about "success", and just talks about the
return value.]</i></p>
<p><b>Rationale:</b></p>
@@ -2353,37 +2360,37 @@ return value.]</i></p>
</p>
<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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<b>Section:</b>&nbsp;27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>In the 27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base"> [lib.ios.base]</a> synopsis change
+"event_call_back" to "event_callback". </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#TC">TC</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>
+<b>Section:</b>&nbsp;26.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a>, 26.2.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.value.ops"> [lib.complex.value.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<p>In 26.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 26.2.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 26.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<b>Section:</b>&nbsp;26.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.synopsis"> [lib.complex.synopsis]</a>, 26.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex"> [lib.complex]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<b>Section:</b>&nbsp;21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -2391,8 +2398,8 @@ 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>
+<p>After 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a> paragraph 4 ("The functions
+described in this clause...") add a new paragraph:</p>
<blockquote>
<p>For any string operation, if as a result of the operation, <tt> size()</tt> would exceed
@@ -2403,7 +2410,7 @@ described in this clause...&quot;) add a new paragraph:</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<b>Section:</b>&nbsp;21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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;
@@ -2414,16 +2421,16 @@ described in this clause...&quot;) add a new paragraph:</p>
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>In 21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>, Strike throws paragraphs for
+constructors which say "Throws: length_error if n ==
+npos."</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>
+resolution for issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;29 Sep 1998</p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -2431,7 +2438,7 @@ 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>
+<p>In 21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a> paragraph 1 Effects clause replace:</p>
<blockquote>
<p>
@@ -2445,8 +2452,70 @@ character c.</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>
+<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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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><i>[Curaçao: Nico agrees with proposed resolution.]</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="103"></a><h3><a name="103">103.&nbsp;set::iterator is required to be modifiable, but this allows modification of keys</a></h3><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -2461,7 +2530,7 @@ 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
+<p>23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -2475,27 +2544,27 @@ 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>Option A.&nbsp;&nbsp; In 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, paragraph 2, after
+first sentence, and before "In addition,...", 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>
+<p>Option B.&nbsp;Add three new sentences to 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+ <p>At the end of paragraph 5: "Keys in an associative container
+ are immutable." At the end of paragraph 6: "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>
+ type."</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
+<p>Option C.&nbsp;To 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>, paragraph 3, which
currently reads:</p>
<blockquote>
@@ -2518,18 +2587,18 @@ currently reads:</p>
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
+<p>Add the following to 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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,
+ <p>At the end of paragraph 3: "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
+ value."</p>
+ <p>At the end of paragraph 5: "Keys in an associative container are immutable."</p>
+ <p>At the end of paragraph 6: "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>
+ are the same type."</p>
</blockquote>
<p><b>Rationale:</b></p>
<p>Several arguments were advanced for and against allowing set elements to be
@@ -2557,33 +2626,33 @@ conversion from <tt>iterator</tt> to <tt>const_iterator</tt>.
<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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<b>Section:</b>&nbsp;26.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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:
+Remove the comment which says "// remainder implementation defined" from:
</p>
<ul>
- <li>26.3.5 <a href="lib-numerics.html#lib.template.slice.array"> [lib.template.slice.array]</a>
+ <li>26.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>26.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>26.3.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>26.3.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;AFNOR&nbsp; <b>Date:</b>&nbsp;7 Oct 1998</p>
+<b>Section:</b>&nbsp;18.6.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.exception"> [lib.exception]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>Add to 18.6.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.exception"> [lib.exception]</a> paragraph 9 (exception::what notes
clause) the sentence:</p>
<blockquote>
@@ -2596,12 +2665,12 @@ 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>
+<a name="109"></a><h3><a name="109">109.&nbsp;Missing binders for non-const sequence elements</a></h3><p>
+<b>Section:</b>&nbsp;20.3.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.binders"> [lib.binders]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;
+page 521 of "The C++ Programming Language (3rd)"
non-conforming. Suitable versions of the binders need to be added.</p>
<p>Further discussion from Nico:</p>
@@ -2673,7 +2742,7 @@ public:
<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>
+<p>In 20.3.6.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2683,7 +2752,7 @@ See c++std-lib-9127. We may need to reopen this issue.</p>
<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>
+<p>In 20.3.6.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -2705,12 +2774,12 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nathan Myers&nbsp; <b>Date:</b>&nbsp;15 Oct 1998</p>
+<b>Section:</b>&nbsp;24.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator"> [lib.istreambuf.iterator]</a>, 24.5.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator::equal"> [lib.istreambuf.iterator::equal]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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==,
+"const", yet 24.5.3.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>,
+<p>In 24.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator"> [lib.istreambuf.iterator]</a> and also in 24.5.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istreambuf.iterator::equal"> [lib.istreambuf.iterator::equal]</a>,
replace:</p>
<blockquote>
@@ -2724,16 +2793,16 @@ replace:</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;20 Oct 1998</p>
+<b>Section:</b>&nbsp;24.5.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.ostreambuf.iter.cons"> [lib.ostreambuf.iter.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+reads "<i>s</i> is not null". 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>In 24.5.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>Move the current paragraph 1, which reads "Requires: s is not
+null.", from the first constructor to the second constructor.</p>
<p>Insert a new paragraph 1 Requires clause for the first constructor
reading:</p>
@@ -2744,7 +2813,7 @@ reading:</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;28 Oct 1998</p>
+<b>Section:</b>&nbsp;18.4.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.placement"> [lib.new.delete.placement]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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:
@@ -2752,7 +2821,7 @@ reading:</p>
Something* p = new (place) Something();
-end example]</pre>
-<p>First code line: &quot;place&quot; need not have any special alignment, and the
+<p>First code line: "place" 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
@@ -2762,7 +2831,7 @@ believes the () are correct.]</p>
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:
+18.4.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.placement"> [lib.new.delete.placement]</a> with:
</p>
<blockquote>
@@ -2770,7 +2839,7 @@ likely to fail.</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;2 Nov 1998</p>
+<b>Section:</b>&nbsp;D.7.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.strstream.cons"> [depr.strstream.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -2784,15 +2853,15 @@ likely to fail.</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
+should be "If mode&amp;app==app", or "mode&amp;app!=0", 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>
+<p>In D.7.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.ostrstream.cons"> [depr.ostrstream.cons]</a> paragraph 2 and D.7.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;27.6.2.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.inserters.arithmetic"> [lib.ostream.inserters.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -2821,7 +2890,7 @@ functions that are actually there. I prefer the latter. </p>
<blockquote>
<p>
-The classes num_get&lt;&gt; and num_put&lt;&gt; handle locale&shy;dependent numeric
+The classes num_get&lt;&gt; and num_put&lt;&gt; handle locale­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
@@ -2829,8 +2898,7 @@ formatting conversion occurs as if it performed the following code
fragment:
</p>
-<pre>
-bool failed = use_facet&lt;
+<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>
@@ -2840,8 +2908,7 @@ 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;
+<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(),
@@ -2855,8 +2922,7 @@ 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;
+<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(),
@@ -2870,8 +2936,7 @@ 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;
+<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();
@@ -2882,8 +2947,7 @@ 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;
+<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();
@@ -2904,7 +2968,7 @@ 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>
+<b>Section:</b>&nbsp;27.6.1.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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,
@@ -2915,7 +2979,7 @@ 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,
+<p>According to section 22.2.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>,
@@ -2924,7 +2988,7 @@ int</tt>, <tt>unsigned long</tt>, <tt>unsigned long</tt>,
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
+<p>In 27.6.1.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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);
@@ -2962,11 +3026,11 @@ operator&gt;&gt;(int&amp; val);</pre>
<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#TC">TC</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>
+<b>Section:</b>&nbsp;17.4.4.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>"An implementation may strengthen the exception-specification
+for a function by removing listed exceptions." </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
@@ -2985,18 +3049,18 @@ public:
// 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>Change Section 17.4.4.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>&nbsp;&nbsp;&nbsp;&nbsp; "may strengthen the
+exception-specification for a function"</p>
<p>to:</p>
-<p>&nbsp;&nbsp;&nbsp;&nbsp; &quot;may strengthen the
-exception-specification for a non-virtual function&quot;. </p>
+<p>&nbsp;&nbsp;&nbsp;&nbsp; "may strengthen the
+exception-specification for a non-virtual function". </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<b>Section:</b>&nbsp;27.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf"> [lib.streambuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3013,37 +3077,154 @@ specialized for the type wchar_t. </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
+<p>Remove 27.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.slice.arr.fill"> [lib.slice.arr.fill]</a>, 26.3.7.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.gslice.array.fill"> [lib.gslice.array.fill]</a>, 26.3.8.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.mask.array.fill"> [lib.mask.array.fill]</a>, 26.3.9.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.indirect.array.fill"> [lib.indirect.array.fill]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="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#TC">TC</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>
+<b>Section:</b>&nbsp;22.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>Change Section 22.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</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
+<b>Section:</b>&nbsp;26.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.template.valarray"> [lib.template.valarray]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>Change in Section 26.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;15 Dec 1998</p>
+<a name="126"></a><h3><a name="126">126.&nbsp;typos in Effects clause of ctype::do_narrow()</a></h3><p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>In Section 22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a> change: </p>
<pre> do_widen(do_narrow(c),0) == c</pre>
@@ -3060,7 +3241,7 @@ latter appears to be correct. </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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Colvin&nbsp; <b>Date:</b>&nbsp;17 Feb 1999</p>
+<b>Section:</b>&nbsp;20.4.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3080,8 +3261,8 @@ 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)
+"assignment operator" to "public assignment
+operator", 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
@@ -3098,23 +3279,23 @@ object parameter may be bound to an rvalue [13.3.3.1.4/3]
<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>,
+ <p>In 20.4.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.auto.ptr"> [lib.auto.ptr]</a>, paragraph 2, and 20.4.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In 20.4.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In 20.4.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>Also add the assignment operator to 20.4.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3126,7 +3307,7 @@ a public assignment operator to the <tt>auto_ptr</tt> definition: </p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;22 Feb 1999</p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, 27.6.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.seeks"> [lib.ostream.seeks]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -3139,8 +3320,8 @@ stream must perform a state-dependent code conversion, etc. </p>
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>
+27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a> and to the Effects: clause of seekp() in
+27.6.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>).
@@ -3150,7 +3331,7 @@ stream state in case of failure.</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<b>Section:</b>&nbsp;23.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.capacity"> [lib.list.capacity]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3182,23 +3363,23 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<b>Section:</b>&nbsp;23.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.map"> [lib.map]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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,
+<p>Insert in 23.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</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>
+<b>Section:</b>&nbsp;23.2.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.cons"> [lib.vector.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;6 Mar 1999</p>
+<p>The complexity description says: "It does at most 2N calls to the copy constructor
+of T and logN reallocations if they are just input iterators ...".</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>Change 23.2.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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)
@@ -3209,12 +3390,12 @@ 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
+<p>"at most 2N calls" 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>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -3256,7 +3437,7 @@ Effects: If fail() != true, executes rdbuf()-&gt;pubseekoff(off, dir, ios_base::
<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
+<p><i>[Dublin: Dietmar Kü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
@@ -3269,15 +3450,15 @@ 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);
+require that std::stringbuf s(std::string("foo"), 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#TC">TC</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>
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;17 Mar 1999</p>
+<p>Section 22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3287,7 +3468,7 @@ 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>:
+22.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3298,14 +3479,14 @@ locale&amp;&nbsp; loc); <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;
+<p>Remove the phrase "(or, failing that, in the global locale)"
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;30 Mar 1999</p>
+<b>Section:</b>&nbsp;23.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3318,7 +3499,7 @@ 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;
+<p>Replace the wording in 23.1.1 paragraph 12&nbsp; which begins ``The operations in table 68 are provided only..."
with:</p>
<blockquote>
@@ -3329,11 +3510,11 @@ with:</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Arch Robison&nbsp; <b>Date:</b>&nbsp;28 Apr 1999</p>
+<b>Section:</b>&nbsp;21.3.6.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::find.last.of"> [lib.string::find.last.of]</a>, 21.3.6.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string::find.last.not.of"> [lib.string::find.last.not.of]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
-&#151; <tt>xpos &lt;= pos</tt> and <tt>pos &lt; size();</tt>
+&#8212; <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>
@@ -3343,19 +3524,19 @@ 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>
-&#151; <tt>xpos &lt;= pos</tt> and <tt>pos &lt; size();<br>
+&#8212; <tt>xpos &lt;= pos</tt> and <tt>pos &lt; size();<br>
<br>
</tt>to:<br>
<tt><br>
-</tt>&#151; <tt>xpos &lt;= pos</tt> and <tt>xpos &lt; size();</tt>
+</tt>&#8212; <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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Howard Hinnant&nbsp; <b>Date:</b>&nbsp;20 Jun 1999</p>
+<b>Section:</b>&nbsp;25.3.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.lex.comparison"> [lib.alg.lex.comparison]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+&nbsp;&nbsp;&nbsp;&nbsp; "At most min((last1 - first1), (last2 - first2))
+applications of the corresponding comparison."<br>
<br>
The best I can do is twice that expensive.</p>
@@ -3364,7 +3545,7 @@ 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>
+<p>Change 25.3.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
@@ -3385,7 +3566,7 @@ right! (and Matt states this complexity in his book)</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Herb Sutter&nbsp; <b>Date:</b>&nbsp;9 May 1999</p>
+<b>Section:</b>&nbsp;23.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.deque.cons"> [lib.deque.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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,
@@ -3396,7 +3577,7 @@ below, was taken from vector:</p>
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,
+<p>The word "reallocations" 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
@@ -3410,14 +3591,14 @@ 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;
+footnote, with the following text (which also corrects the "abd"
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;12 May 1999</p>
+<b>Section:</b>&nbsp;26.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.ops"> [lib.complex.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3457,7 +3638,7 @@ Effects: inserts the complex number x onto the stream o as if it were implemente
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>
+ s &lt;&lt; '(' &lt;&lt; x.real() &lt;&lt; "," &lt;&lt; x.imag() &lt;&lt; ')';&nbsp;<br>
return o &lt;&lt; s.str();&nbsp;<br>
}</p>
@@ -3474,7 +3655,7 @@ 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
+<p>After 26.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.complex.ops"> [lib.complex.ops]</a> paragraph 14 (operator&gt;&gt;), add a
Notes clause:</p>
<blockquote>
@@ -3486,13 +3667,13 @@ 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>
+follows an "all-or-none" 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Lois Goldthwaite&nbsp; <b>Date:</b>&nbsp;4 Jun 1999</p>
+<b>Section:</b>&nbsp;17.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.global.functions"> [lib.global.functions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -3504,7 +3685,7 @@ within namespace std. </p>
</blockquote>
-<p>It appears &quot;global function&quot; was never updated in the following: </p>
+<p>It appears "global function" was never updated in the following: </p>
<blockquote>
@@ -3540,7 +3721,7 @@ 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>
+<p> Change "global" to "global or non-member" in:</p>
<blockquote>
<p>17.4.4.3 [lib.global.functions] section title,<br>
17.4.4.3 [lib.global.functions] para 1,<br>
@@ -3552,27 +3733,27 @@ virtual or global functions, however. </p>
<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.
+was changed from "non-member" to "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#TC">TC</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
+<b>Section:</b>&nbsp;22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Jeremy Siek&nbsp; <b>Date:</b>&nbsp;3 Jun 1999</p>
+<p>In 22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In 22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a> paragraph 13, insert "const" 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>
+ <p><tt>string do_truename() const { return "Oui Oui!"; }<br>
+ string do_falsename() const { return "Mais Non!"; }</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt McClure&nbsp; <b>Date:</b>&nbsp;30 Jun 1999</p>
+<b>Section:</b>&nbsp;25.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.find.first.of"> [lib.alg.find.first.of]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+<p>Change 25.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3587,7 +3768,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Ed Brey&nbsp; <b>Date:</b>&nbsp;21 Jun 1999</p>
+<b>Section:</b>&nbsp;23.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -3625,24 +3806,24 @@ iterators or certain kinds of iterators is unnecessary.
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<a name="152"></a><h3><a name="152">152.&nbsp;Typo in <tt>scan_is()</tt> semantics</a></h3><p>
+<b>Section:</b>&nbsp;22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.virtuals"> [lib.locale.ctype.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+<p>In 22.2.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+ <p>"... such that <tt>is(*p)</tt>
+would..."</p>
</blockquote>
-<p>to:&nbsp; &quot;... such that <tt>is(m, *p)</tt>
- would....&quot;</p>
+<p>to:&nbsp; "... such that <tt>is(m, *p)</tt>
+ would...."</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>
+<b>Section:</b>&nbsp;22.2.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.ctype.char.members"> [lib.facet.ctype.char.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
@@ -3653,7 +3834,7 @@ 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>
+<p>Change the returns clause in 22.2.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3661,7 +3842,7 @@ paragraph 10 from:</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>
+<p>Change 22.2.1.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3678,24 +3859,24 @@ 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>
+asks for clarification of the Kona "a user defined
+version..." comment above. Perhaps it was a circuitous way of
+saying "dfault" 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
+proposed resolution from issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+<p>In 22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3703,33 +3884,33 @@ Modifier table to say that for <tt>double</tt> a length modifier
<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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>
+<tt>Init</tt> is defined. According to 27.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>Change 27.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostream.objects"> [lib.iostream.objects]</a> paragraph 2 from
+"<tt>basic_ios::Init"</tt> to
+"<tt>ios_base::Init"</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<a name="156"></a><h3><a name="156">156.&nbsp;Typo in <tt>imbue()</tt> description</a></h3><p>
+<b>Section:</b>&nbsp;27.4.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+<tt>imbue()</tt>: in 27.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>In 27.4.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base.locales"> [lib.ios.base.locales]</a> change the <tt>imbue</tt> argument
+from "<tt>locale const" to "locale
+const&amp;".</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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;
@@ -3741,12 +3922,12 @@ 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>
+<p>Change 27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>, paragraph 3, Default behavior,
+to: "Default behavior: Does nothing. Returns this."</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.5.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.get"> [lib.streambuf.virt.get]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
@@ -3754,34 +3935,34 @@ 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,
+<p>Change 27.5.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+"supplied" with the words "extracted from the
+stream".</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.6.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream"> [lib.istream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>In 27.6.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream"> [lib.istream]</a>, 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>, paragraph 1,
+27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream"> [lib.ostream]</a>, paragraph 3, and 27.6.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>,
+paragraph 1, change "<tt>exception()" to
+"exceptions()"</tt>.</p>
-<p><i>[Note to Editor: &quot;exceptions&quot; with an &quot;s&quot;
+<p><i>[Note to Editor: "exceptions" with an "s"
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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.6.1.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.arithmetic"> [lib.istream.formatted.arithmetic]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>
+<p>Change 27.6.1.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -3791,8 +3972,8 @@ an object of type <tt>istreambuf_iterator</tt>.</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#TC">TC</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
+<b>Section:</b>&nbsp;22.2.5.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.time.put.virtuals"> [lib.locale.time.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3802,7 +3983,7 @@ 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>
+<p>Add the following note after 22.2.5.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3814,10 +3995,10 @@ 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>
+<b>Section:</b>&nbsp;27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream"> [lib.ostream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+functions falling into one of the groups "formatted output functions"
+and "unformatted output functions" 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
@@ -3826,10 +4007,10 @@ call <tt>xsputn()</tt> for strings... Also, the statement that <tt>overflow()</t
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;
+under "unformatted output functions").</p>
+<p>In addition, I guess that the sentence starting with "They may use other
+public members of <tt>basic_ostream</tt> ..." probably was intended to
+start with "They may use other public members of <tt>basic_streamuf</tt>..."
although the problem with the virtual members exists in both cases.</p>
<p>I see two obvious resolutions:</p>
<ol>
@@ -3861,34 +4042,34 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.6.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>
+<p>In 27.6.2.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.unformatted"> [lib.ostream.unformatted]</a> paragraph 1, the first and last
+sentences, change the word "formatted" to
+"unformatted":</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>
+ <p>"Each <b>unformatted </b> output function begins ..."<br>
+ "... value specified for the <b>unformatted </b> output
+ function."</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<b>Section:</b>&nbsp;27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+member functions are not allowed to use <tt>xsputn()</tt> (see 27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a> paragraph 8, Notes, insert the words
+"at least" 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
@@ -3898,24 +4079,24 @@ solution is to handle this in <tt>underflow()</tt>.</p>
<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#TC">TC</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
+<b>Section:</b>&nbsp;27.7.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringstream"> [lib.stringstream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kühl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>The classes <tt>basic_stringstream</tt> (27.7.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringstream"> [lib.stringstream]</a>),
+<tt>basic_istringstream</tt> (27.7.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istringstream"> [lib.istringstream]</a>), and
+<tt>basic_ostringstream</tt> (27.7.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<tt>basic_ostringstream</tt> (27.7.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostringstream"> [lib.ostringstream]</a>) and
+<tt>basic_stringstream</tt> (27.7.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<b>Section:</b>&nbsp;27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kühl&nbsp; <b>Date:</b>&nbsp;20 Jul 1999</p>
+<p>Overridden virtual functions, seekpos()</p> <p>In 27.8.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -3968,10 +4149,10 @@ paragraph 14 from:</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#TC">TC</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
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Comeau, Dietmar Kühl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>In 27.6.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+argument. However, in 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>
paragraph 23 the first argument is of type <tt>int.</tt>
</p>
@@ -3979,7 +4160,7 @@ paragraph 23 the first argument is of type <tt>int.</tt>
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>
+as described in issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#173">173</a>.</p>
<p>Darin Adler also
submitted this issue, commenting: Either 27.6.1.1 should be modified
@@ -3987,18 +4168,18 @@ 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
+<p>In 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Comeau, Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<b>Section:</b>&nbsp;27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Greg Comeau, Dietmar Kü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
+In 27.8.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.filebuf.virtuals"> [lib.filebuf.virtuals]</a> paragraph 9 the second argument is of type
<tt>int</tt>.
</p>
@@ -4007,32 +4188,32 @@ 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>.
+as described in issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>In 27.8.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<b>Section:</b>&nbsp;D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>
+<p>Change D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.ios.members"> [depr.ios.members]</a> paragraph 1 from "<tt>typedef
+OFF_T streampos;</tt>" to "<tt>typedef POS_T
+streampos;</tt>"</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar K&uuml;hl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<b>Section:</b>&nbsp;D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+"may" 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
@@ -4041,29 +4222,137 @@ 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
+<p>In D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#TC">TC</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
+<b>Section:</b>&nbsp;D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/future.html#depr.ios.members"> [depr.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kühl&nbsp; <b>Date:</b>&nbsp;23 Jul 1999</p>
+<p>The "overload" 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>
+be implemented: "Call the corresponding member function specified
+in clause 27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>."</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
+<p>In D.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="179"><h3>179.&nbsp;Comparison of const_iterators to iterators doesn't work</h3></a><p>
+<b>Section:</b>&nbsp;23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#280">280</a>.)
+</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;3 Aug 1999</p>
+<b>Section:</b>&nbsp;20.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.pairs"> [lib.pairs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <tt>make_pair("abc", 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>
@@ -4071,7 +4360,7 @@ parameter to <tt> const char (&amp;)[4]</tt>, which type is uncopyable.<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
+<p>In 20.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4080,7 +4369,7 @@ declaration of make_pair():</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>
+<p> In 20.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4098,7 +4387,7 @@ pair&lt;T1, T2&gt; make_pair(T1 x, T2 y);</pre>
</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
+Kü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
@@ -4107,18 +4396,18 @@ 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>
+<b>Section:</b>&nbsp;17 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
+example, 17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a> paragraph 2:</p>
<blockquote>
-<pre>&#151; operator new(size_t)
-&#151; operator new(size_t, const std::nothrow_t&amp;)
-&#151; operator new[](size_t)
-&#151; operator new[](size_t, const std::nothrow_t&amp;)</pre>
+<pre>&#8212; operator new(size_t)
+&#8212; operator new(size_t, const std::nothrow_t&amp;)
+&#8212; operator new[](size_t)
+&#8212; 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>
+<p> In 17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4176,12 +4465,13 @@ example, 17.4.3.4 <a href="lib-intro.html#lib.replacement.functions"> [lib.repla
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>
+X::length(p): "size_t" by "std::size_t".</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>
+<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>
@@ -4192,7 +4482,7 @@ X::length(p): &quot;size_t&quot; by &quot;std::size_t&quot;.</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>
+ptrdiff_t meant anyway because, according to 17.4.3.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4206,7 +4496,7 @@ 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
+<p><i>[Toronto: This is tangentially related to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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
@@ -4217,8 +4507,8 @@ 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
+<b>Section:</b>&nbsp;27.6.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.std.manip"> [lib.std.manip]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;7 Jul 1999</p>
+<p>27.6.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4231,36 +4521,46 @@ 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>
+"The expression out &lt;&lt; s has type basic_ostream&amp; ..." and
+[4] should read: "The expression in &gt;&gt; s has type basic_istream&amp;
+..."</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
+<p>The same "cut'n'paste" 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>
+that the value of the expression is "the same specialization of
+basic_ostream as out"&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
+<p>Replace section 27.6.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<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
+-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;
+[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>
@@ -4275,8 +4575,12 @@ The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and v
<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,
+-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>
@@ -4291,8 +4595,12 @@ The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and v
<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,
+-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>
@@ -4310,8 +4618,11 @@ The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and v
<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
+-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>
@@ -4326,8 +4637,12 @@ The expression out&lt;&lt;s has type basic_ostream&lt;charT,traits&gt;&amp; and
<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)
+-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>
@@ -4342,8 +4657,12 @@ The expression in&gt;&gt;s has type basic_istream&lt;charT,traits&gt;&amp; and v
.<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)
+-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>
@@ -4363,20 +4682,20 @@ in.
<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
+<p><i>[Tokyo - The LWG noted that issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+resolution of this issue with the proposed resolution for issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;18.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.numeric.special"> [lib.numeric.special]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;
+3.9.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/basic.html#basic.fundamental"> [basic.fundamental]</a> paragraph 7. However "integer types"
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>
@@ -4404,17 +4723,17 @@ to be meaningful.</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
+requires a "pure binary numeration system" 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
+<p>The footnote 186) says: "Distinguishes types with base other than 2 (e.g
+BCD)."&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>
+<p>Append to the end of 18.2.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 {
@@ -4466,17 +4785,17 @@ 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>
+<a name="185"><h3>185.&nbsp;Questionable use of term "inline"</h3></a><p>
+<b>Section:</b>&nbsp;20.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.function.objects"> [lib.function.objects]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+<p>(Note: The "addition" 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>
+any "inlining" 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
@@ -4490,20 +4809,20 @@ any &quot;inlining&quot; will take place in this case.</p>
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
+<p>Thus the example "mandates" 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>
+<p>In 20.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>Remove 20.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 20.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4513,8 +4832,8 @@ not required elsewhere.</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
+<b>Section:</b>&nbsp;23.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.members"> [lib.bitset.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4524,7 +4843,7 @@ 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>
+<p>In 23.3.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4532,7 +4851,7 @@ translating 0 to false and any non-zero value to true.</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>
+<p>In 23.3.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4552,8 +4871,66 @@ 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="187"><h3>187.&nbsp;iter_swap underspecified</h3></a><p>
+<b>Section:</b>&nbsp;25.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.swap"> [lib.alg.swap]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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><b>Rationale:</b></p>
+<p>It's useful to say just what <tt>iter_swap</tt> does. There may be
+ some iterators for which we want to specialize <tt>iter_swap</tt>,
+ but the fully general version should have a general specification.</p>
+
+<p>Note that in the specific case of <tt>list&lt;T&gt;::iterator</tt>,
+iter_swap should not be specialized as suggested above. That would do
+much more than exchanging the two iterators' values: it would change
+predecessor/successor relationships, possibly moving the iterator from
+one list to another. That would surely be inappropriate.</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Andrew Koenig&nbsp; <b>Date:</b>&nbsp;25 Aug 1999</p>
+<b>Section:</b>&nbsp;27.4.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fmtflags.state"> [lib.fmtflags.state]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -4566,27 +4943,30 @@ point.<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>
+<p>Remove from 27.4.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.fmtflags.state"> [lib.fmtflags.state]</a>, paragraph 9, the text
+"(number of digits after the decimal point)".</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Markus Mauhart&nbsp; <b>Date:</b>&nbsp;24 Sep 1999</p>
+<b>Section:</b>&nbsp;25.3.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.heap.operations"> [lib.alg.heap.operations]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
+&nbsp;&nbsp;&nbsp; `"(1) *a is the largest element"<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>
+ <p>A-"part of largest equivalence class" instead of "largest", cause 25.3
+ [lib.alg.sorting] asserts "strict weak ordering" 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 "priority queue" 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>
+<p>Change 25.3.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4597,20 +4977,20 @@ resolution.</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;13 Oct 1999</p>
+<b>Section:</b>&nbsp;27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream::sentry"> [lib.istream::sentry]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>On the one hand, nothing in 27.6.1.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+other hand, 27.6.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream"> [lib.istream]</a> paragraph 4 says that if
+extraction from a <tt>streambuf</tt> "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
+<tt>setstate(eofbit)"</tt>. So the question comes down to
whether <tt>basic_istream&lt;&gt;::sentry</tt>'s constructor is an
input function.</p>
@@ -4626,12 +5006,12 @@ 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
+read on UNIX returns 0 bytes to indicate "EOF", 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
+tty's on UNIX even after they have signaled "EOF". (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
+an EOL indicator. By typing a "line" consisting solely of
^D you cause a read to return 0 bytes, and by convention this is
interpreted as end of file.)</p>
</blockquote>
@@ -4646,7 +5026,7 @@ returns <tt>traits::eof()</tt>, the function calls
</blockquote>
<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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;3 Nov 1999</p>
+<b>Section:</b>&nbsp;24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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?
@@ -4656,8 +5036,7 @@ 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;
+<pre>#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;iterator&gt;
@@ -4694,14 +5073,14 @@ 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
+change. The definition of reverse_iterator::operator*(), 24.4.1.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>The definition of reverse_iterator::operator-&gt;(), 24.4.1.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4712,18 +5091,17 @@ 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>
+<p>Add a new paragraph to 24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>Replace paragraph 1 of 24.4.1.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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;
+<pre> this-&gt;tmp = current;
--this-&gt;tmp;
return *this-&gt;tmp;
</pre>
@@ -4732,7 +5110,7 @@ previously obtained from that iterator.
[<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
+24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4748,7 +5126,7 @@ reformulated yet again to reflect this reality.]</i></p>
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
+However, this issue is related to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4758,7 +5136,7 @@ other changes in reverse_iterator will be necessary.]</i></p>
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
+include a B-tree iterator, and an "iota iterator" 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
@@ -4772,7 +5150,7 @@ predefined iterators are as strong as users expect.</p>
<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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;19 Nov 1999</p>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -4785,7 +5163,7 @@ unique non-null pointer.
<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>
+"[<i>Note:</i> If <tt>n == 0</tt>, the return value is unspecified. <i>--end note</i>]"</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
@@ -4794,20 +5172,175 @@ representation. Since this already implies special case code, it
would be over-specification to mandate the return value.
</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.forward.iterators"> [lib.forward.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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. ("Value type"
+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 "<tt>T&amp;</tt>" to "<tt>T&amp;</tt>
+if <tt>X</tt> is mutable, otherwise <tt>const T&amp;</tt>".
+In the <tt>a-&gt;m</tt> row, change the return type from
+"<tt>U&amp;</tt>" to "<tt>U&amp;</tt> if <tt>X</tt> is mutable,
+otherwise <tt>const U&amp;</tt>".
+</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "eliminates all but
+ the first element from every consecutive group of equal
+ elements..." and it wouldn't make sense to interpret "equal" as
+ meaning anything but an equivalence relation. [It also doesn't
+ make sense to interpret "equal" as meaning ==, because then there
+ would never be any sense in giving a predicate as an argument at
+ all.]
+</p>
+
+<p>
+ 2. The word "equal" 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 "equal", 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: "Break the
+sequence into subsequences whose elements are in strictly increasing
+order, and keep only the first element of each subsequence". 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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+1, 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: "Requires: The
+comparison function must be an equivalence relation."
+</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 "i-1" is incorrect, since "i" can refer to the first
+iterator in the range. Matt provided wording to address this
+problem.]</i></p>
+
+<p><i>[Curaçao: The LWG changed "... the range (first,
+last)..." to "... the range [first+1, last)..." for
+clarity. They considered this change close enough to editorial to not
+require another round of review.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>The LWG also considered an alternative resolution: change
+25.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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: "Notes: The
+comparison function need not be an equivalence relation."
+</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="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#TC">TC</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>
+<b>Section:</b>&nbsp;24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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 ". . . Dereferenceable and
+past-the-end values are always non-singular."</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>
+without a "footer" 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>
+<p>Change 24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4822,8 +5355,8 @@ 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#TC">TC</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
+<b>Section:</b>&nbsp;21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Igor Stauder&nbsp; <b>Date:</b>&nbsp;11 Feb 2000</p>
+<p>In Section 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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);
@@ -4836,7 +5369,7 @@ 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
+<p>In Section 21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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);
@@ -4852,8 +5385,8 @@ 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#TC">TC</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>
+<b>Section:</b>&nbsp;25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4864,8 +5397,8 @@ change.
</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>On the last line of paragraph 9 of section 25 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.algorithms"> [lib.algorithms]</a> change
+<tt>"a-b"</tt> to <tt>"b-a".</tt>
</p>
<p><b>Rationale:</b></p>
<p>There are two ways to fix the defect; change the description to b-a
@@ -4873,7 +5406,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Scott Snyder&nbsp; <b>Date:</b>&nbsp;4 Feb 2000</p>
+<b>Section:</b>&nbsp;21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -4887,12 +5420,12 @@ 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
+which do include this requirement. (See sections 27.6.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted"> [lib.istream.formatted]</a> and 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+of getline (istream&amp;, string&amp;, charT) in section 21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>Insert new paragraph after paragraph 2 in section 21.3.7.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.io"> [lib.string.io]</a>:</p>
<blockquote>
<p>If the function extracts no characters, it calls
@@ -4901,13 +5434,13 @@ is.setstate(ios::failbit) which may throw ios_base::failure
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Nico Josuttis&nbsp; <b>Date:</b>&nbsp;26 Feb 2000</p>
+<b>Section:</b>&nbsp;25.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.min.max"> [lib.alg.min.max]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+<p>In 25.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -4916,10 +5449,10 @@ 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>
+<b>Section:</b>&nbsp;23.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.set"> [lib.set]</a>, 23.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.multiset"> [lib.multiset]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+Table 69 state that the find member function should "return
+iterator; const_iterator for constant a". The map and multimap
container descriptions have two overloaded versions of find, but set
and multiset do not, all they have is:</p>
<blockquote>
@@ -4927,7 +5460,7 @@ and multiset do not, all they have is:</p>
</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>
+equal_range() in section 23.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.set"> [lib.set]</a> and section 23.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -4944,7 +5477,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;29 Feb 2000</p>
+<b>Section:</b>&nbsp;22.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facets.examples"> [lib.facets.examples]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
@@ -4955,7 +5488,7 @@ name of the namespace `My'.</p>
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,
+<p>Replace the "Classifying Japanese characters" example in 22.2.8,
paragraph 11 with the following:</p>
<pre>#include &lt;locale&gt;</pre>
<pre>namespace My {
@@ -4972,23 +5505,23 @@ paragraph 11 with the following:</p>
<pre>// file: filt.C
#include &lt;iostream&gt;
#include &lt;locale&gt;
-#include &quot;jctype&quot; // above
+#include "jctype" // 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...
+ locale loc(locale(""), // 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;
+ cout &lt;&lt; "no it isn't!" &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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Jonathan Schilling, Howard Hinnant&nbsp; <b>Date:</b>&nbsp;13 Mar 2000</p>
+<b>Section:</b>&nbsp;27.4.2.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios.base.cons"> [lib.ios.base.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -5024,13 +5557,14 @@ behavior.</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>
+ <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>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -5038,23 +5572,23 @@ 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
+must be done "as if" 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
+"0123456789abcdefABCDEF+-". The character "x" 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>
+ <pre>static const char src[] = "0123456789abcdefABCDEF+-";</pre>
</blockquote>
<p>with the line:</p>
<blockquote>
- <pre>static const char src[] = &quot;0123456789abcdefxABCDEFX+-&quot;;</pre>
+ <pre>static const char src[] = "0123456789abcdefxABCDEFX+-";</pre>
</blockquote>
<p><b>Rationale:</b></p>
<p>If we're using the technique of widening a string literal, the
@@ -5064,7 +5598,7 @@ 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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Judy Ward&nbsp; <b>Date:</b>&nbsp;17 Mar 2000</p>
+<b>Section:</b>&nbsp;17.3.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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]
@@ -5080,23 +5614,23 @@ int compare(size_type pos1, size_type n1,
</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>
+section 21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+"Throws: " 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
+"Effects" clauses correct, or are the "Throws" 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>
+<p>In 17.3.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> paragraph 3, the footnote 148 attached to
+the sentence "Descriptions of function semantics contain the
+following elements (as appropriate):", insert the word
+"further" 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>
+ preconditions, there will be no "Requires" paragraph.</p>
</blockquote>
<p><b>Rationale:</b></p>
<p>The standard is somewhat inconsistent, but a failure to note a
@@ -5105,11 +5639,11 @@ 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#TC">TC</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>
+<a name="223"></a><h3><a name="223">223.&nbsp;reverse algorithm should use iter_swap rather than swap</a></h3><p>
+<b>Section:</b>&nbsp;25.2.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.reverse"> [lib.alg.reverse]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;21 Mar 2000</p>
+<p>Shouldn't the effects say "applies iter_swap to all pairs..."?</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>
+<p>In 25.2.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
@@ -5121,22 +5655,139 @@ footnote.</p>
</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Ed Brey&nbsp; <b>Date:</b>&nbsp;23 Mar 2000</p>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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
+a.clear() has complexity "log(size()) + N". 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>
+7, the complexity of a.clear(), change "log(size()) + N" to
+"linear in <tt>size()</tt>".</p>
<p><b>Rationale:</b></p>
-<p>It's the &quot;log(size())&quot;, not the &quot;N&quot;, that is in
+<p>It's the "log(size())", not the "N", 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="225"><h3>225.&nbsp;std:: algorithms use of other unqualified algorithms</h3></a><p>
+<b>Section:</b>&nbsp;17.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.global.functions"> [lib.global.functions]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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, "I know how to implement a more efficient
+unique_copy for my_iterators", 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 "std::" is sufficient;&nbsp;
+leading "::" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/basic.html#basic.lookup.koenig"> [basic.lookup.koenig]</a>).</p>
+
+<p>[Note: the phrase "unless otherwise specified" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#229">229</a> accordingly. Any resolution of
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a> should be coordinated with the resolution of
+issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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>
+
+<p><i>[Curaçao: An LWG-subgroup spent an afternoon working on issues
+225, 226, and 229. Their conclusion was that the issues should be
+separated into an LWG portion (Howard's paper, N1387=02-0045), and a
+EWG portion (Dave will write a proposal). The LWG and EWG had
+(separate) discussions of this plan the next day. The proposed
+resolution for this issue is in accordance with Howard's paper.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>It could be argued that this proposed isn't strictly necessary,
+ that the Standard doesn't grant implementors license to write a
+ standard function that behaves differently than specified in the
+ Standard just because of an unrelated user-defined name in some
+ other namespace. However, this is at worst a clarification. It is
+ surely right that algorithsm shouldn't pick up random names, that
+ user-defined names should have no effect unless otherwise specified.
+ Issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#226">226</a> deals with the question of when it is
+ appropriate for the standard to explicitly specify otherwise.</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#TC">TC</a>&nbsp; <b>Submitter:</b>&nbsp;Dave Abrahams&nbsp; <b>Date:</b>&nbsp;09 Apr 2000</p>
+<b>Section:</b>&nbsp;25.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.swap"> [lib.alg.swap]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#TC">TC</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>
@@ -5178,16 +5829,16 @@ cut-and-paste from the range version of <tt>erase</tt>.</p>
<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
+<a name="228"><h3>228.&nbsp;Incorrect specification of "..._byname" facets</h3></a><p>
+<b>Section:</b>&nbsp;22.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.categories"> [lib.locale.categories]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kühl&nbsp; <b>Date:</b>&nbsp;20 Apr 2000</p>
+<p>The sections 22.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.byname"> [lib.locale.ctype.byname]</a>, 22.2.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.ctype.byname.special"> [lib.locale.ctype.byname.special]</a>,
+22.2.1.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.byname"> [lib.locale.codecvt.byname]</a>, 22.2.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.numpunct.byname"> [lib.locale.numpunct.byname]</a>, 22.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.collate.byname"> [lib.locale.collate.byname]</a>, 22.2.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.time.put.byname"> [lib.locale.time.put.byname]</a>, 22.2.6.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.moneypunct.byname"> [lib.locale.moneypunct.byname]</a>, and 22.2.7.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.messages.byname"> [lib.locale.messages.byname]</a> overspecify the
+definitions of the "..._byname" 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
+the "..._byname" 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
@@ -5275,7 +5926,7 @@ specialization it is not virtual.</p>
protected:
~time_put_byname(); // virtual
};
- }&quot;</pre>
+ }"</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;
@@ -5300,20 +5951,72 @@ specialization it is not virtual.</p>
~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
+<p>Remove section 22.2.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>[Post-Tokyo: Dietmar Kühl submitted this issue at the request of
+the LWG to solve the underlying problems raised by issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="229"><h3>229.&nbsp;Unqualified references of other library entities</h3></a><p>
+<b>Section:</b>&nbsp;17.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.contents"> [lib.contents]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "Swap" describes the effect of
+swap_ranges in terms of the unqualified name "swap". This section
+could reasonably be interpreted to mean that the library must be implemented so
+as to do a lookup of the unqualified name "swap", 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
+"::std::" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 "Library contents" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#225">225</a>. Any resolution of issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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
+"unless explicitly described otherwise".]</i></p>
+
+<p><i>[Curaçao: An LWG-subgroup spent an afternoon working on issues
+225, 226, and 229. Their conclusion was that the issues should be
+separated into an LWG portion (Howard's paper, N1387=02-0045), and a
+EWG portion (Dave will write a proposal). The LWG and EWG had
+(separate) discussions of this plan the next day. This paper resolves
+issues 225 and 226. In light of that resolution, the proposed
+resolution for the current issue makes sense.]</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
+<b>Section:</b>&nbsp;17 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Beman Dawes&nbsp; <b>Date:</b>&nbsp;26 Apr 2000</p>
+<p>Issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -5321,19 +6024,19 @@ 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>
+specified. For example, 26.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>In 23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a> table 65 for value_type:
+change "T is Assignable" to "T is CopyConstructible and
+Assignable"
</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>In 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a> table 69 X::key_type; change
+"Key is Assignable" to "Key is
+CopyConstructible and Assignable"<br>
</p>
-<p>In 24.1.2 <a href="lib-iterators.html#lib.output.iterators"> [lib.output.iterators]</a> paragraph 1, change:
+<p>In 24.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -5352,7 +6055,7 @@ Table 73:
</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
+the LWG. He asks that the 25.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a> and 25.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -5363,11 +6066,80 @@ 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>
+<a name="231"><h3>231.&nbsp;Precision in iostream?</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "1e+00"; this is what
+<tt>printf("%.0e" , 1.00 );</tt> does. G++ outputs
+"1.000000e+00".</p>
+
+<p>The only indication I can find in the standard is 22.2.2.2.2/11,
+where it says "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."
+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>
+Replace 22.2.2.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>, paragraph 11, with the following
+sentence:
+</p>
+<blockquote>
+For conversion from a floating-point type,
+<tt><i>str</i>.precision()</tt> is specified in the conversion
+specification.
+</blockquote>
+<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 %g.</p>
+<p>Turning to the C standard, a precision of 0 is meaningful
+for %f and %e. For %g, precision 0 is taken to be the same as
+precision 1.</p>
+<p>The proposed resolution has the effect that if neither
+<tt>fixed</tt> nor <tt>scientific</tt> is set we'll be
+specifying a precision of 0, which will be internally
+turned into 1. There's no need to call it out as a special
+case.</p>
+<p>The output of the above program will be "1e+00".</p>
+
+<p><i>[Post-Curaçao: Howard provided improved wording covering the case
+where precision is 0 and mode is %g.]</i></p>
+
+<hr>
+<a name="232"><h3>232.&nbsp;"depends" poorly defined in 17.4.3.1</h3></a><p>
+<b>Section:</b>&nbsp;17.4.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.reserved.names"> [lib.reserved.names]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "depends" to limit the set of allowed
+specializations of standard templates to those that "depend on a
+user-defined name of external linkage."</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
@@ -5385,8 +6157,8 @@ construct a specialization that is, I believe, technically legal according to
}</pre>
</blockquote>
<p><b>Proposed resolution:</b></p>
-<p>Change &quot;user-defined name&quot; to &quot;user-defined
-type&quot;.</p>
+<p>Change "user-defined name" to "user-defined
+type".</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,
@@ -5396,26 +6168,26 @@ 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>[Toronto: this may be related to issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;20.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.members"> [lib.allocator.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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>
+<p>Substitute "Returns" by "Effect".</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>
+<b>Section:</b>&nbsp;24.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iterator"> [lib.reverse.iterator]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
+ <p>In section 24.4.1.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.reverse.iter.cons"> [lib.reverse.iter.cons]</a> add the following
paragraph:</p>
<blockquote>
<p><tt>reverse_iterator()</tt></p>
@@ -5429,7 +6201,7 @@ should do.</p>
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>
+<b>Section:</b>&nbsp;23.2.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.cons"> [lib.list.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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
@@ -5441,14 +6213,13 @@ would have to be <tt>last - first</tt>.</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>
+<b>Section:</b>&nbsp;27.7.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.cons"> [lib.stringbuf.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Dietmar Kü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> std::basic_stringbuf&lt;char&gt; sbuf("hello, world", std::ios_base::openmode(0));
+ std::cout &lt;&lt; "'" &lt;&lt; sbuf.str() &lt;&lt; "'\n";
</pre>
<p>Paragraph 3 of 27.7.1.1 basically says that in this case neither
@@ -5459,7 +6230,7 @@ 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>
+"problem"...</p>
<p><b>Proposed resolution:</b></p>
<p>Remove 27.7.1.1 paragraph 4.</p>
<p><b>Rationale:</b></p>
@@ -5468,7 +6239,7 @@ we fixed it, it would say just the same thing as text that's already
in the standard.</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<b>Section:</b>&nbsp;25.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -5495,19 +6266,18 @@ 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>
+<p>Change both complexity sections in 25.2.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Angelika Langer&nbsp; <b>Date:</b>&nbsp;May 15 2000</p>
+<b>Section:</b>&nbsp;25.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.adjacent.find"> [lib.alg.adjacent.find]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;
+<pre>template &lt;class ForwardIterator&gt;
ForwardIterator adjacent_find(ForwardIterator first, ForwardIterator last
BinaryPredicate pred);
</pre>
@@ -5522,8 +6292,8 @@ 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
+<p>In the Complexity section, it is not defined what "value"
+is supposed to mean. My best guess is that "value" 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
@@ -5536,9 +6306,9 @@ 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>
+an "as-if" 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>
+<p>Change the complexity section in 25.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -5550,13 +6320,68 @@ return value.
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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.unique"> [lib.alg.unique]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+ <p>-4- Requires: The ranges [first, last) and [result,
+ result+(last-first)) shall not overlap. The expression *result =
+ *first must be valid. If neither InputIterator nor OutputIterator
+ meets the requirements of forward iterator then the value type of
+ InputIterator must be copy constructible. Otherwise copy
+ constructible is not required. </p>
+</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>
+
+<p><i>[
+Curaçao: The LWG changed the PR editorially to specify
+"neither...nor...meet..." as clearer than
+"both...and...do not meet...". Change believed to be so
+minor as not to require re-review.
+]</i></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>
+<b>Section:</b>&nbsp;25.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.transform"> [lib.alg.transform]</a>, 26.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.numeric.ops"> [lib.numeric.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
+<p>The standard defines a side effect in 1.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -5598,7 +6423,7 @@ a defect.</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
+<li> <i>The fully-closed ("[]" as opposed to half-closed "[)" ranges
are intentional. we want to prevent side-effects from
invalidating the end iterators.</i>
</li>
@@ -5730,43 +6555,43 @@ 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>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+<p>27.6.1.3, p1 states that "... 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
+to obtain the requested input..." 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
+"... In any case, it then stores a null character (using
+charT()) into the next successive location of the array." 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;
+"... If the sentry object returns true, when converted to a value of
+type bool, the function endeavors to obtain the requested input."
</blockquote>
<p>the following</p>
<blockquote>
-&quot;Otherwise, if the sentry constructor exits by throwing an exception or
+"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;
+of the array."
</blockquote>
<p><b>Rationale:</b></p>
<p>Although the general philosophy of the input functions is that the
@@ -5777,8 +6602,8 @@ 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>
+<a name="248"></a><h3><a name="248">248.&nbsp;time_get fails to set eofbit</a></h3><p>
+<b>Section:</b>&nbsp;22.2.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.category.time"> [lib.category.time]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -5797,12 +6622,11 @@ 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>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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> 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>.
@@ -5815,14 +6639,14 @@ 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>
+<p>Add a footnote to 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+[<i>Footnote:</i> As specified in 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -5831,7 +6655,7 @@ 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>
+<p>In 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -5841,7 +6665,7 @@ to refer to this same element but as a member of *this. Iterators to *i
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>
+<p>In 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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).
@@ -5854,13 +6678,13 @@ iterators into *this, not into x.
<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
+would remain "valid". 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
+From 20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<b>Section:</b>&nbsp;27.7.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf"> [lib.stringbuf]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -5871,12 +6695,11 @@ template classes in the library that do provide a typedef for the
<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> 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>
+<b>Section:</b>&nbsp;27.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.string.streams"> [lib.string.streams]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -5912,7 +6735,7 @@ issue is stylistic rather than a matter of correctness.</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>
+<b>Section:</b>&nbsp;27.4.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.members"> [lib.basic.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -5932,7 +6755,7 @@ copyfmt_event.
<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>
+<b>Section:</b>&nbsp;21.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.access"> [lib.string.access]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -5943,21 +6766,21 @@ 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
+The standard (21.3.4/1) says that "If <tt>pos &lt; size()</tt>,
+returns <tt>data()[pos]</tt>." 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;.
+"<tt>data()[<i>pos</i>]</tt>" to "<tt>*(begin() +
+<i>pos</i>)</tt>".
</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>
+<b>Section:</b>&nbsp;24.5.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istream.iterator.ops"> [lib.istream.iterator.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -5965,24 +6788,21 @@ 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> 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> 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>
+<a name="261"></a><h3><a name="261">261.&nbsp;Missing description of <tt>istream_iterator::operator!=</tt>
+</a></h3><p>
+<b>Section:</b>&nbsp;24.5.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.istream.iterator.ops"> [lib.istream.iterator.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;
+<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>
@@ -5996,16 +6816,15 @@ or Returns clause) in 24.5.1.2.
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;
+<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>
+<a name="262"></a><h3><a name="262">262.&nbsp;Bitmask operator ~ specified incorrectly</a></h3><p>
+<b>Section:</b>&nbsp;17.3.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -6014,8 +6833,7 @@ The ~ operation should be applied after the cast to int_type.
Change 17.3.2.1.2 [lib.bitmask.types] operator~ from:
</p>
-<pre>
- bitmask operator~ ( bitmask X )
+<pre> bitmask operator~ ( bitmask X )
{ return static_cast&lt; bitmask&gt;(static_cast&lt;int_type&gt;(~ X)); }
</pre>
@@ -6023,18 +6841,17 @@ Change 17.3.2.1.2 [lib.bitmask.types] operator~ from:
to:
</p>
-<pre>
- bitmask operator~ ( bitmask X )
+<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>
+<b>Section:</b>&nbsp;21.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.basic.string"> [lib.basic.string]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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).
+a "reference counted implementation", but this is a minor editorial fix).
</p>
<p>
@@ -6043,9 +6860,8 @@ 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;
+<pre> // first example: "*******************" should be printed twice
+ string original = "some arbitrary text", copy = original;
const string &amp; alias = original;
string::const_iterator i = alias.begin(), e = alias.end();
@@ -6061,9 +6877,8 @@ conditions for iterator invalidation are satisfied:
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;
+<pre> // second example: "some arbitrary text" should be printed out
+ string original = "some arbitrary text", copy = original;
const string &amp; alias = original;
string::const_iterator i = alias.begin();
@@ -6075,7 +6890,7 @@ Similarly, in the following example:
<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
+"surprising behavior" 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
@@ -6102,21 +6917,21 @@ Change the following sentence in 21.3 paragraph 5 from
</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>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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><i>Related issue: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+insertion of a range from "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;.
+value_comp()" to "N log(size() + N), where N is the distance
+from i to j".
</p>
<p><i>[Copenhagen: Minor fix in proposed resolution: fixed unbalanced
@@ -6142,7 +6957,7 @@ 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>
+<b>Section:</b>&nbsp;20.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.pairs"> [lib.pairs]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6180,7 +6995,7 @@ 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>
+<b>Section:</b>&nbsp;18.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.bad.exception"> [lib.bad.exception]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6189,10 +7004,10 @@ clause is missing).
<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>).
+<tt>bad_alloc</tt> (18.4.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.bad.alloc"> [lib.bad.alloc]</a>),
+<tt>bad_cast</tt> (18.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.bad.cast"> [lib.bad.cast]</a>),
+<tt>bad_typeid</tt> (18.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.bad.typeid"> [lib.bad.typeid]</a>),
+and <tt>bad_exception</tt> (18.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.bad.exception"> [lib.bad.exception]</a>).
</p>
<p><b>Rationale:</b></p>
<p>
@@ -6204,7 +7019,7 @@ 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>
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;)
@@ -6212,22 +7027,20 @@ are missing.</p>
<p><b>Proposed resolution:</b></p>
<p>Add the missing semicolons, i.e., change</p>
-<pre>
- // construct/copy/destroy:
+<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:
+<pre> // construct/copy/destroy:
locale() throw();
locale(const locale&amp; other) throw();
</pre>
<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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;18 Oct 2000</p>
+<b>Section:</b>&nbsp;25.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.binary.search"> [lib.alg.binary.search]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6242,8 +7055,7 @@ 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 {
+<pre> struct key_comp {
bool operator()(const X&amp; x, int n) const {
return x.key() &lt; n;
}
@@ -6297,8 +7109,8 @@ 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
+David Abrahams at the meeting, "Binary Search with Heterogeneous
+Comparison", 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
@@ -6436,8 +7248,7 @@ The proposed resolution is based on that alternative formulation.</li>
<p>to:</p>
-<pre>
- -2- Returns:
+<pre> -2- Returns:
make_pair(lower_bound(first, last, value),
upper_bound(first, last, value))
or
@@ -6464,9 +7275,9 @@ The proposed resolution is based on that alternative formulation.</li>
<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><i>[Redmond: Minor changes in wording. (Removed "non-negative", and
+changed the "other than those described in" wording.) Also, the LWG
+decided to accept the "optional" part.]</i></p>
<p><b>Rationale:</b></p>
<p>The proposed resolution reinterprets binary search. Instead of
@@ -6480,7 +7291,7 @@ 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="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>
+<b>Section:</b>&nbsp;27.6.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostreamclass"> [lib.iostreamclass]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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)
@@ -6489,10 +7300,9 @@ basic_iostream&lt;T&gt;::traits_type is ambiguous.
<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>
+27.6.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostreamclass"> [lib.iostreamclass]</a>, immediately after <tt>public</tt>:</p>
-<pre>
- // types:
+<pre> // types:
typedef charT char_type;
typedef typename traits::int_type int_type;
typedef typename traits::pos_type pos_type;
@@ -6501,7 +7311,7 @@ basic_iostream&lt;T&gt;::traits_type is ambiguous.
</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>
+<b>Section:</b>&nbsp;27.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.iostate.flags"> [lib.iostate.flags]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6519,7 +7329,7 @@ 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>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6529,7 +7339,7 @@ class (14.6.2 [temp.dep]) and thus not visible.</p>
members, i.e., ios_base.</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;02 Nov 2000</p>
+<b>Section:</b>&nbsp;20.1.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.allocator.requirements"> [lib.allocator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6562,8 +7372,8 @@ provided.
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><i>[Redmond: previous proposed resolution was "any non-const,
+non-volatile, non-reference type". Got rid of the "non-volatile".]</i></p>
<p><b>Rationale:</b></p>
<p>
@@ -6580,12 +7390,12 @@ The original text for proposed resolution 2 was modified so that it
also forbids volatile types and reference types.
</p>
-<p><i>[Cura&ccedil;ao: LWG double checked and believes volatile is correctly
+<p><i>[Curaçao: LWG double checked and believes volatile is correctly
excluded from the PR.]</i></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>
+<b>Section:</b>&nbsp;22.2.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.members"> [lib.facet.num.get.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6624,22 +7434,20 @@ These two lists are not identical. They should be, since
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,
+<p>In 22.2.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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,
+<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="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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Peter Dimov&nbsp; <b>Date:</b>&nbsp;07 Nov 2000</p>
+<b>Section:</b>&nbsp;23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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,
+Assignable. 23.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
@@ -6648,8 +7456,8 @@ that is not Assignable.
<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
+mentioning value_type, referring instead to "objects stored in a
+container." 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.
@@ -6663,14 +7471,14 @@ general.
<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
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -6693,8 +7501,8 @@ 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.1, Table 65: in the first row, change "T is Assignable" to "T is
+CopyConstructible".</p>
<p>23.2.1/2: Add sentence for Assignable requirement. Change to:</p>
@@ -6730,8 +7538,7 @@ 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 );
+<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);
@@ -6767,11 +7574,11 @@ 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-defects.html#274">274</a>
+example, such types as "const int". See issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#274">274</a>
for more details.
</p>
-<p>In principle we could also relax the &quot;Assignable&quot; requirement for
+<p>In principle we could also relax the "Assignable" 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
@@ -6779,11 +7586,66 @@ 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "invalidate"? 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#250">250</a>,
+then we'd better clarify that a "valid" 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 "validity."
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Add the following text to the end of section 24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p><b>Rationale:</b></p>
+<p>This resolution simply defines a term that the Standard uses but
+ never defines, "invalid", in terms of a term that is defined,
+ "singular".</p>
+
+<p>Why do we say "may be singular", instead of "is singular"? That's
+ becuase a valid iterator is one that is known to be nonsingular.
+ Invalidating an iterator means changing it in such a way that it's
+ no longer known to be nonsingular. An example: inserting an
+ element into the middle of a vector is correctly said to invalidate
+ all iterators pointing into the vector. That doesn't necessarily
+ mean they all become singular.</p>
+<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>
+<b>Section:</b>&nbsp;25.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.min.max"> [lib.alg.min.max]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>).
+requirements of <tt>LessThanComparable</tt> (20.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.lessthancomparable"> [lib.lessthancomparable]</a>)
+and <tt>CopyConstructible</tt> (20.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
@@ -6793,32 +7655,76 @@ is unnecessary.
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>).
+(20.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>).
+(20.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.lessthancomparable"> [lib.lessthancomparable]</a>).
</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.put.virtuals"> [lib.facet.num.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 "C" 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>
+
+<p><i>[Post-Curaçao: the above proposed resolution is the consensus of
+Howard, Bill, Pete, Benjamin, Nathan, Dietmar, Boris, and Martin.]</i></p>
+
+<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#DR">DR</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
+<b>Section:</b>&nbsp;20.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.function.pointer.adaptors"> [lib.function.pointer.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+functions have <tt>extern "C"</tt> or <tt>extern
+"C++"</tt> linkage [17.4.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+(7.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>Change 20.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> replace_if(v.begin(), v.end(), not1(bind2nd(ptr_fun(strcmp), "C")), "C++");
</pre>
<p>replaces each <tt>C</tt> with <tt>C++</tt> in sequence <tt>v</tt>.</p>
</blockquote>
@@ -6828,10 +7734,9 @@ well-formed is unspecified.
<blockquote>
<p>[<i>Example:</i>
</p>
- <pre>
- int compare(const char*, const char*);
+ <pre> int compare(const char*, const char*);
replace_if(v.begin(), v.end(),
- not1(bind2nd(ptr_fun(compare), &quot;abc&quot;)), &quot;def&quot;);
+ not1(bind2nd(ptr_fun(compare), "abc")), "def");
</pre>
<p>replaces each <tt>abc</tt> with <tt>def</tt> in sequence <tt>v</tt>.</p>
</blockquote>
@@ -6840,7 +7745,7 @@ well-formed is unspecified.
<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;.
+confusing for the strings in the example to be "C" and "C++".
]</i></p>
<p><i>[Redmond: More minor changes. Got rid of the footnote (which
@@ -6850,9 +7755,9 @@ it corresponds to the new code fragment.]</i></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:
+<b>Section:</b>&nbsp;27.8.1.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ifstream.cons"> [lib.ifstream.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;31 Dec 2000</p>
+<p>27.8.1.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ifstream.cons"> [lib.ifstream.cons]</a>, p2, 27.8.1.9 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ofstream.cons"> [lib.ofstream.cons]</a>, p2, and
+27.8.1.12 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -6860,7 +7765,7 @@ it corresponds to the new code fragment.]</i></p>
</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
+exception due to the requirement in 27.4.4.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -6870,7 +7775,7 @@ 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>
+<b>Section:</b>&nbsp;25.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.c.library"> [lib.alg.c.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6887,11 +7792,11 @@ the type size_t &lt;cstdlib&gt; to Table 97 (section C.2).
<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>
+<b>Section:</b>&nbsp;19.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-diagnostics.html#lib.errno"> [lib.errno]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+ISO/IEC 9899:1990/Amendment1:1994 Section 4.3 States: "The list
of macros defined in &lt;errno.h&gt; is adjusted to include a new
-macro, EILSEQ&quot;
+macro, EILSEQ"
</p>
<p>
@@ -6901,12 +7806,12 @@ to the above amendment.
<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.
+Update Table 26 (section 19.3) "Header &lt;cerrno&gt; synopsis"
+and Table 95 (section C.2) "Standard Macros" 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>
+<b>Section:</b>&nbsp;27.4.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.basic.ios.members"> [lib.basic.ios.members]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6935,7 +7840,7 @@ 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>
+<b>Section:</b>&nbsp;26.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.c.math"> [lib.c.math]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -6945,7 +7850,7 @@ of <tt>abs()</tt> should be defined in &lt;cmath&gt;.
<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>,
+of functions "(abs(), div(), rand(), srand())" from 26.5 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-numerics.html#lib.c.math"> [lib.c.math]</a>,
paragraph 1.
</p>
@@ -6956,10 +7861,10 @@ rid of that vestigial list of functions in paragraph 1.]</i></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>
+putting in &lt;cstdlib&gt;. That's issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-closed.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>
+<b>Section:</b>&nbsp;20.3.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.member.pointer.adaptors"> [lib.member.pointer.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7036,7 +7941,7 @@ binary_function&lt;<b>const</b> T*, A, S&gt; {</tt>
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>
+<b>Section:</b>&nbsp;18.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7059,7 +7964,7 @@ For a null value of <i><tt>ptr</tt></i> , does nothing.
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>).
+call to <tt>operator delete[](void*)</tt> (17.4.3.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
@@ -7076,8 +7981,56 @@ or <tt>operator delete(<i>ptr</i>, std::nothrow)</tt> respectively.
</blockquote>
<p>and expunge paragraph 13.</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;John Pedretti&nbsp; <b>Date:</b>&nbsp;23 Jan 2001</p>
+<p>
+The "Effects" 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>In 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, replace paragraps 23-25 with:</p>
+<blockquote>
+<p>
+23 Effects: if (&amp;x == this) does nothing; otherwise, merges the two
+sorted ranges [begin(), end()) and [x.begin(), x.end()). The result
+is a range in which the elements will be sorted in non-decreasing
+order according to the ordering defined by comp; that is, for every
+iterator i in the range other than the first, the condition comp(*i,
+*(i - 1)) will be false.
+</p>
+
+<p>
+24 Notes: Stable: if (&amp;x != this), then for equivalent elements in the
+two original ranges, the elements from the original range [begin(),
+end()) always precede the elements from the original range [x.begin(),
+x.end()). If (&amp;x != this) the range [x.begin(), x.end()) is empty
+after the merge.
+</p>
+
+<p>
+25 Complexity: At most size() + x.size() - 1 applications of comp if
+(&amp;x ! = this); otherwise, no applications of comp are performed. If
+an exception is thrown other than by a comparison there are no
+effects.
+</p>
+
+</blockquote>
+
+<p><i>[Copenhagen: The original proposed resolution did not fix all of
+the problems in 23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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, "merges the argument list into the
+list" is excessively vague.]</i></p>
+
+<p><i>[Post-Curaçao: Robert Klarer provided new wording.]</i></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>
+<b>Section:</b>&nbsp;21.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.string.cons"> [lib.string.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7107,11 +8060,11 @@ a mistake.
</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>
+<b>Section:</b>&nbsp;23.3.5.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.bitset.operators"> [lib.bitset.operators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+"Extracts up to <i>N</i> (single-byte) characters from
+<i>is</i>.", where <i>is</i> is a stream of type
<tt>basic_istream&lt;charT, traits&gt;</tt>.
</p>
@@ -7212,26 +8165,139 @@ 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="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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+"C" 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 JIS, for
+example, and it would rule out a fixed-width encoding of UCS-4.</p>
+
+<p><i>[Curaçao: fixed rationale typo at the request of Ichiro Koshida;
+"shift-JIS" changed to "JIS".]</i></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>
+<b>Section:</b>&nbsp;18.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.support.types"> [lib.support.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
+<p>18.1, paragraph 5, reads: "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>
+undefined."</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.
+<p>For the POD requirement, it doesn't say "no diagnostic
+required" or "undefined behavior". I read 1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>Change 18.1, paragraph 5, to "If <i>type</i> is not a POD
+structure or a POD union the results are undefined."</p>
<p><i>[Copenhagen: straw poll was 7-4 in favor. It was generally
agreed that requiring a diagnostic was inadvertent, but some LWG
@@ -7240,13 +8306,13 @@ 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>
+<b>Section:</b>&nbsp;23.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.adaptors"> [lib.container.adaptors]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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.
+The standard is currently inconsistent in 23.2.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.priority.queue"> [lib.priority.queue]</a>
+paragraph 1 and 23.2.3.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.stack"> [lib.stack]</a> paragraph 1.
23.2.3.3/1, for example, says:
</p>
@@ -7272,7 +8338,7 @@ container's reference type.</p>
<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
+later (see issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
@@ -7281,14 +8347,13 @@ does not break any code.
<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>
+priority_queue and stack. Change return types of "value_type&amp;" to
+"reference". Change return types of "const value_type&amp;" to
+"const_reference". Details:</p>
<p>Change 23.2.3.1/1 from:</p>
-<pre>
- namespace std {
+<pre> namespace std {
template &lt;class T, class Container = deque&lt;T&gt; &gt;
class queue {
public:
@@ -7314,8 +8379,7 @@ priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
<p>to:</p>
-<pre>
- namespace std {
+<pre> namespace std {
template &lt;class T, class Container = deque&lt;T&gt; &gt;
class queue {
public:
@@ -7344,8 +8408,7 @@ priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
<p>Change 23.2.3.2/1 from:</p>
-<pre>
- namespace std {
+<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 {
@@ -7377,8 +8440,7 @@ priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
<p>to:</p>
-<pre>
- namespace std {
+<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 {
@@ -7412,8 +8474,7 @@ priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
<p>And change 23.2.3.3/1 from:</p>
-<pre>
- namespace std {
+<pre> namespace std {
template &lt;class T, class Container = deque&lt;T&gt; &gt;
class stack {
public:
@@ -7457,8 +8518,7 @@ priority_queue and stack. Change return types of &quot;value_type&amp;&quot; to
<p>to:</p>
-<pre>
- namespace std {
+<pre> namespace std {
template &lt;class T, class Container = deque&lt;T&gt; &gt;
class stack {
public:
@@ -7508,14 +8568,14 @@ and it was deliberately not adopted. Nevertheless, the LWG believes
<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>
+<b>Section:</b>&nbsp;27 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.input.output"> [lib.input.output]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+streams (27.7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+subclauses. According to 17.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -7525,11 +8585,11 @@ 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>
+section 27.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.file.streams"> [lib.file.streams]</a>, including 27.8.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.c.files"> [lib.c.files]</a>.]</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Steve Clamage&nbsp; <b>Date:</b>&nbsp;21 Mar 2001</p>
+<b>Section:</b>&nbsp;17.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.headers"> [lib.headers]</a>, 19.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-diagnostics.html#lib.errno"> [lib.errno]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -7539,7 +8599,7 @@ section 27.8 <a href="lib-iostreams.html#lib.file.streams"> [lib.file.streams]</
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
+ function call, but is an extern int otherwise. "Unspecified" allows
such variability.)
</p>
@@ -7613,16 +8673,15 @@ not a name is a macro; it must explicitly specify exactly which names
are required to be macros. The only one that really works is for it
to be a macro.</p>
-<p><i>[Cura&ccedil;ao: additional rationale added.]</i></p>
+<p><i>[Curaçao: additional rationale added.]</i></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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;21 Mar 2001</p>
+<b>Section:</b>&nbsp;27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream"> [lib.ostream]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
+<p>In 27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream"> [lib.ostream]</a>, the synopsis of class basic_ostream says:</p>
-<pre>
- // partial specializationss
+<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 * );
@@ -7630,51 +8689,51 @@ to be a macro.</p>
<p>Problems:</p>
<ul>
-<li>Too many 's's at the end of &quot;specializationss&quot; </li>
+<li>Too many 's's at the end of "specializationss" </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
+<p>In the synopsis in 27.6.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>.
+27.6.2.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+Pre-Redmond: added 27.6.2.5.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="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>
+<a name="312"></a><h3><a name="312">312.&nbsp;Table 27 is missing headers</a></h3><p>
+<b>Section:</b>&nbsp;20 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-utilities.html#lib.utilities"> [lib.utilities]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
+&lt;cstdlib&gt; and &lt;cstring&gt; that are discussed in 20.4.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
<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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;1 May 2001</p>
+<a name="315"><h3>315.&nbsp;Bad "range" in list::unique complexity</h3></a><p>
+<b>Section:</b>&nbsp;23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+23.2.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.ops"> [lib.list.ops]</a>, Para 21 describes the complexity of
+list::unique as: "If the range (last - first) is not empty, exactly
(last - first) -1 applications of the corresponding predicate,
-otherwise no applications of the predicate)&quot;.
+otherwise no applications of the predicate)".
</p>
<p>
-&quot;(last - first)&quot; is not a range.
+"(last - first)" is not a range.
</p>
<p><b>Proposed resolution:</b></p>
<p>
-Change the &quot;range&quot; from (last - first) to [first, last).
+Change the "range" 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;4 May 2001</p>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>
@@ -7695,7 +8754,7 @@ 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;4 May 2001</p>
+<b>Section:</b>&nbsp;22 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.localization"> [lib.localization]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7745,12 +8804,11 @@ 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 May 2001</p>
+<b>Section:</b>&nbsp;22.2.3.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.numpunct.byname"> [lib.locale.numpunct.byname]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 {
+<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.
@@ -7762,24 +8820,24 @@ 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>
+resolution of library issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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#DR">DR</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>
+<a name="319"></a><h3><a name="319">319.&nbsp;Storage allocation wording confuses "Required behavior", "Requires"</a></h3><p>
+<b>Section:</b>&nbsp;18.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.single"> [lib.new.delete.single]</a>, 18.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.new.delete.array"> [lib.new.delete.array]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> that "Required
+behavior" elements describe "the semantics of a function definition
+provided by either the implementation or a C++ program."</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>The standard specifies 17.3.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.structure.specifications"> [lib.structure.specifications]</a> that "Requires"
+elements describe "the preconditions for calling the function."</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>
+"Required Behavior" for what are actually preconditions, and thus
+should be specified as "Requires".</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>
+<p>In 18.4.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -7790,7 +8848,7 @@ should be specified as &quot;Requires&quot;.</p>
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>
+<p>In 18.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
@@ -7802,24 +8860,108 @@ should be specified as &quot;Requires&quot;.</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.list.cons"> [lib.list.cons]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "effects" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.sequence.reqmts"> [lib.sequence.reqmts]</a>, in Table 67 (sequence requirements),
+add two new rows:</p>
+<pre> a.assign(i,j) void pre: i,j are not iterators into a.
+ Replaces elements in a with a copy
+ of [i, j).
+
+ a.assign(n,t) void pre: t is not a reference into a.
+ Replaces elements in a with n copies
+ of t.
+</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. Howard provided wording.
+]</i></p>
+
+<p><i>[Curaçao: Made editorial improvement in wording; changed
+"Replaces elements in a with copies of elements in [i, j)."
+with "Replaces the elements of a with a copy of [i, j)."
+Changes not deemed serious enough to requre rereview.]</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Kevin Djang&nbsp; <b>Date:</b>&nbsp;17 May 2001</p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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;.
+Section 22.2.2.1.2 at p7 states that "A length specifier is added to
+the conversion function, if needed, as indicated in Table 56."
+However, Table 56 uses the term "length modifier", not "length
+specifier".
</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;
+In 22.2.2.1.2 at p7, change the text "A length specifier is added ..."
+to be "A length modifier is added ..."
</p>
<p><b>Rationale:</b></p>
-<p>C uses the term &quot;length modifier&quot;. We should be consistent.</p>
+<p>C uses the term "length modifier". 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Matt Austern&nbsp; <b>Date:</b>&nbsp;17 May 2001</p>
+<b>Section:</b>&nbsp;23.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.container.requirements"> [lib.container.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7827,16 +8969,16 @@ 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;.
+iterator_traits&lt;X::const_iterator&gt;::value_type should be "const
+X::value_type".
</p>
-<p>Related issue: <a href="lwg-closed.html#279">279</a>.</p>
+<p>Related issue: <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>In Table 65 ("Container Requirements"), change the return type for
+X::iterator to "iterator type whose value type is T". Change the
+return type for X::const_iterator to "constant iterator type whose
+value type is T".</p>
<p><b>Rationale:</b></p>
<p>
This belongs as a container requirement, rather than an iterator
@@ -7846,13 +8988,186 @@ pairs is specific to containers' iterator.
<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
+is "int", rather than "const int". 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="324"><h3>324.&nbsp;Do output iterators have value types?</h3></a><p>
+<b>Section:</b>&nbsp;24.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.output.iterators"> [lib.output.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "*a = t". Additionally, although Table 73
+never lists "a = t" or "X(a) = t" in the "expressions" column, it
+contains a note saying that "a = t" and "X(a) = t" have equivalent
+(but nowhere specified!) semantics.</p>
+
+<p>According to 24.1/9, t is supposed to be "a value of value type
+T":</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 "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".</li>
+
+ <li>
+ 24.3.1/1, which says "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."
+ </li>
+</ul>
+
+<p>The first of these passages suggests that "*i" is supposed to
+return a useful value, which contradicts the note in 24.1.2/2 saying
+that the only valid use of "*i" for output iterators is in an
+expression of the form "*i = t". The second of these passages appears
+to contradict Table 73, because it suggests that "*i"'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 "*i = t"? 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 iterator.</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.moneypunct.virtuals"> [lib.locale.moneypunct.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "\003" (not "3").
+</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 "\003", which contradicts the C standard which
+specifies the value of "" 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 "\003", not "3".
+</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 "C" 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Tiki Wan&nbsp; <b>Date:</b>&nbsp;06 Jul 2001</p>
+<b>Section:</b>&nbsp;22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -7861,14 +9176,12 @@ 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;
+22.1.1.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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;
+<pre> time_get&lt;wchar_t, InputIterator&gt;
time_get_byname&lt;wchar_t, InputIterator&gt;
</pre>
@@ -7877,30 +9190,110 @@ 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#DR">DR</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
+<b>Section:</b>&nbsp;22.2.6.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.money.put.virtuals"> [lib.locale.money.put.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;07 Jul 2001</p>
+<p>The sprintf format string , "%.01f" (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
+"%.0Lf"., 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>Change the format string to "%.0Lf".</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>, 23.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.modifiers"> [lib.vector.modifiers]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a> and
+section 23.2.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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
+"after the most recent call to reserve()" 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;PremAnand M. Rao&nbsp; <b>Date:</b>&nbsp;23 Aug 2001</p>
+<b>Section:</b>&nbsp;27.4.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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>)
+With the change in 17.4.4.8 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.res.on.exception.handling"> [lib.res.on.exception.handling]</a> to state
+ "An implementation may strengthen the exception-specification for a
+ non-virtual function by removing listed exceptions."
+(issue <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#119">119</a>)
and the following declaration of ~failure() in ios_base::failure
</p>
-<pre>
- namespace std {
+<pre> namespace std {
class ios_base::failure : public exception {
public:
...
@@ -7909,10 +9302,9 @@ and the following declaration of ~failure() in ios_base::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
+<p>the class failure cannot be implemented since in 18.6.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.exception"> [lib.exception]</a> the destructor of class exception has an empty
exception specification:</p>
-<pre>
- namespace std {
+<pre> namespace std {
class exception {
public:
...
@@ -7927,14 +9319,157 @@ exception specification:</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.manip"> [lib.ostream.manip]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 "file" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.map.access"> [lib.map.access]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#98">98</a> for a similar problem.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>
+This is the second solution described above; as noted, it is
+consistent with existing practice.
+</p>
+
+<p>Note that we now need to specify the complexity explicitly, because
+we are no longer defining <tt>operator[]</tt> in terms of
+<tt>insert</tt>.</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Andy Sawyer&nbsp; <b>Date:</b>&nbsp;06 Sep 2001</p>
+<b>Section:</b>&nbsp;21.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.char.traits.require"> [lib.char.traits.require]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+Table 37, in 21.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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> X::assign(c,d) assigns c = d.
</pre>
<p>And para 1 says:</p>
@@ -7951,8 +9486,7 @@ assign, at least), 'c' is intended to be a reference type.
<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> assign( charT&amp;, const charT&amp; );
</pre>
<p>(or the equivalent). It's also described this way in Nico's book.
@@ -7966,35 +9500,311 @@ and char_traits&lt;wchar_t&gt; in 21.1.3.2...)
</blockquote>
<p>and change the description of assign in the table to:</p>
-<pre>
- X::assign(r,d) assigns r = d
+<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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.library"> [lib.library]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>To 17.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.headers"> [lib.headers]</a> Table 11, C++ Library Headers, add
+"&lt;strstream&gt;".</p>
+
+<p>In the following places, change "clauses 17 through 27" to "clauses
+17 through 27 and Annex D":</p>
+
+<ul>
+<li>1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/intro.html#intro.refs"> [intro.refs]</a> Normative references/1/footnote 1</li>
+<li>1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/intro.html#intro.defs"> [intro.defs]</a> Definitions/1</li>
+<li>7 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/dcl.html#dcl.dcl"> [dcl.dcl]</a> Library introduction/9</li>
+<li>17.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.description"> [lib.description]</a> Method of description (Informative)/1</li>
+<li>17.3.2.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.character.seq"> [lib.character.seq]</a> Character sequences/1/bullet 2</li>
+<li>17.3.2.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.functions.within.classes"> [lib.functions.within.classes]</a> Functions within classes/1</li>
+<li>17.3.2.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.objects.within.classes"> [lib.objects.within.classes]</a> Private members/1/(2 places)</li>
+<li>17.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.requirements"> [lib.requirements]</a> Library-wide requirements/1</li>
+<li>17.4.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.headers"> [lib.headers]</a> Headers/4</li>
+<li>17.4.3.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.replacement.functions"> [lib.replacement.functions]</a> Replacement functions/1</li>
+<li>17.4.4.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.global.functions"> [lib.global.functions]</a> Global or non-member functions/2</li>
+<li>17.4.4.6 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.protection.within.classes"> [lib.protection.within.classes]</a> Protection within classes/1</li>
+</ul>
+
+
+<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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Detlef Vollmann&nbsp; <b>Date:</b>&nbsp;07 Sep 2001</p>
+<b>Section:</b>&nbsp;25.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-algorithms.html#lib.alg.replace"> [lib.alg.replace]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+In section 25.2.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 "InputIterator"
+instead of "Iterator". According to 17.3.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.categories"> [lib.locale.categories]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.html#221">221</a>) it seems clear that no whitespace is allowed
+within a number, but 22.2.3.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lex.html#lex.icon"> [lex.icon]</a>, that of floating-point-literals in 2.13.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>. The proposed
+resolution removes all mention of "whitespace" 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.category.ctype"> [lib.category.ctype]</a>, 17.3.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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 <b><i>T</i></b> 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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-intro.html#lib.bitmask.types"> [lib.bitmask.types]</a>).</p>
+</blockquote>
+
+<p><i>[Curaçao: The LWG notes that T above should be bold-italics to be
+consistent with the rest of the standard.]</i></p>
+
+<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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.category"> [lib.locale.category]</a>, paragraph 3, change
+"that is a member of a standard category" to "shown in Table 51".</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.vector.capacity"> [lib.vector.capacity]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-defects.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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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.
+</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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Clark Nelson&nbsp; <b>Date:</b>&nbsp;19 Oct 2001</p>
+<b>Section:</b>&nbsp;21.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.c.strings"> [lib.c.strings]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
+declares struct tm as an incomplete type. However, table 48 in 21.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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>
+<p>In section 21.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-strings.html#lib.c.strings"> [lib.c.strings]</a>, add "tm" 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#DR">DR</a>&nbsp; <b>Submitter:</b>&nbsp;Jeremy Siek&nbsp; <b>Date:</b>&nbsp;20 Oct 2001</p>
+<b>Section:</b>&nbsp;24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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
@@ -8006,37 +9816,437 @@ are suggested to make this explicit.</p>
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 24.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.iterator.requirements"> [lib.iterator.requirements]</a> Change the first section of p9 from
+"In the following sections, a and b denote values of X..." to
+"In the following sections, a and b denote values of type const X...".</p>
<p>In Table 73, change</p>
-<pre>
- a-&gt;m U&amp; ...
+<pre> a-&gt;m U&amp; ...
</pre>
<p>to</p>
-<pre>
- a-&gt;m const U&amp; ...
+<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> *a = t
</pre>
<p>to</p>
-<pre>
- *r = t
+<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="349"><h3>349.&nbsp;Minor typographical error in ostream_iterator</h3></a><p>
+<b>Section:</b>&nbsp;24.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.ostream.iterator"> [lib.ostream.iterator]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</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 "exposition only", I suspect 'delim'
+should be of type 'const charT*'.</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+In 24.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/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="354"><h3>354.&nbsp;Associative container lower/upper bound requirements</h3></a><p>
+<b>Section:</b>&nbsp;23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Hans Aberg&nbsp; <b>Date:</b>&nbsp;17 Dec 2001</p>
+<p>
+Discussions in the thread "Associative container lower/upper bound
+requirements" on comp.std.c++ suggests that there is a defect in the
+C++ standard, Table 69 of section 23.1.2, "Associative containers",
+[lib.associative.reqmts]. It currently says:</p>
+
+<blockquote>
+<p>
+a.find(k): returns an iterator pointing to an element with the key equivalent to
+k, or a.end() if such an element is not found.
+</p>
+
+<p>
+a.lower_bound(k): returns an iterator pointing to the first element with
+key not less than k.
+</p>
+
+<p>
+a.upper_bound(k): returns an iterator pointing to the first element with
+key greater than k.
+</p>
+</blockquote>
+
+<p>
+We have "or a.end() if such an element is not found" for
+<tt>find</tt>, but not for <tt>upper_bound</tt> or
+<tt>lower_bound</tt>. As the text stands, one would be forced to
+insert a new element into the container and return an iterator to that
+in case the sought iterator does not exist, which does not seem to be
+the intention (and not possible with the "const" versions).
+</p>
+<p><b>Proposed resolution:</b></p>
+
+<p>Change Table 69 of section 23.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-containers.html#lib.associative.reqmts"> [lib.associative.reqmts]</a> indicated entries
+to:</p>
+
+<blockquote>
+<p>
+a.lower_bound(k): returns an iterator pointing to the first element with
+key not less than k, or a.end() if such an element is not found.
+</p>
+
+<p>
+a.upper_bound(k): returns an iterator pointing to the first element with
+key greater than k, or a.end() if such an element is not found.
+</p>
+</blockquote>
+
+<p><i>[Curaçao: LWG reviewed PR.]</i></p>
+
+<hr>
+<a name="358"><h3>358.&nbsp;interpreting <tt>thousands_sep</tt> after a <tt>decimal_point</tt>
+</h3></a><p>
+<b>Section:</b>&nbsp;22.2.2.1.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.facet.num.get.virtuals"> [lib.facet.num.get.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
+<p>
+I don't think <tt>thousands_sep</tt> is being treated correctly after
+decimal_point has been seen. Since grouping applies only to the
+integral part of the number, the first such occurrence should, IMO,
+terminate Stage 2. (If it does not terminate it, then 22.2.2.1.2, p12
+and 22.2.3.1.2, p3 need to explain how <tt>thousands_sep</tt> is to be
+interpreted in the fractional part of a number.)
+</p>
+
+<p>
+The easiest change I can think of that resolves this issue would be
+something like below.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the first sentence of 22.2.2.1.2, p9 from
+</p>
+
+<blockquote>
+ If discard is true then the position of the character is
+ remembered, but the character is otherwise ignored. If it is not
+ discarded, then a check is made to determine if c is allowed as
+ the next character of an input field of the conversion specifier
+ returned by stage 1. If so it is accumulated.
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+ If <tt>discard</tt> is true, then if <tt>'.'</tt> has not yet been
+ accumulated, then the position of the character is remembered, but
+ the character is otherwise ignored. Otherwise, if <tt>'.'</tt> has
+ already been accumulated, the character is discarded and Stage 2
+ terminates. ...
+</blockquote>
+
+<p><b>Rationale:</b></p>
+<p>We believe this reflects the intent of the Standard. Thousands sep
+ characters after the decimal point are not useful in any locale.
+ Some formatting conventions do group digits that follow the decimal
+ point, but they usually introduce a different grouping character
+ instead of reusing the thousand sep character. If we want to add
+ support for such conventions, we need to do so explicitly.</p>
+
+<hr>
+<a name="360"><h3>360.&nbsp;locale mandates inefficient implementation</h3></a><p>
+<b>Section:</b>&nbsp;22.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale"> [lib.locale]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;12 Mar 2002</p>
+<p>
+22.1.1, p7 (copied below) allows iostream formatters and extractors
+to make assumptions about the values returned from facet members.
+However, such assumptions are apparently not guaranteed to hold
+in other cases (e.g., when the facet members are being called directly
+rather than as a result of iostream calls, or between successive
+calls to the same iostream functions with no interevening calls to
+<tt>imbue()</tt>, or even when the facet member functions are called
+from other member functions of other facets). This restriction
+prevents locale from being implemented efficiently.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the first sentence in 22.1.1, p7 from</p>
+<blockquote>
+ In successive calls to a locale facet member function during
+ a call to an iostream inserter or extractor or a streambuf member
+ function, the returned result shall be identical. [Note: This
+ implies that such results may safely be reused without calling
+ the locale facet member function again, and that member functions
+ of iostream classes cannot safely call <tt>imbue()</tt>
+ themselves, except as specified elsewhere. --end note]
+</blockquote>
+
+<p>to</p>
+
+<blockquote>
+ In successive calls to a locale facet member function on a facet
+ object installed in the same locale, the returned result shall be
+ identical. ...
+</blockquote>
+
+<p><b>Rationale:</b></p>
+<p>This change is reasonable becuase it clarifies the intent of this
+ part of the standard.</p>
+<hr>
+<a name="363"><h3>363.&nbsp;Missing exception specification in 27.4.2.1.1</h3></a><p>
+<b>Section:</b>&nbsp;27.4.2.1.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios::failure"> [lib.ios::failure]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown and Marc Paterno&nbsp; <b>Date:</b>&nbsp;20 May 2002</p>
+<p>
+The destructor of ios_base::failure should have an empty throw
+specification, because the destructor of its base class, exception, is
+declared in this way.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>Change the destructor to</p>
+<pre> virtual ~failure() throw();
+</pre>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious glitch. This is almost editorial.</p>
+<hr>
+<a name="364"><h3>364.&nbsp;Inconsistent wording in 27.5.2.4.2</h3></a><p>
+<b>Section:</b>&nbsp;27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Walter Brown, Marc Paterno&nbsp; <b>Date:</b>&nbsp;10 May 2002</p>
+<p>
+27.5.2.4.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.streambuf.virt.buffer"> [lib.streambuf.virt.buffer]</a> paragraph 1 is inconsistent with the Effects
+clause for seekoff.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Make this paragraph, the Effects clause for setbuf, consistent in wording
+with the Effects clause for seekoff in paragraph 3 by amending paragraph 1
+to indicate the purpose of setbuf:
+</p>
+
+<p>Original text:</p>
+
+<blockquote>
+1 Effects: Performs an operation that is defined separately for each
+class derived from basic_streambuf in this clause (27.7.1.3, 27.8.1.4).
+</blockquote>
+
+<p>Proposed text:</p>
+
+<blockquote>
+1 Effects: Influences stream buffering in a way that is defined separately
+for each class derived from basic_streambuf in this clause
+(27.7.1.3, 27.8.1.4).
+</blockquote>
+
+<p><b>Rationale:</b></p>
+<p>The LWG doesn't believe there is any normative difference between
+ the existing wording and what's in the proposed resolution, but the
+ change may make the intent clearer.</p>
+<hr>
+<a name="370"><h3>370.&nbsp;Minor error in basic_istream::get</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;15 Jul 2002</p>
+<p>Defect report for description of basic_istream::get (section 27.6.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.unformatted"> [lib.istream.unformatted]</a>), paragraph 15. The description for the get function
+with the following signature:</p>
+
+<pre> basic_istream&lt;charT,traits&gt;&amp; get(basic_streambuf&lt;char_type,traits&gt;&amp;
+ sb);
+</pre>
+
+<p>is incorrect. It reads</p>
+
+<blockquote>
+ Effects: Calls get(s,n,widen('\n'))
+</blockquote>
+
+<p>which I believe should be:</p>
+
+<blockquote>
+ Effects: Calls get(sb,widen('\n'))
+</blockquote>
+<p><b>Proposed resolution:</b></p>
+<p>Change the <b>Effects</b> paragraph to:</p>
+<blockquote>
+ Effects: Calls get(sb,this-&gt;widen('\n'))
+</blockquote>
+
+<p><i>[Pre-Oxford: Minor correction from Howard: replaced 'widen'
+ with 'this-&gt;widen'.]</i></p>
+
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo.</p>
+<hr>
+<a name="373"><h3>373.&nbsp;Are basic_istream and basic_ostream to use (exceptions()&amp;badbit) != 0 ?</h3></a><p>
+<b>Section:</b>&nbsp;27.6.1.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a>, 27.6.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Keith Baker&nbsp; <b>Date:</b>&nbsp;23 Jul 2002</p>
+
+<p>
+In 27.6.1.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a> and 27.6.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>
+(exception()&amp;badbit) != 0 is used in testing for rethrow, yet
+exception() is the constructor to class std::exception in 18.6.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-support.html#lib.exception"> [lib.exception]</a> that has no return type. Should member function
+exceptions() found in 27.4.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ios"> [lib.ios]</a> be used instead?
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+In 27.6.1.2.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.istream.formatted.reqmts"> [lib.istream.formatted.reqmts]</a> and 27.6.2.5.1 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.ostream.formatted.reqmts"> [lib.ostream.formatted.reqmts]</a>, change
+"(exception()&amp;badbit) != 0" to "(exceptions()&amp;badbit) != 0".
+</p>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo.</p>
+<hr>
+<a name="375"><h3>375.&nbsp;basic_ios should be ios_base in 27.7.1.3</h3></a><p>
+<b>Section:</b>&nbsp;27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Ray Lischner&nbsp; <b>Date:</b>&nbsp;14 Aug 2002</p>
+<p>
+In Section 27.7.1.3 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iostreams.html#lib.stringbuf.virtuals"> [lib.stringbuf.virtuals]</a>: Table 90, Table 91, and paragraph
+14 all contain references to "basic_ios::" which should be
+"ios_base::".
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change all references to "basic_ios" in Table 90, Table 91, and
+paragraph 14 to "ios_base".
+</p>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo.</p>
+<hr>
+<a name="380"><h3>380.&nbsp;typos in codecvt tables 53 and 54</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
+<p>
+Tables 53 and 54 in 22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a> are both titled "convert
+result values," when surely "do_in/do_out result values" must have
+been intended for Table 53 and "do_unshift result values" for Table
+54.
+</p>
+<p>
+Table 54, row 3 says that the meaning of partial is "more characters
+needed to be supplied to complete termination." The function is not
+supplied any characters, it is given a buffer which it fills with
+characters or, more precisely, destination elements (i.e., an escape
+sequence). So partial means that space for more than (to_limit - to)
+destination elements was needed to terminate a sequence given the
+value of state.
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the title of Table 53 to "do_in/do_out result values" and
+the title of Table 54 to "do_unshift result values."
+</p>
+<p>
+Change the text in Table 54, row 3 (the <b>partial</b> row), under the
+heading Meaning, to "space for more than (to_limit - to) destination
+elements was needed to terminate a sequence given the value of state."
+</p>
+<hr>
+<a name="381"><h3>381.&nbsp;detection of invalid mbstate_t in codecvt</h3></a><p>
+<b>Section:</b>&nbsp;22.2.1.5.2 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-locales.html#lib.locale.codecvt.virtuals"> [lib.locale.codecvt.virtuals]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;Martin Sebor&nbsp; <b>Date:</b>&nbsp;6 Sep 2002</p>
+<p>
+All but one codecvt member functions that take a state_type argument
+list as one of their preconditions that the state_type argument have
+a valid value. However, according to 22.2.1.5.2, p6,
+codecvt::do_unshift() is the only codecvt member that is supposed to
+return error if the state_type object is invalid.
+</p>
+
+<p>
+It seems to me that the treatment of state_type by all codecvt member
+functions should be the same and the current requirements should be
+changed. Since the detection of invalid state_type values may be
+difficult in general or computationally expensive in some specific
+cases, I propose the following:
+</p>
+<p><b>Proposed resolution:</b></p>
+<p>
+Add a new paragraph before 22.2.1.5.2, p5, and after the function
+declaration below
+</p>
+<pre> result do_unshift(stateT&amp; state,
+ externT* to, externT* to_limit, externT*&amp; to_next) const;
+</pre>
+<p>
+as follows:
+</p>
+<pre> Requires: (to &lt;= to_end) well defined and true; state initialized,
+ if at the beginning of a sequence, or else equal to the result of
+ converting the preceding characters in the sequence.
+</pre>
+<p>
+and change the text in Table 54, row 4, the <b>error</b> row, under
+the heading Meaning, from
+</p>
+<pre> state has invalid value
+</pre>
+<p>
+to
+</p>
+<pre> an unspecified error has occurred
+</pre>
+<p><b>Rationale:</b></p>
+<p>The intent is that implementations should not be required to detect
+invalid state values; such a requirement appears nowhere else. An
+invalid state value is a precondition violation, <i>i.e.</i> undefined
+behavior. Implementations that do choose to detect invalid state
+values, or that choose to detect any other kind of error, may return
+<b>error</b> as an indication.</p>
+<hr>
+<a name="383"><h3>383.&nbsp;Bidirectional iterator assertion typo</h3></a><p>
+<b>Section:</b>&nbsp;24.1.4 <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lib-iterators.html#lib.bidirectional.iterators"> [lib.bidirectional.iterators]</a>&nbsp; <b>Status:</b>&nbsp;<a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#WP">WP</a>&nbsp; <b>Submitter:</b>&nbsp;ysapir (submitted via comp.std.c++)&nbsp; <b>Date:</b>&nbsp;17 Oct 2002</p>
+<p>
+Following a discussion on the boost list regarding end iterators and
+the possibility of performing operator--() on them, it seems to me
+that there is a typo in the standard. This typo has nothing to do
+with that discussion.
+</p>
+
+<p>
+I have checked this newsgroup, as well as attempted a search of the
+Active/Defect/Closed Issues List on the site for the words "s is
+derefer" so I believe this has not been proposed before. Furthermore,
+the "Lists by Index" mentions only DR <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299">299</a> on section
+24.1.4, and DR <a href="http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/lwg-active.html#299">299</a> is not related to this issue.
+</p>
+
+<p>
+The standard makes the following assertion on bidirectional iterators,
+in section 24.1.4 [lib.bidirectional.iterators], Table 75:
+</p>
+
+<pre> operational assertion/note
+expression return type semantics pre/post-condition
+
+--r X&amp; pre: there exists s such
+ that r == ++s.
+ post: s is dereferenceable.
+ --(++r) == r.
+ --r == --s implies r == s.
+ &amp;r == &amp;--r.
+</pre>
+
+<p>
+(See <a href="http://aspn.activestate.com/ASPN/Mail/Message/boost/1395763">http://aspn.activestate.com/ASPN/Mail/Message/boost/1395763</a>.)
+</p>
+
+<p>
+In particular, "s is dereferenceable" seems to be in error. It seems
+that the intention was to say "r is dereferenceable".
+</p>
+
+<p>
+If it were to say "r is dereferenceable" it would
+make perfect sense. Since s must be dereferenceable prior to
+operator++, then the natural result of operator-- (to undo operator++)
+would be to make r dereferenceable. Furthermore, without other
+assertions, and basing only on precondition and postconditions, we
+could not otherwise know this. So it is also interesting information.
+</p>
+
+<p><b>Proposed resolution:</b></p>
+<p>
+Change the guarantee to "postcondition: r is dereferenceable."
+</p>
+<p><b>Rationale:</b></p>
+<p>Fixes an obvious typo</p>
<p>----- End of document -----</p>
-</body>
-</html>
+</body></html> \ No newline at end of file
diff --git a/libstdc++-v3/docs/html/ext/sgiexts.html b/libstdc++-v3/docs/html/ext/sgiexts.html
index e8bebec877b..159358ff4d4 100644
--- a/libstdc++-v3/docs/html/ext/sgiexts.html
+++ b/libstdc++-v3/docs/html/ext/sgiexts.html
@@ -10,7 +10,12 @@
<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" />
+<link rel="StyleSheet" href="../lib3styles.css" type="text/css" />
+<link rel="Start" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Subsection" href="sgiexts.html" type="text/html" title="Extensions" />
+<link rel="Bookmark" href="howto.html" type="text/html" title="Extensions" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
</head>
<body>
@@ -29,7 +34,7 @@ libstdc++-v3</a></h1>
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: 2002/12/16 18:22:57 $ (UTC).
+ $Date: 2003/11/18 20:56:12 $ (UTC).
</p>
<p>Descriptions range from the scanty to the verbose. You should also check
diff --git a/libstdc++-v3/docs/html/faq/index.html b/libstdc++-v3/docs/html/faq/index.html
index 056cfe37b9d..f17c5d36541 100644
--- a/libstdc++-v3/docs/html/faq/index.html
+++ b/libstdc++-v3/docs/html/faq/index.html
@@ -10,6 +10,9 @@
<meta name="DESCRIPTION" content="FAQ for the GNU libstdc++ effort." />
<title>libstdc++-v3 FAQ</title>
<link rel="StyleSheet" href="../lib3styles.css" />
+<link rel="Start" rev="Help" href="../documentation.html" type="text/html"
+ title="GNU C++ Standard Library" />
+<link rel="Copyright" href="../17_intro/license.html" type="text/html" />
<!--
** Locations of "the most recent snapshot is the Nth" text are
** answers 1_1, .
@@ -115,6 +118,8 @@
<li><a href="#5_6">Is libstdc++-v3 thread-safe?</a> </li>
<li><a href="#5_7">How do I get a copy of the ISO C++ Standard?</a> </li>
<li><a href="#5_8">What's an ABI and why is it so messy?</a> </li>
+ <li><a href="#5_9">How do I make std::vector&lt;T&gt;::capacity()
+ == std::vector&lt;T&gt;::size?</a> </li>
</ol>
</li>
@@ -1057,6 +1062,23 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
candidate C++ ABI that encompasses the standard library.
</p>
+<hr />
+ <h2><a name="5_9">5.9 How do I make std::vector&lt;T&gt;::capacity()
+ == std::vector&lt;T&gt;::size()?</a> </h2>
+ <!-- referenced by 21_strings/howto.html#6 -->
+ <p>The standard idiom for deallocating a <code>std::vector&lt;T&gt;</code>'s
+ unused memory is to create a temporary copy of the vector and swap their
+ contents, e.g. for <code>std::vector&lt;T&gt; v</code>
+ </p>
+ <pre>
+ std::vector&lt;T&gt;(v).swap(v);
+ </pre>
+ <p>The copy will take O(n) time and the swap is constant time.
+ </p>
+ <p>See <a href='../21_strings/howto.html#6'>Shrink-to-fit strings</a> for
+ a similar solution for strings.
+ </p>
+
<!-- ####################################################### -->
<hr />
diff --git a/libstdc++-v3/docs/html/faq/index.txt b/libstdc++-v3/docs/html/faq/index.txt
index 3c8bf0397c8..2e09a1d7fe3 100644
--- a/libstdc++-v3/docs/html/faq/index.txt
+++ b/libstdc++-v3/docs/html/faq/index.txt
@@ -1,93 +1,97 @@
+ #[1]GNU C++ Standard Library [2]Copyright
+
libstdc++ Frequently Asked Questions
-
+
The latest version of this document is always available at
- [1]http://gcc.gnu.org/onlinedocs/libstdc++/faq/. The main
+ [3]http://gcc.gnu.org/onlinedocs/libstdc++/faq/. The main
documentation page is at
- [2]http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html.
-
- To the [3]libstdc++-v3 homepage.
+ [4]http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html.
+
+ To the [5]libstdc++-v3 homepage.
_________________________________________________________________
-
+
Questions
-
- 1. [4]General Information
- 1. [5]What is libstdc++-v3?
- 2. [6]Why should I use libstdc++?
- 3. [7]Who's in charge of it?
- 4. [8]How do I get libstdc++?
- 5. [9]When is libstdc++ going to be finished?
- 6. [10]How do I contribute to the effort?
- 7. [11]What happened to libg++? I need that!
- 8. [12]What if I have more questions?
- 9. [13]What are the license terms for libstdc++-v3?
- 2. [14]Installation
- 1. [15]How do I install libstdc++-v3?
- 2. [16][removed]
- 3. [17]What is this CVS thing that you keep mentioning?
- 4. [18]How do I know if it works?
- 5. [19]This library is HUGE! And what's libsupc++?
- 3. [20]Platform-Specific Issues
- 1. [21]Can libstdc++-v3 be used with <my favorite compiler>?
- 2. [22][removed]
- 3. [23][removed]
- 4. [24]I can't use 'long long' on Solaris
- 5. [25]_XOPEN_SOURCE / _GNU_SOURCE / etc is always defined
- 6. [26]OS X ctype.h is broken! How can I hack it?
- 7. [27]Threading is broken on i386
- 8. [28]Recent GNU/Linux glibc required?
- 9. [29]Can't use wchar_t/wstring on FreeBSD
- 10. [30]MIPS atomic operations
- 4. [31]Known Bugs and Non-Bugs
- 1. [32]What works already?
- 2. [33]Bugs in gcc/g++ (not libstdc++-v3)
- 3. [34]Bugs in the C++ language/lib specification
- 4. [35]Things in libstdc++ that only look like bugs
- o [36]reopening a stream fails
- o [37]-Weffc++ complains too much
- o [38]"ambiguous overloads" after including an old-style
+
+ 1. [6]General Information
+ 1. [7]What is libstdc++-v3?
+ 2. [8]Why should I use libstdc++?
+ 3. [9]Who's in charge of it?
+ 4. [10]How do I get libstdc++?
+ 5. [11]When is libstdc++ going to be finished?
+ 6. [12]How do I contribute to the effort?
+ 7. [13]What happened to libg++? I need that!
+ 8. [14]What if I have more questions?
+ 9. [15]What are the license terms for libstdc++-v3?
+ 2. [16]Installation
+ 1. [17]How do I install libstdc++-v3?
+ 2. [18][removed]
+ 3. [19]What is this CVS thing that you keep mentioning?
+ 4. [20]How do I know if it works?
+ 5. [21]This library is HUGE! And what's libsupc++?
+ 3. [22]Platform-Specific Issues
+ 1. [23]Can libstdc++-v3 be used with <my favorite compiler>?
+ 2. [24][removed]
+ 3. [25][removed]
+ 4. [26]I can't use 'long long' on Solaris
+ 5. [27]_XOPEN_SOURCE / _GNU_SOURCE / etc is always defined
+ 6. [28]OS X ctype.h is broken! How can I hack it?
+ 7. [29]Threading is broken on i386
+ 8. [30]Recent GNU/Linux glibc required?
+ 9. [31]Can't use wchar_t/wstring on FreeBSD
+ 10. [32]MIPS atomic operations
+ 4. [33]Known Bugs and Non-Bugs
+ 1. [34]What works already?
+ 2. [35]Bugs in gcc/g++ (not libstdc++-v3)
+ 3. [36]Bugs in the C++ language/lib specification
+ 4. [37]Things in libstdc++ that only look like bugs
+ o [38]reopening a stream fails
+ o [39]-Weffc++ complains too much
+ o [40]"ambiguous overloads" after including an old-style
header
- o [39]The g++-3 headers are not ours
- o [40]compilation errors from streambuf.h
- o [41]errors about *Concept and constraints in the STL...
- o [42]program crashes when using library code in a
+ o [41]The g++-3 headers are not ours
+ o [42]compilation errors from streambuf.h
+ o [43]errors about *Concept and constraints in the STL...
+ o [44]program crashes when using library code in a
dynamically-loaded library
- o [43]"memory leaks" in containers
- 5. [44]Aw, that's easy to fix!
- 5. [45]Miscellaneous
- 1. [46]string::iterator is not char*; vector<T>::iterator is not
+ o [45]"memory leaks" in containers
+ 5. [46]Aw, that's easy to fix!
+ 5. [47]Miscellaneous
+ 1. [48]string::iterator is not char*; vector<T>::iterator is not
T*
- 2. [47]What's next after libstdc++-v3?
- 3. [48]What about the STL from SGI?
- 4. [49]Extensions and Backward Compatibility
- 5. [50][removed]
- 6. [51]Is libstdc++-v3 thread-safe?
- 7. [52]How do I get a copy of the ISO C++ Standard?
- 8. [53]What's an ABI and why is it so messy?
- _________________________________________________________________
-
+ 2. [49]What's next after libstdc++-v3?
+ 3. [50]What about the STL from SGI?
+ 4. [51]Extensions and Backward Compatibility
+ 5. [52][removed]
+ 6. [53]Is libstdc++-v3 thread-safe?
+ 7. [54]How do I get a copy of the ISO C++ Standard?
+ 8. [55]What's an ABI and why is it so messy?
+ 9. [56]How do I make std::vector<T>::capacity() ==
+ std::vector<T>::size?
+ _________________________________________________________________
+
1.0 General Information
-
+
1.1 What is libstdc++-v3?
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 latest release is [54]the fourteenth
+ a snapshot and released. The latest release is [57]the fourteenth
snapshot but newer versions have been included in recent GCC releases.
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 [55]1.4 below).
-
+ (see [58]1.4 below).
+
The older libstdc++-v2 project is no longer maintained; the code has
- been completely replaced and rewritten. [56]If you are using V2, then
+ been completely replaced and rewritten. [59]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
- [57]design document.
+ [60]design document.
_________________________________________________________________
-
+
1.2 Why should I use libstdc++?
The completion of the ISO C++ standardization gave the C++ community a
@@ -95,79 +99,79 @@
Library. However, all existing C++ implementations are (as the Draft
Standard used to say) "incomplet and incorrekt," and many suffer from
limitations of the compilers that use them.
-
+
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 [58]GCC team. All of
- the rapid development and near-legendary [59]portability that are the
+ development has recently been taken over by the [61]GCC team. All of
+ the rapid development and near-legendary [62]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 incompatibilities.
_________________________________________________________________
-
+
1.3 Who's in charge of it?
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, Ulrich Drepper, Loren James Rittle, and Paolo
Carlini are the lead maintainers of the CVS archive.
-
+
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 [60]homepage.
+ everyone. You can read instructions for doing so on the [63]homepage.
If you have questions, ideas, code, or are just curious, sign up!
_________________________________________________________________
-
+
1.4 How do I get libstdc++?
- The [61]homepage has instructions for retrieving the latest CVS
+ The [64]homepage has instructions for retrieving the latest CVS
sources, and for browsing the CVS sources over the web.
-
- Stable versions of libstdc++-v3 are included with releases of [62]the
+
+ Stable versions of libstdc++-v3 are included with releases of [65]the
GCC compilers.
-
+
The subset commonly known as the Standard Template Library (chapters
23 through 25, mostly) is adapted from the final release of the SGI
STL.
_________________________________________________________________
-
+
1.5 When is libstdc++ going to be finished?
Nathan Myers gave the best of all possible answers, responding to a
Usenet article asking this question: Sooner, if you help.
_________________________________________________________________
-
+
1.6 How do I contribute to the effort?
- Here is [63]a page devoted to this topic. Subscribing to the mailing
+ Here is [66]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
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!
_________________________________________________________________
-
+
1.7 What happened to libg++? I need that!
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.
-
+
The libg++ was designed and created when there was no Standard to
provide guidance. Classes like linked lists are now provided for by
list<T> and do not need to be created by genclass. (For that matter,
templates exist now and are well-supported, whereas genclass (mostly)
predates them.)
-
+
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 "obvious" classes didn't get included.
-
+
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
@@ -176,35 +180,35 @@
entirely plausable that the "useful stuff" from libg++ might be
extracted into an updated utilities library, but nobody has started
such a project yet.
-
- (The [64]Boost site houses free C++ libraries that do varying things,
+
+ (The [67]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 [65]GCC extensions page describes
+
+ For the bold and/or desperate, the [68]GCC extensions page describes
where to find the last libg++ source.
_________________________________________________________________
-
+
1.8 What if I have more questions?
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 [66]libstdc++@gcc.gnu.org.
-
+ list archives); to send to the list, use [69]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 [67]Phil
- Edwards or [68]Gabriel Dos Reis.
+ you have a question about a question/answer here, contact [70]Phil
+ Edwards or [71]Gabriel Dos Reis.
_________________________________________________________________
-
+
1.9 What are the license terms for libstdc++-v3?
- See [69]our license description for these and related questions.
+ See [72]our license description for these and related questions.
_________________________________________________________________
-
+
2.0 Installation
-
+
2.1 How do I install libstdc++-v3?
Complete instructions are not given here (this is a FAQ, not an
@@ -216,57 +220,57 @@
* 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 [70]documentation.html provides a good overview of the steps
+
+ The file [73]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, as well as patches and instructions for working with GCC
2.95.
-
- The top-level install.html and [71]RELEASE-NOTES files contain the
+
+ The top-level install.html and [74]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 [removed]
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 [72]CVS entry in the GNU
- software catalogue has a better description as well as a [73]link to
+ free (beer), and very high quality. The [75]CVS entry in the GNU
+ software catalogue has a better description as well as a [76]link to
the makers of CVS.
-
+
The "anonymous client checkout" feature of CVS is similar to anonymous
FTP in that it allows anyone to retrieve the latest libstdc++ sources.
-
+
After the first of April, American users will have a "/pharmacy"
command-line option...
_________________________________________________________________
-
+
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 ("make install") to run the testsuite, but you do
- need DejaGNU, as described [74]here.
-
+ need DejaGNU, as described [77]here.
+
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 "make check-install"
instead.
-
+
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.5 This library is HUGE! And what's libsupc++?
Usually the size of libraries on disk isn't noticeable. When a link
@@ -277,7 +281,7 @@
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
@@ -288,39 +292,39 @@
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 [75]clause 18 of the standard,
+ support functions (those listed in [78]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>?
Probably not. Yet.
-
+
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
@@ -328,79 +332,79 @@
(see above) will still require certain tools, however. Also keep in
mind that building libstdc++ does not imply that your compiler will be
able to use all of the features found in the C++ Standard Library.
-
+
Since the goal of ISO Standardization is for all C++ implementations
to be able to share code, the final libstdc++ should, in theory, be
usable under any ISO-compliant compiler. It will still be targeted and
optimized for GCC/g++, however.
_________________________________________________________________
-
+
3.2 [removed]
This question has become moot and has been removed. The stub is here
to preserve numbering (and hence links/bookmarks).
_________________________________________________________________
-
+
3.3 [removed]
This question has become moot and has been removed. The stub is here
to preserve numbering (and hence links/bookmarks).
_________________________________________________________________
-
+
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.
_________________________________________________________________
-
+
3.5 _XOPEN_SOURCE / _GNU_SOURCE / etc is always defined
On Solaris, g++ (but not gcc) always defines the preprocessor macro
_XOPEN_SOURCE. On GNU/Linux, the same happens with _GNU_SOURCE. (This
is not an exhaustive list; other macros and other platforms are also
affected.)
-
+
These macros are typically used in C library headers, guarding new
versions of functions from their older versions. The C++ standard
library includes the C standard library, but it requires the C90
version, which for backwards-compatability reasons is often not the
default for many vendors.
-
+
More to the point, the C++ standard requires behavior which is only
available on certain platforms after certain symbols are defined.
Usually the issue involves I/O-related typedefs. In order to ensure
correctness, the compiler simply predefines those symbols.
-
+
Note that it's not enough to #define them only when the library is
being built (during installation). Since we don't have an 'export'
keyword, much of the library exists as headers, which means that the
symbols must also be defined as your programs are parsed and compiled.
-
+
To see which symbols are defined, look for CPLUSPLUS_CPP_SPEC in the
gcc config headers for your target (and try changing them to see what
happens when building complicated code). You can also run "g++ -E -dM
- < /dev/null" to display a list of predefined macros for any
particular installation.
-
- This has been discussed on the mailing lists [76]quite a bit.
-
+
+ This has been discussed on the mailing lists [79]quite a bit.
+
This method is something of a wart. We'd like to find a cleaner
solution, but nobody yet has contributed the time.
_________________________________________________________________
-
+
3.6 OS X ctype.h is broken! How can I hack it?
This is a long-standing bug in the OS X support. Fortunately, the
- patch is quite simple, and well-known. [77]Here's a link to the
+ patch is quite simple, and well-known. [80]Here's a link to the
solution.
_________________________________________________________________
-
+
3.7 Threading is broken on i386
Support for atomic integer operations is/was broken on i386 platforms.
@@ -409,10 +413,10 @@
i386-linux, but actually used the programs on an i686, then you would
encounter no problems. Only when actually running the code on a i386
will the problem appear.
-
+
This is fixed in 3.2.2.
_________________________________________________________________
-
+
3.8 Recent GNU/Linux glibc required?
When running on GNU/Linux, libstdc++ 3.2.1 (shared library version
@@ -420,12 +424,12 @@
C library (glibc) version 2.2.5. That version of glibc is over a year
old and contains necessary bugfixes. Many GNU/Linux distros make glibc
version 2.3.x available now.
-
+
The guideline is simple: the more recent the C++ library, the more
recent the C library. (This is also documented in the main GCC
installation instructions.)
_________________________________________________________________
-
+
3.9 Can't use wchar_t/wstring on FreeBSD
At the moment there are a few problems in FreeBSD's support for wide
@@ -433,111 +437,111 @@
that wchar_t support should be disabled. Once the underlying problems
are fixed in FreeBSD (soon), the library support will automatically
enable itself.
-
+
You can fix the problems yourself, and learn more about the situation,
- by reading [78]this short thread ("_GLIBCPP_USE_WCHAR_T undefined in
+ by reading [81]this short thread ("_GLIBCPP_USE_WCHAR_T undefined in
FreeBSD's c++config.h?").
_________________________________________________________________
-
+
3.10 MIPS atomic operations
The atomic locking routines for MIPS targets requires MIPS II and
later. A patch went in just after the 3.3 release to make mips* use
the generic implementation instead. You can also configure for
mipsel-elf as a workaround.
-
+
mips*-*-linux* continues to use the MIPS II routines, and more work in
this area is expected.
_________________________________________________________________
-
+
4.0 Known Bugs and Non-Bugs
-
+
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.
-
+
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 [79]the configuration instructions for GCC,
+ being found. Please read [82]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.
-
+
For 3.1, the most common "bug" is a parse error when using <fstream>,
ending with a message, "bits/basic_file.h:52: parse error before `{'
- token." Please read [80]the installation instructions for GCC,
+ token." Please read [83]the installation instructions for GCC,
specifically the part about not installing newer versions on top of
older versions. If you install 3.1 over a 3.0.x release, then the
wrong basic_file.h header will be found (its location changed between
releases).
-
+
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?
Short answer: Pretty much everything works except for some corner
cases. Also, localization is incomplete. For whether it works well, or
as you expect it to work, see 5.2.
-
+
Long answer: See the docs/html/17_intro/CHECKLIST file, which is badly
outdated...
-
+
What follows is a verbatim clip from the "Status" section of the
RELEASE-NOTES for the latest snapshot. For a list of fixed bugs, see
that file.
New:
_________________________________________________________________
-
+
4.2 Bugs in gcc/g++ (not libstdc++-v3)
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.
-
- Before reporting a bug, examine the [81]bugs database with the
+
+ Before reporting a bug, examine the [84]bugs database with the
category set to "libstdc++". The BUGS file in the source tree also
tracks known serious problems.
* Debugging is problematic, due to bugs in line-number generation
(mostly fixed in the compiler) and gdb lagging behind the compiler
(lack of personnel). We recommend configuring the compiler using
--with-dwarf2 if the DWARF2 debugging format is not already the
- default on your platform. Also, [82]changing your GDB settings can
+ default on your platform. Also, [85]changing your GDB settings can
have a profound effect on your C++ debugging experiences. :-)
_________________________________________________________________
-
+
4.3 Bugs in the C++ language/lib specification
- Yes, unfortunately, there are some. In a [83]message to the list,
+ Yes, unfortunately, there are some. In a [86]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 [84]posted on his website.
+ concern the library. The list itself is [87]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 [85]here.
- Some of these have resulted in [86]code changes.
+ public list of the library defects is occasionally published [88]here.
+ Some of these have resulted in [89]code changes.
_________________________________________________________________
-
+
4.4 Things in libstdc++ that only 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! Please do not report these as bugs.
-
+
-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.
-
+
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
@@ -555,38 +559,38 @@ New:
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 [87]proposed LWG resolution in DR #22 is to leave the flags
+ the [90]proposed LWG resolution in 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 [88]sums things up here. The collisions with
+ Nathan Myers [91]sums things up here. The collisions with
vector/string iterator types have been fixed for 3.1.
-
+
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 [89]the GCC bug database).
-
+ paragraph of the page describing [92]the GCC bug database).
+
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.
-
+
For GCC versions 3.0 and 3.1 the libstdc++-v3 header files are
installed in ${prefix}/include/g++-v3 (see the 'v'?). Starting with
version 3.2 the headers are installed in
${prefix}/include/c++/${version} as this prevents headers from
previous versions being found by mistake.
-
+
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:
@@ -598,10 +602,10 @@ 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 [90]old v2 library which is no
+ Note that 2.95.x shipped with the [93]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
@@ -609,10 +613,10 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
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 [91]here.
-
+ checks, is available [94]here.
+
dlopen/dlsym If you are using the C++ library across
dynamically-loaded objects, make certain that you are passing the
correct options when compiling and linking:
@@ -630,50 +634,50 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
"memory leaks" in containers A few people have reported that the
standard containers appear to leak memory when tested with memory
- checkers such as [92]valgrind. The library's default allocators keep
+ checkers such as [95]valgrind. The library's default allocators keep
free memory in a pool for later reuse, rather than returning it to the
OS. Although this memory is always reachable by the library and is
never lost, memory debugging tools can report it as a leak. If you
- want to test the library for memory leaks please read [93]Tips for
+ want to test the library for memory leaks please read [96]Tips for
memory leak hunting first.
_________________________________________________________________
-
+
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
- [94]submitting patches that covers the procedure, but for libstdc++
+ [97]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++ [95]contributors' page also
+ GCC patches mailing list. The libstdc++ [98]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 [96]testsuite -- but only if such a test
+ caught immediately by the [99]testsuite -- but only if such a test
exists.
_________________________________________________________________
-
+
5.0 Miscellaneous
-
+
5.1 string::iterator is not char*; vector<T>::iterator is not T*
If you have code that depends on container<T> iterators being
implemented as pointer-to-T, your code is broken.
-
+
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 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
@@ -685,7 +689,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
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 [97]the
+ resolution specifies. Those additions are listed in [100]the
extensions page.
2. Performance tuning. Lots of performance tuning. This too is
already underway for post-3.0 releases, starting with memory
@@ -700,27 +704,27 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
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.
-
- [98]This question about the next libstdc++ prompted some brief but
- interesting [99]speculation.
+
+ [101]This question about the next libstdc++ prompted some brief but
+ interesting [102]speculation.
_________________________________________________________________
-
+
5.3 What about the STL from SGI?
- The [100]STL from SGI, version 3.3, was the most recent merge of the
+ The [103]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
and some others. Classes like vector<> are, however we have made
significant changes to them since then.
-
+
The FAQ for SGI's STL (one jump off of their main page) is recommended
reading.
_________________________________________________________________
-
+
5.4 Extensions and Backward Compatibility
Headers in the ext and backward subdirectories should be referred to
@@ -731,7 +735,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
forward-compatible. (The situation is the same as that of other
headers whose directories are not searched directly, e.g.,
<sys/stat.h>, <X11/Xlib.h>.
-
+
The extensions are no longer in the global or std namespaces, instead
they are declared in the __gnu_cxx namespace. For maximum portability,
consider defining a namespace alias to use to talk about extensions,
@@ -756,20 +760,20 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
This is a bit cleaner than defining typedefs for all the
instantiations you might need.
-
+
Note: explicit template specializations must be declared in the same
namespace as the original template. This means you cannot use a
namespace alias when declaring an explicit specialization.
-
- Extensions to the library have [101]their own page.
+
+ Extensions to the library have [104]their own page.
_________________________________________________________________
-
+
5.5 [removed]
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?
libstdc++-v3 strives to be thread-safe when all of the following
@@ -778,7 +782,7 @@ http://clisp.cons.org/~haible/gccinclude-glibc-2.2-compat.diff
* gcc -v reports a thread model other than 'single',
* [pre-3.3 only] a non-generic implementation of atomicity.h exists
for the architecture in question.
-
+
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
@@ -813,11 +817,11 @@ a
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 [102]17 (library introduction), [103]23 (containers), and
- [104]27 (I/O) for more information.
+
+ See chapters [105]17 (library introduction), [106]23 (containers), and
+ [107]27 (I/O) for more information.
_________________________________________________________________
-
+
5.7 How do I get a copy of the ISO C++ Standard?
Copies of the full ISO 14882 standard are available on line via the
@@ -826,14 +830,14 @@ a
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 [105]here. (And if you've already registered with them, clicking
+ right [108]here. (And if you've already registered with them, clicking
this link will take you to directly to the place where you can
- [106]buy the standard on-line.
-
- Who is your country's member body? Visit the [107]ISO homepage and
+ [109]buy the standard on-line.
+
+ Who is your country's member body? Visit the [110]ISO homepage and
find out!
_________________________________________________________________
-
+
5.8 What's an ABI and why is it so messy?
"ABI" stands for "Application Binary Interface." Conventionally, it
@@ -846,7 +850,7 @@ a
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
@@ -859,7 +863,7 @@ a
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.
@@ -871,7 +875,7 @@ a
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
@@ -880,118 +884,135 @@ a
happen before you can reasonably document a candidate C++ ABI that
encompasses the standard library.
_________________________________________________________________
+
+5.9 How do I make std::vector<T>::capacity() == std::vector<T>::size()?
- See [108]license.html for copying conditions. Comments and suggestions
- are welcome, and may be sent to [109]the libstdc++ mailing list.
+ The standard idiom for deallocating a std::vector<T>'s unused memory
+ is to create a temporary copy of the vector and swap their contents,
+ e.g. for std::vector<T> v
+ std::vector<T>(v).swap(v);
+
+
+ The copy will take O(n) time and the swap is constant time.
+
+ See [111]Shrink-to-fit strings for a similar solution for strings.
+ _________________________________________________________________
+
+ See [112]license.html for copying conditions. Comments and suggestions
+ are welcome, and may be sent to [113]the libstdc++ mailing list.
References
- 1. http://gcc.gnu.org/onlinedocs/libstdc++/faq/
- 2. http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html
- 3. http://gcc.gnu.org/libstdc++/
- 4. ../faq/index.html#1_0
- 5. ../faq/index.html#1_1
- 6. ../faq/index.html#1_2
- 7. ../faq/index.html#1_3
- 8. ../faq/index.html#1_4
- 9. ../faq/index.html#1_5
- 10. ../faq/index.html#1_6
- 11. ../faq/index.html#1_7
- 12. ../faq/index.html#1_8
- 13. ../faq/index.html#1_9
- 14. ../faq/index.html#2_0
- 15. ../faq/index.html#2_1
- 16. ../faq/index.html#2_2
- 17. ../faq/index.html#2_3
- 18. ../faq/index.html#2_4
- 19. ../faq/index.html#2_5
- 20. ../faq/index.html#3_0
- 21. ../faq/index.html#3_1
- 22. ../faq/index.html#3_2
- 23. ../faq/index.html#3_3
- 24. ../faq/index.html#3_4
- 25. ../faq/index.html#3_5
- 26. ../faq/index.html#3_6
- 27. ../faq/index.html#3_7
- 28. ../faq/index.html#3_8
- 29. ../faq/index.html#3_9
- 30. ../faq/index.html#3_10
- 31. ../faq/index.html#4_0
- 32. ../faq/index.html#4_1
- 33. ../faq/index.html#4_2
- 34. ../faq/index.html#4_3
- 35. ../faq/index.html#4_4
- 36. ../faq/index.html#4_4_iostreamclear
- 37. ../faq/index.html#4_4_Weff
- 38. ../faq/index.html#4_4_rel_ops
- 39. ../faq/index.html#4_4_interface
- 40. ../faq/index.html#4_4_glibc
- 41. ../faq/index.html#4_4_checks
- 42. ../faq/index.html#4_4_dlsym
- 43. ../faq/index.html#4_4_leak
- 44. ../faq/index.html#4_5
- 45. ../faq/index.html#5_0
- 46. ../faq/index.html#5_1
- 47. ../faq/index.html#5_2
- 48. ../faq/index.html#5_3
- 49. ../faq/index.html#5_4
- 50. ../faq/index.html#5_5
- 51. ../faq/index.html#5_6
- 52. ../faq/index.html#5_7
- 53. ../faq/index.html#5_8
- 54. http://gcc.gnu.org/libstdc++/index.html#download
- 55. ../faq/index.html#1_4
- 56. ../faq/index.html#4_4_interface
- 57. ../17_intro/DESIGN
- 58. http://gcc.gnu.org/
- 59. http://gcc.gnu.org/gcc-3.0/buildstat.html
- 60. http://gcc.gnu.org/libstdc++/
- 61. http://gcc.gnu.org/libstdc++/
- 62. http://gcc.gnu.org/releases.html
- 63. ../17_intro/contribute.html
- 64. http://www.boost.org/
- 65. http://gcc.gnu.org/extensions.html
- 66. mailto:libstdc++@gcc.gnu.org
- 67. mailto:pme@gcc.gnu.org
- 68. mailto:gdr@gcc.gnu.org
- 69. ../17_intro/license.html
- 70. ../documentation.html
- 71. ../17_intro/RELEASE-NOTES
- 72. http://www.gnu.org/software/cvs/cvs.html
- 73. http://www.cvshome.org/
- 74. http://gcc.gnu.org/install/test.html
- 75. ../18_support/howto.html
- 76. http://gcc.gnu.org/cgi-bin/htsearch?method=and&format=builtin-long&sort=score&words=_XOPEN_SOURCE+Solaris
- 77. http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html
- 78. http://gcc.gnu.org/ml/libstdc++/2003-02/subjects.html#00286
- 79. http://gcc.gnu.org/install/configure.html
- 80. http://gcc.gnu.org/install/
- 81. http://gcc.gnu.org/bugs.html
- 82. http://gcc.gnu.org/ml/libstdc++/2002-02/msg00034.html
- 83. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
- 84. http://www.cantrip.org/draft-bugs.txt
- 85. http://anubis.dkuug.dk/jtc1/sc22/wg21/
- 86. ../faq/index.html#5_2
- 87. ../ext/howto.html#5
- 88. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
- 89. http://gcc.gnu.org/gnatswrite.html
- 90. ../faq/index.html#4_4_interface
- 91. ../19_diagnostics/howto.html#3
- 92. http://developer.kde.org/~sewardj/
- 93. ../debug.html#mem
- 94. http://gcc.gnu.org/contribute.html
- 95. ../17_intro/contribute.html
- 96. ../faq/index.html#2_4
- 97. ../ext/howto.html#5
- 98. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
- 99. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
- 100. http://www.sgi.com/tech/stl/
- 101. ../ext/howto.html
- 102. ../17_intro/howto.html#3
- 103. ../23_containers/howto.html#3
- 104. ../27_io/howto.html#9
- 105. http://www.ansi.org/
- 106. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
- 107. http://www.iso.ch/
- 108. ../17_intro/license.html
- 109. mailto:libstdc++@gcc.gnu.org
+ 1. ../documentation.html
+ 2. ../17_intro/license.html
+ 3. http://gcc.gnu.org/onlinedocs/libstdc++/faq/
+ 4. http://gcc.gnu.org/onlinedocs/libstdc++/documentation.html
+ 5. http://gcc.gnu.org/libstdc++/
+ 6. ../faq/index.html#1_0
+ 7. ../faq/index.html#1_1
+ 8. ../faq/index.html#1_2
+ 9. ../faq/index.html#1_3
+ 10. ../faq/index.html#1_4
+ 11. ../faq/index.html#1_5
+ 12. ../faq/index.html#1_6
+ 13. ../faq/index.html#1_7
+ 14. ../faq/index.html#1_8
+ 15. ../faq/index.html#1_9
+ 16. ../faq/index.html#2_0
+ 17. ../faq/index.html#2_1
+ 18. ../faq/index.html#2_2
+ 19. ../faq/index.html#2_3
+ 20. ../faq/index.html#2_4
+ 21. ../faq/index.html#2_5
+ 22. ../faq/index.html#3_0
+ 23. ../faq/index.html#3_1
+ 24. ../faq/index.html#3_2
+ 25. ../faq/index.html#3_3
+ 26. ../faq/index.html#3_4
+ 27. ../faq/index.html#3_5
+ 28. ../faq/index.html#3_6
+ 29. ../faq/index.html#3_7
+ 30. ../faq/index.html#3_8
+ 31. ../faq/index.html#3_9
+ 32. ../faq/index.html#3_10
+ 33. ../faq/index.html#4_0
+ 34. ../faq/index.html#4_1
+ 35. ../faq/index.html#4_2
+ 36. ../faq/index.html#4_3
+ 37. ../faq/index.html#4_4
+ 38. ../faq/index.html#4_4_iostreamclear
+ 39. ../faq/index.html#4_4_Weff
+ 40. ../faq/index.html#4_4_rel_ops
+ 41. ../faq/index.html#4_4_interface
+ 42. ../faq/index.html#4_4_glibc
+ 43. ../faq/index.html#4_4_checks
+ 44. ../faq/index.html#4_4_dlsym
+ 45. ../faq/index.html#4_4_leak
+ 46. ../faq/index.html#4_5
+ 47. ../faq/index.html#5_0
+ 48. ../faq/index.html#5_1
+ 49. ../faq/index.html#5_2
+ 50. ../faq/index.html#5_3
+ 51. ../faq/index.html#5_4
+ 52. ../faq/index.html#5_5
+ 53. ../faq/index.html#5_6
+ 54. ../faq/index.html#5_7
+ 55. ../faq/index.html#5_8
+ 56. ../faq/index.html#5_9
+ 57. http://gcc.gnu.org/libstdc++/index.html#download
+ 58. ../faq/index.html#1_4
+ 59. ../faq/index.html#4_4_interface
+ 60. ../17_intro/DESIGN
+ 61. http://gcc.gnu.org/
+ 62. http://gcc.gnu.org/gcc-3.0/buildstat.html
+ 63. http://gcc.gnu.org/libstdc++/
+ 64. http://gcc.gnu.org/libstdc++/
+ 65. http://gcc.gnu.org/releases.html
+ 66. ../17_intro/contribute.html
+ 67. http://www.boost.org/
+ 68. http://gcc.gnu.org/extensions.html
+ 69. mailto:libstdc++@gcc.gnu.org
+ 70. mailto:pme@gcc.gnu.org
+ 71. mailto:gdr@gcc.gnu.org
+ 72. ../17_intro/license.html
+ 73. ../documentation.html
+ 74. ../17_intro/RELEASE-NOTES
+ 75. http://www.gnu.org/software/cvs/cvs.html
+ 76. http://www.cvshome.org/
+ 77. http://gcc.gnu.org/install/test.html
+ 78. ../18_support/howto.html
+ 79. http://gcc.gnu.org/cgi-bin/htsearch?method=and&format=builtin-long&sort=score&words=_XOPEN_SOURCE+Solaris
+ 80. http://gcc.gnu.org/ml/gcc/2002-03/msg00817.html
+ 81. http://gcc.gnu.org/ml/libstdc++/2003-02/subjects.html#00286
+ 82. http://gcc.gnu.org/install/configure.html
+ 83. http://gcc.gnu.org/install/
+ 84. http://gcc.gnu.org/bugs.html
+ 85. http://gcc.gnu.org/ml/libstdc++/2002-02/msg00034.html
+ 86. http://gcc.gnu.org/ml/libstdc++/1998/msg00006.html
+ 87. http://www.cantrip.org/draft-bugs.txt
+ 88. http://anubis.dkuug.dk/jtc1/sc22/wg21/
+ 89. ../faq/index.html#5_2
+ 90. ../ext/howto.html#5
+ 91. http://gcc.gnu.org/ml/libstdc++/2001-01/msg00247.html
+ 92. http://gcc.gnu.org/gnatswrite.html
+ 93. ../faq/index.html#4_4_interface
+ 94. ../19_diagnostics/howto.html#3
+ 95. http://developer.kde.org/~sewardj/
+ 96. ../debug.html#mem
+ 97. http://gcc.gnu.org/contribute.html
+ 98. ../17_intro/contribute.html
+ 99. ../faq/index.html#2_4
+ 100. ../ext/howto.html#5
+ 101. http://gcc.gnu.org/ml/libstdc++/1999/msg00080.html
+ 102. http://gcc.gnu.org/ml/libstdc++/1999/msg00084.html
+ 103. http://www.sgi.com/tech/stl/
+ 104. ../ext/howto.html
+ 105. ../17_intro/howto.html#3
+ 106. ../23_containers/howto.html#3
+ 107. ../27_io/howto.html#9
+ 108. http://www.ansi.org/
+ 109. http://webstore.ansi.org/ansidocstore/product.asp?sku=ISO%2FIEC+14882%2D1998
+ 110. http://www.iso.ch/
+ 111. ../21_strings/howto.html#6
+ 112. ../17_intro/license.html
+ 113. mailto:libstdc++@gcc.gnu.org
diff --git a/libstdc++-v3/docs/html/install.html b/libstdc++-v3/docs/html/install.html
index 6c983710b86..7889b93e393 100644
--- a/libstdc++-v3/docs/html/install.html
+++ b/libstdc++-v3/docs/html/install.html
@@ -10,7 +10,8 @@
<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" />
+<link rel="StyleSheet" href="lib3styles.css" type="text/css" />
+<link rel="Copyright" href="17_intro/license.html" type="text/html" />
</head>
<body>
diff --git a/libstdc++-v3/docs/html/test.html b/libstdc++-v3/docs/html/test.html
index 07d585fdc23..8c761113eb6 100644
--- a/libstdc++-v3/docs/html/test.html
+++ b/libstdc++-v3/docs/html/test.html
@@ -34,6 +34,7 @@
<li><a href="#util">Utilities: abicheck and libv3test</a></li>
<li><a href="#new">How to write a new test case</a></li>
<li><a href="#check">Options for running the tests</a></li>
+ <li><a href="#debug">Running debug-mode tests</a></li>
<li><a href="#future">Future</a></li>
<li><a href="#internals">DejaGNU internals</a></li>
</ul>
@@ -391,6 +392,12 @@ Example 3: Testing for expected warnings on line 36
Example 4: Testing for compilation errors on line 41
// { dg-do compile }
// { dg-error "no match for" "" { target *-*-* } 41 }
+
+Example 5: Testing with special command line settings, or without the
+use of pre-compiled headers, in particular the stdc++.h.gch file. Any
+options here will override the DEFAULT_CXXFLAGS set up in the
+normal.exp file.
+// { dg-options "-O0" { target *-*-* } }
</pre>
<p>
@@ -544,6 +551,19 @@ make check-target-libstdc++-v3 RUNTESTFLAGS="--target_board=arm-sim"
for which files to examine.
</p>
+<hr/>
+<h2><a name="debug">Running debug-mode tests</a></h2>
+<p>To run the libstdc++ test suite under the <a
+ href="debug.html#safe">debug mode</a>,
+ edit <code>libstdc++/scripts/testsuite_flags</code> to add the
+ compile-time flag <code>-D_GLIBCXX_DEBUG</code> to the result
+ printed by the <code>--build-cxx</code> option. Additionally, add
+ the <code>-D_GLIBCXX_DEBUG_PEDANTIC</code> flag to turn on pedantic
+ checking. The libstdc++ test suite should produce precisely the same
+ results under debug mode that it does under release mode: any
+ deviation indicates an error in either the library or the test
+ suite.</p>
+
<hr />
<h2><a name="future">Future</a></h2>
diff --git a/libstdc++-v3/include/Makefile.am b/libstdc++-v3/include/Makefile.am
index 862b0a3a8a0..b97267bcb72 100644
--- a/libstdc++-v3/include/Makefile.am
+++ b/libstdc++-v3/include/Makefile.am
@@ -101,6 +101,7 @@ bits_headers = \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
+ ${bits_srcdir}/concurrence.h \
${bits_srcdir}/cpp_type_traits.h \
${bits_srcdir}/demangle.h \
${bits_srcdir}/deque.tcc \
@@ -224,7 +225,6 @@ ext_headers = \
${ext_srcdir}/hash_fun.h \
${ext_srcdir}/hashtable.h
-
# This is the common subset of files that all three "C" header models use.
c_base_srcdir = $(C_INCLUDE_DIR)
c_base_builddir = .
@@ -290,6 +290,34 @@ c_compatibility_headers = \
${c_compatibility_srcdir}/wchar.h \
${c_compatibility_srcdir}/wctype.h
+# Debug mode headers
+debug_srcdir = ${glibcxx_srcdir}/include/debug
+debug_builddir = ./debug
+debug_headers = \
+ ${debug_srcdir}/bitset \
+ ${debug_srcdir}/debug.h \
+ ${debug_srcdir}/deque \
+ ${debug_srcdir}/formatter.h \
+ ${debug_srcdir}/hash_map \
+ ${debug_srcdir}/hash_map.h \
+ ${debug_srcdir}/hash_multimap.h \
+ ${debug_srcdir}/hash_multiset.h \
+ ${debug_srcdir}/hash_set \
+ ${debug_srcdir}/hash_set.h \
+ ${debug_srcdir}/list \
+ ${debug_srcdir}/map \
+ ${debug_srcdir}/map.h \
+ ${debug_srcdir}/multimap.h \
+ ${debug_srcdir}/multiset.h \
+ ${debug_srcdir}/safe_base.h \
+ ${debug_srcdir}/safe_iterator.h \
+ ${debug_srcdir}/safe_iterator.tcc \
+ ${debug_srcdir}/safe_sequence.h \
+ ${debug_srcdir}/set \
+ ${debug_srcdir}/set.h \
+ ${debug_srcdir}/string \
+ ${debug_srcdir}/vector
+
# Some of the different "C" header models need extra files.
# Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std
@@ -350,7 +378,7 @@ endif
# CLEANFILES and all-local are kept up-to-date.
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
- stamp-backward stamp-ext stamp-host
+ stamp-backward stamp-ext stamp-debug stamp-host
# List of all files that are created by explicit building, editing, or
# catenation.
@@ -429,6 +457,15 @@ stamp-ext: ${ext_headers}
fi ;\
$(STAMP) stamp-ext
+stamp-debug: ${debug_headers}
+ @if [ ! -d "${debug_builddir}" ]; then \
+ mkdir -p ${debug_builddir} ;\
+ fi ;\
+ if [ ! -f stamp-debug ]; then \
+ (cd ${debug_builddir} && @LN_S@ $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-debug
+
stamp-${host_alias}:
@if [ ! -d ${host_builddir} ]; then \
mkdir -p ${host_builddir} ;\
@@ -556,6 +593,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
for file in ${std_headers_rename}; do \
$(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
+ for file in ${debug_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
for file in ${host_headers} ${host_headers_extra} \
${thread_host_headers}; do \
diff --git a/libstdc++-v3/include/Makefile.in b/libstdc++-v3/include/Makefile.in
index 1db9bfcd555..8c266e81fef 100644
--- a/libstdc++-v3/include/Makefile.in
+++ b/libstdc++-v3/include/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.8 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -108,7 +108,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -297,6 +296,7 @@ bits_headers = \
${bits_srcdir}/char_traits.h \
${bits_srcdir}/codecvt.h \
${bits_srcdir}/concept_check.h \
+ ${bits_srcdir}/concurrence.h \
${bits_srcdir}/cpp_type_traits.h \
${bits_srcdir}/demangle.h \
${bits_srcdir}/deque.tcc \
@@ -491,11 +491,40 @@ c_compatibility_headers = \
${c_compatibility_srcdir}/wctype.h
+# Debug mode headers
+debug_srcdir = ${glibcxx_srcdir}/include/debug
+debug_builddir = ./debug
+debug_headers = \
+ ${debug_srcdir}/bitset \
+ ${debug_srcdir}/debug.h \
+ ${debug_srcdir}/deque \
+ ${debug_srcdir}/formatter.h \
+ ${debug_srcdir}/hash_map \
+ ${debug_srcdir}/hash_map.h \
+ ${debug_srcdir}/hash_multimap.h \
+ ${debug_srcdir}/hash_multiset.h \
+ ${debug_srcdir}/hash_set \
+ ${debug_srcdir}/hash_set.h \
+ ${debug_srcdir}/list \
+ ${debug_srcdir}/map \
+ ${debug_srcdir}/map.h \
+ ${debug_srcdir}/multimap.h \
+ ${debug_srcdir}/multiset.h \
+ ${debug_srcdir}/safe_base.h \
+ ${debug_srcdir}/safe_iterator.h \
+ ${debug_srcdir}/safe_iterator.tcc \
+ ${debug_srcdir}/safe_sequence.h \
+ ${debug_srcdir}/set \
+ ${debug_srcdir}/set.h \
+ ${debug_srcdir}/string \
+ ${debug_srcdir}/vector
+
+@GLIBCXX_C_HEADERS_C_STD_FALSE@c_base_headers_extra =
+
# Some of the different "C" header models need extra files.
# Some "C" header schemes require the "C" compatibility headers.
# For --enable-cheaders=c_std
@GLIBCXX_C_HEADERS_C_STD_TRUE@c_base_headers_extra = ${c_base_srcdir}/cmath.tcc
-@GLIBCXX_C_HEADERS_C_STD_FALSE@c_base_headers_extra =
@GLIBCXX_C_HEADERS_COMPATIBILITY_FALSE@c_compatibility_headers_extra =
@GLIBCXX_C_HEADERS_COMPATIBILITY_TRUE@c_compatibility_headers_extra = ${c_compatibility_headers}
@@ -537,16 +566,16 @@ pch_input = ${host_builddir}/stdc++.h
pch_output_builddir = ${host_builddir}/stdc++.h.gch
pch_source = ${glibcxx_srcdir}/include/stdc++.h
PCHFLAGS = -Winvalid-pch -Wno-deprecated -x c++-header $(CXXFLAGS)
-@GLIBCXX_BUILD_PCH_FALSE@pch_build =
@GLIBCXX_BUILD_PCH_TRUE@pch_build = ${pch_input}
-@GLIBCXX_BUILD_PCH_FALSE@pch_install =
+@GLIBCXX_BUILD_PCH_FALSE@pch_build =
@GLIBCXX_BUILD_PCH_TRUE@pch_install = install-pch
+@GLIBCXX_BUILD_PCH_FALSE@pch_install =
# List of all timestamp files. By keeping only one copy of this list, both
# CLEANFILES and all-local are kept up-to-date.
allstamped = \
stamp-std stamp-bits stamp-c_base stamp-c_compatibility \
- stamp-backward stamp-ext stamp-host
+ stamp-backward stamp-ext stamp-debug stamp-host
# List of all files that are created by explicit building, editing, or
@@ -644,7 +673,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -783,6 +812,15 @@ stamp-ext: ${ext_headers}
fi ;\
$(STAMP) stamp-ext
+stamp-debug: ${debug_headers}
+ @if [ ! -d "${debug_builddir}" ]; then \
+ mkdir -p ${debug_builddir} ;\
+ fi ;\
+ if [ ! -f stamp-debug ]; then \
+ (cd ${debug_builddir} && @LN_S@ $? . || true) ;\
+ fi ;\
+ $(STAMP) stamp-debug
+
stamp-${host_alias}:
@if [ ! -d ${host_builddir} ]; then \
mkdir -p ${host_builddir} ;\
@@ -904,6 +942,9 @@ install-headers:
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${std_builddir}
for file in ${std_headers_rename}; do \
$(INSTALL_DATA) ${std_builddir}/$${file} $(DESTDIR)${gxx_include_dir}/${std_builddir}; done
+ $(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${debug_builddir}
+ for file in ${debug_headers}; do \
+ $(INSTALL_DATA) $${file} $(DESTDIR)${gxx_include_dir}/${debug_builddir}; done
$(mkinstalldirs) $(DESTDIR)${gxx_include_dir}/${host_builddir}
for file in ${host_headers} ${host_headers_extra} \
${thread_host_headers}; do \
diff --git a/libstdc++-v3/include/backward/algo.h b/libstdc++-v3/include/backward/algo.h
index a56a1b38491..6f248356cf8 100644
--- a/libstdc++-v3/include/backward/algo.h
+++ b/libstdc++-v3/include/backward/algo.h
@@ -66,57 +66,57 @@
#include <ext/numeric>
// 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::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::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::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;
// Names from stl_heap.h
using std::push_heap;
@@ -125,22 +125,22 @@ 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::accumulate;
+using std::inner_product;
+using std::partial_sum;
+using std::adjacent_difference;
// Names from ext/algorithm
-using __gnu_cxx::random_sample;
+using __gnu_cxx::random_sample;
using __gnu_cxx::random_sample_n;
-using __gnu_cxx::is_sorted;
+using __gnu_cxx::is_sorted;
using __gnu_cxx::is_heap;
using __gnu_cxx::count; // Extension returning void
using __gnu_cxx::count_if; // Extension returning void
// Names from ext/numeric
-using __gnu_cxx::power;
-using __gnu_cxx::iota;
+using __gnu_cxx::power;
+using __gnu_cxx::iota;
#endif /* _BACKWARD_ALGO_H */
diff --git a/libstdc++-v3/include/backward/algobase.h b/libstdc++-v3/include/backward/algobase.h
index 4cf82520d64..86028a0d05c 100644
--- a/libstdc++-v3/include/backward/algobase.h
+++ b/libstdc++-v3/include/backward/algobase.h
@@ -64,17 +64,17 @@
#include <ext/memory>
// 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::fill;
-using std::fill_n;
-using std::mismatch;
-using std::equal;
-using std::lexicographical_compare;
+using std::iter_swap;
+using std::swap;
+using std::min;
+using std::max;
+using std::copy;
+using std::copy_backward;
+using std::fill;
+using std::fill_n;
+using std::mismatch;
+using std::equal;
+using std::lexicographical_compare;
// Names from stl_uninitialized.h
using std::uninitialized_copy;
@@ -82,8 +82,8 @@ using std::uninitialized_fill;
using std::uninitialized_fill_n;
// Names from ext/algorithm
-using __gnu_cxx::copy_n;
-using __gnu_cxx::lexicographical_compare_3way;
+using __gnu_cxx::copy_n;
+using __gnu_cxx::lexicographical_compare_3way;
// Names from ext/memory
using __gnu_cxx::uninitialized_copy_n;
diff --git a/libstdc++-v3/include/backward/alloc.h b/libstdc++-v3/include/backward/alloc.h
index 5781192bb33..ad9e4e5bb3c 100644
--- a/libstdc++-v3/include/backward/alloc.h
+++ b/libstdc++-v3/include/backward/alloc.h
@@ -46,14 +46,10 @@
#include "backward_warning.h"
#include <bits/c++config.h>
#include <bits/allocator.h>
-#include <ext/debug_allocator.h>
-#include <ext/malloc_allocator.h>
-
-using __gnu_cxx::__malloc_alloc;
-using __gnu_cxx::__debug_alloc;
-using __gnu_cxx::__pool_alloc;
-using std::__alloc;
-using std::__simple_alloc;
+
+using __gnu_cxx::__pool_alloc;
+using std::__alloc;
+using std::__simple_alloc;
using std::allocator;
-#endif
+#endif
diff --git a/libstdc++-v3/include/backward/complex.h b/libstdc++-v3/include/backward/complex.h
index 589fac73fce..dfc67140655 100644
--- a/libstdc++-v3/include/backward/complex.h
+++ b/libstdc++-v3/include/backward/complex.h
@@ -32,9 +32,9 @@
#include <complex>
using std::complex;
-typedef complex<float> float_complex;
-typedef complex<double> double_complex;
-typedef complex<long double> long_double_complex;
+typedef complex<float> float_complex;
+typedef complex<double> double_complex;
+typedef complex<long double> long_double_complex;
#endif
diff --git a/libstdc++-v3/include/backward/defalloc.h b/libstdc++-v3/include/backward/defalloc.h
index 98987fd0c0f..76ea52abc9e 100644
--- a/libstdc++-v3/include/backward/defalloc.h
+++ b/libstdc++-v3/include/backward/defalloc.h
@@ -47,7 +47,7 @@
// This file WILL BE REMOVED in a future release.
//
// DO NOT USE THIS FILE unless you have an old container implementation
-// that requires an allocator with the HP-style interface.
+// that requires an allocator with the HP-style interface.
//
// Standard-conforming allocators have a very different interface. The
// standard default allocator is declared in the header <memory>.
@@ -59,8 +59,8 @@
#include "new.h"
#include <stddef.h>
#include <stdlib.h>
-#include <limits.h>
-#include "iostream.h"
+#include <limits.h>
+#include "iostream.h"
#include "algobase.h"
@@ -69,7 +69,7 @@ inline _Tp* allocate(ptrdiff_t __size, _Tp*) {
set_new_handler(0);
_Tp* __tmp = (_Tp*)(::operator new((size_t)(__size * sizeof(_Tp))));
if (__tmp == 0) {
- cerr << "out of memory" << endl;
+ cerr << "out of memory" << endl;
exit(1);
}
return __tmp;
@@ -91,19 +91,19 @@ public:
typedef const _Tp& const_reference;
typedef size_t size_type;
typedef ptrdiff_t difference_type;
- pointer allocate(size_type __n) {
+ pointer allocate(size_type __n) {
return ::allocate((difference_type)__n, (pointer)0);
}
void deallocate(pointer __p) { ::deallocate(__p); }
pointer address(reference __x) { return (pointer)&__x; }
- const_pointer const_address(const_reference __x) {
- return (const_pointer)&__x;
+ const_pointer const_address(const_reference __x) {
+ return (const_pointer)&__x;
}
- size_type init_page_size() {
- return max(size_type(1), size_type(4096/sizeof(_Tp)));
+ size_type init_page_size() {
+ return max(size_type(1), size_type(4096/sizeof(_Tp)));
}
- size_type max_size() const {
- return max(size_type(1), size_type(UINT_MAX/sizeof(_Tp)));
+ size_type max_size() const {
+ return max(size_type(1), size_type(UINT_MAX/sizeof(_Tp)));
}
};
diff --git a/libstdc++-v3/include/backward/function.h b/libstdc++-v3/include/backward/function.h
index 19f29c81326..9fc8719c07a 100644
--- a/libstdc++-v3/include/backward/function.h
+++ b/libstdc++-v3/include/backward/function.h
@@ -63,65 +63,65 @@
#include <ext/functional>
// 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::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::pointer_to_unary_function;
-using std::pointer_to_binary_function;
-using std::ptr_fun;
-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::unary_function;
+using std::binary_function;
+using std::plus;
+using std::minus;
+using std::multiplies;
+using std::divides;
+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::pointer_to_unary_function;
+using std::pointer_to_binary_function;
+using std::ptr_fun;
+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;
// Names from ext/functional
-using __gnu_cxx::identity_element;
-using __gnu_cxx::unary_compose;
-using __gnu_cxx::binary_compose;
-using __gnu_cxx::compose1;
-using __gnu_cxx::compose2;
-using __gnu_cxx::identity;
-using __gnu_cxx::select1st;
-using __gnu_cxx::select2nd;
-using __gnu_cxx::project1st;
-using __gnu_cxx::project2nd;
-using __gnu_cxx::constant_void_fun;
-using __gnu_cxx::constant_unary_fun;
-using __gnu_cxx::constant_binary_fun;
-using __gnu_cxx::constant0;
-using __gnu_cxx::constant1;
-using __gnu_cxx::constant2;
-using __gnu_cxx::subtractive_rng;
-using __gnu_cxx::mem_fun1;
-using __gnu_cxx::mem_fun1_ref;
+using __gnu_cxx::identity_element;
+using __gnu_cxx::unary_compose;
+using __gnu_cxx::binary_compose;
+using __gnu_cxx::compose1;
+using __gnu_cxx::compose2;
+using __gnu_cxx::identity;
+using __gnu_cxx::select1st;
+using __gnu_cxx::select2nd;
+using __gnu_cxx::project1st;
+using __gnu_cxx::project2nd;
+using __gnu_cxx::constant_void_fun;
+using __gnu_cxx::constant_unary_fun;
+using __gnu_cxx::constant_binary_fun;
+using __gnu_cxx::constant0;
+using __gnu_cxx::constant1;
+using __gnu_cxx::constant2;
+using __gnu_cxx::subtractive_rng;
+using __gnu_cxx::mem_fun1;
+using __gnu_cxx::mem_fun1_ref;
#endif /* _BACKWARD_FUNCTION_H */
diff --git a/libstdc++-v3/include/backward/iterator.h b/libstdc++-v3/include/backward/iterator.h
index 4100049ee24..659176a73c5 100644
--- a/libstdc++-v3/include/backward/iterator.h
+++ b/libstdc++-v3/include/backward/iterator.h
@@ -116,7 +116,7 @@ template<class _Iter>
using std::distance;
using __gnu_cxx::distance; // 3-parameter extension
-using std::advance;
+using std::advance;
using std::insert_iterator;
using std::front_insert_iterator;
@@ -145,7 +145,7 @@ template <class _Tp>
inline void
destroy(_Tp* __pointer)
{ std::_Destroy(__pointer); }
-
+
template <class _ForwardIterator>
inline void
destroy(_ForwardIterator __first, _ForwardIterator __last)
diff --git a/libstdc++-v3/include/backward/new.h b/libstdc++-v3/include/backward/new.h
index e39f97ae6b2..00a4819a0bb 100644
--- a/libstdc++-v3/include/backward/new.h
+++ b/libstdc++-v3/include/backward/new.h
@@ -7,12 +7,12 @@
// it under the 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,
@@ -39,4 +39,4 @@ using std::nothrow;
using std::new_handler;
using std::set_new_handler;
-#endif
+#endif
diff --git a/libstdc++-v3/include/backward/ostream.h b/libstdc++-v3/include/backward/ostream.h
index 2a65929f97a..a72de09d9eb 100644
--- a/libstdc++-v3/include/backward/ostream.h
+++ b/libstdc++-v3/include/backward/ostream.h
@@ -31,7 +31,7 @@
#include "backward_warning.h"
#include "iostream.h"
-#endif
+#endif
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/backward/queue.h b/libstdc++-v3/include/backward/queue.h
index e092ac27263..a3e2ff3af09 100644
--- a/libstdc++-v3/include/backward/queue.h
+++ b/libstdc++-v3/include/backward/queue.h
@@ -34,7 +34,7 @@
using std::queue;
using std::priority_queue;
-#endif
+#endif
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/backward/rope.h b/libstdc++-v3/include/backward/rope.h
index b6b18c2ab2b..fc6715aa750 100644
--- a/libstdc++-v3/include/backward/rope.h
+++ b/libstdc++-v3/include/backward/rope.h
@@ -44,14 +44,14 @@
#define _BACKWARD_ROPE_H 1
#include "backward_warning.h"
-#include "hashtable.h"
+#include "hashtable.h"
#include <ext/rope>
-using __gnu_cxx::char_producer;
-using __gnu_cxx::sequence_buffer;
-using __gnu_cxx::rope;
-using __gnu_cxx::crope;
-using __gnu_cxx::wrope;
+using __gnu_cxx::char_producer;
+using __gnu_cxx::sequence_buffer;
+using __gnu_cxx::rope;
+using __gnu_cxx::crope;
+using __gnu_cxx::wrope;
#endif /* _BACKWARD_ROPE_H */
diff --git a/libstdc++-v3/include/backward/stream.h b/libstdc++-v3/include/backward/stream.h
index 8371b056a13..5540c7eebd1 100644
--- a/libstdc++-v3/include/backward/stream.h
+++ b/libstdc++-v3/include/backward/stream.h
@@ -31,7 +31,7 @@
#include "backward_warning.h"
#include "iostream.h"
-#endif
+#endif
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/backward/streambuf.h b/libstdc++-v3/include/backward/streambuf.h
index 35a3c672dd2..fc9825ef0a3 100644
--- a/libstdc++-v3/include/backward/streambuf.h
+++ b/libstdc++-v3/include/backward/streambuf.h
@@ -33,7 +33,7 @@
using std::streambuf;
-#endif
+#endif
// Local Variables:
// mode:C++
diff --git a/libstdc++-v3/include/backward/strstream b/libstdc++-v3/include/backward/strstream
index 165c6e70dd4..695d7970db9 100644
--- a/libstdc++-v3/include/backward/strstream
+++ b/libstdc++-v3/include/backward/strstream
@@ -61,12 +61,12 @@ namespace std
// Note that this class is not a template.
class strstreambuf : public basic_streambuf<char, char_traits<char> >
{
- public:
+ public:
// Types.
typedef char_traits<char> _Traits;
typedef basic_streambuf<char, _Traits> _Base;
- public:
+ public:
// Constructor, destructor
explicit strstreambuf(streamsize __initial_capacity = 0);
strstreambuf(void* (*__alloc)(size_t), void (*__free)(void*));
@@ -97,7 +97,7 @@ namespace std
virtual pos_type seekpos(pos_type __pos, ios_base::openmode __mode
= ios_base::in | ios_base::out);
- private:
+ private:
// Dynamic allocation, possibly using _M_alloc_fun and _M_free_fun.
char* _M_alloc(size_t);
void _M_free(char*);
@@ -105,7 +105,7 @@ namespace std
// Helper function used in constructors.
void _M_setup(char* __get, char* __put, streamsize __n);
- private:
+ private:
// Data members.
void* (*_M_alloc_fun)(size_t);
void (*_M_free_fun)(void*);
@@ -171,4 +171,4 @@ namespace std
strstreambuf _M_buf;
};
} // namespace std
-#endif
+#endif
diff --git a/libstdc++-v3/include/backward/tempbuf.h b/libstdc++-v3/include/backward/tempbuf.h
index 75b9b8bbe45..06de2bd39d4 100644
--- a/libstdc++-v3/include/backward/tempbuf.h
+++ b/libstdc++-v3/include/backward/tempbuf.h
@@ -60,9 +60,9 @@
#include "pair.h"
#include "iterator.h"
#include <limits.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <bits/type_traits.h>
+#include <stddef.h>
+#include <stdlib.h>
+#include <bits/type_traits.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
#include <ext/memory>
diff --git a/libstdc++-v3/include/backward/tree.h b/libstdc++-v3/include/backward/tree.h
index ca3ff897594..fcfcbf48dc4 100644
--- a/libstdc++-v3/include/backward/tree.h
+++ b/libstdc++-v3/include/backward/tree.h
@@ -49,7 +49,7 @@
using __gnu_cxx::rb_tree;
-#endif
+#endif
// Local Variables:
// mode:C++
// End:
diff --git a/libstdc++-v3/include/backward/vector.h b/libstdc++-v3/include/backward/vector.h
index 961f41a7840..ba9b704c1dc 100644
--- a/libstdc++-v3/include/backward/vector.h
+++ b/libstdc++-v3/include/backward/vector.h
@@ -58,7 +58,7 @@
#include "backward_warning.h"
#include "algobase.h"
-#include "alloc.h"
+#include "alloc.h"
#include <vector>
using std::vector;
diff --git a/libstdc++-v3/include/bits/allocator.h b/libstdc++-v3/include/bits/allocator.h
index a5bcaf5c512..53d1d351f08 100644
--- a/libstdc++-v3/include/bits/allocator.h
+++ b/libstdc++-v3/include/bits/allocator.h
@@ -172,9 +172,13 @@ namespace std
size_type
max_size() const throw() { return size_t(-1) / sizeof(_Tp); }
- void construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val) { ::new(__p) _Tp(__val); }
- void destroy(pointer __p) { __p->~_Tp(); }
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
};
template<>
diff --git a/libstdc++-v3/include/bits/allocator_traits.h b/libstdc++-v3/include/bits/allocator_traits.h
index 35ef1d4ebb9..93bae7a2d44 100644
--- a/libstdc++-v3/include/bits/allocator_traits.h
+++ b/libstdc++-v3/include/bits/allocator_traits.h
@@ -149,9 +149,11 @@ namespace std
size_type
max_size() const throw() { return size_t(-1) / sizeof(_Tp); }
-
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
void
- construct(pointer __p, const _Tp& __val) { new(__p) _Tp(__val); }
+ construct(pointer __p, const _Tp& __val) { ::new(__p) _Tp(__val); }
void
destroy(pointer __p) { __p->~_Tp(); }
diff --git a/libstdc++-v3/include/bits/basic_ios.h b/libstdc++-v3/include/bits/basic_ios.h
index 7e5b6055ef6..a9cb8d25dd9 100644
--- a/libstdc++-v3/include/bits/basic_ios.h
+++ b/libstdc++-v3/include/bits/basic_ios.h
@@ -143,6 +143,19 @@ namespace std
setstate(iostate __state)
{ this->clear(this->rdstate() | __state); }
+ // Flip the internal state on for the proper state bits, then re
+ // throws the propagated exception if bit also set in
+ // exceptions().
+ void
+ _M_setstate(iostate __state)
+ {
+ // 27.6.1.2.1 Common requirements.
+ // Turn this on without causing an ios::failure to be thrown.
+ _M_streambuf_state |= __state;
+ if (this->exceptions() & __state)
+ __throw_exception_again;
+ }
+
/**
* @brief Fast error checking.
* @return True if no error flags are set.
@@ -441,11 +454,6 @@ namespace std
void
_M_cache_locale(const locale& __loc);
-
- // Internal state setter that won't throw, only set the state bits.
- // Used to guarantee we don't throw when setting badbit.
- void
- _M_setstate(iostate __state) { _M_streambuf_state |= __state; }
};
} // namespace std
diff --git a/libstdc++-v3/include/bits/basic_ios.tcc b/libstdc++-v3/include/bits/basic_ios.tcc
index 45cc894f67c..6f690e0585d 100644
--- a/libstdc++-v3/include/bits/basic_ios.tcc
+++ b/libstdc++-v3/include/bits/basic_ios.tcc
@@ -42,7 +42,7 @@ namespace std
_M_streambuf_state = __state;
else
_M_streambuf_state = __state | badbit;
- if ((this->rdstate() & this->exceptions()))
+ if (this->exceptions() & this->rdstate())
__throw_ios_failure("basic_ios::clear");
}
diff --git a/libstdc++-v3/include/bits/basic_string.h b/libstdc++-v3/include/bits/basic_string.h
index 44df752ae56..e3d19b295a9 100644
--- a/libstdc++-v3/include/bits/basic_string.h
+++ b/libstdc++-v3/include/bits/basic_string.h
@@ -43,6 +43,7 @@
#pragma GCC system_header
#include <bits/atomicity.h>
+#include <debug/debug.h>
namespace std
{
@@ -133,7 +134,7 @@ namespace std
// _CharT() where the interface does not require it.
// 2. _M_capacity >= _M_length
// Allocated memory is always _M_capacity + (1 * sizeof(_CharT)).
- // 3. _M_references has three states:
+ // 3. _M_refcount has three states:
// -1: leaked, one reference, no ref-copies allowed, non-const.
// 0: one reference, non-const.
// n>0: n + 1 references, operations require a lock, const.
@@ -145,7 +146,7 @@ namespace std
{
size_type _M_length;
size_type _M_capacity;
- _Atomic_word _M_references;
+ _Atomic_word _M_refcount;
};
struct _Rep : _Rep_base
@@ -179,19 +180,19 @@ namespace std
bool
_M_is_leaked() const
- { return this->_M_references < 0; }
+ { return this->_M_refcount < 0; }
bool
_M_is_shared() const
- { return this->_M_references > 0; }
+ { return this->_M_refcount > 0; }
void
_M_set_leaked()
- { this->_M_references = -1; }
+ { this->_M_refcount = -1; }
void
_M_set_sharable()
- { this->_M_references = 0; }
+ { this->_M_refcount = 0; }
_CharT*
_M_refdata() throw()
@@ -216,7 +217,7 @@ namespace std
_M_dispose(const _Alloc& __a)
{
if (__builtin_expect(this != &_S_empty_rep(), false))
- if (__exchange_and_add(&this->_M_references, -1) <= 0)
+ if (__exchange_and_add(&this->_M_refcount, -1) <= 0)
_M_destroy(__a);
} // XXX MT
@@ -227,7 +228,7 @@ namespace std
_M_refcopy() throw()
{
if (__builtin_expect(this != &_S_empty_rep(), false))
- __atomic_add(&this->_M_references, 1);
+ __atomic_add(&this->_M_refcount, 1);
return _M_refdata();
} // XXX MT
@@ -608,7 +609,10 @@ namespace std
*/
const_reference
operator[] (size_type __pos) const
- { return _M_data()[__pos]; }
+ {
+ _GLIBCXX_DEBUG_ASSERT(__pos <= size());
+ return _M_data()[__pos];
+ }
/**
* @brief Subscript access to the data contained in the %string.
@@ -623,6 +627,7 @@ namespace std
reference
operator[](size_type __pos)
{
+ _GLIBCXX_DEBUG_ASSERT(__pos < size());
_M_leak();
return _M_data()[__pos];
}
@@ -729,7 +734,10 @@ namespace std
*/
basic_string&
append(const _CharT* __s)
- { return this->append(__s, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->append(__s, traits_type::length(__s));
+ }
/**
* @brief Append multiple characters.
@@ -810,7 +818,10 @@ namespace std
*/
basic_string&
assign(const _CharT* __s)
- { return this->assign(__s, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->assign(__s, traits_type::length(__s));
+ }
/**
* @brief Set value to multiple characters.
@@ -942,7 +953,10 @@ namespace std
*/
basic_string&
insert(size_type __pos, const _CharT* __s)
- { return this->insert(__pos, __s, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->insert(__pos, __s, traits_type::length(__s));
+ }
/**
* @brief Insert multiple characters.
@@ -983,6 +997,7 @@ namespace std
iterator
insert(iterator __p, _CharT __c)
{
+ _GLIBCXX_DEBUG_PEDASSERT(__p >= _M_ibegin() && __p <= _M_iend());
const size_type __pos = __p - _M_ibegin();
this->insert(_M_check(__pos), size_type(1), __c);
_M_rep()->_M_set_leaked();
@@ -1043,6 +1058,8 @@ namespace std
iterator
erase(iterator __position)
{
+ _GLIBCXX_DEBUG_PEDASSERT(__position >= _M_ibegin()
+ && __position < _M_iend());
const size_type __i = __position - _M_ibegin();
this->replace(__position, __position + 1, _M_data(), _M_data());
_M_rep()->_M_set_leaked();
@@ -1064,6 +1081,8 @@ namespace std
iterator
erase(iterator __first, iterator __last)
{
+ _GLIBCXX_DEBUG_PEDASSERT(__first >= _M_ibegin() && __first <= __last
+ && __last <= _M_iend());
const size_type __i = __first - _M_ibegin();
this->replace(__first, __last, _M_data(), _M_data());
_M_rep()->_M_set_leaked();
@@ -1150,7 +1169,10 @@ namespace std
*/
basic_string&
replace(size_type __pos, size_type __n1, const _CharT* __s)
- { return this->replace(__pos, __n1, __s, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->replace(__pos, __n1, __s, traits_type::length(__s));
+ }
/**
* @brief Replace characters with multiple characters.
@@ -1187,7 +1209,11 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2, const basic_string& __str)
- { return this->replace(__i1, __i2, __str._M_data(), __str.size()); }
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return this->replace(__i1, __i2, __str._M_data(), __str.size());
+ }
/**
* @brief Replace range of characters with C substring.
@@ -1205,7 +1231,7 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2,
- const _CharT* __s, size_type __n)
+ const _CharT* __s, size_type __n)
{ return this->replace(__i1 - _M_ibegin(), __i2 - __i1, __s, __n); }
/**
@@ -1223,7 +1249,12 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2, const _CharT* __s)
- { return this->replace(__i1, __i2, __s, traits_type::length(__s)); }
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_string(__s);
+ return this->replace(__i1, __i2, __s, traits_type::length(__s));
+ }
/**
* @brief Replace range of characters with multiple characters
@@ -1241,7 +1272,11 @@ namespace std
*/
basic_string&
replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
- { return _M_replace_aux(__i1, __i2, __n, __c); }
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ return _M_replace_aux(__i1, __i2, __n, __c);
+ }
/**
* @brief Replace range of characters with range.
@@ -1261,30 +1296,55 @@ namespace std
basic_string&
replace(iterator __i1, iterator __i2,
_InputIterator __k1, _InputIterator __k2)
- { typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral()); }
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ return _M_replace_dispatch(__i1, __i2, __k1, __k2, _Integral());
+ }
// Specializations for the common case of pointer and iterator:
// useful to avoid the overhead of temporary buffering in _M_replace.
basic_string&
- replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
- { return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
- __k1, __k2 - __k1); }
+ replace(iterator __i1, iterator __i2, _CharT* __k1, _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
basic_string&
- replace(iterator __i1, iterator __i2, const _CharT* __k1, const _CharT* __k2)
- { return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
- __k1, __k2 - __k1); }
+ replace(iterator __i1, iterator __i2,
+ const _CharT* __k1, const _CharT* __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ __k1, __k2 - __k1);
+ }
basic_string&
- replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
- { return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ replace(iterator __i1, iterator __i2, iterator __k1, iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
basic_string&
- replace(iterator __i1, iterator __i2, const_iterator __k1, const_iterator __k2)
- { return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
+ replace(iterator __i1, iterator __i2,
+ const_iterator __k1, const_iterator __k2)
+ {
+ _GLIBCXX_DEBUG_PEDASSERT(_M_ibegin() <= __i1 && __i1 <= __i2
+ && __i2 <= _M_iend());
+ __glibcxx_requires_valid_range(__k1, __k2);
+ return this->replace(__i1 - _M_ibegin(), __i2 - __i1,
__k1.base(), __k2 - __k1);
}
@@ -1459,7 +1519,10 @@ namespace std
*/
size_type
find(const _CharT* __s, size_type __pos = 0) const
- { return this->find(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->find(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find position of a character.
@@ -1514,7 +1577,10 @@ namespace std
*/
size_type
rfind(const _CharT* __s, size_type __pos = npos) const
- { return this->rfind(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->rfind(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find last position of a character.
@@ -1569,7 +1635,10 @@ namespace std
*/
size_type
find_first_of(const _CharT* __s, size_type __pos = 0) const
- { return this->find_first_of(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_of(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find position of a character.
@@ -1627,7 +1696,10 @@ namespace std
*/
size_type
find_last_of(const _CharT* __s, size_type __pos = npos) const
- { return this->find_last_of(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_of(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find last position of a character.
@@ -1686,7 +1758,10 @@ namespace std
*/
size_type
find_first_not_of(const _CharT* __s, size_type __pos = 0) const
- { return this->find_first_not_of(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_first_not_of(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find position of a different character.
@@ -1742,7 +1817,10 @@ namespace std
*/
size_type
find_last_not_of(const _CharT* __s, size_type __pos = npos) const
- { return this->find_last_not_of(__s, __pos, traits_type::length(__s)); }
+ {
+ __glibcxx_requires_string(__s);
+ return this->find_last_not_of(__s, __pos, traits_type::length(__s));
+ }
/**
* @brief Find last position of a different character.
@@ -2197,7 +2275,6 @@ namespace std
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{ return __rhs.compare(__lhs) <= 0; }
-
/**
* @brief Swap contents of two strings.
* @param lhs First string.
diff --git a/libstdc++-v3/include/bits/basic_string.tcc b/libstdc++-v3/include/bits/basic_string.tcc
index ecd8f71c45e..3a1e8468eb0 100644
--- a/libstdc++-v3/include/bits/basic_string.tcc
+++ b/libstdc++-v3/include/bits/basic_string.tcc
@@ -45,6 +45,16 @@
namespace std
{
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type* __ptr)
+ { return __ptr == 0; }
+
+ template<typename _Type>
+ inline bool
+ __is_null_pointer(_Type)
+ { return false; }
+
template<typename _CharT, typename _Traits, typename _Alloc>
const typename basic_string<_CharT, _Traits, _Alloc>::size_type
basic_string<_CharT, _Traits, _Alloc>::
@@ -141,8 +151,8 @@ namespace std
if (__beg == __end && __a == _Alloc())
return _S_empty_rep()._M_refdata();
- // NB: Not required, but considered best practice.
- if (__builtin_expect(__beg == _InIterator(), 0))
+ // NB: Not required, but considered best practice.
+ if (__builtin_expect(__is_null_pointer(__beg), 0))
__throw_logic_error("basic_string::_S_construct NULL not valid");
const size_type __dnew = static_cast<size_type>(std::distance(__beg, __end));
@@ -215,12 +225,14 @@ namespace std
__str._M_fold(__pos, __n), __a), __a)
{ }
+ // TBD: DPG annotate
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, size_type __n, const _Alloc& __a)
: _M_dataplus(_S_construct(__s, __s + __n, __a), __a)
{ }
+ // TBD: DPG annotate
template<typename _CharT, typename _Traits, typename _Alloc>
basic_string<_CharT, _Traits, _Alloc>::
basic_string(const _CharT* __s, const _Alloc& __a)
@@ -233,7 +245,8 @@ namespace std
basic_string(size_type __n, _CharT __c, const _Alloc& __a)
: _M_dataplus(_S_construct(__n, __c, __a), __a)
{ }
-
+
+ // TBD: DPG annotate
template<typename _CharT, typename _Traits, typename _Alloc>
template<typename _InputIterator>
basic_string<_CharT, _Traits, _Alloc>::
@@ -275,6 +288,7 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
assign(const _CharT* __s, size_type __n)
{
+ __glibcxx_requires_string_len(__s, __n);
if (__n > this->max_size())
__throw_length_error("basic_string::assign");
if (_M_rep()->_M_is_shared() || less<const _CharT*>()(__s, _M_data())
@@ -313,6 +327,7 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
insert(size_type __pos, const _CharT* __s, size_type __n)
{
+ __glibcxx_requires_string_len(__s, __n);
const size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::insert");
@@ -350,6 +365,7 @@ namespace std
replace(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2)
{
+ __glibcxx_requires_string_len(__s, __n2);
const size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::replace");
@@ -458,7 +474,7 @@ namespace std
void
basic_string<_CharT, _Traits, _Alloc>::reserve(size_type __res)
{
- if (__res > this->capacity() || _M_rep()->_M_is_shared())
+ if (__res != this->capacity() || _M_rep()->_M_is_shared())
{
if (__res > this->max_size())
__throw_length_error("basic_string::reserve");
@@ -727,6 +743,7 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
append(const _CharT* __s, size_type __n)
{
+ __glibcxx_requires_string_len(__s, __n);
const size_type __len = __n + this->size();
if (__len > this->capacity())
this->reserve(__len);
@@ -749,6 +766,7 @@ namespace std
operator+(const _CharT* __lhs,
const basic_string<_CharT, _Traits, _Alloc>& __rhs)
{
+ __glibcxx_requires_string(__lhs);
typedef basic_string<_CharT, _Traits, _Alloc> __string_type;
typedef typename __string_type::size_type __size_type;
const __size_type __len = _Traits::length(__lhs);
@@ -783,6 +801,8 @@ namespace std
if (__n > this->size() - __pos)
__n = this->size() - __pos;
+
+ __glibcxx_requires_string_len(__s, __n);
traits_type::copy(__s, _M_data() + __pos, __n);
// 21.3.5.7 par 3: do not append null. (good.)
@@ -794,6 +814,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
find(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
const size_type __size = this->size();
size_t __xpos = __pos;
const _CharT* __data = _M_data();
@@ -827,6 +849,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
rfind(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
const size_type __size = this->size();
if (__n <= __size)
{
@@ -866,6 +890,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
for (; __n && __pos < this->size(); ++__pos)
{
const _CharT* __p = traits_type::find(__s, __n, _M_data()[__pos]);
@@ -880,6 +906,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
size_type __size = this->size();
if (__size && __n)
{
@@ -900,6 +928,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
size_t __xpos = __pos;
for (; __xpos < this->size(); ++__xpos)
if (!traits_type::find(__s, __n, _M_data()[__xpos]))
@@ -924,6 +954,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
{
+ __glibcxx_requires_string_len(__s, __n);
+
size_type __size = this->size();
if (__size)
{
@@ -1004,6 +1036,8 @@ namespace std
basic_string<_CharT, _Traits, _Alloc>::
compare(const _CharT* __s) const
{
+ __glibcxx_requires_string(__s);
+
const size_type __size = this->size();
const size_type __osize = traits_type::length(__s);
const size_type __len = std::min(__size, __osize);
@@ -1019,6 +1053,8 @@ namespace std
basic_string <_CharT, _Traits, _Alloc>::
compare(size_type __pos, size_type __n1, const _CharT* __s) const
{
+ __glibcxx_requires_string(__s);
+
const size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
@@ -1038,6 +1074,8 @@ namespace std
compare(size_type __pos, size_type __n1, const _CharT* __s,
size_type __n2) const
{
+ __glibcxx_requires_string_len(__s, __n2);
+
const size_type __size = this->size();
if (__pos > __size)
__throw_out_of_range("basic_string::compare");
diff --git a/libstdc++-v3/include/bits/c++config b/libstdc++-v3/include/bits/c++config
index 0fd2c0364bc..cb880917e55 100644
--- a/libstdc++-v3/include/bits/c++config
+++ b/libstdc++-v3/include/bits/c++config
@@ -35,7 +35,7 @@
#include <bits/os_defines.h>
// The current version of the C++ library in compressed ISO date format.
-#define __GLIBCXX__ 20031027
+#define __GLIBCXX__ 20031230
// Allow use of "export template." This is currently not a feature
// that g++ supports.
@@ -51,11 +51,27 @@
# define _GLIBCXX_EXTERN_TEMPLATE 1
#endif
-// To enable older, ARM-style iostreams and other anachronisms use this.
-//#define _GLIBCXX_DEPRECATED 1
+// To enable debug mode.
+namespace __gnu_norm
+{
+ using namespace std;
+}
-// Use corrected code from the committee library group's issues list.
-//#define _GLIBCXX_RESOLVE_LIB_DEFECTS 1
+namespace __gnu_debug_def { }
+
+namespace __gnu_debug
+{
+ using namespace __gnu_debug_def __attribute__ ((strong));
+}
+
+namespace std
+{
+#ifdef _GLIBCXX_DEBUG
+ using namespace __gnu_debug_def __attribute__ ((strong));
+#else
+ using namespace __gnu_norm __attribute__ ((strong));
+#endif
+}
// The remainder of the prewritten config is automatic; all the
// user hooks are listed above.
diff --git a/libstdc++-v3/include/bits/concurrence.h b/libstdc++-v3/include/bits/concurrence.h
new file mode 100644
index 00000000000..68b9ab7a9f6
--- /dev/null
+++ b/libstdc++-v3/include/bits/concurrence.h
@@ -0,0 +1,54 @@
+// Support for concurrent programing -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _CONCURRENCE
+#define _CONCURRENCE 1
+
+// GCC's thread abstraction layer
+#include "bits/gthr.h"
+
+#if __GTHREADS
+# ifdef __GTHREAD_MUTEX_INIT
+# define __glibcxx_mutex_define_initialized(NAME) \
+__gthread_mutex_t NAME = __GTHREAD_MUTEX_INIT
+# else
+# define __glibcxx_mutex_define_initialized(NAME) \
+__gthread_mutex_t NAME; \
+__GTHREAD_MUTEX_INIT_FUNCTION(&NAME)
+# endif
+# define __glibcxx_mutex_lock(LOCK) __gthread_mutex_lock(&LOCK)
+# define __glibcxx_mutex_unlock(LOCK) __gthread_mutex_unlock(&LOCK)
+#else
+# define __glibcxx_mutex_define_initialized(NAME)
+# define __glibcxx_mutex_lock(LOCK)
+# define __glibcxx_mutex_unlock(LOCK)
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/bits/demangle.h b/libstdc++-v3/include/bits/demangle.h
index 4d2fa395a42..2c240162e90 100644
--- a/libstdc++-v3/include/bits/demangle.h
+++ b/libstdc++-v3/include/bits/demangle.h
@@ -28,6 +28,10 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
+// This file implements demangling of "C++ ABI for Itanium"-mangled symbol
+// and type names as described in Revision 1.73 of the C++ ABI as can be found
+// at http://www.codesourcery.com/cxx-abi/abi.html#mangling
+
#ifndef _DEMANGLER_H
#define _DEMANGLER_H 1
@@ -40,33 +44,16 @@
#define _GLIBCXX_DEMANGLER_DOUT(cntrl, data)
#define _GLIBCXX_DEMANGLER_DOUT_ENTERING(x)
#define _GLIBCXX_DEMANGLER_DOUT_ENTERING2(x)
-#define _GLIBCXX_DEMANGLER_RETURN \
- return M_result
-#define _GLIBCXX_DEMANGLER_RETURN2 \
- return M_result
+#define _GLIBCXX_DEMANGLER_DOUT_ENTERING3(x)
+#define _GLIBCXX_DEMANGLER_RETURN return M_result
+#define _GLIBCXX_DEMANGLER_RETURN2 return M_result
+#define _GLIBCXX_DEMANGLER_RETURN3
#define _GLIBCXX_DEMANGLER_FAILURE \
do { M_result = false; return false; } while(0)
#else
#define _GLIBCXX_DEMANGLER_CWDEBUG 1
#endif
-// The following defines change the behaviour of the demangler. The
-// default behaviour is that none of these macros is defined.
-
-// _GLIBCXX_DEMANGLER_STYLE_VOID
-// Default behaviour: int f()
-// Uses (void) instead of (): int f(void)
-
-// _GLIBCXX_DEMANGLER_STYLE_LITERAL
-// Default behaviour: (long)13,
-// (unsigned long long)19
-// Use extensions 'u', 'l' and 'll' for integral
-// literals (as in template arguments): 13l, 19ull
-
-// _GLIBCXX_DEMANGLER_STYLE_LITERAL_INT
-// Default behaviour: 4
-// Use also an explicit cast for int in literals: (int)4
-
namespace __gnu_cxx
{
namespace demangler
@@ -78,7 +65,7 @@ namespace __gnu_cxx
template_template_param,
nested_name_prefix,
nested_name_template_prefix,
- unscoped_template_name,
+ unscoped_template_name
};
struct substitution_st
@@ -126,7 +113,9 @@ namespace __gnu_cxx
template<typename Allocator>
class qualifier
{
- typedef std::basic_string<char, std::char_traits<char>, Allocator>
+ typedef typename Allocator::template rebind<char>::other
+ char_Allocator;
+ typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
private:
@@ -192,19 +181,50 @@ namespace __gnu_cxx
part_of_substitution(void) const
{ return M_part_of_substitution; }
+#if _GLIBCXX_DEMANGLER_CWDEBUG
+ friend std::ostream& operator<<(std::ostream& os, qualifier const& qual)
+ {
+ os << (char)qual.M_qualifier1;
+ if (qual.M_qualifier1 == vendor_extension ||
+ qual.M_qualifier1 == array ||
+ qual.M_qualifier1 == pointer_to_member)
+ os << " [" << qual.M_optional_type << ']';
+ else if (qual.M_qualifier1 == 'K' ||
+ qual.M_qualifier1 == 'V' ||
+ qual.M_qualifier1 == 'r')
+ {
+ if (qual.M_qualifier2)
+ {
+ os << (char)qual.M_qualifier2;
+ if (qual.M_qualifier3)
+ os << (char)qual.M_qualifier3;
+ }
+ }
+ return os;
+ }
+#endif
};
template<typename Allocator>
class qualifier_list
{
- typedef std::basic_string<char, std::char_traits<char>, Allocator>
+ typedef typename Allocator::template rebind<char>::other
+ char_Allocator;
+ typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
private:
- bool M_printing_suppressed;
- std::vector<qualifier<Allocator>, Allocator> M_qualifier_starts;
+ mutable bool M_printing_suppressed;
+ typedef qualifier<Allocator> qual;
+ typedef typename Allocator::template rebind<qual>::other qual_Allocator;
+ typedef std::vector<qual, qual_Allocator> qual_vector;
+ qual_vector M_qualifier_starts;
session<Allocator>& M_demangler;
+ void decode_KVrA(string_type& prefix, string_type& postfix, int cvq,
+ typename qual_vector::
+ const_reverse_iterator const& iter_array) const;
+
public:
qualifier_list(session<Allocator>& demangler_obj)
: M_printing_suppressed(false), M_demangler(demangler_obj)
@@ -240,7 +260,7 @@ namespace __gnu_cxx
void
decode_qualifiers(string_type& prefix,
string_type& postfix,
- bool member_function_pointer_qualifiers);
+ bool member_function_pointer_qualifiers) const;
bool
suppressed(void) const
@@ -254,13 +274,86 @@ namespace __gnu_cxx
size(void) const
{ return M_qualifier_starts.size(); }
+#if _GLIBCXX_DEMANGLER_CWDEBUG
+ friend std::ostream& operator<<(std::ostream& os, qualifier_list const& list)
+ {
+ typename qual_vector::const_iterator
+ iter = list.M_qualifier_starts.begin();
+ if (iter != list.M_qualifier_starts.end())
+ {
+ os << "{ " << *iter;
+ while (++iter != list.M_qualifier_starts.end())
+ os << ", " << *iter;
+ os << " }";
+ }
+ else
+ os << "{ }";
+ return os;
+ }
+#endif
};
+ struct implementation_details
+ {
+ private:
+ unsigned int M_style;
+
+ public:
+ // The following flags change the behaviour of the demangler. The
+ // default behaviour is that none of these flags is set.
+
+ static unsigned int const style_void = 1;
+ // Default behaviour: int f()
+ // Use (void) instead of (): int f(void)
+
+ static unsigned int const style_literal = 2;
+ // Default behaviour: (long)13,
+ // (unsigned long long)19
+ // Use extensions 'u', 'l' and 'll' for integral
+ // literals (as in template arguments): 13l, 19ull
+
+ static unsigned int const style_literal_int = 4;
+ // Default behaviour: 4
+ // Use also an explicit
+ // cast for int in literals: (int)4
+
+ static unsigned int const style_compact_expr_ops = 8;
+ // Default behaviour: (i) < (3), sizeof (int)
+ // Don't output spaces around
+ // operators in expressions: (i)<(3), sizeof(int)
+
+ static unsigned int const style_sizeof_typename = 16;
+ // Default behaviour: sizeof (X::t)
+ // Put 'typename' infront of <nested-name>
+ // types inside a 'sizeof': sizeof (typename X::t)
+
+ public:
+ implementation_details(unsigned int style_flags = 0) :
+ M_style(style_flags) { }
+ virtual ~implementation_details() { }
+ bool get_style_void(void) const
+ { return (M_style & style_void); }
+ bool get_style_literal(void) const
+ { return (M_style & style_literal); }
+ bool get_style_literal_int(void) const
+ { return (M_style & style_literal_int); }
+ bool get_style_compact_expr_ops(void) const
+ { return (M_style & style_compact_expr_ops); }
+ bool get_style_sizeof_typename(void) const
+ { return (M_style & style_sizeof_typename); }
+ // This can be overridden by user implementations.
+ virtual bool decode_real(char* /* output */, unsigned long* /* input */,
+ size_t /* size_of_real */) const
+ { return false; }
+ };
+
template<typename Allocator>
class session
{
friend class qualifier_list<Allocator>;
- typedef std::basic_string<char, std::char_traits<char>, Allocator>
+ typedef typename Allocator::template rebind<char>::other
+ char_Allocator;
+ typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
private:
@@ -277,33 +370,36 @@ namespace __gnu_cxx
bool M_name_is_conversion_operator;
bool M_template_args_need_space;
string_type M_function_name;
- std::vector<int, Allocator> M_template_arg_pos;
+ typedef typename Allocator::template rebind<int>::other
+ int_Allocator;
+ typedef typename Allocator::template rebind<substitution_st>::other
+ subst_Allocator;
+ std::vector<int, int_Allocator> M_template_arg_pos;
int M_template_arg_pos_offset;
- std::vector<substitution_st, Allocator> M_substitutions_pos;
+ std::vector<substitution_st, subst_Allocator> M_substitutions_pos;
+ implementation_details const& M_implementation_details;
#if _GLIBCXX_DEMANGLER_CWDEBUG
bool M_inside_add_substitution;
#endif
public:
- explicit session(char const* in, int len)
+ explicit session(char const* in, int len,
+ implementation_details const& id = implementation_details())
: M_str(in), M_pos(0), M_maxpos(len - 1), M_result(true),
M_inside_template_args(0), M_inside_type(0),
M_inside_substitution(0), M_saw_destructor(false),
M_name_is_cdtor(false), M_name_is_template(false),
M_name_is_conversion_operator(false),
- M_template_args_need_space(false), M_template_arg_pos_offset(0)
+ M_template_args_need_space(false), M_template_arg_pos_offset(0),
+ M_implementation_details(id)
#if _GLIBCXX_DEMANGLER_CWDEBUG
, M_inside_add_substitution(false)
#endif
{ }
static int
- decode_encoding(string_type& output, char const* input, int len);
-
- bool
- decode_type_with_postfix(string_type& prefix,
- string_type& postfix,
- qualifier_list<Allocator>* qualifiers = NULL);
+ decode_encoding(string_type& output, char const* input, int len,
+ implementation_details const& id = implementation_details());
bool
decode_type(string_type& output,
@@ -325,6 +421,10 @@ namespace __gnu_cxx
{ return (M_pos > M_maxpos) ? 0 : M_str[M_pos]; }
char
+ next_peek(void) const
+ { return (M_pos >= M_maxpos) ? 0 : M_str[M_pos + 1]; }
+
+ char
next(void)
{ return (M_pos >= M_maxpos) ? 0 : M_str[++M_pos]; }
@@ -345,6 +445,8 @@ namespace __gnu_cxx
substitution_nt sub_type,
int number_of_prefixes);
+ bool decode_type_with_postfix(string_type& prefix,
+ string_type& postfix, qualifier_list<Allocator>* qualifiers = NULL);
bool decode_bare_function_type(string_type& output);
bool decode_builtin_type(string_type& output);
bool decode_call_offset(string_type& output);
@@ -366,8 +468,9 @@ namespace __gnu_cxx
qualifier_list<Allocator>* qualifiers = NULL);
bool decode_unqualified_name(string_type& output);
bool decode_unscoped_name(string_type& output);
- bool decode_decimal_integer(string_type& output);
+ bool decode_non_negative_decimal_integer(string_type& output);
bool decode_special_name(string_type& output);
+ bool decode_real(string_type& output, size_t size_of_real);
};
template<typename Allocator>
@@ -425,6 +528,8 @@ namespace __gnu_cxx
subst += "::";
if (current() == 'S')
decode_substitution(subst);
+ else if (current() == 'T')
+ decode_template_param(subst);
else
decode_unqualified_name(subst);
}
@@ -460,13 +565,14 @@ namespace __gnu_cxx
inline char tolower(char c) { return isupper(c) ? c - 'A' + 'a' : c; }
//
- // <decimal-integer> ::= 0
- // ::= 1|2|3|4|5|6|7|8|9 [<digit>+]
- // <digit> ::= 0|1|2|3|4|5|6|7|8|9
+ // <non-negative decimal integer> ::= 0
+ // ::= 1|2|3|4|5|6|7|8|9 [<digit>+]
+ // <digit> ::= 0|1|2|3|4|5|6|7|8|9
//
template<typename Allocator>
bool
- session<Allocator>::decode_decimal_integer(string_type& output)
+ session<Allocator>::
+ decode_non_negative_decimal_integer(string_type& output)
{
char c = current();
if (c == '0')
@@ -487,7 +593,7 @@ namespace __gnu_cxx
return M_result;
}
- // <number> ::= [n] <decimal-integer>
+ // <number> ::= [n] <non-negative decimal integer>
//
template<typename Allocator>
bool
@@ -495,12 +601,12 @@ namespace __gnu_cxx
{
_GLIBCXX_DEMANGLER_DOUT_ENTERING("decode_number");
if (current() != 'n')
- decode_decimal_integer(output);
+ decode_non_negative_decimal_integer(output);
else
{
output += '-';
eat_current();
- decode_decimal_integer(output);
+ decode_non_negative_decimal_integer(output);
}
_GLIBCXX_DEMANGLER_RETURN;
}
@@ -821,6 +927,66 @@ namespace __gnu_cxx
template<typename Allocator>
bool
+ session<Allocator>::decode_real(string_type& output, size_t size_of_real)
+ {
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING("decode_real");
+
+ unsigned long words[4]; // 32 bit per long, maximum of 128 bits.
+ unsigned long* word = &words[0];
+
+ int saved_pos;
+ store(saved_pos);
+
+ // The following assumes that leading zeroes are also included in the
+ // mangled name, I am not sure that is conforming to the C++-ABI, but
+ // it is what g++ does.
+ unsigned char nibble, c = current();
+ for(size_t word_cnt = size_of_real / 4; word_cnt > 0; --word_cnt)
+ {
+ for (int nibble_cnt = 0; nibble_cnt < 8; ++nibble_cnt)
+ {
+ // Translate character into nibble.
+ if (c < '0' || c > 'f')
+ _GLIBCXX_DEMANGLER_FAILURE;
+ if (c <= '9')
+ nibble = c - '0';
+ else if (c >= 'a')
+ nibble = c - 'a' + 10;
+ else
+ _GLIBCXX_DEMANGLER_FAILURE;
+ // Write nibble into word array.
+ if (nibble_cnt == 0)
+ *word = nibble << 28;
+ else
+ *word |= (nibble << (28 - 4 * nibble_cnt));
+ c = next();
+ }
+ ++word;
+ }
+ char buf[24];
+ if (M_implementation_details.decode_real(buf, words, size_of_real))
+ {
+ output += buf;
+ _GLIBCXX_DEMANGLER_RETURN;
+ }
+ restore(saved_pos);
+
+ output += '[';
+ c = current();
+ for(size_t nibble_cnt = 0; nibble_cnt < 2 * size_of_real; ++nibble_cnt)
+ {
+ if (c < '0' || c > 'f' || (c > '9' && c < 'a'))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ output += c;
+ c = next();
+ }
+ output += ']';
+
+ _GLIBCXX_DEMANGLER_RETURN;
+ }
+
+ template<typename Allocator>
+ bool
session<Allocator>::decode_literal(string_type& output)
{
_GLIBCXX_DEMANGLER_DOUT_ENTERING("decode_literal");
@@ -831,7 +997,7 @@ namespace __gnu_cxx
_GLIBCXX_DEMANGLER_FAILURE;
eat_current();
if ((M_pos += decode_encoding(output, M_str + M_pos,
- M_maxpos - M_pos + 1)) < 0)
+ M_maxpos - M_pos + 1, M_implementation_details)) < 0)
_GLIBCXX_DEMANGLER_FAILURE;
}
else
@@ -847,34 +1013,39 @@ namespace __gnu_cxx
_GLIBCXX_DEMANGLER_RETURN;
}
char c = current();
-#ifdef _GLIBCXX_DEMANGLER_STYLE_LITERAL
- if (c == 'i' || c == 'j' || c == 'l' ||
- c == 'm' || c == 'x' || c == 'y')
+ if ((c == 'i' || c == 'j' || c == 'l' ||
+ c == 'm' || c == 'x' || c == 'y') &&
+ M_implementation_details.get_style_literal())
eat_current();
- else
-#else
-#ifndef _GLIBCXX_DEMANGLER_STYLE_LITERAL_INT
- if (c == 'i')
+ else if (c == 'i' &&
+ !M_implementation_details.get_style_literal_int())
eat_current();
else
-#endif
-#endif
{
output += '(';
if (!decode_type(output))
_GLIBCXX_DEMANGLER_FAILURE;
output += ')';
}
- if (!decode_number(output))
+ if (c >= 'd' && c <= 'g')
+ {
+ size_t size_of_real = (c == 'd') ? sizeof(double) :
+ ((c == 'f') ? sizeof(float) :
+ (c == 'e') ? sizeof(long double) : 16);
+ if (!decode_real(output, size_of_real))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ }
+ else if (!decode_number(output))
_GLIBCXX_DEMANGLER_FAILURE;
-#ifdef _GLIBCXX_DEMANGLER_STYLE_LITERAL
- if (c == 'j' || c == 'm' || c == 'y')
- output += 'u';
- if (c == 'l' || c == 'm')
- output += 'l';
- if (c == 'x' || c == 'y')
- output += "ll";
-#endif
+ if (M_implementation_details.get_style_literal())
+ {
+ if (c == 'j' || c == 'm' || c == 'y')
+ output += 'u';
+ if (c == 'l' || c == 'm')
+ output += 'l';
+ if (c == 'x' || c == 'y')
+ output += "ll";
+ }
}
_GLIBCXX_DEMANGLER_RETURN;
}
@@ -884,6 +1055,7 @@ namespace __gnu_cxx
// na # new[]
// dl # delete
// da # delete[]
+ // ps # + (unary)
// ng # - (unary)
// ad # & (unary)
// de # * (unary)
@@ -925,37 +1097,36 @@ namespace __gnu_cxx
// pt # ->
// cl # ()
// ix # []
- // qu # ?
- // sz # sizeof
- // sr # scope resolution (::), see below
+ // qu # ?
+ // st # sizeof (a type)
+ // sz # sizeof (an expression)
// cv <type> # (cast)
// v <digit> <source-name> # vendor extended operator
//
- //
// Symbol operator codes exist of two characters, we need to find a
// quick hash so that their names can be looked up in a table.
//
// The puzzle :)
// Shift the rows so that there is at most one character per column.
//
- // A perfect solution:
+ // A perfect solution (Oh no, it's THE MATRIX!):
// horizontal
- // ..................................... offset + 'a'
- // a, ||a||d|||||||||n||||s|||||||||||||||||| 2
- // c, || || ||lm|o||| |||| |||||||||||||||||| -3
- // d, || a| |e | ||l |||| |||v|||||||||||||| 3
- // e, || | | o q| |||| ||| |||||||||||||| -4
- // g, |e | | | t||| ||| |||||||||||||| -3
- // i, | | | | ||| ||| ||||||||||x||| 12
- // l, | | | e ||| ||| ||st|||||| ||| 9
- // m, | | | ||| ||| |i lm|||| ||| 18
- // n, a e g ||t |w| | |||| ||| 0
- // o, || | | | ||o| r|| 19
- // p, lm p | t || | || 6
- // q, | || u || 14
- // r, | |m |s 20
- // s, r z | 6
- // .....................................
+ // ....................................... offset + 'a'
+ // a, a||d|||||||||n||||s|||||||||||||||||||| 0
+ // c, || |||||||lm o||| |||||||||||||||||||| 0
+ // d, || a|||e|| l|| ||||||v||||||||||||| 4
+ // e, || ||| || || |||o|q ||||||||||||| 8
+ // g, || ||| || || e|| | ||||||||t|||| 15
+ // i, || ||| || || || | |||||||| |||x 15
+ // l, |e ||| || st || | |||||||| ||| -2
+ // m, | |i| lm || | |||||||| ||| -2
+ // n, a e g t| w |||||||| ||| 1
+ // o, | ||||o||r ||| 16
+ // p, | ||lm |p st| 17
+ // q, | u| | | 6
+ // r, m s | | 9
+ // s, t z 12
+ // .......................................
// ^ ^__ second character
// |___ first character
//
@@ -981,65 +1152,71 @@ namespace __gnu_cxx
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,
// a b c d e f g h i j k
- 0, -95, 0,-100, -94,-101, 0,-100, 0, -85, 0, 0,
+ 0, -97, 0, -97, -93, -89, 0, -82, 0, -82, 0, 0,
// l m n o p q r s t u v
- -88, -79, -97, -78, -91, -83, -77, -91, 0, 0, 0,
+ -99, -99, -96, -81, -80, -91, -88, -85, 0, 0, 0,
#else
// a b c d e f g h i j k
- 0, 161, 0, 156, 162, 155, 0, 156, 0, 171, 0, 0,
+ 0, 159, 0, 159, 163, 167, 0, 174, 0, 174, 0, 0,
// l m n o p q r s t u v
- 168, 177, 159, 178, 165, 173, 179, 165, 0, 0, 0,
+ 157, 157, 160, 175, 176, 165, 168, 171, 0, 0, 0,
#endif
// ... more zeros
};
+ enum xary_nt {
+ unary,
+ binary,
+ trinary
+ };
+
struct entry_st
{
char const* opcode;
char const* symbol_name;
- bool unary;
+ xary_nt type;
};
entry_st const symbol_name_table_c[39] = {
- { "na", "operator new[]", true },
- { "ge", "operator>=", false },
- { "aa", "operator&&", false },
- { "da", "operator delete[]", true },
- { "ne", "operator!=", false },
- { "ad", "operator&", true }, // unary
- { "ng", "operator-", true }, // unary
- { "de", "operator*", true }, // unary
- { "cl", "operator()", true },
- { "cm", "operator,", false },
- { "eo=", "operator^", false },
- { "co", "operator~", false },
- { "eq", "operator==", false },
- { "le", "operator<=", false },
- { "dl", "operator delete", true },
- { "an=", "operator&", false },
- { "gt", "operator>", false },
- { "pl=", "operator+", false },
- { "pm", "operator->*", false },
- { "nt", "operator!", true },
- { "as=", "operator", false },
- { "pp", "operator++", true },
- { "nw", "operator new", true },
- { "sr", "::", true },
- { "dv=", "operator/", false },
- { "pt", "operator->", false },
- { "mi=", "operator-", false },
- { "ls=", "operator<<", false },
- { "lt", "operator<", false },
- { "ml=", "operator*", false },
- { "mm", "operator--", true },
- { "sz", "sizeof", true },
- { "rm=", "operator%", false },
- { "oo", "operator||", false },
- { "qu", "operator?", false },
- { "ix", "operator[]", true },
- { "or=", "operator|", false },
- { "", NULL, false },
- { "rs=", "operator>>", false }
+ { "aa", "operator&&", binary },
+ { "na", "operator new[]", unary },
+ { "le", "operator<=", binary },
+ { "ad", "operator&", unary },
+ { "da", "operator delete[]", unary },
+ { "ne", "operator!=", binary },
+ { "mi=", "operator-", binary },
+ { "ng", "operator-", unary },
+ { "de", "operator*", unary },
+ { "ml=", "operator*", binary },
+ { "mm", "operator--", unary },
+ { "cl", "operator()", unary },
+ { "cm", "operator,", binary },
+ { "an=", "operator&", binary },
+ { "co", "operator~", binary },
+ { "dl", "operator delete", unary },
+ { "ls=", "operator<<", binary },
+ { "lt", "operator<", binary },
+ { "as=", "operator", binary },
+ { "ge", "operator>=", binary },
+ { "nt", "operator!", unary },
+ { "rm=", "operator%", binary },
+ { "eo=", "operator^", binary },
+ { "nw", "operator new", unary },
+ { "eq", "operator==", binary },
+ { "dv=", "operator/", binary },
+ { "qu", "operator?", trinary },
+ { "rs=", "operator>>", binary },
+ { "pl=", "operator+", binary },
+ { "pm", "operator->*", binary },
+ { "oo", "operator||", binary },
+ { "st", "sizeof", unary },
+ { "pp", "operator++", unary },
+ { "or=", "operator|", binary },
+ { "gt", "operator>", binary },
+ { "ps", "operator+", unary },
+ { "pt", "operator->", binary },
+ { "sz", "sizeof", unary },
+ { "ix", "operator[]", unary }
};
template<typename Allocator>
@@ -1070,11 +1247,11 @@ namespace __gnu_cxx
if (opcode1 != current())
output += '=';
eat_current();
- if (hash == 27 || hash == 28)
+ if (hash == 16 || hash == 17)
M_template_args_need_space = true;
_GLIBCXX_DEMANGLER_RETURN;
}
- else if (opcode0 == 'c' && opcode1 == 'v')
+ else if (opcode0 == 'c' && opcode1 == 'v') // casting operator
{
eat_current();
output += "operator ";
@@ -1101,10 +1278,15 @@ namespace __gnu_cxx
//
// <expression> ::= <unary operator-name> <expression>
// ::= <binary operator-name> <expression> <expression>
+ // ::= <trinary operator-name> <expression> <expression> <expression>
+ // ::= st <type>
+ // ::= <template-param>
+ // ::= sr <type> <unqualified-name> # dependent name
+ // ::= sr <type> <unqualified-name> <template-args> # dependent template-id
// ::= <expr-primary>
//
- // <expr-primary> ::= <template-param> # Starts with a T
- // ::= L <type> <value number> E # literal
+ // <expr-primary> ::= L <type> <value number> E # integer literal
+ // ::= L <type> <value float> E # floating literal
// ::= L <mangled-name> E # external name
//
template<typename Allocator>
@@ -1127,6 +1309,86 @@ namespace __gnu_cxx
eat_current();
_GLIBCXX_DEMANGLER_RETURN;
}
+ else if (current() == 's')
+ {
+ char opcode1 = next();
+ if (opcode1 == 't' || opcode1 == 'z')
+ {
+ eat_current();
+ if (M_implementation_details.get_style_compact_expr_ops())
+ output += "sizeof(";
+ else
+ output += "sizeof (";
+ if (opcode1 == 't')
+ {
+ // I cannot think of a mangled name that is valid for both cases
+ // when just replacing the 't' by a 'z' or vica versa, which
+ // indicates that there is no ambiguity that dictates the need
+ // for a seperate "st" case, except to be able catch invalid
+ // mangled names. However there CAN be ambiguity in the demangled
+ // name when there are both a type and a symbol of the same name,
+ // which then leads to different encoding (of course) with
+ // sizeof (type) or sizeof (expression) respectively, but that
+ // ambiguity is not per se related to "sizeof" except that that
+ // is the only place where both a type AND an expression are valid
+ // in as part of a (template function) type.
+ //
+ // Example:
+ //
+ // struct B { typedef int t; };
+ // struct A : public B { static int t[2]; };
+ // template<int i, int j> struct C { typedef int q; };
+ // template<int i, typename T>
+ // void f(typename C<sizeof (typename T::t),
+ // sizeof (T::t)>::q) { }
+ // void instantiate() { f<5, A>(0); }
+ //
+ // Leads to _Z1fILi5E1AEvN1CIXstN1T1tEEXszsrS2_1tEE1qE which
+ // demangles as
+ // void f<5, A>(C<sizeof (T::t), sizeof (T::t)>::q)
+ //
+ // This is ambiguity is very unlikely to happen and it is kind
+ // of fuzzy to detect when adding a 'typename' makes sense.
+ //
+ if (M_implementation_details.get_style_sizeof_typename())
+ {
+ // We can only get here inside a template parameter,
+ // so this is syntactically correct if the given type is
+ // a typedef. The only disadvantage is that it is inconsistent
+ // with all other places where the 'typename' keyword should be
+ // used and we don't.
+ // With this, the above example will demangle as
+ // void f<5, A>(C<sizeof (typename T::t), sizeof (T::t)>::q)
+ if (current() == 'N' || // <nested-name>
+ // This should be a safe bet.
+ (current() == 'S' &&
+ next_peek() == 't')) // std::something, guess that
+ // this involves a typedef.
+ output += "typename ";
+ }
+ if (!decode_type(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ }
+ else
+ {
+ if (!decode_expression(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ }
+ output += ')';
+ _GLIBCXX_DEMANGLER_RETURN;
+ }
+ else if (current() == 'r')
+ {
+ eat_current();
+ if (!decode_type(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ output += "::";
+ if (!decode_unqualified_name(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ if (current() != 'I' || decode_template_args(output))
+ _GLIBCXX_DEMANGLER_RETURN;
+ }
+ }
else
{
char opcode0 = current();
@@ -1147,33 +1409,60 @@ namespace __gnu_cxx
if (entry.opcode[0] == opcode0 && entry.opcode[1] == opcode1
&& (opcode1 == current() || entry.opcode[2] == '='))
{
- char const* p = entry.symbol_name;
- if (!strncmp("operator", p, 8))
- p += 8;
- if (*p == ' ')
- ++p;
- if (entry.unary)
- output += p;
+ char const* op = entry.symbol_name + 8; // Skip "operator".
+ if (*op == ' ') // operator new and delete.
+ ++op;
+ if (entry.type == unary)
+ output += op;
bool is_eq = (opcode1 != current());
eat_current();
+ if (index == 34 && M_inside_template_args) // operator>
+ output += '(';
output += '(';
if (!decode_expression(output))
_GLIBCXX_DEMANGLER_FAILURE;
output += ')';
- if (!entry.unary)
+ if (entry.type != unary)
{
- output += ' ';
- output += p;
+ if (!M_implementation_details.get_style_compact_expr_ops())
+ output += ' ';
+ output += op;
if (is_eq)
output += '=';
- output += ' ';
+ if (!M_implementation_details.get_style_compact_expr_ops())
+ output += ' ';
output += '(';
if (!decode_expression(output))
_GLIBCXX_DEMANGLER_FAILURE;
output += ')';
+ if (index == 34 && M_inside_template_args)
+ output += ')';
+ if (entry.type == trinary)
+ {
+ if (M_implementation_details.get_style_compact_expr_ops())
+ output += ":(";
+ else
+ output += " : (";
+ if (!decode_expression(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ output += ')';
+ }
}
_GLIBCXX_DEMANGLER_RETURN;
}
+ else if (opcode0 == 'c' &&
+ opcode1 == 'v') // casting operator.
+ {
+ eat_current();
+ output += '(';
+ if (!decode_type(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ output += ")(";
+ if (!decode_expression(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ output += ')';
+ _GLIBCXX_DEMANGLER_RETURN;
+ }
}
}
}
@@ -1183,8 +1472,9 @@ namespace __gnu_cxx
//
// <template-args> ::= I <template-arg>+ E
// <template-arg> ::= <type> # type or template
- // ::= L <type> <value number> E # literal
- // ::= L_Z <encoding> E # external name
+ // ::= L <type> <value number> E # integer literal
+ // ::= L <type> <value float> E # floating literal
+ // ::= L <mangled-name> E # external name
// ::= X <expression> E # expression
template<typename Allocator>
bool
@@ -1242,7 +1532,12 @@ namespace __gnu_cxx
}
// <bare-function-type> ::=
- // <signature type>+ # types are parameter types
+ // <signature type>+ # Types are parameter types.
+ //
+ // Note that the possible return type of the <bare-function-type>
+ // has already been eaten before we call this function. This makes
+ // our <bare-function-type> slightly different from the one in
+ // the C++-ABI description.
//
template<typename Allocator>
bool
@@ -1257,8 +1552,7 @@ namespace __gnu_cxx
M_saw_destructor = false;
_GLIBCXX_DEMANGLER_RETURN;
}
-#ifndef _GLIBCXX_DEMANGLER_STYLE_VOID
- if (current() == 'v')
+ if (current() == 'v' && !M_implementation_details.get_style_void())
{
eat_current();
if (current() != 'E' && current() != 0)
@@ -1267,7 +1561,6 @@ namespace __gnu_cxx
M_saw_destructor = false;
_GLIBCXX_DEMANGLER_RETURN;
}
-#endif
output += '(';
M_template_args_need_space = false;
if (!decode_type(output)) // Must have at least one parameter.
@@ -1325,8 +1618,8 @@ namespace __gnu_cxx
// <Q>F<R><B>E ==> R (Q)B "<R>", "<B>" (<B> recursive)
// and "F<R><B>E".
//
- // Note that if <R> has postfix qualifiers (an array), then those
- // are added AFTER the (member) function type. For example:
+ // Note that if <R> has postfix qualifiers (an array or function), then
+ // those are added AFTER the (member) function type. For example:
// <Q>FPA<R><B>E ==> R (*(Q)B) [], where the PA added the prefix
// "(*" and the postfix ") []".
//
@@ -1341,10 +1634,13 @@ namespace __gnu_cxx
// <Q>[K|V|r]+ ==> [ const| volatile| restrict]+Q "KVr..."
// <Q>U<S> ==> SQ "U<S>..."
// <Q>M<C> ==> C::*Q "M<C>..." (<C> recurs.)
- // A<I> ==> [I] "A<I>..." (<I> recurs.)
+ // A<I> ==> [I] "A<I>..." (<I> recurs.)
// <Q>A<I> ==> (Q) [I] "A<I>..." (<I> recurs.)
- // Note that when <Q> ends on an A<I2> then the brackets are omitted:
- // A<I2>A<I> ==> [I2][I]
+ // Note that when <Q> ends on an A<I2> then the brackets are omitted
+ // and no space is written between the two:
+ // A<I2>A<I> ==> [I2][I]
+ // If <Q> ends on [KVr]+, which can happen in combination with
+ // substitutions only, then special handling is required, see below.
//
// A <substitution> is handled with an input position switch during which
// new substitutions are turned off. Because recursive handling of types
@@ -1372,16 +1668,98 @@ namespace __gnu_cxx
// For some weird reason, g++ (3.2.1) does not add substitutions for
// qualified member function pointers. I think that is another bug.
//
+
+ // In the case of
+ // <Q>A<I>
+ // where <Q> ends on [K|V|r]+ then that part should be processed as
+ // if it was behind the A<I> instead of in front of it. This is
+ // because a constant array of ints is normally always mangled as
+ // an array of constant ints. KVr qualifiers can end up in front
+ // of an array when the array is part of a substitution or template
+ // parameter, but the demangling should still result in the same
+ // syntax; thus KA2_i (const array of ints) must result in the same
+ // demangling as A2_Ki (array of const ints). As a result we must
+ // demangle ...[...[[KVr]+A<I0>][KVr]+A<I1>]...[KVr]+A<In>[KVr]+
+ // as A<I0>A<I1>...A<In>[KVr]+ where each K, V and r in the series
+ // collapses to a single character at the right of the string.
+ // For example:
+ // VA9_KrA6_KVi --> A9_A6_KVri --> int volatile const restrict [9][6]
+ // Note that substitutions are still added as usual (the translation
+ // to A9_A6_KVri does not really happen).
+ //
+ // This decoding is achieved by delaying the decoding of any sequence
+ // of [KVrA]'s and processing them together in the order: first the
+ // short-circuited KVr part and then the arrays.
+ static int const cvq_K = 1; // Saw at least one K
+ static int const cvq_V = 2; // Saw at least one V
+ static int const cvq_r = 4; // Saw at least one r
+ static int const cvq_A = 8; // Saw at least one A
+ static int const cvq_last = 16; // No remaining qualifiers.
+ static int const cvq_A_cnt = 32; // Bit 5 and higher represent the
+ // number of A's in the series.
+ // In the function below, iter_array points to the first (right most)
+ // A in the series, if any.
+ template<typename Allocator>
+ void
+ qualifier_list<Allocator>::decode_KVrA(
+ string_type& prefix, string_type& postfix, int cvq,
+ typename qual_vector::const_reverse_iterator const& iter_array) const
+ {
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING3("decode_KVrA");
+ if ((cvq & cvq_K))
+ prefix += " const";
+ if ((cvq & cvq_V))
+ prefix += " volatile";
+ if ((cvq & cvq_r))
+ prefix += " restrict";
+ if ((cvq & cvq_A))
+ {
+ int n = cvq >> 5;
+ for (typename qual_vector::
+ const_reverse_iterator iter = iter_array;
+ iter != M_qualifier_starts.rend(); ++iter)
+ {
+ switch((*iter).first_qualifier())
+ {
+ case 'K':
+ case 'V':
+ case 'r':
+ break;
+ case 'A':
+ {
+ string_type index = (*iter).get_optional_type();
+ if (--n == 0 && (cvq & cvq_last))
+ postfix = " [" + index + "]" + postfix;
+ else if (n > 0)
+ postfix = "[" + index + "]" + postfix;
+ else
+ {
+ prefix += " (";
+ postfix = ") [" + index + "]" + postfix;
+ }
+ break;
+ }
+ default:
+ _GLIBCXX_DEMANGLER_RETURN3;
+ }
+ }
+ }
+ _GLIBCXX_DEMANGLER_RETURN3;
+ }
+
template<typename Allocator>
void
qualifier_list<Allocator>::decode_qualifiers(
string_type& prefix,
string_type& postfix,
- bool member_function_pointer_qualifiers = false)
+ bool member_function_pointer_qualifiers = false) const
{
- for(typename std::vector<qualifier<Allocator>, Allocator>::
- reverse_iterator iter = M_qualifier_starts.rbegin();
- iter != M_qualifier_starts.rend();)
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING3("decode_qualifiers");
+ int cvq = 0;
+ typename qual_vector::const_reverse_iterator iter_array;
+ for(typename qual_vector::
+ const_reverse_iterator iter = M_qualifier_starts.rbegin();
+ iter != M_qualifier_starts.rend(); ++iter)
{
if (!member_function_pointer_qualifiers
&& !(*iter).part_of_substitution())
@@ -1397,39 +1775,54 @@ namespace __gnu_cxx
switch(qualifier_char)
{
case 'P':
+ if (cvq)
+ {
+ decode_KVrA(prefix, postfix, cvq, iter_array);
+ cvq = 0;
+ }
prefix += "*";
break;
case 'R':
+ if (cvq)
+ {
+ decode_KVrA(prefix, postfix, cvq, iter_array);
+ cvq = 0;
+ }
prefix += "&";
break;
case 'K':
- prefix += " const";
+ cvq |= cvq_K;
continue;
case 'V':
- prefix += " volatile";
+ cvq |= cvq_V;
continue;
case 'r':
- prefix += " restrict";
+ cvq |= cvq_r;
continue;
case 'A':
- {
- string_type index = (*iter).get_optional_type();
- if (++iter != M_qualifier_starts.rend()
- && (*iter).first_qualifier() != 'A')
+ if (!(cvq & cvq_A))
{
- prefix += " (";
- postfix = ") [" + index + "]" + postfix;
+ cvq |= cvq_A;
+ iter_array = iter;
}
- else
- postfix = "[" + index + "]" + postfix;
+ cvq += cvq_A_cnt;
break;
- }
case 'M':
+ if (cvq)
+ {
+ decode_KVrA(prefix, postfix, cvq, iter_array);
+ cvq = 0;
+ }
prefix += " ";
prefix += (*iter).get_optional_type();
prefix += "::*";
break;
case 'U':
+ if (cvq)
+ {
+ decode_KVrA(prefix, postfix, cvq, iter_array);
+ cvq = 0;
+ }
prefix += " ";
prefix += (*iter).get_optional_type();
break;
@@ -1438,10 +1831,11 @@ namespace __gnu_cxx
}
break;
}
- if (qualifier_char != 'A')
- ++iter;
}
+ if (cvq)
+ decode_KVrA(prefix, postfix, cvq|cvq_last, iter_array);
M_printing_suppressed = false;
+ _GLIBCXX_DEMANGLER_RETURN3;
}
//
@@ -1451,8 +1845,7 @@ namespace __gnu_cxx
string_type& prefix, string_type& postfix,
qualifier_list<Allocator>* qualifiers)
{
- _GLIBCXX_DEMANGLER_DOUT_ENTERING2
- (qualifiers ? "decode_type" : "decode_type[with qualifiers]");
+ _GLIBCXX_DEMANGLER_DOUT_ENTERING2("decode_type");
++M_inside_type;
bool recursive_template_param_or_substitution_call;
if (!(recursive_template_param_or_substitution_call = qualifiers))
@@ -1531,6 +1924,7 @@ namespace __gnu_cxx
}
case 'M':
{
+ // <pointer-to-member-type> ::= M <class type> <member type>
// <Q>M<C> or <Q>M<C><Q2>F<R><B>E
eat_current();
string_type class_type;
@@ -1577,7 +1971,8 @@ namespace __gnu_cxx
// Return type.
// Constructors, destructors and conversion operators don't
// have a return type, but seem to never get here.
- if (!decode_type_with_postfix(prefix, postfix))
+ string_type return_type_postfix;
+ if (!decode_type_with_postfix(prefix, return_type_postfix))
// substitution: <R> recursive
{
failure = true;
@@ -1599,9 +1994,10 @@ namespace __gnu_cxx
add_substitution(start_pos, type);
// substitution: all qualified types if any.
qualifiers->decode_qualifiers(prefix, postfix);
- prefix += ")";
- prefix += bare_function_type;
- prefix += member_function_qualifiers;
+ postfix += ")";
+ postfix += bare_function_type;
+ postfix += member_function_qualifiers;
+ postfix += return_type_postfix;
goto decode_type_exit;
}
qualifiers->add_qualifier_start(pointer_to_member, start_pos,
@@ -1631,21 +2027,31 @@ namespace __gnu_cxx
{
case 'F':
{
+ // <function-type> ::= F [Y] <bare-function-type> E
+ //
+ // Note that g++ never generates the 'Y', but we try to
+ // demangle it anyway.
+ bool extern_C = (next() == 'Y');
+ if (extern_C)
+ eat_current();
+
// <Q>F<R><B>E ==> R (Q)B
// substitution: "<R>", "<B>" (<B> recursive) and "F<R><B>E".
- eat_current();
+
// Return type.
- if (!decode_type_with_postfix(prefix, postfix))
+ string_type return_type_postfix;
+ if (!decode_type_with_postfix(prefix, return_type_postfix))
// Substitution: "<R>".
{
failure = true;
break;
}
- // Only array (pointer) types have a postfix.
- // In that case we don't want the space but
- // expect something like prefix is "int (*"
- // and postfix is ") [1]".
- if (postfix.size() == 0)
+ // Only array and function (pointer) types have a postfix.
+ // In that case we don't want the space but expect something
+ // like prefix is "int (*" and postfix is ") [1]".
+ // We do want the space if this pointer is qualified.
+ if (return_type_postfix.size() == 0 ||
+ (prefix.size() > 0 && *prefix.rbegin() != '*'))
prefix += ' ';
prefix += '(';
string_type bare_function_type;
@@ -1659,8 +2065,11 @@ namespace __gnu_cxx
add_substitution(start_pos, type); // Substitution: "F<R><B>E".
qualifiers->decode_qualifiers(prefix, postfix);
// substitution: all qualified types, if any.
- prefix += ")";
- prefix += bare_function_type;
+ postfix += ")";
+ if (extern_C)
+ postfix += " [extern \"C\"] ";
+ postfix += bare_function_type;
+ postfix += return_type_postfix;
break;
}
case 'T':
@@ -1783,10 +2192,12 @@ namespace __gnu_cxx
//
// <prefix> ::= <prefix> <unqualified-name>
// ::= <template-prefix> <template-args>
+ // ::= <template-param>
// ::= # empty
// ::= <substitution>
//
// <template-prefix> ::= <prefix> <template unqualified-name>
+ // ::= <template-param>
// ::= <substitution>
//
template<typename Allocator>
@@ -1840,7 +2251,12 @@ namespace __gnu_cxx
}
else
{
- if (!decode_unqualified_name(output))
+ if (current() == 'T')
+ {
+ if (!decode_template_param(output))
+ _GLIBCXX_DEMANGLER_FAILURE;
+ }
+ else if (!decode_unqualified_name(output))
_GLIBCXX_DEMANGLER_FAILURE;
if (current() != 'E')
{
@@ -1878,7 +2294,8 @@ namespace __gnu_cxx
if (current() != 'Z' || M_pos >= M_maxpos)
_GLIBCXX_DEMANGLER_FAILURE;
if ((M_pos += decode_encoding(output, M_str + M_pos + 1,
- M_maxpos - M_pos) + 1) < 0 || eat_current() != 'E')
+ M_maxpos - M_pos, M_implementation_details) + 1) < 0 ||
+ eat_current() != 'E')
_GLIBCXX_DEMANGLER_FAILURE;
output += "::";
if (current() == 's')
@@ -2006,7 +2423,7 @@ namespace __gnu_cxx
// <unscoped-name> ::=
// <unqualified-name> # Starts not with an 'S'
- // St <unqualified-name> # ::std::
+ // St <unqualified-name> # ::std::
//
template<typename Allocator>
bool
@@ -2177,7 +2594,7 @@ namespace __gnu_cxx
if (!decode_call_offset(output)
|| !decode_call_offset(output)
|| (M_pos += decode_encoding(output, M_str + M_pos,
- M_maxpos - M_pos + 1)) < 0)
+ M_maxpos - M_pos + 1, M_implementation_details)) < 0)
_GLIBCXX_DEMANGLER_FAILURE;
_GLIBCXX_DEMANGLER_RETURN;
case 'C': // GNU extension?
@@ -2204,7 +2621,7 @@ namespace __gnu_cxx
output += "non-virtual thunk to ";
if (!decode_call_offset(output)
|| (M_pos += decode_encoding(output, M_str + M_pos,
- M_maxpos - M_pos + 1)) < 0)
+ M_maxpos - M_pos + 1, M_implementation_details)) < 0)
_GLIBCXX_DEMANGLER_FAILURE;
_GLIBCXX_DEMANGLER_RETURN;
}
@@ -2219,8 +2636,7 @@ namespace __gnu_cxx
template<typename Allocator>
int
session<Allocator>::decode_encoding(string_type& output,
- char const* in,
- int len)
+ char const* in, int len, implementation_details const& id)
{
#if _GLIBCXX_DEMANGLER_CWDEBUG
_GLIBCXX_DEMANGLER_DOUT(dc::demangler,
@@ -2231,7 +2647,7 @@ namespace __gnu_cxx
#endif
if (len <= 0)
return INT_MIN;
- session<Allocator> demangler_session(in, len);
+ session<Allocator> demangler_session(in, len, id);
string_type nested_name_qualifiers;
int saved_pos;
demangler_session.store(saved_pos);
@@ -2249,12 +2665,14 @@ namespace __gnu_cxx
return demangler_session.M_pos;
}
// Must have been a <function name>.
+ string_type return_type_postfix;
if (demangler_session.M_name_is_template
&& !(demangler_session.M_name_is_cdtor
|| demangler_session.M_name_is_conversion_operator))
{
- if (!demangler_session.decode_type(output))
- // Return type of function
+ // Return type of function
+ if (!demangler_session.decode_type_with_postfix(output,
+ return_type_postfix))
return INT_MIN;
output += ' ';
}
@@ -2262,6 +2680,7 @@ namespace __gnu_cxx
if (!demangler_session.decode_bare_function_type(output))
return INT_MIN;
output += nested_name_qualifiers;
+ output += return_type_postfix;
return demangler_session.M_pos;
}
@@ -2271,11 +2690,13 @@ namespace __gnu_cxx
template<typename Allocator>
struct demangle
{
- typedef Allocator allocator_type;
- typedef std::basic_string<char, std::char_traits<char>, Allocator>
+ typedef typename Allocator::template rebind<char>::other char_Allocator;
+ typedef std::basic_string<char, std::char_traits<char>, char_Allocator>
string_type;
- static string_type symbol(char const* in);
- static string_type type(char const* in);
+ static string_type symbol(char const* in,
+ demangler::implementation_details const& id);
+ static string_type type(char const* in,
+ demangler::implementation_details const& id);
};
// demangle::symbol()
@@ -2283,8 +2704,9 @@ namespace __gnu_cxx
// Demangle `input' which should be a mangled function name as for
// instance returned by nm(1).
template<typename Allocator>
- std::basic_string<char, std::char_traits<char>, Allocator>
- demangle<Allocator>::symbol(char const* input)
+ typename demangle<Allocator>::string_type
+ demangle<Allocator>::symbol(char const* input,
+ demangler::implementation_details const& id)
{
// <mangled-name> ::= _Z <encoding>
// <mangled-name> ::= _GLOBAL_ _<type>_ <disambiguation part>
@@ -2313,8 +2735,8 @@ namespace __gnu_cxx
}
else if (input[1] == 'Z')
{
- int cnt = demangler_type::decode_encoding(result, input + 2,
- INT_MAX);
+ int cnt =
+ demangler_type::decode_encoding(result, input + 2, INT_MAX, id);
if (cnt < 0 || input[cnt + 2] != 0)
failure = true;
}
@@ -2333,15 +2755,16 @@ namespace __gnu_cxx
// Demangle `input' which must be a zero terminated mangled type
// name as for instance returned by std::type_info::name().
template<typename Allocator>
- std::basic_string<char, std::char_traits<char>, Allocator>
- demangle<Allocator>::type(char const* input)
+ typename demangle<Allocator>::string_type
+ demangle<Allocator>::type(char const* input,
+ demangler::implementation_details const& id)
{
std::basic_string<char, std::char_traits<char>, Allocator> result;
if (input == NULL)
result = "(null)";
else
{
- demangler::session<Allocator> demangler_session(input, INT_MAX);
+ demangler::session<Allocator> demangler_session(input, INT_MAX, id);
if (!demangler_session.decode_type(result)
|| demangler_session.remaining_input_characters())
{
diff --git a/libstdc++-v3/include/bits/deque.tcc b/libstdc++-v3/include/bits/deque.tcc
index dedab6a3112..9f01eed8d68 100644
--- a/libstdc++-v3/include/bits/deque.tcc
+++ b/libstdc++-v3/include/bits/deque.tcc
@@ -61,7 +61,7 @@
#ifndef _DEQUE_TCC
#define _DEQUE_TCC 1
-namespace std
+namespace __gnu_norm
{
template <typename _Tp, typename _Alloc>
deque<_Tp,_Alloc>&
@@ -707,6 +707,6 @@ namespace std
this->_M_start._M_set_node(__new_nstart);
this->_M_finish._M_set_node(__new_nstart + __old_num_nodes - 1);
}
-} // namespace std
+} // namespace __gnu_norm
#endif
diff --git a/libstdc++-v3/include/bits/fstream.tcc b/libstdc++-v3/include/bits/fstream.tcc
index a93459a71f3..998e0c34429 100644
--- a/libstdc++-v3/include/bits/fstream.tcc
+++ b/libstdc++-v3/include/bits/fstream.tcc
@@ -44,15 +44,15 @@ namespace std
basic_filebuf<_CharT, _Traits>::
_M_allocate_internal_buffer()
{
- if (!_M_buf_allocated && this->_M_buf_size)
+ // Allocate internal buffer only if one doesn't already exist
+ // (either allocated or provided by the user via setbuf).
+ if (!_M_buf_allocated && !this->_M_buf)
{
- // Allocate internal buffer.
this->_M_buf = new char_type[this->_M_buf_size];
_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>::
@@ -74,12 +74,12 @@ namespace std
template<typename _CharT, typename _Traits>
basic_filebuf<_CharT, _Traits>::
basic_filebuf() : __streambuf_type(), _M_file(&_M_lock),
- _M_mode(ios_base::openmode(0)), _M_state_cur(__state_type()),
- _M_state_beg(__state_type()), _M_buf(NULL), _M_buf_size(BUFSIZ),
+ _M_mode(ios_base::openmode(0)), _M_state_beg(), _M_state_cur(),
+ _M_state_last(), _M_buf(NULL), _M_buf_size(BUFSIZ),
_M_buf_allocated(false), _M_reading(false), _M_writing(false),
- _M_last_overflowed(false), _M_pback_cur_save(0), _M_pback_end_save(0),
- _M_pback_init(false), _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0),
- _M_ext_next(0), _M_ext_end(0)
+ _M_pback_cur_save(0), _M_pback_end_save(0), _M_pback_init(false),
+ _M_codecvt(0), _M_ext_buf(0), _M_ext_buf_size(0), _M_ext_next(0),
+ _M_ext_end(0)
{
if (has_facet<__codecvt_type>(this->_M_buf_locale))
_M_codecvt = &use_facet<__codecvt_type>(this->_M_buf_locale);
@@ -104,9 +104,12 @@ namespace std
_M_writing = false;
_M_set_buffer(-1);
+ // Reset to initial state.
+ _M_state_last = _M_state_cur = _M_state_beg;
+
// 27.8.1.3,4
if ((__mode & ios_base::ate)
- && this->seekoff(0, ios_base::end, __mode)
+ && this->seekoff(0, ios_base::end, __mode)
== pos_type(off_type(-1)))
this->close();
else
@@ -127,23 +130,11 @@ namespace std
bool __testfail = false;
try
{
- if (this->pbase() < this->pptr()
- && traits_type::eq_int_type(this->overflow(),
- traits_type::eof()))
+ if (!_M_terminate_output())
__testfail = true;
-#if 0
- // XXX not done
- if (_M_last_overflowed)
- {
- _M_output_unshift();
- this->overflow();
- }
-#endif
}
catch(...)
- {
- __testfail = true;
- }
+ { __testfail = true; }
// NB: Do this here so that re-opened filebufs will be cool...
this->_M_mode = ios_base::openmode(0);
@@ -152,6 +143,7 @@ namespace std
_M_reading = false;
_M_writing = false;
_M_set_buffer(-1);
+ _M_state_last = _M_state_cur = _M_state_beg;
if (!_M_file.close())
__testfail = true;
@@ -159,7 +151,6 @@ namespace std
if (!__testfail)
__ret = this;
}
- _M_last_overflowed = false;
return __ret;
}
@@ -170,7 +161,6 @@ namespace std
{
streamsize __ret = -1;
const bool __testin = this->_M_mode & ios_base::in;
-
if (__testin && this->is_open())
{
// For a stateful encoding (-1) the pending sequence might be just
@@ -179,8 +169,6 @@ namespace std
if (__check_facet(_M_codecvt).encoding() >= 0)
__ret += _M_file.showmanyc() / _M_codecvt->max_length();
}
-
- _M_last_overflowed = false;
return __ret;
}
@@ -192,7 +180,6 @@ namespace std
int_type __ret = traits_type::eof();
const bool __testin = this->_M_mode & ios_base::in;
const bool __testout = this->_M_mode & ios_base::out;
-
if (__testin && !_M_writing)
{
// Check for pback madness, and if so swich back to the
@@ -211,6 +198,7 @@ namespace std
bool __got_eof = false;
// Number of internal characters produced.
streamsize __ilen = 0;
+ codecvt_base::result __r = codecvt_base::ok;
if (__check_facet(_M_codecvt).always_noconv())
{
__ilen = _M_file.xsgetn(reinterpret_cast<char*>(this->eback()),
@@ -221,8 +209,8 @@ namespace std
else
{
// Worst-case number of external bytes.
- // XXX Not done encoding() == -1.
- const int __enc = _M_codecvt->encoding();
+ // XXX Not done encoding() == -1.
+ const int __enc = _M_codecvt->encoding();
streamsize __blen; // Minimum buffer size.
streamsize __rlen; // Number of chars to read.
if (__enc > 0)
@@ -252,6 +240,7 @@ namespace std
_M_ext_next = _M_ext_buf;
_M_ext_end = _M_ext_buf + __remainder;
+ _M_state_last = _M_state_cur;
do
{
@@ -261,37 +250,43 @@ namespace std
// This may fail if the return value of
// codecvt::max_length() is bogus.
if (_M_ext_end - _M_ext_buf + __rlen > _M_ext_buf_size)
- std::abort();
+ {
+ __throw_ios_failure("basic_filebuf::underflow "
+ "codecvt::max_length() "
+ "is not valid");
+ }
streamsize __elen = _M_file.xsgetn(_M_ext_end, __rlen);
if (__elen == 0)
__got_eof = true;
+ else if (__elen == -1)
+ break;
_M_ext_end += __elen;
}
-
+
char_type* __iend;
- codecvt_base::result __r;
__r = _M_codecvt->in(_M_state_cur, _M_ext_next,
_M_ext_end, _M_ext_next, this->eback(),
this->eback() + __buflen, __iend);
- if (__r == codecvt_base::ok || __r == codecvt_base::partial)
- __ilen = __iend - this->eback();
- else if (__r == codecvt_base::noconv)
+ if (__r == codecvt_base::noconv)
{
size_t __avail = _M_ext_end - _M_ext_buf;
__ilen = std::min(__avail, __buflen);
traits_type::copy(this->eback(),
- reinterpret_cast<char_type*>(_M_ext_buf),
- __ilen);
+ reinterpret_cast<char_type*>(_M_ext_buf), __ilen);
_M_ext_next = _M_ext_buf + __ilen;
}
- else
- {
- __ilen = 0;
- break;
- }
+ else
+ __ilen = __iend - this->eback();
+
+ // _M_codecvt->in may return error while __ilen > 0: this is
+ // ok, and actually occurs in case of mixed encodings (e.g.,
+ // XML files).
+ if (__r == codecvt_base::error)
+ break;
+
__rlen = 1;
}
- while (!__got_eof && __ilen == 0);
+ while (__ilen == 0 && !__got_eof);
}
if (__ilen > 0)
@@ -307,9 +302,19 @@ namespace std
// intervening seek.
_M_set_buffer(-1);
_M_reading = false;
+ // However, reaching it while looping on partial means that
+ // the file has got an incomplete character.
+ if (__r == codecvt_base::partial)
+ __throw_ios_failure("basic_filebuf::underflow "
+ "incomplete character in file");
}
+ else if (__r == codecvt_base::error)
+ __throw_ios_failure("basic_filebuf::underflow "
+ "invalid byte sequence in file");
+ else
+ __throw_ios_failure("basic_filebuf::underflow "
+ "error reading the file");
}
- _M_last_overflowed = false;
return __ret;
}
@@ -320,14 +325,12 @@ namespace std
{
int_type __ret = traits_type::eof();
const bool __testin = this->_M_mode & ios_base::in;
-
if (__testin && !_M_writing)
{
// Remember whether the pback buffer is active, otherwise below
// we may try to store in it a second char (libstdc++/9761).
const bool __testpb = this->_M_pback_init;
const bool __testeof = traits_type::eq_int_type(__i, __ret);
-
int_type __tmp;
if (this->eback() < this->gptr())
{
@@ -364,7 +367,6 @@ namespace std
__ret = __i;
}
}
- _M_last_overflowed = false;
return __ret;
}
@@ -376,7 +378,6 @@ namespace std
int_type __ret = traits_type::eof();
const bool __testeof = traits_type::eq_int_type(__c, __ret);
const bool __testout = this->_M_mode & ios_base::out;
-
if (__testout && !_M_reading)
{
if (this->pbase() < this->pptr())
@@ -389,7 +390,7 @@ namespace std
}
// Convert pending sequence to external representation,
- // output.
+ // and output.
if (_M_convert_to_external(this->pbase(),
this->pptr() - this->pbase())
&& (!__testeof || (__testeof && !_M_file.sync())))
@@ -423,7 +424,6 @@ namespace std
}
}
}
- _M_last_overflowed = true;
return __ret;
}
@@ -435,7 +435,6 @@ namespace std
// Sizes of external and pending output.
streamsize __elen = 0;
streamsize __plen = 0;
-
if (__check_facet(_M_codecvt).always_noconv())
{
__elen += _M_file.xsputn(reinterpret_cast<char*>(__ibuf), __ilen);
@@ -498,11 +497,10 @@ namespace std
basic_filebuf<_CharT, _Traits>::
xsputn(const _CharT* __s, streamsize __n)
{
- streamsize __ret = 0;
-
// Optimization in the always_noconv() case, to be generalized in the
// future: when __n is sufficiently large we write directly instead of
// using the buffer.
+ streamsize __ret = 0;
const bool __testout = this->_M_mode & ios_base::out;
if (__testout && !_M_reading
&& __check_facet(_M_codecvt).always_noconv())
@@ -521,7 +519,8 @@ namespace std
const streamsize __buffill = this->pptr() - this->pbase();
const char* __buf = reinterpret_cast<const char*>(this->pbase());
__ret = _M_file.xsputn_2(__buf, __buffill,
- reinterpret_cast<const char*>(__s), __n);
+ reinterpret_cast<const char*>(__s),
+ __n);
if (__ret == __buffill + __n)
{
_M_set_buffer(0);
@@ -536,8 +535,7 @@ namespace std
__ret = __streambuf_type::xsputn(__s, __n);
}
else
- __ret = __streambuf_type::xsputn(__s, __n);
-
+ __ret = __streambuf_type::xsputn(__s, __n);
return __ret;
}
@@ -546,30 +544,22 @@ namespace std
basic_filebuf<_CharT, _Traits>::
setbuf(char_type* __s, streamsize __n)
{
- if (!this->is_open() && __s == 0 && __n == 0)
- this->_M_buf_size = 1;
- else if (__s && __n > 0)
- {
- // This is implementation-defined behavior, and assumes that
- // an external char_type array of length __n exists and has
- // been pre-allocated. If this is not the case, things will
- // quickly blow up. When __n > 1, __n - 1 positions will be
- // used for the get area, __n - 1 for the put area and 1
- // position to host the overflow char of a full put area.
- // When __n == 1, 1 position will be used for the get area
- // and 0 for the put area, as in the unbuffered case above.
-
- // Step 1: Destroy the current internal array.
- _M_destroy_internal_buffer();
-
- // Step 2: Use the external array.
- this->_M_buf = __s;
- this->_M_buf_size = __n;
- _M_reading = false;
- _M_writing = false;
- _M_set_buffer(-1);
- }
- _M_last_overflowed = false;
+ if (!this->is_open())
+ if (__s == 0 && __n == 0)
+ this->_M_buf_size = 1;
+ else if (__s && __n > 0)
+ {
+ // This is implementation-defined behavior, and assumes that
+ // an external char_type array of length __n exists and has
+ // been pre-allocated. If this is not the case, things will
+ // quickly blow up. When __n > 1, __n - 1 positions will be
+ // used for the get area, __n - 1 for the put area and 1
+ // position to host the overflow char of a full put area.
+ // When __n == 1, 1 position will be used for the get area
+ // and 0 for the put area, as in the unbuffered case above.
+ this->_M_buf = __s;
+ this->_M_buf_size = __n;
+ }
return this;
}
@@ -581,20 +571,25 @@ namespace std
basic_filebuf<_CharT, _Traits>::
seekoff(off_type __off, ios_base::seekdir __way, ios_base::openmode)
{
- pos_type __ret = pos_type(off_type(-1));
-
int __width = 0;
if (_M_codecvt)
__width = _M_codecvt->encoding();
if (__width < 0)
__width = 0;
- const bool __testfail = __off != 0 && __width <= 0;
+ pos_type __ret = pos_type(off_type(-1));
+ const bool __testfail = __off != 0 && __width <= 0;
if (this->is_open() && !__testfail)
{
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
+ // Correct state at destination. Note that this is the correct
+ // state for the current position during output, because
+ // codecvt::unshift() returns the state to the initial state.
+ // This is also the correct state at the end of the file because
+ // an unshift sequence should have been written at the end.
+ __state_type __state = _M_state_beg;
off_type __computed_off = __off * __width;
if (_M_reading && __way == ios_base::cur)
{
@@ -603,17 +598,20 @@ namespace std
else
{
// Calculate offset from _M_ext_buf that corresponds
- // to gptr().
+ // to gptr(). Note: uses _M_state_last, which
+ // corresponds to eback().
const int __gptr_off =
- _M_codecvt->length(_M_state_cur, _M_ext_buf, _M_ext_next,
+ _M_codecvt->length(_M_state_last, _M_ext_buf, _M_ext_next,
this->gptr() - this->eback());
__computed_off += _M_ext_buf + __gptr_off - _M_ext_end;
+
+ // _M_state_last is modified by codecvt::length() so
+ // it now corresponds to gptr().
+ __state = _M_state_last;
}
}
-
- __ret = _M_seek(__computed_off, __way);
+ __ret = _M_seek(__computed_off, __way, __state);
}
- _M_last_overflowed = false;
return __ret;
}
@@ -627,84 +625,135 @@ namespace std
seekpos(pos_type __pos, ios_base::openmode)
{
pos_type __ret = pos_type(off_type(-1));
-
if (this->is_open())
{
// Ditch any pback buffers to avoid confusion.
_M_destroy_pback();
-
- __ret = _M_seek(off_type(__pos), ios_base::beg);
+ __ret = _M_seek(off_type(__pos), ios_base::beg, __pos.state());
}
- _M_last_overflowed = false;
return __ret;
}
template<typename _CharT, typename _Traits>
typename basic_filebuf<_CharT, _Traits>::pos_type
basic_filebuf<_CharT, _Traits>::
- _M_seek(off_type __off, ios_base::seekdir __way)
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state)
+ {
+ pos_type __ret = pos_type(off_type(-1));
+ if (_M_terminate_output())
+ {
+ // Returns pos_type(off_type(-1)) in case of failure.
+ __ret = pos_type(_M_file.seekoff(__off, __way));
+ _M_reading = false;
+ _M_writing = false;
+ _M_ext_next = _M_ext_end = _M_ext_buf;
+ _M_set_buffer(-1);
+ _M_state_cur = __state;
+ __ret.state(_M_state_cur);
+ }
+ return __ret;
+ }
+
+ template<typename _CharT, typename _Traits>
+ bool
+ basic_filebuf<_CharT, _Traits>::
+ _M_terminate_output()
{
+ // Part one: update the output sequence.
+ bool __testvalid = true;
if (this->pbase() < this->pptr())
{
- // Part one: update the output sequence.
- this->sync();
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
- // Part two: output unshift sequence.
- _M_output_unshift();
+ // Part two: output unshift sequence.
+ if (_M_writing && !__check_facet(_M_codecvt).always_noconv()
+ && __testvalid)
+ {
+ // Note: this value is arbitrary, since there is no way to
+ // get the length of the unshift sequence from codecvt,
+ // without calling unshift.
+ const size_t __blen = 128;
+ char __buf[__blen];
+ codecvt_base::result __r;
+ streamsize __ilen = 0;
+
+ do
+ {
+ char* __next;
+ __r = _M_codecvt->unshift(_M_state_cur, __buf,
+ __buf + __blen, __next);
+ if (__r == codecvt_base::error)
+ __testvalid = false;
+ else if (__r == codecvt_base::ok ||
+ __r == codecvt_base::partial)
+ {
+ __ilen = __next - __buf;
+ if (__ilen > 0)
+ {
+ const streamsize __elen = _M_file.xsputn(__buf, __ilen);
+ if (__elen != __ilen)
+ __testvalid = false;
+ }
+ }
+ }
+ while (__r == codecvt_base::partial && __ilen > 0 && __testvalid);
+
+ if (__testvalid)
+ {
+ // This second call to overflow() is required by the standard,
+ // but it's not clear why it's needed, since the output buffer
+ // should be empty by this point (it should have been emptied
+ // in the first call to overflow()).
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __testvalid = false;
+ }
}
-
- // Returns pos_type(off_type(-1)) in case of failure.
- pos_type __ret (_M_file.seekoff(__off, __way));
-
- _M_reading = false;
- _M_writing = false;
- _M_ext_next = _M_ext_end = _M_ext_buf;
- _M_set_buffer(-1);
- return __ret;
+ return __testvalid;
}
template<typename _CharT, typename _Traits>
- void
+ int
basic_filebuf<_CharT, _Traits>::
- _M_output_unshift()
- { }
+ sync()
+ {
+ // Make sure that the internal buffer resyncs its idea of
+ // the file position with the external file.
+ // NB: _M_file.sync() will be called within.
+ int __ret = 0;
+ if (this->pbase() < this->pptr())
+ {
+ const int_type __tmp = this->overflow();
+ if (traits_type::eq_int_type(__tmp, traits_type::eof()))
+ __ret = -1;
+ }
+ return __ret;
+ }
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
imbue(const locale& __loc)
{
- if (this->_M_buf_locale != __loc)
+ bool __testfail = false;
+ if (this->is_open())
{
- bool __testfail = false;
- if (this->is_open())
- {
- const bool __testbeg =
- this->seekoff(0, ios_base::cur, this->_M_mode) ==
- pos_type(off_type(0));
- const bool __teststate =
- __check_facet(_M_codecvt).encoding() == -1;
-
- __testfail = !__testbeg || __teststate;
- }
+ const pos_type __ret = this->seekoff(0, ios_base::cur,
+ this->_M_mode);
+ const bool __teststate = __check_facet(_M_codecvt).encoding() == -1;
+ __testfail = __teststate && __ret != pos_type(off_type(0));
+ }
- if (!__testfail)
- {
- this->_M_buf_locale = __loc;
- if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
- _M_codecvt = &use_facet<__codecvt_type>(__loc);
- else
- _M_codecvt = 0;
-
- // NB This may require the reconversion of previously
- // converted chars. This in turn may cause the
- // reconstruction of the original file. YIKES!! This
- // implementation interprets this requirement as requiring
- // the file position be at the beginning, and a stateless
- // encoding, or that the filebuf be closed. Opinions may differ.
- }
+ if (!__testfail)
+ {
+ if (__builtin_expect(has_facet<__codecvt_type>(__loc), true))
+ _M_codecvt = &use_facet<__codecvt_type>(__loc);
+ else
+ _M_codecvt = 0;
}
- _M_last_overflowed = false;
}
// Inhibit implicit instantiations for required instantiations,
diff --git a/libstdc++-v3/include/bits/ios_base.h b/libstdc++-v3/include/bits/ios_base.h
index 5455dd26f19..587bda4b092 100644
--- a/libstdc++-v3/include/bits/ios_base.h
+++ b/libstdc++-v3/include/bits/ios_base.h
@@ -492,15 +492,9 @@ namespace std
Init();
~Init();
- // NB: Allows debugger applications use of the standard streams
- // from operator new. _S_ios_base_init must be incremented in
- // _S_ios_create _after_ initialization is completed.
- static bool
- _S_initialized() { return _S_ios_base_init; }
-
private:
- static int _S_ios_base_init;
- static bool _S_synced_with_stdio;
+ static _Atomic_word _S_refcount;
+ static bool _S_synced_with_stdio;
};
// [27.4.2.2] fmtflags state functions
diff --git a/libstdc++-v3/include/bits/istream.tcc b/libstdc++-v3/include/bits/istream.tcc
index 1ae7cba126f..abe795031df 100644
--- a/libstdc++-v3/include/bits/istream.tcc
+++ b/libstdc++-v3/include/bits/istream.tcc
@@ -46,6 +46,7 @@ namespace std
basic_istream<_CharT, _Traits>::sentry::
sentry(basic_istream<_CharT, _Traits>& __in, bool __noskipws)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
if (__in.good())
{
if (__in.tie())
@@ -60,21 +61,23 @@ namespace std
while (!traits_type::eq_int_type(__c, __eof)
&& __ct.is(ctype_base::space,
traits_type::to_char_type(__c)))
- __c = __sb->snextc();
+ __c = __sb->snextc();
// _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 195. Should basic_istream::sentry's constructor ever set eofbit?
+ // 195. Should basic_istream::sentry's constructor ever
+ // set eofbit?
if (traits_type::eq_int_type(__c, __eof))
- __in.setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
}
- if (__in.good())
+ if (__in.good() && __err == ios_base::goodbit)
_M_ok = true;
else
{
_M_ok = false;
- __in.setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
+ __in.setstate(__err);
}
}
@@ -82,10 +85,7 @@ namespace std
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
operator>>(__istream_type& (*__pf)(__istream_type&))
- {
- __pf(*this);
- return *this;
- }
+ { return __pf(*this); }
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
@@ -113,21 +113,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -140,10 +135,10 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
long __l;
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __l);
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -154,16 +149,11 @@ namespace std
__n = __l;
else
__err |= ios_base::failbit;
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -176,21 +166,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -203,10 +188,10 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
long __l;
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __l);
// _GLIBCXX_RESOLVE_LIB_DEFECTS
@@ -217,16 +202,11 @@ namespace std
__n = __l;
else
__err |= ios_base::failbit;
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -239,21 +219,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -266,21 +241,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -293,21 +263,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -321,21 +286,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -348,21 +308,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -376,21 +331,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -403,21 +353,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -430,21 +375,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -457,21 +397,16 @@ namespace std
sentry __cerb(*this, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
- ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
const __num_get_type& __ng = __check_facet(this->_M_num_get);
__ng.get(*this, 0, *this, __err, __n);
- this->setstate(__err);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -481,30 +416,23 @@ namespace std
basic_istream<_CharT, _Traits>::
operator>>(__streambuf_type* __sbout)
{
- sentry __cerb(*this, false);
- if (__cerb)
- {
- try
- {
- streamsize __xtrct = 0;
- if (__sbout)
- {
- __streambuf_type* __sbin = this->rdbuf();
- __xtrct = __copy_streambufs(*this, __sbin, __sbout);
- }
- if (!__sbout || !__xtrct)
- this->setstate(ios_base::failbit);
- }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- return *this;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this, false);
+ if (__cerb && __sbout)
+ {
+ try
+ {
+ if (!__copy_streambufs(this->rdbuf(), __sbout))
+ __err |= ios_base::failbit;
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::failbit); }
+ }
+ else if (!__sbout)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
+ return *this;
}
template<typename _CharT, typename _Traits>
@@ -515,6 +443,7 @@ namespace std
const int_type __eof = traits_type::eof();
int_type __c = __eof;
_M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
{
@@ -525,17 +454,15 @@ namespace std
if (!traits_type::eq_int_type(__c, __eof))
_M_gcount = 1;
else
- this->setstate(ios_base::eofbit | ios_base::failbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
}
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
return __c;
}
@@ -545,31 +472,29 @@ namespace std
get(char_type& __c)
{
_M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
{
try
{
- const int_type __eof = traits_type::eof();
- int_type __bufval = this->rdbuf()->sbumpc();
+ int_type __cb = this->rdbuf()->sbumpc();
// 27.6.1.1 paragraph 3
- if (!traits_type::eq_int_type(__bufval, __eof))
+ if (!traits_type::eq_int_type(__cb, traits_type::eof()))
{
_M_gcount = 1;
- __c = traits_type::to_char_type(__bufval);
+ __c = traits_type::to_char_type(__cb);
}
else
- this->setstate(ios_base::eofbit | ios_base::failbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
}
+ if (!_M_gcount)
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -579,6 +504,7 @@ namespace std
get(char_type* __s, streamsize __n, char_type __delim)
{
_M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
{
@@ -598,20 +524,16 @@ namespace std
++_M_gcount;
}
if (traits_type::eq_int_type(__c, __eof))
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
}
*__s = char_type();
if (!_M_gcount)
- this->setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -621,6 +543,7 @@ namespace std
get(__streambuf_type& __sb, char_type __delim)
{
_M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
{
@@ -641,19 +564,15 @@ namespace std
__c2 = traits_type::to_char_type(__c);
}
if (traits_type::eq_int_type(__c, __eof))
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
}
if (!_M_gcount)
- this->setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -663,6 +582,7 @@ namespace std
getline(char_type* __s, streamsize __n, char_type __delim)
{
_M_gcount = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
sentry __cerb(*this, true);
if (__cerb)
{
@@ -682,7 +602,7 @@ namespace std
++_M_gcount;
}
if (traits_type::eq_int_type(__c, __eof))
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
else
{
if (traits_type::eq_int_type(__c, __idelim))
@@ -691,21 +611,17 @@ namespace std
++_M_gcount;
}
else
- this->setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
}
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
}
*__s = char_type();
if (!_M_gcount)
- this->setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -718,6 +634,7 @@ namespace std
sentry __cerb(*this, true);
if (__cerb && __n > 0)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const int_type __eof = traits_type::eof();
@@ -733,16 +650,12 @@ namespace std
break;
}
if (traits_type::eq_int_type(__c, __eof))
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -757,20 +670,17 @@ namespace std
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
__c = this->rdbuf()->sgetc();
if (traits_type::eq_int_type(__c, traits_type::eof()))
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return __c;
}
@@ -784,20 +694,17 @@ namespace std
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
_M_gcount = this->rdbuf()->sgetn(__s, __n);
if (_M_gcount != __n)
- this->setstate(ios_base::eofbit | ios_base::failbit);
+ __err |= (ios_base::eofbit | ios_base::failbit);
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -811,6 +718,7 @@ namespace std
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
// Cannot compare int_type with streamsize generically.
@@ -822,16 +730,12 @@ namespace std
_M_gcount = this->rdbuf()->sgetn(__s, __num);
}
else
- this->setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return _M_gcount;
}
@@ -847,22 +751,19 @@ namespace std
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb
|| traits_type::eq_int_type(__sb->sputbackc(__c), __eof))
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -878,22 +779,19 @@ namespace std
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const int_type __eof = traits_type::eof();
__streambuf_type* __sb = this->rdbuf();
if (!__sb
|| traits_type::eq_int_type(__sb->sungetc(), __eof))
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -903,30 +801,28 @@ namespace std
basic_istream<_CharT, _Traits>::
sync(void)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR60. Do not change _M_gcount.
int __ret = -1;
sentry __cerb(*this, true);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
__streambuf_type* __sb = this->rdbuf();
if (__sb)
{
if (__sb->pubsync() == -1)
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
else
__ret = 0;
}
}
catch(...)
- {
- // 27.6.1.3 paragraph 1
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return __ret;
}
@@ -936,30 +832,43 @@ namespace std
basic_istream<_CharT, _Traits>::
tellg(void)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR60. Do not change _M_gcount.
pos_type __ret = pos_type(-1);
- if (!this->fail())
- __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
+ try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::in);
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
return __ret;
}
-
template<typename _CharT, typename _Traits>
basic_istream<_CharT, _Traits>&
basic_istream<_CharT, _Traits>::
seekg(pos_type __pos)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR60. Do not change _M_gcount.
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 136. seekp, seekg setting wrong streams?
- pos_type __err = this->rdbuf()->pubseekpos(__pos, ios_base::in);
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::in);
- // 129. Need error indication from seekp() and seekg()
- if (__err == pos_type(off_type(-1)))
- this->setstate(ios_base::failbit);
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -968,18 +877,26 @@ namespace std
basic_istream<_CharT, _Traits>::
seekg(off_type __off, ios_base::seekdir __dir)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
// DR60. Do not change _M_gcount.
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 136. seekp, seekg setting wrong streams?
- 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(ios_base::failbit);
+ if (!this->fail())
+ {
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::in);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -992,16 +909,19 @@ namespace std
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
- { __in.get(__c); }
- catch(...)
{
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __in._M_setstate(ios_base::badbit);
- if ((__in.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
+ typename __istream_type::int_type __cb = __in.rdbuf()->sbumpc();
+ if (!_Traits::eq_int_type(__cb, _Traits::eof()))
+ __c = _Traits::to_char_type(__cb);
+ else
+ __err |= (ios_base::eofbit | ios_base::failbit);
}
+ catch(...)
+ { __in._M_setstate(ios_base::badbit); }
+ if (__err)
+ __in.setstate(__err);
}
return __in;
}
@@ -1015,8 +935,9 @@ namespace std
typedef typename _Traits::int_type int_type;
typedef _CharT char_type;
typedef ctype<_CharT> __ctype_type;
- streamsize __extracted = 0;
+ streamsize __extracted = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
@@ -1043,7 +964,7 @@ namespace std
__c = __sb->snextc();
}
if (_Traits::eq_int_type(__c, __eof))
- __in.setstate(ios_base::eofbit);
+ __err |= ios_base::eofbit;
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 68. Extractors for char* should store null at end
@@ -1051,16 +972,12 @@ namespace std
__in.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __in._M_setstate(ios_base::badbit);
- if ((__in.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __in._M_setstate(ios_base::badbit); }
}
if (!__extracted)
- __in.setstate(ios_base::failbit);
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
return __in;
}
@@ -1084,8 +1001,7 @@ namespace std
__c = __sb->snextc();
if (_Traits::eq_int_type(__c, __eof))
- __in.setstate(ios_base::eofbit);
-
+ __in.setstate(ios_base::eofbit);
return __in;
}
@@ -1101,37 +1017,49 @@ 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;
- __size_type __extracted = 0;
+ __size_type __extracted = 0;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, false);
if (__cerb)
{
- __str.erase();
- streamsize __w = __in.width();
- __size_type __n;
- __n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size();
-
- const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
- const __int_type __eof = _Traits::eof();
- __streambuf_type* __sb = __in.rdbuf();
- __int_type __c = __sb->sgetc();
-
- while (__extracted < __n
- && !_Traits::eq_int_type(__c, __eof)
- && !__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ try
{
- __str += _Traits::to_char_type(__c);
- ++__extracted;
- __c = __sb->snextc();
+ __str.erase();
+ streamsize __w = __in.width();
+ __size_type __n;
+ __n = __w > 0 ? static_cast<__size_type>(__w) : __str.max_size();
+
+ const __ctype_type& __ct = use_facet<__ctype_type>(__in.getloc());
+ const __int_type __eof = _Traits::eof();
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sgetc();
+
+ while (__extracted < __n
+ && !_Traits::eq_int_type(__c, __eof)
+ && !__ct.is(ctype_base::space, _Traits::to_char_type(__c)))
+ {
+ __str += _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __sb->snextc();
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ __in.width(0);
+ }
+ catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(ios_base::badbit);
}
- if (_Traits::eq_int_type(__c, __eof))
- __in.setstate(ios_base::eofbit);
- __in.width(0);
}
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
// 211. operator>>(istream&, string&) doesn't set failbit
if (!__extracted)
- __in.setstate (ios_base::failbit);
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
return __in;
}
@@ -1148,32 +1076,44 @@ namespace std
typedef typename __string_type::size_type __size_type;
__size_type __extracted = 0;
+ const __size_type __n = __str.max_size();
bool __testdelim = false;
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
typename __istream_type::sentry __cerb(__in, true);
if (__cerb)
{
- __str.erase();
- __size_type __n = __str.max_size();
-
- __int_type __idelim = _Traits::to_int_type(__delim);
- __streambuf_type* __sb = __in.rdbuf();
- __int_type __c = __sb->sbumpc();
- const __int_type __eof = _Traits::eof();
- __testdelim = _Traits::eq_int_type(__c, __idelim);
-
- while (__extracted <= __n && !_Traits::eq_int_type(__c, __eof)
- && !__testdelim)
+ try
{
- __str += _Traits::to_char_type(__c);
- ++__extracted;
- __c = __sb->sbumpc();
+ __str.erase();
+ __int_type __idelim = _Traits::to_int_type(__delim);
+ __streambuf_type* __sb = __in.rdbuf();
+ __int_type __c = __sb->sbumpc();
+ const __int_type __eof = _Traits::eof();
__testdelim = _Traits::eq_int_type(__c, __idelim);
+
+ while (!_Traits::eq_int_type(__c, __eof) && !__testdelim
+ && __extracted < __n)
+ {
+ __str += _Traits::to_char_type(__c);
+ ++__extracted;
+ __c = __sb->sbumpc();
+ __testdelim = _Traits::eq_int_type(__c, __idelim);
+ }
+ if (_Traits::eq_int_type(__c, __eof))
+ __err |= ios_base::eofbit;
+ }
+ catch(...)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 91. Description of operator>> and getline() for string<>
+ // might cause endless loop
+ __in._M_setstate(ios_base::badbit);
}
- if (_Traits::eq_int_type(__c, __eof))
- __in.setstate(ios_base::eofbit);
}
- if (!__extracted && !__testdelim)
- __in.setstate(ios_base::failbit);
+ if ((!__extracted && !__testdelim) || __extracted == __n)
+ __err |= ios_base::failbit;
+ if (__err)
+ __in.setstate(__err);
return __in;
}
diff --git a/libstdc++-v3/include/bits/list.tcc b/libstdc++-v3/include/bits/list.tcc
index 2afde96995a..a4f7c18dffa 100644
--- a/libstdc++-v3/include/bits/list.tcc
+++ b/libstdc++-v3/include/bits/list.tcc
@@ -61,12 +61,12 @@
#ifndef _LIST_TCC
#define _LIST_TCC 1
-namespace std
+namespace __gnu_norm
{
template<typename _Tp, typename _Alloc>
void
_List_base<_Tp,_Alloc>::
- __clear()
+ _M_clear()
{
typedef _List_node<_Tp> _Node;
_Node* __cur = static_cast<_Node*>(this->_M_node._M_next);
@@ -92,7 +92,8 @@ namespace std
this->_M_node._M_next = __x._M_node._M_next;
this->_M_node._M_prev = __x._M_node._M_prev;
- this->_M_node._M_next->_M_prev = this->_M_node._M_prev->_M_next = &this->_M_node;
+ this->_M_node._M_prev->_M_next = &this->_M_node;
+ this->_M_node._M_next->_M_prev = this->_M_node._M_prev->_M_next;
__x._M_node._M_next = __x._M_node._M_prev = &__x._M_node;
}
}
@@ -101,7 +102,8 @@ namespace std
__x._M_node._M_next = this->_M_node._M_next;
__x._M_node._M_prev = this->_M_node._M_prev;
- __x._M_node._M_next->_M_prev = __x._M_node._M_prev->_M_next = &__x._M_node;
+ __x._M_node._M_prev->_M_next = &__x._M_node;
+ __x._M_node._M_next->_M_prev = __x._M_node._M_prev->_M_next;
this->_M_node._M_next = this->_M_node._M_prev = &this->_M_node;
}
else
@@ -109,8 +111,10 @@ namespace std
std::swap(this->_M_node._M_next,__x._M_node._M_next);
std::swap(this->_M_node._M_prev,__x._M_node._M_prev);
- this->_M_node._M_next->_M_prev = this->_M_node._M_prev->_M_next = &this->_M_node;
- __x._M_node._M_next->_M_prev = __x._M_node._M_prev->_M_next = &__x._M_node;
+ this->_M_node._M_prev->_M_next = &this->_M_node;
+ this->_M_node._M_next->_M_prev = this->_M_node._M_prev->_M_next;
+ __x._M_node._M_prev->_M_next = &__x._M_node;
+ __x._M_node._M_next->_M_prev = __x._M_node._M_prev->_M_next;
}
}
@@ -196,11 +200,13 @@ namespace std
template <typename _InputIterator>
void
list<_Tp,_Alloc>::
- _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2, __false_type)
+ _M_assign_dispatch(_InputIterator __first2, _InputIterator __last2,
+ __false_type)
{
iterator __first1 = begin();
iterator __last1 = end();
- for (; __first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
+ for (; __first1 != __last1 && __first2 != __last2;
+ ++__first1, ++__first2)
*__first1 = *__first2;
if (__first2 == __last2)
erase(__first1, __last1);
@@ -249,21 +255,26 @@ namespace std
list<_Tp,_Alloc>::
merge(list& __x)
{
- iterator __first1 = begin();
- iterator __last1 = end();
- iterator __first2 = __x.begin();
- iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (*__first2 < *__first1)
- {
- iterator __next = __first2;
- _M_transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2)
- _M_transfer(__last1, __first2, __last2);
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (*__first2 < *__first1)
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
}
// FIXME put this somewhere else
@@ -271,10 +282,12 @@ namespace std
__List_base_reverse(_List_node_base* __p)
{
_List_node_base* __tmp = __p;
- do {
- std::swap(__tmp->_M_next, __tmp->_M_prev);
- __tmp = __tmp->_M_prev; // Old next node is now prev.
- } while (__tmp != __p);
+ do
+ {
+ std::swap(__tmp->_M_next, __tmp->_M_prev);
+ __tmp = __tmp->_M_prev; // Old next node is now prev.
+ }
+ while (__tmp != __p);
}
template<typename _Tp, typename _Alloc>
@@ -351,20 +364,26 @@ namespace std
list<_Tp,_Alloc>::
merge(list& __x, _StrictWeakOrdering __comp)
{
- iterator __first1 = begin();
- iterator __last1 = end();
- iterator __first2 = __x.begin();
- iterator __last2 = __x.end();
- while (__first1 != __last1 && __first2 != __last2)
- if (__comp(*__first2, *__first1))
- {
- iterator __next = __first2;
- _M_transfer(__first1, __first2, ++__next);
- __first2 = __next;
- }
- else
- ++__first1;
- if (__first2 != __last2) _M_transfer(__last1, __first2, __last2);
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 300. list::merge() specification incomplete
+ if (this != &__x)
+ {
+ iterator __first1 = begin();
+ iterator __last1 = end();
+ iterator __first2 = __x.begin();
+ iterator __last2 = __x.end();
+ while (__first1 != __last1 && __first2 != __last2)
+ if (__comp(*__first2, *__first1))
+ {
+ iterator __next = __first2;
+ _M_transfer(__first1, __first2, ++__next);
+ __first2 = __next;
+ }
+ else
+ ++__first1;
+ if (__first2 != __last2)
+ _M_transfer(__last1, __first2, __last2);
+ }
}
template<typename _Tp, typename _Alloc>
@@ -398,6 +417,6 @@ namespace std
swap(__counter[__fill-1]);
}
}
-} // namespace std
+} // namespace __gnu_norm
#endif /* _LIST_TCC */
diff --git a/libstdc++-v3/include/bits/locale_classes.h b/libstdc++-v3/include/bits/locale_classes.h
index 62dabff85a7..87f9e2b9cfb 100644
--- a/libstdc++-v3/include/bits/locale_classes.h
+++ b/libstdc++-v3/include/bits/locale_classes.h
@@ -51,10 +51,24 @@
namespace std
{
// 22.1.1 Class locale
+ /**
+ * @brief Container class for localization functionality.
+ *
+ * The locale class is first a class wrapper for C library locales. It is
+ * also an extensible container for user-defined localization. A locale is
+ * a collection of facets that implement various localization features such
+ * as money, time, and number printing.
+ *
+ * Constructing C++ locales does not change the C library locale.
+ *
+ * This library supports efficient construction and copying of locales
+ * through a reference counting implementation of the locale class.
+ */
class locale
{
public:
// Types:
+ /// Definition of locale::category.
typedef unsigned int category;
// Forward decls and friends:
@@ -76,8 +90,18 @@ namespace std
template<typename _Cache>
friend struct __use_cache;
- // Category values:
- // NB: Order must match _S_facet_categories definition in locale.cc
+ //@{
+ /**
+ * @brief Category values.
+ *
+ * The standard category values are none, ctype, numeric, collate, time,
+ * monetary, and messages. They form a bitmask that supports union and
+ * intersection. The category all is the union of these values.
+ *
+ * @if maint
+ * NB: Order must match _S_facet_categories definition in locale.cc
+ * @endif
+ */
static const category none = 0;
static const category ctype = 1L << 0;
static const category numeric = 1L << 1;
@@ -87,51 +111,173 @@ namespace std
static const category messages = 1L << 5;
static const category all = (ctype | numeric | collate |
time | monetary | messages);
+ //@}
// Construct/copy/destroy:
+
+ /**
+ * @brief Default constructor.
+ *
+ * Constructs a copy of the global locale. If no locale has been
+ * explicitly set, this is the "C" locale.
+ */
locale() throw();
+ /**
+ * @brief Copy constructor.
+ *
+ * Constructs a copy of @a other.
+ *
+ * @param other The locale to copy.
+ */
locale(const locale& __other) throw();
+ /**
+ * @brief Named locale constructor.
+ *
+ * Constructs a copy of the named C library locale.
+ *
+ * @param s Name of the locale to construct.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
explicit
locale(const char* __s);
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale named by @a s. If base is
+ * named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param s Name of the locale to use facets from.
+ * @param cat Set of categories defining the facets to use from s.
+ * @throw std::runtime_error if s is null or an undefined locale.
+ */
locale(const locale& __base, const char* __s, category __cat);
+ /**
+ * @brief Construct locale with facets from another locale.
+ *
+ * Constructs a copy of the locale @a base. The facets specified by @a
+ * cat are replaced with those from the locale @a add. If @a base and @a
+ * add are named, this locale instance will also be named.
+ *
+ * @param base The locale to copy.
+ * @param add The locale to use facets from.
+ * @param cat Set of categories defining the facets to use from add.
+ */
locale(const locale& __base, const locale& __add, category __cat);
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs a copy of the locale @a other. The facet @f is added to
+ * @other, replacing an existing facet of type Facet if there is one. If
+ * @f is null, this locale is a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @param f The facet to add in.
+ */
template<typename _Facet>
locale(const locale& __other, _Facet* __f);
+ /// Locale destructor.
~locale() throw();
- const locale&
+ /**
+ * @brief Assignment operator.
+ *
+ * Set this locale to be a copy of @a other.
+ *
+ * @param other The locale to copy.
+ * @return A reference to this locale.
+ */
+ const locale&
operator=(const locale& __other) throw();
+ /**
+ * @brief Construct locale with another facet.
+ *
+ * Constructs and returns a new copy of this locale. Adds or replaces an
+ * existing facet of type Facet from the locale @a other into the new
+ * locale.
+ *
+ * @param Facet The facet type to copy from other
+ * @param other The locale to copy from.
+ * @return Newly constructed locale.
+ * @throw std::runtime_error if other has no facet of type Facet.
+ */
template<typename _Facet>
locale
combine(const locale& __other) const;
// Locale operations:
+ /**
+ * @brief Return locale name.
+ * @return Locale name or "*" if unnamed.
+ */
string
name() const;
+ /**
+ * @brief Locale equality.
+ *
+ * @param other The locale to compare against.
+ * @return True if other and this refer to the same locale instance, are
+ * copies, or have the same name. False otherwise.
+ */
bool
operator==(const locale& __other) const throw ();
+ /**
+ * @brief Locale inequality.
+ *
+ * @param other The locale to compare against.
+ * @return ! (*this == other)
+ */
inline bool
operator!=(const locale& __other) const throw ()
{ return !(this->operator==(__other)); }
+ /**
+ * @brief Compare two strings according to collate.
+ *
+ * Template operator to compare two strings using the compare function of
+ * the collate facet in this locale. One use is to provide the locale to
+ * the sort function. For example, a vector v of strings could be sorted
+ * according to locale loc by doing:
+ * @code
+ * std::sort(v.begin(), v.end(), loc);
+ * @endcode
+ *
+ * @param s1 First string to compare.
+ * @param s2 Second string to compare.
+ * @return True if collate<Char> facet compares s1 < s2, else false.
+ */
template<typename _Char, typename _Traits, typename _Alloc>
bool
operator()(const basic_string<_Char, _Traits, _Alloc>& __s1,
const basic_string<_Char, _Traits, _Alloc>& __s2) const;
// Global locale objects:
+ /**
+ * @brief Set global locale
+ *
+ * This function sets the global locale to the argument and returns a
+ * copy of the previous global locale. If the argument has a name, it
+ * will also call std::setlocale(LC_ALL, loc.name()).
+ *
+ * @param locale The new locale to make global.
+ * @return Copy of the old global locale.
+ */
static locale
global(const locale&);
+ /**
+ * @brief Return reference to the "C" locale.
+ */
static const locale&
classic();
@@ -185,13 +331,22 @@ namespace std
// 22.1.1.1.2 Class locale::facet
+ /**
+ * @brief Localization functionality base class.
+ *
+ * The facet class is the base class for a localization feature, such as
+ * money, time, and number printing. It provides common support for facets
+ * and reference management.
+ *
+ * Facets may not be copied or assigned.
+ */
class locale::facet
{
private:
friend class locale;
friend class locale::_Impl;
- mutable _Atomic_word _M_references;
+ mutable _Atomic_word _M_refcount;
// Contains data from the underlying "C" library for the classic locale.
static __c_locale _S_c_locale;
@@ -207,10 +362,20 @@ namespace std
_S_initialize_once();
protected:
+ /**
+ * @brief Facet constructor.
+ *
+ * This is the constructor provided by the standard. If refs is 0, the
+ * facet is destroyed when the last referencing locale is destroyed.
+ * Otherwise the facet will never be destroyed.
+ *
+ * @param refs The initial value for reference count.
+ */
explicit
- facet(size_t __refs = 0) throw() : _M_references(__refs ? 1 : 0)
+ facet(size_t __refs = 0) throw() : _M_refcount(__refs ? 1 : 0)
{ }
+ /// Facet destructor.
virtual
~facet();
@@ -235,12 +400,12 @@ namespace std
private:
inline void
_M_add_reference() const throw()
- { __atomic_add(&_M_references, 1); }
+ { __atomic_add(&_M_refcount, 1); }
inline void
_M_remove_reference() const throw()
{
- if (__exchange_and_add(&_M_references, -1) == 1)
+ if (__exchange_and_add(&_M_refcount, -1) == 1)
{
try
{ delete this; }
@@ -257,6 +422,15 @@ namespace std
// 22.1.1.1.3 Class locale::id
+ /**
+ * @brief Facet ID class.
+ *
+ * The ID class provides facets with an index used to identify them.
+ * Every facet class must define a public static member locale::id, or be
+ * derived from a facet that provides this member, otherwise the facet
+ * cannot be used in a locale. The locale::id ensures that each class
+ * type gets a unique identifier.
+ */
class locale::id
{
private:
@@ -277,7 +451,7 @@ namespace std
mutable size_t _M_index;
// Last id number assigned.
- static _Atomic_word _S_highwater;
+ static _Atomic_word _S_refcount;
void
operator=(const id&); // Not defined.
@@ -287,6 +461,7 @@ namespace std
public:
// NB: This class is always a static data member, and thus can be
// counted on to be zero-initialized.
+ /// Constructor.
id() { }
size_t
@@ -315,7 +490,7 @@ namespace std
private:
// Data Members.
- _Atomic_word _M_references;
+ _Atomic_word _M_refcount;
const facet** _M_facets;
size_t _M_facets_size;
const facet** _M_caches;
@@ -330,12 +505,12 @@ namespace std
inline void
_M_add_reference() throw()
- { __atomic_add(&_M_references, 1); }
+ { __atomic_add(&_M_refcount, 1); }
inline void
_M_remove_reference() throw()
{
- if (__exchange_and_add(&_M_references, -1) == 1)
+ if (__exchange_and_add(&_M_refcount, -1) == 1)
{
try
{ delete this; }
diff --git a/libstdc++-v3/include/bits/locale_facets.h b/libstdc++-v3/include/bits/locale_facets.h
index abb9d143c61..2d3f776b26f 100644
--- a/libstdc++-v3/include/bits/locale_facets.h
+++ b/libstdc++-v3/include/bits/locale_facets.h
@@ -63,45 +63,23 @@ namespace std
template<typename _Tv>
void
__convert_to_v(const char* __in, _Tv& __out, ios_base::iostate& __err,
- const __c_locale& __cloc, int __base = 10);
+ const __c_locale& __cloc);
// Explicit specializations for required types.
template<>
void
- __convert_to_v(const char*, long&, ios_base::iostate&,
- const __c_locale&, int);
-
- template<>
- void
- __convert_to_v(const char*, unsigned long&, ios_base::iostate&,
- const __c_locale&, int);
-
-#ifdef _GLIBCXX_USE_LONG_LONG
- template<>
- void
- __convert_to_v(const char*, long long&, ios_base::iostate&,
- const __c_locale&, int);
-
- template<>
- void
- __convert_to_v(const char*, unsigned long long&, ios_base::iostate&,
- const __c_locale&, int);
-#endif
-
- template<>
- void
__convert_to_v(const char*, float&, ios_base::iostate&,
- const __c_locale&, int);
+ const __c_locale&);
template<>
void
__convert_to_v(const char*, double&, ios_base::iostate&,
- const __c_locale&, int);
+ const __c_locale&);
- template<>
+ template<>
void
__convert_to_v(const char*, long double&, ios_base::iostate&,
- const __c_locale&, int);
+ const __c_locale&);
// NB: __pad is a struct, rather than a function, so it can be
// partially-specialized.
@@ -125,7 +103,7 @@ namespace std
template<typename _CharT>
bool
__verify_grouping(const basic_string<_CharT>& __grouping,
- basic_string<_CharT>& __grouping_tmp);
+ const basic_string<_CharT>& __grouping_tmp);
// Used by both numeric and monetary facets.
// Inserts "group separator" characters into an array of characters.
@@ -167,57 +145,217 @@ namespace std
#include <bits/ctype_base.h>
// Common base for ctype<_CharT>.
+ /**
+ * @brief Common base for ctype facet
+ *
+ * This template class provides implementations of the public functions
+ * that forward to the protected virtual functions.
+ *
+ * This template also provides abtract stubs for the protected virtual
+ * functions.
+ */
template<typename _CharT>
class __ctype_abstract_base : public locale::facet, public ctype_base
{
public:
// Types:
+ /// Typedef for the template parameter
typedef _CharT char_type;
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ * It does so by returning the value of ctype<char_type>::do_is().
+ *
+ * @param c The char_type to compare the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
bool
is(mask __m, char_type __c) const
{ return this->do_is(__m, __c); }
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the char array. It does so by returning the value of
+ * ctype<char_type>::do_is().
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
const char_type*
is(const char_type *__lo, const char_type *__hi, mask *__vec) const
{ return this->do_is(__lo, __hi, __vec); }
+ /**
+ * @brief Find char_type matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true. It does so by returning
+ * ctype<char_type>::do_scan_is().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to matching char_type if found, else @a hi.
+ */
const char_type*
scan_is(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_is(__m, __lo, __hi); }
+ /**
+ * @brief Find char_type not matching a mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is false. It does so by returning
+ * ctype<char_type>::do_scan_not().
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to non-matching char if found, else @a hi.
+ */
const char_type*
scan_not(mask __m, const char_type* __lo, const char_type* __hi) const
{ return this->do_scan_not(__m, __lo, __hi); }
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument. It does
+ * so by returning ctype<char_type>::do_toupper().
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_toupper(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
const char_type*
toupper(char_type *__lo, const char_type* __hi) const
{ return this->do_toupper(__lo, __hi); }
- char_type
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the argument to lowercase if possible. If
+ * not possible (for example, '2'), returns the argument. It does so
+ * by returning ctype<char_type>::do_tolower(c).
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char_type in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched. It does so
+ * by returning ctype<char_type>:: do_tolower(lo, hi).
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
const char_type*
tolower(char_type* __lo, const char_type* __hi) const
{ return this->do_tolower(__lo, __hi); }
- char_type
+ /**
+ * @brief Widen char to char_type
+ *
+ * This function converts the char argument to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type.
+ */
+ char_type
widen(char __c) const
{ return this->do_widen(__c); }
+ /**
+ * @brief Widen array to char_type
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation. It does so by returning
+ * ctype<char_type>::do_widen(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
const char*
widen(const char* __lo, const char* __hi, char_type* __to) const
{ return this->do_widen(__lo, __hi, __to); }
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This function converts the char_type to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. It does so by returning
+ * ctype<char_type>::do_narrow(c).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
char
narrow(char_type __c, char __dfault) const
{ return this->do_narrow(__c, __dfault); }
+ /**
+ * @brief Narrow array to char array
+ *
+ * This function converts each char_type in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char_type in the input that cannot be
+ * converted, @a dfault is used instead. It does so by returning
+ * ctype<char_type>::do_narrow(lo, hi, dfault, to).
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
const char_type*
narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char *__to) const
@@ -230,49 +368,253 @@ namespace std
virtual
~__ctype_abstract_base() { }
- virtual bool
+ /**
+ * @brief Test char_type classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The char_type to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
+ virtual bool
do_is(mask __m, char_type __c) const = 0;
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char_type in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi,
mask* __vec) const = 0;
+ /**
+ * @brief Find char_type matching mask
+ *
+ * This function searches for and returns the first char_type c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char_type if found, else @a hi.
+ */
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo,
const char_type* __hi) const = 0;
+ /**
+ * @brief Find char_type not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * char_type c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char_type if found, else @a hi.
+ */
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const = 0;
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char_type argument to uppercase
+ * if possible. If not possible (for example, '2'), returns the
+ * argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The uppercase char_type if convertible, else @a c.
+ */
virtual char_type
do_toupper(char_type) const = 0;
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const = 0;
- virtual char_type
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char_type to convert.
+ * @return The lowercase char_type if convertible, else @a c.
+ */
+ virtual char_type
do_tolower(char_type) const = 0;
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char_type in the range [lo,hi)
+ * to lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const = 0;
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted char_type
+ */
virtual char_type
do_widen(char) const = 0;
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char_type using the
+ * simplest reasonable transformation.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char*
do_widen(const char* __lo, const char* __hi,
char_type* __dest) const = 0;
+ /**
+ * @brief Narrow char_type to char
+ *
+ * This virtual function converts the argument to char using the
+ * simplest reasonable transformation. If the conversion fails, dfault
+ * is returned instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char_type to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
virtual char
do_narrow(char_type, char __dfault) const = 0;
+ /**
+ * @brief Narrow char_type array to char
+ *
+ * This virtual function converts each char_type in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any element in the input that
+ * cannot be converted, @a dfault is used instead.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
- char __dfault, char* __dest) const = 0;
+ char __dfault, char* __dest) const = 0;
};
// NB: Generic, mostly useless implementation.
+ /**
+ * @brief Template ctype facet
+ *
+ * This template class defines classification and conversion functions for
+ * character sets. It wraps <cctype> functionality. Ctype gets used by
+ * streams for many I/O operations.
+ *
+ * This template provides the protected virtual functions the developer
+ * will have to replace in a derived class or specialization to make a
+ * working facet. The public functions that access them are defined in
+ * __ctype_abstract_base, to allow for implementation flexibility. See
+ * ctype<wchar_t> for an example. The functions are documented in
+ * __ctype_abstract_base.
+ *
+ * Note: implementations are provided for all the protected virtual
+ * functions, but will likely not be useful.
+ */
template<typename _CharT>
class ctype : public __ctype_abstract_base<_CharT>
{
@@ -281,6 +623,7 @@ namespace std
typedef _CharT char_type;
typedef typename ctype::mask mask;
+ /// The facet id for ctype<char_type>
static locale::id id;
explicit
@@ -333,11 +676,20 @@ namespace std
locale::id ctype<_CharT>::id;
// 22.2.1.3 ctype<char> specialization.
+ /**
+ * @brief The ctype<char> specialization.
+ *
+ * This class defines classification and conversion functions for
+ * the char type. It gets used by char streams for many I/O
+ * operations. The char specialization provides a number of
+ * optimizations as well.
+ */
template<>
class ctype<char> : public locale::facet, public ctype_base
{
public:
// Types:
+ /// Typedef for the template parameter char.
typedef char char_type;
protected:
@@ -347,90 +699,410 @@ namespace std
__to_type _M_toupper;
__to_type _M_tolower;
const mask* _M_table;
+ mutable char _M_widen_ok;
+ mutable char _M_widen[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow[1 + static_cast<unsigned char>(-1)];
+ mutable char _M_narrow_ok; // 0 uninitialized, 1 init,
+ // 2 non-consecutive
public:
+ /// The facet id for ctype<char>
static locale::id id;
+ /// The size of the mask table. It is SCHAR_MAX + 1.
static const size_t table_size = 1 + static_cast<unsigned char>(-1);
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param table If non-zero, table is used as the per-char mask.
+ * Else classic_table() is used.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
explicit
ctype(const mask* __table = 0, bool __del = false, size_t __refs = 0);
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param table If non-zero, table is used as the per-char mask.
+ * @param del If true, passes ownership of table to this facet.
+ * @param refs Passed to the base facet class.
+ */
explicit
ctype(__c_locale __cloc, const mask* __table = 0, bool __del = false,
size_t __refs = 0);
- inline bool
+ /**
+ * @brief Test char classification.
+ *
+ * This function compares the mask table[c] to @a m.
+ *
+ * @param c The char to compare the mask of.
+ * @param m The mask to compare against.
+ * @return True if m & table[c] is true, false otherwise.
+ */
+ inline bool
is(mask __m, char __c) const;
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each char in the range [lo, hi) and
+ * successively writes it to vec. vec must have as many elements as
+ * the char array.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
inline const char*
is(const char* __lo, const char* __hi, mask* __vec) const;
+ /**
+ * @brief Find char matching a mask
+ *
+ * This function searches for and returns the first char in [lo,hi) for
+ * which is(m,char) is true.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching char if found, else @a hi.
+ */
inline const char*
scan_is(mask __m, const char* __lo, const char* __hi) const;
+ /**
+ * @brief Find char not matching a mask
+ *
+ * This function searches for and returns a pointer to the first char
+ * in [lo,hi) for which is(m,char) is false.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching char if found, else @a hi.
+ */
inline const char*
scan_not(mask __m, const char* __lo, const char* __hi) const;
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This function converts the char argument to uppercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * toupper() acts as if it returns ctype<char>::do_toupper(c).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
char_type
toupper(char_type __c) const
{ return this->do_toupper(__c); }
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This function converts each char in the range [lo,hi) to uppercase
+ * if possible. Other chars remain untouched.
+ *
+ * toupper() acts as if it returns ctype<char>:: do_toupper(lo, hi).
+ * do_toupper() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
const char_type*
toupper(char_type *__lo, const char_type* __hi) const
{ return this->do_toupper(__lo, __hi); }
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This function converts the char argument to lowercase if possible.
+ * If not possible (for example, '2'), returns the argument.
+ *
+ * tolower() acts as if it returns ctype<char>::do_tolower(c).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
char_type
tolower(char_type __c) const
{ return this->do_tolower(__c); }
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This function converts each char in the range [lo,hi) to lowercase
+ * if possible. Other chars remain untouched.
+ *
+ * tolower() acts as if it returns ctype<char>:: do_tolower(lo, hi).
+ * do_tolower() must always return the same result for the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
const char_type*
tolower(char_type* __lo, const char_type* __hi) const
{ return this->do_tolower(__lo, __hi); }
+ /**
+ * @brief Widen char
+ *
+ * This function converts the char to char_type using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
char_type
widen(char __c) const
- { return this->do_widen(__c); }
+ {
+ if (_M_widen_ok) return _M_widen[static_cast<unsigned char>(__c)];
+ this->_M_widen_init();
+ return this->do_widen(__c);
+ }
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_widen(c).
+ * do_widen() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
const char*
widen(const char* __lo, const char* __hi, char_type* __to) const
- { return this->do_widen(__lo, __hi, __to); }
+ {
+ if (_M_widen_ok == 1)
+ {
+ memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_widen_ok) _M_widen_init();
+ return this->do_widen(__lo, __hi, __to);
+ }
+ /**
+ * @brief Narrow char
+ *
+ * This function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c
+ * will be returned unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(c).
+ * do_narrow() must always return the same result for the same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted character.
+ */
char
narrow(char_type __c, char __dfault) const
- { return this->do_narrow(__c, __dfault); }
+ {
+ if (_M_narrow[static_cast<unsigned char>(__c)])
+ return _M_narrow[static_cast<unsigned char>(__c)];
+ const char __t = do_narrow(__c, __dfault);
+ if (__t != __dfault) _M_narrow[static_cast<unsigned char>(__c)] = __t;
+ return __t;
+ }
+ /**
+ * @brief Narrow char array
+ *
+ * This function converts each char in the input to char using the
+ * simplest reasonable transformation and writes the results to the
+ * destination array. For any char in the input that cannot be
+ * converted, @a dfault is used instead. For an underived ctype<char>
+ * facet, the argument will be copied unchanged.
+ *
+ * This function works as if it returns ctype<char>::do_narrow(lo, hi,
+ * dfault, to). do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
const char_type*
narrow(const char_type* __lo, const char_type* __hi,
- char __dfault, char *__to) const
- { return this->do_narrow(__lo, __hi, __dfault, __to); }
+ char __dfault, char *__to) const
+ {
+ if (__builtin_expect(_M_narrow_ok == 1,true))
+ {
+ memcpy(__to, __lo, __hi - __lo);
+ return __hi;
+ }
+ if (!_M_narrow_ok)
+ _M_narrow_init();
+ return this->do_narrow(__lo, __hi, __dfault, __to);
+ }
protected:
+ /// Returns a pointer to the mask table provided to the constructor, or
+ /// the default from classic_table() if none was provided.
const mask*
table() const throw()
{ return _M_table; }
+ /// Returns a pointer to the C locale mask table.
static const mask*
classic_table() throw();
+ /**
+ * @brief Destructor.
+ *
+ * This function deletes table() if @a del was true in the
+ * constructor.
+ */
virtual
~ctype();
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the char argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The uppercase char if convertible, else @a c.
+ */
virtual char_type
do_toupper(char_type) const;
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * uppercase if possible. Other chars remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the char argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The char to convert.
+ * @return The lowercase char if convertible, else @a c.
+ */
virtual char_type
do_tolower(char_type) const;
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * lowercase if possible. Other chars remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to first char in range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
+ /**
+ * @brief Widen char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. For an underived ctype<char> facet, the
+ * argument will be returned unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted character.
+ */
virtual char_type
do_widen(char __c) const
{ return __c; }
+ /**
+ * @brief Widen char array
+ *
+ * This function converts each char in the range [lo,hi) to char using
+ * the simplest reasonable transformation. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const
{
@@ -438,10 +1110,51 @@ namespace std
return __hi;
}
+ /**
+ * @brief Narrow char
+ *
+ * This virtual function converts the char to char using the simplest
+ * reasonable transformation. If the conversion fails, dfault is
+ * returned instead. For an underived ctype<char> facet, @a c will be
+ * returned unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
virtual char
do_narrow(char_type __c, char) const
{ return __c; }
+ /**
+ * @brief Narrow char array to char array
+ *
+ * This virtual function converts each char in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any char in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<char> facet, the argument will be copied unchanged.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char, char* __dest) const
@@ -449,6 +1162,52 @@ namespace std
memcpy(__dest, __lo, __hi - __lo);
return __hi;
}
+
+ private:
+
+ void _M_widen_init() const
+ {
+ char __tmp[sizeof(_M_widen)];
+ for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
+ __tmp[__i] = __i;
+ do_widen(__tmp, __tmp + sizeof(__tmp), _M_widen);
+
+ _M_widen_ok = 1;
+ // Set _M_widen_ok to 2 if memcpy can't be used.
+ for (size_t __i = 0; __i < sizeof(_M_widen); ++__i)
+ if (__tmp[__i] != _M_widen[__i])
+ {
+ _M_widen_ok = 2;
+ break;
+ }
+ }
+
+ // Fill in the narrowing cache and flag whether all values are
+ // valid or not. _M_narrow_ok is set to 1 if the whole table is
+ // narrowed, 2 if only some values could be narrowed.
+ void _M_narrow_init() const
+ {
+ char __tmp[sizeof(_M_narrow)];
+ for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
+ __tmp[__i] = __i;
+ do_narrow(__tmp, __tmp + sizeof(__tmp), 0, _M_narrow);
+
+ // Check if any default values were created. Do this by
+ // renarrowing with a different default value and comparing.
+ bool __consecutive = true;
+ for (size_t __i = 0; __i < sizeof(_M_narrow); ++__i)
+ if (!_M_narrow[__i])
+ {
+ char __c;
+ do_narrow(__tmp + __i, __tmp + __i + 1, 1, &__c);
+ if (__c == 1)
+ {
+ __consecutive = false;
+ break;
+ }
+ }
+ _M_narrow_ok = __consecutive ? 1 : 2;
+ }
};
template<>
@@ -457,24 +1216,60 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
// 22.2.1.3 ctype<wchar_t> specialization
+ /**
+ * @brief The ctype<wchar_t> specialization.
+ *
+ * This class defines classification and conversion functions for the
+ * wchar_t type. It gets used by wchar_t streams for many I/O operations.
+ * The wchar_t specialization provides a number of optimizations as well.
+ *
+ * ctype<wchar_t> inherits its public methods from
+ * __ctype_abstract_base<wchar_t>.
+ */
template<>
class ctype<wchar_t> : public __ctype_abstract_base<wchar_t>
{
public:
// Types:
+ /// Typedef for the template parameter wchar_t.
typedef wchar_t char_type;
typedef wctype_t __wmask_type;
protected:
__c_locale _M_c_locale_ctype;
+ // Pre-computed narrowed and widened chars.
+ bool _M_narrow_ok;
+ char _M_narrow[128];
+ wint_t _M_widen[1 + static_cast<unsigned char>(-1)];
+
+ // Pre-computed elements for do_is.
+ mask _M_bit[16];
+ __wmask_type _M_wmask[16];
+
public:
// Data Members:
+ /// The facet id for ctype<wchar_t>
static locale::id id;
+ /**
+ * @brief Constructor performs initialization.
+ *
+ * This is the constructor provided by the standard.
+ *
+ * @param refs Passed to the base facet class.
+ */
explicit
ctype(size_t __refs = 0);
+ /**
+ * @brief Constructor performs static initialization.
+ *
+ * This constructor is used to construct the initial C locale facet.
+ *
+ * @param cloc Handle to C locale data.
+ * @param refs Passed to the base facet class.
+ */
explicit
ctype(__c_locale __cloc, size_t __refs = 0);
@@ -482,46 +1277,242 @@ namespace std
__wmask_type
_M_convert_to_wmask(const mask __m) const;
+ /// Destructor
virtual
~ctype();
+ /**
+ * @brief Test wchar_t classification.
+ *
+ * This function finds a mask M for @a c and compares it to mask @a m.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param c The wchar_t to find the mask of.
+ * @param m The mask to compare against.
+ * @return (M & m) != 0.
+ */
virtual bool
do_is(mask __m, char_type __c) const;
+ /**
+ * @brief Return a mask array.
+ *
+ * This function finds the mask for each wchar_t in the range [lo,hi)
+ * and successively writes it to vec. vec must have as many elements
+ * as the input.
+ *
+ * do_is() is a hook for a derived facet to change the behavior of
+ * classifying. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param vec Pointer to an array of mask storage.
+ * @return @a hi.
+ */
virtual const char_type*
do_is(const char_type* __lo, const char_type* __hi, mask* __vec) const;
+ /**
+ * @brief Find wchar_t matching mask
+ *
+ * This function searches for and returns the first wchar_t c in
+ * [lo,hi) for which is(m,c) is true.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a matching wchar_t if found, else @a hi.
+ */
virtual const char_type*
do_scan_is(mask __m, const char_type* __lo, const char_type* __hi) const;
+ /**
+ * @brief Find wchar_t not matching mask
+ *
+ * This function searches for and returns a pointer to the first
+ * wchar_t c of [lo,hi) for which is(m,c) is false.
+ *
+ * do_scan_is() is a hook for a derived facet to change the behavior of
+ * match searching. do_is() must always return the same result for the
+ * same input.
+ *
+ * @param m The mask to compare against.
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return Pointer to a non-matching wchar_t if found, else @a hi.
+ */
virtual const char_type*
do_scan_not(mask __m, const char_type* __lo,
const char_type* __hi) const;
+ /**
+ * @brief Convert to uppercase.
+ *
+ * This virtual function converts the wchar_t argument to uppercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The uppercase wchar_t if convertible, else @a c.
+ */
virtual char_type
do_toupper(char_type) const;
+ /**
+ * @brief Convert array to uppercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * uppercase if possible. Other elements remain untouched.
+ *
+ * do_toupper() is a hook for a derived facet to change the behavior of
+ * uppercasing. do_toupper() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_toupper(char_type* __lo, const char_type* __hi) const;
+ /**
+ * @brief Convert to lowercase.
+ *
+ * This virtual function converts the argument to lowercase if
+ * possible. If not possible (for example, '2'), returns the argument.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param c The wchar_t to convert.
+ * @return The lowercase wchar_t if convertible, else @a c.
+ */
virtual char_type
do_tolower(char_type) const;
+ /**
+ * @brief Convert array to lowercase.
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * lowercase if possible. Other elements remain untouched.
+ *
+ * do_tolower() is a hook for a derived facet to change the behavior of
+ * lowercasing. do_tolower() must always return the same result for
+ * the same input.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @return @a hi.
+ */
virtual const char_type*
do_tolower(char_type* __lo, const char_type* __hi) const;
+ /**
+ * @brief Widen char to wchar_t
+ *
+ * This virtual function converts the char to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be cast to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The char to convert.
+ * @return The converted wchar_t.
+ */
virtual char_type
do_widen(char) const;
+ /**
+ * @brief Widen char array to wchar_t array
+ *
+ * This function converts each char in the input to wchar_t using the
+ * simplest reasonable transformation. For an underived ctype<wchar_t>
+ * facet, the argument will be copied, casting each element to wchar_t.
+ *
+ * do_widen() is a hook for a derived facet to change the behavior of
+ * widening. do_widen() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start range.
+ * @param hi Pointer to end of range.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char*
do_widen(const char* __lo, const char* __hi, char_type* __dest) const;
+ /**
+ * @brief Narrow wchar_t to char
+ *
+ * This virtual function converts the argument to char using the
+ * simplest reasonable transformation. If the conversion fails, dfault
+ * is returned instead. For an underived ctype<wchar_t> facet, @a c will
+ * be cast to char and returned.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param c The wchar_t to convert.
+ * @param dfault Char to return if conversion fails.
+ * @return The converted char.
+ */
virtual char
do_narrow(char_type, char __dfault) const;
+ /**
+ * @brief Narrow wchar_t array to char array
+ *
+ * This virtual function converts each wchar_t in the range [lo,hi) to
+ * char using the simplest reasonable transformation and writes the
+ * results to the destination array. For any wchar_t in the input that
+ * cannot be converted, @a dfault is used instead. For an underived
+ * ctype<wchar_t> facet, the argument will be copied, casting each
+ * element to char.
+ *
+ * do_narrow() is a hook for a derived facet to change the behavior of
+ * narrowing. do_narrow() must always return the same result for the
+ * same input.
+ *
+ * Note: this is not what you want for codepage conversions. See
+ * codecvt for that.
+ *
+ * @param lo Pointer to start of range.
+ * @param hi Pointer to end of range.
+ * @param dfault Char to use if conversion fails.
+ * @param to Pointer to the destination array.
+ * @return @a hi.
+ */
virtual const char_type*
do_narrow(const char_type* __lo, const char_type* __hi,
char __dfault, char* __dest) const;
+
+ // For use at construction time only.
+ void
+ _M_initialize_ctype();
};
template<>
@@ -586,7 +1577,7 @@ namespace std
static const char* _S_atoms_out;
// String literal of acceptable (narrow) input, for num_get.
- // "-+xX0123456789eEabcdfABCDF"
+ // "-+xX0123456789abcdefABCDEF"
static const char* _S_atoms_in;
enum
@@ -596,8 +1587,8 @@ namespace std
_S_ix,
_S_iX,
_S_izero,
- _S_ie = _S_izero + 10,
- _S_iE = _S_izero + 11,
+ _S_ie = _S_izero + 14,
+ _S_iE = _S_izero + 20,
_S_iend = 26
};
@@ -624,7 +1615,7 @@ namespace std
_CharT _M_atoms_out[__num_base::_S_oend + 1];
// A list of valid numeric literals for input: in the standard
- // "C" locale, this is "-+xX0123456789eEabcdfABCDF"
+ // "C" locale, this is "-+xX0123456789abcdefABCDEF"
// This array contains the chars after having been passed
// through the current locale's ctype<_CharT>.widen().
_CharT _M_atoms_in[__num_base::_S_iend + 1];
@@ -647,32 +1638,33 @@ namespace std
void
__numpunct_cache<_CharT>::_M_cache(const locale& __loc)
{
+ _M_allocated = true;
+
const numpunct<_CharT>& __np = use_facet<numpunct<_CharT> >(__loc);
- string __grouping = __np.grouping();
- char* __group = new char[__grouping.length() + 1];
- __grouping.copy(__group, __grouping.length());
- __group[__grouping.length()] = char();
- _M_grouping = __group;
-
- _M_use_grouping = __grouping.length() != 0 && __grouping.data()[0] != 0;
- typedef basic_string<_CharT> __string_type;
+ const string::size_type __len = __np.grouping().size();
+ char* __grouping = new char[__len + 1];
+ __np.grouping().copy(__grouping, __len);
+ __grouping[__len] = char();
+ _M_grouping = __grouping;
+ _M_use_grouping = __len && __np.grouping()[0] != 0;
- __string_type __true = __np.truename();
- _CharT* __truename = new _CharT[__true.length() + 1];
- __true.copy(__truename, __true.length());
- __truename[__true.length()] = _CharT();
+ typedef basic_string<_CharT> __string_type;
+ typename __string_type::size_type __lentf = __np.truename().size();
+ _CharT* __truename = new _CharT[__lentf + 1];
+ __np.truename().copy(__truename, __lentf);
+ __truename[__lentf] = _CharT();
_M_truename = __truename;
-
- __string_type __false = __np.falsename();
- _CharT* __falsename = new _CharT[__false.length() + 1];
- __false.copy(__falsename, __false.length());
- __falsename[__false.length()] = _CharT();
+
+ __lentf = __np.falsename().size();
+ _CharT* __falsename = new _CharT[__lentf + 1];
+ __np.falsename().copy(__falsename, __lentf);
+ __falsename[__lentf] = _CharT();
_M_falsename = __falsename;
-
+
_M_decimal_point = __np.decimal_point();
_M_thousands_sep = __np.thousands_sep();
-
+
const ctype<_CharT>& __ct = use_facet<ctype<_CharT> >(__loc);
__ct.widen(__num_base::_S_atoms_out,
__num_base::_S_atoms_out + __num_base::_S_oend, _M_atoms_out);
@@ -680,8 +1672,6 @@ namespace std
__ct.widen(__num_base::_S_atoms_in,
__num_base::_S_atoms_in + __num_base::_S_iend, _M_atoms_in);
_M_atoms_in[__num_base::_S_iend] = _CharT();
-
- _M_allocated = true;
}
template<typename _CharT>
@@ -894,9 +1884,10 @@ namespace std
_M_extract_float(iter_type, iter_type, ios_base&, ios_base::iostate&,
string& __xtrc) const;
- iter_type
- _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
- string& __xtrc, int& __base) const;
+ template<typename _ValueT>
+ iter_type
+ _M_extract_int(iter_type, iter_type, ios_base&, ios_base::iostate&,
+ _ValueT& __v) const;
virtual iter_type
do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, bool&) const;
@@ -1519,6 +2510,7 @@ namespace std
void
_M_extract_name(iter_type& __beg, iter_type& __end, int& __member,
const _CharT** __names, size_t __indexlen,
+ const ctype<_CharT>& __ctype,
ios_base::iostate& __err) const;
// Extract on a component-by-component basis, via __format argument.
diff --git a/libstdc++-v3/include/bits/locale_facets.tcc b/libstdc++-v3/include/bits/locale_facets.tcc
index 0c323dd3471..40b612c1dde 100644
--- a/libstdc++-v3/include/bits/locale_facets.tcc
+++ b/libstdc++-v3/include/bits/locale_facets.tcc
@@ -35,11 +35,6 @@
#pragma GCC system_header
-#include <cerrno>
-#include <clocale> // For localeconv
-#include <cstdlib> // For strof, strtold
-#include <cmath> // For ceil
-#include <cctype> // For isspace
#include <limits> // For numeric_limits
#include <typeinfo> // For bad_cast.
#include <bits/streambuf_iterator.h>
@@ -74,6 +69,18 @@ namespace std
__s2.data(), __s2.data() + __s2.length()) < 0);
}
+ /**
+ * @brief Test for the presence of a facet.
+ *
+ * has_facet tests the locale argument for the presence of the facet type
+ * provided as the template parameter. Facets derived from the facet
+ * parameter will also return true.
+ *
+ * @param Facet The facet type to test the presence of.
+ * @param locale The locale to test.
+ * @return true if locale contains a facet of type Facet, else false.
+ * @throw std::bad_cast if locale doesn't contain the facet.
+ */
template<typename _Facet>
inline bool
has_facet(const locale& __loc) throw()
@@ -83,6 +90,19 @@ namespace std
return (__i < __loc._M_impl->_M_facets_size && __facets[__i]);
}
+ /**
+ * @brief Return a facet.
+ *
+ * use_facet looks for and returns a reference to a facet of type Facet
+ * where Facet is the template parameter. If has_facet(locale) is true,
+ * there is a suitable facet to return. It throws std::bad_cast if the
+ * locale doesn't contain a facet of type Facet.
+ *
+ * @param Facet The facet type to access.
+ * @param locale The locale to use.
+ * @return Reference to facet of type Facet.
+ * @throw std::bad_cast if locale doesn't contain a facet of type Facet.
+ */
template<typename _Facet>
inline const _Facet&
use_facet(const locale& __loc)
@@ -143,55 +163,73 @@ namespace std
const __cache_type* __lc = __uc(__loc);
const _CharT* __lit = __lc->_M_atoms_in;
- // First check for sign.
- int __pos = 0;
- char_type __c = *__beg;
- const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
- if ((__plus || __traits_type::eq(__c, __lit[_S_iminus]))
- && __beg != __end)
- {
- __xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus];
- ++__pos;
- __c = *(++__beg);
- }
+ // True if a mantissa is found.
+ bool __found_mantissa = false;
- // Next, strip leading zeros.
- bool __found_zero = false;
- while (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
+ // First check for sign.
+ if (__beg != __end)
{
- __c = *(++__beg);
- __found_zero = true;
+ const char_type __c = *__beg;
+ const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
+ if ((__plus || __traits_type::eq(__c, __lit[_S_iminus]))
+ && !__traits_type::eq(__c, __lc->_M_decimal_point)
+ && (!__lc->_M_use_grouping
+ || !__traits_type::eq(__c, __lc->_M_thousands_sep)))
+ {
+ __xtrc += __plus ? _S_atoms_in[_S_iplus]
+ : _S_atoms_in[_S_iminus];
+ ++__beg;
+ }
}
- if (__found_zero)
+
+ // Next, look for leading zeros.
+ while (__beg != __end)
{
- __xtrc += _S_atoms_in[_S_izero];
- ++__pos;
+ const char_type __c = *__beg;
+ if (__traits_type::eq(__c, __lc->_M_decimal_point)
+ || (__lc->_M_use_grouping
+ && __traits_type::eq(__c, __lc->_M_thousands_sep)))
+ break;
+ else if (__traits_type::eq(__c, __lit[_S_izero]))
+ {
+ if (!__found_mantissa)
+ {
+ __xtrc += _S_atoms_in[_S_izero];
+ __found_mantissa = true;
+ }
+ ++__beg;
+ }
+ else
+ break;
}
// Only need acceptable digits for floating point numbers.
bool __found_dec = false;
bool __found_sci = false;
string __found_grouping;
- const size_t __len = _S_iE - _S_izero + 1;
int __sep_pos = 0;
bool __e;
+ const char_type* __p;
while (__beg != __end)
{
- // Only look in digits.
- const char_type* __p = __traits_type::find(__lit + _S_izero, 10,
- __c);
-
- // NB: strchr returns true for __c == 0x0
- if (__p && !__traits_type::eq(__c, char_type()))
+ // According to 22.2.2.1.2, p8-9, first look for decimal_point
+ // and thousands_sep.
+ const char_type __c = *__beg;
+ if (__traits_type::eq(__c, __lc->_M_decimal_point)
+ && !__found_dec && !__found_sci)
{
- // Try first for acceptable digit; record it if found.
- ++__pos;
- __xtrc += _S_atoms_in[__p - __lit];
- ++__sep_pos;
- __c = *(++__beg);
+ // According to the standard, if no grouping chars are seen,
+ // no grouping check is applied. Therefore __found_grouping
+ // must be adjusted only if __dec comes after some __sep.
+ if (__found_grouping.size())
+ __found_grouping += static_cast<char>(__sep_pos);
+ __xtrc += '.';
+ __found_dec = true;
+ ++__beg;
}
- else if (__traits_type::eq(__c, __lc->_M_thousands_sep)
- && __lc->_M_use_grouping && !__found_dec)
+ else if (__lc->_M_use_grouping
+ && __traits_type::eq(__c, __lc->_M_thousands_sep)
+ && !__found_dec && !__found_sci)
{
// NB: Thousands separator at the beginning of a string
// is a no-no, as is two consecutive thousands separators.
@@ -199,7 +237,7 @@ namespace std
{
__found_grouping += static_cast<char>(__sep_pos);
__sep_pos = 0;
- __c = *(++__beg);
+ ++__beg;
}
else
{
@@ -207,38 +245,32 @@ namespace std
break;
}
}
- else if (__traits_type::eq(__c, __lc->_M_decimal_point)
- && !__found_dec)
+ else if (__p = __traits_type::find(__lit + _S_izero, 10, __c))
{
- // According to the standard, if no grouping chars are seen,
- // no grouping check is applied. Therefore __found_grouping
- // must be adjusted only if __dec comes after some __sep.
- if (__found_grouping.size())
- __found_grouping += static_cast<char>(__sep_pos);
- ++__pos;
- __xtrc += '.';
- __c = *(++__beg);
- __found_dec = true;
+ __xtrc += _S_atoms_in[__p - __lit];
+ __found_mantissa = true;
+ ++__sep_pos;
+ ++__beg;
}
else if ((__e = __traits_type::eq(__c, __lit[_S_ie])
|| __traits_type::eq(__c, __lit[_S_iE]))
- && !__found_sci && __pos)
+ && __found_mantissa && !__found_sci)
{
// Scientific notation.
- ++__pos;
__xtrc += __e ? _S_atoms_in[_S_ie] : _S_atoms_in[_S_iE];
- __c = *(++__beg);
+ __found_sci = true;
// Remove optional plus or minus sign, if they exist.
- const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
- if (__plus || __traits_type::eq(__c, __lit[_S_iminus]))
+ if (++__beg != __end)
{
- ++__pos;
- __xtrc += __plus ? _S_atoms_in[_S_iplus]
- : _S_atoms_in[_S_iminus];
- __c = *(++__beg);
+ const bool __plus = __traits_type::eq(*__beg, __lit[_S_iplus]);
+ if (__plus || __traits_type::eq(*__beg, __lit[_S_iminus]))
+ {
+ __xtrc += __plus ? _S_atoms_in[_S_iplus]
+ : _S_atoms_in[_S_iminus];
+ ++__beg;
+ }
}
- __found_sci = true;
}
else
// Not a valid input item.
@@ -266,141 +298,200 @@ namespace std
}
template<typename _CharT, typename _InIter>
- _InIter
- num_get<_CharT, _InIter>::
- _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
- ios_base::iostate& __err, string& __xtrc, int& __base) const
- {
- typedef char_traits<_CharT> __traits_type;
- typedef typename numpunct<_CharT>::__cache_type __cache_type;
- __use_cache<__cache_type> __uc;
- const locale& __loc = __io._M_getloc();
- const __cache_type* __lc = __uc(__loc);
- const _CharT* __lit = __lc->_M_atoms_in;
-
- // NB: Iff __basefield == 0, this can change based on contents.
- const ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield;
- if (__basefield == ios_base::oct)
- __base = 8;
- else if (__basefield == ios_base::hex)
- __base = 16;
- else
- __base = 10;
-
- // First check for sign.
- char_type __c = *__beg;
- const bool __plus = __traits_type::eq(__c, __lit[_S_iplus]);
- if ((__plus || __traits_type::eq(__c, __lit[_S_iminus]))
- && __beg != __end)
- {
- __xtrc += __plus ? _S_atoms_in[_S_iplus] : _S_atoms_in[_S_iminus];
- __c = *(++__beg);
- }
+ template<typename _ValueT>
+ _InIter
+ num_get<_CharT, _InIter>::
+ _M_extract_int(_InIter __beg, _InIter __end, ios_base& __io,
+ ios_base::iostate& __err, _ValueT& __v) const
+ {
+ typedef char_traits<_CharT> __traits_type;
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ __use_cache<__cache_type> __uc;
+ const locale& __loc = __io._M_getloc();
+ const __cache_type* __lc = __uc(__loc);
+ const _CharT* __lit = __lc->_M_atoms_in;
+
+ // NB: Iff __basefield == 0, __base can change based on contents.
+ const ios_base::fmtflags __basefield = __io.flags() & ios_base::basefield;
+ const bool __oct = __basefield == ios_base::oct;
+ int __base = __oct ? 8 : (__basefield == ios_base::hex ? 16 : 10);
+
+ // True if numeric digits are found.
+ bool __found_num = false;
+
+ // First check for sign.
+ bool __negative = false;
+ if (__beg != __end)
+ {
+ const char_type __c = *__beg;
+ if (numeric_limits<_ValueT>::is_signed)
+ __negative = __traits_type::eq(__c, __lit[_S_iminus]);
+ if ((__negative || __traits_type::eq(__c, __lit[_S_iplus]))
+ && !__traits_type::eq(__c, __lc->_M_decimal_point)
+ && (!__lc->_M_use_grouping
+ || !__traits_type::eq(__c, __lc->_M_thousands_sep)))
+ ++__beg;
+ }
- // Next, strip leading zeros and check required digits for base formats.
- if (__base == 10)
- {
- bool __found_zero = false;
- while (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
- {
- __c = *(++__beg);
- __found_zero = true;
- }
- if (__found_zero)
- {
- __xtrc += _S_atoms_in[_S_izero];
- if (__basefield == 0)
- {
- const bool __x = __traits_type::eq(__c, __lit[_S_ix]);
- if ((__x || __traits_type::eq(__c, __lit[_S_iX]))
- && __beg != __end)
- {
- __xtrc += __x ? _S_atoms_in[_S_ix] : _S_atoms_in[_S_iX];
- __c = *(++__beg);
+ // Next, look for leading zeros and check required digits
+ // for base formats.
+ while (__beg != __end)
+ {
+ const char_type __c = *__beg;
+ if (__traits_type::eq(__c, __lc->_M_decimal_point)
+ || (__lc->_M_use_grouping
+ && __traits_type::eq(__c, __lc->_M_thousands_sep)))
+ break;
+ else if (__traits_type::eq(__c, __lit[_S_izero])
+ && (!__found_num || __base == 10))
+ {
+ __found_num = true;
+ ++__beg;
+ }
+ else if (__found_num)
+ {
+ if (__traits_type::eq(__c, __lit[_S_ix])
+ || __traits_type::eq(__c, __lit[_S_iX]))
+ {
+ if (__basefield == 0)
__base = 16;
- }
- else
- __base = 8;
- }
- }
- }
- else if (__base == 16)
- {
- if (__traits_type::eq(__c, __lit[_S_izero]) && __beg != __end)
- {
- __xtrc += _S_atoms_in[_S_izero];
- __c = *(++__beg);
-
- const bool __x = __traits_type::eq(__c, __lit[_S_ix]);
- if ((__x || __traits_type::eq(__c, __lit[_S_iX]))
- && __beg != __end)
- {
- __xtrc += __x ? _S_atoms_in[_S_ix] : _S_atoms_in[_S_iX];
- __c = *(++__beg);
- }
- }
- }
-
- // At this point, base is determined. If not hex, only allow
- // base digits as valid input.
- const size_t __len = __base == 16 ? _S_iend : __base;
-
- // Extract.
- string __found_grouping;
- const char_type __sep = __lc->_M_thousands_sep;
- int __sep_pos = 0;
- while (__beg != __end)
- {
- const char_type* __p = __traits_type::find(__lit + _S_izero,
- __len, __c);
+ if (__base == 16)
+ {
+ __found_num = false;
+ ++__beg;
+ }
+ }
+ else if (__basefield == 0)
+ __base = 8;
+ break;
+ }
+ else
+ break;
+ }
- // NB: strchr returns true for __c == 0x0
- if (__p && !__traits_type::eq(__c, char_type()))
- {
- // Try first for acceptable digit; record it if found.
- __xtrc += _S_atoms_in[__p - __lit];
- ++__sep_pos;
- __c = *(++__beg);
- }
- else if (__traits_type::eq(__c, __sep) && __lc->_M_use_grouping)
- {
- // NB: Thousands separator at the beginning of a string
- // is a no-no, as is two consecutive thousands separators.
- if (__sep_pos)
- {
- __found_grouping += static_cast<char>(__sep_pos);
- __sep_pos = 0;
- __c = *(++__beg);
- }
- else
- {
- __err |= ios_base::failbit;
+ // At this point, base is determined. If not hex, only allow
+ // base digits as valid input.
+ const size_t __len = __base == 16 ? _S_iend : __base;
+
+ // Extract.
+ string __found_grouping;
+ int __sep_pos = 0;
+ bool __overflow = false;
+ _ValueT __result = 0;
+ const char_type* __lit_zero = __lit + _S_izero;
+ const char_type* __p;
+ if (__negative)
+ {
+ const _ValueT __min = numeric_limits<_ValueT>::min() / __base;
+ for (; __beg != __end; ++__beg)
+ {
+ // According to 22.2.2.1.2, p8-9, first look for decimal_point
+ // and thousands_sep.
+ const char_type __c = *__beg;
+ if (__traits_type::eq(__c, __lc->_M_decimal_point))
break;
- }
- }
- else
- // Not a valid input item.
- break;
- }
+ else if (__lc->_M_use_grouping
+ && __traits_type::eq(__c, __lc->_M_thousands_sep))
+ {
+ // NB: Thousands separator at the beginning of a string
+ // is a no-no, as is two consecutive thousands separators.
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __err |= ios_base::failbit;
+ break;
+ }
+ }
+ else if (__p = __traits_type::find(__lit_zero, __len, __c))
+ {
+ int __digit = __p - __lit_zero;
+ if (__digit > 15)
+ __digit -= 6;
+ if (__result < __min)
+ __overflow = true;
+ else
+ {
+ const _ValueT __new_result = __result * __base - __digit;
+ __overflow |= __new_result > __result;
+ __result = __new_result;
+ ++__sep_pos;
+ __found_num = true;
+ }
+ }
+ else
+ // Not a valid input item.
+ break;
+ }
+ }
+ else
+ {
+ const _ValueT __max = numeric_limits<_ValueT>::max() / __base;
+ for (; __beg != __end; ++__beg)
+ {
+ const char_type __c = *__beg;
+ if (__traits_type::eq(__c, __lc->_M_decimal_point))
+ break;
+ else if (__lc->_M_use_grouping
+ && __traits_type::eq(__c, __lc->_M_thousands_sep))
+ {
+ if (__sep_pos)
+ {
+ __found_grouping += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
+ __err |= ios_base::failbit;
+ break;
+ }
+ }
+ else if (__p = __traits_type::find(__lit_zero, __len, __c))
+ {
+ int __digit = __p - __lit_zero;
+ if (__digit > 15)
+ __digit -= 6;
+ if (__result > __max)
+ __overflow = true;
+ else
+ {
+ const _ValueT __new_result = __result * __base + __digit;
+ __overflow |= __new_result < __result;
+ __result = __new_result;
+ ++__sep_pos;
+ __found_num = true;
+ }
+ }
+ else
+ break;
+ }
+ }
- // Digit grouping is checked. If grouping and found_grouping don't
- // match, then get very very upset, and set failbit.
- if (__lc->_M_use_grouping && __found_grouping.size())
- {
- // Add the ending grouping.
- __found_grouping += static_cast<char>(__sep_pos);
+ // Digit grouping is checked. If grouping and found_grouping don't
+ // match, then get very very upset, and set failbit.
+ if (__lc->_M_use_grouping && __found_grouping.size())
+ {
+ // Add the ending grouping.
+ __found_grouping += static_cast<char>(__sep_pos);
+
+ const string __grouping = __lc->_M_grouping;
+ if (!std::__verify_grouping(__grouping, __found_grouping))
+ __err |= ios_base::failbit;
+ }
- const string __grouping = __lc->_M_grouping;
- if (!std::__verify_grouping(__grouping, __found_grouping))
- __err |= ios_base::failbit;
- }
+ if (!(__err & ios_base::failbit) && !__overflow
+ && __found_num)
+ __v = __result;
+ else
+ __err |= ios_base::failbit;
- // Finish up.
- __xtrc += char();
- if (__beg == __end)
- __err |= ios_base::eofbit;
- return __beg;
- }
+ if (__beg == __end)
+ __err |= ios_base::eofbit;
+ return __beg;
+ }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 17. Bad bool parsing
@@ -412,61 +503,54 @@ namespace std
{
if (!(__io.flags() & ios_base::boolalpha))
{
- // Parse bool values as unsigned long.
+ // Parse bool values as long.
// NB: We can't just call do_get(long) here, as it might
// refer to a derived class.
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
-
- unsigned long __ul;
- std::__convert_to_v(__xtrc.c_str(), __ul, __err,
- _S_get_c_locale(), __base);
- if (!(__err & ios_base::failbit) && __ul <= 1)
- __v = __ul;
- else
+ long __l = -1;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __l);
+ if (__l == 0 || __l == 1)
+ __v = __l;
+ else
__err |= ios_base::failbit;
}
else
{
// Parse bool values as alphanumeric.
- typedef char_traits<_CharT> __traits_type;
- typedef typename numpunct<_CharT>::__cache_type __cache_type;
+ typedef char_traits<_CharT> __traits_type;
+ typedef typename numpunct<_CharT>::__cache_type __cache_type;
__use_cache<__cache_type> __uc;
const locale& __loc = __io._M_getloc();
const __cache_type* __lc = __uc(__loc);
- const size_t __tn = __traits_type::length(__lc->_M_truename) - 1;
- const size_t __fn = __traits_type::length(__lc->_M_falsename) - 1;
+ const size_t __tn = __traits_type::length(__lc->_M_truename);
+ const size_t __fn = __traits_type::length(__lc->_M_falsename);
- bool __testf = false;
- bool __testt = false;
- for (size_t __n = 0; __beg != __end; ++__n)
+ bool __testf = true;
+ bool __testt = true;
+ size_t __n;
+ for (__n = 0; __beg != __end; ++__n, ++__beg)
{
- const char_type __c = *__beg;
- ++__beg;
-
- if (__n <= __fn)
- __testf = __traits_type::eq(__c, __lc->_M_falsename[__n]);
+ if (__testf)
+ if (__n < __fn)
+ __testf = __traits_type::eq(*__beg, __lc->_M_falsename[__n]);
+ else
+ break;
- if (__n <= __tn)
- __testt = __traits_type::eq(__c, __lc->_M_truename[__n]);
+ if (__testt)
+ if (__n < __tn)
+ __testt = __traits_type::eq(*__beg, __lc->_M_truename[__n]);
+ else
+ break;
- if (!(__testf || __testt))
- {
- __err |= ios_base::failbit;
- break;
- }
- else if (__testf && __n == __fn)
- {
- __v = 0;
- break;
- }
- else if (__testt && __n == __tn)
- {
- __v = 1;
- break;
- }
+ if (!__testf && !__testt)
+ break;
}
+ if (__testf && __n == __fn)
+ __v = 0;
+ else if (__testt && __n == __tn)
+ __v = 1;
+ else
+ __err |= ios_base::failbit;
+
if (__beg == __end)
__err |= ios_base::eofbit;
}
@@ -478,68 +562,28 @@ namespace std
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- std::__convert_to_v(__xtrc.c_str(), __v, __err,
- _S_get_c_locale(), __base);
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned short& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- unsigned long __ul;
- std::__convert_to_v(__xtrc.c_str(), __ul, __err,
- _S_get_c_locale(), __base);
- if (!(__err & ios_base::failbit)
- && __ul <= numeric_limits<unsigned short>::max())
- __v = static_cast<unsigned short>(__ul);
- else
- __err |= ios_base::failbit;
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned int& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- unsigned long __ul;
- std::__convert_to_v(__xtrc.c_str(), __ul, __err,
- _S_get_c_locale(), __base);
- if (!(__err & ios_base::failbit)
- && __ul <= numeric_limits<unsigned int>::max())
- __v = static_cast<unsigned int>(__ul);
- else
- __err |= ios_base::failbit;
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- std::__convert_to_v(__xtrc.c_str(), __v, __err,
- _S_get_c_locale(), __base);
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _InIter>
@@ -547,28 +591,14 @@ namespace std
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, long long& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- std::__convert_to_v(__xtrc.c_str(), __v, __err,
- _S_get_c_locale(), __base);
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
template<typename _CharT, typename _InIter>
_InIter
num_get<_CharT, _InIter>::
do_get(iter_type __beg, iter_type __end, ios_base& __io,
ios_base::iostate& __err, unsigned long long& __v) const
- {
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
- std::__convert_to_v(__xtrc.c_str(), __v, __err,
- _S_get_c_locale(), __base);
- return __beg;
- }
+ { return _M_extract_int(__beg, __end, __io, __err, __v); }
#endif
template<typename _CharT, typename _InIter>
@@ -580,8 +610,7 @@ namespace std
string __xtrc;
__xtrc.reserve(32);
__beg = _M_extract_float(__beg, __end, __io, __err, __xtrc);
- std::__convert_to_v(__xtrc.c_str(), __v, __err,
- _S_get_c_locale());
+ std::__convert_to_v(__xtrc.c_str(), __v, __err, _S_get_c_locale());
return __beg;
}
@@ -624,16 +653,12 @@ namespace std
| ios_base::uppercase | ios_base::internal);
__io.flags(__fmt & __fmtmask | (ios_base::hex | ios_base::showbase));
- string __xtrc;
- int __base;
- __beg = _M_extract_int(__beg, __end, __io, __err, __xtrc, __base);
+ unsigned long __ul;
+ __beg = _M_extract_int(__beg, __end, __io, __err, __ul);
// Reset from hex formatted input.
__io.flags(__fmt);
- unsigned long __ul;
- std::__convert_to_v(__xtrc.c_str(), __ul, __err,
- _S_get_c_locale(), __base);
if (!(__err & ios_base::failbit))
__v = reinterpret_cast<void*>(__ul);
else
@@ -767,7 +792,7 @@ namespace std
_M_group_int(const string& __grouping, _CharT __sep, ios_base& __io,
_CharT* __new, _CharT* __cs, int& __len) const
{
- // By itself __add_grouping cannot deal correctly with __ws when
+ // By itself __add_grouping cannot deal correctly with __cs when
// ios::showbase is set and ios_base::oct || ios_base::hex.
// Therefore we take care "by hand" of the initial 0, 0x or 0X.
// However, remember that the latter do not occur if the number
@@ -799,7 +824,7 @@ namespace std
_OutIter
num_put<_CharT, _OutIter>::
_M_insert_int(_OutIter __s, ios_base& __io, _CharT __fill,
- _ValueT __v) const
+ _ValueT __v) const
{
typedef typename numpunct<_CharT>::__cache_type __cache_type;
__use_cache<__cache_type> __uc;
@@ -819,25 +844,23 @@ namespace std
__cs += __ilen - __len;
// Add grouping, if necessary.
- _CharT* __cs2;
if (__lc->_M_use_grouping)
{
// Grouping can add (almost) as many separators as the
// number of digits, but no more.
- __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
- * __len * 2));
+ _CharT* __cs2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len * 2));
_M_group_int(__lc->_M_grouping, __lc->_M_thousands_sep, __io,
__cs2, __cs, __len);
__cs = __cs2;
}
// Pad.
- _CharT* __cs3;
const streamsize __w = __io.width();
if (__w > static_cast<streamsize>(__len))
{
- __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
- * __w));
+ _CharT* __cs3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
_M_pad(__fill, __w, __io, __cs3, __cs, __len);
__cs = __cs3;
}
@@ -970,24 +993,23 @@ namespace std
__ws[__p - __ws] = __dec;
// Add grouping, if necessary.
- _CharT* __ws2;
if (__lc->_M_use_grouping)
{
// Grouping can add (almost) as many separators as the
// number of digits, but no more.
- __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
- * __len * 2));
+ _CharT* __ws2 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __len * 2));
_M_group_float(__lc->_M_grouping, __lc->_M_thousands_sep, __p,
__ws2, __ws, __len);
__ws = __ws2;
}
// Pad.
- _CharT* __ws3;
const streamsize __w = __io.width();
if (__w > static_cast<streamsize>(__len))
{
- __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
+ _CharT* __ws3 = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
_M_pad(__fill, __w, __io, __ws3, __ws, __len);
__ws = __ws3;
}
@@ -1016,16 +1038,15 @@ namespace std
const locale& __loc = __io._M_getloc();
const __cache_type* __lc = __uc(__loc);
- const _CharT* __name;
- __name = __v ? __lc->_M_truename : __lc->_M_falsename;
+ const _CharT* __name = __v ? __lc->_M_truename
+ : __lc->_M_falsename;
int __len = char_traits<_CharT>::length(__name);
- _CharT* __cs;
const streamsize __w = __io.width();
if (__w > static_cast<streamsize>(__len))
{
- __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
- * __w));
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
+ * __w));
_M_pad(__fill, __w, __io, __cs, __name, __len);
__name = __cs;
}
@@ -1086,17 +1107,10 @@ namespace std
const ios_base::fmtflags __fmt = ~(ios_base::showpos | ios_base::basefield
| ios_base::uppercase | ios_base::internal);
__io.flags(__flags & __fmt | (ios_base::hex | ios_base::showbase));
- try
- {
- __s = _M_insert_int(__s, __io, __fill,
- reinterpret_cast<unsigned long>(__v));
- __io.flags(__flags);
- }
- catch (...)
- {
- __io.flags(__flags);
- __throw_exception_again;
- }
+
+ __s = _M_insert_int(__s, __io, __fill,
+ reinterpret_cast<unsigned long>(__v));
+ __io.flags(__flags);
return __s;
}
@@ -1140,10 +1154,10 @@ namespace std
const money_base::pattern __p = __intl ? __mpt.neg_format()
: __mpf.neg_format();
- const string_type __pos_sign =__intl ? __mpt.positive_sign()
- : __mpf.positive_sign();
- const string_type __neg_sign =__intl ? __mpt.negative_sign()
- : __mpf.negative_sign();
+ const string_type __pos_sign = __intl ? __mpt.positive_sign()
+ : __mpf.positive_sign();
+ const string_type __neg_sign = __intl ? __mpt.negative_sign()
+ : __mpf.negative_sign();
const char_type __d = __intl ? __mpt.decimal_point()
: __mpf.decimal_point();
const char_type __sep = __intl ? __mpt.thousands_sep()
@@ -1165,113 +1179,103 @@ namespace std
// The tentative returned string is stored here.
string_type __tmp_units;
- char_type __c = *__beg;
for (int __i = 0; __beg != __end && __i < 4 && __testvalid; ++__i)
{
+ char_type __c;
const part __which = static_cast<part>(__p.field[__i]);
switch (__which)
+ {
+ case money_base::symbol:
+ if (__io.flags() & ios_base::showbase
+ || __i < 2 || __sign.size() > 1
+ || ((static_cast<part>(__p.field[3]) != money_base::none)
+ && __i == 2))
{
- case money_base::symbol:
- if (__io.flags() & ios_base::showbase
- || __i < 2 || __sign.size() > 1
- || ((static_cast<part>(__p.field[3]) != money_base::none)
- && __i == 2))
- {
- // According to 22.2.6.1.2.2, symbol is required
- // if (__io.flags() & ios_base::showbase),
- // otherwise is optional and consumed only if
- // other characters are needed to complete the
- // format.
- const string_type __symbol = __intl ? __mpt.curr_symbol()
- : __mpf.curr_symbol();
- const size_type __len = __symbol.size();
- size_type __j = 0;
- while (__beg != __end
- && __j < __len && __symbol[__j] == __c)
- {
- __c = *(++__beg);
- ++__j;
- }
- // When (__io.flags() & ios_base::showbase)
- // symbol is required.
- if (__j != __len && (__io.flags() & ios_base::showbase))
+ // According to 22.2.6.1.2.2, symbol is required
+ // if (__io.flags() & ios_base::showbase),
+ // otherwise is optional and consumed only if
+ // other characters are needed to complete the
+ // format.
+ const string_type __symbol = __intl ? __mpt.curr_symbol()
+ : __mpf.curr_symbol();
+ const size_type __len = __symbol.size();
+ size_type __j = 0;
+ for (; __beg != __end && __j < __len
+ && *__beg == __symbol[__j]; ++__beg, ++__j);
+ // When (__io.flags() & ios_base::showbase)
+ // symbol is required.
+ if (__j != __len && (__io.flags() & ios_base::showbase))
+ __testvalid = false;
+ }
+ break;
+ case money_base::sign:
+ // Sign might not exist, or be more than one character long.
+ if (__pos_sign.size() && *__beg == __pos_sign[0])
+ {
+ __sign = __pos_sign;
+ ++__beg;
+ }
+ else if (__neg_sign.size() && *__beg == __neg_sign[0])
+ {
+ __sign = __neg_sign;
+ ++__beg;
+ }
+ else if (__pos_sign.size() && __neg_sign.size())
+ {
+ // Sign is mandatory.
+ __testvalid = false;
+ }
+ break;
+ case money_base::value:
+ // Extract digits, remove and stash away the
+ // grouping of found thousands separators.
+ for (; __beg != __end; ++__beg)
+ if (__ctype.is(ctype_base::digit, __c = *__beg))
+ {
+ __tmp_units += __c;
+ ++__sep_pos;
+ }
+ else if (__c == __d && !__testdecfound)
+ {
+ __grouping_tmp += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ __testdecfound = true;
+ }
+ else if (__c == __sep)
+ {
+ if (__grouping.size())
+ {
+ // Mark position for later analysis.
+ __grouping_tmp += static_cast<char>(__sep_pos);
+ __sep_pos = 0;
+ }
+ else
+ {
__testvalid = false;
- }
- break;
- case money_base::sign:
- // Sign might not exist, or be more than one character long.
- if (__pos_sign.size() && __c == __pos_sign[0])
- {
- __sign = __pos_sign;
- __c = *(++__beg);
- }
- else if (__neg_sign.size() && __c == __neg_sign[0])
- {
- __sign = __neg_sign;
- __c = *(++__beg);
- }
- else if (__pos_sign.size() && __neg_sign.size())
- {
- // Sign is mandatory.
- __testvalid = false;
- }
- break;
- case money_base::value:
- // Extract digits, remove and stash away the
- // grouping of found thousands separators.
- while (__beg != __end
- && (__ctype.is(ctype_base::digit, __c)
- || (__c == __d && !__testdecfound)
- || __c == __sep))
- {
- if (__c == __d)
- {
- __grouping_tmp += static_cast<char>(__sep_pos);
- __sep_pos = 0;
- __testdecfound = true;
- }
- else if (__c == __sep)
- {
- if (__grouping.size())
- {
- // Mark position for later analysis.
- __grouping_tmp += static_cast<char>(__sep_pos);
- __sep_pos = 0;
- }
- else
- {
- __testvalid = false;
- break;
- }
- }
- else
- {
- __tmp_units += __c;
- ++__sep_pos;
- }
- __c = *(++__beg);
- }
- break;
- case money_base::space:
- case money_base::none:
- // Only if not at the end of the pattern.
- if (__i != 3)
- while (__beg != __end
- && __ctype.is(ctype_base::space, __c))
- __c = *(++__beg);
+ break;
+ }
+ }
+ else
break;
- }
+ break;
+ case money_base::space:
+ case money_base::none:
+ // Only if not at the end of the pattern.
+ if (__i != 3)
+ for (; __beg != __end
+ && __ctype.is(ctype_base::space, *__beg); ++__beg);
+ break;
+ }
}
-
+
// Need to get the rest of the sign characters, if they exist.
- const char_type __eof = static_cast<char_type>(char_traits<char_type>::eof());
if (__sign.size() > 1)
{
const size_type __len = __sign.size();
size_type __i = 1;
- for (; __c != __eof && __i < __len; ++__i)
- while (__beg != __end && __c != __sign[__i])
- __c = *(++__beg);
+ for (; __beg != __end && __i < __len; ++__i)
+ for (; __beg != __end
+ && *__beg != __sign[__i]; ++__beg);
if (__i != __len)
__testvalid = false;
@@ -1316,7 +1320,7 @@ namespace std
__testvalid = false;
// Iff no more characters are available.
- if (__c == __eof)
+ if (__beg == __end)
__err |= ios_base::eofbit;
// Iff valid sequence is not recognized.
@@ -1341,22 +1345,23 @@ namespace std
// First try a buffer perhaps big enough.
int __cs_size = 64;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
- int __len = std::__convert_from_v(__cs, __cs_size, "%.01Lf", __units,
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 328. Bad sprintf format modifier in money_put<>::do_put()
+ int __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units,
_S_get_c_locale());
// If the buffer was not large enough, try again with the correct size.
if (__len >= __cs_size)
{
__cs_size = __len + 1;
__cs = static_cast<char*>(__builtin_alloca(__cs_size));
- __len = std::__convert_from_v(__cs, __cs_size, "%.01Lf", __units,
+ __len = std::__convert_from_v(__cs, __cs_size, "%.0Lf", __units,
_S_get_c_locale());
}
#else
- // max_exponent10 + 1 for the integer part, + 4 for sign, decimal point,
- // decimal digit, '\0'.
- const int __cs_size = numeric_limits<long double>::max_exponent10 + 5;
+ // max_exponent10 + 1 for the integer part, + 2 for sign and '\0'.
+ const int __cs_size = numeric_limits<long double>::max_exponent10 + 3;
char* __cs = static_cast<char*>(__builtin_alloca(__cs_size));
- int __len = std::__convert_from_v(__cs, 0, "%.01Lf", __units,
+ int __len = std::__convert_from_v(__cs, 0, "%.0Lf", __units,
_S_get_c_locale());
#endif
_CharT* __ws = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
@@ -1546,24 +1551,19 @@ namespace std
const _CharT* __format) const
{
const locale __loc = __io.getloc();
- __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const size_t __len = char_traits<_CharT>::length(__format);
for (size_t __i = 0; __beg != __end && __i < __len && !__err; ++__i)
{
- char __c = __format[__i];
- if (__c == '%')
+ if (__ctype.narrow(__format[__i], 0) == '%')
{
// Verify valid formatting code, attempt to extract.
- __c = __format[++__i];
- char __mod = 0;
+ char __c = __ctype.narrow(__format[++__i], 0);
int __mem = 0;
if (__c == 'E' || __c == 'O')
- {
- __mod = __c;
- __c = __format[++__i];
- }
+ __c = __ctype.narrow(__format[++__i], 0);
switch (__c)
{
const char* __cs;
@@ -1573,14 +1573,14 @@ namespace std
const char_type* __days1[7];
__tp._M_days_abbreviated(__days1);
_M_extract_name(__beg, __end, __tm->tm_wday, __days1, 7,
- __err);
+ __ctype, __err);
break;
case 'A':
// Weekday name [tm_wday].
const char_type* __days2[7];
__tp._M_days(__days2);
_M_extract_name(__beg, __end, __tm->tm_wday, __days2, 7,
- __err);
+ __ctype, __err);
break;
case 'h':
case 'b':
@@ -1588,14 +1588,14 @@ namespace std
const char_type* __months1[12];
__tp._M_months_abbreviated(__months1);
_M_extract_name(__beg, __end, __tm->tm_mon, __months1, 12,
- __err);
+ __ctype, __err);
break;
case 'B':
// Month name [tm_mon].
const char_type* __months2[12];
__tp._M_months(__months2);
_M_extract_name(__beg, __end, __tm->tm_mon, __months2, 12,
- __err);
+ __ctype, __err);
break;
case 'c':
// Default time and date representation.
@@ -1609,6 +1609,16 @@ namespace std
_M_extract_num(__beg, __end, __tm->tm_mday, 1, 31, 2,
__ctype, __err);
break;
+ case 'e':
+ // Day [1, 31], with single digits preceded by
+ // space. [tm_mday]
+ if (__ctype.is(ctype_base::space, *__beg))
+ _M_extract_num(++__beg, __end, __tm->tm_mday, 1, 9, 1,
+ __ctype, __err);
+ else
+ _M_extract_num(__beg, __end, __tm->tm_mday, 10, 31, 2,
+ __ctype, __err);
+ break;
case 'D':
// Equivalent to %m/%d/%y.[tm_mon, tm_mday, tm_year]
__cs = "%m/%d/%y";
@@ -1660,7 +1670,7 @@ namespace std
if (__ctype.narrow(*__beg, 0) == '\t')
++__beg;
else
- __err |= ios_base::failbit;
+ __err |= ios_base::failbit;
break;
case 'T':
// Equivalent to (%H:%M:%S).
@@ -1691,8 +1701,7 @@ namespace std
break;
case 'Y':
// Year [1900). [tm_year]
- _M_extract_num(__beg, __end, __mem, 0,
- numeric_limits<int>::max(), 4,
+ _M_extract_num(__beg, __end, __mem, 0, 9999, 4,
__ctype, __err);
if (!__err)
__tm->tm_year = __mem - 1900;
@@ -1704,13 +1713,12 @@ namespace std
int __tmp;
_M_extract_name(__beg, __end, __tmp,
__timepunct_cache<_CharT>::_S_timezones,
- 14, __err);
+ 14, __ctype, __err);
// GMT requires special effort.
- char_type __c = *__beg;
- if (!__err && __tmp == 0
- && (__c == __ctype.widen('-')
- || __c == __ctype.widen('+')))
+ if (__beg != __end && !__err && __tmp == 0
+ && (*__beg == __ctype.widen('-')
+ || *__beg == __ctype.widen('+')))
{
_M_extract_num(__beg, __end, __tmp, 0, 23, 2,
__ctype, __err);
@@ -1729,7 +1737,7 @@ namespace std
else
{
// Verify format and input match, extract and discard.
- if (__c == __ctype.narrow(*__beg, 0))
+ if (__format[__i] == *__beg)
++__beg;
else
__err |= ios_base::failbit;
@@ -1745,28 +1753,29 @@ namespace std
const ctype<_CharT>& __ctype,
ios_base::iostate& __err) const
{
+ // As-is works for __len = 1, 2, 4, the values actually used.
+ int __mult = __len == 2 ? 10 : (__len == 4 ? 1000 : 1);
+
+ ++__min;
size_t __i = 0;
- string __digits;
- bool __testvalid = true;
- char_type __c = *__beg;
- while (__beg != __end && __i < __len
- && __ctype.is(ctype_base::digit, __c))
+ int __value = 0;
+ for (; __beg != __end && __i < __len; ++__beg, ++__i)
{
- __digits += __ctype.narrow(__c, 0);
- __c = *(++__beg);
- ++__i;
- }
- if (__i == __len)
- {
- const int __value = std::atoi(__digits.c_str());
- if (__min <= __value && __value <= __max)
- __member = __value;
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ {
+ __value = __value * 10 + (__c - '0');
+ const int __valuec = __value * __mult;
+ if (__valuec > __max || __valuec + __mult < __min)
+ break;
+ __mult /= 10;
+ }
else
- __testvalid = false;
+ break;
}
+ if (__i == __len)
+ __member = __value;
else
- __testvalid = false;
- if (!__testvalid)
__err |= ios_base::failbit;
}
@@ -1777,6 +1786,7 @@ namespace std
time_get<_CharT, _InIter>::
_M_extract_name(iter_type& __beg, iter_type& __end, int& __member,
const _CharT** __names, size_t __indexlen,
+ const ctype<_CharT>& __ctype,
ios_base::iostate& __err) const
{
typedef char_traits<_CharT> __traits_type;
@@ -1787,11 +1797,18 @@ namespace std
bool __testvalid = true;
const char_type* __name;
- char_type __c = *__beg;
- // Look for initial matches.
- for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
- if (__c == __names[__i1][0])
- __matches[__nmatches++] = __i1;
+ // Look for initial matches.
+ // NB: Some of the locale data is in the form of all lowercase
+ // names, and some is in the form of initially-capitalized
+ // names. Look for both.
+ if (__beg != __end)
+ {
+ const char_type __c = *__beg;
+ for (size_t __i1 = 0; __i1 < __indexlen; ++__i1)
+ if (__c == __names[__i1][0]
+ || __c == __ctype.toupper(__names[__i1][0]))
+ __matches[__nmatches++] = __i1;
+ }
while (__nmatches > 1)
{
@@ -1800,15 +1817,14 @@ namespace std
for (size_t __i2 = 0; __i2 < __nmatches; ++__i2)
__minlen = std::min(__minlen,
__traits_type::length(__names[__matches[__i2]]));
-
+ ++__beg;
if (__pos < __minlen && __beg != __end)
{
++__pos;
- __c = *(++__beg);
for (size_t __i3 = 0; __i3 < __nmatches; ++__i3)
{
__name = __names[__matches[__i3]];
- if (__name[__pos] != __c)
+ if (__name[__pos] != *__beg)
__matches[__i3] = __matches[--__nmatches];
}
}
@@ -1818,6 +1834,13 @@ namespace std
if (__nmatches == 1)
{
+ // If there was only one match, the first compare is redundant.
+ if (__pos == 0)
+ {
+ ++__pos;
+ ++__beg;
+ }
+
// Make sure found name is completely extracted.
__name = __names[__matches[0]];
const size_t __len = __traits_type::length(__name);
@@ -1877,11 +1900,12 @@ namespace std
{
typedef char_traits<_CharT> __traits_type;
const locale __loc = __io.getloc();
- __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const char_type* __days[7];
__tp._M_days_abbreviated(__days);
int __tmpwday;
- _M_extract_name(__beg, __end, __tmpwday, __days, 7, __err);
+ _M_extract_name(__beg, __end, __tmpwday, __days, 7, __ctype, __err);
// Check to see if non-abbreviated name exists, and extract.
// NB: Assumes both _M_days and _M_days_abbreviated organized in
@@ -1920,11 +1944,12 @@ namespace std
{
typedef char_traits<_CharT> __traits_type;
const locale __loc = __io.getloc();
- __timepunct<_CharT> const& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const __timepunct<_CharT>& __tp = use_facet<__timepunct<_CharT> >(__loc);
+ const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
const char_type* __months[12];
__tp._M_months_abbreviated(__months);
int __tmpmon;
- _M_extract_name(__beg, __end, __tmpmon, __months, 12, __err);
+ _M_extract_name(__beg, __end, __tmpmon, __months, 12, __ctype, __err);
// Check to see if non-abbreviated name exists, and extract.
// NB: Assumes both _M_months and _M_months_abbreviated organized in
@@ -1965,26 +1990,18 @@ namespace std
const locale __loc = __io.getloc();
const ctype<_CharT>& __ctype = use_facet<ctype<_CharT> >(__loc);
- char_type __c = *__beg;
size_t __i = 0;
- string __digits;
- while (__i < 4 && __beg != __end && __ctype.is(ctype_base::digit, __c))
+ int __value = 0;
+ for (; __beg != __end && __i < 4; ++__beg, ++__i)
{
- __digits += __ctype.narrow(__c, 0);
- __c = *(++__beg);
- ++__i;
+ const char __c = __ctype.narrow(*__beg, '*');
+ if (__c >= '0' && __c <= '9')
+ __value = __value * 10 + (__c - '0');
+ else
+ break;
}
if (__i == 2 || __i == 4)
- {
- long __l;
- std::__convert_to_v(__digits.c_str(), __l, __err,
- _S_get_c_locale());
- if (!(__err & ios_base::failbit) && __l <= INT_MAX)
- {
- __l = __i == 2 ? __l : __l - 1900;
- __tm->tm_year = static_cast<int>(__l);
- }
- }
+ __tm->tm_year = __i == 2 ? __value : __value - 1900;
else
__err |= ios_base::failbit;
if (__beg == __end)
@@ -2000,32 +2017,31 @@ namespace std
{
const locale __loc = __io.getloc();
ctype<_CharT> const& __ctype = use_facet<ctype<_CharT> >(__loc);
- while (__beg != __end)
- {
- const _CharT __tmp = *__beg;
- ++__beg;
- if (__ctype.narrow(__tmp, 0) == '%' && __beg != __end)
- {
- char __format;
- char __mod = 0;
- const char __c = __ctype.narrow(*__beg, 0);
- ++__beg;
- if (__c == 'E' || __c == 'O')
- {
- __mod = __c;
- __format = __ctype.narrow(*__beg, 0);
- ++__beg;
- }
- else
- __format = __c;
- __s = this->do_put(__s, __io, __fill, __tm, __format, __mod);
- }
- else
- {
- *__s = __tmp;
- ++__s;
- }
- }
+ for (; __beg != __end; ++__beg)
+ if (__ctype.narrow(*__beg, 0) != '%')
+ {
+ *__s = *__beg;
+ ++__s;
+ }
+ else if (++__beg != __end)
+ {
+ char __format;
+ char __mod = 0;
+ const char __c = __ctype.narrow(*__beg, 0);
+ if (__c != 'E' && __c != 'O')
+ __format = __c;
+ else if (++__beg != __end)
+ {
+ __mod = __c;
+ __format = __ctype.narrow(*__beg, 0);
+ }
+ else
+ break;
+ __s = this->do_put(__s, __io, __fill, __tm,
+ __format, __mod);
+ }
+ else
+ break;
return __s;
}
@@ -2042,7 +2058,8 @@ namespace std
// NB: This size is arbitrary. Should this be a data member,
// initialized at construction?
const size_t __maxlen = 64;
- char_type* __res = static_cast<char_type*>(__builtin_alloca(sizeof(char_type) * __maxlen));
+ char_type* __res = static_cast<char_type*>(__builtin_alloca(sizeof(char_type)
+ * __maxlen));
// NB: In IEE 1003.1-200x, and perhaps other locale models, it
// is possible that the format character will be longer than one
@@ -2121,7 +2138,7 @@ namespace std
}
}
- template<typename _CharT>
+ template<typename _CharT>
typename collate<_CharT>::string_type
collate<_CharT>::
do_transform(const _CharT* __lo, const _CharT* __hi) const
@@ -2165,7 +2182,7 @@ namespace std
}
}
- template<typename _CharT>
+ template<typename _CharT>
long
collate<_CharT>::
do_hash(const _CharT* __lo, const _CharT* __hi) const
@@ -2245,24 +2262,23 @@ namespace std
template<typename _CharT>
bool
__verify_grouping(const basic_string<_CharT>& __grouping,
- basic_string<_CharT>& __grouping_tmp)
- {
- size_t __i = 0;
- size_t __j = 0;
- const size_t __len = __grouping.size();
- const size_t __n = __grouping_tmp.size();
+ const basic_string<_CharT>& __grouping_tmp)
+ {
+ const size_t __n = __grouping_tmp.size() - 1;
+ const size_t __min = std::min(__n, __grouping.size() - 1);
+ size_t __i = __n;
bool __test = true;
-
+
// Parsed number groupings have to match the
// numpunct::grouping string exactly, starting at the
// right-most point of the parsed sequence of elements ...
- while (__test && __i < __n - 1)
- for (__j = 0; __test && __j < __len && __i < __n - 1; ++__j, ++__i)
- __test = __grouping[__j] == __grouping_tmp[__n - __i - 1];
+ for (size_t __j = 0; __j < __min && __test; --__i, ++__j)
+ __test = __grouping_tmp[__i] == __grouping[__j];
+ for (; __i && __test; --__i)
+ __test = __grouping_tmp[__i] == __grouping[__min];
// ... but the last parsed grouping can be <= numpunct
// grouping.
- __j == __len ? __j = 0 : __j;
- __test &= __grouping[__j] >= __grouping_tmp[__n - __i - 1];
+ __test &= __grouping_tmp[0] <= __grouping[__min];
return __test;
}
@@ -2273,13 +2289,13 @@ namespace std
const _CharT* __first, const _CharT* __last)
{
if (__last - __first > *__gbeg)
- {
+ {
const bool __bump = __gbeg + 1 != __gend;
- __s = std::__add_grouping(__s, __sep, __gbeg + __bump,
+ __s = std::__add_grouping(__s, __sep, __gbeg + __bump,
__gend, __first, __last - *__gbeg);
- __first = __last - *__gbeg;
- *__s++ = __sep;
- }
+ __first = __last - *__gbeg;
+ *__s++ = __sep;
+ }
do
*__s++ = *__first++;
while (__first != __last);
diff --git a/libstdc++-v3/include/bits/ostream.tcc b/libstdc++-v3/include/bits/ostream.tcc
index df63364522b..c8f7fc73c35 100644
--- a/libstdc++-v3/include/bits/ostream.tcc
+++ b/libstdc++-v3/include/bits/ostream.tcc
@@ -43,7 +43,7 @@ namespace std
{
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>::sentry::
- sentry(basic_ostream<_CharT,_Traits>& __os)
+ sentry(basic_ostream<_CharT, _Traits>& __os)
: _M_os(__os)
{
// XXX MT
@@ -64,21 +64,10 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(__ostream_type& (*__pf)(__ostream_type&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- return *this;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ return __pf(*this);
}
template<typename _CharT, typename _Traits>
@@ -86,20 +75,10 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(__ios_type& (*__pf)(__ios_type&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
return *this;
}
@@ -108,81 +87,45 @@ namespace std
basic_ostream<_CharT, _Traits>::
operator<<(ios_base& (*__pf)(ios_base&))
{
- sentry __cerb(*this);
- if (__cerb)
- {
- try
- { __pf(*this); }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- 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<<(__streambuf_type* __sbin)
- {
- sentry __cerb(*this);
- if (__cerb && __sbin)
- {
- try
- {
- if (!__copy_streambufs(*this, __sbin, this->rdbuf()))
- this->setstate(ios_base::failbit);
- }
- catch(...)
- {
- // 27.6.2.5.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
- }
- else if (!__sbin)
- this->setstate(ios_base::badbit);
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // The inserters for manipulators are *not* formatted output functions.
+ __pf(*this);
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(bool __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(bool __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
bool __b = false;
@@ -197,41 +140,35 @@ namespace std
else
__b = __np.put(*this, *this, __c, __n).failed();
if (__b)
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(unsigned long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(unsigned long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -239,11 +176,13 @@ namespace std
#ifdef _GLIBCXX_USE_LONG_LONG
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
bool __b = false;
@@ -259,41 +198,35 @@ namespace std
else
__b = __np.put(*this, *this, __c, __n).failed();
if (__b)
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(unsigned long long __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(unsigned long long __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
@@ -301,160 +234,236 @@ namespace std
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(double __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(double __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(long double __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(long double __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::operator<<(const void* __n)
+ basic_ostream<_CharT, _Traits>::
+ operator<<(const void* __n)
{
sentry __cerb(*this);
if (__cerb)
{
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
try
{
const __num_put_type& __np = __check_facet(this->_M_num_put);
if (__np.put(*this, *this, this->fill(), __n).failed())
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
+ }
+ return *this;
+ }
+
+ template<typename _CharT, typename _Traits>
+ basic_ostream<_CharT, _Traits>&
+ basic_ostream<_CharT, _Traits>::
+ operator<<(__streambuf_type* __sbin)
+ {
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ sentry __cerb(*this);
+ if (__cerb && __sbin)
+ {
+ try
{
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- this->_M_setstate(ios_base::badbit);
- if ((this->exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
+ if (!__copy_streambufs(__sbin, this->rdbuf()))
+ __err |= ios_base::failbit;
}
+ catch(...)
+ { this->_M_setstate(ios_base::failbit); }
}
+ else if (!__sbin)
+ __err |= ios_base::badbit;
+ if (__err)
+ this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::put(char_type __c)
+ basic_ostream<_CharT, _Traits>::
+ put(char_type __c)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::put(char_type) is an unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
sentry __cerb(*this);
if (__cerb)
{
- int_type __put = this->rdbuf()->sputc(__c);
- if (traits_type::eq_int_type(__put, traits_type::eof()))
- this->setstate(ios_base::badbit);
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
+ {
+ int_type __put = this->rdbuf()->sputc(__c);
+ if (traits_type::eq_int_type(__put, traits_type::eof()))
+ __err |= ios_base::badbit;
+ }
+ catch (...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
}
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::write(const _CharT* __s, streamsize __n)
+ basic_ostream<_CharT, _Traits>::
+ write(const _CharT* __s, streamsize __n)
{
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::write(const char_type*, streamsize) is an
+ // unformatted output function.
+ // DR 63. Exception-handling policy for unformatted output.
+ // Unformatted output functions should catch exceptions thrown
+ // from streambuf members.
sentry __cerb(*this);
if (__cerb)
- _M_write(__s, __n);
+ {
+ try
+ { _M_write(__s, __n); }
+ catch (...)
+ { this->_M_setstate(ios_base::badbit); }
+ }
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::flush()
+ basic_ostream<_CharT, _Traits>::
+ flush()
{
- sentry __cerb(*this);
- if (__cerb)
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // DR 60. What is a formatted input function?
+ // basic_ostream::flush() is *not* an unformatted output function.
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
if (this->rdbuf() && this->rdbuf()->pubsync() == -1)
- this->setstate(ios_base::badbit);
+ __err |= ios_base::badbit;
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
typename basic_ostream<_CharT, _Traits>::pos_type
- basic_ostream<_CharT, _Traits>::tellp()
+ basic_ostream<_CharT, _Traits>::
+ tellp()
{
pos_type __ret = pos_type(-1);
- if (!this->fail())
- __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ try
+ {
+ if (!this->fail())
+ __ret = this->rdbuf()->pubseekoff(0, ios_base::cur, ios_base::out);
+ }
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
return __ret;
}
-
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
- basic_ostream<_CharT, _Traits>::seekp(pos_type __pos)
+ basic_ostream<_CharT, _Traits>::
+ seekp(pos_type __pos)
{
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 136. seekp, seekg setting wrong streams?
- 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(ios_base::failbit);
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekpos(__pos, ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
template<typename _CharT, typename _Traits>
basic_ostream<_CharT, _Traits>&
basic_ostream<_CharT, _Traits>::
- seekp(off_type __off, ios_base::seekdir __d)
+ seekp(off_type __off, ios_base::seekdir __dir)
{
- if (!this->fail())
+ ios_base::iostate __err = ios_base::iostate(ios_base::goodbit);
+ try
{
- // _GLIBCXX_RESOLVE_LIB_DEFECTS
- // 136. seekp, seekg setting wrong streams?
- 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(ios_base::failbit);
+ if (!this->fail())
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 136. seekp, seekg setting wrong streams?
+ pos_type __p = this->rdbuf()->pubseekoff(__off, __dir,
+ ios_base::out);
+
+ // 129. Need error indication from seekp() and seekg()
+ if (__p == pos_type(off_type(-1)))
+ __err |= ios_base::failbit;
+ }
}
+ catch(...)
+ { this->_M_setstate(ios_base::badbit); }
+ if (__err)
+ this->setstate(__err);
return *this;
}
@@ -484,13 +493,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
return __out;
}
@@ -520,13 +523,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
return __out;
}
@@ -556,13 +553,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -605,13 +596,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -643,13 +628,7 @@ namespace std
__out.width(0);
}
catch(...)
- {
- // 27.6.1.2.1 Common requirements.
- // Turn this on without causing an ios::failure to be thrown.
- __out._M_setstate(ios_base::badbit);
- if ((__out.exceptions() & ios_base::badbit) != 0)
- __throw_exception_again;
- }
+ { __out._M_setstate(ios_base::badbit); }
}
else if (!__s)
__out.setstate(ios_base::badbit);
@@ -669,12 +648,12 @@ namespace std
const streamsize __w = __out.width();
streamsize __len = static_cast<streamsize>(__str.size());
const _CharT* __s = __str.data();
+
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 25. String operator<< uses width() value wrong
if (__w > __len)
{
- _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT)
- * __w));
+ _CharT* __cs = static_cast<_CharT*>(__builtin_alloca(sizeof(_CharT) * __w));
__pad<_CharT, _Traits>::_S_pad(__out, __out.fill(), __cs, __s,
__w, __len, false);
__s = __cs;
diff --git a/libstdc++-v3/include/bits/postypes.h b/libstdc++-v3/include/bits/postypes.h
index 935ba7c66f7..c9b46b1d171 100644
--- a/libstdc++-v3/include/bits/postypes.h
+++ b/libstdc++-v3/include/bits/postypes.h
@@ -146,8 +146,8 @@ namespace std
private:
friend class streamoff;
- __streamoff_base_type _M_off;
- _StateT _M_state;
+ __streamoff_base_type _M_off;
+ _StateT _M_state;
public:
// The standard doesn't require that fpos objects can be default
diff --git a/libstdc++-v3/include/bits/sstream.tcc b/libstdc++-v3/include/bits/sstream.tcc
index dfa1d6810bd..07e13926ba9 100644
--- a/libstdc++-v3/include/bits/sstream.tcc
+++ b/libstdc++-v3/include/bits/sstream.tcc
@@ -79,8 +79,7 @@ namespace std
if (__builtin_expect(!__testout, false))
return traits_type::eof();
- const bool __testeof = traits_type::eq_int_type(__c,
- traits_type::eof());
+ const bool __testeof = traits_type::eq_int_type(__c, traits_type::eof());
if (__builtin_expect(__testeof, false))
return traits_type::not_eof(__c);
@@ -106,8 +105,7 @@ namespace std
__tmp.assign(_M_string.data(), this->epptr() - this->pbase());
_M_string.swap(__tmp);
_M_sync(const_cast<char_type*>(_M_string.data()),
- this->gptr() - this->eback(),
- this->pptr() - this->pbase());
+ this->gptr() - this->eback(), this->pptr() - this->pbase());
}
return this->sputc(traits_type::to_char_type(__c));
}
@@ -123,7 +121,6 @@ namespace std
{
// Update egptr() to match the actual string end.
_M_update_egptr();
-
if (this->gptr() < this->egptr())
__ret = traits_type::to_int_type(*this->gptr());
}
@@ -181,8 +178,7 @@ namespace std
basic_stringbuf<_CharT, _Traits, _Alloc>::
seekpos(pos_type __sp, ios_base::openmode __mode)
{
- pos_type __ret = pos_type(off_type(-1));
-
+ pos_type __ret = pos_type(off_type(-1));
if (_M_string.capacity())
{
off_type __pos (__sp);
diff --git a/libstdc++-v3/include/bits/stl_algo.h b/libstdc++-v3/include/bits/stl_algo.h
index 70ef2199536..ea23fa7845d 100644
--- a/libstdc++-v3/include/bits/stl_algo.h
+++ b/libstdc++-v3/include/bits/stl_algo.h
@@ -63,12 +63,12 @@
#include <bits/stl_heap.h>
#include <bits/stl_tempbuf.h> // for _Temporary_buffer
+#include <debug/debug.h>
// See concept_check.h for the __glibcxx_*_requires macros.
namespace std
{
-
/**
* @brief Find the median of three values.
* @param a A value.
@@ -153,6 +153,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
__f(*__first);
return __f;
@@ -295,6 +296,7 @@ namespace std
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
return std::find(__first, __last, __val, std::__iterator_category(__first));
}
@@ -315,6 +317,7 @@ namespace std
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
return std::find_if(__first, __last, __pred, std::__iterator_category(__first));
}
@@ -334,6 +337,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return __last;
_ForwardIterator __next = __first;
@@ -365,6 +369,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return __last;
_ForwardIterator __next = __first;
@@ -393,6 +398,7 @@ namespace std
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIterator>::value_type >)
__glibcxx_function_requires(_EqualityComparableConcept<_Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
typename iterator_traits<_InputIterator>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (*__first == __value)
@@ -416,6 +422,7 @@ namespace std
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
typename iterator_traits<_InputIterator>::difference_type __n = 0;
for ( ; __first != __last; ++__first)
if (__pred(*__first))
@@ -458,7 +465,8 @@ namespace std
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIterator1>::value_type,
typename iterator_traits<_ForwardIterator2>::value_type>)
-
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
return __first1;
@@ -531,6 +539,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIterator1>::value_type,
typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
// Test for empty ranges
if (__first1 == __last1 || __first2 == __last2)
@@ -603,6 +613,7 @@ namespace std
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_function_requires(_EqualityComparableConcept<_Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__count <= 0)
return __first;
@@ -651,6 +662,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__count <= 0)
return __first;
@@ -708,6 +720,7 @@ namespace std
__glibcxx_function_requires(_ConvertibleConcept<
typename iterator_traits<_ForwardIterator2>::value_type,
typename iterator_traits<_ForwardIterator1>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2)
std::iter_swap(__first1, __first2);
@@ -739,6 +752,7 @@ namespace std
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _UnaryOperation"
__typeof__(__unary_op(*__first))>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first, ++__result)
*__result = __unary_op(*__first);
@@ -775,6 +789,7 @@ namespace std
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
// "the type returned by a _BinaryOperation"
__typeof__(__binary_op(*__first1,*__first2))>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2, ++__result)
*__result = __binary_op(*__first1, *__first2);
@@ -804,6 +819,7 @@ namespace std
typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
__glibcxx_function_requires(_ConvertibleConcept<_Tp,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
if (*__first == __old_value)
@@ -833,6 +849,7 @@ namespace std
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
if (__pred(*__first))
@@ -865,6 +882,7 @@ namespace std
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first, ++__result)
*__result = *__first == __old_value ? __new_value : *__first;
@@ -898,6 +916,7 @@ namespace std
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first, ++__result)
*__result = __pred(*__first) ? __new_value : *__first;
@@ -923,6 +942,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_GeneratorConcept<_Generator,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
*__first = __gen();
@@ -977,6 +997,7 @@ namespace std
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
if (!(*__first == __value)) {
@@ -1011,6 +1032,7 @@ namespace std
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
if (!__pred(*__first)) {
@@ -1047,6 +1069,7 @@ namespace std
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
__first = std::find(__first, __last, __value);
_ForwardIterator __i = __first;
@@ -1079,6 +1102,7 @@ namespace std
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
__first = std::find_if(__first, __last, __pred);
_ForwardIterator __i = __first;
@@ -1207,6 +1231,7 @@ namespace std
typename iterator_traits<_InputIterator>::value_type>)
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
typedef typename iterator_traits<_OutputIterator>::iterator_category _IterType;
@@ -1239,6 +1264,7 @@ namespace std
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
typedef typename iterator_traits<_OutputIterator>::iterator_category _IterType;
@@ -1266,7 +1292,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_EqualityComparableConcept<
- typename iterator_traits<_ForwardIterator>::value_type>)
+ typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
// Skip the beginning, if already unique.
__first = std::adjacent_find(__first, __last);
@@ -1306,6 +1333,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
// Skip the beginning, if already unique.
__first = std::adjacent_find(__first, __last, __binary_pred);
@@ -1371,7 +1399,8 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
- _BidirectionalIterator>)
+ _BidirectionalIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
std::__reverse(__first, __last, std::__iterator_category(__first));
}
@@ -1399,6 +1428,7 @@ namespace std
__glibcxx_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
while (__first != __last) {
--__last;
@@ -1583,6 +1613,8 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
typedef typename iterator_traits<_ForwardIterator>::iterator_category _IterType;
std::__rotate(__first, __middle, __last, _IterType());
@@ -1614,32 +1646,12 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
return std::copy(__first, __middle, copy(__middle, __last, __result));
}
-
- /**
- * @if maint
- * 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).
- *
- * XXX There is no corresponding encapsulation fn to seed the generator.
- * @endif
- */
- template<typename _Distance>
- inline _Distance
- __random_number(_Distance __n)
- {
- #ifdef _GLIBCXX_HAVE_LRAND48
- return lrand48() % __n;
- #else
- return rand() % __n;
- #endif
- }
-
-
/**
* @brief Randomly shuffle the elements of a sequence.
* @param first A forward iterator.
@@ -1657,10 +1669,11 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
- if (__first == __last) return;
- for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
- std::iter_swap(__i, __first + std::__random_number((__i - __first) + 1));
+ if (__first != __last)
+ for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
+ std::iter_swap(__i, __first + (std::rand() % ((__i - __first) + 1)));
}
/**
@@ -1684,6 +1697,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return;
for (_RandomAccessIterator __i = __first + 1; __i != __last; ++__i)
@@ -1773,6 +1787,7 @@ namespace std
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
return std::__partition(__first, __last, __pred, std::__iterator_category(__first));
}
@@ -1873,6 +1888,7 @@ namespace std
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return __first;
@@ -2139,6 +2155,8 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
std::make_heap(__first, __middle);
for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
@@ -2179,6 +2197,8 @@ namespace std
_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __middle);
+ __glibcxx_requires_valid_range(__middle, __last);
std::make_heap(__first, __middle, __comp);
for (_RandomAccessIterator __i = __middle; __i < __last; ++__i)
@@ -2219,6 +2239,8 @@ namespace std
__glibcxx_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>)
__glibcxx_function_requires(_LessThanComparableConcept<_OutputValueType>)
__glibcxx_function_requires(_LessThanComparableConcept<_InputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
if (__result_first == __result_last) return __result_last;
_RandomAccessIterator __result_real_last = __result_first;
@@ -2275,6 +2297,8 @@ namespace std
__glibcxx_function_requires(_ConvertibleConcept<_InputValueType, _OutputValueType>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
_OutputValueType, _OutputValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__result_first, __result_last);
if (__result_first == __result_last) return __result_last;
_RandomAccessIterator __result_real_last = __result_first;
@@ -2375,6 +2399,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first != __last) {
std::__introsort_loop(__first, __last, __lg(__last - __first) * 2);
@@ -2406,6 +2431,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first != __last) {
std::__introsort_loop(__first, __last, __lg(__last - __first) * 2, __comp);
@@ -2438,6 +2464,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ __glibcxx_requires_partitioned(__first, __last, __val);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -2483,6 +2510,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
+ __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -2525,6 +2553,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ __glibcxx_requires_partitioned(__first, __last, __val);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -2570,6 +2599,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -2755,6 +2785,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2) {
if (*__first2 < *__first1) {
@@ -2808,6 +2840,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first2, *__first1)) {
@@ -3170,6 +3204,8 @@ namespace std
__glibcxx_function_requires(_Mutable_BidirectionalIteratorConcept<
_BidirectionalIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_sorted(__first, __middle);
+ __glibcxx_requires_sorted(__middle, __last);
if (__first == __middle || __middle == __last)
return;
@@ -3223,6 +3259,8 @@ namespace std
_BidirectionalIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
+ __glibcxx_requires_sorted_pred(__first, __middle, __comp);
+ __glibcxx_requires_sorted_pred(__middle, __last, __comp);
if (__first == __middle || __middle == __last)
return;
@@ -3309,6 +3347,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
_Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last);
if (buf.begin() == 0)
@@ -3346,6 +3385,7 @@ namespace std
_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
_Temporary_buffer<_RandomAccessIterator, _ValueType> buf(__first, __last);
if (buf.begin() == 0)
@@ -3381,6 +3421,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
while (__last - __first > 3) {
_RandomAccessIterator __cut =
@@ -3425,6 +3467,8 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
_ValueType, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __nth);
+ __glibcxx_requires_valid_range(__nth, __last);
while (__last - __first > 3) {
_RandomAccessIterator __cut =
@@ -3469,6 +3513,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_SameTypeConcept<_Tp, _ValueType>)
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ __glibcxx_requires_partitioned(__first, __last, __val);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -3524,6 +3569,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _ValueType, _Tp>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp, _ValueType>)
+ __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp);
_DistanceType __len = std::distance(__first, __last);
_DistanceType __half;
@@ -3572,6 +3618,7 @@ namespace std
__glibcxx_function_requires(_SameTypeConcept<_Tp,
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<_Tp>)
+ __glibcxx_requires_partitioned(__first, __last, __val);
_ForwardIterator __i = std::lower_bound(__first, __last, __val);
return __i != __last && !(__val < *__i);
@@ -3603,6 +3650,7 @@ namespace std
typename iterator_traits<_ForwardIterator>::value_type, _Tp>)
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare, _Tp,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_partitioned_pred(__first, __last, __val, __comp);
_ForwardIterator __i = std::lower_bound(__first, __last, __val, __comp);
return __i != __last && !__comp(__val, *__i);
@@ -3642,6 +3690,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2)
if (*__first2 < *__first1)
@@ -3687,6 +3737,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first2, *__first1))
@@ -3732,6 +3784,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2) {
if (*__first1 < *__first2) {
@@ -3788,6 +3842,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2) {
if (__comp(*__first1, *__first2)) {
@@ -3840,6 +3896,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2)
@@ -3892,6 +3950,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2))
@@ -3941,6 +4001,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
@@ -3996,6 +4058,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
@@ -4044,6 +4108,8 @@ namespace std
typename iterator_traits<_InputIterator2>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator1>::value_type>)
+ __glibcxx_requires_sorted(__first1, __last1);
+ __glibcxx_requires_sorted(__first2, __last2);
while (__first1 != __last1 && __first2 != __last2)
if (*__first1 < *__first2) {
@@ -4101,6 +4167,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_sorted_pred(__first1, __last1, __comp);
+ __glibcxx_requires_sorted_pred(__first2, __last2, __comp);
while (__first1 != __last1 && __first2 != __last2)
if (__comp(*__first1, *__first2)) {
@@ -4137,6 +4205,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __first;
_ForwardIterator __result = __first;
@@ -4164,6 +4233,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __first;
_ForwardIterator __result = __first;
@@ -4186,6 +4256,7 @@ namespace std
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __first;
_ForwardIterator __result = __first;
@@ -4213,6 +4284,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __first;
_ForwardIterator __result = __first;
@@ -4244,6 +4316,7 @@ namespace std
__glibcxx_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return false;
@@ -4296,6 +4369,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_BidirectionalIterator>::value_type,
typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return false;
@@ -4344,6 +4418,7 @@ namespace std
__glibcxx_function_requires(_BidirectionalIteratorConcept<_BidirectionalIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return false;
@@ -4396,6 +4471,7 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_Compare,
typename iterator_traits<_BidirectionalIterator>::value_type,
typename iterator_traits<_BidirectionalIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return false;
@@ -4451,6 +4527,8 @@ namespace std
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
@@ -4489,6 +4567,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_InputIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
for ( ; __first1 != __last1; ++__first1)
for (_ForwardIterator __iter = __first2; __iter != __last2; ++__iter)
@@ -4649,6 +4729,8 @@ namespace std
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_ForwardIterator1>::value_type,
typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
return std::__find_end(__first1, __last1, __first2, __last2,
std::__iterator_category(__first1),
@@ -4694,6 +4776,8 @@ namespace std
__glibcxx_function_requires(_BinaryPredicateConcept<_BinaryPredicate,
typename iterator_traits<_ForwardIterator1>::value_type,
typename iterator_traits<_ForwardIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
return std::__find_end(__first1, __last1, __first2, __last2,
std::__iterator_category(__first1),
diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h
index 73b13591cdc..3e1a7c639c3 100644
--- a/libstdc++-v3/include/bits/stl_algobase.h
+++ b/libstdc++-v3/include/bits/stl_algobase.h
@@ -74,6 +74,7 @@
#include <bits/stl_iterator_base_funcs.h>
#include <bits/stl_iterator.h>
#include <bits/concept_check.h>
+#include <debug/debug.h>
namespace std
{
@@ -333,6 +334,7 @@ namespace std
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
typedef typename _Is_normal_iterator<_InputIterator>::_Normal __Normal;
return std::__copy_ni1(__first, __last, __result, __Normal());
@@ -471,6 +473,7 @@ namespace std
__glibcxx_function_requires(_ConvertibleConcept<
typename iterator_traits<_BI1>::value_type,
typename iterator_traits<_BI2>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
typedef typename _Is_normal_iterator<_BI1>::_Normal __Normal;
return std::__copy_backward_input_normal_iterator(__first, __last, __result,
@@ -495,6 +498,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_Mutable_ForwardIteratorConcept<_ForwardIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
*__first = __value;
@@ -527,6 +531,7 @@ namespace std
inline void
fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c)
{
+ __glibcxx_requires_valid_range(__first, __last);
unsigned char __tmp = __c;
std::memset(__first, __tmp, __last - __first);
}
@@ -534,6 +539,7 @@ namespace std
inline void
fill(signed char* __first, signed char* __last, const signed char& __c)
{
+ __glibcxx_requires_valid_range(__first, __last);
signed char __tmp = __c;
std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
@@ -541,6 +547,7 @@ namespace std
inline void
fill(char* __first, char* __last, const char& __c)
{
+ __glibcxx_requires_valid_range(__first, __last);
char __tmp = __c;
std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
@@ -594,6 +601,7 @@ namespace std
typename iterator_traits<_InputIterator1>::value_type>)
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
while (__first1 != __last1 && *__first1 == *__first2)
{
@@ -625,6 +633,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
while (__first1 != __last1 && __binary_pred(*__first1, *__first2))
{
@@ -655,6 +664,7 @@ namespace std
__glibcxx_function_requires(_EqualOpConcept<
typename iterator_traits<_InputIterator1>::value_type,
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!(*__first1 == *__first2))
@@ -684,6 +694,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2)
if (!__binary_pred(*__first1, *__first2))
@@ -717,6 +728,8 @@ namespace std
typename iterator_traits<_InputIterator1>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
for (;__first1 != __last1 && __first2 != __last2; ++__first1, ++__first2)
{
@@ -749,6 +762,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
for ( ; __first1 != __last1 && __first2 != __last2
; ++__first1, ++__first2)
@@ -767,6 +782,9 @@ namespace std
const unsigned char* __first2,
const unsigned char* __last2)
{
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
const size_t __len1 = __last1 - __first1;
const size_t __len2 = __last2 - __first2;
const int __result = std::memcmp(__first1, __first2, std::min(__len1, __len2));
@@ -777,6 +795,9 @@ namespace std
lexicographical_compare(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
+
#if CHAR_MAX == SCHAR_MAX
return std::lexicographical_compare((const signed char*) __first1,
(const signed char*) __last1,
diff --git a/libstdc++-v3/include/bits/stl_bvector.h b/libstdc++-v3/include/bits/stl_bvector.h
index 15e0f57f166..884256151f4 100644
--- a/libstdc++-v3/include/bits/stl_bvector.h
+++ b/libstdc++-v3/include/bits/stl_bvector.h
@@ -61,7 +61,7 @@
#ifndef _BVECTOR_H
#define _BVECTOR_H 1
-namespace std
+namespace __gnu_norm
{
typedef unsigned long _Bit_type;
enum { _S_word_bit = int(CHAR_BIT * sizeof(_Bit_type)) };
@@ -261,86 +261,41 @@ 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:
- _Bit_type * _M_bit_alloc(size_t __n)
- { return _M_data_allocator.allocate((__n + _S_word_bit - 1)/_S_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<_Bit_type, _Allocator>::allocator_type
- _M_data_allocator;
- _Bit_iterator _M_start;
- _Bit_iterator _M_finish;
- _Bit_type * _M_end_of_storage;
-};
-
-// Specialization for instanceless allocators.
-template <class _Allocator>
-class _Bvector_alloc_base<_Allocator, true> {
+template <class _Alloc>
+class _Bvector_base
+ : public _Alloc::template rebind<_Bit_type>::other
+{
+ typedef typename _Alloc::template rebind<_Bit_type>::other _Bit_alloc_type;
public:
- typedef typename _Alloc_traits<bool, _Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
+ typedef _Alloc allocator_type;
+ allocator_type get_allocator() const {
+ return *static_cast<const _Bit_alloc_type*>(this);
+ }
- _Bvector_alloc_base(const allocator_type&)
- : _M_start(), _M_finish(), _M_end_of_storage(0) {}
+ _Bvector_base(const allocator_type& __a)
+ : _Bit_alloc_type(__a), _M_start(), _M_finish(), _M_end_of_storage(0) { }
+ ~_Bvector_base() { this->_M_deallocate(); }
protected:
- typedef typename _Alloc_traits<_Bit_type, _Allocator>::_Alloc_type
- _Alloc_type;
-
- _Bit_type * _M_bit_alloc(size_t __n)
- { return _Alloc_type::allocate((__n + _S_word_bit - 1)/_S_word_bit); }
+ _Bit_type* _M_bit_alloc(size_t __n) {
+ return _Bit_alloc_type::allocate((__n + _S_word_bit - 1)/_S_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_alloc_type::deallocate(_M_start._M_p, _M_end_of_storage - _M_start._M_p);
}
_Bit_iterator _M_start;
_Bit_iterator _M_finish;
_Bit_type * _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
+} // namespace __gnu_norm
// Declare a partial specialization of vector<T, Alloc>.
#include <bits/stl_vector.h>
-namespace std
+namespace __gnu_norm
{
-
template <typename _Alloc>
class vector<bool, _Alloc> : public _Bvector_base<_Alloc>
{
@@ -723,13 +678,8 @@ template <typename _Alloc>
void clear() { erase(begin(), end()); }
};
-// This typedef is non-standard. It is provided for backward compatibility.
-typedef vector<bool, __alloc> bit_vector;
-
-} // namespace std
+ // This typedef is non-standard. It is provided for backward compatibility.
+ typedef vector<bool, __alloc> bit_vector;
+} // namespace __gnu_norm
#endif /* _BVECTOR_H */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/libstdc++-v3/include/bits/stl_construct.h b/libstdc++-v3/include/bits/stl_construct.h
index 08841174f07..c705c003b5d 100644
--- a/libstdc++-v3/include/bits/stl_construct.h
+++ b/libstdc++-v3/include/bits/stl_construct.h
@@ -1,6 +1,6 @@
// nonstandard construct and destroy functions -*- C++ -*-
-// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
+// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -72,10 +72,14 @@ namespace std
* object's constructor with an initializer.
* @endif
*/
- template <class _T1, class _T2>
+ template<typename _T1, typename _T2>
inline void
_Construct(_T1* __p, const _T2& __value)
- { new (static_cast<void*>(__p)) _T1(__value); }
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
+ ::new(static_cast<void*>(__p)) _T1(__value);
+ }
/**
* @if maint
@@ -83,17 +87,21 @@ namespace std
* object's default constructor (no initializers).
* @endif
*/
- template <class _T1>
+ template<typename _T1>
inline void
_Construct(_T1* __p)
- { new (static_cast<void*>(__p)) _T1(); }
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_]allocator::construct
+ ::new(static_cast<void*>(__p)) _T1();
+ }
/**
* @if maint
* Destroy the object pointed to by a pointer type.
* @endif
*/
- template <class _Tp>
+ template<typename _Tp>
inline void
_Destroy(_Tp* __pointer)
{ __pointer->~_Tp(); }
@@ -105,7 +113,7 @@ namespace std
* This is a helper function used only by _Destroy().
* @endif
*/
- template <class _ForwardIterator>
+ template<typename _ForwardIterator>
inline void
__destroy_aux(_ForwardIterator __first, _ForwardIterator __last, __false_type)
{ for ( ; __first != __last; ++__first) std::_Destroy(&*__first); }
@@ -119,7 +127,7 @@ namespace std
* This is a helper function used only by _Destroy().
* @endif
*/
- template <class _ForwardIterator>
+ template<typename _ForwardIterator>
inline void
__destroy_aux(_ForwardIterator, _ForwardIterator, __true_type)
{ }
@@ -131,7 +139,7 @@ namespace std
* away, otherwise the objects' destructors must be invoked.
* @endif
*/
- template <class _ForwardIterator>
+ template<typename _ForwardIterator>
inline void
_Destroy(_ForwardIterator __first, _ForwardIterator __last)
{
diff --git a/libstdc++-v3/include/bits/stl_deque.h b/libstdc++-v3/include/bits/stl_deque.h
index b5733433bbc..64a24b1c027 100644
--- a/libstdc++-v3/include/bits/stl_deque.h
+++ b/libstdc++-v3/include/bits/stl_deque.h
@@ -65,7 +65,7 @@
#include <bits/stl_iterator_base_types.h>
#include <bits/stl_iterator_base_funcs.h>
-namespace std
+namespace __gnu_norm
{
/**
* @if maint
@@ -96,7 +96,7 @@ namespace std
* All the functions are op overloads except for _M_set_node.
* @endif
*/
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
struct _Deque_iterator
{
typedef _Deque_iterator<_Tp, _Tp&, _Tp*> iterator;
@@ -205,7 +205,7 @@ namespace std
// Note: we also provide overloads whose operands are of the same type in
// order to avoid ambiguous overload resolution when std::rel_ops operators
// are in scope (for additional details, see libstdc++/3628)
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator==(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -213,7 +213,7 @@ namespace std
return __x._M_cur == __y._M_cur;
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator==(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -222,7 +222,7 @@ namespace std
return __x._M_cur == __y._M_cur;
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator!=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -230,7 +230,7 @@ namespace std
return !(__x == __y);
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator!=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -239,7 +239,7 @@ namespace std
return !(__x == __y);
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator<(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -248,7 +248,7 @@ namespace std
(__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator<(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -258,7 +258,7 @@ namespace std
(__x._M_cur < __y._M_cur) : (__x._M_node < __y._M_node);
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator>(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -266,7 +266,7 @@ namespace std
return __y < __x;
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator>(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -275,7 +275,7 @@ namespace std
return __y < __x;
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator<=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -283,7 +283,7 @@ namespace std
return !(__y < __x);
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator<=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -292,7 +292,7 @@ namespace std
return !(__y < __x);
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline bool
operator>=(const _Deque_iterator<_Tp, _Ref, _Ptr>& __x,
const _Deque_iterator<_Tp, _Ref, _Ptr>& __y)
@@ -300,7 +300,7 @@ namespace std
return !(__x < __y);
}
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline bool
operator>=(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -313,7 +313,7 @@ namespace std
// According to the resolution of DR179 not only the various comparison
// operators but also operator- must accept mixed iterator/const_iterator
// parameters.
- template <typename _Tp, typename _RefL, typename _PtrL,
+ template<typename _Tp, typename _RefL, typename _PtrL,
typename _RefR, typename _PtrR>
inline typename _Deque_iterator<_Tp, _RefL, _PtrL>::difference_type
operator-(const _Deque_iterator<_Tp, _RefL, _PtrL>& __x,
@@ -325,152 +325,83 @@ namespace std
(__y._M_last - __y._M_cur);
}
- template <typename _Tp, typename _Ref, typename _Ptr>
+ template<typename _Tp, typename _Ref, typename _Ptr>
inline _Deque_iterator<_Tp, _Ref, _Ptr>
operator+(ptrdiff_t __n, const _Deque_iterator<_Tp, _Ref, _Ptr>& __x)
{
return __x + __n;
}
-
- /// @if maint Primary default version. @endif
/**
* @if maint
- * Deque base class. It has two purposes. First, its constructor
- * and destructor allocate (but don't initialize) storage. This makes
- * %exception safety easier. Second, the base class encapsulates all of
- * the differences between SGI-style allocators and standard-conforming
- * allocators. (See allocator.h for more on this topic.) There are two
- * versions: this ordinary one, and the space-saving specialization for
- * instanceless allocators.
+ * Deque base class. This class provides the unified face for %deque's
+ * allocation. This class's constructor and destructor allocate and
+ * deallocate (but do not initialize) storage. This makes %exception
+ * safety easier.
+ *
+ * Nothing in this class ever constructs or destroys an actual Tp element.
+ * (Deque handles that itself.) Only/All memory management is performed
+ * here.
* @endif
*/
- template <typename _Tp, typename _Alloc, bool __is_static>
- class _Deque_alloc_base
- {
- public:
- typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return _M_node_allocator; }
-
- _Deque_alloc_base(const allocator_type& __a)
- : _M_node_allocator(__a), _M_map_allocator(__a),
- _M_map(0), _M_map_size(0)
- {}
-
- protected:
- typedef typename _Alloc_traits<_Tp*, _Alloc>::allocator_type
- _Map_allocator_type;
-
- _Tp*
- _M_allocate_node()
- {
- return _M_node_allocator.allocate(__deque_buf_size(sizeof(_Tp)));
- }
-
- void
- _M_deallocate_node(_Tp* __p)
- {
- _M_node_allocator.deallocate(__p, __deque_buf_size(sizeof(_Tp)));
- }
-
- _Tp**
- _M_allocate_map(size_t __n)
- { return _M_map_allocator.allocate(__n); }
-
- void
- _M_deallocate_map(_Tp** __p, size_t __n)
- { _M_map_allocator.deallocate(__p, __n); }
-
- allocator_type _M_node_allocator;
- _Map_allocator_type _M_map_allocator;
- _Tp** _M_map;
- size_t _M_map_size;
- };
-
- /// @if maint Specialization for instanceless allocators. @endif
- template <typename _Tp, typename _Alloc>
- class _Deque_alloc_base<_Tp, _Alloc, true>
+ template<typename _Tp, typename _Alloc>
+ class _Deque_base
+ : public _Alloc
{
public:
- typedef typename _Alloc_traits<_Tp,_Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
+ typedef _Alloc allocator_type;
+ allocator_type get_allocator() const
+ { return *static_cast<const _Alloc*>(this); }
+
+ typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
+ typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
- _Deque_alloc_base(const allocator_type&)
- : _M_map(0), _M_map_size(0)
- {}
-
+ _Deque_base(const allocator_type& __a, size_t __num_elements)
+ : _Alloc(__a), _M_start(), _M_finish()
+ { _M_initialize_map(__num_elements); }
+ _Deque_base(const allocator_type& __a)
+ : _Alloc(__a), _M_start(), _M_finish() {}
+ ~_Deque_base();
+
protected:
- typedef typename _Alloc_traits<_Tp,_Alloc>::_Alloc_type _Node_alloc_type;
- typedef typename _Alloc_traits<_Tp*,_Alloc>::_Alloc_type _Map_alloc_type;
-
+ typedef typename _Alloc::template rebind<_Tp*>::other _Map_alloc_type;
+ _Map_alloc_type _M_get_map_allocator() const
+ { return _Map_alloc_type(this->get_allocator()); }
+
_Tp*
_M_allocate_node()
{
- return _Node_alloc_type::allocate(__deque_buf_size(sizeof(_Tp)));
+ return _Alloc::allocate(__deque_buf_size(sizeof(_Tp)));
}
void
_M_deallocate_node(_Tp* __p)
{
- _Node_alloc_type::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
+ _Alloc::deallocate(__p, __deque_buf_size(sizeof(_Tp)));
}
_Tp**
_M_allocate_map(size_t __n)
- { return _Map_alloc_type::allocate(__n); }
+ { return _M_get_map_allocator().allocate(__n); }
void
_M_deallocate_map(_Tp** __p, size_t __n)
- { _Map_alloc_type::deallocate(__p, __n); }
-
- _Tp** _M_map;
- size_t _M_map_size;
- };
-
-
- /**
- * @if maint
- * Deque base class. Using _Alloc_traits in the instantiation of the parent
- * class provides the compile-time dispatching mentioned in the parent's
- * docs. This class provides the unified face for %deque's allocation.
- *
- * Nothing in this class ever constructs or destroys an actual Tp element.
- * (Deque handles that itself.) Only/All memory management is performed
- * here.
- * @endif
- */
- template <typename _Tp, typename _Alloc>
- class _Deque_base
- : public _Deque_alloc_base<_Tp,_Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- {
- public:
- typedef _Deque_alloc_base<_Tp,_Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
- typedef _Deque_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _Deque_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
-
- _Deque_base(const allocator_type& __a, size_t __num_elements)
- : _Base(__a), _M_start(), _M_finish()
- { _M_initialize_map(__num_elements); }
- _Deque_base(const allocator_type& __a)
- : _Base(__a), _M_start(), _M_finish() {}
- ~_Deque_base();
-
+ { _M_get_map_allocator().deallocate(__p, __n); }
+
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 };
+ _Tp** _M_map;
+ size_t _M_map_size;
iterator _M_start;
iterator _M_finish;
};
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
_Deque_base<_Tp,_Alloc>::~_Deque_base()
{
if (this->_M_map)
@@ -490,7 +421,7 @@ namespace std
* The initial underlying memory layout is a bit complicated...
* @endif
*/
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
void
_Deque_base<_Tp,_Alloc>::_M_initialize_map(size_t __num_elements)
{
@@ -525,7 +456,7 @@ namespace std
__num_elements % __deque_buf_size(sizeof(_Tp));
}
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
void _Deque_base<_Tp,_Alloc>::_M_create_nodes(_Tp** __nstart, _Tp** __nfinish)
{
_Tp** __cur;
@@ -541,7 +472,7 @@ namespace std
}
}
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
void
_Deque_base<_Tp,_Alloc>::_M_destroy_nodes(_Tp** __nstart, _Tp** __nfinish)
{
@@ -634,7 +565,7 @@ namespace std
* and we can use other standard algorithms as well.
* @endif
*/
- template <typename _Tp, typename _Alloc = allocator<_Tp> >
+ template<typename _Tp, typename _Alloc = allocator<_Tp> >
class deque : protected _Deque_base<_Tp, _Alloc>
{
// concept requirements
@@ -670,9 +601,7 @@ namespace std
using _Base::_M_deallocate_map;
/** @if maint
- * A total of four data members accumulated down the heirarchy. If the
- * _Alloc type requires separate instances, then two of them will also be
- * included in each deque.
+ * A total of four data members accumulated down the heirarchy.
* @endif
*/
using _Base::_M_map;
@@ -1227,13 +1156,13 @@ namespace std
* push_back on each value from the iterator.
* @endif
*/
- template <typename _InputIterator>
+ template<typename _InputIterator>
void
_M_range_initialize(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
// called by the second initialize_dispatch above
- template <typename _ForwardIterator>
+ template<typename _ForwardIterator>
void
_M_range_initialize(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag);
@@ -1278,13 +1207,13 @@ namespace std
}
// called by the second assign_dispatch above
- template <typename _InputIterator>
+ template<typename _InputIterator>
void
_M_assign_aux(_InputIterator __first, _InputIterator __last,
input_iterator_tag);
// called by the second assign_dispatch above
- template <typename _ForwardIterator>
+ template<typename _ForwardIterator>
void
_M_assign_aux(_ForwardIterator __first, _ForwardIterator __last,
forward_iterator_tag)
@@ -1357,13 +1286,13 @@ namespace std
}
// called by the second insert_dispatch above
- template <typename _InputIterator>
+ template<typename _InputIterator>
void
_M_range_insert_aux(iterator __pos, _InputIterator __first,
_InputIterator __last, input_iterator_tag);
// called by the second insert_dispatch above
- template <typename _ForwardIterator>
+ template<typename _ForwardIterator>
void
_M_range_insert_aux(iterator __pos, _ForwardIterator __first,
_ForwardIterator __last, forward_iterator_tag);
@@ -1383,7 +1312,7 @@ namespace std
_M_insert_aux(iterator __pos, size_type __n, const value_type& __x);
// called by range_insert_aux for forward iterators
- template <typename _ForwardIterator>
+ template<typename _ForwardIterator>
void
_M_insert_aux(iterator __pos,
_ForwardIterator __first, _ForwardIterator __last,
@@ -1464,7 +1393,7 @@ namespace std
* deques. Deques are considered equivalent if their sizes are equal,
* and if corresponding elements compare equal.
*/
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator==(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y)
{
@@ -1483,7 +1412,7 @@ namespace std
*
* See std::lexicographical_compare() for how the determination is made.
*/
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator<(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y)
{
@@ -1492,39 +1421,39 @@ namespace std
}
/// Based on operator==
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator!=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__x == __y);
}
/// Based on operator<
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator>(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return __y < __x;
}
/// Based on operator<
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator<=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__y < __x);
}
/// Based on operator<
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline bool operator>=(const deque<_Tp, _Alloc>& __x,
const deque<_Tp, _Alloc>& __y) {
return !(__x < __y);
}
/// See std::deque::swap().
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
inline void swap(deque<_Tp,_Alloc>& __x, deque<_Tp,_Alloc>& __y)
{
__x.swap(__y);
}
-} // namespace std
+} // namespace __gnu_norm
#endif /* _DEQUE_H */
diff --git a/libstdc++-v3/include/bits/stl_heap.h b/libstdc++-v3/include/bits/stl_heap.h
index 697f2c6f7b7..c16cbe02e6f 100644
--- a/libstdc++-v3/include/bits/stl_heap.h
+++ b/libstdc++-v3/include/bits/stl_heap.h
@@ -60,8 +60,53 @@
#ifndef _STL_HEAP_H
#define _STL_HEAP_H 1
+#include <debug/debug.h>
+
namespace std
{
+ // is_heap, a predicate testing whether or not a range is
+ // a heap. This function is an extension, not part of the C++
+ // standard.
+ template<typename _RandomAccessIterator, typename _Distance>
+ bool
+ __is_heap(_RandomAccessIterator __first, _Distance __n)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child) {
+ if (__first[__parent] < __first[__child])
+ return false;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return true;
+ }
+
+ template<typename _RandomAccessIterator, typename _Distance,
+ typename _StrictWeakOrdering>
+ bool
+ __is_heap(_RandomAccessIterator __first, _StrictWeakOrdering __comp,
+ _Distance __n)
+ {
+ _Distance __parent = 0;
+ for (_Distance __child = 1; __child < __n; ++__child) {
+ if (__comp(__first[__parent], __first[__child]))
+ return false;
+ if ((__child & 1) == 0)
+ ++__parent;
+ }
+ return true;
+ }
+
+ template<typename _RandomAccessIterator>
+ bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last)
+ { return std::__is_heap(__first, std::distance(__first, __last)); }
+
+ template<typename _RandomAccessIterator, typename _StrictWeakOrdering>
+ bool
+ __is_heap(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ _StrictWeakOrdering __comp)
+ { return std::__is_heap(__first, __comp, std::distance(__first, __last)); }
// Heap-manipulation functions: push_heap, pop_heap, make_heap, sort_heap.
@@ -101,6 +146,8 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ // __glibcxx_requires_heap(__first, __last - 1);
std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0),
_ValueType(*(__last - 1)));
@@ -145,6 +192,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last - 1, __comp);
std::__push_heap(__first, _DistanceType((__last - __first) - 1), _DistanceType(0),
_ValueType(*(__last - 1)), __comp);
@@ -200,6 +249,8 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap(__first, __last);
std::__pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)));
}
@@ -256,6 +307,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
typedef typename iterator_traits<_RandomAccessIterator>::value_type _ValueType;
std::__pop_heap(__first, __last - 1, __last - 1, _ValueType(*(__last - 1)), __comp);
@@ -282,6 +335,7 @@ namespace std
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<_ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__last - __first < 2) return;
_DistanceType __len = __last - __first;
@@ -317,7 +371,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
-
+ __glibcxx_requires_valid_range(__first, __last);
+
if (__last - __first < 2) return;
_DistanceType __len = __last - __first;
_DistanceType __parent = (__len - 2)/2;
@@ -347,6 +402,8 @@ namespace std
_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+ // __glibcxx_requires_heap(__first, __last);
while (__last - __first > 1)
std::pop_heap(__first, __last--);
@@ -370,6 +427,8 @@ namespace std
// concept requirements
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_heap_pred(__first, __last, __comp);
while (__last - __first > 1)
std::pop_heap(__first, __last--, __comp);
diff --git a/libstdc++-v3/include/bits/stl_list.h b/libstdc++-v3/include/bits/stl_list.h
index 4533aee0bed..a9513f1656a 100644
--- a/libstdc++-v3/include/bits/stl_list.h
+++ b/libstdc++-v3/include/bits/stl_list.h
@@ -63,7 +63,7 @@
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
// Supporting structures are split into common and templated types; the
// latter publicly inherits from the former in an effort to reduce code
@@ -80,18 +80,18 @@ namespace std
/// @if maint An actual node in the %list. @endif
template<typename _Tp>
struct _List_node : public _List_node_base
- {
- _Tp _M_data; ///< User's data.
- };
+ {
+ _Tp _M_data; ///< User's data.
+ };
/**
* @if maint
* @brief Common part of a list::iterator.
*
- * A simple type to walk a doubly-linked list. All operations here should
- * be self-explanatory after taking any decent introductory data structures
- * course.
+ * A simple type to walk a doubly-linked list. All operations here
+ * should be self-explanatory after taking any decent introductory
+ * data structures course.
* @endif
*/
struct _List_iterator_base
@@ -104,11 +104,9 @@ namespace std
_List_node_base* _M_node;
_List_iterator_base(_List_node_base* __x)
- : _M_node(__x)
- { }
+ : _M_node(__x) { }
- _List_iterator_base()
- { }
+ _List_iterator_base() { }
/// Walk the %list forward.
void
@@ -141,184 +139,126 @@ namespace std
*/
template<typename _Tp, typename _Ref, typename _Ptr>
struct _List_iterator : public _List_iterator_base
- {
- typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
- typedef _List_iterator<_Tp,_Ref,_Ptr> _Self;
-
- typedef _Tp value_type;
- typedef _Ptr pointer;
- typedef _Ref reference;
- typedef _List_node<_Tp> _Node;
-
- _List_iterator(_Node* __x)
- : _List_iterator_base(__x)
- { }
-
- _List_iterator()
- { }
-
- _List_iterator(const iterator& __x)
- : _List_iterator_base(__x._M_node)
- { }
-
- reference
- operator*() const
- { return static_cast<_Node*>(_M_node)->_M_data; }
- // Must downcast from List_node_base to _List_node to get to _M_data.
-
- pointer
- operator->() const
- { return &(operator*()); }
-
- _Self&
- operator++()
- {
- this->_M_incr();
- return *this;
- }
-
- _Self
- operator++(int)
{
- _Self __tmp = *this;
- this->_M_incr();
- return __tmp;
- }
-
- _Self&
- operator--()
- {
- this->_M_decr();
- return *this;
- }
-
- _Self
- operator--(int)
- {
- _Self __tmp = *this;
- this->_M_decr();
+ typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
+ typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
+ typedef _List_iterator<_Tp,_Ref,_Ptr> _Self;
+
+ typedef _Tp value_type;
+ typedef _Ptr pointer;
+ typedef _Ref reference;
+ typedef _List_node<_Tp> _Node;
+
+ _List_iterator(_Node* __x)
+ : _List_iterator_base(__x) { }
+
+ _List_iterator() { }
+
+ _List_iterator(const iterator& __x)
+ : _List_iterator_base(__x._M_node) { }
+
+ // Must downcast from List_node_base to _List_node to get to _M_data.
+ reference
+ operator*() const
+ { return static_cast<_Node*>(_M_node)->_M_data; }
+
+ pointer
+ operator->() const
+ { return &(operator*()); }
+
+ _Self&
+ operator++()
+ {
+ this->_M_incr();
+ return *this;
+ }
+
+ _Self
+ operator++(int)
+ {
+ _Self __tmp = *this;
+ this->_M_incr();
+ return __tmp;
+ }
+
+ _Self&
+ operator--()
+ {
+ this->_M_decr();
+ return *this;
+ }
+
+ _Self
+ operator--(int)
+ {
+ _Self __tmp = *this;
+ this->_M_decr();
return __tmp;
- }
- };
-
-
- /// @if maint Primary default version. @endif
- /**
- * @if maint
- * See bits/stl_deque.h's _Deque_alloc_base for an explanation.
- * @endif
- */
- template<typename _Tp, typename _Allocator, bool _IsStatic>
- class _List_alloc_base
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
-
- allocator_type
- get_allocator() const { return _M_node_allocator; }
-
- _List_alloc_base(const allocator_type& __a)
- : _M_node_allocator(__a)
- { }
-
- protected:
- _List_node<_Tp>*
- _M_get_node()
- { return _M_node_allocator.allocate(1); }
-
- void
- _M_put_node(_List_node<_Tp>* __p)
- { _M_node_allocator.deallocate(__p, 1); }
-
- // NOTA BENE
- // The stored instance is not actually of "allocator_type"'s type. Instead
- // we rebind the type to Allocator<List_node<Tp>>, which according to
- // [20.1.5]/4 should probably be the same. List_node<Tp> is not the same
- // size as Tp (it's two pointers larger), and specializations on Tp may go
- // unused because List_node<Tp> is being bound instead.
- //
- // We put this to the test in get_allocator above; if the two types are
- // actually different, there had better be a conversion between them.
- //
- // None of the predefined allocators shipped with the library (as of 3.1)
- // use this instantiation anyhow; they're all instanceless.
- typename _Alloc_traits<_List_node<_Tp>, _Allocator>::allocator_type
- _M_node_allocator;
-
- _List_node_base _M_node;
- };
-
- /// @if maint Specialization for instanceless allocators. @endif
- template<typename _Tp, typename _Allocator>
- class _List_alloc_base<_Tp, _Allocator, true>
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
-
- allocator_type
- get_allocator() const { return allocator_type(); }
-
- _List_alloc_base(const allocator_type&)
- { }
-
- protected:
- // See comment in primary template class about why this is safe for the
- // standard predefined classes.
- typedef typename _Alloc_traits<_List_node<_Tp>, _Allocator>::_Alloc_type
- _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); }
-
- _List_node_base _M_node;
- };
-
+ }
+ };
/**
* @if maint
* See bits/stl_deque.h's _Deque_base for an explanation.
* @endif
*/
- template <typename _Tp, typename _Alloc>
+ template<typename _Tp, typename _Alloc>
class _List_base
- : public _List_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- {
- public:
- typedef _List_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _List_base(const allocator_type& __a)
- : _Base(__a)
- {
- this->_M_node._M_next = &this->_M_node;
- this->_M_node._M_prev = &this->_M_node;
- }
-
- // This is what actually destroys the list.
- ~_List_base()
+ : public _Alloc::template rebind<_List_node<_Tp> >::other
{
- __clear();
- }
+ protected:
+ // NOTA BENE
+ // The stored instance is not actually of "allocator_type"'s
+ // type. Instead we rebind the type to
+ // Allocator<List_node<Tp>>, which according to [20.1.5]/4
+ // should probably be the same. List_node<Tp> is not the same
+ // size as Tp (it's two pointers larger), and specializations on
+ // Tp may go unused because List_node<Tp> is being bound
+ // instead.
+ //
+ // We put this to the test in the constructors and in
+ // get_allocator, where we use conversions between
+ // allocator_type and _Node_Alloc_type. The conversion is
+ // required by table 32 in [20.1.5].
+ typedef typename _Alloc::template rebind<_List_node<_Tp> >::other
+ _Node_Alloc_type;
+
+ _List_node_base _M_node;
+
+ _List_node<_Tp>*
+ _M_get_node()
+ { return _Node_Alloc_type::allocate(1); }
+
+ void
+ _M_put_node(_List_node<_Tp>* __p)
+ { _Node_Alloc_type::deallocate(__p, 1); }
+
+ public:
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const
+ { return allocator_type(*static_cast<const _Node_Alloc_type*>(this)); }
+
+ _List_base(const allocator_type& __a)
+ : _Node_Alloc_type(__a)
+ {
+ this->_M_node._M_next = &this->_M_node;
+ this->_M_node._M_prev = &this->_M_node;
+ }
- void
- __clear();
- };
+ // This is what actually destroys the list.
+ ~_List_base()
+ { _M_clear(); }
+
+ void
+ _M_clear();
+ };
/**
- * @brief A standard container with linear time access to elements, and
- * fixed time insertion/deletion at any point in the sequence.
+ * @brief A standard container with linear time access to elements,
+ * and fixed time insertion/deletion at any point in the sequence.
*
* @ingroup Containers
* @ingroup Sequences
@@ -329,774 +269,802 @@ namespace std
* <a href="tables.html#68">optional sequence requirements</a> with the
* %exception of @c at and @c operator[].
*
- * This is a @e doubly @e linked %list. Traversal up and down the %list
- * requires linear time, but adding and removing elements (or @e nodes) is
- * done in constant time, regardless of where the change takes place.
- * Unlike std::vector and std::deque, random-access iterators are not
- * provided, so subscripting ( @c [] ) access is not allowed. For algorithms
- * which only need sequential access, this lack makes no difference.
+ * This is a @e doubly @e linked %list. Traversal up and down the
+ * %list requires linear time, but adding and removing elements (or
+ * @e nodes) is done in constant time, regardless of where the
+ * change takes place. Unlike std::vector and std::deque,
+ * random-access iterators are not provided, so subscripting ( @c
+ * [] ) access is not allowed. For algorithms which only need
+ * sequential access, this lack makes no difference.
*
- * Also unlike the other standard containers, std::list provides specialized
- * algorithms %unique to linked lists, such as splicing, sorting, and
- * in-place reversal.
+ * Also unlike the other standard containers, std::list provides
+ * specialized algorithms %unique to linked lists, such as
+ * splicing, sorting, and in-place reversal.
*
* @if maint
* A couple points on memory allocation for list<Tp>:
*
- * First, we never actually allocate a Tp, we allocate List_node<Tp>'s
- * and trust [20.1.5]/4 to DTRT. This is to ensure that after elements from
- * %list<X,Alloc1> are spliced into %list<X,Alloc2>, destroying the memory of
- * the second %list is a valid operation, i.e., Alloc1 giveth and Alloc2
- * taketh away.
+ * First, we never actually allocate a Tp, we allocate
+ * List_node<Tp>'s and trust [20.1.5]/4 to DTRT. This is to ensure
+ * that after elements from %list<X,Alloc1> are spliced into
+ * %list<X,Alloc2>, destroying the memory of the second %list is a
+ * valid operation, i.e., Alloc1 giveth and Alloc2 taketh away.
*
* Second, a %list conceptually represented as
* @code
* A <---> B <---> C <---> D
* @endcode
- * is actually circular; a link exists between A and D. The %list class
- * holds (as its only data member) a private list::iterator pointing to
- * @e D, not to @e A! To get to the head of the %list, we start at the tail
- * and move forward by one. When this member iterator's next/previous
- * pointers refer to itself, the %list is %empty.
- * @endif
+ * is actually circular; a link exists between A and D. The %list
+ * class holds (as its only data member) a private list::iterator
+ * pointing to @e D, not to @e A! To get to the head of the %list,
+ * we start at the tail and move forward by one. When this member
+ * iterator's next/previous pointers refer to itself, the %list is
+ * %empty. @endif
*/
template<typename _Tp, typename _Alloc = allocator<_Tp> >
class list : protected _List_base<_Tp, _Alloc>
- {
- // concept requirements
- __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
-
- typedef _List_base<_Tp, _Alloc> _Base;
-
- public:
- typedef _Tp value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
- typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
- typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
- typedef std::reverse_iterator<iterator> reverse_iterator;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef size_t size_type;
- typedef ptrdiff_t difference_type;
- typedef typename _Base::allocator_type allocator_type;
-
- protected:
- // Note that pointers-to-_Node's can be ctor-converted to iterator types.
- typedef _List_node<_Tp> _Node;
-
- /** @if maint
- * One data member plus two memory-handling functions. If the _Alloc
- * type requires separate instances, then one of those will also be
- * included, accumulated from the topmost parent.
- * @endif
- */
- using _Base::_M_node;
- using _Base::_M_put_node;
- using _Base::_M_get_node;
-
- /**
- * @if maint
- * @param x An instance of user data.
- *
- * Allocates space for a new node and constructs a copy of @a x in it.
- * @endif
- */
- _Node*
- _M_create_node(const value_type& __x)
{
- _Node* __p = this->_M_get_node();
- try {
- std::_Construct(&__p->_M_data, __x);
- }
- catch(...)
+ // concept requirements
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+
+ typedef _List_base<_Tp, _Alloc> _Base;
+
+ public:
+ typedef _Tp value_type;
+ typedef value_type* pointer;
+ typedef const value_type* const_pointer;
+ typedef _List_iterator<_Tp,_Tp&,_Tp*> iterator;
+ typedef _List_iterator<_Tp,const _Tp&,const _Tp*> const_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef typename _Base::allocator_type allocator_type;
+
+ protected:
+ // Note that pointers-to-_Node's can be ctor-converted to
+ // iterator types.
+ typedef _List_node<_Tp> _Node;
+
+ /** @if maint
+ * One data member plus two memory-handling functions. If the
+ * _Alloc type requires separate instances, then one of those
+ * will also be included, accumulated from the topmost parent.
+ * @endif
+ */
+ using _Base::_M_node;
+ using _Base::_M_put_node;
+ using _Base::_M_get_node;
+
+ /**
+ * @if maint
+ * @param x An instance of user data.
+ *
+ * Allocates space for a new node and constructs a copy of @a x in it.
+ * @endif
+ */
+ _Node*
+ _M_create_node(const value_type& __x)
{
- _M_put_node(__p);
- __throw_exception_again;
+ _Node* __p = this->_M_get_node();
+ try
+ {
+ std::_Construct(&__p->_M_data, __x);
+ }
+ catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
}
- return __p;
- }
- /**
- * @if maint
- * Allocates space for a new node and default-constructs a new instance
- * of @c value_type in it.
- * @endif
- */
- _Node*
- _M_create_node()
- {
- _Node* __p = this->_M_get_node();
- try {
- std::_Construct(&__p->_M_data);
- }
- catch(...)
+ /**
+ * @if maint
+ * Allocates space for a new node and default-constructs a new
+ * instance of @c value_type in it.
+ * @endif
+ */
+ _Node*
+ _M_create_node()
{
- _M_put_node(__p);
- __throw_exception_again;
+ _Node* __p = this->_M_get_node();
+ try
+ {
+ std::_Construct(&__p->_M_data);
+ }
+ catch(...)
+ {
+ _M_put_node(__p);
+ __throw_exception_again;
+ }
+ return __p;
}
- return __p;
- }
-
- public:
- // [23.2.2.1] construct/copy/destroy
- // (assign() and get_allocator() are also listed in this section)
- /**
- * @brief Default constructor creates no elements.
- */
- explicit
- list(const allocator_type& __a = allocator_type())
- : _Base(__a) { }
-
- /**
- * @brief Create a %list with copies of an exemplar element.
- * @param n The number of elements to initially create.
- * @param value An element to copy.
- *
- * This constructor fills the %list with @a n copies of @a value.
- */
- list(size_type __n, const value_type& __value,
- const allocator_type& __a = allocator_type())
+
+ public:
+ // [23.2.2.1] construct/copy/destroy
+ // (assign() and get_allocator() are also listed in this section)
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ explicit
+ list(const allocator_type& __a = allocator_type())
+ : _Base(__a) { }
+
+ /**
+ * @brief Create a %list with copies of an exemplar element.
+ * @param n The number of elements to initially create.
+ * @param value An element to copy.
+ *
+ * This constructor fills the %list with @a n copies of @a value.
+ */
+ list(size_type __n, const value_type& __value,
+ const allocator_type& __a = allocator_type())
: _Base(__a)
{ this->insert(begin(), __n, __value); }
- /**
- * @brief Create a %list with default elements.
- * @param n The number of elements to initially create.
- *
- * This constructor fills the %list with @a n copies of a
- * default-constructed element.
- */
- explicit
- list(size_type __n)
+ /**
+ * @brief Create a %list with default elements.
+ * @param n The number of elements to initially create.
+ *
+ * This constructor fills the %list with @a n copies of a
+ * default-constructed element.
+ */
+ explicit
+ list(size_type __n)
: _Base(allocator_type())
{ this->insert(begin(), __n, value_type()); }
- /**
- * @brief %List copy constructor.
- * @param x A %list of identical element and allocator types.
- *
- * The newly-created %list uses a copy of the allocation object used
- * by @a x.
- */
- list(const list& __x)
+ /**
+ * @brief %List copy constructor.
+ * @param x A %list of identical element and allocator types.
+ *
+ * The newly-created %list uses a copy of the allocation object used
+ * by @a x.
+ */
+ list(const list& __x)
: _Base(__x.get_allocator())
{ this->insert(begin(), __x.begin(), __x.end()); }
-
- /**
- * @brief Builds a %list from a range.
- * @param first An input iterator.
- * @param last An input iterator.
- *
- * Create a %list consisting of copies of the elements from
- * [@a first,@a last). This is linear in N (where N is
- * distance(@a first,@a last)).
- *
- * @if maint
- * We don't need any dispatching tricks here, because insert does all of
- * that anyway.
- * @endif
- */
- template<typename _InputIterator>
- list(_InputIterator __first, _InputIterator __last,
- const allocator_type& __a = allocator_type())
- : _Base(__a)
- { this->insert(begin(), __first, __last); }
-
- /**
- * No explicit dtor needed as the _Base dtor takes care of things.
- * The _Base dtor only erases the elements, and note that if the elements
- * themselves are pointers, the pointed-to memory is not touched in any
- * way. Managing the pointer is the user's responsibilty.
- */
-
- /**
- * @brief %List assignment operator.
- * @param x A %list of identical element and allocator types.
- *
- * All the elements of @a x are copied, but unlike the copy constructor,
- * the allocator object is not copied.
- */
- list&
- operator=(const list& __x);
-
- /**
- * @brief Assigns a given value to a %list.
- * @param n Number of elements to be assigned.
- * @param val Value to be assigned.
- *
- * This function fills a %list with @a n copies of the given value.
- * Note that the assignment completely changes the %list and that the
- * resulting %list's size is the same as the number of elements assigned.
- * Old data may be lost.
- */
- void
- assign(size_type __n, const value_type& __val) { _M_fill_assign(__n, __val); }
-
- /**
- * @brief Assigns a range to a %list.
- * @param first An input iterator.
- * @param last An input iterator.
- *
- * This function fills a %list with copies of the elements in the
- * range [@a first,@a last).
- *
- * Note that the assignment completely changes the %list and that the
- * resulting %list's size is the same as the number of elements assigned.
- * Old data may be lost.
- */
- template<typename _InputIterator>
+
+ /**
+ * @brief Builds a %list from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * Create a %list consisting of copies of the elements from
+ * [@a first,@a last). This is linear in N (where N is
+ * distance(@a first,@a last)).
+ *
+ * @if maint
+ * We don't need any dispatching tricks here, because insert does all of
+ * that anyway.
+ * @endif
+ */
+ template<typename _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const allocator_type& __a = allocator_type())
+ : _Base(__a)
+ { this->insert(begin(), __first, __last); }
+
+ /**
+ * No explicit dtor needed as the _Base dtor takes care of
+ * things. The _Base dtor only erases the elements, and note
+ * that if the elements themselves are pointers, the pointed-to
+ * memory is not touched in any way. Managing the pointer is
+ * the user's responsibilty.
+ */
+
+ /**
+ * @brief %List assignment operator.
+ * @param x A %list of identical element and allocator types.
+ *
+ * All the elements of @a x are copied, but unlike the copy
+ * constructor, the allocator object is not copied.
+ */
+ list&
+ operator=(const list& __x);
+
+ /**
+ * @brief Assigns a given value to a %list.
+ * @param n Number of elements to be assigned.
+ * @param val Value to be assigned.
+ *
+ * This function fills a %list with @a n copies of the given
+ * value. Note that the assignment completely changes the %list
+ * and that the resulting %list's size is the same as the number
+ * of elements assigned. Old data may be lost.
+ */
+ void
+ assign(size_type __n, const value_type& __val)
+ { _M_fill_assign(__n, __val); }
+
+ /**
+ * @brief Assigns a range to a %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function fills a %list with copies of the elements in the
+ * range [@a first,@a last).
+ *
+ * Note that the assignment completely changes the %list and
+ * that the resulting %list's size is the same as the number of
+ * elements assigned. Old data may be lost.
+ */
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ _M_assign_dispatch(__first, __last, _Integral());
+ }
+
+ /// Get a copy of the memory allocation object.
+ allocator_type
+ get_allocator() const { return _Base::get_allocator(); }
+
+ // iterators
+ /**
+ * Returns a read/write iterator that points to the first element in the
+ * %list. Iteration is done in ordinary element order.
+ */
+ iterator
+ begin() { return static_cast<_Node*>(this->_M_node._M_next); }
+
+ /**
+ * Returns a read-only (constant) iterator that points to the
+ * first element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ begin() const { return static_cast<_Node*>(this->_M_node._M_next); }
+
+ /**
+ * Returns a read/write iterator that points one past the last
+ * element in the %list. Iteration is done in ordinary element
+ * order.
+ */
+ iterator
+ end() { return static_cast<_Node*>(&this->_M_node); }
+
+ /**
+ * Returns a read-only (constant) iterator that points one past
+ * the last element in the %list. Iteration is done in ordinary
+ * element order.
+ */
+ const_iterator
+ end() const
+ { return const_cast<_Node*>(static_cast<const _Node*>(&this->_M_node)); }
+
+ /**
+ * Returns a read/write reverse iterator that points to the last
+ * element in the %list. Iteration is done in reverse element
+ * order.
+ */
+ reverse_iterator
+ rbegin() { return reverse_iterator(end()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to
+ * the last element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rbegin() const { return const_reverse_iterator(end()); }
+
+ /**
+ * Returns a read/write reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in
+ * reverse element order.
+ */
+ reverse_iterator
+ rend() { return reverse_iterator(begin()); }
+
+ /**
+ * Returns a read-only (constant) reverse iterator that points to one
+ * before the first element in the %list. Iteration is done in reverse
+ * element order.
+ */
+ const_reverse_iterator
+ rend() const
+ { return const_reverse_iterator(begin()); }
+
+ // [23.2.2.2] capacity
+ /**
+ * Returns true if the %list is empty. (Thus begin() would equal
+ * end().)
+ */
+ bool
+ empty() const { return this->_M_node._M_next == &this->_M_node; }
+
+ /** Returns the number of elements in the %list. */
+ size_type
+ size() const { return std::distance(begin(), end()); }
+
+ /** Returns the size() of the largest possible %list. */
+ size_type
+ max_size() const { return size_type(-1); }
+
+ /**
+ * @brief Resizes the %list to the specified number of elements.
+ * @param new_size Number of elements the %list should contain.
+ * @param x Data with which new elements should be populated.
+ *
+ * This function will %resize the %list to the specified number
+ * of elements. If the number is smaller than the %list's
+ * current size the %list is truncated, otherwise the %list is
+ * extended and new elements are populated with given data.
+ */
void
- assign(_InputIterator __first, _InputIterator __last)
+ resize(size_type __new_size, const value_type& __x);
+
+ /**
+ * @brief Resizes the %list to the specified number of elements.
+ * @param new_size Number of elements the %list should contain.
+ *
+ * This function will resize the %list to the specified number of
+ * elements. If the number is smaller than the %list's current
+ * size the %list is truncated, otherwise the %list is extended
+ * and new elements are default-constructed.
+ */
+ void
+ resize(size_type __new_size) { this->resize(__new_size, value_type()); }
+
+ // element access
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %list.
+ */
+ reference
+ front() { return *begin(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %list.
+ */
+ const_reference
+ front() const { return *begin(); }
+
+ /**
+ * Returns a read/write reference to the data at the last element
+ * of the %list.
+ */
+ reference
+ back() { return *(--end()); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %list.
+ */
+ const_reference
+ back() const { return *(--end()); }
+
+ // [23.2.2.3] modifiers
+ /**
+ * @brief Add data to the front of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the front of the %list and assigns the given data
+ * to it. Due to the nature of a %list this operation can be
+ * done in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_front(const value_type& __x) { this->insert(begin(), __x); }
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the first element's data
+ * is needed, it should be retrieved before pop_front() is
+ * called.
+ */
+ void
+ pop_front() { this->erase(begin()); }
+
+ /**
+ * @brief Add data to the end of the %list.
+ * @param x Data to be added.
+ *
+ * This is a typical stack operation. The function creates an
+ * element at the end of the %list and assigns the given data to
+ * it. Due to the nature of a %list this operation can be done
+ * in constant time, and does not invalidate iterators and
+ * references.
+ */
+ void
+ push_back(const value_type& __x) { this->insert(end(), __x); }
+
+ /**
+ * @brief Removes last element.
+ *
+ * This is a typical stack operation. It shrinks the %list by
+ * one. Due to the nature of a %list this operation can be done
+ * in constant time, and only invalidates iterators/references to
+ * the element being removed.
+ *
+ * Note that no data is returned, and if the last element's data
+ * is needed, it should be retrieved before pop_back() is called.
+ */
+ void
+ pop_back()
{
- // Check whether it's an integral type. If so, it's not an iterator.
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_assign_dispatch(__first, __last, _Integral());
+ iterator __tmp = end();
+ this->erase(--__tmp);
}
-
- /// Get a copy of the memory allocation object.
- allocator_type
- get_allocator() const { return _Base::get_allocator(); }
-
- // iterators
- /**
- * Returns a read/write iterator that points to the first element in the
- * %list. Iteration is done in ordinary element order.
- */
- iterator
- begin() { return static_cast<_Node*>(this->_M_node._M_next); }
-
- /**
- * Returns a read-only (constant) iterator that points to the first element
- * in the %list. Iteration is done in ordinary element order.
- */
- const_iterator
- begin() const { return static_cast<_Node*>(this->_M_node._M_next); }
-
- /**
- * Returns a read/write iterator that points one past the last element in
- * the %list. Iteration is done in ordinary element order.
- */
- iterator
- end() { return static_cast<_Node*>(&this->_M_node); }
-
- /**
- * Returns a read-only (constant) iterator that points one past the last
- * element in the %list. Iteration is done in ordinary element order.
- */
- const_iterator
- end() const { return const_cast<_Node *>(static_cast<const _Node*>(&this->_M_node)); }
-
- /**
- * Returns a read/write reverse iterator that points to the last element in
- * the %list. Iteration is done in reverse element order.
- */
- reverse_iterator
- rbegin() { return reverse_iterator(end()); }
-
- /**
- * Returns a read-only (constant) reverse iterator that points to the last
- * element in the %list. Iteration is done in reverse element order.
- */
- const_reverse_iterator
- rbegin() const { return const_reverse_iterator(end()); }
-
- /**
- * Returns a read/write reverse iterator that points to one before the
- * first element in the %list. Iteration is done in reverse element
- * order.
- */
- reverse_iterator
- rend() { return reverse_iterator(begin()); }
-
- /**
- * Returns a read-only (constant) reverse iterator that points to one
- * before the first element in the %list. Iteration is done in reverse
- * element order.
- */
- const_reverse_iterator
- rend() const
- { return const_reverse_iterator(begin()); }
-
- // [23.2.2.2] capacity
- /**
- * Returns true if the %list is empty. (Thus begin() would equal end().)
- */
- bool
- empty() const { return this->_M_node._M_next == &this->_M_node; }
-
- /** Returns the number of elements in the %list. */
- size_type
- size() const { return std::distance(begin(), end()); }
-
- /** Returns the size() of the largest possible %list. */
- size_type
- max_size() const { return size_type(-1); }
-
- /**
- * @brief Resizes the %list to the specified number of elements.
- * @param new_size Number of elements the %list should contain.
- * @param x Data with which new elements should be populated.
- *
- * This function will %resize the %list to the specified number of
- * elements. If the number is smaller than the %list's current size the
- * %list is truncated, otherwise the %list is extended and new elements
- * are populated with given data.
- */
- void
- resize(size_type __new_size, const value_type& __x);
-
- /**
- * @brief Resizes the %list to the specified number of elements.
- * @param new_size Number of elements the %list should contain.
- *
- * This function will resize the %list to the specified number of
- * elements. If the number is smaller than the %list's current size the
- * %list is truncated, otherwise the %list is extended and new elements
- * are default-constructed.
- */
- void
- resize(size_type __new_size) { this->resize(__new_size, value_type()); }
-
- // element access
- /**
- * Returns a read/write reference to the data at the first element of the
- * %list.
- */
- reference
- front() { return *begin(); }
-
- /**
- * Returns a read-only (constant) reference to the data at the first
- * element of the %list.
- */
- const_reference
- front() const { return *begin(); }
-
- /**
- * Returns a read/write reference to the data at the last element of the
- * %list.
- */
- reference
- back() { return *(--end()); }
-
- /**
- * Returns a read-only (constant) reference to the data at the last
- * element of the %list.
- */
- const_reference
- back() const { return *(--end()); }
-
- // [23.2.2.3] modifiers
- /**
- * @brief Add data to the front of the %list.
- * @param x Data to be added.
- *
- * This is a typical stack operation. The function creates an element at
- * the front of the %list and assigns the given data to it. Due to the
- * nature of a %list this operation can be done in constant time, and
- * does not invalidate iterators and references.
- */
- void
- push_front(const value_type& __x) { this->insert(begin(), __x); }
-
- /**
- * @brief Removes first element.
- *
- * This is a typical stack operation. It shrinks the %list by one.
- * Due to the nature of a %list this operation can be done in constant
- * time, and only invalidates iterators/references to the element being
- * removed.
- *
- * Note that no data is returned, and if the first element's data is
- * needed, it should be retrieved before pop_front() is called.
- */
- void
- pop_front() { this->erase(begin()); }
-
- /**
- * @brief Add data to the end of the %list.
- * @param x Data to be added.
- *
- * This is a typical stack operation. The function creates an element at
- * the end of the %list and assigns the given data to it. Due to the
- * nature of a %list this operation can be done in constant time, and
- * does not invalidate iterators and references.
- */
- void
- push_back(const value_type& __x) { this->insert(end(), __x); }
-
- /**
- * @brief Removes last element.
- *
- * This is a typical stack operation. It shrinks the %list by one.
- * Due to the nature of a %list this operation can be done in constant
- * time, and only invalidates iterators/references to the element being
- * removed.
- *
- * Note that no data is returned, and if the last element's data is
- * needed, it should be retrieved before pop_back() is called.
- */
- void
- pop_back()
- {
- iterator __tmp = end();
- this->erase(--__tmp);
- }
-
- /**
- * @brief Inserts given value into %list before specified iterator.
- * @param position An iterator into the %list.
- * @param x Data to be inserted.
- * @return An iterator that points to the inserted data.
- *
- * This function will insert a copy of the given value before the specified
- * location.
- * Due to the nature of a %list this operation can be done in constant
- * time, and does not invalidate iterators and references.
- */
- iterator
- insert(iterator __position, const value_type& __x);
-
- /**
- * @brief Inserts a number of copies of given data into the %list.
- * @param position An iterator into the %list.
- * @param n Number of elements to be inserted.
- * @param x Data to be inserted.
- *
- * This function will insert a specified number of copies of the given data
- * before the location specified by @a position.
- *
- * Due to the nature of a %list this operation can be done in constant
- * time, and does not invalidate iterators and references.
- */
- void
- insert(iterator __position, size_type __n, const value_type& __x)
- { _M_fill_insert(__position, __n, __x); }
-
- /**
- * @brief Inserts a range into the %list.
- * @param position An iterator into the %list.
- * @param first An input iterator.
- * @param last An input iterator.
- *
- * This function will insert copies of the data in the range
- * [@a first,@a last) into the %list before the location specified by @a
- * position.
- *
- * Due to the nature of a %list this operation can be done in constant
- * time, and does not invalidate iterators and references.
- */
- template<typename _InputIterator>
+
+ /**
+ * @brief Inserts given value into %list before specified iterator.
+ * @param position An iterator into the %list.
+ * @param x Data to be inserted.
+ * @return An iterator that points to the inserted data.
+ *
+ * This function will insert a copy of the given value before
+ * the specified location. Due to the nature of a %list this
+ * operation can be done in constant time, and does not
+ * invalidate iterators and references.
+ */
+ iterator
+ insert(iterator __position, const value_type& __x);
+
+ /**
+ * @brief Inserts a number of copies of given data into the %list.
+ * @param position An iterator into the %list.
+ * @param n Number of elements to be inserted.
+ * @param x Data to be inserted.
+ *
+ * This function will insert a specified number of copies of the
+ * given data before the location specified by @a position.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and does not invalidate iterators and
+ * references.
+ */
void
- insert(iterator __position, _InputIterator __first, _InputIterator __last)
+ insert(iterator __position, size_type __n, const value_type& __x)
+ { _M_fill_insert(__position, __n, __x); }
+
+ /**
+ * @brief Inserts a range into the %list.
+ * @param position An iterator into the %list.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ *
+ * This function will insert copies of the data in the range [@a
+ * first,@a last) into the %list before the location specified by
+ * @a position.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and does not invalidate iterators and
+ * references.
+ */
+ template<typename _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ // Check whether it's an integral type. If so, it's not an iterator.
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ _M_insert_dispatch(__position, __first, __last, _Integral());
+ }
+
+ /**
+ * @brief Remove element at given position.
+ * @param position Iterator pointing to element to be erased.
+ * @return An iterator pointing to the next element (or end()).
+ *
+ * This function will erase the element at the given position and thus
+ * shorten the %list by one.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the element, and that if the element
+ * is itself a pointer, the pointed-to memory is not touched in
+ * any way. Managing the pointer is the user's responsibilty.
+ */
+ iterator
+ erase(iterator __position);
+
+ /**
+ * @brief Remove a range of elements.
+ * @param first Iterator pointing to the first element to be erased.
+ * @param last Iterator pointing to one past the last element to be
+ * erased.
+ * @return An iterator pointing to the element pointed to by @a last
+ * prior to erasing (or end()).
+ *
+ * This function will erase the elements in the range @a
+ * [first,last) and shorten the %list accordingly.
+ *
+ * Due to the nature of a %list this operation can be done in
+ * constant time, and only invalidates iterators/references to
+ * the element being removed. The user is also cautioned that
+ * this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibilty.
+ */
+ iterator
+ erase(iterator __first, iterator __last)
{
- // Check whether it's an integral type. If so, it's not an iterator.
- typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
- _M_insert_dispatch(__position, __first, __last, _Integral());
+ while (__first != __last)
+ erase(__first++);
+ return __last;
}
- /**
- * @brief Remove element at given position.
- * @param position Iterator pointing to element to be erased.
- * @return An iterator pointing to the next element (or end()).
- *
- * This function will erase the element at the given position and thus
- * shorten the %list by one.
- *
- * Due to the nature of a %list this operation can be done in constant
- * time, and only invalidates iterators/references to the element being
- * removed.
- * The user is also cautioned that
- * this function only erases the element, and that if the element is itself
- * a pointer, the pointed-to memory is not touched in any way. Managing
- * the pointer is the user's responsibilty.
- */
- iterator
- erase(iterator __position);
-
- /**
- * @brief Remove a range of elements.
- * @param first Iterator pointing to the first element to be erased.
- * @param last Iterator pointing to one past the last element to be
- * erased.
- * @return An iterator pointing to the element pointed to by @a last
- * prior to erasing (or end()).
- *
- * This function will erase the elements in the range @a [first,last) and
- * shorten the %list accordingly.
- *
- * Due to the nature of a %list this operation can be done in constant
- * time, and only invalidates iterators/references to the element being
- * removed.
- * The user is also cautioned that
- * this function only erases the elements, and that if the elements
- * themselves are pointers, the pointed-to memory is not touched in any
- * way. Managing the pointer is the user's responsibilty.
- */
- iterator
- erase(iterator __first, iterator __last)
- {
- while (__first != __last)
- erase(__first++);
- return __last;
- }
-
- /**
- * @brief Swaps data with another %list.
- * @param x A %list of the same element and allocator types.
- *
- * This exchanges the elements between two lists in constant time.
- * Note that the global std::swap() function is specialized such that
- * std::swap(l1,l2) will feed to this function.
- */
- void
- swap(list& __x);
-
- /**
- * Erases all the elements. Note that this function only erases the
- * elements, and that if the elements themselves are pointers, the
- * pointed-to memory is not touched in any way. Managing the pointer is
- * the user's responsibilty.
- */
- void
- clear() { _Base::__clear(); }
-
- // [23.2.2.4] list operations
- /**
- * @brief Insert contents of another %list.
- * @param position Iterator referencing the element to insert before.
- * @param x Source list.
- *
- * The elements of @a x are inserted in constant time in front of the
- * element referenced by @a position. @a x becomes an empty list.
- */
- void
- splice(iterator __position, list& __x)
- {
- if (!__x.empty())
- this->_M_transfer(__position, __x.begin(), __x.end());
- }
-
- /**
- * @brief Insert element from another %list.
- * @param position Iterator referencing the element to insert before.
- * @param x Source list.
- * @param i Iterator referencing the element to move.
- *
- * Removes the element in list @a x referenced by @a i and inserts it into the
- * current list before @a position.
- */
- void
- splice(iterator __position, list&, iterator __i)
- {
- iterator __j = __i;
- ++__j;
- if (__position == __i || __position == __j) return;
- this->_M_transfer(__position, __i, __j);
- }
-
- /**
- * @brief Insert range from another %list.
- * @param position Iterator referencing the element to insert before.
- * @param x Source list.
- * @param first Iterator referencing the start of range in x.
- * @param last Iterator referencing the end of range in x.
- *
- * Removes elements in the range [first,last) and inserts them before
- * @a position in constant time.
- *
- * Undefined if @a position is in [first,last).
- */
- void
- splice(iterator __position, list&, iterator __first, iterator __last)
- {
- if (__first != __last)
- this->_M_transfer(__position, __first, __last);
- }
-
- /**
- * @brief Remove all elements equal to value.
- * @param value The value to remove.
- *
- * Removes every element in the list equal to @a value. Remaining
- * elements stay in list order. Note that this function only erases the
- * elements, and that if the elements themselves are pointers, the
- * pointed-to memory is not touched in any way. Managing the pointer is
- * the user's responsibilty.
- */
- void
- remove(const _Tp& __value);
-
- /**
- * @brief Remove all elements satisfying a predicate.
- * @param Predicate Unary predicate function or object.
- *
- * Removes every element in the list for which the predicate returns
- * true. Remaining elements stay in list order. Note that this function
- * only erases the elements, and that if the elements themselves are
- * pointers, the pointed-to memory is not touched in any way. Managing
- * the pointer is the user's responsibilty.
- */
- template<typename _Predicate>
+ /**
+ * @brief Swaps data with another %list.
+ * @param x A %list of the same element and allocator types.
+ *
+ * This exchanges the elements between two lists in constant
+ * time. Note that the global std::swap() function is
+ * specialized such that std::swap(l1,l2) will feed to this
+ * function.
+ */
void
- remove_if(_Predicate);
-
- /**
- * @brief Remove consecutive duplicate elements.
- *
- * For each consecutive set of elements with the same value, remove all
- * but the first one. Remaining elements stay in list order. Note that
- * this function only erases the elements, and that if the elements
- * themselves are pointers, the pointed-to memory is not touched in any
- * way. Managing the pointer is the user's responsibilty.
- */
- void
- unique();
-
- /**
- * @brief Remove consecutive elements satisfying a predicate.
- * @param BinaryPredicate Binary predicate function or object.
- *
- * For each consecutive set of elements [first,last) that satisfy
- * predicate(first,i) where i is an iterator in [first,last), remove all
- * but the first one. Remaining elements stay in list order. Note that
- * this function only erases the elements, and that if the elements
- * themselves are pointers, the pointed-to memory is not touched in any
- * way. Managing the pointer is the user's responsibilty.
- */
- template<typename _BinaryPredicate>
+ swap(list& __x);
+
+ /**
+ * Erases all the elements. Note that this function only erases
+ * the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibilty.
+ */
void
- unique(_BinaryPredicate);
-
- /**
- * @brief Merge sorted lists.
- * @param x Sorted list to merge.
- *
- * Assumes that both @a x and this list are sorted according to
- * operator<(). Merges elements of @a x into this list in sorted order,
- * leaving @a x empty when complete. Elements in this list precede
- * elements in @a x that are equal.
- */
- void
- merge(list& __x);
-
- /**
- * @brief Merge sorted lists according to comparison function.
- * @param x Sorted list to merge.
- * @param StrictWeakOrdering Comparison function definining sort order.
- *
- * Assumes that both @a x and this list are sorted according to
- * StrictWeakOrdering. Merges elements of @a x into this list in sorted
- * order, leaving @a x empty when complete. Elements in this list precede
- * elements in @a x that are equivalent according to StrictWeakOrdering().
- */
- template<typename _StrictWeakOrdering>
+ clear() { _Base::_M_clear(); }
+
+ // [23.2.2.4] list operations
+ /**
+ * @brief Insert contents of another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ *
+ * The elements of @a x are inserted in constant time in front of
+ * the element referenced by @a position. @a x becomes an empty
+ * list.
+ */
void
- merge(list&, _StrictWeakOrdering);
-
- /**
- * @brief Reverse the elements in list.
- *
- * Reverse the order of elements in the list in linear time.
- */
- void
- reverse() { __List_base_reverse(&this->_M_node); }
-
- /**
- * @brief Sort the elements.
- *
- * Sorts the elements of this list in NlogN time. Equivalent elements
- * remain in list order.
- */
- void
- sort();
+ splice(iterator __position, list& __x)
+ {
+ if (!__x.empty())
+ this->_M_transfer(__position, __x.begin(), __x.end());
+ }
- /**
- * @brief Sort the elements according to comparison function.
- *
- * Sorts the elements of this list in NlogN time. Equivalent elements
- * remain in list order.
- */
- template<typename _StrictWeakOrdering>
+ /**
+ * @brief Insert element from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param i Iterator referencing the element to move.
+ *
+ * Removes the element in list @a x referenced by @a i and
+ * inserts it into the current list before @a position.
+ */
void
- sort(_StrictWeakOrdering);
-
- protected:
- // Internal assign functions follow.
+ splice(iterator __position, list&, iterator __i)
+ {
+ iterator __j = __i;
+ ++__j;
+ if (__position == __i || __position == __j) return;
+ this->_M_transfer(__position, __i, __j);
+ }
- // called by the range assign to implement [23.1.1]/9
- template<typename _Integer>
+ /**
+ * @brief Insert range from another %list.
+ * @param position Iterator referencing the element to insert before.
+ * @param x Source list.
+ * @param first Iterator referencing the start of range in x.
+ * @param last Iterator referencing the end of range in x.
+ *
+ * Removes elements in the range [first,last) and inserts them
+ * before @a position in constant time.
+ *
+ * Undefined if @a position is in [first,last).
+ */
void
- _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ splice(iterator __position, list&, iterator __first, iterator __last)
{
- _M_fill_assign(static_cast<size_type>(__n),
- static_cast<value_type>(__val));
+ if (__first != __last)
+ this->_M_transfer(__position, __first, __last);
}
- // called by the range assign to implement [23.1.1]/9
- template<typename _InputIterator>
+ /**
+ * @brief Remove all elements equal to value.
+ * @param value The value to remove.
+ *
+ * Removes every element in the list equal to @a value.
+ * Remaining elements stay in list order. Note that this
+ * function only erases the elements, and that if the elements
+ * themselves are pointers, the pointed-to memory is not
+ * touched in any way. Managing the pointer is the user's
+ * responsibilty.
+ */
void
- _M_assign_dispatch(_InputIterator __first, _InputIterator __last, __false_type);
-
- // Called by assign(n,t), and the range assign when it turns out to be the
- // same thing.
- void
- _M_fill_assign(size_type __n, const value_type& __val);
-
-
- // Internal insert functions follow.
+ remove(const _Tp& __value);
+
+ /**
+ * @brief Remove all elements satisfying a predicate.
+ * @param Predicate Unary predicate function or object.
+ *
+ * Removes every element in the list for which the predicate
+ * returns true. Remaining elements stay in list order. Note
+ * that this function only erases the elements, and that if the
+ * elements themselves are pointers, the pointed-to memory is
+ * not touched in any way. Managing the pointer is the user's
+ * responsibilty.
+ */
+ template<typename _Predicate>
+ void
+ remove_if(_Predicate);
- // called by the range insert to implement [23.1.1]/9
- template<typename _Integer>
+ /**
+ * @brief Remove consecutive duplicate elements.
+ *
+ * For each consecutive set of elements with the same value,
+ * remove all but the first one. Remaining elements stay in
+ * list order. Note that this function only erases the
+ * elements, and that if the elements themselves are pointers,
+ * the pointed-to memory is not touched in any way. Managing
+ * the pointer is the user's responsibilty.
+ */
+ void
+ unique();
+
+ /**
+ * @brief Remove consecutive elements satisfying a predicate.
+ * @param BinaryPredicate Binary predicate function or object.
+ *
+ * For each consecutive set of elements [first,last) that
+ * satisfy predicate(first,i) where i is an iterator in
+ * [first,last), remove all but the first one. Remaining
+ * elements stay in list order. Note that this function only
+ * erases the elements, and that if the elements themselves are
+ * pointers, the pointed-to memory is not touched in any way.
+ * Managing the pointer is the user's responsibilty.
+ */
+ template<typename _BinaryPredicate>
+ void
+ unique(_BinaryPredicate);
+
+ /**
+ * @brief Merge sorted lists.
+ * @param x Sorted list to merge.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * operator<(). Merges elements of @a x into this list in
+ * sorted order, leaving @a x empty when complete. Elements in
+ * this list precede elements in @a x that are equal.
+ */
void
- _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
- __true_type)
+ merge(list& __x);
+
+ /**
+ * @brief Merge sorted lists according to comparison function.
+ * @param x Sorted list to merge.
+ * @param StrictWeakOrdering Comparison function definining
+ * sort order.
+ *
+ * Assumes that both @a x and this list are sorted according to
+ * StrictWeakOrdering. Merges elements of @a x into this list
+ * in sorted order, leaving @a x empty when complete. Elements
+ * in this list precede elements in @a x that are equivalent
+ * according to StrictWeakOrdering().
+ */
+ template<typename _StrictWeakOrdering>
+ void
+ merge(list&, _StrictWeakOrdering);
+
+ /**
+ * @brief Reverse the elements in list.
+ *
+ * Reverse the order of elements in the list in linear time.
+ */
+ void
+ reverse() { __List_base_reverse(&this->_M_node); }
+
+ /**
+ * @brief Sort the elements.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ void
+ sort();
+
+ /**
+ * @brief Sort the elements according to comparison function.
+ *
+ * Sorts the elements of this list in NlogN time. Equivalent
+ * elements remain in list order.
+ */
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering);
+
+ protected:
+ // Internal assign functions follow.
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _Integer>
+ void
+ _M_assign_dispatch(_Integer __n, _Integer __val, __true_type)
+ {
+ _M_fill_assign(static_cast<size_type>(__n),
+ static_cast<value_type>(__val));
+ }
+
+ // Called by the range assign to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_assign_dispatch(_InputIterator __first, _InputIterator __last,
+ __false_type);
+
+ // Called by assign(n,t), and the range assign when it turns out
+ // to be the same thing.
+ void
+ _M_fill_assign(size_type __n, const value_type& __val);
+
+
+ // Internal insert functions follow.
+
+ // Called by the range insert to implement [23.1.1]/9
+ template<typename _Integer>
+ void
+ _M_insert_dispatch(iterator __pos, _Integer __n, _Integer __x,
+ __true_type)
+ {
+ _M_fill_insert(__pos, static_cast<size_type>(__n),
+ static_cast<value_type>(__x));
+ }
+
+ // Called by the range insert to implement [23.1.1]/9
+ template<typename _InputIterator>
+ void
+ _M_insert_dispatch(iterator __pos,
+ _InputIterator __first, _InputIterator __last,
+ __false_type)
+ {
+ for ( ; __first != __last; ++__first)
+ insert(__pos, *__first);
+ }
+
+ // Called by insert(p,n,x), and the range insert when it turns out
+ // to be the same thing.
+ void
+ _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
{
- _M_fill_insert(__pos, static_cast<size_type>(__n),
- static_cast<value_type>(__x));
+ for ( ; __n > 0; --__n)
+ insert(__pos, __x);
}
-
- // called by the range insert to implement [23.1.1]/9
- template<typename _InputIterator>
+
+
+ // Moves the elements from [first,last) before position.
void
- _M_insert_dispatch(iterator __pos,
- _InputIterator __first, _InputIterator __last,
- __false_type)
+ _M_transfer(iterator __position, iterator __first, iterator __last)
{
- for ( ; __first != __last; ++__first)
- insert(__pos, *__first);
+ if (__position != __last)
+ {
+ // Remove [first, last) from its old position.
+ __last._M_node->_M_prev->_M_next = __position._M_node;
+ __first._M_node->_M_prev->_M_next = __last._M_node;
+ __position._M_node->_M_prev->_M_next = __first._M_node;
+
+ // Splice [first, last) into its new position.
+ _List_node_base* __tmp = __position._M_node->_M_prev;
+ __position._M_node->_M_prev = __last._M_node->_M_prev;
+ __last._M_node->_M_prev = __first._M_node->_M_prev;
+ __first._M_node->_M_prev = __tmp;
+ }
}
-
- // Called by insert(p,n,x), and the range insert when it turns out to be
- // the same thing.
- void
- _M_fill_insert(iterator __pos, size_type __n, const value_type& __x)
- {
- for ( ; __n > 0; --__n)
- insert(__pos, __x);
- }
-
-
- // Moves the elements from [first,last) before position.
- void
- _M_transfer(iterator __position, iterator __first, iterator __last)
- {
- if (__position != __last) {
- // Remove [first, last) from its old position.
- __last._M_node->_M_prev->_M_next = __position._M_node;
- __first._M_node->_M_prev->_M_next = __last._M_node;
- __position._M_node->_M_prev->_M_next = __first._M_node;
-
- // Splice [first, last) into its new position.
- _List_node_base* __tmp = __position._M_node->_M_prev;
- __position._M_node->_M_prev = __last._M_node->_M_prev;
- __last._M_node->_M_prev = __first._M_node->_M_prev;
- __first._M_node->_M_prev = __tmp;
- }
- }
- };
+ };
/**
@@ -1105,12 +1073,12 @@ namespace std
* @param y A %list of the same type as @a x.
* @return True iff the size and elements of the lists are equal.
*
- * This is an equivalence relation. It is linear in the size of the
- * lists. Lists are considered equivalent if their sizes are equal,
- * and if corresponding elements compare equal.
+ * This is an equivalence relation. It is linear in the size of
+ * the lists. Lists are considered equivalent if their sizes are
+ * equal, and if corresponding elements compare equal.
*/
template<typename _Tp, typename _Alloc>
- inline bool
+ inline bool
operator==(const list<_Tp,_Alloc>& __x, const list<_Tp,_Alloc>& __y)
{
typedef typename list<_Tp,_Alloc>::const_iterator const_iterator;
@@ -1119,9 +1087,10 @@ namespace std
const_iterator __i1 = __x.begin();
const_iterator __i2 = __y.begin();
- while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2) {
- ++__i1;
- ++__i2;
+ while (__i1 != __end1 && __i2 != __end2 && *__i1 == *__i2)
+ {
+ ++__i1;
+ ++__i2;
}
return __i1 == __end1 && __i2 == __end2;
}
@@ -1174,6 +1143,6 @@ namespace std
inline void
swap(list<_Tp, _Alloc>& __x, list<_Tp, _Alloc>& __y)
{ __x.swap(__y); }
-} // namespace std
+} // namespace __gnu_norm
#endif /* _LIST_H */
diff --git a/libstdc++-v3/include/bits/stl_map.h b/libstdc++-v3/include/bits/stl_map.h
index 7b15dccae1d..9895cad0446 100644
--- a/libstdc++-v3/include/bits/stl_map.h
+++ b/libstdc++-v3/include/bits/stl_map.h
@@ -63,7 +63,7 @@
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
/**
* @brief A standard container made up of (key,value) pairs, which can be
@@ -653,6 +653,6 @@ namespace std
inline void
swap(map<_Key,_Tp,_Compare,_Alloc>& __x, map<_Key,_Tp,_Compare,_Alloc>& __y)
{ __x.swap(__y); }
-} // namespace std
+} // namespace __gnu_norm
#endif /* _MAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multimap.h b/libstdc++-v3/include/bits/stl_multimap.h
index ebc7ff9137b..4d892283bce 100644
--- a/libstdc++-v3/include/bits/stl_multimap.h
+++ b/libstdc++-v3/include/bits/stl_multimap.h
@@ -63,7 +63,7 @@
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -632,6 +632,6 @@ namespace std
swap(multimap<_Key,_Tp,_Compare,_Alloc>& __x,
multimap<_Key,_Tp,_Compare,_Alloc>& __y)
{ __x.swap(__y); }
-} // namespace std
+} // namespace __gnu_norm
#endif /* _MULTIMAP_H */
diff --git a/libstdc++-v3/include/bits/stl_multiset.h b/libstdc++-v3/include/bits/stl_multiset.h
index 49d8c4ea4f7..515ef5c040e 100644
--- a/libstdc++-v3/include/bits/stl_multiset.h
+++ b/libstdc++-v3/include/bits/stl_multiset.h
@@ -63,7 +63,7 @@
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
// Forward declaration of operators < and ==, needed for friend declaration.
@@ -100,10 +100,10 @@ private:
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing multiset
public:
- typedef typename _Rep_type::const_pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::const_reference reference;
- typedef typename _Rep_type::const_reference const_reference;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
@@ -256,6 +256,6 @@ inline void swap(multiset<_Key,_Compare,_Alloc>& __x,
__x.swap(__y);
}
-} // namespace std
+} // namespace __gnu_norm
#endif /* _MULTISET_H */
diff --git a/libstdc++-v3/include/bits/stl_numeric.h b/libstdc++-v3/include/bits/stl_numeric.h
index 4aa92edf91d..7b901a54315 100644
--- a/libstdc++-v3/include/bits/stl_numeric.h
+++ b/libstdc++-v3/include/bits/stl_numeric.h
@@ -61,6 +61,8 @@
#ifndef _STL_NUMERIC_H
#define _STL_NUMERIC_H 1
+#include <debug/debug.h>
+
namespace std
{
@@ -70,6 +72,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
__init = __init + *__first;
@@ -83,6 +86,7 @@ namespace std
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
for ( ; __first != __last; ++__first)
__init = __binary_op(__init, *__first);
@@ -97,6 +101,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __init + (*__first1 * *__first2);
@@ -114,6 +119,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator1>)
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator2>)
+ __glibcxx_requires_valid_range(__first1, __last1);
for ( ; __first1 != __last1; ++__first1, ++__first2)
__init = __binary_op1(__init, __binary_op2(*__first1, *__first2));
@@ -130,6 +136,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __result;
*__result = *__first;
@@ -151,6 +158,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __result;
*__result = *__first;
@@ -172,6 +180,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __result;
*__result = *__first;
@@ -194,6 +203,7 @@ namespace std
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator, _ValueType>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last) return __result;
*__result = *__first;
diff --git a/libstdc++-v3/include/bits/stl_queue.h b/libstdc++-v3/include/bits/stl_queue.h
index 0bb41acaf9f..441fc55ef4b 100644
--- a/libstdc++-v3/include/bits/stl_queue.h
+++ b/libstdc++-v3/include/bits/stl_queue.h
@@ -62,20 +62,21 @@
#define _QUEUE_H 1
#include <bits/concept_check.h>
+#include <debug/debug.h>
namespace std
{
// Forward declarations of operators < and ==, needed for friend declaration.
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class queue;
- template <typename _Tp, typename _Sequence = deque<_Tp> >
- class queue;
-
- template <typename _Tp, typename _Seq>
- inline bool operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
-
- template <typename _Tp, typename _Seq>
- inline bool operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const queue<_Tp,_Seq>&, const queue<_Tp,_Seq>&);
/**
* @brief A standard container giving FIFO behavior.
@@ -101,111 +102,133 @@ namespace std
* which is a typedef for the second Sequence parameter, and @c push and
* @c pop, which are standard %queue/FIFO operations.
*/
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
class queue
- {
- // concept requirements
- typedef typename _Sequence::value_type _Sequence_value_type;
- __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
- __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
- __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
- __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
-
- template <typename _Tp1, typename _Seq1>
- friend bool operator== (const queue<_Tp1, _Seq1>&,
- const queue<_Tp1, _Seq1>&);
- template <typename _Tp1, typename _Seq1>
- friend bool operator< (const queue<_Tp1, _Seq1>&,
- const queue<_Tp1, _Seq1>&);
-
- public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- protected:
- /**
- * 'c' is the underlying container. Maintainers wondering why this isn't
- * uglified as per style guidelines should note that this name is
- * specified in the standard, [23.2.3.1]. (Why? Presumably for the same
- * reason that it's protected instead of private: to allow derivation.
- * But none of the other containers allow for derivation. Odd.)
- */
- _Sequence c;
-
- public:
- /**
- * @brief Default constructor creates no elements.
- */
- explicit
- queue(const _Sequence& __c = _Sequence())
- : c(__c) {}
-
- /**
- * Returns true if the %queue is empty.
- */
- bool
- empty() const { return c.empty(); }
-
- /** Returns the number of elements in the %queue. */
- size_type
- size() const { return c.size(); }
-
- /**
- * Returns a read/write reference to the data at the first element of the
- * %queue.
- */
- reference
- front() { return c.front(); }
-
- /**
- * Returns a read-only (constant) reference to the data at the first
- * element of the %queue.
- */
- const_reference
- front() const { return c.front(); }
-
- /**
- * Returns a read/write reference to the data at the last element of the
- * %queue.
- */
- reference
- back() { return c.back(); }
-
- /**
- * Returns a read-only (constant) reference to the data at the last
- * element of the %queue.
- */
- const_reference
- back() const { return c.back(); }
-
- /**
- * @brief Add data to the end of the %queue.
- * @param x Data to be added.
- *
- * This is a typical %queue operation. The function creates an element at
- * the end of the %queue and assigns the given data to it.
- * The time complexity of the operation depends on the underlying
- * sequence.
- */
- void
- push(const value_type& __x) { c.push_back(__x); }
-
- /**
- * @brief Removes first element.
- *
- * This is a typical %queue operation. It shrinks the %queue by one.
- * The time complexity of the operation depends on the underlying
- * sequence.
- *
- * Note that no data is returned, and if the first element's data is
- * needed, it should be retrieved before pop() is called.
- */
- void
- pop() { c.pop_front(); }
- };
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _FrontInsertionSequenceConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const queue<_Tp1, _Seq1>&, const queue<_Tp1, _Seq1>&);
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ /**
+ * 'c' is the underlying container. Maintainers wondering why
+ * this isn't uglified as per style guidelines should note that
+ * this name is specified in the standard, [23.2.3.1]. (Why?
+ * Presumably for the same reason that it's protected instead
+ * of private: to allow derivation. But none of the other
+ * containers allow for derivation. Odd.)
+ */
+ _Sequence c;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ explicit
+ queue(const _Sequence& __c = _Sequence()) : c(__c) {}
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %queue.
+ */
+ reference
+ front()
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ front() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * Returns a read/write reference to the data at the last
+ * element of the %queue.
+ */
+ reference
+ back()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the last
+ * element of the %queue.
+ */
+ const_reference
+ back() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the end of the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation. The function creates an
+ * element at the end of the %queue and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x) { c.push_back(__x); }
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue by one.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_front();
+ }
+ };
/**
@@ -219,9 +242,10 @@ namespace std
* linear in the size of the sequences, and queues are considered equivalent
* if their sequences compare equal.
*/
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
- operator==(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
+ operator==(const queue<_Tp,_Sequence>& __x,
+ const queue<_Tp,_Sequence>& __y)
{ return __x.c == __y.c; }
/**
@@ -230,39 +254,43 @@ namespace std
* @param y A %queue of the same type as @a x.
* @return True iff @a x is lexicographically less than @a y.
*
- * This is an total ordering relation. Complexity and semantics depend on
- * the underlying sequence type, but the expected rules are: this relation
- * is linear in the size of the sequences, the elements must be comparable
- * with @c <, and std::lexicographical_compare() is usually used to make the
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
* determination.
*/
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
operator<(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __x.c < __y.c; }
/// Based on operator==
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
- operator!=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
+ operator!=(const queue<_Tp,_Sequence>& __x,
+ const queue<_Tp,_Sequence>& __y)
{ return !(__x == __y); }
/// Based on operator<
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
operator>(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
{ return __y < __x; }
/// Based on operator<
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
- operator<=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
+ operator<=(const queue<_Tp,_Sequence>& __x,
+ const queue<_Tp,_Sequence>& __y)
{ return !(__y < __x); }
/// Based on operator<
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
inline bool
- operator>=(const queue<_Tp,_Sequence>& __x, const queue<_Tp,_Sequence>& __y)
+ operator>=(const queue<_Tp,_Sequence>& __x,
+ const queue<_Tp,_Sequence>& __y)
{ return !(__x < __y); }
@@ -272,157 +300,169 @@ namespace std
* @ingroup Containers
* @ingroup Sequences
*
- * This is not a true container, but an @e adaptor. It holds another
- * container, and provides a wrapper interface to that container. The
- * wrapper is what enforces sorting and first-in-first-out %queue behavior.
- * Very few of the standard container/sequence interface requirements are
- * met (e.g., iterators).
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces sorting and
+ * first-in-first-out %queue behavior. Very few of the standard
+ * container/sequence interface requirements are met (e.g.,
+ * iterators).
*
* The second template parameter defines the type of the underlying
- * sequence/container. It defaults to std::vector, but it can be any type
- * that supports @c front(), @c push_back, @c pop_back, and random-access
- * iterators, such as std::deque or an appropriate user-defined type.
+ * sequence/container. It defaults to std::vector, but it can be
+ * any type that supports @c front(), @c push_back, @c pop_back,
+ * and random-access iterators, such as std::deque or an
+ * appropriate user-defined type.
*
- * The third template parameter supplies the means of making priority
- * comparisons. It defaults to @c less<value_type> but can be anything
- * defining a strict weak ordering.
+ * The third template parameter supplies the means of making
+ * priority comparisons. It defaults to @c less<value_type> but
+ * can be anything defining a strict weak ordering.
*
* Members not found in "normal" containers are @c container_type,
- * which is a typedef for the second Sequence parameter, and @c push,
- * @c pop, and @c top, which are standard %queue/FIFO operations.
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %queue/FIFO
+ * operations.
*
- * @note No equality/comparison operators are provided for %priority_queue.
+ * @note No equality/comparison operators are provided for
+ * %priority_queue.
*
- * @note Sorting of the elements takes place as they are added to, and
- * removed from, the %priority_queue using the %priority_queue's
- * member functions. If you access the elements by other means, and
- * change their data such that the sorting order would be different,
- * the %priority_queue will not re-sort the elements for you. (How
- * could it know to do so?)
+ * @note Sorting of the elements takes place as they are added to,
+ * and removed from, the %priority_queue using the
+ * %priority_queue's member functions. If you access the elements
+ * by other means, and change their data such that the sorting
+ * order would be different, the %priority_queue will not re-sort
+ * the elements for you. (How could it know to do so?)
*/
- template <typename _Tp, typename _Sequence = vector<_Tp>,
+ template<typename _Tp, typename _Sequence = vector<_Tp>,
typename _Compare = less<typename _Sequence::value_type> >
class priority_queue
- {
- // concept requirements
- typedef typename _Sequence::value_type _Sequence_value_type;
- __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
- __glibcxx_class_requires(_Sequence, _SequenceConcept)
- __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
- __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
- __glibcxx_class_requires4(_Compare, bool, _Tp, _Tp, _BinaryFunctionConcept)
-
- public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- protected:
- // See queue::c for notes on these names.
- _Sequence c;
- _Compare comp;
-
- public:
- /**
- * @brief Default constructor creates no elements.
- */
- explicit
- priority_queue(const _Compare& __x = _Compare(),
- const _Sequence& __s = _Sequence())
- : c(__s), comp(__x)
- { std::make_heap(c.begin(), c.end(), comp); }
-
- /**
- * @brief Builds a %queue from a range.
- * @param first An input iterator.
- * @param last An input iterator.
- * @param x A comparison functor describing a strict weak ordering.
- * @param s An initial sequence with which to start.
- *
- * Begins by copying @a s, inserting a copy of the elements from
- * @a [first,last) into the copy of @a s, then ordering the copy
- * according to @a x.
- *
- * For more information on function objects, see the documentation on
- * @link s20_3_1_base functor base classes@endlink.
- */
- template <typename _InputIterator>
- priority_queue(_InputIterator __first, _InputIterator __last,
- const _Compare& __x = _Compare(),
- const _Sequence& __s = _Sequence())
- : c(__s), comp(__x)
- {
- c.insert(c.end(), __first, __last);
- std::make_heap(c.begin(), c.end(), comp);
- }
-
- /**
- * Returns true if the %queue is empty.
- */
- bool
- empty() const { return c.empty(); }
-
- /** Returns the number of elements in the %queue. */
- size_type
- size() const { return c.size(); }
-
- /**
- * Returns a read-only (constant) reference to the data at the first
- * element of the %queue.
- */
- const_reference
- top() const { return c.front(); }
-
- /**
- * @brief Add data to the %queue.
- * @param x Data to be added.
- *
- * This is a typical %queue operation.
- * The time complexity of the operation depends on the underlying
- * sequence.
- */
- void
- push(const value_type& __x)
{
- try
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _SequenceConcept)
+ __glibcxx_class_requires(_Sequence, _RandomAccessContainerConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Tp,_Tp,_BinaryFunctionConcept)
+
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on these names.
+ _Sequence c;
+ _Compare comp;
+
+ public:
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ explicit
+ priority_queue(const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ { std::make_heap(c.begin(), c.end(), comp); }
+
+ /**
+ * @brief Builds a %queue from a range.
+ * @param first An input iterator.
+ * @param last An input iterator.
+ * @param x A comparison functor describing a strict weak ordering.
+ * @param s An initial sequence with which to start.
+ *
+ * Begins by copying @a s, inserting a copy of the elements
+ * from @a [first,last) into the copy of @a s, then ordering
+ * the copy according to @a x.
+ *
+ * For more information on function objects, see the
+ * documentation on @link s20_3_1_base functor base
+ * classes@endlink.
+ */
+ template<typename _InputIterator>
+ priority_queue(_InputIterator __first, _InputIterator __last,
+ const _Compare& __x = _Compare(),
+ const _Sequence& __s = _Sequence())
+ : c(__s), comp(__x)
+ {
+ __glibcxx_requires_valid_range(__first, __last);
+ c.insert(c.end(), __first, __last);
+ std::make_heap(c.begin(), c.end(), comp);
+ }
+
+ /**
+ * Returns true if the %queue is empty.
+ */
+ bool
+ empty() const { return c.empty(); }
+
+ /** Returns the number of elements in the %queue. */
+ size_type
+ size() const { return c.size(); }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %queue.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.front();
+ }
+
+ /**
+ * @brief Add data to the %queue.
+ * @param x Data to be added.
+ *
+ * This is a typical %queue operation.
+ * The time complexity of the operation depends on the underlying
+ * sequence.
+ */
+ void
+ push(const value_type& __x)
+ {
+ try
{
c.push_back(__x);
std::push_heap(c.begin(), c.end(), comp);
}
- catch(...)
+ catch(...)
{
c.clear();
__throw_exception_again;
}
- }
-
- /**
- * @brief Removes first element.
- *
- * This is a typical %queue operation. It shrinks the %queue by one.
- * The time complexity of the operation depends on the underlying
- * sequence.
- *
- * Note that no data is returned, and if the first element's data is
- * needed, it should be retrieved before pop() is called.
- */
- void
- pop()
- {
- try
+ }
+
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %queue operation. It shrinks the %queue
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ try
{
std::pop_heap(c.begin(), c.end(), comp);
c.pop_back();
}
- catch(...)
+ catch(...)
{
c.clear();
__throw_exception_again;
}
- }
- };
+ }
+ };
// No equality/comparison operators are provided for priority_queue.
} // namespace std
diff --git a/libstdc++-v3/include/bits/stl_set.h b/libstdc++-v3/include/bits/stl_set.h
index fa8c6cfb707..285d5ee2a85 100644
--- a/libstdc++-v3/include/bits/stl_set.h
+++ b/libstdc++-v3/include/bits/stl_set.h
@@ -63,46 +63,45 @@
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
-
-// Forward declarations of operators < and ==, needed for friend declaration.
-
-template <class _Key, class _Compare = less<_Key>,
- class _Alloc = allocator<_Key> >
-class set;
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator==(const set<_Key,_Compare,_Alloc>& __x,
- const set<_Key,_Compare,_Alloc>& __y);
-
-template <class _Key, class _Compare, class _Alloc>
-inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
- const set<_Key,_Compare,_Alloc>& __y);
-
-
-template <class _Key, class _Compare, class _Alloc>
-class set
-{
- // concept requirements
- __glibcxx_class_requires(_Key, _SGIAssignableConcept)
- __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept)
-
-public:
- // typedefs:
- typedef _Key key_type;
- typedef _Key value_type;
- typedef _Compare key_compare;
- typedef _Compare value_compare;
+ // Forward declarations of operators < and ==, needed for friend declaration.
+ template<class _Key, class _Compare = less<_Key>,
+ class _Alloc = allocator<_Key> >
+ class set;
+
+ template<class _Key, class _Compare, class _Alloc>
+ inline bool
+ operator==(const set<_Key,_Compare,_Alloc>& __x,
+ const set<_Key,_Compare,_Alloc>& __y);
+
+ template<class _Key, class _Compare, class _Alloc>
+ inline bool
+ operator<(const set<_Key,_Compare,_Alloc>& __x,
+ const set<_Key,_Compare,_Alloc>& __y);
+
+ template<class _Key, class _Compare, class _Alloc>
+ class set
+ {
+ // concept requirements
+ __glibcxx_class_requires(_Key, _SGIAssignableConcept)
+ __glibcxx_class_requires4(_Compare, bool, _Key, _Key, _BinaryFunctionConcept)
+
+ public:
+ // typedefs:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
private:
typedef _Rb_tree<key_type, value_type,
_Identity<value_type>, key_compare, _Alloc> _Rep_type;
_Rep_type _M_t; // red-black tree representing set
public:
- typedef typename _Rep_type::const_pointer pointer;
- typedef typename _Rep_type::const_pointer const_pointer;
- typedef typename _Rep_type::const_reference reference;
- typedef typename _Rep_type::const_reference const_reference;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
typedef typename _Rep_type::const_iterator iterator;
typedef typename _Rep_type::const_iterator const_iterator;
typedef typename _Rep_type::const_reverse_iterator reverse_iterator;
@@ -118,12 +117,12 @@ public:
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) {}
- template <class _InputIterator>
+ template<class _InputIterator>
set(_InputIterator __first, _InputIterator __last)
: _M_t(_Compare(), allocator_type())
{ _M_t.insert_unique(__first, __last); }
- template <class _InputIterator>
+ template<class _InputIterator>
set(_InputIterator __first, _InputIterator __last, const _Compare& __comp,
const allocator_type& __a = allocator_type())
: _M_t(__comp, __a) { _M_t.insert_unique(__first, __last); }
@@ -159,7 +158,7 @@ public:
typedef typename _Rep_type::iterator _Rep_iterator;
return _M_t.insert_unique((_Rep_iterator&)__position, __x);
}
- template <class _InputIterator>
+ template<class _InputIterator>
void insert(_InputIterator __first, _InputIterator __last) {
_M_t.insert_unique(__first, __last);
}
@@ -205,54 +204,54 @@ public:
return _M_t.equal_range(__x);
}
- template <class _K1, class _C1, class _A1>
+ 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>
+ template<class _K1, class _C1, class _A1>
friend bool operator< (const set<_K1,_C1,_A1>&, const set<_K1,_C1,_A1>&);
};
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator==(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __x._M_t == __y._M_t;
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator<(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __x._M_t < __y._M_t;
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator!=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__x == __y);
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator>(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return __y < __x;
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator<=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__y < __x);
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline bool operator>=(const set<_Key,_Compare,_Alloc>& __x,
const set<_Key,_Compare,_Alloc>& __y) {
return !(__x < __y);
}
-template <class _Key, class _Compare, class _Alloc>
+template<class _Key, class _Compare, class _Alloc>
inline void swap(set<_Key,_Compare,_Alloc>& __x,
set<_Key,_Compare,_Alloc>& __y) {
__x.swap(__y);
}
-} // namespace std
+} // namespace __gnu_norm
#endif /* _SET_H */
diff --git a/libstdc++-v3/include/bits/stl_stack.h b/libstdc++-v3/include/bits/stl_stack.h
index b9847ceb6ad..d72755a9fae 100644
--- a/libstdc++-v3/include/bits/stl_stack.h
+++ b/libstdc++-v3/include/bits/stl_stack.h
@@ -62,20 +62,22 @@
#define _STACK_H 1
#include <bits/concept_check.h>
+#include <debug/debug.h>
namespace std
{
- // Forward declarations of operators == and <, needed for friend declaration.
+ // Forward declarations of operators == and <, needed for friend
+ // declaration.
+ template<typename _Tp, typename _Sequence = deque<_Tp> >
+ class stack;
- template <typename _Tp, typename _Sequence = deque<_Tp> >
- class stack;
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
- template <typename _Tp, typename _Seq>
- inline bool operator==(const stack<_Tp,_Seq>& __x,
- const stack<_Tp,_Seq>& __y);
-
- template <typename _Tp, typename _Seq>
- inline bool operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
+ template<typename _Tp, typename _Seq>
+ inline bool
+ operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y);
/**
@@ -89,104 +91,120 @@ namespace std
* but does not define anything to do with iterators. Very few of the
* other standard container interfaces are defined.
*
- * This is not a true container, but an @e adaptor. It holds another
- * container, and provides a wrapper interface to that container. The
- * wrapper is what enforces strict first-in-last-out %stack behavior.
+ * This is not a true container, but an @e adaptor. It holds
+ * another container, and provides a wrapper interface to that
+ * container. The wrapper is what enforces strict
+ * first-in-last-out %stack behavior.
*
* The second template parameter defines the type of the underlying
- * sequence/container. It defaults to std::deque, but it can be any type
- * that supports @c back, @c push_back, and @c pop_front, such as
- * std::list, std::vector, or an appropriate user-defined type.
+ * sequence/container. It defaults to std::deque, but it can be
+ * any type that supports @c back, @c push_back, and @c pop_front,
+ * such as std::list, std::vector, or an appropriate user-defined
+ * type.
*
* Members not found in "normal" containers are @c container_type,
- * which is a typedef for the second Sequence parameter, and @c push,
- * @c pop, and @c top, which are standard %stack/FILO operations.
+ * which is a typedef for the second Sequence parameter, and @c
+ * push, @c pop, and @c top, which are standard %stack/FILO
+ * operations.
*/
- template <typename _Tp, typename _Sequence>
+ template<typename _Tp, typename _Sequence>
class stack
- {
- // concept requirements
- typedef typename _Sequence::value_type _Sequence_value_type;
- __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
- __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
- __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
-
- template <typename _Tp1, typename _Seq1>
- friend bool operator== (const stack<_Tp1, _Seq1>&,
- const stack<_Tp1, _Seq1>&);
- template <typename _Tp1, typename _Seq1>
- friend bool operator< (const stack<_Tp1, _Seq1>&,
- const stack<_Tp1, _Seq1>&);
-
- public:
- typedef typename _Sequence::value_type value_type;
- typedef typename _Sequence::reference reference;
- typedef typename _Sequence::const_reference const_reference;
- typedef typename _Sequence::size_type size_type;
- typedef _Sequence container_type;
-
- protected:
- // See queue::c for notes on this name.
- _Sequence c;
-
- public:
- // XXX removed old def ctor, added def arg to this one to match 14882
- /**
- * @brief Default constructor creates no elements.
- */
- explicit
- stack(const _Sequence& __c = _Sequence())
- : c(__c) {}
+ {
+ // concept requirements
+ typedef typename _Sequence::value_type _Sequence_value_type;
+ __glibcxx_class_requires(_Tp, _SGIAssignableConcept)
+ __glibcxx_class_requires(_Sequence, _BackInsertionSequenceConcept)
+ __glibcxx_class_requires2(_Tp, _Sequence_value_type, _SameTypeConcept)
- /**
- * Returns true if the %stack is empty.
- */
- bool
- empty() const { return c.empty(); }
-
- /** Returns the number of elements in the %stack. */
- size_type
- size() const { return c.size(); }
-
- /**
- * Returns a read/write reference to the data at the first element of the
- * %stack.
- */
- reference
- top() { return c.back(); }
-
- /**
- * Returns a read-only (constant) reference to the data at the first
- * element of the %stack.
- */
- const_reference
- top() const { return c.back(); }
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator==(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
+
+ template<typename _Tp1, typename _Seq1>
+ friend bool
+ operator<(const stack<_Tp1, _Seq1>&, const stack<_Tp1, _Seq1>&);
- /**
- * @brief Add data to the top of the %stack.
- * @param x Data to be added.
- *
- * This is a typical %stack operation. The function creates an element at
- * the top of the %stack and assigns the given data to it.
- * The time complexity of the operation depends on the underlying
- * sequence.
- */
- void
- push(const value_type& __x) { c.push_back(__x); }
+ public:
+ typedef typename _Sequence::value_type value_type;
+ typedef typename _Sequence::reference reference;
+ typedef typename _Sequence::const_reference const_reference;
+ typedef typename _Sequence::size_type size_type;
+ typedef _Sequence container_type;
+
+ protected:
+ // See queue::c for notes on this name.
+ _Sequence c;
+
+ public:
+ // XXX removed old def ctor, added def arg to this one to match 14882
+ /**
+ * @brief Default constructor creates no elements.
+ */
+ explicit
+ stack(const _Sequence& __c = _Sequence()) : c(__c) {}
+
+ /**
+ * Returns true if the %stack is empty.
+ */
+ bool
+ empty() const { return c.empty(); }
+
+ /** Returns the number of elements in the %stack. */
+ size_type
+ size() const { return c.size(); }
+
+ /**
+ * Returns a read/write reference to the data at the first
+ * element of the %stack.
+ */
+ reference
+ top()
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * Returns a read-only (constant) reference to the data at the first
+ * element of the %stack.
+ */
+ const_reference
+ top() const
+ {
+ __glibcxx_requires_nonempty();
+ return c.back();
+ }
+
+ /**
+ * @brief Add data to the top of the %stack.
+ * @param x Data to be added.
+ *
+ * This is a typical %stack operation. The function creates an
+ * element at the top of the %stack and assigns the given data
+ * to it. The time complexity of the operation depends on the
+ * underlying sequence.
+ */
+ void
+ push(const value_type& __x) { c.push_back(__x); }
- /**
- * @brief Removes first element.
- *
- * This is a typical %stack operation. It shrinks the %stack by one.
- * The time complexity of the operation depends on the underlying
- * sequence.
- *
- * Note that no data is returned, and if the first element's data is
- * needed, it should be retrieved before pop() is called.
- */
- void
- pop() { c.pop_back(); }
- };
+ /**
+ * @brief Removes first element.
+ *
+ * This is a typical %stack operation. It shrinks the %stack
+ * by one. The time complexity of the operation depends on the
+ * underlying sequence.
+ *
+ * Note that no data is returned, and if the first element's
+ * data is needed, it should be retrieved before pop() is
+ * called.
+ */
+ void
+ pop()
+ {
+ __glibcxx_requires_nonempty();
+ c.pop_back();
+ }
+ };
/**
@@ -195,12 +213,13 @@ namespace std
* @param y A %stack of the same type as @a x.
* @return True iff the size and elements of the stacks are equal.
*
- * This is an equivalence relation. Complexity and semantics depend on the
- * underlying sequence type, but the expected rules are: this relation is
- * linear in the size of the sequences, and stacks are considered equivalent
- * if their sequences compare equal.
+ * This is an equivalence relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, and
+ * stacks are considered equivalent if their sequences compare
+ * equal.
*/
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator==(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return __x.c == __y.c; }
@@ -211,37 +230,38 @@ namespace std
* @param y A %stack of the same type as @a x.
* @return True iff @a x is lexicographically less than @a y.
*
- * This is an total ordering relation. Complexity and semantics depend on
- * the underlying sequence type, but the expected rules are: this relation
- * is linear in the size of the sequences, the elements must be comparable
- * with @c <, and std::lexicographical_compare() is usually used to make the
+ * This is an total ordering relation. Complexity and semantics
+ * depend on the underlying sequence type, but the expected rules
+ * are: this relation is linear in the size of the sequences, the
+ * elements must be comparable with @c <, and
+ * std::lexicographical_compare() is usually used to make the
* determination.
*/
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator<(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return __x.c < __y.c; }
/// Based on operator==
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator!=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return !(__x == __y); }
/// Based on operator<
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator>(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return __y < __x; }
/// Based on operator<
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator<=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return !(__y < __x); }
/// Based on operator<
- template <typename _Tp, typename _Seq>
+ template<typename _Tp, typename _Seq>
inline bool
operator>=(const stack<_Tp,_Seq>& __x, const stack<_Tp,_Seq>& __y)
{ return !(__x < __y); }
diff --git a/libstdc++-v3/include/bits/stl_tree.h b/libstdc++-v3/include/bits/stl_tree.h
index fd81a6755cd..d0739e10a57 100644
--- a/libstdc++-v3/include/bits/stl_tree.h
+++ b/libstdc++-v3/include/bits/stl_tree.h
@@ -261,79 +261,14 @@ namespace std
_Rb_tree_rebalance_for_erase(_Rb_tree_node_base* const __z,
_Rb_tree_node_base& __header);
- // Base class to encapsulate the differences between old SGI-style
- // allocators and standard-conforming allocators. In order to avoid
- // having an empty base class, we arbitrarily move one of rb_tree's
- // data members into the base class.
-
- // _Base for general standard-conforming allocators.
- template<typename _Tp, typename _Alloc, bool _S_instanceless>
- class _Rb_tree_alloc_base
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
-
- allocator_type
- get_allocator() const { return _M_node_allocator; }
-
- _Rb_tree_alloc_base(const allocator_type& __a)
- : _M_node_allocator(__a) {}
-
- protected:
- typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::allocator_type
- _M_node_allocator;
-
- _Rb_tree_node_base _M_header;
-
- _Rb_tree_node<_Tp>*
- _M_get_node() { return _M_node_allocator.allocate(1); }
-
- void
- _M_put_node(_Rb_tree_node<_Tp>* __p)
- { _M_node_allocator.deallocate(__p, 1); }
- };
-
- // Specialization for instanceless allocators.
- template<typename _Tp, typename _Alloc>
- class _Rb_tree_alloc_base<_Tp, _Alloc, true>
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Alloc>::allocator_type allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Rb_tree_alloc_base(const allocator_type&) {}
-
- protected:
- _Rb_tree_node_base _M_header;
-
- typedef typename _Alloc_traits<_Rb_tree_node<_Tp>, _Alloc>::_Alloc_type
- _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); }
- };
-
- template<typename _Tp, typename _Alloc>
- struct _Rb_tree_base : public _Rb_tree_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- {
- typedef _Rb_tree_alloc_base<_Tp,
- _Alloc, _Alloc_traits<_Tp, _Alloc>::_S_instanceless> _Base;
- typedef typename _Base::allocator_type allocator_type;
-
- _Rb_tree_base(const allocator_type& __a)
- : _Base(__a) {}
- };
-
template<typename _Key, typename _Val, typename _KeyOfValue,
typename _Compare, typename _Alloc = allocator<_Val> >
- class _Rb_tree : protected _Rb_tree_base<_Val, _Alloc>
+ class _Rb_tree
+ : protected _Alloc::template rebind<_Rb_tree_node<_Val> >::other
{
- typedef _Rb_tree_base<_Val, _Alloc> _Base;
+ typedef typename _Alloc::template rebind<_Rb_tree_node<_Val> >::other
+ _Node_allocator;
protected:
typedef _Rb_tree_node_base* _Base_ptr;
@@ -352,18 +287,22 @@ namespace std
typedef size_t size_type;
typedef ptrdiff_t difference_type;
- typedef typename _Base::allocator_type allocator_type;
- allocator_type get_allocator() const { return _Base::get_allocator(); }
+ typedef _Alloc allocator_type;
+ allocator_type get_allocator() const {
+ return *static_cast<const _Node_allocator*>(this);
+ }
protected:
- using _Base::_M_get_node;
- using _Base::_M_put_node;
- using _Base::_M_header;
+ _Rb_tree_node*
+ _M_get_node() { return _Node_allocator::allocate(1); }
+
+ void
+ _M_put_node(_Rb_tree_node* __p) { _Node_allocator::deallocate(__p, 1); }
_Link_type
_M_create_node(const value_type& __x)
{
- _Link_type __tmp = this->_M_get_node();
+ _Link_type __tmp = _M_get_node();
try
{ std::_Construct(&__tmp->_M_value_field, __x); }
catch(...)
@@ -391,9 +330,12 @@ namespace std
_M_put_node(__p);
}
+ protected:
+ _Rb_tree_node_base _M_header;
size_type _M_node_count; // keeps track of size of tree
_Compare _M_key_compare;
-
+
+ protected:
_Base_ptr&
_M_root() { return this->_M_header._M_parent; }
@@ -485,20 +427,27 @@ namespace std
public:
// allocation/deallocation
_Rb_tree()
- : _Base(allocator_type()), _M_node_count(0), _M_key_compare()
+ : _Node_allocator(allocator_type()),
+ _M_node_count(0),
+ _M_key_compare()
{ _M_empty_initialize(); }
_Rb_tree(const _Compare& __comp)
- : _Base(allocator_type()), _M_node_count(0), _M_key_compare(__comp)
+ : _Node_allocator(allocator_type()),
+ _M_node_count(0),
+ _M_key_compare(__comp)
{ _M_empty_initialize(); }
_Rb_tree(const _Compare& __comp, const allocator_type& __a)
- : _Base(__a), _M_node_count(0), _M_key_compare(__comp)
+ : _Node_allocator(__a),
+ _M_node_count(0),
+ _M_key_compare(__comp)
{ _M_empty_initialize(); }
_Rb_tree(const _Rb_tree<_Key,_Val,_KeyOfValue,_Compare,_Alloc>& __x)
- : _Base(__x.get_allocator()), _M_node_count(0),
- _M_key_compare(__x._M_key_compare)
+ : _Node_allocator(__x.get_allocator()),
+ _M_node_count(0),
+ _M_key_compare(__x._M_key_compare)
{
if (__x._M_root() == 0)
_M_empty_initialize();
diff --git a/libstdc++-v3/include/bits/stl_vector.h b/libstdc++-v3/include/bits/stl_vector.h
index e911697210d..de9c1a341b9 100644
--- a/libstdc++-v3/include/bits/stl_vector.h
+++ b/libstdc++-v3/include/bits/stl_vector.h
@@ -65,72 +65,8 @@
#include <bits/functexcept.h>
#include <bits/concept_check.h>
-namespace std
+namespace __gnu_norm
{
- /// @if maint Primary default version. @endif
- /**
- * @if maint
- * See bits/stl_deque.h's _Deque_alloc_base for an explanation.
- * @endif
- */
- template<typename _Tp, typename _Allocator, bool _IsStatic>
- class _Vector_alloc_base
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
-
- allocator_type
- get_allocator() const { return _M_data_allocator; }
-
- _Vector_alloc_base(const allocator_type& __a)
- : _M_data_allocator(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0)
- { }
-
- protected:
- allocator_type _M_data_allocator;
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- _Tp*
- _M_allocate(size_t __n) { return _M_data_allocator.allocate(__n); }
-
- void
- _M_deallocate(_Tp* __p, size_t __n)
- { if (__p) _M_data_allocator.deallocate(__p, __n); }
- };
-
- /// @if maint Specialization for instanceless allocators. @endif
- template<typename _Tp, typename _Allocator>
- class _Vector_alloc_base<_Tp, _Allocator, true>
- {
- public:
- typedef typename _Alloc_traits<_Tp, _Allocator>::allocator_type
- allocator_type;
-
- allocator_type
- get_allocator() const { return allocator_type(); }
-
- _Vector_alloc_base(const allocator_type&)
- : _M_start(0), _M_finish(0), _M_end_of_storage(0)
- { }
-
- protected:
- _Tp* _M_start;
- _Tp* _M_finish;
- _Tp* _M_end_of_storage;
-
- typedef typename _Alloc_traits<_Tp, _Allocator>::_Alloc_type _Alloc_type;
-
- _Tp*
- _M_allocate(size_t __n) { return _Alloc_type::allocate(__n); }
-
- void
- _M_deallocate(_Tp* __p, size_t __n) { _Alloc_type::deallocate(__p, __n);}
- };
-
-
/**
* @if maint
* See bits/stl_deque.h's _Deque_base for an explanation.
@@ -138,20 +74,19 @@ namespace std
*/
template<typename _Tp, typename _Alloc>
struct _Vector_base
- : public _Vector_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
+ : public _Alloc
{
public:
- typedef _Vector_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
+ typedef _Alloc allocator_type;
+
+ allocator_type
+ get_allocator() const { return *static_cast<const _Alloc*>(this); }
_Vector_base(const allocator_type& __a)
- : _Base(__a) { }
+ : _Alloc(__a), _M_start(0), _M_finish(0), _M_end_of_storage(0) { }
_Vector_base(size_t __n, const allocator_type& __a)
- : _Base(__a)
+ : _Alloc(__a)
{
this->_M_start = this->_M_allocate(__n);
this->_M_finish = this->_M_start;
@@ -161,6 +96,18 @@ namespace std
~_Vector_base()
{ _M_deallocate(this->_M_start,
this->_M_end_of_storage - this->_M_start); }
+
+ public:
+ _Tp* _M_start;
+ _Tp* _M_finish;
+ _Tp* _M_end_of_storage;
+
+ _Tp*
+ _M_allocate(size_t __n) { return _Alloc::allocate(__n); }
+
+ void
+ _M_deallocate(_Tp* __p, size_t __n)
+ { if (__p) _Alloc::deallocate(__p, __n); }
};
@@ -209,8 +156,7 @@ namespace std
protected:
/** @if maint
* These two functions and three data members are all from the
- * top-most base class, which varies depending on the type of
- * %allocator. They should be pretty self-explanatory, as
+ * base class. They should be pretty self-explanatory, as
* %vector uses a simple contiguous allocation scheme. @endif
*/
using _Base::_M_allocate;
@@ -347,8 +293,7 @@ namespace std
}
/// Get a copy of the memory allocation object.
- allocator_type
- get_allocator() const { return _Base::get_allocator(); }
+ using _Base::get_allocator;
// iterators
/**
@@ -966,6 +911,6 @@ namespace std
inline void
swap(vector<_Tp,_Alloc>& __x, vector<_Tp,_Alloc>& __y)
{ __x.swap(__y); }
-} // namespace std
+} // namespace __gnu_norm
#endif /* _VECTOR_H */
diff --git a/libstdc++-v3/include/bits/stream_iterator.h b/libstdc++-v3/include/bits/stream_iterator.h
index dcbf9f01d91..cc67505dd69 100644
--- a/libstdc++-v3/include/bits/stream_iterator.h
+++ b/libstdc++-v3/include/bits/stream_iterator.h
@@ -37,6 +37,8 @@
#pragma GCC system_header
+#include <debug/debug.h>
+
namespace std
{
template<typename _Tp, typename _CharT = char,
@@ -65,18 +67,33 @@ namespace std
{ }
const _Tp&
- operator*() const { return _M_value; }
+ operator*() const
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_deref_istream)
+ ._M_iterator(*this));
+ return _M_value;
+ }
const _Tp*
operator->() const { return &(operator*()); }
istream_iterator&
operator++()
- { _M_read(); return *this; }
+ {
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
+ _M_read();
+ return *this;
+ }
istream_iterator
operator++(int)
{
+ __glibcxx_requires_cond(_M_ok,
+ _M_message(__gnu_debug::__msg_inc_istream)
+ ._M_iterator(*this));
istream_iterator __tmp = *this;
_M_read();
return __tmp;
@@ -138,6 +155,9 @@ namespace std
ostream_iterator&
operator=(const _Tp& __value)
{
+ __glibcxx_requires_cond(_M_stream != 0,
+ _M_message(__gnu_debug::__msg_output_ostream)
+ ._M_iterator(*this));
*_M_stream << __value;
if (_M_string) *_M_stream << _M_string;
return *this;
diff --git a/libstdc++-v3/include/bits/streambuf.tcc b/libstdc++-v3/include/bits/streambuf.tcc
index 2fac3508e33..4cc9bf1590a 100644
--- a/libstdc++-v3/include/bits/streambuf.tcc
+++ b/libstdc++-v3/include/bits/streambuf.tcc
@@ -113,42 +113,31 @@ namespace std
// necessary.
template<typename _CharT, typename _Traits>
streamsize
- __copy_streambufs(basic_ios<_CharT, _Traits>& __ios,
- basic_streambuf<_CharT, _Traits>* __sbin,
+ __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout)
{
streamsize __ret = 0;
- try
+ typename _Traits::int_type __c = __sbin->sgetc();
+ while (!_Traits::eq_int_type(__c, _Traits::eof()))
{
- typename _Traits::int_type __c = __sbin->sgetc();
- while (!_Traits::eq_int_type(__c, _Traits::eof()))
+ const size_t __n = __sbin->egptr() - __sbin->gptr();
+ if (__n > 1)
{
- const size_t __n = __sbin->egptr() - __sbin->gptr();
- if (__n > 1)
- {
- const size_t __wrote = __sbout->sputn(__sbin->gptr(),
- __n);
- __sbin->gbump(__wrote);
- __ret += __wrote;
- if (__wrote < __n)
- break;
- __c = __sbin->underflow();
- }
- else
- {
- __c = __sbout->sputc(_Traits::to_char_type(__c));
- if (_Traits::eq_int_type(__c, _Traits::eof()))
- break;
- ++__ret;
- __c = __sbin->snextc();
- }
+ const size_t __wrote = __sbout->sputn(__sbin->gptr(), __n);
+ __sbin->gbump(__wrote);
+ __ret += __wrote;
+ if (__wrote < __n)
+ break;
+ __c = __sbin->underflow();
+ }
+ else
+ {
+ __c = __sbout->sputc(_Traits::to_char_type(__c));
+ if (_Traits::eq_int_type(__c, _Traits::eof()))
+ break;
+ ++__ret;
+ __c = __sbin->snextc();
}
- }
- catch(exception& __fail)
- {
- __ios.setstate(ios_base::failbit);
- if ((__ios.exceptions() & ios_base::failbit) != 0)
- __throw_exception_again;
}
return __ret;
}
@@ -160,15 +149,13 @@ namespace std
extern template class basic_streambuf<char>;
extern template
streamsize
- __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
- basic_streambuf<char>*);
+ __copy_streambufs(basic_streambuf<char>*, basic_streambuf<char>*);
#ifdef _GLIBCXX_USE_WCHAR_T
extern template class basic_streambuf<wchar_t>;
extern template
streamsize
- __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
- basic_streambuf<wchar_t>*);
+ __copy_streambufs(basic_streambuf<wchar_t>*, basic_streambuf<wchar_t>*);
#endif
#endif
} // namespace std
diff --git a/libstdc++-v3/include/bits/streambuf_iterator.h b/libstdc++-v3/include/bits/streambuf_iterator.h
index 51d8384b54d..3c393e3f955 100644
--- a/libstdc++-v3/include/bits/streambuf_iterator.h
+++ b/libstdc++-v3/include/bits/streambuf_iterator.h
@@ -39,6 +39,7 @@
#pragma GCC system_header
#include <streambuf>
+#include <debug/debug.h>
// NB: Should specialize copy, find algorithms for streambuf iterators.
@@ -82,11 +83,23 @@ namespace std
// NB: The result of operator*() on an end of stream is undefined.
char_type
operator*() const
- { return traits_type::to_char_type(_M_get()); }
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ // Dereferencing a past-the-end istreambuf_iterator is a
+ // libstdc++ extension
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_deref_istreambuf)
+ ._M_iterator(*this));
+#endif
+ return traits_type::to_char_type(_M_get());
+ }
istreambuf_iterator&
operator++()
{
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
const int_type __eof = traits_type::eof();
if (_M_sbuf && traits_type::eq_int_type(_M_sbuf->sbumpc(), __eof))
_M_sbuf = 0;
@@ -98,6 +111,10 @@ namespace std
istreambuf_iterator
operator++(int)
{
+ __glibcxx_requires_cond(!_M_at_eof(),
+ _M_message(__gnu_debug::__msg_inc_istreambuf)
+ ._M_iterator(*this));
+
const int_type __eof = traits_type::eof();
istreambuf_iterator __old = *this;
if (_M_sbuf
@@ -116,8 +133,8 @@ namespace std
equal(const istreambuf_iterator& __b) const
{
const int_type __eof = traits_type::eof();
- bool __thiseof = traits_type::eq_int_type(_M_get(), __eof);
- bool __beof = traits_type::eq_int_type(__b._M_get(), __eof);
+ bool __thiseof = _M_at_eof();
+ bool __beof = __b._M_at_eof();
return (__thiseof && __beof || (!__thiseof && !__beof));
}
@@ -137,6 +154,13 @@ namespace std
}
return __ret;
}
+
+ bool
+ _M_at_eof() const
+ {
+ const int_type __eof = traits_type::eof();
+ return traits_type::eq_int_type(_M_get(), __eof);
+ }
};
template<typename _CharT, typename _Traits>
@@ -183,15 +207,15 @@ namespace std
}
ostreambuf_iterator&
- operator*() throw()
+ operator*()
{ return *this; }
ostreambuf_iterator&
- operator++(int) throw()
+ operator++(int)
{ return *this; }
ostreambuf_iterator&
- operator++() throw()
+ operator++()
{ return *this; }
bool
diff --git a/libstdc++-v3/include/bits/vector.tcc b/libstdc++-v3/include/bits/vector.tcc
index 181b3596243..6342743266a 100644
--- a/libstdc++-v3/include/bits/vector.tcc
+++ b/libstdc++-v3/include/bits/vector.tcc
@@ -61,7 +61,7 @@
#ifndef _VECTOR_TCC
#define _VECTOR_TCC 1
-namespace std
+namespace __gnu_norm
{
template<typename _Tp, typename _Alloc>
void
@@ -432,7 +432,8 @@ namespace std
{
__new_finish = std::uninitialized_copy(iterator(this->_M_start),
__position, __new_start);
- __new_finish = std::uninitialized_copy(__first, __last, __new_finish);
+ __new_finish = std::uninitialized_copy(__first, __last,
+ __new_finish);
__new_finish = std::uninitialized_copy(__position,
iterator(this->_M_finish),
__new_finish);
@@ -452,6 +453,6 @@ namespace std
}
}
}
-} // namespace std
+} // namespace __gnu_norm
#endif /* _VECTOR_TCC */
diff --git a/libstdc++-v3/include/c/std_cctype.h b/libstdc++-v3/include/c/std_cctype.h
index c007db9a9bd..3231f481fcf 100644
--- a/libstdc++-v3/include/c/std_cctype.h
+++ b/libstdc++-v3/include/c/std_cctype.h
@@ -38,4 +38,4 @@
#include_next <ctype.h>
-#endif
+#endif
diff --git a/libstdc++-v3/include/c/std_cmath.h b/libstdc++-v3/include/c/std_cmath.h
index 07d15ec9953..fcaa7594c97 100644
--- a/libstdc++-v3/include/c/std_cmath.h
+++ b/libstdc++-v3/include/c/std_cmath.h
@@ -33,7 +33,7 @@
#ifndef _GLIBCXX_CMATH
#define _GLIBCXX_CMATH 1
-
+
#pragma GCC system_header
#include <bits/c++config.h>
@@ -79,7 +79,7 @@
#undef islessgreater
#undef isunordered
-namespace std
+namespace std
{
inline double
abs(double __x)
@@ -94,10 +94,10 @@ namespace std
{ return __builtin_fabsl(__x); }
#if _GLIBCXX_HAVE_MODFF
- inline float
+ inline float
modf(float __x, float* __iptr) { return modff(__x, __iptr); }
#else
- inline float
+ inline float
modf(float __x, float* __iptr)
{
double __tmp;
@@ -108,12 +108,12 @@ namespace std
#endif
#if _GLIBCXX_HAVE_MODFL
- inline long double
+ 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)
- {
+ 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);
diff --git a/libstdc++-v3/include/c/std_cstdlib.h b/libstdc++-v3/include/c/std_cstdlib.h
index 47e972fb93b..90b2f106576 100644
--- a/libstdc++-v3/include/c/std_cstdlib.h
+++ b/libstdc++-v3/include/c/std_cstdlib.h
@@ -38,4 +38,4 @@
#include_next <stdlib.h>
-#endif
+#endif
diff --git a/libstdc++-v3/include/c/std_cwchar.h b/libstdc++-v3/include/c/std_cwchar.h
index 5b3451933e7..0d2f6be5491 100644
--- a/libstdc++-v3/include/c/std_cwchar.h
+++ b/libstdc++-v3/include/c/std_cwchar.h
@@ -49,9 +49,9 @@
#ifndef _GLIBCXX_HAVE_MBSTATE_T
namespace std
{
- extern "C"
+ extern "C"
{
- typedef struct
+ typedef struct
{
int __fill[6];
} mbstate_t;
@@ -59,4 +59,4 @@ namespace std
}
#endif
-#endif
+#endif
diff --git a/libstdc++-v3/include/c/std_cwctype.h b/libstdc++-v3/include/c/std_cwctype.h
index c01073a2e0a..9302864828c 100644
--- a/libstdc++-v3/include/c/std_cwctype.h
+++ b/libstdc++-v3/include/c/std_cwctype.h
@@ -42,4 +42,4 @@
#include_next <wctype.h>
#endif
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_compatibility/iso646.h b/libstdc++-v3/include/c_compatibility/iso646.h
index c7a5fbba251..83c536431f7 100644
--- a/libstdc++-v3/include/c_compatibility/iso646.h
+++ b/libstdc++-v3/include/c_compatibility/iso646.h
@@ -32,4 +32,4 @@
#include <ciso646>
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_compatibility/limits.h b/libstdc++-v3/include/c_compatibility/limits.h
index 75fb82b58c0..d9a753c1c6e 100644
--- a/libstdc++-v3/include/c_compatibility/limits.h
+++ b/libstdc++-v3/include/c_compatibility/limits.h
@@ -32,4 +32,4 @@
#include <climits>
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_compatibility/locale.h b/libstdc++-v3/include/c_compatibility/locale.h
index d93e0ec7017..549bd7d5ea3 100644
--- a/libstdc++-v3/include/c_compatibility/locale.h
+++ b/libstdc++-v3/include/c_compatibility/locale.h
@@ -36,4 +36,4 @@ using std::lconv;
using std::setlocale;
using std::localeconv;
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_compatibility/stdio.h b/libstdc++-v3/include/c_compatibility/stdio.h
index 97171407e34..2686a728035 100644
--- a/libstdc++-v3/include/c_compatibility/stdio.h
+++ b/libstdc++-v3/include/c_compatibility/stdio.h
@@ -33,7 +33,7 @@
#include <cstdio>
using std::FILE;
-using std::fpos_t;
+using std::fpos_t;
using std::remove;
using std::rename;
diff --git a/libstdc++-v3/include/c_compatibility/string.h b/libstdc++-v3/include/c_compatibility/string.h
index ebbf6f5c298..a399f60b34b 100644
--- a/libstdc++-v3/include/c_compatibility/string.h
+++ b/libstdc++-v3/include/c_compatibility/string.h
@@ -55,4 +55,4 @@ using std::memset;
using std::strerror;
using std::strlen;
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_compatibility/time.h b/libstdc++-v3/include/c_compatibility/time.h
index 5d330c7ab3f..0e7e2ad917b 100644
--- a/libstdc++-v3/include/c_compatibility/time.h
+++ b/libstdc++-v3/include/c_compatibility/time.h
@@ -31,7 +31,7 @@
#define _GLIBCXX_TIME_H 1
#include <ctime>
-
+
// Get rid of those macros defined in <time.h> in lieu of real functions.
#undef clock
#undef difftime
diff --git a/libstdc++-v3/include/c_compatibility/wchar.h b/libstdc++-v3/include/c_compatibility/wchar.h
index b07e58f4f55..a962ff2ffb9 100644
--- a/libstdc++-v3/include/c_compatibility/wchar.h
+++ b/libstdc++-v3/include/c_compatibility/wchar.h
@@ -52,15 +52,15 @@ using std::swscanf;
using std::vfwprintf;
#if _GLIBCXX_HAVE_VFWSCANF
using std::vfwscanf;
-#endif
+#endif
using std::vswprintf;
#if _GLIBCXX_HAVE_VSWSCANF
using std::vswscanf;
-#endif
+#endif
using std::vwprintf;
#if _GLIBCXX_HAVE_VWSCANF
using std::vwscanf;
-#endif
+#endif
using std::wprintf;
using std::wscanf;
using std::getwc;
@@ -77,7 +77,7 @@ using std::wcrtomb;
using std::wcstod;
#if _GLIBCXX_HAVE_WCSTOF
using std::wcstof;
-#endif
+#endif
using std::wcstol;
using std::wcstoul;
using std::wcscpy;
diff --git a/libstdc++-v3/include/c_compatibility/wctype.h b/libstdc++-v3/include/c_compatibility/wctype.h
index 16b7c750d39..6086f3d6235 100644
--- a/libstdc++-v3/include/c_compatibility/wctype.h
+++ b/libstdc++-v3/include/c_compatibility/wctype.h
@@ -52,4 +52,4 @@ using std::towupper;
using std::wctrans;
using std::wctype;
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_std/cmath.tcc b/libstdc++-v3/include/c_std/cmath.tcc
index a7bdf227b11..0ff9ed74b31 100644
--- a/libstdc++-v3/include/c_std/cmath.tcc
+++ b/libstdc++-v3/include/c_std/cmath.tcc
@@ -32,7 +32,7 @@
#ifndef _GLIBCXX_CMATH_TCC
#define _GLIBCXX_CMATH_TCC 1
-namespace std
+namespace std
{
template<typename _Tp>
_Tp
diff --git a/libstdc++-v3/include/c_std/std_cassert.h b/libstdc++-v3/include/c_std/std_cassert.h
index 06a0577acbd..9fc1079b82a 100644
--- a/libstdc++-v3/include/c_std/std_cassert.h
+++ b/libstdc++-v3/include/c_std/std_cassert.h
@@ -1,6 +1,6 @@
// -*- C++ -*- forwarding header.
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
diff --git a/libstdc++-v3/include/c_std/std_cctype.h b/libstdc++-v3/include/c_std/std_cctype.h
index 02978622d82..65a4214657c 100644
--- a/libstdc++-v3/include/c_std/std_cctype.h
+++ b/libstdc++-v3/include/c_std/std_cctype.h
@@ -80,4 +80,4 @@ namespace std
using ::toupper;
}
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_std/std_cmath.h b/libstdc++-v3/include/c_std/std_cmath.h
index 7edf7581f55..66866b2cc3a 100644
--- a/libstdc++-v3/include/c_std/std_cmath.h
+++ b/libstdc++-v3/include/c_std/std_cmath.h
@@ -77,92 +77,8 @@
#undef tan
#undef tanh
-// ...and in the darkness bind them...
-namespace __gnu_cxx
-{
- namespace __c99_binding
- {
-#if _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_CHECK || \
- _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC
- extern "C" float (acosf)(float);
- extern "C" float (asinf)(float);
- extern "C" float (atanf)(float);
- extern "C" float (atan2f)(float, float);
- extern "C" float (ceilf)(float);
- extern "C" float (coshf)(float);
- extern "C" float (expf)(float);
- extern "C" float (floorf)(float);
- extern "C" float (fmodf)(float, float);
- extern "C" float (frexpf)(float, int*);
- extern "C" float (ldexpf)(float, int);
- extern "C" float (logf)(float);
- extern "C" float (log10f)(float);
- extern "C" float (modff)(float, float*);
- extern "C" float (powf)(float, float);
- extern "C" float (sinhf)(float);
- extern "C" float (tanf)(float);
- extern "C" float (tanhf)(float);
-#endif
-#if !_GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC
-#if _GLIBCXX_HAVE_ACOSF
- using ::acosf;
-#endif
-#if _GLIBCXX_HAVE_ASINF
- using ::asinf;
-#endif
-#if _GLIBCXX_HAVE_ATANF
- using ::atanf;
-#endif
-#if _GLIBCXX_HAVE_ATAN2F
- using ::atan2f;
-#endif
-#if _GLIBCXX_HAVE_CEILF
- using ::ceilf;
-#endif
-#if _GLIBCXX_HAVE_COSHF
- using ::coshf;
-#endif
-#if _GLIBCXX_HAVE_EXPF
- using ::expf;
-#endif
-#if _GLIBCXX_HAVE_FLOORF
- using ::floorf;
-#endif
-#if _GLIBCXX_HAVE_FMODF
- using ::fmodf;
-#endif
-#if _GLIBCXX_HAVE_FREXPF
- using ::frexpf;
-#endif
-#if _GLIBCXX_HAVE_LDEXPF
- using ::ldexpf;
-#endif
-#if _GLIBCXX_HAVE_LOGF
- using ::logf;
-#endif
-#if _GLIBCXX_HAVE_LOG10F
- using ::log10f;
-#endif
-#if _GLIBCXX_HAVE_MODFF
- using ::modff;
-#endif
-#if _GLIBCXX_HAVE_POWF
- using ::powf;
-#endif
-#if _GLIBCXX_HAVE_SINHF
- using ::sinhf;
-#endif
-#if _GLIBCXX_HAVE_TANF
- using ::tanf;
-#endif
-#if _GLIBCXX_HAVE_TANHF
- using ::tanhf;
-#endif
-#endif /* _GLIBCXX_USE_C99_FLOAT_TRANSCENDENTALS_DYNAMIC */
- }
-}
-namespace std
+namespace std
{
// Forward declaration of a helper function. This really should be
// an `exported' forward declaration.
@@ -180,126 +96,84 @@ namespace std
abs(long double __x)
{ return __builtin_fabsl(__x); }
-#if _GLIBCXX_HAVE_ACOSF
- inline float
- acos(float __x) { return __gnu_cxx::__c99_binding::acosf(__x); }
-#else
- inline float
- acos(float __x) { return ::acos(static_cast<double>(__x)); }
-#endif
-
using ::acos;
-
-#if _GLIBCXX_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
+
+ inline float
+ acos(float __x)
+ { return __builtin_acosf(__x); }
+
+ inline long double
+ acos(long double __x)
+ { return __builtin_acosl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
acos(_Tp __x)
{
- return ::acos(static_cast<double>(__x));
+ return __builtin_acos(__x);
}
-
+
using ::asin;
-#if _GLIBCXX_HAVE_ASINF
- inline float
- asin(float __x) { return __gnu_cxx::__c99_binding::asinf(__x); }
-#else
- inline float
- asin(float __x) { return ::asin(static_cast<double>(__x)); }
-#endif
+ inline float
+ asin(float __x)
+ { return __builtin_asinf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ asin(long double __x)
+ { return __builtin_asinl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
asin(_Tp __x)
- { return ::asin(static_cast<double>(__x)); }
+ { return __builtin_asin(__x); }
using ::atan;
-#if _GLIBCXX_HAVE_ATANF
- inline float
- atan(float __x) { return __gnu_cxx::__c99_binding::atanf(__x); }
-#else
- inline float
- atan(float __x) { return ::atan(static_cast<double>(__x)); }
-#endif
+ inline float
+ atan(float __x)
+ { return __builtin_atanf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ atan(long double __x)
+ { return __builtin_atanl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
atan(_Tp __x)
- { return ::atan(static_cast<double>(__x)); }
-
+ { return __builtin_atan(__x); }
+
using ::atan2;
-#if _GLIBCXX_HAVE_ATAN2F
- inline float
- atan2(float __y, float __x) { return __gnu_cxx::__c99_binding::atan2f(__y, __x); }
-#else
- inline float
+ inline float
atan2(float __y, float __x)
- { return ::atan2(static_cast<double>(__y), static_cast<double>(__x)); }
-#endif
+ { return __builtin_atan2f(__y, __x); }
-#if _GLIBCXX_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
+ inline long double
+ atan2(long double __y, long double __x)
+ { return __builtin_atan2l(__y, __x); }
template<typename _Tp, typename _Up>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type
&& __is_integer<_Up>::_M_type>::_M_type
- atan2(_Tp __x, _Up __y)
- { return ::atan2(static_cast<double>(__x), static_cast<double>(__y)); }
+ atan2(_Tp __y, _Up __x)
+ { return __builtin_atan2(__y, __x); }
using ::ceil;
-#if _GLIBCXX_HAVE_CEILF
- inline float
- ceil(float __x) { return __gnu_cxx::__c99_binding::ceilf(__x); }
-#else
- inline float
- ceil(float __x) { return ::ceil(static_cast<double>(__x)); }
-#endif
+ inline float
+ ceil(float __x)
+ { return __builtin_ceilf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ ceil(long double __x)
+ { return __builtin_ceill(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
ceil(_Tp __x)
- { return ::ceil(static_cast<double>(__x)); }
-
+ { return __builtin_ceil(__x); }
+
using ::cos;
inline float
@@ -317,50 +191,34 @@ namespace std
using ::cosh;
-#if _GLIBCXX_HAVE_COSHF
- inline float
- cosh(float __x) { return __gnu_cxx::__c99_binding::coshf(__x); }
-#else
- inline float
- cosh(float __x) { return ::cosh(static_cast<double>(__x)); }
-#endif
+ inline float
+ cosh(float __x)
+ { return __builtin_coshf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ cosh(long double __x)
+ { return __builtin_coshl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
cosh(_Tp __x)
- { return ::cosh(static_cast<double>(__x)); }
+ { return __builtin_cosh(__x); }
using ::exp;
-#if _GLIBCXX_HAVE_EXPF
- inline float
- exp(float __x) { return __gnu_cxx::__c99_binding::expf(__x); }
-#else
- inline float
- exp(float __x) { return ::exp(static_cast<double>(__x)); }
-#endif
+ inline float
+ exp(float __x)
+ { return __builtin_expf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ exp(long double __x)
+ { return __builtin_expl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
exp(_Tp __x)
- { return ::exp(static_cast<double>(__x)); }
-
+ { return __builtin_exp(__x); }
+
using ::fabs;
inline float
@@ -378,171 +236,98 @@ namespace std
using ::floor;
-#if _GLIBCXX_HAVE_FLOORF
- inline float
- floor(float __x) { return __gnu_cxx::__c99_binding::floorf(__x); }
-#else
- inline float
- floor(float __x) { return ::floor(static_cast<double>(__x)); }
-#endif
+ inline float
+ floor(float __x)
+ { return __builtin_floorf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ floor(long double __x)
+ { return __builtin_floorl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
floor(_Tp __x)
- { return ::floor(static_cast<double>(__x)); }
-
+ { return __builtin_floor(__x); }
+
using ::fmod;
-#if _GLIBCXX_HAVE_FMODF
- inline float
- fmod(float __x, float __y) { return __gnu_cxx::__c99_binding::fmodf(__x, __y); }
-#else
- inline float
+ inline float
fmod(float __x, float __y)
- { return ::fmod(static_cast<double>(__x), static_cast<double>(__y)); }
-#endif
+ { return __builtin_fmodf(__x, __y); }
-#if _GLIBCXX_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
+ inline long double
+ fmod(long double __x, long double __y)
+ { return __builtin_fmodl(__x, __y); }
using ::frexp;
-#if _GLIBCXX_HAVE_FREXPF
- inline float
- frexp(float __x, int* __exp) { return __gnu_cxx::__c99_binding::frexpf(__x, __exp); }
-#else
- inline float
- frexp(float __x, int* __exp) { return ::frexp(__x, __exp); }
-#endif
+ inline float
+ frexp(float __x, int* __exp)
+ { return __builtin_frexpf(__x, __exp); }
-#if _GLIBCXX_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
+ inline long double
+ frexp(long double __x, int* __exp)
+ { return __builtin_frexpl(__x, __exp); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
frexp(_Tp __x, int* __exp)
- { return ::frexp(static_cast<double>(__x), __exp); }
-
+ { return __builtin_frexp(__x, __exp); }
+
using ::ldexp;
-#if _GLIBCXX_HAVE_LDEXPF
- inline float
- ldexp(float __x, int __exp) { return __gnu_cxx::__c99_binding::ldexpf(__x, __exp); }
-#else
- inline float
+ inline float
ldexp(float __x, int __exp)
- { return ::ldexp(static_cast<double>(__x), __exp); }
-#endif
+ { return __builtin_ldexpf(__x, __exp); }
-#if _GLIBCXX_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
+ inline long double
+ ldexp(long double __x, int __exp)
+ { return __builtin_ldexpl(__x, __exp); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
ldexp(_Tp __x, int __exp)
- { return ::ldexp(static_cast<double>(__x), __exp); }
+ { return __builtin_ldexp(__x, __exp); }
using ::log;
-#if _GLIBCXX_HAVE_LOGF
- inline float
- log(float __x) { return __gnu_cxx::__c99_binding::logf(__x); }
-#else
- inline float log(float __x)
- { return ::log(static_cast<double>(__x)); }
-#endif
+ inline float
+ log(float __x)
+ { return __builtin_logf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ log(long double __x)
+ { return __builtin_logl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
log(_Tp __x)
- { return ::log(static_cast<double>(__x)); }
-
+ { return __builtin_log(__x); }
+
using ::log10;
-#if _GLIBCXX_HAVE_LOG10F
- inline float
- log10(float __x) { return __gnu_cxx::__c99_binding::log10f(__x); }
-#else
- inline float
- log10(float __x) { return ::log10(static_cast<double>(__x)); }
-#endif
+ inline float
+ log10(float __x)
+ { return __builtin_log10f(__x); }
-#if _GLIBCXX_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
+ inline long double
+ log10(long double __x)
+ { return __builtin_log10l(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
log10(_Tp __x)
- { return ::log10(static_cast<double>(__x)); }
-
+ { return __builtin_log10(__x); }
+
using ::modf;
-#if _GLIBCXX_HAVE_MODFF
- inline float
- modf(float __x, float* __iptr) { return __gnu_cxx::__c99_binding::modff(__x, __iptr); }
-#else
- inline float
+ inline float
modf(float __x, float* __iptr)
- {
- double __tmp;
- double __res = ::modf(static_cast<double>(__x), &__tmp);
- *__iptr = static_cast<float>(__tmp);
- return __res;
- }
-#endif
+ { return __builtin_modff(__x, __iptr); }
-#if _GLIBCXX_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
+ inline long double
+ modf(long double __x, long double* __iptr)
+ { return __builtin_modfl(__x, __iptr); }
template<typename _Tp>
inline _Tp
@@ -555,33 +340,23 @@ namespace std
using ::pow;
-#if _GLIBCXX_HAVE_POWF
- inline float
- pow(float __x, float __y) { return __gnu_cxx::__c99_binding::powf(__x, __y); }
-#else
- inline float
+ inline float
pow(float __x, float __y)
- { return ::pow(static_cast<double>(__x), static_cast<double>(__y)); }
-#endif
+ { return __builtin_powf(__x, __y); }
-#if _GLIBCXX_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
+ inline long double
+ pow(long double __x, long double __y)
+ { return __builtin_powl(__x, __y); }
- inline double
+ inline double
pow(double __x, int __i)
{ return __pow_helper(__x, __i); }
- inline float
+ inline float
pow(float __x, int __n)
{ return __pow_helper(__x, __n); }
- inline long double
+ inline long double
pow(long double __x, int __n)
{ return __pow_helper(__x, __n); }
@@ -602,27 +377,19 @@ namespace std
using ::sinh;
-#if _GLIBCXX_HAVE_SINHF
- inline float
- sinh(float __x) { return __gnu_cxx::__c99_binding::sinhf(__x); }
-#else
- inline float
- sinh(float __x) { return ::sinh(static_cast<double>(__x)); }
-#endif
+ inline float
+ sinh(float __x)
+ { return __builtin_sinhf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ sinh(long double __x)
+ { return __builtin_sinhl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
sinh(_Tp __x)
- { return ::sinh(static_cast<_Tp>(__x)); }
-
+ { return __builtin_sinh(__x); }
+
using ::sqrt;
inline float
@@ -637,113 +404,96 @@ namespace std
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
sqrt(_Tp __x)
{ return __builtin_sqrt(__x); }
-
+
using ::tan;
-#if _GLIBCXX_HAVE_TANF
- inline float
- tan(float __x) { return __gnu_cxx::__c99_binding::tanf(__x); }
-#else
- inline float
- tan(float __x) { return ::tan(static_cast<double>(__x)); }
-#endif
+ inline float
+ tan(float __x)
+ { return __builtin_tanf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ tan(long double __x)
+ { return __builtin_tanl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
tan(_Tp __x)
- { return ::tan(static_cast<double>(__x)); }
-
+ { return __builtin_tan(__x); }
+
using ::tanh;
-#if _GLIBCXX_HAVE_TANHF
- inline float
- tanh(float __x) { return __gnu_cxx::__c99_binding::tanhf(__x); }
-#else
- inline float
- tanh(float __x) { return ::tanh(static_cast<double>(__x)); }
-#endif
+ inline float
+ tanh(float __x)
+ { return __builtin_tanhf(__x); }
-#if _GLIBCXX_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
+ inline long double
+ tanh(long double __x)
+ { return __builtin_tanhl(__x); }
template<typename _Tp>
inline typename __enable_if<double, __is_integer<_Tp>::_M_type>::_M_type
tanh(_Tp __x)
- { return ::tanh(static_cast<double>(__x)); }
-}
-
+ { return __builtin_tanh(__x); }
+}
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
// 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, and sequester them in the __gnu_cxx extension namespace.
namespace __gnu_cxx
{
template<typename _Tp>
- int
+ int
__capture_fpclassify(_Tp __f) { return fpclassify(__f); }
template<typename _Tp>
- int
+ int
__capture_isfinite(_Tp __f) { return isfinite(__f); }
template<typename _Tp>
- int
+ int
__capture_isinf(_Tp __f) { return isinf(__f); }
template<typename _Tp>
- int
+ int
__capture_isnan(_Tp __f) { return isnan(__f); }
template<typename _Tp>
- int
+ int
__capture_isnormal(_Tp __f) { return isnormal(__f); }
template<typename _Tp>
- int
+ int
__capture_signbit(_Tp __f) { return signbit(__f); }
template<typename _Tp>
- int
+ int
__capture_isgreater(_Tp __f1, _Tp __f2)
{ return isgreater(__f1, __f2); }
template<typename _Tp>
- int
- __capture_isgreaterequal(_Tp __f1, _Tp __f2)
+ int
+ __capture_isgreaterequal(_Tp __f1, _Tp __f2)
{ return isgreaterequal(__f1, __f2); }
template<typename _Tp>
- int
+ int
__capture_isless(_Tp __f1, _Tp __f2) { return isless(__f1, __f2); }
template<typename _Tp>
- int
- __capture_islessequal(_Tp __f1, _Tp __f2)
+ int
+ __capture_islessequal(_Tp __f1, _Tp __f2)
{ return islessequal(__f1, __f2); }
template<typename _Tp>
- int
- __capture_islessgreater(_Tp __f1, _Tp __f2)
+ int
+ __capture_islessgreater(_Tp __f1, _Tp __f2)
{ return islessgreater(__f1, __f2); }
template<typename _Tp>
- int
- __capture_isunordered(_Tp __f1, _Tp __f2)
+ int
+ __capture_isunordered(_Tp __f1, _Tp __f2)
{ return isunordered(__f1, __f2); }
}
@@ -763,7 +513,7 @@ namespace __gnu_cxx
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
-#if _GLIBCXX_USE_C99
+#if _GLIBCXX_USE_C99_MATH
#if !_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC
namespace __gnu_cxx
{
@@ -776,47 +526,47 @@ namespace __gnu_cxx
isfinite(_Tp __f) { return __capture_isfinite(__f); }
template<typename _Tp>
- int
+ int
isinf(_Tp __f) { return __capture_isinf(__f); }
template<typename _Tp>
- int
+ int
isnan(_Tp __f) { return __capture_isnan(__f); }
template<typename _Tp>
- int
+ int
isnormal(_Tp __f) { return __capture_isnormal(__f); }
template<typename _Tp>
- int
+ int
signbit(_Tp __f) { return __capture_signbit(__f); }
template<typename _Tp>
- int
+ int
isgreater(_Tp __f1, _Tp __f2) { return __capture_isgreater(__f1, __f2); }
template<typename _Tp>
- int
- isgreaterequal(_Tp __f1, _Tp __f2)
+ int
+ isgreaterequal(_Tp __f1, _Tp __f2)
{ return __capture_isgreaterequal(__f1, __f2); }
template<typename _Tp>
- int
+ int
isless(_Tp __f1, _Tp __f2) { return __capture_isless(__f1, __f2); }
template<typename _Tp>
- int
- islessequal(_Tp __f1, _Tp __f2)
+ int
+ islessequal(_Tp __f1, _Tp __f2)
{ return __capture_islessequal(__f1, __f2); }
template<typename _Tp>
- int
- islessgreater(_Tp __f1, _Tp __f2)
+ int
+ islessgreater(_Tp __f1, _Tp __f2)
{ return __capture_islessgreater(__f1, __f2); }
template<typename _Tp>
- int
- isunordered(_Tp __f1, _Tp __f2)
+ int
+ isunordered(_Tp __f1, _Tp __f2)
{ return __capture_isunordered(__f1, __f2); }
}
@@ -837,7 +587,7 @@ namespace std
}
#endif /* _GLIBCXX_USE_C99_FP_MACROS_DYNAMIC */
#endif
-
+
#ifndef _GLIBCXX_EXPORT_TEMPLATE
# include <bits/cmath.tcc>
#endif
diff --git a/libstdc++-v3/include/c_std/std_cstddef.h b/libstdc++-v3/include/c_std/std_cstddef.h
index a171c5a9765..4fa82c6aa9b 100644
--- a/libstdc++-v3/include/c_std/std_cstddef.h
+++ b/libstdc++-v3/include/c_std/std_cstddef.h
@@ -47,7 +47,7 @@
#include <stddef.h>
-namespace std
+namespace std
{
using ::ptrdiff_t;
using ::size_t;
diff --git a/libstdc++-v3/include/c_std/std_cstdio.h b/libstdc++-v3/include/c_std/std_cstdio.h
index 331dc15b0f7..f31e58e6f24 100644
--- a/libstdc++-v3/include/c_std/std_cstdio.h
+++ b/libstdc++-v3/include/c_std/std_cstdio.h
@@ -94,7 +94,7 @@
#undef vprintf
#undef vsprintf
-namespace std
+namespace std
{
using ::FILE;
using ::fpos_t;
@@ -180,6 +180,6 @@ namespace std
using __gnu_cxx::vsnprintf;
using __gnu_cxx::vsscanf;
}
-#endif
+#endif
#endif
diff --git a/libstdc++-v3/include/c_std/std_cstdlib.h b/libstdc++-v3/include/c_std/std_cstdlib.h
index 14b3b909086..d2d6e37064b 100644
--- a/libstdc++-v3/include/c_std/std_cstdlib.h
+++ b/libstdc++-v3/include/c_std/std_cstdlib.h
@@ -81,7 +81,7 @@
#undef wcstombs
#undef wctomb
-namespace std
+namespace std
{
using ::div_t;
using ::ldiv_t;
@@ -117,14 +117,14 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
using ::wcstombs;
using ::wctomb;
-#endif // _GLIBCXX_USE_WCHAR_T
+#endif // _GLIBCXX_USE_WCHAR_T
- inline long
+ inline long
abs(long __i) { return labs(__i); }
inline ldiv_t
div(long __i, long __j) { return ldiv(__i, __j); }
-}
+}
#if _GLIBCXX_USE_C99
@@ -149,18 +149,18 @@ namespace __gnu_cxx
using ::_Exit;
#endif
- inline long long
+ inline long long
abs(long long __x) { return __x >= 0 ? __x : -__x; }
- inline long long
+ inline long long
llabs(long long __x) { return __x >= 0 ? __x : -__x; }
#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
- inline lldiv_t
+ inline lldiv_t
div(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
- inline lldiv_t
+ inline lldiv_t
lldiv(long long __n, long long __d)
{ lldiv_t __q; __q.quot = __n / __d; __q.rem = __n % __d; return __q; }
#endif
@@ -178,18 +178,18 @@ namespace __gnu_cxx
using ::strtoull;
#endif
using ::strtof;
- using ::strtold;
-}
+ using ::strtold;
+}
namespace std
{
-#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
using __gnu_cxx::lldiv_t;
#endif
using __gnu_cxx::_Exit;
using __gnu_cxx::abs;
- using __gnu_cxx::llabs;
-#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
+ using __gnu_cxx::llabs;
+#if !_GLIBCXX_USE_C99_LONG_LONG_DYNAMIC
using __gnu_cxx::div;
using __gnu_cxx::lldiv;
#endif
@@ -201,4 +201,4 @@ namespace std
}
#endif
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_std/std_cstring.h b/libstdc++-v3/include/c_std/std_cstring.h
index 4436db69240..dad40c290ad 100644
--- a/libstdc++-v3/include/c_std/std_cstring.h
+++ b/libstdc++-v3/include/c_std/std_cstring.h
@@ -74,7 +74,7 @@
#undef strerror
#undef strlen
-namespace std
+namespace std
{
using ::memcpy;
using ::memmove;
diff --git a/libstdc++-v3/include/c_std/std_cwchar.h b/libstdc++-v3/include/c_std/std_cwchar.h
index e199224ff33..e3b7cdd5870 100644
--- a/libstdc++-v3/include/c_std/std_cwchar.h
+++ b/libstdc++-v3/include/c_std/std_cwchar.h
@@ -57,16 +57,16 @@
// 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 _GLIBCXX_HAVE_MBSTATE_T
-extern "C"
+extern "C"
{
- typedef struct
+ typedef struct
{
int __fill[6];
} mbstate_t;
}
#endif
-namespace std
+namespace std
{
using ::mbstate_t;
}
@@ -94,15 +94,15 @@ namespace std
#undef vfwprintf
#if _GLIBCXX_HAVE_VFWSCANF
# undef vfwscanf
-#endif
+#endif
#undef vswprintf
#if _GLIBCXX_HAVE_VSWSCANF
# undef vswscanf
-#endif
+#endif
#undef vwprintf
#if _GLIBCXX_HAVE_VWSCANF
# undef vwscanf
-#endif
+#endif
#undef wcrtomb
#undef wcscat
#undef wcschr
@@ -123,7 +123,7 @@ namespace std
#undef wcstod
#if _GLIBCXX_HAVE_WCSTOF
# undef wcstof
-#endif
+#endif
#undef wcstok
#undef wcstol
#undef wcstoul
@@ -164,15 +164,15 @@ namespace std
using ::vfwprintf;
#if _GLIBCXX_HAVE_VFWSCANF
using ::vfwscanf;
-#endif
+#endif
using ::vswprintf;
#if _GLIBCXX_HAVE_VSWSCANF
using ::vswscanf;
-#endif
+#endif
using ::vwprintf;
#if _GLIBCXX_HAVE_VWSCANF
using ::vwscanf;
-#endif
+#endif
using ::wcrtomb;
using ::wcscat;
using ::wcscmp;
@@ -189,7 +189,7 @@ namespace std
using ::wcstod;
#if _GLIBCXX_HAVE_WCSTOF
using ::wcstof;
-#endif
+#endif
using ::wcstok;
using ::wcstol;
using ::wcstoul;
@@ -270,4 +270,4 @@ namespace std
#endif //_GLIBCXX_USE_WCHAR_T
-#endif
+#endif
diff --git a/libstdc++-v3/include/c_std/std_cwctype.h b/libstdc++-v3/include/c_std/std_cwctype.h
index 79cd8018cf0..970c53a8f3d 100644
--- a/libstdc++-v3/include/c_std/std_cwctype.h
+++ b/libstdc++-v3/include/c_std/std_cwctype.h
@@ -57,7 +57,7 @@
#undef iswalpha
#if _GLIBCXX_HAVE_ISWBLANK
# undef iswblank
-#endif
+#endif
#undef iswcntrl
#undef iswdigit
#undef iswgraph
@@ -68,7 +68,7 @@
#undef iswspace
#undef iswupper
#undef iswxdigit
-#undef iswctype
+#undef iswctype
#undef towlower
#undef towupper
#undef towctrans
@@ -78,7 +78,7 @@
#if _GLIBCXX_USE_WCHAR_T
namespace std
{
- using ::wint_t; // cwchar
+ using ::wint_t; // cwchar
using ::wctype_t;
using ::wctrans_t;
@@ -87,7 +87,7 @@ namespace std
using ::iswalpha;
#if _GLIBCXX_HAVE_ISWBLANK
using ::iswblank;
-#endif
+#endif
using ::iswcntrl;
using ::iswdigit;
using ::iswgraph;
@@ -107,4 +107,4 @@ namespace std
}
#endif //_GLIBCXX_USE_WCHAR_T
-#endif
+#endif
diff --git a/libstdc++-v3/include/debug/bitset b/libstdc++-v3/include/debug/bitset
new file mode 100644
index 00000000000..89244226dd7
--- /dev/null
+++ b/libstdc++-v3/include/debug/bitset
@@ -0,0 +1,298 @@
+// Debugging bitset implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_BITSET
+#define _GLIBCXX_DEBUG_BITSET
+
+#include <bitset>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<size_t _Nb>
+ class bitset
+ : public __gnu_norm::bitset<_Nb>, public __gnu_debug::_Safe_sequence_base
+ {
+ typedef __gnu_norm::bitset<_Nb> _Base;
+ typedef __gnu_debug::_Safe_sequence_base _Safe_base;
+
+ public:
+ // bit reference:
+ class reference
+ : private _Base::reference, public __gnu_debug::_Safe_iterator_base
+ {
+ typedef typename _Base::reference _Base_ref;
+
+ friend class bitset;
+ reference();
+
+ reference(const _Base_ref& __base, bitset* __seq)
+ : _Base_ref(__base), _Safe_iterator_base(__seq, false)
+ { }
+
+ public:
+ reference(const reference& __x)
+ : _Base_ref(__x), _Safe_iterator_base(__x, false)
+ { }
+
+ reference&
+ operator=(bool __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ reference&
+ operator=(const reference& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __x._M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(__x));
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_write)
+ ._M_iterator(*this));
+ *static_cast<_Base_ref*>(this) = __x;
+ return *this;
+ }
+
+ bool
+ operator~() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return ~(*static_cast<const _Base_ref*>(this));
+ }
+
+ operator bool() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_read)
+ ._M_iterator(*this));
+ return *static_cast<const _Base_ref*>(this);
+ }
+
+ reference&
+ flip()
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(::__gnu_debug::__msg_bad_bitset_flip)
+ ._M_iterator(*this));
+ _Base_ref::flip();
+ return *this;
+ }
+ };
+
+ // 23.3.5.1 constructors:
+ bitset() : _Base() { }
+
+ bitset(unsigned long __val) : _Base(__val) { }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ explicit
+ bitset(const std::basic_string<_CharT,_Traits,_Allocator>& __str,
+ typename std::basic_string<_CharT,_Traits,_Allocator>::size_type
+ __pos = 0,
+ typename std::basic_string<_CharT,_Traits,_Allocator>::size_type
+ __n = (std::basic_string<_CharT,_Traits,_Allocator>::npos))
+ : _Base(__str, __pos, __n) { }
+
+ bitset(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ // 23.3.5.2 bitset operations:
+ bitset<_Nb>&
+ operator&=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() &= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator|=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() != __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator^=(const bitset<_Nb>& __rhs)
+ {
+ _M_base() ^= __rhs;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator<<=(size_t __pos)
+ {
+ _M_base() <<= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ operator>>=(size_t __pos)
+ {
+ _M_base() >>= __pos;
+ return *this;
+ }
+
+ bitset<_Nb>&
+ set()
+ {
+ _Base::set();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 186. bitset::set() second parameter should be bool
+ bitset<_Nb>&
+ set(size_t __pos, bool __val = true)
+ {
+ _Base::set(__pos, __val);
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset()
+ {
+ _Base::reset();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ reset(size_t __pos)
+ {
+ _Base::reset(__pos);
+ return *this;
+ }
+
+ bitset<_Nb> operator~() const { return bitset(~_M_base()); }
+
+ bitset<_Nb>&
+ flip()
+ {
+ _Base::flip();
+ return *this;
+ }
+
+ bitset<_Nb>&
+ flip(size_t __pos)
+ {
+ _Base::flip(__pos);
+ return *this;
+ }
+
+ // element access:
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ reference
+ operator[](size_t __pos)
+ {
+ __glibcxx_check_subscript(__pos);
+ return reference(_M_base()[__pos], this);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 11. Bitset minor problems
+ bool
+ operator[](size_t __pos) const
+ {
+ __glibcxx_check_subscript(__pos);
+ return _M_base()[__pos];
+ }
+
+ using _Base::to_ulong;
+
+ template <typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_string<_CharT, _Traits, _Allocator>
+ to_string() const
+ { return _M_base().template to_string<_CharT, _Traits, _Allocator>(); }
+
+ using _Base::count;
+ using _Base::size;
+
+ bool
+ operator==(const bitset<_Nb>& __rhs) const
+ { return _M_base() == __rhs; }
+
+ bool
+ operator!=(const bitset<_Nb>& __rhs) const
+ { return _M_base() != __rhs; }
+
+ using _Base::test;
+ using _Base::any;
+ using _Base::none;
+
+ bitset<_Nb>
+ operator<<(size_t __pos) const
+ { return bitset<_Nb>(_M_base() << __pos); }
+
+ bitset<_Nb>
+ operator>>(size_t __pos) const
+ { return bitset<_Nb>(_M_base() >> __pos); }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator&(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) &= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator|(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) |= __y; }
+
+ template<size_t _Nb>
+ bitset<_Nb>
+ operator^(const bitset<_Nb>& __x, const bitset<_Nb>& __y)
+ { return bitset<_Nb>(__x) ^= __y; }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_istream<_CharT, _Traits>&
+ operator>>(std::basic_istream<_CharT, _Traits>& __is, bitset<_Nb>& __x)
+ { return __is >> __x._M_base(); }
+
+ template<typename _CharT, typename _Traits, size_t _Nb>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const bitset<_Nb>& __x)
+ { return __os << __x._M_base(); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/debug.h b/libstdc++-v3/include/debug/debug.h
new file mode 100644
index 00000000000..87bbcfa4db6
--- /dev/null
+++ b/libstdc++-v3/include/debug/debug.h
@@ -0,0 +1,531 @@
+// Debugging support implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_DEBUG_H
+#define _GLIBCXX_DEBUG_DEBUG_H 1
+
+/**
+ * Macros used by the implementation to verify certain
+ * properties. These macros may only be used directly by the debug
+ * wrappers. Note that these are macros (instead of the more obviously
+ * "correct" choice of making them functions) because we need line and
+ * file information at the call site, to minimize the distance between
+ * the user error and where the error is reported.
+ *
+ */
+#define _GLIBCXX_DEBUG_VERIFY(_Condition,_ErrorMessage) \
+ do { \
+ if (! (_Condition)) \
+ ::__gnu_debug::_Error_formatter::_M_at(__FILE__, __LINE__) \
+ ._ErrorMessage._M_error(); \
+ } while (false)
+
+// Verify that [_First, _Last) forms a valid iterator range.
+#define __glibcxx_check_valid_range(_First,_Last) \
+_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__valid_range(_First, _Last), \
+ _M_message(::__gnu_debug::__msg_valid_range) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that we can insert into *this with the iterator _Position.
+ * Insertion into a container at a specific position requires that
+ * the iterator be nonsingular (i.e., either dereferenceable or
+ * past-the-end) and that it reference the sequence we are inserting
+ * into. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+*/
+#define __glibcxx_check_insert(_Position) \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(::__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(::__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can insert the values in the iterator range
+ * [_First, _Last) into *this with the iterator _Position. Insertion
+ * into a container at a specific position requires that the iterator
+ * be nonsingular (i.e., either dereferenceable or past-the-end),
+ * that it reference the sequence we are inserting into, and that the
+ * iterator range [_First, Last) is a valid (possibly empty)
+ * range. Note that this macro is only valid when the container is a
+ * _Safe_sequence and the iterator is a _Safe_iterator.
+ *
+ * @tbd We would like to be able to check for noninterference of
+ * _Position and the range [_First, _Last), but that can't (in
+ * general) be done.
+*/
+#define __glibcxx_check_insert_range(_Position,_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(!_Position._M_singular(), \
+ _M_message(::__gnu_debug::__msg_insert_singular) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(::__gnu_debug::__msg_insert_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the element referenced by the iterator
+ * _Position. We can erase the element if the _Position iterator is
+ * dereferenceable and references this sequence.
+*/
+#define __glibcxx_check_erase(_Position) \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_dereferenceable(), \
+ _M_message(::__gnu_debug::__msg_erase_bad) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position)); \
+_GLIBCXX_DEBUG_VERIFY(_Position._M_attached_to(this), \
+ _M_message(::__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_Position, #_Position))
+
+/** Verify that we can erase the elements in the iterator range
+ * [_First, _Last). We can erase the elements if [_First, _Last) is a
+ * valid iterator range within this sequence.
+*/
+#define __glibcxx_check_erase_range(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(_First._M_attached_to(this), \
+ _M_message(::__gnu_debug::__msg_erase_different) \
+ ._M_sequence(*this, "this") \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+// Verify that the subscript _N is less than the container's size.
+#define __glibcxx_check_subscript(_N) \
+_GLIBCXX_DEBUG_VERIFY(_N < this->size(), \
+ _M_message(::__gnu_debug::__msg_subscript_oob) \
+ ._M_sequence(*this, "this") \
+ ._M_integer(_N, #_N) \
+ ._M_integer(this->size(), "size"))
+
+// Verify that the container is nonempty
+#define __glibcxx_check_nonempty() \
+_GLIBCXX_DEBUG_VERIFY(! this->empty(), \
+ _M_message(::__gnu_debug::__msg_empty) \
+ ._M_sequence(*this, "this"))
+
+// Verify that the < operator for elements in the sequence is a
+// StrictWeakOrdering by checking that it is irreflexive.
+#define __glibcxx_check_strict_weak_ordering(_First,_Last) \
+_GLIBCXX_DEBUG_ASSERT(_First == _Last || !(*_First < *_First))
+
+// Verify that the predicate is StrictWeakOrdering by checking that it
+// is irreflexive.
+#define __glibcxx_check_strict_weak_ordering_pred(_First,_Last,_Pred) \
+_GLIBCXX_DEBUG_ASSERT(_First == _Last || !_Pred(*_First, *_First))
+
+
+// Verify that the iterator range [_First, _Last) is sorted
+#define __glibcxx_check_sorted(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+__glibcxx_check_strict_weak_ordering(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_sorted(_First, _Last), \
+ _M_message(::__gnu_debug::__msg_unsorted) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is sorted by the
+ predicate _Pred. */
+#define __glibcxx_check_sorted_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+__glibcxx_check_strict_weak_ordering_pred(_First,_Last,_Pred); \
+_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_sorted(_First, _Last, _Pred), \
+ _M_message(::__gnu_debug::__msg_unsorted_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value. */
+#define __glibcxx_check_partitioned(_First,_Last,_Value) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_partitioned(_First, _Last, \
+ _Value), \
+ _M_message(::__gnu_debug::__msg_unpartitioned) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Value))
+
+/** Verify that the iterator range [_First, _Last) is partitioned
+ w.r.t. the value _Value and predicate _Pred. */
+#define __glibcxx_check_partitioned_pred(_First,_Last,_Value,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(::__gnu_debug::__check_partitioned(_First, _Last, \
+ _Value, _Pred), \
+ _M_message(::__gnu_debug::__msg_unpartitioned_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred) \
+ ._M_string(#_Value))
+
+// Verify that the iterator range [_First, _Last) is a heap
+#define __glibcxx_check_heap(_First,_Last) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last), \
+ _M_message(::__gnu_debug::__msg_not_heap) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last))
+
+/** Verify that the iterator range [_First, _Last) is a heap
+ w.r.t. the predicate _Pred. */
+#define __glibcxx_check_heap_pred(_First,_Last,_Pred) \
+__glibcxx_check_valid_range(_First,_Last); \
+_GLIBCXX_DEBUG_VERIFY(::std::__is_heap(_First, _Last, _Pred), \
+ _M_message(::__gnu_debug::__msg_not_heap_pred) \
+ ._M_iterator(_First, #_First) \
+ ._M_iterator(_Last, #_Last) \
+ ._M_string(#_Pred))
+
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+# define __glibcxx_check_string(_String) _GLIBCXX_DEBUG_ASSERT(_String != 0)
+# define __glibcxx_check_string_len(_String,_Len) \
+ _GLIBCXX_DEBUG_ASSERT(_String != 0 || _Len == 0)
+#else
+# define __glibcxx_check_string(_String)
+# define __glibcxx_check_string_len(_String,_Len)
+#endif
+
+/** Macros used by the implementation outside of debug wrappers to
+ * verify certain properties. The __glibcxx_requires_xxx macros are
+ * merely wrappers around the __glibcxx_check_xxx wrappers when we
+ * are compiling with debug mode, but disappear when we are in
+ * release mode so that there is no checking performed in, e.g., the
+ * standard library algorithms.
+*/
+#ifdef _GLIBCXX_DEBUG
+# define _GLIBCXX_DEBUG_ASSERT(_Condition) assert(_Condition)
+
+# ifdef _GLIBXX_DEBUG_PEDANTIC
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition) assert(_Condition)
+# else
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+# endif
+
+# define __glibcxx_requires_cond(_Cond,_Msg) _GLIBCXX_DEBUG_VERIFY(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last) \
+ __glibcxx_check_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last) \
+ __glibcxx_check_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred) \
+ __glibcxx_check_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_partitioned(_First,_Last,_Value) \
+ __glibcxx_check_partitioned(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_pred(_First,_Last,_Value,_Pred) \
+ __glibcxx_check_partitioned_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last) \
+ __glibcxx_check_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred) \
+ __glibcxx_check_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty() __glibcxx_check_nonempty()
+# define __glibcxx_requires_string(_String) __glibcxx_check_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len) \
+ __glibcxx_check_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N) __glibcxx_check_subscript(_N)
+#else
+# define _GLIBCXX_DEBUG_ASSERT(_Condition)
+# define _GLIBCXX_DEBUG_PEDASSERT(_Condition)
+# define __glibcxx_requires_cond(_Cond,_Msg)
+# define __glibcxx_requires_valid_range(_First,_Last)
+# define __glibcxx_requires_sorted(_First,_Last)
+# define __glibcxx_requires_sorted_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_partitioned(_First,_Last,_Value)
+# define __glibcxx_requires_partitioned_pred(_First,_Last,_Value,_Pred)
+# define __glibcxx_requires_heap(_First,_Last)
+# define __glibcxx_requires_heap_pred(_First,_Last,_Pred)
+# define __glibcxx_requires_nonempty()
+# define __glibcxx_requires_string(_String)
+# define __glibcxx_requires_string_len(_String,_Len)
+# define __glibcxx_requires_subscript(_N)
+#endif
+
+#include <cassert> // TBD: temporary
+
+#include <stddef.h> // for ptrdiff_t
+#include <bits/stl_iterator_base_types.h> // for iterator_traits, categories
+#include <bits/type_traits.h> // for _Is_integer
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ // An arbitrary iterator pointer is not singular.
+ inline bool
+ __check_singular_aux(const void*) { return false; }
+
+ // We may have an iterator that derives from _Safe_iterator_base but isn't
+ // a _Safe_iterator.
+ template<typename _Iterator>
+ inline bool
+ __check_singular(_Iterator& __x)
+ { return __gnu_debug::__check_singular_aux(&__x); }
+
+ /** Non-NULL pointers are nonsingular. */
+ template<typename _Tp>
+ inline bool
+ __check_singular(const _Tp* __ptr)
+ { return __ptr == 0; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_singular(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_singular(); }
+
+ /** Assume that some arbitrary iterator is dereferenceable, because we
+ can't prove that it isn't. */
+ template<typename _Iterator>
+ inline bool
+ __check_dereferenceable(_Iterator&)
+ { return true; }
+
+ /** Non-NULL pointers are dereferenceable. */
+ template<typename _Tp>
+ inline bool
+ __check_dereferenceable(const _Tp* __ptr)
+ { return __ptr; }
+
+ /** Safe iterators know if they are singular. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __check_dereferenceable(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ { return __x._M_dereferenceable(); }
+
+ /** If the distance between two random access iterators is
+ * nonnegative, assume the range is valid.
+ */
+ template<typename _RandomAccessIterator>
+ inline bool
+ __valid_range_aux2(const _RandomAccessIterator& __first,
+ const _RandomAccessIterator& __last,
+ std::random_access_iterator_tag)
+ { return __last - __first >= 0; }
+
+ /** Can't test for a valid range with input iterators, because
+ * iteration may be destructive. So we just assume that the range
+ * is valid.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux2(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ /** We say that integral types for a valid range, and defer to other
+ * routines to realize what to do with integral types instead of
+ * iterators.
+ */
+ template<typename _Integral>
+ inline bool
+ __valid_range_aux(const _Integral&, const _Integral&, __true_type)
+ { return true; }
+
+ /** We have iterators, so figure out what kind of iterators that are
+ * to see if we can check the range ahead of time.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range_aux(const _InputIterator& __first,
+ const _InputIterator& __last, __false_type)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __gnu_debug::__valid_range_aux2(__first, __last, _Category());
+ }
+
+ /** Don't know what these iterators are, or if they are even
+ * iterators (we may get an integral type for InputIterator), so
+ * see if they are integral and pass them on to the next phase
+ * otherwise.
+ */
+ template<typename _InputIterator>
+ inline bool
+ __valid_range(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename _Is_integer<_InputIterator>::_Integral _Integral;
+ return __gnu_debug::__valid_range_aux(__first, __last, _Integral());
+ }
+
+ /** Safe iterators know how to check if they form a valid range. */
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ __valid_range(const _Safe_iterator<_Iterator, _Sequence>& __first,
+ const _Safe_iterator<_Iterator, _Sequence>& __last)
+ { return __first._M_valid_range(__last); }
+
+ /* Checks that [first, last) is a valid range, and then returns
+ * __first. This routine is useful when we can't use a separate
+ * assertion statement because, e.g., we are in a constructor.
+ */
+ template<typename _InputIterator>
+ inline _InputIterator
+ __check_valid_range(const _InputIterator& __first,
+ const _InputIterator& __last)
+ {
+ _GLIBCXX_DEBUG_ASSERT(__gnu_debug::__valid_range(__first, __last));
+ return __first;
+ }
+
+ /** Checks that __s is non-NULL or __n == 0, and then returns __s. */
+ template<typename _CharT, typename _Integer>
+ inline const _CharT*
+ __check_string(const _CharT* __s, const _Integer& __n)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0 || __n == 0);
+#endif
+ return __s;
+ }
+
+ /** Checks that __s is non-NULL and then returns __s. */
+ template<typename _CharT>
+ inline const _CharT*
+ __check_string(const _CharT* __s)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ _GLIBCXX_DEBUG_ASSERT(__s != 0);
+#endif
+ return __s;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we
+ // can't step through the sequence.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next) {
+ if (*__next < *__first)
+ return false;
+ }
+
+ return true;
+ }
+
+ // Can't check if an input iterator sequence is sorted, because we can't step
+ // through the sequence.
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(const _InputIterator&, const _InputIterator&,
+ _Predicate, std::input_iterator_tag)
+ { return true; }
+
+ // Can verify if a forward iterator sequence is in fact sorted using
+ // std::__is_sorted
+ template<typename _ForwardIterator, typename _Predicate>
+ inline bool
+ __check_sorted_aux(_ForwardIterator __first, _ForwardIterator __last,
+ _Predicate __pred, std::forward_iterator_tag)
+ {
+ if (__first == __last)
+ return true;
+
+ _ForwardIterator __next = __first;
+ for (++__next; __next != __last; __first = __next, ++__next) {
+ if (__pred(*__next, *__first))
+ return false;
+ }
+
+ return true;
+ }
+
+ // Determine if a sequence is sorted.
+ template<typename _InputIterator>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __gnu_debug::__check_sorted_aux(__first, __last, _Category());
+ }
+
+ template<typename _InputIterator, typename _Predicate>
+ inline bool
+ __check_sorted(const _InputIterator& __first, const _InputIterator& __last,
+ _Predicate __pred)
+ {
+ typedef typename std::iterator_traits<_InputIterator>::iterator_category
+ _Category;
+ return __gnu_debug::__check_sorted_aux(__first, __last, __pred,
+ _Category());
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 270. Binary search requirements overly strict
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp>
+ inline bool
+ __check_partitioned(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value)
+ {
+ while (__first != __last && *__first < __value)
+ ++__first;
+ while (__first != __last && !(*__first < __value))
+ ++__first;
+ return __first == __last;
+ }
+
+ // Determine if a sequence is partitioned w.r.t. this element.
+ template<typename _ForwardIterator, typename _Tp, typename _Pred>
+ inline bool
+ __check_partitioned(_ForwardIterator __first, _ForwardIterator __last,
+ const _Tp& __value, _Pred __pred)
+ {
+ while (__first != __last && __pred(*__first, __value))
+ ++__first;
+ while (__first != __last && !__pred(*__first, __value))
+ ++__first;
+ return __first == __last;
+ }
+} // namespace __gnu_debug
+
+#ifdef _GLIBCXX_DEBUG
+// We need the error formatter
+# include <debug/formatter.h>
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/debug/deque b/libstdc++-v3/include/debug/deque
new file mode 100644
index 00000000000..ed68b37a798
--- /dev/null
+++ b/libstdc++-v3/include/debug/deque
@@ -0,0 +1,386 @@
+// Debugging deque implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_DEQUE
+#define _GLIBCXX_DEBUG_DEQUE 1
+
+#include <deque>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class deque
+ : public __gnu_norm::deque<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<deque<_Tp, _Allocator> >
+ {
+ typedef __gnu_norm::deque<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<deque> _Safe_base;
+
+ public:
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,deque>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,deque>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.1.1 construct/copy/destroy:
+ explicit deque(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit deque(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ deque(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+ deque(const deque<_Tp,_Allocator>& __x) : _Base(__x), _Safe_base() { }
+
+ deque(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~deque() { }
+
+ deque<_Tp,_Allocator>&
+ operator=(const deque<_Tp,_Allocator>& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // 23.2.1.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ bool __invalidate_all = __sz > this->size();
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+
+ _Base::resize(__sz, __c);
+
+ if (__invalidate_all)
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.1.3 modifiers:
+ void
+ push_front(const _Tp& __x)
+ {
+ _Base::push_front(__x);
+ this->_M_invalidate_all();
+ }
+
+ void
+ push_back(const _Tp& __x)
+ {
+ _Base::push_back(__x);
+ this->_M_invalidate_all();
+ }
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ typename _Base::iterator __res = _Base::insert(__position.base(), __x);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ this->_M_invalidate_all();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ if (__position == begin() || __position == end()-1)
+ {
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ if (__first == begin() || __last == end())
+ {
+ this->_M_detach_singular();
+ for (iterator __position = __first; __position != __last; )
+ {
+ iterator __victim = __position++;
+ __victim._M_invalidate();
+ }
+ try
+ {
+ return iterator(_Base::erase(__first.base(), __last.base()),
+ this);
+ }
+ catch (...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+ else
+ {
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+ }
+
+ void
+ swap(deque<_Tp,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const deque<_Tp, _Alloc>& __lhs,
+ const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const deque<_Tp, _Alloc>& __lhs, const deque<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(deque<_Tp, _Alloc>& __lhs, deque<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/formatter.h b/libstdc++-v3/include/debug/formatter.h
new file mode 100644
index 00000000000..6ed00bd868e
--- /dev/null
+++ b/libstdc++-v3/include/debug/formatter.h
@@ -0,0 +1,389 @@
+// Debug-mode error formatting implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_FORMATTER_H
+#define _GLIBCXX_DEBUG_FORMATTER_H 1
+
+#include <typeinfo>
+#include <debug/debug.h>
+
+namespace __gnu_debug
+{
+ using namespace std;
+
+ /** Determine if the two types are the same. */
+ template<typename _Type1, typename _Type2>
+ struct __is_same
+ {
+ static const bool value = false;
+ };
+
+ template<typename _Type>
+ struct __is_same<_Type, _Type>
+ {
+ static const bool value = true;
+ };
+
+ template<bool> struct __truth { };
+
+ class _Safe_sequence_base;
+
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ template<typename _Sequence>
+ class _Safe_sequence;
+
+ enum _Debug_msg_id
+ {
+ // General checks
+ __msg_valid_range,
+ __msg_insert_singular,
+ __msg_insert_different,
+ __msg_erase_bad,
+ __msg_erase_different,
+ __msg_subscript_oob,
+ __msg_empty,
+ __msg_unpartitioned,
+ __msg_unpartitioned_pred,
+ __msg_unsorted,
+ __msg_unsorted_pred,
+ __msg_not_heap,
+ __msg_not_heap_pred,
+ // std::bitset checks
+ __msg_bad_bitset_write,
+ __msg_bad_bitset_read,
+ __msg_bad_bitset_flip,
+ // std::list checks
+ __msg_self_splice,
+ __msg_splice_alloc,
+ __msg_splice_bad,
+ __msg_splice_other,
+ __msg_splice_overlap,
+ // iterator checks
+ __msg_init_singular,
+ __msg_init_copy_singular,
+ __msg_init_const_singular,
+ __msg_copy_singular,
+ __msg_bad_deref,
+ __msg_bad_inc,
+ __msg_bad_dec,
+ __msg_iter_subscript_oob,
+ __msg_advance_oob,
+ __msg_retreat_oob,
+ __msg_iter_compare_bad,
+ __msg_compare_different,
+ __msg_iter_order_bad,
+ __msg_order_different,
+ __msg_distance_bad,
+ __msg_distance_different,
+ // istream_iterator
+ __msg_deref_istream,
+ __msg_inc_istream,
+ // ostream_iterator
+ __msg_output_ostream,
+ // istreambuf_iterator
+ __msg_deref_istreambuf,
+ __msg_inc_istreambuf
+ };
+
+ class _Error_formatter
+ {
+ /// Whether an iterator is constant, mutable, or unknown
+ enum _Constness
+ {
+ __unknown_constness,
+ __const_iterator,
+ __mutable_iterator,
+ __last_constness
+ };
+
+ // The state of the iterator (fine-grained), if we know it.
+ enum _Iterator_state
+ {
+ __unknown_state,
+ __singular, // singular, may still be attached to a sequence
+ __begin, // dereferenceable, and at the beginning
+ __middle, // dereferenceable, not at the beginning
+ __end, // past-the-end, may be at beginning if sequence empty
+ __last_state
+ };
+
+ // Tags denoting the type of parameter for construction
+ struct _Is_iterator { };
+ struct _Is_sequence { };
+
+ // A parameter that may be referenced by an error message
+ struct _Parameter
+ {
+ enum
+ {
+ __unused_param,
+ __iterator,
+ __sequence,
+ __integer,
+ __string
+ } _M_kind;
+
+ union
+ {
+ // When _M_kind == __iterator
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ _Constness _M_constness;
+ _Iterator_state _M_state;
+ const void* _M_sequence;
+ const type_info* _M_seq_type;
+ } _M_iterator;
+
+ // When _M_kind == __sequence
+ struct
+ {
+ const char* _M_name;
+ const void* _M_address;
+ const type_info* _M_type;
+ } _M_sequence;
+
+ // When _M_kind == __integer
+ struct
+ {
+ const char* _M_name;
+ long _M_value;
+ } _M_integer;
+
+ // When _M_kind == __string
+ struct
+ {
+ const char* _M_name;
+ const char* _M_value;
+ } _M_string;
+ } _M_variant;
+
+ _Parameter() : _M_kind(__unused_param) { }
+
+ _Parameter(long __value, const char* __name) : _M_kind(__integer)
+ {
+ _M_variant._M_integer._M_name = __name;
+ _M_variant._M_integer._M_value = __value;
+ }
+
+ _Parameter(const char* __value, const char* __name) : _M_kind(__string)
+ {
+ _M_variant._M_string._M_name = __name;
+ _M_variant._M_string._M_value = __value;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ _Parameter(const _Safe_iterator<_Iterator, _Sequence>& __it,
+ const char* __name, _Is_iterator)
+ : _M_kind(__iterator)
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness =
+ __is_same<_Safe_iterator<_Iterator, _Sequence>,
+ typename _Sequence::iterator>::
+ value? __mutable_iterator : __const_iterator;
+ _M_variant._M_iterator._M_sequence = __it._M_get_sequence();
+ _M_variant._M_iterator._M_seq_type = &typeid(_Sequence);
+
+ if (__it._M_singular())
+ _M_variant._M_iterator._M_state = __singular;
+ else
+ {
+ bool __is_begin = __it._M_is_begin();
+ bool __is_end = __it._M_is_end();
+ if (__is_end)
+ _M_variant._M_iterator._M_state = __end;
+ else if (__is_begin)
+ _M_variant._M_iterator._M_state = __begin;
+ else
+ _M_variant._M_iterator._M_state = __middle;
+ }
+ }
+
+ template<typename _Type>
+ _Parameter(const _Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator)
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __mutable_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Type>
+ _Parameter(_Type*& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator)
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __const_iterator;
+ _M_variant._M_iterator._M_state = __it? __unknown_state : __singular;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Iterator>
+ _Parameter(const _Iterator& __it, const char* __name, _Is_iterator)
+ : _M_kind(__iterator)
+ {
+ _M_variant._M_iterator._M_name = __name;
+ _M_variant._M_iterator._M_address = &__it;
+ _M_variant._M_iterator._M_type = &typeid(__it);
+ _M_variant._M_iterator._M_constness = __unknown_constness;
+ _M_variant._M_iterator._M_state =
+ __gnu_debug::__check_singular(__it)? __singular : __unknown_state;
+ _M_variant._M_iterator._M_sequence = 0;
+ _M_variant._M_iterator._M_seq_type = 0;
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Safe_sequence<_Sequence>& __seq,
+ const char* __name, _Is_sequence)
+ : _M_kind(__sequence)
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address =
+ static_cast<const _Sequence*>(&__seq);
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ template<typename _Sequence>
+ _Parameter(const _Sequence& __seq, const char* __name, _Is_sequence)
+ : _M_kind(__sequence)
+ {
+ _M_variant._M_sequence._M_name = __name;
+ _M_variant._M_sequence._M_address = &__seq;
+ _M_variant._M_sequence._M_type = &typeid(_Sequence);
+ }
+
+ void
+ _M_print_field(const _Error_formatter* __formatter,
+ const char* __name) const;
+
+ void
+ _M_print_description(const _Error_formatter* __formatter) const;
+ };
+
+ friend struct _Parameter;
+
+ public:
+ template<typename _Iterator>
+ const _Error_formatter&
+ _M_iterator(const _Iterator& __it, const char* __name = 0) const
+ {
+ if (_M_num_parameters < __max_parameters)
+ _M_parameters[_M_num_parameters++] = _Parameter(__it, __name,
+ _Is_iterator());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_integer(long __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < __max_parameters)
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_string(const char* __value, const char* __name = 0) const
+ {
+ if (_M_num_parameters < __max_parameters)
+ _M_parameters[_M_num_parameters++] = _Parameter(__value, __name);
+ return *this;
+ }
+
+ template<typename _Sequence>
+ const _Error_formatter&
+ _M_sequence(const _Sequence& __seq, const char* __name = 0) const
+ {
+ if (_M_num_parameters < __max_parameters)
+ _M_parameters[_M_num_parameters++] = _Parameter(__seq, __name,
+ _Is_sequence());
+ return *this;
+ }
+
+ const _Error_formatter&
+ _M_message(const char* __text) const
+ { _M_text = __text; return *this; }
+
+ const _Error_formatter&
+ _M_message(_Debug_msg_id __id) const;
+
+ void
+ _M_error() const;
+
+ private:
+ _Error_formatter(const char* __file, size_t __line)
+ : _M_file(__file), _M_line(__line), _M_num_parameters(0), _M_text(0),
+ _M_max_length(78), _M_column(1), _M_first_line(true), _M_wordwrap(false)
+ { }
+
+ template<typename _Tp>
+ void
+ _M_format_word(char*, int, const char*, _Tp) const;
+
+ void
+ _M_print_word(const char* __word) const;
+
+ void
+ _M_print_string(const char* __string) const;
+
+ enum { __max_parameters = 9 };
+
+ const char* _M_file;
+ size_t _M_line;
+ mutable _Parameter _M_parameters[__max_parameters];
+ mutable size_t _M_num_parameters;
+ mutable const char* _M_text;
+ mutable size_t _M_max_length;
+ enum { _M_indent = 4 } ;
+ mutable size_t _M_column;
+ mutable bool _M_first_line;
+ mutable bool _M_wordwrap;
+
+ public:
+ static _Error_formatter
+ _M_at(const char* __file, size_t __line)
+ { return _Error_formatter(__file, __line); }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_map b/libstdc++-v3/include/debug/hash_map
new file mode 100644
index 00000000000..570a9af6b69
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_map
@@ -0,0 +1,38 @@
+// Debugging hash_map/hash_multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_MAP
+#define _GLIBCXX_DEBUG_HASH_MAP 1
+
+#include <hash_map>
+#include <debug/dbg_hash_map.h>
+#include <debug/dbg_hash_multimap.h>
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_map.h b/libstdc++-v3/include/debug/hash_map.h
new file mode 100644
index 00000000000..c2cd7b8ca69
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_map.h
@@ -0,0 +1,270 @@
+// Debugging hash_map implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_MAP_H
+#define _GLIBCXX_DEBUG_HASH_MAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Value, typename _Tp,
+ typename _HashFcn = __gnu_cxx::hash<_Value>,
+ typename _EqualKey = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class hash_map
+ : public __gnu_cxx::hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>,
+ public __gnu_debug::_Safe_sequence<hash_map<_Value, _Tp, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ typedef __gnu_cxx::hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>
+ _Base;
+ typedef __gnu_debug::_Safe_sequence<hash_map> _Safe_base;
+
+ public:
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::data_type data_type;
+ typedef typename _Base::mapped_type mapped_type;
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, hash_map>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ hash_map>
+ const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ using _Base::hash_funct;
+ using _Base::key_eq;
+ using _Base::get_allocator;
+
+ hash_map() { }
+
+ explicit hash_map(size_type __n) : _Base(__n) { }
+
+ hash_map(size_type __n, const hasher& __hf) : _Base(__n, __hf) { }
+
+ hash_map(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l) { }
+
+ template<typename _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n) { }
+
+ template<typename _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf) { }
+
+ template<typename _InputIterator>
+ hash_map(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf,
+ __eql, __a) { }
+
+ hash_map(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ using _Base::size;
+ using _Base::max_size;
+ using _Base::empty;
+
+ void
+ swap(hash_map& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ iterator
+ begin() { return iterator(_Base::begin(), this); }
+
+ iterator
+ end() { return iterator(_Base::end(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ std::pair<typename _Base::iterator, bool> __res = _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first.base(), __last.base());
+ }
+
+
+ std::pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ std::pair<typename _Base::iterator, bool> __res =
+ _Base::insert_noresize(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ using _Base::operator[];
+ using _Base::count;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ return this->erase(__victim), 1;
+ else
+ return 0;
+ }
+
+ void
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ _Base::erase(__it.base());
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ _Base::erase(__first.base(), __last.base());
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::resize;
+ using _Base::bucket_count;
+ using _Base::max_bucket_count;
+ using _Base::elems_in_bucket;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline bool
+ operator==(const hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() == __y._M_base(); }
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline bool
+ operator!=(const hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() != __y._M_base(); }
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline void
+ swap(hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __x,
+ hash_map<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __y)
+ { __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_multimap.h b/libstdc++-v3/include/debug/hash_multimap.h
new file mode 100644
index 00000000000..83b4425aaf0
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_multimap.h
@@ -0,0 +1,261 @@
+// Debugging hash_multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_MULTIMAP_H
+#define _GLIBCXX_DEBUG_HASH_MULTIMAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Value, typename _Tp,
+ typename _HashFcn = __gnu_cxx::hash<_Value>,
+ typename _EqualKey = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class hash_multimap
+ : public __gnu_cxx::hash_multimap<_Value,_Tp,_HashFcn, _EqualKey,_Alloc>,
+ public __gnu_debug::_Safe_sequence<hash_multimap<_Value, _Tp, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ typedef __gnu_cxx::hash_multimap<_Value,_Tp,_HashFcn, _EqualKey,_Alloc>
+ _Base;
+ typedef __gnu_debug::_Safe_sequence<hash_multimap> _Safe_base;
+
+ public:
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::data_type data_type;
+ typedef typename _Base::mapped_type mapped_type;
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ hash_multimap> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ hash_multimap> const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ using _Base::hash_funct;
+ using _Base::key_eq;
+ using _Base::get_allocator;
+
+ hash_multimap() { }
+
+ explicit hash_multimap(size_type __n) : _Base(__n) { }
+
+ hash_multimap(size_type __n, const hasher& __hf) : _Base(__n, __hf) { }
+
+ hash_multimap(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l) { }
+
+ template<typename _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n) { }
+
+ template<typename _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf) { }
+
+ template<typename _InputIterator>
+ hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf,
+ __eql, __a) { }
+
+ using _Base::size;
+ using _Base::max_size;
+ using _Base::empty;
+
+ void
+ swap(hash_multimap& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ iterator
+ begin() { return iterator(_Base::begin(), this); }
+
+ iterator
+ end() { return iterator(_Base::end(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first.base(), __last.base());
+ }
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return iterator(_Base::insert_noresize(__obj), this); }
+
+ iterator
+ find(const key_type& __key)
+ { return iterator(_Base::find(__key), this); }
+
+ const_iterator
+ find(const key_type& __key) const
+ { return const_iterator(_Base::find(__key), this); }
+
+ using _Base::count;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator, const_iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__key);
+ size_t __num_victims = 0;
+ while (__victims.first != __victims.second)
+ {
+ this->erase(__victims.first++);
+ ++__num_victims;
+ }
+ return __num_victims;
+ }
+
+ void
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ _Base::erase(__it.base());
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ _Base::erase(__first.base(), __last.base());
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::resize;
+ using _Base::bucket_count;
+ using _Base::max_bucket_count;
+ using _Base::elems_in_bucket;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline bool
+ operator==(const hash_multimap<_Value,_Tp,_HashFcn,_EqualKey,_Alloc>& __x,
+ const hash_multimap<_Value,_Tp,_HashFcn,_EqualKey,_Alloc>& __y)
+ { return __x._M_base() == __y._M_base(); }
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline bool
+ operator!=(const hash_multimap<_Value,_Tp,_HashFcn,_EqualKey,_Alloc>& __x,
+ const hash_multimap<_Value,_Tp,_HashFcn,_EqualKey,_Alloc>& __y)
+ { return __x._M_base() != __y._M_base(); }
+
+ template<typename _Value, typename _Tp, typename _HashFcn,
+ typename _EqualKey, typename _Alloc>
+ inline void
+ swap(hash_multimap<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __x,
+ hash_multimap<_Value, _Tp, _HashFcn, _EqualKey, _Alloc>& __y)
+ { __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_multiset.h b/libstdc++-v3/include/debug/hash_multiset.h
new file mode 100644
index 00000000000..705d8da2532
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_multiset.h
@@ -0,0 +1,236 @@
+// Debugging hash_multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_MULTISET_H
+#define _GLIBCXX_DEBUG_HASH_MULTISET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Value,
+ typename _HashFcn = __gnu_cxx::hash<_Value>,
+ typename _EqualKey = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class hash_multiset
+ : public __gnu_cxx::hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>,
+ public __gnu_debug::_Safe_sequence<hash_multiset<_Value, _HashFcn,
+ _EqualKey, _Alloc> >
+ {
+ typedef __gnu_cxx:: hash_multiset<_Value,_HashFcn, _EqualKey,_Alloc>
+ _Base;
+ typedef __gnu_debug::_Safe_sequence<hash_multiset> _Safe_base;
+
+ public:
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,
+ hash_multiset> iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ hash_multiset> const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ using _Base::hash_funct;
+ using _Base::key_eq;
+ using _Base::get_allocator;
+
+ hash_multiset() { }
+
+ explicit hash_multiset(size_type __n) : _Base(__n) { }
+
+ hash_multiset(size_type __n, const hasher& __hf) : _Base(__n, __hf) { }
+
+ hash_multiset(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a)
+ { }
+
+ template<typename _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l)
+ { }
+
+ template<typename _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n)
+ { }
+
+ template<typename _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf)
+ { }
+
+ template<typename _InputIterator>
+ hash_multiset(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf,
+ __eql, __a)
+ { }
+
+ hash_multiset(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ using _Base::size;
+ using _Base::max_size;
+ using _Base::empty;
+
+ void
+ swap(hash_multiset& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ iterator begin() const { return iterator(_Base::begin(), this); }
+ iterator end() const { return iterator(_Base::end(), this); }
+
+ iterator
+ insert(const value_type& __obj)
+ { return iterator(_Base::insert(__obj), this); }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first.base(), __last.base());
+ }
+
+
+ iterator
+ insert_noresize(const value_type& __obj)
+ { return iterator(_Base::insert_noresize(__obj), this); }
+
+ iterator
+ find(const key_type& __key) const
+ { return iterator(_Base::find(__key), this); }
+
+ using _Base::count;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ size_type __count = 0;
+ std::pair<iterator, iterator> __victims = this->equal_range(__key);
+ while (__victims.first != __victims.second)
+ {
+ this->erase(__victims++);
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ _Base::erase(__it.base());
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ _Base::erase(__first.base(), __last.base());
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::resize;
+ using _Base::bucket_count;
+ using _Base::max_bucket_count;
+ using _Base::elems_in_bucket;
+
+ _Base& _M_base() { return *this; }
+ const _Base& _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+template<typename _Value, typename _HashFcn, typename _EqualKey, typename _Alloc>
+ inline bool
+ operator==(const hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() == __y._M_base(); }
+
+template<typename _Value, typename _HashFcn, typename _EqualKey, typename _Alloc>
+ inline bool
+ operator!=(const hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() != __y._M_base(); }
+
+template<typename _Value, typename _HashFcn, typename _EqualKey, typename _Alloc>
+ inline void
+ swap(hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ hash_multiset<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_set b/libstdc++-v3/include/debug/hash_set
new file mode 100644
index 00000000000..282cba27613
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_set
@@ -0,0 +1,38 @@
+// Debugging hash_set/hash_multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_SET
+#define _GLIBCXX_DEBUG_HASH_SET 1
+
+#include <hash_set>
+#include <debug/dbg_hash_set.h>
+#include <debug/dbg_hash_multiset.h>
+
+#endif
diff --git a/libstdc++-v3/include/debug/hash_set.h b/libstdc++-v3/include/debug/hash_set.h
new file mode 100644
index 00000000000..0f56d882935
--- /dev/null
+++ b/libstdc++-v3/include/debug/hash_set.h
@@ -0,0 +1,245 @@
+// Debugging hash_set implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_HASH_SET_H
+#define _GLIBCXX_DEBUG_HASH_SET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Value,
+ typename _HashFcn = __gnu_cxx::hash<_Value>,
+ typename _EqualKey = std::equal_to<_Value>,
+ typename _Alloc = std::allocator<_Value> >
+ class hash_set
+ : public __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc>,
+ public __gnu_debug::_Safe_sequence<hash_set<_Value, _HashFcn, _EqualKey,
+ _Alloc> >
+ {
+ typedef __gnu_cxx::hash_set<_Value, _HashFcn, _EqualKey, _Alloc> _Base;
+ typedef __gnu_debug::_Safe_sequence<hash_set> _Safe_base;
+
+ public:
+ typedef typename _Base::key_type key_type;
+ typedef typename _Base::value_type value_type;
+ typedef typename _Base::hasher hasher;
+ typedef typename _Base::key_equal key_equal;
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Base::pointer pointer;
+ typedef typename _Base::const_pointer const_pointer;
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, hash_set>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ hash_set>
+ const_iterator;
+
+ typedef typename _Base::allocator_type allocator_type;
+
+ using _Base::hash_funct;
+ using _Base::key_eq;
+ using _Base::get_allocator;
+
+ hash_set() { }
+
+ explicit hash_set(size_type __n) : _Base(__n) { }
+
+ hash_set(size_type __n, const hasher& __hf) : _Base(__n, __hf) { }
+
+ hash_set(size_type __n, const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__n, __hf, __eql, __a) { }
+
+ template<typename _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l) { }
+
+ template<typename _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n) { }
+
+ template<typename _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf)
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf) { }
+
+ template<typename _InputIterator>
+ hash_set(_InputIterator __f, _InputIterator __l, size_type __n,
+ const hasher& __hf, const key_equal& __eql,
+ const allocator_type& __a = allocator_type())
+ : _Base(__gnu_debug::__check_valid_range(__f, __l), __l, __n, __hf,
+ __eql, __a) { }
+
+ hash_set(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ using _Base::size;
+ using _Base::max_size;
+ using _Base::empty;
+
+ void
+ swap(hash_set& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ iterator
+ begin() const { return iterator(_Base::begin(), this); }
+
+ iterator
+ end() const { return iterator(_Base::end(), this); }
+
+ std::pair<iterator, bool>
+ insert(const value_type& __obj)
+ {
+ std::pair<typename _Base::iterator, bool> __res =
+ _Base::insert(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first.base(), __last.base());
+ }
+
+
+ std::pair<iterator, bool>
+ insert_noresize(const value_type& __obj)
+ {
+ std::pair<typename _Base::iterator, bool> __res =
+ _Base::insert_noresize(__obj);
+ return std::make_pair(iterator(__res.first, this), __res.second);
+ }
+
+ iterator
+ find(const key_type& __key) const
+ { return iterator(_Base::find(__key), this); }
+
+ using _Base::count;
+
+ std::pair<iterator, iterator>
+ equal_range(const key_type& __key) const
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__key);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ size_type
+ erase(const key_type& __key)
+ {
+ iterator __victim(_Base::find(__key), this);
+ if (__victim != end())
+ return this->erase(__victim), 1;
+ else
+ return 0;
+ }
+
+ void
+ erase(iterator __it)
+ {
+ __glibcxx_check_erase(__it);
+ __it._M_invalidate();
+ _Base::erase(__it.base());
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ __glibcxx_check_erase_range(__first, __last);
+ for (iterator __tmp = __first; __tmp != __last;)
+ {
+ iterator __victim = __tmp++;
+ __victim._M_invalidate();
+ }
+ _Base::erase(__first.base(), __last.base());
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::resize;
+ using _Base::bucket_count;
+ using _Base::max_bucket_count;
+ using _Base::elems_in_bucket;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Value, typename _HashFcn, typename _EqualKey,
+ typename _Alloc>
+ inline bool
+ operator==(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() == __y._M_base(); }
+
+ template<typename _Value, typename _HashFcn, typename _EqualKey,
+ typename _Alloc>
+ inline bool
+ operator!=(const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ const hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { return __x._M_base() != __y._M_base(); }
+
+ template<typename _Value, typename _HashFcn, typename _EqualKey,
+ typename _Alloc>
+ inline void
+ swap(hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __x,
+ hash_set<_Value, _HashFcn, _EqualKey, _Alloc>& __y)
+ { __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/list b/libstdc++-v3/include/debug/list
new file mode 100644
index 00000000000..f9bb9f9435c
--- /dev/null
+++ b/libstdc++-v3/include/debug/list
@@ -0,0 +1,505 @@
+// Debugging list implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_LIST
+#define _GLIBCXX_DEBUG_LIST 1
+
+#include <list>
+#include <bits/stl_algo.h>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug_def
+{
+ template<typename _Tp, typename _Allocator = std::allocator<_Tp> >
+ class list
+ : public __gnu_norm::list<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<list<_Tp, _Allocator> >
+ {
+ typedef __gnu_norm::list<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<list> _Safe_base;
+
+ public:
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, list>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, list>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.2.1 construct/copy/destroy:
+ explicit list(const _Allocator& __a = _Allocator())
+ : _Base(__a) { }
+
+ explicit list(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a) { }
+
+ template<class _InputIterator>
+ list(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last, __a)
+ { }
+
+
+ list(const list& __x) : _Base(__x), _Safe_base() { }
+
+ list(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~list() { }
+
+ list&
+ operator=(const list& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<class _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __t)
+ {
+ _Base::assign(__n, __t);
+ this->_M_invalidate_all();
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // 23.2.2.2 capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ this->_M_detach_singular();
+
+ // if __sz < size(), invalidate all iterators in [begin+__sz, end())
+ iterator __victim = begin();
+ iterator __end = end();
+ for (size_type __i = __sz; __victim != __end && __i > 0; --__i)
+ ++__victim;
+
+ while (__victim != __end)
+ {
+ iterator __real_victim = __victim++;
+ __real_victim._M_invalidate();
+ }
+
+ try
+ {
+ _Base::resize(__sz, __c);
+ }
+ catch(...)
+ {
+ this->_M_revalidate_singular();
+ __throw_exception_again;
+ }
+ }
+
+ // element access:
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.2.3 modifiers:
+ using _Base::push_front;
+
+ void
+ pop_front()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = begin();
+ __victim._M_invalidate();
+ _Base::pop_front();
+ }
+
+ using _Base::push_back;
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end();
+ --__victim;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ _Base::insert(__position.base(), __n, __x);
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position, _InputIterator __first,
+ _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+ _Base::insert(__position.base(), __first, __last);
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ return iterator(_Base::erase(__position.base()), this);
+ }
+
+ iterator
+ erase(iterator __position, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__position, __last);
+ for (iterator __victim = __position; __victim != __last; )
+ {
+ iterator __old = __victim;
+ ++__victim;
+ __old._M_invalidate();
+ }
+ return iterator(_Base::erase(__position.base(), __last.base()), this);
+ }
+
+ void
+ swap(list& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ // 23.2.2.4 list operations:
+ void
+ splice(iterator __position, list& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this,
+ _M_message(::__gnu_debug::__msg_self_splice)
+ ._M_sequence(*this, "this"));
+ this->splice(__position, __x, __x.begin(), __x.end());
+ }
+
+ void
+ splice(iterator __position, list& __x, iterator __i)
+ {
+ __glibcxx_check_insert(__position);
+ _GLIBCXX_DEBUG_VERIFY(__x.get_allocator() == this->get_allocator(),
+ _M_message(::__gnu_debug::__msg_splice_alloc)
+ ._M_sequence(*this)._M_sequence(__x, "__x"));
+ _GLIBCXX_DEBUG_VERIFY(__i._M_dereferenceable(),
+ _M_message(::__gnu_debug::__msg_splice_bad)
+ ._M_iterator(__i, "__i"));
+ _GLIBCXX_DEBUG_VERIFY(__i._M_attached_to(&__x),
+ _M_message(::__gnu_debug::__msg_splice_other)
+ ._M_iterator(__i, "__i")._M_sequence(__x, "__x"));
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__i);
+ _Base::splice(__position.base(), __x._M_base(), __i.base());
+ }
+
+ void
+ splice(iterator __position, list& __x, iterator __first, iterator __last)
+ {
+ __glibcxx_check_insert(__position);
+ __glibcxx_check_valid_range(__first, __last);
+ _GLIBCXX_DEBUG_VERIFY(__first._M_attached_to(&__x),
+ _M_message(::__gnu_debug::__msg_splice_other)
+ ._M_sequence(__x, "x")
+ ._M_iterator(__first, "first"));
+ _GLIBCXX_DEBUG_VERIFY(__x.get_allocator() == this->get_allocator(),
+ _M_message(::__gnu_debug::__msg_splice_alloc)
+ ._M_sequence(*this)._M_sequence(__x));
+
+ for (iterator __tmp = __first; __tmp != __last; )
+ {
+ _GLIBCXX_DEBUG_VERIFY(&__x != this || __tmp != __position,
+ _M_message(::__gnu_debug::__msg_splice_overlap)
+ ._M_iterator(__tmp, "position")
+ ._M_iterator(__first, "first")
+ ._M_iterator(__last, "last"));
+ iterator __victim = __tmp++;
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 250. splicing invalidates iterators
+ this->_M_transfer_iter(__victim);
+ }
+
+ _Base::splice(__position.base(), __x._M_base(), __first.base(),
+ __last.base());
+ }
+
+ void
+ remove(const _Tp& __value)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (*__x == __value)
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ template<class _Predicate>
+ void
+ remove_if(_Predicate __pred)
+ {
+ for (iterator __x = begin(); __x.base() != _Base::end(); )
+ {
+ if (__pred(*__x))
+ __x = erase(__x);
+ else
+ ++__x;
+ }
+ }
+
+ void
+ unique()
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (*__first == *__next)
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ template<class _BinaryPredicate>
+ void
+ unique(_BinaryPredicate __binary_pred)
+ {
+ iterator __first = begin();
+ iterator __last = end();
+ if (__first == __last)
+ return;
+ iterator __next = __first;
+ while (++__next != __last)
+ {
+ if (__binary_pred(*__first, *__next))
+ erase(__next);
+ else
+ __first = __next;
+ __next = __first;
+ }
+ }
+
+ void
+ merge(list& __x)
+ {
+ __glibcxx_check_sorted(_Base::begin(), _Base::end());
+ __glibcxx_check_sorted(__x.begin().base(), __x.end().base());
+ for (iterator __tmp = __x.begin(); __tmp != __x.end(); )
+ {
+ iterator __victim = __tmp++;
+ __victim._M_attach(&__x);
+ }
+ _Base::merge(__x._M_base());
+ }
+
+ template<class _Compare>
+ void
+ merge(list& __x, _Compare __comp)
+ {
+ __glibcxx_check_sorted_pred(_Base::begin(), _Base::end(), __comp);
+ __glibcxx_check_sorted_pred(__x.begin().base(), __x.end().base(),
+ __comp);
+ for (iterator __tmp = __x.begin(); __tmp != __x.end(); )
+ {
+ iterator __victim = __tmp++;
+ __victim._M_attach(&__x);
+ }
+ _Base::merge(__x._M_base(), __comp);
+ }
+
+ void
+ sort() { _Base::sort(); }
+
+ template<typename _StrictWeakOrdering>
+ void
+ sort(_StrictWeakOrdering __pred) { _Base::sort(__pred); }
+
+ using _Base::reverse;
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const list<_Tp, _Alloc>& __lhs, const list<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(list<_Tp, _Alloc>& __lhs, list<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/map b/libstdc++-v3/include/debug/map
new file mode 100644
index 00000000000..2c384048718
--- /dev/null
+++ b/libstdc++-v3/include/debug/map
@@ -0,0 +1,38 @@
+// Debugging map/multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_MAP
+#define _GLIBCXX_DEBUG_MAP 1
+
+#include <map>
+#include <debug/map.h>
+#include <debug/multimap.h>
+
+#endif
diff --git a/libstdc++-v3/include/debug/map.h b/libstdc++-v3/include/debug/map.h
new file mode 100644
index 00000000000..9470e667434
--- /dev/null
+++ b/libstdc++-v3/include/debug/map.h
@@ -0,0 +1,323 @@
+// Debugging map implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_MAP_H
+#define _GLIBCXX_DEBUG_MAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace __gnu_debug_def
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class map
+ : public __gnu_norm::map<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<map<_Key, _Tp, _Compare, _Allocator> >
+ {
+ typedef __gnu_norm::map<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<map> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, map>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, map>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit map(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ map(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a), _Safe_base() { }
+
+ map(const map<_Key,_Tp,_Compare,_Allocator>& __x)
+ : _Base(__x), _Safe_base() { }
+
+ map(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~map() { }
+
+ map<_Key,_Tp,_Compare,_Allocator>&
+ operator=(const map<_Key,_Tp,_Compare,_Allocator>& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 133. map missing get_allocator()
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // 23.3.1.2 element access:
+ using _Base::operator[];
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+ swap(map<_Key,_Tp,_Compare,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 map operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator==(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator!=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator<(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator<=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator>=(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator>(const map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline void
+ swap(map<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ map<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/multimap.h b/libstdc++-v3/include/debug/multimap.h
new file mode 100644
index 00000000000..3772c31dc69
--- /dev/null
+++ b/libstdc++-v3/include/debug/multimap.h
@@ -0,0 +1,314 @@
+// Debugging multimap implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_MULTIMAP_H
+#define _GLIBCXX_DEBUG_MULTIMAP_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace __gnu_debug_def
+{
+ template<typename _Key, typename _Tp, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<std::pair<const _Key, _Tp> > >
+ class multimap
+ : public __gnu_norm::multimap<_Key, _Tp, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multimap<_Key,_Tp,_Compare,_Allocator> >
+ {
+ typedef __gnu_norm::multimap<_Key, _Tp, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multimap> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Tp mapped_type;
+ typedef std::pair<const _Key, _Tp> value_type;
+ typedef _Compare key_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multimap>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multimap> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::value_compare;
+
+ // 23.3.1.1 construct/copy/destroy:
+ explicit multimap(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multimap(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multimap(const multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multimap(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~multimap() { }
+
+ multimap<_Key,_Tp,_Compare,_Allocator>&
+ operator=(const multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+ swap(multimap<_Key,_Tp,_Compare,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // 23.3.1.3 multimap operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ std::pair<_Base_const_iterator, _Base_const_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator==(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator!=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator<(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator<=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator>=(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline bool
+ operator>(const multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ const multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key,typename _Tp,typename _Compare,typename _Allocator>
+ inline void
+ swap(multimap<_Key,_Tp,_Compare,_Allocator>& __lhs,
+ multimap<_Key,_Tp,_Compare,_Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/multiset.h b/libstdc++-v3/include/debug/multiset.h
new file mode 100644
index 00000000000..19bc29a960a
--- /dev/null
+++ b/libstdc++-v3/include/debug/multiset.h
@@ -0,0 +1,320 @@
+// Debugging multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_MULTISET_H
+#define _GLIBCXX_DEBUG_MULTISET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace __gnu_debug_def
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class multiset
+ : public __gnu_norm::multiset<_Key, _Compare, _Allocator>,
+ public __gnu_debug::_Safe_sequence<multiset<_Key, _Compare, _Allocator> >
+ {
+ typedef __gnu_norm::multiset<_Key, _Compare, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<multiset> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, multiset>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ multiset> const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit multiset(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ multiset(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ multiset(const multiset<_Key,_Compare,_Allocator>& __x)
+ : _Base(__x), _Safe_base() { }
+
+ multiset(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~multiset() { }
+
+ multiset<_Key,_Compare,_Allocator>&
+ operator=(const multiset<_Key,_Compare,_Allocator>& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ iterator
+ insert(const value_type& __x)
+ { return iterator(_Base::insert(__x), this); }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ std::pair<iterator, iterator> __victims = this->equal_range(__x);
+ size_type __count = 0;
+ while (__victims.first != __victims.second)
+ {
+ iterator __victim = __victims.first++;
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ ++__count;
+ }
+ return __count;
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+ swap(multiset<_Key,_Compare,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // multiset operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const multiset<_Key,_Compare,_Allocator>& __lhs,
+ const multiset<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(multiset<_Key,_Compare,_Allocator>& __x,
+ multiset<_Key,_Compare,_Allocator>& __y)
+ { return __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_base.h b/libstdc++-v3/include/debug/safe_base.h
new file mode 100644
index 00000000000..07bc3b363e1
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_base.h
@@ -0,0 +1,201 @@
+// Safe sequence/iterator base implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_SAFE_BASE_H
+#define _GLIBCXX_DEBUG_SAFE_BASE_H 1
+
+namespace __gnu_debug
+{
+ class _Safe_sequence_base;
+
+ /** \brief Basic functionality for a "safe" iterator.
+ *
+ * The %_Safe_iterator_base base class implements the functionality
+ * of a safe iterator that is not specific to a particular iterator
+ * type. It contains a pointer back to the sequence it references
+ * along with iterator version information and pointers to form a
+ * doubly-linked list of iterators referenced by the container.
+ *
+ * This class must not perform any operations that can throw an
+ * exception, or the exception guarantees of derived iterators will
+ * be broken.
+ */
+ class _Safe_iterator_base
+ {
+ public:
+ /** The sequence this iterator references; may be NULL to indicate
+ a singular iterator. */
+ _Safe_sequence_base* _M_sequence;
+
+ /** The version number of this iterator. The sentinel value 0 is
+ * used to indicate an invalidated iterator (i.e., one that is
+ * singular because of an operation on the container). This
+ * version number must equal the version number in the sequence
+ * referenced by _M_sequence for the iterator to be
+ * non-singular.
+ */
+ unsigned int _M_version;
+
+ /** Pointer to the previous iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_prior;
+
+ /** Pointer to the next iterator in the sequence's list of
+ iterators. Only valid when _M_sequence != NULL. */
+ _Safe_iterator_base* _M_next;
+
+ protected:
+ /** Initializes the iterator and makes it singular. */
+ _Safe_iterator_base()
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { }
+
+ /** Initialize the iterator to reference the sequence pointed to
+ * by @p__seq. @p __constant is true when we are initializing a
+ * constant iterator, and false if it is a mutable iterator. Note
+ * that @p __seq may be NULL, in which case the iterator will be
+ * singular. Otherwise, the iterator will reference @p __seq and
+ * be nonsingular.
+ */
+ _Safe_iterator_base(const _Safe_sequence_base* __seq, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(const_cast<_Safe_sequence_base*>(__seq), __constant); }
+
+ /** Initializes the iterator to reference the same sequence that
+ @p __x does. @p __constant is true if this is a constant
+ iterator, and false if it is mutable. */
+ _Safe_iterator_base(const _Safe_iterator_base& __x, bool __constant)
+ : _M_sequence(0), _M_version(0), _M_prior(0), _M_next(0)
+ { this->_M_attach(__x._M_sequence, __constant); }
+
+ ~_Safe_iterator_base() { this->_M_detach(); }
+
+ public:
+ /** Attaches this iterator to the given sequence, detaching it
+ * from whatever sequence it was attached to originally. If the
+ * new sequence is the NULL pointer, the iterator is left
+ * unattached.
+ */
+ void _M_attach(_Safe_sequence_base* __seq, bool __constant);
+
+ /** Detach the iterator for whatever sequence it is attached to,
+ * if any.
+ */
+ void _M_detach();
+
+ /** Determines if we are attached to the given sequence. */
+ bool _M_attached_to(const _Safe_sequence_base* __seq) const
+ { return _M_sequence == __seq; }
+
+ /** Is this iterator singular? */
+ bool _M_singular() const;
+
+ /** Can we compare this iterator to the given iterator @p __x?
+ Returns true if both iterators are nonsingular and reference
+ the same sequence. */
+ bool _M_can_compare(const _Safe_iterator_base& __x) const;
+ };
+
+ /**
+ * @brief Base class that supports tracking of iterators that
+ * reference a sequence.
+ *
+ * The %_Safe_sequence_base class provides basic support for
+ * tracking iterators into a sequence. Sequences that track
+ * iterators must derived from %_Safe_sequence_base publicly, so
+ * that safe iterators (which inherit _Safe_iterator_base) can
+ * attach to them. This class contains two linked lists of
+ * iterators, one for constant iterators and one for mutable
+ * iterators, and a version number that allows very fast
+ * invalidation of all iterators that reference the container.
+ *
+ * This class must ensure that no operation on it may throw an
+ * exception, otherwise "safe" sequences may fail to provide the
+ * exception-safety guarantees required by the C++ standard.
+ */
+ class _Safe_sequence_base
+ {
+ public:
+ /// The list of mutable iterators that reference this container
+ _Safe_iterator_base* _M_iterators;
+
+ /// The list of constant iterators that reference this container
+ _Safe_iterator_base* _M_const_iterators;
+
+ /// The container version number. This number may never be 0.
+ mutable unsigned int _M_version;
+
+ protected:
+ // Initialize with a version number of 1 and no iterators
+ _Safe_sequence_base()
+ : _M_iterators(0), _M_const_iterators(0), _M_version(1)
+ { }
+
+ /** Notify all iterators that reference this sequence that the
+ sequence is being destroyed. */
+ ~_Safe_sequence_base()
+ { this->_M_detach_all(); }
+
+ /** Detach all iterators, leaving them singular. */
+ void
+ _M_detach_all();
+
+ /** Detach all singular iterators.
+ * @post for all iterators i attached to this sequence,
+ * i->_M_version == _M_version.
+ */
+ void
+ _M_detach_singular();
+
+ /** Revalidates all attached singular iterators. This method may
+ * be used to validate iterators that were invalidated before
+ * (but for some reasion, such as an exception, need to become
+ * valid again).
+ */
+ void
+ _M_revalidate_singular();
+
+ /** Swap this sequence with the given sequence. This operation
+ * also swaps ownership of the iterators, so that when the
+ * operation is complete all iterators that originally referenced
+ * one container now reference the other container.
+ */
+ void
+ _M_swap(_Safe_sequence_base& __x);
+
+ public:
+ /** Invalidates all iterators. */
+ void
+ _M_invalidate_all() const
+ { if (++_M_version == 0) _M_version = 1; }
+ };
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_iterator.h b/libstdc++-v3/include/debug/safe_iterator.h
new file mode 100644
index 00000000000..72ba3b52f10
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_iterator.h
@@ -0,0 +1,607 @@
+// Safe iterator implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_SAFE_ITERATOR_H
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_H 1
+
+#include <bits/stl_pair.h>
+#include <debug/debug.h>
+#include <debug/formatter.h>
+#include <debug/safe_base.h>
+
+namespace __gnu_debug
+{
+ /** Iterators that derive from _Safe_iterator_base but that aren't
+ * _Safe_iterators can be determined singular or non-singular via
+ * _Safe_iterator_base.
+ */
+ inline bool __check_singular_aux(const _Safe_iterator_base* __x)
+ { return __x->_M_singular(); }
+
+ /** \brief Safe iterator wrapper.
+ *
+ * The class template %_Safe_iterator is a wrapper around an
+ * iterator that tracks the iterator's movement among sequences and
+ * checks that operations performed on the "safe" iterator are
+ * legal. In additional to the basic iterator operations (which are
+ * validated, and then passed to the underlying iterator),
+ * %_Safe_iterator has member functions for iterator invalidation,
+ * attaching/detaching the iterator from sequences, and querying
+ * the iterator's state.
+ */
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator : public _Safe_iterator_base
+ {
+ typedef _Safe_iterator _Self;
+
+ /** The precision to which we can calculate the distance between
+ * two iterators.
+ */
+ enum _Distance_precision
+ {
+ __dp_equality, //< Can compare iterator equality, only
+ __dp_sign, //< Can determine equality and ordering
+ __dp_exact //< Can determine distance precisely
+ };
+
+ /// The underlying iterator
+ _Iterator _M_current;
+
+ /// Determine if this is a constant iterator.
+ bool
+ _M_constant() const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+ return __is_same<const_iterator, _Safe_iterator>::value;
+ }
+
+ typedef iterator_traits<_Iterator> _Traits;
+
+ public:
+ typedef typename _Traits::iterator_category iterator_category;
+ typedef typename _Traits::value_type value_type;
+ typedef typename _Traits::difference_type difference_type;
+ typedef typename _Traits::reference reference;
+ typedef typename _Traits::pointer pointer;
+
+ /// @post the iterator is singular and unattached
+ _Safe_iterator() : _M_current() { }
+
+ /**
+ * @brief Safe iterator construction from an unsafe iterator and
+ * its sequence.
+ *
+ * @pre @p seq is not NULL
+ * @post this is not singular
+ */
+ _Safe_iterator(const _Iterator& __i, const _Sequence* __seq)
+ : _Safe_iterator_base(__seq, _M_constant()), _M_current(__i)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! this->_M_singular(),
+ _M_message(__msg_init_singular)
+ ._M_iterator(*this, "this"));
+ }
+
+ /**
+ * @brief Copy construction.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator(const _Safe_iterator& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x._M_current)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Converting constructor from a mutable iterator to a
+ * constant iterator.
+ *
+ * @pre @p x is not singular
+ */
+ template<typename _MutableIterator>
+ _Safe_iterator(const _Safe_iterator<_MutableIterator, _Sequence>& __x)
+ : _Safe_iterator_base(__x, _M_constant()), _M_current(__x.base())
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_init_const_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ }
+
+ /**
+ * @brief Copy assignment.
+ * @pre @p x is not singular
+ */
+ _Safe_iterator&
+ operator=(const _Safe_iterator& __x)
+ {
+ _GLIBCXX_DEBUG_VERIFY(!__x._M_singular(),
+ _M_message(__msg_copy_singular)
+ ._M_iterator(*this, "this")
+ ._M_iterator(__x, "other"));
+ _M_current = __x._M_current;
+ this->_M_attach(static_cast<_Sequence*>(__x._M_sequence));
+ return *this;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ */
+ reference
+ operator*() const
+ {
+
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return *_M_current;
+ }
+
+ /**
+ * @brief Iterator dereference.
+ * @pre iterator is dereferenceable
+ * @todo Make this correct w.r.t. iterators that return proxies
+ * @todo Use addressof() instead of & operator
+ */
+ pointer
+ operator->() const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_dereferenceable(),
+ _M_message(__msg_bad_deref)
+ ._M_iterator(*this, "this"));
+ return &*_M_current;
+ }
+
+ // ------ Input iterator requirements ------
+ /**
+ * @brief Iterator preincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator&
+ operator++()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ ++_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postincrement
+ * @pre iterator is incrementable
+ */
+ _Safe_iterator
+ operator++(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_incrementable(),
+ _M_message(__msg_bad_inc)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ ++_M_current;
+ return __tmp;
+ }
+
+ // ------ Bidirectional iterator requirements ------
+ /**
+ * @brief Iterator predecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator&
+ operator--()
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ --_M_current;
+ return *this;
+ }
+
+ /**
+ * @brief Iterator postdecrement
+ * @pre iterator is decrementable
+ */
+ _Safe_iterator
+ operator--(int)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_decrementable(),
+ _M_message(__msg_bad_dec)
+ ._M_iterator(*this, "this"));
+ _Safe_iterator __tmp(*this);
+ --_M_current;
+ return __tmp;
+ }
+
+ // ------ Random access iterator requirements ------
+ reference
+ operator[](const difference_type& __n) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n)
+ && this->_M_can_advance(__n+1),
+ _M_message(__msg_iter_subscript_oob)
+ ._M_iterator(*this)._M_integer(__n));
+
+ return _M_current[__n];
+ }
+
+ _Safe_iterator&
+ operator+=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(__n),
+ _M_message(__msg_advance_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += __n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator+(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp += __n;
+ return __tmp;
+ }
+
+ _Safe_iterator&
+ operator-=(const difference_type& __n)
+ {
+ _GLIBCXX_DEBUG_VERIFY(this->_M_can_advance(-__n),
+ _M_message(__msg_retreat_oob)
+ ._M_iterator(*this)._M_integer(__n));
+ _M_current += -__n;
+ return *this;
+ }
+
+ _Safe_iterator
+ operator-(const difference_type& __n) const
+ {
+ _Safe_iterator __tmp(*this);
+ __tmp -= __n;
+ return __tmp;
+ }
+
+ // ------ Utilities ------
+ /**
+ * @brief Return the underlying iterator
+ */
+ _Iterator
+ base() const { return _M_current; }
+
+ /**
+ * @brief Conversion to underlying non-debug iterator to allow
+ * better interaction with non-debug containers.
+ */
+ operator _Iterator() const { return _M_current; }
+
+ /** Attach iterator to the given sequence. */
+ void
+ _M_attach(const _Sequence* __seq)
+ {
+ _Safe_iterator_base::_M_attach(const_cast<_Sequence*>(__seq),
+ _M_constant());
+ }
+
+ /** Invalidate the iterator, making it singular. */
+ void
+ _M_invalidate();
+
+ /// Is the iterator dereferenceable?
+ bool
+ _M_dereferenceable() const
+ { return !this->_M_singular() && !_M_is_end(); }
+
+ /// Is the iterator incrementable?
+ bool
+ _M_incrementable() const { return this->_M_dereferenceable(); }
+
+ // Is the iterator decrementable?
+ bool
+ _M_decrementable() const { return !_M_singular() && !_M_is_begin(); }
+
+ // Can we advance the iterator @p __n steps (@p __n may be negative)
+ bool
+ _M_can_advance(const difference_type& __n) const;
+
+ // Is the iterator range [*this, __rhs) valid?
+ template<typename _Other>
+ bool
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const;
+
+ // The sequence this iterator references.
+ const _Sequence*
+ _M_get_sequence() const
+ { return static_cast<const _Sequence*>(_M_sequence); }
+
+ /** Determine the distance between two iterators with some known
+ * precision.
+ */
+ template<typename _Iterator1, typename _Iterator2>
+ static pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs)
+ {
+ typedef typename iterator_traits<_Iterator1>::iterator_category
+ _Category;
+ return _M_get_distance(__lhs, __rhs, _Category());
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::random_access_iterator_tag)
+ {
+ return std::make_pair(__rhs.base() - __lhs.base(), __dp_exact);
+ }
+
+ template<typename _Iterator1, typename _Iterator2>
+ static pair<difference_type, _Distance_precision>
+ _M_get_distance(const _Iterator1& __lhs, const _Iterator2& __rhs,
+ std::forward_iterator_tag)
+ {
+ return std::make_pair(__lhs.base() == __rhs.base()? 0 : 1,
+ __dp_equality);
+ }
+
+ /// Is this iterator equal to the sequence's begin() iterator?
+ bool _M_is_begin() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->begin(); }
+
+ /// Is this iterator equal to the sequence's end() iterator?
+ bool _M_is_end() const
+ { return *this == static_cast<const _Sequence*>(_M_sequence)->end(); }
+ };
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator==(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() == __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator!=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_compare_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_compare_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() != __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() < __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator<=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() <= __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() > __rhs.base();
+ }
+
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline bool
+ operator>=(const _Safe_iterator<_Iterator, _Sequence>& __lhs,
+ const _Safe_iterator<_Iterator, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_iter_order_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_order_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() >= __rhs.base();
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // According to the resolution of DR179 not only the various comparison
+ // operators but also operator- must accept mixed iterator/const_iterator
+ // parameters.
+ template<typename _IteratorL, typename _IteratorR, typename _Sequence>
+ inline typename _Safe_iterator<_IteratorL, _Sequence>::difference_type
+ operator-(const _Safe_iterator<_IteratorL, _Sequence>& __lhs,
+ const _Safe_iterator<_IteratorR, _Sequence>& __rhs)
+ {
+ _GLIBCXX_DEBUG_VERIFY(! __lhs._M_singular() && ! __rhs._M_singular(),
+ _M_message(__msg_distance_bad)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ _GLIBCXX_DEBUG_VERIFY(__lhs._M_can_compare(__rhs),
+ _M_message(__msg_distance_different)
+ ._M_iterator(__lhs, "lhs")
+ ._M_iterator(__rhs, "rhs"));
+ return __lhs.base() - __rhs.base();
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ inline _Safe_iterator<_Iterator, _Sequence>
+ operator+(typename _Safe_iterator<_Iterator,_Sequence>::difference_type __n,
+ const _Safe_iterator<_Iterator, _Sequence>& __i)
+ { return __i + __n; }
+} // namespace __gnu_debug
+
+#ifndef _GLIBCXX_EXPORT_TEMPLATE
+# include <debug/safe_iterator.tcc>
+#endif
+
+#endif
diff --git a/libstdc++-v3/include/debug/safe_iterator.tcc b/libstdc++-v3/include/debug/safe_iterator.tcc
new file mode 100644
index 00000000000..29813f4e8e2
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_iterator.tcc
@@ -0,0 +1,140 @@
+// Debugging iterator implementation (out of line) -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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.
+
+/** @file safe_iterator.tcc
+ * This is an internal header file, included by other library headers.
+ * You should not attempt to use it directly.
+ */
+
+#ifndef _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC
+#define _GLIBCXX_DEBUG_SAFE_ITERATOR_TCC 1
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_can_advance(const difference_type& __n) const
+ {
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (this->_M_singular())
+ return false;
+ if (__n == 0)
+ return true;
+ if (__n < 0)
+ {
+ const_iterator __begin =
+ static_cast<const _Sequence*>(_M_sequence)->begin();
+ pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(__begin, *this);
+ bool __ok = (__dist.second == __dp_exact && __dist.first >= -__n
+ || __dist.second != __dp_exact && __dist.first > 0);
+ return __ok;
+ }
+ else
+ {
+ const_iterator __end =
+ static_cast<const _Sequence*>(_M_sequence)->end();
+ pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __end);
+ bool __ok = (__dist.second == __dp_exact && __dist.first >= __n
+ || __dist.second != __dp_exact && __dist.first > 0);
+ return __ok;
+ }
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ template<typename _Other>
+ bool
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_valid_range(const _Safe_iterator<_Other, _Sequence>& __rhs) const
+ {
+ if (!_M_can_compare(__rhs))
+ return false;
+
+ /* Determine if we can order the iterators without the help of
+ the container */
+ pair<difference_type, _Distance_precision> __dist =
+ this->_M_get_distance(*this, __rhs);
+ switch (__dist.second) {
+ case __dp_equality:
+ if (__dist.first == 0)
+ return true;
+ break;
+
+ case __dp_sign:
+ case __dp_exact:
+ return __dist.first >= 0;
+ }
+
+ /* We can only test for equality, but check if one of the
+ iterators is at an extreme. */
+ if (_M_is_begin() || __rhs._M_is_end())
+ return true;
+ else if (_M_is_end() || __rhs._M_is_begin())
+ return false;
+
+ // Assume that this is a valid range; we can't check anything else
+ return true;
+ }
+
+ template<typename _Iterator, typename _Sequence>
+ void
+ _Safe_iterator<_Iterator, _Sequence>::
+ _M_invalidate()
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ if (!this->_M_singular())
+ {
+ for (_Safe_iterator_base* iter = _M_sequence->_M_iterators; iter; )
+ {
+ iterator* __victim = static_cast<iterator*>(iter);
+ iter = iter->_M_next;
+ if (this->base() == __victim->base())
+ __victim->_M_version = 0;
+ }
+ for (_Safe_iterator_base* iter = _M_sequence->_M_const_iterators;
+ iter; /* increment in loop */)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(iter);
+ iter = iter->_M_next;
+ if (this->base() == __victim->base())
+ __victim->_M_version = 0;
+ }
+ _M_version = 0;
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
+
diff --git a/libstdc++-v3/include/debug/safe_sequence.h b/libstdc++-v3/include/debug/safe_sequence.h
new file mode 100644
index 00000000000..0bae9430313
--- /dev/null
+++ b/libstdc++-v3/include/debug/safe_sequence.h
@@ -0,0 +1,179 @@
+// Safe sequence implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_SAFE_SEQUENCE_H
+#define _GLIBCXX_DEBUG_SAFE_SEQUENCE_H 1
+
+#include <debug/debug.h>
+#include <debug/safe_base.h>
+
+namespace __gnu_debug
+{
+ template<typename _Iterator, typename _Sequence>
+ class _Safe_iterator;
+
+ /** A simple function object that returns true if the passed-in
+ * value is not equal to the stored value. It saves typing over
+ * using both bind1st and not_equal.
+ */
+ template<typename _Type>
+ class _Not_equal_to
+ {
+ _Type __value;
+
+ public:
+ explicit _Not_equal_to(const _Type& __v) : __value(__v) { }
+
+ bool
+ operator()(const _Type& __x) const
+ { return __value != __x; }
+ };
+
+ /** A function object that returns true when the given random access
+ iterator is at least @c n steps away from the given iterator. */
+ template<typename _Iterator>
+ class _After_nth_from
+ {
+ typedef typename std::iterator_traits<_Iterator>::difference_type
+ difference_type;
+
+ _Iterator _M_base;
+ difference_type _M_n;
+
+ public:
+ _After_nth_from(const difference_type& __n, const _Iterator& __base)
+ : _M_base(__base), _M_n(__n) { }
+
+ bool
+ operator()(const _Iterator& __x) const
+ { return __x - _M_base >= _M_n; }
+ };
+
+ /**
+ * @brief Base class for constructing a "safe" sequence type that
+ * tracks iterators that reference it.
+ *
+ * The class template %_Safe_sequence simplifies the construction of
+ * "safe" sequences that track the iterators that reference the
+ * sequence, so that the iterators are notified of changes in the
+ * sequence that may affect their operation, e.g., if the container
+ * invalidates its iterators or is destructed. This class template
+ * may only be used by deriving from it and passing the name of the
+ * derived class as its template parameter via the curiously
+ * recurring template pattern. The derived class must have @c
+ * iterator and @const_iterator types that are instantiations of
+ * class template _Safe_iterator for this sequence. Iterators will
+ * then be tracked automatically.
+ */
+ template<typename _Sequence>
+ class _Safe_sequence : public _Safe_sequence_base
+ {
+ public:
+ /** Invalidates all iterators @c x that reference this sequence,
+ are not singular, and for which @c pred(x) returns @c
+ true. The user of this routine should be careful not to make
+ copies of the iterators passed to @p pred, as the copies may
+ interfere with the invalidation. */
+ template<typename _Predicate>
+ void
+ _M_invalidate_if(_Predicate __pred);
+
+ /** Transfers all iterators that reference this memory location
+ to this sequence from whatever sequence they are attached
+ to. */
+ template<typename _Iterator>
+ void
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x);
+ };
+
+ template<typename _Sequence>
+ template<typename _Predicate>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_invalidate_if(_Predicate __pred)
+ {
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ for (_Safe_iterator_base* __iter = _M_iterators; __iter; )
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate();
+ }
+ }
+
+ for (_Safe_iterator_base* __iter = _M_const_iterators; __iter; )
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular())
+ {
+ if (__pred(__victim->base()))
+ __victim->_M_invalidate();
+ }
+ }
+ }
+
+ template<typename _Sequence>
+ template<typename _Iterator>
+ void
+ _Safe_sequence<_Sequence>::
+ _M_transfer_iter(const _Safe_iterator<_Iterator, _Sequence>& __x)
+ {
+ _Safe_sequence_base* __from = __x._M_sequence;
+ if (!__from)
+ return;
+
+ typedef typename _Sequence::iterator iterator;
+ typedef typename _Sequence::const_iterator const_iterator;
+
+ for (_Safe_iterator_base* __iter = __from->_M_iterators; __iter; )
+ {
+ iterator* __victim = static_cast<iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach(static_cast<_Sequence*>(this));
+ }
+
+ for (_Safe_iterator_base* __iter = __from->_M_const_iterators; __iter;)
+ {
+ const_iterator* __victim = static_cast<const_iterator*>(__iter);
+ __iter = __iter->_M_next;
+ if (!__victim->_M_singular() && __victim->base() == __x.base())
+ __victim->_M_attach(static_cast<_Sequence*>(this));
+ }
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/set b/libstdc++-v3/include/debug/set
new file mode 100644
index 00000000000..a1a69efb4f4
--- /dev/null
+++ b/libstdc++-v3/include/debug/set
@@ -0,0 +1,38 @@
+// Debugging set/multiset implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_SET
+#define _GLIBCXX_DEBUG_SET 1
+
+#include <set>
+#include <debug/set.h>
+#include <debug/multiset.h>
+
+#endif
diff --git a/libstdc++-v3/include/debug/set.h b/libstdc++-v3/include/debug/set.h
new file mode 100644
index 00000000000..b9200adf233
--- /dev/null
+++ b/libstdc++-v3/include/debug/set.h
@@ -0,0 +1,325 @@
+// Debugging set implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_SET_H
+#define _GLIBCXX_DEBUG_SET_H 1
+
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace __gnu_debug_def
+{
+ template<typename _Key, typename _Compare = std::less<_Key>,
+ typename _Allocator = std::allocator<_Key> >
+ class set
+ : public __gnu_norm::set<_Key,_Compare,_Allocator>,
+ public __gnu_debug::_Safe_sequence<set<_Key, _Compare, _Allocator> >
+ {
+ typedef __gnu_norm::set<_Key,_Compare,_Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<set> _Safe_base;
+
+ public:
+ // types:
+ typedef _Key key_type;
+ typedef _Key value_type;
+ typedef _Compare key_compare;
+ typedef _Compare value_compare;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, set>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator, set>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.3.3.1 construct/copy/destroy:
+ explicit set(const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__comp, __a) { }
+
+ template<typename _InputIterator>
+ set(_InputIterator __first, _InputIterator __last,
+ const _Compare& __comp = _Compare(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last), __last,
+ __comp, __a) { }
+
+ set(const set<_Key,_Compare,_Allocator>& __x)
+ : _Base(__x), _Safe_base() { }
+
+ set(const _Base& __x) : _Base(__x), _Safe_base() { }
+
+ ~set() { }
+
+ set<_Key,_Compare,_Allocator>&
+ operator=(const set<_Key,_Compare,_Allocator>& __x)
+ {
+ *static_cast<_Base*>(this) = __x;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // capacity:
+ using _Base::empty;
+ using _Base::size;
+ using _Base::max_size;
+
+ // modifiers:
+ std::pair<iterator, bool>
+ insert(const value_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, bool> __res = _Base::insert(__x);
+ return std::pair<iterator, bool>(iterator(__res.first, this),
+ __res.second);
+ }
+
+ iterator
+ insert(iterator __position, const value_type& __x)
+ {
+ __glibcxx_check_insert(__position);
+ return iterator(_Base::insert(__position.base(), __x), this);
+ }
+
+ template <typename _InputIterator>
+ void
+ insert(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::insert(__first, __last);
+ }
+
+ void
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ __position._M_invalidate();
+ _Base::erase(__position.base());
+ }
+
+ size_type
+ erase(const key_type& __x)
+ {
+ iterator __victim = find(__x);
+ if (__victim == end())
+ return 0;
+ else
+ {
+ __victim._M_invalidate();
+ _Base::erase(__victim.base());
+ return 1;
+ }
+ }
+
+ void
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ while (__first != __last)
+ this->erase(__first++);
+ }
+
+ void
+ swap(set<_Key,_Compare,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ }
+
+ void
+ clear()
+ { this->erase(begin(), end()); }
+
+ // observers:
+ using _Base::key_comp;
+ using _Base::value_comp;
+
+ // set operations:
+ iterator
+ find(const key_type& __x)
+ { return iterator(_Base::find(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ find(const key_type& __x) const
+ { return const_iterator(_Base::find(__x), this); }
+
+ using _Base::count;
+
+ iterator
+ lower_bound(const key_type& __x)
+ { return iterator(_Base::lower_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ lower_bound(const key_type& __x) const
+ { return const_iterator(_Base::lower_bound(__x), this); }
+
+ iterator
+ upper_bound(const key_type& __x)
+ { return iterator(_Base::upper_bound(__x), this); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ const_iterator
+ upper_bound(const key_type& __x) const
+ { return const_iterator(_Base::upper_bound(__x), this); }
+
+ std::pair<iterator,iterator>
+ equal_range(const key_type& __x)
+ {
+ typedef typename _Base::iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(iterator(__res.first, this),
+ iterator(__res.second, this));
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 214. set::find() missing const overload
+ std::pair<const_iterator,const_iterator>
+ equal_range(const key_type& __x) const
+ {
+ typedef typename _Base::const_iterator _Base_iterator;
+ std::pair<_Base_iterator, _Base_iterator> __res =
+ _Base::equal_range(__x);
+ return std::make_pair(const_iterator(__res.first, this),
+ const_iterator(__res.second, this));
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ void
+ _M_invalidate_all()
+ {
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_Not_equal_to<_Base_const_iterator> _Not_equal;
+ this->_M_invalidate_if(_Not_equal(_M_base().end()));
+ }
+ };
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator==(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator!=(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator<=(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>=(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ inline bool
+ operator>(const set<_Key,_Compare,_Allocator>& __lhs,
+ const set<_Key,_Compare,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Key, typename _Compare, typename _Allocator>
+ void
+ swap(set<_Key,_Compare,_Allocator>& __x,
+ set<_Key,_Compare,_Allocator>& __y)
+ { return __x.swap(__y); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/debug/string b/libstdc++-v3/include/debug/string
new file mode 100644
index 00000000000..a91c004e937
--- /dev/null
+++ b/libstdc++-v3/include/debug/string
@@ -0,0 +1,1001 @@
+// Debugging string implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_STRING
+#define _GLIBCXX_DEBUG_STRING 1
+
+#include <string>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+
+namespace __gnu_debug
+{
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ class basic_string
+ : public std::basic_string<_CharT, _Traits, _Allocator>,
+ public __gnu_debug::_Safe_sequence<basic_string<_CharT, _Traits,
+ _Allocator> >
+ {
+ typedef std::basic_string<_CharT, _Traits, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<basic_string> _Safe_base;
+
+ public:
+ // types:
+ typedef _Traits traits_type;
+ typedef typename _Traits::char_type value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::size_type size_type;
+ typedef typename _Allocator::difference_type difference_type;
+ typedef typename _Allocator::reference reference;
+ typedef typename _Allocator::const_reference const_reference;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator, basic_string>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,
+ basic_string> const_iterator;
+
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ using _Base::npos;
+
+ // 21.3.1 construct/copy/destroy:
+ explicit basic_string(const _Allocator& __a = _Allocator())
+ : _Base(__a)
+ { }
+
+ // Provides conversion from a release-mode string to a debug-mode string
+ basic_string(const _Base& __base) : _Base(__base), _Safe_base() { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str)
+ : _Base(__str, 0, _Base::npos, __str.get_allocator()), _Safe_base()
+ { }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 42. string ctors specify wrong default allocator
+ basic_string(const basic_string& __str, size_type __pos,
+ size_type __n = _Base::npos,
+ const _Allocator& __a = _Allocator())
+ : _Base(__str, __pos, __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, size_type __n,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s, __n), __n, __a)
+ { }
+
+ basic_string(const _CharT* __s, const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_string(__s), __a)
+ { this->assign(__s); }
+
+ basic_string(size_type __n, _CharT __c,
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __c, __a)
+ { }
+
+ template<typename _InputIterator>
+ basic_string(_InputIterator __begin, _InputIterator __end,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__begin, __end), __end, __a)
+ { }
+
+ ~basic_string() { }
+
+ basic_string&
+ operator=(const basic_string& __str)
+ {
+ *static_cast<_Base*>(this) = __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ *static_cast<_Base*>(this) = __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator=(_CharT __c)
+ {
+ *static_cast<_Base*>(this) = __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ // 21.3.2 iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // 21.3.3 capacity:
+ using _Base::size;
+ using _Base::length;
+ using _Base::max_size;
+
+ void
+ resize(size_type __n, _CharT __c)
+ {
+ _Base::resize(__n, __c);
+ this->_M_invalidate_all();
+ }
+
+ void
+ resize(size_type __n)
+ { this->resize(__n, _CharT()); }
+
+ using _Base::capacity;
+ using _Base::reserve;
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ }
+
+ using _Base::empty;
+
+ // 21.3.4 element access:
+ const_reference
+ operator[](size_type __pos) const
+ {
+ _GLIBCXX_DEBUG_VERIFY(__pos <= this->size(),
+ _M_message(::__gnu_debug::__msg_subscript_oob)
+ ._M_sequence(*this, "this")
+ ._M_integer(__pos, "__pos")
+ ._M_integer(this->size(), "size"));
+ return _M_base()[__pos];
+ }
+
+ reference
+ operator[](size_type __pos)
+ {
+ __glibcxx_check_subscript(__pos);
+ return _M_base()[__pos];
+ }
+
+ using _Base::at;
+
+ // 21.3.5 modifiers:
+ basic_string&
+ operator+=(const basic_string& __str)
+ {
+ _M_base() += __str;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _M_base() += __s;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ operator+=(_CharT __c)
+ {
+ _M_base() += __c;
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const basic_string& __str)
+ {
+ _Base::append(__str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::append(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::append(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::append(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ append(size_type __n, _CharT __c)
+ {
+ _Base::append(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ append(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::append(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 7. string clause minor problems
+ void
+ push_back(_CharT __c)
+ {
+ _Base::push_back(__c);
+ this->_M_invalidate_all();
+ }
+
+ basic_string&
+ assign(const basic_string& __x)
+ {
+ _Base::assign(__x);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const basic_string& __str, size_type __pos, size_type __n)
+ {
+ _Base::assign(__str, __pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string_len(__s, __n);
+ _Base::assign(__s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::assign(__s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ assign(size_type __n, _CharT __c)
+ {
+ _Base::assign(__n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str)
+ {
+ _Base::insert(__pos1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos1, const basic_string& __str,
+ size_type __pos2, size_type __n)
+ {
+ _Base::insert(__pos1, __str, __pos2, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::insert(__pos, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ insert(size_type __pos, size_type __n, _CharT __c)
+ {
+ _Base::insert(__pos, __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ insert(iterator __p, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ typename _Base::iterator __res = _Base::insert(__p.base(), __c);
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ void
+ insert(iterator __p, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_insert(__p);
+ _Base::insert(__p.base(), __n, __c);
+ this->_M_invalidate_all();
+ }
+
+ template<typename _InputIterator>
+ void
+ insert(iterator __p, _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__p, __first, __last);
+ _Base::insert(__p.base(), __first, __last);
+ this->_M_invalidate_all();
+ }
+
+ basic_string&
+ erase(size_type __pos = 0, size_type __n = _Base::npos)
+ {
+ _Base::erase(__pos, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_all();
+ return iterator(__res, this);
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str)
+ {
+ _Base::replace(__pos1, __n1, __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2)
+ {
+ _Base::replace(__pos1, __n1, __str, __pos2, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s,
+ size_type __n2)
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ _Base::replace(__pos, __n1, __s, __n2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, const _CharT* __s)
+ {
+ __glibcxx_check_string(__s);
+ _Base::replace(__pos, __n1, __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(size_type __pos, size_type __n1, size_type __n2, _CharT __c)
+ {
+ _Base::replace(__pos, __n1, __n2, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const basic_string& __str)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __str);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s, size_type __n)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string_len(__s, __n);
+ _Base::replace(__i1.base(), __i2.base(), __s, __n);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, const _CharT* __s)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_string(__s);
+ _Base::replace(__i1.base(), __i2.base(), __s);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ basic_string&
+ replace(iterator __i1, iterator __i2, size_type __n, _CharT __c)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ _Base::replace(__i1.base(), __i2.base(), __n, __c);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ basic_string&
+ replace(iterator __i1, iterator __i2,
+ _InputIterator __j1, _InputIterator __j2)
+ {
+ __glibcxx_check_erase_range(__i1, __i2);
+ __glibcxx_check_valid_range(__j1, __j2);
+ _Base::replace(__i1.base(), __i2.base(), __j1, __j2);
+ this->_M_invalidate_all();
+ return *this;
+ }
+
+ size_type
+ copy(_CharT* __s, size_type __n, size_type __pos = 0) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::copy(__s, __n, __pos);
+ }
+
+ void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ this->_M_invalidate_all();
+ __x._M_invalidate_all();
+ }
+
+ // 21.3.6 string operations:
+ const _CharT*
+ c_str() const
+ {
+ const _CharT* __res = _Base::c_str();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ const _CharT*
+ data() const
+ {
+ const _CharT* __res = _Base::data();
+ this->_M_invalidate_all();
+ return __res;
+ }
+
+ using _Base::get_allocator;
+
+ size_type
+ find(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find(__str, __pos); }
+
+ size_type
+ find(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos, __n);
+ }
+
+ size_type
+ find(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find(__s, __pos);
+ }
+
+ size_type
+ find(_CharT __c, size_type __pos = 0) const
+ { return _Base::find(__c, __pos); }
+
+ size_type
+ rfind(const basic_string& __str, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__str, __pos); }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::rfind(__s, __pos, __n);
+ }
+
+ size_type
+ rfind(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::rfind(__s, __pos);
+ }
+
+ size_type
+ rfind(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::rfind(__c, __pos); }
+
+ size_type
+ find_first_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_of(__str, __pos); }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_of(__s, __pos);
+ }
+
+ size_type
+ find_first_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_of(__c, __pos); }
+
+ size_type
+ find_last_of(const basic_string& __str, size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__str, __pos); }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_of(__s, __pos);
+ }
+
+ size_type
+ find_last_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_of(__c, __pos); }
+
+ size_type
+ find_first_not_of(const basic_string& __str, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__str, __pos); }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string_len(__s, __n);
+ return _Base::find_first_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_first_not_of(const _CharT* __s, size_type __pos = 0) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_first_not_of(__s, __pos);
+ }
+
+ size_type
+ find_first_not_of(_CharT __c, size_type __pos = 0) const
+ { return _Base::find_first_not_of(__c, __pos); }
+
+ size_type
+ find_last_not_of(const basic_string& __str,
+ size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__str, __pos); }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos, size_type __n) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos, __n);
+ }
+
+ size_type
+ find_last_not_of(const _CharT* __s, size_type __pos = _Base::npos) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::find_last_not_of(__s, __pos);
+ }
+
+ size_type
+ find_last_not_of(_CharT __c, size_type __pos = _Base::npos) const
+ { return _Base::find_last_not_of(__c, __pos); }
+
+ basic_string
+ substr(size_type __pos = 0, size_type __n = _Base::npos) const
+ { return basic_string(_Base::substr(__pos, __n)); }
+
+ int
+ compare(const basic_string& __str) const
+ { return _Base::compare(__str); }
+
+ int
+ compare(size_type __pos1, size_type __n1,
+ const basic_string& __str) const
+ { return _Base::compare(__pos1, __n1, __str); }
+
+ int
+ compare(size_type __pos1, size_type __n1, const basic_string& __str,
+ size_type __pos2, size_type __n2) const
+ { return _Base::compare(__pos1, __n1, __str, __pos2, __n2); }
+
+ int
+ compare(const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1, const _CharT* __s) const
+ {
+ __glibcxx_check_string(__s);
+ return _Base::compare(__pos1, __n1, __s);
+ }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 5. string::compare specification questionable
+ int
+ compare(size_type __pos1, size_type __n1,const _CharT* __s,
+ size_type __n2) const
+ {
+ __glibcxx_check_string_len(__s, __n2);
+ return _Base::compare(__pos1, __n1, __s, __n2);
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ using _Safe_base::_M_invalidate_all;
+ };
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(_CharT __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(1, __lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline basic_string<_CharT,_Traits,_Allocator>
+ operator+(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ _CharT __rhs)
+ { return basic_string<_CharT,_Traits,_Allocator>(__lhs) += __rhs; }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs == __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator==(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() == __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs != __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator!=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() != __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs < __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() < __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs <= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator<=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() <= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs >= __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>=(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() >= __rhs;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const _CharT* __lhs,
+ const basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ {
+ __glibcxx_check_string(__lhs);
+ return __lhs > __rhs._M_base();
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline bool
+ operator>(const basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ const _CharT* __rhs)
+ {
+ __glibcxx_check_string(__rhs);
+ return __lhs._M_base() > __rhs;
+ }
+
+ // 21.3.7.8:
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ inline void
+ swap(basic_string<_CharT,_Traits,_Allocator>& __lhs,
+ basic_string<_CharT,_Traits,_Allocator>& __rhs)
+ { __lhs.swap(__rhs); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_ostream<_CharT, _Traits>&
+ operator<<(std::basic_ostream<_CharT, _Traits>& __os,
+ const basic_string<_CharT, _Traits, _Allocator>& __str)
+ { return __os << __str._M_base(); }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ operator>>(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = __is >> __str._M_base();
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str, _CharT __delim)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base(),
+ __delim);
+ __str._M_invalidate_all();
+ return __res;
+ }
+
+ template<typename _CharT, typename _Traits, typename _Allocator>
+ std::basic_istream<_CharT,_Traits>&
+ getline(std::basic_istream<_CharT,_Traits>& __is,
+ basic_string<_CharT,_Traits,_Allocator>& __str)
+ {
+ std::basic_istream<_CharT,_Traits>& __res = getline(__is,
+ __str._M_base());
+ __str._M_invalidate_all();
+ return __res;
+ }
+} // namespace __gnu_debug
+
+#endif
diff --git a/libstdc++-v3/include/debug/vector b/libstdc++-v3/include/debug/vector
new file mode 100644
index 00000000000..f7fa3e8f092
--- /dev/null
+++ b/libstdc++-v3/include/debug/vector
@@ -0,0 +1,412 @@
+// Debugging vector implementation -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 _GLIBCXX_DEBUG_VECTOR
+#define _GLIBCXX_DEBUG_VECTOR 1
+
+#include <vector>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <utility>
+
+namespace __gnu_debug_def
+{
+ template<typename _Tp,
+ typename _Allocator = std::allocator<_Tp> >
+ class vector
+ : public __gnu_norm::vector<_Tp, _Allocator>,
+ public __gnu_debug::_Safe_sequence<vector<_Tp, _Allocator> >
+ {
+ typedef __gnu_norm::vector<_Tp, _Allocator> _Base;
+ typedef __gnu_debug::_Safe_sequence<vector> _Safe_base;
+
+ typedef typename _Base::const_iterator _Base_const_iterator;
+ typedef __gnu_debug::_After_nth_from<_Base_const_iterator> _After_nth;
+
+ public:
+ typedef typename _Base::reference reference;
+ typedef typename _Base::const_reference const_reference;
+
+ typedef __gnu_debug::_Safe_iterator<typename _Base::iterator,vector>
+ iterator;
+ typedef __gnu_debug::_Safe_iterator<typename _Base::const_iterator,vector>
+ const_iterator;
+
+ typedef typename _Base::size_type size_type;
+ typedef typename _Base::difference_type difference_type;
+
+ typedef _Tp value_type;
+ typedef _Allocator allocator_type;
+ typedef typename _Allocator::pointer pointer;
+ typedef typename _Allocator::const_pointer const_pointer;
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+
+ // 23.2.4.1 construct/copy/destroy:
+ explicit vector(const _Allocator& __a = _Allocator())
+ : _Base(__a), _M_guaranteed_capacity(0) { }
+
+ explicit vector(size_type __n, const _Tp& __value = _Tp(),
+ const _Allocator& __a = _Allocator())
+ : _Base(__n, __value, __a), _M_guaranteed_capacity(__n) { }
+
+ template<class _InputIterator>
+ vector(_InputIterator __first, _InputIterator __last,
+ const _Allocator& __a = _Allocator())
+ : _Base(__gnu_debug::__check_valid_range(__first, __last),
+ __last, __a),
+ _M_guaranteed_capacity(0)
+ { _M_update_guaranteed_capacity(); }
+
+ vector(const vector<_Tp,_Allocator>& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+ /// Construction from a release-mode vector
+ vector(const _Base& __x)
+ : _Base(__x), _Safe_base(), _M_guaranteed_capacity(__x.size()) { }
+
+ ~vector() { }
+
+ vector<_Tp,_Allocator>&
+ operator=(const vector<_Tp,_Allocator>& __x)
+ {
+ static_cast<_Base&>(*this) = __x;
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ return *this;
+ }
+
+ template<typename _InputIterator>
+ void
+ assign(_InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_valid_range(__first, __last);
+ _Base::assign(__first, __last);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+ void
+ assign(size_type __n, const _Tp& __u)
+ {
+ _Base::assign(__n, __u);
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+ using _Base::get_allocator;
+
+ // iterators:
+ iterator
+ begin()
+ { return iterator(_Base::begin(), this); }
+
+ const_iterator
+ begin() const
+ { return const_iterator(_Base::begin(), this); }
+
+ iterator
+ end()
+ { return iterator(_Base::end(), this); }
+
+ const_iterator
+ end() const
+ { return const_iterator(_Base::end(), this); }
+
+ 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()); }
+
+ // 23.2.4.2 capacity:
+ using _Base::size;
+ using _Base::max_size;
+
+ void
+ resize(size_type __sz, _Tp __c = _Tp())
+ {
+ bool __realloc = _M_requires_reallocation(__sz);
+ if (__sz < this->size())
+ this->_M_invalidate_if(_After_nth(__sz, _M_base().begin()));
+ _Base::resize(__sz, __c);
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ using _Base::capacity;
+ using _Base::empty;
+
+ void
+ reserve(size_type __n)
+ {
+ bool __realloc = _M_requires_reallocation(__n);
+ _Base::reserve(__n);
+ if (__n > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = __n;
+ if (__realloc)
+ this->_M_invalidate_all();
+ }
+
+ // element access:
+ reference
+ operator[](size_type __n)
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ const_reference
+ operator[](size_type __n) const
+ {
+ __glibcxx_check_subscript(__n);
+ return _M_base()[__n];
+ }
+
+ using _Base::at;
+
+ reference
+ front()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ const_reference
+ front() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::front();
+ }
+
+ reference
+ back()
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ const_reference
+ back() const
+ {
+ __glibcxx_check_nonempty();
+ return _Base::back();
+ }
+
+ // 23.2.4.3 modifiers:
+ void
+ push_back(const _Tp& __x)
+ {
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ _Base::push_back(__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ _M_update_guaranteed_capacity();
+ }
+
+ void
+ pop_back()
+ {
+ __glibcxx_check_nonempty();
+ iterator __victim = end() - 1;
+ __victim._M_invalidate();
+ _Base::pop_back();
+ }
+
+ iterator
+ insert(iterator __position, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + 1);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::insert(__position.base(),__x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ return iterator(__res, this);
+ }
+
+ void
+ insert(iterator __position, size_type __n, const _Tp& __x)
+ {
+ __glibcxx_check_insert(__position);
+ bool __realloc = _M_requires_reallocation(this->size() + __n);
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __n, __x);
+ if (__realloc)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ template<class _InputIterator>
+ void
+ insert(iterator __position,
+ _InputIterator __first, _InputIterator __last)
+ {
+ __glibcxx_check_insert_range(__position, __first, __last);
+
+ /* Hard to guess if invalidation will occur, because __last
+ - __first can't be calculated in all cases, so we just
+ punt here by checking if it did occur. */
+ typename _Base::iterator __old_begin = _M_base().begin();
+ difference_type __offset = __position - begin();
+ _Base::insert(__position.base(), __first, __last);
+
+ if (_M_base().begin() != __old_begin)
+ this->_M_invalidate_all();
+ else
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ _M_update_guaranteed_capacity();
+ }
+
+ iterator
+ erase(iterator __position)
+ {
+ __glibcxx_check_erase(__position);
+ difference_type __offset = __position - begin();
+ typename _Base::iterator __res = _Base::erase(__position.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ iterator
+ erase(iterator __first, iterator __last)
+ {
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 151. can't currently clear() empty container
+ __glibcxx_check_erase_range(__first, __last);
+
+ difference_type __offset = __first - begin();
+ typename _Base::iterator __res = _Base::erase(__first.base(),
+ __last.base());
+ this->_M_invalidate_if(_After_nth(__offset, _M_base().begin()));
+ return iterator(__res, this);
+ }
+
+ void
+ swap(vector<_Tp,_Allocator>& __x)
+ {
+ _Base::swap(__x);
+ this->_M_swap(__x);
+ std::swap(_M_guaranteed_capacity, __x._M_guaranteed_capacity);
+ }
+
+ void
+ clear()
+ {
+ _Base::clear();
+ this->_M_invalidate_all();
+ _M_guaranteed_capacity = 0;
+ }
+
+ _Base&
+ _M_base() { return *this; }
+
+ const _Base&
+ _M_base() const { return *this; }
+
+ private:
+ size_type _M_guaranteed_capacity;
+
+ bool
+ _M_requires_reallocation(size_type __elements)
+ {
+#ifdef _GLIBCXX_DEBUG_PEDANTIC
+ return __elements > this->capacity();
+#else
+ return __elements > _M_guaranteed_capacity;
+#endif
+ }
+
+ void
+ _M_update_guaranteed_capacity()
+ {
+ if (this->size() > _M_guaranteed_capacity)
+ _M_guaranteed_capacity = this->size();
+ }
+ };
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator==(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() == __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator!=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() != __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() < __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator<=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() <= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>=(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() >= __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline bool
+ operator>(const vector<_Tp, _Alloc>& __lhs,
+ const vector<_Tp, _Alloc>& __rhs)
+ { return __lhs._M_base() > __rhs._M_base(); }
+
+ template<typename _Tp, typename _Alloc>
+ inline void
+ swap(vector<_Tp, _Alloc>& __lhs, vector<_Tp, _Alloc>& __rhs)
+ { __lhs.swap(__rhs); }
+} // namespace __gnu_debug_def
+
+#endif
diff --git a/libstdc++-v3/include/ext/algorithm b/libstdc++-v3/include/ext/algorithm
index 9cccec871ba..07ac4cbe4d3 100644
--- a/libstdc++-v3/include/ext/algorithm
+++ b/libstdc++-v3/include/ext/algorithm
@@ -160,11 +160,11 @@ namespace __gnu_cxx
const ptrdiff_t __len1 = __last1 - __first1;
const ptrdiff_t __len2 = __last2 - __first2;
const int __result = std::memcmp(__first1, __first2, min(__len1, __len2));
- return __result != 0 ? __result
+ return __result != 0 ? __result
: (__len1 == __len2 ? 0 : (__len1 < __len2 ? -1 : 1));
}
- inline int
+ inline int
__lexicographical_compare_3way(const char* __first1, const char* __last1,
const char* __first2, const char* __last2)
{
@@ -208,6 +208,8 @@ namespace __gnu_cxx
typename iterator_traits<_InputIterator1>::value_type>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_InputIterator2>::value_type>)
+ __glibcxx_requires_valid_range(__first1, __last1);
+ __glibcxx_requires_valid_range(__first2, __last2);
return __lexicographical_compare_3way(__first1, __last1, __first2, __last2);
}
@@ -226,6 +228,8 @@ namespace __gnu_cxx
__glibcxx_function_requires(_EqualityComparableConcept<
typename iterator_traits<_InputIterator>::value_type >)
__glibcxx_function_requires(_EqualityComparableConcept<_Tp>)
+ __glibcxx_requires_valid_range(__first, __last);
+
for ( ; __first != __last; ++__first)
if (*__first == __value)
++__n;
@@ -241,6 +245,8 @@ namespace __gnu_cxx
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_UnaryPredicateConcept<_Predicate,
typename iterator_traits<_InputIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
+
for ( ; __first != __last; ++__first)
if (__pred(*__first))
++__n;
@@ -262,12 +268,13 @@ namespace __gnu_cxx
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_OutputIteratorConcept<_OutputIterator,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
_Distance __remaining = std::distance(__first, __last);
_Distance __m = min(__n, __remaining);
while (__m > 0) {
- if (std::__random_number(__remaining) < __m) {
+ if ((std::rand() % __remaining) < __m) {
*__out = *__first;
++__out;
--__m;
@@ -288,7 +295,7 @@ namespace __gnu_cxx
typename _RandomNumberGenerator>
_OutputIterator
random_sample_n(_ForwardIterator __first, _ForwardIterator __last,
- _OutputIterator __out, const _Distance __n,
+ _OutputIterator __out, const _Distance __n,
_RandomNumberGenerator& __rand)
{
// concept requirements
@@ -297,6 +304,7 @@ namespace __gnu_cxx
typename iterator_traits<_ForwardIterator>::value_type>)
__glibcxx_function_requires(_UnaryFunctionConcept<
_RandomNumberGenerator, _Distance, _Distance>)
+ __glibcxx_requires_valid_range(__first, __last);
_Distance __remaining = std::distance(__first, __last);
_Distance __m = min(__n, __remaining);
@@ -322,12 +330,12 @@ namespace __gnu_cxx
{
_Distance __m = 0;
_Distance __t = __n;
- for ( ; __first != __last && __m < __n; ++__m, ++__first)
+ for ( ; __first != __last && __m < __n; ++__m, ++__first)
__out[__m] = *__first;
while (__first != __last) {
++__t;
- _Distance __M = std::__random_number(__t);
+ _Distance __M = std::rand() % (__t);
if (__M < __n)
__out[__M] = *__first;
++__first;
@@ -372,12 +380,14 @@ namespace __gnu_cxx
template<typename _InputIterator, typename _RandomAccessIterator>
inline _RandomAccessIterator
random_sample(_InputIterator __first, _InputIterator __last,
- _RandomAccessIterator __out_first, _RandomAccessIterator __out_last)
+ _RandomAccessIterator __out_first, _RandomAccessIterator __out_last)
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
return __random_sample(__first, __last,
__out_first, __out_last - __out_first);
@@ -388,56 +398,24 @@ namespace __gnu_cxx
* @ingroup SGIextensions
* @doctodo
*/
- template<typename _InputIterator, typename _RandomAccessIterator,
+ template<typename _InputIterator, typename _RandomAccessIterator,
typename _RandomNumberGenerator>
inline _RandomAccessIterator
random_sample(_InputIterator __first, _InputIterator __last,
_RandomAccessIterator __out_first, _RandomAccessIterator __out_last,
- _RandomNumberGenerator& __rand)
+ _RandomNumberGenerator& __rand)
{
// concept requirements
__glibcxx_function_requires(_InputIteratorConcept<_InputIterator>)
__glibcxx_function_requires(_Mutable_RandomAccessIteratorConcept<
_RandomAccessIterator>)
+ __glibcxx_requires_valid_range(__first, __last);
+ __glibcxx_requires_valid_range(__out_first, __out_last);
return __random_sample(__first, __last,
__out_first, __rand,
__out_last - __out_first);
}
-
- // is_heap, a predicate testing whether or not a range is
- // a heap. This function is an extension, not part of the C++
- // standard.
-
- template<typename _RandomAccessIterator, typename _Distance>
- bool
- __is_heap(_RandomAccessIterator __first, _Distance __n)
- {
- _Distance __parent = 0;
- for (_Distance __child = 1; __child < __n; ++__child) {
- if (__first[__parent] < __first[__child])
- return false;
- if ((__child & 1) == 0)
- ++__parent;
- }
- return true;
- }
-
- template<typename _RandomAccessIterator, typename _Distance,
- typename _StrictWeakOrdering>
- bool
- __is_heap(_RandomAccessIterator __first, _StrictWeakOrdering __comp,
- _Distance __n)
- {
- _Distance __parent = 0;
- for (_Distance __child = 1; __child < __n; ++__child) {
- if (__comp(__first[__parent], __first[__child]))
- return false;
- if ((__child & 1) == 0)
- ++__parent;
- }
- return true;
- }
/**
* This is an SGI extension.
@@ -452,8 +430,9 @@ namespace __gnu_cxx
__glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
- return __is_heap(__first, __last - __first);
+ return std::__is_heap(__first, __last - __first);
}
/**
@@ -469,10 +448,11 @@ namespace __gnu_cxx
// concept requirements
__glibcxx_function_requires(_RandomAccessIteratorConcept<_RandomAccessIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
- typename iterator_traits<_RandomAccessIterator>::value_type,
+ typename iterator_traits<_RandomAccessIterator>::value_type,
typename iterator_traits<_RandomAccessIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
- return __is_heap(__first, __comp, __last - __first);
+ return std::__is_heap(__first, __comp, __last - __first);
}
// is_sorted, a predicated testing whether a range is sorted in
@@ -492,6 +472,7 @@ namespace __gnu_cxx
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_LessThanComparableConcept<
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return true;
@@ -517,8 +498,9 @@ namespace __gnu_cxx
// concept requirements
__glibcxx_function_requires(_ForwardIteratorConcept<_ForwardIterator>)
__glibcxx_function_requires(_BinaryPredicateConcept<_StrictWeakOrdering,
- typename iterator_traits<_ForwardIterator>::value_type,
+ typename iterator_traits<_ForwardIterator>::value_type,
typename iterator_traits<_ForwardIterator>::value_type>)
+ __glibcxx_requires_valid_range(__first, __last);
if (__first == __last)
return true;
@@ -531,7 +513,6 @@ namespace __gnu_cxx
return true;
}
-
} // namespace __gnu_cxx
#endif /* _EXT_ALGORITHM */
diff --git a/libstdc++-v3/include/ext/debug_allocator.h b/libstdc++-v3/include/ext/debug_allocator.h
index 0f7eb0c653d..e744ab61fae 100644
--- a/libstdc++-v3/include/ext/debug_allocator.h
+++ b/libstdc++-v3/include/ext/debug_allocator.h
@@ -41,99 +41,65 @@
*/
/** @file ext/debug_allocator.h
- * This file is a GNU extension to the Standard C++ Library.
+ * This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
#ifndef _DEBUG_ALLOCATOR_H
#define _DEBUG_ALLOCATOR_H 1
-#include <bits/allocator_traits.h>
+#include <memory>
namespace __gnu_cxx
{
/**
- * @if maint
- * An adaptor for an underlying allocator (_Alloc) to check the size
- * arguments for debugging.
+ * @brief A meta-allocator with debugging bits, as per [20.4].
*
- * "There is some evidence that this can confuse Purify." - SGI comment
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
*
- * This adaptor is "SGI" style. The _Alloc parameter must also be "SGI".
- * @endif
* (See @link Allocators allocators info @endlink for more.)
*/
template<typename _Alloc>
- class __debug_alloc
+ class debug_allocator
{
+ public:
+ typedef typename _Alloc::size_type size_type;
+ typedef typename _Alloc::difference_type difference_type;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
+ typedef typename _Alloc::value_type value_type;
+
private:
// Size of space used to store size. Note that this must be
// large enough to preserve alignment.
- enum {_S_extra = 8};
+ const size_t _M_extra;
+
+ _Alloc _M_allocator;
public:
- static void*
- allocate(size_t __n)
+ debug_allocator() : _M_extra(8) { }
+
+ pointer
+ allocate(size_type __n, std::allocator<void>::const_pointer = 0)
{
- char* __result = (char*)_Alloc::allocate(__n + (int) _S_extra);
- *(size_t*)__result = __n;
- return __result + (int) _S_extra;
+ pointer __result = _M_allocator.allocate(__n + _M_extra);
+ *__result = __n;
+ return __result + _M_extra;
}
- static void
- deallocate(void* __p, size_t __n)
+ void
+ deallocate(pointer __p, size_type __n)
{
- char* __real_p = (char*)__p - (int) _S_extra;
- if (*(size_t*)__real_p != __n)
+ pointer __real_p = __p - _M_extra;
+ if (*__real_p != __n)
abort();
- _Alloc::deallocate(__real_p, __n + (int) _S_extra);
+ _M_allocator.deallocate(__real_p, __n + _M_extra);
}
};
-
- //@{
- /** Comparison operators for all of the predifined SGI-style allocators.
- * This ensures that __allocator<malloc_alloc> (for example) will work
- * correctly. As required, all allocators compare equal.
- */
- template<typename _Alloc>
- inline bool
- operator==(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&)
- { return true; }
-
- template<typename _Alloc>
- inline bool
- operator!=(const __debug_alloc<_Alloc>&, const __debug_alloc<_Alloc>&)
- { return false; }
- //@}
} // namespace __gnu_cxx
-namespace std
-{
- //@{
- /// Versions for the predefined "SGI" style allocators.
- template<typename _Tp, typename _Alloc>
- struct _Alloc_traits<_Tp, __gnu_cxx::__debug_alloc<_Alloc> >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx::__debug_alloc<_Alloc> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
- };
- //@}
-
- //@{
- /// Versions for the __allocator adaptor used with the predefined
- /// "SGI" style allocators.
- template<typename _Tp, typename _Tp1, typename _Alloc>
- struct _Alloc_traits<_Tp, __allocator<_Tp1,
- __gnu_cxx::__debug_alloc<_Alloc> > >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx::__debug_alloc<_Alloc> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
- };
- //@}
-} // namespace std
-
#endif
diff --git a/libstdc++-v3/include/ext/enc_filebuf.h b/libstdc++-v3/include/ext/enc_filebuf.h
index a2b3d670570..80c3b5a15be 100644
--- a/libstdc++-v3/include/ext/enc_filebuf.h
+++ b/libstdc++-v3/include/ext/enc_filebuf.h
@@ -1,6 +1,6 @@
-// __enc_traits layer for filebuf -*- C++ -*-
+// filebuf with __enc_traits state type -*- C++ -*-
-// Copyright (C) 2002 Free Software Foundation, Inc.
+// Copyright (C) 2002, 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
@@ -32,12 +32,14 @@
namespace __gnu_cxx
{
- // Custom traits type with __enc_traits for state type, all other bits
- // equivalent to the required char_traits instantiations.
+ // Custom traits type with __enc_traits for the state type, and the
+ // associated fpos<__enc_traits> for the position type, all other
+ // bits equivalent to the required char_traits instantiations.
template<typename _CharT>
struct enc_char_traits: public std::char_traits<_CharT>
{
- typedef std::__enc_traits state_type;
+ typedef std::__enc_traits state_type;
+ typedef typename std::fpos<state_type> pos_type;
};
template<typename _CharT>
@@ -45,17 +47,19 @@ namespace __gnu_cxx
: public std::basic_filebuf<_CharT, enc_char_traits<_CharT> >
{
public:
- typedef typename enc_char_traits<_CharT>::state_type state_type;
-
+ typedef enc_char_traits<_CharT> traits_type;
+ typedef typename traits_type::state_type state_type;
+ typedef typename traits_type::pos_type pos_type;
+
enc_filebuf(state_type& __state)
: std::basic_filebuf<_CharT, enc_char_traits<_CharT> >()
- {
+ {
// Set state type to something useful.
// Something more than copyconstructible is needed here, so
- // require copyconstructible + assignment operator.
+ // require default and copy constructible + assignment operator.
__glibcxx_class_requires(state_type, _SGIAssignableConcept);
- _M_state_cur = __state;
- _M_state_cur._M_init();
+ this->_M_state_beg = __state;
+ this->_M_state_beg._M_init();
};
};
} // namespace __gnu_cxx
diff --git a/libstdc++-v3/include/ext/functional b/libstdc++-v3/include/ext/functional
index c8b4b61a6cf..1a378173177 100644
--- a/libstdc++-v3/include/ext/functional
+++ b/libstdc++-v3/include/ext/functional
@@ -100,7 +100,7 @@ template <class _Tp> inline _Tp identity_element(std::multiplies<_Tp>) {
* Calling @c operator() with a single argument @c x returns @c f(g(x)).
* The function @c compose1 takes the two functions and constructs a
* @c unary_compose variable for you.
- *
+ *
* @c binary_compose is constructed from three functors, @c f, @c g1,
* and @c g2. Its @c operator() returns @c f(g1(x),g2(x)). The function
* @compose2 takes f, g1, and g2, and constructs the @c binary_compose
@@ -124,13 +124,13 @@ template <class _Tp> inline _Tp identity_element(std::multiplies<_Tp>) {
template <class _Operation1, class _Operation2>
class unary_compose
: public unary_function<typename _Operation2::argument_type,
- typename _Operation1::result_type>
+ typename _Operation1::result_type>
{
protected:
_Operation1 _M_fn1;
_Operation2 _M_fn2;
public:
- unary_compose(const _Operation1& __x, const _Operation2& __y)
+ unary_compose(const _Operation1& __x, const _Operation2& __y)
: _M_fn1(__x), _M_fn2(__y) {}
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
@@ -140,7 +140,7 @@ public:
/// An \link SGIextensions SGI extension \endlink.
template <class _Operation1, class _Operation2>
-inline unary_compose<_Operation1,_Operation2>
+inline unary_compose<_Operation1,_Operation2>
compose1(const _Operation1& __fn1, const _Operation2& __fn2)
{
return unary_compose<_Operation1,_Operation2>(__fn1, __fn2);
@@ -156,8 +156,8 @@ protected:
_Operation2 _M_fn2;
_Operation3 _M_fn3;
public:
- binary_compose(const _Operation1& __x, const _Operation2& __y,
- const _Operation3& __z)
+ binary_compose(const _Operation1& __x, const _Operation2& __y,
+ const _Operation3& __z)
: _M_fn1(__x), _M_fn2(__y), _M_fn3(__z) { }
typename _Operation1::result_type
operator()(const typename _Operation2::argument_type& __x) const {
@@ -167,8 +167,8 @@ public:
/// An \link SGIextensions SGI extension \endlink.
template <class _Operation1, class _Operation2, class _Operation3>
-inline binary_compose<_Operation1, _Operation2, _Operation3>
-compose2(const _Operation1& __fn1, const _Operation2& __fn2,
+inline binary_compose<_Operation1, _Operation2, _Operation3>
+compose2(const _Operation1& __fn1, const _Operation2& __fn2,
const _Operation3& __fn3)
{
return binary_compose<_Operation1,_Operation2,_Operation3>
@@ -220,7 +220,7 @@ struct _Project2nd : public binary_function<_Arg1, _Arg2, _Arg2> {
*/
/// An \link SGIextensions SGI extension \endlink.
-template <class _Arg1, class _Arg2>
+template <class _Arg1, class _Arg2>
struct project1st : public _Project1st<_Arg1, _Arg2> {};
/// An \link SGIextensions SGI extension \endlink.
@@ -236,7 +236,7 @@ struct _Constant_void_fun {
_Constant_void_fun(const result_type& __v) : _M_val(__v) {}
const result_type& operator()() const { return _M_val; }
-};
+};
template <class _Result, class _Argument>
struct _Constant_unary_fun {
@@ -279,7 +279,7 @@ struct _Constant_binary_fun {
template <class _Result>
struct constant_void_fun : public _Constant_void_fun<_Result> {
constant_void_fun(const _Result& __v) : _Constant_void_fun<_Result>(__v) {}
-};
+};
/// An \link SGIextensions SGI extension \endlink.
template <class _Result,
@@ -317,7 +317,7 @@ inline constant_unary_fun<_Result,_Result> constant1(const _Result& __val)
/// An \link SGIextensions SGI extension \endlink.
template <class _Result>
-inline constant_binary_fun<_Result,_Result,_Result>
+inline constant_binary_fun<_Result,_Result,_Result>
constant2(const _Result& __val)
{
return constant_binary_fun<_Result,_Result,_Result>(__val);
@@ -369,7 +369,7 @@ public:
subtractive_rng() { _M_initialize(161803398u); }
};
-// Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
+// Mem_fun adaptor helper functions mem_fun1 and mem_fun1_ref,
// provided for backward compatibility, they are no longer part of
// the C++ standard.
@@ -391,5 +391,5 @@ mem_fun1_ref(_Ret (_Tp::*__f)(_Arg) const)
{ return const_mem_fun1_ref_t<_Ret,_Tp,_Arg>(__f); }
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/hash_fun.h b/libstdc++-v3/include/ext/hash_fun.h
index 154252663fe..27453a6b006 100644
--- a/libstdc++-v3/include/ext/hash_fun.h
+++ b/libstdc++-v3/include/ext/hash_fun.h
@@ -70,53 +70,53 @@ namespace __gnu_cxx
template <class _Key> struct hash { };
- inline size_t
+ inline size_t
__stl_hash_string(const char* __s)
{
- unsigned long __h = 0;
+ unsigned long __h = 0;
for ( ; *__s; ++__s)
- __h = 5*__h + *__s;
+ __h = 5*__h + *__s;
return size_t(__h);
}
template<> struct hash<char*>
{
- size_t operator()(const char* __s) const
+ size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
-
+
template<> struct hash<const char*>
{
- size_t operator()(const char* __s) const
+ size_t operator()(const char* __s) const
{ return __stl_hash_string(__s); }
};
- template<> struct hash<char>
+ template<> struct hash<char>
{ size_t operator()(char __x) const { return __x; } };
- template<> struct hash<unsigned char>
+ template<> struct hash<unsigned char>
{ size_t operator()(unsigned char __x) const { return __x; } };
- template<> struct hash<signed char>
+ template<> struct hash<signed char>
{ size_t operator()(unsigned char __x) const { return __x; } };
- template<> struct hash<short>
+ template<> struct hash<short>
{ size_t operator()(short __x) const { return __x; } };
- template<> struct hash<unsigned short>
+ template<> struct hash<unsigned short>
{ size_t operator()(unsigned short __x) const { return __x; } };
- template<> struct hash<int>
+ template<> struct hash<int>
{ size_t operator()(int __x) const { return __x; } };
- template<> struct hash<unsigned int>
+ template<> struct hash<unsigned int>
{ size_t operator()(unsigned int __x) const { return __x; } };
- template<> struct hash<long>
+ template<> struct hash<long>
{ size_t operator()(long __x) const { return __x; } };
- template<> struct hash<unsigned long>
+ template<> struct hash<unsigned long>
{ size_t operator()(unsigned long __x) const { return __x; } };
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/hash_map b/libstdc++-v3/include/ext/hash_map
index 363b27dd627..5032c7b3f21 100644
--- a/libstdc++-v3/include/ext/hash_map
+++ b/libstdc++-v3/include/ext/hash_map
@@ -59,7 +59,7 @@
* include this header if you are using GCC 3 or later.
*/
-#ifndef _HASH_MAP
+#ifndef _HASH_MAP
#define _HASH_MAP 1
#include <ext/hashtable.h>
@@ -102,7 +102,7 @@ public:
typedef typename _Ht::value_type value_type;
typedef typename _Ht::hasher hasher;
typedef typename _Ht::key_equal key_equal;
-
+
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
typedef typename _Ht::pointer pointer;
@@ -171,10 +171,10 @@ public:
void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator,bool> insert_noresize(const value_type& __obj)
- { return _M_ht.insert_unique_noresize(__obj); }
+ { return _M_ht.insert_unique_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
- const_iterator find(const key_type& __key) const
+ const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
_Tp& operator[](const key_type& __key) {
@@ -182,7 +182,7 @@ public:
}
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
+
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
@@ -202,7 +202,7 @@ public:
};
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
@@ -210,14 +210,14 @@ operator==(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline bool
+inline bool
operator!=(const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
const hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline void
+inline void
swap(hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_map<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
@@ -233,7 +233,7 @@ template <class _Key, class _Tp,
class hash_multimap;
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2);
@@ -253,7 +253,7 @@ class hash_multimap
private:
typedef hashtable<pair<const _Key, _Tp>, _Key, _HashFcn,
- _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
+ _Select1st<pair<const _Key, _Tp> >, _EqualKey, _Alloc>
_Ht;
_Ht _M_ht;
@@ -327,20 +327,20 @@ public:
const_iterator end() const { return _M_ht.end(); }
public:
- iterator insert(const value_type& __obj)
+ iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
+ void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
- { return _M_ht.insert_equal_noresize(__obj); }
+ { return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) { return _M_ht.find(__key); }
- const_iterator find(const key_type& __key) const
+ const_iterator find(const key_type& __key) const
{ return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
+
pair<iterator, iterator> equal_range(const key_type& __key)
{ return _M_ht.equal_range(__key); }
pair<const_iterator, const_iterator>
@@ -361,7 +361,7 @@ public:
};
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2)
{
@@ -369,14 +369,14 @@ operator==(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
}
template <class _Key, class _Tp, class _HF, class _EqKey, class _Alloc>
-inline bool
+inline bool
operator!=(const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm1,
const hash_multimap<_Key,_Tp,_HF,_EqKey,_Alloc>& __hm2) {
return !(__hm1 == __hm2);
}
template <class _Key, class _Tp, class _HashFcn, class _EqlKey, class _Alloc>
-inline void
+inline void
swap(hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm1,
hash_multimap<_Key,_Tp,_HashFcn,_EqlKey,_Alloc>& __hm2)
{
@@ -407,7 +407,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
+ operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
@@ -434,7 +434,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
+ operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
diff --git a/libstdc++-v3/include/ext/hash_set b/libstdc++-v3/include/ext/hash_set
index 0a0b738130a..fee64fcbdb0 100644
--- a/libstdc++-v3/include/ext/hash_set
+++ b/libstdc++-v3/include/ext/hash_set
@@ -75,12 +75,12 @@ namespace __gnu_cxx
// Forward declaration of equality operator; needed for friend
// declaration.
template <class _Value, class _HashFcn = hash<_Value>,
- class _EqualKey = equal_to<_Value>,
+ class _EqualKey = equal_to<_Value>,
class _Alloc = allocator<_Value> >
class hash_set;
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
- inline bool
+ inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2);
@@ -98,7 +98,7 @@ class hash_set
__glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
- typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
@@ -110,10 +110,10 @@ public:
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::const_pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::const_reference reference;
- typedef typename _Ht::const_reference const_reference;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
typedef typename _Ht::const_iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
@@ -161,7 +161,7 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_set& __hs) { _M_ht.swap(__hs._M_ht); }
- template <class _Val, class _HF, class _EqK, class _Al>
+ 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>&);
@@ -175,11 +175,11 @@ public:
return pair<iterator,bool>(__p.first, __p.second);
}
template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
+ void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_unique(__f,__l); }
pair<iterator, bool> insert_noresize(const value_type& __obj)
{
- pair<typename _Ht::iterator, bool> __p =
+ pair<typename _Ht::iterator, bool> __p =
_M_ht.insert_unique_noresize(__obj);
return pair<iterator, bool>(__p.first, __p.second);
}
@@ -187,7 +187,7 @@ public:
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
+
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
@@ -205,7 +205,7 @@ public:
};
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
@@ -213,14 +213,14 @@ operator==(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
}
template <class _Value, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
+inline bool
operator!=(const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_set<_Value,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline void
+inline void
swap(hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_set<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
@@ -235,7 +235,7 @@ template <class _Value,
class hash_multiset;
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2);
@@ -254,7 +254,7 @@ class hash_multiset
__glibcxx_class_requires3(_EqualKey, _Value, _Value, _BinaryPredicateConcept)
private:
- typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
+ typedef hashtable<_Value, _Value, _HashFcn, _Identity<_Value>,
_EqualKey, _Alloc> _Ht;
_Ht _M_ht;
@@ -266,10 +266,10 @@ public:
typedef typename _Ht::size_type size_type;
typedef typename _Ht::difference_type difference_type;
- typedef typename _Ht::const_pointer pointer;
- typedef typename _Ht::const_pointer const_pointer;
- typedef typename _Ht::const_reference reference;
- typedef typename _Ht::const_reference const_reference;
+ typedef typename _Alloc::pointer pointer;
+ typedef typename _Alloc::const_pointer const_pointer;
+ typedef typename _Alloc::reference reference;
+ typedef typename _Alloc::const_reference const_reference;
typedef typename _Ht::const_iterator iterator;
typedef typename _Ht::const_iterator const_iterator;
@@ -317,7 +317,7 @@ public:
bool empty() const { return _M_ht.empty(); }
void swap(hash_multiset& hs) { _M_ht.swap(hs._M_ht); }
- template <class _Val, class _HF, class _EqK, class _Al>
+ 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>&);
@@ -328,15 +328,15 @@ public:
iterator insert(const value_type& __obj)
{ return _M_ht.insert_equal(__obj); }
template <class _InputIterator>
- void insert(_InputIterator __f, _InputIterator __l)
+ void insert(_InputIterator __f, _InputIterator __l)
{ _M_ht.insert_equal(__f,__l); }
iterator insert_noresize(const value_type& __obj)
- { return _M_ht.insert_equal_noresize(__obj); }
+ { return _M_ht.insert_equal_noresize(__obj); }
iterator find(const key_type& __key) const { return _M_ht.find(__key); }
size_type count(const key_type& __key) const { return _M_ht.count(__key); }
-
+
pair<iterator, iterator> equal_range(const key_type& __key) const
{ return _M_ht.equal_range(__key); }
@@ -354,7 +354,7 @@ public:
};
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
+inline bool
operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2)
{
@@ -362,14 +362,14 @@ operator==(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline bool
+inline bool
operator!=(const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
const hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
return !(__hs1 == __hs2);
}
template <class _Val, class _HashFcn, class _EqualKey, class _Alloc>
-inline void
+inline void
swap(hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs1,
hash_multiset<_Val,_HashFcn,_EqualKey,_Alloc>& __hs2) {
__hs1.swap(__hs2);
@@ -399,7 +399,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
+ operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
@@ -426,7 +426,7 @@ public:
insert_iterator(_Container& __x, typename _Container::iterator)
: container(&__x) {}
insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
+ operator=(const typename _Container::value_type& __value) {
container->insert(__value);
return *this;
}
@@ -436,4 +436,4 @@ public:
};
} // namespace std
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/hashtable.h b/libstdc++-v3/include/ext/hashtable.h
index 435221c93c7..54540c40aee 100644
--- a/libstdc++-v3/include/ext/hashtable.h
+++ b/libstdc++-v3/include/ext/hashtable.h
@@ -77,7 +77,6 @@ using std::size_t;
using std::ptrdiff_t;
using std::forward_iterator_tag;
using std::input_iterator_tag;
-using std::_Alloc_traits;
using std::_Construct;
using std::_Destroy;
using std::distance;
@@ -90,7 +89,7 @@ struct _Hashtable_node
{
_Hashtable_node* _M_next;
_Val _M_val;
-};
+};
template <class _Val, class _Key, class _HashFcn,
class _ExtractKey, class _EqualKey, class _Alloc = std::__alloc>
@@ -109,10 +108,10 @@ template <class _Val, class _Key, class _HashFcn,
struct _Hashtable_iterator {
typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
_Hashtable;
- typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
+ typedef _Hashtable_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
iterator;
- typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
const_iterator;
typedef _Hashtable_node<_Val> _Node;
@@ -127,7 +126,7 @@ struct _Hashtable_iterator {
_Node* _M_cur;
_Hashtable* _M_ht;
- _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
+ _Hashtable_iterator(_Node* __n, _Hashtable* __tab)
: _M_cur(__n), _M_ht(__tab) {}
_Hashtable_iterator() {}
reference operator*() const { return _M_cur->_M_val; }
@@ -146,10 +145,10 @@ template <class _Val, class _Key, class _HashFcn,
struct _Hashtable_const_iterator {
typedef hashtable<_Val,_Key,_HashFcn,_ExtractKey,_EqualKey,_Alloc>
_Hashtable;
- typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
+ typedef _Hashtable_iterator<_Val,_Key,_HashFcn,
_ExtractKey,_EqualKey,_Alloc>
iterator;
- typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
+ typedef _Hashtable_const_iterator<_Val, _Key, _HashFcn,
_ExtractKey, _EqualKey, _Alloc>
const_iterator;
typedef _Hashtable_node<_Val> _Node;
@@ -167,15 +166,15 @@ struct _Hashtable_const_iterator {
_Hashtable_const_iterator(const _Node* __n, const _Hashtable* __tab)
: _M_cur(__n), _M_ht(__tab) {}
_Hashtable_const_iterator() {}
- _Hashtable_const_iterator(const iterator& __it)
+ _Hashtable_const_iterator(const iterator& __it)
: _M_cur(__it._M_cur), _M_ht(__it._M_ht) {}
reference operator*() const { return _M_cur->_M_val; }
pointer operator->() const { return &(operator*()); }
const_iterator& operator++();
const_iterator operator++(int);
- bool operator==(const const_iterator& __it) const
+ bool operator==(const const_iterator& __it) const
{ return _M_cur == __it._M_cur; }
- bool operator!=(const const_iterator& __it) const
+ bool operator!=(const const_iterator& __it) const
{ return _M_cur != __it._M_cur; }
};
@@ -188,7 +187,7 @@ static const unsigned long __stl_prime_list[_S_num_primes] =
1543ul, 3079ul, 6151ul, 12289ul, 24593ul,
49157ul, 98317ul, 196613ul, 393241ul, 786433ul,
1572869ul, 3145739ul, 6291469ul, 12582917ul, 25165843ul,
- 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
+ 50331653ul, 100663319ul, 201326611ul, 402653189ul, 805306457ul,
1610612741ul, 3221225473ul, 4294967291ul
};
@@ -242,10 +241,14 @@ private:
typedef _Hashtable_node<_Val> _Node;
public:
- typedef typename _Alloc_traits<_Val,_Alloc>::allocator_type allocator_type;
+ typedef _Alloc allocator_type;
allocator_type get_allocator() const { return _M_node_allocator; }
private:
- typename _Alloc_traits<_Node, _Alloc>::allocator_type _M_node_allocator;
+ typedef typename _Alloc::template rebind<_Node>::other _Node_Alloc;
+ typedef typename _Alloc::template rebind<_Node*>::other _Nodeptr_Alloc;
+ typedef vector<_Node*, _Nodeptr_Alloc> _Vector_type;
+
+ _Node_Alloc _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); }
@@ -253,7 +256,7 @@ private:
hasher _M_hash;
key_equal _M_equals;
_ExtractKey _M_get_key;
- vector<_Node*,_Alloc> _M_buckets;
+ _Vector_type _M_buckets;
size_type _M_num_elements;
public:
@@ -337,7 +340,7 @@ public:
}
iterator begin()
- {
+ {
for (size_type __n = 0; __n < _M_buckets.size(); ++__n)
if (_M_buckets[__n])
return iterator(_M_buckets[__n], this);
@@ -364,7 +367,7 @@ public:
size_type bucket_count() const { return _M_buckets.size(); }
size_type max_bucket_count() const
- { return __stl_prime_list[(int)_S_num_primes - 1]; }
+ { return __stl_prime_list[(int)_S_num_primes - 1]; }
size_type elems_in_bucket(size_type __bucket) const
{
@@ -388,7 +391,7 @@ public:
pair<iterator, bool> insert_unique_noresize(const value_type& __obj);
iterator insert_equal_noresize(const value_type& __obj);
-
+
template <class _InputIterator>
void insert_unique(_InputIterator __f, _InputIterator __l)
{
@@ -439,7 +442,7 @@ public:
reference find_or_insert(const value_type& __obj);
- iterator find(const key_type& __key)
+ iterator find(const key_type& __key)
{
size_type __n = _M_bkt_num_key(__key);
_Node* __first;
@@ -448,7 +451,7 @@ public:
__first = __first->_M_next)
{}
return iterator(__first, this);
- }
+ }
const_iterator find(const key_type& __key) const
{
@@ -459,7 +462,7 @@ public:
__first = __first->_M_next)
{}
return const_iterator(__first, this);
- }
+ }
size_type count(const key_type& __key) const
{
@@ -472,10 +475,10 @@ public:
return __result;
}
- pair<iterator, iterator>
+ pair<iterator, iterator>
equal_range(const key_type& __key);
- pair<const_iterator, const_iterator>
+ pair<const_iterator, const_iterator>
equal_range(const key_type& __key) const;
size_type erase(const key_type& __key);
@@ -534,7 +537,7 @@ private:
__throw_exception_again;
}
}
-
+
void _M_delete_node(_Node* __n)
{
_Destroy(&__n->_M_val);
@@ -548,7 +551,7 @@ private:
};
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
+template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
@@ -563,7 +566,7 @@ _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
return *this;
}
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
+template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
inline _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
_Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
@@ -573,7 +576,7 @@ _Hashtable_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
return __tmp;
}
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
+template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>&
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
@@ -588,7 +591,7 @@ _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++()
return *this;
}
-template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
+template <class _Val, class _Key, class _HF, class _ExK, class _EqK,
class _All>
inline _Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>
_Hashtable_const_iterator<_Val,_Key,_HF,_ExK,_EqK,_All>::operator++(int)
@@ -632,7 +635,7 @@ bool operator==(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
}
}
return true;
-}
+}
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,
@@ -640,7 +643,7 @@ inline bool operator!=(const hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>& __ht1,
return !(__ht1 == __ht2);
}
-template <class _Val, class _Key, class _HF, class _Extract, class _EqKey,
+template <class _Val, class _Key, class _HF, class _Extract, class _EqKey,
class _All>
inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht2) {
@@ -649,14 +652,14 @@ inline void swap(hashtable<_Val, _Key, _HF, _Extract, _EqKey, _All>& __ht1,
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
+pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator, bool>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::insert_unique_noresize(const value_type& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = _M_buckets[__n];
- for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj)))
return pair<iterator, bool>(iterator(__cur, this), false);
@@ -668,14 +671,14 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator
+typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::insert_equal_noresize(const value_type& __obj)
{
const size_type __n = _M_bkt_num(__obj);
_Node* __first = _M_buckets[__n];
- for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
+ for (_Node* __cur = __first; __cur; __cur = __cur->_M_next)
if (_M_equals(_M_get_key(__cur->_M_val), _M_get_key(__obj))) {
_Node* __tmp = _M_new_node(__obj);
__tmp->_M_next = __cur->_M_next;
@@ -692,7 +695,7 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::reference
+typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::reference
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj)
{
resize(_M_num_elements + 1);
@@ -713,7 +716,7 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::find_or_insert(const value_type& __obj)
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator,
- typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
+ typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
{
typedef pair<iterator, iterator> _Pii;
@@ -734,8 +737,8 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::equal_range(const key_type& __key)
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
- typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
+pair<typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator,
+ typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::const_iterator>
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::equal_range(const key_type& __key) const
{
@@ -743,7 +746,7 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
const size_type __n = _M_bkt_num_key(__key);
for (const _Node* __first = _M_buckets[__n] ;
- __first;
+ __first;
__first = __first->_M_next) {
if (_M_equals(_M_get_key(__first->_M_val), __key)) {
for (const _Node* __cur = __first->_M_next;
@@ -763,7 +766,7 @@ hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
}
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
-typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::size_type
+typename hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::size_type
hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::erase(const key_type& __key)
{
const size_type __n = _M_bkt_num_key(__key);
@@ -831,9 +834,9 @@ template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::erase(iterator __first, iterator __last)
{
- size_type __f_bucket = __first._M_cur ?
+ size_type __f_bucket = __first._M_cur ?
_M_bkt_num(__first._M_cur->_M_val) : _M_buckets.size();
- size_type __l_bucket = __last._M_cur ?
+ size_type __l_bucket = __last._M_cur ?
_M_bkt_num(__last._M_cur->_M_val) : _M_buckets.size();
if (__first._M_cur == __last._M_cur)
@@ -876,8 +879,7 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
if (__num_elements_hint > __old_n) {
const size_type __n = _M_next_size(__num_elements_hint);
if (__n > __old_n) {
- vector<_Node*, _All> __tmp(__n, (_Node*)(0),
- _M_buckets.get_allocator());
+ _Vector_type __tmp(__n, (_Node*)(0), _M_buckets.get_allocator());
try {
for (size_type __bucket = 0; __bucket < __old_n; ++__bucket) {
_Node* __first = _M_buckets[__bucket];
@@ -886,7 +888,7 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
_M_buckets[__bucket] = __first->_M_next;
__first->_M_next = __tmp[__new_bucket];
__tmp[__new_bucket] = __first;
- __first = _M_buckets[__bucket];
+ __first = _M_buckets[__bucket];
}
}
_M_buckets.swap(__tmp);
@@ -914,8 +916,8 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
_M_erase_bucket(__n, __last);
else {
_Node* __next;
- for (__next = __cur->_M_next;
- __next != __first;
+ for (__next = __cur->_M_next;
+ __next != __first;
__cur = __next, __next = __cur->_M_next)
;
while (__next != __last) {
@@ -956,7 +958,7 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>::clear()
_M_num_elements = 0;
}
-
+
template <class _Val, class _Key, class _HF, class _Ex, class _Eq, class _All>
void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
::_M_copy_from(const hashtable& __ht)
@@ -971,8 +973,8 @@ void hashtable<_Val,_Key,_HF,_Ex,_Eq,_All>
_Node* __local_copy = _M_new_node(__cur->_M_val);
_M_buckets[__i] = __local_copy;
- for (_Node* __next = __cur->_M_next;
- __next;
+ for (_Node* __next = __cur->_M_next;
+ __next;
__cur = __next, __next = __cur->_M_next) {
__local_copy->_M_next = _M_new_node(__next->_M_val);
__local_copy = __local_copy->_M_next;
diff --git a/libstdc++-v3/include/ext/iterator b/libstdc++-v3/include/ext/iterator
index e492e680f17..094313c76e4 100644
--- a/libstdc++-v3/include/ext/iterator
+++ b/libstdc++-v3/include/ext/iterator
@@ -72,7 +72,7 @@ namespace __gnu_cxx
// 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.
+ // returning nothing. The latter seems to be an SGI extension.
// -- pedwards
template<typename _InputIterator, typename _Distance>
inline void
@@ -86,7 +86,7 @@ namespace __gnu_cxx
template<typename _RandomAccessIterator, typename _Distance>
inline void
- __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
+ __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
_Distance& __n, std::random_access_iterator_tag)
{
// concept requirements
@@ -109,5 +109,5 @@ namespace __gnu_cxx
}
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/malloc_allocator.h b/libstdc++-v3/include/ext/malloc_allocator.h
index 410b296e09d..5545a58f8c9 100644
--- a/libstdc++-v3/include/ext/malloc_allocator.h
+++ b/libstdc++-v3/include/ext/malloc_allocator.h
@@ -1,4 +1,4 @@
-// Allocators -*- C++ -*-
+// Allocator that wraps "C" malloc -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
@@ -27,137 +27,78 @@
// 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.
- *
- * 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.
- */
-
-/** @file ext/debug_allocator.h
- * This file is a GNU extension to the Standard C++ Library.
- * You should only include this header if you are using GCC 3 or later.
- */
-
#ifndef _MALLOC_ALLOCATOR_H
#define _MALLOC_ALLOCATOR_H 1
-#include <bits/allocator_traits.h>
+#include <new>
+#include <memory>
namespace __gnu_cxx
{
/**
- * @if maint
- * A malloc-based allocator. Typically slower than the
- * __pool_alloc (below). Typically thread-safe and more
- * storage efficient. The template argument is unused and is only present
- * to permit multiple instantiations (but see __pool_alloc
- * for caveats). "SGI" style, plus __set_malloc_handler for OOM conditions.
- * @endif
+ * @brief An allocator that uses malloc
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls malloc
+ * - all deallocation calls free
+ *
* (See @link Allocators allocators info @endlink for more.)
*/
- template<int __inst>
- class __malloc_alloc
+ template<typename _Tp>
+ class malloc_allocator
{
- private:
- static void* _S_oom_malloc(size_t);
- static void (* __malloc_alloc_oom_handler)();
-
public:
- static void*
- allocate(size_t __n)
- {
- void* __result = malloc(__n);
- if (__builtin_expect(__result == 0, 0))
- __result = _S_oom_malloc(__n);
- return __result;
- }
-
- static void
- deallocate(void* __p, size_t /* __n */)
- { free(__p); }
-
- static void (* __set_malloc_handler(void (*__f)()))()
- {
- void (* __old)() = __malloc_alloc_oom_handler;
- __malloc_alloc_oom_handler = __f;
- return __old;
- }
- };
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
- // malloc_alloc out-of-memory handling
- template<int __inst>
- void (* __malloc_alloc<__inst>::__malloc_alloc_oom_handler)() = 0;
+ template<typename _Tp1>
+ struct rebind
+ { typedef malloc_allocator<_Tp1> other; };
- template<int __inst>
- void*
- __malloc_alloc<__inst>::
- _S_oom_malloc(size_t __n)
- {
- void (* __my_malloc_handler)();
- void* __result;
-
- for (;;)
- {
- __my_malloc_handler = __malloc_alloc_oom_handler;
- if (__builtin_expect(__my_malloc_handler == 0, 0))
- __throw_bad_alloc();
- (*__my_malloc_handler)();
- __result = malloc(__n);
- if (__result)
- return __result;
- }
- }
- //@{
- /** Comparison operators for all of the predifined SGI-style allocators.
- * This ensures that __allocator<malloc_alloc> (for example) will work
- * correctly. As required, all allocators compare equal.
- */
- template<int inst>
- inline bool
- operator==(const __malloc_alloc<inst>&, const __malloc_alloc<inst>&)
- { return true; }
-
- template<int __inst>
- inline bool
- operator!=(const __malloc_alloc<__inst>&, const __malloc_alloc<__inst>&)
- { return false; }
- //@}
-} // namespace __gnu_cxx
+ malloc_allocator() throw() { }
-namespace std
-{
- //@{
- /// Versions for the predefined "SGI" style allocators.
- template<typename _Tp, int __inst>
- struct _Alloc_traits<_Tp, __gnu_cxx::__malloc_alloc<__inst> >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx:: __malloc_alloc<__inst> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
- };
- //@}
-
- //@{
- /// Versions for the __allocator adaptor used with the predefined
- /// "SGI" style allocators.
- template<typename _Tp, typename _Tp1, int __inst>
- struct _Alloc_traits<_Tp, __allocator<_Tp1,
- __gnu_cxx::__malloc_alloc<__inst> > >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx:: __malloc_alloc<__inst> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
+ malloc_allocator(const malloc_allocator&) throw() { }
+
+ template<typename _Tp1>
+ malloc_allocator(const malloc_allocator<_Tp1>&) throw() { }
+
+ ~malloc_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, std::allocator<void>::const_pointer __h = 0)
+ { return static_cast<_Tp*>(malloc(__n * sizeof(_Tp))); }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type __n)
+ { free(static_cast<void*>(__p)); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { *__p = __val; }
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
};
- //@}
-} // namespace std
+} // namespace __gnu_cxx
#endif
diff --git a/libstdc++-v3/include/ext/memory b/libstdc++-v3/include/ext/memory
index 8a3a335195f..1d93f90ac7a 100644
--- a/libstdc++-v3/include/ext/memory
+++ b/libstdc++-v3/include/ext/memory
@@ -73,30 +73,30 @@ namespace __gnu_cxx
using std::pair;
using std::__iterator_category;
using std::_Temporary_buffer;
-
+
template<typename _InputIter, typename _Size, typename _ForwardIter>
pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
_ForwardIter __result, std::input_iterator_tag)
{
_ForwardIter __cur = __result;
- try
+ try
{
- for ( ; __count > 0 ; --__count, ++__first, ++__cur)
+ for ( ; __count > 0 ; --__count, ++__first, ++__cur)
std::_Construct(&*__cur, *__first);
return pair<_InputIter, _ForwardIter>(__first, __cur);
}
catch(...)
{
std::_Destroy(__result, __cur);
- __throw_exception_again;
+ __throw_exception_again;
}
}
-
+
template<typename _RandomAccessIter, typename _Size, typename _ForwardIter>
inline pair<_RandomAccessIter, _ForwardIter>
__uninitialized_copy_n(_RandomAccessIter __first, _Size __count,
- _ForwardIter __result,
+ _ForwardIter __result,
std::random_access_iterator_tag)
{
_RandomAccessIter __last = __first + __count;
@@ -108,7 +108,7 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter>
__uninitialized_copy_n(_InputIter __first, _Size __count,
- _ForwardIter __result)
+ _ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
@@ -127,7 +127,7 @@ namespace __gnu_cxx
template<typename _InputIter, typename _Size, typename _ForwardIter>
inline pair<_InputIter, _ForwardIter>
uninitialized_copy_n(_InputIter __first, _Size __count,
- _ForwardIter __result)
+ _ForwardIter __result)
{
return __uninitialized_copy_n(__first, __count, __result,
__iterator_category(__first));
@@ -154,7 +154,7 @@ namespace __gnu_cxx
*
* @ingroup SGIextensions
*/
- template <class _ForwardIterator, class _Tp
+ template <class _ForwardIterator, class _Tp
= typename std::iterator_traits<_ForwardIterator>::value_type >
struct temporary_buffer : public _Temporary_buffer<_ForwardIterator, _Tp>
{
diff --git a/libstdc++-v3/include/ext/mt_allocator.h b/libstdc++-v3/include/ext/mt_allocator.h
index b1a88ec79be..ec77192db26 100644
--- a/libstdc++-v3/include/ext/mt_allocator.h
+++ b/libstdc++-v3/include/ext/mt_allocator.h
@@ -28,44 +28,95 @@
// the GNU General Public License.
/** @file ext/mt_allocator.h
- * This file is a GNU extension to the Standard C++ Library.
+ * This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
#ifndef _MT_ALLOCATOR_H
#define _MT_ALLOCATOR_H 1
+#include <new>
+#include <memory>
#include <cstdlib>
-#include <bits/functexcept.h>
+#include <bits/functexcept.h>
#include <bits/gthr.h>
#include <bits/atomicity.h>
-#include <bits/allocator_traits.h>
namespace __gnu_cxx
{
-
-/**
- * This is a fixed size (power of 2) allocator which - when compiled
- * with thread support - will maintain one freelist per size per thread
- * plus a "global" one. Steps are taken to limit the per thread freelist
- * sizes (by returning excess back to "global").
- *
- * Usage examples:
- * @code
- * vector<int, __gnu_cxx::__mt_alloc<0> > v1;
- *
- * typedef std::__allocator<char, __gnu_cxx::__mt_alloc<0> > string_alloc;
- * std::basic_string<char, std::char_traits<char>, string_alloc> s1;
- * @endcode
- */
- template<int __inst>
+ /**
+ * This is a fixed size (power of 2) allocator which - when
+ * compiled with thread support - will maintain one freelist per
+ * size per thread plus a "global" one. Steps are taken to limit
+ * the per thread freelist sizes (by returning excess back to
+ * "global").
+ *
+ * Usage examples:
+ * @code
+ * vector<int, __gnu_cxx::__mt_alloc<int> > v1;
+ *
+ * typedef __gnu_cxx::__mt_alloc<char> > string_allocator;
+ * std::basic_string<char, std::char_traits<char>, string_allocator> s1;
+ * @endcode
+ */
+ template<typename _Tp>
class __mt_alloc
{
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef __mt_alloc<_Tp1> other; };
+
+ __mt_alloc() throw()
+ {
+ // XXX
+ }
+
+ __mt_alloc(const __mt_alloc&) throw()
+ {
+ // XXX
+ }
+
+ template<typename _Tp1>
+ __mt_alloc(const __mt_alloc<_Tp1>&) throw()
+ {
+ // XXX
+ }
+
+ ~__mt_alloc() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new(__p) _Tp(__val); }
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+
private:
/*
* We need to create the initial lists and set up some variables
- * before we can answer to the first request for memory.
- * The initialization of these variables is done at file scope
+ * before we can answer to the first request for memory.
+ * The initialization of these variables is done at file scope
* below class declaration.
*/
#ifdef __GTHREADS
@@ -93,7 +144,7 @@ namespace __gnu_cxx
static size_t _S_freelist_headroom;
/*
- * Each requesting thread is assigned an id ranging from 1 to
+ * Each requesting thread is assigned an id ranging from 1 to
* _S_max_threads. Thread id 0 is used as a global memory pool.
* In order to get constant performance on the thread assignment
* routine, we keep a list of free ids. When a thread first requests
@@ -141,8 +192,8 @@ namespace __gnu_cxx
struct bin_record
{
/*
- * An "array" of pointers to the first/last free block for each
- * thread id. Memory to these "arrays" is allocated in _S_init()
+ * An "array" of pointers to the first/last free block for each
+ * thread id. Memory to these "arrays" is allocated in _S_init()
* for _S_max_threads + global pool 0.
*/
block_record** first;
@@ -151,46 +202,44 @@ namespace __gnu_cxx
/*
* An "array" of counters used to keep track of the amount of blocks
* that are on the freelist/used for each thread id.
- * Memory to these "arrays" is allocated in _S_init()
+ * Memory to these "arrays" is allocated in _S_init()
* for _S_max_threads + global pool 0.
*/
size_t* free;
size_t* used;
/*
- * Each bin has its own mutex which is used to ensure data integrity
+ * Each bin has its own mutex which is used to ensure data integrity
* while changing "ownership" on a block.
* The mutex is initialized in _S_init().
*/
#ifdef __GTHREADS
- __gthread_mutex_t* mutex;
+ __gthread_mutex_t* mutex;
#endif
};
/*
- * An "array" of bin_records each of which represents a specific
+ * An "array" of bin_records each of which represents a specific
* power of 2 size. Memory to this "array" is allocated in _S_init().
*/
static bin_record* _S_bin;
public:
- static void*
- allocate(size_t __n)
+ pointer
+ allocate(size_t __n, std::allocator<void>::const_pointer __h = 0)
{
-
/*
* Requests larger than _S_max_bytes are handled by
- * malloc/free directly
+ * new/delete directly
*/
if (__n > _S_max_bytes)
{
- void* __ret = malloc(__n);
- if (!__ret)
+ void* __ret = malloc(__n * sizeof(_Tp));
+ if (!__ret)
__throw_bad_alloc();
-
- return __ret;
+ return static_cast<_Tp*>(__ret);
}
-
+
/*
* Although the test in __gthread_once() would suffice, we
* wrap test of the once condition in our own unlocked
@@ -233,12 +282,12 @@ namespace __gnu_cxx
{
/*
* Are we using threads?
- * - Yes, lock and check if there are free blocks on the global
- * list (and if not add new ones), get the first one
+ * - Yes, lock and check if there are free blocks on the global
+ * list (and if not add new ones), get the first one
* and change owner.
- * - No, all operations are made directly to global pool 0
- * no need to lock or change ownership but check for free
- * blocks on global list (and if not add new ones) and
+ * - No, all operations are made directly to global pool 0
+ * no need to lock or change ownership but check for free
+ * blocks on global list (and if not add new ones) and
* get the first one.
*/
#ifdef __GTHREADS
@@ -248,7 +297,7 @@ namespace __gnu_cxx
if (_S_bin[bin].first[0] == NULL)
{
- _S_bin[bin].first[0] =
+ _S_bin[bin].first[0] =
(block_record*)malloc(_S_chunk_size);
if (!_S_bin[bin].first[0])
@@ -258,7 +307,7 @@ namespace __gnu_cxx
}
size_t bin_t = 1 << bin;
- size_t block_count =
+ size_t block_count =
_S_chunk_size /(bin_t + sizeof(block_record));
_S_bin[bin].free[0] = block_count;
@@ -268,7 +317,7 @@ namespace __gnu_cxx
while (block_count > 0)
{
- block->next = (block_record*)((char*)block +
+ block->next = (block_record*)((char*)block +
(bin_t + sizeof(block_record)));
block = block->next;
block_count--;
@@ -302,12 +351,12 @@ namespace __gnu_cxx
{
_S_bin[bin].first[0] = (block_record*)malloc(_S_chunk_size);
- if (!_S_bin[bin].first[0])
+ if (!_S_bin[bin].first[0])
__throw_bad_alloc();
size_t bin_t = 1 << bin;
size_t block_count =
- _S_chunk_size / (bin_t + sizeof(block_record));
+ _S_chunk_size / (bin_t + sizeof(block_record));
_S_bin[bin].free[0] = block_count;
@@ -316,7 +365,7 @@ namespace __gnu_cxx
while (block_count > 0)
{
- block->next = (block_record*)((char*)block +
+ block->next = (block_record*)((char*)block +
(bin_t + sizeof(block_record)));
block = block->next;
block_count--;
@@ -335,7 +384,7 @@ namespace __gnu_cxx
_S_bin[bin].free[0]--;
_S_bin[bin].used[0]++;
}
- }
+ }
else
{
/*
@@ -349,11 +398,11 @@ namespace __gnu_cxx
_S_bin[bin].used[thread_id]++;
}
- return (void*)((char*)block + sizeof(block_record));
+ return static_cast<_Tp*>(static_cast<void*>((char*)block + sizeof(block_record)));
}
- static void
- deallocate(void* __p, size_t __n)
+ void
+ deallocate(pointer __p, size_type __n)
{
/*
* Requests larger than _S_max_bytes are handled by
@@ -363,7 +412,7 @@ namespace __gnu_cxx
{
free(__p);
return;
- }
+ }
/*
* Round up to power of 2 and figure out which bin to use
@@ -376,7 +425,7 @@ namespace __gnu_cxx
size_t thread_id = 0;
#endif
- block_record* block = (block_record*)((char*)__p
+ block_record* block = (block_record*)((char*)__p
- sizeof(block_record));
/*
@@ -391,7 +440,7 @@ namespace __gnu_cxx
/*
* Calculate the number of records to remove from our freelist
*/
- int remove = _S_bin[bin].free[thread_id] -
+ int remove = _S_bin[bin].free[thread_id] -
(_S_bin[bin].used[thread_id] / _S_freelist_headroom);
/*
@@ -400,8 +449,8 @@ namespace __gnu_cxx
* too much contention when locking and therefore we
* wait until the number of records is "high enough".
*/
- if (remove > (int)(100 * (_S_no_of_bins - bin)) &&
- remove > (int)(_S_bin[bin].free[thread_id] /
+ if (remove > (int)(100 * (_S_no_of_bins - bin)) &&
+ remove > (int)(_S_bin[bin].free[thread_id] /
_S_freelist_headroom))
{
__gthread_mutex_lock(_S_bin[bin].mutex);
@@ -415,7 +464,7 @@ namespace __gnu_cxx
_S_bin[bin].last[0] = _S_bin[bin].first[thread_id];
- _S_bin[bin].first[thread_id] =
+ _S_bin[bin].first[thread_id] =
_S_bin[bin].first[thread_id]->next;
_S_bin[bin].free[0]++;
@@ -482,9 +531,9 @@ namespace __gnu_cxx
}
};
- template<int __inst>
+ template<typename _Tp>
void
- __mt_alloc<__inst>::
+ __mt_alloc<_Tp>::
_S_init()
{
/*
@@ -506,7 +555,7 @@ namespace __gnu_cxx
_S_binmap = (binmap_type*)
malloc ((_S_max_bytes + 1) * sizeof(binmap_type));
- if (!_S_binmap)
+ if (!_S_binmap)
__throw_bad_alloc();
binmap_type* bp_t = _S_binmap;
@@ -530,21 +579,21 @@ namespace __gnu_cxx
#ifdef __GTHREADS
if (__gthread_active_p())
{
- _S_thread_freelist_first =
+ _S_thread_freelist_first =
(thread_record*)malloc(sizeof(thread_record) * _S_max_threads);
- if (!_S_thread_freelist_first)
+ if (!_S_thread_freelist_first)
__throw_bad_alloc();
/*
- * NOTE! The first assignable thread id is 1 since the global
+ * NOTE! The first assignable thread id is 1 since the global
* pool uses id 0
*/
size_t i;
for (i = 1; i < _S_max_threads; i++)
{
_S_thread_freelist_first[i - 1].next =
- &_S_thread_freelist_first[i];
+ &_S_thread_freelist_first[i];
_S_thread_freelist_first[i - 1].id = i;
}
@@ -575,45 +624,37 @@ namespace __gnu_cxx
*/
_S_bin = (bin_record*)malloc(sizeof(bin_record) * _S_no_of_bins);
- if (!_S_bin)
+ if (!_S_bin)
__throw_bad_alloc();
- for (size_t bin = 0; bin < _S_no_of_bins; bin++)
+ for (size_t bin = 0; bin < _S_no_of_bins; bin++)
{
- _S_bin[bin].first = (block_record**)
- malloc(sizeof(block_record*) * (_S_max_threads + 1));
+ std::size_t __n = _S_max_threads + 1;
+
+ _S_bin[bin].first = (block_record**)
+ malloc(sizeof(block_record*) * __n);
- if (!_S_bin[bin].first)
+ if (!_S_bin[bin].first)
__throw_bad_alloc();
- _S_bin[bin].last = (block_record**)
- malloc(sizeof(block_record*) * (_S_max_threads + 1));
+ _S_bin[bin].last = (block_record**)
+ malloc(sizeof(block_record*) * __n);
- if (!_S_bin[bin].last)
+ if (!_S_bin[bin].last)
__throw_bad_alloc();
- _S_bin[bin].free = (size_t*)
- malloc(sizeof(size_t) * (_S_max_threads + 1));
+ _S_bin[bin].free = (size_t*) malloc(sizeof(size_t) * __n);
- if (!_S_bin[bin].free)
+ if (!_S_bin[bin].free)
__throw_bad_alloc();
- _S_bin[bin].used = (size_t*)
- malloc(sizeof(size_t) * (_S_max_threads + 1));
+ _S_bin[bin].used = (size_t*) malloc(sizeof(size_t) * __n);
- if (!_S_bin[bin].used)
+ if (!_S_bin[bin].used)
__throw_bad_alloc();
- /*
- * Ugly workaround of what at the time of writing seems to be
- * a parser problem - see PR c++/9779 for more info.
- */
#ifdef __GTHREADS
- size_t s = sizeof(__gthread_mutex_t);
- _S_bin[bin].mutex = (__gthread_mutex_t*)malloc(s);
-
- if (!_S_bin[bin].mutex)
- __throw_bad_alloc();
+ _S_bin[bin].mutex =(__gthread_mutex_t*) malloc(sizeof(__gthread_mutex_t));
#ifdef __GTHREAD_MUTEX_INIT
{
@@ -635,34 +676,27 @@ namespace __gnu_cxx
}
}
- _S_initialized = true;
+ _S_initialized = true;
}
#ifdef __GTHREADS
- template<int __inst>
+ template<typename _Tp>
void
- __mt_alloc<__inst>::
+ __mt_alloc<_Tp>::
_S_thread_key_destr(void* freelist_pos)
{
/*
- * This is due to the ugly workaround mentioned in _S_init()
- */
- if (freelist_pos == NULL)
- return;
-
- /*
- * If the thread - when it dies - still have records on its
+ * If the thread - when it dies - still has records on its
* freelist we return them to the global pool here.
*/
for (size_t bin = 0; bin < _S_no_of_bins; bin++)
{
- block_record* block =
+ block_record* block =
_S_bin[bin].first[((thread_record*)freelist_pos)->id];
if (block != NULL)
{
__gthread_mutex_lock(_S_bin[bin].mutex);
-
while (block != NULL)
{
if (_S_bin[bin].first[0] == NULL)
@@ -671,14 +705,11 @@ namespace __gnu_cxx
_S_bin[bin].last[0]->next = block;
_S_bin[bin].last[0] = block;
-
block = block->next;
-
_S_bin[bin].free[0]++;
}
_S_bin[bin].last[0]->next = NULL;
-
__gthread_mutex_unlock(_S_bin[bin].mutex);
}
}
@@ -687,18 +718,15 @@ namespace __gnu_cxx
* Return this thread id record to thread_freelist
*/
__gthread_mutex_lock(&_S_thread_freelist_mutex);
-
_S_thread_freelist_last->next = (thread_record*)freelist_pos;
_S_thread_freelist_last = (thread_record*)freelist_pos;
_S_thread_freelist_last->next = NULL;
-
__gthread_mutex_unlock(&_S_thread_freelist_mutex);
-
}
- template<int __inst>
+ template<typename _Tp>
size_t
- __mt_alloc<__inst>::
+ __mt_alloc<_Tp>::
_S_get_thread_id()
{
/*
@@ -711,19 +739,17 @@ namespace __gnu_cxx
{
thread_record* freelist_pos;
- if ((freelist_pos =
+ if ((freelist_pos =
(thread_record*)__gthread_getspecific(_S_thread_key)) == NULL)
{
- __gthread_mutex_lock(&_S_thread_freelist_mutex);
-
/*
* Since _S_max_threads must be larger than the
* theoretical max number of threads of the OS the list
* can never be empty.
*/
+ __gthread_mutex_lock(&_S_thread_freelist_mutex);
freelist_pos = _S_thread_freelist_first;
_S_thread_freelist_first = _S_thread_freelist_first->next;
-
__gthread_mutex_unlock(&_S_thread_freelist_mutex);
__gthread_setspecific(_S_thread_key, (void*)freelist_pos);
@@ -742,7 +768,7 @@ namespace __gnu_cxx
_S_bin[bin].last[freelist_pos->id] = NULL;
_S_bin[bin].free[freelist_pos->id] = 0;
}
- }
+ }
return freelist_pos->id;
}
@@ -754,23 +780,23 @@ namespace __gnu_cxx
return 0;
}
- template<int __inst> __gthread_once_t
- __mt_alloc<__inst>::_S_once_mt = __GTHREAD_ONCE_INIT;
+ template<typename _Tp> __gthread_once_t
+ __mt_alloc<_Tp>::_S_once_mt = __GTHREAD_ONCE_INIT;
#endif
- template<int __inst> bool
- __mt_alloc<__inst>::_S_initialized = false;
+ template<typename _Tp> bool
+ __mt_alloc<_Tp>::_S_initialized = false;
- template<int __inst> typename __mt_alloc<__inst>::binmap_type*
- __mt_alloc<__inst>::_S_binmap = NULL;
+ template<typename _Tp> typename __mt_alloc<_Tp>::binmap_type*
+ __mt_alloc<_Tp>::_S_binmap = NULL;
/*
* Allocation requests (after round-up to power of 2) below this
* value will be handled by the allocator. A raw malloc/free() call
* will be used for requests larger than this value.
*/
- template<int __inst> size_t
- __mt_alloc<__inst>::_S_max_bytes = 128;
+ template<typename _Tp> size_t
+ __mt_alloc<_Tp>::_S_max_bytes = 128;
/*
* In order to avoid fragmenting and minimize the number of malloc()
@@ -779,21 +805,21 @@ namespace __gnu_cxx
* choosen the value below. See
* http://gcc.gnu.org/ml/libstdc++/2001-07/msg00077.html
*/
- template<int __inst> size_t
- __mt_alloc<__inst>::_S_chunk_size = 4096 - 4 * sizeof(void*);
+ template<typename _Tp> size_t
+ __mt_alloc<_Tp>::_S_chunk_size = 4096 - 4 * sizeof(void*);
/*
* The maximum number of supported threads. Our Linux 2.4.18 reports
* 4070 in /proc/sys/kernel/threads-max
*/
- template<int __inst> size_t
- __mt_alloc<__inst>::_S_max_threads = 4096;
+ template<typename _Tp> size_t
+ __mt_alloc<_Tp>::_S_max_threads = 4096;
/*
* Actual value calculated in _S_init()
*/
- template<int __inst> size_t
- __mt_alloc<__inst>::_S_no_of_bins = 1;
+ template<typename _Tp> size_t
+ __mt_alloc<_Tp>::_S_no_of_bins = 1;
/*
* Each time a deallocation occurs in a threaded application we make
@@ -802,63 +828,31 @@ namespace __gnu_cxx
* more than _S_freelist_headroom % of the freelist, we move these
* records back to the global pool.
*/
- template<int __inst> size_t
- __mt_alloc<__inst>::_S_freelist_headroom = 10;
+ template<typename _Tp> size_t
+ __mt_alloc<_Tp>::_S_freelist_headroom = 10;
/*
* Actual initialization in _S_init()
*/
#ifdef __GTHREADS
- template<int __inst> typename __mt_alloc<__inst>::thread_record*
- __mt_alloc<__inst>::_S_thread_freelist_first = NULL;
+ template<typename _Tp> typename __mt_alloc<_Tp>::thread_record*
+ __mt_alloc<_Tp>::_S_thread_freelist_first = NULL;
- template<int __inst> typename __mt_alloc<__inst>::thread_record*
- __mt_alloc<__inst>::_S_thread_freelist_last = NULL;
+ template<typename _Tp> typename __mt_alloc<_Tp>::thread_record*
+ __mt_alloc<_Tp>::_S_thread_freelist_last = NULL;
- template<int __inst> __gthread_mutex_t
- __mt_alloc<__inst>::_S_thread_freelist_mutex = __GTHREAD_MUTEX_INIT;
+ template<typename _Tp> __gthread_mutex_t
+ __mt_alloc<_Tp>::_S_thread_freelist_mutex = __GTHREAD_MUTEX_INIT;
/*
* Actual initialization in _S_init()
*/
- template<int __inst> __gthread_key_t
- __mt_alloc<__inst>::_S_thread_key;
+ template<typename _Tp> __gthread_key_t
+ __mt_alloc<_Tp>::_S_thread_key;
#endif
- template<int __inst> typename __mt_alloc<__inst>::bin_record*
- __mt_alloc<__inst>::_S_bin = NULL;
-
- template<int __inst>
- inline bool
- operator==(const __mt_alloc<__inst>&, const __mt_alloc<__inst>&)
- { return true; }
-
- template<int __inst>
- inline bool
- operator!=(const __mt_alloc<__inst>&, const __mt_alloc<__inst>&)
- { return false; }
+ template<typename _Tp> typename __mt_alloc<_Tp>::bin_record*
+ __mt_alloc<_Tp>::_S_bin = NULL;
} // namespace __gnu_cxx
-namespace std
-{
- template<typename _Tp, int __inst>
- struct _Alloc_traits<_Tp, __gnu_cxx::__mt_alloc<__inst> >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx:: __mt_alloc<__inst> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
- };
-
- template<typename _Tp, typename _Tp1, int __inst>
- struct _Alloc_traits<_Tp,
- __allocator<_Tp1, __gnu_cxx::__mt_alloc<__inst> > >
- {
- static const bool _S_instanceless = true;
- typedef __gnu_cxx:: __mt_alloc<__inst> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
- typedef __allocator<_Tp, base_alloc_type> allocator_type;
- };
-} // namespace std
-
#endif
diff --git a/libstdc++-v3/include/ext/new_allocator.h b/libstdc++-v3/include/ext/new_allocator.h
index 794751d3c13..6c8ca6349ed 100644
--- a/libstdc++-v3/include/ext/new_allocator.h
+++ b/libstdc++-v3/include/ext/new_allocator.h
@@ -1,4 +1,4 @@
-// Allocators -*- C++ -*-
+// Allocator that wraps operator new -*- C++ -*-
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
//
@@ -35,24 +35,69 @@
namespace __gnu_cxx
{
/**
- * @if maint
- * A new-based allocator, as required by the standard. Allocation and
- * deallocation forward to global new and delete. "SGI" style, minus
- * reallocate().
- * @endif
+ * @brief An allocator that uses global new, as per [20.4].
+ *
+ * This is precisely the allocator defined in the C++ Standard.
+ * - all allocation calls operator new
+ * - all deallocation calls operator delete
+ *
* (See @link Allocators allocators info @endlink for more.)
*/
- class __new_alloc
- {
- public:
- static void*
- allocate(size_t __n)
- { return ::operator new(__n); }
-
- static void
- deallocate(void* __p, size_t)
- { ::operator delete(__p); }
- };
+ template<typename _Tp>
+ class new_allocator
+ {
+ public:
+ typedef size_t size_type;
+ typedef ptrdiff_t difference_type;
+ typedef _Tp* pointer;
+ typedef const _Tp* const_pointer;
+ typedef _Tp& reference;
+ typedef const _Tp& const_reference;
+ typedef _Tp value_type;
+
+ template<typename _Tp1>
+ struct rebind
+ { typedef new_allocator<_Tp1> other; };
+
+ new_allocator() throw() { }
+
+ new_allocator(const new_allocator&) throw() { }
+
+ template<typename _Tp1>
+ new_allocator(const new_allocator<_Tp1>&) throw() { }
+
+ ~new_allocator() throw() { }
+
+ pointer
+ address(reference __x) const { return &__x; }
+
+ const_pointer
+ address(const_reference __x) const { return &__x; }
+
+ // NB: __n is permitted to be 0. The C++ standard says nothing
+ // about what the return value is when __n == 0.
+ pointer
+ allocate(size_type __n, allocator<void>::const_pointer __h = 0)
+ { return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp))); }
+
+ // __p is not permitted to be a null pointer.
+ void
+ deallocate(pointer __p, size_type __n)
+ { ::operator delete(__p); }
+
+ size_type
+ max_size() const throw()
+ { return size_t(-1) / sizeof(_Tp); }
+
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 402. wrong new expression in [some_] allocator::construct
+ void
+ construct(pointer __p, const _Tp& __val)
+ { ::new(__p) _Tp(__val); }
+
+ void
+ destroy(pointer __p) { __p->~_Tp(); }
+ };
} // namespace __gnu_cxx
#endif
diff --git a/libstdc++-v3/include/ext/numeric b/libstdc++-v3/include/ext/numeric
index a596d999015..40edf07fe3d 100644
--- a/libstdc++-v3/include/ext/numeric
+++ b/libstdc++-v3/include/ext/numeric
@@ -72,7 +72,7 @@
namespace __gnu_cxx
{
// Returns __x ** __n, where __n >= 0. _Note that "multiplication"
- // is required to be associative, but not necessarily commutative.
+ // is required to be associative, but not necessarily commutative.
template<typename _Tp, typename _Integer, typename _MonoidOperation>
_Tp
__power(_Tp __x, _Integer __n, _MonoidOperation __monoid_op)
@@ -131,7 +131,7 @@ namespace __gnu_cxx
*/
// iota is not part of the C++ standard. It is an extension.
template<typename _ForwardIter, typename _Tp>
- void
+ void
iota(_ForwardIter __first, _ForwardIter __last, _Tp __value)
{
// concept requirements
diff --git a/libstdc++-v3/include/ext/pod_char_traits.h b/libstdc++-v3/include/ext/pod_char_traits.h
index 05190295f4b..c69025e005d 100644
--- a/libstdc++-v3/include/ext/pod_char_traits.h
+++ b/libstdc++-v3/include/ext/pod_char_traits.h
@@ -32,7 +32,7 @@
#ifndef _POD_CHAR_TRAITS_H
#define _POD_CHAR_TRAITS_H 1
-
+
#include <string>
namespace __gnu_cxx
@@ -40,19 +40,19 @@ namespace __gnu_cxx
template<typename V, typename I, typename S = mbstate_t>
struct character
{
- typedef V value_type;
- typedef I int_type;
- typedef S state_type;
- value_type value;
+ typedef V value_type;
+ typedef I int_type;
+ typedef S state_type;
+ value_type value;
};
-
+
template<typename V, typename I>
- inline bool
+ inline bool
operator==(const character<V, I>& lhs, const character<V, I>& rhs)
{ return lhs.value == rhs.value; }
-
+
template<typename V, typename I>
- inline bool
+ inline bool
operator<(const character<V, I>& lhs, const character<V, I>& rhs)
{ return lhs.value < rhs.value; }
} // namespace __gnu_cxx
@@ -63,93 +63,93 @@ namespace std
template<typename V, typename I, typename S>
struct char_traits<__gnu_cxx::character<V, I, S> >
{
- typedef __gnu_cxx::character<V, I, S> char_type;
+ typedef __gnu_cxx::character<V, I, S> char_type;
// NB: This type should be bigger than char_type, so as to
// properly hold EOF values in addition to the full range of
// char_type values.
- // Also, assumes
+ // Also, assumes
// int_type(value_type) is valid.
// int_type(-1) is possible.
typedef typename char_type::int_type int_type;
typedef typename char_type::state_type state_type;
typedef fpos<state_type> pos_type;
- typedef streamoff off_type;
-
- static void
+ typedef streamoff off_type;
+
+ static void
assign(char_type& __c1, const char_type& __c2)
{ __c1 = __c2; }
- static bool
+ static bool
eq(const char_type& __c1, const char_type& __c2)
{ return __c1 == __c2; }
- static bool
+ static bool
lt(const char_type& __c1, const char_type& __c2)
{ return __c1 < __c2; }
- static int
+ static int
compare(const char_type* __s1, const char_type* __s2, size_t __n)
- {
+ {
for (size_t __i = 0; __i < __n; ++__i)
if (!eq(__s1[__i], __s2[__i]))
return lt(__s1[__i], __s2[__i]) ? -1 : 1;
- return 0;
+ return 0;
}
static size_t
length(const char_type* __s)
- {
- const char_type* __p = __s;
- while (__p->value)
- ++__p;
- return (__p - __s);
+ {
+ const char_type* __p = __s;
+ while (__p->value)
+ ++__p;
+ return (__p - __s);
}
- static const char_type*
+ static const char_type*
find(const char_type* __s, size_t __n, const char_type& __a)
- {
+ {
for (const char_type* __p = __s; size_t(__p - __s) < __n; ++__p)
- if (*__p == __a)
+ if (*__p == __a)
return __p;
return 0;
}
- static char_type*
+ static char_type*
move(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memmove(__s1, __s2, __n * sizeof(char_type)); }
- static char_type*
+ static char_type*
copy(char_type* __s1, const char_type* __s2, size_t __n)
{ return (char_type*) memcpy(__s1, __s2, __n * sizeof(char_type)); }
- static char_type*
+ static char_type*
assign(char_type* __s, size_t __n, char_type __a)
- {
- for (char_type* __p = __s; __p < __s + __n; ++__p)
+ {
+ for (char_type* __p = __s; __p < __s + __n; ++__p)
assign(*__p, __a);
- return __s;
+ return __s;
}
- static char_type
+ static char_type
to_char_type(const int_type& __c)
{
char_type __r = { __c };
return __r;
}
- static int_type
- to_int_type(const char_type& __c)
+ static int_type
+ to_int_type(const char_type& __c)
{ return int_type(__c.value); }
- static bool
+ static bool
eq_int_type(const int_type& __c1, const int_type& __c2)
{ return __c1 == __c2; }
- static int_type
+ static int_type
eof() { return static_cast<int_type>(-1); }
- static int_type
+ static int_type
not_eof(const int_type& __c)
{ return eq_int_type(__c, eof()) ? int_type(0) : __c; }
};
diff --git a/libstdc++-v3/include/ext/pool_allocator.h b/libstdc++-v3/include/ext/pool_allocator.h
index cec7920483f..02303de31fd 100644
--- a/libstdc++-v3/include/ext/pool_allocator.h
+++ b/libstdc++-v3/include/ext/pool_allocator.h
@@ -41,18 +41,17 @@
*/
/** @file ext/debug_allocator.h
- * This file is a GNU extension to the Standard C++ Library.
+ * This file is a GNU extension to the Standard C++ Library.
* You should only include this header if you are using GCC 3 or later.
*/
-
#ifndef _POOL_ALLOCATOR_H
#define _POOL_ALLOCATOR_H 1
-#include <bits/functexcept.h>
+#include <new>
+#include <bits/functexcept.h>
#include <bits/stl_threads.h>
#include <bits/atomicity.h>
#include <bits/allocator_traits.h>
-#include <ext/new_allocator.h>
namespace __gnu_cxx
{
@@ -65,9 +64,9 @@ namespace __gnu_cxx
* when in default high-speed pool mode).
*
* Important implementation properties:
- * 0. If globally mandated, then allocate objects from __new_alloc
+ * 0. If globally mandated, then allocate objects from new
* 1. If the clients request an object of size > _S_max_bytes, the resulting
- * object will be obtained directly from __new_alloc
+ * object will be obtained directly from new
* 2. In all other cases, we allocate an object of size exactly
* _S_round_up(requested_size). Thus the client has enough size
* information that we can return the object to the proper free list
@@ -111,7 +110,7 @@ namespace __gnu_cxx
static size_t _S_heap_size;
static _STL_mutex_lock _S_lock;
- static _Atomic_word _S_force_new;
+ static _Atomic_word _S_force_new;
static size_t
_S_round_up(size_t __bytes)
@@ -152,7 +151,7 @@ namespace __gnu_cxx
template<bool __threads, int __inst>
inline bool
- operator==(const __pool_alloc<__threads,__inst>&,
+ operator==(const __pool_alloc<__threads,__inst>&,
const __pool_alloc<__threads,__inst>&)
{ return true; }
@@ -201,7 +200,7 @@ namespace __gnu_cxx
((_Obj*)(void*)_S_start_free)->_M_free_list_link = *__free_list;
*__free_list = (_Obj*)(void*)_S_start_free;
}
- _S_start_free = (char*) __new_alloc::allocate(__bytes_to_get);
+ _S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
if (_S_start_free == 0)
{
size_t __i;
@@ -226,7 +225,7 @@ namespace __gnu_cxx
}
}
_S_end_free = 0; // In case of exception.
- _S_start_free = (char*)__new_alloc::allocate(__bytes_to_get);
+ _S_start_free = static_cast<char*>(::operator new(__bytes_to_get));
// This should either throw an exception or remedy the situation.
// Thus we assume it succeeded.
}
@@ -289,9 +288,9 @@ namespace __gnu_cxx
else
__atomic_add(&_S_force_new, -1);
}
-
+
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
- __ret = __new_alloc::allocate(__n);
+ __ret = ::operator new(__n);
else
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);
@@ -306,24 +305,24 @@ namespace __gnu_cxx
{
*__free_list = __result -> _M_free_list_link;
__ret = __result;
- }
+ }
if (__builtin_expect(__ret == 0, 0))
__throw_bad_alloc();
}
return __ret;
}
-
+
template<bool __threads, int __inst>
void
__pool_alloc<__threads, __inst>::deallocate(void* __p, size_t __n)
{
if ((__n > (size_t) _S_max_bytes) || (_S_force_new > 0))
- __new_alloc::deallocate(__p, __n);
+ ::operator delete(__p);
else
{
_Obj* volatile* __free_list = _S_free_list + _S_freelist_index(__n);
_Obj* __q = (_Obj*)__p;
-
+
// Acquire the lock here with a constructor call. This
// ensures that it is released in exit or during stack
// unwinding.
@@ -368,9 +367,9 @@ namespace std
template<typename _Tp, bool __thr, int __inst>
struct _Alloc_traits<_Tp, __gnu_cxx::__pool_alloc<__thr, __inst> >
{
- static const bool _S_instanceless = true;
- typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
- typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
+ static const bool _S_instanceless = true;
+ typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
+ typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
typedef __allocator<_Tp, base_alloc_type> allocator_type;
};
//@}
@@ -379,11 +378,11 @@ namespace std
/// Versions for the __allocator adaptor used with the predefined
/// "SGI" style allocators.
template<typename _Tp, typename _Tp1, bool __thr, int __inst>
- struct _Alloc_traits<_Tp, __allocator<_Tp1,
+ struct _Alloc_traits<_Tp, __allocator<_Tp1,
__gnu_cxx::__pool_alloc<__thr, __inst> > >
{
static const bool _S_instanceless = true;
- typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
+ typedef __gnu_cxx::__pool_alloc<__thr, __inst> base_alloc_type;
typedef __simple_alloc<_Tp, base_alloc_type> _Alloc_type;
typedef __allocator<_Tp, base_alloc_type> allocator_type;
};
diff --git a/libstdc++-v3/include/ext/rb_tree b/libstdc++-v3/include/ext/rb_tree
index f0aed4714f9..2c38b39706e 100644
--- a/libstdc++-v3/include/ext/rb_tree
+++ b/libstdc++-v3/include/ext/rb_tree
@@ -70,7 +70,7 @@ namespace __gnu_cxx
{
using std::_Rb_tree;
using std::allocator;
-
+
// Class rb_tree is not part of the C++ standard. It is provided for
// compatibility with the HP STL.
@@ -85,13 +85,13 @@ namespace __gnu_cxx
{
typedef _Rb_tree<_Key, _Value, _KeyOfValue, _Compare, _Alloc> _Base;
typedef typename _Base::allocator_type allocator_type;
-
+
rb_tree(const _Compare& __comp = _Compare(),
const allocator_type& __a = allocator_type())
: _Base(__comp, __a) { }
-
+
~rb_tree() { }
};
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/rope b/libstdc++-v3/include/ext/rope
index c12eaa87393..4323e19c2b9 100644
--- a/libstdc++-v3/include/ext/rope
+++ b/libstdc++-v3/include/ext/rope
@@ -112,7 +112,7 @@ template <class _CharT>
class char_producer {
public:
virtual ~char_producer() {};
- virtual void operator()(size_t __start_pos, size_t __len,
+ virtual void operator()(size_t __start_pos, size_t __len,
_CharT* __buffer) = 0;
// Buffer should really be an arbitrary output iterator.
// That way we could flatten directly into an ostream, etc.
@@ -265,17 +265,17 @@ _Rope_const_iterator<_CharT,_Alloc> operator+
const _Rope_const_iterator<_CharT,_Alloc>& __x);
template<class _CharT, class _Alloc>
-bool operator==
+bool operator==
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
template<class _CharT, class _Alloc>
-bool operator<
+bool operator<
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
template<class _CharT, class _Alloc>
-ptrdiff_t operator-
+ptrdiff_t operator-
(const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y);
@@ -295,32 +295,32 @@ _Rope_iterator<_CharT,_Alloc> operator+
const _Rope_iterator<_CharT,_Alloc>& __x);
template<class _CharT, class _Alloc>
-bool operator==
+bool operator==
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
template<class _CharT, class _Alloc>
-bool operator<
+bool operator<
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
template<class _CharT, class _Alloc>
-ptrdiff_t operator-
+ptrdiff_t operator-
(const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y);
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right);
-
+
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
const _CharT* __right);
-
+
template<class _CharT, class _Alloc>
rope<_CharT,_Alloc> operator+ (const rope<_CharT,_Alloc>& __left,
_CharT __right);
-
+
// Some helpers, so we can use power on ropes.
// See below for why this isn't local to the implementation.
@@ -347,16 +347,16 @@ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
// Class _Refcount_Base provides a type, _RC_t, a data member,
// _M_ref_count, and member functions _M_incr and _M_decr, which perform
- // atomic preincrement/predecrement. The constructor initializes
+ // atomic preincrement/predecrement. The constructor initializes
// _M_ref_count.
struct _Refcount_Base
{
// The type _RC_t
typedef size_t _RC_t;
-
+
// The data member _M_ref_count
volatile _RC_t _M_ref_count;
-
+
// Constructor
__gthread_mutex_t _M_ref_count_lock;
@@ -372,16 +372,16 @@ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
#endif
}
- void
- _M_incr()
+ void
+ _M_incr()
{
__gthread_mutex_lock(&_M_ref_count_lock);
++_M_ref_count;
__gthread_mutex_unlock(&_M_ref_count_lock);
}
- _RC_t
- _M_decr()
+ _RC_t
+ _M_decr()
{
__gthread_mutex_lock(&_M_ref_count_lock);
volatile _RC_t __tmp = --_M_ref_count;
@@ -420,7 +420,7 @@ identity_element(_Rope_Concat_fn<_CharT, _Alloc>)
// we are using standard conforming allocators, and whether the allocator
// instances have real state. Thus this macro is invoked repeatedly
// with different definitions of __ROPE_DEFINE_ALLOC.
-// __ROPE_DEFINE_ALLOC(type,name) defines
+// __ROPE_DEFINE_ALLOC(type,name) defines
// type * name_allocate(size_t) and
// void name_deallocate(tipe *, size_t)
// Both functions may or may not be static.
@@ -460,7 +460,7 @@ public:
size_t _M_size; // This is here only to avoid wasting space
// for an otherwise empty base class.
-
+
protected:
allocator_type _M_data_allocator;
@@ -476,7 +476,7 @@ protected:
};
// Specialization for allocators that have the property that we don't
-// actually have to store an allocator object.
+// actually have to store an allocator object.
template <class _CharT, class _Allocator>
class _Rope_rep_alloc_base<_CharT,_Allocator,true> {
public:
@@ -486,7 +486,7 @@ public:
_Rope_rep_alloc_base(size_t __size, const allocator_type&)
: _M_size(__size) {}
size_t _M_size;
-
+
protected:
# define __ROPE_DEFINE_ALLOC(_Tp, __name) \
@@ -513,7 +513,7 @@ struct _Rope_rep_base
typedef typename _Base::allocator_type allocator_type;
_Rope_rep_base(size_t __size, const allocator_type& __a)
: _Base(__size, __a) {}
-};
+};
template<class _CharT, class _Alloc>
@@ -612,7 +612,7 @@ struct _Rope_RopeLeaf : public _Rope_RopeRep<_CharT,_Alloc> {
enum { _S_alloc_granularity = 8 };
static size_t _S_rounded_up_size(size_t __n) {
size_t __size_with_eos;
-
+
if (_S_is_basic_char_type((_CharT*)0)) {
__size_with_eos = __n + 1;
} else {
@@ -780,7 +780,7 @@ struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
this->_M_tag = _Rope_RopeFunction<_CharT,_Alloc>::_S_substringfn;
}
virtual ~_Rope_RopeSubstring()
- {
+ {
# ifndef __GC
_M_base->_M_unref_nonnil();
// _M_free_c_string(); -- done by parent class
@@ -802,7 +802,7 @@ struct _Rope_RopeSubstring : public _Rope_RopeFunction<_CharT,_Alloc>,
template<class _CharT, class _Alloc>
struct _Rope_self_destruct_ptr {
_Rope_RopeRep<_CharT,_Alloc>* _M_ptr;
- ~_Rope_self_destruct_ptr()
+ ~_Rope_self_destruct_ptr()
{ _Rope_RopeRep<_CharT,_Alloc>::_S_unref(_M_ptr); }
#ifdef __EXCEPTIONS
_Rope_self_destruct_ptr() : _M_ptr(0) {};
@@ -854,7 +854,7 @@ class _Rope_char_ref_proxy {
_Rope_char_ref_proxy& operator= (_CharT __c);
_Rope_char_ptr_proxy<_CharT,_Alloc> operator& () const;
_Rope_char_ref_proxy& operator= (const _Rope_char_ref_proxy& __c) {
- return operator=((_CharT)__c);
+ return operator=((_CharT)__c);
}
};
@@ -873,14 +873,14 @@ class _Rope_char_ptr_proxy {
size_t _M_pos;
rope<_CharT,_Alloc>* _M_root; // The whole rope.
public:
- _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
+ _Rope_char_ptr_proxy(const _Rope_char_ref_proxy<_CharT,_Alloc>& __x)
: _M_pos(__x._M_pos), _M_root(__x._M_root) {}
_Rope_char_ptr_proxy(const _Rope_char_ptr_proxy& __x)
: _M_pos(__x._M_pos), _M_root(__x._M_root) {}
_Rope_char_ptr_proxy() {}
_Rope_char_ptr_proxy(_CharT* __x) : _M_root(0), _M_pos(0) {
}
- _Rope_char_ptr_proxy&
+ _Rope_char_ptr_proxy&
operator= (const _Rope_char_ptr_proxy& __x) {
_M_pos = __x._M_pos;
_M_root = __x._M_root;
@@ -942,7 +942,7 @@ class _Rope_iterator_base
// __right. Assumes path_cache_len <= 9.
_CharT _M_tmp_buf[_S_iterator_buf_len];
// Short buffer for surrounding chars.
- // This is useful primarily for
+ // This is useful primarily for
// RopeFunctions. We put the buffer
// here to avoid locking in the
// multithreaded case.
@@ -1081,7 +1081,7 @@ class _Rope_const_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
- friend bool operator<
+ friend bool operator<
(const _Rope_const_iterator<_CharT2,_Alloc2>& __x,
const _Rope_const_iterator<_CharT2,_Alloc2>& __y);
template<class _CharT2, class _Alloc2>
@@ -1105,7 +1105,7 @@ class _Rope_iterator : public _Rope_iterator_base<_CharT,_Alloc> {
// nonGC case.
_Rope_iterator(rope<_CharT,_Alloc>* __r, size_t __pos)
: _Rope_iterator_base<_CharT,_Alloc>(__r->_M_tree_ptr, __pos),
- _M_root_rope(__r)
+ _M_root_rope(__r)
{ _RopeRep::_S_ref(this->_M_root);
if (!(__r -> empty()))_S_setcache(*this); }
@@ -1235,7 +1235,7 @@ public:
: _M_tree_ptr(__t), _M_data_allocator(__a) {}
_Rope_alloc_base(const allocator_type& __a)
: _M_data_allocator(__a) {}
-
+
protected:
// The only data members of a rope:
allocator_type _M_data_allocator;
@@ -1253,7 +1253,7 @@ protected:
};
// Specialization for allocators that have the property that we don't
-// actually have to store an allocator object.
+// actually have to store an allocator object.
template <class _CharT, class _Allocator>
class _Rope_alloc_base<_CharT,_Allocator,true> {
public:
@@ -1264,7 +1264,7 @@ public:
_Rope_alloc_base(_RopeRep *__t, const allocator_type&)
: _M_tree_ptr(__t) {}
_Rope_alloc_base(const allocator_type&) {}
-
+
protected:
// The only data member of a rope:
_RopeRep *_M_tree_ptr;
@@ -1283,7 +1283,7 @@ protected:
};
template <class _CharT, class _Alloc>
-struct _Rope_base
+struct _Rope_base
: public _Rope_alloc_base<_CharT,_Alloc,
_Alloc_traits<_CharT,_Alloc>::_S_instanceless>
{
@@ -1295,7 +1295,7 @@ struct _Rope_base
// The one in _Base may not be visible due to template rules.
_Rope_base(_RopeRep* __t, const allocator_type& __a) : _Base(__t, __a) {}
_Rope_base(const allocator_type& __a) : _Base(__a) {}
-};
+};
/**
@@ -1429,7 +1429,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
return _S_rounded_up_size(__n);
}
}
-
+
// Allocate and construct a RopeLeaf using the supplied allocator
// Takes ownership of s instead of copying.
static _RopeLeaf* _S_new_RopeLeaf(__GC_CONST _CharT *__s,
@@ -1466,7 +1466,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
_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)
+ _S_RopeLeaf_from_unowned_char_ptr(__s, __size, __a)
{
if (0 == __size) return 0;
_CharT* __buf = __a.allocate(_S_rounded_up_size(__size));
@@ -1482,7 +1482,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
__throw_exception_again;
}
}
-
+
// Concatenation of nonempty strings.
// Always builds a concatenation node.
@@ -1526,7 +1526,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
size_t __start, size_t __len,
_CharT* __buffer);
- static const unsigned long
+ static const unsigned long
_S_min_len[_RopeRep::_S_max_rope_depth + 1];
static bool _S_is_balanced(_RopeRep* __r)
@@ -1559,7 +1559,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// Add all unbalanced subtrees to the forest of balanceed trees.
// Used only by balance.
static void _S_add_to_forest(_RopeRep*__r, _RopeRep** __forest);
-
+
// Add __r to forest, assuming __r is already balanced.
static void _S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest);
@@ -1677,7 +1677,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
void pop_back()
{
_RopeRep* __old = this->_M_tree_ptr;
- this->_M_tree_ptr =
+ this->_M_tree_ptr =
_S_substring(this->_M_tree_ptr,
0,
this->_M_tree_ptr->_M_size - 1);
@@ -1736,7 +1736,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// rest of the interface.
// Note that this guaranteed not to compile if the draft standard
// order is assumed.
- size_type copy(size_type __pos, size_type __n, _CharT* __buffer) const
+ size_type copy(size_type __pos, size_type __n, _CharT* __buffer) const
{
size_t __size = size();
size_t __len = (__pos + __n > __size? __size - __pos : __n);
@@ -1765,8 +1765,8 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// is safe for multiple threads.
void delete_c_str () {
if (0 == this->_M_tree_ptr) return;
- if (_RopeRep::_S_leaf == this->_M_tree_ptr->_M_tag &&
- ((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
+ if (_RopeRep::_S_leaf == this->_M_tree_ptr->_M_tag &&
+ ((_RopeLeaf*)this->_M_tree_ptr)->_M_data ==
this->_M_tree_ptr->_M_c_string) {
// Representation shared
return;
@@ -1803,7 +1803,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
return(const_iterator(this->_M_tree_ptr, size()));
}
- size_type size() const {
+ size_type size() const {
return(0 == this->_M_tree_ptr? 0 : this->_M_tree_ptr->_M_size);
}
@@ -1840,12 +1840,12 @@ class rope : public _Rope_base<_CharT,_Alloc> {
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left,
const rope<_CharT2,_Alloc2>& __right);
-
+
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left,
const _CharT2* __right);
-
+
template<class _CharT2, class _Alloc2>
friend rope<_CharT2,_Alloc2>
operator+ (const rope<_CharT2,_Alloc2>& __left, _CharT2 __right);
@@ -1856,7 +1856,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// The first argument should be an input iterator or
// forward iterator with value_type _CharT.
rope& append(const _CharT* __iter, size_t __n) {
- _RopeRep* __result =
+ _RopeRep* __result =
_S_destr_concat_char_iter(this->_M_tree_ptr, __iter, __n);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
@@ -1880,7 +1880,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
rope& append(const_iterator __s, const_iterator __e) {
_Self_destruct_ptr __appendee(_S_substring(
__s._M_root, __s._M_current_pos, __e._M_current_pos));
- _RopeRep* __result =
+ _RopeRep* __result =
_S_concat(this->_M_tree_ptr, (_RopeRep*)__appendee);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
@@ -1888,7 +1888,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
}
rope& append(_CharT __c) {
- _RopeRep* __result =
+ _RopeRep* __result =
_S_destr_concat_char_iter(this->_M_tree_ptr, &__c, 1);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
@@ -1938,7 +1938,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
public:
void insert(size_t __p, const rope& __r) {
- _RopeRep* __result =
+ _RopeRep* __result =
replace(this->_M_tree_ptr, __p, __p, __r._M_tree_ptr);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
@@ -1996,13 +1996,13 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// (position, length) versions of replace operations:
void replace(size_t __p, size_t __n, const rope& __r) {
- _RopeRep* __result =
+ _RopeRep* __result =
replace(this->_M_tree_ptr, __p, __p + __n, __r._M_tree_ptr);
_S_unref(this->_M_tree_ptr);
this->_M_tree_ptr = __result;
}
- void replace(size_t __p, size_t __n,
+ void replace(size_t __p, size_t __n,
const _CharT* __i, size_t __i_len) {
rope __r(__i, __i_len);
replace(__p, __n, __r);
@@ -2018,7 +2018,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
replace(__p, __n, __r);
}
- void replace(size_t __p, size_t __n,
+ void replace(size_t __p, size_t __n,
const _CharT* __i, const _CharT* __j) {
rope __r(__i, __j);
replace(__p, __n, __r);
@@ -2080,20 +2080,20 @@ class rope : public _Rope_base<_CharT,_Alloc> {
erase(__p, __p + 1);
}
- // Insert, iterator variants.
+ // Insert, iterator variants.
iterator insert(const iterator& __p, const rope& __r)
{ insert(__p.index(), __r); return __p; }
iterator insert(const iterator& __p, size_t __n, _CharT __c)
{ insert(__p.index(), __n, __c); return __p; }
- iterator insert(const iterator& __p, _CharT __c)
+ iterator insert(const iterator& __p, _CharT __c)
{ insert(__p.index(), __c); return __p; }
- iterator insert(const iterator& __p )
+ iterator insert(const iterator& __p )
{ insert(__p.index()); return __p; }
- iterator insert(const iterator& __p, const _CharT* c_string)
+ iterator insert(const iterator& __p, const _CharT* c_string)
{ insert(__p.index(), c_string); return __p; }
iterator insert(const iterator& __p, const _CharT* __i, size_t __n)
{ insert(__p.index(), __i, __n); return __p; }
- iterator insert(const iterator& __p, const _CharT* __i,
+ iterator insert(const iterator& __p, const _CharT* __i,
const _CharT* __j)
{ insert(__p.index(), __i, __j); return __p; }
iterator insert(const iterator& __p,
@@ -2136,7 +2136,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
{ replace(__p.index(), __i, __n); }
void replace(const iterator& __p, const _CharT* __i, const _CharT* __j)
{ replace(__p.index(), __i, __j); }
- void replace(const iterator& __p, const_iterator __i,
+ void replace(const iterator& __p, const_iterator __i,
const_iterator __j)
{ replace(__p.index(), __i, __j); }
void replace(const iterator& __p, iterator __i, iterator __j)
@@ -2167,13 +2167,13 @@ class rope : public _Rope_base<_CharT,_Alloc> {
__start.index(),
__end.index()));
}
-
+
rope substr(iterator __start) const {
size_t __pos = __start.index();
return rope<_CharT,_Alloc>(
_S_substring(this->_M_tree_ptr, __pos, __pos + 1));
}
-
+
rope substr(const_iterator __start, const_iterator __end) const {
// This might eventually take advantage of the cache in the
// iterator.
@@ -2244,7 +2244,7 @@ class rope : public _Rope_base<_CharT,_Alloc> {
// Stuff below this line is dangerous because it's error prone.
// I would really like to get rid of it.
// copy function with funny arg ordering.
- size_type copy(_CharT* __buffer, size_type __n,
+ size_type copy(_CharT* __buffer, size_type __n,
size_type __pos = 0) const {
return copy(__pos, __n, __buffer);
}
@@ -2264,11 +2264,11 @@ class rope : public _Rope_base<_CharT,_Alloc> {
const_iterator begin() { return const_begin(); }
const_reverse_iterator rend() { return const_rend(); }
-
+
const_reverse_iterator rbegin() { return const_rbegin(); }
# endif
-
+
};
template <class _CharT, class _Alloc>
@@ -2278,7 +2278,7 @@ const typename rope<_CharT, _Alloc>::size_type rope<_CharT, _Alloc>::npos =
template <class _CharT, class _Alloc>
inline bool operator== (const _Rope_const_iterator<_CharT,_Alloc>& __x,
const _Rope_const_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos == __y._M_current_pos &&
+ return (__x._M_current_pos == __y._M_current_pos &&
__x._M_root == __y._M_root);
}
@@ -2342,7 +2342,7 @@ operator+(ptrdiff_t __n, const _Rope_const_iterator<_CharT,_Alloc>& __x) {
template <class _CharT, class _Alloc>
inline bool operator== (const _Rope_iterator<_CharT,_Alloc>& __x,
const _Rope_iterator<_CharT,_Alloc>& __y) {
- return (__x._M_current_pos == __y._M_current_pos &&
+ return (__x._M_current_pos == __y._M_current_pos &&
__x._M_root_rope == __y._M_root_rope);
}
@@ -2420,7 +2420,7 @@ operator+ (const rope<_CharT,_Alloc>& __left,
template <class _CharT, class _Alloc>
inline
rope<_CharT,_Alloc>&
-operator+= (rope<_CharT,_Alloc>& __left,
+operator+= (rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right)
{
__left.append(__right);
@@ -2435,7 +2435,7 @@ operator+ (const rope<_CharT,_Alloc>& __left,
size_t __rlen = rope<_CharT,_Alloc>::_S_char_ptr_len(__right);
return rope<_CharT,_Alloc>(
rope<_CharT,_Alloc>::_S_concat_char_iter(
- __left._M_tree_ptr, __right, __rlen));
+ __left._M_tree_ptr, __right, __rlen));
}
template <class _CharT, class _Alloc>
@@ -2466,14 +2466,14 @@ operator+= (rope<_CharT,_Alloc>& __left, _CharT __right) {
template <class _CharT, class _Alloc>
bool
-operator< (const rope<_CharT,_Alloc>& __left,
+operator< (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right) {
return __left.compare(__right) < 0;
}
-
+
template <class _CharT, class _Alloc>
bool
-operator== (const rope<_CharT,_Alloc>& __left,
+operator== (const rope<_CharT,_Alloc>& __left,
const rope<_CharT,_Alloc>& __right) {
return __left.compare(__right) == 0;
}
diff --git a/libstdc++-v3/include/ext/ropeimpl.h b/libstdc++-v3/include/ext/ropeimpl.h
index 6129084deb6..b8357ee2d45 100644
--- a/libstdc++-v3/include/ext/ropeimpl.h
+++ b/libstdc++-v3/include/ext/ropeimpl.h
@@ -45,7 +45,7 @@
* You should not attempt to use it directly.
*/
-#include <cstdio>
+#include <cstdio>
#include <ostream>
#include <bits/functexcept.h>
@@ -57,7 +57,7 @@ namespace __gnu_cxx
{
using std::size_t;
using std::printf;
- using std::basic_ostream;
+ using std::basic_ostream;
using std::__throw_length_error;
using std::__alloc;
using std::_Destroy;
@@ -68,7 +68,7 @@ namespace __gnu_cxx
// Results in a valid buf_ptr if the iterator can be legitimately
// dereferenced.
template <class _CharT, class _Alloc>
-void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
+void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
_Rope_iterator_base<_CharT,_Alloc>& __x)
{
const _RopeRep* __leaf = __x._M_path_end[__x._M_leaf_index];
@@ -77,7 +77,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
switch(__leaf->_M_tag) {
case _RopeRep::_S_leaf:
- __x._M_buf_start =
+ __x._M_buf_start =
((_Rope_RopeLeaf<_CharT,_Alloc>*)__leaf)->_M_data;
__x._M_buf_ptr = __x._M_buf_start + (__pos - __leaf_pos);
__x._M_buf_end = __x._M_buf_start + __leaf->_M_size;
@@ -111,7 +111,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setbuf(
}
}
-// Set path and buffer inside a rope iterator. We assume that
+// Set path and buffer inside a rope iterator. We assume that
// pos and root are already set.
template <class _CharT, class _Alloc>
void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
@@ -154,7 +154,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache
(_Rope_RopeConcatenation<_CharT,_Alloc>*)__curr_rope;
_RopeRep* __left = __c->_M_left;
size_t __left_len = __left->_M_size;
-
+
__dirns <<= 1;
if (__pos >= __curr_start_pos + __left_len) {
__dirns |= 1;
@@ -203,7 +203,7 @@ void _Rope_iterator_base<_CharT,_Alloc>::_S_setcache_for_incr
}
// node_start_pos is starting position of last_node.
while (--__current_index >= 0) {
- if (!(__dirns & 1) /* Path turned left */)
+ if (!(__dirns & 1) /* Path turned left */)
break;
__current_node = __x._M_path_end[__current_index];
__c = (_Rope_RopeConcatenation<_CharT,_Alloc>*)__current_node;
@@ -288,23 +288,23 @@ void _Rope_iterator<_CharT,_Alloc>::_M_check() {
}
template <class _CharT, class _Alloc>
-inline
+inline
_Rope_const_iterator<_CharT, _Alloc>::_Rope_const_iterator(
const _Rope_iterator<_CharT,_Alloc>& __x)
-: _Rope_iterator_base<_CharT,_Alloc>(__x)
+: _Rope_iterator_base<_CharT,_Alloc>(__x)
{ }
template <class _CharT, class _Alloc>
inline _Rope_iterator<_CharT,_Alloc>::_Rope_iterator(
rope<_CharT,_Alloc>& __r, size_t __pos)
-: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
+: _Rope_iterator_base<_CharT,_Alloc>(__r._M_tree_ptr, __pos),
_M_root_rope(&__r)
{
_RopeRep::_S_ref(this->_M_root);
}
template <class _CharT, class _Alloc>
-inline size_t
+inline size_t
rope<_CharT,_Alloc>::_S_char_ptr_len(const _CharT* __s)
{
const _CharT* __p = __s;
@@ -409,7 +409,7 @@ rope<_CharT,_Alloc>::_S_leaf_concat_char_iter
_CharT* __new_data = (_CharT*)
_Data_allocate(_S_rounded_up_size(__old_len + __len));
_RopeLeaf* __result;
-
+
uninitialized_copy_n(__r->_M_data, __old_len, __new_data);
uninitialized_copy_n(__iter, __len, __new_data + __old_len);
_S_cond_store_eos(__new_data[__old_len + __len]);
@@ -463,22 +463,22 @@ template <class _CharT, class _Alloc>
typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
{
- _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
+ _RopeConcatenation* __result = _S_new_RopeConcatenation(__left, __right,
__left->get_allocator());
size_t __depth = __result->_M_depth;
-
+
if (__depth > 20 && (__result->_M_size < 1000 ||
- __depth > _RopeRep::_S_max_rope_depth))
+ __depth > _RopeRep::_S_max_rope_depth))
{
_RopeRep* __balanced;
-
- try
+
+ try
{
__balanced = _S_balance(__result);
__result->_M_unref_nonnil();
}
catch(...)
- {
+ {
_C_deallocate(__result,1);
__throw_exception_again;
}
@@ -487,8 +487,8 @@ rope<_CharT,_Alloc>::_S_tree_concat (_RopeRep* __left, _RopeRep* __right)
// still owns its children. Thus unref is
// inappropriate.
return __balanced;
- }
- else
+ }
+ else
return __result;
}
@@ -505,18 +505,18 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
if (0 == __r)
return __STL_ROPE_FROM_UNOWNED_CHAR_PTR(__s, __slen,
__r->get_allocator());
- if (_RopeRep::_S_leaf == __r->_M_tag &&
+ if (_RopeRep::_S_leaf == __r->_M_tag &&
__r->_M_size + __slen <= _S_copy_max) {
__result = _S_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
}
if (_RopeRep::_S_concat == __r->_M_tag
&& _RopeRep::_S_leaf == ((_RopeConcatenation*)__r)->_M_right->_M_tag) {
- _RopeLeaf* __right =
+ _RopeLeaf* __right =
(_RopeLeaf* )(((_RopeConcatenation* )__r)->_M_right);
if (__right->_M_size + __slen <= _S_copy_max) {
_RopeRep* __left = ((_RopeConcatenation*)__r)->_M_left;
- _RopeRep* __nright =
+ _RopeRep* __nright =
_S_leaf_concat_char_iter((_RopeLeaf*)__right, __s, __slen);
__left->_M_ref_nonnil();
try {
@@ -524,7 +524,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
}
catch(...)
{
- _S_unref(__left);
+ _S_unref(__left);
_S_unref(__nright);
__throw_exception_again;
}
@@ -539,7 +539,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
}
catch(...)
{
- _S_unref(__r);
+ _S_unref(__r);
_S_unref(__nright);
__throw_exception_again;
}
@@ -548,7 +548,7 @@ rope<_CharT,_Alloc>::_RopeRep* rope<_CharT,_Alloc>::_S_concat_char_iter
#ifndef __GC
template <class _CharT, class _Alloc>
-typename rope<_CharT,_Alloc>::_RopeRep*
+typename rope<_CharT,_Alloc>::_RopeRep*
rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
_RopeRep* __r, const _CharT* __s, size_t __slen)
{
@@ -563,7 +563,7 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
__r->_M_ref_count = 2; // One more than before
return __r;
}
- if (__orig_size + __slen <= _S_copy_max &&
+ if (__orig_size + __slen <= _S_copy_max &&
_RopeRep::_S_leaf == __r->_M_tag) {
__result = _S_destr_leaf_concat_char_iter((_RopeLeaf*)__r, __s, __slen);
return __result;
@@ -572,11 +572,11 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
_RopeLeaf* __right = (_RopeLeaf*)(((_RopeConcatenation*)__r)->_M_right);
if (_RopeRep::_S_leaf == __right->_M_tag
&& __right->_M_size + __slen <= _S_copy_max) {
- _RopeRep* __new_right =
+ _RopeRep* __new_right =
_S_destr_leaf_concat_char_iter(__right, __s, __slen);
- if (__right == __new_right)
+ if (__right == __new_right)
__new_right->_M_ref_count = 1;
- else
+ else
__right->_M_unref_nonnil();
__r->_M_ref_count = 2; // One more than before.
((_RopeConcatenation*)__r)->_M_right = __new_right;
@@ -596,7 +596,7 @@ rope<_CharT,_Alloc>::_S_destr_concat_char_iter(
}
catch(...)
{
- _S_unref(__r);
+ _S_unref(__r);
_S_unref(__right);
__throw_exception_again;
}
@@ -627,7 +627,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
&& _RopeRep::_S_leaf ==
((_RopeConcatenation*)__left)->_M_right->_M_tag) {
_RopeLeaf* __leftright =
- (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
+ (_RopeLeaf*)(((_RopeConcatenation*)__left)->_M_right);
if (__leftright->_M_size + __right->_M_size <= _S_copy_max) {
_RopeRep* __leftleft = ((_RopeConcatenation*)__left)->_M_left;
_RopeRep* __rest = _S_leaf_concat_char_iter(__leftright,
@@ -639,7 +639,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
}
catch(...)
{
- _S_unref(__leftleft);
+ _S_unref(__leftleft);
_S_unref(__rest);
__throw_exception_again;
}
@@ -653,7 +653,7 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
}
catch(...)
{
- _S_unref(__left);
+ _S_unref(__left);
_S_unref(__right);
__throw_exception_again;
}
@@ -661,14 +661,14 @@ rope<_CharT,_Alloc>::_S_concat(_RopeRep* __left, _RopeRep* __right)
template <class _CharT, class _Alloc>
typename rope<_CharT,_Alloc>::_RopeRep*
-rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
+rope<_CharT,_Alloc>::_S_substring(_RopeRep* __base,
size_t __start, size_t __endp1)
{
if (0 == __base) return 0;
size_t __len = __base->_M_size;
size_t __adj_endp1;
const size_t __lazy_threshold = 128;
-
+
if (__endp1 >= __len) {
if (0 == __start) {
__base->_M_ref_nonnil();
@@ -788,14 +788,14 @@ class _Rope_flatten_char_consumer : public _Rope_char_consumer<_CharT> {
return true;
}
};
-
+
template<class _CharT>
class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
private:
_CharT _M_pattern;
public:
size_t _M_count; // Number of nonmatching characters
- _Rope_find_char_char_consumer(_CharT __p)
+ _Rope_find_char_char_consumer(_CharT __p)
: _M_pattern(__p), _M_count(0) {}
~_Rope_find_char_char_consumer() {}
bool operator() (const _CharT* __leaf, size_t __n) {
@@ -808,7 +808,7 @@ class _Rope_find_char_char_consumer : public _Rope_char_consumer<_CharT> {
_M_count += __n; return true;
}
};
-
+
template<class _CharT, class _Traits>
// Here _CharT is both the stream and rope character type.
class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
@@ -816,14 +816,14 @@ class _Rope_insert_char_consumer : public _Rope_char_consumer<_CharT> {
typedef basic_ostream<_CharT,_Traits> _Insert_ostream;
_Insert_ostream& _M_o;
public:
- _Rope_insert_char_consumer(_Insert_ostream& __writer)
+ _Rope_insert_char_consumer(_Insert_ostream& __writer)
: _M_o(__writer) {};
~_Rope_insert_char_consumer() { };
// Caller is presumed to own the ostream
bool operator() (const _CharT* __leaf, size_t __n);
// Returns true to continue traversal.
};
-
+
template<class _CharT, class _Traits>
bool _Rope_insert_char_consumer<_CharT, _Traits>::operator()
(const _CharT* __leaf, size_t __n)
@@ -901,7 +901,7 @@ bool rope<_CharT, _Alloc>::_S_apply_to_pieces(
for (__i = 0; __i < __n; __i++) __o.put(__f);
}
-
+
template <class _CharT> inline bool _Rope_is_simple(_CharT*) { return false; }
inline bool _Rope_is_simple(char*) { return true; }
@@ -917,7 +917,7 @@ basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
size_t __rope_len = __r.size();
_Rope_insert_char_consumer<_CharT, _Traits> __c(__o);
bool __is_simple = _Rope_is_simple((_CharT*)0);
-
+
if (__rope_len < __w) {
__pad_len = __w - __rope_len;
} else {
@@ -937,7 +937,7 @@ basic_ostream<_CharT, _Traits>& operator<< (basic_ostream<_CharT, _Traits>& __o,
}
catch(...)
{
- if (!__is_simple)
+ if (!__is_simple)
__o.width(__w);
__throw_exception_again;
}
@@ -1058,8 +1058,8 @@ rope<_CharT,_Alloc>::_S_dump(_RopeRep* __r, int __indent)
bool __too_big = __r->_M_size > __prefix->_M_size;
_S_flatten(__prefix, __buffer);
- __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
- printf("%s%s\n",
+ __buffer[__prefix->_M_size] = _S_eos((_CharT*)0);
+ printf("%s%s\n",
(char*)__buffer, __too_big? "...\n" : "\n");
} else {
printf("\n");
@@ -1097,11 +1097,11 @@ rope<_CharT,_Alloc>::_S_balance(_RopeRep* __r)
// __forest[__i]._M_depth = __i
// References from forest are included in refcount.
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
__forest[__i] = 0;
try {
_S_add_to_forest(__r, __forest);
- for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
+ for (__i = 0; __i <= _RopeRep::_S_max_rope_depth; ++__i)
if (0 != __forest[__i]) {
# ifndef __GC
_Self_destruct_ptr __old(__result);
@@ -1148,9 +1148,9 @@ template <class _CharT, class _Alloc>
void
rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
{
- _RopeRep* __insertee; // included in refcount
- _RopeRep* __too_tiny = 0; // included in refcount
- int __i; // forest[0..__i-1] is empty
+ _RopeRep* __insertee; // included in refcount
+ _RopeRep* __too_tiny = 0; // included in refcount
+ int __i; // forest[0..__i-1] is empty
size_t __s = __r->_M_size;
for (__i = 0; __s >= _S_min_len[__i+1]/* not this bucket */; ++__i) {
@@ -1180,7 +1180,7 @@ rope<_CharT,_Alloc>::_S_add_leaf_to_forest(_RopeRep* __r, _RopeRep** __forest)
__forest[__i]->_M_unref_nonnil();
__forest[__i] = 0;
}
- if (__i == _RopeRep::_S_max_rope_depth ||
+ if (__i == _RopeRep::_S_max_rope_depth ||
__insertee->_M_size < _S_min_len[__i+1]) {
__forest[__i] = __insertee;
// refcount is OK since __insertee is now dead.
@@ -1195,7 +1195,7 @@ rope<_CharT,_Alloc>::_S_fetch(_RopeRep* __r, size_type __i)
{
__GC_CONST _CharT* __cstr = __r->_M_c_string;
- if (0 != __cstr) return __cstr[__i];
+ if (0 != __cstr) return __cstr[__i];
for(;;) {
switch(__r->_M_tag) {
case _RopeRep::_S_concat:
@@ -1285,7 +1285,7 @@ rope<_CharT,_Alloc>::_S_fetch_ptr(_RopeRep* __r, size_type __i)
// flat strings.
template <class _CharT, class _Alloc>
int
-rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
+rope<_CharT,_Alloc>::_S_compare (const _RopeRep* __left,
const _RopeRep* __right)
{
size_t __left_len;
@@ -1387,7 +1387,7 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
if (0 == __n)
return;
-
+
__exponent = __n / __exponentiate_threshold;
__rest = __n % __exponentiate_threshold;
if (0 == __rest) {
@@ -1419,12 +1419,12 @@ rope<_CharT, _Alloc>::rope(size_t __n, _CharT __c,
}
catch(...)
{
- _RopeRep::__STL_FREE_STRING(__base_buffer,
+ _RopeRep::__STL_FREE_STRING(__base_buffer,
__exponentiate_threshold, __a);
__throw_exception_again;
}
__base_rope._M_tree_ptr = __base_leaf;
- if (1 == __exponent) {
+ if (1 == __exponent) {
__result = __base_rope;
} else {
__result = power(__base_rope, __exponent,
@@ -1494,14 +1494,14 @@ _Rope_rotate(_Rope_iterator __first,
{
typedef typename _Rope_iterator::value_type _CharT;
typedef typename _Rope_iterator::_allocator_type _Alloc;
-
+
rope<_CharT,_Alloc>& __r(__first.container());
rope<_CharT,_Alloc> __prefix = __r.substr(0, __first.index());
- rope<_CharT,_Alloc> __suffix =
+ rope<_CharT,_Alloc> __suffix =
__r.substr(__last.index(), __r.size() - __last.index());
- rope<_CharT,_Alloc> __part1 =
+ rope<_CharT,_Alloc> __part1 =
__r.substr(__middle.index(), __last.index() - __middle.index());
- rope<_CharT,_Alloc> __part2 =
+ rope<_CharT,_Alloc> __part2 =
__r.substr(__first.index(), __middle.index() - __first.index());
__r = __prefix;
__r += __part1;
diff --git a/libstdc++-v3/include/ext/slist b/libstdc++-v3/include/ext/slist
index 9bcfb716772..4b585203018 100644
--- a/libstdc++-v3/include/ext/slist
+++ b/libstdc++-v3/include/ext/slist
@@ -57,10 +57,9 @@
#include <bits/concept_check.h>
namespace __gnu_cxx
-{
+{
using std::size_t;
using std::ptrdiff_t;
-using std::_Alloc_traits;
using std::_Construct;
using std::_Destroy;
using std::allocator;
@@ -79,7 +78,7 @@ __slist_make_link(_Slist_node_base* __prev_node,
return __new_node;
}
-inline _Slist_node_base*
+inline _Slist_node_base*
__slist_previous(_Slist_node_base* __head,
const _Slist_node_base* __node)
{
@@ -88,7 +87,7 @@ __slist_previous(_Slist_node_base* __head,
return __head;
}
-inline const _Slist_node_base*
+inline const _Slist_node_base*
__slist_previous(const _Slist_node_base* __head,
const _Slist_node_base* __node)
{
@@ -201,73 +200,27 @@ struct _Slist_iterator : public _Slist_iterator_base
}
};
-
-// Base class that encapsulates details of allocators. Three cases:
-// an ordinary standard-conforming allocator, a standard-conforming
-// allocator with no non-static data, and an SGI-style allocator.
-// This complexity is necessary only because we're worrying about backward
-// compatibility and because we want to avoid wasting storage on an
-// allocator instance if it isn't necessary.
-
-// Base for general standard-conforming allocators.
-template <class _Tp, class _Allocator, bool _IsStatic>
-class _Slist_alloc_base {
-public:
- typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return _M_node_allocator; }
-
- _Slist_alloc_base(const allocator_type& __a) : _M_node_allocator(__a) {}
-
-protected:
- _Slist_node<_Tp>* _M_get_node()
- { return _M_node_allocator.allocate(1); }
- void _M_put_node(_Slist_node<_Tp>* __p)
- { _M_node_allocator.deallocate(__p, 1); }
-
-protected:
- typename _Alloc_traits<_Slist_node<_Tp>,_Allocator>::allocator_type
- _M_node_allocator;
- _Slist_node_base _M_head;
-};
-
-// Specialization for instanceless allocators.
-template <class _Tp, class _Allocator>
-class _Slist_alloc_base<_Tp,_Allocator, true> {
-public:
- typedef typename _Alloc_traits<_Tp,_Allocator>::allocator_type
- allocator_type;
- allocator_type get_allocator() const { return allocator_type(); }
-
- _Slist_alloc_base(const allocator_type&) {}
-
-protected:
- typedef typename _Alloc_traits<_Slist_node<_Tp>, _Allocator>::_Alloc_type
- _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); }
-
-protected:
- _Slist_node_base _M_head;
-};
-
-
template <class _Tp, class _Alloc>
struct _Slist_base
- : public _Slist_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
+ : public _Alloc::template rebind<_Slist_node<_Tp> >::other
{
- typedef _Slist_alloc_base<_Tp, _Alloc,
- _Alloc_traits<_Tp, _Alloc>::_S_instanceless>
- _Base;
- typedef typename _Base::allocator_type allocator_type;
+ typedef typename _Alloc::template rebind<_Slist_node<_Tp> >::other _Node_alloc;
+ typedef _Alloc allocator_type;
+ allocator_type get_allocator() const {
+ return *static_cast<const _Node_alloc*>(this);
+ }
_Slist_base(const allocator_type& __a)
- : _Base(__a) { this->_M_head._M_next = 0; }
+ : _Node_alloc(__a) { this->_M_head._M_next = 0; }
~_Slist_base() { _M_erase_after(&this->_M_head, 0); }
protected:
+ _Slist_node_base _M_head;
+
+ _Slist_node<_Tp>* _M_get_node() { return _Node_alloc::allocate(1); }
+ void _M_put_node(_Slist_node<_Tp>* __p) { _Node_alloc::deallocate(__p, 1); }
+protected:
_Slist_node_base* _M_erase_after(_Slist_node_base* __pos)
{
_Slist_node<_Tp>* __next = (_Slist_node<_Tp>*) (__pos->_M_next);
@@ -280,7 +233,7 @@ protected:
_Slist_node_base* _M_erase_after(_Slist_node_base*, _Slist_node_base*);
};
-template <class _Tp, class _Alloc>
+template <class _Tp, class _Alloc>
_Slist_node_base*
_Slist_base<_Tp,_Alloc>::_M_erase_after(_Slist_node_base* __before_first,
_Slist_node_base* __last_node) {
@@ -341,7 +294,7 @@ private:
}
return __node;
}
-
+
_Node* _M_create_node() {
_Node* __node = this->_M_get_node();
try {
@@ -408,7 +361,7 @@ public:
public:
iterator begin() { return iterator((_Node*)this->_M_head._M_next); }
- const_iterator begin() const
+ const_iterator begin() const
{ return const_iterator((_Node*)this->_M_head._M_next);}
iterator end() { return iterator(0); }
@@ -417,8 +370,8 @@ public:
// Experimental new feature: before_begin() returns a
// non-dereferenceable iterator that, when incremented, yields
// begin(). This iterator may be used as the argument to
- // insert_after, erase_after, etc. Note that even for an empty
- // slist, before_begin() is not the same iterator as end(). It
+ // insert_after, erase_after, etc. Note that even for an empty
+ // slist, before_begin() is not the same iterator as end(). It
// is always necessary to increment before_begin() at least once to
// obtain end().
iterator before_begin() { return iterator((_Node*) &this->_M_head); }
@@ -426,7 +379,7 @@ public:
{ return const_iterator((_Node*) &this->_M_head); }
size_type size() const { return __slist_size(this->_M_head._M_next); }
-
+
size_type max_size() const { return size_type(-1); }
bool empty() const { return this->_M_head._M_next == 0; }
@@ -437,7 +390,7 @@ public:
public:
reference front() { return ((_Node*) this->_M_head._M_next)->_M_data; }
- const_reference front() const
+ const_reference front() const
{ return ((_Node*) this->_M_head._M_next)->_M_data; }
void push_front(const value_type& __x) {
__slist_make_link(&this->_M_head, _M_create_node(__x));
@@ -475,7 +428,7 @@ private:
// Check whether it's an integral type. If so, it's not an iterator.
template <class _InIterator>
- void _M_insert_after_range(_Node_base* __pos,
+ void _M_insert_after_range(_Node_base* __pos,
_InIterator __first, _InIterator __last) {
typedef typename _Is_integer<_InIterator>::_Integral _Integral;
_M_insert_after_range(__pos, __first, __last, _Integral());
@@ -533,13 +486,13 @@ public:
void insert(iterator __pos, size_type __n, const value_type& __x) {
_M_insert_after_fill(__slist_previous(&this->_M_head, __pos._M_node),
__n, __x);
- }
-
+ }
+
// We don't need any dispatching tricks here, because _M_insert_after_range
// already does them.
template <class _InIterator>
void insert(iterator __pos, _InIterator __first, _InIterator __last) {
- _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
+ _M_insert_after_range(__slist_previous(&this->_M_head, __pos._M_node),
__first, __last);
}
@@ -548,12 +501,12 @@ public:
return iterator((_Node*) this->_M_erase_after(__pos._M_node));
}
iterator erase_after(iterator __before_first, iterator __last) {
- return iterator((_Node*) this->_M_erase_after(__before_first._M_node,
+ return iterator((_Node*) this->_M_erase_after(__before_first._M_node,
__last._M_node));
- }
+ }
iterator erase(iterator __pos) {
- return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head,
+ return (_Node*) this->_M_erase_after(__slist_previous(&this->_M_head,
__pos._M_node));
}
iterator erase(iterator __first, iterator __last) {
@@ -568,11 +521,11 @@ public:
public:
// Moves the range [__before_first + 1, __before_last + 1) to *this,
// inserting it immediately after __pos. This is constant time.
- void splice_after(iterator __pos,
+ void splice_after(iterator __pos,
iterator __before_first, iterator __before_last)
{
- if (__before_first != __before_last)
- __slist_splice_after(__pos._M_node, __before_first._M_node,
+ if (__before_first != __before_last)
+ __slist_splice_after(__pos._M_node, __before_first._M_node,
__before_last._M_node);
}
@@ -618,27 +571,27 @@ public:
}
public:
- void reverse() {
+ void reverse() {
if (this->_M_head._M_next)
this->_M_head._M_next = __slist_reverse(this->_M_head._M_next);
}
- void remove(const _Tp& __val);
- void unique();
+ void remove(const _Tp& __val);
+ void unique();
void merge(slist& __x);
- void sort();
+ void sort();
- template <class _Predicate>
+ template <class _Predicate>
void remove_if(_Predicate __pred);
- template <class _BinaryPredicate>
- void unique(_BinaryPredicate __pred);
+ template <class _BinaryPredicate>
+ void unique(_BinaryPredicate __pred);
- template <class _StrictWeakOrdering>
+ template <class _StrictWeakOrdering>
void merge(slist&, _StrictWeakOrdering);
- template <class _StrictWeakOrdering>
- void sort(_StrictWeakOrdering __comp);
+ template <class _StrictWeakOrdering>
+ void sort(_StrictWeakOrdering __comp);
};
template <class _Tp, class _Alloc>
@@ -657,7 +610,7 @@ slist<_Tp,_Alloc>& slist<_Tp,_Alloc>::operator=(const slist<_Tp,_Alloc>& __x)
if (__n2 == 0)
this->_M_erase_after(__p1, 0);
else
- _M_insert_after_range(__p1, const_iterator((_Node*)__n2),
+ _M_insert_after_range(__p1, const_iterator((_Node*)__n2),
const_iterator(0));
}
return *this;
@@ -698,7 +651,7 @@ slist<_Tp, _Alloc>::_M_assign_dispatch(_InputIterator __first, _InputIterator __
}
template <class _Tp, class _Alloc>
-inline bool
+inline bool
operator==(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
{
typedef typename slist<_Tp,_Alloc>::const_iterator const_iterator;
@@ -719,30 +672,30 @@ template <class _Tp, class _Alloc>
inline bool
operator<(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2)
{
- return std::lexicographical_compare(_SL1.begin(), _SL1.end(),
+ return std::lexicographical_compare(_SL1.begin(), _SL1.end(),
_SL2.begin(), _SL2.end());
}
template <class _Tp, class _Alloc>
-inline bool
+inline bool
operator!=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL1 == _SL2);
}
template <class _Tp, class _Alloc>
-inline bool
+inline bool
operator>(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return _SL2 < _SL1;
}
template <class _Tp, class _Alloc>
-inline bool
+inline bool
operator<=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL2 < _SL1);
}
template <class _Tp, class _Alloc>
-inline bool
+inline bool
operator>=(const slist<_Tp,_Alloc>& _SL1, const slist<_Tp,_Alloc>& _SL2) {
return !(_SL1 < _SL2);
}
@@ -761,7 +714,7 @@ void slist<_Tp,_Alloc>::resize(size_type __len, const _Tp& __x)
--__len;
__cur = __cur->_M_next;
}
- if (__cur->_M_next)
+ if (__cur->_M_next)
this->_M_erase_after(__cur, 0);
else
_M_insert_after_fill(__cur, __len, __x);
@@ -779,13 +732,13 @@ void slist<_Tp,_Alloc>::remove(const _Tp& __val)
}
}
-template <class _Tp, class _Alloc>
+template <class _Tp, class _Alloc>
void slist<_Tp,_Alloc>::unique()
{
_Node_base* __cur = this->_M_head._M_next;
if (__cur) {
while (__cur->_M_next) {
- if (((_Node*)__cur)->_M_data ==
+ if (((_Node*)__cur)->_M_data ==
((_Node*)(__cur->_M_next))->_M_data)
this->_M_erase_after(__cur);
else
@@ -799,8 +752,8 @@ void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x)
{
_Node_base* __n1 = &this->_M_head;
while (__n1->_M_next && __x._M_head._M_next) {
- if (((_Node*) __x._M_head._M_next)->_M_data <
- ((_Node*) __n1->_M_next)->_M_data)
+ if (((_Node*) __x._M_head._M_next)->_M_data <
+ ((_Node*) __n1->_M_next)->_M_data)
__slist_splice_after(__n1, &__x._M_head, __x._M_head._M_next);
__n1 = __n1->_M_next;
}
@@ -837,7 +790,7 @@ void slist<_Tp,_Alloc>::sort()
}
}
-template <class _Tp, class _Alloc>
+template <class _Tp, class _Alloc>
template <class _Predicate>
void slist<_Tp,_Alloc>::remove_if(_Predicate __pred)
{
@@ -850,13 +803,13 @@ void slist<_Tp,_Alloc>::remove_if(_Predicate __pred)
}
}
-template <class _Tp, class _Alloc> template <class _BinaryPredicate>
+template <class _Tp, class _Alloc> template <class _BinaryPredicate>
void slist<_Tp,_Alloc>::unique(_BinaryPredicate __pred)
{
_Node* __cur = (_Node*) this->_M_head._M_next;
if (__cur) {
while (__cur->_M_next) {
- if (__pred(((_Node*)__cur)->_M_data,
+ if (__pred(((_Node*)__cur)->_M_data,
((_Node*)(__cur->_M_next))->_M_data))
this->_M_erase_after(__cur);
else
@@ -882,7 +835,7 @@ void slist<_Tp,_Alloc>::merge(slist<_Tp,_Alloc>& __x,
}
}
-template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
+template <class _Tp, class _Alloc> template <class _StrictWeakOrdering>
void slist<_Tp,_Alloc>::sort(_StrictWeakOrdering __comp)
{
if (this->_M_head._M_next && this->_M_head._M_next->_M_next) {
@@ -930,7 +883,7 @@ public:
typedef void pointer;
typedef void reference;
- insert_iterator(_Container& __x, typename _Container::iterator __i)
+ insert_iterator(_Container& __x, typename _Container::iterator __i)
: container(&__x) {
if (__i == __x.begin())
iter = __x.before_begin();
@@ -939,7 +892,7 @@ public:
}
insert_iterator<_Container>&
- operator=(const typename _Container::value_type& __value) {
+ operator=(const typename _Container::value_type& __value) {
iter = container->insert_after(iter, __value);
return *this;
}
@@ -950,4 +903,4 @@ public:
} // namespace std
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/stdio_filebuf.h b/libstdc++-v3/include/ext/stdio_filebuf.h
index 8750f5801e3..196492969b5 100644
--- a/libstdc++-v3/include/ext/stdio_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_filebuf.h
@@ -54,42 +54,36 @@ namespace __gnu_cxx
{
public:
// Types:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef typename traits_type::int_type int_type;
- typedef typename traits_type::pos_type pos_type;
- typedef typename traits_type::off_type off_type;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
typedef std::size_t size_t;
-
+
public:
/**
* @param fd An open file descriptor.
* @param mode Same meaning as in a standard filebuf.
- * @param del Whether to close the file on destruction.
- * @param size Optimal or preferred size of internal buffer, in bytes.
- * Note that it includes a position for the overflow char,
- * therefore, can't be smaller than 2.
+ * @param size Optimal or preferred size of internal buffer, in chars.
*
* This constructor associates a file stream buffer with an open
- * POSIX file descriptor. Iff @a del is true, then the associated
- * file will be closed when the stdio_filebuf is closed/destroyed.
+ * POSIX file descriptor.
*/
- stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del,
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>(BUFSIZ));
/**
* @param f An open @c FILE*.
* @param mode Same meaning as in a standard filebuf.
- * @param size Optimal or preferred size of internal buffer, in bytes.
- * Defaults to system's @c BUFSIZ. Note that it includes
- * a position for the overflow char, therefore, can't be
- * smaller than 2.
+ * @param size Optimal or preferred size of internal buffer, in chars.
+ * Defaults to system's @c BUFSIZ.
*
* This constructor associates a file stream buffer with an open
* C @c FILE*. The @c FILE* will not be automatically closed when the
* stdio_filebuf is closed/destroyed.
*/
- stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
size_t __size = static_cast<size_t>(BUFSIZ));
/**
@@ -118,10 +112,9 @@ namespace __gnu_cxx
template<typename _CharT, typename _Traits>
stdio_filebuf<_CharT, _Traits>::
- stdio_filebuf(int __fd, std::ios_base::openmode __mode, bool __del,
- size_t __size)
+ stdio_filebuf(int __fd, std::ios_base::openmode __mode, size_t __size)
{
- this->_M_file.sys_open(__fd, __mode, __del);
+ this->_M_file.sys_open(__fd, __mode);
if (this->is_open())
{
this->_M_mode = __mode;
@@ -135,7 +128,7 @@ namespace __gnu_cxx
template<typename _CharT, typename _Traits>
stdio_filebuf<_CharT, _Traits>::
- stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
+ stdio_filebuf(std::__c_file* __f, std::ios_base::openmode __mode,
size_t __size)
{
this->_M_file.sys_open(__f, __mode);
@@ -151,4 +144,4 @@ namespace __gnu_cxx
}
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/ext/stdio_sync_filebuf.h b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
index 4727c6b2866..2076ca5e307 100644
--- a/libstdc++-v3/include/ext/stdio_sync_filebuf.h
+++ b/libstdc++-v3/include/ext/stdio_sync_filebuf.h
@@ -61,22 +61,22 @@ namespace __gnu_cxx
{
public:
// Types:
- typedef _CharT char_type;
- typedef _Traits traits_type;
- typedef typename traits_type::int_type int_type;
- typedef typename traits_type::pos_type pos_type;
- typedef typename traits_type::off_type off_type;
+ typedef _CharT char_type;
+ typedef _Traits traits_type;
+ typedef typename traits_type::int_type int_type;
+ typedef typename traits_type::pos_type pos_type;
+ typedef typename traits_type::off_type off_type;
private:
// Underlying stdio FILE
std::__c_file* const _M_file;
-
+
// Last character gotten. This is used when pbackfail is
// called from basic_streambuf::sungetc()
int_type _M_unget_buf;
public:
- explicit
+ explicit
stdio_sync_filebuf(std::__c_file* __f)
: _M_file(__f), _M_unget_buf(traits_type::eof())
{ }
@@ -131,10 +131,10 @@ namespace __gnu_cxx
virtual std::streamsize
xsgetn(char_type* __s, std::streamsize __n);
-
+
virtual std::streamsize
showmanyc()
- {
+ {
#if defined(_GLIBCXX_HAVE_S_ISREG) || defined(_GLIBCXX_HAVE_S_IFREG)
// Regular files.
struct stat __buffer;
@@ -142,7 +142,7 @@ namespace __gnu_cxx
if (!__ret && _GLIBCXX_ISREG(__buffer.st_mode))
return __buffer.st_size - ftell(_M_file);
#endif
- return 0;
+ return 0;
}
virtual int_type
@@ -180,9 +180,13 @@ namespace __gnu_cxx
__whence = SEEK_CUR;
else
__whence = SEEK_END;
-
+#ifdef _GLIBCXX_USE_LFS
+ if (!fseeko64(_M_file, __off, __whence))
+ __ret = std::streampos(ftello64(_M_file));
+#else
if (!fseek(_M_file, __off, __whence))
__ret = std::streampos(std::ftell(_M_file));
+#endif
return __ret;
}
@@ -244,7 +248,7 @@ namespace __gnu_cxx
template<>
inline std::streamsize
stdio_sync_filebuf<wchar_t>::xsgetn(wchar_t* __s, std::streamsize __n)
- {
+ {
std::streamsize __ret = 0;
const int_type __eof = traits_type::eof();
while (__n--)
@@ -262,10 +266,10 @@ namespace __gnu_cxx
_M_unget_buf = traits_type::eof();
return __ret;
}
-
+
template<>
inline std::streamsize
- stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
+ stdio_sync_filebuf<wchar_t>::xsputn(const wchar_t* __s,
std::streamsize __n)
{
std::streamsize __ret = 0;
@@ -288,4 +292,4 @@ namespace __gnu_cxx
#endif
} // namespace __gnu_cxx
-#endif
+#endif
diff --git a/libstdc++-v3/include/std/std_algorithm.h b/libstdc++-v3/include/std/std_algorithm.h
index 1d81201bc7d..40e6246ce7f 100644
--- a/libstdc++-v3/include/std/std_algorithm.h
+++ b/libstdc++-v3/include/std/std_algorithm.h
@@ -69,7 +69,3 @@
#include <bits/stl_algo.h>
#endif /* _GLIBCXX_ALGORITHM */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/libstdc++-v3/include/std/std_bitset.h b/libstdc++-v3/include/std/std_bitset.h
index ab4ca236bd7..e6498973e83 100644
--- a/libstdc++-v3/include/std/std_bitset.h
+++ b/libstdc++-v3/include/std/std_bitset.h
@@ -50,21 +50,21 @@
#pragma GCC system_header
-#include <cstddef> // for size_t
-#include <cstring> // for memset
-#include <limits> // for numeric_limits
+#include <cstddef> // For size_t
+#include <cstring> // For memset
+#include <limits> // For numeric_limits
#include <string>
-#include <bits/functexcept.h> // for invalid_argument, out_of_range,
+#include <bits/functexcept.h> // For invalid_argument, out_of_range,
// overflow_error
-#include <ostream> // for ostream (operator<<)
-#include <istream> // for istream (operator>>)
+#include <ostream> // For ostream (operator<<)
+#include <istream> // For istream (operator>>)
#define _GLIBCXX_BITSET_BITS_PER_WORD numeric_limits<unsigned long>::digits
#define _GLIBCXX_BITSET_WORDS(__n) \
((__n) < 1 ? 0 : ((__n) + _GLIBCXX_BITSET_BITS_PER_WORD - 1)/_GLIBCXX_BITSET_BITS_PER_WORD)
-namespace std
+namespace __gnu_norm
{
/**
* @if maint
@@ -646,7 +646,7 @@ namespace std
~reference() { }
- // for b[i] = __x;
+ // For b[i] = __x;
reference&
operator=(bool __x)
{
@@ -657,7 +657,7 @@ namespace std
return *this;
}
- // for b[i] = b[__j];
+ // For b[i] = b[__j];
reference&
operator=(const reference& __j)
{
@@ -668,16 +668,16 @@ namespace std
return *this;
}
- // flips the bit
+ // Flips the bit
bool
operator~() const
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) == 0; }
- // for __x = b[i];
+ // For __x = b[i];
operator bool() const
{ return (*(_M_wp) & _Base::_S_maskbit(_M_bpos)) != 0; }
- // for b[i].flip();
+ // For b[i].flip();
reference&
flip()
{
@@ -1155,46 +1155,53 @@ namespace std
basic_string<_CharT, _Traits> __tmp;
__tmp.reserve(_Nb);
- // Skip whitespace
+ ios_base::iostate __state = ios_base::goodbit;
typename basic_istream<_CharT, _Traits>::sentry __sentry(__is);
if (__sentry)
{
- ios_base::iostate __state = ios_base::goodbit;
- basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
- for (size_t __i = 0; __i < _Nb; ++__i)
+ try
{
- static typename _Traits::int_type __eof = _Traits::eof();
-
- typename _Traits::int_type __c1 = __buf->sbumpc();
- if (_Traits::eq_int_type(__c1, __eof))
- {
- __state |= ios_base::eofbit;
- break;
- }
- else
+ basic_streambuf<_CharT, _Traits>* __buf = __is.rdbuf();
+ // _GLIBCXX_RESOLVE_LIB_DEFECTS
+ // 303. Bitset input operator underspecified
+ const char_type __zero = __is.widen('0');
+ const char_type __one = __is.widen('1');
+ for (size_t __i = 0; __i < _Nb; ++__i)
{
- char_type __c2 = _Traits::to_char_type(__c1);
- char_type __c = __is.narrow(__c2, '*');
-
- if (__c == '0' || __c == '1')
- __tmp.push_back(__c);
- else if (_Traits::eq_int_type(__buf->sputbackc(__c2), __eof))
+ static typename _Traits::int_type __eof = _Traits::eof();
+
+ typename _Traits::int_type __c1 = __buf->sbumpc();
+ if (_Traits::eq_int_type(__c1, __eof))
{
- __state |= ios_base::failbit;
+ __state |= ios_base::eofbit;
break;
}
+ else
+ {
+ char_type __c2 = _Traits::to_char_type(__c1);
+ if (__c2 == __zero)
+ __tmp.push_back('0');
+ else if (__c2 == __one)
+ __tmp.push_back('1');
+ else if (_Traits::eq_int_type(__buf->sputbackc(__c2),
+ __eof))
+ {
+ __state |= ios_base::failbit;
+ break;
+ }
+ }
}
}
-
- if (__tmp.empty() && !_Nb)
- __state |= ios_base::failbit;
- else
- __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
-
- if (__state != ios_base::goodbit)
- __is.setstate(__state); // may throw an exception
+ catch(...)
+ { __is._M_setstate(ios_base::badbit); }
}
+ if (__tmp.empty() && _Nb)
+ __state |= ios_base::failbit;
+ else
+ __x._M_copy_from_string(__tmp, static_cast<size_t>(0), _Nb);
+ if (__state)
+ __is.setstate(__state);
return __is;
}
@@ -1207,9 +1214,13 @@ namespace std
return __os << __tmp;
}
//@}
-} // namespace std
+} // namespace __gnu_norm
#undef _GLIBCXX_BITSET_WORDS
#undef _GLIBCXX_BITSET_BITS_PER_WORD
+#ifdef _GLIBCXX_DEBUG
+# include <debug/bitset>
+#endif
+
#endif /* _GLIBCXX_BITSET */
diff --git a/libstdc++-v3/include/std/std_deque.h b/libstdc++-v3/include/std/std_deque.h
index 7200220975c..80817f632aa 100644
--- a/libstdc++-v3/include/std/std_deque.h
+++ b/libstdc++-v3/include/std/std_deque.h
@@ -74,4 +74,8 @@
# include <bits/deque.tcc>
#endif
+#ifdef _GLIBCXX_DEBUG
+# include <debug/deque>
+#endif
+
#endif /* _GLIBCXX_DEQUE */
diff --git a/libstdc++-v3/include/std/std_fstream.h b/libstdc++-v3/include/std/std_fstream.h
index dd19cccfcfd..040f5798b11 100644
--- a/libstdc++-v3/include/std/std_fstream.h
+++ b/libstdc++-v3/include/std/std_fstream.h
@@ -60,6 +60,11 @@ namespace std
* sequences. Many of its sematics are described in terms of similar
* behavior in the Standard C Library's @c FILE streams.
*/
+ // Requirements on traits_type, specific to this class:
+ // traits_type::pos_type must be fpos<traits_type::state_type>
+ // traits_type::off_type must be streamoff
+ // traits_type::state_type must be Assignable and DefaultConstructable,
+ // and traits_type::state_type() must be the initial state for codecvt.
template<typename _CharT, typename _Traits>
class basic_filebuf : public basic_streambuf<_CharT, _Traits>
{
@@ -111,18 +116,36 @@ namespace std
*/
ios_base::openmode _M_mode;
- // Current and beginning state type for codecvt.
+ // Beginning state type for codecvt.
/**
* @if maint
* @doctodo
* @endif
*/
- __state_type _M_state_cur;
__state_type _M_state_beg;
+ // During output, the state that corresponds to pptr(),
+ // during input, the state that corresponds to egptr() and
+ // _M_ext_next.
+ /**
+ * @if maint
+ * @doctodo
+ * @endif
+ */
+ __state_type _M_state_cur;
+
+ // Not used for output. During input, the state that corresponds
+ // to eback() and _M_ext_buf.
+ /**
+ * @if maint
+ * @doctodo
+ * @endif
+ */
+ __state_type _M_state_last;
+
/**
* @if maint
- * Pointer to the beginning of internally-allocated space.
+ * Pointer to the beginning of internal buffer.
* @endif
*/
char_type* _M_buf;
@@ -156,9 +179,6 @@ namespace std
bool _M_reading;
bool _M_writing;
- // XXX Needed?
- bool _M_last_overflowed;
-
//@{
/**
* @if maint
@@ -386,33 +406,11 @@ namespace std
* @endif
*/
pos_type
- _M_seek(off_type __off, ios_base::seekdir __way);
+ _M_seek(off_type __off, ios_base::seekdir __way, __state_type __state);
// [documentation is inherited]
virtual int
- sync()
- {
- int __ret = 0;
-
- // Make sure that the internal buffer resyncs its idea of
- // the file position with the external file.
- // NB: _M_file.sync() will be called within.
- if (this->pbase() < this->pptr())
- {
- const int_type __tmp = this->overflow();
- if (traits_type::eq_int_type(__tmp, traits_type::eof()))
- __ret = -1;
- else
- {
- _M_set_buffer(-1);
- _M_reading = false;
- _M_writing = false;
- }
- }
-
- _M_last_overflowed = false;
- return __ret;
- }
+ sync();
// [documentation is inherited]
virtual void
@@ -443,13 +441,14 @@ namespace std
virtual streamsize
xsputn(const char_type* __s, streamsize __n);
+ // Flushes output buffer, then writes unshift sequence.
/**
* @if maint
* @doctodo
* @endif
*/
- void
- _M_output_unshift();
+ bool
+ _M_terminate_output();
/**
* @if maint
diff --git a/libstdc++-v3/include/std/std_functional.h b/libstdc++-v3/include/std/std_functional.h
index 0330eda8e14..6819f20b6f0 100644
--- a/libstdc++-v3/include/std/std_functional.h
+++ b/libstdc++-v3/include/std/std_functional.h
@@ -50,13 +50,9 @@
#define _GLIBCXX_FUNCTIONAL 1
#pragma GCC system_header
+
#include <bits/c++config.h>
#include <cstddef>
#include <bits/stl_function.h>
#endif /* _GLIBCXX_FUNCTIONAL */
-
-// Local Variables:
-// mode:C++
-// End:
-
diff --git a/libstdc++-v3/include/std/std_iterator.h b/libstdc++-v3/include/std/std_iterator.h
index 3da3e90a414..6e3840b1e7e 100644
--- a/libstdc++-v3/include/std/std_iterator.h
+++ b/libstdc++-v3/include/std/std_iterator.h
@@ -62,6 +62,7 @@
#define _GLIBCXX_ITERATOR 1
#pragma GCC system_header
+
#include <bits/c++config.h>
#include <cstddef>
#include <bits/stl_iterator_base_types.h>
@@ -73,7 +74,3 @@
#include <bits/streambuf_iterator.h>
#endif /* _GLIBCXX_ITERATOR */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/libstdc++-v3/include/std/std_list.h b/libstdc++-v3/include/std/std_list.h
index f882bf7e5ee..285a29d8131 100644
--- a/libstdc++-v3/include/std/std_list.h
+++ b/libstdc++-v3/include/std/std_list.h
@@ -74,5 +74,9 @@
# include <bits/list.tcc>
#endif
+#ifdef _GLIBCXX_DEBUG
+# include <debug/list>
+#endif
+
#endif /* _GLIBCXX_LIST */
diff --git a/libstdc++-v3/include/std/std_map.h b/libstdc++-v3/include/std/std_map.h
index f4e0ca1aafc..4a88ae22ea3 100644
--- a/libstdc++-v3/include/std/std_map.h
+++ b/libstdc++-v3/include/std/std_map.h
@@ -67,8 +67,8 @@
#include <bits/stl_map.h>
#include <bits/stl_multimap.h>
-#endif /* _GLIBCXX_MAP */
+#ifdef _GLIBCXX_DEBUG
+# include <debug/map>
+#endif
-// Local Variables:
-// mode:C++
-// End:
+#endif /* _GLIBCXX_MAP */
diff --git a/libstdc++-v3/include/std/std_memory.h b/libstdc++-v3/include/std/std_memory.h
index 3b7cefaefb0..eb2923276f7 100644
--- a/libstdc++-v3/include/std/std_memory.h
+++ b/libstdc++-v3/include/std/std_memory.h
@@ -57,6 +57,7 @@
#include <bits/stl_iterator_base_types.h> //for iterator_traits
#include <bits/stl_uninitialized.h>
#include <bits/stl_raw_storage_iter.h>
+#include <debug/debug.h>
namespace std
{
@@ -259,7 +260,11 @@ namespace std
* what happens when you dereference one of those...)
*/
element_type&
- operator*() const throw() { return *_M_ptr; }
+ operator*() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return *_M_ptr;
+ }
/**
* @brief Smart pointer dereferencing.
@@ -268,7 +273,11 @@ namespace std
* automatically cause to be dereferenced.
*/
element_type*
- operator->() const throw() { return _M_ptr; }
+ operator->() const throw()
+ {
+ _GLIBCXX_DEBUG_ASSERT(_M_ptr != 0);
+ return _M_ptr;
+ }
/**
* @brief Bypassing the smart pointer.
diff --git a/libstdc++-v3/include/std/std_numeric.h b/libstdc++-v3/include/std/std_numeric.h
index f46150872e9..88661e9f5a4 100644
--- a/libstdc++-v3/include/std/std_numeric.h
+++ b/libstdc++-v3/include/std/std_numeric.h
@@ -62,6 +62,7 @@
#define _GLIBCXX_NUMERIC 1
#pragma GCC system_header
+
#include <bits/c++config.h>
#include <cstddef>
#include <iterator>
@@ -69,7 +70,3 @@
#include <bits/stl_numeric.h>
#endif /* _GLIBCXX_NUMERIC */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/libstdc++-v3/include/std/std_queue.h b/libstdc++-v3/include/std/std_queue.h
index e2e0b845e45..9a6523bef87 100644
--- a/libstdc++-v3/include/std/std_queue.h
+++ b/libstdc++-v3/include/std/std_queue.h
@@ -62,21 +62,17 @@
#define _GLIBCXX_QUEUE 1
#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/functexcept.h>
#include <bits/stl_algobase.h>
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
-#include <bits/stl_vector.h>
#include <bits/stl_heap.h>
-#include <bits/stl_deque.h>
#include <bits/stl_function.h>
+#include <deque>
+#include <vector>
#include <bits/stl_queue.h>
-#ifndef _GLIBCXX_EXPORT_TEMPLATE
-# include <bits/deque.tcc>
-# include <bits/vector.tcc>
-#endif
-
#endif /* _GLIBCXX_QUEUE */
diff --git a/libstdc++-v3/include/std/std_set.h b/libstdc++-v3/include/std/std_set.h
index 8dbed180ace..7ef8c9fef3b 100644
--- a/libstdc++-v3/include/std/std_set.h
+++ b/libstdc++-v3/include/std/std_set.h
@@ -67,8 +67,8 @@
#include <bits/stl_set.h>
#include <bits/stl_multiset.h>
-#endif /* _GLIBCXX_SET */
+#ifdef _GLIBCXX_DEBUG
+# include <debug/set>
+#endif
-// Local Variables:
-// mode:C++
-// End:
+#endif /* _GLIBCXX_SET */
diff --git a/libstdc++-v3/include/std/std_stack.h b/libstdc++-v3/include/std/std_stack.h
index 80178528516..70f045684e0 100644
--- a/libstdc++-v3/include/std/std_stack.h
+++ b/libstdc++-v3/include/std/std_stack.h
@@ -67,11 +67,7 @@
#include <bits/allocator.h>
#include <bits/stl_construct.h>
#include <bits/stl_uninitialized.h>
-#include <bits/stl_deque.h>
+#include <deque>
#include <bits/stl_stack.h>
-#ifndef _GLIBCXX_EXPORT_TEMPLATE
-# include <bits/deque.tcc>
-#endif
-
#endif /* _GLIBCXX_STACK */
diff --git a/libstdc++-v3/include/std/std_streambuf.h b/libstdc++-v3/include/std/std_streambuf.h
index e8a4992e21d..fe82b3bcda0 100644
--- a/libstdc++-v3/include/std/std_streambuf.h
+++ b/libstdc++-v3/include/std/std_streambuf.h
@@ -56,8 +56,7 @@ namespace std
*/
template<typename _CharT, typename _Traits>
streamsize
- __copy_streambufs(basic_ios<_CharT, _Traits>& _ios,
- basic_streambuf<_CharT, _Traits>* __sbin,
+ __copy_streambufs(basic_streambuf<_CharT, _Traits>* __sbin,
basic_streambuf<_CharT, _Traits>* __sbout);
/**
@@ -153,8 +152,8 @@ namespace std
friend class ostreambuf_iterator<char_type, traits_type>;
friend streamsize
- __copy_streambufs<>(basic_ios<char_type, traits_type>& __ios,
- __streambuf_type* __sbin,__streambuf_type* __sbout);
+ __copy_streambufs<>(__streambuf_type* __sbin,
+ __streambuf_type* __sbout);
protected:
//@{
@@ -200,6 +199,7 @@ namespace std
{
locale __tmp(this->getloc());
this->imbue(__loc);
+ _M_buf_locale = __loc;
return __tmp;
}
@@ -538,15 +538,13 @@ namespace std
* are changed by this call. The standard adds, "Between invocations
* of this function a class derived from streambuf can safely cache
* results of calls to locale functions and to members of facets
- * so obtained." This function simply stores the new locale for use
- * by derived classes.
+ * so obtained."
+ *
+ * @note Base class version does nothing.
*/
virtual void
- imbue(const locale& __loc)
- {
- if (_M_buf_locale != __loc)
- _M_buf_locale = __loc;
- }
+ imbue(const locale&)
+ { }
// [27.5.2.4.2] buffer management and positioning
/**
diff --git a/libstdc++-v3/include/std/std_utility.h b/libstdc++-v3/include/std/std_utility.h
index f5793425b22..fe93090f939 100644
--- a/libstdc++-v3/include/std/std_utility.h
+++ b/libstdc++-v3/include/std/std_utility.h
@@ -62,12 +62,9 @@
#define _GLIBCXX_UTILITY 1
#pragma GCC system_header
+
#include <bits/c++config.h>
#include <bits/stl_relops.h>
#include <bits/stl_pair.h>
#endif /* _GLIBCXX_UTILITY */
-
-// Local Variables:
-// mode:C++
-// End:
diff --git a/libstdc++-v3/include/std/std_valarray.h b/libstdc++-v3/include/std/std_valarray.h
index 09367488c8b..7dac89dadb0 100644
--- a/libstdc++-v3/include/std/std_valarray.h
+++ b/libstdc++-v3/include/std/std_valarray.h
@@ -46,6 +46,7 @@
#include <cstdlib>
#include <numeric>
#include <algorithm>
+#include <debug/debug.h>
namespace std
{
@@ -221,12 +222,18 @@ namespace std
template<typename _Tp>
inline const _Tp&
valarray<_Tp>::operator[](size_t __i) const
- { return _M_data[__i]; }
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
template<typename _Tp>
inline _Tp&
valarray<_Tp>::operator[](size_t __i)
- { return _M_data[__i]; }
+ {
+ __glibcxx_requires_subscript(__i);
+ return _M_data[__i];
+ }
} // std::
@@ -260,7 +267,10 @@ namespace std
inline
valarray<_Tp>::valarray(const _Tp* __restrict__ __p, size_t __n)
: _M_size(__n), _M_data(__valarray_get_storage<_Tp>(__n))
- { std::__valarray_copy_construct(__p, __p + __n, _M_data); }
+ {
+ _GLIBCXX_DEBUG_ASSERT(__p != 0 || __n == 0);
+ std::__valarray_copy_construct(__p, __p + __n, _M_data);
+ }
template<typename _Tp>
inline
@@ -324,6 +334,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const valarray<_Tp>& __v)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size);
std::__valarray_copy(__v._M_data, _M_size, _M_data);
return *this;
}
@@ -340,6 +351,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const slice_array<_Tp>& __sa)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __sa._M_sz);
std::__valarray_copy(__sa._M_array, __sa._M_sz,
__sa._M_stride, _Array<_Tp>(_M_data));
return *this;
@@ -349,6 +361,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const gslice_array<_Tp>& __ga)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ga._M_index.size());
std::__valarray_copy(__ga._M_array, _Array<size_t>(__ga._M_index),
_Array<_Tp>(_M_data), _M_size);
return *this;
@@ -358,6 +371,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const mask_array<_Tp>& __ma)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ma._M_sz);
std::__valarray_copy(__ma._M_array, __ma._M_mask,
_Array<_Tp>(_M_data), _M_size);
return *this;
@@ -367,6 +381,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const indirect_array<_Tp>& __ia)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __ia._M_sz);
std::__valarray_copy(__ia._M_array, __ia._M_index,
_Array<_Tp>(_M_data), _M_size);
return *this;
@@ -376,6 +391,7 @@ namespace std
inline valarray<_Tp>&
valarray<_Tp>::operator=(const _Expr<_Dom, _Tp>& __e)
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __e.size());
std::__valarray_copy(__e, _M_size, _Array<_Tp>(_M_data));
return *this;
}
@@ -460,6 +476,7 @@ namespace std
inline _Tp
valarray<_Tp>::sum() const
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
return std::__valarray_sum(_M_data, _M_data + _M_size);
}
@@ -540,6 +557,7 @@ namespace std
inline _Tp
valarray<_Tp>::min() const
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
return *std::min_element (_M_data, _M_data+_M_size);
}
@@ -547,6 +565,7 @@ namespace std
inline _Tp
valarray<_Tp>::max() const
{
+ _GLIBCXX_DEBUG_ASSERT(_M_size > 0);
return *std::max_element (_M_data, _M_data+_M_size);
}
@@ -596,6 +615,7 @@ namespace std
inline valarray<_Tp>& \
valarray<_Tp>::operator _Op##=(const valarray<_Tp> &__v) \
{ \
+ _GLIBCXX_DEBUG_ASSERT(_M_size == __v._M_size); \
_Array_augmented_##_Name(_Array<_Tp>(_M_data), _M_size, \
_Array<_Tp>(__v._M_data)); \
return *this; \
@@ -643,6 +663,7 @@ _DEFINE_VALARRAY_EXPR_AUGMENTED_ASSIGNMENT(>>, __shift_right)
typename __fun<_Name, _Tp>::result_type> \
operator _Op(const valarray<_Tp>& __v, const valarray<_Tp>& __w) \
{ \
+ _GLIBCXX_DEBUG_ASSERT(__v.size() == __w.size()); \
typedef _BinClos<_Name,_ValArray,_ValArray,_Tp,_Tp> _Closure; \
typedef typename __fun<_Name, _Tp>::result_type _Rt; \
return _Expr<_Closure, _Rt>(_Closure(__v, __w)); \
@@ -690,7 +711,3 @@ _DEFINE_BINARY_OPERATOR(>=, __greater_equal)
} // namespace std
#endif /* _GLIBCXX_VALARRAY */
-
-// Local Variables:
-// mode:c++
-// End:
diff --git a/libstdc++-v3/include/std/std_vector.h b/libstdc++-v3/include/std/std_vector.h
index 02cf1229148..16e50a99ec8 100644
--- a/libstdc++-v3/include/std/std_vector.h
+++ b/libstdc++-v3/include/std/std_vector.h
@@ -75,5 +75,9 @@
# include <bits/vector.tcc>
#endif
+#ifdef _GLIBCXX_DEBUG
+# include <debug/vector>
+#endif
+
#endif /* _GLIBCXX_VECTOR */
diff --git a/libstdc++-v3/libmath/Makefile.in b/libstdc++-v3/libmath/Makefile.in
index f9023ffb051..e5e1d62f986 100644
--- a/libstdc++-v3/libmath/Makefile.in
+++ b/libstdc++-v3/libmath/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -80,8 +80,6 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
-FPOS_H = @FPOS_H@
-FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
@@ -112,7 +110,6 @@ LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
# Only compiling "C" sources in this directory.
LIBTOOL = @LIBTOOL@ --tag CC
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -232,7 +229,7 @@ CCLD = $(CC)
LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
DIST_SOURCES = $(libmath_la_SOURCES)
-DIST_COMMON = Makefile.am Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in Makefile.am
SOURCES = $(libmath_la_SOURCES)
all: all-am
@@ -382,7 +379,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -390,7 +387,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -401,7 +398,7 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
mostlyclean-am
distclean: distclean-am
-
+ -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
@@ -424,7 +421,7 @@ install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
diff --git a/libstdc++-v3/libmath/stubs.c b/libstdc++-v3/libmath/stubs.c
index 1968bffe7f9..797b2017fb0 100644
--- a/libstdc++-v3/libmath/stubs.c
+++ b/libstdc++-v3/libmath/stubs.c
@@ -34,6 +34,57 @@
we use the crude approximation. We'll do better later. */
+#ifndef HAVE_ACOSF
+float
+acosf(float x)
+{
+ return (float) acos(x);
+}
+#endif
+
+#ifndef HAVE_ACOSL
+long double
+acosl(long double x)
+{
+ return acos((double) x);
+}
+#endif
+
+
+#ifndef HAVE_ASINF
+float
+asinf(float x)
+{
+ return (float) asin(x);
+}
+#endif
+
+#ifndef HAVE_ASINL
+long double
+asinl(long double x)
+{
+ return asin((double) x);
+}
+#endif
+
+
+#ifndef HAVE_ATANF
+float
+atanf(float x)
+{
+ return (float) atan(x);
+}
+#endif
+
+#ifndef HAVE_ATANL
+long double
+atanl(long double x)
+{
+ return atan ((double) x);
+}
+#endif
+
+
#ifndef HAVE_ATAN2F
float
atan2f(float x, float y)
@@ -51,6 +102,23 @@ atan2l(long double x, long double y)
#endif
+#ifndef HAVE_CEILF
+float
+ceilf(float x)
+{
+ return (float) ceil(x);
+}
+#endif
+
+#ifndef HAVE_CEILL
+long double
+ceill(long double x)
+{
+ return ceil((double) x);
+}
+#endif
+
+
#ifndef HAVE_COSF
float
cosf(float x)
@@ -102,6 +170,74 @@ expl(long double x)
#endif
+#ifndef HAVE_FLOORF
+float
+floorf(float x)
+{
+ return (float) floor(x);
+}
+#endif
+
+#ifndef HAVE_FLOORL
+long double
+floorl(long double x)
+{
+ return floor((double) x);
+}
+#endif
+
+
+#ifndef HAVE_FMODF
+float
+fmodf(float x, float y)
+{
+ return (float) fmod(x, y);
+}
+#endif
+
+#ifndef HAVE_FMODL
+long double
+fmodl(long double x, long double y)
+{
+ return fmod((double) x, (double) y);
+}
+#endif
+
+
+#ifndef HAVE_FREXPF
+float
+frexpf(float x, int *exp)
+{
+ return (float) frexp(x, exp);
+}
+#endif
+
+#ifndef HAVE_FREXPL
+long double
+frexpl(long double x, int *exp)
+{
+ return frexp((double) x, exp);
+}
+#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
+
+
/* Compute the hypothenuse of a right triangle with side x and y. */
#ifndef HAVE_HYPOTF
float
@@ -141,6 +277,23 @@ hypotl(long double x, long double y)
+#ifndef HAVE_LDEXPF
+float
+ldexpf(float x, int exp)
+{
+ return (float) ldexp(x, exp);
+}
+#endif
+
+#ifndef HAVE_LDEXPL
+long double
+ldexpl(long double x, int exp)
+{
+ return ldexp((double) x, exp);
+}
+#endif
+
+
#ifndef HAVE_LOGF
float
logf(float x)
@@ -175,6 +328,31 @@ log10l(long double x)
#endif
+#ifndef HAVE_MODFF
+float
+modff(float x, float *iptr)
+{
+ double result, temp;
+
+ result = modf(x, &temp);
+ *iptr = (float) temp;
+ return (float) result;
+}
+#endif
+
+#ifndef HAVE_MODFL
+long double
+modfl(long double x, long double *iptr)
+{
+ double result, temp;
+
+ result = modf((double) x, &temp);
+ *iptr = temp;
+ return result;
+}
+#endif
+
+
#ifndef HAVE_POWF
float
powf(float x, float y)
@@ -226,23 +404,6 @@ sinhl(long 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)
diff --git a/libstdc++-v3/libsupc++/Makefile.in b/libstdc++-v3/libsupc++/Makefile.in
index 2806ac2a798..f2ef55ee83b 100644
--- a/libstdc++-v3/libsupc++/Makefile.in
+++ b/libstdc++-v3/libsupc++/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -80,8 +80,6 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
-FPOS_H = @FPOS_H@
-FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
@@ -110,7 +108,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -349,8 +346,8 @@ DIST_SOURCES = $(libsupc___la_SOURCES) \
$(libsupc__convenience_la_SOURCES)
HEADERS = $(glibcxxinstall_HEADERS)
-DIST_COMMON = $(glibcxxinstall_HEADERS) $(top_srcdir)/fragment.am \
- Makefile.am Makefile.in
+DIST_COMMON = $(glibcxxinstall_HEADERS) $(srcdir)/Makefile.in \
+ $(top_srcdir)/fragment.am Makefile.am
SOURCES = $(libsupc___la_SOURCES) $(libsupc__convenience_la_SOURCES)
all: all-am
@@ -533,7 +530,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -541,7 +538,7 @@ mostlyclean-generic:
clean-generic:
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -552,7 +549,7 @@ clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
clean-toolexeclibLTLIBRARIES mostlyclean-am
distclean: distclean-am
-
+ -rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-libtool distclean-tags
@@ -575,7 +572,7 @@ install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
diff --git a/libstdc++-v3/libsupc++/vec.cc b/libstdc++-v3/libsupc++/vec.cc
index e2c8f09df4b..908fe9978de 100644
--- a/libstdc++-v3/libsupc++/vec.cc
+++ b/libstdc++-v3/libsupc++/vec.cc
@@ -282,7 +282,10 @@ namespace __cxxabiv1
void (*destructor) (void *),
void (*dealloc) (void *))
{
- char *base = static_cast<char *>(array_address);
+ if (!array_address)
+ return;
+
+ char* base = static_cast<char *>(array_address);
if (padding_size)
{
@@ -312,9 +315,12 @@ namespace __cxxabiv1
void (*destructor) (void *),
void (*dealloc) (void *, std::size_t))
{
- char *base = static_cast <char *> (array_address);
+ if (!array_address)
+ return;
+
+ 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];
diff --git a/libstdc++-v3/linkage.m4 b/libstdc++-v3/linkage.m4
index 9597635359c..ae8b18f544c 100644
--- a/libstdc++-v3/linkage.m4
+++ b/libstdc++-v3/linkage.m4
@@ -371,7 +371,6 @@ dnl This might seem like overkill but experience has shown that it's not...
dnl
dnl Define HAVE_STRTOLD if "strtold" is declared and links
dnl Define HAVE_STRTOF if "strtof" is declared and links
-dnl Define HAVE_LRAND48 if "lrand48" is declared and links
dnl
dnl GLIBCXX_CHECK_STDLIB_SUPPORT
AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
@@ -381,7 +380,6 @@ AC_DEFUN(GLIBCXX_CHECK_STDLIB_SUPPORT, [
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtold)
GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_2(strtof)
- GLIBCXX_CHECK_STDLIB_DECL_AND_LINKAGE_0(lrand48)
CXXFLAGS="$ac_save_CXXFLAGS"
])
diff --git a/libstdc++-v3/po/Makefile.in b/libstdc++-v3/po/Makefile.in
index 7925f979c91..c36ef8fea61 100644
--- a/libstdc++-v3/po/Makefile.in
+++ b/libstdc++-v3/po/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -80,8 +80,6 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
-FPOS_H = @FPOS_H@
-FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
@@ -110,7 +108,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -246,7 +243,8 @@ CONFIG_CLEAN_FILES =
depcomp =
am__depfiles_maybe =
DIST_SOURCES =
-DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/fragment.am \
+ Makefile.am
all: all-am
.SUFFIXES:
@@ -320,7 +318,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -329,7 +327,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -339,7 +337,7 @@ clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-
+ -rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool
dvi: dvi-am
@@ -361,7 +359,7 @@ install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
diff --git a/libstdc++-v3/scripts/testsuite_flags.in b/libstdc++-v3/scripts/testsuite_flags.in
index b260ce4ea0d..f66082e2fae 100755
--- a/libstdc++-v3/scripts/testsuite_flags.in
+++ b/libstdc++-v3/scripts/testsuite_flags.in
@@ -17,6 +17,7 @@ Usage:
--build-cxx
--install-cxx
--cxxflags
+ --cxxpchflags
EOF
}
@@ -41,8 +42,7 @@ case ${query} in
echo ${CXX}
;;
--build-cxx)
- PCHFLAGS="@glibcxx_PCHFLAGS@"
- CXX_build="@CXX@ ${PCHFLAGS}"
+ CXX_build="@CXX@"
CXX=`echo "$CXX_build" | sed 's,gcc/xgcc ,gcc/g++ ,'`
echo ${CXX}
;;
@@ -52,8 +52,12 @@ case ${query} in
@EXTRA_CXX_FLAGS@ -DLOCALEDIR="@glibcxx_localedir@" '
echo ${CXXFLAGS_save} ${CXXFLAGS_config}
;;
+ --cxxpchflags)
+ PCHFLAGS="@glibcxx_PCHFLAGS@"
+ echo ${PCHFLAGS}
+ ;;
*)
- print_usage
+ print_usagex
;;
esac
diff --git a/libstdc++-v3/src/Makefile.am b/libstdc++-v3/src/Makefile.am
index e3e04b52f12..a0d0187c7cf 100644
--- a/libstdc++-v3/src/Makefile.am
+++ b/libstdc++-v3/src/Makefile.am
@@ -94,6 +94,7 @@ sources = \
codecvt.cc \
complex_io.cc \
ctype.cc \
+ debug.cc \
demangle.cc \
functexcept.cc \
globals_locale.cc \
@@ -140,8 +141,7 @@ libstdc___la_LIBADD = \
libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
- -version-info $(libtool_VERSION) ${version_arg} \
- -lm $(LIBUNWIND_FLAG)
+ -version-info $(libtool_VERSION) ${version_arg} -lm
# Use special rules for the deprecated source files so that they find
diff --git a/libstdc++-v3/src/Makefile.in b/libstdc++-v3/src/Makefile.in
index 40d6f8bc94a..3f1d41bd9e3 100644
--- a/libstdc++-v3/src/Makefile.in
+++ b/libstdc++-v3/src/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.8 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -109,7 +109,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -251,6 +250,7 @@ sources = \
codecvt.cc \
complex_io.cc \
ctype.cc \
+ debug.cc \
demangle.cc \
functexcept.cc \
globals_locale.cc \
@@ -297,8 +297,7 @@ libstdc___la_LIBADD = \
libstdc___la_DEPENDENCIES = ${version_dep} $(libstdc___la_LIBADD)
libstdc___la_LDFLAGS = \
- -version-info $(libtool_VERSION) ${version_arg} \
- -lm $(LIBUNWIND_FLAG)
+ -version-info $(libtool_VERSION) ${version_arg} -lm
# Use special rules for the deprecated source files so that they find
@@ -360,7 +359,7 @@ am__objects_1 = codecvt_members.lo collate_members.lo ctype_members.lo \
messages_members.lo monetary_members.lo numeric_members.lo \
time_members.lo
am__objects_2 = basic_file.lo c++locale.lo
-am__objects_3 = codecvt.lo complex_io.lo ctype.lo demangle.lo \
+am__objects_3 = codecvt.lo complex_io.lo ctype.lo debug.lo demangle.lo \
functexcept.lo globals_locale.lo globals_io.lo ios.lo \
ios_failure.lo ios_init.lo ios_locale.lo limits.lo locale.lo \
locale_init.lo locale_facets.lo localename.lo stdexcept.lo \
@@ -552,7 +551,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
diff --git a/libstdc++-v3/src/ctype.cc b/libstdc++-v3/src/ctype.cc
index 7fb5c2da81f..b0888c57c81 100644
--- a/libstdc++-v3/src/ctype.cc
+++ b/libstdc++-v3/src/ctype.cc
@@ -87,11 +87,17 @@ namespace std
#ifdef _GLIBCXX_USE_WCHAR_T
ctype<wchar_t>::ctype(size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
- { _M_c_locale_ctype = _S_get_c_locale(); }
+ {
+ _M_c_locale_ctype = _S_get_c_locale();
+ _M_initialize_ctype();
+ }
ctype<wchar_t>::ctype(__c_locale __cloc, size_t __refs)
: __ctype_abstract_base<wchar_t>(__refs)
- { _M_c_locale_ctype = _S_clone_c_locale(__cloc); }
+ {
+ _M_c_locale_ctype = _S_clone_c_locale(__cloc);
+ _M_initialize_ctype();
+ }
ctype<wchar_t>::~ctype()
{ _S_destroy_c_locale(_M_c_locale_ctype); }
@@ -103,7 +109,8 @@ namespace std
if (std::strcmp(__s, "C") != 0 && std::strcmp(__s, "POSIX") != 0)
{
_S_destroy_c_locale(_M_c_locale_ctype);
- _S_create_c_locale(_M_c_locale_ctype, __s);
+ _S_create_c_locale(_M_c_locale_ctype, __s);
+ _M_initialize_ctype();
}
}
#endif
diff --git a/libstdc++-v3/src/debug.cc b/libstdc++-v3/src/debug.cc
new file mode 100644
index 00000000000..a78bdec2df3
--- /dev/null
+++ b/libstdc++-v3/src/debug.cc
@@ -0,0 +1,660 @@
+// Debugging mode support code -*- C++ -*-
+
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <debug/debug.h>
+#include <debug/safe_sequence.h>
+#include <debug/safe_iterator.h>
+#include <algorithm>
+#include <cstdlib>
+#include <cassert>
+#include <cstring>
+#include <cstdio>
+#include <cctype>
+
+using namespace std;
+
+namespace __gnu_debug
+{
+ const char* _S_debug_messages[] =
+ {
+ "function requires a valid iterator range [%1.name;, %2.name;)",
+ "attempt to insert into container with a singular iterator",
+ "attempt to insert into container with an iterator"
+ " from a different container",
+ "attempt to erase from container with a %2.state; iterator",
+ "attempt to erase from container with an iterator"
+ " from a different container",
+ "attempt to subscript container with out-of-bounds index %2;,"
+ " but container only holds %3; elements",
+ "attempt to access an element in an empty container",
+ "elements in iterator range [%1.name;, %2.name;)"
+ " are not partitioned by the value %3;",
+ "elements in iterator range [%1.name;, %2.name;)"
+ " are not partitioned by the predicate %3; and value %4;",
+ "elements in iterator range [%1.name;, %2.name;) are not sorted",
+ "elements in iterator range [%1.name;, %2.name;)"
+ " are not sorted according to the predicate %3;",
+ "elements in iterator range [%1.name;, %2.name;) do not form a heap",
+ "elements in iterator range [%1.name;, %2.name;)"
+ " do not form a heap with respect to the predicate %3;",
+ "attempt to write through a singular bitset reference",
+ "attempt to read from a singular bitset reference",
+ "attempt to flip a singular bitset reference",
+ "attempt to splice a list into itself",
+ "attempt to splice lists with inequal allocators",
+ "attempt to splice elements referenced by a %1.state; iterator",
+ "attempt to splice an iterator from a different container",
+ "splice destination %1.name;"
+ " occurs within source range [%2.name;, %3.name;)",
+ "attempt to initialize an iterator that will immediately become singular",
+ "attempt to copy-construct an iterator from a singular iterator",
+ "attempt to construct a constant iterator"
+ " from a singular mutable iterator",
+ "attempt to copy from a singular iterator",
+ "attempt to dereference a %1.state; iterator",
+ "attempt to increment a %1.state; iterator",
+ "attempt to decrement a %1.state; iterator",
+ "attempt to subscript a %1.state; iterator %2; step from"
+ " its current position, which falls outside its dereferenceable range",
+ "attempt to advance a %1.state; iterator %2; steps,"
+ " which falls outside its valid range",
+ "attempt to retreat a %1.state; iterator %2; steps,"
+ " which falls outside its valid range",
+ "attempt to compare a %1.state; iterator to a %2.state; iterator",
+ "attempt to compare iterators from different sequences",
+ "attempt to order a %1.state; iterator to a %2.state; iterator",
+ "attempt to order iterators from different sequences",
+ "attempt to compute the difference between a %1.state;"
+ " iterator to a %2.state; iterator",
+ "attempt to compute the different between two iterators"
+ " from different sequences",
+ "attempt to dereference an end-of-stream istream_iterator",
+ "attempt to increment an end-of-stream istream_iterator",
+ "attempt to output via an ostream_iterator with no associated stream",
+ "attempt to dereference an end-of-stream istreambuf_iterator"
+ " (this is a GNU extension)",
+ "attempt to increment an end-of-stream istreambuf_iterator"
+ };
+
+ void
+ _Safe_sequence_base::
+ _M_detach_all()
+ {
+ for (_Safe_iterator_base* iter = _M_iterators; iter; )
+ {
+ _Safe_iterator_base* old = iter;
+ iter = iter->_M_next;
+ old->_M_attach(0, false);
+ }
+
+ for (_Safe_iterator_base* iter = _M_const_iterators; iter; )
+ {
+ _Safe_iterator_base* old = iter;
+ iter = iter->_M_next;
+ old->_M_attach(0, true);
+ }
+ }
+
+ void
+ _Safe_sequence_base::
+ _M_detach_singular()
+ {
+ for (_Safe_iterator_base* iter = _M_iterators; iter; )
+ {
+ _Safe_iterator_base* old = iter;
+ iter = iter->_M_next;
+ if (old->_M_singular())
+ old->_M_attach(0, false);
+ }
+
+ for (_Safe_iterator_base* iter = _M_const_iterators; iter; )
+ {
+ _Safe_iterator_base* old = iter;
+ iter = iter->_M_next;
+ if (old->_M_singular())
+ old->_M_attach(0, true);
+ }
+ }
+
+ void
+ _Safe_sequence_base::
+ _M_revalidate_singular()
+ {
+ _Safe_iterator_base* iter;
+ for (iter = _M_iterators; iter; iter = iter->_M_next)
+ {
+ iter->_M_version = _M_version;
+ iter = iter->_M_next;
+ }
+
+ for (iter = _M_const_iterators; iter; iter = iter->_M_next)
+ {
+ iter->_M_version = _M_version;
+ iter = iter->_M_next;
+ }
+ }
+
+ void
+ _Safe_sequence_base::
+ _M_swap(_Safe_sequence_base& __x)
+ {
+ swap(_M_iterators, __x._M_iterators);
+ swap(_M_const_iterators, __x._M_const_iterators);
+ swap(_M_version, __x._M_version);
+ _Safe_iterator_base* iter;
+ for (iter = _M_iterators; iter; iter = iter->_M_next)
+ iter->_M_sequence = this;
+ for (iter = __x._M_iterators; iter; iter = iter->_M_next)
+ iter->_M_sequence = &__x;
+ for (iter = _M_const_iterators; iter; iter = iter->_M_next)
+ iter->_M_sequence = this;
+ for (iter = __x._M_const_iterators; iter; iter = iter->_M_next)
+ iter->_M_sequence = &__x;
+ }
+
+ void
+ _Safe_iterator_base::
+ _M_attach(_Safe_sequence_base* __seq, bool __constant)
+ {
+ _M_detach();
+
+ // Attach to the new sequence (if there is one)
+ if (__seq)
+ {
+ _M_sequence = __seq;
+ _M_version = _M_sequence->_M_version;
+ _M_prior = 0;
+ if (__constant)
+ {
+ _M_next = _M_sequence->_M_const_iterators;
+ if (_M_next)
+ _M_next->_M_prior = this;
+ _M_sequence->_M_const_iterators = this;
+ }
+ else
+ {
+ _M_next = _M_sequence->_M_iterators;
+ if (_M_next)
+ _M_next->_M_prior = this;
+ _M_sequence->_M_iterators = this;
+ }
+ }
+ }
+
+ void
+ _Safe_iterator_base::
+ _M_detach()
+ {
+ if (_M_sequence)
+ {
+ // Remove us from this sequence's list
+ if (_M_prior)
+ _M_prior->_M_next = _M_next;
+ if (_M_next)
+ _M_next->_M_prior = _M_prior;
+
+ if (_M_sequence->_M_const_iterators == this)
+ _M_sequence->_M_const_iterators = _M_next;
+ if (_M_sequence->_M_iterators == this)
+ _M_sequence->_M_iterators = _M_next;
+ }
+
+ _M_sequence = 0;
+ _M_version = 0;
+ _M_prior = 0;
+ _M_next = 0;
+ }
+
+ bool
+ _Safe_iterator_base::
+ _M_singular() const
+ { return !_M_sequence || _M_version != _M_sequence->_M_version; }
+
+ bool
+ _Safe_iterator_base::
+ _M_can_compare(const _Safe_iterator_base& __x) const
+ {
+ return (!_M_singular() && !__x._M_singular()
+ && _M_sequence == __x._M_sequence);
+ }
+
+ void
+ _Error_formatter::_Parameter::
+ _M_print_field(const _Error_formatter* __formatter, const char* __name) const
+ {
+ assert(this->_M_kind != _Parameter::__unused_param);
+ const int bufsize = 64;
+ char buf[bufsize];
+
+ if (_M_kind == __iterator)
+ {
+ if (strcmp(__name, "name") == 0)
+ {
+ assert(_M_variant._M_iterator._M_name);
+ __formatter->_M_print_word(_M_variant._M_iterator._M_name);
+ }
+ else if (strcmp(__name, "address") == 0)
+ {
+ __formatter->_M_format_word(buf, bufsize, "%p",
+ _M_variant._M_iterator._M_address);
+ __formatter->_M_print_word(buf);
+ }
+ else if (strcmp(__name, "type") == 0)
+ {
+ assert(_M_variant._M_iterator._M_type);
+ // TBD: demangle!
+ __formatter->_M_print_word(_M_variant._M_iterator._M_type->name());
+ }
+ else if (strcmp(__name, "constness") == 0)
+ {
+ static const char* __constness_names[__last_constness] =
+ {
+ "<unknown>",
+ "constant",
+ "mutable"
+ };
+ __formatter->_M_print_word(__constness_names[_M_variant._M_iterator._M_constness]);
+ }
+ else if (strcmp(__name, "state") == 0)
+ {
+ static const char* __state_names[__last_state] =
+ {
+ "<unknown>",
+ "singular",
+ "dereferenceable (start-of-sequence)",
+ "dereferenceable",
+ "past-the-end"
+ };
+ __formatter->_M_print_word(__state_names[_M_variant._M_iterator._M_state]);
+ }
+ else if (strcmp(__name, "sequence") == 0)
+ {
+ assert(_M_variant._M_iterator._M_sequence);
+ __formatter->_M_format_word(buf, bufsize, "%p",
+ _M_variant._M_iterator._M_sequence);
+ __formatter->_M_print_word(buf);
+ }
+ else if (strcmp(__name, "seq_type") == 0)
+ {
+ // TBD: demangle!
+ assert(_M_variant._M_iterator._M_seq_type);
+ __formatter->_M_print_word(_M_variant._M_iterator._M_seq_type->name());
+ }
+ else
+ assert(false);
+ }
+ else if (_M_kind == __sequence)
+ {
+ if (strcmp(__name, "name") == 0)
+ {
+ assert(_M_variant._M_sequence._M_name);
+ __formatter->_M_print_word(_M_variant._M_sequence._M_name);
+ }
+ else if (strcmp(__name, "address") == 0)
+ {
+ assert(_M_variant._M_sequence._M_address);
+ __formatter->_M_format_word(buf, bufsize, "%p",
+ _M_variant._M_sequence._M_address);
+ __formatter->_M_print_word(buf);
+ }
+ else if (strcmp(__name, "type") == 0)
+ {
+ // TBD: demangle!
+ assert(_M_variant._M_sequence._M_type);
+ __formatter->_M_print_word(_M_variant._M_sequence._M_type->name());
+ }
+ else
+ assert(false);
+ }
+ else if (_M_kind == __integer)
+ {
+ if (strcmp(__name, "name") == 0)
+ {
+ assert(_M_variant._M_integer._M_name);
+ __formatter->_M_print_word(_M_variant._M_integer._M_name);
+ }
+ else
+ assert(false);
+ }
+ else if (_M_kind == __string)
+ {
+ if (strcmp(__name, "name") == 0)
+ {
+ assert(_M_variant._M_string._M_name);
+ __formatter->_M_print_word(_M_variant._M_string._M_name);
+ }
+ else
+ assert(false);
+ }
+ else
+ {
+ assert(false);
+ }
+ }
+
+ void
+ _Error_formatter::_Parameter::
+ _M_print_description(const _Error_formatter* __formatter) const
+ {
+ const int bufsize = 128;
+ char buf[bufsize];
+
+ if (_M_kind == __iterator)
+ {
+ __formatter->_M_print_word("iterator ");
+ if (_M_variant._M_iterator._M_name)
+ {
+ __formatter->_M_format_word(buf, bufsize, "\"%s\" ",
+ _M_variant._M_iterator._M_name);
+ __formatter->_M_print_word(buf);
+ }
+
+ __formatter->_M_format_word(buf, bufsize, "@ 0x%p {\n",
+ _M_variant._M_iterator._M_address);
+ __formatter->_M_print_word(buf);
+ if (_M_variant._M_iterator._M_type)
+ {
+ __formatter->_M_print_word("type = ");
+ _M_print_field(__formatter, "type");
+
+ if (_M_variant._M_iterator._M_constness != __unknown_constness)
+ {
+ __formatter->_M_print_word(" (");
+ _M_print_field(__formatter, "constness");
+ __formatter->_M_print_word(" iterator)");
+ }
+ __formatter->_M_print_word(";\n");
+ }
+
+ if (_M_variant._M_iterator._M_state != __unknown_state)
+ {
+ __formatter->_M_print_word(" state = ");
+ _M_print_field(__formatter, "state");
+ __formatter->_M_print_word(";\n");
+ }
+
+ if (_M_variant._M_iterator._M_sequence)
+ {
+ __formatter->_M_print_word(" references sequence ");
+ if (_M_variant._M_iterator._M_seq_type)
+ {
+ __formatter->_M_print_word("with type `");
+ _M_print_field(__formatter, "seq_type");
+ __formatter->_M_print_word("' ");
+ }
+
+ __formatter->_M_format_word(buf, bufsize, "@ 0x%p\n",
+ _M_variant._M_sequence._M_address);
+ __formatter->_M_print_word(buf);
+ }
+ __formatter->_M_print_word("}\n");
+ }
+ else if (_M_kind == __sequence)
+ {
+ __formatter->_M_print_word("sequence ");
+ if (_M_variant._M_sequence._M_name)
+ {
+ __formatter->_M_format_word(buf, bufsize, "\"%s\" ",
+ _M_variant._M_sequence._M_name);
+ __formatter->_M_print_word(buf);
+ }
+
+ __formatter->_M_format_word(buf, bufsize, "@ 0x%p {\n",
+ _M_variant._M_sequence._M_address);
+ __formatter->_M_print_word(buf);
+
+ if (_M_variant._M_sequence._M_type)
+ {
+ __formatter->_M_print_word(" type = ");
+ _M_print_field(__formatter, "type");
+ __formatter->_M_print_word(";\n");
+ }
+ __formatter->_M_print_word("}\n");
+ }
+ }
+
+ const _Error_formatter&
+ _Error_formatter::_M_message(_Debug_msg_id __id) const
+ { return this->_M_message(_S_debug_messages[__id]); }
+
+ void
+ _Error_formatter::_M_error() const
+ {
+ const int bufsize = 128;
+ char buf[bufsize];
+
+ // Emit file & line number information
+ _M_column = 1;
+ _M_wordwrap = false;
+ if (_M_file)
+ {
+ _M_format_word(buf, bufsize, "%s:", _M_file);
+ _M_print_word(buf);
+ _M_column += strlen(buf);
+ }
+
+ if (_M_line > 0)
+ {
+ _M_format_word(buf, bufsize, "%u:", _M_line);
+ _M_print_word(buf);
+ _M_column += strlen(buf);
+ }
+
+ _M_wordwrap = true;
+ _M_print_word("error: ");
+
+ // Print the error message
+ assert(_M_text);
+ _M_print_string(_M_text);
+ _M_print_word(".\n");
+
+ // Emit descriptions of the objects involved in the operation
+ _M_wordwrap = false;
+ bool has_noninteger_parameters = false;
+ for (unsigned int i = 0; i < _M_num_parameters; ++i)
+ {
+ if (_M_parameters[i]._M_kind == _Parameter::__iterator
+ || _M_parameters[i]._M_kind == _Parameter::__sequence)
+ {
+ if (!has_noninteger_parameters)
+ {
+ _M_first_line = true;
+ _M_print_word("\nObjects involved in the operation:\n");
+ has_noninteger_parameters = true;
+ }
+ _M_parameters[i]._M_print_description(this);
+ }
+ }
+
+ abort();
+ }
+
+ template<typename _Tp>
+ void
+ _Error_formatter::_M_format_word(char* __buf,
+ int __n __attribute__((__unused__)),
+ const char* __fmt, _Tp __s) const
+ {
+#ifdef _GLIBCXX_USE_C99
+ std::snprintf(__buf, __n, __fmt, __s);
+#else
+ std::sprintf(__buf, __fmt, __s);
+#endif
+ }
+
+
+ void
+ _Error_formatter::_M_print_word(const char* __word) const
+ {
+ if (!_M_wordwrap)
+ {
+ fprintf(stderr, "%s", __word);
+ return;
+ }
+
+ size_t __length = strlen(__word);
+ if (__length == 0)
+ return;
+
+ if ((_M_column + __length < _M_max_length)
+ || (__length >= _M_max_length && _M_column == 1))
+ {
+ // If this isn't the first line, indent
+ if (_M_column == 1 && !_M_first_line)
+ {
+ char spacing[_M_indent + 1];
+ for (int i = 0; i < _M_indent; ++i)
+ spacing[i] = ' ';
+ spacing[_M_indent] = '\0';
+ fprintf(stderr, "%s", spacing);
+ _M_column += _M_indent;
+ }
+
+ fprintf(stderr, "%s", __word);
+ _M_column += __length;
+
+ if (__word[__length - 1] == '\n')
+ {
+ _M_first_line = false;
+ _M_column = 1;
+ }
+ }
+ else
+ {
+ _M_column = 1;
+ _M_print_word("\n");
+ _M_print_word(__word);
+ }
+ }
+
+ void
+ _Error_formatter::
+ _M_print_string(const char* __string) const
+ {
+ const char* __start = __string;
+ const char* __end = __start;
+ const int bufsize = 128;
+ char buf[bufsize];
+
+ while (*__start)
+ {
+ if (*__start != '%')
+ {
+ // [__start, __end) denotes the next word
+ __end = __start;
+ while (isalnum(*__end)) ++__end;
+ if (__start == __end) ++__end;
+ if (isspace(*__end)) ++__end;
+
+ assert(__end - __start + 1< bufsize);
+ _M_format_word(buf, __end - __start + 1, "%s", __start);
+ _M_print_word(buf);
+ __start = __end;
+
+ // Skip extra whitespace
+ while (*__start == ' ')
+ ++__start;
+
+ continue;
+ }
+
+ ++__start;
+ assert(*__start);
+ if (*__start == '%')
+ {
+ _M_print_word("%");
+ ++__start;
+ continue;
+ }
+
+ // Get the parameter number
+ assert(*__start >= '1' && *__start <= '9');
+ size_t param = *__start - '0';
+ --param;
+ assert(param < _M_num_parameters);
+
+ // '.' separates the parameter number from the field
+ // name, if there is one.
+ ++__start;
+ if (*__start != '.')
+ {
+ assert(*__start == ';');
+ ++__start;
+ buf[0] = '\0';
+ if (_M_parameters[param]._M_kind == _Parameter::__integer)
+ {
+ _M_format_word(buf, bufsize, "%ld",
+ _M_parameters[param]._M_variant._M_integer._M_value);
+ _M_print_word(buf);
+ }
+ else if (_M_parameters[param]._M_kind == _Parameter::__string)
+ _M_print_string(_M_parameters[param]._M_variant._M_string._M_value);
+ continue;
+ }
+
+ // Extract the field name we want
+ enum { max_field_len = 16 };
+ char field[max_field_len];
+ int field_idx = 0;
+ ++__start;
+ while (*__start != ';')
+ {
+ assert(*__start);
+ assert(field_idx < max_field_len-1);
+ field[field_idx++] = *__start++;
+ }
+ ++__start;
+ field[field_idx] = 0;
+
+ _M_parameters[param]._M_print_field(this, field);
+ }
+ }
+
+ // Instantiations.
+ template
+ void
+ _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt,
+ const void* __s) const;
+
+ template
+ void
+ _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt,
+ long __s) const;
+
+ template
+ void
+ _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt,
+ std::size_t __s) const;
+
+ template
+ void
+ _Error_formatter::_M_format_word(char* __buf, int __n, const char* __fmt,
+ const char* __s) const;
+} // namespace __gnu_debug
diff --git a/libstdc++-v3/src/demangle.cc b/libstdc++-v3/src/demangle.cc
index fc5672bb0ed..58c076785e5 100644
--- a/libstdc++-v3/src/demangle.cc
+++ b/libstdc++-v3/src/demangle.cc
@@ -28,8 +28,8 @@
// invalidate any other reasons why the executable file might be covered by
// the GNU General Public License.
-#include <cxxabi.h>
#include <bits/demangle.h>
+#include <cxxabi.h>
// __cxa_demangle
//
diff --git a/libstdc++-v3/src/ios.cc b/libstdc++-v3/src/ios.cc
index fdc1f06c1cb..b36165e7497 100644
--- a/libstdc++-v3/src/ios.cc
+++ b/libstdc++-v3/src/ios.cc
@@ -107,7 +107,7 @@ namespace std
const int ios_base::_S_local_word_size;
- int ios_base::Init::_S_ios_base_init = 0;
+ _Atomic_word ios_base::Init::_S_refcount;
bool ios_base::Init::_S_synced_with_stdio = true;
diff --git a/libstdc++-v3/src/ios_init.cc b/libstdc++-v3/src/ios_init.cc
index 1645ea7b381..b40202553e5 100644
--- a/libstdc++-v3/src/ios_init.cc
+++ b/libstdc++-v3/src/ios_init.cc
@@ -80,7 +80,7 @@ namespace std
ios_base::Init::Init()
{
- if (_S_ios_base_init == 0)
+ if (__exchange_and_add(&_S_refcount, 1) == 0)
{
// Standard streams default to synced with "C" operations.
_S_synced_with_stdio = true;
@@ -110,15 +110,18 @@ namespace std
wcin.tie(&wcout);
wcerr.flags(ios_base::unitbuf);
#endif
-
- _S_ios_base_init = 1;
+
+ // NB: Have to set refcount above one, so that standard
+ // streams are not re-initialized with uses of ios_base::Init
+ // besides <iostream> static object, ie just using <ios> with
+ // ios_base::Init objects.
+ __atomic_add(&_S_refcount, 1);
}
- ++_S_ios_base_init;
}
ios_base::Init::~Init()
{
- if (--_S_ios_base_init == 1)
+ if (__exchange_and_add(&_S_refcount, -1) == 2)
{
// Catch any exceptions thrown by basic_ostream::flush()
try
diff --git a/libstdc++-v3/src/locale-inst.cc b/libstdc++-v3/src/locale-inst.cc
index 35140ea7094..7a41ef83e7c 100644
--- a/libstdc++-v3/src/locale-inst.cc
+++ b/libstdc++-v3/src/locale-inst.cc
@@ -56,6 +56,50 @@ namespace std
template class num_get<C, istreambuf_iterator<C> >;
template class num_put<C, ostreambuf_iterator<C> >;
template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ long&) const;
+
+ template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ unsigned short&) const;
+
+ template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ unsigned int&) const;
+
+ template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ unsigned long&) const;
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ long long&) const;
+
+ template
+ istreambuf_iterator<C>
+ num_get<C, istreambuf_iterator<C> >::
+ _M_extract_int(istreambuf_iterator<C>, istreambuf_iterator<C>,
+ ios_base&, ios_base::iostate&,
+ unsigned long long&) const;
+#endif
+
+ template
ostreambuf_iterator<C>
num_put<C, ostreambuf_iterator<C> >::
_M_insert_int(ostreambuf_iterator<C>, ios_base&, C,
@@ -233,7 +277,8 @@ namespace std
template
bool
- __verify_grouping<C>(const basic_string<C>&, basic_string<C>&);
+ __verify_grouping<C>(const basic_string<C>&,
+ const basic_string<C>&);
template class __pad<C, char_traits<C> >;
diff --git a/libstdc++-v3/src/locale.cc b/libstdc++-v3/src/locale.cc
index c3e57863fb3..c9562e213a7 100644
--- a/libstdc++-v3/src/locale.cc
+++ b/libstdc++-v3/src/locale.cc
@@ -211,7 +211,7 @@ namespace std
// Clone existing _Impl object.
locale::_Impl::
_Impl(const _Impl& __imp, size_t __refs)
- : _M_references(__refs), _M_facets_size(__imp._M_facets_size)
+ : _M_refcount(__refs), _M_facets_size(__imp._M_facets_size)
{
_M_facets = _M_caches = 0;
_M_names = 0;
@@ -350,13 +350,13 @@ namespace std
// locale::id
// Definitions for static const data members of locale::id
- _Atomic_word locale::id::_S_highwater; // init'd to 0 by linker
+ _Atomic_word locale::id::_S_refcount; // init'd to 0 by linker
size_t
locale::id::_M_id() const
{
if (!_M_index)
- _M_index = 1 + __exchange_and_add(&_S_highwater, 1);
+ _M_index = 1 + __exchange_and_add(&_S_refcount, 1);
return _M_index - 1;
}
} // namespace std
diff --git a/libstdc++-v3/src/locale_facets.cc b/libstdc++-v3/src/locale_facets.cc
index 6a0ccf21257..da975f0c78f 100644
--- a/libstdc++-v3/src/locale_facets.cc
+++ b/libstdc++-v3/src/locale_facets.cc
@@ -53,7 +53,7 @@ namespace std
const money_base::pattern
money_base::_S_default_pattern = { {symbol, sign, none, value} };
- const char* __num_base::_S_atoms_in = "-+xX0123456789eEabcdfABCDF";
+ const char* __num_base::_S_atoms_in = "-+xX0123456789abcdefABCDEF";
const char* __num_base::_S_atoms_out ="-+xX0123456789abcdef0123456789ABCDEF";
// _GLIBCXX_RESOLVE_LIB_DEFECTS
diff --git a/libstdc++-v3/src/locale_init.cc b/libstdc++-v3/src/locale_init.cc
index 99bfe3e84ca..2fd22f6f01b 100644
--- a/libstdc++-v3/src/locale_init.cc
+++ b/libstdc++-v3/src/locale_init.cc
@@ -33,6 +33,7 @@
#include <cwctype> // For towupper, etc.
#include <locale>
#include <bits/atomicity.h>
+#include <bits/concurrence.h>
namespace __gnu_cxx
{
@@ -47,45 +48,45 @@ namespace __gnu_cxx
extern std::ctype<char> ctype_c;
extern std::collate<char> collate_c;
extern std::numpunct<char> numpunct_c;
- extern std::num_get<char> num_get_c;
- extern std::num_put<char> num_put_c;
- extern std::codecvt<char, char, mbstate_t> codecvt_c;
+ extern std::num_get<char> num_get_c;
+ extern std::num_put<char> num_put_c;
+ extern std::codecvt<char, char, mbstate_t> codecvt_c;
extern std::moneypunct<char, false> moneypunct_cf;
extern std::moneypunct<char, true> moneypunct_ct;
extern std::money_get<char> money_get_c;
extern std::money_put<char> money_put_c;
- extern std::__timepunct<char> timepunct_c;
+ extern std::__timepunct<char> timepunct_c;
extern std::time_get<char> time_get_c;
extern std::time_put<char> time_put_c;
extern std::messages<char> messages_c;
#ifdef _GLIBCXX_USE_WCHAR_T
extern std::ctype<wchar_t> ctype_w;
extern std::collate<wchar_t> collate_w;
- extern std::numpunct<wchar_t> numpunct_w;
+ extern std::numpunct<wchar_t> numpunct_w;
extern std::num_get<wchar_t> num_get_w;
extern std::num_put<wchar_t> num_put_w;
extern std::codecvt<wchar_t, char, mbstate_t> codecvt_w;
- extern std::moneypunct<wchar_t, false> moneypunct_wf;
- extern std::moneypunct<wchar_t, true> moneypunct_wt;
- extern std::money_get<wchar_t> money_get_w;
- extern std::money_put<wchar_t> money_put_w;
- extern std::__timepunct<wchar_t> timepunct_w;
- extern std::time_get<wchar_t> time_get_w;
- extern std::time_put<wchar_t> time_put_w;
+ extern std::moneypunct<wchar_t, false> moneypunct_wf;
+ extern std::moneypunct<wchar_t, true> moneypunct_wt;
+ extern std::money_get<wchar_t> money_get_w;
+ extern std::money_put<wchar_t> money_put_w;
+ extern std::__timepunct<wchar_t> timepunct_w;
+ extern std::time_get<wchar_t> time_get_w;
+ extern std::time_put<wchar_t> time_put_w;
extern std::messages<wchar_t> messages_w;
#endif
// And the caches....
extern std::locale::facet* cache_vec[_GLIBCXX_NUM_FACETS];
- extern std::__numpunct_cache<char> numpunct_cache_c;
+ extern std::__numpunct_cache<char> numpunct_cache_c;
extern std::__moneypunct_cache<char> moneypunct_cache_cf;
extern std::__moneypunct_cache<char> moneypunct_cache_ct;
extern std::__timepunct_cache<char> timepunct_cache_c;
#ifdef _GLIBCXX_USE_WCHAR_T
extern std::__numpunct_cache<wchar_t> numpunct_cache_w;
- extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wf;
- extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wt;
- extern std::__timepunct_cache<wchar_t> timepunct_cache_w;
+ extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wf;
+ extern std::__moneypunct_cache<wchar_t> moneypunct_cache_wt;
+ extern std::__timepunct_cache<wchar_t> timepunct_cache_w;
#endif
} // namespace __gnu_cxx
@@ -96,21 +97,26 @@ namespace std
locale::locale() throw()
{
_S_initialize();
- (_M_impl = _S_global)->_M_add_reference();
+ __glibcxx_mutex_define_initialized(lock);
+ __glibcxx_mutex_lock(lock);
+ _S_global->_M_add_reference();
+ _M_impl = _S_global;
+ __glibcxx_mutex_unlock(lock);
}
locale
locale::global(const locale& __other)
{
_S_initialize();
-
- // XXX MT
+ __glibcxx_mutex_define_initialized(lock);
+ __glibcxx_mutex_lock(lock);
_Impl* __old = _S_global;
__other._M_impl->_M_add_reference();
_S_global = __other._M_impl;
if (_S_global->_M_check_same_name()
&& (std::strcmp(_S_global->_M_names[0], "*") != 0))
setlocale(LC_ALL, __other.name().c_str());
+ __glibcxx_mutex_unlock(lock);
// Reference count sanity check: one reference removed for the
// subsition of __other locale, one added by return-by-value. Net
@@ -241,7 +247,7 @@ namespace std
// Construct "C" _Impl.
locale::_Impl::
_Impl(size_t __refs) throw()
- : _M_references(__refs), _M_facets_size(_GLIBCXX_NUM_FACETS)
+ : _M_refcount(__refs), _M_facets_size(_GLIBCXX_NUM_FACETS)
{
_M_facets = new (&facet_vec) const facet*[_M_facets_size];
_M_caches = new (&cache_vec) const facet*[_M_facets_size];
diff --git a/libstdc++-v3/src/localename.cc b/libstdc++-v3/src/localename.cc
index 2c12ba7552c..c6a7de92be9 100644
--- a/libstdc++-v3/src/localename.cc
+++ b/libstdc++-v3/src/localename.cc
@@ -178,7 +178,7 @@ namespace std
// Construct named _Impl.
locale::_Impl::
_Impl(const char* __s, size_t __refs)
- : _M_references(__refs), _M_facets_size(_GLIBCXX_NUM_FACETS)
+ : _M_refcount(__refs), _M_facets_size(_GLIBCXX_NUM_FACETS)
{
// Initialize the underlying locale model, which also checks to
// see if the given name is valid.
diff --git a/libstdc++-v3/src/misc-inst.cc b/libstdc++-v3/src/misc-inst.cc
index e08ad9f88db..37a4d3d460b 100644
--- a/libstdc++-v3/src/misc-inst.cc
+++ b/libstdc++-v3/src/misc-inst.cc
@@ -42,6 +42,10 @@
namespace std
{
+#ifdef _GLIBCXX_INST_ATOMICITY_LOCK
+ template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
+#endif
+
// string related to iostreams
template
basic_istream<char>&
@@ -69,12 +73,8 @@ namespace std
basic_istream<wchar_t>&
getline(basic_istream<wchar_t>&, wstring&);
#endif
-#ifdef _GLIBCXX_INST_ATOMICITY_LOCK
- template volatile int __Atomicity_lock<0>::_S_atomicity_lock;
-#endif
} // namespace std
-
namespace __gnu_cxx
{
#ifdef _GLIBCXX_NEED_GENERIC_MUTEX
diff --git a/libstdc++-v3/src/streambuf-inst.cc b/libstdc++-v3/src/streambuf-inst.cc
index 49cb6052560..5d1879a6fae 100644
--- a/libstdc++-v3/src/streambuf-inst.cc
+++ b/libstdc++-v3/src/streambuf-inst.cc
@@ -45,12 +45,12 @@ namespace std
template
streamsize
- __copy_streambufs(basic_ios<char>&, basic_streambuf<char>*,
+ __copy_streambufs(basic_streambuf<char>*,
basic_streambuf<char>*);
#ifdef _GLIBCXX_USE_WCHAR_T
template
streamsize
- __copy_streambufs(basic_ios<wchar_t>&, basic_streambuf<wchar_t>*,
+ __copy_streambufs(basic_streambuf<wchar_t>*,
basic_streambuf<wchar_t>*);
#endif
} //std
diff --git a/libstdc++-v3/src/string-inst.cc b/libstdc++-v3/src/string-inst.cc
index ec17e54c3d2..ab779b872e8 100644
--- a/libstdc++-v3/src/string-inst.cc
+++ b/libstdc++-v3/src/string-inst.cc
@@ -42,7 +42,7 @@
# define C char
#endif
-namespace std
+namespace std
{
typedef basic_string<C> S;
@@ -50,17 +50,7 @@ namespace std
template S operator+(const C*, const S&);
template S operator+(C, const S&);
template S operator+(const S&, const S&);
-} // namespace std
-
-namespace __gnu_cxx
-{
- using std::S;
- template bool operator==(const S::iterator&, const S::iterator&);
- template bool operator==(const S::const_iterator&, const S::const_iterator&);
-}
-namespace std
-{
// Only one template keyword allowed here.
// See core issue #46 (NAD)
// http://anubis.dkuug.dk/jtc1/sc22/wg21/docs/cwg_closed.html#46
@@ -100,3 +90,10 @@ namespace std
S::_S_construct(const C*, const C*, const allocator<C>&,
forward_iterator_tag);
} // namespace std
+
+namespace __gnu_cxx
+{
+ using std::S;
+ template bool operator==(const S::iterator&, const S::iterator&);
+ template bool operator==(const S::const_iterator&, const S::const_iterator&);
+} // namespace __gnu_cxx
diff --git a/libstdc++-v3/testsuite/18_support/numeric_limits.cc b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
index a96cdf55453..a7c2494a8b9 100644
--- a/libstdc++-v3/testsuite/18_support/numeric_limits.cc
+++ b/libstdc++-v3/testsuite/18_support/numeric_limits.cc
@@ -1,4 +1,4 @@
-// { dg-options "-mieee" { target alpha*-*-* } }
+// { dg-options "-D_GLIBCXX_ASSERT -mieee" { target alpha*-*-* } }
// 1999-08-23 bkoz
diff --git a/libstdc++-v3/testsuite/20_util/allocator_members.cc b/libstdc++-v3/testsuite/20_util/allocator_members.cc
deleted file mode 100644
index 4170a9d9a96..00000000000
--- a/libstdc++-v3/testsuite/20_util/allocator_members.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// 2001-06-14 Benjamin Kosnik <bkoz@redhat.com>
-
-// 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.
-
-// 20.4.1.1 allocator members
-
-#include <memory>
-#include <stdexcept>
-#include <cstdlib>
-#include <testsuite_hooks.h>
-
-struct gnu { };
-
-bool check_new = false;
-bool check_delete = false;
-
-void*
-operator new(std::size_t n) throw(std::bad_alloc)
-{
- check_new = true;
- return std::malloc(n);
-}
-
-void operator delete(void *v) throw()
-{
- check_delete = true;
- return std::free(v);
-}
-
-void test01()
-{
- bool test __attribute__((unused)) = true;
- std::allocator<gnu> obj;
-
- // XXX These should work for various size allocation and
- // deallocations. Currently, they only work as expected for sizes >
- // _MAX_BYTES as defined in stl_alloc.h, which happes to be 128.
- gnu* pobj = obj.allocate(256);
- VERIFY( check_new );
-
- obj.deallocate(pobj, 256);
- VERIFY( check_delete );
-}
-
-// libstdc++/8230
-void test02()
-{
- bool test __attribute__((unused)) = true;
- try
- {
- std::allocator<int> alloc;
- const std::allocator<int>::size_type n = alloc.max_size();
- int* p = alloc.allocate(n + 1);
- p[n] = 2002;
- }
- catch(const std::bad_alloc& e)
- {
- // Allowed.
- test = true;
- }
- catch(...)
- {
- test = false;
- }
- VERIFY( test );
-}
-
-int main()
-{
- test01();
- test02();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc b/libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc
index 6f1c629e84b..15a6ae43986 100644
--- a/libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/auto_ptr_neg.cc
@@ -46,5 +46,5 @@ main()
test01();
return 0;
}
-// { dg-error "candidates" "" { target *-*-* } 216 }
-// { dg-error "std::auto_ptr" "" { target *-*-* } 338 }
+// { dg-error "candidates" "" { target *-*-* } 217 }
+// { dg-error "std::auto_ptr" "" { target *-*-* } 347 }
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
index c37e01fb046..2599d4298ff 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/1.cc
@@ -140,7 +140,7 @@ void test01()
VERIFY( sz04 >= 100 );
str02.reserve();
sz03 = str02.capacity();
- VERIFY( sz03 > 0 );
+ VERIFY( sz03 >= 0 );
sz03 = str02.size() + 5;
str02.resize(sz03);
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
index 649c5418ba6..9cdc4f0457c 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/char/1.cc
@@ -37,7 +37,7 @@ void test01()
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 > 0 );
+ VERIFY( sz01 >= 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);
diff --git a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
index f10a25578a0..925d812c748 100644
--- a/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/21_strings/basic_string/capacity/wchar_t/1.cc
@@ -37,7 +37,7 @@ void test01()
VERIFY( sz02 >= 100 );
str01.reserve();
sz01 = str01.capacity();
- VERIFY( sz01 > 0 );
+ VERIFY( sz01 >= 0 );
sz01 = str01.size() + 5;
str01.resize(sz01);
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
index 06e7e0d1427..b58f61bfa97 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12352.cc
@@ -22,6 +22,7 @@
#include <locale>
#include <cstdlib>
#include <cstring>
+#include <testsuite_hooks.h>
int times_to_fail = 0;
@@ -100,7 +101,7 @@ void test01(int iters)
times_to_fail = i;
try
{
- std::locale loc1("");
+ std::locale loc1 = __gnu_test::try_named_locale("");
std::locale loc2(loc1, std::locale::classic(),
std::locale::numeric);
}
diff --git a/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc b/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc
index c9129993c7b..70691d320e4 100644
--- a/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc
+++ b/libstdc++-v3/testsuite/22_locale/locale/cons/12438.cc
@@ -57,8 +57,8 @@ void test01(int iters)
int main(int argc, char* argv[])
{
// We leaked ~400-500 bytes/iter.
- __gnu_test::set_memory_limits(5.0);
- int iters = 20000;
+ __gnu_test::set_memory_limits(10.0);
+ int iters = 30000;
if (argc > 1)
iters = atoi(argv[1]);
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
index 39dca1df909..fd2c1e55c93 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/char/1.cc
@@ -100,7 +100,7 @@ void test01()
ios_base::iostate err04 = ios_base::goodbit;
mon_get.get(is_it04, end, true, iss, err04, result4);
VERIFY( result4 == empty );
- VERIFY( err04 == ios_base::failbit | ios_base::eofbit );
+ VERIFY( err04 == (ios_base::failbit | ios_base::eofbit) );
iss.str("working for enlightenment and peace in a mad world");
iterator_type is_it05(iss);
diff --git a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
index 0a7f90b6366..a8950723455 100644
--- a/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/money_get/get/wchar_t/1.cc
@@ -100,7 +100,7 @@ void test01()
ios_base::iostate err04 = ios_base::goodbit;
mon_get.get(is_it04, end, true, iss, err04, result4);
VERIFY( result4 == empty );
- VERIFY( err04 == ios_base::failbit | ios_base::eofbit );
+ VERIFY( err04 == (ios_base::failbit | ios_base::eofbit) );
iss.str(L"working for enlightenment and peace in a mad world");
iterator_type is_it05(iss);
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc
new file mode 100644
index 00000000000..62599354ce5
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/char/12971.cc
@@ -0,0 +1,50 @@
+// 2003-11-09 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.6.2.1 money_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12971
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef ostreambuf_iterator<char> iterator_type;
+
+ long double amount = 10.8L;
+
+ // cache the money_put facet
+ ostringstream oss;
+ const money_put<char>& mon_put = use_facet<money_put<char> >(oss.getloc());
+
+ iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, ' ', amount);
+ string result = oss.str();
+ VERIFY( result == "11" );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc
new file mode 100644
index 00000000000..1bc93e34898
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/money_put/put/wchar_t/12971.cc
@@ -0,0 +1,50 @@
+// 2003-11-09 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.6.2.1 money_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12971
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef ostreambuf_iterator<wchar_t> iterator_type;
+
+ long double amount = 10.8L;
+
+ // cache the money_put facet
+ wostringstream oss;
+ const money_put<wchar_t>& mon_put = use_facet<money_put<wchar_t> >(oss.getloc());
+
+ iterator_type os_it01 = mon_put.put(oss.rdbuf(), true, oss, L' ', amount);
+ wstring result = oss.str();
+ VERIFY( result == L"11" );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc
new file mode 100644
index 00000000000..259dea95e80
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/10.cc
@@ -0,0 +1,72 @@
+// 2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ istringstream iss;
+ const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ float f = 0.0f;
+ double d = 0.0;
+ long double ld = 0.0l;
+ float f1 = 1.0f;
+ double d1 = 3.0;
+ long double ld1 = 6.0l;
+
+ iss.str("1e.");
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, f);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == '.' );
+ VERIFY( f == f1 );
+
+ iss.str("3e+");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss.str("6e ");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, ld);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == ' ' );
+ VERIFY( ld == ld1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc
new file mode 100644
index 00000000000..138f10d0a0c
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/11.cc
@@ -0,0 +1,69 @@
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct: std::numpunct<char>
+{
+ std::string do_grouping() const { return "\1"; }
+ char do_thousands_sep() const { return '2'; }
+ char do_decimal_point() const { return '4'; }
+};
+
+// http://gcc.gnu.org/ml/libstdc++/2003-12/msg00201.html
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ istringstream iss;
+ iss.imbue(locale(iss.getloc(), static_cast<numpunct<char>*>(new Punct)));
+ const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d = 0.0;
+ double d1 = 13.0;
+ long l = 0l;
+ long l1 = 13l;
+
+ iss.str("1234");
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss.str("1234");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( l == l1 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc
new file mode 100644
index 00000000000..1898867086f
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/12.cc
@@ -0,0 +1,160 @@
+// 2003-12-22 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct1: std::numpunct<char>
+{
+ std::string do_grouping() const { return "\1"; }
+ char do_thousands_sep() const { return '+'; }
+ char do_decimal_point() const { return 'x'; }
+};
+
+struct Punct2: std::numpunct<char>
+{
+ std::string do_grouping() const { return "\1"; }
+ char do_thousands_sep() const { return 'X'; }
+ char do_decimal_point() const { return '-'; }
+};
+
+// http://gcc.gnu.org/ml/libstdc++/2003-12/msg00201.html
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ istringstream iss1, iss2;
+ iss1.imbue(locale(iss1.getloc(), static_cast<numpunct<char>*>(new Punct1)));
+ iss2.imbue(locale(iss2.getloc(), static_cast<numpunct<char>*>(new Punct2)));
+ const num_get<char>& ng1 = use_facet<num_get<char> >(iss1.getloc());
+ const num_get<char>& ng2 = use_facet<num_get<char> >(iss2.getloc());
+
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ long l = 1l;
+ long l1 = 0l;
+ long l2 = 10l;
+ long l3 = 1l;
+ long l4 = 63l;
+ double d = 0.0;
+ double d1 = .4;
+ double d2 = .1;
+
+ iss1.str("+3");
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == '+' );
+
+ iss1.str("0x1");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == 'x' );
+ VERIFY( l == l1 );
+
+ iss1.str("0Xa");
+ iss1.clear();
+ iss1.unsetf(ios::basefield);
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( l == l2 );
+
+ iss1.str("0xa");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == 'x' );
+ VERIFY( l == l1 );
+
+ iss1.str("+5");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == '+' );
+
+ iss1.str("x4");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss2.str("0001-");
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == '-' );
+ VERIFY( l == l3 );
+
+ iss2.str("-2");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == '-' );
+
+ iss2.str("0X1");
+ iss2.clear();
+ iss2.unsetf(ios::basefield);
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == 'X' );
+
+ iss2.str("000778");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == '8' );
+ VERIFY( l == l4 );
+
+ iss2.str("00X");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == 'X' );
+
+ iss2.str("-1");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d2 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc
new file mode 100644
index 00000000000..63cb008e850
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/13.cc
@@ -0,0 +1,79 @@
+// 2003-12-30 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct1: std::numpunct<char>
+{ std::string do_grouping() const { return "\003\002\001"; } };
+
+struct Punct2: std::numpunct<char>
+{ std::string do_grouping() const { return "\001\003"; } };
+
+// libstdc++/13369
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ istringstream iss1, iss2;
+ iss1.imbue(locale(iss1.getloc(), static_cast<numpunct<char>*>(new Punct1)));
+ iss2.imbue(locale(iss2.getloc(), static_cast<numpunct<char>*>(new Punct2)));
+ const num_get<char>& ng1 = use_facet<num_get<char> >(iss1.getloc());
+ const num_get<char>& ng2 = use_facet<num_get<char> >(iss2.getloc());
+
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ long l = 0l;
+ long l1 = 12345678l;
+ double d = 0.0;
+ double d1 = 1234567.0;
+ double d2 = 123456.0;
+
+ iss1.str("1,2,3,45,678");
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( l == l1 );
+
+ iss2.str("123,456,7.0");
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss2.str("12,345,6.0");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d2 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc
new file mode 100644
index 00000000000..7e8e69dda89
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/7.cc
@@ -0,0 +1,58 @@
+// 2003-10-25 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // cache the num_get facet
+ istringstream iss;
+ const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d;
+
+ iss.str("+e3");
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == 'e' );
+
+ iss.str(".e+1");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == 'e' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc
new file mode 100644
index 00000000000..d3f24f972de
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/8.cc
@@ -0,0 +1,70 @@
+// 2003-12-15 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ bool b;
+
+ // cache the num_get facet
+ istringstream iss;
+ const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
+ const ios_base::iostate goodbit = ios_base::goodbit;
+ const ios_base::iostate failbit = ios_base::failbit;
+ ios_base::iostate err;
+ iterator_type end;
+
+ iss.setf(ios_base::boolalpha);
+ iss.str("faLse");
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == 'L' );
+ VERIFY( err == failbit );
+
+ iss.str("falsr");
+ iss.clear();
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == 'r' );
+ VERIFY( err == failbit );
+
+ iss.str("trus");
+ iss.clear();
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == 's' );
+ VERIFY( err == failbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc
new file mode 100644
index 00000000000..5934b61cbd5
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/char/9.cc
@@ -0,0 +1,65 @@
+// 2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // A locale that expects grouping
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
+ istringstream iss;
+ iss.imbue(loc_de);
+
+ const num_get<char>& ng = use_facet<num_get<char> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d = 0.0;
+ double d1 = 1e1;
+ double d2 = 3e1;
+
+ iss.str("1e1,");
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == ',' );
+ VERIFY( d == d1 );
+
+ iss.str("3e1.");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == '.' );
+ VERIFY( d == d2 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc
new file mode 100644
index 00000000000..85fa5744dec
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/10.cc
@@ -0,0 +1,72 @@
+// 2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ wistringstream iss;
+ const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ float f = 0.0f;
+ double d = 0.0;
+ long double ld = 0.0l;
+ float f1 = 1.0f;
+ double d1 = 3.0;
+ long double ld1 = 6.0l;
+
+ iss.str(L"1e.");
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, f);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'.' );
+ VERIFY( f == f1 );
+
+ iss.str(L"3e+");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss.str(L"6e ");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, ld);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L' ' );
+ VERIFY( ld == ld1 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc
new file mode 100644
index 00000000000..d478209f49d
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/11.cc
@@ -0,0 +1,69 @@
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct: std::numpunct<wchar_t>
+{
+ std::string do_grouping() const { return "\1"; }
+ wchar_t do_thousands_sep() const { return L'2'; }
+ wchar_t do_decimal_point() const { return L'4'; }
+};
+
+// http://gcc.gnu.org/ml/libstdc++/2003-12/msg00201.html
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ wistringstream iss;
+ iss.imbue(locale(iss.getloc(), static_cast<numpunct<wchar_t>*>(new Punct)));
+ const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d = 0.0;
+ double d1 = 13.0;
+ long l = 0l;
+ long l1 = 13l;
+
+ iss.str(L"1234");
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss.str(L"1234");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( l == l1 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc
new file mode 100644
index 00000000000..fa9cb15973c
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/12.cc
@@ -0,0 +1,160 @@
+// 2003-12-22 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct1: std::numpunct<wchar_t>
+{
+ std::string do_grouping() const { return "\1"; }
+ wchar_t do_thousands_sep() const { return L'+'; }
+ wchar_t do_decimal_point() const { return L'x'; }
+};
+
+struct Punct2: std::numpunct<wchar_t>
+{
+ std::string do_grouping() const { return "\1"; }
+ wchar_t do_thousands_sep() const { return L'X'; }
+ wchar_t do_decimal_point() const { return L'-'; }
+};
+
+// http://gcc.gnu.org/ml/libstdc++/2003-12/msg00201.html
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ wistringstream iss1, iss2;
+ iss1.imbue(locale(iss1.getloc(), static_cast<numpunct<wchar_t>*>(new Punct1)));
+ iss2.imbue(locale(iss2.getloc(), static_cast<numpunct<wchar_t>*>(new Punct2)));
+ const num_get<wchar_t>& ng1 = use_facet<num_get<wchar_t> >(iss1.getloc());
+ const num_get<wchar_t>& ng2 = use_facet<num_get<wchar_t> >(iss2.getloc());
+
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ long l = 1l;
+ long l1 = 0l;
+ long l2 = 10l;
+ long l3 = 1l;
+ long l4 = 63l;
+ double d = 0.0;
+ double d1 = .4;
+ double d2 = .1;
+
+ iss1.str(L"+3");
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'+' );
+
+ iss1.str(L"0x1");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'x' );
+ VERIFY( l == l1 );
+
+ iss1.str(L"0Xa");
+ iss1.clear();
+ iss1.unsetf(ios::basefield);
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( l == l2 );
+
+ iss1.str(L"0xa");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'x' );
+ VERIFY( l == l1 );
+
+ iss1.str(L"+5");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'+' );
+
+ iss1.str(L"x4");
+ iss1.clear();
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss2.str(L"0001-");
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'-' );
+ VERIFY( l == l3 );
+
+ iss2.str(L"-2");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'-' );
+
+ iss2.str(L"0X1");
+ iss2.clear();
+ iss2.unsetf(ios::basefield);
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'X' );
+
+ iss2.str(L"000778");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, l);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'8' );
+ VERIFY( l == l4 );
+
+ iss2.str(L"00X");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'X' );
+
+ iss2.str(L"-1");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d2 );
+}
+
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc
new file mode 100644
index 00000000000..217695957b8
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/13.cc
@@ -0,0 +1,79 @@
+// 2003-12-30 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Punct1: std::numpunct<wchar_t>
+{ std::string do_grouping() const { return "\003\002\001"; } };
+
+struct Punct2: std::numpunct<wchar_t>
+{ std::string do_grouping() const { return "\001\003"; } };
+
+// libstdc++/13369
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ wistringstream iss1, iss2;
+ iss1.imbue(locale(iss1.getloc(), static_cast<numpunct<wchar_t>*>(new Punct1)));
+ iss2.imbue(locale(iss2.getloc(), static_cast<numpunct<wchar_t>*>(new Punct2)));
+ const num_get<wchar_t>& ng1 = use_facet<num_get<wchar_t> >(iss1.getloc());
+ const num_get<wchar_t>& ng2 = use_facet<num_get<wchar_t> >(iss2.getloc());
+
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ long l = 0l;
+ long l1 = 12345678l;
+ double d = 0.0;
+ double d1 = 1234567.0;
+ double d2 = 123456.0;
+
+ iss1.str(L"1,2,3,45,678");
+ err = ios_base::goodbit;
+ end = ng1.get(iss1.rdbuf(), 0, iss1, err, l);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( l == l1 );
+
+ iss2.str(L"123,456,7.0");
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d1 );
+
+ iss2.str(L"12,345,6.0");
+ iss2.clear();
+ err = ios_base::goodbit;
+ end = ng2.get(iss2.rdbuf(), 0, iss2, err, d);
+ VERIFY( err == ios_base::eofbit );
+ VERIFY( d == d2 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc
new file mode 100644
index 00000000000..fdb9ee7ac36
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/7.cc
@@ -0,0 +1,58 @@
+// 2003-10-25 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // cache the num_get facet
+ wistringstream iss;
+ const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d;
+
+ iss.str(L"+e3");
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'e' );
+
+ iss.str(L".e+1");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::failbit );
+ VERIFY( *end == L'e' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc
new file mode 100644
index 00000000000..fbba3a5553a
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/8.cc
@@ -0,0 +1,70 @@
+// 2003-12-15 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ bool b;
+
+ // cache the num_get facet
+ wistringstream iss;
+ const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
+ const ios_base::iostate goodbit = ios_base::goodbit;
+ const ios_base::iostate failbit = ios_base::failbit;
+ ios_base::iostate err;
+ iterator_type end;
+
+ iss.setf(ios_base::boolalpha);
+ iss.str(L"faLse");
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == L'L' );
+ VERIFY( err == failbit );
+
+ iss.str(L"falsr");
+ iss.clear();
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == L'r' );
+ VERIFY( err == failbit );
+
+ iss.str(L"trus");
+ iss.clear();
+ err = goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, b);
+ VERIFY( *end == L's' );
+ VERIFY( err == failbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc
new file mode 100644
index 00000000000..df3db53b127
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_get/get/wchar_t/9.cc
@@ -0,0 +1,65 @@
+// 2003-12-19 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.1.1 num_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // A locale that expects grouping
+ locale loc_de = __gnu_test::try_named_locale("de_DE");
+ wistringstream iss;
+ iss.imbue(loc_de);
+
+ const num_get<wchar_t>& ng = use_facet<num_get<wchar_t> >(iss.getloc());
+ ios_base::iostate err = ios_base::goodbit;
+ iterator_type end;
+ double d = 0.0;
+ double d1 = 1e1;
+ double d2 = 3e1;
+
+ iss.str(L"1e1,");
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L',' );
+ VERIFY( d == d1 );
+
+ iss.str(L"3e1.");
+ iss.clear();
+ err = ios_base::goodbit;
+ end = ng.get(iss.rdbuf(), 0, iss, err, d);
+ VERIFY( err == ios_base::goodbit );
+ VERIFY( *end == L'.' );
+ VERIFY( d == d2 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc
new file mode 100644
index 00000000000..4ec8de1d958
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/char/8.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.2.1 num_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Ctype: std::ctype<char>
+{
+ char
+ do_widen(char c) const
+ { return 'A' + c % 26; }
+
+ const char*
+ do_widen(const char* lo, const char* hi, char* to) const
+ {
+ for (; lo != hi; *to++ = Ctype::do_widen(*lo++));
+ return hi;
+ }
+};
+
+// See http://gcc.gnu.org/ml/libstdc++/2003-11/msg00154.html
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ ostringstream oss;
+ oss.imbue(locale(locale::classic(), new Ctype));
+ const num_put<char>& np = use_facet<num_put<char> >(oss.getloc());
+
+ const string empty;
+ string result;
+ long inum = 123;
+ double fnum = 123.456;
+
+ np.put(oss.rdbuf(), oss, '+', inum);
+ result = oss.str();
+ VERIFY( result == "XYZ" );
+
+ oss.clear();
+ oss.str(empty);
+ np.put(oss.rdbuf(), oss, '+', fnum);
+ result = oss.str();
+ VERIFY( result == "XYZ.ABC" );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc
new file mode 100644
index 00000000000..b1915d4d9f6
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/num_put/put/wchar_t/8.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.2.2.1 num_put members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+struct Ctype: std::ctype<wchar_t>
+{
+ wchar_t
+ do_widen(char c) const
+ { return L'A' + c % 26; }
+
+ const char*
+ do_widen(const char* lo, const char* hi, wchar_t* to) const
+ {
+ for (; lo != hi; *to++ = Ctype::do_widen(*lo++));
+ return hi;
+ }
+};
+
+// See http://gcc.gnu.org/ml/libstdc++/2003-11/msg00154.html
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ wostringstream oss;
+ oss.imbue(locale(locale::classic(), new Ctype));
+ const num_put<wchar_t>& np = use_facet<num_put<wchar_t> >(oss.getloc());
+
+ const wstring empty;
+ wstring result;
+ long inum = 123;
+ double fnum = 123.456;
+
+ np.put(oss.rdbuf(), oss, '+', inum);
+ result = oss.str();
+ VERIFY( result == L"XYZ" );
+
+ oss.clear();
+ oss.str(empty);
+ np.put(oss.rdbuf(), oss, '+', fnum);
+ result = oss.str();
+ VERIFY( result == L"XYZ.ABC" );
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc
new file mode 100644
index 00000000000..99e4aeac048
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12750.cc
@@ -0,0 +1,79 @@
+// 2003-10-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.5.1.1 time_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12750
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<char> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // basic construction
+ locale loc_is = __gnu_test::try_named_locale("is_IS");
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
+
+ istringstream iss;
+ const time_get<char>& tim_get = use_facet<time_get<char> >(iss.getloc());
+
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+ // create "C" time objects
+ const tm time_bday01 = { 0, 0, 12, 2, 9, 103, 4, 274, -1 };
+ const tm time_bday02 = { 0, 0, 12, 26, 9, 103, 0, 298, -1 };
+
+ // inspection of named locales, is_IS
+ iss.imbue(loc_is);
+
+ iss.str("Fim 2.Okt 2003");
+ iterator_type is_it01(iss);
+ tm time01;
+ errorstate = good;
+ tim_get.get_date(is_it01, end, iss, errorstate, &time01);
+ VERIFY( time01.tm_mon == time_bday01.tm_mon );
+ VERIFY( time01.tm_mday == time_bday01.tm_mday );
+ VERIFY( time01.tm_year == time_bday01.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+
+ iss.str("Sun 26.Okt 2003");
+ iterator_type is_it02(iss);
+ tm time02;
+ errorstate = good;
+ tim_get.get_date(is_it02, end, iss, errorstate, &time02);
+ VERIFY( time02.tm_mon == time_bday02.tm_mon );
+ VERIFY( time02.tm_mday == time_bday02.tm_mday );
+ VERIFY( time02.tm_year == time_bday02.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc
new file mode 100644
index 00000000000..643bbca81d4
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/char/12791.cc
@@ -0,0 +1,65 @@
+// 2003-12-03 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.5.1.1 time_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12791
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<char> iterator_type;
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
+
+ istringstream iss;
+ const time_get<char>& tim_get = use_facet<time_get<char> >(iss.getloc());
+
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+ iss.str("60/04/71");
+ iterator_type is_it01(iss);
+ tm time01;
+ errorstate = good;
+ tim_get.get_date(is_it01, end, iss, errorstate, &time01);
+ VERIFY( errorstate == ios_base::failbit );
+ VERIFY( *is_it01 == '6' );
+
+ iss.str("04/38/71");
+ iterator_type is_it02(iss);
+ tm time02;
+ errorstate = good;
+ tim_get.get_date(is_it02, end, iss, errorstate, &time02);
+ VERIFY( errorstate == ios_base::failbit );
+ VERIFY( *is_it02 == '8' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc
index 4affdf1796a..e4b67e0778d 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/1.cc
@@ -80,7 +80,7 @@ void test01()
VERIFY( time02.tm_mon == time_bday.tm_mon );
VERIFY( time02.tm_mday == time_bday.tm_mday );
VERIFY( errorstate == good );
- VERIFY( *is_it02 == ' ');
+ VERIFY( *is_it02 == L' ' );
iss.str(L"04/04d/71 ");
iterator_type is_it03(iss);
@@ -92,7 +92,7 @@ void test01()
VERIFY( time03.tm_mon == time_bday.tm_mon );
VERIFY( time03.tm_mday == time_bday.tm_mday );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it03 == 'd');
+ VERIFY( *is_it03 == L'd' );
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc
new file mode 100644
index 00000000000..c122d6598dc
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12750.cc
@@ -0,0 +1,79 @@
+// 2003-10-27 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.5.1.1 time_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12750
+void test01()
+{
+ using namespace std;
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ bool test __attribute__((unused)) = true;
+
+ // basic construction
+ locale loc_is = __gnu_test::try_named_locale("is_IS");
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
+
+ wistringstream iss;
+ const time_get<wchar_t>& tim_get = use_facet<time_get<wchar_t> >(iss.getloc());
+
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+ // create "C" time objects
+ const tm time_bday01 = { 0, 0, 12, 2, 9, 103, 4, 274, -1 };
+ const tm time_bday02 = { 0, 0, 12, 26, 9, 103, 0, 298, -1 };
+
+ // inspection of named locales, is_IS
+ iss.imbue(loc_is);
+
+ iss.str(L"Fim 2.Okt 2003");
+ iterator_type is_it01(iss);
+ tm time01;
+ errorstate = good;
+ tim_get.get_date(is_it01, end, iss, errorstate, &time01);
+ VERIFY( time01.tm_mon == time_bday01.tm_mon );
+ VERIFY( time01.tm_mday == time_bday01.tm_mday );
+ VERIFY( time01.tm_year == time_bday01.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+
+ iss.str(L"Sun 26.Okt 2003");
+ iterator_type is_it02(iss);
+ tm time02;
+ errorstate = good;
+ tim_get.get_date(is_it02, end, iss, errorstate, &time02);
+ VERIFY( time02.tm_mon == time_bday02.tm_mon );
+ VERIFY( time02.tm_mday == time_bday02.tm_mday );
+ VERIFY( time02.tm_year == time_bday02.tm_year );
+ VERIFY( errorstate == ios_base::eofbit );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc
new file mode 100644
index 00000000000..d06fca8d34e
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/12791.cc
@@ -0,0 +1,65 @@
+// 2003-12-03 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.5.1.1 time_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/12791
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ // create an ostream-derived object, cache the time_get facet
+ iterator_type end;
+
+ wistringstream iss;
+ const time_get<wchar_t>& tim_get = use_facet<time_get<wchar_t> >(iss.getloc());
+
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+ iss.str(L"60/04/71");
+ iterator_type is_it01(iss);
+ tm time01;
+ errorstate = good;
+ tim_get.get_date(is_it01, end, iss, errorstate, &time01);
+ VERIFY( errorstate == ios_base::failbit );
+ VERIFY( *is_it01 == L'6' );
+
+ iss.str(L"04/38/71");
+ iterator_type is_it02(iss);
+ tm time02;
+ errorstate = good;
+ tim_get.get_date(is_it02, end, iss, errorstate, &time02);
+ VERIFY( errorstate == ios_base::failbit );
+ VERIFY( *is_it02 == L'8' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc
new file mode 100644
index 00000000000..a64efe834c2
--- /dev/null
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_date/wchar_t/4.cc
@@ -0,0 +1,63 @@
+// 2003-12-17 Paolo Carlini <pcarlini@suse.de>
+
+// Copyright (C) 2003 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
+// 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.
+
+// 22.2.5.1.1 time_get members
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ typedef istreambuf_iterator<wchar_t> iterator_type;
+
+ locale loc_tw = __gnu_test::try_named_locale("zh_TW");
+
+ iterator_type end;
+
+ wistringstream iss;
+ iss.imbue(loc_tw);
+ const time_get<wchar_t>& tim_get = use_facet<time_get<wchar_t> >(iss.getloc());
+
+ const ios_base::iostate good = ios_base::goodbit;
+ ios_base::iostate errorstate = good;
+
+ const wchar_t wstr[] = { 0x897f, 0x5143, L'2', L'0', L'0', L'3',
+ 0x5e74, L'1', L'2', 0x6708, L'1', L'7',
+ 0x65e5 , 0x0 };
+
+ iss.str(wstr);
+ iterator_type is_it01(iss);
+ tm time01;
+ tim_get.get_date(is_it01, end, iss, errorstate, &time01);
+ VERIFY( errorstate == ios_base::eofbit );
+ VERIFY( time01.tm_mon == 11 );
+ VERIFY( time01.tm_mday == 17 );
+ VERIFY( time01.tm_year == 103 );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
index 47f5c48188a..17a8075f16d 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_monthname/wchar_t/1.cc
@@ -81,7 +81,7 @@ void test01()
tim_get.get_monthname(is_it03, end, iss, errorstate, &time03);
VERIFY( time03.tm_mon == time_bday.tm_mon );
VERIFY( errorstate == good );
- VERIFY( *is_it03 == ' ');
+ VERIFY( *is_it03 == L' ' );
iss.str(L"Aar");
iterator_type is_it04(iss);
@@ -90,7 +90,7 @@ void test01()
errorstate = good;
tim_get.get_monthname(is_it04, end, iss, errorstate, &time04);
VERIFY( time04.tm_mon == 5 );
- VERIFY( *is_it04 == 'a');
+ VERIFY( *is_it04 == L'a' );
VERIFY( errorstate == ios_base::failbit );
iss.str(L"December ");
@@ -100,7 +100,7 @@ void test01()
tim_get.get_monthname(is_it05, end, iss, errorstate, &time05);
VERIFY( time05.tm_mon == 11 );
VERIFY( errorstate == good );
- VERIFY( *is_it05 == ' ');
+ VERIFY( *is_it05 == L' ' );
iss.str(L"Decelember ");
iterator_type is_it06(iss);
@@ -110,7 +110,7 @@ void test01()
tim_get.get_monthname(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_mon == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == 'l');
+ VERIFY( *is_it05 == L'l' );
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc
index bc9b3a12734..f8d0bc6de60 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_time/wchar_t/1.cc
@@ -94,7 +94,7 @@ void test01()
errorstate = good;
tim_get.get_time(is_it04, end, iss, errorstate, &time04);
VERIFY( time01.tm_hour == time_bday.tm_hour );
- VERIFY( *is_it04 == 'a');
+ VERIFY( *is_it04 == L'a' );
VERIFY( errorstate == ios_base::failbit );
// inspection of named locales, de_DE
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
index 065b13cf788..782b4e70d34 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_weekday/wchar_t/1.cc
@@ -85,7 +85,7 @@ void test01()
tim_get.get_weekday(is_it03, end, iss, errorstate, &time03);
VERIFY( time03.tm_wday == time_bday.tm_wday );
VERIFY( errorstate == good );
- VERIFY( *is_it03 == ' ');
+ VERIFY( *is_it03 == L' ' );
iss.str(L"San");
iterator_type is_it04(iss);
@@ -94,7 +94,7 @@ void test01()
errorstate = good;
tim_get.get_weekday(is_it04, end, iss, errorstate, &time04);
VERIFY( time04.tm_wday == 4 );
- VERIFY( *is_it04 == 'n');
+ VERIFY( *is_it04 == L'n' );
VERIFY( errorstate == ios_base::failbit );
iss.str(L"Tuesday ");
@@ -104,7 +104,7 @@ void test01()
tim_get.get_weekday(is_it05, end, iss, errorstate, &time05);
VERIFY( time05.tm_wday == 2 );
VERIFY( errorstate == good );
- VERIFY( *is_it05 == ' ');
+ VERIFY( *is_it05 == L' ' );
iss.str(L"Tuesducky "); // Kind of like Fryday, without the swirls.
iterator_type is_it06(iss);
@@ -114,7 +114,7 @@ void test01()
tim_get.get_weekday(is_it06, end, iss, errorstate, &time06);
VERIFY( time06.tm_wday == 4 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it05 == 'u');
+ VERIFY( *is_it05 == L'u' );
}
int main()
diff --git a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
index 5aa77c9519f..578d18f7e04 100644
--- a/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
+++ b/libstdc++-v3/testsuite/22_locale/time_get/get_year/wchar_t/1.cc
@@ -76,7 +76,7 @@ void test01()
tim_get.get_year(is_it02, end, iss, errorstate, &time02);
VERIFY( time02.tm_year == time_bday.tm_year );
VERIFY( errorstate == good );
- VERIFY( *is_it02 == ' ');
+ VERIFY( *is_it02 == L' ' );
iss.str(L"197d1 ");
iterator_type is_it03(iss);
@@ -86,7 +86,7 @@ void test01()
tim_get.get_year(is_it03, end, iss, errorstate, &time03);
VERIFY( time03.tm_year == 3 );
VERIFY( errorstate == ios_base::failbit );
- VERIFY( *is_it03 == 'd');
+ VERIFY( *is_it03 == L'd' );
iss.str(L"71d71");
iterator_type is_it04(iss);
@@ -95,7 +95,7 @@ void test01()
tim_get.get_year(is_it04, end, iss, errorstate, &time04);
VERIFY( time04.tm_year == time_bday.tm_year );
VERIFY( errorstate == good );
- VERIFY( *is_it03 == 'd');
+ VERIFY( *is_it03 == L'd' );
iss.str(L"71");
iterator_type is_it05(iss);
diff --git a/libstdc++-v3/testsuite/23_containers/list/operators/4.cc b/libstdc++-v3/testsuite/23_containers/list/operators/4.cc
index 5de95b9eb5e..bbebfb59a23 100644
--- a/libstdc++-v3/testsuite/23_containers/list/operators/4.cc
+++ b/libstdc++-v3/testsuite/23_containers/list/operators/4.cc
@@ -76,14 +76,18 @@ test04()
CompLastLt::reset();
list0401.merge(list0402, lt);
VERIFY(list0401 == list0404);
+#ifndef _GLIBCXX_DEBUG
VERIFY(lt.count() <= (N + M - 1));
+#endif
CompLastEq eq;
CompLastEq::reset();
list0401.unique(eq);
VERIFY(list0401 == list0405);
+#ifndef _GLIBCXX_DEBUG
VERIFY(eq.count() == (N + M - 1));
+#endif
}
int main()
diff --git a/libstdc++-v3/testsuite/23_containers/vector/resize/1.cc b/libstdc++-v3/testsuite/23_containers/vector/resize/1.cc
index 5f8a9de547f..c8e07cd54c7 100644
--- a/libstdc++-v3/testsuite/23_containers/vector/resize/1.cc
+++ b/libstdc++-v3/testsuite/23_containers/vector/resize/1.cc
@@ -24,7 +24,7 @@
// XXX This test will not work for irix6 because of bug(s) in libc malloc
// XXX for very large allocations. However -lmalloc seems to work.
// See http://gcc.gnu.org/ml/libstdc++/2002-12/msg00131.html
-// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+// { dg-options "-D_GLIBCXX_ASSERT -lmalloc" { target mips*-*-irix6* } }
#include <vector>
#include <stdexcept>
diff --git a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
deleted file mode 100644
index 8683de6e463..00000000000
--- a/libstdc++-v3/testsuite/24_iterators/istreambuf_iterator.cc
+++ /dev/null
@@ -1,181 +0,0 @@
-// 1999-06-28 bkoz
-
-// Copyright (C) 1999, 2001, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 24.5.3 template class istreambuf_iterator
-
-#include <sstream>
-#include <iterator>
-#include <testsuite_hooks.h>
-
-void test01()
-{
- using namespace std;
-
- // Check for required base class.
- typedef istreambuf_iterator<char> test_iterator;
- typedef char_traits<char>::off_type off_type;
- typedef iterator<input_iterator_tag, char, off_type, char*, char&> base_iterator;
-
- istringstream isstream("this tag");
- test_iterator r_it(isstream);
- base_iterator* base __attribute__((unused)) = &r_it;
-
- // Check for required typedefs
- typedef test_iterator::value_type value_type;
- typedef test_iterator::difference_type difference_type;
- typedef test_iterator::pointer pointer;
- typedef test_iterator::reference reference;
- typedef test_iterator::iterator_category iteratory_category;
-
- typedef test_iterator::char_type char_type;
- typedef test_iterator::traits_type traits_type;
- typedef test_iterator::istream_type istream_type;
- typedef test_iterator::streambuf_type streambuf_type;
-}
-
-bool test02(void)
-{
-
- typedef std::istreambuf_iterator<char> cistreambuf_iter;
- typedef cistreambuf_iter::streambuf_type cstreambuf_type;
- bool test __attribute__((unused)) = true;
- const char slit01[] = "playa hermosa, liberia, guanacaste";
- std::string str01(slit01);
- std::istringstream istrs00(str01);
- std::istringstream istrs01(str01);
-
- // ctor sanity checks
- cistreambuf_iter istrb_it01(istrs00);
- cistreambuf_iter istrb_it02;
- std::string tmp(istrb_it01, istrb_it02);
- VERIFY( tmp == str01 );
-
- cistreambuf_iter istrb_it03(0);
- cistreambuf_iter istrb_it04;
- VERIFY( istrb_it03 == istrb_it04 );
-
- cistreambuf_iter istrb_it05(istrs01);
- cistreambuf_iter istrb_it06(istrs01.rdbuf());
- VERIFY( istrb_it05 == istrb_it06 );
-
- // bool equal(istreambuf_iter& b)
- cistreambuf_iter istrb_it07(0);
- cistreambuf_iter istrb_it08;
- VERIFY( istrb_it07.equal(istrb_it08) );
- cistreambuf_iter istrb_it09(0);
- cistreambuf_iter istrb_it10;
- VERIFY( istrb_it10.equal(istrb_it09) );
-
- cistreambuf_iter istrb_it11(istrs01);
- cistreambuf_iter istrb_it12(istrs01.rdbuf());
- VERIFY( istrb_it11.equal(istrb_it12) );
- cistreambuf_iter istrb_it13(istrs01);
- cistreambuf_iter istrb_it14(istrs01.rdbuf());
- VERIFY( istrb_it14.equal(istrb_it13) );
-
- cistreambuf_iter istrb_it15(istrs01);
- cistreambuf_iter istrb_it16;
- VERIFY( !(istrb_it15.equal(istrb_it16)) );
- cistreambuf_iter istrb_it17(istrs01);
- cistreambuf_iter istrb_it18;
- VERIFY( !(istrb_it18.equal(istrb_it17)) );
-
- // bool operator==(const istreambuf_iterator&a, const istreambuf_iterator& b)
- // bool operator!=(const istreambuf_iterator&a, const istreambuf_iterator& b)
- cistreambuf_iter istrb_it19(0);
- cistreambuf_iter istrb_it20;
- VERIFY( istrb_it19 == istrb_it20 );
-
- cistreambuf_iter istrb_it21(istrs01);
- cistreambuf_iter istrb_it22(istrs01.rdbuf());
- VERIFY( istrb_it22 == istrb_it21 );
-
- cistreambuf_iter istrb_it23(istrs01);
- cistreambuf_iter istrb_it24;
- VERIFY( istrb_it23 != istrb_it24 );
-
- cistreambuf_iter istrb_it25(0);
- cistreambuf_iter istrb_it26(istrs01.rdbuf());
- VERIFY( istrb_it25 != istrb_it26 );
-
- // charT operator*() const
- // istreambuf_iterator& operator++();
- // istreambuf_iterator& operator++(int);
- cistreambuf_iter istrb_it27(istrs01.rdbuf());
- char c;
- for (std::size_t i = 0; i < sizeof(slit01) - 2; ++i)
- {
- c = *istrb_it27++;
- VERIFY( c == slit01[i] );
- }
-
- std::istringstream istrs02(str01);
- cistreambuf_iter istrb_it28(istrs02);
- for (std::size_t i = 0; i < sizeof(slit01) - 2;)
- {
- c = *++istrb_it28;
- VERIFY( c == slit01[++i] );
- }
- return test;
-}
-
-// libstdc++/2627
-void test03()
-{
- bool test __attribute__((unused)) = true;
- const std::string s("free the vieques");
-
- // 1
- std::string res_postfix;
- std::istringstream iss01(s);
- std::istreambuf_iterator<char> isbufit01(iss01);
- for (std::size_t 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 (std::size_t 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 (std::size_t j = 0; j < (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();
- test03();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc b/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
deleted file mode 100644
index 3bc6bbbcf98..00000000000
--- a/libstdc++-v3/testsuite/24_iterators/ostreambuf_iterator.cc
+++ /dev/null
@@ -1,118 +0,0 @@
-// 2001-04-30 Benjamin Kosnik <bkoz@redhat.com>
-
-// Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-//
-// This file is part of the GNU ISO C++ Library. This library is free
-// software; you can redistribute it and/or modify it under the
-// terms of the GNU General Public License as published by the
-// Free Software Foundation; either version 2, or (at your option)
-// any later version.
-
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-// GNU General Public License for more details.
-
-// You should have received a copy of the GNU General Public License along
-// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
-// USA.
-
-// 24.5.4 template class ostreambuf_iterator
-
-#include <sstream>
-#include <iterator>
-#include <testsuite_hooks.h>
-
-void test01()
-{
- using namespace std;
-
- // Check for required base class.
- typedef ostreambuf_iterator<char> test_iterator;
- typedef iterator<output_iterator_tag, void, void, void, void> base_iterator;
- ostringstream osstream("this tag");
- test_iterator r_it(osstream);
- base_iterator* base __attribute__((unused)) = &r_it;
-
- // Check for required typedefs
- typedef test_iterator::value_type value_type;
- typedef test_iterator::difference_type difference_type;
- typedef test_iterator::pointer pointer;
- typedef test_iterator::reference reference;
- typedef test_iterator::iterator_category iteratory_category;
-
- typedef test_iterator::char_type char_type;
- typedef test_iterator::traits_type traits_type;
- typedef test_iterator::ostream_type ostream_type;
- typedef test_iterator::streambuf_type streambuf_type;
-}
-
-bool test02(void)
-{
- typedef std::ostreambuf_iterator<char> costreambuf_iter;
- typedef costreambuf_iter::streambuf_type cstreambuf_type;
- bool test __attribute__((unused)) = 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 );
- return test;
-}
-
-int main()
-{
- test01();
- test02();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
index 2852d87bb68..d6b088ea3aa 100644
--- a/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
+++ b/libstdc++-v3/testsuite/24_iterators/reverse_iterator/1.cc
@@ -1,3 +1,4 @@
+// { dg-do compile }
// 2001-06-21 Benjamin Kosnik <bkoz@redhat.com>
// Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
@@ -48,9 +49,3 @@ void test01()
// Make sure iterator can be instantiated.
template class std::reverse_iterator<int*>;
-
-int main()
-{
- test01();
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/25_algorithms/heap.cc b/libstdc++-v3/testsuite/25_algorithms/heap.cc
index a62a9a819b6..6d564f2f9ee 100644
--- a/libstdc++-v3/testsuite/25_algorithms/heap.cc
+++ b/libstdc++-v3/testsuite/25_algorithms/heap.cc
@@ -95,13 +95,17 @@ test02()
for (int i = 2; i <= N; ++i) {
std::push_heap(s1, s1 + i, gt);
+#ifndef _GLIBCXX_DEBUG
VERIFY(gt.count() <= logN);
+#endif
gt.reset();
}
for (int i = N; i >= 2; --i) {
std::pop_heap(s1, s1 + i, gt);
+#ifndef _GLIBCXX_DEBUG
VERIFY(gt.count() <= 2 * logN);
+#endif
gt.reset();
}
@@ -113,11 +117,15 @@ test02()
VERIFY(std::equal(s2, s2 + N, A));
std::make_heap(s2, s2 + N, gt);
+#ifndef _GLIBCXX_DEBUG
VERIFY(gt.count() <= 3 * N);
+#endif
gt.reset();
std::sort_heap(s2, s2 + N, gt);
+#ifndef _GLIBCXX_DEBUG
VERIFY(gt.count() <= N * logN);
+#endif
VERIFY(std::equal(s2, s2 + N, C));
}
diff --git a/libstdc++-v3/testsuite/26_numerics/complex_value.cc b/libstdc++-v3/testsuite/26_numerics/complex_value.cc
index 62720c621f3..edb8f33c544 100644
--- a/libstdc++-v3/testsuite/26_numerics/complex_value.cc
+++ b/libstdc++-v3/testsuite/26_numerics/complex_value.cc
@@ -1,4 +1,4 @@
-// { dg-options "-O0" }
+// { dg-options "-D_GLIBCXX_ASSERT -O0" }
// 2000-11-20
// Benjamin Kosnik bkoz@redhat.com
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc
index 6cb9e6e8b3f..6523af7bb10 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/3.cc
@@ -56,9 +56,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc
new file mode 100644
index 00000000000..a6c27000833
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/12790-1.cc
@@ -0,0 +1,78 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_close_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out | ios_base::trunc);
+ fb.sputc(character::from_char('b'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+
+ // Check that close() writes unshift sequence
+ fb.close();
+
+ fb.open(name, ios_base::in | ios_base::out | ios_base::ate);
+
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+
+ fb.close();
+
+ fb.open(name, ios_base::in);
+
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc
new file mode 100644
index 00000000000..cc68efb6f3c
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-1.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::close() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_close_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.close();
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc
new file mode 100644
index 00000000000..2e166822483
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-2.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::close() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_close_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+ fb.in_avail(); // showmanyc() should have no effect on close().
+
+ VERIFY( !cvt->unshift_called );
+ fb.close();
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc
new file mode 100644
index 00000000000..0e3629a0be5
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-3.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return codecvt_base::error;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::close() should fail if codecvt::unshift() fails
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_close_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ filebuf* ret = fb.close();
+ VERIFY( cvt->unshift_called );
+ VERIFY( ret == NULL );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc
new file mode 100644
index 00000000000..c0efd7f2743
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/12790-4.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::close() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_close_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+ fb.pubsync(); // Does not call unshift()
+
+ VERIFY( !cvt->unshift_called );
+ fb.close();
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
index 90107cd72a9..cee52eebe45 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/4879.cc
@@ -35,6 +35,11 @@
#include <sys/stat.h>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// libstdc++/2913, libstdc++/4879
// John Fardo <jfardo@laurelnetworks.com>, Brad Garcia <garsh@attbi.com>
void
@@ -97,4 +102,4 @@ main()
return 0;
}
-
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
index 895c0956e23..70b8b34bbe1 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/close/char/9964.cc
@@ -34,6 +34,11 @@
#include <sys/stat.h>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// libstdc++/9964
void test_07()
{
@@ -79,3 +84,5 @@ main()
test_07();
return 0;
}
+
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc
new file mode 100644
index 00000000000..6eb5d9ae799
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13007.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class Buf : public std::filebuf
+{
+public:
+ std::locale before;
+ std::locale after;
+
+protected:
+ void imbue(const std::locale& loc)
+ {
+ before = getloc();
+
+ std::filebuf::imbue(loc);
+
+ after = getloc();
+ }
+};
+
+// libstdc++/13007
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ Buf buf;
+ std::locale loc(__gnu_test::try_named_locale("fr_FR"));
+
+ buf.pubimbue(loc);
+
+ VERIFY( buf.getloc() == loc );
+ VERIFY( buf.before == std::locale::classic() );
+ VERIFY( buf.after == std::locale::classic() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc
index 8b313b3f31f..672394ac829 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-1.cc
@@ -1,5 +1,3 @@
-// 2003-02-11 Paolo Carlini <pcarlini@unitus.it>
-
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -18,19 +16,30 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// stdio_filebuf.h
+// 27.8.1.4 Overridden virtual functions
-#include <ext/stdio_filebuf.h>
+#include <fstream>
+#include <locale>
#include <testsuite_hooks.h>
-// { dg-do compile }
-
-// libstdc++/9320
-namespace test
+// libstdc++/13171
+void test01()
{
+ bool test __attribute__((unused)) = true;
using namespace std;
- using __gnu_test::pod_char;
- typedef short type_t;
- template class __gnu_cxx::stdio_filebuf<type_t, char_traits<type_t> >;
- template class __gnu_cxx::stdio_filebuf<pod_char, char_traits<pod_char> >;
-} // test
+
+ filebuf fb;
+
+ fb.pubimbue(__gnu_test::try_named_locale("en_US"));
+ fb.pubimbue(__gnu_test::try_named_locale("en_US"));
+
+ fb.open("tmp_13171-1", ios_base::out);
+ fb.sputc('F');
+ fb.pubsync();
+ fb.close();
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc
new file mode 100644
index 00000000000..d3ac7e15699
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-2.cc
@@ -0,0 +1,78 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+
+#include <testsuite_hooks.h>
+
+// { dg-do run }
+
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
+// libstdc++/13171
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ locale loc_fr(__gnu_test::try_named_locale("fr_FR"));
+ locale loc_en(__gnu_test::try_named_locale("en_US"));
+
+ const char* name = "tmp_fifo_13171-2";
+ unlink(name);
+ mkfifo(name, S_IRWXU);
+
+ int child = fork();
+ if (child == 0)
+ {
+ filebuf fb;
+ fb.open(name, ios_base::out);
+ fb.sputc('S');
+ fb.pubsync();
+ sleep(2);
+ fb.close();
+ exit(0);
+ }
+
+ filebuf fb;
+ fb.pubimbue(loc_fr);
+ fb.open(name, ios_base::in);
+ sleep(1);
+ VERIFY( fb.is_open() );
+ fb.pubimbue(loc_en);
+ filebuf::int_type c = fb.sgetc();
+ fb.close();
+ VERIFY( c == 'S' );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
+
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc
new file mode 100644
index 00000000000..497a35fea72
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc
@@ -0,0 +1,54 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+protected:
+ int do_encoding() const throw()
+ { return -1; }
+
+ bool do_always_noconv() const throw()
+ { return false; }
+};
+
+// libstdc++/13171
+int test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ filebuf fb;
+ fb.pubimbue(locale(__gnu_test::try_named_locale("en_US"),
+ new Cvt));
+ fb.open("tmp_13171-4", ios_base::out);
+ fb.pubimbue(__gnu_test::try_named_locale("fr_FR"));
+ fb.sputc('N');
+ fb.pubsync();
+ fb.close();
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
index f10ff4f8c40..14842bc6fc7 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/2.cc
@@ -41,10 +41,10 @@ void test02()
pos_type p = ob.pubseekoff(2, ios_base::beg, ios_base::in);
VERIFY( p != bad);
- // 1 "if file is not positioned at its beginning" fails...
+ // According to 27.5.2.2.1, loc == getloc() after pubimbue(loc).
locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
- VERIFY( ob.getloc() == loc );
+ VERIFY( ob.getloc() == loc_de );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc
index 0cd5d0f27fd..868ea59cea9 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/char/3.cc
@@ -42,7 +42,8 @@ void test03()
ob.pubimbue(loc_s);
VERIFY( ob.getloc() == loc_s );
- // 2 "if encoding of current locale is state dependent" fails...
+ // 2 "if encoding of current locale is state dependent" and
+ // not at the beginning of the file fails...
locale loc_c = locale::classic();
locale ret = ob.pubimbue(loc_s);
VERIFY( ob.getloc() == loc_s );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc
new file mode 100644
index 00000000000..67fccda2099
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/12868.cc
@@ -0,0 +1,60 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <ostream>
+#include <fstream>
+#include <locale>
+#include <string>
+#include <testsuite_hooks.h>
+
+// libstdc++/12868
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc_is(__gnu_test::try_named_locale("is_IS.UTF-8"));
+
+ {
+ wofstream out("tmp_12868");
+ out << L"<? xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
+ out.imbue(loc_is);
+ VERIFY( out.rdbuf()->getloc() == loc_is );
+ out << L"<greeting>Hall\u00f3 heimur</greeting>\n";
+ }
+
+ {
+ wifstream in("tmp_12868");
+ wstring str;
+ getline(in, str);
+ if (str.find(L"encoding=\"UTF-8\"") != wstring::npos)
+ {
+ in.imbue(loc_is);
+ VERIFY( in.rdbuf()->getloc() == loc_is );
+ }
+ getline(in, str);
+ VERIFY( str == L"<greeting>Hall\u00f3 heimur</greeting>" );
+ }
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc
new file mode 100644
index 00000000000..db3e5360a06
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13007.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class Buf : public std::wfilebuf
+{
+public:
+ std::locale before;
+ std::locale after;
+
+protected:
+ void imbue(const std::locale& loc)
+ {
+ before = getloc();
+
+ std::wfilebuf::imbue(loc);
+
+ after = getloc();
+ }
+};
+
+// libstdc++/13007
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ Buf buf;
+ std::locale loc(__gnu_test::try_named_locale("fr_FR"));
+
+ buf.pubimbue(loc);
+
+ VERIFY( buf.getloc() == loc );
+ VERIFY( buf.before == std::locale::classic() );
+ VERIFY( buf.after == std::locale::classic() );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc
new file mode 100644
index 00000000000..c2864e735d1
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/13171-3.cc
@@ -0,0 +1,56 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <iostream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+// libstdc++/13171
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ using namespace std;
+
+ locale::global(__gnu_test::try_named_locale("fr_FR"));
+
+ ios_base::sync_with_stdio(false);
+
+ locale::global(__gnu_test::try_named_locale("en_US"));
+ cin.imbue(__gnu_test::try_named_locale("en_US"));
+ cout.imbue(__gnu_test::try_named_locale("en_US"));
+ cerr.imbue(__gnu_test::try_named_locale("en_US"));
+ clog.imbue(__gnu_test::try_named_locale("de_DE"));
+ wcin.imbue(__gnu_test::try_named_locale("en_US"));
+ wcout.imbue(__gnu_test::try_named_locale("en_US"));
+ wcerr.imbue(__gnu_test::try_named_locale("en_US"));
+ wclog.imbue(__gnu_test::try_named_locale("de_DE"));
+
+ cout << 'f' << endl;
+ cerr << 'r' << endl;
+ clog << 'A' << endl;
+ wcout << L's' << endl;
+ wcerr << L'i' << endl;
+ wclog << L'L' << endl;
+}
+
+int main()
+{
+ test01();
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
index c47a6faac51..1def258c7d6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/2.cc
@@ -41,10 +41,10 @@ void test02()
pos_type p = ob.pubseekoff(2, ios_base::beg, ios_base::in);
VERIFY( p != bad);
- // 1 "if file is not positioned at its beginning" fails...
+ // According to 27.5.2.2.1, p1, loc == getloc() after pubimbue(loc).
locale loc_de = __gnu_test::try_named_locale("de_DE");
locale ret = ob.pubimbue(loc_de);
- VERIFY( ob.getloc() == loc );
+ VERIFY( ob.getloc() == loc_de );
}
int main()
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc
index 067e48784b2..5825f63fb23 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/imbue/wchar_t/3.cc
@@ -42,7 +42,8 @@ void test03()
ob.pubimbue(loc_s);
VERIFY( ob.getloc() == loc_s );
- // 2 "if encoding of current locale is state dependent" fails...
+ // 2 "if encoding of current locale is state dependent" and
+ // not at the beginning of the file fails...
locale loc_c = locale::classic();
locale ret = ob.pubimbue(loc_s);
VERIFY( ob.getloc() == loc_s );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc
new file mode 100644
index 00000000000..d37972b6e3e
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/12790-1.cc
@@ -0,0 +1,60 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.3 filebuf member functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_open_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(character::from_char('b'));
+ fb.close();
+
+ // Check that reopened basic_filebuf begins in the initial state.
+ fb.open(name, ios_base::in);
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('b')) );
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
index 85eeededdd2..d3dabc4a169 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/open/char/9507.cc
@@ -34,6 +34,11 @@
#include <sys/stat.h>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// libstdc++/9507
void test_06()
{
@@ -67,4 +72,4 @@ main()
return 0;
}
-
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc
index 70788e31aaa..c4e45fb9add 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-1.cc
@@ -32,7 +32,7 @@ void test01()
fb.pubimbue(loc);
fb.pubsetbuf(0, 0);
fb.open("tmp_11305-1", ios_base::out);
- wfilebuf::int_type n1 = fb.sputc(L'e');
+ wfilebuf::int_type n1 = fb.sputc(0x20000000);
wfilebuf* f = fb.close();
VERIFY( n1 != wfilebuf::traits_type::eof() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc
index 0e6297a0add..5e1d0968774 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-2.cc
@@ -32,8 +32,8 @@ void test02()
fb.pubimbue(loc);
fb.pubsetbuf(0, 0);
fb.open("tmp_11305-2", ios_base::out);
- wfilebuf::int_type n1 = fb.sputc(L'n');
- wfilebuf::int_type n2 = fb.sputc(L'e');
+ wfilebuf::int_type n1 = fb.sputc(0x20000000);
+ wfilebuf::int_type n2 = fb.sputc(0x40000000);
wfilebuf* f = fb.close();
VERIFY( n1 != wfilebuf::traits_type::eof() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc
index 9558393d484..02f8363d7d6 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-3.cc
@@ -31,7 +31,7 @@ void test03()
locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fb.pubimbue(loc);
fb.open("tmp_11305-3", ios_base::out);
- wfilebuf::int_type n1 = fb.sputc(L'a');
+ wfilebuf::int_type n1 = fb.sputc(0x20000000);
wfilebuf* f = fb.close();
VERIFY( n1 != wfilebuf::traits_type::eof() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc
index 7e6010d5737..3a04d81daaf 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/overflow/wchar_t/11305-4.cc
@@ -31,8 +31,8 @@ void test04()
locale loc(__gnu_test::try_named_locale("en_US.UTF-8"));
fb.pubimbue(loc);
fb.open("tmp_11405-4", ios_base::out);
- wfilebuf::int_type n1 = fb.sputc(L'i');
- wfilebuf::int_type n2 = fb.sputc(L'a');
+ wfilebuf::int_type n1 = fb.sputc(0x20000000);
+ wfilebuf::int_type n2 = fb.sputc(0x40000000);
wfilebuf* f = fb.close();
VERIFY( n1 != wfilebuf::traits_type::eof() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc
index 0d218a60aa6..14f0870517f 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/10132-2.cc
@@ -54,9 +54,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc
new file mode 100644
index 00000000000..79a625169eb
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-1.cc
@@ -0,0 +1,82 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.close();
+
+ fb.open(name, ios_base::in);
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+
+ // Check that seekoff calls codecvt::length with the correct state.
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::cur);
+ VERIFY( pos != traits_type::pos_type(traits_type::off_type(-1)) );
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+ fb.sbumpc();
+ fb.sbumpc();
+ c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+ c = fb.sbumpc();
+ VERIFY( c == traits_type::eof() );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc
new file mode 100644
index 00000000000..5966e1721b8
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-2.cc
@@ -0,0 +1,85 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char('a'));
+ fb.close();
+
+ fb.open(name, ios_base::in);
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+
+ // Check that seekoff resets the state when seeking to beginning.
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::beg);
+ VERIFY( pos != traits_type::pos_type(traits_type::off_type(-1)) );
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char(0xff)) );
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+ fb.sbumpc();
+ c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+ c = fb.sbumpc();
+ VERIFY( c == traits_type::eof() );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc
new file mode 100644
index 00000000000..42a17955582
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-3.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out | ios_base::trunc);
+ fb.sputc(character::from_char('b'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0xfc));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+
+ fb.close();
+ fb.open(name, ios_base::in);
+
+ fb.sbumpc();
+ fb.sbumpc();
+
+ // Check that seekoff returns the correct state
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::cur);
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+ fb.sbumpc();
+
+ fb.pubseekpos(pos);
+
+ c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc
new file mode 100644
index 00000000000..d246657d1e7
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/12790-4.cc
@@ -0,0 +1,71 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+ fb.sputc(character::from_char('b'));
+ fb.sputc(character::from_char(0xff));
+
+ // Check that seekoff sets the current state during output
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::cur);
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+
+ fb.pubseekoff(0, ios_base::beg);
+ fb.sbumpc();
+ fb.sbumpc();
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc
new file mode 100644
index 00000000000..a6340233201
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-1.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc
new file mode 100644
index 00000000000..006078ad977
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-2.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc
new file mode 100644
index 00000000000..b56a5e9a990
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-3.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift(),
+// but only if writing
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( !cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc
new file mode 100644
index 00000000000..69752b2cb46
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/char/12790-4.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc('a');
+ fb.pubsync(); // Does not call unshift()
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc
new file mode 100644
index 00000000000..bf70ecd5f3c
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-1.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(L'a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc
new file mode 100644
index 00000000000..748ae3a086c
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-2.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(L'a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc
new file mode 100644
index 00000000000..6db1648cab8
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-3.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift(),
+// but only if writing
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( !cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc
new file mode 100644
index 00000000000..b6af7fbe7ff
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/12790-4.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekoff() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ fb.sputc(L'a');
+ fb.pubsync(); // Does not call unshift()
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekoff(0, ios_base::cur);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc
new file mode 100644
index 00000000000..3088e5ff944
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekoff/wchar_t/3.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test03()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekoff_3";
+
+ wfilebuf fb;
+
+ fb.open(name, ios_base::out);
+ fb.sputc(0xf001);
+
+ // seekoff should flush the output sequence, which will fail
+ // if the output buffer contains illegal characters.
+ streampos ret = fb.pubseekoff(0, ios_base::cur);
+ VERIFY( ret == streampos(streamoff(-1)) );
+}
+
+int main()
+{
+ test03();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc
index fdb817dce2a..85b80a1329e 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/10132-3.cc
@@ -54,9 +54,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc
new file mode 100644
index 00000000000..3201da8478c
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-1.cc
@@ -0,0 +1,66 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::cur);
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+
+ // Check that seekpos restores the state correctly
+ fb.pubseekpos(pos);
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc
new file mode 100644
index 00000000000..b5198e53b90
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-2.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out | ios_base::trunc);
+ fb.sputc(character::from_char('b'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0xfc));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+
+ fb.close();
+ fb.open(name, ios_base::in);
+
+ fb.sbumpc();
+ fb.sbumpc();
+ traits_type::pos_type pos1 = fb.pubseekoff(0, ios_base::cur);
+ fb.sbumpc();
+ fb.sbumpc();
+
+ // Check that seekpos returns the correct state
+ traits_type::pos_type pos2 = fb.pubseekpos(pos1);
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+ fb.sbumpc();
+
+ fb.pubseekpos(pos2);
+ c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc
new file mode 100644
index 00000000000..1d0535c72c5
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/12790-3.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+#include <testsuite_character.h>
+
+// libstdc++/12790
+void test01()
+{
+ using namespace std;
+ using __gnu_test::character;
+ typedef basic_filebuf<character>::traits_type traits_type;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ locale loc(locale::classic(),
+ new codecvt<traits_type::char_type, char,
+ traits_type::state_type>);
+
+ basic_filebuf<character> fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+ fb.sputc(character::from_char('b'));
+ fb.sputc(character::from_char(0xff));
+ fb.sputc(character::from_char('c'));
+ fb.sputc(character::from_char(0xff));
+
+ fb.pubseekoff(0, ios_base::beg);
+ fb.sbumpc();
+ fb.sbumpc();
+ traits_type::pos_type pos = fb.pubseekoff(0, ios_base::cur);
+ fb.sbumpc();
+ fb.sbumpc();
+
+ // Check that seekoff sets the current state for output
+ fb.pubseekpos(pos);
+
+ fb.sputc(character::from_char('a'));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+ fb.sputc(character::from_char(0));
+
+ fb.pubseekpos(pos);
+
+ traits_type::int_type c = fb.sbumpc();
+ VERIFY( c != traits_type::eof() );
+ VERIFY( traits_type::eq(traits_type::to_char_type(c),
+ character::from_char('a')) );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc
index eea3be8108f..588a1b27ccb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-io.cc
@@ -88,7 +88,7 @@ void test05()
VERIFY( off_1 > off_2 );
fb.sputn("\nof the wonderful things he does!!\nok", 37);
fb.pubsync();
- VERIFY( !fb.write_position() );
+ VERIFY( fb.write_position() );
VERIFY( !fb.read_position() );
fb.close();
VERIFY( !fb.is_open() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
index cc29a27204d..c684786fe00 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/1-out.cc
@@ -90,7 +90,7 @@ void test05()
VERIFY( off_1 > off_2 );
fb.sputn("\nof the wonderful things he does!!\nok", 37);
fb.pubsync();
- VERIFY( !fb.write_position() );
+ VERIFY( fb.write_position() );
VERIFY( !fb.read_position() );
fb.close();
VERIFY( !fb.is_open() );
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc
new file mode 100644
index 00000000000..2c31c8a248a
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-1.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc
new file mode 100644
index 00000000000..42b10230bf1
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-2.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc('a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc
new file mode 100644
index 00000000000..e168c945952
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-3.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift(),
+// but only if writing
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( !cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc
new file mode 100644
index 00000000000..0bf84cbfdd5
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/char/12790-4.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<char, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ filebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc('a');
+ fb.pubsync(); // Does not call unshift()
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc
new file mode 100644
index 00000000000..c543212b19e
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/1.cc
@@ -0,0 +1,46 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_1";
+
+ wfilebuf fb;
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc(0xf001);
+
+ streampos ret = fb.pubseekpos(pos);
+ VERIFY( ret == streampos(streamoff(-1)) );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc
new file mode 100644
index 00000000000..718589e8cdf
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-1.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc(L'a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc
new file mode 100644
index 00000000000..220a48c79ea
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-2.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubsetbuf(0, 0);
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc(L'a');
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc
new file mode 100644
index 00000000000..eaa3cb6976b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-3.cc
@@ -0,0 +1,80 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift(),
+// but only if writing
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( !cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc
new file mode 100644
index 00000000000..70d36c8482b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/seekpos/wchar_t/12790-4.cc
@@ -0,0 +1,81 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <locale>
+#include <fstream>
+#include <testsuite_hooks.h>
+
+class Cvt : public std::codecvt<wchar_t, char, std::mbstate_t>
+{
+public:
+ mutable bool unshift_called;
+
+ Cvt()
+ : unshift_called(false)
+ { }
+
+protected:
+ bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ int
+ do_encoding() const throw()
+ { return -1; }
+
+ std::codecvt_base::result
+ do_unshift(std::mbstate_t&, char* to, char*, char*& to_next) const
+ {
+ unshift_called = true;
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+};
+
+// libstdc++/12790
+// basic_filebuf::seekpos() should call codecvt::unshift()
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_seekpos_12790";
+
+ Cvt* cvt = new Cvt;
+ locale loc(locale::classic(), cvt);
+
+ wfilebuf fb;
+ fb.pubimbue(loc);
+
+ fb.open(name, ios_base::out);
+ streampos pos = fb.pubseekoff(0, ios_base::beg);
+ fb.sputc(L'a');
+ fb.pubsync(); // Does not call unshift()
+
+ VERIFY( !cvt->unshift_called );
+ fb.pubseekpos(pos);
+ VERIFY( cvt->unshift_called );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc
index 1ef57eecb21..5013b87fcf9 100644
--- a/libstdc++-v3/testsuite/ext/stdio_filebuf_2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-1.cc
@@ -1,5 +1,3 @@
-// 2003-04-12 Paolo Carlini <pcarlini at unitus dot it>
-
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -18,42 +16,42 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
-// stdio_filebuf.h
+// 27.8.1.4 Overridden virtual functions
-#include <ext/stdio_filebuf.h>
-#include <cstdio>
#include <fstream>
+#include <cstdio>
+#include <cstring>
#include <testsuite_hooks.h>
-// Small stack-based buffers (i.e., using _M_unbuf) were not flushed
-// out by _M_really_overflow upon overflow.
+// libstdc++/12875
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
- const char* name = "tmp_file1";
- FILE* file = fopen(name, "w");
- {
- using namespace __gnu_cxx;
- stdio_filebuf<char> sbuf(file, ios_base::out, 2);
- sbuf.sputc('T');
- sbuf.sputc('S');
- sbuf.sputc('P');
- }
- fclose(file);
-
- filebuf fbuf;
- fbuf.open(name, ios_base::in);
- char buf[10];
- streamsize n = fbuf.sgetn(buf, sizeof(buf));
- fbuf.close();
+ const char* name = "tmp_setbuf4";
+ static char buf[1024];
+
+ FILE* out = fopen(name, "w");
+ fputs("Hello, world", out);
+ fclose(out);
- VERIFY( n == 3 );
- VERIFY( !memcmp(buf, "TSP", 3) );
+ filebuf in;
+ in.open(name, ios_base::in);
+ char str[256];
+ streamsize r = in.sgetn(str, 6);
+ VERIFY( r == 6 );
+ VERIFY( !memcmp(str, "Hello,", 6) );
+ in.pubsetbuf(buf, 1024);
+ r = in.sgetn(str, 6);
+ VERIFY( r == 6 );
+ VERIFY( !memcmp(str, " world", 6) );
+ in.close();
}
+// libstdc++/12875
int main()
{
test01();
+ return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc
new file mode 100644
index 00000000000..c50a5ed4a12
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/12875-2.cc
@@ -0,0 +1,55 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <cstdio>
+#include <cstring>
+#include <testsuite_hooks.h>
+
+// libstdc++/12875
+void test02()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ const char* name = "tmp_setbuf5";
+ static char buf[1024];
+
+ filebuf out;
+ out.open(name, ios_base::out);
+ streamsize r = out.sputn("Hello,", 6);
+ VERIFY( r == 6 );
+ out.pubsetbuf(buf, 1024);
+ r = out.sputn(" world", 6);
+ VERIFY( r == 6 );
+ VERIFY( out.close() );
+
+ FILE* in = fopen(name, "r");
+ char str[256];
+ fgets(str, 256, in);
+ VERIFY( !strcmp(str, "Hello, world") );
+ fclose(in);
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
index 7cca957e17f..524935a1c84 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/2.cc
@@ -32,8 +32,8 @@ void test01()
const char* strlit = "how to tell a story and other essays: mark twain";
const size_t strlitsize = std::strlen(strlit);
filebuf fbuf;
- fbuf.open("tmp_setbuf2", ios_base::out);
fbuf.pubsetbuf(buf, 512);
+ fbuf.open("tmp_setbuf2", ios_base::out);
fbuf.sputn(strlit, strlitsize);
VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
index b5512d76534..11702dc0336 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/setbuf/char/3.cc
@@ -23,7 +23,7 @@
#include <fstream>
#include <testsuite_hooks.h>
-void test02()
+void test03()
{
using namespace std;
@@ -32,17 +32,17 @@ void test02()
const char* strlit = "how to tell a story and other essays: mark twain";
const size_t strlitsize = std::strlen(strlit);
filebuf fbuf01;
- fbuf01.open("tmp", ios_base::out);
-
// NB: +2 otherwise sputn is optimized to a direct write,
// bypassing the buffer.
fbuf01.pubsetbuf(buf, strlitsize + 2);
+ fbuf01.open("tmp_setbuf3", ios_base::out);
+
fbuf01.sputn(strlit, strlitsize);
VERIFY( std::strncmp(strlit, buf, strlitsize) == 0 );
}
int main()
{
- test02();
+ test03();
return 0;
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
index 8f6d83c0597..50e5475a744 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-in.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
index dd2ea4736f4..f35d0dde58a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/1-io.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
index e77cfee94d7..f02babec182 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-in.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
index 90f00879132..f4f5113aa43 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sgetn/char/2-io.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
// 27.8.1.4 Overridden virtual functions
#include <fstream>
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc
index 057f72de32c..a79e65128fb 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/showmanyc/char/9533-1.cc
@@ -29,6 +29,11 @@
#include <fstream>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// libstdc++/9533
void test_01()
{
@@ -94,3 +99,4 @@ main()
return 0;
}
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc
new file mode 100644
index 00000000000..202cc38d60a
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/sync/char/1.cc
@@ -0,0 +1,52 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <testsuite_hooks.h>
+
+void test01()
+{
+ using namespace std;
+
+ bool test __attribute__((unused)) = true;
+ const char* name = "tmp_sync_1";
+
+ filebuf fb;
+
+ fb.open(name, ios_base::in | ios_base::out | ios_base::trunc);
+ fb.sputn("abc", 3);
+
+ fb.pubseekoff(0, ios_base::beg);
+ fb.sputc('1');
+
+ // Sync can't be used to switch from write mode to read mode.
+ fb.pubsync();
+
+ filebuf::int_type c = fb.sbumpc();
+ VERIFY( c == filebuf::traits_type::eof() );
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
index 156421092dd..aa1dd649562 100644
--- a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/char/10097.cc
@@ -31,6 +31,11 @@
#include <sys/stat.h>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
class UnderBuf : public std::filebuf
{
public:
@@ -102,3 +107,5 @@ int main()
test16();
return 0;
}
+
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc
new file mode 100644
index 00000000000..91d92e4d127
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-1.cc
@@ -0,0 +1,185 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+template <typename InternT, typename StateT = mbstate_t>
+class checksumcvt : public std::codecvt<InternT, char, StateT>
+{
+ typedef std::codecvt<InternT, char, StateT> Base;
+ static const size_t width = sizeof(InternT) + 1;
+
+public:
+ typedef InternT intern_type;
+ typedef char extern_type;
+
+ explicit checksumcvt(size_t refs = 0)
+ : Base(refs)
+ { }
+
+protected:
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_out(StateT&, const intern_type* from,
+ const intern_type* from_end, const intern_type*& from_next,
+ extern_type* to, extern_type* to_end,
+ extern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(from_end - from),
+ static_cast<size_t>(to_end - to) / width);
+
+ while (len--)
+ {
+ const char* p = reinterpret_cast<const char*>(from);
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ *to++ = p[i];
+ checksum ^= static_cast<unsigned char>(p[i]);
+ }
+
+ *to++ = checksum;
+ ++from;
+ }
+
+ from_next = from;
+ to_next = to;
+ return from_next == from_end ? std::codecvt<InternT, char, StateT>::ok
+ : std::codecvt<InternT, char, StateT>::partial;
+ }
+
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_unshift(StateT&, extern_type* to,
+ extern_type*, extern_type*& to_next) const
+ {
+ to_next = to;
+ return std::codecvt<InternT, char, StateT>::ok;
+ }
+
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_in(StateT&, const extern_type* from,
+ const extern_type* from_end, const extern_type*& from_next,
+ intern_type* to, intern_type* to_end,
+ intern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(to_end - to),
+ static_cast<size_t>(from_end - from) / width);
+
+ while (len)
+ {
+ const char* f = from;
+ intern_type tmp;
+ char* p = reinterpret_cast<char*>(&tmp);
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ p[i] = *f;
+ checksum ^= static_cast<unsigned char>(*f++);
+ }
+
+ if (*f++ != checksum)
+ break;
+
+ from = f;
+ *to++ = tmp;
+ len--;
+ }
+
+ from_next = from;
+ to_next = to;
+ return len ? std::codecvt<InternT, char, StateT>::error :
+ (from_next == from_end ? std::codecvt<InternT, char, StateT>::ok
+ : std::codecvt<InternT, char, StateT>::partial);
+ }
+
+ virtual int
+ do_encoding() const throw()
+ { return width; }
+
+ virtual int
+ do_length(StateT&, const extern_type* from,
+ const extern_type* end, size_t max) const
+ {
+ size_t len = std::min(max, static_cast<size_t>(end - from) / width);
+
+ int ret = 0;
+ while (len--)
+ {
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ checksum ^= static_cast<unsigned char>(*from++);
+ }
+
+ if (*from++ != checksum)
+ break;
+
+ ret++;
+ }
+
+ return ret;
+ }
+
+ virtual int
+ do_max_length() const throw()
+ { return width; }
+
+ virtual bool
+ do_always_noconv() const throw()
+ { return false; }
+};
+
+// libstdc++/11544 (incomplete character in file)
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new checksumcvt<wchar_t>);
+
+ const char* name = "tmp_11544-1";
+
+ FILE* f = fopen(name, "w");
+ putc('a', f);
+ fclose(f);
+
+ wifstream in;
+ in.imbue(loc);
+ in.open(name);
+
+ VERIFY( in.good() );
+ in.get();
+ VERIFY( !in.good() );
+ VERIFY( in.bad() );
+ VERIFY( !in.eof() );
+
+ in.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc
new file mode 100644
index 00000000000..c5e617d7bdf
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11544-2.cc
@@ -0,0 +1,185 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <cstdio>
+#include <testsuite_hooks.h>
+
+template <typename InternT, typename StateT = mbstate_t>
+class checksumcvt : public std::codecvt<InternT, char, StateT>
+{
+ typedef std::codecvt<InternT, char, StateT> Base;
+ static const size_t width = sizeof(InternT) + 1;
+
+public:
+ typedef InternT intern_type;
+ typedef char extern_type;
+
+ explicit checksumcvt(size_t refs = 0)
+ : Base(refs)
+ { }
+
+protected:
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_out(StateT&, const intern_type* from,
+ const intern_type* from_end, const intern_type*& from_next,
+ extern_type* to, extern_type* to_end,
+ extern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(from_end - from),
+ static_cast<size_t>(to_end - to) / width);
+
+ while (len--)
+ {
+ const char* p = reinterpret_cast<const char*>(from);
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ *to++ = p[i];
+ checksum ^= static_cast<unsigned char>(p[i]);
+ }
+
+ *to++ = checksum;
+ ++from;
+ }
+
+ from_next = from;
+ to_next = to;
+ return from_next == from_end ? std::codecvt<InternT, char, StateT>::ok
+ : std::codecvt<InternT, char, StateT>::partial;
+ }
+
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_unshift(StateT&, extern_type* to,
+ extern_type*, extern_type*& to_next) const
+ {
+ to_next = to;
+ return std::codecvt<InternT, char, StateT>::ok;
+ }
+
+ virtual typename std::codecvt<InternT, char, StateT>::result
+ do_in(StateT&, const extern_type* from,
+ const extern_type* from_end, const extern_type*& from_next,
+ intern_type* to, intern_type* to_end,
+ intern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(to_end - to),
+ static_cast<size_t>(from_end - from) / width);
+
+ while (len)
+ {
+ const char* f = from;
+ intern_type tmp;
+ char* p = reinterpret_cast<char*>(&tmp);
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ p[i] = *f;
+ checksum ^= static_cast<unsigned char>(*f++);
+ }
+
+ if (*f++ != checksum)
+ break;
+
+ from = f;
+ *to++ = tmp;
+ len--;
+ }
+
+ from_next = from;
+ to_next = to;
+ return len ? std::codecvt<InternT, char, StateT>::error :
+ (from_next == from_end ? std::codecvt<InternT, char, StateT>::ok
+ : std::codecvt<InternT, char, StateT>::partial);
+ }
+
+ virtual int
+ do_encoding() const throw()
+ { return width; }
+
+ virtual int
+ do_length(StateT&, const extern_type* from,
+ const extern_type* end, size_t max) const
+ {
+ size_t len = std::min(max, static_cast<size_t>(end - from) / width);
+
+ int ret = 0;
+ while (len--)
+ {
+ unsigned char checksum = 0;
+
+ for (size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ checksum ^= static_cast<unsigned char>(*from++);
+ }
+
+ if (*from++ != checksum)
+ break;
+
+ ret++;
+ }
+
+ return ret;
+ }
+
+ virtual int
+ do_max_length() const throw()
+ { return width; }
+
+ virtual bool
+ do_always_noconv() const throw()
+ { return false; }
+};
+
+// libstdc++/11544 (invalid byte sequence in file)
+void test02()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new checksumcvt<wchar_t>);
+
+ const char* name = "tmp_11544-2";
+
+ FILE* f = fopen(name, "w");
+ fwrite("aaaab", 1, 5, f);
+ fclose(f);
+
+ wifstream in;
+ in.imbue(loc);
+ in.open(name);
+
+ VERIFY( in.good() );
+ in.get();
+ VERIFY( !in.good() );
+ VERIFY( in.bad() );
+ VERIFY( !in.eof() );
+
+ in.close();
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
new file mode 100644
index 00000000000..6b827f15b6e
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_filebuf/underflow/wchar_t/11603.cc
@@ -0,0 +1,200 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.8.1.4 Overridden virtual functions
+
+#include <fstream>
+#include <locale>
+#include <testsuite_hooks.h>
+
+template <typename InternT, typename StateT = std::mbstate_t>
+class checksumcvt : public std::codecvt<InternT, char, StateT>
+{
+ typedef std::codecvt<InternT, char, StateT> Base;
+ static const std::size_t width = sizeof(InternT) + 1;
+
+public:
+ typedef InternT intern_type;
+ typedef char extern_type;
+
+ explicit checksumcvt(std::size_t refs = 0)
+ : Base(refs)
+ { }
+
+protected:
+ virtual std::codecvt_base::result
+ do_out(StateT&, const intern_type* from,
+ const intern_type* from_end, const intern_type*& from_next,
+ extern_type* to, extern_type* to_end,
+ extern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(from_end - from),
+ static_cast<size_t>(to_end - to) / width);
+
+ while (len--)
+ {
+ const char* p =
+ reinterpret_cast<const char*>(from);
+ unsigned char checksum = 0;
+
+ for (std::size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ *to++ = p[i];
+ checksum ^= static_cast<unsigned char>(p[i]);
+ }
+
+ *to++ = checksum;
+ ++from;
+ }
+
+ from_next = from;
+ to_next = to;
+ return from_next == from_end ? std::codecvt_base::ok
+ : std::codecvt_base::partial;
+ }
+
+ virtual std::codecvt_base::result
+ do_unshift(StateT&, extern_type* to,
+ extern_type*, extern_type*& to_next) const
+ {
+ to_next = to;
+ return std::codecvt_base::ok;
+ }
+
+ virtual std::codecvt_base::result
+ do_in(StateT&, const extern_type* from,
+ const extern_type* from_end, const extern_type*& from_next,
+ intern_type* to, intern_type* to_end,
+ intern_type*& to_next) const
+ {
+ size_t len = std::min(static_cast<size_t>(to_end - to),
+ static_cast<size_t>(from_end - from) / width);
+
+ while (len)
+ {
+ const char* f = from;
+ intern_type tmp;
+ char* p = reinterpret_cast<char*>(&tmp);
+ unsigned char checksum = 0;
+
+ for (std::size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ p[i] = *f;
+ checksum ^= static_cast<unsigned char>(*f++);
+ }
+
+ if (*f++ != checksum)
+ break;
+
+ from = f;
+ *to++ = tmp;
+ len--;
+ }
+
+ from_next = from;
+ to_next = to;
+ return len ? std::codecvt_base::error :
+ (from_next == from_end ? std::codecvt_base::ok
+ : std::codecvt_base::partial);
+ }
+
+ virtual int
+ do_encoding() const throw()
+ { return width; }
+
+ virtual int
+ do_length(const StateT&, const extern_type* from,
+ const extern_type* end, size_t max) const
+ {
+ size_t len = std::min(max,
+ static_cast<size_t>(end - from) / width);
+
+ int ret = 0;
+ while (len--)
+ {
+ unsigned char checksum = 0;
+
+ for (std::size_t i = 0; i < sizeof(intern_type); ++i)
+ {
+ checksum ^= static_cast<unsigned char>(*from++);
+ }
+
+ if (*from++ != checksum)
+ break;
+
+ ret++;
+ }
+
+ return ret;
+ }
+
+ virtual int
+ do_max_length() const throw()
+ { return width; }
+
+ virtual bool
+ do_always_noconv() const throw()
+ { return false; }
+};
+
+class Buf : public std::wfilebuf
+{
+public:
+ std::streamsize pub_showmanyc()
+ { return showmanyc(); }
+ std::wfilebuf::int_type pub_underflow()
+ { return underflow(); }
+};
+
+// libstdc++/11603
+void test01()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ filebuf fbout;
+ fbout.open("tmp_11603", ios_base::out);
+ fbout.sputn("aaaab", 5);
+ fbout.close();
+
+ locale loc(locale::classic(), new checksumcvt<wchar_t>);
+
+ Buf fb;
+ fb.pubimbue(loc);
+ fb.open("tmp_11603", ios_base::in);
+ assert(fb.pub_showmanyc() == 1);
+
+ try
+ {
+ wfilebuf::int_type ret = fb.pub_underflow();
+ VERIFY( ret != wfilebuf::traits_type::eof() );
+ fb.sbumpc();
+ ret = fb.pub_underflow();
+ VERIFY( ret == wfilebuf::traits_type::eof() );
+ }
+ catch (...)
+ { }
+
+ fb.close();
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc
index c71e0e86b94..484c611cdda 100644
--- a/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_fstream/3.cc
@@ -58,9 +58,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc
index 7ffd7b3b9af..6649be318ec 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ifstream/3.cc
@@ -58,9 +58,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc
new file mode 100644
index 00000000000..b9f938e7559
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ios/exceptions/char/2.cc
@@ -0,0 +1,59 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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.4.2 basic_ios member functions
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ using namespace std;
+ ostringstream stream;
+
+ try
+ {
+ stream.setstate(ios_base::failbit);
+ stream.exceptions(ios_base::failbit);
+ assert(false);
+ }
+ catch (...)
+ {
+ // Don't clear.
+ }
+
+ try
+ {
+ // Calls clear(rdstate()), which throws in this case.
+ stream.setstate(ios_base::goodbit);
+ assert(false);
+ }
+ catch (...)
+ { }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc b/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc
index 315b651c93c..ace6cdd56ed 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/exceptions/char/9561.cc
@@ -21,44 +21,36 @@
#include <istream>
#include <streambuf>
#include <testsuite_hooks.h>
+#include <testsuite_io.h>
// libstdc++/9561
-struct foobar: std::exception { };
-
-struct buf: std::streambuf
-{
- virtual int_type underflow () {
- throw foobar ();
- return -1;
- }
- virtual int_type uflow () {
- throw foobar ();
- return -1;
- }
-};
-
void test01()
{
using namespace std;
bool test __attribute__((unused)) = true;
- buf b;
+ __gnu_test::fail_streambuf b;
std::istream strm (&b);
strm.exceptions (std::ios::badbit);
int i = 0;
- try {
- i = strm.get();
- }
- catch (foobar) {
- // strm should throw foobar and not do anything else
- VERIFY(strm.bad());
- }
- catch (...) {
- VERIFY(false);
- }
+ try
+ {
+ i = strm.get();
+ i = strm.get();
+ i = strm.get();
+ }
+ catch (__gnu_test::underflow_error&)
+ {
+ // strm should throw facet_error and not do anything else
+ VERIFY(strm.bad());
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
- VERIFY(i == 0);
+ VERIFY(i == 's');
}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc
index 5df68d5845d..08c39ee8167 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/10.cc
@@ -127,13 +127,13 @@ bool test10() {
is_05 >> f;
VERIFY( f == 0 );
is_05 >> f;
- VERIFY( f == 0 );
- VERIFY( is_05.rdstate() == std::ios_base::failbit );
+ VERIFY( f == 5.0 );
+ VERIFY( is_05.rdstate() == std::ios_base::goodbit );
is_05.clear();
is_05 >> c;
VERIFY( c == 'a' );
is_05 >> f;
- VERIFY( f == 0 );
+ VERIFY( f == 5.0 );
VERIFY( is_05.rdstate() == std::ios_base::failbit );
is_05.clear();
is_05.ignore();
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..f7c43e2b630
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_badbit_throw.cc
@@ -0,0 +1,76 @@
+// 2003-03-08 Jerry Quinn <jlquinn@optonline.net>
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+// libstdc++/9561
+template<typename T>
+void test_badbit()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new __gnu_test::fail_num_get);
+ istringstream stream("jaylib - champion sound");
+ stream.imbue(loc);
+
+ stream.exceptions(ios_base::badbit);
+ VERIFY( stream.rdstate() == ios_base::goodbit );
+
+ try
+ {
+ T i;
+ stream >> i;
+ VERIFY( false );
+ }
+ catch (const __gnu_test::facet_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+
+int main()
+{
+ test_badbit<bool>();
+ test_badbit<short>();
+ test_badbit<unsigned short>();
+ test_badbit<int>();
+ test_badbit<unsigned int>();
+ test_badbit<long>();
+ test_badbit<unsigned long>();
+
+ test_badbit<float>();
+ test_badbit<double>();
+
+ test_badbit<void*>();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc
new file mode 100644
index 00000000000..e2ffe3623d4
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit.cc
@@ -0,0 +1,75 @@
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <sstream>
+#include <testsuite_hooks.h>
+
+// libstdc++/10093
+template<typename T>
+void test_failbit()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ istringstream stream("jaylib - champion sound");
+ stream.exceptions(ios_base::failbit);
+
+ try
+ {
+ T i;
+ stream >> i;
+ VERIFY( false );
+ }
+ catch (const ios_base::failure&)
+ {
+ // stream should set failbit and throw ios_base::failure.
+ VERIFY( stream.fail() );
+ VERIFY( !stream.bad() );
+ VERIFY( !stream.eof() );
+ }
+ catch(...)
+ { VERIFY( false ); }
+}
+
+int main()
+{
+ test_failbit<bool>();
+ test_failbit<short>();
+ test_failbit<unsigned short>();
+ test_failbit<int>();
+ test_failbit<unsigned int>();
+ test_failbit<long>();
+ test_failbit<unsigned long>();
+
+ test_failbit<float>();
+ test_failbit<double>();
+
+ test_failbit<void*>();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc
new file mode 100644
index 00000000000..0b223bcbeef
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_arithmetic/char/exceptions_failbit_throw.cc
@@ -0,0 +1,78 @@
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+// libstdc++/10093
+template<typename T>
+void test_failbit()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new __gnu_test::fail_num_get);
+ istringstream stream("jaylib - champion sound");
+ stream.imbue(loc);
+
+ stream.exceptions(ios_base::failbit);
+
+ try
+ {
+ T i;
+ stream >> i;
+ }
+ catch (const ios_base::failure&)
+ { VERIFY( false ); }
+ catch(...)
+ { VERIFY( false ); }
+
+ // stream should set badbit.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+}
+
+int main()
+{
+ test_failbit<bool>();
+ test_failbit<short>();
+ test_failbit<unsigned short>();
+ test_failbit<int>();
+ test_failbit<unsigned int>();
+ test_failbit<long>();
+ test_failbit<unsigned long>();
+
+ test_failbit<float>();
+ test_failbit<double>();
+
+ test_failbit<void*>();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc
index 1900236c1f3..435e7f428af 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc
@@ -27,8 +27,7 @@
#include <istream>
#include <streambuf>
-//#include <testsuite_hooks.h>
-#define VERIFY(x) x
+#include <testsuite_hooks.h>
struct buf: std::streambuf
{
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc
new file mode 100644
index 00000000000..2079b453995
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/error_failbit.cc
@@ -0,0 +1,67 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test6()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stringbuf sbuf("", ios_base::out);
+
+ stream >> &sbuf;
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test8()
+{
+ bool test __attribute__((unused)) = true;
+ istringstream stream("foo, bar, qux");
+ __gnu_test::fail_streambuf bob;
+
+ stream >> &bob;
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test6();
+ test8();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..86c0a8a1a92
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_badbit_throw.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test14()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+ stringbuf sbuf("", ios_base::out);
+
+ try
+ {
+ stream >> &sbuf;
+ }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test16()
+{
+ bool test __attribute__((unused)) = true;
+ istringstream stream("foo, bar, qux");
+ stream.exceptions(ios_base::badbit);
+ __gnu_test::fail_streambuf bob;
+
+ try
+ {
+ stream >> &bob;
+ }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test14();
+ test16();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc
new file mode 100644
index 00000000000..199750af0bd
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_failbit_throw.cc
@@ -0,0 +1,89 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test10()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stream.exceptions(ios_base::failbit);
+ stringbuf sbuf("", ios_base::out);
+
+ try
+ {
+ stream >> &sbuf;
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ { VERIFY(false); }
+ catch (__gnu_test::underflow_error&)
+ { }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test12()
+{
+ bool test __attribute__((unused)) = true;
+ istringstream stream("foo, bar, qux");
+ stream.exceptions(ios_base::failbit);
+ __gnu_test::fail_streambuf bob;
+
+ try
+ {
+ stream >> &bob;
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ { VERIFY(false); }
+ catch (__gnu_test::overflow_error&)
+ { }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test10();
+ test12();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc
new file mode 100644
index 00000000000..8e012d13714
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/extractors_other/char/exceptions_null.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+void test2()
+{
+ bool test __attribute__((unused)) = true;
+ istringstream stream;
+ stream >> static_cast<streambuf*>(NULL);
+ VERIFY(stream.rdstate() & ios_base::failbit);
+}
+
+void test4()
+{
+ bool test __attribute__((unused)) = true;
+ istringstream stream;
+ stream.exceptions(ios_base::failbit);
+
+ try
+ {
+ stream >> static_cast<streambuf*>(NULL);
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ {
+ }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+}
+
+// libstdc++/9371
+int main()
+{
+ test2();
+ test4();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
index bf25632f967..95b421306a0 100644
--- a/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/readsome/char/6746-2.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
// 27.6.1.3 unformatted input functions
// @require@ %-*.tst %-*.txt
// @diff@ %-*.tst %-*.txt
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..bf893408064
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc
@@ -0,0 +1,96 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+
+ istream::pos_type pos;
+
+ try
+ {
+ stream.seekg(pos);
+ VERIFY( false );
+ }
+ catch (const __gnu_test::positioning_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+
+ istream::off_type off;
+
+ try
+ {
+ stream.seekg(off, ios_base::cur);
+ VERIFY( false );
+ }
+ catch (const __gnu_test::positioning_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+// libstdc++/9546
+int main()
+{
+ test01();
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc
new file mode 100644
index 00000000000..918870c54d2
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/sentry/char/12297.cc
@@ -0,0 +1,50 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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.6.1.1.2 class basic_istream::sentry
+
+#include <sstream>
+#include <testsuite_hooks.h>
+
+int main()
+{
+ using namespace std;
+ istringstream stream;
+ stream.exceptions(ios_base::eofbit);
+
+ try
+ {
+ istream::sentry sentry(stream, false);
+ VERIFY( false );
+ }
+ catch (ios_base::failure&)
+ {
+ VERIFY( stream.rdstate() == (ios_base::eofbit | ios_base::failbit) );
+ }
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..bd90ab26ba7
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_istream/tellg/char/exceptions_badbit_throw.cc
@@ -0,0 +1,66 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ istream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+
+ try
+ {
+ stream.tellg();
+ VERIFY( false );
+ }
+ catch (const __gnu_test::positioning_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+// libstdc++/9546
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc b/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc
index 3cba2191ced..8f264d4a37a 100644
--- a/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc
+++ b/libstdc++-v3/testsuite/27_io/basic_ofstream/3.cc
@@ -58,9 +58,9 @@ struct gnu_char_traits
{
typedef gnu_char_type char_type;
typedef long int_type;
- typedef long pos_type;
- typedef unsigned long off_type;
+ typedef std::streamoff off_type;
typedef long state_type;
+ typedef std::fpos<state_type> pos_type;
static void
assign(char_type& __c1, const char_type& __c2) { }
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc
new file mode 100644
index 00000000000..2f031169790
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/2.cc
@@ -0,0 +1,66 @@
+// 2003-09-22 Petur Runolfsson <peturr02@ru.is>
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.6.2.6 Unformatted output functions
+//
+// _GLIBCXX_RESOLVE_LIB_DEFECTS
+// DR 60. What is a formatted input function?
+// basic_ostream::flush() does not behave as an unformatted output function.
+
+#include <ostream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+void test02()
+{
+ bool test = true;
+
+ __gnu_test::sync_streambuf buf;
+ std::ostream os(&buf);
+
+ __gnu_test::sync_streambuf buf_tie;
+ std::ostream os_tie(&buf_tie);
+
+ // No sentry should be constructed so os.tie()->flush() should not be
+ // called.
+ os.tie(&os_tie);
+
+ os.flush();
+
+ VERIFY( os.good() );
+ VERIFY( buf.sync_called() );
+ VERIFY( !buf_tie.sync_called() );
+
+ // os.rdbuf()->pubsync() should be called even if !os.good().
+ os.setstate(std::ios_base::eofbit);
+
+ os.flush();
+
+ VERIFY( os.rdstate() == std::ios_base::eofbit );
+ VERIFY( buf.sync_called() );
+ VERIFY( !buf_tie.sync_called() );
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
+
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..e8c5653189d
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/flush/char/exceptions_badbit_throw.cc
@@ -0,0 +1,66 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ ostream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+
+ try
+ {
+ stream.flush();
+ VERIFY( false );
+ }
+ catch (const __gnu_test::positioning_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+// libstdc++/9546
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..a084dbdb7d4
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc
@@ -0,0 +1,74 @@
+// 2003-03-08 Jerry Quinn <jlquinn@optonline.net>
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+#include <locale>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+// libstdc++/9561
+template<typename T>
+void test_badbit()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new __gnu_test::fail_num_put);
+ ostringstream stream("jaylib - champion sound");
+ stream.imbue(loc);
+
+ stream.exceptions(ios_base::badbit);
+ VERIFY( stream.rdstate() == ios_base::goodbit );
+
+ try
+ {
+ T i;
+ stream << i;
+ VERIFY( false );
+ }
+ catch (const __gnu_test::facet_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+
+int main()
+{
+ test_badbit<bool>();
+ test_badbit<short>();
+ test_badbit<unsigned short>();
+ test_badbit<int>();
+ test_badbit<unsigned int>();
+ test_badbit<long>();
+ test_badbit<unsigned long>();
+
+ test_badbit<float>();
+ test_badbit<double>();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc
new file mode 100644
index 00000000000..a1fbe21178f
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc
@@ -0,0 +1,76 @@
+// Copyright (C) 2003
+// Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+// libstdc++/10093
+template<typename T>
+void test_failbit()
+{
+ using namespace std;
+ bool test __attribute__((unused)) = true;
+
+ locale loc(locale::classic(), new __gnu_test::fail_num_put);
+ ostringstream stream("jaylib - champion sound");
+ stream.imbue(loc);
+
+ stream.exceptions(ios_base::failbit);
+
+ try
+ {
+ T i;
+ stream << i;
+ }
+ catch (const ios_base::failure&)
+ { VERIFY( false ); }
+ catch(...)
+ { VERIFY( false ); }
+
+ // stream should set badbit.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+}
+
+int main()
+{
+ test_failbit<bool>();
+ test_failbit<short>();
+ test_failbit<unsigned short>();
+ test_failbit<int>();
+ test_failbit<unsigned int>();
+ test_failbit<long>();
+ test_failbit<unsigned long>();
+
+ test_failbit<float>();
+ test_failbit<double>();
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc
new file mode 100644
index 00000000000..d905875d340
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/5.cc
@@ -0,0 +1,99 @@
+// 2003-09-22 Petur Runolfsson <peturr02@ru.is>
+
+// Copyright (C) 2003 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
+// 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.6.2.5.3 basic_ostream manipulator inserters
+//
+// _GLIBCXX_RESOLVE_LIB_DEFECTS
+// DR 60. What is a formatted input function?
+// Inserters for manipulators do not behave as formatted output functions.
+
+#include <ostream>
+#include <stdexcept>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+std::ostream& func1(std::ostream&)
+{ throw std::runtime_error(""); }
+
+std::ios& func2(std::ios&)
+{ throw std::runtime_error(""); }
+
+std::ios_base& func3(std::ios_base&)
+{ throw std::runtime_error(""); }
+
+template<typename T>
+void test(T& (*f)(T&))
+{
+ bool test = true;
+
+ __gnu_test::sync_streambuf buf;
+ std::ostream os(&buf);
+
+ __gnu_test::sync_streambuf buf_tie;
+ std::ostream os_tie(&buf_tie);
+
+ // No sentry should be constructed so os.tie()->flush() should not be
+ // called.
+ os.tie(&os_tie);
+
+ try
+ {
+ os << f;
+ // Exceptions thrown by f should not be caught
+ VERIFY( false );
+ }
+ catch (std::runtime_error&)
+ {
+ }
+
+ // Exceptions thrown by f should not cause badbit to be set
+ VERIFY( os.good() );
+ VERIFY( !buf_tie.sync_called() );
+
+ // The manipulator should be called even if !os.good().
+ os.setstate(std::ios_base::eofbit);
+
+ try
+ {
+ os << f;
+ // Exceptions thrown by f should not be caught
+ VERIFY( false );
+ }
+ catch (std::runtime_error&)
+ {
+ }
+
+ // Exceptions thrown by f should not cause badbit to be set
+ VERIFY( os.rdstate() == std::ios_base::eofbit );
+ VERIFY( !buf_tie.sync_called() );
+}
+
+void test05()
+{
+ test(&func1);
+ test(&func2);
+ test(&func3);
+}
+
+int main()
+{
+ test05();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc
new file mode 100644
index 00000000000..ce47b6f3989
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/error_failbit.cc
@@ -0,0 +1,67 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test5()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bob;
+ ostream stream(&bob);
+ stringbuf sbuf("Foo, bar, qux", ios_base::in);
+
+ stream << &sbuf;
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test7()
+{
+ bool test __attribute__((unused)) = true;
+ ostringstream stream;
+ __gnu_test::fail_streambuf bib;
+
+ stream << &bib;
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test5();
+ test7();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..13ff248940b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_badbit_throw.cc
@@ -0,0 +1,79 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test13()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bob;
+ ostream stream(&bob);
+ stream.exceptions(ios_base::badbit);
+ stringbuf sbuf("Foo, bar, qux", ios_base::in);
+
+ try
+ {
+ stream << &sbuf;
+ }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test15()
+{
+ bool test __attribute__((unused)) = true;
+ ostringstream stream;
+ stream.exceptions(ios_base::badbit);
+ __gnu_test::fail_streambuf bib;
+
+ try
+ {
+ stream << &bib;
+ }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test13();
+ test15();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc
new file mode 100644
index 00000000000..5abaf92b804
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_failbit_throw.cc
@@ -0,0 +1,89 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test9()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bob;
+ ostream stream(&bob);
+ stream.exceptions(ios_base::failbit);
+ stringbuf sbuf("Foo, bar, qux", ios_base::in);
+
+ try
+ {
+ stream << &sbuf;
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ { VERIFY(false); }
+ catch (__gnu_test::overflow_error&)
+ { }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+void test11()
+{
+ bool test __attribute__((unused)) = true;
+ ostringstream stream;
+ stream.exceptions(ios_base::failbit);
+ __gnu_test::fail_streambuf bib;
+
+ try
+ {
+ stream << &bib;
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ { VERIFY(false); }
+ catch (__gnu_test::underflow_error&)
+ { }
+ catch (...)
+ { VERIFY(false); }
+
+ VERIFY(stream.rdstate() & ios_base::failbit);
+ VERIFY((stream.rdstate() & ios_base::badbit) == 0);
+}
+
+// libstdc++/9371
+int main()
+{
+ test9();
+ test11();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc
new file mode 100644
index 00000000000..3f2de4d683b
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/inserters_other/char/exceptions_null.cc
@@ -0,0 +1,68 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <istream>
+#include <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+
+using namespace std;
+
+void test1()
+{
+ bool test __attribute__((unused)) = true;
+ ostringstream stream;
+ stream << static_cast<streambuf*>(NULL);
+ VERIFY(stream.rdstate() & ios_base::badbit);
+}
+
+void test3()
+{
+ bool test __attribute__((unused)) = true;
+ ostringstream stream;
+ stream.exceptions(ios_base::badbit);
+
+ try
+ {
+ stream << static_cast<streambuf*>(NULL);
+ VERIFY(false);
+ }
+ catch (ios_base::failure&)
+ {
+ }
+
+ VERIFY(stream.rdstate() & ios_base::badbit);
+}
+
+// libstdc++/9371
+int main()
+{
+ test1();
+ test3();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc
new file mode 100644
index 00000000000..01d346ab7ba
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_ostream/tellp/char/exceptions_badbit_throw.cc
@@ -0,0 +1,66 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <ostream>
+#include <streambuf>
+#include <sstream>
+#include <testsuite_hooks.h>
+#include <testsuite_io.h>
+
+using namespace std;
+
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+ __gnu_test::fail_streambuf bib;
+ ostream stream(&bib);
+ stream.exceptions(ios_base::badbit);
+
+ try
+ {
+ stream.tellp();
+ VERIFY( false );
+ }
+ catch (const __gnu_test::positioning_error&)
+ {
+ // stream should set badbit and rethrow facet_error.
+ VERIFY( stream.bad() );
+ VERIFY( (stream.rdstate() & ios_base::failbit) == 0 );
+ VERIFY( !stream.eof() );
+ }
+ catch (...)
+ {
+ VERIFY(false);
+ }
+}
+
+// libstdc++/9546
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc
new file mode 100644
index 00000000000..4f5c0466f1a
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-1.cc
@@ -0,0 +1,49 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.5.2.4.1 Locales
+
+#include <streambuf>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class Buf1 : public std::streambuf
+{
+protected:
+ void imbue(const std::locale&)
+ { }
+};
+
+// libstdc++/13007
+void test01()
+{
+ bool test __attribute__((unused)) = true;
+
+ Buf1 buf;
+ std::locale loc(__gnu_test::try_named_locale("is_IS.UTF-8"));
+
+ buf.pubimbue(loc);
+
+ VERIFY( buf.getloc() == loc );
+}
+
+int main()
+{
+ test01();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc
new file mode 100644
index 00000000000..812d822ccca
--- /dev/null
+++ b/libstdc++-v3/testsuite/27_io/basic_streambuf/imbue/char/13007-2.cc
@@ -0,0 +1,61 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 27.5.2.4.1 Locales
+
+#include <streambuf>
+#include <locale>
+#include <testsuite_hooks.h>
+
+class Buf2 : public std::streambuf
+{
+public:
+ std::locale before;
+ std::locale after;
+
+protected:
+ void imbue(const std::locale& loc)
+ {
+ before = getloc();
+
+ std::streambuf::imbue(loc);
+
+ after = getloc();
+ }
+};
+
+// libstdc++/13007
+void test02()
+{
+ bool test __attribute__((unused)) = true;
+
+ Buf2 buf;
+ std::locale loc(__gnu_test::try_named_locale("en_US"));
+
+ buf.pubimbue(loc);
+
+ VERIFY( buf.getloc() == loc );
+ VERIFY( buf.before == std::locale::classic() );
+ VERIFY( buf.after == std::locale::classic() );
+}
+
+int main()
+{
+ test02();
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
index ae7ba3c87fb..6e80b878fd5 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/assign_neg.cc
@@ -41,5 +41,5 @@ void test01()
io1 = io2;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 746 }
+// { dg-error "is private" "" { target *-*-* } 740 }
// { dg-error "operator=" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
index 9dfde27d710..b4cf359d3ac 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/cons/copy_neg.cc
@@ -41,5 +41,5 @@ void test02()
test_base io2 = io1;
}
// { dg-error "within this context" "" { target *-*-* } 41 }
-// { dg-error "is private" "" { target *-*-* } 743 }
+// { dg-error "is private" "" { target *-*-* } 737 }
// { dg-error "copy constructor" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
index ce5303111ac..07b9bbe79fb 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/1.cc
@@ -24,7 +24,7 @@
// XXX bug(s) in libc malloc for very large allocations. However
// XXX -lmalloc seems to work.
// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
-// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+// { dg-options "-D_GLIBCXX_ASSERT -lmalloc" { target mips*-*-irix6* } }
#include <sstream>
#include <iostream>
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
index 960669e4804..65ed829e193 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/2.cc
@@ -24,7 +24,7 @@
// XXX bug(s) in libc malloc for very large allocations. However
// XXX -lmalloc seems to work.
// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
-// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+// { dg-options "-D_GLIBCXX_ASSERT -lmalloc" { target mips*-*-irix6* } }
#include <sstream>
#include <iostream>
diff --git a/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc b/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
index ea5e13a422a..3a5d7025ce7 100644
--- a/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
+++ b/libstdc++-v3/testsuite/27_io/ios_base/storage/3.cc
@@ -24,7 +24,7 @@
// XXX bug(s) in libc malloc for very large allocations. However
// XXX -lmalloc seems to work.
// See http://gcc.gnu.org/ml/gcc/2002-05/msg01012.html
-// { dg-options "-lmalloc" { target mips*-*-irix6* } }
+// { dg-options "-D_GLIBCXX_ASSERT -lmalloc" { target mips*-*-irix6* } }
#include <sstream>
#include <iostream>
diff --git a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc
index be6c22deb05..6d07434851a 100644
--- a/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc
+++ b/libstdc++-v3/testsuite/27_io/manipulators/standard/char/2.cc
@@ -1,3 +1,5 @@
+// { dg-options "-D_GLIBCXX_ASSERT -fno-implicit-templates" }
+
// Copyright (C) 2001, 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -20,8 +22,6 @@
// their own code with -fno-implicit-templates and not suffer from a zillion
// link errors.
-// { dg-options "-fno-implicit-templates" }
-
#include <fstream>
#include <istream>
#include <ostream>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/5.cc b/libstdc++-v3/testsuite/27_io/objects/char/5.cc
index da93e83e127..acf8d6d3f0a 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/5.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/5.cc
@@ -1,3 +1,4 @@
+// { dg-options "-D_GLIBCXX_ASSERT" { target *-*-* } }
// 2003-04-26 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/7.cc b/libstdc++-v3/testsuite/27_io/objects/char/7.cc
index 21a7b49c479..7f6bc3f322b 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/7.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/7.cc
@@ -32,6 +32,11 @@
#include <sys/stat.h>
#include <testsuite_hooks.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// Check that cout.flush() is called when last ios_base::Init is destroyed.
void test07()
{
@@ -76,3 +81,5 @@ main()
test07();
return 0;
}
+
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/9.cc b/libstdc++-v3/testsuite/27_io/objects/char/9.cc
index 32424133d40..374fce4eeb9 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/9.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/9.cc
@@ -18,6 +18,10 @@
// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
// USA.
+// The ARM simulator does not provide support for "fstat", which
+// causes "in_avail" to return an incorrect value.
+// { dg-do run { xfail arm-none-elf } }
+
#include <iostream>
#include <cstdio>
#include <testsuite_hooks.h>
diff --git a/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc b/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc
index 61855064277..059e312d29a 100644
--- a/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/char/9661-1.cc
@@ -30,6 +30,11 @@
#include <sys/types.h>
#include <sys/stat.h>
+#ifdef _NEWLIB_VERSION
+// Newlib does not have mkfifo.
+int main () {}
+#else // _NEWLIB_VERSION
+
// Check that cin.rdbuf()->sputbackc() puts characters back to stdin.
// If cin.rdbuf() is a filebuf, this succeeds when stdin is a regular
// file, but fails otherwise, hence the named fifo.
@@ -86,3 +91,5 @@ int main()
test01();
return 0;
}
+
+#endif // _NEWLIB_VERSION
diff --git a/libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc b/libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc
index 318598f5e9d..ed6f3173256 100644
--- a/libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc
+++ b/libstdc++-v3/testsuite/27_io/objects/wchar_t/5.cc
@@ -1,3 +1,4 @@
+// { dg-options "-D_GLIBCXX_ASSERT" { target *-*-* } }
// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
// Copyright (C) 2003 Free Software Foundation
diff --git a/libstdc++-v3/testsuite/Makefile.am b/libstdc++-v3/testsuite/Makefile.am
index 3a03189b7b8..0fa37323230 100644
--- a/libstdc++-v3/testsuite/Makefile.am
+++ b/libstdc++-v3/testsuite/Makefile.am
@@ -32,9 +32,12 @@ AM_RUNTESTFLAGS =
testsuite_flags_script=${glibcxx_builddir}/scripts/testsuite_flags
CXX=`${testsuite_flags_script} --build-cxx`
+GLIBGCC_DIR=`$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
+GLIBCXX_DIR=${glibcxx_builddir}/src/.libs
+
CXXLINK = \
- LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs\
$(LIBTOOL) --tag=CXX --mode=link $(CXX) \
+ -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
# Generated lists of files to run. All of these names are valid make
diff --git a/libstdc++-v3/testsuite/Makefile.in b/libstdc++-v3/testsuite/Makefile.in
index c44c29428d5..cfa2e2e0023 100644
--- a/libstdc++-v3/testsuite/Makefile.in
+++ b/libstdc++-v3/testsuite/Makefile.in
@@ -1,4 +1,4 @@
-# Makefile.in generated by automake 1.7.6 from Makefile.am.
+# Makefile.in generated by automake 1.7.9 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
@@ -80,8 +80,6 @@ ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
EXTRA_CXX_FLAGS = @EXTRA_CXX_FLAGS@
-FPOS_H = @FPOS_H@
-FPOS_INC_SRCDIR = @FPOS_INC_SRCDIR@
GLIBCXX_BUILD_DEBUG_FALSE = @GLIBCXX_BUILD_DEBUG_FALSE@
GLIBCXX_BUILD_DEBUG_TRUE = @GLIBCXX_BUILD_DEBUG_TRUE@
GLIBCXX_BUILD_PCH_FALSE = @GLIBCXX_BUILD_PCH_FALSE@
@@ -110,7 +108,6 @@ LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBSUPCXX_PICFLAGS = @LIBSUPCXX_PICFLAGS@
LIBTOOL = @LIBTOOL@
-LIBUNWIND_FLAG = @LIBUNWIND_FLAG@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
@@ -226,9 +223,12 @@ AM_RUNTESTFLAGS =
testsuite_flags_script = ${glibcxx_builddir}/scripts/testsuite_flags
+GLIBGCC_DIR = `$(CC) -print-libgcc-file-name | sed 's,/[^/]*$$,,'`
+GLIBCXX_DIR = ${glibcxx_builddir}/src/.libs
+
CXXLINK = \
- LD_RUN_PATH=$${LD_RUN_PATH:+$$LD_RUN_PATH:}${glibcxx_builddir}/src/.libs\
$(LIBTOOL) --tag=CXX --mode=link $(CXX) \
+ -R $(GLIBGCC_DIR) -R $(GLIBCXX_DIR) \
$(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
@@ -298,7 +298,8 @@ LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \
$(AM_CXXFLAGS) $(CXXFLAGS)
CXXLD = $(CXX)
DIST_SOURCES = $(libv3test_a_SOURCES) $(abi_check_SOURCES)
-DIST_COMMON = $(top_srcdir)/fragment.am Makefile.am Makefile.in
+DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/fragment.am \
+ Makefile.am
SOURCES = $(libv3test_a_SOURCES) $(abi_check_SOURCES)
all: all-am
@@ -497,7 +498,7 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- INSTALL_STRIP_FLAG=-s \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
@@ -506,7 +507,7 @@ clean-generic:
-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
distclean-generic:
- -rm -f Makefile $(CONFIG_CLEAN_FILES)
+ -rm -f $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -517,7 +518,7 @@ clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
clean-noinstPROGRAMS mostlyclean-am
distclean: distclean-am
-
+ -rm -f Makefile
distclean-am: clean-am distclean-DEJAGNU distclean-compile \
distclean-generic distclean-libtool distclean-tags
@@ -540,7 +541,7 @@ install-man:
installcheck-am:
maintainer-clean: maintainer-clean-am
-
+ -rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
diff --git a/libstdc++-v3/testsuite/backward/11460.cc b/libstdc++-v3/testsuite/backward/11460.cc
index 087ba0f529a..a0139e98d89 100644
--- a/libstdc++-v3/testsuite/backward/11460.cc
+++ b/libstdc++-v3/testsuite/backward/11460.cc
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated -D_GLIBCXX_ASSERT" }
// Copyright (C) 2003 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -19,8 +20,6 @@
#include <strstream>
#include <testsuite_hooks.h>
-// { dg-options "-Wno-deprecated" }
-
class Buf : public std::strstreambuf
{
public:
diff --git a/libstdc++-v3/testsuite/backward/strstream_members.cc b/libstdc++-v3/testsuite/backward/strstream_members.cc
index 906201c8967..9ce059d297d 100644
--- a/libstdc++-v3/testsuite/backward/strstream_members.cc
+++ b/libstdc++-v3/testsuite/backward/strstream_members.cc
@@ -1,3 +1,4 @@
+// { dg-options "-Wno-deprecated" }
// Copyright (C) 2002 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
@@ -21,8 +22,6 @@
#include <strstream>
#include <testsuite_hooks.h>
-// { dg-options "-Wno-deprecated" }
-
void test01()
{
std::strstream s;
diff --git a/libstdc++-v3/testsuite/demangle/abi_examples/10.cc b/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
index fc422a7cd04..d639ca826b9 100644
--- a/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_examples/10.cc
@@ -34,7 +34,7 @@ int main()
{ static int bar; };
int Foo<int[4]>::bar;
*/
- verify_demangle("_ZN3FooIA4_iE3barE", "Foo<int[4]>::bar");
+ verify_demangle("_ZN3FooIA4_iE3barE", "Foo<int [4]>::bar");
return 0;
}
diff --git a/libstdc++-v3/testsuite/demangle/abi_text/01.cc b/libstdc++-v3/testsuite/demangle/abi_text/01.cc
index 33cfd01ac0b..5563d5093f7 100644
--- a/libstdc++-v3/testsuite/demangle/abi_text/01.cc
+++ b/libstdc++-v3/testsuite/demangle/abi_text/01.cc
@@ -36,7 +36,7 @@ int main()
// standard text
// verify_demangle("U4_farrVKPi", "int* volatile const restrict _far");
// new __cxa_demangle
- verify_demangle("U4_farrVKPi", "int* restrict volatile const _far");
+ verify_demangle("U4_farrVKPi", "int* const volatile restrict _far");
return 0;
}
diff --git a/libstdc++-v3/testsuite/demangle/regression/3111-2.cc b/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
index 8897c5069a1..24e03ea07fc 100644
--- a/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/3111-2.cc
@@ -32,7 +32,7 @@ int main()
// verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i",
// "f(int[sizeof(N::A::f() const::foo())])");
verify_demangle("_Z1fAszL_ZZNK1N1A1fEvE3foo_0E_i",
- "f(int[sizeof(N::A::f() const::foo)])");
+ "f(int [sizeof (N::A::f() const::foo)])");
return 0;
}
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-01.cc b/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
index e864957db39..46551e77fc7 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-01.cc
@@ -27,7 +27,7 @@ int main()
{
using namespace __gnu_test;
// cplus-dem FAIL
- verify_demangle("_Z1fA37_iPS_", "f(int[37], int (*) [37])");
+ verify_demangle("_Z1fA37_iPS_", "f(int [37], int (*) [37])");
return 0;
}
diff --git a/libstdc++-v3/testsuite/demangle/regression/7986-07.cc b/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
index 6a4dfb05024..e0352567b00 100644
--- a/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
+++ b/libstdc++-v3/testsuite/demangle/regression/7986-07.cc
@@ -28,7 +28,7 @@ int main()
using namespace __gnu_test;
// cplus-dem FAIL
- verify_demangle("_Z3fooA30_A_i", "foo(int[30][])");
+ verify_demangle("_Z3fooA30_A_i", "foo(int [30][])");
return 0;
diff --git a/libstdc++-v3/testsuite/demangle/regression/cw-16.cc b/libstdc++-v3/testsuite/demangle/regression/cw-16.cc
new file mode 100644
index 00000000000..8dbfcb1f56e
--- /dev/null
+++ b/libstdc++-v3/testsuite/demangle/regression/cw-16.cc
@@ -0,0 +1,53 @@
+// 2003-11-07 Carlo Wood <carlo@alinoe.com>
+
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// IA 64 C++ ABI - 5.1 External Names (a.k.a. Mangling)
+
+#include <testsuite_hooks.h>
+
+// Torturing by Carlo Wood.
+int main()
+{
+ using namespace __gnu_test;
+
+// 2003/11/07, libstdc++/12736
+verify_demangle("_Z3fooIA6_KiEvA9_KT_rVPrS4_",
+ "void foo<int const [6]>(int const [9][6], int const restrict (* volatile restrict) [9][6])");
+// 2003/11/12, libstdc++/12947
+verify_demangle("_Z1fILi5E1AEvN1CIXqugtT_Li0ELi1ELi2EEE1qE",
+ "void f<5, A>(C<(((5) > (0))) ? (1) : (2)>::q)");
+verify_demangle("_Z1fILi5EEvN1AIXcvimlT_Li22EEE1qE",
+ "void f<5>(A<(int)((5) * (22))>::q)");
+verify_demangle("_Z1fPFYPFiiEiE",
+ "f(int (*(*) [extern \"C\"] (int))(int))");
+verify_demangle("_Z1fI1XENT_1tES2_",
+ "X::t f<X>(X::t)");
+verify_demangle("_Z1fILi5E1AEvN1CIXstN1T1tEEXszsrS2_1tEE1qE",
+ "void f<5, A>(C<sizeof (T::t), sizeof (T::t)>::q)");
+// 2003/12/03, libstdc++/13045
+verify_demangle("_Z1fILi1ELc120EEv1AIXplT_cviLd4028ae147ae147aeEEE",
+ "void f<1, (char)120>(A<(1) + ((int)((double)[4028ae147ae147ae]))>)");
+verify_demangle("_Z1fILi1ELc120EEv1AIXplT_cviLf3f800000EEE",
+ "void f<1, (char)120>(A<(1) + ((int)((float)[3f800000]))>)");
+verify_demangle("_Z9hairyfuncM1YKFPVPFrPA2_PM1XKFKPA3_ilEPcEiE",
+ "hairyfunc(int (* const (X::** (* restrict (* volatile* (Y::*)(int) const)(char*)) [2])(long) const) [3])");
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/ext/allocators.cc b/libstdc++-v3/testsuite/ext/allocators.cc
index 85205d53a7b..7e4e9f98aa4 100644
--- a/libstdc++-v3/testsuite/ext/allocators.cc
+++ b/libstdc++-v3/testsuite/ext/allocators.cc
@@ -22,25 +22,23 @@
#include <cstdlib>
#include <memory>
-#include <ext/pool_allocator.h>
+//#include <ext/pool_allocator.h>
#include <ext/debug_allocator.h>
#include <ext/malloc_allocator.h>
#include <testsuite_hooks.h>
-using __gnu_cxx::__malloc_alloc;
-using __gnu_cxx::__debug_alloc;
-using __gnu_cxx::__pool_alloc;
+using __gnu_cxx::malloc_allocator;
+using __gnu_cxx::debug_allocator;
-template class __malloc_alloc<3>;
-template class __debug_alloc<__malloc_alloc<3> >;
-template class __pool_alloc<true, 3>;
-template class __pool_alloc<false, 3>;
-struct big
-{
- long f[15];
-};
+template class malloc_allocator<int>;
+template class debug_allocator<malloc_allocator<int> >;
+#if 0
+using __gnu_cxx::__pool_alloc;
+template class __pool_alloc<true, 3>;
+template class __pool_alloc<false, 3>;
+#endif
bool new_called;
bool delete_called;
@@ -69,31 +67,39 @@ void check_allocator()
delete_called = false;
requested = 0;
- std::__allocator<big, Alloc> a;
- big *p = a.allocate(10);
+ Alloc a;
+ typename Alloc::pointer p = a.allocate(10);
if (uses_global_new_and_delete)
VERIFY( requested >= (10 * 15 * sizeof(long)) );
- // Touch the far end of supposedly-allocated memory to check that we got
- // all of it. Why "3"? Because it's my favorite integer between e and pi.
- p[9].f[14] = 3;
VERIFY( new_called == uses_global_new_and_delete );
- a.deallocate(p,10);
+ a.deallocate(p, 10);
VERIFY( delete_called == uses_global_new_and_delete );
}
// These just help tracking down error messages.
-void test01() { check_allocator<__malloc_alloc<3>, false>(); }
-void test02() { check_allocator<__debug_alloc<__malloc_alloc<3> >, false>(); }
-void test03() { check_allocator<__pool_alloc<true, 3>, true>(); }
-void test04() { check_allocator<__pool_alloc<false, 3>, true>(); }
+void test01()
+{ check_allocator<malloc_allocator<int>, false>(); }
+
+void test02()
+{ check_allocator<debug_allocator<malloc_allocator<int> >, false>(); }
+
+#if 0
+void test03()
+{ check_allocator<__pool_alloc<true, 3>, true>(); }
+
+void test04()
+{ check_allocator<__pool_alloc<false, 3>, true>(); }
+#endif
int main()
{
test01();
test02();
+#if 0
test03();
test04();
+#endif
return 0;
}
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc
deleted file mode 100644
index 5134cadfbe9..00000000000
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_char.cc
+++ /dev/null
@@ -1,140 +0,0 @@
-// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-
-// Copyright (C) 2003 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
-// 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 <ext/stdio_sync_filebuf.h>
-#include <testsuite_hooks.h>
-
-void test01()
-{
- using namespace std;
-
- bool test __attribute__((unused)) = true;
- const char* c_lit = "black pearl jasmine tea";
- int size = strlen(c_lit);
- const char* name = "stdiobuf-1.txt";
-
- FILE* fout = fopen(name, "w");
- fwrite(c_lit, 1, size, fout);
- fclose(fout);
-
- FILE* fin = fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<char> sbuf(fin);
-
- VERIFY( sbuf.sgetc() == c_lit[0] );
- VERIFY( getc(fin) == c_lit[0] );
- VERIFY( sbuf.sgetc() == c_lit[1] );
- VERIFY( sbuf.sbumpc() == c_lit[1] );
- VERIFY( ungetc('Z', fin) == 'Z' );
- VERIFY( sbuf.sbumpc() == 'Z' );
- VERIFY( getc(fin) == c_lit[2] );
- VERIFY( sbuf.sputbackc('X') == 'X' );
- VERIFY( getc(fin) == 'X' );
-
- char buf[5];
- memset(buf, 'x', 5);
- VERIFY( sbuf.sgetn(buf, 5) == 5 );
- VERIFY( !memcmp(buf, c_lit + 3, 5) );
- VERIFY( getc(fin) == c_lit[8] );
-
- fclose(fin);
-}
-
-// libstdc++/12048
-void test02()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<char> sbuf(file);
- int c1 = sbuf.sbumpc();
- VERIFY( c1 != EOF );
- int c2 = sbuf.sungetc();
- VERIFY( c2 != EOF );
- int c3 = sbuf.sbumpc();
- VERIFY( c3 == c1 );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test03()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<char> sbuf(file);
- int c1 = sbuf.sbumpc();
- VERIFY( c1 != EOF );
- int c2 = sbuf.sungetc();
- VERIFY( c2 != EOF );
- int c3 = std::fgetc(file);
- VERIFY( c3 == c1 );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test04()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<char> sbuf(file);
- char buf[2];
- VERIFY( sbuf.sgetn(buf, 2) == 2 );
- int c2 = sbuf.sungetc();
- VERIFY( c2 != EOF );
- int c3 = sbuf.sbumpc();
- VERIFY( c3 == std::char_traits<char>::to_int_type(buf[1]) );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test05()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<char> sbuf(file);
- char buf[2];
- VERIFY( sbuf.sgetn(buf, 2) == 2 );
- int c2 = sbuf.sungetc();
- VERIFY( c2 != EOF );
- int c3 = std::fgetc(file);
- VERIFY( c3 == std::char_traits<char>::to_int_type(buf[1]) );
-
- std::fclose(file);
-}
-
-int main ()
-{
- test01();
- test02();
- test03();
- test04();
- test05();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc b/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc
deleted file mode 100644
index 96831c3c2f4..00000000000
--- a/libstdc++-v3/testsuite/ext/stdio_sync_filebuf_wchar_t.cc
+++ /dev/null
@@ -1,142 +0,0 @@
-// 2003-05-01 Petur Runolfsson <peturr02@ru.is>
-
-// Copyright (C) 2003 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
-// 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 <ext/stdio_sync_filebuf.h>
-#include <testsuite_hooks.h>
-
-void test01()
-{
- using namespace std;
- typedef char_traits<wchar_t> traits_type;
-
- bool test __attribute__((unused)) = true;
- const char* c_lit = "black pearl jasmine tea";
- const wchar_t* w_lit = L"black pearl jasmine tea";
- int size = strlen(c_lit);
- const char* name = "stdiobuf-1.txt";
-
- FILE* fout = fopen(name, "w");
- fwrite(c_lit, 1, size, fout);
- fclose(fout);
-
- FILE* fin = fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<wchar_t> wsbuf(fin);
-
- VERIFY( traits_type::to_char_type(wsbuf.sgetc()) == w_lit[0] );
- VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[0] );
- VERIFY( traits_type::to_char_type(wsbuf.sgetc()) == w_lit[1] );
- VERIFY( traits_type::to_char_type(wsbuf.sbumpc()) == w_lit[1] );
- VERIFY( ungetwc(L'Z', fin) == L'Z' );
- VERIFY( wsbuf.sbumpc() == L'Z' );
- VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[2] );
- VERIFY( wsbuf.sputbackc(L'X') == L'X' );
- VERIFY( getwc(fin) == L'X' );
-
- wchar_t buf[5];
- wmemset(buf, 0xdeadbeef, 5);
- VERIFY( wsbuf.sgetn(buf, 5) == 5 );
- VERIFY( !wmemcmp(buf, w_lit + 3, 5) );
- VERIFY( traits_type::to_char_type(getwc(fin)) == w_lit[8] );
-
- fclose(fin);
-}
-
-// libstdc++/12048
-void test02()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file);
- std::wint_t c1 = sbuf.sbumpc();
- VERIFY( c1 != WEOF );
- std::wint_t c2 = sbuf.sungetc();
- VERIFY( c2 != WEOF );
- std::wint_t c3 = sbuf.sbumpc();
- VERIFY( c3 == c1 );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test03()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file);
- std::wint_t c1 = sbuf.sbumpc();
- VERIFY( c1 != WEOF );
- std::wint_t c2 = sbuf.sungetc();
- VERIFY( c2 != WEOF );
- std::wint_t c3 = std::fgetwc(file);
- VERIFY( c3 == c1 );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test04()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file);
- wchar_t buf[2];
- VERIFY( sbuf.sgetn(buf, 2) == 2 );
- std::wint_t c2 = sbuf.sungetc();
- VERIFY( c2 != WEOF );
- std::wint_t c3 = sbuf.sbumpc();
- VERIFY( c3 == std::char_traits<wchar_t>::to_int_type(buf[1]) );
-
- std::fclose(file);
-}
-
-// libstdc++/12048
-void test05()
-{
- bool test __attribute__((unused)) = true;
- const char* name = "cin_unget-1.txt";
-
- std::FILE* file = std::fopen(name, "r");
- __gnu_cxx::stdio_sync_filebuf<wchar_t> sbuf(file);
- wchar_t buf[2];
- VERIFY( sbuf.sgetn(buf, 2) == 2 );
- std::wint_t c2 = sbuf.sungetc();
- VERIFY( c2 != WEOF );
- std::wint_t c3 = std::fgetwc(file);
- VERIFY( c3 == std::char_traits<wchar_t>::to_int_type(buf[1]) );
-
- std::fclose(file);
-}
-
-int main ()
-{
- test01();
- test02();
- test03();
- test04();
- test05();
-
- return 0;
-}
diff --git a/libstdc++-v3/testsuite/lib/libstdc++.exp b/libstdc++-v3/testsuite/lib/libstdc++.exp
index f5453890d1e..9aacdb28b83 100644
--- a/libstdc++-v3/testsuite/lib/libstdc++.exp
+++ b/libstdc++-v3/testsuite/lib/libstdc++.exp
@@ -46,7 +46,9 @@ proc v3-init { args } {
global cxxflags
global objdir
global gluefile wrap_flags
+ global env
global ld_library_path
+ global original_ld_library_path
global tool_root_dir
set blddir [lookfor_file [get_multilibs] libstdc++-v3]
@@ -59,15 +61,31 @@ proc v3-init { args } {
v3-copy-files [glob -nocomplain "$srcdir/data/*.tst"] $outdir
v3-copy-files [glob -nocomplain "$srcdir/data/*.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
+ # Setup LD_LIBRARY_PATH so that libgcc_s, libstdc++ binaries can be found.
+ # Find the existing LD_LIBRARY_PATH.
+ if [info exists env(LD_LIBRARY_PATH)] {
+ set original_ld_library_path $env(LD_LIBRARY_PATH)
+ } else {
+ if [info exists env(SHLIB_PATH)] {
+ set original_ld_library_path $env(SHLIB_PATH)
+ } else {
+ if [info exists env(DYLD_LIBRARY_PATH)] {
+ set original_ld_library_path $env(DYLD_LIBRARY_PATH)
+ } else {
+ set original_ld_library_path ""
+ }
+ }
+ }
+
+ # 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 "."
+ # Compute what needs to be added to the existing LD_LIBRARY_PATH.
+ set ld_library_path ""
append ld_library_path ":${gccdir}"
set compiler ${gccdir}/g++
if { [is_remote host] == 0 && [which $compiler] != 0 } {
@@ -91,13 +109,14 @@ proc v3-init { args } {
# unix.exp -- but that's not an option since it's part of DejaGNU
# proper, so we do it here. We really only need to do
# this on IRIX, but it shouldn't hurt to do it anywhere else.
- setenv LD_LIBRARY_PATH $ld_library_path
- setenv SHLIB_PATH $ld_library_path
- setenv LD_LIBRARYN32_PATH $ld_library_path
- setenv LD_LIBRARY64_PATH $ld_library_path
- setenv LD_RUN_PATH $ld_library_path
- setenv LD_LIBRARY_PATH_64 $ld_library_path
- verbose -log "Set LD_*_PATHs to ${ld_library_path}"
+ setenv LD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
+ setenv SHLIB_PATH "$ld_library_path:$original_ld_library_path"
+ setenv LD_LIBRARYN32_PATH "$ld_library_path:$original_ld_library_path"
+ setenv LD_LIBRARY64_PATH "$ld_library_path:$original_ld_library_path"
+ setenv LD_RUN_PATH "$ld_library_path:$original_ld_library_path"
+ setenv LD_LIBRARY_PATH_64 "$ld_library_path:$original_ld_library_path"
+ setenv DYLD_LIBRARY_PATH "$ld_library_path:$original_ld_library_path"
+ verbose -log "LD_LIBRARY_PATH = $env(LD_LIBRARY_PATH)"
# Do a bunch of handstands and backflips for cross compiling and
# finding simulators...
diff --git a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp
index 0ce6668d4b8..a5665438aa5 100644
--- a/libstdc++-v3/testsuite/libstdc++-dg/normal.exp
+++ b/libstdc++-v3/testsuite/libstdc++-dg/normal.exp
@@ -16,15 +16,36 @@
# libstdc++-v3 testsuite that uses the 'dg.exp' driver.
-# If a testcase doesn't have special options, use these.
+# Initialization.
+dg-init
+v3-init
+
+# If a libstdc++ test file doesn't have special options, use DEFAULT_CXXFLAGS.
+# Use this variable if the behavior
+# 1) only applies to libstdc++ testing
+# 2) might need to be negated
+# In particular, some tests have to be run without precompiled
+# headers, or without assertions.
+global blddir
+global target_triplet
global DEFAULT_CXXFLAGS
if ![info exists DEFAULT_CXXFLAGS] then {
set DEFAULT_CXXFLAGS "-D_GLIBCXX_ASSERT"
-}
-# Initialization.
-dg-init
-v3-init
+ # Set up includes for stdc++.h.gch, the precompiled header file.
+ set flags_file "${blddir}/scripts/testsuite_flags"
+ if { [file exists $flags_file] } {
+ set cxxpchflags [exec sh $flags_file --cxxpchflags]
+ } else {
+ set cxxpchflags ""
+ }
+ append DEFAULT_CXXFLAGS " ${cxxpchflags}"
+
+ # Host specific goo here.
+ if { [string match "powerpc-*-darwin*" $target_triplet] } {
+ append DEFAULT_CXXFLAGS " -multiply_defined suppress"
+ }
+}
# Main loop.
dg-runtest [v3-list-tests testsuite_files] "" $DEFAULT_CXXFLAGS
diff --git a/libstdc++-v3/testsuite/performance/allocator.cc b/libstdc++-v3/testsuite/performance/allocator.cc
index 4cd615e1a83..e4a5ad47766 100644
--- a/libstdc++-v3/testsuite/performance/allocator.cc
+++ b/libstdc++-v3/testsuite/performance/allocator.cc
@@ -61,7 +61,7 @@
#include <testsuite_performance.h>
using namespace std;
-using __gnu_cxx::__malloc_alloc;
+using __gnu_cxx::malloc_allocator;
using __gnu_cxx::__mt_alloc;
/*
@@ -155,7 +155,7 @@ test_ints_malloc_alloc(int iterations)
tstart();
for(int i = 0; i < iterations; i++)
{
- vector<int, __malloc_alloc<0> > v1;
+ vector<int, malloc_allocator<int> > v1;
for(int j = 0; j < insert_values; j++)
{
@@ -173,7 +173,7 @@ test_ints_mt_alloc(int iterations)
tstart();
for(int i = 0; i < iterations; i++)
{
- vector<int, __mt_alloc<0> > v1;
+ vector<int, __mt_alloc<int> > v1;
for(int j = 0; j < insert_values; j++)
{
diff --git a/libstdc++-v3/testsuite/performance/container_benchmark.cc b/libstdc++-v3/testsuite/performance/container_benchmark.cc
new file mode 100644
index 00000000000..4e54374575d
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/container_benchmark.cc
@@ -0,0 +1,175 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <cmath>
+#include <cstdlib>
+
+#include <vector>
+#include <algorithm>
+#include <list>
+#include <deque>
+#include <set>
+
+#include <sstream>
+#include <testsuite_performance.h>
+
+using namespace std;
+
+typedef double element_t;
+typedef void(*test)(element_t*, element_t*);
+
+void array_test(element_t* first, element_t* last)
+{
+ element_t* array = new element_t[last - first];
+ copy(first, last, array);
+ sort(array, array + (last - first));
+ unique(array, array + (last - first));
+ delete [] array;
+}
+
+void vector_pointer_test(element_t* first, element_t* last)
+{
+ vector<element_t> container(first, last);
+ sort(&*container.begin(), &*container.end());
+ unique(&*container.begin(), &*container.end());
+}
+
+void vector_iterator_test(element_t* first, element_t* last)
+{
+ vector<element_t> container(first, last);
+ sort(container.begin(), container.end());
+ unique(container.begin(), container.end());
+}
+
+void deque_test(element_t* first, element_t* last)
+{
+ deque<element_t> container(first, last);
+ copy(first, last, container.begin());
+ sort(container.begin(), container.end());
+ unique(container.begin(), container.end());
+}
+
+void list_test(element_t* first, element_t* last)
+{
+ list<element_t> container(first, last);
+ container.sort();
+ container.unique();
+}
+
+void set_test(element_t* first, element_t* last)
+{ set<element_t> container(first, last); }
+
+void multiset_test(element_t* first, element_t* last)
+{
+ multiset<element_t> container(first, last);
+ typedef multiset<element_t>::iterator iterator;
+ {
+ iterator first = container.begin();
+ iterator last = container.end();
+
+ while (first != last)
+ {
+ iterator next = first;
+ if (++next == last) break;
+ if (*first == *next)
+ container.erase(next);
+ else
+ ++first;
+ }
+ }
+}
+
+double logtwo(double x)
+{ return log(x)/log(2.0); }
+
+int number_of_tests(int size)
+{
+ const double n = size;
+ const double largest_n = 1000000;
+ return int(floor((largest_n * logtwo(largest_n))
+ / (n * logtwo(n))));
+}
+
+void initialize(element_t* first, element_t* last)
+{
+ element_t value = 0.0;
+ while (first != last)
+ {
+ *first++ = value;
+ value += 1.;
+ }
+}
+
+void run_tests(int size, const test* tests, const char** names,
+ int ntests)
+{
+ using namespace __gnu_test;
+ time_counter time;
+ resource_counter resource;
+
+ const int n = number_of_tests(size);
+ const size_t length = 2 * size;
+
+ // make a random test set of the chosen size:
+ vector<element_t> buf(length);
+ element_t* buffer = &buf[0];
+ element_t* buffer_end = &buf[length];
+ initialize(buffer, buffer + size); // elements
+ initialize(buffer + size, buffer_end); // duplicate elements
+ random_shuffle(buffer, buffer_end);
+
+ // test the containers:
+ ostringstream oss;
+ oss << "size = " << size << " :";
+ report_header(__FILE__, oss.str());
+ for (int i = 0; i < ntests; ++i)
+ {
+ start_counters(time, resource);
+ for (int j = 0; j < n; ++j)
+ tests[i](buffer, buffer_end);
+ stop_counters(time, resource);
+ report_performance(__FILE__, names[i], time, resource);
+ clear_counters(time, resource);
+ }
+}
+
+int main()
+{
+ const test tests[] = { &array_test, &vector_pointer_test,
+ &vector_iterator_test, &deque_test,
+ &list_test, &set_test, &multiset_test };
+ const int ntests = sizeof(tests) / sizeof(test);
+ const char* names[ntests] = { "array", "vector (pointer)",
+ "vector (iterator)", "deque",
+ "list", "set", "multiset" };
+
+ const int sizes[] = {100, 1000, 10000, 100000};
+ for (int i = 0; i < sizeof(sizes) / sizeof(int); ++i)
+ run_tests(sizes[i], tests, names, ntests);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/ifstream_extract_int.cc b/libstdc++-v3/testsuite/performance/ifstream_extract_int.cc
new file mode 100644
index 00000000000..b6ff6c47603
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/ifstream_extract_int.cc
@@ -0,0 +1,57 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <fstream>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iterations = 10000000;
+
+ {
+ ofstream out("tmp_perf_int.txt");
+ for (int i = 0; i < iterations; ++i)
+ out << i << "\n";
+ }
+
+ {
+ ifstream in("tmp_perf_int.txt");
+ start_counters(time, resource);
+ for (int j, i = 0; i < iterations; ++i)
+ in >> j;
+ stop_counters(time, resource);
+ report_performance(__FILE__, "", time, resource);
+ }
+
+ unlink("tmp_perf_int.txt");
+ return 0;
+};
diff --git a/libstdc++-v3/testsuite/performance/is_wchar_t.cc b/libstdc++-v3/testsuite/performance/is_wchar_t.cc
new file mode 100644
index 00000000000..e35edd023cb
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/is_wchar_t.cc
@@ -0,0 +1,87 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <locale>
+#include <cwctype>
+#include <cstddef>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ const wchar_t str[] =
+ L"Is this the real life?\n"
+ L"Is this just fantasy?\n"
+ L"Caught in a landslide\n"
+ L"No escape from reality\n"
+ L"Open your eyes\n"
+ L"Look up to the skies and see\n"
+ L"I'm just a poor boy\n"
+ L"I need no sympathy\n"
+ L"Because I'm easy come, easy go\n"
+ L"Little high, little low"
+ L"Anyway the wind blows\n"
+ L"Doesn't really matter to me\n"
+ L"To me\n"
+ L" -- Queen\n";
+ const size_t len = sizeof(str) / sizeof(str[0]) - 1;
+
+ locale loc;
+ const ctype<wchar_t>& ct = use_facet<ctype<wchar_t> >(loc);
+
+ // C
+ wctype_t w = wctype("space");
+ start_counters(time, resource);
+ for (int j = 0; j < 200000; ++j)
+ {
+ for (size_t i = 0; i < len; ++i)
+ {
+ iswctype(str[i], w);
+ }
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "C", time, resource);
+ clear_counters(time, resource);
+
+ // C++
+ start_counters(time, resource);
+ for (int j = 0; j < 200000; ++j)
+ {
+ for (size_t i = 0; i < len; ++i)
+ {
+ ct.is(ctype_base::space, str[i]);
+ }
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "C++", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc b/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
index ee3ff3369d6..8999b43c53f 100644
--- a/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
+++ b/libstdc++-v3/testsuite/performance/list_create_fill_sort.cc
@@ -57,7 +57,7 @@ int main()
}
stop_counters(time, resource);
- sprintf(comment,"Iterations: %8u Size: %8u",iterations,n);
+ sprintf(comment,"Iters: %8u Size: %4u", iterations, n);
report_performance(__FILE__, comment, time, resource);
}
return 0;
diff --git a/libstdc++-v3/testsuite/performance/narrow_widen_char.cc b/libstdc++-v3/testsuite/performance/narrow_widen_char.cc
new file mode 100644
index 00000000000..f8b530dcfd0
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/narrow_widen_char.cc
@@ -0,0 +1,76 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <locale>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ char bufin[] = "This was an attempt to bypass string construction just for test.";
+ char bufout[sizeof(bufin)];
+
+ locale loc;
+ const ctype<char>& ct = use_facet<ctype<char> >(loc);
+
+ // narrow
+ start_counters(time, resource);
+ for (long i = 0; i < 1000000000; ++i)
+ ct.narrow(i % 128, '*');
+ stop_counters(time, resource);
+ report_performance(__FILE__, "narrow", time, resource);
+ clear_counters(time, resource);
+
+ // narrow array
+ start_counters(time, resource);
+ for (long i = 0; i < 100000000; ++i)
+ ct.narrow(bufin, bufin+sizeof(bufin), '*', bufout);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "narrow_array", time, resource);
+ clear_counters(time, resource);
+
+ // widen
+ start_counters(time, resource);
+ for (long i = 0; i < 1000000000; ++i)
+ ct.widen(i % 128);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "widen", time, resource);
+ clear_counters(time, resource);
+
+ // widen array
+ start_counters(time, resource);
+ for (long i = 0; i < 100000000; ++i)
+ ct.widen(bufin, bufin+sizeof(bufin), bufout);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "widen_array", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc b/libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc
new file mode 100644
index 00000000000..f5d4536d0ac
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/narrow_widen_wchar_t.cc
@@ -0,0 +1,76 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <locale>
+#include <testsuite_performance.h>
+
+int main()
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ wchar_t bufwc[] = L"Mi innamoravo di tutto (Fabrizio De Andre')";
+ char bufc[sizeof(bufwc) / sizeof(wchar_t)];
+
+ locale loc;
+ const ctype<wchar_t>& ct = use_facet<ctype<wchar_t> >(loc);
+
+ // narrow
+ start_counters(time, resource);
+ for (long i = 0; i < 200000000; ++i)
+ ct.narrow(i % 128, '*');
+ stop_counters(time, resource);
+ report_performance(__FILE__, "narrow", time, resource);
+ clear_counters(time, resource);
+
+ // narrow array
+ start_counters(time, resource);
+ for (long i = 0; i < 20000000; ++i)
+ ct.narrow(bufwc, bufwc + sizeof(bufwc) / sizeof(wchar_t), '*', bufc);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "narrow array", time, resource);
+ clear_counters(time, resource);
+
+ // widen
+ start_counters(time, resource);
+ for (long i = 0; i < 200000000; ++i)
+ ct.widen(i % 128);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "widen", time, resource);
+ clear_counters(time, resource);
+
+ // widen array
+ start_counters(time, resource);
+ for (long i = 0; i < 20000000; ++i)
+ ct.widen(bufc, bufc + sizeof(bufc), bufwc);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "widen array", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/wchar_t_in.cc b/libstdc++-v3/testsuite/performance/wchar_t_in.cc
new file mode 100644
index 00000000000..43e09e39a78
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/wchar_t_in.cc
@@ -0,0 +1,84 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <cstdio>
+#include <cstring>
+#include <fstream>
+#include <langinfo.h>
+#include <iconv.h>
+#include <testsuite_performance.h>
+
+// libstdc++/11602 (do_in)
+int main(int argc, char** argv)
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iters = 400000;
+
+ wchar_t wbuf[1024];
+ char cbuf[1024];
+
+ memset(cbuf, 'a', 1024);
+
+ // C (iconv)
+ iconv_t cd = iconv_open("WCHAR_T", nl_langinfo(CODESET));
+ start_counters(time, resource);
+ for (int i = 0; i < iters; ++i)
+ {
+ size_t inbytesleft = 1024;
+ size_t outbytesleft = 1024 * sizeof(wchar_t);
+ char* in = cbuf;
+ char* out = reinterpret_cast<char*>(wbuf);
+ iconv(cd, &in, &inbytesleft, &out, &outbytesleft);
+ }
+ stop_counters(time, resource);
+ iconv_close(cd);
+ report_performance(__FILE__, "C (iconv)", time, resource);
+ clear_counters(time, resource);
+
+ // C++ (codecvt)
+ locale loc;
+ const codecvt<wchar_t, char, mbstate_t>& cvt =
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(loc);
+ mbstate_t state;
+ memset(&state, 0, sizeof(state));
+ start_counters(time, resource);
+ for (int i = 0; i < iters; ++i)
+ {
+ const char* from_next;
+ wchar_t* to_next;
+ cvt.in(state, cbuf, cbuf + 1024, from_next,
+ wbuf, wbuf + 1024, to_next);
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "C++ (codecvt)", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/wchar_t_length.cc b/libstdc++-v3/testsuite/performance/wchar_t_length.cc
new file mode 100644
index 00000000000..f0146fe9991
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/wchar_t_length.cc
@@ -0,0 +1,62 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <cstdio>
+#include <cstring>
+#include <fstream>
+#include <langinfo.h>
+#include <iconv.h>
+#include <testsuite_performance.h>
+
+// libstdc++/11602 (do_length)
+int main(int argc, char** argv)
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iters = 400000;
+
+ char cbuf[1024];
+
+ memset(cbuf, 'a', 1024);
+
+ // C++ (codecvt)
+ locale loc;
+ const codecvt<wchar_t, char, mbstate_t>& cvt =
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(loc);
+ mbstate_t state;
+ memset(&state, 0, sizeof(state));
+ start_counters(time, resource);
+ for (int i = 0; i < iters; ++i)
+ cvt.length(state, cbuf, cbuf + 1024, 1024);
+ stop_counters(time, resource);
+ report_performance(__FILE__, "C++ (codecvt)", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/performance/wchar_t_out.cc b/libstdc++-v3/testsuite/performance/wchar_t_out.cc
new file mode 100644
index 00000000000..4e5106817d0
--- /dev/null
+++ b/libstdc++-v3/testsuite/performance/wchar_t_out.cc
@@ -0,0 +1,84 @@
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+
+// 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 <cstdio>
+#include <cstring>
+#include <fstream>
+#include <langinfo.h>
+#include <iconv.h>
+#include <testsuite_performance.h>
+
+// libstdc++/11602
+int main(int argc, char** argv)
+{
+ using namespace std;
+ using namespace __gnu_test;
+
+ time_counter time;
+ resource_counter resource;
+ const int iters = 300000;
+
+ wchar_t wbuf[1024];
+ char cbuf[1024];
+
+ wmemset(wbuf, L'a', 1024);
+
+ // C (iconv)
+ iconv_t cd = iconv_open(nl_langinfo(CODESET), "WCHAR_T");
+ start_counters(time, resource);
+ for (int i = 0; i < iters; ++i)
+ {
+ size_t inbytesleft = 1024 * sizeof(wchar_t);
+ size_t outbytesleft = 1024;
+ char* in = reinterpret_cast<char*>(wbuf);
+ char* out = cbuf;
+ iconv(cd, &in, &inbytesleft, &out, &outbytesleft);
+ }
+ stop_counters(time, resource);
+ iconv_close(cd);
+ report_performance(__FILE__, "C (iconv)", time, resource);
+ clear_counters(time, resource);
+
+ // C++ (codecvt)
+ locale loc;
+ const codecvt<wchar_t, char, mbstate_t>& cvt =
+ use_facet<codecvt<wchar_t, char, mbstate_t> >(loc);
+ mbstate_t state;
+ memset(&state, 0, sizeof(state));
+ start_counters(time, resource);
+ for (int i = 0; i < iters; ++i)
+ {
+ const wchar_t* from_next;
+ char* to_next;
+ cvt.out(state, wbuf, wbuf + 1024, from_next,
+ cbuf, cbuf + 1024, to_next);
+ }
+ stop_counters(time, resource);
+ report_performance(__FILE__, "C++ (codecvt)", time, resource);
+
+ return 0;
+}
diff --git a/libstdc++-v3/testsuite/testsuite_character.h b/libstdc++-v3/testsuite/testsuite_character.h
new file mode 100644
index 00000000000..67c35c25443
--- /dev/null
+++ b/libstdc++-v3/testsuite/testsuite_character.h
@@ -0,0 +1,415 @@
+// -*- C++ -*-
+// Testing character type and state type with char_traits and codecvt
+// specializations for the C++ library testsuite.
+//
+// Copyright (C) 2003 Free Software Foundation, Inc.
+//
+// This file is part of the GNU ISO C++ Library. This library is free
+// software; you can redistribute it and/or modify it under the
+// terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option)
+// any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this library; see the file COPYING. If not, write to the Free
+// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// USA.
+//
+// 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 _GLIBCXX_TESTSUITE_CHARACTER_H
+#define _GLIBCXX_TESTSUITE_CHARACTER_H
+
+#include <string> // for char_traits
+#include <locale> // for codecvt
+#include <climits>
+
+namespace __gnu_test
+{
+ // Character type
+ struct character
+ {
+ unsigned char val;
+
+ static character from_char(char c)
+ {
+ character ret;
+ ret.val = c;
+ return ret;
+ }
+ };
+
+ // State type.
+ struct conversion_state
+ {
+ unsigned int state;
+ };
+}; // namespace __gnu_test
+
+namespace std
+{
+ // char_traits specialization. Meets the additional requirements for
+ // basic_filebuf.
+ template<>
+ struct char_traits<__gnu_test::character>
+ {
+ typedef __gnu_test::character char_type;
+ typedef unsigned int int_type;
+ typedef __gnu_test::conversion_state state_type;
+ typedef streamoff off_type;
+ typedef fpos<state_type> pos_type;
+
+ static void
+ assign(char_type& c1, const char_type& c2)
+ { c1 = c2; }
+
+ static bool
+ eq(const char_type& c1, const char_type& c2)
+ { return c1.val == c2.val; }
+
+ static bool
+ lt(const char_type& c1, const char_type& c2)
+ { return c1.val < c2.val; }
+
+ static int
+ compare(const char_type* s1, const char_type* s2, size_t n)
+ {
+ for (size_t i = 0; i < n; ++i)
+ {
+ if (lt(s1[i], s2[i]))
+ return -1;
+ else if (lt(s2[i], s1[i]))
+ return 1;
+ }
+ return 0;
+ }
+
+ static size_t
+ length(const char_type* s)
+ {
+ size_t n = 0;
+ while (!eq(s[n], char_type()))
+ ++n;
+ return n;
+ }
+
+ static const char_type*
+ find(const char_type* s, size_t n, const char_type& a)
+ {
+ for (size_t i = 0; i < n; ++i)
+ {
+ if (eq(s[i], a))
+ return s + i;
+ }
+ return NULL;
+ }
+
+ static char_type*
+ move(char_type* s1, const char_type* s2, size_t n)
+ {
+ if (s1 > s2)
+ {
+ for (size_t i = 0; i < n; ++i)
+ assign(s1[n - i - 1], s2[n - i - 1]);
+ }
+ else
+ {
+ for (size_t i = 0; i < n; ++i)
+ assign(s1[i], s2[i]);
+ }
+ return s1;
+ }
+
+ static char_type*
+ copy(char_type* s1, const char_type* s2, size_t n)
+ {
+ for (size_t i = 0; i < n; ++i)
+ assign(s1[i], s2[i]);
+ return s1;
+ }
+
+ static char_type*
+ assign(char_type* s, size_t n, char_type a)
+ {
+ for (size_t i = 0; i < n; ++i)
+ assign(s[i], a);
+ return s;
+ }
+
+ static int_type
+ not_eof(const int_type& c)
+ {
+ if (eq_int_type(c, eof()))
+ return 0;
+ return c;
+ }
+
+ // Note non-trivial conversion to maximize chance of catching bugs
+ static char_type
+ to_char_type(const int_type& c)
+ {
+ char_type ret;
+ ret.val = (c >> 5);
+ return ret;
+ }
+
+ static int_type
+ to_int_type(const char_type& c)
+ {
+ return c.val << 5;
+ }
+
+ static bool
+ eq_int_type(const int_type& c1, const int_type& c2)
+ { return c1 == c2; }
+
+ static int_type eof()
+ { return 0xf; }
+ };
+
+ // codecvt specialization
+ //
+ // The conversion performed by the specialization is not supposed to
+ // be useful, rather it has been designed to demonstrate the
+ // essential features of stateful conversions:
+ // * Number and value of bytes for each internal character depends on the
+ // state in addition to the character itself.
+ // * Unshift produces an unshift sequence and resets the state. On input
+ // the unshift sequence causes the state to be reset.
+ //
+ // The conversion for output is as follows:
+ // 1. Calculate the value tmp by xor-ing the state and the internal
+ // character
+ // 2. Split tmp into either two or three bytes depending on the value of
+ // state. Output those bytes.
+ // 3. tmp becomes the new value of state.
+ template<>
+ class codecvt<__gnu_test::character, char, __gnu_test::conversion_state>
+ : public locale::facet, public codecvt_base
+ {
+ public:
+ typedef __gnu_test::character intern_type;
+ typedef char extern_type;
+ typedef __gnu_test::conversion_state state_type;
+
+ explicit codecvt(size_t refs = 0)
+ : locale::facet(refs)
+ { }
+
+ result
+ out(state_type& state, const intern_type* from,
+ const intern_type* from_end, const intern_type*& from_next,
+ extern_type* to, extern_type* to_limit, extern_type*& to_next) const
+ {
+ return do_out(state, from, from_end, from_next,
+ to, to_limit, to_next);
+ }
+
+ result
+ unshift(state_type& state, extern_type* to, extern_type* to_limit,
+ extern_type*& to_next) const
+ { return do_unshift(state, to, to_limit, to_next); }
+
+ result
+ in(state_type& state, const extern_type* from,
+ const extern_type* from_end, const extern_type*& from_next,
+ intern_type* to, intern_type* to_limit, intern_type*& to_next) const
+ {
+ return do_in(state, from, from_end, from_next,
+ to, to_limit, to_next);
+ }
+
+ int
+ encoding() const throw()
+ { return do_encoding(); }
+
+ bool
+ always_noconv() const throw()
+ { return do_always_noconv(); }
+
+ int
+ length(state_type& state, const extern_type* from,
+ const extern_type* end, size_t max) const
+ { return do_length(state, from, end, max); }
+
+ int
+ max_length() const throw()
+ { return do_max_length(); }
+
+ static locale::id id;
+
+ protected:
+ ~codecvt()
+ { }
+
+ virtual result
+ do_out(state_type& state, const intern_type* from,
+ const intern_type* from_end, const intern_type*& from_next,
+ extern_type* to, extern_type* to_limit,
+ extern_type*& to_next) const
+ {
+ while (from < from_end && to < to_limit)
+ {
+ unsigned char tmp = (state.state ^ from->val);
+ if (state.state & 0x8)
+ {
+ if (to >= to_limit - 2)
+ break;
+ *to++ = (tmp & 0x7);
+ *to++ = ((tmp >> 3) & 0x7);
+ *to++ = ((tmp >> 6) & 0x3);
+ }
+ else
+ {
+ if (to >= to_limit - 1)
+ break;
+ *to++ = (tmp & 0xf);
+ *to++ = ((tmp >> 4) & 0xf);
+ }
+ state.state = tmp;
+ ++from;
+ }
+
+ from_next = from;
+ to_next = to;
+ return (from < from_end) ? partial : ok;
+ }
+
+ virtual result
+ do_in(state_type& state, const extern_type* from,
+ const extern_type* from_end, const extern_type*& from_next,
+ intern_type* to, intern_type* to_limit,
+ intern_type*& to_next) const
+ {
+ while (from < from_end && to < to_limit)
+ {
+ unsigned char c = *from;
+ if (c & 0xc0)
+ {
+ // Unshift sequence
+ state.state &= c;
+ ++from;
+ continue;
+ }
+
+ unsigned char tmp;
+ if (state.state & 0x8)
+ {
+ if (from >= from_end - 2)
+ break;
+ tmp = (*from++ & 0x7);
+ tmp |= ((*from++ << 3) & 0x38);
+ tmp |= ((*from++ << 6) & 0xc0);
+ }
+ else
+ {
+ if (from >= from_end - 1)
+ break;
+ tmp = (*from++ & 0xf);
+ tmp |= ((*from++ << 4) & 0xf0);
+ }
+ to->val = (tmp ^ state.state);
+ state.state = tmp;
+ ++to;
+ }
+
+ from_next = from;
+ to_next = to;
+ return (from < from_end) ? partial : ok;
+ }
+
+ virtual result
+ do_unshift(state_type& state, extern_type* to, extern_type* to_limit,
+ extern_type*& to_next) const
+ {
+ for (unsigned int i = 0; i < CHAR_BIT; ++i)
+ {
+ unsigned int mask = (1 << i);
+ if (state.state & mask)
+ {
+ if (to == to_limit)
+ {
+ to_next = to;
+ return partial;
+ }
+
+ state.state &= ~mask;
+ *to++ = static_cast<unsigned char>(~mask);
+ }
+ }
+
+ to_next = to;
+ return state.state == 0 ? ok : error;
+ }
+
+ virtual int
+ do_encoding() const throw()
+ { return -1; }
+
+ virtual bool
+ do_always_noconv() const throw()
+ { return false; }
+
+ virtual int
+ do_length(state_type& state, const extern_type* from,
+ const extern_type* end, size_t max) const
+ {
+ const extern_type* beg = from;
+ while (from < end && max)
+ {
+ unsigned char c = *from;
+ if (c & 0xc0)
+ {
+ // Unshift sequence
+ state.state &= c;
+ ++from;
+ continue;
+ }
+
+ unsigned char tmp;
+ if (state.state & 0x8)
+ {
+ if (from >= end - 2)
+ break;
+ tmp = (*from++ & 0x7);
+ tmp |= ((*from++ << 3) & 0x38);
+ tmp |= ((*from++ << 6) & 0xc0);
+ }
+ else
+ {
+ if (from >= end - 1)
+ break;
+ tmp = (*from++ & 0xf);
+ tmp |= ((*from++ << 4) & 0xf0);
+ }
+ state.state = tmp;
+ --max;
+ }
+ return from - beg;
+ }
+
+ // Maximum 8 bytes unshift sequence followed by max 3 bytes for
+ // one character.
+ virtual int
+ do_max_length() const throw()
+ { return 11; }
+ };
+
+ locale::id
+ codecvt<__gnu_test::character, char, __gnu_test::conversion_state>::id;
+} // namespace std
+
+#endif // _GLIBCXX_TESTSUITE_CHARACTER_H
+
diff --git a/libstdc++-v3/testsuite/testsuite_io.h b/libstdc++-v3/testsuite/testsuite_io.h
index a499f9fedc4..e5e342eed14 100644
--- a/libstdc++-v3/testsuite/testsuite_io.h
+++ b/libstdc++-v3/testsuite/testsuite_io.h
@@ -70,8 +70,194 @@ namespace __gnu_test
bool one = this->pbase() == NULL;
bool two = this->pptr() == NULL;
return one && two;
+ }
+ };
+
+ // Used to check if basic_streambuf::pubsync() has been called.
+ // This is useful for checking if a function creates [io]stream::sentry
+ // objects, since the sentry constructors call tie()->flush().
+ class sync_streambuf : public std::streambuf
+ {
+ private:
+ bool m_sync_called;
+
+ public:
+ sync_streambuf()
+ : m_sync_called(false)
+ { }
+
+ bool sync_called() const
+ { return m_sync_called; }
+
+ protected:
+ int sync()
+ {
+ m_sync_called = true;
+ return 0;
+ }
+ };
+
+ // Throws on all overflow and underflow calls.
+ struct underflow_error: std::exception { };
+ struct overflow_error: std::exception { };
+ struct positioning_error: std::exception { };
+
+ struct fail_streambuf : std::streambuf
+ {
+ private:
+ char p[2];
+
+ public:
+ fail_streambuf()
+ {
+ p[0] = 's';
+ p[1] = char();
+ setg(p, p, p + 1);
+ }
+
+ virtual int_type underflow()
+ {
+ throw underflow_error();
+ return -1;
+ }
+
+ virtual int_type uflow()
+ {
+ throw underflow_error();
+ return -1;
}
+
+ virtual int_type
+ overflow(int_type)
+ {
+ throw overflow_error();
+ return -1;
+ }
+
+ virtual pos_type
+ seekoff(off_type, std::ios_base::seekdir, std::ios_base::openmode)
+ {
+ throw positioning_error();
+ return pos_type(off_type(-1));
+ }
+ virtual pos_type
+ seekpos(pos_type, std::ios_base::openmode)
+ {
+ throw positioning_error();
+ return pos_type(off_type(-1));
+ }
+
+ virtual int
+ sync()
+ {
+ throw positioning_error();
+ return 0;
+ }
+ };
+
+ // Facets that throw an exception for every virtual function.
+ struct facet_error: std::exception { };
+
+ class fail_num_get : public std::num_get<char>
+ {
+ typedef std::ios_base ios_base;
+
+ protected:
+ iter_type
+ do_get(iter_type a, iter_type, ios_base&, ios_base::iostate&, bool&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate&, long&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned short&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned int&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned long&) const
+ { throw facet_error(); return iter_type(); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long long&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ unsigned long long&) const
+ { throw facet_error(); return iter_type(); }
+#endif
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ float&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ double&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ long double&) const
+ { throw facet_error(); return iter_type(); }
+
+ virtual iter_type
+ do_get(iter_type, iter_type, ios_base&, ios_base::iostate& __err,
+ void*&) const
+ { throw facet_error(); return iter_type(); }
+ };
+
+ class fail_num_put : public std::num_put<char>
+ {
+ typedef std::ios_base ios_base;
+
+ protected:
+ iter_type
+ do_put(iter_type, ios_base&, char_type __fill, bool __v) const
+ { throw facet_error(); return iter_type(NULL); }
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long __v) const
+ { throw facet_error(); return iter_type(NULL); }
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, unsigned long) const
+ { throw facet_error(); return iter_type(NULL); }
+
+#ifdef _GLIBCXX_USE_LONG_LONG
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long long __v) const
+ { throw facet_error(); return iter_type(NULL); }
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, unsigned long long) const
+ { throw facet_error(); return iter_type(NULL); }
+#endif
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, double __v) const
+ { throw facet_error(); return iter_type(NULL); }
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, long double __v) const
+ { throw facet_error(); return iter_type(NULL); }
+
+ virtual iter_type
+ do_put(iter_type, ios_base&, char_type __fill, const void* __v) const
+ { throw facet_error(); return iter_type(NULL); }
};
}; // namespace __gnu_test
diff --git a/libstdc++-v3/testsuite/testsuite_performance.h b/libstdc++-v3/testsuite/testsuite_performance.h
index 9ec2f865191..f70e5274af6 100644
--- a/libstdc++-v3/testsuite/testsuite_performance.h
+++ b/libstdc++-v3/testsuite/testsuite_performance.h
@@ -185,18 +185,37 @@ namespace __gnu_test
out.setf(std::ios_base::left);
out << std::setw(25) << testname << tab;
- out << std::setw(10) << comment << tab;
+ out << std::setw(25) << comment << tab;
out.setf(std::ios_base::right);
out << std::setw(4) << t.real_time() << "r" << space;
out << std::setw(4) << t.user_time() << "u" << space;
out << std::setw(4) << t.system_time() << "s" << space;
- out << std::setw(4) << r.allocated_memory() << "mem" << space;
+ out << std::setw(8) << r.allocated_memory() << "mem" << space;
out << std::setw(4) << r.hard_page_fault() << "pf" << space;
out << std::endl;
out.close();
}
+
+ void
+ report_header(const std::string file, const std::string header)
+ {
+ const char space = ' ';
+ const char tab = '\t';
+ const char* name = "libstdc++-performance.sum";
+ std::string::const_iterator i = file.begin() + file.find_last_of('/') + 1;
+ std::string testname(i, file.end());
+
+ std::ofstream out(name, std::ios_base::app);
+
+ out.setf(std::ios_base::left);
+ out << std::setw(25) << testname << tab;
+ out << std::setw(40) << header << tab;
+
+ out << std::endl;
+ out.close();
+ }
}; // namespace __gnu_test
#endif // _GLIBCXX_PERFORMANCE_H
diff --git a/libtool.m4 b/libtool.m4
index 3a6ec825645..0312861d47f 100644
--- a/libtool.m4
+++ b/libtool.m4
@@ -607,6 +607,7 @@ cygwin* | mingw* |pw32*)
;;
darwin* | rhapsody*)
+ # this will be overwritten by pass_all, but leave it in just in case
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
@@ -617,6 +618,7 @@ darwin* | rhapsody*)
lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
;;
esac
+ lt_cv_deplibs_check_method=pass_all
;;
freebsd* )
@@ -780,8 +782,9 @@ AC_DEFUN([AC_CHECK_LIBM],
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
LIBM=
case $host in
-*-*-beos* | *-*-cygwin* | *-*-pw32*)
+*-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*)
# These system don't have libm
+ # on darwin the libm is a symbolic link to libSystem.dylib
;;
*-ncr-sysv4.3*)
AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
diff --git a/ltcf-c.sh b/ltcf-c.sh
index d60a3baa19b..2c51fd3d55c 100644
--- a/ltcf-c.sh
+++ b/ltcf-c.sh
@@ -175,16 +175,6 @@ EOF
$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*)
if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
@@ -385,10 +375,53 @@ else
fix_srcfile_path='`cygpath -w "$srcfile"`'
;;
- freebsd1*)
- ld_shlibs=no
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ # Disable shared library build on OS-X older than 10.3.
+ case $host_os in
+ darwin[1-6]*)
+ can_build_shared=no
+ ;;
+ darwin7*)
+ can_build_shared=yes
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag,
+ # it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -dynamiclib $allow_undefined_flag -o $lib $libobjs $deplibs$compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
;;
+ freebsd1*)
+ ld_shlibs=no
+ ;;
+
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -670,7 +703,7 @@ else
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_cv_prog_cc_pic='-fno-common'
+ ac_cv_prog_cc_pic='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
diff --git a/ltcf-cxx.sh b/ltcf-cxx.sh
index 3044fc39bd2..2ecd53e5758 100644
--- a/ltcf-cxx.sh
+++ b/ltcf-cxx.sh
@@ -223,6 +223,51 @@ case $host_os in
;;
esac
;;
+
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ # Disable shared library build on OS-X older than 10.3.
+ case $host_os in
+ darwin[1-6]*)
+ can_build_shared=no
+ ;;
+ darwin7*)
+ can_build_shared=yes
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+
+ # Don't fix this by using the ld -exported_symbols_list flag,
+ # it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ ;;
+
dgux*)
case $cc_basename in
ec++)
@@ -712,7 +757,7 @@ if test "$with_gcc" = yes; then
darwin* | rhapsody*)
# PIC is the default on this platform
# Common symbols not allowed in MH_DYLIB files
- lt_cv_prog_cc_pic='-fno-common'
+ ac_cv_prog_cc_pic='-fno-common'
;;
*djgpp*)
# DJGPP does not support shared libraries at all
diff --git a/ltcf-gcj.sh b/ltcf-gcj.sh
index 2d704975c86..ac4fbbca3d4 100644
--- a/ltcf-gcj.sh
+++ b/ltcf-gcj.sh
@@ -378,6 +378,49 @@ else
fix_srcfile_path='`cygpath -w "$srcfile"`'
;;
+ darwin* | rhapsody*)
+ case "$host_os" in
+ rhapsody* | darwin1.[[012]])
+ allow_undefined_flag='-undefined suppress'
+ ;;
+ *) # Darwin 1.3 on
+ if test -z ${MACOSX_DEPLOYMENT_TARGET} ; then
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ else
+ case ${MACOSX_DEPLOYMENT_TARGET} in
+ 10.[[012]])
+ allow_undefined_flag='-flat_namespace -undefined suppress'
+ ;;
+ 10.*)
+ allow_undefined_flag='-undefined dynamic_lookup'
+ ;;
+ esac
+ fi
+ ;;
+ esac
+ # Disable shared library build on OS-X older than 10.3.
+ case $host_os in
+ darwin[1-6]*)
+ can_build_shared=no
+ ;;
+ darwin7*)
+ can_build_shared=yes
+ ;;
+ esac
+ output_verbose_link_cmd='echo'
+ archive_cmds='$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring'
+ module_cmds='$CC ${wl}-bind_at_load $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags'
+ # Don't fix this by using the ld -exported_symbols_list flag, it doesn't exist in older darwin ld's
+ archive_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC -r ${wl}-bind_at_load -keep_private_externs -nostdlib -o ${lib}-master.o $libobjs~$CC -dynamiclib $allow_undefined_flag -o $lib ${lib}-master.o $deplibs $compiler_flags -install_name $rpath/$soname $verstring~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ module_expsym_cmds='sed -e "s,#.*,," -e "s,^[ ]*,," -e "s,^\(..*\),_&," < $export_symbols > $output_objdir/${libname}-symbols.expsym~$CC $allow_undefined_flag -o $lib -bundle $libobjs $deplibs$compiler_flags~nmedit -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ hardcode_direct=no
+ hardcode_automatic=yes
+ hardcode_shlibpath_var=unsupported
+ whole_archive_flag_spec='-all_load $convenience'
+ link_all_deplibs=yes
+ ;;
+
+
freebsd1*)
ld_shlibs=no
;;
@@ -628,6 +671,12 @@ fi
# built for inclusion in a dll (and should export symbols for example).
ac_cv_prog_cc_pic='-DDLL_EXPORT'
;;
+
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ ac_cv_prog_cc_pic='-fno-common'
+ ;;
amigaos*)
# FIXME: we need at least 68020 code to build shared libraries, but
# adding the `-m68020' flag to GCC prevents building anything better,
diff --git a/ltconfig b/ltconfig
index 7ed24bc0a6d..9c420ace726 100755
--- a/ltconfig
+++ b/ltconfig
@@ -965,6 +965,7 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
library_names_spec=
libname_spec='lib$name'
soname_spec=
+shrext=".so"
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
@@ -1102,13 +1103,28 @@ cygwin* | mingw* | pw32*)
darwin* | rhapsody*)
dynamic_linker="$host_os dyld"
+ lt_cv_dlopen="dyld"
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=yes
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`'
+ # Disable shared library build on OS-X older than 10.3.
+ case $host_os in
+ darwin[1-6]*)
+ can_build_shared=no
+ ;;
+ darwin7*)
+ can_build_shared=yes
+ ;;
+ esac
+ library_names_spec='${libname}${release}${versuffix}$shared_ext ${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+ soname_spec='${libname}${release}${major}$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
+ shrext='$(test .$module = .yes && echo .so || echo .dylib)'
+ sys_lib_search_path_spec=`$CC -print-search-dirs | tr "\n" "$PATH_SEPARATOR" | sed -e 's/libraries:/@libraries:/' | tr "@" "\n" | grep "^libraries:" | sed -e "s/^libraries://" -e "s,=/,/,g" -e "s,$PATH_SEPARATOR, ,g" -e "s,.*,& /lib /usr/lib /usr/local/lib,g"`
+ sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
;;
freebsd1*)
@@ -2325,6 +2341,9 @@ objext="$objext"
# Old archive suffix (normally "a").
libext="$libext"
+# Shared library suffix (normally ".so").
+shrext='$shrext'
+
# Executable file suffix (normally "").
exeext="$exeext"
diff --git a/ltmain.sh b/ltmain.sh
index 5d4281c54d2..5ccf95c7d1d 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1111,6 +1111,19 @@ EOF
finalize_command="$finalize_command $wl$qarg"
continue
;;
+ framework)
+ case $host in
+ *-*-darwin*)
+ case "$deplibs " in
+ *" $qarg.framework "*) ;;
+ *) deplibs="$deplibs $qarg.framework" # this is fixed later
+ ;;
+ esac
+ ;;
+ esac
+ prev=
+ continue
+ ;;
*)
eval "$prev=\"\$arg\""
prev=
@@ -1363,6 +1376,10 @@ EOF
prev=xlinker
continue
;;
+ -framework)
+ prev=framework
+ continue
+ ;;
# Some other compiler flag.
-* | +*)
@@ -1841,6 +1858,13 @@ EOF
*) . ./$lib ;;
esac
+ case $host in
+ *-*-darwin*)
+ # Convert "-framework foo" to "foo.framework" in dependency_libs
+ test -n "$dependency_libs" && dependency_libs=`$echo "X$dependency_libs" | $Xsed -e 's/-framework \([^ $]*\)/\1.framework/g'`
+ ;;
+ esac
+
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test $linkmode = oldlib && test $linkmode = obj; }; then
@@ -2446,6 +2470,7 @@ EOF
case $outputname in
lib*)
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
;;
*)
@@ -2457,6 +2482,7 @@ EOF
if test "$need_lib_prefix" != no; then
# Add the "lib" prefix for modules if required
name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+ eval shared_ext=\"$shrext\"
eval libname=\"$libname_spec\"
else
libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -2644,7 +2670,16 @@ EOF
# Clear the version info if we defaulted, and they specified a release.
if test -z "$vinfo" && test -n "$release"; then
major=
- verstring="0.0"
+ case $version_type in
+ darwin)
+ # we can't check for "0.0" in archive_cmds due to quoting
+ # problems, so we reset it completely
+ verstring=
+ ;;
+ *)
+ verstring="0.0"
+ ;;
+ esac
if test "$need_version" = no; then
versuffix=
else
@@ -3020,6 +3055,14 @@ EOF
fi
fi
fi
+ # Time to change all our "foo.framework" stuff back to "-framework foo"
+ case $host in
+ *-*-darwin*)
+ newdeplibs=`$echo "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+ dependency_libs=`$echo "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+ ;;
+ esac
+ # Done checking deplibs!
# Done checking deplibs!
deplibs=$newdeplibs
fi
@@ -3088,6 +3131,7 @@ EOF
# Get the real and link names of the library.
eval library_names=\"$library_names_spec\"
+ eval shared_ext=\"$shrext\"
set dummy $library_names
realname="$2"
shift; shift
@@ -3533,6 +3577,19 @@ EOF
;;
esac
+ case $host in
+ *-*-darwin*)
+ # Don't allow lazy linking, it breaks C++ global constructors
+ if test "$tagname" = CXX ; then
+ compile_command="$compile_command ${wl}-bind_at_load"
+ finalize_command="$finalize_command ${wl}-bind_at_load"
+ fi
+ # Time to change all our "foo.framework" stuff back to "-framework foo"
+ compile_deplibs=`$echo "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+ finalize_deplibs=`$echo "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).framework% -framework \1%g'`
+ ;;
+ esac
+
compile_command="$compile_command $compile_deplibs"
finalize_command="$finalize_command $finalize_deplibs"
diff --git a/maintainer-scripts/ChangeLog b/maintainer-scripts/ChangeLog
index 744a3c8b5c8..c67a0408385 100644
--- a/maintainer-scripts/ChangeLog
+++ b/maintainer-scripts/ChangeLog
@@ -1,3 +1,7 @@
+2003-11-02 Gerald Pfeifer <gerald@pfeifer.com>
+
+ * maintainer-addresses: New script.
+
2003-10-24 Kelley Cook <kcook@gcc.gnu.org>
* gcc_release (build_sources): Use --enable-generated-files-in-srcdir.
diff --git a/maintainer-scripts/maintainer-addresses b/maintainer-scripts/maintainer-addresses
new file mode 100755
index 00000000000..e57f2d50c50
--- /dev/null
+++ b/maintainer-scripts/maintainer-addresses
@@ -0,0 +1,25 @@
+#! /usr/bin/perl -w -T
+#
+# Extract all maintainers' addresses from the GCC MAINTAINERS file, only
+# skipping those addresses specified in $OMIT.
+#
+# Copyright (c) 2003 Free Software Foundation.
+#
+# Written by Gerald Pfeifer <gerald@pfeifer.com>, June 2003/October 2003
+#
+# 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
+
+my $OMIT='rms@gnu.org|config-patches@gnu.org';
+
+( @ARGV == 1 && -e $ARGV[0] ) || die "usage: $0 MAINTAINERS";
+
+while( <> ) {
+ chomp;
+
+ if( /([\w\d.+-]+@[\w\d.-]+)/ ) {
+ my $addr=$1;
+ printf $addr."\n" if( not $addr =~ /$OMIT/ );
+ }
+}